mulmoterminal 13.1.0 → 13.2.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 (123) hide show
  1. package/README.md +6 -1
  2. package/common/libraryFiles.ts +52 -0
  3. package/common/libraryMemory.ts +117 -0
  4. package/dist/assets/{Notation-CypJd7OM-BO9f8_wn.js → Notation-CypJd7OM-Bkj3ugvx.js} +1 -1
  5. package/dist/assets/{abnfDiagram-S7VZAUFO-DX7MYQNO.js → abnfDiagram-S7VZAUFO-D1ywcxJJ.js} +1 -1
  6. package/dist/assets/{architecture-WOLXFQ4H-Er33vMDl.js → architecture-WOLXFQ4H-CzxWOh7g.js} +1 -1
  7. package/dist/assets/{architectureDiagram-YGSQEFNW-RuFs4K8r.js → architectureDiagram-YGSQEFNW-DXkBxnZB.js} +1 -1
  8. package/dist/assets/{blockDiagram-APKKGZFW-CEakdgi0.js → blockDiagram-APKKGZFW-C93vJZ60.js} +1 -1
  9. package/dist/assets/{c4Diagram-KJ2TOQU5-DkZTuzXy.js → c4Diagram-KJ2TOQU5-CzhIrSPv.js} +1 -1
  10. package/dist/assets/{chunk-6MUBBAK2-4Psl-rVs.js → chunk-6MUBBAK2-B8dba2D5.js} +1 -1
  11. package/dist/assets/{chunk-AXFCVDMN-_THBcA3m.js → chunk-AXFCVDMN-BF1BaeZM.js} +1 -1
  12. package/dist/assets/{chunk-BG4553SI-DEs9CcBd.js → chunk-BG4553SI-CrlLpYyS.js} +1 -1
  13. package/dist/assets/{chunk-DQASFODM-BjPZd1vg.js → chunk-DQASFODM-31XKM8G5.js} +1 -1
  14. package/dist/assets/{chunk-HFQBQIA3-Cn50fJjU.js → chunk-HFQBQIA3-hdZEPui0.js} +1 -1
  15. package/dist/assets/{chunk-KQLB2F66-CxKJ5VW6.js → chunk-KQLB2F66-pq29Bwny.js} +1 -1
  16. package/dist/assets/{chunk-KS47KZWR-B1n-ARyf.js → chunk-KS47KZWR-D8euv6BW.js} +1 -1
  17. package/dist/assets/{chunk-LEVMRMFU-BCKhEfOJ.js → chunk-LEVMRMFU-DxfgjwMM.js} +1 -1
  18. package/dist/assets/{chunk-M57EVK23-C2IbA_qJ.js → chunk-M57EVK23-CbRhplaG.js} +1 -1
  19. package/dist/assets/{chunk-OY52VR5R-TzFAtZ_w.js → chunk-OY52VR5R-WRzw8fSZ.js} +1 -1
  20. package/dist/assets/{chunk-QB3YPZ4I-CqcBmlgs.js → chunk-QB3YPZ4I-BomH8StZ.js} +1 -1
  21. package/dist/assets/{chunk-R3KSYZAL-sapT-duB.js → chunk-R3KSYZAL-U5ZTWDjT.js} +1 -1
  22. package/dist/assets/{chunk-STOXU5M4-BNotEa29.js → chunk-STOXU5M4-Cwsfrp8s.js} +1 -1
  23. package/dist/assets/{chunk-TU62E6Q5-BZhyxJkb.js → chunk-TU62E6Q5-CgTV0yCN.js} +1 -1
  24. package/dist/assets/{chunk-X4PVCEUW-CNQ-Xvdz.js → chunk-X4PVCEUW-DkeipGOD.js} +1 -1
  25. package/dist/assets/{classDiagram-v2-L25IHNXF-BKLfGW9P.js → classDiagram-v2-L25IHNXF-D_SUDLFf.js} +1 -1
  26. package/dist/assets/cynefin-EF2NZ3EQ-BO6sbOTe.js +1 -0
  27. package/dist/assets/{cynefinDiagram-L36ESFBY-DCZOgs8X.js → cynefinDiagram-L36ESFBY-SGjnYvMu.js} +1 -1
  28. package/dist/assets/{dagre-SPEB5RXH-Dy0BJIEm.js → dagre-SPEB5RXH-BgdOh_QS.js} +1 -1
  29. package/dist/assets/{diagram-3B7GL73J-S6ZhiU2d.js → diagram-3B7GL73J-BpgZlDn8.js} +1 -1
  30. package/dist/assets/{diagram-DNEMPZML-CUmg80Qc.js → diagram-DNEMPZML-xrSdIhy8.js} +1 -1
  31. package/dist/assets/{diagram-L3MUGCDN-cPBBA4WI.js → diagram-L3MUGCDN-CQsJbFFT.js} +1 -1
  32. package/dist/assets/{diagram-LA4NIPWU-CPCpe3xv.js → diagram-LA4NIPWU-kJV1gdXE.js} +1 -1
  33. package/dist/assets/{diagram-MHCOC4E2-Dw5Ffvbi.js → diagram-MHCOC4E2-CNBRjzg8.js} +1 -1
  34. package/dist/assets/{diagram-XPFHEONP-Cc0-H1nc.js → diagram-XPFHEONP-BuoqzWAD.js} +1 -1
  35. package/dist/assets/{dist-BhGUK0iZ.js → dist-BGAjB1Pl.js} +1 -1
  36. package/dist/assets/{dist-DL_hxD1T.js → dist-BoBnhiwu.js} +1 -1
  37. package/dist/assets/{dist-BsVzXb6G.js → dist-CH6Es3_d.js} +1 -1
  38. package/dist/assets/{dist-DvRaBDyS.js → dist-CaAdsmKa.js} +1 -1
  39. package/dist/assets/{dist-DRN9-QtG.js → dist-CkwWFeBg.js} +1 -1
  40. package/dist/assets/dist-CvoDRBOB.js +2 -0
  41. package/dist/assets/{ebnfDiagram-UZSYDL2S-m4wkQjZ7.js → ebnfDiagram-UZSYDL2S-COZ_UYsS.js} +1 -1
  42. package/dist/assets/{echarts-gl-C-Tb2Yv4.js → echarts-gl-Cju9Hjy8.js} +1 -1
  43. package/dist/assets/{elk-XV6XMXQE-_TQxmAcx.js → elk-XV6XMXQE-Bf_zpXJ-.js} +1 -1
  44. package/dist/assets/{emscripten-module-Q67P5WYC-DkK5EL_r.js → emscripten-module-Q67P5WYC-C2pz9hud.js} +1 -1
  45. package/dist/assets/{erDiagram-EYBAPDEH-DzcKEmuK.js → erDiagram-EYBAPDEH-B_wEcY9d.js} +1 -1
  46. package/dist/assets/{eventmodeling-K75KTNOO-C6a_Sq-9.js → eventmodeling-K75KTNOO-Bz-7Ov6a.js} +1 -1
  47. package/dist/assets/flowDiagram-MALGAFMO-BNCQgw2W.js +1 -0
  48. package/dist/assets/{ganttDiagram-23REXITY-BL9fHj3z.js → ganttDiagram-23REXITY-9dI4Sb-Y.js} +1 -1
  49. package/dist/assets/gitGraph-VSP46ZUC-C1LDt_Ps.js +1 -0
  50. package/dist/assets/{gitGraphDiagram-STJD7YCW-Dspf-kdw.js → gitGraphDiagram-STJD7YCW-CJrcuSxh.js} +1 -1
  51. package/dist/assets/{index-CpS9q9L6.js → index-2biruWQx.js} +400 -397
  52. package/dist/assets/index-Bosx0ygR.css +1 -0
  53. package/dist/assets/info-OHQRW6UA-DRlKlOwD.js +1 -0
  54. package/dist/assets/{infoDiagram-KBXO4MBG-BBUCSKcc.js → infoDiagram-KBXO4MBG-CFuszPhx.js} +1 -1
  55. package/dist/assets/{ishikawaDiagram-M35NCXHK-CR5AxlN-.js → ishikawaDiagram-M35NCXHK-0cLJulAY.js} +1 -1
  56. package/dist/assets/{journeyDiagram-OPLOXDXO-DcFWQOr3.js → journeyDiagram-OPLOXDXO-BLj4TqPQ.js} +1 -1
  57. package/dist/assets/{kanban-definition-BZKZHSQY-D14qopgX.js → kanban-definition-BZKZHSQY-BwxUFQi3.js} +1 -1
  58. package/dist/assets/{line-CtLI_lsS.js → line-BY6Cr-hg.js} +1 -1
  59. package/dist/assets/{manifold-BSMczo8C.js → manifold-CHW6v47O.js} +1 -1
  60. package/dist/assets/{mermaid-parser.core-D0v0F3kZ.js → mermaid-parser.core-DCy09sdt.js} +3 -3
  61. package/dist/assets/{mermaid.core-boy8dqNh.js → mermaid.core-DII2m8Jh.js} +4 -4
  62. package/dist/assets/{mindmap-definition-I2QAS2VK-DYbE3HR8.js → mindmap-definition-I2QAS2VK-DPuWv7ac.js} +1 -1
  63. package/dist/assets/packet-JDAUHWVQ-D5o3cjnq.js +1 -0
  64. package/dist/assets/{pegDiagram-FD4XPPHP-DO9kTbo4.js → pegDiagram-FD4XPPHP-RxkPvHT3.js} +1 -1
  65. package/dist/assets/pie-XZMESJXO-M5OsFE3Z.js +1 -0
  66. package/dist/assets/{pieDiagram-J4AKIIQI-DWIgbOK_.js → pieDiagram-J4AKIIQI-CLtu6zfB.js} +1 -1
  67. package/dist/assets/{quadrantDiagram-XTYBLID2-I-htxFyw.js → quadrantDiagram-XTYBLID2-CzWQe7_L.js} +1 -1
  68. package/dist/assets/radar-ABXABTNO-FzD2sCnH.js +1 -0
  69. package/dist/assets/railroad-I3PHUGI6-D5_ZVXhN.js +1 -0
  70. package/dist/assets/{railroad-abnf-LNEFI6M7-B8YpE0yt.js → railroad-abnf-LNEFI6M7-BD6waUQF.js} +1 -1
  71. package/dist/assets/{railroad-ebnf-DWYD2UWJ-BTP-Py1A.js → railroad-ebnf-DWYD2UWJ-ClBqanFH.js} +1 -1
  72. package/dist/assets/{railroad-peg-JR7BVNR7-C7E3Pvj8.js → railroad-peg-JR7BVNR7-VMHl1tcR.js} +1 -1
  73. package/dist/assets/{railroadDiagram-MRQ6NCDL-Iwurnw7-.js → railroadDiagram-MRQ6NCDL-RiGAgMaB.js} +1 -1
  74. package/dist/assets/{requirementDiagram-Y7LWUY3S-Bm7y1HTz.js → requirementDiagram-Y7LWUY3S-gMasSNPL.js} +1 -1
  75. package/dist/assets/{sankeyDiagram-WGJFYUXA-2as2DzX_.js → sankeyDiagram-WGJFYUXA-DWRWy9ya.js} +1 -1
  76. package/dist/assets/{sequenceDiagram-5NDRBG5M-Bp5DNH0D.js → sequenceDiagram-5NDRBG5M-Cc0GMFmT.js} +1 -1
  77. package/dist/assets/{stateDiagram-v2-FJ4FJNEA-C9g9Ksva.js → stateDiagram-v2-FJ4FJNEA-kZUOgUaG.js} +1 -1
  78. package/dist/assets/{swimlanes-UMQ2AFYF-CiASfEkT.js → swimlanes-UMQ2AFYF-Cc3zY4p-.js} +1 -1
  79. package/dist/assets/swimlanesDiagram-OMPLPG4O-DtDwYrQ2.js +8 -0
  80. package/dist/assets/{timeline-definition-SEUHKTQE-BsyL-kVq.js → timeline-definition-SEUHKTQE-CJQzhcUU.js} +1 -1
  81. package/dist/assets/treeView-D4JQ5SDB-Bw6TRccc.js +1 -0
  82. package/dist/assets/treemap-SAJKECNS-DV1Ic9Gc.js +1 -0
  83. package/dist/assets/{usecaseDiagram-AFA6YXN4-BM1AzHQC.js → usecaseDiagram-AFA6YXN4-BNz1ziZs.js} +1 -1
  84. package/dist/assets/{vennDiagram-NNMJR3RB-DXKn1NQy.js → vennDiagram-NNMJR3RB-BGNM3y1D.js} +1 -1
  85. package/dist/assets/wardley-7MLQ67FV-BMhRQwOU.js +1 -0
  86. package/dist/assets/{wardleyDiagram-S7YFUSEH-V2roKN_V.js → wardleyDiagram-S7YFUSEH-DdgXJ6yj.js} +1 -1
  87. package/dist/assets/{xychartDiagram-GGNKY7IX-BmIvl78f.js → xychartDiagram-GGNKY7IX-CnD9_h1u.js} +1 -1
  88. package/dist/index.html +2 -2
  89. package/docs/ChangeLog.md +12 -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 +2 -2
  94. package/docs/guide/en/v13.2.0.md +72 -0
  95. package/docs/guide/ja/feature-list.md +3 -1
  96. package/docs/guide/ja/features.md +1 -1
  97. package/docs/guide/ja/index.md +2 -2
  98. package/docs/guide/ja/v13.2.0.md +70 -0
  99. package/package.json +1 -1
  100. package/server/backends/library/bounded-lines.ts +31 -0
  101. package/server/backends/library/file-history-read.ts +102 -0
  102. package/server/backends/library/file-history.ts +113 -0
  103. package/server/backends/library/index-queries.ts +8 -0
  104. package/server/backends/library/library-dispatch.ts +5 -1
  105. package/server/backends/library/library-service.ts +18 -1
  106. package/server/backends/library/memory-folders.ts +182 -0
  107. package/server/routes/library-file-routes.ts +73 -0
  108. package/server/routes/library-memory-routes.ts +37 -0
  109. package/server/routes/library-routes.ts +10 -1
  110. package/dist/assets/cynefin-EF2NZ3EQ-aZObWpPL.js +0 -1
  111. package/dist/assets/dist-BQ8H_GDJ.js +0 -2
  112. package/dist/assets/flowDiagram-MALGAFMO-D2mZBOUP.js +0 -1
  113. package/dist/assets/gitGraph-VSP46ZUC-Dcetz1qJ.js +0 -1
  114. package/dist/assets/index-B_J-79Px.css +0 -1
  115. package/dist/assets/info-OHQRW6UA-CDH5k5Wi.js +0 -1
  116. package/dist/assets/packet-JDAUHWVQ-Ci94b3Ro.js +0 -1
  117. package/dist/assets/pie-XZMESJXO-CIcswX9a.js +0 -1
  118. package/dist/assets/radar-ABXABTNO-DJD3JUH6.js +0 -1
  119. package/dist/assets/railroad-I3PHUGI6-DexJ2rg3.js +0 -1
  120. package/dist/assets/swimlanesDiagram-OMPLPG4O-B1AVZXur.js +0 -8
  121. package/dist/assets/treeView-D4JQ5SDB-BDmNnMSW.js +0 -1
  122. package/dist/assets/treemap-SAJKECNS-BvkvOjT4.js +0 -1
  123. package/dist/assets/wardley-7MLQ67FV-BzWTFdnh.js +0 -1
