/** Local pathway file format (YAML/JSON) */ export interface PathwayFile { name: string; description?: string; version?: "draft" | "production" | string; global?: { prompt?: string; voice?: string; model?: "base" | "turbo" | "smart"; tools?: string[]; first_sentence?: string; language?: string; }; nodes: Record; tests?: PathwayTestCase[]; } export interface PathwayFileNode { /** * The node's server-side UUID. Written on pull; reused verbatim on push so * id-referencing fields (edge targets, fallbackNodeId, routes[].targetNodeId) * stay valid. Omit for brand-new nodes — an id is minted on push. */ id?: string; type?: string; prompt?: string; condition?: string; is_global?: boolean; global_label?: string; /** Marks the conversation's start node. Falls back to first-node-in-file for hand-written files that never set it. */ is_start?: boolean; /** Dashboard canvas position. Preserved on pull so push doesn't re-layout the graph. */ position?: { x: number; y: number; }; tag?: PathwayFileTag; dialogue_examples?: PathwayFileDialogueExample[]; condition_examples?: PathwayFileConditionExample[]; pathway_examples?: PathwayFilePathwayExample[]; global_description?: string; enable_global_auto_return?: boolean; enable_return_to_prev_before_global?: boolean; prev_node_pathway_label?: string; prev_node_pathway_description?: string; number?: string; code?: string; knowledge_base_id?: string; /** Tool ID to use for KB retrieval (advanced KB nodes) */ kb_tool?: string; /** Filler speech while the KB is being queried */ speech_during_kb?: string; tools?: PathwayFileTool[]; extract_variables?: PathwayFileVariable[]; /** Settings that apply across all extract_variables on this node */ extract_var_settings?: { ignore_previous?: boolean; use_audio?: boolean; }; model_options?: PathwayModelOptions; edges?: PathwayFileEdge[]; /** * Every node-data field the codec doesn't explicitly model, preserved * VERBATIM in the server's own key casing — routes[], fallbackNodeId, * warmTransferFields, responsePathways, and anything the server adds later. * Spread back into the node on push. Edit with care: keys here are the raw * API shape, not the file format's snake_case. */ passthrough?: Record; } /** Visual tag attached to a node — renders as a colored label in the dashboard */ export interface PathwayFileTag { name: string; /** Hex color (e.g. "#FF5733") or a named color the dashboard understands */ color: string; } /** Few-shot example: a sample user input + how the agent should respond at this node */ export interface PathwayFileDialogueExample { user?: string; agent?: string; /** Optional explanation of why this is the right response */ reasoning?: string; } /** Few-shot example for the `condition` field — when condition should fire */ export interface PathwayFileConditionExample { user?: string; /** Whether the condition should match this user input */ matches: boolean; reasoning?: string; } /** Few-shot example for routing decisions — which edge should fire */ export interface PathwayFilePathwayExample { user?: string; /** Name of the target edge / next node */ target?: string; reasoning?: string; } export interface PathwayFileEdge { target: string; label?: string; description?: string; /** The edge's server-side id, preserved on pull and reused on push. */ id?: string; /** Unmodeled edge-data fields, preserved verbatim (server key casing). */ passthrough?: Record; /** @deprecated Use label instead. Kept for backwards compatibility on read. */ condition?: string; } /** * Tool attached to a pathway node. * * Tools are triggered inline during conversation when the LLM decides to call them. * Use tools for information lookups (inventory, availability, pricing). * Use webhook nodes for operational workflows (booking, payment). * * The LLM triggers a tool by outputting . */ export interface PathwayFileTool { name: string; description?: string; type?: "webhook" | "custom_tool"; /** What to say (TTS) before executing the tool */ speech?: string; /** How to handle the result: * - "feed_context": inject result into LLM context, continue dialogue * - "feed_context_and_route": inject result AND evaluate response_pathways to potentially offramp */ behavior?: "feed_context" | "feed_context_and_route"; url?: string; method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"; headers?: Record; body?: Record; /** JSONPath response mapping — extract fields from webhook response */ response_data?: Array<{ name: string; data: string; context?: string; }>; timeout?: number; max_retries?: number; input_schema?: Record; tool_id?: string; response_pathways?: Array<{ variable: string; condition: string; value: string; target_id: string; target_name: string; }>; extract_vars?: Array<{ name: string; type: string; description: string; }>; } export interface PathwayFileVariable { name: string; type: "string" | "integer" | "boolean"; description: string; spelling_precision?: boolean; } export interface PathwayModelOptions { model_type?: "base" | "turbo" | "smart"; temperature?: number; skip_user_response?: boolean; block_interruptions?: boolean; } export interface PathwayTestCase { name: string; scenario: string; expected_path?: string[]; expected_variables?: Record; max_turns?: number; } //# sourceMappingURL=pathway.d.ts.map