@stigmer/react 3.0.9-dev.20260615153829 → 3.1.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/execution/ApprovalCard.d.ts +47 -3
- package/execution/ApprovalCard.d.ts.map +1 -1
- package/execution/ApprovalCard.js +138 -70
- package/execution/ApprovalCard.js.map +1 -1
- package/execution/ApprovalContext.d.ts +72 -0
- package/execution/ApprovalContext.d.ts.map +1 -0
- package/execution/ApprovalContext.js +41 -0
- package/execution/ApprovalContext.js.map +1 -0
- package/execution/ArtifactCard.d.ts.map +1 -1
- package/execution/ArtifactCard.js +3 -1
- package/execution/ArtifactCard.js.map +1 -1
- package/execution/ArtifactPreviewModal.d.ts.map +1 -1
- package/execution/ArtifactPreviewModal.js +5 -3
- package/execution/ArtifactPreviewModal.js.map +1 -1
- package/execution/EmptyChangeNotice.d.ts +38 -0
- package/execution/EmptyChangeNotice.d.ts.map +1 -0
- package/execution/EmptyChangeNotice.js +27 -0
- package/execution/EmptyChangeNotice.js.map +1 -0
- package/execution/FileChangesView.d.ts +81 -0
- package/execution/FileChangesView.d.ts.map +1 -0
- package/execution/FileChangesView.js +164 -0
- package/execution/FileChangesView.js.map +1 -0
- package/execution/FilePathLink.d.ts +24 -4
- package/execution/FilePathLink.d.ts.map +1 -1
- package/execution/FilePathLink.js +31 -9
- package/execution/FilePathLink.js.map +1 -1
- package/execution/FileReviewCard.d.ts +111 -0
- package/execution/FileReviewCard.d.ts.map +1 -0
- package/execution/FileReviewCard.js +558 -0
- package/execution/FileReviewCard.js.map +1 -0
- package/execution/FileReviewContext.d.ts +35 -0
- package/execution/FileReviewContext.d.ts.map +1 -0
- package/execution/FileReviewContext.js +23 -0
- package/execution/FileReviewContext.js.map +1 -0
- package/execution/FileReviewDock.d.ts +73 -0
- package/execution/FileReviewDock.d.ts.map +1 -0
- package/execution/FileReviewDock.js +65 -0
- package/execution/FileReviewDock.js.map +1 -0
- package/execution/McpToolDetail.d.ts.map +1 -1
- package/execution/McpToolDetail.js +38 -5
- package/execution/McpToolDetail.js.map +1 -1
- package/execution/MessageThread.d.ts +42 -3
- package/execution/MessageThread.d.ts.map +1 -1
- package/execution/MessageThread.js +263 -18
- package/execution/MessageThread.js.map +1 -1
- package/execution/PlanArtifactCard.d.ts.map +1 -1
- package/execution/PlanArtifactCard.js +3 -1
- package/execution/PlanArtifactCard.js.map +1 -1
- package/execution/PlanCompletionCard.d.ts +1 -1
- package/execution/PlanCompletionCard.js +1 -1
- package/execution/ResultView.d.ts +19 -1
- package/execution/ResultView.d.ts.map +1 -1
- package/execution/ResultView.js +141 -40
- package/execution/ResultView.js.map +1 -1
- package/execution/SubAgentSection.d.ts.map +1 -1
- package/execution/SubAgentSection.js +45 -6
- package/execution/SubAgentSection.js.map +1 -1
- package/execution/TerminalSession.d.ts +34 -0
- package/execution/TerminalSession.d.ts.map +1 -0
- package/execution/TerminalSession.js +34 -0
- package/execution/TerminalSession.js.map +1 -0
- package/execution/TodoCard.d.ts +53 -0
- package/execution/TodoCard.d.ts.map +1 -0
- package/execution/TodoCard.js +77 -0
- package/execution/TodoCard.js.map +1 -0
- package/execution/ToolArgsView.d.ts +7 -1
- package/execution/ToolArgsView.d.ts.map +1 -1
- package/execution/ToolArgsView.js +10 -9
- package/execution/ToolArgsView.js.map +1 -1
- package/execution/ToolCallDetail.d.ts +10 -1
- package/execution/ToolCallDetail.d.ts.map +1 -1
- package/execution/ToolCallDetail.js +66 -19
- package/execution/ToolCallDetail.js.map +1 -1
- package/execution/ToolCallGroup.d.ts +28 -18
- package/execution/ToolCallGroup.d.ts.map +1 -1
- package/execution/ToolCallGroup.js +39 -148
- package/execution/ToolCallGroup.js.map +1 -1
- package/execution/ToolCallItem.d.ts +36 -8
- package/execution/ToolCallItem.d.ts.map +1 -1
- package/execution/ToolCallItem.js +140 -21
- package/execution/ToolCallItem.js.map +1 -1
- package/execution/ToolRunGroup.d.ts +48 -0
- package/execution/ToolRunGroup.d.ts.map +1 -0
- package/execution/ToolRunGroup.js +168 -0
- package/execution/ToolRunGroup.js.map +1 -0
- package/execution/approval-provenance.d.ts +2 -0
- package/execution/approval-provenance.d.ts.map +1 -0
- package/execution/approval-provenance.js +6 -0
- package/execution/approval-provenance.js.map +1 -0
- package/execution/artifact-utils.d.ts +0 -10
- package/execution/artifact-utils.d.ts.map +1 -1
- package/execution/artifact-utils.js +0 -17
- package/execution/artifact-utils.js.map +1 -1
- package/execution/execution-phases.d.ts +1 -6
- package/execution/execution-phases.d.ts.map +1 -1
- package/execution/execution-phases.js +4 -14
- package/execution/execution-phases.js.map +1 -1
- package/execution/file-path-resolver.d.ts +28 -0
- package/execution/file-path-resolver.d.ts.map +1 -1
- package/execution/file-path-resolver.js +24 -0
- package/execution/file-path-resolver.js.map +1 -1
- package/execution/file-review-status.d.ts +127 -0
- package/execution/file-review-status.d.ts.map +1 -0
- package/execution/file-review-status.js +135 -0
- package/execution/file-review-status.js.map +1 -0
- package/execution/index.d.ts +39 -5
- package/execution/index.d.ts.map +1 -1
- package/execution/index.js +23 -3
- package/execution/index.js.map +1 -1
- package/execution/segment-tool-calls.d.ts +46 -0
- package/execution/segment-tool-calls.d.ts.map +1 -0
- package/execution/segment-tool-calls.js +71 -0
- package/execution/segment-tool-calls.js.map +1 -0
- package/execution/tool-categories.d.ts +62 -1
- package/execution/tool-categories.d.ts.map +1 -1
- package/execution/tool-categories.js +96 -2
- package/execution/tool-categories.js.map +1 -1
- package/execution/tool-presenter.d.ts +38 -2
- package/execution/tool-presenter.d.ts.map +1 -1
- package/execution/tool-presenter.js +23 -1
- package/execution/tool-presenter.js.map +1 -1
- package/execution/tool-rendering-primitives.d.ts.map +1 -1
- package/execution/tool-rendering-primitives.js +3 -2
- package/execution/tool-rendering-primitives.js.map +1 -1
- package/execution/useArtifactDownload.d.ts +44 -0
- package/execution/useArtifactDownload.d.ts.map +1 -0
- package/execution/useArtifactDownload.js +80 -0
- package/execution/useArtifactDownload.js.map +1 -0
- package/execution/useArtifactDownloadUrl.d.ts +67 -0
- package/execution/useArtifactDownloadUrl.d.ts.map +1 -0
- package/execution/useArtifactDownloadUrl.js +59 -0
- package/execution/useArtifactDownloadUrl.js.map +1 -0
- package/execution/useFileChangeContent.d.ts +61 -0
- package/execution/useFileChangeContent.d.ts.map +1 -0
- package/execution/useFileChangeContent.js +89 -0
- package/execution/useFileChangeContent.js.map +1 -0
- package/execution/useFileReview.d.ts +89 -0
- package/execution/useFileReview.d.ts.map +1 -0
- package/execution/useFileReview.js +106 -0
- package/execution/useFileReview.js.map +1 -0
- package/execution/useSubmitApproval.d.ts +17 -2
- package/execution/useSubmitApproval.d.ts.map +1 -1
- package/execution/useSubmitApproval.js +27 -23
- package/execution/useSubmitApproval.js.map +1 -1
- package/execution/useToolOutputContent.d.ts +44 -0
- package/execution/useToolOutputContent.d.ts.map +1 -0
- package/execution/useToolOutputContent.js +31 -0
- package/execution/useToolOutputContent.js.map +1 -0
- package/index.d.ts +6 -6
- package/index.d.ts.map +1 -1
- package/index.js +3 -3
- package/index.js.map +1 -1
- package/internal/ApprovalPeekBar.d.ts +23 -0
- package/internal/ApprovalPeekBar.d.ts.map +1 -0
- package/internal/ApprovalPeekBar.js +25 -0
- package/internal/ApprovalPeekBar.js.map +1 -0
- package/internal/BoundedContent.d.ts +49 -0
- package/internal/BoundedContent.d.ts.map +1 -0
- package/internal/BoundedContent.js +50 -0
- package/internal/BoundedContent.js.map +1 -0
- package/internal/DecisionButton.d.ts +47 -0
- package/internal/DecisionButton.d.ts.map +1 -0
- package/internal/DecisionButton.js +42 -0
- package/internal/DecisionButton.js.map +1 -0
- package/internal/InCardDecisionError.d.ts +31 -0
- package/internal/InCardDecisionError.d.ts.map +1 -0
- package/internal/InCardDecisionError.js +23 -0
- package/internal/InCardDecisionError.js.map +1 -0
- package/internal/RevealToggle.d.ts +36 -0
- package/internal/RevealToggle.d.ts.map +1 -0
- package/internal/RevealToggle.js +32 -0
- package/internal/RevealToggle.js.map +1 -0
- package/internal/VirtualizedThread.d.ts +7 -1
- package/internal/VirtualizedThread.d.ts.map +1 -1
- package/internal/VirtualizedThread.js +7 -3
- package/internal/VirtualizedThread.js.map +1 -1
- package/internal/code-highlight.d.ts +24 -0
- package/internal/code-highlight.d.ts.map +1 -0
- package/internal/code-highlight.js +115 -0
- package/internal/code-highlight.js.map +1 -0
- package/internal/markdown-components.d.ts.map +1 -1
- package/internal/markdown-components.js +13 -2
- package/internal/markdown-components.js.map +1 -1
- package/internal/useAutoDisclosure.d.ts +34 -0
- package/internal/useAutoDisclosure.d.ts.map +1 -0
- package/internal/useAutoDisclosure.js +53 -0
- package/internal/useAutoDisclosure.js.map +1 -0
- package/internal/useElapsedSince.d.ts +30 -0
- package/internal/useElapsedSince.d.ts.map +1 -0
- package/internal/useElapsedSince.js +70 -0
- package/internal/useElapsedSince.js.map +1 -0
- package/internal/useIsOverflowing.d.ts +30 -0
- package/internal/useIsOverflowing.d.ts.map +1 -0
- package/internal/useIsOverflowing.js +47 -0
- package/internal/useIsOverflowing.js.map +1 -0
- package/internal/useIsTextTruncated.d.ts +24 -0
- package/internal/useIsTextTruncated.d.ts.map +1 -0
- package/internal/useIsTextTruncated.js +41 -0
- package/internal/useIsTextTruncated.js.map +1 -0
- package/internal/useKeyedSubmission.d.ts +49 -0
- package/internal/useKeyedSubmission.d.ts.map +1 -0
- package/internal/useKeyedSubmission.js +67 -0
- package/internal/useKeyedSubmission.js.map +1 -0
- package/package.json +7 -4
- package/session/SessionViewer.d.ts +2 -2
- package/session/SessionViewer.d.ts.map +1 -1
- package/session/SessionViewer.js +10 -4
- package/session/SessionViewer.js.map +1 -1
- package/session/index.d.ts +2 -0
- package/session/index.d.ts.map +1 -1
- package/session/index.js +1 -0
- package/session/index.js.map +1 -1
- package/session/inspector/ChangesTab.d.ts +8 -5
- package/session/inspector/ChangesTab.d.ts.map +1 -1
- package/session/inspector/ChangesTab.js +11 -8
- package/session/inspector/ChangesTab.js.map +1 -1
- package/session/inspector/SessionInspector.d.ts +4 -4
- package/session/inspector/SessionInspector.d.ts.map +1 -1
- package/session/inspector/SessionInspector.js +4 -4
- package/session/inspector/SessionInspector.js.map +1 -1
- package/session/inspector/index.d.ts +0 -2
- package/session/inspector/index.d.ts.map +1 -1
- package/session/inspector/index.js +0 -1
- package/session/inspector/index.js.map +1 -1
- package/session/inspector/useSessionInspector.d.ts +8 -4
- package/session/inspector/useSessionInspector.d.ts.map +1 -1
- package/session/inspector/useSessionInspector.js +27 -20
- package/session/inspector/useSessionInspector.js.map +1 -1
- package/session/useSessionConversation.d.ts +37 -3
- package/session/useSessionConversation.d.ts.map +1 -1
- package/session/useSessionConversation.js +18 -2
- package/session/useSessionConversation.js.map +1 -1
- package/session/useSessionFileChanges.d.ts +74 -0
- package/session/useSessionFileChanges.d.ts.map +1 -0
- package/session/useSessionFileChanges.js +178 -0
- package/session/useSessionFileChanges.js.map +1 -0
- package/src/__tests__/styles-border-layer-invariant.test.ts +105 -0
- package/src/execution/ApprovalCard.tsx +368 -230
- package/src/execution/ApprovalContext.ts +109 -0
- package/src/execution/ArtifactCard.tsx +10 -6
- package/src/execution/ArtifactPreviewModal.tsx +12 -6
- package/src/execution/EmptyChangeNotice.tsx +62 -0
- package/src/execution/FileChangesView.tsx +383 -0
- package/src/execution/FilePathLink.tsx +65 -12
- package/src/execution/FileReviewCard.tsx +1118 -0
- package/src/execution/FileReviewContext.ts +53 -0
- package/src/execution/FileReviewDock.tsx +157 -0
- package/src/execution/McpToolDetail.tsx +98 -32
- package/src/execution/MessageThread.tsx +374 -9
- package/src/execution/PlanArtifactCard.tsx +9 -6
- package/src/execution/PlanCompletionCard.tsx +1 -1
- package/src/execution/ResultView.tsx +333 -162
- package/src/execution/SubAgentSection.tsx +58 -11
- package/src/execution/TerminalSession.tsx +91 -0
- package/src/execution/TodoCard.tsx +186 -0
- package/src/execution/ToolArgsView.tsx +28 -17
- package/src/execution/ToolCallDetail.tsx +137 -26
- package/src/execution/ToolCallGroup.tsx +68 -296
- package/src/execution/ToolCallItem.tsx +265 -67
- package/src/execution/ToolRunGroup.tsx +302 -0
- package/src/execution/__tests__/ApprovalCard.test.tsx +395 -5
- package/src/execution/__tests__/ArtifactContentRenderer.test.tsx +15 -0
- package/src/execution/__tests__/ArtifactPreviewModal.test.tsx +0 -1
- package/src/execution/__tests__/EmptyChangeNotice.test.tsx +24 -0
- package/src/execution/__tests__/FileChangesView.test.tsx +296 -0
- package/src/execution/__tests__/FilePathLink.test.tsx +92 -0
- package/src/execution/__tests__/FileReviewCard.test.tsx +1044 -0
- package/src/execution/__tests__/FileReviewDock.test.tsx +134 -0
- package/src/execution/__tests__/McpToolDetail.test.tsx +79 -0
- package/src/execution/__tests__/MessageThread.test.tsx +324 -0
- package/src/execution/__tests__/PlanArtifactCard.test.tsx +37 -16
- package/src/execution/__tests__/ResultView.test.tsx +280 -2
- package/src/execution/__tests__/SubAgentSection.test.tsx +180 -0
- package/src/execution/__tests__/TerminalSession.test.tsx +72 -0
- package/src/execution/__tests__/TodoCard.test.tsx +102 -0
- package/src/execution/__tests__/ToolArgsView.test.tsx +48 -0
- package/src/execution/__tests__/ToolCallDetail.test.tsx +195 -0
- package/src/execution/__tests__/ToolCallGroup.test.tsx +132 -0
- package/src/execution/__tests__/ToolCallItem.test.tsx +521 -0
- package/src/execution/__tests__/ToolRunGroup.test.tsx +137 -0
- package/src/execution/__tests__/blanked-narration.test.tsx +149 -0
- package/src/execution/__tests__/buildThreadItems-approvals.test.ts +304 -0
- package/src/execution/__tests__/buildThreadItems-file-review.test.ts +331 -0
- package/src/execution/__tests__/file-path-resolver.test.ts +44 -0
- package/src/execution/__tests__/file-review-status.test.ts +343 -0
- package/src/execution/__tests__/message-entry.test.tsx +16 -0
- package/src/execution/__tests__/segment-tool-calls.test.ts +124 -0
- package/src/execution/__tests__/subagent-file-review-badge.test.tsx +273 -0
- package/src/execution/__tests__/thread-keys.test.ts +195 -0
- package/src/execution/__tests__/tool-presenter.test.tsx +95 -0
- package/src/execution/__tests__/useArtifactDownload.test.tsx +67 -0
- package/src/execution/__tests__/useArtifactDownloadUrl.test.tsx +51 -0
- package/src/execution/__tests__/useFileChangeContent.test.tsx +240 -0
- package/src/execution/__tests__/useFileReview.test.tsx +236 -0
- package/src/execution/__tests__/useSubmitApproval.test.tsx +165 -0
- package/src/execution/__tests__/useToolOutputContent.test.tsx +82 -0
- package/src/execution/approval-provenance.ts +8 -0
- package/src/execution/artifact-utils.ts +0 -18
- package/src/execution/execution-phases.ts +4 -16
- package/src/execution/file-path-resolver.ts +38 -0
- package/src/execution/file-review-status.ts +219 -0
- package/src/execution/index.ts +84 -4
- package/src/execution/segment-tool-calls.ts +101 -0
- package/src/execution/tool-categories.ts +128 -1
- package/src/execution/tool-presenter.ts +58 -3
- package/src/execution/tool-rendering-primitives.tsx +11 -14
- package/src/execution/useArtifactDownload.ts +109 -0
- package/src/execution/useArtifactDownloadUrl.ts +116 -0
- package/src/execution/useFileChangeContent.ts +149 -0
- package/src/execution/useFileReview.ts +197 -0
- package/src/execution/useSubmitApproval.ts +49 -27
- package/src/execution/useToolOutputContent.ts +70 -0
- package/src/index.ts +60 -1
- package/src/internal/ApprovalPeekBar.tsx +73 -0
- package/src/internal/BoundedContent.tsx +97 -0
- package/src/internal/DecisionButton.tsx +127 -0
- package/src/internal/InCardDecisionError.tsx +47 -0
- package/src/internal/RevealToggle.tsx +91 -0
- package/src/internal/VirtualizedThread.tsx +28 -2
- package/src/internal/__tests__/ApprovalPeekBar.test.tsx +34 -0
- package/src/internal/__tests__/BoundedContent.test.tsx +92 -0
- package/src/internal/__tests__/DecisionButton.test.tsx +107 -0
- package/src/internal/__tests__/RevealToggle.test.tsx +61 -0
- package/src/internal/__tests__/code-highlight.test.tsx +59 -0
- package/src/internal/__tests__/markdown-components.test.tsx +68 -2
- package/src/internal/__tests__/useAutoDisclosure.test.ts +74 -0
- package/src/internal/__tests__/useElapsedSince.test.tsx +68 -0
- package/src/internal/__tests__/useIsOverflowing.test.ts +36 -0
- package/src/internal/__tests__/useKeyedSubmission.test.tsx +126 -0
- package/src/internal/code-highlight.tsx +120 -0
- package/src/internal/markdown-components.tsx +20 -3
- package/src/internal/useAutoDisclosure.ts +58 -0
- package/src/internal/useElapsedSince.ts +72 -0
- package/src/internal/useIsOverflowing.ts +61 -0
- package/src/internal/useIsTextTruncated.ts +55 -0
- package/src/internal/useKeyedSubmission.ts +101 -0
- package/src/session/SessionViewer.tsx +21 -4
- package/src/session/__tests__/SessionViewer-fileReviewDock.test.tsx +198 -0
- package/src/session/__tests__/audienceWiring.test.tsx +4 -0
- package/src/session/__tests__/useSessionFileChanges.test.ts +303 -0
- package/src/session/index.ts +3 -0
- package/src/session/inspector/ChangesTab.tsx +20 -17
- package/src/session/inspector/SessionInspector.tsx +12 -10
- package/src/session/inspector/__tests__/ArtifactsTab.test.tsx +0 -1
- package/src/session/inspector/__tests__/ChangesTab.test.tsx +38 -0
- package/src/session/inspector/__tests__/useSessionInspector.test.ts +46 -61
- package/src/session/inspector/index.ts +0 -3
- package/src/session/inspector/useSessionInspector.ts +27 -20
- package/src/session/useSessionConversation.ts +80 -3
- package/src/session/useSessionFileChanges.ts +207 -0
- package/src/styles.css +123 -10
- package/src/version-history/DiffViewer.tsx +10 -7
- package/src/version-history/UnifiedDiffView.tsx +66 -0
- package/src/version-history/__tests__/DiffViewer.test.tsx +57 -0
- package/src/version-history/__tests__/UnifiedDiffView.test.tsx +50 -0
- package/src/version-history/__tests__/computeDiff.test.ts +35 -0
- package/src/version-history/__tests__/parseUnifiedDiff.test.ts +82 -0
- package/src/version-history/computeDiff.ts +6 -37
- package/src/version-history/diff-hunks.ts +63 -0
- package/src/version-history/index.ts +1 -0
- package/src/version-history/parseUnifiedDiff.ts +34 -0
- package/src/workflow/WorkflowExecutionApprovalCard.tsx +49 -24
- package/src/workflow/WorkflowExecutionTimeline.tsx +15 -4
- package/src/workflow/WorkflowExecutionTimelineEvent.tsx +8 -3
- package/src/workflow/WorkflowExecutionViewer.tsx +72 -28
- package/src/workflow/WorkflowFileReviewList.tsx +152 -0
- package/src/workflow/WorkflowTaskApprovalCard.tsx +37 -85
- package/src/workflow/__tests__/ExecutionInspector.test.tsx +30 -2
- package/src/workflow/__tests__/WorkflowExecutionApprovalCard.test.tsx +129 -0
- package/src/workflow/__tests__/WorkflowFileReviewList.test.tsx +129 -0
- package/src/workflow/__tests__/WorkflowTaskApprovalCard.test.tsx +43 -11
- package/src/workflow/__tests__/useWorkflowExecutionActions.test.tsx +276 -0
- package/src/workflow/execution-inspector/ExecutionInspector.tsx +42 -18
- package/src/workflow/index.ts +5 -0
- package/src/workflow/useWorkflowExecutionActions.ts +177 -29
- package/styles.css +1 -1
- package/version-history/DiffViewer.d.ts.map +1 -1
- package/version-history/DiffViewer.js +9 -3
- package/version-history/DiffViewer.js.map +1 -1
- package/version-history/UnifiedDiffView.d.ts +29 -0
- package/version-history/UnifiedDiffView.d.ts.map +1 -0
- package/version-history/UnifiedDiffView.js +36 -0
- package/version-history/UnifiedDiffView.js.map +1 -0
- package/version-history/computeDiff.d.ts +3 -1
- package/version-history/computeDiff.d.ts.map +1 -1
- package/version-history/computeDiff.js +5 -35
- package/version-history/computeDiff.js.map +1 -1
- package/version-history/diff-hunks.d.ts +21 -0
- package/version-history/diff-hunks.d.ts.map +1 -0
- package/version-history/diff-hunks.js +58 -0
- package/version-history/diff-hunks.js.map +1 -0
- package/version-history/index.d.ts +1 -0
- package/version-history/index.d.ts.map +1 -1
- package/version-history/index.js +1 -0
- package/version-history/index.js.map +1 -1
- package/version-history/parseUnifiedDiff.d.ts +22 -0
- package/version-history/parseUnifiedDiff.d.ts.map +1 -0
- package/version-history/parseUnifiedDiff.js +34 -0
- package/version-history/parseUnifiedDiff.js.map +1 -0
- package/workflow/WorkflowExecutionApprovalCard.d.ts +8 -1
- package/workflow/WorkflowExecutionApprovalCard.d.ts.map +1 -1
- package/workflow/WorkflowExecutionApprovalCard.js +17 -3
- package/workflow/WorkflowExecutionApprovalCard.js.map +1 -1
- package/workflow/WorkflowExecutionTimeline.d.ts +11 -2
- package/workflow/WorkflowExecutionTimeline.d.ts.map +1 -1
- package/workflow/WorkflowExecutionTimeline.js +2 -2
- package/workflow/WorkflowExecutionTimeline.js.map +1 -1
- package/workflow/WorkflowExecutionTimelineEvent.d.ts +4 -1
- package/workflow/WorkflowExecutionTimelineEvent.d.ts.map +1 -1
- package/workflow/WorkflowExecutionTimelineEvent.js +2 -2
- package/workflow/WorkflowExecutionTimelineEvent.js.map +1 -1
- package/workflow/WorkflowExecutionViewer.d.ts.map +1 -1
- package/workflow/WorkflowExecutionViewer.js +18 -10
- package/workflow/WorkflowExecutionViewer.js.map +1 -1
- package/workflow/WorkflowFileReviewList.d.ts +46 -0
- package/workflow/WorkflowFileReviewList.d.ts.map +1 -0
- package/workflow/WorkflowFileReviewList.js +48 -0
- package/workflow/WorkflowFileReviewList.js.map +1 -0
- package/workflow/WorkflowTaskApprovalCard.d.ts +8 -1
- package/workflow/WorkflowTaskApprovalCard.d.ts.map +1 -1
- package/workflow/WorkflowTaskApprovalCard.js +12 -19
- package/workflow/WorkflowTaskApprovalCard.js.map +1 -1
- package/workflow/execution-inspector/ExecutionInspector.d.ts +21 -4
- package/workflow/execution-inspector/ExecutionInspector.d.ts.map +1 -1
- package/workflow/execution-inspector/ExecutionInspector.js +6 -3
- package/workflow/execution-inspector/ExecutionInspector.js.map +1 -1
- package/workflow/index.d.ts +1 -0
- package/workflow/index.d.ts.map +1 -1
- package/workflow/index.js +1 -0
- package/workflow/index.js.map +1 -1
- package/workflow/useWorkflowExecutionActions.d.ts +62 -4
- package/workflow/useWorkflowExecutionActions.d.ts.map +1 -1
- package/workflow/useWorkflowExecutionActions.js +94 -18
- package/workflow/useWorkflowExecutionActions.js.map +1 -1
- package/session/inspector/PlanTab.d.ts +0 -15
- package/session/inspector/PlanTab.d.ts.map +0 -1
- package/session/inspector/PlanTab.js +0 -19
- package/session/inspector/PlanTab.js.map +0 -1
- package/src/session/inspector/PlanTab.tsx +0 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiffViewer.d.ts","sourceRoot":"","sources":["../../src/version-history/DiffViewer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAElD,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"DiffViewer.d.ts","sourceRoot":"","sources":["../../src/version-history/DiffViewer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAElD,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,2CA4CzE"}
|
|
@@ -24,14 +24,14 @@ export function DiffViewer({ hunks, filePath, className }) {
|
|
|
24
24
|
if (hunks.length === 0) {
|
|
25
25
|
return (_jsx("div", { role: "status", className: cn("flex items-center justify-center py-8 text-sm text-muted-foreground", className), children: "No changes" }));
|
|
26
26
|
}
|
|
27
|
-
return (_jsxs("div", { className: cn("overflow-auto rounded-lg border border-border font-mono text-[13px] leading-[1.6]", className), children: [filePath && (_jsx("div", { className: "sticky top-0 z-10 border-b border-border bg-muted px-3 py-1.5 text-xs font-medium text-muted-foreground", children: filePath })), _jsxs("table", { className: "w-full border-collapse", role: "table", children: [_jsx("thead", { className: "sr-only", children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: "
|
|
27
|
+
return (_jsxs("div", { className: cn("overflow-auto rounded-lg border border-border font-mono text-[13px] leading-[1.6]", className), children: [filePath && (_jsx("div", { className: "sticky top-0 z-10 border-b border-border bg-muted px-3 py-1.5 text-xs font-medium text-muted-foreground", children: filePath })), _jsxs("table", { className: "w-full border-collapse", role: "table", children: [_jsx("thead", { className: "sr-only", children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: "Line" }), _jsx("th", { scope: "col", children: "Change" }), _jsx("th", { scope: "col", children: "Content" })] }) }), _jsx("tbody", { children: hunks.map((hunk, hunkIdx) => (_jsx(HunkRows, { hunk: hunk, isFirst: hunkIdx === 0 }, hunkIdx))) })] })] }));
|
|
28
28
|
}
|
|
29
29
|
// ---------------------------------------------------------------------------
|
|
30
30
|
// Hunk rendering
|
|
31
31
|
// ---------------------------------------------------------------------------
|
|
32
32
|
function HunkRows({ hunk, isFirst, }) {
|
|
33
33
|
const header = `@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`;
|
|
34
|
-
return (_jsxs(_Fragment, { children: [!isFirst && (_jsx("tr", { children: _jsx("td", { colSpan:
|
|
34
|
+
return (_jsxs(_Fragment, { children: [!isFirst && (_jsx("tr", { children: _jsx("td", { colSpan: 3, className: "select-none bg-diff-hunk-header-bg px-3 py-1 text-[11px] text-diff-hunk-header-fg", "aria-label": `Hunk: ${header}`, children: header }) })), hunk.lines.map((line, lineIdx) => (_jsx(DiffLineRow, { line: line }, lineIdx)))] }));
|
|
35
35
|
}
|
|
36
36
|
// ---------------------------------------------------------------------------
|
|
37
37
|
// Line rendering
|
|
@@ -55,6 +55,12 @@ function DiffLineRow({ line }) {
|
|
|
55
55
|
: line.type === "removed"
|
|
56
56
|
? `Removed line ${line.oldLineNumber}: ${line.content}`
|
|
57
57
|
: undefined;
|
|
58
|
-
|
|
58
|
+
// A single line-number gutter — the Cursor/VS Code inline-diff convention,
|
|
59
|
+
// more compact than GitHub's old+new pair. Each line shows the number from the
|
|
60
|
+
// side it belongs to: the new-file number for added/context lines, the
|
|
61
|
+
// old-file number for a removed line (which has no new-side number). The
|
|
62
|
+
// marker (+/-) and row color carry the change type.
|
|
63
|
+
const lineNumber = line.newLineNumber ?? line.oldLineNumber;
|
|
64
|
+
return (_jsxs("tr", { className: rowClass, "aria-label": ariaLabel, children: [_jsx("td", { className: LINE_NUM_CLASSES, children: lineNumber ?? "" }), _jsx("td", { className: cn(MARKER_CLASSES, markerColor), "aria-hidden": "true", children: marker }), _jsx("td", { className: "whitespace-pre-wrap break-all px-2", children: line.content })] }));
|
|
59
65
|
}
|
|
60
66
|
//# sourceMappingURL=DiffViewer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiffViewer.js","sourceRoot":"","sources":["../../src/version-history/DiffViewer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAapC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAmB;IACxE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,CACL,cACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CACX,qEAAqE,EACrE,SAAS,CACV,2BAGG,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,mFAAmF,EACnF,SAAS,CACV,aAEA,QAAQ,IAAI,CACX,cAAK,SAAS,EAAC,yGAAyG,YACrH,QAAQ,GACL,CACP,EAED,iBAAO,SAAS,EAAC,wBAAwB,EAAC,IAAI,EAAC,OAAO,aACpD,gBAAO,SAAS,EAAC,SAAS,YACxB,yBACE,aAAI,KAAK,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"DiffViewer.js","sourceRoot":"","sources":["../../src/version-history/DiffViewer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAapC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAmB;IACxE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,CACL,cACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CACX,qEAAqE,EACrE,SAAS,CACV,2BAGG,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,mFAAmF,EACnF,SAAS,CACV,aAEA,QAAQ,IAAI,CACX,cAAK,SAAS,EAAC,yGAAyG,YACrH,QAAQ,GACL,CACP,EAED,iBAAO,SAAS,EAAC,wBAAwB,EAAC,IAAI,EAAC,OAAO,aACpD,gBAAO,SAAS,EAAC,SAAS,YACxB,yBACE,aAAI,KAAK,EAAC,KAAK,qBAAU,EACzB,aAAI,KAAK,EAAC,KAAK,uBAAY,EAC3B,aAAI,KAAK,EAAC,KAAK,wBAAa,IACzB,GACC,EACR,0BACG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAC5B,KAAC,QAAQ,IAAe,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,KAAK,CAAC,IAA3C,OAAO,CAAwC,CAC/D,CAAC,GACI,IACF,IACJ,CACP,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,iBAAiB;AAC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BAAsB;YACxB,CAAC,CAAC,6BAA6B,CAAC;IAEtC,MAAM,SAAS,GACb,IAAI,CAAC,IAAI,KAAK,OAAO;QACnB,CAAC,CAAC,cAAc,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,OAAO,EAAE;QACrD,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS;YACvB,CAAC,CAAC,gBAAgB,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,OAAO,EAAE;YACvD,CAAC,CAAC,SAAS,CAAC;IAElB,2EAA2E;IAC3E,+EAA+E;IAC/E,uEAAuE;IACvE,yEAAyE;IACzE,oDAAoD;IACpD,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC;IAE5D,OAAO,CACL,cAAI,SAAS,EAAE,QAAQ,gBAAc,SAAS,aAC5C,aAAI,SAAS,EAAE,gBAAgB,YAC5B,UAAU,IAAI,EAAE,GACd,EACL,aAAI,SAAS,EAAE,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,iBAAc,MAAM,YAC/D,MAAM,GACJ,EACL,aAAI,SAAS,EAAC,oCAAoC,YAC/C,IAAI,CAAC,OAAO,GACV,IACF,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Props for {@link UnifiedDiffView}. */
|
|
2
|
+
export interface UnifiedDiffViewProps {
|
|
3
|
+
/** A unified-diff patch string (e.g. Cursor's hunk-only `diffString`). */
|
|
4
|
+
readonly patch: string;
|
|
5
|
+
/** Additional CSS classes for the root container (e.g. a height cap). */
|
|
6
|
+
readonly className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The single canonical renderer for a unified-diff patch *string*.
|
|
10
|
+
*
|
|
11
|
+
* It parses the patch into hunks and renders them through {@link DiffViewer} —
|
|
12
|
+
* the same accessible table (line numbers, colored row backgrounds, a narrow
|
|
13
|
+
* `+`/`-` gutter column, `--stgm-diff-*` tokens) that a computed before/after
|
|
14
|
+
* diff uses — so a harness that only emits a ready unified diff (the Cursor
|
|
15
|
+
* harness's `diffString`) looks line-for-line identical to a native whole-file
|
|
16
|
+
* diff. The `---`/`+++`/`@@` preamble parses into metadata and never reaches the
|
|
17
|
+
* screen; a single-hunk diff shows no `@@` separator at all.
|
|
18
|
+
*
|
|
19
|
+
* Fallback: if the patch cannot be parsed into any hunk (a malformed or
|
|
20
|
+
* non-standard payload) it renders verbatim in a `<pre>` so we show something
|
|
21
|
+
* truthful rather than a misleading "No changes". Color is never the sole
|
|
22
|
+
* channel in either path — the gutter marker / literal prefix carries the change
|
|
23
|
+
* type for non-color readers.
|
|
24
|
+
*
|
|
25
|
+
* Internal to the SDK (not barrel-exported); consumed by {@link ResultView} and
|
|
26
|
+
* {@link FileChangeDiff}.
|
|
27
|
+
*/
|
|
28
|
+
export declare function UnifiedDiffView({ patch, className }: UnifiedDiffViewProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=UnifiedDiffView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnifiedDiffView.d.ts","sourceRoot":"","sources":["../../src/version-history/UnifiedDiffView.tsx"],"names":[],"mappings":"AAOA,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,oBAAoB,2CA8BzE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { DiffViewer } from "./DiffViewer";
|
|
6
|
+
import { parseUnifiedDiff } from "./parseUnifiedDiff";
|
|
7
|
+
/**
|
|
8
|
+
* The single canonical renderer for a unified-diff patch *string*.
|
|
9
|
+
*
|
|
10
|
+
* It parses the patch into hunks and renders them through {@link DiffViewer} —
|
|
11
|
+
* the same accessible table (line numbers, colored row backgrounds, a narrow
|
|
12
|
+
* `+`/`-` gutter column, `--stgm-diff-*` tokens) that a computed before/after
|
|
13
|
+
* diff uses — so a harness that only emits a ready unified diff (the Cursor
|
|
14
|
+
* harness's `diffString`) looks line-for-line identical to a native whole-file
|
|
15
|
+
* diff. The `---`/`+++`/`@@` preamble parses into metadata and never reaches the
|
|
16
|
+
* screen; a single-hunk diff shows no `@@` separator at all.
|
|
17
|
+
*
|
|
18
|
+
* Fallback: if the patch cannot be parsed into any hunk (a malformed or
|
|
19
|
+
* non-standard payload) it renders verbatim in a `<pre>` so we show something
|
|
20
|
+
* truthful rather than a misleading "No changes". Color is never the sole
|
|
21
|
+
* channel in either path — the gutter marker / literal prefix carries the change
|
|
22
|
+
* type for non-color readers.
|
|
23
|
+
*
|
|
24
|
+
* Internal to the SDK (not barrel-exported); consumed by {@link ResultView} and
|
|
25
|
+
* {@link FileChangeDiff}.
|
|
26
|
+
*/
|
|
27
|
+
export function UnifiedDiffView({ patch, className }) {
|
|
28
|
+
const hunks = useMemo(() => parseUnifiedDiff(patch), [patch]);
|
|
29
|
+
if (hunks.length > 0) {
|
|
30
|
+
return _jsx(DiffViewer, { hunks: hunks, className: className });
|
|
31
|
+
}
|
|
32
|
+
// Unparseable but non-empty: show the raw patch rather than nothing.
|
|
33
|
+
const lines = patch.split("\n");
|
|
34
|
+
return (_jsx("pre", { className: cn("max-h-96 overflow-auto whitespace-pre-wrap break-words rounded-md border border-border bg-muted-subtle p-2 font-mono text-xs", className), children: lines.map((line, i) => (_jsx("div", { className: cn(line.startsWith("+") && !line.startsWith("+++") && "text-diff-added-fg", line.startsWith("-") && !line.startsWith("---") && "text-diff-removed-fg", line.startsWith("@@") && "text-diff-hunk-header-fg"), children: line || " " }, i))) }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=UnifiedDiffView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnifiedDiffView.js","sourceRoot":"","sources":["../../src/version-history/UnifiedDiffView.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAUtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,SAAS,EAAwB;IACxE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAE9D,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,GAAI,CAAC;IAC5D,CAAC;IAED,qEAAqE;IACrE,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,8HAA8H,EAC9H,SAAS,CACV,YAEA,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,cAEE,SAAS,EAAE,EAAE,CACX,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,oBAAoB,EACvE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,sBAAsB,EACzE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,0BAA0B,CACpD,YAEA,IAAI,IAAI,GAAG,IAPP,CAAC,CAQF,CACP,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -4,7 +4,9 @@ import type { DiffHunk } from "./types";
|
|
|
4
4
|
*
|
|
5
5
|
* Returns an array of {@link DiffHunk} objects, each containing the
|
|
6
6
|
* changed and context lines with line numbers. Uses the `diff` library's
|
|
7
|
-
* Myers algorithm internally
|
|
7
|
+
* Myers algorithm internally, then maps the structured hunks through the
|
|
8
|
+
* shared {@link mapPatchHunks} (the same mapper `parseUnifiedDiff` uses), so a
|
|
9
|
+
* computed diff and a parsed unified diff render line-for-line identically.
|
|
8
10
|
*
|
|
9
11
|
* Pure function — no side effects, safe to call outside React.
|
|
10
12
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeDiff.d.ts","sourceRoot":"","sources":["../../src/version-history/computeDiff.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"computeDiff.d.ts","sourceRoot":"","sources":["../../src/version-history/computeDiff.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,YAAY,SAAI,GACf,SAAS,QAAQ,EAAE,CAMrB"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { structuredPatch } from "diff";
|
|
2
|
+
import { mapPatchHunks } from "./diff-hunks";
|
|
2
3
|
/**
|
|
3
4
|
* Compute a unified diff between two text strings.
|
|
4
5
|
*
|
|
5
6
|
* Returns an array of {@link DiffHunk} objects, each containing the
|
|
6
7
|
* changed and context lines with line numbers. Uses the `diff` library's
|
|
7
|
-
* Myers algorithm internally
|
|
8
|
+
* Myers algorithm internally, then maps the structured hunks through the
|
|
9
|
+
* shared {@link mapPatchHunks} (the same mapper `parseUnifiedDiff` uses), so a
|
|
10
|
+
* computed diff and a parsed unified diff render line-for-line identically.
|
|
8
11
|
*
|
|
9
12
|
* Pure function — no side effects, safe to call outside React.
|
|
10
13
|
*
|
|
@@ -16,39 +19,6 @@ export function computeDiff(oldText, newText, contextLines = 3) {
|
|
|
16
19
|
const patch = structuredPatch("a", "b", oldText, newText, "", "", {
|
|
17
20
|
context: contextLines,
|
|
18
21
|
});
|
|
19
|
-
return patch.hunks
|
|
20
|
-
const lines = [];
|
|
21
|
-
let oldLine = hunk.oldStart;
|
|
22
|
-
let newLine = hunk.newStart;
|
|
23
|
-
for (const raw of hunk.lines) {
|
|
24
|
-
const prefix = raw[0];
|
|
25
|
-
const content = raw.slice(1);
|
|
26
|
-
if (prefix === "+") {
|
|
27
|
-
lines.push({ type: "added", content, newLineNumber: newLine });
|
|
28
|
-
newLine++;
|
|
29
|
-
}
|
|
30
|
-
else if (prefix === "-") {
|
|
31
|
-
lines.push({ type: "removed", content, oldLineNumber: oldLine });
|
|
32
|
-
oldLine++;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
lines.push({
|
|
36
|
-
type: "context",
|
|
37
|
-
content,
|
|
38
|
-
oldLineNumber: oldLine,
|
|
39
|
-
newLineNumber: newLine,
|
|
40
|
-
});
|
|
41
|
-
oldLine++;
|
|
42
|
-
newLine++;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
oldStart: hunk.oldStart,
|
|
47
|
-
oldLines: hunk.oldLines,
|
|
48
|
-
newStart: hunk.newStart,
|
|
49
|
-
newLines: hunk.newLines,
|
|
50
|
-
lines,
|
|
51
|
-
};
|
|
52
|
-
});
|
|
22
|
+
return mapPatchHunks(patch.hunks);
|
|
53
23
|
}
|
|
54
24
|
//# sourceMappingURL=computeDiff.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeDiff.js","sourceRoot":"","sources":["../../src/version-history/computeDiff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"computeDiff.js","sourceRoot":"","sources":["../../src/version-history/computeDiff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,WAAW,CACzB,OAAe,EACf,OAAe,EACf,YAAY,GAAG,CAAC;IAEhB,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE;QAChE,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { StructuredPatchHunk } from "diff";
|
|
2
|
+
import type { DiffHunk } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Maps the `diff` library's structured-patch hunks into our presentation
|
|
5
|
+
* {@link DiffHunk} shape, assigning running old/new line numbers per line.
|
|
6
|
+
*
|
|
7
|
+
* This is the single source of truth for the hunk mapping, shared by
|
|
8
|
+
* {@link computeDiff} (which feeds it `structuredPatch` output computed from
|
|
9
|
+
* before/after text) and `parseUnifiedDiff` (which feeds it `parsePatch` output
|
|
10
|
+
* parsed from a unified-diff string). Both functions in the `diff` library emit
|
|
11
|
+
* the identical {@link StructuredPatchHunk} shape, so one mapper serves both and
|
|
12
|
+
* the two diff sources can never drift in how a `+`/`-`/context line becomes a
|
|
13
|
+
* {@link DiffLine}.
|
|
14
|
+
*
|
|
15
|
+
* `` markers are skipped: they are diff metadata, not
|
|
16
|
+
* content, and would otherwise be mis-rendered as a spurious context line.
|
|
17
|
+
*
|
|
18
|
+
* Pure function — no side effects, safe to call outside React.
|
|
19
|
+
*/
|
|
20
|
+
export declare function mapPatchHunks(hunks: readonly StructuredPatchHunk[]): readonly DiffHunk[];
|
|
21
|
+
//# sourceMappingURL=diff-hunks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-hunks.d.ts","sourceRoot":"","sources":["../../src/version-history/diff-hunks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAElD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,mBAAmB,EAAE,GACpC,SAAS,QAAQ,EAAE,CAwCrB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps the `diff` library's structured-patch hunks into our presentation
|
|
3
|
+
* {@link DiffHunk} shape, assigning running old/new line numbers per line.
|
|
4
|
+
*
|
|
5
|
+
* This is the single source of truth for the hunk mapping, shared by
|
|
6
|
+
* {@link computeDiff} (which feeds it `structuredPatch` output computed from
|
|
7
|
+
* before/after text) and `parseUnifiedDiff` (which feeds it `parsePatch` output
|
|
8
|
+
* parsed from a unified-diff string). Both functions in the `diff` library emit
|
|
9
|
+
* the identical {@link StructuredPatchHunk} shape, so one mapper serves both and
|
|
10
|
+
* the two diff sources can never drift in how a `+`/`-`/context line becomes a
|
|
11
|
+
* {@link DiffLine}.
|
|
12
|
+
*
|
|
13
|
+
* `` markers are skipped: they are diff metadata, not
|
|
14
|
+
* content, and would otherwise be mis-rendered as a spurious context line.
|
|
15
|
+
*
|
|
16
|
+
* Pure function — no side effects, safe to call outside React.
|
|
17
|
+
*/
|
|
18
|
+
export function mapPatchHunks(hunks) {
|
|
19
|
+
return hunks.map((hunk) => {
|
|
20
|
+
const lines = [];
|
|
21
|
+
let oldLine = hunk.oldStart;
|
|
22
|
+
let newLine = hunk.newStart;
|
|
23
|
+
for (const raw of hunk.lines) {
|
|
24
|
+
// "" is a metadata marker, not a real line.
|
|
25
|
+
if (raw.startsWith("\\"))
|
|
26
|
+
continue;
|
|
27
|
+
const prefix = raw[0];
|
|
28
|
+
const content = raw.slice(1);
|
|
29
|
+
if (prefix === "+") {
|
|
30
|
+
lines.push({ type: "added", content, newLineNumber: newLine });
|
|
31
|
+
newLine++;
|
|
32
|
+
}
|
|
33
|
+
else if (prefix === "-") {
|
|
34
|
+
lines.push({ type: "removed", content, oldLineNumber: oldLine });
|
|
35
|
+
oldLine++;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
// A context line (leading space) or an empty raw line.
|
|
39
|
+
lines.push({
|
|
40
|
+
type: "context",
|
|
41
|
+
content,
|
|
42
|
+
oldLineNumber: oldLine,
|
|
43
|
+
newLineNumber: newLine,
|
|
44
|
+
});
|
|
45
|
+
oldLine++;
|
|
46
|
+
newLine++;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
oldStart: hunk.oldStart,
|
|
51
|
+
oldLines: hunk.oldLines,
|
|
52
|
+
newStart: hunk.newStart,
|
|
53
|
+
newLines: hunk.newLines,
|
|
54
|
+
lines,
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=diff-hunks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-hunks.js","sourceRoot":"","sources":["../../src/version-history/diff-hunks.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAqC;IAErC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,KAAK,GAAe,EAAE,CAAC;QAC7B,IAAI,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC5B,IAAI,OAAO,GAAG,IAAI,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type { MultiFileDiffViewProps } from "./MultiFileDiffView";
|
|
11
11
|
export { computeDiff } from "./computeDiff";
|
|
12
|
+
export { parseUnifiedDiff } from "./parseUnifiedDiff";
|
|
12
13
|
export { computeMultiFileDiff } from "./computeMultiFileDiff";
|
|
13
14
|
export type { VersionEntry, VersionTimelineProps, VersionTimelineEntryProps, DiffLine, DiffHunk, FileDiffEntry, MultiFileDiffResult, DiffViewMode, } from "./types";
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/version-history/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,yBAAyB,EACzB,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,YAAY,GACb,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/version-history/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,yBAAyB,EACzB,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,YAAY,GACb,MAAM,SAAS,CAAC"}
|
package/version-history/index.js
CHANGED
|
@@ -5,5 +5,6 @@ export { DiffFileList } from "./DiffFileList";
|
|
|
5
5
|
export { DiffSummary } from "./DiffSummary";
|
|
6
6
|
export { MultiFileDiffView } from "./MultiFileDiffView";
|
|
7
7
|
export { computeDiff } from "./computeDiff";
|
|
8
|
+
export { parseUnifiedDiff } from "./parseUnifiedDiff";
|
|
8
9
|
export { computeMultiFileDiff } from "./computeMultiFileDiff";
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/version-history/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/version-history/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DiffHunk } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Parses a unified-diff patch *string* into presentation {@link DiffHunk}s.
|
|
4
|
+
*
|
|
5
|
+
* This is the bridge that lets a harness which only emits a ready unified diff
|
|
6
|
+
* (the Cursor harness's `diffString` -> `view.unifiedDiff` / `FileChange.
|
|
7
|
+
* unifiedDiff`) render through the same accessible {@link DiffViewer} table as a
|
|
8
|
+
* computed before/after diff — instead of being dumped as a raw `<pre>` with the
|
|
9
|
+
* `--- /dev/null`, `+++ b/...`, `@@` preamble and inline `+`/`-` prefixes.
|
|
10
|
+
*
|
|
11
|
+
* The `---`/`+++` file headers parse into metadata and are discarded; only the
|
|
12
|
+
* hunks survive, mapped through the shared {@link mapPatchHunks}. A diff input is
|
|
13
|
+
* a single file's patch, but `parsePatch` can return multiple file entries, so
|
|
14
|
+
* their hunks are flattened defensively.
|
|
15
|
+
*
|
|
16
|
+
* Returns `[]` for an empty or unparseable patch, so callers can fall back to a
|
|
17
|
+
* truthful raw rendering rather than showing a misleading "No changes".
|
|
18
|
+
*
|
|
19
|
+
* Pure function — no side effects, safe to call outside React.
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseUnifiedDiff(patch: string): readonly DiffHunk[];
|
|
22
|
+
//# sourceMappingURL=parseUnifiedDiff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseUnifiedDiff.d.ts","sourceRoot":"","sources":["../../src/version-history/parseUnifiedDiff.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,QAAQ,EAAE,CAUnE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { parsePatch } from "diff";
|
|
2
|
+
import { mapPatchHunks } from "./diff-hunks";
|
|
3
|
+
/**
|
|
4
|
+
* Parses a unified-diff patch *string* into presentation {@link DiffHunk}s.
|
|
5
|
+
*
|
|
6
|
+
* This is the bridge that lets a harness which only emits a ready unified diff
|
|
7
|
+
* (the Cursor harness's `diffString` -> `view.unifiedDiff` / `FileChange.
|
|
8
|
+
* unifiedDiff`) render through the same accessible {@link DiffViewer} table as a
|
|
9
|
+
* computed before/after diff — instead of being dumped as a raw `<pre>` with the
|
|
10
|
+
* `--- /dev/null`, `+++ b/...`, `@@` preamble and inline `+`/`-` prefixes.
|
|
11
|
+
*
|
|
12
|
+
* The `---`/`+++` file headers parse into metadata and are discarded; only the
|
|
13
|
+
* hunks survive, mapped through the shared {@link mapPatchHunks}. A diff input is
|
|
14
|
+
* a single file's patch, but `parsePatch` can return multiple file entries, so
|
|
15
|
+
* their hunks are flattened defensively.
|
|
16
|
+
*
|
|
17
|
+
* Returns `[]` for an empty or unparseable patch, so callers can fall back to a
|
|
18
|
+
* truthful raw rendering rather than showing a misleading "No changes".
|
|
19
|
+
*
|
|
20
|
+
* Pure function — no side effects, safe to call outside React.
|
|
21
|
+
*/
|
|
22
|
+
export function parseUnifiedDiff(patch) {
|
|
23
|
+
if (!patch)
|
|
24
|
+
return [];
|
|
25
|
+
try {
|
|
26
|
+
return parsePatch(patch).flatMap((file) => mapPatchHunks(file.hunks));
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// parsePatch can throw on a badly malformed patch; degrade to "no hunks" so
|
|
30
|
+
// the caller renders its raw fallback instead of crashing the thread.
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=parseUnifiedDiff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseUnifiedDiff.js","sourceRoot":"","sources":["../../src/version-history/parseUnifiedDiff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IAEtB,IAAI,CAAC;QACH,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACxE,CAAC;IAAC,MAAM,CAAC;QACP,4EAA4E;QAC5E,sEAAsE;QACtE,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -11,8 +11,15 @@ export interface WorkflowExecutionApprovalCardProps {
|
|
|
11
11
|
readonly timeoutSeconds: number;
|
|
12
12
|
/** Callback to submit the approval decision. */
|
|
13
13
|
readonly onSubmitApproval: (toolCallId: string, action: ApprovalAction, comment?: string) => Promise<unknown>;
|
|
14
|
-
/** `true` while
|
|
14
|
+
/** `true` while this gate's submission is in flight. */
|
|
15
15
|
readonly isSubmitting: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* This gate's last failed decision, or `null`. Surfaced in-card beside the
|
|
18
|
+
* actions (via the shared {@link InCardDecisionError}) — supply
|
|
19
|
+
* {@link useWorkflowExecutionActions}'s `approvalErrorsByToolCallId` for this
|
|
20
|
+
* `toolCallId`.
|
|
21
|
+
*/
|
|
22
|
+
readonly error?: Error | null;
|
|
16
23
|
/** Additional CSS class names. */
|
|
17
24
|
readonly className?: string;
|
|
18
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowExecutionApprovalCard.d.ts","sourceRoot":"","sources":["../../src/workflow/WorkflowExecutionApprovalCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkflowExecutionApprovalCard.d.ts","sourceRoot":"","sources":["../../src/workflow/WorkflowExecutionApprovalCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAC;AAKnG,uDAAuD;AACvD,MAAM,WAAW,kCAAkC;IACjD,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,4CAA4C;IAC5C,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,2CAA2C;IAC3C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,gDAAgD;IAChD,QAAQ,CAAC,gBAAgB,EAAE,CACzB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,MAAM,KACb,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,wDAAwD;IACxD,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC9B,kCAAkC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,0EAqGxC,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { memo, useCallback, useState } from "react";
|
|
3
|
+
import { memo, useCallback, useEffect, useState } from "react";
|
|
4
4
|
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { DecisionButton } from "../internal/DecisionButton";
|
|
6
|
+
import { InCardDecisionError } from "../internal/InCardDecisionError";
|
|
5
7
|
/**
|
|
6
8
|
* Inline approval card rendered within the execution timeline when
|
|
7
9
|
* a `human_input` task or agent tool approval gate is active.
|
|
@@ -9,16 +11,28 @@ import { cn } from "@stigmer/theme";
|
|
|
9
11
|
* Provides approve and reject buttons with an optional comment field.
|
|
10
12
|
* Keyboard-navigable and accessible.
|
|
11
13
|
*/
|
|
12
|
-
export const WorkflowExecutionApprovalCard = memo(function WorkflowExecutionApprovalCard({ prompt, toolCallId, approvers, timeoutSeconds, onSubmitApproval, isSubmitting, className, }) {
|
|
14
|
+
export const WorkflowExecutionApprovalCard = memo(function WorkflowExecutionApprovalCard({ prompt, toolCallId, approvers, timeoutSeconds, onSubmitApproval, isSubmitting, error, className, }) {
|
|
13
15
|
const [comment, setComment] = useState("");
|
|
16
|
+
// Which action is in flight, so the spinner lands on the clicked button —
|
|
17
|
+
// matching ApprovalCard / WorkflowTaskApprovalCard. Reset once the RPC settles.
|
|
18
|
+
const [active, setActive] = useState(null);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!isSubmitting)
|
|
21
|
+
setActive(null);
|
|
22
|
+
}, [isSubmitting]);
|
|
14
23
|
// ApprovalAction enum values: 0=UNSPECIFIED, 1=APPROVE, 2=SKIP, 3=REJECT
|
|
15
24
|
const handleApprove = useCallback(() => {
|
|
25
|
+
setActive("approve");
|
|
16
26
|
onSubmitApproval(toolCallId, 1, comment || undefined);
|
|
17
27
|
}, [toolCallId, comment, onSubmitApproval]);
|
|
18
28
|
const handleReject = useCallback(() => {
|
|
29
|
+
setActive("reject");
|
|
19
30
|
onSubmitApproval(toolCallId, 3, comment || undefined);
|
|
20
31
|
}, [toolCallId, comment, onSubmitApproval]);
|
|
21
|
-
return (_jsxs("div", { role: "alert", "aria-label": "Approval required",
|
|
32
|
+
return (_jsxs("div", { role: "alert", "aria-label": "Approval required",
|
|
33
|
+
// Neutral card + 2px warning left accent — the quiet Cursor-grade chrome
|
|
34
|
+
// shared with ApprovalCard. (Replaces the old amber `bg-warning/5` fill.)
|
|
35
|
+
className: cn("my-1 rounded-lg border border-border-prominent border-l-2 border-l-warning p-3", className), children: [_jsx("p", { className: "text-sm font-medium text-foreground", children: prompt }), approvers.length > 0 && (_jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: ["Approvers: ", approvers.join(", ")] })), timeoutSeconds > 0 && (_jsxs("p", { className: "text-xs text-muted-foreground", children: ["Expires in ", formatTimeout(timeoutSeconds)] })), _jsx("div", { className: "mt-2", children: _jsx("input", { type: "text", value: comment, onChange: (e) => setComment(e.target.value), placeholder: "Comment (optional)", disabled: isSubmitting, className: cn("w-full rounded border border-border bg-background px-2 py-1 text-xs text-foreground", "placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring", "disabled:opacity-50") }) }), _jsxs("div", { className: "mt-2 flex gap-2", children: [_jsx(DecisionButton, { label: "Approve", variant: "primary", onClick: handleApprove, isActive: active === "approve", isSubmitting: isSubmitting }), _jsx(DecisionButton, { label: "Reject", variant: "danger", onClick: handleReject, isActive: active === "reject", isSubmitting: isSubmitting })] }), error && (_jsx(InCardDecisionError, { error: error, leadIn: "submit decision", cursorTarget: "wf-approval-error" }))] }));
|
|
22
36
|
});
|
|
23
37
|
function formatTimeout(seconds) {
|
|
24
38
|
if (seconds < 60)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowExecutionApprovalCard.js","sourceRoot":"","sources":["../../src/workflow/WorkflowExecutionApprovalCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkflowExecutionApprovalCard.js","sourceRoot":"","sources":["../../src/workflow/WorkflowExecutionApprovalCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AA+BtE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC,SAAS,6BAA6B,CAAC,EACvF,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,SAAS,GAC0B;IACnC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,EAAE,CA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<string, DerivedTaskState>;
|
|
13
13
|
/** Callback to submit a human_input task approval decision. */
|
|
14
14
|
readonly onSubmitTaskApproval?: (taskName: string, outcome: string, formData?: Record<string, unknown>, comment?: string) => Promise<unknown>;
|
|
15
|
-
/**
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Task names whose human_input approval is currently in flight, keyed by
|
|
17
|
+
* `taskName` so deciding one gate never spins another. Supply
|
|
18
|
+
* {@link useWorkflowExecutionActions}'s `taskApprovalSubmittingTaskNames`.
|
|
19
|
+
*/
|
|
20
|
+
readonly taskApprovalSubmittingTaskNames?: ReadonlySet<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Per-gate human_input approval failures, keyed by `taskName`. Supply
|
|
23
|
+
* {@link useWorkflowExecutionActions}'s `taskApprovalErrorsByTaskName`.
|
|
24
|
+
*/
|
|
25
|
+
readonly taskApprovalErrorsByTaskName?: ReadonlyMap<string, Error>;
|
|
17
26
|
/** Additional CSS class names. */
|
|
18
27
|
readonly className?: string;
|
|
19
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowExecutionTimeline.d.ts","sourceRoot":"","sources":["../../src/workflow/WorkflowExecutionTimeline.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAC;AAG/G,OAAO,KAAK,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAEnH,mDAAmD;AACnD,MAAM,WAAW,8BAA8B;IAC7C,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACnD,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,wBAAwB,CAAC;IAC/C,yDAAyD;IACzD,QAAQ,CAAC,0BAA0B,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,oEAAoE;IACpE,QAAQ,CAAC,UAAU,CAAC,EAAE,WAA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Q,CAAC,4BAA4B,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnE,kCAAkC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,sEAkGpC,CAAC"}
|
|
@@ -15,7 +15,7 @@ import { WorkflowExecutionTimelineEvent } from "./WorkflowExecutionTimelineEvent
|
|
|
15
15
|
* near the bottom). When the user scrolls up, auto-scroll pauses
|
|
16
16
|
* to allow reading history.
|
|
17
17
|
*/
|
|
18
|
-
export const WorkflowExecutionTimeline = memo(function WorkflowExecutionTimeline({ events, streamState, onNavigateToAgentExecution, taskStates, onSubmitTaskApproval,
|
|
18
|
+
export const WorkflowExecutionTimeline = memo(function WorkflowExecutionTimeline({ events, streamState, onNavigateToAgentExecution, taskStates, onSubmitTaskApproval, taskApprovalSubmittingTaskNames, taskApprovalErrorsByTaskName, className, }) {
|
|
19
19
|
const scrollRef = useRef(null);
|
|
20
20
|
const sentinelRef = useRef(null);
|
|
21
21
|
const isNearBottomRef = useRef(true);
|
|
@@ -47,6 +47,6 @@ export const WorkflowExecutionTimeline = memo(function WorkflowExecutionTimeline
|
|
|
47
47
|
const hasTaskFallback = taskStates && taskStates.size > 0;
|
|
48
48
|
return (_jsxs("div", { className: cn("flex flex-1 flex-col items-center justify-center gap-1 text-sm text-muted-foreground", className), children: [_jsx("span", { children: "No events recorded" }), hasTaskFallback && (_jsx("span", { className: "text-xs", children: "Task status available in the panel" }))] }));
|
|
49
49
|
}
|
|
50
|
-
return (_jsxs("div", { ref: scrollRef, className: cn("flex-1 overflow-y-auto", className), role: "list", "aria-label": "Execution timeline", children: [events.map((event) => (_jsx(WorkflowExecutionTimelineEvent, { event: event, onNavigateToAgentExecution: onNavigateToAgentExecution, taskStates: taskStates, onSubmitTaskApproval: onSubmitTaskApproval,
|
|
50
|
+
return (_jsxs("div", { ref: scrollRef, className: cn("flex-1 overflow-y-auto", className), role: "list", "aria-label": "Execution timeline", children: [events.map((event) => (_jsx(WorkflowExecutionTimelineEvent, { event: event, onNavigateToAgentExecution: onNavigateToAgentExecution, taskStates: taskStates, onSubmitTaskApproval: onSubmitTaskApproval, taskApprovalSubmittingTaskNames: taskApprovalSubmittingTaskNames, taskApprovalErrorsByTaskName: taskApprovalErrorsByTaskName }, event.eventId))), isLive && (_jsxs("div", { className: "flex items-center gap-2 px-4 py-2 text-xs text-muted-foreground", children: [_jsxs("span", { className: "relative flex h-1.5 w-1.5", children: [_jsx("span", { className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-success opacity-75" }), _jsx("span", { className: "relative inline-flex h-1.5 w-1.5 rounded-full bg-success" })] }), "Streaming events\u2026"] })), isError && (_jsx("div", { className: "px-4 py-2 text-xs text-destructive", children: "Stream disconnected. Events may be incomplete." })), _jsx("div", { ref: sentinelRef, className: "h-px", "aria-hidden": "true" })] }));
|
|
51
51
|
});
|
|
52
52
|
//# sourceMappingURL=WorkflowExecutionTimeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowExecutionTimeline.js","sourceRoot":"","sources":["../../src/workflow/WorkflowExecutionTimeline.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAe,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkflowExecutionTimeline.js","sourceRoot":"","sources":["../../src/workflow/WorkflowExecutionTimeline.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAe,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAA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eAAM,SAAS,EAAC,oFAAoF,GAAG,EACvG,eAAM,SAAS,EAAC,0DAA0D,GAAG,IACxE,8BAEH,CACP,EAEA,OAAO,IAAI,CACV,cAAK,SAAS,EAAC,oCAAoC,+DAE7C,CACP,EAGD,cAAK,GAAG,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,iBAAa,MAAM,GAAG,IACzD,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -5,7 +5,10 @@ interface TimelineEventProps {
|
|
|
5
5
|
readonly onNavigateToAgentExecution?: (id: string) => void;
|
|
6
6
|
readonly taskStates?: ReadonlyMap<string, DerivedTaskState>;
|
|
7
7
|
readonly onSubmitTaskApproval?: (taskName: string, outcome: string, formData?: Record<string, unknown>, comment?: string) => Promise<unknown>;
|
|
8
|
-
|
|
8
|
+
/** Task names whose human_input approval is in flight, keyed by `taskName`. */
|
|
9
|
+
readonly taskApprovalSubmittingTaskNames?: ReadonlySet<string>;
|
|
10
|
+
/** Per-gate human_input approval failures, keyed by `taskName`. */
|
|
11
|
+
readonly taskApprovalErrorsByTaskName?: ReadonlyMap<string, Error>;
|
|
9
12
|
}
|
|
10
13
|
/**
|
|
11
14
|
* Renders a single event in the workflow execution timeline.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowExecutionTimelineEvent.d.ts","sourceRoot":"","sources":["../../src/workflow/WorkflowExecutionTimelineEvent.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAC;AAI/G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAIzF,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACvC,QAAQ,CAAC,0BAA0B,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC5D,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,OAAO,CAAC,EAAE,MAAM,KACb,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"WorkflowExecutionTimelineEvent.d.ts","sourceRoot":"","sources":["../../src/workflow/WorkflowExecutionTimelineEvent.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAC;AAI/G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAIzF,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACvC,QAAQ,CAAC,0BAA0B,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC5D,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,OAAO,CAAC,EAAE,MAAM,KACb,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,+BAA+B,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/D,mEAAmE;IACnE,QAAQ,CAAC,4BAA4B,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CACpE;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,8BAA8B,0DA8TzC,CAAC"}
|
|
@@ -15,7 +15,7 @@ import { formatDuration, formatMicroUsd, formatBytes, formatTimestamp, formatMet
|
|
|
15
15
|
* @internal Not exported from the public SDK barrel — used only by
|
|
16
16
|
* `WorkflowExecutionTimeline`.
|
|
17
17
|
*/
|
|
18
|
-
export const WorkflowExecutionTimelineEvent = memo(function WorkflowExecutionTimelineEvent({ event, onNavigateToAgentExecution, taskStates, onSubmitTaskApproval,
|
|
18
|
+
export const WorkflowExecutionTimelineEvent = memo(function WorkflowExecutionTimelineEvent({ event, onNavigateToAgentExecution, taskStates, onSubmitTaskApproval, taskApprovalSubmittingTaskNames, taskApprovalErrorsByTaskName, }) {
|
|
19
19
|
const timestamp = formatTimestamp(event.occurredAt);
|
|
20
20
|
const p = event.payload;
|
|
21
21
|
switch (p.case) {
|
|
@@ -62,7 +62,7 @@ export const WorkflowExecutionTimelineEvent = memo(function WorkflowExecutionTim
|
|
|
62
62
|
label: o.label,
|
|
63
63
|
})), formSchema: p.value.formSchema
|
|
64
64
|
? p.value.formSchema
|
|
65
|
-
: undefined, onSubmit: onSubmitTaskApproval, isSubmitting:
|
|
65
|
+
: undefined, onSubmit: onSubmitTaskApproval, isSubmitting: taskApprovalSubmittingTaskNames?.has(event.taskName) ?? false, error: taskApprovalErrorsByTaskName?.get(event.taskName) ?? null }))] }));
|
|
66
66
|
}
|
|
67
67
|
case "approvalResolved":
|
|
68
68
|
return (_jsxs(EventRow, { icon: _jsx(ShieldIcon, {}), iconColor: "text-success", timestamp: timestamp, children: [_jsx("span", { className: "font-medium text-foreground", children: "Approval resolved" }), _jsxs("span", { className: "text-xs text-muted-foreground", children: ["by ", p.value.resolvedBy] }), p.value.comment && (_jsxs("p", { className: "mt-1 text-xs text-muted-foreground italic", children: ["\"", p.value.comment, "\""] }))] }));
|