@hasna/hooks 0.12.23 → 0.13.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.
@@ -13,11 +13,21 @@ import { type HookEvent, type HookMeta } from "./registry.js";
13
13
  import { type StaleRegistration } from "./registration.js";
14
14
  import { type NativeSafetyName } from "./native-safety.js";
15
15
  import { type MementosRegistration } from "./mementos-options.js";
16
+ import { type TargetName } from "./targets.js";
17
+ import { type AdapterOptions, type AdapterRunner } from "./target-adapters.js";
16
18
  export type Scope = "global" | "project";
17
- export type Target = "claude" | "gemini" | "codewith" | "codex" | "all";
18
- type SingleTarget = Exclude<Target, "all">;
19
- export type ConcreteTarget = SingleTarget;
19
+ /**
20
+ * Every target name the CLI accepts, plus the `all` group. The names come from
21
+ * the capability model (targets.ts); `all` is not a target and keeps its
22
+ * long-standing meaning (Claude + managed Codewith fragments on install,
23
+ * Claude/Gemini/Codex on removal).
24
+ */
25
+ export type Target = TargetName | "all";
26
+ type SingleTarget = TargetName;
27
+ export type ConcreteTarget = TargetName;
20
28
  export type CodewithInstallMode = "fragment" | "write";
29
+ /** Adapter options for one scope; the test seam for the harness commands. */
30
+ export declare function adapterOptions(scope: Scope, home?: string, run?: AdapterOptions["run"]): AdapterOptions;
21
31
  export interface InstallResult {
22
32
  hook: string;
23
33
  success: boolean;
@@ -56,6 +66,12 @@ export interface InstallOptions {
56
66
  */
57
67
  beforeWrite?: () => void;
58
68
  }
69
+ /**
70
+ * The config file (or, for Muse, the plugin directory) `hooks install` writes
71
+ * for a scope + target. The path itself is the capability model's decision, so
72
+ * a harness's own layout is stated once (targets.ts) and every caller — doctor,
73
+ * install receipts and the adapters — resolves the same file.
74
+ */
59
75
  export declare function getSettingsPath(scope?: Scope, target?: SingleTarget, codewithConfigPath?: string): string;
60
76
  export declare function getHookPath(name: string): string;
61
77
  export declare function hookExists(name: string): boolean;
@@ -112,7 +128,11 @@ export declare function getRegisteredHooksForTarget(scope?: Scope, target?: Sing
112
128
  export declare function getRegisteredHooks(scope?: Scope): string[];
113
129
  /** @deprecated Use getRegisteredHooks instead */
114
130
  export declare const getInstalledHooks: typeof getRegisteredHooks;
115
- export declare function removeHook(name: string, scope?: Scope, target?: Target): boolean;
131
+ export declare function removeHook(name: string, scope?: Scope, target?: Target,
132
+ /** Test seam: the harness runner every adapter command goes through. */
133
+ options?: {
134
+ run?: AdapterRunner;
135
+ }): boolean;
116
136
  /**
117
137
  * Every settings registration for the scope whose hook name does not resolve.
118
138
  *
@@ -149,8 +169,23 @@ export interface UninstallResult {
149
169
  dbRecordRemoved: boolean;
150
170
  /** Targets whose config still registers the hook after removal (e.g. codewith TOML the caller must edit itself). */
151
171
  registrationsRemaining: string[];
172
+ /**
173
+ * Harnesses a `--target all` sweep skipped, and why. A harness that is not
174
+ * installed carries no registration, so skipping it is not a failure — but
175
+ * the skip is named rather than silent, because "removed" otherwise reads as
176
+ * "removed everywhere".
177
+ */
178
+ notes?: string[];
152
179
  error?: string;
153
180
  }
181
+ /**
182
+ * What the human `hooks remove` line says for a failed removal.
183
+ *
184
+ * It must agree with the JSON `removed` value: a removal refused by an
185
+ * unreadable harness config or by an adapter is not "not found", and printing
186
+ * that hides the exact cause the user has to repair.
187
+ */
188
+ export declare function removeFailureMessage(result: Pick<UninstallResult, "name" | "error">, hook: string, suggestions?: readonly string[]): string;
154
189
  /**
155
190
  * Lossless removal of a `hooks run <name>` entry from a Codewith config.toml.
156
191
  *
@@ -166,5 +201,9 @@ export declare function removeCodewithHookEntry(configText: string, name: string
166
201
  text: string;
167
202
  removed: boolean;
168
203
  };
169
- export declare function uninstallHook(name: string, scope?: Scope, target?: Target): UninstallResult;
204
+ export declare function uninstallHook(name: string, scope?: Scope, target?: Target,
205
+ /** Test seam: the harness runner every adapter command goes through. */
206
+ options?: {
207
+ run?: AdapterRunner;
208
+ }): UninstallResult;
170
209
  export {};
