@burakboduroglu/nors 0.1.0 → 0.1.2

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 (92) hide show
  1. package/README.md +10 -16
  2. package/bin/nors.js +5 -2
  3. package/package.json +2 -1
  4. package/pb_hooks/nors.pb.js +44 -0
  5. package/pb_public/nors/assets/{abnfDiagram-VCTEODGH-72Hc1HpF.js → abnfDiagram-VCTEODGH-BjNTd20L.js} +1 -1
  6. package/pb_public/nors/assets/architecture-7GRP2DOG-CszbBaLG.js +1 -0
  7. package/pb_public/nors/assets/{architectureDiagram-5GKGNRK7-Dyvym86p.js → architectureDiagram-5GKGNRK7-DFNV5SNP.js} +1 -1
  8. package/pb_public/nors/assets/{blockDiagram-I7D4REHJ-CDUU8dVT.js → blockDiagram-I7D4REHJ-DNijD6G8.js} +1 -1
  9. package/pb_public/nors/assets/{c4Diagram-7LVT6UL2-DO3ezHBq.js → c4Diagram-7LVT6UL2-DLW_Vk73.js} +1 -1
  10. package/pb_public/nors/assets/channel-BBJC6jlq.js +1 -0
  11. package/pb_public/nors/assets/{chunk-4HAMMTFA-1EqQyQU7.js → chunk-4HAMMTFA-CQW8auRW.js} +1 -1
  12. package/pb_public/nors/assets/{chunk-75Z2AOVW-Cwc7WThs.js → chunk-75Z2AOVW-OUM6F-Z2.js} +1 -1
  13. package/pb_public/nors/assets/{chunk-DU6HZSFF-B5Wb9e-Z.js → chunk-DU6HZSFF-DdkkHC2K.js} +1 -1
  14. package/pb_public/nors/assets/{chunk-F27PBJKO-Bab3aPrd.js → chunk-F27PBJKO-D4tBKW95.js} +1 -1
  15. package/pb_public/nors/assets/{chunk-GMAD6QVW-BvxprKvk.js → chunk-GMAD6QVW-CZU7s-_u.js} +1 -1
  16. package/pb_public/nors/assets/{chunk-GVQU2GXP-CsbitBlJ.js → chunk-GVQU2GXP-BQGI6BgU.js} +1 -1
  17. package/pb_public/nors/assets/{chunk-IMKFNOWR-CPLySese.js → chunk-IMKFNOWR-BRvu8wxF.js} +1 -1
  18. package/pb_public/nors/assets/{chunk-L3NEJ4N5-CFPB-We8.js → chunk-L3NEJ4N5-OjXnRmPt.js} +1 -1
  19. package/pb_public/nors/assets/{chunk-OSK3NFVY-BAJO2owD.js → chunk-OSK3NFVY-puWVIqFn.js} +1 -1
  20. package/pb_public/nors/assets/{chunk-P2QGCYS3-f8ck-xGx.js → chunk-P2QGCYS3-BH6JrbP_.js} +1 -1
  21. package/pb_public/nors/assets/{chunk-POPQ4Y6H-B_VDFlEk.js → chunk-POPQ4Y6H-XJIxFdlK.js} +1 -1
  22. package/pb_public/nors/assets/{chunk-PWAF6VOD-B32HYusP.js → chunk-PWAF6VOD-B__l-VgZ.js} +1 -1
  23. package/pb_public/nors/assets/{chunk-SHT3W25Y-CfjlZPrR.js → chunk-SHT3W25Y-B8vLWnR_.js} +1 -1
  24. package/pb_public/nors/assets/{chunk-SVP7TREG-DT0H529z.js → chunk-SVP7TREG-Cjv1tk7U.js} +1 -1
  25. package/pb_public/nors/assets/{chunk-TICWLB2K-BD3m0b83.js → chunk-TICWLB2K-B5znima5.js} +1 -1
  26. package/pb_public/nors/assets/classDiagram-ZZMXUADV-CflNlJhy.js +1 -0
  27. package/pb_public/nors/assets/classDiagram-v2-VYDZK3BY-CflNlJhy.js +1 -0
  28. package/pb_public/nors/assets/{cynefin-OW5HDTMX-Bts7NCEe.js → cynefin-OW5HDTMX-CG0jDjpt.js} +1 -1
  29. package/pb_public/nors/assets/{cynefinDiagram-5FMLGOSQ-DQtWZ8b_.js → cynefinDiagram-5FMLGOSQ-C_Ir6oea.js} +1 -1
  30. package/pb_public/nors/assets/{dagre-GXQ25YYZ-9KsnELcz.js → dagre-GXQ25YYZ-D8QhYxWu.js} +1 -1
  31. package/pb_public/nors/assets/{diagram-S7CK7UJ4-BH9UWoqn.js → diagram-S7CK7UJ4-BpLSV2IE.js} +1 -1
  32. package/pb_public/nors/assets/{diagram-UQ7AKVKN-CxwLdAs_.js → diagram-UQ7AKVKN-CZdWRYnI.js} +1 -1
  33. package/pb_public/nors/assets/{diagram-VSXAHHWV-CZ09vgYE.js → diagram-VSXAHHWV-DumOz0aB.js} +1 -1
  34. package/pb_public/nors/assets/{diagram-VX7I27RA-BOR_eKl1.js → diagram-VX7I27RA-FEvMg4vC.js} +1 -1
  35. package/pb_public/nors/assets/{diagram-Z3DM3KII-CNxcZIX5.js → diagram-Z3DM3KII-B0wSI-7M.js} +1 -1
  36. package/pb_public/nors/assets/{ebnfDiagram-PWID7BFC-Bd6A_szT.js → ebnfDiagram-PWID7BFC-DnVv0Jr0.js} +1 -1
  37. package/pb_public/nors/assets/{erDiagram-RLTQ6QDP-Cg1LC0U7.js → erDiagram-RLTQ6QDP-DRrBeVO-.js} +1 -1
  38. package/pb_public/nors/assets/eventmodeling-NTZA5JFV-CHTuxREV.js +1 -0
  39. package/pb_public/nors/assets/flowDiagram-HODETNUW-GyQBSUMm.js +1 -0
  40. package/pb_public/nors/assets/{ganttDiagram-EL5Y4UJY-DvZJpWfe.js → ganttDiagram-EL5Y4UJY-Boo75Thn.js} +1 -1
  41. package/pb_public/nors/assets/{gitGraph-4MIJSDKK-CsEbmQD4.js → gitGraph-4MIJSDKK-DkHL0Vmb.js} +1 -1
  42. package/pb_public/nors/assets/{gitGraphDiagram-WWUBYQGX-CVlXu2Qq.js → gitGraphDiagram-WWUBYQGX-BxbzXOHt.js} +1 -1
  43. package/pb_public/nors/assets/index-B1thqj8h.css +1 -0
  44. package/pb_public/nors/assets/index-CHyIcFAa.js +71 -0
  45. package/pb_public/nors/assets/{info-A6RAGUB7-Cr_1btt8.js → info-A6RAGUB7-Dm0lTq1F.js} +1 -1
  46. package/pb_public/nors/assets/{infoDiagram-27XIBGKW-B5T1nV5L.js → infoDiagram-27XIBGKW-DqVr5vns.js} +1 -1
  47. package/pb_public/nors/assets/{ishikawaDiagram-5VMMS53U-CBxNSCVW.js → ishikawaDiagram-5VMMS53U-D9UPVhhC.js} +1 -1
  48. package/pb_public/nors/assets/{journeyDiagram-3NMN7TZE-Cr3ECa1U.js → journeyDiagram-3NMN7TZE-B_TT0UBS.js} +1 -1
  49. package/pb_public/nors/assets/{kanban-definition-UXKFOSKX-DePsUrbx.js → kanban-definition-UXKFOSKX-CYxipC8k.js} +1 -1
  50. package/pb_public/nors/assets/{line-DcGZsAWh.js → line-CeGn86Ww.js} +1 -1
  51. package/pb_public/nors/assets/{mermaid-parser.core-BR6xQvT6.js → mermaid-parser.core-Bh2pMn-f.js} +3 -3
  52. package/pb_public/nors/assets/{mermaid.core-FEPUjAo_.js → mermaid.core-CL8sN1KK.js} +4 -4
  53. package/pb_public/nors/assets/{mindmap-definition-YA3MSWOX-7sU4YIM1.js → mindmap-definition-YA3MSWOX-DACQFk4_.js} +1 -1
  54. package/pb_public/nors/assets/{packet-AYTQ26CC-TYEYjIA7.js → packet-AYTQ26CC-6s6XRIHO.js} +1 -1
  55. package/pb_public/nors/assets/{pegDiagram-XKGWAZYB-BGzYtGBp.js → pegDiagram-XKGWAZYB-3cpO6gJW.js} +1 -1
  56. package/pb_public/nors/assets/{pie-WAS4IAKB-BAuhAqOa.js → pie-WAS4IAKB-BNoU8wOh.js} +1 -1
  57. package/pb_public/nors/assets/{pieDiagram-E7YTZNPT-Dc1PZDwl.js → pieDiagram-E7YTZNPT-BCVRuVsN.js} +1 -1
  58. package/pb_public/nors/assets/{quadrantDiagram-AXDQQJYC-D-d3azLW.js → quadrantDiagram-AXDQQJYC-B5ib9c-g.js} +1 -1
  59. package/pb_public/nors/assets/{radar-RG4KPBEZ-CWKhbiay.js → radar-RG4KPBEZ-7fT-y4bj.js} +1 -1
  60. package/pb_public/nors/assets/{railroad-74A4TZTK-Cm0h6b91.js → railroad-74A4TZTK-DfD5x0yO.js} +1 -1
  61. package/pb_public/nors/assets/railroad-abnf-HS5TGJTU-b8Cz753z.js +1 -0
  62. package/pb_public/nors/assets/railroad-ebnf-LZEXJU2U-B_O77J7F.js +1 -0
  63. package/pb_public/nors/assets/railroad-peg-WCYAUIDC-DY-15zgB.js +1 -0
  64. package/pb_public/nors/assets/{railroadDiagram-O6MQD6OU-nzjXgwpW.js → railroadDiagram-O6MQD6OU-JtCr1lo_.js} +1 -1
  65. package/pb_public/nors/assets/{requirementDiagram-BXWQKSXE-v6B3lGir.js → requirementDiagram-BXWQKSXE-BqStJCDF.js} +1 -1
  66. package/pb_public/nors/assets/{sankeyDiagram-P5KCCOFB-CuyMtFNE.js → sankeyDiagram-P5KCCOFB-CX_LZnAD.js} +1 -1
  67. package/pb_public/nors/assets/{sequenceDiagram-WJ2MYXX4-C2LyM7bh.js → sequenceDiagram-WJ2MYXX4-BCudH1Kz.js} +1 -1
  68. package/pb_public/nors/assets/{stateDiagram-D77RDMKH-D1A2WBer.js → stateDiagram-D77RDMKH-rGlSUlYz.js} +1 -1
  69. package/pb_public/nors/assets/stateDiagram-v2-MP3YSRHH-BYqH8M1b.js +1 -0
  70. package/pb_public/nors/assets/{swimlanes-42K2YHIH-sCNSWX_N.js → swimlanes-42K2YHIH-DKvSloZp.js} +1 -1
  71. package/pb_public/nors/assets/swimlanesDiagram-VR7AAH4N-XbCiub0l.js +8 -0
  72. package/pb_public/nors/assets/{timeline-definition-24CTP7MA-DCxtDLFB.js → timeline-definition-24CTP7MA-CELuFcfA.js} +1 -1
  73. package/pb_public/nors/assets/{treeView-Q6P3EWNA-Bnjs5jw6.js → treeView-Q6P3EWNA-D5E6rNip.js} +1 -1
  74. package/pb_public/nors/assets/{treemap-WGGIJYW6-C5ajpoq6.js → treemap-WGGIJYW6-CdXHwdKK.js} +1 -1
  75. package/pb_public/nors/assets/{vennDiagram-4TSXK5OY-B5S6LN3U.js → vennDiagram-4TSXK5OY-ByJmWaze.js} +1 -1
  76. package/pb_public/nors/assets/{wardley-WFR3VGLG-zH3dSKZv.js → wardley-WFR3VGLG-Bb28LKxc.js} +1 -1
  77. package/pb_public/nors/assets/{wardleyDiagram-VM6X3IG4-BffSe1Zn.js → wardleyDiagram-VM6X3IG4-CZbfB95E.js} +1 -1
  78. package/pb_public/nors/assets/{xychartDiagram-S5SC5T6Z-zb3OjZUW.js → xychartDiagram-S5SC5T6Z-BzhKhU_k.js} +1 -1
  79. package/pb_public/nors/index.html +2 -2
  80. package/pb_public/nors/assets/architecture-7GRP2DOG-HrDOEF9a.js +0 -1
  81. package/pb_public/nors/assets/channel-Df8EOoqr.js +0 -1
  82. package/pb_public/nors/assets/classDiagram-ZZMXUADV-B17tfBoX.js +0 -1
  83. package/pb_public/nors/assets/classDiagram-v2-VYDZK3BY-B17tfBoX.js +0 -1
  84. package/pb_public/nors/assets/eventmodeling-NTZA5JFV-04EdYz80.js +0 -1
  85. package/pb_public/nors/assets/flowDiagram-HODETNUW-D2i1JVc0.js +0 -1
  86. package/pb_public/nors/assets/index-BZ_XOI9a.js +0 -71
  87. package/pb_public/nors/assets/index-DpLWWzac.css +0 -1
  88. package/pb_public/nors/assets/railroad-abnf-HS5TGJTU-DAMHMau8.js +0 -1
  89. package/pb_public/nors/assets/railroad-ebnf-LZEXJU2U-CqJSrz-5.js +0 -1
  90. package/pb_public/nors/assets/railroad-peg-WCYAUIDC-CjgiTUIW.js +0 -1
  91. package/pb_public/nors/assets/stateDiagram-v2-MP3YSRHH-4A_XCUQM.js +0 -1
  92. package/pb_public/nors/assets/swimlanesDiagram-VR7AAH4N-D7VxXsS9.js +0 -8
