@hasna/hooks 0.10.9 → 0.11.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.
- package/README.md +48 -0
- package/bin/hooks-mcp.js +352 -182
- package/bin/index.js +2314 -1607
- package/bin/native-readiness-entry.js +355 -0
- package/dist/index.js +502 -284
- package/dist/lib/codex-safety-check.d.ts +2 -1
- package/dist/lib/codex-safety-trust.d.ts +40 -8
- package/dist/lib/installer.d.ts +11 -0
- package/dist/lib/native-readiness-command.d.ts +14 -0
- package/dist/lib/native-safety-registration.d.ts +38 -7
- package/dist/lib/readiness-process.d.ts +20 -0
- package/dist/native-readiness.d.ts +68 -0
- package/dist/native-readiness.js +328 -0
- package/hooks/native-readiness-entry.ts +31 -0
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -13,6 +13,54 @@ npm install -g @hasna/hooks
|
|
|
13
13
|
|
|
14
14
|
## CLI Usage
|
|
15
15
|
|
|
16
|
+
### Trash startup readiness
|
|
17
|
+
|
|
18
|
+
The bundled `trash-readiness` observer checks an installed Trash ready plan at
|
|
19
|
+
session startup. It reports a short ready or attention message. It does not
|
|
20
|
+
capture files, repair settings, retry failed requests, or authorize deletion.
|
|
21
|
+
Keep the separate `trash-guard` installed and enabled.
|
|
22
|
+
|
|
23
|
+
Claude and Codex use their native `SessionStart` event for startup, resume,
|
|
24
|
+
clear and fork. Compaction does not repeat this check. Configuration and native
|
|
25
|
+
execution are separate: successful setup leaves `nativeAdoptionVerified:false`
|
|
26
|
+
until the actual consumer has been exercised.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
hooks safety startup registration-plan --target claude
|
|
30
|
+
hooks safety startup registration-apply --target claude --expected-plan-digest SHA256
|
|
31
|
+
|
|
32
|
+
hooks safety startup registration-plan --target codex
|
|
33
|
+
hooks safety startup registration-apply --target codex --expected-plan-digest SHA256
|
|
34
|
+
hooks safety startup trust-plan --target codex --codex-command /absolute/native/codex --cwd /absolute/project
|
|
35
|
+
hooks safety startup trust-apply --target codex --codex-command /absolute/native/codex --cwd /absolute/project --expected-plan-digest SHA256
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
After registration and trust, use Trash's station setup flow to produce a new
|
|
39
|
+
ready plan. Native configuration changes must precede this plan because its
|
|
40
|
+
digest binds the selected configuration. Bind that plan explicitly:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
hooks safety startup bind --target codex --binding /absolute/binding.json --expected-binding-sha256 absent
|
|
44
|
+
hooks safety startup check --target codex
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The binding schema is `hasna.hooks.trash-readiness/v1`. It contains the exact
|
|
48
|
+
provider and home, `runtime:{path,sha256}`, `trash:{root,version,cliSha256}`,
|
|
49
|
+
`plan:{path,sha256}`, and `timeoutMs` (1000–15000). Paths are absolute; the
|
|
50
|
+
package and plan must be inside that home. The installed binding lives at
|
|
51
|
+
`~/.hasna/hooks/native/trash-readiness/<provider>.json`. Updating it requires its
|
|
52
|
+
current digest; the writer preserves an immutable predecessor, intent and
|
|
53
|
+
receipt. Response loss requires inspection before another explicit operation.
|
|
54
|
+
Generic Hooks registry authentication is unchanged.
|
|
55
|
+
|
|
56
|
+
The `@hasna/hooks/native-readiness` export also exposes the observer for harness
|
|
57
|
+
integrations as `await runTrashReadiness(provider, { signal })`. The observer
|
|
58
|
+
supervises only its newly created check process group, including nested clients,
|
|
59
|
+
and cleans it up on completion, cancellation or timeout. Selecting `sumi`
|
|
60
|
+
identifies that consumer; it does not register
|
|
61
|
+
a Sumi lifecycle event. A Sumi adapter must call the observer through its own
|
|
62
|
+
supported startup path and verify delivery separately.
|
|
63
|
+
|
|
16
64
|
```bash
|
|
17
65
|
hooks --help
|
|
18
66
|
```
|