stitchkit 0.106.1 → 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.
Files changed (96) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/darwin-native.cjs +16 -4
  3. package/dist/agent-runtime/deferred-tool-types.d.ts +6 -27
  4. package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
  5. package/dist/entrypoints/agent-runtime/browser.js +2 -3
  6. package/dist/entrypoints/agent-runtime/coding-tools.js +6 -8
  7. package/dist/entrypoints/agent-runtime/harness.js +7 -11
  8. package/dist/entrypoints/agent-runtime/realtime.js +2 -3
  9. package/dist/entrypoints/agent-runtime/sandbox.js +6 -8
  10. package/dist/entrypoints/agent-runtime.d.ts +2 -1
  11. package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
  12. package/dist/entrypoints/agent-runtime.js +20 -23
  13. package/dist/entrypoints/application/diagnostic-journal.js +3 -3
  14. package/dist/entrypoints/application/directory-inbox.js +8 -9
  15. package/dist/entrypoints/application/grammy.js +3 -3
  16. package/dist/entrypoints/application.js +7 -8
  17. package/dist/entrypoints/cli/publish.js +10 -11
  18. package/dist/entrypoints/cli.js +12 -16
  19. package/dist/entrypoints/contract.js +1 -1
  20. package/dist/entrypoints/files/packaging.d.ts +1 -1
  21. package/dist/entrypoints/files/packaging.d.ts.map +1 -1
  22. package/dist/entrypoints/files/packaging.js +99 -47
  23. package/dist/entrypoints/files.js +16 -16
  24. package/dist/entrypoints/index.js +41 -41
  25. package/dist/entrypoints/node.js +27 -29
  26. package/dist/entrypoints/observability.js +10 -12
  27. package/dist/entrypoints/process.js +2 -2
  28. package/dist/entrypoints/react.js +3 -4
  29. package/dist/entrypoints/remote.js +8 -9
  30. package/dist/entrypoints/server.js +48 -51
  31. package/dist/entrypoints/telegram/html.js +3 -3
  32. package/dist/entrypoints/telegram/screens.js +5 -5
  33. package/dist/entrypoints/telegram.js +9 -10
  34. package/dist/entrypoints/testing.js +8 -11
  35. package/dist/entrypoints/tools/connections.js +11 -11
  36. package/dist/entrypoints/tools/invoker.js +5 -9
  37. package/dist/entrypoints/tools/mcp.js +8 -14
  38. package/dist/entrypoints/tools.js +19 -25
  39. package/dist/entrypoints/tracking.js +3 -3
  40. package/dist/files/native-packaging-layout.d.ts +6 -2
  41. package/dist/files/native-packaging-layout.d.ts.map +1 -1
  42. package/dist/files/native-packaging.d.ts +45 -10
  43. package/dist/files/native-packaging.d.ts.map +1 -1
  44. package/dist/{index-v5ee8ath.js → index-1h2zv8rx.js} +10 -40
  45. package/dist/index-2kbysk9s.js +42 -0
  46. package/dist/{index-wbhdzxar.js → index-2s6fpehp.js} +5 -5
  47. package/dist/{index-4vsby8n8.js → index-4f37d3bg.js} +1 -1
  48. package/dist/{index-ksfagmyz.js → index-4qh90tyw.js} +8 -8
  49. package/dist/{index-yvfk3y36.js → index-636mggad.js} +4 -3
  50. package/dist/{index-f199nfq5.js → index-6y9t2fwz.js} +7 -7
  51. package/dist/{index-azx12jgv.js → index-7r74re56.js} +1 -1
  52. package/dist/{index-w8etpm8j.js → index-9j2atjte.js} +1 -1
  53. package/dist/{index-dsnjzb62.js → index-bnf8s6v3.js} +1 -1
  54. package/dist/{index-pz3y6b6g.js → index-cx2nh595.js} +3 -3
  55. package/dist/{index-2k91mewf.js → index-dm2fv45z.js} +9 -9
  56. package/dist/{index-9bskshe3.js → index-dwf0gymy.js} +10 -10
  57. package/dist/{index-qaqbdm7s.js → index-h7qms8f9.js} +8 -8
  58. package/dist/{index-drs41arz.js → index-ktjmgq9p.js} +1 -1
  59. package/dist/{index-1ptj98e0.js → index-mbf4h8kp.js} +2 -2
  60. package/dist/{index-916yh4e2.js → index-mep4sb48.js} +14 -14
  61. package/dist/{index-wdy68sh6.js → index-njs9gvrh.js} +17 -17
  62. package/dist/{index-sj28htvf.js → index-pvh3z03x.js} +1 -1
  63. package/dist/{index-r393tnfp.js → index-q6crhe1n.js} +4 -4
  64. package/dist/{index-z23rfxhj.js → index-xmgjtkvr.js} +1 -1
  65. package/dist/{index-gr5g3xfw.js → index-yz8x0hbx.js} +1 -1
  66. package/dist/{index-gxm9rc97.js → index-zrtrjkbf.js} +1 -1
  67. package/dist/{index-1pwwan01.js → index-zsqt5q98.js} +5 -5
  68. package/dist/internal/darwin-binding-error.d.ts +9 -1
  69. package/dist/internal/darwin-binding-error.d.ts.map +1 -1
  70. package/dist/internal/darwin-binding.d.ts.map +1 -1
  71. package/dist/tools/internal/surface-projector.d.ts +0 -7
  72. package/dist/tools/internal/surface-projector.d.ts.map +1 -1
  73. package/dist/tools/runtime-tool-declaration.d.ts +11 -0
  74. package/dist/tools/runtime-tool-declaration.d.ts.map +1 -1
  75. package/dist/tools/runtime-tool.d.ts +2 -3
  76. package/dist/tools/runtime-tool.d.ts.map +1 -1
  77. package/llms/files-packaging.txt +10 -6
  78. package/llms/process.txt +57 -15
  79. package/llms/stitchkit.txt +3 -3
  80. package/llms/{upgrading-0.37.0-0.53.0.txt → upgrading-0.37.0-0.58.0.txt} +209 -3
  81. package/llms/{upgrading-0.55.0-0.68.0.txt → upgrading-0.59.0-0.71.0.txt} +149 -209
  82. package/llms/{upgrading-0.69.0-0.95.0.txt → upgrading-0.72.0-0.97.0.txt} +76 -149
  83. package/llms/{upgrading-0.96.0-0.106.0.txt → upgrading-0.98.0-0.107.0.txt} +56 -83
  84. package/llms/upgrading.txt +4 -4
  85. package/llms-full.txt +123 -31
  86. package/llms.txt +6 -6
  87. package/package.json +2 -1
  88. package/dist/{index-cazts87s.js → index-07dcf2yn.js} +3 -3
  89. package/dist/{index-n1nszyk0.js → index-7jvwrjqa.js} +3 -3
  90. package/dist/{index-cmzvhhtd.js → index-85qve8mq.js} +3 -3
  91. package/dist/{index-rpzewktb.js → index-fynr93w4.js} +3 -3
  92. package/dist/{index-37asdw3a.js → index-k7qdkh3n.js} +3 -3
  93. package/dist/{index-x7w1z6pf.js → index-q4hjtyye.js} +4 -4
  94. package/dist/{index-7n68nmc6.js → index-y3nemndz.js} +3 -3
  95. package/dist/{index-12zsej7b.js → index-y70v24cw.js} +3 -3
  96. package/dist/{index-pzb63z66.js → index-ykdcnq1f.js} +3 -3
