@wzrhine/agent 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/LICENSE +21 -0
- package/README.md +29 -3
- package/dist/agent.css +16 -0
- package/dist/components/artifact/ArtifactCard.d.ts +59 -0
- package/dist/components/artifact/ArtifactCard.d.ts.map +1 -0
- package/dist/components/artifact/ArtifactCard.js +79 -0
- package/dist/components/artifact/ArtifactCard.js.map +1 -0
- package/dist/components/artifact/FilePreview.d.ts +121 -0
- package/dist/components/artifact/FilePreview.d.ts.map +1 -0
- package/dist/components/artifact/FilePreview.js +213 -0
- package/dist/components/artifact/FilePreview.js.map +1 -0
- package/dist/components/artifact/FilePreviewTabs.d.ts +51 -0
- package/dist/components/artifact/FilePreviewTabs.d.ts.map +1 -0
- package/dist/components/artifact/FilePreviewTabs.js +150 -0
- package/dist/components/artifact/FilePreviewTabs.js.map +1 -0
- package/dist/components/composer/AttachmentList.d.ts +33 -0
- package/dist/components/composer/AttachmentList.d.ts.map +1 -0
- package/dist/components/composer/AttachmentList.js +60 -0
- package/dist/components/composer/AttachmentList.js.map +1 -0
- package/dist/components/composer/Composer.d.ts +119 -0
- package/dist/components/composer/Composer.d.ts.map +1 -0
- package/dist/components/composer/Composer.js +336 -0
- package/dist/components/composer/Composer.js.map +1 -0
- package/dist/components/composer/ComposerInput.d.ts +103 -0
- package/dist/components/composer/ComposerInput.d.ts.map +1 -0
- package/dist/components/composer/ComposerInput.js +301 -0
- package/dist/components/composer/ComposerInput.js.map +1 -0
- package/dist/components/composer/ComposerNotice.d.ts +38 -0
- package/dist/components/composer/ComposerNotice.d.ts.map +1 -0
- package/dist/components/composer/ComposerNotice.js +16 -0
- package/dist/components/composer/ComposerNotice.js.map +1 -0
- package/dist/components/composer/MentionMenu.d.ts +37 -0
- package/dist/components/composer/MentionMenu.d.ts.map +1 -0
- package/dist/components/composer/MentionMenu.js +56 -0
- package/dist/components/composer/MentionMenu.js.map +1 -0
- package/dist/components/composer/MenuPanel.d.ts +49 -0
- package/dist/components/composer/MenuPanel.d.ts.map +1 -0
- package/dist/components/composer/MenuPanel.js +50 -0
- package/dist/components/composer/MenuPanel.js.map +1 -0
- package/dist/components/composer/ModelPicker.d.ts +53 -0
- package/dist/components/composer/ModelPicker.d.ts.map +1 -0
- package/dist/components/composer/ModelPicker.js +126 -0
- package/dist/components/composer/ModelPicker.js.map +1 -0
- package/dist/components/composer/PermissionPicker.d.ts +35 -0
- package/dist/components/composer/PermissionPicker.d.ts.map +1 -0
- package/dist/components/composer/PermissionPicker.js +51 -0
- package/dist/components/composer/PermissionPicker.js.map +1 -0
- package/dist/components/composer/ReferencePicker.d.ts +31 -0
- package/dist/components/composer/ReferencePicker.d.ts.map +1 -0
- package/dist/components/composer/ReferencePicker.js +50 -0
- package/dist/components/composer/ReferencePicker.js.map +1 -0
- package/dist/components/composer/SendStopButton.d.ts +73 -0
- package/dist/components/composer/SendStopButton.d.ts.map +1 -0
- package/dist/components/composer/SendStopButton.js +88 -0
- package/dist/components/composer/SendStopButton.js.map +1 -0
- package/dist/components/composer/SkillPicker.d.ts +26 -0
- package/dist/components/composer/SkillPicker.d.ts.map +1 -0
- package/dist/components/composer/SkillPicker.js +26 -0
- package/dist/components/composer/SkillPicker.js.map +1 -0
- package/dist/components/composer/SlashCommandMenu.d.ts +33 -0
- package/dist/components/composer/SlashCommandMenu.d.ts.map +1 -0
- package/dist/components/composer/SlashCommandMenu.js +43 -0
- package/dist/components/composer/SlashCommandMenu.js.map +1 -0
- package/dist/components/composer/composer-text.d.ts +10 -0
- package/dist/components/composer/composer-text.d.ts.map +1 -0
- package/dist/components/composer/composer-text.js +26 -0
- package/dist/components/composer/composer-text.js.map +1 -0
- package/dist/components/composer/composer-utils.d.ts +74 -0
- package/dist/components/composer/composer-utils.d.ts.map +1 -0
- package/dist/components/composer/composer-utils.js +133 -0
- package/dist/components/composer/composer-utils.js.map +1 -0
- package/dist/components/conversation/ConversationList.d.ts +94 -0
- package/dist/components/conversation/ConversationList.d.ts.map +1 -0
- package/dist/components/conversation/ConversationList.js +81 -0
- package/dist/components/conversation/ConversationList.js.map +1 -0
- package/dist/components/conversation/ConversationRow.d.ts +66 -0
- package/dist/components/conversation/ConversationRow.d.ts.map +1 -0
- package/dist/components/conversation/ConversationRow.js +65 -0
- package/dist/components/conversation/ConversationRow.js.map +1 -0
- package/dist/components/conversation/conversation-status.d.ts +21 -0
- package/dist/components/conversation/conversation-status.d.ts.map +1 -0
- package/dist/components/conversation/conversation-status.js +33 -0
- package/dist/components/conversation/conversation-status.js.map +1 -0
- package/dist/components/intervention/ApprovalDiff.d.ts +14 -0
- package/dist/components/intervention/ApprovalDiff.d.ts.map +1 -0
- package/dist/components/intervention/ApprovalDiff.js +25 -0
- package/dist/components/intervention/ApprovalDiff.js.map +1 -0
- package/dist/components/intervention/ApprovalPanel.d.ts +57 -0
- package/dist/components/intervention/ApprovalPanel.d.ts.map +1 -0
- package/dist/components/intervention/ApprovalPanel.js +111 -0
- package/dist/components/intervention/ApprovalPanel.js.map +1 -0
- package/dist/components/intervention/ErrorRecoveryNotice.d.ts +28 -0
- package/dist/components/intervention/ErrorRecoveryNotice.d.ts.map +1 -0
- package/dist/components/intervention/ErrorRecoveryNotice.js +31 -0
- package/dist/components/intervention/ErrorRecoveryNotice.js.map +1 -0
- package/dist/components/intervention/GrantList.d.ts +49 -0
- package/dist/components/intervention/GrantList.d.ts.map +1 -0
- package/dist/components/intervention/GrantList.js +58 -0
- package/dist/components/intervention/GrantList.js.map +1 -0
- package/dist/components/intervention/InterventionDock.d.ts +24 -0
- package/dist/components/intervention/InterventionDock.d.ts.map +1 -0
- package/dist/components/intervention/InterventionDock.js +18 -0
- package/dist/components/intervention/InterventionDock.js.map +1 -0
- package/dist/components/intervention/QuestionnaireCard.d.ts +81 -0
- package/dist/components/intervention/QuestionnaireCard.d.ts.map +1 -0
- package/dist/components/intervention/QuestionnaireCard.js +333 -0
- package/dist/components/intervention/QuestionnaireCard.js.map +1 -0
- package/dist/components/intervention/action-lock.d.ts +20 -0
- package/dist/components/intervention/action-lock.d.ts.map +1 -0
- package/dist/components/intervention/action-lock.js +65 -0
- package/dist/components/intervention/action-lock.js.map +1 -0
- package/dist/components/intervention/icons.d.ts +8 -0
- package/dist/components/intervention/icons.d.ts.map +1 -0
- package/dist/components/intervention/icons.js +11 -0
- package/dist/components/intervention/icons.js.map +1 -0
- package/dist/components/intervention/questionnaire-answers.d.ts +34 -0
- package/dist/components/intervention/questionnaire-answers.d.ts.map +1 -0
- package/dist/components/intervention/questionnaire-answers.js +97 -0
- package/dist/components/intervention/questionnaire-answers.js.map +1 -0
- package/dist/components/message/AgentMessage.d.ts +98 -0
- package/dist/components/message/AgentMessage.d.ts.map +1 -0
- package/dist/components/message/AgentMessage.js +94 -0
- package/dist/components/message/AgentMessage.js.map +1 -0
- package/dist/components/message/CitationChip.d.ts +38 -0
- package/dist/components/message/CitationChip.d.ts.map +1 -0
- package/dist/components/message/CitationChip.js +32 -0
- package/dist/components/message/CitationChip.js.map +1 -0
- package/dist/components/message/CodeBlock.d.ts +45 -0
- package/dist/components/message/CodeBlock.d.ts.map +1 -0
- package/dist/components/message/CodeBlock.js +21 -0
- package/dist/components/message/CodeBlock.js.map +1 -0
- package/dist/components/message/JumpToLatest.d.ts +27 -0
- package/dist/components/message/JumpToLatest.d.ts.map +1 -0
- package/dist/components/message/JumpToLatest.js +17 -0
- package/dist/components/message/JumpToLatest.js.map +1 -0
- package/dist/components/message/Markdown.d.ts +21 -0
- package/dist/components/message/Markdown.d.ts.map +1 -0
- package/dist/components/message/Markdown.js +21 -0
- package/dist/components/message/Markdown.js.map +1 -0
- package/dist/components/message/MessageActions.d.ts +67 -0
- package/dist/components/message/MessageActions.d.ts.map +1 -0
- package/dist/components/message/MessageActions.js +83 -0
- package/dist/components/message/MessageActions.js.map +1 -0
- package/dist/components/message/MessageList.d.ts +106 -0
- package/dist/components/message/MessageList.d.ts.map +1 -0
- package/dist/components/message/MessageList.js +327 -0
- package/dist/components/message/MessageList.js.map +1 -0
- package/dist/components/message/MessagePart.d.ts +44 -0
- package/dist/components/message/MessagePart.d.ts.map +1 -0
- package/dist/components/message/MessagePart.js +150 -0
- package/dist/components/message/MessagePart.js.map +1 -0
- package/dist/components/message/RunDetails.d.ts +26 -0
- package/dist/components/message/RunDetails.d.ts.map +1 -0
- package/dist/components/message/RunDetails.js +113 -0
- package/dist/components/message/RunDetails.js.map +1 -0
- package/dist/components/message/SkillUseList.d.ts +22 -0
- package/dist/components/message/SkillUseList.d.ts.map +1 -0
- package/dist/components/message/SkillUseList.js +20 -0
- package/dist/components/message/SkillUseList.js.map +1 -0
- package/dist/components/message/ThinkingBlock.d.ts +44 -0
- package/dist/components/message/ThinkingBlock.d.ts.map +1 -0
- package/dist/components/message/ThinkingBlock.js +34 -0
- package/dist/components/message/ThinkingBlock.js.map +1 -0
- package/dist/components/message/icons.d.ts +14 -0
- package/dist/components/message/icons.d.ts.map +1 -0
- package/dist/components/message/icons.js +16 -0
- package/dist/components/message/icons.js.map +1 -0
- package/dist/components/message/plain-text.d.ts +11 -0
- package/dist/components/message/plain-text.d.ts.map +1 -0
- package/dist/components/message/plain-text.js +58 -0
- package/dist/components/message/plain-text.js.map +1 -0
- package/dist/components/message/renderers.d.ts +30 -0
- package/dist/components/message/renderers.d.ts.map +1 -0
- package/dist/components/message/renderers.js +2 -0
- package/dist/components/message/renderers.js.map +1 -0
- package/dist/components/message/use-copy.d.ts +19 -0
- package/dist/components/message/use-copy.d.ts.map +1 -0
- package/dist/components/message/use-copy.js +67 -0
- package/dist/components/message/use-copy.js.map +1 -0
- package/dist/components/process/AgentProcess.d.ts +47 -0
- package/dist/components/process/AgentProcess.d.ts.map +1 -0
- package/dist/components/process/AgentProcess.js +78 -0
- package/dist/components/process/AgentProcess.js.map +1 -0
- package/dist/components/process/RunStatus.d.ts +60 -0
- package/dist/components/process/RunStatus.d.ts.map +1 -0
- package/dist/components/process/RunStatus.js +34 -0
- package/dist/components/process/RunStatus.js.map +1 -0
- package/dist/components/shell/AgentEmptyState.d.ts +35 -0
- package/dist/components/shell/AgentEmptyState.d.ts.map +1 -0
- package/dist/components/shell/AgentEmptyState.js +20 -0
- package/dist/components/shell/AgentEmptyState.js.map +1 -0
- package/dist/components/shell/AgentHeader.d.ts +84 -0
- package/dist/components/shell/AgentHeader.d.ts.map +1 -0
- package/dist/components/shell/AgentHeader.js +43 -0
- package/dist/components/shell/AgentHeader.js.map +1 -0
- package/dist/components/shell/AgentShell.d.ts +154 -0
- package/dist/components/shell/AgentShell.d.ts.map +1 -0
- package/dist/components/shell/AgentShell.js +210 -0
- package/dist/components/shell/AgentShell.js.map +1 -0
- package/dist/components/shell/AgentSidePane.d.ts +54 -0
- package/dist/components/shell/AgentSidePane.d.ts.map +1 -0
- package/dist/components/shell/AgentSidePane.js +26 -0
- package/dist/components/shell/AgentSidePane.js.map +1 -0
- package/dist/components/shell/ResizeHandle.d.ts +54 -0
- package/dist/components/shell/ResizeHandle.d.ts.map +1 -0
- package/dist/components/shell/ResizeHandle.js +94 -0
- package/dist/components/shell/ResizeHandle.js.map +1 -0
- package/dist/components/shell/use-controllable.d.ts +9 -0
- package/dist/components/shell/use-controllable.d.ts.map +1 -0
- package/dist/components/shell/use-controllable.js +26 -0
- package/dist/components/shell/use-controllable.js.map +1 -0
- package/dist/components/tools/ChunkPager.d.ts +48 -0
- package/dist/components/tools/ChunkPager.d.ts.map +1 -0
- package/dist/components/tools/ChunkPager.js +68 -0
- package/dist/components/tools/ChunkPager.js.map +1 -0
- package/dist/components/tools/CodeModeToolTree.d.ts +64 -0
- package/dist/components/tools/CodeModeToolTree.d.ts.map +1 -0
- package/dist/components/tools/CodeModeToolTree.js +97 -0
- package/dist/components/tools/CodeModeToolTree.js.map +1 -0
- package/dist/components/tools/DiffPreview.d.ts +83 -0
- package/dist/components/tools/DiffPreview.d.ts.map +1 -0
- package/dist/components/tools/DiffPreview.js +95 -0
- package/dist/components/tools/DiffPreview.js.map +1 -0
- package/dist/components/tools/ToolActivity.d.ts +63 -0
- package/dist/components/tools/ToolActivity.d.ts.map +1 -0
- package/dist/components/tools/ToolActivity.js +45 -0
- package/dist/components/tools/ToolActivity.js.map +1 -0
- package/dist/components/tools/ToolDetails.d.ts +118 -0
- package/dist/components/tools/ToolDetails.d.ts.map +1 -0
- package/dist/components/tools/ToolDetails.js +258 -0
- package/dist/components/tools/ToolDetails.js.map +1 -0
- package/dist/components/tools/ToolHistory.d.ts +48 -0
- package/dist/components/tools/ToolHistory.d.ts.map +1 -0
- package/dist/components/tools/ToolHistory.js +37 -0
- package/dist/components/tools/ToolHistory.js.map +1 -0
- package/dist/components/tools/ToolOutput.d.ts +61 -0
- package/dist/components/tools/ToolOutput.d.ts.map +1 -0
- package/dist/components/tools/ToolOutput.js +45 -0
- package/dist/components/tools/ToolOutput.js.map +1 -0
- package/dist/components/tools/ToolRecord.d.ts +58 -0
- package/dist/components/tools/ToolRecord.d.ts.map +1 -0
- package/dist/components/tools/ToolRecord.js +79 -0
- package/dist/components/tools/ToolRecord.js.map +1 -0
- package/dist/components/tools/shared.d.ts +93 -0
- package/dist/components/tools/shared.d.ts.map +1 -0
- package/dist/components/tools/shared.js +160 -0
- package/dist/components/tools/shared.js.map +1 -0
- package/dist/components/workspace/ActivityLedger.d.ts +44 -0
- package/dist/components/workspace/ActivityLedger.d.ts.map +1 -0
- package/dist/components/workspace/ActivityLedger.js +63 -0
- package/dist/components/workspace/ActivityLedger.js.map +1 -0
- package/dist/components/workspace/CompactionNotice.d.ts +63 -0
- package/dist/components/workspace/CompactionNotice.d.ts.map +1 -0
- package/dist/components/workspace/CompactionNotice.js +36 -0
- package/dist/components/workspace/CompactionNotice.js.map +1 -0
- package/dist/components/workspace/ContextUsage.d.ts +50 -0
- package/dist/components/workspace/ContextUsage.d.ts.map +1 -0
- package/dist/components/workspace/ContextUsage.js +106 -0
- package/dist/components/workspace/ContextUsage.js.map +1 -0
- package/dist/components/workspace/PersistentTerminal.d.ts +86 -0
- package/dist/components/workspace/PersistentTerminal.d.ts.map +1 -0
- package/dist/components/workspace/PersistentTerminal.js +155 -0
- package/dist/components/workspace/PersistentTerminal.js.map +1 -0
- package/dist/components/workspace/PinnedSummary.d.ts +43 -0
- package/dist/components/workspace/PinnedSummary.d.ts.map +1 -0
- package/dist/components/workspace/PinnedSummary.js +33 -0
- package/dist/components/workspace/PinnedSummary.js.map +1 -0
- package/dist/components/workspace/RunOverview.d.ts +29 -0
- package/dist/components/workspace/RunOverview.d.ts.map +1 -0
- package/dist/components/workspace/RunOverview.js +20 -0
- package/dist/components/workspace/RunOverview.js.map +1 -0
- package/dist/components/workspace/RunSummary.d.ts +35 -0
- package/dist/components/workspace/RunSummary.d.ts.map +1 -0
- package/dist/components/workspace/RunSummary.js +46 -0
- package/dist/components/workspace/RunSummary.js.map +1 -0
- package/dist/components/workspace/SubAgentCard.d.ts +64 -0
- package/dist/components/workspace/SubAgentCard.d.ts.map +1 -0
- package/dist/components/workspace/SubAgentCard.js +78 -0
- package/dist/components/workspace/SubAgentCard.js.map +1 -0
- package/dist/components/workspace/TerminalRow.d.ts +61 -0
- package/dist/components/workspace/TerminalRow.d.ts.map +1 -0
- package/dist/components/workspace/TerminalRow.js +65 -0
- package/dist/components/workspace/TerminalRow.js.map +1 -0
- package/dist/components/workspace/shared.d.ts +26 -0
- package/dist/components/workspace/shared.d.ts.map +1 -0
- package/dist/components/workspace/shared.js +41 -0
- package/dist/components/workspace/shared.js.map +1 -0
- package/dist/index.d.ts +136 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -0
- package/dist/motion/agent-motion.d.ts +62 -0
- package/dist/motion/agent-motion.d.ts.map +1 -0
- package/dist/motion/agent-motion.js +61 -0
- package/dist/motion/agent-motion.js.map +1 -0
- package/dist/primitives/AgentSpark.d.ts +17 -0
- package/dist/primitives/AgentSpark.d.ts.map +1 -0
- package/dist/primitives/AgentSpark.js +11 -0
- package/dist/primitives/AgentSpark.js.map +1 -0
- package/dist/primitives/AgentStatus.d.ts +32 -0
- package/dist/primitives/AgentStatus.d.ts.map +1 -0
- package/dist/primitives/AgentStatus.js +13 -0
- package/dist/primitives/AgentStatus.js.map +1 -0
- package/dist/primitives/StatusGlyph.d.ts +16 -0
- package/dist/primitives/StatusGlyph.d.ts.map +1 -0
- package/dist/primitives/StatusGlyph.js +31 -0
- package/dist/primitives/StatusGlyph.js.map +1 -0
- package/dist/primitives/icons.d.ts +13 -0
- package/dist/primitives/icons.d.ts.map +1 -0
- package/dist/primitives/icons.js +55 -0
- package/dist/primitives/icons.js.map +1 -0
- package/dist/provider/AgentMessages.d.ts +61 -0
- package/dist/provider/AgentMessages.d.ts.map +1 -0
- package/dist/provider/AgentMessages.js +81 -0
- package/dist/provider/AgentMessages.js.map +1 -0
- package/dist/provider/messages/composer.d.ts +112 -0
- package/dist/provider/messages/composer.d.ts.map +1 -0
- package/dist/provider/messages/composer.js +165 -0
- package/dist/provider/messages/composer.js.map +1 -0
- package/dist/provider/messages/intervention.d.ts +136 -0
- package/dist/provider/messages/intervention.d.ts.map +1 -0
- package/dist/provider/messages/intervention.js +321 -0
- package/dist/provider/messages/intervention.js.map +1 -0
- package/dist/provider/messages/message.d.ts +119 -0
- package/dist/provider/messages/message.d.ts.map +1 -0
- package/dist/provider/messages/message.js +224 -0
- package/dist/provider/messages/message.js.map +1 -0
- package/dist/provider/messages/shell.d.ts +70 -0
- package/dist/provider/messages/shell.d.ts.map +1 -0
- package/dist/provider/messages/shell.js +109 -0
- package/dist/provider/messages/shell.js.map +1 -0
- package/dist/provider/messages/status.d.ts +21 -0
- package/dist/provider/messages/status.d.ts.map +1 -0
- package/dist/provider/messages/status.js +195 -0
- package/dist/provider/messages/status.js.map +1 -0
- package/dist/provider/messages/tools.d.ts +217 -0
- package/dist/provider/messages/tools.d.ts.map +1 -0
- package/dist/provider/messages/tools.js +496 -0
- package/dist/provider/messages/tools.js.map +1 -0
- package/dist/provider/messages/workspace.d.ts +187 -0
- package/dist/provider/messages/workspace.d.ts.map +1 -0
- package/dist/provider/messages/workspace.js +333 -0
- package/dist/provider/messages/workspace.js.map +1 -0
- package/dist/styles/artifact.css +564 -0
- package/dist/styles/base.css +220 -0
- package/dist/styles/composer.css +1001 -0
- package/dist/styles/conversation.css +275 -0
- package/dist/styles/intervention.css +929 -0
- package/dist/styles/message.css +917 -0
- package/dist/styles/process.css +207 -0
- package/dist/styles/shell.css +453 -0
- package/dist/styles/tools.css +929 -0
- package/dist/styles/workspace.css +1297 -0
- package/dist/styles/wpi-adoption.css +24 -0
- package/dist/utils/cx.d.ts +3 -0
- package/dist/utils/cx.d.ts.map +1 -0
- package/dist/utils/cx.js +5 -0
- package/dist/utils/cx.js.map +1 -0
- package/package.json +64 -3
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { lineDiff } from '@wzrhine/agent-core';
|
|
5
|
+
import { useAgentFormat, useAgentMessages } from '../../provider/AgentMessages.js';
|
|
6
|
+
import { AgentSpark } from '../../primitives/AgentSpark.js';
|
|
7
|
+
import { cx } from '../../utils/cx.js';
|
|
8
|
+
import { DiffPreview, MultiFileDiff } from './DiffPreview.js';
|
|
9
|
+
import { ChunkPager } from './ChunkPager.js';
|
|
10
|
+
import { ToolOutput } from './ToolOutput.js';
|
|
11
|
+
import { ActionButton, CodeView, CopyButton, MetaList, Notice, Pill, toDisplayJson } from './shared.js';
|
|
12
|
+
function Section({ title, children, className }) {
|
|
13
|
+
return (_jsxs("div", { className: cx('rl-agent-detail__section', className), children: [title != null && _jsx("p", { className: "rl-agent-detail__title", children: title }), children] }));
|
|
14
|
+
}
|
|
15
|
+
function fileName(path) {
|
|
16
|
+
const parts = path.split(/[\\/]/);
|
|
17
|
+
return parts[parts.length - 1] || path;
|
|
18
|
+
}
|
|
19
|
+
/** FileReadDetail (atlas 37): path, range, preview with line numbers from `range.start`, real result info. */
|
|
20
|
+
export function FileReadDetail({ detail, onReadMore, className, ...rest }) {
|
|
21
|
+
const m = useAgentMessages().tools;
|
|
22
|
+
const fmt = useAgentFormat();
|
|
23
|
+
const unit = detail.nextOffsetUnit ?? detail.range?.unit ?? 'lines';
|
|
24
|
+
const startLine = detail.range?.unit === 'lines' ? detail.range.start : detail.range ? undefined : 1;
|
|
25
|
+
// Only facts the runtime reported; nothing is inferred (no "next offset" without `nextOffset`).
|
|
26
|
+
const facts = [
|
|
27
|
+
detail.eof === true && m.readEof,
|
|
28
|
+
detail.eof === false && (detail.nextOffset != null ? m.readContinue(detail.nextOffset, unit) : m.readNotEof),
|
|
29
|
+
detail.eof === undefined && detail.nextOffset != null && m.readContinue(detail.nextOffset, unit),
|
|
30
|
+
detail.totalLines != null && m.readTotalLines(fmt.number(detail.totalLines)),
|
|
31
|
+
detail.bytes != null && m.readBytes(fmt.bytes(detail.bytes)),
|
|
32
|
+
].filter((x) => typeof x === 'string');
|
|
33
|
+
return (_jsxs("div", { ...rest, className: cx('rl-agent-detail', className), "data-kind": "file-read", children: [_jsx(MetaList, { items: [
|
|
34
|
+
{ label: m.path, value: detail.path, mono: true },
|
|
35
|
+
detail.version != null && { label: m.currentVersion, value: detail.version, mono: true },
|
|
36
|
+
detail.range && {
|
|
37
|
+
label: m.editRange,
|
|
38
|
+
value: m.readRange(detail.range.start, detail.range.end, detail.range.unit),
|
|
39
|
+
},
|
|
40
|
+
] }), detail.error ? (_jsx(Notice, { tone: detail.error === 'not-found' ? 'warning' : 'danger', children: m.readError[detail.error](fileName(detail.path)) })) : (detail.preview != null && _jsx(CodeView, { code: detail.preview, label: m.readPreview(detail.path), startLine: startLine })), !detail.error && facts.length > 0 && (_jsx("ul", { className: "rl-agent-detail__facts", "aria-label": m.readResult, children: facts.map((fact, i) => (_jsx("li", { children: fact }, i))) })), detail.nextOffset != null && onReadMore && (_jsx("div", { className: "rl-agent-detail__actions", children: _jsx(ActionButton, { icon: "arrow-down", onClick: () => onReadMore(detail.nextOffset), children: m.readMore }) }))] }));
|
|
41
|
+
}
|
|
42
|
+
/** FileWriteDetail (atlas 38): target, write mode, expected vs current version, proposal diff. */
|
|
43
|
+
export function FileWriteDetail({ detail, onReload, onViewFull, beforeActions, display = 'diff', className, ...rest }) {
|
|
44
|
+
const m = useAgentMessages().tools;
|
|
45
|
+
const fmt = useAgentFormat();
|
|
46
|
+
const conflict = detail.expectedVersion != null && detail.currentVersion != null && detail.expectedVersion !== detail.currentVersion;
|
|
47
|
+
return (_jsxs("div", { ...rest, className: cx('rl-agent-detail', className), "data-kind": "file-write", children: [_jsx(MetaList, { items: [
|
|
48
|
+
{ label: m.writeTarget, value: detail.path, mono: true },
|
|
49
|
+
{ label: m.writeModeLabel, value: m.writeMode[detail.mode] },
|
|
50
|
+
detail.diff?.created && { label: m.writeCreated, value: m.writeCreated },
|
|
51
|
+
detail.diff?.observedBytes !== undefined && { label: m.writeObservedBytes(fmt.bytes(detail.diff.observedBytes)), value: fmt.bytes(detail.diff.observedBytes), mono: true },
|
|
52
|
+
detail.expectedVersion != null && {
|
|
53
|
+
label: m.expectedVersion,
|
|
54
|
+
value: detail.expectedVersion,
|
|
55
|
+
mono: true,
|
|
56
|
+
},
|
|
57
|
+
detail.currentVersion != null && {
|
|
58
|
+
label: m.currentVersion,
|
|
59
|
+
value: detail.currentVersion,
|
|
60
|
+
mono: true,
|
|
61
|
+
},
|
|
62
|
+
] }), conflict && (_jsx(Notice, { tone: "warning", action: onReload && (_jsx(ActionButton, { icon: "retry", onClick: onReload, children: m.reloadFile })), children: m.versionConflict(detail.expectedVersion, detail.currentVersion) })), detail.materialReady === false && _jsx(Notice, { tone: "info", children: m.materialPending }), detail.diff?.statsReliable === false && _jsx(Notice, { tone: "info", children: m.writeStatsUnreliable }), detail.diff?.before && _jsx(ChunkPager, { page: detail.diff.before, label: m.expectedVersion, canGoBack: false, ...beforeActions }), detail.diff && display === 'verbatim' && _jsx(CodeView, { code: detail.diff.hunks.flatMap((hunk) => hunk.lines.filter((line) => line.kind !== 'meta').map((line) => line.text)).join('\n'), label: m.writeTarget }), detail.diff && display === 'diff' && (_jsx(DiffPreview, { diff: conflict && !detail.diff.status ? { ...detail.diff, status: 'conflict' } : detail.diff, onReload: conflict ? undefined : onReload, onViewFull: onViewFull }))] }));
|
|
63
|
+
}
|
|
64
|
+
/** EditFileDetail (atlas 39): every edit as 「编辑 N」 with range, strategy and a before/after diff. */
|
|
65
|
+
export function EditFileDetail({ detail, pageActions, display = 'diff', className, ...rest }) {
|
|
66
|
+
const m = useAgentMessages().tools;
|
|
67
|
+
return (_jsxs("div", { ...rest, className: cx('rl-agent-detail', className), "data-kind": "file-edit", children: [_jsx(MetaList, { items: [
|
|
68
|
+
{ label: m.path, value: detail.path, mono: true },
|
|
69
|
+
detail.expectedVersion != null && {
|
|
70
|
+
label: m.expectedVersion,
|
|
71
|
+
value: detail.expectedVersion,
|
|
72
|
+
mono: true,
|
|
73
|
+
},
|
|
74
|
+
] }), detail.materialReady === false && _jsx(Notice, { tone: "info", children: m.materialPending }), detail.replacementCount !== undefined && _jsx("p", { className: "rl-agent-detail__aside", children: m.editTitle(detail.replacementCount) }), detail.complete === false && _jsx(Notice, { tone: "info", children: m.editTruncated }), detail.page && _jsx(ChunkPager, { page: detail.page, label: m.editRange, canGoBack: false, ...pageActions }), _jsx("ol", { className: "rl-agent-detail__edits", children: detail.edits.map((edit, i) => {
|
|
75
|
+
const result = lineDiff(edit.before, edit.after);
|
|
76
|
+
const offset = edit.range?.unit === 'lines' ? edit.range.start - 1 : 0;
|
|
77
|
+
const lines = result.hunk.lines.map((line) => ({
|
|
78
|
+
...line,
|
|
79
|
+
oldLine: line.oldLine != null ? line.oldLine + offset : undefined,
|
|
80
|
+
newLine: line.newLine != null ? line.newLine + offset : undefined,
|
|
81
|
+
}));
|
|
82
|
+
return (_jsxs("li", { className: "rl-agent-detail__edit", children: [_jsxs("p", { className: "rl-agent-detail__title", children: [m.editTitle(i + 1), edit.range && (_jsx("span", { className: "rl-agent-detail__aside", children: m.readRange(edit.range.start, edit.range.end, edit.range.unit) })), edit.strategy && (_jsxs("span", { className: "rl-agent-detail__aside", children: [m.editStrategy, " \u00B7 ", edit.strategy] }))] }), display === 'verbatim' ? _jsxs(_Fragment, { children: [_jsx(CodeView, { code: edit.before, label: m.expectedVersion }), _jsx(CodeView, { code: edit.after, label: m.currentVersion })] }) : _jsx(DiffPreview, { hideHeader: true, diff: {
|
|
83
|
+
path: `${detail.path} · ${m.editTitle(i + 1)}`,
|
|
84
|
+
change: 'update',
|
|
85
|
+
hunks: [{ ...result.hunk, id: `${edit.id}-h`, lines }],
|
|
86
|
+
truncated: edit.truncated || result.truncated,
|
|
87
|
+
} })] }, edit.id));
|
|
88
|
+
}) })] }));
|
|
89
|
+
}
|
|
90
|
+
/** ApplyPatchDetail (atlas 40): per-file change and status; a conflict names its files. */
|
|
91
|
+
export function ApplyPatchDetail({ detail, onReload, onViewFull, rawActions, className, ...rest }) {
|
|
92
|
+
const m = useAgentMessages().tools;
|
|
93
|
+
const conflicts = detail.files.filter((f) => f.status === 'conflict').map((f) => f.path);
|
|
94
|
+
return (_jsxs("div", { ...rest, className: cx('rl-agent-detail', className), "data-kind": "patch", children: [detail.revision && _jsx("p", { className: "rl-agent-detail__aside", children: m.revision(detail.revision) }), detail.baseVersion && _jsxs("p", { className: "rl-agent-detail__aside", children: [m.expectedVersion, " ", detail.baseVersion] }), detail.raw && _jsx(ChunkPager, { page: detail.raw, label: m.patchFiles, canGoBack: false, ...rawActions }), conflicts.length > 0 && _jsx(Notice, { tone: "warning", children: m.patchConflict(conflicts.join(', ')) }), detail.materialReady === false && _jsx(Notice, { tone: "info", children: m.materialPending }), detail.hunksAvailable === false ? _jsx("ul", { "aria-label": m.patchFiles, children: detail.files.map((file) => _jsx("li", { children: file.path }, file.path)) }) : _jsx(MultiFileDiff, { files: detail.files, label: m.patchFiles, onReload: onReload, onViewFull: onViewFull })] }));
|
|
95
|
+
}
|
|
96
|
+
const opStatusMeta = {
|
|
97
|
+
pending: { glyph: 'pending', tone: 'neutral' },
|
|
98
|
+
completed: { glyph: 'done', tone: 'success' },
|
|
99
|
+
failed: { glyph: 'failed', tone: 'danger' },
|
|
100
|
+
conflict: { glyph: 'failed', tone: 'warning' },
|
|
101
|
+
};
|
|
102
|
+
/** ManageFilesDetail (atlas 41): operation table; delete rows carry 「不能自动恢复」 in text. */
|
|
103
|
+
export function ManageFilesDetail({ detail, onLoadMore, loadingMore, pageActions, className, ...rest }) {
|
|
104
|
+
const m = useAgentMessages().tools;
|
|
105
|
+
return (_jsxs("div", { ...rest, className: cx('rl-agent-detail', className), "data-kind": "manage-files", children: [detail.materialReady === false && _jsx(Notice, { tone: "info", children: m.materialPending }), detail.counts && _jsx("dl", { className: "rl-agent-detail__counts", children: Object.entries(detail.counts).map(([kind, count]) => _jsxs("div", { children: [_jsx("dt", { children: m.manageOp[kind] }), _jsx("dd", { children: count })] }, kind)) }), detail.total !== undefined && _jsx("p", { className: "rl-agent-detail__aside", children: detail.total }), detail.page && _jsx(ChunkPager, { page: detail.page, label: m.manageList, canGoBack: false, ...pageActions }), _jsx("div", { className: "rl-agent-detail__table-scroll", role: "region", tabIndex: 0, "aria-label": m.codeRegion(m.manageList), children: _jsxs("table", { className: "rl-agent-ops", children: [_jsx("caption", { className: "rl-agent-sr", children: m.manageList }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: m.manageColumns.type }), _jsx("th", { scope: "col", children: m.manageColumns.path }), _jsx("th", { scope: "col", children: m.manageColumns.status })] }) }), _jsx("tbody", { children: detail.operations.map((op) => {
|
|
106
|
+
const danger = op.type === 'delete';
|
|
107
|
+
return (_jsxs("tr", { "data-danger": danger || undefined, children: [_jsx("th", { scope: "row", className: "rl-agent-ops__type", children: m.manageOp[op.type] }), _jsxs("td", { className: "rl-agent-ops__path", children: [_jsx("code", { children: op.source }), op.target && (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: " \u2192 " }), _jsxs("span", { className: "rl-agent-sr", children: [" ", m.manageTarget, " "] }), _jsx("code", { children: op.target })] })), (op.recursive || danger || op.reason) && (_jsxs("span", { className: "rl-agent-ops__notes", children: [op.recursive && _jsx("span", { children: m.manageRecursive }), danger && _jsx("span", { className: "rl-agent-ops__danger", children: m.manageIrreversible }), op.reason && _jsx("span", { children: op.reason })] }))] }), _jsx("td", { children: op.status && _jsx(Pill, { ...opStatusMeta[op.status], label: m.manageStatus[op.status] }) })] }, op.id));
|
|
108
|
+
}) })] }) }), detail.hasMore && onLoadMore && (_jsx("div", { className: "rl-agent-detail__actions", children: _jsx(ActionButton, { icon: "arrow-down", onClick: onLoadMore, busy: loadingMore, children: m.manageLoadMore }) }))] }));
|
|
109
|
+
}
|
|
110
|
+
const executionMeta = {
|
|
111
|
+
pending: { glyph: 'pending', tone: 'neutral', active: true },
|
|
112
|
+
running: { glyph: 'terminal', tone: 'accent', active: true },
|
|
113
|
+
returned: { glyph: 'done', tone: 'neutral' },
|
|
114
|
+
background: { glyph: 'terminal', tone: 'info', active: true },
|
|
115
|
+
'timed-out': { glyph: 'failed', tone: 'warning' },
|
|
116
|
+
'cancel-unconfirmed': { glyph: 'stopping', tone: 'warning', active: true },
|
|
117
|
+
};
|
|
118
|
+
/** RunCommandDetail (atlas 42): command, cwd, shell, timeout, execution state, exit code, terminal output. */
|
|
119
|
+
export function RunCommandDetail({ detail, onOpenTerminal, outputProps, onCopyText, className, ...rest }) {
|
|
120
|
+
const m = useAgentMessages().tools;
|
|
121
|
+
const fmt = useAgentFormat();
|
|
122
|
+
const failed = detail.exitCode != null && detail.exitCode !== 0;
|
|
123
|
+
return (_jsxs("div", { ...rest, className: cx('rl-agent-detail', className), "data-kind": "command", children: [_jsxs("div", { className: "rl-agent-command", children: [_jsx("span", { className: "rl-agent-command__prompt", "aria-hidden": "true", children: "$" }), _jsx("div", { className: "rl-agent-command__scroll", role: "region", tabIndex: 0, "aria-label": m.commandLabel, children: _jsx("code", { className: "rl-agent-command__text", children: detail.command }) }), _jsx(CopyButton, { text: detail.command, label: m.copyCommand, onCopyText: onCopyText })] }), _jsx(MetaList, { items: [
|
|
124
|
+
detail.cwd && { label: m.commandCwd, value: detail.cwd, mono: true },
|
|
125
|
+
detail.shell && {
|
|
126
|
+
label: m.commandShell,
|
|
127
|
+
value: detail.shell,
|
|
128
|
+
mono: true,
|
|
129
|
+
},
|
|
130
|
+
detail.timeoutMs != null && {
|
|
131
|
+
label: m.commandTimeout,
|
|
132
|
+
value: fmt.duration(detail.timeoutMs),
|
|
133
|
+
mono: true,
|
|
134
|
+
},
|
|
135
|
+
] }), _jsxs("div", { className: "rl-agent-detail__row", children: [detail.execution && _jsx(Pill, { ...executionMeta[detail.execution], label: m.commandExecution[detail.execution] }), detail.exitCode != null ? (_jsx("span", { className: "rl-agent-command__exit", "data-failed": failed || undefined, children: failed ? m.exitCodeFailed(detail.exitCode) : m.exitCode(detail.exitCode) })) : (detail.execution &&
|
|
136
|
+
detail.execution !== 'running' &&
|
|
137
|
+
detail.execution !== 'pending' &&
|
|
138
|
+
detail.execution !== 'background' && _jsx("span", { className: "rl-agent-command__exit", children: m.exitCodeMissing })), detail.terminalId && onOpenTerminal && (_jsx(ActionButton, { icon: "terminal", onClick: () => onOpenTerminal(detail.terminalId), children: m.openTerminal }))] }), detail.sandboxed === false && _jsx(Notice, { tone: "warning", children: m.unsandboxed }), detail.output && (_jsx(ToolOutput, { output: {
|
|
139
|
+
...detail.output,
|
|
140
|
+
kind: detail.output.kind === 'text' ? 'terminal' : detail.output.kind,
|
|
141
|
+
}, label: m.commandOutput, ...outputProps }))] }));
|
|
142
|
+
}
|
|
143
|
+
const remoteMeta = {
|
|
144
|
+
pending: { glyph: 'pending', tone: 'info', active: true },
|
|
145
|
+
completed: { glyph: 'done', tone: 'success' },
|
|
146
|
+
failed: { glyph: 'failed', tone: 'danger' },
|
|
147
|
+
unknown: { glyph: 'unknown', tone: 'warning' },
|
|
148
|
+
};
|
|
149
|
+
/** MCPExecuteDetail (atlas 43): server, tool, endpoint, catalog revision, full arguments, remote status. */
|
|
150
|
+
export function MCPExecuteDetail({ detail, onReconcile, outputProps, className, ...rest }) {
|
|
151
|
+
const m = useAgentMessages().tools;
|
|
152
|
+
return (_jsxs("div", { ...rest, className: cx('rl-agent-detail', className), "data-kind": "mcp", children: [_jsx(MetaList, { items: [
|
|
153
|
+
{ label: m.mcpServer, value: detail.server, mono: true },
|
|
154
|
+
{ label: m.mcpTool, value: detail.tool, mono: true },
|
|
155
|
+
detail.endpoint && {
|
|
156
|
+
label: m.mcpEndpoint,
|
|
157
|
+
value: detail.endpoint,
|
|
158
|
+
mono: true,
|
|
159
|
+
},
|
|
160
|
+
detail.catalogRevision && {
|
|
161
|
+
label: m.mcpCatalog,
|
|
162
|
+
value: detail.catalogRevision,
|
|
163
|
+
mono: true,
|
|
164
|
+
},
|
|
165
|
+
] }), detail.catalogStale && _jsx(Notice, { tone: "warning", children: m.mcpCatalogStale }), detail.remote === 'unknown' ? (_jsx(Notice, { tone: "warning", action: onReconcile && (_jsx(ActionButton, { icon: "retry", onClick: onReconcile, children: m.mcpReconcile })), children: m.mcpRemote.unknown })) : (detail.remote && (_jsx("div", { className: "rl-agent-detail__row", children: _jsx(Pill, { ...remoteMeta[detail.remote], label: m.mcpRemote[detail.remote] }) }))), detail.arguments !== undefined && (_jsx(ToolOutput, { output: { kind: 'json', content: toDisplayJson(detail.arguments) }, label: m.mcpArguments })), detail.output && _jsx(ToolOutput, { output: detail.output, ...outputProps })] }));
|
|
166
|
+
}
|
|
167
|
+
const saveMeta = {
|
|
168
|
+
pending: { glyph: 'pending', tone: 'neutral' },
|
|
169
|
+
saving: { glyph: 'saving', tone: 'info', active: true },
|
|
170
|
+
saved: { glyph: 'done', tone: 'success' },
|
|
171
|
+
partial: { glyph: 'unknown', tone: 'warning' },
|
|
172
|
+
failed: { glyph: 'failed', tone: 'danger' },
|
|
173
|
+
};
|
|
174
|
+
/** NativeModelDetail (atlas 44): provider · model, purpose, inputs, params, results and save state. */
|
|
175
|
+
export function NativeModelDetail({ detail, running, onRetrySave, retrying, className, ...rest }) {
|
|
176
|
+
const m = useAgentMessages().tools;
|
|
177
|
+
const fmt = useAgentFormat();
|
|
178
|
+
const hintId = React.useId();
|
|
179
|
+
const params = detail.params ? Object.entries(detail.params) : [];
|
|
180
|
+
const canRetry = (detail.save === 'partial' || detail.save === 'failed' || detail.saveRetry === true) && onRetrySave;
|
|
181
|
+
return (_jsxs("div", { ...rest, className: cx('rl-agent-detail', className), "data-kind": "model", children: [_jsx(MetaList, { items: [
|
|
182
|
+
{
|
|
183
|
+
label: m.modelProvider,
|
|
184
|
+
value: m.modelTitle(detail.provider, detail.model),
|
|
185
|
+
mono: true,
|
|
186
|
+
},
|
|
187
|
+
detail.purpose && { label: m.modelPurpose, value: detail.purpose },
|
|
188
|
+
detail.endpoint && { label: m.mcpEndpoint, value: detail.endpoint, mono: true },
|
|
189
|
+
detail.route && { label: m.modelRoute, value: detail.route, mono: true },
|
|
190
|
+
detail.timeoutMs !== undefined && { label: m.commandTimeout, value: fmt.duration(detail.timeoutMs) },
|
|
191
|
+
detail.sha256 && { label: m.modelHash, value: detail.sha256, mono: true },
|
|
192
|
+
detail.stopReason && { label: m.modelStopReason, value: detail.stopReason },
|
|
193
|
+
detail.remote !== undefined && { label: m.modelRemote, value: String(detail.remote) },
|
|
194
|
+
] }), detail.arguments !== undefined && _jsx(ToolOutput, { output: { kind: 'json', content: toDisplayJson(detail.arguments) }, label: m.mcpArguments }), detail.saveError && _jsx(Notice, { tone: "danger", children: detail.saveError }), running && (_jsxs("p", { className: "rl-agent-detail__activity", role: "status", children: [_jsx(AgentSpark, { phase: "executing" }), _jsx("span", { children: m.modelRunning })] })), detail.inputs && detail.inputs.length > 0 && (_jsx(Section, { title: m.modelInputs, children: _jsx("ul", { className: "rl-agent-detail__list", children: detail.inputs.map((input) => (_jsxs("li", { children: [_jsx("span", { className: "rl-agent-detail__item-label", children: input.label }), [
|
|
195
|
+
input.mimeType,
|
|
196
|
+
input.size != null ? fmt.bytes(input.size) : undefined,
|
|
197
|
+
input.destination ? m.modelDestination(input.destination) : undefined,
|
|
198
|
+
]
|
|
199
|
+
.filter(Boolean)
|
|
200
|
+
.map((part, i) => (_jsx("span", { className: "rl-agent-detail__aside", children: part }, i)))] }, input.id))) }) })), params.length > 0 && (_jsx(Section, { title: m.modelParams, children: _jsx(MetaList, { items: params.map(([k, v]) => ({
|
|
201
|
+
label: k,
|
|
202
|
+
value: String(v),
|
|
203
|
+
mono: true,
|
|
204
|
+
})) }) })), detail.results && detail.results.length > 0 && (_jsx(Section, { title: m.modelResults, children: _jsx("ul", { className: "rl-agent-detail__results", children: detail.results.map((r) => (_jsxs("li", { className: "rl-agent-detail__result-item", children: [r.preview && _jsx("img", { className: "rl-agent-detail__thumb", src: r.preview, alt: r.alt ?? r.label }), _jsx("span", { className: "rl-agent-detail__item-label", children: r.label }), _jsx(Pill, { glyph: r.saved ? 'done' : 'unknown', tone: r.saved ? 'success' : 'warning', label: r.saved ? m.modelResultSaved : m.modelResultUnsaved })] }, r.id))) }) })), detail.save && (_jsxs("div", { className: "rl-agent-detail__row", children: [_jsx(Pill, { ...saveMeta[detail.save], label: m.modelSave[detail.save] }), canRetry && (_jsxs(_Fragment, { children: [_jsx(ActionButton, { icon: "retry", onClick: onRetrySave, busy: retrying, describedBy: hintId, children: m.modelRetrySave }), _jsx("span", { id: hintId, className: "rl-agent-detail__aside", children: m.modelRetrySaveHint })] }))] })), detail.costNotice && _jsx(Notice, { tone: "info", children: detail.costNotice })] }));
|
|
205
|
+
}
|
|
206
|
+
/** QuestionToolDetail: question count and each answer (or 「已跳过」). */
|
|
207
|
+
export function QuestionToolDetail({ detail, className, ...rest }) {
|
|
208
|
+
const m = useAgentMessages().tools;
|
|
209
|
+
return (_jsxs("div", { ...rest, className: cx('rl-agent-detail', className), "data-kind": "question", children: [_jsx("p", { className: "rl-agent-detail__aside", children: m.questionCount(detail.count) }), detail.answers && detail.answers.length > 0 ? (_jsx("dl", { className: "rl-agent-detail__answers", "aria-label": m.questionAnswers, children: detail.answers.map((a, i) => (_jsxs("div", { className: "rl-agent-detail__answer", children: [_jsx("dt", { children: a.question }), _jsx("dd", { "data-skipped": a.skipped || undefined, children: a.skipped || a.answer == null ? m.questionSkipped : a.answer })] }, i))) })) : (_jsx("p", { className: "rl-agent-detail__aside", children: m.questionNoAnswers }))] }));
|
|
210
|
+
}
|
|
211
|
+
/** SubagentToolDetail: sub-task name, task and a link to the child conversation. */
|
|
212
|
+
export function SubagentToolDetail({ detail, onOpenChild, className, ...rest }) {
|
|
213
|
+
const m = useAgentMessages().tools;
|
|
214
|
+
return (_jsxs("div", { ...rest, className: cx('rl-agent-detail', className), "data-kind": "agent", children: [_jsx(MetaList, { items: [{ label: m.agentName, value: detail.agentName }, detail.task && { label: m.agentTask, value: detail.task }] }), detail.childConversationId && onOpenChild && (_jsx("div", { className: "rl-agent-detail__actions", children: _jsx(ActionButton, { icon: "external", onClick: () => onOpenChild(detail.childConversationId), children: m.openChild }) }))] }));
|
|
215
|
+
}
|
|
216
|
+
/** GenericToolDetail: any tool without a special view — input JSON + output. */
|
|
217
|
+
export function GenericToolDetail({ detail, outputProps, className, ...rest }) {
|
|
218
|
+
const m = useAgentMessages().tools;
|
|
219
|
+
return (_jsxs("div", { ...rest, className: cx('rl-agent-detail', className), "data-kind": "generic", children: [detail.input !== undefined && _jsx(ToolOutput, { output: { kind: 'json', content: toDisplayJson(detail.input) }, label: m.inputLabel }), detail.output && _jsx(ToolOutput, { output: detail.output, ...outputProps }), detail.input === undefined && !detail.output && _jsx("p", { className: "rl-agent-detail__aside", children: m.noDetails })] }));
|
|
220
|
+
}
|
|
221
|
+
/** Render the built-in detail view for `detail.kind` (or the generic one). */
|
|
222
|
+
export function ToolDetail({ tool, detail = tool.detail, ...actions }) {
|
|
223
|
+
if (!detail)
|
|
224
|
+
return null;
|
|
225
|
+
const outputProps = {
|
|
226
|
+
onLoadMore: actions.onLoadMoreOutput ? () => actions.onLoadMoreOutput(tool) : undefined,
|
|
227
|
+
onOpenFull: actions.onOpenFullOutput ? () => actions.onOpenFullOutput(tool) : undefined,
|
|
228
|
+
onCopyText: actions.onCopyText,
|
|
229
|
+
};
|
|
230
|
+
switch (detail.kind) {
|
|
231
|
+
case 'file-read':
|
|
232
|
+
return _jsx(FileReadDetail, { detail: detail, onReadMore: actions.onReadMore ? (n) => actions.onReadMore(tool, n) : undefined });
|
|
233
|
+
case 'file-write':
|
|
234
|
+
return (_jsx(FileWriteDetail, { detail: detail, onReload: actions.onReload ? () => actions.onReload(tool, detail.path) : undefined, onViewFull: actions.onViewFull ? () => actions.onViewFull(tool, detail.path) : undefined, beforeActions: actions.beforeActions }));
|
|
235
|
+
case 'file-edit':
|
|
236
|
+
return _jsx(EditFileDetail, { detail: detail, pageActions: actions.pageActions });
|
|
237
|
+
case 'patch':
|
|
238
|
+
return (_jsx(ApplyPatchDetail, { detail: detail, onReload: actions.onReload ? (p) => actions.onReload(tool, p) : undefined, onViewFull: actions.onViewFull ? (p) => actions.onViewFull(tool, p) : undefined, rawActions: actions.rawActions }));
|
|
239
|
+
case 'manage-files':
|
|
240
|
+
return (_jsx(ManageFilesDetail, { detail: detail, onLoadMore: actions.onLoadMoreOperations ? () => actions.onLoadMoreOperations(tool) : undefined, loadingMore: actions.loadingMore, pageActions: actions.pageActions }));
|
|
241
|
+
case 'command':
|
|
242
|
+
return (_jsx(RunCommandDetail, { detail: detail, onCopyText: actions.onCopyText, outputProps: outputProps, onOpenTerminal: actions.onOpenTerminal ? (id) => actions.onOpenTerminal(id, tool) : undefined }));
|
|
243
|
+
case 'mcp':
|
|
244
|
+
return (_jsx(MCPExecuteDetail, { detail: detail, outputProps: outputProps, onReconcile: actions.onReconcile ? () => actions.onReconcile(tool) : undefined }));
|
|
245
|
+
case 'model':
|
|
246
|
+
return (_jsx(NativeModelDetail, { detail: detail, running: tool.status === 'running' || tool.status === 'queued', onRetrySave: actions.onRetrySave ? () => actions.onRetrySave(tool) : undefined, retrying: actions.retrying }));
|
|
247
|
+
case 'question':
|
|
248
|
+
return _jsx(QuestionToolDetail, { detail: detail });
|
|
249
|
+
case 'agent':
|
|
250
|
+
return _jsx(SubagentToolDetail, { detail: detail, onOpenChild: actions.onOpenChild ? (id) => actions.onOpenChild(id, tool) : undefined });
|
|
251
|
+
case 'generic':
|
|
252
|
+
return _jsx(GenericToolDetail, { detail: detail, outputProps: outputProps });
|
|
253
|
+
default:
|
|
254
|
+
// Future variants: never drop them silently.
|
|
255
|
+
return _jsx(GenericToolDetail, { detail: { kind: 'generic', input: detail } });
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=ToolDetails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolDetails.js","sourceRoot":"","sources":["../../../src/components/tools/ToolDetails.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;A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'react';
|
|
2
|
+
import type { ToolCallView } from '@wzrhine/agent-core';
|
|
3
|
+
import type { ToolRowSharedProps } from './ToolActivity.js';
|
|
4
|
+
/**
|
|
5
|
+
* Append-only order for paged history: rows already shown keep their position; new ids are
|
|
6
|
+
* appended (sorted by `sequence` among themselves). Duplicates — the same id on two pages, or a
|
|
7
|
+
* live row replayed into history — are dropped; the latest data for a known id replaces its
|
|
8
|
+
* content but not its place.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useStableOrder(items: readonly ToolCallView[]): ToolCallView[];
|
|
11
|
+
/**
|
|
12
|
+
* ToolHistory (atlas 46): 「完整工具记录」 disclosure listing every loaded page. Rows are
|
|
13
|
+
* deduped by id across pages and never reordered once read; a load error keeps the loaded rows
|
|
14
|
+
* and offers 「加载更多」 again (no retry loop). The count says how many are loaded (and the total
|
|
15
|
+
* when the adapter knows it). Rows mount without entrance motion (history is restored, not new).
|
|
16
|
+
* `onOpenOperation` adds a 「在对话中定位」 button beside each row.
|
|
17
|
+
*/
|
|
18
|
+
export type ToolHistoryProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & ToolRowSharedProps & {
|
|
19
|
+
/** All loaded rows (pages concatenated; duplicates allowed, they are dropped here). */
|
|
20
|
+
items: readonly ToolCallView[];
|
|
21
|
+
total?: number;
|
|
22
|
+
hasMore?: boolean;
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
error?: React.ReactNode;
|
|
25
|
+
onLoadMore?: () => void;
|
|
26
|
+
onOpenOperation?: (id: string) => void;
|
|
27
|
+
expanded?: boolean;
|
|
28
|
+
defaultExpanded?: boolean;
|
|
29
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
30
|
+
title?: React.ReactNode;
|
|
31
|
+
};
|
|
32
|
+
export declare const ToolHistory: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & Pick<import("./ToolRecord.js").ToolRecordProps, "onLoadDetails" | "renderDetail" | "detailActions"> & {
|
|
33
|
+
detailsErrors?: Readonly<Record<string, React.ReactNode>>;
|
|
34
|
+
} & {
|
|
35
|
+
/** All loaded rows (pages concatenated; duplicates allowed, they are dropped here). */
|
|
36
|
+
items: readonly ToolCallView[];
|
|
37
|
+
total?: number;
|
|
38
|
+
hasMore?: boolean;
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
error?: React.ReactNode;
|
|
41
|
+
onLoadMore?: () => void;
|
|
42
|
+
onOpenOperation?: (id: string) => void;
|
|
43
|
+
expanded?: boolean;
|
|
44
|
+
defaultExpanded?: boolean;
|
|
45
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
46
|
+
title?: React.ReactNode;
|
|
47
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
48
|
+
//# sourceMappingURL=ToolHistory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolHistory.d.ts","sourceRoot":"","sources":["../../../src/components/tools/ToolHistory.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAKxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAG5D;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,EAAE,CAY7E;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GACnF,kBAAkB,GAAG;IACnB,uFAAuF;IACvF,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,CAAC;AAEJ,eAAO,MAAM,WAAW;;;IAdpB,uFAAuF;WAChF,SAAS,YAAY,EAAE;YACtB,MAAM;cACJ,OAAO;cACP,OAAO;YACT,KAAK,CAAC,SAAS;iBACV,MAAM,IAAI;sBACL,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;eAC3B,OAAO;sBACA,OAAO;uBACN,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI;YACtC,KAAK,CAAC,SAAS;wCAsFzB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Collapsible } from '@wzrhine/react';
|
|
5
|
+
import { useAgentMessages } from '../../provider/AgentMessages.js';
|
|
6
|
+
import { cx } from '../../utils/cx.js';
|
|
7
|
+
import { ToolRecord } from './ToolRecord.js';
|
|
8
|
+
import { ActionButton, Notice } from './shared.js';
|
|
9
|
+
/**
|
|
10
|
+
* Append-only order for paged history: rows already shown keep their position; new ids are
|
|
11
|
+
* appended (sorted by `sequence` among themselves). Duplicates — the same id on two pages, or a
|
|
12
|
+
* live row replayed into history — are dropped; the latest data for a known id replaces its
|
|
13
|
+
* content but not its place.
|
|
14
|
+
*/
|
|
15
|
+
export function useStableOrder(items) {
|
|
16
|
+
const order = React.useRef([]);
|
|
17
|
+
const latest = new Map();
|
|
18
|
+
for (const item of items)
|
|
19
|
+
if (!latest.has(item.id))
|
|
20
|
+
latest.set(item.id, item);
|
|
21
|
+
const known = new Set(order.current);
|
|
22
|
+
const added = [...latest.values()].filter((t) => !known.has(t.id));
|
|
23
|
+
if (added.every((t) => typeof t.sequence === 'number'))
|
|
24
|
+
added.sort((a, b) => a.sequence - b.sequence);
|
|
25
|
+
const ids = [...order.current.filter((id) => latest.has(id)), ...added.map((t) => t.id)];
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
order.current = ids;
|
|
28
|
+
});
|
|
29
|
+
return ids.map((id) => latest.get(id));
|
|
30
|
+
}
|
|
31
|
+
export const ToolHistory = React.forwardRef(function ToolHistory({ items, total, hasMore, loading, error, onLoadMore, onOpenOperation, expanded, defaultExpanded = false, onExpandedChange, title, onLoadDetails, renderDetail, detailActions, detailsErrors, className, ...rest }, ref) {
|
|
32
|
+
const m = useAgentMessages().tools;
|
|
33
|
+
const rows = useStableOrder(items);
|
|
34
|
+
const countText = total != null ? m.historyTotal(rows.length, total) : m.historyLoaded(rows.length);
|
|
35
|
+
return (_jsx("div", { ...rest, ref: ref, className: cx('rl-agent-history', className), children: _jsx(Collapsible, { open: expanded, defaultOpen: defaultExpanded, onOpenChange: onExpandedChange, trigger: _jsxs("span", { className: "rl-agent-history__header", children: [_jsx("span", { className: "rl-agent-history__title", children: title ?? m.historyTitle }), _jsx("span", { className: "rl-agent-history__count", children: countText })] }), triggerProps: { className: 'rl-agent-history__trigger' }, children: _jsxs("div", { className: "rl-agent-history__body", "aria-busy": loading || undefined, children: [rows.length === 0 && !loading && !error && _jsx("p", { className: "rl-agent-detail__aside", children: m.historyEmpty }), rows.length > 0 && (_jsx("ul", { className: "rl-agent-tool-list", "aria-label": m.historyList, children: rows.map((tool) => (_jsx("li", { className: "rl-agent-tool-list__item", children: _jsx(ToolRecord, { tool: tool, onLoadDetails: onLoadDetails, detailsError: detailsErrors?.[tool.id], renderDetail: renderDetail, detailActions: detailActions, actions: onOpenOperation && (_jsx("button", { type: "button", className: "rl-agent-tool-button", "aria-label": `${m.openOperation} · ${tool.displayName ?? tool.name}${tool.subject ? ` ${tool.subject}` : ''}`, onClick: () => onOpenOperation(tool.id), children: _jsx("span", { className: "rl-agent-tool-button__text", children: m.openOperation }) })) }) }, tool.id))) })), _jsx("p", { className: "rl-agent-history__status", role: "status", children: loading ? m.historyLoading : '' }), error != null && error !== false && _jsx(Notice, { tone: "danger", children: error === true ? m.historyError : error }), hasMore && onLoadMore && (_jsx("div", { className: "rl-agent-detail__actions", children: _jsx(ActionButton, { icon: "arrow-down", onClick: onLoadMore, busy: loading, children: m.historyLoadMore }) }))] }) }) }));
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=ToolHistory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolHistory.js","sourceRoot":"","sources":["../../../src/components/tools/ToolHistory.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAA8B;IAC3D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAW,EAAE,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC/C,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC9E,MAAM,KAAK,GAAG,IAAI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+
import type { ChunkPagerActions } from './ChunkPager.js';
|
|
4
|
+
/**
|
|
5
|
+
* ToolOutput (atlas 45): bounded preview of one tool output. The body never grows past
|
|
6
|
+
* `--rl-agent-output-max-height`; it scrolls inside a focusable, named region so keyboard users
|
|
7
|
+
* can scroll it and the page never overflows. Text stays selectable; the copy button copies the
|
|
8
|
+
* loaded portion only.
|
|
9
|
+
*
|
|
10
|
+
* Truncation is never conflated (ADR-0011 §5):
|
|
11
|
+
* - `display` → 「仅显示部分输出」 + `onLoadMore` / `onOpenFull` (only rendered when given);
|
|
12
|
+
* - `execution` → 「工具输出已达上限,结果本身被截断」: nothing more exists to load.
|
|
13
|
+
*
|
|
14
|
+
* `status: 'loading'` shows a skeleton inside an `aria-busy` container; `unavailable` says so
|
|
15
|
+
* instead of pretending the output is empty. With `page` (stored material read page by page) the
|
|
16
|
+
* body is a `ChunkPager` instead of the inline preview; `pager` carries its callbacks.
|
|
17
|
+
* No motion of its own.
|
|
18
|
+
*/
|
|
19
|
+
export type ToolOutputProps = Omit<React.HTMLAttributes<HTMLElement>, 'children'> & {
|
|
20
|
+
output: ToolOutputView;
|
|
21
|
+
/** Heading text; defaults to the kind label (「终端输出」, 「JSON」…). */
|
|
22
|
+
label?: React.ReactNode;
|
|
23
|
+
/** Name of the scroll region; defaults to the label text. */
|
|
24
|
+
regionLabel?: string;
|
|
25
|
+
/** Load the next display chunk (`truncated: 'display'`). */
|
|
26
|
+
onLoadMore?: () => void;
|
|
27
|
+
/** Open the full output elsewhere (`truncated: 'display'`). */
|
|
28
|
+
onOpenFull?: () => void;
|
|
29
|
+
/** Busy state for `onLoadMore`. */
|
|
30
|
+
loadingMore?: boolean;
|
|
31
|
+
/** Replace the clipboard write (tests, host clipboards). */
|
|
32
|
+
onCopyText?: (text: string) => void | Promise<void>;
|
|
33
|
+
/** Hide the copy button. */
|
|
34
|
+
copyable?: boolean;
|
|
35
|
+
/** One page of the stored output; replaces the inline body with a `ChunkPager`. */
|
|
36
|
+
page?: MaterialPageView;
|
|
37
|
+
/** Paging callbacks for `page` (`canGoBack` defaults to false). */
|
|
38
|
+
pager?: Partial<ChunkPagerActions>;
|
|
39
|
+
};
|
|
40
|
+
export declare const ToolOutput: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "children"> & {
|
|
41
|
+
output: ToolOutputView;
|
|
42
|
+
/** Heading text; defaults to the kind label (「终端输出」, 「JSON」…). */
|
|
43
|
+
label?: React.ReactNode;
|
|
44
|
+
/** Name of the scroll region; defaults to the label text. */
|
|
45
|
+
regionLabel?: string;
|
|
46
|
+
/** Load the next display chunk (`truncated: 'display'`). */
|
|
47
|
+
onLoadMore?: () => void;
|
|
48
|
+
/** Open the full output elsewhere (`truncated: 'display'`). */
|
|
49
|
+
onOpenFull?: () => void;
|
|
50
|
+
/** Busy state for `onLoadMore`. */
|
|
51
|
+
loadingMore?: boolean;
|
|
52
|
+
/** Replace the clipboard write (tests, host clipboards). */
|
|
53
|
+
onCopyText?: (text: string) => void | Promise<void>;
|
|
54
|
+
/** Hide the copy button. */
|
|
55
|
+
copyable?: boolean;
|
|
56
|
+
/** One page of the stored output; replaces the inline body with a `ChunkPager`. */
|
|
57
|
+
page?: MaterialPageView;
|
|
58
|
+
/** Paging callbacks for `page` (`canGoBack` defaults to false). */
|
|
59
|
+
pager?: Partial<ChunkPagerActions>;
|
|
60
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
61
|
+
//# sourceMappingURL=ToolOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolOutput.d.ts","sourceRoot":"","sources":["../../../src/components/tools/ToolOutput.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAK5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD;;;;;;;;;;;;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react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Skeleton } from '@wzrhine/react';
|
|
5
|
+
import { useAgentFormat, useAgentMessages } from '../../provider/AgentMessages.js';
|
|
6
|
+
import { cx } from '../../utils/cx.js';
|
|
7
|
+
import { ChunkPager } from './ChunkPager.js';
|
|
8
|
+
import { ActionButton, CopyButton, Notice, prettyJson } from './shared.js';
|
|
9
|
+
export const ToolOutput = React.forwardRef(function ToolOutput({ output, label, regionLabel, onLoadMore, onOpenFull, loadingMore, onCopyText, copyable = true, page, pager, className, ...rest }, ref) {
|
|
10
|
+
const m = useAgentMessages().tools;
|
|
11
|
+
const fmt = useAgentFormat();
|
|
12
|
+
const noticeId = React.useId();
|
|
13
|
+
const kind = output.kind;
|
|
14
|
+
const heading = label ?? (kind === 'empty' ? m.outputLabel : m.outputKind[kind]);
|
|
15
|
+
const name = regionLabel ?? (typeof heading === 'string' ? heading : m.outputLabel);
|
|
16
|
+
const loading = output.status === 'loading';
|
|
17
|
+
const unavailable = output.status === 'unavailable';
|
|
18
|
+
const raw = output.content ?? '';
|
|
19
|
+
const text = kind === 'json' ? prettyJson(raw) : raw;
|
|
20
|
+
const empty = kind === 'empty' || (!loading && !unavailable && raw === '' && !output.error);
|
|
21
|
+
let body;
|
|
22
|
+
if (page) {
|
|
23
|
+
body = _jsx(ChunkPager, { ...pager, page: page, label: name, canGoBack: pager?.canGoBack ?? false });
|
|
24
|
+
}
|
|
25
|
+
else if (loading) {
|
|
26
|
+
body = (_jsxs("div", { className: "rl-agent-output__loading", "aria-busy": "true", children: [_jsx(Skeleton, { shape: "text", lines: 3 }), _jsx("span", { className: "rl-agent-sr", children: m.outputLoading })] }));
|
|
27
|
+
}
|
|
28
|
+
else if (unavailable) {
|
|
29
|
+
body = _jsx("p", { className: "rl-agent-output__placeholder", children: output.error ?? m.outputUnavailable });
|
|
30
|
+
}
|
|
31
|
+
else if (empty) {
|
|
32
|
+
body = _jsx("p", { className: "rl-agent-output__placeholder", children: m.emptyOutput });
|
|
33
|
+
}
|
|
34
|
+
else if (kind === 'list') {
|
|
35
|
+
const items = text.split('\n').filter((line) => line.trim() !== '');
|
|
36
|
+
body = (_jsx("div", { className: "rl-agent-output__scroll", role: "region", tabIndex: 0, "aria-label": name, children: _jsx("ul", { className: "rl-agent-output__list", children: items.map((item, i) => (_jsx("li", { children: item }, i))) }) }));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
body = (_jsxs("div", { className: "rl-agent-output__scroll", role: "region", tabIndex: 0, "aria-label": name, children: [kind === 'error' && output.error && _jsx("p", { className: "rl-agent-output__error", children: output.error }), text !== '' && (_jsx("pre", { className: "rl-agent-output__pre", "data-wrap": kind === 'text' || kind === 'error' || undefined, children: _jsx("code", { children: text }) }))] }));
|
|
40
|
+
}
|
|
41
|
+
const showCopy = copyable && !loading && !unavailable && !empty && text !== '' && !page;
|
|
42
|
+
const pageText = page?.status === 'ready' ? (page.content ?? '') : '';
|
|
43
|
+
return (_jsxs("div", { ...rest, ref: ref, role: "group", className: cx('rl-agent-output', className), "data-kind": kind, "data-status": output.status, "data-truncated": output.truncated, "aria-label": name, children: [_jsxs("header", { className: "rl-agent-output__header", children: [_jsx("span", { className: "rl-agent-output__kind", children: heading }), output.summary && _jsx("span", { className: "rl-agent-output__summary", children: output.summary }), output.total != null && output.totalUnit && (_jsx("span", { className: "rl-agent-output__total", children: m.outputTotal(fmt.number(output.total), output.totalUnit) })), output.status === 'partial' && !output.truncated && _jsx("span", { className: "rl-agent-output__total", children: m.outputStreaming }), showCopy && _jsx(CopyButton, { text: text, onCopyText: onCopyText, className: "rl-agent-output__copy" }), copyable && page && pageText !== '' && _jsx(CopyButton, { text: pageText, onCopyText: onCopyText, className: "rl-agent-output__copy" })] }), kind !== 'error' && output.error && !unavailable && _jsx(Notice, { tone: "danger", children: output.error }), body, !page && output.truncated === 'display' && (_jsx(Notice, { tone: "info", id: noticeId, action: (onLoadMore || onOpenFull) && (_jsxs(_Fragment, { children: [onLoadMore && (_jsx(ActionButton, { icon: "arrow-down", onClick: onLoadMore, busy: loadingMore, describedBy: noticeId, children: m.loadMore })), onOpenFull && (_jsx(ActionButton, { icon: "external", onClick: onOpenFull, describedBy: noticeId, children: m.openFull }))] })), children: m.truncatedDisplay })), output.truncated === 'execution' && _jsx(Notice, { tone: "warning", children: m.truncatedExecution })] }));
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=ToolOutput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolOutput.js","sourceRoot":"","sources":["../../../src/components/tools/ToolOutput.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAuC3E,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAA+B,SAAS,UAAU,CAC1F,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,GAAG,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EACjI,GAAG;IAEH,MAAM,CAAC,GAAG,gBAAgB,EAAE,CAAC,KAAK,CAAC;IACnC,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAA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