AgentThinkingPanel.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <script setup>
  2. /**
  3. * v1.1:Hermes Agent 思考过程展示容器(深色风格)
  4. *
  5. * 整合 3 个区域(ThinkingLive 已提到 WorkflowEditor.vue 的 .nrc-thinking 上方):
  6. * ③ TodoListPanel —— 待办清单(位于工具调用上方)
  7. * ④ ToolCalls —— 工具调用(current + history)
  8. * ⑤ AskforPanel —— 全局唯一用户确认(内嵌)
  9. *
  10. * 还包含 RunReconnectBadge 显示断线重连状态。
  11. */
  12. import ToolCalls from './ToolCalls.vue'
  13. import TodoListPanel from './TodoListPanel.vue'
  14. import AskforPanel from './AskforPanel.vue'
  15. import RunReconnectBadge from './RunReconnectBadge.vue'
  16. defineProps({
  17. // 当前节点结果对象(必填)
  18. node: { type: Object, required: true },
  19. // v1.1:全局 Askfor 暂停点(来自 runner.pendingAsk)
  20. pendingAsk: { type: Object, default: null },
  21. // v1.1:全局重连状态(来自 runner.reconnecting)
  22. reconnecting: { type: Boolean, default: false },
  23. })
  24. const emit = defineEmits(['submit-clarify'])
  25. </script>
  26. <template>
  27. <div class="agent-thinking-panel">
  28. <RunReconnectBadge :reconnecting="reconnecting" />
  29. <!-- ③ 待办清单:放在工具调用上方,running 时强制展开,完成后自动收起 -->
  30. <TodoListPanel
  31. :todos="node.todos || []"
  32. :node-running="node.status === 'running'"
  33. />
  34. <!-- ④ 工具调用:传节点状态,running 时强制展开历史 -->
  35. <ToolCalls
  36. :current-tool="node.currentTool || null"
  37. :history="node.toolHistory || []"
  38. :node-running="node.status === 'running'"
  39. />
  40. <!-- ⑤ Askfor 内嵌(pendingAsk 与当前节点绑定时显示) -->
  41. <AskforPanel :pending="pendingAsk" @submit="answer => emit('submit-clarify', answer)" />
  42. </div>
  43. </template>
  44. <style scoped>
  45. /* v1.1:Agent 思考过程容器,深色风格(与 .nrc-thinking 视觉一致)
  46. 容器本身不占额外 padding/margin,让子组件(ToolCalls/TodoList/Askfor)
  47. 的 margin 直接生效,与 .nrc-thinking 在 .node-result-card 中对齐 */
  48. .agent-thinking-panel {
  49. font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', ui-monospace, monospace;
  50. }
  51. </style>