Definitions

Patties exposes:

  • agent and tool config types
  • job config types
  • defineAgent()
  • defineTool()
  • defineJob()
  • generateAgentsMd
  • AI runtime helpers under patties/ai

App layout

The current repository fixtures show the intended layout:

  • app/agents/ for agent definitions
  • app/tools/ for callable tools
  • app/jobs/ for scheduled jobs

Core types

  • AgentConfig defines the model, tools, triggers, and token settings
  • ToolConfig defines description, Zod input schema, and handler
  • JobConfig defines the cron schedule, timezone, and handler
  • AiContext provides request identity, optional user state, variables, and an Anthropic-like client

Discovery

Build-time scanning collects modules from agents, tools, and jobs directories. Missing directories are allowed, and test files are ignored.

During patties build and patties dev, Patties attempts to regenerate the root AGENTS.md file from the app definition so downstream tools can inspect routes, agents, tools, jobs, and middleware.

Bundle footprint

The AI primitives are opt-in at build time. The generated server entry imports patties/ai only when the app has agents, tools, or jobs, and the Anthropic SDK is loaded lazily when an agent first runs. An app without them carries neither the SDK nor the agent registry in its bun/edge bundle or its --compile binary (which is built from the same entry). @anthropic-ai/sdk stays an optional peer dependency; a regression test asserts the exclusion.

Patties documentation · Licensed under MIT. · Design specs