@hasna/skills 0.10.45 → 0.10.47

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.
@@ -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";
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[];
@@ -62,7 +62,7 @@ export interface AgentIntegrationPlan {
62
62
  before: string;
63
63
  };
64
64
  settingsWitnessUpgrade?: {
65
- agent: "claude" | "codex";
65
+ agent: "claude" | "codex" | "sumi";
66
66
  path: string;
67
67
  fromHashMode: string;
68
68
  fromSha256: string;
@@ -188,7 +188,7 @@ export declare function planClaudeHookEventsUpdate(options: ClaudeHookUpdateOpti
188
188
  * unknown settings, native controls and policy bytes remain guarded.
189
189
  */
190
190
  export declare function planAgentSettingsWitnessUpgrade(options: {
191
- agent: "claude" | "codex";
191
+ agent: "claude" | "codex" | "sumi";
192
192
  targetCodexVersion?: 2 | 3 | 4;
193
193
  reviewedPreimage: string;
194
194
  home?: string;
@@ -4,6 +4,9 @@ export declare function sumiConfigPath(home: string): string;
4
4
  /** Native V2 plugin, not an OpenCode chat.message factory. Instructions enter
5
5
  * transient request context; prompts and the plugin carry no payload fallback. */
6
6
  export declare function renderSumiPlugin(command: string, profile: string): string;
7
+ /** Exact previous generator only: upgrades may replace this owned plugin, never
8
+ * arbitrary plugin bytes. Native discovery and config checks still run first. */
9
+ export declare function isManagedSumiPlugin(text: string | null, command: string, profile: string): boolean;
7
10
  export declare const SUMI_SKILL_PERMISSIONS: readonly [{
8
11
  readonly action: "skill";
9
12
  readonly resource: "*";
@@ -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;
@@ -9,7 +9,7 @@ export declare const CLAUDE_SETTINGS_WITNESS_LIMITS: Readonly<{
9
9
  export interface ClaudeSettingsWitnessBudget {
10
10
  remaining: number;
11
11
  }
12
- export declare function readNativeSettingsWitnessFile(path: string, budget: ClaudeSettingsWitnessBudget, filename?: "settings.json" | "config.toml"): string;
12
+ export declare function readNativeSettingsWitnessFile(path: string, budget: ClaudeSettingsWitnessBudget, filename?: "settings.json" | "config.toml" | "sumi.json"): string;
13
13
  /** Cooperating installers may replace only their explicitly selected event. Compare the strict syntax
14
14
  * trees, not JSON.parse values or the preference-tolerant witness digest: all
15
15
  * other hooks, discovery settings, unknown values and number spellings remain
@@ -53,3 +53,7 @@ export declare function upgradeClaudeSettingsWitness(previous: {
53
53
  }, reviewedSettingsPath: string): ReturnType<typeof captureClaudeSettingsV3>;
54
54
  /** Strict bounded JSON control witness; metadata exclusion must be explicit. */
55
55
  export declare function hashNativeJsonControls(text: string, excludedMetadata?: "version"): string;
56
+ /** Sumi's versioned review uses the same strict JSON parser and bounded syntax
57
+ * tree. Unknown fields, permissions, routing and executable inputs stay bound.
58
+ * Only schema/display strings and two presentation-only booleans may vary. */
59
+ export declare function hashSumiNativeJsonControls(text: 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;
@@ -49,6 +49,7 @@ export declare function loadSelectedSkill(spec: string, profileId: string, optio
49
49
  file: string;
50
50
  source: string;
51
51
  verifiedAt: string;
52
+ authorizationEpoch?: string;
52
53
  authority: string;
53
54
  workspaceId: string;
54
55
  profileRevision: string;
@@ -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
- * Managed hooks may move an expired pin only when every skill already loaded
35
- * by this session is still selected with exactly the same behavior and bytes.
36
- * The old receipt is archived and replaced under its exact snapshot lock.
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. */
@@ -0,0 +1,14 @@
1
+ import { type ClaudeSettingsWitnessBudget } from "./claude-settings-witness.js";
2
+ export declare const SUMI_DISCOVERY_PROJECTION_FIELDS: readonly ["skills", "plugin", "plugins", "permissions"];
3
+ export declare function readSumiSettingsPreimage(path: string): string;
4
+ export declare function hashSumiSettingsReplacement(text: string, limits: ClaudeSettingsWitnessBudget): string;
5
+ export declare function captureSumiSettings(path: string, limits?: ClaudeSettingsWitnessBudget): {
6
+ path: string;
7
+ hashMode: "sumi-settings-v1";
8
+ sha256: string;
9
+ };
10
+ export declare function upgradeSumiSettingsWitness(previous: {
11
+ path: string;
12
+ hashMode?: "bytes";
13
+ sha256: string;
14
+ }, reviewedSettingsPath: string): ReturnType<typeof captureSumiSettings>;