mulmoterminal 13.0.0 → 13.1.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 (158) hide show
  1. package/README.md +21 -0
  2. package/common/library.ts +166 -0
  3. package/common/repoEntry.ts +7 -0
  4. package/dist/assets/{Notation-CypJd7OM-pkbcJly3.js → Notation-CypJd7OM-BO9f8_wn.js} +1 -1
  5. package/dist/assets/{abnfDiagram-S7VZAUFO-DBlb1Nox.js → abnfDiagram-S7VZAUFO-DX7MYQNO.js} +1 -1
  6. package/dist/assets/{architecture-WOLXFQ4H-DIFqKSk-.js → architecture-WOLXFQ4H-Er33vMDl.js} +1 -1
  7. package/dist/assets/{architectureDiagram-YGSQEFNW-rKhAytLE.js → architectureDiagram-YGSQEFNW-RuFs4K8r.js} +1 -1
  8. package/dist/assets/{blockDiagram-APKKGZFW-Uh4wHTps.js → blockDiagram-APKKGZFW-CEakdgi0.js} +1 -1
  9. package/dist/assets/{c4Diagram-KJ2TOQU5-l2R9FN0_.js → c4Diagram-KJ2TOQU5-DkZTuzXy.js} +1 -1
  10. package/dist/assets/{chunk-6MUBBAK2-D3cV4tq0.js → chunk-6MUBBAK2-4Psl-rVs.js} +1 -1
  11. package/dist/assets/{chunk-AXFCVDMN-CS91A48H.js → chunk-AXFCVDMN-_THBcA3m.js} +1 -1
  12. package/dist/assets/{chunk-BG4553SI-CqnaDepj.js → chunk-BG4553SI-DEs9CcBd.js} +1 -1
  13. package/dist/assets/{chunk-DQASFODM-BvbU2BJR.js → chunk-DQASFODM-BjPZd1vg.js} +1 -1
  14. package/dist/assets/{chunk-HFQBQIA3-B-jT4Hk1.js → chunk-HFQBQIA3-Cn50fJjU.js} +1 -1
  15. package/dist/assets/{chunk-KQLB2F66-of-ThZIT.js → chunk-KQLB2F66-CxKJ5VW6.js} +1 -1
  16. package/dist/assets/{chunk-KS47KZWR-CtA7kQxW.js → chunk-KS47KZWR-B1n-ARyf.js} +1 -1
  17. package/dist/assets/{chunk-LEVMRMFU-Dvh_M_kH.js → chunk-LEVMRMFU-BCKhEfOJ.js} +1 -1
  18. package/dist/assets/{chunk-M57EVK23-DV2qHg72.js → chunk-M57EVK23-C2IbA_qJ.js} +1 -1
  19. package/dist/assets/{chunk-OY52VR5R-CqhircLU.js → chunk-OY52VR5R-TzFAtZ_w.js} +1 -1
  20. package/dist/assets/{chunk-QB3YPZ4I-B5z_n75L.js → chunk-QB3YPZ4I-CqcBmlgs.js} +1 -1
  21. package/dist/assets/{chunk-R3KSYZAL-Br8r988E.js → chunk-R3KSYZAL-sapT-duB.js} +1 -1
  22. package/dist/assets/{chunk-STOXU5M4-BI7HZETK.js → chunk-STOXU5M4-BNotEa29.js} +1 -1
  23. package/dist/assets/{chunk-TU62E6Q5-DOPGbSff.js → chunk-TU62E6Q5-BZhyxJkb.js} +1 -1
  24. package/dist/assets/{chunk-X4PVCEUW-C5xkuruX.js → chunk-X4PVCEUW-CNQ-Xvdz.js} +1 -1
  25. package/dist/assets/{classDiagram-v2-L25IHNXF-DaONIRVP.js → classDiagram-v2-L25IHNXF-BKLfGW9P.js} +1 -1
  26. package/dist/assets/cynefin-EF2NZ3EQ-aZObWpPL.js +1 -0
  27. package/dist/assets/{cynefinDiagram-L36ESFBY-CEVxFRDq.js → cynefinDiagram-L36ESFBY-DCZOgs8X.js} +1 -1
  28. package/dist/assets/{dagre-SPEB5RXH-odDoDXjK.js → dagre-SPEB5RXH-Dy0BJIEm.js} +1 -1
  29. package/dist/assets/{diagram-3B7GL73J-DLfqoIVM.js → diagram-3B7GL73J-S6ZhiU2d.js} +1 -1
  30. package/dist/assets/{diagram-DNEMPZML-Ct8neJrj.js → diagram-DNEMPZML-CUmg80Qc.js} +1 -1
  31. package/dist/assets/{diagram-L3MUGCDN-D6WW00FN.js → diagram-L3MUGCDN-cPBBA4WI.js} +1 -1
  32. package/dist/assets/{diagram-LA4NIPWU-B-ZxMEXb.js → diagram-LA4NIPWU-CPCpe3xv.js} +1 -1
  33. package/dist/assets/{diagram-MHCOC4E2-B6BloYzr.js → diagram-MHCOC4E2-Dw5Ffvbi.js} +1 -1
  34. package/dist/assets/{diagram-XPFHEONP-DafQESxK.js → diagram-XPFHEONP-Cc0-H1nc.js} +1 -1
  35. package/dist/assets/dist-BQ8H_GDJ.js +2 -0
  36. package/dist/assets/{dist-CiQjNb2C.js → dist-BhGUK0iZ.js} +1 -1
  37. package/dist/assets/{dist-C-QjIW1m.js → dist-BsVzXb6G.js} +1 -1
  38. package/dist/assets/{dist-CI2ANgsl.js → dist-DL_hxD1T.js} +1 -1
  39. package/dist/assets/{dist-BYVnV4YS.js → dist-DRN9-QtG.js} +1 -1
  40. package/dist/assets/{dist-BSBaWDHE.js → dist-DvRaBDyS.js} +1 -1
  41. package/dist/assets/{ebnfDiagram-UZSYDL2S-FYrQVmMi.js → ebnfDiagram-UZSYDL2S-m4wkQjZ7.js} +1 -1
  42. package/dist/assets/{echarts-gl-Dxw4tLc8.js → echarts-gl-C-Tb2Yv4.js} +1 -1
  43. package/dist/assets/{elk-XV6XMXQE-DGcxOyYW.js → elk-XV6XMXQE-_TQxmAcx.js} +1 -1
  44. package/dist/assets/{emscripten-module-Q67P5WYC-B-Sk0b8X.js → emscripten-module-Q67P5WYC-DkK5EL_r.js} +1 -1
  45. package/dist/assets/{erDiagram-EYBAPDEH-i3Je_W4f.js → erDiagram-EYBAPDEH-DzcKEmuK.js} +1 -1
  46. package/dist/assets/{eventmodeling-K75KTNOO-DuQyxIlQ.js → eventmodeling-K75KTNOO-C6a_Sq-9.js} +1 -1
  47. package/dist/assets/flowDiagram-MALGAFMO-D2mZBOUP.js +1 -0
  48. package/dist/assets/{ganttDiagram-23REXITY-CKFGO6Hd.js → ganttDiagram-23REXITY-BL9fHj3z.js} +1 -1
  49. package/dist/assets/gitGraph-VSP46ZUC-Dcetz1qJ.js +1 -0
  50. package/dist/assets/{gitGraphDiagram-STJD7YCW-nH19iIXf.js → gitGraphDiagram-STJD7YCW-Dspf-kdw.js} +1 -1
  51. package/dist/assets/index-B_J-79Px.css +1 -0
  52. package/dist/assets/{index-CVWvCw8Y.js → index-CpS9q9L6.js} +622 -620
  53. package/dist/assets/info-OHQRW6UA-CDH5k5Wi.js +1 -0
  54. package/dist/assets/{infoDiagram-KBXO4MBG-BUFEBdgw.js → infoDiagram-KBXO4MBG-BBUCSKcc.js} +1 -1
  55. package/dist/assets/{ishikawaDiagram-M35NCXHK-CuEfX9ei.js → ishikawaDiagram-M35NCXHK-CR5AxlN-.js} +1 -1
  56. package/dist/assets/{journeyDiagram-OPLOXDXO-S6n87Tzl.js → journeyDiagram-OPLOXDXO-DcFWQOr3.js} +1 -1
  57. package/dist/assets/{kanban-definition-BZKZHSQY-Bxr9AZDN.js → kanban-definition-BZKZHSQY-D14qopgX.js} +1 -1
  58. package/dist/assets/{line-CMQ-ALY6.js → line-CtLI_lsS.js} +1 -1
  59. package/dist/assets/{manifold-C78YWcrd.js → manifold-BSMczo8C.js} +1 -1
  60. package/dist/assets/{mermaid-parser.core-DNUBFfdd.js → mermaid-parser.core-D0v0F3kZ.js} +3 -3
  61. package/dist/assets/{mermaid.core-iwKGIwht.js → mermaid.core-boy8dqNh.js} +4 -4
  62. package/dist/assets/{mindmap-definition-I2QAS2VK-BHWdqvWe.js → mindmap-definition-I2QAS2VK-DYbE3HR8.js} +1 -1
  63. package/dist/assets/packet-JDAUHWVQ-Ci94b3Ro.js +1 -0
  64. package/dist/assets/{pegDiagram-FD4XPPHP-CNRH_6cs.js → pegDiagram-FD4XPPHP-DO9kTbo4.js} +1 -1
  65. package/dist/assets/pie-XZMESJXO-CIcswX9a.js +1 -0
  66. package/dist/assets/{pieDiagram-J4AKIIQI-7rewZ6yW.js → pieDiagram-J4AKIIQI-DWIgbOK_.js} +1 -1
  67. package/dist/assets/{quadrantDiagram-XTYBLID2-Bi5svJW6.js → quadrantDiagram-XTYBLID2-I-htxFyw.js} +1 -1
  68. package/dist/assets/radar-ABXABTNO-DJD3JUH6.js +1 -0
  69. package/dist/assets/railroad-I3PHUGI6-DexJ2rg3.js +1 -0
  70. package/dist/assets/{railroad-abnf-LNEFI6M7-DjNxn3v0.js → railroad-abnf-LNEFI6M7-B8YpE0yt.js} +1 -1
  71. package/dist/assets/{railroad-ebnf-DWYD2UWJ-DdoROrjx.js → railroad-ebnf-DWYD2UWJ-BTP-Py1A.js} +1 -1
  72. package/dist/assets/{railroad-peg-JR7BVNR7-BxyrzS1q.js → railroad-peg-JR7BVNR7-C7E3Pvj8.js} +1 -1
  73. package/dist/assets/{railroadDiagram-MRQ6NCDL-CmgbIsC5.js → railroadDiagram-MRQ6NCDL-Iwurnw7-.js} +1 -1
  74. package/dist/assets/{requirementDiagram-Y7LWUY3S-CtkXE6Kj.js → requirementDiagram-Y7LWUY3S-Bm7y1HTz.js} +1 -1
  75. package/dist/assets/{sankeyDiagram-WGJFYUXA-BXC84-xg.js → sankeyDiagram-WGJFYUXA-2as2DzX_.js} +1 -1
  76. package/dist/assets/{sequenceDiagram-5NDRBG5M-CC-X4V9R.js → sequenceDiagram-5NDRBG5M-Bp5DNH0D.js} +1 -1
  77. package/dist/assets/{stateDiagram-v2-FJ4FJNEA-B7fa-kKQ.js → stateDiagram-v2-FJ4FJNEA-C9g9Ksva.js} +1 -1
  78. package/dist/assets/{swimlanes-UMQ2AFYF-sbr7SO2Q.js → swimlanes-UMQ2AFYF-CiASfEkT.js} +1 -1
  79. package/dist/assets/swimlanesDiagram-OMPLPG4O-B1AVZXur.js +8 -0
  80. package/dist/assets/{timeline-definition-SEUHKTQE-Cm8m2u66.js → timeline-definition-SEUHKTQE-BsyL-kVq.js} +1 -1
  81. package/dist/assets/treeView-D4JQ5SDB-BDmNnMSW.js +1 -0
  82. package/dist/assets/treemap-SAJKECNS-BvkvOjT4.js +1 -0
  83. package/dist/assets/{usecaseDiagram-AFA6YXN4-B7xukskQ.js → usecaseDiagram-AFA6YXN4-BM1AzHQC.js} +1 -1
  84. package/dist/assets/{vennDiagram-NNMJR3RB-CaeaGSTj.js → vennDiagram-NNMJR3RB-DXKn1NQy.js} +1 -1
  85. package/dist/assets/wardley-7MLQ67FV-BzWTFdnh.js +1 -0
  86. package/dist/assets/{wardleyDiagram-S7YFUSEH-Mm_9l7zd.js → wardleyDiagram-S7YFUSEH-V2roKN_V.js} +1 -1
  87. package/dist/assets/{xychartDiagram-GGNKY7IX-CIT2pkTe.js → xychartDiagram-GGNKY7IX-BmIvl78f.js} +1 -1
  88. package/dist/index.html +2 -2
  89. package/docs/ChangeLog.md +35 -0
  90. package/docs/facts.json +1 -1
  91. package/docs/guide/en/faq.md +11 -0
  92. package/docs/guide/en/feature-list.md +5 -1
  93. package/docs/guide/en/features.md +1 -0
  94. package/docs/guide/en/index.md +2 -2
  95. package/docs/guide/en/v13.1.0.md +111 -0
  96. package/docs/guide/ja/faq.md +11 -0
  97. package/docs/guide/ja/feature-list.md +5 -1
  98. package/docs/guide/ja/features.md +1 -0
  99. package/docs/guide/ja/index.md +2 -2
  100. package/docs/guide/ja/v13.1.0.md +108 -0
  101. package/package.json +17 -17
  102. package/server/agents/claude/config-project-key.spec.ts +29 -0
  103. package/server/agents/claude/config-project-key.ts +9 -0
  104. package/server/agents/claude/own-folder-trust.ts +3 -2
  105. package/server/agents/rate-limit/rate-limit-service.spec.ts +2 -1
  106. package/server/backends/library/conversation-fold.ts +168 -0
  107. package/server/backends/library/history-fold.ts +21 -0
  108. package/server/backends/library/index-queries.ts +155 -0
  109. package/server/backends/library/index-store.ts +329 -0
  110. package/server/backends/library/indexer.ts +145 -0
  111. package/server/backends/library/library-client.ts +97 -0
  112. package/server/backends/library/library-dispatch.ts +49 -0
  113. package/server/backends/library/library-index.ts +88 -0
  114. package/server/backends/library/library-marks.ts +154 -0
  115. package/server/backends/library/library-search.ts +49 -0
  116. package/server/backends/library/library-service.ts +64 -0
  117. package/server/backends/library/library-text.ts +19 -0
  118. package/server/backends/library/library-worker.ts +36 -0
  119. package/server/backends/library/opened-file.ts +45 -0
  120. package/server/backends/library/resume-plan.ts +41 -0
  121. package/server/backends/library/scan-batches.ts +72 -0
  122. package/server/backends/library/temporary-path.ts +29 -0
  123. package/server/backends/library/transcript-files.ts +51 -0
  124. package/server/backends/remoteHost/hostSessionList.ts +8 -4
  125. package/server/config/header/header-title.ts +2 -4
  126. package/server/routes/app-routes.ts +2 -0
  127. package/server/routes/hook-routes.ts +69 -28
  128. package/server/routes/library-routes.ts +145 -0
  129. package/server/routes/session-routes.ts +19 -6
  130. package/server/routes/ws-routes.ts +4 -2
  131. package/server/session/activity/header-hook.ts +1 -7
  132. package/server/session/activity/task-push.ts +12 -11
  133. package/server/session/drops-trust.spec.ts +3 -1
  134. package/server/session/lifecycle.ts +8 -8
  135. package/server/session/list/session-detail-view.ts +2 -2
  136. package/server/session/list/session-resolve.ts +20 -13
  137. package/server/session/list/session-title.ts +20 -16
  138. package/server/session/registry.ts +2 -3
  139. package/server/session/session-reads.ts +6 -6
  140. package/server/session/transcript/cleared-transcripts.ts +77 -47
  141. package/server/session/transcript/conversation-move.ts +39 -0
  142. package/server/session/transcript/current-transcript.ts +18 -0
  143. package/server/session/transcript/mark-prune.ts +19 -0
  144. package/server/session/transcript/transcript-view-read.ts +8 -9
  145. package/dist/assets/cynefin-EF2NZ3EQ-BbSH20Oy.js +0 -1
  146. package/dist/assets/dist-BKENFDRp.js +0 -2
  147. package/dist/assets/flowDiagram-MALGAFMO-DGHoD_nW.js +0 -1
  148. package/dist/assets/gitGraph-VSP46ZUC-D-FrFpz7.js +0 -1
  149. package/dist/assets/index-G3i5t9Y_.css +0 -1
  150. package/dist/assets/info-OHQRW6UA-BM5arluP.js +0 -1
  151. package/dist/assets/packet-JDAUHWVQ-DaulIJfg.js +0 -1
  152. package/dist/assets/pie-XZMESJXO-8Hujaacy.js +0 -1
  153. package/dist/assets/radar-ABXABTNO-v4UMxTyv.js +0 -1
  154. package/dist/assets/railroad-I3PHUGI6-Q9azc_XK.js +0 -1
  155. package/dist/assets/swimlanesDiagram-OMPLPG4O-xs2WKQuP.js +0 -8
  156. package/dist/assets/treeView-D4JQ5SDB-DLx1rhJ8.js +0 -1
  157. package/dist/assets/treemap-SAJKECNS-BMg8FpT_.js +0 -1
  158. package/dist/assets/wardley-7MLQ67FV-B8Pr6tjo.js +0 -1
