@davidbalzan/groundwork-console 0.1.16 → 0.1.17

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 (95) hide show
  1. package/dist/bus.js +28 -5
  2. package/dist/mcp.js +1 -1
  3. package/dist/server.js +16 -2
  4. package/package.json +1 -1
  5. package/public/assets/{abnfDiagram-N423BO3Z-CxWt6pmv.js → abnfDiagram-N423BO3Z-4d2uv_Bq.js} +1 -1
  6. package/public/assets/{arc-D5-I_DjS.js → arc-CsO5oHRF.js} +1 -1
  7. package/public/assets/architecture-TIHT7OUA-ChM--lpn.js +1 -0
  8. package/public/assets/{architectureDiagram-T3A2C74G-BGmT60on.js → architectureDiagram-T3A2C74G-DMmZHzpW.js} +1 -1
  9. package/public/assets/{blockDiagram-VBNYF7ZC-PVAr34Dh.js → blockDiagram-VBNYF7ZC-BypTIZaz.js} +1 -1
  10. package/public/assets/{c4Diagram-5PPSVZJV-CLEl06cP.js → c4Diagram-5PPSVZJV-DvCrTZm6.js} +1 -1
  11. package/public/assets/channel-CTT-B1Jd.js +1 -0
  12. package/public/assets/{chunk-2GRJ4B5K-BqqD7kMu.js → chunk-2GRJ4B5K-iIMSEuYT.js} +1 -1
  13. package/public/assets/{chunk-4I5QYGJK-DK_fIVHN.js → chunk-4I5QYGJK-DE7yI8Ek.js} +1 -1
  14. package/public/assets/{chunk-5RXB4S5H-DgstcPFg.js → chunk-5RXB4S5H-GX_WxHPA.js} +1 -1
  15. package/public/assets/{chunk-6Q2QTUOP-DO9RKXCT.js → chunk-6Q2QTUOP-CY62du0c.js} +1 -1
  16. package/public/assets/{chunk-7Z6QIM7H-BA33EzDX.js → chunk-7Z6QIM7H--U6-3mMF.js} +1 -1
  17. package/public/assets/{chunk-GF5L2VYU-CRW6rE0L.js → chunk-GF5L2VYU-CYC_rSaq.js} +1 -1
  18. package/public/assets/{chunk-I66GZJ75-C5_NbBqn.js → chunk-I66GZJ75-Czc6RDTX.js} +1 -1
  19. package/public/assets/{chunk-JQJVKLGR-CdSZSVu-.js → chunk-JQJVKLGR-CcM1wERy.js} +1 -1
  20. package/public/assets/{chunk-KBJHAD2P-CRCRrXrk.js → chunk-KBJHAD2P-Bc86tmO-.js} +1 -1
  21. package/public/assets/{chunk-NSK5VX7P-DIVqgBu4.js → chunk-NSK5VX7P-9_tkKeKf.js} +1 -1
  22. package/public/assets/{chunk-QR6OTTB3-sKyKNPgl.js → chunk-QR6OTTB3-B9-c0tqf.js} +1 -1
  23. package/public/assets/{chunk-RYQCIY6F-P19k1JhZ.js → chunk-RYQCIY6F-CyxQKlO3.js} +1 -1
  24. package/public/assets/{chunk-UBXNYLIW-DxiLGa8n.js → chunk-UBXNYLIW-DsDjYE1H.js} +1 -1
  25. package/public/assets/{chunk-W5SLKNZC-CMnFpaIo.js → chunk-W5SLKNZC-DBT8eyiL.js} +1 -1
  26. package/public/assets/{chunk-WRU74C26-BzhPgtRt.js → chunk-WRU74C26-BkBE-ufW.js} +1 -1
  27. package/public/assets/{chunk-XXDRQBXY-BrE4EAhD.js → chunk-XXDRQBXY-C-4dWLfF.js} +1 -1
  28. package/public/assets/classDiagram-JCYQIIEL-hiXee6Eo.js +1 -0
  29. package/public/assets/classDiagram-v2-OCEON4UE-hiXee6Eo.js +1 -0
  30. package/public/assets/{cose-bilkent-JH36ORCC-Dt6PDdrZ.js → cose-bilkent-JH36ORCC-D43fgxak.js} +1 -1
  31. package/public/assets/{cynefin-VYW2F7L2-Dpyi5ItX.js → cynefin-VYW2F7L2-C11FHLih.js} +1 -1
  32. package/public/assets/{cynefinDiagram-MW4NZA55-B2yGLd8X.js → cynefinDiagram-MW4NZA55-CT3s9Cvn.js} +1 -1
  33. package/public/assets/{dagre-VZM6K2ZE-Dntfcg-X.js → dagre-VZM6K2ZE-LvZVEXM6.js} +1 -1
  34. package/public/assets/{diagram-7IWD3JNH-BPxK9-c4.js → diagram-7IWD3JNH-Cw0TOqRI.js} +1 -1
  35. package/public/assets/{diagram-B4RE2ZJO-DsUBXKVA.js → diagram-B4RE2ZJO-B8CLj1IC.js} +1 -1
  36. package/public/assets/{diagram-LBJQPF4R-qP08Jdv_.js → diagram-LBJQPF4R-C9jjsjqA.js} +1 -1
  37. package/public/assets/{diagram-Q27KOJAE-1TdMfJjf.js → diagram-Q27KOJAE-zmK9KaIF.js} +1 -1
  38. package/public/assets/{diagram-UB23O5K3-cK29jWGW.js → diagram-UB23O5K3-D9FLjjFN.js} +1 -1
  39. package/public/assets/{dist-Bp1jCq1s.js → dist-D4PgRFT8.js} +1 -1
  40. package/public/assets/{ebnfDiagram-BXEA7PRR-CJRoip6W.js → ebnfDiagram-BXEA7PRR-gsjjs_XZ.js} +1 -1
  41. package/public/assets/{erDiagram-JOGREHBK-salUqYy9.js → erDiagram-JOGREHBK-CTT6y-7Y.js} +1 -1
  42. package/public/assets/eventmodeling-45OFAUF4-se4AzYWu.js +1 -0
  43. package/public/assets/flowDiagram-UKHOOZJN-CykShUMb.js +1 -0
  44. package/public/assets/{ganttDiagram-PKOTCBZU-zgcauP2k.js → ganttDiagram-PKOTCBZU-Co40RJeV.js} +1 -1
  45. package/public/assets/{gitGraph-TEB2WS4Q-D8twe_B6.js → gitGraph-TEB2WS4Q-K4j3kGfP.js} +1 -1
  46. package/public/assets/{gitGraphDiagram-DS77QQ5N-mpQTM4Fs.js → gitGraphDiagram-DS77QQ5N-C7egTGgK.js} +1 -1
  47. package/public/assets/{index-0OCDcZ1F.js → index-DKFIHr9f.js} +4 -4
  48. package/public/assets/{info-DKCQHKI2-NlG3PDiK.js → info-DKCQHKI2-B12S9dur.js} +1 -1
  49. package/public/assets/{infoDiagram-6WML65LV-DNlytqqs.js → infoDiagram-6WML65LV-Cr2CrVeL.js} +1 -1
  50. package/public/assets/{ishikawaDiagram-WSZJBQD7-CLbOZsbe.js → ishikawaDiagram-WSZJBQD7-DYFpwuke.js} +1 -1
  51. package/public/assets/{journeyDiagram-NVQOT4AX-BFYvvwGf.js → journeyDiagram-NVQOT4AX-CiANQSH5.js} +1 -1
  52. package/public/assets/{kanban-definition-27J2QSJJ-Dg-9h3d2.js → kanban-definition-27J2QSJJ-BPEtkdf6.js} +1 -1
  53. package/public/assets/{line-C3fZyPMI.js → line-Dlv0QupC.js} +1 -1
  54. package/public/assets/{linear-Bg74_IwO.js → linear-DP-JyCeQ.js} +1 -1
  55. package/public/assets/{mermaid-parser.core-wU8rV0JZ.js → mermaid-parser.core-m5Z6GHDK.js} +3 -3
  56. package/public/assets/{mermaid.core-Cqu2TmEc.js → mermaid.core-BhJBKv0J.js} +4 -4
  57. package/public/assets/{mindmap-definition-FAOFIHXS-DocCU_OY.js → mindmap-definition-FAOFIHXS-DpwEU_bQ.js} +1 -1
  58. package/public/assets/{packet-7NZHBO7P-CJ18AmJI.js → packet-7NZHBO7P-ElpZJWUo.js} +1 -1
  59. package/public/assets/{pegDiagram-VL7TDLO6-BKmrK3N_.js → pegDiagram-VL7TDLO6-B4UAE4d-.js} +1 -1
  60. package/public/assets/{pie-RZYD4A2V-BzZwhKll.js → pie-RZYD4A2V-CXsn8HRS.js} +1 -1
  61. package/public/assets/{pieDiagram-7S7Q4E2Y-BrADNAEN.js → pieDiagram-7S7Q4E2Y-Cg9oK3mU.js} +1 -1
  62. package/public/assets/{quadrantDiagram-CIZ2JOQS-7-El3SnP.js → quadrantDiagram-CIZ2JOQS-jq_OdvvR.js} +1 -1
  63. package/public/assets/{radar-I7S5WNFK-BiznqFD1.js → radar-I7S5WNFK-BkzfZxFa.js} +1 -1
  64. package/public/assets/{railroad-3IZDKUUU-DgnMfEWG.js → railroad-3IZDKUUU-B3THFlyo.js} +1 -1
  65. package/public/assets/railroad-abnf-AHOZXSZD-h1yNvons.js +1 -0
  66. package/public/assets/railroad-ebnf-EBAXGLYW-D_YJ8F3o.js +1 -0
  67. package/public/assets/railroad-peg-LSFZ7HO6-5Fq3k5T9.js +1 -0
  68. package/public/assets/{railroadDiagram-AXF67PYL-yqboeuy1.js → railroadDiagram-AXF67PYL-YLfOS1Ub.js} +1 -1
  69. package/public/assets/{requirementDiagram-LRYGKXZP-DtEXQN5L.js → requirementDiagram-LRYGKXZP-Bdu77Te0.js} +1 -1
  70. package/public/assets/{sankeyDiagram-W5VNT64P-CzdkrepT.js → sankeyDiagram-W5VNT64P-7HO0TSNW.js} +1 -1
  71. package/public/assets/{sequenceDiagram-SI44F4Z6-Z2e0D63k.js → sequenceDiagram-SI44F4Z6-CQcwlLyD.js} +1 -1
  72. package/public/assets/{src-FX1L97V2.js → src-_jO5__EL.js} +1 -1
  73. package/public/assets/{stateDiagram-OKZ733FA-CMy-EwvM.js → stateDiagram-OKZ733FA-C64YdGh1.js} +1 -1
  74. package/public/assets/stateDiagram-v2-UEYNNEHI-BQX29486.js +1 -0
  75. package/public/assets/{swimlanes-SLNWSIFB-B4L51W7W.js → swimlanes-SLNWSIFB-MD924CgH.js} +1 -1
  76. package/public/assets/swimlanesDiagram-ULZ7WXOC-Bc9cfxpb.js +8 -0
  77. package/public/assets/{timeline-definition-Z64GVDOM-qGeZo2i4.js → timeline-definition-Z64GVDOM-BwmMNgBf.js} +1 -1
  78. package/public/assets/{treeView-QDETBFTQ-CENBPnul.js → treeView-QDETBFTQ-Di_P_CHe.js} +1 -1
  79. package/public/assets/{treemap-6X3UGDF4-Db3FvIgt.js → treemap-6X3UGDF4-BI4XvsgT.js} +1 -1
  80. package/public/assets/{vennDiagram-T6HMQDX7-BzOcljxT.js → vennDiagram-T6HMQDX7-D_BFpD2j.js} +1 -1
  81. package/public/assets/{wardley-OPB4EBWU-BCjI5d0A.js → wardley-OPB4EBWU-CSCluGr0.js} +1 -1
  82. package/public/assets/{wardleyDiagram-T6FBY63Y-BxMi8v_W.js → wardleyDiagram-T6FBY63Y-IUT_hnBA.js} +1 -1
  83. package/public/assets/{xychartDiagram-ELKLHX3M-D9iLw6GM.js → xychartDiagram-ELKLHX3M-CPlrFIYm.js} +1 -1
  84. package/public/index.html +1 -1
  85. package/public/assets/architecture-TIHT7OUA-qas-fLcU.js +0 -1
  86. package/public/assets/channel-CPtW5HV2.js +0 -1
  87. package/public/assets/classDiagram-JCYQIIEL-Ca4Olyo-.js +0 -1
  88. package/public/assets/classDiagram-v2-OCEON4UE-Ca4Olyo-.js +0 -1
  89. package/public/assets/eventmodeling-45OFAUF4-vG8tmD-p.js +0 -1
  90. package/public/assets/flowDiagram-UKHOOZJN-B8KA04Jj.js +0 -1
  91. package/public/assets/railroad-abnf-AHOZXSZD-BJx969N4.js +0 -1
  92. package/public/assets/railroad-ebnf-EBAXGLYW-vSQ0SM-G.js +0 -1
  93. package/public/assets/railroad-peg-LSFZ7HO6-CIn0Sk7Q.js +0 -1
  94. package/public/assets/stateDiagram-v2-UEYNNEHI-FIj7i3no.js +0 -1
  95. package/public/assets/swimlanesDiagram-ULZ7WXOC-D8KvDdSc.js +0 -8
