frizz-server 0.15.65 → 0.15.67

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 (101) hide show
  1. package/dist/acp-daemon.js +138 -69
  2. package/dist/claude-agent-broker.js +15896 -15704
  3. package/dist/codex-app-server-daemon.js +128 -46
  4. package/dist/dev-child.js +19857 -18456
  5. package/package.json +1 -1
  6. package/runtime/cc-worker/hooks/session-seed.mjs +4 -4
  7. package/runtime/cc-worker/lib/frizz-tools.mjs +169 -13
  8. package/runtime/cc-worker/skills/gh/SKILL.md +17 -3
  9. package/web-dist/assets/{abnfDiagram-VCTEODGH-BiJ4o5Ds.js → abnfDiagram-VCTEODGH-CkK-Z5Tb.js} +1 -1
  10. package/web-dist/assets/architecture-7GRP2DOG-BvwaGEem.js +1 -0
  11. package/web-dist/assets/{architectureDiagram-5GKGNRK7-CsLqK0BE.js → architectureDiagram-5GKGNRK7-BZpGyj0s.js} +1 -1
  12. package/web-dist/assets/{blockDiagram-I7D4REHJ-DWs5aRRO.js → blockDiagram-I7D4REHJ-B1-TqoUR.js} +1 -1
  13. package/web-dist/assets/{c4Diagram-7LVT6UL2-Dk9wYT5j.js → c4Diagram-7LVT6UL2-fKeWCZjm.js} +1 -1
  14. package/web-dist/assets/channel-B-7JItvh.js +1 -0
  15. package/web-dist/assets/{chunk-2E4U76K2-iLxD8PcN.js → chunk-2E4U76K2-CmRbtjDH.js} +1 -1
  16. package/web-dist/assets/{chunk-4HAMMTFA-B2bZyZs2.js → chunk-4HAMMTFA-6cao8IkW.js} +1 -1
  17. package/web-dist/assets/{chunk-75Z2AOVW-DIZn8bvE.js → chunk-75Z2AOVW-x0AfQHPP.js} +1 -1
  18. package/web-dist/assets/{chunk-CLGD4ZFX-DXth0YhX.js → chunk-CLGD4ZFX-BAgdhcJ1.js} +1 -1
  19. package/web-dist/assets/{chunk-DU6HZSFF-D0BZQTG5.js → chunk-DU6HZSFF-BrFmYIzY.js} +1 -1
  20. package/web-dist/assets/{chunk-F27PBJKO-BF6w8taS.js → chunk-F27PBJKO-CLQD5Si7.js} +1 -1
  21. package/web-dist/assets/{chunk-GMAD6QVW-BgS1USoA.js → chunk-GMAD6QVW-Cbeyvky6.js} +1 -1
  22. package/web-dist/assets/{chunk-GVQU2GXP-BwmGDTq-.js → chunk-GVQU2GXP-C-jtfKi1.js} +1 -1
  23. package/web-dist/assets/{chunk-IMKFNOWR-C2hHnw7E.js → chunk-IMKFNOWR-BeCWhDvz.js} +1 -1
  24. package/web-dist/assets/{chunk-L3NEJ4N5-Bbg747MC.js → chunk-L3NEJ4N5-gMnoZfz-.js} +1 -1
  25. package/web-dist/assets/{chunk-OSK3NFVY-DAQ50rcr.js → chunk-OSK3NFVY-DUP59KCM.js} +1 -1
  26. package/web-dist/assets/{chunk-P2QGCYS3-BObSA-cM.js → chunk-P2QGCYS3-jeSkL0G4.js} +1 -1
  27. package/web-dist/assets/{chunk-POPQ4Y6H-BqmJCF6N.js → chunk-POPQ4Y6H-CP-zYAzx.js} +1 -1
  28. package/web-dist/assets/{chunk-PWAF6VOD-CuDeijqS.js → chunk-PWAF6VOD-BQSU5ceC.js} +1 -1
  29. package/web-dist/assets/{chunk-SHT3W25Y-DbJTvHUA.js → chunk-SHT3W25Y-CKePtilX.js} +1 -1
  30. package/web-dist/assets/{chunk-SVP7TREG-BC8SdQcL.js → chunk-SVP7TREG-BD5qJuyG.js} +1 -1
  31. package/web-dist/assets/{chunk-TICWLB2K-DXexujNp.js → chunk-TICWLB2K-DlMkszgO.js} +1 -1
  32. package/web-dist/assets/{chunk-TLUHSLCS-0wx9EWEa.js → chunk-TLUHSLCS-NoZvhOPQ.js} +2 -2
  33. package/web-dist/assets/classDiagram-ZZMXUADV-AQs_B2Cr.js +1 -0
  34. package/web-dist/assets/classDiagram-v2-VYDZK3BY-AQs_B2Cr.js +1 -0
  35. package/web-dist/assets/{cynefin-OW5HDTMX-CGrLGBfS.js → cynefin-OW5HDTMX-DZk_ZjYv.js} +1 -1
  36. package/web-dist/assets/{cynefinDiagram-5FMLGOSQ-EyQdBwCu.js → cynefinDiagram-5FMLGOSQ-Ho11TFUW.js} +1 -1
  37. package/web-dist/assets/{dagre-GXQ25YYZ-BVqzmn7R.js → dagre-GXQ25YYZ-BasuG2Ie.js} +1 -1
  38. package/web-dist/assets/{diagram-S7CK7UJ4-DZ1hfAmp.js → diagram-S7CK7UJ4-C4IM1U2F.js} +1 -1
  39. package/web-dist/assets/{diagram-UQ7AKVKN-DpAP9cxe.js → diagram-UQ7AKVKN-DZJZMFQY.js} +1 -1
  40. package/web-dist/assets/{diagram-VSXAHHWV-CU3WPzI-.js → diagram-VSXAHHWV-Cub4v22K.js} +1 -1
  41. package/web-dist/assets/{diagram-VX7I27RA-Zbw7QxDA.js → diagram-VX7I27RA-vsgm0yAi.js} +1 -1
  42. package/web-dist/assets/{diagram-Z3DM3KII-B1wgPjix.js → diagram-Z3DM3KII-B2QNqXhM.js} +1 -1
  43. package/web-dist/assets/{ebnfDiagram-PWID7BFC-Dv7JWtKb.js → ebnfDiagram-PWID7BFC-Bj9JAh1f.js} +1 -1
  44. package/web-dist/assets/{erDiagram-RLTQ6QDP-C5sXCiIS.js → erDiagram-RLTQ6QDP-DLLibevD.js} +1 -1
  45. package/web-dist/assets/eventmodeling-NTZA5JFV-Djp2uiQ_.js +1 -0
  46. package/web-dist/assets/flowDiagram-HODETNUW-DUuVSFII.js +1 -0
  47. package/web-dist/assets/{ganttDiagram-EL5Y4UJY-DZd_7lQ3.js → ganttDiagram-EL5Y4UJY-Bh8LMhYe.js} +1 -1
  48. package/web-dist/assets/{gitGraph-4MIJSDKK-B26quh1K.js → gitGraph-4MIJSDKK-C9LjVJma.js} +1 -1
  49. package/web-dist/assets/{gitGraphDiagram-WWUBYQGX-BqPUII5h.js → gitGraphDiagram-WWUBYQGX-Xt-6X2cc.js} +1 -1
  50. package/web-dist/assets/index-BhUQZkSW.css +2 -0
  51. package/web-dist/assets/index-DwHaBuGz.js +263 -0
  52. package/web-dist/assets/{info-A6RAGUB7-BtK5rNNi.js → info-A6RAGUB7-D4wrVOSg.js} +1 -1
  53. package/web-dist/assets/{infoDiagram-27XIBGKW-rMo0hIHa.js → infoDiagram-27XIBGKW-Bu-D0d6G.js} +1 -1
  54. package/web-dist/assets/{ishikawaDiagram-5VMMS53U-DKHMSlJD.js → ishikawaDiagram-5VMMS53U-C2rUfjSF.js} +1 -1
  55. package/web-dist/assets/{journeyDiagram-3NMN7TZE-CZLE8Bqt.js → journeyDiagram-3NMN7TZE-BLTFQ5nu.js} +1 -1
  56. package/web-dist/assets/{kanban-definition-UXKFOSKX-dqVMgmbb.js → kanban-definition-UXKFOSKX-DqkyDGTw.js} +1 -1
  57. package/web-dist/assets/{line-CrnyN3Lt.js → line-CzPDg_0v.js} +1 -1
  58. package/web-dist/assets/{mermaid-parser.core-Dr2z-e4o.js → mermaid-parser.core-BWYaJQLC.js} +3 -3
  59. package/web-dist/assets/{mermaid.core-BXpwwhdN.js → mermaid.core-CAT5p5nB.js} +3 -3
  60. package/web-dist/assets/{mindmap-definition-YA3MSWOX-D-J1xW_j.js → mindmap-definition-YA3MSWOX-CmS72LVj.js} +1 -1
  61. package/web-dist/assets/{packet-AYTQ26CC-xrZeixjb.js → packet-AYTQ26CC-vAFMS3Gw.js} +1 -1
  62. package/web-dist/assets/{pegDiagram-XKGWAZYB-BR5WwIHq.js → pegDiagram-XKGWAZYB-BrxtQcgq.js} +1 -1
  63. package/web-dist/assets/{pie-WAS4IAKB-dc_3hE8I.js → pie-WAS4IAKB-CXnd9TO0.js} +1 -1
  64. package/web-dist/assets/{pieDiagram-E7YTZNPT-B84B9L5r.js → pieDiagram-E7YTZNPT-Lo6mSDEr.js} +1 -1
  65. package/web-dist/assets/{quadrantDiagram-AXDQQJYC-Bm859-6L.js → quadrantDiagram-AXDQQJYC-BFHRFeEy.js} +1 -1
  66. package/web-dist/assets/{radar-RG4KPBEZ-DOlDnfZi.js → radar-RG4KPBEZ-C_egGNWl.js} +1 -1
  67. package/web-dist/assets/{railroad-74A4TZTK-CB_W8mmn.js → railroad-74A4TZTK-vPSdVfO3.js} +1 -1
  68. package/web-dist/assets/railroad-abnf-HS5TGJTU-DDHSOfoe.js +1 -0
  69. package/web-dist/assets/railroad-ebnf-LZEXJU2U-StTM9TJ1.js +1 -0
  70. package/web-dist/assets/railroad-peg-WCYAUIDC-RiHjNDd-.js +1 -0
  71. package/web-dist/assets/{railroadDiagram-O6MQD6OU-Ce4wBI0Y.js → railroadDiagram-O6MQD6OU-BJ-hao4B.js} +1 -1
  72. package/web-dist/assets/{requirementDiagram-BXWQKSXE-DMfJJlOr.js → requirementDiagram-BXWQKSXE-DlqkBgex.js} +1 -1
  73. package/web-dist/assets/{sankeyDiagram-P5KCCOFB-CWAtaK1M.js → sankeyDiagram-P5KCCOFB-gsQFgOI2.js} +1 -1
  74. package/web-dist/assets/{sequenceDiagram-WJ2MYXX4-CGGVQ0p0.js → sequenceDiagram-WJ2MYXX4-FMC9F7xI.js} +1 -1
  75. package/web-dist/assets/{stateDiagram-D77RDMKH-Z23iP6vB.js → stateDiagram-D77RDMKH-D23HryR7.js} +1 -1
  76. package/web-dist/assets/stateDiagram-v2-MP3YSRHH-CAIwx9LT.js +1 -0
  77. package/web-dist/assets/{swimlanes-42K2YHIH-Z1I7L9cr.js → swimlanes-42K2YHIH-CcfzNwJl.js} +1 -1
  78. package/web-dist/assets/swimlanesDiagram-VR7AAH4N-C2qCOtQf.js +8 -0
  79. package/web-dist/assets/threadSurfaces-DFNWoq9v.js +141 -0
  80. package/web-dist/assets/{timeline-definition-24CTP7MA-B9l0F0nK.js → timeline-definition-24CTP7MA-BR_c-dIK.js} +1 -1
  81. package/web-dist/assets/{treeView-Q6P3EWNA-BDHbzVhP.js → treeView-Q6P3EWNA-C0in44IY.js} +1 -1
  82. package/web-dist/assets/{treemap-WGGIJYW6-DIk7J7mj.js → treemap-WGGIJYW6-s6rLlQhE.js} +1 -1
  83. package/web-dist/assets/{vennDiagram-4TSXK5OY-CXFQUhMh.js → vennDiagram-4TSXK5OY-DB7SlxKI.js} +1 -1
  84. package/web-dist/assets/{wardley-WFR3VGLG-2-8sLGSL.js → wardley-WFR3VGLG-Cop_4ibk.js} +1 -1
  85. package/web-dist/assets/{wardleyDiagram-VM6X3IG4-CQJUGn_G.js → wardleyDiagram-VM6X3IG4-CgUZsjiZ.js} +1 -1
  86. package/web-dist/assets/{xychartDiagram-S5SC5T6Z-hgi3z_lr.js → xychartDiagram-S5SC5T6Z-U9ugKEbO.js} +1 -1
  87. package/web-dist/index.html +2 -2
  88. package/web-dist/assets/architecture-7GRP2DOG-DTQZDTlF.js +0 -1
  89. package/web-dist/assets/channel-DEEIlZEQ.js +0 -1
  90. package/web-dist/assets/classDiagram-ZZMXUADV-CS5b4mpy.js +0 -1
  91. package/web-dist/assets/classDiagram-v2-VYDZK3BY-CS5b4mpy.js +0 -1
  92. package/web-dist/assets/eventmodeling-NTZA5JFV-Bt0Eptkc.js +0 -1
  93. package/web-dist/assets/flowDiagram-HODETNUW-BNRmy-JK.js +0 -1
  94. package/web-dist/assets/index-D-Pgx7jI.js +0 -262
  95. package/web-dist/assets/index-DjVez4iB.css +0 -2
  96. package/web-dist/assets/railroad-abnf-HS5TGJTU-DB7tPOt1.js +0 -1
  97. package/web-dist/assets/railroad-ebnf-LZEXJU2U-Bl0t7Ei-.js +0 -1
  98. package/web-dist/assets/railroad-peg-WCYAUIDC-RTQXALoT.js +0 -1
  99. package/web-dist/assets/stateDiagram-v2-MP3YSRHH-Cctq6goD.js +0 -1
  100. package/web-dist/assets/swimlanesDiagram-VR7AAH4N-CkF-YA0k.js +0 -8
  101. package/web-dist/assets/threadSurfaces-DpQhUD3Q.js +0 -140
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frizz-server",
3
- "version": "0.15.65",
3
+ "version": "0.15.67",
4
4
  "private": false,
