@hasna/skills 0.10.68 → 0.10.70
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 +42 -0
- package/bin/index.js +11977 -11351
- package/bin/mcp.js +2764 -2199
- package/bin/migrate.js +2 -1
- package/bin/server.js +2 -1
- package/bin/worker.js +2 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +9721 -9269
- package/dist/lib/agent-discovery.d.ts +5 -1
- package/dist/lib/codex-hook-mcp-dependencies.d.ts +16 -0
- package/dist/lib/codex-numeric-provenance-v6.d.ts +14 -0
- package/dist/lib/codex-settings-witness.d.ts +9 -0
- package/dist/mcp/invitation-recovery.d.ts +6 -0
- package/dist/mcp/package-tool-list.d.ts +19 -0
- package/dist/mcp/server.d.ts +2 -0
- package/dist/runtime-prerequisites.js +18 -3
- package/dist/sdk/index.js +4424 -3972
- package/package.json +2 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IntegrationAgent } from "./agent-adapters.js";
|
|
2
2
|
import { type DiscoveryDirectory } from "./agent-discovery-directories.js";
|
|
3
|
+
import { type CodexReviewedHookSource } from "./codex-hook-mcp-dependencies.js";
|
|
3
4
|
import { type ManagedPluginRegistrationWitness } from "./plugin-discovery.js";
|
|
4
5
|
import { type CodexHookDiscoveryRecovery } from "./codex-hook-discovery-recovery.js";
|
|
5
6
|
import { type CodexPluginSkillControl, type CodexPluginSourceInput } from "./codex-plugin-skill-controls.js";
|
|
@@ -10,7 +11,8 @@ export interface DiscoverySource {
|
|
|
10
11
|
reviewArtifact?: RetainedReviewArtifact;
|
|
11
12
|
path: string;
|
|
12
13
|
sha256: string | null;
|
|
13
|
-
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" | "codex-settings-v5" | "sumi-settings-v1" | "claude-marketplace-entry-v1";
|
|
14
|
+
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" | "codex-settings-v5" | "codex-settings-v6" | "executable-v1" | "sumi-settings-v1" | "claude-marketplace-entry-v1";
|
|
15
|
+
hookSources?: CodexReviewedHookSource[];
|
|
14
16
|
managedPlugins?: ManagedPluginRegistrationWitness[];
|
|
15
17
|
format?: "json" | "toml" | "yaml";
|
|
16
18
|
fields?: string[];
|
|
@@ -103,6 +105,8 @@ export declare function verifyAgentDiscovery(binding: AgentDiscoveryBinding, cod
|
|
|
103
105
|
target: string;
|
|
104
106
|
}[]): void;
|
|
105
107
|
export declare function rebindAgentDiscovery(binding: AgentDiscoveryBinding, changes: Map<string, string>): AgentDiscoveryBinding;
|
|
108
|
+
/** Explicit streaming integrity witness. Never read an executable as text or execute it. */
|
|
109
|
+
export declare function captureDiscoveryExecutableSources(paths: string[]): DiscoverySource[];
|
|
106
110
|
/** Capture full byte witnesses for reviewed source or executable files; never import or execute them. */
|
|
107
111
|
export declare function captureDiscoveryByteSources(paths: string[]): DiscoverySource[];
|
|
108
112
|
/** Capture executable/source path identity, including links and absent targets. */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface CodexReviewedHookSource {
|
|
2
|
+
path: string;
|
|
3
|
+
sha256: string | null;
|
|
4
|
+
}
|
|
5
|
+
export interface CodexHookMcpDependencies {
|
|
6
|
+
sources: CodexReviewedHookSource[];
|
|
7
|
+
servers: string[];
|
|
8
|
+
}
|
|
9
|
+
/** Exact Codex installed.rs selector contract, using its locked semver1.0.27
|
|
10
|
+
* Version::cmp (including BuildMetadata::cmp), not loose npm precedence.
|
|
11
|
+
* Mixed semver/lexical comparisons can cycle. Validate the complete resulting
|
|
12
|
+
* order so selection cannot depend on native read_dir/sort enumeration. */
|
|
13
|
+
export declare function selectCodexPluginVersion(versions: readonly string[], budget?: {
|
|
14
|
+
remaining: number;
|
|
15
|
+
}): string;
|
|
16
|
+
export declare function captureCodexHookMcpDependencies(configPath: string, reviewed: readonly CodexReviewedHookSource[], configText?: string, changes?: Map<string, string>, budget?: import("./agent-discovery-bytes.js").DiscoveryByteBudget): CodexHookMcpDependencies;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Path = Array<string | number>;
|
|
2
|
+
export interface CodexNumericToken {
|
|
3
|
+
path: Path;
|
|
4
|
+
kind: "integer" | "float" | "date";
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class CodexNumericValue {
|
|
8
|
+
readonly token: CodexNumericToken;
|
|
9
|
+
constructor(token: CodexNumericToken);
|
|
10
|
+
}
|
|
11
|
+
export declare function codexNumericProvenance(text: string, original: unknown): Map<string, CodexNumericToken>;
|
|
12
|
+
export declare function codexIntegerToken(tokens: Map<string, CodexNumericToken>, path: Path): boolean;
|
|
13
|
+
export declare function embedCodexNumericTokens(value: any, tokens: Map<string, CodexNumericToken>, path?: Path): any;
|
|
14
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { captureCodexSettings, hashCodexSettingsReplacement } from "./codex-settings-witness-v1.js";
|
|
2
|
+
import { type CodexReviewedHookSource } from "./codex-hook-mcp-dependencies.js";
|
|
2
3
|
import { type ClaudeSettingsWitnessBudget } from "./claude-settings-witness.js";
|
|
3
4
|
/** The Codex discovery fields the automatic TOML projection witnesses. A typed
|
|
4
5
|
* `codex-settings-v2` witness binds strictly more of the same file, so it
|
|
@@ -60,3 +61,11 @@ export declare function upgradeCodexSettingsWitnessV5(previous: {
|
|
|
60
61
|
hashMode?: "bytes" | "codex-settings-v1" | "codex-settings-v2" | "codex-settings-v3" | "codex-settings-v4";
|
|
61
62
|
sha256: string;
|
|
62
63
|
}, reviewedSettingsPath: string): ReturnType<typeof captureCodexSettingsV5>;
|
|
64
|
+
/** V6 keeps V5 display tolerances and binds routes referenced by the complete
|
|
65
|
+
* independently reviewed native hook source population. No legacy migration. */
|
|
66
|
+
export declare function captureCodexSettingsV6(path: string, reviewedSources: readonly CodexReviewedHookSource[], budget?: ClaudeSettingsWitnessBudget, changes?: Map<string, string>): {
|
|
67
|
+
path: string;
|
|
68
|
+
hashMode: "codex-settings-v6";
|
|
69
|
+
sha256: string;
|
|
70
|
+
hookSources: CodexReviewedHookSource[];
|
|
71
|
+
};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { RemoteSkillsAuthClient } from "../lib/remote-auth.js";
|
|
1
3
|
/** Dedicated anonymous proof surface. Ordinary tools and credential resolution are not initialized. */
|
|
2
4
|
export declare function startInvitationRecoveryMcp(args: string[], env?: Record<string, string | undefined>): Promise<void>;
|
|
5
|
+
/** Register the two anonymous invitation recovery tools on `server`. */
|
|
6
|
+
export declare function registerInvitationRecoveryTools(server: McpServer, client: RemoteSkillsAuthClient, target: {
|
|
7
|
+
unchanged(): void;
|
|
8
|
+
}): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
/**
|
|
3
|
+
* Serve tools/list with JSON Schema converted by this package's own zod.
|
|
4
|
+
*
|
|
5
|
+
* bin/mcp.js bundles zod but loads the MCP SDK from the consumer's
|
|
6
|
+
* node_modules, and the SDK may resolve a different zod. The SDK's own
|
|
7
|
+
* tools/list converts each input schema with its zod; when that zod is older
|
|
8
|
+
* than the one that built the schema it fails (`ctx.deferred.push`) or
|
|
9
|
+
* advertises degraded schemas. This records the schemas each tool is
|
|
10
|
+
* registered with and converts them exactly as the SDK does (draft-7, `io`
|
|
11
|
+
* input/output, raw shapes as objects), but with the zod that built them.
|
|
12
|
+
* Argument validation for tools/call stays with the SDK.
|
|
13
|
+
*
|
|
14
|
+
* Call it right after constructing the server and before registering tools.
|
|
15
|
+
* Both `registerTool` and the positional `tool()` form are covered.
|
|
16
|
+
*/
|
|
17
|
+
export declare function servePackageZodToolList(server: McpServer): void;
|
|
18
|
+
/** The input schema the SDK's positional `tool()` form takes from its arguments. */
|
|
19
|
+
export declare function legacyInputSchema(rest: readonly unknown[]): unknown;
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
/** Register every Skills tool and resource on `server`. */
|
|
3
|
+
export declare function registerSkillsTools(server: McpServer): void;
|
|
2
4
|
export declare function buildServer(): McpServer;
|
|
3
5
|
/** @deprecated Use buildServer() — kept for internal imports during migration */
|
|
4
6
|
export declare const server: McpServer;
|
|
@@ -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.70";
|
|
53
53
|
var package_default = {
|
|
54
54
|
name: "@hasna/skills",
|
|
55
55
|
version,
|
|
@@ -118,6 +118,7 @@ var package_default = {
|
|
|
118
118
|
"verify:release": "bun run scripts/release-guard.ts",
|
|
119
119
|
"verify:release-review": "bun run scripts/verify-release-review.ts",
|
|
120
120
|
"verify:consumer-types": "bun run scripts/consumer-types.ts",
|
|
121
|
+
"verify:consumer-mcp": "bun run scripts/consumer-mcp.ts",
|
|
121
122
|
prepack: "bun run verify:generated && bun run verify:release && bun run verify:consumer-types",
|
|
122
123
|
prepublishOnly: "bun run verify:producer && bun run typecheck && bun run test",
|
|
123
124
|
"verify:producer": "bun run scripts/release-dependencies.ts",
|
|
@@ -2731,12 +2732,26 @@ function assertAgentPolicyCollections(policy) {
|
|
|
2731
2732
|
text(source.path);
|
|
2732
2733
|
requireBound(source.sha256 === null || typeof source.sha256 === "string" && /^[a-f0-9]{64}$/.test(source.sha256));
|
|
2733
2734
|
if (source.hashMode !== undefined)
|
|
2734
|
-
requireBound(["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", "codex-settings-v5", "sumi-settings-v1", "claude-marketplace-entry-v1"].includes(source.hashMode) && source.format === undefined && source.fields === undefined && (source.hashMode === "bytes" || source.sha256 !== null));
|
|
2735
|
+
requireBound(["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", "codex-settings-v5", "codex-settings-v6", "executable-v1", "sumi-settings-v1", "claude-marketplace-entry-v1"].includes(source.hashMode) && source.format === undefined && source.fields === undefined && (source.hashMode === "bytes" || source.sha256 !== null));
|
|
2736
|
+
if (source.hashMode === "executable-v1")
|
|
2737
|
+
requireBound(agent === "codex" && value.agent === "codex" && value.method === "reviewed" && value.sources.some((row) => row.hashMode === "codex-settings-v6") && isAbsolute3(source.path) && resolve5(source.path) === source.path);
|
|
2738
|
+
if (source.hashMode === "codex-settings-v6") {
|
|
2739
|
+
const seen = new Set;
|
|
2740
|
+
for (const hook of array(source.hookSources, AGENT_POLICY_LIMITS.discoverySources)) {
|
|
2741
|
+
requireBound(object(hook) && Object.keys(hook).length === 2 && Object.keys(hook).every((key) => ["path", "sha256"].includes(key)));
|
|
2742
|
+
text(hook.path);
|
|
2743
|
+
requireBound(isAbsolute3(hook.path) && resolve5(hook.path) === hook.path && !seen.has(hook.path));
|
|
2744
|
+
seen.add(hook.path);
|
|
2745
|
+
requireBound(hook.sha256 === null || typeof hook.sha256 === "string" && /^[a-f0-9]{64}$/.test(hook.sha256));
|
|
2746
|
+
requireBound(value.sources.some((row) => row.path === hook.path && row.sha256 === hook.sha256 && [undefined, "bytes"].includes(row.hashMode) && row.format === undefined && row.fields === undefined));
|
|
2747
|
+
}
|
|
2748
|
+
} else
|
|
2749
|
+
requireBound(source.hookSources === undefined);
|
|
2735
2750
|
if (source.hashMode === "claude-plugin-manifest-v1")
|
|
2736
2751
|
requireBound(agent === "claude" && value.agent === "claude" && ["automatic", "reviewed"].includes(value.method) && !/[\x00-\x1f\x7f]/.test(source.path) && isAbsolute3(source.path) && resolve5(source.path) === source.path && source.path.endsWith(join5(sep, ".claude-plugin", "plugin.json")) && source.managedPlugins === undefined);
|
|
2737
2752
|
if (source.hashMode === "sumi-settings-v1")
|
|
2738
2753
|
requireBound(agent === "sumi" && value.agent === "sumi" && value.method === "reviewed" && !/[\x00-\x1f\x7f]/.test(source.path) && isAbsolute3(source.path) && resolve5(source.path) === source.path && basename3(source.path) === "sumi.json");
|
|
2739
|
-
if (source.hashMode === "codex-settings-v1" || source.hashMode === "codex-settings-v2" || (source.hashMode === "codex-settings-v3" || source.hashMode === "codex-settings-v4" || source.hashMode === "codex-settings-v5"))
|
|
2754
|
+
if (source.hashMode === "codex-settings-v1" || source.hashMode === "codex-settings-v2" || (source.hashMode === "codex-settings-v3" || source.hashMode === "codex-settings-v4" || source.hashMode === "codex-settings-v5" || source.hashMode === "codex-settings-v6"))
|
|
2740
2755
|
requireBound(agent === "codex" && value.agent === "codex" && value.method === "reviewed" && !/[\x00-\x1f\x7f]/.test(source.path) && isAbsolute3(source.path) && resolve5(source.path) === source.path && basename3(source.path) === "config.toml");
|
|
2741
2756
|
if (source.hashMode === "claude-settings-v1" || source.hashMode === "claude-settings-v2" || (source.hashMode === "claude-settings-v3" || source.hashMode === "claude-settings-v4"))
|
|
2742
2757
|
requireBound(agent === "claude" && value.agent === "claude" && value.method === "reviewed" && !/[\x00-\x1f\x7f]/.test(source.path) && isAbsolute3(source.path) && resolve5(source.path) === source.path && basename3(source.path) === "settings.json");
|