import { CONNECTOR_DISCOVERY_TOOLS, type Json, type RunContext, type ToolOutcome, type ToolRegistry } from "./core/index.js"; /** * The connector-discovery tools, projected as ordinary tools on the one registry * — so the guard, the audit trail and every door treat them exactly like a host * tool. There is no privileged side door. * * The tool LISTING never changes (connector-discovery design 2026-08-03). A * broker's catalog is tens of thousands of tools and no client re-lists mid * session, so the catalog is not reached by growing the list: `find_service_tools` * returns each match WITH its argument schema, and `use_service_tool` runs one by * the broker's own slug. These four names are permanent, and a tool the model * found a moment ago is callable on the same turn. * * CONNECTING is still a UI act — only the person can complete a consent screen, * and the connect card is where they do it. What `request_connection` changes is * WHO STARTS IT: the agent may now ASK, in its own words, as soon as it knows the * request needs a service this user has not connected — with or without that * service's tools on its listing. The tool mints exactly the `connect-required` * outcome a refused call would have produced, so the card the user sees is the * same card — it just no longer costs a failed call to reach. * * The four names themselves live in core: the loadout reads them too, and none of * them carries the `vendo_*` prefix its always-active exemption keys on. */ export { CONNECTOR_DISCOVERY_TOOLS }; /** The one dispatcher's name. Exported because composition has to recognise it * to resolve the call's REAL, per-slug risk — see `serviceToolRisk` in the * umbrella's server.ts. */ export declare const USE_SERVICE_TOOL = "use_service_tool"; /** One tool the broker's own search matched. Structurally identical to * `ServiceToolMatch` in @vendoai/vendo/actions, restated here because agent may not * depend on actions (layering) — the wire adapts one to the other. */ export interface ServiceToolMatch { /** The broker's callable slug, verbatim — what `use_service_tool` takes. */ slug: string; toolkit: string; description: string; /** JSON Schema for `arguments`. Absent when the broker produced none. */ inputSchema?: Record; /** Whether THIS caller has an active connection for the toolkit. */ connected: boolean; /** The broker's own sentence about the connection and what to do next. */ statusMessage?: string; } export interface ConnectorDiscoveryPorts { /** The broker's OWN search over its whole catalog. Absent when no configured * connector can search — no adapter, no tool, so `find_service_tools` is not * projected at all rather than answering nothing. * * `ctx` is the CALLER's, handed down from `execute` — never assembled by the * port and never taken from the model's input, because a connection belongs * to a person, not to the deployment. */ find?(need: string, ctx: RunContext): Promise; /** Run one of the broker's tools by its own slug, as the caller in `ctx`. * `undefined` means NO connector serves that slug — the model gets a sentence * telling it to search rather than guess a second slug. The outcome is * returned verbatim so its `connectorAccount` passthrough reaches the guard's * audit lift. Paired with {@link find}: both or neither. */ use?(slug: string, args: unknown, ctx: RunContext): Promise; /** The services this deployment can connect to, each tagged with whether the * caller has connected it. Subject-scoped through `ctx` for the same reason. */ list(ctx: RunContext): Promise; /** Resolve a toolkit slug to the connector that can connect it here, so the * ask the model raises names a real, connectable service. `undefined` means * THIS deployment cannot connect that toolkit — the model is told to check * what exists rather than raise a card for a service nobody can complete. * Absent (like {@link find}) means no connect is offered at all, so * `request_connection` is not projected. */ connect?(toolkit: string, ctx: RunContext): Promise<{ connector: string; toolkit: string; } | undefined>; } export declare function connectorDiscoveryRegistry(ports: ConnectorDiscoveryPorts, /** The turn's `toolOutputCap`, so a search can stay under it instead of being * cut by it. See {@link OUTPUT_BUDGET_SHARE}. */ options?: { toolOutputCap?: number; }): ToolRegistry;