@@ -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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(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,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,MAAM,MAAM,eAAe,CAAC,IAAI,SAAS,iBAAiB,GAAG,SAAS,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E,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,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,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1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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;AAEP;;;;;GAKG;AACH,MAAM,WAAW,kCACf,SAAQ,yBAAyB,CAAC,SAAS,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,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 SurfaceAgentRuntimeToolDefinition[]): readonly RuntimeToolDefinition[];
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;AAIlE,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAA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E,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"}
@@ -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 public inputs;
23
- `assetPath` accepts one template, `[hash]`, replaced by the first 16 hex digits of the addon's
24
- published SHA256;
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. Keep JS builds without splitting, preserve
42
- every output, and write each asset's `bytes` to its `outputPath`.
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
@@ -443,23 +443,46 @@ version: carry their reachable relative `.d.ts` closure, rather than emitting re
443
443
  instead emit declarations for only that DTO contract. Keep the library's manifest at runtime
444
444
  `dependencies: {}` and `peerDependencies: { zod: ... }` when that is its declared promise.
445
445
 
446
- The packaged Darwin loader names its addons by a path computed at run time, so a bundler
447
- never follows it: bundling `stitchkit/server`, `stitchkit/files` or `stitchkit/process` yields
448
- the same single JS file on every operating system, with no `.node` output, and
449
- `bun build --outfile` works. Such a bundle looks for the addon beside the original package
450
- files, never inside itself. Where that file is absent (an artifact moved to another machine)
451
- the Darwin backend is `unavailable`: process identity cannot be recorded, so a lock held by a
452
- crashed owner is not reclaimed. An artifact that must carry the Darwin addon uses the packaging
453
- plugin of the next section; it is the only way a static loader enters a bundle.
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.
454
472
 