5
5
  "description": "Replaceable Frizz server runtime",
6
6
  "license": "MIT",
@@ -99,7 +99,7 @@ const ghBlock =
99
99
  '• READ freely: `gh issue view N -R OWNER/REPO --comments`, `gh pr view N`, `gh pr diff N`, `gh pr checks N`, `gh run list`/`gh run view`, `gh api repos/OWNER/REPO/…`. Prefer `--json <fields>` over scraping human text.\n' +
100
100
  '• SEARCH across the repo (and GitHub) with `gh search issues`/`gh search prs` when hunting related work, duplicates, or prior art.\n' +
101
101
  ghReadOnly +
102
- 'To wait on CI or reviews, register `frizzctl watch-pr add` / `frizzctl watch-issue add` rather than polling. Load the `frizz:gh` skill for the full playbook (recipes, waits, and the bundled monitors as a fallback).';
102
+ 'To wait on CI or reviews, register `frizzctl watch-pr add` / `frizzctl watch-issue add` / `frizzctl watch-run add` rather than polling. Load the `frizz:gh` skill for the full playbook (recipes, waits, and the bundled monitors as a fallback).';
103
103
 
104
104
  const ghFrizzReadOnlyBlock =
105
105
  '⟦gh available, read-only⟧ Plain `gh` is signed in here with Frizz\'s own READ-ONLY GitHub credential: no Touch ID, and it works while the screen is locked. Use it EAGERLY and well — it is the fastest path to issue/PR/CI/release context, and you should reach for it before guessing:\n' +
