@hop-top/kit 0.5.0-alpha.0 → 0.5.0-alpha.10

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 (284) hide show
  1. package/CHANGELOG.md +262 -0
  2. package/LICENSE +1 -1
  3. package/LICENSE-cobra.txt +174 -0
  4. package/NOTICE +15 -0
  5. package/README.md +55 -259
  6. package/dist/aim-DZHwwiIc.d.ts +139 -0
  7. package/dist/aim.d.ts +1 -116
  8. package/dist/aim.js +13 -414
  9. package/dist/alias-D9_qFlyP.d.ts +174 -0
  10. package/dist/alias.d.ts +2 -73
  11. package/dist/alias.js +27 -207
  12. package/dist/api-DAexsu2H.d.ts +77 -0
  13. package/dist/api.d.ts +1 -62
  14. package/dist/api.js +10 -164
  15. package/dist/auth-2-jfgiHn.d.ts +34 -0
  16. package/dist/auth.d.ts +1 -26
  17. package/dist/auth.js +6 -40
  18. package/dist/chunk-2JV3A7OP.js +1894 -0
  19. package/dist/chunk-3FIKGFKI.js +54 -0
  20. package/dist/chunk-4UE5TCMQ.js +104 -0
  21. package/dist/chunk-6HFAEZ52.js +29 -0
  22. package/dist/chunk-6SVOHNIC.js +17 -0
  23. package/dist/chunk-72XZWQX7.js +504 -0
  24. package/dist/chunk-ABQSE7AI.js +513 -0
  25. package/dist/chunk-BDNNPRX6.js +41 -0
  26. package/dist/chunk-BLS2OBIQ.js +263 -0
  27. package/dist/chunk-BRNEKPWX.js +37 -0
  28. package/dist/chunk-CSJWB6D3.js +151 -0
  29. package/dist/chunk-GGWJRWWA.js +309 -0
  30. package/dist/chunk-GHPJJV5L.js +613 -0
  31. package/dist/chunk-IXVQ62NZ.js +334 -0
  32. package/dist/chunk-JKMQSAJP.js +174 -0
  33. package/dist/chunk-JZ22ZUFA.js +1131 -0
  34. package/dist/chunk-K7VCKJ27.js +814 -0
  35. package/dist/chunk-KVG7YCTS.js +115 -0
  36. package/dist/chunk-L23O2FFE.js +51 -0
  37. package/dist/chunk-MQXYDYRD.js +968 -0
  38. package/dist/chunk-MUIQVU6E.js +251 -0
  39. package/dist/chunk-NLMS7HGP.js +178 -0
  40. package/dist/chunk-POR5L2DG.js +247 -0
  41. package/dist/chunk-PSFYJGDG.js +1445 -0
  42. package/dist/chunk-QJVSKKRQ.js +369 -0
  43. package/dist/chunk-QPUCXQXT.js +67 -0
  44. package/dist/chunk-QQQYCWSC.js +240 -0
  45. package/dist/chunk-R5U7XKVJ.js +16 -0
  46. package/dist/chunk-SNVGDYX7.js +187 -0
  47. package/dist/chunk-T46YPHKN.js +669 -0
  48. package/dist/chunk-UKZIAQA7.js +26 -0
  49. package/dist/chunk-WBVO43HU.js +355 -0
  50. package/dist/chunk-WUOAQVOA.js +86 -0
  51. package/dist/chunk-WWUKGJB5.js +90 -0
  52. package/dist/chunk-XJTRY453.js +868 -0
  53. package/dist/chunk-YGYQUFGY.js +219 -0
  54. package/dist/chunk-YOBAUCVN.js +583 -0
  55. package/dist/cli-C5B5tnpA.d.ts +400 -0
  56. package/dist/cli.d.ts +7 -309
  57. package/dist/cli.js +70 -885
  58. package/dist/completion-csVun6SP.d.ts +112 -0
  59. package/dist/completion-values-By-mnjNt.d.ts +142 -0
  60. package/dist/completion-values.d.ts +1 -0
  61. package/dist/completion-values.js +29 -0
  62. package/dist/completion.d.ts +3 -0
  63. package/dist/completion.js +34 -0
  64. package/dist/compliance-AxFf-uMy.d.ts +60 -0
  65. package/dist/compliance.d.ts +1 -0
  66. package/dist/compliance.js +17 -0
  67. package/dist/config-CaK60ByQ.d.ts +241 -0
  68. package/dist/config.d.ts +1 -97
  69. package/dist/config.js +8 -78
  70. package/dist/errcorrect-BcX1Ft0K.d.ts +44 -0
  71. package/dist/errcorrect.d.ts +1 -37
  72. package/dist/errcorrect.js +8 -68
  73. package/dist/error-Do8Qji43.d.ts +231 -0
  74. package/dist/id/index.d.ts +2 -83
  75. package/dist/id/index.js +14 -65
  76. package/dist/index-BKJZClJx.d.ts +1486 -0
  77. package/dist/index-C3Zw4wDJ.d.ts +359 -0
  78. package/dist/index-DCe1boBz.d.ts +328 -0
  79. package/dist/index-VLDcI5NF.d.ts +95 -0
  80. package/dist/index.d.ts +37 -0
  81. package/dist/index.js +132 -0
  82. package/dist/llm-DYuR7_uX.d.ts +1069 -0
  83. package/dist/llm-anthropic-Cd_I2xXB.d.ts +67 -0
  84. package/dist/llm-anthropic.d.ts +2 -0
  85. package/dist/llm-anthropic.js +13 -0
  86. package/dist/llm-openai-DyFrucmV.d.ts +87 -0
  87. package/dist/llm-openai.d.ts +2 -0
  88. package/dist/llm-openai.js +19 -0
  89. package/dist/llm.d.ts +1 -188
  90. package/dist/llm.js +101 -356
  91. package/dist/log-CkaxMX3U.d.ts +115 -0
  92. package/dist/log.d.ts +2 -0
  93. package/dist/log.js +14 -0
  94. package/dist/mcp/index.d.ts +4 -0
  95. package/dist/mcp/index.js +184 -0
  96. package/dist/netpolicy-Brx5XZUB.d.ts +151 -0
  97. package/dist/netpolicy.d.ts +1 -0
  98. package/dist/netpolicy.js +25 -0
  99. package/dist/output-CjZWmL8s.d.ts +420 -0
  100. package/dist/output.d.ts +3 -213
  101. package/dist/output.js +137 -447
  102. package/dist/parity-CvMuYcVI.d.ts +61 -0
  103. package/dist/progress-CAzyxeWl.d.ts +38 -0
  104. package/dist/progress.d.ts +1 -30
  105. package/dist/progress.js +6 -55
  106. package/dist/provenance-SMFHm5gx.d.ts +30 -0
  107. package/dist/provenance.d.ts +1 -24
  108. package/dist/provenance.js +6 -31
  109. package/dist/routellm-B0nv59mH.d.ts +111 -0
  110. package/dist/routellm.d.ts +2 -64
  111. package/dist/routellm.js +13 -255
  112. package/dist/rpc-D31Lg0Kc.d.ts +32 -0
  113. package/dist/rpc.d.ts +2 -25
  114. package/dist/rpc.js +4 -98
  115. package/dist/safety-CUaYEjZc.d.ts +30 -0
  116. package/dist/safety.d.ts +1 -24
  117. package/dist/safety.js +6 -43
  118. package/dist/scope-BrhYB4ij.d.ts +141 -0
  119. package/dist/scope.d.ts +1 -121
  120. package/dist/scope.js +20 -377
  121. package/dist/serve-D8yWMrTc.d.ts +646 -0
  122. package/dist/serve.d.ts +3 -0
  123. package/dist/serve.js +75 -0
  124. package/dist/sqlstore.js +6 -39
  125. package/dist/stream-CrjeCp0M.d.ts +44 -0
  126. package/dist/stream.d.ts +1 -35
  127. package/dist/stream.js +8 -51
  128. package/dist/telemetry/index.d.ts +1 -315
  129. package/dist/telemetry/index.js +26 -599
  130. package/dist/toolspec-DcPwwoAZ.d.ts +368 -0
  131. package/dist/toolspec.d.ts +2 -0
  132. package/dist/toolspec.js +37 -0
  133. package/dist/tui/index.d.ts +6 -298
  134. package/dist/tui/index.js +18 -322
  135. package/dist/upgrade-p_zh3pvV.d.ts +102 -0
  136. package/dist/upgrade.d.ts +1 -95
  137. package/dist/upgrade.js +6 -114
  138. package/dist/xdg-DB7Shoib.d.ts +179 -0
  139. package/dist/xdg.d.ts +1 -169
  140. package/dist/xdg.js +14 -128
  141. package/package.json +236 -46
  142. package/src/README.md +15 -0
  143. package/src/alias.conformance.test.ts +250 -0
  144. package/src/alias.test.ts +206 -2
  145. package/src/alias.ts +196 -21
  146. package/src/cli.help-command.test.ts +105 -0
  147. package/src/cli.offline.test.ts +93 -0
  148. package/src/cli.parity.test.ts +192 -0
  149. package/src/cli.test.ts +95 -1
  150. package/src/cli.ts +195 -25
  151. package/src/completion-scripts.ts +16 -0
  152. package/src/completion-values.test.ts +76 -16
  153. package/src/completion-values.ts +170 -66
  154. package/src/completion.conformance.test.ts +297 -0
  155. package/src/completion.test.ts +256 -145
  156. package/src/completion.ts +767 -121
  157. package/src/compliance.test.ts +196 -2
  158. package/src/compliance.ts +440 -20
  159. package/src/config-merge.test.ts +425 -0
  160. package/src/config.test.ts +228 -1
  161. package/src/config.ts +429 -16
  162. package/src/gen/crud_pb.ts +7 -7
  163. package/src/id/README.md +38 -0
  164. package/src/id/contract.test.ts +1 -1
  165. package/src/id/index.test.ts +1 -1
  166. package/src/id/index.ts +3 -2
  167. package/src/index.test.ts +71 -0
  168. package/src/index.ts +46 -0
  169. package/src/llm-anthropic.conformance.test.ts +1135 -0
  170. package/src/llm-anthropic.test.ts +152 -0
  171. package/src/llm-anthropic.ts +940 -0
  172. package/src/llm-choice-hermetic.test.ts +335 -0
  173. package/src/llm-config.test.ts +232 -0
  174. package/src/llm-config.ts +106 -0
  175. package/src/llm-endpoint.ts +254 -0
  176. package/src/llm-error.ts +17 -0
  177. package/src/llm-errors.ts +152 -0
  178. package/src/llm-file.ts +126 -0
  179. package/src/llm-http.ts +317 -0
  180. package/src/llm-keys.ts +167 -0
  181. package/src/llm-media.conformance.test.ts +87 -0
  182. package/src/llm-media.test.ts +279 -0
  183. package/src/llm-media.ts +322 -0
  184. package/src/llm-openai.conformance.test.ts +407 -0
  185. package/src/llm-openai.test.ts +510 -0
  186. package/src/llm-openai.ts +708 -0
  187. package/src/llm-payload.ts +155 -0
  188. package/src/llm-quote.ts +46 -0
  189. package/src/llm-routellm.conformance.test.ts +44 -0
  190. package/src/llm-toolnames.conformance.test.ts +112 -0
  191. package/src/llm-toolnames.test.ts +132 -0
  192. package/src/llm-toolnames.ts +298 -0
  193. package/src/llm-uri.ts +99 -0
  194. package/src/llm.test.ts +43 -15
  195. package/src/llm.toolcall.test.ts +175 -0
  196. package/src/llm.ts +602 -190
  197. package/src/log.parity.test.ts +105 -0
  198. package/src/log.test.ts +270 -1
  199. package/src/log.ts +228 -49
  200. package/src/mcp/README.md +63 -0
  201. package/src/mcp/args-separator.test.ts +164 -0
  202. package/src/mcp/args.test.ts +223 -0
  203. package/src/mcp/args.ts +160 -0
  204. package/src/mcp/audit.test.ts +520 -0
  205. package/src/mcp/audit.ts +70 -0
  206. package/src/mcp/bridge.test.ts +222 -0
  207. package/src/mcp/bridge.ts +291 -0
  208. package/src/mcp/conformance.test.ts +357 -0
  209. package/src/mcp/dispatch.ts +359 -0
  210. package/src/mcp/identity.test.ts +166 -0
  211. package/src/mcp/identity.ts +72 -0
  212. package/src/mcp/index.ts +176 -0
  213. package/src/mcp/legacy-notify.test.ts +59 -0
  214. package/src/mcp/legacy.ts +367 -0
  215. package/src/mcp/mcp.test.ts +707 -0
  216. package/src/mcp/modern-confirm.test.ts +520 -0
  217. package/src/mcp/modern-confirm.ts +484 -0
  218. package/src/mcp/modern.ts +788 -0
  219. package/src/mcp/stdio.test.ts +313 -0
  220. package/src/mcp/stdio.ts +254 -0
  221. package/src/mcp/tasks.ts +82 -0
  222. package/src/mcp/testtree.ts +250 -0
  223. package/src/mcp/toolname.test.ts +147 -0
  224. package/src/mcp/types.ts +689 -0
  225. package/src/netpolicy.test.ts +280 -0
  226. package/src/netpolicy.ts +256 -0
  227. package/src/output/README.md +46 -0
  228. package/src/output/builtins.ts +5 -5
  229. package/src/output/dispatch.ts +10 -2
  230. package/src/output/error.ts +459 -0
  231. package/src/output/formatter.ts +29 -5
  232. package/src/output/formatters/README.md +50 -0
  233. package/src/output/formatters/csv.ts +48 -12
  234. package/src/output/formatters/json.ts +4 -25
  235. package/src/output/formatters/project.ts +34 -0
  236. package/src/output/formatters/table.ts +8 -6
  237. package/src/output/formatters/text.ts +7 -3
  238. package/src/output/formatters/yaml.ts +5 -22
  239. package/src/output/projection.test.ts +298 -0
  240. package/src/output/projection.ts +33 -59
  241. package/src/output/template.ts +11 -21
  242. package/src/output.surface.test.ts +41 -0
  243. package/src/output.ts +64 -3
  244. package/src/published-types.test.ts +133 -0
  245. package/src/routellm.test.ts +209 -28
  246. package/src/routellm.toolcall.test.ts +521 -0
  247. package/src/routellm.ts +213 -177
  248. package/src/router/README.md +44 -0
  249. package/src/router/server.test.ts +41 -0
  250. package/src/router/server.ts +11 -0
  251. package/src/safety.test.ts +19 -9
  252. package/src/scope-defaults.json +29 -29
  253. package/src/serve.test.ts +1257 -0
  254. package/src/serve.ts +1665 -0
  255. package/src/telemetry/README.md +48 -0
  256. package/src/telemetry/client.test.ts +31 -0
  257. package/src/telemetry/client.ts +12 -6
  258. package/src/telemetry/offline.test.ts +64 -0
  259. package/src/toolspec-internal.ts +279 -0
  260. package/src/toolspec-manifest.test.ts +167 -0
  261. package/src/toolspec-manifest.ts +410 -0
  262. package/src/toolspec-spec-schemas.ts +12 -0
  263. package/src/toolspec-spec.test.ts +273 -0
  264. package/src/toolspec-spec.ts +458 -0
  265. package/src/toolspec.from-command.test.ts +350 -0
  266. package/src/toolspec.test.ts +2 -2
  267. package/src/toolspec.ts +222 -0
  268. package/src/triton/README.md +34 -0
  269. package/src/tui/README.md +42 -0
  270. package/src/tui/parity.test.ts +142 -0
  271. package/src/tui/parity.ts +59 -13
  272. package/src/wizard.test.ts +7 -7
  273. package/test/llm/conformance-helpers.ts +100 -0
  274. package/test/output/csv.test.ts +164 -0
  275. package/test/output/dispatch.test.ts +1 -2
  276. package/test/output/error.test.ts +277 -0
  277. package/test/output/smoke-capture.ts +2 -2
  278. package/test/output/smoke.test.ts +2 -2
  279. package/test/output/taxonomy-contract.test.ts +148 -0
  280. package/test/setup-env.ts +16 -0
  281. package/test/toolspec/fixture.ts +79 -0
  282. package/tsconfig.json +3 -1
  283. package/tsconfig.test.json +10 -0
  284. package/vitest.config.ts +9 -0
