@hasna/mementos 0.17.2 → 0.17.3

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
@@ -402,3 +402,33 @@ Development entry points are `bun run dev:cli`, `bun run dev:mcp`, and
402
402
  ## License
403
403
 
404
404
  Apache-2.0 — see [LICENSE](LICENSE).
405
+
406
+ ## Claude Code Stop hook
407
+
408
+ Preview the installed CLI's managed hook configuration:
409
+
410
+ ```sh
411
+ mementos session setup-hook --claude
412
+ ```
413
+
414
+ Apply that exact preview with `--apply --expect-settings-sha256 <digest>`
415
+ (or `absent` for a new settings file). A recognized legacy hook also requires
416
+ `--expect-hook-sha256 <digest>`. The installer preserves unrelated settings,
417
+ retains the original settings as a private backup, and refuses custom or changed
418
+ hook files. A symlinked `.claude` directory is preserved and requires the preview's
419
+ `--expect-directory-sha256 <digest>`; retargeting the alias invalidates the preview
420
+ even when its settings have identical bytes. `mementos init` uses the same installer and does not start a local
421
+ server when a hosted API is configured.
422
+
423
+ The portable command is `mementos session stop-hook --claude`; the installed CLI
424
+ must be on Claude's PATH. It reads the native `transcript_path` and final assistant
425
+ text, excludes tool payloads, redacts known secret patterns, and submits through
426
+ the normal hosted credential resolver. It never ingests the hook envelope as a
427
+ conversation, falls back to a local store, or automatically retries an ambiguous
428
+ submission. HTTP failures and invalid receipts emit a fixed, private-data-free
429
+ error and exit 1. This reports failure without blocking Claude's Stop; see the
430
+ [Claude hook exit-code contract](https://code.claude.com/docs/en/hooks#exit-code-output).
431
+ The hook reads at most 8 MiB of transcript and 64 KiB of input context.
432
+ When `MEMENTOS_AGENT` is configured, the hook preserves that agent attribution.
433
+ The installer also recognizes the historical CLI-ingest migration shim by its
434
+ exact digest; modified copies remain protected as custom hooks.
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAazC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqR1D"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8L1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"system-session.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/system-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmI7D"}
1
+ {"version":3,"file":"system-session.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/system-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwI7D"}