v1.2.0
- Minor9758347
Add AI SDK tools subpath (
files-sdk/ai-sdk) exportingcreateFileTools(...)— wraps a configuredFilesinstance as a set of Vercel AI SDK tools (listFiles,getFileMetadata,downloadFile,getFileUrl,uploadFile,deleteFile,copyFile,signUploadUrl) ready to plug intogenerateText/streamText/ any agent. Mirrors@github-tools/sdk's ergonomics: write tools require approval by default (configurable globally or per-tool viarequireApproval),readOnly: truestrips writes entirely, andoverrideslets callers patch tool descriptions/titles/etc. without touchingexecute. Individual tool factories (uploadFile,downloadFile, …) are also exported for cherry-picking.aiandzodare optional peer dependencies — only required when consuming the new subpath. - Minor2d811b1
Add Claude Agent SDK tools subpath (
files-sdk/claude) exportingcreateClaudeFileTools(...)— wraps a configuredFilesinstance as an in-process MCP server ready to drop intoquery()from `@anthropic-ai/claude-agent-sdk` (the renamed Claude Code SDK).The Claude Agent SDK consumes tools differently than the OpenAI/Vercel adapters: tools are bundled into an
SdkMcpServerand surfaced to the agent viamcpServers+allowedTools, with approval enforced through a top-levelcanUseToolcallback. The factory returns all four pieces:const tools = createClaudeFileTools({ files });for await (const msg of query({ prompt: "List my files.", options: { mcpServers: tools.mcpServers, allowedTools: tools.allowedTools, canUseTool: tools.canUseTool, },})) { /* ... */}Same eight file operations as the other AI subpaths (
listFiles,getFileMetadata,downloadFile,getFileUrl,uploadFile,deleteFile,copyFile,signUploadUrl) with the same approval-gating defaults,readOnlymode, and per-tooloverrides(description + MCPannotations). The bundledcanUseTooldenies approval-gated writes; compose your own usingtools.needsApproval(name)for human-in-the-loop UX — it accepts both bare names ("uploadFile") and the MCP-prefixed form ("mcp__files__uploadFile") the SDK passes in. The MCP server name defaults to"files"and is configurable viaserverName, which also flows through to themcp__<server>__*strings inallowedTools. Read tools get areadOnlyHintannotation; writes getdestructiveHint(copyFile/signUploadUrluseidempotentHintinstead).Individual tool factories (
claudeUploadFile,claudeDownloadFile, …) are also exported asSdkMcpToolDefinitioninstances for callers that want to compose their owncreateSdkMcpServerrather than use the bundled one.@anthropic-ai/claude-agent-sdkandzodare optional peer dependencies — only required when consuming the new subpath. - Minord6adeae
Add OpenAI tools subpath (
files-sdk/openai) with two factories:createResponsesFileTools(...)— for OpenAI's native Responses API. Returns{ definitions, execute, needsApproval }.definitionsis the array of function-tool specs to pass intoopenai.responses.create({ tools }).execute(call)runs afunction_callitem and returns afunction_call_outputready to push into the next turn's input — JSON parse failures and Zod validation errors come back as the tool's output so the model can self-correct.createAgentsFileTools(...)— for the OpenAI Agents SDK (@openai/agents). Returns a record oftool()outputs ready to spread intonew Agent({ tools }).
Both wrap the same eight file operations as
files-sdk/ai-sdk(listFiles,getFileMetadata,downloadFile,getFileUrl,uploadFile,deleteFile,copyFile,signUploadUrl) with the same approval-gating defaults,readOnlymode, and per-tool overrides. Schemas + execute logic are extracted to a shared internal module so the three subpaths can't drift apart.openaiand@openai/agentsare optional peer dependencies — install only the one(s) you use. The subpath requires Zod 4.