@lossless-claude/lcm 0.5.0 → 0.6.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.
Files changed (152) hide show
  1. package/.claude-plugin/commands/lcm-compact.md +10 -0
  2. package/.claude-plugin/commands/lcm-curate.md +16 -6
  3. package/.claude-plugin/commands/lcm-diagnose.md +10 -0
  4. package/.claude-plugin/commands/lcm-doctor.md +1 -1
  5. package/.claude-plugin/commands/lcm-dogfood.md +1 -1
  6. package/.claude-plugin/commands/lcm-import.md +10 -0
  7. package/.claude-plugin/commands/lcm-promote.md +10 -0
  8. package/.claude-plugin/commands/lcm-sensitive.md +10 -0
  9. package/.claude-plugin/commands/lcm-stats.md +1 -1
  10. package/.claude-plugin/commands/lcm-status.md +10 -0
  11. package/.claude-plugin/hooks/README.md +1 -1
  12. package/.claude-plugin/marketplace.json +1 -1
  13. package/.claude-plugin/plugin.json +8 -2
  14. package/.claude-plugin/skills/lcm-context/SKILL.md +10 -0
  15. package/.claude-plugin/skills/lcm-dogfood/SKILL.md +1 -1
  16. package/.claude-plugin/skills/lcm-dogfood/references/checks.md +1 -1
  17. package/README.md +2 -2
  18. package/dist/bin/lcm.js +828 -474
  19. package/dist/bin/lcm.js.map +1 -1
  20. package/dist/installer/install.d.ts +6 -5
  21. package/dist/installer/install.js +97 -107
  22. package/dist/installer/install.js.map +1 -1
  23. package/dist/src/batch-compact.d.ts +7 -1
  24. package/dist/src/batch-compact.js +80 -6
  25. package/dist/src/batch-compact.js.map +1 -1
  26. package/dist/src/bootstrap.d.ts +24 -0
  27. package/dist/src/bootstrap.js +76 -0
  28. package/dist/src/bootstrap.js.map +1 -0
  29. package/dist/src/cli/pipeline-runner.d.ts +47 -0
  30. package/dist/src/cli/pipeline-runner.js +106 -0
  31. package/dist/src/cli/pipeline-runner.js.map +1 -0
  32. package/dist/src/cli/pipeline-step.d.ts +20 -0
  33. package/dist/src/cli/pipeline-step.js +6 -0
  34. package/dist/src/cli/pipeline-step.js.map +1 -0
  35. package/dist/src/cli/progress-state.d.ts +61 -0
  36. package/dist/src/cli/progress-state.js +16 -0
  37. package/dist/src/cli/progress-state.js.map +1 -0
  38. package/dist/src/cli/render-frame.d.ts +26 -0
  39. package/dist/src/cli/render-frame.js +153 -0
  40. package/dist/src/cli/render-frame.js.map +1 -0
  41. package/dist/src/cli/render-summary.d.ts +8 -0
  42. package/dist/src/cli/render-summary.js +79 -0
  43. package/dist/src/cli/render-summary.js.map +1 -0
  44. package/dist/src/cli-help.js +15 -9
  45. package/dist/src/cli-help.js.map +1 -1
  46. package/dist/src/codex-transcript.d.ts +50 -0
  47. package/dist/src/codex-transcript.js +207 -0
  48. package/dist/src/codex-transcript.js.map +1 -0
  49. package/dist/src/daemon/auth.d.ts +2 -0
  50. package/dist/src/daemon/auth.js +40 -0
  51. package/dist/src/daemon/auth.js.map +1 -0
  52. package/dist/src/daemon/client.d.ts +5 -1
  53. package/dist/src/daemon/client.js +21 -2
  54. package/dist/src/daemon/client.js.map +1 -1
  55. package/dist/src/daemon/config.d.ts +5 -0
  56. package/dist/src/daemon/config.js +23 -8
  57. package/dist/src/daemon/config.js.map +1 -1
  58. package/dist/src/daemon/content-fence.d.ts +7 -0
  59. package/dist/src/daemon/content-fence.js +14 -0
  60. package/dist/src/daemon/content-fence.js.map +1 -0
  61. package/dist/src/daemon/lifecycle.js +5 -0
  62. package/dist/src/daemon/lifecycle.js.map +1 -1
  63. package/dist/src/daemon/orientation.d.ts +1 -0
  64. package/dist/src/daemon/orientation.js +35 -6
  65. package/dist/src/daemon/orientation.js.map +1 -1
  66. package/dist/src/daemon/project.d.ts +1 -0
  67. package/dist/src/daemon/project.js +95 -3
  68. package/dist/src/daemon/project.js.map +1 -1
  69. package/dist/src/daemon/routes/compact.js +41 -10
  70. package/dist/src/daemon/routes/compact.js.map +1 -1
  71. package/dist/src/daemon/routes/describe.js +12 -1
  72. package/dist/src/daemon/routes/describe.js.map +1 -1
  73. package/dist/src/daemon/routes/expand.js +12 -1
  74. package/dist/src/daemon/routes/expand.js.map +1 -1
  75. package/dist/src/daemon/routes/grep.js +11 -2
  76. package/dist/src/daemon/routes/grep.js.map +1 -1
  77. package/dist/src/daemon/routes/ingest.js +36 -8
  78. package/dist/src/daemon/routes/ingest.js.map +1 -1
  79. package/dist/src/daemon/routes/promote.js +18 -3
  80. package/dist/src/daemon/routes/promote.js.map +1 -1
  81. package/dist/src/daemon/routes/prompt-search.js +11 -2
  82. package/dist/src/daemon/routes/prompt-search.js.map +1 -1
  83. package/dist/src/daemon/routes/recent.js +11 -2
  84. package/dist/src/daemon/routes/recent.js.map +1 -1
  85. package/dist/src/daemon/routes/restore.js +89 -72
  86. package/dist/src/daemon/routes/restore.js.map +1 -1
  87. package/dist/src/daemon/routes/search.js +12 -1
  88. package/dist/src/daemon/routes/search.js.map +1 -1
  89. package/dist/src/daemon/routes/session-complete.d.ts +2 -0
  90. package/dist/src/daemon/routes/session-complete.js +36 -0
  91. package/dist/src/daemon/routes/session-complete.js.map +1 -0
  92. package/dist/src/daemon/routes/status.js +77 -64
  93. package/dist/src/daemon/routes/status.js.map +1 -1
  94. package/dist/src/daemon/routes/store.d.ts +2 -1
  95. package/dist/src/daemon/routes/store.js +42 -8
  96. package/dist/src/daemon/routes/store.js.map +1 -1
  97. package/dist/src/daemon/safe-error.d.ts +5 -0
  98. package/dist/src/daemon/safe-error.js +15 -0
  99. package/dist/src/daemon/safe-error.js.map +1 -0
  100. package/dist/src/daemon/server.d.ts +1 -0
  101. package/dist/src/daemon/server.js +33 -4
  102. package/dist/src/daemon/server.js.map +1 -1
  103. package/dist/src/daemon/validate-cwd.d.ts +5 -0
  104. package/dist/src/daemon/validate-cwd.js +38 -0
  105. package/dist/src/daemon/validate-cwd.js.map +1 -0
  106. package/dist/src/db/migration.js +8 -0
  107. package/dist/src/db/migration.js.map +1 -1
  108. package/dist/src/diagnose.js +14 -1
  109. package/dist/src/diagnose.js.map +1 -1
  110. package/dist/src/doctor/doctor.js +45 -2
  111. package/dist/src/doctor/doctor.js.map +1 -1
  112. package/dist/src/hooks/auto-heal.js +24 -1
  113. package/dist/src/hooks/auto-heal.js.map +1 -1
  114. package/dist/src/hooks/dispatch.d.ts +1 -1
  115. package/dist/src/hooks/dispatch.js +14 -1
  116. package/dist/src/hooks/dispatch.js.map +1 -1
  117. package/dist/src/hooks/session-end.d.ts +2 -0
  118. package/dist/src/hooks/session-end.js +50 -5
  119. package/dist/src/hooks/session-end.js.map +1 -1
  120. package/dist/src/hooks/session-snapshot.d.ts +12 -0
  121. package/dist/src/hooks/session-snapshot.js +88 -0
  122. package/dist/src/hooks/session-snapshot.js.map +1 -0
  123. package/dist/src/hooks/user-prompt.js +17 -5
  124. package/dist/src/hooks/user-prompt.js.map +1 -1
  125. package/dist/src/import-summary.d.ts +4 -0
  126. package/dist/src/import-summary.js +34 -0
  127. package/dist/src/import-summary.js.map +1 -0
  128. package/dist/src/import.d.ts +11 -1
  129. package/dist/src/import.js +218 -88
  130. package/dist/src/import.js.map +1 -1
  131. package/dist/src/installer/settings.d.ts +5 -0
  132. package/dist/src/installer/settings.js +73 -0
  133. package/dist/src/installer/settings.js.map +1 -0
  134. package/dist/src/mcp/server.d.ts +15 -0
  135. package/dist/src/mcp/server.js +78 -5
  136. package/dist/src/mcp/server.js.map +1 -1
  137. package/dist/src/promotion/detector.js +19 -5
  138. package/dist/src/promotion/detector.js.map +1 -1
  139. package/dist/src/scrub.js +26 -0
  140. package/dist/src/scrub.js.map +1 -1
  141. package/dist/src/stats.d.ts +1 -0
  142. package/dist/src/stats.js +5 -0
  143. package/dist/src/stats.js.map +1 -1
  144. package/dist/src/store/conversation-store.js +2 -1
  145. package/dist/src/store/conversation-store.js.map +1 -1
  146. package/dist/src/store/regex-safety.d.ts +1 -0
  147. package/dist/src/store/regex-safety.js +22 -0
  148. package/dist/src/store/regex-safety.js.map +1 -0
  149. package/dist/src/store/summary-store.js +2 -1
  150. package/dist/src/store/summary-store.js.map +1 -1
  151. package/lcm.mjs +20 -1
  152. package/package.json +5 -2
