resourcexjs 2.17.2 → 2.19.0
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/dist/arp.js +28 -519
- package/dist/arp.js.map +4 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +233 -15945
- package/dist/index.js.map +6 -7
- package/package.json +3 -3
package/dist/arp.js
CHANGED
|
@@ -13,524 +13,33 @@ var __export = (target, all) => {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
class SemanticError extends ARPError {
|
|
47
|
-
semantic;
|
|
48
|
-
constructor(message, semantic, options) {
|
|
49
|
-
super(message, options);
|
|
50
|
-
this.semantic = semantic;
|
|
51
|
-
this.name = "SemanticError";
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
class ARL {
|
|
56
|
-
semantic;
|
|
57
|
-
transport;
|
|
58
|
-
location;
|
|
59
|
-
resolver;
|
|
60
|
-
constructor(semantic, transport, location, resolver) {
|
|
61
|
-
this.semantic = semantic;
|
|
62
|
-
this.transport = transport;
|
|
63
|
-
this.location = location;
|
|
64
|
-
this.resolver = resolver;
|
|
65
|
-
}
|
|
66
|
-
createContext(params) {
|
|
67
|
-
return {
|
|
68
|
-
url: this.toString(),
|
|
69
|
-
semantic: this.semantic,
|
|
70
|
-
transport: this.transport,
|
|
71
|
-
location: this.location,
|
|
72
|
-
timestamp: new Date,
|
|
73
|
-
params
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
async resolve(params) {
|
|
77
|
-
const transport = this.resolver.getTransportHandler(this.transport);
|
|
78
|
-
const semantic = this.resolver.getSemanticHandler(this.semantic);
|
|
79
|
-
const context = this.createContext(params);
|
|
80
|
-
return semantic.resolve(transport, this.location, context);
|
|
81
|
-
}
|
|
82
|
-
async deposit(data, params) {
|
|
83
|
-
const transport = this.resolver.getTransportHandler(this.transport);
|
|
84
|
-
const semantic = this.resolver.getSemanticHandler(this.semantic);
|
|
85
|
-
const context = this.createContext(params);
|
|
86
|
-
if (!semantic.deposit) {
|
|
87
|
-
throw new SemanticError(`Semantic "${semantic.name}" does not support deposit operation`, this.semantic);
|
|
88
|
-
}
|
|
89
|
-
await semantic.deposit(transport, this.location, data, context);
|
|
90
|
-
}
|
|
91
|
-
async exists() {
|
|
92
|
-
const transport = this.resolver.getTransportHandler(this.transport);
|
|
93
|
-
const semantic = this.resolver.getSemanticHandler(this.semantic);
|
|
94
|
-
const context = this.createContext();
|
|
95
|
-
if (semantic.exists) {
|
|
96
|
-
return semantic.exists(transport, this.location, context);
|
|
97
|
-
}
|
|
98
|
-
return transport.exists(this.location);
|
|
99
|
-
}
|
|
100
|
-
async delete() {
|
|
101
|
-
const transport = this.resolver.getTransportHandler(this.transport);
|
|
102
|
-
const semantic = this.resolver.getSemanticHandler(this.semantic);
|
|
103
|
-
const context = this.createContext();
|
|
104
|
-
if (semantic.delete) {
|
|
105
|
-
return semantic.delete(transport, this.location, context);
|
|
106
|
-
}
|
|
107
|
-
await transport.delete(this.location);
|
|
108
|
-
}
|
|
109
|
-
async list(options) {
|
|
110
|
-
const transport = this.resolver.getTransportHandler(this.transport);
|
|
111
|
-
if (!transport.list) {
|
|
112
|
-
throw new TransportError(`Transport "${transport.name}" does not support list operation`, this.transport);
|
|
113
|
-
}
|
|
114
|
-
return transport.list(this.location, options);
|
|
115
|
-
}
|
|
116
|
-
async mkdir() {
|
|
117
|
-
const transport = this.resolver.getTransportHandler(this.transport);
|
|
118
|
-
if (!transport.mkdir) {
|
|
119
|
-
throw new TransportError(`Transport "${transport.name}" does not support mkdir operation`, this.transport);
|
|
120
|
-
}
|
|
121
|
-
await transport.mkdir(this.location);
|
|
122
|
-
}
|
|
123
|
-
toString() {
|
|
124
|
-
return `arp:${this.semantic}:${this.transport}://${this.location}`;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
function toBuffer(data) {
|
|
128
|
-
if (Buffer.isBuffer(data)) {
|
|
129
|
-
return data;
|
|
130
|
-
}
|
|
131
|
-
if (data instanceof Uint8Array) {
|
|
132
|
-
return Buffer.from(data);
|
|
133
|
-
}
|
|
134
|
-
if (data instanceof ArrayBuffer) {
|
|
135
|
-
return Buffer.from(data);
|
|
136
|
-
}
|
|
137
|
-
if (Array.isArray(data)) {
|
|
138
|
-
return Buffer.from(data);
|
|
139
|
-
}
|
|
140
|
-
throw new SemanticError(`Unsupported binary input type`, "binary");
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
class BinarySemanticHandler {
|
|
144
|
-
name = "binary";
|
|
145
|
-
async resolve(transport, location, context) {
|
|
146
|
-
const result = await transport.get(location, context.params);
|
|
147
|
-
const meta = {
|
|
148
|
-
url: context.url,
|
|
149
|
-
semantic: context.semantic,
|
|
150
|
-
transport: context.transport,
|
|
151
|
-
location: context.location,
|
|
152
|
-
size: result.metadata?.size ?? result.content.length,
|
|
153
|
-
resolvedAt: context.timestamp.toISOString(),
|
|
154
|
-
type: result.metadata?.type
|
|
155
|
-
};
|
|
156
|
-
return {
|
|
157
|
-
type: "binary",
|
|
158
|
-
content: result.content,
|
|
159
|
-
meta
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
async deposit(transport, location, data, context) {
|
|
163
|
-
const buffer = toBuffer(data);
|
|
164
|
-
try {
|
|
165
|
-
await transport.set(location, buffer, context.params);
|
|
166
|
-
} catch (error) {
|
|
167
|
-
throw new SemanticError(`Failed to deposit binary to "${location}": ${error.message}`, this.name, { cause: error });
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
async exists(transport, location, _context) {
|
|
171
|
-
return transport.exists(location);
|
|
172
|
-
}
|
|
173
|
-
async delete(transport, location, _context) {
|
|
174
|
-
try {
|
|
175
|
-
await transport.delete(location);
|
|
176
|
-
} catch (error) {
|
|
177
|
-
throw new SemanticError(`Failed to delete "${location}": ${error.message}`, this.name, { cause: error });
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
var binarySemantic = new BinarySemanticHandler;
|
|
182
|
-
|
|
183
|
-
class TextSemanticHandler {
|
|
184
|
-
name = "text";
|
|
185
|
-
async resolve(transport, location, context) {
|
|
186
|
-
const result = await transport.get(location, context.params);
|
|
187
|
-
if (result.metadata?.type === "directory") {
|
|
188
|
-
const meta2 = {
|
|
189
|
-
url: context.url,
|
|
190
|
-
semantic: context.semantic,
|
|
191
|
-
transport: context.transport,
|
|
192
|
-
location: context.location,
|
|
193
|
-
size: result.content.length,
|
|
194
|
-
encoding: "utf-8",
|
|
195
|
-
mimeType: "application/json",
|
|
196
|
-
resolvedAt: context.timestamp.toISOString(),
|
|
197
|
-
type: "directory"
|
|
198
|
-
};
|
|
199
|
-
return {
|
|
200
|
-
type: "text",
|
|
201
|
-
content: result.content.toString("utf-8"),
|
|
202
|
-
meta: meta2
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
const text = result.content.toString("utf-8");
|
|
206
|
-
const meta = {
|
|
207
|
-
url: context.url,
|
|
208
|
-
semantic: context.semantic,
|
|
209
|
-
transport: context.transport,
|
|
210
|
-
location: context.location,
|
|
211
|
-
size: result.metadata?.size ?? result.content.length,
|
|
212
|
-
encoding: "utf-8",
|
|
213
|
-
mimeType: "text/plain",
|
|
214
|
-
resolvedAt: context.timestamp.toISOString(),
|
|
215
|
-
type: "file"
|
|
216
|
-
};
|
|
217
|
-
return {
|
|
218
|
-
type: "text",
|
|
219
|
-
content: text,
|
|
220
|
-
meta
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
async deposit(transport, location, data, context) {
|
|
224
|
-
const buffer = Buffer.from(data, "utf-8");
|
|
225
|
-
try {
|
|
226
|
-
await transport.set(location, buffer, context.params);
|
|
227
|
-
} catch (error) {
|
|
228
|
-
throw new SemanticError(`Failed to deposit text to "${location}": ${error.message}`, this.name, { cause: error });
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
async exists(transport, location, _context) {
|
|
232
|
-
return transport.exists(location);
|
|
233
|
-
}
|
|
234
|
-
async delete(transport, location, _context) {
|
|
235
|
-
try {
|
|
236
|
-
await transport.delete(location);
|
|
237
|
-
} catch (error) {
|
|
238
|
-
throw new SemanticError(`Failed to delete "${location}": ${error.message}`, this.name, { cause: error });
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
var textSemantic = new TextSemanticHandler;
|
|
243
|
-
|
|
244
|
-
class FileTransportHandler {
|
|
245
|
-
name = "file";
|
|
246
|
-
resolvePath(location) {
|
|
247
|
-
return resolve(process.cwd(), location);
|
|
248
|
-
}
|
|
249
|
-
async get(location, params) {
|
|
250
|
-
const filePath = this.resolvePath(location);
|
|
251
|
-
try {
|
|
252
|
-
const stats = await stat(filePath);
|
|
253
|
-
if (stats.isDirectory()) {
|
|
254
|
-
return this.getDirectory(filePath, stats, params);
|
|
255
|
-
} else {
|
|
256
|
-
return this.getFile(filePath, stats);
|
|
257
|
-
}
|
|
258
|
-
} catch (error) {
|
|
259
|
-
const err = error;
|
|
260
|
-
throw new TransportError(`File get error: ${err.code} - ${filePath}`, this.name, {
|
|
261
|
-
cause: err
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
async getFile(filePath, stats) {
|
|
266
|
-
const content = await readFile(filePath);
|
|
267
|
-
return {
|
|
268
|
-
content,
|
|
269
|
-
metadata: {
|
|
270
|
-
type: "file",
|
|
271
|
-
size: Number(stats.size),
|
|
272
|
-
modifiedAt: stats.mtime
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
async getDirectory(dirPath, stats, params) {
|
|
277
|
-
const recursive = params?.recursive === "true";
|
|
278
|
-
const pattern = params?.pattern;
|
|
279
|
-
let entries;
|
|
280
|
-
if (recursive) {
|
|
281
|
-
entries = await this.listRecursive(dirPath, dirPath);
|
|
282
|
-
} else {
|
|
283
|
-
entries = await readdir(dirPath);
|
|
284
|
-
}
|
|
285
|
-
if (pattern) {
|
|
286
|
-
entries = this.filterByPattern(entries, pattern);
|
|
287
|
-
}
|
|
288
|
-
const content = Buffer.from(JSON.stringify(entries));
|
|
289
|
-
return {
|
|
290
|
-
content,
|
|
291
|
-
metadata: {
|
|
292
|
-
type: "directory",
|
|
293
|
-
modifiedAt: stats.mtime
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
async listRecursive(basePath, currentPath) {
|
|
298
|
-
const entries = await readdir(currentPath, { withFileTypes: true });
|
|
299
|
-
const results = [];
|
|
300
|
-
for (const entry of entries) {
|
|
301
|
-
const fullPath = join(currentPath, entry.name);
|
|
302
|
-
const relativePath = fullPath.substring(basePath.length + 1);
|
|
303
|
-
if (entry.isDirectory()) {
|
|
304
|
-
const subEntries = await this.listRecursive(basePath, fullPath);
|
|
305
|
-
results.push(...subEntries);
|
|
306
|
-
} else {
|
|
307
|
-
results.push(relativePath);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
return results;
|
|
311
|
-
}
|
|
312
|
-
filterByPattern(entries, pattern) {
|
|
313
|
-
const regexPattern = pattern.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".");
|
|
314
|
-
const regex = new RegExp(`^${regexPattern}$`);
|
|
315
|
-
return entries.filter((entry) => {
|
|
316
|
-
const filename = entry.split("/").pop() || entry;
|
|
317
|
-
return regex.test(filename);
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
async set(location, content, _params) {
|
|
321
|
-
const filePath = this.resolvePath(location);
|
|
322
|
-
try {
|
|
323
|
-
await mkdir(dirname(filePath), { recursive: true });
|
|
324
|
-
await writeFile(filePath, content);
|
|
325
|
-
} catch (error) {
|
|
326
|
-
const err = error;
|
|
327
|
-
throw new TransportError(`File set error: ${err.code} - ${filePath}`, this.name, {
|
|
328
|
-
cause: err
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
async exists(location) {
|
|
333
|
-
const filePath = this.resolvePath(location);
|
|
334
|
-
try {
|
|
335
|
-
await access(filePath);
|
|
336
|
-
return true;
|
|
337
|
-
} catch {
|
|
338
|
-
return false;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
async delete(location) {
|
|
342
|
-
const filePath = this.resolvePath(location);
|
|
343
|
-
try {
|
|
344
|
-
await rm(filePath, { recursive: true });
|
|
345
|
-
} catch (error) {
|
|
346
|
-
const err = error;
|
|
347
|
-
if (err.code === "ENOENT") {
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
throw new TransportError(`File delete error: ${err.code} - ${filePath}`, this.name, {
|
|
351
|
-
cause: err
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
async list(location, options) {
|
|
356
|
-
const dirPath = this.resolvePath(location);
|
|
357
|
-
try {
|
|
358
|
-
let entries;
|
|
359
|
-
if (options?.recursive) {
|
|
360
|
-
entries = await this.listRecursive(dirPath, dirPath);
|
|
361
|
-
} else {
|
|
362
|
-
entries = await readdir(dirPath);
|
|
363
|
-
}
|
|
364
|
-
if (options?.pattern) {
|
|
365
|
-
entries = this.filterByPattern(entries, options.pattern);
|
|
366
|
-
}
|
|
367
|
-
return entries;
|
|
368
|
-
} catch (error) {
|
|
369
|
-
const err = error;
|
|
370
|
-
throw new TransportError(`File list error: ${err.code} - ${dirPath}`, this.name, {
|
|
371
|
-
cause: err
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
async mkdir(location) {
|
|
376
|
-
const dirPath = this.resolvePath(location);
|
|
377
|
-
try {
|
|
378
|
-
await mkdir(dirPath, { recursive: true });
|
|
379
|
-
} catch (error) {
|
|
380
|
-
const err = error;
|
|
381
|
-
throw new TransportError(`File mkdir error: ${err.code} - ${dirPath}`, this.name, {
|
|
382
|
-
cause: err
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
var fileTransport = new FileTransportHandler;
|
|
388
|
-
|
|
389
|
-
class HttpTransportHandler {
|
|
390
|
-
name;
|
|
391
|
-
protocol;
|
|
392
|
-
constructor(protocol = "https") {
|
|
393
|
-
this.protocol = protocol;
|
|
394
|
-
this.name = protocol;
|
|
395
|
-
}
|
|
396
|
-
async get(location, params) {
|
|
397
|
-
const url = this.buildUrl(location, params);
|
|
398
|
-
try {
|
|
399
|
-
const response = await fetch(url);
|
|
400
|
-
if (!response.ok) {
|
|
401
|
-
throw new TransportError(`HTTP ${response.status}: ${response.statusText} - ${url}`, this.name);
|
|
402
|
-
}
|
|
403
|
-
const arrayBuffer = await response.arrayBuffer();
|
|
404
|
-
const content = Buffer.from(arrayBuffer);
|
|
405
|
-
const contentType = response.headers.get("content-type");
|
|
406
|
-
const contentLength = response.headers.get("content-length");
|
|
407
|
-
const lastModified = response.headers.get("last-modified");
|
|
408
|
-
return {
|
|
409
|
-
content,
|
|
410
|
-
metadata: {
|
|
411
|
-
type: "file",
|
|
412
|
-
size: contentLength ? parseInt(contentLength, 10) : content.length,
|
|
413
|
-
modifiedAt: lastModified ? new Date(lastModified) : undefined,
|
|
414
|
-
contentType
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
|
-
} catch (error) {
|
|
418
|
-
if (error instanceof TransportError) {
|
|
419
|
-
throw error;
|
|
420
|
-
}
|
|
421
|
-
throw new TransportError(`Network error: ${url}`, this.name, {
|
|
422
|
-
cause: error
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
buildUrl(location, params) {
|
|
427
|
-
const url = new URL(`${this.protocol}://${location}`);
|
|
428
|
-
if (params) {
|
|
429
|
-
for (const [key, value] of Object.entries(params)) {
|
|
430
|
-
url.searchParams.set(key, value);
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
return url.toString();
|
|
434
|
-
}
|
|
435
|
-
async set(_location, _content, _params) {
|
|
436
|
-
throw new TransportError("HTTP transport is read-only, set not supported", this.name);
|
|
437
|
-
}
|
|
438
|
-
async exists(location) {
|
|
439
|
-
const url = `${this.protocol}://${location}`;
|
|
440
|
-
try {
|
|
441
|
-
const response = await fetch(url, { method: "HEAD" });
|
|
442
|
-
return response.ok;
|
|
443
|
-
} catch {
|
|
444
|
-
return false;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
async delete(_location) {
|
|
448
|
-
throw new TransportError("HTTP transport is read-only, delete not supported", this.name);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
var httpsTransport = new HttpTransportHandler("https");
|
|
452
|
-
var httpTransport = new HttpTransportHandler("http");
|
|
453
|
-
|
|
454
|
-
class ARP {
|
|
455
|
-
transports;
|
|
456
|
-
semantics;
|
|
457
|
-
constructor(config = {}) {
|
|
458
|
-
this.transports = new Map;
|
|
459
|
-
this.semantics = new Map;
|
|
460
|
-
const defaultTransports = [fileTransport, httpTransport, httpsTransport];
|
|
461
|
-
const defaultSemantics = [textSemantic, binarySemantic];
|
|
462
|
-
for (const handler of defaultTransports) {
|
|
463
|
-
this.transports.set(handler.name, handler);
|
|
464
|
-
}
|
|
465
|
-
for (const handler of defaultSemantics) {
|
|
466
|
-
this.semantics.set(handler.name, handler);
|
|
467
|
-
}
|
|
468
|
-
if (config.transports) {
|
|
469
|
-
for (const handler of config.transports) {
|
|
470
|
-
this.transports.set(handler.name, handler);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
if (config.semantics) {
|
|
474
|
-
for (const handler of config.semantics) {
|
|
475
|
-
this.semantics.set(handler.name, handler);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
registerTransport(handler) {
|
|
480
|
-
this.transports.set(handler.name, handler);
|
|
481
|
-
}
|
|
482
|
-
registerSemantic(handler) {
|
|
483
|
-
this.semantics.set(handler.name, handler);
|
|
484
|
-
}
|
|
485
|
-
getTransportHandler(name) {
|
|
486
|
-
const handler = this.transports.get(name);
|
|
487
|
-
if (!handler) {
|
|
488
|
-
throw new TransportError(`Unsupported transport type: ${name}`, name);
|
|
489
|
-
}
|
|
490
|
-
return handler;
|
|
491
|
-
}
|
|
492
|
-
getSemanticHandler(name) {
|
|
493
|
-
const handler = this.semantics.get(name);
|
|
494
|
-
if (!handler) {
|
|
495
|
-
throw new SemanticError(`Unsupported semantic type: ${name}`, name);
|
|
496
|
-
}
|
|
497
|
-
return handler;
|
|
498
|
-
}
|
|
499
|
-
parse(url) {
|
|
500
|
-
if (!url.startsWith("arp:")) {
|
|
501
|
-
throw new ParseError(`Invalid ARP URL: must start with "arp:"`, url);
|
|
502
|
-
}
|
|
503
|
-
const content = url.substring(4);
|
|
504
|
-
const separatorIndex = content.indexOf("://");
|
|
505
|
-
if (separatorIndex === -1) {
|
|
506
|
-
throw new ParseError(`Invalid ARP URL: missing "://"`, url);
|
|
507
|
-
}
|
|
508
|
-
const typePart = content.substring(0, separatorIndex);
|
|
509
|
-
const location = content.substring(separatorIndex + 3);
|
|
510
|
-
const colonIndex = typePart.indexOf(":");
|
|
511
|
-
if (colonIndex === -1) {
|
|
512
|
-
throw new ParseError(`Invalid ARP URL: must have exactly 2 types (semantic:transport)`, url);
|
|
513
|
-
}
|
|
514
|
-
const semantic = typePart.substring(0, colonIndex);
|
|
515
|
-
const transport = typePart.substring(colonIndex + 1);
|
|
516
|
-
if (!semantic) {
|
|
517
|
-
throw new ParseError(`Invalid ARP URL: semantic type cannot be empty`, url);
|
|
518
|
-
}
|
|
519
|
-
if (!transport) {
|
|
520
|
-
throw new ParseError(`Invalid ARP URL: transport type cannot be empty`, url);
|
|
521
|
-
}
|
|
522
|
-
if (!location) {
|
|
523
|
-
throw new ParseError(`Invalid ARP URL: location cannot be empty`, url);
|
|
524
|
-
}
|
|
525
|
-
this.getTransportHandler(transport);
|
|
526
|
-
this.getSemanticHandler(semantic);
|
|
527
|
-
return new ARL(semantic, transport, location, this);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
function createARP(config) {
|
|
531
|
-
return new ARP(config);
|
|
532
|
-
}
|
|
533
|
-
var VERSION = "2.17.2";
|
|
16
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
17
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
18
|
+
}) : x)(function(x) {
|
|
19
|
+
if (typeof require !== "undefined")
|
|
20
|
+
return require.apply(this, arguments);
|
|
21
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// src/arp.ts
|
|
25
|
+
import {
|
|
26
|
+
ARP,
|
|
27
|
+
ARPError,
|
|
28
|
+
BinarySemanticHandler,
|
|
29
|
+
binarySemantic,
|
|
30
|
+
createARP,
|
|
31
|
+
FileTransportHandler,
|
|
32
|
+
fileTransport,
|
|
33
|
+
HttpTransportHandler,
|
|
34
|
+
httpsTransport,
|
|
35
|
+
httpTransport,
|
|
36
|
+
ParseError,
|
|
37
|
+
SemanticError,
|
|
38
|
+
TextSemanticHandler,
|
|
39
|
+
TransportError,
|
|
40
|
+
textSemantic,
|
|
41
|
+
VERSION
|
|
42
|
+
} from "@resourcexjs/arp";
|
|
534
43
|
export {
|
|
535
44
|
textSemantic,
|
|
536
45
|
httpsTransport,
|
|
@@ -550,4 +59,4 @@ export {
|
|
|
550
59
|
ARP
|
|
551
60
|
};
|
|
552
61
|
|
|
553
|
-
//# debugId=
|
|
62
|
+
//# debugId=C5D905594912983064756E2164756E21
|
package/dist/arp.js.map
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../src/arp.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"// src/errors.ts\nclass ARPError extends Error {\n constructor(message, options) {\n super(message, options);\n this.name = \"ARPError\";\n }\n}\n\nclass ParseError extends ARPError {\n url;\n constructor(message, url) {\n super(message);\n this.url = url;\n this.name = \"ParseError\";\n }\n}\n\nclass TransportError extends ARPError {\n transport;\n constructor(message, transport, options) {\n super(message, options);\n this.transport = transport;\n this.name = \"TransportError\";\n }\n}\n\nclass SemanticError extends ARPError {\n semantic;\n constructor(message, semantic, options) {\n super(message, options);\n this.semantic = semantic;\n this.name = \"SemanticError\";\n }\n}\n\n// src/ARL.ts\nclass ARL {\n semantic;\n transport;\n location;\n resolver;\n constructor(semantic, transport, location, resolver) {\n this.semantic = semantic;\n this.transport = transport;\n this.location = location;\n this.resolver = resolver;\n }\n createContext(params) {\n return {\n url: this.toString(),\n semantic: this.semantic,\n transport: this.transport,\n location: this.location,\n timestamp: new Date,\n params\n };\n }\n async resolve(params) {\n const transport = this.resolver.getTransportHandler(this.transport);\n const semantic = this.resolver.getSemanticHandler(this.semantic);\n const context = this.createContext(params);\n return semantic.resolve(transport, this.location, context);\n }\n async deposit(data, params) {\n const transport = this.resolver.getTransportHandler(this.transport);\n const semantic = this.resolver.getSemanticHandler(this.semantic);\n const context = this.createContext(params);\n if (!semantic.deposit) {\n throw new SemanticError(`Semantic \"${semantic.name}\" does not support deposit operation`, this.semantic);\n }\n await semantic.deposit(transport, this.location, data, context);\n }\n async exists() {\n const transport = this.resolver.getTransportHandler(this.transport);\n const semantic = this.resolver.getSemanticHandler(this.semantic);\n const context = this.createContext();\n if (semantic.exists) {\n return semantic.exists(transport, this.location, context);\n }\n return transport.exists(this.location);\n }\n async delete() {\n const transport = this.resolver.getTransportHandler(this.transport);\n const semantic = this.resolver.getSemanticHandler(this.semantic);\n const context = this.createContext();\n if (semantic.delete) {\n return semantic.delete(transport, this.location, context);\n }\n await transport.delete(this.location);\n }\n async list(options) {\n const transport = this.resolver.getTransportHandler(this.transport);\n if (!transport.list) {\n throw new TransportError(`Transport \"${transport.name}\" does not support list operation`, this.transport);\n }\n return transport.list(this.location, options);\n }\n async mkdir() {\n const transport = this.resolver.getTransportHandler(this.transport);\n if (!transport.mkdir) {\n throw new TransportError(`Transport \"${transport.name}\" does not support mkdir operation`, this.transport);\n }\n await transport.mkdir(this.location);\n }\n toString() {\n return `arp:${this.semantic}:${this.transport}://${this.location}`;\n }\n}\n\n// src/semantic/binary.ts\nfunction toBuffer(data) {\n if (Buffer.isBuffer(data)) {\n return data;\n }\n if (data instanceof Uint8Array) {\n return Buffer.from(data);\n }\n if (data instanceof ArrayBuffer) {\n return Buffer.from(data);\n }\n if (Array.isArray(data)) {\n return Buffer.from(data);\n }\n throw new SemanticError(`Unsupported binary input type`, \"binary\");\n}\n\nclass BinarySemanticHandler {\n name = \"binary\";\n async resolve(transport, location, context) {\n const result = await transport.get(location, context.params);\n const meta = {\n url: context.url,\n semantic: context.semantic,\n transport: context.transport,\n location: context.location,\n size: result.metadata?.size ?? result.content.length,\n resolvedAt: context.timestamp.toISOString(),\n type: result.metadata?.type\n };\n return {\n type: \"binary\",\n content: result.content,\n meta\n };\n }\n async deposit(transport, location, data, context) {\n const buffer = toBuffer(data);\n try {\n await transport.set(location, buffer, context.params);\n } catch (error) {\n throw new SemanticError(`Failed to deposit binary to \"${location}\": ${error.message}`, this.name, { cause: error });\n }\n }\n async exists(transport, location, _context) {\n return transport.exists(location);\n }\n async delete(transport, location, _context) {\n try {\n await transport.delete(location);\n } catch (error) {\n throw new SemanticError(`Failed to delete \"${location}\": ${error.message}`, this.name, { cause: error });\n }\n }\n}\nvar binarySemantic = new BinarySemanticHandler;\n// src/semantic/text.ts\nclass TextSemanticHandler {\n name = \"text\";\n async resolve(transport, location, context) {\n const result = await transport.get(location, context.params);\n if (result.metadata?.type === \"directory\") {\n const meta2 = {\n url: context.url,\n semantic: context.semantic,\n transport: context.transport,\n location: context.location,\n size: result.content.length,\n encoding: \"utf-8\",\n mimeType: \"application/json\",\n resolvedAt: context.timestamp.toISOString(),\n type: \"directory\"\n };\n return {\n type: \"text\",\n content: result.content.toString(\"utf-8\"),\n meta: meta2\n };\n }\n const text = result.content.toString(\"utf-8\");\n const meta = {\n url: context.url,\n semantic: context.semantic,\n transport: context.transport,\n location: context.location,\n size: result.metadata?.size ?? result.content.length,\n encoding: \"utf-8\",\n mimeType: \"text/plain\",\n resolvedAt: context.timestamp.toISOString(),\n type: \"file\"\n };\n return {\n type: \"text\",\n content: text,\n meta\n };\n }\n async deposit(transport, location, data, context) {\n const buffer = Buffer.from(data, \"utf-8\");\n try {\n await transport.set(location, buffer, context.params);\n } catch (error) {\n throw new SemanticError(`Failed to deposit text to \"${location}\": ${error.message}`, this.name, { cause: error });\n }\n }\n async exists(transport, location, _context) {\n return transport.exists(location);\n }\n async delete(transport, location, _context) {\n try {\n await transport.delete(location);\n } catch (error) {\n throw new SemanticError(`Failed to delete \"${location}\": ${error.message}`, this.name, { cause: error });\n }\n }\n}\nvar textSemantic = new TextSemanticHandler;\n// src/transport/file.ts\nimport { access, mkdir, readdir, readFile, rm, stat, writeFile } from \"node:fs/promises\";\nimport { dirname, join, resolve } from \"node:path\";\nclass FileTransportHandler {\n name = \"file\";\n resolvePath(location) {\n return resolve(process.cwd(), location);\n }\n async get(location, params) {\n const filePath = this.resolvePath(location);\n try {\n const stats = await stat(filePath);\n if (stats.isDirectory()) {\n return this.getDirectory(filePath, stats, params);\n } else {\n return this.getFile(filePath, stats);\n }\n } catch (error) {\n const err = error;\n throw new TransportError(`File get error: ${err.code} - ${filePath}`, this.name, {\n cause: err\n });\n }\n }\n async getFile(filePath, stats) {\n const content = await readFile(filePath);\n return {\n content,\n metadata: {\n type: \"file\",\n size: Number(stats.size),\n modifiedAt: stats.mtime\n }\n };\n }\n async getDirectory(dirPath, stats, params) {\n const recursive = params?.recursive === \"true\";\n const pattern = params?.pattern;\n let entries;\n if (recursive) {\n entries = await this.listRecursive(dirPath, dirPath);\n } else {\n entries = await readdir(dirPath);\n }\n if (pattern) {\n entries = this.filterByPattern(entries, pattern);\n }\n const content = Buffer.from(JSON.stringify(entries));\n return {\n content,\n metadata: {\n type: \"directory\",\n modifiedAt: stats.mtime\n }\n };\n }\n async listRecursive(basePath, currentPath) {\n const entries = await readdir(currentPath, { withFileTypes: true });\n const results = [];\n for (const entry of entries) {\n const fullPath = join(currentPath, entry.name);\n const relativePath = fullPath.substring(basePath.length + 1);\n if (entry.isDirectory()) {\n const subEntries = await this.listRecursive(basePath, fullPath);\n results.push(...subEntries);\n } else {\n results.push(relativePath);\n }\n }\n return results;\n }\n filterByPattern(entries, pattern) {\n const regexPattern = pattern.replace(/\\./g, \"\\\\.\").replace(/\\*/g, \".*\").replace(/\\?/g, \".\");\n const regex = new RegExp(`^${regexPattern}$`);\n return entries.filter((entry) => {\n const filename = entry.split(\"/\").pop() || entry;\n return regex.test(filename);\n });\n }\n async set(location, content, _params) {\n const filePath = this.resolvePath(location);\n try {\n await mkdir(dirname(filePath), { recursive: true });\n await writeFile(filePath, content);\n } catch (error) {\n const err = error;\n throw new TransportError(`File set error: ${err.code} - ${filePath}`, this.name, {\n cause: err\n });\n }\n }\n async exists(location) {\n const filePath = this.resolvePath(location);\n try {\n await access(filePath);\n return true;\n } catch {\n return false;\n }\n }\n async delete(location) {\n const filePath = this.resolvePath(location);\n try {\n await rm(filePath, { recursive: true });\n } catch (error) {\n const err = error;\n if (err.code === \"ENOENT\") {\n return;\n }\n throw new TransportError(`File delete error: ${err.code} - ${filePath}`, this.name, {\n cause: err\n });\n }\n }\n async list(location, options) {\n const dirPath = this.resolvePath(location);\n try {\n let entries;\n if (options?.recursive) {\n entries = await this.listRecursive(dirPath, dirPath);\n } else {\n entries = await readdir(dirPath);\n }\n if (options?.pattern) {\n entries = this.filterByPattern(entries, options.pattern);\n }\n return entries;\n } catch (error) {\n const err = error;\n throw new TransportError(`File list error: ${err.code} - ${dirPath}`, this.name, {\n cause: err\n });\n }\n }\n async mkdir(location) {\n const dirPath = this.resolvePath(location);\n try {\n await mkdir(dirPath, { recursive: true });\n } catch (error) {\n const err = error;\n throw new TransportError(`File mkdir error: ${err.code} - ${dirPath}`, this.name, {\n cause: err\n });\n }\n }\n}\nvar fileTransport = new FileTransportHandler;\n// src/transport/http.ts\nclass HttpTransportHandler {\n name;\n protocol;\n constructor(protocol = \"https\") {\n this.protocol = protocol;\n this.name = protocol;\n }\n async get(location, params) {\n const url = this.buildUrl(location, params);\n try {\n const response = await fetch(url);\n if (!response.ok) {\n throw new TransportError(`HTTP ${response.status}: ${response.statusText} - ${url}`, this.name);\n }\n const arrayBuffer = await response.arrayBuffer();\n const content = Buffer.from(arrayBuffer);\n const contentType = response.headers.get(\"content-type\");\n const contentLength = response.headers.get(\"content-length\");\n const lastModified = response.headers.get(\"last-modified\");\n return {\n content,\n metadata: {\n type: \"file\",\n size: contentLength ? parseInt(contentLength, 10) : content.length,\n modifiedAt: lastModified ? new Date(lastModified) : undefined,\n contentType\n }\n };\n } catch (error) {\n if (error instanceof TransportError) {\n throw error;\n }\n throw new TransportError(`Network error: ${url}`, this.name, {\n cause: error\n });\n }\n }\n buildUrl(location, params) {\n const url = new URL(`${this.protocol}://${location}`);\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n url.searchParams.set(key, value);\n }\n }\n return url.toString();\n }\n async set(_location, _content, _params) {\n throw new TransportError(\"HTTP transport is read-only, set not supported\", this.name);\n }\n async exists(location) {\n const url = `${this.protocol}://${location}`;\n try {\n const response = await fetch(url, { method: \"HEAD\" });\n return response.ok;\n } catch {\n return false;\n }\n }\n async delete(_location) {\n throw new TransportError(\"HTTP transport is read-only, delete not supported\", this.name);\n }\n}\nvar httpsTransport = new HttpTransportHandler(\"https\");\nvar httpTransport = new HttpTransportHandler(\"http\");\n// src/ARP.ts\nclass ARP {\n transports;\n semantics;\n constructor(config = {}) {\n this.transports = new Map;\n this.semantics = new Map;\n const defaultTransports = [fileTransport, httpTransport, httpsTransport];\n const defaultSemantics = [textSemantic, binarySemantic];\n for (const handler of defaultTransports) {\n this.transports.set(handler.name, handler);\n }\n for (const handler of defaultSemantics) {\n this.semantics.set(handler.name, handler);\n }\n if (config.transports) {\n for (const handler of config.transports) {\n this.transports.set(handler.name, handler);\n }\n }\n if (config.semantics) {\n for (const handler of config.semantics) {\n this.semantics.set(handler.name, handler);\n }\n }\n }\n registerTransport(handler) {\n this.transports.set(handler.name, handler);\n }\n registerSemantic(handler) {\n this.semantics.set(handler.name, handler);\n }\n getTransportHandler(name) {\n const handler = this.transports.get(name);\n if (!handler) {\n throw new TransportError(`Unsupported transport type: ${name}`, name);\n }\n return handler;\n }\n getSemanticHandler(name) {\n const handler = this.semantics.get(name);\n if (!handler) {\n throw new SemanticError(`Unsupported semantic type: ${name}`, name);\n }\n return handler;\n }\n parse(url) {\n if (!url.startsWith(\"arp:\")) {\n throw new ParseError(`Invalid ARP URL: must start with \"arp:\"`, url);\n }\n const content = url.substring(4);\n const separatorIndex = content.indexOf(\"://\");\n if (separatorIndex === -1) {\n throw new ParseError(`Invalid ARP URL: missing \"://\"`, url);\n }\n const typePart = content.substring(0, separatorIndex);\n const location = content.substring(separatorIndex + 3);\n const colonIndex = typePart.indexOf(\":\");\n if (colonIndex === -1) {\n throw new ParseError(`Invalid ARP URL: must have exactly 2 types (semantic:transport)`, url);\n }\n const semantic = typePart.substring(0, colonIndex);\n const transport = typePart.substring(colonIndex + 1);\n if (!semantic) {\n throw new ParseError(`Invalid ARP URL: semantic type cannot be empty`, url);\n }\n if (!transport) {\n throw new ParseError(`Invalid ARP URL: transport type cannot be empty`, url);\n }\n if (!location) {\n throw new ParseError(`Invalid ARP URL: location cannot be empty`, url);\n }\n this.getTransportHandler(transport);\n this.getSemanticHandler(semantic);\n return new ARL(semantic, transport, location, this);\n }\n}\nfunction createARP(config) {\n return new ARP(config);\n}\n\n// src/index.ts\nvar VERSION = \"2.17.2\";\nexport {\n textSemantic,\n httpsTransport,\n httpTransport,\n fileTransport,\n createARP,\n binarySemantic,\n VERSION,\n TransportError,\n TextSemanticHandler,\n SemanticError,\n ParseError,\n HttpTransportHandler,\n FileTransportHandler,\n BinarySemanticHandler,\n ARPError,\n ARP\n};\n\n//# debugId=E80F29B5EAF135F664756E2164756E21\n"
|
|
5
|
+
"/**\n * ARP (Agent Resource Protocol) - Re-exported from @resourcexjs/arp\n *\n * @example\n * ```typescript\n * import { createARP } from \"resourcexjs/arp\";\n *\n * const arp = createARP();\n * const arl = arp.parse(\"arp:text:file:///path/to/file.txt\");\n * const resource = await arl.resolve();\n * ```\n *\n * For more details, see @resourcexjs/arp documentation.\n */\n\n// Re-export everything from @resourcexjs/arp\nexport {\n type ARI,\n type ARL,\n ARP,\n type ARPConfig,\n ARPError,\n type BinaryInput,\n type BinaryResource,\n BinarySemanticHandler,\n binarySemantic,\n createARP,\n FileTransportHandler,\n fileTransport,\n HttpTransportHandler,\n httpsTransport,\n httpTransport,\n ParseError,\n type Resource,\n type ResourceMeta,\n type SemanticContext,\n SemanticError,\n type SemanticHandler,\n type TextResource,\n TextSemanticHandler,\n TransportError,\n type TransportHandler,\n type TransportParams,\n type TransportResult,\n textSemantic,\n VERSION,\n} from \"@resourcexjs/arp\";\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAmOA;AACA;AAAA;AAnOA,MAAM,iBAAiB,MAAM;AAAA,EAC3B,WAAW,CAAC,SAAS,SAAS;AAAA,IAC5B,MAAM,SAAS,OAAO;AAAA,IACtB,KAAK,OAAO;AAAA;AAEhB;AAAA;AAEA,MAAM,mBAAmB,SAAS;AAAA,EAChC;AAAA,EACA,WAAW,CAAC,SAAS,KAAK;AAAA,IACxB,MAA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AAAA,IACnD,IAAI,CAAC,UAAU;AAAA,MACb,MAAM,IAAI,WAAW,kDAAkD,GAAG;AAAA,IAC5E;AAAA,IACA,IAAI,CAAC,WAAW;AAAA,MACd,MAAM,IAAI,WAAW,mDAAmD,GAAG;AAAA,IAC7E;AAAA,IACA,IAAI,CAAC,UAAU;AAAA,MACb,MAAM,IAAI,WAAW,6CAA6C,GAAG;AAAA,IACvE;AAAA,IACA,KAAK,oBAAoB,SAAS;AAAA,IAClC,KAAK,mBAAmB,QAAQ;AAAA,IAChC,OAAO,IAAI,IAAI,UAAU,WAAW,UAAU,IAAI;AAAA;AAEtD;AACA,SAAS,SAAS,CAAC,QAAQ;AAAA,EACzB,OAAO,IAAI,IAAI,MAAM;AAAA;AAIvB,IAAI,UAAU;",
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAgBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
8
|
+
"debugId": "C5D905594912983064756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BundledType as BundledType2, FileEntry, FileTree, IsolatorType as IsolatorType2, ProviderConfig, ProviderStores, RegistryEntry as RegistryEntry2, ResolveSourceConfig, ResourceXProvider as ResourceXProvider2, RXA, RXD, RXI, RXL as RXL2, RXM as RXM2, RXMArchive as RXMArchive2, RXMDefinition as RXMDefinition2, RXMSource as RXMSource2, RXR, RXS, SourceLoader, TypeDetectionResult, TypeDetector as TypeDetector2 } from "@resourcexjs/core";
|
|
2
|
-
import { archive,
|
|
1
|
+
import { BundledType as BundledType2, CustomExecutor as CustomExecutor2, FileEntry, FileTree, IsolatorType as IsolatorType2, ProviderConfig, ProviderStores, RegistryEntry as RegistryEntry2, ResolveSourceConfig, ResourceXProvider as ResourceXProvider2, RXA, RXD, RXI, RXL as RXL2, RXM as RXM2, RXMArchive as RXMArchive2, RXMDefinition as RXMDefinition2, RXMSource as RXMSource2, RXR, RXS, SourceLoader, TypeDetectionResult, TypeDetector as TypeDetector2 } from "@resourcexjs/core";
|
|
2
|
+
import { archive, extract, format, GitHubSourceLoader, generateDefinition, manifest, parse, RegistryError, ResourceJsonDetector, ResourceTypeError, resolveSource, resource, SkillDetector, SourceLoaderChain, TypeDetectorChain, wrap } from "@resourcexjs/core";
|
|
3
3
|
import { ResourceXProvider } from "@resourcexjs/core";
|
|
4
4
|
/**
|
|
5
5
|
* Set the global ResourceX provider.
|
|
@@ -30,7 +30,7 @@ declare function hasProvider(): boolean;
|
|
|
30
30
|
* Clear the provider (for testing).
|
|
31
31
|
*/
|
|
32
32
|
declare function clearProvider(): void;
|
|
33
|
-
import { BundledType, IsolatorType, RegistryEntry, RXL, RXM, RXMArchive, RXMDefinition, RXMSource, TypeDetector } from "@resourcexjs/core";
|
|
33
|
+
import { BundledType, CustomExecutor, IsolatorType, RegistryEntry, RXL, RXM, RXMArchive, RXMDefinition, RXMSource, TypeDetector } from "@resourcexjs/core";
|
|
34
34
|
/**
|
|
35
35
|
* ResourceX configuration.
|
|
36
36
|
*/
|
|
@@ -55,6 +55,11 @@ interface ResourceXConfig {
|
|
|
55
55
|
*/
|
|
56
56
|
isolator?: IsolatorType;
|
|
57
57
|
/**
|
|
58
|
+
* Custom executor function for resolver execution.
|
|
59
|
+
* Required when isolator is set to "custom".
|
|
60
|
+
*/
|
|
61
|
+
executor?: CustomExecutor;
|
|
62
|
+
/**
|
|
58
63
|
* Custom type detectors for auto-detection.
|
|
59
64
|
* Built-in detectors (resource.json, SKILL.md) are always included.
|
|
60
65
|
*/
|
|
@@ -111,4 +116,4 @@ interface ResourceX {
|
|
|
111
116
|
*/
|
|
112
117
|
declare function createResourceX(config?: ResourceXConfig): ResourceX;
|
|
113
118
|
declare const VERSION: string;
|
|
114
|
-
export { wrap, setProvider, resource, resolveSource, parse, manifest, hasProvider, getProvider, generateDefinition, format, extract, createResourceX, clearProvider,
|
|
119
|
+
export { wrap, setProvider, resource, resolveSource, parse, manifest, hasProvider, getProvider, generateDefinition, format, extract, createResourceX, clearProvider, archive, VERSION, TypeDetectorChain, TypeDetector2 as TypeDetector, TypeDetectionResult, SourceLoaderChain, SourceLoader, SkillDetector, ResourceXProvider2 as ResourceXProvider, ResourceXConfig, ResourceX, ResourceTypeError, ResourceJsonDetector, Resource, ResolveSourceConfig, RegistryOptions, RegistryError, RegistryEntry2 as RegistryEntry, RXS, RXR, RXMSource2 as RXMSource, RXMDefinition2 as RXMDefinition, RXMArchive2 as RXMArchive, RXM2 as RXM, RXL2 as RXL, RXI, RXD, RXA, ProviderStores, ProviderConfig, IsolatorType2 as IsolatorType, GitHubSourceLoader, FileTree, FileEntry, CustomExecutor2 as CustomExecutor, BundledType2 as BundledType };
|