spryng-agent 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. spryng_agent-0.1.1/.env.example +40 -0
  2. spryng_agent-0.1.1/.github/workflows/publish-image.yml +58 -0
  3. spryng_agent-0.1.1/.github/workflows/publish-pypi.yml +37 -0
  4. spryng_agent-0.1.1/.gitignore +19 -0
  5. spryng_agent-0.1.1/DEPLOY_AWS.md +532 -0
  6. spryng_agent-0.1.1/Dockerfile +47 -0
  7. spryng_agent-0.1.1/LOCAL_AGENT_QUICKSTART.md +86 -0
  8. spryng_agent-0.1.1/Makefile +36 -0
  9. spryng_agent-0.1.1/PKG-INFO +347 -0
  10. spryng_agent-0.1.1/README.md +321 -0
  11. spryng_agent-0.1.1/RELEASING.md +50 -0
  12. spryng_agent-0.1.1/TESTING.md +596 -0
  13. spryng_agent-0.1.1/deploy/fargate/buildspec.yml +35 -0
  14. spryng_agent-0.1.1/deploy/fargate/codebuild-ecr-policy.json +36 -0
  15. spryng_agent-0.1.1/deploy/fargate/ecs-exec-secrets-policy.json +20 -0
  16. spryng_agent-0.1.1/deploy/fargate/issue-cert.sh +63 -0
  17. spryng_agent-0.1.1/deploy/fargate/provision.sh +154 -0
  18. spryng_agent-0.1.1/deploy/fargate/taskdef.json +47 -0
  19. spryng_agent-0.1.1/docker-compose.yml +37 -0
  20. spryng_agent-0.1.1/pyproject.toml +59 -0
  21. spryng_agent-0.1.1/runner/__init__.py +10 -0
  22. spryng_agent-0.1.1/runner/agent_cli.py +160 -0
  23. spryng_agent-0.1.1/runner/claude_runner.py +335 -0
  24. spryng_agent-0.1.1/runner/codex_runner.py +142 -0
  25. spryng_agent-0.1.1/runner/config.py +68 -0
  26. spryng_agent-0.1.1/runner/finalize.py +255 -0
  27. spryng_agent-0.1.1/runner/jobs.py +169 -0
  28. spryng_agent-0.1.1/runner/main.py +648 -0
  29. spryng_agent-0.1.1/runner/models.py +159 -0
  30. spryng_agent-0.1.1/runner/spryng_client.py +181 -0
  31. spryng_agent-0.1.1/tests/__init__.py +0 -0
  32. spryng_agent-0.1.1/tests/conftest.py +66 -0
  33. spryng_agent-0.1.1/tests/fixtures/sample_job.json +28 -0
  34. spryng_agent-0.1.1/tests/mock_spryng.py +144 -0
  35. spryng_agent-0.1.1/tests/test_agent_cli.py +45 -0
  36. spryng_agent-0.1.1/tests/test_commit_guidance.py +66 -0
  37. spryng_agent-0.1.1/tests/test_engines.py +116 -0
  38. spryng_agent-0.1.1/tests/test_finalize.py +231 -0
  39. spryng_agent-0.1.1/tests/test_finalize_integration.py +145 -0
  40. spryng_agent-0.1.1/tests/test_protocol.py +225 -0
  41. spryng_agent-0.1.1/tests/test_pull.py +68 -0
  42. spryng_agent-0.1.1/tests/test_spec_drafting.py +115 -0
