@litfamily/litmuse 0.1.19 → 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/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
- print('LitMuse uninstall');
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
- print(` bundle ${bundleLine}`);
20
- if (st.state === 'modified' && !discard) print(' hint add --discard-modified to remove the edited bundle too');
21
- print(` kept ${p.backups} and ${p.receipt}`);
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
- print(`FAIL ${r.command}: ${(r.stderr || r.stdout).trim().split(/\r?\n/)[0]}`);
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
- print('Removed the LitMuse plugin from Muse.');
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
- print(`Removed ${p.stage}.`);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@litfamily/litmuse",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "Installer for LitMuse: skills, hooks and agents that help Meta's Muse Code plan, build, check and hand off work.",
5
5
  "keywords": [
6
6
  "muse",
@@ -42,6 +42,8 @@
42
42
  "docs/assets/card/idle.webp",
43
43
  "docs/assets/card/working.webp",
44
44
  "docs/assets/card/after.webp",
45
+ "docs/assets/card/watch.webp",
46
+ "docs/assets/card/watch-still.webp",
45
47
  "docs/assets/handoff/saved.webp",
46
48
  "docs/assets/handoff/latest.webp",
47
49
  "README.md",
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "name": "litmuse",
4
4
  "displayName": "LitMuse",
5
- "version": "0.1.19",
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",