agents-relay 1.0.0

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 (62) hide show
  1. package/.github/workflows/publish.yml +91 -0
  2. package/AGENTS.md +16 -0
  3. package/LICENSE +21 -0
  4. package/README.md +102 -0
  5. package/dist/adapters.js +311 -0
  6. package/dist/cli.js +455 -0
  7. package/dist/continuation.js +21 -0
  8. package/dist/dashboard.js +446 -0
  9. package/dist/events.js +36 -0
  10. package/dist/github-auth.js +34 -0
  11. package/dist/github-webhook.js +47 -0
  12. package/dist/markers.js +42 -0
  13. package/dist/planner.js +172 -0
  14. package/dist/pool.js +98 -0
  15. package/dist/reconciler.js +434 -0
  16. package/dist/registry.js +27 -0
  17. package/dist/relayd.js +177 -0
  18. package/dist/scheduler.js +49 -0
  19. package/dist/store.js +586 -0
  20. package/dist/types.js +6 -0
  21. package/dist/usage.js +370 -0
  22. package/dist/workspace.js +76 -0
  23. package/docs/agent-network.md +34 -0
  24. package/docs/architecture.md +120 -0
  25. package/docs/autonomous-objective-jobs.md +121 -0
  26. package/docs/example.md +30 -0
  27. package/docs/github-app-rate-limit.md +124 -0
  28. package/docs/service.md +43 -0
  29. package/pack.json +326 -0
  30. package/package.json +14 -0
  31. package/scripts/npm-version.mjs +11 -0
  32. package/skills/agents-relay/SKILL.md +77 -0
  33. package/skills/agents-relay/agents/planner.agent.md +28 -0
  34. package/src/adapters.ts +231 -0
  35. package/src/cli.ts +324 -0
  36. package/src/continuation.ts +6 -0
  37. package/src/dashboard.ts +421 -0
  38. package/src/events.ts +25 -0
  39. package/src/github-auth.ts +35 -0
  40. package/src/github-webhook.ts +37 -0
  41. package/src/markers.ts +33 -0
  42. package/src/planner.ts +150 -0
  43. package/src/pool.ts +87 -0
  44. package/src/reconciler.ts +235 -0
  45. package/src/registry.ts +35 -0
  46. package/src/relayd.ts +137 -0
  47. package/src/scheduler.ts +27 -0
  48. package/src/store.ts +526 -0
  49. package/src/types.ts +45 -0
  50. package/src/usage.ts +385 -0
  51. package/src/workspace.ts +62 -0
  52. package/test/adapters.test.js +303 -0
  53. package/test/autonomous.test.js +119 -0
  54. package/test/core.test.js +363 -0
  55. package/test/dashboard.test.js +178 -0
  56. package/test/github-auth.test.js +51 -0
  57. package/test/github-webhook.test.js +21 -0
  58. package/test/service.test.js +116 -0
  59. package/test/store.test.js +390 -0
  60. package/test/usage.test.js +88 -0
  61. package/test/workspace.test.js +95 -0
  62. package/tsconfig.json +4 -0
