@engenty/wizards-runtime 0.20.5 → 0.20.6

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 (87) hide show
  1. package/README.md +1 -1
  2. package/apps/runtime/dist/agents/subscription.js +19 -11
  3. package/apps/runtime/dist/cli/ollama.js +7 -76
  4. package/apps/runtime/dist/cli/setup.js +5 -4
  5. package/apps/runtime/dist/decision-model.js +1 -4
  6. package/apps/runtime/dist/docs/dev/licensing.md +7 -2
  7. package/apps/runtime/dist/docs/user-guide/command-line.md +2 -2
  8. package/apps/runtime/dist/engine/device.js +3 -2
  9. package/apps/runtime/dist/harness/antigravity.js +11 -7
  10. package/apps/runtime/dist/harness/apple.js +4 -3
  11. package/apps/runtime/dist/harness/clients.js +108 -0
  12. package/apps/runtime/dist/harness/index.js +29 -30
  13. package/apps/runtime/dist/harness/model.js +32 -270
  14. package/apps/runtime/dist/harness/prompt.js +6 -120
  15. package/apps/runtime/dist/harness/types.js +3 -2
  16. package/apps/runtime/dist/local-models.js +17 -37
  17. package/apps/runtime/dist/models.js +8 -5
  18. package/apps/runtime/dist/motion-graphics/step.js +2 -2
  19. package/apps/runtime/dist/routes/studio.js +1 -1
  20. package/apps/runtime/dist/services/work-ai.js +2 -2
  21. package/apps/web/dist/assets/{AboutDialog-DM_2-iLP.js → AboutDialog-BRUwrfQH.js} +1 -1
  22. package/apps/web/dist/assets/{CapabilitiesPage-DxRUERr-.js → CapabilitiesPage-C30knXsS.js} +1 -1
  23. package/apps/web/dist/assets/{ChangelogDialog-Cyn3LAch.js → ChangelogDialog-BkZQOAdl.js} +1 -1
  24. package/apps/web/dist/assets/{ConnectorsSection-BYOrwccO.js → ConnectorsSection-CmXQD7zu.js} +1 -1
  25. package/apps/web/dist/assets/{EditorPage-BFUQzJpN.js → EditorPage-LEbyNWmG.js} +1 -1
  26. package/apps/web/dist/assets/{NewWizardChannels-DhmYe2C8.js → NewWizardChannels-CSn-9zHr.js} +1 -1
  27. package/apps/web/dist/assets/{NewWizardPage-MGKJVDp2.js → NewWizardPage-B4wPfClS.js} +1 -1
  28. package/apps/web/dist/assets/{ProtocolSection-B1MshkAx.js → ProtocolSection-s4mEL_pu.js} +1 -1
  29. package/apps/web/dist/assets/{ReadOnly-CbvEK0rz.js → ReadOnly-CO3ndR23.js} +1 -1
  30. package/apps/web/dist/assets/{Results-DI4EHtkh.js → Results-CC1-mElv.js} +1 -1
  31. package/apps/web/dist/assets/{RunDrawer-xXcbQ9wP.js → RunDrawer-DkmSXhad.js} +1 -1
  32. package/apps/web/dist/assets/{SettingsPage-BcqqYDqw.js → SettingsPage-DKs_fkNL.js} +2 -2
  33. package/apps/web/dist/assets/{SetupPage-DG3fJ6fk.js → SetupPage-RvmKCzF2.js} +1 -1
  34. package/apps/web/dist/assets/{SpacePage-CzQAEQj8.js → SpacePage-aZqYFttF.js} +1 -1
  35. package/apps/web/dist/assets/{StudioHome-DWTDTslp.js → StudioHome-Doua9Lyl.js} +1 -1
  36. package/apps/web/dist/assets/{TableEditor-DirMDIGk.js → TableEditor-Dbq3HZZS.js} +1 -1
  37. package/apps/web/dist/assets/{UpdateCheck-C6GlE6Am.js → UpdateCheck-B7etUbUf.js} +2 -2
  38. package/apps/web/dist/assets/changelog-BW79cVbx.js +1 -0
  39. package/apps/web/dist/assets/{host-DNvnJXoi.js → host-BXSxBoOH.js} +3 -3
  40. package/apps/web/dist/assets/{index-DOq0CvXM.js → index-kDKA6ddy.js} +3 -3
  41. package/apps/web/dist/assets/{oss-credits-C4SGbRkz.js → oss-credits-B3PXhamW.js} +1 -1
  42. package/apps/web/dist/index.html +4 -4
  43. package/bin/bot-tunnel.mjs +375 -0
  44. package/bin/bot.mjs +494 -69
  45. package/node_modules/@engenty/local-models/dist/clients/chat.d.ts +89 -0
  46. package/node_modules/@engenty/local-models/dist/clients/chat.js +22 -0
  47. package/node_modules/@engenty/local-models/dist/clients/claude.d.ts +32 -0
  48. package/node_modules/@engenty/local-models/dist/clients/claude.js +238 -0
  49. package/node_modules/@engenty/local-models/dist/clients/client.d.ts +29 -0
  50. package/node_modules/@engenty/local-models/dist/clients/client.js +2 -0
  51. package/node_modules/@engenty/local-models/dist/clients/codex.d.ts +35 -0
  52. package/node_modules/@engenty/local-models/dist/clients/codex.js +253 -0
  53. package/node_modules/@engenty/local-models/dist/clients/cursor.d.ts +33 -0
  54. package/node_modules/@engenty/local-models/dist/clients/cursor.js +180 -0
  55. package/node_modules/@engenty/local-models/dist/clients/detect.d.ts +18 -0
  56. package/node_modules/@engenty/local-models/dist/clients/detect.js +34 -0
  57. package/node_modules/@engenty/local-models/dist/clients/env.d.ts +66 -0
  58. package/{apps/runtime/dist/harness → node_modules/@engenty/local-models/dist/clients}/env.js +62 -31
  59. package/node_modules/@engenty/local-models/dist/clients/failure.d.ts +26 -0
  60. package/node_modules/@engenty/local-models/dist/clients/failure.js +35 -0
  61. package/node_modules/@engenty/local-models/dist/clients/index.d.ts +14 -0
  62. package/node_modules/@engenty/local-models/dist/clients/index.js +16 -0
  63. package/node_modules/@engenty/local-models/dist/clients/model.d.ts +126 -0
  64. package/node_modules/@engenty/local-models/dist/clients/model.js +225 -0
  65. package/node_modules/@engenty/local-models/dist/clients/prompt.d.ts +36 -0
  66. package/node_modules/@engenty/local-models/dist/clients/prompt.js +123 -0
  67. package/node_modules/@engenty/local-models/dist/clients/run.d.ts +15 -0
  68. package/node_modules/@engenty/local-models/dist/clients/run.js +41 -0
  69. package/node_modules/@engenty/local-models/dist/index.d.ts +3 -0
  70. package/node_modules/@engenty/local-models/dist/index.js +3 -0
  71. package/node_modules/@engenty/local-models/dist/ollama/api.d.ts +70 -0
  72. package/node_modules/@engenty/local-models/dist/ollama/api.js +164 -0
  73. package/node_modules/@engenty/local-models/dist/ollama/index.d.ts +2 -0
  74. package/node_modules/@engenty/local-models/dist/ollama/index.js +2 -0
  75. package/node_modules/@engenty/local-models/dist/ollama/model.d.ts +52 -0
  76. package/node_modules/@engenty/local-models/dist/ollama/model.js +302 -0
  77. package/node_modules/@engenty/local-models/dist/probe.d.ts +54 -0
  78. package/node_modules/@engenty/local-models/dist/probe.js +190 -0
  79. package/node_modules/@engenty/local-models/package.json +12 -0
  80. package/package.json +3 -1
  81. package/plugin/.claude-plugin/plugin.json +1 -1
  82. package/plugin/plugin.json +1 -1
  83. package/apps/runtime/dist/agents/chat-clients.js +0 -344
  84. package/apps/runtime/dist/harness/claude.js +0 -141
  85. package/apps/runtime/dist/harness/codex.js +0 -222
  86. package/apps/runtime/dist/harness/cursor.js +0 -89
  87. package/apps/web/dist/assets/changelog-CMovB3yB.js +0 -1
