@hasna/skills 0.10.62 → 0.10.63
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 +41 -0
- package/bin/index.js +1958 -1690
- package/bin/mcp.js +698 -551
- package/bin/migrate.js +1 -1
- package/bin/server.js +1 -1
- package/bin/worker.js +1 -1
- package/dist/index.js +1055 -816
- package/dist/lib/agent-discovery.d.ts +3 -0
- package/dist/lib/agent-integration.d.ts +19 -0
- package/dist/lib/retained-review-artifacts.d.ts +35 -0
- package/dist/runtime-prerequisites.js +10 -1
- package/dist/sdk/index.js +1050 -811
- package/package.json +1 -1
|
@@ -3,8 +3,10 @@ import { type DiscoveryDirectory } from "./agent-discovery-directories.js";
|
|
|
3
3
|
import { type ManagedPluginRegistrationWitness } from "./plugin-discovery.js";
|
|
4
4
|
import { type CodexHookDiscoveryRecovery } from "./codex-hook-discovery-recovery.js";
|
|
5
5
|
import { type CodexPluginSkillControl, type CodexPluginSourceInput } from "./codex-plugin-skill-controls.js";
|
|
6
|
+
import { type RetainedReviewArtifact, type ReviewedArtifact } from "./retained-review-artifacts.js";
|
|
6
7
|
export { captureDiscoveryDirectories, type DiscoveryDirectory } from "./agent-discovery-directories.js";
|
|
7
8
|
export interface DiscoverySource {
|
|
9
|
+
reviewArtifact?: RetainedReviewArtifact;
|
|
8
10
|
path: string;
|
|
9
11
|
sha256: string | null;
|
|
10
12
|
hashMode?: "bytes" | "path-bytes" | "claude-plugin-manifest-v1" | "claude-plugin-registry" | "claude-marketplace-registry" | "claude-settings-v1" | "claude-settings-v2" | "claude-settings-v3" | "claude-settings-v4" | "claude-marketplace-registry-v2" | "codex-settings-v1" | "codex-settings-v2" | "codex-settings-v3" | "codex-settings-v4" | "sumi-settings-v1" | "claude-marketplace-entry-v1";
|
|
@@ -63,6 +65,7 @@ export interface ReviewedDiscoveryInputs {
|
|
|
63
65
|
agent: IntegrationAgent;
|
|
64
66
|
roots: string[];
|
|
65
67
|
sources: DiscoverySource[];
|
|
68
|
+
reviewArtifacts?: ReviewedArtifact[];
|
|
66
69
|
directories?: DiscoveryDirectory[];
|
|
67
70
|
pluginHooks: "reviewed-no-skill-injection";
|
|
68
71
|
}>;
|
|
@@ -6,6 +6,7 @@ import { type DiscoveryExecutable, type AgentDiscoveryBinding, type ReviewedDisc
|
|
|
6
6
|
import { type IntegrationAgent } from "./agent-adapters.js";
|
|
7
7
|
import type { CodexHookDiscoveryRecovery } from "./codex-hook-discovery-recovery.js";
|
|
8
8
|
import { type ClaudeCoordinatedHookEvent } from "./claude-settings-witness.js";
|
|
9
|
+
import { type ReviewArtifactChange } from "./retained-review-artifacts.js";
|
|
9
10
|
export type { IntegrationAgent } from "./agent-adapters.js";
|
|
10
11
|
export type ContextHookEvent = "UserPromptSubmit" | "SessionStart" | "SubagentStart";
|
|
11
12
|
export interface AgentRootAlias {
|
|
@@ -47,6 +48,12 @@ export interface AgentConfigChange {
|
|
|
47
48
|
after: string;
|
|
48
49
|
}
|
|
49
50
|
export interface AgentIntegrationPlan {
|
|
51
|
+
reviewArtifactSources?: Array<{
|
|
52
|
+
path: string;
|
|
53
|
+
sha256: string;
|
|
54
|
+
}>;
|
|
55
|
+
retainedReviewArtifacts?: ReviewArtifactChange[];
|
|
56
|
+
reviewArtifactMigration?: ReviewArtifactMigration;
|
|
50
57
|
observedNativeSources?: Array<{
|
|
51
58
|
path: string;
|
|
52
59
|
sha256: string | null;
|
|
@@ -89,6 +96,7 @@ export interface AgentIntegrationPlan {
|
|
|
89
96
|
rootAliases?: AgentRootAlias[];
|
|
90
97
|
managedAgentChecks?: {
|
|
91
98
|
home: string;
|
|
99
|
+
projectDir?: string;
|
|
92
100
|
agents: IntegrationAgent[];
|
|
93
101
|
};
|
|
94
102
|
retainedReviewChecks?: {
|
|
@@ -203,6 +211,17 @@ export declare function planAgentSettingsWitnessUpgrade(options: {
|
|
|
203
211
|
expectedPolicySha256: string;
|
|
204
212
|
expectedSettingsSha256: string;
|
|
205
213
|
}): AgentIntegrationPlan;
|
|
214
|
+
export interface ReviewArtifactMigration {
|
|
215
|
+
kind: "codex-native-catalog";
|
|
216
|
+
sourcePath: string;
|
|
217
|
+
expectedPolicySha256: string;
|
|
218
|
+
expectedSourceSha256: string;
|
|
219
|
+
home?: string;
|
|
220
|
+
dataDir?: string;
|
|
221
|
+
projectDir?: string;
|
|
222
|
+
}
|
|
223
|
+
/** Explicit exact-proof migration. Never captures a new catalog or refreshes live inputs. */
|
|
224
|
+
export declare function planReviewedArtifactMigration(options: ReviewArtifactMigration): AgentIntegrationPlan;
|
|
206
225
|
export declare function applyAgentIntegration(plan: AgentIntegrationPlan, options?: CodexCorpusWriteOptions): {
|
|
207
226
|
changed: string[];
|
|
208
227
|
backups: string[];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AgentDiscoveryBinding, DiscoverySource } from "./agent-discovery.js";
|
|
2
|
+
export interface ReviewedArtifact {
|
|
3
|
+
kind: "codex-native-catalog";
|
|
4
|
+
path: string;
|
|
5
|
+
sha256: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RetainedReviewArtifact {
|
|
8
|
+
version: 1;
|
|
9
|
+
kind: "codex-native-catalog";
|
|
10
|
+
storeRoot: string;
|
|
11
|
+
originalPath: string;
|
|
12
|
+
sha256: string;
|
|
13
|
+
catalogSha256: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ReviewArtifactChange {
|
|
16
|
+
path: string;
|
|
17
|
+
before: null;
|
|
18
|
+
after: string;
|
|
19
|
+
artifact: RetainedReviewArtifact;
|
|
20
|
+
}
|
|
21
|
+
export declare function verifyReviewArtifactOriginal(path: string, expectedSha256: string): void;
|
|
22
|
+
export declare function retainedArtifactPath(metadata: RetainedReviewArtifact): string;
|
|
23
|
+
export declare function validRetainedArtifact(value: unknown): value is RetainedReviewArtifact;
|
|
24
|
+
export declare function verifyRetainedReviewArtifact(source: DiscoverySource, storeRoot?: string): void;
|
|
25
|
+
/** Planning only: preserve source bytes and lineage, but create no storage. */
|
|
26
|
+
export declare function planReviewArtifactRetention(binding: AgentDiscoveryBinding, artifacts: ReviewedArtifact[] | undefined, dataDir: string, home: string): {
|
|
27
|
+
binding: AgentDiscoveryBinding;
|
|
28
|
+
changes: ReviewArtifactChange[];
|
|
29
|
+
observed: Array<{
|
|
30
|
+
path: string;
|
|
31
|
+
sha256: string;
|
|
32
|
+
}>;
|
|
33
|
+
};
|
|
34
|
+
/** Publish only an absent exact-byte artifact; existing immutable bytes are never replaced. */
|
|
35
|
+
export declare function writeReviewArtifactExclusive(change: ReviewArtifactChange): void;
|
|
@@ -49,7 +49,7 @@ var __require = import.meta.require;
|
|
|
49
49
|
// src/runtime-prerequisites.ts
|
|
50
50
|
import { isAbsolute as isAbsolute5 } from "path";
|
|
51
51
|
// package.json
|
|
52
|
-
var version = "0.10.
|
|
52
|
+
var version = "0.10.63";
|
|
53
53
|
var package_default = {
|
|
54
54
|
name: "@hasna/skills",
|
|
55
55
|
version,
|
|
@@ -2673,6 +2673,15 @@ function assertAgentPolicyCollections(policy) {
|
|
|
2673
2673
|
}
|
|
2674
2674
|
} else
|
|
2675
2675
|
requireBound(source.managedPlugins === undefined);
|
|
2676
|
+
if (source.reviewArtifact !== undefined) {
|
|
2677
|
+
const artifact = source.reviewArtifact;
|
|
2678
|
+
requireBound(agent === "codex" && value.method === "reviewed" && source.hashMode === "bytes" && object(artifact) && Object.keys(artifact).length === 6 && Object.keys(artifact).every((key) => ["version", "kind", "storeRoot", "originalPath", "sha256", "catalogSha256"].includes(key)) && artifact.version === 1 && artifact.kind === "codex-native-catalog" && artifact.sha256 === source.sha256 && /^[a-f0-9]{64}$/.test(artifact.catalogSha256));
|
|
2679
|
+
for (const path of [artifact.storeRoot, artifact.originalPath]) {
|
|
2680
|
+
text(path);
|
|
2681
|
+
requireBound(isAbsolute3(path) && resolve5(path) === path);
|
|
2682
|
+
}
|
|
2683
|
+
requireBound(source.path === join5(artifact.storeRoot, "agent-discovery", "artifacts", artifact.sha256, "catalog.json"));
|
|
2684
|
+
}
|
|
2676
2685
|
if (source.format !== undefined)
|
|
2677
2686
|
requireBound(["json", "toml", "yaml"].includes(source.format));
|
|
2678
2687
|
if (source.fields !== undefined)
|