@hasna/skills 0.1.63 → 0.1.64
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 +28 -6
- package/bin/index.js +1593 -228
- package/bin/mcp.js +290 -24
- package/bin/migrate.js +229 -33
- package/bin/server.js +774 -116
- package/bin/worker.js +558 -79
- package/dist/cli/commands/registry-reconcile.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +559 -251
- package/dist/lib/agent-sync.d.ts +26 -6
- package/dist/lib/auth-store.d.ts +37 -0
- package/dist/lib/config.d.ts +51 -0
- package/dist/lib/home-census.d.ts +4 -0
- package/dist/lib/home-migration.d.ts +8 -9
- package/dist/lib/native-storage.d.ts +1 -1
- package/dist/lib/portable-skills.d.ts +35 -6
- package/dist/lib/pull.d.ts +31 -0
- package/dist/lib/registry-reconcile.d.ts +114 -0
- package/dist/lib/registry.d.ts +7 -4
- package/dist/lib/remote-client.d.ts +118 -1
- package/dist/lib/remote-registry.d.ts +26 -0
- package/dist/lib/revision.d.ts +29 -0
- package/dist/sdk/index.js +1351 -353
- package/dist/server/app.d.ts +1 -1
- package/dist/server/config.d.ts +12 -2
- package/dist/server/rows.d.ts +2 -1
- package/dist/server/skills-api.d.ts +108 -6
- package/dist/server/sqlite-store.d.ts +20 -3
- package/dist/server/store.d.ts +31 -5
- package/dist/server/types.d.ts +98 -3
- package/dist/storage.js +7 -2
- package/migrations/postgres/0004_hosted_pins.sql +28 -0
- package/migrations/postgres/0005_revision_tombstone_registry.sql +37 -0
- package/migrations/postgres/0005_tag_projection.sql +36 -0
- package/migrations/sqlite/0004_hosted_pins.sql +21 -0
- package/migrations/sqlite/0005_revision_tombstone_registry.sql +18 -0
- package/migrations/sqlite/0005_tag_projection.sql +25 -0
- package/package.json +3 -2
|
@@ -19,4 +19,30 @@ export declare function buildSkillsApiUrl(apiUrl: string, endpoint?: string): st
|
|
|
19
19
|
export declare function parseRemoteRegistryPayload(payload: unknown): SkillMeta[];
|
|
20
20
|
export declare function parseRemoteSkillPayload(payload: unknown): SkillMeta;
|
|
21
21
|
export declare function loadRemoteRegistry(options?: RemoteRegistryOptions): Promise<SkillMeta[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Merge the authenticated remote registry into a local listing, whenever the
|
|
24
|
+
* install is pointed at a hosted instance.
|
|
25
|
+
*
|
|
26
|
+
* This is the fail-closed (R1) default-read merge: a client configured with an
|
|
27
|
+
* origin sees the folder UNION cloud in the plain `list`/`search` path, while
|
|
28
|
+
* every other install keeps today's exact local behavior.
|
|
29
|
+
*
|
|
30
|
+
* - No origin configured -> the local list is returned unchanged and no
|
|
31
|
+
* request is attempted. An unconfigured install must stay byte-identical
|
|
32
|
+
* to the pre-merge output.
|
|
33
|
+
* - Origin configured but no credential -> the local list is returned
|
|
34
|
+
* unchanged and nothing throws. Auth-missing must never crash a read.
|
|
35
|
+
* - Origin + credential -> the remote registry is fetched and merged under
|
|
36
|
+
* the precedence in registry-merge.ts (custom > extension > private >
|
|
37
|
+
* private-hosted > remote > upstream > official), remote rows tagged
|
|
38
|
+
* `source: "remote"`.
|
|
39
|
+
* - A configured, authenticated read that FAILS (auth rejection, HTTP
|
|
40
|
+
* error, network failure) throws a clear error rather than silently
|
|
41
|
+
* returning the local half — a silent partial listing would report
|
|
42
|
+
* success for a union the caller asked to include.
|
|
43
|
+
*
|
|
44
|
+
* The explicit `--remote` path stays on loadRemoteRegistry(): an explicit
|
|
45
|
+
* request has always been fatal on failure, and that contract is unchanged.
|
|
46
|
+
*/
|
|
47
|
+
export declare function mergeRemoteRegistry(local: SkillMeta[], options?: RemoteRegistryOptions): Promise<SkillMeta[]>;
|
|
22
48
|
export declare function loadRemoteSkill(name: string, options?: RemoteRegistryOptions): Promise<SkillMeta>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The row's content-addressed revision identity: a lowercase hex sha-256. */
|
|
2
|
+
export declare const REVISION_ID_PATTERN: RegExp;
|
|
3
|
+
export interface RevisionContent {
|
|
4
|
+
slug: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
description: string;
|
|
7
|
+
category: string;
|
|
8
|
+
tags: string[];
|
|
9
|
+
source: string;
|
|
10
|
+
kind: "executable" | "instruction";
|
|
11
|
+
version?: string;
|
|
12
|
+
skillMd?: string;
|
|
13
|
+
bundleSha256?: string;
|
|
14
|
+
bundleByteSize?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function revisionIdOf(content: RevisionContent): string;
|
|
17
|
+
export declare function revisionIdOfRecord(record: RevisionContent): string;
|
|
18
|
+
/**
|
|
19
|
+
* The legacy-row marker the 0004 migration leaves behind.
|
|
20
|
+
*
|
|
21
|
+
* Migration 0004 adds revision_id with DEFAULT '', so rows written before the migration
|
|
22
|
+
* carry an empty id. An empty id would make the If-Match guard vacuous for those rows:
|
|
23
|
+
* two clients that both read '' would both "match" and both land, silently overwriting
|
|
24
|
+
* each other. The stores replace the marker with a real content sha on first open
|
|
25
|
+
* (idempotent: new code always writes a full id, so the marker never reappears).
|
|
26
|
+
*/
|
|
27
|
+
export declare const LEGACY_REVISION_ID = "";
|
|
28
|
+
/** True when a revision id is the empty legacy marker (needs backfill). */
|
|
29
|
+
export declare function isLegacyRevisionId(value: string): boolean;
|