package/README.md CHANGED
@@ -1,6 +1,4 @@
1
- <div align="center">
2
-
3
- <img src="assets/nors-mark-512.png" alt="Nors mark" width="112">
1
+ ![Nors mark](assets/nors-mark-32.png)
4
2
 
5
3
  # Nors
6
4
 
@@ -13,8 +11,6 @@
13
11
  ![No Docker](https://img.shields.io/badge/Docker-not_required-000?style=flat-square&logo=docker)
14
12
  ![Bun](https://img.shields.io/badge/Bun-runtime-000?style=flat-square&logo=bun)
15
13
 
16
- </div>
17
-
18
14
  ---
19
15
 
20
16
  Nors is not an application you deploy. It is one migration and one static
@@ -22,11 +18,7 @@ page, copied into a PocketBase directory you already have. The database,
22
18
  auth, HTTP server and backups are already running — a dedicated notes app
23
19
  would duplicate all of them.
24
20
 
25
- <div align="center">
26
-
27
- <img src="assets/screenshot-dash.png" alt="Nors dashboard — note cards with kind tabs" width="760">
28
-
29
- </div>
21
+ ![Nors dashboard — note cards with kind tabs](assets/screenshot-dash.png)
30
22
 
31
23
  ## What it is
32
24
 
@@ -51,11 +43,7 @@ is nothing else to fill in.
51
43
  | 🛡️ | **Unsaved work asks first** | Leaving the editor with edits pops a guard instead of silently dropping the draft. |
52
44
  | 📵 | **No telemetry** | Zero outbound requests. The page talks to your PocketBase and nothing else. |
53
45
 
54
- <div align="center">
55
-
56
- <img src="assets/screenshot-reader.png" alt="Nors reader — CLI shelf note with rendered Mermaid diagrams" width="760">
57
-
58
- </div>
46
+ ![Nors reader — CLI shelf note with rendered Mermaid diagrams](assets/screenshot-reader.png)
59
47
 
60
48
  ## Footprint
61
49
 
@@ -89,7 +77,7 @@ For a source checkout and remote host, the `deploy/` installer performs the
89
77
  stop → copy → start sequence:
90
78
 
91
79
  ```bash
92
- scp -r pb_migrations pb_public deploy/install.sh host:/tmp/nors-stage/
80
+ scp -r pb_migrations pb_hooks pb_public deploy/install.sh host:/tmp/nors-stage/
93
81
  ssh host
94
82
  sudo /tmp/nors-stage/install.sh /tmp/nors-stage
95
83
  ```
@@ -108,6 +96,7 @@ NORS_PB_URL=https://your.host NORS_PB_EMAIL=... NORS_PB_PASSWORD=... \
108
96
  ```
109
97
  browser ──▶ /nors/ static page, superuser login
110
98
  browser ──▶ /api/collections/nors_notes/* superuser only, CRUD + reorder
99
+ Glance ──▶ 127.0.0.1:8090/api/nors/summary counts + recent titles
111
100
  agent ──▶ drafts markdown ──▶ editor ──▶ publish
112
101
  ```
113
102
 
@@ -123,6 +112,11 @@ with the browser profile has the keys, documented rather than hidden. There is
123
112
  no audit log and no second user; this is a single-operator surface behind
124
113
  Cloudflare Access, not a multi-user app.
125
114
 
115
+ The Glance summary hook has no PocketBase authentication because Glance reads
116
+ it over loopback. The public reverse proxy must return `404` for the exact
117
+ `/api/nors/summary` path; `deploy/patch-caddy-nors-summary.py` installs that
118
+ guard. Do not expose this endpoint publicly: it includes recent note titles.
119
+
126
120
  ## What it deliberately does not do
127
121
 
128
122
  No in-app LLM calls. No public notes or team sharing. No wiki search, tag
package/bin/nors.js CHANGED
@@ -22,7 +22,7 @@ Options
22
22
  -h, --help this
23
23
  -v, --version
24
24
 
25
- The install step only writes pb_migrations/ and pb_public/nors/.
25
+ The install step only writes pb_migrations/, pb_hooks/, and pb_public/nors/.
26
26
  Your data lives in pb_data/ and is never read or written.
27
27
  `
28
28
 
@@ -52,6 +52,7 @@ async function install(dir, force) {
52
52
 
53
53
  const parts = [
54
54
  ["pb_migrations", "pb_migrations"],
55
+ ["pb_hooks", "pb_hooks"],
55
56
  [join("pb_public", "nors"), join("pb_public", "nors")]
56
57
  ]
57
58
  for (const [from, to] of parts) {
@@ -71,7 +72,9 @@ Next, and none of it is automatic:
71
72
  3. Put an auth layer in front of /nors and
72
73
  /api/collections/nors_notes. The collection is superuser-only on its own;
73
74
  the page is a login form anyone could reach.
74
- 4. A source checkout includes optional seed notes and the import-seeds script.
75
+ 4. Block /api/nors/summary at the public reverse proxy. It is intentionally
76
+ unauthenticated so a same-host Glance can read it over loopback.
77
+ 5. A source checkout includes optional seed notes and the import-seeds script.
75
78
  `)
76
79
  }
