import type { Component, Ref } from 'vue'; import { InterruptResumeOperation } from '../../../ag-ui/types/interrupt'; import type { BkFlowNode, BkFlowTask } from '../../../ag-ui/types/contents'; import type { OnInterruptResume } from '../../../ag-ui/types/interrupt'; import type { FlowNodeVM, FlowTaskVM } from './use-flow-agent'; /** 节点行尾操作类型标识 */ export type FlowNodeActionId = 'detail' | InterruptResumeOperation.FlowNodeRetry | InterruptResumeOperation.FlowNodeSkip; /** 节点行尾操作视图模型:详情 / 重试 / 跳过统一为同一渲染单元(图标 + 文案 + 点击) */ export interface FlowNodeActionVM { /** 按钮图标组件 */ icon: Component; /** 唯一标识,用于 v-for key 与样式钩子 */ id: FlowNodeActionId; /** 国际化文案 */ label: string; /** 点击执行 */ run: () => void; } /** * flow-agent 节点行尾操作 composable。 * * 将「详情(打开侧栏)」与「重试 / 跳过(回传 Agent resume)」聚合为统一的、声明式的 * 操作列表,组件层只需遍历渲染,显隐与点击行为均收敛于此,便于复用、单测与扩展。 */ export declare const useFlowNodeActions: (options: { /** resume 回调(与第三方审批取消同一回调,按 payload.operation 分流) */ onInterruptResume: Ref; /** 打开节点详情侧栏(复用 useFlowTab 的能力) */ openNodeDetail: (task: BkFlowTask, node: BkFlowNode) => void; }) => { getNodeActions: (task: FlowTaskVM, node: FlowNodeVM) => FlowNodeActionVM[]; };