@moda-ai/cli 1.55.26 → 1.55.27

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 (30) hide show
  1. package/dist/{agent-nqmha8ck.js → agent-vp9prdma.js} +8 -8
  2. package/dist/{cli-k6q8dbpk.js → cli-0pkc8jhg.js} +3 -3
  3. package/dist/{cli-5g1tv80h.js → cli-4h0ave0f.js} +5 -5
  4. package/dist/{cli-8tfk8qeb.js → cli-6et4z504.js} +7 -6
  5. package/dist/{cli-1mbb0ct0.js → cli-ccjfwzqx.js} +1 -1
  6. package/dist/{cli-q6f6vrrr.js → cli-hmjdgxrn.js} +1 -1
  7. package/dist/{cli-jtyvbd8d.js → cli-pg5qfmqc.js} +1 -1
  8. package/dist/{cli-b4740tnv.js → cli-q9nsvqqg.js} +14 -14
  9. package/dist/{cli-d577kq6h.js → cli-qwgct6x7.js} +7 -6
  10. package/dist/{cli-sqsjd08w.js → cli-r5pp7qny.js} +64 -438
  11. package/dist/{cli-cdrvjva5.js → cli-v8q7sd7g.js} +28 -6
  12. package/dist/cli-vdkwkkp5.js +567 -0
  13. package/dist/{cli-jgfm7w1r.js → cli-wzds257x.js} +5 -4
  14. package/dist/cli.js +299 -151
  15. package/dist/{doctor-w913fj4g.js → doctor-wmre3mr7.js} +8 -8
  16. package/dist/{fix-crkwdkt4.js → fix-75s9s0d6.js} +45 -47
  17. package/dist/{harness-x3e7d68b.js → harness-a7tb9a23.js} +5 -5
  18. package/dist/{harness-github-actions-fjhvhgpj.js → harness-github-actions-6v4wydb8.js} +5 -5
  19. package/dist/{index-2kf3fnnb.js → index-91bpc8g8.js} +15 -14
  20. package/dist/{production-intelligence-7n83c701.js → production-intelligence-7nqddd4f.js} +15 -15
  21. package/dist/{profile-commands-ct2t0bfr.js → profile-commands-49yn02yg.js} +5 -4
  22. package/dist/prompt-source-mcp.js +5 -5
  23. package/dist/{prompts-92aqqb2k.js → prompts-17wyrst6.js} +6 -6
  24. package/dist/{provision-gn8raqpt.js → provision-bc3h68e1.js} +5 -5
  25. package/dist/{registry-ex162j5y.js → registry-fpzhjznj.js} +3 -3
  26. package/dist/{skills-2mbsj9bt.js → skills-ccdbqghj.js} +5 -5
  27. package/dist/{sync-kghmmmk5.js → sync-hkxce5zh.js} +7 -7
  28. package/package.json +1 -1
  29. package/skills/integration/index.json +2 -2
  30. package/dist/cli-bb7133m7.js +0 -144
@@ -3,16 +3,16 @@ import {
3
3
  promptsDiscoveredCheck,
4
4
  runDoctorCommand,
5
5
  runStatusCommand
6
- } from "./cli-5g1tv80h.js";
7
- import"./cli-q6f6vrrr.js";
8
- import"./cli-b4740tnv.js";
6
+ } from "./cli-4h0ave0f.js";
7
+ import"./cli-hmjdgxrn.js";
8
+ import"./cli-q9nsvqqg.js";
9
9
  import"./cli-mm48br00.js";
10
- import"./cli-d577kq6h.js";
10
+ import"./cli-qwgct6x7.js";
11
11
  import"./cli-97fnztpy.js";
12
- import"./cli-cdrvjva5.js";
13
- import"./cli-jgfm7w1r.js";
14
- import"./cli-jtyvbd8d.js";
15
- import"./cli-sqsjd08w.js";
12
+ import"./cli-v8q7sd7g.js";
13
+ import"./cli-wzds257x.js";
14
+ import"./cli-pg5qfmqc.js";
15
+ import"./cli-r5pp7qny.js";
16
16
  import"./cli-0v6na3yp.js";
17
17
  export {
18
18
  runStatusCommand,
@@ -2,17 +2,17 @@ import {
2
2
  DEFAULT_POLL_INTERVAL_MS,
3
3
  DEFAULT_WAIT_TIMEOUT_MS,
4
4
  fetchLatestRun
5
- } from "./cli-b4740tnv.js";
5
+ } from "./cli-q9nsvqqg.js";
6
6
  import"./cli-mm48br00.js";
7
- import"./cli-d577kq6h.js";
7
+ import"./cli-qwgct6x7.js";
8
8
  import"./cli-97fnztpy.js";
9
- import"./cli-cdrvjva5.js";
9
+ import"./cli-v8q7sd7g.js";
10
10
  import {
11
11
  assertFlags
12
- } from "./cli-jgfm7w1r.js";
12
+ } from "./cli-wzds257x.js";
13
13
  import {
14
14
  callControlAPI
15
- } from "./cli-jtyvbd8d.js";
15
+ } from "./cli-pg5qfmqc.js";
16
16
  import {
17
17
  CliInputError,
18
18
  EXIT_DEGRADED,
@@ -20,8 +20,9 @@ import {
20
20
  EXIT_OK,
21
21
  getModaPaths,
22
22
  resolveApiTenantId,
23
+ shellArg,
23
24
  validateConfig
24
- } from "./cli-sqsjd08w.js";
25
+ } from "./cli-r5pp7qny.js";
25
26
  import"./cli-0v6na3yp.js";
