stitchkit 0.106.0 → 0.107.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 +65 -0
- package/darwin-native.cjs +16 -4
- package/dist/agent-runtime/deferred-tool-types.d.ts +6 -27
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/browser.js +2 -3
- package/dist/entrypoints/agent-runtime/coding-tools.js +6 -8
- package/dist/entrypoints/agent-runtime/harness.js +7 -11
- package/dist/entrypoints/agent-runtime/realtime.js +2 -3
- package/dist/entrypoints/agent-runtime/sandbox.js +6 -8
- package/dist/entrypoints/agent-runtime.d.ts +2 -1
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime.js +20 -23
- package/dist/entrypoints/application/diagnostic-journal.js +3 -3
- package/dist/entrypoints/application/directory-inbox.js +8 -9
- package/dist/entrypoints/application/grammy.js +3 -3
- package/dist/entrypoints/application.js +7 -8
- package/dist/entrypoints/cli/publish.js +10 -11
- package/dist/entrypoints/cli.js +12 -16
- package/dist/entrypoints/contract.js +1 -1
- package/dist/entrypoints/files/packaging.d.ts +1 -1
- package/dist/entrypoints/files/packaging.d.ts.map +1 -1
- package/dist/entrypoints/files/packaging.js +99 -47
- package/dist/entrypoints/files.js +16 -16
- package/dist/entrypoints/index.js +41 -41
- package/dist/entrypoints/node.js +27 -29
- package/dist/entrypoints/observability.js +10 -12
- package/dist/entrypoints/process.js +2 -2
- package/dist/entrypoints/react.js +3 -4
- package/dist/entrypoints/remote.js +8 -9
- package/dist/entrypoints/server.js +48 -51
- package/dist/entrypoints/telegram/html.js +3 -3
- package/dist/entrypoints/telegram/screens.js +5 -5
- package/dist/entrypoints/telegram.js +9 -10
- package/dist/entrypoints/testing.js +8 -11
- package/dist/entrypoints/tools/connections.js +11 -11
- package/dist/entrypoints/tools/invoker.js +5 -9
- package/dist/entrypoints/tools/mcp.js +8 -14
- package/dist/entrypoints/tools.js +19 -25
- package/dist/entrypoints/tracking.js +3 -3
- package/dist/files/native-packaging-layout.d.ts +6 -2
- package/dist/files/native-packaging-layout.d.ts.map +1 -1
- package/dist/files/native-packaging.d.ts +45 -10
- package/dist/files/native-packaging.d.ts.map +1 -1
- package/dist/{index-v5ee8ath.js → index-1h2zv8rx.js} +10 -40
- package/dist/index-2kbysk9s.js +42 -0
- package/dist/{index-wbhdzxar.js → index-2s6fpehp.js} +5 -5
- package/dist/{index-4vsby8n8.js → index-4f37d3bg.js} +1 -1
- package/dist/{index-ksfagmyz.js → index-4qh90tyw.js} +8 -8
- package/dist/{index-yvfk3y36.js → index-636mggad.js} +4 -3
- package/dist/{index-f199nfq5.js → index-6y9t2fwz.js} +7 -7
- package/dist/{index-azx12jgv.js → index-7r74re56.js} +1 -1
- package/dist/{index-w8etpm8j.js → index-9j2atjte.js} +1 -1
- package/dist/{index-dsnjzb62.js → index-bnf8s6v3.js} +1 -1
- package/dist/{index-pz3y6b6g.js → index-cx2nh595.js} +3 -3
- package/dist/{index-2k91mewf.js → index-dm2fv45z.js} +9 -9
- package/dist/{index-9bskshe3.js → index-dwf0gymy.js} +10 -10
- package/dist/{index-qaqbdm7s.js → index-h7qms8f9.js} +8 -8
- package/dist/{index-drs41arz.js → index-ktjmgq9p.js} +1 -1
- package/dist/{index-1ptj98e0.js → index-mbf4h8kp.js} +2 -2
- package/dist/{index-916yh4e2.js → index-mep4sb48.js} +14 -14
- package/dist/{index-wdy68sh6.js → index-njs9gvrh.js} +17 -17
- package/dist/{index-sj28htvf.js → index-pvh3z03x.js} +1 -1
- package/dist/{index-r393tnfp.js → index-q6crhe1n.js} +4 -4
- package/dist/{index-z23rfxhj.js → index-xmgjtkvr.js} +1 -1
- package/dist/{index-gr5g3xfw.js → index-yz8x0hbx.js} +1 -1
- package/dist/{index-gxm9rc97.js → index-zrtrjkbf.js} +1 -1
- package/dist/{index-1pwwan01.js → index-zsqt5q98.js} +5 -5
- package/dist/internal/darwin-binding-error.d.ts +9 -1
- package/dist/internal/darwin-binding-error.d.ts.map +1 -1
- package/dist/internal/darwin-binding.d.ts.map +1 -1
- package/dist/process/contract.d.ts +4 -2
- package/dist/process/contract.d.ts.map +1 -1
- package/dist/tools/internal/surface-projector.d.ts +0 -7
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/runtime-tool-declaration.d.ts +11 -0
- package/dist/tools/runtime-tool-declaration.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +2 -3
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/llms/files-packaging.txt +10 -6
- package/llms/process.txt +64 -20
- package/llms/stitchkit.txt +3 -3
- package/llms/{upgrading-0.37.0-0.53.0.txt → upgrading-0.37.0-0.58.0.txt} +209 -3
- package/llms/{upgrading-0.55.0-0.68.0.txt → upgrading-0.59.0-0.71.0.txt} +149 -209
- package/llms/{upgrading-0.69.0-0.95.0.txt → upgrading-0.72.0-0.97.0.txt} +76 -149
- package/llms/{upgrading-0.96.0-0.106.0.txt → upgrading-0.98.0-0.107.0.txt} +56 -83
- package/llms/upgrading.txt +4 -4
- package/llms-full.txt +130 -36
- package/llms.txt +6 -6
- package/package.json +4 -3
- package/dist/{index-cazts87s.js → index-07dcf2yn.js} +3 -3
- package/dist/{index-n1nszyk0.js → index-7jvwrjqa.js} +3 -3
- package/dist/{index-cmzvhhtd.js → index-85qve8mq.js} +3 -3
- package/dist/{index-rpzewktb.js → index-fynr93w4.js} +3 -3
- package/dist/{index-37asdw3a.js → index-k7qdkh3n.js} +3 -3
- package/dist/{index-x7w1z6pf.js → index-q4hjtyye.js} +4 -4
- package/dist/{index-7n68nmc6.js → index-y3nemndz.js} +3 -3
- package/dist/{index-12zsej7b.js → index-y70v24cw.js} +3 -3
- package/dist/{index-pzb63z66.js → index-ykdcnq1f.js} +3 -3
|
@@ -183,8 +183,10 @@ declare const NativeCommandLimitReasonSchema: z.ZodEnum<{
|
|
|
183
183
|
}>;
|
|
184
184
|
/**
|
|
185
185
|
* Thrown by `runNativeCommand`; `code` is `COMMAND_LIMIT` (see `reason`),
|
|
186
|
-
* `COMMAND_UNAVAILABLE` (could not start) or `COMMAND_CLEANUP` (
|
|
187
|
-
* `cleanupTimeoutMs`
|
|
186
|
+
* `COMMAND_UNAVAILABLE` (could not start) or `COMMAND_CLEANUP` (the command's resources were not
|
|
187
|
+
* proven closed): handles stayed open past `cleanupTimeoutMs` after a stop, or the output pipes
|
|
188
|
+
* stayed open past `drainTimeoutMs` after the leader exited. `cause` holds the failure of the
|
|
189
|
+
* bound that tripped.
|
|
188
190
|
*/
|
|
189
191
|
export declare class NativeCommandError extends Error {
|
|
190
192
|
readonly code: 'COMMAND_LIMIT' | 'COMMAND_UNAVAILABLE' | 'COMMAND_CLEANUP';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/process/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,QAAA,MAAM,6BAA6B;;;;;;;;;;;;2BAajC,CAAC;AACH;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF;;GAEG;AACH,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,gGAAgG;AAChG,eAAO,MAAM,yBAAyB,UAAY,CAAC;AAEnD,QAAA,MAAM,6BAA6B;;;;;;;;;;;;;;;kBAOjC,CAAC;AACH;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAiC3F,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;gDAqBpB,UAAU,WACR,QAAQ,GAAG,QAAQ,UACp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,qBAAqB,GAAG,iBAAiB,EACjE,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,YAAY,GAAG;QAAE,MAAM,CAAC,EAAE,KAAK,CAAA;KAAE,EAC3C;CAgBH"}
|
|
@@ -23,13 +23,6 @@ export interface SurfaceRuntimeToolDefinition {
|
|
|
23
23
|
ui?: EndpointUiMeta;
|
|
24
24
|
mcp?: EndpointMcpPolicy;
|
|
25
25
|
}
|
|
26
|
-
/** Peer-free executable shape accepted by Agent-only composition entrypoints. */
|
|
27
|
-
export interface SurfaceAgentRuntimeToolDefinition extends SurfaceRuntimeToolDefinition {
|
|
28
|
-
handler: unknown;
|
|
29
|
-
present?: {
|
|
30
|
-
agent?: unknown;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
26
|
/** One peer-free structural extension shared by executable mounts and projections. */
|
|
34
27
|
export interface SurfaceToolExtension<TContext extends Record<string, unknown> = Record<string, unknown>> {
|
|
35
28
|
schema: Record<string, ZodType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface-projector.d.ts","sourceRoot":"","sources":["../../../src/tools/internal/surface-projector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAK,MAAM,KAAK,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACf,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAUhE;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE;QACR,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,UAAU,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,CAAC;IACF,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACtC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,EAAE,CAAC,EAAE,cAAc,CAAC;IACpB,GAAG,CAAC,EAAE,iBAAiB,CAAC;CACzB;AAED,
|
|
1
|
+
{"version":3,"file":"surface-projector.d.ts","sourceRoot":"","sources":["../../../src/tools/internal/surface-projector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAK,MAAM,KAAK,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACf,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAUhE;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE;QACR,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,UAAU,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,CAAC;IACF,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAA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,GAC1C,wBAAwB,CAAC,KAAK,CAAC,EAAE,CA8GnC"}
|
|
@@ -84,5 +84,16 @@ export type RuntimeToolDefinition = (Omit<RuntimeToolDefinitionWithOutput<ZodObj
|
|
|
84
84
|
}) | (Omit<RuntimeToolDefinitionWithoutOutput<ZodObject, EndpointMcpPolicy | undefined>, 'handler'> & {
|
|
85
85
|
handler(context: RegisteredHandlerContext): void | Promise<void>;
|
|
86
86
|
});
|
|
87
|
+
/**
|
|
88
|
+
* The peer-free executable shape the Agent-only entrypoints accept (the deferred catalog,
|
|
89
|
+
* `executableAgentRuntimeTools`). `present` is open like `RuntimeToolDefinition`'s, so a
|
|
90
|
+
* registered list is a catalog without a cast; construction validates the Agent presenter
|
|
91
|
+
* (a function, with an `output` schema).
|
|
92
|
+
*/
|
|
93
|
+
export interface DeferredAgentRuntimeToolDefinition extends RuntimeToolDefinitionBase<ZodObject, EndpointMcpPolicy | undefined> {
|
|
94
|
+
output?: ZodType;
|
|
95
|
+
handler: unknown;
|
|
96
|
+
present?: unknown;
|
|
97
|
+
}
|
|
87
98
|
export {};
|
|
88
99
|
//# sourceMappingURL=runtime-tool-declaration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-tool-declaration.d.ts","sourceRoot":"","sources":["../../src/tools/runtime-tool-declaration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,W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ACpB;AAED;;;GAGG;AACH,MAAM,WAAW,kCAAkC,CACjD,MAAM,SAAS,SAAS,EACxB,IAAI,SAAS,iBAAiB,GAAG,SAAS,GAAG,SAAS,CACtD,SAAQ,yBAAyB,CAAC,MAAM,EAAE,IAAI,CAAC;IAC/C,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,EAAE,CAAC,OAAO,EAAE,yBAAyB,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpF,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED;;GAEG;AACH,KAAK,wBAAwB,GAAG,yBAAyB,CACvD,SAAS,EACT,iBAAiB,GAAG,SAAS,CAC9B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,qBAAqB,GAC7B,CAAC,IAAI,CACH,+BAA+B,CAC7B,SAAS,EACT,OAAO,EACP,iBAAiB,GAAG,SAAS,EAC7B,OAAO,CACR,EACD,SAAS,CACV,GAAG;IACF,OAAO,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC;CACrD,CAAC,GACF,CAAC,IAAI,CACH,kCAAkC,CAAC,SAAS,EAAE,iBAAiB,GAAG,SAAS,CAAC,EAC5E,SAAS,CACV,GAAG;IACF,OAAO,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"runtime-tool-declaration.d.ts","sourceRoot":"","sources":["../../src/tools/runtime-tool-declaration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClF,OA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AO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -2,9 +2,8 @@ import type { Tool } from 'ai';
|
|
|
2
2
|
import type { ZodObject, ZodType, z } from 'zod';
|
|
3
3
|
import type { HttpMethod } from '../contract/define.js';
|
|
4
4
|
import type { EndpointMcpPolicy } from '../contract/tool-options.js';
|
|
5
|
-
import { type SurfaceAgentRuntimeToolDefinition } from './internal/surface-projector.js';
|
|
6
5
|
import type { MountableTool } from './mount.js';
|
|
7
|
-
import type { RuntimeToolDefinition, RuntimeToolDefinitionWithOutput, RuntimeToolDefinitionWithoutOutput, RuntimeToolFactoryHandlerContext } from './runtime-tool-declaration.js';
|
|
6
|
+
import type { DeferredAgentRuntimeToolDefinition, RuntimeToolDefinition, RuntimeToolDefinitionWithOutput, RuntimeToolDefinitionWithoutOutput, RuntimeToolFactoryHandlerContext } from './runtime-tool-declaration.js';
|
|
8
7
|
import type { RuntimeMcpToolPresenters } from './runtime-tool-mcp.js';
|
|
9
8
|
export type { RuntimeMcpInput, RuntimeToolDefinition, RuntimeToolDefinitionBase, RuntimeToolDefinitionWithOutput, RuntimeToolDefinitionWithoutOutput, RuntimeToolFactoryHandlerContext, RuntimeToolHandlerContext, RuntimeToolIdentity, RuntimeToolOutput, } from './runtime-tool-declaration.js';
|
|
10
9
|
export type { RuntimeMcpPresentation } from './runtime-tool-mcp.js';
|
|
@@ -54,5 +53,5 @@ export declare function runtimeToolMountable(definition: RuntimeToolDefinition,
|
|
|
54
53
|
* the richer internal definition consumed by the canonical mount. A named cast
|
|
55
54
|
* boundary (ADR 0003): the checks above are what make the cast true.
|
|
56
55
|
*/
|
|
57
|
-
export declare function executableAgentRuntimeTools(tools: readonly
|
|
56
|
+
export declare function executableAgentRuntimeTools(tools: readonly DeferredAgentRuntimeToolDefinition[]): readonly RuntimeToolDefinition[];
|
|
58
57
|
//# sourceMappingURL=runtime-tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-tool.d.ts","sourceRoot":"","sources":["../../src/tools/runtime-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime-tool.d.ts","sourceRoot":"","sources":["../../src/tools/runtime-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAKlE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EACV,kCAAkC,EAClC,qBAAqB,EACrB,+BAA+B,EAC/B,kCAAkC,EAClC,gCAAgC,EAGjC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,+BAA+B,EAC/B,kCAAkC,EAClC,gCAAgC,EAChC,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAC3C,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,eAAe,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,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CACzC,CAAC;AACF,wBAAgB,iBAAiB,CAC/B,MAAM,SAAS,SAAS,EACxB,KAAK,CAAC,IAAI,SAAS,iBAAiB,GAAG,SAAS,GAAG,SAAS,EAE5D,UAAU,EAAE,kCAAkC,CAAC,MAAM,EAAE,IAAI,CAAC,GAC3D,kCAAkC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAQpD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,SAAS,SAAS,EACjE,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC,GACzC,kBAAkB,CAAC,QAAQ,CAAC,CAiE9B;AAED,KAAK,cAAc,GAAG,CACpB,MAAM,EAAE,OAAO,KACZ,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAYpE,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,qBAAqB,GAChC,cAAc,GAAG,SAAS,CAG5B;AAiBD,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,qBAAqB,EACjC,UAAU,UAAO,GAChB,aAAa,CAef;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,kCAAkC,EAAE,GACnD,SAAS,qBAAqB,EAAE,CAgBlC"}
|
package/llms/files-packaging.txt
CHANGED
|
@@ -15,13 +15,16 @@ Also read:
|
|
|
15
15
|
## `stitchkit/files/packaging`
|
|
16
16
|
|
|
17
17
|
`stitchkit/files/packaging` owns `createNativePackaging` and the types
|
|
18
|
-
`NativePackagingOptions`, `NativePackagingAsset`, `NativePackagingPlugin`, `NativePackagingResult
|
|
18
|
+
`NativePackagingOptions`, `NativePackagingAsset`, `NativePackagingPlugin`, `NativePackagingResult`,
|
|
19
|
+
and for a standalone executable `NativePackagingEmbeddedOptions`, `NativePackagingEmbeddedAsset`,
|
|
20
|
+
`NativePackagingEmbeddedResult`.
|
|
19
21
|
It resolves the installed package's target/version, reads each selected addon once and checks it
|
|
20
22
|
against the `size` and `sha256` published in the package's `native-assets.json` (`formatVersion: 2`,
|
|
21
23
|
written when Stitchkit is built). Call it once per build and reuse the result.
|
|
22
|
-
`platform`, `architecture`, `delivery`, `entryPath` and `assetPath` are explicit
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
`platform`, `architecture`, `delivery`, `entryPath` and `assetPath` are the explicit inputs of
|
|
25
|
+
companion delivery; embedded delivery takes `platform`, one `architecture` and `delivery` only, and
|
|
26
|
+
refuses a path. `assetPath` accepts one template, `[hash]`, replaced by the first 16 hex digits of
|
|
27
|
+
the addon's published SHA256;
|
|
25
28
|
`platform` is the closed set `'darwin'`, and another name is a type error and a schema refusal.
|
|
26
29
|
The result is `ready` with verified assets and a structural Bun plugin, or `unsupported` /
|
|
27
30
|
`missing` / `mismatch` with the safe code `NATIVE_TARGET_UNSUPPORTED`, `NATIVE_ASSET_MISSING` or
|
|
@@ -38,7 +41,8 @@ and the published `size` and `sha256`.
|
|
|
38
41
|
Targets must be unique; entry and all asset paths must be disjoint. One lazy loader chooses only
|
|
39
42
|
the actual runtime architecture, with no fallback.
|
|
40
43
|
Companion mode places external addons relative to the emitted entry; embedded mode gives
|
|
41
|
-
Bun compile the verified bytes of the matching addon
|
|
42
|
-
|
|
44
|
+
Bun compile the verified bytes of the matching addon, and its asset (`bytes`, `size`, `sha256`)
|
|
45
|
+
has no `outputPath`, because nothing is written beside the executable. Keep companion JS builds
|
|
46
|
+
without splitting, preserve every output, and write each asset's `bytes` to its `outputPath`.
|
|
43
47
|
This evolving entrypoint is a build dependency; runtime imports do not reach it.
|
|
44
48
|
The detailed recipe is in [native IO](../guide/native-io.md#public-native-packaging).
|
package/llms/process.txt
CHANGED
|
@@ -270,13 +270,15 @@ so a helper started in the background races the leader:
|
|
|
270
270
|
|
|
271
271
|
| launched by the leader as | after the leader exits |
|
|
272
272
|
|---|---|
|
|
273
|
-
| `setsid -f helper`
|
|
273
|
+
| `setsid -f helper` | usually survives: `setsid -f` forks and returns at once, and the child calls `setsid()` a moment later, so a leader that exits immediately can still catch it in the group (13 of 300 launches under CPU load) |
|
|
274
274
|
| `setsid helper &`, `(setsid helper &)`, `nohup helper &` | stopped: the leader usually exits before the background job has left the group |
|
|
275
|
+
| a launch the leader waits on until the helper reports it has left the group | survives |
|
|
275
276
|
| any of these under `descendants: 'leave'` | survives |
|
|
276
277
|
|
|
277
|
-
Start a daemon so that the
|
|
278
|
-
|
|
279
|
-
`'leave'` only for a helper that has to outlive the command while
|
|
278
|
+
Start a daemon so that the leader waits for the session to exist before it returns: the helper
|
|
279
|
+
writes its pid, or prints a line, only after its own `setsid()`, and the leader waits for that.
|
|
280
|
+
Or declare `'leave'`. Declare `'leave'` only for a helper that has to outlive the command while
|
|
281
|
+
staying in its group:
|
|
280
282
|
|
|
281
283
|
```ts
|
|
282
284
|
await runNativeCommand({
|
|
@@ -441,23 +443,46 @@ version: carry their reachable relative `.d.ts` closure, rather than emitting re
|
|
|
441
443
|
instead emit declarations for only that DTO contract. Keep the library's manifest at runtime
|
|
442
444
|
`dependencies: {}` and `peerDependencies: { zod: ... }` when that is its declared promise.
|
|
443
445
|
|
|
444
|
-
The packaged Darwin loader
|
|
445
|
-
never follows it: bundling `stitchkit/server`,
|
|
446
|
-
the same single JS file on every operating
|
|
447
|
-
`bun build --outfile` works
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
plugin of the next section; it is the only way
|
|
446
|
+
The packaged Darwin loader computes its addon path at run time from its own file
|
|
447
|
+
(`module.filename`), so a bundler never follows it: bundling `stitchkit/server`,
|
|
448
|
+
`stitchkit/files` or `stitchkit/process` yields the same single JS file on every operating
|
|
449
|
+
system, with no `.node` output, `bun build --outfile` works, and no path of the build machine
|
|
450
|
+
becomes a literal of the artifact. A bundle has no installed package beside it, so without the
|
|
451
|
+
packaging plugin it never loads the addon: the first call that needs it reports the Darwin backend
|
|
452
|
+
`unavailable` with stage `packaging`, and the message names `createNativePackaging`. An artifact
|
|
453
|
+
that must carry the Darwin addon uses the packaging plugin of the next section; it is the only way
|
|
454
|
+
a static loader enters a bundle.
|
|
455
|
+
|
|
456
|
+
Only these calls load the addon, and only on macOS: process identity (`observeProcessInstance`
|
|
457
|
+
and `probeProcessOwner`), every exclusive lock (`withExclusiveLock` and what is built on it, such
|
|
458
|
+
as the file state store and the diagnostic journal) and the contained file operations of the Agent
|
|
459
|
+
coding tools. Without the addon a lock still works, but it cannot record or check its owner's
|
|
460
|
+
identity, so a lock held by a crashed owner is not reclaimed. The managed file boundary
|
|
461
|
+
(`createManagedFileBoundary` and the transfer tools built on it), atomic writes and the chunk
|
|
462
|
+
spool never load it, on any operating system. The package is free of import side effects
|
|
463
|
+
(`sideEffects: false`), so a bundle that imports only those parts carries no Darwin loader at all.
|
|
464
|
+
|
|
465
|
+
Check an artifact by its loader, never by whether it holds `.node` bytes: Bun can copy the addon
|
|
466
|
+
into a compiled executable even without the plugin, and the unpackaged loader does not use it.
|
|
467
|
+
Search the artifact for `STITCHKIT_NATIVE_NOT_PACKAGED` in both latin1 and UTF-16LE, because Bun
|
|
468
|
+
stores source text with non-ASCII characters as UTF-16. Present: the unpackaged loader is inside,
|
|
469
|
+
and every call above refuses on macOS. Absent in a plugin build: the static loader is inside
|
|
470
|
+
(`/$bunfs/root/darwin-<arch>-<hash>.node` in an executable, the companion path in a JS build).
|
|
471
|
+
Absent without the plugin: nothing in the artifact needs the addon.
|
|
452
472
|
|
|
453
473
|
```sh
|
|
454
474
|
bun build src/native.ts --target=bun --minify --outfile=dist/native.js
|
|
455
475
|
```
|
|
456
476
|
|
|
477
|
+
That plain build serves Linux and the parts that never load the addon. A library whose consumers
|
|
478
|
+
take locks or read process identity on macOS builds each native entry with the companion plugin of
|
|
479
|
+
the next section (one entry per build, `naming.entry` equal to `entryPath`) and ships the addon it
|
|
480
|
+
writes beside the entries.
|
|
481
|
+
|
|
457
482
|
Qualify the complete output outside its build tree and installed dependency graph. Test process
|
|
458
483
|
identity, live-owner refusal, dead-owner recovery and contained file operations in artifacts built
|
|
459
484
|
with the packaging plugin, and check that an unpackaged build reports the backend `unavailable`
|
|
460
|
-
rather than certifying a dead owner. Bun and Node package imports retain the same
|
|
485
|
+
with stage `packaging` rather than certifying a dead owner. Bun and Node package imports retain the same
|
|
461
486
|
lazy loader; importing a portable leaf does not load a Darwin addon on another OS. Test
|
|
462
487
|
declarations too, and check that importing an unbundled Stitchkit leaf fails in a deliberately
|
|
463
488
|
isolated library distribution. A separate schema-only entry must not import the native entry.
|
|
@@ -465,7 +490,9 @@ isolated library distribution. A separate schema-only entry must not import the
|
|
|
465
490
|
If the Darwin backend cannot load, `observeProcessInstance` still returns `unavailable`.
|
|
466
491
|
Its backend `Error` preserves the original `cause`; JSON serialization carries only the stable
|
|
467
492
|
`DARWIN_BACKEND_UNAVAILABLE` code, architecture, safe message and failure stage
|
|
468
|
-
(`architecture`, `resolve`, `load` or `surface`), plus a recognized native error code
|
|
493
|
+
(`architecture`, `packaging`, `resolve`, `load` or `surface`), plus a recognized native error code
|
|
494
|
+
when present: `packaging` is a bundle built without the packaging plugin, with native code
|
|
495
|
+
`STITCHKIT_NATIVE_NOT_PACKAGED`.
|
|
469
496
|
It excludes stack, paths and nested cause. This backend diagnosis does not reclassify kernel
|
|
470
497
|
failures or turn unavailable identity into proof that an owner is dead. If a runtime provides
|
|
471
498
|
no recognized native error code, the stage stays `load`; the loader never infers errno from text.
|
|
@@ -512,7 +539,7 @@ for (const asset of native.assets) {
|
|
|
512
539
|
}
|
|
513
540
|
```
|
|
514
541
|
|
|
515
|
-
`entryPath` and `assetPath` are relative paths inside the application's output root, without
|
|
542
|
+
In companion delivery, `entryPath` and `assetPath` are relative paths inside the application's output root, without
|
|
516
543
|
absolute paths, traversal or overlapping file/directory paths. `assetPath` may contain `[hash]`,
|
|
517
544
|
which becomes the first 16 hex digits of that addon's published SHA256: the digest is known before
|
|
518
545
|
the build, so `addons/darwin-arm64-[hash].node` gives two installed versions of the package
|
|
@@ -551,10 +578,27 @@ process primitives without loading Darwin assets. Qualify the exact same JS byte
|
|
|
551
578
|
Darwin arm64 and x64 machines, with both companions preserved through archive delivery.
|
|
552
579
|
Build-machine architecture and cross-build success cannot establish universal native support.
|
|
553
580
|
|
|
554
|
-
For a standalone executable use `delivery: 'embedded'` and
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
581
|
+
For a standalone executable use `delivery: 'embedded'` and its plugin in `Bun.build` with
|
|
582
|
+
`compile`. An executable carries the addon inside itself, so this form names no `entryPath` or
|
|
583
|
+
`assetPath`; passing one is a type error and a schema refusal, never silently ignored:
|
|
584
|
+
|
|
585
|
+
```ts
|
|
586
|
+
const native = createNativePackaging({
|
|
587
|
+
platform: 'darwin', architecture: 'arm64', delivery: 'embedded',
|
|
588
|
+
})
|
|
589
|
+
if (native.state !== 'ready') throw new Error(native.code)
|
|
590
|
+
const result = await Bun.build({
|
|
591
|
+
entrypoints: ['src/cli.ts'], minify: true,
|
|
592
|
+
compile: { target: 'bun-darwin-arm64', outfile: 'dist/cli' },
|
|
593
|
+
plugins: [native.plugin],
|
|
594
|
+
})
|
|
595
|
+
if (!result.success) throw new AggregateError(result.logs, 'Build failed')
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
Bun embeds the selected addon from the verified bytes the plugin holds, not from a second read of
|
|
599
|
+
the file, and the executable loads it from `/$bunfs/root/darwin-arm64-<hash>.node`. Its `assets`
|
|
600
|
+
(`NativePackagingEmbeddedAsset`: `bytes`, `size`, `sha256`) identify those bytes and their
|
|
601
|
+
published digest for qualification; there is nothing to write beside the executable.
|
|
558
602
|
Cross-builds must select the requested architecture explicitly; the artifact must run on that target.
|
|
559
603
|
The installed package must contain that target's addon. No automatic fallback/downgrade occurs.
|
|
560
604
|
|
|
@@ -622,7 +666,7 @@ Native POSIX Bun/Node one-shot command execution. See [native IO](../guide/nativ
|
|
|
622
666
|
| `NativeCommandOptions` | type | executable/args, env policy, signal/deadline, bytes sink, finite cleanup limits, the `stop` policy and `descendants` (`'terminate-after-leader'`, the default: stop the group after the leader exits, or `'leave'`); `stdio` (`'pipe'`, or `'inherit'` for the caller's descriptors, refusing the pipe-only options) and `group` (`'own'`, or `'caller'`: joins the caller's process group, stops only the leader, refuses `descendants` and a group stop); `onLeaderStarted({ pid })` (once, after the leader exists), `drainTimeoutMs` (bound on the pipes staying open after the leader exited, `COMMAND_CLEANUP`); an unknown key is refused by name, a removed one (`killGraceMs`) with its replacement |
|
|
623
667
|
| `NativeCommandStopPolicy` | type | how a cancelled command stops: `target` `'group'` (signal every member) or `'leader'` (signal only the leader; its exit ends the grace), `signal` (default `SIGTERM`), `graceMs` (at most one hour) before KILL to the group, and `killOn`, an `AbortSignal` that skips the grace; default `{ target: 'group', signal: 'SIGTERM', graceMs: 100 }` |
|
|
624
668
|
| `NativeCommandResult` | type | observed nullable exit code/signal, `descendantsStopped` (members left in the group after the leader exited were stopped) and captured stdout/stderr bytes |
|
|
625
|
-
| `NativeCommandError` | class | COMMAND_LIMIT with machine reason `deadline` or `output-budget`; COMMAND_UNAVAILABLE / COMMAND_CLEANUP have no limit reason. Preserves internal cause and existing constructor; caller-created limits without supplied reason remain unclassified |
|
|
669
|
+
| `NativeCommandError` | class | COMMAND_LIMIT with machine reason `deadline` or `output-budget`; COMMAND_UNAVAILABLE / COMMAND_CLEANUP have no limit reason; COMMAND_CLEANUP means the command's resources were not proven closed, either past `cleanupTimeoutMs` after a stop or past `drainTimeoutMs` after the leader exited, and `cause` holds that bound's failure. Preserves internal cause and existing constructor; caller-created limits without supplied reason remain unclassified |
|
|
626
670
|
|
|
627
671
|
| `NativeCommandSettlement` | type | `exit` (the leader ended on its own), `stopped` (the command was stopped and the leader's exit after the stop observed: the stop's `cause` with `exitCode`/`signal`) or `error` (no exit observed), including synchronous native launch failure; `onLeaderSettled` runs once before drain, bounded by cleanupTimeoutMs, with a cancellable settlement signal; schema/pre-abort refusal creates no settlement obligation |
|
|
628
672
|
| `observeProcessInstance` / `ProcessInstanceObservation` | function / type | Linux/Darwin lifetime observation; observed identity or unavailable with its original cause, never guessed absence |
|
package/llms/stitchkit.txt
CHANGED
|
@@ -83,12 +83,12 @@ own, recorded as an ADR.
|
|
|
83
83
|
| `stitchkit/geo` | server (Bun or Node) | evolving | managed GeoIP reader generations, last-known-good reload and the optional MaxMind adapter |
|
|
84
84
|
| `stitchkit/oauth` | browser **and** server | evolving | provider-neutral Authorization Code + PKCE request and one-shot callback transaction mechanics |
|
|
85
85
|
| `stitchkit/google` | server (Bun or Node) | evolving | optional Google code exchange and verified OIDC identity adapter |
|
|
86
|
-
| `stitchkit/observability` | server | stable<br>_redefined in 2 of the
|
|
86
|
+
| `stitchkit/observability` | server | stable<br>_redefined in 2 of the 52 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
|
|
87
87
|
| `stitchkit/testing` | tests on Bun or Node | stable | in-process generated clients over a real Fetch handler, plus the managed-resource conformance kit |
|
|
88
88
|
| `stitchkit/declaration` | browser + build and deployment tooling (Bun or Node) | evolving | `ProjectDeclarationSchema` — the one machine-readable statement a repository makes about itself |
|
|
89
89
|
| `stitchkit/react` | browser + server rendering | stable | `createCursorQuery`, `createCacheBridge`, QueryClient and `ApiError` retry policy |
|
|
90
90
|
| `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) |
|
|
91
|
-
| `stitchkit/agent-runtime` | server | evolving<br>_redefined in 23 of the
|
|
91
|
+
| `stitchkit/agent-runtime` | server | evolving<br>_redefined in 23 of the 52 minors since 0.56.2, most recently 0.105.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
|
|
92
92
|
| `stitchkit/agent-runtime/sandbox` | server | evolving | optional Linux Bubblewrap sessions, durable workspaces and a host HTTP credential gateway; see [sandbox guide](sandbox.md) |
|
|
93
93
|
| `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 |
|
|
94
94
|
| `stitchkit/agent-runtime/harness` | server | evolving | resource-aware process-local facade over the canonical Agent runtime; supervision stays outside |
|
|
@@ -100,7 +100,7 @@ own, recorded as an ADR.
|
|
|
100
100
|
| `stitchkit/agent-runtime/sqlite/bun` | server (Bun) | evolving | durable built-in SQLite store for the agent runtime |
|
|
101
101
|
| `stitchkit/agent-runtime/sqlite/node` | server (Node ≥ 22.5) | evolving | durable built-in SQLite store for the agent runtime |
|
|
102
102
|
| `stitchkit-tui` | terminal (Bun) | evolving | optional official OpenTUI host over a caller-composed headless runtime |
|
|
103
|
-
| `stitchkit/application` | browser + server | evolving<br>_redefined in 13 of the
|
|
103
|
+
| `stitchkit/application` | browser + server | evolving<br>_redefined in 13 of the 52 minors since 0.56.2, most recently 0.105.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
|
|
104
104
|
| `stitchkit/application/grammy` | server | evolving | a grammY bot as application resources — configuration, then polling with updates admitted by batch — and the webhook adapter |
|
|
105
105
|
| `stitchkit/application/opentelemetry` | server | evolving | maps application snapshots onto an injected OpenTelemetry `Meter` |
|
|
106
106
|
| `stitchkit/application/schemas` | browser + server | evolving | the application's snapshot, health and shutdown schemas alone, without the kernel |
|
|
@@ -1,14 +1,220 @@
|
|
|
1
|
-
# Upgrading 0.37.0 → 0.
|
|
1
|
+
# Upgrading 0.37.0 → 0.58.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.37.0 → 0.
|
|
6
|
+
Contains: Guide: Upgrading, 0.37.0 → 0.58.0 (docs/guide/upgrading.md)
|
|
7
7
|
|
|
8
8
|
==============================================================================
|
|
9
|
-
# Guide: Upgrading, 0.37.0 → 0.
|
|
9
|
+
# Guide: Upgrading, 0.37.0 → 0.58.0 (docs/guide/upgrading.md)
|
|
10
10
|
==============================================================================
|
|
11
11
|
|
|
12
|
+
## Released migration: 0.58.0
|
|
13
|
+
|
|
14
|
+
### The default history projection rejects invalid chronology
|
|
15
|
+
|
|
16
|
+
`projectAgentHistory` no longer forwards records a provider contract cannot
|
|
17
|
+
accept. A completed assistant record before the first user message, and an
|
|
18
|
+
assistant record whose tool calls have no matching results, are omitted with an
|
|
19
|
+
inspectable decision instead of being sent upstream:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
// before — a leading assistant record was forwarded as-is
|
|
23
|
+
projectAgentHistory(messages)
|
|
24
|
+
// after — opt in explicitly, and only where the provider contract permits it
|
|
25
|
+
projectAgentHistory(messages, { leadingAssistant: 'allow' })
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Two consequences the changelog does not spell out. First, the projection can now
|
|
29
|
+
return **fewer** messages than the history holds, so any assertion or metric
|
|
30
|
+
that compared projected length against stored length will move; read the
|
|
31
|
+
detailed projection instead — it reports what was omitted and why, which is the
|
|
32
|
+
supported way to see the difference. Second, the omission is silent to the
|
|
33
|
+
provider but not to you: if a conversation suddenly loses its leading context,
|
|
34
|
+
the decision record is where that shows up, not the transcript.
|
|
35
|
+
|
|
36
|
+
### Operator events redact `internalCause` by default
|
|
37
|
+
|
|
38
|
+
Raw provider and tool failures no longer travel in operator events unless the
|
|
39
|
+
sink asks for them:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
// before — internalCause was present
|
|
43
|
+
createAgentObservability({ write })
|
|
44
|
+
// after — an explicit operator-only opt-in
|
|
45
|
+
createAgentObservability({ write, includeInternalCause: true })
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The consequence to check before upgrading: any dashboard, alert or log
|
|
49
|
+
processor keyed on `internalCause` goes blind the moment you upgrade, and it
|
|
50
|
+
goes blind quietly — the field is absent, not empty. Set the flag on the
|
|
51
|
+
operator sink you own. Product delivery stays redacted regardless of the flag;
|
|
52
|
+
this option cannot widen what reaches a user.
|
|
53
|
+
|
|
54
|
+
## Released migration: 0.57.0
|
|
55
|
+
|
|
56
|
+
### Duplicate admission results carry the complete identity
|
|
57
|
+
|
|
58
|
+
Custom `AgentRuntimeStore` adapters must persist and return the input and
|
|
59
|
+
assistant identities associated with an idempotency key:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
// before
|
|
63
|
+
return { outcome: 'duplicate', runId, snapshot }
|
|
64
|
+
|
|
65
|
+
// after
|
|
66
|
+
return { outcome: 'duplicate', input, inputMessageId, runId, assistantMessageId, snapshot }
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Prefer replacing the custom aggregate reducer with `createAgentRuntimeStore()`;
|
|
70
|
+
its admission record and transaction driver implement this contract
|
|
71
|
+
automatically. Historical note: 0.59.0 reshaped this driver again, so an adapter
|
|
72
|
+
crossing both versions should read that section first and migrate once.
|
|
73
|
+
|
|
74
|
+
### `AgentRuntimeEvent` adds a post-commit `admission` variant
|
|
75
|
+
|
|
76
|
+
Add it to any exhaustive publisher switch. Its `assistant` is either the pending
|
|
77
|
+
placeholder for a new assignment or the canonical persisted assistant for a
|
|
78
|
+
duplicate:
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
case 'admission':
|
|
82
|
+
await persistProductProjection(event.input, event.run, event.assistant)
|
|
83
|
+
break
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The consequence for an exhaustive switch written without a `default` branch is a
|
|
87
|
+
compile error, which is the point. The consequence for a switch that *has* a
|
|
88
|
+
`default` is worse and silent: post-commit admissions fall into it and are
|
|
89
|
+
projected as an unknown event. Grep for publisher switches before upgrading.
|
|
90
|
+
|
|
91
|
+
## Released migration: 0.56.0
|
|
92
|
+
|
|
93
|
+
### Surface manifests are version 2
|
|
94
|
+
|
|
95
|
+
`operation.tools` could not describe a role-selected MCP surface, a different
|
|
96
|
+
Agent or CLI selection, or an advertised `extend` schema, so projections moved
|
|
97
|
+
out of the canonical operation:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
// before
|
|
101
|
+
manifest.operations[0].tools.MCP
|
|
102
|
+
// after
|
|
103
|
+
manifest.toolSurfaces.find((s) => s.transport === 'MCP' && s.surface === null)?.tools
|
|
104
|
+
|
|
105
|
+
// before
|
|
106
|
+
buildSurfaceManifest({ mcpSurfaces: { admin: { services, extend } } })
|
|
107
|
+
// after
|
|
108
|
+
buildSurfaceManifest({ mcpSurfaces: { admin: { services } }, mcpPreparation: { extend } })
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
A committed snapshot is regenerated once, deliberately: `manifestVersion` is
|
|
112
|
+
`2`, and `ConformanceTransport` gained `REALTIME`, so any exhaustive
|
|
113
|
+
`Record<ConformanceTransport, …>` must handle it.
|
|
114
|
+
|
|
115
|
+
### `FILE_*` codes joined the error registry
|
|
116
|
+
|
|
117
|
+
`StitchErrorCode` gained `FILE_INVALID_PATH`, `FILE_OUTSIDE_ROOT`,
|
|
118
|
+
`FILE_NOT_FOUND`, `FILE_NOT_REGULAR`, `FILE_INSPECTION_REJECTED`,
|
|
119
|
+
`FILE_TOO_LARGE` and `FILE_EXISTS`. Only exhaustive maps break:
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
// before — compiled while the registry had no file codes
|
|
123
|
+
const copy: Record<StitchErrorCode, string> = { …, RATE_LIMITED: '…' }
|
|
124
|
+
// after — add the seven managed-file codes (or use Partial<Record<…>>)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Unexpected IO stays scrubbed as `INTERNAL_SERVER_ERROR`: the new codes are the
|
|
128
|
+
caller-safe ones only.
|
|
129
|
+
|
|
130
|
+
### `ScopedAuthHook` is nominal
|
|
131
|
+
|
|
132
|
+
A hand-written function shaped like an auth hook is no longer assignable —
|
|
133
|
+
identity now comes from the factory, so scope ownership and the inferred
|
|
134
|
+
context cannot drift apart:
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
// before — a structural stand-in
|
|
138
|
+
const auth: ScopedAuthHook<Scopes> = async (ctx, endpoint) => { … }
|
|
139
|
+
// after — create it, then compose domains
|
|
140
|
+
const auth = createAuthHook({ resolve, rules })
|
|
141
|
+
const composed = composeAuthHooks({ hooks: [auth, billingAuth], defaultScope: 'public' })
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Managed-file inspectors also run on reads
|
|
145
|
+
|
|
146
|
+
An inspector is no longer write-only, and it has a finite default deadline
|
|
147
|
+
(15 s). Make it read-aware and idempotent — a read carries no
|
|
148
|
+
`declaredMediaType`:
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
// before
|
|
152
|
+
inspect: ({ declaredMediaType }) => inspectDeclaredType(declaredMediaType!)
|
|
153
|
+
// after
|
|
154
|
+
inspect: ({ prefix, declaredMediaType, signal }) =>
|
|
155
|
+
inspectBytes(prefix, { declaredMediaType, signal })
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Set `inspectionTimeoutMs` explicitly when 15 seconds is the wrong budget.
|
|
159
|
+
|
|
160
|
+
### Direct async-operation binding needs a wire-stable ID
|
|
161
|
+
|
|
162
|
+
A direct binding reuses the start output as the follow-up wire input, so the ID
|
|
163
|
+
schema must parse to itself (`z.input` equals `z.output`, no transform,
|
|
164
|
+
coercion, default or overwrite). Anything else is parsed twice:
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
// before — a transform silently ran on start and again on every follow-up
|
|
168
|
+
defineAsyncOperationContract({ binding: 'direct', id: z.string().transform(Number) })
|
|
169
|
+
// after — keep the wire shape, adapt explicitly
|
|
170
|
+
defineAsyncOperationContract({
|
|
171
|
+
binding: 'adapted',
|
|
172
|
+
id,
|
|
173
|
+
adapters: { idFromStart, inputFor },
|
|
174
|
+
})
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Released migration: 0.55.0
|
|
178
|
+
|
|
179
|
+
### Peer-free `implementRemote`
|
|
180
|
+
|
|
181
|
+
`implementRemote` now has one canonical, optional-peer-free owner. This keeps
|
|
182
|
+
MCP SDK and AI SDK modules out of CLI bundles that only proxy HTTP calls:
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
// before
|
|
186
|
+
import { implementRemote } from 'stitchkit/tools'
|
|
187
|
+
// after
|
|
188
|
+
import { implementRemote } from 'stitchkit/remote'
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Managed file boundary and strict auth returns
|
|
192
|
+
|
|
193
|
+
Create one boundary during application bootstrap and pass the capability, never
|
|
194
|
+
a per-call directory or host path:
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
import { createManagedFileBoundary } from 'stitchkit/files'
|
|
198
|
+
|
|
199
|
+
const files = await createManagedFileBoundary({ root: '/srv/app-files' })
|
|
200
|
+
|
|
201
|
+
// before
|
|
202
|
+
defineDownloadTool({ defaultDir: '/srv/app-files', resolveUrl, ...common })
|
|
203
|
+
defineUploadTool({ upload: (path) => provider.uploadFile(path), ...common })
|
|
204
|
+
defineViewFileTool({ baseDir: '/srv/app-files', ...common })
|
|
205
|
+
|
|
206
|
+
// after
|
|
207
|
+
defineDownloadTool({ files, resolveUrl, ...common })
|
|
208
|
+
defineUploadTool({ files, upload: ({ bytes }) => provider.upload(bytes), ...common })
|
|
209
|
+
defineViewFileTool({ files, ...common })
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Downloaded `path` is now relative to the boundary and MIME metadata is named
|
|
213
|
+
`mediaType`. Update raw `mountDownload`/`mountUpload`/`mountViewFile` configs the
|
|
214
|
+
same way. Auth predicates must explicitly return `true`, `false`, or a plain
|
|
215
|
+
object of context fields; replace accidental `undefined` fallthroughs with the
|
|
216
|
+
intended boolean.
|
|
217
|
+
|
|
12
218
|
## Released migration: 0.53.0
|
|
13
219
|
|
|
14
220
|
### Realtime `emit` returns `boolean` instead of `void`
|