/** * Merged prompt/tool-delivery module for the unified ConnectorManager. * * Combines the responsibilities of: * - `mount-prompt.ts` — build a system-prompt section for filesystem-face connectors * - `connector-tools.ts` — build an SDK MCP server + system-prompt section for tool-face connectors * * Two exports: * 1. `buildConnectorPromptSection(manager, options?)` — markdown string for the * agent's system prompt. Iterates the unified manager's connectors and: * - if `connector.filesystem` is present → emits a Mounts table row (ported from mount-prompt.ts) * - if `connector.tools` is present → emits a Connectors list entry (ported from connector-tools.ts) * - dual-face connectors emit BOTH * * 2. `buildSdkConnectorTools(manager, options?)` — in-process MCP server config for * the Claude Agent SDK. Only tool-face connectors are wired to tools; filesystem-only * connectors are silently excluded. * * @docLink packages/connectors/concepts#connector-prompt */ import type { ConnectorManager } from "./connector-manager.js"; /** * Options for `buildSdkConnectorTools`. * @docLink packages/connectors/api-reference#connector-tool-options */ export interface ConnectorToolOptions { /** Pre-loaded `@anthropic-ai/claude-agent-sdk` instance (optional; auto-imported if absent). */ sdk?: any; /** Pre-loaded `zod` namespace (optional; uses static import if absent). */ z?: any; /** Whether the agent has shell access. Defaults to true. When true, `connector_exec` is omitted. */ shellAccess?: boolean; } /** * Options for `buildConnectorPromptSection`. * @docLink packages/connectors/api-reference#connector-prompt-options */ export interface ConnectorPromptOptions { /** Whether the agent has shell access. Defaults to true. Affects CLI vs SDK tool examples. */ shellAccess?: boolean; } /** * Build an in-process MCP server exposing connector tools for the Claude Agent SDK. * Only connectors with a `tools` face are wired; filesystem-only connectors are excluded. * Returns the server config to pass as `mcpServers` in the SDK query options. * Returns `null` if `@anthropic-ai/claude-agent-sdk` is not available. * * @param manager - Connected unified `ConnectorManager`. * @param options - Optional SDK/Zod overrides and shell access flag. * @returns MCP server config object or `null`. * @docLink packages/connectors/api-reference#build-sdk-connector-tools */ export declare function buildSdkConnectorTools(manager: ConnectorManager, options?: ConnectorToolOptions): Promise; /** SDK-free definitions shared by the managed registry adapter and Claude SDK. */ export declare function buildConnectorToolDefs(manager: ConnectorManager, options?: ConnectorToolOptions): ConnectorToolDef[]; /** * Build an in-process MCP server exposing the flow connector's agent operations * as **one callable tool per operation** (`start_node`, `complete_node`, * `request_approval`, …), surfaced to the model as * `mcp__skaile-flow__`. * * The generic `buildSdkConnectorTools` never emits per-operation tools — a * claude-sdk session with shell access gets no `connector_exec` tool either — * so a real agent could not discover or invoke the flow node-advancement tools * the orchestrator prompt tells it to call (workspaces#399). This dedicated * server closes that gap for the one connector whose operations ARE the agent's * turn surface. Each tool handler dispatches to `manager.executeOp(connectorId, * op, args)`. * * @param manager - Connected unified `ConnectorManager`. * @param connectorId - The active flow connector id (`flow:`). * @param options - Optional SDK/Zod overrides. * @returns MCP server config object, or `null` if the SDK is unavailable or the * connector exposes no agent operations. * @docLink packages/connectors/api-reference#build-sdk-flow-tools * @since 3.6.0 */ export declare function buildSdkFlowTools(manager: ConnectorManager, connectorId: string, options?: ConnectorToolOptions): Promise; /** Agent-only flow operations; host approvals and lifecycle operations stay private. */ export declare function buildFlowToolDefs(manager: ConnectorManager, connectorId: string, options?: ConnectorToolOptions): ConnectorToolDef[]; /** * Build a markdown section describing all connectors for the agent's system prompt. * * Iterates the unified `ConnectorManager` and, per connector: * - **Filesystem face** (`connector.filesystem != null`) → emits a row in the * `## Mounts` table (id, driver, mount path, access level), plus Tier-1/Tier-2 * git auth guidance for `git` connectors (ported from `mount-prompt.ts`). * - **Tool face** (`connector.tools != null`) → emits an entry in the * `## Connectors` section (ported from `connector-tools.ts`). * - Dual-face connectors appear in BOTH sections. * * @param manager - Connected unified `ConnectorManager`. * @param options - Optional shell access flag. * @returns Markdown string to append to the system prompt, or empty string when * no connectors are connected. * @docLink packages/connectors/api-reference#build-connector-prompt-section */ export declare function buildConnectorPromptSection(manager: ConnectorManager, options?: ConnectorPromptOptions): string; /** Transport-independent tool descriptor with a Zod raw input shape. */ export interface ConnectorToolDef { name: string; description: string; inputSchema: Record; handler: (input: any) => Promise; } //# sourceMappingURL=connector-prompt.d.ts.map