26
27
 
27
28
  // src/fix.ts
@@ -154,7 +155,7 @@ async function runFixesCommand(context) {
154
155
  confidence: "high"
155
156
  },
156
157
  nextCommands: fixes.slice(0, 1).map((fix) => ({
157
- command: `moda fix ${fix.id}`,
158
+ command: `moda fix ${shellArg(fix.id)}`,
158
159
  purpose: "Open the top-ranked fix (status, gate result, next actions).",
159
160
  mutability: "read",
160
161
  requires_approval: false
@@ -528,13 +529,13 @@ async function runFixStart(context, profileOptions, tenantId) {
528
529
  },
529
530
  nextCommands: [
530
531
  {
531
- command: `moda fix start ${problemId} --wait`,
532
+ command: `moda fix start ${shellArg(problemId)} --wait`,
532
533
  purpose: "Drive the pipeline (scope → propose → gate) to a resting status.",
533
534
  mutability: "write",
534
535
  requires_approval: false
535
536
  },
536
537
  {
537
- command: `moda fix ${created.id}`,
538
+ command: `moda fix ${shellArg(created.id)}`,
538
539
  purpose: "Inspect the fix status and gate result.",
539
540
  mutability: "read",
540
541
  requires_approval: false
@@ -598,12 +599,12 @@ async function runFixVerify(context, profileOptions, tenantId) {
598
599
  if (noWait) {
599
600
  context.output.writeData({ fixId, gateRunId: enqueue.gateRunId, status: "GATING" }, {
600
601
  summary: {
601
- text: `Gate + control runs enqueued (gate run ${enqueue.gateRunId}). Resume with \`moda fix ${fixId} --wait\`.`,
602
+ text: `Gate + control runs enqueued (gate run ${enqueue.gateRunId}). Resume with \`moda fix ${shellArg(fixId)} --wait\`.`,
602
603
  confidence: "high"
603
604
  },
604
605
  nextCommands: [
605
606
  {
606
- command: `moda fix ${fixId} --wait`,
607
+ command: `moda fix ${shellArg(fixId)} --wait`,
607
608
  purpose: "Drive the advance-on-poll gate to a verdict.",
608
609
  mutability: "write",
609
610
  requires_approval: false
@@ -700,14 +701,14 @@ async function runFixCheckout(context, profileOptions, tenantId) {
700
701
  }
701
702
  const fix = await getFix(tenantId, fixId, profileOptions);
702
703
  if (isArtifactFix(fix)) {
703
- throw new CliInputError(`Fix MODA-FIX-${fix.shortRef} is a ${fix.fixType} fix — its candidate is applied in your own stack, not checked out. Run \`moda fix ${fixId} --packet\` for the candidate (written as local artifacts), apply it, then confirm with \`moda fix mark-applied ${fixId}\`.`);
704
+ throw new CliInputError(`Fix MODA-FIX-${fix.shortRef} is a ${fix.fixType} fix — its candidate is applied in your own stack, not checked out. Run \`moda fix ${shellArg(fixId)} --packet\` for the candidate (written as local artifacts), apply it, then confirm with \`moda fix mark-applied ${shellArg(fixId)}\`.`);
704
705
  }
705
706
  if (!fix.targetSourcePath) {
706
- throw new CliInputError(`Fix MODA-FIX-${fix.shortRef} has no target source path — ${fix.fixType} fixes are packet-only. Run \`moda fix ${fixId} --packet\` for the diagnosis packet.`);
707
+ throw new CliInputError(`Fix MODA-FIX-${fix.shortRef} has no target source path — ${fix.fixType} fixes are packet-only. Run \`moda fix ${shellArg(fixId)} --packet\` for the diagnosis packet.`);
707
708
  }
708
709
  const candidateVersionId = fix.candidateRef?.promptVersionId ?? "";
709
710
  if (!candidateVersionId) {
710
- throw new CliInputError(`Fix MODA-FIX-${fix.shortRef} has no registered candidate version yet (status ${fix.status}). Run \`moda fix start ${fix.problemId} --wait\` to propose one, or edit the target locally and gate it with \`moda fix verify ${fixId} --prompt-file=<path>\`.`);
711
+ throw new CliInputError(`Fix MODA-FIX-${fix.shortRef} has no registered candidate version yet (status ${fix.status}). Run \`moda fix start ${shellArg(fix.problemId)} --wait\` to propose one, or edit the target locally and gate it with \`moda fix verify ${shellArg(fixId)} --prompt-file=<path>\`.`);
711
712
  }
712
713
  if (!fix.promptId) {
713
714
  throw new CliInputError(`Fix MODA-FIX-${fix.shortRef} has no routed prompt — the candidate content cannot be resolved.`);
@@ -729,8 +730,8 @@ async function runFixCheckout(context, profileOptions, tenantId) {
729
730
  "",
730
731
  "Next steps (the CLI never runs git — branching and committing are yours):",
731
732
  ` 1. git checkout -b ${branch}`,
732
- ` 2. Review the diff. Re-gate any edits: moda fix verify ${fix.id} --prompt-file=${relPath}`,
733
- ` 3. Hand back: moda fix submit ${fix.id} --pr (or --local-ref=${branch})`,
733
+ ` 2. Review the diff. Re-gate any edits: moda fix verify ${shellArg(fix.id)} --prompt-file=${shellArg(relPath)}`,
734
+ ` 3. Hand back: moda fix submit ${shellArg(fix.id)} --pr (or --local-ref=${shellArg(branch)})`,
734
735
  ` A hand-authored PR body must end with the magic word: ${magicWord}`,
735
736
  ""
736
737
  ].join(`
@@ -758,13 +759,13 @@ async function runFixCheckout(context, profileOptions, tenantId) {
758
759
  ],
759
760
  nextCommands: [
760
761
  {
761
- command: `moda fix verify ${fix.id} --prompt-file=${relPath}`,
762
+ command: `moda fix verify ${shellArg(fix.id)} --prompt-file=${shellArg(relPath)}`,
762
763
  purpose: "Re-gate the (possibly edited) local candidate on the frozen holdout.",
763
764
  mutability: "write",
764
765
  requires_approval: false
765
766
  },
766
767
  {
767
- command: `moda fix submit ${fix.id} --pr`,
768
+ command: `moda fix submit ${shellArg(fix.id)} --pr`,
768
769
  purpose: `Open the draft fix PR (branch ${branch}, magic word "${magicWord}").`,
769
770
  mutability: "write",
770
771
  requires_approval: true
@@ -800,7 +801,7 @@ async function runFixSubmit(context, profileOptions, tenantId) {
800
801
  },
801
802
  nextCommands: [
802
803
  {
803
- command: `moda fix ${fixId}`,
804
+ command: `moda fix ${shellArg(fixId)}`,
804
805
  purpose: "Track delivery and confirmation status.",
805
806
  mutability: "read",
806
807
  requires_approval: false
@@ -832,7 +833,7 @@ async function runFixMarkApplied(context, profileOptions, tenantId) {
832
833
  },
833
834
  nextCommands: [
834
835
  {
835
- command: `moda fix ${fix.id}`,
836
+ command: `moda fix ${shellArg(fix.id)}`,
836
837
  purpose: "Track confirmation monitoring (HELD after 14 clean days; REGRESSED on reopen).",
837
838
  mutability: "read",
838
839
  requires_approval: false
@@ -967,15 +968,12 @@ async function assertRegateCooldown(tenantId, fixId, context, profileOptions, ca
967
968
  if (ageMs >= VERIFY_COOLDOWN_MS)
968
969
  return;
969
970
  const waitMin = Math.ceil((VERIFY_COOLDOWN_MS - ageMs) / 60000);
970
- const rerun = ["moda", "fix", "verify", fixId, ...Object.entries(context.flags).filter(([key]) => key !== "yes" && key !== "fix-id").map(([key, value]) => value === "true" ? `--${key}` : `--${key}=${shellQuote(value)}`), "--yes"].join(" ");
971
+ const rerun = ["moda", "fix", "verify", shellArg(fixId), ...Object.entries(context.flags).filter(([key]) => key !== "yes" && key !== "fix-id").map(([key, value]) => value === "true" ? `--${key}` : `--${key}=${shellArg(value)}`), "--yes"].join(" ");
971
972
  throw new CliInputError(`MODA-FIX-${current.shortRef} was gated ${Math.max(0, Math.floor(ageMs / 60000))} min ago (verdict ${gate.verdict}); re-gating within 10 minutes re-runs the replay. Nothing was sent.`, `Wait ~${waitMin} min, or re-run with --yes to gate now: ${rerun}`);
972
973
  }
973
974
  function sha256(content) {
974
975
  return createHash("sha256").update(content, "utf8").digest("hex");
975
976
  }
976
- function shellQuote(value) {
977
- return /^[A-Za-z0-9_@%+=:,./-]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`;
978
- }
979
977
  async function getFix(tenantId, fixId, profileOptions) {
980
978
  return await callControlAPI(`${fixesBase(tenantId)}/${encodeURIComponent(fixId)}`, { method: "GET" }, profileOptions);
981
979
  }
@@ -1053,7 +1051,7 @@ function materializePacketCandidates(packet, fixId, human) {
1053
1051
  const paramNotes = (Array.isArray(tool.param_notes) ? tool.param_notes : []).filter((note) => typeof note === "string" && note !== "");
1054
1052
  const rationale = typeof tool.rationale === "string" ? tool.rationale : "";
1055
1053
  const currentPath = writeCandidateFile("tool-description.current.md", typeof tool.current_description === "string" ? tool.current_description : "", "fix_tool_description_current", `Current description of tool '${toolName}'${source ? ` (from ${source})` : ""} — the diff base.`);
1056
- const proposedPath = writeCandidateFile("tool-description.proposed.md", tool.proposed_description ?? "", "fix_tool_description_proposed", `Proposed description for tool '${toolName}' — apply it to your tool definition, then \`moda fix mark-applied ${fixId}\`.`);
1054
+ const proposedPath = writeCandidateFile("tool-description.proposed.md", tool.proposed_description ?? "", "fix_tool_description_proposed", `Proposed description for tool '${toolName}' — apply it to your tool definition, then \`moda fix mark-applied ${shellArg(fixId)}\`.`);
1057
1055
  findings.push({
1058
1056
  id: "fix:candidate_tool",
1059
1057
  title: `tool '${toolName}' description candidate${source ? ` (current from ${source})` : ""}`,
@@ -1076,19 +1074,19 @@ function materializePacketCandidates(packet, fixId, human) {
1076
1074
  if (rationale)
1077
1075
  block("rationale", rationale);
1078
1076
  if (currentPath && proposedPath) {
1079
- w(` diff: diff ${currentPath} ${proposedPath}`);
1077
+ w(` diff: diff ${shellArg(currentPath)} ${shellArg(proposedPath)}`);
1080
1078
  }
1081
1079
  }
1082
1080
  }
1083
1081
  if (hasSkill && skill) {
1084
1082
  const skillName = typeof skill.skill_name === "string" && skill.skill_name ? skill.skill_name : "moda-fix-skill";
1085
- const skillPath = writeCandidateFile("SKILL.md", skill.skill_md ?? "", "fix_candidate_skill", `Drafted SKILL.md for '${skillName}' — install it (for example .claude/skills/${skillName}/SKILL.md), then \`moda fix mark-applied ${fixId}\`.`);
1083
+ const skillPath = writeCandidateFile("SKILL.md", skill.skill_md ?? "", "fix_candidate_skill", `Drafted SKILL.md for '${skillName}' — install it (for example .claude/skills/${skillName}/SKILL.md), then \`moda fix mark-applied ${shellArg(fixId)}\`.`);
1086
1084
  findings.push({
1087
1085
  id: "fix:candidate_skill",
1088
1086
  title: `skill '${skillName}' drafted (SKILL.md, ${(skill.skill_md ?? "").length} chars)`,
1089
1087
  status: "proposed",
1090
1088
  severity: "info",
1091
- description: `Install the skill in your agent, then confirm with \`moda fix mark-applied ${fixId}\`. Gating on the replay holdout stays pending until the skill is registered with the skill harness.`
1089
+ description: `Install the skill in your agent, then confirm with \`moda fix mark-applied ${shellArg(fixId)}\`. Gating on the replay holdout stays pending until the skill is registered with the skill harness.`
1092
1090
  });
1093
1091
  summaryParts.push(`Includes a drafted SKILL.md candidate ('${skillName}').`);
1094
1092
  if (human) {
@@ -1097,20 +1095,20 @@ function materializePacketCandidates(packet, fixId, human) {
1097
1095
  if (skillPath)
1098
1096
  w(` SKILL.md written to ${skillPath}`);
1099
1097
  w(` install it (for example .claude/skills/${skillName}/SKILL.md), then confirm:`);
1100
- w(` moda fix mark-applied ${fixId} --note="installed skill ${skillName}"`);
1098
+ w(` moda fix mark-applied ${shellArg(fixId)} --note=${shellArg(`installed skill ${skillName}`)}`);
1101
1099
  }
1102
1100
  }
1103
1101
  if (hasSkillEdit && skillEdit) {
1104
1102
  const skillKey = typeof skillEdit.skill_key === "string" && skillEdit.skill_key ? skillEdit.skill_key : typeof skillEdit.skill_name === "string" && skillEdit.skill_name ? skillEdit.skill_name : "moda-skill";
1105
1103
  const changeSummary = typeof skillEdit.change_summary === "string" ? skillEdit.change_summary : "";
1106
1104
  const currentPath = writeCandidateFile("SKILL.current.md", typeof skillEdit.current_skill_md === "string" ? skillEdit.current_skill_md : "", "fix_skill_edit_current", `Current SKILL.md of your synced skill '${skillKey}' — the diff base.`);
1107
- const proposedPath = writeCandidateFile("SKILL.proposed.md", skillEdit.proposed_skill_md ?? "", "fix_skill_edit_proposed", `Proposed SKILL.md for '${skillKey}' (minimal edit) — apply it to the existing skill in your repo, then \`moda fix mark-applied ${fixId}\`.`);
1105
+ const proposedPath = writeCandidateFile("SKILL.proposed.md", skillEdit.proposed_skill_md ?? "", "fix_skill_edit_proposed", `Proposed SKILL.md for '${skillKey}' (minimal edit) — apply it to the existing skill in your repo, then \`moda fix mark-applied ${shellArg(fixId)}\`.`);
1108
1106
  findings.push({
1109
1107
  id: "fix:candidate_skill_edit",
1110
1108
  title: `skill '${skillKey}' edit proposed${changeSummary ? `: ${changeSummary}` : " (minimal delta to the existing skill)"}`,
1111
1109
  status: "proposed",
1112
1110
  severity: "info",
1113
- description: `This amends the EXISTING synced skill '${skillKey}' — a minimal delta, not a new skill. Apply the proposed SKILL.md in your repo, then confirm with \`moda fix mark-applied ${fixId}\`.`
1111
+ description: `This amends the EXISTING synced skill '${skillKey}' — a minimal delta, not a new skill. Apply the proposed SKILL.md in your repo, then confirm with \`moda fix mark-applied ${shellArg(fixId)}\`.`
1114
1112
  });
1115
1113
  summaryParts.push(`Includes a skill-edit candidate amending existing skill '${skillKey}'.`);
1116
1114
  if (human) {
@@ -1123,13 +1121,13 @@ function materializePacketCandidates(packet, fixId, human) {
1123
1121
  if (proposedPath)
1124
1122
  w(` proposed SKILL.md written to ${proposedPath}`);
1125
1123
  if (currentPath && proposedPath)
1126
- w(` diff: diff ${currentPath} ${proposedPath}`);
1124
+ w(` diff: diff ${shellArg(currentPath)} ${shellArg(proposedPath)}`);
1127
1125
  w(` apply the edit to the existing skill in your repo, then confirm:`);
1128
- w(` moda fix mark-applied ${fixId} --note="amended skill ${skillKey}"`);
1126
+ w(` moda fix mark-applied ${shellArg(fixId)} --note=${shellArg(`amended skill ${skillKey}`)}`);
1129
1127
  }
1130
1128
  }
1131
1129
  nextCommands.push({
1132
- command: `moda fix mark-applied ${fixId} --note="where/how you applied it"`,
1130
+ command: `moda fix mark-applied ${shellArg(fixId)} --note="where/how you applied it"`,
1133
1131
  purpose: "Confirm you applied the candidate in your own stack (no PR) — flips the fix to SHIPPED and starts recurrence monitoring.",
1134
1132
  mutability: "write",
1135
1133
  requires_approval: true
@@ -1232,13 +1230,13 @@ function passLabel(value) {
1232
1230
  }
1233
1231
  function nextCommandsFor(fix) {
1234
1232
  const packetCommand = {
1235
- command: `moda fix ${fix.id} --packet`,
1233
+ command: `moda fix ${shellArg(fix.id)} --packet`,
1236
1234
  purpose: "Read the packet — the tool/skill candidate is written as local artifacts to apply in your own stack.",
1237
1235
  mutability: "write",
1238
1236
  requires_approval: false
1239
1237
  };
1240
1238
  const markAppliedCommand = {
1241
- command: `moda fix mark-applied ${fix.id} --note="where/how you applied it"`,
1239
+ command: `moda fix mark-applied ${shellArg(fix.id)} --note="where/how you applied it"`,
1242
1240
  purpose: "Confirm you applied the candidate in your own stack (no PR) — flips the fix to SHIPPED and starts recurrence monitoring.",
1243
1241
  mutability: "write",
1244
1242
  requires_approval: true
@@ -1251,13 +1249,13 @@ function nextCommandsFor(fix) {
1251
1249
  }
1252
1250
  return [
1253
1251
  {
1254
- command: `moda fix submit ${fix.id} --pr`,
1252
+ command: `moda fix submit ${shellArg(fix.id)} --pr`,
1255
1253
  purpose: "Open the draft fix PR (merge with the magic word to confirm).",
1256
1254
  mutability: "write",
1257
1255
  requires_approval: true
1258
1256
  },
1259
1257
  {
1260
- command: `moda fix checkout ${fix.id}`,
1258
+ command: `moda fix checkout ${shellArg(fix.id)}`,
1261
1259
  purpose: "Write the verified candidate locally instead of opening a PR.",
1262
1260
  mutability: "write",
1263
1261
  requires_approval: false
@@ -1269,7 +1267,7 @@ function nextCommandsFor(fix) {
1269
1267
  }
1270
1268
  return [
1271
1269
  {
1272
- command: `moda fix verify ${fix.id}`,
1270
+ command: `moda fix verify ${shellArg(fix.id)}`,
1273
1271
  purpose: "Gate the proposed candidate on the frozen holdout.",
1274
1272
  mutability: "write",
1275
1273
  requires_approval: false
@@ -1279,7 +1277,7 @@ function nextCommandsFor(fix) {
1279
1277
  if (isArtifactFix(fix)) {
1280
1278
  return [
1281
1279
  {
1282
- command: `moda fix verify ${fix.id}`,
1280
+ command: `moda fix verify ${shellArg(fix.id)}`,
1283
1281
  purpose: "Re-gate the stored candidate on the frozen holdout.",
1284
1282
  mutability: "write",
1285
1283
  requires_approval: false
@@ -1289,13 +1287,13 @@ function nextCommandsFor(fix) {
1289
1287
  }
1290
1288
  return [
1291
1289
  {
1292
- command: `moda fix checkout ${fix.id}`,
1290
+ command: `moda fix checkout ${shellArg(fix.id)}`,
1293
1291
  purpose: "Check out the candidate, edit it, and re-gate (fail-to-pass loop).",
1294
1292
  mutability: "write",
1295
1293
  requires_approval: false
1296
1294
  },
1297
1295
  {
1298
- command: `moda fix verify ${fix.id} --prompt-file=<path>`,
1296
+ command: `moda fix verify ${shellArg(fix.id)} --prompt-file=<path>`,
1299
1297
  purpose: "Re-gate an edited local candidate on the frozen holdout.",
1300
1298
  mutability: "write",
1301
1299
  requires_approval: false
@@ -1304,7 +1302,7 @@ function nextCommandsFor(fix) {
1304
1302
  case "GATE_INCONCLUSIVE":
1305
1303
  return [
1306
1304
  {
1307
- command: `moda fix verify ${fix.id}`,
1305
+ command: `moda fix verify ${shellArg(fix.id)}`,
1308
1306
  purpose: "Re-run the gate — the last run was inconclusive (never a pass).",
1309
1307
  mutability: "write",
1310
1308
  requires_approval: false
@@ -1313,7 +1311,7 @@ function nextCommandsFor(fix) {
1313
1311
  case "UNROUTED":
1314
1312
  return [
1315
1313
  {
1316
- command: `moda fix ${fix.id} --packet`,
1314
+ command: `moda fix ${shellArg(fix.id)} --packet`,
1317
1315
  purpose: "Read the investigation packet — this fix is deliverable as diagnosis.",
1318
1316
  mutability: "read",
1319
1317
  requires_approval: false
@@ -1330,7 +1328,7 @@ function nextCommandsFor(fix) {
1330
1328
  case "NO_HEADROOM":
1331
1329
  return [
1332
1330
  {
1333
- command: `moda fix ${fix.id} --packet`,
1331
+ command: `moda fix ${shellArg(fix.id)} --packet`,
1334
1332
  purpose: "Read the investigation packet — this fix is deliverable as diagnosis.",
1335
1333
  mutability: "read",
1336
1334
  requires_approval: false
@@ -1342,7 +1340,7 @@ function nextCommandsFor(fix) {
1342
1340
  case "GATING":
1343
1341
  return [
1344
1342
  {
1345
- command: `moda fix ${fix.id} --wait`,
1343
+ command: `moda fix ${shellArg(fix.id)} --wait`,
1346
1344
  purpose: "Drive the advance-on-poll pipeline to its next resting status.",
1347
1345
  mutability: "write",
1348
1346
  requires_approval: false
@@ -1351,7 +1349,7 @@ function nextCommandsFor(fix) {
1351
1349
  default:
1352
1350
  return [
1353
1351
  {
1354
- command: `moda fix ${fix.id}`,
1352
+ command: `moda fix ${shellArg(fix.id)}`,
1355
1353
  purpose: "Track the fix status.",
1356
1354
  mutability: "read",
1357
1355
  requires_approval: false
@@ -42,12 +42,12 @@ import {
42
42
  writeHarnessAnalyzeResult,
43
43
  writeHarnessArtifacts,
44
44
  writeHumanProgress
45
- } from "./cli-d577kq6h.js";
45
+ } from "./cli-qwgct6x7.js";
46
46
  import"./cli-97fnztpy.js";
47
- import"./cli-cdrvjva5.js";
48
- import"./cli-jgfm7w1r.js";
49
- import"./cli-jtyvbd8d.js";
50
- import"./cli-sqsjd08w.js";
47
+ import"./cli-v8q7sd7g.js";
48
+ import"./cli-wzds257x.js";
49
+ import"./cli-pg5qfmqc.js";
50
+ import"./cli-r5pp7qny.js";
51
51
  import"./cli-0v6na3yp.js";
52
52
  export {
53
53
  writeHumanProgress,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  buildSourceSnapshot
3
- } from "./cli-d577kq6h.js";
3
+ } from "./cli-qwgct6x7.js";
4
4
  import"./cli-97fnztpy.js";
5
- import"./cli-cdrvjva5.js";
6
- import"./cli-jgfm7w1r.js";
7
- import"./cli-jtyvbd8d.js";
5
+ import"./cli-v8q7sd7g.js";
6
+ import"./cli-wzds257x.js";
7
+ import"./cli-pg5qfmqc.js";
8
8
  import {
9
9
  recordApiRequest
10
- } from "./cli-sqsjd08w.js";
10
+ } from "./cli-r5pp7qny.js";
11
11
  import"./cli-0v6na3yp.js";
12
12
 
13
13
  // src/harness-github-actions.ts
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  selectTenantAndCreateKey
3
- } from "./cli-k6q8dbpk.js";
4
- import"./cli-1mbb0ct0.js";
3
+ } from "./cli-0pkc8jhg.js";
4
+ import"./cli-ccjfwzqx.js";
5
5
  import {
6
6
  buildDoctorReport
7
- } from "./cli-5g1tv80h.js";
7
+ } from "./cli-4h0ave0f.js";
8
8
  import {
9
9
  ConnectCodeError,
10
10
  connectWithCode,
11
11
  loadAuthSession,
12
12
  loadToken,
13
13
  login
14
- } from "./cli-q6f6vrrr.js";
14
+ } from "./cli-hmjdgxrn.js";
15
15
  import {
16
16
  initPrompts,
17
17
  runPromptSync
18
- } from "./cli-b4740tnv.js";
18
+ } from "./cli-q9nsvqqg.js";
19
19
  import"./cli-mm48br00.js";
20
20
  import {
21
21
  canonicalText,
@@ -35,7 +35,7 @@ import {
35
35
  runCodingAgent,
36
36
  runHarnessCommand,
37
37
  startRemoteAnalyze
38
- } from "./cli-d577kq6h.js";
38
+ } from "./cli-qwgct6x7.js";
39
39
  import {
40
40
  stripAnsi
41
41
  } from "./cli-97fnztpy.js";
@@ -47,20 +47,21 @@ import {
47
47
  import {
48
48
  agentsMdProblem,
49
49
  runSkillSync
50
- } from "./cli-8tfk8qeb.js";
50
+ } from "./cli-6et4z504.js";
51
51
  import {
52
52
  createCommandContext
53
- } from "./cli-cdrvjva5.js";
54
- import"./cli-jgfm7w1r.js";
55
- import"./cli-jtyvbd8d.js";
53
+ } from "./cli-v8q7sd7g.js";
54
+ import"./cli-wzds257x.js";
55
+ import"./cli-pg5qfmqc.js";
56
56
  import {
57
57
  CliAuthError,
58
58
  CliInputError,
59
59
  VERSION,
60
60
  recordApiRequest,
61
61
  resolveIngestUrl,
62
- resolveModaBaseUrl
63
- } from "./cli-sqsjd08w.js";
62
+ resolveModaBaseUrl,
63
+ shellArg
64
+ } from "./cli-r5pp7qny.js";
64
65
  import {
65
66
  detectAgents,
66
67
  installRules,
@@ -2359,7 +2360,7 @@ function applySdkIntegrationOutcome(setupPlan, outcome, deps) {
2359
2360
  break;
2360
2361
  }
2361
2362
  case "telemetry_not_observed":
2362
- laneBoard?.warn("sdk", `integration applied but the verification trace was not observed; check MODA_API_KEY at runtime, then moda traces spans ${verificationId}`);
2363
+ laneBoard?.warn("sdk", `integration applied but the verification trace was not observed; check MODA_API_KEY at runtime, then moda traces spans ${shellArg(verificationId)}`);
2363
2364
  markManual(setupPlan, "sdk", outcome.detail ?? "Verification trace was not observed.");
2364
2365
  break;
2365
2366
  case "needs_human_input": {
@@ -2376,7 +2377,7 @@ function applySdkIntegrationOutcome(setupPlan, outcome, deps) {
2376
2377
  sdkAction.reason = outcome.detail ?? "Existing Moda integration verified.";
2377
2378
  break;
2378
2379
  }
2379
- const reason = outcome.verification ? "agent reports Moda is already integrated but the verification trace was not observed; " + `check MODA_API_KEY at runtime, then \`moda traces spans ${verificationId}\`` : "agent reports Moda is already integrated — not independently verified; " + "send a real request through your app with a trace ID (`conversation_id`) you choose, then run `moda traces spans` with that id";
2380
+ const reason = outcome.verification ? "agent reports Moda is already integrated but the verification trace was not observed; " + `check MODA_API_KEY at runtime, then \`moda traces spans ${shellArg(verificationId)}\`` : "agent reports Moda is already integrated — not independently verified; " + "send a real request through your app with a trace ID (`conversation_id`) you choose, then run `moda traces spans` with that id";
2380
2381
  laneBoard?.warn("sdk", reason);
2381
2382
  markManual(setupPlan, "sdk", reason);
2382
2383
  break;
@@ -1,6 +1,12 @@
1
1
  import {
2
- INTELLIGENCE_SCHEMA_VERSION
3
- } from "./cli-bb7133m7.js";
2
+ INTELLIGENCE_SCHEMA_VERSION,
3
+ asNumber,
4
+ asRecord,
5
+ asString,
6
+ contextTarget,
7
+ frustrationAnchorIndex,
8
+ frustrationsFromEmotions
9
+ } from "./cli-vdkwkkp5.js";
4
10
  import {
5
11
  renderMarkdownForTerminal,
6
12
  shouldColorTerminalOutput,
@@ -10,7 +16,7 @@ import {
10
16
  import {
11
17
  callControlAPI,
12
18
  callDataAPI
13
- } from "./cli-jtyvbd8d.js";
19
+ } from "./cli-pg5qfmqc.js";
14
20
  import {
15
21
  CliAuthError,
16
22
  CliInputError,
@@ -18,18 +24,12 @@ import {
18
24
  EXIT_OK,
19
25
  apiErrorStatus,
20
26
  apiKeyHeaders,
21
- asNumber,
22
- asRecord,
23
- asString,
24
- contextTarget,
25
- frustrationAnchorIndex,
26
- frustrationsFromEmotions,
27
27
  recordApiRequest,
28
28
  resolveApiKey,
29
29
  resolveModaBaseUrl,
30
30
  safeWriteStderr,
31
- shellWord
32
- } from "./cli-sqsjd08w.js";
31
+ shellArg
32
+ } from "./cli-r5pp7qny.js";
33
33
  import"./cli-0v6na3yp.js";
34
34
 
35
35
  // src/production-intelligence.ts
@@ -538,7 +538,7 @@ async function investigateProduction(options) {
538
538
  warnings.push(`No failures found for tool "${options.toolName}" in the last ${options.daysBack} day(s) — the tool may have no failures in this window, or the name may not exist in this tenant. ` + "Run `moda detections tools` to list tools with recorded failures, or widen --days-back.");
539
539
  }
540
540
  if (options.conversationId) {
541
- warnings.push(`Scoped to trace ${options.conversationId} for frustration evidence only; overview and tool failures are tenant-wide. ` + `Open the trace itself with \`moda traces spans ${options.conversationId}\`.`);
541
+ warnings.push(`Scoped to trace ${options.conversationId} for frustration evidence only; overview and tool failures are tenant-wide. ` + `Open the trace itself with \`moda traces spans ${shellArg(options.conversationId)}\`.`);
542
542
  }
543
543
  const evidenceRefs = [];
544
544
  const findings = [];
@@ -872,7 +872,7 @@ function toolFailureFindings(data, daysBack, hints, evidenceRefs, scopedTool) {
872
872
  id: `action_tool_detail_${slug(name)}`,
873
873
  title: `Inspect ${name} failure examples.`,
874
874
  rationale: "Examples include trace anchors and error subtypes.",
875
- command: `moda detections tools ${name} --days-back=${daysBack} --include-window`,
875
+ command: `moda detections tools ${shellArg(name)} --days-back=${daysBack} --include-window`,
876
876
  mutability: "read",
877
877
  requiresApproval: false
878
878
  }]
@@ -918,7 +918,7 @@ function frustrationFindings(data, daysBack, evidenceRefs) {
918
918
  id: "action_frustration_window",
919
919
  title: "Read the frustration window.",
920
920
  rationale: "The user quote and nearby turns reveal what confused or blocked the user.",
921
- command: conversationId ? `moda traces get ${shellWord(contextTarget(conversationId))}${anchorIndex !== null ? ` --msg-index=${anchorIndex}` : ""} --window=3` : `moda detections list --family=frustration --days-back=${daysBack} --include-window`,
921
+ command: conversationId ? `moda traces get ${shellArg(contextTarget(conversationId))}${anchorIndex !== null ? ` --msg-index=${anchorIndex}` : ""} --window=3` : `moda detections list --family=frustration --days-back=${daysBack} --include-window`,
922
922
  mutability: "read",
923
923
  requiresApproval: false
924
924
  }]
@@ -994,7 +994,7 @@ function problemFindings(data, daysBack, evidenceRefs) {
994
994
  id: `action_problem_${slug(problem.id)}`,
995
995
  title: `Open the Problem dossier for ${problem.name}.`,
996
996
  rationale: "The dossier has the cause, evidence, affected traces and verification state.",
997
- command: `moda problems get ${problem.id}`,
997
+ command: `moda problems get ${shellArg(problem.id)}`,
998
998
  mutability: "read",
999
999
  requiresApproval: false
1000
1000
  }]
@@ -2,7 +2,7 @@ import {
2
2
  probeApiKey,
3
3
  redactApiKey,
4
4
  resolveApiKeyCredential
5
- } from "./cli-1mbb0ct0.js";
5
+ } from "./cli-ccjfwzqx.js";
6
6
  import {
7
7
  authFetch,
8
8
  clearAuthSession,
@@ -10,7 +10,7 @@ import {
10
10
  loadAuthSession,
11
11
  login,
12
12
  revokeCliSessionToken
13
- } from "./cli-q6f6vrrr.js";
13
+ } from "./cli-hmjdgxrn.js";
14
14
  import {
15
15
  CliInputError,
16
16
  DEFAULT_INGEST_URL,
@@ -34,8 +34,9 @@ import {
34
34
  saveCliConfig,
35
35
  secretFilePathFromRef,
36
36
  setActiveProfile,
37
+ shellArg,
37
38
  upsertProfile
38
- } from "./cli-sqsjd08w.js";
39
+ } from "./cli-r5pp7qny.js";
39
40
  import"./cli-0v6na3yp.js";
40
41
 
41
42
  // src/profile-commands.ts
@@ -326,7 +327,7 @@ async function runProfilesCommand(context) {
326
327
  default_profile: config.active_profile,
327
328
  profiles: Object.values(config.profiles).map((profile) => serializeProfile(profile, effective)),
328
329
  migrations: config.migrations
329
- }, missing ? { warnings: [`The active profile '${effective}' (from ${source}) does not exist. Create it with \`moda profiles create ${effective}\` or select an existing profile.`] } : undefined);
330
+ }, missing ? { warnings: [`The active profile '${effective}' (from ${source}) does not exist. Create it with \`moda profiles create ${shellArg(effective)}\` or select an existing profile.`] } : undefined);
330
331
  return { exitCode: 0 };
331
332
  }
332
333
  case "use": {
@@ -5,12 +5,12 @@ import {
5
5
  inspectCodeSelectors,
6
6
  inspectPythonSelectors,
7
7
  safePromptEvidencePath
8
- } from "./cli-d577kq6h.js";
8
+ } from "./cli-qwgct6x7.js";
9
9
  import"./cli-97fnztpy.js";
10
- import"./cli-cdrvjva5.js";
11
- import"./cli-jgfm7w1r.js";
12
- import"./cli-jtyvbd8d.js";
13
- import"./cli-sqsjd08w.js";
10
+ import"./cli-v8q7sd7g.js";
11
+ import"./cli-wzds257x.js";
12
+ import"./cli-pg5qfmqc.js";
13
+ import"./cli-r5pp7qny.js";
14
14
  import {
15
15
  __commonJS,
16
16
  __toESM
@@ -11,16 +11,16 @@ import {
11
11
  runPromptSync,
12
12
  runPromptsCommand,
13
13
  writePromptSyncProgress
14
- } from "./cli-b4740tnv.js";
14
+ } from "./cli-q9nsvqqg.js";
15
15
  import {
16
16
  promptSourceHashPayload
17
17
  } from "./cli-mm48br00.js";
18
- import"./cli-d577kq6h.js";
18
+ import"./cli-qwgct6x7.js";
19
19
  import"./cli-97fnztpy.js";
20
- import"./cli-cdrvjva5.js";
21
- import"./cli-jgfm7w1r.js";
22
- import"./cli-jtyvbd8d.js";
23
- import"./cli-sqsjd08w.js";
20
+ import"./cli-v8q7sd7g.js";
21
+ import"./cli-wzds257x.js";
22
+ import"./cli-pg5qfmqc.js";
23
+ import"./cli-r5pp7qny.js";
24
24
  import"./cli-0v6na3yp.js";
25
25
  export {
26
26
  writePromptSyncProgress,