stitchkit 0.94.0 → 0.94.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 +64 -0
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
- package/dist/agent-runtime/contained-darwin.d.ts +38 -0
- package/dist/agent-runtime/contained-darwin.d.ts.map +1 -0
- package/dist/agent-runtime/contained-files.d.ts +11 -26
- package/dist/agent-runtime/contained-files.d.ts.map +1 -1
- package/dist/agent-runtime/contained-scan.d.ts +21 -0
- package/dist/agent-runtime/contained-scan.d.ts.map +1 -0
- package/dist/agent-runtime/contained-write.d.ts +9 -0
- package/dist/agent-runtime/contained-write.d.ts.map +1 -0
- package/dist/agent-runtime/deferred-tool-types.d.ts +3 -2
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/harness-control.d.ts +0 -1
- package/dist/agent-runtime/harness-control.d.ts.map +1 -1
- package/dist/agent-runtime/harness.d.ts +0 -5
- package/dist/agent-runtime/harness.d.ts.map +1 -1
- package/dist/agent-runtime/managed-tools.d.ts +3 -2
- package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
- package/dist/agent-runtime/runtime.d.ts +1 -1
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-records.d.ts +34 -0
- package/dist/agent-runtime/schedule-records.d.ts.map +1 -0
- package/dist/agent-runtime/schedules.d.ts +34 -0
- package/dist/agent-runtime/schedules.d.ts.map +1 -1
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +434 -0
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-ordering.d.ts +18 -0
- package/dist/agent-runtime/store-conformance-ordering.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-support.d.ts +130 -0
- package/dist/agent-runtime/store-conformance-support.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-terminal.d.ts +12 -0
- package/dist/agent-runtime/store-conformance-terminal.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance.d.ts.map +1 -1
- package/dist/application/admission-rate.d.ts +21 -0
- package/dist/application/admission-rate.d.ts.map +1 -0
- package/dist/application/admission-run.d.ts +8 -0
- package/dist/application/admission-run.d.ts.map +1 -0
- package/dist/application/admission.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-lock.d.ts +9 -34
- package/dist/application/diagnostic-journal-lock.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
- package/dist/application/kernel-resource-context.d.ts.map +1 -1
- package/dist/application/notification-outbox.d.ts.map +1 -1
- package/dist/application/schedule.d.ts +0 -1
- package/dist/application/schedule.d.ts.map +1 -1
- package/dist/application/watch-hub-core.d.ts +122 -0
- package/dist/application/watch-hub-core.d.ts.map +1 -0
- package/dist/application/watch-hub.d.ts +2 -2
- package/dist/application/watch-hub.d.ts.map +1 -1
- package/dist/browser/client-executors.d.ts +14 -0
- package/dist/browser/client-executors.d.ts.map +1 -0
- package/dist/browser/client-multipart.d.ts +1 -1
- package/dist/browser/client-multipart.d.ts.map +1 -1
- package/dist/browser/client.d.ts +3 -2
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/http-fetch.d.ts +22 -0
- package/dist/browser/http-fetch.d.ts.map +1 -0
- package/dist/browser/http.d.ts +1 -3
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/live-state-core.d.ts +63 -0
- package/dist/browser/live-state-core.d.ts.map +1 -0
- package/dist/browser/live-state.d.ts.map +1 -1
- package/dist/browser/realtime-client.d.ts +26 -0
- package/dist/browser/realtime-client.d.ts.map +1 -0
- package/dist/browser/socket-io-connection.d.ts +82 -0
- package/dist/browser/socket-io-connection.d.ts.map +1 -0
- package/dist/browser/socket-io-peer.d.ts +20 -0
- package/dist/browser/socket-io-peer.d.ts.map +1 -0
- package/dist/browser/socket-io-trace.d.ts +31 -0
- package/dist/browser/socket-io-trace.d.ts.map +1 -0
- package/dist/browser/socket-io.d.ts +2 -18
- package/dist/browser/socket-io.d.ts.map +1 -1
- package/dist/contract/client-types.d.ts +134 -0
- package/dist/contract/client-types.d.ts.map +1 -0
- package/dist/contract/define-validation.d.ts +30 -0
- package/dist/contract/define-validation.d.ts.map +1 -0
- package/dist/contract/define.d.ts +3 -357
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/runtime-context.d.ts +131 -0
- package/dist/contract/runtime-context.d.ts.map +1 -0
- package/dist/contract/tool-options.d.ts +105 -0
- package/dist/contract/tool-options.d.ts.map +1 -0
- package/dist/contract/tool-view.d.ts +15 -2
- package/dist/contract/tool-view.d.ts.map +1 -1
- package/dist/durability/contract.d.ts +83 -0
- package/dist/durability/contract.d.ts.map +1 -1
- package/dist/durability/effect.d.ts +24 -0
- package/dist/durability/effect.d.ts.map +1 -0
- package/dist/durability/engine.d.ts +2 -2
- package/dist/durability/engine.d.ts.map +1 -1
- package/dist/durability/events.d.ts +2 -0
- package/dist/durability/events.d.ts.map +1 -1
- package/dist/durability/ledger.d.ts +11 -0
- package/dist/durability/ledger.d.ts.map +1 -1
- package/dist/durability/parks.d.ts +22 -0
- package/dist/durability/parks.d.ts.map +1 -0
- package/dist/durability/scheduler.d.ts +1 -0
- package/dist/durability/scheduler.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/coding-tools.js +4 -4
- package/dist/entrypoints/agent-runtime/harness.js +127 -116
- package/dist/entrypoints/agent-runtime/sandbox.js +4 -4
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/node.js +3 -3
- package/dist/entrypoints/agent-runtime/testing.js +246 -214
- package/dist/entrypoints/agent-runtime.js +224 -203
- package/dist/entrypoints/application/diagnostic-journal.js +63 -203
- package/dist/entrypoints/application/opentelemetry.js +1 -1
- package/dist/entrypoints/application.js +361 -324
- package/dist/entrypoints/cli.d.ts +4 -1
- package/dist/entrypoints/cli.d.ts.map +1 -1
- package/dist/entrypoints/cli.js +57 -35
- package/dist/entrypoints/contract.d.ts +5 -2
- package/dist/entrypoints/contract.d.ts.map +1 -1
- package/dist/entrypoints/contract.js +3 -2
- package/dist/entrypoints/files.d.ts +2 -0
- package/dist/entrypoints/files.d.ts.map +1 -1
- package/dist/entrypoints/files.js +98 -2
- package/dist/entrypoints/index.d.ts +4 -2
- package/dist/entrypoints/index.d.ts.map +1 -1
- package/dist/entrypoints/index.js +348 -282
- package/dist/entrypoints/live.js +89 -71
- package/dist/entrypoints/node.d.ts +2 -1
- package/dist/entrypoints/node.d.ts.map +1 -1
- package/dist/entrypoints/node.js +13 -12
- package/dist/entrypoints/react.js +1 -1
- package/dist/entrypoints/remote.js +4 -4
- package/dist/entrypoints/server.d.ts +4 -2
- package/dist/entrypoints/server.d.ts.map +1 -1
- package/dist/entrypoints/server.js +293 -79
- package/dist/entrypoints/testing.d.ts +2 -1
- package/dist/entrypoints/testing.d.ts.map +1 -1
- package/dist/entrypoints/testing.js +288 -281
- package/dist/entrypoints/tools/connections.js +2 -2
- package/dist/entrypoints/tools/invoker.js +4 -4
- package/dist/entrypoints/tools.d.ts +6 -3
- package/dist/entrypoints/tools.d.ts.map +1 -1
- package/dist/entrypoints/tools.js +245 -202
- package/dist/entrypoints/tracking.js +325 -274
- package/dist/files/boundary.d.ts.map +1 -1
- package/dist/files/file-io.d.ts +14 -0
- package/dist/files/file-io.d.ts.map +1 -0
- package/dist/index-1j8pm5t0.js +412 -0
- package/dist/{index-kvj7f4hq.js → index-2bxbyab0.js} +10 -2
- package/dist/{index-xnj9bgxe.js → index-2gxzjvyr.js} +2 -162
- package/dist/index-4gcnakhx.js +82 -0
- package/dist/{index-j05z5gn4.js → index-55hkhm67.js} +136 -119
- package/dist/{index-cq4qfycf.js → index-79z7m7dt.js} +227 -59
- package/dist/{index-97ac4gph.js → index-7f68ghdn.js} +3 -3
- package/dist/{index-r7nmqpsg.js → index-7p1f0vp2.js} +1 -1
- package/dist/{index-dcpdvjsc.js → index-863ea9jb.js} +4 -4
- package/dist/index-8p52kd5p.js +242 -0
- package/dist/{index-2qzskm8h.js → index-dce5wxcq.js} +1 -1
- package/dist/index-e01r054k.js +105 -0
- package/dist/{index-sees8yf8.js → index-ensd0r74.js} +118 -111
- package/dist/{index-1nd48tm9.js → index-gxrt5h6v.js} +2 -1
- package/dist/{index-e87kakm4.js → index-ham5sz8m.js} +112 -110
- package/dist/{index-kj2wbeta.js → index-het2he5g.js} +280 -196
- package/dist/{index-vcvkq30w.js → index-hmp4800j.js} +3 -3
- package/dist/{index-gyr48nzg.js → index-k30h66yd.js} +71 -151
- package/dist/{index-2cr1cqhn.js → index-khtgb21r.js} +2 -2
- package/dist/{index-x4799c19.js → index-ndddxtyx.js} +11 -11
- package/dist/{index-dydjcp8z.js → index-np4m8hd3.js} +38 -36
- package/dist/{index-p81267c2.js → index-p3vsv1fb.js} +621 -357
- package/dist/{index-mp5sn43f.js → index-p9e0w8hs.js} +2 -2
- package/dist/{index-rewkc2hj.js → index-p9sh0xx4.js} +3 -3
- package/dist/{index-70yj2ebz.js → index-paz6sgdp.js} +107 -103
- package/dist/{index-bn2cjajt.js → index-px2gm2jp.js} +26 -102
- package/dist/index-s812ycat.js +65 -0
- package/dist/{index-xsqjkha9.js → index-sp1tzwnb.js} +2 -2
- package/dist/{index-n6hxg8as.js → index-t9rhjr9f.js} +615 -566
- package/dist/{index-zeemqhqx.js → index-v260df89.js} +88 -80
- package/dist/{index-fdp6hdxn.js → index-w906953s.js} +5 -1
- package/dist/{index-mdzh02yc.js → index-wdkt63w3.js} +1 -1
- package/dist/{index-58k4fp34.js → index-wsm5w4ee.js} +1 -1
- package/dist/{index-v38qyerb.js → index-xw3s75nj.js} +1 -1
- package/dist/internal/atomic-file.d.ts +23 -2
- package/dist/internal/atomic-file.d.ts.map +1 -1
- package/dist/internal/exclusive-lock.d.ts +51 -0
- package/dist/internal/exclusive-lock.d.ts.map +1 -0
- package/dist/internal/process-identity.d.ts +47 -0
- package/dist/internal/process-identity.d.ts.map +1 -0
- package/dist/internal/with-exclusive-lock.d.ts +67 -0
- package/dist/internal/with-exclusive-lock.d.ts.map +1 -0
- package/dist/live/watch-client.d.ts.map +1 -1
- package/dist/observability/audit.d.ts +2 -2
- package/dist/observability/audit.d.ts.map +1 -1
- package/dist/observability/event.d.ts +2 -1
- package/dist/observability/event.d.ts.map +1 -1
- package/dist/primitives/export-operation.d.ts +1 -1
- package/dist/primitives/export-operation.d.ts.map +1 -1
- package/dist/realtime/registry.d.ts +0 -5
- package/dist/realtime/registry.d.ts.map +1 -1
- package/dist/server/bun.d.ts +0 -1
- package/dist/server/bun.d.ts.map +1 -1
- package/dist/server/context-contribution.d.ts +1 -1
- package/dist/server/context-contribution.d.ts.map +1 -1
- package/dist/server/context.d.ts +1 -1
- package/dist/server/context.d.ts.map +1 -1
- package/dist/server/endpoint-response.d.ts +2 -1
- package/dist/server/endpoint-response.d.ts.map +1 -1
- package/dist/server/error-dispatch.d.ts +1 -1
- package/dist/server/error-dispatch.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +1 -1
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts +1 -1
- package/dist/server/handler-state.d.ts.map +1 -1
- package/dist/server/implement-registry.d.ts +54 -0
- package/dist/server/implement-registry.d.ts.map +1 -0
- package/dist/server/implement.d.ts +9 -55
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/middleware/auth.d.ts +1 -31
- package/dist/server/middleware/auth.d.ts.map +1 -1
- package/dist/server/middleware/jwt.d.ts +31 -0
- package/dist/server/middleware/jwt.d.ts.map +1 -0
- package/dist/server/multipart-reader.d.ts +22 -0
- package/dist/server/multipart-reader.d.ts.map +1 -0
- package/dist/server/multipart.d.ts +1 -1
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/server/oauth/cimd.d.ts +88 -0
- package/dist/server/oauth/cimd.d.ts.map +1 -0
- package/dist/server/oauth/endpoints.d.ts +39 -0
- package/dist/server/oauth/endpoints.d.ts.map +1 -0
- package/dist/server/oauth/provider.d.ts +1 -68
- package/dist/server/oauth/provider.d.ts.map +1 -1
- package/dist/server/streaming-pump.d.ts +66 -0
- package/dist/server/streaming-pump.d.ts.map +1 -0
- package/dist/server/streaming-route.d.ts +12 -5
- package/dist/server/streaming-route.d.ts.map +1 -1
- package/dist/server/types.d.ts +4 -1
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/unix-client-bun.d.ts.map +1 -1
- package/dist/server/unix-client-http1.d.ts +76 -0
- package/dist/server/unix-client-http1.d.ts.map +1 -0
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/testing/handler-clients.d.ts +2 -1
- package/dist/testing/handler-clients.d.ts.map +1 -1
- package/dist/testing/realtime-probe.d.ts +33 -0
- package/dist/testing/realtime-probe.d.ts.map +1 -0
- package/dist/testing/surface-conformance.d.ts +0 -31
- package/dist/testing/surface-conformance.d.ts.map +1 -1
- package/dist/testing/surface-manifest-digest.d.ts +44 -0
- package/dist/testing/surface-manifest-digest.d.ts.map +1 -0
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +1 -1
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/args-fields.d.ts +31 -0
- package/dist/tools/cli/args-fields.d.ts.map +1 -0
- package/dist/tools/cli/args-route.d.ts +42 -0
- package/dist/tools/cli/args-route.d.ts.map +1 -0
- package/dist/tools/cli/args-view.d.ts +32 -0
- package/dist/tools/cli/args-view.d.ts.map +1 -0
- package/dist/tools/cli/args.d.ts +2 -65
- package/dist/tools/cli/args.d.ts.map +1 -1
- package/dist/tools/cli/argument-error.d.ts +5 -0
- package/dist/tools/cli/argument-error.d.ts.map +1 -0
- package/dist/tools/cli/checkpoint.d.ts.map +1 -1
- package/dist/tools/cli/command.d.ts +1 -1
- package/dist/tools/cli/command.d.ts.map +1 -1
- package/dist/tools/cli/config.d.ts +1 -1
- package/dist/tools/cli/config.d.ts.map +1 -1
- package/dist/tools/cli/format.d.ts +2 -1
- package/dist/tools/cli/format.d.ts.map +1 -1
- package/dist/tools/cli/invoke.d.ts +2 -1
- package/dist/tools/cli/invoke.d.ts.map +1 -1
- package/dist/tools/cli/managed-surface.d.ts +1 -1
- package/dist/tools/cli/managed-surface.d.ts.map +1 -1
- package/dist/tools/cli/policy.d.ts +1 -1
- package/dist/tools/cli/policy.d.ts.map +1 -1
- package/dist/tools/cli/prepare.d.ts.map +1 -1
- package/dist/tools/cli/run-managed.d.ts.map +1 -1
- package/dist/tools/cli/session.d.ts +1 -1
- package/dist/tools/cli/session.d.ts.map +1 -1
- package/dist/tools/cli/update.d.ts +19 -0
- package/dist/tools/cli/update.d.ts.map +1 -1
- package/dist/tools/cli/view.d.ts +1 -1
- package/dist/tools/cli/view.d.ts.map +1 -1
- package/dist/tools/cli/wait.d.ts +1 -1
- package/dist/tools/cli/wait.d.ts.map +1 -1
- package/dist/tools/connections/runtime.d.ts +1 -1
- package/dist/tools/connections/runtime.d.ts.map +1 -1
- package/dist/tools/execute-args.d.ts +23 -0
- package/dist/tools/execute-args.d.ts.map +1 -0
- package/dist/tools/execute-hooks.d.ts +146 -0
- package/dist/tools/execute-hooks.d.ts.map +1 -0
- package/dist/tools/execute-result.d.ts +40 -0
- package/dist/tools/execute-result.d.ts.map +1 -0
- package/dist/tools/execute.d.ts +4 -193
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/internal/surface-projector.d.ts +2 -1
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts +2 -1
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/lifecycle.d.ts +1 -1
- package/dist/tools/lifecycle.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +1 -1
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/prepare.d.ts +2 -1
- package/dist/tools/mcp/prepare.d.ts.map +1 -1
- package/dist/tools/mcp/progress.d.ts +1 -1
- package/dist/tools/mcp/progress.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts +3 -2
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/dist/tools/mcp/round-context.d.ts +38 -0
- package/dist/tools/mcp/round-context.d.ts.map +1 -0
- package/dist/tools/mcp/round-policy.d.ts +1 -1
- package/dist/tools/mcp/round-policy.d.ts.map +1 -1
- package/dist/tools/mcp/round.d.ts +3 -11
- package/dist/tools/mcp/round.d.ts.map +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts +2 -1
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
- package/dist/tools/mount.d.ts +3 -1
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/native-definition.d.ts +2 -1
- package/dist/tools/native-definition.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-runtime-tools.d.ts +2 -1
- package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-runtime-types.d.ts +2 -1
- package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -1
- package/dist/tools/remote.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +3 -1
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/tool-logger.d.ts +1 -1
- package/dist/tools/tool-logger.d.ts.map +1 -1
- package/dist/tracking/client-listeners.d.ts +30 -0
- package/dist/tracking/client-listeners.d.ts.map +1 -0
- package/dist/tracking/client-visit.d.ts +61 -0
- package/dist/tracking/client-visit.d.ts.map +1 -0
- package/dist/tracking/client.d.ts +3 -2
- package/dist/tracking/client.d.ts.map +1 -1
- package/llms/application.2.txt +266 -2
- package/llms/application.txt +8 -266
- package/llms/cli.2.txt +80 -0
- package/llms/cli.txt +45 -74
- package/llms/contract.txt +3 -3
- package/llms/files.txt +3 -0
- package/llms/tools.2.txt +88 -279
- package/llms/tools.3.txt +288 -0
- package/llms/tools.txt +27 -65
- package/llms-full.txt +108 -12
- package/llms.txt +5 -5
- package/package.json +1 -1
- package/dist/index-e2z3ahw9.js +0 -325
- package/dist/index-mkm15s49.js +0 -394
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The run-lifecycle scenario of the agent-store conformance kit, in the phases
|
|
3
|
+
* it walks one run through: admitted, acquired and fenced, read back, operated
|
|
4
|
+
* and interrupted, settled by a terminal race — and a second run abandoned.
|
|
5
|
+
* Each phase hands the next exactly what it needs.
|
|
6
|
+
*/
|
|
7
|
+
import { type AgentRun } from './schemas.js';
|
|
8
|
+
import type { AgentRuntimeStore } from './store.js';
|
|
9
|
+
/** Admission: idempotent, coalescing, refusing reserved identities, surviving compaction. */
|
|
10
|
+
export declare function admissionPhase(store: AgentRuntimeStore, conversationId: string): Promise<{
|
|
11
|
+
schemaVersion: 1;
|
|
12
|
+
id: string;
|
|
13
|
+
conversationId: string;
|
|
14
|
+
inputMessageIds: string[];
|
|
15
|
+
assistantMessageId: string;
|
|
16
|
+
state: "abandoned" | "cancelled" | "completed" | "failed" | "interrupt_requested" | "interrupted" | "queued" | "running" | "superseded";
|
|
17
|
+
revision: number;
|
|
18
|
+
queuePriority?: "interrupt-next" | undefined;
|
|
19
|
+
executionSequence?: number | undefined;
|
|
20
|
+
ownerId?: string | undefined;
|
|
21
|
+
fencingToken?: number | undefined;
|
|
22
|
+
terminalReason?: "abandoned" | "absorbed" | "cancelled" | "context_overflow" | "interrupted" | "output_rejected" | "policy_stop" | "provider_failure" | "provider_stop" | "runtime_failure" | "shutdown" | "storage_conflict" | "success" | "superseded" | "timeout" | undefined;
|
|
23
|
+
terminalPolicyName?: string | undefined;
|
|
24
|
+
absorbedIntoRunId?: string | undefined;
|
|
25
|
+
usage?: {
|
|
26
|
+
inputTokens: {
|
|
27
|
+
value?: number | undefined;
|
|
28
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
29
|
+
};
|
|
30
|
+
outputTokens: {
|
|
31
|
+
value?: number | undefined;
|
|
32
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
33
|
+
};
|
|
34
|
+
reasoningTokens?: {
|
|
35
|
+
value?: number | undefined;
|
|
36
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
37
|
+
} | undefined;
|
|
38
|
+
cacheReadTokens?: {
|
|
39
|
+
value?: number | undefined;
|
|
40
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
41
|
+
} | undefined;
|
|
42
|
+
cacheWriteTokens?: {
|
|
43
|
+
value?: number | undefined;
|
|
44
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
45
|
+
} | undefined;
|
|
46
|
+
cost?: {
|
|
47
|
+
value?: number | undefined;
|
|
48
|
+
currency?: string | undefined;
|
|
49
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
50
|
+
} | undefined;
|
|
51
|
+
} | undefined;
|
|
52
|
+
lastOperation?: {
|
|
53
|
+
operationId: string;
|
|
54
|
+
kind: "compaction" | "model-request";
|
|
55
|
+
phase: "cancelled" | "completed" | "failed" | "first-output" | "started";
|
|
56
|
+
step?: number | undefined;
|
|
57
|
+
startedAt: string;
|
|
58
|
+
firstOutputAt?: string | undefined;
|
|
59
|
+
finishedAt?: string | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
createdAt: string;
|
|
62
|
+
updatedAt: string;
|
|
63
|
+
}>;
|
|
64
|
+
/** Acquisition and fencing: a stale revision, a stale token and another owner all conflict. */
|
|
65
|
+
export declare function fencingPhase(store: AgentRuntimeStore, conversationId: string, assigned: AgentRun): Promise<{
|
|
66
|
+
running: {
|
|
67
|
+
schemaVersion: 1;
|
|
68
|
+
id: string;
|
|
69
|
+
conversationId: string;
|
|
70
|
+
inputMessageIds: string[];
|
|
71
|
+
assistantMessageId: string;
|
|
72
|
+
state: "abandoned" | "cancelled" | "completed" | "failed" | "interrupt_requested" | "interrupted" | "queued" | "running" | "superseded";
|
|
73
|
+
revision: number;
|
|
74
|
+
queuePriority?: "interrupt-next" | undefined;
|
|
75
|
+
executionSequence?: number | undefined;
|
|
76
|
+
ownerId?: string | undefined;
|
|
77
|
+
fencingToken?: number | undefined;
|
|
78
|
+
terminalReason?: "abandoned" | "absorbed" | "cancelled" | "context_overflow" | "interrupted" | "output_rejected" | "policy_stop" | "provider_failure" | "provider_stop" | "runtime_failure" | "shutdown" | "storage_conflict" | "success" | "superseded" | "timeout" | undefined;
|
|
79
|
+
terminalPolicyName?: string | undefined;
|
|
80
|
+
absorbedIntoRunId?: string | undefined;
|
|
81
|
+
usage?: {
|
|
82
|
+
inputTokens: {
|
|
83
|
+
value?: number | undefined;
|
|
84
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
85
|
+
};
|
|
86
|
+
outputTokens: {
|
|
87
|
+
value?: number | undefined;
|
|
88
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
89
|
+
};
|
|
90
|
+
reasoningTokens?: {
|
|
91
|
+
value?: number | undefined;
|
|
92
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
93
|
+
} | undefined;
|
|
94
|
+
cacheReadTokens?: {
|
|
95
|
+
value?: number | undefined;
|
|
96
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
97
|
+
} | undefined;
|
|
98
|
+
cacheWriteTokens?: {
|
|
99
|
+
value?: number | undefined;
|
|
100
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
101
|
+
} | undefined;
|
|
102
|
+
cost?: {
|
|
103
|
+
value?: number | undefined;
|
|
104
|
+
currency?: string | undefined;
|
|
105
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
106
|
+
} | undefined;
|
|
107
|
+
} | undefined;
|
|
108
|
+
lastOperation?: {
|
|
109
|
+
operationId: string;
|
|
110
|
+
kind: "compaction" | "model-request";
|
|
111
|
+
phase: "cancelled" | "completed" | "failed" | "first-output" | "started";
|
|
112
|
+
step?: number | undefined;
|
|
113
|
+
startedAt: string;
|
|
114
|
+
firstOutputAt?: string | undefined;
|
|
115
|
+
finishedAt?: string | undefined;
|
|
116
|
+
} | undefined;
|
|
117
|
+
createdAt: string;
|
|
118
|
+
updatedAt: string;
|
|
119
|
+
};
|
|
120
|
+
checkpoint: {
|
|
121
|
+
outcome: "applied";
|
|
122
|
+
snapshot: {
|
|
123
|
+
schemaVersion: 1;
|
|
124
|
+
conversationId: string;
|
|
125
|
+
version: number;
|
|
126
|
+
messages: {
|
|
127
|
+
schemaVersion: 1;
|
|
128
|
+
id: string;
|
|
129
|
+
conversationId: string;
|
|
130
|
+
runId?: string | undefined;
|
|
131
|
+
role: "assistant" | "summary" | "system" | "tool" | "user";
|
|
132
|
+
status: "committed" | "completed" | "failed" | "interrupted" | "streaming" | "superseded";
|
|
133
|
+
parts: ({
|
|
134
|
+
type: "text";
|
|
135
|
+
text: string;
|
|
136
|
+
} | {
|
|
137
|
+
type: "reasoning";
|
|
138
|
+
text: string;
|
|
139
|
+
provider?: {
|
|
140
|
+
schemaVersion: number;
|
|
141
|
+
provider: string;
|
|
142
|
+
data: Record<string, import("zod").JSONType>;
|
|
143
|
+
} | undefined;
|
|
144
|
+
} | {
|
|
145
|
+
type: "file";
|
|
146
|
+
mediaType: string;
|
|
147
|
+
reference: string;
|
|
148
|
+
filename?: string | undefined;
|
|
149
|
+
} | {
|
|
150
|
+
type: "source";
|
|
151
|
+
sourceId: string;
|
|
152
|
+
url?: string | undefined;
|
|
153
|
+
title?: string | undefined;
|
|
154
|
+
} | {
|
|
155
|
+
type: "tool-call";
|
|
156
|
+
callId: string;
|
|
157
|
+
toolName: string;
|
|
158
|
+
input: import("zod").JSONType;
|
|
159
|
+
provider?: {
|
|
160
|
+
schemaVersion: number;
|
|
161
|
+
provider: string;
|
|
162
|
+
data: Record<string, import("zod").JSONType>;
|
|
163
|
+
} | undefined;
|
|
164
|
+
} | {
|
|
165
|
+
type: "tool-result";
|
|
166
|
+
callId: string;
|
|
167
|
+
toolName: string;
|
|
168
|
+
outcome: "error" | "interrupted" | "success";
|
|
169
|
+
output?: import("zod").JSONType | undefined;
|
|
170
|
+
} | {
|
|
171
|
+
type: "tool-approval-request";
|
|
172
|
+
approvalId: string;
|
|
173
|
+
callId: string;
|
|
174
|
+
isAutomatic?: boolean | undefined;
|
|
175
|
+
signature?: string | undefined;
|
|
176
|
+
} | {
|
|
177
|
+
type: "tool-approval-response";
|
|
178
|
+
approvalId: string;
|
|
179
|
+
approved: boolean;
|
|
180
|
+
reason?: string | undefined;
|
|
181
|
+
} | {
|
|
182
|
+
type: "provider";
|
|
183
|
+
envelope: {
|
|
184
|
+
schemaVersion: number;
|
|
185
|
+
provider: string;
|
|
186
|
+
data: Record<string, import("zod").JSONType>;
|
|
187
|
+
};
|
|
188
|
+
} | {
|
|
189
|
+
type: "control";
|
|
190
|
+
reason: "run-interrupted" | "stale-run";
|
|
191
|
+
})[];
|
|
192
|
+
metadata?: Record<string, import("zod").JSONType> | undefined;
|
|
193
|
+
createdAt: string;
|
|
194
|
+
updatedAt: string;
|
|
195
|
+
}[];
|
|
196
|
+
runs: {
|
|
197
|
+
schemaVersion: 1;
|
|
198
|
+
id: string;
|
|
199
|
+
conversationId: string;
|
|
200
|
+
inputMessageIds: string[];
|
|
201
|
+
assistantMessageId: string;
|
|
202
|
+
state: "abandoned" | "cancelled" | "completed" | "failed" | "interrupt_requested" | "interrupted" | "queued" | "running" | "superseded";
|
|
203
|
+
revision: number;
|
|
204
|
+
queuePriority?: "interrupt-next" | undefined;
|
|
205
|
+
executionSequence?: number | undefined;
|
|
206
|
+
ownerId?: string | undefined;
|
|
207
|
+
fencingToken?: number | undefined;
|
|
208
|
+
terminalReason?: "abandoned" | "absorbed" | "cancelled" | "context_overflow" | "interrupted" | "output_rejected" | "policy_stop" | "provider_failure" | "provider_stop" | "runtime_failure" | "shutdown" | "storage_conflict" | "success" | "superseded" | "timeout" | undefined;
|
|
209
|
+
terminalPolicyName?: string | undefined;
|
|
210
|
+
absorbedIntoRunId?: string | undefined;
|
|
211
|
+
usage?: {
|
|
212
|
+
inputTokens: {
|
|
213
|
+
value?: number | undefined;
|
|
214
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
215
|
+
};
|
|
216
|
+
outputTokens: {
|
|
217
|
+
value?: number | undefined;
|
|
218
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
219
|
+
};
|
|
220
|
+
reasoningTokens?: {
|
|
221
|
+
value?: number | undefined;
|
|
222
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
223
|
+
} | undefined;
|
|
224
|
+
cacheReadTokens?: {
|
|
225
|
+
value?: number | undefined;
|
|
226
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
227
|
+
} | undefined;
|
|
228
|
+
cacheWriteTokens?: {
|
|
229
|
+
value?: number | undefined;
|
|
230
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
231
|
+
} | undefined;
|
|
232
|
+
cost?: {
|
|
233
|
+
value?: number | undefined;
|
|
234
|
+
currency?: string | undefined;
|
|
235
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
236
|
+
} | undefined;
|
|
237
|
+
} | undefined;
|
|
238
|
+
lastOperation?: {
|
|
239
|
+
operationId: string;
|
|
240
|
+
kind: "compaction" | "model-request";
|
|
241
|
+
phase: "cancelled" | "completed" | "failed" | "first-output" | "started";
|
|
242
|
+
step?: number | undefined;
|
|
243
|
+
startedAt: string;
|
|
244
|
+
firstOutputAt?: string | undefined;
|
|
245
|
+
finishedAt?: string | undefined;
|
|
246
|
+
} | undefined;
|
|
247
|
+
createdAt: string;
|
|
248
|
+
updatedAt: string;
|
|
249
|
+
}[];
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
checkpointedRun: {
|
|
253
|
+
schemaVersion: 1;
|
|
254
|
+
id: string;
|
|
255
|
+
conversationId: string;
|
|
256
|
+
inputMessageIds: string[];
|
|
257
|
+
assistantMessageId: string;
|
|
258
|
+
state: "abandoned" | "cancelled" | "completed" | "failed" | "interrupt_requested" | "interrupted" | "queued" | "running" | "superseded";
|
|
259
|
+
revision: number;
|
|
260
|
+
queuePriority?: "interrupt-next" | undefined;
|
|
261
|
+
executionSequence?: number | undefined;
|
|
262
|
+
ownerId?: string | undefined;
|
|
263
|
+
fencingToken?: number | undefined;
|
|
264
|
+
terminalReason?: "abandoned" | "absorbed" | "cancelled" | "context_overflow" | "interrupted" | "output_rejected" | "policy_stop" | "provider_failure" | "provider_stop" | "runtime_failure" | "shutdown" | "storage_conflict" | "success" | "superseded" | "timeout" | undefined;
|
|
265
|
+
terminalPolicyName?: string | undefined;
|
|
266
|
+
absorbedIntoRunId?: string | undefined;
|
|
267
|
+
usage?: {
|
|
268
|
+
inputTokens: {
|
|
269
|
+
value?: number | undefined;
|
|
270
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
271
|
+
};
|
|
272
|
+
outputTokens: {
|
|
273
|
+
value?: number | undefined;
|
|
274
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
275
|
+
};
|
|
276
|
+
reasoningTokens?: {
|
|
277
|
+
value?: number | undefined;
|
|
278
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
279
|
+
} | undefined;
|
|
280
|
+
cacheReadTokens?: {
|
|
281
|
+
value?: number | undefined;
|
|
282
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
283
|
+
} | undefined;
|
|
284
|
+
cacheWriteTokens?: {
|
|
285
|
+
value?: number | undefined;
|
|
286
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
287
|
+
} | undefined;
|
|
288
|
+
cost?: {
|
|
289
|
+
value?: number | undefined;
|
|
290
|
+
currency?: string | undefined;
|
|
291
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
292
|
+
} | undefined;
|
|
293
|
+
} | undefined;
|
|
294
|
+
lastOperation?: {
|
|
295
|
+
operationId: string;
|
|
296
|
+
kind: "compaction" | "model-request";
|
|
297
|
+
phase: "cancelled" | "completed" | "failed" | "first-output" | "started";
|
|
298
|
+
step?: number | undefined;
|
|
299
|
+
startedAt: string;
|
|
300
|
+
firstOutputAt?: string | undefined;
|
|
301
|
+
finishedAt?: string | undefined;
|
|
302
|
+
} | undefined;
|
|
303
|
+
createdAt: string;
|
|
304
|
+
updatedAt: string;
|
|
305
|
+
};
|
|
306
|
+
terminalAssistant: {
|
|
307
|
+
schemaVersion: 1;
|
|
308
|
+
id: string;
|
|
309
|
+
conversationId: string;
|
|
310
|
+
runId?: string | undefined;
|
|
311
|
+
role: "assistant" | "summary" | "system" | "tool" | "user";
|
|
312
|
+
status: "committed" | "completed" | "failed" | "interrupted" | "streaming" | "superseded";
|
|
313
|
+
parts: ({
|
|
314
|
+
type: "text";
|
|
315
|
+
text: string;
|
|
316
|
+
} | {
|
|
317
|
+
type: "reasoning";
|
|
318
|
+
text: string;
|
|
319
|
+
provider?: {
|
|
320
|
+
schemaVersion: number;
|
|
321
|
+
provider: string;
|
|
322
|
+
data: Record<string, import("zod").JSONType>;
|
|
323
|
+
} | undefined;
|
|
324
|
+
} | {
|
|
325
|
+
type: "file";
|
|
326
|
+
mediaType: string;
|
|
327
|
+
reference: string;
|
|
328
|
+
filename?: string | undefined;
|
|
329
|
+
} | {
|
|
330
|
+
type: "source";
|
|
331
|
+
sourceId: string;
|
|
332
|
+
url?: string | undefined;
|
|
333
|
+
title?: string | undefined;
|
|
334
|
+
} | {
|
|
335
|
+
type: "tool-call";
|
|
336
|
+
callId: string;
|
|
337
|
+
toolName: string;
|
|
338
|
+
input: import("zod").JSONType;
|
|
339
|
+
provider?: {
|
|
340
|
+
schemaVersion: number;
|
|
341
|
+
provider: string;
|
|
342
|
+
data: Record<string, import("zod").JSONType>;
|
|
343
|
+
} | undefined;
|
|
344
|
+
} | {
|
|
345
|
+
type: "tool-result";
|
|
346
|
+
callId: string;
|
|
347
|
+
toolName: string;
|
|
348
|
+
outcome: "error" | "interrupted" | "success";
|
|
349
|
+
output?: import("zod").JSONType | undefined;
|
|
350
|
+
} | {
|
|
351
|
+
type: "tool-approval-request";
|
|
352
|
+
approvalId: string;
|
|
353
|
+
callId: string;
|
|
354
|
+
isAutomatic?: boolean | undefined;
|
|
355
|
+
signature?: string | undefined;
|
|
356
|
+
} | {
|
|
357
|
+
type: "tool-approval-response";
|
|
358
|
+
approvalId: string;
|
|
359
|
+
approved: boolean;
|
|
360
|
+
reason?: string | undefined;
|
|
361
|
+
} | {
|
|
362
|
+
type: "provider";
|
|
363
|
+
envelope: {
|
|
364
|
+
schemaVersion: number;
|
|
365
|
+
provider: string;
|
|
366
|
+
data: Record<string, import("zod").JSONType>;
|
|
367
|
+
};
|
|
368
|
+
} | {
|
|
369
|
+
type: "control";
|
|
370
|
+
reason: "run-interrupted" | "stale-run";
|
|
371
|
+
})[];
|
|
372
|
+
metadata?: Record<string, import("zod").JSONType> | undefined;
|
|
373
|
+
createdAt: string;
|
|
374
|
+
updatedAt: string;
|
|
375
|
+
};
|
|
376
|
+
}>;
|
|
377
|
+
/** The two bounded reads answer what the snapshot answers, and nothing across conversations. */
|
|
378
|
+
export declare function boundedReadsPhase(store: AgentRuntimeStore, conversationId: string, absentConversationId: string, checkpointed: Awaited<ReturnType<typeof fencingPhase>>): Promise<void>;
|
|
379
|
+
/** A recoverable scan, a recorded operation and a durable interrupt of the live run. */
|
|
380
|
+
export declare function interruptPhase(store: AgentRuntimeStore, conversationId: string, checkpointed: Awaited<ReturnType<typeof fencingPhase>>): Promise<{
|
|
381
|
+
schemaVersion: 1;
|
|
382
|
+
id: string;
|
|
383
|
+
conversationId: string;
|
|
384
|
+
inputMessageIds: string[];
|
|
385
|
+
assistantMessageId: string;
|
|
386
|
+
state: "abandoned" | "cancelled" | "completed" | "failed" | "interrupt_requested" | "interrupted" | "queued" | "running" | "superseded";
|
|
387
|
+
revision: number;
|
|
388
|
+
queuePriority?: "interrupt-next" | undefined;
|
|
389
|
+
executionSequence?: number | undefined;
|
|
390
|
+
ownerId?: string | undefined;
|
|
391
|
+
fencingToken?: number | undefined;
|
|
392
|
+
terminalReason?: "abandoned" | "absorbed" | "cancelled" | "context_overflow" | "interrupted" | "output_rejected" | "policy_stop" | "provider_failure" | "provider_stop" | "runtime_failure" | "shutdown" | "storage_conflict" | "success" | "superseded" | "timeout" | undefined;
|
|
393
|
+
terminalPolicyName?: string | undefined;
|
|
394
|
+
absorbedIntoRunId?: string | undefined;
|
|
395
|
+
usage?: {
|
|
396
|
+
inputTokens: {
|
|
397
|
+
value?: number | undefined;
|
|
398
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
399
|
+
};
|
|
400
|
+
outputTokens: {
|
|
401
|
+
value?: number | undefined;
|
|
402
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
403
|
+
};
|
|
404
|
+
reasoningTokens?: {
|
|
405
|
+
value?: number | undefined;
|
|
406
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
407
|
+
} | undefined;
|
|
408
|
+
cacheReadTokens?: {
|
|
409
|
+
value?: number | undefined;
|
|
410
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
411
|
+
} | undefined;
|
|
412
|
+
cacheWriteTokens?: {
|
|
413
|
+
value?: number | undefined;
|
|
414
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
415
|
+
} | undefined;
|
|
416
|
+
cost?: {
|
|
417
|
+
value?: number | undefined;
|
|
418
|
+
currency?: string | undefined;
|
|
419
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
420
|
+
} | undefined;
|
|
421
|
+
} | undefined;
|
|
422
|
+
lastOperation?: {
|
|
423
|
+
operationId: string;
|
|
424
|
+
kind: "compaction" | "model-request";
|
|
425
|
+
phase: "cancelled" | "completed" | "failed" | "first-output" | "started";
|
|
426
|
+
step?: number | undefined;
|
|
427
|
+
startedAt: string;
|
|
428
|
+
firstOutputAt?: string | undefined;
|
|
429
|
+
finishedAt?: string | undefined;
|
|
430
|
+
} | undefined;
|
|
431
|
+
createdAt: string;
|
|
432
|
+
updatedAt: string;
|
|
433
|
+
}>;
|
|
434
|
+
//# sourceMappingURL=store-conformance-lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-conformance-lifecycle.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-conformance-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGjD,6FAA6F;AAC7F,wBAAsB,cAAc,CAAC,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0GpF;AAED,+FAA+F;AAC/F,wBAAsB,YAAY,CAChC,KAAK,EAAE,iBAAiB,EACxB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4InB;AAED,gGAAgG;AAChG,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,iBAAiB,EACxB,cAAc,EAAE,MAAM,EACtB,oBAAoB,EAAE,MAAM,EAC5B,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,GACrD,OAAO,CAAC,IAAI,CAAC,CAqDf;AAED,wFAAwF;AACxF,wBAAsB,cAAc,CAClC,KAAK,EAAE,iBAAiB,EACxB,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CvD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AgentRuntimeStore } from './store.js';
|
|
2
|
+
/** Urgent queued work survives storage and becomes the next acquired run. */
|
|
3
|
+
export declare function assertInterruptPriorityOrder(store: AgentRuntimeStore, conversationId: string): Promise<void>;
|
|
4
|
+
/** Active-run reads preserve admission order when identifiers point backwards. */
|
|
5
|
+
export declare function assertActiveRunCausalOrder(store: AgentRuntimeStore, conversationId: string): Promise<void>;
|
|
6
|
+
/** A later durable admission follows the predecessor answer in every snapshot. */
|
|
7
|
+
export declare function assertCausalHistoryOrder(store: AgentRuntimeStore, conversationId: string): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* One terminal commit, two run records — and they land together or not at all.
|
|
10
|
+
*
|
|
11
|
+
* A driver that saves the run it was asked about and drops the second is the
|
|
12
|
+
* failure this exists to catch: the absorbing run would claim to have answered
|
|
13
|
+
* an input whose own run is still queued, and that input would then be answered
|
|
14
|
+
* twice. The pair is written inside one transaction, so a driver that persists
|
|
15
|
+
* one record of it fails here.
|
|
16
|
+
*/
|
|
17
|
+
export declare function assertAbsorptionIsAtomic(store: AgentRuntimeStore, conversationId: string): Promise<void>;
|
|
18
|
+
//# sourceMappingURL=store-conformance-ordering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-conformance-ordering.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-conformance-ordering.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGjD,6EAA6E;AAC7E,wBAAsB,4BAA4B,CAChD,KAAK,EAAE,iBAAiB,EACxB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CA6Gf;AAED,kFAAkF;AAClF,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,iBAAiB,EACxB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,kFAAkF;AAClF,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,iBAAiB,EACxB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CAuDf;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,iBAAiB,EACxB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CAuGf"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
export declare function userMessage(conversationId: string, id: string): {
|
|
2
|
+
schemaVersion: 1;
|
|
3
|
+
id: string;
|
|
4
|
+
conversationId: string;
|
|
5
|
+
runId?: string | undefined;
|
|
6
|
+
role: "assistant" | "summary" | "system" | "tool" | "user";
|
|
7
|
+
status: "committed" | "completed" | "failed" | "interrupted" | "streaming" | "superseded";
|
|
8
|
+
parts: ({
|
|
9
|
+
type: "text";
|
|
10
|
+
text: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: "reasoning";
|
|
13
|
+
text: string;
|
|
14
|
+
provider?: {
|
|
15
|
+
schemaVersion: number;
|
|
16
|
+
provider: string;
|
|
17
|
+
data: Record<string, import("zod").JSONType>;
|
|
18
|
+
} | undefined;
|
|
19
|
+
} | {
|
|
20
|
+
type: "file";
|
|
21
|
+
mediaType: string;
|
|
22
|
+
reference: string;
|
|
23
|
+
filename?: string | undefined;
|
|
24
|
+
} | {
|
|
25
|
+
type: "source";
|
|
26
|
+
sourceId: string;
|
|
27
|
+
url?: string | undefined;
|
|
28
|
+
title?: string | undefined;
|
|
29
|
+
} | {
|
|
30
|
+
type: "tool-call";
|
|
31
|
+
callId: string;
|
|
32
|
+
toolName: string;
|
|
33
|
+
input: import("zod").JSONType;
|
|
34
|
+
provider?: {
|
|
35
|
+
schemaVersion: number;
|
|
36
|
+
provider: string;
|
|
37
|
+
data: Record<string, import("zod").JSONType>;
|
|
38
|
+
} | undefined;
|
|
39
|
+
} | {
|
|
40
|
+
type: "tool-result";
|
|
41
|
+
callId: string;
|
|
42
|
+
toolName: string;
|
|
43
|
+
outcome: "error" | "interrupted" | "success";
|
|
44
|
+
output?: import("zod").JSONType | undefined;
|
|
45
|
+
} | {
|
|
46
|
+
type: "tool-approval-request";
|
|
47
|
+
approvalId: string;
|
|
48
|
+
callId: string;
|
|
49
|
+
isAutomatic?: boolean | undefined;
|
|
50
|
+
signature?: string | undefined;
|
|
51
|
+
} | {
|
|
52
|
+
type: "tool-approval-response";
|
|
53
|
+
approvalId: string;
|
|
54
|
+
approved: boolean;
|
|
55
|
+
reason?: string | undefined;
|
|
56
|
+
} | {
|
|
57
|
+
type: "provider";
|
|
58
|
+
envelope: {
|
|
59
|
+
schemaVersion: number;
|
|
60
|
+
provider: string;
|
|
61
|
+
data: Record<string, import("zod").JSONType>;
|
|
62
|
+
};
|
|
63
|
+
} | {
|
|
64
|
+
type: "control";
|
|
65
|
+
reason: "run-interrupted" | "stale-run";
|
|
66
|
+
})[];
|
|
67
|
+
metadata?: Record<string, import("zod").JSONType> | undefined;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
updatedAt: string;
|
|
70
|
+
};
|
|
71
|
+
export declare function queuedRun(conversationId: string, inputMessageId: string, id: string): {
|
|
72
|
+
schemaVersion: 1;
|
|
73
|
+
id: string;
|
|
74
|
+
conversationId: string;
|
|
75
|
+
inputMessageIds: string[];
|
|
76
|
+
assistantMessageId: string;
|
|
77
|
+
state: "abandoned" | "cancelled" | "completed" | "failed" | "interrupt_requested" | "interrupted" | "queued" | "running" | "superseded";
|
|
78
|
+
revision: number;
|
|
79
|
+
queuePriority?: "interrupt-next" | undefined;
|
|
80
|
+
executionSequence?: number | undefined;
|
|
81
|
+
ownerId?: string | undefined;
|
|
82
|
+
fencingToken?: number | undefined;
|
|
83
|
+
terminalReason?: "abandoned" | "absorbed" | "cancelled" | "context_overflow" | "interrupted" | "output_rejected" | "policy_stop" | "provider_failure" | "provider_stop" | "runtime_failure" | "shutdown" | "storage_conflict" | "success" | "superseded" | "timeout" | undefined;
|
|
84
|
+
terminalPolicyName?: string | undefined;
|
|
85
|
+
absorbedIntoRunId?: string | undefined;
|
|
86
|
+
usage?: {
|
|
87
|
+
inputTokens: {
|
|
88
|
+
value?: number | undefined;
|
|
89
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
90
|
+
};
|
|
91
|
+
outputTokens: {
|
|
92
|
+
value?: number | undefined;
|
|
93
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
94
|
+
};
|
|
95
|
+
reasoningTokens?: {
|
|
96
|
+
value?: number | undefined;
|
|
97
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
98
|
+
} | undefined;
|
|
99
|
+
cacheReadTokens?: {
|
|
100
|
+
value?: number | undefined;
|
|
101
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
102
|
+
} | undefined;
|
|
103
|
+
cacheWriteTokens?: {
|
|
104
|
+
value?: number | undefined;
|
|
105
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
106
|
+
} | undefined;
|
|
107
|
+
cost?: {
|
|
108
|
+
value?: number | undefined;
|
|
109
|
+
currency?: string | undefined;
|
|
110
|
+
provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
|
|
111
|
+
} | undefined;
|
|
112
|
+
} | undefined;
|
|
113
|
+
lastOperation?: {
|
|
114
|
+
operationId: string;
|
|
115
|
+
kind: "compaction" | "model-request";
|
|
116
|
+
phase: "cancelled" | "completed" | "failed" | "first-output" | "started";
|
|
117
|
+
step?: number | undefined;
|
|
118
|
+
startedAt: string;
|
|
119
|
+
firstOutputAt?: string | undefined;
|
|
120
|
+
finishedAt?: string | undefined;
|
|
121
|
+
} | undefined;
|
|
122
|
+
createdAt: string;
|
|
123
|
+
updatedAt: string;
|
|
124
|
+
};
|
|
125
|
+
export declare function requireOutcome<OUTCOME extends string>(actual: {
|
|
126
|
+
outcome: string;
|
|
127
|
+
}, expected: OUTCOME): asserts actual is {
|
|
128
|
+
outcome: OUTCOME;
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=store-conformance-support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-conformance-support.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-conformance-support.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW7D;AAED,wBAAgB,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYnF;AAED,wBAAgB,cAAc,CAAC,OAAO,SAAS,MAAM,EACnD,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EAC3B,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,MAAM,IAAI;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAMxC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a run ends in the conformance kit: a terminal race that exactly one
|
|
3
|
+
* commit wins, and an abandoned run terminalized atomically.
|
|
4
|
+
*/
|
|
5
|
+
import { type AgentRun } from './schemas.js';
|
|
6
|
+
import type { AgentRuntimeStore } from './store.js';
|
|
7
|
+
import type { fencingPhase } from './store-conformance-lifecycle.js';
|
|
8
|
+
/** Two terminal commits race and exactly one applies; the result survives compaction. */
|
|
9
|
+
export declare function terminalPhase(store: AgentRuntimeStore, conversationId: string, checkpointed: Awaited<ReturnType<typeof fencingPhase>>, interruptedRun: AgentRun): Promise<void>;
|
|
10
|
+
/** An abandoned run is terminalized atomically and leaves the recoverable index. */
|
|
11
|
+
export declare function abandonPhase(store: AgentRuntimeStore, recoveryConversationId: string): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=store-conformance-terminal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-conformance-terminal.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-conformance-terminal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAsB,KAAK,QAAQ,EAAmB,MAAM,WAAW,CAAC;AAC/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGlE,yFAAyF;AACzF,wBAAsB,aAAa,CACjC,KAAK,EAAE,iBAAiB,EACxB,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,EACtD,cAAc,EAAE,QAAQ,GACvB,OAAO,CAAC,IAAI,CAAC,CAsFf;AAED,oFAAoF;AACpF,wBAAsB,YAAY,CAChC,KAAK,EAAE,iBAAiB,EACxB,sBAAsB,EAAE,MAAM,GAC7B,OAAO,CAAC,IAAI,CAAC,CAmDf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-conformance.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-conformance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"store-conformance.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-conformance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAkBjD;;;;;;;;;GASG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,WAAW,CACT,OAAO,EAAE,4BAA4B,GACpC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAClD;;;;;;;;OAQG;IACH,OAAO,CAAC,CAAC,OAAO,EAAE,4BAA4B,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,gFAAgF;AAChF,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,IAAI,CAAC,CAqCf"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sliding windows behind admission's rate budgets: samples expire after
|
|
3
|
+
* their interval, and a refusal says how long until the oldest one does.
|
|
4
|
+
*/
|
|
5
|
+
import type { BoundedAdmissionPerKeyLimits, BoundedAdmissionPolicy, BoundedRateBudget } from './admission.js';
|
|
6
|
+
export interface RateSample {
|
|
7
|
+
readonly at: number;
|
|
8
|
+
}
|
|
9
|
+
export interface KeyRecord {
|
|
10
|
+
active: number;
|
|
11
|
+
readonly rate: RateSample[];
|
|
12
|
+
/** Resolved once when this record was created; dropped with it on eviction. */
|
|
13
|
+
readonly limits: BoundedAdmissionPerKeyLimits | undefined;
|
|
14
|
+
}
|
|
15
|
+
/** Drop expired samples everywhere, and every key that holds nothing any more. */
|
|
16
|
+
export declare function pruneExpired(policy: BoundedAdmissionPolicy, globalRate: RateSample[], keys: Map<string, KeyRecord>, at: number): void;
|
|
17
|
+
/** Milliseconds until the oldest sample leaves its window — at least one. */
|
|
18
|
+
export declare function retryAfter(samples: RateSample[], budget: BoundedRateBudget, at: number): number;
|
|
19
|
+
/** Take back one reserved sample, if it is still in its window. */
|
|
20
|
+
export declare function removeSample(samples: RateSample[], sample: RateSample | undefined): void;
|
|
21
|
+
//# sourceMappingURL=admission-rate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admission-rate.d.ts","sourceRoot":"","sources":["../../src/application/admission-rate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,4BAA4B,EAC5B,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,4BAA4B,GAAG,SAAS,CAAC;CAC3D;AAUD,kFAAkF;AAClF,wBAAgB,YAAY,CAC1B,MAAM,EAAE,sBAAsB,EAC9B,UAAU,EAAE,UAAU,EAAE,EACxB,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,EAC5B,EAAE,EAAE,MAAM,GACT,IAAI,CAMN;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CACxB,OAAO,EAAE,UAAU,EAAE,EACrB,MAAM,EAAE,iBAAiB,EACzB,EAAE,EAAE,MAAM,GACT,MAAM,CAER;AAED,mEAAmE;AACnE,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,IAAI,CAIxF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An operation run under one admission lease, waited for within a deadline and
|
|
3
|
+
* a caller's signal. The lease is released when the WORK settles, not when the
|
|
4
|
+
* caller stops waiting: an abandoned wait never frees capacity the work holds.
|
|
5
|
+
*/
|
|
6
|
+
import { type BoundedAdmissionResult, type BoundedOperationRunContext, type BoundedOperationRunOptions } from './admission.js';
|
|
7
|
+
export declare function runAdmitted<T>(acquire: (key?: string) => BoundedAdmissionResult, key: string | undefined, work: (context: BoundedOperationRunContext) => T | Promise<T>, options: BoundedOperationRunOptions): Promise<T>;
|
|
8
|
+
//# sourceMappingURL=admission-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admission-run.d.ts","sourceRoot":"","sources":["../../src/application/admission-run.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAEhC,MAAM,aAAa,CAAC;AAErB,wBAAsB,WAAW,CAAC,CAAC,EACjC,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,sBAAsB,EACjD,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,IAAI,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAC7D,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,CAAC,CAAC,CAgDZ"}
|