@@ -8,6 +8,16 @@ user_invocable: true
8
8
 
9
9
  Compact unprocessed conversation messages into summarized DAG nodes.
10
10
 
11
+ ## Binary Resolution
12
+
13
+ If `lcm` is not on PATH, use the plugin's bundled binary instead:
14
+
15
+ ```bash
16
+ node ~/.claude/plugins/cache/*/lossless-claude/*/lcm.mjs
17
+ ```
18
+
19
+ Replace `lcm` with the command above in all instructions below.
20
+
11
21
  ## Instructions
12
22
 
13
23
  Run the following command via Bash:
@@ -8,25 +8,35 @@ user_invocable: true
8
8
 
9
9
  Run the full memory curation pipeline: import, compact, and promote.
10
10
 
11
+ ## Binary Resolution
12
+
13
+ If `lcm` is not on PATH, use the plugin's bundled binary instead:
14
+
15
+ ```bash
16
+ node ~/.claude/plugins/cache/*/lossless-claude/*/lcm.mjs
17
+ ```
18
+
19
+ Replace `lcm` with the command above in all instructions below.
20
+
11
21
  ## Instructions
12
22
 
13
- Run the following commands sequentially via Bash:
23
+ Run the following commands sequentially via Bash. Always use `--verbose` on `import` and `promote` by default:
14
24
 