@@ -0,0 +1,89 @@
1
+ /**
2
+ * How an installed client answers one turn of a chat: the command line, what goes on stdin, and
3
+ * what its output lines mean. The client reaches only the host's MCP server, under the name the
4
+ * host gives it, and keeps the conversation itself; the host keeps the id it reports.
5
+ */
6
+ /** The host's MCP server for a turn. */
7
+ export interface ChatMcp {
8
+ /** The name the client knows the server by: its tools are `mcp__<name>__…` to Claude Code. */
9
+ name: string;
10
+ url: string;
11
+ /** Codex: the environment variable it reads the bearer key from; the host sets it for the turn. */
12
+ keyVar: string;
13
+ /** Claude Code: the MCP config file with the server and its key. */
14
+ configFile?: string;
15
+ }
16
+ /** What one turn hands the client. */
17
+ export interface ChatCall {
18
+ /** The instructions the client works by. */
19
+ system: string;
20
+ message: string;
21
+ /** The conversation to continue, as the client named it last time. */
22
+ session: string | null;
23
+ /** The folder the client runs in: Claude's MCP config, Cursor's workspace. */
24
+ dir: string;
25
+ /** The model the client runs, by its own name: left out, the client picks. */
26
+ model?: string;
27
+ /** The host's MCP server. Left out, the turn has no tools at all: a call that only writes text. */
28
+ mcp?: ChatMcp;
29
+ /** The pictures pasted with the message: base64 for Claude, files for Codex. */
30
+ images: {
31
+ mime: string;
32
+ base64: string;
33
+ file: string;
34
+ }[];
35
+ }
36
+ /** What one line of the client's output says. */
37
+ export type ChatEvent = {
38
+ kind: "text";
39
+ text: string;
40
+ } | {
41
+ kind: "tool";
42
+ name: string;
43
+ args: Record<string, unknown>;
44
+ started: boolean;
45
+ }
46
+ /** A tool has answered; `issues` is how many it found, if its answer speaks of them. */
47
+ | {
48
+ kind: "toolDone";
49
+ issues?: number;
50
+ }
51
+ /**
52
+ * The model is writing text this client hands over whole later on: for the turn's clock, and
53
+ * the piece itself where the client streams it.
54
+ */
55
+ | {
56
+ kind: "writing";
57
+ text?: string;
58
+ } | {
59
+ kind: "thinkingStart";
60
+ }
61
+ /** `whole`: the client gives its reasoning once that is done, not as it streams. */
62
+ | {
63
+ kind: "thinking";
64
+ text: string;
65
+ whole?: boolean;
66
+ } | {
67
+ kind: "session";
68
+ id: string;
69
+ } | {
70
+ kind: "failure";
71
+ detail: string;
72
+ }
73
+ /** The client's own summary of the answer, used where no text came before it. */
74
+ | {
75
+ kind: "result";
76
+ text: string;
77
+ };
78
+ /** A client as a chat: its command line and how to read it. */
79
+ export interface ChatClient {
80
+ args(call: ChatCall): string[];
81
+ stdin(call: ChatCall): string;
82
+ events(line: string): ChatEvent[];
83
+ /** Whether a failure the client reports means its sign-in is missing or expired. */
84
+ signedOut(detail: string): boolean;
85
+ }
86
+ export declare function parseLine(line: string): any;
87
+ export declare const record: (v: unknown) => Record<string, unknown>;
88
+ /** How many issues a tool's answer names; nothing where the answer does not speak of them. */
89
+ export declare function issuesIn(text: unknown): number | undefined;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * How an installed client answers one turn of a chat: the command line, what goes on stdin, and
3
+ * what its output lines mean. The client reaches only the host's MCP server, under the name the
4
+ * host gives it, and keeps the conversation itself; the host keeps the id it reports.
5
+ */
6
+ export function parseLine(line) {
7
+ try {
8
+ return JSON.parse(line);
9
+ }
10
+ catch {
11
+ return null;
12
+ }
13
+ }
14
+ export const record = (v) => v && typeof v === "object" ? v : {};
15
+ /** How many issues a tool's answer names; nothing where the answer does not speak of them. */
16
+ export function issuesIn(text) {
17
+ if (typeof text !== "string" || !text.includes('"issues"')) {
18
+ return undefined;
19
+ }
20
+ const issues = parseLine(text)?.issues;
21
+ return Array.isArray(issues) ? issues.length : undefined;
22
+ }
@@ -0,0 +1,32 @@
1
+ import type { Client } from "./client.js";
2
+ import { type ClientAnswer } from "./model.js";
3
+ /**
4
+ * Claude Code: `claude -p` answers on the person's sign-in — the client's keychain, or the key
5
+ * or token their login shell sets. Tools go over MCP; structured output is validated by the
6
+ * client (`--json-schema`); web search is its own tool.
7
+ */
8
+ export declare const CLAUDE_BIN: string;
9
+ /** What the client prints last with `--output-format json`. */
10
+ export interface ClaudeResult {
11
+ type?: string;
12
+ /** On a failure: why, e.g. error_max_turns, error_during_execution. */
13
+ subtype?: string;
14
+ is_error?: boolean;
15
+ /** On a failure: what went wrong, where the client says. */
16
+ errors?: unknown[];
17
+ result?: unknown;
18
+ structured_output?: unknown;
19
+ session_id?: string;
20
+ stop_reason?: string;
21
+ total_cost_usd?: number;
22
+ num_turns?: number;
23
+ usage?: {
24
+ input_tokens?: number;
25
+ output_tokens?: number;
26
+ cache_read_input_tokens?: number;
27
+ cache_creation_input_tokens?: number;
28
+ };
29
+ }
30
+ /** The client's result as the model call wants it: text (or the structured output as JSON) and usage. */
31
+ export declare function claudeAnswer(event: ClaudeResult): ClientAnswer;
32
+ export declare const claude: Client;
@@ -0,0 +1,238 @@
1
+ import { issuesIn, parseLine, record } from "./chat.js";
2
+ import { probeVersion, resolveEnv, run } from "./env.js";
3
+ import { clientFailure } from "./failure.js";
4
+ import { ClientModel } from "./model.js";
5
+ import { lastJson, runClient } from "./run.js";
6
+ /**
7
+ * Claude Code: `claude -p` answers on the person's sign-in — the client's keychain, or the key
8
+ * or token their login shell sets. Tools go over MCP; structured output is validated by the
9
+ * client (`--json-schema`); web search is its own tool.
10
+ */
11
+ export const CLAUDE_BIN = process.env.CLAUDE_BIN?.trim() || "claude";
12
+ const spec = {
13
+ id: "claude",
14
+ passThrough: /^(ANTHROPIC_|CLAUDE_CODE_OAUTH_TOKEN$|CLAUDE_CODE_USE_|CLAUDE_CONFIG_DIR$|AWS_(PROFILE|REGION|DEFAULT_REGION|ACCESS_KEY_ID|SECRET_ACCESS_KEY|SESSION_TOKEN)$|GOOGLE_APPLICATION_CREDENTIALS$|CLOUD_ML_REGION$)/,
15
+ keyVars: ["ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN"],
16
+ async auth(env) {
17
+ try {
18
+ const { stdout } = await run(CLAUDE_BIN, ["auth", "status", "--json"], {
19
+ timeout: 15_000,
20
+ env,
21
+ });
22
+ const status = JSON.parse(stdout.trim());
23
+ if (!status.loggedIn) {
24
+ return "none";
25
+ }
26
+ return status.authMethod === "api_key" ? "api_key" : "subscription";
27
+ }
28
+ catch {
29
+ return "none";
30
+ }
31
+ },
32
+ };
33
+ /** The client's result as the model call wants it: text (or the structured output as JSON) and usage. */
34
+ export function claudeAnswer(event) {
35
+ const u = event.usage ?? {};
36
+ const cacheRead = u.cache_read_input_tokens ?? 0;
37
+ const cacheWrite = u.cache_creation_input_tokens ?? 0;
38
+ return {
39
+ text: event.structured_output !== undefined
40
+ ? JSON.stringify(event.structured_output)
41
+ : typeof event.result === "string"
42
+ ? event.result
43
+ : JSON.stringify(event.result ?? ""),
44
+ usage: {
45
+ input: (u.input_tokens ?? 0) + cacheRead + cacheWrite,
46
+ cacheRead,
47
+ cacheWrite,
48
+ output: u.output_tokens ?? 0,
49
+ },
50
+ meta: { costUsd: event.total_cost_usd ?? 0, turns: event.num_turns ?? 1 },
51
+ sessionId: event.session_id,
52
+ stopReason: event.stop_reason,
53
+ };
54
+ }
55
+ class ClaudeCodeModel extends ClientModel {
56
+ provider = "claude-code";
57
+ nativeSchema = true;
58
+ async invoke(call) {
59
+ const builtin = [];
60
+ if (call.files.length) {
61
+ builtin.push("Read");
62
+ }
63
+ if (call.webSearch) {
64
+ builtin.push("WebSearch");
65
+ }
66
+ const args = [
67
+ "-p",
68
+ "--output-format",
69
+ "json",
70
+ "--model",
71
+ this.modelId,
72
+ "--tools",
73
+ builtin.join(","),
74
+ "--strict-mcp-config",
75
+ "--setting-sources",
76
+ "",
77
+ "--disable-slash-commands",
78
+ "--no-session-persistence",
79
+ ];
80
+ if (call.system) {
81
+ args.push("--system-prompt", call.system);
82
+ }
83
+ if (call.effort) {
84
+ args.push("--effort", call.effort);
85
+ }
86
+ if (call.schema) {
87
+ // The CLI checks the schema with no dialects loaded: one that names its own is refused.
88
+ const { $schema: _dialect, ...schema } = call.schema;
89
+ args.push("--json-schema", JSON.stringify(schema));
90
+ }
91
+ if (call.bridgeUrl) {
92
+ args.push("--mcp-config", JSON.stringify({ mcpServers: { step: { type: "http", url: call.bridgeUrl } } }));
93
+ }
94
+ const allowed = [...builtin, ...(call.bridgeUrl ? ["mcp__step"] : [])];
95
+ if (allowed.length) {
96
+ args.push("--allowedTools", allowed.join(","));
97
+ }
98
+ if (call.files.length) {
99
+ args.push("--add-dir", call.dir);
100
+ }
101
+ const { stdout, stderr, code } = await runClient(CLAUDE_BIN, args, {
102
+ cwd: call.dir,
103
+ env: (await resolveEnv(spec)).env,
104
+ signal: call.signal,
105
+ stdin: call.prompt,
106
+ });
107
+ const event = lastJson(stdout);
108
+ if (!event) {
109
+ throw clientFailure(this.client, stderr.trim() || `exit ${code}`);
110
+ }
111
+ if (event.is_error) {
112
+ // A failed run carries no result, only why (subtype) and sometimes what (errors).
113
+ const why = [
114
+ typeof event.result === "string" ? event.result : "",
115
+ event.subtype ?? "",
116
+ ...(event.errors ?? []).map((e) => (typeof e === "string" ? e : JSON.stringify(e))),
117
+ event.num_turns ? `after ${event.num_turns} turns` : "",
118
+ ].filter(Boolean);
119
+ throw clientFailure(this.client, why.join(" – ") || "error", JSON.stringify(event).slice(0, 2000));
120
+ }
121
+ return claudeAnswer(event);
122
+ }
123
+ }
124
+ export const claude = {
125
+ ...spec,
126
+ id: "claude",
127
+ name: "Claude Code",
128
+ bin: CLAUDE_BIN,
129
+ version: (env) => probeVersion(CLAUDE_BIN, env, (stdout) => stdout.trim().split(/\s+/)[0] || stdout.trim()),
130
+ login: { args: ["auth", "login"], interactive: false },
131
+ model: (alias, options) => new ClaudeCodeModel(claude, alias || "sonnet", options),
132
+ args: (call) => [
133
+ // The message comes on stdin, so pictures can go with it.
134
+ "-p",
135
+ "--input-format",
136
+ "stream-json",
137
+ "--output-format",
138
+ "stream-json",
139
+ "--verbose",
140
+ // Names a tool as it starts and streams the thinking; whole messages still follow.
141
+ "--include-partial-messages",
142
+ // No built-in tools: `--allowedTools` alone would not take them away.
143
+ "--tools",
144
+ "",
145
+ "--strict-mcp-config",
146
+ ...(call.mcp
147
+ ? ["--mcp-config", call.mcp.configFile ?? "", "--allowedTools", `mcp__${call.mcp.name}`]
148
+ : []),
149
+ "--disable-slash-commands",
150
+ "--setting-sources",
151
+ "",
152
+ "--append-system-prompt",
153
+ call.system,
154
+ ...(call.model ? ["--model", call.model] : []),
155
+ ...(call.session ? ["--resume", call.session] : []),
156
+ ],
157
+ stdin: (call) => `${JSON.stringify({
158
+ type: "user",
159
+ message: {
160
+ role: "user",
161
+ content: [
162
+ { type: "text", text: call.message },
163
+ ...call.images.map((i) => ({
164
+ type: "image",
165
+ source: { type: "base64", media_type: i.mime, data: i.base64 },
166
+ })),
167
+ ],
168
+ },
169
+ })}\n`,
170
+ events(line) {
171
+ const event = parseLine(line);
172
+ if (!event) {
173
+ return [];
174
+ }
175
+ if (event.type === "stream_event") {
176
+ const e = event.event ?? {};
177
+ if (e.type === "content_block_start" && e.content_block?.type === "tool_use") {
178
+ return [
179
+ { kind: "tool", name: String(e.content_block.name ?? ""), args: {}, started: false },
180
+ ];
181
+ }
182
+ if (e.type === "content_block_start" && e.content_block?.type === "thinking") {
183
+ return [{ kind: "thinkingStart" }];
184
+ }
185
+ if (e.type === "content_block_delta" && e.delta?.type === "thinking_delta") {
186
+ return [{ kind: "thinking", text: e.delta.thinking ?? "" }];
187
+ }
188
+ if (e.type === "content_block_delta" && e.delta?.type === "text_delta") {
189
+ return [{ kind: "writing", text: String(e.delta.text ?? "") }];
190
+ }
191
+ return [];
192
+ }
193
+ if (event.type === "user") {
194
+ const out = [];
195
+ for (const block of event.message?.content ?? []) {
196
+ if (block.type === "tool_result") {
197
+ const text = Array.isArray(block.content)
198
+ ? block.content.find((c) => c.type === "text")?.text
199
+ : block.content;
200
+ out.push({ kind: "toolDone", issues: issuesIn(text) });
201
+ }
202
+ }
203
+ return out;
204
+ }
205
+ if (event.type === "assistant") {
206
+ const out = [];
207
+ for (const block of event.message?.content ?? []) {
208
+ if (block.type === "text" && block.text) {
209
+ out.push({ kind: "text", text: block.text });
210
+ }
211
+ else if (block.type === "tool_use") {
212
+ out.push({
213
+ kind: "tool",
214
+ name: String(block.name ?? ""),
215
+ args: record(block.input),
216
+ started: true,
217
+ });
218
+ }
219
+ }
220
+ return out;
221
+ }
222
+ if (event.type === "result") {
223
+ const out = [];
224
+ if (event.session_id) {
225
+ out.push({ kind: "session", id: String(event.session_id) });
226
+ }
227
+ if (event.is_error) {
228
+ out.push({ kind: "failure", detail: String(event.result ?? "error") });
229
+ }
230
+ else if (typeof event.result === "string") {
231
+ out.push({ kind: "result", text: event.result });
232
+ }
233
+ return out;
234
+ }
235
+ return [];
236
+ },
237
+ signedOut: (detail) => /authenticat|log ?in|oauth|credential/i.test(detail),
238
+ };
@@ -0,0 +1,29 @@
1
+ import type { ChatClient } from "./chat.js";
2
+ import type { EnvSpec } from "./env.js";
3
+ import type { ClientMeta } from "./failure.js";
4
+ import type { ClientModel, ClientModelOptions } from "./model.js";
5
+ /** The AI clients a person signs in to with their own subscription. */
6
+ export declare const CLIENT_IDS: readonly ["claude", "codex", "cursor"];
7
+ export type ClientId = (typeof CLIENT_IDS)[number];
8
+ /**
9
+ * An AI client installed on this computer that answers on the person's own subscription or
10
+ * sign-in: how it is found and signed in, how it runs headless as a model, and how it answers a
11
+ * chat turn with the host's MCP server. Nothing of the host's process reaches it: no key of the
12
+ * host's, no session of a parent client.
13
+ */
14
+ export interface Client extends EnvSpec, ChatClient, ClientMeta {
15
+ id: ClientId;
16
+ bin: string;
17
+ /** Null: not installed. Throws ProbeUndecided when the probe could not finish on a busy machine. */
18
+ version(env: NodeJS.ProcessEnv): Promise<string | null>;
19
+ /**
20
+ * What a terminal runs to sign the client in. `interactive`: the client's own app opens and the
21
+ * person ends it.
22
+ */
23
+ login: {
24
+ args: string[];
25
+ interactive: boolean;
26
+ };
27
+ /** The client as a model; `alias` is the model by the client's own name. */
28
+ model(alias: string, options?: ClientModelOptions): ClientModel;
29
+ }
@@ -0,0 +1,2 @@
1
+ /** The AI clients a person signs in to with their own subscription. */
2
+ export const CLIENT_IDS = ["claude", "codex", "cursor"];
@@ -0,0 +1,35 @@
1
+ import type { Client } from "./client.js";
2
+ import { type ClientAnswer } from "./model.js";
3
+ /**
4
+ * Codex: `codex exec` answers on the ChatGPT sign-in kept in CODEX_HOME. The person's own
5
+ * config is left out so none of their MCP servers start for a call; tools go over MCP through
6
+ * a config override; structured output is validated by the client (`--output-schema`).
7
+ */
8
+ export declare const CODEX_BIN: string;
9
+ /** One line of `codex exec --json`. */
10
+ export interface CodexEvent {
11
+ type?: string;
12
+ item?: {
13
+ type?: string;
14
+ text?: string;
15
+ };
16
+ usage?: {
17
+ input_tokens?: number;
18
+ cached_input_tokens?: number;
19
+ cache_write_input_tokens?: number;
20
+ output_tokens?: number;
21
+ };
22
+ error?: {
23
+ message?: string;
24
+ } | string;
25
+ message?: string;
26
+ thread_id?: string;
27
+ }
28
+ /** The events of one run as the model call wants them: the last agent message and the usage. */
29
+ export declare function codexAnswer(stdout: string): {
30
+ answer: ClientAnswer | null;
31
+ failure: string | null;
32
+ };
33
+ /** The arguments every headless `codex exec` starts with: read-only, no approvals, nothing of the person's config. */
34
+ export declare function codexExecArgs(dir: string, webSearch: boolean): string[];
35
+ export declare const codex: Client;