@@ -107,7 +107,7 @@ const ghFrizzReadOnlyBlock =
107
107
  '• A WRITE fails with a permission error (`Resource not accessible by integration`, HTTP 403), and so does a read that needs more than it holds, such as a private repo on an account where Frizz\'s GitHub App is not installed (it reads as not found). That is this credential, not a fault: rerun that one command as `keyward --reason "<what this command is for>" -- gh …`, `gh` the first word after `--`. One Touch ID covers this repository for 10 minutes.\n' +
108
108
  '• On any stderr line starting `keyward: not released:` (screen locked, declined), STOP and report it to the human; NEVER retry. A locked screen does not clear by retrying, and a decline was their answer.\n' +
109
109
  ghReadOnly +
110
- 'To wait on CI or reviews, register `frizzctl watch-pr add` / `frizzctl watch-issue add` rather than polling. Load the `frizz:gh` skill for the full playbook.';
110
+ 'To wait on CI or reviews, register `frizzctl watch-pr add` / `frizzctl watch-issue add` / `frizzctl watch-run add` rather than polling. Load the `frizz:gh` skill for the full playbook.';
111
111
 
112
112
  // The same credential on a machine with no Keyward, where `gh` had no sign-in of its own, so a write has
113
113
  // nowhere to go from here (frizzGithubWorkerEnv).
@@ -116,13 +116,13 @@ const ghFrizzReadOnlyNoWritesBlock =
116
116
  '• READ freely: `gh issue view N -R OWNER/REPO --comments`, `gh pr view N`, `gh pr diff N`, `gh pr checks N`, `gh run list`/`gh run view`, `gh run view <id> --log-failed`, `gh api repos/OWNER/REPO/…`. Prefer `--json <fields>` over scraping human text. Repo source is not readable through it; read the checkout.\n' +
117
117
  '• A WRITE fails with a permission error (`Resource not accessible by integration`, HTTP 403), and so does a read that needs more than it holds, such as a private repo on an account where Frizz\'s GitHub App is not installed (it reads as not found). That is this credential, not a fault, and this machine has no other GitHub sign-in: hand the write to the human as steps, with the exact command or page.\n' +