@@ -0,0 +1,121 @@
1
+ # Autonomous Objective-Driven Jobs
2
+
3
+ This document records the design, implementation flow, recovery semantics, and validation of autonomous objective-driven jobs in Agents Relay.
4
+
5
+ ## Objective
6
+
7
+ Existing jobs remain `fixed` by default. An `autonomous` job may grow its own durable task tree until the objective is satisfied. Planning is represented by real tasks rather than hidden generations or a second state store. GitHub-backed durable state remains authoritative.
8
+
9
+ ## Design principles
10
+
11
+ - `executionMode` is explicitly `fixed` or `autonomous`; legacy jobs deserialize as `fixed`.
12
+ - A planner is a real durable task (`kind: planner`) in the same parent/subtask hierarchy as execution work.
13
+ - Reconciliation owns liveness: it decides when another planner is required, including after daemon restart or a missed wake-up.
14
+ - The planner owns reasoning: it returns `objective_status`, an assessment, and typed `next_tasks`.
15
+ - The default planner is the installable `skills/agents-relay/agents/planner.agent.md` agent contract shipped with the npm package; runtime command configuration is only an override.
16
+ - `in_progress` creates durable child work; `satisfied` stops growth but does not bypass normal completion gates.
17
+ - Failed or blocked work prevents autonomous completion and prevents blindly creating another planning round.
18
+ - Planner and generated task creation are idempotent so repeated reconciliation does not duplicate work.
19
+
20
+ ## Autonomous lifecycle
21
+
22
+ ```mermaid
23
+ flowchart TD
24
+ A[Job created] --> B{executionMode}
25
+ B -->|fixed| C[Existing fixed-job scheduler]
26
+ B -->|autonomous| D[Reconciliation]
27
+ D --> E{Runnable execution work?}
28
+ E -->|yes| F[Run durable tasks]
29
+ F --> D
30
+ E -->|no| G{Failed or blocked work?}
31
+ G -->|yes| H[Remain open for recovery]
32
+ G -->|no| I{Active planner?}
33
+ I -->|yes| J[Wait for planner outcome]
34
+ I -->|no| K[Create durable planner task]
35
+ K --> L[Run planner]
36
+ L --> M{objective_status}
37
+ M -->|in_progress| N[Create typed child tasks]
38
+ N --> D
39
+ M -->|satisfied| O[Existing completion gates]
40
+ O -->|pass| P[Eligible for normal completion]
41
+ O -->|fail| H
42
+ ```
43
+
44
+ ## Durable hierarchy
45
+
46
+ Planning causality is visible directly in the existing task tree. No wave/generation abstraction is introduced.
47
+
48
+ ```mermaid
49
+ graph TD
50
+ J[Autonomous Job] --> P1[planner-1]
51
+ P1 --> T1[implementation task]
52
+ P1 --> T2[test task]
53
+ P1 --> P2[planner-2]
54
+ P2 --> T3[remediation task]
55
+ P2 --> P3[planner-3: satisfied]
56
+ ```
57
+
58
+ Each planner result is persisted with its assessment and generated work. Stable generated task IDs plus durable append semantics make replay safe.
59
+
60
+ ## Reconciliation and restart recovery
61
+
62
+ The daemon does not depend on a planner remembering to schedule its successor. Reconciliation reconstructs the next action from durable state.
63
+
64
+ ```mermaid
65
+ sequenceDiagram
66
+ participant W as Webhook/Startup/Watchdog
67
+ participant R as Reconciler
68
+ participant S as Durable Store
69
+ participant P as Planner
70
+ participant X as Worker
71
+ W->>R: wake/reconcile
72
+ R->>S: load job + task tree
73
+ alt lost or expired execution lease
74
+ R->>S: reclaim to READY or terminal failure
75
+ end
76
+ alt autonomous subtree settled
77
+ R->>S: append planner task idempotently
78
+ R->>P: execute planner
79
+ P-->>R: in_progress + next_tasks
80
+ R->>S: persist planner result + child tasks
81
+ R->>X: launch READY child work
82
+ else objective satisfied
83
+ R->>S: persist satisfied planner result
84
+ R->>R: apply normal completion gates
85
+ end
86
+ ```
87
+
88
+ A restarted daemon can reclaim a durable planner lease owned by the previous runtime. Repeated reconciliation observes existing planner/task markers instead of creating duplicate work.
89
+
90
+ ## Completion semantics
91
+
92
+ Planner satisfaction is evidence about the objective, not authority to close the job. The existing job lifecycle remains authoritative. An autonomous job can stop growing only after a planner reports `satisfied`; it can complete only when the normal completion conditions also allow it. Failed or blocked tasks remain visible and prevent accidental success.
93
+
94
+ ## Compatibility and surfaces
95
+
96
+ Fixed jobs retain their previous scheduling behavior. Execution mode and planner state are serialized in durable markers, exposed through CLI/status data, and surfaced in the dashboard. Legacy markers without an execution mode are interpreted as `fixed`.
97
+
98
+ ## Implementation sequence
99
+
100
+ ```mermaid
101
+ flowchart LR
102
+ A[Add durable execution mode] --> B[Add planner result/task model]
103
+ B --> C[Integrate planner with reconciler]
104
+ C --> D[Add idempotent child creation]
105
+ D --> E[Add restart recovery]
106
+ E --> F[Expose CLI/status/dashboard]
107
+ F --> G[Update documentation]
108
+ G --> H[Build + full test suite]
109
+ ```
110
+
111
+ ## Validation
112
+
113
+ The completed branch was validated with `npm test`, which runs the TypeScript build before the Node test suite. Final result on 2026-09-19:
114
+
115
+ - TypeScript build: passed.
116
+ - Tests: **108 passed, 0 failed, 0 skipped/cancelled**.
117
+ - Focused coverage includes marker round-trip and legacy defaults, fixed-job compatibility, autonomous task-tree growth, stable/idempotent generated task IDs, restart planner-lease recovery, objective satisfaction, and failed/blocked completion gates.
118
+
119
+ ## Follow-up
120
+
121
+ GitHub API quota exhaustion prevented managed PR bootstrap during this implementation. The feature was therefore completed and validated on `feat/autonomous-objective-jobs`; managed PR/job bootstrap can be retried after quota recovery. The next P0 work is intentionally separate: GitHub App authentication and reducing residual GitHub API consumption while retaining webhook-driven targeted reconciliation.
@@ -0,0 +1,30 @@
1
+ # Local dogfood
2
+
3
+ ```sh
4
+ npx agents-relay init --file /tmp/agents-relay.json --id dogfood --title "Local dogfood"
5
+ npx agents-relay submit --file /tmp/agents-relay.json --task-id build --input "echo build" --adapter shell
6
+ npx agents-relay reconcile --file /tmp/agents-relay.json
7
+ npx agents-relay status --file /tmp/agents-relay.json
8
+ ```
9
+
10
+ Autonomous local jobs use the same file and task tree. The mode is durable and
11
+ defaults to fixed:
12
+
13
+ ```sh
14
+ npx agents-relay init --file /tmp/agents-relay-auto.json --id auto --title "Objective" --mode autonomous
15
+ npx agents-relay reconcile --file /tmp/agents-relay-auto.json --planner-command ./planner.sh
16
+ npx agents-relay status --file /tmp/agents-relay-auto.json
17
+ ```
18
+
19
+ `planner.sh` reads the current objective/task snapshot from stdin and prints a
20
+ typed planner result. Its `next_tasks` IDs must remain stable across retries.
21
+
22
+ For a nested task, submit `--parent build --deps build`; reconciliation releases it only after `build` succeeds.
23
+
24
+ The same flow against the dogfood PR is:
25
+
26
+ ```sh
27
+ npx agents-relay init --repo lalalic/agents-relay --pr 1 --id agents-relay-dev-20260918-1302 --title "Dogfood"
28
+ npx agents-relay submit --repo lalalic/agents-relay --pr 1 --id agents-relay-dev-20260918-1302 --task-id safe-shell --input "printf dogfood" --adapter shell --capabilities shell
29
+ npx agents-relay reconcile --repo lalalic/agents-relay --pr 1 --id agents-relay-dev-20260918-1302
30
+ ```
@@ -0,0 +1,124 @@
1
+ # GitHub App Authentication and API Consumption
2
+
3
+ Agents Relay can authenticate GitHub API traffic with a GitHub App installation instead of consuming the interactive user account quota. This document also records the API-consumption changes that make webhook-driven reconciliation the normal path.
4
+
5
+ ## Goals
6
+
7
+ - Separate automation API traffic from the developer's interactive GitHub identity.
8
+ - Cache GitHub App installation tokens instead of minting one per request.
9
+ - Apply the same rate-limit cooldown to REST and GraphQL calls.
10
+ - Stop periodic dashboard refreshes from causing workspace-wide GitHub scans.
11
+ - Keep webhook wakes targeted to a repository and pull request.
12
+ - Retain a low-frequency watchdog and startup reconciliation for missed events/restarts.
13
+ - Preserve existing `gh` authentication when GitHub App settings are not configured.
14
+
15
+ ## Authentication flow
16
+
17
+ ```mermaid
18
+ sequenceDiagram
19
+ participant R as Agents Relay
20
+ participant K as App private key
21
+ participant G as GitHub App API
22
+ participant I as Installation API
23
+ R->>K: read configured PEM key
24
+ R->>R: create RS256 JWT
25
+ R->>I: POST installation access token
26
+ I-->>R: installation token + expiry
27
+ R->>R: cache token until near expiry
28
+ R->>G: REST / GraphQL using installation token
29
+ Note over R,G: existing gh login remains fallback when App auth is absent
30
+ ```
31
+
32
+ The JWT uses a 60-second backdated `iat` and an expiry nine minutes in the future. Installation tokens are cached and refreshed only when fewer than five minutes remain. No private key or token is written to durable PR state.
33
+
34
+ ## Configuration
35
+
36
+ All three GitHub App settings are required together. They can be provided as CLI flags or environment variables. CLI flags take precedence.
37
+
38
+ | CLI flag | Environment variable | Meaning |
39
+ | --- | --- | --- |
40
+ | `--github-app-id` | `AGENTS_RELAY_GITHUB_APP_ID` | GitHub App ID |
41
+ | `--github-app-installation-id` | `AGENTS_RELAY_GITHUB_APP_INSTALLATION_ID` | Installation ID for the account/repositories |
42
+ | `--github-app-private-key-file` | `AGENTS_RELAY_GITHUB_APP_PRIVATE_KEY_FILE` | Local PEM private-key path |
43
+ | `--trusted-authors` | `AGENTS_RELAY_TRUSTED_AUTHORS` | Extra trusted marker authors |
44
+
45
+ Example:
46
+
47
+ ```bash
48
+ export AGENTS_RELAY_GITHUB_APP_ID=123456
49
+ export AGENTS_RELAY_GITHUB_APP_INSTALLATION_ID=7890123
50
+ export AGENTS_RELAY_GITHUB_APP_PRIVATE_KEY_FILE=$HOME/.config/agents-relay/github-app.pem
51
+ npx agents-relayd --workspace ~/Workspace
52
+ ```
53
+
54
+ When App auth is enabled, Agents Relay trusts both the App bot identity and the current local `gh` user (when one exists). This keeps existing durable markers readable during migration from user auth to App auth.
55
+
56
+ ## Rate-limit behavior
57
+
58
+ REST and GraphQL now share one cooldown circuit. A rate-limit/secondary-limit/HTTP 429 failure activates exponential cooldown (one minute initially, capped at fifteen minutes). While cooldown is active, workspace refresh/reconciliation uses cached state rather than continuing to spend requests.
59
+
60
+ ```mermaid
61
+ flowchart TD
62
+ A[GitHub request] --> B{Cooldown active?}
63
+ B -->|yes| C[Return cached/degraded state]
64
+ B -->|no| D[REST or GraphQL request]
65
+ D --> E{Rate-limit failure?}
66
+ E -->|yes| F[Increase cooldown]
67
+ F --> C
68
+ E -->|no| G[Reset failure backoff]
69
+ G --> H[Persist/serve fresh state]
70
+ ```
71
+
72
+ ## Webhook-first consumption model
73
+
74
+ The workspace daemon previously had several independent paths that could trigger broad GitHub reads: the five-minute watchdog, dashboard `/api/jobs` refreshes, startup discovery, and webhook reconciliation. The new flow keeps broad discovery exceptional.
75
+
76
+ ```mermaid
77
+ flowchart LR
78
+ S[Daemon startup] --> A[One workspace discovery]
79
+ A --> B[Reconcile discovered state directly]
80
+ W[GitHub webhook] --> T[Target exact repository + PR]
81
+ T --> R[Targeted reconciliation]
82
+ R --> C[Update durable state]
83
+ D[Dashboard auto refresh] --> K[Read local cache]
84
+ M[Manual Jobs refresh] --> A
85
+ F[30-minute webhook watchdog] --> A
86
+ ```
87
+
88
+ Key changes:
89
+
90
+ - Startup discovery is reused directly for startup reconciliation, avoiding a second immediate workspace scan.
91
+ - Dashboard automatic refresh reads the in-process/disk cache. Only an explicit Jobs refresh asks for a broad refresh.
92
+ - Selected-job refresh remains targeted to that job's pull request.
93
+ - Webhook mode uses a 30-minute watchdog by default instead of five minutes; `--interval` still overrides it.
94
+ - Without webhook configuration, the existing five-minute watchdog remains for compatibility.
95
+ - Full discovery queries every open PR but only the 20 most recently updated closed PRs; it no longer paginates the complete closed PR history.
96
+
97
+ ## Discovery query shape
98
+
99
+ ```mermaid
100
+ flowchart TD
101
+ Q[Repository discovery] --> O[OPEN PR connection]
102
+ O -->|paginate until complete| OM[Managed open jobs]
103
+ Q --> C[20 most recent CLOSED PRs]
104
+ C --> CM[Recent terminal jobs]
105
+ OM --> D[Dashboard/reconciliation set]
106
+ CM --> D
107
+ ```
108
+
109
+ This keeps all active managed jobs discoverable while bounding historical reads needed for dashboard history and missed terminal lifecycle recovery. Webhooks remain the primary path for immediate merge/close transitions.
110
+
111
+ ## Failure and migration behavior
112
+
113
+ - Partial App configuration fails fast; Agents Relay will not silently mix identities.
114
+ - If App authentication is not configured, existing local `gh` authentication is unchanged.
115
+ - If GitHub becomes rate limited, dashboard data remains available from cache and the daemon stops broad retries until cooldown expires.
116
+ - The private key is read locally and used only to sign App JWTs. Durable GitHub comments never contain the key, JWT, or installation token.
117
+
118
+ ## Validation
119
+
120
+ Coverage includes App-config validation, RS256 JWT signature/claims, existing fixed/auth fallback behavior, dashboard manual-vs-cached refresh wiring, startup reconciliation reuse without a second workspace scan, targeted webhook reconciliation, and open-PR pagination with bounded closed history. Run the full suite with:
121
+
122
+ ```bash
123
+ npm test
124
+ ```
@@ -0,0 +1,43 @@
1
+ # Running the service
2
+
3
+ `agents-relayd` starts the repository worker pool, event-driven reconciler, periodic recovery watchdog, and dashboard. With no `--pr`/`--id`, it discovers Git repositories under `~/Workspace` (or `--workspace PATH`), maps GitHub `origin` remotes to repositories, and watches all discovered repositories together. It listens on `127.0.0.1:8787` by default. With a GitHub webhook configured, targeted webhook reconciliation is primary and the broad recovery watchdog runs every 30 minutes by default; without a webhook, the compatibility watchdog remains 5 minutes. Dashboard auto-refresh and periodic SSE snapshots use cached workspace state instead of broad GitHub reads. Explicit Jobs refresh performs broad discovery, while selected-job refresh is targeted to one pull request.
4
+
5
+ The dashboard reads a bounded window (one day by default, or `--usage-window-days`) of local Codex JSONL session telemetry at `/api/usage`. Requests recorded with GLM models are shown as Z.ai runtime usage; account quota and remaining balance are marked unavailable unless a supported source is added.
6
+
7
+ ```sh
8
+ npx agents-relayd --repo OWNER/REPO
9
+ ```
10
+
11
+ Workspace mode (the default):
12
+
13
+ ```sh
14
+ npx agents-relayd --workspace ~/Workspace
15
+ ```
16
+
17
+ Use `--repo OWNER/REPO` to retain the single-repository worker pool. Legacy single-job daemon mode remains available with `--repo OWNER/REPO --pr NUMBER --id JOB_ID`.
18
+
19
+ Use service overrides as needed:
20
+
21
+ ```sh
22
+ npx agents-relayd --repo OWNER/REPO \
23
+ --port 8787 --interval 1800000 --refresh-ms 300000 \
24
+ --events nats --nats-url nats://127.0.0.1:4222
25
+ ```
26
+
27
+ For an installed package, launch through the package binary rather than a checkout path:
28
+
29
+ ```sh
30
+ npx --package agents-relay agents-relayd --repo OWNER/REPO
31
+ ```
32
+
33
+ With PM2:
34
+
35
+ ```sh
36
+ npx --package agents-relay --package pm2 pm2 start agents-relayd --name agents-relayd -- \
37
+ --repo OWNER/REPO \
38
+ --events nats --nats-url nats://127.0.0.1:4222
39
+ ```
40
+
41
+ PM2 forwards `SIGINT` and `SIGTERM`. The service clears its watchdog, unsubscribes from wake events, closes the local dashboard server, and exits only after cleanup.
42
+
43
+ GitHub App installation authentication and the webhook/cache consumption model are documented in [github-app-rate-limit.md](github-app-rate-limit.md).
package/pack.json ADDED
@@ -0,0 +1,326 @@
1
+ [
2
+ {
3
+ "id": "agents-relay@1.0.0",
4
+ "name": "agents-relay",
5
+ "version": "1.0.0",
6
+ "size": 139459,
7
+ "unpackedSize": 558932,
8
+ "shasum": "5226a077ca94674bad5c7ceb2755d2dee30a4a16",
9
+ "integrity": "sha512-EV0VBLgoqprIeDjTm+cW/0sefNFLGoPMSFYluWknICMaUOV6uxXiR6E/WJRuP+mTkXc9XmcmBeJbnSQtGtZbcQ==",
10
+ "filename": "agents-relay-1.0.0.tgz",
11
+ "files": [
12
+ {
13
+ "path": ".github/workflows/publish.yml",
14
+ "size": 3469,
15
+ "mode": 420
16
+ },
17
+ {
18
+ "path": "AGENTS.md",
19
+ "size": 955,
20
+ "mode": 420
21
+ },
22
+ {
23
+ "path": "LICENSE",
24
+ "size": 1065,
25
+ "mode": 420
26
+ },
27
+ {
28
+ "path": "README.md",
29
+ "size": 8465,
30
+ "mode": 420
31
+ },
32
+ {
33
+ "path": "dist/adapters.js",
34
+ "size": 13461,
35
+ "mode": 420
36
+ },
37
+ {
38
+ "path": "dist/cli.js",
39
+ "size": 26305,
40
+ "mode": 493
41
+ },
42
+ {
43
+ "path": "dist/continuation.js",
44
+ "size": 1476,
45
+ "mode": 420
46
+ },
47
+ {
48
+ "path": "dist/dashboard.js",
49
+ "size": 39154,
50
+ "mode": 420
51
+ },
52
+ {
53
+ "path": "dist/events.js",
54
+ "size": 2789,
55
+ "mode": 420
56
+ },
57
+ {
58
+ "path": "dist/github-auth.js",
59
+ "size": 1746,
60
+ "mode": 420
61
+ },
62
+ {
63
+ "path": "dist/github-webhook.js",
64
+ "size": 2038,
65
+ "mode": 420
66
+ },
67
+ {
68
+ "path": "dist/markers.js",
69
+ "size": 1996,
70
+ "mode": 420
71
+ },
72
+ {
73
+ "path": "dist/planner.js",
74
+ "size": 8790,
75
+ "mode": 420
76
+ },
77
+ {
78
+ "path": "dist/pool.js",
79
+ "size": 5469,
80
+ "mode": 420
81
+ },
82
+ {
83
+ "path": "dist/reconciler.js",
84
+ "size": 25047,
85
+ "mode": 420
86
+ },
87
+ {
88
+ "path": "dist/registry.js",
89
+ "size": 1800,
90
+ "mode": 420
91
+ },
92
+ {
93
+ "path": "dist/relayd.js",
94
+ "size": 10056,
95
+ "mode": 493
96
+ },
97
+ {
98
+ "path": "dist/scheduler.js",
99
+ "size": 2869,
100
+ "mode": 420
101
+ },
102
+ {
103
+ "path": "dist/store.js",
104
+ "size": 30955,
105
+ "mode": 420
106
+ },
107
+ {
108
+ "path": "dist/types.js",
109
+ "size": 1043,
110
+ "mode": 420
111
+ },
112
+ {
113
+ "path": "dist/usage.js",
114
+ "size": 16829,
115
+ "mode": 420
116
+ },
117
+ {
118
+ "path": "dist/workspace.js",
119
+ "size": 2684,
120
+ "mode": 420
121
+ },
122
+ {
123
+ "path": "docs/agent-network.md",
124
+ "size": 2556,
125
+ "mode": 420
126
+ },
127
+ {
128
+ "path": "docs/architecture.md",
129
+ "size": 7632,
130
+ "mode": 420
131
+ },
132
+ {
133
+ "path": "docs/autonomous-objective-jobs.md",
134
+ "size": 5702,
135
+ "mode": 420
136
+ },
137
+ {
138
+ "path": "docs/example.md",
139
+ "size": 1413,
140
+ "mode": 420
141
+ },
142
+ {
143
+ "path": "docs/github-app-rate-limit.md",
144
+ "size": 6030,
145
+ "mode": 420
146
+ },
147
+ {
148
+ "path": "docs/service.md",
149
+ "size": 2255,
150
+ "mode": 420
151
+ },
152
+ {
153
+ "path": "pack.json",
154
+ "size": 0,
155
+ "mode": 420
156
+ },
157
+ {
158
+ "path": "package.json",
159
+ "size": 562,
160
+ "mode": 420
161
+ },
162
+ {
163
+ "path": "scripts/npm-version.mjs",
164
+ "size": 420,
165
+ "mode": 493
166
+ },
167
+ {
168
+ "path": "skills/agents-relay/agents/planner.agent.md",
169
+ "size": 1265,
170
+ "mode": 420
171
+ },
172
+ {
173
+ "path": "skills/agents-relay/SKILL.md",
174
+ "size": 6747,
175
+ "mode": 420
176
+ },
177
+ {
178
+ "path": "src/adapters.ts",
179
+ "size": 13759,
180
+ "mode": 420
181
+ },
182
+ {
183
+ "path": "src/cli.ts",
184
+ "size": 27102,
185
+ "mode": 420
186
+ },
187
+ {
188
+ "path": "src/continuation.ts",
189
+ "size": 1842,
190
+ "mode": 420
191
+ },
192
+ {
193
+ "path": "src/dashboard.ts",
194
+ "size": 38466,
195
+ "mode": 420
196
+ },
197
+ {
198
+ "path": "src/events.ts",
199
+ "size": 3820,
200
+ "mode": 420
201
+ },
202
+ {
203
+ "path": "src/github-auth.ts",
204
+ "size": 2083,
205
+ "mode": 420
206
+ },
207
+ {
208
+ "path": "src/github-webhook.ts",
209
+ "size": 2353,
210
+ "mode": 420
211
+ },
212
+ {
213
+ "path": "src/markers.ts",
214
+ "size": 2145,
215
+ "mode": 420
216
+ },
217
+ {
218
+ "path": "src/planner.ts",
219
+ "size": 9322,
220
+ "mode": 420
221
+ },
222
+ {
223
+ "path": "src/pool.ts",
224
+ "size": 5653,
225
+ "mode": 420
226
+ },
227
+ {
228
+ "path": "src/reconciler.ts",
229
+ "size": 23541,
230
+ "mode": 420
231
+ },
232
+ {
233
+ "path": "src/registry.ts",
234
+ "size": 2288,
235
+ "mode": 420
236
+ },
237
+ {
238
+ "path": "src/relayd.ts",
239
+ "size": 9864,
240
+ "mode": 493
241
+ },
242
+ {
243
+ "path": "src/scheduler.ts",
244
+ "size": 2877,
245
+ "mode": 420
246
+ },
247
+ {
248
+ "path": "src/store.ts",
249
+ "size": 33718,
250
+ "mode": 420
251
+ },
252
+ {
253
+ "path": "src/types.ts",
254
+ "size": 4184,
255
+ "mode": 420
256
+ },
257
+ {
258
+ "path": "src/usage.ts",
259
+ "size": 17314,
260
+ "mode": 420
261
+ },
262
+ {
263
+ "path": "src/workspace.ts",
264
+ "size": 2734,
265
+ "mode": 420
266
+ },
267
+ {
268
+ "path": "test/adapters.test.js",
269
+ "size": 12940,
270
+ "mode": 420
271
+ },
272
+ {
273
+ "path": "test/autonomous.test.js",
274
+ "size": 8417,
275
+ "mode": 420
276
+ },
277
+ {
278
+ "path": "test/core.test.js",
279
+ "size": 37282,
280
+ "mode": 420
281
+ },
282
+ {
283
+ "path": "test/dashboard.test.js",
284
+ "size": 9291,
285
+ "mode": 420
286
+ },
287
+ {
288
+ "path": "test/github-auth.test.js",
289
+ "size": 2848,
290
+ "mode": 420
291
+ },
292
+ {
293
+ "path": "test/github-webhook.test.js",
294
+ "size": 1341,
295
+ "mode": 420
296
+ },
297
+ {
298
+ "path": "test/service.test.js",
299
+ "size": 6766,
300
+ "mode": 420
301
+ },
302
+ {
303
+ "path": "test/store.test.js",
304
+ "size": 22991,
305
+ "mode": 420
306
+ },
307
+ {
308
+ "path": "test/usage.test.js",
309
+ "size": 4797,
310
+ "mode": 420
311
+ },
312
+ {
313
+ "path": "test/workspace.test.js",
314
+ "size": 5871,
315
+ "mode": 420
316
+ },
317
+ {
318
+ "path": "tsconfig.json",
319
+ "size": 280,
320
+ "mode": 420
321
+ }
322
+ ],
323
+ "entryCount": 62,
324
+ "bundled": []
325
+ }
326
+ ]
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "agents-relay",
3
+ "version": "1.0.0",
4
+ "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
+ "type": "module",
6
+ "bin": { "agents-relay": "dist/cli.js", "agents-relayd": "dist/relayd.js" },
7
+ "scripts": {
8
+ "build": "tsc -p tsconfig.json && chmod +x dist/cli.js dist/relayd.js",
9
+ "test": "npm run build && node --test test/*.test.js",
10
+ "dev": "tsx src/cli.ts"
11
+ },
12
+ "devDependencies": { "@types/node": "^22.10.2", "tsx": "^4.19.2", "typescript": "^5.7.2" },
13
+ "optionalDependencies": { "nats": "^2.29.0" }
14
+ }
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ export function nextPatchVersion(current) {
3
+ if (!current) return '1.0.0';
4
+ const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(current.trim());
5
+ if (!match) throw new Error(`Unsupported npm version: ${current}`);
6
+ return `${match[1]}.${match[2]}.${Number(match[3]) + 1}`;
7
+ }
8
+
9
+ if (import.meta.url === `file://${process.argv[1]}`) {
10
+ process.stdout.write(`${nextPatchVersion(process.argv[2] ?? '')}\n`);
11
+ }