/** * The turn's media tools: `upload_file`, `generate_image` and `generate_audio`, * from `@lobu/plugin-media` itself. * * GUEST code, so the same portability rules as `workspace.ts` and * `gateway-tools.ts` apply: no `node:` import, no host module, no root * `@lobu/core` import. * * Nothing here reimplements a tool. `createMediaTools` owns the schemas, * descriptions, request bodies and refusal text. This module supplies the * isolate-specific file port: `upload_file` reads the turn's in-memory * workspace, not the host filesystem. * * The upload itself is the plugin's shared multipart driver over the guest's * `fetch`, so it goes through the host's one egress module under the turn's one * credential, to the same gateway host the MCP route is on. */ import type { AgentTool } from '@mariozechner/pi-agent-core'; import type { AgentTurnConversation, AgentTurnMediaTool } from './types.js'; import { type AgentWorkspace } from './workspace.js'; /** * Build the media tools this turn may call. * * `allowed` is the producer's list, already filtered through the agent's tool * policy — this function only selects, it never grants, exactly as * `createGatewayTools` does. * * `upload_file` is dropped when the turn has no workspace: with no filesystem * behind it there is no file it could ever show, and offering the model a tool * that can only fail is worse than not offering it. */ export declare function createTurnMediaTools(allowed: readonly AgentTurnMediaTool[], args: { gatewayUrl: string; credential: string; conversation: AgentTurnConversation; workspace: AgentWorkspace | null; onFileUploaded: (data: Record) => void; }): AgentTool[]; //# sourceMappingURL=media-tools.d.ts.map