/** * MCP resources, through the tools Codex and opencode use: `list_mcp_resources`, * `list_mcp_resource_templates`, and `read_mcp_resource`. They take a `server` argument and cover * every connected server with resources, so models trained on those tools use them unchanged. * * Listings are JSON, as in Codex: `{ server?, resources: [{ server, ...resource }], nextCursor? }`. * With a `server`, one page is listed and `cursor` continues it; without, every page of every server. * MCP App resources (`ui://` URIs and `profile=mcp-app` HTML) are left out, since they are user * interfaces for hosts that render them, and so are icons. Read resources become text and images for * the model; binary resources are saved to temp files. Scripts get the JSON payloads. */ import type { ListResourcesResult, ListResourceTemplatesResult, McpRequestOptions, ReadResourceResult, Resource, ResourceTemplate } from "@earendil-works/pi-mcp"; import type { TSchema } from "typebox"; import type { ToolDefinition } from "../../core/extensions/types.ts"; import type { McpExposure } from "./config.ts"; import { type McpToolDetails, READ_MCP_RESOURCE_TOOL } from "./tools.ts"; export declare const LIST_MCP_RESOURCES_TOOL = "list_mcp_resources"; export declare const LIST_MCP_RESOURCE_TEMPLATES_TOOL = "list_mcp_resource_templates"; export { READ_MCP_RESOURCE_TOOL }; /** A connected server that offers resources. */ export interface McpResourceServer { name: string; timeoutMs: number; resourcesPage(cursor: string | undefined, options: McpRequestOptions): Promise; resourceTemplatesPage(cursor: string | undefined, options: McpRequestOptions): Promise; allResources(options: McpRequestOptions): Promise; allResourceTemplates(options: McpRequestOptions): Promise; readResource(uri: string, options: McpRequestOptions): Promise; } /** MCP App user interfaces, which only hosts that render them can use. */ export declare function isMcpAppResource(item: { uri?: string; uriTemplate?: string; mimeType?: string; }): boolean; /** * The three resource tools. `servers` returns the servers whose resources they reach, at call time. */ export declare function createMcpResourceToolDefinitions(options: { exposure: McpExposure; servers: () => readonly McpResourceServer[]; }): ToolDefinition[]; //# sourceMappingURL=resources.d.ts.map