stitchkit 0.87.1 → 0.89.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.
- package/CHANGELOG.md +190 -0
- package/dist/agent-runtime/child-blocking.d.ts +17 -0
- package/dist/agent-runtime/child-blocking.d.ts.map +1 -0
- package/dist/agent-runtime/child-budget-policy.d.ts +23 -0
- package/dist/agent-runtime/child-budget-policy.d.ts.map +1 -0
- package/dist/agent-runtime/children-contract.d.ts +155 -0
- package/dist/agent-runtime/children-contract.d.ts.map +1 -0
- package/dist/agent-runtime/children.d.ts +4 -99
- package/dist/agent-runtime/children.d.ts.map +1 -1
- package/dist/agent-runtime/coding-shell-process.d.ts +33 -0
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -0
- package/dist/agent-runtime/coding-tool-contract.d.ts +18 -0
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-files.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-paths.d.ts +1 -1
- package/dist/agent-runtime/coding-tool-paths.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-utf8.d.ts +28 -0
- package/dist/agent-runtime/coding-tool-utf8.d.ts.map +1 -0
- package/dist/agent-runtime/contained-files.d.ts +20 -0
- package/dist/agent-runtime/contained-files.d.ts.map +1 -1
- package/dist/agent-runtime/durability-contract.d.ts +176 -0
- package/dist/agent-runtime/durability-contract.d.ts.map +1 -0
- package/dist/agent-runtime/durability-json.d.ts +3 -0
- package/dist/agent-runtime/durability-json.d.ts.map +1 -0
- package/dist/agent-runtime/durability-ledger.d.ts +16 -0
- package/dist/agent-runtime/durability-ledger.d.ts.map +1 -0
- package/dist/agent-runtime/durability-scheduler.d.ts +29 -0
- package/dist/agent-runtime/durability-scheduler.d.ts.map +1 -0
- package/dist/agent-runtime/durability.d.ts +14 -0
- package/dist/agent-runtime/durability.d.ts.map +1 -0
- package/dist/agent-runtime/event-search.d.ts.map +1 -1
- package/dist/agent-runtime/harness-contract.d.ts +37 -0
- package/dist/agent-runtime/harness-contract.d.ts.map +1 -1
- package/dist/agent-runtime/harness.d.ts +8 -0
- package/dist/agent-runtime/harness.d.ts.map +1 -1
- package/dist/agent-runtime/models.d.ts +14 -0
- package/dist/agent-runtime/models.d.ts.map +1 -1
- package/dist/agent-runtime/observability.d.ts +8 -0
- package/dist/agent-runtime/observability.d.ts.map +1 -1
- package/dist/agent-runtime/owned-provider-stream.d.ts +16 -0
- package/dist/agent-runtime/owned-provider-stream.d.ts.map +1 -0
- package/dist/agent-runtime/prompt.d.ts +23 -0
- package/dist/agent-runtime/prompt.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-internals.d.ts +16 -0
- package/dist/agent-runtime/runtime-internals.d.ts.map +1 -1
- package/dist/agent-runtime/runtime.d.ts +25 -0
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-broker.d.ts +7 -0
- package/dist/agent-runtime/sandbox-broker.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-bubblewrap-args.d.ts +9 -0
- package/dist/agent-runtime/sandbox-bubblewrap-args.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-bubblewrap-storage.d.ts +22 -0
- package/dist/agent-runtime/sandbox-bubblewrap-storage.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-bubblewrap.d.ts +14 -0
- package/dist/agent-runtime/sandbox-bubblewrap.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-coding-adapter.d.ts +15 -0
- package/dist/agent-runtime/sandbox-coding-adapter.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-coding.d.ts +15 -0
- package/dist/agent-runtime/sandbox-coding.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-contract.d.ts +93 -0
- package/dist/agent-runtime/sandbox-contract.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-process-owner.d.ts +11 -0
- package/dist/agent-runtime/sandbox-process-owner.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-process.d.ts +8 -0
- package/dist/agent-runtime/sandbox-process.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-session.d.ts +5 -0
- package/dist/agent-runtime/sandbox-session.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox.d.ts +19 -0
- package/dist/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/agent-runtime/schemas.d.ts +6 -0
- package/dist/agent-runtime/schemas.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-purge.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver.d.ts +127 -0
- package/dist/agent-runtime/store-driver.d.ts.map +1 -1
- package/dist/agent-runtime/store-events.d.ts +106 -0
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/store-migrations/v2-to-v3.d.ts +14 -0
- package/dist/agent-runtime/store-migrations/v2-to-v3.d.ts.map +1 -0
- package/dist/agent-runtime/store.d.ts +115 -0
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/agent-runtime-browser.js +5 -3
- package/dist/agent-runtime-coding-tools.js +11 -1236
- package/dist/agent-runtime-harness.d.ts +1 -1
- package/dist/agent-runtime-harness.d.ts.map +1 -1
- package/dist/agent-runtime-harness.js +69 -19
- package/dist/agent-runtime-openrouter.d.ts +3 -12
- package/dist/agent-runtime-openrouter.d.ts.map +1 -1
- package/dist/agent-runtime-openrouter.js +22 -9
- package/dist/agent-runtime-sandbox.d.ts +5 -0
- package/dist/agent-runtime-sandbox.d.ts.map +1 -0
- package/dist/agent-runtime-sandbox.js +797 -0
- package/dist/agent-runtime-sqlite-bun.js +5 -5
- package/dist/agent-runtime-sqlite-node.js +5 -5
- package/dist/agent-runtime.d.ts +6 -5
- package/dist/agent-runtime.d.ts.map +1 -1
- package/dist/agent-runtime.js +266 -69
- package/dist/application.js +26 -26
- package/dist/cli.js +8 -8
- package/dist/{index-rcgsnrr6.js → index-31jw8fjq.js} +3 -3
- package/dist/{index-9hw9eq48.js → index-7601qfg1.js} +14 -14
- package/dist/{index-3xnq72rz.js → index-7rkhw9ec.js} +14 -1
- package/dist/{index-0vfdh685.js → index-8c3a7m4g.js} +1 -1
- package/dist/{index-t7gh5w3v.js → index-bn2cjajt.js} +27 -6
- package/dist/{index-z2452tsw.js → index-bt14acb5.js} +2 -2
- package/dist/index-cp20z0n6.js +1351 -0
- package/dist/{index-9553432s.js → index-crykmqkr.js} +1 -1
- package/dist/{index-6g273pqx.js → index-fadnxwna.js} +89 -7
- package/dist/{index-p1b1y93x.js → index-gtj3zc53.js} +5 -1
- package/dist/{index-5wezxcxx.js → index-hrbajay7.js} +107 -5
- package/dist/{index-35aefxby.js → index-hw2chdvy.js} +768 -49
- package/dist/{index-0ydchz76.js → index-mnm4qp0p.js} +5 -5
- package/dist/{index-tg3m2ec5.js → index-mqv3b5rh.js} +4 -1
- package/dist/{index-1szetq6f.js → index-q3ve2d1k.js} +30 -8
- package/dist/{index-hkm6wysp.js → index-y64k3s0h.js} +1 -1
- package/dist/{index-z1m86vc8.js → index-zwkgfq1s.js} +97 -86
- package/dist/{index-wn9cb82y.js → index-zyvby92n.js} +12 -9
- package/dist/index.js +13 -13
- package/dist/server/index.js +9 -9
- package/dist/testing/agent-store-conformance.d.ts.map +1 -1
- package/dist/testing.js +69 -24
- package/dist/tool-invoker.js +6 -6
- package/dist/tools/agent.d.ts +6 -0
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/connections/define.d.ts +6 -0
- package/dist/tools/connections/define.d.ts.map +1 -0
- package/dist/tools/connections/errors.d.ts +50 -0
- package/dist/tools/connections/errors.d.ts.map +1 -0
- package/dist/tools/connections/http.d.ts +3 -0
- package/dist/tools/connections/http.d.ts.map +1 -0
- package/dist/tools/connections/index.d.ts +19 -0
- package/dist/tools/connections/index.d.ts.map +1 -0
- package/dist/tools/connections/index.js +1047 -0
- package/dist/tools/connections/instance.d.ts +3 -0
- package/dist/tools/connections/instance.d.ts.map +1 -0
- package/dist/tools/connections/json-rpc.d.ts +8 -0
- package/dist/tools/connections/json-rpc.d.ts.map +1 -0
- package/dist/tools/connections/limits.d.ts +36 -0
- package/dist/tools/connections/limits.d.ts.map +1 -0
- package/dist/tools/connections/mcp-client.d.ts +44 -0
- package/dist/tools/connections/mcp-client.d.ts.map +1 -0
- package/dist/tools/connections/mcp.d.ts +5 -0
- package/dist/tools/connections/mcp.d.ts.map +1 -0
- package/dist/tools/connections/mount.d.ts +12 -0
- package/dist/tools/connections/mount.d.ts.map +1 -0
- package/dist/tools/connections/openapi-document.d.ts +4 -0
- package/dist/tools/connections/openapi-document.d.ts.map +1 -0
- package/dist/tools/connections/openapi.d.ts +5 -0
- package/dist/tools/connections/openapi.d.ts.map +1 -0
- package/dist/tools/connections/runtime.d.ts +29 -0
- package/dist/tools/connections/runtime.d.ts.map +1 -0
- package/dist/tools/connections/schema-budget.d.ts +8 -0
- package/dist/tools/connections/schema-budget.d.ts.map +1 -0
- package/dist/tools/connections/sse-frames.d.ts +7 -0
- package/dist/tools/connections/sse-frames.d.ts.map +1 -0
- package/dist/tools/connections/sse-session.d.ts +26 -0
- package/dist/tools/connections/sse-session.d.ts.map +1 -0
- package/dist/tools/connections/ssrf.d.ts +15 -0
- package/dist/tools/connections/ssrf.d.ts.map +1 -0
- package/dist/tools/connections/types.d.ts +60 -0
- package/dist/tools/connections/types.d.ts.map +1 -0
- package/dist/tools/durability-context.d.ts +7 -0
- package/dist/tools/durability-context.d.ts.map +1 -0
- package/dist/tools/execute.d.ts +2 -0
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/registry.d.ts +38 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/runtime-tool.d.ts +4 -0
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools.d.ts +1 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +83 -26
- package/llms-full.txt +329 -14
- package/llms.txt +1 -0
- package/package.json +9 -1
- package/dist/{index-evcnmsc3.js → index-t7fkyxcr.js} +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,196 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
## [0.89.0] — 2026-09-12
|
|
19
|
+
|
|
20
|
+
### ⚠️ Breaking changes
|
|
21
|
+
|
|
22
|
+
**Who must act:** applications implementing `AgentRuntimeStore` or `AgentRuntimeStoreDriver`,
|
|
23
|
+
and applications normalizing OpenRouter usage. Custom stores add ordered once-seeding;
|
|
24
|
+
OpenRouter callers pass raw per-step usage. New durability users return lossless JSON.
|
|
25
|
+
See the 0.89.0 migration in the upgrading guide.
|
|
26
|
+
|
|
27
|
+
- **OpenRouter token provenance requires raw step usage.** `normalizeOpenRouterUsage` and the
|
|
28
|
+
runtime read original counters rather than SDK defaults. Pass `step.usage` from each
|
|
29
|
+
completed SDK step; normalized-only or aggregate records without `raw` yield unavailable
|
|
30
|
+
token counts. Missing cache/reasoning counts no longer become provider-reported zero.
|
|
31
|
+
|
|
32
|
+
- **Durability results must be lossless JSON.** `step<T>` accepts JSON-compatible types and
|
|
33
|
+
rejects non-finite numbers, negative zero, Date/class instances, undefined, sparse arrays
|
|
34
|
+
and accessors at runtime. First execution and replay return detached JSON snapshots.
|
|
35
|
+
Effect-only bodies must return `null`: `step('send', async () => { await send(); return null; })`.
|
|
36
|
+
Convert dates explicitly with `toISOString()` before returning them. Rejected results do not
|
|
37
|
+
undo external effects; idempotency remains the host's responsibility.
|
|
38
|
+
- **`AgentRuntimeStore` gains `seedConversationInput`.** A custom store adapter must implement it;
|
|
39
|
+
the memory and SQLite drivers already do. The SQLite schema moves to version 3 with an automatic
|
|
40
|
+
migration. The method writes user-role prompt instructions into a conversation's durable history
|
|
41
|
+
exactly once, ahead of the conversation, so they can be summarized by compaction and removed by a
|
|
42
|
+
history replacement instead of being re-injected on every call. → ADR 0178
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
// before: an adapter implemented the existing store members only
|
|
46
|
+
// after: add
|
|
47
|
+
async seedConversationInput({ conversationId, seedKey, inputs }) { /* … */ }
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- **A custom store driver gains a required `seeds` member.** `AgentRuntimeStoreDriver` now needs
|
|
51
|
+
`seeds: { load, create }` in addition to its history mutation, so a driver that only implemented
|
|
52
|
+
the previous members must add it. Memory, SQLite and the Prisma example implement it;
|
|
53
|
+
the public conformance kit verifies ordered once-seeding and compaction survival.
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
|
|
57
|
+
- Parallel verification no longer reaps a live supervised build before its isolated
|
|
58
|
+
PM2 home has been created; abandonment requires the lane directory to be gone.
|
|
59
|
+
- Provider silence deadlines exclude resource preparation, local tool execution and approval
|
|
60
|
+
waiting. Provider calls still time out before the first chunk and between chunks; caller
|
|
61
|
+
cancellation remains active during tools and child waits.
|
|
62
|
+
- Connection calls isolate credentials, refuse redirects, bound SSE reads and retain typed
|
|
63
|
+
authorization causes through the standard mount. Lifecycle executes once.
|
|
64
|
+
- Instruction seed budgets are counted once; partial imports fail explicitly. Coding reads
|
|
65
|
+
obey EOF byte limits, report invalid UTF-8, preserve literal replacement text and bound denied lists.
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
|
|
69
|
+
- `createSandboxCodingTools` connects the maintained coding profile to a sandbox workspace.
|
|
70
|
+
File authorization, UTF-8, shell deadlines/output/artifacts are shared with the host profile;
|
|
71
|
+
sandbox stop and command admission cover both session and coding launches.
|
|
72
|
+
- **Optional Linux process sandbox.** `stitchkit/agent-runtime/sandbox` supplies a Bubblewrap
|
|
73
|
+
backend, reusable byte-file templates, durable workspace reconnect and bounded command execution.
|
|
74
|
+
Network namespaces deny direct egress; an explicit HTTP Unix-socket gateway brokers configured
|
|
75
|
+
origin headers on the host. Existing coding tools remain unchanged. See the sandbox guide for
|
|
76
|
+
platform requirements, trusted-upstream and resource-isolation limits. → ADR 0181
|
|
77
|
+
- **Durable once-seeding of user-role instructions.** `composeAgentPrompt` reports user-role
|
|
78
|
+
sections separately and the runtime seeds them into durable history once; a retry or replay writes
|
|
79
|
+
one copy, and a history replacement does not resurrect them. → ADR 0178
|
|
80
|
+
- **The parent owns a child's blocking events.** `AgentChildManager` presents a child's approval or
|
|
81
|
+
input request on the parent once (child-local ids rewritten to parent-scoped ids, unanswered
|
|
82
|
+
siblings retained) and routes approval decisions or JSON input values back. A child harness uses
|
|
83
|
+
`blockingPresentation: 'parent'` to keep requests out of its presentation stream. The
|
|
84
|
+
`subagent` tool result and `list_agents` are proven to read one source. → ADR 0179
|
|
85
|
+
- **A local durability port for tool bodies.** `createLocalStepDurability` over the store: `step(name,
|
|
86
|
+
fn)` replays recorded JSON results. `createAgentRuntime({ durability: true })` exposes
|
|
87
|
+
`step/sleep/waitFor` in mounted handler context; a factory can replace the port. Timers and
|
|
88
|
+
event waits preserve ledger facts across host-driven recovery, with optional external-write
|
|
89
|
+
notifications. In-flight maps are store-scoped; undecodable records fail closed. → ADR 0182
|
|
90
|
+
- **External MCP and OpenAPI servers are consumable as typed tools.** The new server-only entrypoint
|
|
91
|
+
`stitchkit/tools/connections` provides `defineMcpClientConnection`, `defineOpenApiConnection` and
|
|
92
|
+
`mountConnections`: MCP over Streamable HTTP with an SSE fallback only on `400/404/405`,
|
|
93
|
+
per-call credential resolution, a typed `401` reauthorization cause while `403` passes through, OpenAPI
|
|
94
|
+
operations with bounded local references and qualified names, redirect refusal and a host guard
|
|
95
|
+
that remote specs cannot expand. Unsupported OpenAPI semantics are refused at mount. No peer
|
|
96
|
+
dependency enters `stitchkit/tools`. → ADR 0180
|
|
97
|
+
- **Prompt sections declare their authority.** `AgentPromptSection.role` (default `system`) splits
|
|
98
|
+
framework policy from caller-supplied context; `composeAgentPrompt` reports user-role sections
|
|
99
|
+
separately and the runtime carries them into provider history ahead of the durable conversation,
|
|
100
|
+
so retrieved or tenant context can no longer sit at system authority. → ADR 0178
|
|
101
|
+
- **Approval responses are authorized separately from the request.**
|
|
102
|
+
`createHeadlessAgentHarness` accepts `authorizeApprovalResponse`, a response-time policy that
|
|
103
|
+
judges the responder rather than the signature; a refusal is recorded as a durable
|
|
104
|
+
`approval/response-rejected` event with its reason and leaves the request pending for another
|
|
105
|
+
responder. Absent the policy, behaviour is unchanged. → ADR 0177
|
|
106
|
+
- **Tool compositions replace and disable built-ins by name.** `defineToolRegistry({ defaults })`
|
|
107
|
+
declares the runtime surface once and refuses a `replace`/`disable` name outside those defaults
|
|
108
|
+
instead of leaving a default silently in place; `mountAgent` accepts a `registry` in place of
|
|
109
|
+
`runtimeTools`. → ADR 0176
|
|
110
|
+
- **Coding discovery names the paths the host refuses.** `list_directory`, `glob` and
|
|
111
|
+
`search_files` gained an optional `denied` list of `{ path, kind }` — with
|
|
112
|
+
`deniedTruncated` when the list is cut — present only when there is something to report.
|
|
113
|
+
A path rejected by `authorizePath` used to vanish exactly like an absent one, so a model
|
|
114
|
+
read "the host hid this" as "this is not here". Only the name and kind travel, never
|
|
115
|
+
content, and `search_files` keeps the host's refusals apart from the include pattern's own.
|
|
116
|
+
|
|
117
|
+
### Fixed
|
|
118
|
+
|
|
119
|
+
- **`read_file` resumes on a UTF-8 boundary.** A byte window whose end fell inside a
|
|
120
|
+
multi-byte character made the fatal decoder throw, surfacing as `INTERNAL_SERVER_ERROR`
|
|
121
|
+
on some offsets and succeeding on others for the same file. The window is now aligned to a
|
|
122
|
+
character boundary — extended to the whole character when the window is smaller than one —
|
|
123
|
+
and `nextOffset` names the start of the next character, so successive windows stitch back
|
|
124
|
+
to the original file. A caller-supplied `offset` inside a character now resumes at the next
|
|
125
|
+
character boundary instead of throwing the same unnamed refusal. A file that is genuinely
|
|
126
|
+
not UTF-8 is still refused. `run_command`'s retained output is aligned the same way, on the
|
|
127
|
+
artifact path and without artifacts, so a byte budget no longer leaves a replacement glyph.
|
|
128
|
+
- **Connections enforce their declared network bounds.** `defineMcpClientConnection`'s
|
|
129
|
+
`allowHosts` is now honoured on every MCP request, and a legacy-SSE server's discovered
|
|
130
|
+
`endpoint` is host-fenced before the client POSTs a bearer token to it; requests carry a
|
|
131
|
+
default timeout and responses are size-bounded, with `ConnectionBudget.maxSchemaBytes`
|
|
132
|
+
enforced over the mounted foreign schemas. SSE framing also accepts CRLF, and a non-2xx SSE
|
|
133
|
+
POST no longer leaves an orphaned pending response.
|
|
134
|
+
- **Coding discovery scopes what it reports.** `glob` now scopes its `denied` entries to the
|
|
135
|
+
requested path, and a re-seeded conversation whose compacted seed survived without a receipt
|
|
136
|
+
resolves idempotently instead of failing a `UNIQUE` constraint.
|
|
137
|
+
- **Journal event search treats a multi-word query as all words, not one phrase.**
|
|
138
|
+
`createSqliteAgentEventSearch` quoted the whole query, so a query of two or more words
|
|
139
|
+
matched only the adjacent phrase and returned `[]` when the words merely occurred — a
|
|
140
|
+
silent zero read as "the journal never said this". Terms are now quoted individually and
|
|
141
|
+
joined with `AND`, still escaped as literal text, and a query that reduces to no terms is
|
|
142
|
+
an error rather than an empty result.
|
|
143
|
+
|
|
144
|
+
## [0.88.0] — 2026-09-10
|
|
145
|
+
|
|
146
|
+
### ⚠️ Breaking changes
|
|
147
|
+
|
|
148
|
+
**Who must act:** applications that construct an `AgentStepFinishedEvent` themselves — a test
|
|
149
|
+
double, a replay fixture, a pipeline that re-validates persisted operator events — and
|
|
150
|
+
applications that implement or mock the `AgentRuntime` interface rather than only calling the
|
|
151
|
+
one `createAgentRuntime` returns.
|
|
152
|
+
|
|
153
|
+
- **A completed step event carries its provider response identity.**
|
|
154
|
+
`AgentStepFinishedEventSchema` gains a required `response`, so an event built or re-parsed
|
|
155
|
+
without one is now refused. A step the runtime emits always has it; a persisted event from an
|
|
156
|
+
earlier version does not.
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
// before
|
|
160
|
+
{ type: 'step-finished', step: 0, usage }
|
|
161
|
+
|
|
162
|
+
// after
|
|
163
|
+
{ type: 'step-finished', step: 0, usage, response: { id: generationId } }
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
- **`AgentRuntime` gains `abandon`.** Anything typed as the whole interface must supply it.
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
// before
|
|
170
|
+
const fake: AgentRuntime = { submit, interrupt, recover, close }
|
|
171
|
+
|
|
172
|
+
// after
|
|
173
|
+
const fake: AgentRuntime = { submit, interrupt, abandon, recover, close }
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Added
|
|
177
|
+
|
|
178
|
+
- **Completed agent steps expose their provider response identity.** `step-finished.response`
|
|
179
|
+
carries the provider-assigned response ID and, when the model's adapter can name it, the selected
|
|
180
|
+
upstream provider — `AgentLanguageModelProvider.resolveResponseProvider`, which
|
|
181
|
+
`openRouterProvider` implements, so the neutral runtime never reads one gateway's metadata key.
|
|
182
|
+
The same object is retained in one `provider/response` ledger event with run, retry attempt and
|
|
183
|
+
step identity; run totals remain computed aggregates.
|
|
184
|
+
- **A zero-coverage coding search explains its filter.** `search_files.include` now publishes its
|
|
185
|
+
anchored workspace-relative glob semantics, `scannedFiles` names the post-filter count, and a
|
|
186
|
+
filter that rejected every file the scan reached returns a recovery hint without turning a valid
|
|
187
|
+
empty result into an error. An empty tree and a host-refused path produce the same empty result
|
|
188
|
+
with no hint: the number that would have blamed the pattern has three causes, and only one of
|
|
189
|
+
them is the pattern.
|
|
190
|
+
- **A known orphan run can be closed without editing its storage adapter.**
|
|
191
|
+
`runtime.abandon({ conversationId, runId, expectedRevision, staleOwner: true })`
|
|
192
|
+
applies the existing canonical abandonment transition, atomically fails the
|
|
193
|
+
assistant projection, removes the run from recovery scans and publishes its
|
|
194
|
+
state. The expected revision refuses stale operator evidence. Store
|
|
195
|
+
conformance now verifies that the canonical record and recovery index agree
|
|
196
|
+
after abandonment.
|
|
197
|
+
|
|
198
|
+
### Fixed
|
|
199
|
+
|
|
200
|
+
- **An absolute coding-tool path no longer suggests deleting one slash.** If it is inside the
|
|
201
|
+
configured workspace, the refusal carries the exact `recoveryPath`; an external absolute path
|
|
202
|
+
remains refused without a misleading replacement.
|
|
203
|
+
- **A storage failure releases the provider stream before runtime recovery I/O.** Every model
|
|
204
|
+
attempt owns a private abort signal. Abrupt consumer exit aborts that attempt before bounded
|
|
205
|
+
iterator cleanup, so a retained AI SDK tee branch cannot keep generation or the next queue lane
|
|
206
|
+
alive; cleanup failure remains secondary to the original runtime/storage failure.
|
|
207
|
+
|
|
18
208
|
## [0.87.1] — 2026-09-08
|
|
19
209
|
|
|
20
210
|
### Fixed
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type AgentChildBlockingDecision, type AgentChildBlockingEvent, type AgentChildHandle, type AgentChildRecord } from './children-contract.js';
|
|
2
|
+
import type { AgentRuntimeStore } from './store.js';
|
|
3
|
+
export declare function createChildBlockingRelay(input: {
|
|
4
|
+
store: AgentRuntimeStore;
|
|
5
|
+
now: () => Date;
|
|
6
|
+
handles: Map<string, AgentChildHandle>;
|
|
7
|
+
listChildren: (id: string) => readonly AgentChildRecord[];
|
|
8
|
+
activeChild: (parent: string, child: string) => {
|
|
9
|
+
handle: AgentChildHandle;
|
|
10
|
+
};
|
|
11
|
+
bounded: <V>(work: Promise<V> | V, fallback: V) => Promise<V>;
|
|
12
|
+
}): {
|
|
13
|
+
retireChildBlocking: (childConversationId: string) => void;
|
|
14
|
+
listChildBlocking: (parentConversationId: string) => Promise<readonly AgentChildBlockingEvent[]>;
|
|
15
|
+
respondToChildBlocking: (parentConversationId: string, decision: AgentChildBlockingDecision) => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=child-blocking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-blocking.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/child-blocking.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAG5B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAEtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,KAAK,EAAE,iBAAiB,CAAC;IACzB,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACvC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,SAAS,gBAAgB,EAAE,CAAC;IAC1D,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK;QAAE,MAAM,EAAE,gBAAgB,CAAA;KAAE,CAAC;IAC7E,OAAO,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CAC/D;+CA6BmD,MAAM,KAAG,IAAI;8CA0EvC,MAAM,KAC3B,OAAO,CAAC,SAAS,uBAAuB,EAAE,CAAC;mDAmCtB,MAAM,YAClB,0BAA0B,KACnC,OAAO,CAAC,IAAI,CAAC;EAIjB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LanguageModelUsage } from 'ai';
|
|
2
|
+
import type { AgentChildManager } from './children-contract.js';
|
|
3
|
+
import type { AgentRuntimeStopPolicy } from './runtime.js';
|
|
4
|
+
import type { AgentUsage } from './schemas.js';
|
|
5
|
+
/**
|
|
6
|
+
* The child runtime's own budget policy.
|
|
7
|
+
*
|
|
8
|
+
* `recordStepUsage` measures and decides; something has to call it at every
|
|
9
|
+
* step boundary of the child's run, and that is the child's runtime. Given to
|
|
10
|
+
* `createAgentRuntime({ loop: { stopPolicies: [agentChildBudgetStopPolicy(…)] } })`
|
|
11
|
+
* in the host that runs the child, it records the last step's usage and stops
|
|
12
|
+
* the run as `policy_stop` (`child-budget`) when the budget is spent — the
|
|
13
|
+
* enforcement the guide promises, in the package rather than in every host.
|
|
14
|
+
*/
|
|
15
|
+
export declare function agentChildBudgetStopPolicy(input: {
|
|
16
|
+
manager: Pick<AgentChildManager, 'recordStepUsage'>;
|
|
17
|
+
childConversationId: string;
|
|
18
|
+
/** Cost of a step, when a USD budget is set; tokens come from the step itself. */
|
|
19
|
+
cost?: (step: {
|
|
20
|
+
usage: LanguageModelUsage;
|
|
21
|
+
}) => AgentUsage['cost'];
|
|
22
|
+
}): AgentRuntimeStopPolicy;
|
|
23
|
+
//# sourceMappingURL=child-budget-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-budget-policy.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/child-budget-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;IACpD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kFAAkF;IAClF,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,kBAAkB,CAAA;KAAE,KAAK,UAAU,CAAC,MAAM,CAAC,CAAC;CACpE,GAAG,sBAAsB,CAqBzB"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { AgentUsage } from './schemas.js';
|
|
3
|
+
export declare const AgentChildBudgetSchema: z.ZodObject<{
|
|
4
|
+
usd: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
tokens: z.ZodOptional<z.ZodInt>;
|
|
6
|
+
milliseconds: z.ZodOptional<z.ZodInt>;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export type AgentChildBudget = z.infer<typeof AgentChildBudgetSchema>;
|
|
9
|
+
export declare const AgentChildStateSchema: z.ZodEnum<{
|
|
10
|
+
finished: "finished";
|
|
11
|
+
lost: "lost";
|
|
12
|
+
running: "running";
|
|
13
|
+
spawned: "spawned";
|
|
14
|
+
stopped: "stopped";
|
|
15
|
+
}>;
|
|
16
|
+
export type AgentChildState = z.infer<typeof AgentChildStateSchema>;
|
|
17
|
+
export declare const AgentChildRecordSchema: z.ZodObject<{
|
|
18
|
+
parentConversationId: z.ZodString;
|
|
19
|
+
childConversationId: z.ZodString;
|
|
20
|
+
seedUptoSeq: z.ZodInt;
|
|
21
|
+
state: z.ZodEnum<{
|
|
22
|
+
finished: "finished";
|
|
23
|
+
lost: "lost";
|
|
24
|
+
running: "running";
|
|
25
|
+
spawned: "spawned";
|
|
26
|
+
stopped: "stopped";
|
|
27
|
+
}>;
|
|
28
|
+
budget: z.ZodObject<{
|
|
29
|
+
usd: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
tokens: z.ZodOptional<z.ZodInt>;
|
|
31
|
+
milliseconds: z.ZodOptional<z.ZodInt>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
usage: z.ZodObject<{
|
|
34
|
+
tokens: z.ZodInt;
|
|
35
|
+
usd: z.ZodNumber;
|
|
36
|
+
milliseconds: z.ZodInt;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
resultReference: z.ZodOptional<z.ZodString>;
|
|
39
|
+
createdAt: z.ZodString;
|
|
40
|
+
updatedAt: z.ZodString;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
export type AgentChildRecord = z.infer<typeof AgentChildRecordSchema>;
|
|
43
|
+
/**
|
|
44
|
+
* A child is a separate conversation with its own harness, so an approval or
|
|
45
|
+
* input request is raised inside it. The parent owns presentation (ADR 0179):
|
|
46
|
+
* the manager relays the request to the parent once and routes the parent's
|
|
47
|
+
* answer back. This is the source shape an `AgentChildHandle` reports.
|
|
48
|
+
*/
|
|
49
|
+
export declare const AgentChildBlockingKindSchema: z.ZodEnum<{
|
|
50
|
+
approval: "approval";
|
|
51
|
+
input: "input";
|
|
52
|
+
}>;
|
|
53
|
+
export type AgentChildBlockingKind = z.infer<typeof AgentChildBlockingKindSchema>;
|
|
54
|
+
export declare const AgentChildBlockingSourceSchema: z.ZodObject<{
|
|
55
|
+
approvalId: z.ZodString;
|
|
56
|
+
callId: z.ZodString;
|
|
57
|
+
toolName: z.ZodString;
|
|
58
|
+
input: z.ZodJSONSchema;
|
|
59
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
60
|
+
approval: "approval";
|
|
61
|
+
input: "input";
|
|
62
|
+
}>>;
|
|
63
|
+
batchId: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
export type AgentChildBlockingSource = z.infer<typeof AgentChildBlockingSourceSchema>;
|
|
66
|
+
/** A blocking event as the parent presents it: the id is rewritten under the child. */
|
|
67
|
+
export declare const AgentChildBlockingEventSchema: z.ZodObject<{
|
|
68
|
+
parentConversationId: z.ZodString;
|
|
69
|
+
childConversationId: z.ZodString;
|
|
70
|
+
kind: z.ZodEnum<{
|
|
71
|
+
approval: "approval";
|
|
72
|
+
input: "input";
|
|
73
|
+
}>;
|
|
74
|
+
approvalId: z.ZodString;
|
|
75
|
+
childApprovalId: z.ZodString;
|
|
76
|
+
callId: z.ZodString;
|
|
77
|
+
toolName: z.ZodString;
|
|
78
|
+
input: z.ZodJSONSchema;
|
|
79
|
+
batchId: z.ZodString;
|
|
80
|
+
presentedAt: z.ZodString;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
export type AgentChildBlockingEvent = z.infer<typeof AgentChildBlockingEventSchema>;
|
|
83
|
+
/** The parent's answer to a presented child blocking event. */
|
|
84
|
+
export declare const ChildBlockingDecisionSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
85
|
+
approvalId: z.ZodString;
|
|
86
|
+
approved: z.ZodBoolean;
|
|
87
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
89
|
+
approvalId: z.ZodString;
|
|
90
|
+
value: z.ZodJSONSchema;
|
|
91
|
+
}, z.core.$strict>]>;
|
|
92
|
+
export type AgentChildBlockingDecision = z.infer<typeof ChildBlockingDecisionSchema>;
|
|
93
|
+
export declare function parseChild(raw: unknown): AgentChildRecord;
|
|
94
|
+
export declare function usageNumbers(usage: AgentUsage): {
|
|
95
|
+
tokens?: number;
|
|
96
|
+
usd?: number;
|
|
97
|
+
};
|
|
98
|
+
export interface AgentChildHandle {
|
|
99
|
+
result: Promise<{
|
|
100
|
+
resultReference?: string;
|
|
101
|
+
}>;
|
|
102
|
+
stopPolicy(name: string): void | Promise<void>;
|
|
103
|
+
sendMessage?(input: unknown): void | Promise<void>;
|
|
104
|
+
reachable?(): boolean | Promise<boolean>;
|
|
105
|
+
/**
|
|
106
|
+
* Child-local blocking events the parent must own. The host wires this to
|
|
107
|
+
* its child harness (`pendingApprovals`); the manager presents them on the
|
|
108
|
+
* parent and never on the child. → ADR 0179
|
|
109
|
+
*/
|
|
110
|
+
blockingEvents?(): readonly AgentChildBlockingSource[] | Promise<readonly AgentChildBlockingSource[]>;
|
|
111
|
+
/** Route the parent's answer to the child harness (`respondToApproval`). */
|
|
112
|
+
respondToBlocking?(decision: AgentChildBlockingDecision): void | Promise<void>;
|
|
113
|
+
}
|
|
114
|
+
export interface AgentChildManager {
|
|
115
|
+
spawnChild(request: {
|
|
116
|
+
parentConversationId: string;
|
|
117
|
+
childConversationId?: string;
|
|
118
|
+
seedUptoSeq?: number;
|
|
119
|
+
childInput: unknown;
|
|
120
|
+
budget: AgentChildBudget;
|
|
121
|
+
}): Promise<AgentChildRecord>;
|
|
122
|
+
listChildren(parentConversationId: string): readonly AgentChildRecord[];
|
|
123
|
+
recordStepUsage(request: {
|
|
124
|
+
childConversationId: string;
|
|
125
|
+
usage: AgentUsage;
|
|
126
|
+
elapsedMs: number;
|
|
127
|
+
}): Promise<{
|
|
128
|
+
stop: boolean;
|
|
129
|
+
/** Whether a stop was delivered to the child's host from this process. */
|
|
130
|
+
enforced: boolean;
|
|
131
|
+
policyName?: string;
|
|
132
|
+
overrun: {
|
|
133
|
+
tokens: number;
|
|
134
|
+
usd: number;
|
|
135
|
+
milliseconds: number;
|
|
136
|
+
};
|
|
137
|
+
}>;
|
|
138
|
+
stopChildren(parentConversationId: string): Promise<void>;
|
|
139
|
+
sendMessage(parentConversationId: string, childConversationId: string, input: unknown): Promise<void>;
|
|
140
|
+
interruptChild(parentConversationId: string, childConversationId: string): Promise<void>;
|
|
141
|
+
waitChild(childConversationId: string): Promise<void>;
|
|
142
|
+
/**
|
|
143
|
+
* Present each live child's blocking events on the parent exactly once and
|
|
144
|
+
* return the pending set. Never writes a presentation event to the child's
|
|
145
|
+
* own conversation. → ADR 0179
|
|
146
|
+
*/
|
|
147
|
+
listChildBlocking(parentConversationId: string): Promise<readonly AgentChildBlockingEvent[]>;
|
|
148
|
+
/**
|
|
149
|
+
* Route the parent's answer to the child that raised the request. A missing,
|
|
150
|
+
* stale or already-answered id is refused. Answering one request preserves
|
|
151
|
+
* every unanswered sibling, including requests in the same presentation batch.
|
|
152
|
+
*/
|
|
153
|
+
respondToChildBlocking(parentConversationId: string, decision: AgentChildBlockingDecision): Promise<void>;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=children-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"children-contract.d.ts","sourceRoot":"","sources":["../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AO,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAC;YAAC,YAAY,EAAE,MAAM,CAAA;SAAE,CAAC;KAChE,CAAC,CAAC;IACH,YAAY,CAAC,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,WAAW,CACT,oBAAoB,EAAE,MAAM,EAC5B,mBAAmB,EAAE,MAAM,EAC3B,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,cAAc,CAAC,oBAAoB,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzF,SAAS,CAAC,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD;;;;OAIG;IACH,iBAAiB,CAAC,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,uBAAuB,EAAE,CAAC,CAAC;IAC7F;;;;OAIG;IACH,sBAAsB,CACpB,oBAAoB,EAAE,MAAM,EAC5B,QAAQ,EAAE,0BAA0B,GACnC,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB"}
|
|
@@ -1,85 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import type { AgentRuntimeStopPolicy } from './runtime.js';
|
|
4
|
-
import type { AgentUsage } from './schemas.js';
|
|
1
|
+
import { type AgentChildBudget, type AgentChildHandle, type AgentChildManager } from './children-contract.js';
|
|
5
2
|
import type { SqliteAgentRuntimeStore } from './sqlite.js';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
tokens: z.ZodOptional<z.ZodInt>;
|
|
9
|
-
milliseconds: z.ZodOptional<z.ZodInt>;
|
|
10
|
-
}, z.core.$strict>;
|
|
11
|
-
export type AgentChildBudget = z.infer<typeof AgentChildBudgetSchema>;
|
|
12
|
-
export declare const AgentChildStateSchema: z.ZodEnum<{
|
|
13
|
-
finished: "finished";
|
|
14
|
-
lost: "lost";
|
|
15
|
-
running: "running";
|
|
16
|
-
spawned: "spawned";
|
|
17
|
-
stopped: "stopped";
|
|
18
|
-
}>;
|
|
19
|
-
export type AgentChildState = z.infer<typeof AgentChildStateSchema>;
|
|
20
|
-
export declare const AgentChildRecordSchema: z.ZodObject<{
|
|
21
|
-
parentConversationId: z.ZodString;
|
|
22
|
-
childConversationId: z.ZodString;
|
|
23
|
-
seedUptoSeq: z.ZodInt;
|
|
24
|
-
state: z.ZodEnum<{
|
|
25
|
-
finished: "finished";
|
|
26
|
-
lost: "lost";
|
|
27
|
-
running: "running";
|
|
28
|
-
spawned: "spawned";
|
|
29
|
-
stopped: "stopped";
|
|
30
|
-
}>;
|
|
31
|
-
budget: z.ZodObject<{
|
|
32
|
-
usd: z.ZodOptional<z.ZodNumber>;
|
|
33
|
-
tokens: z.ZodOptional<z.ZodInt>;
|
|
34
|
-
milliseconds: z.ZodOptional<z.ZodInt>;
|
|
35
|
-
}, z.core.$strict>;
|
|
36
|
-
usage: z.ZodObject<{
|
|
37
|
-
tokens: z.ZodInt;
|
|
38
|
-
usd: z.ZodNumber;
|
|
39
|
-
milliseconds: z.ZodInt;
|
|
40
|
-
}, z.core.$strict>;
|
|
41
|
-
resultReference: z.ZodOptional<z.ZodString>;
|
|
42
|
-
createdAt: z.ZodString;
|
|
43
|
-
updatedAt: z.ZodString;
|
|
44
|
-
}, z.core.$strict>;
|
|
45
|
-
export type AgentChildRecord = z.infer<typeof AgentChildRecordSchema>;
|
|
46
|
-
export interface AgentChildHandle {
|
|
47
|
-
result: Promise<{
|
|
48
|
-
resultReference?: string;
|
|
49
|
-
}>;
|
|
50
|
-
stopPolicy(name: string): void | Promise<void>;
|
|
51
|
-
sendMessage?(input: unknown): void | Promise<void>;
|
|
52
|
-
reachable?(): boolean | Promise<boolean>;
|
|
53
|
-
}
|
|
54
|
-
export interface AgentChildManager {
|
|
55
|
-
spawnChild(request: {
|
|
56
|
-
parentConversationId: string;
|
|
57
|
-
childConversationId?: string;
|
|
58
|
-
seedUptoSeq?: number;
|
|
59
|
-
childInput: unknown;
|
|
60
|
-
budget: AgentChildBudget;
|
|
61
|
-
}): Promise<AgentChildRecord>;
|
|
62
|
-
listChildren(parentConversationId: string): readonly AgentChildRecord[];
|
|
63
|
-
recordStepUsage(request: {
|
|
64
|
-
childConversationId: string;
|
|
65
|
-
usage: AgentUsage;
|
|
66
|
-
elapsedMs: number;
|
|
67
|
-
}): Promise<{
|
|
68
|
-
stop: boolean;
|
|
69
|
-
/** Whether a stop was delivered to the child's host from this process. */
|
|
70
|
-
enforced: boolean;
|
|
71
|
-
policyName?: string;
|
|
72
|
-
overrun: {
|
|
73
|
-
tokens: number;
|
|
74
|
-
usd: number;
|
|
75
|
-
milliseconds: number;
|
|
76
|
-
};
|
|
77
|
-
}>;
|
|
78
|
-
stopChildren(parentConversationId: string): Promise<void>;
|
|
79
|
-
sendMessage(parentConversationId: string, childConversationId: string, input: unknown): Promise<void>;
|
|
80
|
-
interruptChild(parentConversationId: string, childConversationId: string): Promise<void>;
|
|
81
|
-
waitChild(childConversationId: string): Promise<void>;
|
|
82
|
-
}
|
|
3
|
+
export type { AgentChildBlockingDecision, AgentChildBlockingEvent, AgentChildBlockingKind, AgentChildBlockingSource, AgentChildBudget, AgentChildHandle, AgentChildManager, AgentChildRecord, AgentChildState, } from './children-contract.js';
|
|
4
|
+
export { AgentChildBlockingEventSchema, AgentChildBlockingKindSchema, AgentChildBlockingSourceSchema, AgentChildBudgetSchema, AgentChildRecordSchema, AgentChildStateSchema, } from './children-contract.js';
|
|
83
5
|
export declare function createSqliteAgentChildManager(input: {
|
|
84
6
|
sqlite: SqliteAgentRuntimeStore;
|
|
85
7
|
spawn(request: {
|
|
@@ -92,22 +14,5 @@ export declare function createSqliteAgentChildManager(input: {
|
|
|
92
14
|
remainingBudget?(parentConversationId: string): AgentChildBudget | Promise<AgentChildBudget>;
|
|
93
15
|
now?: () => Date;
|
|
94
16
|
}): AgentChildManager;
|
|
95
|
-
|
|
96
|
-
* The child runtime's own budget policy.
|
|
97
|
-
*
|
|
98
|
-
* `recordStepUsage` measures and decides; something has to call it at every
|
|
99
|
-
* step boundary of the child's run, and that is the child's runtime. Given to
|
|
100
|
-
* `createAgentRuntime({ loop: { stopPolicies: [agentChildBudgetStopPolicy(…)] } })`
|
|
101
|
-
* in the host that runs the child, it records the last step's usage and stops
|
|
102
|
-
* the run as `policy_stop` (`child-budget`) when the budget is spent — the
|
|
103
|
-
* enforcement the guide promises, in the package rather than in every host.
|
|
104
|
-
*/
|
|
105
|
-
export declare function agentChildBudgetStopPolicy(input: {
|
|
106
|
-
manager: Pick<AgentChildManager, 'recordStepUsage'>;
|
|
107
|
-
childConversationId: string;
|
|
108
|
-
/** Cost of a step, when a USD budget is set; tokens come from the step itself. */
|
|
109
|
-
cost?: (step: {
|
|
110
|
-
usage: LanguageModelUsage;
|
|
111
|
-
}) => AgentUsage['cost'];
|
|
112
|
-
}): AgentRuntimeStopPolicy;
|
|
17
|
+
export { agentChildBudgetStopPolicy } from './child-budget-policy.js';
|
|
113
18
|
//# sourceMappingURL=children.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"children.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/children.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"children.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/children.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAOvB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAGxD,YAAY,EACV,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,MAAM,EAAE,uBAAuB,CAAC;IAChC,KAAK,CAAC,OAAO,EAAE;QACb,oBAAoB,EAAE,MAAM,CAAC;QAC7B,mBAAmB,EAAE,MAAM,CAAC;QAC5B,WAAW,EAAE,UAAU,CAAC;QACxB,UAAU,EAAE,OAAO,CAAC;QACpB,MAAM,EAAE,gBAAgB,CAAC;KAC1B,GAAG,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACjD,eAAe,CAAC,CAAC,oBAAoB,EAAE,MAAM,GAAG,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7F,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB,GAAG,iBAAiB,CA4bpB;AAED,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type AgentCodingToolConfig } from './coding-tool-contract.js';
|
|
2
|
+
import type { AgentProcessSandbox } from './sandbox.js';
|
|
3
|
+
export declare function runCodingShell(input: {
|
|
4
|
+
executableName: string;
|
|
5
|
+
executable: string;
|
|
6
|
+
args: readonly string[];
|
|
7
|
+
cwd: string;
|
|
8
|
+
environment: Readonly<Record<string, string>>;
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
timeoutMs: number;
|
|
11
|
+
terminationGraceMs: number;
|
|
12
|
+
maxOutputBytes: number;
|
|
13
|
+
maxArtifactBytes: number;
|
|
14
|
+
artifacts?: AgentCodingToolConfig['artifacts'];
|
|
15
|
+
authorization?: Parameters<NonNullable<AgentCodingToolConfig['authorize']>>[0];
|
|
16
|
+
spawn?: () => ReturnType<NonNullable<AgentProcessSandbox['spawn']>>;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
executable: string;
|
|
19
|
+
exitCode: number | null;
|
|
20
|
+
signal: string | null;
|
|
21
|
+
stdout: string;
|
|
22
|
+
stderr: string;
|
|
23
|
+
outcome: "cancelled" | "exited" | "output-limit" | "timeout";
|
|
24
|
+
artifact?: {
|
|
25
|
+
reference: string;
|
|
26
|
+
bytes: number;
|
|
27
|
+
truncated: boolean;
|
|
28
|
+
headBytes: number;
|
|
29
|
+
tailBytes: number;
|
|
30
|
+
omittedBytes: number;
|
|
31
|
+
} | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
//# sourceMappingURL=coding-shell-process.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coding-shell-process.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-shell-process.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,qBAAqB,EAAqB,MAAM,wBAAwB,CAAC;AAEvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD,wBAAsB,cAAc,CAAC,KAAK,EAAE;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9C,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC/C,aAAa,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/E,KAAK,CAAC,EAAE,MAAM,UAAU,CAAC,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;CACrE;;;;;;;;;;;;;;;GAwMA"}
|
|
@@ -68,6 +68,24 @@ export declare const AgentCodingToolPathAuthorizationSchema: z.ZodObject<{
|
|
|
68
68
|
path: z.ZodString;
|
|
69
69
|
}, z.core.$strict>;
|
|
70
70
|
export type AgentCodingToolPathAuthorization = z.infer<typeof AgentCodingToolPathAuthorizationSchema>;
|
|
71
|
+
/**
|
|
72
|
+
* One entry the host's path policy refused while listing or searching.
|
|
73
|
+
*
|
|
74
|
+
* Only the workspace-relative path and kind travel — never content — so a
|
|
75
|
+
* caller can tell "the host will not let me see this" from "this is not here".
|
|
76
|
+
* The absence of this fact is what made a denied `.env` indistinguishable from
|
|
77
|
+
* a file that does not exist.
|
|
78
|
+
*/
|
|
79
|
+
export declare const CodingDeniedEntrySchema: z.ZodObject<{
|
|
80
|
+
path: z.ZodString;
|
|
81
|
+
kind: z.ZodEnum<{
|
|
82
|
+
directory: "directory";
|
|
83
|
+
file: "file";
|
|
84
|
+
other: "other";
|
|
85
|
+
symlink: "symlink";
|
|
86
|
+
}>;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
export type CodingDeniedEntry = z.infer<typeof CodingDeniedEntrySchema>;
|
|
71
89
|
export interface AgentCodingToolConfig {
|
|
72
90
|
root: string;
|
|
73
91
|
authorize(input: AgentCodingToolAuthorization): boolean | Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coding-tool-contract.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAE9E,eAAO,M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1B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAK3B,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"coding-tool-files.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-files.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAK3B,MAAM,wBAAwB,CAAC;AAgChC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,qBAAqB,GAC5B,SAAS,yBAAyB,EAAE,CA+LtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coding-tool-listing.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-listing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"coding-tool-listing.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coding-tool-listing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAehC,iFAAiF;AACjF,eAAO,MAAM,4BAA4B,UAQxC,CAAC;AA6CF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA2B5D;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,qBAAqB,GAC5B,SAAS,yBAAyB,EAAE,CAkItC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AgentCodingToolAuthorization, type AgentCodingToolConfig } from './coding-tool-contract.js';
|
|
2
|
-
export declare function boundedCodingRelativePath(requested: string, maxPathBytes: number): string;
|
|
2
|
+
export declare function boundedCodingRelativePath(root: string, requested: string, maxPathBytes: number): string;
|
|
3
3
|
export declare function existingCodingPath(root: string, requested: string, maxPathBytes: number): Promise<{
|
|
4
4
|
absolute: string;
|
|
5
5
|
relative: string;
|