"""Static strings for ``replayt init`` and generated CI snippets."""

from __future__ import annotations

INIT_GITHUB_REPLAYT_WORKFLOW = """\
# Generated by replayt init --ci github.
# Replace CHANGE_ME_MODULE:wf with your target.
name: replayt
on:
  push:
  pull_request:
jobs:
  workflow-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install 'replayt[yaml]'
      - name: Doctor (no network)
        run: replayt doctor --skip-connectivity --format json
      - name: Validate graph
        run: replayt validate CHANGE_ME_MODULE:wf --strict-graph --format json
      - name: Dry-check run
        run: replayt ci CHANGE_ME_MODULE:wf --dry-check --strict-graph --inputs-json '{}'
"""

INIT_WORKFLOW_PY = '''"""Scaffolded replayt workflow. Run with: replayt run workflow.py --inputs-json '{}'."""

from pathlib import Path

from replayt import LogMode, Runner, Workflow
from replayt.persistence import JSONLStore

wf = Workflow("my_workflow", version="1")
wf.set_initial("hello")


@wf.step("hello")
def hello(ctx):
    ctx.set("message", "ready")
    return None


if __name__ == "__main__":
    runner = Runner(wf, JSONLStore(Path(".replayt/runs")), log_mode=LogMode.redacted)
    r = runner.run(inputs={})
    print(r.run_id, r.status)
'''

INIT_ENV_EXAMPLE = """# Copy to .env and load before running (replayt does not read .env automatically).
# Example (bash): set -a && source .env && set +a
OPENAI_API_KEY=

# Optional - OpenAI-compatible API base (overrides REPLAYT_PROVIDER preset default).
# OPENAI_BASE_URL=https://openrouter.ai/api/v1

# Optional - default model (overrides provider preset default).
# REPLAYT_MODEL=anthropic/claude-sonnet-4.6

# Optional - openai | ollama | groq | together | openrouter (see README).
# For Anthropic, set OPENAI_BASE_URL to an OpenAI-compatible gateway or use the native SDK example.
# REPLAYT_PROVIDER=openrouter
"""

INIT_GITIGNORE_LINES = [".replayt/", ".env", ".venv/", "__pycache__/"]
