import React from 'react'; export * from './Robot'; export { AGENT_RUN_BAR_TEST_ID } from './testIds'; /** * 任务状态可选值列表 * * @remarks * - `running`:任务正在运行中 * - `success`:任务已成功完成 * - `error`:任务执行出错 * - `pause`:任务已暂停 * - `stopped`:任务已停止 * - `cancelled`:任务已取消 */ export declare const TaskStatusList: readonly ["running", "success", "error", "pause", "stopped", "cancelled"]; /** * 任务状态联合类型 * * 表示一个任务的"宏观状态"(终态或主流程态)。 * 与 {@link TaskRunningStatus} 的区别: * - `TaskStatus` 偏"宏观结果"(成功/失败/取消/已停止/暂停/运行中) * - `TaskRunningStatus` 偏"运行过程态"(运行中/已完成/已暂停) * * 在判断 UI 状态时通常需要两者组合,例如 `taskStatus='running' && taskRunningStatus='pause'` * 表示"任务整体在运行中、当前被用户暂停"。 */ export type TaskStatus = (typeof TaskStatusList)[number]; /** * 任务运行状态可选值列表 * * @remarks * - `running`:正在运行中 * - `complete`:已完成 * - `pause`:已暂停 */ export declare const TaskRunningStatusList: readonly ["running", "complete", "pause"]; /** * 任务运行状态联合类型 * * 表示任务运行过程中的"过程态",详见 {@link TaskStatus} 的对比说明。 */ export type TaskRunningStatus = (typeof TaskRunningStatusList)[number]; /** * 任务状态常量对象(向后兼容) * * 推荐直接使用字符串字面量(如 `'running'`),可获得更好的 tree-shaking 与类型推导。 * 该对象保留以兼容旧代码 `TASK_STATUS.RUNNING` 的写法。 */ export declare const TASK_STATUS: { readonly RUNNING: "running"; readonly SUCCESS: "success"; readonly ERROR: "error"; readonly PAUSE: "pause"; readonly STOPPED: "stopped"; readonly CANCELLED: "cancelled"; }; /** * 任务状态常量对象的类型(向后兼容) * * @deprecated 请直接使用 {@link TaskStatus} 联合类型 * * 此处与同名常量 `TASK_STATUS` 共享名称,依赖 TypeScript 的"值/类型命名空间合并" * 语义;ESLint 的 `no-redeclare` 不识别该模式,故在此显式禁用。 */ export type TASK_STATUS = TaskStatus; /** * 任务运行状态常量对象(向后兼容) * * 推荐直接使用字符串字面量(如 `'running'`),可获得更好的 tree-shaking 与类型推导。 * 该对象保留以兼容旧代码 `TASK_RUNNING_STATUS.RUNNING` 的写法。 */ export declare const TASK_RUNNING_STATUS: { readonly RUNNING: "running"; readonly COMPLETE: "complete"; readonly PAUSE: "pause"; }; /** * 任务运行状态常量对象的类型(向后兼容) * * @deprecated 请直接使用 {@link TaskRunningStatus} 联合类型 * * 此处与同名常量 `TASK_RUNNING_STATUS` 共享名称,依赖 TypeScript 的"值/类型命名空间合并" * 语义;ESLint 的 `no-redeclare` 不识别该模式,故在此显式禁用。 */ export type TASK_RUNNING_STATUS = TaskRunningStatus; /** * 主题样式变体 */ export type AgentRunBarVariant = 'simple' | 'default'; /** * @deprecated 请使用 {@link AgentRunBarVariant} */ export type TaskRunningVariant = AgentRunBarVariant; /** * 任务操作按钮渲染函数 */ export type AgentRunBarActionsRender = (props: { status?: TaskStatus; runningStatus?: TaskRunningStatus; }) => React.ReactNode; /** * @deprecated 请使用 {@link AgentRunBarActionsRender} */ export type TaskRunningActionsRender = AgentRunBarActionsRender; /** * AgentRunBar 组件的属性接口 * * @interface AgentRunBarProps */ export interface AgentRunBarProps { /** 任务状态(宏观/终态),详见 {@link TaskStatus} */ taskStatus: TaskStatus; /** 任务运行状态(过程态),详见 {@link TaskRunningStatus} */ taskRunningStatus: TaskRunningStatus; /** 创建新任务的回调函数 */ onCreateNewTask?: () => void; /** 暂停任务的回调函数 */ onPause?: () => void; /** 继续任务的回调函数 */ onResume?: () => void; /** 停止任务的回调函数 */ onStop?: () => void; /** 重新执行任务的回调函数 */ onReplay?: () => void; /** 查看任务结果的回调函数 */ onViewResult?: () => void; className?: string; style?: React.CSSProperties; /** 自定义图标 */ icon?: React.ReactNode; /** 图标提示文案 */ iconTooltip?: string; /** 标题文案 */ title?: string; /** 描述文案 */ description?: string; /** * 自定义操作按钮(actionNode 部分;不影响 stop/pause/resume 控制按钮) * * 三态语义: * - `undefined`:使用内置默认 actionNode(依据 `taskStatus` / `taskRunningStatus` 自动选择) * - `false`:不渲染任何自定义 actionNode;停止 / 暂停 / 继续控制按钮仍按状态显示 * - 函数:调用并将其返回值作为 actionNode 渲染(返回 `false` / `null` 等同于不渲染该 actionNode) */ actionsRender?: AgentRunBarActionsRender | false; /** 主题样式变体 */ variant?: AgentRunBarVariant; /** 国际化配置 */ locale?: { agentRunBar?: { play?: string; pause?: string; stop?: string; createNewTask?: string; replayTask?: string; newTask?: string; submitTask?: string; }; }; } /** * @deprecated 请使用 {@link AgentRunBarProps} */ export type TaskRunningProps = AgentRunBarProps; /** * AgentRunBar - 智能体任务运行状态条 * * 使用 React.memo 优化性能,避免不必要的重新渲染。 */ export declare const AgentRunBar: React.NamedExoticComponent; /** * @deprecated 请使用 {@link AgentRunBar}。该别名保留以兼容旧代码,将在未来版本移除。 */ export declare const TaskRunning: React.NamedExoticComponent;