stitchkit 0.124.5 → 0.125.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 (52) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
  3. package/dist/entrypoints/agent-runtime/harness.js +4 -4
  4. package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
  5. package/dist/entrypoints/agent-runtime/sqlite/bun.js +5 -5
  6. package/dist/entrypoints/agent-runtime/sqlite/node.js +5 -5
  7. package/dist/entrypoints/agent-runtime/testing.js +5 -5
  8. package/dist/entrypoints/agent-runtime.js +11 -11
  9. package/dist/entrypoints/cli.js +6 -6
  10. package/dist/entrypoints/testing.js +1 -1
  11. package/dist/entrypoints/tools/agent.js +6 -6
  12. package/dist/entrypoints/tools/connections.js +2 -2
  13. package/dist/entrypoints/tools/invoker.js +4 -4
  14. package/dist/entrypoints/tools/mcp.js +6 -6
  15. package/dist/entrypoints/tools/toolkit.js +8 -8
  16. package/dist/entrypoints/tools.js +7 -7
  17. package/dist/{index-afc3mtah.js → index-0sg3wnzr.js} +1 -1
  18. package/dist/{index-cm07qz01.js → index-1v3k5zgx.js} +1 -1
  19. package/dist/{index-x68eyh6y.js → index-7cn66qdk.js} +2 -2
  20. package/dist/{index-6fmg17bg.js → index-8wzhmgpa.js} +1 -1
  21. package/dist/{index-xaem29dc.js → index-a3z56mtn.js} +1 -1
  22. package/dist/{index-en2xqhty.js → index-cj5f0x4y.js} +1 -1
  23. package/dist/{index-z2z67tnv.js → index-cvjddnvd.js} +3 -3
  24. package/dist/{index-3n8k175r.js → index-fgzbc06j.js} +4 -4
  25. package/dist/{index-q7s1yr9g.js → index-kxff9e9w.js} +3 -3
  26. package/dist/{index-r7v5xz0g.js → index-m0wsfmrc.js} +1 -1
  27. package/dist/{index-2ds89z96.js → index-n6hvd1r2.js} +4 -4
  28. package/dist/{index-p9saezh1.js → index-r8swbw1x.js} +1 -1
  29. package/dist/{index-p1mwqkgh.js → index-v7rbjatr.js} +122 -113
  30. package/dist/{index-rk7m4j7r.js → index-x2d51zay.js} +9 -10
  31. package/dist/{index-1wz4y15d.js → index-x2rvpbtj.js} +1 -1
  32. package/dist/tools/cli/args-route.d.ts +10 -1
  33. package/dist/tools/cli/args-route.d.ts.map +1 -1
  34. package/dist/tools/cli/args.d.ts.map +1 -1
  35. package/dist/tools/cli/command-shape.d.ts +4 -0
  36. package/dist/tools/cli/command-shape.d.ts.map +1 -1
  37. package/dist/tools/cli/managed-surface.d.ts.map +1 -1
  38. package/dist/tools/cli/run-managed.d.ts.map +1 -1
  39. package/dist/tools/cli/session.d.ts +1 -1
  40. package/dist/tools/cli/session.d.ts.map +1 -1
  41. package/dist/tools/cli/stream-surface.d.ts +6 -1
  42. package/dist/tools/cli/stream-surface.d.ts.map +1 -1
  43. package/dist/tools/internal/surface-projector.d.ts +2 -0
  44. package/dist/tools/internal/surface-projector.d.ts.map +1 -1
  45. package/llms/cli.2.txt +1 -1
  46. package/llms/cli.txt +27 -0
  47. package/llms/stitchkit.txt +3 -3
  48. package/llms/{upgrading-0.106.0-0.124.0.txt → upgrading-0.106.0-0.125.0.txt} +26 -3
  49. package/llms/upgrading.txt +1 -1
  50. package/llms-full.txt +54 -4
  51. package/llms.txt +2 -2
  52. package/package.json +1 -1
@@ -2,11 +2,11 @@ import {
2
2
  toolResultFromError,
3
3
  toolCauseFromResult,
4
4
  isToolExecutionControlError2
5
- } from "./index-1wz4y15d.js";
5
+ } from "./index-x2rvpbtj.js";
6
6
  import {
7
7
  createToolRunner,
8
8
  formatToolError
9
- } from "./index-x68eyh6y.js";
9
+ } from "./index-7cn66qdk.js";
10
10
  import {
11
11
  resolveRuntimeToolCall
12
12
  } from "./index-eh71zr32.js";
@@ -15,10 +15,10 @@ import {
15
15
  } from "./index-1psbyyhj.js";