118
118
  ghReadOnly +
119
- 'To wait on CI or reviews, register `frizzctl watch-pr add` / `frizzctl watch-issue add` rather than polling. Load the `frizz:gh` skill for the full playbook.';
119
+ 'To wait on CI or reviews, register `frizzctl watch-pr add` / `frizzctl watch-issue add` / `frizzctl watch-run add` rather than polling. Load the `frizz:gh` skill for the full playbook.';
120
120
 
121
121
  const ghKeywardBlock =
122
122
  '⟦gh available through Keyward⟧ Plain `gh` is signed OUT here; Keyward, the human\'s vault, signs it in for one run at a time. Run EVERY gh command as `keyward --reason "<what this command is for>" -- gh …` (`gh` must be the first word after `--`). It is still the fastest path to issue/PR/CI/release context — reach for it before guessing:\n' +
123
123
  '• One Touch ID covers this repository\'s gh runs for 10 minutes (less if the screen locks), so BATCH your gh reads together rather than spreading them out. Prefer `--json <fields>`.\n' +
124
124
  '• On any stderr line starting `keyward: not released:` (screen locked, declined), STOP and report it to the human; NEVER retry. A locked screen does not clear by retrying, and a decline was their answer.\n' +
125
- '• WAITS: register `frizzctl watch-pr add` / `frizzctl watch-issue add` for CI and reviews — Frizz\'s server watches on its own credential, even while the screen is locked. Never poll gh; the bundled ci-watch/review-watch monitors cannot sign in under Keyward.\n' +
125
+ '• WAITS: register `frizzctl watch-pr add` / `frizzctl watch-issue add` / `frizzctl watch-run add` for CI and reviews — Frizz\'s server watches on its own credential, even while the screen is locked. Never poll gh; the bundled ci-watch/review-watch monitors cannot sign in under Keyward.\n' +
126
126
  ghReadOnly +
127
127
  'Load the `frizz:gh` skill for the full playbook (recipes and the exact Keyward failures).';
128
128
 
@@ -451,6 +451,68 @@ const WATCH_ISSUE = {
451
451
  },
452
452
  }
453
453
 
454
+ const WATCH_RUN = {
455
+ name: "watch_run",
456
+ description:
457
+ "REGISTER A GITHUB ACTIONS WORKFLOW RUN and Frizz brings you back when it needs you — a job going red " +
458
+ "while the run is still going, the run holding on an environment that needs a reviewer's approval, and " +
459
+ "the run ending. Register it, come to rest, and you are woken. This is how you wait on a release run, " +
460
+ "main's CI after a merge, or a deploy: Frizz's server polls GitHub with its own read-only sign-in, so " +
461
+ "nothing of yours keeps running and your thread can rest.\n\n" +
462
+ "NAME THE RUN, OR THE COMMIT AND ITS WORKFLOW. `owner/repo/actions/runs/<id>` or the run's URL follows " +
463
+ "that run. `owner/repo@<sha> --workflow test.yml` follows that workflow's run on that commit, and the run " +
464
+ "need not exist yet: a merge commit's CI starts seconds later, and Frizz finds it. If none has started " +
465
+ "after 15m, you are told once (a path filter or an `if:` may have skipped it).\n\n" +
466
+ "A HOLD ON AN ENVIRONMENT WAKES YOU, with its reviewers, whether the account Frizz reads GitHub with can " +
467
+ "approve it, and the approve command with the id filled in. That command needs a credential that can " +
468
+ "write; if you cannot approve it, ask a reviewer.\n\n" +
469
+ "IT FOLLOWS RE-RUNS. A pass settles it. A red end (failed, cancelled, timed out) leaves it ARMED until its " +
470
+ "`--for` runs out, so re-running the failed jobs is followed with no new registration; drop it when nobody " +
471
+ "will re-run. A run that has already passed is refused: there is nothing left to wait for.\n\n" +
472
+ "NAME IT IN YOUR ```awaiting FENCE TOO, under `runs:` (the same string you registered), with `status: " +
473
+ "working` while the run is going. REGISTERING IS IDEMPOTENT per run (and per commit and workflow), so " +
474
+ "re-registering after a compaction is safe. `frizzctl watch-run list` reads back what you hold, with each " +
475
+ "run's state. You can only ever watch a run on your OWN thread.",
476
+ inputSchema: {
477
+ type: "object",
478
+ properties: {
479
+ action: {
480
+ type: "string",
481
+ enum: ["add", "list", "drop"],
482
+ description:
483
+ "`add` registers a watcher (idempotent per run); `drop` withdraws one by id; `list` reads back every " +
484
+ "run watched on this thread, with its latest state, without changing anything.",
485
+ },
486
+ target: {
487
+ type: "string",
488
+ description:
489
+ "Required for `add`. The run, as `owner/repo/actions/runs/<id>` or a run URL, or a commit as " +
490
+ "`owner/repo@<sha>` (full or at least 7 characters) together with `workflow`. A target that cannot be " +
491
+ "parsed, or a run Frizz's own GitHub sign-in cannot read, is REFUSED rather than stored, with the reason.",
492
+ },
493
+ workflow: {
494
+ type: "string",
495
+ description:
496
+ "Required with an `owner/repo@<sha>` target, and only there. The workflow whose run on that commit to " +
497
+ "follow, by file name (`test.yml`) or by its `name:` (`Test Linux`).",
498
+ },
499
+ for: {
500
+ type: "string",
501
+ description:
502
+ "REQUIRED for `add`. How long to watch, as a DURATION — `30m`, `6h`, `3d` (max 30d, after which GitHub " +
503
+ "cancels a run still waiting on an environment). The watcher settles itself when this runs out and " +
504
+ "tells you. Give it the run's length plus slack: a CI run, an hour or two; a release that waits on a " +
505
+ "human's approval, a day or more.",
506
+ },
507
+ id: {
508
+ type: "string",
509
+ description: "Required for `drop`. The watcher id returned by `add` (or listed by `list`).",
510
+ },
511
+ },
512
+ required: ["action"],
513
+ },
514
+ }
515
+
454
516
  // The registry that replaces a ```awaiting fence's `shells:` line: a wait the worker CREATES rather
