@fungi.computer/forage 0.1.0 → 0.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 +7 -1
- package/dist/app-api.d.ts +3 -3
- package/dist/catalog.js +7 -14
- package/dist/openapi.js +25 -14
- package/docs/api/index.md +131 -163
- package/docs/api/openapi.md +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -59,7 +59,13 @@ has a unique dotted path, an input schema, and optional description, capability
|
|
|
59
59
|
notes, instructions, and output schema. Forage validates the catalog, orders its
|
|
60
60
|
operations deterministically, and prepares descriptions once when the catalog is
|
|
61
61
|
created. To change the catalog, create a new revision instead of mutating the
|
|
62
|
-
existing one.
|
|
62
|
+
existing one. Every operation must fit one complete description, and the
|
|
63
|
+
catalog's aggregate metadata remains bounded. A whole namespace can exceed a
|
|
64
|
+
description response without making its individually describable operations
|
|
65
|
+
unavailable. Use paged `list({ namespace })` and describe one operation or
|
|
66
|
+
select `methods` when a broad namespace description exceeds the response bound.
|
|
67
|
+
This applies equally to flat namespaces and broad parents of nested namespaces;
|
|
68
|
+
responses are never truncated and the response bound is unchanged.
|
|
63
69
|
|
|
64
70
|
`search` ranks matching operations. `describe` returns a bounded TypeScript
|
|
65
71
|
description for one operation or a namespace. Operation descriptions also
|
package/dist/app-api.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare function appMethodSchemas(api: AppApi): {
|
|
|
11
11
|
[k: string]: {
|
|
12
12
|
readonly description: string;
|
|
13
13
|
readonly effect: "write" | "external" | "read";
|
|
14
|
-
readonly requires: readonly ("agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[];
|
|
14
|
+
readonly requires: readonly ("approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[];
|
|
15
15
|
readonly pending: true | undefined;
|
|
16
16
|
readonly input: Pick<z.ZodType<z.core.util.JSONType, unknown, z.core.$ZodTypeInternals<z.core.util.JSONType, unknown>>, "~standard" | "parse" | "safeParse">;
|
|
17
17
|
readonly output: Pick<z.ZodType<z.core.util.JSONType, unknown, z.core.$ZodTypeInternals<z.core.util.JSONType, unknown>>, "~standard" | "parse" | "safeParse">;
|
|
@@ -22,7 +22,7 @@ export declare function appToolSchemas(api: AppApi): {
|
|
|
22
22
|
[k: string]: {
|
|
23
23
|
readonly description: string;
|
|
24
24
|
readonly effect: "write" | "external" | "read";
|
|
25
|
-
readonly requires: readonly ("agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[];
|
|
25
|
+
readonly requires: readonly ("approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[];
|
|
26
26
|
readonly pending: true | undefined;
|
|
27
27
|
readonly input: Pick<z.ZodType<z.core.util.JSONType, unknown, z.core.$ZodTypeInternals<z.core.util.JSONType, unknown>>, "~standard" | "parse" | "safeParse">;
|
|
28
28
|
readonly output: Pick<z.ZodType<z.core.util.JSONType, unknown, z.core.$ZodTypeInternals<z.core.util.JSONType, unknown>>, "~standard" | "parse" | "safeParse">;
|
|
@@ -35,7 +35,7 @@ export declare function appToolFamilySchemas(api: AppApi, reply: unknown): {
|
|
|
35
35
|
name: string;
|
|
36
36
|
call: string;
|
|
37
37
|
effect: "write" | "external" | "read";
|
|
38
|
-
requires: readonly ("agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[];
|
|
38
|
+
requires: readonly ("approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[];
|
|
39
39
|
kind: "ready" | "unindexed";
|
|
40
40
|
tools: {
|
|
41
41
|
row: {
|
package/dist/catalog.js
CHANGED
|
@@ -4,7 +4,7 @@ import { describeCatalog } from "./describe.js";
|
|
|
4
4
|
import { catalogStamp, prepareOperation, searchCatalog, } from "./search.js";
|
|
5
5
|
import { compareCodeUnits } from "./normalization.js";
|
|
6
6
|
import { listOperations } from "./list.js";
|
|
7
|
-
import {
|
|
7
|
+
import { renderOperationTypes, schemaProjectionSize } from "./rendering.js";
|
|
8
8
|
const maximumCatalogProjectionBytes = 1_000_000;
|
|
9
9
|
function parseCatalog(input) {
|
|
10
10
|
const parsed = catalogInputSchema.safeParse(input);
|
|
@@ -42,20 +42,13 @@ function parseCatalog(input) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
const preparedOperations = operations.map((operation) => prepareOperation(operation));
|
|
45
|
-
|
|
45
|
+
// Broad namespace descriptions can be narrowed through the existing methods
|
|
46
|
+
// selector or discovered through list pages. Every operation must still fit
|
|
47
|
+
// a complete description on its own; every response keeps the same bound.
|
|
46
48
|
for (const operation of preparedOperations) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
namespaces.set(namespace, group);
|
|
51
|
-
}
|
|
52
|
-
for (const [namespace, group] of namespaces) {
|
|
53
|
-
const rendered = group.map((operation) => operation.rendered);
|
|
54
|
-
const index = renderNamespaceIndex(rendered);
|
|
55
|
-
const full = renderOperationTypes(rendered);
|
|
56
|
-
if (index.length > maximumDescriptionTypes ||
|
|
57
|
-
full.length > maximumDescriptionTypes) {
|
|
58
|
-
throw new ForageError("invalid_input", `Namespace description exceeds the bounded output: ${namespace}`);
|
|
49
|
+
if (renderOperationTypes([operation.rendered]).length >
|
|
50
|
+
maximumDescriptionTypes) {
|
|
51
|
+
throw new ForageError("invalid_input", `Operation description exceeds the bounded output: ${operation.path}`);
|
|
59
52
|
}
|
|
60
53
|
}
|
|
61
54
|
return {
|
package/dist/openapi.js
CHANGED
|
@@ -11,6 +11,16 @@ const reservedNames = new Set([
|
|
|
11
11
|
"prototype",
|
|
12
12
|
...Object.getOwnPropertyNames(Object.prototype),
|
|
13
13
|
]);
|
|
14
|
+
const operationMethods = [
|
|
15
|
+
"get",
|
|
16
|
+
"head",
|
|
17
|
+
"options",
|
|
18
|
+
"post",
|
|
19
|
+
"put",
|
|
20
|
+
"patch",
|
|
21
|
+
"delete",
|
|
22
|
+
"trace",
|
|
23
|
+
];
|
|
14
24
|
const pathTemplate = z
|
|
15
25
|
.string()
|
|
16
26
|
.max(2048)
|
|
@@ -304,6 +314,18 @@ function inspectExpansion(source, budget) {
|
|
|
304
314
|
throw new OpenApiError(refusal, messages[refusal]);
|
|
305
315
|
}
|
|
306
316
|
}
|
|
317
|
+
function inspectOperationCount(paths) {
|
|
318
|
+
let count = 0;
|
|
319
|
+
for (const item of Object.values(paths)) {
|
|
320
|
+
count +=
|
|
321
|
+
item.$ref !== undefined
|
|
322
|
+
? 1
|
|
323
|
+
: operationMethods.filter((method) => item[method] !== undefined)
|
|
324
|
+
.length;
|
|
325
|
+
if (count > 500)
|
|
326
|
+
throw new OpenApiError("operations_limit", "The spec exceeds 500 operations");
|
|
327
|
+
}
|
|
328
|
+
}
|
|
307
329
|
/** Pure intake: the host supplies bounded spec text, never a fetch locator. */
|
|
308
330
|
export async function normalizeOpenApi(source, options = {}) {
|
|
309
331
|
const authParameter = intakeOptions.parse(options).authParameter;
|
|
@@ -349,9 +371,9 @@ export async function normalizeOpenApi(source, options = {}) {
|
|
|
349
371
|
const budget = { nodes: 0 };
|
|
350
372
|
const names = new Set(reservedNames);
|
|
351
373
|
const operations = [];
|
|
374
|
+
// Refuse oversized catalogs before cloning or compiling individual operations.
|
|
375
|
+
inspectOperationCount(parsed.paths);
|
|
352
376
|
for (const [path, item] of Object.entries(parsed.paths).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)) {
|
|
353
|
-
if (operations.length >= 500)
|
|
354
|
-
throw new OpenApiError("operations_limit", "The spec exceeds 500 operations");
|
|
355
377
|
if (item.$ref !== undefined) {
|
|
356
378
|
operations.push({
|
|
357
379
|
status: "unsupported",
|
|
@@ -362,21 +384,10 @@ export async function normalizeOpenApi(source, options = {}) {
|
|
|
362
384
|
});
|
|
363
385
|
continue;
|
|
364
386
|
}
|
|
365
|
-
for (const method of
|
|
366
|
-
"get",
|
|
367
|
-
"head",
|
|
368
|
-
"options",
|
|
369
|
-
"post",
|
|
370
|
-
"put",
|
|
371
|
-
"patch",
|
|
372
|
-
"delete",
|
|
373
|
-
"trace",
|
|
374
|
-
]) {
|
|
387
|
+
for (const method of operationMethods) {
|
|
375
388
|
const raw = item[method];
|
|
376
389
|
if (raw === undefined)
|
|
377
390
|
continue;
|
|
378
|
-
if (operations.length >= 500)
|
|
379
|
-
throw new OpenApiError("operations_limit", "The spec exceeds 500 operations");
|
|
380
391
|
const label = z
|
|
381
392
|
.object({ operationId: z.string().max(128).optional() })
|
|
382
393
|
.safeParse(raw);
|
package/docs/api/index.md
CHANGED
|
@@ -342,12 +342,14 @@ Narrow convenience namespace for the package's public seams.
|
|
|
342
342
|
### forageSearchInput
|
|
343
343
|
|
|
344
344
|
```ts
|
|
345
|
-
const forageSearchInput:
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
345
|
+
const forageSearchInput: ZodLazy<
|
|
346
|
+
ZodObject<
|
|
347
|
+
{
|
|
348
|
+
query: ZodString;
|
|
349
|
+
maxResults: ZodDefault<ZodNumber>;
|
|
350
|
+
},
|
|
351
|
+
$strip
|
|
352
|
+
>
|
|
351
353
|
>;
|
|
352
354
|
```
|
|
353
355
|
|
|
@@ -358,18 +360,20 @@ Input accepted by the pure catalog search seam.
|
|
|
358
360
|
### forageDescribeInput
|
|
359
361
|
|
|
360
362
|
```ts
|
|
361
|
-
const forageDescribeInput:
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
363
|
+
const forageDescribeInput: ZodLazy<
|
|
364
|
+
ZodObject<
|
|
365
|
+
{
|
|
366
|
+
path: ZodString;
|
|
367
|
+
detail: ZodDefault<
|
|
368
|
+
ZodEnum<{
|
|
369
|
+
index: "index";
|
|
370
|
+
full: "full";
|
|
371
|
+
}>
|
|
372
|
+
>;
|
|
373
|
+
methods: ZodOptional<ZodArray<ZodString>>;
|
|
374
|
+
},
|
|
375
|
+
$strip
|
|
376
|
+
>
|
|
373
377
|
>;
|
|
374
378
|
```
|
|
375
379
|
|
|
@@ -404,16 +408,18 @@ const searchResultSchema: ZodObject<
|
|
|
404
408
|
description: ZodOptional<ZodString>;
|
|
405
409
|
score: ZodNumber;
|
|
406
410
|
matchReason: ZodOptional<ZodString>;
|
|
407
|
-
sample: ZodOptional<ZodRecord<ZodString, ZodJSONSchema
|
|
411
|
+
sample: ZodOptional<ZodLazy<ZodRecord<ZodString, ZodJSONSchema>>>;
|
|
408
412
|
capabilityNotes: ZodOptional<ZodString>;
|
|
409
413
|
peers: ZodOptional<
|
|
410
414
|
ZodArray<
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
415
|
+
ZodLazy<
|
|
416
|
+
ZodObject<
|
|
417
|
+
{
|
|
418
|
+
path: ZodString;
|
|
419
|
+
capabilityNotes: ZodOptional<ZodString>;
|
|
420
|
+
},
|
|
421
|
+
$strip
|
|
422
|
+
>
|
|
417
423
|
>
|
|
418
424
|
>
|
|
419
425
|
>;
|
|
@@ -429,40 +435,25 @@ One ranked operation in a search response.
|
|
|
429
435
|
### searchOutputSchema
|
|
430
436
|
|
|
431
437
|
```ts
|
|
432
|
-
const searchOutputSchema: ZodObject<
|
|
433
|
-
{
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
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
|
-
>;
|
|
438
|
+
const searchOutputSchema: ZodLazy<ZodObject<{
|
|
439
|
+
results: ZodArray<ZodObject<{
|
|
440
|
+
path: ZodString;
|
|
441
|
+
description: ZodOptional<ZodString>;
|
|
442
|
+
score: ZodNumber;
|
|
443
|
+
matchReason: ZodOptional<ZodString>;
|
|
444
|
+
sample: ZodOptional<ZodLazy<ZodRecord<ZodString, ZodJSONSchema>>>;
|
|
445
|
+
capabilityNotes: ZodOptional<ZodString>;
|
|
446
|
+
peers: ZodOptional<ZodArray<ZodLazy<ZodObject<{
|
|
447
|
+
path: ...;
|
|
448
|
+
capabilityNotes: ...;
|
|
449
|
+
}, $strip>>>>;
|
|
450
|
+
}, $strip>>;
|
|
451
|
+
total: ZodNumber;
|
|
452
|
+
truncated: ZodBoolean;
|
|
453
|
+
topScore: ZodNumber;
|
|
454
|
+
margin: ZodNumber;
|
|
455
|
+
catalogStamp: ZodString;
|
|
456
|
+
}, $strip>>;
|
|
466
457
|
```
|
|
467
458
|
|
|
468
459
|
Bounded search response envelope.
|
|
@@ -472,38 +463,23 @@ Bounded search response envelope.
|
|
|
472
463
|
### listOutputSchema
|
|
473
464
|
|
|
474
465
|
```ts
|
|
475
|
-
const listOutputSchema: ZodObject<
|
|
476
|
-
{
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
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
|
-
>;
|
|
466
|
+
const listOutputSchema: ZodObject<{
|
|
467
|
+
results: ZodArray<ZodObject<{
|
|
468
|
+
path: ZodString;
|
|
469
|
+
description: ZodOptional<ZodString>;
|
|
470
|
+
score: ZodNumber;
|
|
471
|
+
matchReason: ZodOptional<ZodString>;
|
|
472
|
+
sample: ZodOptional<ZodLazy<ZodRecord<ZodString, ZodJSONSchema>>>;
|
|
473
|
+
capabilityNotes: ZodOptional<ZodString>;
|
|
474
|
+
peers: ZodOptional<ZodArray<ZodLazy<ZodObject<{
|
|
475
|
+
path: ZodString;
|
|
476
|
+
capabilityNotes: ZodOptional<...>;
|
|
477
|
+
}, $strip>>>>;
|
|
478
|
+
}, $strip>>;
|
|
479
|
+
total: ZodNumber;
|
|
480
|
+
nextCursor: ZodNullable<ZodString>;
|
|
481
|
+
catalogStamp: ZodString;
|
|
482
|
+
}, $strip>;
|
|
507
483
|
```
|
|
508
484
|
|
|
509
485
|
One exhaustive page, using the exact search operation summary schema.
|
|
@@ -513,19 +489,21 @@ One exhaustive page, using the exact search operation summary schema.
|
|
|
513
489
|
### describeOutputSchema
|
|
514
490
|
|
|
515
491
|
```ts
|
|
516
|
-
const describeOutputSchema:
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
492
|
+
const describeOutputSchema: ZodLazy<
|
|
493
|
+
ZodObject<
|
|
494
|
+
{
|
|
495
|
+
path: ZodString;
|
|
496
|
+
description: ZodOptional<ZodString>;
|
|
497
|
+
types: ZodString;
|
|
498
|
+
inputSchema: ZodOptional<ZodJSONSchema>;
|
|
499
|
+
kind: ZodEnum<{
|
|
500
|
+
module: "module";
|
|
501
|
+
operation: "operation";
|
|
502
|
+
}>;
|
|
503
|
+
usage: ZodOptional<ZodString>;
|
|
504
|
+
},
|
|
505
|
+
$strip
|
|
506
|
+
>
|
|
529
507
|
>;
|
|
530
508
|
```
|
|
531
509
|
|
|
@@ -536,18 +514,20 @@ Deterministic description response.
|
|
|
536
514
|
### forageFailureSchema
|
|
537
515
|
|
|
538
516
|
```ts
|
|
539
|
-
const forageFailureSchema:
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
517
|
+
const forageFailureSchema: ZodLazy<
|
|
518
|
+
ZodObject<
|
|
519
|
+
{
|
|
520
|
+
code: ZodEnum<{
|
|
521
|
+
empty_query: "empty_query";
|
|
522
|
+
empty_catalog: "empty_catalog";
|
|
523
|
+
unknown_target: "unknown_target";
|
|
524
|
+
duplicate_operation: "duplicate_operation";
|
|
525
|
+
invalid_input: "invalid_input";
|
|
526
|
+
}>;
|
|
527
|
+
message: ZodString;
|
|
528
|
+
},
|
|
529
|
+
$strip
|
|
530
|
+
>
|
|
551
531
|
>;
|
|
552
532
|
```
|
|
553
533
|
|
|
@@ -558,42 +538,36 @@ Closed failure vocabulary for malformed or absent catalog requests.
|
|
|
558
538
|
### operationSchema
|
|
559
539
|
|
|
560
540
|
```ts
|
|
561
|
-
const operationSchema: ZodObject<{
|
|
541
|
+
const operationSchema: ZodLazy<ZodObject<{
|
|
562
542
|
path: ZodString;
|
|
563
543
|
description: ZodOptional<ZodString>;
|
|
564
|
-
input: ZodCustom<Readonly<{
|
|
544
|
+
input: ZodLazy<ZodCustom<Readonly<{
|
|
565
545
|
~standard: Readonly<{
|
|
566
546
|
jsonSchema: Readonly<{
|
|
567
|
-
input:
|
|
568
|
-
output:
|
|
547
|
+
input: ...;
|
|
548
|
+
output: ...;
|
|
569
549
|
}>;
|
|
570
550
|
}>;
|
|
571
551
|
}>, Readonly<{
|
|
572
552
|
~standard: Readonly<{
|
|
573
553
|
jsonSchema: Readonly<{
|
|
574
|
-
input:
|
|
575
|
-
output:
|
|
554
|
+
input: ...;
|
|
555
|
+
output: ...;
|
|
576
556
|
}>;
|
|
577
557
|
}>;
|
|
578
|
-
}
|
|
579
|
-
output: ZodOptional<ZodCustom<Readonly<{
|
|
558
|
+
}>>>;
|
|
559
|
+
output: ZodOptional<ZodLazy<ZodCustom<Readonly<{
|
|
580
560
|
~standard: Readonly<{
|
|
581
|
-
jsonSchema: Readonly
|
|
582
|
-
input: (options) => ...;
|
|
583
|
-
output: (options) => ...;
|
|
584
|
-
}>;
|
|
561
|
+
jsonSchema: Readonly<...>;
|
|
585
562
|
}>;
|
|
586
563
|
}>, Readonly<{
|
|
587
564
|
~standard: Readonly<{
|
|
588
|
-
jsonSchema: Readonly
|
|
589
|
-
input: (options) => ...;
|
|
590
|
-
output: (options) => ...;
|
|
591
|
-
}>;
|
|
565
|
+
jsonSchema: Readonly<...>;
|
|
592
566
|
}>;
|
|
593
|
-
}
|
|
567
|
+
}>>>>;
|
|
594
568
|
capabilityNotes: ZodOptional<ZodString>;
|
|
595
569
|
instructions: ZodOptional<ZodString>;
|
|
596
|
-
}, $strip
|
|
570
|
+
}, $strip>>;
|
|
597
571
|
```
|
|
598
572
|
|
|
599
573
|
A secret-free, callback-free operation descriptor.
|
|
@@ -603,33 +577,21 @@ A secret-free, callback-free operation descriptor.
|
|
|
603
577
|
### catalogInputSchema
|
|
604
578
|
|
|
605
579
|
```ts
|
|
606
|
-
const catalogInputSchema: ZodObject<{
|
|
580
|
+
const catalogInputSchema: ZodLazy<ZodObject<{
|
|
607
581
|
revision: ZodString;
|
|
608
|
-
operations: ZodArray<ZodObject<{
|
|
582
|
+
operations: ZodArray<ZodLazy<ZodObject<{
|
|
609
583
|
path: ZodString;
|
|
610
584
|
description: ZodOptional<ZodString>;
|
|
611
|
-
input: ZodCustom<Readonly<{
|
|
612
|
-
~standard:
|
|
613
|
-
jsonSchema: Readonly<...>;
|
|
614
|
-
}>;
|
|
585
|
+
input: ZodLazy<ZodCustom<Readonly<{
|
|
586
|
+
~standard: ...;
|
|
615
587
|
}>, Readonly<{
|
|
616
|
-
~standard:
|
|
617
|
-
jsonSchema: Readonly<...>;
|
|
618
|
-
}>;
|
|
619
|
-
}>>;
|
|
620
|
-
output: ZodOptional<ZodCustom<Readonly<{
|
|
621
|
-
~standard: Readonly<{
|
|
622
|
-
jsonSchema: ...;
|
|
623
|
-
}>;
|
|
624
|
-
}>, Readonly<{
|
|
625
|
-
~standard: Readonly<{
|
|
626
|
-
jsonSchema: ...;
|
|
627
|
-
}>;
|
|
588
|
+
~standard: ...;
|
|
628
589
|
}>>>;
|
|
590
|
+
output: ZodOptional<ZodLazy<ZodCustom<Readonly<...>, Readonly<...>>>>;
|
|
629
591
|
capabilityNotes: ZodOptional<ZodString>;
|
|
630
592
|
instructions: ZodOptional<ZodString>;
|
|
631
|
-
}, $strip
|
|
632
|
-
}, $strip
|
|
593
|
+
}, $strip>>>;
|
|
594
|
+
}, $strip>>;
|
|
633
595
|
```
|
|
634
596
|
|
|
635
597
|
Input used to construct one immutable catalog revision.
|
|
@@ -715,8 +677,12 @@ function appToolFamilySchemas(
|
|
|
715
677
|
call: string;
|
|
716
678
|
effect: "write" | "external" | "read";
|
|
717
679
|
requires: readonly (
|
|
680
|
+
| "approvals"
|
|
718
681
|
| "agent.list"
|
|
719
682
|
| "agent.manage"
|
|
683
|
+
| "agent.rename"
|
|
684
|
+
| "agent.avatar"
|
|
685
|
+
| "agent.toolPolicy"
|
|
720
686
|
| "agent.read"
|
|
721
687
|
| "agent.send"
|
|
722
688
|
| "computer.list"
|
|
@@ -760,15 +726,17 @@ arguments; this projection supplies neither defaults nor handlers.
|
|
|
760
726
|
#### Returns
|
|
761
727
|
|
|
762
728
|
\| \{ `name`: `string`; `call`: `string`; `effect`: `"write"` \| `"external"` \|
|
|
763
|
-
`"read"`; `requires`: readonly ( \| `"
|
|
764
|
-
`"agent.
|
|
765
|
-
\| `"
|
|
766
|
-
`"
|
|
767
|
-
|
|
768
|
-
`"
|
|
769
|
-
`"
|
|
770
|
-
`"
|
|
771
|
-
`"
|
|
729
|
+
`"read"`; `requires`: readonly ( \| `"approvals"` \| `"agent.list"` \|
|
|
730
|
+
`"agent.manage"` \| `"agent.rename"` \| `"agent.avatar"` \| `"agent.toolPolicy"`
|
|
731
|
+
\| `"agent.read"` \| `"agent.send"` \| `"computer.list"` \|
|
|
732
|
+
`"computer.readFile"` \| `"computer.writeFile"` \| `"computer.execute"` \|
|
|
733
|
+
`"llm.generation"` \| `"media.generation"` \| `"games:servers"` \|
|
|
734
|
+
`"git.repository"` \| `"apps.open"` \| `"apps.call"` \| `"app.storage"` \|
|
|
735
|
+
`"app.events.emit"` \| `"team.workbenchHost"` \| `"marketplace.browse"` \|
|
|
736
|
+
`"marketplace.purchase"` \| `"workflow.run"` \| `"workflow.publish"` \|
|
|
737
|
+
`"workflow.arm"` \| `"world"` \| `"channels.read"` \|
|
|
738
|
+
`"channels.personal.manage"`)[]; `kind`: `"ready"` \| `"unindexed"`; `tools`:
|
|
739
|
+
`object`[]; \} \| `null`
|
|
772
740
|
|
|
773
741
|
---
|
|
774
742
|
|
package/docs/api/openapi.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/forage",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"description": "Pure immutable Zod-typed capability discovery",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@apidevtools/json-schema-ref-parser": "16.0.3",
|
|
32
|
-
"@fungi.computer/puffball": "0.
|
|
32
|
+
"@fungi.computer/puffball": "0.2.0",
|
|
33
33
|
"yaml": "2.9.0",
|
|
34
34
|
"zod": "4.4.3"
|
|
35
35
|
},
|