@musebook/discovery 0.0.0-stage → 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 The Musebook
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,11 @@
1
- # Temporary Holding Version
1
+ # @musebook/discovery
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Musebook Agent Kit — directory/registry search, provider inspection, x402m discovery + contentProfiles.
4
+
5
+ ```sh
6
+ npm install @musebook/discovery
7
+ ```
8
+
9
+ Part of [Musebook Agent Kit](https://github.com/themusebook/agent-kit). Every write builds an **unsigned** transaction that you sign in your own wallet; this package never holds or reads private keys.
10
+
11
+ MIT licensed.
@@ -0,0 +1,5 @@
1
+ export * from "./registry.js";
2
+ export * from "./provider.js";
3
+ export * from "./messaging.js";
4
+ export * from "./skills.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from "./registry.js";
2
+ export * from "./provider.js";
3
+ export * from "./messaging.js";
4
+ export * from "./skills.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * x402m discovery + content-profile negotiation.
3
+ *
4
+ * Delivery is not intelligibility: the mailbox spec answers "did the bytes
5
+ * arrive, from an authenticated agent?" — content profiles answer "will
6
+ * the recipient understand what the quote MEANS?" Services advertise
7
+ * `contentProfiles` in their discovery descriptor; envelopes name the
8
+ * profile they use (`<name>/v<major>`); a recipient that cannot interpret
9
+ * one replies with a typed `unsupported_profile` refusal instead of
10
+ * silently misreading an offer. (Reserved upstream in spec commit 022e006,
11
+ * x402-foundation PR #3944.)
12
+ */
13
+ export interface MessagingDescriptor {
14
+ /** Mailbox execute endpoint base. */
15
+ endpoint: string;
16
+ /** Agent directory URL for this messaging service. */
17
+ directory?: string;
18
+ deliveryGuarantee?: string;
19
+ retention?: string;
20
+ federation?: boolean;
21
+ capabilities?: string[];
22
+ authProfiles?: string[];
23
+ /** Content profile identifiers this service's agents accept. Absent = none. */
24
+ contentProfiles: string[];
25
+ raw: unknown;
26
+ }
27
+ export declare function getMessagingDescriptor(baseUrl: string): Promise<MessagingDescriptor>;
28
+ /** Parse `<name>/v<major>` — names may be short names or absolute URIs. */
29
+ export declare function parseContentProfile(id: string): {
30
+ name: string;
31
+ major: number;
32
+ } | null;
33
+ export declare function isProfileSupported(descriptor: MessagingDescriptor, profile: string): boolean;
34
+ export type ProfileNegotiation = {
35
+ supported: true;
36
+ profile: string;
37
+ } | {
38
+ supported: false;
39
+ code: "unsupported_profile";
40
+ profile: string;
41
+ /** Profiles the counterparty DOES accept (the wire reply calls this `supported`). */
42
+ supportedProfiles: string[];
43
+ /** Same name, highest major the other side offers — a hint, never a silent downgrade. */
44
+ closest: string | null;
45
+ };
46
+ /**
47
+ * Decide whether `profile` can be used with a counterparty descriptor.
48
+ * Fail closed on major-version mismatch; never downgrade silently.
49
+ */
50
+ export declare function negotiateContentProfile(descriptor: MessagingDescriptor, profile: string): ProfileNegotiation;
51
+ /** Build the wire shape of an unsupported_profile error reply (kind: "error"). */
52
+ export declare function unsupportedProfileReply(profile: string, supported: string[]): {
53
+ code: "unsupported_profile";
54
+ profile: string;
55
+ supported: string[];
56
+ };
57
+ //# sourceMappingURL=messaging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../src/messaging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,+EAA+E;IAC/E,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,GAAG,EAAE,OAAO,CAAC;CACd;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,mBAAmB,CAAC,CAmB9B;AAED,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAItF;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5F;AAED,MAAM,MAAM,kBAAkB,GAC1B;IAAE,SAAS,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACpC;IACE,SAAS,EAAE,KAAK,CAAC;IACjB,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,yFAAyF;IACzF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEN;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,mBAAmB,EAC/B,OAAO,EAAE,MAAM,GACd,kBAAkB,CAoBpB;AAED,kFAAkF;AAClF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG;IAC7E,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAEA"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * x402m discovery + content-profile negotiation.
3
+ *
4
+ * Delivery is not intelligibility: the mailbox spec answers "did the bytes
5
+ * arrive, from an authenticated agent?" — content profiles answer "will
6
+ * the recipient understand what the quote MEANS?" Services advertise
7
+ * `contentProfiles` in their discovery descriptor; envelopes name the
8
+ * profile they use (`<name>/v<major>`); a recipient that cannot interpret
9
+ * one replies with a typed `unsupported_profile` refusal instead of
10
+ * silently misreading an offer. (Reserved upstream in spec commit 022e006,
11
+ * x402-foundation PR #3944.)
12
+ */
13
+ export async function getMessagingDescriptor(baseUrl) {
14
+ const base = baseUrl.replace(/\/$/, "");
15
+ const res = await fetch(`${base}/.well-known/x402m`);
16
+ if (!res.ok)
17
+ throw new Error(`x402m discovery failed: HTTP ${res.status}`);
18
+ const body = (await res.json());
19
+ const str = (v) => (typeof v === "string" ? v : undefined);
20
+ return {
21
+ endpoint: str(body.endpoint) ?? str(body.execute_endpoint) ?? base,
22
+ directory: str(body.directory),
23
+ deliveryGuarantee: str(body.deliveryGuarantee) ?? str(body.delivery_guarantee),
24
+ retention: str(body.retention),
25
+ federation: typeof body.federation === "boolean" ? body.federation : undefined,
26
+ capabilities: Array.isArray(body.capabilities) ? body.capabilities : undefined,
27
+ authProfiles: Array.isArray(body.authProfiles) ? body.authProfiles : undefined,
28
+ contentProfiles: Array.isArray(body.contentProfiles)
29
+ ? body.contentProfiles
30
+ : [],
31
+ raw: body,
32
+ };
33
+ }
34
+ /** Parse `<name>/v<major>` — names may be short names or absolute URIs. */
35
+ export function parseContentProfile(id) {
36
+ const m = /^(.+)\/v(\d+)$/.exec(id);
37
+ if (!m)
38
+ return null;
39
+ return { name: m[1], major: Number(m[2]) };
40
+ }
41
+ export function isProfileSupported(descriptor, profile) {
42
+ return descriptor.contentProfiles.includes(profile);
43
+ }
44
+ /**
45
+ * Decide whether `profile` can be used with a counterparty descriptor.
46
+ * Fail closed on major-version mismatch; never downgrade silently.
47
+ */
48
+ export function negotiateContentProfile(descriptor, profile) {
49
+ if (isProfileSupported(descriptor, profile)) {
50
+ return { supported: true, profile };
51
+ }
52
+ const wanted = parseContentProfile(profile);
53
+ let closest = null;
54
+ if (wanted) {
55
+ const sameName = descriptor.contentProfiles
56
+ .map((id) => ({ id, parsed: parseContentProfile(id) }))
57
+ .filter((x) => x.parsed && x.parsed.name === wanted.name)
58
+ .sort((a, b) => (b.parsed?.major ?? 0) - (a.parsed?.major ?? 0));
59
+ closest = sameName[0]?.id ?? null;
60
+ }
61
+ return {
62
+ supported: false,
63
+ code: "unsupported_profile",
64
+ profile,
65
+ supportedProfiles: descriptor.contentProfiles,
66
+ closest,
67
+ };
68
+ }
69
+ /** Build the wire shape of an unsupported_profile error reply (kind: "error"). */
70
+ export function unsupportedProfileReply(profile, supported) {
71
+ return { code: "unsupported_profile", profile, supported };
72
+ }
73
+ //# sourceMappingURL=messaging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messaging.js","sourceRoot":"","sources":["../src/messaging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAiBH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAe;IAEf,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,oBAAoB,CAAC,CAAC;IACrD,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3E,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA4B,CAAC;IAC3D,MAAM,GAAG,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACpE,OAAO;QACL,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,IAAI;QAClE,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;QAC9B,iBAAiB,EAAE,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC;QAC9E,SAAS,EAAE,GAAG,CAA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GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,OAAO,GAAkB,IAAI,CAAC;IAClC,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe;aACxC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;aACtD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC;aACxD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC;QACnE,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC;IACpC,CAAC;IACD,OAAO;QACL,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,qBAAqB;QAC3B,OAAO;QACP,iBAAiB,EAAE,UAAU,CAAC,eAAe;QAC7C,OAAO;KACR,CAAC;AACJ,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,uBAAuB,CAAC,OAAe,EAAE,SAAmB;IAK1E,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { AgentConfiguration } from "@musebook/auth";
2
+ /**
3
+ * Agent Auth provider inspection — the same read registry.musebook.trade's
4
+ * /discover page performs: fetch a provider's agent-configuration and
5
+ * summarize what an agent is walking into.
6
+ */
7
+ export interface ProviderSummary {
8
+ providerName: string | null;
9
+ issuer: string;
10
+ modes: string[];
11
+ approval: string[];
12
+ endpointCount: number;
13
+ raw: AgentConfiguration;
14
+ }
15
+ export declare function inspectProvider(providerBaseUrl: string): Promise<ProviderSummary>;
16
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;;;GAIG;AAEH,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,kBAAkB,CAAC;CACzB;AAED,wBAAsB,eAAe,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAavF"}
@@ -0,0 +1,16 @@
1
+ export async function inspectProvider(providerBaseUrl) {
2
+ const base = providerBaseUrl.replace(/\/$/, "");
3
+ const res = await fetch(`${base}/.well-known/agent-configuration`);
4
+ if (!res.ok)
5
+ throw new Error(`Provider discovery failed: HTTP ${res.status}`);
6
+ const config = (await res.json());
7
+ return {
8
+ providerName: config.provider_name ?? null,
9
+ issuer: config.issuer,
10
+ modes: config.modes ?? [],
11
+ approval: config.approval ?? [],
12
+ endpointCount: config.endpoints ? Object.keys(config.endpoints).length : 0,
13
+ raw: config,
14
+ };
15
+ }
16
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,eAAuB;IAC3D,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAChD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,kCAAkC,CAAC,CAAC;IACnE,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9E,MAAM,MAAM,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAuB,CAAC;IACxD,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,aAAa,IAAI,IAAI;QAC1C,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE;QACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,EAAE;QAC/B,aAAa,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1E,GAAG,EAAE,MAAM;KACZ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Directory / registry search.
3
+ *
4
+ * The population layer today is the Musebook DIRECTORY on the hub
5
+ * (musebook.trade); registry.musebook.trade renders it but has NO JSON API
6
+ * of its own (GAPS #1) — so the kit queries hub APIs and treats the
7
+ * registry host as the human surface. When the registry API lands, only
8
+ * the base URL changes.
9
+ *
10
+ * Two machine-readable shapes exist in the wild, and BOTH are supported:
11
+ *
12
+ * 1. The hub directory API: GET {hub}/api/v2/agents?search=&limit=&offset=
13
+ * answering an array or { agents: [...] }.
14
+ * 2. The published directory snapshot: GET {hub}/live/agents.json —
15
+ * { generated_at, total_agents, by_network, agents: [...] } where each
16
+ * record is the DAS-shaped directory entry:
17
+ * { assetId, name, network, metadataUri, assetSigner, interface,
18
+ * update_authority, json_uri?, description?, image?,
19
+ * external_url?, agentToken? }
20
+ * The agents repo (themusebook/agents, `musebook/agents.json`) carries
21
+ * the same records in a camelCase envelope
22
+ * { $schema, apiVersion, generatedAt, source, stats, agents } with
23
+ * `identifier` + `updateAuthority` instead of `update_authority`.
24
+ * normalizeAgent() accepts all of these spellings.
25
+ *
26
+ * searchDirectory tries the API first and falls back to the snapshot, so
27
+ * directory reads keep working even when the API route is unavailable.
28
+ */
29
+ export interface DiscoveryConfig {
30
+ hub: string;
31
+ registry: string;
32
+ }
33
+ export interface DirectoryAgent {
34
+ /** Directory/API id when one exists; the asset id for snapshot records. */
35
+ id: string;
36
+ /** MPL Core asset address (snapshot spelling: assetId). */
37
+ assetId: string | null;
38
+ name: string | null;
39
+ description: string | null;
40
+ /** Owner wallet — snapshot spelling is update_authority (the update authority wallet). */
41
+ wallet: string | null;
42
+ ownerWallet: string | null;
43
+ updateAuthority: string | null;
44
+ /** Keyless Asset Signer PDA, when the record carries it. */
45
+ assetSigner: string | null;
46
+ network: string | null;
47
+ image: string | null;
48
+ metadataUri: string | null;
49
+ externalUrl: string | null;
50
+ /** Canonical bound token mint (agent_token binding), when present. */
51
+ agentToken: string | null;
52
+ assetAddress: string | null;
53
+ raw: unknown;
54
+ }
55
+ export declare function normalizeAgent(raw: Record<string, unknown>): DirectoryAgent;
56
+ /** The snapshot envelope, as published at {hub}/live/agents.json. */
57
+ export interface DirectorySnapshot {
58
+ generatedAt: string | null;
59
+ totalAgents: number | null;
60
+ byNetwork: Record<string, number> | null;
61
+ agents: DirectoryAgent[];
62
+ }
63
+ export declare function normalizeSnapshot(body: unknown): DirectorySnapshot;
64
+ /** Fetch + normalize the published directory snapshot. */
65
+ export declare function fetchDirectorySnapshot(config: DiscoveryConfig): Promise<DirectorySnapshot>;
66
+ /** Search the snapshot client-side (fallback path / offline reads). */
67
+ export declare function searchDirectorySnapshot(config: DiscoveryConfig, query: string, options?: {
68
+ limit?: number;
69
+ offset?: number;
70
+ }): Promise<DirectoryAgent[]>;
71
+ export declare function searchDirectory(config: DiscoveryConfig, query: string, options?: {
72
+ limit?: number;
73
+ offset?: number;
74
+ }): Promise<DirectoryAgent[]>;
75
+ export declare function getDirectoryAgent(config: DiscoveryConfig, idOrWallet: string): Promise<DirectoryAgent | null>;
76
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,0FAA0F;IAC1F,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,4DAA4D;IAC5D,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,sEAAsE;IACtE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,GAAG,EAAE,OAAO,CAAC;CACd;AAID,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc,CAyB3E;AAED,qEAAqE;AACrE,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACzC,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,iBAAiB,CAmBlE;AAED,0DAA0D;AAC1D,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,iBAAiB,CAAC,CAI5B;AAUD,uEAAuE;AACvE,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAChD,OAAO,CAAC,cAAc,EAAE,CAAC,CAO3B;AAED,wBAAsB,eAAe,CACnC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAChD,OAAO,CAAC,cAAc,EAAE,CAAC,CAmB3B;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAUhC"}
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Directory / registry search.
3
+ *
4
+ * The population layer today is the Musebook DIRECTORY on the hub
5
+ * (musebook.trade); registry.musebook.trade renders it but has NO JSON API
6
+ * of its own (GAPS #1) — so the kit queries hub APIs and treats the
7
+ * registry host as the human surface. When the registry API lands, only
8
+ * the base URL changes.
9
+ *
10
+ * Two machine-readable shapes exist in the wild, and BOTH are supported:
11
+ *
12
+ * 1. The hub directory API: GET {hub}/api/v2/agents?search=&limit=&offset=
13
+ * answering an array or { agents: [...] }.
14
+ * 2. The published directory snapshot: GET {hub}/live/agents.json —
15
+ * { generated_at, total_agents, by_network, agents: [...] } where each
16
+ * record is the DAS-shaped directory entry:
17
+ * { assetId, name, network, metadataUri, assetSigner, interface,
18
+ * update_authority, json_uri?, description?, image?,
19
+ * external_url?, agentToken? }
20
+ * The agents repo (themusebook/agents, `musebook/agents.json`) carries
21
+ * the same records in a camelCase envelope
22
+ * { $schema, apiVersion, generatedAt, source, stats, agents } with
23
+ * `identifier` + `updateAuthority` instead of `update_authority`.
24
+ * normalizeAgent() accepts all of these spellings.
25
+ *
26
+ * searchDirectory tries the API first and falls back to the snapshot, so
27
+ * directory reads keep working even when the API route is unavailable.
28
+ */
29
+ const str = (v) => (typeof v === "string" && v.length > 0 ? v : null);
30
+ export function normalizeAgent(raw) {
31
+ const assetId = str(raw.assetId) ?? str(raw.assetAddress) ?? str(raw.asset) ?? str(raw.mint);
32
+ const owner = str(raw.update_authority) ??
33
+ str(raw.updateAuthority) ??
34
+ str(raw.ownerWallet) ??
35
+ str(raw.wallet);
36
+ return {
37
+ id: str(raw.id) ?? str(raw.agentId) ?? str(raw.identifier) ?? assetId ?? "",
38
+ assetId,
39
+ name: str(raw.name),
40
+ description: str(raw.description),
41
+ wallet: owner,
42
+ ownerWallet: owner,
43
+ updateAuthority: owner,
44
+ assetSigner: str(raw.assetSigner) ?? str(raw.asset_signer),
45
+ network: str(raw.network),
46
+ image: str(raw.image),
47
+ metadataUri: str(raw.metadataUri) ?? str(raw.metadata_uri) ?? str(raw.json_uri),
48
+ externalUrl: str(raw.external_url) ?? str(raw.externalUrl),
49
+ agentToken: str(raw.agentToken) ?? str(raw.agent_token),
50
+ assetAddress: assetId,
51
+ raw,
52
+ };
53
+ }
54
+ export function normalizeSnapshot(body) {
55
+ const env = (body ?? {});
56
+ const list = Array.isArray(body)
57
+ ? body
58
+ : (env.agents ?? []);
59
+ return {
60
+ generatedAt: str(env.generated_at) ?? str(env.generatedAt),
61
+ totalAgents: typeof env.total_agents === "number"
62
+ ? env.total_agents
63
+ : typeof env.totalAgents === "number"
64
+ ? env.totalAgents
65
+ : list.length,
66
+ byNetwork: env.by_network && typeof env.by_network === "object"
67
+ ? env.by_network
68
+ : null,
69
+ agents: list.map(normalizeAgent),
70
+ };
71
+ }
72
+ /** Fetch + normalize the published directory snapshot. */
73
+ export async function fetchDirectorySnapshot(config) {
74
+ const res = await fetch(`${config.hub.replace(/\/$/, "")}/live/agents.json`);
75
+ if (!res.ok)
76
+ throw new Error(`Directory snapshot failed: HTTP ${res.status}`);
77
+ return normalizeSnapshot(await res.json());
78
+ }
79
+ function matchesQuery(agent, query) {
80
+ const q = query.trim().toLowerCase();
81
+ if (!q)
82
+ return true;
83
+ return [agent.id, agent.name, agent.description, agent.wallet, agent.assetId]
84
+ .filter((v) => typeof v === "string")
85
+ .some((v) => v.toLowerCase().includes(q));
86
+ }
87
+ /** Search the snapshot client-side (fallback path / offline reads). */
88
+ export async function searchDirectorySnapshot(config, query, options = {}) {
89
+ const snapshot = await fetchDirectorySnapshot(config);
90
+ const offset = options.offset ?? 0;
91
+ const limit = options.limit ?? 25;
92
+ return snapshot.agents
93
+ .filter((a) => matchesQuery(a, query))
94
+ .slice(offset, offset + limit);
95
+ }
96
+ export async function searchDirectory(config, query, options = {}) {
97
+ const params = new URLSearchParams({
98
+ search: query,
99
+ limit: String(options.limit ?? 25),
100
+ offset: String(options.offset ?? 0),
101
+ });
102
+ try {
103
+ const res = await fetch(`${config.hub.replace(/\/$/, "")}/api/v2/agents?${params}`);
104
+ if (!res.ok)
105
+ throw new Error(`Directory search failed: HTTP ${res.status}`);
106
+ const body = (await res.json());
107
+ const list = Array.isArray(body)
108
+ ? body
109
+ : (body.agents ?? []);
110
+ return list.map(normalizeAgent);
111
+ }
112
+ catch {
113
+ // The snapshot is the same population in published form — fall back to
114
+ // it rather than failing the read.
115
+ return searchDirectorySnapshot(config, query, options);
116
+ }
117
+ }
118
+ export async function getDirectoryAgent(config, idOrWallet) {
119
+ const results = await searchDirectory(config, idOrWallet, { limit: 10 });
120
+ return (results.find((a) => a.id === idOrWallet || a.wallet === idOrWallet || a.assetId === idOrWallet) ??
121
+ results[0] ??
122
+ null);
123
+ }
124
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AA8BH,MAAM,GAAG,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAE/E,MAAM,UAAU,cAAc,CAAC,GAA4B;IACzD,MAAM,OAAO,GACX,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/E,MAAM,KAAK,GACT,GAAG,CAAC,GAAG,CAAC,gBAAgB,CAAC;QACzB,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC;QACxB,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC;QACpB,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAClB,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,OAAO,IAAI,EAAE;QAC3E,OAAO;QACP,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;QACnB,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC;QACjC,MAAM,EAAE,KAAK;QACb,WAAW,EAAE,KAAK;QAClB,eAAe,EAAE,KAAK;QACtB,WAAW,EAAE,GAAG,CAAC,GAAG,CAAC,WAAW,CA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AC;IACzD,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAuB,EACvB,UAAkB;IAElB,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACzE,OAAO,CACL,OAAO,CAAC,IAAI,CACV,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,EAAE,KAAK,UAAU,IAAI,CAAC,CAAC,MAAM,KAAK,UAAU,IAAI,CAAC,CAAC,OAAO,KAAK,UAAU,CAC7E;QACD,OAAO,CAAC,CAAC,CAAC;QACV,IAAI,CACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Skills catalog discovery.
3
+ *
4
+ * Canonical home: the skills repo — github.com/themusebook/skills
5
+ * (transferred from Solizardking/skills; the old path redirects). The repo
6
+ * publishes a flat catalog at catalog.json:
7
+ * [ { slug, name, description, category }, ... ] (599 entries)
8
+ * and one folder per skill under skills/<slug>/SKILL.md whose YAML
9
+ * frontmatter follows the standard skill shape:
10
+ * ---
11
+ * name: ask-mcp
12
+ * description: "..."
13
+ * metadata: # optional
14
+ * source: https://github.com/<upstream>
15
+ * documentation: https://…
16
+ * openclaw:
17
+ * requires: { env: [], bins: [] }
18
+ * allowed-tools: # optional
19
+ * - Read
20
+ * ---
21
+ *
22
+ * The live site surface is musebook.trade/skills, and the hub serves the
23
+ * live catalog at GET {hub}/api/skills — a flat list of
24
+ * { slug, name, description, category, path, version }
25
+ * (272 entries, verified 2026-10-29; `path` is the SKILL.md path inside
26
+ * the install tarball, e.g. "1password/SKILL.md"). fetchSkillsCatalog
27
+ * prefers that live endpoint and falls back to the repo's catalog.json.
28
+ * The install tarball itself is at {hub}/clawd-skills.tar.gz
29
+ * (layout: skills/<slug>/SKILL.md + references). Note /live/skills.json
30
+ * and /skills.json are NOT endpoints (404) — /api/skills is the live one.
31
+ */
32
+ export interface SkillsConfig {
33
+ hub: string;
34
+ /** Live catalog endpoint override. Default: {hub}/api/skills. */
35
+ apiUrl?: string;
36
+ /** Fallback catalog.json URL. Default: the canonical skills repo on GitHub. */
37
+ catalogUrl?: string;
38
+ }
39
+ export declare const DEFAULT_SKILLS_CATALOG_URL = "https://raw.githubusercontent.com/themusebook/skills/main/catalog.json";
40
+ export declare const SKILLS_REPO_URL = "https://github.com/themusebook/skills";
41
+ export interface SkillCatalogEntry {
42
+ slug: string;
43
+ name: string;
44
+ description: string | null;
45
+ category: string | null;
46
+ /** SKILL.md path inside the install tarball (live API entries only). */
47
+ path: string | null;
48
+ /** Catalog version string, when the source provides one. */
49
+ version: string | null;
50
+ raw: unknown;
51
+ }
52
+ export declare function normalizeSkillEntry(raw: Record<string, unknown>): SkillCatalogEntry;
53
+ /**
54
+ * Fetch the full skills catalog. Prefers the LIVE hub endpoint
55
+ * ({hub}/api/skills — the catalog musebook.trade/skills renders); falls
56
+ * back to the skills repo's catalog.json when the API is unavailable.
57
+ */
58
+ export declare function fetchSkillsCatalog(config: SkillsConfig): Promise<SkillCatalogEntry[]>;
59
+ /** Search the catalog by slug/name/description/category (client-side). */
60
+ export declare function searchSkills(config: SkillsConfig, query: string, options?: {
61
+ limit?: number;
62
+ }): Promise<SkillCatalogEntry[]>;
63
+ /** URL of the install tarball the hub serves for the skills catalog. */
64
+ export declare function skillsTarballUrl(config: SkillsConfig): string;
65
+ /** Parsed SKILL.md frontmatter, aligned with the skills repo's format. */
66
+ export interface SkillFrontmatter {
67
+ name: string;
68
+ description: string | null;
69
+ /** metadata.source — upstream repo the skill was vendored from, if any. */
70
+ source: string | null;
71
+ /** metadata.documentation URL, if present. */
72
+ documentation: string | null;
73
+ /** metadata.openclaw.requires — { env: string[], bins: string[] }. */
74
+ requires: {
75
+ env: string[];
76
+ bins: string[];
77
+ } | null;
78
+ /** allowed-tools list, when the skill restricts its tool surface. */
79
+ allowedTools: string[] | null;
80
+ /** Every frontmatter key, unparsed values as raw strings. */
81
+ raw: Record<string, string>;
82
+ }
83
+ /**
84
+ * Parse the YAML frontmatter of a SKILL.md file. Deliberately minimal —
85
+ * it covers the shapes the skills repo actually uses (top-level scalars,
86
+ * the nested metadata.source / metadata.documentation scalars, the
87
+ * metadata.openclaw.requires env/bins lists, and the allowed-tools list)
88
+ * without taking a YAML dependency. Unknown keys are preserved in `raw`.
89
+ */
90
+ export declare function parseSkillFrontmatter(markdown: string): SkillFrontmatter | null;
91
+ //# sourceMappingURL=skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,0BAA0B,2EACmC,CAAC;AAE3E,eAAO,MAAM,eAAe,0CAA0C,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,wEAAwE;IACxE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,GAAG,EAAE,OAAO,CAAC;CACd;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,iBAAiB,CAWnF;AASD;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAY9B;AAED,0EAA0E;AAC1E,wBAAsB,YAAY,CAChC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAW9B;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAE7D;AAED,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,2EAA2E;IAC3E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,sEAAsE;IACtE,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;IACnD,qEAAqE;IACrE,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC9B,6DAA6D;IAC7D,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAaD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAwE/E"}
package/dist/skills.js ADDED
@@ -0,0 +1,186 @@
1
+ /**
2
+ * Skills catalog discovery.
3
+ *
4
+ * Canonical home: the skills repo — github.com/themusebook/skills
5
+ * (transferred from Solizardking/skills; the old path redirects). The repo
6
+ * publishes a flat catalog at catalog.json:
7
+ * [ { slug, name, description, category }, ... ] (599 entries)
8
+ * and one folder per skill under skills/<slug>/SKILL.md whose YAML
9
+ * frontmatter follows the standard skill shape:
10
+ * ---
11
+ * name: ask-mcp
12
+ * description: "..."
13
+ * metadata: # optional
14
+ * source: https://github.com/<upstream>
15
+ * documentation: https://…
16
+ * openclaw:
17
+ * requires: { env: [], bins: [] }
18
+ * allowed-tools: # optional
19
+ * - Read
20
+ * ---
21
+ *
22
+ * The live site surface is musebook.trade/skills, and the hub serves the
23
+ * live catalog at GET {hub}/api/skills — a flat list of
24
+ * { slug, name, description, category, path, version }
25
+ * (272 entries, verified 2026-10-29; `path` is the SKILL.md path inside
26
+ * the install tarball, e.g. "1password/SKILL.md"). fetchSkillsCatalog
27
+ * prefers that live endpoint and falls back to the repo's catalog.json.
28
+ * The install tarball itself is at {hub}/clawd-skills.tar.gz
29
+ * (layout: skills/<slug>/SKILL.md + references). Note /live/skills.json
30
+ * and /skills.json are NOT endpoints (404) — /api/skills is the live one.
31
+ */
32
+ export const DEFAULT_SKILLS_CATALOG_URL = "https://raw.githubusercontent.com/themusebook/skills/main/catalog.json";
33
+ export const SKILLS_REPO_URL = "https://github.com/themusebook/skills";
34
+ export function normalizeSkillEntry(raw) {
35
+ const s = (v) => (typeof v === "string" && v.length > 0 ? v : null);
36
+ return {
37
+ slug: s(raw.slug) ?? s(raw.name) ?? "",
38
+ name: s(raw.name) ?? s(raw.slug) ?? "",
39
+ description: s(raw.description),
40
+ category: s(raw.category),
41
+ path: s(raw.path),
42
+ version: s(raw.version),
43
+ raw,
44
+ };
45
+ }
46
+ function toEntries(body) {
47
+ const list = Array.isArray(body)
48
+ ? body
49
+ : (body.skills ?? []);
50
+ return list.map(normalizeSkillEntry);
51
+ }
52
+ /**
53
+ * Fetch the full skills catalog. Prefers the LIVE hub endpoint
54
+ * ({hub}/api/skills — the catalog musebook.trade/skills renders); falls
55
+ * back to the skills repo's catalog.json when the API is unavailable.
56
+ */
57
+ export async function fetchSkillsCatalog(config) {
58
+ const apiUrl = config.apiUrl ?? `${config.hub.replace(/\/$/, "")}/api/skills`;
59
+ try {
60
+ const res = await fetch(apiUrl);
61
+ if (!res.ok)
62
+ throw new Error(`Skills API failed: HTTP ${res.status}`);
63
+ return toEntries(await res.json());
64
+ }
65
+ catch {
66
+ const url = config.catalogUrl ?? DEFAULT_SKILLS_CATALOG_URL;
67
+ const res = await fetch(url);
68
+ if (!res.ok)
69
+ throw new Error(`Skills catalog failed: HTTP ${res.status}`);
70
+ return toEntries(await res.json());
71
+ }
72
+ }
73
+ /** Search the catalog by slug/name/description/category (client-side). */
74
+ export async function searchSkills(config, query, options = {}) {
75
+ const catalog = await fetchSkillsCatalog(config);
76
+ const q = query.trim().toLowerCase();
77
+ const hits = q
78
+ ? catalog.filter((e) => [e.slug, e.name, e.description, e.category]
79
+ .filter((v) => typeof v === "string")
80
+ .some((v) => v.toLowerCase().includes(q)))
81
+ : catalog;
82
+ return hits.slice(0, options.limit ?? 25);
83
+ }
84
+ /** URL of the install tarball the hub serves for the skills catalog. */
85
+ export function skillsTarballUrl(config) {
86
+ return `${config.hub.replace(/\/$/, "")}/clawd-skills.tar.gz`;
87
+ }
88
+ function unquote(value) {
89
+ const v = value.trim();
90
+ if ((v.startsWith('"') && v.endsWith('"')) ||
91
+ (v.startsWith("'") && v.endsWith("'"))) {
92
+ return v.slice(1, -1);
93
+ }
94
+ return v;
95
+ }
96
+ /**
97
+ * Parse the YAML frontmatter of a SKILL.md file. Deliberately minimal —
98
+ * it covers the shapes the skills repo actually uses (top-level scalars,
99
+ * the nested metadata.source / metadata.documentation scalars, the
100
+ * metadata.openclaw.requires env/bins lists, and the allowed-tools list)
101
+ * without taking a YAML dependency. Unknown keys are preserved in `raw`.
102
+ */
103
+ export function parseSkillFrontmatter(markdown) {
104
+ const match = /^---\r?\n([\s\S]*?)\r?\n---/.exec(markdown);
105
+ if (!match)
106
+ return null;
107
+ const lines = match[1].split(/\r?\n/);
108
+ const raw = {};
109
+ let name = "";
110
+ let description = null;
111
+ let source = null;
112
+ let documentation = null;
113
+ let requires = null;
114
+ let allowedTools = null;
115
+ let section = ""; // "", "metadata", "openclaw", "requires", "allowed-tools"
116
+ let listKey = null;
117
+ for (const line of lines) {
118
+ const top = /^([A-Za-z0-9_-]+):\s*(.*)$/.exec(line);
119
+ const item = /^\s+-\s+(.*)$/.exec(line);
120
+ if (top && !/^\s/.test(line)) {
121
+ const [, key, value] = top;
122
+ listKey = null;
123
+ if (key === "name") {
124
+ name = unquote(value);
125
+ section = "";
126
+ }
127
+ else if (key === "description") {
128
+ description = unquote(value);
129
+ section = "";
130
+ }
131
+ else if (key === "metadata") {
132
+ section = "metadata";
133
+ }
134
+ else if (key === "allowed-tools") {
135
+ allowedTools = [];
136
+ section = "allowed-tools";
137
+ }
138
+ else {
139
+ section = "";
140
+ }
141
+ if (value)
142
+ raw[key] = value;
143
+ continue;
144
+ }
145
+ if (item) {
146
+ const value = unquote(item[1]);
147
+ if (section === "allowed-tools" && allowedTools) {
148
+ allowedTools.push(value);
149
+ }
150
+ else if (section === "requires" && requires && listKey) {
151
+ requires[listKey].push(value);
152
+ }
153
+ continue;
154
+ }
155
+ const nested = /^\s+([A-Za-z0-9_-]+):\s*(.*)$/.exec(line);
156
+ if (nested) {
157
+ const [, key, value] = nested;
158
+ if (section === "metadata" && key === "source")
159
+ source = unquote(value);
160
+ else if (section === "metadata" && key === "documentation") {
161
+ documentation = unquote(value);
162
+ }
163
+ else if (section === "metadata" && key === "openclaw")
164
+ section = "openclaw";
165
+ else if (section === "openclaw" && key === "requires") {
166
+ requires = { env: [], bins: [] };
167
+ section = "requires";
168
+ }
169
+ else if (section === "requires" && (key === "env" || key === "bins")) {
170
+ listKey = key;
171
+ const inline = value.trim();
172
+ if (inline.startsWith("[") && inline.endsWith("]")) {
173
+ const inner = inline.slice(1, -1).trim();
174
+ if (inner && requires) {
175
+ requires[listKey] = inner.split(",").map((v) => unquote(v.trim()));
176
+ }
177
+ listKey = null;
178
+ }
179
+ }
180
+ }
181
+ }
182
+ if (!name)
183
+ return null;
184
+ return { name, description, source, documentation, requires, allowedTools, raw };
185
+ }
186
+ //# sourceMappingURL=skills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.js","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA;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,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;oBACnD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;oBACzC,IAAI,KAAK,IAAI,QAAQ,EAAE,CAAC;wBACtB,QAAQ,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;oBACrE,CAAC;oBACD,OAAO,GAAG,IAAI,CAAC;gBACjB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC;AACnF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,41 @@
1
1
  {
2
2
  "name": "@musebook/discovery",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "Musebook Agent Kit — directory/registry search, provider inspection, x402m discovery + contentProfiles.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./package.json": "./package.json"
15
+ },
16
+ "dependencies": {
17
+ "@musebook/auth": "0.1.1"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/themusebook/agent-kit.git",
22
+ "directory": "packages/discovery"
23
+ },
24
+ "homepage": "https://github.com/themusebook/agent-kit/tree/main/packages/discovery#readme",
25
+ "bugs": {
26
+ "url": "https://github.com/themusebook/agent-kit/issues"
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "README.md",
31
+ "LICENSE"
32
+ ],
33
+ "sideEffects": false,
34
+ "publishConfig": {
35
+ "access": "public",
36
+ "provenance": true
37
+ },
38
+ "scripts": {
39
+ "build": "tsc -p tsconfig.build.json && node ../../scripts/release/fix-esm.mjs"
40
+ }
6
41
  }