455
473
  ```sh
456
474
  bun build src/native.ts --target=bun --minify --outfile=dist/native.js
457
475
  ```
458
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
+
459
482
  Qualify the complete output outside its build tree and installed dependency graph. Test process
460
483
  identity, live-owner refusal, dead-owner recovery and contained file operations in artifacts built
461
484
  with the packaging plugin, and check that an unpackaged build reports the backend `unavailable`
462
- 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
463
486
  lazy loader; importing a portable leaf does not load a Darwin addon on another OS. Test
464
487
  declarations too, and check that importing an unbundled Stitchkit leaf fails in a deliberately
465
488
  isolated library distribution. A separate schema-only entry must not import the native entry.
@@ -467,7 +490,9 @@ isolated library distribution. A separate schema-only entry must not import the
467
490
  If the Darwin backend cannot load, `observeProcessInstance` still returns `unavailable`.
468
491
  Its backend `Error` preserves the original `cause`; JSON serialization carries only the stable
469
492
  `DARWIN_BACKEND_UNAVAILABLE` code, architecture, safe message and failure stage
470
- (`architecture`, `resolve`, `load` or `surface`), plus a recognized native error code when present.
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`.
471
496
  It excludes stack, paths and nested cause. This backend diagnosis does not reclassify kernel
472
497
  failures or turn unavailable identity into proof that an owner is dead. If a runtime provides
473
498
  no recognized native error code, the stage stays `load`; the loader never infers errno from text.
@@ -514,7 +539,7 @@ for (const asset of native.assets) {
514
539
  }
515
540
  ```
516
541
 
517
- `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
518
543
  absolute paths, traversal or overlapping file/directory paths. `assetPath` may contain `[hash]`,
519
544
  which becomes the first 16 hex digits of that addon's published SHA256: the digest is known before
520
545
  the build, so `addons/darwin-arm64-[hash].node` gives two installed versions of the package
@@ -553,10 +578,27 @@ process primitives without loading Darwin assets. Qualify the exact same JS byte
553
578
  Darwin arm64 and x64 machines, with both companions preserved through archive delivery.
554
579
  Build-machine architecture and cross-build success cannot establish universal native support.
555
580
 
556
- For a standalone executable use `delivery: 'embedded'` and the same plugin in `Bun.build`
557
- with `compile: { outfile: ... }`. Bun embeds the selected addon from the verified bytes the
558
- plugin holds, not from a second read of the file; `assets` identifies those bytes and their
559
- published digest for qualification, not a companion that must be installed beside the executable.
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.
560
602
  Cross-builds must select the requested architecture explicitly; the artifact must run on that target.
561
603
  The installed package must contain that target's addon. No automatic fallback/downgrade occurs.
562
604
 
@@ -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 51 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
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 51 minors since 0.56.2, most recently 0.105.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
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 51 minors since 0.56.2, most recently 0.105.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
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.53.0 — stitchkit docs slice
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.53.0 (docs/guide/upgrading.md)
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.53.0 (docs/guide/upgrading.md)
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`