stitchkit 0.113.1 → 0.113.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/contract/errors.d.ts +2 -0
  3. package/dist/contract/errors.d.ts.map +1 -1
  4. package/dist/entrypoints/agent-runtime/browser.js +2 -2
  5. package/dist/entrypoints/agent-runtime/coding-tools.js +4 -4
  6. package/dist/entrypoints/agent-runtime/harness.js +5 -5
  7. package/dist/entrypoints/agent-runtime/realtime.js +2 -2
  8. package/dist/entrypoints/agent-runtime/sandbox.js +4 -4
  9. package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
  10. package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
  11. package/dist/entrypoints/agent-runtime/testing.js +6 -6
  12. package/dist/entrypoints/agent-runtime.js +11 -11
  13. package/dist/entrypoints/application/grammy.js +1 -1
  14. package/dist/entrypoints/application.js +2 -2
  15. package/dist/entrypoints/cli.js +8 -8
  16. package/dist/entrypoints/contract.js +2 -2
  17. package/dist/entrypoints/files.js +1 -1
  18. package/dist/entrypoints/index.js +5 -5
  19. package/dist/entrypoints/node.js +7 -7
  20. package/dist/entrypoints/observability.js +1 -1
  21. package/dist/entrypoints/realtime.js +3 -3
  22. package/dist/entrypoints/remote.js +1 -1
  23. package/dist/entrypoints/server.js +8 -8
  24. package/dist/entrypoints/testing.js +3 -3
  25. package/dist/entrypoints/tools/connections.js +5 -5
  26. package/dist/entrypoints/tools/invoker.js +5 -5
  27. package/dist/entrypoints/tools/mcp.js +7 -7
  28. package/dist/entrypoints/tools.js +13 -13
  29. package/dist/{index-8jjzfts8.js → index-095ya5hm.js} +5 -5
  30. package/dist/{index-sjww6myv.js → index-1csp1hwm.js} +4 -4
  31. package/dist/{index-xmgjtkvr.js → index-2bqf0a74.js} +1 -1
  32. package/dist/{index-ykdcnq1f.js → index-3za04re9.js} +1 -1
  33. package/dist/{index-yjnmac9b.js → index-523tq7y4.js} +1 -1
  34. package/dist/{index-mhrtwttb.js → index-7fc0c2np.js} +1 -1
  35. package/dist/{index-emrmgq3s.js → index-86nbfysb.js} +3 -3
  36. package/dist/{index-556g5hsh.js → index-98hv3sba.js} +1 -1
  37. package/dist/{index-h1spd9kv.js → index-9dyd8xzf.js} +1 -1
  38. package/dist/{index-gz9jf461.js → index-aykhzcnf.js} +1 -1
  39. package/dist/{index-86sxnvpr.js → index-bjcjqj46.js} +1 -1
  40. package/dist/{index-pzw0fpek.js → index-cqmqyjax.js} +1 -1
  41. package/dist/{index-nk1mh535.js → index-ega3yz4c.js} +1 -1
  42. package/dist/{index-k8fbzggr.js → index-fy4av0hq.js} +1 -1
  43. package/dist/{index-v6mzw27b.js → index-htxh46ej.js} +3 -3
  44. package/dist/{index-pvh3z03x.js → index-jk29rwkr.js} +1 -1
  45. package/dist/{index-fynr93w4.js → index-k42ckyzx.js} +1 -1
  46. package/dist/{index-fytsnhzj.js → index-k7z3j3hr.js} +211 -125
  47. package/dist/{index-j9gxbztg.js → index-qcn84byh.js} +2 -0
  48. package/dist/{index-jgwqc38k.js → index-rhzkndr5.js} +2 -2
  49. package/dist/{index-k0zfcxf5.js → index-tpwbct8j.js} +1 -1
  50. package/dist/{index-8asb62xn.js → index-v1tswj0z.js} +1 -1
  51. package/dist/{index-tg2q89ps.js → index-v6vb5qx8.js} +4 -4
  52. package/dist/{index-2qymcsq2.js → index-vtann8bz.js} +3 -3
  53. package/dist/{index-nn6607y3.js → index-vwhrnp67.js} +4 -4
  54. package/dist/{index-dsxrcseb.js → index-zktz242w.js} +2 -2
  55. package/dist/tools/cli/command-shape.d.ts +4 -0
  56. package/dist/tools/cli/command-shape.d.ts.map +1 -0
  57. package/dist/tools/cli/command.d.ts +2 -1
  58. package/dist/tools/cli/command.d.ts.map +1 -1
  59. package/dist/tools/cli/format.d.ts +5 -1
  60. package/dist/tools/cli/format.d.ts.map +1 -1
  61. package/dist/tools/cli/help.d.ts.map +1 -1
  62. package/dist/tools/cli/invoke.d.ts +1 -1
  63. package/dist/tools/cli/invoke.d.ts.map +1 -1
  64. package/dist/tools/cli/managed-surface.d.ts +3 -2
  65. package/dist/tools/cli/managed-surface.d.ts.map +1 -1
  66. package/dist/tools/cli/policy.d.ts +2 -0
  67. package/dist/tools/cli/policy.d.ts.map +1 -1
  68. package/dist/tools/cli/run-managed.d.ts.map +1 -1
  69. package/dist/tools/cli/run-native.d.ts.map +1 -1
  70. package/dist/tools/cli/session.d.ts +0 -1
  71. package/dist/tools/cli/session.d.ts.map +1 -1
  72. package/dist/tools/cli/unavailable.d.ts +10 -0
  73. package/dist/tools/cli/unavailable.d.ts.map +1 -0
  74. package/llms/cli.2.txt +282 -1
  75. package/llms/cli.txt +49 -287
  76. package/llms/server.4.txt +1 -1
  77. package/llms-full.txt +51 -8
  78. package/llms.txt +1 -1
  79. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGjD,OAAO,EAAE,KAAK,UAAU,EAAuB,MAAM,mBAAmB,CAAC;AAGzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,iBAAiB,CAAC,MAAM,SAAS,SAAS,CAAE,SAAQ,UAAU;IAC7E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,OAAO,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IACjC;;;;;OAKG;IACH,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,wBAAwB,CAAC,MAAM,SAAS,SAAS;IACh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,MAAM,CAMR;AAED,+EAA+E;AAC/E,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,oBAAoB,EAChC,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,QAAQ,CAAC,aAAa,CAAC,GAC/B,0BAA0B,CA6B5B;AAED,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,oBAAoB,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKzB;AAED,iFAAiF;AACjF,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,oBAAoB,EAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,UAAU,EACnB,UAAU,EAAE,OAAO,EACnB,OAAO,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM,GAC9C,OAAO,CAAC,UAAU,CAAC,CAoCrB"}
