@hasna/hooks 0.9.4 → 0.9.6
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 +40 -2
- package/bin/hooks-mcp.js +330 -149
- package/bin/index.js +974 -350
- package/bin/native-safety-entry.js +1136 -0
- package/bin/serve.js +559 -165
- package/dist/index.d.ts +1 -1
- package/dist/index.js +902 -290
- package/dist/lib/native-safety.d.ts +15 -0
- package/dist/lib/resolver-types.d.ts +1 -1
- package/dist/lib/sync.d.ts +3 -2
- package/dist/lib/transport.d.ts +5 -1
- package/dist/openapi.d.ts +314 -45
- package/dist/sdk/authority.d.ts +31 -0
- package/dist/sdk/generated.d.ts +97 -0
- package/dist/sdk/index.d.ts +16 -17
- package/dist/sdk/index.js +447 -47
- package/dist/sdk/registry-client.d.ts +75 -0
- package/hooks/native-safety-entry.ts +28 -0
- package/package.json +8 -5
- package/scripts/generate-sdk.ts +60 -0
- package/scripts/validate-package.ts +104 -2
- package/scripts/verify-generated-artifacts.ts +237 -0
package/dist/sdk/index.d.ts
CHANGED
|
@@ -16,10 +16,17 @@
|
|
|
16
16
|
* opt-in (`HASNA_HOOKS_LOCAL=1`) is refused here by name: the SDK is a hosted
|
|
17
17
|
* client and the on-box store is the CLI's, opt-in only.
|
|
18
18
|
*/
|
|
19
|
-
import { hooksRegistryOrigin, type HooksRemoteAuthority
|
|
19
|
+
import { hooksRegistryOrigin, type HooksRemoteAuthority } from "../lib/transport.js";
|
|
20
20
|
import type { HooksCredentialOptions, HooksLocalOptInEnv } from "../lib/resolver-types.js";
|
|
21
|
+
import { type HooksClientOptions } from "./authority.js";
|
|
21
22
|
export type { HooksRemoteAuthority, HooksCredentialOptions, HooksLocalOptInEnv };
|
|
22
23
|
export { hooksRegistryOrigin };
|
|
24
|
+
export { resolveHooksSdkAuthority } from "./authority.js";
|
|
25
|
+
export type { HooksClientOptions } from "./authority.js";
|
|
26
|
+
export { HooksRegistryApiClient, ApiError as HooksRegistryApiError } from "./generated.js";
|
|
27
|
+
export type { HooksRegistryApiClientOptions, HooksHealth, HooksVersion, HooksCatalogEntry, HooksCatalog, HooksLockEntry, HooksLock, HooksManifest, HooksArtifact, HooksError, HooksPublishRequest, HooksPublishResponse, } from "./generated.js";
|
|
28
|
+
export { createHooksRegistryApiClient, hooksRegistryApiClientFor, } from "./registry-client.js";
|
|
29
|
+
export type { HooksRegistryApiClientAuthority, ResolvedHooksRegistryApiClient, } from "./registry-client.js";
|
|
23
30
|
/** One row of `GET /api/v1/catalog` — the registry's latest version of a hook. */
|
|
24
31
|
export interface HooksRegistryCatalogEntry {
|
|
25
32
|
name: string;
|
|
@@ -56,23 +63,15 @@ export interface HooksRegistryArtifact {
|
|
|
56
63
|
/** The registry's `x-hook-sha256` header for the served row, when present. */
|
|
57
64
|
sha256: string | null;
|
|
58
65
|
}
|
|
59
|
-
export interface HooksClientOptions {
|
|
60
|
-
/** Injectable environment (tests). Defaults to `process.env`. */
|
|
61
|
-
env?: HooksLocalOptInEnv;
|
|
62
|
-
/** Tier-1 credential inputs and the injectable `security` runner. */
|
|
63
|
-
credentials?: HooksCredentialOptions;
|
|
64
|
-
/** Injectable fetch (tests). Defaults to the global `fetch`. */
|
|
65
|
-
fetch?: typeof fetch;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Resolve the hosted authority the SDK will talk to. Throws — never returns a
|
|
69
|
-
* local fallback — when nothing resolves, and refuses the local opt-in by
|
|
70
|
-
* name: there is no SDK surface for the on-box store.
|
|
71
|
-
*/
|
|
72
|
-
export declare function resolveHooksSdkAuthority(env?: HooksLocalOptInEnv, options?: Omit<HooksTransportOptions, "notice">): HooksRemoteAuthority;
|
|
73
66
|
/**
|
|
74
|
-
* Hosted registry client. Holds the
|
|
75
|
-
*
|
|
67
|
+
* Hosted registry client. Holds the authority binding privately and resolves
|
|
68
|
+
* its current credential for each request before dispatch to that authority.
|
|
69
|
+
*
|
|
70
|
+
* This is the hand-kept, stable surface: it pins the `REMOTE_API_*` error
|
|
71
|
+
* codes, the raw `x-hook-sha256` header on `artifact()`, and the
|
|
72
|
+
* never-follow-a-redirect rule. `HooksRegistryApiClient` (./generated.ts) is
|
|
73
|
+
* the generated counterpart over the same served routes; it is additive, not
|
|
74
|
+
* a replacement.
|
|
76
75
|
*/
|
|
77
76
|
export declare class HooksClient {
|
|
78
77
|
#private;
|