@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
|
@@ -163,5 +163,6 @@ export declare function readSkillVersion(store: SkillsProductStore, principal: A
|
|
|
163
163
|
export declare function readSkillVersionBundle(store: SkillsProductStore, artifactStorage: ArtifactStorage, principal: ApiPrincipal, slug: string, version: string): Promise<{
|
|
164
164
|
version: ServerSkillVersion;
|
|
165
165
|
bytes: OwnedBytes;
|
|
166
|
+
authorizationEpoch?: string;
|
|
166
167
|
}>;
|
|
167
168
|
export {};
|
package/dist/server/types.d.ts
CHANGED
|
@@ -217,6 +217,8 @@ export interface ServerSkillRecord {
|
|
|
217
217
|
*/
|
|
218
218
|
tombstonedAt?: string;
|
|
219
219
|
tombstonePurgeAfter?: string;
|
|
220
|
+
/** Changes on lifecycle breaks, not ordinary immutable-version publication. */
|
|
221
|
+
authorizationEpoch?: string;
|
|
220
222
|
/** Catalog lifecycle state. Archived rows retain versions and bundles for explicit reads. */
|
|
221
223
|
lifecycle: "active" | "archived";
|
|
222
224
|
archivedAt?: string;
|
|
@@ -286,7 +288,7 @@ export interface PublishedSkillSelection {
|
|
|
286
288
|
}
|
|
287
289
|
/** Metadata only: bundle availability means its tenant-owned storage row exists. */
|
|
288
290
|
export interface PublishedSkillSelectionState extends PublishedSkillSelection {
|
|
289
|
-
current: Pick<ServerSkillRecord, "lifecycle" | "tombstonedAt"> | null;
|
|
291
|
+
current: Pick<ServerSkillRecord, "lifecycle" | "tombstonedAt" | "authorizationEpoch"> | null;
|
|
290
292
|
versionBundleSha256: string | null;
|
|
291
293
|
bundleAvailable: boolean;
|
|
292
294
|
}
|
|
@@ -19,6 +19,8 @@ export interface SkillProfile {
|
|
|
19
19
|
updatedAt: string;
|
|
20
20
|
}
|
|
21
21
|
export interface ResolvedSkillSelection extends SkillSelection {
|
|
22
|
+
/** Server-minted lifecycle fence, absent on legacy authorities/snapshots. */
|
|
23
|
+
authorizationEpoch?: string;
|
|
22
24
|
authority: string;
|
|
23
25
|
workspaceId: string;
|
|
24
26
|
profileRevision: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
-- A new baseline is current authorization, never evidence of historical continuity.
|
|
2
|
+
-- Clients lacking a recorded epoch may adopt one only from exact-current selections.
|
|
3
|
+
ALTER TABLE skills_registry ADD COLUMN authorization_epoch text NOT NULL
|
|
4
|
+
DEFAULT replace(gen_random_uuid()::text, '-', '')
|
|
5
|
+
CHECK (authorization_epoch ~ '^[a-f0-9]{32}$');
|
|
6
|
+
|
|
7
|
+
CREATE FUNCTION skills_registry_authorization_epoch() RETURNS trigger LANGUAGE plpgsql AS $$
|
|
8
|
+
BEGIN
|
|
9
|
+
IF TG_OP = 'INSERT' THEN
|
|
10
|
+
NEW.authorization_epoch := replace(gen_random_uuid()::text, '-', '');
|
|
11
|
+
ELSIF (OLD.tombstoned_at IS NULL AND NEW.tombstoned_at IS NOT NULL)
|
|
12
|
+
OR OLD.lifecycle IS DISTINCT FROM NEW.lifecycle THEN
|
|
13
|
+
NEW.authorization_epoch := replace(gen_random_uuid()::text, '-', '');
|
|
14
|
+
ELSE
|
|
15
|
+
NEW.authorization_epoch := OLD.authorization_epoch;
|
|
16
|
+
END IF;
|
|
17
|
+
RETURN NEW;
|
|
18
|
+
END;
|
|
19
|
+
$$;
|
|
20
|
+
CREATE TRIGGER skills_registry_authorization_epoch
|
|
21
|
+
BEFORE INSERT OR UPDATE ON skills_registry
|
|
22
|
+
FOR EACH ROW EXECUTE FUNCTION skills_registry_authorization_epoch();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- Snapshot epochs are server-owned. This baseline does not backfill local receipts.
|
|
2
|
+
ALTER TABLE skills_registry ADD COLUMN authorization_epoch text;
|
|
3
|
+
UPDATE skills_registry SET authorization_epoch = lower(hex(randomblob(16)));
|
|
4
|
+
CREATE TRIGGER skills_registry_authorization_epoch_insert
|
|
5
|
+
AFTER INSERT ON skills_registry
|
|
6
|
+
BEGIN
|
|
7
|
+
UPDATE skills_registry SET authorization_epoch = lower(hex(randomblob(16)))
|
|
8
|
+
WHERE org_id = NEW.org_id AND slug = NEW.slug;
|
|
9
|
+
END;
|
|
10
|
+
CREATE TRIGGER skills_registry_authorization_epoch_lifecycle
|
|
11
|
+
AFTER UPDATE OF tombstoned_at, lifecycle ON skills_registry
|
|
12
|
+
WHEN (OLD.tombstoned_at IS NULL AND NEW.tombstoned_at IS NOT NULL)
|
|
13
|
+
OR OLD.lifecycle IS NOT NEW.lifecycle
|
|
14
|
+
BEGIN
|
|
15
|
+
UPDATE skills_registry SET authorization_epoch = lower(hex(randomblob(16)))
|
|
16
|
+
WHERE org_id = NEW.org_id AND slug = NEW.slug;
|
|
17
|
+
END;
|