indusagi-coding-agent 0.2.3 → 0.2.5

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 (260) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/LICENSE +661 -0
  3. package/README.md +95 -1
  4. package/dist/entry.js +3205 -1585
  5. package/dist/guardrails.js +47 -515
  6. package/dist/index.js +3232 -1671
  7. package/package.json +8 -7
  8. package/dist/types/addons/addons.test.d.ts +0 -21
  9. package/dist/types/addons/contract.d.ts +0 -640
  10. package/dist/types/addons/dispatch/event-dispatcher.d.ts +0 -140
  11. package/dist/types/addons/dispatch/index.d.ts +0 -23
  12. package/dist/types/addons/dispatch/tool-interceptor.d.ts +0 -128
  13. package/dist/types/addons/host.d.ts +0 -246
  14. package/dist/types/addons/index.d.ts +0 -51
  15. package/dist/types/addons/manifest.d.ts +0 -56
  16. package/dist/types/addons/sandbox.d.ts +0 -103
  17. package/dist/types/addons/surface.d.ts +0 -42
  18. package/dist/types/boot/auth-vault.d.ts +0 -29
  19. package/dist/types/boot/boot.d.ts +0 -26
  20. package/dist/types/boot/boot.test.d.ts +0 -15
  21. package/dist/types/boot/contract.d.ts +0 -236
  22. package/dist/types/boot/index.d.ts +0 -20
  23. package/dist/types/boot/invocation.d.ts +0 -40
  24. package/dist/types/boot/invocation.test.d.ts +0 -8
  25. package/dist/types/boot/runners/addon-wiring.d.ts +0 -103
  26. package/dist/types/boot/runners/addon-wiring.test.d.ts +0 -19
  27. package/dist/types/boot/runners/checkpoint.d.ts +0 -133
  28. package/dist/types/boot/runners/checkpoint.test.d.ts +0 -12
  29. package/dist/types/boot/runners/delegate-runner.d.ts +0 -89
  30. package/dist/types/boot/runners/delegate-runner.test.d.ts +0 -13
  31. package/dist/types/boot/runners/index.d.ts +0 -13
  32. package/dist/types/boot/runners/link-runner.d.ts +0 -20
  33. package/dist/types/boot/runners/memdir.d.ts +0 -103
  34. package/dist/types/boot/runners/memdir.test.d.ts +0 -12
  35. package/dist/types/boot/runners/oneshot-runner.d.ts +0 -19
  36. package/dist/types/boot/runners/read-state.d.ts +0 -82
  37. package/dist/types/boot/runners/read-state.test.d.ts +0 -10
  38. package/dist/types/boot/runners/registry.d.ts +0 -30
  39. package/dist/types/boot/runners/repl-runner.d.ts +0 -19
  40. package/dist/types/boot/runners/session-persist.test.d.ts +0 -10
  41. package/dist/types/boot/runners/session.d.ts +0 -65
  42. package/dist/types/boot/runners/session.test.d.ts +0 -10
  43. package/dist/types/boot/stages.d.ts +0 -92
  44. package/dist/types/boot/upgrade/apply.d.ts +0 -45
  45. package/dist/types/boot/upgrade/index.d.ts +0 -13
  46. package/dist/types/boot/upgrade/upgrades.d.ts +0 -126
  47. package/dist/types/briefing/briefing.test.d.ts +0 -15
  48. package/dist/types/briefing/compose.d.ts +0 -37
  49. package/dist/types/briefing/context-docs.d.ts +0 -38
  50. package/dist/types/briefing/context-docs.test.d.ts +0 -18
  51. package/dist/types/briefing/contract.d.ts +0 -686
  52. package/dist/types/briefing/index.d.ts +0 -29
  53. package/dist/types/briefing/macros.d.ts +0 -206
  54. package/dist/types/briefing/skills.d.ts +0 -67
  55. package/dist/types/capability-deck/bridge-ledger/index.d.ts +0 -25
  56. package/dist/types/capability-deck/bridge-ledger/key.d.ts +0 -65
  57. package/dist/types/capability-deck/bridge-ledger/ledger.d.ts +0 -129
  58. package/dist/types/capability-deck/bridge-ledger/network.d.ts +0 -115
  59. package/dist/types/capability-deck/builtin-bridge.d.ts +0 -114
  60. package/dist/types/capability-deck/capability-deck.test.d.ts +0 -18
  61. package/dist/types/capability-deck/cards/bg-process-card.d.ts +0 -99
  62. package/dist/types/capability-deck/cards/index.d.ts +0 -37
  63. package/dist/types/capability-deck/cards/memory-card.d.ts +0 -68
  64. package/dist/types/capability-deck/cards/plan-file.d.ts +0 -56
  65. package/dist/types/capability-deck/cards/plan-tools.d.ts +0 -97
  66. package/dist/types/capability-deck/cards/plan-tools.test.d.ts +0 -9
  67. package/dist/types/capability-deck/cards/saas-card.d.ts +0 -78
  68. package/dist/types/capability-deck/cards/task-card.d.ts +0 -106
  69. package/dist/types/capability-deck/cards/todo-card.d.ts +0 -78
  70. package/dist/types/capability-deck/cards/workflow-card.d.ts +0 -55
  71. package/dist/types/capability-deck/cards/workflow-card.test.d.ts +0 -12
  72. package/dist/types/capability-deck/checkpoint.int.test.d.ts +0 -25
  73. package/dist/types/capability-deck/contract.d.ts +0 -317
  74. package/dist/types/capability-deck/index.d.ts +0 -46
  75. package/dist/types/capability-deck/manifest.d.ts +0 -60
  76. package/dist/types/capability-deck/provision.d.ts +0 -76
  77. package/dist/types/capability-deck/read-edit-gate.int.test.d.ts +0 -21
  78. package/dist/types/channels/channels.test.d.ts +0 -15
  79. package/dist/types/channels/contract.d.ts +0 -489
  80. package/dist/types/channels/framer.d.ts +0 -49
  81. package/dist/types/channels/index.d.ts +0 -24
  82. package/dist/types/channels/link/dialog.d.ts +0 -138
  83. package/dist/types/channels/link/driver.d.ts +0 -81
  84. package/dist/types/channels/link/index.d.ts +0 -13
  85. package/dist/types/channels/link/server.d.ts +0 -70
  86. package/dist/types/channels/oneshot.d.ts +0 -37
  87. package/dist/types/channels/ops.d.ts +0 -89
  88. package/dist/types/channels/session-ops.d.ts +0 -80
  89. package/dist/types/conductor/bash-guard.d.ts +0 -106
  90. package/dist/types/conductor/bash-guard.test.d.ts +0 -17
  91. package/dist/types/conductor/catalog/catalog.d.ts +0 -87
  92. package/dist/types/conductor/catalog/index.d.ts +0 -14
  93. package/dist/types/conductor/catalog/matcher.d.ts +0 -47
  94. package/dist/types/conductor/conductor.d.ts +0 -189
  95. package/dist/types/conductor/conductor.test.d.ts +0 -10
  96. package/dist/types/conductor/contract.d.ts +0 -774
  97. package/dist/types/conductor/diagnostics.d.ts +0 -183
  98. package/dist/types/conductor/diagnostics.test.d.ts +0 -10
  99. package/dist/types/conductor/index.d.ts +0 -26
  100. package/dist/types/conductor/permission-gate.integration.test.d.ts +0 -22
  101. package/dist/types/conductor/permission-wiring.test.d.ts +0 -14
  102. package/dist/types/conductor/permissions.d.ts +0 -217
  103. package/dist/types/conductor/permissions.test.d.ts +0 -12
  104. package/dist/types/conductor/plan-mode.integration.test.d.ts +0 -23
  105. package/dist/types/conductor/post-edit-diagnostics.test.d.ts +0 -13
  106. package/dist/types/conductor/signal-hub/hub.d.ts +0 -83
  107. package/dist/types/conductor/signal-hub/index.d.ts +0 -19
  108. package/dist/types/conductor/signal-hub/translate.d.ts +0 -77
  109. package/dist/types/conductor/skill-parse/index.d.ts +0 -10
  110. package/dist/types/conductor/skill-parse/parse.d.ts +0 -67
  111. package/dist/types/conductor/submit.test.d.ts +0 -28
  112. package/dist/types/conductor/transcript-store/index.d.ts +0 -16
  113. package/dist/types/conductor/transcript-store/serialize.d.ts +0 -106
  114. package/dist/types/conductor/transcript-store/serialize.test.d.ts +0 -10
  115. package/dist/types/conductor/transcript-store/store.d.ts +0 -188
  116. package/dist/types/console/components/AgentsView.d.ts +0 -41
  117. package/dist/types/console/components/BackgroundAgents.d.ts +0 -63
  118. package/dist/types/console/components/BackgroundAgents.test.d.ts +0 -8
  119. package/dist/types/console/components/Banner.d.ts +0 -110
  120. package/dist/types/console/components/Composer.d.ts +0 -37
  121. package/dist/types/console/components/StatusBar.d.ts +0 -42
  122. package/dist/types/console/components/TerminalConsole.d.ts +0 -32
  123. package/dist/types/console/components/WorkingIndicator.d.ts +0 -44
  124. package/dist/types/console/components/WorkingIndicator.test.d.ts +0 -9
  125. package/dist/types/console/components/banner-sweep.d.ts +0 -55
  126. package/dist/types/console/components/banner.test.d.ts +0 -9
  127. package/dist/types/console/components/welcome.d.ts +0 -115
  128. package/dist/types/console/components/welcome.test.d.ts +0 -9
  129. package/dist/types/console/console.test.d.ts +0 -19
  130. package/dist/types/console/contract.d.ts +0 -598
  131. package/dist/types/console/index.d.ts +0 -34
  132. package/dist/types/console/input/complete.d.ts +0 -120
  133. package/dist/types/console/input/dir-reader.d.ts +0 -28
  134. package/dist/types/console/input/index.d.ts +0 -24
  135. package/dist/types/console/input/input.test.d.ts +0 -14
  136. package/dist/types/console/input/keymap.d.ts +0 -193
  137. package/dist/types/console/input/paste.d.ts +0 -131
  138. package/dist/types/console/mount.d.ts +0 -53
  139. package/dist/types/console/overlays/approval-queue.d.ts +0 -71
  140. package/dist/types/console/overlays/approval.d.ts +0 -104
  141. package/dist/types/console/overlays/approval.test.d.ts +0 -17
  142. package/dist/types/console/overlays/auth.d.ts +0 -31
  143. package/dist/types/console/overlays/boards.d.ts +0 -55
  144. package/dist/types/console/overlays/host.d.ts +0 -45
  145. package/dist/types/console/overlays/index.d.ts +0 -15
  146. package/dist/types/console/overlays/pickers.d.ts +0 -37
  147. package/dist/types/console/overlays/sessions.d.ts +0 -29
  148. package/dist/types/console/reducer.d.ts +0 -51
  149. package/dist/types/console/slash/builtins.d.ts +0 -33
  150. package/dist/types/console/slash/commands/dynamic.d.ts +0 -57
  151. package/dist/types/console/slash/commands/dynamic.test.d.ts +0 -9
  152. package/dist/types/console/slash/commands/integrations.d.ts +0 -28
  153. package/dist/types/console/slash/commands/integrations.test.d.ts +0 -18
  154. package/dist/types/console/slash/commands/shared.d.ts +0 -72
  155. package/dist/types/console/slash/commands/transcript.d.ts +0 -24
  156. package/dist/types/console/slash/commands/transcript.test.d.ts +0 -10
  157. package/dist/types/console/slash/commands/workbench.d.ts +0 -21
  158. package/dist/types/console/slash/commands/workbench.test.d.ts +0 -10
  159. package/dist/types/console/slash/index.d.ts +0 -34
  160. package/dist/types/console/slash/registry.d.ts +0 -90
  161. package/dist/types/console/slash/resolve.d.ts +0 -109
  162. package/dist/types/console/slash/slash.test.d.ts +0 -18
  163. package/dist/types/console/startup.d.ts +0 -119
  164. package/dist/types/console/theme/adapter.d.ts +0 -79
  165. package/dist/types/console/theme/index.d.ts +0 -18
  166. package/dist/types/console/theme/palette.d.ts +0 -77
  167. package/dist/types/console/theme/resolve.d.ts +0 -45
  168. package/dist/types/console/theme/theme.test.d.ts +0 -16
  169. package/dist/types/console/theme/tokens.d.ts +0 -62
  170. package/dist/types/entry.d.ts +0 -17
  171. package/dist/types/guardrails.d.ts +0 -33
  172. package/dist/types/index.d.ts +0 -24
  173. package/dist/types/insight/channel.d.ts +0 -45
  174. package/dist/types/insight/contract.d.ts +0 -411
  175. package/dist/types/insight/index.d.ts +0 -26
  176. package/dist/types/insight/insight.test.d.ts +0 -17
  177. package/dist/types/insight/recorder.d.ts +0 -63
  178. package/dist/types/insight/redaction.d.ts +0 -44
  179. package/dist/types/insight/replay.d.ts +0 -77
  180. package/dist/types/insight/sampling.d.ts +0 -84
  181. package/dist/types/insight/serialize.d.ts +0 -54
  182. package/dist/types/insight/sinks/console.d.ts +0 -36
  183. package/dist/types/insight/sinks/file.d.ts +0 -37
  184. package/dist/types/insight/sinks/index.d.ts +0 -16
  185. package/dist/types/insight/sinks/stream.d.ts +0 -53
  186. package/dist/types/kit/clipboard-image.d.ts +0 -40
  187. package/dist/types/kit/external-editor.d.ts +0 -35
  188. package/dist/types/kit/image.d.ts +0 -102
  189. package/dist/types/kit/index.d.ts +0 -29
  190. package/dist/types/kit/kit.test.d.ts +0 -13
  191. package/dist/types/kit/shell.d.ts +0 -50
  192. package/dist/types/kit/tool-fetch.d.ts +0 -165
  193. package/dist/types/launch/catalog.d.ts +0 -51
  194. package/dist/types/launch/contract.d.ts +0 -387
  195. package/dist/types/launch/credentials.d.ts +0 -112
  196. package/dist/types/launch/index.d.ts +0 -28
  197. package/dist/types/launch/invocation/attachments.d.ts +0 -72
  198. package/dist/types/launch/invocation/flags.d.ts +0 -59
  199. package/dist/types/launch/invocation/index.d.ts +0 -23
  200. package/dist/types/launch/invocation/read.d.ts +0 -52
  201. package/dist/types/launch/invocation/usage.d.ts +0 -25
  202. package/dist/types/launch/launch.test.d.ts +0 -20
  203. package/dist/types/launch/oauth.d.ts +0 -101
  204. package/dist/types/launch/packages.d.ts +0 -75
  205. package/dist/types/launch/packages.test.d.ts +0 -15
  206. package/dist/types/launch/pickers.d.ts +0 -97
  207. package/dist/types/runtime-bridge/bridges/_drive.d.ts +0 -74
  208. package/dist/types/runtime-bridge/bridges/builtins.d.ts +0 -77
  209. package/dist/types/runtime-bridge/bridges/claude-cli.d.ts +0 -37
  210. package/dist/types/runtime-bridge/bridges/codex-cli.d.ts +0 -27
  211. package/dist/types/runtime-bridge/bridges/index.d.ts +0 -15
  212. package/dist/types/runtime-bridge/bridges/indusagi-cli.d.ts +0 -36
  213. package/dist/types/runtime-bridge/broker.d.ts +0 -182
  214. package/dist/types/runtime-bridge/contract.d.ts +0 -436
  215. package/dist/types/runtime-bridge/index.d.ts +0 -21
  216. package/dist/types/runtime-bridge/runtime-bridge.test.d.ts +0 -17
  217. package/dist/types/runtime-bridge/sink.d.ts +0 -59
  218. package/dist/types/sessions/contract.d.ts +0 -79
  219. package/dist/types/sessions/index.d.ts +0 -11
  220. package/dist/types/sessions/library.d.ts +0 -95
  221. package/dist/types/sessions/sessions.test.d.ts +0 -11
  222. package/dist/types/settings/contract.d.ts +0 -175
  223. package/dist/types/settings/index.d.ts +0 -13
  224. package/dist/types/settings/manager.d.ts +0 -109
  225. package/dist/types/settings/settings.test.d.ts +0 -16
  226. package/dist/types/transcript-export/index.d.ts +0 -20
  227. package/dist/types/transcript-export/publish.d.ts +0 -81
  228. package/dist/types/transcript-export/sgr.d.ts +0 -90
  229. package/dist/types/transcript-export/template.d.ts +0 -64
  230. package/dist/types/transcript-export/theme-bridge.d.ts +0 -99
  231. package/dist/types/transcript-export/transcript-export.test.d.ts +0 -16
  232. package/dist/types/window-budget/budget/estimate.d.ts +0 -47
  233. package/dist/types/window-budget/budget/gate.d.ts +0 -37
  234. package/dist/types/window-budget/budget/index.d.ts +0 -14
  235. package/dist/types/window-budget/budget/slice.d.ts +0 -38
  236. package/dist/types/window-budget/condenser.d.ts +0 -73
  237. package/dist/types/window-budget/contract.d.ts +0 -182
  238. package/dist/types/window-budget/index.d.ts +0 -17
  239. package/dist/types/window-budget/microcompact.d.ts +0 -68
  240. package/dist/types/window-budget/microcompact.test.d.ts +0 -16
  241. package/dist/types/window-budget/rehydrate.d.ts +0 -56
  242. package/dist/types/window-budget/summarize/condense.d.ts +0 -70
  243. package/dist/types/window-budget/summarize/index.d.ts +0 -12
  244. package/dist/types/window-budget/summarize/prompt.d.ts +0 -56
  245. package/dist/types/window-budget/window-budget.test.d.ts +0 -18
  246. package/dist/types/workflow-engine/agent-runner.d.ts +0 -105
  247. package/dist/types/workflow-engine/agent-runner.test.d.ts +0 -8
  248. package/dist/types/workflow-engine/display.d.ts +0 -148
  249. package/dist/types/workflow-engine/display.test.d.ts +0 -1
  250. package/dist/types/workflow-engine/engine.d.ts +0 -183
  251. package/dist/types/workflow-engine/engine.test.d.ts +0 -1
  252. package/dist/types/workflow-engine/index.d.ts +0 -21
  253. package/dist/types/workflow-engine/parse.d.ts +0 -64
  254. package/dist/types/workflow-engine/parse.test.d.ts +0 -1
  255. package/dist/types/workflow-engine/structured-output.d.ts +0 -51
  256. package/dist/types/workflow-engine/structured-output.test.d.ts +0 -1
  257. package/dist/types/workspace/brand.d.ts +0 -26
  258. package/dist/types/workspace/index.d.ts +0 -11
  259. package/dist/types/workspace/locator.d.ts +0 -50
  260. package/dist/types/workspace/runtime-detect.d.ts +0 -56
