stitchkit 0.112.3 → 0.113.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -1
  3. package/dist/agent-runtime/runtime.d.ts +8 -3
  4. package/dist/agent-runtime/runtime.d.ts.map +1 -1
  5. package/dist/agent-runtime/sqlite-history.d.ts.map +1 -1
  6. package/dist/agent-runtime/store-driver-contract.d.ts +94 -1
  7. package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
  8. package/dist/agent-runtime/store-events.d.ts +8 -0
  9. package/dist/agent-runtime/store-events.d.ts.map +1 -1
  10. package/dist/agent-runtime/store-memory.d.ts.map +1 -1
  11. package/dist/agent-runtime/store-reduce-history.d.ts +1 -1
  12. package/dist/agent-runtime/store-reduce-history.d.ts.map +1 -1
  13. package/dist/agent-runtime/store.d.ts +8 -2
  14. package/dist/agent-runtime/store.d.ts.map +1 -1
  15. package/dist/entrypoints/agent-runtime/harness.js +2 -2
  16. package/dist/entrypoints/agent-runtime/sqlite/bun.js +3 -3
  17. package/dist/entrypoints/agent-runtime/sqlite/node.js +3 -3
  18. package/dist/entrypoints/agent-runtime/testing.js +34 -3
  19. package/dist/entrypoints/agent-runtime.js +4 -4
  20. package/dist/{index-jna0ejsa.js → index-fggxgbrk.js} +2 -1
  21. package/dist/{index-c9vpsxw4.js → index-gz9jf461.js} +22 -3
  22. package/dist/{index-kenvdagc.js → index-k0zfcxf5.js} +19 -3
  23. package/dist/{index-b9yqb9e7.js → index-ppf5nerp.js} +4 -4
  24. package/dist/{index-f2p949ax.js → index-yjnmac9b.js} +41 -7
  25. package/llms/agent-runtime.2.txt +25 -0
  26. package/llms/agent-runtime.3.txt +1 -1
  27. package/llms/agent-runtime.txt +6 -0
  28. package/llms/stitchkit.txt +3 -3
  29. package/llms/{upgrading-0.103.0-0.112.0.txt → upgrading-0.103.13-0.113.0.txt} +22 -32
  30. package/llms/{upgrading-0.75.0-0.102.0.txt → upgrading-0.75.0-0.103.0.txt} +32 -3
  31. package/llms/upgrading.txt +2 -2
  32. package/llms-full.txt +54 -4
  33. package/llms.txt +3 -3
  34. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -15,6 +15,21 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
15
15
 
16
16
  ## [Unreleased]
17
17
 
18
+ ## [0.113.0] - 2026-10-26
19
+
20
+ ### ⚠️ Breaking changes
21
+
22
+ **Who must act:** custom `AgentRuntimeStoreDriver` adapters must apply the new `insert` history mutation; custom `AgentRuntimeStore` implementations of `seedConversationInput` must honour `placement`. Applications on the built-in memory or SQLite stores need no change.
23
+
24
+ - `stitchkit/agent-runtime` — **a store driver applies `insert` history mutations.** `seedConversationInput` with `placement: 'after-settled'` places an exchange completed without a model ahead of an active run's first message, which no existing mutation can express. A driver whose `history.apply` does not handle `{ type: 'insert', message, beforeMessageId? }` corrupts or refuses that write. Before: `apply` handled `admit`, `upsert-assistant`, `replace-compacted-range` and `seed`. After: it also places `message` ahead of the active row `beforeMessageId`, at the end when absent, and replaces a message already present where it stands. `runAgentStoreConformance` proves it; the Prisma example shows the implementation. See [ADR 0271](docs/decisions/0271-an-exchange-without-a-model-is-settled-history.md) and the [migration](docs/guide/upgrading.md).
25
+ **Affects:** `stitchkit/agent-runtime` AgentRuntimeStoreDriver, AgentHistoryMutationSchema, AgentRuntimeStore(seedConversationInput)
26
+
27
+ ### Added
28
+
29
+ - `stitchkit/agent-runtime` — `seedConversationInput` takes `placement: 'after-settled'` to write a keyed exchange that happened without a model (committed user and completed assistant messages, no run) after the settled history and ahead of any active run. It is ordinary history: in the snapshot, in compaction and in the next provider request; no model call and no run. → ADR 0271
30
+
31
+ - `stitchkit/agent-runtime` — a stop policy's `when` receives the run context next to `steps`: `context`, `run`, `signal`, `toolFenceLifecycle` and `contextUsage`, the same shape `prepareStep` gets, typed by the runtime's `CONTEXT`. A rule that depends on its own run no longer needs a module map keyed by `runId`. A policy that reads only `steps` is unchanged.
32
+
18
33
  ## [0.112.3] - 2026-10-26
19
34
 
20
35
  ### Fixed
