@hasna/skills 0.10.72 → 0.10.73

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 type { IntegrationAgent } from "./agent-adapters.js";
2
2
  import { type DiscoveryDirectory } from "./agent-discovery-directories.js";
3
3
  import { type CodexReviewedHookSource } from "./codex-hook-mcp-dependencies.js";
4
+ import { CLAUDE_ORPHAN_MARKER_MODE } from "./claude-plugin-cache-marker.js";
4
5
  import { type NativeDiscoveryWitnessTolerance } from "./native-discovery-witness-change.js";
5
6
  import { type ManagedPluginRegistrationWitness } from "./plugin-discovery.js";
6
7
  import { type CodexHookDiscoveryRecovery } from "./codex-hook-discovery-recovery.js";
@@ -95,6 +96,11 @@ export declare function projectNativeDiscoveryFields(text: string, format: "json
95
96
  /** Called only after the owning planner validated discovery and capabilities.
96
97
  * New roots must already be body-free; absent roots need the prior typed proof. */
97
98
  export declare function captureRetiredCodexDiscovery(binding: AgentDiscoveryBinding, controls: CodexPluginSkillControl[], rules: unknown): AgentDiscoveryBinding;
99
+ /** The witness class that may keep its reviewed digest beneath a positively
100
+ * verified absent root: a full byte witness, the installer's full manifest
101
+ * projection or a present version-root orphan marker. Null for every other
102
+ * source, which must stay current. */
103
+ export type RetainedAbsentWitness = "bytes" | "claude-plugin-manifest-v1" | typeof CLAUDE_ORPHAN_MARKER_MODE;
98
104
  /** Only native capability locations covered by the complete typed cache census
99
105
  * qualify. Historical sources remain stored; arbitrary missing files do not. */
100
106
  export declare function codexSemanticCacheSourceRole(source: DiscoverySource, cacheRoot: string, parents: readonly string[], hookParents?: readonly string[]): boolean;
@@ -109,6 +115,25 @@ export declare function verifyAgentDiscovery(binding: AgentDiscoveryBinding, cod
109
115
  alias: string;
110
116
  target: string;
111
117
  }[], witnessTolerance?: NativeDiscoveryWitnessTolerance): void;
118
+ /** One stored Claude discovery source as an installer sees it. */
119
+ export type ClaudeDiscoverySourceVerdict = {
120
+ status: "current";
121
+ } | {
122
+ status: "retained-absent";
123
+ root: string;
124
+ witness: RetainedAbsentWitness;
125
+ } | {
126
+ status: "drift";
127
+ reason: "MISSING" | "APPEARED" | "CHANGED" | "MARKER_INVALID" | "REFUSED";
128
+ };
129
+ /** Read-only, per-source report on a stored Claude discovery binding, in
130
+ * stored order. A source is retained only through the same absent retired
131
+ * version rule and predicate verifyAgentDiscovery applies; a refused rule
132
+ * retains nothing. Every other source is checked by its own witness, exactly
133
+ * as verification checks it (a typed orphan marker by the marker predicate).
134
+ * This report never accepts a binding by itself: a caller must also require
135
+ * verifyAgentDiscovery to accept the same binding. */
136
+ export declare function classifyClaudeDiscoverySources(binding: AgentDiscoveryBinding): ClaudeDiscoverySourceVerdict[];
112
137
  export declare function rebindAgentDiscovery(binding: AgentDiscoveryBinding, changes: Map<string, string>): AgentDiscoveryBinding;
113
138
  /** Explicit streaming integrity witness. Never read an executable as text or execute it. */
114
139
  export declare function captureDiscoveryExecutableSources(paths: string[]): DiscoverySource[];
@@ -116,6 +141,11 @@ export declare function captureDiscoveryExecutableSources(paths: string[]): Disc
116
141
  export declare function captureDiscoveryByteSources(paths: string[]): DiscoverySource[];
117
142
  /** Capture executable/source path identity, including links and absent targets. */
118
143
  export declare function captureDiscoveryPathSources(paths: string[]): DiscoverySource[];
144
+ /** Top-level keys whose presence, at any value, makes a project Claude settings
145
+ * file a higher-precedence discovery source that needs review. Claude 2.1.300
146
+ * rewrites `additionalMarketplaces` into `extraKnownMarketplaces` on every
147
+ * settings read, including local settings, so the alias counts as well. */
148
+ export declare const CLAUDE_PROJECT_DISCOVERY_KEYS: readonly ["enabledPlugins", "extraKnownMarketplaces", "additionalMarketplaces", "skillOverrides"];
119
149
  /** Project settings can introduce a higher-precedence discovery source. Until
120
150
  * its native merge format is supported, refuse that layer rather than certify
121
151
  * the home-only inventory. Ordinary unrelated project settings remain usable. */
