@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.
Files changed (85) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/cjs/index.cjs +38 -46
  3. package/cjs/index.cjs.map +1 -1
  4. package/esm/adapters/aider.d.mts +4 -4
  5. package/esm/adapters/aider.d.mts.map +1 -1
  6. package/esm/adapters/amp.d.mts +2 -2
  7. package/esm/adapters/amp.d.mts.map +1 -1
  8. package/esm/adapters/antigravity.d.mts +3 -3
  9. package/esm/adapters/antigravity.d.mts.map +1 -1
  10. package/esm/adapters/claude-code.d.mts +2 -2
  11. package/esm/adapters/claude-code.d.mts.map +1 -1
  12. package/esm/adapters/claude-stream.d.mts +3 -3
  13. package/esm/adapters/claude-stream.d.mts.map +1 -1
  14. package/esm/adapters/codex.d.mts +3 -3
  15. package/esm/adapters/codex.d.mts.map +1 -1
  16. package/esm/adapters/codex.mjs +10 -8
  17. package/esm/adapters/codex.mjs.map +1 -1
  18. package/esm/adapters/copilot.d.mts +3 -3
  19. package/esm/adapters/copilot.d.mts.map +1 -1
  20. package/esm/adapters/copilot.mjs +5 -7
  21. package/esm/adapters/copilot.mjs.map +1 -1
  22. package/esm/adapters/cursor.d.mts +3 -3
  23. package/esm/adapters/cursor.d.mts.map +1 -1
  24. package/esm/adapters/droid.d.mts +3 -3
  25. package/esm/adapters/droid.d.mts.map +1 -1
  26. package/esm/adapters/grok.d.mts +3 -3
  27. package/esm/adapters/grok.d.mts.map +1 -1
  28. package/esm/adapters/grok.mjs +6 -8
  29. package/esm/adapters/grok.mjs.map +1 -1
  30. package/esm/adapters/index.d.mts +2 -1
  31. package/esm/adapters/index.mjs +1 -1
  32. package/esm/adapters/kimi.d.mts +3 -3
  33. package/esm/adapters/kimi.d.mts.map +1 -1
  34. package/esm/adapters/mistral-vibe.d.mts +3 -3
  35. package/esm/adapters/mistral-vibe.d.mts.map +1 -1
  36. package/esm/adapters/mistral-vibe.mjs +5 -7
  37. package/esm/adapters/mistral-vibe.mjs.map +1 -1
  38. package/esm/adapters/opencode.d.mts +3 -3
  39. package/esm/adapters/opencode.d.mts.map +1 -1
  40. package/esm/adapters/qwen-code.d.mts +2 -2
  41. package/esm/adapters/qwen-code.d.mts.map +1 -1
  42. package/esm/adapters/reasonix.d.mts +3 -3
  43. package/esm/adapters/reasonix.d.mts.map +1 -1
  44. package/esm/adapters/reasonix.mjs +6 -8
  45. package/esm/adapters/reasonix.mjs.map +1 -1
  46. package/esm/adapters/shared.d.mts +19 -16
  47. package/esm/adapters/shared.d.mts.map +1 -1
  48. package/esm/cli-agent.d.mts +9 -8
  49. package/esm/cli-agent.d.mts.map +1 -1
  50. package/esm/cli.d.mts +11 -8
  51. package/esm/cli.d.mts.map +1 -1
  52. package/esm/contracts/adapter.contract.d.mts +52 -31
  53. package/esm/contracts/adapter.contract.d.mts.map +1 -1
  54. package/esm/contracts/events.type.d.mts +36 -24
  55. package/esm/contracts/events.type.d.mts.map +1 -1
  56. package/esm/contracts/index.d.mts +2 -1
  57. package/esm/contracts/mcp.type.d.mts +4 -5
  58. package/esm/contracts/mcp.type.d.mts.map +1 -1
  59. package/esm/contracts/options.type.d.mts +56 -31
  60. package/esm/contracts/options.type.d.mts.map +1 -1
  61. package/esm/errors.d.mts +11 -9
  62. package/esm/errors.d.mts.map +1 -1
  63. package/esm/index.d.mts +2 -0
  64. package/esm/model/cli-model.d.mts +8 -7
  65. package/esm/model/cli-model.d.mts.map +1 -1
  66. package/esm/probe/probe.d.mts +4 -4
  67. package/esm/probe/probe.d.mts.map +1 -1
  68. package/esm/probe/probe.mjs +2 -2
  69. package/esm/probe/probe.mjs.map +1 -1
  70. package/esm/session/aggregate.mjs +2 -4
  71. package/esm/session/aggregate.mjs.map +1 -1
  72. package/esm/session/environment.mjs +1 -1
  73. package/esm/spawn/invocation.d.mts +6 -7
  74. package/esm/spawn/invocation.d.mts.map +1 -1
  75. package/esm/spawn/invocation.mjs +3 -3
  76. package/esm/spawn/invocation.mjs.map +1 -1
  77. package/esm/spawn/resolve-command.d.mts +12 -10
  78. package/esm/spawn/resolve-command.d.mts.map +1 -1
  79. package/esm/stream/json-lines.d.mts +10 -10
  80. package/esm/stream/json-lines.d.mts.map +1 -1
  81. package/esm/stream/line-splitter.mjs +2 -2
  82. package/esm/stream/line-splitter.mjs.map +1 -1
  83. package/esm/utils/toml.d.mts +3 -4
  84. package/esm/utils/toml.d.mts.map +1 -1
  85. 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; /** Where the prompt must go for this plan. */
