import type { AgentNodeDefinition, JsonObject, NodeAttemptId, WorkflowDefinition, WorkflowRun, WorkflowRunId, WorkflowValue } from "../types/index.js"; export type ResolvedAgentProfile = { id: string; requestedId: string; aliases?: string[]; tools?: string[]; nativeTools?: string[]; skills?: string[]; contextFiles?: string[]; metadata?: JsonObject; }; export type AgentProfileResolverContext = { workflow: WorkflowDefinition; run: WorkflowRun; nodeId: string; node: AgentNodeDefinition; selection: AgentNodeDefinition["profile"]; }; export type AgentProfileResolver = (context: AgentProfileResolverContext) => Promise | ResolvedAgentProfile | undefined; export type OneNodeAgentExecutorContext = { workflow: WorkflowDefinition; run: WorkflowRun; nodeAttemptId?: NodeAttemptId; nodeId: string; node: AgentNodeDefinition; input: WorkflowValue; prompt: string; profileId: string; resolvedProfile: ResolvedAgentProfile; routing?: AgentNodeDefinition["routing"]; }; export type PiboRoutingJsonValue = null | boolean | number | string | PiboRoutingJsonValue[] | { [key: string]: PiboRoutingJsonValue; }; export type PiboRoutingJsonObject = { [key: string]: PiboRoutingJsonValue; }; export declare const PIBO_WORKFLOW_SESSION_KIND_METADATA_KEY: "workflowSessionKind"; export declare const PIBO_WORKFLOW_SESSION_KINDS: readonly ["main_workflow", "nested_workflow", "agent_node", "subagent"]; export type PiboWorkflowSessionKind = (typeof PIBO_WORKFLOW_SESSION_KINDS)[number]; export type PiboWorkflowSession = { id: string; piSessionId?: string; profile: string; parentId?: string; workspace?: string; metadata?: PiboRoutingJsonObject; }; export type PiboWorkflowSessionCreateInput = { channel: string; kind: string; profile: string; parentId?: string; workspace?: string; title?: string; metadata?: PiboRoutingJsonObject; }; export type PiboWorkflowMessageEvent = { type: "message"; piboSessionId: string; id?: string; text: string; source?: "user" | "ui" | "service" | "actor"; }; export type PiboWorkflowAssistantMessageEvent = { type: "assistant_message"; piboSessionId: string; eventId?: string; text: string; }; export type PiboWorkflowSessionErrorEvent = { type: "session_error"; piboSessionId: string; eventId?: string; error: string; }; export type PiboWorkflowOutputEvent = PiboWorkflowAssistantMessageEvent | PiboWorkflowSessionErrorEvent | { type: string; piboSessionId: string; eventId?: string; }; export type PiboWorkflowSessionStatus = { piboSessionId: string; enabledTools?: string[]; activeTools?: string[]; }; export type PiboWorkflowSessionRouting = { createSession(input: PiboWorkflowSessionCreateInput): PiboWorkflowSession; emit(event: PiboWorkflowMessageEvent): Promise | unknown; subscribe(listener: (event: PiboWorkflowOutputEvent) => void): () => void; getSessionRuntimeStatus?(piboSessionId: string): PiboWorkflowSessionStatus | undefined; }; export type PiboWorkflowSessionLinkInput = { piboSessionId: string; workflowSessionKind?: PiboWorkflowSessionKind; workflowRunId: WorkflowRunId; workflowId: string; workflowVersion: string; workflowNodeId: string; workflowNodeAttemptId?: NodeAttemptId; parentPiboSessionId?: string; }; export type PiboWorkflowSessionLinker = (input: PiboWorkflowSessionLinkInput) => Promise | unknown; export type PiboSessionRoutingAgentExecutorOptions = { routing: PiboWorkflowSessionRouting; workspace?: string; timeoutMs?: number; createMessageId?: () => string; channel?: string; kind?: string; title?: string | ((context: OneNodeAgentExecutorContext) => string | undefined); metadata?: PiboRoutingJsonObject | ((context: OneNodeAgentExecutorContext) => PiboRoutingJsonObject | undefined); linkWorkflowSession?: PiboWorkflowSessionLinker; }; export type OneNodeAgentExecutorResult = { output: WorkflowValue; piboSessionId?: string; piSessionId?: string; effectiveProfile?: string; effectiveTools?: string[]; effectiveSkills?: string[]; effectiveContextFiles?: string[]; }; export type OneNodeAgentExecutor = (context: OneNodeAgentExecutorContext) => Promise | OneNodeAgentExecutorResult; export declare function createPiboSessionRoutingAgentExecutor(options: PiboSessionRoutingAgentExecutorOptions): OneNodeAgentExecutor; //# sourceMappingURL=pibo-routing.d.ts.map