Knapsack
Validated file reads, edits and patches for an Agent's Computer, for TypeScript services that host their own Agent runtime.
Fastest path
Install
Add it to your project with npm, pnpm, Yarn or Bun.
TERMINAL npm install @fungi.computer/knapsackValidate a Files read request
Validates a bounded Files read request with the same Zod schema the Files module uses, then rejects one whose page limit is too small.
home.ts import { readInputSchema } from "@fungi.computer/knapsack";const request = readInputSchema.parse({path: "notes.md",offset: 0,limit: 4,});console.log(request); // { path: "notes.md", offset: 0, limit: 4 }console.log(readInputSchema.safeParse({ path: "notes.md", limit: 1 }).success); // false: limit too small