mulmoterminal 13.3.0 → 13.5.0

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 (129) hide show
  1. package/README.md +10 -3
  2. package/common/libraryMemory.ts +2 -3
  3. package/common/libraryPromote.ts +7 -0
  4. package/common/libraryRetrospective.ts +22 -5
  5. package/dist/assets/{Notation-CypJd7OM-D4oJLFIP.js → Notation-CypJd7OM-BKgqg0ug.js} +1 -1
  6. package/dist/assets/{abnfDiagram-S7VZAUFO-BMcgYOG2.js → abnfDiagram-S7VZAUFO-B4h6oeZs.js} +1 -1
  7. package/dist/assets/{architecture-WOLXFQ4H-CqhsvxLg.js → architecture-WOLXFQ4H-Dq1l0Zni.js} +1 -1
  8. package/dist/assets/{architectureDiagram-YGSQEFNW-DsijgzL1.js → architectureDiagram-YGSQEFNW-B6VzxMiI.js} +1 -1
  9. package/dist/assets/{blockDiagram-APKKGZFW-erx3F2wt.js → blockDiagram-APKKGZFW-J7OTO4gX.js} +1 -1
  10. package/dist/assets/{c4Diagram-KJ2TOQU5-Dr5IktyG.js → c4Diagram-KJ2TOQU5-D7yY7Rc-.js} +1 -1
  11. package/dist/assets/{chunk-6MUBBAK2-DH9iP_SO.js → chunk-6MUBBAK2-Cgd2-WF3.js} +1 -1
  12. package/dist/assets/{chunk-AXFCVDMN-B4mG9OUM.js → chunk-AXFCVDMN-Bq4a_-H8.js} +1 -1
  13. package/dist/assets/{chunk-BG4553SI-B01m1Fri.js → chunk-BG4553SI-BNzUXFWw.js} +1 -1
  14. package/dist/assets/{chunk-DQASFODM-CJxMupbb.js → chunk-DQASFODM-BkhGm08a.js} +1 -1
  15. package/dist/assets/{chunk-HFQBQIA3-KFFKf4m6.js → chunk-HFQBQIA3-j2UYfHlU.js} +1 -1
  16. package/dist/assets/{chunk-KQLB2F66-BLFTzPrj.js → chunk-KQLB2F66-CfLCXDuZ.js} +1 -1
  17. package/dist/assets/{chunk-KS47KZWR-DUf5pi0p.js → chunk-KS47KZWR-DhnoxnCN.js} +1 -1
  18. package/dist/assets/{chunk-LEVMRMFU-ComSfUsY.js → chunk-LEVMRMFU-DVCew3pv.js} +1 -1
  19. package/dist/assets/{chunk-M57EVK23-Cym5WjjC.js → chunk-M57EVK23-SLpx0xKb.js} +1 -1
  20. package/dist/assets/{chunk-OY52VR5R-BqExdpA8.js → chunk-OY52VR5R-DKTWmw49.js} +1 -1
  21. package/dist/assets/{chunk-QB3YPZ4I-C6vMfT9j.js → chunk-QB3YPZ4I-Bk96_PW6.js} +1 -1
  22. package/dist/assets/{chunk-R3KSYZAL-jJrOTMxV.js → chunk-R3KSYZAL-Bq0s2Eun.js} +1 -1
  23. package/dist/assets/{chunk-STOXU5M4-TtyPEMjC.js → chunk-STOXU5M4-CpTweUcf.js} +1 -1
  24. package/dist/assets/{chunk-TU62E6Q5-BcX9C3vU.js → chunk-TU62E6Q5-Yvk0ipL6.js} +1 -1
  25. package/dist/assets/{chunk-X4PVCEUW-622V7pcP.js → chunk-X4PVCEUW-3ezegusa.js} +1 -1
  26. package/dist/assets/{classDiagram-v2-L25IHNXF-CG2OEy42.js → classDiagram-v2-L25IHNXF-CGS0pe7r.js} +1 -1
  27. package/dist/assets/cynefin-EF2NZ3EQ-BgEoWrVY.js +1 -0
  28. package/dist/assets/{cynefinDiagram-L36ESFBY-b0PW0BRV.js → cynefinDiagram-L36ESFBY-YK2IZKmk.js} +1 -1
  29. package/dist/assets/{dagre-SPEB5RXH-ChpooqkD.js → dagre-SPEB5RXH-DX90cq5i.js} +1 -1
  30. package/dist/assets/{diagram-3B7GL73J-COJn-Hnl.js → diagram-3B7GL73J-DOK7yhU0.js} +1 -1
  31. package/dist/assets/{diagram-DNEMPZML-DPoos9W_.js → diagram-DNEMPZML-AIZIP-sA.js} +1 -1
  32. package/dist/assets/{diagram-L3MUGCDN-BomMVHrk.js → diagram-L3MUGCDN-Ct-ITOBV.js} +1 -1
  33. package/dist/assets/{diagram-LA4NIPWU-DOmO8Jer.js → diagram-LA4NIPWU-E7Cwl_l6.js} +1 -1
  34. package/dist/assets/{diagram-MHCOC4E2-BHBeHFy8.js → diagram-MHCOC4E2-UIymiVVY.js} +1 -1
  35. package/dist/assets/{diagram-XPFHEONP-DD7FFvTB.js → diagram-XPFHEONP-ryciLG_j.js} +1 -1
  36. package/dist/assets/dist-BSzeiOgr.js +2 -0
  37. package/dist/assets/{dist-B_e8GY23.js → dist-C71641Ro.js} +1 -1
  38. package/dist/assets/{dist-CvW1pMqB.js → dist-D3E8T4ya.js} +1 -1
  39. package/dist/assets/{dist-DreEPxod.js → dist-DBQe5WKY.js} +1 -1
  40. package/dist/assets/{dist-BOQlrxwy.js → dist-Dr7JIHBd.js} +1 -1
  41. package/dist/assets/{dist-DnfM3aPI.js → dist-b-yUBxAe.js} +1 -1
  42. package/dist/assets/{ebnfDiagram-UZSYDL2S-DFzHCxXo.js → ebnfDiagram-UZSYDL2S-CY0JHMvz.js} +1 -1
  43. package/dist/assets/{echarts-gl-YiN0LqIW.js → echarts-gl-bLBKDvOM.js} +1 -1
  44. package/dist/assets/{elk-XV6XMXQE-Kgff7tvd.js → elk-XV6XMXQE-1m-1l45x.js} +1 -1
  45. package/dist/assets/{emscripten-module-Q67P5WYC-B9iy4Bgu.js → emscripten-module-Q67P5WYC-DhkBfBTU.js} +1 -1
  46. package/dist/assets/{erDiagram-EYBAPDEH-BTWkB5PA.js → erDiagram-EYBAPDEH-Cj9Z1QAt.js} +1 -1
  47. package/dist/assets/{eventmodeling-K75KTNOO-BgZU1_zA.js → eventmodeling-K75KTNOO-Bgu3bWKF.js} +1 -1
  48. package/dist/assets/flowDiagram-MALGAFMO--WBWxzio.js +1 -0
  49. package/dist/assets/{ganttDiagram-23REXITY-DlFGlYNT.js → ganttDiagram-23REXITY-DrMv2uTE.js} +1 -1
  50. package/dist/assets/gitGraph-VSP46ZUC-BZ7rQbeE.js +1 -0
  51. package/dist/assets/{gitGraphDiagram-STJD7YCW-DratNofa.js → gitGraphDiagram-STJD7YCW-DIC11JmN.js} +1 -1
  52. package/dist/assets/{index-Dc8zMoSG.js → index-9wJpsvRU.js} +628 -628
  53. package/dist/assets/info-OHQRW6UA-BXQ_c3wB.js +1 -0
  54. package/dist/assets/{infoDiagram-KBXO4MBG-D9vm3eva.js → infoDiagram-KBXO4MBG-DDSo8Io7.js} +1 -1
  55. package/dist/assets/{ishikawaDiagram-M35NCXHK-C16xQBfm.js → ishikawaDiagram-M35NCXHK-Bzmw2TF2.js} +1 -1
  56. package/dist/assets/{journeyDiagram-OPLOXDXO-C3MJaTdC.js → journeyDiagram-OPLOXDXO-BxwCc82r.js} +1 -1
  57. package/dist/assets/{kanban-definition-BZKZHSQY-CgHSD97S.js → kanban-definition-BZKZHSQY-Cynf0hZx.js} +1 -1
  58. package/dist/assets/{line-DGc9Wwrr.js → line-TO9hemou.js} +1 -1
  59. package/dist/assets/{manifold-DO1Dy1jV.js → manifold-HiFPOFEg.js} +1 -1
  60. package/dist/assets/{mermaid-parser.core-CZXw0Z-h.js → mermaid-parser.core-BNvYCkrt.js} +3 -3
  61. package/dist/assets/{mermaid.core-Am2s49wf.js → mermaid.core-BmMXO-Il.js} +4 -4
  62. package/dist/assets/{mindmap-definition-I2QAS2VK-AYuUi-1t.js → mindmap-definition-I2QAS2VK-CADhbBNc.js} +1 -1
  63. package/dist/assets/packet-JDAUHWVQ-6yVrcOt0.js +1 -0
  64. package/dist/assets/{pegDiagram-FD4XPPHP-ZgRyArnU.js → pegDiagram-FD4XPPHP-D5Mjx2bR.js} +1 -1
  65. package/dist/assets/pie-XZMESJXO-BVbFnlho.js +1 -0
  66. package/dist/assets/{pieDiagram-J4AKIIQI-Jdh-2iWY.js → pieDiagram-J4AKIIQI-D8C0xlym.js} +1 -1
  67. package/dist/assets/{quadrantDiagram-XTYBLID2-B-L_DUcJ.js → quadrantDiagram-XTYBLID2-DUSU8N76.js} +1 -1
  68. package/dist/assets/radar-ABXABTNO-BAkn0QUi.js +1 -0
  69. package/dist/assets/railroad-I3PHUGI6-BsTsrGjr.js +1 -0
  70. package/dist/assets/{railroad-abnf-LNEFI6M7-BRsICqY5.js → railroad-abnf-LNEFI6M7-DYF2oGOx.js} +1 -1
  71. package/dist/assets/{railroad-ebnf-DWYD2UWJ-J581SN3T.js → railroad-ebnf-DWYD2UWJ-B9P1IjyH.js} +1 -1
  72. package/dist/assets/{railroad-peg-JR7BVNR7-C-QY0AZR.js → railroad-peg-JR7BVNR7-DAXTUfFs.js} +1 -1
  73. package/dist/assets/{railroadDiagram-MRQ6NCDL-CvjjFwVP.js → railroadDiagram-MRQ6NCDL-BK0TrBM3.js} +1 -1
  74. package/dist/assets/{requirementDiagram-Y7LWUY3S-qrXGd3zr.js → requirementDiagram-Y7LWUY3S-C0uoUpA5.js} +1 -1
  75. package/dist/assets/{sankeyDiagram-WGJFYUXA-Bx0N1IkY.js → sankeyDiagram-WGJFYUXA-CG-jvyNh.js} +1 -1
  76. package/dist/assets/{sequenceDiagram-5NDRBG5M-w24GJW4g.js → sequenceDiagram-5NDRBG5M-DTZyjaGv.js} +1 -1
  77. package/dist/assets/{stateDiagram-v2-FJ4FJNEA-D1KVlNmY.js → stateDiagram-v2-FJ4FJNEA-BeKI0WVL.js} +1 -1
  78. package/dist/assets/{swimlanes-UMQ2AFYF-DTCUOS1f.js → swimlanes-UMQ2AFYF-B0E3P_F_.js} +1 -1
  79. package/dist/assets/swimlanesDiagram-OMPLPG4O-BR8__KX0.js +8 -0
  80. package/dist/assets/{timeline-definition-SEUHKTQE-C2r1NiQI.js → timeline-definition-SEUHKTQE-DyR_qs9y.js} +1 -1
  81. package/dist/assets/treeView-D4JQ5SDB-BFOPdUdk.js +1 -0
  82. package/dist/assets/treemap-SAJKECNS-B9aVvZ4_.js +1 -0
  83. package/dist/assets/{usecaseDiagram-AFA6YXN4-CMJfAL7M.js → usecaseDiagram-AFA6YXN4-B9yjOqP5.js} +1 -1
  84. package/dist/assets/{vennDiagram-NNMJR3RB-BQYxzZ6O.js → vennDiagram-NNMJR3RB-DsCylvr-.js} +1 -1
  85. package/dist/assets/wardley-7MLQ67FV-BA5WNcCQ.js +1 -0
  86. package/dist/assets/{wardleyDiagram-S7YFUSEH-DtT564L-.js → wardleyDiagram-S7YFUSEH-BZ0eRxFH.js} +1 -1
  87. package/dist/assets/{xychartDiagram-GGNKY7IX-ByQ3LQkA.js → xychartDiagram-GGNKY7IX-YB9bOG5A.js} +1 -1
  88. package/dist/index.html +1 -1
  89. package/docs/ChangeLog.md +25 -0
  90. package/docs/facts.json +1 -1
  91. package/docs/guide/en/feature-list.md +3 -1
  92. package/docs/guide/en/features.md +1 -1
  93. package/docs/guide/en/index.md +3 -4
  94. package/docs/guide/en/v13.4.0.md +65 -0
  95. package/docs/guide/en/v13.5.0.md +61 -0
  96. package/docs/guide/ja/feature-list.md +3 -1
  97. package/docs/guide/ja/features.md +1 -1
  98. package/docs/guide/ja/index.md +2 -3
  99. package/docs/guide/ja/v13.4.0.md +65 -0
  100. package/docs/guide/ja/v13.5.0.md +56 -0
  101. package/package.json +1 -1
  102. package/server/backends/library/conversation-fold.ts +9 -2
  103. package/server/backends/library/index-queries.ts +39 -4
  104. package/server/backends/library/index-store.ts +26 -4
  105. package/server/backends/library/indexer.ts +2 -0
  106. package/server/backends/library/library-service.ts +5 -1
  107. package/server/backends/library/memory-folders.ts +3 -4
  108. package/server/backends/library/memory-health-read.ts +3 -11
  109. package/server/backends/library/project-folders.ts +82 -0
  110. package/server/backends/library/retrospective.ts +69 -24
  111. package/server/backends/library/spend-fold.ts +197 -0
  112. package/server/backends/library/spend-split.ts +81 -0
  113. package/server/routes/library-memory-routes.ts +2 -1
  114. package/server/routes/library-memory-tidy-routes.ts +36 -0
  115. package/server/routes/library-routes.ts +2 -0
  116. package/server/skills/mulmoterminal-library/SKILL.md +34 -1
  117. package/dist/assets/cynefin-EF2NZ3EQ-DwqnCkiL.js +0 -1
  118. package/dist/assets/dist-CSp1bGLv.js +0 -2
  119. package/dist/assets/flowDiagram-MALGAFMO-BPTzCYVB.js +0 -1
  120. package/dist/assets/gitGraph-VSP46ZUC-C-zLTI42.js +0 -1
  121. package/dist/assets/info-OHQRW6UA-D6xccwYW.js +0 -1
  122. package/dist/assets/packet-JDAUHWVQ-BRmDFxbP.js +0 -1
  123. package/dist/assets/pie-XZMESJXO-BcU8uN2-.js +0 -1
  124. package/dist/assets/radar-ABXABTNO-q6s0ov8g.js +0 -1
  125. package/dist/assets/railroad-I3PHUGI6-FiR2iLTA.js +0 -1
  126. package/dist/assets/swimlanesDiagram-OMPLPG4O-674lZwKu.js +0 -8
  127. package/dist/assets/treeView-D4JQ5SDB-Cg-BEsgg.js +0 -1
  128. package/dist/assets/treemap-SAJKECNS-BSixpn8-.js +0 -1
  129. package/dist/assets/wardley-7MLQ67FV-BicDp3r_.js +0 -1