15
25
  ```bash
16
- lcm import && lcm compact && lcm promote
26
+ lcm import --verbose && lcm compact && lcm promote --verbose
17
27
  ```
18
28
 
19
29
  ### Options
20
30
 
21
31
  Pass user-specified flags through to the commands that support them:
22
32
  - `--all` — Process all projects (default: current project only); applies to all three commands
23
- - `--verbose` — Show per-step details; applies to `import` and `promote` only (compact does not support `--verbose`)
33
+ - `--no-verbose` — Suppress verbose output (verbose is on by default)
24
34
  - `--dry-run` — Preview without writing; applies to all three commands
25
35
 
26
36
  For example:
27
- - `/lcm-curate --all` → `lcm import --all && lcm compact --all && lcm promote --all`
28
- - `/lcm-curate --all --verbose` → `lcm import --all --verbose && lcm compact --all && lcm promote --all --verbose`
29
- - `/lcm-curate --dry-run` → `lcm import --dry-run && lcm compact --dry-run && lcm promote --dry-run`
37
+ - `/lcm-curate --all` → `lcm import --all --verbose && lcm compact --all && lcm promote --all --verbose`
38
+ - `/lcm-curate --dry-run` → `lcm import --dry-run --verbose && lcm compact --dry-run && lcm promote --dry-run --verbose`
39
+ - `/lcm-curate --no-verbose` → `lcm import && lcm compact && lcm promote`
30
40
 
