@hasna/hooks 0.12.10 → 0.12.16

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.
Files changed (57) hide show
  1. package/README.md +69 -6
  2. package/bin/hooks/stop-review.js +1235 -0
  3. package/bin/hooks-mcp.js +298 -85
  4. package/bin/index.js +3348 -1086
  5. package/bin/native-readiness-entry.js +5 -1
  6. package/bin/native-safety-entry.js +27 -25
  7. package/bin/native-safety-worker.cjs +27 -25
  8. package/bin/serve.js +1362 -70
  9. package/dist/db/remote-storage.d.ts +7 -1
  10. package/dist/index.d.ts +4 -1
  11. package/dist/index.js +1665 -257
  12. package/dist/lib/codex-safety-check.d.ts +1 -1
  13. package/dist/lib/hosted-registry.d.ts +70 -0
  14. package/dist/lib/legacy-registry-artifact.d.ts +23 -0
  15. package/dist/lib/manifest.d.ts +7 -0
  16. package/dist/lib/native-safety.d.ts +1 -0
  17. package/dist/lib/native-target.d.ts +7 -0
  18. package/dist/lib/opencode-stop-plugin.d.ts +55 -0
  19. package/dist/lib/registry-artifact.d.ts +36 -0
  20. package/dist/lib/registry.d.ts +4 -0
  21. package/dist/lib/stop-review-context.d.ts +12 -0
  22. package/dist/lib/store.d.ts +4 -0
  23. package/dist/lib/sumi-stop-plugin.d.ts +129 -0
  24. package/dist/lib/sync.d.ts +10 -0
  25. package/dist/lib/transport.d.ts +1 -1
  26. package/dist/native-readiness.d.ts +1 -1
  27. package/dist/native-readiness.js +5 -1
  28. package/dist/openapi.d.ts +160 -16
  29. package/dist/opencode-stop-plugin.js +384 -0
  30. package/dist/registry-auth.d.ts +5 -0
  31. package/dist/registry-http.d.ts +4 -0
  32. package/dist/sdk/generated.d.ts +32 -12
  33. package/dist/sdk/index.d.ts +28 -5
  34. package/dist/sdk/index.js +49 -24
  35. package/dist/sdk/registry-client.d.ts +1 -1
  36. package/dist/serve.d.ts +4 -4
  37. package/dist/storage.js +33 -2
  38. package/dist/sumi-stop-plugin.js +380 -0
  39. package/hooks/hook-stop-review/README.md +109 -0
  40. package/hooks/hook-stop-review/manifest.json +10 -0
  41. package/hooks/hook-stop-review/package.json +11 -0
  42. package/hooks/hook-stop-review/src/hook.ts +59 -0
  43. package/hooks/hook-stop-review/src/index.ts +3 -0
  44. package/hooks/hook-stop-review/src/jev.ts +121 -0
  45. package/hooks/hook-stop-review/src/native.ts +246 -0
  46. package/hooks/hook-stop-review/src/policy.ts +145 -0
  47. package/hooks/hook-stop-review/src/runtime.ts +309 -0
  48. package/hooks/hook-stop-review/src/types.ts +121 -0
  49. package/hooks/hook-trash-guard/src/hook.ts +96 -0
  50. package/hooks/hook-workspace-repos-guard/src/hook.ts +116 -3
  51. package/hooks/local-executors.ts +841 -0
  52. package/package.json +22 -4
  53. package/scripts/build-bundled-hooks.ts +40 -0
  54. package/scripts/validate-bundled-hooks.ts +78 -0
  55. package/scripts/validate-opencode-stop-plugin.ts +42 -0
  56. package/scripts/validate-package.ts +9 -0
  57. package/scripts/validate-sumi-stop-plugin.ts +47 -0
@@ -22,7 +22,13 @@ export declare function sslConfigFor(connectionString: string): {
22
22
  } | undefined;
23
23
  export declare class PgAdapterAsync {
24
24
  private readonly pool;
25
- constructor(connectionString: string);
25
+ constructor(connectionString: string, options?: {
26
+ timeoutMs?: number;
27
+ });
28
+ /** One connection and a read-only transaction for deployment prerequisite checks. */
29
+ readOnlyAll(sql: string, ...params: unknown[]): Promise<unknown[]>;
30
+ /** One connection; every write in the callback commits together or is rolled back. */
31
+ transaction<T>(operation: (db: Pick<PgAdapterAsync, "run" | "all">) => Promise<T>): Promise<T>;
26
32
  run(sql: string, ...params: unknown[]): Promise<{
27
33
  changes: number;
28
34
  }>;
package/dist/index.d.ts CHANGED
@@ -50,7 +50,10 @@ export declare function installHooksForProject(names: string[], options?: Omit<I
50
50
  export declare function listProjectHooks(): string[];
51
51
  /** Remove a hook from the current project */
52
52
  export declare function removeProjectHook(name: string): boolean;
53
+ import { type HookRunTarget } from "./lib/native-target.js";
53
54
  export interface RunHookOptions {
55
+ /** Trusted native registration target, never derived from hook input. */
56
+ target?: HookRunTarget;
54
57
  /** Agent profile ID to inject into hook input */
55
58
  profile?: string;
56
59
  /**
@@ -67,7 +70,7 @@ export interface RunHookResult {
67
70
  }
68
71
  /**
69
72
  * Programmatically execute a hook with the given input.
70
- * Spawns the hook's src/hook.ts via bun, passes input as stdin JSON,
73
+ * Spawns the resolved execution entry via bun, passes input as stdin JSON,
71
74
  * and returns the parsed stdout JSON.
72
75
  */
73
76
  export declare function runHook(name: string, input: HookInput, options?: RunHookOptions): Promise<RunHookResult>;