package/README.md CHANGED
@@ -1906,7 +1906,11 @@ narrow and tall for one record you are discussing — and each position keeps it
1906
1906
  memory only) and **Write this text there** (writes this memory's text over that copy, refused if
1907
1907
  it changed since it was read, with **Undo**), so the copies can be made one. Under a memory's title,
1908
1908
  **Written in** names the conversation that last wrote it (from the file writes its transcript
1909
- recorded) and opens it.
1909
+ recorded) and opens it. Each project heading has a tidy-up button: it opens Claude in plan mode in
1910
+ the project's directory with the `mulmoterminal-library` skill, which proposes merging duplicate
1911
+ memories, removing ones the code shows no longer hold, fixing what the health check found and
1912
+ moving standing rules into a `CLAUDE.md` or a skill, backs up every file it changes, and writes
1913
+ nothing until you approve.
1910
1914
  **Edit** (`Enter`) changes a memory's whole text in place (`⌘Enter` saves, `Esc` cancels); a save
1911
1915
  is refused when the file changed on disk since it was opened, and a running session there is warned of.
1912
1916
  **⋯** → **Move to Trash** moves a memory to the system Trash with its lines in `MEMORY.md`, and
@@ -1924,8 +1928,11 @@ narrow and tall for one record you are discussing — and each position keeps it
1924
1928
  managed `settings.json` files in Claude Code's order and shows the permission rules (every file's,