package/README.md CHANGED
@@ -852,6 +852,15 @@ The one exception is the **managed** workspace named by `MULMOCLAUDE_WORKSPACE_P
852
852
  (`~/mulmoclaude` by default), where that state stays in the workspace — MulmoClaude reads the
853
853
  same files there, and splitting them would give the two apps different answers.
854
854
 
855
+ **Run one version per home.** Every server started with the same `HOME` shares `~/.mulmoterminal`,
856
+ including the record of which sessions a `/clear` or an in-session `/resume` moved to another
857
+ conversation (`cleared-transcripts/`). A release from before #3340 deletes that record whenever it
858
+ ends a session, so a newer server sharing the home then reopens the conversation the cell had left
859
+ (#3325, #3348). Running two versions side by side — an `npx mulmoterminal@<older>` next to a checkout,
860
+ say — is therefore not supported; give one of them its own `HOME` (it then gets its own tmux server
861
+ too). Rolling back to an older release brings back that release's behaviour and damages nothing on
862
+ disk.
863
+
855
864
  If you ran an older version in a project directory, what it left behind is inert and nothing
856
865
  recreates it — but delete the generated files, **not** the whole directory:
857
866
  `config/scheduler/state.json`, `data/scheduler/`, `data/notifier/`. Leave
@@ -1867,6 +1876,18 @@ narrow and tall for one record you are discussing — and each position keeps it
1867
1876
 
1868
1877
  ## More features
1869
1878
 
1879
+ - **Library** — **More features** → **Library** (or a Claude cell's **History** menu → **Open in Library**, which opens on that conversation) lists every Claude conversation on this machine,
1880
+ newest first, across all projects: its title, then the project, branch, PRs and when. Type to
1881
+ search the conversations' text and titles (Japanese included); pick one to read it, and press
1882
+ **Resume** (or `Enter`) to open it in a terminal in the directory it ran in. `/` focuses the
1883
+ search, the arrow keys move. The **⋯** menu pins a conversation to the top of the list or renames
1884
+ it; pins and names are MulmoTerminal's own (`~/.mulmoterminal/library/marks.json`) and the
1885
+ conversation's file is never written. `claude -p` and SDK runs, and runs from temp directories, are left
1886
+ out. The index behind it is built in the background the first time you open it and kept up to
1887
+ date from what is appended; it is `~/.mulmoterminal/library/index.db` and can be deleted at any
1888
+ time (it is rebuilt). `marks.json` beside it holds your pins and names and is not rebuilt.
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).
1870
1891
  - **Skills viewer** — **More features** → **Skills** lists every Claude skill on disk in three
1871
1892
  columns — where it lives, its skills, its `SKILL.md`. The places are your `~/.claude/skills`,
1872
1893
  each enabled plugin (skills shown as `plugin:skill`), and the `.claude/skills` of each folder a
@@ -0,0 +1,166 @@
1
+ // The Library's index over the wire (#3328). The shape is the same for every agent; only claude
2
+ // is indexed so far, which is why `agent` is a column rather than an assumption.
3
+ import { isRecord } from "./isRecord.js";
4
+ import { TERMINAL_AGENTS, type TerminalAgent } from "./sessionAgent.js";
5
+
6
+ export interface LibraryPrLink {
7
+ number: number;
8
+ url: string;
9
+ repository: string;
10
+ }
11
+
12
+ export interface LibraryConversation {
13
+ /** The session id, which is the transcript's file name. A subagent's is its own file name. */
14
+ id: string;
15
+ agent: TerminalAgent;
16
+ /** `/rename`, else the agent's own title, else the first prompt. Null for a conversation with none. */
17
+ title: string | null;
18
+ cwd: string | null;
19
+ gitBranch: string | null;
20
+ prs: LibraryPrLink[];
21
+ /** From the last cost record. Null — never 0 — when the agent wrote none. */
22
+ costUsd: number | null;
23
+ linesAdded: number | null;
24
+ linesRemoved: number | null;
25
+ /** Epoch milliseconds. */
26
+ startedAt: number | null;
27
+ endedAt: number | null;
28
+ skills: string[];
29
+ hookErrors: number;
30
+ userTurns: number;
31
+ isSidechain: boolean;
32
+ /** The conversation a subagent ran under. */
33
+ parentId: string | null;
34
+ /** Run from under the OS temp directory: kept for the storage view, left out of search. */
35
+ isTemporary: boolean;
36
+ /** How the agent was started, as it recorded it: `cli` for an interactive session, `claude-desktop`
37
+ * for the desktop app, `sdk-cli` for `claude -p` and the SDK. Null when it recorded none. */
38
+ entrypoint: string | null;
39
+ }
40
+
41
+ /** The entrypoint of a run nobody typed into — `claude -p` and the SDK. On a working machine these
42
+ * are most of the transcripts (hooks and tools call claude), so lists leave them out by default. */
43
+ export const AUTOMATED_ENTRYPOINT = "sdk-cli";
44
+
45
+ export const LIBRARY_TURN_ROLES = ["user", "assistant", "prompt"] as const;
46
+ /** `prompt` is a line of the agent's own prompt history, which holds prompts its transcript lacks. */
47
+ export type LibraryTurnRole = (typeof LIBRARY_TURN_ROLES)[number];
48
+
49
+ export interface LibrarySearchHit {
50
+ conversation: LibraryConversation;
51
+ /** Null when only the title matched. */
52
+ snippet: string | null;
53
+ role: LibraryTurnRole | null;
54
+ }
55
+
56
+ export interface LibraryIndexStatus {
57
+ indexing: boolean;
58
+ filesDone: number;
59
+ filesTotal: number;
60
+ /** Epoch milliseconds of the last complete pass, by any process sharing this index. */
61
+ finishedAt: number | null;
62
+ }
63
+
64
+ export interface LibraryConversationPage {
65
+ conversations: LibraryConversation[];
66
+ /** One was found past the page — a fact, not an inference from a full page. */
67
+ hasMore: boolean;
68
+ /** When the index pass this page reflects finished, or null when none had yet. A client compares it
69
+ * with the status's `finishedAt` to know its list is behind, without trusting its own clock. */
70
+ indexFinishedAt: number | null;
71
+ }
72
+
73
+ // ---- reading the wire back --------------------------------------------------------------------
74
+
75
+ const nullableString = (value: unknown): boolean => value === null || typeof value === "string";
76
+ const nullableNumber = (value: unknown): boolean => value === null || typeof value === "number";
77
+
78
+ const isPrLink = (value: unknown): value is LibraryPrLink =>
79
+ isRecord(value) && typeof value.number === "number" && typeof value.url === "string" && typeof value.repository === "string";
80
+
81
+ export function isLibraryConversation(value: unknown): value is LibraryConversation {
82
+ if (!isRecord(value)) return false;
83
+ const v = value;
84
+ return (
85
+ typeof v.id === "string" &&
86
+ TERMINAL_AGENTS.some((agent) => agent === v.agent) &&
87
+ ["title", "cwd", "gitBranch", "parentId", "entrypoint"].every((key) => nullableString(v[key])) &&
88
+ ["costUsd", "linesAdded", "linesRemoved", "startedAt", "endedAt"].every((key) => nullableNumber(v[key])) &&
89
+ Array.isArray(v.prs) &&
90
+ v.prs.every(isPrLink) &&
91
+ Array.isArray(v.skills) &&
92
+ v.skills.every((skill) => typeof skill === "string") &&
93
+ typeof v.hookErrors === "number" &&
94
+ typeof v.userTurns === "number" &&
95
+ typeof v.isSidechain === "boolean" &&
96
+ typeof v.isTemporary === "boolean"
97
+ );
98
+ }
99
+
100
+ export const isLibrarySearchHit = (value: unknown): value is LibrarySearchHit =>
101
+ isRecord(value) &&
102
+ isLibraryConversation(value.conversation) &&
103
+ nullableString(value.snippet) &&
104
+ (value.role === null || LIBRARY_TURN_ROLES.some((role) => role === value.role));
105
+
106
+ export const isLibraryIndexStatus = (value: unknown): value is LibraryIndexStatus =>
107
+ isRecord(value) &&
108
+ typeof value.indexing === "boolean" &&
109
+ typeof value.filesDone === "number" &&
110
+ typeof value.filesTotal === "number" &&
111
+ nullableNumber(value.finishedAt);
112
+
113
+ // ---- what the user marks on a conversation ------------------------------------------------------
114
+
115
+ /** A name the user gave, kept to one line of a list. */
116
+ export const LIBRARY_NAME_MAX = 200;
117
+
118
+ /** Pins and names, by session id. MulmoTerminal's own record: the agent's transcript is never written. */
119
+ export interface LibraryMarks {
120
+ /** Newest pin first. */
121
+ pinned: string[];
122
+ names: Record<string, string>;
123
+ }
124
+
125
+ export const emptyLibraryMarks = (): LibraryMarks => ({ pinned: [], names: {} });
126
+
127
+ // One line, as every write leaves it: a name with a line break was not written by this code.
128
+ const isMarkName = (name: unknown): boolean => typeof name === "string" && name.trim() !== "" && name.length <= LIBRARY_NAME_MAX && !/[\r\n]/.test(name);
129
+
130
+ /** The shape this code writes and nothing looser: a file edited by hand into something else is
131
+ * refused, not read and then written back. */
132
+ export const isLibraryMarks = (value: unknown): value is LibraryMarks =>
133
+ isRecord(value) &&
134
+ Object.keys(value).every((key) => key === "pinned" || key === "names") &&
135
+ Array.isArray(value.pinned) &&
136
+ value.pinned.every((id) => typeof id === "string" && id !== "") &&
137
+ new Set(value.pinned).size === value.pinned.length &&
138
+ isRecord(value.names) &&
139
+ Object.keys(value.names).every((id) => id !== "") &&
140
+ Object.values(value.names).every(isMarkName);
141
+
142
+ /** One change to one conversation's marks; a field left out is left as it is. */
143
+ export interface LibraryMarkChange {
144
+ pinned?: boolean;
145
+ /** Null or blank clears the name. */
146
+ name?: string | null;
147
+ }
148
+
149
+ /** A pull request and the conversation that made it: the one that recorded it and began first. */
150
+ export interface LibraryPrCreator {
151
+ number: number;
152
+ conversation: LibraryConversation;
153
+ }
154
+
155
+ export const isLibraryPrCreator = (value: unknown): value is LibraryPrCreator =>
156
+ isRecord(value) && typeof value.number === "number" && Number.isInteger(value.number) && isLibraryConversation(value.conversation);
157
+
158
+ /** How many PR numbers one lookup may ask about: more than the GitHub view lists for a repository. */
159
+ export const PR_CREATORS_MAX = 200;
160
+
161
+ /** `owner/repo` as GitHub spells one. Neither half is all dots, which GitHub does not allow either; a
162
+ * host-qualified name (`gitlab.com/group/project`) is not one, and pr-link records are GitHub's. */
163
+ export const isRepositoryName = (value: string): boolean => {
164
+ const halves = value.split("/");
165
+ return halves.length === 2 && halves.every((half) => /^[A-Za-z0-9_.-]{1,100}$/.test(half) && !/^\.+$/.test(half));
166
+ };
@@ -45,6 +45,13 @@ export function parseRepoEntry(entry: string): RepoEntry | null {
45
45
  */
46
46
  export const canonicalRepo = (entry: string): string => parseRepoEntry(entry)?.path.join("/") ?? entry.trim();
47
47
 
48
+ /** `owner/repo` for an entry on GitHub, spelled with its host or without; null for any other forge
49
+ * or shape. What a GitHub record (a transcript's PR link) names the repository by. */
50
+ export function githubRepoName(entry: string): string | null {
51
+ const parsed = parseRepoEntry(entry);
52
+ return parsed !== null && parsed.host === GITHUB_HOST && parsed.path.length === NAMESPACED ? parsed.path.join("/") : null;
53
+ }
54
+
48
55
  /** The identity used to MATCH a configured entry against a resolved clone: always host-qualified.
49
56
  *
50
57
  * Distinct from `canonicalRepo`, which strips the host because that is what a CLI's `--repo`
@@ -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-CVWvCw8Y.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-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};
@@ -1 +1 @@
1
- import{n as e,r as t,t as n}from"./chunk-OY52VR5R-CqhircLU.js";import{t as r}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-iwKGIwht.js";import"./chunk-BG4553SI-CqnaDepj.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-DNUBFfdd.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-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 +1 @@
1
- export{M as createArchitectureServices}from"./mermaid-parser.core-DNUBFfdd.js";import"./chunk-NGNAAXSQ-DI_UYJZ4.js";
1
+ export{M as createArchitectureServices}from"./mermaid-parser.core-D0v0F3kZ.js";import"./chunk-NGNAAXSQ-DI_UYJZ4.js";