import type { CapabilityCatalogItem, UpdateSessionToolPolicyRequest } from "@opengeni/sdk"; import type { OpenGeniBrowserClient as OpenGeniClient } from "@opengeni/sdk/browser"; import { type OpenGeniText } from "./messages/runtime.js"; /** What selecting a capability for a chat needs: its kind and tools. An * installed API integration has no catalog row, only its runtime server. */ export type SessionCapabilityToolSource = Pick; /** Catalog tool discovery may be lazy; selecting the installed server does not * require its individual tool inventory to have been fetched. */ export declare function sessionCapabilityTools(item: SessionCapabilityToolSource): import("@opengeni/sdk").ToolRef[]; /** A connection never resets the human's existing tool selection. Default-mode * sessions discover newly enabled servers at admission; explicit/inherited * policies add only this reviewed capability, with the existing CAS fence. */ export declare function attachSessionCapability(t: OpenGeniText, client: OpenGeniClient, workspaceId: string, sessionId: string, item: SessionCapabilityToolSource, stillCurrent?: () => boolean): Promise; /** Read-only review. Hosts must show ancestor changes and obtain a separate * explicit click before applying. This plan is never authorization. */ export type SessionCapabilityAccessPlan = { workspaceId: string; sessionId: string; capabilityId: string; sessions: Array<{ id: string; title: string | null; parentSessionId: string | null; toolPolicyVersion: number; request: UpdateSessionToolPolicyRequest | null; }>; }; export declare function prepareSessionCapabilityAccess(t: OpenGeniText, client: OpenGeniClient, workspaceId: string, sessionId: string, item: CapabilityCatalogItem, stillCurrent?: () => boolean): Promise; /** Preflight the entire review, then apply ordinary CAS-fenced API writes root * first. A partial failure may leave approved ancestor changes committed; never * claim success or roll back another person's edits. Prepare a new review. */ export declare function applySessionCapabilityAccess(t: OpenGeniText, client: OpenGeniClient, plan: SessionCapabilityAccessPlan, stillCurrent?: () => boolean): Promise; /** Native OAuth callbacks have already saved the provider connection. Finish * the separate, version-fenced session tool selection before reporting success, * then let the agent continue the request that asked for this connection. */ export declare function completeSessionCapabilityOAuth(t: OpenGeniText, client: OpenGeniClient, workspaceId: string, sessionId: string, capabilityId: string | null): Promise; /** * After setup from an agent's capability card is verified, let the agent * continue the request that needed it, so the person does not have to say * they are done. The server sends at most one continuation per card and none * once the person has written since; a failure here never fails the setup the * person just finished, so it is swallowed. Call only on verified success. */ export declare function continueAfterCapabilitySetup(client: OpenGeniClient, workspaceId: string, sessionId: string, capabilityId: string): void;