@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,83 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { FileDiffView } from '@wzrhine/agent-core';
|
|
3
|
+
/**
|
|
4
|
+
* DiffPreview (atlas 31): one file diff. Header = path, change kind, `+N −M` stats and the
|
|
5
|
+
* proposal status. Lines sit in their own horizontally scrolling, focusable region (the page
|
|
6
|
+
* never overflows); each line is old line no · new line no · sign · code. The sign is visible
|
|
7
|
+
* text (`+` / `−` / space) and screen readers hear 「新增」/「删除」; line numbers are hidden from
|
|
8
|
+
* assistive tech and unselectable, so copying a block copies code only. Added / removed lines
|
|
9
|
+
* are tinted with the success / danger subtle tokens *and* carry the sign, never colour alone.
|
|
10
|
+
*
|
|
11
|
+
* A conflict renders a warning (「文件版本冲突 · 重新读取最新文件后再决定」) with `onReload`;
|
|
12
|
+
* binary files show a message instead of hunks; `truncated` shows a notice and `onViewFull`.
|
|
13
|
+
* Pass `diff` (canonical, from the adapter) or `before` / `after` strings for a bounded preview
|
|
14
|
+
* computed with `lineDiff` (a preview aid, not a patch engine). No motion.
|
|
15
|
+
*/
|
|
16
|
+
export type DiffPreviewProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
17
|
+
diff?: FileDiffView;
|
|
18
|
+
/** Convenience: compute a preview diff from two strings (ignored when `diff` is given). */
|
|
19
|
+
before?: string;
|
|
20
|
+
after?: string;
|
|
21
|
+
/** Path for the `before` / `after` form. */
|
|
22
|
+
path?: string;
|
|
23
|
+
/** Status for the `before` / `after` form (defaults to `preview`). */
|
|
24
|
+
status?: FileDiffView['status'];
|
|
25
|
+
/** Hide the header (when an outer disclosure already shows it). */
|
|
26
|
+
hideHeader?: boolean;
|
|
27
|
+
/** Open the full diff (shown when the diff is truncated). */
|
|
28
|
+
onViewFull?: () => void;
|
|
29
|
+
/** Re-read the latest file (shown on conflict). */
|
|
30
|
+
onReload?: () => void;
|
|
31
|
+
};
|
|
32
|
+
/** Resolve the props into one FileDiffView. */
|
|
33
|
+
export declare function resolveDiff(props: Pick<DiffPreviewProps, 'diff' | 'before' | 'after' | 'path' | 'status'>): FileDiffView | undefined;
|
|
34
|
+
/** `+N −M` with a spoken label. */
|
|
35
|
+
export declare function DiffStats({ additions, deletions }: {
|
|
36
|
+
additions: number;
|
|
37
|
+
deletions: number;
|
|
38
|
+
}): React.JSX.Element;
|
|
39
|
+
export declare function DiffStatusPill({ status }: {
|
|
40
|
+
status: NonNullable<FileDiffView['status']>;
|
|
41
|
+
}): React.JSX.Element;
|
|
42
|
+
export declare const DiffPreview: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
43
|
+
diff?: FileDiffView;
|
|
44
|
+
/** Convenience: compute a preview diff from two strings (ignored when `diff` is given). */
|
|
45
|
+
before?: string;
|
|
46
|
+
after?: string;
|
|
47
|
+
/** Path for the `before` / `after` form. */
|
|
48
|
+
path?: string;
|
|
49
|
+
/** Status for the `before` / `after` form (defaults to `preview`). */
|
|
50
|
+
status?: FileDiffView["status"];
|
|
51
|
+
/** Hide the header (when an outer disclosure already shows it). */
|
|
52
|
+
hideHeader?: boolean;
|
|
53
|
+
/** Open the full diff (shown when the diff is truncated). */
|
|
54
|
+
onViewFull?: () => void;
|
|
55
|
+
/** Re-read the latest file (shown on conflict). */
|
|
56
|
+
onReload?: () => void;
|
|
57
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
58
|
+
/**
|
|
59
|
+
* MultiFileDiff: several file diffs as a list of disclosures, each with its own status (a
|
|
60
|
+
* conflict in one file never colours the others). The first file and every conflicting file are
|
|
61
|
+
* open by default; `expanded` / `onExpandedChange` control it by path.
|
|
62
|
+
*/
|
|
63
|
+
export type MultiFileDiffProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
64
|
+
files: readonly FileDiffView[];
|
|
65
|
+
expanded?: readonly string[];
|
|
66
|
+
defaultExpanded?: readonly string[];
|
|
67
|
+
onExpandedChange?: (paths: string[]) => void;
|
|
68
|
+
onViewFull?: (path: string) => void;
|
|
69
|
+
onReload?: (path: string) => void;
|
|
70
|
+
/** List name; defaults to 「改动的文件」. */
|
|
71
|
+
label?: string;
|
|
72
|
+
};
|
|
73
|
+
export declare const MultiFileDiff: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
74
|
+
files: readonly FileDiffView[];
|
|
75
|
+
expanded?: readonly string[];
|
|
76
|
+
defaultExpanded?: readonly string[];
|
|
77
|
+
onExpandedChange?: (paths: string[]) => void;
|
|
78
|
+
onViewFull?: (path: string) => void;
|
|
79
|
+
onReload?: (path: string) => void;
|
|
80
|
+
/** List name; defaults to 「改动的文件」. */
|
|
81
|
+
label?: string;
|
|
82
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
83
|
+
//# sourceMappingURL=DiffPreview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiffPreview.d.ts","sourceRoot":"","sources":["../../../src/components/tools/DiffPreview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAA2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iBAChD,MAAM,IAAI;IACvB,mDAAmD;eACxC,MAAM,IAAI;wCAmNrB,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG;IACxF,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,aAAa;WAVjB,SAAS,YAAY,EAAE;eACnB,SAAS,MAAM,EAAE;sBACV,SAAS,MAAM,EAAE;uBAChB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI;iBAC/B,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;eACxB,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;IACjC,sCAAsC;YAC9B,MAAM;wCA+Cd,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { diffStats, lineDiff } from '@wzrhine/agent-core';
|
|
5
|
+
import { Collapsible } from '@wzrhine/react';
|
|
6
|
+
import { useAgentMessages } from '../../provider/AgentMessages.js';
|
|
7
|
+
import { cx } from '../../utils/cx.js';
|
|
8
|
+
import { ActionButton, Notice, Pill } from './shared.js';
|
|
9
|
+
const statusMeta = {
|
|
10
|
+
preview: { glyph: 'pending', tone: 'neutral' },
|
|
11
|
+
proposed: { glyph: 'approval', tone: 'warning' },
|
|
12
|
+
applied: { glyph: 'done', tone: 'success' },
|
|
13
|
+
conflict: { glyph: 'failed', tone: 'warning' },
|
|
14
|
+
unavailable: { glyph: 'unknown', tone: 'neutral' },
|
|
15
|
+
};
|
|
16
|
+
/** Resolve the props into one FileDiffView. */
|
|
17
|
+
export function resolveDiff(props) {
|
|
18
|
+
if (props.diff)
|
|
19
|
+
return props.diff;
|
|
20
|
+
if (props.before === undefined && props.after === undefined)
|
|
21
|
+
return undefined;
|
|
22
|
+
const before = props.before ?? '';
|
|
23
|
+
const after = props.after ?? '';
|
|
24
|
+
const result = lineDiff(before, after);
|
|
25
|
+
return {
|
|
26
|
+
path: props.path ?? '',
|
|
27
|
+
change: before === '' ? 'add' : after === '' ? 'delete' : 'update',
|
|
28
|
+
hunks: [result.hunk],
|
|
29
|
+
additions: result.additions,
|
|
30
|
+
deletions: result.deletions,
|
|
31
|
+
truncated: result.truncated,
|
|
32
|
+
status: props.status ?? 'preview',
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function totals(diff) {
|
|
36
|
+
const counted = diffStats([diff]);
|
|
37
|
+
return {
|
|
38
|
+
additions: diff.additions ?? counted.additions,
|
|
39
|
+
deletions: diff.deletions ?? counted.deletions,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** `+N −M` with a spoken label. */
|
|
43
|
+
export function DiffStats({ additions, deletions }) {
|
|
44
|
+
const m = useAgentMessages().tools;
|
|
45
|
+
return (_jsxs("span", { className: "rl-agent-diff-stats", children: [_jsxs("span", { "aria-hidden": "true", children: [_jsxs("span", { className: "rl-agent-diff-stats__add", children: ["+", additions] }), " ", _jsxs("span", { className: "rl-agent-diff-stats__del", children: ["\u2212", deletions] })] }), _jsx("span", { className: "rl-agent-sr", children: m.diffStatsLabel(additions, deletions) })] }));
|
|
46
|
+
}
|
|
47
|
+
export function DiffStatusPill({ status }) {
|
|
48
|
+
const m = useAgentMessages().tools;
|
|
49
|
+
const meta = statusMeta[status];
|
|
50
|
+
return _jsx(Pill, { glyph: meta.glyph, tone: meta.tone, label: m.diffStatus[status] });
|
|
51
|
+
}
|
|
52
|
+
const SIGN = {
|
|
53
|
+
add: '+',
|
|
54
|
+
remove: '−',
|
|
55
|
+
context: ' ',
|
|
56
|
+
meta: ' ',
|
|
57
|
+
};
|
|
58
|
+
function DiffLines({ diff, label }) {
|
|
59
|
+
const m = useAgentMessages().tools;
|
|
60
|
+
return (_jsx("div", { className: "rl-agent-diff__scroll", role: "region", tabIndex: 0, "aria-label": label, children: _jsxs("div", { className: "rl-agent-diff__lines", children: [diff.hunks.map((hunk) => (_jsxs(React.Fragment, { children: [hunk.header && (_jsxs("div", { className: "rl-agent-diff__line", "data-kind": "hunk", children: [_jsx("span", { className: "rl-agent-diff__ln", "aria-hidden": "true" }), _jsx("span", { className: "rl-agent-diff__ln", "aria-hidden": "true" }), _jsx("span", { className: "rl-agent-diff__sign", "aria-hidden": "true" }), _jsx("code", { className: "rl-agent-diff__code", children: hunk.header })] })), hunk.lines.map((line, i) => (_jsxs("div", { className: "rl-agent-diff__line", "data-kind": line.kind, children: [_jsx("span", { className: "rl-agent-diff__ln", "aria-hidden": "true", children: line.oldLine ?? '' }), _jsx("span", { className: "rl-agent-diff__ln", "aria-hidden": "true", children: line.newLine ?? '' }), _jsx("span", { className: "rl-agent-diff__sign", "aria-hidden": "true", children: SIGN[line.kind] }), line.kind === 'add' && _jsxs("span", { className: "rl-agent-sr", children: [m.diffAdded, " "] }), line.kind === 'remove' && _jsxs("span", { className: "rl-agent-sr", children: [m.diffRemoved, " "] }), _jsx("code", { className: "rl-agent-diff__code", children: line.text === '' ? '\u00a0' : line.text })] }, i)))] }, hunk.id))), diff.noNewlineAtEnd?.old && (_jsxs("div", { className: "rl-agent-diff__line", "data-kind": "meta", children: [_jsx("span", { className: "rl-agent-diff__ln", "aria-hidden": "true" }), _jsx("span", { className: "rl-agent-diff__ln", "aria-hidden": "true" }), _jsx("span", { className: "rl-agent-diff__sign", "aria-hidden": "true" }), _jsx("span", { className: "rl-agent-diff__code", children: m.noNewlineAtEnd('old') })] })), diff.noNewlineAtEnd?.new && (_jsxs("div", { className: "rl-agent-diff__line", "data-kind": "meta", children: [_jsx("span", { className: "rl-agent-diff__ln", "aria-hidden": "true" }), _jsx("span", { className: "rl-agent-diff__ln", "aria-hidden": "true" }), _jsx("span", { className: "rl-agent-diff__sign", "aria-hidden": "true" }), _jsx("span", { className: "rl-agent-diff__code", children: m.noNewlineAtEnd('new') })] }))] }) }));
|
|
61
|
+
}
|
|
62
|
+
/** Body of a diff (notices + lines), shared by DiffPreview and MultiFileDiff. */
|
|
63
|
+
function DiffBody({ diff, onViewFull, onReload }) {
|
|
64
|
+
const m = useAgentMessages().tools;
|
|
65
|
+
const noticeId = React.useId();
|
|
66
|
+
const hasLines = diff.hunks.some((h) => h.lines.length > 0);
|
|
67
|
+
return (_jsxs(_Fragment, { children: [diff.status === 'conflict' && (_jsx("div", { className: "rl-agent-diff__conflict", children: _jsxs(Notice, { tone: "warning", action: onReload && (_jsx(ActionButton, { icon: "retry", onClick: onReload, children: m.reloadFile })), children: [_jsx("strong", { children: m.conflictTitle }), " \u00B7 ", diff.conflictReason ?? m.conflictBody] }) })), diff.binary ? (_jsx("p", { className: "rl-agent-diff__placeholder", children: m.diffBinary })) : diff.status === 'unavailable' && !hasLines ? (_jsx("p", { className: "rl-agent-diff__placeholder", children: m.diffUnavailable })) : hasLines ? (_jsx(DiffLines, { diff: diff, label: m.diffRegion(diff.path) })) : (_jsx("p", { className: "rl-agent-diff__placeholder", children: m.diffEmpty })), diff.truncated && (_jsx(Notice, { tone: "info", id: noticeId, action: onViewFull && (_jsx(ActionButton, { icon: "external", onClick: onViewFull, describedBy: noticeId, children: m.diffViewFull })), children: m.diffTruncated }))] }));
|
|
68
|
+
}
|
|
69
|
+
function DiffHeaderParts({ diff }) {
|
|
70
|
+
const m = useAgentMessages().tools;
|
|
71
|
+
const t = totals(diff);
|
|
72
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "rl-agent-diff__path", title: diff.path, children: diff.path }), diff.movedTo && (_jsx("span", { className: "rl-agent-diff__moved", title: diff.movedTo, children: m.movedTo(diff.movedTo) })), _jsx("span", { className: "rl-agent-diff__change", children: m.diffChange[diff.change] }), !diff.binary && diff.statsReliable !== false && _jsx(DiffStats, { additions: t.additions, deletions: t.deletions }), diff.status && _jsx(DiffStatusPill, { status: diff.status })] }));
|
|
73
|
+
}
|
|
74
|
+
export const DiffPreview = React.forwardRef(function DiffPreview({ diff: diffProp, before, after, path, status, hideHeader, onViewFull, onReload, className, ...rest }, ref) {
|
|
75
|
+
const m = useAgentMessages().tools;
|
|
76
|
+
const diff = React.useMemo(() => resolveDiff({ diff: diffProp, before, after, path, status }), [diffProp, before, after, path, status]);
|
|
77
|
+
if (!diff) {
|
|
78
|
+
return (_jsx("div", { ...rest, ref: ref, className: cx('rl-agent-diff', className), children: _jsx("p", { className: "rl-agent-diff__placeholder", children: m.diffUnavailable }) }));
|
|
79
|
+
}
|
|
80
|
+
return (_jsxs("div", { ...rest, ref: ref, className: cx('rl-agent-diff', className), "data-status": diff.status, "data-change": diff.change, children: [!hideHeader && (_jsx("div", { className: "rl-agent-diff__header", children: _jsx(DiffHeaderParts, { diff: diff }) })), _jsx(DiffBody, { diff: diff, onViewFull: onViewFull, onReload: onReload })] }));
|
|
81
|
+
});
|
|
82
|
+
export const MultiFileDiff = React.forwardRef(function MultiFileDiff({ files, expanded, defaultExpanded, onExpandedChange, onViewFull, onReload, label, className, ...rest }, ref) {
|
|
83
|
+
const m = useAgentMessages().tools;
|
|
84
|
+
const [inner, setInner] = React.useState(() => defaultExpanded ? [...defaultExpanded] : files.filter((f, i) => i === 0 || f.status === 'conflict').map((f) => f.path));
|
|
85
|
+
const open = expanded ?? inner;
|
|
86
|
+
const stats = diffStats(files);
|
|
87
|
+
const toggle = (p, next) => {
|
|
88
|
+
const list = next ? [...open.filter((x) => x !== p), p] : open.filter((x) => x !== p);
|
|
89
|
+
if (expanded === undefined)
|
|
90
|
+
setInner(list);
|
|
91
|
+
onExpandedChange?.(list);
|
|
92
|
+
};
|
|
93
|
+
return (_jsxs("div", { ...rest, ref: ref, className: cx('rl-agent-multidiff', className), children: [_jsxs("p", { className: "rl-agent-multidiff__summary", children: [_jsx("span", { children: m.diffFiles(files.length) }), files.every((file) => file.statsReliable !== false) && _jsx(DiffStats, { additions: stats.additions, deletions: stats.deletions })] }), _jsx("ul", { className: "rl-agent-multidiff__list", "aria-label": label ?? m.multiFileList, children: files.map((file) => (_jsx("li", { className: "rl-agent-multidiff__item", "data-status": file.status, children: _jsx(Collapsible, { className: "rl-agent-multidiff__file", open: open.includes(file.path), onOpenChange: (next) => toggle(file.path, next), trigger: _jsx(DiffHeaderParts, { diff: file }), triggerProps: { className: 'rl-agent-multidiff__trigger' }, children: _jsx("div", { className: "rl-agent-diff", "data-status": file.status, "data-change": file.change, children: _jsx(DiffBody, { diff: file, onViewFull: onViewFull ? () => onViewFull(file.path) : undefined, onReload: onReload ? () => onReload(file.path) : undefined }) }) }) }, file.path))) })] }));
|
|
94
|
+
});
|
|
95
|
+
//# sourceMappingURL=DiffPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiffPreview.js","sourceRoot":"","sources":["../../../src/components/tools/DiffPreview.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1D,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,YAAY,E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,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,aAAoB,SAAS,EAAC,0BAA0B,iBAAc,IAAI,CAAC,MAAM,YAC/E,KAAC,WAAW,IACV,SAAS,EAAC,0BAA0B,EACpC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAC9B,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAC/C,OAAO,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,IAAI,GAAI,EACxC,YAAY,EAAE,EAAE,SAAS,EAAE,6BAA6B,EAAE,YAE1D,cAAK,SAAS,EAAC,eAAe,iBAAc,IAAI,CAAC,MAAM,iBAAe,IAAI,CAAC,MAAM,YAC/E,KAAC,QAAQ,IACP,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EAChE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,GAC1D,GACE,GACM,IAfP,IAAI,CAAC,IAAI,CAgBb,CACN,CAAC,GACC,IACD,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ToolCallView } from '@wzrhine/agent-core';
|
|
3
|
+
import type { ToolRecordProps } from './ToolRecord.js';
|
|
4
|
+
/** Dedupe by id (first occurrence wins) and order by `sequence` when every row has one. */
|
|
5
|
+
export declare function orderTools(tools: readonly ToolCallView[]): ToolCallView[];
|
|
6
|
+
/** Props forwarded to every row. */
|
|
7
|
+
export type ToolRowSharedProps = Pick<ToolRecordProps, 'onLoadDetails' | 'renderDetail' | 'detailActions'> & {
|
|
8
|
+
/** Load errors by tool id (`detailsError` of each row). */
|
|
9
|
+
detailsErrors?: Readonly<Record<string, React.ReactNode>>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* ToolActivity (atlas 11): one round of tool calls. The header is a disclosure button with the
|
|
13
|
+
* operation count, the running count, elapsed time and aggregated status counts (glyph + text).
|
|
14
|
+
* While any row is active an AgentSpark (executing) runs next to the count; it is decorative —
|
|
15
|
+
* the running count is the text. Rows are deduped by id and ordered by `sequence`.
|
|
16
|
+
*
|
|
17
|
+
* Open by default while the round is active, unless the user toggled it (or `expanded` controls
|
|
18
|
+
* it). Rows present at mount appear without animation; rows that arrive later get one
|
|
19
|
+
* AgentEntrance (`row`, staggered, capped); a batch of more than 20 rows arrives without motion.
|
|
20
|
+
* No layout animation across the list.
|
|
21
|
+
*/
|
|
22
|
+
export type ToolActivityProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & ToolRowSharedProps & {
|
|
23
|
+
tools: readonly ToolCallView[];
|
|
24
|
+
/** The round is still running. Defaults to "any row is active". */
|
|
25
|
+
active?: boolean;
|
|
26
|
+
/** Elapsed time of the round. */
|
|
27
|
+
elapsedMs?: number;
|
|
28
|
+
expanded?: boolean;
|
|
29
|
+
defaultExpanded?: boolean;
|
|
30
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
31
|
+
/** Shows the 「完整工具记录」 link. */
|
|
32
|
+
onOpenHistory?: () => void;
|
|
33
|
+
/** Replace a row. Return `undefined` to use the default ToolRecord. */
|
|
34
|
+
renderTool?: (tool: ToolCallView) => React.ReactNode | undefined;
|
|
35
|
+
/** Controlled expanded rows by id. */
|
|
36
|
+
expandedIds?: readonly string[];
|
|
37
|
+
onToolExpandedChange?: (id: string, expanded: boolean) => void;
|
|
38
|
+
/** Header title override (default 「N 个操作」). */
|
|
39
|
+
title?: React.ReactNode;
|
|
40
|
+
};
|
|
41
|
+
export declare const ToolActivity: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & Pick<ToolRecordProps, "onLoadDetails" | "renderDetail" | "detailActions"> & {
|
|
42
|
+
/** Load errors by tool id (`detailsError` of each row). */
|
|
43
|
+
detailsErrors?: Readonly<Record<string, React.ReactNode>>;
|
|
44
|
+
} & {
|
|
45
|
+
tools: readonly ToolCallView[];
|
|
46
|
+
/** The round is still running. Defaults to "any row is active". */
|
|
47
|
+
active?: boolean;
|
|
48
|
+
/** Elapsed time of the round. */
|
|
49
|
+
elapsedMs?: number;
|
|
50
|
+
expanded?: boolean;
|
|
51
|
+
defaultExpanded?: boolean;
|
|
52
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
53
|
+
/** Shows the 「完整工具记录」 link. */
|
|
54
|
+
onOpenHistory?: () => void;
|
|
55
|
+
/** Replace a row. Return `undefined` to use the default ToolRecord. */
|
|
56
|
+
renderTool?: (tool: ToolCallView) => React.ReactNode | undefined;
|
|
57
|
+
/** Controlled expanded rows by id. */
|
|
58
|
+
expandedIds?: readonly string[];
|
|
59
|
+
onToolExpandedChange?: (id: string, expanded: boolean) => void;
|
|
60
|
+
/** Header title override (default 「N 个操作」). */
|
|
61
|
+
title?: React.ReactNode;
|
|
62
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
63
|
+
//# sourceMappingURL=ToolActivity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolActivity.d.ts","sourceRoot":"","sources":["../../../src/components/tools/ToolActivity.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD,2FAA2F;AAC3F,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,EAAE,CAIzE;AAED,oCAAoC;AACpC,MAAM,MAA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,MAAM;eACP,OAAO;sBACA,OAAO;uBACN,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI;IAC9C,+BAA+B;oBACf,MAAM,IAAI;IAC1B,uEAAuE;iBAC1D,CAAC,IAAI,EAAE,YAAY,KAAK,KAAK,CAAC,SAAS,GAAG,SAAS;IAChE,sCAAsC;kBACxB,SAAS,MAAM,EAAE;2BACR,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI;IAC9D,+CAA+C;YACvC,KAAK,CAAC,SAAS;wCA6GzB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { dedupeById, toolStatusMeta } from '@wzrhine/agent-core';
|
|
5
|
+
import { Collapsible } from '@wzrhine/react';
|
|
6
|
+
import { useAgentFormat, useAgentMessages } from '../../provider/AgentMessages.js';
|
|
7
|
+
import { AgentSpark } from '../../primitives/AgentSpark.js';
|
|
8
|
+
import { AgentEntrance } from '../../motion/agent-motion.js';
|
|
9
|
+
import { AgentIcon } from '../../primitives/icons.js';
|
|
10
|
+
import { cx } from '../../utils/cx.js';
|
|
11
|
+
import { ToolRecord } from './ToolRecord.js';
|
|
12
|
+
import { ACTIVE_TOOL_STATUSES, ToolStatusPill, countStatuses, useFreshIndex } from './shared.js';
|
|
13
|
+
/** Dedupe by id (first occurrence wins) and order by `sequence` when every row has one. */
|
|
14
|
+
export function orderTools(tools) {
|
|
15
|
+
const unique = dedupeById(tools);
|
|
16
|
+
if (unique.every((t) => typeof t.sequence === 'number'))
|
|
17
|
+
return unique.slice().sort((a, b) => a.sequence - b.sequence);
|
|
18
|
+
return unique;
|
|
19
|
+
}
|
|
20
|
+
export const ToolActivity = React.forwardRef(function ToolActivity({ tools, active: activeProp, elapsedMs, expanded, defaultExpanded, onExpandedChange, onOpenHistory, renderTool, expandedIds, onToolExpandedChange, title, onLoadDetails, renderDetail, detailActions, detailsErrors, className, ...rest }, ref) {
|
|
21
|
+
const messages = useAgentMessages();
|
|
22
|
+
const m = messages.tools;
|
|
23
|
+
const fmt = useAgentFormat();
|
|
24
|
+
const rows = React.useMemo(() => orderTools(tools), [tools]);
|
|
25
|
+
const freshIndex = useFreshIndex(rows.map((r) => r.id));
|
|
26
|
+
// "Running" = activity in progress (queued / running / waiting for children); a round waiting
|
|
27
|
+
// for approval or an answer is still unsettled (open by default) but shows no spark.
|
|
28
|
+
const running = rows.filter((r) => toolStatusMeta[r.status]?.active).length;
|
|
29
|
+
const active = activeProp ?? rows.some((r) => ACTIVE_TOOL_STATUSES.includes(r.status));
|
|
30
|
+
const [userOpen, setUserOpen] = React.useState(defaultExpanded);
|
|
31
|
+
const open = expanded ?? userOpen ?? active;
|
|
32
|
+
const counts = countStatuses(rows.map((r) => r.status));
|
|
33
|
+
const setOpen = (next) => {
|
|
34
|
+
if (expanded === undefined)
|
|
35
|
+
setUserOpen(next);
|
|
36
|
+
onExpandedChange?.(next);
|
|
37
|
+
};
|
|
38
|
+
const header = (_jsxs("span", { className: "rl-agent-activity__header", children: [running > 0 && _jsx(AgentSpark, { phase: "executing", className: "rl-agent-activity__spark" }), _jsx("span", { className: "rl-agent-activity__title", children: title ?? m.operationCount(rows.length) }), running > 0 && _jsx("span", { className: "rl-agent-activity__running", children: m.runningCount(running) }), elapsedMs != null && _jsx("span", { className: "rl-agent-activity__elapsed", children: messages.status.elapsed(fmt.duration(elapsedMs)) }), counts.length > 0 && (_jsx("span", { className: "rl-agent-activity__counts", children: counts.map(([status, n]) => (_jsx(ToolStatusPill, { status: status, meta: n }, status))) }))] }));
|
|
39
|
+
return (_jsx("div", { ...rest, ref: ref, className: cx('rl-agent-activity', className), "data-active": active || undefined, children: _jsxs(Collapsible, { open: open, onOpenChange: setOpen, trigger: header, triggerProps: { className: 'rl-agent-activity__trigger' }, panelClassName: "rl-agent-activity__panel", children: [_jsx("ul", { className: "rl-agent-tool-list", "aria-label": m.activityList, children: rows.map((tool) => {
|
|
40
|
+
const index = freshIndex(tool.id);
|
|
41
|
+
const custom = renderTool?.(tool);
|
|
42
|
+
return (_jsx(AgentEntrance, { as: "li", kind: "row", animate: index >= 0, index: Math.max(0, index), className: "rl-agent-tool-list__item", children: custom !== undefined ? (custom) : (_jsx(ToolRecord, { tool: tool, expanded: expandedIds ? expandedIds.includes(tool.id) : undefined, onExpandedChange: onToolExpandedChange ? (next) => onToolExpandedChange(tool.id, next) : undefined, onLoadDetails: onLoadDetails, detailsError: detailsErrors?.[tool.id], renderDetail: renderDetail, detailActions: detailActions })) }, tool.id));
|
|
43
|
+
}) }), onOpenHistory && (_jsx("div", { className: "rl-agent-activity__footer", children: _jsxs("button", { type: "button", className: "rl-agent-tool-button", onClick: onOpenHistory, children: [_jsx(AgentIcon, { name: "history" }), _jsx("span", { className: "rl-agent-tool-button__text", children: m.openHistory })] }) }))] }) }));
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=ToolActivity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolActivity.js","sourceRoot":"","sources":["../../../src/components/tools/ToolActivity.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,UAA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V,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,EACjE,gBAAgB,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EAClG,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EACtC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAA8C,GAC7D,CACH,IAnBI,IAAI,CAAC,EAAE,CAoBE,CACjB,CAAC;oBACJ,CAAC,CAAC,GACC,EACJ,aAAa,IAAI,CAChB,cAAK,SAAS,EAAC,2BAA2B,YACxC,kBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,sBAAsB,EAAC,OAAO,EAAE,aAAa,aAC3E,KAAC,SAAS,IAAC,IAAI,EAAC,SAAS,GAAG,EAC5B,eAAM,SAAS,EAAC,4BAA4B,YAAE,CAAC,CAAC,WAAW,GAAQ,IAC5D,GACL,CACP,IACW,GACV,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ToolCallView, ToolDetailView } from '@wzrhine/agent-core';
|
|
3
|
+
import type { ChunkPagerActions } from './ChunkPager.js';
|
|
4
|
+
import type { ToolOutputProps } from './ToolOutput.js';
|
|
5
|
+
type DetailOf<K extends ToolDetailView['kind']> = Extract<ToolDetailView, {
|
|
6
|
+
kind: K;
|
|
7
|
+
}>;
|
|
8
|
+
type DetailBase = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
9
|
+
export type FileReadDetailProps = DetailBase & {
|
|
10
|
+
detail: DetailOf<'file-read'>;
|
|
11
|
+
/** Continue reading from the runtime-provided `nextOffset`. Rendered only when `nextOffset` exists. */
|
|
12
|
+
onReadMore?: (nextOffset: number) => void;
|
|
13
|
+
};
|
|
14
|
+
/** FileReadDetail (atlas 37): path, range, preview with line numbers from `range.start`, real result info. */
|
|
15
|
+
export declare function FileReadDetail({ detail, onReadMore, className, ...rest }: FileReadDetailProps): React.JSX.Element;
|
|
16
|
+
export type FileWriteDetailProps = DetailBase & {
|
|
17
|
+
detail: DetailOf<'file-write'>;
|
|
18
|
+
onReload?: () => void;
|
|
19
|
+
onViewFull?: () => void;
|
|
20
|
+
beforeActions?: ChunkPagerActions;
|
|
21
|
+
display?: 'verbatim' | 'diff';
|
|
22
|
+
};
|
|
23
|
+
/** FileWriteDetail (atlas 38): target, write mode, expected vs current version, proposal diff. */
|
|
24
|
+
export declare function FileWriteDetail({ detail, onReload, onViewFull, beforeActions, display, className, ...rest }: FileWriteDetailProps): React.JSX.Element;
|
|
25
|
+
export type EditFileDetailProps = DetailBase & {
|
|
26
|
+
detail: DetailOf<'file-edit'>;
|
|
27
|
+
pageActions?: ChunkPagerActions;
|
|
28
|
+
display?: 'verbatim' | 'diff';
|
|
29
|
+
};
|
|
30
|
+
/** EditFileDetail (atlas 39): every edit as 「编辑 N」 with range, strategy and a before/after diff. */
|
|
31
|
+
export declare function EditFileDetail({ detail, pageActions, display, className, ...rest }: EditFileDetailProps): React.JSX.Element;
|
|
32
|
+
export type ApplyPatchDetailProps = DetailBase & {
|
|
33
|
+
detail: DetailOf<'patch'>;
|
|
34
|
+
onReload?: (path: string) => void;
|
|
35
|
+
onViewFull?: (path: string) => void;
|
|
36
|
+
rawActions?: ChunkPagerActions;
|
|
37
|
+
};
|
|
38
|
+
/** ApplyPatchDetail (atlas 40): per-file change and status; a conflict names its files. */
|
|
39
|
+
export declare function ApplyPatchDetail({ detail, onReload, onViewFull, rawActions, className, ...rest }: ApplyPatchDetailProps): React.JSX.Element;
|
|
40
|
+
export type ManageFilesDetailProps = DetailBase & {
|
|
41
|
+
detail: DetailOf<'manage-files'>;
|
|
42
|
+
onLoadMore?: () => void;
|
|
43
|
+
loadingMore?: boolean;
|
|
44
|
+
pageActions?: ChunkPagerActions;
|
|
45
|
+
};
|
|
46
|
+
/** ManageFilesDetail (atlas 41): operation table; delete rows carry 「不能自动恢复」 in text. */
|
|
47
|
+
export declare function ManageFilesDetail({ detail, onLoadMore, loadingMore, pageActions, className, ...rest }: ManageFilesDetailProps): React.JSX.Element;
|
|
48
|
+
export type RunCommandDetailProps = DetailBase & {
|
|
49
|
+
detail: DetailOf<'command'>;
|
|
50
|
+
onOpenTerminal?: (terminalId: string) => void;
|
|
51
|
+
/** Passed through to the output (display truncation). */
|
|
52
|
+
outputProps?: Pick<ToolOutputProps, 'onLoadMore' | 'onOpenFull' | 'loadingMore' | 'onCopyText'>;
|
|
53
|
+
onCopyText?: (text: string) => void | Promise<void>;
|
|
54
|
+
};
|
|
55
|
+
/** RunCommandDetail (atlas 42): command, cwd, shell, timeout, execution state, exit code, terminal output. */
|
|
56
|
+
export declare function RunCommandDetail({ detail, onOpenTerminal, outputProps, onCopyText, className, ...rest }: RunCommandDetailProps): React.JSX.Element;
|
|
57
|
+
export type MCPExecuteDetailProps = DetailBase & {
|
|
58
|
+
detail: DetailOf<'mcp'>;
|
|
59
|
+
/** Ask the adapter to reconcile an unknown remote result. Shown only for `remote: 'unknown'`. */
|
|
60
|
+
onReconcile?: () => void;
|
|
61
|
+
outputProps?: Pick<ToolOutputProps, 'onLoadMore' | 'onOpenFull' | 'loadingMore' | 'onCopyText'>;
|
|
62
|
+
};
|
|
63
|
+
/** MCPExecuteDetail (atlas 43): server, tool, endpoint, catalog revision, full arguments, remote status. */
|
|
64
|
+
export declare function MCPExecuteDetail({ detail, onReconcile, outputProps, className, ...rest }: MCPExecuteDetailProps): React.JSX.Element;
|
|
65
|
+
export type NativeModelDetailProps = DetailBase & {
|
|
66
|
+
detail: DetailOf<'model'>;
|
|
67
|
+
/** The tool call is still running: show activity without a percentage. */
|
|
68
|
+
running?: boolean;
|
|
69
|
+
/** Save the generated material again (never calls the model again). Shown for partial / failed saves. */
|
|
70
|
+
onRetrySave?: () => void;
|
|
71
|
+
retrying?: boolean;
|
|
72
|
+
};
|
|
73
|
+
/** NativeModelDetail (atlas 44): provider · model, purpose, inputs, params, results and save state. */
|
|
74
|
+
export declare function NativeModelDetail({ detail, running, onRetrySave, retrying, className, ...rest }: NativeModelDetailProps): React.JSX.Element;
|
|
75
|
+
export type QuestionToolDetailProps = DetailBase & {
|
|
76
|
+
detail: DetailOf<'question'>;
|
|
77
|
+
};
|
|
78
|
+
/** QuestionToolDetail: question count and each answer (or 「已跳过」). */
|
|
79
|
+
export declare function QuestionToolDetail({ detail, className, ...rest }: QuestionToolDetailProps): React.JSX.Element;
|
|
80
|
+
export type SubagentToolDetailProps = DetailBase & {
|
|
81
|
+
detail: DetailOf<'agent'>;
|
|
82
|
+
onOpenChild?: (childConversationId: string) => void;
|
|
83
|
+
};
|
|
84
|
+
/** SubagentToolDetail: sub-task name, task and a link to the child conversation. */
|
|
85
|
+
export declare function SubagentToolDetail({ detail, onOpenChild, className, ...rest }: SubagentToolDetailProps): React.JSX.Element;
|
|
86
|
+
export type GenericToolDetailProps = DetailBase & {
|
|
87
|
+
detail: DetailOf<'generic'>;
|
|
88
|
+
outputProps?: Pick<ToolOutputProps, 'onLoadMore' | 'onOpenFull' | 'loadingMore' | 'onCopyText'>;
|
|
89
|
+
};
|
|
90
|
+
/** GenericToolDetail: any tool without a special view — input JSON + output. */
|
|
91
|
+
export declare function GenericToolDetail({ detail, outputProps, className, ...rest }: GenericToolDetailProps): React.JSX.Element;
|
|
92
|
+
/** Callbacks the built-in detail views can emit, keyed by what they act on. */
|
|
93
|
+
export interface ToolDetailActions {
|
|
94
|
+
onReadMore?: (tool: ToolCallView, nextOffset: number) => void;
|
|
95
|
+
onReload?: (tool: ToolCallView, path?: string) => void;
|
|
96
|
+
onViewFull?: (tool: ToolCallView, path?: string) => void;
|
|
97
|
+
onLoadMoreOperations?: (tool: ToolCallView) => void;
|
|
98
|
+
onOpenTerminal?: (terminalId: string, tool: ToolCallView) => void;
|
|
99
|
+
onReconcile?: (tool: ToolCallView) => void;
|
|
100
|
+
onRetrySave?: (tool: ToolCallView) => void;
|
|
101
|
+
onOpenChild?: (childConversationId: string, tool: ToolCallView) => void;
|
|
102
|
+
onLoadMoreOutput?: (tool: ToolCallView) => void;
|
|
103
|
+
onOpenFullOutput?: (tool: ToolCallView) => void;
|
|
104
|
+
onCopyText?: (text: string) => void | Promise<void>;
|
|
105
|
+
beforeActions?: ChunkPagerActions;
|
|
106
|
+
pageActions?: ChunkPagerActions;
|
|
107
|
+
rawActions?: ChunkPagerActions;
|
|
108
|
+
loadingMore?: boolean;
|
|
109
|
+
retrying?: boolean;
|
|
110
|
+
}
|
|
111
|
+
export type ToolDetailProps = ToolDetailActions & {
|
|
112
|
+
tool: ToolCallView;
|
|
113
|
+
detail?: ToolDetailView;
|
|
114
|
+
};
|
|
115
|
+
/** Render the built-in detail view for `detail.kind` (or the generic one). */
|
|
116
|
+
export declare function ToolDetail({ tool, detail, ...actions }: ToolDetailProps): React.JSX.Element | null;
|
|
117
|
+
export {};
|
|
118
|
+
//# sourceMappingURL=ToolDetails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolDetails.d.ts","sourceRoot":"","sources":["../../../src/components/tools/ToolDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAA8B,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAOpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAevD,KAAK,QAAQ,CAAC,CAAC,SAAS,cAAc,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,CAAC,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