@resourcexjs/core 2.7.0 → 2.9.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/index.d.ts CHANGED
@@ -1,23 +1,22 @@
1
1
  /**
2
- * ResourceX Error hierarchy
2
+ * RXA - ResourceX Archive
3
+ *
4
+ * Archive container (tar.gz format) for storage and transfer.
3
5
  */
4
- declare class ResourceXError extends Error {
5
- constructor(message: string, options?: ErrorOptions);
6
- }
7
- declare class LocatorError extends ResourceXError {
8
- readonly locator?: string;
9
- constructor(message: string, locator?: string);
10
- }
11
- declare class ManifestError extends ResourceXError {
12
- constructor(message: string);
13
- }
14
- declare class ContentError extends ResourceXError {
15
- constructor(message: string);
16
- }
17
- declare class DefinitionError extends ResourceXError {
18
- constructor(message: string);
6
+ interface RXA {
7
+ /** Content as a readable stream (tar.gz format) */
8
+ readonly stream: ReadableStream<Uint8Array>;
9
+ /** Get raw archive buffer (tar.gz format) */
10
+ buffer(): Promise<Buffer>;
19
11
  }
20
12
  /**
13
+ * Create RXA from files.
14
+ *
15
+ * @param files - Record of file paths to Buffer contents
16
+ * @returns RXA archive object
17
+ */
18
+ declare function archive(files: Record<string, Buffer>): Promise<RXA>;
19
+ /**
21
20
  * RXD - ResourceX Definition
22
21
  *
23
22
  * The content of resource.json file.
@@ -37,6 +36,21 @@ interface RXD {
37
36
  readonly [key: string]: unknown;
38
37
  }
39
38
  /**
39
+ * Parse and validate a resource definition (resource.json content).
40
+ *
41
+ * @param input - The raw JSON object to parse
42
+ * @returns A validated RXD object
43
+ * @throws DefinitionError if validation fails
44
+ */
45
+ declare function define(input: unknown): RXD;
46
+ /**
47
+ * Extract files from RXA.
48
+ *
49
+ * @param rxa - Resource archive
50
+ * @returns Record of file paths to Buffer contents
51
+ */
52
+ declare function extract(rxa: RXA): Promise<Record<string, Buffer>>;
53
+ /**
40
54
  * RXL - ResourceX Locator
41
55
  *
42
56
  * Unique identifier for a resource (pure data object).
@@ -62,62 +76,73 @@ interface RXL {
62
76
  readonly tag: string;
63
77
  }
64
78
  /**
79
+ * Format RXL to locator string.
80
+ *
81
+ * Docker-style format: [registry/][path/]name[:tag]
82
+ *
83
+ * Examples:
84
+ * - { name: "hello", tag: "latest" } → "hello" (omit :latest)
85
+ * - { name: "hello", tag: "1.0.0" } → "hello:1.0.0"
86
+ * - { registry: "localhost:3098", name: "hello", tag: "1.0.0" } → "localhost:3098/hello:1.0.0"
87
+ *
88
+ * @param rxl - Resource locator
89
+ * @returns Locator string
90
+ */
91
+ declare function format(rxl: RXL): string;
92
+ /**
65
93
  * RXM - ResourceX Manifest
66
94
  *
67
- * Resource metadata stored within the resource (pure data object).
95
+ * Resource context representation organized by RX primitives.
96
+ * Structure: definition (RXD) + archive (RXA) + source (RXS)
68
97
  */
69
- interface RXM {
70
- readonly registry?: string;
71
- readonly path?: string;
98
+ /**
99
+ * RXM Definition — what the resource IS.
100
+ * Sourced from RXD (resource.json).
101
+ */
102
+ interface RXMDefinition {
72
103
  readonly name: string;
73
104
  readonly type: string;
74
105
  readonly tag: string;
75
- readonly files?: string[];
106
+ readonly registry?: string;
107
+ readonly path?: string;
108
+ readonly description?: string;
109
+ readonly author?: string;
110
+ readonly license?: string;
111
+ readonly keywords?: string[];
112
+ readonly repository?: string;
76
113
  }
77
114
  /**
78
- * RXA - ResourceX Archive
79
- *
80
- * Archive container (tar.gz format) for storage and transfer.
115
+ * RXM Archive packaging metadata.
116
+ * Placeholder for future fields (digest, size, md5, etc.)
81
117
  */
82
- interface RXA {
83
- /** Content as a readable stream (tar.gz format) */
84
- readonly stream: ReadableStream<Uint8Array>;
85
- /** Get raw archive buffer (tar.gz format) */
86
- buffer(): Promise<Buffer>;
87
- }
118
+ type RXMArchive = {};
88
119
  /**
89
- * RXR - ResourceX Resource
90
- *
91
- * Complete resource object combining locator, manifest, and archive.
120
+ * File entry with metadata.
92
121
  */
93
- interface RXR {
94
- readonly locator: RXL;
95
- readonly manifest: RXM;
96
- readonly archive: RXA;
122
+ interface FileEntry {
123
+ readonly size: number;
97
124
  }
98
125
  /**
99
- * Parse and validate a resource definition (resource.json content).
100
- *
101
- * @param input - The raw JSON object to parse
102
- * @returns A validated RXD object
103
- * @throws DefinitionError if validation fails
104
- */
105
- declare function define(input: unknown): RXD;
106
- /**
107
- * Create RXM from RXD.
108
- * Extracts only the core metadata fields (pure data object).
109
- *
110
- * @param rxd - Resource definition
111
- * @returns RXM manifest object
126
+ * Recursive file tree structure.
127
+ * Keys ending with '/' are directories containing nested FileTree.
128
+ * Other keys are files with FileEntry metadata.
112
129
  */
113
- declare function manifest(rxd: RXD): RXM;
130
+ type FileTree = {
131
+ readonly [key: string]: FileEntry | FileTree
132
+ };
114
133
  /**
115
- * Create RXA from files.
116
- *
117
- * @param files - Record of file paths to Buffer contents
118
- * @returns RXA archive object
134
+ * RXM Source what's IN the resource.
135
+ * File structure and content preview.
119
136
  */
120
- declare function archive(files: Record<string, Buffer>): Promise<RXA>;
137
+ interface RXMSource {
138
+ readonly files?: FileTree;
139
+ readonly preview?: string;
140
+ }
141
+ interface RXM {
142
+ readonly definition: RXMDefinition;
143
+ readonly archive: RXMArchive;
144
+ readonly source: RXMSource;
145
+ }
121
146
  /**
122
147
  * Create RXL from RXM.
123
148
  *
@@ -126,34 +151,13 @@ declare function archive(files: Record<string, Buffer>): Promise<RXA>;
126
151
  */
127
152
  declare function locate(rxm: RXM): RXL;
128
153
  /**
129
- * Create RXR from RXM and RXA.
130
- *
131
- * @param rxm - Resource manifest
132
- * @param rxa - Resource archive
133
- * @returns RXR resource object
134
- */
135
- declare function resource(rxm: RXM, rxa: RXA): RXR;
136
- /**
137
- * Extract files from RXA.
138
- *
139
- * @param rxa - Resource archive
140
- * @returns Record of file paths to Buffer contents
141
- */
142
- declare function extract(rxa: RXA): Promise<Record<string, Buffer>>;
143
- /**
144
- * Format RXL to locator string.
145
- *
146
- * Docker-style format: [registry/][path/]name[:tag]
147
- *
148
- * Examples:
149
- * - { name: "hello", tag: "latest" } → "hello" (omit :latest)
150
- * - { name: "hello", tag: "1.0.0" } → "hello:1.0.0"
151
- * - { registry: "localhost:3098", name: "hello", tag: "1.0.0" } → "localhost:3098/hello:1.0.0"
154
+ * Create RXM from RXD.
155
+ * Maps RXD fields into the structured RXM format.
152
156
  *
153
- * @param rxl - Resource locator
154
- * @returns Locator string
157
+ * @param rxd - Resource definition
158
+ * @returns RXM manifest object
155
159
  */
156
- declare function format(rxl: RXL): string;
160
+ declare function manifest(rxd: RXD): RXM;
157
161
  /**
158
162
  * Parse locator string to RXL.
159
163
  *
@@ -171,6 +175,39 @@ declare function format(rxl: RXL): string;
171
175
  */
172
176
  declare function parse(locator: string): RXL;
173
177
  /**
178
+ * RXR - ResourceX Resource
179
+ *
180
+ * Complete resource object combining locator, manifest, and archive.
181
+ */
182
+ interface RXR {
183
+ readonly locator: RXL;
184
+ readonly manifest: RXM;
185
+ readonly archive: RXA;
186
+ }
187
+ /**
188
+ * Create RXR from RXM and RXA.
189
+ *
190
+ * @param rxm - Resource manifest
191
+ * @param rxa - Resource archive
192
+ * @returns RXR resource object
193
+ */
194
+ declare function resource(rxm: RXM, rxa: RXA): RXR;
195
+ /**
196
+ * RXS - ResourceX Source
197
+ *
198
+ * Intermediate representation of raw files from any source.
199
+ * Produced by SourceLoader, consumed by TypeDetectorChain.
200
+ *
201
+ * Unlike RXR (which is fully packaged), RXS is pre-detection:
202
+ * the files have been loaded but the type and metadata are unknown.
203
+ */
204
+ interface RXS {
205
+ /** Original source identifier (path, URL, etc.) */
206
+ readonly source: string;
207
+ /** Raw files loaded from source: relative path -> content */
208
+ readonly files: Record<string, Buffer>;
209
+ }
210
+ /**
174
211
  * Wrap existing tar.gz buffer as RXA.
175
212
  *
176
213
  * @param buffer - Existing tar.gz buffer
@@ -178,243 +215,178 @@ declare function parse(locator: string): RXL;
178
215
  */
179
216
  declare function wrap(buffer: Buffer): RXA;
180
217
  /**
181
- * Isolator type for resolver execution.
182
- * Matches SandboX isolator types directly.
183
- * Configured at Registry level, not per-type.
218
+ * TypeDetector - Strategy interface for detecting resource type from files.
184
219
  *
185
- * - "none": No isolation, fastest (~10ms), for development
186
- * - "srt": OS-level isolation (~50ms), secure local dev
187
- * - "cloudflare": Container isolation (~100ms), local Docker or edge
188
- * - "e2b": MicroVM isolation (~150ms), production (planned)
220
+ * Detectors examine file contents and structure to determine
221
+ * the resource type and extract metadata.
189
222
  */
190
- type IsolatorType = "none" | "srt" | "cloudflare" | "e2b";
191
223
  /**
192
- * ResolveContext - Pure data context passed to resolver in sandbox.
193
- *
194
- * This is a serializable data structure that replaces RXR for sandbox execution.
195
- * The executor pre-processes RXR (extracts files) before passing to resolver.
224
+ * Result of type detection.
225
+ * Fields map directly to RXD fields for generateDefinition().
196
226
  */
197
- interface ResolveContext {
198
- /**
199
- * Resource manifest metadata.
200
- */
201
- manifest: {
202
- domain: string
203
- path?: string
204
- name: string
205
- type: string
206
- version: string
207
- };
227
+ interface TypeDetectionResult {
228
+ /** Detected resource type (e.g., "skill", "text") */
229
+ readonly type: string;
230
+ /** Detected resource name */
231
+ readonly name: string;
232
+ /** Tag/version (defaults to "latest" if not provided) */
233
+ readonly tag?: string;
234
+ /** Description extracted from content */
235
+ readonly description?: string;
236
+ /** Registry for the resource */
237
+ readonly registry?: string;
238
+ /** Path within registry */
239
+ readonly path?: string;
240
+ /** Author information */
241
+ readonly author?: string;
242
+ /** License information */
243
+ readonly license?: string;
244
+ /** Keywords for searchability */
245
+ readonly keywords?: string[];
246
+ /** Repository URL */
247
+ readonly repository?: string;
208
248
  /**
209
- * Extracted files from archive.
210
- * Key is file path, value is file content as Uint8Array.
249
+ * Files to exclude from the content archive.
250
+ * E.g., ["resource.json"] metadata files, not content.
211
251
  */
212
- files: Record<string, Uint8Array>;
252
+ readonly excludeFromContent?: string[];
213
253
  }
214
254
  /**
215
- * BundledType - Pre-bundled resource type ready for execution.
216
- * Contains bundled code string instead of closure.
255
+ * TypeDetector - detects resource type from raw files.
217
256
  *
218
- * Note: Sandbox isolation is configured at Registry level via createRegistry({ sandbox: ... })
257
+ * Follows the Chain of Responsibility pattern (like TypeHandlerChain).
219
258
  */
220
- interface BundledType {
259
+ interface TypeDetector {
260
+ /** Detector name (for debugging and logging) */
261
+ readonly name: string;
221
262
  /**
222
- * Type name (e.g., "text", "json", "prompt").
263
+ * Detect the resource type from the given files.
264
+ *
265
+ * @param files - Raw files from the source
266
+ * @param source - Original source identifier (for deriving name)
267
+ * @returns Detection result, or null if this detector cannot handle the files
223
268
  */
224
- name: string;
269
+ detect(files: Record<string, Buffer>, source: string): TypeDetectionResult | null;
270
+ }
271
+ /**
272
+ * Generate an RXD from a TypeDetectionResult.
273
+ *
274
+ * Maps detection result fields to the RXD schema and validates
275
+ * through the existing define() function.
276
+ *
277
+ * @param result - Detection result from TypeDetectorChain
278
+ * @returns Validated RXD
279
+ * @throws DefinitionError if the result produces invalid RXD
280
+ */
281
+ declare function generateDefinition(result: TypeDetectionResult): RXD;
282
+ /**
283
+ * ResourceJsonDetector - Detects resources with an explicit resource.json.
284
+ *
285
+ * Highest-priority detector. When resource.json exists,
286
+ * it takes precedence over all other detectors.
287
+ */
288
+ declare class ResourceJsonDetector implements TypeDetector {
289
+ readonly name = "resource-json";
290
+ detect(files: Record<string, Buffer>, _source: string): TypeDetectionResult | null;
291
+ }
292
+ /**
293
+ * SkillDetector - Detects Agent Skill resources from SKILL.md.
294
+ *
295
+ * Pattern:
296
+ * - Required: SKILL.md file
297
+ * - Optional: references/ directory
298
+ *
299
+ * SKILL.md is content (kept in archive), not metadata.
300
+ */
301
+ declare class SkillDetector implements TypeDetector {
302
+ readonly name = "skill";
303
+ detect(files: Record<string, Buffer>, source: string): TypeDetectionResult | null;
225
304
  /**
226
- * Alternative names for this type.
305
+ * Extract description from the first markdown heading.
227
306
  */
228
- aliases?: string[];
307
+ private extractDescription;
308
+ }
309
+ /**
310
+ * TypeDetectorChain - Chain of type detectors.
311
+ *
312
+ * Follows the same pattern as TypeHandlerChain:
313
+ * - Static create() factory with built-in detectors
314
+ * - Extensible via register()
315
+ * - First match wins
316
+ *
317
+ * Detection order:
318
+ * 1. ResourceJsonDetector (explicit resource.json always wins)
319
+ * 2. SkillDetector (SKILL.md pattern)
320
+ * 3. Custom detectors (registered in order)
321
+ */
322
+ declare class TypeDetectorChain {
323
+ private readonly detectors;
324
+ private constructor();
229
325
  /**
230
- * Human-readable description.
326
+ * Create a new TypeDetectorChain with built-in detectors.
231
327
  */
232
- description: string;
328
+ static create(): TypeDetectorChain;
233
329
  /**
234
- * JSON Schema for resolver arguments.
330
+ * Register a custom detector.
331
+ * Custom detectors are appended after built-in detectors.
235
332
  */
236
- schema?: JSONSchema;
333
+ register(detector: TypeDetector): void;
237
334
  /**
238
- * Bundled resolver code (executable in sandbox).
335
+ * Detect type from files.
336
+ *
337
+ * @param files - Raw files from the source
338
+ * @param source - Original source identifier
339
+ * @returns Detection result
340
+ * @throws ResourceXError if no detector matches
239
341
  */
240
- code: string;
342
+ detect(files: Record<string, Buffer>, source: string): TypeDetectionResult;
241
343
  }
242
344
  /**
243
- * JSON Schema property definition.
345
+ * ResourceX Error hierarchy
244
346
  */
245
- interface JSONSchemaProperty {
246
- type: "string" | "number" | "integer" | "boolean" | "object" | "array" | "null";
247
- description?: string;
248
- default?: unknown;
249
- enum?: unknown[];
250
- items?: JSONSchemaProperty;
251
- properties?: Record<string, JSONSchemaProperty>;
252
- required?: string[];
347
+ declare class ResourceXError extends Error {
348
+ constructor(message: string, options?: ErrorOptions);
253
349
  }
254
- /**
255
- * JSON Schema definition for resolver arguments.
256
- * Used by UI to render parameter forms.
257
- */
258
- interface JSONSchema extends JSONSchemaProperty {
259
- $schema?: string;
260
- title?: string;
350
+ declare class LocatorError extends ResourceXError {
351
+ readonly locator?: string;
352
+ constructor(message: string, locator?: string);
261
353
  }
262
- /**
263
- * ResolvedResource - Structured result object returned by resolver.
264
- * Contains execute function, original resource, and optional schema for UI rendering.
265
- */
266
- interface ResolvedResource<
267
- TArgs = void,
268
- TResult = unknown
269
- > {
270
- /**
271
- * Original resource object (RXR from @resourcexjs/core).
272
- */
273
- resource: unknown;
274
- /**
275
- * Execute function to get the resource content.
276
- * - For static resources (text/json/binary): call with no arguments
277
- * - For dynamic resources (tool): call with arguments
278
- */
279
- execute: (args?: TArgs) => TResult | Promise<TResult>;
280
- /**
281
- * JSON Schema for the arguments (undefined if no arguments needed).
282
- * UI uses this to render parameter forms.
283
- */
284
- schema: TArgs extends void ? undefined : JSONSchema;
285
- }
286
- /**
287
- * ResourceResolver - Transforms resource into a structured result object.
288
- * The execute function is lazy-loaded: content is only read when called.
289
- */
290
- interface ResourceResolver<
291
- TArgs = void,
292
- TResult = unknown
293
- > {
294
- /**
295
- * JSON Schema for arguments (required if TArgs is not void).
296
- * This constraint ensures type safety at definition time.
297
- */
298
- schema: TArgs extends void ? undefined : JSONSchema;
299
- /**
300
- * Resolve resource into a structured result object.
301
- * @param rxr - RXR object from @resourcexjs/core
302
- */
303
- resolve(rxr: unknown): Promise<ResolvedResource<TArgs, TResult>>;
354
+ declare class ManifestError extends ResourceXError {
355
+ constructor(message: string);
304
356
  }
305
- /**
306
- * ResourceType - Defines how a resource type is handled.
307
- */
308
- interface ResourceType<
309
- TArgs = void,
310
- TResult = unknown
311
- > {
312
- /**
313
- * Type name (e.g., "text", "json", "binary").
314
- */
315
- name: string;
316
- /**
317
- * Alternative names for this type (e.g., ["txt", "plaintext"]).
318
- */
319
- aliases?: string[];
320
- /**
321
- * Human-readable description.
322
- */
323
- description: string;
324
- /**
325
- * Resolver to transform RXR into structured result object.
326
- */
327
- resolver: ResourceResolver<TArgs, TResult>;
357
+ declare class ContentError extends ResourceXError {
358
+ constructor(message: string);
328
359
  }
329
- /**
330
- * Bundle a resource type from a source file.
331
- *
332
- * @param sourcePath - Path to the .type.ts file
333
- * @param basePath - Base path for resolving relative paths (defaults to cwd)
334
- * @returns BundledType ready for registry
335
- *
336
- * @example
337
- * ```typescript
338
- * const promptType = await bundleResourceType("./prompt.type.ts");
339
- * ```
340
- */
341
- declare function bundleResourceType(sourcePath: string, basePath?: string): Promise<BundledType>;
342
- /**
343
- * Resource type related error.
344
- */
345
- declare class ResourceTypeError extends ResourceXError {
360
+ declare class DefinitionError extends ResourceXError {
346
361
  constructor(message: string);
347
362
  }
348
363
  /**
349
- * TypeHandlerChain - Manages resource type registration.
350
- *
351
- * Responsibilities:
352
- * - Register types (name + aliases)
353
- * - Look up types by name
354
- *
355
- * Execution is delegated to ResolverExecutor (in registry package).
356
- *
357
- * Built-in types (text, json, binary) are registered by default.
364
+ * ResourceLoader - Strategy interface for loading resources from different sources.
358
365
  */
359
- declare class TypeHandlerChain {
360
- private handlers;
361
- private constructor();
362
- /**
363
- * Create a new TypeHandlerChain instance.
364
- * Built-in types (text, json, binary) are included by default.
365
- */
366
- static create(): TypeHandlerChain;
367
- /**
368
- * Internal registration (no duplicate check).
369
- */
370
- private registerInternal;
371
- /**
372
- * Register a type.
373
- * @throws ResourceTypeError if type is already registered
374
- */
375
- register(type: BundledType): void;
376
- /**
377
- * Check if a type is supported.
378
- */
379
- canHandle(typeName: string): boolean;
380
- /**
381
- * Get handler for a type.
382
- * @throws ResourceTypeError if type is not supported
383
- */
384
- getHandler(typeName: string): BundledType;
385
- /**
386
- * Get handler for a type, or undefined if not found.
387
- */
388
- getHandlerOrUndefined(typeName: string): BundledType | undefined;
366
+ interface ResourceLoader {
389
367
  /**
390
- * Get all supported type names (including aliases).
368
+ * Check if this loader can handle the given source.
369
+ *
370
+ * @param source - Source path or identifier
371
+ * @returns true if this loader can handle the source
391
372
  */
392
- getSupportedTypes(): string[];
373
+ canLoad(source: string): boolean | Promise<boolean>;
393
374
  /**
394
- * Clear all registered types (for testing).
375
+ * Load a resource from the given source.
376
+ *
377
+ * @param source - Source path or identifier
378
+ * @returns Complete RXR object
379
+ * @throws ResourceXError if loading fails
395
380
  */
396
- clear(): void;
381
+ load(source: string): Promise<RXR>;
397
382
  }
398
383
  /**
399
- * Plain text content
400
- */
401
- declare const textType: BundledType;
402
- /**
403
- * JSON content
404
- */
405
- declare const jsonType: BundledType;
406
- /**
407
- * Binary content
408
- */
409
- declare const binaryType: BundledType;
410
- /**
411
- * All built-in types as an array.
412
- */
413
- declare const builtinTypes: BundledType[];
414
- /**
415
- * ResourceLoader - Strategy interface for loading resources from different sources.
384
+ * SourceLoader - Strategy interface for loading raw files from a source.
385
+ *
386
+ * Unlike ResourceLoader (which produces a complete RXR),
387
+ * SourceLoader produces an RXS (raw files) for type detection.
416
388
  */
417
- interface ResourceLoader {
389
+ interface SourceLoader {
418
390
  /**
419
391
  * Check if this loader can handle the given source.
420
392
  *
@@ -423,13 +395,13 @@ interface ResourceLoader {
423
395
  */
424
396
  canLoad(source: string): boolean | Promise<boolean>;
425
397
  /**
426
- * Load a resource from the given source.
398
+ * Load raw files from the given source.
427
399
  *
428
400
  * @param source - Source path or identifier
429
- * @returns Complete RXR object
401
+ * @returns RXS with raw files
430
402
  * @throws ResourceXError if loading fails
431
403
  */
432
- load(source: string): Promise<RXR>;
404
+ load(source: string): Promise<RXS>;
433
405
  }
434
406
  /**
435
407
  * Default ResourceLoader implementation for loading resources from folders.
@@ -463,6 +435,39 @@ declare class FolderLoader implements ResourceLoader {
463
435
  private readFolderFiles;
464
436
  }
465
437
  /**
438
+ * FolderSourceLoader - Loads raw files from a folder into RXS.
439
+ *
440
+ * Unlike FolderLoader (which requires resource.json and produces RXR),
441
+ * FolderSourceLoader loads ALL files from a folder without interpreting them.
442
+ * Type detection happens downstream via TypeDetectorChain.
443
+ */
444
+ declare class FolderSourceLoader implements SourceLoader {
445
+ canLoad(source: string): Promise<boolean>;
446
+ load(source: string): Promise<RXS>;
447
+ /**
448
+ * Recursively read all files in a folder.
449
+ */
450
+ private readFolderFiles;
451
+ }
452
+ /**
453
+ * GitHubSourceLoader - Loads raw files from a GitHub directory into RXS.
454
+ *
455
+ * Fetches files via the GitHub Contents API (no authentication required
456
+ * for public repositories).
457
+ */
458
+ declare class GitHubSourceLoader implements SourceLoader {
459
+ canLoad(source: string): boolean;
460
+ load(source: string): Promise<RXS>;
461
+ /**
462
+ * Recursively fetch all files from a GitHub directory.
463
+ */
464
+ private fetchDirectory;
465
+ /**
466
+ * Fetch a single file's content.
467
+ */
468
+ private fetchFile;
469
+ }
470
+ /**
466
471
  * Configuration options for loadResource.
467
472
  */
468
473
  interface LoadResourceConfig {
@@ -503,53 +508,83 @@ interface LoadResourceConfig {
503
508
  */
504
509
  declare function loadResource(source: string, config?: LoadResourceConfig): Promise<RXR>;
505
510
  /**
506
- * Search options for querying resources.
507
- */
508
- interface SearchOptions {
509
- /**
510
- * Search query string (matches against name, domain, path).
511
- */
512
- query?: string;
513
- /**
514
- * Maximum number of results to return.
515
- */
516
- limit?: number;
517
- /**
518
- * Number of results to skip (for pagination).
519
- */
520
- offset?: number;
521
- }
522
- /**
523
- * Registry interface - business layer for RXR operations.
511
+ * SourceLoaderChain - Chain of source loaders.
524
512
  *
525
- * This interface defines CRUD operations on RXR objects.
526
- * Different implementations (HostedRegistry, MirrorRegistry, LinkedRegistry)
527
- * provide different semantics on top of the same Storage layer.
513
+ * Follows the same pattern as TypeDetectorChain:
514
+ * - Static create() factory with built-in loaders
515
+ * - Extensible via register()
516
+ * - First match wins
517
+ *
518
+ * Loading order:
519
+ * 1. FolderSourceLoader (local directories)
520
+ * 2. GitHubSourceLoader (GitHub URLs)
521
+ * 3. Custom loaders (registered in order)
528
522
  */
529
- interface Registry {
530
- /**
531
- * Get resource by locator.
532
- * @throws RegistryError if not found
533
- */
534
- get(rxl: RXL): Promise<RXR>;
523
+ declare class SourceLoaderChain {
524
+ private readonly loaders;
525
+ private constructor();
535
526
  /**
536
- * Store resource.
527
+ * Create a new SourceLoaderChain with built-in loaders.
537
528
  */
538
- put(rxr: RXR): Promise<void>;
529
+ static create(): SourceLoaderChain;
539
530
  /**
540
- * Check if resource exists.
531
+ * Register a custom loader.
532
+ * Custom loaders are appended after built-in loaders.
541
533
  */
542
- has(rxl: RXL): Promise<boolean>;
534
+ register(loader: SourceLoader): void;
543
535
  /**
544
- * Delete resource.
536
+ * Check if any loader in the chain can handle the source.
537
+ *
538
+ * @param source - Source path or identifier
539
+ * @returns true if any loader can handle the source
545
540
  */
546
- remove(rxl: RXL): Promise<void>;
541
+ canLoad(source: string): Promise<boolean>;
547
542
  /**
548
- * List resources matching options.
543
+ * Load raw files from a source.
544
+ *
545
+ * @param source - Source path or identifier
546
+ * @returns RXS with raw files
547
+ * @throws ResourceXError if no loader matches
549
548
  */
550
- list(options?: SearchOptions): Promise<RXL[]>;
549
+ load(source: string): Promise<RXS>;
550
+ }
551
+ /**
552
+ * Configuration for resolveSource.
553
+ */
554
+ interface ResolveSourceConfig {
555
+ /** Custom loader chain (overrides default chain) */
556
+ loaderChain?: SourceLoaderChain;
557
+ /** Additional loaders to register on the chain */
558
+ loaders?: SourceLoader[];
559
+ /** Custom detector chain (default: TypeDetectorChain.create()) */
560
+ detectorChain?: TypeDetectorChain;
561
+ /** Additional detectors to register on the default chain */
562
+ detectors?: TypeDetector[];
551
563
  }
552
564
  /**
565
+ * Resolve a source into a complete RXR.
566
+ *
567
+ * Pipeline: Load files -> Detect type -> Generate RXD -> Archive -> RXR
568
+ *
569
+ * Supports both explicit resource.json and auto-detection from file patterns.
570
+ *
571
+ * @param source - Source path or identifier
572
+ * @param config - Optional configuration
573
+ * @returns Complete RXR ready for registry
574
+ *
575
+ * @example
576
+ * ```typescript
577
+ * // Auto-detect from folder (with or without resource.json)
578
+ * const rxr = await resolveSource("./my-skill");
579
+ *
580
+ * // With custom loader
581
+ * const rxr = await resolveSource("./custom", {
582
+ * loaders: [new MyCustomLoader()]
583
+ * });
584
+ * ```
585
+ */
586
+ declare function resolveSource(source: string, config?: ResolveSourceConfig): Promise<RXR>;
587
+ /**
553
588
  * RXAStore - Content-Addressable Storage for Resource Archives
554
589
  *
555
590
  * SPI interface for storing file content by digest (hash).
@@ -596,6 +631,11 @@ interface StoredRXM {
596
631
  readonly name: string;
597
632
  readonly type: string;
598
633
  readonly tag: string;
634
+ readonly description?: string;
635
+ readonly author?: string;
636
+ readonly license?: string;
637
+ readonly keywords?: string[];
638
+ readonly repository?: string;
599
639
  readonly files: Record<string, string>;
600
640
  readonly createdAt?: Date;
601
641
  readonly updatedAt?: Date;
@@ -658,19 +698,161 @@ interface RXMStore {
658
698
  * Delete all manifests from a registry (clear cache).
659
699
  */
660
700
  deleteByRegistry(registry: string): Promise<void>;
661
- }
662
- declare class CASRegistry implements Registry {
663
- private readonly rxaStore;
664
- private readonly rxmStore;
665
- constructor(rxaStore: RXAStore, rxmStore: RXMStore);
666
- get(rxl: RXL): Promise<RXR>;
667
- put(rxr: RXR): Promise<void>;
668
- has(rxl: RXL): Promise<boolean>;
669
- remove(rxl: RXL): Promise<void>;
670
- list(options?: SearchOptions): Promise<RXL[]>;
671
701
  /**
672
- * Clear cached resources (resources with registry).
673
- * @param registry - If provided, only clear resources from this registry
702
+ * Set the "latest" pointer for a resource.
703
+ * Points to the tag of the most recently added version.
704
+ */
705
+ setLatest(name: string, tag: string, registry?: string): Promise<void>;
706
+ /**
707
+ * Get the "latest" pointer for a resource.
708
+ * @returns The tag that "latest" points to, or null if no pointer exists.
709
+ */
710
+ getLatest(name: string, registry?: string): Promise<string | null>;
711
+ }
712
+ /**
713
+ * Provider configuration passed to createStores/createLoader.
714
+ */
715
+ interface ProviderConfig {
716
+ /**
717
+ * Base path for storage (filesystem) or connection info.
718
+ */
719
+ path?: string;
720
+ /**
721
+ * Platform-specific configuration.
722
+ */
723
+ [key: string]: unknown;
724
+ }
725
+ /**
726
+ * Stores created by the provider.
727
+ */
728
+ interface ProviderStores {
729
+ rxaStore: RXAStore;
730
+ rxmStore: RXMStore;
731
+ }
732
+ /**
733
+ * Resource loader interface for loading from directories/archives.
734
+ */
735
+ interface ResourceLoader2 {
736
+ /**
737
+ * Check if this loader can handle the given source.
738
+ */
739
+ canLoad(source: string): boolean | Promise<boolean>;
740
+ /**
741
+ * Load resource from source.
742
+ */
743
+ load(source: string): Promise<unknown>;
744
+ }
745
+ /**
746
+ * ResourceX Provider - Platform implementation interface.
747
+ *
748
+ * Platforms implement this interface to provide storage and loading
749
+ * capabilities for their environment.
750
+ */
751
+ interface ResourceXProvider {
752
+ /**
753
+ * Platform identifier.
754
+ */
755
+ readonly platform: string;
756
+ /**
757
+ * Create storage instances for the platform.
758
+ */
759
+ createStores(config: ProviderConfig): ProviderStores;
760
+ /**
761
+ * Create resource loader (optional).
762
+ * Not all platforms support loading from filesystem.
763
+ */
764
+ createLoader?(config: ProviderConfig): ResourceLoader2;
765
+ /**
766
+ * Create source loader for auto-detection pipeline (optional).
767
+ */
768
+ createSourceLoader?(config: ProviderConfig): SourceLoader;
769
+ }
770
+ /**
771
+ * Well-known discovery response format.
772
+ */
773
+ interface WellKnownResponse {
774
+ version?: string;
775
+ registries: string[];
776
+ }
777
+ /**
778
+ * Result from discoverRegistry().
779
+ */
780
+ interface DiscoveryResult {
781
+ domain: string;
782
+ registries: string[];
783
+ }
784
+ /**
785
+ * Discover registry for a domain using well-known.
786
+ * @param domain - The domain to discover (e.g., "deepractice.ai")
787
+ * @returns Discovery result with domain and authorized registries
788
+ */
789
+ declare function discoverRegistry(domain: string): Promise<DiscoveryResult>;
790
+ /**
791
+ * Registry-specific error.
792
+ */
793
+ declare class RegistryError extends ResourceXError {
794
+ constructor(message: string, options?: ErrorOptions);
795
+ }
796
+ /**
797
+ * Search options for querying resources.
798
+ */
799
+ interface SearchOptions {
800
+ /**
801
+ * Search query string (matches against name, domain, path).
802
+ */
803
+ query?: string;
804
+ /**
805
+ * Maximum number of results to return.
806
+ */
807
+ limit?: number;
808
+ /**
809
+ * Number of results to skip (for pagination).
810
+ */
811
+ offset?: number;
812
+ }
813
+ /**
814
+ * Registry interface - business layer for RXR operations.
815
+ *
816
+ * This interface defines CRUD operations on RXR objects.
817
+ * Different implementations (HostedRegistry, MirrorRegistry, LinkedRegistry)
818
+ * provide different semantics on top of the same Storage layer.
819
+ */
820
+ interface Registry {
821
+ /**
822
+ * Get resource by locator.
823
+ * @throws RegistryError if not found
824
+ */
825
+ get(rxl: RXL): Promise<RXR>;
826
+ /**
827
+ * Store resource.
828
+ */
829
+ put(rxr: RXR): Promise<void>;
830
+ /**
831
+ * Check if resource exists.
832
+ */
833
+ has(rxl: RXL): Promise<boolean>;
834
+ /**
835
+ * Delete resource.
836
+ */
837
+ remove(rxl: RXL): Promise<void>;
838
+ /**
839
+ * List resources matching options.
840
+ */
841
+ list(options?: SearchOptions): Promise<RXL[]>;
842
+ }
843
+ declare class CASRegistry implements Registry {
844
+ private readonly rxaStore;
845
+ private readonly rxmStore;
846
+ constructor(rxaStore: RXAStore, rxmStore: RXMStore);
847
+ private resolveTag;
848
+ get(rxl: RXL): Promise<RXR>;
849
+ put(rxr: RXR): Promise<void>;
850
+ has(rxl: RXL): Promise<boolean>;
851
+ remove(rxl: RXL): Promise<void>;
852
+ list(options?: SearchOptions): Promise<RXL[]>;
853
+ /**
854
+ * Clear cached resources (resources with registry).
855
+ * @param registry - If provided, only clear resources from this registry
674
856
  */
675
857
  clearCache(registry?: string): Promise<void>;
676
858
  /**
@@ -745,6 +927,45 @@ declare class LinkedRegistry implements Registry {
745
927
  private parsePathToRXL;
746
928
  }
747
929
  /**
930
+ * Base class for Registry middleware.
931
+ * Delegates all operations to the inner registry.
932
+ * Override specific methods to add custom behavior.
933
+ */
934
+ declare abstract class RegistryMiddleware implements Registry {
935
+ protected readonly inner: Registry;
936
+ constructor(inner: Registry);
937
+ get(rxl: RXL): Promise<RXR>;
938
+ put(rxr: RXR): Promise<void>;
939
+ has(rxl: RXL): Promise<boolean>;
940
+ remove(rxl: RXL): Promise<void>;
941
+ list(options?: SearchOptions): Promise<RXL[]>;
942
+ }
943
+ /**
944
+ * Registry validation middleware.
945
+ * Ensures all resources from this registry match the trusted registry.
946
+ */
947
+ declare class RegistryValidation extends RegistryMiddleware {
948
+ private readonly trustedRegistry;
949
+ constructor(inner: Registry, trustedRegistry: string);
950
+ /**
951
+ * Validate that manifest registry matches trusted registry.
952
+ */
953
+ private validateRegistry;
954
+ /**
955
+ * Get resource and validate registry.
956
+ */
957
+ get(rxl: RXL): Promise<RXR>;
958
+ }
959
+ /**
960
+ * Factory function to create registry validation middleware.
961
+ *
962
+ * @example
963
+ * const registry = withRegistryValidation(hostedRegistry, "deepractice.ai");
964
+ */
965
+ declare function withRegistryValidation(registry: Registry, trustedRegistry: string): Registry;
966
+ declare const DomainValidation: typeof RegistryValidation;
967
+ declare const withDomainValidation: typeof withRegistryValidation;
968
+ /**
748
969
  * Compute SHA-256 digest of data.
749
970
  * Returns string in format "sha256:{hex}"
750
971
  */
@@ -767,6 +988,7 @@ declare class MemoryRXAStore implements RXAStore {
767
988
  }
768
989
  declare class MemoryRXMStore implements RXMStore {
769
990
  private readonly manifests;
991
+ private readonly latestPointers;
770
992
  /**
771
993
  * Build key for manifest lookup.
772
994
  */
@@ -779,128 +1001,245 @@ declare class MemoryRXMStore implements RXMStore {
779
1001
  listNames(registry?: string, query?: string): Promise<string[]>;
780
1002
  search(options?: RXMSearchOptions): Promise<StoredRXM[]>;
781
1003
  deleteByRegistry(registry: string): Promise<void>;
1004
+ setLatest(name: string, tag: string, registry?: string): Promise<void>;
1005
+ getLatest(name: string, registry?: string): Promise<string | null>;
782
1006
  /**
783
1007
  * Clear all manifests (for testing).
784
1008
  */
785
1009
  clear(): void;
786
1010
  }
787
1011
  /**
788
- * Well-known discovery response format.
1012
+ * Isolator type for resolver execution.
1013
+ * Matches SandboX isolator types directly.
1014
+ * Configured at Registry level, not per-type.
1015
+ *
1016
+ * - "none": No isolation, fastest (~10ms), for development
1017
+ * - "srt": OS-level isolation (~50ms), secure local dev
1018
+ * - "cloudflare": Container isolation (~100ms), local Docker or edge
1019
+ * - "e2b": MicroVM isolation (~150ms), production (planned)
789
1020
  */
790
- interface WellKnownResponse {
791
- version?: string;
792
- registries: string[];
793
- }
1021
+ type IsolatorType = "none" | "srt" | "cloudflare" | "e2b";
794
1022
  /**
795
- * Result from discoverRegistry().
1023
+ * ResolveContext - Pure data context passed to resolver in sandbox.
1024
+ *
1025
+ * This is a serializable data structure that replaces RXR for sandbox execution.
1026
+ * The executor pre-processes RXR (extracts files) before passing to resolver.
796
1027
  */
797
- interface DiscoveryResult {
798
- domain: string;
799
- registries: string[];
1028
+ interface ResolveContext {
1029
+ /**
1030
+ * Resource manifest metadata.
1031
+ */
1032
+ manifest: {
1033
+ domain: string
1034
+ path?: string
1035
+ name: string
1036
+ type: string
1037
+ version: string
1038
+ };
1039
+ /**
1040
+ * Extracted files from archive.
1041
+ * Key is file path, value is file content as Uint8Array.
1042
+ */
1043
+ files: Record<string, Uint8Array>;
800
1044
  }
801
1045
  /**
802
- * Discover registry for a domain using well-known.
803
- * @param domain - The domain to discover (e.g., "deepractice.ai")
804
- * @returns Discovery result with domain and authorized registries
1046
+ * BundledType - Pre-bundled resource type ready for execution.
1047
+ * Contains bundled code string instead of closure.
1048
+ *
1049
+ * Note: Sandbox isolation is configured at Registry level via createRegistry({ sandbox: ... })
805
1050
  */
806
- declare function discoverRegistry(domain: string): Promise<DiscoveryResult>;
1051
+ interface BundledType {
1052
+ /**
1053
+ * Type name (e.g., "text", "json", "prompt").
1054
+ */
1055
+ name: string;
1056
+ /**
1057
+ * Alternative names for this type.
1058
+ */
1059
+ aliases?: string[];
1060
+ /**
1061
+ * Human-readable description.
1062
+ */
1063
+ description: string;
1064
+ /**
1065
+ * JSON Schema for resolver arguments.
1066
+ */
1067
+ schema?: JSONSchema;
1068
+ /**
1069
+ * Bundled resolver code (executable in sandbox).
1070
+ */
1071
+ code: string;
1072
+ }
807
1073
  /**
808
- * Registry-specific error.
1074
+ * JSON Schema property definition.
809
1075
  */
810
- declare class RegistryError extends ResourceXError {
811
- constructor(message: string, options?: ErrorOptions);
1076
+ interface JSONSchemaProperty {
1077
+ type: "string" | "number" | "integer" | "boolean" | "object" | "array" | "null";
1078
+ description?: string;
1079
+ default?: unknown;
1080
+ enum?: unknown[];
1081
+ items?: JSONSchemaProperty;
1082
+ properties?: Record<string, JSONSchemaProperty>;
1083
+ required?: string[];
812
1084
  }
813
1085
  /**
814
- * Base class for Registry middleware.
815
- * Delegates all operations to the inner registry.
816
- * Override specific methods to add custom behavior.
1086
+ * JSON Schema definition for resolver arguments.
1087
+ * Used by UI to render parameter forms.
817
1088
  */
818
- declare abstract class RegistryMiddleware implements Registry {
819
- protected readonly inner: Registry;
820
- constructor(inner: Registry);
821
- get(rxl: RXL): Promise<RXR>;
822
- put(rxr: RXR): Promise<void>;
823
- has(rxl: RXL): Promise<boolean>;
824
- remove(rxl: RXL): Promise<void>;
825
- list(options?: SearchOptions): Promise<RXL[]>;
1089
+ interface JSONSchema extends JSONSchemaProperty {
1090
+ $schema?: string;
1091
+ title?: string;
826
1092
  }
827
1093
  /**
828
- * Registry validation middleware.
829
- * Ensures all resources from this registry match the trusted registry.
1094
+ * ResolvedResource - Structured result object returned by resolver.
1095
+ * Contains execute function, original resource, and optional schema for UI rendering.
830
1096
  */
831
- declare class RegistryValidation extends RegistryMiddleware {
832
- private readonly trustedRegistry;
833
- constructor(inner: Registry, trustedRegistry: string);
1097
+ interface ResolvedResource<
1098
+ TArgs = void,
1099
+ TResult = unknown
1100
+ > {
834
1101
  /**
835
- * Validate that manifest registry matches trusted registry.
1102
+ * Original resource object (RXR from @resourcexjs/core).
836
1103
  */
837
- private validateRegistry;
1104
+ resource: unknown;
838
1105
  /**
839
- * Get resource and validate registry.
1106
+ * Execute function to get the resource content.
1107
+ * - For static resources (text/json/binary): call with no arguments
1108
+ * - For dynamic resources (tool): call with arguments
840
1109
  */
841
- get(rxl: RXL): Promise<RXR>;
1110
+ execute: (args?: TArgs) => TResult | Promise<TResult>;
1111
+ /**
1112
+ * JSON Schema for the arguments (undefined if no arguments needed).
1113
+ * UI uses this to render parameter forms.
1114
+ */
1115
+ schema: TArgs extends void ? undefined : JSONSchema;
842
1116
  }
843
1117
  /**
844
- * Factory function to create registry validation middleware.
845
- *
846
- * @example
847
- * const registry = withRegistryValidation(hostedRegistry, "deepractice.ai");
1118
+ * ResourceResolver - Transforms resource into a structured result object.
1119
+ * The execute function is lazy-loaded: content is only read when called.
848
1120
  */
849
- declare function withRegistryValidation(registry: Registry, trustedRegistry: string): Registry;
850
- declare const DomainValidation: typeof RegistryValidation;
851
- declare const withDomainValidation: typeof withRegistryValidation;
1121
+ interface ResourceResolver<
1122
+ TArgs = void,
1123
+ TResult = unknown
1124
+ > {
1125
+ /**
1126
+ * JSON Schema for arguments (required if TArgs is not void).
1127
+ * This constraint ensures type safety at definition time.
1128
+ */
1129
+ schema: TArgs extends void ? undefined : JSONSchema;
1130
+ /**
1131
+ * Resolve resource into a structured result object.
1132
+ * @param rxr - RXR object from @resourcexjs/core
1133
+ */
1134
+ resolve(rxr: unknown): Promise<ResolvedResource<TArgs, TResult>>;
1135
+ }
852
1136
  /**
853
- * Provider configuration passed to createStores/createLoader.
1137
+ * ResourceType - Defines how a resource type is handled.
854
1138
  */
855
- interface ProviderConfig {
1139
+ interface ResourceType<
1140
+ TArgs = void,
1141
+ TResult = unknown
1142
+ > {
856
1143
  /**
857
- * Base path for storage (filesystem) or connection info.
1144
+ * Type name (e.g., "text", "json", "binary").
858
1145
  */
859
- path?: string;
1146
+ name: string;
860
1147
  /**
861
- * Platform-specific configuration.
1148
+ * Alternative names for this type (e.g., ["txt", "plaintext"]).
862
1149
  */
863
- [key: string]: unknown;
1150
+ aliases?: string[];
1151
+ /**
1152
+ * Human-readable description.
1153
+ */
1154
+ description: string;
1155
+ /**
1156
+ * Resolver to transform RXR into structured result object.
1157
+ */
1158
+ resolver: ResourceResolver<TArgs, TResult>;
864
1159
  }
865
1160
  /**
866
- * Stores created by the provider.
1161
+ * Plain text content
867
1162
  */
868
- interface ProviderStores {
869
- rxaStore: RXAStore;
870
- rxmStore: RXMStore;
1163
+ declare const textType: BundledType;
1164
+ /**
1165
+ * JSON content
1166
+ */
1167
+ declare const jsonType: BundledType;
1168
+ /**
1169
+ * Binary content
1170
+ */
1171
+ declare const binaryType: BundledType;
1172
+ /**
1173
+ * All built-in types as an array.
1174
+ */
1175
+ declare const builtinTypes: BundledType[];
1176
+ /**
1177
+ * Bundle a resource type from a source file.
1178
+ *
1179
+ * @param sourcePath - Path to the .type.ts file
1180
+ * @param basePath - Base path for resolving relative paths (defaults to cwd)
1181
+ * @returns BundledType ready for registry
1182
+ *
1183
+ * @example
1184
+ * ```typescript
1185
+ * const promptType = await bundleResourceType("./prompt.type.ts");
1186
+ * ```
1187
+ */
1188
+ declare function bundleResourceType(sourcePath: string, basePath?: string): Promise<BundledType>;
1189
+ /**
1190
+ * Resource type related error.
1191
+ */
1192
+ declare class ResourceTypeError extends ResourceXError {
1193
+ constructor(message: string);
871
1194
  }
872
1195
  /**
873
- * Resource loader interface for loading from directories/archives.
1196
+ * TypeHandlerChain - Manages resource type registration.
1197
+ *
1198
+ * Responsibilities:
1199
+ * - Register types (name + aliases)
1200
+ * - Look up types by name
1201
+ *
1202
+ * Execution is delegated to ResolverExecutor (in registry package).
1203
+ *
1204
+ * Built-in types (text, json, binary) are registered by default.
874
1205
  */
875
- interface ResourceLoader2 {
1206
+ declare class TypeHandlerChain {
1207
+ private handlers;
1208
+ private constructor();
876
1209
  /**
877
- * Check if this loader can handle the given source.
1210
+ * Create a new TypeHandlerChain instance.
1211
+ * Built-in types (text, json, binary) are included by default.
878
1212
  */
879
- canLoad(source: string): boolean | Promise<boolean>;
1213
+ static create(): TypeHandlerChain;
880
1214
  /**
881
- * Load resource from source.
1215
+ * Internal registration (no duplicate check).
882
1216
  */
883
- load(source: string): Promise<unknown>;
884
- }
885
- /**
886
- * ResourceX Provider - Platform implementation interface.
887
- *
888
- * Platforms implement this interface to provide storage and loading
889
- * capabilities for their environment.
890
- */
891
- interface ResourceXProvider {
1217
+ private registerInternal;
892
1218
  /**
893
- * Platform identifier.
1219
+ * Register a type.
1220
+ * @throws ResourceTypeError if type is already registered
894
1221
  */
895
- readonly platform: string;
1222
+ register(type: BundledType): void;
896
1223
  /**
897
- * Create storage instances for the platform.
1224
+ * Check if a type is supported.
898
1225
  */
899
- createStores(config: ProviderConfig): ProviderStores;
1226
+ canHandle(typeName: string): boolean;
900
1227
  /**
901
- * Create resource loader (optional).
902
- * Not all platforms support loading from filesystem.
1228
+ * Get handler for a type.
1229
+ * @throws ResourceTypeError if type is not supported
903
1230
  */
904
- createLoader?(config: ProviderConfig): ResourceLoader2;
1231
+ getHandler(typeName: string): BundledType;
1232
+ /**
1233
+ * Get handler for a type, or undefined if not found.
1234
+ */
1235
+ getHandlerOrUndefined(typeName: string): BundledType | undefined;
1236
+ /**
1237
+ * Get all supported type names (including aliases).
1238
+ */
1239
+ getSupportedTypes(): string[];
1240
+ /**
1241
+ * Clear all registered types (for testing).
1242
+ */
1243
+ clear(): void;
905
1244
  }
906
- export { wrap, withDomainValidation, textType, resource, parse, manifest, locate, loadResource, jsonType, isValidDigest, format, extract, discoverRegistry, define, computeDigest, bundleResourceType, builtinTypes, binaryType, archive, WellKnownResponse, TypeHandlerChain, StoredRXM, SearchOptions, ResourceXProvider, ResourceXError, ResourceTypeError, ResourceType, ResourceResolver, ResourceLoader, ResolvedResource, ResolveContext, RegistryMiddleware, RegistryError, Registry, RXR, RXMStore, RXMSearchOptions, RXM, RXL, RXD, RXAStore, RXA, ProviderStores, ProviderConfig, MemoryRXMStore, MemoryRXAStore, ManifestError, LocatorError, LoadResourceConfig, LinkedRegistry, JSONSchemaProperty, JSONSchema, IsolatorType, FolderLoader, DomainValidation, DiscoveryResult, DefinitionError, ContentError, CASRegistry, BundledType };
1245
+ export { wrap, withDomainValidation, textType, resource, resolveSource, parse, manifest, locate, loadResource, jsonType, isValidDigest, generateDefinition, format, extract, discoverRegistry, define, computeDigest, bundleResourceType, builtinTypes, binaryType, archive, WellKnownResponse, TypeHandlerChain, TypeDetectorChain, TypeDetector, TypeDetectionResult, StoredRXM, SourceLoaderChain, SourceLoader, SkillDetector, SearchOptions, ResourceXProvider, ResourceXError, ResourceTypeError, ResourceType, ResourceResolver, ResourceLoader, ResourceJsonDetector, ResolvedResource, ResolveSourceConfig, ResolveContext, RegistryMiddleware, RegistryError, Registry, RXS, RXR, RXMStore, RXMSource, RXMSearchOptions, RXMDefinition, RXMArchive, RXM, RXL, RXD, RXAStore, RXA, ProviderStores, ProviderConfig, MemoryRXMStore, MemoryRXAStore, ManifestError, LocatorError, LoadResourceConfig, LinkedRegistry, JSONSchemaProperty, JSONSchema, IsolatorType, GitHubSourceLoader, FolderSourceLoader, FolderLoader, FileTree, FileEntry, DomainValidation, DiscoveryResult, DefinitionError, ContentError, CASRegistry, BundledType };