@warlock.js/ai-cli 5.31.0 → 5.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/cjs/index.cjs +38 -46
- package/cjs/index.cjs.map +1 -1
- package/esm/adapters/aider.d.mts +4 -4
- package/esm/adapters/aider.d.mts.map +1 -1
- package/esm/adapters/amp.d.mts +2 -2
- package/esm/adapters/amp.d.mts.map +1 -1
- package/esm/adapters/antigravity.d.mts +3 -3
- package/esm/adapters/antigravity.d.mts.map +1 -1
- package/esm/adapters/claude-code.d.mts +2 -2
- package/esm/adapters/claude-code.d.mts.map +1 -1
- package/esm/adapters/claude-stream.d.mts +3 -3
- package/esm/adapters/claude-stream.d.mts.map +1 -1
- package/esm/adapters/codex.d.mts +3 -3
- package/esm/adapters/codex.d.mts.map +1 -1
- package/esm/adapters/codex.mjs +10 -8
- package/esm/adapters/codex.mjs.map +1 -1
- package/esm/adapters/copilot.d.mts +3 -3
- package/esm/adapters/copilot.d.mts.map +1 -1
- package/esm/adapters/copilot.mjs +5 -7
- package/esm/adapters/copilot.mjs.map +1 -1
- package/esm/adapters/cursor.d.mts +3 -3
- package/esm/adapters/cursor.d.mts.map +1 -1
- package/esm/adapters/droid.d.mts +3 -3
- package/esm/adapters/droid.d.mts.map +1 -1
- package/esm/adapters/grok.d.mts +3 -3
- package/esm/adapters/grok.d.mts.map +1 -1
- package/esm/adapters/grok.mjs +6 -8
- package/esm/adapters/grok.mjs.map +1 -1
- package/esm/adapters/index.d.mts +2 -1
- package/esm/adapters/index.mjs +1 -1
- package/esm/adapters/kimi.d.mts +3 -3
- package/esm/adapters/kimi.d.mts.map +1 -1
- package/esm/adapters/mistral-vibe.d.mts +3 -3
- package/esm/adapters/mistral-vibe.d.mts.map +1 -1
- package/esm/adapters/mistral-vibe.mjs +5 -7
- package/esm/adapters/mistral-vibe.mjs.map +1 -1
- package/esm/adapters/opencode.d.mts +3 -3
- package/esm/adapters/opencode.d.mts.map +1 -1
- package/esm/adapters/qwen-code.d.mts +2 -2
- package/esm/adapters/qwen-code.d.mts.map +1 -1
- package/esm/adapters/reasonix.d.mts +3 -3
- package/esm/adapters/reasonix.d.mts.map +1 -1
- package/esm/adapters/reasonix.mjs +6 -8
- package/esm/adapters/reasonix.mjs.map +1 -1
- package/esm/adapters/shared.d.mts +19 -16
- package/esm/adapters/shared.d.mts.map +1 -1
- package/esm/cli-agent.d.mts +9 -8
- package/esm/cli-agent.d.mts.map +1 -1
- package/esm/cli.d.mts +11 -8
- package/esm/cli.d.mts.map +1 -1
- package/esm/contracts/adapter.contract.d.mts +52 -31
- package/esm/contracts/adapter.contract.d.mts.map +1 -1
- package/esm/contracts/events.type.d.mts +36 -24
- package/esm/contracts/events.type.d.mts.map +1 -1
- package/esm/contracts/index.d.mts +2 -1
- package/esm/contracts/mcp.type.d.mts +4 -5
- package/esm/contracts/mcp.type.d.mts.map +1 -1
- package/esm/contracts/options.type.d.mts +56 -31
- package/esm/contracts/options.type.d.mts.map +1 -1
- package/esm/errors.d.mts +11 -9
- package/esm/errors.d.mts.map +1 -1
- package/esm/index.d.mts +2 -0
- package/esm/model/cli-model.d.mts +8 -7
- package/esm/model/cli-model.d.mts.map +1 -1
- package/esm/probe/probe.d.mts +4 -4
- package/esm/probe/probe.d.mts.map +1 -1
- package/esm/probe/probe.mjs +2 -2
- package/esm/probe/probe.mjs.map +1 -1
- package/esm/session/aggregate.mjs +2 -4
- package/esm/session/aggregate.mjs.map +1 -1
- package/esm/session/environment.mjs +1 -1
- package/esm/spawn/invocation.d.mts +6 -7
- package/esm/spawn/invocation.d.mts.map +1 -1
- package/esm/spawn/invocation.mjs +3 -3
- package/esm/spawn/invocation.mjs.map +1 -1
- package/esm/spawn/resolve-command.d.mts +12 -10
- package/esm/spawn/resolve-command.d.mts.map +1 -1
- package/esm/stream/json-lines.d.mts +10 -10
- package/esm/stream/json-lines.d.mts.map +1 -1
- package/esm/stream/line-splitter.mjs +2 -2
- package/esm/stream/line-splitter.mjs.map +1 -1
- package/esm/utils/toml.d.mts +3 -4
- package/esm/utils/toml.d.mts.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CliParsedEvent } from "./events.type.mjs";
|
|
2
2
|
import { CliMcpServers } from "./mcp.type.mjs";
|
|
3
3
|
import { ReasoningEffort } from "@warlock.js/ai";
|
|
4
|
-
|
|
5
4
|
//#region ../../packages/ai-cli/src/contracts/adapter.contract.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Permission mode for a run.
|
|
@@ -11,24 +10,28 @@ import { ReasoningEffort } from "@warlock.js/ai";
|
|
|
11
10
|
* - `bypass` — every tool call is approved without asking (each vendor's
|
|
12
11
|
* "yolo"/"dangerously skip permissions" switch). Opt in per agent or per run.
|
|
13
12
|
*/
|
|
14
|
-
type CliPermission = "standard" | "bypass";
|
|
13
|
+
export type CliPermission = "standard" | "bypass";
|
|
15
14
|
/**
|
|
16
15
|
* How the prompt reaches the CLI: as an argv element, written to stdin, or
|
|
17
16
|
* written to a file in the run directory whose path is passed (for CLIs
|
|
18
17
|
* with a `--prompt-file` flag).
|
|
19
18
|
*/
|
|
20
|
-
type CliPromptTransport = "argv" | "stdin" | "file";
|
|
19
|
+
export type CliPromptTransport = "argv" | "stdin" | "file";
|
|
21
20
|
/**
|
|
22
21
|
* Everything an adapter needs to build one launch. Built by the runner;
|
|
23
22
|
* adapters only read it.
|
|
24
23
|
*/
|
|
25
|
-
type CliLaunchContext = {
|
|
26
|
-
prompt: string;
|
|
27
|
-
|
|
24
|
+
export type CliLaunchContext = {
|
|
25
|
+
prompt: string;
|
|
26
|
+
/** Where the prompt must go for this plan. */
|
|
27
|
+
transport: CliPromptTransport;
|
|
28
|
+
/** Absolute working directory of the run. */
|
|
28
29
|
cwd: string;
|
|
29
|
-
model?: string;
|
|
30
|
+
model?: string;
|
|
31
|
+
/** Requested reasoning effort; the adapter maps it to the vendor's scale. */
|
|
30
32
|
effort?: ReasoningEffort;
|
|
31
|
-
permission: CliPermission;
|
|
33
|
+
permission: CliPermission;
|
|
34
|
+
/** Session reference to resume (from a previous `session.started` / `done().sessionRef`). */
|
|
32
35
|
resume?: string;
|
|
33
36
|
mcp?: CliMcpServers;
|
|
34
37
|
/**
|
|
@@ -47,25 +50,31 @@ type CliLaunchContext = {
|
|
|
47
50
|
* the adapter may write home-level config files (for example Codex's
|
|
48
51
|
* `config.toml`) into it. `false` for a caller-owned or inherited home.
|
|
49
52
|
*/
|
|
50
|
-
homeIsPrivate: boolean;
|
|
53
|
+
homeIsPrivate: boolean;
|
|
54
|
+
/** A private directory (mode 0700) for run-scoped files; deleted after the run. */
|
|
51
55
|
runDir: string;
|
|
52
56
|
platform: NodeJS.Platform;
|
|
53
57
|
};
|
|
54
58
|
/** A file the runner writes (mode 0600, parent directories 0700) before spawning. */
|
|
55
|
-
type CliLaunchFile = {
|
|
56
|
-
/** Absolute path, inside `context.runDir` or a private `context.home`. */
|
|
59
|
+
export type CliLaunchFile = {
|
|
60
|
+
/** Absolute path, inside `context.runDir` or a private `context.home`. */
|
|
61
|
+
path: string;
|
|
57
62
|
content: string;
|
|
58
63
|
};
|
|
59
64
|
/** What an adapter returns for one launch. */
|
|
60
|
-
type CliLaunchPlan = {
|
|
61
|
-
/** argv after the executable (subcommand and flags). */
|
|
65
|
+
export type CliLaunchPlan = {
|
|
66
|
+
/** argv after the executable (subcommand and flags). */
|
|
67
|
+
args: string[];
|
|
62
68
|
/**
|
|
63
69
|
* argv that must come last, after any caller `args` — typically the
|
|
64
70
|
* positional prompt (`transport: "argv"`).
|
|
65
71
|
*/
|
|
66
|
-
tail?: string[];
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
tail?: string[];
|
|
73
|
+
/** Text written to stdin before it is closed (the prompt, for `transport: "stdin"`). */
|
|
74
|
+
stdin?: string;
|
|
75
|
+
/** Environment the CLI needs on top of the inherited one (config home variables, …). */
|
|
76
|
+
env?: Record<string, string>;
|
|
77
|
+
/** Files to write before spawning (MCP config, …). */
|
|
69
78
|
files?: CliLaunchFile[];
|
|
70
79
|
/**
|
|
71
80
|
* The flags (and subcommands) this plan relies on, spelled as `--help`
|
|
@@ -75,22 +84,28 @@ type CliLaunchPlan = {
|
|
|
75
84
|
requires: string[];
|
|
76
85
|
};
|
|
77
86
|
/** How the capability probe reads the CLI's help and version. */
|
|
78
|
-
type CliProbeSpec = {
|
|
79
|
-
/** Each entry is one help invocation; their outputs are searched together. */
|
|
87
|
+
export type CliProbeSpec = {
|
|
88
|
+
/** Each entry is one help invocation; their outputs are searched together. */
|
|
89
|
+
help: string[][];
|
|
90
|
+
/** Version invocation. */
|
|
80
91
|
version: string[];
|
|
81
92
|
};
|
|
82
93
|
/** Where an adapter's flags and stream format were verified, recorded per adapter. */
|
|
83
|
-
type CliAdapterVerification = {
|
|
84
|
-
/** CLI version the adapter was checked against. */
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
export type CliAdapterVerification = {
|
|
95
|
+
/** CLI version the adapter was checked against. */
|
|
96
|
+
version: string;
|
|
97
|
+
/** `help` — checked against the real `--help` output; `docs` — official docs/source only. */
|
|
98
|
+
verifiedBy: "help" | "docs";
|
|
99
|
+
/** Official documentation / source URLs. */
|
|
100
|
+
sources: string[];
|
|
101
|
+
/** ISO date of the check. */
|
|
87
102
|
checkedAt: string;
|
|
88
103
|
};
|
|
89
104
|
/**
|
|
90
105
|
* A stateful parser for one session's stdout. The runner feeds it complete
|
|
91
106
|
* lines (without the trailing newline) and calls `end()` once stdout closes.
|
|
92
107
|
*/
|
|
93
|
-
type CliStreamParser = {
|
|
108
|
+
export type CliStreamParser = {
|
|
94
109
|
line(line: string): CliParsedEvent[];
|
|
95
110
|
end(): CliParsedEvent[];
|
|
96
111
|
/**
|
|
@@ -125,19 +140,26 @@ type CliStreamParser = {
|
|
|
125
140
|
* ),
|
|
126
141
|
* };
|
|
127
142
|
*/
|
|
128
|
-
type CliAdapter = {
|
|
129
|
-
/** Stable id, e.g. `"claude-code"`. Used in errors and as the model provider name. */
|
|
130
|
-
readonly
|
|
131
|
-
|
|
143
|
+
export type CliAdapter = {
|
|
144
|
+
/** Stable id, e.g. `"claude-code"`. Used in errors and as the model provider name. */
|
|
145
|
+
readonly name: string;
|
|
146
|
+
/** Human name, e.g. `"Claude Code"`. */
|
|
147
|
+
readonly title: string;
|
|
148
|
+
/** Default executable name looked up on `PATH`. */
|
|
149
|
+
readonly command: string;
|
|
150
|
+
/** Environment variables that receive an API key (the first is used for the `apiKey` option). */
|
|
132
151
|
readonly apiKeyEnv: readonly string[];
|
|
133
152
|
/**
|
|
134
153
|
* Environment variables pointed at the config home. Empty when the CLI
|
|
135
154
|
* cannot relocate its config, in which case `home` other than `"inherit"`
|
|
136
155
|
* is refused for it.
|
|
137
156
|
*/
|
|
138
|
-
readonly homeEnv: readonly string[];
|
|
139
|
-
|
|
140
|
-
readonly
|
|
157
|
+
readonly homeEnv: readonly string[];
|
|
158
|
+
/** Prompt transports the CLI accepts, in order of preference. */
|
|
159
|
+
readonly transports: readonly CliPromptTransport[];
|
|
160
|
+
/** Whether the adapter maps `effort` to a vendor flag. */
|
|
161
|
+
readonly effort?: boolean;
|
|
162
|
+
/** Whether the adapter can attach per-run MCP servers. */
|
|
141
163
|
readonly mcp?: boolean;
|
|
142
164
|
readonly probe: CliProbeSpec;
|
|
143
165
|
readonly verification: CliAdapterVerification;
|
|
@@ -150,5 +172,4 @@ type CliAdapter = {
|
|
|
150
172
|
parser(context: CliLaunchContext): CliStreamParser;
|
|
151
173
|
};
|
|
152
174
|
//#endregion
|
|
153
|
-
export { CliAdapter, CliAdapterVerification, CliLaunchContext, CliLaunchFile, CliLaunchPlan, CliPermission, CliProbeSpec, CliPromptTransport, CliStreamParser };
|
|
154
175
|
//# sourceMappingURL=adapter.contract.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.contract.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/contracts/adapter.contract.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"adapter.contract.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/contracts/adapter.contract.ts"],"mappings":";;;;;;;;;;;;YAYY;;;;;;YAOA;;;;;YAMA;EACV;;EAEA,WAAW;;EAEX;EACA;;EAEA,SAAS;EACT,YAAY;;EAEZ;EACA,MAAM;;;;;;EAMN;;;;;EAKA;;;;;;EAMA;;EAEA;EACA,UAAU,OAAO;;;YAIP;;EAEV;EACA;;;YAIU;;EAEV;;;;;EAKA;;EAEA;;EAEA,MAAM;;EAEN,QAAQ;;;;;;EAMR;;;YAIU;;EAEV;;EAEA;;;YAIU;;EAEV;;EAEA;;EAEA;;EAEA;;;;;;YAOU;EACV,KAAK,eAAe;EACpB,OAAO;;;;;;EAMP;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4BU;;WAED;;WAEA;;WAEA;;WAEA;;;;;;WAMA;;WAEA,qBAAqB;;WAErB;;WAEA;WACA,OAAO;WACP,cAAc;EACvB,KAAK,SAAS,mBAAmB;;;;;;EAMjC,OAAO,SAAS,mBAAmB"}
|
|
@@ -10,13 +10,20 @@
|
|
|
10
10
|
* @example
|
|
11
11
|
* const usage: CliUsage = { input: 1200, output: 340, total: 1540, cachedTokens: 800 };
|
|
12
12
|
*/
|
|
13
|
-
type CliUsage = {
|
|
14
|
-
/** Input/prompt tokens (includes `cachedTokens` when the vendor counts them together). */
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
export type CliUsage = {
|
|
14
|
+
/** Input/prompt tokens (includes `cachedTokens` when the vendor counts them together). */
|
|
15
|
+
input: number;
|
|
16
|
+
/** Output/completion tokens. */
|
|
17
|
+
output: number;
|
|
18
|
+
/** `input + output`. */
|
|
19
|
+
total: number;
|
|
20
|
+
/** Input tokens served from the vendor's prompt cache. */
|
|
21
|
+
cachedTokens?: number;
|
|
22
|
+
/** Input tokens written to the vendor's prompt cache. */
|
|
23
|
+
cacheWriteTokens?: number;
|
|
24
|
+
/** Output tokens spent on reasoning, when the vendor reports them. */
|
|
25
|
+
reasoningTokens?: number;
|
|
26
|
+
/** Cost in USD as reported by the CLI itself (never computed by this package). */
|
|
20
27
|
costUSD?: number;
|
|
21
28
|
};
|
|
22
29
|
/**
|
|
@@ -27,12 +34,15 @@ type CliUsage = {
|
|
|
27
34
|
* - `cancelled` — the run's `signal` aborted (or `session.cancel()` was called).
|
|
28
35
|
* - `timeout` — `timeoutMs` elapsed and the process tree was killed.
|
|
29
36
|
*/
|
|
30
|
-
type CliEndStatus = "completed" | "failed" | "cancelled" | "timeout";
|
|
37
|
+
export type CliEndStatus = "completed" | "failed" | "cancelled" | "timeout";
|
|
31
38
|
/** A session started; carries the vendor's session/thread id when it reported one. */
|
|
32
|
-
type CliSessionStartedEvent = {
|
|
33
|
-
type: "session.started";
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
export type CliSessionStartedEvent = {
|
|
40
|
+
type: "session.started";
|
|
41
|
+
/** Reference to pass back as `resume` to continue this session. */
|
|
42
|
+
sessionRef?: string;
|
|
43
|
+
/** Model the CLI reported it is using. */
|
|
44
|
+
model?: string;
|
|
45
|
+
/** The vendor's original record, for debugging. */
|
|
36
46
|
raw?: unknown;
|
|
37
47
|
};
|
|
38
48
|
/**
|
|
@@ -40,7 +50,7 @@ type CliSessionStartedEvent = {
|
|
|
40
50
|
* written; `delta: false` is a complete message. `final: true` marks the
|
|
41
51
|
* vendor's own "final answer" record (for example Claude Code's `result`).
|
|
42
52
|
*/
|
|
43
|
-
type CliMessageEvent = {
|
|
53
|
+
export type CliMessageEvent = {
|
|
44
54
|
type: "message";
|
|
45
55
|
text: string;
|
|
46
56
|
delta: boolean;
|
|
@@ -48,15 +58,16 @@ type CliMessageEvent = {
|
|
|
48
58
|
raw?: unknown;
|
|
49
59
|
};
|
|
50
60
|
/** The CLI invoked one of its tools (or an MCP tool). */
|
|
51
|
-
type CliToolCallEvent = {
|
|
52
|
-
type: "tool.call";
|
|
61
|
+
export type CliToolCallEvent = {
|
|
62
|
+
type: "tool.call";
|
|
63
|
+
/** Vendor call id, used to pair the call with its `tool.result`. */
|
|
53
64
|
id: string;
|
|
54
65
|
name: string;
|
|
55
66
|
input: unknown;
|
|
56
67
|
raw?: unknown;
|
|
57
68
|
};
|
|
58
69
|
/** A tool finished. `output` is the tool's text output (stringified when structured). */
|
|
59
|
-
type CliToolResultEvent = {
|
|
70
|
+
export type CliToolResultEvent = {
|
|
60
71
|
type: "tool.result";
|
|
61
72
|
id: string;
|
|
62
73
|
output: string;
|
|
@@ -68,7 +79,7 @@ type CliToolResultEvent = {
|
|
|
68
79
|
* reported totals for the whole session so far); `cumulative: false` adds
|
|
69
80
|
* to it (the vendor reported one turn).
|
|
70
81
|
*/
|
|
71
|
-
type CliUsageEvent = {
|
|
82
|
+
export type CliUsageEvent = {
|
|
72
83
|
type: "usage";
|
|
73
84
|
usage: CliUsage;
|
|
74
85
|
cumulative: boolean;
|
|
@@ -78,17 +89,19 @@ type CliUsageEvent = {
|
|
|
78
89
|
* Something went wrong. `fatal: true` means the vendor reported the run as
|
|
79
90
|
* failed; the session then ends `failed` even when the process exits 0.
|
|
80
91
|
*/
|
|
81
|
-
type CliErrorEvent = {
|
|
92
|
+
export type CliErrorEvent = {
|
|
82
93
|
type: "error";
|
|
83
94
|
message: string;
|
|
84
95
|
fatal?: boolean;
|
|
85
96
|
raw?: unknown;
|
|
86
97
|
};
|
|
87
98
|
/** The process exited and the stream is drained. Always the last event. */
|
|
88
|
-
type CliSessionEndedEvent = {
|
|
99
|
+
export type CliSessionEndedEvent = {
|
|
89
100
|
type: "session.ended";
|
|
90
|
-
status: CliEndStatus;
|
|
91
|
-
|
|
101
|
+
status: CliEndStatus;
|
|
102
|
+
/** Process exit code; `null` when the process never started or died by signal. */
|
|
103
|
+
exitCode: number | null;
|
|
104
|
+
/** Terminating signal, when the process died by one. */
|
|
92
105
|
signal: string | null;
|
|
93
106
|
sessionRef?: string;
|
|
94
107
|
durationMs: number;
|
|
@@ -103,9 +116,8 @@ type CliSessionEndedEvent = {
|
|
|
103
116
|
* if (event.type === "tool.call") console.log("→", event.name, event.input);
|
|
104
117
|
* }
|
|
105
118
|
*/
|
|
106
|
-
type CliEvent = CliSessionStartedEvent | CliMessageEvent | CliToolCallEvent | CliToolResultEvent | CliUsageEvent | CliErrorEvent | CliSessionEndedEvent;
|
|
119
|
+
export type CliEvent = CliSessionStartedEvent | CliMessageEvent | CliToolCallEvent | CliToolResultEvent | CliUsageEvent | CliErrorEvent | CliSessionEndedEvent;
|
|
107
120
|
/** Events an adapter's stream parser may emit (`session.ended` is emitted by the runner). */
|
|
108
|
-
type CliParsedEvent = Exclude<CliEvent, CliSessionEndedEvent>;
|
|
121
|
+
export type CliParsedEvent = Exclude<CliEvent, CliSessionEndedEvent>;
|
|
109
122
|
//#endregion
|
|
110
|
-
export { CliEndStatus, CliErrorEvent, CliEvent, CliMessageEvent, CliParsedEvent, CliSessionEndedEvent, CliSessionStartedEvent, CliToolCallEvent, CliToolResultEvent, CliUsage, CliUsageEvent };
|
|
111
123
|
//# sourceMappingURL=events.type.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.type.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/contracts/events.type.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"events.type.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/contracts/events.type.ts"],"mappings":";;;;;;;;;;;;YAWY;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;YAWU;;YAGA;EACV;;EAEA;;EAEA;;EAEA;;;;;;;YAQU;EACV;EACA;EACA;EACA;EACA;;;YAIU;EACV;;EAEA;EACA;EACA;EACA;;;YAIU;EACV;EACA;EACA;EACA;EACA;;;;;;;YAQU;EACV;EACA,OAAO;EACP;EACA;;;;;;YAOU;EACV;EACA;EACA;EACA;;;YAIU;EACV;EACA,QAAQ;;EAER;;EAEA;EACA;EACA;;;;;;;;;;;;YAaU,WACR,yBACA,kBACA,mBACA,qBACA,gBACA,gBACA;;YAGQ,iBAAiB,QAAQ,UAAU"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CliEndStatus, CliErrorEvent, CliEvent, CliMessageEvent, CliParsedEvent, CliSessionEndedEvent, CliSessionStartedEvent, CliToolCallEvent, CliToolResultEvent, CliUsage, CliUsageEvent } from "./events.type.mjs";
|
|
2
2
|
import { CliMcpRemoteServer, CliMcpServer, CliMcpServers, CliMcpStdioServer } from "./mcp.type.mjs";
|
|
3
3
|
import { CliAdapter, CliAdapterVerification, CliLaunchContext, CliLaunchFile, CliLaunchPlan, CliPermission, CliProbeSpec, CliPromptTransport, CliStreamParser } from "./adapter.contract.mjs";
|
|
4
|
-
import { CliAgentOptions, CliHome, CliProbeResult, CliResult, CliRunOptions, CliSession } from "./options.type.mjs";
|
|
4
|
+
import { CliAgentOptions, CliHome, CliProbeResult, CliResult, CliRunOptions, CliSession } from "./options.type.mjs";
|
|
5
|
+
export type { CliAdapter, CliAdapterVerification, CliAgentOptions, CliEndStatus, CliErrorEvent, CliEvent, CliHome, CliLaunchContext, CliLaunchFile, CliLaunchPlan, CliMcpRemoteServer, CliMcpServer, CliMcpServers, CliMcpStdioServer, CliMessageEvent, CliParsedEvent, CliPermission, CliProbeResult, CliProbeSpec, CliPromptTransport, CliResult, CliRunOptions, CliSession, CliSessionEndedEvent, CliSessionStartedEvent, CliStreamParser, CliToolCallEvent, CliToolResultEvent, CliUsage, CliUsageEvent };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* `env` values usually hold tokens — they are written only into a 0600
|
|
5
5
|
* config file inside the run's private directory, never into argv.
|
|
6
6
|
*/
|
|
7
|
-
type CliMcpStdioServer = {
|
|
7
|
+
export type CliMcpStdioServer = {
|
|
8
8
|
type: "stdio";
|
|
9
9
|
command: string;
|
|
10
10
|
args?: string[];
|
|
@@ -15,15 +15,14 @@ type CliMcpStdioServer = {
|
|
|
15
15
|
* `headers` usually hold an `Authorization` token — written only into the
|
|
16
16
|
* run's 0600 config file, never into argv.
|
|
17
17
|
*/
|
|
18
|
-
type CliMcpRemoteServer = {
|
|
18
|
+
export type CliMcpRemoteServer = {
|
|
19
19
|
type: "http" | "sse";
|
|
20
20
|
url: string;
|
|
21
21
|
headers?: Record<string, string>;
|
|
22
22
|
};
|
|
23
23
|
/** One MCP server, in the vendor-neutral shape every adapter renders to its own config format. */
|
|
24
|
-
type CliMcpServer = CliMcpStdioServer | CliMcpRemoteServer;
|
|
24
|
+
export type CliMcpServer = CliMcpStdioServer | CliMcpRemoteServer;
|
|
25
25
|
/** MCP servers for a run, keyed by the server name the CLI will show. */
|
|
26
|
-
type CliMcpServers = Record<string, CliMcpServer>;
|
|
26
|
+
export type CliMcpServers = Record<string, CliMcpServer>;
|
|
27
27
|
//#endregion
|
|
28
|
-
export { CliMcpRemoteServer, CliMcpServer, CliMcpServers, CliMcpStdioServer };
|
|
29
28
|
//# sourceMappingURL=mcp.type.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.type.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/contracts/mcp.type.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp.type.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/contracts/mcp.type.ts"],"mappings":";;;;;;YAKY;EACV;EACA;EACA;EACA,MAAM;;;;;;;YAQI;EACV;EACA;EACA,UAAU;;;YAIA,eAAe,oBAAoB;;YAGnC,gBAAgB,eAAe"}
|
|
@@ -2,7 +2,6 @@ import { CliEndStatus, CliEvent, CliUsage } from "./events.type.mjs";
|
|
|
2
2
|
import { CliMcpServers } from "./mcp.type.mjs";
|
|
3
3
|
import { CliPermission } from "./adapter.contract.mjs";
|
|
4
4
|
import { ReasoningEffort } from "@warlock.js/ai";
|
|
5
|
-
|
|
6
5
|
//#region ../../packages/ai-cli/src/contracts/options.type.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Where the CLI keeps its config for a run.
|
|
@@ -16,24 +15,37 @@ import { ReasoningEffort } from "@warlock.js/ai";
|
|
|
16
15
|
* per-run directory.
|
|
17
16
|
* - `"inherit"` — the CLI's normal home of the current user.
|
|
18
17
|
*/
|
|
19
|
-
type CliHome = "private" | "inherit" | (string & {});
|
|
18
|
+
export type CliHome = "private" | "inherit" | (string & {});
|
|
20
19
|
/** Options shared by a CLI agent's defaults and a single run. */
|
|
21
|
-
type CliRunOptions = {
|
|
22
|
-
/** Working directory of the run. Default: `process.cwd()`. */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
export type CliRunOptions = {
|
|
21
|
+
/** Working directory of the run. Default: `process.cwd()`. */
|
|
22
|
+
cwd?: string;
|
|
23
|
+
/** Session reference to resume (`done().sessionRef` of an earlier run). */
|
|
24
|
+
resume?: string;
|
|
25
|
+
/** Cancels the run and kills the CLI's whole process tree. */
|
|
26
|
+
signal?: AbortSignal;
|
|
27
|
+
/** Kills the process tree after this many milliseconds (status `timeout`). */
|
|
28
|
+
timeoutMs?: number;
|
|
29
|
+
/** Vendor model id or alias, passed to the CLI's model flag. */
|
|
30
|
+
model?: string;
|
|
31
|
+
/** Reasoning effort, mapped to the vendor's scale. Refused for CLIs without an effort control. */
|
|
32
|
+
effort?: ReasoningEffort;
|
|
33
|
+
/** `"standard"` (default) or `"bypass"` (approve every tool call — opt in only). */
|
|
34
|
+
permission?: CliPermission;
|
|
35
|
+
/** Per-run MCP servers, written to a 0600 config file — never argv. */
|
|
36
|
+
mcp?: CliMcpServers;
|
|
37
|
+
/** Extra environment for the CLI (wins over inherited variables). */
|
|
38
|
+
env?: Record<string, string>;
|
|
39
|
+
/** API key, exported as the adapter's first `apiKeyEnv` variable. Never placed in argv. */
|
|
40
|
+
apiKey?: string;
|
|
41
|
+
/** Extra argv appended after the adapter's own flags. Do not put secrets here. */
|
|
32
42
|
args?: string[];
|
|
33
43
|
};
|
|
34
44
|
/** Configuration of a CLI agent (`cli.claudeCode({...})`). */
|
|
35
|
-
type CliAgentOptions = CliRunOptions & {
|
|
36
|
-
/** Executable to run instead of the adapter's default (a name on `PATH` or an absolute path). */
|
|
45
|
+
export type CliAgentOptions = CliRunOptions & {
|
|
46
|
+
/** Executable to run instead of the adapter's default (a name on `PATH` or an absolute path). */
|
|
47
|
+
command?: string;
|
|
48
|
+
/** Config home. Default `"private"`. */
|
|
37
49
|
home?: CliHome;
|
|
38
50
|
/**
|
|
39
51
|
* Which of the current process's environment variables the CLI inherits.
|
|
@@ -48,40 +60,53 @@ type CliAgentOptions = CliRunOptions & {
|
|
|
48
60
|
* Default `true`. Turning it off skips the flag check — a CLI version
|
|
49
61
|
* whose flags changed then fails at run time instead of up front.
|
|
50
62
|
*/
|
|
51
|
-
probe?: boolean;
|
|
63
|
+
probe?: boolean;
|
|
64
|
+
/** Grace period between SIGTERM and SIGKILL when a run is cancelled (POSIX). Default 2000 ms. */
|
|
52
65
|
killGraceMs?: number;
|
|
53
66
|
};
|
|
54
67
|
/** What `session.done()` resolves to. */
|
|
55
|
-
type CliResult = {
|
|
56
|
-
status: CliEndStatus;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
export type CliResult = {
|
|
69
|
+
status: CliEndStatus;
|
|
70
|
+
/** The final answer: the vendor's final record, else the last assistant message. */
|
|
71
|
+
text: string;
|
|
72
|
+
/** Every complete assistant message, in order. */
|
|
73
|
+
messages: string[];
|
|
74
|
+
/** Accumulated usage, or `undefined` when the CLI reported none. */
|
|
75
|
+
usage?: CliUsage;
|
|
76
|
+
/** Pass as `resume` to continue this session. */
|
|
60
77
|
sessionRef?: string;
|
|
61
78
|
exitCode: number | null;
|
|
62
|
-
signal: string | null;
|
|
63
|
-
|
|
79
|
+
signal: string | null;
|
|
80
|
+
/** First fatal error, or a summary of stderr when the run failed. */
|
|
81
|
+
error?: string;
|
|
82
|
+
/** The last 64 KiB of stderr. */
|
|
64
83
|
stderr: string;
|
|
65
84
|
durationMs: number;
|
|
66
85
|
};
|
|
67
86
|
/** A running CLI session. */
|
|
68
|
-
type CliSession = {
|
|
69
|
-
/** Adapter name, e.g. `"claude-code"`. */
|
|
87
|
+
export type CliSession = {
|
|
88
|
+
/** Adapter name, e.g. `"claude-code"`. */
|
|
89
|
+
readonly adapter: string;
|
|
90
|
+
/** Process id of the spawned CLI. */
|
|
70
91
|
readonly pid: number | undefined;
|
|
71
92
|
/**
|
|
72
93
|
* The normalized event stream. Every iteration replays from the first
|
|
73
94
|
* event, so several consumers may read it; it ends after `session.ended`.
|
|
74
95
|
*/
|
|
75
|
-
readonly events: AsyncIterable<CliEvent>;
|
|
76
|
-
|
|
96
|
+
readonly events: AsyncIterable<CliEvent>;
|
|
97
|
+
/** Resolves once the process exits and the stream is drained. Never rejects. */
|
|
98
|
+
done(): Promise<CliResult>;
|
|
99
|
+
/** Cancel the run (kills the process tree); `done()` then resolves `cancelled`. */
|
|
77
100
|
cancel(): void;
|
|
78
101
|
};
|
|
79
102
|
/** Result of the capability probe. */
|
|
80
|
-
type CliProbeResult = {
|
|
81
|
-
/** Resolved executable path. */
|
|
82
|
-
|
|
103
|
+
export type CliProbeResult = {
|
|
104
|
+
/** Resolved executable path. */
|
|
105
|
+
executable: string;
|
|
106
|
+
/** First version-looking token of `--version`, or the trimmed output. */
|
|
107
|
+
version: string;
|
|
108
|
+
/** Concatenated help output the required flags are checked against. */
|
|
83
109
|
help: string;
|
|
84
110
|
};
|
|
85
111
|
//#endregion
|
|
86
|
-
export { CliAgentOptions, CliHome, CliProbeResult, CliResult, CliRunOptions, CliSession };
|
|
87
112
|
//# sourceMappingURL=options.type.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.type.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/contracts/options.type.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.type.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/contracts/options.type.ts"],"mappings":";;;;;;;;;;;;;;;;;YAiBY;;YAGA;;EAEV;;EAEA;;EAEA,SAAS;;EAET;;EAEA;;EAEA,SAAS;;EAET,aAAa;;EAEb,MAAM;;EAEN,MAAM;;EAEN;;EAEA;;;YAIU,kBAAkB;;EAE5B;;EAEA,OAAO;;;;;;;;EAQP;;;;;;EAMA;;EAEA;;;YAIU;EACV,QAAQ;;EAER;;EAEA;;EAEA,QAAQ;;EAER;EACA;EACA;;EAEA;;EAEA;EACA;;;YAIU;;WAED;;WAEA;;;;;WAKA,QAAQ,cAAc;;EAE/B,QAAQ,QAAQ;;EAEhB;;;YAIU;;EAEV;;EAEA;;EAEA"}
|
package/esm/errors.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AIErrorOptions, ProviderError } from "@warlock.js/ai";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/ai-cli/src/errors.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Why a CLI agent refused or failed a run.
|
|
@@ -11,12 +10,16 @@ import { AIErrorOptions, ProviderError } from "@warlock.js/ai";
|
|
|
11
10
|
* - `prompt-transport` — the prompt fits neither argv nor stdin for this CLI and platform.
|
|
12
11
|
* - `run-failed` — the session ended `failed` or `timeout` (raised by the model adapter).
|
|
13
12
|
*/
|
|
14
|
-
type CliErrorType = "not-found" | "capability" | "probe-failed" | "unsupported-option" | "prompt-transport" | "run-failed";
|
|
15
|
-
type CliErrorOptions = AIErrorOptions & {
|
|
16
|
-
type: CliErrorType;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
export type CliErrorType = "not-found" | "capability" | "probe-failed" | "unsupported-option" | "prompt-transport" | "run-failed";
|
|
14
|
+
export type CliErrorOptions = AIErrorOptions & {
|
|
15
|
+
type: CliErrorType;
|
|
16
|
+
/** Adapter name, e.g. `"codex"`. */
|
|
17
|
+
adapter: string;
|
|
18
|
+
/** The missing flag, for `capability`. */
|
|
19
|
+
flag?: string;
|
|
20
|
+
/** Detected CLI version, when known. */
|
|
21
|
+
version?: string;
|
|
22
|
+
/** Resolved executable, when known. */
|
|
20
23
|
executable?: string;
|
|
21
24
|
};
|
|
22
25
|
/**
|
|
@@ -33,7 +36,7 @@ type CliErrorOptions = AIErrorOptions & {
|
|
|
33
36
|
* }
|
|
34
37
|
* }
|
|
35
38
|
*/
|
|
36
|
-
declare class CliError extends ProviderError {
|
|
39
|
+
export declare class CliError extends ProviderError {
|
|
37
40
|
readonly type: CliErrorType;
|
|
38
41
|
readonly adapter: string;
|
|
39
42
|
readonly flag?: string;
|
|
@@ -42,5 +45,4 @@ declare class CliError extends ProviderError {
|
|
|
42
45
|
constructor(message: string, options: CliErrorOptions);
|
|
43
46
|
}
|
|
44
47
|
//#endregion
|
|
45
|
-
export { CliError, CliErrorOptions, CliErrorType };
|
|
46
48
|
//# sourceMappingURL=errors.d.mts.map
|
package/esm/errors.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../../../../../../packages/ai-cli/src/errors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../../../../../../packages/ai-cli/src/errors.ts"],"mappings":";;;;;;;;;;;;YAYY;YAQA,kBAAkB;EAC5B,MAAM;;EAEN;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;;;;qBAiBW,iBAAiB;WACZ,MAAM;WACN;WACA;WACA;WACA;EAEhB,YAAmB,iBAAiB,SAAS"}
|
package/esm/index.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import { CliEndStatus, CliErrorEvent, CliEvent, CliMessageEvent, CliParsedEvent,
|
|
|
2
2
|
import { CliMcpRemoteServer, CliMcpServer, CliMcpServers, CliMcpStdioServer } from "./contracts/mcp.type.mjs";
|
|
3
3
|
import { CliAdapter, CliAdapterVerification, CliLaunchContext, CliLaunchFile, CliLaunchPlan, CliPermission, CliProbeSpec, CliPromptTransport, CliStreamParser } from "./contracts/adapter.contract.mjs";
|
|
4
4
|
import { CliAgentOptions, CliHome, CliProbeResult, CliResult, CliRunOptions, CliSession } from "./contracts/options.type.mjs";
|
|
5
|
+
import "./contracts/index.mjs";
|
|
5
6
|
import { CliError, CliErrorOptions, CliErrorType } from "./errors.mjs";
|
|
6
7
|
import { CliModelConfig, cliModel, renderPrompt, toUsage } from "./model/cli-model.mjs";
|
|
7
8
|
import { CmdShimTarget, CommandLookup, SpawnTarget, findExecutable, parseCmdShim, resolveSpawnTarget } from "./spawn/resolve-command.mjs";
|
|
@@ -26,6 +27,7 @@ import { createOpencodeParser, opencodeAdapter } from "./adapters/opencode.mjs";
|
|
|
26
27
|
import { qwenCodeAdapter } from "./adapters/qwen-code.mjs";
|
|
27
28
|
import { createReasonixParser, reasonixAdapter } from "./adapters/reasonix.mjs";
|
|
28
29
|
import { anthropicUsage, argvPrompt, dotenvFile, jsonFile, mapEffort, mcpServersJson, parseArguments, promptFile, requirePrivateHome, unsupportedOption, usageOf } from "./adapters/shared.mjs";
|
|
30
|
+
import "./adapters/index.mjs";
|
|
29
31
|
import { CliVendor, cli, cliAdapters } from "./cli.mjs";
|
|
30
32
|
export { type ClaudeStreamUsage, type CliAdapter, type CliAdapterVerification, type CliAgent, type CliAgentOptions, type CliEndStatus, CliError, type CliErrorEvent, type CliErrorOptions, type CliErrorType, type CliEvent, type CliHome, type CliHost, type CliLaunchContext, type CliLaunchFile, type CliLaunchPlan, type CliMcpRemoteServer, type CliMcpServer, type CliMcpServers, type CliMcpStdioServer, type CliMessageEvent, type CliModelConfig, type CliParsedEvent, type CliPermission, type CliProbeResult, type CliProbeSpec, type CliPromptTransport, type CliResult, type CliRunOptions, type CliSession, type CliSessionEndedEvent, type CliSessionStartedEvent, type CliStreamParser, type CliToolCallEvent, type CliToolResultEvent, type CliUsage, type CliUsageEvent, type CliVendor, type CmdShimTarget, type CommandLookup, type Invocation, type JsonRecord, type SpawnTarget, type TomlTable, type TomlValue, aiderAdapter, ampAdapter, anthropicUsage, antigravityAdapter, argvPrompt, asArray, asRecord, buildInvocation, claudeCodeAdapter, cli, cliAdapters, cliModel, codexAdapter, copilotAdapter, createAiderParser, createAntigravityParser, createClaudeStreamParser, createCliAgent, createCodexParser, createCopilotParser, createCursorParser, createDroidParser, createGrokParser, createKimiParser, createOpencodeParser, createReasonixParser, createVibeParser, currentHost, cursorAdapter, dotenvFile, droidAdapter, findExecutable, fitsCommandLine, grokAdapter, helpLists, jsonFile, jsonLinesParser, kimiAdapter, mapEffort, mcpServersJson, missingFlags, mistralVibeAdapter, numberField, opencodeAdapter, outputText, parseAiderCount, parseArguments, parseCmdShim, parseJsonLine, parseVersion, promptFile, quoteForCmd, qwenCodeAdapter, reasonixAdapter, recordField, renderPrompt, requirePrivateHome, resolveSpawnTarget, stringField, toToml, toUsage, unsupportedOption, usageOf };
|
|
31
33
|
import "./cli.mjs";
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { CliUsage } from "../contracts/events.type.mjs";
|
|
2
2
|
import { CliRunOptions } from "../contracts/options.type.mjs";
|
|
3
|
+
import "../contracts/index.mjs";
|
|
3
4
|
import { CliAgent } from "../cli-agent.mjs";
|
|
4
5
|
import { Message, ModelContract, ModelPricing, Usage } from "@warlock.js/ai";
|
|
5
|
-
|
|
6
6
|
//#region ../../packages/ai-cli/src/model/cli-model.d.ts
|
|
7
7
|
/** Configuration of a CLI-backed model. Run options apply to every call. */
|
|
8
|
-
type CliModelConfig = CliRunOptions & {
|
|
9
|
-
/** Model name reported to the agent, reports and observers. Default: `model`, else the adapter name. */
|
|
8
|
+
export type CliModelConfig = CliRunOptions & {
|
|
9
|
+
/** Model name reported to the agent, reports and observers. Default: `model`, else the adapter name. */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** Per-million-token pricing, so the agent computes `Usage.cost` (and USD budgets apply). */
|
|
10
12
|
pricing?: ModelPricing;
|
|
11
13
|
};
|
|
12
14
|
/**
|
|
@@ -18,9 +20,9 @@ type CliModelConfig = CliRunOptions & {
|
|
|
18
20
|
* renderPrompt([{ role: "system", content: "Be brief." }, { role: "user", content: "Hi" }], "codex");
|
|
19
21
|
* // "Be brief.\n\nHi"
|
|
20
22
|
*/
|
|
21
|
-
declare function renderPrompt(messages: Message[], adapter: string): string;
|
|
23
|
+
export declare function renderPrompt(messages: Message[], adapter: string): string;
|
|
22
24
|
/** Map CLI usage to the framework `Usage` (zeros when the CLI reported none). */
|
|
23
|
-
declare function toUsage(usage: CliUsage | undefined): Usage;
|
|
25
|
+
export declare function toUsage(usage: CliUsage | undefined): Usage;
|
|
24
26
|
/**
|
|
25
27
|
* A `ModelContract` backed by a CLI agent, so `ai.agent({ model })` — and
|
|
26
28
|
* its budget, guardrail, observer and fallback middleware — can drive a
|
|
@@ -42,7 +44,6 @@ declare function toUsage(usage: CliUsage | undefined): Usage;
|
|
|
42
44
|
* });
|
|
43
45
|
* const { text } = await reviewer.execute("Review the last commit.");
|
|
44
46
|
*/
|
|
45
|
-
declare function cliModel(agent: CliAgent, config?: CliModelConfig): ModelContract;
|
|
47
|
+
export declare function cliModel(agent: CliAgent, config?: CliModelConfig): ModelContract;
|
|
46
48
|
//#endregion
|
|
47
|
-
export { CliModelConfig, cliModel, renderPrompt, toUsage };
|
|
48
49
|
//# sourceMappingURL=cli-model.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-model.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/model/cli-model.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"cli-model.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/model/cli-model.ts"],"mappings":";;;;;;;YAeY,iBAAiB;;EAE3B;;EAEA,UAAU;;;;;;;;;;;wBAgCI,aAAa,UAAU,WAAW;;wBA2BlC,QAAQ,OAAO,uBAAuB;;;;;;;;;;;;;;;;;;;;;;wBA2CtC,SAAS,OAAO,UAAU,SAAQ,iBAAsB"}
|
package/esm/probe/probe.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "../contracts/index.mjs";
|
|
1
2
|
//#region ../../packages/ai-cli/src/probe/probe.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* Whether a help screen lists a flag or subcommand. Flags (`--json`, `-p`)
|
|
@@ -8,11 +9,10 @@
|
|
|
8
9
|
* helpLists(" -p, --print Print response", "--print"); // true
|
|
9
10
|
* helpLists(" --output-format <format>", "--output"); // false
|
|
10
11
|
*/
|
|
11
|
-
declare function helpLists(help: string, flag: string): boolean;
|
|
12
|
+
export declare function helpLists(help: string, flag: string): boolean;
|
|
12
13
|
/** The first version-looking token of `--version` output, else its first line. */
|
|
13
|
-
declare function parseVersion(output: string): string;
|
|
14
|
+
export declare function parseVersion(output: string): string;
|
|
14
15
|
/** Flags a plan requires that the help screen does not list. */
|
|
15
|
-
declare function missingFlags(help: string, required: readonly string[]): string[];
|
|
16
|
+
export declare function missingFlags(help: string, required: readonly string[]): string[];
|
|
16
17
|
//#endregion
|
|
17
|
-
export { helpLists, missingFlags, parseVersion };
|
|
18
18
|
//# sourceMappingURL=probe.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probe.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/probe/probe.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"probe.d.mts","names":[],"sources":["../../../../../../../../packages/ai-cli/src/probe/probe.ts"],"mappings":";;;;;;;;;;;wBA0BgB,UAAU,cAAc;;wBAaxB,aAAa;;wBAab,aAAa,cAAc"}
|