@hasna/skills 0.9.10 → 0.9.12

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.
@@ -1,6 +1,7 @@
1
1
  import { connectCodexHookRpc } from "./codex-hook-rpc.js";
2
2
  import { type ReviewedSkillsCli } from "./codex-hook-trust-identity.js";
3
3
  import { type ClaudeDiscoveryRecovery } from "./codex-hook-policy-recovery.js";
4
+ import { type NativeHookAdditionsRecovery } from "./codex-hook-additions-review.js";
4
5
  export interface CodexNativeHookTrustOptions {
5
6
  home?: string;
6
7
  dataDir?: string;
@@ -26,6 +27,7 @@ export interface CodexNativeHookReconcileOptions {
26
27
  releaseProof?: SkillsCliReleaseProof;
27
28
  supersedeBinding?: boolean;
28
29
  claudeDiscoveryRecovery?: ClaudeDiscoveryRecovery;
30
+ nativeHookAdditionsRecovery?: NativeHookAdditionsRecovery;
29
31
  }
30
32
  type Connect = typeof connectCodexHookRpc;
31
33
  /** Resolve an interrupted native write only after the native consumer and every
@@ -40,16 +42,6 @@ export declare function reconcileCodexNativeHooks(options: CodexNativeHookReconc
40
42
  before: any;
41
43
  after: any;
42
44
  }[] | undefined;
43
- version: number;
44
- kind: string;
45
- journal: string;
46
- journalIntentSha256: string;
47
- stoppedSha256: string;
48
- originalPlanDigest: any;
49
- policyBeforeSha256: string;
50
- policyCurrentSha256: string;
51
- configBeforeSha256: string;
52
- configCurrentSha256: string;
53
45
  hooksSha256: string;
54
46
  nativeConfigPath: any;
55
47
  nativeVersion: string;
@@ -68,6 +60,30 @@ export declare function reconcileCodexNativeHooks(options: CodexNativeHookReconc
68
60
  manifestSha256: string;
69
61
  };
70
62
  releaseProof: SkillsCliReleaseProof | undefined;
63
+ nativeHookAdditions?: {
64
+ reviewPath: string;
65
+ reviewSha256: string;
66
+ reason: string;
67
+ producerEvidence: string;
68
+ producerBefore: {
69
+ configPath: string;
70
+ configSha256: string;
71
+ hooksPath: string;
72
+ hooksSha256: string;
73
+ };
74
+ additions: any[];
75
+ } | undefined;
76
+ configDiscoveryRecovery?: import("./codex-hook-discovery-recovery.js").CodexHookDiscoveryRecovery | undefined;
77
+ version: number;
78
+ kind: string;
79
+ journal: string;
80
+ journalIntentSha256: string;
81
+ stoppedSha256: string;
82
+ originalPlanDigest: any;
83
+ policyBeforeSha256: string;
84
+ policyCurrentSha256: string;
85
+ configBeforeSha256: string;
86
+ configCurrentSha256: string;
71
87
  } | undefined;
72
88
  recoveryPlanDigest?: string | undefined;
73
89
  version: number;
@@ -80,6 +96,7 @@ export declare function reconcileCodexNativeHooks(options: CodexNativeHookReconc
80
96
  nativeVersion: string;
81
97
  nativeStateVerified: boolean;
82
98
  nativeTrustPending: boolean;
99
+ bindingRefreshRequired: boolean;
83
100
  nativeExecutionVerified: boolean;
84
101
  configSha256: string;
85
102
  hooksSha256: string;
@@ -125,6 +142,7 @@ export declare function enrollCodexNativeHooks(options?: CodexNativeHookTrustOpt
125
142
  trustStatus: any;
126
143
  }[];
127
144
  nativeEligible: boolean;
145
+ bindingRefreshRequired: boolean;
128
146
  transport: string;
129
147
  existingSessionsReloaded: boolean;
130
148
  nativeExecutionVerified: boolean;
@@ -1,6 +1,7 @@
1
1
  import type { IntegrationAgent } from "./agent-adapters.js";
2
2
  import { type DiscoveryDirectory } from "./agent-discovery-directories.js";
3
3
  import { type ManagedPluginRegistrationWitness } from "./plugin-discovery.js";
4
+ import { type CodexHookDiscoveryRecovery } from "./codex-hook-discovery-recovery.js";
4
5
  export { captureDiscoveryDirectories, type DiscoveryDirectory } from "./agent-discovery-directories.js";
5
6
  export interface DiscoverySource {
6
7
  path: string;
@@ -28,7 +29,7 @@ export interface ReviewedDiscoveryInputs {
28
29
  pluginHooks: "reviewed-no-skill-injection";
29
30
  }>;
30
31
  }
31
- export declare function verifyAgentDiscovery(binding: AgentDiscoveryBinding): void;
32
+ export declare function verifyAgentDiscovery(binding: AgentDiscoveryBinding, codexRecovery?: CodexHookDiscoveryRecovery): void;
32
33
  export declare function rebindAgentDiscovery(binding: AgentDiscoveryBinding, changes: Map<string, string>): AgentDiscoveryBinding;
33
34
  /** Capture full byte witnesses for reviewed source or executable files; never import or execute them. */
34
35
  export declare function captureDiscoveryByteSources(paths: string[]): DiscoverySource[];
@@ -40,6 +41,7 @@ export declare function captureDiscoveryPathSources(paths: string[]): DiscoveryS
40
41
  export declare function assertProjectDiscovery(agent: IntegrationAgent, directories: string[], home: string, canonical?: (path: string) => string, reviewed?: AgentDiscoveryBinding): void;
41
42
  /** Resolve configured plugin discovery without starting an agent or loading a plugin.
42
43
  * Unknown runtime registrations require explicit reviewed inputs, never a cache guess. */
44
+ export declare function agentDiscoveryConfigPath(home: string, agent: IntegrationAgent): string;
43
45
  export declare function resolveAgentDiscovery(options: {
44
46
  home: string;
45
47
  agent: IntegrationAgent;
@@ -1,5 +1,6 @@
1
1
  import { type AgentDiscoveryBinding, type ReviewedDiscoveryInputs } from "./agent-discovery.js";
2
2
  import { type IntegrationAgent } from "./agent-adapters.js";
3
+ import type { CodexHookDiscoveryRecovery } from "./codex-hook-discovery-recovery.js";
3
4
  export type { IntegrationAgent } from "./agent-adapters.js";
4
5
  export type ContextHookEvent = "UserPromptSubmit" | "SessionStart" | "SubagentStart";
5
6
  export interface AgentRootAlias {
@@ -50,6 +51,10 @@ export interface AgentIntegrationPlan {
50
51
  discoveryBefore?: AgentDiscoveryBinding[];
51
52
  discoveryAfter?: AgentDiscoveryBinding[];
52
53
  rootAliases?: AgentRootAlias[];
54
+ managedAgentChecks?: {
55
+ home: string;
56
+ agents: IntegrationAgent[];
57
+ };
53
58
  }
54
59
  /** Parse the reviewed exact-target binding used by native migration. Paths are
55
60
  * deliberately project-relative so a manifest cannot silently select another
@@ -86,6 +91,17 @@ export declare function planAgentIntegration(options: {
86
91
  discoveryInputs?: ReviewedDiscoveryInputs;
87
92
  allowRootAliases?: boolean;
88
93
  }): AgentIntegrationPlan;
94
+ /** Plan an explicitly authorized Stop hook replacement without adopting drift.
95
+ * The caller owns authorization of its exact Stop hook delta; Skills refuses
96
+ * every other settings change and owns discovery witnesses and guarded writes.
97
+ * No policy means this installer has no Skills integration to update.
98
+ */
99
+ export declare function planClaudeStopHookUpdate(options: {
100
+ home?: string;
101
+ dataDir?: string;
102
+ expectedSettingsSha256: string;
103
+ replacement: string;
104
+ }): AgentIntegrationPlan | null;
89
105
  export declare function applyAgentIntegration(plan: AgentIntegrationPlan): {
90
106
  changed: string[];
91
107
  backups: string[];
@@ -120,6 +136,7 @@ export declare function assertManagedAgentBridge(agent: IntegrationAgent, option
120
136
  projectDir?: string;
121
137
  projectDirs?: string[];
122
138
  profileId?: string;
139
+ codexDiscoveryRecovery?: CodexHookDiscoveryRecovery;
123
140
  }): void;
124
141
  export declare function normalizeAgentHookPrompt(agent: IntegrationAgent, event: string, prompt: string): string;
125
142
  export declare function hookContextOutput(event: string, result: {
@@ -0,0 +1,10 @@
1
+ export interface PortableAuthoringPathOptions {
2
+ /** The account whose native discovery must remain free of authored payloads. */
3
+ homeDir?: string;
4
+ }
5
+ /**
6
+ * Refuse a write target that is, or physically aliases, an agent discovery
7
+ * root. Read-only inventory and archive operations deliberately do not call
8
+ * this guard; they must remain able to inspect and migrate native copies.
9
+ */
10
+ export declare function assertPortableAuthoringPath(path: string, options?: PortableAuthoringPathOptions): void;
@@ -9,6 +9,12 @@ export declare const CLAUDE_SETTINGS_WITNESS_LIMITS: Readonly<{
9
9
  export interface ClaudeSettingsWitnessBudget {
10
10
  remaining: number;
11
11
  }
12
+ /** Cooperating installers may replace Stop only. Compare the strict syntax
13
+ * trees, not JSON.parse values or the preference-tolerant witness digest: all
14
+ * other hooks, discovery settings, unknown values and number spellings remain
15
+ * identical. Whitespace and object-key order have no configuration meaning.
16
+ */
17
+ export declare function assertClaudeStopHookReplacement(before: string | null, replacement: string): void;
12
18
  /** Hash only reviewed installer-rendered settings after the disk preimage has been verified. */
13
19
  export declare function hashClaudeSettingsReplacement(text: string, budget: ClaudeSettingsWitnessBudget): string;
14
20
  /** Explicit capture never converts a stored legacy raw witness or changes settings. */
@@ -0,0 +1,42 @@
1
+ import { snapshot } from "./codex-hook-trust-files.js";
2
+ type Snapshot = ReturnType<typeof snapshot>;
3
+ export interface NativeHookAdditionsRecovery {
4
+ path: string;
5
+ reviewedPlanDigest?: string;
6
+ }
7
+ /** An explicit, private review of a later producer's append-only hook change.
8
+ * The producer backups must themselves describe exactly the completed journal
9
+ * operation. Neither a claimed receipt nor a matching raw hash grants authority
10
+ * to replace an original hook or accept unrelated configuration changes. */
11
+ export declare function reviewNativeHookAdditions(options: {
12
+ path: string;
13
+ intent: Snapshot;
14
+ policy: Snapshot;
15
+ configBefore: Snapshot;
16
+ configCurrent: Snapshot;
17
+ hooksBefore: Snapshot;
18
+ hooksCurrent: Snapshot;
19
+ nativeHooksPath: string;
20
+ journalHooks: Array<{
21
+ key: string;
22
+ currentHash: string;
23
+ }>;
24
+ recordedNativeHooks: any[];
25
+ }): {
26
+ hooks: any[];
27
+ recheck: () => void;
28
+ receipt: {
29
+ reviewPath: string;
30
+ reviewSha256: string;
31
+ reason: string;
32
+ producerEvidence: string;
33
+ producerBefore: {
34
+ configPath: string;
35
+ configSha256: string;
36
+ hooksPath: string;
37
+ hooksSha256: string;
38
+ };
39
+ additions: any[];
40
+ };
41
+ };
42
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { AgentDiscoveryBinding, DiscoverySource } from "./agent-discovery.js";
2
+ import { type snapshot } from "./codex-hook-trust-files.js";
3
+ type Snapshot = ReturnType<typeof snapshot>;
4
+ /** A receipt projection, not an override supplied by a CLI caller. Only this
5
+ * module can create the in-memory proof used by discovery verification. */
6
+ export interface CodexHookDiscoveryRecovery {
7
+ readonly configPath: string;
8
+ readonly beforeSha256: string;
9
+ readonly currentSha256: string;
10
+ readonly discoverySha256: string;
11
+ readonly typedProjectionSha256: string;
12
+ }
13
+ /** Called after a complete journal/intent or the current reviewed native
14
+ * transaction and exact intended trust writes have been checked. Recheck those
15
+ * writes here so a raw hash alone can never
16
+ * grant this exception. Policy bytes and recorded sources remain unchanged. */
17
+ export declare function createCodexHookDiscoveryRecovery(binding: AgentDiscoveryBinding, before: Snapshot, current: Snapshot, hooks: Array<{
18
+ key: string;
19
+ currentHash: string;
20
+ }>): CodexHookDiscoveryRecovery | undefined;
21
+ export declare function assertCodexHookDiscoveryRecovery(binding: AgentDiscoveryBinding, witness: CodexHookDiscoveryRecovery): void;
22
+ /** Verify this one historical byte witness using the already-validated native
23
+ * transition. Every other source still uses its ordinary current-file hash. */
24
+ export declare function verifiesCodexHookDiscoverySource(binding: AgentDiscoveryBinding, source: DiscoverySource, currentDigest: string | null, witness?: CodexHookDiscoveryRecovery): boolean;
25
+ export {};
@@ -0,0 +1,2 @@
1
+ /** Shared default discovery roots for inventory and authoring exclusion. */
2
+ export declare const NATIVE_SKILL_ROOTS: readonly [readonly ["claude", ".claude/skills"], readonly ["codex", ".codex/skills"], readonly ["codex", ".agents/skills"], readonly ["gemini", ".gemini/skills"], readonly ["codewith", ".codewith/skills"], readonly ["opencode", ".config/opencode/skills"], readonly ["opencode", ".opencode/skills"], readonly ["cursor", ".cursor/skills"], readonly ["hermes", ".hermes/skills"], readonly ["windsurf", ".windsurf/skills"], readonly ["pi", ".pi/agent/skills"], readonly ["amp", ".amp/skills"], readonly ["cline", ".cline/skills"], readonly ["roo", ".roo/skills"], readonly ["copilot", ".github/skills"]];