@hasna/hooks 0.7.9 → 0.8.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 +32 -6
- package/bin/index.js +1573 -695
- package/bin/serve.js +713 -335
- package/dist/config.d.ts +25 -19
- package/dist/db/index.d.ts +3 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1162 -473
- package/dist/lib/app-home.d.ts +74 -0
- package/dist/lib/installer.d.ts +0 -9
- package/dist/lib/local-opt-in.d.ts +80 -0
- package/dist/lib/profiles.d.ts +14 -1
- package/dist/lib/resolver-types.d.ts +45 -0
- package/dist/lib/sync.d.ts +13 -8
- package/dist/lib/transport.d.ts +87 -0
- package/dist/openapi.d.ts +1 -1
- package/dist/serve.d.ts +7 -0
- package/dist/storage.js +141 -27
- package/hooks/hook-affected-tests/package.json +1 -1
- package/hooks/hook-agent-rules-version-check/package.json +1 -1
- package/hooks/hook-agentmessages/package.json +1 -1
- package/hooks/hook-announce-start/package.json +1 -1
- package/hooks/hook-announce-stop/package.json +1 -1
- package/hooks/hook-autoformat/package.json +1 -1
- package/hooks/hook-branchprotect/package.json +1 -1
- package/hooks/hook-checkbugs/package.json +1 -1
- package/hooks/hook-checkdocs/package.json +1 -1
- package/hooks/hook-checkfiles/package.json +1 -1
- package/hooks/hook-checklint/package.json +1 -1
- package/hooks/hook-checkpoint/package.json +1 -1
- package/hooks/hook-checksecurity/package.json +1 -1
- package/hooks/hook-checktasks/package.json +1 -1
- package/hooks/hook-checktests/package.json +1 -1
- package/hooks/hook-conflict-detect/package.json +1 -1
- package/hooks/hook-contextrefresh/package.json +1 -1
- package/hooks/hook-desktopnotify/package.json +1 -1
- package/hooks/hook-dm-inject/package.json +1 -1
- package/hooks/hook-envsetup/package.json +1 -1
- package/hooks/hook-failure-to-task/package.json +1 -1
- package/hooks/hook-filelock/package.json +1 -1
- package/hooks/hook-fleet-blockers-gate/package.json +1 -1
- package/hooks/hook-fleet-catchup/package.json +1 -1
- package/hooks/hook-gitguard/package.json +1 -1
- package/hooks/hook-packageage/package.json +1 -1
- package/hooks/hook-permissionguard/package.json +1 -1
- package/hooks/hook-phonenotify/package.json +1 -1
- package/hooks/hook-precompact/package.json +1 -1
- package/hooks/hook-protectfiles/package.json +1 -1
- package/hooks/hook-stylescheck/package.json +1 -1
- package/hooks/hook-typecheck-gate/package.json +1 -1
- package/package.json +6 -9
- package/scripts/artifact-scan.ts +49 -0
- package/scripts/ensure-profiles-dir.mjs +99 -0
- package/scripts/validate-package.ts +280 -0
package/dist/config.d.ts
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Runtime configuration for @hasna/hooks.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Transport policy (fleet fail-closed doctrine, 2026-09-04): the remote
|
|
5
|
+
* registry is selected and authenticated by the ONE resolver in
|
|
6
|
+
* `@hasna/contracts/client` (strict URL+key pair, resolved fresh per call —
|
|
7
|
+
* see `src/lib/transport.ts`). Without a resolved pair the CLI must FAIL
|
|
8
|
+
* CLOSED instead of silently serving the local store. Local mode (bundled
|
|
9
|
+
* registry + local SQLite at the effective data root) is an explicit opt-in
|
|
10
|
+
* via HASNA_HOOKS_LOCAL=1 / HOOKS_LOCAL=1 — never the default for a CLI run.
|
|
11
|
+
*
|
|
12
|
+
* The app's own credential chain is gone: no `~/.hasna/fleet-env`,
|
|
13
|
+
* `~/.hasna/cloud`, `~/.config/hasna` or `$XDG_CONFIG_HOME` read, no
|
|
14
|
+
* `~/.hasna/hooks/config.json` `api_url` / `api_key_ref` key store, no
|
|
15
|
+
* `HASNA_HOOKS_REGISTRY_URL` / `HOOKS_REGISTRY_URL` spellings, no `*_MODE`
|
|
16
|
+
* transport switches. The authority and the credential both come from
|
|
17
|
+
* @hasna/contracts, which resolves per call: Keychain `hasna.credentials.hooks.*`,
|
|
18
|
+
* disk `~/.hasna/hooks/config/credentials`, then `HASNA_HOOKS_API_URL` /
|
|
19
|
+
* `HASNA_HOOKS_API_KEY` (the unprefixed `HOOKS_*` spellings remain only as the
|
|
20
|
+
* resolver's silent alias fallback).
|
|
6
21
|
*/
|
|
7
22
|
export declare function getHooksDataDir(): string;
|
|
8
23
|
export declare function getCustomHooksDir(): string;
|
|
9
24
|
export declare function getLockPath(): string;
|
|
10
|
-
export declare function getConfigPath(): string;
|
|
11
|
-
export interface HooksConfig {
|
|
12
|
-
api_url?: string;
|
|
13
|
-
api_key_ref?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare function readConfig(): HooksConfig;
|
|
16
|
-
export declare function writeConfig(config: HooksConfig): string;
|
|
17
|
-
export declare function resolveApiUrl(): string | undefined;
|
|
18
25
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* and
|
|
26
|
-
*/
|
|
27
|
-
export declare function resolveApiKey(): string | undefined;
|
|
26
|
+
* The legacy `config.json` reader/writer and its `api_url` / `api_key_ref`
|
|
27
|
+
* fields were REMOVED (hasna/apps#1720): the file was this package's own
|
|
28
|
+
* configuration key store, outranked the canonical env names for operators who
|
|
29
|
+
* had both, and carried a secret-valued reference outside the resolver's
|
|
30
|
+
* chain. The registry authority and its credential now resolve exclusively
|
|
31
|
+
* through `@hasna/contracts` (env, Keychain item `hasna.credentials.hooks.api-url`
|
|
32
|
+
* / `.api-key`, and `~/.hasna/hooks/config/credentials`).
|
|
33
|
+
*/
|
package/dist/db/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SQLite DB module for hooks — persistent storage at
|
|
2
|
+
* SQLite DB module for hooks — persistent storage at the effective data
|
|
3
|
+
* root resolved through @hasna/paths (legacy ~/.hasna/hooks until adopted,
|
|
4
|
+
* then the XDG data home) at hooks.db.
|
|
3
5
|
*
|
|
4
6
|
* Uses bun:sqlite with WAL mode for concurrent reads.
|
|
5
7
|
* Supports HASNA_HOOKS_DATA_DIR / HOOKS_DATA_DIR and HASNA_HOOKS_DB_PATH / HOOKS_DB_PATH env overrides.
|
package/dist/index.d.ts
CHANGED
|
@@ -74,8 +74,9 @@ export declare function runHook(name: string, input: HookInput, options?: RunHoo
|
|
|
74
74
|
export { createProfile, getProfile, listProfiles, updateProfile, deleteProfile, touchProfile, getProfilesDir, exportProfiles, importProfiles, type AgentProfile, type CreateProfileInput, } from "./lib/profiles.js";
|
|
75
75
|
export { HOOKS_STORAGE_ENV, HOOKS_STORAGE_FALLBACK_ENV, HOOKS_STORAGE_BACKEND_ENV, HOOKS_STORAGE_BACKEND_FALLBACK_ENV, HOOKS_STORAGE_TABLES, RETIRED_STORAGE_MODE_ENV, STORAGE_BACKENDS, STORAGE_BACKEND_ENV, STORAGE_DATABASE_ENV, STORAGE_TABLES, getStorageBackend, getStorageDatabaseEnv, getStorageDatabaseEnvName, getStorageDatabaseUrl, getStoragePg, getStorageStatus, getSyncMetaAll, parseStorageTables, resolveTables, runStorageMigrations, storagePull, storagePush, storageSync, } from "./storage.js";
|
|
76
76
|
export type { StorageBackend, StorageEnv, StorageStatus, SyncMeta, SyncResult } from "./storage.js";
|
|
77
|
-
export { getHooksDataDir, getCustomHooksDir, getLockPath,
|
|
78
|
-
export type
|
|
77
|
+
export { getHooksDataDir, getCustomHooksDir, getLockPath, } from "./config.js";
|
|
78
|
+
export { resolveHooksTransport, resolveHooksServePublishKey, hooksRegistryOrigin, type HooksRemoteAuthority, type HooksCredentialOptions, type HooksTransportMode, type HooksTransportNotice, type HooksTransportOptions, type HooksTransportResolution, } from "./lib/transport.js";
|
|
79
|
+
export type { HooksLocalOptInEnv } from "./lib/resolver-types.js";
|
|
79
80
|
export { getHookRecord, listHookRecords, upsertHookRecord, removeHookRecord, readLock, writeLock, setPinnedHook, getPinnedHook, removePinnedHook, pinInstalledHook, removeHookFromStore, verifyScriptHash, checkScriptHash, retrustHook, sha256Of, sha256File, } from "./lib/store.js";
|
|
80
81
|
export type { HookRecord, LockEntry, LockFile, TrustCheck } from "./lib/store.js";
|
|
81
82
|
export { parseManifest, readCustomManifest, listCustomHooks, writeCustomHook, resolveScript, } from "./lib/manifest.js";
|