@hasna/mementos 0.17.1 → 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 +38 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/prompt-context.d.ts +3 -0
- package/dist/cli/commands/prompt-context.d.ts.map +1 -0
- package/dist/cli/commands/system-session.d.ts.map +1 -1
- package/dist/cli/index.js +2501 -519
- package/dist/cli/register-all.d.ts.map +1 -1
- package/dist/lib/claude-hook-install.d.ts +33 -0
- package/dist/lib/claude-hook-install.d.ts.map +1 -0
- package/dist/lib/claude-stop-hook.d.ts +9 -0
- package/dist/lib/claude-stop-hook.d.ts.map +1 -0
- package/dist/lib/prompt-context.d.ts +65 -0
- package/dist/lib/prompt-context.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -92,6 +92,14 @@ mementos decisions evaluate --input pair.json --json
|
|
|
92
92
|
mementos decisions disable
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
+
For prompt hooks, `mementos prompt-context --enabled --input -` accepts JSON
|
|
96
|
+
containing `prompt`, `project` and optional explicit scope filters. It returns a
|
|
97
|
+
bounded, read-only context receipt. Without `--enabled` it performs no retrieval;
|
|
98
|
+
provider decisions still require their separate opt-in. The Hooks app registers
|
|
99
|
+
the native event with `hooks install mementos-context --target codex` (also
|
|
100
|
+
`claude` or `codewith`). See the [prompt hook setup](../hooks/hooks/hook-mementos-context/README.md)
|
|
101
|
+
for environment enablement, project scope, provider disclosure and native trust.
|
|
102
|
+
|
|
95
103
|
`configure` always leaves assistance disabled. `enable` permits only the selected
|
|
96
104
|
features and explicitly permits sending their text to the configured provider.
|
|
97
105
|
The key is read from `OPENROUTER_API_KEY`; it is never saved in decision settings.
|
|
@@ -394,3 +402,33 @@ Development entry points are `bun run dev:cli`, `bun run dev:mcp`, and
|
|
|
394
402
|
## License
|
|
395
403
|
|
|
396
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;
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-context.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/prompt-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsCzC,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyBnE"}
|
|
@@ -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;
|
|
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"}
|