import type { ResolutionRequest, ResolutionResponse } from "../../executor/src/index.js"; import type { AuthResolver, Caller, ExecutionEvent, RunLocalSkillResult } from "../../runner-local/src/index.js"; export interface FrameworkBridgeRunOptions { readonly skillPath: string; readonly inputs?: Readonly>; readonly answersPath?: string; readonly receiptDir?: string; readonly runxHome?: string; readonly parentReceipt?: string; readonly contextFrom?: readonly string[]; readonly caller?: Caller; readonly authResolver?: AuthResolver; readonly allowedSourceTypes?: readonly string[]; readonly resumeFromRunId?: string; } export type FrameworkSkillExecutor = (options: FrameworkBridgeRunOptions & { readonly caller: Caller; }) => Promise; export interface FrameworkBoundaryContext { readonly request: ResolutionRequest; readonly events: readonly ExecutionEvent[]; } export type FrameworkBoundaryReply = ResolutionResponse | { readonly actor?: "agent" | "human"; readonly payload: unknown; } | boolean | string | number | Readonly> | undefined; export type FrameworkBoundaryResolver = (context: FrameworkBoundaryContext) => Promise | FrameworkBoundaryReply; export interface FrameworkBridgeOptions { readonly execute: FrameworkSkillExecutor; } export interface FrameworkPausedResult { readonly status: "paused"; readonly skillName: string; readonly runId: string; readonly requests: readonly ResolutionRequest[]; readonly stepIds?: readonly string[]; readonly stepLabels?: readonly string[]; readonly events: readonly ExecutionEvent[]; } export interface FrameworkCompletedResult { readonly status: "completed"; readonly skillName: string; readonly receiptId: string; readonly output: string; readonly events: readonly ExecutionEvent[]; } export interface FrameworkFailedResult { readonly status: "failed"; readonly skillName: string; readonly receiptId?: string; readonly error: string; readonly events: readonly ExecutionEvent[]; } export interface FrameworkDeniedResult { readonly status: "denied"; readonly skillName: string; readonly reasons: readonly string[]; readonly receiptId?: string; readonly events: readonly ExecutionEvent[]; } export type FrameworkRunResult = FrameworkPausedResult | FrameworkCompletedResult | FrameworkFailedResult | FrameworkDeniedResult; export interface FrameworkBridge { readonly run: (options: FrameworkBridgeRunOptions & { readonly resolver?: FrameworkBoundaryResolver; }) => Promise; readonly resume: (runId: string, options: Omit & { readonly resolver?: FrameworkBoundaryResolver; }) => Promise; } export interface OpenAIAdapterResponse { readonly role: "tool"; readonly content: readonly [{ readonly type: "text"; readonly text: string; }]; readonly structuredContent: { readonly runx: FrameworkRunResult; }; } export interface AnthropicAdapterResponse { readonly content: readonly [{ readonly type: "text"; readonly text: string; }]; readonly metadata: { readonly runx: FrameworkRunResult; }; } export interface VercelAiAdapterResponse { readonly messages: readonly [{ readonly role: "assistant"; readonly content: string; }]; readonly data: { readonly runx: FrameworkRunResult; }; } export interface LangChainAdapterResponse { readonly content: string; readonly additional_kwargs: { readonly runx: FrameworkRunResult; }; } export interface CrewAiAdapterResponse { readonly raw: string; readonly json_dict: { readonly runx: FrameworkRunResult; }; } export interface ProviderFrameworkAdapter { readonly run: (options: FrameworkBridgeRunOptions & { readonly resolver?: FrameworkBoundaryResolver; }) => Promise; readonly resume: (runId: string, options: Omit & { readonly resolver?: FrameworkBoundaryResolver; }) => Promise; } export declare function createFrameworkBridge(options: FrameworkBridgeOptions): FrameworkBridge; export declare function createOpenAiAdapter(bridge: FrameworkBridge): ProviderFrameworkAdapter; export declare function createAnthropicAdapter(bridge: FrameworkBridge): ProviderFrameworkAdapter; export declare function createVercelAiAdapter(bridge: FrameworkBridge): ProviderFrameworkAdapter; export declare function createLangChainAdapter(bridge: FrameworkBridge): ProviderFrameworkAdapter; export declare function createCrewAiAdapter(bridge: FrameworkBridge): ProviderFrameworkAdapter;