@aigne/afs-registry 1.11.0-beta.7

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.md ADDED
@@ -0,0 +1,26 @@
1
+ # Proprietary License
2
+
3
+ Copyright (c) 2024-2025 ArcBlock, Inc. All Rights Reserved.
4
+
5
+ This software and associated documentation files (the "Software") are proprietary
6
+ and confidential. Unauthorized copying, modification, distribution, or use of
7
+ this Software, via any medium, is strictly prohibited.
8
+
9
+ The Software is provided for internal use only within ArcBlock, Inc. and its
10
+ authorized affiliates.
11
+
12
+ ## No License Granted
13
+
14
+ No license, express or implied, is granted to any party for any purpose.
15
+ All rights are reserved by ArcBlock, Inc.
16
+
17
+ ## Public Artifact Distribution
18
+
19
+ Portions of this Software may be released publicly under separate open-source
20
+ licenses (such as MIT License) through designated public repositories. Such
21
+ public releases are governed by their respective licenses and do not affect
22
+ the proprietary nature of this repository.
23
+
24
+ ## Contact
25
+
26
+ For licensing inquiries, contact: legal@arcblock.io
@@ -0,0 +1,168 @@
1
+ import { AFSBaseProvider, AFSEntry, AFSExecResult, AFSExplainResult, AFSRoot, AFSSearchResult, AFSStatResult, RouteContext } from "@aigne/afs";
2
+
3
+ //#region src/index.d.ts
4
+ /**
5
+ * A single provider manifest entry in the registry.
6
+ */
7
+ interface ProviderManifest {
8
+ name: string;
9
+ description: string;
10
+ category: string;
11
+ scheme: string;
12
+ capabilities_summary: string;
13
+ tags?: string[];
14
+ use_cases?: string[];
15
+ package?: string;
16
+ }
17
+ /**
18
+ * Options for constructing an AFSRegistry provider.
19
+ */
20
+ interface AFSRegistryOptions {
21
+ /** Static list of provider manifests (for testing / offline use) */
22
+ providers: ProviderManifest[];
23
+ }
24
+ /**
25
+ * AFS Registry Provider — virtual file tree for discovering and mounting providers.
26
+ *
27
+ * File tree:
28
+ * ```
29
+ * /
30
+ * ├── providers/{name}/manifest.json
31
+ * ├── providers/{name}/README.md
32
+ * ├── providers/{name}/.actions/mount
33
+ * ├── by-category/{category}/{name}/
34
+ * ├── by-tag/{tag}/{name}/
35
+ * └── .actions/search
36
+ * ```
37
+ */
38
+ declare class AFSRegistry extends AFSBaseProvider {
39
+ readonly name = "registry";
40
+ readonly description = "AFS Provider Registry \u2014 discover and mount providers";
41
+ readonly accessMode: "readwrite";
42
+ private providers;
43
+ private loadProviderFn?;
44
+ constructor(options: AFSRegistryOptions);
45
+ onMount(root: AFSRoot): void;
46
+ private get byCategory();
47
+ private get byTag();
48
+ private findProvider;
49
+ listRoot(_ctx: RouteContext): Promise<{
50
+ data: AFSEntry[];
51
+ }>;
52
+ listProviders(_ctx: RouteContext): Promise<{
53
+ data: AFSEntry[];
54
+ }>;
55
+ listProviderContents(ctx: RouteContext<{
56
+ name: string;
57
+ }>): Promise<{
58
+ data: AFSEntry[];
59
+ }>;
60
+ listCategories(_ctx: RouteContext): Promise<{
61
+ data: AFSEntry[];
62
+ }>;
63
+ listCategoryProviders(ctx: RouteContext<{
64
+ category: string;
65
+ }>): Promise<{
66
+ data: AFSEntry[];
67
+ }>;
68
+ listTags(_ctx: RouteContext): Promise<{
69
+ data: AFSEntry[];
70
+ }>;
71
+ listCategoryProviderChildren(ctx: RouteContext<{
72
+ category: string;
73
+ name: string;
74
+ }>): Promise<{
75
+ data: AFSEntry[];
76
+ }>;
77
+ listTagProviders(ctx: RouteContext<{
78
+ tag: string;
79
+ }>): Promise<{
80
+ data: AFSEntry[];
81
+ }>;
82
+ listTagProviderChildren(ctx: RouteContext<{
83
+ tag: string;
84
+ name: string;
85
+ }>): Promise<{
86
+ data: AFSEntry[];
87
+ }>;
88
+ listFileNode(ctx: RouteContext<{
89
+ name: string;
90
+ }>): Promise<{
91
+ data: AFSEntry[];
92
+ }>;
93
+ readRoot(_ctx: RouteContext): Promise<AFSEntry | undefined>;
94
+ readProviders(_ctx: RouteContext): Promise<AFSEntry | undefined>;
95
+ readProvider(ctx: RouteContext<{
96
+ name: string;
97
+ }>): Promise<AFSEntry | undefined>;
98
+ readManifest(ctx: RouteContext<{
99
+ name: string;
100
+ }>): Promise<AFSEntry | undefined>;
101
+ readReadme(ctx: RouteContext<{
102
+ name: string;
103
+ }>): Promise<AFSEntry | undefined>;
104
+ readByCategory(_ctx: RouteContext): Promise<AFSEntry | undefined>;
105
+ readCategory(ctx: RouteContext<{
106
+ category: string;
107
+ }>): Promise<AFSEntry | undefined>;
108
+ readCategoryProvider(ctx: RouteContext<{
109
+ category: string;
110
+ name: string;
111
+ }>): Promise<AFSEntry | undefined>;
112
+ readByTag(_ctx: RouteContext): Promise<AFSEntry | undefined>;
113
+ readTag(ctx: RouteContext<{
114
+ tag: string;
115
+ }>): Promise<AFSEntry | undefined>;
116
+ readTagProvider(ctx: RouteContext<{
117
+ tag: string;
118
+ name: string;
119
+ }>): Promise<AFSEntry | undefined>;
120
+ readCapabilities(_ctx: RouteContext): Promise<AFSEntry | undefined>;
121
+ rootMeta(_ctx: RouteContext): Promise<AFSEntry>;
122
+ providersMeta(_ctx: RouteContext): Promise<AFSEntry>;
123
+ providerMeta(ctx: RouteContext<{
124
+ name: string;
125
+ }>): Promise<AFSEntry>;
126
+ manifestMeta(ctx: RouteContext<{
127
+ name: string;
128
+ }>): Promise<AFSEntry>;
129
+ readmeMeta(ctx: RouteContext<{
130
+ name: string;
131
+ }>): Promise<AFSEntry>;
132
+ byCategoryMeta(_ctx: RouteContext): Promise<AFSEntry>;
133
+ categoryMeta(ctx: RouteContext<{
134
+ category: string;
135
+ }>): Promise<AFSEntry>;
136
+ categoryProviderMeta(ctx: RouteContext<{
137
+ category: string;
138
+ name: string;
139
+ }>): Promise<AFSEntry>;
140
+ byTagMeta(_ctx: RouteContext): Promise<AFSEntry>;
141
+ tagMeta(ctx: RouteContext<{
142
+ tag: string;
143
+ }>): Promise<AFSEntry>;
144
+ tagProviderMeta(ctx: RouteContext<{
145
+ tag: string;
146
+ name: string;
147
+ }>): Promise<AFSEntry>;
148
+ listRootActions(_ctx: RouteContext): Promise<{
149
+ data: AFSEntry[];
150
+ }>;
151
+ searchProviders(_ctx: RouteContext, args: Record<string, unknown>): Promise<AFSExecResult>;
152
+ listProviderActions(ctx: RouteContext<{
153
+ name: string;
154
+ }>): Promise<{
155
+ data: AFSEntry[];
156
+ }>;
157
+ mountProvider(ctx: RouteContext<{
158
+ name: string;
159
+ }>, args: Record<string, unknown>): Promise<AFSExecResult>;
160
+ searchRoot(_ctx: RouteContext, query: string, options?: {
161
+ limit?: number;
162
+ }): Promise<AFSSearchResult>;
163
+ explainPath(_ctx: RouteContext): Promise<AFSExplainResult>;
164
+ statPath(ctx: RouteContext): Promise<AFSStatResult>;
165
+ }
166
+ //#endregion
167
+ export { AFSRegistry, AFSRegistryOptions, ProviderManifest };
168
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;AAuBA;UAAiB,gBAAA;EACf,IAAA;EACA,WAAA;EACA,QAAA;EACA,MAAA;EACA,oBAAA;EACA,IAAA;EACA,SAAA;EACA,OAAA;AAAA;;;;UAMe,kBAAA;EAAkB;EAEjC,SAAA,EAAW,gBAAA;AAAA;;AAiBb;;;;;;;;;;;;;cAAa,WAAA,SAAoB,eAAA;EAAA,SACtB,IAAA;EAAA,SACA,WAAA;EAAA,SACA,UAAA;EAAA,QAED,SAAA;EAAA,QACA,cAAA;cAEI,OAAA,EAAS,kBAAA;EAMrB,OAAA,CAAQ,IAAA,EAAM,OAAA;EAAA,YAMF,UAAA,CAAA;EAAA,YAUA,KAAA,CAAA;EAAA,QAYJ,YAAA;EAOF,QAAA,CAAS,IAAA,EAAM,YAAA,GAAY,OAAA;UAkBxB,QAAA;EAAA;EAKH,aAAA,CAAc,IAAA,EAAM,YAAA,GAAY,OAAA;UAU3B,QAAA;EAAA;EAKL,oBAAA,CAAqB,GAAA,EAAK,YAAA;IAAe,IAAA;EAAA,KAAe,OAAA;UAgBrD,QAAA;EAAA;EAKH,cAAA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c,IAAA,EAAM,MAAA,oBAA0B,OAAA,CAAQ,aAAA;EAY5E,mBAAA,CAAoB,GAAA,EAAK,YAAA;IAAe,IAAA;EAAA,KAAe,OAAA;UA8BpD,QAAA;EAAA;EAKH,aAAA,CACJ,GAAA,EAAK,YAAA;IAAe,IAAA;EAAA,IACpB,IAAA,EAAM,MAAA,oBACL,OAAA,CAAQ,aAAA;EA0BL,UAAA,CACJ,IAAA,EAAM,YAAA,EACN,KAAA,UACA,OAAA;IAAY,KAAA;EAAA,IACX,OAAA,CAAQ,eAAA;EA0BL,WAAA,CAAY,IAAA,EAAM,YAAA,GAAe,OAAA,CAAQ,gBAAA;EAkCzC,QAAA,CAAS,GAAA,EAAK,YAAA,GAAe,OAAA,CAAQ,aAAA;AAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,660 @@
1
+ import { AFSBaseProvider, AFSNotFoundError, Actions, Explain, List, Meta, Read, Search, Stat } from "@aigne/afs";
2
+ import { joinURL } from "ufo";
3
+
4
+ //#region \0@oxc-project+runtime@0.108.0/helpers/decorate.js
5
+ function __decorate(decorators, target, key, desc) {
6
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
7
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
8
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
9
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
10
+ }
11
+
12
+ //#endregion
13
+ //#region src/index.ts
14
+ /**
15
+ * AFS Registry Provider — virtual file tree for discovering and mounting providers.
16
+ *
17
+ * File tree:
18
+ * ```
19
+ * /
20
+ * ├── providers/{name}/manifest.json
21
+ * ├── providers/{name}/README.md
22
+ * ├── providers/{name}/.actions/mount
23
+ * ├── by-category/{category}/{name}/
24
+ * ├── by-tag/{tag}/{name}/
25
+ * └── .actions/search
26
+ * ```
27
+ */
28
+ var AFSRegistry = class extends AFSBaseProvider {
29
+ name = "registry";
30
+ description = "AFS Provider Registry — discover and mount providers";
31
+ accessMode = "readwrite";
32
+ providers;
33
+ loadProviderFn;
34
+ constructor(options) {
35
+ super();
36
+ this.providers = JSON.parse(JSON.stringify(options.providers));
37
+ }
38
+ onMount(root) {
39
+ this.loadProviderFn = root.loadProvider;
40
+ }
41
+ get byCategory() {
42
+ const map = /* @__PURE__ */ new Map();
43
+ for (const p of this.providers) {
44
+ const list = map.get(p.category) || [];
45
+ list.push(p);
46
+ map.set(p.category, list);
47
+ }
48
+ return map;
49
+ }
50
+ get byTag() {
51
+ const map = /* @__PURE__ */ new Map();
52
+ for (const p of this.providers) for (const tag of p.tags || []) {
53
+ const list = map.get(tag) || [];
54
+ list.push(p);
55
+ map.set(tag, list);
56
+ }
57
+ return map;
58
+ }
59
+ findProvider(name) {
60
+ return this.providers.find((p) => p.name === name);
61
+ }
62
+ async listRoot(_ctx) {
63
+ return { data: [
64
+ {
65
+ id: "providers",
66
+ path: "/providers",
67
+ meta: {
68
+ kind: "afs:directory",
69
+ childrenCount: this.providers.length
70
+ }
71
+ },
72
+ {
73
+ id: "by-category",
74
+ path: "/by-category",
75
+ meta: {
76
+ kind: "afs:directory",
77
+ childrenCount: this.byCategory.size
78
+ }
79
+ },
80
+ {
81
+ id: "by-tag",
82
+ path: "/by-tag",
83
+ meta: {
84
+ kind: "afs:directory",
85
+ childrenCount: this.byTag.size
86
+ }
87
+ }
88
+ ] };
89
+ }
90
+ async listProviders(_ctx) {
91
+ return { data: this.providers.map((p) => ({
92
+ id: p.name,
93
+ path: joinURL("/providers", p.name),
94
+ summary: p.description,
95
+ meta: {
96
+ kind: "registry:provider",
97
+ childrenCount: 3
98
+ }
99
+ })) };
100
+ }
101
+ async listProviderContents(ctx) {
102
+ const provider = this.findProvider(ctx.params.name);
103
+ if (!provider) throw new AFSNotFoundError(ctx.path);
104
+ const base = joinURL("/providers", provider.name);
105
+ return { data: [{
106
+ id: "manifest.json",
107
+ path: joinURL(base, "manifest.json"),
108
+ meta: { kind: "afs:file" }
109
+ }, {
110
+ id: "README.md",
111
+ path: joinURL(base, "README.md"),
112
+ meta: { kind: "afs:file" }
113
+ }] };
114
+ }
115
+ async listCategories(_ctx) {
116
+ return { data: Array.from(this.byCategory.entries()).map(([cat, providers]) => ({
117
+ id: cat,
118
+ path: joinURL("/by-category", cat),
119
+ meta: {
120
+ kind: "afs:directory",
121
+ childrenCount: providers.length
122
+ }
123
+ })) };
124
+ }
125
+ async listCategoryProviders(ctx) {
126
+ const providers = this.byCategory.get(ctx.params.category);
127
+ if (!providers) throw new AFSNotFoundError(ctx.path);
128
+ return { data: providers.map((p) => ({
129
+ id: p.name,
130
+ path: joinURL("/by-category", ctx.params.category, p.name),
131
+ summary: p.description,
132
+ meta: {
133
+ kind: "registry:provider",
134
+ childrenCount: 2
135
+ }
136
+ })) };
137
+ }
138
+ async listTags(_ctx) {
139
+ return { data: Array.from(this.byTag.entries()).map(([tag, providers]) => ({
140
+ id: tag,
141
+ path: joinURL("/by-tag", tag),
142
+ meta: {
143
+ kind: "afs:directory",
144
+ childrenCount: providers.length
145
+ }
146
+ })) };
147
+ }
148
+ async listCategoryProviderChildren(ctx) {
149
+ if (!this.byCategory.get(ctx.params.category)?.find((p) => p.name === ctx.params.name)) throw new AFSNotFoundError(ctx.path);
150
+ return { data: [] };
151
+ }
152
+ async listTagProviders(ctx) {
153
+ const providers = this.byTag.get(ctx.params.tag);
154
+ if (!providers) throw new AFSNotFoundError(ctx.path);
155
+ return { data: providers.map((p) => ({
156
+ id: p.name,
157
+ path: joinURL("/by-tag", ctx.params.tag, p.name),
158
+ summary: p.description,
159
+ meta: { kind: "registry:provider" }
160
+ })) };
161
+ }
162
+ async listTagProviderChildren(ctx) {
163
+ if (!this.byTag.get(ctx.params.tag)?.find((p) => p.name === ctx.params.name)) throw new AFSNotFoundError(ctx.path);
164
+ return { data: [] };
165
+ }
166
+ async listFileNode(ctx) {
167
+ if (!this.findProvider(ctx.params.name)) throw new AFSNotFoundError(ctx.path);
168
+ return { data: [] };
169
+ }
170
+ async readRoot(_ctx) {
171
+ return {
172
+ id: "/",
173
+ path: "/",
174
+ content: {
175
+ type: "registry",
176
+ providerCount: this.providers.length
177
+ },
178
+ meta: {
179
+ kind: "registry:root",
180
+ childrenCount: 3
181
+ }
182
+ };
183
+ }
184
+ async readProviders(_ctx) {
185
+ return {
186
+ id: "providers",
187
+ path: "/providers",
188
+ content: {
189
+ type: "directory",
190
+ count: this.providers.length
191
+ },
192
+ meta: {
193
+ kind: "afs:directory",
194
+ childrenCount: this.providers.length
195
+ }
196
+ };
197
+ }
198
+ async readProvider(ctx) {
199
+ const provider = this.findProvider(ctx.params.name);
200
+ if (!provider) throw new AFSNotFoundError(ctx.path);
201
+ return {
202
+ id: provider.name,
203
+ path: joinURL("/providers", provider.name),
204
+ content: {
205
+ type: "provider",
206
+ name: provider.name,
207
+ description: provider.description
208
+ },
209
+ meta: {
210
+ kind: "registry:provider",
211
+ childrenCount: 2
212
+ }
213
+ };
214
+ }
215
+ async readManifest(ctx) {
216
+ const provider = this.findProvider(ctx.params.name);
217
+ if (!provider) throw new AFSNotFoundError(ctx.path);
218
+ return {
219
+ id: "manifest.json",
220
+ path: ctx.path,
221
+ content: { ...provider },
222
+ meta: { kind: "afs:file" }
223
+ };
224
+ }
225
+ async readReadme(ctx) {
226
+ const provider = this.findProvider(ctx.params.name);
227
+ if (!provider) throw new AFSNotFoundError(ctx.path);
228
+ const lines = [
229
+ `# ${provider.name}`,
230
+ "",
231
+ provider.description,
232
+ "",
233
+ `**Category:** ${provider.category}`,
234
+ `**Scheme:** \`${provider.scheme}://\``,
235
+ "",
236
+ `## Capabilities`,
237
+ "",
238
+ provider.capabilities_summary
239
+ ];
240
+ if (provider.tags?.length) lines.push("", `**Tags:** ${provider.tags.join(", ")}`);
241
+ if (provider.use_cases?.length) lines.push("", `## Use Cases`, "", ...provider.use_cases.map((u) => `- ${u}`));
242
+ lines.push("");
243
+ return {
244
+ id: "README.md",
245
+ path: ctx.path,
246
+ content: lines.join("\n"),
247
+ meta: { kind: "afs:file" }
248
+ };
249
+ }
250
+ async readByCategory(_ctx) {
251
+ return {
252
+ id: "by-category",
253
+ path: "/by-category",
254
+ content: {
255
+ type: "directory",
256
+ count: this.byCategory.size
257
+ },
258
+ meta: {
259
+ kind: "afs:directory",
260
+ childrenCount: this.byCategory.size
261
+ }
262
+ };
263
+ }
264
+ async readCategory(ctx) {
265
+ const providers = this.byCategory.get(ctx.params.category);
266
+ if (!providers) throw new AFSNotFoundError(ctx.path);
267
+ return {
268
+ id: ctx.params.category,
269
+ path: joinURL("/by-category", ctx.params.category),
270
+ content: {
271
+ type: "category",
272
+ count: providers.length
273
+ },
274
+ meta: {
275
+ kind: "afs:directory",
276
+ childrenCount: providers.length
277
+ }
278
+ };
279
+ }
280
+ async readCategoryProvider(ctx) {
281
+ const provider = this.byCategory.get(ctx.params.category)?.find((p) => p.name === ctx.params.name);
282
+ if (!provider) throw new AFSNotFoundError(ctx.path);
283
+ return {
284
+ id: provider.name,
285
+ path: ctx.path,
286
+ content: {
287
+ type: "provider",
288
+ name: provider.name,
289
+ description: provider.description
290
+ },
291
+ meta: { kind: "registry:provider" }
292
+ };
293
+ }
294
+ async readByTag(_ctx) {
295
+ return {
296
+ id: "by-tag",
297
+ path: "/by-tag",
298
+ content: {
299
+ type: "directory",
300
+ count: this.byTag.size
301
+ },
302
+ meta: {
303
+ kind: "afs:directory",
304
+ childrenCount: this.byTag.size
305
+ }
306
+ };
307
+ }
308
+ async readTag(ctx) {
309
+ const providers = this.byTag.get(ctx.params.tag);
310
+ if (!providers) throw new AFSNotFoundError(ctx.path);
311
+ return {
312
+ id: ctx.params.tag,
313
+ path: joinURL("/by-tag", ctx.params.tag),
314
+ content: {
315
+ type: "tag",
316
+ count: providers.length
317
+ },
318
+ meta: {
319
+ kind: "afs:directory",
320
+ childrenCount: providers.length
321
+ }
322
+ };
323
+ }
324
+ async readTagProvider(ctx) {
325
+ const provider = this.byTag.get(ctx.params.tag)?.find((p) => p.name === ctx.params.name);
326
+ if (!provider) throw new AFSNotFoundError(ctx.path);
327
+ return {
328
+ id: provider.name,
329
+ path: ctx.path,
330
+ content: {
331
+ type: "provider",
332
+ name: provider.name,
333
+ description: provider.description
334
+ },
335
+ meta: { kind: "registry:provider" }
336
+ };
337
+ }
338
+ async readCapabilities(_ctx) {
339
+ return {
340
+ id: "/.meta/.capabilities",
341
+ path: "/.meta/.capabilities",
342
+ content: { operations: {
343
+ list: true,
344
+ read: true,
345
+ write: false,
346
+ delete: false,
347
+ exec: true,
348
+ stat: true,
349
+ explain: true,
350
+ search: true
351
+ } },
352
+ meta: { kind: "afs:capabilities" }
353
+ };
354
+ }
355
+ async rootMeta(_ctx) {
356
+ return {
357
+ id: ".meta",
358
+ path: "/.meta",
359
+ content: {
360
+ providerCount: this.providers.length,
361
+ categories: Array.from(this.byCategory.keys()),
362
+ tags: Array.from(this.byTag.keys())
363
+ },
364
+ meta: {
365
+ kind: "registry:root",
366
+ childrenCount: 3
367
+ }
368
+ };
369
+ }
370
+ async providersMeta(_ctx) {
371
+ return {
372
+ id: ".meta",
373
+ path: "/providers/.meta",
374
+ content: { count: this.providers.length },
375
+ meta: {
376
+ kind: "afs:directory",
377
+ childrenCount: this.providers.length
378
+ }
379
+ };
380
+ }
381
+ async providerMeta(ctx) {
382
+ const provider = this.findProvider(ctx.params.name);
383
+ if (!provider) throw new AFSNotFoundError(ctx.path);
384
+ return {
385
+ id: ".meta",
386
+ path: joinURL("/providers", provider.name, ".meta"),
387
+ content: {
388
+ name: provider.name,
389
+ category: provider.category,
390
+ scheme: provider.scheme
391
+ },
392
+ meta: {
393
+ kind: "registry:provider",
394
+ childrenCount: 2
395
+ }
396
+ };
397
+ }
398
+ async manifestMeta(ctx) {
399
+ const provider = this.findProvider(ctx.params.name);
400
+ if (!provider) throw new AFSNotFoundError(ctx.path);
401
+ return {
402
+ id: ".meta",
403
+ path: joinURL("/providers", provider.name, "manifest.json", ".meta"),
404
+ content: { format: "json" },
405
+ meta: { kind: "afs:file" }
406
+ };
407
+ }
408
+ async readmeMeta(ctx) {
409
+ const provider = this.findProvider(ctx.params.name);
410
+ if (!provider) throw new AFSNotFoundError(ctx.path);
411
+ return {
412
+ id: ".meta",
413
+ path: joinURL("/providers", provider.name, "README.md", ".meta"),
414
+ content: { format: "markdown" },
415
+ meta: { kind: "afs:file" }
416
+ };
417
+ }
418
+ async byCategoryMeta(_ctx) {
419
+ return {
420
+ id: ".meta",
421
+ path: "/by-category/.meta",
422
+ content: { count: this.byCategory.size },
423
+ meta: {
424
+ kind: "afs:directory",
425
+ childrenCount: this.byCategory.size
426
+ }
427
+ };
428
+ }
429
+ async categoryMeta(ctx) {
430
+ const providers = this.byCategory.get(ctx.params.category);
431
+ if (!providers) throw new AFSNotFoundError(ctx.path);
432
+ return {
433
+ id: ".meta",
434
+ path: joinURL("/by-category", ctx.params.category, ".meta"),
435
+ content: {
436
+ category: ctx.params.category,
437
+ count: providers.length
438
+ },
439
+ meta: {
440
+ kind: "afs:directory",
441
+ childrenCount: providers.length
442
+ }
443
+ };
444
+ }
445
+ async categoryProviderMeta(ctx) {
446
+ const provider = this.byCategory.get(ctx.params.category)?.find((p) => p.name === ctx.params.name);
447
+ if (!provider) throw new AFSNotFoundError(ctx.path);
448
+ return {
449
+ id: ".meta",
450
+ path: joinURL("/by-category", ctx.params.category, provider.name, ".meta"),
451
+ content: { name: provider.name },
452
+ meta: { kind: "registry:provider" }
453
+ };
454
+ }
455
+ async byTagMeta(_ctx) {
456
+ return {
457
+ id: ".meta",
458
+ path: "/by-tag/.meta",
459
+ content: { count: this.byTag.size },
460
+ meta: {
461
+ kind: "afs:directory",
462
+ childrenCount: this.byTag.size
463
+ }
464
+ };
465
+ }
466
+ async tagMeta(ctx) {
467
+ const providers = this.byTag.get(ctx.params.tag);
468
+ if (!providers) throw new AFSNotFoundError(ctx.path);
469
+ return {
470
+ id: ".meta",
471
+ path: joinURL("/by-tag", ctx.params.tag, ".meta"),
472
+ content: {
473
+ tag: ctx.params.tag,
474
+ count: providers.length
475
+ },
476
+ meta: {
477
+ kind: "afs:directory",
478
+ childrenCount: providers.length
479
+ }
480
+ };
481
+ }
482
+ async tagProviderMeta(ctx) {
483
+ const provider = this.byTag.get(ctx.params.tag)?.find((p) => p.name === ctx.params.name);
484
+ if (!provider) throw new AFSNotFoundError(ctx.path);
485
+ return {
486
+ id: ".meta",
487
+ path: joinURL("/by-tag", ctx.params.tag, provider.name, ".meta"),
488
+ content: { name: provider.name },
489
+ meta: { kind: "registry:provider" }
490
+ };
491
+ }
492
+ async listRootActions(_ctx) {
493
+ return { data: [{
494
+ id: "search",
495
+ path: "/.actions/search",
496
+ meta: {
497
+ kind: "afs:executable",
498
+ kinds: ["afs:executable", "afs:node"]
499
+ },
500
+ actions: [{
501
+ name: "search",
502
+ description: "Search for providers matching a query",
503
+ inputSchema: {
504
+ type: "object",
505
+ properties: { query: {
506
+ type: "string",
507
+ description: "Search query"
508
+ } }
509
+ }
510
+ }]
511
+ }] };
512
+ }
513
+ async searchProviders(_ctx, args) {
514
+ return {
515
+ success: true,
516
+ data: {
517
+ query: args.query || "",
518
+ providers: this.providers.map((p) => ({ ...p }))
519
+ }
520
+ };
521
+ }
522
+ async listProviderActions(ctx) {
523
+ const provider = this.findProvider(ctx.params.name);
524
+ if (!provider) throw new AFSNotFoundError(ctx.path);
525
+ return { data: [{
526
+ id: "mount",
527
+ path: joinURL("/providers", provider.name, ".actions", "mount"),
528
+ meta: {
529
+ kind: "afs:executable",
530
+ kinds: ["afs:executable", "afs:node"]
531
+ },
532
+ actions: [{
533
+ name: "mount",
534
+ description: `Mount the ${provider.name} provider`,
535
+ inputSchema: {
536
+ type: "object",
537
+ properties: {
538
+ path: {
539
+ type: "string",
540
+ description: "Mount path"
541
+ },
542
+ uri: {
543
+ type: "string",
544
+ description: `Provider URI (default: ${provider.scheme}:///)`
545
+ }
546
+ },
547
+ required: ["path"]
548
+ }
549
+ }]
550
+ }] };
551
+ }
552
+ async mountProvider(ctx, args) {
553
+ const provider = this.findProvider(ctx.params.name);
554
+ if (!provider) throw new AFSNotFoundError(ctx.path);
555
+ if (!this.loadProviderFn) throw new Error("loadProvider not configured — Registry was not mounted on an AFS instance");
556
+ const mountPath = args.path;
557
+ const uri = args.uri || `${provider.scheme}:///`;
558
+ await this.loadProviderFn(uri, mountPath);
559
+ return {
560
+ success: true,
561
+ data: {
562
+ provider: provider.name,
563
+ uri,
564
+ path: mountPath
565
+ }
566
+ };
567
+ }
568
+ async searchRoot(_ctx, query, options) {
569
+ const q = query.toLowerCase();
570
+ let matched = this.providers.filter((p) => p.name.toLowerCase().includes(q) || p.description.toLowerCase().includes(q) || p.category.toLowerCase().includes(q) || (p.tags || []).some((t) => t.toLowerCase().includes(q)) || p.capabilities_summary.toLowerCase().includes(q));
571
+ if (options?.limit !== void 0 && matched.length > options.limit) matched = matched.slice(0, options.limit);
572
+ return { data: matched.map((p) => ({
573
+ id: p.name,
574
+ path: joinURL("/providers", p.name),
575
+ summary: p.description,
576
+ meta: { kind: "registry:provider" }
577
+ })) };
578
+ }
579
+ async explainPath(_ctx) {
580
+ return {
581
+ format: "markdown",
582
+ content: [
583
+ "# AFS Provider Registry",
584
+ "",
585
+ "This provider exposes a virtual file tree of available AFS providers.",
586
+ "",
587
+ "## Structure",
588
+ "- `/providers/{name}/manifest.json` — Provider metadata",
589
+ "- `/providers/{name}/README.md` — Human-readable description",
590
+ "- `/providers/{name}/.actions/mount` — Mount action",
591
+ "- `/by-category/{category}/` — Browse by category",
592
+ "- `/by-tag/{tag}/` — Browse by tag",
593
+ "- `/.actions/search` — Full-text search across providers",
594
+ "",
595
+ `**Total providers:** ${this.providers.length}`
596
+ ].join("\n")
597
+ };
598
+ }
599
+ async statPath(ctx) {
600
+ const readResult = await this.read(ctx.path);
601
+ if (readResult.data) return { data: readResult.data };
602
+ throw new AFSNotFoundError(ctx.path);
603
+ }
604
+ };
605
+ __decorate([List("/")], AFSRegistry.prototype, "listRoot", null);
606
+ __decorate([List("/providers")], AFSRegistry.prototype, "listProviders", null);
607
+ __decorate([List("/providers/:name")], AFSRegistry.prototype, "listProviderContents", null);
608
+ __decorate([List("/by-category")], AFSRegistry.prototype, "listCategories", null);
609
+ __decorate([List("/by-category/:category")], AFSRegistry.prototype, "listCategoryProviders", null);
610
+ __decorate([List("/by-tag")], AFSRegistry.prototype, "listTags", null);
611
+ __decorate([List("/by-category/:category/:name")], AFSRegistry.prototype, "listCategoryProviderChildren", null);
612
+ __decorate([List("/by-tag/:tag")], AFSRegistry.prototype, "listTagProviders", null);
613
+ __decorate([List("/by-tag/:tag/:name")], AFSRegistry.prototype, "listTagProviderChildren", null);
614
+ __decorate([List("/providers/:name/manifest.json"), List("/providers/:name/README.md")], AFSRegistry.prototype, "listFileNode", null);
615
+ __decorate([Read("/")], AFSRegistry.prototype, "readRoot", null);
616
+ __decorate([Read("/providers")], AFSRegistry.prototype, "readProviders", null);
617
+ __decorate([Read("/providers/:name")], AFSRegistry.prototype, "readProvider", null);
618
+ __decorate([Read("/providers/:name/manifest.json")], AFSRegistry.prototype, "readManifest", null);
619
+ __decorate([Read("/providers/:name/README.md")], AFSRegistry.prototype, "readReadme", null);
620
+ __decorate([Read("/by-category")], AFSRegistry.prototype, "readByCategory", null);
621
+ __decorate([Read("/by-category/:category")], AFSRegistry.prototype, "readCategory", null);
622
+ __decorate([Read("/by-category/:category/:name")], AFSRegistry.prototype, "readCategoryProvider", null);
623
+ __decorate([Read("/by-tag")], AFSRegistry.prototype, "readByTag", null);
624
+ __decorate([Read("/by-tag/:tag")], AFSRegistry.prototype, "readTag", null);
625
+ __decorate([Read("/by-tag/:tag/:name")], AFSRegistry.prototype, "readTagProvider", null);
626
+ __decorate([Read("/.meta/.capabilities")], AFSRegistry.prototype, "readCapabilities", null);
627
+ __decorate([Meta("/")], AFSRegistry.prototype, "rootMeta", null);
628
+ __decorate([Meta("/providers")], AFSRegistry.prototype, "providersMeta", null);
629
+ __decorate([Meta("/providers/:name")], AFSRegistry.prototype, "providerMeta", null);
630
+ __decorate([Meta("/providers/:name/manifest.json")], AFSRegistry.prototype, "manifestMeta", null);
631
+ __decorate([Meta("/providers/:name/README.md")], AFSRegistry.prototype, "readmeMeta", null);
632
+ __decorate([Meta("/by-category")], AFSRegistry.prototype, "byCategoryMeta", null);
633
+ __decorate([Meta("/by-category/:category")], AFSRegistry.prototype, "categoryMeta", null);
634
+ __decorate([Meta("/by-category/:category/:name")], AFSRegistry.prototype, "categoryProviderMeta", null);
635
+ __decorate([Meta("/by-tag")], AFSRegistry.prototype, "byTagMeta", null);
636
+ __decorate([Meta("/by-tag/:tag")], AFSRegistry.prototype, "tagMeta", null);
637
+ __decorate([Meta("/by-tag/:tag/:name")], AFSRegistry.prototype, "tagProviderMeta", null);
638
+ __decorate([Actions("/")], AFSRegistry.prototype, "listRootActions", null);
639
+ __decorate([Actions.Exec("/", "search")], AFSRegistry.prototype, "searchProviders", null);
640
+ __decorate([Actions("/providers/:name")], AFSRegistry.prototype, "listProviderActions", null);
641
+ __decorate([Actions.Exec("/providers/:name", "mount")], AFSRegistry.prototype, "mountProvider", null);
642
+ __decorate([Search("/")], AFSRegistry.prototype, "searchRoot", null);
643
+ __decorate([Explain("/:path*")], AFSRegistry.prototype, "explainPath", null);
644
+ __decorate([
645
+ Stat("/"),
646
+ Stat("/providers"),
647
+ Stat("/providers/:name"),
648
+ Stat("/providers/:name/manifest.json"),
649
+ Stat("/providers/:name/README.md"),
650
+ Stat("/by-category"),
651
+ Stat("/by-category/:category"),
652
+ Stat("/by-category/:category/:name"),
653
+ Stat("/by-tag"),
654
+ Stat("/by-tag/:tag"),
655
+ Stat("/by-tag/:tag/:name")
656
+ ], AFSRegistry.prototype, "statPath", null);
657
+
658
+ //#endregion
659
+ export { AFSRegistry };
660
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n Actions,\n AFSBaseProvider,\n type AFSEntry,\n type AFSExecResult,\n type AFSExplainResult,\n AFSNotFoundError,\n type AFSRoot,\n type AFSSearchResult,\n type AFSStatResult,\n Explain,\n List,\n Meta,\n Read,\n type RouteContext,\n Search,\n Stat,\n} from \"@aigne/afs\";\nimport { joinURL } from \"ufo\";\n\n/**\n * A single provider manifest entry in the registry.\n */\nexport interface ProviderManifest {\n name: string;\n description: string;\n category: string;\n scheme: string;\n capabilities_summary: string;\n tags?: string[];\n use_cases?: string[];\n package?: string;\n}\n\n/**\n * Options for constructing an AFSRegistry provider.\n */\nexport interface AFSRegistryOptions {\n /** Static list of provider manifests (for testing / offline use) */\n providers: ProviderManifest[];\n}\n\n/**\n * AFS Registry Provider — virtual file tree for discovering and mounting providers.\n *\n * File tree:\n * ```\n * /\n * ├── providers/{name}/manifest.json\n * ├── providers/{name}/README.md\n * ├── providers/{name}/.actions/mount\n * ├── by-category/{category}/{name}/\n * ├── by-tag/{tag}/{name}/\n * └── .actions/search\n * ```\n */\nexport class AFSRegistry extends AFSBaseProvider {\n readonly name = \"registry\";\n readonly description = \"AFS Provider Registry — discover and mount providers\";\n readonly accessMode = \"readwrite\" as const;\n\n private providers: ProviderManifest[];\n private loadProviderFn?: (uri: string, path: string) => Promise<void>;\n\n constructor(options: AFSRegistryOptions) {\n super();\n // Deep-copy to prevent prototype pollution\n this.providers = JSON.parse(JSON.stringify(options.providers));\n }\n\n onMount(root: AFSRoot): void {\n this.loadProviderFn = (root as any).loadProvider;\n }\n\n // ── Indexes ──\n\n private get byCategory(): Map<string, ProviderManifest[]> {\n const map = new Map<string, ProviderManifest[]>();\n for (const p of this.providers) {\n const list = map.get(p.category) || [];\n list.push(p);\n map.set(p.category, list);\n }\n return map;\n }\n\n private get byTag(): Map<string, ProviderManifest[]> {\n const map = new Map<string, ProviderManifest[]>();\n for (const p of this.providers) {\n for (const tag of p.tags || []) {\n const list = map.get(tag) || [];\n list.push(p);\n map.set(tag, list);\n }\n }\n return map;\n }\n\n private findProvider(name: string): ProviderManifest | undefined {\n return this.providers.find((p) => p.name === name);\n }\n\n // ── List Routes ──\n\n @List(\"/\")\n async listRoot(_ctx: RouteContext) {\n return {\n data: [\n {\n id: \"providers\",\n path: \"/providers\",\n meta: { kind: \"afs:directory\", childrenCount: this.providers.length },\n },\n {\n id: \"by-category\",\n path: \"/by-category\",\n meta: { kind: \"afs:directory\", childrenCount: this.byCategory.size },\n },\n {\n id: \"by-tag\",\n path: \"/by-tag\",\n meta: { kind: \"afs:directory\", childrenCount: this.byTag.size },\n },\n ] as AFSEntry[],\n };\n }\n\n @List(\"/providers\")\n async listProviders(_ctx: RouteContext) {\n return {\n data: this.providers.map((p) => ({\n id: p.name,\n path: joinURL(\"/providers\", p.name),\n summary: p.description,\n meta: {\n kind: \"registry:provider\",\n childrenCount: 3, // manifest.json, README.md, .actions\n },\n })) as AFSEntry[],\n };\n }\n\n @List(\"/providers/:name\")\n async listProviderContents(ctx: RouteContext<{ name: string }>) {\n const provider = this.findProvider(ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n const base = joinURL(\"/providers\", provider.name);\n return {\n data: [\n {\n id: \"manifest.json\",\n path: joinURL(base, \"manifest.json\"),\n meta: { kind: \"afs:file\" },\n },\n {\n id: \"README.md\",\n path: joinURL(base, \"README.md\"),\n meta: { kind: \"afs:file\" },\n },\n ] as AFSEntry[],\n };\n }\n\n @List(\"/by-category\")\n async listCategories(_ctx: RouteContext) {\n return {\n data: Array.from(this.byCategory.entries()).map(([cat, providers]) => ({\n id: cat,\n path: joinURL(\"/by-category\", cat),\n meta: { kind: \"afs:directory\", childrenCount: providers.length },\n })) as AFSEntry[],\n };\n }\n\n @List(\"/by-category/:category\")\n async listCategoryProviders(ctx: RouteContext<{ category: string }>) {\n const providers = this.byCategory.get(ctx.params.category);\n if (!providers) throw new AFSNotFoundError(ctx.path);\n return {\n data: providers.map((p) => ({\n id: p.name,\n path: joinURL(\"/by-category\", ctx.params.category, p.name),\n summary: p.description,\n meta: { kind: \"registry:provider\", childrenCount: 2 },\n })) as AFSEntry[],\n };\n }\n\n @List(\"/by-tag\")\n async listTags(_ctx: RouteContext) {\n return {\n data: Array.from(this.byTag.entries()).map(([tag, providers]) => ({\n id: tag,\n path: joinURL(\"/by-tag\", tag),\n meta: { kind: \"afs:directory\", childrenCount: providers.length },\n })) as AFSEntry[],\n };\n }\n\n @List(\"/by-category/:category/:name\")\n async listCategoryProviderChildren(ctx: RouteContext<{ category: string; name: string }>) {\n const providers = this.byCategory.get(ctx.params.category);\n const provider = providers?.find((p) => p.name === ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return { data: [] as AFSEntry[] };\n }\n\n @List(\"/by-tag/:tag\")\n async listTagProviders(ctx: RouteContext<{ tag: string }>) {\n const providers = this.byTag.get(ctx.params.tag);\n if (!providers) throw new AFSNotFoundError(ctx.path);\n return {\n data: providers.map((p) => ({\n id: p.name,\n path: joinURL(\"/by-tag\", ctx.params.tag, p.name),\n summary: p.description,\n meta: { kind: \"registry:provider\" },\n })) as AFSEntry[],\n };\n }\n\n @List(\"/by-tag/:tag/:name\")\n async listTagProviderChildren(ctx: RouteContext<{ tag: string; name: string }>) {\n const providers = this.byTag.get(ctx.params.tag);\n const provider = providers?.find((p) => p.name === ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return { data: [] as AFSEntry[] };\n }\n\n @List(\"/providers/:name/manifest.json\")\n @List(\"/providers/:name/README.md\")\n async listFileNode(ctx: RouteContext<{ name: string }>) {\n const provider = this.findProvider(ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return { data: [] as AFSEntry[] };\n }\n\n // ── Read Routes ──\n\n @Read(\"/\")\n async readRoot(_ctx: RouteContext): Promise<AFSEntry | undefined> {\n return {\n id: \"/\",\n path: \"/\",\n content: { type: \"registry\", providerCount: this.providers.length },\n meta: { kind: \"registry:root\", childrenCount: 3 },\n };\n }\n\n @Read(\"/providers\")\n async readProviders(_ctx: RouteContext): Promise<AFSEntry | undefined> {\n return {\n id: \"providers\",\n path: \"/providers\",\n content: { type: \"directory\", count: this.providers.length },\n meta: { kind: \"afs:directory\", childrenCount: this.providers.length },\n };\n }\n\n @Read(\"/providers/:name\")\n async readProvider(ctx: RouteContext<{ name: string }>): Promise<AFSEntry | undefined> {\n const provider = this.findProvider(ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return {\n id: provider.name,\n path: joinURL(\"/providers\", provider.name),\n content: { type: \"provider\", name: provider.name, description: provider.description },\n meta: { kind: \"registry:provider\", childrenCount: 2 },\n };\n }\n\n @Read(\"/providers/:name/manifest.json\")\n async readManifest(ctx: RouteContext<{ name: string }>): Promise<AFSEntry | undefined> {\n const provider = this.findProvider(ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return {\n id: \"manifest.json\",\n path: ctx.path,\n content: { ...provider },\n meta: { kind: \"afs:file\" },\n };\n }\n\n @Read(\"/providers/:name/README.md\")\n async readReadme(ctx: RouteContext<{ name: string }>): Promise<AFSEntry | undefined> {\n const provider = this.findProvider(ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n\n const lines = [\n `# ${provider.name}`,\n \"\",\n provider.description,\n \"\",\n `**Category:** ${provider.category}`,\n `**Scheme:** \\`${provider.scheme}://\\``,\n \"\",\n `## Capabilities`,\n \"\",\n provider.capabilities_summary,\n ];\n\n if (provider.tags?.length) {\n lines.push(\"\", `**Tags:** ${provider.tags.join(\", \")}`);\n }\n if (provider.use_cases?.length) {\n lines.push(\"\", `## Use Cases`, \"\", ...provider.use_cases.map((u) => `- ${u}`));\n }\n lines.push(\"\");\n\n return {\n id: \"README.md\",\n path: ctx.path,\n content: lines.join(\"\\n\"),\n meta: { kind: \"afs:file\" },\n };\n }\n\n @Read(\"/by-category\")\n async readByCategory(_ctx: RouteContext): Promise<AFSEntry | undefined> {\n return {\n id: \"by-category\",\n path: \"/by-category\",\n content: { type: \"directory\", count: this.byCategory.size },\n meta: { kind: \"afs:directory\", childrenCount: this.byCategory.size },\n };\n }\n\n @Read(\"/by-category/:category\")\n async readCategory(ctx: RouteContext<{ category: string }>): Promise<AFSEntry | undefined> {\n const providers = this.byCategory.get(ctx.params.category);\n if (!providers) throw new AFSNotFoundError(ctx.path);\n return {\n id: ctx.params.category,\n path: joinURL(\"/by-category\", ctx.params.category),\n content: { type: \"category\", count: providers.length },\n meta: { kind: \"afs:directory\", childrenCount: providers.length },\n };\n }\n\n @Read(\"/by-category/:category/:name\")\n async readCategoryProvider(\n ctx: RouteContext<{ category: string; name: string }>,\n ): Promise<AFSEntry | undefined> {\n const providers = this.byCategory.get(ctx.params.category);\n const provider = providers?.find((p) => p.name === ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return {\n id: provider.name,\n path: ctx.path,\n content: { type: \"provider\", name: provider.name, description: provider.description },\n meta: { kind: \"registry:provider\" },\n };\n }\n\n @Read(\"/by-tag\")\n async readByTag(_ctx: RouteContext): Promise<AFSEntry | undefined> {\n return {\n id: \"by-tag\",\n path: \"/by-tag\",\n content: { type: \"directory\", count: this.byTag.size },\n meta: { kind: \"afs:directory\", childrenCount: this.byTag.size },\n };\n }\n\n @Read(\"/by-tag/:tag\")\n async readTag(ctx: RouteContext<{ tag: string }>): Promise<AFSEntry | undefined> {\n const providers = this.byTag.get(ctx.params.tag);\n if (!providers) throw new AFSNotFoundError(ctx.path);\n return {\n id: ctx.params.tag,\n path: joinURL(\"/by-tag\", ctx.params.tag),\n content: { type: \"tag\", count: providers.length },\n meta: { kind: \"afs:directory\", childrenCount: providers.length },\n };\n }\n\n @Read(\"/by-tag/:tag/:name\")\n async readTagProvider(\n ctx: RouteContext<{ tag: string; name: string }>,\n ): Promise<AFSEntry | undefined> {\n const providers = this.byTag.get(ctx.params.tag);\n const provider = providers?.find((p) => p.name === ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return {\n id: provider.name,\n path: ctx.path,\n content: { type: \"provider\", name: provider.name, description: provider.description },\n meta: { kind: \"registry:provider\" },\n };\n }\n\n @Read(\"/.meta/.capabilities\")\n async readCapabilities(_ctx: RouteContext): Promise<AFSEntry | undefined> {\n return {\n id: \"/.meta/.capabilities\",\n path: \"/.meta/.capabilities\",\n content: {\n operations: {\n list: true,\n read: true,\n write: false,\n delete: false,\n exec: true,\n stat: true,\n explain: true,\n search: true,\n },\n },\n meta: { kind: \"afs:capabilities\" },\n };\n }\n\n // ── Meta Routes ──\n\n @Meta(\"/\")\n async rootMeta(_ctx: RouteContext): Promise<AFSEntry> {\n return {\n id: \".meta\",\n path: \"/.meta\",\n content: {\n providerCount: this.providers.length,\n categories: Array.from(this.byCategory.keys()),\n tags: Array.from(this.byTag.keys()),\n },\n meta: {\n kind: \"registry:root\",\n childrenCount: 3,\n },\n };\n }\n\n @Meta(\"/providers\")\n async providersMeta(_ctx: RouteContext): Promise<AFSEntry> {\n return {\n id: \".meta\",\n path: \"/providers/.meta\",\n content: { count: this.providers.length },\n meta: { kind: \"afs:directory\", childrenCount: this.providers.length },\n };\n }\n\n @Meta(\"/providers/:name\")\n async providerMeta(ctx: RouteContext<{ name: string }>): Promise<AFSEntry> {\n const provider = this.findProvider(ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return {\n id: \".meta\",\n path: joinURL(\"/providers\", provider.name, \".meta\"),\n content: { name: provider.name, category: provider.category, scheme: provider.scheme },\n meta: { kind: \"registry:provider\", childrenCount: 2 },\n };\n }\n\n @Meta(\"/providers/:name/manifest.json\")\n async manifestMeta(ctx: RouteContext<{ name: string }>): Promise<AFSEntry> {\n const provider = this.findProvider(ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return {\n id: \".meta\",\n path: joinURL(\"/providers\", provider.name, \"manifest.json\", \".meta\"),\n content: { format: \"json\" },\n meta: { kind: \"afs:file\" },\n };\n }\n\n @Meta(\"/providers/:name/README.md\")\n async readmeMeta(ctx: RouteContext<{ name: string }>): Promise<AFSEntry> {\n const provider = this.findProvider(ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return {\n id: \".meta\",\n path: joinURL(\"/providers\", provider.name, \"README.md\", \".meta\"),\n content: { format: \"markdown\" },\n meta: { kind: \"afs:file\" },\n };\n }\n\n @Meta(\"/by-category\")\n async byCategoryMeta(_ctx: RouteContext): Promise<AFSEntry> {\n return {\n id: \".meta\",\n path: \"/by-category/.meta\",\n content: { count: this.byCategory.size },\n meta: { kind: \"afs:directory\", childrenCount: this.byCategory.size },\n };\n }\n\n @Meta(\"/by-category/:category\")\n async categoryMeta(ctx: RouteContext<{ category: string }>): Promise<AFSEntry> {\n const providers = this.byCategory.get(ctx.params.category);\n if (!providers) throw new AFSNotFoundError(ctx.path);\n return {\n id: \".meta\",\n path: joinURL(\"/by-category\", ctx.params.category, \".meta\"),\n content: { category: ctx.params.category, count: providers.length },\n meta: { kind: \"afs:directory\", childrenCount: providers.length },\n };\n }\n\n @Meta(\"/by-category/:category/:name\")\n async categoryProviderMeta(\n ctx: RouteContext<{ category: string; name: string }>,\n ): Promise<AFSEntry> {\n const providers = this.byCategory.get(ctx.params.category);\n const provider = providers?.find((p) => p.name === ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return {\n id: \".meta\",\n path: joinURL(\"/by-category\", ctx.params.category, provider.name, \".meta\"),\n content: { name: provider.name },\n meta: { kind: \"registry:provider\" },\n };\n }\n\n @Meta(\"/by-tag\")\n async byTagMeta(_ctx: RouteContext): Promise<AFSEntry> {\n return {\n id: \".meta\",\n path: \"/by-tag/.meta\",\n content: { count: this.byTag.size },\n meta: { kind: \"afs:directory\", childrenCount: this.byTag.size },\n };\n }\n\n @Meta(\"/by-tag/:tag\")\n async tagMeta(ctx: RouteContext<{ tag: string }>): Promise<AFSEntry> {\n const providers = this.byTag.get(ctx.params.tag);\n if (!providers) throw new AFSNotFoundError(ctx.path);\n return {\n id: \".meta\",\n path: joinURL(\"/by-tag\", ctx.params.tag, \".meta\"),\n content: { tag: ctx.params.tag, count: providers.length },\n meta: { kind: \"afs:directory\", childrenCount: providers.length },\n };\n }\n\n @Meta(\"/by-tag/:tag/:name\")\n async tagProviderMeta(ctx: RouteContext<{ tag: string; name: string }>): Promise<AFSEntry> {\n const providers = this.byTag.get(ctx.params.tag);\n const provider = providers?.find((p) => p.name === ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return {\n id: \".meta\",\n path: joinURL(\"/by-tag\", ctx.params.tag, provider.name, \".meta\"),\n content: { name: provider.name },\n meta: { kind: \"registry:provider\" },\n };\n }\n\n // ── Actions Routes ──\n\n @Actions(\"/\")\n async listRootActions(_ctx: RouteContext) {\n return {\n data: [\n {\n id: \"search\",\n path: \"/.actions/search\",\n meta: {\n kind: \"afs:executable\",\n kinds: [\"afs:executable\", \"afs:node\"],\n },\n actions: [\n {\n name: \"search\",\n description: \"Search for providers matching a query\",\n inputSchema: {\n type: \"object\",\n properties: {\n query: { type: \"string\", description: \"Search query\" },\n },\n },\n },\n ],\n },\n ] as AFSEntry[],\n };\n }\n\n @Actions.Exec(\"/\", \"search\")\n async searchProviders(_ctx: RouteContext, args: Record<string, unknown>): Promise<AFSExecResult> {\n // Return all providers — the agent filters client-side\n return {\n success: true,\n data: {\n query: (args.query as string) || \"\",\n providers: this.providers.map((p) => ({ ...p })),\n },\n };\n }\n\n @Actions(\"/providers/:name\")\n async listProviderActions(ctx: RouteContext<{ name: string }>) {\n const provider = this.findProvider(ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n return {\n data: [\n {\n id: \"mount\",\n path: joinURL(\"/providers\", provider.name, \".actions\", \"mount\"),\n meta: {\n kind: \"afs:executable\",\n kinds: [\"afs:executable\", \"afs:node\"],\n },\n actions: [\n {\n name: \"mount\",\n description: `Mount the ${provider.name} provider`,\n inputSchema: {\n type: \"object\",\n properties: {\n path: { type: \"string\", description: \"Mount path\" },\n uri: {\n type: \"string\",\n description: `Provider URI (default: ${provider.scheme}:///)`,\n },\n },\n required: [\"path\"],\n },\n },\n ],\n },\n ] as AFSEntry[],\n };\n }\n\n @Actions.Exec(\"/providers/:name\", \"mount\")\n async mountProvider(\n ctx: RouteContext<{ name: string }>,\n args: Record<string, unknown>,\n ): Promise<AFSExecResult> {\n const provider = this.findProvider(ctx.params.name);\n if (!provider) throw new AFSNotFoundError(ctx.path);\n\n if (!this.loadProviderFn) {\n throw new Error(\"loadProvider not configured — Registry was not mounted on an AFS instance\");\n }\n\n const mountPath = args.path as string;\n const uri = (args.uri as string) || `${provider.scheme}:///`;\n\n await this.loadProviderFn(uri, mountPath);\n\n return {\n success: true,\n data: {\n provider: provider.name,\n uri,\n path: mountPath,\n },\n };\n }\n\n // ── Search Route ──\n\n @Search(\"/\")\n async searchRoot(\n _ctx: RouteContext,\n query: string,\n options?: { limit?: number },\n ): Promise<AFSSearchResult> {\n const q = query.toLowerCase();\n let matched = this.providers.filter(\n (p) =>\n p.name.toLowerCase().includes(q) ||\n p.description.toLowerCase().includes(q) ||\n p.category.toLowerCase().includes(q) ||\n (p.tags || []).some((t) => t.toLowerCase().includes(q)) ||\n p.capabilities_summary.toLowerCase().includes(q),\n );\n if (options?.limit !== undefined && matched.length > options.limit) {\n matched = matched.slice(0, options.limit);\n }\n return {\n data: matched.map((p) => ({\n id: p.name,\n path: joinURL(\"/providers\", p.name),\n summary: p.description,\n meta: { kind: \"registry:provider\" },\n })),\n };\n }\n\n // ── Explain Route ──\n\n @Explain(\"/:path*\")\n async explainPath(_ctx: RouteContext): Promise<AFSExplainResult> {\n return {\n format: \"markdown\",\n content: [\n \"# AFS Provider Registry\",\n \"\",\n \"This provider exposes a virtual file tree of available AFS providers.\",\n \"\",\n \"## Structure\",\n \"- `/providers/{name}/manifest.json` — Provider metadata\",\n \"- `/providers/{name}/README.md` — Human-readable description\",\n \"- `/providers/{name}/.actions/mount` — Mount action\",\n \"- `/by-category/{category}/` — Browse by category\",\n \"- `/by-tag/{tag}/` — Browse by tag\",\n \"- `/.actions/search` — Full-text search across providers\",\n \"\",\n `**Total providers:** ${this.providers.length}`,\n ].join(\"\\n\"),\n };\n }\n\n // ── Stat Route ──\n\n @Stat(\"/\")\n @Stat(\"/providers\")\n @Stat(\"/providers/:name\")\n @Stat(\"/providers/:name/manifest.json\")\n @Stat(\"/providers/:name/README.md\")\n @Stat(\"/by-category\")\n @Stat(\"/by-category/:category\")\n @Stat(\"/by-category/:category/:name\")\n @Stat(\"/by-tag\")\n @Stat(\"/by-tag/:tag\")\n @Stat(\"/by-tag/:tag/:name\")\n async statPath(ctx: RouteContext): Promise<AFSStatResult> {\n // Delegate to read to get actual entry data\n const readResult = await this.read(ctx.path);\n if (readResult.data) {\n return { data: readResult.data };\n }\n throw new AFSNotFoundError(ctx.path);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,IAAa,cAAb,cAAiC,gBAAgB;CAC/C,AAAS,OAAO;CAChB,AAAS,cAAc;CACvB,AAAS,aAAa;CAEtB,AAAQ;CACR,AAAQ;CAER,YAAY,SAA6B;AACvC,SAAO;AAEP,OAAK,YAAY,KAAK,MAAM,KAAK,UAAU,QAAQ,UAAU,CAAC;;CAGhE,QAAQ,MAAqB;AAC3B,OAAK,iBAAkB,KAAa;;CAKtC,IAAY,aAA8C;EACxD,MAAM,sBAAM,IAAI,KAAiC;AACjD,OAAK,MAAM,KAAK,KAAK,WAAW;GAC9B,MAAM,OAAO,IAAI,IAAI,EAAE,SAAS,IAAI,EAAE;AACtC,QAAK,KAAK,EAAE;AACZ,OAAI,IAAI,EAAE,UAAU,KAAK;;AAE3B,SAAO;;CAGT,IAAY,QAAyC;EACnD,MAAM,sBAAM,IAAI,KAAiC;AACjD,OAAK,MAAM,KAAK,KAAK,UACnB,MAAK,MAAM,OAAO,EAAE,QAAQ,EAAE,EAAE;GAC9B,MAAM,OAAO,IAAI,IAAI,IAAI,IAAI,EAAE;AAC/B,QA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,iCAAiC;CACtC,KAAK,6BAA6B;CAClC,KAAK,eAAe;CACpB,KAAK,yBAAyB;CAC9B,KAAK,+BAA+B;CACpC,KAAK,UAAU;CACf,KAAK,eAAe;CACpB,KAAK,qBAAqB"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@aigne/afs-registry",
3
+ "version": "1.11.0-beta.7",
4
+ "description": "AIGNE AFS registry provider - virtual file tree for discovering and mounting providers",
5
+ "license": "UNLICENSED",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "author": "Arcblock <blocklet@arcblock.io> https://github.com/arcblock",
10
+ "homepage": "https://github.com/arcblock/afs",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/arcblock/afs"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/arcblock/afs/issues"
17
+ },
18
+ "type": "module",
19
+ "main": "./dist/index.cjs",
20
+ "module": "./dist/index.mjs",
21
+ "types": "./dist/index.d.cts",
22
+ "exports": {
23
+ ".": {
24
+ "require": "./dist/index.cjs",
25
+ "import": "./dist/index.mjs"
26
+ },
27
+ "./*": "./*"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "LICENSE",
32
+ "README.md",
33
+ "CHANGELOG.md"
34
+ ],
35
+ "dependencies": {
36
+ "ufo": "^1.6.3",
37
+ "@aigne/afs": "^1.11.0-beta.7"
38
+ },
39
+ "devDependencies": {
40
+ "@types/bun": "^1.3.6",
41
+ "npm-run-all": "^4.1.5",
42
+ "rimraf": "^6.1.2",
43
+ "tsdown": "0.20.0-beta.3",
44
+ "typescript": "5.9.2",
45
+ "@aigne/afs-testing": "1.11.0-beta.7",
46
+ "@aigne/typescript-config": "0.0.0"
47
+ },
48
+ "scripts": {
49
+ "build": "tsdown",
50
+ "check-types": "tsc --noEmit",
51
+ "clean": "rimraf dist coverage",
52
+ "test": "bun test",
53
+ "test:coverage": "bun test --coverage --coverage-reporter=lcov --coverage-reporter=text"
54
+ }
55
+ }