31
41
  The pipeline stops on the first failure and reports the result.
32
42
 
@@ -8,6 +8,16 @@ user_invocable: true
8
8
 
9
9
  Inspect recent Claude Code transcripts for historical lcm issues.
10
10
 
11
+ ## Binary Resolution
12
+
13
+ If `lcm` is not on PATH, use the plugin's bundled binary instead:
14
+
15
+ ```bash
16
+ node ~/.claude/plugins/cache/*/lossless-claude/*/lcm.mjs
17
+ ```
18
+
19
+ Replace `lcm` with the command above in all instructions below.
20
+
11
21
  ## Instructions
12
22
 
13
23
  Run `lcm diagnose` via Bash and display the output verbatim.
@@ -20,4 +20,4 @@ End with one of:
20
20
  - *All checks passed — lossless-claude is healthy.*
21
21
  - *N check(s) need attention — see Fix section above.*
22
22
 
23
- If `lcm_doctor` is unavailable, run `lcm doctor` via Bash and display the output verbatim.
23
+ If `lcm_doctor` is unavailable, run `lcm doctor` via Bash and display the output verbatim. If `lcm` is not on PATH, first try to install it by running `node ~/.claude/plugins/cache/*/lossless-claude/*/lcm.mjs install`, then retry `lcm doctor`. If `lcm` is still unavailable, run `node ~/.claude/plugins/cache/*/lossless-claude/*/lcm.mjs doctor` instead.
@@ -48,7 +48,7 @@ All CLI checks use `node dist/bin/lcm.js <subcommand>`. If `lcm` is on PATH, use
48
48
  Hooks are registered in `.claude-plugin/plugin.json`, NOT `~/.claude/settings.json`. Verify all 4:
49
49
  - `SessionStart` → `lcm restore`
50
50
  - `UserPromptSubmit` → `lcm user-prompt`
51
- - `PreCompact` → `lcm compact`
51
+ - `PreCompact` → `lcm compact --hook`
52
52
  - `SessionEnd` → `lcm session-end`
53
53
 
54
54
  For live hook testing, pipe JSON to stdin:
@@ -8,6 +8,16 @@ user_invocable: true
8
8
 
9
9
  Import Claude Code session transcripts into lcm memory.
10
10
 
11
+ ## Binary Resolution
12
+
13
+ If `lcm` is not on PATH, use the plugin's bundled binary instead:
14
+
15
+ ```bash
16
+ node ~/.claude/plugins/cache/*/lossless-claude/*/lcm.mjs
17
+ ```
18
+
19
+ Replace `lcm` with the command above in all instructions below.
20
+
11
21
  ## Instructions
12
22
 
13
23
  Run the following command via Bash:
@@ -8,6 +8,16 @@ user_invocable: true
8
8
 
9
9
  Promote durable insights from summaries into cross-session memory.
10
10
 