@@ -1,29 +0,0 @@
1
- /**
2
- * Kit subsystem — public barrel.
3
- *
4
- * `kit/` holds the agent's framework-agnostic leaf helpers: small, pure, Node-
5
- * builtin-only utilities with no dependency on the framework or on any sibling
6
- * subsystem. It re-exports three groups:
7
- *
8
- * - **tool-fetch** — the managed-binary provisioner stub (fd / rg): managed
9
- * path resolution, regex-driven release-asset selection, and a download-
10
- * request builder stamped with this kit's own {@link KIT_USER_AGENT}. The
11
- * network is injected, never imported.
12
- * - **image** — PNG / JPEG magic-byte sniffing (interface-dictated
13
- * signatures) and the `{token}` asset-name renderer.
14
- * - **shell** — POSIX shell-argument quoting and command assembly.
15
- *
16
- * Consumers import from `src/kit` rather than reaching into individual modules.
17
- * The upstream filler libraries (generic array / string / date / json / etc.
18
- * stdlib clones) are intentionally omitted: they had zero consumers, so they
19
- * are not rebuilt here.
20
- */
21
- export type { ToolDescriptor, ReleaseAsset, ReleaseInfo, ReleaseLookup, DownloadRequest, ProvisionPlan, } from "./tool-fetch";
22
- export { KIT_USER_AGENT, resolveManagedBinaryPath, pickReleaseAsset, buildDownloadRequest, planProvision, } from "./tool-fetch";
23
- export type { ImageFormat, ImageMediaType, ByteSource, AssetNameContext, } from "./image";
24
- export { IMAGE_SNIFF_BYTES, sniffImageFormat, mediaTypeForImageFormat, detectImageMediaType, isSupportedImage, resolveAssetName, } from "./image";
25
- export { quoteArg, needsQuoting, buildShellCommand, } from "./shell";
26
- export type { ClipboardImageOptions, } from "./clipboard-image";
27
- export { readClipboardImage, } from "./clipboard-image";
28
- export type { ExternalEditorOptions, } from "./external-editor";
29
- export { openInExternalEditor, } from "./external-editor";
@@ -1,13 +0,0 @@
1
- /**
2
- * Phase 11 kit — behavioral tests for the leaf helpers.
3
- *
4
- * Three independent surfaces, all pure and offline:
5
- *
6
- * 1. image magic-byte detection sniffs PNG and JPEG from their leading bytes
7
- * and rejects non-images;
8
- * 2. the tool-fetch provisioner builds a download request stamped with the
9
- * fresh kit User-Agent and resolves a platform-correct managed binary path;
10
- * 3. the shell helper quotes arguments that carry metacharacters and passes
11
- * safe ones through.
12
- */
13
- export {};
@@ -1,50 +0,0 @@
1
- /**
2
- * Shell kit — POSIX shell-argument quoting and command assembly.
3
- *
4
- * A leaf utility for safely turning argument strings into a single shell line.
5
- * The agent shells out to provisioned binaries (fd / rg) and to user commands;
6
- * any argument carrying a space, a glob, a quote, or a metacharacter must be
7
- * quoted so the shell passes it through as one literal token rather than
8
- * re-parsing it.
9
- *
10
- * The strategy is the conventional POSIX one: wrap the argument in single
11
- * quotes and escape any embedded single quote by closing the quote, emitting an
12
- * escaped quote, and reopening — `it's` becomes `'it'\''s'`. Inside single
13
- * quotes the shell treats every other character literally, so this is robust
14
- * against spaces, `$`, backticks, `*`, `;`, newlines, and the rest. Arguments
15
- * that contain only safe characters are passed through unquoted to keep the
16
- * rendered line readable.
17
- *
18
- * Pure and framework-agnostic: no process spawn, no environment, no I/O.
19
- */
20
- /**
21
- * Quote a single argument for a POSIX shell.
22
- *
23
- * Returns the argument unchanged when it is non-empty and made up entirely of
24
- * shell-safe characters; otherwise wraps it in single quotes, escaping embedded
25
- * single quotes with the `'\''` idiom. An empty string becomes `''` so it
26
- * survives as a distinct (empty) argument rather than vanishing.
27
- *
28
- * @param arg the raw argument value to quote
29
- */
30
- export declare function quoteArg(arg: string): string;
31
- /**
32
- * Whether an argument would need quoting on a POSIX shell line.
33
- *
34
- * `true` when the value is empty or contains any character outside the
35
- * shell-safe class. Useful for diagnostics or for deciding whether to render a
36
- * command differently; {@link quoteArg} applies the same test internally.
37
- *
38
- * @param arg the raw argument value to test
39
- */
40
- export declare function needsQuoting(arg: string): boolean;
41
- /**
42
- * Assemble a list of arguments into a single space-separated shell line.
43
- *
44
- * Each element is run through {@link quoteArg}, so the result is safe to hand to
45
- * a shell as one command string. The argument order is preserved; an empty list
46
- * yields an empty string.
47
- *
48
- * @param args the command and its arguments, in invocation order
49
- */
50
- export declare function buildShellCommand(args: readonly string[]): string;
@@ -1,165 +0,0 @@
1
- /**
2
- * Tool-fetch kit — a managed-binary provisioner stub for the native helpers the
3
- * agent shells out to (a fast file finder and a fast content grep, fd / rg).
4
- *
5
- * The agent prefers native binaries when present and otherwise provisions them
6
- * from a project release page into a managed directory. This module owns the
7
- * *resolution and URL-building* half of that flow as a small, injectable stub:
8
- *
9
- * - {@link resolveManagedBinaryPath} computes where a managed binary lives on
10
- * disk (the managed `bin/` directory + the platform-correct file name),
11
- * without touching the filesystem;
12
- * - {@link pickReleaseAsset} selects the right release asset for the host by
13
- * matching a per-tool {@link RegExp} against the asset names a release
14
- * exposes — a regex matcher rather than a per-tool string switch;
15
- * - {@link buildDownloadRequest} renders the asset download URL plus the
16
- * outbound request headers, stamping this kit's own {@link KIT_USER_AGENT}.
17
- *
18
- * The network is *optional and injectable*: nothing here calls `fetch`. A caller
19
- * supplies a {@link ReleaseLookup} (e.g. backed by a release REST endpoint, a
20
- * fixture, or a cache) and this module turns its result into a concrete request.
21
- * That keeps the module pure, host-agnostic, and trivially testable offline.
22
- */
23
- /**
24
- * The `User-Agent` this kit stamps on every outbound provisioning request.
25
- *
26
- * A fresh, self-describing token owned by this module — release hosts expect a
27
- * non-empty agent string, and a distinctive one keeps the agent's traffic
28
- * identifiable in server logs. Versioned so the string can move with the kit.
29
- */
30
- export declare const KIT_USER_AGENT = "indusagi-kit-provisioner/1.0";
31
- /**
32
- * A declarative description of one provisionable native helper.
33
- *
34
- * The provisioner is driven entirely off an array of these: there is no
35
- * per-tool branch anywhere in the flow. {@link assetMatcher} is the load-bearing
36
- * field — a {@link RegExp} tested against each candidate asset name to pick the
37
- * host build, replacing the old per-platform name templates.
38
- */
39
- export interface ToolDescriptor {
40
- /** The bare binary name the agent invokes, e.g. `"fd"` / `"rg"`. */
41
- readonly bin: string;
42
- /** The owner/repo coordinate the release is fetched from, e.g. `"owner/tool"`. */
43
- readonly repo: string;
44
- /**
45
- * A regex selecting this tool's asset for the *current host* from a release's
46
- * asset list. The caller composes platform / arch fragments into the pattern;
47
- * the matcher then does the selection, so adding a tool is data, not code.
48
- */
49
- readonly assetMatcher: RegExp;
50
- }
51
- /**
52
- * Compute the on-disk path of a managed binary without touching the filesystem.
53
- *
54
- * Joins the managed binaries directory with the platform-correct executable
55
- * name — the bare `bin` name on POSIX, the same name with a `.exe` suffix on
56
- * Windows. Pure: it builds a string and never stats the path, so a caller can
57
- * decide separately whether the binary is actually present.
58
- *
59
- * @param binDir the managed binaries directory (e.g. the workspace `bin/`)
60
- * @param bin the bare binary name, e.g. `"fd"`
61
- * @param platform the host platform tag (defaults to `process.platform`)
62
- */
63
- export declare function resolveManagedBinaryPath(binDir: string, bin: string, platform?: NodeJS.Platform): string;
64
- /**
65
- * One downloadable asset on a release, reduced to the two fields the matcher
66
- * and the request builder need.
67
- */
68
- export interface ReleaseAsset {
69
- /** The asset file name matched against a {@link ToolDescriptor.assetMatcher}. */
70
- readonly name: string;
71
- /** The fully-qualified URL the asset bytes are fetched from. */
72
- readonly url: string;
73
- }
74
- /**
75
- * A resolved release: its tag and the assets it exposes.
76
- *
77
- * Whatever produces this — a live REST call, a fixture, a cache — is the
78
- * caller's concern; this module only consumes the shape.
79
- */
80
- export interface ReleaseInfo {
81
- /** The release tag, e.g. `"v1.2.3"`; surfaced for path / version templating. */
82
- readonly tag: string;
83
- /** Every downloadable asset on the release. */
84
- readonly assets: readonly ReleaseAsset[];
85
- }
86
- /**
87
- * The injected, optional network boundary.
88
- *
89
- * A caller supplies a function that resolves a `owner/repo` coordinate to its
90
- * latest {@link ReleaseInfo}. This module never imports a HTTP client; the
91
- * lookup is the single seam where real network access (or a stub) is plugged
92
- * in, keeping {@link buildDownloadRequest} pure and offline-testable.
93
- */
94
- export type ReleaseLookup = (repo: string) => Promise<ReleaseInfo>;
95
- /**
96
- * Select the release asset matching a tool's {@link ToolDescriptor.assetMatcher}.
97
- *
98
- * Tests each asset name against the descriptor's regex and returns the first
99
- * match, or `null` when no asset fits the host (a release that lacks a build for
100
- * this platform / arch). Pure: it filters the supplied list and performs no I/O.
101
- *
102
- * @param descriptor the tool whose asset is being located
103
- * @param release the release whose assets are searched
104
- */
105
- export declare function pickReleaseAsset(descriptor: ToolDescriptor, release: ReleaseInfo): ReleaseAsset | null;
106
- /**
107
- * A ready-to-issue download request: the URL plus the outbound headers.
108
- *
109
- * The caller hands this to whatever HTTP client it owns; this module builds it
110
- * but never sends it (the network stays injectable).
111
- */
112
- export interface DownloadRequest {
113
- /** The asset URL to fetch. */
114
- readonly url: string;
115
- /** The asset file name (useful for the unpack / install step). */
116
- readonly assetName: string;
117
- /** The outbound request headers, including this kit's {@link KIT_USER_AGENT}. */
118
- readonly headers: Readonly<Record<string, string>>;
119
- }
120
- /**
121
- * Render the download request for a selected release asset.
122
- *
123
- * Stamps the kit {@link KIT_USER_AGENT} and an octet-stream `Accept` so the
124
- * release host returns the raw asset rather than a metadata document, then
125
- * carries through the asset URL and name. Pure string assembly — issuing the
126
- * request is the caller's job.
127
- *
128
- * @param asset the asset chosen by {@link pickReleaseAsset}
129
- */
130
- export declare function buildDownloadRequest(asset: ReleaseAsset): DownloadRequest;
131
- /**
132
- * A computed provisioning plan for one tool: where the binary should land and
133
- * how to fetch its bytes.
134
- *
135
- * This is the stub's terminal value — everything needed to perform the install
136
- * (download to {@link DownloadRequest.url}, unpack, move to
137
- * {@link targetPath}, mark executable) without this module performing any of it.
138
- */
139
- export interface ProvisionPlan {
140
- /** The bare binary name being provisioned. */
141
- readonly bin: string;
142
- /** Where the installed binary should live (from {@link resolveManagedBinaryPath}). */
143
- readonly targetPath: string;
144
- /** The release tag the plan was built against. */
145
- readonly tag: string;
146
- /** The request that fetches the matching asset for the host. */
147
- readonly download: DownloadRequest;
148
- }
149
- /**
150
- * Build a {@link ProvisionPlan} for a tool by looking up its latest release and
151
- * selecting the host asset.
152
- *
153
- * Resolves the release through the injected {@link ReleaseLookup}, picks the
154
- * asset via {@link pickReleaseAsset}, and assembles the on-disk target path and
155
- * the download request. The network touch is entirely the caller-supplied
156
- * `lookup`; this function adds no I/O of its own. Returns `null` when the
157
- * release exposes no asset for the host, so a caller can fall back to a
158
- * system-installed binary.
159
- *
160
- * @param descriptor the tool to provision
161
- * @param binDir the managed binaries directory the binary installs into
162
- * @param lookup the injected release resolver (the only network seam)
163
- * @param platform the host platform tag (defaults to `process.platform`)
164
- */
165
- export declare function planProvision(descriptor: ToolDescriptor, binDir: string, lookup: ReleaseLookup, platform?: NodeJS.Platform): Promise<ProvisionPlan | null>;
@@ -1,51 +0,0 @@
1
- /**
2
- * Model catalog printer — `printModelCatalog`.
3
- *
4
- * Renders the available models as a padded text table. The data comes from the
5
- * framework {@link ModelRegistry} (via its `getModels` per provider); this module
6
- * re-derives the rows it needs, applies a plain case-insensitive
7
- * {@link CatalogFilter}, sorts by provider then model id, and lays the result out
8
- * as aligned columns with a Title-Case header and a rule row beneath it.
9
- *
10
- * Filtering is a literal substring test — no fuzzy matcher, no external ranking.
11
- * The column set (provider, model, context window, max output, thinking, images)
12
- * is the established model-table shape; only the headers and ordering are this
13
- * module's own.
14
- */
15
- import { ModelRegistry, type KnownProvider, type Model } from "indusagi/ai";
16
- import type { CatalogFilter } from "./contract";
17
- /**
18
- * The minimal sink the catalog prints onto. A test captures the lines into an
19
- * array; production passes a writer over `process.stdout`.
20
- */
21
- export interface CatalogIo {
22
- /** Emit one line of table text. */
23
- print(line: string): void;
24
- }
25
- /** The default {@link CatalogIo} backed by `process.stdout`. */
26
- export declare function defaultCatalogIo(): CatalogIo;
27
- /**
28
- * The seam the catalog sources its raw models from. Defaults to a fresh
29
- * framework {@link ModelRegistry}; tests inject a stand-in to drive the layout
30
- * deterministically.
31
- */
32
- export interface CatalogModelSource {
33
- /** Enumerate the providers to scan. */
34
- providers(): readonly (KnownProvider | string)[];
35
- /** Pull every model for one provider. */
36
- models(provider: string): readonly Model<Model<string>["api"]>[];
37
- }
38
- /** Build a {@link CatalogModelSource} over a framework {@link ModelRegistry}. */
39
- export declare function registrySource(registry?: ModelRegistry): CatalogModelSource;
40
- /**
41
- * Print the model catalog table.
42
- *
43
- * Pulls every model from the framework registry, applies {@link filter}, sorts,
44
- * and writes the aligned table through {@link io}. When the filter matches
45
- * nothing, a single explanatory line is printed instead of an empty table.
46
- *
47
- * @param io the line sink (defaults to `process.stdout`)
48
- * @param filter optional provider / capability / substring narrowing
49
- * @param source optional model source (defaults to the live framework registry)
50
- */
51
- export declare function printModelCatalog(io?: CatalogIo, filter?: CatalogFilter, source?: CatalogModelSource): void;