455
517
  // than one it restates at every rest. Two commands rather than one action-switch, because they are two
456
518
  // verbs and a worker reaching for `unwatch` should find `unwatch`. See plans/rest-by-registration.md.
@@ -525,8 +587,8 @@ const UNWATCH = {
525
587
  "you are about to end the thread. A watch you no longer care about still wakes you for nothing, and " +
526
588
  "it blocks `done` until it is withdrawn.\n\n" +
527
589
  "You do NOT need this when the work simply finishes: frizz settles the row itself and wakes you. " +
528
- "`frizzctl activity` prints the id of everything you hold. A `watch-pr` / `watch-issue` id (`prw_…` / " +
529
- "`isw_…`), a `timer` id (`tmr_…`) or a `monitor` id (`cmw_…`) is withdrawn here too.",
590
+ "`frizzctl activity` prints the id of everything you hold. A `watch-pr` / `watch-issue` / `watch-run` id " +
591
+ "(`prw_…` / `isw_…` / `rnw_…`), a `timer` id (`tmr_…`) or a `monitor` id (`cmw_…`) is withdrawn here too.",
530
592
  inputSchema: {
531
593
  type: "object",
532
594
  properties: {
@@ -724,7 +786,7 @@ const DONE = {
724
786
  "longer need — then run it again. There is no force flag and there will not be one.\n\n" +
725
787
  "IT ONLY COUNTS WHAT IS REGISTERED. A background shell or a sub-agent you never registered does " +
726
788
  "not block this, because frizz cannot tell a build you are waiting on from a dev server you walked " +
727
- "away from. That judgement is yours, and registering it is how you make it.\n\n" +
789
+ "away from. That judgment is yours, and registering it is how you make it.\n\n" +
728
790
  "DONE MEANS THE WORK LANDED, NOT THAT YOU STOPPED. Code committed to the project's mainline; a " +
729
791
  "plan, doc or commissioned report written INTO A FILE. An open pull request is not done — the " +
730
792
  "merge is. An investigation headed for a fix is not done — the fix is. And a verdict that ends in " +
@@ -1134,7 +1196,7 @@ const MODELS = {
1134
1196
  },
1135
1197
  json: {
1136
1198
  type: "boolean",
1137
- description: "Print the catalogue as JSON instead of text.",
1199
+ description: "Print the catalog as JSON instead of text.",
1138
1200
  },
1139
1201
  },
1140
1202
  required: [],
@@ -1144,7 +1206,7 @@ const MODELS = {
1144
1206
  // WATCH_ISSUE rides at the END (2026-09-14), and SECRET, STEER, WATCH_COMMAND, MONITOR and THREADS after it: the tool list is
1145
1207
  // read by position in frizz-mcp.test.ts, and a worker's runtime reads it by name, so the order costs nothing and appending
1146
1208
  // breaks nothing.
1147
- const TOOLS = [SPAWN_THREAD, GOAL, TIMER, WATCH_PR, WATCH, UNWATCH, ASK, UNASK, DONE, TITLE, ACTIVITY, LINK, UNLINK, WATCH_ISSUE, SECRET, STEER, WATCH_COMMAND, MONITOR, THREADS, SPAWN_CHILD, MCP, WORKTREE, MODELS]
1209
+ const TOOLS = [SPAWN_THREAD, GOAL, TIMER, WATCH_PR, WATCH, UNWATCH, ASK, UNASK, DONE, TITLE, ACTIVITY, LINK, UNLINK, WATCH_ISSUE, SECRET, STEER, WATCH_COMMAND, MONITOR, THREADS, SPAWN_CHILD, MCP, WORKTREE, MODELS, WATCH_RUN]
1148
1210
 
1149
1211
  /** @type {Record<string, (args: Record<string, unknown>) => Promise<string>>} */
1150
1212
  const HANDLERS = {
@@ -1154,6 +1216,7 @@ const HANDLERS = {
1154
1216
  [TIMER.name]: timer,
1155
1217
  [WATCH_PR.name]: watchPr,
1156
1218
  [WATCH_ISSUE.name]: watchIssue,
1219
+ [WATCH_RUN.name]: watchRun,
1157
1220
  [WATCH.name]: watch,
1158
1221
  [ASK.name]: ask,
1159
1222
  [UNASK.name]: unask,
@@ -1540,14 +1603,15 @@ async function activity() {
1540
1603
  // keys are PLURAL sequences, so an id printed on its own line is no longer something a worker can copy
1541
1604
  // into a fence — it has to see the shape. This command is where the contract sends a worker that has lost
1542
1605
  // an id, so printing the retired one-line-per-item form would teach the very grammar frizz refuses.
1543
- const byKind = { shell: [], agent: [], timer: [], pr: [], issue: [], command: [], thread: [] }
1606
+ const byKind = { shell: [], agent: [], timer: [], pr: [], issue: [], run: [], command: [], thread: [] }
1544
1607
  for (const i of items) if (byKind[i.kind] && i.id) byKind[i.kind].push(i.id)
1545
- const block = Object.entries({ shells: byKind.shell, agents: byKind.agent, timers: byKind.timer, prs: byKind.pr, issues: byKind.issue, commands: byKind.command, threads: byKind.thread })
1608
+ const block = Object.entries({ shells: byKind.shell, agents: byKind.agent, timers: byKind.timer, prs: byKind.pr, issues: byKind.issue, runs: byKind.run, commands: byKind.command, threads: byKind.thread })
1546
1609
  .filter(([, ids]) => ids.length > 0)
1547
1610
  .map(([key, ids]) => ` ${key}: [${ids.join(", ")}]`)
1548
1611
  // The template guesses `status:` from the kinds — a shell or a sub-agent is usually work that finishes
1549
1612
  // by itself, a PR, an issue or a timer a watch — and the prose tells the worker to correct it.
1550
- const status = byKind.shell.length + byKind.agent.length + byKind.thread.length > 0 ? "working" : "watching"
1613
+ // A workflow run finishes by itself too, so it guesses `working`.
1614
+ const status = byKind.shell.length + byKind.agent.length + byKind.thread.length + byKind.run.length > 0 ? "working" : "watching"
1551
1615
  return (
1552
1616
  `${items.length} thing${items.length === 1 ? "" : "s"} running on this thread:\n\n${lines.join("\n")}\n\n` +
1553
1617
  "Name the ones you are ACTUALLY waiting on in your ```awaiting fence. The frontmatter is YAML — one " +
@@ -2494,7 +2558,8 @@ async function timer(args) {
2494
2558
  function armedPrWatchList(result) {
2495
2559
  // Only the PULL REQUESTS: the registry holds issues too (`watch_issue`), and each command reads back its
2496
2560
  // own kind so a worker asking where its PRs stand is not told about an issue it registered elsewhere.
2497
- const watches = (Array.isArray(result?.watches) ? result.watches : []).filter((w) => w.kind !== "issue")
2561
+ // `kind` absent is a server from before issues, whose every row is a pull request.
2562
+ const watches = (Array.isArray(result?.watches) ? result.watches : []).filter((w) => (w.kind ?? "pull") === "pull")
2498
2563
  if (!watches.length) return "No pull requests are watched on this thread — nothing will wake you."
2499
2564
  const lines = watches.map((w) => {
2500
2565
  const g = w.github
@@ -2530,6 +2595,27 @@ function armedIssueWatchList(result) {
2530
2595
  return `Issues watched on this thread now:\n${lines.join("\n")}`
2531
2596
  }
2532
2597
 
2598
+ /** The run twin of armedPrWatchList: the WORKFLOW RUNS watched on this thread, with each one's last-polled state.
2599
+ * @param {{ watches?: Array<{id: string, kind?: string, target: string, workflow?: string, expiresAt?: string, run?: {status: string, conclusion?: string, workflow?: string, runNumber?: number, attempt?: number, jobs: number, done: number, failing: string[], held: string[]}}> }|undefined} result */
2600
+ function armedRunWatchList(result) {
2601
+ const watches = (Array.isArray(result?.watches) ? result.watches : []).filter((w) => w.kind === "run")
2602
+ if (!watches.length) return "No workflow runs are watched on this thread — nothing will wake you."
2603
+ const lines = watches.map((w) => {
2604
+ const r = w.run
2605
+ const name = r?.workflow ? `${r.workflow}${r.runNumber ? ` #${r.runNumber}` : ""}${r.attempt && r.attempt > 1 ? ` (attempt ${r.attempt})` : ""}` : w.workflow ? `${w.workflow}, run not started yet` : ""
2606
+ const jobs = r && r.jobs > 0 ? `, ${r.done}/${r.jobs} jobs done` : ""
2607
+ const state = !r
2608
+ ? (w.workflow ? "waiting for its run to start" : "not polled yet")
2609
+ : r.status === "completed"
2610
+ ? `ended: ${r.conclusion ?? "unknown"}${r.failing.length ? ` (red: ${r.failing.join(", ")})` : ""}`
2611
+ : r.status === "waiting"
2612
+ ? `waiting${r.held.length ? ` on the ${r.held.join(", ")} environment${r.held.length === 1 ? "" : "s"}` : ""}${jobs}`
2613
+ : `${r.status === "queued" ? "queued" : "running"}${jobs}${r.failing.length ? `, red: ${r.failing.join(", ")}` : ""}`
2614
+ return ` ${w.id} ${w.target}${name ? ` "${name}"` : ""} — ${state}${w.expiresAt ? ` (until ${w.expiresAt})` : ""}`
2615
+ })
2616
+ return `Workflow runs watched on this thread now:\n${lines.join("\n")}`
2617
+ }
2618
+
2533
2619
  /** The armed watches on this thread, as the read-back prints them. */
2534
2620
  function armedWatchList(result) {
2535
2621
  const watches = Array.isArray(result?.watches) ? result.watches : []
@@ -2581,13 +2667,14 @@ async function unwatch(args) {
2581
2667
  // A PR, issue or timer id is not a `watch` row, and dropOwnWatch would report it "already settled"
2582
2668
  // while it stayed armed. The id prefix names its kind, so the one verb a worker reaches for routes it
2583
2669
  // to the call that really withdraws it.
2584
- if (id.startsWith("prw_") || id.startsWith("isw_")) {
2670
+ if (id.startsWith("prw_") || id.startsWith("isw_") || id.startsWith("rnw_")) {
2585
2671
  const dropped = (await callRpc("dropOwnPrWatch", { slug, id }))?.result
2586
- const kind = id.startsWith("isw_") ? "issue" : "pull request"
2672
+ const kind = id.startsWith("isw_") ? "issue" : id.startsWith("rnw_") ? "workflow run" : "pull request"
2587
2673
  const head = dropped?.dropped
2588
2674
  ? `Watcher ${id} dropped. It will not wake you.`
2589
2675
  : `No ARMED ${kind} watcher ${id} on this thread — it was already settled, or the id is not one of yours.`
2590
- return `${head}\n\n${id.startsWith("isw_") ? armedIssueWatchList(dropped) : armedPrWatchList(dropped)}`
2676
+ const list = id.startsWith("isw_") ? armedIssueWatchList(dropped) : id.startsWith("rnw_") ? armedRunWatchList(dropped) : armedPrWatchList(dropped)
2677
+ return `${head}\n\n${list}`
2591
2678
  }
2592
2679
  if (id.startsWith("cmw_")) {
2593
2680
  const dropped = (await callRpc("dropOwnCommandWatch", { slug, id }))?.result
@@ -2736,7 +2823,7 @@ async function done(args) {
2736
2823
  parts.push(
2737
2824
  `${watches.length} registration${watches.length === 1 ? "" : "s"} still armed:\n${watches.join("\n")}\n` +
2738
2825
  "A live wait means the thing you were waiting for has not happened. Wait for it, or drop the ones " +
2739
- "that stopped mattering (`frizzctl unwatch <id>` takes a watch, a PR or issue watcher, a timer, or a monitor).",
2826
+ "that stopped mattering (`frizzctl unwatch <id>` takes a watch, a PR, issue or run watcher, a timer, or a monitor).",
2740
2827
  )
2741
2828
  }
2742
2829
  parts.push("There is no force flag. Resolve them and run `frizzctl done` again.")
@@ -2842,6 +2929,62 @@ async function watchIssue(args) {
2842
2929
  )
2843
2930
  }
2844
2931
 
2932
+ /** The `watch_run` handler: register, withdraw, or read back this thread's workflow run watchers. The same
2933
+ * three RPCs as `watchPr` — one registry — with `kind: "run"` (and `workflow`, for a commit target) on the add.
2934
+ * @param {Record<string, unknown>} args @returns {Promise<string>} */
2935
+ async function watchRun(args) {
2936
+ const slug = threadSlug()
2937
+ const action = actionOf("watch_run", args.action)
2938
+ if (action !== "add" && action !== "list" && action !== "drop") {
2939
+ throw new Error("`action` must be one of \"add\", \"list\" or \"drop\"")
2940
+ }
2941
+ if (action === "list") {
2942
+ return armedRunWatchList((await callRpc("listOwnPrWatches", { slug }))?.result)
2943
+ }
2944
+ if (action === "drop") {
2945
+ const id = typeof args.id === "string" ? args.id.trim() : ""
2946
+ if (!id) throw new Error("`id` is required to drop a watcher — take it from `add` or from `list`")
2947
+ const result = (await callRpc("dropOwnPrWatch", { slug, id }))?.result
2948
+ const head = result?.dropped
2949
+ ? `Watcher ${id} dropped. It will not wake you.`
2950
+ : `No ARMED watcher ${id} on this thread — it was already settled, or the id is not one of yours.`
2951
+ return `${head}\n\n${armedRunWatchList(result)}`
2952
+ }
2953
+ const target = typeof args.target === "string" ? args.target.trim() : ""
2954
+ if (!target) throw new Error("`target` is required — the run, as `owner/repo/actions/runs/<id>` or a run URL, or `owner/repo@<sha>` with `--workflow`")
2955
+ const forValue = typeof args.for === "string" ? args.for.trim() : ""
2956
+ if (!forValue) throw new Error("`for` is required — a DURATION like `30m`, `6h` or `3d` (max 30d), never an instant")
2957
+ const workflow = typeof args.workflow === "string" && args.workflow.trim() ? args.workflow.trim() : undefined
2958
+ const result = (await callRpc("addOwnPrWatch", { slug, target, for: forValue, kind: "run", ...(workflow ? { workflow } : {}) }))?.result
2959
+ const id = result?.id ?? "(unknown)"
2960
+ const ref = result?.target ?? target
2961
+ const until = result?.expiresAt ? ` until ${result.expiresAt}` : ""
2962
+ const view = (Array.isArray(result?.watches) ? result.watches : []).find((w) => w.id === id)
2963
+ const r = view?.run
2964
+ // WHERE THE RUN STANDS NOW, from GitHub's own answer at registration — above all a run that has already
2965
+ // ended red, which is armed (a re-run may follow) and would otherwise read as one still going.
2966
+ const now = !r
2967
+ ? (view?.workflow ? ` No ${view.workflow} run has started on that commit yet; Frizz looks for it every minute.` : "")
2968
+ : r.status === "completed"
2969
+ ? ` It has ALREADY ENDED: ${r.conclusion ?? "unknown"}. The watcher stays armed in case its failed jobs are re-run; drop it if they will not be.`
2970
+ : ` It is ${r.status === "in_progress" ? "running" : r.status === "waiting" ? "waiting on an environment" : "queued"} now.`
2971
+ const head = result?.alreadyArmed
2972
+ ? `Already watching ${ref} as ${id}${until} — nothing new was registered, and its original expiry stands.`
2973
+ : `Watching ${ref} as ${id}${until}.${now} Frizz wakes you when a job goes red, when the run waits on an ` +
2974
+ "environment's approval, and when it ends; the registration survives your turn ending, a compaction and a frizz restart."
2975
+ const clamped = result?.clampedFrom
2976
+ ? `\n\nYOUR \`--for ${result.clampedFrom}\` WAS CAPPED at the 30d ceiling — the expiry above is what you actually hold.`
2977
+ : ""
2978
+ // The fence names the run as the tool's own target, so a URL the worker pasted is shortened to
2979
+ // `owner/repo/actions/runs/N`. A commit-form watch keeps `owner/repo@<sha>`, the string it was registered by.
2980
+ const fenceName = /^https?:\/\//i.test(target) && result?.target ? result.target : target
2981
+ return (
2982
+ `${head}${clamped}\n\nNAME IT IN YOUR \`\`\`awaiting FENCE TOO (\`runs: [${fenceName}]\`) — the watcher does the ` +
2983
+ `waking, the fence is what lets you come to rest and shows the human what you are waiting for.\n\n` +
2984
+ `DROP IT when it stops mattering (\`frizzctl watch-run drop ${id}\`).\n\n${armedRunWatchList(result)}`
2985
+ )
2986
+ }
2987
+
2845
2988
  /** The monitors armed on this thread, as every `monitor` action reads them back.
2846
2989
  * @param {{ watches?: Array<{id: string, command: string, every: string, expiresAt: string, runs: number, lastRun?: {outcome: string, exitCode: number|null}}> }|undefined} result */
2847
2990
  function armedCommandWatchList(result) {
@@ -3099,6 +3242,19 @@ const CLI = {
3099
3242
  then: { add: ["target"], drop: ["id"] },
3100
3243
  examples: ["frizzctl watch-issue add acme/app#482 --for 30d", "frizzctl watch-issue list", "frizzctl watch-issue drop isw_ab12cd34"],
3101
3244
  },
3245
+ watch_run: {
3246
+ group: "Waiting",
3247
+ summary: "Wake on a GitHub Actions run: a job going red, an environment's approval, the run ending",
3248
+ positional: ["action"],
3249
+ alias: { remove: "drop", rm: "drop", cancel: "drop" },
3250
+ then: { add: ["target"], drop: ["id"] },
3251
+ examples: [
3252
+ "frizzctl watch-run add reylosql/reylo/actions/runs/45656829814 --for 6h",
3253
+ "frizzctl watch-run add acme/app@3f9e2c1 --workflow test.yml --for 2h",
3254
+ "frizzctl watch-run list",
3255
+ "frizzctl watch-run drop rnw_ab12cd34ef56",
3256
+ ],
3257
+ },
3102
3258
  monitor: {
3103
3259
  group: "Waiting",
3104
3260
  summary: "Wake when a command the server re-runs exits 0, or with --persistent on every line a script prints",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gh
3
- description: The gh-CLI playbook for a frizz worker that can reach GitHub (invoke as frizz:gh). Load this whenever your effort touches GitHub — reading or triaging an issue or PR, reviewing a diff, checking CI/release status, or searching issues/PRs — to use `gh` eagerly and correctly, whether plain `gh` is signed in, reads with Frizz's read-only credential while writes go through Keyward (`keyward --reason "…" -- gh …`), or is signed out behind Keyward: the read-vs-write boundary (never comment/label/close/merge unless the human asks), concrete read recipes, Keyward's failure lines and what to do on each, and waiting on CI and reviews with `frizzctl watch-pr add` / `watch-issue add`. The session-seed hook injects a pointer here naming the mode: `⟦gh available, read-only⟧`, `⟦gh available⟧` or `⟦gh available through Keyward⟧`.
3
+ description: The gh-CLI playbook for a frizz worker that can reach GitHub (invoke as frizz:gh). Load this whenever your effort touches GitHub — reading or triaging an issue or PR, reviewing a diff, checking CI/release status, or searching issues/PRs — to use `gh` eagerly and correctly, whether plain `gh` is signed in, reads with Frizz's read-only credential while writes go through Keyward (`keyward --reason "…" -- gh …`), or is signed out behind Keyward: the read-vs-write boundary (never comment/label/close/merge unless the human asks), concrete read recipes, Keyward's failure lines and what to do on each, and waiting on CI, reviews and workflow runs with `frizzctl watch-pr add` / `watch-issue add` / `watch-run add`. The session-seed hook injects a pointer here naming the mode: `⟦gh available, read-only⟧`, `⟦gh available⟧` or `⟦gh available through Keyward⟧`.
4
4
  version: 0.3.0
5
5
  metadata:
6
6
  internal: true
@@ -24,7 +24,7 @@ The injected block names your mode.
24
24
  keyward --reason "<what this command is for, in a sentence>" -- gh issue view 123 -R OWNER/REPO --comments
25
25
  ```
26
26
 
27
- `gh` must be the first word after `--`: Keyward reads only that word, so `keyward -- npx gh …` is not recognised. The reason is shown on the human's Touch ID sheet, so write what they need to recognise the job; a run without `--reason` is refused before anything is asked. Otherwise the exit code is gh's own.
27
+ `gh` must be the first word after `--`: Keyward reads only that word, so `keyward -- npx gh …` is not recognized. The reason is shown on the human's Touch ID sheet, so write what they need to recognize the job; a run without `--reason` is refused before anything is asked. Otherwise the exit code is gh's own.
28
28
 
29
29
  ### Reads and writes in read-only mode
30
30
 
@@ -163,6 +163,20 @@ human (a ` ```question ` fence) — waiting on a person is never a park. The das
163
163
  go/no-go remains a registered question. If the next check deliberately belongs at a named wall-clock
164
164
  instant, set a durable timer with `frizzctl timer set` and park with its id in your fence's `timers:` list.
165
165
 
166
+ ### Wait on a GitHub Actions run with `frizzctl watch-run`
167
+
168
+ A release run, main's CI after a merge, a deploy:
169
+
170
+ ```bash
171
+ frizzctl watch-run add OWNER/REPO/actions/runs/RUN_ID --for 6h
172
+ frizzctl watch-run add OWNER/REPO@SHA --workflow test.yml --for 2h # the run may not have started yet
173
+ ```
174
+
175
+ Rest on it with `runs: [OWNER/REPO/actions/runs/RUN_ID]` (or the `OWNER/REPO@SHA` you registered) and
176
+ `status: working`. It wakes you when a job goes red, when the run waits on an environment's approval
177
+ (with the approve command filled in, which needs a credential that can write), and when the run ends. A
178
+ pass settles it; a red end stays armed so a re-run of the failed jobs is followed.
179
+
166
180
  ### Watching inside a turn — only where plain `gh` can read
167
181
 
168
182
  Sometimes you want the verdict inside the turn you are in, not as a wake after a rest: a CI run you
@@ -201,7 +215,7 @@ such as `push` and `pull_request` both contribute to the aggregate verdict.
201
215
  `TaskOutput` is deprecated. Do not fake waiting with `echo waiting` or sleep-only Bash calls.
202
216
 
203
217
  Both mechanisms are session-bound: they die with the session, and a rest does not wait on them. A wait
204
- you rest on is `frizzctl watch-pr` / `watch-issue`.
218
+ you rest on is `frizzctl watch-pr` / `watch-issue` / `watch-run`.
205
219
 
206
220
  ## Fitting gh work into your thread type
207
221
 
@@ -1 +1 @@
1
- import{m as e,t}from"./mermaid-parser.core-Dr2z-e4o.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-C4XfhTaE.js";import"./chunk-DU6HZSFF-D0BZQTG5.js";import"./chunk-CLGD4ZFX-DXth0YhX.js";import{n as i,r as a,t as o}from"./chunk-SVP7TREG-BC8SdQcL.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";var c=e().RailroadAbnf.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=n(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=n(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=n(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=n(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:n(e=>{o.clear(),r.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new t(n);let i=n.value;r.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),r.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
1
+ import{m as e,t}from"./mermaid-parser.core-BWYaJQLC.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-C4XfhTaE.js";import"./chunk-DU6HZSFF-BrFmYIzY.js";import"./chunk-CLGD4ZFX-BAgdhcJ1.js";import{n as i,r as a,t as o}from"./chunk-SVP7TREG-BD5qJuyG.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";var c=e().RailroadAbnf.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=n(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=n(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=n(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=n(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:n(e=>{o.clear(),r.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new t(n);let i=n.value;r.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),r.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
@@ -0,0 +1 @@
1
+ import"./chunk-FOHPRMQF-CyTuVbu3.js";import{M as e}from"./mermaid-parser.core-BWYaJQLC.js";export{e as createArchitectureServices};