@@ -1 +1 @@
1
- {"version":3,"file":"run-model-attempts.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/run-model-attempts.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,OAAO,EACb,MAAM,IAAI,CAAC;AASZ,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,uBAAuB,CAAC;AAS/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAwW3D,+EAA+E;AAC/E,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,KAAK,SAAS,OAAO,EACnE,SAAS,EAAE,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,EACvC,IAAI,EAAE,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC,CAuCf"}
1
+ {"version":3,"file":"run-model-attempts.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/run-model-attempts.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,OAAO,EACb,MAAM,IAAI,CAAC;AASZ,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,uBAAuB,CAAC;AAS/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAyW3D,+EAA+E;AAC/E,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,KAAK,SAAS,OAAO,EACnE,SAAS,EAAE,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,EACvC,IAAI,EAAE,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC,CAuCf"}
@@ -201,7 +201,7 @@ export interface AgentRuntimeConfig<CONTEXT, TOOLS extends ToolSet = ToolSet> {
201
201
  * application can prove the assembled step exceeds the model budget.
202
202
  */
203
203
  prepareStep?: AgentRuntimePrepareStep<CONTEXT, TOOLS>;
204
- stopPolicies?: readonly AgentRuntimeStopPolicy<TOOLS>[];
204
+ stopPolicies?: readonly AgentRuntimeStopPolicy<TOOLS, CONTEXT>[];
205
205
  toolApproval?: ToolApprovalConfiguration<TOOLS, CONTEXT>;
206
206
  /** Enables the SDK's HMAC binding between approval request and exact tool call/input. */
207
207
  toolApprovalSecret?: string | Uint8Array;
@@ -246,9 +246,14 @@ export interface AgentRuntimeConfig<CONTEXT, TOOLS extends ToolSet = ToolSet> {
246
246
  generateId?: () => string;
247
247
  now?: () => Date;
248
248
  }
249
- export interface AgentRuntimeStopPolicy<TOOLS extends ToolSet = ToolSet> {
249
+ /**
250
+ * A rule that ends the run at a step boundary. `when` sees the steps so far and the
251
+ * same run context `prepareStep` sees, so a rule that depends on its run reads it
252
+ * here instead of keeping a map of its own keyed by run.
253
+ */
254
+ export interface AgentRuntimeStopPolicy<TOOLS extends ToolSet = ToolSet, CONTEXT = unknown> {
250
255
  name: string;
251
- when: StopCondition<TOOLS>;
256
+ when: (input: Parameters<StopCondition<TOOLS>>[0] & AgentRuntimeRunContext<CONTEXT>) => ReturnType<StopCondition<TOOLS>>;
252
257
  }
253
258
  export interface AgentRuntime<CONTEXT = unknown> {
254
259
  submit(input: AgentRuntimeInput): {
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,yBAAyB,EACzB,OAAO,EACR,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK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AC,KAAK,EAAE,yBAAyB,GAAG;QACxC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACxB,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;KACrC,CAAC;IACF,SAAS,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAChF,OAAO,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAC5E,OAAO,CACL,OAAO,EAAE,0BAA0B,CAAC,OAAO,CAAC,GAC3C,OAAO,CAAC,SAAS,2BAA2B,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC;IACjE;;;;;;;OAOG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC7E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,KAAK,SAAS,OAAO,EAC/D,MAAM,EAAE,kBAAkB,CAAC,OAAO,EAAE,KAAK,CAAC,GACzC,YAAY,CAAC,OAAO,CAAC,CAWvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"sqlite-history.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sqlite-history.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,iBAAiB,EACvB,MAAM,eAAe,CAAC;AAGvB;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC,SAAS,CAqJtD,CAAC"}
1
+ {"version":3,"file":"sqlite-history.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sqlite-history.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,iBAAiB,EACvB,MAAM,eAAe,CAAC;AAGvB;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC,SAAS,CA6KtD,CAAC"}
@@ -324,7 +324,7 @@ export type AgentRuntimeHead = z.infer<typeof AgentRuntimeHeadSchema>;
324
324
  export type AgentStoredRun = z.infer<typeof AgentStoredRunSchema>;
325
325
  export type AgentAdmissionReceipt = z.infer<typeof AgentAdmissionReceiptSchema>;
326
326
  /**
327
- * The durable record that a keyed user-instruction seed already happened.
327
+ * The durable record that a keyed seed already happened.
328
328
  *
329
329
  * Kept beside the history rather than derived from it: compaction and `clear`
330
330
  * legitimately remove the seeded messages, and the seed must not return when
@@ -707,6 +707,99 @@ export declare const AgentHistoryMutationSchema: z.ZodDiscriminatedUnion<[z.ZodO
707
707
  createdAt: z.ZodISODateTime;
708
708
  updatedAt: z.ZodISODateTime;
709
709
  }, z.core.$strip>;
710
+ }, z.core.$strip>, z.ZodObject<{
711
+ type: z.ZodLiteral<"insert">;
712
+ message: z.ZodObject<{
713
+ schemaVersion: z.ZodLiteral<1>;
714
+ id: z.ZodString;
715
+ conversationId: z.ZodString;
716
+ runId: z.ZodOptional<z.ZodString>;
717
+ role: z.ZodEnum<{
718
+ assistant: "assistant";
719
+ summary: "summary";
720
+ system: "system";
721
+ tool: "tool";
722
+ user: "user";
723
+ }>;
724
+ status: z.ZodEnum<{
725
+ committed: "committed";
726
+ completed: "completed";
727
+ failed: "failed";
728
+ interrupted: "interrupted";
729
+ streaming: "streaming";
730
+ superseded: "superseded";
731
+ }>;
732
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
733
+ type: z.ZodLiteral<"text">;
734
+ text: z.ZodString;
735
+ }, z.core.$strip>, z.ZodObject<{
736
+ type: z.ZodLiteral<"reasoning">;
737
+ text: z.ZodString;
738
+ provider: z.ZodOptional<z.ZodObject<{
739
+ schemaVersion: z.ZodInt;
740
+ provider: z.ZodString;
741
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
742
+ }, z.core.$strip>>;
743
+ }, z.core.$strip>, z.ZodObject<{
744
+ type: z.ZodLiteral<"file">;
745
+ mediaType: z.ZodString;
746
+ reference: z.ZodString;
747
+ filename: z.ZodOptional<z.ZodString>;
748
+ }, z.core.$strip>, z.ZodObject<{
749
+ type: z.ZodLiteral<"source">;
750
+ sourceId: z.ZodString;
751
+ url: z.ZodOptional<z.ZodURL>;
752
+ title: z.ZodOptional<z.ZodString>;
753
+ }, z.core.$strip>, z.ZodObject<{
754
+ type: z.ZodLiteral<"tool-call">;
755
+ callId: z.ZodString;
756
+ toolName: z.ZodString;
757
+ input: z.ZodJSONSchema;
758
+ provider: z.ZodOptional<z.ZodObject<{
759
+ schemaVersion: z.ZodInt;
760
+ provider: z.ZodString;
761
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
762
+ }, z.core.$strip>>;
763
+ }, z.core.$strip>, z.ZodObject<{
764
+ type: z.ZodLiteral<"tool-result">;
765
+ callId: z.ZodString;
766
+ toolName: z.ZodString;
767
+ outcome: z.ZodEnum<{
768
+ error: "error";
769
+ interrupted: "interrupted";
770
+ success: "success";
771
+ }>;
772
+ output: z.ZodOptional<z.ZodJSONSchema>;
773
+ }, z.core.$strip>, z.ZodObject<{
774
+ type: z.ZodLiteral<"tool-approval-request">;
775
+ approvalId: z.ZodString;
776
+ callId: z.ZodString;
777
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
778
+ signature: z.ZodOptional<z.ZodString>;
779
+ }, z.core.$strip>, z.ZodObject<{
780
+ type: z.ZodLiteral<"tool-approval-response">;
781
+ approvalId: z.ZodString;
782
+ approved: z.ZodBoolean;
783
+ reason: z.ZodOptional<z.ZodString>;
784
+ }, z.core.$strip>, z.ZodObject<{
785
+ type: z.ZodLiteral<"provider">;
786
+ envelope: z.ZodObject<{
787
+ schemaVersion: z.ZodInt;
788
+ provider: z.ZodString;
789
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
790
+ }, z.core.$strip>;
791
+ }, z.core.$strip>, z.ZodObject<{
792
+ type: z.ZodLiteral<"control">;
793
+ reason: z.ZodEnum<{
794
+ "run-interrupted": "run-interrupted";
795
+ "stale-run": "stale-run";
796
+ }>;
797
+ }, z.core.$strip>], "type">>;
798
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
799
+ createdAt: z.ZodISODateTime;
800
+ updatedAt: z.ZodISODateTime;
801
+ }, z.core.$strip>;
802
+ beforeMessageId: z.ZodOptional<z.ZodString>;
710
803
  }, z.core.$strip>], "type">;
711
804
  export type AgentHistoryMutation = z.infer<typeof AgentHistoryMutationSchema>;
712
805
  export type AgentStoreCompareAndSwapResult = {
@@ -1 +1 @@
1
- {"version":3,"file":"store-driver-contract.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-driver-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,YAAY,EAIjB,KAAK,QAAQ,EAEd,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAElE,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI/B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ASG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,QAAQ,CAAC,OAAO,CAAC,EAI/D,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,OAAO,CAElE;AAED,wBAAgB,SAAS,CAAC,cAAc,EAAE,MAAM,GAAG,gBAAgB,CAMlE"}
@@ -888,6 +888,10 @@ export declare const AgentStoreTransitionSchema: z.ZodDiscriminatedUnion<[z.ZodO
888
888
  createdAt: z.ZodISODateTime;
889
889
  updatedAt: z.ZodISODateTime;
890
890
  }, z.core.$strip>>;
891
+ placement: z.ZodOptional<z.ZodEnum<{
892
+ "after-settled": "after-settled";
893
+ lead: "lead";
894
+ }>>;
891
895
  }, z.core.$strip>;
892
896
  }, z.core.$strict>], "type">;
893
897
  export type AgentStoreTransition = z.infer<typeof AgentStoreTransitionSchema>;
@@ -1855,6 +1859,10 @@ export declare const AgentStoreTransitionRecordSchema: z.ZodUnion<readonly [z.Zo
1855
1859
  createdAt: z.ZodISODateTime;
1856
1860
  updatedAt: z.ZodISODateTime;
1857
1861
  }, z.core.$strip>>;
1862
+ placement: z.ZodOptional<z.ZodEnum<{
1863
+ "after-settled": "after-settled";
1864
+ lead: "lead";
1865
+ }>>;
1858
1866
  }, z.core.$strip>;
1859
1867
  }, z.core.$strict>], "type">, z.ZodObject<{
1860
1868
  type: z.ZodLiteral<"checkpoint">;
@@ -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;AACxB,OAAO,EACL,KAAK,uBAAuB,EAG5B,KAAK,qBAAqB,EAE3B,MAAM,sBAAsB,CAAC;AAe9B,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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K,iBAAiB,EACvB,MAAM,SAAS,CAAC;AAwTjB,oGAAoG;AACpG,wBAAgB,6BAA6B,IAAI,iBAAiB,GAChE,QAAQ,CAAC,IAAI,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC,CAkExD"}
1
+ {"version":3,"file":"store-memory.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-memory.ts"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,SAAS,CAAC;AA0UjB,oGAAoG;AACpG,wBAAgB,6BAA6B,IAAI,iBAAiB,GAChE,QAAQ,CAAC,IAAI,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC,CAkExD"}
@@ -3,7 +3,7 @@ import type { AcceptInputAndAssignRun, ReplaceCompactedRange, SeedConversationIn
3
3
  import { type ReducedMutation } from './store-reduce-shared.js';
4
4
  /** Admit one input and assign it to a new queued run, or coalesce it into one. */
5
5
  export declare function reduceAccept(current: AgentSnapshot, input: AcceptInputAndAssignRun): ReducedMutation;
6
- /** Prepend a keyed user-instruction seed ahead of the conversation. */
6
+ /** Write a keyed seed: user instructions ahead of the conversation, or a settled exchange. */
7
7
  export declare function reduceSeed(current: AgentSnapshot, input: SeedConversationInput): ReducedMutation;
8
8
  /** Replace one contiguous range of finished history with its summary. */
9
9
  export declare function reduceCompact(current: AgentSnapshot, input: ReplaceCompactedRange): ReducedMutation;
@@ -1 +1 @@
1
- {"version":3,"file":"store-reduce-history.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-reduce-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAOjB,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGhF,kFAAkF;AAClF,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,uBAAuB,GAC7B,eAAe,CAwEjB;AAED,uEAAuE;AACvE,wBAAgB,UAAU,CACxB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,qBAAqB,GAC3B,eAAe,CAkCjB;AAED,yEAAyE;AACzE,wBAAgB,aAAa,CAC3B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,qBAAqB,GAC3B,eAAe,CAwDjB"}
1
+ {"version":3,"file":"store-reduce-history.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-reduce-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EACV,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAOjB,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGhF,kFAAkF;AAClF,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,uBAAuB,GAC7B,eAAe,CAwEjB;AAkED,8FAA8F;AAC9F,wBAAgB,UAAU,CACxB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,qBAAqB,GAC3B,eAAe,CA8BjB;AAED,yEAAyE;AACzE,wBAAgB,aAAa,CAC3B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,qBAAqB,GAC3B,eAAe,CAwDjB"}
@@ -2516,6 +2516,10 @@ export declare const SeedConversationInputSchema: z.ZodObject<{
2516
2516
  createdAt: z.ZodISODateTime;
2517
2517
  updatedAt: z.ZodISODateTime;
2518
2518
  }, z.core.$strip>>;
2519
+ placement: z.ZodOptional<z.ZodEnum<{
2520
+ "after-settled": "after-settled";
2521
+ lead: "lead";
2522
+ }>>;
2519
2523
  }, z.core.$strip>;
2520
2524
  export type AcceptInputAndAssignRun = z.infer<typeof AcceptInputAndAssignRunSchema>;
2521
2525
  export type AcquireAgentRun = z.infer<typeof AcquireAgentRunSchema>;
@@ -2819,9 +2823,11 @@ export interface AgentRuntimeStore {
2819
2823
  commitRunTerminal(input: CommitRunTerminal): Promise<AgentStoreMutationResult>;
2820
2824
  replaceCompactedRange(input: ReplaceCompactedRange): Promise<AgentStoreMutationResult>;
2821
2825
  /**
2822
- * Write user-role instructions into durable history exactly once per key.
2826
+ * Write history no run owns exactly once per key: user instructions ahead of
2827
+ * the conversation, or (`placement: 'after-settled'`) an exchange completed
2828
+ * without a model after its settled history.
2823
2829
  *
2824
- * The messages become ordinary user history (no run owns them), so they
2830
+ * The messages become ordinary history (no run owns them), so they
2825
2831
  * appear in `snapshot().messages`, compaction may summarize them, and a
2826
2832
  * history replacement removes them. A subsequent call with the same
2827
2833
  * `seedKey` is a no-op even after that removal, because "already seeded" is
@@ -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,EACV,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAIL,KAAK,QAAQ,EAGb,KAAK,aAAa,EAInB,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAC;AACH,eAAO,MAAM,wBAAwB;;iBAAgD,CAAC;AACtF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAG,OAAO,CAAC;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5F"}
@@ -5,7 +5,7 @@ import"../../index-8kzct1d6.js";
5
5
  import {
6
6
  composeAgentPrompt2,
7
7
  createAgentRuntime2
8
- } from "../../index-b9yqb9e7.js";
8
+ } from "../../index-ppf5nerp.js";
9
9
  import"../../index-qaet40b2.js";
10
10
  import"../../index-mnkk1ffz.js";
11
11
  import"../../index-fynr93w4.js";
@@ -16,7 +16,7 @@ import"../../index-jgwqc38k.js";
16
16
  import"../../index-z4ga1fa1.js";
17
17
  import"../../index-snef22zr.js";
18
18
  import"../../index-56yx8dxp.js";
19
- import"../../index-jna0ejsa.js";
19
+ import"../../index-fggxgbrk.js";
20
20
  import"../../index-5w6t91ze.js";
21
21
  import"../../index-2kbysk9s.js";
22
22
  import"../../index-b0w7rbpt.js";
@@ -1,10 +1,10 @@
1
- import"../../../index-jna0ejsa.js";
2
- import"../../../index-f2p949ax.js";
1
+ import"../../../index-fggxgbrk.js";
2
+ import"../../../index-yjnmac9b.js";
3
3
  import"../../../index-8kzct1d6.js";
4
4
  import {
5
5
  initializeAgentRuntimeSqlite2,
6
6
  createSqliteAgentRuntimeStore2
7
- } from "../../../index-c9vpsxw4.js";
7
+ } from "../../../index-gz9jf461.js";
8
8
  import"../../../index-kqnd6a85.js";
9
9
  import"../../../index-5w6t91ze.js";
10
10
  import"../../../index-dsxrcseb.js";
@@ -1,10 +1,10 @@
1
- import"../../../index-jna0ejsa.js";
2
- import"../../../index-f2p949ax.js";
1
+ import"../../../index-fggxgbrk.js";
2
+ import"../../../index-yjnmac9b.js";
3
3
  import"../../../index-8kzct1d6.js";
4
4
  import {
5
5
  initializeAgentRuntimeSqlite2,
6
6
  createSqliteAgentRuntimeStore2
7
- } from "../../../index-c9vpsxw4.js";
7
+ } from "../../../index-gz9jf461.js";
8
8
  import"../../../index-kqnd6a85.js";
9
9
  import"../../../index-5w6t91ze.js";
10
10
  import"../../../index-dsxrcseb.js";
@@ -8,10 +8,10 @@ import {
8
8
  decodeAgentConversationArchive2,
9
9
  createToolChronology,
10
10
  advanceToolChronology
11
- } from "../../index-jna0ejsa.js";
11
+ } from "../../index-fggxgbrk.js";
12
12
  import"../../index-5w6t91ze.js";
13
13
  import"../../index-dsxrcseb.js";
14
- import"../../index-f2p949ax.js";
14
+ import"../../index-yjnmac9b.js";
15
15
  import"../../index-ct75c3at.js";
16
16
  import"../../index-jgwqc38k.js";
17
17
  import"../../index-fynr93w4.js";
@@ -21,7 +21,7 @@ import"../../index-7r4knwf8.js";
21
21
  import"../../index-snef22zr.js";
22
22
  import {
23
23
  createMemoryAgentRuntimeStore2
24
- } from "../../index-kenvdagc.js";
24
+ } from "../../index-k0zfcxf5.js";
25
25
  import"../../index-zrtrjkbf.js";
26
26
  import {
27
27
  assertPositiveSafeInteger
@@ -1074,6 +1074,37 @@ async function seedScenario(store, conversationId) {
1074
1074
  const after = await store.loadSnapshot(conversationId);
1075
1075
  if (after.messages.some((message) => message.id === "seed-a" || message.id === "seed-b"))
1076
1076
  throw new Error("Seed conformance: compacted instructions resurrected");
1077
+ await settledExchangeScenario(store, conversationId);
1078
+ }
1079
+ async function settledExchangeScenario(store, conversationId) {
1080
+ const exchange = (key) => ({
1081
+ conversationId,
1082
+ seedKey: key,
1083
+ placement: "after-settled",
1084
+ inputs: [
1085
+ userMessage(conversationId, `${key}-user`),
1086
+ AgentMessageSchema2.parse({
1087
+ ...userMessage(conversationId, `${key}-assistant`),
1088
+ role: "assistant",
1089
+ status: "completed"
1090
+ })
1091
+ ]
1092
+ });
1093
+ const order = async () => (await store.loadSnapshot(conversationId)).messages.map((message) => message.id).join(",");
1094
+ requireOutcome(await store.seedConversationInput(exchange("tail")), "applied");
1095
+ if (await order() !== "seed-summary,tail-user,tail-assistant")
1096
+ throw new Error("Settled exchange conformance: an idle conversation did not append it");
1097
+ requireOutcome(await store.acceptInputAndAssignRun({
1098
+ idempotencyKey: "settled-exchange-run",
1099
+ input: userMessage(conversationId, "queued-input"),
1100
+ run: queuedRun(conversationId, "queued-input", "queued-run")
1101
+ }), "applied");
1102
+ await Promise.all([
1103
+ store.seedConversationInput(exchange("ahead")),
1104
+ store.seedConversationInput(exchange("ahead"))
1105
+ ]);
1106
+ if (await order() !== "seed-summary,tail-user,tail-assistant,ahead-user,ahead-assistant,queued-input")
1107
+ throw new Error("Settled exchange conformance: it must land once, ahead of the active run input");
1077
1108
  }
1078
1109
  async function conformanceScenario(store, conversationIds) {
1079
1110
  const [
@@ -58,7 +58,7 @@ import {
58
58
  AgentHistoryMutationSchema2,
59
59
  ACTIVE_AGENT_RUN_STATES2,
60
60
  createAgentRuntimeStore2
61
- } from "../index-f2p949ax.js";
61
+ } from "../index-yjnmac9b.js";
62
62
  import {
63
63
  AgentStoreEventKindSchema2,
64
64
  AgentStoreEventEnvelopeSchema2,
@@ -91,7 +91,7 @@ import {
91
91
  decodeAgentConversationArchive2,
92
92
  isAssistantHistoryEvidence2,
93
93
  isCompleteAgentHistoryTurn
94
- } from "../index-jna0ejsa.js";
94
+ } from "../index-fggxgbrk.js";
95
95
  import"../index-5w6t91ze.js";
96
96
  import {
97
97
  AgentRuntimeConflictError2,
@@ -123,7 +123,7 @@ import {
123
123
  agentGoalStateSlot2,
124
124
  agentTodoStateSlot2,
125
125
  createAgentRuntime2
126
- } from "../index-b9yqb9e7.js";
126
+ } from "../index-ppf5nerp.js";
127
127
  import {
128
128
  AgentConversationSummarySchema2,
129
129
  AgentConversationPageSchema2,
@@ -191,7 +191,7 @@ import"../index-84bf5spd.js";
191
191
  import"../index-7r4knwf8.js";
192
192
  import {
193
193
  createMemoryAgentRuntimeStore2
194
- } from "../index-kenvdagc.js";
194
+ } from "../index-k0zfcxf5.js";
195
195
  import {
196
196
  createAgentRuntimeEventSink2
197
197
  } from "../index-616xh7f2.js";
@@ -170,7 +170,8 @@ var ReplaceCompactedRangeSchema2 = z2.object({
170
170
  var SeedConversationInputSchema2 = z2.object({
171
171
  conversationId: AgentRecordIdSchema2,
172
172
  seedKey: z2.string().min(1),
173
- inputs: z2.array(AgentMessageSchema2).min(1)
173
+ inputs: z2.array(AgentMessageSchema2).min(1),
174
+ placement: z2.enum(["lead", "after-settled"]).optional()
174
175
  });
175
176
  var AgentRecoverableDescriptorSchema2 = z2.object({
176
177
  conversationId: AgentRecordIdSchema2,
@@ -5,7 +5,7 @@ import {
5
5
  AgentRecoverableDescriptorSchema2,
6
6
  AgentRecoverablePageSchema2,
7
7
  canonicalAgentJson2
8
- } from "./index-jna0ejsa.js";
8
+ } from "./index-fggxgbrk.js";
9
9
  import {
10
10
  AgentMessageSchema2,
11
11
  AgentRunSchema2
@@ -19,7 +19,7 @@ import {
19
19
  appendEventIn,
20
20
  ArchiveProjectionSchema,
21
21
  createAgentRuntimeStore2
22
- } from "./index-f2p949ax.js";
22
+ } from "./index-yjnmac9b.js";
23
23
  import {
24
24
  AgentConversationPageSchema2,
25
25
  AgentConversationMessagePageSchema2
@@ -656,7 +656,7 @@ var sqliteHistory = {
656
656
  },
657
657
  async apply(transaction, rawMutation) {
658
658
  const mutation = AgentHistoryMutationSchema2.parse(rawMutation);
659
- const message = mutation.type === "admit" ? mutation.input : mutation.type === "upsert-assistant" ? mutation.message : mutation.type === "seed" ? mutation.message : mutation.summary;
659
+ const message = mutation.type === "admit" ? mutation.input : mutation.type === "upsert-assistant" ? mutation.message : mutation.type === "seed" || mutation.type === "insert" ? mutation.message : mutation.summary;
660
660
  if (mutation.type === "seed") {
661
661
  transaction.prepare(`
662
662
  UPDATE stitchkit_agent_runtime_messages SET position = position + 1
@@ -700,6 +700,25 @@ var sqliteHistory = {
700
700
  SELECT position FROM stitchkit_agent_runtime_messages
701
701
  WHERE conversation_id = ? AND id = ?
702
702
  `).get(message.conversationId, message.id);
703
+ if (mutation.type === "insert" && missing(existing) && mutation.beforeMessageId) {
704
+ const anchor = transaction.prepare(`
705
+ SELECT position FROM stitchkit_agent_runtime_messages
706
+ WHERE conversation_id = ? AND id = ? AND active = 1
707
+ `).get(message.conversationId, mutation.beforeMessageId);
708
+ if (missing(anchor))
709
+ throw new Error("Insert anchor is not in the active history");
710
+ const { position } = PositionedMessageRowSchema.parse(anchor);
711
+ transaction.prepare(`
712
+ UPDATE stitchkit_agent_runtime_messages SET position = position + 1
713
+ WHERE conversation_id = ? AND position >= ?
714
+ `).run(message.conversationId, position);
715
+ transaction.prepare(`
716
+ INSERT INTO stitchkit_agent_runtime_messages
717
+ (conversation_id, id, position, active, payload)
718
+ VALUES (?, ?, ?, 1, ?)
719
+ `).run(message.conversationId, message.id, position, encodeJson(message));
720
+ return;
721
+ }
703
722
  if (!missing(existing)) {
704
723
  transaction.prepare(`
705
724
  UPDATE stitchkit_agent_runtime_messages SET payload = ?, active = 1
@@ -2,7 +2,7 @@ import {
2
2
  AgentStoreEventEnvelopeSchema2,
3
3
  AgentStoreEventPageSchema2,
4
4
  AgentRecoverablePageSchema2
5
- } from "./index-jna0ejsa.js";
5
+ } from "./index-fggxgbrk.js";
6
6
  import {
7
7
  AgentRecordIdSchema2,
8
8
  AgentMessageSchema2
@@ -17,7 +17,7 @@ import {
17
17
  replaceMessage,
18
18
  ArchiveSpillSchema,
19
19
  createAgentRuntimeStore2
20
- } from "./index-f2p949ax.js";
20
+ } from "./index-yjnmac9b.js";
21
21
 
22
22
  // src/agent-runtime/store-memory.ts
23
23
  import { z as z2 } from "zod";
@@ -208,8 +208,24 @@ var memoryHistory = {
208
208
  },
209
209
  async apply(transaction, rawMutation) {
210
210
  const mutation = AgentHistoryMutationSchema2.parse(rawMutation);
211
- const conversationId = mutation.type === "admit" ? mutation.input.conversationId : mutation.type === "upsert-assistant" ? mutation.message.conversationId : mutation.type === "seed" ? mutation.message.conversationId : mutation.summary.conversationId;
211
+ const conversationId = mutation.type === "admit" ? mutation.input.conversationId : mutation.type === "upsert-assistant" ? mutation.message.conversationId : mutation.type === "seed" || mutation.type === "insert" ? mutation.message.conversationId : mutation.summary.conversationId;
212
212
  const current = transaction.histories.get(conversationId) ?? [];
213
+ if (mutation.type === "insert") {
214
+ const existingIndex = current.findIndex((message) => message.id === mutation.message.id);
215
+ if (existingIndex !== -1) {
216
+ transaction.histories.set(conversationId, replaceMessage(current, mutation.message));
217
+ return;
218
+ }
219
+ const anchorIndex = mutation.beforeMessageId === undefined ? current.length : current.findIndex((message) => message.id === mutation.beforeMessageId);
220
+ if (anchorIndex === -1)
221
+ throw new Error("Insert anchor is not in the active history");
222
+ transaction.histories.set(conversationId, [
223
+ ...current.slice(0, anchorIndex),
224
+ mutation.message,
225
+ ...current.slice(anchorIndex)
226
+ ]);
227
+ return;
228
+ }
213
229
  if (mutation.type === "admit") {
214
230
  transaction.histories.set(conversationId, [...current, mutation.input]);
215
231
  return;
@@ -34,7 +34,7 @@ import {
34
34
  ProviderJournalMessageSchema,
35
35
  ProviderJournalRequestSchema,
36
36
  ProviderJournalResponseSchema
37
- } from "./index-jna0ejsa.js";
37
+ } from "./index-fggxgbrk.js";
38
38
  import {
39
39
  messageOf
40
40
  } from "./index-g149e9pk.js";
@@ -3214,7 +3214,7 @@ async function applyStreamPart(execution, scope, part) {
3214
3214
  }
3215
3215
 
3216
3216
  // src/agent-runtime/run-model-attempts.ts
3217
- function createStopConditions(execution) {
3217
+ function createStopConditions(execution, turn) {
3218
3218
  const { config, maxSteps } = execution.dependencies;
3219
3219
  const { state } = execution;
3220
3220
  const maxStepCondition = stepCountIs(maxSteps);
@@ -3228,7 +3228,7 @@ function createStopConditions(execution) {
3228
3228
  ];
3229
3229
  for (const policy of config.loop?.stopPolicies ?? []) {
3230
3230
  stopConditions.push(async (options) => {
3231
- const stopped = await policy.when(options);
3231
+ const stopped = await policy.when({ ...options, ...turn.runtimeContext });
3232
3232
  if (stopped && state.terminalPolicyName === undefined)
3233
3233
  state.terminalPolicyName = policy.name;
3234
3234
  return stopped;
@@ -3452,7 +3452,7 @@ async function consumeAttempt(context, attempt, stream) {
3452
3452
  async function runModelAttempts(execution, turn) {
3453
3453
  const { config, publish, now } = execution.dependencies;
3454
3454
  const { state } = execution;
3455
- const stopConditions = createStopConditions(execution);
3455
+ const stopConditions = createStopConditions(execution, turn);
3456
3456
  const loop = {
3457
3457
  retryAttempt: 1,
3458
3458
  takenThisAttempt: [],
@@ -39,7 +39,7 @@ import {
39
39
  ProviderJournalMessageSchema,
40
40
  ProviderJournalRequestSchema,
41
41
  ProviderJournalResponseSchema
42
- } from "./index-jna0ejsa.js";
42
+ } from "./index-fggxgbrk.js";
43
43
  import {
44
44
  StepEventPayloadSchema,
45
45
  ParkEventPayloadSchema,
@@ -154,6 +154,11 @@ var AgentHistoryMutationSchema2 = z3.discriminatedUnion("type", [
154
154
  z3.object({
155
155
  type: z3.literal("seed"),
156
156
  message: AgentMessageSchema2
157
+ }),
158
+ z3.object({
159
+ type: z3.literal("insert"),
160
+ message: AgentMessageSchema2,
161
+ beforeMessageId: AgentRecordIdSchema2.optional()
157
162
  })
158
163
  ]);
159
164
  var ACTIVE_AGENT_RUN_STATES2 = [
@@ -362,22 +367,51 @@ function reduceAccept(current, input) {
362
367
  historyMutations: [{ type: "admit", input: input.input }]
363
368
  });
364
369
  }
370
+ function seedReceipt(input) {
371
+ return AgentSeedReceiptSchema2.parse({
372
+ schemaVersion: 1,
373
+ conversationId: input.conversationId,
374
+ seedKey: input.seedKey,
375
+ messageIds: input.inputs.map((message) => message.id)
376
+ });
377
+ }
378
+ function reduceSettledSeed(current, input) {
379
+ for (const message of input.inputs) {
380
+ if (message.conversationId !== input.conversationId || message.runId !== undefined || !(message.role === "user" && message.status === "committed" || message.role === "assistant" && message.status === "completed")) {
381
+ throw new TypeError("A settled exchange must be committed user and completed assistant messages no run owns");
382
+ }
383
+ }
384
+ const activeMessageIds = new Set(current.runs.filter((run) => isActiveRunState(run.state)).flatMap((run) => [...run.inputMessageIds, run.assistantMessageId]));
385
+ const anchor = current.messages.find((message) => activeMessageIds.has(message.id));
386
+ const at = anchor ? current.messages.indexOf(anchor) : current.messages.length;
387
+ return applied(current, {
388
+ messages: [
389
+ ...current.messages.slice(0, at),
390
+ ...input.inputs,
391
+ ...current.messages.slice(at)
392
+ ]
393
+ }, {
394
+ seedReceipt: seedReceipt(input),
395
+ historyMutations: input.inputs.map((message) => ({
396
+ type: "insert",
397
+ message,
398
+ ...anchor && { beforeMessageId: anchor.id }
399
+ }))
400
+ });
401
+ }
365
402
  function reduceSeed(current, input) {
366
403
  const conversationId = input.conversationId;
367
404
  if (current.conversationId !== conversationId)
368
405
  return { outcome: "not_found" };
406
+ if (input.placement === "after-settled")
407
+ return reduceSettledSeed(current, input);
369
408
  for (const message of input.inputs) {
370
409
  if (message.conversationId !== conversationId || message.role !== "user" || message.status !== "committed" || message.runId !== undefined) {
371
410
  throw new TypeError("Seeded conversation input must be committed unowned user messages");
372
411
  }
373
412
  }
374
413
  return applied(current, { messages: [...input.inputs, ...current.messages] }, {
375
- seedReceipt: AgentSeedReceiptSchema2.parse({
376
- schemaVersion: 1,
377
- conversationId,
378
- seedKey: input.seedKey,
379
- messageIds: input.inputs.map((message) => message.id)
380
- }),
414
+ seedReceipt: seedReceipt(input),
381
415
  historyMutations: [...input.inputs].reverse().map((message) => ({
382
416
  type: "seed",
383
417
  message
@@ -256,6 +256,31 @@ implement the smaller `AgentRuntimeStoreDriver` rather than these eleven members
256
256
  calls this and nothing else, so an adapter that implements the interface has
257
257
  everything recovery needs
258
258
 
259
+ ### Writing history no run owns
260
+
261
+ `seedConversationInput` writes messages no run owns, exactly once per `seedKey`; the key is
262
+ recorded beside the history, so compaction or replacement of the messages never brings them
263
+ back. It places them by `placement`:
264
+
265
+ - absent or `'lead'` — committed user instructions ahead of the whole conversation;
266
+ - `'after-settled'` — an exchange that already happened without a model (a confirmed voice
267
+ command and its receipt): committed `user` and completed `assistant` messages. They land after
268
+ the settled history and ahead of the first message of any run still active, so an active run's
269
+ input and answer stay adjacent and the next run reads the exchange before the input queued
270
+ behind it. With no active run they are the tail.
271
+
272
+ ```ts
273
+ await store.seedConversationInput({
274
+ conversationId,
275
+ seedKey: `voice:${commandId}`,
276
+ placement: 'after-settled',
277
+ inputs: [ownerMessage, receiptMessage],
278
+ })
279
+ ```
280
+
281
+ The pair is ordinary history: it is in `loadSnapshot`, compaction may summarize it, and the next
282
+ provider request carries it. No model is called and no run is created.
283
+
259
284
  ### Reading a conversation
260
285
 
261
286
  Two shapes of read, and the difference matters as a conversation grows.
@@ -181,7 +181,7 @@ Server-only optional application runtime. See the
181
181
  | `selectCompactableHistory` | function | which oldest whole complete turns may be summarised away — the half of compaction that needs no store (→ ADR 0142) |
182
182
  | `SelectCompactableHistoryOptions` / `CompactableHistory` | _type_ | message list, retained-turn count and evidence policy in; `leadingSummary`, `compactable` and `retained` out |
183
183
  | `createAgentSessionCoordinator` | function | strict process-local queue/interrupt/supersede lifecycle |
184
- | `AgentRuntimeStopPolicy` | _type_ | named custom AI SDK stop condition persisted and published on policy stop |
184
+ | `AgentRuntimeStopPolicy` | _type_ | named stop rule persisted and published on policy stop; `when` receives the AI SDK `steps` plus the run context `prepareStep` gets (`context`, `run`, `signal`, `toolFenceLifecycle`, `contextUsage`) |
185
185
  | `AgentRuntimePrepareStep` | _type_ | per-run controlled step callback with typed domain context and managed run signal/fence |
186
186
  | `AgentContextOverflowError` | class | deliberate application budget refusal thrown from `loop.prepareStep`; terminalizes as `context_overflow` without classifying arbitrary error text |
187
187
  | `AgentRuntimeRecordIds` | _type_ | optional caller-provided input, run and assistant IDs for stable application records |
@@ -165,6 +165,12 @@ await ticket.accepted
165
165
  const terminal = await ticket.result
166
166
  ```
167
167
 
168
+ A stop policy's `when` receives the steps so far together with the same run context
169
+ `prepareStep` gets — `context`, `run`, `signal`, `toolFenceLifecycle` and `contextUsage` —
170
+ typed by the runtime's `CONTEXT`. A rule that depends on its own run (a receipt bound to the
171
+ run's request, a per-tenant limit) reads it there; it needs no map of its own keyed by `runId`.
172
+ The first policy to return `true` ends the run as `policy_stop` with its `name` as `policyName`.
173
+
168
174
  ## Bounded deferred tool catalogs
169
175
 
170
176
  Use `createDeferredAgentToolSurface` when a measured large catalog makes
@@ -85,12 +85,12 @@ own, recorded as an ADR.
85
85
  | `stitchkit/geo` | server (Bun or Node) | evolving | managed GeoIP reader generations, last-known-good reload and the optional MaxMind adapter |
86
86
  | `stitchkit/oauth` | browser **and** server | evolving | provider-neutral Authorization Code + PKCE request and one-shot callback transaction mechanics |
87
87
  | `stitchkit/google` | server (Bun or Node) | evolving | optional Google code exchange and verified OIDC identity adapter |
88
- | `stitchkit/observability` | server | stable<br>_redefined in 2 of the 57 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
88
+ | `stitchkit/observability` | server | stable<br>_redefined in 2 of the 58 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
89
89
  | `stitchkit/testing` | tests on Bun or Node | stable | in-process generated clients over a real Fetch handler, the managed-resource conformance kit and manual time for schedules and retries |
90
90
  | `stitchkit/declaration` | browser + build and deployment tooling (Bun or Node) | evolving | `ProjectDeclarationSchema` — the one machine-readable statement a repository makes about itself |
91
91
  | `stitchkit/react` | browser + server rendering | stable | `createCursorQuery`, `createCacheBridge`, QueryClient and `ApiError` retry policy |
92
92
  | `stitchkit/react/keyboard` | browser | evolving | which part of a screen gets a key — ordered layers, one Escape per level, list zones with real focus; see [keyboard guide](keyboard.md) |
93
- | `stitchkit/agent-runtime` | server | evolving<br>_redefined in 23 of the 57 minors since 0.56.2, most recently 0.105.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
93
+ | `stitchkit/agent-runtime` | server | evolving<br>_redefined in 24 of the 58 minors since 0.56.2, most recently 0.113.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
94
94
  | `stitchkit/agent-runtime/sandbox` | server | evolving | optional Linux Bubblewrap sessions, durable workspaces and a host HTTP credential gateway; see [sandbox guide](sandbox.md) |
95
95
  | `stitchkit/agent-runtime/testing` | tests on Bun or Node | evolving | credential-free replay, scripted provider faults, deterministic race controls and the agent-store conformance kit |
96
96
  | `stitchkit/agent-runtime/harness` | server | evolving | resource-aware process-local facade over the canonical Agent runtime; supervision stays outside |
@@ -102,7 +102,7 @@ own, recorded as an ADR.
102
102
  | `stitchkit/agent-runtime/sqlite/bun` | server (Bun) | evolving | durable built-in SQLite store for the agent runtime |
103
103
  | `stitchkit/agent-runtime/sqlite/node` | server (Node ≥ 22.5) | evolving | durable built-in SQLite store for the agent runtime |
104
104
  | `stitchkit-tui` | terminal (Bun) | evolving | optional official OpenTUI host over a caller-composed headless runtime |
105
- | `stitchkit/application` | browser + server | evolving<br>_redefined in 14 of the 57 minors since 0.56.2, most recently 0.110.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
105
+ | `stitchkit/application` | browser + server | evolving<br>_redefined in 14 of the 58 minors since 0.56.2, most recently 0.110.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
106
106
  | `stitchkit/application/grammy` | server | evolving | a grammY bot as application resources — configuration, then polling with updates admitted by batch — and the webhook adapter |
107
107
  | `stitchkit/application/opentelemetry` | server | evolving | maps application snapshots onto an injected OpenTelemetry `Meter` |
108
108
  | `stitchkit/application/schemas` | browser + server | evolving | the application's snapshot, health and shutdown schemas alone, without the kernel |
@@ -1,14 +1,33 @@
1
- # Upgrading 0.103.0 → 0.112.0 — stitchkit docs slice
1
+ # Upgrading 0.103.13 → 0.113.0 — stitchkit docs slice
2
2
 
3
3
  > Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
4
4
  > `llms.txt` in this package.
5
5
 
6
- Contains: Guide: Upgrading, 0.103.0 → 0.112.0 (docs/guide/upgrading.md)
6
+ Contains: Guide: Upgrading, 0.103.13 → 0.113.0 (docs/guide/upgrading.md)
7
7
 
8
8
  ==============================================================================
9
- # Guide: Upgrading, 0.103.0 → 0.112.0 (docs/guide/upgrading.md)
9
+ # Guide: Upgrading, 0.103.13 → 0.113.0 (docs/guide/upgrading.md)
10
10
  ==============================================================================
11
11
 
12
+ ## Released migration: 0.113.0
13
+
14
+ **Who must act:** custom `AgentRuntimeStoreDriver` adapters and custom `AgentRuntimeStore` implementations of `seedConversationInput`. The built-in memory and SQLite stores already implement the contract.
15
+
16
+ `seedConversationInput({ placement: 'after-settled' })` emits one `insert` history mutation per message. A driver's `history.apply` places the message ahead of the active row named `beforeMessageId`, or at the end when it is absent, and replaces a message already present in place:
17
+
18
+ ```ts
19
+ // after: one more branch in history.apply
20
+ if (mutation.type === 'insert') {
21
+ if (await exists(mutation.message.id)) return replaceInPlace(mutation.message)
22
+ if (mutation.beforeMessageId === undefined) return appendAtEnd(mutation.message)
23
+ const anchor = await activePosition(mutation.beforeMessageId) // refuse when missing
24
+ await shiftPositionsFrom(anchor) // every row at or after it moves one down
25
+ return insertAt(anchor, mutation.message)
26
+ }
27
+ ```
28
+
29
+ A custom `AgentRuntimeStore` that implements `seedConversationInput` itself places `'after-settled'` messages after the settled history and ahead of the first message of any active run, and keeps `'lead'` (or an absent `placement`) as before. Run `runAgentStoreConformance` against the adapter; `examples/agent-store-prisma/adapter.ts` shows the Prisma form.
30
+
12
31
  ## Released migration: 0.112.0
13
32
 
14
33
  **Who must act:** scripts using an array option together with bare positional arguments without a declared `positionals` policy, including calls to `parseCliArgs`.
@@ -876,32 +895,3 @@ mytool deploy --profile "${PROFILE:-production}" "$@"
876
895
 
877
896
  Dotted leaves such as `--filter.name` follow the same rule as their parent field. Declare a
878
897
  field as an array when repetition is meant.
879
-
880
- ## Released migration: 0.103.0
881
-
882
- ### Diagnostic journal startup preserves torn evidence and inspects archives
883
-
884
- **Who must act:** operators using `maxFiles: 1` who can encounter a torn active
885
- file, or whose retained files are unreadable by the writer. Clean single-file
886
- journals continue to work; successful startup now requires read access to every
887
- retained generation.
888
-
889
- ```ts
890
- import { createDiagnosticJournal } from 'stitchkit/application/diagnostic-journal'
891
-
892
- // Before: a torn active file could be discarded during startup.
893
- await createDiagnosticJournal({ ...config, limits: { ...config.limits, maxFiles: 1 } })
894
- // After: retain the torn file while the fresh writer starts in a new active file.
895
- await createDiagnosticJournal({ ...config, limits: { ...config.limits, maxFiles: 2 } })
896
- ```
897
-
898
- With single-file retention, a torn active file throws `DiagnosticJournalRecoveryError`
899
- from `stitchkit/application`, carrying `recovery` observations and releasing its lock
900
- without deleting evidence. Inspection I/O errors also fail startup and release the
901
- lock; restore filesystem access rather than treating that failure as a bad JSON row.
902
- Normal rotation retains the configured finite eviction policy.
903
-
904
- For archive inspection, replace ad hoc line parsing with `readDiagnosticJournal`
905
- from the same filesystem leaf. Handle its `frame | anomaly` stream explicitly;
906
- missing files, permissions and unsafe paths still throw. See the
907
- [journal guide](application-kernel.md#bounded-local-diagnostic-journal).
@@ -1,14 +1,43 @@
1
- # Upgrading 0.75.0 → 0.102.0 — stitchkit docs slice
1
+ # Upgrading 0.75.0 → 0.103.0 — stitchkit docs slice
2
2
 
3
3
  > Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
4
4
  > `llms.txt` in this package.
5
5
 
6
- Contains: Guide: Upgrading, 0.75.0 → 0.102.0 (docs/guide/upgrading.md)
6
+ Contains: Guide: Upgrading, 0.75.0 → 0.103.0 (docs/guide/upgrading.md)
7
7
 
8
8
  ==============================================================================
9
- # Guide: Upgrading, 0.75.0 → 0.102.0 (docs/guide/upgrading.md)
9
+ # Guide: Upgrading, 0.75.0 → 0.103.0 (docs/guide/upgrading.md)
10
10
  ==============================================================================
11
11
 
12
+ ## Released migration: 0.103.0
13
+
14
+ ### Diagnostic journal startup preserves torn evidence and inspects archives
15
+
16
+ **Who must act:** operators using `maxFiles: 1` who can encounter a torn active
17
+ file, or whose retained files are unreadable by the writer. Clean single-file
18
+ journals continue to work; successful startup now requires read access to every
19
+ retained generation.
20
+
21
+ ```ts
22
+ import { createDiagnosticJournal } from 'stitchkit/application/diagnostic-journal'
23
+
24
+ // Before: a torn active file could be discarded during startup.
25
+ await createDiagnosticJournal({ ...config, limits: { ...config.limits, maxFiles: 1 } })
26
+ // After: retain the torn file while the fresh writer starts in a new active file.
27
+ await createDiagnosticJournal({ ...config, limits: { ...config.limits, maxFiles: 2 } })
28
+ ```
29
+
30
+ With single-file retention, a torn active file throws `DiagnosticJournalRecoveryError`
31
+ from `stitchkit/application`, carrying `recovery` observations and releasing its lock
32
+ without deleting evidence. Inspection I/O errors also fail startup and release the
33
+ lock; restore filesystem access rather than treating that failure as a bad JSON row.
34
+ Normal rotation retains the configured finite eviction policy.
35
+
36
+ For archive inspection, replace ad hoc line parsing with `readDiagnosticJournal`
37
+ from the same filesystem leaf. Handle its `frame | anomaly` stream explicitly;
38
+ missing files, permissions and unsafe paths still throw. See the
39
+ [journal guide](application-kernel.md#bounded-local-diagnostic-journal).
40
+
12
41
  ## Released migration: 0.102.0
13
42
 
14
43
  ### `view_file` receives an array, not an array encoded as text
@@ -11,8 +11,8 @@ Contains: Guide: Upgrading, general (docs/guide/upgrading.md)
11
11
 
12
12
  Load this slice, then every range slice between your installed version and the target:
13
13
 
14
- - 0.103.0 → 0.112.0: `llms/upgrading-0.103.0-0.112.0.txt`
15
- - 0.75.0 → 0.102.0: `llms/upgrading-0.75.0-0.102.0.txt`
14
+ - 0.103.13 → 0.113.0: `llms/upgrading-0.103.13-0.113.0.txt`
15
+ - 0.75.0 → 0.103.0: `llms/upgrading-0.75.0-0.103.0.txt`
16
16
  - 0.61.0 → 0.74.0: `llms/upgrading-0.61.0-0.74.0.txt`
17
17
  - 0.44.0 → 0.60.0: `llms/upgrading-0.44.0-0.60.0.txt`
18
18
  - 0.37.0 → 0.37.0: `llms/upgrading-0.37.0.txt`
package/llms-full.txt CHANGED
@@ -77,12 +77,12 @@ own, recorded as an ADR.
77
77
  | `stitchkit/geo` | server (Bun or Node) | evolving | managed GeoIP reader generations, last-known-good reload and the optional MaxMind adapter |
78
78
  | `stitchkit/oauth` | browser **and** server | evolving | provider-neutral Authorization Code + PKCE request and one-shot callback transaction mechanics |
79
79
  | `stitchkit/google` | server (Bun or Node) | evolving | optional Google code exchange and verified OIDC identity adapter |
80
- | `stitchkit/observability` | server | stable<br>_redefined in 2 of the 57 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
80
+ | `stitchkit/observability` | server | stable<br>_redefined in 2 of the 58 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
81
81
  | `stitchkit/testing` | tests on Bun or Node | stable | in-process generated clients over a real Fetch handler, the managed-resource conformance kit and manual time for schedules and retries |
82
82
  | `stitchkit/declaration` | browser + build and deployment tooling (Bun or Node) | evolving | `ProjectDeclarationSchema` — the one machine-readable statement a repository makes about itself |
83
83
  | `stitchkit/react` | browser + server rendering | stable | `createCursorQuery`, `createCacheBridge`, QueryClient and `ApiError` retry policy |
84
84
  | `stitchkit/react/keyboard` | browser | evolving | which part of a screen gets a key — ordered layers, one Escape per level, list zones with real focus; see [keyboard guide](keyboard.md) |
85
- | `stitchkit/agent-runtime` | server | evolving<br>_redefined in 23 of the 57 minors since 0.56.2, most recently 0.105.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
85
+ | `stitchkit/agent-runtime` | server | evolving<br>_redefined in 24 of the 58 minors since 0.56.2, most recently 0.113.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
86
86
  | `stitchkit/agent-runtime/sandbox` | server | evolving | optional Linux Bubblewrap sessions, durable workspaces and a host HTTP credential gateway; see [sandbox guide](sandbox.md) |
87
87
  | `stitchkit/agent-runtime/testing` | tests on Bun or Node | evolving | credential-free replay, scripted provider faults, deterministic race controls and the agent-store conformance kit |
88
88
  | `stitchkit/agent-runtime/harness` | server | evolving | resource-aware process-local facade over the canonical Agent runtime; supervision stays outside |
@@ -94,7 +94,7 @@ own, recorded as an ADR.
94
94
  | `stitchkit/agent-runtime/sqlite/bun` | server (Bun) | evolving | durable built-in SQLite store for the agent runtime |
95
95
  | `stitchkit/agent-runtime/sqlite/node` | server (Node ≥ 22.5) | evolving | durable built-in SQLite store for the agent runtime |
96
96
  | `stitchkit-tui` | terminal (Bun) | evolving | optional official OpenTUI host over a caller-composed headless runtime |
97
- | `stitchkit/application` | browser + server | evolving<br>_redefined in 14 of the 57 minors since 0.56.2, most recently 0.110.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
97
+ | `stitchkit/application` | browser + server | evolving<br>_redefined in 14 of the 58 minors since 0.56.2, most recently 0.110.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
98
98
  | `stitchkit/application/grammy` | server | evolving | a grammY bot as application resources — configuration, then polling with updates admitted by batch — and the webhook adapter |
99
99
  | `stitchkit/application/opentelemetry` | server | evolving | maps application snapshots onto an injected OpenTelemetry `Meter` |
100
100
  | `stitchkit/application/schemas` | browser + server | evolving | the application's snapshot, health and shutdown schemas alone, without the kernel |
@@ -5518,6 +5518,12 @@ await ticket.accepted
5518
5518
  const terminal = await ticket.result
5519
5519
  ```
5520
5520
 
5521
+ A stop policy's `when` receives the steps so far together with the same run context
5522
+ `prepareStep` gets — `context`, `run`, `signal`, `toolFenceLifecycle` and `contextUsage` —
5523
+ typed by the runtime's `CONTEXT`. A rule that depends on its own run (a receipt bound to the
5524
+ run's request, a per-tenant limit) reads it there; it needs no map of its own keyed by `runId`.
5525
+ The first policy to return `true` ends the run as `policy_stop` with its `name` as `policyName`.
5526
+
5521
5527
  ## Bounded deferred tool catalogs
5522
5528
 
5523
5529
  Use `createDeferredAgentToolSurface` when a measured large catalog makes
@@ -6365,6 +6371,31 @@ implement the smaller `AgentRuntimeStoreDriver` rather than these eleven members
6365
6371
  calls this and nothing else, so an adapter that implements the interface has
6366
6372
  everything recovery needs
6367
6373
 
6374
+ ### Writing history no run owns
6375
+
6376
+ `seedConversationInput` writes messages no run owns, exactly once per `seedKey`; the key is
6377
+ recorded beside the history, so compaction or replacement of the messages never brings them
6378
+ back. It places them by `placement`:
6379
+
6380
+ - absent or `'lead'` — committed user instructions ahead of the whole conversation;
6381
+ - `'after-settled'` — an exchange that already happened without a model (a confirmed voice
6382
+ command and its receipt): committed `user` and completed `assistant` messages. They land after
6383
+ the settled history and ahead of the first message of any run still active, so an active run's
6384
+ input and answer stay adjacent and the next run reads the exchange before the input queued
6385
+ behind it. With no active run they are the tail.
6386
+
6387
+ ```ts
6388
+ await store.seedConversationInput({
6389
+ conversationId,
6390
+ seedKey: `voice:${commandId}`,
6391
+ placement: 'after-settled',
6392
+ inputs: [ownerMessage, receiptMessage],
6393
+ })
6394
+ ```
6395
+
6396
+ The pair is ordinary history: it is in `loadSnapshot`, compaction may summarize it, and the next
6397
+ provider request carries it. No model is called and no run is created.
6398
+
6368
6399
  ### Reading a conversation
6369
6400
 
6370
6401
  Two shapes of read, and the difference matters as a conversation grows.
@@ -16276,6 +16307,25 @@ analytics policy belong to the application.
16276
16307
 
16277
16308
  # Upgrading stitchkit
16278
16309
 
16310
+ ## Released migration: 0.113.0
16311
+
16312
+ **Who must act:** custom `AgentRuntimeStoreDriver` adapters and custom `AgentRuntimeStore` implementations of `seedConversationInput`. The built-in memory and SQLite stores already implement the contract.
16313
+
16314
+ `seedConversationInput({ placement: 'after-settled' })` emits one `insert` history mutation per message. A driver's `history.apply` places the message ahead of the active row named `beforeMessageId`, or at the end when it is absent, and replaces a message already present in place:
16315
+
16316
+ ```ts
16317
+ // after: one more branch in history.apply
16318
+ if (mutation.type === 'insert') {
16319
+ if (await exists(mutation.message.id)) return replaceInPlace(mutation.message)
16320
+ if (mutation.beforeMessageId === undefined) return appendAtEnd(mutation.message)
16321
+ const anchor = await activePosition(mutation.beforeMessageId) // refuse when missing
16322
+ await shiftPositionsFrom(anchor) // every row at or after it moves one down
16323
+ return insertAt(anchor, mutation.message)
16324
+ }
16325
+ ```
16326
+
16327
+ A custom `AgentRuntimeStore` that implements `seedConversationInput` itself places `'after-settled'` messages after the settled history and ahead of the first message of any active run, and keeps `'lead'` (or an absent `placement`) as before. Run `runAgentStoreConformance` against the adapter; `examples/agent-store-prisma/adapter.ts` shows the Prisma form.
16328
+
16279
16329
  ## Released migration: 0.112.0
16280
16330
 
16281
16331
  **Who must act:** scripts using an array option together with bare positional arguments without a declared `positionals` policy, including calls to `parseCliArgs`.
@@ -22193,7 +22243,7 @@ Server-only optional application runtime. See the
22193
22243
  | `selectCompactableHistory` | function | which oldest whole complete turns may be summarised away — the half of compaction that needs no store (→ ADR 0142) |
22194
22244
  | `SelectCompactableHistoryOptions` / `CompactableHistory` | _type_ | message list, retained-turn count and evidence policy in; `leadingSummary`, `compactable` and `retained` out |
22195
22245
  | `createAgentSessionCoordinator` | function | strict process-local queue/interrupt/supersede lifecycle |
22196
- | `AgentRuntimeStopPolicy` | _type_ | named custom AI SDK stop condition persisted and published on policy stop |
22246
+ | `AgentRuntimeStopPolicy` | _type_ | named stop rule persisted and published on policy stop; `when` receives the AI SDK `steps` plus the run context `prepareStep` gets (`context`, `run`, `signal`, `toolFenceLifecycle`, `contextUsage`) |
22197
22247
  | `AgentRuntimePrepareStep` | _type_ | per-run controlled step callback with typed domain context and managed run signal/fence |
22198
22248
  | `AgentContextOverflowError` | class | deliberate application budget refusal thrown from `loop.prepareStep`; terminalizes as `context_overflow` without classifying arbitrary error text |
22199
22249
  | `AgentRuntimeRecordIds` | _type_ | optional caller-provided input, run and assistant IDs for stable application records |
package/llms.txt CHANGED
@@ -25,7 +25,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
25
25
  - **stitchkit/primitives**: [llms/primitives.txt](llms/primitives.txt) 11.7 KB
26
26
  - **stitchkit/server**: [llms/server.txt](llms/server.txt) 44.2 KB → [llms/server.2.txt](llms/server.2.txt) 20.5 KB → [llms/server.3.txt](llms/server.3.txt) 45.6 KB → [llms/server.4.txt](llms/server.4.txt) 38.3 KB → [llms/server.5.txt](llms/server.5.txt) 22.9 KB
27
27
  - **stitchkit/observability**: [llms/observability.txt](llms/observability.txt) 46.9 KB
28
- - **stitchkit/agent-runtime**: [llms/agent-runtime.txt](llms/agent-runtime.txt) 42.7 KB → [llms/agent-runtime.2.txt](llms/agent-runtime.2.txt) 44.8 KB → [llms/agent-runtime.3.txt](llms/agent-runtime.3.txt) 42.1 KB
28
+ - **stitchkit/agent-runtime**: [llms/agent-runtime.txt](llms/agent-runtime.txt) 43.2 KB → [llms/agent-runtime.2.txt](llms/agent-runtime.2.txt) 45.9 KB → [llms/agent-runtime.3.txt](llms/agent-runtime.3.txt) 42.2 KB
29
29
  - **stitchkit/agent-runtime/testing**: [llms/agent-runtime-testing.txt](llms/agent-runtime-testing.txt) 2.6 KB
30
30
  - **stitchkit/agent-runtime/harness**: [llms/agent-runtime-harness.txt](llms/agent-runtime-harness.txt) 11.0 KB
31
31
  - **stitchkit/agent-runtime/coding-tools**: [llms/agent-runtime-coding-tools.txt](llms/agent-runtime-coding-tools.txt) 5.0 KB
@@ -64,8 +64,8 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
64
64
 
65
65
  ## Upgrading slices
66
66
  - **Upgrading — how to move across versions**: [llms/upgrading.txt](llms/upgrading.txt) 12.7 KB
67
- - **Upgrading 0.103.0 → 0.112.0**: [llms/upgrading-0.103.0-0.112.0.txt](llms/upgrading-0.103.0-0.112.0.txt) 46.6 KB
68
- - **Upgrading 0.75.0 → 0.102.0**: [llms/upgrading-0.75.0-0.102.0.txt](llms/upgrading-0.75.0-0.102.0.txt) 44.8 KB
67
+ - **Upgrading 0.103.13 → 0.113.0**: [llms/upgrading-0.103.13-0.113.0.txt](llms/upgrading-0.103.13-0.113.0.txt) 46.4 KB
68
+ - **Upgrading 0.75.0 → 0.103.0**: [llms/upgrading-0.75.0-0.103.0.txt](llms/upgrading-0.75.0-0.103.0.txt) 46.3 KB
69
69
  - **Upgrading 0.61.0 → 0.74.0**: [llms/upgrading-0.61.0-0.74.0.txt](llms/upgrading-0.61.0-0.74.0.txt) 43.5 KB
70
70
  - **Upgrading 0.44.0 → 0.60.0**: [llms/upgrading-0.44.0-0.60.0.txt](llms/upgrading-0.44.0-0.60.0.txt) 43.9 KB
71
71
  - **Upgrading 0.37.0 → 0.37.0**: [llms/upgrading-0.37.0.txt](llms/upgrading-0.37.0.txt) 6.2 KB
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.112.3",
3
+ "version": "0.113.0",
4
4
  "description": "Contract-first backend framework — one defineContract() into an HTTP API, MCP tools, AI-agent tools and a typed client. Bun and Node.",
5
5
  "keywords": [
6
6
  "bun",