stitchkit 0.88.0 → 0.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +126 -0
- package/dist/agent-runtime/child-blocking.d.ts +17 -0
- package/dist/agent-runtime/child-blocking.d.ts.map +1 -0
- package/dist/agent-runtime/child-budget-policy.d.ts +23 -0
- package/dist/agent-runtime/child-budget-policy.d.ts.map +1 -0
- package/dist/agent-runtime/children-contract.d.ts +155 -0
- package/dist/agent-runtime/children-contract.d.ts.map +1 -0
- package/dist/agent-runtime/children.d.ts +4 -99
- package/dist/agent-runtime/children.d.ts.map +1 -1
- package/dist/agent-runtime/coding-shell-process.d.ts +33 -0
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -0
- package/dist/agent-runtime/coding-tool-contract.d.ts +18 -0
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-files.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-utf8.d.ts +28 -0
- package/dist/agent-runtime/coding-tool-utf8.d.ts.map +1 -0
- package/dist/agent-runtime/contained-files.d.ts +20 -0
- package/dist/agent-runtime/contained-files.d.ts.map +1 -1
- package/dist/agent-runtime/durability-contract.d.ts +176 -0
- package/dist/agent-runtime/durability-contract.d.ts.map +1 -0
- package/dist/agent-runtime/durability-json.d.ts +3 -0
- package/dist/agent-runtime/durability-json.d.ts.map +1 -0
- package/dist/agent-runtime/durability-ledger.d.ts +16 -0
- package/dist/agent-runtime/durability-ledger.d.ts.map +1 -0
- package/dist/agent-runtime/durability-scheduler.d.ts +29 -0
- package/dist/agent-runtime/durability-scheduler.d.ts.map +1 -0
- package/dist/agent-runtime/durability.d.ts +14 -0
- package/dist/agent-runtime/durability.d.ts.map +1 -0
- package/dist/agent-runtime/event-search.d.ts.map +1 -1
- package/dist/agent-runtime/harness-contract.d.ts +37 -0
- package/dist/agent-runtime/harness-contract.d.ts.map +1 -1
- package/dist/agent-runtime/harness.d.ts +8 -0
- package/dist/agent-runtime/harness.d.ts.map +1 -1
- package/dist/agent-runtime/prompt.d.ts +23 -0
- package/dist/agent-runtime/prompt.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-internals.d.ts +4 -0
- package/dist/agent-runtime/runtime-internals.d.ts.map +1 -1
- package/dist/agent-runtime/runtime.d.ts +13 -0
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-broker.d.ts +7 -0
- package/dist/agent-runtime/sandbox-broker.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-bubblewrap-args.d.ts +9 -0
- package/dist/agent-runtime/sandbox-bubblewrap-args.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-bubblewrap-storage.d.ts +22 -0
- package/dist/agent-runtime/sandbox-bubblewrap-storage.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-bubblewrap.d.ts +14 -0
- package/dist/agent-runtime/sandbox-bubblewrap.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-coding-adapter.d.ts +15 -0
- package/dist/agent-runtime/sandbox-coding-adapter.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-coding.d.ts +15 -0
- package/dist/agent-runtime/sandbox-coding.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-contract.d.ts +93 -0
- package/dist/agent-runtime/sandbox-contract.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-process-owner.d.ts +11 -0
- package/dist/agent-runtime/sandbox-process-owner.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-process.d.ts +8 -0
- package/dist/agent-runtime/sandbox-process.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-session.d.ts +5 -0
- package/dist/agent-runtime/sandbox-session.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox.d.ts +19 -0
- package/dist/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-purge.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver.d.ts +127 -0
- package/dist/agent-runtime/store-driver.d.ts.map +1 -1
- package/dist/agent-runtime/store-events.d.ts +104 -0
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/store-migrations/v2-to-v3.d.ts +14 -0
- package/dist/agent-runtime/store-migrations/v2-to-v3.d.ts.map +1 -0
- package/dist/agent-runtime/store.d.ts +115 -0
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/agent-runtime-coding-tools.js +11 -1247
- package/dist/agent-runtime-harness.d.ts +1 -1
- package/dist/agent-runtime-harness.d.ts.map +1 -1
- package/dist/agent-runtime-harness.js +65 -15
- package/dist/agent-runtime-openrouter.d.ts +3 -12
- package/dist/agent-runtime-openrouter.d.ts.map +1 -1
- package/dist/agent-runtime-openrouter.js +10 -7
- package/dist/agent-runtime-sandbox.d.ts +5 -0
- package/dist/agent-runtime-sandbox.d.ts.map +1 -0
- package/dist/agent-runtime-sandbox.js +797 -0
- package/dist/agent-runtime-sqlite-bun.js +3 -3
- package/dist/agent-runtime-sqlite-node.js +3 -3
- package/dist/agent-runtime.d.ts +5 -4
- package/dist/agent-runtime.d.ts.map +1 -1
- package/dist/agent-runtime.js +259 -65
- package/dist/application.js +26 -26
- package/dist/cli.js +8 -8
- package/dist/{index-rcgsnrr6.js → index-31jw8fjq.js} +3 -3
- package/dist/{index-9hw9eq48.js → index-7601qfg1.js} +14 -14
- package/dist/{index-3xnq72rz.js → index-7rkhw9ec.js} +14 -1
- package/dist/{index-0vfdh685.js → index-8c3a7m4g.js} +1 -1
- package/dist/{index-t7gh5w3v.js → index-bn2cjajt.js} +27 -6
- package/dist/index-cp20z0n6.js +1351 -0
- package/dist/{index-qp3vshvc.js → index-fadnxwna.js} +87 -5
- package/dist/{index-v1qk37y9.js → index-hrbajay7.js} +106 -4
- package/dist/{index-p86mxmpp.js → index-hw2chdvy.js} +646 -43
- package/dist/{index-0ydchz76.js → index-mnm4qp0p.js} +5 -5
- package/dist/{index-1szetq6f.js → index-q3ve2d1k.js} +30 -8
- package/dist/{index-6krwcdcf.js → index-zwkgfq1s.js} +95 -85
- package/dist/{index-wn9cb82y.js → index-zyvby92n.js} +12 -9
- package/dist/index.js +13 -13
- package/dist/server/index.js +9 -9
- package/dist/testing/agent-store-conformance.d.ts.map +1 -1
- package/dist/testing.js +57 -23
- package/dist/tool-invoker.js +6 -6
- package/dist/tools/agent.d.ts +6 -0
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/connections/define.d.ts +6 -0
- package/dist/tools/connections/define.d.ts.map +1 -0
- package/dist/tools/connections/errors.d.ts +50 -0
- package/dist/tools/connections/errors.d.ts.map +1 -0
- package/dist/tools/connections/http.d.ts +3 -0
- package/dist/tools/connections/http.d.ts.map +1 -0
- package/dist/tools/connections/index.d.ts +19 -0
- package/dist/tools/connections/index.d.ts.map +1 -0
- package/dist/tools/connections/index.js +1047 -0
- package/dist/tools/connections/instance.d.ts +3 -0
- package/dist/tools/connections/instance.d.ts.map +1 -0
- package/dist/tools/connections/json-rpc.d.ts +8 -0
- package/dist/tools/connections/json-rpc.d.ts.map +1 -0
- package/dist/tools/connections/limits.d.ts +36 -0
- package/dist/tools/connections/limits.d.ts.map +1 -0
- package/dist/tools/connections/mcp-client.d.ts +44 -0
- package/dist/tools/connections/mcp-client.d.ts.map +1 -0
- package/dist/tools/connections/mcp.d.ts +5 -0
- package/dist/tools/connections/mcp.d.ts.map +1 -0
- package/dist/tools/connections/mount.d.ts +12 -0
- package/dist/tools/connections/mount.d.ts.map +1 -0
- package/dist/tools/connections/openapi-document.d.ts +4 -0
- package/dist/tools/connections/openapi-document.d.ts.map +1 -0
- package/dist/tools/connections/openapi.d.ts +5 -0
- package/dist/tools/connections/openapi.d.ts.map +1 -0
- package/dist/tools/connections/runtime.d.ts +29 -0
- package/dist/tools/connections/runtime.d.ts.map +1 -0
- package/dist/tools/connections/schema-budget.d.ts +8 -0
- package/dist/tools/connections/schema-budget.d.ts.map +1 -0
- package/dist/tools/connections/sse-frames.d.ts +7 -0
- package/dist/tools/connections/sse-frames.d.ts.map +1 -0
- package/dist/tools/connections/sse-session.d.ts +26 -0
- package/dist/tools/connections/sse-session.d.ts.map +1 -0
- package/dist/tools/connections/ssrf.d.ts +15 -0
- package/dist/tools/connections/ssrf.d.ts.map +1 -0
- package/dist/tools/connections/types.d.ts +60 -0
- package/dist/tools/connections/types.d.ts.map +1 -0
- package/dist/tools/durability-context.d.ts +7 -0
- package/dist/tools/durability-context.d.ts.map +1 -0
- package/dist/tools/execute.d.ts +2 -0
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/registry.d.ts +38 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/runtime-tool.d.ts +4 -0
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools.d.ts +1 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +83 -26
- package/llms-full.txt +246 -7
- package/llms.txt +1 -0
- package/package.json +9 -1
- package/dist/{index-evcnmsc3.js → index-t7fkyxcr.js} +3 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SandboxCommand, SandboxNetworkPolicy } from './sandbox-contract.js';
|
|
2
|
+
/** Only immutable runtime directories are exposed; host homes, /run and /etc are absent. */
|
|
3
|
+
export declare function bubblewrapArgs(input: {
|
|
4
|
+
workspace: string;
|
|
5
|
+
socket: string;
|
|
6
|
+
command: SandboxCommand;
|
|
7
|
+
network: SandboxNetworkPolicy;
|
|
8
|
+
}): string[];
|
|
9
|
+
//# sourceMappingURL=sandbox-bubblewrap-args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-bubblewrap-args.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sandbox-bubblewrap-args.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,KAAK,EAAE;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,oBAAoB,CAAC;CAC/B,YAwDA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type SandboxPrewarmInput, type SandboxState } from './sandbox-contract.js';
|
|
2
|
+
export declare function sandboxStorage(root: string, name: string): {
|
|
3
|
+
prewarm: (input: SandboxPrewarmInput) => Promise<{
|
|
4
|
+
reused: boolean;
|
|
5
|
+
templateKey: string;
|
|
6
|
+
}>;
|
|
7
|
+
create: (template: string, saved?: SandboxState) => Promise<{
|
|
8
|
+
directory: string;
|
|
9
|
+
release: () => Promise<void>;
|
|
10
|
+
workspace: string;
|
|
11
|
+
state: {
|
|
12
|
+
backend: string;
|
|
13
|
+
sessionId: string;
|
|
14
|
+
templateKey: string;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
acquire: (id: string) => Promise<{
|
|
18
|
+
directory: string;
|
|
19
|
+
release: () => Promise<void>;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=sandbox-bubblewrap-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-bubblewrap-storage.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sandbox-bubblewrap-storage.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAElB,MAAM,oBAAoB,CAAC;AAK5B,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;qBAEzB,mBAAmB;;;;uBA0EjB,MAAM,UAAU,YAAY;;;;;;;;;;kBApBjC,MAAM;;;;EAsElC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type SandboxBackend } from './sandbox-contract.js';
|
|
2
|
+
export interface BubblewrapSandboxConfig {
|
|
3
|
+
/** Private, application-owned directory, never mounted into the guest. */
|
|
4
|
+
stateDirectory: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
executable?: string;
|
|
7
|
+
/** Maximum live commands across session calls and the coding profile. Defaults to 8. */
|
|
8
|
+
maxConcurrentCommands?: number;
|
|
9
|
+
/** Internal diagnostic sink; errors are never sent back to the guest. */
|
|
10
|
+
onBrokerError: (cause: unknown) => void;
|
|
11
|
+
}
|
|
12
|
+
/** Linux reference backend. Bubblewrap and a conventional /usr,/lib,/lib64 runtime are required. */
|
|
13
|
+
export declare function createBubblewrapSandboxBackend(config: BubblewrapSandboxConfig): Promise<SandboxBackend>;
|
|
14
|
+
//# sourceMappingURL=sandbox-bubblewrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-bubblewrap.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sandbox-bubblewrap.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,oBAAoB,CAAC;AAK5B,MAAM,WAAW,uBAAuB;IACtC,0EAA0E;IAC1E,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,yEAAyE;IACzE,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AACD,oGAAoG;AACpG,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,cAAc,CAAC,CAoKzB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type AgentProcessSandbox } from './sandbox.js';
|
|
2
|
+
import { type SandboxNetworkPolicy } from './sandbox-contract.js';
|
|
3
|
+
import type { sandboxProcessOwner } from './sandbox-process-owner.js';
|
|
4
|
+
export declare function createSandboxCodingAdapter(input: {
|
|
5
|
+
workspace: string;
|
|
6
|
+
socket: string;
|
|
7
|
+
executable: string;
|
|
8
|
+
getPolicy(): SandboxNetworkPolicy;
|
|
9
|
+
processes: ReturnType<typeof sandboxProcessOwner>;
|
|
10
|
+
assertActive(): void;
|
|
11
|
+
}): {
|
|
12
|
+
adapter: AgentProcessSandbox;
|
|
13
|
+
refresh(): Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=sandbox-coding-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-coding-adapter.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sandbox-coding-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EAIzB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,IAAI,oBAAoB,CAAC;IAClC,SAAS,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;IAClD,YAAY,IAAI,IAAI,CAAC;CACtB;;;EAyDA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AgentCodingToolConfig } from './coding-tool-contract.js';
|
|
2
|
+
import type { AgentProcessSandbox, AgentSandboxRestriction } from './sandbox.js';
|
|
3
|
+
import { type SandboxHandle } from './sandbox-contract.js';
|
|
4
|
+
export interface SandboxCodingBinding {
|
|
5
|
+
/** Trusted host path; never expose this binding to a model. */
|
|
6
|
+
root: string;
|
|
7
|
+
adapter: AgentProcessSandbox;
|
|
8
|
+
assertActive(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare function sandboxCommandCwd(root: string, cwd: string): string;
|
|
11
|
+
/** Compose the maintained coding profile, preserving authorization, artifacts and limits. */
|
|
12
|
+
export declare function createSandboxCodingTools(handle: SandboxHandle, config: Omit<AgentCodingToolConfig, 'root' | 'sandbox'> & {
|
|
13
|
+
requiredRestrictions?: readonly AgentSandboxRestriction[];
|
|
14
|
+
}): readonly import("./coding-tool-contract.js").AgentCodingToolDefinition[];
|
|
15
|
+
//# sourceMappingURL=sandbox-coding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-coding.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sandbox-coding.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGtE,MAAM,WAAW,oBAAoB;IACnC,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,mBAAmB,CAAC;IAC7B,YAAY,IAAI,IAAI,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAG1D;AAED,6FAA6F;AAC7F,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG;IACxD,oBAAoB,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAC3D,yEAyCF"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { SandboxCodingBinding } from './sandbox-coding.js';
|
|
3
|
+
export declare const SandboxNetworkPolicySchema: z.ZodUnion<readonly [z.ZodLiteral<"allow-all">, z.ZodLiteral<"deny-all">, z.ZodObject<{
|
|
4
|
+
allow: z.ZodArray<z.ZodObject<{
|
|
5
|
+
origin: z.ZodURL;
|
|
6
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7
|
+
}, z.core.$strict>>;
|
|
8
|
+
}, z.core.$strict>]>;
|
|
9
|
+
export type SandboxNetworkPolicy = z.infer<typeof SandboxNetworkPolicySchema>;
|
|
10
|
+
export declare const SandboxStateSchema: z.ZodObject<{
|
|
11
|
+
backend: z.ZodString;
|
|
12
|
+
sessionId: z.ZodString;
|
|
13
|
+
templateKey: z.ZodString;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type SandboxState = z.infer<typeof SandboxStateSchema>;
|
|
16
|
+
export declare const SandboxCommandSchema: z.ZodObject<{
|
|
17
|
+
executable: z.ZodString;
|
|
18
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
20
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
21
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
maxOutputBytes: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export type SandboxCommand = z.infer<typeof SandboxCommandSchema>;
|
|
25
|
+
export interface SandboxRunOptions {
|
|
26
|
+
signal?: AbortSignal;
|
|
27
|
+
stdin?: Uint8Array;
|
|
28
|
+
}
|
|
29
|
+
export interface SandboxProcess {
|
|
30
|
+
readonly result: Promise<{
|
|
31
|
+
exitCode: number;
|
|
32
|
+
stdout: Uint8Array;
|
|
33
|
+
stderr: Uint8Array;
|
|
34
|
+
}>;
|
|
35
|
+
stop(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
/** Byte I/O and spawn are the only per-backend session primitives. */
|
|
38
|
+
export interface SandboxDriver {
|
|
39
|
+
read(path: string): Promise<Uint8Array>;
|
|
40
|
+
write(path: string, bytes: Uint8Array): Promise<void>;
|
|
41
|
+
remove(path: string): Promise<void>;
|
|
42
|
+
spawn(command: SandboxCommand, options?: SandboxRunOptions): Promise<SandboxProcess>;
|
|
43
|
+
setNetworkPolicy(policy: SandboxNetworkPolicy): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
export interface SandboxSession {
|
|
46
|
+
readonly id: string;
|
|
47
|
+
/** HTTP gateway socket, present only when the backend supports a host broker. */
|
|
48
|
+
readonly brokerSocket?: string;
|
|
49
|
+
resolvePath(path: string): string;
|
|
50
|
+
readBinaryFile(path: string): Promise<Uint8Array>;
|
|
51
|
+
readTextFile(path: string): Promise<string>;
|
|
52
|
+
writeBinaryFile(path: string, bytes: Uint8Array): Promise<void>;
|
|
53
|
+
writeTextFile(path: string, text: string): Promise<void>;
|
|
54
|
+
removePath(path: string): Promise<void>;
|
|
55
|
+
spawn(command: SandboxCommand, options?: SandboxRunOptions): Promise<SandboxProcess>;
|
|
56
|
+
run(command: SandboxCommand, options?: SandboxRunOptions): Promise<{
|
|
57
|
+
exitCode: number;
|
|
58
|
+
stdout: string;
|
|
59
|
+
stderr: string;
|
|
60
|
+
}>;
|
|
61
|
+
setNetworkPolicy(policy: SandboxNetworkPolicy): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
export interface SandboxHandle {
|
|
64
|
+
/** Optional host workspace integration; unsupported backends omit it explicitly. */
|
|
65
|
+
readonly coding?: SandboxCodingBinding;
|
|
66
|
+
readonly session: SandboxSession;
|
|
67
|
+
captureState(): SandboxState;
|
|
68
|
+
stop(): Promise<void>;
|
|
69
|
+
shutdown(): Promise<void>;
|
|
70
|
+
delete(): Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
export interface SandboxCreateInput {
|
|
73
|
+
template: string;
|
|
74
|
+
state?: SandboxState;
|
|
75
|
+
network: SandboxNetworkPolicy;
|
|
76
|
+
}
|
|
77
|
+
export interface SandboxPrewarmInput {
|
|
78
|
+
template: string;
|
|
79
|
+
files?: Readonly<Record<string, Uint8Array>>;
|
|
80
|
+
}
|
|
81
|
+
export interface SandboxBackend {
|
|
82
|
+
readonly name: string;
|
|
83
|
+
prewarm(input: SandboxPrewarmInput): Promise<{
|
|
84
|
+
reused: boolean;
|
|
85
|
+
templateKey: string;
|
|
86
|
+
}>;
|
|
87
|
+
create(input: SandboxCreateInput): Promise<SandboxHandle>;
|
|
88
|
+
}
|
|
89
|
+
export declare class SandboxError extends Error {
|
|
90
|
+
readonly code: 'SANDBOX_UNAVAILABLE' | 'SANDBOX_BUSY' | 'SANDBOX_STOPPED' | 'SANDBOX_STATE_MISMATCH' | 'SANDBOX_NETWORK_DENIED' | 'SANDBOX_LIMIT' | 'SANDBOX_PATH';
|
|
91
|
+
constructor(code: 'SANDBOX_UNAVAILABLE' | 'SANDBOX_BUSY' | 'SANDBOX_STOPPED' | 'SANDBOX_STATE_MISMATCH' | 'SANDBOX_NETWORK_DENIED' | 'SANDBOX_LIMIT' | 'SANDBOX_PATH', message: string, options?: ErrorOptions);
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=sandbox-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-contract.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sandbox-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,eAAO,MAAM,0BAA0B;;;;;oBAqDrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,eAAO,MAAM,kBAAkB;;;;kBAMpB,CAAC;AACZ,MAA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C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;CAC9C;AACD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvF,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC3D;AACD,qBAAa,YAAa,SAAQ,KAAK;IAEnC,QAAQ,CAAC,IAAI,EACT,qBAAqB,GACrB,cAAc,GACd,iBAAiB,GACjB,wBAAwB,GACxB,wBAAwB,GACxB,eAAe,GACf,cAAc;IARpB,YACW,IAAI,EACT,qBAAqB,GACrB,cAAc,GACd,iBAAiB,GACjB,wBAAwB,GACxB,wBAAwB,GACxB,eAAe,GACf,cAAc,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,YAAY,EAIvB;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ChildProcessWithoutNullStreams } from 'node:child_process';
|
|
2
|
+
import type { AgentProcessSandbox } from './sandbox.js';
|
|
3
|
+
/** All entry paths share one command admission limit and one shutdown barrier. */
|
|
4
|
+
export declare function sandboxProcessOwner(assertActive: () => void, maximum: number): {
|
|
5
|
+
admit: () => void;
|
|
6
|
+
track: (child: ChildProcessWithoutNullStreams) => void;
|
|
7
|
+
readonly size: number;
|
|
8
|
+
spawn(input: Parameters<AgentProcessSandbox['prepare']>[0]): ChildProcessWithoutNullStreams;
|
|
9
|
+
stop(): Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=sandbox-process-owner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-process-owner.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sandbox-process-owner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,8BAA8B,EAAS,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGrD,kFAAkF;AAClF,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,IAAI,EAAE,OAAO,EAAE,MAAM;;mBAOrD,8BAA8B;;iBAerC,UAAU,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;;EA0B7D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ChildProcessWithoutNullStreams } from 'node:child_process';
|
|
2
|
+
import { type SandboxProcess, type SandboxRunOptions } from './sandbox-contract.js';
|
|
3
|
+
/** Owns the host wrapper through close, including bounded collection and process-group kill. */
|
|
4
|
+
export declare function spawnSandboxProcess(executable: string, args: string[], limits: {
|
|
5
|
+
timeoutMs: number;
|
|
6
|
+
maxOutputBytes: number;
|
|
7
|
+
}, options?: SandboxRunOptions, onSpawn?: (child: ChildProcessWithoutNullStreams) => void): SandboxProcess;
|
|
8
|
+
//# sourceMappingURL=sandbox-process.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-process.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sandbox-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,8BAA8B,EAAS,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAgB,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE/F,gGAAgG;AAChG,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,EACrD,OAAO,GAAE,iBAAsB,EAC/B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,GACxD,cAAc,CAoFhB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type SandboxDriver, type SandboxSession } from './sandbox-contract.js';
|
|
2
|
+
export declare function sandboxPath(path: string): string;
|
|
3
|
+
/** One public composition for every backend; text never gets its own I/O engine. */
|
|
4
|
+
export declare function createSandboxSession(id: string, driver: SandboxDriver, brokerSocket?: string): SandboxSession;
|
|
5
|
+
//# sourceMappingURL=sandbox-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-session.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sandbox-session.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,aAAa,EAGlB,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAE5B,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAahD;AACD,oFAAoF;AACpF,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,aAAa,EACrB,YAAY,CAAC,EAAE,MAAM,GACpB,cAAc,CAiChB"}
|
|
@@ -34,13 +34,32 @@ export declare const AgentSandboxGradeSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
34
34
|
}, z.core.$strict>], "grade">;
|
|
35
35
|
export type AgentSandboxRestriction = z.infer<typeof AgentSandboxRestrictionSchema>;
|
|
36
36
|
export type AgentSandboxGrade = z.infer<typeof AgentSandboxGradeSchema>;
|
|
37
|
+
/** Structural process surface keeps optional launchers independent of Node ambient types. */
|
|
38
|
+
export interface AgentSandboxProcess {
|
|
39
|
+
readonly pid?: number;
|
|
40
|
+
readonly exitCode: number | null;
|
|
41
|
+
readonly signalCode: string | null;
|
|
42
|
+
readonly stdout: AgentSandboxOutputStream;
|
|
43
|
+
readonly stderr: AgentSandboxOutputStream;
|
|
44
|
+
kill(signal: 'SIGKILL'): boolean;
|
|
45
|
+
on(event: 'error', listener: (error: Error) => void): unknown;
|
|
46
|
+
on(event: 'exit' | 'close', listener: (code: number | null, signal: string | null) => void): unknown;
|
|
47
|
+
}
|
|
48
|
+
export interface AgentSandboxOutputStream {
|
|
49
|
+
readonly destroyed: boolean;
|
|
50
|
+
on(event: 'data', listener: (chunk: Uint8Array) => void): unknown;
|
|
51
|
+
destroy(): unknown;
|
|
52
|
+
}
|
|
37
53
|
export interface AgentProcessSandbox {
|
|
54
|
+
/** Optional lifecycle-owned launcher; the coding profile still owns output and deadline handling. */
|
|
55
|
+
spawn?(input: Parameters<AgentProcessSandbox['prepare']>[0]): AgentSandboxProcess;
|
|
38
56
|
probe(): AgentSandboxGrade | Promise<AgentSandboxGrade>;
|
|
39
57
|
prepare(input: {
|
|
40
58
|
executable: string;
|
|
41
59
|
args: readonly string[];
|
|
42
60
|
cwd: string;
|
|
43
61
|
environment: Readonly<Record<string, string>>;
|
|
62
|
+
required?: readonly AgentSandboxRestriction[];
|
|
44
63
|
}): {
|
|
45
64
|
executable: string;
|
|
46
65
|
args: readonly string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,eAAO,MAAM,6BAA6B;;;;;EAKxC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;6BAYlC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,MAAM,WAAW,mBAAmB;IAClC,KAAK,IAAI,iBAAiB,GAAG,OAA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AAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,QAAQ,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAC9C,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAa7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite-purge.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sqlite-purge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"sqlite-purge.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sqlite-purge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAclE,iFAAiF;AACjF,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAoBhF;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,cAAc,GACvB,4BAA4B,CAAC,cAAc,CAAC,GAAG,SAAS,CAgC1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sqlite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,iBAAiB,CAAC;AAKzB,OAAO,
|
|
1
|
+
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sqlite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAOL,uBAAuB,EACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,KAAK,uBAAuB,EAG5B,KAAK,qBAAqB,EAG3B,MAAM,gBAAgB,CAAC;AAUxB,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEvF,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,EAAE,cAAc,CAAC;IACzB,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,cAAc,CAAC,CAAC,CAAC;IAClE,aAAa,EAAE,uBAAuB,CAAC;IACvC;;;;;;;OAOG;IACH,QAAQ,EAAE,cAAc,CAAC;IACzB;;;;;;;;;OASG;IACH,WAAW,CAAC,MAAM,EAChB,IAAI,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC,MAAM,CAAC,GACvD,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,oFAAoF;IACpF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,4DAA4D;AAC5D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC7E;AA8KD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CA6G3E;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,6BAA6B,GACpC,uBAAuB,CA8vBzB"}
|
|
@@ -322,6 +322,21 @@ export declare const AgentAdmissionReceiptSchema: z.ZodObject<{
|
|
|
322
322
|
export type AgentRuntimeHead = z.infer<typeof AgentRuntimeHeadSchema>;
|
|
323
323
|
export type AgentStoredRun = z.infer<typeof AgentStoredRunSchema>;
|
|
324
324
|
export type AgentAdmissionReceipt = z.infer<typeof AgentAdmissionReceiptSchema>;
|
|
325
|
+
/**
|
|
326
|
+
* The durable record that a keyed user-instruction seed already happened.
|
|
327
|
+
*
|
|
328
|
+
* Kept beside the history rather than derived from it: compaction and `clear`
|
|
329
|
+
* legitimately remove the seeded messages, and the seed must not return when
|
|
330
|
+
* they do. `messageIds` lets an archive round trip match an imported seed's
|
|
331
|
+
* messages without this record.
|
|
332
|
+
*/
|
|
333
|
+
export declare const AgentSeedReceiptSchema: z.ZodObject<{
|
|
334
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
335
|
+
conversationId: z.ZodString;
|
|
336
|
+
seedKey: z.ZodString;
|
|
337
|
+
messageIds: z.ZodArray<z.ZodString>;
|
|
338
|
+
}, z.core.$strip>;
|
|
339
|
+
export type AgentSeedReceipt = z.infer<typeof AgentSeedReceiptSchema>;
|
|
325
340
|
export declare const AgentHistoryMutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
326
341
|
type: z.ZodLiteral<"admit">;
|
|
327
342
|
input: z.ZodObject<{
|
|
@@ -599,6 +614,98 @@ export declare const AgentHistoryMutationSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
599
614
|
createdAt: z.ZodISODateTime;
|
|
600
615
|
updatedAt: z.ZodISODateTime;
|
|
601
616
|
}, z.core.$strip>;
|
|
617
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
618
|
+
type: z.ZodLiteral<"seed">;
|
|
619
|
+
message: z.ZodObject<{
|
|
620
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
621
|
+
id: z.ZodString;
|
|
622
|
+
conversationId: z.ZodString;
|
|
623
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
624
|
+
role: z.ZodEnum<{
|
|
625
|
+
assistant: "assistant";
|
|
626
|
+
summary: "summary";
|
|
627
|
+
system: "system";
|
|
628
|
+
tool: "tool";
|
|
629
|
+
user: "user";
|
|
630
|
+
}>;
|
|
631
|
+
status: z.ZodEnum<{
|
|
632
|
+
committed: "committed";
|
|
633
|
+
completed: "completed";
|
|
634
|
+
failed: "failed";
|
|
635
|
+
interrupted: "interrupted";
|
|
636
|
+
streaming: "streaming";
|
|
637
|
+
superseded: "superseded";
|
|
638
|
+
}>;
|
|
639
|
+
parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
640
|
+
type: z.ZodLiteral<"text">;
|
|
641
|
+
text: z.ZodString;
|
|
642
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
643
|
+
type: z.ZodLiteral<"reasoning">;
|
|
644
|
+
text: z.ZodString;
|
|
645
|
+
provider: z.ZodOptional<z.ZodObject<{
|
|
646
|
+
schemaVersion: z.ZodInt;
|
|
647
|
+
provider: z.ZodString;
|
|
648
|
+
data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
649
|
+
}, z.core.$strip>>;
|
|
650
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
651
|
+
type: z.ZodLiteral<"file">;
|
|
652
|
+
mediaType: z.ZodString;
|
|
653
|
+
reference: z.ZodString;
|
|
654
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
655
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
656
|
+
type: z.ZodLiteral<"source">;
|
|
657
|
+
sourceId: z.ZodString;
|
|
658
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
659
|
+
title: z.ZodOptional<z.ZodString>;
|
|
660
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
661
|
+
type: z.ZodLiteral<"tool-call">;
|
|
662
|
+
callId: z.ZodString;
|
|
663
|
+
toolName: z.ZodString;
|
|
664
|
+
input: z.ZodJSONSchema;
|
|
665
|
+
provider: z.ZodOptional<z.ZodObject<{
|
|
666
|
+
schemaVersion: z.ZodInt;
|
|
667
|
+
provider: z.ZodString;
|
|
668
|
+
data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
669
|
+
}, z.core.$strip>>;
|
|
670
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
671
|
+
type: z.ZodLiteral<"tool-result">;
|
|
672
|
+
callId: z.ZodString;
|
|
673
|
+
toolName: z.ZodString;
|
|
674
|
+
outcome: z.ZodEnum<{
|
|
675
|
+
error: "error";
|
|
676
|
+
interrupted: "interrupted";
|
|
677
|
+
success: "success";
|
|
678
|
+
}>;
|
|
679
|
+
output: z.ZodOptional<z.ZodJSONSchema>;
|
|
680
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
681
|
+
type: z.ZodLiteral<"tool-approval-request">;
|
|
682
|
+
approvalId: z.ZodString;
|
|
683
|
+
callId: z.ZodString;
|
|
684
|
+
isAutomatic: z.ZodOptional<z.ZodBoolean>;
|
|
685
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
686
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
687
|
+
type: z.ZodLiteral<"tool-approval-response">;
|
|
688
|
+
approvalId: z.ZodString;
|
|
689
|
+
approved: z.ZodBoolean;
|
|
690
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
691
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
692
|
+
type: z.ZodLiteral<"provider">;
|
|
693
|
+
envelope: z.ZodObject<{
|
|
694
|
+
schemaVersion: z.ZodInt;
|
|
695
|
+
provider: z.ZodString;
|
|
696
|
+
data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
697
|
+
}, z.core.$strip>;
|
|
698
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
699
|
+
type: z.ZodLiteral<"control">;
|
|
700
|
+
reason: z.ZodEnum<{
|
|
701
|
+
"run-interrupted": "run-interrupted";
|
|
702
|
+
"stale-run": "stale-run";
|
|
703
|
+
}>;
|
|
704
|
+
}, z.core.$strip>], "type">>;
|
|
705
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
706
|
+
createdAt: z.ZodISODateTime;
|
|
707
|
+
updatedAt: z.ZodISODateTime;
|
|
708
|
+
}, z.core.$strip>;
|
|
602
709
|
}, z.core.$strip>], "type">;
|
|
603
710
|
export type AgentHistoryMutation = z.infer<typeof AgentHistoryMutationSchema>;
|
|
604
711
|
export type AgentStoreCompareAndSwapResult = {
|
|
@@ -652,8 +759,28 @@ export interface AgentRuntimeStoreDriver<TRANSACTION> {
|
|
|
652
759
|
}): Promise<AgentAdmissionReceipt | undefined>;
|
|
653
760
|
create(transaction: TRANSACTION, receipt: AgentAdmissionReceipt): Promise<void>;
|
|
654
761
|
};
|
|
762
|
+
seeds: {
|
|
763
|
+
load(transaction: TRANSACTION, input: {
|
|
764
|
+
conversationId: string;
|
|
765
|
+
seedKey: string;
|
|
766
|
+
}): Promise<AgentSeedReceipt | undefined>;
|
|
767
|
+
create(transaction: TRANSACTION, receipt: AgentSeedReceipt): Promise<void>;
|
|
768
|
+
};
|
|
655
769
|
history: {
|
|
656
770
|
load(transaction: TRANSACTION, conversationId: string): Promise<readonly AgentMessage[]>;
|
|
771
|
+
/**
|
|
772
|
+
* Whether any stored message — active or compacted — already carries this
|
|
773
|
+
* identity.
|
|
774
|
+
*
|
|
775
|
+
* `load` deliberately hides compacted rows, so a seed restored into a
|
|
776
|
+
* conversation whose receipts were not restored can match a message the
|
|
777
|
+
* active view does not show. Optional because a driver with no inactive
|
|
778
|
+
* store has nothing `load` hides; the seed write is idempotent either way.
|
|
779
|
+
*/
|
|
780
|
+
hasMessage?(transaction: TRANSACTION, input: {
|
|
781
|
+
conversationId: string;
|
|
782
|
+
messageId: string;
|
|
783
|
+
}): Promise<boolean>;
|
|
657
784
|
apply(transaction: TRANSACTION, mutation: AgentHistoryMutation): Promise<void>;
|
|
658
785
|
};
|
|
659
786
|
events: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-driver.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-driver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAC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W,EAAE,WAAW,EACxB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,GAChD,OAAO,CAAC,mBAAmB,CAAC,CAAC;KACjC,CAAC;IACF,gFAAgF;IAChF,OAAO,CAAC,EAAE;QACR,MAAM,CACJ,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC;QACrE,MAAM,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACpF,CAAC;IACF,eAAe,CAAC,KAAK,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC3F;AAyQD;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,QAAQ,CAAC,OAAO,CAAC,EAI/D,CAAC;AAgjBF,wBAAgB,uBAAuB,CAAC,WAAW,EACjD,MAAM,EAAE,uBAAuB,CAAC,WAAW,CAAC,GAC3C,iBAAiB,CA8dnB;AA0CD,oGAAoG;AACpG,wBAAgB,6BAA6B,IAAI,iBAAiB,CAqSjE"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const AgentStoreEventKindSchema: z.ZodEnum<{
|
|
3
|
+
"approval/response-rejected": "approval/response-rejected";
|
|
3
4
|
"child/spawned": "child/spawned";
|
|
4
5
|
"child/state": "child/state";
|
|
6
|
+
"durability/event": "durability/event";
|
|
7
|
+
"durability/park": "durability/park";
|
|
8
|
+
"durability/step": "durability/step";
|
|
5
9
|
"provider/message": "provider/message";
|
|
6
10
|
"provider/request": "provider/request";
|
|
7
11
|
"provider/response": "provider/response";
|
|
@@ -723,6 +727,102 @@ export declare const AgentStoreTransitionSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
723
727
|
updatedAt: z.ZodISODateTime;
|
|
724
728
|
}, z.core.$strip>;
|
|
725
729
|
}, z.core.$strip>;
|
|
730
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
731
|
+
type: z.ZodLiteral<"seed">;
|
|
732
|
+
input: z.ZodObject<{
|
|
733
|
+
conversationId: z.ZodString;
|
|
734
|
+
seedKey: z.ZodString;
|
|
735
|
+
inputs: z.ZodArray<z.ZodObject<{
|
|
736
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
737
|
+
id: z.ZodString;
|
|
738
|
+
conversationId: z.ZodString;
|
|
739
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
740
|
+
role: z.ZodEnum<{
|
|
741
|
+
assistant: "assistant";
|
|
742
|
+
summary: "summary";
|
|
743
|
+
system: "system";
|
|
744
|
+
tool: "tool";
|
|
745
|
+
user: "user";
|
|
746
|
+
}>;
|
|
747
|
+
status: z.ZodEnum<{
|
|
748
|
+
committed: "committed";
|
|
749
|
+
completed: "completed";
|
|
750
|
+
failed: "failed";
|
|
751
|
+
interrupted: "interrupted";
|
|
752
|
+
streaming: "streaming";
|
|
753
|
+
superseded: "superseded";
|
|
754
|
+
}>;
|
|
755
|
+
parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
756
|
+
type: z.ZodLiteral<"text">;
|
|
757
|
+
text: z.ZodString;
|
|
758
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
759
|
+
type: z.ZodLiteral<"reasoning">;
|
|
760
|
+
text: z.ZodString;
|
|
761
|
+
provider: z.ZodOptional<z.ZodObject<{
|
|
762
|
+
schemaVersion: z.ZodInt;
|
|
763
|
+
provider: z.ZodString;
|
|
764
|
+
data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
765
|
+
}, z.core.$strip>>;
|
|
766
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
767
|
+
type: z.ZodLiteral<"file">;
|
|
768
|
+
mediaType: z.ZodString;
|
|
769
|
+
reference: z.ZodString;
|
|
770
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
771
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
772
|
+
type: z.ZodLiteral<"source">;
|
|
773
|
+
sourceId: z.ZodString;
|
|
774
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
775
|
+
title: z.ZodOptional<z.ZodString>;
|
|
776
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
777
|
+
type: z.ZodLiteral<"tool-call">;
|
|
778
|
+
callId: z.ZodString;
|
|
779
|
+
toolName: z.ZodString;
|
|
780
|
+
input: z.ZodJSONSchema;
|
|
781
|
+
provider: z.ZodOptional<z.ZodObject<{
|
|
782
|
+
schemaVersion: z.ZodInt;
|
|
783
|
+
provider: z.ZodString;
|
|
784
|
+
data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
785
|
+
}, z.core.$strip>>;
|
|
786
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
787
|
+
type: z.ZodLiteral<"tool-result">;
|
|
788
|
+
callId: z.ZodString;
|
|
789
|
+
toolName: z.ZodString;
|
|
790
|
+
outcome: z.ZodEnum<{
|
|
791
|
+
error: "error";
|
|
792
|
+
interrupted: "interrupted";
|
|
793
|
+
success: "success";
|
|
794
|
+
}>;
|
|
795
|
+
output: z.ZodOptional<z.ZodJSONSchema>;
|
|
796
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
797
|
+
type: z.ZodLiteral<"tool-approval-request">;
|
|
798
|
+
approvalId: z.ZodString;
|
|
799
|
+
callId: z.ZodString;
|
|
800
|
+
isAutomatic: z.ZodOptional<z.ZodBoolean>;
|
|
801
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
802
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
803
|
+
type: z.ZodLiteral<"tool-approval-response">;
|
|
804
|
+
approvalId: z.ZodString;
|
|
805
|
+
approved: z.ZodBoolean;
|
|
806
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
807
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
808
|
+
type: z.ZodLiteral<"provider">;
|
|
809
|
+
envelope: z.ZodObject<{
|
|
810
|
+
schemaVersion: z.ZodInt;
|
|
811
|
+
provider: z.ZodString;
|
|
812
|
+
data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
813
|
+
}, z.core.$strip>;
|
|
814
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
815
|
+
type: z.ZodLiteral<"control">;
|
|
816
|
+
reason: z.ZodEnum<{
|
|
817
|
+
"run-interrupted": "run-interrupted";
|
|
818
|
+
"stale-run": "stale-run";
|
|
819
|
+
}>;
|
|
820
|
+
}, z.core.$strip>], "type">>;
|
|
821
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
822
|
+
createdAt: z.ZodISODateTime;
|
|
823
|
+
updatedAt: z.ZodISODateTime;
|
|
824
|
+
}, z.core.$strip>>;
|
|
825
|
+
}, z.core.$strip>;
|
|
726
826
|
}, z.core.$strict>], "type">;
|
|
727
827
|
export type AgentStoreTransition = z.infer<typeof AgentStoreTransitionSchema>;
|
|
728
828
|
export declare const AgentStoreEventEnvelopeSchema: z.ZodObject<{
|
|
@@ -739,8 +839,12 @@ export type AgentStoreEventEnvelope = z.infer<typeof AgentStoreEventEnvelopeSche
|
|
|
739
839
|
export declare const AppendAgentStoreEventSchema: z.ZodObject<{
|
|
740
840
|
conversationId: z.ZodString;
|
|
741
841
|
kind: z.ZodEnum<{
|
|
842
|
+
"approval/response-rejected": "approval/response-rejected";
|
|
742
843
|
"child/spawned": "child/spawned";
|
|
743
844
|
"child/state": "child/state";
|
|
845
|
+
"durability/event": "durability/event";
|
|
846
|
+
"durability/park": "durability/park";
|
|
847
|
+
"durability/step": "durability/step";
|
|
744
848
|
"provider/message": "provider/message";
|
|
745
849
|
"provider/request": "provider/request";
|
|
746
850
|
"provider/response": "provider/response";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-events.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-events.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"store-events.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-events.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;EAuBpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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