frizz-server 0.15.53 → 0.15.54

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 (96) hide show
  1. package/dist/claude-agent-broker.js +169 -32
  2. package/dist/dev-child.js +507 -113
  3. package/package.json +1 -1
  4. package/runtime/cc-worker/lib/frizz-tools.mjs +138 -26
  5. package/web-dist/assets/{abnfDiagram-VCTEODGH-C5-n-yX3.js → abnfDiagram-VCTEODGH-60tR6m6W.js} +1 -1
  6. package/web-dist/assets/architecture-7GRP2DOG-Sz6NSKcw.js +1 -0
  7. package/web-dist/assets/{architectureDiagram-5GKGNRK7-v9eLyom7.js → architectureDiagram-5GKGNRK7-BkVtlnlf.js} +1 -1
  8. package/web-dist/assets/{blockDiagram-I7D4REHJ-De0HKZV7.js → blockDiagram-I7D4REHJ-DlYmcXj7.js} +1 -1
  9. package/web-dist/assets/{c4Diagram-7LVT6UL2-DQFZ6NeQ.js → c4Diagram-7LVT6UL2-BVkk1o2q.js} +1 -1
  10. package/web-dist/assets/channel-CHoDmp0D.js +1 -0
  11. package/web-dist/assets/{chunk-2E4U76K2-Cec1rhm9.js → chunk-2E4U76K2-CQayNXdN.js} +1 -1
  12. package/web-dist/assets/{chunk-4HAMMTFA-DYmlzCrb.js → chunk-4HAMMTFA-BQfSiIk8.js} +1 -1
  13. package/web-dist/assets/{chunk-75Z2AOVW-D4PgvSWX.js → chunk-75Z2AOVW-CVYDSc2i.js} +1 -1
  14. package/web-dist/assets/{chunk-CLGD4ZFX-BCRaJRgH.js → chunk-CLGD4ZFX-kiC8BECf.js} +1 -1
  15. package/web-dist/assets/{chunk-DU6HZSFF-CXuOpgv7.js → chunk-DU6HZSFF-Dh3eMNB1.js} +1 -1
  16. package/web-dist/assets/{chunk-F27PBJKO-Cij7-KWq.js → chunk-F27PBJKO-Cgk_e8Qp.js} +1 -1
  17. package/web-dist/assets/{chunk-GMAD6QVW-Vfi9Qodg.js → chunk-GMAD6QVW-CfPQYPSy.js} +1 -1
  18. package/web-dist/assets/{chunk-GVQU2GXP-eAwOwPRP.js → chunk-GVQU2GXP--AyZ3Hdp.js} +1 -1
  19. package/web-dist/assets/{chunk-IMKFNOWR-jBkoemYF.js → chunk-IMKFNOWR-BvmF4pSb.js} +1 -1
  20. package/web-dist/assets/{chunk-L3NEJ4N5-Xttgzyc5.js → chunk-L3NEJ4N5-0CEQDQlt.js} +1 -1
  21. package/web-dist/assets/{chunk-OSK3NFVY-DR9jXn3P.js → chunk-OSK3NFVY-BGQx5cpJ.js} +1 -1
  22. package/web-dist/assets/{chunk-P2QGCYS3-Cpc3emFn.js → chunk-P2QGCYS3-DjK4Ukle.js} +1 -1
  23. package/web-dist/assets/{chunk-POPQ4Y6H-CuScFkWc.js → chunk-POPQ4Y6H-CnKzeNvL.js} +1 -1
  24. package/web-dist/assets/{chunk-PWAF6VOD-CIdwTlgR.js → chunk-PWAF6VOD-jccWzZMG.js} +1 -1
  25. package/web-dist/assets/{chunk-SHT3W25Y-Yb5paoPg.js → chunk-SHT3W25Y-RB6wBqMi.js} +1 -1
  26. package/web-dist/assets/{chunk-SVP7TREG-x8diHpMs.js → chunk-SVP7TREG-fbiX-oy5.js} +1 -1
  27. package/web-dist/assets/{chunk-TICWLB2K-DHsuW_jr.js → chunk-TICWLB2K-C7_LnR8U.js} +1 -1
  28. package/web-dist/assets/{chunk-TLUHSLCS-BwiXM_E2.js → chunk-TLUHSLCS-joZSA-Su.js} +2 -2
  29. package/web-dist/assets/classDiagram-ZZMXUADV-BwC8qzol.js +1 -0
  30. package/web-dist/assets/classDiagram-v2-VYDZK3BY-BwC8qzol.js +1 -0
  31. package/web-dist/assets/{cynefin-OW5HDTMX-Cs2PLbXO.js → cynefin-OW5HDTMX-DbrlwUVr.js} +1 -1
  32. package/web-dist/assets/{cynefinDiagram-5FMLGOSQ-DThGVJ4q.js → cynefinDiagram-5FMLGOSQ-B2CvZXjU.js} +1 -1
  33. package/web-dist/assets/{dagre-GXQ25YYZ-D4QLKHYZ.js → dagre-GXQ25YYZ-CYJutr3h.js} +1 -1
  34. package/web-dist/assets/{diagram-S7CK7UJ4-C-oieh0l.js → diagram-S7CK7UJ4-ClJgtc_A.js} +1 -1
  35. package/web-dist/assets/{diagram-UQ7AKVKN-BRTaSxi8.js → diagram-UQ7AKVKN-Dzzc2AV8.js} +1 -1
  36. package/web-dist/assets/{diagram-VSXAHHWV-B01NfoBK.js → diagram-VSXAHHWV-BQjCeD1w.js} +1 -1
  37. package/web-dist/assets/{diagram-VX7I27RA-CIi0wWLy.js → diagram-VX7I27RA-DBSk4ezX.js} +1 -1
  38. package/web-dist/assets/{diagram-Z3DM3KII-Bj0bns7N.js → diagram-Z3DM3KII-BzJWxRO-.js} +1 -1
  39. package/web-dist/assets/{ebnfDiagram-PWID7BFC-DJWjvFhA.js → ebnfDiagram-PWID7BFC-Ilj46-1V.js} +1 -1
  40. package/web-dist/assets/{erDiagram-RLTQ6QDP-OArCjKyL.js → erDiagram-RLTQ6QDP-Bz16i8Le.js} +1 -1
  41. package/web-dist/assets/eventmodeling-NTZA5JFV-DYqgZFXg.js +1 -0
  42. package/web-dist/assets/flowDiagram-HODETNUW-DPm1z06j.js +1 -0
  43. package/web-dist/assets/{ganttDiagram-EL5Y4UJY-Sh-yF7Pk.js → ganttDiagram-EL5Y4UJY-B45cswyo.js} +1 -1
  44. package/web-dist/assets/{gitGraph-4MIJSDKK-diOiZ9jR.js → gitGraph-4MIJSDKK-CSyOk207.js} +1 -1
  45. package/web-dist/assets/{gitGraphDiagram-WWUBYQGX-CUUUaPk1.js → gitGraphDiagram-WWUBYQGX-DTfJYE88.js} +1 -1
  46. package/web-dist/assets/{index-C7R3M7gN.js → index-B7C7zwGI.js} +47 -47
  47. package/web-dist/assets/index-BNn8gDgZ.css +2 -0
  48. package/web-dist/assets/{info-A6RAGUB7-RybBrr2w.js → info-A6RAGUB7-BxgC--z3.js} +1 -1
  49. package/web-dist/assets/{infoDiagram-27XIBGKW-Cph6Zwcq.js → infoDiagram-27XIBGKW-BhJxPw0d.js} +1 -1
  50. package/web-dist/assets/{ishikawaDiagram-5VMMS53U-BANgLDpg.js → ishikawaDiagram-5VMMS53U-B4uOoNl6.js} +1 -1
  51. package/web-dist/assets/{journeyDiagram-3NMN7TZE-DI-v8VTL.js → journeyDiagram-3NMN7TZE-E1cpX8Zh.js} +1 -1
  52. package/web-dist/assets/{kanban-definition-UXKFOSKX-Bzf950KK.js → kanban-definition-UXKFOSKX-CLCqGZaO.js} +1 -1
  53. package/web-dist/assets/{line--92Un6e-.js → line-D4YOxj2A.js} +1 -1
  54. package/web-dist/assets/{mermaid-parser.core-tLBuwbpU.js → mermaid-parser.core-CI_hCipX.js} +3 -3
  55. package/web-dist/assets/{mermaid.core-eLZc0PEp.js → mermaid.core-TBRjJPdU.js} +3 -3
  56. package/web-dist/assets/{mindmap-definition-YA3MSWOX-4_2Ouyga.js → mindmap-definition-YA3MSWOX-C8dMFTze.js} +1 -1
  57. package/web-dist/assets/{packet-AYTQ26CC-DpTDZ1kf.js → packet-AYTQ26CC-wiotbGtO.js} +1 -1
  58. package/web-dist/assets/{pegDiagram-XKGWAZYB-CHCMV4dR.js → pegDiagram-XKGWAZYB-C3hPCxJN.js} +1 -1
  59. package/web-dist/assets/{pie-WAS4IAKB-DCAUr7Sl.js → pie-WAS4IAKB-mMmNlgxH.js} +1 -1
  60. package/web-dist/assets/{pieDiagram-E7YTZNPT-ClmhRIOi.js → pieDiagram-E7YTZNPT-_BZAqwG7.js} +1 -1
  61. package/web-dist/assets/{quadrantDiagram-AXDQQJYC-C5-AhbaK.js → quadrantDiagram-AXDQQJYC-D4D56jhg.js} +1 -1
  62. package/web-dist/assets/{radar-RG4KPBEZ-BcqJ67Ci.js → radar-RG4KPBEZ-lBxKtBg1.js} +1 -1
  63. package/web-dist/assets/{railroad-74A4TZTK-BfVmIesg.js → railroad-74A4TZTK-CsSd3VR4.js} +1 -1
  64. package/web-dist/assets/railroad-abnf-HS5TGJTU-Dm55RVIf.js +1 -0
  65. package/web-dist/assets/railroad-ebnf-LZEXJU2U-BWb5OekZ.js +1 -0
  66. package/web-dist/assets/railroad-peg-WCYAUIDC-ZMHpjeRF.js +1 -0
  67. package/web-dist/assets/{railroadDiagram-O6MQD6OU-BV06urHq.js → railroadDiagram-O6MQD6OU-Th6g174U.js} +1 -1
  68. package/web-dist/assets/{requirementDiagram-BXWQKSXE-B0kxzubq.js → requirementDiagram-BXWQKSXE-D7pxtmmL.js} +1 -1
  69. package/web-dist/assets/{sankeyDiagram-P5KCCOFB-DjBlKiUQ.js → sankeyDiagram-P5KCCOFB-p5SoQoVY.js} +1 -1
  70. package/web-dist/assets/{sequenceDiagram-WJ2MYXX4-BHxYt7aE.js → sequenceDiagram-WJ2MYXX4-oNRTLIdc.js} +1 -1
  71. package/web-dist/assets/{stateDiagram-D77RDMKH-DUMg8VxQ.js → stateDiagram-D77RDMKH-DI9DxX4Y.js} +1 -1
  72. package/web-dist/assets/stateDiagram-v2-MP3YSRHH-BqIm-gME.js +1 -0
  73. package/web-dist/assets/{swimlanes-42K2YHIH-yb-iMsnc.js → swimlanes-42K2YHIH-DEQbdCsz.js} +1 -1
  74. package/web-dist/assets/swimlanesDiagram-VR7AAH4N-BrTbasxm.js +8 -0
  75. package/web-dist/assets/threadSurfaces-Bmm69aB4.js +145 -0
  76. package/web-dist/assets/{timeline-definition-24CTP7MA-DNW8iOn2.js → timeline-definition-24CTP7MA-CkfRsc_R.js} +1 -1
  77. package/web-dist/assets/{treeView-Q6P3EWNA-CuVRJqXc.js → treeView-Q6P3EWNA-DqoctESh.js} +1 -1
  78. package/web-dist/assets/{treemap-WGGIJYW6-CqAS1nJa.js → treemap-WGGIJYW6-mTc2J0pl.js} +1 -1
  79. package/web-dist/assets/{vennDiagram-4TSXK5OY-CayuoPm-.js → vennDiagram-4TSXK5OY-BmfPoTOH.js} +1 -1
  80. package/web-dist/assets/{wardley-WFR3VGLG-DLBjtOPH.js → wardley-WFR3VGLG-BBPuwAzz.js} +1 -1
  81. package/web-dist/assets/{wardleyDiagram-VM6X3IG4-VjTKjARS.js → wardleyDiagram-VM6X3IG4-xFLi_TZH.js} +1 -1
  82. package/web-dist/assets/{xychartDiagram-S5SC5T6Z-VztC2hoJ.js → xychartDiagram-S5SC5T6Z-BK53kLG3.js} +1 -1
  83. package/web-dist/index.html +2 -2
  84. package/web-dist/assets/architecture-7GRP2DOG-BXfsnnri.js +0 -1
  85. package/web-dist/assets/channel-CbqV-FJf.js +0 -1
  86. package/web-dist/assets/classDiagram-ZZMXUADV-ChpFNZ6-.js +0 -1
  87. package/web-dist/assets/classDiagram-v2-VYDZK3BY-ChpFNZ6-.js +0 -1
  88. package/web-dist/assets/eventmodeling-NTZA5JFV-DnLS-G1o.js +0 -1
  89. package/web-dist/assets/flowDiagram-HODETNUW-DxBcq7hK.js +0 -1
  90. package/web-dist/assets/index-C2agpmfX.css +0 -2
  91. package/web-dist/assets/railroad-abnf-HS5TGJTU-DmdHOz1X.js +0 -1
  92. package/web-dist/assets/railroad-ebnf-LZEXJU2U-pF0K7xke.js +0 -1
  93. package/web-dist/assets/railroad-peg-WCYAUIDC-D-df90Rl.js +0 -1
  94. package/web-dist/assets/stateDiagram-v2-MP3YSRHH-W4P30iTw.js +0 -1
  95. package/web-dist/assets/swimlanesDiagram-VR7AAH4N-CY1l7luM.js +0 -8
  96. package/web-dist/assets/threadSurfaces-i506BiUf.js +0 -143
package/dist/dev-child.js CHANGED
@@ -727,8 +727,8 @@ function ensureProjectIdFile(root, home = homedir3(), seed) {
727
727
  release();
728
728
  }
729
729
  }