package/README.md CHANGED
@@ -1887,7 +1887,12 @@ narrow and tall for one record you are discussing — and each position keeps it
1887
1887
  date from what is appended; it is `~/.mulmoterminal/library/index.db` and can be deleted at any
1888
1888
  time (it is rebuilt). `marks.json` beside it holds your pins and names and is not rebuilt.
1889
1889
  A conversation's PR numbers open the PR; in the GitHub view, a PR a conversation made has a
1890
- `local_library` button beside it that opens that conversation in the Library. Design: [`docs/library-design.md`](docs/library-design.md).
1890
+ `local_library` button beside it that opens that conversation in the Library. **Changed files**
1891
+ under a conversation lists the files it edited with Claude Code's edit tools, each with a diff of
1892
+ the whole change or of one turn's (read only; read from Claude Code's own file history).
1893
+ **Memory** beside **Conversations** lists Claude Code's auto memory for every project, with how
1894
+ full each `MEMORY.md` is against what Claude Code loads (200 lines / 25,000 bytes); a memory
1895
+ reads as Markdown and its `[[name]]` links open the memory they name (read only for now). Design: [`docs/library-design.md`](docs/library-design.md).
1891
1896
  - **Skills viewer** — **More features** → **Skills** lists every Claude skill on disk in three