16
16
  import {
17
17
  collectToolSurface
18
- } from "./index-q7s1yr9g.js";
18
+ } from "./index-kxff9e9w.js";
19
19
  import {
20
20
  agentPresenterOf
21
- } from "./index-r7v5xz0g.js";
21
+ } from "./index-m0wsfmrc.js";
22
22
  import {
23
23
  isRecord
24
24
  } from "./index-hkxgennw.js";
@@ -17,7 +17,7 @@ import {
17
17
  replaceMessage,
18
18
  ArchiveSpillSchema,
19
19
  createAgentRuntimeStore2
20
- } from "./index-afc3mtah.js";
20
+ } from "./index-0sg3wnzr.js";
21
21
 
22
22
  // src/agent-runtime/store-memory.ts
23
23
  import { z as z2 } from "zod";
@@ -18,16 +18,17 @@ import {
18
18
  mergeSchemas,
19
19
  toToolName,
20
20
  assertUniqueToolName,
21
- buildToolPresentationSchema
22
- } from "./index-rk7m4j7r.js";
21
+ buildToolPresentationSchema,
22
+ projectedContractToolName
23
+ } from "./index-x2d51zay.js";
23
24
  import {
24
25
  toolResultFromError,
25
26
  toolErrorFromResult
26
- } from "./index-1wz4y15d.js";
27
+ } from "./index-x2rvpbtj.js";
27
28
  import {
28
29
  createToolRunner,
29
30
  formatToolError
30
- } from "./index-x68eyh6y.js";
31
+ } from "./index-7cn66qdk.js";
31
32
  import {
32
33
  isRepeatableRead
33
34
  } from "./index-332d0m9g.js";
@@ -54,7 +55,7 @@ import {
54
55
  } from "./index-9cxxfkhb.js";
