part.state 由宿主提供。回合中断且缺少工具终态时,使用 interrupted 显示“结果未确认”。收到工具回执后更新同一行。参数和输出可展开查看,失败原因与局部操作常驻。可用 input、output slots 替换对应详情。
参数与输出默认使用无标题栏的紧凑 CodeBlock,不重复展示“输入 / 输出”和语言栏;复制入口位于内容右上角,保留原始文本与可访问名称。需要标题或专用内容时,通过对应 slot 自定义。
part.icon 可使用公共 Icon 名称区分读取、编辑、图片等工具,默认 terminal。图片、文件或其他结构化结果可以组合进 output slot;正文与执行过程交错示例展示完整用法。
工具摘要行沿用 Reasoning、Process 的轻量展开反馈:hover 不铺整行背景,键盘焦点以文字和下划线提示;标题、失败提示、恢复操作和输出内容与相邻正文同起始边。
API
QuireChatTool Props
Slots 内容位置
input{ part: { /** 工具判别项。 */ kind: "tool"; /** 可读工具名称。 */ title: string; /** 公共 Icon 名称,默认 terminal;由宿主表达读取、编辑、图片等工具类别。 */ icon?: undefined | string; /** 一行任务摘要。 */ summary?: string | undefined; /** 耗时等由宿主提供的元信息。 */ meta?: string | undefined; /** 权威展示状态,不能根据 output 是否存在猜测。 */ state: "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | "interrupted"; /** 自定义状态文案,例如具体等待原因。 */ stateLabel?: string | undefined; /** 可选原始输入文本。 */ input?: string | undefined; /** 可选原始输出文本。 */ output?: string | undefined; /** 输入代码语言标签,默认 text。 */ inputLanguage?: string | undefined; /** 输出代码语言标签,默认 text。 */ outputLanguage?: string | undefined; /** 可读错误说明;不替换已有输出。 */ error?: string | undefined; /** 仅提供部分输出时必须传入的截断说明;默认禁止复制不完整输出。 */ outputTruncated?: string | undefined; /** 消息内唯一、非空的稳定 ID,跨 chunk 和终态保持。 */ id: string; /** 可选的局部操作。 */ actions?: undefined | readonly ({ /** 在所属操作组内稳定且唯一的标识。 */ id: string; /** 可见名称或图标操作的辅助名称。 */ label: string; /** IconProvider 中的图标名;省略时显示文字按钮。 */ icon?: string | undefined; /** 明确不可执行时禁用。 */ disabled?: boolean | undefined; /** 宿主正在处理此操作;阻止重复触发。 */ busy?: boolean | undefined; /** 内联反馈/开关类操作的受控按下状态;有此状态的操作保持内联。 */ pressed?: boolean | undefined; /** 需要危险语义的操作。 */ danger?: boolean | undefined; /** inline 留在操作栏,more 放进紧凑的公共 Menu。 */ placement?: "inline" | "more" | undefined; /** 消息级默认 settled,Part 级默认 always;active 用于停止,always 用于必要恢复/确认。 */ when?: "settled" | "active" | "always" | undefined; })[]; }; }output{ part: { /** 工具判别项。 */ kind: "tool"; /** 可读工具名称。 */ title: string; /** 公共 Icon 名称,默认 terminal;由宿主表达读取、编辑、图片等工具类别。 */ icon?: undefined | string; /** 一行任务摘要。 */ summary?: string | undefined; /** 耗时等由宿主提供的元信息。 */ meta?: string | undefined; /** 权威展示状态,不能根据 output 是否存在猜测。 */ state: "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | "interrupted"; /** 自定义状态文案,例如具体等待原因。 */ stateLabel?: string | undefined; /** 可选原始输入文本。 */ input?: string | undefined; /** 可选原始输出文本。 */ output?: string | undefined; /** 输入代码语言标签,默认 text。 */ inputLanguage?: string | undefined; /** 输出代码语言标签,默认 text。 */ outputLanguage?: string | undefined; /** 可读错误说明;不替换已有输出。 */ error?: string | undefined; /** 仅提供部分输出时必须传入的截断说明;默认禁止复制不完整输出。 */ outputTruncated?: string | undefined; /** 消息内唯一、非空的稳定 ID,跨 chunk 和终态保持。 */ id: string; /** 可选的局部操作。 */ actions?: undefined | readonly ({ /** 在所属操作组内稳定且唯一的标识。 */ id: string; /** 可见名称或图标操作的辅助名称。 */ label: string; /** IconProvider 中的图标名;省略时显示文字按钮。 */ icon?: string | undefined; /** 明确不可执行时禁用。 */ disabled?: boolean | undefined; /** 宿主正在处理此操作;阻止重复触发。 */ busy?: boolean | undefined; /** 内联反馈/开关类操作的受控按下状态;有此状态的操作保持内联。 */ pressed?: boolean | undefined; /** 需要危险语义的操作。 */ danger?: boolean | undefined; /** inline 留在操作栏,more 放进紧凑的公共 Menu。 */ placement?: "inline" | "more" | undefined; /** 消息级默认 settled,Part 级默认 always;active 用于停止,always 用于必要恢复/确认。 */ when?: "settled" | "active" | "always" | undefined; })[]; }; }
Events 组件事件
action[details: QuireKitChatActionDetails]update:open更新
open,可通过对应 v-model 绑定。[value: boolean]