1892
1897
  columns — where it lives, its skills, its `SKILL.md`. The places are your `~/.claude/skills`,
1893
1898
  each enabled plugin (skills shown as `plugin:skill`), and the `.claude/skills` of each folder a
@@ -0,0 +1,52 @@
1
+ // The files a conversation changed (#3330), as Claude Code's own file history records them: the
2
+ // files it edited with its edit tools, and a copy of each as it stood before each turn that edited it.
3
+ import { isRecord } from "./isRecord.js";
4
+
5
+ /** One kept state of a file. `exists` is false where the file was not there yet (the turn created it). */
6
+ export interface LibraryFileVersion {
7
+ version: number;
8
+ /** When the copy was taken, ms; null when the record carried no readable time. */
9
+ at: number | null;
10
+ exists: boolean;
11
+ }
12
+
13
+ export interface LibraryTrackedFile {
14
+ /** As the transcript names it: relative to the conversation's directory, or absolute. */
15
+ trackingPath: string;
16
+ /** Where it is on disk, when the record says; null when it cannot be told. */
17
+ path: string | null;
18
+ versions: LibraryFileVersion[];
19
+ }
20
+
21
+ /** One side of a diff. `text` is null when there is nothing to show, and `reason` says why. */
22
+ export interface LibraryFileText {
23
+ text: string | null;
24
+ reason?: "absent" | "too-large" | "binary" | "unreadable";
25
+ }
26
+
27
+ /** The biggest file shown, either side: a diff of more is not read, and the server does not send it. */
28
+ export const LIBRARY_FILE_TEXT_MAX = 1_000_000;
29
+
30
+ /** The version that means "the file as it is now", beside the kept numbered ones. */
31
+ export const NOW_VERSION = "now";
32
+
33
+ const isVersion = (value: unknown): value is LibraryFileVersion =>
34
+ isRecord(value) &&
35
+ typeof value.version === "number" &&
36
+ Number.isInteger(value.version) &&
37
+ (value.at === null || typeof value.at === "number") &&
38
+ typeof value.exists === "boolean";
39
+
40
+ export const isLibraryTrackedFile = (value: unknown): value is LibraryTrackedFile =>
41
+ isRecord(value) &&
42
+ typeof value.trackingPath === "string" &&
43
+ (value.path === null || typeof value.path === "string") &&
44
+ Array.isArray(value.versions) &&
45
+ value.versions.every(isVersion);
46
+
47
+ const REASONS: readonly string[] = ["absent", "too-large", "binary", "unreadable"];
48
+
49
+ export const isLibraryFileText = (value: unknown): value is LibraryFileText =>
50
+ isRecord(value) &&
51
+ (value.text === null || typeof value.text === "string") &&
52
+ (value.reason === undefined || (typeof value.reason === "string" && REASONS.includes(value.reason)));
@@ -0,0 +1,117 @@
1
+ // Claude Code's auto memory as the Library reads it (#3331): each project's `memory/` folder, its
2
+ // `MEMORY.md` index, and the memory files with their frontmatter. Pure.
3
+ import { isRecord } from "./isRecord.js";
4
+
5
+ /** How much of `MEMORY.md` Claude Code loads, as its own source has it (2.1.292: 200 lines, 25,000
6
+ * bytes). Past either, the rest of the index is not in the agent's context. */
7
+ export const MEMORY_INDEX_LINES_MAX = 200;
8
+ export const MEMORY_INDEX_BYTES_MAX = 25_000;
9
+ /** The index's own name in a memory folder. */
10
+ export const MEMORY_INDEX_FILE = "MEMORY.md";
11
+
12
+ /** The folder Claude Code keeps a directory's data under: every character outside `[A-Za-z0-9_-]`
13
+ * becomes `-` (its own rule, so a directory is matched to its memory without guessing). */
14
+ export const projectSlug = (cwd: string): string => cwd.replace(/[^a-zA-Z0-9\-_]/g, "-") || "unknown";
15
+
16
+ export interface LibraryMemoryFile {
17
+ /** The file's name in the folder. */
18
+ file: string;
19
+ /** The frontmatter `name`, or null when it has none. */
20
+ name: string | null;
21
+ description: string | null;
22
+ /** `metadata.type` (user, feedback, project, reference), or null. */
23
+ type: string | null;
24
+ updatedAt: number;
25
+ }
26
+
27
+ export interface LibraryMemoryProject {
28
+ slug: string;
29
+ /** The directory the folder belongs to, when a conversation there tells it; else null. */
30
+ cwd: string | null;
31
+ /** The index's size against what is loaded; null when the folder has no index. */
32
+ index: { lines: number; bytes: number } | null;
33
+ files: LibraryMemoryFile[];
34
+ }
35
+
36
+ export interface MemoryFrontmatter {
37
+ /** Top-level `key: value` lines, quotes taken off. */
38
+ fields: Record<string, string>;
39
+ /** The `metadata:` block's `key: value` lines. */
40
+ metadata: Record<string, string>;
41
+ body: string;
42
+ }
43
+
44
+ const unquote = (value: string): string => {
45
+ const trimmed = value.trim();
46
+ if (trimmed.length >= 2 && trimmed.startsWith('"') && trimmed.endsWith('"')) {
47
+ try {
48
+ const parsed: unknown = JSON.parse(trimmed);
49
+ return typeof parsed === "string" ? parsed : trimmed;
50
+ } catch {
51
+ return trimmed.slice(1, -1);
52
+ }
53
+ }
54
+ return trimmed.length >= 2 && trimmed.startsWith("'") && trimmed.endsWith("'") ? trimmed.slice(1, -1).replaceAll("''", "'") : trimmed;
55
+ };
56
+
57
+ const KEY_VALUE = /^([A-Za-z_][\w-]*):(.*)$/;
58
+
59
+ /** The frontmatter between the opening `---` and the next one, as the memory files write it: flat
60
+ * keys and one `metadata:` block indented under them. No frontmatter: all of it is body. */
61
+ /** The text as the frontmatter rules read it: no byte-order mark (some Windows editors write one, and
62
+ * it would hide the opening `---`), and `\n` line ends. */
63
+ const normalizedMemory = (text: string): string => text.replace(/^\uFEFF/, "").replace(/\r\n/g, "\n");
64
+
65
+ /** Where the closing delimiter starts, or -1: a line of exactly `---` (a `---draft` line inside is not
66
+ * one), at the end of the text or followed by a newline. -1 too when there is no opening line. */
67
+ function frontmatterEnd(normalized: string): number {
68
+ const close = normalized.startsWith("---\n") ? /\n---(?:\n|$)/.exec(normalized.slice(3)) : null;
69
+ return close === null ? -1 : close.index + 3;
70
+ }
71
+
72
+ /** Whether a frontmatter opens and has not closed yet — what a reader of a file's head asks to know
73
+ * whether to read on. */
74
+ export function frontmatterStillOpen(text: string): boolean {
75
+ const normalized = normalizedMemory(text);
76
+ return normalized.startsWith("---\n") && frontmatterEnd(normalized) === -1;
77
+ }
78
+
79
+ export function parseMemoryFrontmatter(text: string): MemoryFrontmatter {
80
+ const normalized = normalizedMemory(text);
81
+ const end = frontmatterEnd(normalized);
82
+ if (end === -1) return { fields: {}, metadata: {}, body: text };
83
+ const fields: Record<string, string> = {};
84
+ const metadata: Record<string, string> = {};
85
+ let inMetadata = false;
86
+ normalized
87
+ .slice(4, end)
88
+ .split("\n")
89
+ .forEach((line) => {
90
+ const nested = /^\s+/.test(line);
91
+ const match = KEY_VALUE.exec(line.trim());
92
+ if (!match) return;
93
+ const [, key = "", value = ""] = match;
94
+ if (!nested) inMetadata = key === "metadata" && value.trim() === "";
95
+ if (nested && inMetadata) metadata[key] = unquote(value);
96
+ else if (!nested && !inMetadata) fields[key] = unquote(value);
97
+ });
98
+ return { fields, metadata, body: normalized.slice(end + 5) };
99
+ }
100
+
101
+ const isNullableString = (value: unknown): boolean => value === null || typeof value === "string";
102
+
103
+ const isMemoryFile = (value: unknown): value is LibraryMemoryFile =>
104
+ isRecord(value) &&
105
+ typeof value.file === "string" &&
106
+ isNullableString(value.name) &&
107
+ isNullableString(value.description) &&
108
+ isNullableString(value.type) &&
109
+ typeof value.updatedAt === "number";
110
+
111
+ export const isLibraryMemoryProject = (value: unknown): value is LibraryMemoryProject =>
112
+ isRecord(value) &&
113
+ typeof value.slug === "string" &&
114
+ isNullableString(value.cwd) &&
115
+ (value.index === null || (isRecord(value.index) && typeof value.index.lines === "number" && typeof value.index.bytes === "number")) &&
116
+ Array.isArray(value.files) &&
117
+ value.files.every(isMemoryFile);
@@ -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-CpS9q9L6.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-2biruWQx.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-TzFAtZ_w.js";import{t as r}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-boy8dqNh.js";import"./chunk-BG4553SI-DEs9CcBd.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-D0v0F3kZ.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-WRzw8fSZ.js";import{t as r}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-DII2m8Jh.js";import"./chunk-BG4553SI-CrlLpYyS.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-DCy09sdt.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-D0v0F3kZ.js";import"./chunk-NGNAAXSQ-DI_UYJZ4.js";
1
+ export{M as createArchitectureServices}from"./mermaid-parser.core-DCy09sdt.js";import"./chunk-NGNAAXSQ-DI_UYJZ4.js";