11
+ ## Binary Resolution
12
+
13
+ If `lcm` is not on PATH, use the plugin's bundled binary instead:
14
+
15
+ ```bash
16
+ node ~/.claude/plugins/cache/*/lossless-claude/*/lcm.mjs
17
+ ```
18
+
19
+ Replace `lcm` with the command above in all instructions below.
20
+
11
21
  ## Instructions
12
22
 
13
23
  Run the following command via Bash:
@@ -19,6 +19,16 @@ Manage the sensitive patterns used by lossless-claude to redact secrets before s
19
19
  /lcm-sensitive purge [--all] --yes
20
20
  ```
21
21
 
22
+ ## Binary Resolution
23
+
24
+ If `lcm` is not on PATH, use the plugin's bundled binary instead:
25
+
26
+ ```bash
27
+ node ~/.claude/plugins/cache/*/lossless-claude/*/lcm.mjs
28
+ ```
29
+
30
+ Replace `lcm` with the command above in all instructions below.
31
+
22
32
  ## Instructions
23
33
 
24
34
  Run the appropriate `lcm sensitive` subcommand via Bash based on the user's intent:
@@ -14,6 +14,6 @@ When invoked, call the `lcm_stats` MCP tool with `{"verbose": true}`.
14
14
 
15
15
  The tool returns pre-formatted markdown with Memory and Compression tables. Display the output verbatim — it is already formatted correctly.
16
16
 
17
- If `lcm_stats` is unavailable, run `lcm stats -v` via Bash and display the output verbatim.
17
+ If `lcm_stats` is unavailable, run `lcm stats -v` via Bash and display the output verbatim. If `lcm` is not on PATH, use `node ~/.claude/plugins/cache/*/lossless-claude/*/lcm.mjs stats -v` instead.
18
18
 
19
19
  Do not add commentary — just the stats output.
@@ -8,6 +8,16 @@ user_invocable: true
8
8
 
9
9
  Show daemon state and project memory statistics.
10
10
 
11
+ ## Binary Resolution
12
+
13
+ If `lcm` is not on PATH, use the plugin's bundled binary instead:
14
+
15
+ ```bash
16
+ node ~/.claude/plugins/cache/*/lossless-claude/*/lcm.mjs
17
+ ```
18
+
19
+ Replace `lcm` with the command above in all instructions below.
20
+
11
21
  ## Instructions
12
22
 
13
23
  Run the following command via Bash:
@@ -8,7 +8,7 @@ All hooks auto-heal: each validates that all 4 hooks are registered in `settings
8
8
 
9
9
  | Hook | Command | What it does |
10
10
  |------|---------|-------------|
11
- | PreCompact | `lcm compact` | Intercepts compaction, runs LLM summarization into a DAG, returns the summary (exit 2 = replace native) |
11
+ | PreCompact | `lcm compact --hook` | Intercepts compaction, runs LLM summarization into a DAG, returns the summary (exit 2 = replace native) |
12
12
  | SessionStart | `lcm restore` | Restores project context + recent summaries + promoted memories from prior sessions |
13
13
  | SessionEnd | `lcm session-end` | Ingests the session transcript into the database for future recall |
14
14
  | UserPromptSubmit | `lcm user-prompt` | Searches promoted memory for relevant context, surfaces it as `<memory-context>` hints |
@@ -13,7 +13,7 @@
13
13
  "repo": "lossless-claude/lcm"
14
14
  },
15
15
  "description": "Lossless context management — DAG-based summarization that preserves every message",
16
- "version": "0.5.0",
16
+ "version": "0.6.0",
17
17
  "strict": true
18
18
  }
