frizz-server 0.15.41 → 0.15.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev-child.js +1156 -367
- package/package.json +1 -1
- package/runtime/cc-worker/bin/frizzctl.mjs +1 -1
- package/runtime/cc-worker/lib/frizz-tools.mjs +302 -7
- package/web-dist/assets/{abnfDiagram-VRR7QNED-DZgIn5ff.js → abnfDiagram-VRR7QNED-R4fnqpL_.js} +1 -1
- package/web-dist/assets/{arc-DwPpA8R3.js → arc-D7SIyyY_.js} +1 -1
- package/web-dist/assets/architecture-TIHT7OUA-CiN6_7kZ.js +1 -0
- package/web-dist/assets/{architectureDiagram-ZJ3FMSHR-DbP9lkjM.js → architectureDiagram-ZJ3FMSHR-D22HkIR4.js} +1 -1
- package/web-dist/assets/{blockDiagram-677ZJIJ3-DwQN1M8B.js → blockDiagram-677ZJIJ3-BYSQJXJL.js} +1 -1
- package/web-dist/assets/{c4Diagram-LMCZKHZV-BF5QrD37.js → c4Diagram-LMCZKHZV-SjlUwA7R.js} +1 -1
- package/web-dist/assets/channel-DMQMWHKq.js +1 -0
- package/web-dist/assets/{chunk-32BRIVSS-CA8c9JxF.js → chunk-32BRIVSS-B6CWPyBg.js} +1 -1
- package/web-dist/assets/{chunk-52WLFC77-CdYcy5t0.js → chunk-52WLFC77-CPot8sRW.js} +1 -1
- package/web-dist/assets/{chunk-C7G6YPKG-4uxANQmd.js → chunk-C7G6YPKG-yG-A9TmK.js} +1 -1
- package/web-dist/assets/{chunk-EX3LRPZG-4wMgoywY.js → chunk-EX3LRPZG-UAuz2xkd.js} +1 -1
- package/web-dist/assets/{chunk-FWX5IMBZ-BH3kLM9J.js → chunk-FWX5IMBZ-CSJBWLcY.js} +2 -2
- package/web-dist/assets/{chunk-HOUHSVGY-C6s3cxko.js → chunk-HOUHSVGY-CGGIln55.js} +1 -1
- package/web-dist/assets/{chunk-ICXQ74PX-9fUt4TuP.js → chunk-ICXQ74PX-DPvO3p3l.js} +1 -1
- package/web-dist/assets/{chunk-MOJQB5TN-CXZbnRJB.js → chunk-MOJQB5TN-cR_XVznl.js} +1 -1
- package/web-dist/assets/{chunk-OGEWGWER-kBUaZg1h.js → chunk-OGEWGWER-DgJ4Na7c.js} +1 -1
- package/web-dist/assets/{chunk-PUDLZKDR-T8I9vJeW.js → chunk-PUDLZKDR-PVkKiizt.js} +1 -1
- package/web-dist/assets/{chunk-Q4XR5HBZ-Bc1e-VQ6.js → chunk-Q4XR5HBZ-BiE_9prp.js} +1 -1
- package/web-dist/assets/{chunk-RYQCIY6F-ExoEx5xU.js → chunk-RYQCIY6F-Dfd2lI97.js} +1 -1
- package/web-dist/assets/{chunk-V7JOEXUC-BejALgmS.js → chunk-V7JOEXUC-MSd34shk.js} +1 -1
- package/web-dist/assets/{chunk-VAUOI2AC-DCxTR7U8.js → chunk-VAUOI2AC-_LdsfMm9.js} +1 -1
- package/web-dist/assets/{chunk-VR4S4FIN-BukySeYi.js → chunk-VR4S4FIN-DgNM8Q2U.js} +1 -1
- package/web-dist/assets/{chunk-WYO6CB5R-Bws7hxsV.js → chunk-WYO6CB5R-DvwyN_Z1.js} +1 -1
- package/web-dist/assets/{chunk-XXDRQBXY-DjA78QDQ.js → chunk-XXDRQBXY-C0vY3rJT.js} +1 -1
- package/web-dist/assets/{chunk-ZGVPDNZ5-DKIh9xod.js → chunk-ZGVPDNZ5-Ca-iIrGH.js} +1 -1
- package/web-dist/assets/classDiagram-OUVF2IWQ-DTyv6Ys_.js +1 -0
- package/web-dist/assets/classDiagram-v2-EOCWNBFH-DTyv6Ys_.js +1 -0
- package/web-dist/assets/{cose-bilkent-JH36ORCC-C9L1n6fr.js → cose-bilkent-JH36ORCC-BLE-b6JZ.js} +1 -1
- package/web-dist/assets/{cynefin-VYW2F7L2-DI26e4Tc.js → cynefin-VYW2F7L2-DbgUjSrw.js} +1 -1
- package/web-dist/assets/{cynefinDiagram-TSTJHNR4-Cp57PoPj.js → cynefinDiagram-TSTJHNR4-DRmXMjB5.js} +1 -1
- package/web-dist/assets/{dagre-VKFMJZFB-DBADVTqD.js → dagre-VKFMJZFB-BXVJTmZ5.js} +1 -1
- package/web-dist/assets/{diagram-FQU43EPY-0HlOV1mt.js → diagram-FQU43EPY-NURkTSwG.js} +1 -1
- package/web-dist/assets/{diagram-G47NLZAW-DgR5-Pxg.js → diagram-G47NLZAW-Cj3RSicU.js} +1 -1
- package/web-dist/assets/{diagram-NH7WQ7WH-DoGKoxYE.js → diagram-NH7WQ7WH-WL3LSlQV.js} +1 -1
- package/web-dist/assets/{diagram-OA4YK3LP-D5GrLhaq.js → diagram-OA4YK3LP-BDgiFton.js} +1 -1
- package/web-dist/assets/{diagram-WEI45ONY-DPj7-RdX.js → diagram-WEI45ONY-fOXZHugt.js} +1 -1
- package/web-dist/assets/{dist-Bo2PwwGZ.js → dist-CdXepqKz.js} +1 -1
- package/web-dist/assets/{ebnfDiagram-CCIWWBDH-DIXYEkGD.js → ebnfDiagram-CCIWWBDH-C3rumWt2.js} +1 -1
- package/web-dist/assets/{erDiagram-Q63AITRT-Dg3MGwWR.js → erDiagram-Q63AITRT-fXC5vjIx.js} +1 -1
- package/web-dist/assets/eventmodeling-45OFAUF4-O_wbqgIy.js +1 -0
- package/web-dist/assets/flowDiagram-23GEKE2U-DPWulizP.js +1 -0
- package/web-dist/assets/{ganttDiagram-NO4QXBWP-BIcCVXZQ.js → ganttDiagram-NO4QXBWP-C_YYhYTS.js} +1 -1
- package/web-dist/assets/{gitGraph-TEB2WS4Q-B5RytoFn.js → gitGraph-TEB2WS4Q-BzIRwr8p.js} +1 -1
- package/web-dist/assets/{gitGraphDiagram-IHSO6WYX-Cb-dT-cW.js → gitGraphDiagram-IHSO6WYX-BOAG2hkd.js} +1 -1
- package/web-dist/assets/index-BZoI3aqA.css +2 -0
- package/web-dist/assets/{index-B5PLhSPz.js → index-CfGKCD_6.js} +120 -117
- package/web-dist/assets/{info-DKCQHKI2-GIyDtSFf.js → info-DKCQHKI2-DiYenczO.js} +1 -1
- package/web-dist/assets/{infoDiagram-FWYZ7A6U-hajuuFGe.js → infoDiagram-FWYZ7A6U-bY5uPyPk.js} +1 -1
- package/web-dist/assets/{ishikawaDiagram-FXEZZL3T-DFX-Hnma.js → ishikawaDiagram-FXEZZL3T-XWRtGb2K.js} +1 -1
- package/web-dist/assets/{journeyDiagram-5HDEW3XC-DCAhU4Cx.js → journeyDiagram-5HDEW3XC-CHNPHjLQ.js} +1 -1
- package/web-dist/assets/{kanban-definition-HUTT4EX6-C3WHlUdK.js → kanban-definition-HUTT4EX6-DyZmBgdz.js} +1 -1
- package/web-dist/assets/{line-CSYf7CnT.js → line-B7I8Db8G.js} +1 -1
- package/web-dist/assets/{linear-Di1L0vVF.js → linear-BYlHJE0j.js} +1 -1
- package/web-dist/assets/{mermaid-parser.core-CudEuGod.js → mermaid-parser.core-1DKULFlf.js} +3 -3
- package/web-dist/assets/{mermaid.core-D2s3bQBM.js → mermaid.core-DS92P-bA.js} +3 -3
- package/web-dist/assets/{mindmap-definition-LN4V7U3C-yXCjhQFg.js → mindmap-definition-LN4V7U3C-CDhSXmFL.js} +1 -1
- package/web-dist/assets/{packet-7NZHBO7P-3EcXllio.js → packet-7NZHBO7P-gxHCLGcb.js} +1 -1
- package/web-dist/assets/{pegDiagram-2B236MQR-CvS28grz.js → pegDiagram-2B236MQR-B2WHH9TM.js} +1 -1
- package/web-dist/assets/{pie-RZYD4A2V-CAmA2Snx.js → pie-RZYD4A2V-CJfSfoox.js} +1 -1
- package/web-dist/assets/{pieDiagram-ENE6RG2P-BYuB33BI.js → pieDiagram-ENE6RG2P-Cg0kblQs.js} +1 -1
- package/web-dist/assets/{quadrantDiagram-ABIIQ3AL-CDnklrlY.js → quadrantDiagram-ABIIQ3AL-BEF0HFg0.js} +1 -1
- package/web-dist/assets/{radar-I7S5WNFK-Bz7Vyy1A.js → radar-I7S5WNFK-BD-NCKAZ.js} +1 -1
- package/web-dist/assets/{railroad-3IZDKUUU-CAUAJCaq.js → railroad-3IZDKUUU-6euojYMA.js} +1 -1
- package/web-dist/assets/railroad-abnf-AHOZXSZD-BxRR4FEv.js +1 -0
- package/web-dist/assets/railroad-ebnf-EBAXGLYW-DYynHpjS.js +1 -0
- package/web-dist/assets/railroad-peg-LSFZ7HO6-wOmjP52W.js +1 -0
- package/web-dist/assets/{railroadDiagram-RFXS5EU6-DZaYV9Io.js → railroadDiagram-RFXS5EU6-CXsPEV9p.js} +1 -1
- package/web-dist/assets/{requirementDiagram-TGXJPOKE-BFlpQunS.js → requirementDiagram-TGXJPOKE-m_jpRKM1.js} +1 -1
- package/web-dist/assets/{sankeyDiagram-HTMAVEWB-DIOr2M-C.js → sankeyDiagram-HTMAVEWB-cvi4BPq1.js} +1 -1
- package/web-dist/assets/{sequenceDiagram-DBY2YBRQ-DpYJiT1u.js → sequenceDiagram-DBY2YBRQ-tRc--AQc.js} +1 -1
- package/web-dist/assets/{src-BkVLS0R9.js → src-CkPXvRdk.js} +1 -1
- package/web-dist/assets/{stateDiagram-2N3HPSRC-C4UYGg5g.js → stateDiagram-2N3HPSRC-DpFbxWsG.js} +1 -1
- package/web-dist/assets/stateDiagram-v2-6OUMAXLB-CrP44Mxj.js +1 -0
- package/web-dist/assets/{swimlanes-5IMT3BWC-cJ6KOezW.js → swimlanes-5IMT3BWC-CmuQ3olM.js} +1 -1
- package/web-dist/assets/swimlanesDiagram-G3AALYLV-gsPqoddO.js +8 -0
- package/web-dist/assets/{timeline-definition-FHXFAJF6-yi-2X9QL.js → timeline-definition-FHXFAJF6-yuDa2CuK.js} +1 -1
- package/web-dist/assets/{treeView-QDETBFTQ-Bnlc02cs.js → treeView-QDETBFTQ-rO5Wh8Eu.js} +1 -1
- package/web-dist/assets/{treemap-6X3UGDF4-DUWj2eOS.js → treemap-6X3UGDF4-wNat2V0h.js} +1 -1
- package/web-dist/assets/{vennDiagram-L72KCM5P-jPHNRI-h.js → vennDiagram-L72KCM5P-CNDV0uDF.js} +1 -1
- package/web-dist/assets/{wardley-OPB4EBWU-CPbgZ6M1.js → wardley-OPB4EBWU-Bahki8cs.js} +1 -1
- package/web-dist/assets/{wardleyDiagram-EHGQE667-CrExyaRO.js → wardleyDiagram-EHGQE667-B87eSsOa.js} +1 -1
- package/web-dist/assets/{xychartDiagram-FW5EYKEG-CN06Wt1I.js → xychartDiagram-FW5EYKEG-Cajd3Ik6.js} +1 -1
- package/web-dist/index.html +2 -2
- package/web-dist/assets/architecture-TIHT7OUA-DaAFvFkn.js +0 -1
- package/web-dist/assets/channel-B1iPbzai.js +0 -1
- package/web-dist/assets/classDiagram-OUVF2IWQ-DQlurrbL.js +0 -1
- package/web-dist/assets/classDiagram-v2-EOCWNBFH-DQlurrbL.js +0 -1
- package/web-dist/assets/eventmodeling-45OFAUF4-CeTMJyik.js +0 -1
- package/web-dist/assets/flowDiagram-23GEKE2U-QhaJlS-W.js +0 -1
- package/web-dist/assets/index-D_uxez2a.css +0 -2
- package/web-dist/assets/railroad-abnf-AHOZXSZD-B9RdcI3r.js +0 -1
- package/web-dist/assets/railroad-ebnf-EBAXGLYW-Cimw_4Xu.js +0 -1
- package/web-dist/assets/railroad-peg-LSFZ7HO6-DJTpn0sf.js +0 -1
- package/web-dist/assets/stateDiagram-v2-6OUMAXLB-CO0mbUgI.js +0 -1
- package/web-dist/assets/swimlanesDiagram-G3AALYLV-AkPUIZ-W.js +0 -8
package/package.json
CHANGED
|
@@ -276,7 +276,7 @@ function topHelp() {
|
|
|
276
276
|
}).filter(Boolean)
|
|
277
277
|
return [
|
|
278
278
|
`${NAME} — the Frizz command line for the worker of one thread.`,
|
|
279
|
-
"Every command acts
|
|
279
|
+
"Every command acts AS the thread whose worker runs it; there is no way to act as another.",
|
|
280
280
|
"",
|
|
281
281
|
"Usage:",
|
|
282
282
|
` ${NAME} <command> [arguments]`,
|
|
@@ -841,10 +841,117 @@ const WATCH_COMMAND = {
|
|
|
841
841
|
},
|
|
842
842
|
}
|
|
843
843
|
|
|
844
|
-
//
|
|
845
|
-
//
|
|
844
|
+
// ONE REGISTRATION, MANY WAKES (2026-11-02): a script the SERVER keeps running, every stdout line a wake.
|
|
845
|
+
// Claude Code's own Monitor tool moved into the server, so it outlives the session's turns and the thread
|
|
846
|
+
// can hibernate under it. A command watch row of kind `monitor`; see packages/server/src/command-watch.ts.
|
|
847
|
+
const MONITOR = {
|
|
848
|
+
name: "monitor",
|
|
849
|
+
description:
|
|
850
|
+
"WAKE ON EVERY LINE A LONG-RUNNING SCRIPT PRINTS. Give Frizz a script that keeps running and prints a " +
|
|
851
|
+
"line each time something happens — a log tail filtered to the lines you would act on, a poll loop that " +
|
|
852
|
+
"prints each new PR comment, a listener on a socket — and the SERVER runs it for you: every line it " +
|
|
853
|
+
"prints on stdout wakes you with that line, for as long as `--for` lasts. Register once, woken many " +
|
|
854
|
+
"times. Nothing of yours runs meanwhile, so your thread can hibernate while it rests; Claude Code's own " +
|
|
855
|
+
"Monitor tool dies with your session after at most 30 minutes, and pins your process tree while it runs.\n\n" +
|
|
856
|
+
"STDOUT IS THE EVENT STREAM. Lines printed within 200ms of each other are one event; blank lines are " +
|
|
857
|
+
"nothing. Stderr is never an event, but its tail is reported when the script exits — merge it with " +
|
|
858
|
+
"`2>&1` into a filter if its failures are what you watch for. Every stage of a pipe must flush per line " +
|
|
859
|
+
"(`grep --line-buffered`, `awk` with `fflush()`), or lines sit in a buffer unseen.\n\n" +
|
|
860
|
+
"EVERY EVENT IS A TURN OF YOURS, so print only what you would act on — never raw logs. Events are " +
|
|
861
|
+
"merged while you work and for 5m after each wake, so a burst costs one turn; but a monitor that prints " +
|
|
862
|
+
"30 events inside 10m is stopped, and you are told to tighten its filter. Cover the failure signals as " +
|
|
863
|
+
"well as the success one: silence reads exactly like \"still running\".\n\n" +
|
|
864
|
+
"IT RUNS ON THE SERVER, NOT IN YOUR SHELL: `/bin/sh -c` in the project root, with the server's " +
|
|
865
|
+
"environment and PATH, stdin closed. Nothing your session exported, no aliases, no functions; use " +
|
|
866
|
+
"absolute paths. Registration watches it for 2s: anything it prints by then, or its exit, is in the " +
|
|
867
|
+
"reply instead of a wake. If Frizz restarts, the script is started again from the top — so make its " +
|
|
868
|
+
"first lines harmless to repeat (baseline silently, then print only what is new).\n\n" +
|
|
869
|
+
"IT ENDS when the script exits (you are woken once with the exit code and its last output), when " +
|
|
870
|
+
"`--for` runs out, or when you drop it. A poll loop that should stop on a known end — a CI run " +
|
|
871
|
+
"finishing — exits itself. ONLY ON A THREAD WITH NO PERMISSION CHECKS: Frizz refuses it unless this " +
|
|
872
|
+
"thread runs in `bypassPermissions` mode with Claude Code's sandbox off, and refuses it on Codex.\n\n" +
|
|
873
|
+
"Name its id in your ```awaiting fence — `commands: [cmw_…]` with `status: watching` — and come to rest. " +
|
|
874
|
+
"Idempotent on the exact script text. `list` reads back what is armed; `drop` stops one (so does " +
|
|
875
|
+
"`frizzctl unwatch <id>`). Only ever your OWN thread's.",
|
|
876
|
+
inputSchema: {
|
|
877
|
+
type: "object",
|
|
878
|
+
properties: {
|
|
879
|
+
action: {
|
|
880
|
+
type: "string",
|
|
881
|
+
enum: ["add", "list", "drop"],
|
|
882
|
+
description: "`add` starts a monitor (idempotent per script); `drop` stops one by id; `list` reads back every monitor and command watch armed on this thread.",
|
|
883
|
+
},
|
|
884
|
+
command: {
|
|
885
|
+
type: "string",
|
|
886
|
+
description:
|
|
887
|
+
"Required for `add`. The script, as one shell command line run with `/bin/sh -c` in the project root. " +
|
|
888
|
+
"Each line it prints on stdout is an event. A longer script belongs in a file this line runs.",
|
|
889
|
+
},
|
|
890
|
+
description: {
|
|
891
|
+
type: "string",
|
|
892
|
+
description:
|
|
893
|
+
"Optional for `add`, and worth giving: what it watches, in a few words (\"errors in deploy.log\", " +
|
|
894
|
+
"\"new comments on acme/app#62\"). It labels every wake and the row the human sees.",
|
|
895
|
+
},
|
|
896
|
+
for: {
|
|
897
|
+
type: "string",
|
|
898
|
+
description: "Required for `add`. How long to keep it running, as a DURATION — `2h`, `1d`, `7d` (max 7d). When it runs out the script is stopped and you are woken once.",
|
|
899
|
+
},
|
|
900
|
+
id: {
|
|
901
|
+
type: "string",
|
|
902
|
+
description: "Required for `drop`. The `cmw_…` id `add` printed (or that `list` and `frizzctl activity` show).",
|
|
903
|
+
},
|
|
904
|
+
},
|
|
905
|
+
required: ["action"],
|
|
906
|
+
},
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
// A BOARD'S THREADS, as another agent reads them (2026-11-03). Until then a worker could message any
|
|
910
|
+
// thread on the machine (`steer`) and start one anywhere (`spawn-thread`), but had no way to see which
|
|
911
|
+
// threads exist, what they are called, or whether they are working, waiting or finished — so it could not
|
|
912
|
+
// find the thread already on its bug, or the slug of the one it should tell. packages/server/src/
|
|
913
|
+
// thread-listing.ts is the readout; the band in it is the sidebar's own.
|
|
914
|
+
const THREADS = {
|
|
915
|
+
name: "threads",
|
|
916
|
+
description:
|
|
917
|
+
"LIST THE THREADS ON A BOARD — your own project's, or any other project this Frizz serves — each by " +
|
|
918
|
+
"its slug, the title the human's sidebar shows, and where it sits on the board:\n\n" +
|
|
919
|
+
" rested — in the human's QUEUE: it came to rest with a card waiting on them (a question, a " +
|
|
920
|
+
"handoff, finished work, a failure).\n" +
|
|
921
|
+
" active — open with no card, in practice SPINNING: a turn in flight, or its own sub-agents, " +
|
|
922
|
+
"shells or CI still running.\n" +
|
|
923
|
+
" snoozed — PARKED: the human snoozed it, or its worker rested on something outside the thread " +
|
|
924
|
+
"(a review, a release, a timer).\n" +
|
|
925
|
+
" done — archived. Left out unless `--all`, because on a long-lived board it is nearly every " +
|
|
926
|
+
"thread; the count is always printed.\n\n" +
|
|
927
|
+
"Each row also says what the thread is doing right now (the tool call in flight), the first line of " +
|
|
928
|
+
"its newest message, what it is waiting on (sub-agents, shells, watched PRs, open questions), and how " +
|
|
929
|
+
"long ago it last moved.\n\n" +
|
|
930
|
+
"USE IT BEFORE YOU DUPLICATE SOMEONE'S WORK, AND TO FIND WHO TO TELL. Another thread may already be on " +
|
|
931
|
+
"the bug you just found, or waiting on the commit you just landed; the slug in the first column is " +
|
|
932
|
+
"what `frizzctl steer` takes (with `--project` for a thread on another board).\n\n" +
|
|
933
|
+
"`--json` prints the whole listing — every field, ISO timestamps — for `jq`. It only reads: nothing is " +
|
|
934
|
+
"changed, and no thread is woken by being listed.",
|
|
935
|
+
inputSchema: {
|
|
936
|
+
type: "object",
|
|
937
|
+
properties: {
|
|
938
|
+
project: {
|
|
939
|
+
type: "string",
|
|
940
|
+
description:
|
|
941
|
+
"Another project's board: its slug, as its board URL shows it (`/project/<slug>/…`), or any link " +
|
|
942
|
+
"into that board. Omitted ⇒ your own project.",
|
|
943
|
+
},
|
|
944
|
+
all: { type: "boolean", description: "Also list the Done band — every archived thread, newest first." },
|
|
945
|
+
json: { type: "boolean", description: "Print the listing as JSON instead of text." },
|
|
946
|
+
},
|
|
947
|
+
required: [],
|
|
948
|
+
},
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// WATCH_ISSUE rides at the END (2026-09-14), and SECRET, STEER, WATCH_COMMAND, MONITOR and THREADS after it: the tool list is
|
|
952
|
+
// read by position in frizz-mcp.test.ts, and a worker's runtime reads it by name, so the order costs nothing and appending
|
|
846
953
|
// breaks nothing.
|
|
847
|
-
const TOOLS = [SPAWN_THREAD, GOAL, TIMER, WATCH_PR, WATCH, UNWATCH, ASK, UNASK, DONE, TITLE, ACTIVITY, LINK, UNLINK, WATCH_ISSUE, SECRET, STEER, WATCH_COMMAND]
|
|
954
|
+
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]
|
|
848
955
|
|
|
849
956
|
/** @type {Record<string, (args: Record<string, unknown>) => Promise<string>>} */
|
|
850
957
|
const HANDLERS = {
|
|
@@ -865,6 +972,8 @@ const HANDLERS = {
|
|
|
865
972
|
[UNLINK.name]: unlink,
|
|
866
973
|
[STEER.name]: steer,
|
|
867
974
|
[WATCH_COMMAND.name]: watchCommand,
|
|
975
|
+
[MONITOR.name]: monitor,
|
|
976
|
+
[THREADS.name]: threads,
|
|
868
977
|
}
|
|
869
978
|
|
|
870
979
|
// The slug out of whatever a worker has in hand for a thread: the slug itself, the `[title](/thread/<slug>)`
|
|
@@ -908,6 +1017,105 @@ async function steer(args) {
|
|
|
908
1017
|
)
|
|
909
1018
|
}
|
|
910
1019
|
|
|
1020
|
+
/** The `threads` handler: one board's threads, from this project's `listThreads`, which finds the other
|
|
1021
|
+
* project itself when one is named (as `steer` and `spawn-thread --project` do).
|
|
1022
|
+
* @param {Record<string, unknown>} args @returns {Promise<string>} */
|
|
1023
|
+
async function threads(args) {
|
|
1024
|
+
const raw = typeof args.project === "string" ? args.project.trim() : ""
|
|
1025
|
+
const project = raw ? decodeURIComponent(PROJECT_SEGMENT.exec(raw)?.[1] ?? raw) : ""
|
|
1026
|
+
const result = (await callRpc("listThreads", { ...(project ? { project } : {}), ...(args.all === true ? { all: true } : {}) }))?.result
|
|
1027
|
+
if (!result?.project || !Array.isArray(result.threads) || !result.counts) {
|
|
1028
|
+
throw new Error(`listThreads returned no listing: ${JSON.stringify(result)?.slice(0, 300)}`)
|
|
1029
|
+
}
|
|
1030
|
+
if (args.json === true) return JSON.stringify(result, null, 2)
|
|
1031
|
+
// THE CALLER IS MARKED, not left out: a worker reading its own board should see itself where the human
|
|
1032
|
+
// sees it. Optional — a shell with no thread can list a board too, and simply has no row to mark.
|
|
1033
|
+
const own = !project || result.project.id === projectSegment()
|
|
1034
|
+
const caller = own ? process.env.FRIZZ_THREAD_SLUG || process.env.FRIZZ_THREAD || "" : ""
|
|
1035
|
+
return threadsReport(result, { caller, all: args.all === true, nowMs: Date.now() })
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
const BAND_HEADINGS = {
|
|
1039
|
+
rested: "Rested — in the human's queue",
|
|
1040
|
+
active: "Active — spinning",
|
|
1041
|
+
snoozed: "Snoozed — parked",
|
|
1042
|
+
done: "Done — archived",
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
/** How long ago an instant was, in the house duration grammar (`40m`, `2h 35m`, `3d 4h`; see
|
|
1046
|
+
* `packages/web/src/lib/durationLabels.ts`). @param {string|undefined} iso @param {number} nowMs */
|
|
1047
|
+
function agoLabel(iso, nowMs) {
|
|
1048
|
+
const at = Date.parse(iso ?? "")
|
|
1049
|
+
if (!Number.isFinite(at)) return undefined
|
|
1050
|
+
const s = Math.max(0, Math.floor((nowMs - at) / 1000))
|
|
1051
|
+
if (s < 60) return `${s}s`
|
|
1052
|
+
const m = Math.floor(s / 60)
|
|
1053
|
+
if (m < 60) return `${m}m`
|
|
1054
|
+
const h = Math.floor(m / 60)
|
|
1055
|
+
if (h < 24) return m % 60 ? `${h}h ${m % 60}m` : `${h}h`
|
|
1056
|
+
const d = Math.floor(h / 24)
|
|
1057
|
+
if (d < 7) return h % 24 ? `${d}d ${h % 24}h` : `${d}d`
|
|
1058
|
+
if (d < 30) return `${Math.floor(d / 7)}w`
|
|
1059
|
+
if (d < 365) return `${Math.floor(d / 30)}mo`
|
|
1060
|
+
return `${Math.floor(d / 365)}y`
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
const plural = (/** @type {number} */ n, /** @type {string} */ one, many = `${one}s`) => `${n} ${n === 1 ? one : many}`
|
|
1064
|
+
|
|
1065
|
+
/** One thread's facts line: what it is doing or waiting on, and when it last moved.
|
|
1066
|
+
* @param {any} t @param {number} nowMs */
|
|
1067
|
+
function threadFacts(t, nowMs) {
|
|
1068
|
+
const facts = []
|
|
1069
|
+
if (t.runtime === "running" || t.runtime === "spawning") facts.push(t.doing ? `turn in flight: ${t.doing}` : "turn in flight")
|
|
1070
|
+
if (t.runtime === "perm-prompt") facts.push("on a permission prompt")
|
|
1071
|
+
if (t.questions > 0) facts.push(`${plural(t.questions, "question")} open`)
|
|
1072
|
+
if (t.subAgents > 0) facts.push(`${plural(t.subAgents, "sub-agent")} running`)
|
|
1073
|
+
if (t.shells > 0) facts.push(`${plural(t.shells, "shell")} running`)
|
|
1074
|
+
for (const w of t.watches ?? []) facts.push(`watching ${w}`)
|
|
1075
|
+
if (t.limited) facts.push("stopped by a usage limit")
|
|
1076
|
+
else if (t.crashed) facts.push("crashed mid-turn")
|
|
1077
|
+
else if (t.runtime === "exited" && t.band !== "done" && t.fence !== "done") facts.push("worker exited")
|
|
1078
|
+
if (t.fence === "done") facts.push("signed off done")
|
|
1079
|
+
// An awaiting fence on a QUEUED thread is a handoff (`needs_input`, `steps:`); elsewhere it is the park
|
|
1080
|
+
// the band already states, and the watches above already name what it is parked on.
|
|
1081
|
+
else if (t.fence === "awaiting" && t.band === "rested") facts.push("handed off to the human")
|
|
1082
|
+
if (t.snoozedUntil) facts.push(`snoozed until ${t.snoozedUntil}`)
|
|
1083
|
+
const moved = t.band === "done"
|
|
1084
|
+
? agoLabel(t.archivedAt ?? t.lastActivityAt, nowMs)
|
|
1085
|
+
: agoLabel(t.lastActivityAt ?? t.restedAt ?? t.spawnedAt, nowMs)
|
|
1086
|
+
if (moved) facts.push(`${t.band === "done" ? "archived" : "last moved"} ${moved} ago`)
|
|
1087
|
+
return facts.join(" · ")
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
/** The text readout: a count line, then one block per band, one thread per two or three lines.
|
|
1091
|
+
* @param {any} result @param {{ caller: string, all: boolean, nowMs: number }} opts */
|
|
1092
|
+
function threadsReport(result, { caller, all, nowMs }) {
|
|
1093
|
+
const { counts } = result
|
|
1094
|
+
const open = counts.rested + counts.active + counts.snoozed
|
|
1095
|
+
const tally = [`${counts.rested} rested`, `${counts.active} active`, `${counts.snoozed} snoozed`].join(", ")
|
|
1096
|
+
const doneNote = all ? `${counts.done} done` : `${counts.done} done, not listed (\`--all\` lists them)`
|
|
1097
|
+
const head = `${result.project.name} (\`${result.project.slug}\`) — ${plural(open, "open thread")} (${tally}); ${doneNote}.`
|
|
1098
|
+
if (result.threads.length === 0) return `${head}\n\nNothing to list.`
|
|
1099
|
+
const blocks = []
|
|
1100
|
+
for (const band of ["rested", "active", "snoozed", "done"]) {
|
|
1101
|
+
const rows = result.threads.filter((/** @type {any} */ t) => t.band === band)
|
|
1102
|
+
if (!rows.length) continue
|
|
1103
|
+
const lines = rows.map((/** @type {any} */ t) => {
|
|
1104
|
+
const mark = [t.slug === caller ? "this thread" : "", t.pinned ? "pinned" : ""].filter(Boolean).join(", ")
|
|
1105
|
+
const out = [` ${t.slug} ${t.title}${mark ? ` (${mark})` : ""}`]
|
|
1106
|
+
const facts = threadFacts(t, nowMs)
|
|
1107
|
+
if (facts) out.push(` ${facts}`)
|
|
1108
|
+
if (t.lastLine) out.push(` > ${t.lastLine.replace(/\s+/g, " ").slice(0, 160)}`)
|
|
1109
|
+
return out.join("\n")
|
|
1110
|
+
})
|
|
1111
|
+
blocks.push(`${BAND_HEADINGS[/** @type {keyof typeof BAND_HEADINGS} */ (band)]}\n${lines.join("\n")}`)
|
|
1112
|
+
}
|
|
1113
|
+
const steerHint = result.project.id === projectSegment()
|
|
1114
|
+
? "Message one with `frizzctl steer <slug>`."
|
|
1115
|
+
: `Message one with \`frizzctl steer <slug> --project ${result.project.slug}\`.`
|
|
1116
|
+
return `${head}\n\n${blocks.join("\n\n")}\n\n${steerHint} \`--json\` prints every field.`
|
|
1117
|
+
}
|
|
1118
|
+
|
|
911
1119
|
/** @param {Record<string, unknown>} args @returns {Promise<string>} */
|
|
912
1120
|
async function link(args) {
|
|
913
1121
|
const label = typeof args.label === "string" ? args.label.trim() : ""
|
|
@@ -1700,8 +1908,8 @@ async function unwatch(args) {
|
|
|
1700
1908
|
if (id.startsWith("cmw_")) {
|
|
1701
1909
|
const dropped = (await callRpc("dropOwnCommandWatch", { slug, id }))?.result
|
|
1702
1910
|
const head = dropped?.dropped
|
|
1703
|
-
? `Command watch ${id} dropped. Frizz will not run it again, and it will not wake you.`
|
|
1704
|
-
: `No ARMED command watch ${id} on this thread — it already
|
|
1911
|
+
? `Command watch or monitor ${id} dropped. Frizz will not run it again, and it will not wake you.`
|
|
1912
|
+
: `No ARMED command watch or monitor ${id} on this thread — it already ended, expired or was cancelled, or the id is not one of yours.`
|
|
1705
1913
|
return `${head}\n\n${armedCommandWatchList(dropped)}`
|
|
1706
1914
|
}
|
|
1707
1915
|
if (id.startsWith("tmr_")) {
|
|
@@ -1950,14 +2158,26 @@ async function watchIssue(args) {
|
|
|
1950
2158
|
* @param {{ watches?: Array<{id: string, command: string, every: string, expiresAt: string, runs: number, lastRun?: {outcome: string, exitCode: number|null}}> }|undefined} result */
|
|
1951
2159
|
function armedCommandWatchList(result) {
|
|
1952
2160
|
const watches = Array.isArray(result?.watches) ? result.watches : []
|
|
1953
|
-
if (!watches.length) return "No command watches are armed on this thread — none will wake you."
|
|
2161
|
+
if (!watches.length) return "No command watches or monitors are armed on this thread — none will wake you."
|
|
1954
2162
|
const lines = watches.map((w) => {
|
|
2163
|
+
if (w.monitor) {
|
|
2164
|
+
const events = `${w.monitor.events} event${w.monitor.events === 1 ? "" : "s"} so far`
|
|
2165
|
+
const latest = w.monitor.lastEvent ? `, the latest at ${w.monitor.lastEvent.at}: ${firstLine(w.monitor.lastEvent.text)}` : ""
|
|
2166
|
+
const label = w.monitor.description ? ` "${w.monitor.description}"` : ""
|
|
2167
|
+
return ` ${w.id} monitor${label}, running until ${w.expiresAt} — ${events}${latest}\n $ ${w.command}`
|
|
2168
|
+
}
|
|
1955
2169
|
const last = !w.lastRun
|
|
1956
2170
|
? "no check finished yet"
|
|
1957
2171
|
: `last check ${commandRunClause(w.lastRun)}`
|
|
1958
2172
|
return ` ${w.id} every ${w.every}, until ${w.expiresAt} — ${w.runs} check${w.runs === 1 ? "" : "s"}, ${last}\n $ ${w.command}`
|
|
1959
2173
|
})
|
|
1960
|
-
return `Command watches on this thread now:\n${lines.join("\n")}`
|
|
2174
|
+
return `Command watches and monitors on this thread now:\n${lines.join("\n")}`
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
/** One line of an event, short enough for a list. @param {string} text */
|
|
2178
|
+
function firstLine(text) {
|
|
2179
|
+
const line = String(text ?? "").split("\n")[0].trim()
|
|
2180
|
+
return line.length > 120 ? `${line.slice(0, 119)}…` : line
|
|
1961
2181
|
}
|
|
1962
2182
|
|
|
1963
2183
|
/** "exited 1", "timed out", … — how one check ended. @param {{outcome: string, exitCode: number|null}} run */
|
|
@@ -2043,6 +2263,64 @@ async function watchCommand(args) {
|
|
|
2043
2263
|
)
|
|
2044
2264
|
}
|
|
2045
2265
|
|
|
2266
|
+
/** The `monitor` handler: start, stop, or read back this thread's monitors.
|
|
2267
|
+
* @param {Record<string, unknown>} args @returns {Promise<string|Refused>} */
|
|
2268
|
+
async function monitor(args) {
|
|
2269
|
+
const slug = threadSlug()
|
|
2270
|
+
const action = typeof args.action === "string" ? args.action.trim() : ""
|
|
2271
|
+
if (action !== "add" && action !== "list" && action !== "drop") {
|
|
2272
|
+
throw new Error("`action` must be one of \"add\", \"list\" or \"drop\"")
|
|
2273
|
+
}
|
|
2274
|
+
if (action === "list") {
|
|
2275
|
+
return armedCommandWatchList((await callRpc("listOwnCommandWatches", { slug }))?.result)
|
|
2276
|
+
}
|
|
2277
|
+
if (action === "drop") {
|
|
2278
|
+
const id = typeof args.id === "string" ? args.id.trim() : ""
|
|
2279
|
+
if (!id) throw new Error("`id` is required to drop a monitor — take it from `add` or from `list`")
|
|
2280
|
+
const result = (await callRpc("dropOwnCommandWatch", { slug, id }))?.result
|
|
2281
|
+
const head = result?.dropped
|
|
2282
|
+
? `Monitor ${id} stopped. Its script was killed, and it will not wake you again.`
|
|
2283
|
+
: `No ARMED monitor ${id} on this thread — its script already ended, its \`for\` ran out or Frizz stopped it, or the id is not one of yours.`
|
|
2284
|
+
return `${head}\n\n${armedCommandWatchList(result)}`
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
const command = typeof args.command === "string" ? args.command.trim() : ""
|
|
2288
|
+
if (!command) throw new Error("`command` is required — a script that keeps running and prints a line per event")
|
|
2289
|
+
const forValue = typeof args.for === "string" ? args.for.trim() : ""
|
|
2290
|
+
if (!forValue) throw new Error("`for` is required — how long to keep it running, a DURATION like `6h` or `3d` (max 7d)")
|
|
2291
|
+
const description = typeof args.description === "string" && args.description.trim() ? args.description.trim() : undefined
|
|
2292
|
+
const result = (await callRpc("addOwnMonitor", { slug, command, for: forValue, ...(description ? { description } : {}) }))?.result
|
|
2293
|
+
const printed = Array.isArray(result?.events) && result.events.length
|
|
2294
|
+
? `\n\nIt printed in its first 2s (handed to you here, not as a wake):\n${result.events.map((e) => e.split("\n").map((l) => ` ${l}`).join("\n")).join("\n")}`
|
|
2295
|
+
: ""
|
|
2296
|
+
if (result?.refused) {
|
|
2297
|
+
const ran = result.exited ? `\n\n${outputTail(result.exited.output)}` : ""
|
|
2298
|
+
return new Refused(`NOT registered. ${result.refused}${printed}${ran}`)
|
|
2299
|
+
}
|
|
2300
|
+
if (result?.exited) {
|
|
2301
|
+
return (
|
|
2302
|
+
`NOTHING IS RUNNING: your script ${commandRunClause(result.exited)} within its first 2s, so the monitor ended ` +
|
|
2303
|
+
`as soon as it started. A monitor's script must keep running — loop, tail, or listen.${printed}\n\n${outputTail(result.exited.output)}`
|
|
2304
|
+
)
|
|
2305
|
+
}
|
|
2306
|
+
const id = result?.id ?? "(unknown)"
|
|
2307
|
+
if (result?.alreadyArmed) {
|
|
2308
|
+
return (
|
|
2309
|
+
`Already running this script as ${id} (until ${result.expiresAt}) — nothing new was started, and its ` +
|
|
2310
|
+
`original expiry stands.\n\n${armedCommandWatchList(result)}`
|
|
2311
|
+
)
|
|
2312
|
+
}
|
|
2313
|
+
const clamped = result?.clamped?.for
|
|
2314
|
+
? `\n\nYOUR \`--for ${result.clamped.for}\` was capped at the 7d ceiling — what is listed below is what you hold.`
|
|
2315
|
+
: ""
|
|
2316
|
+
return (
|
|
2317
|
+
`Monitoring as ${id}: Frizz keeps your script running until ${result?.expiresAt}, and every line it prints wakes ` +
|
|
2318
|
+
`you with that line. Nothing of yours runs meanwhile.${printed}${clamped}\n\n` +
|
|
2319
|
+
`NAME IT IN YOUR \`\`\`awaiting FENCE (\`commands: [${id}]\`, \`status: watching\`) and come to rest. STOP IT ` +
|
|
2320
|
+
`when it stops mattering (\`frizzctl monitor drop ${id}\`).\n\n${armedCommandWatchList(result)}`
|
|
2321
|
+
)
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2046
2324
|
/**
|
|
2047
2325
|
* HOW EACH COMMAND IS SPELLED ON A COMMAND LINE. The schema above already says what a command takes;
|
|
2048
2326
|
* this says the three things a schema cannot:
|
|
@@ -2124,6 +2402,17 @@ const CLI = {
|
|
|
2124
2402
|
then: { add: ["target"], drop: ["id"] },
|
|
2125
2403
|
examples: ["frizzctl watch-issue add acme/app#482 --for 30d", "frizzctl watch-issue list", "frizzctl watch-issue drop isw_ab12cd34"],
|
|
2126
2404
|
},
|
|
2405
|
+
monitor: {
|
|
2406
|
+
group: "Waiting",
|
|
2407
|
+
summary: "Wake on every line a long-running script prints (a filtered log tail, a poll loop)",
|
|
2408
|
+
positional: ["action"],
|
|
2409
|
+
then: { add: ["command"], drop: ["id"] },
|
|
2410
|
+
examples: [
|
|
2411
|
+
'frizzctl monitor add "tail -F /var/log/app.log | grep --line-buffered -E \'ERROR|FATAL\'" --description "errors in app.log" --for 1d',
|
|
2412
|
+
"frizzctl monitor list",
|
|
2413
|
+
"frizzctl monitor drop cmw_ab12cd34ef56",
|
|
2414
|
+
],
|
|
2415
|
+
},
|
|
2127
2416
|
watch_command: {
|
|
2128
2417
|
group: "Waiting",
|
|
2129
2418
|
summary: "Wake when a shell command the server re-runs exits 0 (a version published, a URL up)",
|
|
@@ -2174,6 +2463,12 @@ const CLI = {
|
|
|
2174
2463
|
positional: ["id"],
|
|
2175
2464
|
examples: ["frizzctl unlink lnk_ab12cd34"],
|
|
2176
2465
|
},
|
|
2466
|
+
threads: {
|
|
2467
|
+
group: "Other threads",
|
|
2468
|
+
summary: "List a project's threads: each one's slug, title and where it sits on the board",
|
|
2469
|
+
positional: ["project"],
|
|
2470
|
+
examples: ["frizzctl threads", "frizzctl threads nub", "frizzctl threads --all --json"],
|
|
2471
|
+
},
|
|
2177
2472
|
steer: {
|
|
2178
2473
|
group: "Other threads",
|
|
2179
2474
|
summary: "Send a message into another thread, in any project",
|
package/web-dist/assets/{abnfDiagram-VRR7QNED-DZgIn5ff.js → abnfDiagram-VRR7QNED-R4fnqpL_.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e,t}from"./mermaid-parser.core-
|
|
1
|
+
import{m as e,t}from"./mermaid-parser.core-1DKULFlf.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-CkPXvRdk.js";import"./chunk-WYO6CB5R-DvwyN_Z1.js";import"./chunk-VAUOI2AC-_LdsfMm9.js";import{n as i,r as a,t as o}from"./chunk-MOJQB5TN-cR_XVznl.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 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./path-BWPyau1x.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-
|
|
1
|
+
import{n as e,t}from"./path-BWPyau1x.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-CdXepqKz.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i)if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-KEIR6QF5-BfrZ3jm6.js";import{M as e}from"./mermaid-parser.core-1DKULFlf.js";export{e as createArchitectureServices};
|