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.
- package/CHANGELOG.md +25 -0
- package/LICENSE +661 -0
- package/README.md +95 -1
- package/dist/entry.js +3205 -1585
- package/dist/guardrails.js +47 -515
- package/dist/index.js +3232 -1671
- package/package.json +8 -7
- package/dist/types/addons/addons.test.d.ts +0 -21
- package/dist/types/addons/contract.d.ts +0 -640
- package/dist/types/addons/dispatch/event-dispatcher.d.ts +0 -140
- package/dist/types/addons/dispatch/index.d.ts +0 -23
- package/dist/types/addons/dispatch/tool-interceptor.d.ts +0 -128
- package/dist/types/addons/host.d.ts +0 -246
- package/dist/types/addons/index.d.ts +0 -51
- package/dist/types/addons/manifest.d.ts +0 -56
- package/dist/types/addons/sandbox.d.ts +0 -103
- package/dist/types/addons/surface.d.ts +0 -42
- package/dist/types/boot/auth-vault.d.ts +0 -29
- package/dist/types/boot/boot.d.ts +0 -26
- package/dist/types/boot/boot.test.d.ts +0 -15
- package/dist/types/boot/contract.d.ts +0 -236
- package/dist/types/boot/index.d.ts +0 -20
- package/dist/types/boot/invocation.d.ts +0 -40
- package/dist/types/boot/invocation.test.d.ts +0 -8
- package/dist/types/boot/runners/addon-wiring.d.ts +0 -103
- package/dist/types/boot/runners/addon-wiring.test.d.ts +0 -19
- package/dist/types/boot/runners/checkpoint.d.ts +0 -133
- package/dist/types/boot/runners/checkpoint.test.d.ts +0 -12
- package/dist/types/boot/runners/delegate-runner.d.ts +0 -89
- package/dist/types/boot/runners/delegate-runner.test.d.ts +0 -13
- package/dist/types/boot/runners/index.d.ts +0 -13
- package/dist/types/boot/runners/link-runner.d.ts +0 -20
- package/dist/types/boot/runners/memdir.d.ts +0 -103
- package/dist/types/boot/runners/memdir.test.d.ts +0 -12
- package/dist/types/boot/runners/oneshot-runner.d.ts +0 -19
- package/dist/types/boot/runners/read-state.d.ts +0 -82
- package/dist/types/boot/runners/read-state.test.d.ts +0 -10
- package/dist/types/boot/runners/registry.d.ts +0 -30
- package/dist/types/boot/runners/repl-runner.d.ts +0 -19
- package/dist/types/boot/runners/session-persist.test.d.ts +0 -10
- package/dist/types/boot/runners/session.d.ts +0 -65
- package/dist/types/boot/runners/session.test.d.ts +0 -10
- package/dist/types/boot/stages.d.ts +0 -92
- package/dist/types/boot/upgrade/apply.d.ts +0 -45
- package/dist/types/boot/upgrade/index.d.ts +0 -13
- package/dist/types/boot/upgrade/upgrades.d.ts +0 -126
- package/dist/types/briefing/briefing.test.d.ts +0 -15
- package/dist/types/briefing/compose.d.ts +0 -37
- package/dist/types/briefing/context-docs.d.ts +0 -38
- package/dist/types/briefing/context-docs.test.d.ts +0 -18
- package/dist/types/briefing/contract.d.ts +0 -686
- package/dist/types/briefing/index.d.ts +0 -29
- package/dist/types/briefing/macros.d.ts +0 -206
- package/dist/types/briefing/skills.d.ts +0 -67
- package/dist/types/capability-deck/bridge-ledger/index.d.ts +0 -25
- package/dist/types/capability-deck/bridge-ledger/key.d.ts +0 -65
- package/dist/types/capability-deck/bridge-ledger/ledger.d.ts +0 -129
- package/dist/types/capability-deck/bridge-ledger/network.d.ts +0 -115
- package/dist/types/capability-deck/builtin-bridge.d.ts +0 -114
- package/dist/types/capability-deck/capability-deck.test.d.ts +0 -18
- package/dist/types/capability-deck/cards/bg-process-card.d.ts +0 -99
- package/dist/types/capability-deck/cards/index.d.ts +0 -37
- package/dist/types/capability-deck/cards/memory-card.d.ts +0 -68
- package/dist/types/capability-deck/cards/plan-file.d.ts +0 -56
- package/dist/types/capability-deck/cards/plan-tools.d.ts +0 -97
- package/dist/types/capability-deck/cards/plan-tools.test.d.ts +0 -9
- package/dist/types/capability-deck/cards/saas-card.d.ts +0 -78
- package/dist/types/capability-deck/cards/task-card.d.ts +0 -106
- package/dist/types/capability-deck/cards/todo-card.d.ts +0 -78
- package/dist/types/capability-deck/cards/workflow-card.d.ts +0 -55
- package/dist/types/capability-deck/cards/workflow-card.test.d.ts +0 -12
- package/dist/types/capability-deck/checkpoint.int.test.d.ts +0 -25
- package/dist/types/capability-deck/contract.d.ts +0 -317
- package/dist/types/capability-deck/index.d.ts +0 -46
- package/dist/types/capability-deck/manifest.d.ts +0 -60
- package/dist/types/capability-deck/provision.d.ts +0 -76
- package/dist/types/capability-deck/read-edit-gate.int.test.d.ts +0 -21
- package/dist/types/channels/channels.test.d.ts +0 -15
- package/dist/types/channels/contract.d.ts +0 -489
- package/dist/types/channels/framer.d.ts +0 -49
- package/dist/types/channels/index.d.ts +0 -24
- package/dist/types/channels/link/dialog.d.ts +0 -138
- package/dist/types/channels/link/driver.d.ts +0 -81
- package/dist/types/channels/link/index.d.ts +0 -13
- package/dist/types/channels/link/server.d.ts +0 -70
- package/dist/types/channels/oneshot.d.ts +0 -37
- package/dist/types/channels/ops.d.ts +0 -89
- package/dist/types/channels/session-ops.d.ts +0 -80
- package/dist/types/conductor/bash-guard.d.ts +0 -106
- package/dist/types/conductor/bash-guard.test.d.ts +0 -17
- package/dist/types/conductor/catalog/catalog.d.ts +0 -87
- package/dist/types/conductor/catalog/index.d.ts +0 -14
- package/dist/types/conductor/catalog/matcher.d.ts +0 -47
- package/dist/types/conductor/conductor.d.ts +0 -189
- package/dist/types/conductor/conductor.test.d.ts +0 -10
- package/dist/types/conductor/contract.d.ts +0 -774
- package/dist/types/conductor/diagnostics.d.ts +0 -183
- package/dist/types/conductor/diagnostics.test.d.ts +0 -10
- package/dist/types/conductor/index.d.ts +0 -26
- package/dist/types/conductor/permission-gate.integration.test.d.ts +0 -22
- package/dist/types/conductor/permission-wiring.test.d.ts +0 -14
- package/dist/types/conductor/permissions.d.ts +0 -217
- package/dist/types/conductor/permissions.test.d.ts +0 -12
- package/dist/types/conductor/plan-mode.integration.test.d.ts +0 -23
- package/dist/types/conductor/post-edit-diagnostics.test.d.ts +0 -13
- package/dist/types/conductor/signal-hub/hub.d.ts +0 -83
- package/dist/types/conductor/signal-hub/index.d.ts +0 -19
- package/dist/types/conductor/signal-hub/translate.d.ts +0 -77
- package/dist/types/conductor/skill-parse/index.d.ts +0 -10
- package/dist/types/conductor/skill-parse/parse.d.ts +0 -67
- package/dist/types/conductor/submit.test.d.ts +0 -28
- package/dist/types/conductor/transcript-store/index.d.ts +0 -16
- package/dist/types/conductor/transcript-store/serialize.d.ts +0 -106
- package/dist/types/conductor/transcript-store/serialize.test.d.ts +0 -10
- package/dist/types/conductor/transcript-store/store.d.ts +0 -188
- package/dist/types/console/components/AgentsView.d.ts +0 -41
- package/dist/types/console/components/BackgroundAgents.d.ts +0 -63
- package/dist/types/console/components/BackgroundAgents.test.d.ts +0 -8
- package/dist/types/console/components/Banner.d.ts +0 -110
- package/dist/types/console/components/Composer.d.ts +0 -37
- package/dist/types/console/components/StatusBar.d.ts +0 -42
- package/dist/types/console/components/TerminalConsole.d.ts +0 -32
- package/dist/types/console/components/WorkingIndicator.d.ts +0 -44
- package/dist/types/console/components/WorkingIndicator.test.d.ts +0 -9
- package/dist/types/console/components/banner-sweep.d.ts +0 -55
- package/dist/types/console/components/banner.test.d.ts +0 -9
- package/dist/types/console/components/welcome.d.ts +0 -115
- package/dist/types/console/components/welcome.test.d.ts +0 -9
- package/dist/types/console/console.test.d.ts +0 -19
- package/dist/types/console/contract.d.ts +0 -598
- package/dist/types/console/index.d.ts +0 -34
- package/dist/types/console/input/complete.d.ts +0 -120
- package/dist/types/console/input/dir-reader.d.ts +0 -28
- package/dist/types/console/input/index.d.ts +0 -24
- package/dist/types/console/input/input.test.d.ts +0 -14
- package/dist/types/console/input/keymap.d.ts +0 -193
- package/dist/types/console/input/paste.d.ts +0 -131
- package/dist/types/console/mount.d.ts +0 -53
- package/dist/types/console/overlays/approval-queue.d.ts +0 -71
- package/dist/types/console/overlays/approval.d.ts +0 -104
- package/dist/types/console/overlays/approval.test.d.ts +0 -17
- package/dist/types/console/overlays/auth.d.ts +0 -31
- package/dist/types/console/overlays/boards.d.ts +0 -55
- package/dist/types/console/overlays/host.d.ts +0 -45
- package/dist/types/console/overlays/index.d.ts +0 -15
- package/dist/types/console/overlays/pickers.d.ts +0 -37
- package/dist/types/console/overlays/sessions.d.ts +0 -29
- package/dist/types/console/reducer.d.ts +0 -51
- package/dist/types/console/slash/builtins.d.ts +0 -33
- package/dist/types/console/slash/commands/dynamic.d.ts +0 -57
- package/dist/types/console/slash/commands/dynamic.test.d.ts +0 -9
- package/dist/types/console/slash/commands/integrations.d.ts +0 -28
- package/dist/types/console/slash/commands/integrations.test.d.ts +0 -18
- package/dist/types/console/slash/commands/shared.d.ts +0 -72
- package/dist/types/console/slash/commands/transcript.d.ts +0 -24
- package/dist/types/console/slash/commands/transcript.test.d.ts +0 -10
- package/dist/types/console/slash/commands/workbench.d.ts +0 -21
- package/dist/types/console/slash/commands/workbench.test.d.ts +0 -10
- package/dist/types/console/slash/index.d.ts +0 -34
- package/dist/types/console/slash/registry.d.ts +0 -90
- package/dist/types/console/slash/resolve.d.ts +0 -109
- package/dist/types/console/slash/slash.test.d.ts +0 -18
- package/dist/types/console/startup.d.ts +0 -119
- package/dist/types/console/theme/adapter.d.ts +0 -79
- package/dist/types/console/theme/index.d.ts +0 -18
- package/dist/types/console/theme/palette.d.ts +0 -77
- package/dist/types/console/theme/resolve.d.ts +0 -45
- package/dist/types/console/theme/theme.test.d.ts +0 -16
- package/dist/types/console/theme/tokens.d.ts +0 -62
- package/dist/types/entry.d.ts +0 -17
- package/dist/types/guardrails.d.ts +0 -33
- package/dist/types/index.d.ts +0 -24
- package/dist/types/insight/channel.d.ts +0 -45
- package/dist/types/insight/contract.d.ts +0 -411
- package/dist/types/insight/index.d.ts +0 -26
- package/dist/types/insight/insight.test.d.ts +0 -17
- package/dist/types/insight/recorder.d.ts +0 -63
- package/dist/types/insight/redaction.d.ts +0 -44
- package/dist/types/insight/replay.d.ts +0 -77
- package/dist/types/insight/sampling.d.ts +0 -84
- package/dist/types/insight/serialize.d.ts +0 -54
- package/dist/types/insight/sinks/console.d.ts +0 -36
- package/dist/types/insight/sinks/file.d.ts +0 -37
- package/dist/types/insight/sinks/index.d.ts +0 -16
- package/dist/types/insight/sinks/stream.d.ts +0 -53
- package/dist/types/kit/clipboard-image.d.ts +0 -40
- package/dist/types/kit/external-editor.d.ts +0 -35
- package/dist/types/kit/image.d.ts +0 -102
- package/dist/types/kit/index.d.ts +0 -29
- package/dist/types/kit/kit.test.d.ts +0 -13
- package/dist/types/kit/shell.d.ts +0 -50
- package/dist/types/kit/tool-fetch.d.ts +0 -165
- package/dist/types/launch/catalog.d.ts +0 -51
- package/dist/types/launch/contract.d.ts +0 -387
- package/dist/types/launch/credentials.d.ts +0 -112
- package/dist/types/launch/index.d.ts +0 -28
- package/dist/types/launch/invocation/attachments.d.ts +0 -72
- package/dist/types/launch/invocation/flags.d.ts +0 -59
- package/dist/types/launch/invocation/index.d.ts +0 -23
- package/dist/types/launch/invocation/read.d.ts +0 -52
- package/dist/types/launch/invocation/usage.d.ts +0 -25
- package/dist/types/launch/launch.test.d.ts +0 -20
- package/dist/types/launch/oauth.d.ts +0 -101
- package/dist/types/launch/packages.d.ts +0 -75
- package/dist/types/launch/packages.test.d.ts +0 -15
- package/dist/types/launch/pickers.d.ts +0 -97
- package/dist/types/runtime-bridge/bridges/_drive.d.ts +0 -74
- package/dist/types/runtime-bridge/bridges/builtins.d.ts +0 -77
- package/dist/types/runtime-bridge/bridges/claude-cli.d.ts +0 -37
- package/dist/types/runtime-bridge/bridges/codex-cli.d.ts +0 -27
- package/dist/types/runtime-bridge/bridges/index.d.ts +0 -15
- package/dist/types/runtime-bridge/bridges/indusagi-cli.d.ts +0 -36
- package/dist/types/runtime-bridge/broker.d.ts +0 -182
- package/dist/types/runtime-bridge/contract.d.ts +0 -436
- package/dist/types/runtime-bridge/index.d.ts +0 -21
- package/dist/types/runtime-bridge/runtime-bridge.test.d.ts +0 -17
- package/dist/types/runtime-bridge/sink.d.ts +0 -59
- package/dist/types/sessions/contract.d.ts +0 -79
- package/dist/types/sessions/index.d.ts +0 -11
- package/dist/types/sessions/library.d.ts +0 -95
- package/dist/types/sessions/sessions.test.d.ts +0 -11
- package/dist/types/settings/contract.d.ts +0 -175
- package/dist/types/settings/index.d.ts +0 -13
- package/dist/types/settings/manager.d.ts +0 -109
- package/dist/types/settings/settings.test.d.ts +0 -16
- package/dist/types/transcript-export/index.d.ts +0 -20
- package/dist/types/transcript-export/publish.d.ts +0 -81
- package/dist/types/transcript-export/sgr.d.ts +0 -90
- package/dist/types/transcript-export/template.d.ts +0 -64
- package/dist/types/transcript-export/theme-bridge.d.ts +0 -99
- package/dist/types/transcript-export/transcript-export.test.d.ts +0 -16
- package/dist/types/window-budget/budget/estimate.d.ts +0 -47
- package/dist/types/window-budget/budget/gate.d.ts +0 -37
- package/dist/types/window-budget/budget/index.d.ts +0 -14
- package/dist/types/window-budget/budget/slice.d.ts +0 -38
- package/dist/types/window-budget/condenser.d.ts +0 -73
- package/dist/types/window-budget/contract.d.ts +0 -182
- package/dist/types/window-budget/index.d.ts +0 -17
- package/dist/types/window-budget/microcompact.d.ts +0 -68
- package/dist/types/window-budget/microcompact.test.d.ts +0 -16
- package/dist/types/window-budget/rehydrate.d.ts +0 -56
- package/dist/types/window-budget/summarize/condense.d.ts +0 -70
- package/dist/types/window-budget/summarize/index.d.ts +0 -12
- package/dist/types/window-budget/summarize/prompt.d.ts +0 -56
- package/dist/types/window-budget/window-budget.test.d.ts +0 -18
- package/dist/types/workflow-engine/agent-runner.d.ts +0 -105
- package/dist/types/workflow-engine/agent-runner.test.d.ts +0 -8
- package/dist/types/workflow-engine/display.d.ts +0 -148
- package/dist/types/workflow-engine/display.test.d.ts +0 -1
- package/dist/types/workflow-engine/engine.d.ts +0 -183
- package/dist/types/workflow-engine/engine.test.d.ts +0 -1
- package/dist/types/workflow-engine/index.d.ts +0 -21
- package/dist/types/workflow-engine/parse.d.ts +0 -64
- package/dist/types/workflow-engine/parse.test.d.ts +0 -1
- package/dist/types/workflow-engine/structured-output.d.ts +0 -51
- package/dist/types/workflow-engine/structured-output.test.d.ts +0 -1
- package/dist/types/workspace/brand.d.ts +0 -26
- package/dist/types/workspace/index.d.ts +0 -11
- package/dist/types/workspace/locator.d.ts +0 -50
- 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;
|