mulmoterminal 13.1.0 → 13.3.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.
- package/README.md +47 -4
- package/common/bundledSkills.ts +1 -0
- package/common/ghItems.ts +4 -0
- package/common/githubBoard.ts +9 -0
- package/common/libraryFiles.ts +52 -0
- package/common/libraryMemory.ts +191 -0
- package/common/libraryPromote.ts +25 -0
- package/common/libraryRepeats.ts +86 -0
- package/common/libraryRetrospective.ts +36 -0
- package/common/librarySettings.ts +61 -0
- package/common/libraryStorage.ts +105 -0
- package/common/libraryTools.ts +52 -0
- package/common/ptyOpenedChannel.ts +18 -0
- package/common/trimEndOf.ts +8 -0
- package/dist/assets/{Notation-CypJd7OM-BO9f8_wn.js → Notation-CypJd7OM-D4oJLFIP.js} +1 -1
- package/dist/assets/{abnfDiagram-S7VZAUFO-DX7MYQNO.js → abnfDiagram-S7VZAUFO-BMcgYOG2.js} +1 -1
- package/dist/assets/{architecture-WOLXFQ4H-Er33vMDl.js → architecture-WOLXFQ4H-CqhsvxLg.js} +1 -1
- package/dist/assets/{architectureDiagram-YGSQEFNW-RuFs4K8r.js → architectureDiagram-YGSQEFNW-DsijgzL1.js} +1 -1
- package/dist/assets/{blockDiagram-APKKGZFW-CEakdgi0.js → blockDiagram-APKKGZFW-erx3F2wt.js} +1 -1
- package/dist/assets/{c4Diagram-KJ2TOQU5-DkZTuzXy.js → c4Diagram-KJ2TOQU5-Dr5IktyG.js} +1 -1
- package/dist/assets/{chunk-6MUBBAK2-4Psl-rVs.js → chunk-6MUBBAK2-DH9iP_SO.js} +1 -1
- package/dist/assets/{chunk-AXFCVDMN-_THBcA3m.js → chunk-AXFCVDMN-B4mG9OUM.js} +1 -1
- package/dist/assets/{chunk-BG4553SI-DEs9CcBd.js → chunk-BG4553SI-B01m1Fri.js} +1 -1
- package/dist/assets/{chunk-DQASFODM-BjPZd1vg.js → chunk-DQASFODM-CJxMupbb.js} +1 -1
- package/dist/assets/{chunk-HFQBQIA3-Cn50fJjU.js → chunk-HFQBQIA3-KFFKf4m6.js} +1 -1
- package/dist/assets/{chunk-KQLB2F66-CxKJ5VW6.js → chunk-KQLB2F66-BLFTzPrj.js} +1 -1
- package/dist/assets/{chunk-KS47KZWR-B1n-ARyf.js → chunk-KS47KZWR-DUf5pi0p.js} +1 -1
- package/dist/assets/{chunk-LEVMRMFU-BCKhEfOJ.js → chunk-LEVMRMFU-ComSfUsY.js} +1 -1
- package/dist/assets/{chunk-M57EVK23-C2IbA_qJ.js → chunk-M57EVK23-Cym5WjjC.js} +1 -1
- package/dist/assets/{chunk-OY52VR5R-TzFAtZ_w.js → chunk-OY52VR5R-BqExdpA8.js} +1 -1
- package/dist/assets/{chunk-QB3YPZ4I-CqcBmlgs.js → chunk-QB3YPZ4I-C6vMfT9j.js} +1 -1
- package/dist/assets/{chunk-R3KSYZAL-sapT-duB.js → chunk-R3KSYZAL-jJrOTMxV.js} +1 -1
- package/dist/assets/{chunk-STOXU5M4-BNotEa29.js → chunk-STOXU5M4-TtyPEMjC.js} +1 -1
- package/dist/assets/{chunk-TU62E6Q5-BZhyxJkb.js → chunk-TU62E6Q5-BcX9C3vU.js} +1 -1
- package/dist/assets/{chunk-X4PVCEUW-CNQ-Xvdz.js → chunk-X4PVCEUW-622V7pcP.js} +1 -1
- package/dist/assets/{classDiagram-v2-L25IHNXF-BKLfGW9P.js → classDiagram-v2-L25IHNXF-CG2OEy42.js} +1 -1
- package/dist/assets/cynefin-EF2NZ3EQ-DwqnCkiL.js +1 -0
- package/dist/assets/{cynefinDiagram-L36ESFBY-DCZOgs8X.js → cynefinDiagram-L36ESFBY-b0PW0BRV.js} +1 -1
- package/dist/assets/{dagre-SPEB5RXH-Dy0BJIEm.js → dagre-SPEB5RXH-ChpooqkD.js} +1 -1
- package/dist/assets/{diagram-3B7GL73J-S6ZhiU2d.js → diagram-3B7GL73J-COJn-Hnl.js} +1 -1
- package/dist/assets/{diagram-DNEMPZML-CUmg80Qc.js → diagram-DNEMPZML-DPoos9W_.js} +1 -1
- package/dist/assets/{diagram-L3MUGCDN-cPBBA4WI.js → diagram-L3MUGCDN-BomMVHrk.js} +1 -1
- package/dist/assets/{diagram-LA4NIPWU-CPCpe3xv.js → diagram-LA4NIPWU-DOmO8Jer.js} +1 -1
- package/dist/assets/{diagram-MHCOC4E2-Dw5Ffvbi.js → diagram-MHCOC4E2-BHBeHFy8.js} +1 -1
- package/dist/assets/{diagram-XPFHEONP-Cc0-H1nc.js → diagram-XPFHEONP-DD7FFvTB.js} +1 -1
- package/dist/assets/{dist-DvRaBDyS.js → dist-BOQlrxwy.js} +1 -1
- package/dist/assets/{dist-BsVzXb6G.js → dist-B_e8GY23.js} +1 -1
- package/dist/assets/dist-CSp1bGLv.js +2 -0
- package/dist/assets/{dist-BhGUK0iZ.js → dist-CvW1pMqB.js} +1 -1
- package/dist/assets/{dist-DRN9-QtG.js → dist-DnfM3aPI.js} +1 -1
- package/dist/assets/{dist-DL_hxD1T.js → dist-DreEPxod.js} +1 -1
- package/dist/assets/{ebnfDiagram-UZSYDL2S-m4wkQjZ7.js → ebnfDiagram-UZSYDL2S-DFzHCxXo.js} +1 -1
- package/dist/assets/{echarts-gl-C-Tb2Yv4.js → echarts-gl-YiN0LqIW.js} +1 -1
- package/dist/assets/{elk-XV6XMXQE-_TQxmAcx.js → elk-XV6XMXQE-Kgff7tvd.js} +1 -1
- package/dist/assets/{emscripten-module-Q67P5WYC-DkK5EL_r.js → emscripten-module-Q67P5WYC-B9iy4Bgu.js} +1 -1
- package/dist/assets/{erDiagram-EYBAPDEH-DzcKEmuK.js → erDiagram-EYBAPDEH-BTWkB5PA.js} +1 -1
- package/dist/assets/{eventmodeling-K75KTNOO-C6a_Sq-9.js → eventmodeling-K75KTNOO-BgZU1_zA.js} +1 -1
- package/dist/assets/flowDiagram-MALGAFMO-BPTzCYVB.js +1 -0
- package/dist/assets/{ganttDiagram-23REXITY-BL9fHj3z.js → ganttDiagram-23REXITY-DlFGlYNT.js} +1 -1
- package/dist/assets/gitGraph-VSP46ZUC-C-zLTI42.js +1 -0
- package/dist/assets/{gitGraphDiagram-STJD7YCW-Dspf-kdw.js → gitGraphDiagram-STJD7YCW-DratNofa.js} +1 -1
- package/dist/assets/index--APEAsVF.css +1 -0
- package/dist/assets/{index-CpS9q9L6.js → index-Dc8zMoSG.js} +637 -623
- package/dist/assets/info-OHQRW6UA-D6xccwYW.js +1 -0
- package/dist/assets/{infoDiagram-KBXO4MBG-BBUCSKcc.js → infoDiagram-KBXO4MBG-D9vm3eva.js} +1 -1
- package/dist/assets/{ishikawaDiagram-M35NCXHK-CR5AxlN-.js → ishikawaDiagram-M35NCXHK-C16xQBfm.js} +1 -1
- package/dist/assets/{journeyDiagram-OPLOXDXO-DcFWQOr3.js → journeyDiagram-OPLOXDXO-C3MJaTdC.js} +1 -1
- package/dist/assets/{kanban-definition-BZKZHSQY-D14qopgX.js → kanban-definition-BZKZHSQY-CgHSD97S.js} +1 -1
- package/dist/assets/{line-CtLI_lsS.js → line-DGc9Wwrr.js} +1 -1
- package/dist/assets/{manifold-BSMczo8C.js → manifold-DO1Dy1jV.js} +1 -1
- package/dist/assets/{mermaid-parser.core-D0v0F3kZ.js → mermaid-parser.core-CZXw0Z-h.js} +3 -3
- package/dist/assets/{mermaid.core-boy8dqNh.js → mermaid.core-Am2s49wf.js} +4 -4
- package/dist/assets/{mindmap-definition-I2QAS2VK-DYbE3HR8.js → mindmap-definition-I2QAS2VK-AYuUi-1t.js} +1 -1
- package/dist/assets/packet-JDAUHWVQ-BRmDFxbP.js +1 -0
- package/dist/assets/{pegDiagram-FD4XPPHP-DO9kTbo4.js → pegDiagram-FD4XPPHP-ZgRyArnU.js} +1 -1
- package/dist/assets/pie-XZMESJXO-BcU8uN2-.js +1 -0
- package/dist/assets/{pieDiagram-J4AKIIQI-DWIgbOK_.js → pieDiagram-J4AKIIQI-Jdh-2iWY.js} +1 -1
- package/dist/assets/{quadrantDiagram-XTYBLID2-I-htxFyw.js → quadrantDiagram-XTYBLID2-B-L_DUcJ.js} +1 -1
- package/dist/assets/radar-ABXABTNO-q6s0ov8g.js +1 -0
- package/dist/assets/railroad-I3PHUGI6-FiR2iLTA.js +1 -0
- package/dist/assets/{railroad-abnf-LNEFI6M7-B8YpE0yt.js → railroad-abnf-LNEFI6M7-BRsICqY5.js} +1 -1
- package/dist/assets/{railroad-ebnf-DWYD2UWJ-BTP-Py1A.js → railroad-ebnf-DWYD2UWJ-J581SN3T.js} +1 -1
- package/dist/assets/{railroad-peg-JR7BVNR7-C7E3Pvj8.js → railroad-peg-JR7BVNR7-C-QY0AZR.js} +1 -1
- package/dist/assets/{railroadDiagram-MRQ6NCDL-Iwurnw7-.js → railroadDiagram-MRQ6NCDL-CvjjFwVP.js} +1 -1
- package/dist/assets/{requirementDiagram-Y7LWUY3S-Bm7y1HTz.js → requirementDiagram-Y7LWUY3S-qrXGd3zr.js} +1 -1
- package/dist/assets/{sankeyDiagram-WGJFYUXA-2as2DzX_.js → sankeyDiagram-WGJFYUXA-Bx0N1IkY.js} +1 -1
- package/dist/assets/{sequenceDiagram-5NDRBG5M-Bp5DNH0D.js → sequenceDiagram-5NDRBG5M-w24GJW4g.js} +1 -1
- package/dist/assets/{stateDiagram-v2-FJ4FJNEA-C9g9Ksva.js → stateDiagram-v2-FJ4FJNEA-D1KVlNmY.js} +1 -1
- package/dist/assets/{swimlanes-UMQ2AFYF-CiASfEkT.js → swimlanes-UMQ2AFYF-DTCUOS1f.js} +1 -1
- package/dist/assets/swimlanesDiagram-OMPLPG4O-674lZwKu.js +8 -0
- package/dist/assets/{timeline-definition-SEUHKTQE-BsyL-kVq.js → timeline-definition-SEUHKTQE-C2r1NiQI.js} +1 -1
- package/dist/assets/treeView-D4JQ5SDB-Cg-BEsgg.js +1 -0
- package/dist/assets/treemap-SAJKECNS-BSixpn8-.js +1 -0
- package/dist/assets/{usecaseDiagram-AFA6YXN4-BM1AzHQC.js → usecaseDiagram-AFA6YXN4-CMJfAL7M.js} +1 -1
- package/dist/assets/{vennDiagram-NNMJR3RB-DXKn1NQy.js → vennDiagram-NNMJR3RB-BQYxzZ6O.js} +1 -1
- package/dist/assets/wardley-7MLQ67FV-BicDp3r_.js +1 -0
- package/dist/assets/{wardleyDiagram-S7YFUSEH-V2roKN_V.js → wardleyDiagram-S7YFUSEH-DtT564L-.js} +1 -1
- package/dist/assets/{xychartDiagram-GGNKY7IX-BmIvl78f.js → xychartDiagram-GGNKY7IX-ByQ3LQkA.js} +1 -1
- package/dist/index.html +2 -2
- package/docs/ChangeLog.md +81 -0
- package/docs/facts.json +1 -1
- package/docs/guide/en/conversation.md +5 -2
- package/docs/guide/en/feature-list.md +19 -1
- package/docs/guide/en/features.md +4 -4
- package/docs/guide/en/github.md +19 -1
- package/docs/guide/en/index.md +4 -2
- package/docs/guide/en/v13.2.0.md +72 -0
- package/docs/guide/en/v13.3.0.md +227 -0
- package/docs/guide/ja/conversation.md +5 -2
- package/docs/guide/ja/feature-list.md +19 -1
- package/docs/guide/ja/features.md +4 -4
- package/docs/guide/ja/github.md +17 -1
- package/docs/guide/ja/index.md +3 -2
- package/docs/guide/ja/v13.2.0.md +70 -0
- package/docs/guide/ja/v13.3.0.md +214 -0
- package/package.json +1 -1
- package/server/agents/antigravity/antigravity-last-turn.ts +61 -0
- package/server/agents/antigravity/antigravity-session.ts +3 -0
- package/server/agents/antigravity/antigravity-sessions.ts +3 -2
- package/server/agents/copilot/copilot-last-turn.ts +76 -0
- package/server/agents/copilot/copilot-sessions.ts +3 -0
- package/server/agents/cursor/cursor-last-turn.ts +2 -24
- package/server/agents/cursor/cursor-sessions.ts +2 -2
- package/server/agents/grok/grok-last-turn.ts +66 -0
- package/server/agents/grok/grok-sessions.ts +3 -0
- package/server/agents/user-query.ts +24 -0
- package/server/backends/library/bounded-lines.ts +31 -0
- package/server/backends/library/cleanup-period.ts +20 -0
- package/server/backends/library/conversation-fold.ts +16 -0
- package/server/backends/library/file-history-read.ts +102 -0
- package/server/backends/library/file-history.ts +113 -0
- package/server/backends/library/index-queries.ts +43 -0
- package/server/backends/library/index-store.ts +7 -4
- package/server/backends/library/instruction-files-read.ts +282 -0
- package/server/backends/library/instruction-files.ts +113 -0
- package/server/backends/library/instruction-references.ts +72 -0
- package/server/backends/library/library-client.ts +1 -1
- package/server/backends/library/library-dispatch.ts +25 -1
- package/server/backends/library/library-service.ts +88 -2
- package/server/backends/library/library-worker.ts +2 -2
- package/server/backends/library/memory-folders.ts +202 -0
- package/server/backends/library/memory-health-read.ts +163 -0
- package/server/backends/library/memory-health.ts +145 -0
- package/server/backends/library/memory-index-lines.ts +33 -0
- package/server/backends/library/memory-link-rewrite.ts +99 -0
- package/server/backends/library/memory-merge-links.ts +82 -0
- package/server/backends/library/memory-source.ts +30 -0
- package/server/backends/library/memory-trash.ts +343 -0
- package/server/backends/library/memory-workcopies.ts +50 -0
- package/server/backends/library/memory-write.ts +59 -0
- package/server/backends/library/repeat-detect.ts +207 -0
- package/server/backends/library/repeat-source.ts +59 -0
- package/server/backends/library/retrospective.ts +67 -0
- package/server/backends/library/settings-layers-read.ts +32 -0
- package/server/backends/library/settings-layers.ts +82 -0
- package/server/backends/library/storage-home.ts +80 -0
- package/server/backends/library/storage-measurer.ts +101 -0
- package/server/backends/library/storage-projects.ts +56 -0
- package/server/backends/library/storage-walk.ts +72 -0
- package/server/backends/library/storage-worker.ts +18 -0
- package/server/backends/skills/skillCatalog.ts +9 -4
- package/server/backends/skills/skillEdit.ts +19 -0
- package/server/files/files-tree-routes.ts +1 -4
- package/server/files/tree-ops.ts +15 -3
- package/server/git/board-fetch.ts +60 -25
- package/server/git/board-repos.ts +34 -0
- package/server/git/board.ts +19 -4
- package/server/index.ts +3 -0
- package/server/routes/app-routes.ts +1 -1
- package/server/routes/library-file-routes.ts +73 -0
- package/server/routes/library-memory-routes.ts +218 -0
- package/server/routes/library-promote-routes.ts +57 -0
- package/server/routes/library-repeat-routes.ts +48 -0
- package/server/routes/library-routes.ts +32 -1
- package/server/routes/library-storage-routes.ts +108 -0
- package/server/routes/library-tools-routes.ts +80 -0
- package/server/routes/repo-routes.ts +16 -10
- package/server/routes/session-routes.ts +57 -1
- package/server/routes/skill-catalog-routes.ts +27 -1
- package/server/routes/ws-routes.ts +5 -3
- package/server/session/activity/task-push.ts +9 -7
- package/server/session/pty/agent-pty-start.ts +2 -2
- package/server/session/pty/pty-register.ts +25 -0
- package/server/session/session-reads.ts +51 -3
- package/server/session/spawn/agents/permission-mode-log.ts +25 -0
- package/server/session/spawn/agents/session-permission-mode.ts +49 -0
- package/server/session/spawn/agents/spawn-claude.ts +15 -4
- package/server/session/spawn/issue-session-spawn.ts +19 -5
- package/server/session/spawn/issue-spawn-options.ts +2 -1
- package/server/session/spawn/spawn-shell.ts +3 -3
- package/server/session/transcript/handoff-text.ts +39 -0
- package/server/session/transcript/relay-mark-store.ts +48 -0
- package/server/session/transcript/relay-marks.ts +41 -0
- package/server/session/transcript/relay-range.ts +116 -0
- package/server/session/transcript/relay-read.ts +64 -0
- package/server/session/transcript/transcript-view-antigravity.ts +104 -0
- package/server/session/transcript/transcript-view-cursor.ts +4 -3
- package/server/session/transcript/transcript-view-grok.ts +98 -0
- package/server/session/transcript/transcript-view-read.ts +36 -17
- package/server/skills/mulmoterminal-decisions/SKILL.md +1 -1
- package/server/skills/mulmoterminal-library/SKILL.md +94 -0
- package/dist/assets/cynefin-EF2NZ3EQ-aZObWpPL.js +0 -1
- package/dist/assets/dist-BQ8H_GDJ.js +0 -2
- package/dist/assets/flowDiagram-MALGAFMO-D2mZBOUP.js +0 -1
- package/dist/assets/gitGraph-VSP46ZUC-Dcetz1qJ.js +0 -1
- package/dist/assets/index-B_J-79Px.css +0 -1
- package/dist/assets/info-OHQRW6UA-CDH5k5Wi.js +0 -1
- package/dist/assets/packet-JDAUHWVQ-Ci94b3Ro.js +0 -1
- package/dist/assets/pie-XZMESJXO-CIcswX9a.js +0 -1
- package/dist/assets/radar-ABXABTNO-DJD3JUH6.js +0 -1
- package/dist/assets/railroad-I3PHUGI6-DexJ2rg3.js +0 -1
- package/dist/assets/swimlanesDiagram-OMPLPG4O-B1AVZXur.js +0 -8
- package/dist/assets/treeView-D4JQ5SDB-BDmNnMSW.js +0 -1
- package/dist/assets/treemap-SAJKECNS-BvkvOjT4.js +0 -1
- package/dist/assets/wardley-7MLQ67FV-BzWTFdnh.js +0 -1
package/README.md
CHANGED
|
@@ -1882,17 +1882,58 @@ narrow and tall for one record you are discussing — and each position keeps it
|
|
|
1882
1882
|
**Resume** (or `Enter`) to open it in a terminal in the directory it ran in. `/` focuses the
|
|
1883
1883
|
search, the arrow keys move. The **⋯** menu pins a conversation to the top of the list or renames
|
|
1884
1884
|
it; pins and names are MulmoTerminal's own (`~/.mulmoterminal/library/marks.json`) and the
|
|
1885
|
-
conversation's file is never written.
|
|
1886
|
-
|
|
1885
|
+
conversation's file is never written. **⋯** → **Promote to** turns the conversation into a memory,
|
|
1886
|
+
a `CLAUDE.md` rule, a plan under `plans/`, an issue or a skill: it opens a Claude cell in plan mode in the
|
|
1887
|
+
directory the conversation ran in, running the bundled `mulmoterminal-library` skill, which reads
|
|
1888
|
+
the conversation, shows the change as a diff, and writes nothing until you approve its plan (it backs up every
|
|
1889
|
+
file it changes first, and says how to undo). **Repeats** lists instructions you typed 3 times or more, in 2 conversations or more, in the last 90 days, read from `~/.claude/history.jsonl` (commands, pastes, automated runs and one-prompt sessions left out; short ones alike in a project grouped), with the conversations each was typed in lately; **Make a rule** / **Make a skill** start the same skill on it, in plan mode. **Storage** shows what each entry of `~/.claude` (or `CLAUDE_CONFIG_DIR`) takes on disk, and under `projects/` each project, largest first, with temp-directory ones marked; it is measured in the background and measured again when the last one is over an hour old, and it says what `cleanupPeriodDays` is set to. The conversation list leaves out `claude -p` and SDK runs, and runs from temp
|
|
1890
|
+
directories. The index behind it is built in the background the first time you open it and kept up to
|
|
1887
1891
|
date from what is appended; it is `~/.mulmoterminal/library/index.db` and can be deleted at any
|
|
1888
1892
|
time (it is rebuilt). `marks.json` beside it holds your pins and names and is not rebuilt.
|
|
1889
1893
|
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.
|
|
1894
|
+
`local_library` button beside it that opens that conversation in the Library. **Changed files**
|
|
1895
|
+
under a conversation lists the files it edited with Claude Code's edit tools, each with a diff of
|
|
1896
|
+
the whole change or of one turn's (read only; read from Claude Code's own file history).
|
|
1897
|
+
**Memory** beside **Conversations** lists Claude Code's auto memory for every project, with how
|
|
1898
|
+
full each `MEMORY.md` is against what Claude Code loads (200 lines / 25,000 bytes); a memory
|
|
1899
|
+
reads as Markdown and its `[[name]]` links open the memory they name (read only for now).
|
|
1900
|
+
Memory that can be tidied is marked with a dot and counted above the list (**Show** narrows to
|
|
1901
|
+
it): a memory missing from `MEMORY.md`, missing frontmatter, a `[[link]]` to no memory, a file it
|
|
1902
|
+
names that is gone, a memory of the same name in another work copy of the repository (a directory
|
|
1903
|
+
whose `origin` is the same remote; the reader says which copies hold the same text), or an index
|
|
1904
|
+
that is missing, overfull or pointing at a file that is gone. For a copy that differs, the reader
|
|
1905
|
+
offers **Add its text here** (opens the editor with that copy's body added; saving writes this
|
|
1906
|
+
memory only) and **Write this text there** (writes this memory's text over that copy, refused if
|
|
1907
|
+
it changed since it was read, with **Undo**), so the copies can be made one. Under a memory's title,
|
|
1908
|
+
**Written in** names the conversation that last wrote it (from the file writes its transcript
|
|
1909
|
+
recorded) and opens it.
|
|
1910
|
+
**Edit** (`Enter`) changes a memory's whole text in place (`⌘Enter` saves, `Esc` cancels); a save
|
|
1911
|
+
is refused when the file changed on disk since it was opened, and a running session there is warned of.
|
|
1912
|
+
**⋯** → **Move to Trash** moves a memory to the system Trash with its lines in `MEMORY.md`, and
|
|
1913
|
+
**Undo** in the notice puts both back. **⋯** → **Merge into another memory** picks another memory of
|
|
1914
|
+
the same project and opens it in the editor with this one's body added at its end; saving writes it
|
|
1915
|
+
and moves this one to the Trash with its lines. It also points the `[[links]]` to this memory, in
|
|
1916
|
+
the merged text and in the project's other memories (as listed when the merge starts), at the one kept (never one inside code or by
|
|
1917
|
+
a name another memory also has; how many is said before saving, and a link that cannot be rewritten exactly stops the merge). **Undo**
|
|
1918
|
+
puts all of it back. **Tools** picks a directory a conversation ran in and lists the instruction
|
|
1919
|
+
files Claude Code loads there, in the order it loads them: the managed `CLAUDE.md`, yours and your
|
|
1920
|
+
`~/.claude/rules`, every `CLAUDE.md` / `.claude/CLAUDE.md` / `CLAUDE.local.md` from the filesystem root
|
|
1921
|
+
down, the project's `.claude/rules` (a rule with `paths` marked as loading only for matching files),
|
|
1922
|
+
and what their `@path` imports bring in — or `AGENTS.md` where no `CLAUDE.md` counts. Each is read
|
|
1923
|
+
beside the list, with the paths it names (Markdown links, code-span paths) that are not there. Above them, **Settings, laid over each other** reads the user, project, local and
|
|
1924
|
+
managed `settings.json` files in Claude Code's order and shows the permission rules (every file's,
|
|
1925
|
+
added up), environment variables, hooks and other keys in effect, each naming the file that set it.
|
|
1926
|
+
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).
|
|
1891
1929
|
- **Skills viewer** — **More features** → **Skills** lists every Claude skill on disk in three
|
|
1892
1930
|
columns — where it lives, its skills, its `SKILL.md`. The places are your `~/.claude/skills`,
|
|
1893
1931
|
each enabled plugin (skills shown as `plugin:skill`), and the `.claude/skills` of each folder a
|
|
1894
1932
|
terminal has run in (folders with none are left out). A project skill with the same name as one
|
|
1895
1933
|
of yours is marked as overriding it. The search (name, description or folder) narrows both lists.
|
|
1934
|
+
**Edit** changes one of your own or a project's `SKILL.md` in place (`⌘Enter` saves, `Esc`
|
|
1935
|
+
cancels), refused if it changed on disk since it was opened; a plugin's skills and the ones
|
|
1936
|
+
MulmoTerminal ships (copied over at every start) are read only.
|
|
1896
1937
|
Switch to **skills.sh** to search the public directory at [skills.sh](https://skills.sh) for
|
|
1897
1938
|
skills you do not have yet and read one before installing it: its `SKILL.md`, every file it would
|
|
1898
1939
|
bring, and a warning listing the files that can run code. Nothing is installed from the viewer —
|
|
@@ -1973,7 +2014,7 @@ narrow and tall for one record you are discussing — and each position keeps it
|
|
|
1973
2014
|
- **Tool traffic is folded away**, one line saying what ran (`Bash · Read`); click to open it.
|
|
1974
2015
|
It is most of a turn's bulk and almost none of what you came back to read.
|
|
1975
2016
|
- A **snapshot**, not a live tail — the terminal beside it is the live view — and the header's
|
|
1976
|
-
reload fetches the newest turns again. Claude, Codex, Cursor and
|
|
2017
|
+
reload fetches the newest turns again. Claude, Codex, Cursor, Copilot, Grok and Antigravity; an agent whose
|
|
1977
2018
|
conversation no reader here can read yet says so rather than showing an empty pane.
|
|
1978
2019
|
- **Notifications** (🔔) — a toolbar bell with an unread badge and a dropdown of active
|
|
1979
2020
|
notifications; click a row to jump to its session.
|
|
@@ -2194,6 +2235,8 @@ name in `MULMOTERMINAL_HOST` / `MULMOTERMINAL_ALLOWED_ORIGINS`, against DNS rebi
|
|
|
2194
2235
|
| `GET /api/cursor/sessions?cwd=` | Cursor chats for the project, newest first. Cursor's project directory name is a truncated-and-hashed slug of the path, so this reads each directory's own `.workspace-trusted` to learn which one it stands for and omits any that does not say. |
|
|
2195
2236
|
| `GET /api/cost?cwd=&session=` | Estimated $ cost — session / today / month. |
|
|
2196
2237
|
| `GET /api/transcript/timeline?session=&cwd=` | Per-session activity timeline (tools run). |
|
|
2238
|
+
| `GET /api/transcript/relay?session=&cwd=&agent=&dest=` | Every exchange of that session since the last relay to directory `dest`: `status` (`ok` / `nothing-new` / `no-turn`), the `text` to paste, and the `mark` to record. |
|
|
2239
|
+
| `POST /api/transcript/relay-mark?session=&cwd=&agent=&dest=` | Body `{ mark }`. Records where the relay to `dest` ended, once the text was pasted. |
|
|
2197
2240
|
| `GET /api/transcript/last-turn?session=&cwd=&agent=` | A session's last completed exchange (`prompt`, `reply`) plus the `text` to paste into another terminal. `agent=codex` reads the codex rollout instead of the Claude transcript. |
|
|
2198
2241
|
| `GET /api/decisions?cwd=&limit=` | The decisions a human was asked to make in this project, newest first — each question with the options it offered, their descriptions, and the answer. `answerKind` says whether the answer was one of the options, text the user wrote instead (the question was wrong), or never given. Read out of Claude's own transcripts; writes nothing. `scanned` reports how many transcripts were read (the scan is capped) and `unreadable` how many could not be, so a partial answer is visible rather than implied. A `cwd` that is not an existing directory answers an empty response rather than falling back to the default workspace. |
|
|
2199
2242
|
| `GET /api/decisions/digest?cwd=` | The same decisions as Markdown, for an agent to read (`{ enabled, markdown }`). `enabled: false` means the `decisionDigest` setting is off — a different answer from an empty digest, so a reader can tell "switched off" from "nothing decided here". |
|
package/common/bundledSkills.ts
CHANGED
package/common/ghItems.ts
CHANGED
|
@@ -29,6 +29,8 @@ export interface RepoPrs {
|
|
|
29
29
|
// True when the repo has at least PR_LIMIT open PRs, so the list may be incomplete —
|
|
30
30
|
// surfaced in the UI so a truncated view isn't mistaken for full coverage.
|
|
31
31
|
truncated?: boolean;
|
|
32
|
+
/** Read only because a live cell is in it: not in `prRepos`. */
|
|
33
|
+
unregistered?: boolean;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
export interface RepoIssues {
|
|
@@ -40,4 +42,6 @@ export interface RepoIssues {
|
|
|
40
42
|
truncated?: boolean;
|
|
41
43
|
// The repo's GitHub issues page, used as the "see the rest" target when truncated.
|
|
42
44
|
url?: string;
|
|
45
|
+
/** Read only because a live cell is in it: not in `prRepos`. */
|
|
46
|
+
unregistered?: boolean;
|
|
43
47
|
}
|
package/common/githubBoard.ts
CHANGED
|
@@ -49,6 +49,11 @@ export interface BoardCell {
|
|
|
49
49
|
waiting: boolean;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/** A live cell on no piece of work: on the default branch, which `branch` names, or on no branch (null). */
|
|
53
|
+
export interface BoardMainlineCell extends BoardCell {
|
|
54
|
+
branch: string | null;
|
|
55
|
+
}
|
|
56
|
+
|
|
52
57
|
export interface BoardCard {
|
|
53
58
|
/** Stable within a repo: `pr-N`, `issue-N` or `branch-<name>`. */
|
|
54
59
|
key: string;
|
|
@@ -64,6 +69,10 @@ export interface RepoBoard {
|
|
|
64
69
|
repo: string;
|
|
65
70
|
cards?: BoardCard[];
|
|
66
71
|
error?: string;
|
|
72
|
+
/** Read only because a live cell is in it: not in `prRepos`. */
|
|
73
|
+
unregistered?: boolean;
|
|
74
|
+
/** The cells on the default branch or on no branch, which belong to no card. Absent when none. */
|
|
75
|
+
mainlineCells?: BoardMainlineCell[];
|
|
67
76
|
}
|
|
68
77
|
|
|
69
78
|
export interface BoardResponse {
|
|
@@ -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,191 @@
|
|
|
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 most a memory edit may write: far past any real memory, and what the editor refuses to send. */
|
|
10
|
+
export const MEMORY_EDIT_MAX_BYTES = 256 * 1024;
|
|
11
|
+
|
|
12
|
+
/** The index's own name in a memory folder. */
|
|
13
|
+
export const MEMORY_INDEX_FILE = "MEMORY.md";
|
|
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";
|
|
18
|
+
|
|
19
|
+
export interface LibraryMemoryFile {
|
|
20
|
+
/** The file's name in the folder. */
|
|
21
|
+
file: string;
|
|
22
|
+
/** The frontmatter `name`, or null when it has none. */
|
|
23
|
+
name: string | null;
|
|
24
|
+
description: string | null;
|
|
25
|
+
/** `metadata.type` (user, feedback, project, reference), or null. */
|
|
26
|
+
type: string | null;
|
|
27
|
+
updatedAt: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface LibraryMemoryProject {
|
|
31
|
+
slug: string;
|
|
32
|
+
/** The directory the folder belongs to, when a conversation there tells it; else null. */
|
|
33
|
+
cwd: string | null;
|
|
34
|
+
/** The index's size against what is loaded; null when the folder has no index. */
|
|
35
|
+
index: { lines: number; bytes: number } | null;
|
|
36
|
+
files: LibraryMemoryFile[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface MemoryFrontmatter {
|
|
40
|
+
/** Top-level `key: value` lines, quotes taken off. */
|
|
41
|
+
fields: Record<string, string>;
|
|
42
|
+
/** The `metadata:` block's `key: value` lines. */
|
|
43
|
+
metadata: Record<string, string>;
|
|
44
|
+
body: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const unquote = (value: string): string => {
|
|
48
|
+
const trimmed = value.trim();
|
|
49
|
+
if (trimmed.length >= 2 && trimmed.startsWith('"') && trimmed.endsWith('"')) {
|
|
50
|
+
try {
|
|
51
|
+
const parsed: unknown = JSON.parse(trimmed);
|
|
52
|
+
return typeof parsed === "string" ? parsed : trimmed;
|
|
53
|
+
} catch {
|
|
54
|
+
return trimmed.slice(1, -1);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return trimmed.length >= 2 && trimmed.startsWith("'") && trimmed.endsWith("'") ? trimmed.slice(1, -1).replaceAll("''", "'") : trimmed;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const KEY_VALUE = /^([A-Za-z_][\w-]*):(.*)$/;
|
|
61
|
+
|
|
62
|
+
/** The frontmatter between the opening `---` and the next one, as the memory files write it: flat
|
|
63
|
+
* keys and one `metadata:` block indented under them. No frontmatter: all of it is body. */
|
|
64
|
+
/** The text as the frontmatter rules read it: no byte-order mark (some Windows editors write one, and
|
|
65
|
+
* it would hide the opening `---`), and `\n` line ends. */
|
|
66
|
+
const normalizedMemory = (text: string): string => text.replace(/^\uFEFF/, "").replace(/\r\n/g, "\n");
|
|
67
|
+
|
|
68
|
+
/** Where the closing delimiter starts, or -1: a line of exactly `---` (a `---draft` line inside is not
|
|
69
|
+
* one), at the end of the text or followed by a newline. -1 too when there is no opening line. */
|
|
70
|
+
function frontmatterEnd(normalized: string): number {
|
|
71
|
+
const close = normalized.startsWith("---\n") ? /\n---(?:\n|$)/.exec(normalized.slice(3)) : null;
|
|
72
|
+
return close === null ? -1 : close.index + 3;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Whether a frontmatter opens and has not closed yet — what a reader of a file's head asks to know
|
|
76
|
+
* whether to read on. */
|
|
77
|
+
export function frontmatterStillOpen(text: string): boolean {
|
|
78
|
+
const normalized = normalizedMemory(text);
|
|
79
|
+
return normalized.startsWith("---\n") && frontmatterEnd(normalized) === -1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Where a memory's body starts in its text as written — after the frontmatter's closing line, or 0 when
|
|
83
|
+
* there is none — found as `parseMemoryFrontmatter` finds it, but on the text itself rather than its
|
|
84
|
+
* normalised copy, so the body can be edited and the frontmatter left byte for byte. */
|
|
85
|
+
export function memoryBodyStart(text: string): number {
|
|
86
|
+
const open = /^\uFEFF?---\r?\n/.exec(text);
|
|
87
|
+
if (open === null) return 0;
|
|
88
|
+
const close = /\r?\n---(?:\r?\n|$)/.exec(text.slice(open[0].length - 1));
|
|
89
|
+
return close === null ? 0 : open[0].length - 1 + close.index + close[0].length;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Whether a `[[link]]` names a memory: by its file name without `.md`, or by its frontmatter `name`,
|
|
93
|
+
* either side's surrounding spaces aside (a link's own are, and a quoted value can carry some). The one
|
|
94
|
+
* rule the reader, the health check and a merge's rewrite all decide a link's memory by. */
|
|
95
|
+
export const linkNamesMemory = (link: string, memory: { file: string; name: string | null }): boolean => {
|
|
96
|
+
const wanted = link.trim();
|
|
97
|
+
return wanted !== "" && (wanted === memory.file.replace(/\.md$/, "") || wanted === (memory.name ?? "").trim());
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/** The names a `[[link]]` reaches a memory by, as `linkNamesMemory` decides it. */
|
|
101
|
+
export const memoryLinkNames = (memory: { file: string; name: string | null }): string[] =>
|
|
102
|
+
[memory.file.replace(/\.md$/, ""), (memory.name ?? "").trim()].filter((name, at, all) => name !== "" && all.indexOf(name) === at);
|
|
103
|
+
|
|
104
|
+
export function parseMemoryFrontmatter(text: string): MemoryFrontmatter {
|
|
105
|
+
const normalized = normalizedMemory(text);
|
|
106
|
+
const end = frontmatterEnd(normalized);
|
|
107
|
+
if (end === -1) return { fields: {}, metadata: {}, body: text };
|
|
108
|
+
const fields: Record<string, string> = {};
|
|
109
|
+
const metadata: Record<string, string> = {};
|
|
110
|
+
let inMetadata = false;
|
|
111
|
+
normalized
|
|
112
|
+
.slice(4, end)
|
|
113
|
+
.split("\n")
|
|
114
|
+
.forEach((line) => {
|
|
115
|
+
const nested = /^\s+/.test(line);
|
|
116
|
+
const match = KEY_VALUE.exec(line.trim());
|
|
117
|
+
if (!match) return;
|
|
118
|
+
const [, key = "", value = ""] = match;
|
|
119
|
+
if (!nested) inMetadata = key === "metadata" && value.trim() === "";
|
|
120
|
+
if (nested && inMetadata) metadata[key] = unquote(value);
|
|
121
|
+
else if (!nested && !inMetadata) fields[key] = unquote(value);
|
|
122
|
+
});
|
|
123
|
+
return { fields, metadata, body: normalized.slice(end + 5) };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const isNullableString = (value: unknown): boolean => value === null || typeof value === "string";
|
|
127
|
+
|
|
128
|
+
const isMemoryFile = (value: unknown): value is LibraryMemoryFile =>
|
|
129
|
+
isRecord(value) &&
|
|
130
|
+
typeof value.file === "string" &&
|
|
131
|
+
isNullableString(value.name) &&
|
|
132
|
+
isNullableString(value.description) &&
|
|
133
|
+
isNullableString(value.type) &&
|
|
134
|
+
typeof value.updatedAt === "number";
|
|
135
|
+
|
|
136
|
+
export const isLibraryMemoryProject = (value: unknown): value is LibraryMemoryProject =>
|
|
137
|
+
isRecord(value) &&
|
|
138
|
+
typeof value.slug === "string" &&
|
|
139
|
+
isNullableString(value.cwd) &&
|
|
140
|
+
(value.index === null || (isRecord(value.index) && typeof value.index.lines === "number" && typeof value.index.bytes === "number")) &&
|
|
141
|
+
Array.isArray(value.files) &&
|
|
142
|
+
value.files.every(isMemoryFile);
|
|
143
|
+
|
|
144
|
+
/** A memory's type: `metadata.type`, or a top-level `type` as some memory files write it — an empty one
|
|
145
|
+
* falls through. The list and the health check both decide it here. */
|
|
146
|
+
export const memoryType = (frontmatter: Pick<MemoryFrontmatter, "fields" | "metadata">): string | null =>
|
|
147
|
+
frontmatter.metadata.type?.trim() || frontmatter.fields.type?.trim() || null;
|
|
148
|
+
|
|
149
|
+
/** What can be tidied in one memory file (#3331). */
|
|
150
|
+
export type MemoryFileIssue =
|
|
151
|
+
| { kind: "not-in-index" }
|
|
152
|
+
| { kind: "no-frontmatter"; missing: string[] }
|
|
153
|
+
| { kind: "broken-link"; names: string[] }
|
|
154
|
+
| { kind: "missing-path"; paths: string[] }
|
|
155
|
+
/** A memory of the same name in other work copies of the repository, each the same text or not. */
|
|
156
|
+
| { kind: "in-work-copies"; copies: { slug: string; same: boolean }[] };
|
|
157
|
+
|
|
158
|
+
/** What can be tidied in a project's memory as a whole: its index. */
|
|
159
|
+
export type MemoryProjectIssue = { kind: "index-over-limit" } | { kind: "no-index" } | { kind: "dead-index-entry"; files: string[] };
|
|
160
|
+
|
|
161
|
+
export interface LibraryMemoryHealth {
|
|
162
|
+
slug: string;
|
|
163
|
+
issues: MemoryProjectIssue[];
|
|
164
|
+
/** By file name; a file with nothing to tidy is not listed. */
|
|
165
|
+
files: Record<string, MemoryFileIssue[]>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const isStringList = (value: unknown): value is string[] => Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
169
|
+
|
|
170
|
+
const isFileIssue = (value: unknown): value is MemoryFileIssue => {
|
|
171
|
+
if (!isRecord(value)) return false;
|
|
172
|
+
if (value.kind === "not-in-index") return true;
|
|
173
|
+
if (value.kind === "no-frontmatter") return isStringList(value.missing);
|
|
174
|
+
if (value.kind === "broken-link") return isStringList(value.names);
|
|
175
|
+
if (value.kind === "in-work-copies") return Array.isArray(value.copies) && value.copies.length > 0 && value.copies.every(isWorkCopy);
|
|
176
|
+
return value.kind === "missing-path" && isStringList(value.paths);
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const isWorkCopy = (value: unknown): value is { slug: string; same: boolean } =>
|
|
180
|
+
isRecord(value) && typeof value.slug === "string" && typeof value.same === "boolean";
|
|
181
|
+
|
|
182
|
+
const isProjectIssue = (value: unknown): value is MemoryProjectIssue =>
|
|
183
|
+
isRecord(value) && (value.kind === "index-over-limit" || value.kind === "no-index" || (value.kind === "dead-index-entry" && isStringList(value.files)));
|
|
184
|
+
|
|
185
|
+
export const isLibraryMemoryHealth = (value: unknown): value is LibraryMemoryHealth =>
|
|
186
|
+
isRecord(value) &&
|
|
187
|
+
typeof value.slug === "string" &&
|
|
188
|
+
Array.isArray(value.issues) &&
|
|
189
|
+
value.issues.every(isProjectIssue) &&
|
|
190
|
+
isRecord(value.files) &&
|
|
191
|
+
Object.values(value.files).every((issues) => Array.isArray(issues) && issues.every(isFileIssue));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Promoting a conversation from the Library (#3334): what it can become, and the turn that asks the
|
|
2
|
+
// bundled skill to make it. Both sides decide from these — the reader lists the targets, the server
|
|
3
|
+
// refuses any other and writes the turn — so they are named once, here.
|
|
4
|
+
import type { BundledSkillName } from "./bundledSkills.js";
|
|
5
|
+
|
|
6
|
+
/** What a conversation can be promoted to: a memory, a `CLAUDE.md` rule, a plan under `plans/`, an
|
|
7
|
+
* issue, or a skill. */
|
|
8
|
+
export const PROMOTE_TARGETS = ["memory", "rule", "plan", "issue", "skill"] as const;
|
|
9
|
+
|
|
10
|
+
export type PromoteTarget = (typeof PROMOTE_TARGETS)[number];
|
|
11
|
+
|
|
12
|
+
export const isPromoteTarget = (value: unknown): value is PromoteTarget => PROMOTE_TARGETS.some((target) => target === value);
|
|
13
|
+
|
|
14
|
+
/** The skill that reads the conversation and writes what it is promoted to, once the person approves. */
|
|
15
|
+
export const PROMOTE_SKILL: BundledSkillName = "mulmoterminal-library";
|
|
16
|
+
|
|
17
|
+
/** A Claude session id, a UUID: the only shape the transcript routes the skill reads it through take
|
|
18
|
+
* (a subagent's file name is not one, so a subagent's conversation is not promoted). Only such an id
|
|
19
|
+
* is put into the turn, so nothing the browser sent can become words the agent reads. */
|
|
20
|
+
const SESSION_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
21
|
+
|
|
22
|
+
/** The first turn of the session that promotes `sessionId`, or null for an id that is not one. */
|
|
23
|
+
export function promoteTurn(target: PromoteTarget, sessionId: string): string | null {
|
|
24
|
+
return SESSION_ID.test(sessionId) ? `/${PROMOTE_SKILL} promote ${target} ${sessionId}` : null;
|
|
25
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Instructions typed again and again (#3334), for the Library's Repeats view: candidates for a
|
|
2
|
+
// CLAUDE.md rule or a skill. The server finds them; the browser shows them; a candidate is promoted by
|
|
3
|
+
// its id, so nothing the browser sends becomes words the agent reads.
|
|
4
|
+
import { isRecord } from "./isRecord.js";
|
|
5
|
+
import { PROMOTE_SKILL } from "./libraryPromote.js";
|
|
6
|
+
|
|
7
|
+
/** How far back, how many times and in how many conversations an instruction has to be typed to count
|
|
8
|
+
* as repeated. The server decides by them and the view says them. */
|
|
9
|
+
export const REPEAT_WINDOW_DAYS = 90;
|
|
10
|
+
export const REPEAT_MIN_COUNT = 3;
|
|
11
|
+
export const REPEAT_MIN_SESSIONS = 2;
|
|
12
|
+
|
|
13
|
+
/** What a repeated instruction can become. */
|
|
14
|
+
export const REPEAT_TARGETS = ["rule", "skill"] as const;
|
|
15
|
+
|
|
16
|
+
export type RepeatTarget = (typeof REPEAT_TARGETS)[number];
|
|
17
|
+
|
|
18
|
+
export const isRepeatTarget = (value: unknown): value is RepeatTarget => REPEAT_TARGETS.some((target) => target === value);
|
|
19
|
+
|
|
20
|
+
/** One time the instruction was typed. */
|
|
21
|
+
export interface RepeatOccurrence {
|
|
22
|
+
sessionId: string;
|
|
23
|
+
project: string | null;
|
|
24
|
+
at: number;
|
|
25
|
+
text: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface RepeatCandidate {
|
|
29
|
+
/** Stable while the instruction's most typed form stays the most typed: hex. */
|
|
30
|
+
id: string;
|
|
31
|
+
/** Its most typed form. */
|
|
32
|
+
text: string;
|
|
33
|
+
/** The forms it was typed in, most typed first. */
|
|
34
|
+
variants: string[];
|
|
35
|
+
count: number;
|
|
36
|
+
sessions: number;
|
|
37
|
+
/** The directories it was typed in, most first. */
|
|
38
|
+
projects: string[];
|
|
39
|
+
lastAt: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** GET /api/library/repeats: the most typed candidates, and how many there are in all. */
|
|
43
|
+
export interface RepeatList {
|
|
44
|
+
candidates: RepeatCandidate[];
|
|
45
|
+
total: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** One candidate with the latest times it was typed, newest first (for the skill that promotes it);
|
|
49
|
+
* `count` is how many there were in all, and `projects` names every directory it was typed in. */
|
|
50
|
+
export interface RepeatDetail extends RepeatCandidate {
|
|
51
|
+
occurrences: RepeatOccurrence[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const REPEAT_ID = /^[0-9a-f]{16}$/;
|
|
55
|
+
|
|
56
|
+
export const isRepeatId = (value: string): boolean => REPEAT_ID.test(value);
|
|
57
|
+
|
|
58
|
+
/** The first turn of the session that promotes a candidate, or null for an id that is not one. */
|
|
59
|
+
export function repeatTurn(target: RepeatTarget, id: string): string | null {
|
|
60
|
+
return isRepeatId(id) ? `/${PROMOTE_SKILL} repeat ${target} ${id}` : null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const isStrings = (value: unknown): value is string[] => Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
64
|
+
|
|
65
|
+
export const isRepeatCandidate = (value: unknown): value is RepeatCandidate =>
|
|
66
|
+
isRecord(value) &&
|
|
67
|
+
typeof value.id === "string" &&
|
|
68
|
+
typeof value.text === "string" &&
|
|
69
|
+
isStrings(value.variants) &&
|
|
70
|
+
typeof value.count === "number" &&
|
|
71
|
+
typeof value.sessions === "number" &&
|
|
72
|
+
isStrings(value.projects) &&
|
|
73
|
+
typeof value.lastAt === "number";
|
|
74
|
+
|
|
75
|
+
const isOccurrence = (value: unknown): value is RepeatOccurrence =>
|
|
76
|
+
isRecord(value) &&
|
|
77
|
+
typeof value.sessionId === "string" &&
|
|
78
|
+
(value.project === null || typeof value.project === "string") &&
|
|
79
|
+
typeof value.at === "number" &&
|
|
80
|
+
typeof value.text === "string";
|
|
81
|
+
|
|
82
|
+
export const isRepeatDetail = (value: unknown): value is RepeatDetail =>
|
|
83
|
+
isRepeatCandidate(value) && isRecord(value) && Array.isArray(value.occurrences) && value.occurrences.every(isOccurrence);
|
|
84
|
+
|
|
85
|
+
export const isRepeatList = (value: unknown): value is RepeatList =>
|
|
86
|
+
isRecord(value) && Array.isArray(value.candidates) && value.candidates.every(isRepeatCandidate) && typeof value.total === "number";
|
|
@@ -0,0 +1,36 @@
|
|
|
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.
|
|
4
|
+
import { isRecord } from "./isRecord.js";
|
|
5
|
+
|
|
6
|
+
/** How far back the retrospective reaches. */
|
|
7
|
+
export const RETROSPECTIVE_WEEKS = 12;
|
|
8
|
+
|
|
9
|
+
export interface RetrospectiveTotals {
|
|
10
|
+
costUsd: number;
|
|
11
|
+
conversations: number;
|
|
12
|
+
prs: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface LibraryRetrospective {
|
|
16
|
+
/** Each week's totals, oldest first, every week present (an empty one is all zeros). `start_ms` is the
|
|
17
|
+
* Monday the week starts on, at local midnight on the server. */
|
|
18
|
+
weeks: (RetrospectiveTotals & { start_ms: number })[];
|
|
19
|
+
/** By project directory, the most spent first; a conversation with no directory is under "". */
|
|
20
|
+
projects: (RetrospectiveTotals & { cwd: string })[];
|
|
21
|
+
/** By agent, the most spent first. */
|
|
22
|
+
agents: (RetrospectiveTotals & { agent: string })[];
|
|
23
|
+
total: RetrospectiveTotals;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const isTotals = (value: unknown): value is RetrospectiveTotals =>
|
|
27
|
+
isRecord(value) && typeof value.costUsd === "number" && typeof value.conversations === "number" && typeof value.prs === "number";
|
|
28
|
+
const listOf = (value: unknown, key: string, kind: "string" | "number"): boolean =>
|
|
29
|
+
Array.isArray(value) && value.every((entry) => isTotals(entry) && isRecord(entry) && typeof entry[key] === kind);
|
|
30
|
+
|
|
31
|
+
export const isLibraryRetrospective = (value: unknown): value is LibraryRetrospective =>
|
|
32
|
+
isRecord(value) &&
|
|
33
|
+
listOf(value.weeks, "start_ms", "number") &&
|
|
34
|
+
listOf(value.projects, "cwd", "string") &&
|
|
35
|
+
listOf(value.agents, "agent", "string") &&
|
|
36
|
+
isTotals(value.total);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// What the Library's tools kind shows of Claude Code's settings for one directory (#3332): each file it
|
|
2
|
+
// reads, and the result of laying them over each other, every value naming the file it came from.
|
|
3
|
+
// Shared by the route and the view.
|
|
4
|
+
import { isRecord } from "./isRecord.js";
|
|
5
|
+
|
|
6
|
+
/** The settings files, weakest first: a key in a later one overrides the same key in an earlier one, and
|
|
7
|
+
* a list adds to it (code.claude.com/docs/en/settings, "Settings precedence"). */
|
|
8
|
+
export const SETTINGS_SOURCES = ["user", "project", "local", "managed"] as const;
|
|
9
|
+
export type SettingsSource = (typeof SETTINGS_SOURCES)[number];
|
|
10
|
+
|
|
11
|
+
export const PERMISSION_KINDS = ["allow", "ask", "deny"] as const;
|
|
12
|
+
export type PermissionKind = (typeof PERMISSION_KINDS)[number];
|
|
13
|
+
|
|
14
|
+
export interface SettingsFile {
|
|
15
|
+
source: SettingsSource;
|
|
16
|
+
path: string;
|
|
17
|
+
/** "absent": no such file; "invalid": not a JSON object, so Claude Code skips it. */
|
|
18
|
+
state: "ok" | "absent" | "invalid";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface FromSource<T> {
|
|
22
|
+
value: T;
|
|
23
|
+
source: SettingsSource;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface LibrarySettings {
|
|
27
|
+
cwd: string;
|
|
28
|
+
files: SettingsFile[];
|
|
29
|
+
/** Every rule of each kind, from every file: the lists merge. */
|
|
30
|
+
permissions: Record<PermissionKind, FromSource<string>[]>;
|
|
31
|
+
/** Each variable's value from the strongest file that sets it. */
|
|
32
|
+
env: (FromSource<string> & { name: string })[];
|
|
33
|
+
/** Each hook event's entries, from every file. */
|
|
34
|
+
hooks: (FromSource<string> & { event: string })[];
|
|
35
|
+
/** Every other top-level key, from the strongest file that sets it, as JSON. */
|
|
36
|
+
other: (FromSource<string> & { key: string })[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const isSource = (value: unknown): value is SettingsSource => SETTINGS_SOURCES.some((source) => source === value);
|
|
40
|
+
const isFrom = (value: unknown, extra: string | null = null): boolean =>
|
|
41
|
+
isRecord(value) && typeof value.value === "string" && isSource(value.source) && (extra === null || typeof value[extra] === "string");
|
|
42
|
+
const isFile = (value: unknown): value is SettingsFile =>
|
|
43
|
+
isRecord(value) &&
|
|
44
|
+
isSource(value.source) &&
|
|
45
|
+
typeof value.path === "string" &&
|
|
46
|
+
(value.state === "ok" || value.state === "absent" || value.state === "invalid");
|
|
47
|
+
|
|
48
|
+
const listOf = (value: unknown, extra: string | null): boolean => Array.isArray(value) && value.every((entry) => isFrom(entry, extra));
|
|
49
|
+
|
|
50
|
+
const isPermissions = (value: unknown): value is LibrarySettings["permissions"] =>
|
|
51
|
+
isRecord(value) && PERMISSION_KINDS.every((kind) => listOf(value[kind], null));
|
|
52
|
+
|
|
53
|
+
export const isLibrarySettings = (value: unknown): value is LibrarySettings =>
|
|
54
|
+
isRecord(value) &&
|
|
55
|
+
typeof value.cwd === "string" &&
|
|
56
|
+
Array.isArray(value.files) &&
|
|
57
|
+
value.files.every(isFile) &&
|
|
58
|
+
isPermissions(value.permissions) &&
|
|
59
|
+
listOf(value.env, "name") &&
|
|
60
|
+
listOf(value.hooks, "event") &&
|
|
61
|
+
listOf(value.other, "key");
|