730
- function hasAny(dir, names) {
731
- return names.some((name) => existsSync2(join4(dir, name)));
730
+ function hasAny(dir, names2) {
731
+ return names2.some((name) => existsSync2(join4(dir, name)));
732
732
  }
733
733
  function isHomeDirectory(dir, home = homedir3()) {
734
734
  const canonical2 = (value) => {
@@ -14434,6 +14434,12 @@ function prWatchWakeMessage(input) {
14434
14434
  if (lines.length) lines.push("");
14435
14435
  lines.push(input.review);
14436
14436
  }
14437
+ const running = input.checks?.verdict === "failing" ? input.checks.running : void 0;
14438
+ if (running !== void 0) {
14439
+ const held = input.checks?.gated ?? 0;
14440
+ const gating = input.checks?.gating?.length ? `: ${input.checks.gating.join(", ")}` : "";
14441
+ lines.push("", running > 0 ? `${running} check${running === 1 ? "" : "s"} still running; this watcher reports again once they have all finished.` : held > 0 ? `Nothing else is running, but ${held} workflow${held === 1 ? " is" : "s are"} held for a maintainer's approval and ${held === 1 ? "has" : "have"} not run${gating}.` : "Every check has finished.");
14442
+ }
14437
14443
  lines.push("", PR_WATCH_ARMED_TRAILER);
14438
14444
  return lines.join("\n");
14439
14445
  }
@@ -14628,7 +14634,7 @@ function isParkCorrection(text2) {
14628
14634
  return t.startsWith(PARK_CORRECTION_NAMES_LEAD) || t.startsWith(PARK_CORRECTION_RETIRED_LEAD) || t.startsWith(PARK_CORRECTION_QUESTION_LEAD) || t.startsWith(PARK_CORRECTION_NEEDS_INPUT_LEAD) || t.startsWith(QUESTION_FENCE_CORRECTION_LEAD) || t.startsWith(DONE_FENCE_CORRECTION_LEAD) || t.startsWith(SIGNOFF_CORRECTION_LEAD);
14629
14635
  }
14630
14636
  function signOffCorrection(faults) {
14631
- const ids = (names) => names.map((n) => `\`${n}\``).join(", ");
14637
+ const ids = (names2) => names2.map((n) => `\`${n}\``).join(", ");
14632
14638
  const parts = [];
14633
14639
  if (faults.missing.length > 0) {
14634
14640
  const one2 = faults.missing.length === 1;
@@ -14980,10 +14986,10 @@ function wordsUnderAnswers(text2) {
14980
14986
  function questionsCancelledWakeMessage(count, cancelled = []) {
14981
14987
  const lead = `${count} question${count === 1 ? "" : "s"} you registered ${count === 1 ? "was" : "were"} CANCELLED without an answer. Decide ${count === 1 ? "it" : "them"} yourself and carry on \u2014 say which way you went in your write-up. Do not re-ask.`;
14982
14988
  if (cancelled.length === 0) return lead;
14983
- const names = cancelled.map((q2) => `- ${q2.handle ? `\`${q2.handle}\` \u2014 ` : ""}\u201C${q2.question.replace(/\s+/g, " ").trim()}\u201D`);
14989
+ const names2 = cancelled.map((q2) => `- ${q2.handle ? `\`${q2.handle}\` \u2014 ` : ""}\u201C${q2.question.replace(/\s+/g, " ").trim()}\u201D`);
14984
14990
  return `${lead}
14985
14991
 
14986
- ${names.join("\n")}`;
14992
+ ${names2.join("\n")}`;
14987
14993
  }
14988
14994
  function queuedThread(t) {
14989
14995
  return t.kind === "session" && t.foreign !== true && t.needsYou === true && t.state !== "archived";
@@ -15388,7 +15394,7 @@ function parseGithubWakeSteer(text2) {
15388
15394
  function frizzRoute(path3) {
15389
15395
  return `${FRIZZ_ROUTE_PREFIX}${path3.startsWith("/") ? path3 : `/${path3}`}`;
15390
15396
  }
15391
- var import_yaml2, ATTACHMENT_IMAGE_EXTENSIONS, ATTACHMENT_TEXT_EXTENSIONS, ATTACHMENT_OFFICE_EXTENSIONS, ATTACHMENT_DATA_EXTENSIONS, ATTACHMENT_ARCHIVE_EXTENSIONS, ATTACHMENT_DOC_EXTENSIONS, ATTACHMENT_EXTENSIONS, ATTACHMENT_MAX_BASE64_CHARS, ATTACHMENT_MAX_BYTES, ATTACHMENT_EXT_SET, ATTACHMENT_ACCEPT, FrizzStatus, BlockMechanism, RuntimeState, Backend, BACKEND_FOLLOW_UPS, CodexModel, ClaudeModel, CODEX_MODELS_FALLBACK, AcpAgent, ACP_MODEL_PREFIX, OPENCODE_MODEL_PREFIX, OpencodeModel, OpencodeModels, AcpAgentModel, AcpAgentModels, AcpAgentModelsInput, ThreadProfileOption, ThreadAgent, SubAgentView, BgShellView, CompletionHoldOp, CompletionHold, AskOption, AskQuestion, PendingAsk, AwaitingHint, RETIRED_AWAITING_KINDS, RETIRED_LINE_RE, RETIRED_AWAITING_REPLACEMENT, AWAITING_KEY_RE, AWAITING_YAML_KEYS, AWAITING_SEQUENCE_KEYS, AWAITING_HINT_MAX, AWAITING_HINT_VALUE_MAX, AWAITING_SCALAR_KINDS, AWAITING_STEPS_MAX, AWAITING_STEP_VALUE_MAX, AWAITING_STEP_BODY_MAX, AWAITING_QUESTIONS_MAX, AWAITING_TITLE_MAX, FENCE_DELIMITER_RE, STEP_CODE_FENCE_RE, indentOf2, AWAITING_STATUSES, AWAITING_ITEM_KINDS, AWAITING_DURATION_RE, DURATION_UNIT_MS, AWAITING_FOR_MAX_MS, SnoozeUntil, SNOOZE_PROMPT_MAX, SnoozePrompt, RECURRING_PROMPT_MAX, RECURRING_MIN_INTERVAL_SECONDS, RECURRING_MAX_INTERVAL_SECONDS, RecurringPromptText, RecurringIntervalSeconds, ThreadRecurringPrompt, INTERRUPT_MARKERS, ALLDONE_SENTINEL, OPT_OUT_NOTE, OVER_QUESTION_NOTE, TIMER_PROMPT_MAX, TIMER_MAX_DELAY_SECONDS, TIMER_MAX_ARMED, TimerPromptText, PR_WATCH_SPENT_TRAILER, PR_WATCH_ARMED_TRAILER, SHELL_DONE_TRAILER, ISSUE_WATCH_SPENT_TRAILER, ISSUE_WATCH_ARMED_TRAILER, LEGACY_PR_WATCH_ARMED_TRAILER, LEGACY_ISSUE_WATCH_ARMED_TRAILER, INTERRUPT_ENDED_LEAD, SIGNOFF_NUDGE_MARKER, SIGNOFF_NUDGE_BARE_LINE, SIGNOFF_NUDGE_STRAY_LINE, SIGNOFF_NUDGE_MESSAGE, SIGNOFF_NUDGE_MESSAGE_NEEDS_INPUT, PARK_CORRECTION_NAMES_LEAD, PARK_CORRECTION_RETIRED_LEAD, PARK_CORRECTION_QUESTION_LEAD, PARK_CORRECTION_NEEDS_INPUT_LEAD, QUESTION_FENCE_CORRECTION_LEAD, DONE_FENCE_CORRECTION_LEAD, SIGNOFF_CORRECTION_LEAD, ThreadWatchKind, GithubChecksState, GithubMergeState, GithubWatchStatus, GITHUB_READING_STALE_MS, GithubIssueStatus, CommandWatchRun, MonitorStatus, ThreadWatchView, PR_WATCH_FOR_MAX_MS, PR_WATCH_DEFAULT_FOR_MS, PR_WATCH_MAX_ARMED, PrWatchView, AddOwnPrWatchInput, AddOwnPrWatchResult, DropOwnPrWatchInput, DropOwnPrWatchResult, OwnWatchKind, AddOwnWatchInput, OwnWatchView, AddOwnWatchResult, DropOwnWatchInput, DropOwnWatchResult, OWN_WATCH_MAX_ARMED, COMMAND_WATCH_EVERY_MIN_MS, COMMAND_WATCH_EVERY_MAX_MS, COMMAND_WATCH_FOR_MAX_MS, COMMAND_WATCH_MAX_ARMED, COMMAND_WATCH_COMMAND_MAX, COMMAND_WATCH_OUTPUT_MAX_BYTES, COMMAND_WATCH_RUN_TIMEOUT_MS, CommandWatchState, CommandWatchView, AddOwnCommandWatchInput, AddOwnCommandWatchResult, DropOwnCommandWatchInput, DropOwnCommandWatchResult, ListOwnCommandWatchesInput, OwnCommandWatchesResult, COMMAND_WATCH_FALLBACK, COMMAND_WATCH_PASSED_TRAILER, COMMAND_WATCH_EXPIRED_TRAILER, COMMAND_WATCH_CANCELLED_TRAILER, COMMAND_WATCH_TRAILERS_EXPIRED, MONITOR_BATCH_MS, MONITOR_LINE_MAX_CHARS, MONITOR_EVENT_MAX_LINES, MONITOR_FLOOD_MAX_EVENTS, MONITOR_FLOOD_WINDOW_MS, MONITOR_REGISTRATION_WINDOW_MS, MONITOR_DESCRIPTION_MAX, MONITOR_SERVER_MAX_RUNNING, AddOwnMonitorInput, AddOwnMonitorResult, MONITOR_FALLBACK, MONITOR_EVENT_TRAILER, MONITOR_EXITED_TRAILER, MONITOR_EXPIRED_TRAILER, MONITOR_CANCELLED_TRAILER, MONITOR_FLOOD_REASON, MONITOR_STOPPED_BY_HUMAN_REASON, QUESTION_FENCE_RETIRED_AT, NEEDS_INPUT_REQUIRED_AT, AskQuestionKind, ASK_MAX_DEPTH, AskedOptionSchema, AskedQuestionSchema, AskInput, RegisteredQuestionView, QuestionFenceFaultView, ClosedQuestionView, SECRET_ANSWER_PREFIX, SECRET_TTL_MS, AskResult, UnaskInput, UnaskResult, QuestionAnswerSchema, AnswerQuestionsInput, AnswerQuestionsResult, DismissQuestionsInput, DismissQuestionsResult, SettledQuestionView, ClosedQuestionSpecView, ThreadSettledQuestionsResult, ThreadRegisteredDoneResult, BURIED_ANSWERS_HEADER, ANSWER_FOLLOW_UP_MARKER, ANSWER_CONTINUATION_INDENT, indentAnswerContinuation, ANSWER_PICK_PREFIX, DISMISSED_ANSWER, ANSWER_ROW_ID_PATTERN, ANSWER_ROW_ID, answerRowId, ANSWERS_NOTE_HEADER, STEPS_DONE, MarkOwnDoneInput, MarkOwnDoneResult, ListOwnPrWatchesInput, OwnPrWatchesResult, ThreadTimerView, ThreadFence, LimitWindow, LimitPause, ProviderError, ThreadLinkView, HumanTodo, SetHumanTodoInput, UpsertOwnLinkInput, UpsertOwnLinkResult, DropOwnLinkInput, DropOwnLinkResult, LiveTool, ThreadView, SPINNING_UP_TITLE, UNTITLED_THREAD_TITLE, SPIN_UP_MS, CODEX_TITLE_SIGNAL_GRACE_MS, BoardErrorItem, BoardSnapshot, BoardState, QuotaWindow, ProviderQuota, QuotaSnapshot, ProviderAuth, AccountEmails, AuthSnapshot, AccountBackend, AccountLogoutInput, AccountLogoutResult, PermissionMode, LocalFileOpener, Settings, DispatchProviderPreferences, DispatchPreferences, DispatchProfileSnapshotShape, DispatchProfileSnapshot, SetDispatchPreferenceInput, DispatchInput, ADOPT_THREAD_MESSAGE_MAX_CHARS, AdoptThreadInput, AdoptThreadResult, AdoptSessionInput, FollowUpInput, SteerThreadInput, SteerThreadResult, SpawnThreadInput, SpawnThreadResult, SpawnChildInput, SpawnChildResult, DismissFailedFollowUpInput, DismissFailedFollowUpResult, UnqueueFollowUpInput, UnqueueFollowUpResult, DeliverQueuedNowInput, DeliverQueuedNowResult, CompactThreadInput, SetThreadSnoozeInput, SetThreadPinnedInput, ReorderPinnedThreadsInput, SetThreadConsolePinnedInput, ReorderConsolePinnedThreadsInput, SetThreadRecurringPromptInput, SetOwnThreadRecurringPromptInput, SetOwnThreadRecurringPromptResult, GetOwnThreadRecurringPromptInput, OwnThreadRecurringPromptResult, SetOwnThreadTimerInput, CancelOwnThreadTimerInput, ListOwnThreadTimersInput, OwnThreadTimersResult, ThreadActivityItem, ListOwnThreadActivityInput, OwnThreadActivityResult, ThreadBand, ThreadListing, ListThreadsInput, ListThreadsResult, SetOwnThreadTimerResult, CancelOwnThreadTimerResult, SetOwnThreadStopHookInput, SetOwnThreadHeartbeatInput, RenameThreadInput, AiRenameThreadInput, AiRenameThreadResult, SetOwnThreadTitleInput, SetOwnThreadTitleResult, SetThreadPermissionInput, SetThreadPermissionResult, ThreadProfileOptionsInput, ThreadProfileOptionsResult, ThreadSkillSource, ThreadSkill, ThreadSkillsInput, ThreadSkillsResult, McpTarget, McpServerState, McpServerReading, McpStatusInput, McpStatusResult, McpSignInInput, McpSignInState, McpSignInResult, McpSignInAttemptInput, McpSignInPollResult, McpSignInFinishInput, SetThreadProfileInput, SetThreadProfileResult, UpgradeThreadModelInput, UpgradeThreadModelResult, DISPATCH_TASK_BANNER, DISPATCH_TASK_BANNER_MARKER, GITHUB_DISPATCH_UI_BOUNDARY, WAKE_TIME_HEADER_TAIL, WAKE_TRAILERS, HUMAN_GAP_FLOOR_MS, HUMAN_GAP_NOTE_TAIL, WAKE_DELIVERY_TOKEN_TAIL, WAKE_DELIVERY_TOKEN_LINE, MERGED_WAKE_LEAD, MERGED_WAKE_HEADING, NOISE_PREFIXES, AGENT_MESSAGE_WRAPPER, CROSS_SESSION_PREAMBLE, CROSS_SESSION_WRAPPER, CROSS_SESSION_GUIDANCE, XML_ATTRIBUTE, THREAD_MESSAGE_OPEN, THREAD_MESSAGE_CLOSE, THREAD_MESSAGE_GUIDANCE, sealThreadMessageBody, unsealThreadMessageBody, RETRY_FOLLOW_UP, GithubWakeItem, GithubWakeSteer, WAKE_SCOPE, WAKE_REVIEW_LEAD, WAKE_BACKLOG_TAIL, WAKE_REF, WAKE_SINGLE, WAKE_MULTI_HEAD, WAKE_ITEM, WAKE_MORE, PR_WATCH_FINISHED, PR_WATCH_CI_PASSED, PR_WATCH_CI_GATED, PR_WATCH_STATE, PR_WATCH_CI_FAILED, GithubStatus, GithubAccount, GithubRefCard, GithubRefPreviewInput, GithubRefPreviewResult, GithubItem, GithubListInput, GithubListResult, GithubBatchInput, GithubBatchResult, BoardMeta, BoardDeltaEvent, ServerEvent, BoardDeltasInput, BoardDeltasResult, TranscriptEdit, TranscriptTodo, TranscriptToolCall, TranscriptPart, TranscriptMessage, TranscriptPageCursor, EditedFile, TranscriptPage, TranscriptEarlierInput, SocketTranscriptSlug, SocketFilePath, SocketTranscriptClientMsg, SocketFileClientMsg, SocketBoardClientMsg, SocketClientMsg, ProjectCard, ProjectRailCounts, PROJECT_ICON_EXTENSIONS, PROJECT_ICON_MAX_BASE64_CHARS, DirectoryPickResult, ThreadLocation, FRIZZ_ROUTE_PREFIX, DEFAULT_PORT, threadIdentityName;
15397
+ var import_yaml2, ATTACHMENT_IMAGE_EXTENSIONS, ATTACHMENT_TEXT_EXTENSIONS, ATTACHMENT_OFFICE_EXTENSIONS, ATTACHMENT_DATA_EXTENSIONS, ATTACHMENT_ARCHIVE_EXTENSIONS, ATTACHMENT_DOC_EXTENSIONS, ATTACHMENT_EXTENSIONS, ATTACHMENT_MAX_BASE64_CHARS, ATTACHMENT_MAX_BYTES, ATTACHMENT_EXT_SET, ATTACHMENT_ACCEPT, FrizzStatus, BlockMechanism, RuntimeState, Backend, BACKEND_FOLLOW_UPS, CodexModel, ClaudeModel, CODEX_MODELS_FALLBACK, AcpAgent, ACP_MODEL_PREFIX, OPENCODE_MODEL_PREFIX, OpencodeModel, OpencodeModels, AcpAgentModel, AcpAgentModels, AcpAgentModelsInput, ThreadProfileOption, ThreadAgent, SubAgentView, BgShellView, CompletionHoldOp, CompletionHold, AskOption, AskQuestion, PendingAsk, AwaitingHint, RETIRED_AWAITING_KINDS, RETIRED_LINE_RE, RETIRED_AWAITING_REPLACEMENT, AWAITING_KEY_RE, AWAITING_YAML_KEYS, AWAITING_SEQUENCE_KEYS, AWAITING_HINT_MAX, AWAITING_HINT_VALUE_MAX, AWAITING_SCALAR_KINDS, AWAITING_STEPS_MAX, AWAITING_STEP_VALUE_MAX, AWAITING_STEP_BODY_MAX, AWAITING_QUESTIONS_MAX, AWAITING_TITLE_MAX, FENCE_DELIMITER_RE, STEP_CODE_FENCE_RE, indentOf2, AWAITING_STATUSES, AWAITING_ITEM_KINDS, AWAITING_DURATION_RE, DURATION_UNIT_MS, AWAITING_FOR_MAX_MS, SnoozeUntil, SNOOZE_PROMPT_MAX, SnoozePrompt, RECURRING_PROMPT_MAX, RECURRING_MIN_INTERVAL_SECONDS, RECURRING_MAX_INTERVAL_SECONDS, RecurringPromptText, RecurringIntervalSeconds, ThreadRecurringPrompt, INTERRUPT_MARKERS, ALLDONE_SENTINEL, OPT_OUT_NOTE, OVER_QUESTION_NOTE, TIMER_PROMPT_MAX, TIMER_MAX_DELAY_SECONDS, TIMER_MAX_ARMED, TimerPromptText, TIMER_DESCRIPTION_MAX, TimerDescriptionText, PR_WATCH_SPENT_TRAILER, PR_WATCH_ARMED_TRAILER, SHELL_DONE_TRAILER, ISSUE_WATCH_SPENT_TRAILER, ISSUE_WATCH_ARMED_TRAILER, LEGACY_PR_WATCH_ARMED_TRAILER, LEGACY_ISSUE_WATCH_ARMED_TRAILER, INTERRUPT_ENDED_LEAD, SIGNOFF_NUDGE_MARKER, SIGNOFF_NUDGE_BARE_LINE, SIGNOFF_NUDGE_STRAY_LINE, SIGNOFF_NUDGE_MESSAGE, SIGNOFF_NUDGE_MESSAGE_NEEDS_INPUT, PARK_CORRECTION_NAMES_LEAD, PARK_CORRECTION_RETIRED_LEAD, PARK_CORRECTION_QUESTION_LEAD, PARK_CORRECTION_NEEDS_INPUT_LEAD, QUESTION_FENCE_CORRECTION_LEAD, DONE_FENCE_CORRECTION_LEAD, SIGNOFF_CORRECTION_LEAD, ThreadWatchKind, GithubChecksState, GithubMergeState, GithubWatchStatus, GITHUB_READING_STALE_MS, GithubIssueStatus, CommandWatchRun, MonitorStatus, ThreadWatchView, PR_WATCH_FOR_MAX_MS, PR_WATCH_DEFAULT_FOR_MS, PR_WATCH_MAX_ARMED, PrWatchView, AddOwnPrWatchInput, AddOwnPrWatchResult, DropOwnPrWatchInput, DropOwnPrWatchResult, OwnWatchKind, AddOwnWatchInput, OwnWatchView, AddOwnWatchResult, DropOwnWatchInput, DropOwnWatchResult, OWN_WATCH_MAX_ARMED, COMMAND_WATCH_EVERY_MIN_MS, COMMAND_WATCH_EVERY_MAX_MS, COMMAND_WATCH_FOR_MAX_MS, COMMAND_WATCH_MAX_ARMED, COMMAND_WATCH_COMMAND_MAX, COMMAND_WATCH_OUTPUT_MAX_BYTES, COMMAND_WATCH_RUN_TIMEOUT_MS, MONITOR_DESCRIPTION_MAX, CommandWatchState, CommandWatchView, AddOwnCommandWatchInput, AddOwnCommandWatchResult, DropOwnCommandWatchInput, DropOwnCommandWatchResult, ListOwnCommandWatchesInput, OwnCommandWatchesResult, COMMAND_WATCH_FALLBACK, COMMAND_WATCH_PASSED_TRAILER, COMMAND_WATCH_EXPIRED_TRAILER, COMMAND_WATCH_CANCELLED_TRAILER, COMMAND_WATCH_TRAILERS_EXPIRED, MONITOR_BATCH_MS, MONITOR_LINE_MAX_CHARS, MONITOR_EVENT_MAX_LINES, MONITOR_FLOOD_MAX_EVENTS, MONITOR_FLOOD_WINDOW_MS, MONITOR_REGISTRATION_WINDOW_MS, MONITOR_SERVER_MAX_RUNNING, AddOwnMonitorInput, AddOwnMonitorResult, MONITOR_FALLBACK, MONITOR_EVENT_TRAILER, MONITOR_EXITED_TRAILER, MONITOR_EXPIRED_TRAILER, MONITOR_CANCELLED_TRAILER, MONITOR_FLOOD_REASON, MONITOR_STOPPED_BY_HUMAN_REASON, QUESTION_FENCE_RETIRED_AT, NEEDS_INPUT_REQUIRED_AT, AskQuestionKind, ASK_MAX_DEPTH, AskedOptionSchema, AskedQuestionSchema, AskInput, RegisteredQuestionView, QuestionFenceFaultView, ClosedQuestionView, SECRET_ANSWER_PREFIX, SECRET_TTL_MS, AskResult, UnaskInput, UnaskResult, QuestionAnswerSchema, AnswerQuestionsInput, AnswerQuestionsResult, DismissQuestionsInput, DismissQuestionsResult, SettledQuestionView, ClosedQuestionSpecView, ThreadSettledQuestionsResult, ThreadRegisteredDoneResult, BURIED_ANSWERS_HEADER, ANSWER_FOLLOW_UP_MARKER, ANSWER_CONTINUATION_INDENT, indentAnswerContinuation, ANSWER_PICK_PREFIX, DISMISSED_ANSWER, ANSWER_ROW_ID_PATTERN, ANSWER_ROW_ID, answerRowId, ANSWERS_NOTE_HEADER, STEPS_DONE, MarkOwnDoneInput, MarkOwnDoneResult, ListOwnPrWatchesInput, OwnPrWatchesResult, ThreadTimerView, ThreadFence, LimitWindow, LimitPause, ProviderError, ThreadLinkView, HumanTodo, SetHumanTodoInput, UpsertOwnLinkInput, UpsertOwnLinkResult, DropOwnLinkInput, DropOwnLinkResult, LiveTool, ThreadView, SPINNING_UP_TITLE, UNTITLED_THREAD_TITLE, SPIN_UP_MS, CODEX_TITLE_SIGNAL_GRACE_MS, BoardErrorItem, BoardSnapshot, BoardState, QuotaWindow, ProviderQuota, QuotaSnapshot, ProviderAuth, AccountEmails, AuthSnapshot, AccountBackend, AccountLogoutInput, AccountLogoutResult, PermissionMode, LocalFileOpener, Settings, DispatchProviderPreferences, DispatchPreferences, DispatchProfileSnapshotShape, DispatchProfileSnapshot, SetDispatchPreferenceInput, DispatchInput, ADOPT_THREAD_MESSAGE_MAX_CHARS, AdoptThreadInput, AdoptThreadResult, AdoptSessionInput, FollowUpInput, SteerThreadInput, SteerThreadResult, SpawnThreadInput, SpawnThreadResult, SpawnChildInput, SpawnChildResult, DismissFailedFollowUpInput, DismissFailedFollowUpResult, UnqueueFollowUpInput, UnqueueFollowUpResult, DeliverQueuedNowInput, DeliverQueuedNowResult, CompactThreadInput, SetThreadSnoozeInput, SetThreadPinnedInput, ReorderPinnedThreadsInput, SetThreadConsolePinnedInput, ReorderConsolePinnedThreadsInput, SetThreadRecurringPromptInput, SetOwnThreadRecurringPromptInput, SetOwnThreadRecurringPromptResult, GetOwnThreadRecurringPromptInput, OwnThreadRecurringPromptResult, SetOwnThreadTimerInput, CancelOwnThreadTimerInput, ListOwnThreadTimersInput, OwnThreadTimersResult, ThreadActivityItem, ListOwnThreadActivityInput, OwnThreadActivityResult, ThreadBand, ThreadListing, ListThreadsInput, ListThreadsResult, SetOwnThreadTimerResult, CancelOwnThreadTimerResult, SetOwnThreadStopHookInput, SetOwnThreadHeartbeatInput, RenameThreadInput, AiRenameThreadInput, AiRenameThreadResult, SetOwnThreadTitleInput, SetOwnThreadTitleResult, SetThreadPermissionInput, SetThreadPermissionResult, ThreadProfileOptionsInput, ThreadProfileOptionsResult, ThreadSkillSource, ThreadSkill, ThreadSkillsInput, ThreadSkillsResult, McpTarget, McpServerState, McpServerReading, McpStatusInput, McpStatusResult, McpServerName, McpReloadChange, McpReloadInput, McpReloadResult, McpSignInInput, McpSignInState, McpSignInResult, McpSignInAttemptInput, McpSignInPollResult, McpSignInFinishInput, SetThreadProfileInput, SetThreadProfileResult, UpgradeThreadModelInput, UpgradeThreadModelResult, DISPATCH_TASK_BANNER, DISPATCH_TASK_BANNER_MARKER, GITHUB_DISPATCH_UI_BOUNDARY, WAKE_TIME_HEADER_TAIL, WAKE_TRAILERS, HUMAN_GAP_FLOOR_MS, HUMAN_GAP_NOTE_TAIL, WAKE_DELIVERY_TOKEN_TAIL, WAKE_DELIVERY_TOKEN_LINE, MERGED_WAKE_LEAD, MERGED_WAKE_HEADING, NOISE_PREFIXES, AGENT_MESSAGE_WRAPPER, CROSS_SESSION_PREAMBLE, CROSS_SESSION_WRAPPER, CROSS_SESSION_GUIDANCE, XML_ATTRIBUTE, THREAD_MESSAGE_OPEN, THREAD_MESSAGE_CLOSE, THREAD_MESSAGE_GUIDANCE, sealThreadMessageBody, unsealThreadMessageBody, RETRY_FOLLOW_UP, GithubWakeItem, GithubWakeSteer, WAKE_SCOPE, WAKE_REVIEW_LEAD, WAKE_BACKLOG_TAIL, WAKE_REF, WAKE_SINGLE, WAKE_MULTI_HEAD, WAKE_ITEM, WAKE_MORE, PR_WATCH_FINISHED, PR_WATCH_CI_PASSED, PR_WATCH_CI_GATED, PR_WATCH_STATE, PR_WATCH_CI_FAILED, GithubStatus, GithubAccount, GithubRefCard, GithubRefPreviewInput, GithubRefPreviewResult, GithubItem, GithubListInput, GithubListResult, GithubBatchInput, GithubBatchResult, BoardMeta, BoardDeltaEvent, ServerEvent, BoardDeltasInput, BoardDeltasResult, TranscriptEdit, TranscriptTodo, TranscriptToolCall, TranscriptPart, TranscriptMessage, TranscriptPageCursor, EditedFile, TranscriptPage, TranscriptEarlierInput, SocketTranscriptSlug, SocketFilePath, SocketTranscriptClientMsg, SocketFileClientMsg, SocketBoardClientMsg, SocketClientMsg, ProjectCard, ProjectRailCounts, PROJECT_ICON_EXTENSIONS, PROJECT_ICON_MAX_BASE64_CHARS, DirectoryPickResult, ThreadLocation, FRIZZ_ROUTE_PREFIX, DEFAULT_PORT, threadIdentityName;
15392
15398
  var init_src = __esm({
15393
15399
  "packages/shared/src/index.ts"() {
15394
15400
  "use strict";
@@ -15721,6 +15727,11 @@ var init_src = __esm({
15721
15727
  // A positive flag for the EXCEPTION rather than a `readable` that every existing row would have to
15722
15728
  // start setting: an old snapshot then keeps its drill-in instead of silently losing it.
15723
15729
  outputUnavailable: external_exports.boolean().optional(),
15730
+ // A Claude Code `Monitor` rather than a background Bash. It has no output file either, but frizz keeps
15731
+ // the events it delivered to the worker, so its row opens the same drawer onto those, and the row's
15732
+ // live counter counts events instead of lines. Until 2026-11-12 a Monitor was `outputUnavailable` and
15733
+ // its row opened nothing.
15734
+ monitor: external_exports.boolean().optional(),
15724
15735
  // The command this shell runs, when frizz knows it independently of the label. Set only on a CODEX
15725
15736
  // row, where it is the ONE thing the board's copy of the shell and the transcript's copy share — see
15726
15737
  // lib/childOps.ts mergeBackgroundShells, which reconciles the two on it. A Claude row leaves it
@@ -15874,6 +15885,8 @@ var init_src = __esm({
15874
15885
  TIMER_MAX_DELAY_SECONDS = 30 * 24 * 60 * 60;
15875
15886
  TIMER_MAX_ARMED = 64;
15876
15887
  TimerPromptText = external_exports.string().trim().min(1).max(TIMER_PROMPT_MAX);
15888
+ TIMER_DESCRIPTION_MAX = 120;
15889
+ TimerDescriptionText = external_exports.string().trim().min(1).max(TIMER_DESCRIPTION_MAX);
15877
15890
  PR_WATCH_SPENT_TRAILER = "(This watcher is spent \u2014 there is nothing further to report on a finished PR.)";
15878
15891
  PR_WATCH_ARMED_TRAILER = "(Registered PR watcher \u2014 STILL ARMED. It reports again on the next CI change, review, comment, label, conflict or review request. Drop it with `frizzctl watch-pr drop <id>` when it stops mattering.)";
15879
15892
  SHELL_DONE_TRAILER = "(Frizz sends this because it finished after you came to rest, where your runtime's own completion notification does not reach you. Read its output if you still need it.)";
@@ -16004,14 +16017,22 @@ var init_src = __esm({
16004
16017
  /** `timer` rows only: the armed timer's own registration, which is everything the row renders — the
16005
16018
  * worker's prompt is the row's NAME (a `tmr_…` id names nothing to a human) and the fire instant is
16006
16019
  * its status. Unlike `github` there is no polled half to be absent: a timer that exists is fully
16007
- * known, so a timer row always carries this. */
16008
- timer: external_exports.object({ fireAt: external_exports.string(), prompt: external_exports.string() }).strict().optional(),
16020
+ * known, so a timer row always carries this.
16021
+ *
16022
+ * `description` (2026-11-12) is the worker's few words for the HUMAN — the row's name and its drawer's
16023
+ * title. The prompt is written to the worker's future self ("Re-run the release preflight against
16024
+ * <sha> and …"), and its first line was all a row could show. Absent on a timer set before it. */
16025
+ timer: external_exports.object({ fireAt: external_exports.string(), prompt: external_exports.string(), description: external_exports.string().optional() }).strict().optional(),
16009
16026
  /** `command` rows only: the armed command watch's registration and its last check — what the worker's
16010
16027
  * own read-back carries (CommandWatchView), minus the id and state the row already has. The command is
16011
16028
  * the row's NAME and the cadence its status. Until 2026-10-13 a command watch had no row at all, so a
16012
16029
  * thread parked on nothing else drew a card that said only "Waiting for an external update." */
16013
16030
  command: external_exports.object({
16014
16031
  command: external_exports.string(),
16032
+ /** What it watches, in the worker's words: the row's name and its drawer's title, for a check as for a
16033
+ * monitor (2026-11-12; a check refused one until then and was named by its command). Absent on a row
16034
+ * registered without one. A monitor's also rides `monitor.description` below, for older clients. */
16035
+ description: external_exports.string().optional(),
16015
16036
  /** The cadence in the house duration grammar (`2m`, `1h 30m`). */
16016
16037
  every: external_exports.string(),
16017
16038
  expiresAt: external_exports.string(),
@@ -16159,10 +16180,13 @@ var init_src = __esm({
16159
16180
  COMMAND_WATCH_COMMAND_MAX = 4e3;
16160
16181
  COMMAND_WATCH_OUTPUT_MAX_BYTES = 4096;
16161
16182
  COMMAND_WATCH_RUN_TIMEOUT_MS = 2 * 6e4;
16183
+ MONITOR_DESCRIPTION_MAX = 120;
16162
16184
  CommandWatchState = external_exports.enum(["armed", "dropped", "passed", "expired", "cancelled"]);
16163
16185
  CommandWatchView = external_exports.object({
16164
16186
  id: external_exports.string(),
16165
16187
  command: external_exports.string(),
16188
+ /** What it watches, in the worker's words — present when it gave one (required from 2026-11-12). */
16189
+ description: external_exports.string().optional(),
16166
16190
  /** The cadence in the house duration grammar (`5m`, `1h 30m`). */
16167
16191
  every: external_exports.string(),
16168
16192
  state: CommandWatchState,
@@ -16180,6 +16204,10 @@ var init_src = __esm({
16180
16204
  slug: ThreadSlug,
16181
16205
  /** Run with `/bin/sh -c` in the project root, with the server's environment. Exit status 0 is "passed". */
16182
16206
  command: external_exports.string().trim().min(1).max(COMMAND_WATCH_COMMAND_MAX),
16207
+ /** What it waits for, in the worker's words ("frizz 0.15.54 on npm") — the name on its row and drawer.
16208
+ * REQUIRED BY THE TOOL, OPTIONAL ON THE WIRE (2026-11-12): `frizzctl monitor` refuses an `add` without
16209
+ * one, while a worker whose tool predates the field still registers, named by its command. */
16210
+ description: external_exports.string().trim().min(1).max(MONITOR_DESCRIPTION_MAX).optional(),
16183
16211
  /** How often to check, as a DURATION (`5m`; parseAwaitingDurationRaw). Clamped to [1m, 24h] and reported. */
16184
16212
  every: external_exports.string().trim().min(1).max(16),
16185
16213
  /** How long to keep checking, as a DURATION. Clamped to COMMAND_WATCH_FOR_MAX_MS and reported. */
@@ -16229,7 +16257,6 @@ var init_src = __esm({
16229
16257
  MONITOR_FLOOD_MAX_EVENTS = 30;
16230
16258
  MONITOR_FLOOD_WINDOW_MS = 10 * 6e4;
16231
16259
  MONITOR_REGISTRATION_WINDOW_MS = 2e3;
16232
- MONITOR_DESCRIPTION_MAX = 120;
16233
16260
  MONITOR_SERVER_MAX_RUNNING = 32;
16234
16261
  AddOwnMonitorInput = external_exports.object({
16235
16262
  slug: ThreadSlug,
@@ -16437,6 +16464,8 @@ ${ANSWER_CONTINUATION_INDENT}`);
16437
16464
  ThreadTimerView = external_exports.object({
16438
16465
  id: external_exports.string(),
16439
16466
  prompt: external_exports.string(),
16467
+ /** What it is for, in the worker's words — present when it gave one (required from 2026-11-12). */
16468
+ description: external_exports.string().optional(),
16440
16469
  /** The exact UTC instant it fires — the same string the delivered trailer names. */
16441
16470
  fireAt: external_exports.string(),
16442
16471
  state: external_exports.enum(["armed", "fired", "cancelled"]),
@@ -17345,6 +17374,9 @@ ${ANSWER_CONTINUATION_INDENT}`);
17345
17374
  SetOwnThreadTimerInput = external_exports.object({
17346
17375
  slug: ThreadSlug,
17347
17376
  prompt: TimerPromptText,
17377
+ /** What it is for, in a few words, for the human: the row's name and its drawer's title. REQUIRED BY
17378
+ * THE TOOL, OPTIONAL ON THE WIRE (2026-11-12), as AddOwnCommandWatchInput's is. */
17379
+ description: TimerDescriptionText.optional(),
17348
17380
  fireAt: SnoozeUntil
17349
17381
  }).strict();
17350
17382
  CancelOwnThreadTimerInput = external_exports.object({
@@ -17534,6 +17566,33 @@ ${ANSWER_CONTINUATION_INDENT}`);
17534
17566
  */
17535
17567
  note: external_exports.string().max(500).optional()
17536
17568
  }).strict();
17569
+ McpServerName = external_exports.string().min(1).max(256);
17570
+ McpReloadChange = external_exports.object({
17571
+ added: external_exports.array(McpServerName).max(256),
17572
+ removed: external_exports.array(McpServerName).max(256),
17573
+ /** Kept its name, changed its definition: restarted with the new one. */
17574
+ changed: external_exports.array(McpServerName).max(256),
17575
+ unchanged: external_exports.number().int().nonnegative(),
17576
+ /** Servers that failed to connect, with the agent's reason. */
17577
+ errors: external_exports.record(McpServerName, external_exports.string().max(2e3)),
17578
+ /** Declared in `.mcp.json` but approved nowhere, so left out (Claude only). */
17579
+ unapproved: external_exports.array(McpServerName).max(256)
17580
+ }).strict();
17581
+ McpReloadInput = McpTarget;
17582
+ McpReloadResult = external_exports.object({
17583
+ backend: Backend,
17584
+ agent: external_exports.string().max(200),
17585
+ supported: external_exports.boolean(),
17586
+ /** What the reload did to the asking thread's session. Absent for the new-thread box, and for a thread
17587
+ * whose session is not running or predates reload — `note` then says why. */
17588
+ thread: McpReloadChange.optional(),
17589
+ note: external_exports.string().max(500).optional(),
17590
+ /** The project's other running Claude threads: reloaded, or too old to be (they pick the change up when
17591
+ * their session next starts). Codex reloads every thread of its app-server at once and counts none. */
17592
+ others: external_exports.object({ reloaded: external_exports.number().int().nonnegative(), stale: external_exports.number().int().nonnegative(), failed: external_exports.number().int().nonnegative() }).strict().optional(),
17593
+ /** The servers as they read after the reload, the same reading `mcpStatus` gives. */
17594
+ servers: external_exports.array(McpServerReading).max(256)
17595
+ }).strict();
17537
17596
  McpSignInInput = external_exports.object({ target: McpTarget, server: external_exports.string().min(1).max(256) }).strict();
17538
17597
  McpSignInState = external_exports.enum(["waiting", "done", "failed", "expired", "cancelled"]);
17539
17598
  McpSignInResult = external_exports.object({
@@ -23042,7 +23101,10 @@ function ensureStorageSchema(db2) {
23042
23101
  ["command_watch", "last_event_at INTEGER"],
23043
23102
  ["command_watch", "last_event TEXT"],
23044
23103
  ["command_watch", "pid INTEGER"],
23045
- ["command_watch", "pid_started_at INTEGER"]
23104
+ ["command_watch", "pid_started_at INTEGER"],
23105
+ // `thread_timer.description` (2026-11-12): a timer's name for the human, which its prompt (written
23106
+ // to the worker's future self) is not.
23107
+ ["thread_timer", "description TEXT"]
23046
23108
  ]) {
23047
23109
  try {
23048
23110
  db2.exec(`ALTER TABLE ${table} ADD COLUMN ${column}`);
@@ -23462,8 +23524,8 @@ function createStorage(source, projectId) {
23462
23524
  WHERE project_id = @project_id AND slug = ? AND recurring_armed_at = ?
23463
23525
  `);
23464
23526
  const armTimerStmt = scope.prepare(`
23465
- INSERT INTO thread_timer (project_id, id, thread_slug, prompt, fire_at, state, created_at, settled_at)
23466
- VALUES (@project_id, @id, @slug, @prompt, @fireAtMs, 'armed', @createdAtMs, NULL)
23527
+ INSERT INTO thread_timer (project_id, id, thread_slug, prompt, description, fire_at, state, created_at, settled_at)
23528
+ VALUES (@project_id, @id, @slug, @prompt, @description, @fireAtMs, 'armed', @createdAtMs, NULL)
23467
23529
  `);
23468
23530
  const timersBySlugStmt = scope.prepare(
23469
23531
  "SELECT * FROM thread_timer WHERE project_id = @project_id AND thread_slug = ? ORDER BY fire_at, id"
@@ -23531,9 +23593,9 @@ function createStorage(source, projectId) {
23531
23593
  const prWatchCursorStmt = scope.prepare("UPDATE pr_watch SET cursor = ? WHERE project_id = @project_id AND id = ? AND state = 'armed'");
23532
23594
  const delPrWatches = scope.prepare("DELETE FROM pr_watch WHERE project_id = @project_id AND thread_slug = ?");
23533
23595
  const armCommandWatchStmt = scope.prepare(`
23534
- INSERT INTO command_watch (project_id, id, thread_slug, command, every_ms, state, created_at, expires_at, settled_at,
23596
+ INSERT INTO command_watch (project_id, id, thread_slug, command, description, every_ms, state, created_at, expires_at, settled_at,
23535
23597
  runs, last_run_at, last_outcome, last_exit, last_output)
23536
- VALUES (@project_id, @id, @slug, @command, @everyMs, 'armed', @createdAtMs, @expiresAtMs, NULL,
23598
+ VALUES (@project_id, @id, @slug, @command, @description, @everyMs, 'armed', @createdAtMs, @expiresAtMs, NULL,
23537
23599
  @runs, @lastRunAt, @lastOutcome, @lastExit, @lastOutput)
23538
23600
  RETURNING *
23539
23601
  `);
@@ -24244,6 +24306,7 @@ function createStorage(source, projectId) {
24244
24306
  id: watch2.id,
24245
24307
  slug: watch2.slug,
24246
24308
  command: watch2.command,
24309
+ description: watch2.description?.trim() || null,
24247
24310
  everyMs: watch2.everyMs,
24248
24311
  createdAtMs: watch2.createdAtMs,
24249
24312
  expiresAtMs: watch2.expiresAtMs,
@@ -24336,7 +24399,7 @@ function createStorage(source, projectId) {
24336
24399
  listSubAgentSteers: (slug, subAgentId) => listSubAgentSteersStmt.all(slug, subAgentId),
24337
24400
  dropThreadWatch: (slug, id2, settledAtMs) => dropThreadWatchStmt.run(settledAtMs, id2, slug).changes === 1,
24338
24401
  settleThreadWatch: (id2, settledAtMs, state = "settled") => settleThreadWatchStmt.run(state, settledAtMs, id2).changes === 1,
24339
- armThreadTimer: (timer) => void armTimerStmt.run(timer),
24402
+ armThreadTimer: (timer) => void armTimerStmt.run({ ...timer, description: timer.description?.trim() || null }),
24340
24403
  listThreadTimers: (slug, opts) => (opts?.armedOnly ? armedTimersBySlugStmt : timersBySlugStmt).all(slug),
24341
24404
  armedThreadTimersBySlug: () => registryBySlug("thread_timer", () => groupBySlug(armedTimersStmt.all()), sameRows),
24342
24405
  getThreadTimer: (id2) => timerByIdStmt.get(id2),
@@ -25892,14 +25955,14 @@ function discoverTranscriptId(logDir, sessionId, opts = {}) {
25892
25955
  const nowMs = opts.nowMs ?? Date.now();
25893
25956
  const exclude = opts.exclude;
25894
25957
  const sentinel = sentinelFor(sessionId);
25895
- let names;
25958
+ let names2;
25896
25959
  try {
25897
- names = readdirSync4(logDir);
25960
+ names2 = readdirSync4(logDir);
25898
25961
  } catch {
25899
25962
  return void 0;
25900
25963
  }
25901
25964
  const cands = [];
25902
- for (const name of names) {
25965
+ for (const name of names2) {
25903
25966
  if (name.startsWith(".") || !name.endsWith(".jsonl")) continue;
25904
25967
  const id2 = name.slice(0, -".jsonl".length);
25905
25968
  if (!id2 || id2 === sessionId || exclude?.has(id2)) continue;
@@ -27623,7 +27686,7 @@ function validateElicitationResult(value) {
27623
27686
  }
27624
27687
  throw new ClaudeAgentSdkProtocolError("elicitation action is unsupported");
27625
27688
  }
27626
- var CLAUDE_AGENT_SDK_PROTOCOL_VERSION, CLAUDE_AGENT_SDK_MAX_INPUT_BYTES, CLAUDE_AGENT_SDK_MAX_JSON_BYTES, CLAUDE_AGENT_SDK_MAX_EVENT_TEXT_BYTES, CLAUDE_AGENT_SDK_MAX_DIAGNOSTIC_BYTES, CLAUDE_AGENT_SDK_MAX_QUEUED_INPUTS, CLAUDE_AGENT_SDK_MAX_QUEUED_EVENTS, encoder2, UNSAFE_TEXT2, ID_PATTERN, RESERVED_KEYS, DELIVERABLE_CONTROL_CODES, UNDELIVERABLE_LINE_BREAK_CODES, CLAUDE_BROKER_CAPABILITY_SUBAGENT_STEER, CLAUDE_BROKER_CAPABILITY_CANCEL_INPUT, CLAUDE_BROKER_CAPABILITY_STOP_TASK, CLAUDE_BROKER_CAPABILITY_RENAME, CLAUDE_BROKER_CAPABILITY_LIST_SKILLS, CLAUDE_BROKER_CAPABILITY_INPUT_ACK, CLAUDE_BROKER_CAPABILITY_MCP, CLAUDE_SEND_NOW_OUTCOMES, CLAUDE_INPUT_DROP_DIAGNOSTIC_PREFIX, ClaudeAgentSdkProtocolError;
27689
+ var CLAUDE_AGENT_SDK_PROTOCOL_VERSION, CLAUDE_AGENT_SDK_MAX_INPUT_BYTES, CLAUDE_AGENT_SDK_MAX_JSON_BYTES, CLAUDE_AGENT_SDK_MAX_EVENT_TEXT_BYTES, CLAUDE_AGENT_SDK_MAX_DIAGNOSTIC_BYTES, CLAUDE_AGENT_SDK_MAX_QUEUED_INPUTS, CLAUDE_AGENT_SDK_MAX_QUEUED_EVENTS, encoder2, UNSAFE_TEXT2, ID_PATTERN, RESERVED_KEYS, DELIVERABLE_CONTROL_CODES, UNDELIVERABLE_LINE_BREAK_CODES, CLAUDE_BROKER_CAPABILITY_SUBAGENT_STEER, CLAUDE_BROKER_CAPABILITY_CANCEL_INPUT, CLAUDE_BROKER_CAPABILITY_STOP_TASK, CLAUDE_BROKER_CAPABILITY_RENAME, CLAUDE_BROKER_CAPABILITY_LIST_SKILLS, CLAUDE_BROKER_CAPABILITY_INPUT_ACK, CLAUDE_BROKER_CAPABILITY_MCP, CLAUDE_BROKER_CAPABILITY_MCP_RELOAD, CLAUDE_SEND_NOW_OUTCOMES, CLAUDE_INPUT_DROP_DIAGNOSTIC_PREFIX, ClaudeAgentSdkProtocolError;
27627
27690
  var init_claude_agent_sdk_protocol = __esm({
27628
27691
  "packages/server/src/backend/claude-agent-sdk-protocol.ts"() {
27629
27692
  "use strict";
@@ -27647,6 +27710,7 @@ var init_claude_agent_sdk_protocol = __esm({
27647
27710
  CLAUDE_BROKER_CAPABILITY_LIST_SKILLS = "list-skills-v1";
27648
27711
  CLAUDE_BROKER_CAPABILITY_INPUT_ACK = "input-ack-v1";
27649
27712
  CLAUDE_BROKER_CAPABILITY_MCP = "mcp-v1";
27713
+ CLAUDE_BROKER_CAPABILITY_MCP_RELOAD = "mcp-reload-v1";
27650
27714
  CLAUDE_SEND_NOW_OUTCOMES = ["stopped", "delivering", "nothing_waiting"];
27651
27715
  CLAUDE_INPUT_DROP_DIAGNOSTIC_PREFIX = "input dropped, the agent never received it";
27652
27716
  ClaudeAgentSdkProtocolError = class extends Error {
@@ -27985,25 +28049,25 @@ function recordListing(dir) {
27985
28049
  const cached2 = listings.get(dir);
27986
28050
  if (cached2 && cached2.trusted && cached2.mtimeMs === stat2.mtimeMs && cached2.ino === stat2.ino) return cached2.names;
27987
28051
  const listedAt = Date.now();
27988
- let names;
28052
+ let names2;
27989
28053
  try {
27990
- names = new Set(readdirSync5(dir));
28054
+ names2 = new Set(readdirSync5(dir));
27991
28055
  } catch {
27992
- names = /* @__PURE__ */ new Set();
28056
+ names2 = /* @__PURE__ */ new Set();
27993
28057
  }
27994
- listings.set(dir, { mtimeMs: stat2.mtimeMs, ino: stat2.ino, names, trusted: stat2.mtimeMs <= listedAt - RACY_LISTING_MS });
27995
- return names;
28058
+ listings.set(dir, { mtimeMs: stat2.mtimeMs, ino: stat2.ino, names: names2, trusted: stat2.mtimeMs <= listedAt - RACY_LISTING_MS });
28059
+ return names2;
27996
28060
  }
27997
28061
  function brokerLivenessSnapshot(stateDir) {
27998
28062
  const dir = join28(stateDir, "claude-broker");
27999
- const names = recordListing(dir);
28063
+ const names2 = recordListing(dir);
28000
28064
  const alive = (sessionId) => {
28001
28065
  const name = claudeBrokerRecordName(sessionId);
28002
- return names.has(name) && recordDaemonAlive(join28(dir, name));
28066
+ return names2.has(name) && recordDaemonAlive(join28(dir, name));
28003
28067
  };
28004
28068
  return Object.assign(alive, {
28005
- listing: names,
28006
- listed: (sessionId) => names.has(claudeBrokerRecordName(sessionId))
28069
+ listing: names2,
28070
+ listed: (sessionId) => names2.has(claudeBrokerRecordName(sessionId))
28007
28071
  });
28008
28072
  }
28009
28073
  function recordDaemonAlive(recordPath2) {
@@ -28097,14 +28161,14 @@ function liveBrokerRecord(recordPath2) {
28097
28161
  }
28098
28162
  function liveBrokerRecords(stateDir) {
28099
28163
  const dir = join28(stateDir, "claude-broker");
28100
- let names;
28164
+ let names2;
28101
28165
  try {
28102
- names = readdirSync5(dir);
28166
+ names2 = readdirSync5(dir);
28103
28167
  } catch {
28104
28168
  return [];
28105
28169
  }
28106
28170
  const out = [];
28107
- for (const name of names) {
28171
+ for (const name of names2) {
28108
28172
  if (!name.endsWith(".json")) continue;
28109
28173
  const record = liveBrokerRecord(join28(dir, name));
28110
28174
  if (record) out.push(record);
@@ -30127,7 +30191,7 @@ function retireLive(state, entry, finishedAt, status) {
30127
30191
  state.subAgents.delete(entry.toolUseId);
30128
30192
  if (entry.kind === "shell") {
30129
30193
  state.retiredShells.delete(entry.toolUseId);
30130
- state.retiredShells.set(entry.toolUseId, { toolUseId: entry.toolUseId, command: entry.command, outputFile: entry.outputFile, status, taskId: entry.taskId, label: entry.label, finishedAt });
30194
+ state.retiredShells.set(entry.toolUseId, { toolUseId: entry.toolUseId, command: entry.command, outputFile: entry.outputFile, status, taskId: entry.taskId, label: entry.label, finishedAt, ...entry.monitor ? { monitor: true } : {} });
30131
30195
  while (state.retiredShells.size > RETAINED_SHELLS_MAX) {
30132
30196
  const oldest = state.retiredShells.keys().next().value;
30133
30197
  if (oldest === void 0) break;
@@ -30174,14 +30238,14 @@ function launchTaskId(text2) {
30174
30238
  return text2.match(/Command running in background with ID:\s*(\S+)/)?.[1]?.replace(/\.$/, "") ?? text2.match(/was moved to the background \(ID:\s*([^)\s]+)\)/)?.[1] ?? text2.match(/Monitor started \(task\s+(\w+)/)?.[1] ?? text2.match(/agentId:\s*(\S+)/)?.[1];
30175
30239
  }
30176
30240
  function readDescendantSidecars(sessionDir, mtimeMs) {
30177
- let names;
30241
+ let names2;
30178
30242
  try {
30179
- names = readdirSync6(join30(sessionDir, "subagents"));
30243
+ names2 = readdirSync6(join30(sessionDir, "subagents"));
30180
30244
  } catch {
30181
30245
  return [];
30182
30246
  }
30183
30247
  const out = [];
30184
- for (const name of names) {
30248
+ for (const name of names2) {
30185
30249
  if (out.length >= DESCENDANT_SIDECAR_MAX) break;
30186
30250
  const agentId = /^agent-(.+)\.meta\.json$/.exec(name)?.[1];
30187
30251
  if (!agentId) continue;
@@ -30376,6 +30440,85 @@ function trackCompletions(state, rec) {
30376
30440
  for (const entry of doomed) retireLive(state, entry, typeof rec.timestamp === "string" ? rec.timestamp : void 0, terminal);
30377
30441
  }
30378
30442
  }
30443
+ function collectMonitorEvents(state, rec) {
30444
+ if (rec.type !== "queue-operation" && rec.type !== "user" && rec.type !== "attachment") return;
30445
+ const raw2 = notificationText(rec);
30446
+ if (!raw2 || !raw2.includes("<event>")) return;
30447
+ const carrier = rec.type === "queue-operation" ? `queue:${typeof rec.operation === "string" ? rec.operation : ""}` : rec.type;
30448
+ const at2 = typeof rec.timestamp === "string" ? rec.timestamp : void 0;
30449
+ for (const block of raw2.match(/<task-notification>[\s\S]*?<\/task-notification>/g) ?? []) {
30450
+ const event = block.match(/<event>([\s\S]*?)<\/event>/)?.[1];
30451
+ const taskId = block.match(/<task-id>([^<]*)<\/task-id>/)?.[1]?.trim();
30452
+ if (event === void 0 || !taskId) continue;
30453
+ const text2 = unescapeNotificationText(event).replace(/\s+$/, "");
30454
+ if (!text2.trim()) continue;
30455
+ const logs = state.monitorEvents ??= /* @__PURE__ */ new Map();
30456
+ let log3 = logs.get(taskId);
30457
+ if (log3) logs.delete(taskId);
30458
+ else log3 = { events: [], dropped: 0, seen: /* @__PURE__ */ new Map() };
30459
+ logs.set(taskId, log3);
30460
+ const fingerprint = createHash11("sha1").update(block).digest("hex").slice(0, 16);
30461
+ const seen = log3.seen.get(fingerprint) ?? { recorded: 0, copies: {} };
30462
+ log3.seen.delete(fingerprint);
30463
+ log3.seen.set(fingerprint, seen);
30464
+ const copies = seen.copies[carrier] ??= [];
30465
+ const name = at2 ?? `#${copies.length}`;
30466
+ if (copies.includes(name)) continue;
30467
+ copies.push(name);
30468
+ if (copies.length > seen.recorded) {
30469
+ seen.recorded = copies.length;
30470
+ insertMonitorEvent(log3, { text: capMonitorEvent(text2), ...at2 ? { at: at2 } : {} });
30471
+ }
30472
+ while (log3.seen.size > MONITOR_SEEN_MAX) {
30473
+ const oldest = log3.seen.keys().next().value;
30474
+ if (oldest === void 0) break;
30475
+ log3.seen.delete(oldest);
30476
+ }
30477
+ boundMonitorLogs(state, logs);
30478
+ }
30479
+ }
30480
+ function insertMonitorEvent(log3, event) {
30481
+ let i = log3.events.length;
30482
+ if (event.at) while (i > 0 && (log3.events[i - 1].at ?? "") > event.at) i--;
30483
+ log3.events.splice(i, 0, event);
30484
+ let chars = 0;
30485
+ for (const e9 of log3.events) chars += e9.text.length;
30486
+ while (log3.events.length > 1 && (log3.events.length > MONITOR_EVENTS_MAX || chars > MONITOR_LOG_CHARS_MAX)) {
30487
+ chars -= log3.events.shift().text.length;
30488
+ log3.dropped++;
30489
+ }
30490
+ }
30491
+ function capMonitorEvent(text2) {
30492
+ if (text2.length <= MONITOR_EVENT_CHARS_MAX) return text2;
30493
+ return `${text2.slice(0, MONITOR_EVENT_CHARS_MAX)}
30494
+ \u2026 ${text2.length - MONITOR_EVENT_CHARS_MAX} more characters not kept`;
30495
+ }
30496
+ function boundMonitorLogs(state, logs) {
30497
+ while (logs.size > MONITOR_LOGS_MAX) {
30498
+ let victim;
30499
+ for (const taskId of logs.keys()) {
30500
+ if (!isOwnMonitorTask(state, taskId)) {
30501
+ victim = taskId;
30502
+ break;
30503
+ }
30504
+ }
30505
+ victim ??= logs.keys().next().value;
30506
+ if (victim === void 0) break;
30507
+ logs.delete(victim);
30508
+ }
30509
+ }
30510
+ function isOwnMonitorTask(state, taskId) {
30511
+ for (const e9 of state.subAgents.values()) if (e9.monitor && e9.taskId === taskId) return true;
30512
+ for (const r of state.retiredShells.values()) if (r.monitor && r.taskId === taskId) return true;
30513
+ return false;
30514
+ }
30515
+ function unescapeNotificationText(text2) {
30516
+ return text2.replace(/&(lt|gt|amp|quot|apos|#39);/g, (_m, name) => NOTIFICATION_ENTITIES[name] ?? _m);
30517
+ }
30518
+ function monitorEventsOf(state, taskId) {
30519
+ const log3 = taskId ? state.monitorEvents?.get(taskId) : void 0;
30520
+ return log3 ? { events: log3.events.map((e9) => ({ ...e9 })), dropped: log3.dropped } : { events: [], dropped: 0 };
30521
+ }
30379
30522
  function trackReportDelivery(state, rec, raw2) {
30380
30523
  const modelFacing = isModelFacingCarrier(rec.type);
30381
30524
  const at2 = typeof rec.timestamp === "string" ? rec.timestamp : void 0;
@@ -30614,6 +30757,7 @@ function applyRecord(state, rec) {
30614
30757
  noteWakeTokens(state, rec.attachment?.prompt);
30615
30758
  }
30616
30759
  trackCompletions(state, rec);
30760
+ collectMonitorEvents(state, rec);
30617
30761
  trackRelayEchoes(state, rec);
30618
30762
  }
30619
30763
  function applyFinalText(state, text2) {
@@ -31057,6 +31201,7 @@ function createTailer(deps) {
31057
31201
  return deadline;
31058
31202
  }
31059
31203
  function entryLastActivity(state, e9) {
31204
+ if (e9.monitor) return e9.taskId ? state.monitorEvents?.get(e9.taskId)?.events.at(-1)?.at : void 0;
31060
31205
  const path3 = entryTranscript(state, e9);
31061
31206
  if (!path3) return void 0;
31062
31207
  const m = mtimeMs(path3);
@@ -31120,7 +31265,7 @@ function createTailer(deps) {
31120
31265
  if (e9.kind !== "shell") continue;
31121
31266
  const lastActivityAt = entryLastActivity(state, e9);
31122
31267
  const shellState = shellIsGone(e9, state.sessionId) ? "stale" : "running";
31123
- out.push({ label: e9.label, startedAt: e9.startedAt, state: shellState, id: e9.toolUseId, ...e9.taskId ? { stoppable: true, taskId: e9.taskId } : {}, ...lastActivityAt ? { lastActivityAt } : {}, ...e9.monitor ? { outputUnavailable: true } : {} });
31268
+ out.push({ label: e9.label, startedAt: e9.startedAt, state: shellState, id: e9.toolUseId, ...e9.taskId ? { stoppable: true, taskId: e9.taskId } : {}, ...lastActivityAt ? { lastActivityAt } : {}, ...e9.monitor ? { monitor: true } : {} });
31124
31269
  }
31125
31270
  return out;
31126
31271
  }
@@ -31451,10 +31596,10 @@ ${ask}`;
31451
31596
  if (!state || !registeredStateIsCurrent(state)) return void 0;
31452
31597
  const live2 = state.subAgents.get(id2);
31453
31598
  if (live2?.kind === "shell") {
31454
- return { command: live2.command, outputFile: live2.outputFile, state: state.paneDead ? "done" : "running" };
31599
+ return { command: live2.command, outputFile: live2.outputFile, state: state.paneDead ? "done" : "running", ...live2.monitor ? { monitor: monitorEventsOf(state, live2.taskId) } : {} };
31455
31600
  }
31456
31601
  const dead = state.retiredShells.get(id2);
31457
- if (dead) return { command: dead.command, outputFile: dead.outputFile, state: "done" };
31602
+ if (dead) return { command: dead.command, outputFile: dead.outputFile, state: "done", ...dead.monitor ? { monitor: monitorEventsOf(state, dead.taskId) } : {} };
31458
31603
  return void 0;
31459
31604
  }
31460
31605
  function dismissOp(slug, id2) {
@@ -31551,22 +31696,22 @@ ${ask}`;
31551
31696
  { cwds: [...cwds], nowMs, freshMs: FOREIGN_FRESH_MS, exclude: registeredIds(), max: FOREIGN_MAX },
31552
31697
  home
31553
31698
  );
31554
- const names = found.length ? readCodexThreadNames(home) : void 0;
31555
- return found.map((f) => ({ ...f, ...names?.get(f.id) ? { title: names.get(f.id) } : {} }));
31699
+ const names2 = found.length ? readCodexThreadNames(home) : void 0;
31700
+ return found.map((f) => ({ ...f, ...names2?.get(f.id) ? { title: names2.get(f.id) } : {} }));
31556
31701
  } catch {
31557
31702
  return [];
31558
31703
  }
31559
31704
  }
31560
31705
  function scanForeign(nowMs) {
31561
- let names;
31706
+ let names2;
31562
31707
  try {
31563
- names = readdirSync6(logDir);
31708
+ names2 = readdirSync6(logDir);
31564
31709
  } catch {
31565
31710
  return [];
31566
31711
  }
31567
31712
  const registered = registeredIds();
31568
31713
  const found = [];
31569
- for (const name of names) {
31714
+ for (const name of names2) {
31570
31715
  if (name.startsWith(".") || !name.endsWith(".jsonl")) continue;
31571
31716
  const id2 = name.slice(0, -".jsonl".length);
31572
31717
  if (!id2 || registered.has(id2)) continue;
@@ -32576,7 +32721,7 @@ function landsAfterRead(eventAt, lastReadAt) {
32576
32721
  if (!Number.isFinite(e9) || !Number.isFinite(r)) return true;
32577
32722
  return e9 > r;
32578
32723
  }
32579
- var IDLE_BACKSTOP_MS, RUNTIME_CHASE_MAX, POLL_MS3, MAX_PRIME_ROWS_PER_TICK, PRIME_BUDGET_MS, TRANSCRIPT_READ_WINDOW, EMPTY_BUFFER, LINE_FAULT_LOG_CAP, MAX_POLL_MS, QUIET_POLL_MS, DORMANT_SWEEP_MS, SUBAGENT_STALE_MS, SUSPENDED_GAP_MS, BASH_TIMEOUT_CEILING_MS, PENDING_CALL_TAIL_BYTES, SHELL_PROBE_TTL_MS, SHELL_PROBE_GRACE_MS, SHELL_PROBE_TTL_MAX_MS, SHELL_PROBE_TTL_AGE_SHARE, execFileAsync, shellProbeExec, FOREIGN_FRESH_MS, FOREIGN_MAX, FOREIGN_SCAN_EVERY, CACHE_FLUSH_MS, PRIME_PROGRESS_EVERY, DISCOVER_RETRY_MS, DISCOVER_RETRY_MAX_MS, RETAINED_SUBAGENTS_MAX, RETAINED_SHELLS_MAX, QUESTION_SIGHTINGS_MAX, DESCENDANT_TERMINALS_MAX, PENDING_RESUMES_MAX, PENDING_SHELLS_MAX, LIVE_TOOLS_MAX, RESUME_REPLAY_SLACK_MS, FIRST_USER_TEXT_MAX, ASSISTANT_LINE_MAX, QUESTION_BLOCK_RE, FENCE_BODY_MAX, LOCAL_COMMAND_RECEIPT, QUEUED_HUMAN_TEXTS_MAX, WAKE_TOKEN_RE, WAKE_TOKENS_MAX, LAUNCH_ACK_RE, AUTO_BACKGROUND_ACK_RE, ASYNC_AGENT_ACK_RE, FOLDED_TERMINALS_MAX, AGENT_TRANSCRIPT_PATH_RE, DESCENDANT_SIDECAR_MAX, DESCENDANT_NOTIFY_GRACE_MS, MAX_OWNED_TOOL_USE_IDS, humanStepsAtRest, unlistedAtRest, STOP_CLEARING_KINDS, FRIZZ_HOOK_FILES, FRIZZ_HOOK_COMMAND, HOOK_FAILURE_REPORT_EVERY_MS, BROKER_LIVENESS_TTL_MS, UNRESTORED_TAIL_FIELDS;
32724
+ var IDLE_BACKSTOP_MS, RUNTIME_CHASE_MAX, POLL_MS3, MAX_PRIME_ROWS_PER_TICK, PRIME_BUDGET_MS, TRANSCRIPT_READ_WINDOW, EMPTY_BUFFER, LINE_FAULT_LOG_CAP, MAX_POLL_MS, QUIET_POLL_MS, DORMANT_SWEEP_MS, SUBAGENT_STALE_MS, SUSPENDED_GAP_MS, BASH_TIMEOUT_CEILING_MS, PENDING_CALL_TAIL_BYTES, SHELL_PROBE_TTL_MS, SHELL_PROBE_GRACE_MS, SHELL_PROBE_TTL_MAX_MS, SHELL_PROBE_TTL_AGE_SHARE, execFileAsync, shellProbeExec, FOREIGN_FRESH_MS, FOREIGN_MAX, FOREIGN_SCAN_EVERY, CACHE_FLUSH_MS, PRIME_PROGRESS_EVERY, DISCOVER_RETRY_MS, DISCOVER_RETRY_MAX_MS, RETAINED_SUBAGENTS_MAX, RETAINED_SHELLS_MAX, MONITOR_LOGS_MAX, MONITOR_EVENTS_MAX, MONITOR_EVENT_CHARS_MAX, MONITOR_LOG_CHARS_MAX, MONITOR_SEEN_MAX, QUESTION_SIGHTINGS_MAX, DESCENDANT_TERMINALS_MAX, PENDING_RESUMES_MAX, PENDING_SHELLS_MAX, LIVE_TOOLS_MAX, RESUME_REPLAY_SLACK_MS, FIRST_USER_TEXT_MAX, ASSISTANT_LINE_MAX, QUESTION_BLOCK_RE, FENCE_BODY_MAX, LOCAL_COMMAND_RECEIPT, QUEUED_HUMAN_TEXTS_MAX, WAKE_TOKEN_RE, WAKE_TOKENS_MAX, LAUNCH_ACK_RE, AUTO_BACKGROUND_ACK_RE, ASYNC_AGENT_ACK_RE, FOLDED_TERMINALS_MAX, AGENT_TRANSCRIPT_PATH_RE, DESCENDANT_SIDECAR_MAX, DESCENDANT_NOTIFY_GRACE_MS, NOTIFICATION_ENTITIES, MAX_OWNED_TOOL_USE_IDS, humanStepsAtRest, unlistedAtRest, STOP_CLEARING_KINDS, FRIZZ_HOOK_FILES, FRIZZ_HOOK_COMMAND, HOOK_FAILURE_REPORT_EVERY_MS, BROKER_LIVENESS_TTL_MS, UNRESTORED_TAIL_FIELDS;
32580
32725
  var init_tailer = __esm({
32581
32726
  "packages/server/src/tailer.ts"() {
32582
32727
  "use strict";
@@ -32639,6 +32784,11 @@ var init_tailer = __esm({
32639
32784
  DISCOVER_RETRY_MAX_MS = 15 * 6e4;
32640
32785
  RETAINED_SUBAGENTS_MAX = 20;
32641
32786
  RETAINED_SHELLS_MAX = 20;
32787
+ MONITOR_LOGS_MAX = 8;
32788
+ MONITOR_EVENTS_MAX = 200;
32789
+ MONITOR_EVENT_CHARS_MAX = 4e3;
32790
+ MONITOR_LOG_CHARS_MAX = 48e3;
32791
+ MONITOR_SEEN_MAX = 400;
32642
32792
  QUESTION_SIGHTINGS_MAX = 32;
32643
32793
  DESCENDANT_TERMINALS_MAX = 512;
32644
32794
  PENDING_RESUMES_MAX = 32;
@@ -32660,6 +32810,7 @@ var init_tailer = __esm({
32660
32810
  AGENT_TRANSCRIPT_PATH_RE = /[\\/]subagents[\\/]agent-[\w-]+\.jsonl$/;
32661
32811
  DESCENDANT_SIDECAR_MAX = 512;
32662
32812
  DESCENDANT_NOTIFY_GRACE_MS = 5e3;
32813
+ NOTIFICATION_ENTITIES = { lt: "<", gt: ">", amp: "&", quot: '"', apos: "'", "#39": "'" };
32663
32814
  MAX_OWNED_TOOL_USE_IDS = 25e3;
32664
32815
  humanStepsAtRest = /* @__PURE__ */ new WeakMap();
32665
32816
  unlistedAtRest = /* @__PURE__ */ new WeakMap();
@@ -38243,14 +38394,14 @@ function leaseRuntime(bin, role, pid = process.pid) {
38243
38394
  }
38244
38395
  function liveRuntimeLeases(versionDir) {
38245
38396
  const dir = join35(versionDir, LEASES_DIR);
38246
- let names;
38397
+ let names2;
38247
38398
  try {
38248
- names = readdirSync8(dir);
38399
+ names2 = readdirSync8(dir);
38249
38400
  } catch {
38250
38401
  return [];
38251
38402
  }
38252
38403
  const live2 = [];
38253
- for (const name of names) {
38404
+ for (const name of names2) {
38254
38405
  if (!name.endsWith(".json")) continue;
38255
38406
  const path3 = join35(dir, name);
38256
38407
  let lease;
@@ -39461,7 +39612,7 @@ function mcpField(id2, raw2, required) {
39461
39612
  if (values.length === 0 || values.length > 64 || values.some((value) => typeof value !== "string")) {
39462
39613
  throw new RpcProtocolError(-32602, "MCP select field has unsupported options");
39463
39614
  }
39464
- const names = Array.isArray(schema.enumNames) ? schema.enumNames : null;
39615
+ const names2 = Array.isArray(schema.enumNames) ? schema.enumNames : null;
39465
39616
  const oneOf = Array.isArray(schema.oneOf) ? schema.oneOf : null;
39466
39617
  return {
39467
39618
  ...base,
@@ -39469,7 +39620,7 @@ function mcpField(id2, raw2, required) {
39469
39620
  options: values.map((value, index) => ({
39470
39621
  value,
39471
39622
  label: cleanText(
39472
- typeof names?.[index] === "string" ? names[index] : oneOf?.[index] && typeof oneOf[index] === "object" && typeof oneOf[index].title === "string" ? oneOf[index].title : value,
39623
+ typeof names2?.[index] === "string" ? names2[index] : oneOf?.[index] && typeof oneOf[index] === "object" && typeof oneOf[index].title === "string" ? oneOf[index].title : value,
39473
39624
  160,
39474
39625
  value
39475
39626
  )
@@ -45427,7 +45578,7 @@ function readQuestionFences(storage, input) {
45427
45578
  if (memo3 && memo3.sightings === input.sightings && memo3.sightingCount === input.sightings.length && memo3.rows === bucket && memo3.spawnedAt === input.spawnedAt && memo3.autonomousGoal === input.autonomousGoal && memo3.childOf === childOf) return memo3.out;
45428
45579
  memos.delete(input.slug);
45429
45580
  const rows = (bucket ?? []).map((row) => ({ ...row }));
45430
- const names = /* @__PURE__ */ new Map();
45581
+ const names2 = /* @__PURE__ */ new Map();
45431
45582
  const heldAt = /* @__PURE__ */ new Map();
45432
45583
  const autonomousFault = input.autonomousGoal ? `this thread is running autonomously, so the question was not asked \u2014 decide it yourself and proceed, and say which way you went in your write-up. Its standing instruction is: ${input.autonomousGoal.replace(/\s+/g, " ").slice(0, 400)}` : void 0;
45433
45584
  const childFault = input.childOf ? `this is a child thread of \xAB${input.childOf.title}\xBB (\`${input.childOf.slug}\`), so the question was not asked \u2014 a decision goes to your PARENT, not the human: write it in your handoff's prose and rest with an \`\`\`awaiting fence carrying \`status: needs_input\`. Frizz hands that handoff to the parent, which answers you or takes it to the human. Only a \`kind: secret\` question still reaches the human directly` : void 0;
@@ -45435,7 +45586,7 @@ function readQuestionFences(storage, input) {
45435
45586
  const atMs = Date.parse(sighting.at);
45436
45587
  if (!Number.isFinite(atMs) || atMs < REGISTER_FROM_MS) continue;
45437
45588
  const at2 = sighting.at;
45438
- const index = handleIndex(rows, atMs, names);
45589
+ const index = handleIndex(rows, atMs, names2);
45439
45590
  const reusable = atMs >= IDS_REUSABLE_FROM_MS;
45440
45591
  const assembled = assembleQuestionFences(questionFenceBlocks(sighting.text).map((b) => b.read));
45441
45592
  const fault = (id2, text2) => out.faults.push({ at: at2, id: id2, faults: [text2] });
@@ -46162,13 +46313,13 @@ function monitorOutputSink(path3, maxBytes = MONITOR_OUTPUT_MAX_BYTES, nowIso =
46162
46313
  };
46163
46314
  }
46164
46315
  function pruneMonitorOutputs(dir, rowOf, nowMs, keepMs = MONITOR_OUTPUT_KEEP_MS) {
46165
- let names;
46316
+ let names2;
46166
46317
  try {
46167
- names = readdirSync10(dir);
46318
+ names2 = readdirSync10(dir);
46168
46319
  } catch {
46169
46320
  return [];
46170
46321
  }
46171
- return names.flatMap((name) => {
46322
+ return names2.flatMap((name) => {
46172
46323
  const id2 = /^(cmw_[A-Za-z0-9_-]+)\.log$/.exec(name)?.[1];
46173
46324
  if (!id2) return [];
46174
46325
  const row = rowOf(id2);
@@ -47052,13 +47203,20 @@ var init_child_threads = __esm({
47052
47203
  import { readFileSync as readFileSync29 } from "node:fs";
47053
47204
  import { homedir as homedir16 } from "node:os";
47054
47205
  import { join as join42 } from "node:path";
47055
- function readJsonObject(path3) {
47206
+ function readJsonObject(path3, invalid) {
47207
+ let text2;
47056
47208
  try {
47057
- const parsed = JSON.parse(readFileSync29(path3, "utf8"));
47058
- return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : void 0;
47209
+ text2 = readFileSync29(path3, "utf8");
47059
47210
  } catch {
47060
47211
  return void 0;
47061
47212
  }
47213
+ try {
47214
+ const parsed = JSON.parse(text2);
47215
+ if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
47216
+ } catch {
47217
+ }
47218
+ invalid?.push(path3);
47219
+ return void 0;
47062
47220
  }
47063
47221
  function objectField(source, key) {
47064
47222
  const value = source?.[key];
@@ -47156,28 +47314,36 @@ function userScopeRemoteServers(account, cwd, env) {
47156
47314
  return out;
47157
47315
  }
47158
47316
  function projectMcpServers(cwd, options = {}) {
47317
+ return projectMcpServerPlan(cwd, options).servers;
47318
+ }
47319
+ function projectMcpServerPlan(cwd, options = {}) {
47159
47320
  const env = options.env ?? process.env;
47160
47321
  const home = options.home ?? homedir16();
47161
47322
  const configOverride = options.claudeConfigDir ?? (env.CLAUDE_CONFIG_DIR?.trim() ? env.CLAUDE_CONFIG_DIR.trim() : void 0);
47162
47323
  const accountFile = configOverride ? join42(configOverride, ".claude.json") : join42(home, ".claude.json");
47163
47324
  const userSettingsFile = join42(configOverride ?? join42(home, ".claude"), "settings.json");
47164
- const account = readJsonObject(accountFile);
47165
- const out = userScopeRemoteServers(account, cwd, env);
47166
- const declared = objectField(readJsonObject(join42(cwd, ".mcp.json")), "mcpServers");
47167
- if (!declared) return out;
47325
+ const invalid = [];
47326
+ const account = readJsonObject(accountFile, invalid);
47327
+ const servers = userScopeRemoteServers(account, cwd, env);
47328
+ const unapproved = [];
47329
+ const declared = objectField(readJsonObject(join42(cwd, ".mcp.json"), invalid), "mcpServers");
47330
+ if (!declared) return { servers, unapproved, invalid };
47168
47331
  const approval = collectApproval([
47169
- readJsonObject(join42(cwd, ".claude", "settings.json")),
47170
- readJsonObject(join42(cwd, ".claude", "settings.local.json")),
47171
- readJsonObject(userSettingsFile),
47332
+ readJsonObject(join42(cwd, ".claude", "settings.json"), invalid),
47333
+ readJsonObject(join42(cwd, ".claude", "settings.local.json"), invalid),
47334
+ readJsonObject(userSettingsFile, invalid),
47172
47335
  objectField(objectField(account, "projects"), cwd)
47173
47336
  ]);
47174
47337
  for (const [name, raw2] of Object.entries(declared)) {
47175
47338
  if (approval.disabled.has(name)) continue;
47176
- if (!approval.all && !approval.enabled.has(name)) continue;
47339
+ if (!approval.all && !approval.enabled.has(name)) {
47340
+ unapproved.push(name);
47341
+ continue;
47342
+ }
47177
47343
  const server = normalizeMcpServer(raw2, env);
47178
- if (server) out[name] = server;
47344
+ if (server) servers[name] = server;
47179
47345
  }
47180
- return out;
47346
+ return { servers, unapproved, invalid };
47181
47347
  }
47182
47348
  function workerMcpServers(project, frizz) {
47183
47349
  return { ...project ?? {}, ...frizz ?? {} };
@@ -47356,6 +47522,7 @@ ${WORKTREES_HARNESS}` : WORKTREES,
47356
47522
  VISUAL_EVIDENCE,
47357
47523
  MARKDOWN_COMPONENTS,
47358
47524
  REGISTERED_LINKS,
47525
+ MCP_RELOAD[kind] ?? null,
47359
47526
  QUALITY_BAR,
47360
47527
  TOKEN_ECONOMY,
47361
47528
  QUESTIONS,
@@ -47367,7 +47534,7 @@ ${WORKTREES_HARNESS}` : WORKTREES,
47367
47534
  out = out.replaceAll("{{FRIZZ_MONITORS_DIR}}", opts.monitorsDir?.trim() || MONITORS_DIR_FALLBACK);
47368
47535
  return out;
47369
47536
  }
47370
- var COMMANDS_KEY_CLAUDE, COMMANDS_FOR_CLAUDE, COMMANDS_CI_CLAUDE, NO_COMMAND_WATCHES, COMMAND_WATCH_WAITS, NO_COMMAND_WATCH_WAITS, INLINE, INTRO, DEFER, OPENING, ACTIVITY_CAPTIONS, FRIZZCTL, SIGNALS, AGENT_COMPLETION, VISUAL_EVIDENCE, MARKDOWN_COMPONENTS, REGISTERED_LINKS, QUALITY_BAR, TOKEN_ECONOMY, QUESTIONS, STOP_CRITERION, TRIVIAL_PROMPTS, THREAD_NAME, SCRATCHPAD, WORKTREES, WORKTREES_HARNESS, BACKEND, CLAUDE_INTERRUPTED_CALL, SPAWN_THREAD, CHILD_THREADS, STEER_THREADS, THREAD_EXECUTION, MONITORS_DIR_FALLBACK;
47537
+ var COMMANDS_KEY_CLAUDE, COMMANDS_FOR_CLAUDE, COMMANDS_CI_CLAUDE, NO_COMMAND_WATCHES, COMMAND_WATCH_WAITS, NO_COMMAND_WATCH_WAITS, INLINE, INTRO, DEFER, OPENING, ACTIVITY_CAPTIONS, FRIZZCTL, SIGNALS, AGENT_COMPLETION, VISUAL_EVIDENCE, MARKDOWN_COMPONENTS, REGISTERED_LINKS, MCP_RELOAD, QUALITY_BAR, TOKEN_ECONOMY, QUESTIONS, STOP_CRITERION, TRIVIAL_PROMPTS, THREAD_NAME, SCRATCHPAD, WORKTREES, WORKTREES_HARNESS, BACKEND, CLAUDE_INTERRUPTED_CALL, SPAWN_THREAD, CHILD_THREADS, STEER_THREADS, THREAD_EXECUTION, MONITORS_DIR_FALLBACK;
47371
47538
  var init_workerPrompt = __esm({
47372
47539
  "packages/server/src/workerPrompt.ts"() {
47373
47540
  "use strict";
@@ -47383,7 +47550,7 @@ var init_workerPrompt = __esm({
47383
47550
  \`frizzctl monitor\` where Frizz allows it`;
47384
47551
  NO_COMMAND_WATCHES = { "COMMANDS_KEY": "", "COMMANDS_FOR": "", "COMMANDS_CI": "" };
47385
47552
  COMMAND_WATCH_WAITS = {
47386
- "WAIT_ANY_CONDITION": `\`frizzctl monitor add "<check that exits 0 once it holds>" --every 5m --for 6h\`, then rest on
47553
+ "WAIT_ANY_CONDITION": `\`frizzctl monitor add "<check that exits 0 once it holds>" --description "<what>" --every 5m --for 6h\`, then rest on
47387
47554
  its id (\`monitors: [cmw_\u2026]\`) with \`status: watching\`. Not a polling loop in a background shell
47388
47555
  and not a sub-agent that owns the wait: either keeps your process tree alive (~250 MB) for the whole
47389
47556
  wait, and a thread holding one can never be hibernated, while the server-run check holds nothing.
@@ -48015,6 +48182,22 @@ prompt box (\`1 link\`, \`2 files\`) that lists it on hover, the side rail in fu
48015
48182
  links under \u22EF on a phone. Reuse the label to update its destination;
48016
48183
  read registrations with \`frizzctl activity\` and remove one with \`frizzctl unlink <id>\`. Register existing files, using an
48017
48184
  absolute path outside the project root. A saved reference is not a running process or a completion gate.`;
48185
+ MCP_RELOAD = {
48186
+ claude: `## Adding an MCP server to this thread
48187
+
48188
+ This thread read the project's MCP configuration when its session started, and nothing watches the
48189
+ files. To add, change or remove a server, edit the project's \`.mcp.json\` (a server there loads once its
48190
+ name is in \`enabledMcpjsonServers\` in \`.claude/settings.local.json\`), then run \`frizzctl mcp reload\`.
48191
+ It connects the change in this thread and in every other running thread of the project, with no restart,
48192
+ and you can call the new server's tools in the same turn. \`frizzctl mcp --help\` has the details.`,
48193
+ codex: `## Adding an MCP server to this thread
48194
+
48195
+ This thread read the project's MCP configuration when its session started, and nothing watches the
48196
+ files. To add, change or remove a server, edit an \`[mcp_servers.<name>]\` table in the project's
48197
+ \`.codex/config.toml\` (Codex reads it only for a project it trusts), then run \`frizzctl mcp reload\`. It
48198
+ connects the change in every running Codex thread of the project, with no restart, and you can call the
48199
+ new server's tools in the same turn. \`frizzctl mcp --help\` has the details.`
48200
+ };
48018
48201
  QUALITY_BAR = `## Quality bar
48019
48202
 
48020
48203
  - Verify behavior end-to-end before calling anything done. A green suite over a stubbed implementation
@@ -48567,10 +48750,11 @@ them when the human asks for a loop:
48567
48750
  \`frizzctl goal stop\` when the work it drives is finished \u2014 one left armed on a finished thread wakes it
48568
48751
  forever, and the human can also switch it off from the thread's Goal control. Replying \`ALLDONE\` on its own
48569
48752
  line stops it too, but that permanently stalls the run: a last resort, only when nothing is left.
48570
- - \`frizzctl timer\` is your own alarm clock: \`frizzctl timer set\` with \`--prompt\` plus \`--in-seconds\` or an
48571
- ISO \`--at\`, delivered exactly once, mid-turn, and then gone. You may hold MANY at once; \`frizzctl timer list\`
48572
- shows them and \`frizzctl timer cancel <id>\` withdraws one. Use it to come back to something at a specific
48573
- time \u2014 never to poll something a background shell, a sub-agent or a monitor can wake you for.`,
48753
+ - \`frizzctl timer\` is your own alarm clock: \`frizzctl timer set\` with \`--prompt\`, a \`--description\`
48754
+ naming it for the human, and \`--in-seconds\` or an ISO \`--at\`, delivered exactly once, mid-turn, and
48755
+ then gone. You may hold MANY at once; \`frizzctl timer list\` shows them and \`frizzctl timer cancel <id>\`
48756
+ withdraws one. Use it to come back to something at a specific time \u2014 never to poll something a
48757
+ background shell, a sub-agent or a monitor can wake you for.`,
48574
48758
  // § Bounded native delegation describes the NATIVE `spawn_agent` surface, which frizz does not
48575
48759
  // configure at all. The only `-c` override frizz puts on a codex app-server is
48576
48760
  // `default_tools_approval_mode` (backend/codex-mcp.ts `codexAppServerArgv`, the single argv builder
@@ -49134,10 +49318,28 @@ var init_opencode_types = __esm({
49134
49318
 
49135
49319
  // packages/server/src/backend/claude-broker-client.ts
49136
49320
  import net from "node:net";
49321
+ function mcpReloadOf(value) {
49322
+ const raw2 = value && typeof value === "object" ? value : {};
49323
+ const errors = {};
49324
+ if (raw2.errors && typeof raw2.errors === "object" && !Array.isArray(raw2.errors)) {
49325
+ for (const [name, message] of Object.entries(raw2.errors).slice(0, 256)) {
49326
+ if (typeof message === "string") errors[name] = message;
49327
+ }
49328
+ }
49329
+ return {
49330
+ added: names(raw2.added),
49331
+ removed: names(raw2.removed),
49332
+ changed: names(raw2.changed),
49333
+ unchanged: typeof raw2.unchanged === "number" && Number.isInteger(raw2.unchanged) && raw2.unchanged >= 0 ? raw2.unchanged : 0,
49334
+ errors,
49335
+ unapproved: names(raw2.unapproved)
49336
+ };
49337
+ }
49137
49338
  function connectClaudeBroker(socketPath, handlers, options = {}) {
49138
49339
  const retryDelayMs = options.retryDelayMs ?? 250;
49139
49340
  const cancelTimeoutMs = options.cancelTimeoutMs ?? 1e4;
49140
49341
  const renameTimeoutMs = options.renameTimeoutMs ?? 3e4;
49342
+ const mcpReloadTimeoutMs = options.mcpReloadTimeoutMs ?? 9e4;
49141
49343
  let sock = null;
49142
49344
  let closed = false;
49143
49345
  let buf = "";
@@ -49229,7 +49431,8 @@ function connectClaudeBroker(socketPath, handlers, options = {}) {
49229
49431
  break;
49230
49432
  }
49231
49433
  case "mcp-status-result":
49232
- case "mcp-reconnect-result": {
49434
+ case "mcp-reconnect-result":
49435
+ case "mcp-reload-result": {
49233
49436
  const entry = pendingMcp.get(frame.requestId);
49234
49437
  if (!entry) break;
49235
49438
  pendingMcp.delete(frame.requestId);
@@ -49378,6 +49581,9 @@ function connectClaudeBroker(socketPath, handlers, options = {}) {
49378
49581
  // longer deadline.
49379
49582
  mcpServerStatus: () => mcpRequest("mcp-status", {}, cancelTimeoutMs).then((frame) => (Array.isArray(frame.servers) ? frame.servers : []).filter((s) => typeof s?.name === "string" && typeof s?.status === "string")),
49380
49583
  reconnectMcpServer: (name) => mcpRequest("mcp-reconnect", { name }, renameTimeoutMs).then(() => void 0),
49584
+ // The longest deadline of the MCP verbs: a reload waits on every new server's handshake, and a stdio
49585
+ // server the lazy host has never seen starts its real command to answer it (`npx` resolving a package).
49586
+ reloadMcpServers: () => mcpRequest("mcp-reload", {}, mcpReloadTimeoutMs).then((frame) => mcpReloadOf(frame.reload)),
49381
49587
  // The longer deadline: a re-title is a provider round trip, not local bookkeeping.
49382
49588
  renameSession: (description) => new Promise((resolve17, reject) => {
49383
49589
  if (closed) {
@@ -49430,11 +49636,12 @@ function connectClaudeBroker(socketPath, handlers, options = {}) {
49430
49636
  }
49431
49637
  };
49432
49638
  }
49433
- var SKILL_SOURCES;
49639
+ var names, SKILL_SOURCES;
49434
49640
  var init_claude_broker_client = __esm({
49435
49641
  "packages/server/src/backend/claude-broker-client.ts"() {
49436
49642
  "use strict";
49437
49643
  init_src();
49644
+ names = (value) => Array.isArray(value) ? value.filter((v4) => typeof v4 === "string").slice(0, 256) : [];
49438
49645
  SKILL_SOURCES = new Set(ThreadSkillSource.options);
49439
49646
  }
49440
49647
  });
@@ -50090,6 +50297,23 @@ function createClaudeAgentBrokerBridge(deps) {
50090
50297
  const results = await Promise.allSettled(held.map((session) => session.client.reconnectMcpServer(name)));
50091
50298
  return results.filter((result) => result.status === "fulfilled").length;
50092
50299
  },
50300
+ async reloadMcpServersEverywhere() {
50301
+ const outcomes = [];
50302
+ await Promise.all([...sessions.entries()].map(async ([threadSlug, session]) => {
50303
+ if (!holdsLiveDaemon(session)) return;
50304
+ const record = liveBrokerRecord(claudeBrokerRecordPath(deps.stateDir, session.sessionId));
50305
+ if (!record?.capabilities?.includes(CLAUDE_BROKER_CAPABILITY_MCP_RELOAD)) {
50306
+ outcomes.push({ threadSlug, outcome: "stale" });
50307
+ return;
50308
+ }
50309
+ try {
50310
+ outcomes.push({ threadSlug, outcome: "reloaded", reload: await session.client.reloadMcpServers() });
50311
+ } catch (error) {
50312
+ outcomes.push({ threadSlug, outcome: "failed", error: error instanceof Error ? error.message : String(error) });
50313
+ }
50314
+ }));
50315
+ return outcomes;
50316
+ },
50093
50317
  async warmUp() {
50094
50318
  let owned;
50095
50319
  try {
@@ -51411,7 +51635,7 @@ function fenceWatchViews(slug, tele, fenceAt, github = {}, registered = [], arme
51411
51635
  createdAt: t.createdAt,
51412
51636
  // Always present, unlike the github half above: a timer that exists is fully known — there is no
51413
51637
  // poller to wait for. The prompt is the row's NAME client-side (a `tmr_…` id names nothing).
51414
- timer: { fireAt: t.fireAt, prompt: t.prompt }
51638
+ timer: { fireAt: t.fireAt, prompt: t.prompt, ...t.description ? { description: t.description } : {} }
51415
51639
  });
51416
51640
  }
51417
51641
  for (const w of armedCommands) {
@@ -51427,6 +51651,7 @@ function fenceWatchViews(slug, tele, fenceAt, github = {}, registered = [], arme
51427
51651
  // `frizzctl monitor` name one cadence and one last check.
51428
51652
  command: {
51429
51653
  command: w.command,
51654
+ ...w.description ? { description: w.description } : {},
51430
51655
  every: formatElapsed(w.every_ms),
51431
51656
  expiresAt: new Date(w.expires_at).toISOString(),
51432
51657
  runs: w.runs,
@@ -51734,6 +51959,7 @@ function sessionThreadView(projectDir, storage, row, rawTele, registeredLegacyTe
51734
51959
  const armedTimers = (registries.timers.get(row.slug) ?? []).map((t) => ({
51735
51960
  id: t.id,
51736
51961
  prompt: t.prompt,
51962
+ description: t.description,
51737
51963
  fireAt: new Date(t.fire_at).toISOString(),
51738
51964
  createdAt: new Date(t.created_at).toISOString()
51739
51965
  }));
@@ -52744,9 +52970,9 @@ function readSignOffFaults(rest) {
52744
52970
  });
52745
52971
  return { ...none, missing };
52746
52972
  }
52747
- function unique(names) {
52973
+ function unique(names2) {
52748
52974
  const seen = /* @__PURE__ */ new Set();
52749
- return names.filter((n) => {
52975
+ return names2.filter((n) => {
52750
52976
  const k4 = n.toLowerCase();
52751
52977
  if (seen.has(k4)) return false;
52752
52978
  seen.add(k4);
@@ -53706,7 +53932,7 @@ function runConclusion(run4) {
53706
53932
  return typeof run4.conclusion === "string" ? run4.conclusion.toUpperCase() : void 0;
53707
53933
  }
53708
53934
  function gatedWorkflowNames(runs = [], cap = 8) {
53709
- const names = [];
53935
+ const names2 = [];
53710
53936
  const seen = /* @__PURE__ */ new Set();
53711
53937
  for (const run4 of Array.isArray(runs) ? runs : []) {
53712
53938
  if (!run4 || typeof run4 !== "object") continue;
@@ -53714,32 +53940,36 @@ function gatedWorkflowNames(runs = [], cap = 8) {
53714
53940
  const name = (run4.workflowName ?? run4.name)?.trim();
53715
53941
  if (!name || seen.has(name)) continue;
53716
53942
  seen.add(name);
53717
- names.push(name);
53943
+ names2.push(name);
53718
53944
  }
53719
- return { names: names.slice(0, cap), total: names.length };
53945
+ return { names: names2.slice(0, cap), total: names2.length };
53720
53946
  }
53721
53947
  function failedCheckNames(rollup, runs = [], cap = 8) {
53722
- const names = [];
53948
+ const names2 = [];
53723
53949
  const seen = /* @__PURE__ */ new Set();
53724
53950
  const push = (raw2) => {
53725
53951
  const name = raw2?.trim();
53726
53952
  if (!name || seen.has(name)) return;
53727
53953
  seen.add(name);
53728
- names.push(name);
53954
+ names2.push(name);
53729
53955
  };
53956
+ const named = /* @__PURE__ */ new Set();
53730
53957
  for (const c of Array.isArray(rollup) ? rollup : []) {
53731
53958
  if (!c || typeof c !== "object") continue;
53732
53959
  if (!rollupEntryFailed(typeof c.conclusion === "string" ? c.conclusion : void 0, typeof c.state === "string" ? c.state : void 0)) continue;
53733
53960
  push(c.name ?? c.context ?? c.workflowName);
53961
+ if (c.workflowName?.trim()) named.add(c.workflowName.trim());
53734
53962
  }
53735
53963
  for (const run4 of Array.isArray(runs) ? runs : []) {
53736
53964
  if (!run4 || typeof run4 !== "object") continue;
53737
53965
  const conclusion = runConclusion(run4);
53738
53966
  if (conclusion === "ACTION_REQUIRED") continue;
53739
53967
  if (!rollupEntryFailed(conclusion, void 0)) continue;
53740
- push(run4.workflowName ?? run4.name);
53968
+ const name = (run4.workflowName ?? run4.name)?.trim();
53969
+ if (name && named.has(name)) continue;
53970
+ push(name);
53741
53971
  }
53742
- return { names: names.slice(0, cap), omitted: Math.max(0, names.length - cap) };
53972
+ return { names: names2.slice(0, cap), omitted: Math.max(0, names2.length - cap) };
53743
53973
  }
53744
53974
  function mostSpecificOffMergePath(paths) {
53745
53975
  return paths.reduce(
@@ -55020,7 +55250,8 @@ ${clock}`;
55020
55250
  // the formatter, so a folded-forward report says exactly what its own poll saw and no more.
55021
55251
  skipped: Number(c.skipped) || 0,
55022
55252
  gated: Number(c.gated) || 0,
55023
- gating: Array.isArray(c.gating) ? c.gating.filter((x) => typeof x === "string") : []
55253
+ gating: Array.isArray(c.gating) ? c.gating.filter((x) => typeof x === "string") : [],
55254
+ ...typeof c.running === "number" ? { running: c.running } : {}
55024
55255
  } : void 0;
55025
55256
  const changes = Array.isArray(h2.changes) ? h2.changes.filter((x) => typeof x === "string") : void 0;
55026
55257
  return {
@@ -55063,6 +55294,7 @@ ${clock}`;
55063
55294
  return {
55064
55295
  seen,
55065
55296
  checks: typeof parsed.checks === "string" ? parsed.checks : void 0,
55297
+ ...typeof parsed.running === "boolean" ? { running: parsed.running } : {},
55066
55298
  report: Number(parsed.report) || 0,
55067
55299
  ...held ? { held } : {},
55068
55300
  ...typeof parsed.merge === "string" ? { merge: parsed.merge } : {},
@@ -55224,6 +55456,7 @@ ${clock}`;
55224
55456
  const terminal = st && (st.checks === "passing" || st.checks === "failing") ? st.checks : st && st.gated > 0 ? "gated" : void 0;
55225
55457
  const stamp = terminal !== void 0 ? `${st?.head ?? "?"}:${terminal}:${st?.failureSig ?? ""}` : void 0;
55226
55458
  const checksChanged = stamp !== void 0 && cursor.checks !== stamp && !(terminal === "gated" && stampVerdict(cursor.checks) === "gated");
55459
+ const ciSettled = terminal === "failing" && cursor.checks === stamp && cursor.running === true && st.running === 0;
55227
55460
  const seen = new Set(cursor.seen);
55228
55461
  const firstPoll = w.cursor === null;
55229
55462
  const newestFirst = [...acts ?? []].sort((a, b) => {
@@ -55260,6 +55493,8 @@ ${clock}`;
55260
55493
  // The STAMP, so the next poll compares against the commit as well as the colour. A verdict taken
55261
55494
  // back was never read, so it stops counting as said: a force-push back to that commit reports it.
55262
55495
  checks: stamp ?? (outrun ? void 0 : cursor.checks),
55496
+ // Whether checks were still running under that stamp, which travels with it.
55497
+ ...stamp !== void 0 ? { running: st.running > 0 } : !outrun && cursor.running !== void 0 ? { running: cursor.running } : {},
55263
55498
  report: cursor.report ?? 0,
55264
55499
  // Each of these advances only when this poll actually READ it. A `gh`-fallback poll knows the
55265
55500
  // merge verdict but not the labels, and overwriting a known baseline with "not known" would make
@@ -55270,7 +55505,7 @@ ${clock}`;
55270
55505
  ...typeof prMeta?.isDraft === "boolean" ? { draft: prMeta.isDraft } : typeof cursor.draft === "boolean" ? { draft: cursor.draft } : {},
55271
55506
  ...prMeta?.mergeExits || cursor.exits ? { exits: [.../* @__PURE__ */ new Set([...(prMeta?.mergeExits ?? []).map((e9) => e9.id), ...cursor.exits ?? []])].slice(0, 20) } : {}
55272
55507
  };
55273
- const news = checksChanged || fresh.length > 0 || changes.length > 0;
55508
+ const news = checksChanged || ciSettled || fresh.length > 0 || changes.length > 0;
55274
55509
  const held = (() => {
55275
55510
  if (!waiting2 || !cursor.held) return void 0;
55276
55511
  if (!outrun) return cursor.held;
@@ -55294,7 +55529,7 @@ ${clock}`;
55294
55529
  const carried = {
55295
55530
  items: items.slice(-REVIEW_STEER_CAP),
55296
55531
  omitted: (held?.omitted ?? 0) + (fresh.length - named.length) + Math.max(0, items.length - REVIEW_STEER_CAP),
55297
- ...checksChanged && terminal ? {
55532
+ ...(checksChanged || ciSettled) && terminal ? {
55298
55533
  checks: {
55299
55534
  verdict: terminal,
55300
55535
  passed: st.passed,
@@ -55303,7 +55538,8 @@ ${clock}`;
55303
55538
  skipped: st.skipped,
55304
55539
  gated: st.gated,
55305
55540
  gating: st.gating,
55306
- ...st.head ? { head: st.head } : {}
55541
+ ...st.head ? { head: st.head } : {},
55542
+ ...terminal === "failing" ? { running: st.running } : {}
55307
55543
  }
55308
55544
  } : held?.checks ? { checks: held.checks } : {},
55309
55545
  // The state clauses fold forward the same way the review items do, and are DEDUPED on the way:
@@ -55329,7 +55565,7 @@ ${clock}`;
55329
55565
  ...carried.changes?.length ? { changes: carried.changes } : {},
55330
55566
  ...carried.offMergePath ? { offMergePath: carried.offMergePath } : {},
55331
55567
  ...review ? { review } : {}
55332
- }), `pr-watch ${key}${carried.checks ? ` CI ${carried.checks.verdict}` : ""}${carried.offMergePath ? " left merge path" : carried.changes?.length ? " state" : ""}${review ? " review" : ""}`, nowMs);
55568
+ }), `pr-watch ${key}${carried.checks ? ` CI ${carried.checks.verdict}${ciSettled ? " settled" : ""}` : ""}${carried.offMergePath ? " left merge path" : carried.changes?.length ? " state" : ""}${review ? " review" : ""}`, nowMs);
55333
55569
  deps.storage.setPrWatchCursor(w.id, JSON.stringify({ ...nextCursor, report, held: carried }));
55334
55570
  }
55335
55571
  }
@@ -62753,13 +62989,13 @@ function liveAcpDaemonRecord(stateDir, sessionId) {
62753
62989
  return null;
62754
62990
  }
62755
62991
  function liveAcpDaemonSessionIds(stateDir) {
62756
- let names;
62992
+ let names2;
62757
62993
  try {
62758
- names = readdirSync13(daemonDir2(stateDir));
62994
+ names2 = readdirSync13(daemonDir2(stateDir));
62759
62995
  } catch {
62760
62996
  return [];
62761
62997
  }
62762
- return names.filter((name) => name.endsWith(".json")).map((name) => name.slice(0, -".json".length)).filter((sessionId) => liveAcpDaemonRecord(stateDir, sessionId) !== null);
62998
+ return names2.filter((name) => name.endsWith(".json")).map((name) => name.slice(0, -".json".length)).filter((sessionId) => liveAcpDaemonRecord(stateDir, sessionId) !== null);
62763
62999
  }
62764
63000
  async function stopAcpDaemon(stateDir, sessionId, timeoutMs = 1e4, identity) {
62765
63001
  const record = liveAcpDaemonRecord(stateDir, sessionId);
@@ -93788,8 +94024,8 @@ function validateMcpPrimitiveSchema(field2) {
93788
94024
  assertOnlyKeys(field2, /* @__PURE__ */ new Set(["type", "title", "description", "enum", "enumNames", "default"]), "MCP enum field");
93789
94025
  const values = nonEmptyUniqueStrings(field2.enum, "MCP enum values");
93790
94026
  if (field2.enumNames !== void 0) {
93791
- const names = nonEmptyUniqueStrings(field2.enumNames, "MCP enum names");
93792
- if (names.length !== values.length) throw new ClaudeAgentSdkProtocolError("MCP enum names do not match its values");
94027
+ const names2 = nonEmptyUniqueStrings(field2.enumNames, "MCP enum names");
94028
+ if (names2.length !== values.length) throw new ClaudeAgentSdkProtocolError("MCP enum names do not match its values");
93793
94029
  }
93794
94030
  if (field2.default !== void 0 && (typeof field2.default !== "string" || !values.includes(field2.default))) {
93795
94031
  throw new ClaudeAgentSdkProtocolError("MCP enum default is not advertised");
@@ -94953,6 +95189,24 @@ var init_claude_agent_sdk = __esm({
94953
95189
  this.assertOpen();
94954
95190
  await this.awaitOpenControl(this.sdkQuery.reconnectMcpServer(exactText(name, "reconnectMcpServer.name", 256)));
94955
95191
  }
95192
+ // Not gated on ready(), like mcpServerStatus: a reload reaches a thread at rest as well as mid-turn. The
95193
+ // servers ride the control channel on the CLI's stdin, never its argv, so the credentials in them stay
95194
+ // out of `ps` exactly as the launch file keeps them (writeMcpConfigFile).
95195
+ async setMcpServers(servers) {
95196
+ this.assertOpen();
95197
+ const result = objectValue(await this.awaitOpenControl(this.sdkQuery.setMcpServers(servers)), "setMcpServers");
95198
+ const errors = {};
95199
+ const rawErrors = result.errors && typeof result.errors === "object" && !Array.isArray(result.errors) ? result.errors : {};
95200
+ for (const [name, message] of Object.entries(rawErrors).slice(0, 256)) {
95201
+ const key = safeText(name, "setMcpServers.errors.name", 256);
95202
+ if (key) errors[key] = safeText(typeof message === "string" ? message : String(message), "setMcpServers.errors.message", 2e3);
95203
+ }
95204
+ return {
95205
+ added: boundedStringArray(Array.isArray(result.added) ? result.added : [], "setMcpServers.added", 256, 256),
95206
+ removed: boundedStringArray(Array.isArray(result.removed) ? result.removed : [], "setMcpServers.removed", 256, 256),
95207
+ errors
95208
+ };
95209
+ }
94956
95210
  // `mcpAuthenticate` is present at runtime in @anthropic-ai/claude-agent-sdk 0.3.303 (the
94957
95211
  // `mcp_authenticate` control request) but absent from its `.d.ts`, so — like cancelAsyncMessage — it
94958
95212
  // is PROBED: an SDK bump that drops it fails here, with a reason, instead of as "not a function".
@@ -96111,22 +96365,72 @@ function createMcpService(deps) {
96111
96365
  return attempt;
96112
96366
  };
96113
96367
  const view = (attempt) => ({ state: attempt.state, ...attempt.error ? { error: attempt.error } : {} });
96368
+ const statusOf = async (target) => {
96369
+ const resolved2 = resolve17(target);
96370
+ if (resolved2.backend === "acp" || resolved2.backend === "opencode") return { backend: resolved2.backend, agent: resolved2.agent, supported: false, servers: [] };
96371
+ if (resolved2.backend === "codex") {
96372
+ if (!deps.codexAppServer) return { backend: "codex", agent: resolved2.agent, supported: true, servers: [], note: CODEX_UNAVAILABLE };
96373
+ if (isRuntimeDeferred("codex")) return { backend: "codex", agent: resolved2.agent, supported: true, servers: [], note: CODEX_NOT_DOWNLOADED };
96374
+ const rows = withoutFrizz(await deps.codexAppServer.listMcpServers());
96375
+ return { backend: "codex", agent: resolved2.agent, supported: true, servers: rows.map(toReading) };
96376
+ }
96377
+ try {
96378
+ return { backend: "claude", agent: resolved2.agent, supported: true, servers: (await claudeServers(resolved2)).map(toReading) };
96379
+ } catch (error) {
96380
+ if (error instanceof McpUnavailable) return { backend: "claude", agent: resolved2.agent, supported: true, servers: [], note: error.message };
96381
+ throw error;
96382
+ }
96383
+ };
96114
96384
  return {
96115
- async status(target) {
96385
+ status: statusOf,
96386
+ // RELOAD. The configuration is the PROJECT's, so the reload is too: every running thread of the
96387
+ // project is brought level with it, whichever box asked. Claude: each live broker session re-reads
96388
+ // `.mcp.json` and swaps its servers in place (the daemon's reloadMcp). Codex: the app-server re-reads
96389
+ // its config layers for every thread it has loaded (`config/mcpServer/reload`), so the change is
96390
+ // read off its server list before and after.
96391
+ async reload(target) {
96116
96392
  const resolved2 = resolve17(target);
96117
96393
  if (resolved2.backend === "acp" || resolved2.backend === "opencode") return { backend: resolved2.backend, agent: resolved2.agent, supported: false, servers: [] };
96118
96394
  if (resolved2.backend === "codex") {
96119
96395
  if (!deps.codexAppServer) return { backend: "codex", agent: resolved2.agent, supported: true, servers: [], note: CODEX_UNAVAILABLE };
96120
96396
  if (isRuntimeDeferred("codex")) return { backend: "codex", agent: resolved2.agent, supported: true, servers: [], note: CODEX_NOT_DOWNLOADED };
96121
- const rows = withoutFrizz(await deps.codexAppServer.listMcpServers());
96122
- return { backend: "codex", agent: resolved2.agent, supported: true, servers: rows.map(toReading) };
96123
- }
96124
- try {
96125
- return { backend: "claude", agent: resolved2.agent, supported: true, servers: (await claudeServers(resolved2)).map(toReading) };
96126
- } catch (error) {
96127
- if (error instanceof McpUnavailable) return { backend: "claude", agent: resolved2.agent, supported: true, servers: [], note: error.message };
96128
- throw error;
96129
- }
96397
+ const before = withoutFrizz(await deps.codexAppServer.listMcpServers());
96398
+ await deps.codexAppServer.reloadMcpServers();
96399
+ const after = withoutFrizz(await deps.codexAppServer.listMcpServers());
96400
+ const had = new Set(before.map((row) => row.name));
96401
+ const has = new Set(after.map((row) => row.name));
96402
+ const change = {
96403
+ added: after.filter((row) => !had.has(row.name)).map((row) => row.name),
96404
+ removed: before.filter((row) => !has.has(row.name)).map((row) => row.name),
96405
+ // The list carries no definitions, so a server that kept its name reads as unchanged here.
96406
+ changed: [],
96407
+ unchanged: after.filter((row) => had.has(row.name)).length,
96408
+ errors: Object.fromEntries(after.filter((row) => row.status === "failed").map((row) => [row.name, (row.error ?? "Failed to start").slice(0, 2e3)])),
96409
+ unapproved: []
96410
+ };
96411
+ return { backend: "codex", agent: resolved2.agent, supported: true, ..."slug" in target ? { thread: change } : {}, servers: after.map(toReading) };
96412
+ }
96413
+ const outcomes = deps.claudeBroker ? await deps.claudeBroker.reloadMcpServersEverywhere() : [];
96414
+ const mine = resolved2.thread ? outcomes.find((outcome) => outcome.threadSlug === resolved2.thread.slug) : void 0;
96415
+ if (mine?.outcome === "failed") throw new Error(mine.error);
96416
+ const others = outcomes.filter((outcome) => outcome !== mine);
96417
+ let note;
96418
+ if (resolved2.thread && !mine) note = "This thread\u2019s Claude session isn\u2019t running. Its next turn starts with the project\u2019s MCP servers as they read then.";
96419
+ else if (mine?.outcome === "stale") note = "This thread\u2019s Claude session predates MCP reload. It gets the project\u2019s MCP servers as they read now when its session next starts.";
96420
+ const status = await statusOf(target);
96421
+ return {
96422
+ backend: "claude",
96423
+ agent: resolved2.agent,
96424
+ supported: true,
96425
+ ...mine?.outcome === "reloaded" ? { thread: mine.reload } : {},
96426
+ ...note ?? status.note ? { note: note ?? status.note } : {},
96427
+ others: {
96428
+ reloaded: others.filter((outcome) => outcome.outcome === "reloaded").length,
96429
+ stale: others.filter((outcome) => outcome.outcome === "stale").length,
96430
+ failed: others.filter((outcome) => outcome.outcome === "failed").length
96431
+ },
96432
+ servers: status.servers
96433
+ };
96130
96434
  },
96131
96435
  async signIn(target, server) {
96132
96436
  sweep();
@@ -102146,6 +102450,7 @@ ${gapNote}` : input.message;
102146
102450
  return {
102147
102451
  id: w.id,
102148
102452
  command: w.command,
102453
+ ...w.description ? { description: w.description } : {},
102149
102454
  every: formatElapsed(w.every_ms),
102150
102455
  state: w.state,
102151
102456
  createdAt: new Date(w.created_at).toISOString(),
@@ -102277,6 +102582,7 @@ ${gapNote}` : input.message;
102277
102582
  return ctx.storage.listThreadTimers(slug, { armedOnly: true }).map((t) => ({
102278
102583
  id: t.id,
102279
102584
  prompt: t.prompt,
102585
+ ...t.description ? { description: t.description } : {},
102280
102586
  fireAt: new Date(t.fire_at).toISOString(),
102281
102587
  state: t.state,
102282
102588
  createdAt: new Date(t.created_at).toISOString()
@@ -102779,12 +103085,19 @@ ${gapNote}` : input.message;
102779
103085
  }),
102780
103086
  // A live/recent background shell's command and combined process output. The tailer supplies the
102781
103087
  // scoped path; the reader caps the response so long-lived watchers/dev servers stay cheap.
103088
+ //
103089
+ // A Claude Code MONITOR answers here too, with no output file: `events` is what it delivered to the
103090
+ // worker, oldest first, each with the instant it arrived, and `eventsDropped` how many earlier ones
103091
+ // the tailer's caps let go (tailer.ts collectMonitorEvents). `events` is null for every other shell,
103092
+ // which is how the drawer tells the two apart.
102782
103093
  backgroundShellOutput: query({
102783
103094
  input: external_exports.object({ slug: ThreadSlug, id: external_exports.string() }).strict(),
102784
103095
  output: external_exports.object({
102785
103096
  command: external_exports.string().nullable(),
102786
103097
  output: external_exports.string(),
102787
103098
  truncated: external_exports.boolean(),
103099
+ events: external_exports.array(external_exports.object({ text: external_exports.string(), at: external_exports.string().nullable() })).nullable(),
103100
+ eventsDropped: external_exports.number(),
102788
103101
  state: external_exports.enum(["running", "done", "gone"]),
102789
103102
  // The same pair `subAgentTranscript` carries, for the same reason: the drawer renders a Stop
102790
103103
  // button if and only if this is true, and states `stopNote` in its place when a running shell
@@ -102794,13 +103107,15 @@ ${gapNote}` : input.message;
102794
103107
  }),
102795
103108
  handler: async ({ input }) => {
102796
103109
  const info = ctx.tailer.backgroundShell?.(input.slug, input.id);
102797
- if (!info) return { command: null, output: "", truncated: false, state: "gone", stoppable: false, stopNote: null };
103110
+ if (!info) return { command: null, output: "", truncated: false, events: null, eventsDropped: 0, state: "gone", stoppable: false, stopNote: null };
102798
103111
  const outputFile = readableTaskOutput(info.outputFile);
102799
103112
  const content = outputFile ? readBackgroundShellOutput(outputFile) : { output: "", truncated: false };
102800
103113
  const stop2 = subAgentStoppable(input.slug, input.id);
102801
103114
  return {
102802
103115
  command: info.command ?? null,
102803
103116
  ...content,
103117
+ events: info.monitor ? info.monitor.events.map((e9) => ({ text: e9.text, at: e9.at ?? null })) : null,
103118
+ eventsDropped: info.monitor?.dropped ?? 0,
102804
103119
  state: info.state,
102805
103120
  stoppable: stop2.sessionId !== null,
102806
103121
  stopNote: stop2.sessionId === null ? stop2.note : null
@@ -102844,6 +103159,10 @@ ${gapNote}` : input.message;
102844
103159
  for (const id2 of input.ids) {
102845
103160
  const info = ctx.tailer.backgroundShell?.(input.slug, id2);
102846
103161
  if (!info) continue;
103162
+ if (info.monitor) {
103163
+ shells.push({ id: id2, lines: info.monitor.events.length + info.monitor.dropped, running: info.state === "running" });
103164
+ continue;
103165
+ }
102847
103166
  const outputFile = readableTaskOutput(info.outputFile);
102848
103167
  const lines = outputFile ? backgroundShellLineCount(outputFile) : void 0;
102849
103168
  shells.push({ id: id2, lines: lines ?? null, running: info.state === "running" });
@@ -103347,6 +103666,17 @@ ${gapNote}` : input.message;
103347
103666
  return await ctx.mcp.status(input);
103348
103667
  }
103349
103668
  }),
103669
+ // Re-read the project's MCP configuration into its running threads: the plug menu's Reload, and
103670
+ // `frizzctl mcp reload` from an agent that just edited `.mcp.json` (it passes its own slug, as every
103671
+ // worker call does). mcp-status.ts `reload` has the rule; the result says what changed.
103672
+ mcpReload: mutation({
103673
+ input: McpReloadInput,
103674
+ output: McpReloadResult,
103675
+ handler: async ({ input }) => {
103676
+ if (!ctx.mcp) throw new Error("MCP reload is not available on this server");
103677
+ return await ctx.mcp.reload(input);
103678
+ }
103679
+ }),
103350
103680
  mcpSignIn: mutation({
103351
103681
  input: McpSignInInput,
103352
103682
  output: McpSignInResult,
@@ -103695,6 +104025,8 @@ ${gapNote}` : input.message;
103695
104025
  id: id2,
103696
104026
  slug: input.slug,
103697
104027
  prompt: input.prompt,
104028
+ // One line: it is a row's name and a drawer's title (addOwnMonitor squeezes its own the same way).
104029
+ description: input.description?.replace(/\s+/g, " ") || null,
103698
104030
  fireAtMs: Date.parse(input.fireAt),
103699
104031
  createdAtMs: Date.now()
103700
104032
  });
@@ -103755,7 +104087,7 @@ ${gapNote}` : input.message;
103755
104087
  activity.push({
103756
104088
  kind: "timer",
103757
104089
  id: t.id,
103758
- label: t.prompt.trim().replace(/\s+/g, " ").slice(0, 120),
104090
+ label: (t.description ?? t.prompt).trim().replace(/\s+/g, " ").slice(0, 120),
103759
104091
  since: new Date(t.created_at).toISOString(),
103760
104092
  until: new Date(t.fire_at).toISOString()
103761
104093
  });
@@ -103773,7 +104105,7 @@ ${gapNote}` : input.message;
103773
104105
  activity.push({
103774
104106
  kind: "command",
103775
104107
  id: w.id,
103776
- label: w.command.trim().replace(/\s+/g, " ").slice(0, 120),
104108
+ label: (w.description ?? w.command).trim().replace(/\s+/g, " ").slice(0, 120),
103777
104109
  since: new Date(w.created_at).toISOString(),
103778
104110
  until: new Date(w.expires_at).toISOString()
103779
104111
  });
@@ -103979,6 +104311,7 @@ ${gapNote}` : input.message;
103979
104311
  everyMs,
103980
104312
  createdAtMs: now,
103981
104313
  expiresAtMs: now + forMs,
104314
+ description: input.description?.replace(/\s+/g, " ") || null,
103982
104315
  // A first check cut short by the registration's own short timeout is NOT recorded: the
103983
104316
  // scheduler runs it again at once with the full timeout, rather than a cadence from now.
103984
104317
  ...first && first.outcome !== "timeout" ? { firstRun: { atMs: first.finishedAtMs, outcome: first.outcome, exitCode: first.exitCode, output: first.output } } : {}
@@ -104014,6 +104347,11 @@ ${gapNote}` : input.message;
104014
104347
  // A MONITOR'S DRAWER (2026-11-03): its script and everything it printed, the way a background shell's
104015
104348
  // drawer reads its output file. The log is written by the monitor's own process (command-watch.ts
104016
104349
  // monitorOutputSink); `ended` says how a monitor that is no longer running stopped.
104350
+ //
104351
+ // A CHECK opens the same drawer (2026-11-12; until then its row opened nothing): its command, and in
104352
+ // place of a log the output of its LAST check, which is all the server keeps of one — the tail each run
104353
+ // overwrites (COMMAND_WATCH_OUTPUT_MAX_BYTES). `check` carries what only a check has, and is null on a
104354
+ // persistent monitor. A check has no human stop: nothing tells its worker it was stopped.
104017
104355
  monitorOutput: query({
104018
104356
  input: external_exports.object({ slug: ThreadSlug, id: external_exports.string() }).strict(),
104019
104357
  output: external_exports.object({
@@ -104025,15 +104363,40 @@ ${gapNote}` : input.message;
104025
104363
  ended: external_exports.string().nullable(),
104026
104364
  events: external_exports.number(),
104027
104365
  startedAt: external_exports.string().nullable(),
104028
- stoppable: external_exports.boolean()
104366
+ stoppable: external_exports.boolean(),
104367
+ check: external_exports.object({
104368
+ every: external_exports.string(),
104369
+ runs: external_exports.number(),
104370
+ expiresAt: external_exports.string(),
104371
+ lastRun: external_exports.object({ at: external_exports.string(), outcome: external_exports.enum(["exit", "timeout", "signal", "error"]), exitCode: external_exports.number().nullable() }).nullable()
104372
+ }).nullable().optional()
104029
104373
  }),
104030
104374
  handler: async ({ input }) => {
104031
104375
  const w = ctx.storage.getCommandWatch(input.id);
104032
- if (!w || w.kind !== "monitor" || w.thread_slug !== input.slug) {
104033
- return { command: null, description: null, output: "", truncated: false, state: "gone", ended: null, events: 0, startedAt: null, stoppable: false };
104376
+ if (!w || w.thread_slug !== input.slug) {
104377
+ return { command: null, description: null, output: "", truncated: false, state: "gone", ended: null, events: 0, startedAt: null, stoppable: false, check: null };
104034
104378
  }
104035
- const content = readBackgroundShellOutput(monitorOutputPath(join61(ctx.project.stateDir, "monitors"), w.id));
104036
104379
  const running = w.state === "armed";
104380
+ if (w.kind === "check") {
104381
+ return {
104382
+ command: w.command,
104383
+ description: w.description,
104384
+ output: w.last_output ?? "",
104385
+ truncated: false,
104386
+ state: running ? "running" : "ended",
104387
+ ended: running ? null : w.state === "passed" ? "passed" : w.state === "cancelled" ? "stopped" : w.state,
104388
+ events: 0,
104389
+ startedAt: new Date(w.created_at).toISOString(),
104390
+ stoppable: false,
104391
+ check: {
104392
+ every: formatElapsed(w.every_ms),
104393
+ runs: w.runs,
104394
+ expiresAt: new Date(w.expires_at).toISOString(),
104395
+ lastRun: w.last_run_at !== null && w.last_outcome ? { at: new Date(w.last_run_at).toISOString(), outcome: w.last_outcome, exitCode: w.last_exit } : null
104396
+ }
104397
+ };
104398
+ }
104399
+ const content = readBackgroundShellOutput(monitorOutputPath(join61(ctx.project.stateDir, "monitors"), w.id));
104037
104400
  return {
104038
104401
  command: w.command,
104039
104402
  description: w.description,
@@ -104042,7 +104405,36 @@ ${gapNote}` : input.message;
104042
104405
  ended: running ? null : monitorEndedLabel(w),
104043
104406
  events: w.events,
104044
104407
  startedAt: new Date(w.created_at).toISOString(),
104045
- stoppable: running
104408
+ stoppable: running,
104409
+ check: null
104410
+ };
104411
+ }
104412
+ }),
104413
+ // A TIMER'S DRAWER (2026-11-12): what it is for, when it fires, and the prompt the worker will be sent.
104414
+ // Read from the row rather than the board, so the drawer still reads after the timer fires or is
104415
+ // cancelled — the board lists only armed ones.
104416
+ threadTimer: query({
104417
+ input: external_exports.object({ slug: ThreadSlug, id: external_exports.string() }).strict(),
104418
+ output: external_exports.object({
104419
+ id: external_exports.string(),
104420
+ description: external_exports.string().nullable(),
104421
+ prompt: external_exports.string(),
104422
+ fireAt: external_exports.string(),
104423
+ createdAt: external_exports.string(),
104424
+ settledAt: external_exports.string().nullable(),
104425
+ state: external_exports.enum(["armed", "fired", "cancelled"])
104426
+ }).nullable(),
104427
+ handler: async ({ input }) => {
104428
+ const t = ctx.storage.getThreadTimer(input.id);
104429
+ if (!t || t.thread_slug !== input.slug) return null;
104430
+ return {
104431
+ id: t.id,
104432
+ description: t.description,
104433
+ prompt: t.prompt,
104434
+ fireAt: new Date(t.fire_at).toISOString(),
104435
+ createdAt: new Date(t.created_at).toISOString(),
104436
+ settledAt: t.settled_at === null ? null : new Date(t.settled_at).toISOString(),
104437
+ state: t.state
104046
104438
  };
104047
104439
  }
104048
104440
  }),
@@ -105657,6 +106049,7 @@ var init_remote_gate = __esm({
105657
106049
  backgroundShellOutput: "allow",
105658
106050
  backgroundShellActivity: "allow",
105659
106051
  monitorOutput: "allow",
106052
+ threadTimer: "allow",
105660
106053
  projectsList: "allow",
105661
106054
  projectsRailCounts: "allow",
105662
106055
  // What the page reads as it loads. None of these takes input that reaches a process.
@@ -105723,6 +106116,7 @@ var init_remote_gate = __esm({
105723
106116
  stopThreadTurn: "full",
105724
106117
  // MCP, provider and GitHub sign-ins.
105725
106118
  mcpStatus: "full",
106119
+ mcpReload: "full",
105726
106120
  mcpSignIn: "full",
105727
106121
  mcpSignInPoll: "full",
105728
106122
  mcpSignInFinish: "full",