@litfamily/litmuse 0.1.13 → 0.1.14

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.14 — 2026-11-16
4
+
5
+ - `install` now prints the LitFamily extensions notice (and the fixed "Muse refuses a folder that is already there" line after it) once per text. Each printed text leaves a hash and a time as one line in `~/.local/share/litmuse/shown.jsonl`; a later install whose notice would be the same leaves it out, while the live "N things need a look" line and the status line still print. A new text (for example the leftover-engines line after an upgrade) is printed and appended. A missing, corrupt or symlinked record prints the notice as before. No hook, context or manifest file changed, so the hook digests stay the ones 0.1.13 shipped and Muse does not ask you to approve the hooks again.
6
+
3
7
  ## 0.1.13 — 2026-11-14
4
8
 
5
9
  - The nine extension stubs and both READMEs now give three lines for installing an extension safely. The first only reads: it prints every folder Muse could load under that id (Muse's user skills, the personal `~/.claude/skills` and `~/.codex/skills` that Muse also loads, and the project's `.agents/skills` and `.claude/skills`). The second moves an existing copy in Muse's user skills, whole and with any file you added, into a dated folder under `$CONFIG_DIR/extension-backups/`, which Muse does not scan. The third is the `muse skills install` line. Muse 1.4.15 refuses to install over a folder that is already there, and `--force` and `muse skills update` rewrite the shipped files in place while keeping every other file, so the stubs no longer suggest `--force` for a newer edition: an update is the same three lines again.
package/lib/install.mjs CHANGED
@@ -8,6 +8,7 @@ import { expectedApprovals, approvalStates } from './approvals.mjs';
8
8
  import { agentFilePlan, installAgentFile } from './agent-file.mjs';
9
9
  import { MOVED, movedSkill, installLine } from '../plugin/hooks/lib/moved.mjs';
10
10
  import { SHELF, extensionsNotice, leftoverRuntime } from '../plugin/hooks/lib/extensions.mjs';
11
+ import { noticeHash, wasShown, recordShown } from './shown.mjs';
11
12
  import { survey, findings, CLI } from './extensions.mjs';
12
13
 
13
14
  function remedy(state, detail, p) {
@@ -222,8 +223,16 @@ export async function install({ env = process.env, flags = {}, interactive = fal
222
223
  print('Written:');
223
224
  for (const w of written) print(` ${w}`);
224
225
  print('');
225
- for (const line of extensionsNotice({ leftovers })) print(line);
226
- for (const line of extensionLines(env)) print(line);
226
+ // The notice and the fixed line after it are printed once per text; the live count of folders to check always is.
227
+ const [fixedLine, ...liveLines] = extensionLines(env);
228
+ const noticeLines = [...extensionsNotice({ leftovers }), fixedLine];
229
+ const hash = noticeHash(noticeLines.join('\n'));
230
+ if (wasShown(p.shown, hash)) {
231
+ for (const line of liveLines) print(line);
232
+ } else {
233
+ for (const line of [...noticeLines, ...liveLines]) print(line);
234
+ recordShown(p.shown, hash);
235
+ }
227
236
  print('');
228
237
  print(left === 0
229
238
  ? 'Status: Ready. Start Muse in a project and begin a prompt with `lit`. Check any time with `npx @litfamily/litmuse doctor`.'
package/lib/paths.mjs CHANGED
@@ -16,6 +16,7 @@ export function paths(env = process.env) {
16
16
  updateCache: join(data, 'update-check.json'),
17
17
  config: join(data, 'config.json'),
18
18
  notice: join(data, 'first-session-notice.json'),
19
+ shown: join(data, 'shown.jsonl'),
19
20
  museSettings: join(configHome, 'muse', 'settings.json'),
20
21
  museRules: join(configHome, 'muse', 'AGENTS.md'),
21
22
  museInstalled: join(dataHome, 'muse', 'plugins', 'installed.json'),
package/lib/shown.mjs ADDED
@@ -0,0 +1,58 @@
1
+ import { appendFileSync, lstatSync, mkdirSync, readFileSync } from 'node:fs';
2
+ import { createHash } from 'node:crypto';
3
+ import { dirname } from 'node:path';
4
+ import { assertSafeWritePath } from './guard.mjs';
5
+
6
+ // An append-only record of the notice texts LitMuse has already printed: one JSON line `{hash, at}` per text, in
7
+ // LitMuse's own data folder. Anything unreadable, oversized or linked counts as "nothing shown yet", so a broken
8
+ // record can only bring a notice back, never hide a new one.
9
+ const READ_LIMIT = 256 * 1024;
10
+
11
+ export const noticeHash = (text) => createHash('sha256').update(String(text).replace(/\s+/g, ' ').trim().toLowerCase()).digest('hex').slice(0, 16);
12
+
13
+ function realFile(file) {
14
+ try {
15
+ const st = lstatSync(file);
16
+ return st.isFile() && st.size <= READ_LIMIT;
17
+ } catch {
18
+ return false;
19
+ }
20
+ }
21
+
22
+ export function wasShown(file, hash) {
23
+ if (!realFile(file)) return false;
24
+ try {
25
+ return readFileSync(file, 'utf8').split('\n').some((line) => {
26
+ try {
27
+ return JSON.parse(line)?.hash === hash;
28
+ } catch {
29
+ return false;
30
+ }
31
+ });
32
+ } catch {
33
+ return false;
34
+ }
35
+ }
36
+
37
+ export function recordShown(file, hash) {
38
+ try {
39
+ assertSafeWritePath(file);
40
+ const parent = lstatSyncOrNull(dirname(file));
41
+ if (parent && (parent.isSymbolicLink() || !parent.isDirectory())) return false;
42
+ const own = lstatSyncOrNull(file);
43
+ if (own && !own.isFile()) return false;
44
+ mkdirSync(dirname(file), { recursive: true });
45
+ appendFileSync(file, `${JSON.stringify({ hash, at: Date.now() })}\n`);
46
+ return true;
47
+ } catch {
48
+ return false;
49
+ }
50
+ }
51
+
52
+ function lstatSyncOrNull(p) {
53
+ try {
54
+ return lstatSync(p);
55
+ } catch {
56
+ return null;
57
+ }
58
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@litfamily/litmuse",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
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",
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "name": "litmuse",
4
4
  "displayName": "LitMuse",
5
- "version": "0.1.13",
5
+ "version": "0.1.14",
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",