19
19
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lcm",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Lossless context management — DAG-based summarization that preserves every message",
5
5
  "author": {
6
6
  "name": "Pedro Almeida",
@@ -21,7 +21,7 @@
21
21
  "PreCompact": [
22
22
  {
23
23
  "matcher": "",
24
- "hooks": [{ "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/lcm.mjs\" compact" }]
24
+ "hooks": [{ "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/lcm.mjs\" compact --hook" }]
25
25
  }
26
26
  ],
27
27
  "SessionStart": [
@@ -41,6 +41,12 @@
41
41
  "matcher": "",
42
42
  "hooks": [{ "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/lcm.mjs\" user-prompt" }]
43
43
  }
44
+ ],
45
+ "Stop": [
46
+ {
47
+ "matcher": "",
48
+ "hooks": [{ "type": "command", "command": "node \"${CLAUDE_PLUGIN_ROOT}/lcm.mjs\" session-snapshot" }]
49
+ }
44
50
  ]
45
51
  }
46
52
  }
@@ -75,6 +75,16 @@ These three tools **chain** from broad to deep:
75
75
  - It's already documented in CLAUDE.md or memory files
76
76
  - It's general knowledge, not project-specific
77
77
 
78
+ ## Binary Resolution
79
+
80
+ If `lcm` is not on PATH, first try to install it by running:
81
+
82
+ ```bash
83
+ node ~/.claude/plugins/cache/*/lossless-claude/*/lcm.mjs install
84
+ ```
85
+
86
+ If install succeeds, `lcm` should now be available on PATH. If it is still not available, use the bundled binary directly: `node ~/.claude/plugins/cache/*/lossless-claude/*/lcm.mjs`
87
+
78
88
  ## Error Self-Healing
79
89
 
80
90
  ### Agent-Fixable (handle automatically)
@@ -49,7 +49,7 @@ All CLI checks use `node dist/bin/lcm.js <subcommand>`. If `lcm` is on PATH, use
49
49
  Hooks are registered in `.claude-plugin/plugin.json`, NOT `~/.claude/settings.json`. Verify all 4:
50
50
  - `SessionStart` → `lcm restore`
51
51
  - `UserPromptSubmit` → `lcm user-prompt`
52
- - `PreCompact` → `lcm compact`
52
+ - `PreCompact` → `lcm compact --hook`
53
53
  - `SessionEnd` → `lcm session-end`
54
54
 
55
55
  For live hook testing, pipe JSON to stdin:
@@ -126,7 +126,7 @@ Hooks are registered in `.claude-plugin/plugin.json`, NOT `~/.claude/settings.js
126
126
  Read `.claude-plugin/plugin.json` and verify all 4 hooks:
127
127
  - `SessionStart` → `lcm restore`
128
128
  - `UserPromptSubmit` → `lcm user-prompt`
129
- - `PreCompact` → `lcm compact`
129
+ - `PreCompact` → `lcm compact --hook`
130
130
  - `SessionEnd` → `lcm session-end`
131
131
 
132
132
  Pass if: all 4 present with correct commands.
package/README.md CHANGED
@@ -108,7 +108,7 @@ Claude Code uses four hooks. All hooks auto-heal: each validates that all requir
108
108
 
109
109
  | Hook | Command | Purpose |
110
110
  |---|---|---|
111
- | `PreCompact` | `lcm compact` | Intercepts compaction and writes DAG summaries |
111
+ | `PreCompact` | `lcm compact --hook` | Intercepts compaction and writes DAG summaries |
112
112
  | `SessionStart` | `lcm restore` | Restores project context, recent summaries, and promoted memory |
113
113
  | `SessionEnd` | `lcm session-end` | Ingests the completed Claude transcript |
114
114
  | `UserPromptSubmit` | `lcm user-prompt` | Searches memory and injects prompt-time hints |
@@ -144,7 +144,7 @@ lcm stats # memory and compression overview
144
144
  lcm stats -v # per-conversation breakdown
145
145
  lcm status # daemon + summarizer mode
146
146
  lcm daemon start --detach # start daemon in background
147
- lcm compact # PreCompact hook handler
147
+ lcm compact --hook # PreCompact hook handler (internal)
148
148
  lcm restore # SessionStart hook handler
149
149
  lcm session-end # SessionEnd hook handler
150
150
  lcm user-prompt # UserPromptSubmit hook handler