Skip to content

Forage

Lets an AI Agent find the right operation by name or description out of every one a host has registered, without granting it the power to run any.

  • @fungi.computer/forage
  • v0.2.0
  • MIT

Fastest path

  1. Install

    Add it to your project with npm, pnpm, Yarn or Bun.

    TERMINAL
    npm install @fungi.computer/forage
  2. Search and describe one operation

    Builds a one-operation catalog, searches it by keyword, and describes the match as a typed TypeScript signature.

    home.ts
    import { Forage } from "@fungi.computer/forage";
    import { z } from "zod";
    const catalog = Forage.createCatalog({
    revision: "run-1",
    operations: [
    {
    path: "files.read",
    description: "Read a file",
    input: z.object({ path: z.string() }),
    },
    ],
    });
    const matches = catalog.search({ query: "read" });
    const description = catalog.describe({ path: "files.read" });
    console.log(matches.results[0]?.path, description.kind); // "files.read" "operation"