@conveno/cli 0.2.0-rc.14 → 0.2.0-rc.16

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.
@@ -6169,6 +6169,8 @@ const Session = object({
6169
6169
  name: union([SessionName, RemoteSessionName]),
6170
6170
  cli: CliKind,
6171
6171
  cliVersion: string().min(1).max(64).optional(),
6172
+ /** The model and effort a background worker runs on (`sonnet · high`), when known. Not stored. */
6173
+ model: string().min(1).max(200).optional(),
6172
6174
  /** Set when the session is a desktop app of `cli` rather than the CLI. Screens say "Antigravity app". */
6173
6175
  variant: SessionVariant.optional(),
6174
6176
  deviceId: DeviceId,
@@ -6196,6 +6198,8 @@ const Session = object({
6196
6198
  unreadCount: number().int().min(0).optional(),
6197
6199
  startedAt: IsoTimestamp,
6198
6200
  lastSeenAt: IsoTimestamp,
6201
+ /** When the session last sent a message. Absent until it has sent one. */
6202
+ lastSentAt: IsoTimestamp.optional(),
6199
6203
  /**
6200
6204
  * The CLI's own id for this session (Codex's thread id), set by its hooks with
6201
6205
  * `session.setNative`. Hooks of a CLI that runs many sessions in one process find theirs by it.
@@ -6246,6 +6250,8 @@ const RegisterParams = object({
6246
6250
  name: SessionNameInput.optional(),
6247
6251
  cli: CliKind,
6248
6252
  cliVersion: string().min(1).max(64).optional(),
6253
+ /** The worker's model and effort as a short label (`sonnet · high`), shown on its card. */
6254
+ model: string().min(1).max(200).optional(),
6249
6255
  /** The session runs in a desktop app of `cli`. See `Session.variant`. */
6250
6256
  variant: SessionVariant.optional(),
6251
6257
  cwd: string().min(1),
@@ -6314,6 +6320,21 @@ const SendResult = object({
6314
6320
  name: union([SessionName, literal("you")])
6315
6321
  })
6316
6322
  });
6323
+ /** One message between two sessions, as `message.recent` lists it for the app's activity list. */
6324
+ const RecentMessage = object({
6325
+ id: MessageId,
6326
+ from: SessionId,
6327
+ /** The sender's name when it sent the message (`<device>:<name>` for another machine's). */
6328
+ fromName: string().max(200).optional(),
6329
+ fromCli: CliKind.optional(),
6330
+ /** The session that got it. */
6331
+ to: SessionId,
6332
+ toName: string().max(200),
6333
+ toCli: CliKind.optional(),
6334
+ /** The first line of the text (or a handoff's goal), one plain line, cut. */
6335
+ text: string().max(200),
6336
+ createdAt: IsoTimestamp
6337
+ });
6317
6338
  const EVENT_NAMES = [
6318
6339
  "message.received",
6319
6340
  "session.updated",
@@ -6377,7 +6398,8 @@ const ipcMethods = {
6377
6398
  "session.heartbeat": {
6378
6399
  params: object({
6379
6400
  ...sid,
6380
- pid: number().int().positive().optional()
6401
+ pid: number().int().positive().optional(),
6402
+ model: string().min(1).max(200).optional()
6381
6403
  }),
6382
6404
  result: object({ lastSeenAt: IsoTimestamp })
6383
6405
  },
@@ -6529,6 +6551,7 @@ const ipcMethods = {
6529
6551
  "allow_always",
6530
6552
  "deny",
6531
6553
  "unanswered",
6554
+ "worker_offline",
6532
6555
  "no_spawner"
6533
6556
  ]),
6534
6557
  by: SessionId.optional()
@@ -6590,6 +6613,10 @@ const ipcMethods = {
6590
6613
  }),
6591
6614
  result: object({ acked: number().int().min(0) })
6592
6615
  },
6616
+ "message.recent": {
6617
+ params: object({ limit: number().int().min(1).max(200).default(50) }),
6618
+ result: object({ messages: array(RecentMessage) })
6619
+ },
6593
6620
  "owner.send": {
6594
6621
  params: object({
6595
6622
  to: Recipient,
@@ -7187,7 +7214,9 @@ function dataPaths(platform, dir) {
7187
7214
  /** Conveno account tokens from `conveno login`, mode 0600. See account.ts. */
7188
7215
  account: p.join(dir, "account.json"),
7189
7216
  /** Choices the user made, such as whether ACP adapters may be fetched with npx. See settings.ts. */
7190
- settings: p.join(dir, "settings.json")
7217
+ settings: p.join(dir, "settings.json"),
7218
+ /** The models and effort levels each CLI offered its last worker. See worker-models.ts. */
7219
+ workerModels: p.join(dir, "worker-models.json")
7191
7220
  };
7192
7221
  }
7193
7222
  /** Best effort: deletes the markers in `dir` not touched for `ASKED_MAX_AGE_MS`. */
@@ -7563,20 +7592,20 @@ function parseCliVersion(output) {
7563
7592
  }
7564
7593
  var clis = {
7565
7594
  "claude": {
7566
- "verified": "2.1.332",
7595
+ "verified": "2.1.335",
7567
7596
  "minimum": "2.1.139"
7568
7597
  },
7569
- "codex": { "verified": "0.172.0" },
7570
- "opencode": { "verified": "2.4.3" },
7598
+ "codex": { "verified": "0.173.0" },
7599
+ "opencode": { "verified": "2.4.4" },
7571
7600
  "antigravity": {
7572
- "verified": "1.5.20",
7601
+ "verified": "1.5.22",
7573
7602
  "minimum": "1.5.8"
7574
7603
  },
7575
- "grok": { "verified": "1.0.92" }
7604
+ "grok": { "verified": "1.0.100" }
7576
7605
  };
7577
7606
  var acpAdapters = {
7578
- "@agentclientprotocol/codex-acp": "2.10.0",
7579
- "@agentclientprotocol/claude-agent-acp": "0.110.0"
7607
+ "@agentclientprotocol/codex-acp": "2.12.0",
7608
+ "@agentclientprotocol/claude-agent-acp": "0.112.0"
7580
7609
  };
7581
7610
  /**
7582
7611
  * Versions per CLI, from `compat.json`. The nightly compat workflow raises `verified` when a newer
@@ -8460,7 +8489,7 @@ function statusAfterLiveness(current, verdict) {
8460
8489
  return current;
8461
8490
  }
8462
8491
  const isOnline = (s) => s.status !== "offline";
8463
- const MAX_NAME = 64;
8492
+ const MAX_NAME$1 = 64;
8464
8493
  /** Make a directory name safe to embed in a session name: lowercase, `[a-z0-9._-]`, non-empty. */
8465
8494
  function sanitizeNamePart(raw) {
8466
8495
  const cleaned = raw.toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[^a-z0-9]+/, "").replace(/-+$/, "");
@@ -8475,7 +8504,7 @@ function generateSessionName(cli, repoBasename, sessions) {
8475
8504
  const prefix = `${cli}@`;
8476
8505
  for (let n = 1;; n++) {
8477
8506
  const suffix = `-${n}`;
8478
- const room = MAX_NAME - prefix.length - suffix.length;
8507
+ const room = MAX_NAME$1 - prefix.length - suffix.length;
8479
8508
  const name = `${prefix}${sanitizeNamePart(repoBasename).slice(0, room)}${suffix}`;
8480
8509
  if (!taken.has(name)) return name;
8481
8510
  }
@@ -9222,10 +9251,157 @@ function accessAllows(access, call) {
9222
9251
  if (access === "full") return true;
9223
9252
  return isAllowed(accessRules(access), call) || call.kind === "execute" && isSafeReadCommand(call.title ?? "");
9224
9253
  }
9254
+ const MAX_NAME = 200;
9255
+ const CONTROL = /\p{Cc}/u;
9256
+ /**
9257
+ * A model or effort name as given by a person or an agent: trimmed, non-empty, bounded, with no
9258
+ * control characters (it ends up on a command line and in a terminal).
9259
+ */
9260
+ function cleanModelName(v) {
9261
+ if (typeof v !== "string") return void 0;
9262
+ const s = v.trim();
9263
+ return s.length > 0 && s.length <= MAX_NAME && !CONTROL.test(s) ? s : void 0;
9264
+ }
9265
+ /**
9266
+ * One item of a menu a CLI offered: a value with a control character is dropped, a name has them
9267
+ * taken out (and falls back to the value when nothing is left).
9268
+ */
9269
+ function menuItem(value, name) {
9270
+ if (typeof value !== "string" || value === "" || CONTROL.test(value)) return void 0;
9271
+ const shown = typeof name === "string" ? name.replace(/\p{Cc}+/gu, " ").trim() : "";
9272
+ return {
9273
+ value,
9274
+ name: shown === "" ? value : shown
9275
+ };
9276
+ }
9277
+ /** Parse the `workerModels` settings value; anything malformed is dropped. */
9278
+ function parseWorkerModels(v) {
9279
+ if (typeof v !== "object" || v === null || Array.isArray(v)) return {};
9280
+ const out = {};
9281
+ for (const cli of CLI_KINDS) {
9282
+ const c = v[cli];
9283
+ if (typeof c !== "object" || c === null) continue;
9284
+ const model = cleanModelName(c.model);
9285
+ const effort = cleanModelName(c.effort);
9286
+ if (model || effort) out[cli] = {
9287
+ ...model ? { model } : {},
9288
+ ...effort ? { effort } : {}
9289
+ };
9290
+ }
9291
+ return out;
9292
+ }
9293
+ /** The worker's model and effort: each field from the request, else the user's default. */
9294
+ function resolveWorkerModel(requested, defaults) {
9295
+ const model = cleanModelName(requested?.model) ?? cleanModelName(defaults?.model);
9296
+ const effort = cleanModelName(requested?.effort) ?? cleanModelName(defaults?.effort);
9297
+ return {
9298
+ ...model ? { model } : {},
9299
+ ...effort ? { effort } : {}
9300
+ };
9301
+ }
9302
+ const MODEL_IDS = ["model"];
9303
+ const EFFORT_IDS = [
9304
+ "effort",
9305
+ "reasoning_effort",
9306
+ "thought_level"
9307
+ ];
9308
+ /** The ACP session config option for `kind`: by category, else by a known id. */
9309
+ function findModelOption(options, kind) {
9310
+ if (!Array.isArray(options)) return void 0;
9311
+ const list = options;
9312
+ const category = kind === "model" ? "model" : "thought_level";
9313
+ const ids = kind === "model" ? MODEL_IDS : EFFORT_IDS;
9314
+ const o = list.find((x) => x?.category === category) ?? list.find((x) => typeof x?.id === "string" && ids.includes(x.id));
9315
+ if (!o || typeof o.id !== "string") return void 0;
9316
+ const flat = (Array.isArray(o.options) ? o.options : []).flatMap((x) => {
9317
+ const item = x;
9318
+ return Array.isArray(item?.options) ? item.options : [x];
9319
+ });
9320
+ const values = [];
9321
+ for (const x of flat) {
9322
+ const item = menuItem(x?.value, x?.name);
9323
+ if (item) values.push(item);
9324
+ }
9325
+ return {
9326
+ id: o.id,
9327
+ ...typeof o.currentValue === "string" && !CONTROL.test(o.currentValue) ? { current: o.currentValue } : {},
9328
+ values
9329
+ };
9330
+ }
9331
+ /** The menu a CLI offers, from its ACP session config options. */
9332
+ function menuFromConfigOptions(options, at) {
9333
+ const m = findModelOption(options, "model");
9334
+ const e = findModelOption(options, "effort");
9335
+ return {
9336
+ models: m?.values ?? [],
9337
+ efforts: e?.values ?? [],
9338
+ current: {
9339
+ ...m?.current ? { model: m.current } : {},
9340
+ ...e?.current ? { effort: e.current } : {}
9341
+ },
9342
+ at
9343
+ };
9344
+ }
9345
+ /** Short label for a card: `sonnet · high`, or undefined when nothing is known. */
9346
+ function modelLabel(c) {
9347
+ const parts = [c?.model, c?.effort].filter((x) => !!x);
9348
+ return parts.length > 0 ? parts.join(" · ") : void 0;
9349
+ }
9350
+ function parseItems(v) {
9351
+ if (!Array.isArray(v)) return [];
9352
+ return v.flatMap((x) => {
9353
+ if (typeof x !== "object" || x === null) return [];
9354
+ const item = menuItem(x.value, x.name);
9355
+ return item ? [item] : [];
9356
+ });
9357
+ }
9358
+ /** Read the remembered menus (`dataPaths(...).workerModels`). Missing or malformed: none. */
9359
+ function readModelMenus(path) {
9360
+ try {
9361
+ const v = JSON.parse(readFileSync(path, "utf8"));
9362
+ if (typeof v !== "object" || v === null) return {};
9363
+ const out = {};
9364
+ for (const cli of CLI_KINDS) {
9365
+ const m = v[cli];
9366
+ if (typeof m !== "object" || m === null) continue;
9367
+ const cur = m.current ?? {};
9368
+ const model = cleanModelName(cur.model);
9369
+ const effort = cleanModelName(cur.effort);
9370
+ out[cli] = {
9371
+ models: parseItems(m.models),
9372
+ efforts: parseItems(m.efforts),
9373
+ current: {
9374
+ ...model ? { model } : {},
9375
+ ...effort ? { effort } : {}
9376
+ },
9377
+ at: typeof m.at === "string" ? m.at : ""
9378
+ };
9379
+ }
9380
+ return out;
9381
+ } catch {
9382
+ return {};
9383
+ }
9384
+ }
9385
+ /** Remember the menu of one CLI. Written atomically; failures are ignored (it is a cache). */
9386
+ function writeModelMenu(path, cli, menu) {
9387
+ try {
9388
+ const all = {
9389
+ ...readModelMenus(path),
9390
+ [cli]: menu
9391
+ };
9392
+ mkdirSync(dirname(path), {
9393
+ recursive: true,
9394
+ mode: 448
9395
+ });
9396
+ const tmp = `${path}.${process.pid}.tmp`;
9397
+ writeFileSync(tmp, `${JSON.stringify(all, null, 2)}\n`, { mode: 384 });
9398
+ renameSync(tmp, path);
9399
+ } catch {}
9400
+ }
9225
9401
  const WORKER_UNANSWERED = ["deny", "allow"];
9226
9402
  /** What workers may do, with the default when it was never chosen. */
9227
9403
  function workerAccessOf(s) {
9228
- return s.workerAccess ?? "edit";
9404
+ return s.workerAccess ?? "full";
9229
9405
  }
9230
9406
  /** What happens to an unanswered request, with the default when it was never chosen. */
9231
9407
  function workerUnansweredOf(s) {
@@ -9251,7 +9427,8 @@ function readSettings(path) {
9251
9427
  ...typeof o.wakeBeforeFirstPrompt === "boolean" ? { wakeBeforeFirstPrompt: o.wakeBeforeFirstPrompt } : {},
9252
9428
  ...typeof o.workerAccess === "string" && parseWorkerAccess(o.workerAccess) ? { workerAccess: parseWorkerAccess(o.workerAccess) } : {},
9253
9429
  ...WORKER_ASK_TIMEOUT_CHOICES.includes(o.workerAskTimeoutSec) ? { workerAskTimeoutSec: o.workerAskTimeoutSec } : {},
9254
- ...WORKER_UNANSWERED.includes(o.workerUnanswered) ? { workerUnanswered: o.workerUnanswered } : {}
9430
+ ...WORKER_UNANSWERED.includes(o.workerUnanswered) ? { workerUnanswered: o.workerUnanswered } : {},
9431
+ ...Object.keys(parseWorkerModels(o.workerModels)).length > 0 ? { workerModels: parseWorkerModels(o.workerModels) } : {}
9255
9432
  };
9256
9433
  } catch {
9257
9434
  return {};
@@ -9408,6 +9585,13 @@ const recordFiles = (dataDir) => {
9408
9585
  return [];
9409
9586
  }
9410
9587
  };
9588
+ /** The record of the worker whose host registered `sessionId`, whatever its file is named. */
9589
+ function spawnRecordOfSession(dataDir, sessionId) {
9590
+ for (const path of recordFiles(dataDir)) {
9591
+ const rec = readSpawnRecord(path);
9592
+ if (rec?.sessionId === sessionId) return rec;
9593
+ }
9594
+ }
9411
9595
  /**
9412
9596
  * Records of spawned sessions that are still running. Records of sessions that ended are deleted
9413
9597
  * as they are found.
@@ -9479,7 +9663,7 @@ function decodeAcpLaunchSpec(text) {
9479
9663
  ...typeof o.task === "string" && o.task !== "" ? { task: o.task } : {},
9480
9664
  ...typeof o.spawnedBy === "string" ? { spawnedBy: o.spawnedBy } : {},
9481
9665
  from: str("from"),
9482
- access: (typeof o.access === "string" ? parseWorkerAccess(o.access) : void 0) ?? "edit",
9666
+ access: (typeof o.access === "string" ? parseWorkerAccess(o.access) : void 0) ?? "full",
9483
9667
  ...typeof o.mode === "string" && o.mode !== "" ? { mode: o.mode } : {},
9484
9668
  ...mcp && typeof mcp.command === "string" && strings(mcp.args) ? { mcp: {
9485
9669
  command: mcp.command,
@@ -9487,7 +9671,10 @@ function decodeAcpLaunchSpec(text) {
9487
9671
  } } : {},
9488
9672
  askTimeoutMs: typeof o.askTimeoutMs === "number" && o.askTimeoutMs > 0 ? o.askTimeoutMs : 12e4,
9489
9673
  ...o.unanswered === "allow" || o.unanswered === "deny" ? { unanswered: o.unanswered } : {},
9490
- ...typeof o.setupTimeoutMs === "number" && o.setupTimeoutMs > 0 ? { setupTimeoutMs: o.setupTimeoutMs } : {}
9674
+ ...typeof o.setupTimeoutMs === "number" && o.setupTimeoutMs > 0 ? { setupTimeoutMs: o.setupTimeoutMs } : {},
9675
+ ...cleanModelName(o.model) ? { model: cleanModelName(o.model) } : {},
9676
+ ...cleanModelName(o.effort) ? { effort: cleanModelName(o.effort) } : {},
9677
+ ...typeof o.modelMenuPath === "string" && o.modelMenuPath !== "" ? { modelMenuPath: o.modelMenuPath } : {}
9491
9678
  };
9492
9679
  }
9493
9680
  /** Write an ACP launch file readable by the owner only. */
@@ -9764,6 +9951,7 @@ function realSpawnDeps(opts) {
9764
9951
  which: (name) => findOnPath(name, env, platform, platform === "win32" ? entryExists : void 0),
9765
9952
  acpNpxConsent: () => readSettings(dataPaths(platform, opts.dataDir).settings).acpAdapterNpx === true,
9766
9953
  workerAccess: () => readSettings(dataPaths(platform, opts.dataDir).settings).workerAccess,
9954
+ workerModels: () => readSettings(dataPaths(platform, opts.dataDir).settings).workerModels,
9767
9955
  workerUnanswered: () => readSettings(dataPaths(platform, opts.dataDir).settings).workerUnanswered ?? "deny",
9768
9956
  workerAskTimeoutSec: () => workerAskTimeoutOf(readSettings(dataPaths(platform, opts.dataDir).settings)),
9769
9957
  repoExists: existsSync,
@@ -9846,6 +10034,7 @@ const SPAWN_TABLE = {
9846
10034
  claude: {
9847
10035
  binaries: ["claude"],
9848
10036
  interactive: (task) => task === void 0 ? [] : [task],
10037
+ modelArgs: (c) => [...c.model ? ["--model", c.model] : [], ...c.effort ? ["--effort", c.effort] : []],
9849
10038
  interactivePrompt: true,
9850
10039
  docs: ["https://code.claude.com/docs/en/cli-reference (claude \"query\")"],
9851
10040
  acp: {
@@ -9864,6 +10053,7 @@ const SPAWN_TABLE = {
9864
10053
  codex: {
9865
10054
  binaries: ["codex"],
9866
10055
  interactive: (task) => task === void 0 ? [] : [task],
10056
+ modelArgs: (c) => [...c.model ? ["-m", c.model] : [], ...c.effort ? ["-c", `model_reasoning_effort=${c.effort}`] : []],
9867
10057
  interactivePrompt: true,
9868
10058
  docs: ["https://developers.openai.com/codex/cli/reference (codex [PROMPT])", "reference/src/codex/codex-rs/tui/src/cli.rs (the optional PROMPT argument)"],
9869
10059
  acp: {
@@ -9886,6 +10076,7 @@ const SPAWN_TABLE = {
9886
10076
  opencode: {
9887
10077
  binaries: ["opencode"],
9888
10078
  interactive: (task) => task === void 0 ? [] : ["--prompt", task],
10079
+ modelArgs: (c) => c.model ? ["-m", c.model] : [],
9889
10080
  interactivePrompt: true,
9890
10081
  docs: ["https://opencode.ai/docs/cli/ (the TUI --prompt flag)", "reference/src/opencode/packages/cli/src/commands/commands.ts at v2.4.3 (--prompt)"],
9891
10082
  acp: {
@@ -9903,6 +10094,7 @@ const SPAWN_TABLE = {
9903
10094
  antigravity: {
9904
10095
  binaries: ["agy"],
9905
10096
  interactive: () => [],
10097
+ modelArgs: (c) => [...c.model ? ["--model", c.model] : [], ...c.effort ? ["--effort", c.effort] : []],
9906
10098
  interactivePrompt: false,
9907
10099
  docs: ["https://antigravity.google/docs/cli/acp (agy)"],
9908
10100
  acp: {
@@ -9920,6 +10112,7 @@ const SPAWN_TABLE = {
9920
10112
  grok: {
9921
10113
  binaries: ["grok"],
9922
10114
  interactive: (task) => task === void 0 ? [] : [task],
10115
+ modelArgs: (c) => [...c.model ? ["-m", c.model] : [], ...c.effort ? ["--reasoning-effort", c.effort] : []],
9923
10116
  interactivePrompt: true,
9924
10117
  docs: ["reference/src/grok-build/crates/codegen/xai-grok-pager/src/app/cli.rs (prompt)"],
9925
10118
  acp: {
@@ -9942,10 +10135,10 @@ function safePrompt(task) {
9942
10135
  return task.startsWith("-") ? `Task: ${task}` : task;
9943
10136
  }
9944
10137
  /** Arguments (after the program) for a window spawn: the interactive CLI, with the first task. */
9945
- function buildCliArgs(cli, task) {
10138
+ function buildCliArgs(cli, task, choice = {}) {
9946
10139
  const spec = SPAWN_TABLE[cli];
9947
10140
  if (!spec) throw new Error(`No spawn entry for "${cli}".`);
9948
- return spec.interactive(spec.interactivePrompt && task !== void 0 ? safePrompt(task) : void 0);
10141
+ return [...spec.modelArgs?.(choice) ?? [], ...spec.interactive(spec.interactivePrompt && task !== void 0 ? safePrompt(task) : void 0)];
9949
10142
  }
9950
10143
  const NO_TERMINAL_FIX = "Run the session in the background (drop --window), or start the CLI yourself.";
9951
10144
  /** Linux terminals, in the order tried. Each says how to run a program in a directory. */
@@ -10171,7 +10364,7 @@ async function spawnSession(deps, req) {
10171
10364
  confineToHome: req.confineToHome
10172
10365
  });
10173
10366
  const window = req.window === true;
10174
- const access = req.access ?? deps.workerAccess?.() ?? "edit";
10367
+ const access = req.access ?? deps.workerAccess?.() ?? "full";
10175
10368
  const acpResolved = spec.acp ? resolveAcpProgram(cli, spec.acp, {
10176
10369
  env: deps.env,
10177
10370
  which: deps.which,
@@ -10204,7 +10397,12 @@ async function spawnSession(deps, req) {
10204
10397
  }))];
10205
10398
  const repo = await detectRepo(cwd, { exists: deps.repoExists });
10206
10399
  const name = req.name !== void 0 ? validateRename(newSessionId(), req.name, named) : generateSessionName(kind.data, repo.basename, named);
10207
- const plan = planProgram(program, window ? buildCliArgs(cli, task) : [...acpRun?.args ?? [], ...spec.acp?.args ?? []], {
10400
+ const chosen = resolveWorkerModel({
10401
+ model: req.model,
10402
+ effort: req.effort
10403
+ }, deps.workerModels?.()?.[cli]);
10404
+ if (window && [chosen.model, chosen.effort].some((v) => v?.startsWith("-"))) throw new SpawnError("A model or effort name cannot start with a dash in a window, the CLI would read it as a flag.");
10405
+ const plan = planProgram(program, window ? buildCliArgs(cli, task, chosen) : [...acpRun?.args ?? [], ...spec.acp?.args ?? []], {
10208
10406
  platform: deps.platform,
10209
10407
  env: deps.env
10210
10408
  });
@@ -10254,6 +10452,9 @@ async function spawnSession(deps, req) {
10254
10452
  },
10255
10453
  unanswered: deps.workerUnanswered?.() === "allow" ? "allow" : "deny",
10256
10454
  askTimeoutMs: (deps.workerAskTimeoutSec?.() ?? 120) * 1e3,
10455
+ ...chosen.model ? { model: chosen.model } : {},
10456
+ ...chosen.effort ? { effort: chosen.effort } : {},
10457
+ modelMenuPath: dataPaths(deps.platform, deps.dataDir).workerModels,
10257
10458
  ...acpRun?.source.startsWith("npx:") ? { setupTimeoutMs: NPX_SETUP_TIMEOUT_MS } : {}
10258
10459
  });
10259
10460
  run = await deps.launchBackground({
@@ -10381,4 +10582,4 @@ async function waitForRegistration(deps, w) {
10381
10582
  await deps.sleep(250);
10382
10583
  }
10383
10584
  }
10384
- export { formatContinuation as $, sanitizeLine as $n, resolveRecipient as $t, claimOrchestrator as A, MessageId as An, pendingHookContext as At, dataDir as B, defaultSocketPath as Bn, readAccountTokens as Bt, askedKey as C, CLI_KINDS as Cn, oneWindowPerHost as Ct, autoLimitsFromEnv as D, EVENT_NOTIFICATION_METHOD as Dn, parsePs1ShimTarget as Dt, autoCandidates as E, EVENT_NAMES as En, parseCmdShimTarget as Et, compatStatus as F, RpcResponse as Fn, planProgram as Ft, dropFromList as G, makeEventNotification as Gn, readSettings as Gt, decideAutoContinue as H, ipcMethods as Hn, readCommandLine as Ht, completeLogin as I, SESSION_ENDED_TEXT as In, planSpawn as It, endTurnContinuation as J, newMessageId as Jn, renderBody as Jt, editJson as K, makeResult as Kn, readSpawnRecord as Kt, createWmiWalker as L, SESSION_NAME_PATTERN as Ln, pollDeviceCode as Lt, clearOrchestrator as M, PROTOCOL_VERSION as Mn, pidAlive as Mt, clientProof as N, RelayPayload as Nn, pinnedAdapter as Nt, baseName as O, EventPayload as On, parseWorkerAccess as Ot, compareVersions as P, RpcErrorCode as Pn, planLauncher as Pt, findOnPath as Q, safeParse as Qn, resolveAcpProgram as Qt, currentAccessToken as R, SessionId as Rn, proofsMatch as Rt, appendHookLog as S, writeSettings as Sn, newAuthNonce as St, attachAcpSession as T, DeviceId as Tn, parseCliVersion as Tt, defaultProcessIo as U, isSocketPathTooLong as Un, readInbox as Ut, dataPaths as V, encodeFrame as Vn, readAncestry as Vt, detectRepo as W, makeError as Wn, readProcessList as Wt, existedBefore as X, parseIpcRequest as Xn, requeueEntries as Xt, evaluateLiveness as Y, newSessionId as Yn, requestDeviceCode as Yt, fetchAccountStatus as Z, parseRelayFrame as Zn, requeueMessages as Zt, ackEntries as _, waitForWork as _n, leadLogPath as _t, FROM_USER_NOTICE as a, spawnRecordPath as an, literal as ar, hookLogPath as at, adapterNpxCommand as b, workerAskTimeoutOf as bn, markDelivered as bt, ORCHESTRATOR_TASK_NOTICE as c, statusAfterLiveness as cn, string as cr, isAntigravityApp as ct, SPAWN_TABLE as d, takeWithinChars as dn, isOnline as dt, resolveWindowsCommand as en, socketPathTooLongMessage as er, formatHookContext as et, SpawnError as f, tooManyUnreadMessage as fn, jwtClaim as ft, accessAllows as g, validateRename as gn, leadLogLine as gt, WORKER_UNANSWERED as h, updateSpawnRecord as hn, launcherText as ht, ConvenoError as i, senderOf as in, discriminatedUnion as ir, hookLogLine as it, claimSpawnRecord as j, OWNER_SESSION_ID as jn, pendingTurn as jt, bindAccountDevice as k, Message as kn, pendingForInjection as kt, RESPONSE_BUDGET_BYTES as l, takeAcpLaunchFile as ln, isFromOwner as lt, WORKER_ASK_TIMEOUT_CHOICES as m, uninstallLauncher as mn, launcherPath as mt, AccountError as n, runWaker as nn, array as nr, generateSessionName as nt, HEARTBEAT_INTERVAL_MS as o, spawnSession as on, number as or, hostAlive as ot, WORKER_ACCESS as p, turnHops as pn, late as pt, effectiveHolder as q, newDeviceId as qn, realSpawnDeps as qt, CLAUDE_PENDING_TURN_FOLDER as r, sameJson as rn, boolean as rr, holderAfterDeparture as rt, NOT_FROM_USER_NOTICE as s, startTurnContext as sn, object as sr, hostPidOf as st, ACCOUNT_API as t, runLaunchFile as tn, _enum as tr, formatInbox as tt, SPAWN_CLIS as u, takeWithinBytes as un, isObject as ut, acpOverrideVar as v, waitForWorkBatch as vn, loadJson as vt, askedMarker as w, CliKind as wn, ownSession as wt, agentCommand as x, workerUnansweredOf as xn, needsQuoting as xt, adapterInstallCommand as y, workerAccessOf as yn, logoutAccount as yt, daemonProof as z, createLineDecoder as zn, putInList as zt };
10585
+ export { fetchAccountStatus as $, makeEventNotification as $n, realSpawnDeps as $t, bindAccountDevice as A, writeSettings as An, parseCliVersion as At, currentAccessToken as B, PROTOCOL_VERSION as Bn, planProgram as Bt, appendHookLog as C, validateRename as Cn, markDelivered as Ct, autoCandidates as D, workerAskTimeoutOf as Dn, newAuthNonce as Dt, attachAcpSession as E, workerAccessOf as En, needsQuoting as Et, clientProof as F, EVENT_NOTIFICATION_METHOD as Fn, pendingHookContext as Ft, defaultProcessIo as G, SESSION_NAME_PATTERN as Gn, readAccountTokens as Gt, dataDir as H, RpcErrorCode as Hn, pollDeviceCode as Ht, compareVersions as I, EventPayload as In, pendingTurn as It, editJson as J, defaultSocketPath as Jn, readInbox as Jt, detectRepo as K, SessionId as Kn, readAncestry as Kt, compatStatus as L, Message as Ln, pidAlive as Lt, claimSpawnRecord as M, CliKind as Mn, parsePs1ShimTarget as Mt, cleanModelName as N, DeviceId as Nn, parseWorkerAccess as Nt, autoLimitsFromEnv as O, workerUnansweredOf as On, oneWindowPerHost as Ot, clearOrchestrator as P, EVENT_NAMES as Pn, pendingForInjection as Pt, existedBefore as Q, makeError as Qn, readSpawnRecord as Qt, completeLogin as R, MessageId as Rn, pinnedAdapter as Rt, agentCommand as S, updateSpawnRecord as Sn, logoutAccount as St, askedMarker as T, waitForWorkBatch as Tn, modelLabel as Tt, dataPaths as U, RpcResponse as Un, proofsMatch as Ut, daemonProof as V, RelayPayload as Vn, planSpawn as Vt, decideAutoContinue as W, SESSION_ENDED_TEXT as Wn, putInList as Wt, endTurnContinuation as X, ipcMethods as Xn, readProcessList as Xt, effectiveHolder as Y, encodeFrame as Yn, readModelMenus as Yt, evaluateLiveness as Z, isSocketPathTooLong as Zn, readSettings as Zt, accessAllows as _, takeWithinBytes as _n, launcherPath as _t, FROM_USER_NOTICE as a, resolveRecipient as an, parseRelayFrame as ar, generateSessionName as at, adapterInstallCommand as b, turnHops as bn, leadLogPath as bt, NPX_SETUP_TIMEOUT_MS as c, runWaker as cn, socketPathTooLongMessage as cr, hookLogPath as ct, SPAWN_CLIS as d, spawnRecordOfSession as dn, boolean as dr, isAntigravityApp as dt, renderBody as en, makeResult as er, findModelOption as et, SPAWN_TABLE as f, spawnRecordPath as fn, discriminatedUnion as fr, isFromOwner as ft, WORKER_UNANSWERED as g, takeAcpLaunchFile as gn, string as gr, late as gt, WORKER_ASK_TIMEOUT_CHOICES as h, statusAfterLiveness as hn, object as hr, jwtClaim as ht, ConvenoError as i, resolveAcpProgram as in, parseIpcRequest as ir, formatInbox as it, claimOrchestrator as j, CLI_KINDS as jn, parseCmdShimTarget as jt, baseName as k, writeModelMenu as kn, ownSession as kt, ORCHESTRATOR_TASK_NOTICE as l, sameJson as ln, _enum as lr, hostAlive as lt, WORKER_ACCESS as m, startTurnContext as mn, number as mr, isOnline as mt, AccountError as n, requeueEntries as nn, newMessageId as nr, formatContinuation as nt, HEARTBEAT_INTERVAL_MS as o, resolveWindowsCommand as on, safeParse as or, holderAfterDeparture as ot, SpawnError as p, spawnSession as pn, literal as pr, isObject as pt, dropFromList as q, createLineDecoder as qn, readCommandLine as qt, CLAUDE_PENDING_TURN_FOLDER as r, requeueMessages as rn, newSessionId as rr, formatHookContext as rt, NOT_FROM_USER_NOTICE as s, runLaunchFile as sn, sanitizeLine as sr, hookLogLine as st, ACCOUNT_API as t, requestDeviceCode as tn, newDeviceId as tr, findOnPath as tt, RESPONSE_BUDGET_BYTES as u, senderOf as un, array as ur, hostPidOf as ut, ackEntries as v, takeWithinChars as vn, launcherText as vt, askedKey as w, waitForWork as wn, menuFromConfigOptions as wt, adapterNpxCommand as x, uninstallLauncher as xn, loadJson as xt, acpOverrideVar as y, tooManyUnreadMessage as yn, leadLogLine as yt, createWmiWalker as z, OWNER_SESSION_ID as zn, planLauncher as zt };
@@ -2,7 +2,7 @@ import { execFile, spawn } from "node:child_process";
2
2
  import { readFileSync, statSync } from "node:fs";
3
3
  import { readFile } from "node:fs/promises";
4
4
  import { join } from "node:path";
5
- import { At as pendingHookContext, Ft as planProgram, It as planSpawn, J as endTurnContinuation, Q as findOnPath, Tt as parseCliVersion, sn as startTurnContext, wt as ownSession } from "./dist-1k5b8UGF.js";
5
+ import { At as parseCliVersion, Bt as planProgram, Ft as pendingHookContext, Vt as planSpawn, X as endTurnContinuation, kt as ownSession, mn as startTurnContext, tt as findOnPath } from "./dist-DnWOZkAu.js";
6
6
  import { n as cs, t as Za } from "./toml-patch-DGzVRdd1.js";
7
7
  // ../adapters/codex/dist/index.js
8
8
  const SERVER_NAME = "conveno";
@@ -1,6 +1,6 @@
1
1
  import { readFile, readdir } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
- import { At as pendingHookContext, B as dataDir, G as dropFromList, J as endTurnContinuation, K as editJson, P as compareVersions, Pt as planLauncher, Tt as parseCliVersion, X as existedBefore, mn as uninstallLauncher, pt as late, rn as sameJson, ut as isObject, vt as loadJson, w as askedMarker, wt as ownSession, x as agentCommand, xt as needsQuoting } from "./dist-1k5b8UGF.js";
3
+ import { At as parseCliVersion, Et as needsQuoting, Ft as pendingHookContext, H as dataDir, I as compareVersions, J as editJson, Q as existedBefore, S as agentCommand, T as askedMarker, X as endTurnContinuation, gt as late, kt as ownSession, ln as sameJson, pt as isObject, q as dropFromList, xn as uninstallLauncher, xt as loadJson, zt as planLauncher } from "./dist-DnWOZkAu.js";
4
4
  // ../adapters/antigravity/dist/index.js
5
5
  const SERVER_NAME = "conveno";
6
6
  /** The name of our entry in hooks.json. Antigravity keys hooks by an arbitrary name. */
@@ -2,7 +2,7 @@ import { randomBytes as randomBytes$1 } from "@noble/ciphers/utils.js";
2
2
  import { equalBytes } from "@noble/curves/utils.js";
3
3
  import { sha256 } from "@noble/hashes/sha2.js";
4
4
  import { bytesToHex, concatBytes, utf8ToBytes } from "@noble/hashes/utils.js";
5
- import { Tn as DeviceId, ar as literal, cr as string, ir as discriminatedUnion, nr as array, or as number, sr as object, tr as _enum } from "./dist-1k5b8UGF.js";
5
+ import { Nn as DeviceId, fr as discriminatedUnion, gr as string, hr as object, lr as _enum, mr as number, pr as literal, ur as array } from "./dist-DnWOZkAu.js";
6
6
  import { ed25519, x25519 } from "@noble/curves/ed25519.js";
7
7
  import { chacha20poly1305 } from "@noble/ciphers/chacha.js";
8
8
  import { expand, extract } from "@noble/hashes/hkdf.js";
@@ -1,5 +1,5 @@
1
1
  import { appendFileSync } from "node:fs";
2
- import { S as appendHookLog, it as hookLogLine } from "./dist-1k5b8UGF.js";
2
+ import { C as appendHookLog, st as hookLogLine } from "./dist-DnWOZkAu.js";
3
3
  import { n as connectOpts } from "./ctx-tYftvhz_.js";
4
4
  // src/hook.ts
5
5
  /**
@@ -1,13 +1,13 @@
1
1
  import { homedir } from "node:os";
2
- import { n as antigravityAdapter } from "./dist-vefQHFb-.js";
2
+ import { n as antigravityAdapter } from "./dist-XoKXwG-y.js";
3
3
  import { isAbsolute, join } from "node:path";
4
- import { At as pendingHookContext, B as dataDir, Gt as readSettings, J as endTurnContinuation, Tt as parseCliVersion, V as dataPaths, Vt as readAncestry, Zt as requeueMessages, _n as waitForWork, at as hookLogPath, jt as pendingTurn, ot as hostAlive, r as CLAUDE_PENDING_TURN_FOLDER, sn as startTurnContext, vn as waitForWorkBatch, wt as ownSession } from "./dist-1k5b8UGF.js";
4
+ import { At as parseCliVersion, Ft as pendingHookContext, H as dataDir, It as pendingTurn, Kt as readAncestry, Tn as waitForWorkBatch, U as dataPaths, X as endTurnContinuation, Zt as readSettings, ct as hookLogPath, kt as ownSession, lt as hostAlive, mn as startTurnContext, r as CLAUDE_PENDING_TURN_FOLDER, rn as requeueMessages, wn as waitForWork } from "./dist-DnWOZkAu.js";
5
5
  import { readFile } from "node:fs/promises";
6
6
  import { applyEdits, modify, parse, printParseErrorCode } from "jsonc-parser";
7
- import { t as codexAdapter } from "./dist-Cv5et1iE.js";
8
- import { t as grokAdapter } from "./dist-D-PhGsuL.js";
9
- import { n as connect } from "./dist-BYkDv29h.js";
10
- import { t as runHook } from "./hook-mvifUk0K.js";
7
+ import { t as codexAdapter } from "./dist-X1bpJWck.js";
8
+ import { t as grokAdapter } from "./dist-BqfYxlVP.js";
9
+ import { n as connect } from "./dist-Ch3ohbIk.js";
10
+ import { t as runHook } from "./hook-DHMu72Vf.js";
11
11
  // ../adapters/claude/dist/index.js
12
12
  const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
13
13
  /** Read a JSON object file. Missing or blank files give `{}`; anything else that is not a JSON object throws. */
@@ -0,0 +1 @@
1
+ export { i as runHookEntry } from "./hook-entry-CLAuy_HJ.js";
@@ -1,13 +1,13 @@
1
- import { Cn as CLI_KINDS, Ot as parseWorkerAccess, V as dataPaths, d as SPAWN_TABLE, f as SpawnError, on as spawnSession, p as WORKER_ACCESS, qt as realSpawnDeps, tn as runLaunchFile, u as SPAWN_CLIS } from "./dist-1k5b8UGF.js";
2
- import { A as runRelay, I as runAccount, L as runLogin, M as runDaemon, P as VERSION, R as runLogout, b as workerAccessLine, i as runDoctor, k as runDevices, m as runSetup, p as runInit, t as runUninstall } from "./uninstall-CQoGVhp3.js";
3
- import { a as parseFlags, i as commandHelp, n as COMMANDS, r as COMMAND_NAMES, t as ALL_COMMAND_NAMES } from "./args-DmUsbNu9.js";
4
- import { t as daemonProblem } from "./daemonError-CUE_dVn-.js";
1
+ import { $t as realSpawnDeps, N as cleanModelName, Nt as parseWorkerAccess, U as dataPaths, d as SPAWN_CLIS, f as SPAWN_TABLE, jn as CLI_KINDS, m as WORKER_ACCESS, p as SpawnError, pn as spawnSession, sn as runLaunchFile } from "./dist-DnWOZkAu.js";
2
+ import { A as runRelay, I as runAccount, L as runLogin, M as runDaemon, P as VERSION, R as runLogout, b as workerAccessLine, i as runDoctor, k as runDevices, m as runSetup, p as runInit, t as runUninstall } from "./uninstall-jwneyeJm.js";
3
+ import { a as parseFlags, i as commandHelp, n as COMMANDS, r as COMMAND_NAMES, t as ALL_COMMAND_NAMES } from "./args-CtyKPZuN.js";
4
+ import { t as daemonProblem } from "./daemonError-DUP5zkiR.js";
5
5
  import { chmod, mkdir, writeFile } from "node:fs/promises";
6
6
  import { join, resolve } from "node:path";
7
7
  import { a as fail, c as plural, d as warnBlock, n as cmd, r as columns, s as plainError, t as closest, u as tilde } from "./fmt-C2SsP5Y0.js";
8
- import { t as runHook } from "./hook-mvifUk0K.js";
8
+ import { t as runHook } from "./hook-DHMu72Vf.js";
9
9
  import { n as connectOpts, t as adapterEnv } from "./ctx-tYftvhz_.js";
10
- import { t as findSession } from "./pick-ClIK4l8K.js";
10
+ import { t as findSession } from "./pick-UDFASnAn.js";
11
11
  import { readFileSync } from "node:fs";
12
12
  // src/errorLog.ts
13
13
  /** The message of an unexpected error, as it is. Not the softened text `plainError` gives. */
@@ -297,6 +297,23 @@ async function runSpawn(ctx, argv) {
297
297
  exit: 2,
298
298
  ref: "e_usage"
299
299
  });
300
+ const model = cleanModelName(str("model"));
301
+ const effort = cleanModelName(str("effort"));
302
+ for (const [flag, given, clean] of [[
303
+ "model",
304
+ str("model"),
305
+ model
306
+ ], [
307
+ "effort",
308
+ str("effort"),
309
+ effort
310
+ ]]) if (given !== void 0 && clean === void 0) return fail(ctx, {
311
+ what: `--${flag} is empty, too long or has a line break`,
312
+ detail: ["Give the CLI's own name, up to 200 characters."],
313
+ fix: help,
314
+ exit: 2,
315
+ ref: "e_usage"
316
+ });
300
317
  const window = parsed.values.window === true;
301
318
  const yes = parsed.values.yes === true;
302
319
  const adapter = ctx.adapters.find((a) => a.cli === cli);
@@ -335,8 +352,6 @@ async function runSpawn(ctx, argv) {
335
352
  });
336
353
  }
337
354
  try {
338
- const { hostPid } = await ctx.ancestry(8e3);
339
- const requester = hostPid === void 0 ? void 0 : (await client["session.byHost"]({ pid: hostPid }).catch(() => void 0))?.session ?? void 0;
340
355
  const runner = ctx.spawnRunner ?? [process.execPath, process.argv[1] ?? "conveno"];
341
356
  const deps = realSpawnDeps({
342
357
  platform: ctx.platform,
@@ -354,12 +369,13 @@ async function runSpawn(ctx, argv) {
354
369
  task,
355
370
  window,
356
371
  access,
357
- requester,
372
+ model,
373
+ effort,
358
374
  confineToHome: false,
359
375
  onProgress: (line) => ctx.err(`${t.paint("quiet", line)}\n`)
360
376
  });
361
377
  const how = res.window ? res.terminal ?? "terminal" : "background";
362
- ctx.out(`${t.status("ok")} ${t.bold(`Started ${res.name}`)} ${t.paint("quiet", `(${res.cli}, ${how}) in ${tilde(res.cwd, ctx.home)}${requester ? ` for ${requester.name}` : ""}`)}\n`);
378
+ ctx.out(`${t.status("ok")} ${t.bold(`Started ${res.name}`)} ${t.paint("quiet", `(${res.cli}, ${how}) in ${tilde(res.cwd, ctx.home)}`)}\n`);
363
379
  if (res.task === "message") ctx.out(` The first task was sent to it as a Conveno message.\n`);
364
380
  if (!res.window) {
365
381
  ctx.out(` End it with ${cmd(t, `conveno stop ${res.name}`)}.\n`);
@@ -446,7 +462,7 @@ function renderSessions(ctx, sessions) {
446
462
  const tags = [...s.isOrchestrator ? [t.paint("entry", "lead")] : [], ...s.spawned || s.spawnedBy ? [q("spawned")] : []];
447
463
  return [
448
464
  `${st.glyph} ${t.bold(s.name)}${tags.length > 0 ? ` ${tags.join(" ")}` : ""}`,
449
- s.variant === "app" ? "Antigravity app" : toolName(s.cli),
465
+ (s.variant === "app" ? "Antigravity app" : toolName(s.cli)) + (s.model ? q(` · ${s.model.length > 30 ? `${s.model.slice(0, 29)}…` : s.model}`) : ""),
450
466
  st.word,
451
467
  ...waiting ? [s.unreadCount ? String(s.unreadCount) : q("none")] : [],
452
468
  ...doing ? [s.statusText ?? ""] : []
@@ -588,11 +604,11 @@ async function dispatch(name, rest, ctx) {
588
604
  case "rename": return runRename(ctx, rest);
589
605
  case "lead": return runLead(ctx, rest);
590
606
  case "spawn": return runSpawn(ctx, rest);
591
- case "acp-host": return (await import("./acp-OHqthTVC.js")).runAcpHostCmd(ctx, rest);
592
- case "stop": return (await import("./acp-OHqthTVC.js")).runStop(ctx, rest);
607
+ case "acp-host": return (await import("./acp-BtwJHwcr.js")).runAcpHostCmd(ctx, rest);
608
+ case "stop": return (await import("./acp-BtwJHwcr.js")).runStop(ctx, rest);
593
609
  case "spawn-run": return runSpawnRun(ctx, rest);
594
- case "agy-relay": return (await import("./agy-relay-DLP2H1Rj.js")).runAgyRelay(ctx, rest);
595
- case "watch": return (await import("./watch-CaC2G2cT.js")).runWatch(ctx, rest);
610
+ case "agy-relay": return (await import("./agy-relay-KS1DbLqD.js")).runAgyRelay(ctx, rest);
611
+ case "watch": return (await import("./watch-Cpp4Uwsd.js")).runWatch(ctx, rest);
596
612
  case "devices": return runDevices(ctx, rest);
597
613
  case "relay": return runRelay(ctx, rest);
598
614
  case "doctor": return runDoctor(ctx, rest);
@@ -631,7 +647,7 @@ function opensApp(env, tty = {
631
647
  async function main(argv, ctx) {
632
648
  const [command, ...rest] = argv;
633
649
  if (command === void 0 && opensApp(ctx.env)) try {
634
- return await (await import("./run-BYmOjvDF.js")).runTui(ctx);
650
+ return await (await import("./run-B-UMVEQs.js")).runTui(ctx);
635
651
  } catch (e) {
636
652
  ctx.err(`The app could not start (${rawMessage(e)}). Showing the help instead.\n`);
637
653
  ctx.out(helpText(ctx));
@@ -1,4 +1,4 @@
1
- import { Rn as SessionId } from "./dist-1k5b8UGF.js";
1
+ import { Kn as SessionId } from "./dist-DnWOZkAu.js";
2
2
  // src/pick.ts
3
3
  /** The online session a name or id means, or undefined when nothing matches. */
4
4
  async function findSession(client, text) {