Browse documentation

Reference

Package exports

Find the right Flary module for runs, tools, providers, storage, and Cloudflare adapters.

Import from focused entry points so bundles and type declarations stay small. This also makes the host boundary easier to audit.

Import Use
flary Function authoring, Zod, contracts, modes, and top-level exports
flary/functions Function authoring, Dynamic Worker Code Mode, and function types
flary/prompts Prompt Markdown parsing, compilation, revisions, and rollouts
flary/flue Low-level Flue services, lazy tools, and user input
flary/host Authenticated host routers and trusted context
flary/client Function and low-level run/thread clients
flary/react WebSocket React console, durable thread hook, and timeline projector
flary/vite Vite generation for functions, Flue entries, bindings, and tools
flary/tools Zod tools, catalogs, lazy runtime, and capability handles
flary/mcp Remote MCP discovery and safe tool adapters
flary/providers Normalized model requests, adapters, OAuth, and cache policy
flary/evaluations Versioned datasets, graders, judges, and reports
flary/contracts Zod schemas and TypeScript types
flary/cloudflare D1, Durable Object, R2, Dynamic Worker, Sandbox, and queue adapters
flary/storage Workspace, blob, Artifacts, JSONL, and history contracts
flary/session Session ledger, integrity chain, portable JSONL, and SQLite projector
flary/history Checkpoints, indexing queue, and history projection
flary/recall Exact, in-memory, and Turbopuffer recall indexes
flary/subagents Child execution contracts and coordinators
flary/execution Parallel scheduler, mode policy, approvals, and idempotency
flary/telemetry Usage, trace, and normalized model telemetry
flary/vault Encrypted secret references and capability-scoped access

Common imports

import { flary, z, AgentModeSchema, resolveAgentMode } from "flary";
import { flary as createFunctionClient } from "flary/client";
import { FlaryAgentConsole, useFlaryThread } from "flary/react";
import { createFlaryCodemodeExecutor } from "flary/functions";
import { compilePrompt } from "flary/prompts";
import { createFlaryRunRouter } from "flary/host";
import { createMcpTools } from "flary/mcp";

Versioning

Use the exact release in production:

npm install flary

Run the clean npm installation test in CI so a host does not silently lose checked-in dependency patches.