stitchkit 0.85.1 → 0.86.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 +178 -0
- package/README.md +3 -0
- package/dist/agent-runtime/agent-tool.d.ts +25 -0
- package/dist/agent-runtime/agent-tool.d.ts.map +1 -0
- package/dist/agent-runtime/child-tools.d.ts +69 -0
- package/dist/agent-runtime/child-tools.d.ts.map +1 -0
- package/dist/agent-runtime/children.d.ts +113 -0
- package/dist/agent-runtime/children.d.ts.map +1 -0
- package/dist/agent-runtime/coding-tool-contract.d.ts +29 -0
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-refusals.d.ts +2 -0
- package/dist/agent-runtime/coding-tool-refusals.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tools.d.ts +1 -0
- package/dist/agent-runtime/coding-tools.d.ts.map +1 -1
- package/dist/agent-runtime/control-schema.d.ts +17 -0
- package/dist/agent-runtime/control-schema.d.ts.map +1 -1
- package/dist/agent-runtime/event-schema.d.ts +34 -0
- package/dist/agent-runtime/event-schema.d.ts.map +1 -1
- package/dist/agent-runtime/event-search-tools.d.ts +53 -0
- package/dist/agent-runtime/event-search-tools.d.ts.map +1 -0
- package/dist/agent-runtime/event-search.d.ts +23 -0
- package/dist/agent-runtime/event-search.d.ts.map +1 -0
- package/dist/agent-runtime/fault-bench.d.ts +45 -0
- package/dist/agent-runtime/fault-bench.d.ts.map +1 -0
- package/dist/agent-runtime/observability.d.ts +6 -0
- package/dist/agent-runtime/observability.d.ts.map +1 -1
- package/dist/agent-runtime/projections.d.ts +69 -0
- package/dist/agent-runtime/projections.d.ts.map +1 -0
- package/dist/agent-runtime/provider-failure.d.ts +5 -1
- package/dist/agent-runtime/provider-failure.d.ts.map +1 -1
- package/dist/agent-runtime/provider-origin.d.ts +12 -0
- package/dist/agent-runtime/provider-origin.d.ts.map +1 -0
- package/dist/agent-runtime/retry-policy.d.ts +27 -0
- package/dist/agent-runtime/retry-policy.d.ts.map +1 -0
- package/dist/agent-runtime/run-execution.d.ts +0 -9
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/run-mutation-queue.d.ts +21 -0
- package/dist/agent-runtime/run-mutation-queue.d.ts.map +1 -0
- package/dist/agent-runtime/run-operation-lifecycle.d.ts +3 -0
- package/dist/agent-runtime/run-operation-lifecycle.d.ts.map +1 -1
- package/dist/agent-runtime/runtime.d.ts +15 -0
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox.d.ts +66 -0
- package/dist/agent-runtime/sandbox.d.ts.map +1 -0
- package/dist/agent-runtime/schedule-tools.d.ts +35 -0
- package/dist/agent-runtime/schedule-tools.d.ts.map +1 -0
- package/dist/agent-runtime/schedules.d.ts +63 -0
- package/dist/agent-runtime/schedules.d.ts.map +1 -0
- package/dist/agent-runtime/schemas.d.ts +9 -0
- package/dist/agent-runtime/schemas.d.ts.map +1 -1
- package/dist/agent-runtime/spill.d.ts +24 -0
- package/dist/agent-runtime/spill.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-purge.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite.d.ts +26 -0
- package/dist/agent-runtime/sqlite.d.ts.map +1 -1
- package/dist/agent-runtime/state-slots.d.ts +48 -0
- package/dist/agent-runtime/state-slots.d.ts.map +1 -0
- package/dist/agent-runtime/state-tools.d.ts +58 -0
- package/dist/agent-runtime/state-tools.d.ts.map +1 -0
- package/dist/agent-runtime/store-driver.d.ts +13 -0
- package/dist/agent-runtime/store-driver.d.ts.map +1 -1
- package/dist/agent-runtime/store-events.d.ts +829 -0
- package/dist/agent-runtime/store-events.d.ts.map +1 -0
- package/dist/agent-runtime/store-migrations/v1-to-v2.d.ts +6 -0
- package/dist/agent-runtime/store-migrations/v1-to-v2.d.ts.map +1 -0
- package/dist/agent-runtime/store.d.ts +45 -0
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/agent-runtime/terminal-commit.d.ts +1 -1
- package/dist/agent-runtime-browser.js +5 -3
- package/dist/agent-runtime-coding-tools.js +144 -15
- package/dist/agent-runtime-harness.js +12 -10
- package/dist/agent-runtime-sqlite-bun.d.ts +1 -1
- package/dist/agent-runtime-sqlite-bun.d.ts.map +1 -1
- package/dist/agent-runtime-sqlite-bun.js +4 -3
- package/dist/agent-runtime-sqlite-node.d.ts +1 -1
- package/dist/agent-runtime-sqlite-node.d.ts.map +1 -1
- package/dist/agent-runtime-sqlite-node.js +4 -3
- package/dist/agent-runtime-testing.d.ts +3 -0
- package/dist/agent-runtime-testing.d.ts.map +1 -0
- package/dist/agent-runtime-testing.js +156 -0
- package/dist/agent-runtime.d.ts +16 -2
- package/dist/agent-runtime.d.ts.map +1 -1
- package/dist/agent-runtime.js +1591 -154
- package/dist/application.js +14 -14
- package/dist/cli.js +6 -6
- package/dist/{index-fwbkp2jn.js → index-0vfdh685.js} +2 -2
- package/dist/{index-5z8tezpx.js → index-0ydchz76.js} +3 -3
- package/dist/{index-3ds42w1w.js → index-1szetq6f.js} +33 -4
- package/dist/{index-jpp7jd1p.js → index-33xckd7h.js} +898 -425
- package/dist/{index-27487ay5.js → index-9hw9eq48.js} +4 -4
- package/dist/{index-66nxrgy0.js → index-b7qwhbzq.js} +428 -46
- package/dist/index-cnyk6te3.js +77 -0
- package/dist/index-gskm1k5a.js +50 -0
- package/dist/{index-fq492hg0.js → index-hber83mk.js} +254 -157
- package/dist/{index-4hk633vz.js → index-hkm6wysp.js} +9 -2
- package/dist/{index-dx9xehwt.js → index-kc6h6hg0.js} +1 -1
- package/dist/{index-x15ss2dx.js → index-p1b1y93x.js} +3 -0
- package/dist/{index-mgtxfe6b.js → index-r159gjwy.js} +8 -1
- package/dist/{index-s4ckmrac.js → index-rcgsnrr6.js} +3 -3
- package/dist/index-vfgb58nf.js +252 -0
- package/dist/{index-dggwnnjv.js → index-wn9cb82y.js} +1 -1
- package/dist/{index-ff0kcqvp.js → index-z2452tsw.js} +3 -3
- package/dist/testing/agent-store-conformance.d.ts.map +1 -1
- package/dist/testing.js +54 -80
- package/dist/tool-invoker.js +4 -4
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +16 -0
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +10 -8
- package/llms-full.txt +321 -13
- package/package.json +6 -1
|
@@ -0,0 +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;AAYxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAkBpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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vB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,2BAA2B,GACnC,6BAA6B,GAC7B,4BAA4B,CAAC;AAIjC;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,2BAA2B,CAmBjF;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,qBAAqB,GAAG,oBAAoB,CAWvF;AAeD,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEzD;AAED,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;kBAShC,CAAC;AAEZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,wBAAwB,GAAG,UAAU,CAG5F;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,UAAU,GAAG,wBAAwB,CAkB1F"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SqliteDatabase } from '../../internal/sqlite.js';
|
|
2
|
+
/** Transaction body for the single v1 → v2 durable-capabilities migration. */
|
|
3
|
+
export declare function migrateAgentRuntimeSqliteV1ToV2(database: SqliteDatabase, migratedAt?: string): void;
|
|
4
|
+
/** Create the complete current schema in a fresh database. */
|
|
5
|
+
export declare function createAgentRuntimeSqliteV2Tables(database: SqliteDatabase): void;
|
|
6
|
+
//# sourceMappingURL=v1-to-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1-to-v2.d.ts","sourceRoot":"","sources":["../../../src/agent-runtime/store-migrations/v1-to-v2.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAyM5D,8EAA8E;AAC9E,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,cAAc,EACxB,UAAU,GAAE,MAAiC,GAC5C,IAAI,CAQN;AAED,8DAA8D;AAC9D,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAE/E"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { AgentConversationPurgeInput, AgentConversationPurgeResult } from './purge.js';
|
|
3
3
|
import { type AgentRun, type AgentSnapshot } from './schemas.js';
|
|
4
|
+
import type { AgentStoreEventEnvelope, AgentStoreEventPage, AppendAgentStoreEvent, ReadAgentStoreEvents } from './store-events.js';
|
|
4
5
|
export declare const AgentStoreConflictSchema: z.ZodObject<{
|
|
5
6
|
outcome: z.ZodLiteral<"conflict">;
|
|
6
7
|
actualVersion: z.ZodInt;
|
|
@@ -134,10 +135,13 @@ export declare const AgentStoreAppliedSchema: z.ZodObject<{
|
|
|
134
135
|
cancelled: "cancelled";
|
|
135
136
|
context_overflow: "context_overflow";
|
|
136
137
|
interrupted: "interrupted";
|
|
138
|
+
output_rejected: "output_rejected";
|
|
137
139
|
policy_stop: "policy_stop";
|
|
138
140
|
provider_failure: "provider_failure";
|
|
139
141
|
provider_stop: "provider_stop";
|
|
142
|
+
runtime_failure: "runtime_failure";
|
|
140
143
|
shutdown: "shutdown";
|
|
144
|
+
storage_conflict: "storage_conflict";
|
|
141
145
|
success: "success";
|
|
142
146
|
superseded: "superseded";
|
|
143
147
|
timeout: "timeout";
|
|
@@ -349,10 +353,13 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
|
|
|
349
353
|
cancelled: "cancelled";
|
|
350
354
|
context_overflow: "context_overflow";
|
|
351
355
|
interrupted: "interrupted";
|
|
356
|
+
output_rejected: "output_rejected";
|
|
352
357
|
policy_stop: "policy_stop";
|
|
353
358
|
provider_failure: "provider_failure";
|
|
354
359
|
provider_stop: "provider_stop";
|
|
360
|
+
runtime_failure: "runtime_failure";
|
|
355
361
|
shutdown: "shutdown";
|
|
362
|
+
storage_conflict: "storage_conflict";
|
|
356
363
|
success: "success";
|
|
357
364
|
superseded: "superseded";
|
|
358
365
|
timeout: "timeout";
|
|
@@ -651,10 +658,13 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
|
|
|
651
658
|
cancelled: "cancelled";
|
|
652
659
|
context_overflow: "context_overflow";
|
|
653
660
|
interrupted: "interrupted";
|
|
661
|
+
output_rejected: "output_rejected";
|
|
654
662
|
policy_stop: "policy_stop";
|
|
655
663
|
provider_failure: "provider_failure";
|
|
656
664
|
provider_stop: "provider_stop";
|
|
665
|
+
runtime_failure: "runtime_failure";
|
|
657
666
|
shutdown: "shutdown";
|
|
667
|
+
storage_conflict: "storage_conflict";
|
|
658
668
|
success: "success";
|
|
659
669
|
superseded: "superseded";
|
|
660
670
|
timeout: "timeout";
|
|
@@ -867,10 +877,13 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
|
|
|
867
877
|
cancelled: "cancelled";
|
|
868
878
|
context_overflow: "context_overflow";
|
|
869
879
|
interrupted: "interrupted";
|
|
880
|
+
output_rejected: "output_rejected";
|
|
870
881
|
policy_stop: "policy_stop";
|
|
871
882
|
provider_failure: "provider_failure";
|
|
872
883
|
provider_stop: "provider_stop";
|
|
884
|
+
runtime_failure: "runtime_failure";
|
|
873
885
|
shutdown: "shutdown";
|
|
886
|
+
storage_conflict: "storage_conflict";
|
|
874
887
|
success: "success";
|
|
875
888
|
superseded: "superseded";
|
|
876
889
|
timeout: "timeout";
|
|
@@ -1081,10 +1094,13 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
|
|
|
1081
1094
|
cancelled: "cancelled";
|
|
1082
1095
|
context_overflow: "context_overflow";
|
|
1083
1096
|
interrupted: "interrupted";
|
|
1097
|
+
output_rejected: "output_rejected";
|
|
1084
1098
|
policy_stop: "policy_stop";
|
|
1085
1099
|
provider_failure: "provider_failure";
|
|
1086
1100
|
provider_stop: "provider_stop";
|
|
1101
|
+
runtime_failure: "runtime_failure";
|
|
1087
1102
|
shutdown: "shutdown";
|
|
1103
|
+
storage_conflict: "storage_conflict";
|
|
1088
1104
|
success: "success";
|
|
1089
1105
|
superseded: "superseded";
|
|
1090
1106
|
timeout: "timeout";
|
|
@@ -1383,10 +1399,13 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
|
|
|
1383
1399
|
cancelled: "cancelled";
|
|
1384
1400
|
context_overflow: "context_overflow";
|
|
1385
1401
|
interrupted: "interrupted";
|
|
1402
|
+
output_rejected: "output_rejected";
|
|
1386
1403
|
policy_stop: "policy_stop";
|
|
1387
1404
|
provider_failure: "provider_failure";
|
|
1388
1405
|
provider_stop: "provider_stop";
|
|
1406
|
+
runtime_failure: "runtime_failure";
|
|
1389
1407
|
shutdown: "shutdown";
|
|
1408
|
+
storage_conflict: "storage_conflict";
|
|
1390
1409
|
success: "success";
|
|
1391
1410
|
superseded: "superseded";
|
|
1392
1411
|
timeout: "timeout";
|
|
@@ -1523,10 +1542,13 @@ export declare const AgentRunViewSchema: z.ZodObject<{
|
|
|
1523
1542
|
cancelled: "cancelled";
|
|
1524
1543
|
context_overflow: "context_overflow";
|
|
1525
1544
|
interrupted: "interrupted";
|
|
1545
|
+
output_rejected: "output_rejected";
|
|
1526
1546
|
policy_stop: "policy_stop";
|
|
1527
1547
|
provider_failure: "provider_failure";
|
|
1528
1548
|
provider_stop: "provider_stop";
|
|
1549
|
+
runtime_failure: "runtime_failure";
|
|
1529
1550
|
shutdown: "shutdown";
|
|
1551
|
+
storage_conflict: "storage_conflict";
|
|
1530
1552
|
success: "success";
|
|
1531
1553
|
superseded: "superseded";
|
|
1532
1554
|
timeout: "timeout";
|
|
@@ -1826,10 +1848,13 @@ export declare const AcceptInputAndAssignRunSchema: z.ZodObject<{
|
|
|
1826
1848
|
cancelled: "cancelled";
|
|
1827
1849
|
context_overflow: "context_overflow";
|
|
1828
1850
|
interrupted: "interrupted";
|
|
1851
|
+
output_rejected: "output_rejected";
|
|
1829
1852
|
policy_stop: "policy_stop";
|
|
1830
1853
|
provider_failure: "provider_failure";
|
|
1831
1854
|
provider_stop: "provider_stop";
|
|
1855
|
+
runtime_failure: "runtime_failure";
|
|
1832
1856
|
shutdown: "shutdown";
|
|
1857
|
+
storage_conflict: "storage_conflict";
|
|
1833
1858
|
success: "success";
|
|
1834
1859
|
superseded: "superseded";
|
|
1835
1860
|
timeout: "timeout";
|
|
@@ -2203,10 +2228,13 @@ export declare const CommitRunTerminalSchema: z.ZodObject<{
|
|
|
2203
2228
|
cancelled: "cancelled";
|
|
2204
2229
|
context_overflow: "context_overflow";
|
|
2205
2230
|
interrupted: "interrupted";
|
|
2231
|
+
output_rejected: "output_rejected";
|
|
2206
2232
|
policy_stop: "policy_stop";
|
|
2207
2233
|
provider_failure: "provider_failure";
|
|
2208
2234
|
provider_stop: "provider_stop";
|
|
2235
|
+
runtime_failure: "runtime_failure";
|
|
2209
2236
|
shutdown: "shutdown";
|
|
2237
|
+
storage_conflict: "storage_conflict";
|
|
2210
2238
|
success: "success";
|
|
2211
2239
|
superseded: "superseded";
|
|
2212
2240
|
timeout: "timeout";
|
|
@@ -2424,10 +2452,13 @@ export declare const AgentRecoverableDescriptorSchema: z.ZodObject<{
|
|
|
2424
2452
|
cancelled: "cancelled";
|
|
2425
2453
|
context_overflow: "context_overflow";
|
|
2426
2454
|
interrupted: "interrupted";
|
|
2455
|
+
output_rejected: "output_rejected";
|
|
2427
2456
|
policy_stop: "policy_stop";
|
|
2428
2457
|
provider_failure: "provider_failure";
|
|
2429
2458
|
provider_stop: "provider_stop";
|
|
2459
|
+
runtime_failure: "runtime_failure";
|
|
2430
2460
|
shutdown: "shutdown";
|
|
2461
|
+
storage_conflict: "storage_conflict";
|
|
2431
2462
|
success: "success";
|
|
2432
2463
|
superseded: "superseded";
|
|
2433
2464
|
timeout: "timeout";
|
|
@@ -2546,10 +2577,13 @@ export declare const AgentRecoverablePageSchema: z.ZodObject<{
|
|
|
2546
2577
|
cancelled: "cancelled";
|
|
2547
2578
|
context_overflow: "context_overflow";
|
|
2548
2579
|
interrupted: "interrupted";
|
|
2580
|
+
output_rejected: "output_rejected";
|
|
2549
2581
|
policy_stop: "policy_stop";
|
|
2550
2582
|
provider_failure: "provider_failure";
|
|
2551
2583
|
provider_stop: "provider_stop";
|
|
2584
|
+
runtime_failure: "runtime_failure";
|
|
2552
2585
|
shutdown: "shutdown";
|
|
2586
|
+
storage_conflict: "storage_conflict";
|
|
2553
2587
|
success: "success";
|
|
2554
2588
|
superseded: "superseded";
|
|
2555
2589
|
timeout: "timeout";
|
|
@@ -2688,5 +2722,16 @@ export interface AgentRuntimeStore {
|
|
|
2688
2722
|
cursor?: string;
|
|
2689
2723
|
limit: number;
|
|
2690
2724
|
}): Promise<AgentRecoverablePage>;
|
|
2725
|
+
/** Append one declared non-transition fact without creating a second history store. */
|
|
2726
|
+
appendEvent(input: AppendAgentStoreEvent): Promise<AgentStoreEventEnvelope>;
|
|
2727
|
+
/** Read one bounded ordered slice of the canonical conversation event log. */
|
|
2728
|
+
readEvents(input: ReadAgentStoreEvents): Promise<AgentStoreEventPage>;
|
|
2729
|
+
/** Deterministic canonical archive bytes for one conversation's durable event log. */
|
|
2730
|
+
exportConversation(conversationId: string): Promise<Uint8Array>;
|
|
2731
|
+
/** Restore a canonical archive into an empty conversation event log. */
|
|
2732
|
+
importConversation(bytes: Uint8Array): Promise<{
|
|
2733
|
+
conversationId: string;
|
|
2734
|
+
events: number;
|
|
2735
|
+
}>;
|
|
2691
2736
|
}
|
|
2692
2737
|
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AACzF,O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,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACtE,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAC/E,qBAAqB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACvF;;;;;;;OAOG;IACH,eAAe,CAAC,KAAK,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC1F,uFAAuF;IACvF,WAAW,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC5E,8EAA8E;IAC9E,UAAU,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACtE,sFAAsF;IACtF,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAChE,wEAAwE;IACxE,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5F"}
|
|
@@ -89,7 +89,7 @@ export declare function appliedSnapshot(result: AgentStoreMutationResult, operat
|
|
|
89
89
|
executionSequence?: number | undefined;
|
|
90
90
|
ownerId?: string | undefined;
|
|
91
91
|
fencingToken?: number | undefined;
|
|
92
|
-
terminalReason?: "abandoned" | "absorbed" | "cancelled" | "context_overflow" | "interrupted" | "policy_stop" | "provider_failure" | "provider_stop" | "shutdown" | "success" | "superseded" | "timeout" | undefined;
|
|
92
|
+
terminalReason?: "abandoned" | "absorbed" | "cancelled" | "context_overflow" | "interrupted" | "output_rejected" | "policy_stop" | "provider_failure" | "provider_stop" | "runtime_failure" | "shutdown" | "storage_conflict" | "success" | "superseded" | "timeout" | undefined;
|
|
93
93
|
terminalPolicyName?: string | undefined;
|
|
94
94
|
absorbedIntoRunId?: string | undefined;
|
|
95
95
|
usage?: {
|
|
@@ -7,9 +7,10 @@ import {
|
|
|
7
7
|
createAgentControlView,
|
|
8
8
|
reduceAgentControlEvent,
|
|
9
9
|
reduceAgentControlSnapshot
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-z2452tsw.js";
|
|
11
11
|
import {
|
|
12
12
|
AgentAdmissionEventSchema,
|
|
13
|
+
AgentAttemptResetEventSchema,
|
|
13
14
|
AgentCheckpointEventSchema,
|
|
14
15
|
AgentReasoningDeltaEventSchema,
|
|
15
16
|
AgentReasoningEndEventSchema,
|
|
@@ -23,7 +24,7 @@ import {
|
|
|
23
24
|
AgentTransientDeltaEventSchema,
|
|
24
25
|
advanceAgentRuntimeEventCursor,
|
|
25
26
|
agentDurableEventId
|
|
26
|
-
} from "./index-
|
|
27
|
+
} from "./index-hkm6wysp.js";
|
|
27
28
|
import {
|
|
28
29
|
AgentAssistantPlaceholderSchema,
|
|
29
30
|
AgentControlPartSchema,
|
|
@@ -59,7 +60,7 @@ import {
|
|
|
59
60
|
AgentUsageSchema,
|
|
60
61
|
AgentUsageValueSchema,
|
|
61
62
|
runStateForTerminalReason
|
|
62
|
-
} from "./index-
|
|
63
|
+
} from "./index-p1b1y93x.js";
|
|
63
64
|
export {
|
|
64
65
|
runStateForTerminalReason,
|
|
65
66
|
reduceAgentControlSnapshot,
|
|
@@ -115,6 +116,7 @@ export {
|
|
|
115
116
|
AgentControlPartSchema,
|
|
116
117
|
AgentControlDeliverySchema,
|
|
117
118
|
AgentCheckpointEventSchema,
|
|
119
|
+
AgentAttemptResetEventSchema,
|
|
118
120
|
AgentAssistantPlaceholderSchema,
|
|
119
121
|
AgentAdmissionEventSchema
|
|
120
122
|
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
missingSandboxRestrictions,
|
|
3
|
+
probeAgentProcessSandbox
|
|
4
|
+
} from "./index-gskm1k5a.js";
|
|
1
5
|
import {
|
|
2
6
|
assertContainedFileCurrent,
|
|
3
7
|
assertContainedParentCurrent,
|
|
@@ -13,8 +17,8 @@ import {
|
|
|
13
17
|
} from "./index-t7gh5w3v.js";
|
|
14
18
|
import {
|
|
15
19
|
defineRuntimeTool
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
20
|
+
} from "./index-kc6h6hg0.js";
|
|
21
|
+
import"./index-r159gjwy.js";
|
|
18
22
|
import"./index-cby4ar3v.js";
|
|
19
23
|
import"./index-2bxcmqkb.js";
|
|
20
24
|
import"./index-6k1937bx.js";
|
|
@@ -82,6 +86,12 @@ var AgentCodingToolAuthorizationSchema = z.discriminatedUnion("operation", [
|
|
|
82
86
|
offset: z.int().nonnegative(),
|
|
83
87
|
maxBytes: z.int().positive()
|
|
84
88
|
}).strict(),
|
|
89
|
+
z.object({
|
|
90
|
+
operation: z.literal("artifact-search"),
|
|
91
|
+
reference: z.string().min(1),
|
|
92
|
+
query: z.string().min(1),
|
|
93
|
+
maxMatches: z.int().positive()
|
|
94
|
+
}).strict(),
|
|
85
95
|
z.object({
|
|
86
96
|
operation: z.literal("shell"),
|
|
87
97
|
executable: z.string().min(1),
|
|
@@ -138,7 +148,10 @@ var ShellOutputSchema = z.object({
|
|
|
138
148
|
artifact: z.object({
|
|
139
149
|
reference: z.string().min(1),
|
|
140
150
|
bytes: z.int().nonnegative(),
|
|
141
|
-
truncated: z.boolean()
|
|
151
|
+
truncated: z.boolean(),
|
|
152
|
+
headBytes: z.int().nonnegative(),
|
|
153
|
+
tailBytes: z.int().nonnegative(),
|
|
154
|
+
omittedBytes: z.int().nonnegative()
|
|
142
155
|
}).strict().optional()
|
|
143
156
|
}).strict();
|
|
144
157
|
var DEFAULT_LIMITS = {
|
|
@@ -173,7 +186,9 @@ var REFUSAL_STATUS = {
|
|
|
173
186
|
BAD_REQUEST: 400,
|
|
174
187
|
FORBIDDEN: 403,
|
|
175
188
|
NOT_FOUND: 404,
|
|
176
|
-
CONFLICT: 409
|
|
189
|
+
CONFLICT: 409,
|
|
190
|
+
SANDBOX_UNAVAILABLE: 503,
|
|
191
|
+
SANDBOX_INSUFFICIENT: 503
|
|
177
192
|
};
|
|
178
193
|
function codingRefusal(code, message, options = {}) {
|
|
179
194
|
throw new AppError(code, message, REFUSAL_STATUS[code], { message, ...options.details }, options.hint);
|
|
@@ -840,6 +855,22 @@ function createSearchAndPatchCodingTools(config, limits) {
|
|
|
840
855
|
import { spawn } from "node:child_process";
|
|
841
856
|
import { realpath as realpath5, stat } from "node:fs/promises";
|
|
842
857
|
async function runShell(input) {
|
|
858
|
+
const preview = (data, budget) => {
|
|
859
|
+
if (data.byteLength <= budget) {
|
|
860
|
+
return { data, headBytes: data.byteLength, tailBytes: 0, omittedBytes: 0 };
|
|
861
|
+
}
|
|
862
|
+
const headBytes = Math.ceil(budget / 2);
|
|
863
|
+
const tailBytes = Math.floor(budget / 2);
|
|
864
|
+
return {
|
|
865
|
+
data: Buffer.concat([
|
|
866
|
+
data.subarray(0, headBytes),
|
|
867
|
+
data.subarray(data.byteLength - tailBytes)
|
|
868
|
+
]),
|
|
869
|
+
headBytes,
|
|
870
|
+
tailBytes,
|
|
871
|
+
omittedBytes: data.byteLength - budget
|
|
872
|
+
};
|
|
873
|
+
};
|
|
843
874
|
const stdoutHeader = Buffer.from(`--- stdout ---
|
|
844
875
|
`);
|
|
845
876
|
const stderrHeader = Buffer.from(`
|
|
@@ -889,23 +920,38 @@ async function runShell(input) {
|
|
|
889
920
|
cleanup();
|
|
890
921
|
try {
|
|
891
922
|
const hasArtifact = input.artifacts && artifactBytes > input.maxOutputBytes;
|
|
892
|
-
const
|
|
923
|
+
const completeStdout = Buffer.concat(artifactStdout);
|
|
924
|
+
const completeStderr = Buffer.concat(artifactStderr);
|
|
925
|
+
const artifactData = hasArtifact ? Buffer.concat([stdoutHeader, completeStdout, stderrHeader, completeStderr]) : undefined;
|
|
926
|
+
const stdoutBudget = completeStderr.byteLength === 0 ? input.maxOutputBytes : Math.ceil(input.maxOutputBytes / 2);
|
|
927
|
+
const stderrBudget = completeStdout.byteLength === 0 ? input.maxOutputBytes : Math.floor(input.maxOutputBytes / 2);
|
|
928
|
+
const stdoutPreview = hasArtifact ? preview(completeStdout, stdoutBudget) : {
|
|
929
|
+
data: Buffer.concat(stdout),
|
|
930
|
+
headBytes: retained,
|
|
931
|
+
tailBytes: 0,
|
|
932
|
+
omittedBytes: 0
|
|
933
|
+
};
|
|
934
|
+
const stderrPreview = hasArtifact ? preview(completeStderr, stderrBudget) : { data: Buffer.concat(stderr), headBytes: 0, tailBytes: 0, omittedBytes: 0 };
|
|
893
935
|
const persisted = hasArtifact ? await input.artifacts?.write({
|
|
894
936
|
mediaType: "text/plain; charset=utf-8",
|
|
895
|
-
data: artifactData ?? new Uint8Array
|
|
937
|
+
data: artifactData ?? new Uint8Array,
|
|
938
|
+
...input.authorization && { authorization: input.authorization }
|
|
896
939
|
}) : undefined;
|
|
897
940
|
resolve(ShellOutputSchema.parse({
|
|
898
941
|
executable: input.executableName,
|
|
899
942
|
exitCode,
|
|
900
943
|
signal,
|
|
901
|
-
stdout:
|
|
902
|
-
stderr:
|
|
944
|
+
stdout: stdoutPreview.data.toString("utf8"),
|
|
945
|
+
stderr: stderrPreview.data.toString("utf8"),
|
|
903
946
|
outcome,
|
|
904
947
|
...persisted && {
|
|
905
948
|
artifact: {
|
|
906
949
|
reference: persisted.reference,
|
|
907
950
|
bytes: artifactData?.byteLength ?? 0,
|
|
908
|
-
truncated: outcome === "output-limit"
|
|
951
|
+
truncated: outcome === "output-limit",
|
|
952
|
+
headBytes: stdoutPreview.headBytes + stderrPreview.headBytes,
|
|
953
|
+
tailBytes: stdoutPreview.tailBytes + stderrPreview.tailBytes,
|
|
954
|
+
omittedBytes: stdoutPreview.omittedBytes + stderrPreview.omittedBytes
|
|
909
955
|
}
|
|
910
956
|
}
|
|
911
957
|
}));
|
|
@@ -1010,24 +1056,64 @@ function createShellCodingTool(config, limits) {
|
|
|
1010
1056
|
if (!(await stat(cwd.absolute)).isDirectory()) {
|
|
1011
1057
|
throw new Error("Coding tool cwd is not a directory");
|
|
1012
1058
|
}
|
|
1013
|
-
|
|
1059
|
+
const shellAuthorization = {
|
|
1014
1060
|
operation: "shell",
|
|
1015
1061
|
executable: input.executable,
|
|
1016
1062
|
args: input.args,
|
|
1017
1063
|
cwd: cwd.relative
|
|
1018
|
-
}
|
|
1064
|
+
};
|
|
1065
|
+
await authorizeCodingTool(config, shellAuthorization);
|
|
1066
|
+
let executablePath = executable;
|
|
1067
|
+
let executableArgs = input.args;
|
|
1068
|
+
let environment = config.environment ?? {};
|
|
1069
|
+
if (config.sandbox) {
|
|
1070
|
+
const grade = await probeAgentProcessSandbox(config.sandbox.adapter);
|
|
1071
|
+
if (grade.grade === "unavailable") {
|
|
1072
|
+
codingRefusal("SANDBOX_UNAVAILABLE", "The configured process sandbox is unavailable", {
|
|
1073
|
+
details: { reason: grade.reason }
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
const missing = missingSandboxRestrictions(grade, config.sandbox.required);
|
|
1077
|
+
if (missing.length > 0) {
|
|
1078
|
+
codingRefusal("SANDBOX_INSUFFICIENT", "The process sandbox lacks required restrictions", {
|
|
1079
|
+
details: { missing, grade: grade.grade }
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
try {
|
|
1083
|
+
const prepared = await config.sandbox.adapter.prepare({
|
|
1084
|
+
executable,
|
|
1085
|
+
args: input.args,
|
|
1086
|
+
cwd: cwd.absolute,
|
|
1087
|
+
environment
|
|
1088
|
+
});
|
|
1089
|
+
executablePath = prepared.executable;
|
|
1090
|
+
executableArgs = [...prepared.args];
|
|
1091
|
+
environment = prepared.environment ?? environment;
|
|
1092
|
+
} catch (error) {
|
|
1093
|
+
const refreshed = await probeAgentProcessSandbox(config.sandbox.adapter, {
|
|
1094
|
+
refresh: true
|
|
1095
|
+
});
|
|
1096
|
+
codingRefusal("SANDBOX_UNAVAILABLE", "The process sandbox failed while preparing a command", {
|
|
1097
|
+
details: {
|
|
1098
|
+
grade: refreshed.grade,
|
|
1099
|
+
reason: error instanceof Error ? error.message : "unknown sandbox error"
|
|
1100
|
+
}
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1019
1104
|
return runShell({
|
|
1020
1105
|
executableName: input.executable,
|
|
1021
|
-
executable,
|
|
1022
|
-
args:
|
|
1106
|
+
executable: executablePath,
|
|
1107
|
+
args: executableArgs,
|
|
1023
1108
|
cwd: cwd.absolute,
|
|
1024
|
-
environment
|
|
1109
|
+
environment,
|
|
1025
1110
|
...signal && { signal },
|
|
1026
1111
|
timeoutMs: limits.shellTimeoutMs,
|
|
1027
1112
|
terminationGraceMs: limits.shellTerminationGraceMs,
|
|
1028
1113
|
maxOutputBytes: limits.maxShellOutputBytes,
|
|
1029
1114
|
maxArtifactBytes: limits.maxArtifactBytes,
|
|
1030
|
-
...config.artifacts && { artifacts: config.artifacts }
|
|
1115
|
+
...config.artifacts && { artifacts: config.artifacts },
|
|
1116
|
+
authorization: shellAuthorization
|
|
1031
1117
|
});
|
|
1032
1118
|
}
|
|
1033
1119
|
});
|
|
@@ -1040,6 +1126,7 @@ var AGENT_CODING_TOOL_NAMES = {
|
|
|
1040
1126
|
listDirectory: "list_directory",
|
|
1041
1127
|
readFile: "read_file",
|
|
1042
1128
|
readOutput: "read_output",
|
|
1129
|
+
searchOutput: "search_output",
|
|
1043
1130
|
runCommand: "run_command",
|
|
1044
1131
|
searchFiles: "search_files",
|
|
1045
1132
|
writeFile: "write_file"
|
|
@@ -1081,6 +1168,9 @@ function createAgentCodingTools(config) {
|
|
|
1081
1168
|
offset: input.offset,
|
|
1082
1169
|
maxBytes
|
|
1083
1170
|
});
|
|
1171
|
+
const originAuthorization = await artifacts.authorization?.(input.reference);
|
|
1172
|
+
if (originAuthorization)
|
|
1173
|
+
await authorizeCodingTool(config, originAuthorization);
|
|
1084
1174
|
const result = await artifacts.read({
|
|
1085
1175
|
reference: input.reference,
|
|
1086
1176
|
offset: input.offset,
|
|
@@ -1100,6 +1190,45 @@ function createAgentCodingTools(config) {
|
|
|
1100
1190
|
};
|
|
1101
1191
|
}
|
|
1102
1192
|
}));
|
|
1193
|
+
if (artifacts.search) {
|
|
1194
|
+
const search = artifacts.search;
|
|
1195
|
+
artifactTools.push(defineRuntimeTool({
|
|
1196
|
+
name: AGENT_CODING_TOOL_NAMES.searchOutput,
|
|
1197
|
+
description: "Search a durable spilled output without loading it into context.",
|
|
1198
|
+
identity: { serviceName: "coding", action: "search-artifact", method: "POST" },
|
|
1199
|
+
input: z4.object({
|
|
1200
|
+
reference: z4.string().min(1),
|
|
1201
|
+
query: z4.string().min(1),
|
|
1202
|
+
maxMatches: z4.int().positive().max(limits.maxSearchResults).default(20)
|
|
1203
|
+
}).strict(),
|
|
1204
|
+
output: z4.object({
|
|
1205
|
+
reference: z4.string(),
|
|
1206
|
+
matches: z4.array(z4.object({ line: z4.int().positive(), text: z4.string() }))
|
|
1207
|
+
}).strict(),
|
|
1208
|
+
transports: ["AGENT"],
|
|
1209
|
+
handler: async ({ input }) => {
|
|
1210
|
+
await authorizeCodingTool(config, {
|
|
1211
|
+
operation: "artifact-search",
|
|
1212
|
+
reference: input.reference,
|
|
1213
|
+
query: input.query,
|
|
1214
|
+
maxMatches: input.maxMatches
|
|
1215
|
+
});
|
|
1216
|
+
const originAuthorization = await artifacts.authorization?.(input.reference);
|
|
1217
|
+
if (originAuthorization)
|
|
1218
|
+
await authorizeCodingTool(config, originAuthorization);
|
|
1219
|
+
return {
|
|
1220
|
+
reference: input.reference,
|
|
1221
|
+
matches: [
|
|
1222
|
+
...await search({
|
|
1223
|
+
reference: input.reference,
|
|
1224
|
+
query: input.query,
|
|
1225
|
+
maxMatches: input.maxMatches
|
|
1226
|
+
})
|
|
1227
|
+
]
|
|
1228
|
+
};
|
|
1229
|
+
}
|
|
1230
|
+
}));
|
|
1231
|
+
}
|
|
1103
1232
|
}
|
|
1104
1233
|
const commandTools = Object.keys(config.executables ?? {}).length ? [createShellCodingTool(config, limits)] : [];
|
|
1105
1234
|
return [
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentControlRequestSchema,
|
|
3
|
+
AgentControlResponseSchema
|
|
4
|
+
} from "./index-z2452tsw.js";
|
|
1
5
|
import {
|
|
2
6
|
composeAgentPrompt,
|
|
3
7
|
createAgentRuntime,
|
|
4
8
|
createAgentRuntimeEventSink
|
|
5
|
-
} from "./index-
|
|
9
|
+
} from "./index-33xckd7h.js";
|
|
10
|
+
import"./index-p13mwz16.js";
|
|
11
|
+
import"./index-hkm6wysp.js";
|
|
6
12
|
import {
|
|
7
13
|
AgentModelDescriptorSchema
|
|
8
14
|
} from "./index-tg3m2ec5.js";
|
|
9
15
|
import"./index-y2s6h5bf.js";
|
|
16
|
+
import"./index-vfgb58nf.js";
|
|
17
|
+
import"./index-p1b1y93x.js";
|
|
10
18
|
import"./index-wnfk50r0.js";
|
|
11
19
|
import {
|
|
12
20
|
walkContainedFiles
|
|
13
21
|
} from "./index-t7gh5w3v.js";
|
|
14
|
-
import {
|
|
15
|
-
AgentControlRequestSchema,
|
|
16
|
-
AgentControlResponseSchema
|
|
17
|
-
} from "./index-ff0kcqvp.js";
|
|
18
|
-
import"./index-4hk633vz.js";
|
|
19
|
-
import"./index-x15ss2dx.js";
|
|
20
22
|
import"./index-3xnq72rz.js";
|
|
21
23
|
import {
|
|
22
24
|
defineRuntimeTool
|
|
23
|
-
} from "./index-
|
|
24
|
-
import"./index-
|
|
25
|
+
} from "./index-kc6h6hg0.js";
|
|
26
|
+
import"./index-wn9cb82y.js";
|
|
25
27
|
import"./index-vsbzgd7b.js";
|
|
26
28
|
import"./index-f9mb610r.js";
|
|
27
|
-
import"./index-
|
|
29
|
+
import"./index-r159gjwy.js";
|
|
28
30
|
import"./index-cby4ar3v.js";
|
|
29
31
|
import"./index-7zbps32p.js";
|
|
30
32
|
import"./index-7evdsyez.js";
|
|
@@ -6,6 +6,6 @@ export interface BunSqliteAgentRuntimeStoreConfig {
|
|
|
6
6
|
}
|
|
7
7
|
/** Bun `bun:sqlite` binding with non-blocking lock refusal on same-thread contention. */
|
|
8
8
|
export declare function createBunSqliteAgentRuntimeStore(config: BunSqliteAgentRuntimeStoreConfig): SqliteAgentRuntimeStore;
|
|
9
|
-
export type { SqliteAgentRuntimeStore, SqliteAgentRuntimeStoreConfig, SqliteDatabase, SqliteStatement, SqliteValue, } from './agent-runtime/sqlite.js';
|
|
9
|
+
export type { SqliteAgentRuntimeStore, SqliteAgentRuntimeStoreConfig, SqliteDatabase, SqliteStatement, SqliteStoreTransaction, SqliteValue, } from './agent-runtime/sqlite.js';
|
|
10
10
|
export { createSqliteAgentRuntimeStore, initializeAgentRuntimeSqlite, } from './agent-runtime/sqlite.js';
|
|
11
11
|
//# sourceMappingURL=agent-runtime-sqlite-bun.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-runtime-sqlite-bun.d.ts","sourceRoot":"","sources":["../src/agent-runtime-sqlite-bun.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,uBAAuB,EAG7B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,yFAAyF;AACzF,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,gCAAgC,GACvC,uBAAuB,CAyBzB;AAED,YAAY,EACV,uBAAuB,EACvB,6BAA6B,EAC7B,cAAc,EACd,eAAe,EACf,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"agent-runtime-sqlite-bun.d.ts","sourceRoot":"","sources":["../src/agent-runtime-sqlite-bun.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,uBAAuB,EAG7B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,yFAAyF;AACzF,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,gCAAgC,GACvC,uBAAuB,CAyBzB;AAED,YAAY,EACV,uBAAuB,EACvB,6BAA6B,EAC7B,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSqliteAgentRuntimeStore,
|
|
3
3
|
initializeAgentRuntimeSqlite
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-b7qwhbzq.js";
|
|
5
|
+
import"./index-hber83mk.js";
|
|
6
6
|
import"./index-y2s6h5bf.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-vfgb58nf.js";
|
|
8
|
+
import"./index-p1b1y93x.js";
|
|
8
9
|
|
|
9
10
|
// src/agent-runtime-sqlite-bun.ts
|
|
10
11
|
import { Database } from "bun:sqlite";
|
|
@@ -6,6 +6,6 @@ export interface NodeSqliteAgentRuntimeStoreConfig {
|
|
|
6
6
|
}
|
|
7
7
|
/** Node built-in `node:sqlite` binding with non-blocking lock refusal on contention. */
|
|
8
8
|
export declare function createNodeSqliteAgentRuntimeStore(config: NodeSqliteAgentRuntimeStoreConfig): SqliteAgentRuntimeStore;
|
|
9
|
-
export type { SqliteAgentRuntimeStore, SqliteAgentRuntimeStoreConfig, SqliteDatabase, SqliteStatement, SqliteValue, } from './agent-runtime/sqlite.js';
|
|
9
|
+
export type { SqliteAgentRuntimeStore, SqliteAgentRuntimeStoreConfig, SqliteDatabase, SqliteStatement, SqliteStoreTransaction, SqliteValue, } from './agent-runtime/sqlite.js';
|
|
10
10
|
export { createSqliteAgentRuntimeStore, initializeAgentRuntimeSqlite, } from './agent-runtime/sqlite.js';
|
|
11
11
|
//# sourceMappingURL=agent-runtime-sqlite-node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-runtime-sqlite-node.d.ts","sourceRoot":"","sources":["../src/agent-runtime-sqlite-node.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,uBAAuB,EAG7B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,iCAAiC;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wFAAwF;AACxF,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,iCAAiC,GACxC,uBAAuB,CA2BzB;AAED,YAAY,EACV,uBAAuB,EACvB,6BAA6B,EAC7B,cAAc,EACd,eAAe,EACf,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"agent-runtime-sqlite-node.d.ts","sourceRoot":"","sources":["../src/agent-runtime-sqlite-node.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,uBAAuB,EAG7B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,iCAAiC;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wFAAwF;AACxF,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,iCAAiC,GACxC,uBAAuB,CA2BzB;AAED,YAAY,EACV,uBAAuB,EACvB,6BAA6B,EAC7B,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSqliteAgentRuntimeStore,
|
|
3
3
|
initializeAgentRuntimeSqlite
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-b7qwhbzq.js";
|
|
5
|
+
import"./index-hber83mk.js";
|
|
6
6
|
import"./index-y2s6h5bf.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-vfgb58nf.js";
|
|
8
|
+
import"./index-p1b1y93x.js";
|
|
8
9
|
|
|
9
10
|
// src/agent-runtime-sqlite-node.ts
|
|
10
11
|
import { DatabaseSync } from "node:sqlite";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { type AgentFaultStep, AgentFaultStepSchema, createFaultProviderServer, createReplayAgentProvider, defineAgentFaultPlan, } from './agent-runtime/fault-bench.js';
|
|
2
|
+
export { type AgentRaceBarrier, type AgentRaceDriver, type AgentRaceTrace, type AgentRaceTraceEntry, createAgentRaceBarrier, createAgentRaceDriver, createAgentRaceTrace, } from './agent-runtime/testing.js';
|
|
3
|
+
//# sourceMappingURL=agent-runtime-testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-runtime-testing.d.ts","sourceRoot":"","sources":["../src/agent-runtime-testing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC"}
|