stitchkit 0.100.0 → 0.100.1
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 +80 -1
- package/dist/agent-runtime/invocation-attempt.d.ts +6 -0
- package/dist/agent-runtime/invocation-attempt.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-payload.d.ts +2 -0
- package/dist/agent-runtime/invocation-payload.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-read.d.ts.map +1 -1
- package/dist/agent-runtime/invocations.d.ts +6 -0
- package/dist/agent-runtime/invocations.d.ts.map +1 -1
- package/dist/agent-runtime/projections.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-dispatch.d.ts +9 -2
- package/dist/agent-runtime/schedule-dispatch.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-records.d.ts +8 -2
- package/dist/agent-runtime/schedule-records.d.ts.map +1 -1
- package/dist/agent-runtime/schedules.d.ts +5 -0
- package/dist/agent-runtime/schedules.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-events.d.ts.map +1 -1
- package/dist/agent-runtime/store-create.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver-contract.d.ts +9 -0
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
- package/dist/agent-runtime/store-event-once.d.ts +9 -1
- package/dist/agent-runtime/store-event-once.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory.d.ts.map +1 -1
- package/dist/agent-runtime/store.d.ts +6 -0
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/application/change-subscription.d.ts.map +1 -1
- package/dist/application/notification-delivery.d.ts +24 -1
- package/dist/application/notification-delivery.d.ts.map +1 -1
- package/dist/application/notification-outbox-state.d.ts +4 -0
- package/dist/application/notification-outbox-state.d.ts.map +1 -1
- package/dist/application/notification-outbox.d.ts.map +1 -1
- package/dist/application/watch-hub-core.d.ts +14 -79
- package/dist/application/watch-hub-core.d.ts.map +1 -1
- package/dist/application/watch-hub-source.d.ts +98 -0
- package/dist/application/watch-hub-source.d.ts.map +1 -0
- package/dist/browser/session-credentials.d.ts +6 -0
- package/dist/browser/session-credentials.d.ts.map +1 -1
- package/dist/browser/session.d.ts +3 -1
- package/dist/browser/session.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/harness.js +1 -1
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +2 -2
- package/dist/entrypoints/agent-runtime/sqlite/node.js +2 -2
- package/dist/entrypoints/agent-runtime/testing.js +2 -2
- package/dist/entrypoints/agent-runtime.js +53 -19
- package/dist/entrypoints/application/diagnostic-journal.js +1 -1
- package/dist/entrypoints/application.d.ts +1 -1
- package/dist/entrypoints/application.d.ts.map +1 -1
- package/dist/entrypoints/application.js +275 -189
- package/dist/entrypoints/files.js +8 -2
- package/dist/entrypoints/index.js +33 -6
- package/dist/entrypoints/live.js +16 -12
- package/dist/entrypoints/node.js +1 -1
- package/dist/entrypoints/server.js +4 -4
- package/dist/{index-s84he4v7.js → index-10x2hbx0.js} +4 -1
- package/dist/{index-js7gqrb1.js → index-c6bxbsnc.js} +5 -1
- package/dist/{index-y9qn426m.js → index-eaysmdtq.js} +10 -1
- package/dist/{index-xwhjjw2x.js → index-f4fx2tza.js} +119 -49
- package/dist/{index-p3vsv1fb.js → index-hadmp193.js} +14 -5
- package/dist/{index-0b1cnze2.js → index-vqr7f7v8.js} +31 -15
- package/dist/internal/coalesced-task.d.ts +2 -0
- package/dist/internal/coalesced-task.d.ts.map +1 -1
- package/dist/internal/process-instance.d.ts.map +1 -1
- package/dist/internal/with-exclusive-lock.d.ts.map +1 -1
- package/dist/server/realtime.d.ts.map +1 -1
- package/llms/agent-runtime.2.txt +13 -5
- package/llms/agent-runtime.3.txt +9 -4
- package/llms/agent-runtime.txt +8 -3
- package/llms/application.2.txt +21 -5
- package/llms/live.txt +2 -1
- package/llms/server.3.txt +22 -0
- package/llms/stitchkit.3.txt +9 -5
- package/llms/upgrading-0.74.0-0.100.0.txt +15 -3
- package/llms-full.txt +99 -26
- package/llms.txt +5 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coalesced-task.d.ts","sourceRoot":"","sources":["../../src/internal/coalesced-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,WAAW,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,OAAO,IAAI,IAAI,CAAC;IAChB,UAAU,IAAI,IAAI,CAAC;IACnB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,0FAA0F;AAC1F,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,MAAM,IAAI,OAAO,CAAC;IAClB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,aAAa,CAAC;CACxB,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"coalesced-task.d.ts","sourceRoot":"","sources":["../../src/internal/coalesced-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,WAAW,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,OAAO,IAAI,IAAI,CAAC;IAChB,UAAU,IAAI,IAAI,CAAC;IACnB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,0FAA0F;AAC1F,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,MAAM,IAAI,OAAO,CAAC;IAClB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,aAAa,CAAC;CACxB,GAAG,aAAa,CAuDhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-instance.d.ts","sourceRoot":"","sources":["../../src/internal/process-instance.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,eAAO,MAAM,qBAAqB;;;;;;;;kBAOvB,CAAC;AACZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAS1E;AAED,iGAAiG;AACjG,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,QAAQ,SAAU,GACjB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"process-instance.d.ts","sourceRoot":"","sources":["../../src/internal/process-instance.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,eAAO,MAAM,qBAAqB;;;;;;;;kBAOvB,CAAC;AACZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAS1E;AAED,iGAAiG;AACjG,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,QAAQ,SAAU,GACjB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CA6CjC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC;IACnD,QAAQ,CAAC,QAAQ,EACb,SAAS,GACT,gBAAgB,GAChB,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,aAAa,CAAC;CACnB;AAED,yFAAyF;AACzF,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EAC5C,MAAM;IAAK,IAAI;IAAuB,QAAQ;CAAiB,GAC9D,OAAO,CAAC,oBAAoB,CAAC,CAyB/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-exclusive-lock.d.ts","sourceRoot":"","sources":["../../src/internal/with-exclusive-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"with-exclusive-lock.d.ts","sourceRoot":"","sources":["../../src/internal/with-exclusive-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,4CAA4C;AAC5C,MAAM,WAAW,oBAAoB;IACnC,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC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MAAM,CAAC,CAAC;IAC9E,EAAE,CACA,IAAI,EAAE,MAAM,GACX,IAAI,CAAC,uBAAuB,CAAC,qBAAqB,EAAE,eAAe,CAAC,EAAE,MAAM,CAAC,CAAC;CAClF;AAED,MAAM,WAAW,oBAAoB,CAAC,KAAK,GAAG,GAAG;IAC/C,EAAE,EAAE,cAAc,CAAC,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;CAC7E;AAED,wBAAgB,kBAAkB,CAChC,KAAK,CAAC,eAAe,SAAS,qBAAqB,EACnD,KAAK,CAAC,eAAe,SAAS,qBAAqB,EACnD,KAAK,GAAG,GAAG,EAEX,QAAQ,EAAE,gBAAgB,CAAC,eAAe,EAAE,eAAe,CAAC,EAC5D,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,EACnC,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,yBAAyB,CAAC;IAAC,MAAM,CAAC,EAAE,YAAY,CAAA;CAAO,GAC9E,cAAc,CAAC,eAAe,EAAE,eAAe,EAAE,KAAK,CAAC,CAyDzD"}
|
package/llms/agent-runtime.2.txt
CHANGED
|
@@ -848,15 +848,23 @@ hashes; `readPayload({ conversationId, artifactId }, context)` separately author
|
|
|
848
848
|
`read-payload` and checks authentication tags and hashes. `payloadKey` must be 32
|
|
849
849
|
bytes and is copied at construction. Keep it outside the event store/backups; retain
|
|
850
850
|
the appropriate key when restoring an archive. `maxPayloadBytes` defaults to 4 MiB
|
|
851
|
-
(range 1 KiB–64 MiB)
|
|
851
|
+
(range 1 KiB–64 MiB). Streaming output evidence keeps parts up to half of it; past
|
|
852
|
+
that the evidence carries `truncated: { parts, sha256 }` over the whole stream, and
|
|
853
|
+
the answer itself is never cut. A receipt that cannot be written never changes an
|
|
854
|
+
outcome: `complete()` returns it with `receiptError` beside it, and a succeeded
|
|
855
|
+
answer keeps its `text`. Request headers
|
|
852
856
|
are excluded. Protect existing agent history independently: enabling receipts does
|
|
853
857
|
not encrypt its ordinary conversation records.
|
|
854
858
|
|
|
855
859
|
The built-in memory and SQLite stores implement `appendEventOnce`. Custom stores
|
|
856
860
|
must implement its once-only check and append atomically, returning the original
|
|
857
861
|
event on a duplicate key scoped by conversation and kind. A factory without this
|
|
858
|
-
capability refuses receipt setup. The driver-backed implementation
|
|
859
|
-
|
|
862
|
+
capability refuses receipt setup. The driver-backed implementation finds the keyed
|
|
863
|
+
event by its identity through the driver's optional `events.find` — one index probe
|
|
864
|
+
in SQLite — so admission costs the same on a long conversation as on a new one; a
|
|
865
|
+
custom driver without `find` falls back to paging the log in one transaction.
|
|
866
|
+
`store.findEventOnce({ conversationId, kind, key })` reads the same event back.
|
|
867
|
+
Invocation payload artifacts are keyed by their artifact id the same way.
|
|
860
868
|
|
|
861
869
|
### Migration from direct SDK completions
|
|
862
870
|
|
|
@@ -864,5 +872,5 @@ pages under one transaction, without another table or database.
|
|
|
864
872
|
Replace the direct `generateText` call with `invocations.complete`, configure host
|
|
865
873
|
authorization and a retained payload key, and pass the same ledger in the agent's
|
|
866
874
|
`invocations` option. Use the returned invocation ID and the paginated `read` method
|
|
867
|
-
for receipt queries; do not import runtime internals.
|
|
868
|
-
|
|
875
|
+
for receipt queries; do not import runtime internals. Available since 0.100.0;
|
|
876
|
+
existing runtime configurations need no migration.
|
package/llms/agent-runtime.3.txt
CHANGED
|
@@ -111,7 +111,7 @@ Server-only optional application runtime. See the
|
|
|
111
111
|
| `AgentSandboxProcess` / `AgentSandboxOutputStream` | _types_ | structural child/output interface for optional lifecycle-owned `AgentProcessSandbox.spawn`, without Node ambient type dependencies |
|
|
112
112
|
| `AgentEventSearchResultSchema` / `AgentEventSearchResult` / `createSqliteAgentEventSearch` / `createAgentEventSearchTools` | schema / _type_ / functions | authorized FTS5 search with exact event addresses and `session_*` tools |
|
|
113
113
|
| `createSqliteAgentSpillStore` | function | durable content-address-checked artifact storage, bounded read/search, retention facts and archive participation |
|
|
114
|
-
| `AgentScheduleSchema` / `AgentSchedule` / `AgentScheduleService` / `AgentScheduleDeliveryOutcomeSchema` / `AgentScheduleDeliveryOutcome` / `createAgentScheduleService` / `createAgentScheduleTools` | schemas / _types_ / functions | durable `at`/`after`/timezone-explicit `every`, indexed retry eligibility, typed retry/terminal failure, bounded dispatch and fenced stable occurrence identity (ADR 0202) |
|
|
114
|
+
| `AgentScheduleSchema` / `AgentSchedule` / `AgentScheduleService` / `AgentScheduleDeliveryOutcomeSchema` / `AgentScheduleDeliveryOutcome` / `createAgentScheduleService` / `createAgentScheduleTools` | schemas / _types_ / functions | durable `at`/`after`/timezone-explicit `every`, indexed retry eligibility, typed retry/terminal failure (any other returned value delivers), `maxAttempts` (default 1000) per occurrence — a one-off ends `failed`, a recurring schedule skips to its next slot — bounded dispatch and fenced stable occurrence identity (ADR 0202) |
|
|
115
115
|
| `AgentChildBudgetSchema` / `AgentChildBudget` / `AgentChildStateSchema` / `AgentChildState` / `AgentChildRecordSchema` / `AgentChildRecord` | schema / _type_ | durable child graph, bounded seed and measured budget state |
|
|
116
116
|
| `AgentChildBlockingKindSchema` / `AgentChildBlockingKind` / `AgentChildBlockingSourceSchema` / `AgentChildBlockingSource` / `AgentChildBlockingEventSchema` / `AgentChildBlockingEvent` / `AgentChildBlockingDecision` | schemas / _types_ | parent-owned request identities; responses discriminate approval decisions from JSON input values |
|
|
117
117
|
| `AgentChildHandle` / `AgentChildManager` / `SqliteAgentChildManagerConfig` / `createSqliteAgentChildManager` / `createAgentChildTools` / `agentChildBudgetStopPolicy` | _type_ / functions | host execution port, child lifecycle, cascade (given to `createAgentRuntime` as `children`), messaging, Agent tools, and the child runtime's own budget stop policy — `recordStepUsage` at every step boundary, `policy_stop` as `child-budget` when spent |
|
|
@@ -272,7 +272,9 @@ operator-only observability sink explicitly opts in.
|
|
|
272
272
|
`ModelInvocationConfig`: the existing store and model registry, a 32-byte payload
|
|
273
273
|
key, required host authorization, optional bounded payload size and `onAttempt`.
|
|
274
274
|
`complete(input, context, signal?)` executes only the supplied prompt, with no tools
|
|
275
|
-
or framework instructions; repeated keys return the existing invocation ID.
|
|
275
|
+
or framework instructions; repeated keys return the existing invocation ID. It
|
|
276
|
+
resolves `{ invocationId, outcome, text?, receiptError? }`: `receiptError` says a
|
|
277
|
+
receipt could not be written and never changes `outcome` or drops `text`.
|
|
276
278
|
`read(input, context)` returns a bounded event page shared by agent and completion;
|
|
277
279
|
`readPayload(input, context)` requires a separate authorization action to decrypt
|
|
278
280
|
one protected artifact. See the [guide and migration example](../guide/agent-runtime.md#plain-completions-and-shared-invocation-receipts).
|
|
@@ -287,8 +289,11 @@ one protected artifact. See the [guide and migration example](../guide/agent-run
|
|
|
287
289
|
|
|
288
290
|
The runtime `invocations` option takes this ledger and a trace callback; it requires
|
|
289
291
|
the same store and preserves the existing tool loop. `AgentRuntimeStore.appendEventOnce`
|
|
290
|
-
is an optional atomic capability required by receipt admission
|
|
291
|
-
|
|
292
|
+
is an optional atomic capability required by receipt admission, and
|
|
293
|
+
`AgentRuntimeStore.findEventOnce` reads the event it wrote by kind and key. Built-in
|
|
294
|
+
stores supply both; custom adapters must honor the once-only transaction contract.
|
|
295
|
+
A driver's optional `events.find(transaction, { conversationId, eventId })` makes
|
|
296
|
+
both one lookup instead of a scan of the conversation log.
|
|
292
297
|
|
|
293
298
|
==============================================================================
|
|
294
299
|
# API reference: `stitchkit-tui` (docs/api/reference.md)
|
package/llms/agent-runtime.txt
CHANGED
|
@@ -19,7 +19,7 @@ description: Configure Stitchkit's optional durable history, stream loop, run co
|
|
|
19
19
|
type: architecture
|
|
20
20
|
status: active
|
|
21
21
|
created: 2026-08-22
|
|
22
|
-
updated: 2026-09-
|
|
22
|
+
updated: 2026-09-28 18:39 +07:00
|
|
23
23
|
---
|
|
24
24
|
|
|
25
25
|
# Agent application runtime
|
|
@@ -636,9 +636,14 @@ has invoked a tool is never automatically replayed.
|
|
|
636
636
|
`createAgentScheduleService` persists `at`, `after` and `every` input. Repeating
|
|
637
637
|
schedules require an explicit IANA time zone. Dispatch uses a stable
|
|
638
638
|
`schedule:<id>:<occurrence>` idempotency key, and restart lateness is recorded.
|
|
639
|
-
Resolve
|
|
639
|
+
Resolve after durable admission; return `{ status: 'retry', reason }` for a
|
|
640
640
|
transient refusal or `{ status: 'terminal', reason }` to stop the entire schedule in
|
|
641
|
-
`failed` state.
|
|
641
|
+
`failed` state. Only those two shapes are failures: any other returned value — a
|
|
642
|
+
queue length, a receipt — means the callback returned, so it delivered. Throws retry
|
|
643
|
+
too. `maxAttempts` (default 1000, about sixteen hours at the retry ceiling) bounds
|
|
644
|
+
one occurrence: a one-off schedule then becomes `failed`, a recurring one gives up
|
|
645
|
+
that occurrence (`schedule/failed` with `skipped: true` and the `nextAt` it moves
|
|
646
|
+
to) and keeps its cadence. A failure reason is kept to 1000 characters. Backoff is 1, 2, 4, 8, 16, 32, then 60 seconds,
|
|
642
647
|
capped at 60 seconds and persisted across restart. `retryAt`, `attempts` and `lastError`
|
|
643
648
|
show retry diagnostics; success resets them. `nextAt` and `lateByMs` retain the original
|
|
644
649
|
occurrence time. Recurring schedules fire once after an idle stretch and advance to the
|
package/llms/application.2.txt
CHANGED
|
@@ -17,6 +17,9 @@ Opt into `delivery: { version, actions, project }` on `createNotificationOutbox`
|
|
|
17
17
|
The pure `actions(payload)` selector runs at enqueue; the versioned plan remains
|
|
18
18
|
fixed throughout retry. Each `send` receives its action and a stable idempotency
|
|
19
19
|
key; return a small JSON receipt such as a remote message or uploaded object ID.
|
|
20
|
+
An action that returned is confirmed and is never sent again: a result that is not
|
|
21
|
+
JSON, or does not fit the state's byte budget, is kept as `receipt: null` with
|
|
22
|
+
`unrecorded: 'not-json' | 'too-large'` and reported to `onError`.
|
|
20
23
|
`project(notification, receipts)` applies all confirmed results locally and must
|
|
21
24
|
be idempotent. Checkpoints and the final projection timestamp live in the existing
|
|
22
25
|
atomic StateStore; completed receipts retain them within retention/byte limits.
|
|
@@ -28,9 +31,13 @@ not repeat confirmed sends. A crash after remote success but before receipt comm
|
|
|
28
31
|
is ambiguous: the provider must deduplicate the action key or reconcile its result.
|
|
29
32
|
A projection can also repeat if its completion checkpoint is lost.
|
|
30
33
|
|
|
31
|
-
A
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
A plan keeps its actions from enqueue, so an older version needs only its
|
|
35
|
+
projection to finish: a new executor lists it in `retiredVersions: { v1: project }`
|
|
36
|
+
until the queue has drained. A plan version the executor does not know is reported
|
|
37
|
+
to `onError` as `NotificationPlanVersionError` and waits — at least a poll interval,
|
|
38
|
+
spending no attempt, without `classify` — for a process that knows it: the other
|
|
39
|
+
side of a rolling deploy, the version a rollback returns to, or this one once it
|
|
40
|
+
lists the version. Whole-state file and memory stores
|
|
34
41
|
remain supported. Atomic enqueue with an unrelated business transaction is not
|
|
35
42
|
provided by this contract; retain the application's transactional adapter when that
|
|
36
43
|
boundary is required. Send and projection callbacks own their external deadlines.
|
|
@@ -535,7 +542,10 @@ periodically even when no notification arrives.
|
|
|
535
542
|
`reconcileIntervalMs` (10 ms–1 h). `hub.attach(subscriber, scope?)` accepts a
|
|
536
543
|
`WatchAdmissionScope` containing a **server-verified** `key` (1–512 characters) and
|
|
537
544
|
revocation `signal`. The key separates sharing and is the optional third argument
|
|
538
|
-
of `read(operation, args, scope)
|
|
545
|
+
of `read(operation, args, scope)`; a key's `instance` routes frames and never
|
|
546
|
+
separates sources. Attached over `maxSubscribers`, a subscriber gets a watcher whose
|
|
547
|
+
`open` refuses with `Watch subscriber capacity exceeded`; `attach` does not throw
|
|
548
|
+
for capacity. It must represent account, session and permissions;
|
|
539
549
|
never trust a client-supplied owner ID as that scope.
|
|
540
550
|
|
|
541
551
|
|
|
@@ -546,7 +556,13 @@ never trust a client-supplied owner ID as that scope.
|
|
|
546
556
|
immutable executor `version`, pure `actions(payload)` plan selector (1–128 unique
|
|
547
557
|
names, each at most 128 characters), and idempotent `project(notification, receipts)`.
|
|
548
558
|
`send` receives optional `action` and stable `idempotencyKey`, and returns a JSON
|
|
549
|
-
remote receipt (void becomes null).
|
|
559
|
+
remote receipt (void becomes null). A result that is not JSON or does not fit the
|
|
560
|
+
byte budget is kept as `receipt: null` with `unrecorded: 'not-json' | 'too-large'`;
|
|
561
|
+
the action stays confirmed and is not sent again. `retiredVersions` maps earlier
|
|
562
|
+
plan versions to their `NotificationProjection` so queued items drain after an
|
|
563
|
+
executor upgrade; an unknown version is reported to `onError` as
|
|
564
|
+
`NotificationPlanVersionError` and waits, spending no attempt and not consulting
|
|
565
|
+
`classify`, for an executor that knows it. `NotificationDeliveryStateSchema` validates the
|
|
550
566
|
optional `NotificationDeliveryState` on queued items and completed receipts:
|
|
551
567
|
`version`, `actions`, `receipts` and optional `projectedAt`. Checkpoints share the
|
|
552
568
|
existing atomic StateStore and lease fence. Receipt retention and serialized byte
|
package/llms/live.txt
CHANGED
|
@@ -473,6 +473,7 @@ realtime contract from `stitchkit`, and the server halves live in `stitchkit/app
|
|
|
473
473
|
### Session-scoped watch lifetime
|
|
474
474
|
|
|
475
475
|
`WatchClientConfig.session` captures a `SessionOperation`; `maxKeys` (1024) and
|
|
476
|
-
`maxListenersPerKey` (128) bound retained subscriptions
|
|
476
|
+
`maxListenersPerKey` (128) bound retained subscriptions; a handle takes its key on
|
|
477
|
+
`subscribe`, which is where capacity refuses. Its lifetime nonce travels
|
|
477
478
|
in optional `WatchKey.instance`, preventing old-session frames from matching a new
|
|
478
479
|
client on the same socket. This is routing identity, never authorization.
|
package/llms/server.3.txt
CHANGED
|
@@ -1040,6 +1040,28 @@ The nonce is not authorization: the server still admits a verified identity and
|
|
|
1040
1040
|
uses `hub.attach(subscriber, { key: verifiedScope, signal: revocationSignal })`.
|
|
1041
1041
|
The scope key must change with session and permission boundaries.
|
|
1042
1042
|
|
|
1043
|
+
One scope and one question share one source and one read, however many client
|
|
1044
|
+
instances watch it: the hub routes each frame to every instance under its own
|
|
1045
|
+
key. A new tab of the same session costs a route, not a read.
|
|
1046
|
+
|
|
1047
|
+
### Capacity
|
|
1048
|
+
|
|
1049
|
+
A hub admits at most `maxSources` sources (1024) and `maxSubscribers` attached
|
|
1050
|
+
subscribers (1024); a client holds at most `maxKeys` keys (1024) and
|
|
1051
|
+
`maxListenersPerKey` listeners per key (128). Every excess is a refusal, never
|
|
1052
|
+
unbounded state: `open` answers `{ accepted: false, reason }` — including for a
|
|
1053
|
+
subscriber attached over capacity, whose `attach` returns a watcher that refuses
|
|
1054
|
+
every `open` — and a client's `subscribe` throws. A client handle takes its key
|
|
1055
|
+
when it subscribes, so handles a render creates and never subscribes cost
|
|
1056
|
+
nothing. A connection handler that throws closes that connection and is logged;
|
|
1057
|
+
the server goes on. A subscriber attached over capacity is not tracked: its
|
|
1058
|
+
refusals stand until it reconnects.
|
|
1059
|
+
|
|
1060
|
+
A read that fails sends its subscribers `unavailable` / `source-error` with the
|
|
1061
|
+
`code` and `message` of an `AppError`, which is written for its caller. Any other
|
|
1062
|
+
error reaches only the hub's `logger`; the browser reads `The watched read failed`. Set larger finite limits for larger workloads, and
|
|
1063
|
+
`reconcileIntervalMs` when a lost invalidation must recover without a reconnect.
|
|
1064
|
+
|
|
1043
1065
|
`createCacheBridge` can bind watched handles directly:
|
|
1044
1066
|
|
|
1045
1067
|
```ts
|
package/llms/stitchkit.3.txt
CHANGED
|
@@ -150,18 +150,22 @@ can emit / propagate a `traceparent` (see `HttpClientConfig.trace`).
|
|
|
150
150
|
|
|
151
151
|
`createSessionScope` (`stitchkit`) returns the generic `SessionScope`: `replace(context)`
|
|
152
152
|
creates a new login lifetime (including same-account relogin), `capture()` returns
|
|
153
|
-
its `SessionOperation<T>`, `clear()` invalidates it,
|
|
154
|
-
the host
|
|
153
|
+
its `SessionOperation<T>`, `clear()` invalidates it, `stop()` permanently closes
|
|
154
|
+
the host, and `owns(operation)` answers whether an operation is this scope's current
|
|
155
|
+
one — `current()` alone cannot tell an operation of another scope. Operations expose `id`, `generation`, `context`, `signal`, `current()` and
|
|
155
156
|
`assertCurrent()`. `run(callback)` checks both success and failure across an await;
|
|
156
157
|
`deliver(callback)` admits a synchronous final send/state change or returns false.
|
|
157
158
|
`bindFetch(fetch, headers?)` guards every attempt and scopes its abort signal. Wrap
|
|
158
159
|
the complete client call in `run` too: headers are not the response body boundary.
|
|
159
|
-
Expired work throws `SessionExpiredError`, not a refresh instruction
|
|
160
|
+
Expired work throws `SessionExpiredError`, not a refresh instruction; when the work
|
|
161
|
+
itself failed, that failure is its `cause`.
|
|
160
162
|
|
|
161
163
|
`createSessionCredentials` accepts `SessionCredentialsConfig`:
|
|
162
164
|
`scope`, `refresh(credentials, signal)`, `storage.write(session, credentials)`,
|
|
163
|
-
`storage.clear()`, `maxPendingWrites` (128),
|
|
164
|
-
hour)
|
|
165
|
+
`storage.clear()`, `maxPendingWrites` (128), `refreshTimeoutMs` (30000, at most one
|
|
166
|
+
hour) and `storageTimeoutMs` (30000, at most one hour): a storage call past it
|
|
167
|
+
rejects and frees the queue, so `logout()` still clears; when the late call settles,
|
|
168
|
+
storage is written again from memory, or cleared when nobody is logged in. `SessionCredentials` provides `login`, `logout`, `read(operation)` and
|
|
165
169
|
`refresh(operation)`. Concurrent refresh calls in one generation share the same
|
|
166
170
|
promise. Logout invalidates memory before its returned persistence promise settles.
|
|
167
171
|
Storage errors and queue-capacity refusals reject; callers must handle them. All
|
|
@@ -47,7 +47,10 @@ must recover without a reconnect.
|
|
|
47
47
|
For multi-action outboxes, enqueue new items with a versioned delivery plan and
|
|
48
48
|
return small JSON receipts from `send`. Existing queued single-send items should
|
|
49
49
|
be drained before enabling a delivery executor on that queue, or migrated under
|
|
50
|
-
the store's atomic transition.
|
|
50
|
+
the store's atomic transition. When a new executor version ships, list the old
|
|
51
|
+
version's projection in `delivery.retiredVersions` until its queued items drain;
|
|
52
|
+
a plan version with no executor waits, reported to `onError` as
|
|
53
|
+
`NotificationPlanVersionError` (from 0.100.1).
|
|
51
54
|
Make projection idempotent. Provider idempotency/reconciliation remains necessary
|
|
52
55
|
for a crash between remote success and checkpoint. These APIs are available starting with 0.100.0.
|
|
53
56
|
|
|
@@ -70,7 +73,9 @@ write the modern record; no journal data migration is needed.
|
|
|
70
73
|
Darwin distributions must retain the package's architecture-matched native
|
|
71
74
|
`.node` asset for process birth measurement, as for contained filesystem access.
|
|
72
75
|
If native/proc identity cannot be read, new locks explicitly record null and
|
|
73
|
-
recovery refuses rather than treating unknown ownership as death.
|
|
76
|
+
recovery refuses rather than treating unknown ownership as death. From 0.100.1 a
|
|
77
|
+
Linux kernel without time namespaces (before 5.6) records the PID namespace alone
|
|
78
|
+
instead of null, so its locks recover like any other. Existing
|
|
74
79
|
`refuse` policy and the separately configured ownerless-file grace are unchanged.
|
|
75
80
|
|
|
76
81
|
## Released migration: 0.99.0
|
|
@@ -88,13 +93,20 @@ Colliding object/array fields retain their complete structural alternatives:
|
|
|
88
93
|
{ type: ['object', 'array'] }
|
|
89
94
|
// After: structural alternatives live inside the property schema.
|
|
90
95
|
{ anyOf: [
|
|
91
|
-
{ type: 'object', properties: { id: { type: 'string' } }, required: ['id'] },
|
|
92
96
|
{ type: 'array', items: {
|
|
93
97
|
type: 'object', properties: { id: { type: 'string' } }, required: ['id'],
|
|
94
98
|
} },
|
|
99
|
+
{ type: 'object', properties: { id: { type: 'string' } }, required: ['id'] },
|
|
95
100
|
] }
|
|
96
101
|
```
|
|
97
102
|
|
|
103
|
+
Alternatives come in kind order, independent of variant order. The same shape
|
|
104
|
+
covers every collision of different kinds, scalars included: `string` against
|
|
105
|
+
`string[]` becomes `{ anyOf: [{ type: 'array', items: { type: 'string' } }, { type:
|
|
106
|
+
'string' }] }`. A nullable field keeps `null` in each alternative's `type`, and
|
|
107
|
+
differing nested object unions remain nested `anyOf` inside the alternatives. Update
|
|
108
|
+
snapshots to this order.
|
|
109
|
+
|
|
98
110
|
Traverse each nested alternative when inspecting schemas and regenerate schema
|
|
99
111
|
snapshots. Verify the actual manifest with the chosen provider. Keep flatten
|
|
100
112
|
enabled when a top-level discriminated union needs to be advertised as an
|
package/llms-full.txt
CHANGED
|
@@ -4888,7 +4888,7 @@ description: Configure Stitchkit's optional durable history, stream loop, run co
|
|
|
4888
4888
|
type: architecture
|
|
4889
4889
|
status: active
|
|
4890
4890
|
created: 2026-08-22
|
|
4891
|
-
updated: 2026-09-
|
|
4891
|
+
updated: 2026-09-28 18:39 +07:00
|
|
4892
4892
|
---
|
|
4893
4893
|
|
|
4894
4894
|
# Agent application runtime
|
|
@@ -5505,9 +5505,14 @@ has invoked a tool is never automatically replayed.
|
|
|
5505
5505
|
`createAgentScheduleService` persists `at`, `after` and `every` input. Repeating
|
|
5506
5506
|
schedules require an explicit IANA time zone. Dispatch uses a stable
|
|
5507
5507
|
`schedule:<id>:<occurrence>` idempotency key, and restart lateness is recorded.
|
|
5508
|
-
Resolve
|
|
5508
|
+
Resolve after durable admission; return `{ status: 'retry', reason }` for a
|
|
5509
5509
|
transient refusal or `{ status: 'terminal', reason }` to stop the entire schedule in
|
|
5510
|
-
`failed` state.
|
|
5510
|
+
`failed` state. Only those two shapes are failures: any other returned value — a
|
|
5511
|
+
queue length, a receipt — means the callback returned, so it delivered. Throws retry
|
|
5512
|
+
too. `maxAttempts` (default 1000, about sixteen hours at the retry ceiling) bounds
|
|
5513
|
+
one occurrence: a one-off schedule then becomes `failed`, a recurring one gives up
|
|
5514
|
+
that occurrence (`schedule/failed` with `skipped: true` and the `nextAt` it moves
|
|
5515
|
+
to) and keeps its cadence. A failure reason is kept to 1000 characters. Backoff is 1, 2, 4, 8, 16, 32, then 60 seconds,
|
|
5511
5516
|
capped at 60 seconds and persisted across restart. `retryAt`, `attempts` and `lastError`
|
|
5512
5517
|
show retry diagnostics; success resets them. `nextAt` and `lateByMs` retain the original
|
|
5513
5518
|
occurrence time. Recurring schedules fire once after an idle stretch and advance to the
|
|
@@ -6389,15 +6394,23 @@ hashes; `readPayload({ conversationId, artifactId }, context)` separately author
|
|
|
6389
6394
|
`read-payload` and checks authentication tags and hashes. `payloadKey` must be 32
|
|
6390
6395
|
bytes and is copied at construction. Keep it outside the event store/backups; retain
|
|
6391
6396
|
the appropriate key when restoring an archive. `maxPayloadBytes` defaults to 4 MiB
|
|
6392
|
-
(range 1 KiB–64 MiB)
|
|
6397
|
+
(range 1 KiB–64 MiB). Streaming output evidence keeps parts up to half of it; past
|
|
6398
|
+
that the evidence carries `truncated: { parts, sha256 }` over the whole stream, and
|
|
6399
|
+
the answer itself is never cut. A receipt that cannot be written never changes an
|
|
6400
|
+
outcome: `complete()` returns it with `receiptError` beside it, and a succeeded
|
|
6401
|
+
answer keeps its `text`. Request headers
|
|
6393
6402
|
are excluded. Protect existing agent history independently: enabling receipts does
|
|
6394
6403
|
not encrypt its ordinary conversation records.
|
|
6395
6404
|
|
|
6396
6405
|
The built-in memory and SQLite stores implement `appendEventOnce`. Custom stores
|
|
6397
6406
|
must implement its once-only check and append atomically, returning the original
|
|
6398
6407
|
event on a duplicate key scoped by conversation and kind. A factory without this
|
|
6399
|
-
capability refuses receipt setup. The driver-backed implementation
|
|
6400
|
-
|
|
6408
|
+
capability refuses receipt setup. The driver-backed implementation finds the keyed
|
|
6409
|
+
event by its identity through the driver's optional `events.find` — one index probe
|
|
6410
|
+
in SQLite — so admission costs the same on a long conversation as on a new one; a
|
|
6411
|
+
custom driver without `find` falls back to paging the log in one transaction.
|
|
6412
|
+
`store.findEventOnce({ conversationId, kind, key })` reads the same event back.
|
|
6413
|
+
Invocation payload artifacts are keyed by their artifact id the same way.
|
|
6401
6414
|
|
|
6402
6415
|
### Migration from direct SDK completions
|
|
6403
6416
|
|
|
@@ -6405,8 +6418,8 @@ pages under one transaction, without another table or database.
|
|
|
6405
6418
|
Replace the direct `generateText` call with `invocations.complete`, configure host
|
|
6406
6419
|
authorization and a retained payload key, and pass the same ledger in the agent's
|
|
6407
6420
|
`invocations` option. Use the returned invocation ID and the paginated `read` method
|
|
6408
|
-
for receipt queries; do not import runtime internals.
|
|
6409
|
-
|
|
6421
|
+
for receipt queries; do not import runtime internals. Available since 0.100.0;
|
|
6422
|
+
existing runtime configurations need no migration.
|
|
6410
6423
|
|
|
6411
6424
|
|
|
6412
6425
|
==============================================================================
|
|
@@ -7424,6 +7437,9 @@ Opt into `delivery: { version, actions, project }` on `createNotificationOutbox`
|
|
|
7424
7437
|
The pure `actions(payload)` selector runs at enqueue; the versioned plan remains
|
|
7425
7438
|
fixed throughout retry. Each `send` receives its action and a stable idempotency
|
|
7426
7439
|
key; return a small JSON receipt such as a remote message or uploaded object ID.
|
|
7440
|
+
An action that returned is confirmed and is never sent again: a result that is not
|
|
7441
|
+
JSON, or does not fit the state's byte budget, is kept as `receipt: null` with
|
|
7442
|
+
`unrecorded: 'not-json' | 'too-large'` and reported to `onError`.
|
|
7427
7443
|
`project(notification, receipts)` applies all confirmed results locally and must
|
|
7428
7444
|
be idempotent. Checkpoints and the final projection timestamp live in the existing
|
|
7429
7445
|
atomic StateStore; completed receipts retain them within retention/byte limits.
|
|
@@ -7435,9 +7451,13 @@ not repeat confirmed sends. A crash after remote success but before receipt comm
|
|
|
7435
7451
|
is ambiguous: the provider must deduplicate the action key or reconcile its result.
|
|
7436
7452
|
A projection can also repeat if its completion checkpoint is lost.
|
|
7437
7453
|
|
|
7438
|
-
A
|
|
7439
|
-
|
|
7440
|
-
|
|
7454
|
+
A plan keeps its actions from enqueue, so an older version needs only its
|
|
7455
|
+
projection to finish: a new executor lists it in `retiredVersions: { v1: project }`
|
|
7456
|
+
until the queue has drained. A plan version the executor does not know is reported
|
|
7457
|
+
to `onError` as `NotificationPlanVersionError` and waits — at least a poll interval,
|
|
7458
|
+
spending no attempt, without `classify` — for a process that knows it: the other
|
|
7459
|
+
side of a rolling deploy, the version a rollback returns to, or this one once it
|
|
7460
|
+
lists the version. Whole-state file and memory stores
|
|
7441
7461
|
remain supported. Atomic enqueue with an unrelated business transaction is not
|
|
7442
7462
|
provided by this contract; retain the application's transactional adapter when that
|
|
7443
7463
|
boundary is required. Send and projection callbacks own their external deadlines.
|
|
@@ -9927,6 +9947,28 @@ The nonce is not authorization: the server still admits a verified identity and
|
|
|
9927
9947
|
uses `hub.attach(subscriber, { key: verifiedScope, signal: revocationSignal })`.
|
|
9928
9948
|
The scope key must change with session and permission boundaries.
|
|
9929
9949
|
|
|
9950
|
+
One scope and one question share one source and one read, however many client
|
|
9951
|
+
instances watch it: the hub routes each frame to every instance under its own
|
|
9952
|
+
key. A new tab of the same session costs a route, not a read.
|
|
9953
|
+
|
|
9954
|
+
### Capacity
|
|
9955
|
+
|
|
9956
|
+
A hub admits at most `maxSources` sources (1024) and `maxSubscribers` attached
|
|
9957
|
+
subscribers (1024); a client holds at most `maxKeys` keys (1024) and
|
|
9958
|
+
`maxListenersPerKey` listeners per key (128). Every excess is a refusal, never
|
|
9959
|
+
unbounded state: `open` answers `{ accepted: false, reason }` — including for a
|
|
9960
|
+
subscriber attached over capacity, whose `attach` returns a watcher that refuses
|
|
9961
|
+
every `open` — and a client's `subscribe` throws. A client handle takes its key
|
|
9962
|
+
when it subscribes, so handles a render creates and never subscribes cost
|
|
9963
|
+
nothing. A connection handler that throws closes that connection and is logged;
|
|
9964
|
+
the server goes on. A subscriber attached over capacity is not tracked: its
|
|
9965
|
+
refusals stand until it reconnects.
|
|
9966
|
+
|
|
9967
|
+
A read that fails sends its subscribers `unavailable` / `source-error` with the
|
|
9968
|
+
`code` and `message` of an `AppError`, which is written for its caller. Any other
|
|
9969
|
+
error reaches only the hub's `logger`; the browser reads `The watched read failed`. Set larger finite limits for larger workloads, and
|
|
9970
|
+
`reconcileIntervalMs` when a lost invalidation must recover without a reconnect.
|
|
9971
|
+
|
|
9930
9972
|
`createCacheBridge` can bind watched handles directly:
|
|
9931
9973
|
|
|
9932
9974
|
```ts
|
|
@@ -13297,7 +13339,10 @@ must recover without a reconnect.
|
|
|
13297
13339
|
For multi-action outboxes, enqueue new items with a versioned delivery plan and
|
|
13298
13340
|
return small JSON receipts from `send`. Existing queued single-send items should
|
|
13299
13341
|
be drained before enabling a delivery executor on that queue, or migrated under
|
|
13300
|
-
the store's atomic transition.
|
|
13342
|
+
the store's atomic transition. When a new executor version ships, list the old
|
|
13343
|
+
version's projection in `delivery.retiredVersions` until its queued items drain;
|
|
13344
|
+
a plan version with no executor waits, reported to `onError` as
|
|
13345
|
+
`NotificationPlanVersionError` (from 0.100.1).
|
|
13301
13346
|
Make projection idempotent. Provider idempotency/reconciliation remains necessary
|
|
13302
13347
|
for a crash between remote success and checkpoint. These APIs are available starting with 0.100.0.
|
|
13303
13348
|
|
|
@@ -13320,7 +13365,9 @@ write the modern record; no journal data migration is needed.
|
|
|
13320
13365
|
Darwin distributions must retain the package's architecture-matched native
|
|
13321
13366
|
`.node` asset for process birth measurement, as for contained filesystem access.
|
|
13322
13367
|
If native/proc identity cannot be read, new locks explicitly record null and
|
|
13323
|
-
recovery refuses rather than treating unknown ownership as death.
|
|
13368
|
+
recovery refuses rather than treating unknown ownership as death. From 0.100.1 a
|
|
13369
|
+
Linux kernel without time namespaces (before 5.6) records the PID namespace alone
|
|
13370
|
+
instead of null, so its locks recover like any other. Existing
|
|
13324
13371
|
`refuse` policy and the separately configured ownerless-file grace are unchanged.
|
|
13325
13372
|
|
|
13326
13373
|
## Released migration: 0.99.0
|
|
@@ -13338,13 +13385,20 @@ Colliding object/array fields retain their complete structural alternatives:
|
|
|
13338
13385
|
{ type: ['object', 'array'] }
|
|
13339
13386
|
// After: structural alternatives live inside the property schema.
|
|
13340
13387
|
{ anyOf: [
|
|
13341
|
-
{ type: 'object', properties: { id: { type: 'string' } }, required: ['id'] },
|
|
13342
13388
|
{ type: 'array', items: {
|
|
13343
13389
|
type: 'object', properties: { id: { type: 'string' } }, required: ['id'],
|
|
13344
13390
|
} },
|
|
13391
|
+
{ type: 'object', properties: { id: { type: 'string' } }, required: ['id'] },
|
|
13345
13392
|
] }
|
|
13346
13393
|
```
|
|
13347
13394
|
|
|
13395
|
+
Alternatives come in kind order, independent of variant order. The same shape
|
|
13396
|
+
covers every collision of different kinds, scalars included: `string` against
|
|
13397
|
+
`string[]` becomes `{ anyOf: [{ type: 'array', items: { type: 'string' } }, { type:
|
|
13398
|
+
'string' }] }`. A nullable field keeps `null` in each alternative's `type`, and
|
|
13399
|
+
differing nested object unions remain nested `anyOf` inside the alternatives. Update
|
|
13400
|
+
snapshots to this order.
|
|
13401
|
+
|
|
13348
13402
|
Traverse each nested alternative when inspecting schemas and regenerate schema
|
|
13349
13403
|
snapshots. Verify the actual manifest with the chosen provider. Keep flatten
|
|
13350
13404
|
enabled when a top-level discriminated union needs to be advertised as an
|
|
@@ -17292,18 +17346,22 @@ can emit / propagate a `traceparent` (see `HttpClientConfig.trace`).
|
|
|
17292
17346
|
|
|
17293
17347
|
`createSessionScope` (`stitchkit`) returns the generic `SessionScope`: `replace(context)`
|
|
17294
17348
|
creates a new login lifetime (including same-account relogin), `capture()` returns
|
|
17295
|
-
its `SessionOperation<T>`, `clear()` invalidates it,
|
|
17296
|
-
the host
|
|
17349
|
+
its `SessionOperation<T>`, `clear()` invalidates it, `stop()` permanently closes
|
|
17350
|
+
the host, and `owns(operation)` answers whether an operation is this scope's current
|
|
17351
|
+
one — `current()` alone cannot tell an operation of another scope. Operations expose `id`, `generation`, `context`, `signal`, `current()` and
|
|
17297
17352
|
`assertCurrent()`. `run(callback)` checks both success and failure across an await;
|
|
17298
17353
|
`deliver(callback)` admits a synchronous final send/state change or returns false.
|
|
17299
17354
|
`bindFetch(fetch, headers?)` guards every attempt and scopes its abort signal. Wrap
|
|
17300
17355
|
the complete client call in `run` too: headers are not the response body boundary.
|
|
17301
|
-
Expired work throws `SessionExpiredError`, not a refresh instruction
|
|
17356
|
+
Expired work throws `SessionExpiredError`, not a refresh instruction; when the work
|
|
17357
|
+
itself failed, that failure is its `cause`.
|
|
17302
17358
|
|
|
17303
17359
|
`createSessionCredentials` accepts `SessionCredentialsConfig`:
|
|
17304
17360
|
`scope`, `refresh(credentials, signal)`, `storage.write(session, credentials)`,
|
|
17305
|
-
`storage.clear()`, `maxPendingWrites` (128),
|
|
17306
|
-
hour)
|
|
17361
|
+
`storage.clear()`, `maxPendingWrites` (128), `refreshTimeoutMs` (30000, at most one
|
|
17362
|
+
hour) and `storageTimeoutMs` (30000, at most one hour): a storage call past it
|
|
17363
|
+
rejects and frees the queue, so `logout()` still clears; when the late call settles,
|
|
17364
|
+
storage is written again from memory, or cleared when nobody is logged in. `SessionCredentials` provides `login`, `logout`, `read(operation)` and
|
|
17307
17365
|
`refresh(operation)`. Concurrent refresh calls in one generation share the same
|
|
17308
17366
|
promise. Logout invalidates memory before its returned persistence promise settles.
|
|
17309
17367
|
Storage errors and queue-capacity refusals reject; callers must handle them. All
|
|
@@ -17453,7 +17511,8 @@ realtime contract from `stitchkit`, and the server halves live in `stitchkit/app
|
|
|
17453
17511
|
### Session-scoped watch lifetime
|
|
17454
17512
|
|
|
17455
17513
|
`WatchClientConfig.session` captures a `SessionOperation`; `maxKeys` (1024) and
|
|
17456
|
-
`maxListenersPerKey` (128) bound retained subscriptions
|
|
17514
|
+
`maxListenersPerKey` (128) bound retained subscriptions; a handle takes its key on
|
|
17515
|
+
`subscribe`, which is where capacity refuses. Its lifetime nonce travels
|
|
17457
17516
|
in optional `WatchKey.instance`, preventing old-session frames from matching a new
|
|
17458
17517
|
client on the same socket. This is routing identity, never authorization.
|
|
17459
17518
|
|
|
@@ -17966,7 +18025,10 @@ periodically even when no notification arrives.
|
|
|
17966
18025
|
`reconcileIntervalMs` (10 ms–1 h). `hub.attach(subscriber, scope?)` accepts a
|
|
17967
18026
|
`WatchAdmissionScope` containing a **server-verified** `key` (1–512 characters) and
|
|
17968
18027
|
revocation `signal`. The key separates sharing and is the optional third argument
|
|
17969
|
-
of `read(operation, args, scope)
|
|
18028
|
+
of `read(operation, args, scope)`; a key's `instance` routes frames and never
|
|
18029
|
+
separates sources. Attached over `maxSubscribers`, a subscriber gets a watcher whose
|
|
18030
|
+
`open` refuses with `Watch subscriber capacity exceeded`; `attach` does not throw
|
|
18031
|
+
for capacity. It must represent account, session and permissions;
|
|
17970
18032
|
never trust a client-supplied owner ID as that scope.
|
|
17971
18033
|
|
|
17972
18034
|
|
|
@@ -17977,7 +18039,13 @@ never trust a client-supplied owner ID as that scope.
|
|
|
17977
18039
|
immutable executor `version`, pure `actions(payload)` plan selector (1–128 unique
|
|
17978
18040
|
names, each at most 128 characters), and idempotent `project(notification, receipts)`.
|
|
17979
18041
|
`send` receives optional `action` and stable `idempotencyKey`, and returns a JSON
|
|
17980
|
-
remote receipt (void becomes null).
|
|
18042
|
+
remote receipt (void becomes null). A result that is not JSON or does not fit the
|
|
18043
|
+
byte budget is kept as `receipt: null` with `unrecorded: 'not-json' | 'too-large'`;
|
|
18044
|
+
the action stays confirmed and is not sent again. `retiredVersions` maps earlier
|
|
18045
|
+
plan versions to their `NotificationProjection` so queued items drain after an
|
|
18046
|
+
executor upgrade; an unknown version is reported to `onError` as
|
|
18047
|
+
`NotificationPlanVersionError` and waits, spending no attempt and not consulting
|
|
18048
|
+
`classify`, for an executor that knows it. `NotificationDeliveryStateSchema` validates the
|
|
17981
18049
|
optional `NotificationDeliveryState` on queued items and completed receipts:
|
|
17982
18050
|
`version`, `actions`, `receipts` and optional `projectedAt`. Checkpoints share the
|
|
17983
18051
|
existing atomic StateStore and lease fence. Receipt retention and serialized byte
|
|
@@ -18163,7 +18231,7 @@ Server-only optional application runtime. See the
|
|
|
18163
18231
|
| `AgentSandboxProcess` / `AgentSandboxOutputStream` | _types_ | structural child/output interface for optional lifecycle-owned `AgentProcessSandbox.spawn`, without Node ambient type dependencies |
|
|
18164
18232
|
| `AgentEventSearchResultSchema` / `AgentEventSearchResult` / `createSqliteAgentEventSearch` / `createAgentEventSearchTools` | schema / _type_ / functions | authorized FTS5 search with exact event addresses and `session_*` tools |
|
|
18165
18233
|
| `createSqliteAgentSpillStore` | function | durable content-address-checked artifact storage, bounded read/search, retention facts and archive participation |
|
|
18166
|
-
| `AgentScheduleSchema` / `AgentSchedule` / `AgentScheduleService` / `AgentScheduleDeliveryOutcomeSchema` / `AgentScheduleDeliveryOutcome` / `createAgentScheduleService` / `createAgentScheduleTools` | schemas / _types_ / functions | durable `at`/`after`/timezone-explicit `every`, indexed retry eligibility, typed retry/terminal failure, bounded dispatch and fenced stable occurrence identity (ADR 0202) |
|
|
18234
|
+
| `AgentScheduleSchema` / `AgentSchedule` / `AgentScheduleService` / `AgentScheduleDeliveryOutcomeSchema` / `AgentScheduleDeliveryOutcome` / `createAgentScheduleService` / `createAgentScheduleTools` | schemas / _types_ / functions | durable `at`/`after`/timezone-explicit `every`, indexed retry eligibility, typed retry/terminal failure (any other returned value delivers), `maxAttempts` (default 1000) per occurrence — a one-off ends `failed`, a recurring schedule skips to its next slot — bounded dispatch and fenced stable occurrence identity (ADR 0202) |
|
|
18167
18235
|
| `AgentChildBudgetSchema` / `AgentChildBudget` / `AgentChildStateSchema` / `AgentChildState` / `AgentChildRecordSchema` / `AgentChildRecord` | schema / _type_ | durable child graph, bounded seed and measured budget state |
|
|
18168
18236
|
| `AgentChildBlockingKindSchema` / `AgentChildBlockingKind` / `AgentChildBlockingSourceSchema` / `AgentChildBlockingSource` / `AgentChildBlockingEventSchema` / `AgentChildBlockingEvent` / `AgentChildBlockingDecision` | schemas / _types_ | parent-owned request identities; responses discriminate approval decisions from JSON input values |
|
|
18169
18237
|
| `AgentChildHandle` / `AgentChildManager` / `SqliteAgentChildManagerConfig` / `createSqliteAgentChildManager` / `createAgentChildTools` / `agentChildBudgetStopPolicy` | _type_ / functions | host execution port, child lifecycle, cascade (given to `createAgentRuntime` as `children`), messaging, Agent tools, and the child runtime's own budget stop policy — `recordStepUsage` at every step boundary, `policy_stop` as `child-budget` when spent |
|
|
@@ -18324,7 +18392,9 @@ operator-only observability sink explicitly opts in.
|
|
|
18324
18392
|
`ModelInvocationConfig`: the existing store and model registry, a 32-byte payload
|
|
18325
18393
|
key, required host authorization, optional bounded payload size and `onAttempt`.
|
|
18326
18394
|
`complete(input, context, signal?)` executes only the supplied prompt, with no tools
|
|
18327
|
-
or framework instructions; repeated keys return the existing invocation ID.
|
|
18395
|
+
or framework instructions; repeated keys return the existing invocation ID. It
|
|
18396
|
+
resolves `{ invocationId, outcome, text?, receiptError? }`: `receiptError` says a
|
|
18397
|
+
receipt could not be written and never changes `outcome` or drops `text`.
|
|
18328
18398
|
`read(input, context)` returns a bounded event page shared by agent and completion;
|
|
18329
18399
|
`readPayload(input, context)` requires a separate authorization action to decrypt
|
|
18330
18400
|
one protected artifact. See the [guide and migration example](../guide/agent-runtime.md#plain-completions-and-shared-invocation-receipts).
|
|
@@ -18339,8 +18409,11 @@ one protected artifact. See the [guide and migration example](../guide/agent-run
|
|
|
18339
18409
|
|
|
18340
18410
|
The runtime `invocations` option takes this ledger and a trace callback; it requires
|
|
18341
18411
|
the same store and preserves the existing tool loop. `AgentRuntimeStore.appendEventOnce`
|
|
18342
|
-
is an optional atomic capability required by receipt admission
|
|
18343
|
-
|
|
18412
|
+
is an optional atomic capability required by receipt admission, and
|
|
18413
|
+
`AgentRuntimeStore.findEventOnce` reads the event it wrote by kind and key. Built-in
|
|
18414
|
+
stores supply both; custom adapters must honor the once-only transaction contract.
|
|
18415
|
+
A driver's optional `events.find(transaction, { conversationId, eventId })` makes
|
|
18416
|
+
both one lookup instead of a scan of the conversation log.
|
|
18344
18417
|
|
|
18345
18418
|
## `stitchkit/agent-runtime/testing`
|
|
18346
18419
|
|