@litfamily/litmuse 0.1.20 → 0.1.21
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 +14 -0
- package/README.md +19 -13
- package/README_ko-KR.md +17 -11
- package/bin/litmuse.mjs +7 -4
- package/docs/assets/card/after.webp +0 -0
- package/docs/assets/card/idle.webp +0 -0
- package/docs/assets/card/watch-still.webp +0 -0
- package/docs/assets/card/watch.webp +0 -0
- package/docs/assets/card/working.webp +0 -0
- package/docs/assets/cover-motion-still.webp +0 -0
- package/docs/assets/cover-motion.webp +0 -0
- package/docs/assets/readme/demo.webp +0 -0
- package/lib/agent-file.mjs +16 -2
- package/lib/card-facts.mjs +109 -0
- package/lib/card-view.mjs +35 -74
- package/lib/framed-card.mjs +379 -0
- package/lib/glyphs.mjs +55 -0
- package/lib/install-cards.mjs +401 -0
- package/lib/install.mjs +175 -73
- package/lib/mark.mjs +1 -2
- package/lib/stage-card.mjs +5 -22
- package/lib/sunset.mjs +24 -70
- package/lib/uninstall.mjs +30 -11
- package/package.json +1 -1
- package/plugin/.muse-plugin/plugin.json +1 -1
package/lib/uninstall.mjs
CHANGED
|
@@ -5,20 +5,28 @@ import { stageState } from './bundle.mjs';
|
|
|
5
5
|
import { assertSafeWritePath } from './guard.mjs';
|
|
6
6
|
import { removeAgentFile } from './agent-file.mjs';
|
|
7
7
|
import { packageVersion } from './bundle.mjs';
|
|
8
|
+
import { planRows } from './install-cards.mjs';
|
|
8
9
|
|
|
9
|
-
export async function uninstall({ env = process.env, flags = {}, interactive = false, print = console.log }) {
|
|
10
|
+
export async function uninstall({ env = process.env, flags = {}, interactive = false, print = console.log, cards = null }) {
|
|
10
11
|
const p = paths(env);
|
|
11
12
|
const plugin = installedPlugin(env);
|
|
12
13
|
const st = stageState(p);
|
|
13
|
-
|
|
14
|
-
print(` muse plugin ${plugin ? 'muse plugins remove litmuse (also clears its approvals)' : 'not installed in Muse'}`);
|
|
14
|
+
const pluginLine = plugin ? 'muse plugins remove litmuse (also clears its approvals)' : 'not installed in Muse';
|
|
15
15
|
const discard = st.state === 'modified' && flags.discardModified;
|
|
16
16
|
const bundleLine = st.state === 'owned' || discard
|
|
17
17
|
? `remove ${p.stage}${discard ? ` (discarding edits: ${st.detail})` : ''}`
|
|
18
18
|
: st.state === 'absent' ? 'absent' : `keep ${p.stage} (${st.state}: ${st.detail})`;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const plan = [
|
|
20
|
+
['muse plugin', pluginLine],
|
|
21
|
+
['bundle', bundleLine],
|
|
22
|
+
...(st.state === 'modified' && !discard ? [['hint', 'add --discard-modified to remove the edited bundle too']] : []),
|
|
23
|
+
['kept', `${p.backups} and ${p.receipt}`],
|
|
24
|
+
];
|
|
25
|
+
if (cards) cards.panel({ title: 'LitMuse uninstall', sections: [{ rows: planRows(plan.map(([label, value]) => [label[0].toUpperCase() + label.slice(1), value])) }] });
|
|
26
|
+
else {
|
|
27
|
+
print('LitMuse uninstall');
|
|
28
|
+
for (const [label, value] of plan) print(` ${label.padEnd(14)}${value}`);
|
|
29
|
+
}
|
|
22
30
|
if (flags.dryRun) {
|
|
23
31
|
print(removeAgentFile({ env, version: packageVersion(), dryRun: true }));
|
|
24
32
|
print('Dry run: nothing removed.');
|
|
@@ -31,16 +39,27 @@ export async function uninstall({ env = process.env, flags = {}, interactive = f
|
|
|
31
39
|
if (plugin) {
|
|
32
40
|
const r = muse(env, ['plugins', 'remove', 'litmuse', '--json']);
|
|
33
41
|
if (!r.ok) {
|
|
34
|
-
|
|
42
|
+
const why = `${r.command}: ${(r.stderr || r.stdout).trim().split(/\r?\n/)[0]}`;
|
|
43
|
+
if (cards) cards.row('fail', 'Muse plugin', why);
|
|
44
|
+
else print(`FAIL ${why}`);
|
|
35
45
|
return 1;
|
|
36
46
|
}
|
|
37
|
-
|
|
47
|
+
if (cards) cards.row('done', 'Muse plugin', 'removed from Muse');
|
|
48
|
+
else print('Removed the LitMuse plugin from Muse.');
|
|
38
49
|
}
|
|
39
50
|
if (st.state === 'owned' || discard) {
|
|
40
51
|
rmSync(assertSafeWritePath(p.stage), { recursive: true, force: true });
|
|
41
|
-
|
|
52
|
+
if (cards) cards.row('done', 'Bundle', `removed ${p.stage}`);
|
|
53
|
+
else print(`Removed ${p.stage}.`);
|
|
54
|
+
}
|
|
55
|
+
const rules = removeAgentFile({ env, version: packageVersion() });
|
|
56
|
+
const stays = 'Project files LitMuse sessions wrote (plans/, .litmuse/) stay in each project.';
|
|
57
|
+
if (cards) {
|
|
58
|
+
cards.row(/refused/.test(rules) ? 'warn' : 'done', 'Rules file', rules.replace('AGENT_FILE: ', ''));
|
|
59
|
+
cards.panel({ title: 'LitMuse uninstall is done', sections: [{ rows: [{ value: stays }] }] });
|
|
60
|
+
} else {
|
|
61
|
+
print(rules);
|
|
62
|
+
print(stays);
|
|
42
63
|
}
|
|
43
|
-
print(removeAgentFile({ env, version: packageVersion() }));
|
|
44
|
-
print('Project files LitMuse sessions wrote (plans/, .litmuse/) stay in each project.');
|
|
45
64
|
return 0;
|
|
46
65
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "litmuse",
|
|
4
4
|
"displayName": "LitMuse",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.21",
|
|
6
6
|
"description": "LitFamily workflows for Muse Code: bare lit activation, planning, evidence-bound execution, review, research, handoff and Korean prose care.",
|
|
7
7
|
"compat": {
|
|
8
8
|
"source": "native",
|