@@ -12,7 +12,7 @@
12
12
  * still parsing a success.
13
13
  */
14
14
  import type { ErrorHintFn } from '../execute-hooks.js';
15
- import type { ToolResult } from '../execute-result.js';
15
+ import type { ToolFailure, ToolResult } from '../execute-result.js';
16
16
  /** Map a `ToolResult.code` to a process exit code. */
17
17
  export type ExitCodeMap = Record<string, number>;
18
18
  /**
@@ -47,4 +47,8 @@ export interface EmitOptions {
47
47
  */
48
48
  export declare function cliExitCode(result: ToolResult, exitCodes?: ExitCodeMap): number;
49
49
  export declare function emitResult(result: ToolResult, writers: CliWriters, opts: EmitOptions): number;
50
+ /** A presentation failure cannot erase a successfully completed operation. */
51
+ export declare function emitPresentationFailure(result: Extract<ToolResult, {
52
+ ok: true;
53
+ }>, failure: ToolFailure, writers: CliWriters, opts: EmitOptions): number;
50
54
  //# sourceMappingURL=format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EA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C,kBAAkB,GAAE,SAAS,eAAe,EAAO,GAClD,MAAM,CA4ER"}
@@ -135,7 +135,7 @@ export declare function createCliInvoker<TAuth = unknown, TContext extends Recor
135
135
  * empty map — the uniqueness and shape checks have to see both halves, or a
136
136
  * managed command could silently shadow a native one.
137
137
  */
