@hasna/skills 0.10.46 → 0.10.48
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/bin/index.js +1211 -926
- package/bin/maintenance.js +7 -2
- package/bin/mcp.js +577 -360
- package/bin/migrate.js +7 -5
- package/bin/server.js +29 -10
- package/bin/worker.js +12 -7
- package/dist/index.js +826 -613
- package/dist/lib/agent-discovery.d.ts +1 -1
- package/dist/lib/claude-plugin-manifest-witness.d.ts +9 -0
- package/dist/lib/profile-client.d.ts +6 -2
- package/dist/lib/remote-files.d.ts +1 -1
- package/dist/lib/selection-cache.d.ts +5 -0
- package/dist/lib/selection-resolver.d.ts +1 -0
- package/dist/lib/session-reconciliation.d.ts +6 -3
- package/dist/sdk/index.js +796 -564
- package/dist/server/skills-api.d.ts +1 -0
- package/dist/server/types.d.ts +3 -1
- package/dist/types/skill-selection.d.ts +2 -0
- package/migrations/postgres/0011_skill_authorization_epoch.sql +22 -0
- package/migrations/sqlite/0011_skill_authorization_epoch.sql +17 -0
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ export { captureDiscoveryDirectories, type DiscoveryDirectory } from "./agent-di
|
|
|
7
7
|
export interface DiscoverySource {
|
|
8
8
|
path: string;
|
|
9
9
|
sha256: string | null;
|
|
10
|
-
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" | "codex-settings-v2" | "codex-settings-v3" | "codex-settings-v4" | "sumi-settings-v1";
|
|
10
|
+
hashMode?: "bytes" | "path-bytes" | "claude-plugin-manifest-v1" | "claude-plugin-registry" | "claude-marketplace-registry" | "claude-settings-v1" | "claude-settings-v2" | "claude-settings-v3" | "claude-marketplace-registry-v2" | "codex-settings-v1" | "codex-settings-v2" | "codex-settings-v3" | "codex-settings-v4" | "sumi-settings-v1";
|
|
11
11
|
managedPlugins?: ManagedPluginRegistrationWitness[];
|
|
12
12
|
format?: "json" | "toml" | "yaml";
|
|
13
13
|
fields?: string[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const CLAUDE_PLUGIN_MANIFEST_LIMITS: Readonly<{
|
|
2
|
+
bytes: number;
|
|
3
|
+
depth: 32;
|
|
4
|
+
nodes: 65536;
|
|
5
|
+
stringCharacters: 16384;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function hashClaudePluginManifest(text: string): string;
|
|
8
|
+
/** Project only the exact raw manifest bytes that the explicit review attested. */
|
|
9
|
+
export declare function projectReviewedClaudePluginManifest(text: string, reviewedSha256: string): string;
|
|
@@ -4,6 +4,8 @@ export interface ProfileClient {
|
|
|
4
4
|
/** Stable whoami subject; raw credential/key identities are intentionally excluded. */
|
|
5
5
|
resolvePrincipal?(): Promise<AuthenticatedProfilePrincipal>;
|
|
6
6
|
resolveProfile(id: string): Promise<ResolvedSkillProfile>;
|
|
7
|
+
/** Optional on older authorities/embedders; absence never authorizes old versions. */
|
|
8
|
+
supportsPinRenewal?(): Promise<boolean>;
|
|
7
9
|
recordStation(id: string, state: StationSkillStateInput): Promise<StationSkillState>;
|
|
8
10
|
getBundle(slug: string, version: string): Promise<Response | null>;
|
|
9
11
|
}
|
|
@@ -15,15 +17,17 @@ export interface AuthenticatedProfilePrincipal {
|
|
|
15
17
|
}
|
|
16
18
|
export declare class HttpProfileClient implements ProfileClient {
|
|
17
19
|
private key;
|
|
20
|
+
private signal?;
|
|
18
21
|
readonly authority: string;
|
|
19
22
|
private origin;
|
|
20
|
-
constructor(key: string, origin: string);
|
|
23
|
+
constructor(key: string, origin: string, signal?: AbortSignal | undefined);
|
|
21
24
|
private requestRoute;
|
|
22
25
|
private request;
|
|
23
26
|
private read;
|
|
27
|
+
supportsPinRenewal(): Promise<boolean>;
|
|
24
28
|
resolveProfile(id: string): Promise<ResolvedSkillProfile>;
|
|
25
29
|
resolvePrincipal(): Promise<AuthenticatedProfilePrincipal>;
|
|
26
30
|
recordStation(id: string, input: StationSkillStateInput): Promise<StationSkillState>;
|
|
27
31
|
getBundle(slug: string, version: string): Promise<Response | null>;
|
|
28
32
|
}
|
|
29
|
-
export declare function createProfileClient(): Promise<ProfileClient>;
|
|
33
|
+
export declare function createProfileClient(signal?: AbortSignal): Promise<ProfileClient>;
|
|
@@ -12,7 +12,7 @@ export interface RemoteInputFileDescriptor {
|
|
|
12
12
|
}
|
|
13
13
|
export declare function describeRemoteFiles(files: RemoteInputFile[]): RemoteInputFileDescriptor[];
|
|
14
14
|
export declare function sha256(bytes: Uint8Array): string;
|
|
15
|
-
export declare function readBoundedResponse(response: Response, maximum: number): Promise<Uint8Array>;
|
|
15
|
+
export declare function readBoundedResponse(response: Response, maximum: number, signal?: AbortSignal): Promise<Uint8Array>;
|
|
16
16
|
/** Small inline inputs for agent transports; larger files belong in the CLI/SDK. */
|
|
17
17
|
export declare function decodeRemoteFiles(files: Array<{
|
|
18
18
|
name: string;
|
|
@@ -46,6 +46,11 @@ export declare function selectionBundlePath(selection: ResolvedSkillSelection, o
|
|
|
46
46
|
export declare function writeSelectionJson(path: string, value: unknown): void;
|
|
47
47
|
export declare function readSelectionJson<T>(path: string): T | null;
|
|
48
48
|
export declare function readCachedSelection(selection: ResolvedSkillSelection, options?: SelectionCacheOptions): Promise<SkillBundleEntry[] | null>;
|
|
49
|
+
/** Verify an authenticated exact-version response without changing any cache or receipt. */
|
|
50
|
+
export declare function verifySelectionBundleResponse(selection: ResolvedSkillSelection, response: Response | null, signal?: AbortSignal, deadline?: number): Promise<{
|
|
51
|
+
bytes: Uint8Array;
|
|
52
|
+
entries: SkillBundleEntry[];
|
|
53
|
+
}>;
|
|
49
54
|
export declare function cacheSelectionBundle(selection: ResolvedSkillSelection, response: Response | null, options?: SelectionCacheOptions): Promise<SkillBundleEntry[]>;
|
|
50
55
|
export declare function activateSelectionProfile(profile: ResolvedSkillProfile, options?: SelectionCacheOptions): CachedSelectionProfile;
|
|
51
56
|
export declare function readSelectionProfile(profileId: string, options?: SelectionCacheOptions): CachedSelectionProfile | null;
|
|
@@ -30,10 +30,13 @@ export declare function inspectSkillSession(sessionId: string, options?: Selecti
|
|
|
30
30
|
selectionCount: number;
|
|
31
31
|
loadedCount: number;
|
|
32
32
|
};
|
|
33
|
+
/** Fits inside the managed context child's 6.5-second ceiling, including CLI work. */
|
|
34
|
+
export declare const SESSION_RENEWAL_TIMEOUT_MS = 4000;
|
|
33
35
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
36
|
+
* Renew authorization for the complete immutable pin; never manufacture a
|
|
37
|
+
* profile combining historical loaded versions with current unloaded versions.
|
|
38
|
+
* Current profile membership/lifecycle authorizes unchanged pins. Historical
|
|
39
|
+
* versions additionally require the authenticated exact-version bundle read.
|
|
37
40
|
*/
|
|
38
41
|
export declare function reconcileSkillSessionIfSafe(sessionId: string, profileId: string, options?: SessionReconciliationOptions): Promise<boolean>;
|
|
39
42
|
/** Explicit review for changed loaded selections or intentional profile migration. */
|