@fungi.computer/forage 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -0
- package/README.md +223 -2
- package/THIRD_PARTY_NOTICES +13 -0
- package/dist/app-api.d.ts +62 -0
- package/dist/app-api.js +121 -0
- package/dist/catalog.d.ts +16 -0
- package/dist/catalog.js +108 -0
- package/dist/definitions.d.ts +16 -0
- package/dist/definitions.js +25 -0
- package/dist/describe.d.ts +4 -0
- package/dist/describe.js +66 -0
- package/dist/errors.d.ts +7 -0
- package/dist/errors.js +12 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +16 -0
- package/dist/json-schema-boundary.d.ts +10 -0
- package/dist/json-schema-boundary.js +56 -0
- package/dist/json-schema-subset.d.ts +6 -0
- package/dist/json-schema-subset.js +77 -0
- package/dist/list.d.ts +8 -0
- package/dist/list.js +53 -0
- package/dist/normalization.d.ts +22 -0
- package/dist/normalization.js +109 -0
- package/dist/openapi.d.ts +106 -0
- package/dist/openapi.js +519 -0
- package/dist/rendering.d.ts +26 -0
- package/dist/rendering.js +341 -0
- package/dist/schemas.d.ts +231 -0
- package/dist/schemas.js +156 -0
- package/dist/search.d.ts +17 -0
- package/dist/search.js +258 -0
- package/docs/api/README.md +15 -0
- package/docs/api/index.md +859 -0
- package/docs/api/json-schema-subset.md +42 -0
- package/docs/api/openapi.md +308 -0
- package/package.json +71 -3
|
@@ -0,0 +1,859 @@
|
|
|
1
|
+
<!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
|
|
2
|
+
|
|
3
|
+
[**@fungi.computer/forage**](README.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
[@fungi.computer/forage](README.md) / index
|
|
8
|
+
|
|
9
|
+
# index
|
|
10
|
+
|
|
11
|
+
## Classes
|
|
12
|
+
|
|
13
|
+
### ForageError
|
|
14
|
+
|
|
15
|
+
A bounded, machine-readable failure at a Forage public seam.
|
|
16
|
+
|
|
17
|
+
#### Extends
|
|
18
|
+
|
|
19
|
+
- `Error`
|
|
20
|
+
|
|
21
|
+
#### Constructors
|
|
22
|
+
|
|
23
|
+
##### Constructor
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
new ForageError(
|
|
27
|
+
code,
|
|
28
|
+
message,
|
|
29
|
+
options?
|
|
30
|
+
): ForageError;
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
###### Parameters
|
|
34
|
+
|
|
35
|
+
| Parameter | Type |
|
|
36
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------- |
|
|
37
|
+
| `code` | \| `"empty_query"` \| `"empty_catalog"` \| `"unknown_target"` \| `"duplicate_operation"` \| `"invalid_input"` |
|
|
38
|
+
| `message` | `string` |
|
|
39
|
+
| `options?` | `ErrorOptions` |
|
|
40
|
+
|
|
41
|
+
###### Returns
|
|
42
|
+
|
|
43
|
+
[`ForageError`](#forageerror)
|
|
44
|
+
|
|
45
|
+
###### Overrides
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
Error.constructor;
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
#### Properties
|
|
52
|
+
|
|
53
|
+
##### code
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
readonly code:
|
|
57
|
+
| "empty_query"
|
|
58
|
+
| "empty_catalog"
|
|
59
|
+
| "unknown_target"
|
|
60
|
+
| "duplicate_operation"
|
|
61
|
+
| "invalid_input";
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
##### failure
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
readonly failure: object;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
###### code
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
code:
|
|
74
|
+
| "empty_query"
|
|
75
|
+
| "empty_catalog"
|
|
76
|
+
| "unknown_target"
|
|
77
|
+
| "duplicate_operation"
|
|
78
|
+
| "invalid_input";
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
###### message
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
message: string;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Type Aliases
|
|
88
|
+
|
|
89
|
+
### ForageCatalog
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
type ForageCatalog = Readonly<{
|
|
93
|
+
revision: string;
|
|
94
|
+
search: (rawInput) => SearchOutput;
|
|
95
|
+
describe: (rawInput) => DescribeOutput;
|
|
96
|
+
list: (rawInput) => ListOutput;
|
|
97
|
+
stamp: () => string;
|
|
98
|
+
}>;
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Immutable public facade for one prepared catalog revision.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### ForageDefinition
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
type ForageDefinition = Readonly<{
|
|
109
|
+
replay: "safe";
|
|
110
|
+
path: string;
|
|
111
|
+
description: string;
|
|
112
|
+
input:
|
|
113
|
+
| typeof forageSearchInput
|
|
114
|
+
| typeof forageDescribeInput
|
|
115
|
+
| typeof forageListInput;
|
|
116
|
+
output:
|
|
117
|
+
| typeof searchOutputSchema
|
|
118
|
+
| typeof describeOutputSchema
|
|
119
|
+
| typeof listOutputSchema;
|
|
120
|
+
}>;
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Structural operation definition consumed by a capability composer.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### ForageApi
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
type ForageApi = object;
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Public convenience namespace contract.
|
|
134
|
+
|
|
135
|
+
#### Properties
|
|
136
|
+
|
|
137
|
+
##### createCatalog
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
createCatalog: typeof createCatalog;
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Construct one immutable catalog revision.
|
|
144
|
+
|
|
145
|
+
##### forageSearchDefinition
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
forageSearchDefinition: typeof forageSearchDefinition;
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Structural search operation definition.
|
|
152
|
+
|
|
153
|
+
##### forageDescribeDefinition
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
forageDescribeDefinition: typeof forageDescribeDefinition;
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Structural description operation definition.
|
|
160
|
+
|
|
161
|
+
##### forageListDefinition
|
|
162
|
+
|
|
163
|
+
```ts
|
|
164
|
+
forageListDefinition: typeof forageListDefinition;
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Structural exhaustive listing definition.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### JsonSchemaTarget
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
type JsonSchemaTarget = Readonly<{
|
|
175
|
+
target: "draft-2020-12";
|
|
176
|
+
}>;
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Options Forage passes when it asks a schema for its JSON Schema.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### JsonSchemaSource
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
type JsonSchemaSource = Readonly<{
|
|
187
|
+
~standard: Readonly<{
|
|
188
|
+
jsonSchema: Readonly<{
|
|
189
|
+
input: (options) => object;
|
|
190
|
+
output: (options) => object;
|
|
191
|
+
}>;
|
|
192
|
+
}>;
|
|
193
|
+
}>;
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Any schema that describes itself through Standard JSON Schema: Zod 4 schemas
|
|
197
|
+
natively, and Effect schemas through Mycelium. Forage only renders descriptions;
|
|
198
|
+
validation stays with the schema's owner.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### ForageSearchInput
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
type ForageSearchInput = z.input<typeof forageSearchInput>;
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Parsed search request type.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
### ForageListInput
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
type ForageListInput = z.input<typeof forageListInput>;
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Exhaustive listing request type.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
### ListOutput
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
type ListOutput = z.infer<typeof listOutputSchema>;
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Exhaustive page response type.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
### ForageDescribeInput
|
|
233
|
+
|
|
234
|
+
```ts
|
|
235
|
+
type ForageDescribeInput = z.input<typeof forageDescribeInput>;
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Parsed description request type.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
### SearchResult
|
|
243
|
+
|
|
244
|
+
```ts
|
|
245
|
+
type SearchResult = z.infer<typeof searchResultSchema>;
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
One ranked search result type.
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
### SearchOutput
|
|
253
|
+
|
|
254
|
+
```ts
|
|
255
|
+
type SearchOutput = z.infer<typeof searchOutputSchema>;
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Search response envelope type.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
### DescribeOutput
|
|
263
|
+
|
|
264
|
+
```ts
|
|
265
|
+
type DescribeOutput = z.infer<typeof describeOutputSchema>;
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Description response type.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
### ForageFailure
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
type ForageFailure = z.infer<typeof forageFailureSchema>;
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Typed failure value type.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
### Operation
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
type Operation = z.infer<typeof operationSchema>;
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Catalog operation descriptor type.
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
### CatalogInput
|
|
293
|
+
|
|
294
|
+
```ts
|
|
295
|
+
type CatalogInput = z.input<typeof catalogInputSchema>;
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Catalog construction input type.
|
|
299
|
+
|
|
300
|
+
## Variables
|
|
301
|
+
|
|
302
|
+
### forageSearchDefinition
|
|
303
|
+
|
|
304
|
+
```ts
|
|
305
|
+
const forageSearchDefinition: ForageDefinition;
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
The search operation has schema metadata only; it has no host behavior.
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
### forageDescribeDefinition
|
|
313
|
+
|
|
314
|
+
```ts
|
|
315
|
+
const forageDescribeDefinition: ForageDefinition;
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
The description operation has schema metadata only; it has no host behavior.
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
### forageListDefinition
|
|
323
|
+
|
|
324
|
+
```ts
|
|
325
|
+
const forageListDefinition: ForageDefinition;
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Pure exhaustive catalog listing; no execution or authority is granted.
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
### Forage
|
|
333
|
+
|
|
334
|
+
```ts
|
|
335
|
+
const Forage: ForageApi;
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Narrow convenience namespace for the package's public seams.
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
### forageSearchInput
|
|
343
|
+
|
|
344
|
+
```ts
|
|
345
|
+
const forageSearchInput: ZodObject<
|
|
346
|
+
{
|
|
347
|
+
query: ZodString;
|
|
348
|
+
maxResults: ZodDefault<ZodNumber>;
|
|
349
|
+
},
|
|
350
|
+
$strip
|
|
351
|
+
>;
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Input accepted by the pure catalog search seam.
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
### forageDescribeInput
|
|
359
|
+
|
|
360
|
+
```ts
|
|
361
|
+
const forageDescribeInput: ZodObject<
|
|
362
|
+
{
|
|
363
|
+
path: ZodString;
|
|
364
|
+
detail: ZodDefault<
|
|
365
|
+
ZodEnum<{
|
|
366
|
+
index: "index";
|
|
367
|
+
full: "full";
|
|
368
|
+
}>
|
|
369
|
+
>;
|
|
370
|
+
methods: ZodOptional<ZodArray<ZodString>>;
|
|
371
|
+
},
|
|
372
|
+
$strip
|
|
373
|
+
>;
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Input accepted by the pure catalog description seam.
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
### forageListInput
|
|
381
|
+
|
|
382
|
+
```ts
|
|
383
|
+
const forageListInput: ZodObject<
|
|
384
|
+
{
|
|
385
|
+
cursor: ZodOptional<ZodString>;
|
|
386
|
+
limit: ZodDefault<ZodNumber>;
|
|
387
|
+
namespace: ZodOptional<ZodString>;
|
|
388
|
+
},
|
|
389
|
+
$strip
|
|
390
|
+
>;
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
Exhaustive listing request; cursor is scoped to one immutable catalog and
|
|
394
|
+
filter.
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
### searchResultSchema
|
|
399
|
+
|
|
400
|
+
```ts
|
|
401
|
+
const searchResultSchema: ZodObject<
|
|
402
|
+
{
|
|
403
|
+
path: ZodString;
|
|
404
|
+
description: ZodOptional<ZodString>;
|
|
405
|
+
score: ZodNumber;
|
|
406
|
+
matchReason: ZodOptional<ZodString>;
|
|
407
|
+
sample: ZodOptional<ZodRecord<ZodString, ZodJSONSchema>>;
|
|
408
|
+
capabilityNotes: ZodOptional<ZodString>;
|
|
409
|
+
peers: ZodOptional<
|
|
410
|
+
ZodArray<
|
|
411
|
+
ZodObject<
|
|
412
|
+
{
|
|
413
|
+
path: ZodString;
|
|
414
|
+
capabilityNotes: ZodOptional<ZodString>;
|
|
415
|
+
},
|
|
416
|
+
$strip
|
|
417
|
+
>
|
|
418
|
+
>
|
|
419
|
+
>;
|
|
420
|
+
},
|
|
421
|
+
$strip
|
|
422
|
+
>;
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
One ranked operation in a search response.
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
### searchOutputSchema
|
|
430
|
+
|
|
431
|
+
```ts
|
|
432
|
+
const searchOutputSchema: ZodObject<
|
|
433
|
+
{
|
|
434
|
+
results: ZodArray<
|
|
435
|
+
ZodObject<
|
|
436
|
+
{
|
|
437
|
+
path: ZodString;
|
|
438
|
+
description: ZodOptional<ZodString>;
|
|
439
|
+
score: ZodNumber;
|
|
440
|
+
matchReason: ZodOptional<ZodString>;
|
|
441
|
+
sample: ZodOptional<ZodRecord<ZodString, ZodJSONSchema>>;
|
|
442
|
+
capabilityNotes: ZodOptional<ZodString>;
|
|
443
|
+
peers: ZodOptional<
|
|
444
|
+
ZodArray<
|
|
445
|
+
ZodObject<
|
|
446
|
+
{
|
|
447
|
+
path: ZodString;
|
|
448
|
+
capabilityNotes: ZodOptional<ZodString>;
|
|
449
|
+
},
|
|
450
|
+
$strip
|
|
451
|
+
>
|
|
452
|
+
>
|
|
453
|
+
>;
|
|
454
|
+
},
|
|
455
|
+
$strip
|
|
456
|
+
>
|
|
457
|
+
>;
|
|
458
|
+
total: ZodNumber;
|
|
459
|
+
truncated: ZodBoolean;
|
|
460
|
+
topScore: ZodNumber;
|
|
461
|
+
margin: ZodNumber;
|
|
462
|
+
catalogStamp: ZodString;
|
|
463
|
+
},
|
|
464
|
+
$strip
|
|
465
|
+
>;
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
Bounded search response envelope.
|
|
469
|
+
|
|
470
|
+
---
|
|
471
|
+
|
|
472
|
+
### listOutputSchema
|
|
473
|
+
|
|
474
|
+
```ts
|
|
475
|
+
const listOutputSchema: ZodObject<
|
|
476
|
+
{
|
|
477
|
+
results: ZodArray<
|
|
478
|
+
ZodObject<
|
|
479
|
+
{
|
|
480
|
+
path: ZodString;
|
|
481
|
+
description: ZodOptional<ZodString>;
|
|
482
|
+
score: ZodNumber;
|
|
483
|
+
matchReason: ZodOptional<ZodString>;
|
|
484
|
+
sample: ZodOptional<ZodRecord<ZodString, ZodJSONSchema>>;
|
|
485
|
+
capabilityNotes: ZodOptional<ZodString>;
|
|
486
|
+
peers: ZodOptional<
|
|
487
|
+
ZodArray<
|
|
488
|
+
ZodObject<
|
|
489
|
+
{
|
|
490
|
+
path: ZodString;
|
|
491
|
+
capabilityNotes: ZodOptional<ZodString>;
|
|
492
|
+
},
|
|
493
|
+
$strip
|
|
494
|
+
>
|
|
495
|
+
>
|
|
496
|
+
>;
|
|
497
|
+
},
|
|
498
|
+
$strip
|
|
499
|
+
>
|
|
500
|
+
>;
|
|
501
|
+
total: ZodNumber;
|
|
502
|
+
nextCursor: ZodNullable<ZodString>;
|
|
503
|
+
catalogStamp: ZodString;
|
|
504
|
+
},
|
|
505
|
+
$strip
|
|
506
|
+
>;
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
One exhaustive page, using the exact search operation summary schema.
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
### describeOutputSchema
|
|
514
|
+
|
|
515
|
+
```ts
|
|
516
|
+
const describeOutputSchema: ZodObject<
|
|
517
|
+
{
|
|
518
|
+
path: ZodString;
|
|
519
|
+
description: ZodOptional<ZodString>;
|
|
520
|
+
types: ZodString;
|
|
521
|
+
inputSchema: ZodOptional<ZodJSONSchema>;
|
|
522
|
+
kind: ZodEnum<{
|
|
523
|
+
module: "module";
|
|
524
|
+
operation: "operation";
|
|
525
|
+
}>;
|
|
526
|
+
usage: ZodOptional<ZodString>;
|
|
527
|
+
},
|
|
528
|
+
$strip
|
|
529
|
+
>;
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
Deterministic description response.
|
|
533
|
+
|
|
534
|
+
---
|
|
535
|
+
|
|
536
|
+
### forageFailureSchema
|
|
537
|
+
|
|
538
|
+
```ts
|
|
539
|
+
const forageFailureSchema: ZodObject<
|
|
540
|
+
{
|
|
541
|
+
code: ZodEnum<{
|
|
542
|
+
empty_query: "empty_query";
|
|
543
|
+
empty_catalog: "empty_catalog";
|
|
544
|
+
unknown_target: "unknown_target";
|
|
545
|
+
duplicate_operation: "duplicate_operation";
|
|
546
|
+
invalid_input: "invalid_input";
|
|
547
|
+
}>;
|
|
548
|
+
message: ZodString;
|
|
549
|
+
},
|
|
550
|
+
$strip
|
|
551
|
+
>;
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
Closed failure vocabulary for malformed or absent catalog requests.
|
|
555
|
+
|
|
556
|
+
---
|
|
557
|
+
|
|
558
|
+
### operationSchema
|
|
559
|
+
|
|
560
|
+
```ts
|
|
561
|
+
const operationSchema: ZodObject<{
|
|
562
|
+
path: ZodString;
|
|
563
|
+
description: ZodOptional<ZodString>;
|
|
564
|
+
input: ZodCustom<Readonly<{
|
|
565
|
+
~standard: Readonly<{
|
|
566
|
+
jsonSchema: Readonly<{
|
|
567
|
+
input: (options) => object;
|
|
568
|
+
output: (options) => object;
|
|
569
|
+
}>;
|
|
570
|
+
}>;
|
|
571
|
+
}>, Readonly<{
|
|
572
|
+
~standard: Readonly<{
|
|
573
|
+
jsonSchema: Readonly<{
|
|
574
|
+
input: (options) => object;
|
|
575
|
+
output: (options) => object;
|
|
576
|
+
}>;
|
|
577
|
+
}>;
|
|
578
|
+
}>>;
|
|
579
|
+
output: ZodOptional<ZodCustom<Readonly<{
|
|
580
|
+
~standard: Readonly<{
|
|
581
|
+
jsonSchema: Readonly<{
|
|
582
|
+
input: (options) => ...;
|
|
583
|
+
output: (options) => ...;
|
|
584
|
+
}>;
|
|
585
|
+
}>;
|
|
586
|
+
}>, Readonly<{
|
|
587
|
+
~standard: Readonly<{
|
|
588
|
+
jsonSchema: Readonly<{
|
|
589
|
+
input: (options) => ...;
|
|
590
|
+
output: (options) => ...;
|
|
591
|
+
}>;
|
|
592
|
+
}>;
|
|
593
|
+
}>>>;
|
|
594
|
+
capabilityNotes: ZodOptional<ZodString>;
|
|
595
|
+
instructions: ZodOptional<ZodString>;
|
|
596
|
+
}, $strip>;
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
A secret-free, callback-free operation descriptor.
|
|
600
|
+
|
|
601
|
+
---
|
|
602
|
+
|
|
603
|
+
### catalogInputSchema
|
|
604
|
+
|
|
605
|
+
```ts
|
|
606
|
+
const catalogInputSchema: ZodObject<{
|
|
607
|
+
revision: ZodString;
|
|
608
|
+
operations: ZodArray<ZodObject<{
|
|
609
|
+
path: ZodString;
|
|
610
|
+
description: ZodOptional<ZodString>;
|
|
611
|
+
input: ZodCustom<Readonly<{
|
|
612
|
+
~standard: Readonly<{
|
|
613
|
+
jsonSchema: Readonly<...>;
|
|
614
|
+
}>;
|
|
615
|
+
}>, Readonly<{
|
|
616
|
+
~standard: Readonly<{
|
|
617
|
+
jsonSchema: Readonly<...>;
|
|
618
|
+
}>;
|
|
619
|
+
}>>;
|
|
620
|
+
output: ZodOptional<ZodCustom<Readonly<{
|
|
621
|
+
~standard: Readonly<{
|
|
622
|
+
jsonSchema: ...;
|
|
623
|
+
}>;
|
|
624
|
+
}>, Readonly<{
|
|
625
|
+
~standard: Readonly<{
|
|
626
|
+
jsonSchema: ...;
|
|
627
|
+
}>;
|
|
628
|
+
}>>>;
|
|
629
|
+
capabilityNotes: ZodOptional<ZodString>;
|
|
630
|
+
instructions: ZodOptional<ZodString>;
|
|
631
|
+
}, $strip>>;
|
|
632
|
+
}, $strip>;
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
Input used to construct one immutable catalog revision.
|
|
636
|
+
|
|
637
|
+
## Functions
|
|
638
|
+
|
|
639
|
+
### jsonSchemaToZod()
|
|
640
|
+
|
|
641
|
+
```ts
|
|
642
|
+
function jsonSchemaToZod(
|
|
643
|
+
source,
|
|
644
|
+
defaultTarget?,
|
|
645
|
+
): ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>;
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
The shared JSON-Schema compiler for App methods and OpenAPI operations.
|
|
649
|
+
|
|
650
|
+
#### Parameters
|
|
651
|
+
|
|
652
|
+
| Parameter | Type | Default value |
|
|
653
|
+
| --------------- | ------------------------------------ | ----------------- |
|
|
654
|
+
| `source` | `unknown` | `undefined` |
|
|
655
|
+
| `defaultTarget` | `"draft-2020-12"` \| `"openapi-3.0"` | `"draft-2020-12"` |
|
|
656
|
+
|
|
657
|
+
#### Returns
|
|
658
|
+
|
|
659
|
+
`ZodType`\<`unknown`, `unknown`, `$ZodTypeInternals`\<`unknown`, `unknown`\>\>
|
|
660
|
+
|
|
661
|
+
---
|
|
662
|
+
|
|
663
|
+
### appMethodSchemas()
|
|
664
|
+
|
|
665
|
+
```ts
|
|
666
|
+
function appMethodSchemas(api): object;
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
Compile App validators and their Standard JSON Schema descriptions. Validation
|
|
670
|
+
enforces both the declaration and JSON-only values; discovery describes the
|
|
671
|
+
declaration without adding JSON guard nesting. Agar's emitted output already
|
|
672
|
+
includes Pending for opted-in methods.
|
|
673
|
+
|
|
674
|
+
#### Parameters
|
|
675
|
+
|
|
676
|
+
| Parameter | Type |
|
|
677
|
+
| --------- | -------- |
|
|
678
|
+
| `api` | `AppApi` |
|
|
679
|
+
|
|
680
|
+
#### Returns
|
|
681
|
+
|
|
682
|
+
`object`
|
|
683
|
+
|
|
684
|
+
---
|
|
685
|
+
|
|
686
|
+
### appToolSchemas()
|
|
687
|
+
|
|
688
|
+
```ts
|
|
689
|
+
function appToolSchemas(api): object;
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
Compile discoverable App methods only; direct RPC validation uses
|
|
693
|
+
appMethodSchemas.
|
|
694
|
+
|
|
695
|
+
#### Parameters
|
|
696
|
+
|
|
697
|
+
| Parameter | Type |
|
|
698
|
+
| --------- | -------- |
|
|
699
|
+
| `api` | `AppApi` |
|
|
700
|
+
|
|
701
|
+
#### Returns
|
|
702
|
+
|
|
703
|
+
`object`
|
|
704
|
+
|
|
705
|
+
---
|
|
706
|
+
|
|
707
|
+
### appToolFamilySchemas()
|
|
708
|
+
|
|
709
|
+
```ts
|
|
710
|
+
function appToolFamilySchemas(
|
|
711
|
+
api,
|
|
712
|
+
reply,
|
|
713
|
+
): {
|
|
714
|
+
name: string;
|
|
715
|
+
call: string;
|
|
716
|
+
effect: "write" | "external" | "read";
|
|
717
|
+
requires: readonly (
|
|
718
|
+
| "agent.list"
|
|
719
|
+
| "agent.manage"
|
|
720
|
+
| "agent.read"
|
|
721
|
+
| "agent.send"
|
|
722
|
+
| "computer.list"
|
|
723
|
+
| "computer.readFile"
|
|
724
|
+
| "computer.writeFile"
|
|
725
|
+
| "computer.execute"
|
|
726
|
+
| "llm.generation"
|
|
727
|
+
| "media.generation"
|
|
728
|
+
| "games:servers"
|
|
729
|
+
| "git.repository"
|
|
730
|
+
| "apps.open"
|
|
731
|
+
| "apps.call"
|
|
732
|
+
| "app.storage"
|
|
733
|
+
| "app.events.emit"
|
|
734
|
+
| "team.workbenchHost"
|
|
735
|
+
| "marketplace.browse"
|
|
736
|
+
| "marketplace.purchase"
|
|
737
|
+
| "workflow.run"
|
|
738
|
+
| "workflow.publish"
|
|
739
|
+
| "workflow.arm"
|
|
740
|
+
| "world"
|
|
741
|
+
| "channels.read"
|
|
742
|
+
| "channels.personal.manage"
|
|
743
|
+
)[];
|
|
744
|
+
kind: "ready" | "unindexed";
|
|
745
|
+
tools: object[];
|
|
746
|
+
} | null;
|
|
747
|
+
```
|
|
748
|
+
|
|
749
|
+
Decode the signed listing before compiling dynamic discovery schemas. Rows
|
|
750
|
+
retain App-owned selectors as data. Hosts supply call admission and invocation
|
|
751
|
+
arguments; this projection supplies neither defaults nor handlers.
|
|
752
|
+
|
|
753
|
+
#### Parameters
|
|
754
|
+
|
|
755
|
+
| Parameter | Type |
|
|
756
|
+
| --------- | --------- |
|
|
757
|
+
| `api` | `AppApi` |
|
|
758
|
+
| `reply` | `unknown` |
|
|
759
|
+
|
|
760
|
+
#### Returns
|
|
761
|
+
|
|
762
|
+
\| \{ `name`: `string`; `call`: `string`; `effect`: `"write"` \| `"external"` \|
|
|
763
|
+
`"read"`; `requires`: readonly ( \| `"agent.list"` \| `"agent.manage"` \|
|
|
764
|
+
`"agent.read"` \| `"agent.send"` \| `"computer.list"` \| `"computer.readFile"`
|
|
765
|
+
\| `"computer.writeFile"` \| `"computer.execute"` \| `"llm.generation"` \|
|
|
766
|
+
`"media.generation"` \| `"games:servers"` \| `"git.repository"` \| `"apps.open"`
|
|
767
|
+
\| `"apps.call"` \| `"app.storage"` \| `"app.events.emit"` \|
|
|
768
|
+
`"team.workbenchHost"` \| `"marketplace.browse"` \| `"marketplace.purchase"` \|
|
|
769
|
+
`"workflow.run"` \| `"workflow.publish"` \| `"workflow.arm"` \| `"world"` \|
|
|
770
|
+
`"channels.read"` \| `"channels.personal.manage"`)[]; `kind`: `"ready"` \|
|
|
771
|
+
`"unindexed"`; `tools`: `object`[]; \} \| `null`
|
|
772
|
+
|
|
773
|
+
---
|
|
774
|
+
|
|
775
|
+
### appApiOperations()
|
|
776
|
+
|
|
777
|
+
```ts
|
|
778
|
+
function appApiOperations(name, api): readonly object[];
|
|
779
|
+
```
|
|
780
|
+
|
|
781
|
+
Project an already decoded Release API into discovery data with the same paths
|
|
782
|
+
the Agent catalog uses (`PRINTS.generate`, called as `env.PRINTS.generate()`).
|
|
783
|
+
The introduction owner supplies the installation's binding name; this function
|
|
784
|
+
grants no access and supplies no execution handler. Role aliases can project the
|
|
785
|
+
same API.
|
|
786
|
+
|
|
787
|
+
#### Parameters
|
|
788
|
+
|
|
789
|
+
| Parameter | Type |
|
|
790
|
+
| --------- | -------- |
|
|
791
|
+
| `name` | `string` |
|
|
792
|
+
| `api` | `AppApi` |
|
|
793
|
+
|
|
794
|
+
#### Returns
|
|
795
|
+
|
|
796
|
+
readonly `object`[]
|
|
797
|
+
|
|
798
|
+
---
|
|
799
|
+
|
|
800
|
+
### createCatalog()
|
|
801
|
+
|
|
802
|
+
```ts
|
|
803
|
+
function createCatalog(input): ForageCatalog;
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
Construct one immutable catalog revision with a narrow public facade.
|
|
807
|
+
|
|
808
|
+
#### Parameters
|
|
809
|
+
|
|
810
|
+
| Parameter | Type |
|
|
811
|
+
| ------------------ | ----------------------------------------------------- |
|
|
812
|
+
| `input` | \{ `revision`: `string`; `operations`: `object`[]; \} |
|
|
813
|
+
| `input.revision` | `string` |
|
|
814
|
+
| `input.operations` | `object`[] |
|
|
815
|
+
|
|
816
|
+
#### Returns
|
|
817
|
+
|
|
818
|
+
[`ForageCatalog`](#foragecatalog)
|
|
819
|
+
|
|
820
|
+
---
|
|
821
|
+
|
|
822
|
+
### listOperations()
|
|
823
|
+
|
|
824
|
+
```ts
|
|
825
|
+
function listOperations(operations, catalogStamp, rawInput): object;
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
Page a trusted immutable operation-summary view. Hosts may filter the existing
|
|
829
|
+
catalog to their bound operations before paging; this is the one cursor owner.
|
|
830
|
+
Order is namespace then full path, compared by UTF-16 code units, never locale.
|
|
831
|
+
Unlike search, no equivalent operations are merged into peers.
|
|
832
|
+
|
|
833
|
+
#### Parameters
|
|
834
|
+
|
|
835
|
+
| Parameter | Type |
|
|
836
|
+
| --------------------- | ---------------------------------------------------------------------- |
|
|
837
|
+
| `operations` | readonly `object`[] |
|
|
838
|
+
| `catalogStamp` | `string` |
|
|
839
|
+
| `rawInput` | \{ `cursor?`: `string`; `limit?`: `number`; `namespace?`: `string`; \} |
|
|
840
|
+
| `rawInput.cursor?` | `string` |
|
|
841
|
+
| `rawInput.limit?` | `number` |
|
|
842
|
+
| `rawInput.namespace?` | `string` |
|
|
843
|
+
|
|
844
|
+
#### Returns
|
|
845
|
+
|
|
846
|
+
`object`
|
|
847
|
+
|
|
848
|
+
| Name | Type |
|
|
849
|
+
| -------------- | ------------------ |
|
|
850
|
+
| `results` | `object`[] |
|
|
851
|
+
| `total` | `number` |
|
|
852
|
+
| `nextCursor` | `string` \| `null` |
|
|
853
|
+
| `catalogStamp` | `string` |
|
|
854
|
+
|
|
855
|
+
## References
|
|
856
|
+
|
|
857
|
+
### default
|
|
858
|
+
|
|
859
|
+
Renames and re-exports [Forage](#forage)
|