55
56
  import {
56
57
  collectToolSurface
57
- } from "./index-q7s1yr9g.js";
58
+ } from "./index-kxff9e9w.js";
58
59
  import {
59
60
  fetchGuarded,
60
61
  readCapped
@@ -646,15 +647,21 @@ function assertCliPoliciesResolved(commands, config) {
646
647
  }
647
648
 
648
649
  // src/tools/cli/stream-surface.ts
650
+ function cliStreamIdentity(serviceName, methodName, method) {
651
+ if (!method.stream || !method.expose?.includes("CLI"))
652
+ return;
653
+ return { name: toToolName(serviceName, methodName), descriptor: method.stream };
654
+ }
649
655
  function collectCliStreams(services) {
650
656
  const streams = new Map;
651
657
  for (const service of services) {
652
658
  for (const [methodName, method] of Object.entries(service.methods)) {
653
- if (method.stream === undefined || !method.expose?.includes("CLI"))
659
+ const identity = cliStreamIdentity(service.name, methodName, method);
660
+ if (identity === undefined)
654
661
  continue;
655
- const name = toToolName(service.name, methodName);
662
+ const { name, descriptor } = identity;
656
663
  streams.set(name, {
657
- descriptor: method.stream,
664
+ descriptor,
658
665
  tool: {
659
666
  method,
660
667
  name,
@@ -978,19 +985,39 @@ function classifyLongOptionToken(token) {
978
985
  };
979
986
  }
980
987
  function readCliBooleanFlag(argv, name) {
988
+ const request = name === "help" || name === "schema";
981
989
  for (const [index, token] of argv.entries()) {
982
990
  if (token === "--")
983
991
  break;
984
992
  if (token === undefined)
985
993
  continue;
994
+ if (name === "help" && token === "-h")
995
+ return true;
986
996
  const option = classifyLongOptionToken(token);
987
997
  if (option?.name !== name || option.globalKind !== "boolean")
988
998
  continue;
989
- return option.value === undefined ? separateBoolValue(argv[index + 1]) ?? true : isReservedBoolWord(option.value) && parseReservedBool(name, option.value);
999
+ const enabled = option.value === undefined ? separateBoolValue(argv[index + 1]) ?? true : isReservedBoolWord(option.value) && parseReservedBool(name, option.value);
1000
+ if (enabled || !request)
1001
+ return enabled;
990
1002
  }
991
1003
  return false;
992
1004
  }
1005
+ function preserveCliBooleanBoundary(prefix, next) {
1006
+ if (separateBoolValue(next) === undefined)
1007
+ return;
1008
+ const last = prefix.at(-1);
1009
+ const option = last === undefined ? undefined : classifyLongOptionToken(last);
1010
+ if (option?.globalKind === "boolean" && !option.inline) {
1011
+ prefix[prefix.length - 1] = last === "--help" ? "-h" : `${last}=true`;
1012
+ }
1013
+ }
993
1014
  var HELP_TOKENS = new Set(["--help", "-h", "help"]);
1015
+ function isCliVersionToken(token) {
1016
+ return token === "--version" || token === "version";
1017
+ }
1018
+ function isReservedCliCommandName(name) {
1019
+ return name === "--" || HELP_TOKENS.has(name) || isCliVersionToken(name) || classifyLongOptionToken(name)?.globalKind !== undefined;
1020
+ }
994
1021
  function helpFilterFrom(token, rest) {
995
1022
  if (token?.startsWith("--help=")) {
996
1023
  const value = token.slice("--help=".length).trim();
@@ -1003,34 +1030,50 @@ function helpFilterFrom(token, rest) {
1003
1030
  const next = rest[0];
1004
1031
  return next !== undefined && !next.startsWith("-") ? next : undefined;
1005
1032
  }
1033
+ function isTopHelpOption(token) {
1034
+ return token === "--help" || token === "-h" || token.startsWith("--help=") && !isReservedBoolWord(token.slice("--help=".length));
1035
+ }
1036
+ function leadingGlobalCount(argv, hasDefault) {
1037
+ let index = 0;
1038
+ while (index < argv.length) {
1039
+ const token = argv[index];
1040
+ if (token === undefined || isTopHelpOption(token))
1041
+ break;
1042
+ const option = classifyLongOptionToken(token);
1043
+ if (!option?.globalKind)
1044
+ break;
1045
+ index++;
1046
+ if (option.inline)
1047
+ continue;
1048
+ const value = argv[index];
1049
+ if (value === undefined)
1050
+ break;
1051
+ if (option.globalKind === "boolean") {
1052
+ if (separateBoolValue(value) !== undefined)
1053
+ index++;
1054
+ } else {
1055
+ if (value === "--" || value === "--help" || value === "-h" || value === "--version" || hasDefault && value === "version") {
1056
+ break;
1057
+ }
1058
+ if (hasDefault || !classifyLongOptionToken(value)?.globalKind)
1059
+ index++;
1060
+ }
1061
+ }
1062
+ return index;
1063
+ }
1006
1064
  function routeCliArgv2(argv, defaultCommand) {
1007
- if (defaultCommand === undefined) {
1008
- const [command, ...commandArgv] = argv;
1009
- const helpFilter = helpFilterFrom(command, commandArgv);
1065
+ const index = leadingGlobalCount(argv, defaultCommand !== undefined);
1066
+ const token = argv[index];
1067
+ if (token === "--" && (index > 0 || defaultCommand !== undefined)) {
1010
1068
  return {
1011
- command,
1012
- commandArgv,
1069
+ commandArgv: [],
1013
1070
  topLevelHelp: false,
1014
1071
  version: false,
1015
- ...helpFilter !== undefined && { helpFilter }
1072
+ error: 'A command is required before "--"'
1016
1073
  };
1017
1074
  }
1018
- const globals = [];
1019
- let index = 0;
1020
- while (index < argv.length) {
1021
- const token = argv[index];
1022
- if (token === undefined)
1023
- break;
1024
- if (token === "--") {
1025
- return {
1026
- commandArgv: [],
1027
- topLevelHelp: false,
1028
- version: false,
1029
- error: 'A command is required before "--"'
1030
- };
1031
- }
1032
- const inlineHelpFilter = token.startsWith("--help=") && !isReservedBoolWord(token.slice("--help=".length));
1033
- if (token === "--help" || token === "-h" || inlineHelpFilter) {
1075
+ if (defaultCommand !== undefined) {
1076
+ if (token !== undefined && isTopHelpOption(token)) {
1034
1077
  const helpFilter = helpFilterFrom(token, argv.slice(index + 1));
1035
1078
  return {
1036
1079
  commandArgv: [],
@@ -1039,80 +1082,30 @@ function routeCliArgv2(argv, defaultCommand) {
1039
1082
  ...helpFilter !== undefined && { helpFilter }
1040
1083
  };
1041
1084
  }
1042
- if (token === "--version" || token === "version") {
1085
+ if (isCliVersionToken(token)) {
1043
1086
  return { commandArgv: [], topLevelHelp: false, version: true };
1044
1087
  }
1045
- if (!token.startsWith("-") || token === "-") {
1046
- return {
1047
- command: token,
1048
- commandArgv: [...globals, ...argv.slice(index + 1)],
1049
- topLevelHelp: false,
1050
- version: false
1051
- };
1052
- }
1053
- if (!token.startsWith("--")) {
1088
+ if (token === undefined || token.startsWith("-") && token !== "-") {
1054
1089
  return {
1055
1090
  command: defaultCommand,
1056
- commandArgv: [...globals, ...argv.slice(index)],
1091
+ commandArgv: argv.slice(),
1057
1092
  topLevelHelp: false,
1058
1093
  version: false
1059
1094
  };
1060
1095
  }
1061
- const option = classifyLongOptionToken(token);
1062
- if (!option) {
1063
- return {
1064
- command: defaultCommand,
1065
- commandArgv: [...globals, ...argv.slice(index)],
1066
- topLevelHelp: false,
1067
- version: false
1068
- };
1069
- }
1070
- if (option.globalKind === "boolean") {
1071
- globals.push(token);
1072
- index += 1;
1073
- const next = argv[index];
1074
- if (option.value === undefined && next !== undefined && separateBoolValue(next) !== undefined) {
1075
- globals.push(next);
1076
- index += 1;
1077
- }
1078
- continue;
1079
- }
1080
- if (option.globalKind === "value") {
1081
- globals.push(token);
1082
- if (!option.inline) {
1083
- const value = argv[index + 1];
1084
- if (value === "--help" || value === "-h") {
1085
- const helpFilter = helpFilterFrom(value, argv.slice(index + 2));
1086
- return {
1087
- commandArgv: [],
1088
- topLevelHelp: true,
1089
- version: false,
1090
- ...helpFilter !== undefined && { helpFilter }
1091
- };
1092
- }
1093
- if (value === "--version" || value === "version") {
1094
- return { commandArgv: [], topLevelHelp: false, version: true };
1095
- }
1096
- if (value !== undefined)
1097
- globals.push(value);
1098
- index += value === undefined ? 1 : 2;
1099
- } else {
1100
- index += 1;
1101
- }
1102
- continue;
1103
- }
1104
- return {
1105
- command: defaultCommand,
1106
- commandArgv: [...globals, ...argv.slice(index)],
1107
- topLevelHelp: false,
1108
- version: false
1109
- };
1110
1096
  }
1097
+ const commandIndex = token === undefined ? 0 : index;
1098
+ const command = argv[commandIndex];
1099
+ const rest = argv.slice(commandIndex + 1);
1100
+ const prefix = argv.slice(0, commandIndex);
1101
+ preserveCliBooleanBoundary(prefix, rest[0]);
1102
+ const helpFilter = commandIndex > 0 || defaultCommand === undefined ? helpFilterFrom(command, rest) : undefined;
1111
1103
  return {
1112
- command: defaultCommand,
1113
- commandArgv: globals,
1104
+ command,
1105
+ commandArgv: prefix.concat(rest),
1114
1106
  topLevelHelp: false,
1115
- version: false
1107
+ version: false,
1108
+ ...helpFilter !== undefined && { helpFilter }
1116
1109
  };
1117
1110
  }
1118
1111
 
@@ -1539,11 +1532,27 @@ function renderCommandHelp(name, command, descriptor, applicationOptions = []) {
1539
1532
  }
1540
1533
 
1541
1534
  // src/tools/cli/command-shape.ts
1535
+ function assertCliCommandName(name) {
1536
+ if (isReservedCliCommandName(name)) {
1537
+ throw new Error(`[stitchkit] CLI command "${name}" is reserved. Rename the command to a word outside the framework option syntax.`);
1538
+ }
1539
+ }
1540
+ function assertStaticCliCommandNames(services, runtimeTools) {
1541
+ for (const tool of runtimeTools) {
1542
+ if (tool.transports?.includes("CLI"))
1543
+ assertCliCommandName(tool.name);
1544
+ }
1545
+ for (const service of services) {
1546
+ for (const [key, method] of Object.entries(service.methods)) {
1547
+ const name = projectedContractToolName(service.name, key, method, "CLI") ?? cliStreamIdentity(service.name, key, method)?.name;
1548
+ if (name !== undefined)
1549
+ assertCliCommandName(name);
1550
+ }
1551
+ }
1552
+ }
1542
1553
  function commandShapeIssue(name, descriptor, exists, passthroughField, applicationGlobals = new Set) {
1543
1554
  assertUniqueToolName(name, exists, "CLI command");
1544
- if (name === "help" || name === "version") {
1545
- throw new Error(`[stitchkit] CLI command "${name}" is reserved`);
1546
- }
1555
+ assertCliCommandName(name);
1547
1556
  if (passthroughField !== undefined && descriptor.aliases.has(passthroughField)) {
1548
1557
  throw new Error(`[stitchkit] CLI command "${name}" cannot alias passthrough field "${passthroughField}"`);
1549
1558
  }
@@ -1566,9 +1575,8 @@ async function buildManagedSurface(session, typedGlobals, forExecution) {
1566
1575
  authPromise ??= (async () => config.resolveAuth ? await config.resolveAuth(typedGlobals) : await config.auth)();
1567
1576
  return authPromise;
1568
1577
  };
1569
- const dynamicSurface = typeof config.services === "function" || typeof config.runtimeTools === "function";
1570
1578
  let auth;
1571
- if (dynamicSurface || forExecution) {
1579
+ if (session.hasManagedFactory || forExecution) {
1572
1580
  try {
1573
1581
  auth = await resolveIdentity();
1574
1582
  } catch (error) {
@@ -1986,6 +1994,7 @@ function extractCliGlobalOptions2(argv, schema) {
1986
1994
  }
1987
1995
  }
1988
1996
  appendCliFieldValue(raw, jsonFields, field.name, value, info, field.json);
1997
+ preserveCliBooleanBoundary(rest, argv[i + 1]);
1989
1998
  }
1990
1999
  const args = {};
1991
2000
  for (const [name, values] of raw) {
@@ -2104,6 +2113,7 @@ function createCliSession(config, io) {
2104
2113
  }
2105
2114
  const nativeCommands = new Map;
2106
2115
  const nativeHelp = new Map;
2116
+ assertStaticCliCommandNames(typeof config.services === "function" ? [] : config.services ?? [], typeof config.runtimeTools === "function" ? [] : config.runtimeTools ?? []);
2107
2117
  for (const definition of config.commands ?? []) {
2108
2118
  const descriptor = applyCliPresentationPolicy(definition.name, nativeDescriptor(definition), config);
2109
2119
  const issue = commandShapeIssue(definition.name, descriptor, nativeCommands.has(definition.name), config.passthrough?.[definition.name], applicationGlobalNames);
@@ -2118,7 +2128,8 @@ function createCliSession(config, io) {
2118
2128
  applicationOptions,
2119
2129
  applicationGlobalNames,
2120
2130
  nativeCommands,
2121
- nativeHelp
2131
+ nativeHelp,
2132
+ hasManagedFactory: typeof config.services === "function" || typeof config.runtimeTools === "function"
2122
2133
  };
2123
2134
  }
2124
2135
  function resolveCliRoute(session, argv) {
@@ -2147,28 +2158,26 @@ function resolveCliRoute(session, argv) {
2147
2158
  return;
2148
2159
  }
2149
2160
  const { command, commandArgv } = route;
2150
- if (route.version || command === "--version" || command === "version") {
2161
+ if (config.defaultCommand === undefined && session.hasManagedFactory && command !== undefined && command !== routableArgv[0] && session.nativeCommands.has(command)) {
2162
+ stderr(`Managed command names are unknown before native dispatch. Put "${config.name} ${command}" first and keep options with their values. ` + `If moving a bare boolean flag next to positional true or false, spell the flag explicitly (for example, --dry-run=true).
2163
+ `);
2164
+ exit(2);
2165
+ return;
2166
+ }
2167
+ if (route.version || isCliVersionToken(command)) {
2151
2168
  stdout(`${config.name} ${config.version}
2152
2169
  `);
2153
2170
  exit(0);
2154
2171
  return;
2155
2172
  }
2156
- const beforeSeparator = commandArgv.indexOf("--") === -1 ? commandArgv : commandArgv.slice(0, commandArgv.indexOf("--"));
2157
- const asked = (name) => beforeSeparator.some((token) => {
2158
- if (token === `--${name}` || name === "help" && token === "-h")
2159
- return true;
2160
- const option = classifyLongOptionToken(token);
2161
- return option?.name === name && option.value !== undefined && isReservedBoolWord(option.value) && parseReservedBool(name, option.value);
2162
- });
2163
- const helpRequested = asked("help");
2164
- const schemaRequested = !helpRequested && asked("schema");
2173
+ const helpRequested = readCliBooleanFlag(commandArgv, "help");
2174
+ const schemaRequested = !helpRequested && readCliBooleanFlag(commandArgv, "schema");
2165
2175
  return {
2166
2176
  globals,
2167
2177
  typedGlobals,
2168
2178
  route,
2169
2179
  command,
2170
2180
  commandArgv,
2171
- beforeSeparator,
2172
2181
  quiet: readCliBooleanFlag(route.topLevelHelp ? routableArgv : commandArgv, "quiet"),
2173
2182
  helpRequested,
2174
2183
  schemaRequested
@@ -2543,13 +2552,13 @@ async function pollUntilDone2(params) {
2543
2552
  async function runManagedInvocation(session, route) {
2544
2553
  const { config } = session;
2545
2554
  const { stdout, stderr, exit } = session.io;
2546
- const { command, helpRequested, schemaRequested, beforeSeparator } = route;
2555
+ const { command, helpRequested, schemaRequested } = route;
2547
2556
  const topLevelHelp = route.route.topLevelHelp || command === undefined || command === "help" || command === "--help" || command === "-h" || command.startsWith("--help=") && !isReservedBoolWord(command.slice("--help=".length));
2548
2557
  const managed = await buildManagedSurface(session, route.typedGlobals, !topLevelHelp && !helpRequested && !schemaRequested);
2549
2558
  if (topLevelHelp)
2550
2559
  return respondTopLevelHelp(session, route, managed);
2551
2560
  if (!managed.resolved) {
2552
- return exit(emitResult2(managed.failure, { stdout, stderr }, emitOptionsFor(config, beforeSeparator.includes("--json"), command ?? config.name)));
2561
+ return exit(emitResult2(managed.failure, { stdout, stderr }, emitOptionsFor(config, readCliBooleanFlag(route.commandArgv, "json"), command ?? config.name)));
2553
2562
  }
2554
2563
  return runManagedCommand(session, route, command, managed);
2555
2564
  }
@@ -1039,6 +1039,12 @@ function assertProjectedName(name, serviceName, action, transport, derived) {
1039
1039
  }
1040
1040
  assertToolName(name, serviceName, action);
1041
1041
  }
1042
+ function projectedContractToolName(serviceName, methodName, method, transport) {
1043
+ const exposed = method.expose?.includes(transport) ?? transport !== "CLI";
1044
+ if (!exposed || isHttpOnlyEndpoint(method))
1045
+ return;
1046
+ return method.toolName ?? toToolName(serviceName, methodName);
1047
+ }
1042
1048
  function projectToolSurface(surface, transport, config = {}) {
1043
1049
  const projected = [];
1044
1050
  const names = new Set;
@@ -1058,16 +1064,9 @@ function projectToolSurface(surface, transport, config = {}) {
1058
1064
  };
1059
1065
  for (const service of surface.services ?? []) {
1060
1066
  for (const [methodName, method] of Object.entries(service.methods)) {
1061
- if (transport === "CLI") {
1062
- if (!method.expose?.includes("CLI"))
1063
- continue;
1064
- } else if (method.expose && !method.expose.includes(transport)) {
1067
+ const name = projectedContractToolName(service.name, methodName, method, transport);
1068
+ if (name === undefined)
1065
1069
  continue;
1066
- }
1067
- if (isHttpOnlyEndpoint(method)) {
1068
- continue;
1069
- }
1070
- const name = method.toolName ?? toToolName(service.name, methodName);
1071
1070
  if (config.assertNames ?? true) {
1072
1071
  assertProjectedName(name, service.name, methodName, transport, !method.toolName);
1073
1072
  }
@@ -1216,4 +1215,4 @@ function prepareProjectedMcpTools(tools, config = {}) {
1216
1215
  return prepared;
1217
1216
  }
1218
1217
 
1219
- export { toolSurfaceOutputSchema, applyToolViewDefaults, projectToolView, objectShapeKeys, rebuildObject, mergeSchemas, staticInputRounds, validateMcpRoundPolicy, validateResolvedInputRounds, assertToolName, toToolName, assertUniqueToolName, PORTABLE_JSON_SCHEMA_FORMATS2, findNonPortableFormats2, flattenToolJsonSchema2, buildToolPresentationSchema, presentationMetadata, findUntypedProperties2, assertToolExtensionCompatible, projectRuntimeTool, projectToolSurface, mcpProjectionCandidate, prepareProjectedMcpTools };
1218
+ export { toolSurfaceOutputSchema, applyToolViewDefaults, projectToolView, objectShapeKeys, rebuildObject, mergeSchemas, staticInputRounds, validateMcpRoundPolicy, validateResolvedInputRounds, assertToolName, toToolName, assertUniqueToolName, PORTABLE_JSON_SCHEMA_FORMATS2, findNonPortableFormats2, flattenToolJsonSchema2, buildToolPresentationSchema, presentationMetadata, findUntypedProperties2, assertToolExtensionCompatible, projectRuntimeTool, projectedContractToolName, projectToolSurface, mcpProjectionCandidate, prepareProjectedMcpTools };
@@ -12,7 +12,7 @@ import {
12
12
  applyToolViewDefaults,
13
13
  projectToolView,
14
14
  objectShapeKeys
15
- } from "./index-rk7m4j7r.js";
15
+ } from "./index-x2d51zay.js";
16
16
  import {
17
17
  runWithRequestContext2,
18
18
  getRequestContext2
@@ -29,8 +29,10 @@ export interface CliLongOptionToken {
29
29
  }
30
30
  /** One source of truth for long-option token shape and framework-global ownership. */
31
31
  export declare function classifyLongOptionToken(token: string): CliLongOptionToken | undefined;
32
- /** Read a reserved boolean for presentation before command arguments can be validated. */
32
+ /** Read a setting before validation. Any enabled help or schema request takes precedence. */
33
33
  export declare function readCliBooleanFlag(argv: readonly string[], name: string): boolean;
34
+ /** Removing an intervening token cannot make a positional true/false a flag's value. */
35
+ export declare function preserveCliBooleanBoundary(prefix: string[], next: string | undefined): void;
34
36
  export interface CliArgvRoute {
35
37
  command?: string;
36
38
  commandArgv: string[];
@@ -40,5 +42,12 @@ export interface CliArgvRoute {
40
42
  helpFilter?: string;
41
43
  error?: string;
42
44
  }
45
+ export declare function isCliVersionToken(token: string | undefined): boolean;
46
+ /** Exact shell tokens owned by the framework, including inline option values. */
47
+ export declare function isReservedCliCommandName(name: string): boolean;
48
+ /**
49
+ * Route recognised leading globals to the explicit command. A CLI with a default
50
+ * also routes a global-only invocation and command-local leading flags to that default.
51
+ */
43
52
  export declare function routeCliArgv(argv: string[], defaultCommand?: string): CliArgvRoute;
44
53
  //# sourceMappingURL=args-route.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"args-route.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/args-route.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD;AAWD,eAAO,MAAM,YAAY,aAA6D,CAAC;AAEvF,eAAO,MAAM,oBAAoB,aAA+C,CAAC;AAEjF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CAClC;AAED,sFAAsF;AACtF,wBAAgB,uBAAuB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ool-declaration.js';
1
3
  import type { CliCommandPresentation } from './policy.js';
4
+ /** Check already-declared shell names before a native handler can run. */
5
+ export declare function assertStaticCliCommandNames(services: readonly ServiceDef[], runtimeTools: readonly RuntimeToolDefinition[]): void;
2
6
  /** Local configuration faults throw; only argv field conflicts become unavailable. */
3
7
  export declare function commandShapeIssue(name: string, descriptor: CliCommandPresentation, exists: boolean, passthroughField?: string, applicationGlobals?: ReadonlySet<string>): string | undefined;
4
8
  //# sourceMappingURL=command-shape.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-shape.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/command-shape.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,sFAAsF;AACtF,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,sBAAsB,EAClC,MAAM,EAAE,OAAO,EACf,gBAAgB,CAAC,EAAE,MAAM,EACzB,kBAAkB,GAAE,WAAW,CAAC,MAAM,CAAa,GAClD,MAAM,GAAG,SAAS,CAwBpB"}
1
+ {"version":3,"file":"command-shape.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/command-shape.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAWvD,0EAA0E;AAC1E,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,SAAS,UAAU,EAAE,EAC/B,YAAY,EAAE,SAAS,qBAAqB,EAAE,GAC7C,IAAI,CAYN;AAED,sFAAsF;AACtF,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,sBAAsB,EAClC,MAAM,EAAE,OAAO,EACf,gBAAgB,CAAC,EAAE,MAAM,EACzB,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ACvC,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,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAChC,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAqChC"}
@@ -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;AAgBrC,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,UAAU,EAGhB,MAAM,WAAW,CAAC;AAQnB,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;AAgBrC,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,UAAU,EAGhB,MAAM,WAAW,CAAC;AAQnB,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,CAsC1F"}
@@ -17,6 +17,7 @@ export interface CliSession<TAuth, TContext extends Record<string, unknown>, TGl
17
17
  applicationGlobalNames: Set<string>;
18
18
  nativeCommands: Map<string, CliCommandDefinition>;
19
19
  nativeHelp: Map<string, CliCommandPresentation>;
20
+ hasManagedFactory: boolean;
20
21
  }
21
22
  /** Startup: everything that is a configuration fault throws here, before argv is read. */
22
23
  export declare function createCliSession<TAuth, TContext extends Record<string, unknown>, TGlobals extends ZodObject>(config: CliConfig<TAuth, TContext, TGlobals>, io: CliIo): CliSession<TAuth, TContext, TGlobals>;
@@ -26,7 +27,6 @@ export interface CliRoute<TGlobals extends ZodObject> {
26
27
  route: CliArgvRoute;
27
28
  command: string | undefined;
28
29
  commandArgv: string[];
29
- beforeSeparator: string[];
30
30
  quiet: boolean;
31
31
  helpRequested: boolean;
32
32
  /** `--schema` — answered like help: before identity, validation and the call. */
@@ -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;AAExC,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EACL,KAAK,YAAY,EAKlB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,oBAAoB,EAAgC,MAAM,WAAW,CAAC;AAEpF,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;AAanF,MAAM,WAAW,UAAU,CACzB,KAAK,EACL,QAAQ,SAAS,MAAM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AE,MAAM,EACf,UAAU,EAAE,sBAAsB,GACjC,MAAM,CAcR;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"}
@@ -1,11 +1,16 @@
1
1
  import type { EndpointStreamDescriptor } from '../../contract/define.js';
2
- import type { ServiceDef } from '../../server/types.js';
2
+ import type { MethodDef, ServiceDef } from '../../server/types.js';
3
3
  import type { MountableTool } from '../mount.js';
4
4
  /** One contract stream exposed as a command: how it is called and what it yields. */
5
5
  export interface CliStreamOperation {
6
6
  tool: MountableTool;
7
7
  descriptor: EndpointStreamDescriptor;
8
8
  }
9
+ /** Read the shell name of a CLI stream without materialising its schemas. */
10
+ export declare function cliStreamIdentity(serviceName: string, methodName: string, method: MethodDef): {
11
+ name: string;
12
+ descriptor: EndpointStreamDescriptor;
13
+ } | undefined;
9
14
  /**
10
15
  * The contract streams a CLI carries, by command name.
11
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"stream-surface.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/stream-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAK9C,qFAAqF;AACrF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,wBAAwB,CAAC;CACtC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,SAAS,UAAU,EAAE,GAC9B,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAuBjC"}
1
+ {"version":3,"file":"stream-surface.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/stream-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAK9C,qFAAqF;AACrF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,wBAAwB,CAAC;CACtC;AAED,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS;;;cAG3F;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,SAAS,UAAU,EAAE,GAC9B,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAwBjC"}
@@ -70,6 +70,8 @@ export type ProjectedTool<TRuntime extends SurfaceRuntimeToolDefinition = Surfac
70
70
  */
71
71
  export declare function projectRuntimeTool<TRuntime extends SurfaceRuntimeToolDefinition>(definition: TRuntime, assertName?: boolean): ProjectedRuntimeTool<TRuntime>;
72
72
  export declare function projectedRuntimeToolSupports(definition: SurfaceRuntimeToolDefinition, transport: ToolTransport): boolean;
73
+ /** The exposed name can be inspected before building its argument or presentation schema. */
74
+ export declare function projectedContractToolName(serviceName: string, methodName: string, method: MethodDef, transport: ToolTransport): string | undefined;
73
75
  /** Canonical name/exposure/presentation projection shared by mounts and manifests. */
74
76
  export declare function projectToolSurface<TRuntime extends SurfaceRuntimeToolDefinition>(surface: ToolSurfaceProjection<TRuntime>, transport: ToolTransport, config?: ToolPresentationProjectionConfig): ProjectedTool<TRuntime>[];
75
77
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"surface-projector.d.ts","sourceRoot":"","sources":["../../../src/tools/internal/surface-projector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,S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vB,YAAY,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,WAAW,wBAAwB,CAAC,KAAK;IAC7C,IAAI,EAAE,KAAK,CAAC;IACZ,WAAW,EAAE,sBAAsB,CAAC;IACpC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,SAAS,4BAA4B,EAClF,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,GAC5B,sBAAsB,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CA6BjD;AAeD,0EAA0E;AAC1E,wBAAgB,wBAAwB,CAAC,KAAK,EAC5C,KAAK,EAAE,SAAS,sBAAsB,CAAC,KAAK,CAAC,EAAE,EAC/C,MAAM,GAAE,8BAAmC,GAC1C,wBAAwB,CAAC,KAAK,CAAC,EAAE,CA8GnC"}
package/llms/cli.2.txt CHANGED
@@ -682,7 +682,7 @@ SDK nor the `ai` peer.
682
682
  | `defineCliCommand` | function | define one Zod-typed CLI-only executable command with optional validated-result presentation/exit policy |
683
683
  | `defineCliResult` | function | type a managed command's `present` / `exitCode` policy against its output schema, for `CliConfig.results` — [guide](../guide/cli.md#the-same-policy-for-a-managed-command) |
684
684
  | `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) |
685
- | `routeCliArgv` | function | select the command out of argv without duplicating the global-option grammar (advanced) |
685
+ | `routeCliArgv` | function | select the command using the framework's option grammar before catalogue discovery. `createCli` also checks declared names and offline native dispatch — [guide](../guide/cli.md#global-flags) |
686
686
  | `extractCliGlobalOptions` | function | lift the application's own global options out of argv before routing (advanced) |
687
687
  | `coerceJsonArgs` | function | the second half of `parseCliArgs` — parse array/object values a consumer sends itself, including discovered MCP object guards restored from JSON Schema, without the `stitchkit/tools` barrel |
688
688
  | `CliArgumentError` | class | the refusal `parseCliArgs` and the view flags raise; a CLI reports it and exits `2` |