import { C as CopyFileInput, D as DeleteFileInput, a as DownloadFileInput, G as GetFileMetadataInput, b as GetFileUrlInput, L as ListFilesInput, S as SignUploadUrlInput, U as UploadFileInput, F as FileToolName, A as ApprovalConfig, c as FileReadToolName } from "../../packem_shared/approval.d-C-d-t94D.js"; export type { d as FileWriteToolName } from "../../packem_shared/approval.d-C-d-t94D.js"; import { Tool } from 'ai'; import { e as executors } from "../../packem_shared/executors.d-HWHR3Ids.js"; import { F as Files } from "../../packem_shared/files.d-DuIceNg2.js"; import 'zod'; import "../../packem_shared/storage.d-C9EdfTf1.js"; import 'node:stream'; import 'node:timers'; import 'node:crypto'; import 'node:http'; import 'lru-cache'; /** * Common options accepted by every write-tool factory. */ interface ToolOptions { needsApproval?: boolean; } /** * Per-tool overrides for customizing AI SDK `tool()` properties without * changing the underlying implementation. Core properties (`execute`, * `inputSchema`, `outputSchema`) are intentionally excluded — those drive * the tool's behavior and contract and shouldn't be patched at this layer. */ type ToolOverrides = Partial>; type ListFilesOutput = Awaited>; type GetFileMetadataOutput = Awaited>; type DownloadFileOutput = Awaited>; type GetFileUrlOutput = Awaited>; type UploadFileOutput = Awaited>; type DeleteFileOutput = Awaited>; type CopyFileOutput = Awaited>; type SignUploadUrlOutput = Awaited>; declare const listFiles: (files: Files) => Tool; declare const getFileMetadata: (files: Files) => Tool; declare const downloadFile: (files: Files) => Tool; declare const getFileUrl: (files: Files) => Tool; declare const uploadFile: (files: Files, { needsApproval }?: ToolOptions) => Tool; declare const deleteFile: (files: Files, { needsApproval }?: ToolOptions) => Tool; declare const copyFile: (files: Files, { needsApproval }?: ToolOptions) => Tool; declare const signUploadUrl: (files: Files, { needsApproval }?: ToolOptions) => Tool; interface FileToolsOptions { /** * The configured `Files` instance the tools will operate against. * Each tool delegates to the methods on this instance. */ files: Files; /** * Per-tool overrides for customizing tool behavior (description, title, * needsApproval, etc.) without changing the underlying implementation. * `execute` and `inputSchema` cannot be overridden. */ overrides?: Partial>; /** * When `true`, write tools (`uploadFile`, `deleteFile`, `copyFile`, * `signUploadUrl`) are omitted entirely. The model cannot mutate the * bucket regardless of approval configuration. */ readOnly?: boolean; /** * Approval gating for write tools. Defaults to `true` (all writes * require approval). See {@link ApprovalConfig}. */ requireApproval?: ApprovalConfig; } interface FileTools { copyFile: ReturnType; deleteFile: ReturnType; downloadFile: ReturnType; getFileMetadata: ReturnType; getFileUrl: ReturnType; listFiles: ReturnType; signUploadUrl: ReturnType; uploadFile: ReturnType; } type ReadOnlyFileTools = Pick; /** * Create a set of visulima/storage tools for the Vercel AI SDK. * * Write operations require user approval by default. Control globally or * per-tool via `requireApproval`, or strip writes entirely with * `readOnly: true`. * @example * ```ts * import { Files } from "@visulima/storage"; * import { S3Storage } from "@visulima/storage/provider/aws"; * import { createFileTools } from "@visulima/storage/ai/sdk"; * import { generateText } from "ai"; * * const files = new Files({ adapter: new S3Storage({ bucket: "uploads" }) }); * * const result = await generateText({ * model, * tools: createFileTools({ files }), * prompt: "Find every CSV under reports/ and summarize the latest one.", * }); * ``` */ declare function createFileTools(options: FileToolsOptions & { readOnly: true; }): ReadOnlyFileTools; declare function createFileTools(options: FileToolsOptions & { readOnly?: false | undefined; }): FileTools; declare function createFileTools(options: FileToolsOptions): FileTools | ReadOnlyFileTools; export { type ApprovalConfig, type FileReadToolName, type FileToolName, FileTools, FileToolsOptions, ReadOnlyFileTools, type ToolOptions, type ToolOverrides, copyFile, createFileTools, deleteFile, downloadFile, getFileMetadata, getFileUrl, listFiles, signUploadUrl, uploadFile };