27
- transport: CliPromptTransport; /** Absolute working directory of the run. */
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; /** Requested reasoning effort; the adapter maps it to the vendor's scale. */
30
+ model?: string;
31
+ /** Requested reasoning effort; the adapter maps it to the vendor's scale. */
30
32
  effort?: ReasoningEffort;
31
- permission: CliPermission; /** Session reference to resume (from a previous `session.started` / `done().sessionRef`). */
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; /** A private directory (mode 0700) for run-scoped files; deleted after the run. */
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`. */path: string;
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). */args: string[];
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[]; /** Text written to stdin before it is closed (the prompt, for `transport: "stdin"`). */
67
- stdin?: string; /** Environment the CLI needs on top of the inherited one (config home variables, …). */
68
- env?: Record<string, string>; /** Files to write before spawning (MCP config, …). */
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. */help: string[][]; /** Version invocation. */
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. */version: string; /** `help` — checked against the real `--help` output; `docs` — official docs/source only. */
85
- verifiedBy: "help" | "docs"; /** Official documentation / source URLs. */
86
- sources: string[]; /** ISO date of the check. */
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. */readonly name: string; /** Human name, e.g. `"Claude Code"`. */
130
- readonly title: string; /** Default executable name looked up on `PATH`. */
131
- readonly command: string; /** Environment variables that receive an API key (the first is used for the `apiKey` option). */
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[]; /** Prompt transports the CLI accepts, in order of preference. */
139
- readonly transports: readonly CliPromptTransport[]; /** Whether the adapter maps `effort` to a vendor flag. */
140
- readonly effort?: boolean; /** Whether the adapter can attach per-run MCP servers. */
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":";;;;;;;AAYA;;;;AAAyB;AAOzB;KAPY,aAAA;;;AAOkB;AAM9B;;KANY,kBAAA;;;;;KAMA,gBAAA;EACV,MAAA,UA+ByB;EA7BzB,SAAA,EAAW,kBAAA,EAAX;EAEA,GAAA;EACA,KAAA;EAEA,MAAA,GAAS,eAAA;EACT,UAAA,EAAY,aAAA,EAAZ;EAEA,MAAA;EACA,GAAA,GAAM,aAAA;EAAN;;;;;EAMA,MAAA;EAcA;;;;EATA,IAAA;EAaU;;;;AAGH;EAVP,aAAA,WAcuB;EAZvB,MAAA;EACA,QAAA,EAAU,MAAA,CAAO,QAAA;AAAA;;KAIP,aAAA;EAkBV,0EAhBA,IAAA;EACA,OAAO;AAAA;;KAIG,aAAA;EAmBF,wDAjBR,IAAA;EAqBsB;;;AAIf;EApBP,IAAA,aAwBgC;EAtBhC,KAAA,WAsBgC;EApBhC,GAAA,GAAM,MAAA,kBAwBN;EAtBA,KAAA,GAAQ,aAAa;EA0BrB;;AAAS;AAOX;;EA3BE,QAAA;AAAA;;KAIU,YAAA;EAwBU,8EAtBpB,IAAA,cAuBO;EArBP,OAAO;AAAA;AA2BG;AAAA,KAvBA,sBAAA;EAmDU,mDAjDpB,OAAA,UAiE8B;EA/D9B,UAAA,mBAqEuB;EAnEvB,OAAA,YAoEiC;EAlEjC,SAAA;AAAA;;;;;KAOU,eAAA;EACV,IAAA,CAAK,IAAA,WAAe,cAAA;EACpB,GAAA,IAAO,cAAc;EAkDZ;;;;;EA5CT,UAAA;AAAA;;;;;;;;;;;AAyDkD;;;;;;;;;;;;;;;KA7BxC,UAAA;iGAED,IAAA;WAEA,KAAA;WAEA,OAAA;WAEA,SAAA;;;;;;WAMA,OAAA;WAEA,UAAA,WAAqB,kBAAA;WAErB,MAAA;WAEA,GAAA;EAAA,SACA,KAAA,EAAO,YAAA;EAAA,SACP,YAAA,EAAc,sBAAA;EACvB,IAAA,CAAK,OAAA,EAAS,gBAAA,GAAmB,aAAA;;;;;;EAMjC,MAAA,CAAO,OAAA,EAAS,gBAAA,GAAmB,eAAA;AAAA"}
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). */input: number; /** Output/completion tokens. */
15
- output: number; /** `input + output`. */
16
- total: number; /** Input tokens served from the vendor's prompt cache. */
17
- cachedTokens?: number; /** Input tokens written to the vendor's prompt cache. */
18
- cacheWriteTokens?: number; /** Output tokens spent on reasoning, when the vendor reports them. */
19
- reasoningTokens?: number; /** Cost in USD as reported by the CLI itself (never computed by this package). */
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"; /** Reference to pass back as `resume` to continue this session. */
34
- sessionRef?: string; /** Model the CLI reported it is using. */
35
- model?: string; /** The vendor's original record, for debugging. */
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"; /** Vendor call id, used to pair the call with its `tool.result`. */
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; /** Process exit code; `null` when the process never started or died by signal. */
91
- exitCode: number | null; /** Terminating signal, when the process died by one. */
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":";;AAWA;;;;;;;;;;KAAY,QAAA;EAcH,0FAZP,KAAA,UAuBU;EArBV,MAAA;EAEA,KAAA,UAmBsB;EAjBtB,YAAA,WAoBgC;EAlBhC,gBAAA,WAkBgC;EAhBhC,eAAA,WAmBA;EAjBA,OAAA;AAAA;;AAqBG;AAQL;;;;;;KAlBY,YAAA;;KAGA,sBAAA;EACV,IAAA,qBAmBG;EAjBH,UAAA,WAqB0B;EAnB1B,KAAA,WAmB0B;EAjB1B,GAAA;AAAA;;;;;AAuBG;KAfO,eAAA;EACV,IAAA;EACA,IAAA;EACA,KAAA;EACA,KAAA;EACA,GAAA;AAAA;;KAIU,gBAAA;EACV,IAAA,eAcG;EAZH,EAAA;EACA,IAAA;EACA,KAAA;EACA,GAAA;AAAA;;KAIU,kBAAA;EACV,IAAA;EACA,EAAA;EACA,MAAA;EACA,OAAA;EACA,GAAA;AAAA;;;;;;KAQU,aAAA;EACV,IAAA;EACA,KAAA,EAAO,QAAQ;EACf,UAAA;EACA,GAAA;AAAA;;;;;KAOU,aAAA;EACV,IAAA;EACA,OAAA;EACA,KAAA;EACA,GAAA;AAAA;AAyBF;AAAA,KArBY,oBAAA;EACV,IAAA;EACA,MAAA,EAAQ,YAAY,EAqBlB;EAnBF,QAAA,iBAqBE;EAnBF,MAAA;EACA,UAAA;EACA,UAAA;AAAA;;;;;;;;;;AAoBsB;KAPZ,QAAA,GACR,sBAAA,GACA,eAAA,GACA,gBAAA,GACA,kBAAA,GACA,aAAA,GACA,aAAA,GACA,oBAAA;;KAGQ,cAAA,GAAiB,OAAA,CAAQ,QAAA,EAAU,oBAAA"}
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":";;AAKA;;;;KAAY,iBAAA;EACV,IAAA;EACA,OAAA;EACA,IAAA;EACA,GAAA,GAAM,MAAM;AAAA;AAAA;AAQd;;;;AARc,KAQF,kBAAA;EACV,IAAA;EACA,GAAA;EACA,OAAA,GAAU,MAAM;AAAA;AAAA;AAAA,KAIN,YAAA,GAAe,iBAAA,GAAoB,kBAAkB;;KAGrD,aAAA,GAAgB,MAAM,SAAS,YAAA"}
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()`. */cwd?: string; /** Session reference to resume (`done().sessionRef` of an earlier run). */
23
- resume?: string; /** Cancels the run and kills the CLI's whole process tree. */
24
- signal?: AbortSignal; /** Kills the process tree after this many milliseconds (status `timeout`). */
25
- timeoutMs?: number; /** Vendor model id or alias, passed to the CLI's model flag. */
26
- model?: string; /** Reasoning effort, mapped to the vendor's scale. Refused for CLIs without an effort control. */
27
- effort?: ReasoningEffort; /** `"standard"` (default) or `"bypass"` (approve every tool call — opt in only). */
28
- permission?: CliPermission; /** Per-run MCP servers, written to a 0600 config file — never argv. */
29
- mcp?: CliMcpServers; /** Extra environment for the CLI (wins over inherited variables). */
30
- env?: Record<string, string>; /** API key, exported as the adapter's first `apiKeyEnv` variable. Never placed in argv. */
31
- apiKey?: string; /** Extra argv appended after the adapter's own flags. Do not put secrets here. */
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). */command?: string; /** Config home. Default `"private"`. */
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; /** Grace period between SIGTERM and SIGKILL when a run is cancelled (POSIX). Default 2000 ms. */
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; /** The final answer: the vendor's final record, else the last assistant message. */
57
- text: string; /** Every complete assistant message, in order. */
58
- messages: string[]; /** Accumulated usage, or `undefined` when the CLI reported none. */
59
- usage?: CliUsage; /** Pass as `resume` to continue this session. */
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; /** First fatal error, or a summary of stderr when the run failed. */
63
- error?: string; /** The last 64 KiB of stderr. */
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"`. */readonly adapter: string; /** Process id of the spawned CLI. */
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>; /** Resolves once the process exits and the stream is drained. Never rejects. */
76
- done(): Promise<CliResult>; /** Cancel the run (kills the process tree); `done()` then resolves `cancelled`. */
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. */executable: string; /** First version-looking token of `--version`, or the trimmed output. */
82
- version: string; /** Concatenated help output the required flags are checked against. */
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":";;;;;;;;AAiBA;;;;AAAmB;AAGnB;;;;;KAHY,OAAA;;KAGA,aAAA;EAkBE,8DAhBZ,GAAA;EAEA,MAAA,WAEA;EAAA,MAAA,GAAS,WAAA,EAET;EAAA,SAAA,WAIA;EAFA,KAAA,WAIA;EAFA,MAAA,GAAS,eAAA,EAIT;EAFA,UAAA,GAAa,aAAA,EAIb;EAFA,GAAA,GAAM,aAAA,EAIN;EAFA,GAAA,GAAM,MAAA,kBAIF;EAFJ,MAAA,WAMU;EAJV,IAAA;AAAA;;KAIU,eAAA,GAAkB,aAAA;EAE5B,iGAAA,OAAA,WAEO;EAAP,IAAA,GAAO,OAAO;EAcd;;;AAEW;AAIb;;;EAZE,UAAA;EAaA;;;;;EAPA,KAAA,YAeA;EAbA,WAAA;AAAA;;KAIU,SAAA;EACV,MAAA,EAAQ,YAAA,EAeE;EAbV,IAAA,UAiBU;EAfV,QAAA;EAEA,KAAA,GAAQ,QAAQ,EAsBC;EApBjB,UAAA;EACA,QAAA;EACA,MAAA,iBAoBe;EAlBf,KAAA,WAWS;EATT,MAAA;EACA,UAAA;AAAA;;KAIU,UAAA;EAWM,mDATP,OAAA,UAWH;EAAA,SATG,GAAA;EAaC;;;;EAAA,SARD,MAAA,EAAQ,aAAA,CAAc,QAAA,GAY/B;EAVA,IAAA,IAAQ,OAAA,CAAQ,SAAA,GAYZ;EAVJ,MAAA;AAAA;;KAIU,cAAA;kCAEV,UAAA;EAEA,OAAA;EAEA,IAAA;AAAA"}
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; /** Adapter name, e.g. `"codex"`. */
17
- adapter: string; /** The missing flag, for `capability`. */
18
- flag?: string; /** Detected CLI version, when known. */
19
- version?: string; /** Resolved executable, when known. */
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
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.mts","names":[],"sources":["../../../../../../../packages/ai-cli/src/errors.ts"],"mappings":";;;;;AAYA;;;;AAAwB;AAQxB;;;KARY,YAAA;AAAA,KAQA,eAAA,GAAkB,cAAA;EAC5B,IAAA,EAAM,YAAY,EAAZ;EAEN,OAAA,UAEA;EAAA,IAAA,WAIA;EAFA,OAAA,WAEU;EAAV,UAAA;AAAA;;;;;;;;;;;;;;;cAiBW,QAAA,SAAiB,aAAA;EAAA,SACZ,IAAA,EAAM,YAAA;EAAA,SACN,OAAA;EAAA,SACA,IAAA;EAAA,SACA,OAAA;EAAA,SACA,UAAA;cAEG,OAAA,UAAiB,OAAA,EAAS,eAAA;AAAA"}
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. */name?: string; /** Per-million-token pricing, so the agent computes `Usage.cost` (and USD budgets apply). */
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":";;;;;;;KAeY,cAAA,GAAiB,aAAA;0GAE3B,IAAA,WAFU;EAIV,OAAA,GAAU,YAAY;AAAA;;;;;;;AAAA;AAgCxB;;iBAAgB,YAAA,CAAa,QAAA,EAAU,OAAO,IAAI,OAAA;;iBA2BlC,OAAA,CAAQ,KAAA,EAAO,QAAA,eAAuB,KAAK;;;;AA3BM;AA2BjE;;;;;;;;AAA2D;AA2C3D;;;;;;;;iBAAgB,QAAA,CAAS,KAAA,EAAO,QAAA,EAAU,MAAA,GAAQ,cAAA,GAAsB,aAAA"}
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"}
@@ -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":";;;;AA0BoD;AAapD;;;;AAA2C;iBAb3B,SAAA,CAAU,IAAA,UAAc,IAAY;;iBAapC,YAAA,CAAa,MAAc;;iBAa3B,YAAA,CAAa,IAAA,UAAc,QAA2B"}
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"}