@@ -143,6 +173,12 @@ export declare function verifyAutomaticDiscoveryClosure(binding: AgentDiscoveryB
143
173
  * the stored digest. Witness modes
144
174
  * without a replacement digest (V6, artifacts, managed registries) stay strict. */
145
175
  export declare function codexVendorConfigChangeOnly(source: DiscoverySource, cache: string): boolean;
176
+ /** Whether replacing `path` with `text` leaves every recorded witness of it
177
+ * satisfied, judged by each source's own digest mode without touching the file,
178
+ * with the same screen-reader receipt tolerance typed V1-V5 verification applies.
179
+ * Fails closed: a review artifact, managed-plugin or hook-source witness, a
180
+ * semantic cache binding of the file, or an unsupported mode counts as changed. */
181
+ export declare function discoveryTextKeepsWitness(binding: Pick<AgentDiscoveryBinding, "sources" | "codexSemanticCache">, path: string, text: string): boolean;
146
182
  /** `executable` is the agent's runtime: omitted, it is resolved through PATH;
147
183
  * a value (or null for none) is used as given, so verification never depends
148
184
  * on the caller's PATH. */
@@ -0,0 +1,65 @@
1
+ import { type RetainedAbsentWitness } from "./agent-discovery.js";
2
+ export declare const CLAUDE_DISCOVERY_BINDING_VERIFICATION_SCHEMA: "skills.claude-discovery-binding-verification/v1";
3
+ /** The rule that lets a stored witness stay unverified because Claude removed
4
+ * its whole retired plugin-cache version while unchanged settings and
5
+ * registrations select a current sibling version. */
6
+ export declare const ABSENT_RETIRED_CLAUDE_VERSION_RULE: "absent-retired-claude-version";
7
+ export type ClaudeDiscoveryBindingRefusalCode = "POLICY_PATH_MISMATCH" | "POLICY_UNAVAILABLE" | "POLICY_UNREADABLE" | "BINDING_UNAVAILABLE" | "BINDING_INVALID" | "POLICY_CHANGED";
8
+ /** A request, policy or stored-binding read/parse failure: no verdict. */
9
+ export declare class ClaudeDiscoveryBindingRefusal extends Error {
10
+ readonly code: ClaudeDiscoveryBindingRefusalCode;
11
+ constructor(code: ClaudeDiscoveryBindingRefusalCode);
12
+ }
13
+ export type ClaudeBindingSourceFailure = "MISSING" | "APPEARED" | "CHANGED" | "MARKER_INVALID" | "REFUSED";
14
+ export type ClaudeBindingDirectoryFailure = "MEMBERSHIP_CHANGED" | "REFUSED";
15
+ export interface ClaudeBindingSourceReport {
16
+ index: number;
17
+ path: string;
18
+ hashMode: string | null;
19
+ format: string | null;
20
+ sha256: string | null;
21
+ status: "current" | "retained-absent" | "drift";
22
+ retention?: {
23
+ rule: typeof ABSENT_RETIRED_CLAUDE_VERSION_RULE;
24
+ root: string;
25
+ witness: RetainedAbsentWitness;
26
+ };
27
+ reason?: ClaudeBindingSourceFailure;
28
+ }
29
+ export interface ClaudeBindingDirectoryReport {
30
+ index: number;
31
+ path: string;
32
+ status: "current" | "drift";
33
+ reason?: ClaudeBindingDirectoryFailure;
34
+ }
35
+ export type ClaudeBindingFailure = {
36
+ kind: "source";
37
+ index: number;
38
+ path: string;
39
+ reason: ClaudeBindingSourceFailure;
40
+ } | {
41
+ kind: "directory";
42
+ index: number;
43
+ path: string;
44
+ reason: ClaudeBindingDirectoryFailure;
45
+ } | {
46
+ kind: "binding";
47
+ reason: "DISCOVERY_REFUSED";
48
+ };
49
+ export interface ClaudeDiscoveryBindingVerification {
50
+ schema: typeof CLAUDE_DISCOVERY_BINDING_VERIFICATION_SCHEMA;
51
+ ok: boolean;
52
+ policySha256: string;
53
+ discoverySha256: string;
54
+ agent: "claude";
55
+ method: "reviewed" | "automatic";
56
+ rootCount: number;
57
+ sources: ClaudeBindingSourceReport[];
58
+ directories: ClaudeBindingDirectoryReport[];
59
+ failures: ClaudeBindingFailure[];
60
+ }
61
+ /** Verify the stored `bridge.discovery.claude` binding of the package-owned
62
+ * Skills policy. `ok` is true only when the hook's own discovery verification
63
+ * accepts the binding and every source is current or retained under the
64
+ * absent retired version rule, and every directory witness is current. */
65
+ export declare function verifyClaudeInstallerDiscoveryBinding(policyPath: string): ClaudeDiscoveryBindingVerification;
@@ -0,0 +1,11 @@
1
+ /** Whether Codex can load a skill below `path`, a `node_modules` directory
2
+ * `depth` levels below its plugin cache. A marketplace, plugin or version
3
+ * directory is an identity, so one named `node_modules` is always walked.
4
+ * Inside a version, the directory is walked when it lies in, or leads to, a
5
+ * manifest-declared skills path or the default `skills` root. Codex replaces
6
+ * the default with a declared path; Skills keeps walking it, as it walks every
7
+ * other visible directory in the cache. A manifest that cannot be read exactly
8
+ * (a link or special file, oversized, invalid UTF-8 or JSON, duplicate keys, an
9
+ * unsupported skills shape or an escaping path) walks it too, so an unreadable
10
+ * declaration never hides a loaded skill. */
11
+ export declare function codexPluginCacheSkillTree(path: string, depth: number): boolean;
@@ -1,5 +1,14 @@
1
1
  import { type ClaudeSettingsWitnessBudget } from "./claude-settings-witness.js";
2
2
  export declare function hashCodexSettingsReplacement(text: string, budget?: ClaudeSettingsWitnessBudget): string;
3
+ /** The parsed document and numeric spellings a V1 digest binds, before the
4
+ * documented inference fields are removed. Callers that edit the structure
5
+ * (codexSettingsToleratesScreenReaderReceipt) finish each edited copy separately. */
6
+ export declare function prepareCodexSettingsV1(text: string): {
7
+ config: Record<string, any>;
8
+ tokens: string[];
9
+ };
10
+ /** The V1 digest of a prepared structure. Mutates `config`. */
11
+ export declare function finishCodexSettingsV1(config: Record<string, any>, tokens: string[]): string;
3
12
  export declare function captureCodexSettings(path: string, budget?: ClaudeSettingsWitnessBudget): {
4
13
  path: string;
5
14
  hashMode: "codex-settings-v1";
@@ -5,6 +5,24 @@ import { type ClaudeSettingsWitnessBudget } from "./claude-settings-witness.js";
5
5
  * `codex-settings-v2` witness binds strictly more of the same file, so it
6
6
  * supersedes this projection instead of coexisting with it. */
7
7
  export declare const CODEX_DISCOVERY_PROJECTION_FIELDS: readonly ["plugins", "marketplaces", "skills"];
8
+ /** Typed modes whose digests bind the receipt. */
9
+ export type CodexReceiptSettingsMode = "codex-settings-v1" | "codex-settings-v2" | "codex-settings-v3" | "codex-settings-v4" | "codex-settings-v5";
10
+ /** How a current document relates to a typed V1-V5 witness's reviewed digest.
11
+ * `screen-reader-receipt` is the only tolerated difference. */
12
+ export type CodexSettingsWitnessMatch = "exact" | "screen-reader-receipt";
13
+ /** True when `text` differs from the document a typed V1-V5 witness reviewed
14
+ * only by the boolean screen-reader receipt, proven by reproducing `expected`
15
+ * under the witness's own unchanged digest from the current document with the
16
+ * receipt edited back. The text-bound projections (local MCP rows, V4 counts,
17
+ * numeric spelling) run once on the current text; a receipt line holds no
18
+ * numeric token. Digest values never change and nothing is recorded. Any other
19
+ * TUI key, a non-boolean value and every other difference stay bound.
20
+ * Fail-closed: errors return false. */
21
+ export declare function codexSettingsToleratesScreenReaderReceipt(text: string, hashMode: CodexReceiptSettingsMode, expected: string): boolean;
22
+ /** Read a typed V1-V5 settings witness file once and classify it against the
23
+ * reviewed digest: `exact`, `screen-reader-receipt` (the only tolerated
24
+ * difference), or null (drift). */
25
+ export declare function codexSettingsWitnessMatch(path: string, hashMode: CodexReceiptSettingsMode, expected: string, budget?: ClaudeSettingsWitnessBudget): CodexSettingsWitnessMatch | null;
8
26
  export declare function hashCodexSettingsReplacementV2(text: string, budget?: ClaudeSettingsWitnessBudget): string;
9
27
  export declare function captureCodexSettingsV2(path: string, budget?: ClaudeSettingsWitnessBudget): {
10
28
  path: string;
@@ -49,7 +49,7 @@ var __require = import.meta.require;
49
49
  // src/runtime-prerequisites.ts
50
50
  import { isAbsolute as isAbsolute7 } from "path";
51
51
  // package.json
52
- var version = "0.10.72";
52
+ var version = "0.10.73";
53
53
  var package_default = {
54
54
  name: "@hasna/skills",
55
55
  version,