1925
1929
  added up), environment variables, hooks and other keys in effect, each naming the file that set it.
1926
1930
  Read only. **More features** → **Usage** adds a retrospective of the last twelve weeks from the
1927
- same index: money, conversations and the PRs they made, by week, project and agent (a conversation
1928
- counts in the week it started); the token windows appear above it while token rotation is on. Design: [`docs/library-design.md`](docs/library-design.md).
1931
+ same index: money, tokens, conversations and the PRs they made, by week, project, agent and model.
1932
+ Money and tokens count in the week they were spent — Claude Code records cost only as running totals
1933
+ with no time, so each model's cost is split over the conversation's replies by their tokens — and
1934
+ every time Claude Code started counting again is added in; a conversation and its PRs count in the
1935
+ week it started. The token windows appear above it while token rotation is on. Design: [`docs/library-design.md`](docs/library-design.md).
1929
1936
  - **Skills viewer** — **More features** → **Skills** lists every Claude skill on disk in three
1930
1937
  columns — where it lives, its skills, its `SKILL.md`. The places are your `~/.claude/skills`,
1931
1938
  each enabled plugin (skills shown as `plugin:skill`), and the `.claude/skills` of each folder a
@@ -12,9 +12,8 @@ export const MEMORY_EDIT_MAX_BYTES = 256 * 1024;
12
12
  /** The index's own name in a memory folder. */
