@mu-crew/mu 3.10.0 → 3.10.2

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/dist/cli.js CHANGED
@@ -47,6 +47,6 @@ function enableCompileCacheIn(dir, enable = nodeEnable ?? null) {
47
47
 
48
48
  // src/main.ts
49
49
  enableCompileCacheIn(join(defaultStateDir(), "compile-cache"));
50
- var { runCli } = await import("./cli-UZEMPIPW.js");
50
+ var { runCli } = await import("./cli-GBIC22X7.js");
51
51
  await runCli(process.argv);
52
52
  //# sourceMappingURL=cli.js.map
@@ -175,6 +175,12 @@ function labelStem(label) {
175
175
  const stem = label.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 20).replace(/-+$/, "");
176
176
  return stem || void 0;
177
177
  }
178
+ var MODEL_RE = /^[A-Za-z0-9._:/@+-]+$/;
179
+ function modelCommand(cli, model, env = process.env) {
180
+ const override = env[`MU_${cli.toUpperCase().replace(/-/g, "_")}_COMMAND`];
181
+ const base = override && override.trim() !== "" ? override.trim() : cli;
182
+ return `${base} --model ${model}`;
183
+ }
178
184
  function registerDelegate(pi, run = defaultRunner()) {
179
185
  if (!delegateEnabled()) return;
180
186
  const inflight = /* @__PURE__ */ new Map();
@@ -264,7 +270,10 @@ function registerDelegate(pi, run = defaultRunner()) {
264
270
  const args = ["agent", "spawn", base, "-w", W, "--next-free", "--send", text, "--json"];
265
271
  if (params.workspace === true) args.push("--workspace");
266
272
  else if (cwd) args.push("--cwd", cwd);
267
- if (typeof params.cli === "string" && params.cli) args.push("--cli", params.cli);
273
+ const cli = typeof params.cli === "string" && params.cli ? params.cli : void 0;
274
+ if (cli) args.push("--cli", cli);
275
+ if (typeof params.model === "string" && params.model)
276
+ args.push("--command", modelCommand(cli ?? "pi", params.model));
268
277
  const r = await mu(args);
269
278
  const out = json(r);
270
279
  const spawned = out?.agent?.name;
@@ -513,7 +522,11 @@ ${task}` : task,
513
522
  },
514
523
  cli: {
515
524
  type: "string",
516
- description: "Agent CLI key (default pi). Name a configured key such as 'pi_fast' to run a cheaper model."
525
+ description: "Agent CLI key (default pi). Only keys with $MU_<KEY>_COMMAND set in pi's environment exist; to pick a model, use model instead."
526
+ },
527
+ model: {
528
+ type: "string",
529
+ description: "Model for the subagent, passed to pi as --model (e.g. 'sonnet', 'openai/gpt-5:high'); appended to the cli's command. Default: the cli's own model. Use it to vary models across a review panel."
517
530
  },
518
531
  keep: {
519
532
  type: "boolean",
@@ -546,6 +559,11 @@ ${task}` : task,
546
559
  const cwd = typeof params.cwd === "string" && params.cwd ? params.cwd : ctx?.cwd ?? process.cwd();
547
560
  if (!isDir(cwd)) throw new Error(`mu_delegate: cwd ${cwd} is not a directory`);
548
561
  }
562
+ const m = params.model;
563
+ if (m !== void 0 && !(typeof m === "string" && MODEL_RE.test(m)))
564
+ throw new Error(
565
+ `mu_delegate: model must be a pi model id like 'provider/id:thinking' (got ${JSON.stringify(m)})`
566
+ );
549
567
  const record = await resolveRecord(params.record);
550
568
  const max = delegateMax();
551
569
  if (inflight.size + starting < max) {
@@ -1084,7 +1102,7 @@ function registerRefuteNudge(pi, run = defaultRunner(), nested = notNested) {
1084
1102
  }
1085
1103
 
1086
1104
  // extension/mu-pi.ts
1087
- var EXT_VERSION = true ? "3.10.0" : void 0;
1105
+ var EXT_VERSION = true ? "3.10.2" : void 0;
1088
1106
  var FRESH_COMMAND = "mu-fresh";
1089
1107
  var FRESH_TIMEOUT_MS = 3e4;
1090
1108
  function commandName(name) {