package/dist/bus.js CHANGED
@@ -102,20 +102,43 @@ export function agentsSync(root, scanLines = SCAN_LINES) {
102
102
  return { ...a, transport: t?.transport ?? t?.kind ?? (t ? "tmux-push" : null), pane: t?.tmuxTarget ?? null, reachability: reachOf(age), heartbeatAgeMs: Number.isFinite(age) ? age : null, lastSeen: lastSeen || null, progress: progressOf(output.get(a.agentId), now, scanLines) };
103
103
  }).sort((a, b) => (b.lastSeen ?? 0) - (a.lastSeen ?? 0));
104
104
  }
105
- export function busConditions(root) {
105
+ /* Map `list_subscriptions` onto the console's shape. The bus owns the verdict; this only counts.
106
+ An unrecognised level is folded into `unknown` rather than dropped or guessed — a level this
107
+ console has not been taught is precisely the case where it must not assert. */
108
+ export function subscriptionHealth(res) {
109
+ const r = res;
110
+ const rows = r?.subscriptions;
111
+ if (!Array.isArray(rows))
112
+ return { total: 0, visible: 0, byLevel: { ok: 0, error: 0, unknown: 0 }, unreachable: true, agents: [] };
113
+ const agents = rows.map((x) => {
114
+ const l = x.health?.level;
115
+ /* An unrecognised level folds to `unknown` rather than being dropped or guessed — a level this
116
+ console has not been taught is exactly the case where it must not assert. */
117
+ return { agentId: String(x.agentId ?? "?"), level: (l === "ok" || l === "error" ? l : "unknown") };
118
+ });
119
+ return {
120
+ /* `total` is the bus's own population, and it is usually LARGER than what we can see:
121
+ list_subscriptions is AGENT-SCOPED, so this console is returned only its own rows. Measured:
122
+ listed 0 of total 2 — both belong to groundwork-kit-aide. Keeping the two numbers apart is
123
+ the whole point; collapsing them is how "0 visible" would become "0 exist". */
124
+ total: r?.population?.total ?? agents.length,
125
+ visible: r?.population?.listed ?? agents.length,
126
+ byLevel: { ok: agents.filter((a) => a.level === "ok").length, error: agents.filter((a) => a.level === "error").length, unknown: agents.filter((a) => a.level === "unknown").length },
127
+ unreachable: false,
128
+ agents,
129
+ };
130
+ }
131
+ export function busConditions(root, subs) {
106
132
  const halt = readJson(path.join(root, "halt.json"), null);
107
133
  const away = readJson(path.join(root, "coord-away.json"), null);
108
- const subs = readJson(path.join(root, "subscriptions.json"), {});
109
134
  const stallFile = path.join(root, "stall-check.json");
110
135
  const stallRaw = existsSync(stallFile) ? readJson(stallFile, {}) : null;
111
136
  const runs = (stallRaw?.history ?? []).filter((r) => typeof r?.at === "number").sort((a, b) => a.at - b.at);
112
137
  const last = runs.length ? runs[runs.length - 1] : null;
113
- const list = subs.subscriptions ?? [];
114
- const never = list.filter((x) => x.lastEvaluatedAt === null || x.lastEvaluatedAt === undefined);
115
138
  return {
116
139
  halt: halt ? { active: true, ...halt } : { active: false },
117
140
  away: away ? { active: true, ...away } : { active: false },
118
- subscriptions: { total: list.length, neverEvaluated: never.length, agents: [...new Set(never.map((x) => x.agentId).filter((a) => !!a))] },
141
+ subscriptions: subs ?? { total: 0, visible: 0, byLevel: { ok: 0, error: 0, unknown: 0 }, unreachable: true, agents: [] },
119
142
  stallClock: { inUse: stallRaw !== null, runs: runs.slice(-12), last, ageMs: last ? Date.now() - last.at : null },
120
143
  };
121
144
  }
package/dist/mcp.js CHANGED
@@ -13,7 +13,7 @@ const IDENTITIES = {
13
13
  david: { agentId: "david", project: "groundwork-console", role: { roleId: "human", displayName: "David" } },
14
14
  };
15
15
  export const AGENT_ID = "groundwork-console";
16
- export const READ_ONLY_TOOLS = new Set(["doctor", "list_agents", "list_rooms", "list_scopes", "status", "ping", "read_messages", "retrieve_room_history", "retrieve_message", "list_work"]);
16
+ export const READ_ONLY_TOOLS = new Set(["doctor", "list_agents", "list_rooms", "list_scopes", "status", "ping", "read_messages", "retrieve_room_history", "retrieve_message", "list_work", "list_subscriptions"]);
17
17
  export const WRITE_TOOLS_GATED = new Set(["send_message", "send_command", "post_status", "prune", "force_unregister", "unregister", "join_room", "leave_room", "delete_room", "set_room_topic", "set_room_motd", "import_work", "export_work"]);
18
18
  const SWITCH_FILE = path.join(homedir(), ".groundwork-console", "switches.json");
19
19
  function loadSwitches() {
package/dist/server.js CHANGED
@@ -12,7 +12,7 @@ import { hostname as osHostname } from "node:os";
12
12
  import { loadConfig, saveProjects, validateProjectPath, CONFIG_FILE } from "./config.js";
13
13
  import { boardOf, docOf, docsIndex, phaseTasksOf } from "./seam.js";
14
14
  import { DocWriteError, sha256, writeDoc } from "./docwrite.js";
15
- import { agents, agentsAsync, rooms, roomMessages, roomMessageCount, statusStream, scopes, prefixOfMessage, busConditions } from "./bus.js";
15
+ import { agents, agentsAsync, rooms, roomMessages, roomMessageCount, statusStream, scopes, prefixOfMessage, busConditions, subscriptionHealth } from "./bus.js";
16
16
  import { capturePane } from "./tmux.js";
17
17
  import { spawnAgent, suggestId, fleetStatus, FLEET_TEMPLATES, HARNESS_CMD, ROLE_SKILL } from "./provision.js";
18
18
  import { doctor, status, list, playbookList } from "./groundwork.js";
@@ -1063,7 +1063,21 @@ app.get("/bus/rooms/:room/messages", (c) => {
1063
1063
  });
1064
1064
  app.get("/bus/status", (c) => c.json(statusStream(cfg.coordDir, Number(c.req.query("limit") ?? 50))));
1065
1065
  app.get("/bus/scopes", (c) => c.json(scopes(cfg.coordDir)));
1066
- app.get("/bus/conditions", (c) => c.json(busConditions(cfg.coordDir)));
1066
+ /* Subscription health comes from the BUS, not from a field read here — `health` is computed at
1067
+ read time by `list_subscriptions` and is not persisted, so there is nothing on disk to consult.
1068
+ If the call fails the console reports `unreachable` rather than falling back to a local guess:
1069
+ the whole defect was a second copy of a verdict, and a fallback copy is the same defect with a
1070
+ longer fuse. */
1071
+ app.get("/bus/conditions", async (c) => {
1072
+ let subs;
1073
+ try {
1074
+ subs = subscriptionHealth(await bus.call("list_subscriptions", {}));
1075
+ }
1076
+ catch {
1077
+ subs = undefined;
1078
+ }
1079
+ return c.json(busConditions(cfg.coordDir, subs));
1080
+ });
1067
1081
  app.get("/bus/card-loads", (c) => c.json(cardLoads()));
1068
1082
  events.start(15_000);
1069
1083
  notifier.start(15_000);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@davidbalzan/groundwork-console",
3
3
  "private": false,
4
- "version": "0.1.16",
4
+ "version": "0.1.17",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "@davidbalzan/groundwork-seam": "0.1.8",
@@ -1 +1 @@
1
- import{m as e,t}from"./mermaid-parser.core-wU8rV0JZ.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-FX1L97V2.js";import"./chunk-I66GZJ75-C5_NbBqn.js";import{n as i,r as a,t as o}from"./chunk-6Q2QTUOP-DO9RKXCT.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-Cqu2TmEc.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-m5Z6GHDK.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-_jO5__EL.js";import"./chunk-I66GZJ75-Czc6RDTX.js";import{n as i,r as a,t as o}from"./chunk-6Q2QTUOP-CY62du0c.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-BhJBKv0J.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-fybaL0A-.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-Bp1jCq1s.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};
1
+ import{n as e,t}from"./path-fybaL0A-.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-D4PgRFT8.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-BICK3FdT.js";import{M as e}from"./mermaid-parser.core-m5Z6GHDK.js";export{e as createArchitectureServices};