13
13
  export const MEMORY_INDEX_FILE = "MEMORY.md";
14
14
 
15
- /** The folder Claude Code keeps a directory's data under: every character outside `[A-Za-z0-9_-]`
16
- * becomes `-` (its own rule, so a directory is matched to its memory without guessing). */
17
- export const projectSlug = (cwd: string): string => cwd.replace(/[^a-zA-Z0-9\-_]/g, "-") || "unknown";
15
+ /** A project folder's name as Claude Code makes them (`encodeProjectDirName`, server/session/project-dir.ts). */
16
+ export const isProjectSlug = (slug: string): boolean => /^[A-Za-z0-9_-]{1,255}$/.test(slug);
18
17
 
19
18
  export interface LibraryMemoryFile {
20
19
  /** The file's name in the folder. */
@@ -2,6 +2,7 @@
2
2
  // bundled skill to make it. Both sides decide from these — the reader lists the targets, the server
3
3
  // refuses any other and writes the turn — so they are named once, here.
4
4
  import type { BundledSkillName } from "./bundledSkills.js";
5
+ import { isProjectSlug } from "./libraryMemory.js";
5
6
 
6
7
  /** What a conversation can be promoted to: a memory, a `CLAUDE.md` rule, a plan under `plans/`, an
7
8
  * issue, or a skill. */
@@ -23,3 +24,9 @@ const SESSION_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12
23
24
  export function promoteTurn(target: PromoteTarget, sessionId: string): string | null {
24
25
  return SESSION_ID.test(sessionId) ? `/${PROMOTE_SKILL} promote ${target} ${sessionId}` : null;
25
26
  }
27
+
28
+ /** The first turn of the session that proposes how to tidy one project's memory, or null for a
29
+ * folder name that is not one Claude Code makes. */
30
+ export function tidyTurn(slug: string): string | null {
31
+ return isProjectSlug(slug) ? `/${PROMOTE_SKILL} tidy ${slug}` : null;
32
+ }
@@ -1,6 +1,7 @@
1
- // The retrospective in /usage (#3335): what the last weeks went on — money, conversations and the PRs
2
- // they made — by week, by project and by agent, computed from the Library's index rather than Claude
3
- // Code's own stats cache, which can stop updating. Shared by the route and the view.
1
+ // The retrospective in /usage (#3335): what the last weeks went on — money, tokens, conversations and
2
+ // the PRs they made — by week, by project, by agent and by model, computed from the Library's index
3
+ // rather than Claude Code's own stats cache, which can stop updating. Shared by the route and the view.
4
+ // Money and tokens count when they were spent (#3395); a conversation and its PRs, in the week it started.
4
5
  import { isRecord } from "./isRecord.js";
5
6
 
6
7
  /** How far back the retrospective reaches. */
@@ -12,6 +13,13 @@ export interface RetrospectiveTotals {
12
13
  prs: number;
13
14
  }
14
15
 
16
+ export interface RetrospectiveTokens {
17
+ input: number;
18
+ output: number;
19
+ cacheRead: number;
20
+ cacheWrite: number;
21
+ }
22
+
15
23
  export interface LibraryRetrospective {
16
24
  /** Each week's totals, oldest first, every week present (an empty one is all zeros). `start_ms` is the
17
25
  * Monday the week starts on, at local midnight on the server. */
@@ -20,11 +28,16 @@ export interface LibraryRetrospective {
20
28
  projects: (RetrospectiveTotals & { cwd: string })[];
21
29
  /** By agent, the most spent first. */
22
30
  agents: (RetrospectiveTotals & { agent: string })[];
23
- total: RetrospectiveTotals;
31
+ /** By model, the most spent first; a cost recorded with no model is under "". */
32
+ models: { model: string; costUsd: number; tokens: RetrospectiveTokens }[];
33
+ total: RetrospectiveTotals & { tokens: RetrospectiveTokens };
24
34
  }
25
35
 
26
36
  const isTotals = (value: unknown): value is RetrospectiveTotals =>
27
37
  isRecord(value) && typeof value.costUsd === "number" && typeof value.conversations === "number" && typeof value.prs === "number";
38
+ const isTokens = (value: unknown): value is RetrospectiveTokens =>
39
+ isRecord(value) && ["input", "output", "cacheRead", "cacheWrite"].every((key) => typeof value[key] === "number");
40
+ const isModel = (value: unknown): boolean => isRecord(value) && typeof value.model === "string" && typeof value.costUsd === "number" && isTokens(value.tokens);
28
41
  const listOf = (value: unknown, key: string, kind: "string" | "number"): boolean =>
29
42
  Array.isArray(value) && value.every((entry) => isTotals(entry) && isRecord(entry) && typeof entry[key] === kind);
30
43
 
@@ -33,4 +46,8 @@ export const isLibraryRetrospective = (value: unknown): value is LibraryRetrospe
33
46
  listOf(value.weeks, "start_ms", "number") &&
34
47
  listOf(value.projects, "cwd", "string") &&
35
48
  listOf(value.agents, "agent", "string") &&
36
- isTotals(value.total);
49
+ Array.isArray(value.models) &&
50
+ value.models.every(isModel) &&
51
+ isTotals(value.total) &&
52
+ isRecord(value.total) &&
53
+ isTokens(value.total.tokens);
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/opensheetmusicdisplay.min-CeBHhrOd.js","assets/rolldown-runtime-BCiCTKAo.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./rolldown-runtime-BCiCTKAo.js";import{C as t,D as n,E as r,S as i,T as a,_ as o,b as s,f as c,n as l,t as u,v as d,w as f,x as p,y as m}from"./index-Dc8zMoSG.js";p(),r();var h={class:`sheet`},g={key:0,class:`status`},_={key:1,class:`status`},v=u(s({__name:`Notation`,props:{musicxml:{},tempo:{},now:{}},setup(r){let s=r,u=n(null),p=n(`loading`),v,y=[],b=0;function x(e){let t=v?.cursor;if(t===void 0||y.length===0)return;let n=l(y,e);if(n!==b)for(n<b&&(t.reset(),b=0);b<n;)t.next(),b++}let S=0;async function C(t){let n=u.value;if(!n)return;let r=++S;p.value=`loading`;try{let{OpenSheetMusicDisplay:i}=await c(async()=>{let{OpenSheetMusicDisplay:t}=await import(`./opensheetmusicdisplay.min-CeBHhrOd.js`).then(t=>e(t.default,1));return{OpenSheetMusicDisplay:t}},__vite__mapDeps([0,1]));if(r!==S)return;v??=new i(n,{backend:`svg`,autoResize:!0,autoBeam:!0,drawTitle:!1,drawComposer:!1,drawCredits:!1,followCursor:!0,defaultColorMusic:`#000000`});let a=v;if(await a.load(t),r!==S)return;a.render();let o=a.cursor;o.show(),o.reset();let l=240/s.tempo,u=[];for(;!o.iterator.EndReached;)u.push(o.iterator.currentTimeStamp.RealValue*l),o.next();o.reset(),y=u,b=0,p.value=`ready`,x(s.now)}catch(e){if(r!==S)return;console.error(`jinglescript: the sheet music could not be drawn`,e),p.value=`failed`}}return t(()=>void C(s.musicxml)),a(()=>s.musicxml,e=>void C(e)),a(()=>s.now,e=>x(e)),i(()=>{S++,v?.clear(),v=void 0}),(e,t)=>(f(),m(`div`,h,[p.value===`loading`?(f(),m(`p`,g,`Drawing the sheet music…`)):p.value===`failed`?(f(),m(`p`,_,`The sheet music could not be drawn. The audio still plays; the MusicXML can be downloaded below.`)):d(``,!0),o(`div`,{ref_key:`container`,ref:u,class:`page`},null,512)]))}}),[[`__scopeId`,`data-v-80f75f9d`]]);export{v as default};
2
+ import{o as e}from"./rolldown-runtime-BCiCTKAo.js";import{C as t,D as n,E as r,S as i,T as a,_ as o,b as s,f as c,n as l,t as u,v as d,w as f,x as p,y as m}from"./index-9wJpsvRU.js";p(),r();var h={class:`sheet`},g={key:0,class:`status`},_={key:1,class:`status`},v=u(s({__name:`Notation`,props:{musicxml:{},tempo:{},now:{}},setup(r){let s=r,u=n(null),p=n(`loading`),v,y=[],b=0;function x(e){let t=v?.cursor;if(t===void 0||y.length===0)return;let n=l(y,e);if(n!==b)for(n<b&&(t.reset(),b=0);b<n;)t.next(),b++}let S=0;async function C(t){let n=u.value;if(!n)return;let r=++S;p.value=`loading`;try{let{OpenSheetMusicDisplay:i}=await c(async()=>{let{OpenSheetMusicDisplay:t}=await import(`./opensheetmusicdisplay.min-CeBHhrOd.js`).then(t=>e(t.default,1));return{OpenSheetMusicDisplay:t}},__vite__mapDeps([0,1]));if(r!==S)return;v??=new i(n,{backend:`svg`,autoResize:!0,autoBeam:!0,drawTitle:!1,drawComposer:!1,drawCredits:!1,followCursor:!0,defaultColorMusic:`#000000`});let a=v;if(await a.load(t),r!==S)return;a.render();let o=a.cursor;o.show(),o.reset();let l=240/s.tempo,u=[];for(;!o.iterator.EndReached;)u.push(o.iterator.currentTimeStamp.RealValue*l),o.next();o.reset(),y=u,b=0,p.value=`ready`,x(s.now)}catch(e){if(r!==S)return;console.error(`jinglescript: the sheet music could not be drawn`,e),p.value=`failed`}}return t(()=>void C(s.musicxml)),a(()=>s.musicxml,e=>void C(e)),a(()=>s.now,e=>x(e)),i(()=>{S++,v?.clear(),v=void 0}),(e,t)=>(f(),m(`div`,h,[p.value===`loading`?(f(),m(`p`,g,`Drawing the sheet music…`)):p.value===`failed`?(f(),m(`p`,_,`The sheet music could not be drawn. The audio still plays; the MusicXML can be downloaded below.`)):d(``,!0),o(`div`,{ref_key:`container`,ref:u,class:`page`},null,512)]))}}),[[`__scopeId`,`data-v-80f75f9d`]]);export{v as default};
@@ -1 +1 @@
1
- import{n as e,r as t,t as n}from"./chunk-OY52VR5R-BqExdpA8.js";import{t as r}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-Am2s49wf.js";import"./chunk-BG4553SI-B01m1Fri.js";import{m as i}from"./src-Bc_iCBZR.js";import{n as a}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as o,t as s}from"./mermaid-parser.core-CZXw0Z-h.js";var c=o().RailroadAbnf.parser.LangiumParser,l=a(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=a(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=a(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=a(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=a(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=a(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=a(e=>{r(e,n),e.title&&n.setTitle(e.title),e.rules.map(e=>n.addRule(m(e)))},`populateDb`),g={parser:{parse:a(e=>{n.clear(),i.debug(`[ABNF Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;i.debug(`[ABNF Parser] Parsed rules:`,r.rules.length),h(r),i.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:n}},db:n,renderer:t,styles:e};export{g as diagram};
1
+ import{n as e,r as t,t as n}from"./chunk-OY52VR5R-DKTWmw49.js";import{t as r}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-BmMXO-Il.js";import"./chunk-BG4553SI-BNzUXFWw.js";import{m as i}from"./src-Bc_iCBZR.js";import{n as a}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as o,t as s}from"./mermaid-parser.core-BNvYCkrt.js";var c=o().RailroadAbnf.parser.LangiumParser,l=a(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=a(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=a(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=a(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=a(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=a(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=a(e=>{r(e,n),e.title&&n.setTitle(e.title),e.rules.map(e=>n.addRule(m(e)))},`populateDb`),g={parser:{parse:a(e=>{n.clear(),i.debug(`[ABNF Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;i.debug(`[ABNF Parser] Parsed rules:`,r.rules.length),h(r),i.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:n}},db:n,renderer:t,styles:e};export{g as diagram};
@@ -1 +1 @@
1
- export{M as createArchitectureServices}from"./mermaid-parser.core-CZXw0Z-h.js";import"./chunk-NGNAAXSQ-DI_UYJZ4.js";
1
+ export{M as createArchitectureServices}from"./mermaid-parser.core-BNvYCkrt.js";import"./chunk-NGNAAXSQ-DI_UYJZ4.js";