@martian-engineering/lossless-claw 0.13.1 → 0.13.2

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/README.md CHANGED
@@ -8,8 +8,10 @@ Lossless Context Management plugin for [OpenClaw](https://github.com/openclaw/op
8
8
  - [Quick start](#quick-start)
9
9
  - [Configuration](#configuration)
10
10
  - [Commands And Skill](#commands-and-skill)
11
+ - [Session Migration CLI](#session-migration-cli)
11
12
  - [Documentation](#documentation)
12
13
  - [Development](#development)
14
+ - [Line endings](#line-endings)
13
15
  - [Security](#security)
14
16
  - [License](#license)
15
17
 
@@ -33,31 +35,50 @@ Nothing is lost. Raw messages stay in the database. Summaries link back to their
33
35
 
34
36
  The plugin now ships a bundled `lossless-claw` skill plus a small plugin command surface for supported OpenClaw chat/native command providers:
35
37
 
36
- - `/lcm` shows version, enablement/selection state, DB path and size, summary counts, and summary-health status
37
- - `/lcm backup` creates a timestamped backup of the current LCM SQLite database
38
- - `/lcm rotate` rewrites the active session transcript into a compact tail-preserving form without changing the live OpenClaw session identity or current LCM conversation
39
- - `/lcm doctor` scans for broken or truncated summaries
40
- - `/lcm doctor clean` shows read-only high-confidence junk diagnostics for archived subagents, cron sessions, and NULL-key orphaned subagent runs
41
- - `/lcm status` shows plugin, conversation, and maintenance state including deferred compaction debt
42
- - `/lossless` is an alias for `/lcm` on supported native command surfaces
38
+ - `/lossless` shows version, enablement/selection state, DB path and size, summary counts, and summary-health status
39
+ - `/lossless backup` creates a timestamped backup of the current LCM SQLite database
40
+ - `/lossless rotate` rewrites the active session transcript into a compact tail-preserving form without changing the live OpenClaw session identity or current LCM conversation
41
+ - `/lossless doctor` scans for broken or truncated summaries
42
+ - `/lossless doctor clean` shows read-only high-confidence junk diagnostics for archived subagents, cron sessions, and NULL-key orphaned subagent runs
43
+ - `/lossless status` shows plugin, conversation, and maintenance state including deferred compaction debt
44
+ - `/lcm` is the shorter alias for `/lossless`
43
45
 
44
46
  These are plugin slash/native commands, not root shell CLI subcommands. Supported examples:
45
47
 
46
- - `/lcm`
47
- - `/lcm backup`
48
- - `/lcm rotate`
49
- - `/lcm doctor`
50
- - `/lcm doctor clean`
51
48
  - `/lossless`
49
+ - `/lossless backup`
50
+ - `/lossless rotate`
51
+ - `/lossless doctor`
52
+ - `/lossless doctor clean`
53
+ - `/lcm`
52
54
 
53
55
  Not currently supported as root CLI commands:
54
56
 
55
- - `openclaw lcm`
56
57
  - `openclaw lossless`
58
+ - `openclaw lcm`
59
+ - `openclaw /lossless`
57
60
  - `openclaw /lcm`
58
61
 
59
62
  The bundled skill focuses on configuration, diagnostics, architecture, and recall-tool usage. Its reference set lives under `skills/lossless-claw/references/`.
60
63
 
64
+ ## Session Migration CLI
65
+
66
+ `lossless-claw-migrate-sessions` is a one-time shell CLI for backfilling OpenClaw JSONL session files into `lcm.db` after lossless-claw was disabled, missing, or installed after sessions already existed. It is not a background replay loop and it does not run summarization.
67
+
68
+ Run it in dry-run mode first:
69
+
70
+ ```bash
71
+ npx --package @martian-engineering/lossless-claw@latest lossless-claw-migrate-sessions --state-dir ~/.openclaw
72
+ ```
73
+
74
+ Apply the import only after reviewing the dry-run output:
75
+
76
+ ```bash
77
+ npx --package @martian-engineering/lossless-claw@latest lossless-claw-migrate-sessions --state-dir ~/.openclaw --apply
78
+ ```
79
+
80
+ The command defaults to `${OPENCLAW_STATE_DIR:-~/.openclaw}` and `${OPENCLAW_STATE_DIR:-~/.openclaw}/lcm.db`. `--apply` creates a timestamped SQLite backup before writing when the database already exists. Use `--file <path>` or repeatable `--sessions-dir <path>` for targeted imports, `--since <iso-date>` or `--limit <n>` to narrow a batch, and `--json` for machine-readable output.
81
+
61
82
  ## Quick start
62
83
 
63
84
  ### Prerequisites
@@ -73,13 +94,19 @@ The bundled skill focuses on configuration, diagnostics, architecture, and recal
73
94
  Use OpenClaw's plugin installer (recommended):
74
95
 
75
96
  ```bash
76
- openclaw plugins install @martian-engineering/lossless-claw
97
+ openclaw plugins install @martian-engineering/lossless-claw@latest
77
98
  ```
78
99
 
79
100
  If you're running from a local OpenClaw checkout, use:
80
101
 
81
102
  ```bash
82
- pnpm openclaw plugins install @martian-engineering/lossless-claw
103
+ pnpm openclaw plugins install @martian-engineering/lossless-claw@latest
104
+ ```
105
+
106
+ Use exact versions only for rollback or reproducible canary testing. OpenClaw records an exact install spec such as `@martian-engineering/lossless-claw@0.12.0` as a pinned update track, so OpenClaw plugin update sync will keep that version until you move back to the stable track:
107
+
108
+ ```bash
109
+ openclaw plugins update @martian-engineering/lossless-claw@latest
83
110
  ```
84
111
 
85
112
  For local plugin development, build your working copy first, then link it instead of copying files:
@@ -313,7 +340,7 @@ For large sessions, neither command is a perfect “keep my live agent context,
313
340
  - `/new` keeps writing into the same active LCM conversation row.
314
341
  - `/reset` changes OpenClaw session flow, which is heavier than users often want when their real problem is just LCM row size.
315
342
 
316
- `/lcm rotate` fills that gap. Before trimming the transcript, it forces leaf-only compaction for raw context outside the preserved live tail so older transcript messages are represented by LCM summaries. It then replaces one rolling `rotate-latest` SQLite backup, rewrites the current session transcript down to the preserved live tail plus current session settings, and refreshes the bootstrap frontier on the same active LCM conversation so dropped transcript history is not replayed. Existing durable messages, summaries, context items, and conversation identity stay in place; only the transcript backing is compacted. If you want additional timestamped snapshots instead, run `/lcm backup`.
343
+ `/lossless rotate` fills that gap. Before trimming the transcript, it forces leaf-only compaction for raw context outside the preserved live tail so older transcript messages are represented by LCM summaries. It then replaces one rolling `rotate-latest` SQLite backup, rewrites the current session transcript down to the preserved live tail plus current session settings, and refreshes the bootstrap frontier on the same active LCM conversation so dropped transcript history is not replayed. Existing durable messages, summaries, context items, and conversation identity stay in place; only the transcript backing is compacted. If you want additional timestamped snapshots instead, run `/lossless backup`.
317
344
 
318
345
  `newSessionRetainDepth` (or `LCM_NEW_SESSION_RETAIN_DEPTH`) controls how much summary structure survives `/new`:
319
346
 
@@ -519,6 +546,22 @@ tui/ # Interactive terminal UI (Go)
519
546
  .goreleaser.yml # GoReleaser config for TUI binary releases
520
547
  ```
521
548
 
549
+ ### Line endings
550
+
551
+ This repository codifies LF line endings through `.gitattributes` so diffs stay
552
+ stable across macOS, Linux, and Windows development environments.
553
+
554
+ - Git should store text files with LF endings in the repository.
555
+ - The root `* text=auto eol=lf` rule normalizes newly added text files.
556
+ - Common source, documentation, lockfile, template, and config extensions are
557
+ listed explicitly so contributors and tooling see the expected policy.
558
+ - Binary assets and SQLite/database files are marked `binary` to avoid unsafe
559
+ newline conversion.
560
+ - If your editor or operating system prefers CRLF locally, keep the repository
561
+ rules authoritative and avoid committing CRLF-only rewrites.
562
+ - After changing line-ending rules, prefer a focused normalization commit so
563
+ future functional changes remain easy to review.
564
+
522
565
  ## Security
523
566
 
524
567
  Please report suspected vulnerabilities privately. See [SECURITY.md](SECURITY.md)