import { D as WorkspaceRuntimeValue, c as WorkspaceModuleFactory, s as WorkspaceModuleCallContext } from "./shared-BP8PrtyI.js"; //#region src/modules/tools.d.ts /** One tool, as code calls it. */ interface ToolBinding { readonly name: string; /** * The tool only reads. On a read-only backend, calls to any tool * without it are refused before the tool runs. */ readonly readOnly?: boolean; /** * Run the tool. `input` is the single object the code passed, or `{}` * when it passed nothing. Check it as strictly as a model's call. */ call(input: Record, context: WorkspaceModuleCallContext): Promise | ToolBindingResult; } /** What a tool call returns to code. */ interface ToolBindingResult { /** The tool's text output, as the model would read it. */ readonly text: string; /** Whether the tool reported a failure. A tool that throws rejects the call instead. */ readonly isError: boolean; /** The tool's structured result, for code to read. `null` when it has none. */ readonly details?: WorkspaceRuntimeValue; /** Present when the tool also returns machine-readable output. */ readonly structuredContent?: WorkspaceRuntimeValue; } /** The tools to export, or a function returning them, called each time a backend connects. */ type ToolBindings = Iterable | (() => Iterable); /** Options for {@link createToolBindings}. */ interface ToolBindingsOptions { /** Tools never exported. Defaults to `["exec"]`; pass `[]` to export every tool. */ readonly exclude?: readonly string[]; /** Replaces the module's description for a model. */ readonly description?: string; } /** * Build the `ws:tools` host module. * * Pass a function rather than a list when the tools depend on something * that does not exist yet when the backend is constructed, such as the * Workspace they act on. The function runs once per connection, so * tools added later reach the next connection, not this one. * * @param bindings - The tools, or a function returning them. * @param options - Tools to leave out, and a replacement description. * @returns The module to pass as `modules["ws:tools"]`. * @throws When the backend connects, if two tools share an export name * once their names are made into identifiers. */ declare function createToolBindings(bindings: ToolBindings, options?: ToolBindingsOptions): WorkspaceModuleFactory; //#endregion export { createToolBindings as a, ToolBindingsOptions as i, ToolBindingResult as n, ToolBindings as r, ToolBinding as t }; //# sourceMappingURL=shared-BIYAGyxd.d.ts.map