@@ -0,0 +1,40 @@
1
+ # claude-code-runner — operator config.
2
+ #
3
+ # Copy to .env, fill in values, then `uvicorn runner.main:app`.
4
+
5
+ # Bind address. 0.0.0.0:8088 for a sidecar container; 127.0.0.1:8088
6
+ # behind a reverse proxy.
7
+ RUNNER_HOST=0.0.0.0
8
+ RUNNER_PORT=8088
9
+
10
+ # Bearer token Spryng's adapter sends in the `Authorization` header
11
+ # on every `POST /jobs` and `POST /jobs/<id>/cancel`. Pick a random
12
+ # string (32+ bytes) and put the same value in the AgentRuntimeConfig
13
+ # row in Spryng under "Credential".
14
+ RUNNER_AUTH_TOKEN=CHANGE_ME
15
+
16
+ # Where the `claude` CLI lives. Defaults to `claude` on PATH. Point at
17
+ # a specific binary if you have multiple installs.
18
+ CLAUDE_CLI_BINARY=claude
19
+
20
+ # Working-directory root. Every job gets a fresh subdirectory under
21
+ # this path; cleaned up after the job terminates. Use a fast local
22
+ # volume (not NFS) for best subprocess performance.
23
+ RUNNER_WORKDIR_ROOT=/tmp/spryng-runs
24
+
25
+ # Job retention: how long completed/failed/cancelled jobs stay in the
26
+ # in-memory store before they're GC'd. Spryng polls during the run
27
+ # itself, so 1h is comfortably more than enough.
28
+ RUNNER_JOB_TTL_SECONDS=3600
29
+
30
+ # How often the runner polls Spryng's `/agent-runs/<id>/` to detect
31
+ # state transitions (e.g. awaiting_approval -> executing after a
32
+ # human approves). Lower = more responsive, higher = less load.
33
+ RUNNER_SPRYNG_POLL_INTERVAL_SECONDS=15
34
+
35
+ # Safety cap on outbound callbacks. The Spryng base URL is supplied
36
+ # in every job payload; this regex is matched against `scheme://host`
37
+ # to prevent SSRF if a malicious payload tries to redirect callbacks
38
+ # elsewhere. Comma-separated list of allowed hosts; '*' allows all
39
+ # (NOT recommended in prod).
40
+ RUNNER_ALLOWED_CALLBACK_HOSTS=app.spryng.io,qa.spryng.io
@@ -0,0 +1,58 @@
1
+ # Build + publish the runner image to GitHub Container Registry (GHCR) so
2
+ # customers can pull it for self-hosting (no access to the private repo / our
3
+ # ECR needed). Runs on a version tag (v0.1.0) and can be dispatched manually.
4
+ #
5
+ # After the first run, make the package public:
6
+ # GitHub → Packages → claude-code-runner → Package settings → Visibility: Public.
7
+ name: publish-image
8
+
9
+ on:
10
+ push:
11
+ tags: ['v*']
12
+ workflow_dispatch:
13
+ inputs:
14
+ tag:
15
+ description: 'Image tag (e.g. 0.1.0)'
16
+ required: true
17
+ default: '0.1.0'
18
+
19
+ jobs:
20
+ build-push:
21
+ runs-on: ubuntu-latest
22
+ permissions:
23
+ contents: read
24
+ packages: write
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+
28
+ - name: Resolve tag + image (GHCR requires a lowercase repo name)
29
+ id: meta
30
+ run: |
31
+ if [ "${{ github.event_name }}" = "push" ]; then
32
+ echo "value=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
33
+ else
34
+ echo "value=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
35
+ fi
36
+ owner_lc="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
37
+ echo "image=ghcr.io/${owner_lc}/claude-code-runner" >> "$GITHUB_OUTPUT"
38
+
39
+ - uses: docker/setup-buildx-action@v3
40
+
41
+ - name: Log in to GHCR
42
+ uses: docker/login-action@v3
43
+ with:
44
+ registry: ghcr.io
45
+ username: ${{ github.actor }}
46
+ password: ${{ secrets.GITHUB_TOKEN }}
47
+
48
+ - name: Build + push
49
+ uses: docker/build-push-action@v6
50
+ with:
51
+ context: .
52
+ platforms: linux/amd64
53
+ push: true
54
+ tags: |
55
+ ${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.value }}
56
+ ${{ steps.meta.outputs.image }}:latest
57
+ cache-from: type=gha
58
+ cache-to: type=gha,mode=max
@@ -0,0 +1,37 @@
1
+ # Publish the `spryng-agent` package to PyPI on a version tag, via PyPI
2
+ # Trusted Publishing (OIDC) — no API token stored anywhere.
3
+ #
4
+ # ONE-TIME SETUP (PyPI side, see RELEASING.md):
5
+ # PyPI → your account → Publishing → "Add a pending publisher":
6
+ # PyPI project name: spryng-agent
7
+ # Owner: ScrumDoLLC
8
+ # Repository: claude-code-runner
9
+ # Workflow name: publish-pypi.yml
10
+ # The first tagged run then creates + publishes the project.
11
+ name: publish-pypi
12
+
13
+ on:
14
+ push:
15
+ tags: ['v*']
16
+ workflow_dispatch:
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ build-publish:
23
+ runs-on: ubuntu-latest
24
+ permissions:
25
+ id-token: write # required for PyPI Trusted Publishing
26
+ contents: read
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: actions/setup-python@v5
30
+ with:
31
+ python-version: '3.12'
32
+ - name: Build sdist + wheel
33
+ run: |
34
+ python -m pip install --upgrade build
35
+ python -m build
36
+ - name: Publish to PyPI
37
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,19 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.pyo
4
+ *.egg-info/
5
+ .eggs/
6
+ build/
7
+ dist/
8
+
9
+ .env
10
+ .venv/
11
+ venv/
12
+
13
+ .pytest_cache/
14
+ .coverage
15
+ .coverage.*
16
+ htmlcov/
17
+
18
+ # Job workdirs
19
+ /tmp/spryng-runs/