@aigne/afs-registry 1.11.0-beta.10
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 +26 -0
- package/dist/index.d.mts +191 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +1308 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +55 -0
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
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { AFSBaseProvider, AFSEntry, AFSExecResult, AFSExplainOptions, AFSExplainResult, AFSListOptions, AFSListResult, AFSReadOptions, AFSReadResult, AFSRoot, AFSSearchOptions, AFSSearchResult, AFSStatOptions, AFSStatResult, RouteContext } from "@aigne/afs";
|
|
2
|
+
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A single provider manifest entry in the registry.
|
|
6
|
+
*
|
|
7
|
+
* Aligned with the core ProviderManifest (serialized form: schema as JSON Schema
|
|
8
|
+
* instead of Zod, camelCase field names).
|
|
9
|
+
*/
|
|
10
|
+
interface ProviderManifest {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
category: string;
|
|
14
|
+
/** URI template with {param} placeholders, e.g. "s3://{bucket}/{prefix+?}" */
|
|
15
|
+
uriTemplate: string;
|
|
16
|
+
/** JSON Schema describing provider parameters (serialized from Zod) */
|
|
17
|
+
schema?: Record<string, unknown>;
|
|
18
|
+
tags?: string[];
|
|
19
|
+
useCases?: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Options for constructing an AFSRegistry provider.
|
|
23
|
+
*/
|
|
24
|
+
interface AFSRegistryOptions {
|
|
25
|
+
/** Static provider manifests (for testing / offline use). Overrides url if provided. */
|
|
26
|
+
providers?: ProviderManifest[];
|
|
27
|
+
/** Remote URL to fetch provider manifests from. Falls back to bundled data on failure. */
|
|
28
|
+
url?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* AFS Registry Provider — virtual file tree for discovering and mounting providers.
|
|
32
|
+
*
|
|
33
|
+
* File tree:
|
|
34
|
+
* ```
|
|
35
|
+
* /
|
|
36
|
+
* ├── providers/{name}/manifest.json
|
|
37
|
+
* ├── providers/{name}/README.md
|
|
38
|
+
* ├── providers/{name}/.actions/mount
|
|
39
|
+
* ├── by-category/{category}/{name}/
|
|
40
|
+
* ├── by-tag/{tag}/{name}/
|
|
41
|
+
* └── .actions/search
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
declare class AFSRegistry extends AFSBaseProvider {
|
|
45
|
+
readonly name = "registry";
|
|
46
|
+
readonly description = "AFS Provider Registry \u2014 discover and install available providers.\n- Browse providers by name, category, or tag\n- Read provider manifests, README docs, and configuration schemas\n- Search providers by keyword (name, description, tags, use cases)\n- Exec actions: `search` (full-text query), `mount` (per-provider, install to AFS)\n- Path structure: `/providers/{name}/manifest.json`, `/by-category/{cat}`, `/by-tag/{tag}`";
|
|
47
|
+
readonly accessMode: "readwrite";
|
|
48
|
+
private providers;
|
|
49
|
+
private remoteUrl?;
|
|
50
|
+
private fetchPromise?;
|
|
51
|
+
private loadProviderFn?;
|
|
52
|
+
constructor(options?: AFSRegistryOptions);
|
|
53
|
+
private fetchRemoteProviders;
|
|
54
|
+
private ensureLoaded;
|
|
55
|
+
onMount(root: AFSRoot): void;
|
|
56
|
+
list(path: string, options?: AFSListOptions): Promise<AFSListResult>;
|
|
57
|
+
read(path: string, options?: AFSReadOptions): Promise<AFSReadResult>;
|
|
58
|
+
stat(path: string, options?: AFSStatOptions): Promise<AFSStatResult>;
|
|
59
|
+
search(path: string, query: string, options?: AFSSearchOptions): Promise<AFSSearchResult>;
|
|
60
|
+
exec(path: string, args: Record<string, unknown>, options: Record<string, unknown>): Promise<AFSExecResult>;
|
|
61
|
+
explain(path: string, options?: AFSExplainOptions): Promise<AFSExplainResult>;
|
|
62
|
+
private buildByCategory;
|
|
63
|
+
private buildByTag;
|
|
64
|
+
private findProvider;
|
|
65
|
+
listRoot(_ctx: RouteContext): Promise<{
|
|
66
|
+
data: AFSEntry[];
|
|
67
|
+
}>;
|
|
68
|
+
listProviders(_ctx: RouteContext): Promise<{
|
|
69
|
+
data: AFSEntry[];
|
|
70
|
+
}>;
|
|
71
|
+
listProviderContents(ctx: RouteContext<{
|
|
72
|
+
name: string;
|
|
73
|
+
}>): Promise<{
|
|
74
|
+
data: AFSEntry[];
|
|
75
|
+
}>;
|
|
76
|
+
listCategories(_ctx: RouteContext): Promise<{
|
|
77
|
+
data: AFSEntry[];
|
|
78
|
+
}>;
|
|
79
|
+
listCategoryProviders(ctx: RouteContext<{
|
|
80
|
+
category: string;
|
|
81
|
+
}>): Promise<{
|
|
82
|
+
data: AFSEntry[];
|
|
83
|
+
}>;
|
|
84
|
+
listTags(_ctx: RouteContext): Promise<{
|
|
85
|
+
data: AFSEntry[];
|
|
86
|
+
}>;
|
|
87
|
+
listCategoryProviderChildren(ctx: RouteContext<{
|
|
88
|
+
category: string;
|
|
89
|
+
name: string;
|
|
90
|
+
}>): Promise<{
|
|
91
|
+
data: AFSEntry[];
|
|
92
|
+
}>;
|
|
93
|
+
listTagProviders(ctx: RouteContext<{
|
|
94
|
+
tag: string;
|
|
95
|
+
}>): Promise<{
|
|
96
|
+
data: AFSEntry[];
|
|
97
|
+
}>;
|
|
98
|
+
listTagProviderChildren(ctx: RouteContext<{
|
|
99
|
+
tag: string;
|
|
100
|
+
name: string;
|
|
101
|
+
}>): Promise<{
|
|
102
|
+
data: AFSEntry[];
|
|
103
|
+
}>;
|
|
104
|
+
listFileNode(ctx: RouteContext<{
|
|
105
|
+
name: string;
|
|
106
|
+
}>): Promise<{
|
|
107
|
+
data: AFSEntry[];
|
|
108
|
+
}>;
|
|
109
|
+
readRoot(_ctx: RouteContext): Promise<AFSEntry | undefined>;
|
|
110
|
+
readProviders(_ctx: RouteContext): Promise<AFSEntry | undefined>;
|
|
111
|
+
readProvider(ctx: RouteContext<{
|
|
112
|
+
name: string;
|
|
113
|
+
}>): Promise<AFSEntry | undefined>;
|
|
114
|
+
readManifest(ctx: RouteContext<{
|
|
115
|
+
name: string;
|
|
116
|
+
}>): Promise<AFSEntry | undefined>;
|
|
117
|
+
readReadme(ctx: RouteContext<{
|
|
118
|
+
name: string;
|
|
119
|
+
}>): Promise<AFSEntry | undefined>;
|
|
120
|
+
readByCategory(_ctx: RouteContext): Promise<AFSEntry | undefined>;
|
|
121
|
+
readCategory(ctx: RouteContext<{
|
|
122
|
+
category: string;
|
|
123
|
+
}>): Promise<AFSEntry | undefined>;
|
|
124
|
+
readCategoryProvider(ctx: RouteContext<{
|
|
125
|
+
category: string;
|
|
126
|
+
name: string;
|
|
127
|
+
}>): Promise<AFSEntry | undefined>;
|
|
128
|
+
readByTag(_ctx: RouteContext): Promise<AFSEntry | undefined>;
|
|
129
|
+
readTag(ctx: RouteContext<{
|
|
130
|
+
tag: string;
|
|
131
|
+
}>): Promise<AFSEntry | undefined>;
|
|
132
|
+
readTagProvider(ctx: RouteContext<{
|
|
133
|
+
tag: string;
|
|
134
|
+
name: string;
|
|
135
|
+
}>): Promise<AFSEntry | undefined>;
|
|
136
|
+
readCapabilities(_ctx: RouteContext): Promise<AFSEntry | undefined>;
|
|
137
|
+
rootMeta(_ctx: RouteContext): Promise<AFSEntry>;
|
|
138
|
+
providersMeta(_ctx: RouteContext): Promise<AFSEntry>;
|
|
139
|
+
providerMeta(ctx: RouteContext<{
|
|
140
|
+
name: string;
|
|
141
|
+
}>): Promise<AFSEntry>;
|
|
142
|
+
manifestMeta(ctx: RouteContext<{
|
|
143
|
+
name: string;
|
|
144
|
+
}>): Promise<AFSEntry>;
|
|
145
|
+
readmeMeta(ctx: RouteContext<{
|
|
146
|
+
name: string;
|
|
147
|
+
}>): Promise<AFSEntry>;
|
|
148
|
+
byCategoryMeta(_ctx: RouteContext): Promise<AFSEntry>;
|
|
149
|
+
categoryMeta(ctx: RouteContext<{
|
|
150
|
+
category: string;
|
|
151
|
+
}>): Promise<AFSEntry>;
|
|
152
|
+
categoryProviderMeta(ctx: RouteContext<{
|
|
153
|
+
category: string;
|
|
154
|
+
name: string;
|
|
155
|
+
}>): Promise<AFSEntry>;
|
|
156
|
+
byTagMeta(_ctx: RouteContext): Promise<AFSEntry>;
|
|
157
|
+
tagMeta(ctx: RouteContext<{
|
|
158
|
+
tag: string;
|
|
159
|
+
}>): Promise<AFSEntry>;
|
|
160
|
+
tagProviderMeta(ctx: RouteContext<{
|
|
161
|
+
tag: string;
|
|
162
|
+
name: string;
|
|
163
|
+
}>): Promise<AFSEntry>;
|
|
164
|
+
listRootActions(_ctx: RouteContext): Promise<{
|
|
165
|
+
data: AFSEntry[];
|
|
166
|
+
}>;
|
|
167
|
+
searchProviders(_ctx: RouteContext, args: Record<string, unknown>): Promise<AFSExecResult>;
|
|
168
|
+
/**
|
|
169
|
+
* Build mount action inputSchema for a provider
|
|
170
|
+
*/
|
|
171
|
+
private buildMountSchema;
|
|
172
|
+
listProviderActions(ctx: RouteContext<{
|
|
173
|
+
name: string;
|
|
174
|
+
}>): Promise<{
|
|
175
|
+
data: AFSEntry[];
|
|
176
|
+
}>;
|
|
177
|
+
readMountAction(ctx: RouteContext<{
|
|
178
|
+
name: string;
|
|
179
|
+
}>): Promise<AFSEntry | undefined>;
|
|
180
|
+
mountProvider(ctx: RouteContext<{
|
|
181
|
+
name: string;
|
|
182
|
+
}>, args: Record<string, unknown>): Promise<AFSExecResult>;
|
|
183
|
+
searchRoot(_ctx: RouteContext, query: string, options?: {
|
|
184
|
+
limit?: number;
|
|
185
|
+
}): Promise<AFSSearchResult>;
|
|
186
|
+
explainPath(_ctx: RouteContext): Promise<AFSExplainResult>;
|
|
187
|
+
statPath(ctx: RouteContext): Promise<AFSStatResult>;
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
export { AFSRegistry, AFSRegistryOptions, ProviderManifest };
|
|
191
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;AAoCA;;;;UAAiB,gBAAA;EACf,IAAA;EACA,WAAA;EACA,QAAA;EAIA;EAFA,WAAA;EAGA;EADA,MAAA,GAAS,MAAA;EACT,IAAA;EACA,QAAA;AAAA;;;;UAMe,kBAAA;EAEH;EAAZ,SAAA,GAAY,gBAAA;EAET;EAAH,GAAA;AAAA;;;;;;;;;;;;;;;cAiBW,WAAA,SAAoB,eAAA;EAAA,SACtB,IAAA;EAAA,SACA,WAAA;EAAA,SAEA,UAAA;EAAA,QAED,SAAA;EAAA,QACA,SAAA;EAAA,QACA,YAAA;EAAA,QACA,cAAA;cAMI,OAAA,GAAS,kBAAA;EAAA,QAeP,oBAAA;EAAA,QA8BA,YAAA;EAOd,OAAA,CA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