@hasna/skills 0.10.15 → 0.10.18

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.
@@ -6,7 +6,7 @@ export { captureDiscoveryDirectories, type DiscoveryDirectory } from "./agent-di
6
6
  export interface DiscoverySource {
7
7
  path: string;
8
8
  sha256: string | null;
9
- hashMode?: "bytes" | "path-bytes" | "claude-plugin-registry" | "claude-marketplace-registry" | "claude-settings-v1" | "claude-settings-v2" | "claude-settings-v3" | "claude-marketplace-registry-v2";
9
+ hashMode?: "bytes" | "path-bytes" | "claude-plugin-registry" | "claude-marketplace-registry" | "claude-settings-v1" | "claude-settings-v2" | "claude-settings-v3" | "claude-marketplace-registry-v2" | "codex-settings-v1";
10
10
  managedPlugins?: ManagedPluginRegistrationWitness[];
11
11
  format?: "json" | "toml" | "yaml";
12
12
  fields?: string[];
@@ -1,3 +1,4 @@
1
+ import { type CodexNativeSkillCatalog } from "./codex-native-skill-catalog.js";
1
2
  import { type AgentDiscoveryBinding, type ReviewedDiscoveryInputs } from "./agent-discovery.js";
2
3
  import { type IntegrationAgent } from "./agent-adapters.js";
3
4
  import type { CodexHookDiscoveryRecovery } from "./codex-hook-discovery-recovery.js";
@@ -42,6 +43,30 @@ export interface AgentConfigChange {
42
43
  after: string;
43
44
  }
44
45
  export interface AgentIntegrationPlan {
46
+ observedNativeSources?: Array<{
47
+ path: string;
48
+ sha256: string;
49
+ }>;
50
+ codexPluginSkillReview?: {
51
+ version: string;
52
+ cwd: string;
53
+ catalogSha256: string;
54
+ configSha256: string | null;
55
+ };
56
+ observedSettings?: {
57
+ path: string;
58
+ before: string;
59
+ };
60
+ settingsWitnessUpgrade?: {
61
+ agent: "claude" | "codex";
62
+ path: string;
63
+ fromHashMode: string;
64
+ fromSha256: string;
65
+ toHashMode: string;
66
+ toSha256: string;
67
+ reviewedPreimage: string;
68
+ currentSettingsSha256: string;
69
+ };
45
70
  dataDir: string;
46
71
  profileId: string;
47
72
  changes: AgentConfigChange[];
@@ -87,6 +112,7 @@ export declare function inventoryNativeSkills(home?: string, options?: {
87
112
  allowRootAliases?: boolean;
88
113
  reviewedCacheAlias?: string;
89
114
  disabledVendorPaths?: readonly string[];
115
+ disabledVendorSkill?: (entry: NativeSkillEntry) => boolean;
90
116
  }): NativeSkillEntry[];
91
117
  /** Planning is read-only; credentials and unrelated settings never appear in CLI output. */
92
118
  export declare function planAgentIntegration(options: {
@@ -100,6 +126,7 @@ export declare function planAgentIntegration(options: {
100
126
  discoveryInputs?: ReviewedDiscoveryInputs;
101
127
  allowRootAliases?: boolean;
102
128
  reviewedCacheAlias?: string;
129
+ codexNativeCatalog?: CodexNativeSkillCatalog;
103
130
  }): AgentIntegrationPlan;
104
131
  /** Plan an explicitly authorized Stop hook replacement without adopting drift.
105
132
  * The caller owns authorization of its exact Stop hook delta; Skills refuses
@@ -119,6 +146,19 @@ export declare function planClaudePreToolUseHookUpdate(options: ClaudeHookUpdate
119
146
  export declare function planClaudeHookEventsUpdate(options: ClaudeHookUpdateOptions & {
120
147
  events: readonly ClaudeCoordinatedHookEvent[];
121
148
  }): AgentIntegrationPlan | null;
149
+ /** Explicitly rebind one legacy review after exact preimage and semantic comparison.
150
+ * Runtime readers never relax the old witness. All other discovery sources,
151
+ * unknown settings, native controls and policy bytes remain guarded.
152
+ */
153
+ export declare function planAgentSettingsWitnessUpgrade(options: {
154
+ agent: "claude" | "codex";
155
+ reviewedPreimage: string;
156
+ home?: string;
157
+ dataDir?: string;
158
+ projectDir?: string;
159
+ expectedPolicySha256: string;
160
+ expectedSettingsSha256: string;
161
+ }): AgentIntegrationPlan;
122
162
  export declare function applyAgentIntegration(plan: AgentIntegrationPlan): {
123
163
  changed: string[];
124
164
  backups: string[];
@@ -9,6 +9,7 @@ export declare const CLAUDE_SETTINGS_WITNESS_LIMITS: Readonly<{
9
9
  export interface ClaudeSettingsWitnessBudget {
10
10
  remaining: number;
11
11
  }
12
+ export declare function readNativeSettingsWitnessFile(path: string, budget: ClaudeSettingsWitnessBudget, filename?: "settings.json" | "config.toml"): string;
12
13
  /** Cooperating installers may replace only their explicitly selected event. Compare the strict syntax
13
14
  * trees, not JSON.parse values or the preference-tolerant witness digest: all
14
15
  * other hooks, discovery settings, unknown values and number spellings remain
@@ -47,6 +48,8 @@ export declare function hashClaudeSettingsReplacementV3(text: string, budget: Cl
47
48
  */
48
49
  export declare function upgradeClaudeSettingsWitness(previous: {
49
50
  path: string;
50
- hashMode: "claude-settings-v1" | "claude-settings-v2";
51
+ hashMode?: "bytes" | "claude-settings-v1" | "claude-settings-v2";
51
52
  sha256: string;
52
53
  }, reviewedSettingsPath: string): ReturnType<typeof captureClaudeSettingsV3>;
54
+ /** Strict bounded JSON control witness; metadata exclusion must be explicit. */
55
+ export declare function hashNativeJsonControls(text: string, excludedMetadata?: "version"): string;
@@ -1,4 +1,4 @@
1
- export declare const SUPPORTED_CODEX_HOOK_VERSIONS: readonly ["codex-cli 0.153.0", "codex-cli 0.154.0", "codex-cli 0.155.0", "codex-cli 0.155.1", "codex-cli 0.156.1", "codex-cli 0.157.0", "codex-cli 0.157.1", "codex-cli 0.158.0", "codex-cli 0.159.0"];
1
+ export declare const SUPPORTED_CODEX_HOOK_VERSIONS: readonly ["codex-cli 0.153.0", "codex-cli 0.154.0", "codex-cli 0.155.0", "codex-cli 0.155.1", "codex-cli 0.156.1", "codex-cli 0.157.0", "codex-cli 0.157.1", "codex-cli 0.158.0", "codex-cli 0.159.0", "codex-cli 0.159.2"];
2
2
  export interface CodexHookRpc {
3
3
  version: string;
4
4
  processId?: number;
@@ -10,4 +10,5 @@ export declare function connectCodexHookRpc(options: {
10
10
  command: string;
11
11
  home: string;
12
12
  codexHome?: string;
13
+ timeoutMs?: number;
13
14
  }): Promise<CodexHookRpc>;
@@ -0,0 +1,36 @@
1
+ import { type CodexHookRpc } from "./codex-hook-rpc.js";
2
+ export interface CodexNativeSkill {
3
+ /** Native qualified name, not a directory name or plugin identifier. */
4
+ name: string;
5
+ path: string;
6
+ enabled: boolean;
7
+ pluginId: string | null;
8
+ }
9
+ export interface CodexNativeSkillCatalog {
10
+ version: string;
11
+ cwd: string;
12
+ skills: CodexNativeSkill[];
13
+ }
14
+ /** Project the measured native skills/list contract without retaining descriptions,
15
+ * links, interfaces, errors, or any other untrusted native text. */
16
+ export declare function projectCodexNativeSkillCatalog(response: unknown, cwd: string): CodexNativeSkill[];
17
+ /** Read one consumer's catalog through an owned, bounded native client. The RPC
18
+ * transport owns request deadlines and child shutdown. Native discovery can
19
+ * maintain its own caches; callers must constrain writes when requiring isolation. */
20
+ export declare function captureCodexNativeSkillCatalog(options: {
21
+ command: string;
22
+ home: string;
23
+ codexHome?: string;
24
+ cwd: string;
25
+ timeoutMs?: number;
26
+ }, connect?: (options: {
27
+ command: string;
28
+ home: string;
29
+ codexHome?: string;
30
+ timeoutMs?: number;
31
+ }) => Promise<CodexHookRpc>): Promise<CodexNativeSkillCatalog>;
32
+ /** Evaluate already-selected user/session rules in native order. This is a rule
33
+ * projection, not proof that an existing live consumer adopted the rules. Names
34
+ * use exact equality; paths use native canonicalization with lexical fallback.
35
+ * Unknown fields remain the caller's property and are not rewritten here. */
36
+ export declare function isCodexNativeSkillDisabled(skill: CodexNativeSkill, rules: unknown): boolean;
@@ -0,0 +1,16 @@
1
+ import { type CodexNativeSkillCatalog } from "./codex-native-skill-catalog.js";
2
+ export interface CodexPluginSkillControl {
3
+ name: string;
4
+ pluginId: string;
5
+ namespace: string;
6
+ pluginParent: string;
7
+ manifestSha256: string;
8
+ appSha256?: string;
9
+ }
10
+ type Read = (path: string) => string;
11
+ /** Capability controls remain bound even after every native Skill body disappears. */
12
+ export declare function reviewedCodexPluginCapabilitiesUnchanged(cache: string, controls: CodexPluginSkillControl[], read: Read): boolean;
13
+ export declare function reviewCodexPluginSkillControls(catalog: CodexNativeSkillCatalog, documents: string[], cache: string, cwd: string, read: Read): CodexPluginSkillControl[];
14
+ export declare function isReviewedCodexPluginSkillDisabled(document: string, cache: string, controls: CodexPluginSkillControl[], rules: unknown, read: Read): boolean;
15
+ export declare function disableReviewedCodexPluginNames(text: string, controls: CodexPluginSkillControl[]): string;
16
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type ClaudeSettingsWitnessBudget } from "./claude-settings-witness.js";
2
+ export declare function hashCodexSettingsReplacement(text: string, budget?: ClaudeSettingsWitnessBudget): string;
3
+ export declare function captureCodexSettings(path: string, budget?: ClaudeSettingsWitnessBudget): {
4
+ path: string;
5
+ hashMode: "codex-settings-v1";
6
+ sha256: string;
7
+ };
8
+ export declare function upgradeCodexSettingsWitness(previous: {
9
+ path: string;
10
+ hashMode?: "bytes";
11
+ sha256: string;
12
+ }, reviewedSettingsPath: string): ReturnType<typeof captureCodexSettings>;
@@ -5,3 +5,5 @@ export declare class HookDiagnosticError extends Error {
5
5
  }
6
6
  export declare function hookChildError(stdout: string, stage: "context" | "sync"): HookDiagnosticError;
7
7
  export declare function hookFailureReason(error: unknown, profileId?: string): string;
8
+ export declare function isOptionalHookContextFailure(error: unknown): error is HookDiagnosticError;
9
+ export declare function hookUnavailableContext(error: HookDiagnosticError, profileId?: string): string;