138
- export declare function buildCliSurface<TAuth, TContext extends Record<string, unknown>, TGlobals extends ZodObject>(config: CliInvokerConfig<TAuth, TContext, TGlobals>, auth: Awaited<TAuth> | undefined, nativeHelp: Map<string, CliCommandPresentation>, applicationGlobalNames: ReadonlySet<string>, assertShape?: (name: string, descriptor: CliCommandPresentation, exists: boolean, passthroughField: string | undefined, globalNames: ReadonlySet<string>) => void): {
138
+ export declare function buildCliSurface<TAuth, TContext extends Record<string, unknown>, TGlobals extends ZodObject>(config: CliInvokerConfig<TAuth, TContext, TGlobals>, auth: Awaited<TAuth> | undefined, nativeHelp: Map<string, CliCommandPresentation>, applicationGlobalNames: ReadonlySet<string>, shapeIssue?: (name: string, descriptor: CliCommandPresentation, exists: boolean, passthroughField: string | undefined, globalNames: ReadonlySet<string>) => string | undefined): {
139
139
  tools: Map<string, MountableTool>;
140
140
  help: Map<string, CliCommandPresentation>;
141
141
  };
@@ -1 +1 @@
1
- {"version":3,"file":"invoke.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/invoke.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,KAAK,UAAU,EAA4C,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAA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AAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAAC,UAAU,CAAC,CA6DrB;AAgED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EACL,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxC,QAAQ,SAAS,SAAS,EAE1B,MAAM,EAAE,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EACnD,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,SAAS,EAChC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,EAC/C,sBAAsB,EAAE,WAAW,CAAC,MAAM,CAAC,EAC3C,UAAU,CAAC,EAAE,CACX,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,sBAAsB,EAClC,MAAM,EAAE,OAAO,EACf,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,KAC7B,MAAM,GAAG,SAAS,GACtB;IAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAA;CAAE,CAmClF;AAED,mFAAmF;AACnF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,aAAa,GAClB,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,aAAa,CAAC,CAMzD"}
@@ -2,7 +2,7 @@ import type { ZodObject, z } from 'zod';
2
2
  import { type ToolResult } from '../execute-result.js';
3
3
  import type { MountableTool } from '../mount.js';
4
4
  import type { CliCommandPresentation } from './policy.js';
5
- import { type CliSession } from './session.js';
5
+ import type { CliSession } from './session.js';
6
6
  /**
7
7
  * The managed surface, or the reason there isn't one.
8
8
  *
@@ -11,7 +11,8 @@ import { type CliSession } from './session.js';
11
11
  * and it knows why the rest are missing. Letting the rejection escape printed
12
12
  * neither, and answering `Unknown command` would be a lie: the name is not
13
13
  * unknown, it is unresolvable. Only identity resolution is caught here; a
14
- * configuration fault in the surface itself is still a startup error.
14
+ * local configuration fault is still a startup error; runtime argv field
15
+ * conflicts remain discoverable as unavailable commands.
15
16
  */
16
17
  export type ManagedSurface<TAuth> = {
17
18
  resolved: true;
@@ -1 +1 @@
1
- {"version":3,"file":"managed-surface.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/managed-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,KAAK,UAAU,EAA4C,MAAM,mBAAmB,CAAC;AAC9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAEhE;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,CAAC,KAAK,IAC5B;IACE,QAAQ,EAAE,IAAI,CAAC;IACf,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IACjC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC1C,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CACnC,GACD;IACE,QAAQ,EAAE,KAAK,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE;QAAE,EAAE,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;CAC3C,CAAC;AAEN,wBAAsB,mBAAmB,CACvC,KAAK,EACL,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxC,QAAQ,SAAS,SAAS,EAE1B,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,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,CAAC,EAC9C,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAChC,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAuChC"}
@@ -9,6 +9,8 @@ export interface CliPresentationPolicyConfig {
9
9
  }
10
10
  export interface CliCommandPresentation {
11
11
  description: string;
12
+ /** An argv field conflict in a runtime catalogue entry; never executable. */
13
+ unavailableReason?: string;
12
14
  argumentSchema: Parameters<typeof describeSchemaFields>[0];
13
15
  presentationSchema: Record<string, unknown>;
14
16
  /** Canonical field name → one short alias. */
@@ -1 +1 @@
1
- {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/policy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,2BAA2B;IAC1C,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3E,6FAA6F;IAC7F,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,8CAA8C;IAC9C,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AAkFD,wBAAgB,0BAA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C,sBAAsB,EAAE,SAAS,GAAG,aAAa,CAAC,EACnE,MAAM,EAAE,2BAA2B,GAClC,sBAAsB,CAexB;AAED,wFAAwF;AACxF,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,EACrD,MAAM,EAAE,2BAA2B,GAClC,IAAI,CAWN"}
@@ -1 +1 @@
1
- {"version":3,"file":"run-managed.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/run-managed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAWrC,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAkB,MAAM,WAAW,CAAC;AAO3E,wFAAwF;AACxF,wBAAsB,oBAAoB,CACxC,KAAK,EACL,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxC,QAAQ,SAAS,SAAS,EAC1B,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAkC1F"}
1
+ {"version":3,"file":"run-managed.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/run-managed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAWrC,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAkB,MAAM,WAAW,CAAC;AAQ3E,wFAAwF;AACxF,wBAAsB,oBAAoB,CACxC,KAAK,EACL,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxC,QAAQ,SAAS,SAAS,EAC1B,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAkC1F"}
@@ -1 +1 @@
1
- {"version":3,"file":"run-native.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/run-native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAkB,MAAM,WAAW,CAAC;AAE3E;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EACL,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxC,QAAQ,SAAS,SAAS,EAE1B,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAC9C,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,EACzB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,IAAI,CAAC,CA+Df"}
1
+ {"version":3,"file":"run-native.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/run-native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAkB,MAAM,WAAW,CAAC;AAE3E;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EACL,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxC,QAAQ,SAAS,SAAS,EAE1B,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAC9C,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,EACzB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAyEf"}
@@ -10,7 +10,6 @@ import type { CliConfig } from './config.js';
10
10
  import { type EmitOptions } from './format.js';
11
11
  import type { CliIo } from './io.js';
12
12
  import { type CliCommandPresentation } from './policy.js';
13
- export declare function assertCommandShape(name: string, descriptor: CliCommandPresentation, exists: boolean, passthroughField?: string, applicationGlobals?: ReadonlySet<string>): void;
14
13
  export interface CliSession<TAuth, TContext extends Record<string, unknown>, TGlobals extends ZodObject> {
15
14
  config: CliConfig<TAuth, TContext, TGlobals>;
16
15
  io: CliIo;
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/session.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,+BAA+B,CAAC;AAIvF,OAAO,EAAE,KAAK,YAAY,EAAsC,MAAM,cAAc,CAAC;AAErF,OAAO,EAAE,KAAK,oBAAoB,EAAgC,MAAM,WAAW,CAAC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAA8B,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAYnF,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,sBAAsB,EAClC,MAAM,EAAE,OAAO,EACf,gBAAgB,CAAC,EAAE,MAAM,EACzB,kBAAkB,GAAE,WAAW,CAAC,MAAM,CAAa,GAClD,IAAI,CA4BN;AAED,MAAM,WAAW,UAAU,CACzB,KAAK,EACL,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxC,QAAQ,SAAS,SAAS;IAE1B,MAAM,EAAE,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,QAA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C,EACxC,QAAQ,SAAS,SAAS,EAE1B,MAAM,EAAE,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAC5C,EAAE,EAAE,KAAK,GACR,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAiDvC;AAED,MAAM,WAAW,QAAQ,CAAC,QAAQ,SAAS,SAAS;IAClD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjC,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EACL,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxC,QAAQ,SAAS,SAAS,EAE1B,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAC9C,IAAI,EAAE,MAAM,EAAE,GACb,QAAQ,CAAC,QAAQ,CAAC,GAAG,SAAS,CA4DhC;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAC5B,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,WAAW,GAAG,WAAW,CAAC,EAClD,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,MAAM,GACf,WAAW,CAOb"}
@@ -0,0 +1,10 @@
1
+ import { type ToolFailure } from '../execute-result.js';
2
+ /** One refusal for direct dispatch and a known, unavailable --wait target. */
3
+ export declare function unavailableCommand(reason: string): ToolFailure;
4
+ /**
5
+ * Choose only the error's format, without admitting arguments of a command that
6
+ * cannot run. Its availability refusal takes precedence over argument errors.
7
+ * Reuse the framework's token/boolean vocabulary; after -- everything is data.
8
+ */
9
+ export declare function unavailableCommandJson(argv: readonly string[]): boolean;
10
+ //# sourceMappingURL=unavailable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unavailable.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/unavailable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,mBAAmB,CAAC;AAI1E,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAQ9D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAYvE"}
package/llms/cli.2.txt CHANGED
@@ -11,6 +11,287 @@ Parts of this slice:
11
11
  # Guide: CLI (docs/guide/cli.md) (continued)
12
12
  ==============================================================================
13
13
 
14
+ ## Distribution and self-update
15
+
16
+ `createCli` ships no executable, and that is right — but the step after the
17
+ executable is not application logic either. It is the same problem for every
18
+ consumer, with the same three traps:
19
+
20
+ 1. **The installer cannot parse the manifest.** A `curl … | sh` runs on a
21
+ machine where nothing is installed yet, including `jq`. So the installer is
22
+ generated *from* the manifest, server-side, with the URL and digest already
23
+ substituted — it parses no JSON at all.
24
+ 2. **Replacing a running binary is a rename, not a write.** Anything else can
25
+ leave a half-written executable on someone's PATH when the connection drops.
26
+ 3. **The digest covers the decompressed bytes** — the file that will actually be
27
+ executed, not the archive that was transferred.
28
+
29
+ The framework owns the manifest shape, the installer generation and the update
30
+ primitive. The application owns where the assets live, which platforms it
31
+ publishes and who may download them.
32
+
33
+ ```ts
34
+ import {
35
+ CliBuildManifestSchema, assertCliPublishable, renderCliInstaller,
36
+ selectCliBuildAsset, checkCliUpdate, applyCliUpdate,
37
+ } from 'stitchkit/cli'
38
+
39
+ // Publishing: refuse to republish one version from a different commit —
40
+ // otherwise everyone who already installed it never receives the fix.
41
+ assertCliPublishable(previous, next)
42
+
43
+ // Serving: omit `asset` and one script covers every published target, selecting
44
+ // by uname at run time — otherwise that dispatch is the last hand-written piece
45
+ // of the install path, and every publisher writes the same x86_64 → x64 table.
46
+ renderCliInstaller({ manifest, binaryName: 'myapp' })
47
+ // Or pin one target explicitly:
48
+ renderCliInstaller({ manifest, asset: selectCliBuildAsset(manifest, target), binaryName: 'myapp' })
49
+
50
+ // Checking: bounded, at most once per interval, silent on any failure.
51
+ const check = await checkCliUpdate({ manifestUrl, currentVersion, lastCheckedAt })
52
+ if (check.status === 'outdated' && check.asset) {
53
+ // Replacing is always an explicit command, never a side effect of a check.
54
+ await applyCliUpdate({ asset: check.asset })
55
+ }
56
+ ```
57
+
58
+ `checkCliUpdate` has **four** answers, not three: `skipped`, `current`,
59
+ `outdated` and `unknown`. "Could not ask" is not "up to date" — collapsing them
60
+ is how a tool goes quiet about its own staleness for months. It never throws,
61
+ and a command still exits with the code it earned.
62
+
63
+ Carry the build stamp inside the binary (`CliBuildStampSchema`,
64
+ `formatCliBuildStamp`) so the tool can say what it is rather than leaving the
65
+ reader to infer it from behaviour.
66
+
67
+ #### A manifest inside your own network
68
+
69
+ The check goes through the same SSRF boundary every outbound fetch does, so a
70
+ manifest served from `10.x`, `localhost` or a `.internal` name is refused and
71
+ the answer is `unknown`. For a self-hosted deployment that is a wrong answer
72
+ dressed as a careful one, and the refusal says so — it names the field that
73
+ lifts it rather than reading like a timeout:
74
+
75
+ ```text
76
+ refusing to fetch an internal host — the manifest endpoint is not public.
77
+ Set `allowPrivateHosts` if it is your own deployment; the download keeps its
78
+ own setting, because an asset URL comes from the document.
79
+ ```
80
+
81
+ ```ts
82
+ const check = await checkCliUpdate({ manifestUrl, currentVersion, allowPrivateHosts: true })
83
+ ```
84
+
85
+ Set it from whether **your** endpoint is private, not as a blanket switch, and
86
+ leave `applyCliUpdate` at its default. The two are not the same decision: the
87
+ manifest URL is configuration you wrote, while an asset URL arrives inside a
88
+ document the endpoint served, and a document is exactly what an SSRF boundary
89
+ exists to distrust.
90
+
91
+ ### Publishing a complete version
92
+
93
+ `publishCli` is an opt-in publisher for a local application-owned distribution
94
+ directory. It commits every target and its version manifest before atomically
95
+ replacing the public `manifest.json`. It ships from its own evolving entrypoint,
96
+ `stitchkit/cli/publish`: release infrastructure follows how distributions are
97
+ published, so it is not held to the stable promise of `stitchkit/cli`
98
+ ([ADR 0245](../decisions/0245-cli-publication-is-an-evolving-leaf.md)). The
99
+ manifest, signatures, installer and updater it writes for stay in
100
+ `stitchkit/cli`. Your application selects the CLI source identity and admits
101
+ that snapshot at each phase:
102
+
103
+ ```ts
104
+ import { publishCli } from 'stitchkit/cli/publish'
105
+
106
+ const result = await publishCli({
107
+ storageRoot: '/srv/myapp/cli',
108
+ name: 'myapp', version: cliVersion, commit: selectedCliCommit,
109
+ baseUrl: 'https://downloads.example.com/cli/',
110
+ targets: [{ platform: 'linux', arch: 'x64' }],
111
+ signal,
112
+ admit: ({ phase, identity, signal }) => assertSelectedSource({ phase, identity, signal }),
113
+ build: ({ target, stamp, signal }) => compileSelectedSource({ target, stamp, signal }),
114
+ })
115
+ // result.outcome: 'published' | 'existing'; result.manifest is ready to serve.
116
+ ```
117
+
118
+ The builder returns `Uint8Array` or `ReadableStream<Uint8Array>` containing the
119
+ executable. Every target receives the same immutable `{ version, commit,
120
+ builtAt }` stamp; carry it inside the binary. The publisher owns staging,
121
+ gzip assets, paths and manifests. Callbacks receive the cancellation signal and
122
+ run under the publication lock. Admission phases are `prepare`, each target's
123
+ `build`, `commit`, and `promote`; validate the selected source through commit
124
+ and promotion. A backend release can explicitly select an unchanged older CLI
125
+ identity. The helper never substitutes a different commit or rebuilds an
126
+ existing version under a new identity.
127
+
128
+ Assets live at `<version>/<name>-<platform>-<arch>.gz`, with an immutable
129
+ `<version>/manifest.json` and a public `manifest.json`. A verified repeat keeps
130
+ the exact bytes and `builtAt`, requires the same target set and base URL, and
131
+ returns `existing` without invoking the builder. A version committed before a
132
+ failed promotion is recovered and promoted without rebuilding. Conflicting
133
+ same-version commits, downgrades, unsafe components, corrupt manifests and
134
+ assets are refused. Version/name/target components are validated before any
135
+ build; `storageRoot` is absolute and its existing parent must be trusted.
136
+
137
+ All limits are finite positive safe integers; `limits` overrides these defaults:
138
+
139
+ | Field | Default | Enforced boundary |
140
+ | --- | --- | --- |
141
+ | `maxTargets` | 16 | Requested and verified target count |
142
+ | `maxManifestBytes` | 256 KiB | Read and written manifest bytes |
143
+ | `maxAssetBytes` | 256 MiB | Builder and decompressed executable bytes |
144
+ | `maxCompressedBytes` | 256 MiB | Archived asset bytes |
145
+ | `maxDirectoryEntries` | 128 | Version layout, root scan and commit space |
146
+ | `maxStoredVersions` | 16 | Verified publisher-owned history |
147
+ | `lockTimeoutMs` | 10,000 | Wait to acquire the lock |
148
+ | `timeoutMs` | 600,000 | Whole publication deadline |
149
+
150
+ `retention` defaults to 2 and keeps the current and previous published versions.
151
+ It must be at least 2 and less than `maxStoredVersions` (at least 3), leaving a
152
+ recovery slot. Older versions are pruned only after their own identity, exact
153
+ layout, raw size and digest are verified. Runtime folders and foreign semver
154
+ directories remain untouched. A full or unverifiable store refuses further
155
+ publication; repeated completed candidates stay inside the owned history cap.
156
+ Cancelled or failed incomplete staging is removed only while its root and
157
+ directory generations still match. The shared asynchronous gzip decoder also
158
+ bounds updater expansion by the declared raw size and configured byte cap.
159
+
160
+ The publisher rejects symlink roots/versions/assets, non-regular files and
161
+ multiply linked files, and checks held-lock, root and prior-pointer generations
162
+ before commit and promotion. This is cooperative publication under a trusted
163
+ parent directory. Portable path checks do not provide an atomic comparison with
164
+ a hostile process replacing ancestors between syscalls. Durability uses file
165
+ and directory sync on POSIX; Windows publication is refused. A deadline stops
166
+ callback/stream waits and blocks late promotion; trusted callbacks remain
167
+ responsible for cancelling their own subprocesses and external effects.
168
+
169
+ A failure after an immutable commit reports that the publication outcome must
170
+ be checked. A failure after public-pointer rename may already have published;
171
+ `AtomicFilePublicationError.published` remains available when the atomic writer
172
+ reports that boundary. Read the durable manifest and retry the admitted same
173
+ identity to recover; an error does not promise rollback. Optional `signing` and
174
+ `trust` reuse the Ed25519 contract below. The generated shell installer checks
175
+ raw digest and size; the updater checks manifest authorship when given a trust
176
+ root.
177
+
178
+ ### Proving who built it — signing the manifest
179
+
180
+ The asset digest proves the bytes that arrived are the bytes the manifest named.
181
+ It proves nothing about who named them: the manifest and the assets come from
182
+ one origin, so whoever can replace one can replace the other. Authorship needs a
183
+ key the build carries and the server never holds.
184
+
185
+ ```ts
186
+ // Publishing — the only side that holds a private key.
187
+ const signature = signCliManifest(manifest, { keyId: 'release-2026', privateKey })
188
+ publish({ ...manifest, signature })
189
+
190
+ // Installing — the trust root is compiled into the binary. One fetched at run
191
+ // time from the same origin as the manifest would prove nothing.
192
+ const trust = { keys: { 'release-2026': PUBLISHED_KEY } }
193
+ const check = await checkCliUpdate({ manifestUrl, currentVersion, trust })
194
+ if (check.status === 'outdated' && check.asset) {
195
+ await applyCliUpdate({ asset: check.asset, manifest: check.manifest, trust, backupPath })
196
+ }
197
+ ```
198
+
199
+ The signature covers `{name, version, commit, builtAt, assets[]}` with **every
200
+ asset's digest**, so the chain closes on the file that will execute rather than
201
+ on the document describing it; moving an asset to a new URL does not invalidate
202
+ it, changing what an asset contains does.
203
+
204
+ Five verdicts, and `unenforced` is the one that earns its keep: a build with no
205
+ pinned key keeps updating, and the fact that nothing was checked is *visible*
206
+ rather than assumed. `missing`, `unknown-key` and `invalid` are distinguished
207
+ because they need different answers — a key you forgot to pin is not a forged
208
+ signature.
209
+
210
+ A bad verdict does not produce a fifth status. `outdated` is an instruction to
211
+ install, and a manifest that failed its signature has not established that there
212
+ is a newer build worth installing — only that a document claims one. The check
213
+ answers `unknown` with the verdict in its reason, so it is never mistaken for a
214
+ network failure. `applyCliUpdate` checks again and refuses **before** the
215
+ download: a signature verified after the bytes are on the machine produces a
216
+ cleanup problem rather than a refusal.
217
+
218
+ ### A way back — `backupPath` and `rollbackCliUpdate`
219
+
220
+ Rolling back is a property of updating, not of the application:
221
+
222
+ ```ts
223
+ const applied = await applyCliUpdate({ asset, targetPath, backupPath })
224
+ // …the new build turns out to be wrong. `backupSha256` is absent when there was
225
+ // nothing to keep — a first install — and that is the case with nothing to roll
226
+ // back to:
227
+ if (applied.backupSha256) {
228
+ rollbackCliUpdate({ targetPath, backupPath, expectedSha256: applied.backupSha256 })
229
+ }
230
+ ```
231
+
232
+ The copy is taken between "the new bytes verified" and the replacement — earlier
233
+ would preserve a binary about to be replaced by a download that then failed its
234
+ digest, later has nothing left to copy — and it carries the target's file mode,
235
+ because a backup that cannot be executed is not a way back. A first install has
236
+ nothing to keep, which is not a failure.
237
+
238
+ `expectedSha256` is required, not optional. A rollback that installs whatever
239
+ happens to be at the backup path is a second install of an unverified binary,
240
+ and the day it is used is the day nobody is in a position to check.
241
+
242
+ ### Run it before it replaces anything — `verify`
243
+
244
+ A digest proves the bytes are the ones published, not that they load. A tool
245
+ that updates itself unattended — a daemon — and installs a build that does not
246
+ start takes its own updater down with it, and every machine is then repaired by
247
+ hand. `verify` is the step between "digest matched" and "target replaced":
248
+
249
+ ```ts
250
+ await applyCliUpdate({
251
+ asset, targetPath, backupPath,
252
+ verify: async (candidate, signal) => {
253
+ const child = Bun.spawn(['bun', candidate, 'version'], { signal, stdout: 'pipe' })
254
+ const printed = (await new Response(child.stdout).text()).trim()
255
+ if ((await child.exited) !== 0 || printed !== check.version) {
256
+ throw new Error(`printed ${printed}, expected ${check.version}`)
257
+ }
258
+ },
259
+ verifyTimeoutMs: 15_000, // default 30 000
260
+ })
261
+ ```
262
+
263
+ The verified bytes are written beside the target as an executable candidate
264
+ with the target's extension, and `verify` gets its path — a path rather than a
265
+ command, because a JavaScript bundle is started through its runtime. It runs
266
+ before the backup and the replacement. If it throws or outlives
267
+ `verifyTimeoutMs` (its `signal` aborts at the deadline), the candidate is
268
+ removed, the target and any earlier backup are untouched, and the update is
269
+ refused with the reason as its cause. The target is written from the checked
270
+ bytes in memory, never from the candidate file, so nothing the candidate did
271
+ while it ran can change what is installed.
272
+
273
+ ### Two release tracks
274
+
275
+ `assertCliPublishable` takes one manifest **or every manifest already
276
+ published**:
277
+
278
+ ```ts
279
+ assertCliPublishable([stableManifest, betaManifest], next)
280
+ ```
281
+
282
+ With a single argument and two tracks the check is silently useless: `1.2.3`
283
+ goes to beta from one commit and to stable from another, the function is called
284
+ with the track being published and sees no conflict, and the person who
285
+ installed the beta is told they are current forever. Nothing on their machine
286
+ looks wrong.
287
+
288
+ **The channel itself is not an argument of the framework, and will not become
289
+ one.** The framework has no model of how your URLs are built and should not: an
290
+ asset's address comes from the manifest, and the manifest's address belongs to
291
+ your server. A channel is two documents at two addresses — which of them a build
292
+ consults is your decision, and `assertCliPublishable` is told about all of them
293
+ rather than taught the shape of any.
294
+
14
295
  ## One operation per line — `createCliInvoker`
15
296
 
16
297
  The most common way an agent drives a CLI is not one command: it is a stream —
@@ -290,7 +571,7 @@ SDK nor the `ai` peer.
290
571
 
291
572
  | Export | Kind | Summary |
292
573
  |--------|------|---------|
293
- | `createCli` | function | build and run a CLI from contracts — [guide](../guide/cli.md) |
574
+ | `createCli` | function | build and run a CLI from contracts; a runtime catalogue field conflicting with reserved/global argv options disables only that entry, retained in help with its reason; invocation returns `CLI_COMMAND_UNAVAILABLE` before side effects — [guide](../guide/cli.md#when-one-runtime-command-cannot-be-represented-in-argv) |
294
575
  | `defineCliCommand` | function | define one Zod-typed CLI-only executable command with optional validated-result presentation/exit policy |
295
576
  | `parseCliArgs` | function | argv → typed tool args against a schema; inline `--field:=JSON` assigns a whole JSON value, including null, while ordinary string flags remain lexical; named array options together with bare positionals require an explicit `positionals` policy (advanced) |
296
577
  | `routeCliArgv` | function | select the command out of argv without duplicating the global-option grammar (advanced) |