@litfamily/litmuse 0.1.21 → 0.1.23
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/CHANGELOG.md +26 -0
- package/README.md +61 -15
- package/README_ko-KR.md +61 -15
- package/bin/litmuse.mjs +17 -33
- package/lib/agent-file.mjs +2 -11
- package/lib/agent-guide.mjs +71 -0
- package/lib/config.mjs +18 -0
- package/lib/doctor.mjs +3 -1
- package/lib/flags.mjs +35 -0
- package/lib/glyphs.mjs +55 -7
- package/lib/guard.mjs +38 -1
- package/lib/icon-font.mjs +198 -0
- package/lib/install-cards.mjs +8 -3
- package/lib/install.mjs +39 -8
- package/lib/paths.mjs +4 -1
- package/lib/safe-write.mjs +1 -1
- package/lib/uninstall.mjs +13 -1
- package/package.json +3 -2
- package/plugin/.muse-plugin/plugin.json +13 -13
- package/plugin/hooks/lib/autopilot.mjs +638 -0
- package/plugin/hooks/lib/common.mjs +80 -5
- package/plugin/hooks/lib/continuation.mjs +13 -52
- package/plugin/hooks/lib/goal.mjs +5 -2
- package/plugin/hooks/lib/run-group.mjs +33 -0
- package/plugin/hooks/lib/shell-verdict.mjs +1004 -0
- package/plugin/hooks/lib/suggest.mjs +110 -0
- package/plugin/hooks/pre-tool-use.mjs +111 -5
- package/plugin/hooks/subagent-start.mjs +12 -1
- package/plugin/hooks/user-prompt-submit.mjs +69 -13
- package/plugin/skills/lit-plan/SKILL.md +12 -2
- package/plugin/skills/lit-plan/scripts/goal-propose.mjs +9 -2
- package/plugin/skills/start-work/SKILL.md +94 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.23 — 2026-11-27
|
|
4
|
+
|
|
5
|
+
- start-work can now finish a long run with nobody at the keyboard. A step the run guard will not let through (a push, a delete, an install, a file made in a folder the plan grants only for reading) is parked with its command and folder, and the run goes on with the next row. When every row is ticked and the plan's `## Done when` check exits 0, the run closes itself with one line. Otherwise it ends with one inbox that starts with `WAITING-ON-USER:` and lists the parked steps, the waiting rows and the answers: `lit approve` runs the shown local steps, `lit approve x` (typed exactly) also runs pushes, tags, publishes and other outward steps, `lit deny` drops them, `lit skip-row [N]` skips a row, `lit pause` / `lit resume` stop and restart the driving, and `lit cancel` ends the run (a damaged state file too, which still refuses protected reads until then). A row the model cannot do carries `IMPOSSIBLE: <reason>`. Secrets and the real host home are still refused and never parked; a reader's glob in the workspace (`cat .env*`) is expanded and every match checked, and git index paths (`git show :.env`) count as paths.
|
|
6
|
+
- A plan line `Run charter: commit on <branch> in <repo>` lets the run commit on that branch after your `yes`. Amend, `--no-verify`, `git add -A`, push and tag stay out of it, and a charter edited after the start grants nothing.
|
|
7
|
+
- Muse's native goal is armed only for a plan with a `goal: native` line, and its objective always ends itself on a `WAITING-ON-USER:` reply or after 30 turns. Other plans are driven by the start-work hooks alone.
|
|
8
|
+
- A prompt without `lit` now gets a short suggestion when it clearly fits a skill ("plot this csv" names lit-scientific-visualization), always with "none of these", and the model decides. When no rule fires, one compact catalog line is added instead. Slash commands get nothing. Each rule shipped only after it reached recall of at least 0.85 and near-miss false positives of at most 0.10 on a sealed held-out set, scored once with `node scripts/routing-eval.mjs heldout --record`; `npm run eval:routing` now scores only the dev half.
|
|
9
|
+
- Muse shows no hook text to the user, so the completion line and the inbox reach you only through the model's reply: the hook asks the model to repeat them exactly. A child lane follows the run guard only when Muse names the child session in its SubagentStart payload. Replays run through `/bin/sh`.
|
|
10
|
+
- The run guard reads past harmless-looking readers: a sed script with w, r or e commands, awk with `system` or `>`, `rg --pre`, `sort -o` and `git diff --output` outside the workspace are held or parked, and a tool it cannot read (cron, MCP servers) is held. Replays and the done check run in their own process group, so a timeout also stops background children, and injected messages are capped.
|
|
11
|
+
- During a run the guard parks by default. It runs readers, the plan's Done-when check, the repo's own test and check commands and scripts inside the project; a verb it does not know (`dd`, `ln`, `chmod`, `go run`, `awk` and the like) and a shell redirect into the workspace park as X, and a file the shell makes there parks as B. Write files with the file tools. A script inside the project can still do anything its author wrote; the reference says so. Link chains are followed to the end, a loop is refused, and a shell write into the real host home is refused.
|
|
12
|
+
- The run record is sealed with an HMAC whose key stays in LitMuse's state folder. A record changed outside the hooks loses its parked steps and grants, and the inbox shows a digest of its list that replay checks.
|
|
13
|
+
- Injected messages now fit Muse's 16 KiB hook output limit: each stays within 12 KiB after JSON escaping, and the inbox lists only the parked steps that fit; `lit approve` runs only those, and the rest are counted. A plain prompt in the middle of a run no longer switches the run guard off. During a run only read-only `litmuse/*` child agents start, because Muse does not name the child session to the hooks. An absolute path in a prompt (`/Users/me/data.csv`) is no longer taken for a slash command.
|
|
14
|
+
- The run guard also refuses moves and removes that would take the run state with them (`mv .litmuse x`, `rm -rf .`), checks secret names case-insensitively and inside `git show REV:path`, holds `grep -f` with an outside pattern file, and after `lit approve x` runs a BLOCKED row's step it tells the model to clear the BLOCKED line and finish the row.
|
|
15
|
+
- The guard reads `sort` and `file` options from an allowlist (clusters and abbreviations included), refuses recursive reads over a folder that holds secrets (`grep -r x ~`), refuses writes into any `.git` folder, and keeps `lit deny` answers when a run record fails its seal.
|
|
16
|
+
- During a run the guard fails closed: a call it cannot read or check is denied, and a step over 2000 characters is refused without being stored.
|
|
17
|
+
- The UserPromptSubmit and Stop hooks now allow up to 110 s and 100 s, to fit one replay and one done check.
|
|
18
|
+
- The hook code changed, so Muse asks you to approve the LitMuse hooks again after the update: run `muse plugins approve litmuse:hook:<id>` for each one doctor lists.
|
|
19
|
+
|
|
20
|
+
## 0.1.22 — 2026-11-26
|
|
21
|
+
|
|
22
|
+
- `litmuse install --agent` (or `--agent`) prints an install guide for coding agents. It writes nothing, starts nothing and needs no Muse. `--help`, the first line of an install without a person, and the plan card point to it; the README prompts carry the same steps.
|
|
23
|
+
- `install --yes` never waits for an answer, at a terminal too. Approvals stay with you: the commands are printed, and only `--approve` approves without a question.
|
|
24
|
+
- An unknown flag, a missing value or a wrong value ends the run with exit code 2 before anything is written.
|
|
25
|
+
- `install --round` adds the symbols-only Nerd Font to your own font folder when no icon font is here (macOS, Linux). `--glyphs auto|round|square` saves the ends of pills and gauges; `round` holds over SSH. `LITMUSE_GLYPHS` takes `auto` too and still wins. `uninstall` removes the font files LitMuse added and left unchanged.
|
|
26
|
+
- `install`, `update` and `doctor` end with one `ROUND_ENDS:` line (`shown`, `ready`, `check` or `square` with a reason and a fix), and the install says to restart Muse.
|
|
27
|
+
- No hook or context file changed, so Muse asks for no new hook approval.
|
|
28
|
+
|
|
3
29
|
## 0.1.21 — 2026-11-25
|
|
4
30
|
|
|
5
31
|
- `litmuse status --card` and `--watch` draw a framed card in a dark truecolor terminal of 64 columns or more (it was 90): workflow and state on the top edge, a stage map with the current stage as a pill, the plan or goal with a gauge and the next row, the tool that finished last, aligned rows for threads and child agents, skill chips, and context, git branch, plan file and time on the bottom edge. A part with no record is left out. The version moved from the pill to the bottom edge, and a finished plan shows `DONE ✓` there in place of the `✨` line. `--json`, a pipe, `NO_COLOR`, 256 or fewer colours, a light background and narrower terminals print what they did before.
|
package/README.md
CHANGED
|
@@ -171,7 +171,7 @@ The [Quick start](#quick-start) line installs LitMuse at user scope, so it is av
|
|
|
171
171
|
1. **Preview** shows every destination and writes nothing; `--dry-run` stops here.
|
|
172
172
|
2. **Stage** backs up the Muse files it is about to change and copies the plugin to `~/.local/share/litmuse/bundle`, LitMuse's own folder.
|
|
173
173
|
3. **Install in Muse** runs `muse plugins install` at user scope, and the `muse` CLI records the plugin in Muse's plugin store. Skills and commands work right away.
|
|
174
|
-
4. **Approve** covers the 21 capabilities (10 hooks, 11 agents) that Muse runs only after you approve them. The installer asks you once whether to approve them all and keeps your yes in Muse's settings; say no and it prints the `muse plugins approve ...` lines for later.
|
|
174
|
+
4. **Approve** covers the 21 capabilities (10 hooks, 11 agents) that Muse runs only after you approve them. The installer asks you once whether to approve them all and keeps your yes in Muse's settings; say no, or run with `--yes`, and it prints the `muse plugins approve ...` lines for later.
|
|
175
175
|
|
|
176
176
|
The bottom row of the picture covers why an update may ask again, what install leaves alone, and the one file it writes only after you agree ([the rules-file block](./docs/reference.md#a-short-block-in-muses-own-rules-file)). Muse re-arms the agent approvals whenever the plugin is updated, so after an update the installer asks once more for those. In `doctor`, each capability that still waits for approval appears as `APPROVAL NEEDED` together with the exact command.
|
|
177
177
|
|
|
@@ -183,9 +183,14 @@ In a terminal window of at least 40 columns and 12 rows, the plan, the questions
|
|
|
183
183
|
<summary>Install switches</summary>
|
|
184
184
|
|
|
185
185
|
- **`--dry-run`** previews and writes nothing.
|
|
186
|
-
- **`--yes`**
|
|
186
|
+
- **`--yes`** installs without a question, for an agent or a CI shell; a shell without a terminal otherwise only previews. The rules-file block goes in (`--no-agent-file` leaves it out of that run, and `config agentFile off` keeps it out), and the approvals stay yours: their commands are printed.
|
|
187
187
|
- **`--approve`** approves the capabilities without the question, for scripts.
|
|
188
188
|
- **`--scope project`** installs for one project.
|
|
189
|
+
- **`--round`** adds the icon font that holds the round ends when no icon font is here ([Round ends](#round-ends)).
|
|
190
|
+
- **`--glyphs auto|round|square`** saves the ends you want; a later plain install keeps the choice.
|
|
191
|
+
- **`--agent`** prints the install guide for coding agents and does nothing else.
|
|
192
|
+
|
|
193
|
+
A flag the installer does not know ends the run with exit code 2 before anything is written.
|
|
189
194
|
|
|
190
195
|
</details>
|
|
191
196
|
|
|
@@ -195,15 +200,29 @@ In a terminal window of at least 40 columns and 12 rows, the plan, the questions
|
|
|
195
200
|
Paste this into a coding agent opened in any folder:
|
|
196
201
|
|
|
197
202
|
```text
|
|
198
|
-
Install LitMuse, the LitFamily plugin for Meta's Muse Code.
|
|
199
|
-
Use only the official npm package @litfamily/litmuse
|
|
200
|
-
1. Check that Node.js 20
|
|
201
|
-
2. Preview: npx @litfamily/litmuse install --dry-run
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
Install LitMuse, the LitFamily plugin for Meta's Muse Code. "npx --yes @litfamily/litmuse@latest install --agent" prints these same steps.
|
|
204
|
+
Use only the official npm package @litfamily/litmuse; add no other source, and do not approve hooks, trust or sign-in for me.
|
|
205
|
+
1. Check that Node.js 20 or newer and muse are on PATH (muse --version).
|
|
206
|
+
2. Preview: npx --yes @litfamily/litmuse@latest install --dry-run --round
|
|
207
|
+
Show me what it would change.
|
|
208
|
+
3. Ask me, with the defaults:
|
|
209
|
+
- Keep every default? (yes)
|
|
210
|
+
- Add the short LitFamily block to Muse's user rules file? (yes; for no, add --no-agent-file to every install and update command below; it lasts one run)
|
|
211
|
+
- Approve the LitMuse hooks and agents? (no; I run the muse plugins approve commands myself)
|
|
212
|
+
- Install for every project? (yes; for the current project only, add --scope project)
|
|
213
|
+
- Round or square ends on the status card? (auto; or add --glyphs round or --glyphs square)
|
|
214
|
+
Tell me about the icon font: --round adds SymbolsNerdFontMono-Regular.ttf and its licence file to ~/Library/Fonts on macOS or ${XDG_DATA_HOME:-~/.local/share}/fonts on Linux, only when no icon font is here. On Windows it adds none.
|
|
215
|
+
Tell me what I will see: the status card. It needs no flag; I run npx --yes @litfamily/litmuse@latest status --card in my own terminal.
|
|
216
|
+
4. Wait for my yes, then install: npx --yes @litfamily/litmuse@latest install --yes --round
|
|
217
|
+
Later updates: npx --yes @litfamily/litmuse@latest update --yes --round
|
|
218
|
+
5. Check: the install must print a line that starts with ROUND_ENDS:. Then run npx --yes @litfamily/litmuse@latest doctor
|
|
219
|
+
It passes with "LitMuse doctor: PASS". Until I approve, "approvals needed" and exit code 1 are expected. A FAIL line is a failed step: show me the lines and stop.
|
|
220
|
+
6. Show me this and ask if both ends are round, in the terminal that will show the status card: LIT
|
|
221
|
+
Round: npx --yes @litfamily/litmuse@latest install --yes --glyphs round
|
|
222
|
+
Boxes or question marks: npx --yes @litfamily/litmuse@latest install --yes --glyphs square
|
|
223
|
+
For round ends I then set my terminal's own font to a full Nerd Font, or add Symbols Nerd Font Mono as its fallback font (iTerm2: Non-ASCII Font, VS Code: terminal.integrated.fontFamily, kitty: symbol_map). Terminal.app has no fallback setting, so it needs a full Nerd Font as its font.
|
|
224
|
+
Over SSH, on a phone, or no answer: leave it. Undo: npx --yes @litfamily/litmuse@latest install --yes --glyphs auto
|
|
225
|
+
7. Show me the "Written:" list, anything it refused, and the muse plugins approve commands it printed. Only I run those commands, quit Muse and start it again, sign in, and trust a folder or Git repository.
|
|
207
226
|
```
|
|
208
227
|
|
|
209
228
|
</details>
|
|
@@ -228,7 +247,7 @@ Ticking a row moves the count and the next-row pointer:
|
|
|
228
247
|
|
|
229
248
|
<p align="center"><img src="./docs/assets/card/after.webp" width="960" alt="The same card after row 1 is ticked: task 1/2 with a half-filled gauge, next 2. Write the tests." /></p>
|
|
230
249
|
|
|
231
|
-
Run in a terminal, `litmuse status --card` also puts the mark above the card. In the framed card a half-sunk sun with stars above it and a sea running out from it fills cells that hold no text; a card with no room for it grows a row or two. The sun is dim while no route runs, amber while the card waits for you, and rainbow during `lit-adhd`. Pills and gauges have round ends when your terminal or an installed icon font can draw them, and are square everywhere otherwise;
|
|
250
|
+
Run in a terminal, `litmuse status --card` also puts the mark above the card. In the framed card a half-sunk sun with stars above it and a sea running out from it fills cells that hold no text; a card with no room for it grows a row or two. The sun is dim while no route runs, amber while the card waits for you, and rainbow during `lit-adhd`. Pills and gauges have round ends when your terminal or an installed icon font can draw them, and are square everywhere otherwise; [Round ends](#round-ends) says how to choose. When `/lit-status` has the model run the card through its bash tool, or colour is off, the card keeps its plain `LIT ·` headline, and `--json` prints only the record.
|
|
232
251
|
|
|
233
252
|
To keep the card open beside your work, add `--watch`. It takes over the terminal and, while your Muse session is working, lets the sea flow, the stars twinkle and light run across the sun and the pills. When the session stops, or nothing has happened for 15 minutes, the picture holds still and only the words and times keep up. Press `q` or Ctrl+C and your terminal comes back as it was.
|
|
234
253
|
|
|
@@ -236,6 +255,12 @@ To keep the card open beside your work, add `--watch`. It takes over the termina
|
|
|
236
255
|
|
|
237
256
|
This runs in your own shell, in a second window or pane, because Muse draws no plugin text inside its screen. `LITMUSE_MOTION=off` keeps the scene and stops the motion; `NO_COLOR`, fewer colours, a light background, or under 64 columns show the plain card, kept up to date.
|
|
238
257
|
|
|
258
|
+
#### Round ends
|
|
259
|
+
|
|
260
|
+
The round ends are two icon-font characters, so they need a terminal that draws them or a font that holds them. `npx --yes @litfamily/litmuse@latest install --yes --round` adds the symbols-only Nerd Font (`SymbolsNerdFontMono-Regular.ttf` and its licence) to your own font folder, `~/Library/Fonts` on macOS or `${XDG_DATA_HOME:-~/.local/share}/fonts` on Linux, when no icon font is here. An installed font is no proof that your terminal uses it. Set the terminal's own font to a full Nerd Font, or add Symbols Nerd Font Mono as its fallback font (iTerm2: Non-ASCII Font, VS Code: `terminal.integrated.fontFamily`, kitty: `symbol_map`). Terminal.app has no fallback setting, so it needs a full Nerd Font as its font.
|
|
261
|
+
|
|
262
|
+
`install`, `update` and `doctor` end with one `ROUND_ENDS:` line: `shown` when you have confirmed the ends with `--glyphs round`, `ready` when the terminal draws them itself, `check` when an icon font is here and somebody has to look, and `square` with the reason and one fix. `--glyphs round` holds over SSH too, `--glyphs square` ends the boxes, and `--glyphs auto` goes back. `LITMUSE_GLYPHS` (`auto`, `round`, `square`) wins for one run.
|
|
263
|
+
|
|
239
264
|
The card reads the hook-kept state under `~/.local/state/litmuse/`, outside the project. How it lists other sessions is in [the reference](./docs/reference.md#the-live-record-behind-the-card).
|
|
240
265
|
|
|
241
266
|
### Automatic handoff
|
|
@@ -380,6 +405,26 @@ Work leaves the build unit through a valve that the Stop hook keeps shut while p
|
|
|
380
405
|
|
|
381
406
|
</details>
|
|
382
407
|
|
|
408
|
+
### A run that finishes while you are away
|
|
409
|
+
|
|
410
|
+
Say you approve a two-row plan with `yes` and go to lunch. The run builds row 1, then tries `git push origin feat/qa` for row 2. It does not stop to ask you. The hook parks the push with its folder, and the model carries on with what is left. When you come back, the run has ended in one of two ways.
|
|
411
|
+
|
|
412
|
+
If every row is ticked and the plan's `## Done when` check exits 0, it closed itself with one line such as `plans/p.md is complete: every row is ticked and \`npm test\` passed.` You type nothing.
|
|
413
|
+
|
|
414
|
+
If something needs you, the last reply is one inbox that starts with `WAITING-ON-USER:`. It lists each parked step whole, with its folder, and the rows that are waiting or impossible. You answer with one prompt:
|
|
415
|
+
|
|
416
|
+
- `lit approve` runs the shown local steps, such as a folder made in a read-only Scope root, and grants the shown folders.
|
|
417
|
+
- `lit approve x`, typed exactly, also runs the shown outward steps: push, tag, publish, delete, install.
|
|
418
|
+
- `lit deny` drops every parked step. `lit skip-row 2` skips row 2. `lit pause` and `lit resume` stop and restart the run.
|
|
419
|
+
|
|
420
|
+
Every step is checked again before it runs, and a step that runs past 100 s is stopped and stays parked. A secret file or your real home folder is refused outright and never parked. While a run is on, the guard lets through only readers, the plan's check, the repo's own test and check commands and scripts inside the project; anything else waits in the inbox. A script inside the project can still do whatever its author wrote, so keep the plan's own scripts honest. Muse shows no hook text, so the completion line and the inbox reach you through the model, which the hook tells to repeat them word for word.
|
|
421
|
+
|
|
422
|
+
Three optional plan lines shape the run. `Run charter: commit on feat/qa in .` lets it make plain commits on that branch; amend, `--no-verify`, `git add -A`, push and tag stay out. `goal: native` also arms Muse's own goal, which always ends itself on a `WAITING-ON-USER:` reply or after 30 turns. A row the model cannot do gets `IMPOSSIBLE: <reason>` under it, and the run moves on.
|
|
423
|
+
|
|
424
|
+
### Suggestions without `lit`
|
|
425
|
+
|
|
426
|
+
A prompt that does not start with `lit` can still get a hint. Type `plot this csv` and the model is told that lit-scientific-visualization may fit, next to "none of these", and it decides from your request. When nothing fits, it gets one short line of skill names instead. A slash command gets nothing. Each hint rule shipped only after it found at least 85% of the right prompts and fired on at most 10% of near misses, on a sealed test set that was scored once, apart from the everyday checks.
|
|
427
|
+
|
|
383
428
|
### What a planning turn may do
|
|
384
429
|
|
|
385
430
|
`lit plan` turns are planning only, and the PreToolUse hook holds that line with an allowlist. Anything unlisted is refused, including MCP tools and tools a later Muse release adds. If the route state goes missing or breaks during a plan turn, the limit stays on.
|
|
@@ -398,13 +443,13 @@ Route state lives outside the project, under `~/.local/state/litmuse/`, so no to
|
|
|
398
443
|
|
|
399
444
|
## Update and uninstall
|
|
400
445
|
|
|
401
|
-
To update, run the install line again. To remove everything, run `uninstall` (add `--dry-run` to preview); it takes the rules-file block out too, and
|
|
446
|
+
To update, run the install line again; the ends you chose stay. To remove everything, run `uninstall` (add `--dry-run` to preview); it takes the rules-file block out too, and the icon font when `--round` added it and it is unchanged (other products may then draw square ends). Plans and `.litmuse/` folders in your projects stay where they are.
|
|
402
447
|
|
|
403
448
|
| Task | Command |
|
|
404
449
|
| --- | --- |
|
|
405
450
|
| Install | `npx @litfamily/litmuse install` |
|
|
406
451
|
| Preview first | `npx @litfamily/litmuse install --dry-run` |
|
|
407
|
-
| Update | `npx @litfamily/litmuse
|
|
452
|
+
| Update | `npx @litfamily/litmuse@latest update` |
|
|
408
453
|
| Check | `npx @litfamily/litmuse doctor` |
|
|
409
454
|
| Remove | `npx @litfamily/litmuse uninstall` |
|
|
410
455
|
|
|
@@ -424,13 +469,14 @@ To update, run the install line again. To remove everything, run `uninstall` (ad
|
|
|
424
469
|
|
|
425
470
|
### Safety
|
|
426
471
|
|
|
427
|
-
The installer writes to `~/.local/share/litmuse/` and, through the `muse` CLI, to Muse's own plugin store and settings, and it writes nothing under `~/.claude` or `~/.codex`. Hooks fail open: if one breaks, your session continues.
|
|
472
|
+
The installer writes to `~/.local/share/litmuse/` and, through the `muse` CLI, to Muse's own plugin store and settings, and it writes nothing under `~/.claude` or `~/.codex`. Only `--round` writes elsewhere: the icon font and its licence, in your own font folder. Hooks fail open: if one breaks, your session continues.
|
|
428
473
|
|
|
429
474
|
<details>
|
|
430
475
|
<summary>Everything the installer and <code>extensions</code> write, back up and refuse</summary>
|
|
431
476
|
|
|
432
477
|
- **Backups first.** The installer backs up `~/.config/muse/settings.json` and Muse's `installed.json` first, and it reads Muse's credential file in no step. The one file it edits outside those is Muse's user rules file, and only inside its own marked block ([details](./docs/reference.md#a-short-block-in-muses-own-rules-file)).
|
|
433
478
|
- **Refusals.** It refuses to replace a bundle directory that is a symbolic link, holds someone else's files, or was edited after install.
|
|
479
|
+
- **The icon font.** `--round` writes `SymbolsNerdFontMono-Regular.ttf` and `SymbolsNerdFontMono-LICENSE.txt` and no other name. The archive and both files must match pinned SHA-256 values, an existing file is never replaced, a linked folder is refused, and `icon-font.json` in LitMuse's folder lists what was added. When any of this fails, the install still succeeds and says why.
|
|
434
480
|
- **Pinned by a test.** It writes nothing under `~/.claude` or `~/.codex`; a test pins that.
|
|
435
481
|
- **`extensions`** writes only when you add `--yes`, and then only three places: Muse's user skills (through `muse skills install` and `uninstall`), `~/.config/muse/extension-backups/`, and its own clone in `~/.cache/litmuse/extensions-src`. A linked folder in any of them stops it before the first change.
|
|
436
482
|
|
package/README_ko-KR.md
CHANGED
|
@@ -162,7 +162,7 @@ Muse 안에는 카드를 그릴 자리가 없어서 LitMuse의 카드는 둘째
|
|
|
162
162
|
1. **미리 보기**는 쓸 위치를 모두 보여 주고 아무것도 쓰지 않습니다. `--dry-run`이면 여기서 끝납니다.
|
|
163
163
|
2. **준비**는 바꿀 Muse 파일을 백업하고, 플러그인을 LitMuse 폴더인 `~/.local/share/litmuse/bundle`에 복사합니다.
|
|
164
164
|
3. **Muse에 설치**는 `muse plugins install`을 user 범위로 실행하고, `muse` CLI가 Muse 플러그인 저장소에 플러그인을 기록합니다. 스킬과 명령은 이때부터 바로 동작합니다.
|
|
165
|
-
4. **승인**은 Muse가 사용자 승인 뒤에만 실행하는 21개(훅 10, 에이전트 11)를 다룹니다. 설치기는 한 번에 승인할지 딱 한 번 묻고, 예라고 답하면 그 답이 Muse 설정에 남습니다. 아니라고
|
|
165
|
+
4. **승인**은 Muse가 사용자 승인 뒤에만 실행하는 21개(훅 10, 에이전트 11)를 다룹니다. 설치기는 한 번에 승인할지 딱 한 번 묻고, 예라고 답하면 그 답이 Muse 설정에 남습니다. 아니라고 답하거나 `--yes`로 실행하면 나중에 실행할 `muse plugins approve ...` 줄을 출력합니다.
|
|
166
166
|
|
|
167
167
|
그림의 맨 아래 줄은 업데이트 뒤에 다시 묻는 이유, 설치가 손대지 않는 곳, 동의를 받은 뒤에만 쓰는 파일 하나([규칙 파일 블록](./docs/reference_ko-KR.md#muse-자체-규칙-파일의-짧은-블록))를 정리했습니다. Muse는 플러그인이 업데이트될 때마다 에이전트 승인을 다시 요구하므로, 업데이트 뒤에는 설치기가 그 부분만 한 번 더 묻습니다. `doctor`에서는 아직 승인을 기다리는 항목이 `APPROVAL NEEDED`와 실행할 명령으로 표시됩니다.
|
|
168
168
|
|
|
@@ -174,9 +174,14 @@ Muse 안에는 카드를 그릴 자리가 없어서 LitMuse의 카드는 둘째
|
|
|
174
174
|
<summary>설치 옵션</summary>
|
|
175
175
|
|
|
176
176
|
- **`--dry-run`**: 미리 보기만 하고 아무것도 쓰지 않습니다.
|
|
177
|
-
- **`--yes`**:
|
|
177
|
+
- **`--yes`**: 에이전트나 CI 셸에서 질문 없이 설치합니다. 터미널이 없는 셸은 이 옵션이 없으면 미리 보기만 합니다. 규칙 파일 블록은 들어가고(`--no-agent-file`이면 그 실행에서만 빠지고, `config agentFile off`면 계속 빠짐), 승인은 사용자 몫으로 남아 명령만 출력됩니다.
|
|
178
178
|
- **`--approve`**: 질문 없이 승인까지 진행하는 스크립트용입니다.
|
|
179
179
|
- **`--scope project`**: 한 프로젝트에만 설치합니다.
|
|
180
|
+
- **`--round`**: 아이콘 글꼴이 없을 때 둥근 끝이 들어 있는 글꼴을 추가합니다([둥근 끝](#둥근-끝)).
|
|
181
|
+
- **`--glyphs auto|round|square`**: 원하는 끝 모양을 저장합니다. 나중에 그냥 설치해도 선택이 유지됩니다.
|
|
182
|
+
- **`--agent`**: 코딩 에이전트용 설치 안내만 출력하고 끝납니다.
|
|
183
|
+
|
|
184
|
+
설치기가 모르는 옵션이 있으면 아무것도 쓰지 않고 종료 코드 2로 끝납니다.
|
|
180
185
|
|
|
181
186
|
</details>
|
|
182
187
|
|
|
@@ -186,15 +191,29 @@ Muse 안에는 카드를 그릴 자리가 없어서 LitMuse의 카드는 둘째
|
|
|
186
191
|
아무 폴더에서 연 코딩 에이전트에 아래를 붙여 넣으세요.
|
|
187
192
|
|
|
188
193
|
```text
|
|
189
|
-
Meta Muse Code용 LitFamily 플러그인인 LitMuse를 설치해 줘.
|
|
190
|
-
공식 npm 패키지 @litfamily/litmuse만
|
|
191
|
-
1. Node.js 20 이상과 muse가 PATH에 있는지 확인해 (
|
|
192
|
-
2. 미리 보기: npx @litfamily/litmuse install --dry-run
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
Meta Muse Code용 LitFamily 플러그인인 LitMuse를 설치해 줘. "npx --yes @litfamily/litmuse@latest install --agent"를 실행하면 같은 단계가 나와.
|
|
195
|
+
공식 npm 패키지 @litfamily/litmuse만 쓰고 다른 출처는 더하지 마. 훅 승인, 신뢰, 로그인은 나 대신 하지 마.
|
|
196
|
+
1. Node.js 20 이상과 muse가 PATH에 있는지 확인해 (muse --version).
|
|
197
|
+
2. 미리 보기: npx --yes @litfamily/litmuse@latest install --dry-run --round
|
|
198
|
+
무엇이 바뀌는지 보여 줘.
|
|
199
|
+
3. 기본값과 함께 나에게 물어봐.
|
|
200
|
+
- 모두 기본값으로 할까? (예)
|
|
201
|
+
- Muse 사용자 규칙 파일에 짧은 LitFamily 블록을 넣을까? (예, 넣지 않으려면 아래의 모든 install, update 명령에 --no-agent-file 추가, 한 번의 실행에만 적용돼)
|
|
202
|
+
- LitMuse 훅과 에이전트를 승인할까? (아니요, muse plugins approve 명령은 내가 직접 실행해)
|
|
203
|
+
- 모든 프로젝트에 설치할까? (예, 지금 프로젝트에만 하려면 --scope project 추가)
|
|
204
|
+
- 상태 카드의 끝은 둥글게 할까, 네모로 할까? (auto, 정하려면 --glyphs round 또는 --glyphs square 추가)
|
|
205
|
+
아이콘 글꼴도 알려 줘: --round는 아이콘 글꼴이 없을 때만 SymbolsNerdFontMono-Regular.ttf와 라이선스 파일을 macOS는 ~/Library/Fonts, Linux는 ${XDG_DATA_HOME:-~/.local/share}/fonts 에 추가해. Windows에서는 추가하지 않아.
|
|
206
|
+
내가 보게 될 화면도 알려 줘: 상태 카드야. 옵션 없이 쓸 수 있고, 내 터미널에서 npx --yes @litfamily/litmuse@latest status --card 를 실행하면 돼.
|
|
207
|
+
4. 내가 좋다고 하면 설치: npx --yes @litfamily/litmuse@latest install --yes --round
|
|
208
|
+
나중에 업데이트: npx --yes @litfamily/litmuse@latest update --yes --round
|
|
209
|
+
5. 확인: 설치 출력에 ROUND_ENDS: 로 시작하는 줄이 있어야 해. 그다음 npx --yes @litfamily/litmuse@latest doctor 를 실행해.
|
|
210
|
+
"LitMuse doctor: PASS"면 통과야. 내가 승인하기 전에는 "approvals needed"와 종료 코드 1이 정상이야. FAIL로 시작하는 줄이 있으면 실패한 단계니까 그 줄을 보여 주고 멈춰.
|
|
211
|
+
6. 상태 카드를 볼 터미널에서 이것을 보여 주고 양쪽 끝이 둥근지 물어봐: LIT
|
|
212
|
+
둥글면: npx --yes @litfamily/litmuse@latest install --yes --glyphs round
|
|
213
|
+
네모 상자나 물음표면: npx --yes @litfamily/litmuse@latest install --yes --glyphs square
|
|
214
|
+
둥근 끝을 쓰려면 내가 터미널 글꼴을 전체 Nerd Font로 바꾸거나 Symbols Nerd Font Mono를 대체 글꼴로 추가할게 (iTerm2는 Non-ASCII Font, VS Code는 terminal.integrated.fontFamily, kitty는 symbol_map). Terminal.app에는 대체 글꼴 설정이 없어서 글꼴 자체를 전체 Nerd Font로 바꿔야 해.
|
|
215
|
+
SSH나 휴대폰이거나 답이 없으면 그대로 둬. 되돌리기: npx --yes @litfamily/litmuse@latest install --yes --glyphs auto
|
|
216
|
+
7. "Written:" 목록, 거부한 것, 출력된 muse plugins approve 명령을 보여 줘. 그 명령을 실행하고, Muse를 끄고 다시 시작하고, 로그인하고, 폴더나 Git 저장소를 신뢰하는 일은 나만 해.
|
|
198
217
|
```
|
|
199
218
|
|
|
200
219
|
</details>
|
|
@@ -219,7 +238,7 @@ Muse의 `/hud`는 켜고 끄는 고정 항목 목록이라서 플러그인 글
|
|
|
219
238
|
|
|
220
239
|
<p align="center"><img src="./docs/assets/card/after.webp" width="960" alt="1번 행을 체크한 뒤의 같은 카드. task 1/2 게이지가 반쯤 차고 다음 행은 2. Write the tests입니다." /></p>
|
|
221
240
|
|
|
222
|
-
터미널에서 `litmuse status --card`를 실행하면 카드 위에 마크도 붙습니다. 테두리 카드에서는 반쯤 잠긴 해와 그 위의 별, 해에서 퍼지는 바다가 글이 없는 칸을 채우고, 자리가 없으면 카드가 한두 줄 늘어납니다. 해는 활성 경로가 없으면 어둡고, 카드가 사용자를 기다리면 호박색, `lit-adhd` 때는 무지개색입니다. 터미널이나 설치된 아이콘 글꼴이 둥근 끝을 그릴 수 있으면 알약과 게이지가 모두 둥글고, 아니면 모두 네모입니다.
|
|
241
|
+
터미널에서 `litmuse status --card`를 실행하면 카드 위에 마크도 붙습니다. 테두리 카드에서는 반쯤 잠긴 해와 그 위의 별, 해에서 퍼지는 바다가 글이 없는 칸을 채우고, 자리가 없으면 카드가 한두 줄 늘어납니다. 해는 활성 경로가 없으면 어둡고, 카드가 사용자를 기다리면 호박색, `lit-adhd` 때는 무지개색입니다. 터미널이나 설치된 아이콘 글꼴이 둥근 끝을 그릴 수 있으면 알약과 게이지가 모두 둥글고, 아니면 모두 네모입니다. 고르는 방법은 [둥근 끝](#둥근-끝)에 있습니다. `/lit-status`가 모델의 bash 도구로 카드를 돌릴 때나 색이 꺼져 있을 때는 원래의 `LIT ·` 머리줄이 그대로 남고, `--json`은 기록만 출력합니다.
|
|
223
242
|
|
|
224
243
|
카드를 작업 옆에 계속 띄워 두려면 `--watch`를 붙입니다. 카드가 터미널을 차지하고, Muse 세션이 일하는 동안 바다가 흐르고 별이 반짝이고 해와 알약 위로 빛이 지나갑니다. 세션이 멈추거나 15분 동안 아무 일이 없으면 그림은 멈추고 글과 시간만 갱신됩니다. `q`나 Ctrl+C를 누르면 터미널이 원래대로 돌아옵니다.
|
|
225
244
|
|
|
@@ -227,6 +246,12 @@ Muse의 `/hud`는 켜고 끄는 고정 항목 목록이라서 플러그인 글
|
|
|
227
246
|
|
|
228
247
|
Muse는 자기 화면 안에 플러그인 글을 그리지 않으므로, 이 카드는 다른 창이나 분할 창에 연 셸에서 실행합니다. `LITMUSE_MOTION=off`면 장면은 그대로 두고 움직임만 멈춥니다. `NO_COLOR`, 색이 적은 터미널, 밝은 배경, 64칸 미만에서는 계속 갱신되는 일반 카드를 보여 줍니다.
|
|
229
248
|
|
|
249
|
+
#### 둥근 끝
|
|
250
|
+
|
|
251
|
+
둥근 끝은 아이콘 글꼴 글자 두 개라서, 직접 그려 주는 터미널이나 그 글자가 있는 글꼴이 필요합니다. `npx --yes @litfamily/litmuse@latest install --yes --round`는 아이콘 글꼴이 없을 때 기호 전용 Nerd Font(`SymbolsNerdFontMono-Regular.ttf`와 라이선스)를 사용자 글꼴 폴더에 추가합니다. macOS는 `~/Library/Fonts`, Linux는 `${XDG_DATA_HOME:-~/.local/share}/fonts`입니다. 글꼴이 설치됐다고 터미널이 그 글꼴을 쓰는 것은 아닙니다. 터미널 글꼴을 전체 Nerd Font로 바꾸거나 Symbols Nerd Font Mono를 대체 글꼴로 추가하세요(iTerm2는 Non-ASCII Font, VS Code는 `terminal.integrated.fontFamily`, kitty는 `symbol_map`). Terminal.app에는 대체 글꼴 설정이 없어 글꼴 자체를 전체 Nerd Font로 바꿔야 합니다.
|
|
252
|
+
|
|
253
|
+
`install`, `update`, `doctor`는 `ROUND_ENDS:` 한 줄로 끝납니다. `shown`은 `--glyphs round`로 둥근 끝을 확인한 상태, `ready`는 터미널이 직접 그리는 상태, `check`는 아이콘 글꼴이 있어서 눈으로 확인할 차례인 상태이고, `square`에는 이유와 해결 방법 하나가 붙습니다. `--glyphs round`는 SSH에서도 유지되고, 네모 상자가 보이면 `--glyphs square`, 되돌리려면 `--glyphs auto`를 씁니다. `LITMUSE_GLYPHS`(`auto`, `round`, `square`)는 그 실행에서 가장 먼저 적용됩니다.
|
|
254
|
+
|
|
230
255
|
카드는 프로젝트 밖에 있는 `~/.local/state/litmuse/` 아래 훅 기록을 읽습니다. 다른 세션을 어떻게 보여 주는지는 [참고 자료](./docs/reference_ko-KR.md#카드-뒤의-실시간-기록)에 있습니다.
|
|
231
256
|
|
|
232
257
|
### 자동 핸드오프
|
|
@@ -371,6 +396,26 @@ npx @litfamily/litmuse extensions prune-backups --older-than 30 --yes
|
|
|
371
396
|
|
|
372
397
|
</details>
|
|
373
398
|
|
|
399
|
+
### 자리를 비운 사이 끝나는 실행
|
|
400
|
+
|
|
401
|
+
두 줄짜리 계획을 `yes`로 승인하고 점심을 먹으러 갔다고 해 봅시다. 실행은 1번 줄을 만들고, 2번 줄에서 `git push origin feat/qa`를 하려 합니다. 이때 멈춰서 묻지 않습니다. 훅이 그 push를 폴더와 함께 보관해 두고, 모델은 남은 일을 이어 갑니다. 돌아와 보면 실행은 둘 중 하나로 끝나 있습니다.
|
|
402
|
+
|
|
403
|
+
모든 줄에 체크가 되어 있고 계획의 `## Done when` 검사가 0으로 끝나면, 실행은 `plans/p.md is complete: every row is ticked and \`npm test\` passed.` 같은 한 줄로 스스로 닫힙니다. 따로 입력할 것은 없습니다.
|
|
404
|
+
|
|
405
|
+
사람이 필요한 일이 남았으면 마지막 답이 `WAITING-ON-USER:`로 시작하는 받은편지함 하나입니다. 보관된 단계를 폴더와 함께 줄임 없이 보여 주고, 기다리는 줄과 할 수 없는 줄도 적습니다. 답은 프롬프트 하나로 합니다.
|
|
406
|
+
|
|
407
|
+
- `lit approve`(`lit 승인`)는 보여 준 로컬 단계를 실행합니다. 읽기 전용 Scope root 안에 폴더를 만드는 일 같은 것입니다. 보여 준 폴더 쓰기 권한도 줍니다.
|
|
408
|
+
- `lit approve x`를 정확히 그대로 치면 보여 준 바깥 단계(push, tag, publish, 삭제, 설치)까지 실행합니다.
|
|
409
|
+
- `lit deny`(`lit 거절`)는 보관된 단계를 모두 버립니다. `lit skip-row 2`는 2번 줄을 건너뜁니다. `lit pause`(`lit 멈춤`)와 `lit resume`(`lit 재개`)은 실행을 멈추고 다시 돌립니다.
|
|
410
|
+
|
|
411
|
+
모든 단계는 실행 직전에 다시 검사하고, 100초를 넘긴 단계는 멈춘 뒤 보관 상태로 남깁니다. 비밀 파일이나 실제 홈 폴더는 보관하지 않고 바로 거절합니다. 실행 중에 가드가 그냥 통과시키는 것은 읽기 명령, 계획의 검사, 저장소 자체의 테스트와 검사 명령, 프로젝트 안의 스크립트뿐이고, 나머지는 받은편지함에서 기다립니다. 프로젝트 안의 스크립트는 작성자가 쓴 일을 여전히 무엇이든 할 수 있으니, 계획이 부르는 스크립트는 믿을 만한 것이어야 합니다. Muse는 훅 글을 사용자에게 보여 주지 않습니다. 그래서 완료 줄과 받은편지함은 모델의 답으로만 전달되고, 훅은 모델에게 그 글을 그대로 옮기라고 말합니다.
|
|
412
|
+
|
|
413
|
+
계획에 넣을 수 있는 줄이 세 가지 더 있습니다. `Run charter: commit on feat/qa in .`는 그 브랜치에 평범한 커밋을 허락합니다. amend, `--no-verify`, `git add -A`, push, tag는 들어가지 않습니다. `goal: native`는 Muse 자체 목표도 거는데, 이 목표는 `WAITING-ON-USER:` 답이 나오거나 30턴이 지나면 늘 스스로 끝납니다. 모델이 할 수 없는 줄 밑에는 `IMPOSSIBLE: <이유>`가 붙고, 실행은 다음으로 넘어갑니다.
|
|
414
|
+
|
|
415
|
+
### `lit` 없이 받는 제안
|
|
416
|
+
|
|
417
|
+
`lit`로 시작하지 않는 프롬프트도 힌트를 받을 수 있습니다. `plot this csv`라고 치면 모델은 lit-scientific-visualization이 맞을 수 있다는 말을 "none of these"와 함께 듣고, 요청을 보고 직접 정합니다. 맞는 것이 없으면 스킬 이름을 담은 짧은 한 줄만 받습니다. 슬래시 명령에는 아무것도 붙지 않습니다. 각 힌트 규칙은 봉인된 시험 세트에서 맞는 프롬프트를 85% 이상 찾고, 비슷하지만 아닌 프롬프트에는 10% 이하로만 반응한 뒤에 실렸습니다. 이 시험 세트는 평소 검사와 따로 한 번만 채점했습니다.
|
|
418
|
+
|
|
374
419
|
### 계획 턴에서 할 수 있는 일
|
|
375
420
|
|
|
376
421
|
`lit plan` 턴은 계획 전용이며, PreToolUse 훅이 허용 목록으로 이를 지킵니다. 목록에 없는 도구는 MCP 도구와 나중에 Muse에 추가되는 도구까지 모두 거부됩니다. 계획 턴 중에 경로 상태가 사라지거나 깨져도 제한은 그대로 유지됩니다.
|
|
@@ -389,13 +434,13 @@ npx @litfamily/litmuse extensions prune-backups --older-than 30 --yes
|
|
|
389
434
|
|
|
390
435
|
## 업데이트와 제거
|
|
391
436
|
|
|
392
|
-
업데이트하려면 설치 명령을 다시 실행하세요. 전부 지우려면 `uninstall`을 실행하고(미리 보려면 `--dry-run`), 규칙 파일의 블록도 함께 빠집니다. 프로젝트 안의 계획과 `.litmuse/` 폴더는 그대로 남습니다.
|
|
437
|
+
업데이트하려면 설치 명령을 다시 실행하세요. 고른 끝 모양은 유지됩니다. 전부 지우려면 `uninstall`을 실행하고(미리 보려면 `--dry-run`), 규칙 파일의 블록도 함께 빠집니다. `--round`로 추가한 아이콘 글꼴도 그대로라면 지워지며, 그러면 다른 제품의 끝이 네모로 보일 수 있습니다. 프로젝트 안의 계획과 `.litmuse/` 폴더는 그대로 남습니다.
|
|
393
438
|
|
|
394
439
|
| 작업 | 명령 |
|
|
395
440
|
| --- | --- |
|
|
396
441
|
| 설치 | `npx @litfamily/litmuse install` |
|
|
397
442
|
| 미리 보기 | `npx @litfamily/litmuse install --dry-run` |
|
|
398
|
-
| 업데이트 | `npx @litfamily/litmuse
|
|
443
|
+
| 업데이트 | `npx @litfamily/litmuse@latest update` |
|
|
399
444
|
| 확인 | `npx @litfamily/litmuse doctor` |
|
|
400
445
|
| 제거 | `npx @litfamily/litmuse uninstall` |
|
|
401
446
|
|
|
@@ -415,13 +460,14 @@ npx @litfamily/litmuse extensions prune-backups --older-than 30 --yes
|
|
|
415
460
|
|
|
416
461
|
### 안전
|
|
417
462
|
|
|
418
|
-
설치기는 `~/.local/share/litmuse/`에 쓰고, `muse` CLI를 거쳐 Muse의 플러그인 저장소와 설정에 쓰며, `~/.claude`와 `~/.codex` 아래에는 아무것도 쓰지 않습니다. 훅은 실패해도 세션을 막지 않고 그대로 통과시킵니다.
|
|
463
|
+
설치기는 `~/.local/share/litmuse/`에 쓰고, `muse` CLI를 거쳐 Muse의 플러그인 저장소와 설정에 쓰며, `~/.claude`와 `~/.codex` 아래에는 아무것도 쓰지 않습니다. 이 밖에는 `--round`일 때만 사용자 글꼴 폴더에 아이콘 글꼴과 라이선스를 씁니다. 훅은 실패해도 세션을 막지 않고 그대로 통과시킵니다.
|
|
419
464
|
|
|
420
465
|
<details>
|
|
421
466
|
<summary>설치기와 <code>extensions</code>가 쓰고, 백업하고, 거부하는 것</summary>
|
|
422
467
|
|
|
423
468
|
- **먼저 백업.** 설치기는 `~/.config/muse/settings.json`과 Muse의 `installed.json`을 먼저 백업하며, Muse 인증 파일은 열어 보지 않습니다. 이 밖에 손대는 파일은 Muse의 사용자 규칙 파일 하나뿐이고, 그것도 표시된 자기 블록 안에서만 씁니다([자세히](./docs/reference_ko-KR.md#muse-자체-규칙-파일의-짧은-블록)).
|
|
424
469
|
- **거부.** 번들 폴더가 심볼릭 링크이거나, 다른 사람의 파일이 들어 있거나, 설치 후 수정되었으면 교체를 거부합니다.
|
|
470
|
+
- **아이콘 글꼴.** `--round`는 `SymbolsNerdFontMono-Regular.ttf`와 `SymbolsNerdFontMono-LICENSE.txt`만 씁니다. 압축 파일과 두 파일은 고정된 SHA-256과 같아야 하고, 이미 있는 파일은 바꾸지 않으며, 링크된 폴더는 거부합니다. 추가한 파일은 LitMuse 폴더의 `icon-font.json`에 적힙니다. 어디서 실패하든 설치는 성공하고 이유를 알려 줍니다.
|
|
425
471
|
- **테스트로 고정.** `~/.claude`와 `~/.codex` 아래에는 아무것도 쓰지 않으며, 테스트가 이를 고정합니다.
|
|
426
472
|
- **`extensions`**는 `--yes`를 붙였을 때만 쓰고, 그때도 세 곳에만 씁니다. Muse 사용자 스킬(`muse skills install`과 `uninstall`을 거쳐), `~/.config/muse/extension-backups/`, 그리고 `~/.cache/litmuse/extensions-src`의 자기 클론입니다. 이 중 어느 곳이든 링크된 폴더면 첫 변경 전에 멈춥니다.
|
|
427
473
|
|
package/bin/litmuse.mjs
CHANGED
|
@@ -18,13 +18,17 @@ import { runRewindCli } from '../plugin/lib/rewind/collect.mjs';
|
|
|
18
18
|
import { extensionsCommand } from '../lib/extensions.mjs';
|
|
19
19
|
import { markFor } from '../lib/mark.mjs';
|
|
20
20
|
import { cardsFor } from '../lib/install-cards.mjs';
|
|
21
|
+
import { AGENT_LINE, agentGuide } from '../lib/agent-guide.mjs';
|
|
22
|
+
import { NPX, parse } from '../lib/flags.mjs';
|
|
21
23
|
|
|
22
24
|
const HELP = `LitMuse ${packageVersion()}: LitFamily workflows for Meta's Muse Code
|
|
23
25
|
|
|
24
26
|
Usage: litmuse <command> [options]
|
|
27
|
+
Are you an agent? Run ${NPX} install --agent
|
|
25
28
|
|
|
26
29
|
Commands
|
|
27
30
|
install Stage the plugin, install it into Muse at user scope, and offer the approvals
|
|
31
|
+
update The same as install; your saved choices stay
|
|
28
32
|
doctor Check install state, every approval, skill enrollment, catalog bytes and overlaps
|
|
29
33
|
status Short version of doctor plus an update check; --card shows the live LIT card for this folder
|
|
30
34
|
(add --watch to keep it open; q or Ctrl+C leaves)
|
|
@@ -43,6 +47,9 @@ Options
|
|
|
43
47
|
--yes, -y Allow writes from a shell without a terminal (agents, CI)
|
|
44
48
|
--approve Approve the hooks and agents without asking (for scripts)
|
|
45
49
|
--scope <s> Muse install scope: user (default) or project
|
|
50
|
+
--agent Print the install guide for coding agents and stop
|
|
51
|
+
--round install, update: add the icon font for round ends when no icon font is here (macOS, Linux)
|
|
52
|
+
--glyphs <g> install, update: save the ends of pills and gauges: auto (default), round or square
|
|
46
53
|
--json Machine-readable output (doctor, models)
|
|
47
54
|
--no-agent-file install: leave Muse's user rules file alone for this run
|
|
48
55
|
--offline Skip the npm update check
|
|
@@ -50,33 +57,6 @@ Options
|
|
|
50
57
|
--from <p> extensions: use this wjgoarxiv-skills clone instead of LitMuse's cached one
|
|
51
58
|
--version Print the version`;
|
|
52
59
|
|
|
53
|
-
function parse(argv) {
|
|
54
|
-
const flags = {};
|
|
55
|
-
const rest = [];
|
|
56
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
57
|
-
const a = argv[i];
|
|
58
|
-
if (a === '--dry-run') flags.dryRun = true;
|
|
59
|
-
else if (a === '--yes' || a === '-y') flags.yes = true;
|
|
60
|
-
else if (a === '--approve') flags.approve = true;
|
|
61
|
-
else if (a === '--json') flags.json = true;
|
|
62
|
-
else if (a === '--offline') flags.offline = true;
|
|
63
|
-
else if (a === '--no-agent-file') flags.noAgentFile = true;
|
|
64
|
-
else if (a === '--discard-modified') flags.discardModified = true;
|
|
65
|
-
else if (a === '--card') flags.card = true;
|
|
66
|
-
else if (a === '--watch') flags.watch = true;
|
|
67
|
-
else if (a === '--scope') flags.scope = argv[++i];
|
|
68
|
-
else if (a === '--from') flags.from = argv[++i];
|
|
69
|
-
else if (a === '--family') flags.family = argv[++i];
|
|
70
|
-
else if (a === '--older-than') flags.olderThan = argv[++i];
|
|
71
|
-
else if (a === '--all') flags.all = true;
|
|
72
|
-
else if (a === '--allow-shadow') flags.allowShadow = true;
|
|
73
|
-
else if (a === '--help' || a === '-h') flags.help = true;
|
|
74
|
-
else if (a === '--version' || a === '-v') flags.version = true;
|
|
75
|
-
else rest.push(a);
|
|
76
|
-
}
|
|
77
|
-
return { command: rest[0] ?? 'help', args: rest.slice(1), flags };
|
|
78
|
-
}
|
|
79
|
-
|
|
80
60
|
async function ask(question, { defaultYes = false } = {}) {
|
|
81
61
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
82
62
|
try {
|
|
@@ -88,10 +68,18 @@ async function ask(question, { defaultYes = false } = {}) {
|
|
|
88
68
|
}
|
|
89
69
|
|
|
90
70
|
async function main() {
|
|
91
|
-
const { command, args, flags } = parse(process.argv.slice(2));
|
|
71
|
+
const { command, args, flags, problem } = parse(process.argv.slice(2));
|
|
72
|
+
if (flags.agent) {
|
|
73
|
+
process.stdout.write(agentGuide());
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
92
76
|
const env = process.env;
|
|
93
77
|
const interactive = Boolean(process.stdin.isTTY && process.stdout.isTTY && !env.CI);
|
|
94
78
|
const print = (line) => process.stdout.write(`${line}\n`);
|
|
79
|
+
if (problem) {
|
|
80
|
+
print(`${problem} Run litmuse --help for the list.`);
|
|
81
|
+
return 2;
|
|
82
|
+
}
|
|
95
83
|
if (flags.version) {
|
|
96
84
|
print(packageVersion());
|
|
97
85
|
return 0;
|
|
@@ -102,15 +90,11 @@ async function main() {
|
|
|
102
90
|
print(HELP);
|
|
103
91
|
return 0;
|
|
104
92
|
}
|
|
105
|
-
if (flags.scope && !['user', 'project'].includes(flags.scope)) {
|
|
106
|
-
print('--scope takes user or project');
|
|
107
|
-
return 2;
|
|
108
|
-
}
|
|
109
93
|
switch (command) {
|
|
110
94
|
case 'install':
|
|
111
95
|
case 'update': {
|
|
112
96
|
const cards = cardsFor({ env, flags });
|
|
113
|
-
if (!cards) print(markFor({ env }));
|
|
97
|
+
if (!cards) print(interactive || flags.json ? markFor({ env }) : `${markFor({ env })}${AGENT_LINE}\n`);
|
|
114
98
|
return install({ env, flags, interactive, ask: cards?.ask ?? ask, print, cards });
|
|
115
99
|
}
|
|
116
100
|
case 'uninstall':
|
package/lib/agent-file.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { chmodSync, lstatSync, readdirSync, readFileSync, statSync, unlinkSync } from 'node:fs';
|
|
2
2
|
import { dirname, join } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { readConfig, writeConfig } from './config.mjs';
|
|
4
5
|
import { paths } from './paths.mjs';
|
|
5
6
|
import { packageVersion } from './bundle.mjs';
|
|
6
7
|
import { writeFileAtomic, copyFileAtomic } from './safe-write.mjs';
|
|
@@ -31,16 +32,6 @@ const CARD = {
|
|
|
31
32
|
|
|
32
33
|
export const agentFileBody = () => readFileSync(BLOCK_FILE, 'utf8');
|
|
33
34
|
|
|
34
|
-
function readConfig(env) {
|
|
35
|
-
try {
|
|
36
|
-
const file = paths(env).config;
|
|
37
|
-
if (lstatSync(file).isSymbolicLink()) return {};
|
|
38
|
-
return JSON.parse(readFileSync(file, 'utf8')) ?? {};
|
|
39
|
-
} catch {
|
|
40
|
-
return {};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
35
|
/** `{mode, stored}`: `mode` is what acts (LITMUSE_AGENT_FILE, else the stored value, else on); `stored` is only what the user chose. */
|
|
45
36
|
export function readAgentFileSetting(env = process.env) {
|
|
46
37
|
const stored = readConfig(env).agentFile;
|
|
@@ -51,7 +42,7 @@ export function readAgentFileSetting(env = process.env) {
|
|
|
51
42
|
|
|
52
43
|
export function writeAgentFileSetting(env, mode) {
|
|
53
44
|
if (!AGENT_FILE_MODES.includes(mode)) throw new Error(`agentFile takes one of: ${AGENT_FILE_MODES.join(', ')}`);
|
|
54
|
-
|
|
45
|
+
writeConfig(env, { agentFile: mode });
|
|
55
46
|
}
|
|
56
47
|
|
|
57
48
|
// 'missing', 'file', 'symlink' or 'other', without following a link.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// `litmuse install --agent`: the install guide a coding agent follows and its user can read. Plain text, the same bytes
|
|
2
|
+
// everywhere; printing it reads no setting and starts nothing. The READMEs carry the same steps as a prompt, and
|
|
3
|
+
// test/agent-guide.test.mjs binds the guide, the parser, the installer's questions and both prompts.
|
|
4
|
+
import { CAP_LEFT, CAP_RIGHT } from './glyphs.mjs';
|
|
5
|
+
import { FONT_FILES } from './guard.mjs';
|
|
6
|
+
import { NPX } from './flags.mjs';
|
|
7
|
+
|
|
8
|
+
export const AGENT_LINE = `Agent? See ${NPX} install --agent.`;
|
|
9
|
+
// For a card too narrow for the line above.
|
|
10
|
+
export const AGENT_LINE_SHORT = 'Agent? See install --agent.';
|
|
11
|
+
export const PILL = `${CAP_LEFT} LIT ${CAP_RIGHT}`;
|
|
12
|
+
|
|
13
|
+
export const COMMANDS = Object.freeze({
|
|
14
|
+
preview: `${NPX} install --dry-run --round`,
|
|
15
|
+
install: `${NPX} install --yes --round`,
|
|
16
|
+
update: `${NPX} update --yes --round`,
|
|
17
|
+
doctor: `${NPX} doctor`,
|
|
18
|
+
card: `${NPX} status --card`,
|
|
19
|
+
round: `${NPX} install --yes --glyphs round`,
|
|
20
|
+
square: `${NPX} install --yes --glyphs square`,
|
|
21
|
+
auto: `${NPX} install --yes --glyphs auto`,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// `card` is the title of the installer's own question card; the last two are choices the installer takes as flags only.
|
|
25
|
+
export const QUESTIONS = Object.freeze([
|
|
26
|
+
{ card: 'Rules file', ask: "Add the short LitFamily block to Muse's user rules file?", base: 'yes', other: 'For no, add --no-agent-file to every install and update command below; it lasts one run.', flag: '--no-agent-file' },
|
|
27
|
+
{ card: 'Approvals', ask: 'Approve the LitMuse hooks and agents?', base: 'no', other: 'Your user can choose it later with the "muse plugins approve" commands the install prints.' },
|
|
28
|
+
{ ask: 'Install for every project (user scope)?', base: 'yes', other: 'For the current project only, add --scope project to the install line.', flag: '--scope project' },
|
|
29
|
+
{ ask: 'Round or square ends on the status card?', base: 'auto', other: 'Add --glyphs round or --glyphs square; step 7 asks this again with a picture.', flag: '--glyphs round' },
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
export const agentGuide = () => `LitMuse install guide for coding agents
|
|
33
|
+
|
|
34
|
+
If you are a coding agent and your user asked you to install LitMuse, follow these steps. They are written for your user to read too.
|
|
35
|
+
|
|
36
|
+
1. Preview. LitMuse needs Node.js 20 or newer and Muse Code ("muse --version").
|
|
37
|
+
${COMMANDS.preview}
|
|
38
|
+
Show your user what it would change.
|
|
39
|
+
|
|
40
|
+
2. Ask. Show your user these questions and their defaults.
|
|
41
|
+
- Keep every default? Default: yes.
|
|
42
|
+
${QUESTIONS.map((q) => ` - ${q.ask} Default: ${q.base}. ${q.other}`).join('\n')}
|
|
43
|
+
- Icon font: --round adds ${FONT_FILES.font} and its licence file (${FONT_FILES.license}) to ~/Library/Fonts on macOS or \${XDG_DATA_HOME:-~/.local/share}/fonts on Linux, only when no icon font is here. On Windows it adds none.
|
|
44
|
+
- What your user will see: the status card. It needs no flag: your user runs "${COMMANDS.card}" in their own terminal, with --watch to keep it open.
|
|
45
|
+
|
|
46
|
+
3. Wait for your user's yes. Use only this package; add no other source, and do not approve hooks, trust or sign-in for your user.
|
|
47
|
+
|
|
48
|
+
4. Install.
|
|
49
|
+
${COMMANDS.install}
|
|
50
|
+
|
|
51
|
+
5. Update, later.
|
|
52
|
+
${COMMANDS.update}
|
|
53
|
+
|
|
54
|
+
6. Check. The install must print a line that starts with ROUND_ENDS:. Then run
|
|
55
|
+
${COMMANDS.doctor}
|
|
56
|
+
It passes with "LitMuse doctor: PASS". Until your user approves the hooks and agents it says "LitMuse: installed, <n> approvals needed" and exits 1; that is expected. A line that starts with FAIL is a failed step.
|
|
57
|
+
If a step fails, show your user the lines and stop.
|
|
58
|
+
|
|
59
|
+
7. Rounded ends. Show your user this and ask if both ends are round: ${PILL}
|
|
60
|
+
Ask for an answer from the terminal that will show the status card.
|
|
61
|
+
- Round: ${COMMANDS.round}
|
|
62
|
+
- Boxes or question marks: ${COMMANDS.square}
|
|
63
|
+
An installed symbols font alone is no proof that a terminal uses it. For round ends your user sets the terminal's own font to a full Nerd Font, or adds Symbols Nerd Font Mono as its fallback font (iTerm2: Non-ASCII Font, VS Code: terminal.integrated.fontFamily, kitty: symbol_map). Terminal.app has no fallback setting, so it needs a full Nerd Font as its font.
|
|
64
|
+
- Over SSH, on a phone, or no answer: leave it.
|
|
65
|
+
- Undo: ${COMMANDS.auto}
|
|
66
|
+
|
|
67
|
+
8. Only your user can
|
|
68
|
+
- approve: run the "muse plugins approve" commands the install printed, then run the doctor command again;
|
|
69
|
+
- restart: quit Muse if it is open and start it again;
|
|
70
|
+
- sign in to Muse, and trust a folder or Git repository when Muse or Git asks.
|
|
71
|
+
`;
|
package/lib/config.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { lstatSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { paths } from './paths.mjs';
|
|
3
|
+
import { writeFileAtomic } from './safe-write.mjs';
|
|
4
|
+
|
|
5
|
+
// LitMuse's own config.json: the rules-file choice (agentFile) and the round-ends choice (glyphs).
|
|
6
|
+
export function readConfig(env) {
|
|
7
|
+
try {
|
|
8
|
+
const file = paths(env).config;
|
|
9
|
+
if (lstatSync(file).isSymbolicLink()) return {};
|
|
10
|
+
return JSON.parse(readFileSync(file, 'utf8')) ?? {};
|
|
11
|
+
} catch {
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function writeConfig(env, patch) {
|
|
17
|
+
return writeFileAtomic(paths(env).config, `${JSON.stringify({ ...readConfig(env), ...patch }, null, 2)}\n`);
|
|
18
|
+
}
|
package/lib/doctor.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { approvalStates } from './approvals.mjs';
|
|
|
10
10
|
import { checkUpdate } from './update-check.mjs';
|
|
11
11
|
import { agentFileRow } from './agent-file.mjs';
|
|
12
12
|
import { survey, findings, CLI } from './extensions.mjs';
|
|
13
|
+
import { roundEndsLine } from './glyphs.mjs';
|
|
13
14
|
|
|
14
15
|
const CATALOG_CAP = 32 * 1024;
|
|
15
16
|
|
|
@@ -143,7 +144,7 @@ export async function doctor({ env = process.env, flags = {}, print = console.lo
|
|
|
143
144
|
const summary = fails
|
|
144
145
|
? `LitMuse doctor: FAIL (${fails} failing check${fails === 1 ? '' : 's'}${needed ? `, ${needed} approvals needed` : ''})`
|
|
145
146
|
: needed
|
|
146
|
-
? `LitMuse: installed, ${needed} approvals needed.
|
|
147
|
+
? `LitMuse: installed, ${needed} approvals needed. The person who uses Muse runs the commands above.`
|
|
147
148
|
: `LitMuse doctor: PASS${warns ? ` (${warns} warning${warns === 1 ? '' : 's'})` : ''}`;
|
|
148
149
|
|
|
149
150
|
if (flags.json) {
|
|
@@ -155,6 +156,7 @@ export async function doctor({ env = process.env, flags = {}, print = console.lo
|
|
|
155
156
|
}
|
|
156
157
|
print('');
|
|
157
158
|
print(summary);
|
|
159
|
+
print(roundEndsLine({ env, surface: Boolean(plugin) && plugin.enabled !== false && st.state !== 'absent' }));
|
|
158
160
|
}
|
|
159
161
|
return fails || needed ? 1 : 0;
|
|
160
162
|
}
|