@@ -19,6 +19,23 @@ export declare const manifestSchema: z.ZodObject<{
19
19
  args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
20
20
  /** Request trusted native target dispatch as --harness, never from stdin. */
21
21
  nativeTargetDispatch: z.ZodOptional<z.ZodBoolean>;
22
+ /**
23
+ * The hook reads the assistant's final message out of its stdin payload.
24
+ *
25
+ * Install refuses a target whose payload cannot carry it (the capability
26
+ * model in targets.ts) instead of wiring a hook that would run on every turn
27
+ * and do nothing — a silent install is the failure this field prevents.
28
+ */
29
+ requires_final_message: z.ZodOptional<z.ZodBoolean>;
30
+ /**
31
+ * The hook's verdict must hold the turn open (a `block` that the harness
32
+ * honours as a continuation).
33
+ *
34
+ * Install refuses a target whose verdict cannot hold the turn (the
35
+ * capability model in targets.ts) instead of wiring a hook whose block is
36
+ * silently ignored — the same failure `requires_final_message` prevents.
37
+ */
38
+ requires_block: z.ZodOptional<z.ZodBoolean>;
22
39
  timeout_ms: z.ZodOptional<z.ZodNumber>;
23
40
  /**
24
41
  * Per-hook environment passed to the hook child (reviewer efcad315).
@@ -39,6 +56,8 @@ export declare const manifestSchema: z.ZodObject<{
39
56
  script_kind?: "inline" | "file" | undefined;
40
57
  args?: string[] | undefined;
41
58
  nativeTargetDispatch?: boolean | undefined;
59
+ requires_final_message?: boolean | undefined;
60
+ requires_block?: boolean | undefined;
42
61
  timeout_ms?: number | undefined;
43
62
  }, {
44
63
  version: string;
@@ -50,6 +69,8 @@ export declare const manifestSchema: z.ZodObject<{
50
69
  script_kind?: "inline" | "file" | undefined;
51
70
  args?: string[] | undefined;
52
71
  nativeTargetDispatch?: boolean | undefined;
72
+ requires_final_message?: boolean | undefined;
73
+ requires_block?: boolean | undefined;
53
74
  timeout_ms?: number | undefined;
54
75
  }>;
55
76
  export type HookManifest = z.infer<typeof manifestSchema>;
@@ -1,6 +1,15 @@
1
+ /**
2
+ * The trusted target names a native registration may pass as `--target`.
3
+ *
4
+ * This list is the capability model's own target list (targets.ts): a harness
5
+ * gains a name here exactly when `hooks run` has a payload shape for it, so the
6
+ * settings scanner, the installer and the runner can never disagree about what
7
+ * a valid registration looks like.
8
+ */
9
+ import { type TargetName } from "./targets.js";
1
10
  /** Trusted invocation metadata, supplied by a native registration or plugin, never hook stdin. */
2
- export declare const HOOK_RUN_TARGETS: readonly ["claude", "codex", "gemini", "codewith", "sumi", "opencode"];
3
- export type HookRunTarget = typeof HOOK_RUN_TARGETS[number];
11
+ export declare const HOOK_RUN_TARGETS: readonly ["claude", "codex", "gemini", "codewith", "qwen", "muse", "kimi", "pi", "cursor", "opencode", "sumi"];
12
+ export type HookRunTarget = TargetName;
4
13
  export declare function isHookRunTarget(value: unknown): value is HookRunTarget;
5
14
  /** Existing hooks keep their arguments verbatim. Opted-in hooks require explicit native dispatch. */
6
15
  export declare function nativeTargetArgs(dispatch: boolean | undefined, target: unknown, args?: readonly string[]): string[];
@@ -8,6 +8,18 @@ export interface HookMeta {
8
8
  bundledEntry?: string;
9
9
  /** Requires the owning runner to pass the installer-selected native target. */
10
10
  nativeTargetDispatch?: boolean;
11
+ /**
12
+ * The hook reads the assistant's final message from its stdin payload.
13
+ * Install refuses a target that does not deliver one (`deliversFinalMessage`
14
+ * in the capability model) rather than wiring a hook that can never fire.
15
+ */
16
+ requiresFinalMessage?: boolean;
17
+ /**
18
+ * The hook's verdict must hold the turn open. Install refuses a target whose
19
+ * verdict cannot hold it (`canBlock` in the capability model) rather than
20
+ * wiring a hook whose block is silently ignored.
21
+ */
22
+ requiresBlock?: boolean;
11
23
  name: string;
12
24
  displayName: string;
13
25
  description: string;
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Install adapters for harnesses whose config is not a JSON settings file.
3
+ *
4
+ * Claude, Codex, Gemini, Qwen and Codewith are settings targets: installer.ts
5
+ * writes `hooks[event][]` into a JSON/TOML settings file it owns the shape of.
6
+ * Muse, Kimi, Pi and Cursor are not: each has its own config format and its own
7
+ * idea of what a registered hook is. This module is the only writer for those
8
+ * four, so the format knowledge lives in one place and every entry still reads
9
+ * `hooks run <name> --target <harness>` — the command the capability model
10
+ * promises.
11
+ *
12
+ * Every writer here is additive and idempotent: an existing entry for the same
13
+ * hook is reported as already installed rather than duplicated, and nothing
14
+ * outside the entries Hooks owns is rewritten.
15
+ *
16
+ * Removal is honest per harness: Cursor and Kimi entries are removed from their
17
+ * own files, Pi drops the hook from the profile the bridge reads, and Muse is
18
+ * unregistered through its own `muse plugins remove <id>` — deleting our bundle
19
+ * alone would leave Muse running a plugin whose source has gone (measured on
20
+ * Muse Code 1.4.4: `muse plugins remove <id> [--delete-data] [--json]`).
21
+ *
22
+ * A config that cannot be READ is reported, never treated as an empty one: a
23
+ * hook whose state is unknown may still be registered there, so a caller gets a
24
+ * named failure with the harness and the read error instead of a silent
25
+ * success.
26
+ */
27
+ export declare const ADAPTER_TARGETS: readonly ["muse", "kimi", "pi", "cursor"];
28
+ export type AdapterTarget = typeof ADAPTER_TARGETS[number];
29
+ export declare function isAdapterTarget(value: unknown): value is AdapterTarget;
30
+ export interface RunOutcome {
31
+ status: number;
32
+ stdout: string;
33
+ stderr: string;
34
+ /** The harness binary is not on PATH. */
35
+ notFound?: boolean;
36
+ }
37
+ /** Test seam: every harness command the adapters run goes through this. */
38
+ export type AdapterRunner = (command: string, args: string[]) => RunOutcome;
39
+ export interface AdapterOptions {
40
+ scope: "global" | "project";
41
+ home?: string;
42
+ cwd?: string;
43
+ env?: NodeJS.ProcessEnv;
44
+ /** Hook metadata copied into a Muse plugin manifest. */
45
+ version?: string;
46
+ description?: string;
47
+ run?: AdapterRunner;
48
+ }
49
+ /** One registration the harness's own config currently carries. */
50
+ export interface AdapterRegistration {
51
+ hook: string;
52
+ command: string;
53
+ }
54
+ /**
55
+ * What one adapter's own config says, and whether it could be read at all.
56
+ *
57
+ * `unverified` is not `[]`: an unreadable config may still carry the hook, so a
58
+ * caller must report the read failure rather than conclude "not registered".
59
+ */
60
+ export interface AdapterReadState {
61
+ status: "verified" | "unverified";
62
+ registrations: AdapterRegistration[];
63
+ /** Always present when status is "unverified"; names the file or command and the error. */
64
+ reason?: string;
65
+ /**
66
+ * The harness itself is not installed here, so it carries no registration:
67
+ * an unverified read whose cause is absence, not an unreadable store. Only
68
+ * Muse can answer this — Kimi, Pi and Cursor keep the registration in the
69
+ * file that would be missing, and a missing file is a verified empty read.
70
+ */
71
+ absent?: boolean;
72
+ }
73
+ /** Muse's own plugin store: the registrations it will actually run. */
74
+ export interface MuseState extends AdapterReadState {
75
+ /** Installed by Muse but not enabled (approval pending), so it never runs. */
76
+ inactive: string[];
77
+ /** The authority this state was read from. */
78
+ source: string;
79
+ }
80
+ export interface AdapterInstallOutcome {
81
+ ok: boolean;
82
+ /** The file (or, for Muse, the bundle directory) the adapter owns. */
83
+ configPath: string;
84
+ /** What the receipt must say honestly; never a claim that the harness runs it. */
85
+ note?: string;
86
+ /** Why the install did not complete, with the exact command that would finish it. */
87
+ error?: string;
88
+ }
89
+ export interface AdapterRemoveOutcome {
90
+ removed: boolean;
91
+ reason?: string;
92
+ /**
93
+ * Muse only: whether the install source this removal deleted was actually
94
+ * there. Undefined means the adapter did not look, so a caller must not
95
+ * turn it into "no bundle was present".
96
+ */
97
+ bundleRemoved?: boolean;
98
+ }
99
+ /** The hook name inside a written registration command, or undefined. */
100
+ export declare function hookFromCommand(command: string): string | undefined;
101
+ /**
102
+ * The file (or, for Muse, the bundle directory) an adapter owns for a scope.
103
+ *
104
+ * Exported so removal can tell a scope-invariant store from a scope-dependent
105
+ * one: Muse, Kimi and Pi resolve to the same path for both scopes, so acting on
106
+ * both scopes would attempt the same removal twice.
107
+ */
108
+ export declare function adapterStorePath(target: AdapterTarget, options: AdapterOptions, hook?: string): string;
109
+ /**
110
+ * Muse's own registration state, read from its plugin store.
111
+ *
112
+ * A bundle under our plugin root is a file Hooks wrote; Muse's store is what
113
+ * says whether Muse carries the plugin and will run it. Every reason this
114
+ * cannot be read is returned, never flattened into "no plugins".
115
+ */
116
+ export declare function readMuseState(options: AdapterOptions, runner?: AdapterRunner): MuseState;
117
+ /**
118
+ * What one adapter's own config (or, for Muse, its plugin store) says.
119
+ *
120
+ * Never throws, and never answers `registrations: []` for a failure: a config
121
+ * that cannot be read is `unverified` with the harness and the read error, so a
122
+ * caller cannot mistake it for "not registered" and report a removal that never
123
+ * happened.
124
+ */
125
+ export declare function readAdapterState(target: AdapterTarget, options: AdapterOptions, runner?: AdapterRunner): AdapterReadState;
126
+ /**
127
+ * Every registration the harness's own config currently carries.
128
+ *
129
+ * Muse is answered from the bundle files Hooks wrote — a filesystem read that
130
+ * never spawns the harness — so hot paths stay subprocess-free. The plugin
131
+ * store is the authority and is read by `readMuseState`, which doctor and
132
+ * uninstall use. A config that cannot be read yields no registration here;
133
+ * `readAdapterState` is the call that reports why.
134
+ */
135
+ export declare function readAdapterRegistrations(target: AdapterTarget, options: AdapterOptions): AdapterRegistration[];
136
+ /**
137
+ * Whether the harness's own store carries this hook, either as a running
138
+ * registration or as one it installed but did not enable.
139
+ *
140
+ * Muse keeps a plugin it has not approved: it never runs, so it is not a
141
+ * registration, but it is still in Muse's store — a removal that read only
142
+ * the enabled plugins would leave both the plugin and its bundle behind.
143
+ */
144
+ export declare function adapterStateCarries(state: AdapterReadState, hook: string): boolean;
145
+ /**
146
+ * Write one registration into the harness's own config. `command` is the exact
147
+ * `hooks run <name> --target <harness>` string the config must carry.
148
+ */
149
+ export declare function installInAdapter(target: AdapterTarget, hook: string, command: string, options: AdapterOptions, timeoutSeconds?: number): AdapterInstallOutcome;
150
+ /** Remove one registration from the harness's own config, or say why it stays. */
151
+ export declare function removeFromAdapter(target: AdapterTarget, hook: string, options: AdapterOptions): AdapterRemoveOutcome;
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Target capability model.
3
+ *
4
+ * A target is not just a config writer: it is a promise about what a hook can
5
+ * do there. Every install/remove/doctor/run path reads this record instead of
6
+ * assuming that each harness behaves like Claude Code, so a hook can never be
7
+ * written into a config where the runtime would silently ignore it.
8
+ *
9
+ * `configPath` is resolved per scope + home; it is the file (or, for Muse, the
10
+ * plugin directory) the adapter writes.
11
+ *
12
+ * Continuation caps are per harness and are NOT ours to change: 8 consecutive
13
+ * blocks in Claude Code, Codex, Copilot, Grok and Junie; 5 follow-ups in Cursor
14
+ * and Amp. Our own stop-hook cap is 10, so a loop is bounded by the SMALLER of
15
+ * the two — the harness's number wins on every target that caps it.
16
+ */
17
+ export type TargetScope = "global" | "project";
18
+ /** Every harness the CLI can name. `all` is a group, not a target. */
19
+ export declare const TARGET_NAMES: readonly ["claude", "codex", "gemini", "codewith", "qwen", "muse", "kimi", "pi", "cursor", "opencode", "sumi"];
20
+ export type TargetName = typeof TARGET_NAMES[number];
21
+ /** Targets whose own config the CLI can write: they accept `hooks install`. */
22
+ export declare const INSTALL_TARGET_NAMES: readonly ["claude", "codex", "gemini", "codewith", "qwen", "muse", "kimi", "pi", "cursor"];
23
+ export type InstallTargetName = typeof INSTALL_TARGET_NAMES[number];
24
+ export declare function isTargetName(value: unknown): value is TargetName;
25
+ export declare function isInstallTargetName(value: unknown): value is InstallTargetName;
26
+ export interface TargetCapabilities {
27
+ /** The CLI can write this harness's own config. */
28
+ install: boolean;
29
+ /** `hooks run --target <name>` has a payload shape for this harness. */
30
+ run: boolean;
31
+ /** The harness's turn-end event name; null when the harness has none. */
32
+ stopEvent: string | null;
33
+ /** A hook can hold the turn open there. */
34
+ canBlock: boolean;
35
+ /** The hook payload carries the assistant's last message. */
36
+ deliversFinalMessage: boolean;
37
+ /** Resolved per scope + home. */
38
+ configPath: string;
39
+ }
40
+ export interface CapabilityOptions {
41
+ scope?: TargetScope;
42
+ home?: string;
43
+ cwd?: string;
44
+ env?: NodeJS.ProcessEnv;
45
+ /** Muse keeps one bundle per hook; every other target ignores it. */
46
+ hook?: string;
47
+ }
48
+ /** The capability record for one target. Unknown names return undefined. */
49
+ export declare function getTargetCapabilities(target: string, options?: CapabilityOptions): TargetCapabilities | undefined;
50
+ /** The payload field carrying the assistant's last message, when the target delivers one. */
51
+ export declare function finalMessageField(target: string): string | undefined;
52
+ /** The directory holding every Muse plugin bundle Hooks owns. */
53
+ export declare function musePluginRoot(options?: CapabilityOptions): string;
54
+ /** The honest note an install receipt carries for this target, when it has one. */
55
+ export declare function targetInstallNote(target: string): string | undefined;
56
+ /** `hooks run --target` names, in help order. */
57
+ export declare function runTargetHelp(): string;
58
+ /**
59
+ * Fail-closed refusal for `hooks run`: an unknown name has no payload shape,
60
+ * and an unparsable verdict is worse than a named refusal.
61
+ */
62
+ export declare function runTargetRefusal(target: string): string | undefined;
63
+ export interface TargetRequirement {
64
+ events: readonly string[];
65
+ /** The hook's manifest declares `requires_final_message: true`. */
66
+ requiresFinalMessage: boolean;
67
+ /** The hook's manifest declares `requires_block: true`. */
68
+ requiresBlock: boolean;
69
+ }
70
+ /**
71
+ * Refuse an install the harness can never run.
72
+ *
73
+ * Returns the exact, actionable reason — naming the harness, the missing
74
+ * capability and what would unblock it — or undefined when the target can
75
+ * honour the hook.
76
+ */
77
+ export declare function installCapabilityRefusal(hook: string, target: string, requirement: TargetRequirement, options?: CapabilityOptions): string | undefined;
78
+ export interface RunOutput {
79
+ stdout: string;
80
+ stderr: string;
81
+ exitCode: number;
82
+ }
83
+ /**
84
+ * Shape the hook's stdin for a target.
85
+ *
86
+ * Muse hands the final message back as a quoted JSON string; parsing it once
87
+ * is what makes the Claude-shaped contract hold there. Every other target gets
88
+ * the payload untouched.
89
+ */
90
+ export declare function shapeTargetInput(target: string | undefined, stdin: string): string;
91
+ /**
92
+ * Shape the hook's verdict for a target.
93
+ *
94
+ * Kimi blocks with exit 2 + stderr (once per turn) and reads no JSON verdict,
95
+ * so a `{"decision":"block","reason"}` is translated rather than written to a
96
+ * file Kimi never reads. Claude, Codex, Gemini, Codewith, Qwen, Muse, Pi and
97
+ * Cursor consume the verdict as the hook produced it.
98
+ */
99
+ export declare function shapeTargetOutput(target: string | undefined, output: RunOutput): RunOutput;
@@ -323,16 +323,16 @@ async function handleReadinessSessionStart(provider, event, dependencies = {}) {
323
323
  return readinessSessionStartOutput(await runTrashReadiness(provider, dependencies));
324
324
  }
325
325
  export {
326
- trashReadinessBindingPath,
327
- runTrashReadiness,
328
- readinessSessionStartOutput,
329
- readinessContext,
330
- readTrashReadinessBindingFile,
331
- parseTrashReadinessBinding,
332
- isReadinessProvider,
333
- handleReadinessSessionStart,
334
- checkTrashReadinessBinding,
335
- TRASH_READINESS_NATIVE_TIMEOUT_SECONDS,
326
+ TRASH_READINESS_DEFAULT_TIMEOUT_MS,
336
327
  TRASH_READINESS_MAX_TIMEOUT_MS,
337
- TRASH_READINESS_DEFAULT_TIMEOUT_MS
328
+ TRASH_READINESS_NATIVE_TIMEOUT_SECONDS,
329
+ checkTrashReadinessBinding,
330
+ handleReadinessSessionStart,
331
+ isReadinessProvider,
332
+ parseTrashReadinessBinding,
333
+ readTrashReadinessBindingFile,
334
+ readinessContext,
335
+ readinessSessionStartOutput,
336
+ runTrashReadiness,
337
+ trashReadinessBindingPath
338
338
  };
@@ -588,14 +588,14 @@ async function verifyNativeSafetyExecutionRegistration(home = homedir2()) {
588
588
  return { path: before.path, sha256: before.sha256 };
589
589
  }
590
590
  export {
591
- verifyNativeSafetyRegistration,
592
- verifyNativeSafetyExecutionRegistration,
593
- verifyNativeSafetyCommand,
594
- registerNativeSafety,
595
- readNativeSafetyRegistration,
596
- nativeSafetyRecordText,
597
- nativeSafetyBindingIntegrityReason,
598
- evaluateNativeSafetyForExecution,
591
+ NativeSafetyError,
599
592
  evaluateNativeSafety,
600
- NativeSafetyError
593
+ evaluateNativeSafetyForExecution,
594
+ nativeSafetyBindingIntegrityReason,
595
+ nativeSafetyRecordText,
596
+ readNativeSafetyRegistration,
597
+ registerNativeSafety,
598
+ verifyNativeSafetyCommand,
599
+ verifyNativeSafetyExecutionRegistration,
600
+ verifyNativeSafetyRegistration
601
601
  };
@@ -385,10 +385,10 @@ var opencode_stop_plugin_default = {
385
385
  server: async (input, options) => createOpenCodeStopReviewPlugin(options).server(input)
386
386
  };
387
387
  export {
388
- isOpenCodeStopReviewCapability,
389
- opencode_stop_plugin_default as default,
390
- createOpenCodeStopReviewPlugin,
391
- OPENCODE_STOP_PLUGIN_SCHEMA,
388
+ OPENCODE_STOP_HOOK,
392
389
  OPENCODE_STOP_PLUGIN_ID,
393
- OPENCODE_STOP_HOOK
390
+ OPENCODE_STOP_PLUGIN_SCHEMA,
391
+ createOpenCodeStopReviewPlugin,
392
+ opencode_stop_plugin_default as default,
393
+ isOpenCodeStopReviewCapability
394
394
  };
package/dist/sdk/index.js CHANGED
@@ -1508,12 +1508,12 @@ function createHooksClient(options = {}) {
1508
1508
  return new HooksClient(authority, { fetch: options.fetch });
1509
1509
  }
1510
1510
  export {
1511
- resolveHooksSdkAuthority,
1512
- hooksRegistryOrigin,
1513
- hooksRegistryApiClientFor,
1514
- createHooksRegistryApiClient,
1515
- createHooksClient,
1516
- ApiError as HooksRegistryApiError,
1511
+ HooksClient,
1517
1512
  HooksRegistryApiClient,
1518
- HooksClient
1513
+ ApiError as HooksRegistryApiError,
1514
+ createHooksClient,
1515
+ createHooksRegistryApiClient,
1516
+ hooksRegistryApiClientFor,
1517
+ hooksRegistryOrigin,
1518
+ resolveHooksSdkAuthority
1519
1519
  };
package/dist/storage.js CHANGED
@@ -166,7 +166,7 @@ function up(db) {
166
166
  db.exec(idx);
167
167
  }
168
168
  }
169
- var init_001_initial = __esm(() => {
169
+ var init__001_initial = __esm(() => {
170
170
  init_schema();
171
171
  });
172
172
 
@@ -195,7 +195,7 @@ function up2(db) {
195
195
  throw err;
196
196
  }
197
197
  }
198
- var init_002_session_events = __esm(() => {
198
+ var init__002_session_events = __esm(() => {
199
199
  init_schema();
200
200
  });
201
201
 
@@ -224,7 +224,7 @@ function up3(db) {
224
224
  throw err;
225
225
  }
226
226
  }
227
- var init_003_user_prompt_submit_event = __esm(() => {
227
+ var init__003_user_prompt_submit_event = __esm(() => {
228
228
  init_schema();
229
229
  });
230
230
 
@@ -248,7 +248,7 @@ var CREATE_HOOKS_TABLE = `
248
248
  last_verified_at TEXT
249
249
  )
250
250
  `, CREATE_HOOKS_INDEXES;
251
- var init_004_hooks_table = __esm(() => {
251
+ var init__004_hooks_table = __esm(() => {
252
252
  CREATE_HOOKS_INDEXES = [
253
253
  `CREATE INDEX IF NOT EXISTS idx_hooks_name ON hooks (name)`
254
254
  ];
@@ -279,7 +279,7 @@ function up5(db) {
279
279
  throw err;
280
280
  }
281
281
  }
282
- var init_005_subagent_start_event = __esm(() => {
282
+ var init__005_subagent_start_event = __esm(() => {
283
283
  init_schema();
284
284
  });
285
285
 
@@ -311,11 +311,11 @@ function runMigrations(db) {
311
311
  }
312
312
  var MIGRATIONS;
313
313
  var init_migrations = __esm(() => {
314
- init_001_initial();
315
- init_002_session_events();
316
- init_003_user_prompt_submit_event();
317
- init_004_hooks_table();
318
- init_005_subagent_start_event();
314
+ init__001_initial();
315
+ init__002_session_events();
316
+ init__003_user_prompt_submit_event();
317
+ init__004_hooks_table();
318
+ init__005_subagent_start_event();
319
319
  MIGRATIONS = [
320
320
  { version: "001_initial", up },
321
321
  { version: "002_session_events", up: up2 },
@@ -1047,29 +1047,29 @@ function coerceForSqlite(value) {
1047
1047
  return String(value);
1048
1048
  }
1049
1049
  export {
1050
- storageSync,
1051
- storagePush,
1052
- storagePull,
1053
- runStorageMigrations,
1054
- resolveTables,
1055
- parseStorageTables,
1056
- getSyncMetaAll,
1057
- getStorageStatus,
1058
- getStoragePg,
1059
- getStorageDatabaseUrl,
1060
- getStorageDatabaseEnvName,
1061
- getStorageDatabaseEnv,
1062
- getStorageBackend,
1063
- STORAGE_TABLES,
1064
- STORAGE_DATABASE_ENV,
1065
- STORAGE_BACKEND_ENV,
1066
- STORAGE_BACKENDS,
1067
- RETIRED_STORAGE_MODE_ENV,
1068
- PgAdapterAsync,
1069
- PG_MIGRATIONS,
1070
- HOOKS_STORAGE_TABLES,
1071
- HOOKS_STORAGE_FALLBACK_ENV,
1072
- HOOKS_STORAGE_ENV,
1050
+ HOOKS_STORAGE_BACKEND_ENV,
1073
1051
  HOOKS_STORAGE_BACKEND_FALLBACK_ENV,
1074
- HOOKS_STORAGE_BACKEND_ENV
1052
+ HOOKS_STORAGE_ENV,
1053
+ HOOKS_STORAGE_FALLBACK_ENV,
1054
+ HOOKS_STORAGE_TABLES,
1055
+ PG_MIGRATIONS,
1056
+ PgAdapterAsync,
1057
+ RETIRED_STORAGE_MODE_ENV,
1058
+ STORAGE_BACKENDS,
1059
+ STORAGE_BACKEND_ENV,
1060
+ STORAGE_DATABASE_ENV,
1061
+ STORAGE_TABLES,
1062
+ getStorageBackend,
1063
+ getStorageDatabaseEnv,
1064
+ getStorageDatabaseEnvName,
1065
+ getStorageDatabaseUrl,
1066
+ getStoragePg,
1067
+ getStorageStatus,
1068
+ getSyncMetaAll,
1069
+ parseStorageTables,
1070
+ resolveTables,
1071
+ runStorageMigrations,
1072
+ storagePull,
1073
+ storagePush,
1074
+ storageSync
1075
1075
  };
@@ -388,12 +388,12 @@ function createSumiStopReviewPlugin(options, dependencies = {}) {
388
388
  };
389
389
  }
390
390
  export {
391
- verifySumiStopReviewCommand,
392
- runSumiStopReviewCommand,
393
- requestParentStopReview,
394
- parentStopReviewPins,
395
- isSumiStopReviewResult,
396
- isSumiStopReviewEnvelope,
391
+ createSumiStopReviewPlugin,
397
392
  isParentStopReviewResult,
398
- createSumiStopReviewPlugin
393
+ isSumiStopReviewEnvelope,
394
+ isSumiStopReviewResult,
395
+ parentStopReviewPins,
396
+ requestParentStopReview,
397
+ runSumiStopReviewCommand,
398
+ verifySumiStopReviewCommand
399
399
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/hooks",
3
- "version": "0.12.23",
3
+ "version": "0.13.0",
4
4
  "description": "Open source hooks library for AI coding agents - Install safety, quality, and automation hooks with a single command",
5
5
  "type": "module",
6
6
  "bin": {