stitchkit 0.110.1 → 0.110.3
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 +16 -0
- package/dist/agent-runtime/archive-projection.d.ts +10 -0
- package/dist/agent-runtime/archive-projection.d.ts.map +1 -0
- package/dist/agent-runtime/archive-spill.d.ts +61 -0
- package/dist/agent-runtime/archive-spill.d.ts.map +1 -0
- package/dist/agent-runtime/branch-contract.d.ts +102 -0
- package/dist/agent-runtime/branch-contract.d.ts.map +1 -0
- package/dist/agent-runtime/branch-events.d.ts +18 -0
- package/dist/agent-runtime/branch-events.d.ts.map +1 -0
- package/dist/agent-runtime/branch-identities.d.ts +20 -0
- package/dist/agent-runtime/branch-identities.d.ts.map +1 -0
- package/dist/agent-runtime/branch-messages.d.ts +32 -0
- package/dist/agent-runtime/branch-messages.d.ts.map +1 -0
- package/dist/agent-runtime/branch-observations.d.ts +104 -0
- package/dist/agent-runtime/branch-observations.d.ts.map +1 -0
- package/dist/agent-runtime/branch-provider.d.ts +130 -0
- package/dist/agent-runtime/branch-provider.d.ts.map +1 -0
- package/dist/agent-runtime/branch-replay.d.ts +426 -0
- package/dist/agent-runtime/branch-replay.d.ts.map +1 -0
- package/dist/agent-runtime/branch-source.d.ts +16 -0
- package/dist/agent-runtime/branch-source.d.ts.map +1 -0
- package/dist/agent-runtime/branch-transitions.d.ts +6 -0
- package/dist/agent-runtime/branch-transitions.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-events.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-history.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-purge.d.ts.map +1 -1
- package/dist/agent-runtime/store-archive.d.ts +1 -0
- package/dist/agent-runtime/store-archive.d.ts.map +1 -1
- package/dist/agent-runtime/store-branch.d.ts +5 -0
- package/dist/agent-runtime/store-branch.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-branch.d.ts +4 -0
- package/dist/agent-runtime/store-conformance-branch.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-support.d.ts +5 -5
- package/dist/agent-runtime/store-conformance.d.ts.map +1 -1
- package/dist/agent-runtime/store-create.d.ts +1 -1
- package/dist/agent-runtime/store-create.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver-contract.d.ts +6 -0
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
- package/dist/agent-runtime/store-events.d.ts +1131 -0
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory-archive.d.ts +8 -0
- package/dist/agent-runtime/store-memory-archive.d.ts.map +1 -0
- package/dist/agent-runtime/store-memory-events.d.ts +7 -0
- package/dist/agent-runtime/store-memory-events.d.ts.map +1 -0
- package/dist/agent-runtime/store-memory.d.ts +1 -1
- package/dist/agent-runtime/store-memory.d.ts.map +1 -1
- package/dist/agent-runtime/store-purge.d.ts +2 -0
- package/dist/agent-runtime/store-purge.d.ts.map +1 -1
- package/dist/agent-runtime/store-reduce-run.d.ts +2 -2
- package/dist/agent-runtime/store-reduce-run.d.ts.map +1 -1
- package/dist/agent-runtime/store-reduce-shared.d.ts +1 -0
- package/dist/agent-runtime/store-reduce-shared.d.ts.map +1 -1
- package/dist/agent-runtime/store-reducer.d.ts +2 -2
- package/dist/agent-runtime/store-reducer.d.ts.map +1 -1
- package/dist/agent-runtime/store-replay.d.ts +4 -0
- package/dist/agent-runtime/store-replay.d.ts.map +1 -0
- package/dist/agent-runtime/store.d.ts +3 -0
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/durability/events.d.ts +4 -0
- package/dist/durability/events.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/coding-tools.js +1 -2
- package/dist/entrypoints/agent-runtime/harness.js +4 -3
- package/dist/entrypoints/agent-runtime/sandbox.js +3 -5
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +13 -3
- package/dist/entrypoints/agent-runtime/sqlite/node.js +13 -3
- package/dist/entrypoints/agent-runtime/testing.js +89 -5
- package/dist/entrypoints/agent-runtime.d.ts +2 -1
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime.js +27 -15
- package/dist/entrypoints/tools.js +5 -3
- package/dist/{index-0gs4ymfj.js → index-4fgg1507.js} +31 -2
- package/dist/{index-c17xcx4k.js → index-56yx8dxp.js} +19 -96
- package/dist/{index-8rstkvcf.js → index-7c046kxr.js} +1 -1
- package/dist/{index-tjdsyrys.js → index-bm180f2d.js} +203 -83
- package/dist/{index-924500c3.js → index-ddkwkcvn.js} +2 -2
- package/dist/{index-c0hffcmj.js → index-dgfah0g8.js} +21 -9
- package/dist/index-j1cwtyk1.js +2269 -0
- package/dist/index-snef22zr.js +94 -0
- package/dist/{index-5p55xreg.js → index-w619fqvv.js} +67 -29
- package/llms/agent-runtime.3.txt +4 -0
- package/llms/agent-runtime.txt +75 -0
- package/llms-full.txt +79 -0
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/dist/index-8ks9b85e.js +0 -129
- package/dist/index-d2h99n7d.js +0 -1071
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,22 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
## [0.110.3] - 2026-10-15
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- `stitchkit/agent-runtime`: `AgentStoreTransitionRecordSchema` and its inferred `AgentStoreTransitionRecord` type inspect the persisted journal, including full transitions and compact hash-only streaming checkpoints. `AgentStoreTransitionSchema` continues to describe executable mutations. These two names belong to the runtime entrypoint (I3, I8, I15).
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- `stitchkit/agent-runtime`: branch and restore accept complete SQLite streaming exports with companion projections, including schema v4 exports written by 0.109.4. Companion cache envelopes are validated and their values discarded; destination projections rebuild from the rekeyed ledger without importing source state or effects. Ordinary archive import also restores compacted history and admissions through the shared replay writer. Unknown journal payloads still refuse atomically; see ADR 0259.
|
|
27
|
+
|
|
28
|
+
## [0.110.2] - 2026-10-15
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- `stitchkit/agent-runtime`: atomic `store.branchConversation()` creates an independent conversation from an exact settled prefix or a validated archive. Typed identities and spill references are rekeyed; stable retries return a durable lineage receipt, while control observations remain inert and artifact access requires fresh destination policy. Six input/result/receipt type and schema exports belong to this entrypoint (I3, I8, I12, I15). Unknown opaque payloads fail before any destination write. Abandon transitions retain their exact terminal assistant for reconstruction after compaction; incomplete legacy recovery archives refuse.
|
|
33
|
+
|
|
18
34
|
## [0.110.1] - 2026-10-14
|
|
19
35
|
|
|
20
36
|
### Added
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Derived companion cache, distinct from the authoritative runtime snapshot. */
|
|
3
|
+
export declare const ArchiveProjectionSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
version: z.ZodInt;
|
|
6
|
+
uptoSeq: z.ZodInt;
|
|
7
|
+
value: z.ZodJSONSchema;
|
|
8
|
+
updatedAt: z.ZodString;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
//# sourceMappingURL=archive-projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive-projection.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/archive-projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iFAAiF;AACjF,eAAO,MAAM,uBAAuB;;;;;;kBAQzB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ArchiveSpillSchema: z.ZodObject<{
|
|
3
|
+
reference: z.ZodString;
|
|
4
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
5
|
+
toolCallId: z.ZodOptional<z.ZodString>;
|
|
6
|
+
mediaType: z.ZodString;
|
|
7
|
+
bytes: z.ZodInt;
|
|
8
|
+
sha256: z.ZodString;
|
|
9
|
+
createdAt: z.ZodISODateTime;
|
|
10
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
11
|
+
authorization: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
+
operation: z.ZodLiteral<"read">;
|
|
13
|
+
path: z.ZodString;
|
|
14
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
15
|
+
operation: z.ZodLiteral<"write">;
|
|
16
|
+
path: z.ZodString;
|
|
17
|
+
bytes: z.ZodInt;
|
|
18
|
+
overwrite: z.ZodBoolean;
|
|
19
|
+
createsDirectories: z.ZodArray<z.ZodString>;
|
|
20
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
21
|
+
operation: z.ZodLiteral<"search">;
|
|
22
|
+
query: z.ZodString;
|
|
23
|
+
mode: z.ZodEnum<{
|
|
24
|
+
content: "content";
|
|
25
|
+
path: "path";
|
|
26
|
+
}>;
|
|
27
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
28
|
+
operation: z.ZodLiteral<"edit">;
|
|
29
|
+
path: z.ZodString;
|
|
30
|
+
baseSha256: z.ZodString;
|
|
31
|
+
resultSha256: z.ZodString;
|
|
32
|
+
resultBytes: z.ZodInt;
|
|
33
|
+
replacements: z.ZodInt;
|
|
34
|
+
dryRun: z.ZodBoolean;
|
|
35
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
36
|
+
operation: z.ZodLiteral<"list">;
|
|
37
|
+
path: z.ZodString;
|
|
38
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
39
|
+
operation: z.ZodLiteral<"glob">;
|
|
40
|
+
pattern: z.ZodString;
|
|
41
|
+
path: z.ZodString;
|
|
42
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
43
|
+
operation: z.ZodLiteral<"artifact-read">;
|
|
44
|
+
reference: z.ZodString;
|
|
45
|
+
offset: z.ZodInt;
|
|
46
|
+
maxBytes: z.ZodInt;
|
|
47
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
48
|
+
operation: z.ZodLiteral<"artifact-search">;
|
|
49
|
+
reference: z.ZodString;
|
|
50
|
+
query: z.ZodString;
|
|
51
|
+
maxMatches: z.ZodInt;
|
|
52
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
53
|
+
operation: z.ZodLiteral<"shell">;
|
|
54
|
+
executable: z.ZodString;
|
|
55
|
+
args: z.ZodArray<z.ZodString>;
|
|
56
|
+
cwd: z.ZodString;
|
|
57
|
+
}, z.core.$strict>], "operation">>;
|
|
58
|
+
base64: z.ZodString;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
export type ArchiveSpill = z.infer<typeof ArchiveSpillSchema>;
|
|
61
|
+
//# sourceMappingURL=archive-spill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive-spill.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/archive-spill.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0B3B,CAAC;AAEL,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const BranchAgentConversationInputSchema: z.ZodObject<{
|
|
3
|
+
requestKey: z.ZodString;
|
|
4
|
+
destinationConversationId: z.ZodString;
|
|
5
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
|
+
kind: z.ZodLiteral<"conversation">;
|
|
7
|
+
conversationId: z.ZodString;
|
|
8
|
+
throughRunId: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
10
|
+
kind: z.ZodLiteral<"archive">;
|
|
11
|
+
bytes: z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>;
|
|
12
|
+
}, z.core.$strict>], "kind">;
|
|
13
|
+
artifactAuthorization: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
|
+
operation: z.ZodLiteral<"read">;
|
|
15
|
+
path: z.ZodString;
|
|
16
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
17
|
+
operation: z.ZodLiteral<"write">;
|
|
18
|
+
path: z.ZodString;
|
|
19
|
+
bytes: z.ZodInt;
|
|
20
|
+
overwrite: z.ZodBoolean;
|
|
21
|
+
createsDirectories: z.ZodArray<z.ZodString>;
|
|
22
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
23
|
+
operation: z.ZodLiteral<"search">;
|
|
24
|
+
query: z.ZodString;
|
|
25
|
+
mode: z.ZodEnum<{
|
|
26
|
+
content: "content";
|
|
27
|
+
path: "path";
|
|
28
|
+
}>;
|
|
29
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
30
|
+
operation: z.ZodLiteral<"edit">;
|
|
31
|
+
path: z.ZodString;
|
|
32
|
+
baseSha256: z.ZodString;
|
|
33
|
+
resultSha256: z.ZodString;
|
|
34
|
+
resultBytes: z.ZodInt;
|
|
35
|
+
replacements: z.ZodInt;
|
|
36
|
+
dryRun: z.ZodBoolean;
|
|
37
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
38
|
+
operation: z.ZodLiteral<"list">;
|
|
39
|
+
path: z.ZodString;
|
|
40
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
41
|
+
operation: z.ZodLiteral<"glob">;
|
|
42
|
+
pattern: z.ZodString;
|
|
43
|
+
path: z.ZodString;
|
|
44
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
45
|
+
operation: z.ZodLiteral<"artifact-read">;
|
|
46
|
+
reference: z.ZodString;
|
|
47
|
+
offset: z.ZodInt;
|
|
48
|
+
maxBytes: z.ZodInt;
|
|
49
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
50
|
+
operation: z.ZodLiteral<"artifact-search">;
|
|
51
|
+
reference: z.ZodString;
|
|
52
|
+
query: z.ZodString;
|
|
53
|
+
maxMatches: z.ZodInt;
|
|
54
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
55
|
+
operation: z.ZodLiteral<"shell">;
|
|
56
|
+
executable: z.ZodString;
|
|
57
|
+
args: z.ZodArray<z.ZodString>;
|
|
58
|
+
cwd: z.ZodString;
|
|
59
|
+
}, z.core.$strict>], "operation">>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
export type BranchAgentConversationInput = z.infer<typeof BranchAgentConversationInputSchema>;
|
|
62
|
+
export declare const AgentConversationBranchReceiptSchema: z.ZodObject<{
|
|
63
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
64
|
+
requestKey: z.ZodString;
|
|
65
|
+
fingerprint: z.ZodString;
|
|
66
|
+
conversationId: z.ZodString;
|
|
67
|
+
sourceConversationId: z.ZodString;
|
|
68
|
+
sourceKind: z.ZodEnum<{
|
|
69
|
+
archive: "archive";
|
|
70
|
+
conversation: "conversation";
|
|
71
|
+
}>;
|
|
72
|
+
throughRunId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
sourceSeq: z.ZodInt;
|
|
74
|
+
sourceVersion: z.ZodInt;
|
|
75
|
+
sourceDigest: z.ZodString;
|
|
76
|
+
createdAt: z.ZodISODateTime;
|
|
77
|
+
}, z.core.$strict>;
|
|
78
|
+
export type AgentConversationBranchReceipt = z.infer<typeof AgentConversationBranchReceiptSchema>;
|
|
79
|
+
export declare const AgentConversationBranchResultSchema: z.ZodObject<{
|
|
80
|
+
outcome: z.ZodEnum<{
|
|
81
|
+
created: "created";
|
|
82
|
+
duplicate: "duplicate";
|
|
83
|
+
}>;
|
|
84
|
+
receipt: z.ZodObject<{
|
|
85
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
86
|
+
requestKey: z.ZodString;
|
|
87
|
+
fingerprint: z.ZodString;
|
|
88
|
+
conversationId: z.ZodString;
|
|
89
|
+
sourceConversationId: z.ZodString;
|
|
90
|
+
sourceKind: z.ZodEnum<{
|
|
91
|
+
archive: "archive";
|
|
92
|
+
conversation: "conversation";
|
|
93
|
+
}>;
|
|
94
|
+
throughRunId: z.ZodOptional<z.ZodString>;
|
|
95
|
+
sourceSeq: z.ZodInt;
|
|
96
|
+
sourceVersion: z.ZodInt;
|
|
97
|
+
sourceDigest: z.ZodString;
|
|
98
|
+
createdAt: z.ZodISODateTime;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
export type AgentConversationBranchResult = z.infer<typeof AgentConversationBranchResultSchema>;
|
|
102
|
+
//# sourceMappingURL=branch-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-contract.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAuBpC,CAAC;AAEZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;kBActC,CAAC;AAEZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;kBAKrC,CAAC;AAEZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { AgentStoreEventEnvelope } from '../durability/events.js';
|
|
3
|
+
import type { BranchIdentities } from './branch-identities.js';
|
|
4
|
+
import { BranchProvider } from './branch-provider.js';
|
|
5
|
+
import type { AgentMessage } from './schemas.js';
|
|
6
|
+
export declare function rekeyBranchEvents(ids: BranchIdentities, source: string, events: readonly AgentStoreEventEnvelope[], retainedMessages?: ReadonlyMap<string, AgentMessage>): {
|
|
7
|
+
schemaVersion: number;
|
|
8
|
+
eventId: string;
|
|
9
|
+
conversationId: string;
|
|
10
|
+
seq: number;
|
|
11
|
+
kind: string;
|
|
12
|
+
occurredAt: string;
|
|
13
|
+
payload: z.JSONType;
|
|
14
|
+
ignorable?: true | undefined;
|
|
15
|
+
}[];
|
|
16
|
+
export declare function collectBranchEvent(ids: BranchIdentities, event: AgentStoreEventEnvelope): void;
|
|
17
|
+
export declare function rekeyBranchEvent(ids: BranchIdentities, source: string, event: AgentStoreEventEnvelope, provider: BranchProvider): AgentStoreEventEnvelope;
|
|
18
|
+
//# sourceMappingURL=branch-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-events.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAK9C,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,SAAS,uBAAuB,EAAE,EAC1C,gBAAgB,GAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAa;;;;;;;;;IAwBhE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,uBAAuB,QAYvF;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,uBAAuB,EAC9B,QAAQ,EAAE,cAAc,GACvB,uBAAuB,CAiHzB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AgentMessage, AgentRun } from './schemas.js';
|
|
2
|
+
import type { StoreOperation } from './store-reduce-shared.js';
|
|
3
|
+
type IdentityKind = 'run' | 'message' | 'call' | 'approval' | 'operation' | 'spill' | 'event' | 'owner' | 'key' | 'schedule' | 'child';
|
|
4
|
+
/** Definitions are collected before references are resolved; foreign references never mint IDs. */
|
|
5
|
+
export declare class BranchIdentities {
|
|
6
|
+
readonly conversationId: string;
|
|
7
|
+
private readonly requestKey;
|
|
8
|
+
readonly sourceConversationId: string;
|
|
9
|
+
private readonly definitions;
|
|
10
|
+
private readonly references;
|
|
11
|
+
constructor(conversationId: string, requestKey: string, sourceConversationId: string);
|
|
12
|
+
define(kind: IdentityKind, source: string): string;
|
|
13
|
+
reference(kind: IdentityKind, source: string): string;
|
|
14
|
+
referenced(kind: IdentityKind): ReadonlySet<string>;
|
|
15
|
+
collectMessage(message: AgentMessage): void;
|
|
16
|
+
collectRun(run: AgentRun): void;
|
|
17
|
+
collectOperation(operation: StoreOperation): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=branch-identities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-identities.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-identities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,KAAK,YAAY,GACb,KAAK,GACL,SAAS,GACT,MAAM,GACN,UAAU,GACV,WAAW,GACX,OAAO,GACP,OAAO,GACP,OAAO,GACP,KAAK,GACL,UAAU,GACV,OAAO,CAAC;AAEZ,mGAAmG;AACnG,qBAAa,gBAAgB;IAIzB,QAAQ,CAAC,cAAc,EAAE,MAAM;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,QAAQ,CAAC,oBAAoB,EAAE,MAAM;IALvC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAgD;IAC5E,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAwC;IACnE,YACW,cAAc,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAC1B,oBAAoB,EAAE,MAAM,EACnC;IACJ,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAUjD;IACD,SAAS,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOpD;IACD,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,CAElD;IACD,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAM1C;IACD,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAI9B;IACD,gBAAgB,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI,CAuBhD;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { BranchIdentities } from './branch-identities.js';
|
|
3
|
+
import type { AgentMessage, AgentRun } from './schemas.js';
|
|
4
|
+
/** Application JSON is data, never an undocumented runtime reference codec. */
|
|
5
|
+
export declare function branchOpaqueJson(value: z.infer<ReturnType<typeof z.json>>): typeof value;
|
|
6
|
+
export declare function branchToolJson(ids: BranchIdentities, name: string, value: z.infer<ReturnType<typeof z.json>>, output: boolean): string | number | boolean | z.JSONType[] | {
|
|
7
|
+
[key: string]: z.JSONType;
|
|
8
|
+
} | {
|
|
9
|
+
matches: {
|
|
10
|
+
line: number;
|
|
11
|
+
text: string;
|
|
12
|
+
}[];
|
|
13
|
+
reference: string;
|
|
14
|
+
} | {
|
|
15
|
+
executable: string;
|
|
16
|
+
exitCode: number | null;
|
|
17
|
+
signal: string | null;
|
|
18
|
+
stdout: string;
|
|
19
|
+
stderr: string;
|
|
20
|
+
outcome: "cancelled" | "exited" | "output-limit" | "timeout";
|
|
21
|
+
artifact?: {
|
|
22
|
+
reference: string;
|
|
23
|
+
bytes: number;
|
|
24
|
+
truncated: boolean;
|
|
25
|
+
headBytes: number;
|
|
26
|
+
tailBytes: number;
|
|
27
|
+
omittedBytes: number;
|
|
28
|
+
} | undefined;
|
|
29
|
+
} | null;
|
|
30
|
+
export declare function branchMessage(ids: BranchIdentities, sourceConversationId: string, message: AgentMessage): AgentMessage;
|
|
31
|
+
export declare function branchRun(ids: BranchIdentities, sourceConversationId: string, run: AgentRun, settled: boolean): AgentRun;
|
|
32
|
+
//# sourceMappingURL=branch-messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-messages.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,KAAK,EAAE,YAAY,EAAoB,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1E,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,KAAK,CAoBxF;AAgCD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EACzC,MAAM,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;SA4BhB;AA6CD,wBAAgB,aAAa,CAC3B,GAAG,EAAE,gBAAgB,EACrB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,YAAY,GACpB,YAAY,CAad;AAED,wBAAgB,SAAS,CACvB,GAAG,EAAE,gBAAgB,EACrB,oBAAoB,EAAE,MAAM,EAC5B,GAAG,EAAE,QAAQ,EACb,OAAO,EAAE,OAAO,GACf,QAAQ,CAsBV"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { BranchIdentities } from './branch-identities.js';
|
|
3
|
+
/** Control observations are retained under an inert kind: no state/schedule/durability reader can replay them. */
|
|
4
|
+
export declare function branchObservation(ids: BranchIdentities, kind: string, raw: z.infer<ReturnType<typeof z.json>>): {
|
|
5
|
+
result: {
|
|
6
|
+
grade: "full";
|
|
7
|
+
restrictions: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
|
|
8
|
+
} | {
|
|
9
|
+
grade: "partial";
|
|
10
|
+
restrictions: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
|
|
11
|
+
gaps: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
|
|
12
|
+
} | {
|
|
13
|
+
grade: "unavailable";
|
|
14
|
+
reason: string;
|
|
15
|
+
};
|
|
16
|
+
required: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
|
|
17
|
+
missing: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
|
|
18
|
+
} | {
|
|
19
|
+
name: string;
|
|
20
|
+
version: number;
|
|
21
|
+
value: z.JSONType;
|
|
22
|
+
actor: "agent" | "human" | "system";
|
|
23
|
+
} | {
|
|
24
|
+
attempt: number;
|
|
25
|
+
delayMs?: number | undefined;
|
|
26
|
+
reason?: string | undefined;
|
|
27
|
+
} | {
|
|
28
|
+
effectName: string;
|
|
29
|
+
phase: "intent";
|
|
30
|
+
runId: string;
|
|
31
|
+
id?: string | undefined;
|
|
32
|
+
} | {
|
|
33
|
+
effectName: string;
|
|
34
|
+
phase: "accepted";
|
|
35
|
+
encoded: string;
|
|
36
|
+
via: "reconcile" | "run";
|
|
37
|
+
runId: string;
|
|
38
|
+
id?: string | undefined;
|
|
39
|
+
} | {
|
|
40
|
+
effectName: string;
|
|
41
|
+
phase: "uncertain";
|
|
42
|
+
runId: string;
|
|
43
|
+
id?: string | undefined;
|
|
44
|
+
} | {
|
|
45
|
+
kind: "sleep";
|
|
46
|
+
name: string;
|
|
47
|
+
deadline: number;
|
|
48
|
+
runId: string;
|
|
49
|
+
id?: string | undefined;
|
|
50
|
+
} | {
|
|
51
|
+
kind: "wait";
|
|
52
|
+
event: string;
|
|
53
|
+
id: string;
|
|
54
|
+
runId: string;
|
|
55
|
+
} | {
|
|
56
|
+
stepName: string;
|
|
57
|
+
encoded: string;
|
|
58
|
+
runId: string;
|
|
59
|
+
id?: string | undefined;
|
|
60
|
+
} | {
|
|
61
|
+
event: string;
|
|
62
|
+
id: string;
|
|
63
|
+
encoded: string;
|
|
64
|
+
runId: string;
|
|
65
|
+
} | {
|
|
66
|
+
bytes: number;
|
|
67
|
+
sha256?: string | undefined;
|
|
68
|
+
reference: string;
|
|
69
|
+
} | {
|
|
70
|
+
kind?: "after" | "at" | "every" | undefined;
|
|
71
|
+
nextAt?: string | null | undefined;
|
|
72
|
+
occurrence?: number | undefined;
|
|
73
|
+
lateByMs?: number | undefined;
|
|
74
|
+
state?: string | undefined;
|
|
75
|
+
message?: string | undefined;
|
|
76
|
+
attempts?: number | undefined;
|
|
77
|
+
retryAt?: string | null | undefined;
|
|
78
|
+
terminal?: boolean | undefined;
|
|
79
|
+
skipped?: boolean | undefined;
|
|
80
|
+
id: string;
|
|
81
|
+
} | {
|
|
82
|
+
childConversationId?: string | undefined;
|
|
83
|
+
parentConversationId?: string | undefined;
|
|
84
|
+
seedUptoSeq?: number | undefined;
|
|
85
|
+
budget?: z.JSONType | undefined;
|
|
86
|
+
state?: string | undefined;
|
|
87
|
+
resultReference?: string | undefined;
|
|
88
|
+
reason?: string | undefined;
|
|
89
|
+
action?: "blocking-presented" | "blocking-resolved" | "message-sent" | undefined;
|
|
90
|
+
approvalId?: string | undefined;
|
|
91
|
+
childApprovalId?: string | undefined;
|
|
92
|
+
callId?: string | undefined;
|
|
93
|
+
toolName?: string | undefined;
|
|
94
|
+
input?: z.JSONType | undefined;
|
|
95
|
+
batchId?: string | undefined;
|
|
96
|
+
kind?: string | undefined;
|
|
97
|
+
presentedAt?: string | undefined;
|
|
98
|
+
approved?: boolean | undefined;
|
|
99
|
+
};
|
|
100
|
+
export declare const BranchObservationSchema: z.ZodObject<{
|
|
101
|
+
sourceKind: z.ZodString;
|
|
102
|
+
payload: z.ZodJSONSchema;
|
|
103
|
+
}, z.core.$strict>;
|
|
104
|
+
//# sourceMappingURL=branch-observations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-observations.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-observations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAiE5D,kHAAkH;AAClH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmFxC;AAED,eAAO,MAAM,uBAAuB;;;kBAEzB,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { BranchIdentities } from './branch-identities.js';
|
|
3
|
+
/** Provider IDs stay provider IDs; runtime call references and their content digests are rekeyed. */
|
|
4
|
+
export declare class BranchProvider {
|
|
5
|
+
private readonly ids;
|
|
6
|
+
private readonly digests;
|
|
7
|
+
constructor(ids: BranchIdentities);
|
|
8
|
+
rekey(kind: string, raw: z.infer<ReturnType<typeof z.json>>): {
|
|
9
|
+
sha256: string;
|
|
10
|
+
message: {
|
|
11
|
+
role: "assistant" | "tool" | "user";
|
|
12
|
+
content: string | ({
|
|
13
|
+
type: "reasoning" | "text";
|
|
14
|
+
text: string;
|
|
15
|
+
} | {
|
|
16
|
+
type: "file";
|
|
17
|
+
data: string | {
|
|
18
|
+
binary: true;
|
|
19
|
+
sha256: string;
|
|
20
|
+
bytes: number;
|
|
21
|
+
};
|
|
22
|
+
mediaType: string;
|
|
23
|
+
filename?: string | undefined;
|
|
24
|
+
} | {
|
|
25
|
+
type: "image";
|
|
26
|
+
image: string | {
|
|
27
|
+
binary: true;
|
|
28
|
+
sha256: string;
|
|
29
|
+
bytes: number;
|
|
30
|
+
};
|
|
31
|
+
mediaType?: string | undefined;
|
|
32
|
+
} | {
|
|
33
|
+
type: "tool-call";
|
|
34
|
+
toolName: string;
|
|
35
|
+
toolCallId: string;
|
|
36
|
+
input: string | number | boolean | z.JSONType[] | {
|
|
37
|
+
[key: string]: z.JSONType;
|
|
38
|
+
} | {
|
|
39
|
+
matches: {
|
|
40
|
+
line: number;
|
|
41
|
+
text: string;
|
|
42
|
+
}[];
|
|
43
|
+
reference: string;
|
|
44
|
+
} | {
|
|
45
|
+
executable: string;
|
|
46
|
+
exitCode: number | null;
|
|
47
|
+
signal: string | null;
|
|
48
|
+
stdout: string;
|
|
49
|
+
stderr: string;
|
|
50
|
+
outcome: "cancelled" | "exited" | "output-limit" | "timeout";
|
|
51
|
+
artifact?: {
|
|
52
|
+
reference: string;
|
|
53
|
+
bytes: number;
|
|
54
|
+
truncated: boolean;
|
|
55
|
+
headBytes: number;
|
|
56
|
+
tailBytes: number;
|
|
57
|
+
omittedBytes: number;
|
|
58
|
+
} | undefined;
|
|
59
|
+
} | null;
|
|
60
|
+
approvalId?: undefined;
|
|
61
|
+
} | {
|
|
62
|
+
type: "tool-result";
|
|
63
|
+
toolName: string;
|
|
64
|
+
toolCallId: string;
|
|
65
|
+
output: {
|
|
66
|
+
type: "error-text" | "text";
|
|
67
|
+
value: string;
|
|
68
|
+
} | {
|
|
69
|
+
type: "error-json" | "json";
|
|
70
|
+
value: string | number | boolean | z.JSONType[] | {
|
|
71
|
+
[key: string]: z.JSONType;
|
|
72
|
+
} | {
|
|
73
|
+
matches: {
|
|
74
|
+
line: number;
|
|
75
|
+
text: string;
|
|
76
|
+
}[];
|
|
77
|
+
reference: string;
|
|
78
|
+
} | {
|
|
79
|
+
executable: string;
|
|
80
|
+
exitCode: number | null;
|
|
81
|
+
signal: string | null;
|
|
82
|
+
stdout: string;
|
|
83
|
+
stderr: string;
|
|
84
|
+
outcome: "cancelled" | "exited" | "output-limit" | "timeout";
|
|
85
|
+
artifact?: {
|
|
86
|
+
reference: string;
|
|
87
|
+
bytes: number;
|
|
88
|
+
truncated: boolean;
|
|
89
|
+
headBytes: number;
|
|
90
|
+
tailBytes: number;
|
|
91
|
+
omittedBytes: number;
|
|
92
|
+
} | undefined;
|
|
93
|
+
} | null;
|
|
94
|
+
};
|
|
95
|
+
approvalId?: undefined;
|
|
96
|
+
} | {
|
|
97
|
+
type: "tool-approval-request";
|
|
98
|
+
approvalId: string;
|
|
99
|
+
toolCallId: string;
|
|
100
|
+
} | {
|
|
101
|
+
type: "tool-approval-response";
|
|
102
|
+
approved: boolean;
|
|
103
|
+
reason?: string | undefined;
|
|
104
|
+
toolCallId?: undefined;
|
|
105
|
+
approvalId: string;
|
|
106
|
+
})[];
|
|
107
|
+
};
|
|
108
|
+
} | {
|
|
109
|
+
attempt: number;
|
|
110
|
+
stepNumber: number;
|
|
111
|
+
modelId: string;
|
|
112
|
+
instructionsSha256: string;
|
|
113
|
+
sha256?: undefined;
|
|
114
|
+
message?: undefined;
|
|
115
|
+
runId: string;
|
|
116
|
+
messageShas: string[];
|
|
117
|
+
bodySha256: string;
|
|
118
|
+
} | {
|
|
119
|
+
attempt: number;
|
|
120
|
+
stepNumber: number;
|
|
121
|
+
response: {
|
|
122
|
+
id: string;
|
|
123
|
+
provider?: string | undefined;
|
|
124
|
+
};
|
|
125
|
+
sha256?: undefined;
|
|
126
|
+
message?: undefined;
|
|
127
|
+
runId: string;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=branch-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-provider.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAmH5D,qGAAqG;AACrG,qBAAa,cAAc;IAEb,OAAO,CAAC,QAAQ,CAAC,GAAG;IADhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IACrD,YAA6B,GAAG,EAAE,gBAAgB,EAAI;IACtD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgF1D;CACF"}
|