Summary
Requesting a createPiTool(executor) integration for the Pi agent toolkit (@mariozechner/pi-agent-core), following the same pattern as the existing Vercel AI SDK integration.
Motivation
Pi is a popular TypeScript AI agent toolkit (43k+ GitHub stars) by Mario Zechner. It provides a layered architecture (pi-ai → pi-agent-core → pi-coding-agent) with a clean tool interface using TypeBox schemas. Currently, agent-diff has only one TypeScript integration (Vercel AI SDK) — adding Pi would expand coverage to a second major TS agent framework.
Proposed API
Following the established pattern (createVercelAITool, create_langchain_tool, create_openai_tool):
import{AgentDiff,TypeScriptExecutorProxy,createPiTool}from'agent-diff';import{Agent}from'@mariozechner/pi-agent-core';import{getModel,streamSimple}from'@mariozechner/pi-ai';constclient=newAgentDiff();constenv=awaitclient.initEnv({templateService: 'slack',templateName: 'slack_default',impersonateUserId: 'U01AGENBOT9',});constexecutor=newTypeScriptExecutorProxy(env.environmentId,client.getBaseUrl());consttool=awaitcreatePiTool(executor);constagent=newAgent({initialState: {systemPrompt: 'You are a helpful assistant.',model: getModel('anthropic','claude-sonnet-4-6'),tools: [tool],},streamFn: streamSimple,});construn=awaitclient.startRun({envId: env.environmentId});awaitagent.prompt('Post "Hello World!" to Slack channel C01GENERAL99.');constdiff=awaitclient.diffRun({runId: run.runId});Implementation notes
Pi tools use the AgentTool<T> interface with TypeBox parameter schemas:
import{Type}from'@mariozechner/pi-ai';importtype{AgentTool}from'@mariozechner/pi-agent-core';constparams=Type.Object({code: Type.String({description: 'TypeScript code to execute'}),});consttool: AgentTool<typeofparams>={name: 'execute_typescript',label: 'Execute Code',description: '...',parameters: params,execute: async(toolCallId,params,signal,onUpdate)=>{constresult=awaitexecutor.execute(params.code);return{content: [{type: 'text',text: result}],details: {},};},};The mapping from agent-diff's executor to Pi's AgentTool is straightforward — similar in shape to the Vercel AI tool wrapper.
References
Summary
Requesting a
createPiTool(executor)integration for the Pi agent toolkit (@mariozechner/pi-agent-core), following the same pattern as the existing Vercel AI SDK integration.Motivation
Pi is a popular TypeScript AI agent toolkit (43k+ GitHub stars) by Mario Zechner. It provides a layered architecture (
pi-ai→pi-agent-core→pi-coding-agent) with a clean tool interface using TypeBox schemas. Currently, agent-diff has only one TypeScript integration (Vercel AI SDK) — adding Pi would expand coverage to a second major TS agent framework.Proposed API
Following the established pattern (
createVercelAITool,create_langchain_tool,create_openai_tool):Implementation notes
Pi tools use the
AgentTool<T>interface with TypeBox parameter schemas:The mapping from agent-diff's executor to Pi's
AgentToolis straightforward — similar in shape to the Vercel AI tool wrapper.References