77
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burakboduroglu/nors",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Personal ops notes dashboard on PocketBase — Norse-named, Solid UI at /nors/",
5
5
  "license": "MIT",
6
6
  "author": "Burak Boduroğlu",
@@ -18,6 +18,7 @@
18
18
  "files": [
19
19
  "bin",
20
20
  "pb_migrations",
21
+ "pb_hooks",
21
22
  "pb_public",
22
23
  "LICENSE",
23
24
  "README.md"
@@ -0,0 +1,44 @@
1
+ /// <reference path="../pb_data/types.d.ts" />
2
+
3
+ // GET /api/nors/summary
4
+ //
5
+ // Intentionally unauthenticated inside PocketBase: Glance reaches it directly
6
+ // over 127.0.0.1, while Caddy returns 404 for the exact public path. Keep that
7
+ // Caddy guard in place because note titles are private metadata.
8
+ routerAdd("GET", "/api/nors/summary", (e) => {
9
+ const records = e.app.findRecordsByFilter(
10
+ "nors_notes",
11
+ "id != ''",
12
+ "-updated",
13
+ 500,
14
+ 0
15
+ )
16
+
17
+ let drafts = 0
18
+ let pinned = 0
19
+ const recent = []
20
+
21
+ for (const record of records) {
22
+ const status = record.getString("status")
23
+ if (status === "draft") drafts++
24
+ if (record.getBool("pinned")) pinned++
25
+
26
+ if (recent.length < 5) {
27
+ const kind = record.getString("kind")
28
+ recent.push({
29
+ title: record.getString("title"),
30
+ slug: record.getString("slug"),
31
+ kind: kind === "runbook" ? "Runbook" : kind === "decision" ? "Karar" : "Not",
32
+ status: status,
33
+ updated: record.getString("updated").substring(0, 10)
34
+ })
35
+ }
36
+ }
37
+
38
+ return e.json(200, {
39
+ total: records.length,
40
+ drafts: drafts,
41
+ pinned: pinned,
42
+ recent: recent
43
+ })
44
+ })
@@ -1 +1 @@
1
- import{m as e}from"./src-BH-TyZbA.js";import{m as t,t as n}from"./mermaid-parser.core-BR6xQvT6.js";import{n as r}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./chunk-DU6HZSFF-B5Wb9e-Z.js";import{n as i,r as a,t as o}from"./chunk-SVP7TREG-DT0H529z.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-FEPUjAo_.js";var c=t().RailroadAbnf.parser.LangiumParser,l=r(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=r(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=r(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=r(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=r(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=r(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=r(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:r(t=>{o.clear(),e.debug(`[ABNF Parser] Starting Langium parse`);let r=c.parse(t);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new n(r);let i=r.value;e.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),e.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
1
+ import{m as e}from"./src-BH-TyZbA.js";import{m as t,t as n}from"./mermaid-parser.core-Bh2pMn-f.js";import{n as r}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./chunk-DU6HZSFF-DdkkHC2K.js";import{n as i,r as a,t as o}from"./chunk-SVP7TREG-Cjv1tk7U.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-CL8sN1KK.js";var c=t().RailroadAbnf.parser.LangiumParser,l=r(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=r(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=r(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=r(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=r(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=r(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=r(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:r(t=>{o.clear(),e.debug(`[ABNF Parser] Starting Langium parse`);let r=c.parse(t);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new n(r);let i=r.value;e.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),e.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-DzxwRta7.js";import{M as e}from"./mermaid-parser.core-Bh2pMn-f.js";export{e as createArchitectureServices};