@resourcexjs/registry 1.0.0 → 1.2.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/README.md +22 -2
- package/dist/index.d.ts +28 -4
- package/dist/index.js +1281 -175
- package/dist/index.js.map +6 -6
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -175,9 +175,29 @@ await registry.delete("localhost/my-prompt.text@1.0.0");
|
|
|
175
175
|
|
|
176
176
|
Publish resource to remote registry (TODO: not yet implemented).
|
|
177
177
|
|
|
178
|
-
#### `search(
|
|
178
|
+
#### `search(options?): Promise<RXL[]>`
|
|
179
179
|
|
|
180
|
-
Search for resources
|
|
180
|
+
Search for resources in local registry.
|
|
181
|
+
|
|
182
|
+
**Parameters:**
|
|
183
|
+
|
|
184
|
+
- `options?: SearchOptions`
|
|
185
|
+
- `query?: string` - Filter by locator substring
|
|
186
|
+
- `limit?: number` - Max results to return
|
|
187
|
+
- `offset?: number` - Skip first N results
|
|
188
|
+
|
|
189
|
+
**Returns**: `Promise<RXL[]>` - Array of matching locators
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
// Search by name
|
|
193
|
+
const results = await registry.search({ query: "assistant" });
|
|
194
|
+
|
|
195
|
+
// With pagination
|
|
196
|
+
const page = await registry.search({ query: "prompt", limit: 10, offset: 20 });
|
|
197
|
+
|
|
198
|
+
// List all resources
|
|
199
|
+
const all = await registry.search();
|
|
200
|
+
```
|
|
181
201
|
|
|
182
202
|
## Storage Structure
|
|
183
203
|
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,23 @@ interface RegistryConfig {
|
|
|
15
15
|
types?: ResourceType[];
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
+
* Search options for querying resources.
|
|
19
|
+
*/
|
|
20
|
+
interface SearchOptions {
|
|
21
|
+
/**
|
|
22
|
+
* Search query string (matches against name, domain, path).
|
|
23
|
+
*/
|
|
24
|
+
query?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Maximum number of results to return.
|
|
27
|
+
*/
|
|
28
|
+
limit?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Number of results to skip (for pagination).
|
|
31
|
+
*/
|
|
32
|
+
offset?: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
18
35
|
* Registry interface for resource storage and retrieval.
|
|
19
36
|
*/
|
|
20
37
|
interface Registry {
|
|
@@ -40,9 +57,11 @@ interface Registry {
|
|
|
40
57
|
*/
|
|
41
58
|
delete(locator: string): Promise<void>;
|
|
42
59
|
/**
|
|
43
|
-
* Search for resources matching
|
|
60
|
+
* Search for resources matching options.
|
|
61
|
+
* @param options - Search options (query, limit, offset)
|
|
62
|
+
* @returns Array of matching resource locators
|
|
44
63
|
*/
|
|
45
|
-
search(
|
|
64
|
+
search(options?: SearchOptions): Promise<RXL[]>;
|
|
46
65
|
}
|
|
47
66
|
import { ResourceXError } from "@resourcexjs/core";
|
|
48
67
|
/**
|
|
@@ -70,11 +89,16 @@ declare class ARPRegistry implements Registry {
|
|
|
70
89
|
resolve(locator: string): Promise<RXR2>;
|
|
71
90
|
exists(locator: string): Promise<boolean>;
|
|
72
91
|
delete(locator: string): Promise<void>;
|
|
73
|
-
search(
|
|
92
|
+
search(options?: SearchOptions): Promise<RXL2[]>;
|
|
93
|
+
/**
|
|
94
|
+
* Parse a file entry path to RXL.
|
|
95
|
+
* Entry format: {domain}/{path}/{name}.{type}@{version}/manifest.json
|
|
96
|
+
*/
|
|
97
|
+
private parseEntryToRXL;
|
|
74
98
|
}
|
|
75
99
|
/**
|
|
76
100
|
* Create a registry instance.
|
|
77
101
|
* Uses ARP protocol for storage operations.
|
|
78
102
|
*/
|
|
79
103
|
declare function createRegistry(config?: RegistryConfig): Registry;
|
|
80
|
-
export { createRegistry, RegistryError, RegistryConfig, Registry, ARPRegistry };
|
|
104
|
+
export { createRegistry, SearchOptions, RegistryError, RegistryConfig, Registry, ARPRegistry };
|