@paradoc/mastra
v0.7.1
Published
Mastra adapter for Paradoc tools — wraps @paradoc/ai-tools with Mastra createTool()
Maintainers
Readme
Paradoc is documents as code. This package exposes the shared Paradoc document operations as native Mastra tools.
Installation
npm install @paradoc/mastra @mastra/core zod@paradoc/mastra is verified against @mastra/core 1.64.0 and requires Node.js 22.13 or newer, matching Mastra's runtime baseline.
Use with an agent
import { Agent } from "@mastra/core/agent";
import { paradocTools } from "@paradoc/mastra";
const agent = new Agent({
id: "document-agent",
name: "Document agent",
instructions: "Use the Paradoc tools to inspect and complete documents.",
model: "openai/gpt-4o-mini",
tools: paradocTools({
defaultRegistryUrl: "https://public.paradoc.dev",
}),
});The collection keeps the canonical wire names used by @paradoc/ai-tools:
const tools = paradocTools();
tools.get_registry;
tools.get_artifact;
tools.inspect_artifact;
tools.validate_artifact;
tools.validate_input;
tools.fill;
tools.get_fill_state;
tools.update_fill;
tools.render;
tools.extract;Each operation is also available through an individual factory, such as render() or updateFill(). The factories pass the shared Zod input and output schemas directly to Mastra, and the tool IDs and descriptions remain aligned with the neutral contract.
The same factories are available from per-tool subpaths such as @paradoc/mastra/render and @paradoc/mastra/update-fill.
Mastra's execution abortSignal is forwarded to the shared request policy. The raw operation result stays available to application code while toModelOutput bounds text and base64 content for the model. Set maxOutputBytes to change the default 16 KiB model-facing budget:
const tools = paradocTools({
defaultRegistryUrl: "https://public.paradoc.dev",
maxOutputBytes: 32_000,
});The adapter depends on the framework-neutral @paradoc/ai-tools package and imports Mastra's createTool contract. It does not add Mastra dependencies to other Paradoc adapters or render/session behavior to the shared package.
Related packages
@paradoc/ai-tools- framework-neutral tool contract@paradoc/ai-sdk- Vercel AI SDK adapter@paradoc/tanstack-ai- TanStack AI adapter
License
MIT. See LICENSE.
