@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.
- package/README.md +1 -1
- package/apps/runtime/dist/agents/subscription.js +19 -11
- package/apps/runtime/dist/cli/ollama.js +7 -76
- package/apps/runtime/dist/cli/setup.js +5 -4
- package/apps/runtime/dist/decision-model.js +1 -4
- package/apps/runtime/dist/docs/dev/licensing.md +7 -2
- package/apps/runtime/dist/docs/user-guide/command-line.md +2 -2
- package/apps/runtime/dist/engine/device.js +3 -2
- package/apps/runtime/dist/harness/antigravity.js +11 -7
- package/apps/runtime/dist/harness/apple.js +4 -3
- package/apps/runtime/dist/harness/clients.js +108 -0
- package/apps/runtime/dist/harness/index.js +29 -30
- package/apps/runtime/dist/harness/model.js +32 -270
- package/apps/runtime/dist/harness/prompt.js +6 -120
- package/apps/runtime/dist/harness/types.js +3 -2
- package/apps/runtime/dist/local-models.js +17 -37
- package/apps/runtime/dist/models.js +8 -5
- package/apps/runtime/dist/motion-graphics/step.js +2 -2
- package/apps/runtime/dist/routes/studio.js +1 -1
- package/apps/runtime/dist/services/work-ai.js +2 -2
- package/apps/web/dist/assets/{AboutDialog-DM_2-iLP.js → AboutDialog-BRUwrfQH.js} +1 -1
- package/apps/web/dist/assets/{CapabilitiesPage-DxRUERr-.js → CapabilitiesPage-C30knXsS.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-Cyn3LAch.js → ChangelogDialog-BkZQOAdl.js} +1 -1
- package/apps/web/dist/assets/{ConnectorsSection-BYOrwccO.js → ConnectorsSection-CmXQD7zu.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-BFUQzJpN.js → EditorPage-LEbyNWmG.js} +1 -1
- package/apps/web/dist/assets/{NewWizardChannels-DhmYe2C8.js → NewWizardChannels-CSn-9zHr.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-MGKJVDp2.js → NewWizardPage-B4wPfClS.js} +1 -1
- package/apps/web/dist/assets/{ProtocolSection-B1MshkAx.js → ProtocolSection-s4mEL_pu.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-CbvEK0rz.js → ReadOnly-CO3ndR23.js} +1 -1
- package/apps/web/dist/assets/{Results-DI4EHtkh.js → Results-CC1-mElv.js} +1 -1
- package/apps/web/dist/assets/{RunDrawer-xXcbQ9wP.js → RunDrawer-DkmSXhad.js} +1 -1
- package/apps/web/dist/assets/{SettingsPage-BcqqYDqw.js → SettingsPage-DKs_fkNL.js} +2 -2
- package/apps/web/dist/assets/{SetupPage-DG3fJ6fk.js → SetupPage-RvmKCzF2.js} +1 -1
- package/apps/web/dist/assets/{SpacePage-CzQAEQj8.js → SpacePage-aZqYFttF.js} +1 -1
- package/apps/web/dist/assets/{StudioHome-DWTDTslp.js → StudioHome-Doua9Lyl.js} +1 -1
- package/apps/web/dist/assets/{TableEditor-DirMDIGk.js → TableEditor-Dbq3HZZS.js} +1 -1
- package/apps/web/dist/assets/{UpdateCheck-C6GlE6Am.js → UpdateCheck-B7etUbUf.js} +2 -2
- package/apps/web/dist/assets/changelog-BW79cVbx.js +1 -0
- package/apps/web/dist/assets/{host-DNvnJXoi.js → host-BXSxBoOH.js} +3 -3
- package/apps/web/dist/assets/{index-DOq0CvXM.js → index-kDKA6ddy.js} +3 -3
- package/apps/web/dist/assets/{oss-credits-C4SGbRkz.js → oss-credits-B3PXhamW.js} +1 -1
- package/apps/web/dist/index.html +4 -4
- package/bin/bot-tunnel.mjs +375 -0
- package/bin/bot.mjs +494 -69
- package/node_modules/@engenty/local-models/dist/clients/chat.d.ts +89 -0
- package/node_modules/@engenty/local-models/dist/clients/chat.js +22 -0
- package/node_modules/@engenty/local-models/dist/clients/claude.d.ts +32 -0
- package/node_modules/@engenty/local-models/dist/clients/claude.js +238 -0
- package/node_modules/@engenty/local-models/dist/clients/client.d.ts +29 -0
- package/node_modules/@engenty/local-models/dist/clients/client.js +2 -0
- package/node_modules/@engenty/local-models/dist/clients/codex.d.ts +35 -0
- package/node_modules/@engenty/local-models/dist/clients/codex.js +253 -0
- package/node_modules/@engenty/local-models/dist/clients/cursor.d.ts +33 -0
- package/node_modules/@engenty/local-models/dist/clients/cursor.js +180 -0
- package/node_modules/@engenty/local-models/dist/clients/detect.d.ts +18 -0
- package/node_modules/@engenty/local-models/dist/clients/detect.js +34 -0
- package/node_modules/@engenty/local-models/dist/clients/env.d.ts +66 -0
- package/{apps/runtime/dist/harness → node_modules/@engenty/local-models/dist/clients}/env.js +62 -31
- package/node_modules/@engenty/local-models/dist/clients/failure.d.ts +26 -0
- package/node_modules/@engenty/local-models/dist/clients/failure.js +35 -0
- package/node_modules/@engenty/local-models/dist/clients/index.d.ts +14 -0
- package/node_modules/@engenty/local-models/dist/clients/index.js +16 -0
- package/node_modules/@engenty/local-models/dist/clients/model.d.ts +126 -0
- package/node_modules/@engenty/local-models/dist/clients/model.js +225 -0
- package/node_modules/@engenty/local-models/dist/clients/prompt.d.ts +36 -0
- package/node_modules/@engenty/local-models/dist/clients/prompt.js +123 -0
- package/node_modules/@engenty/local-models/dist/clients/run.d.ts +15 -0
- package/node_modules/@engenty/local-models/dist/clients/run.js +41 -0
- package/node_modules/@engenty/local-models/dist/index.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/index.js +3 -0
- package/node_modules/@engenty/local-models/dist/ollama/api.d.ts +70 -0
- package/node_modules/@engenty/local-models/dist/ollama/api.js +164 -0
- package/node_modules/@engenty/local-models/dist/ollama/index.d.ts +2 -0
- package/node_modules/@engenty/local-models/dist/ollama/index.js +2 -0
- package/node_modules/@engenty/local-models/dist/ollama/model.d.ts +52 -0
- package/node_modules/@engenty/local-models/dist/ollama/model.js +302 -0
- package/node_modules/@engenty/local-models/dist/probe.d.ts +54 -0
- package/node_modules/@engenty/local-models/dist/probe.js +190 -0
- package/node_modules/@engenty/local-models/package.json +12 -0
- package/package.json +3 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/runtime/dist/agents/chat-clients.js +0 -344
- package/apps/runtime/dist/harness/claude.js +0 -141
- package/apps/runtime/dist/harness/codex.js +0 -222
- package/apps/runtime/dist/harness/cursor.js +0 -89
- package/apps/web/dist/assets/changelog-CMovB3yB.js +0 -1
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { existsSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { note } from "@engenty/wizards-shared/run";
|
|
5
|
-
import { prompt } from "../prompts.js";
|
|
6
|
-
import { probeVersion, resolveEnv, run } from "./env.js";
|
|
7
|
-
import { failureOf, HarnessImageModel, HarnessModel, runClient, } from "./model.js";
|
|
8
|
-
/**
|
|
9
|
-
* Codex: `codex exec` answers on the ChatGPT sign-in kept in CODEX_HOME. The person's own
|
|
10
|
-
* config is left out so none of their MCP servers start for a call; tools go over MCP through
|
|
11
|
-
* a config override; structured output is validated by the client (`--output-schema`).
|
|
12
|
-
*/
|
|
13
|
-
export const CODEX_BIN = process.env.CODEX_BIN?.trim() || "codex";
|
|
14
|
-
/**
|
|
15
|
-
* Models a ChatGPT sign-in runs (checked 2026-10-04): Luna for small calls, Sol as the
|
|
16
|
-
* workhorse, Astra for the hardest work. A binding `codex/<model>` names another;
|
|
17
|
-
* `codex/default` = the model the client picks itself.
|
|
18
|
-
*/
|
|
19
|
-
const CLASSES = {
|
|
20
|
-
classifier: "gpt-6-luna",
|
|
21
|
-
low: "gpt-6.1-sol",
|
|
22
|
-
standard: "gpt-6.1-sol",
|
|
23
|
-
high: "gpt-6-astra",
|
|
24
|
-
};
|
|
25
|
-
const spec = {
|
|
26
|
-
id: "codex",
|
|
27
|
-
passThrough: /^CODEX_HOME$/,
|
|
28
|
-
keyVars: [],
|
|
29
|
-
async auth(env) {
|
|
30
|
-
try {
|
|
31
|
-
const { stdout, stderr } = await run(CODEX_BIN, ["login", "status"], {
|
|
32
|
-
timeout: 15_000,
|
|
33
|
-
env,
|
|
34
|
-
});
|
|
35
|
-
const text = `${stdout}\n${stderr}`;
|
|
36
|
-
if (/not logged in/i.test(text)) {
|
|
37
|
-
return "none";
|
|
38
|
-
}
|
|
39
|
-
if (/api key/i.test(text)) {
|
|
40
|
-
return "api_key";
|
|
41
|
-
}
|
|
42
|
-
return /logged in/i.test(text) ? "subscription" : "none";
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
return "none";
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
/** The events of one run as the model call wants them: the last agent message and the usage. */
|
|
50
|
-
export function codexAnswer(stdout) {
|
|
51
|
-
let text = null;
|
|
52
|
-
let usage;
|
|
53
|
-
let failure = null;
|
|
54
|
-
let sessionId;
|
|
55
|
-
for (const line of stdout.split("\n")) {
|
|
56
|
-
let event;
|
|
57
|
-
try {
|
|
58
|
-
event = JSON.parse(line);
|
|
59
|
-
}
|
|
60
|
-
catch {
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
if (event.type === "thread.started") {
|
|
64
|
-
sessionId = event.thread_id;
|
|
65
|
-
}
|
|
66
|
-
else if (event.type === "item.completed" && event.item?.type === "agent_message") {
|
|
67
|
-
text = event.item.text ?? "";
|
|
68
|
-
}
|
|
69
|
-
else if (event.type === "turn.completed") {
|
|
70
|
-
const u = event.usage ?? {};
|
|
71
|
-
usage = {
|
|
72
|
-
input: u.input_tokens ?? 0,
|
|
73
|
-
cacheRead: u.cached_input_tokens ?? 0,
|
|
74
|
-
cacheWrite: u.cache_write_input_tokens ?? 0,
|
|
75
|
-
output: u.output_tokens ?? 0,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
else if (event.type === "turn.failed" || event.type === "error") {
|
|
79
|
-
failure =
|
|
80
|
-
typeof event.error === "string"
|
|
81
|
-
? event.error
|
|
82
|
-
: (event.error?.message ?? event.message ?? "error");
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return {
|
|
86
|
-
answer: text === null ? null : { text, usage, sessionId },
|
|
87
|
-
failure,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
class CodexModel extends HarnessModel {
|
|
91
|
-
provider = "codex";
|
|
92
|
-
nativeSchema = true;
|
|
93
|
-
async invoke(call) {
|
|
94
|
-
const args = [
|
|
95
|
-
"exec",
|
|
96
|
-
"-",
|
|
97
|
-
"--json",
|
|
98
|
-
"--ephemeral",
|
|
99
|
-
"--skip-git-repo-check",
|
|
100
|
-
"--ignore-user-config",
|
|
101
|
-
"-s",
|
|
102
|
-
"read-only",
|
|
103
|
-
"-C",
|
|
104
|
-
call.dir,
|
|
105
|
-
"-c",
|
|
106
|
-
'approval_policy="never"',
|
|
107
|
-
"-c",
|
|
108
|
-
`web_search="${call.webSearch ? "live" : "disabled"}"`,
|
|
109
|
-
];
|
|
110
|
-
if (this.modelId !== "default") {
|
|
111
|
-
args.push("-m", this.modelId);
|
|
112
|
-
}
|
|
113
|
-
if (call.effort) {
|
|
114
|
-
args.push("-c", `model_reasoning_effort="${call.effort}"`);
|
|
115
|
-
}
|
|
116
|
-
if (call.system) {
|
|
117
|
-
// A JSON string is a TOML basic string: the instructions travel as one config value.
|
|
118
|
-
args.push("-c", `developer_instructions=${JSON.stringify(call.system)}`);
|
|
119
|
-
}
|
|
120
|
-
if (call.bridgeUrl) {
|
|
121
|
-
args.push("-c", `mcp_servers.step.url="${call.bridgeUrl}"`, "-c", "mcp_servers.step.startup_timeout_sec=30", "-c", "mcp_servers.step.tool_timeout_sec=600",
|
|
122
|
-
// The tools are this runtime's own: they run without the client asking anyone.
|
|
123
|
-
"-c", 'mcp_servers.step.default_tools_approval_mode="approve"');
|
|
124
|
-
}
|
|
125
|
-
if (call.schema) {
|
|
126
|
-
const file = join(call.dir, "schema.json");
|
|
127
|
-
writeFileSync(file, JSON.stringify(call.schema));
|
|
128
|
-
args.push("--output-schema", file);
|
|
129
|
-
}
|
|
130
|
-
const { stdout, stderr, code } = await runClient(CODEX_BIN, args, {
|
|
131
|
-
cwd: call.dir,
|
|
132
|
-
env: (await resolveEnv(spec)).env,
|
|
133
|
-
signal: call.signal,
|
|
134
|
-
stdin: call.prompt,
|
|
135
|
-
});
|
|
136
|
-
const { answer, failure } = codexAnswer(stdout);
|
|
137
|
-
if (failure || !answer) {
|
|
138
|
-
throw failureOf(this.harness, failure ?? stderr.trim() ?? `exit ${code}`);
|
|
139
|
-
}
|
|
140
|
-
return answer;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Images: `codex exec` with the built-in image tool, the reference photos attached with `-i`.
|
|
145
|
-
* Codex keeps what it made under CODEX_HOME/generated_images/<thread>; the file is read from
|
|
146
|
-
* there and that folder removed. `codex/image` runs the tool on the standard model.
|
|
147
|
-
*/
|
|
148
|
-
class CodexImageModel extends HarnessImageModel {
|
|
149
|
-
provider = "codex";
|
|
150
|
-
async invoke(call) {
|
|
151
|
-
const request = [
|
|
152
|
-
call.prompt,
|
|
153
|
-
call.files.length ? prompt("services", "harness.codex_image.edit") : "",
|
|
154
|
-
call.aspectRatio ? `Aspect ratio: ${call.aspectRatio}.` : "",
|
|
155
|
-
prompt("services", "harness.codex_image.once"),
|
|
156
|
-
]
|
|
157
|
-
.filter(Boolean)
|
|
158
|
-
.join("\n\n");
|
|
159
|
-
const args = [
|
|
160
|
-
"exec",
|
|
161
|
-
"-",
|
|
162
|
-
"--json",
|
|
163
|
-
"--ephemeral",
|
|
164
|
-
"--skip-git-repo-check",
|
|
165
|
-
"--ignore-user-config",
|
|
166
|
-
"-s",
|
|
167
|
-
"read-only",
|
|
168
|
-
"-C",
|
|
169
|
-
call.dir,
|
|
170
|
-
"-c",
|
|
171
|
-
'approval_policy="never"',
|
|
172
|
-
"-c",
|
|
173
|
-
'web_search="disabled"',
|
|
174
|
-
"-m",
|
|
175
|
-
this.modelId === "image" ? CLASSES.low : this.modelId,
|
|
176
|
-
];
|
|
177
|
-
for (const file of call.files) {
|
|
178
|
-
args.push("-i", file);
|
|
179
|
-
}
|
|
180
|
-
const { env } = await resolveEnv(spec);
|
|
181
|
-
const { stdout, stderr, code } = await runClient(CODEX_BIN, args, {
|
|
182
|
-
cwd: call.dir,
|
|
183
|
-
env,
|
|
184
|
-
signal: call.signal,
|
|
185
|
-
stdin: request,
|
|
186
|
-
});
|
|
187
|
-
const { answer, failure } = codexAnswer(stdout);
|
|
188
|
-
if (failure || !answer?.sessionId) {
|
|
189
|
-
throw failureOf(this.harness, failure ?? stderr.trim() ?? `exit ${code}`);
|
|
190
|
-
}
|
|
191
|
-
const folder = join(env.CODEX_HOME?.trim() || join(homedir(), ".codex"), "generated_images", answer.sessionId);
|
|
192
|
-
try {
|
|
193
|
-
const made = existsSync(folder)
|
|
194
|
-
? readdirSync(folder)
|
|
195
|
-
.filter((f) => /\.(png|jpe?g|webp)$/i.test(f))
|
|
196
|
-
.map((f) => join(folder, f))
|
|
197
|
-
.sort((a, b) => statSync(b).mtimeMs - statSync(a).mtimeMs)
|
|
198
|
-
: [];
|
|
199
|
-
if (!made[0]) {
|
|
200
|
-
throw new Error(`Codex made no image: ${answer.text.slice(0, 300)}`);
|
|
201
|
-
}
|
|
202
|
-
return new Uint8Array(readFileSync(made[0]));
|
|
203
|
-
}
|
|
204
|
-
finally {
|
|
205
|
-
rmSync(folder, { recursive: true, force: true });
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
export const codex = {
|
|
210
|
-
...spec,
|
|
211
|
-
name: "Codex",
|
|
212
|
-
bin: CODEX_BIN,
|
|
213
|
-
classes: CLASSES,
|
|
214
|
-
version: (env) => probeVersion(CODEX_BIN, env, (stdout) => {
|
|
215
|
-
const words = stdout.trim().split(/\s+/);
|
|
216
|
-
return words[words.length - 1] || null;
|
|
217
|
-
}),
|
|
218
|
-
login: { args: ["login"], interactive: false },
|
|
219
|
-
model: (alias, effort) => new CodexModel(codex, alias || "default", effort),
|
|
220
|
-
image: { alias: "image", model: (alias) => new CodexImageModel(codex, alias || "image") },
|
|
221
|
-
exhausted: note("chatgptAccountCodexSigned"),
|
|
222
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { probeVersion, resolveEnv, run } from "./env.js";
|
|
4
|
-
import { failureOf, HarnessModel, lastJson, runClient, } from "./model.js";
|
|
5
|
-
/**
|
|
6
|
-
* Cursor Agent: `cursor-agent -p` answers on the Cursor sign-in. The call's folder is its
|
|
7
|
-
* workspace: the instructions as AGENTS.md, the tools as an MCP server in .cursor/mcp.json.
|
|
8
|
-
* The answer is asked for as JSON where a schema is wanted.
|
|
9
|
-
*/
|
|
10
|
-
export const CURSOR_BIN = process.env.CURSOR_AGENT_BIN?.trim() || "cursor-agent";
|
|
11
|
-
/** "auto" = the model the client picks itself; a binding `cursor/<model>` names one. */
|
|
12
|
-
const CLASSES = {
|
|
13
|
-
classifier: "auto",
|
|
14
|
-
low: "auto",
|
|
15
|
-
standard: "auto",
|
|
16
|
-
high: "auto",
|
|
17
|
-
};
|
|
18
|
-
/** The escape sequences a terminal app draws with. */
|
|
19
|
-
const ANSI = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*[A-Za-z]`, "g");
|
|
20
|
-
const spec = {
|
|
21
|
-
id: "cursor",
|
|
22
|
-
passThrough: /^CURSOR_API_KEY$/,
|
|
23
|
-
keyVars: ["CURSOR_API_KEY"],
|
|
24
|
-
async auth(env) {
|
|
25
|
-
try {
|
|
26
|
-
const { stdout, stderr } = await run(CURSOR_BIN, ["status"], { timeout: 15_000, env });
|
|
27
|
-
// The client draws on the terminal even here: the control sequences are taken out.
|
|
28
|
-
const text = `${stdout}\n${stderr}`.replace(ANSI, "");
|
|
29
|
-
if (/not logged in/i.test(text) || !/logged in/i.test(text)) {
|
|
30
|
-
return "none";
|
|
31
|
-
}
|
|
32
|
-
return env.CURSOR_API_KEY ? "api_key" : "subscription";
|
|
33
|
-
}
|
|
34
|
-
catch {
|
|
35
|
-
return "none";
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
class CursorModel extends HarnessModel {
|
|
40
|
-
provider = "cursor-agent";
|
|
41
|
-
async invoke(call) {
|
|
42
|
-
if (call.system) {
|
|
43
|
-
writeFileSync(join(call.dir, "AGENTS.md"), call.system);
|
|
44
|
-
}
|
|
45
|
-
if (call.bridgeUrl) {
|
|
46
|
-
mkdirSync(join(call.dir, ".cursor"), { recursive: true });
|
|
47
|
-
writeFileSync(join(call.dir, ".cursor", "mcp.json"), JSON.stringify({ mcpServers: { step: { url: call.bridgeUrl } } }));
|
|
48
|
-
// The call's tools are all on the bridge: the client runs no commands and writes no files.
|
|
49
|
-
writeFileSync(join(call.dir, ".cursor", "cli.json"), JSON.stringify({
|
|
50
|
-
permissions: { allow: ["Mcp(step:*)"], deny: ["Shell(*)", "Write(**)"] },
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
const args = ["-p", "--output-format", "json", "--workspace", call.dir, "--approve-mcps"];
|
|
54
|
-
if (this.modelId !== "auto") {
|
|
55
|
-
args.push("--model", this.modelId);
|
|
56
|
-
}
|
|
57
|
-
if (!call.bridgeUrl) {
|
|
58
|
-
// Nothing to work through: the client answers, it does not edit.
|
|
59
|
-
args.push("--mode", "ask");
|
|
60
|
-
}
|
|
61
|
-
const { stdout, stderr, code } = await runClient(CURSOR_BIN, args, {
|
|
62
|
-
cwd: call.dir,
|
|
63
|
-
env: (await resolveEnv(spec)).env,
|
|
64
|
-
signal: call.signal,
|
|
65
|
-
stdin: call.prompt,
|
|
66
|
-
});
|
|
67
|
-
const event = lastJson(stdout);
|
|
68
|
-
if (!event) {
|
|
69
|
-
throw failureOf(this.harness, stderr.trim() || `exit ${code}`);
|
|
70
|
-
}
|
|
71
|
-
if (event.is_error) {
|
|
72
|
-
throw failureOf(this.harness, String(event.result ?? "error"));
|
|
73
|
-
}
|
|
74
|
-
return {
|
|
75
|
-
text: typeof event.result === "string" ? event.result : JSON.stringify(event.result ?? ""),
|
|
76
|
-
sessionId: event.session_id,
|
|
77
|
-
meta: { durationMs: event.duration_ms ?? 0 },
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
export const cursor = {
|
|
82
|
-
...spec,
|
|
83
|
-
name: "Cursor Agent",
|
|
84
|
-
bin: CURSOR_BIN,
|
|
85
|
-
classes: CLASSES,
|
|
86
|
-
version: (env) => probeVersion(CURSOR_BIN, env, (stdout) => stdout.trim().split("\n").pop()?.trim() || null),
|
|
87
|
-
login: { args: ["login"], interactive: false },
|
|
88
|
-
model: (alias, effort) => new CursorModel(cursor, alias || "auto", effort),
|
|
89
|
-
};
|