@@ -0,0 +1,368 @@
1
+ import { Command as Command$1 } from 'commander';
2
+
3
+ /**
4
+ * Port of Go's `toolspec.Manifest` and `BuildManifest`
5
+ * (go/ai/toolspec/spec.go, go/ai/toolspec/cli/spec_command.go): the
6
+ * flat, snake_case capability manifest a `<tool> spec` command emits,
7
+ * projected from a commander tree carrying kit/* annotations.
8
+ *
9
+ * Byte parity with Go is pinned by
10
+ * sdk/tests/cross-lang/fixtures/toolspec-manifest*.json.
11
+ */
12
+
13
+ /** Env var a harness sets to request a manifest schema version. */
14
+ declare const SCHEMA_VERSION_ENV = "KIT_TOOLSPEC_SCHEMA";
15
+ /**
16
+ * Newest manifest schema version kit emits. 1.1 added per-command
17
+ * fields; 1.2 adds per-flag `required` and `choices` and per-argument
18
+ * `variadic`. Each is additive over the one before.
19
+ */
20
+ declare const LATEST_SCHEMA_VERSION = "1.2";
21
+ /** Value side_effect / idempotent carry when nothing was declared. */
22
+ declare const SIDE_EFFECT_UNKNOWN = "unknown";
23
+ declare const IDEMPOTENT_UNKNOWN = "unknown";
24
+ interface ManifestArg {
25
+ name: string;
26
+ required?: boolean;
27
+ /** Schema 1.2: a kit/args `name...` entry, always the last argument. */
28
+ variadic?: boolean;
29
+ }
30
+ interface ManifestFlag {
31
+ name: string;
32
+ short?: string;
33
+ type?: string;
34
+ description?: string;
35
+ default?: string;
36
+ since_version?: string;
37
+ /** Schema 1.2: commander makeOptionMandatory (cobra MarkFlagRequired). */
38
+ required?: boolean;
39
+ /** Schema 1.2: commander `.choices()` (kit WithFlagEnum), in order. */
40
+ choices?: string[];
41
+ }
42
+ interface ManifestExample {
43
+ title: string;
44
+ command: string;
45
+ output?: string;
46
+ }
47
+ interface ManifestNextStep {
48
+ when?: string;
49
+ suggest: string;
50
+ reason?: string;
51
+ }
52
+ /** One invocable command. Field order is the Go struct order. */
53
+ interface ManifestCommand {
54
+ path: string[];
55
+ short: string;
56
+ side_effect: string;
57
+ idempotent: string;
58
+ args?: ManifestArg[];
59
+ flags?: ManifestFlag[];
60
+ exit_codes?: string[];
61
+ deprecated?: boolean;
62
+ deprecated_since?: string;
63
+ removal_target?: string;
64
+ since_version?: string;
65
+ long?: string;
66
+ retryable: boolean;
67
+ /** Raw JSON Schema text, embedded verbatim (Go RawJSON). */
68
+ output_schema?: string;
69
+ output_schema_version?: string;
70
+ examples?: ManifestExample[];
71
+ next_steps?: ManifestNextStep[];
72
+ top_level_verb?: boolean;
73
+ hierarchical?: boolean;
74
+ passthrough?: boolean;
75
+ destructive_token_required?: boolean;
76
+ dry_run_supported: boolean;
77
+ dry_run_rationale?: string;
78
+ reserved?: boolean;
79
+ hidden?: boolean;
80
+ }
81
+ interface Manifest {
82
+ tool: string;
83
+ version: string;
84
+ schema_version: string;
85
+ commands: ManifestCommand[];
86
+ }
87
+ interface BuildManifestOptions {
88
+ /** Include deprecated commands (Go --include-deprecated). */
89
+ includeDeprecated?: boolean;
90
+ /** Depth-1 verbs the tool reserves (Go Root.IsReserved). */
91
+ reserved?: Iterable<string>;
92
+ /**
93
+ * The command being executed, if any. It gets the -h/--help flag
94
+ * cobra adds to the executing command, as a live Go run lists.
95
+ */
96
+ invokedCommand?: Command$1;
97
+ }
98
+ /**
99
+ * Resolve the emitted schema_version (Go NegotiateSchemaVersion):
100
+ * declared is a floor; a well-formed request raises it to the highest
101
+ * known version not above the request; nothing is ever refused.
102
+ */
103
+ declare function negotiateSchemaVersion(declared: string, requested: string): string;
104
+ /**
105
+ * Project a commander tree into the Go-shaped Manifest (Go
106
+ * BuildManifest). Lists every runnable command except framework
107
+ * builtins (help, completion, man) and, unless includeDeprecated,
108
+ * deprecated ones; hidden and reserved commands stay listed and say
109
+ * so. Children are visited in name order and flags sorted by name,
110
+ * as cobra and pflag do by default.
111
+ */
112
+ declare function buildManifest(program: Command$1, schemaVersion: string, opts?: BuildManifestOptions): Manifest;
113
+ /**
114
+ * Render a Manifest exactly as Go's `output.Render(w, "json", m)`:
115
+ * two-space indent, HTML-escaped strings, trailing newline, fields
116
+ * in Go struct order with omitempty applied.
117
+ */
118
+ declare function renderManifestJSON(m: Manifest): string;
119
+
120
+ /**
121
+ * Port of Go's `<tool> spec` subcommand and `spec coverage`
122
+ * (go/ai/toolspec/cli/spec_command.go, coverage.go,
123
+ * coverage_command.go). Output bytes for json / kit-manifest are
124
+ * pinned against Go by sdk/tests/cross-lang/fixtures/toolspec-spec*.json.
125
+ */
126
+
127
+ /** Annotation marking kit's spec subcommands (Go specCommandAnnotation). */
128
+ declare const SPEC_COMMAND_ANNOTATION = "kit/spec-command";
129
+ interface RegisterSpecOptions {
130
+ /** Depth-1 verbs the tool reserves; "spec" is always added. */
131
+ reserved?: Iterable<string>;
132
+ }
133
+ /**
134
+ * Attach a `spec` subcommand emitting the tool's capability manifest
135
+ * (Go RegisterSpecCommand). Call once after registering every
136
+ * command.
137
+ *
138
+ * - `--format`: `kit-manifest` (default; aliases `kit`, `manifest`)
139
+ * and `json` emit Go-identical JSON; `yaml` emits the same document
140
+ * as YAML; `table`/`csv`/`text` emit nothing, as Go does today.
141
+ * The program's global `--format` is used when it has one,
142
+ * otherwise spec adds its own.
143
+ * - `--version`: print only the schema version.
144
+ * - `--include-deprecated`: list deprecated commands too.
145
+ *
146
+ * schemaVersion is a floor: each run resolves the emitted version
147
+ * against KIT_TOOLSPEC_SCHEMA (negotiateSchemaVersion).
148
+ *
149
+ * commander parses a program's own options anywhere on the line, so
150
+ * a program-level `--version` (commander `.version()`, which
151
+ * createCLI sets) would answer `spec --version` with the tool
152
+ * version. The program's version listener is wrapped so a literal
153
+ * `--version` is forwarded to spec when spec is the command being
154
+ * executed; `tool --version`, `-v`, and `--version` on any other
155
+ * command keep commander's behaviour. See forwardVersionToSpec.
156
+ */
157
+ declare function registerSpecCommand(program: Command$1, schemaVersion: string, opts?: RegisterSpecOptions): Command$1;
158
+ /** Go CoverageReport: annotation coverage over a command tree. */
159
+ interface CoverageReport {
160
+ tool: string;
161
+ total: number;
162
+ annotated: number;
163
+ unannotated: number;
164
+ inferred: number;
165
+ malformed: number;
166
+ unannotated_paths?: string[];
167
+ malformed_paths?: string[];
168
+ measurable: boolean;
169
+ }
170
+ interface CoverageOptions {
171
+ /** Depth-1 verbs the tool reserves (not measured). */
172
+ reserved?: Iterable<string>;
173
+ }
174
+ /**
175
+ * Measure kit/side-effect annotation coverage (Go CoverageOf):
176
+ * runnable commands, excluding framework builtins, reserved verbs and
177
+ * kit's spec commands. Deprecated and hidden commands count.
178
+ */
179
+ declare function coverageOf(program: Command$1, opts?: CoverageOptions): CoverageReport;
180
+
181
+ type SafetyLevel = "safe" | "caution" | "dangerous";
182
+ interface Contract {
183
+ /** True iff kit/idempotent is "yes"; see idempotentClass for "no" / "conditional". */
184
+ idempotent: boolean;
185
+ sideEffects?: string[];
186
+ retryable: boolean;
187
+ preConditions?: string[];
188
+ /**
189
+ * The raw kit/idempotent class when it is one of yes|no|conditional
190
+ * (YAML key `idempotent_class`). "conditional" means the command
191
+ * takes --idempotency-key and a retry must supply one.
192
+ */
193
+ idempotentClass?: string;
194
+ }
195
+ interface Safety {
196
+ level: SafetyLevel;
197
+ requiresConfirmation?: boolean;
198
+ permissions?: string[];
199
+ }
200
+ interface OutputSchema {
201
+ format?: string;
202
+ fields?: string[];
203
+ example?: string;
204
+ }
205
+ interface StateIntrospection {
206
+ configCommands?: string[];
207
+ envVars?: string[];
208
+ authCommands?: string[];
209
+ }
210
+ interface Provenance {
211
+ source?: string;
212
+ retrievedAt?: string;
213
+ confidence?: number;
214
+ }
215
+ interface Intent {
216
+ domain?: string;
217
+ category?: string;
218
+ tags?: string[];
219
+ }
220
+ interface Flag {
221
+ name: string;
222
+ short?: string;
223
+ type?: string;
224
+ description?: string;
225
+ /** Flag must be supplied (commander `makeOptionMandatory`). */
226
+ required?: boolean;
227
+ deprecated?: boolean;
228
+ replacedBy?: string;
229
+ /**
230
+ * Default value spelled as pflag prints it ("false" for a bool,
231
+ * "[a,b]" for a list), the same string the manifest's `default`
232
+ * carries; absent when empty.
233
+ */
234
+ default?: string;
235
+ /** Closed set of legal values (commander `.choices()`, kit WithFlagEnum), in order. */
236
+ choices?: string[];
237
+ }
238
+ /** A declared positional argument (mirrors Go toolspec.Arg). */
239
+ interface Arg {
240
+ name: string;
241
+ /** False/absent for an optional argument. */
242
+ required?: boolean;
243
+ /** True for a `<name...>` argument: takes every remaining operand; always last. */
244
+ variadic?: boolean;
245
+ }
246
+ interface Command {
247
+ name: string;
248
+ /** One-line summary of the command. */
249
+ short?: string;
250
+ aliases?: string[];
251
+ flags?: Flag[];
252
+ /** Declared positional arguments, in order. */
253
+ args?: Arg[];
254
+ /** Command takes positional arguments it does not declare. */
255
+ undeclaredArgs?: boolean;
256
+ /** Exit-code symbols the command may produce (kit/exit-codes). */
257
+ exitCodes?: string[];
258
+ children?: Command[];
259
+ contract?: Contract;
260
+ safety?: Safety;
261
+ previewModes?: string[];
262
+ outputSchema?: OutputSchema;
263
+ deprecated?: boolean;
264
+ deprecatedSince?: string;
265
+ replacedBy?: string;
266
+ intent?: Intent;
267
+ suggestedNext?: string[];
268
+ }
269
+ interface ErrorPattern {
270
+ pattern: string;
271
+ fix: string;
272
+ source?: string;
273
+ cause?: string;
274
+ fixes?: string[];
275
+ confidence?: number;
276
+ provenance?: Provenance;
277
+ }
278
+ interface Workflow {
279
+ name: string;
280
+ steps: string[];
281
+ after?: Record<string, string[]>;
282
+ provenance?: Provenance;
283
+ }
284
+ interface ToolSpec {
285
+ name: string;
286
+ schemaVersion: string;
287
+ commands: Command[];
288
+ flags?: Flag[];
289
+ errorPatterns?: ErrorPattern[];
290
+ workflows?: Workflow[];
291
+ stateIntrospection?: StateIntrospection;
292
+ }
293
+ /** Parse a YAML toolspec file into a ToolSpec object. */
294
+ declare function loadToolSpec(yamlPath: string): ToolSpec;
295
+ /** Validate a ToolSpec, returning a list of error strings. */
296
+ declare function validateToolSpec(spec: ToolSpec): string[];
297
+ /** BFS search for a command by name (mirrors Go FindCommand). */
298
+ declare function findCommand(spec: ToolSpec, name: string): Command | undefined;
299
+
300
+ /**
301
+ * Per-command fields merged over what the commander tree yields.
302
+ * Structural fields (name, aliases, flags, args, children) always
303
+ * come from the tree.
304
+ */
305
+ type CommandAnnotation = Omit<Partial<Command>, "name" | "aliases" | "flags" | "args" | "children">;
306
+ interface FromCommandOptions {
307
+ /** Annotations keyed by space-joined path below the root, e.g. "mission list". */
308
+ annotations?: Record<string, CommandAnnotation>;
309
+ /** Defaults to "1", the version the YAML toolspecs declare. */
310
+ schemaVersion?: string;
311
+ /** Keep hidden commands (Go WithIncludeHidden). Hidden options stay omitted. */
312
+ includeHidden?: boolean;
313
+ }
314
+ /**
315
+ * Build a ToolSpec from a constructed commander tree, so CLIs with
316
+ * dynamically registered subcommands need no hand-synced YAML.
317
+ * Mirrors Go's WalkCobra projection: hidden commands (unless
318
+ * includeHidden) and hidden options are omitted, framework builtins
319
+ * (help, completion and its shells, man, __complete,
320
+ * __completeNoDesc) and kit/spec-command commands are skipped, flag
321
+ * names are undashed, root options become spec.flags.
322
+ */
323
+ declare function toolSpecFromCommand(program: Command$1, opts?: FromCommandOptions): ToolSpec;
324
+
325
+ type toolspec_Arg = Arg;
326
+ type toolspec_BuildManifestOptions = BuildManifestOptions;
327
+ type toolspec_Command = Command;
328
+ type toolspec_CommandAnnotation = CommandAnnotation;
329
+ type toolspec_Contract = Contract;
330
+ type toolspec_CoverageOptions = CoverageOptions;
331
+ type toolspec_CoverageReport = CoverageReport;
332
+ type toolspec_ErrorPattern = ErrorPattern;
333
+ type toolspec_Flag = Flag;
334
+ type toolspec_FromCommandOptions = FromCommandOptions;
335
+ declare const toolspec_IDEMPOTENT_UNKNOWN: typeof IDEMPOTENT_UNKNOWN;
336
+ type toolspec_Intent = Intent;
337
+ declare const toolspec_LATEST_SCHEMA_VERSION: typeof LATEST_SCHEMA_VERSION;
338
+ type toolspec_Manifest = Manifest;
339
+ type toolspec_ManifestArg = ManifestArg;
340
+ type toolspec_ManifestCommand = ManifestCommand;
341
+ type toolspec_ManifestExample = ManifestExample;
342
+ type toolspec_ManifestFlag = ManifestFlag;
343
+ type toolspec_ManifestNextStep = ManifestNextStep;
344
+ type toolspec_OutputSchema = OutputSchema;
345
+ type toolspec_Provenance = Provenance;
346
+ type toolspec_RegisterSpecOptions = RegisterSpecOptions;
347
+ declare const toolspec_SCHEMA_VERSION_ENV: typeof SCHEMA_VERSION_ENV;
348
+ declare const toolspec_SIDE_EFFECT_UNKNOWN: typeof SIDE_EFFECT_UNKNOWN;
349
+ declare const toolspec_SPEC_COMMAND_ANNOTATION: typeof SPEC_COMMAND_ANNOTATION;
350
+ type toolspec_Safety = Safety;
351
+ type toolspec_SafetyLevel = SafetyLevel;
352
+ type toolspec_StateIntrospection = StateIntrospection;
353
+ type toolspec_ToolSpec = ToolSpec;
354
+ type toolspec_Workflow = Workflow;
355
+ declare const toolspec_buildManifest: typeof buildManifest;
356
+ declare const toolspec_coverageOf: typeof coverageOf;
357
+ declare const toolspec_findCommand: typeof findCommand;
358
+ declare const toolspec_loadToolSpec: typeof loadToolSpec;
359
+ declare const toolspec_negotiateSchemaVersion: typeof negotiateSchemaVersion;
360
+ declare const toolspec_registerSpecCommand: typeof registerSpecCommand;
361
+ declare const toolspec_renderManifestJSON: typeof renderManifestJSON;
362
+ declare const toolspec_toolSpecFromCommand: typeof toolSpecFromCommand;
363
+ declare const toolspec_validateToolSpec: typeof validateToolSpec;
364
+ declare namespace toolspec {
365
+ export { type toolspec_Arg as Arg, type toolspec_BuildManifestOptions as BuildManifestOptions, type toolspec_Command as Command, type toolspec_CommandAnnotation as CommandAnnotation, type toolspec_Contract as Contract, type toolspec_CoverageOptions as CoverageOptions, type toolspec_CoverageReport as CoverageReport, type toolspec_ErrorPattern as ErrorPattern, type toolspec_Flag as Flag, type toolspec_FromCommandOptions as FromCommandOptions, toolspec_IDEMPOTENT_UNKNOWN as IDEMPOTENT_UNKNOWN, type toolspec_Intent as Intent, toolspec_LATEST_SCHEMA_VERSION as LATEST_SCHEMA_VERSION, type toolspec_Manifest as Manifest, type toolspec_ManifestArg as ManifestArg, type toolspec_ManifestCommand as ManifestCommand, type toolspec_ManifestExample as ManifestExample, type toolspec_ManifestFlag as ManifestFlag, type toolspec_ManifestNextStep as ManifestNextStep, type toolspec_OutputSchema as OutputSchema, type toolspec_Provenance as Provenance, type toolspec_RegisterSpecOptions as RegisterSpecOptions, toolspec_SCHEMA_VERSION_ENV as SCHEMA_VERSION_ENV, toolspec_SIDE_EFFECT_UNKNOWN as SIDE_EFFECT_UNKNOWN, toolspec_SPEC_COMMAND_ANNOTATION as SPEC_COMMAND_ANNOTATION, type toolspec_Safety as Safety, type toolspec_SafetyLevel as SafetyLevel, type toolspec_StateIntrospection as StateIntrospection, type toolspec_ToolSpec as ToolSpec, type toolspec_Workflow as Workflow, toolspec_buildManifest as buildManifest, toolspec_coverageOf as coverageOf, toolspec_findCommand as findCommand, toolspec_loadToolSpec as loadToolSpec, toolspec_negotiateSchemaVersion as negotiateSchemaVersion, toolspec_registerSpecCommand as registerSpecCommand, toolspec_renderManifestJSON as renderManifestJSON, toolspec_toolSpecFromCommand as toolSpecFromCommand, toolspec_validateToolSpec as validateToolSpec };
366
+ }
367
+
368
+ export { type Arg as A, type BuildManifestOptions as B, type Command as C, type ErrorPattern as E, type Flag as F, IDEMPOTENT_UNKNOWN as I, LATEST_SCHEMA_VERSION as L, type Manifest as M, type OutputSchema as O, type Provenance as P, type RegisterSpecOptions as R, SCHEMA_VERSION_ENV as S, type ToolSpec as T, type Workflow as W, type CommandAnnotation as a, type Contract as b, type CoverageOptions as c, type CoverageReport as d, type FromCommandOptions as e, type Intent as f, type ManifestArg as g, type ManifestCommand as h, type ManifestExample as i, type ManifestFlag as j, type ManifestNextStep as k, SIDE_EFFECT_UNKNOWN as l, SPEC_COMMAND_ANNOTATION as m, type Safety as n, type SafetyLevel as o, type StateIntrospection as p, buildManifest as q, coverageOf as r, findCommand as s, toolspec as t, loadToolSpec as u, negotiateSchemaVersion as v, registerSpecCommand as w, renderManifestJSON as x, toolSpecFromCommand as y, validateToolSpec as z };
@@ -0,0 +1,2 @@
1
+ import 'commander';
2
+ export { A as Arg, B as BuildManifestOptions, C as Command, a as CommandAnnotation, b as Contract, c as CoverageOptions, d as CoverageReport, E as ErrorPattern, F as Flag, e as FromCommandOptions, I as IDEMPOTENT_UNKNOWN, f as Intent, L as LATEST_SCHEMA_VERSION, M as Manifest, g as ManifestArg, h as ManifestCommand, i as ManifestExample, j as ManifestFlag, k as ManifestNextStep, O as OutputSchema, P as Provenance, R as RegisterSpecOptions, S as SCHEMA_VERSION_ENV, l as SIDE_EFFECT_UNKNOWN, m as SPEC_COMMAND_ANNOTATION, n as Safety, o as SafetyLevel, p as StateIntrospection, T as ToolSpec, W as Workflow, q as buildManifest, r as coverageOf, s as findCommand, u as loadToolSpec, v as negotiateSchemaVersion, w as registerSpecCommand, x as renderManifestJSON, y as toolSpecFromCommand, z as validateToolSpec } from './toolspec-DcPwwoAZ.js';
@@ -0,0 +1,37 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+ var _chunkK7VCKJ27js = require('./chunk-K7VCKJ27.js');
17
+ require('./chunk-SNVGDYX7.js');
18
+ require('./chunk-IXVQ62NZ.js');
19
+ require('./chunk-72XZWQX7.js');
20
+ require('./chunk-POR5L2DG.js');
21
+ require('./chunk-R5U7XKVJ.js');
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+ exports.IDEMPOTENT_UNKNOWN = _chunkK7VCKJ27js.IDEMPOTENT_UNKNOWN; exports.LATEST_SCHEMA_VERSION = _chunkK7VCKJ27js.LATEST_SCHEMA_VERSION; exports.SCHEMA_VERSION_ENV = _chunkK7VCKJ27js.SCHEMA_VERSION_ENV; exports.SIDE_EFFECT_UNKNOWN = _chunkK7VCKJ27js.SIDE_EFFECT_UNKNOWN; exports.SPEC_COMMAND_ANNOTATION = _chunkK7VCKJ27js.SPEC_COMMAND_ANNOTATION; exports.buildManifest = _chunkK7VCKJ27js.buildManifest; exports.coverageOf = _chunkK7VCKJ27js.coverageOf; exports.findCommand = _chunkK7VCKJ27js.findCommand; exports.loadToolSpec = _chunkK7VCKJ27js.loadToolSpec; exports.negotiateSchemaVersion = _chunkK7VCKJ27js.negotiateSchemaVersion; exports.registerSpecCommand = _chunkK7VCKJ27js.registerSpecCommand; exports.renderManifestJSON = _chunkK7VCKJ27js.renderManifestJSON; exports.toolSpecFromCommand = _chunkK7VCKJ27js.toolSpecFromCommand; exports.validateToolSpec = _chunkK7VCKJ27js.validateToolSpec;