@stigmer/react 2.0.0 → 3.0.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/README.md +64 -2
- package/agent/AgentDetailView.d.ts +26 -1
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +9 -2
- package/agent/AgentDetailView.js.map +1 -1
- package/agent/useAgentSetup.d.ts +19 -0
- package/agent/useAgentSetup.d.ts.map +1 -1
- package/agent/useAgentSetup.js +15 -1
- package/agent/useAgentSetup.js.map +1 -1
- package/agent-instance/AgentInstanceDetailPanel.d.ts +26 -0
- package/agent-instance/AgentInstanceDetailPanel.d.ts.map +1 -0
- package/agent-instance/AgentInstanceDetailPanel.js +94 -0
- package/agent-instance/AgentInstanceDetailPanel.js.map +1 -0
- package/agent-instance/AgentInstanceEmptyState.d.ts +17 -0
- package/agent-instance/AgentInstanceEmptyState.d.ts.map +1 -0
- package/agent-instance/AgentInstanceEmptyState.js +21 -0
- package/agent-instance/AgentInstanceEmptyState.js.map +1 -0
- package/agent-instance/AgentInstanceList.d.ts +38 -0
- package/agent-instance/AgentInstanceList.d.ts.map +1 -0
- package/agent-instance/AgentInstanceList.js +75 -0
- package/agent-instance/AgentInstanceList.js.map +1 -0
- package/agent-instance/CreateAgentInstanceDialog.d.ts +24 -0
- package/agent-instance/CreateAgentInstanceDialog.d.ts.map +1 -0
- package/agent-instance/CreateAgentInstanceDialog.js +78 -0
- package/agent-instance/CreateAgentInstanceDialog.js.map +1 -0
- package/agent-instance/index.d.ts +14 -0
- package/agent-instance/index.d.ts.map +1 -1
- package/agent-instance/index.js +7 -0
- package/agent-instance/index.js.map +1 -1
- package/agent-instance/useAgentInstances.d.ts +34 -0
- package/agent-instance/useAgentInstances.d.ts.map +1 -0
- package/agent-instance/useAgentInstances.js +37 -0
- package/agent-instance/useAgentInstances.js.map +1 -0
- package/agent-instance/useDeleteAgentInstance.d.ts +42 -0
- package/agent-instance/useDeleteAgentInstance.d.ts.map +1 -0
- package/agent-instance/useDeleteAgentInstance.js +48 -0
- package/agent-instance/useDeleteAgentInstance.js.map +1 -0
- package/agent-instance/useUpdateAgentInstance.d.ts +36 -0
- package/agent-instance/useUpdateAgentInstance.d.ts.map +1 -0
- package/agent-instance/useUpdateAgentInstance.js +47 -0
- package/agent-instance/useUpdateAgentInstance.js.map +1 -0
- package/composer/SessionComposer.d.ts +18 -0
- package/composer/SessionComposer.d.ts.map +1 -1
- package/composer/SessionComposer.js +27 -3
- package/composer/SessionComposer.js.map +1 -1
- package/execution/ApprovalCard.d.ts.map +1 -1
- package/execution/ApprovalCard.js +6 -3
- package/execution/ApprovalCard.js.map +1 -1
- package/execution/MessageThread.d.ts +3 -0
- package/execution/MessageThread.d.ts.map +1 -1
- package/execution/MessageThread.js +12 -2
- package/execution/MessageThread.js.map +1 -1
- package/execution/PlanArtifactCard.d.ts +29 -0
- package/execution/PlanArtifactCard.d.ts.map +1 -0
- package/execution/PlanArtifactCard.js +59 -0
- package/execution/PlanArtifactCard.js.map +1 -0
- package/execution/ResultView.d.ts +24 -0
- package/execution/ResultView.d.ts.map +1 -0
- package/execution/ResultView.js +152 -0
- package/execution/ResultView.js.map +1 -0
- package/execution/SubAgentSection.js +1 -1
- package/execution/SubAgentSection.js.map +1 -1
- package/execution/ToolCallDetail.d.ts +13 -19
- package/execution/ToolCallDetail.d.ts.map +1 -1
- package/execution/ToolCallDetail.js +42 -70
- package/execution/ToolCallDetail.js.map +1 -1
- package/execution/ToolCallGroup.js +2 -2
- package/execution/ToolCallGroup.js.map +1 -1
- package/execution/ToolCallItem.d.ts.map +1 -1
- package/execution/ToolCallItem.js +13 -9
- package/execution/ToolCallItem.js.map +1 -1
- package/execution/index.d.ts +7 -1
- package/execution/index.d.ts.map +1 -1
- package/execution/index.js +4 -1
- package/execution/index.js.map +1 -1
- package/execution/tool-categories.d.ts +30 -21
- package/execution/tool-categories.d.ts.map +1 -1
- package/execution/tool-categories.js +57 -49
- package/execution/tool-categories.js.map +1 -1
- package/execution/tool-presenter.d.ts +60 -0
- package/execution/tool-presenter.d.ts.map +1 -0
- package/execution/tool-presenter.js +81 -0
- package/execution/tool-presenter.js.map +1 -0
- package/execution/useCreateAgentExecution.d.ts +9 -0
- package/execution/useCreateAgentExecution.d.ts.map +1 -1
- package/execution/useCreateAgentExecution.js +1 -0
- package/execution/useCreateAgentExecution.js.map +1 -1
- package/index.d.ts +6 -5
- package/index.d.ts.map +1 -1
- package/index.js +7 -4
- package/index.js.map +1 -1
- package/library/detect-plan-artifact.d.ts +26 -0
- package/library/detect-plan-artifact.d.ts.map +1 -0
- package/library/detect-plan-artifact.js +37 -0
- package/library/detect-plan-artifact.js.map +1 -0
- package/library/index.d.ts +1 -0
- package/library/index.d.ts.map +1 -1
- package/library/index.js +1 -0
- package/library/index.js.map +1 -1
- package/package.json +4 -4
- package/provider.d.ts +5 -3
- package/provider.d.ts.map +1 -1
- package/provider.js.map +1 -1
- package/runner-adapter.d.ts +19 -4
- package/runner-adapter.d.ts.map +1 -1
- package/runner-adapter.js.map +1 -1
- package/session/NewSessionViewer.d.ts +10 -1
- package/session/NewSessionViewer.d.ts.map +1 -1
- package/session/NewSessionViewer.js +2 -2
- package/session/NewSessionViewer.js.map +1 -1
- package/session/SessionViewer.d.ts.map +1 -1
- package/session/SessionViewer.js +17 -2
- package/session/SessionViewer.js.map +1 -1
- package/session/useCreateSession.d.ts.map +1 -1
- package/session/useCreateSession.js +4 -6
- package/session/useCreateSession.js.map +1 -1
- package/session/useLocalSessionWorker.d.ts +33 -0
- package/session/useLocalSessionWorker.d.ts.map +1 -0
- package/session/useLocalSessionWorker.js +65 -0
- package/session/useLocalSessionWorker.js.map +1 -0
- package/session/useNewSessionFlow.d.ts.map +1 -1
- package/session/useNewSessionFlow.js +22 -1
- package/session/useNewSessionFlow.js.map +1 -1
- package/session/useSessionConversation.d.ts +12 -0
- package/session/useSessionConversation.d.ts.map +1 -1
- package/session/useSessionConversation.js +11 -0
- package/session/useSessionConversation.js.map +1 -1
- package/session/useSessionPageFlow.d.ts +23 -0
- package/session/useSessionPageFlow.d.ts.map +1 -1
- package/session/useSessionPageFlow.js +21 -1
- package/session/useSessionPageFlow.js.map +1 -1
- package/src/__tests__/runner-adapter.test.tsx +14 -107
- package/src/agent/AgentDetailView.tsx +49 -1
- package/src/agent/__tests__/useAgentSetup.resolveToInstance.test.tsx +73 -0
- package/src/agent/useAgentSetup.ts +48 -1
- package/src/agent-instance/AgentInstanceDetailPanel.tsx +359 -0
- package/src/agent-instance/AgentInstanceEmptyState.tsx +87 -0
- package/src/agent-instance/AgentInstanceList.tsx +329 -0
- package/src/agent-instance/CreateAgentInstanceDialog.tsx +258 -0
- package/src/agent-instance/__tests__/agent-instance-hooks.test.tsx +213 -0
- package/src/agent-instance/index.ts +15 -0
- package/src/agent-instance/useAgentInstances.ts +66 -0
- package/src/agent-instance/useDeleteAgentInstance.ts +73 -0
- package/src/agent-instance/useUpdateAgentInstance.ts +67 -0
- package/src/composer/SessionComposer.tsx +54 -2
- package/src/execution/ApprovalCard.tsx +22 -3
- package/src/execution/MessageThread.tsx +27 -3
- package/src/execution/PlanArtifactCard.tsx +257 -0
- package/src/execution/ResultView.tsx +366 -0
- package/src/execution/SubAgentSection.tsx +5 -0
- package/src/execution/ToolCallDetail.tsx +72 -173
- package/src/execution/ToolCallGroup.tsx +2 -2
- package/src/execution/ToolCallItem.tsx +25 -12
- package/src/execution/__tests__/ApprovalCard.test.tsx +99 -0
- package/src/execution/__tests__/ResultView.test.tsx +95 -0
- package/src/execution/__tests__/subagent-thread-item.test.ts +153 -0
- package/src/execution/__tests__/tool-presenter.test.tsx +78 -0
- package/src/execution/index.ts +16 -0
- package/src/execution/tool-categories.ts +80 -66
- package/src/execution/tool-presenter.ts +118 -0
- package/src/execution/useCreateAgentExecution.ts +10 -0
- package/src/index.ts +32 -1
- package/src/library/__tests__/detect-plan-artifact.test.ts +75 -0
- package/src/library/detect-plan-artifact.ts +43 -0
- package/src/library/index.ts +6 -0
- package/src/provider.tsx +5 -3
- package/src/runner-adapter.ts +19 -4
- package/src/session/NewSessionViewer.tsx +11 -0
- package/src/session/SessionViewer.tsx +46 -2
- package/src/session/__tests__/group-sessions.test.ts +3 -5
- package/src/session/__tests__/useLocalSessionWorker.test.tsx +194 -0
- package/src/session/__tests__/useNewSessionFlow.test.tsx +80 -4
- package/src/session/__tests__/useSessionConversation.test.tsx +89 -0
- package/src/session/__tests__/useSessionPageFlow.autoApprove.test.tsx +149 -0
- package/src/session/useCreateSession.ts +4 -7
- package/src/session/useLocalSessionWorker.ts +73 -0
- package/src/session/useNewSessionFlow.ts +23 -1
- package/src/session/useSessionConversation.ts +18 -0
- package/src/session/useSessionPageFlow.ts +51 -1
- package/src/workflow/__tests__/useWorkflowExecution.test.tsx +2 -2
- package/styles.css +1 -1
- package/__tests__/hooks.test.d.ts +0 -2
- package/__tests__/hooks.test.d.ts.map +0 -1
- package/__tests__/hooks.test.js +0 -35
- package/__tests__/hooks.test.js.map +0 -1
- package/__tests__/runner-adapter.test.d.ts +0 -2
- package/__tests__/runner-adapter.test.d.ts.map +0 -1
- package/__tests__/runner-adapter.test.js +0 -153
- package/__tests__/runner-adapter.test.js.map +0 -1
- package/activity/__tests__/useRecentActivity-optimistic.test.d.ts +0 -2
- package/activity/__tests__/useRecentActivity-optimistic.test.d.ts.map +0 -1
- package/activity/__tests__/useRecentActivity-optimistic.test.js +0 -139
- package/activity/__tests__/useRecentActivity-optimistic.test.js.map +0 -1
- package/activity/__tests__/useRecentActivity.test.d.ts +0 -2
- package/activity/__tests__/useRecentActivity.test.d.ts.map +0 -1
- package/activity/__tests__/useRecentActivity.test.js +0 -107
- package/activity/__tests__/useRecentActivity.test.js.map +0 -1
- package/agent/__tests__/useAgent.test.d.ts +0 -2
- package/agent/__tests__/useAgent.test.d.ts.map +0 -1
- package/agent/__tests__/useAgent.test.js +0 -86
- package/agent/__tests__/useAgent.test.js.map +0 -1
- package/agent/__tests__/useDefaultAgent.test.d.ts +0 -2
- package/agent/__tests__/useDefaultAgent.test.d.ts.map +0 -1
- package/agent/__tests__/useDefaultAgent.test.js +0 -135
- package/agent/__tests__/useDefaultAgent.test.js.map +0 -1
- package/billing/__tests__/CreditLedgerTable.test.d.ts +0 -2
- package/billing/__tests__/CreditLedgerTable.test.d.ts.map +0 -1
- package/billing/__tests__/CreditLedgerTable.test.js +0 -74
- package/billing/__tests__/CreditLedgerTable.test.js.map +0 -1
- package/composer/__tests__/ComposerToolbar-directAction.test.d.ts +0 -2
- package/composer/__tests__/ComposerToolbar-directAction.test.d.ts.map +0 -1
- package/composer/__tests__/ComposerToolbar-directAction.test.js +0 -64
- package/composer/__tests__/ComposerToolbar-directAction.test.js.map +0 -1
- package/composer/__tests__/SessionComposer-contract.test.d.ts +0 -2
- package/composer/__tests__/SessionComposer-contract.test.d.ts.map +0 -1
- package/composer/__tests__/SessionComposer-contract.test.js +0 -87
- package/composer/__tests__/SessionComposer-contract.test.js.map +0 -1
- package/composer/__tests__/SessionComposer-fileref.test.d.ts +0 -2
- package/composer/__tests__/SessionComposer-fileref.test.d.ts.map +0 -1
- package/composer/__tests__/SessionComposer-fileref.test.js +0 -132
- package/composer/__tests__/SessionComposer-fileref.test.js.map +0 -1
- package/composer/__tests__/SessionComposer-memo.test.d.ts +0 -2
- package/composer/__tests__/SessionComposer-memo.test.d.ts.map +0 -1
- package/composer/__tests__/SessionComposer-memo.test.js +0 -28
- package/composer/__tests__/SessionComposer-memo.test.js.map +0 -1
- package/composer/__tests__/useComposer.test.d.ts +0 -2
- package/composer/__tests__/useComposer.test.d.ts.map +0 -1
- package/composer/__tests__/useComposer.test.js +0 -139
- package/composer/__tests__/useComposer.test.js.map +0 -1
- package/environment/__tests__/systemEnvVars.test.d.ts +0 -2
- package/environment/__tests__/systemEnvVars.test.d.ts.map +0 -1
- package/environment/__tests__/systemEnvVars.test.js +0 -76
- package/environment/__tests__/systemEnvVars.test.js.map +0 -1
- package/execution/__tests__/MessageThread.test.d.ts +0 -2
- package/execution/__tests__/MessageThread.test.d.ts.map +0 -1
- package/execution/__tests__/MessageThread.test.js +0 -164
- package/execution/__tests__/MessageThread.test.js.map +0 -1
- package/execution/__tests__/PlanCompletionCard.test.d.ts +0 -2
- package/execution/__tests__/PlanCompletionCard.test.d.ts.map +0 -1
- package/execution/__tests__/PlanCompletionCard.test.js +0 -53
- package/execution/__tests__/PlanCompletionCard.test.js.map +0 -1
- package/execution/__tests__/buildThreadItems-plan-completion.test.d.ts +0 -2
- package/execution/__tests__/buildThreadItems-plan-completion.test.d.ts.map +0 -1
- package/execution/__tests__/buildThreadItems-plan-completion.test.js +0 -137
- package/execution/__tests__/buildThreadItems-plan-completion.test.js.map +0 -1
- package/execution/__tests__/execution-phases.test.d.ts +0 -2
- package/execution/__tests__/execution-phases.test.d.ts.map +0 -1
- package/execution/__tests__/execution-phases.test.js +0 -25
- package/execution/__tests__/execution-phases.test.js.map +0 -1
- package/execution/__tests__/file-path-resolver.test.d.ts +0 -2
- package/execution/__tests__/file-path-resolver.test.d.ts.map +0 -1
- package/execution/__tests__/file-path-resolver.test.js +0 -180
- package/execution/__tests__/file-path-resolver.test.js.map +0 -1
- package/execution/__tests__/message-entry.test.d.ts +0 -2
- package/execution/__tests__/message-entry.test.d.ts.map +0 -1
- package/execution/__tests__/message-entry.test.js +0 -178
- package/execution/__tests__/message-entry.test.js.map +0 -1
- package/execution/__tests__/thread-keys.test.d.ts +0 -2
- package/execution/__tests__/thread-keys.test.d.ts.map +0 -1
- package/execution/__tests__/thread-keys.test.js +0 -462
- package/execution/__tests__/thread-keys.test.js.map +0 -1
- package/execution/__tests__/thread-memoization.test.d.ts +0 -2
- package/execution/__tests__/thread-memoization.test.d.ts.map +0 -1
- package/execution/__tests__/thread-memoization.test.js +0 -262
- package/execution/__tests__/thread-memoization.test.js.map +0 -1
- package/execution/__tests__/thread-skeleton.test.d.ts +0 -2
- package/execution/__tests__/thread-skeleton.test.d.ts.map +0 -1
- package/execution/__tests__/thread-skeleton.test.js +0 -35
- package/execution/__tests__/thread-skeleton.test.js.map +0 -1
- package/execution/__tests__/useContextWindow.test.d.ts +0 -2
- package/execution/__tests__/useContextWindow.test.d.ts.map +0 -1
- package/execution/__tests__/useContextWindow.test.js +0 -121
- package/execution/__tests__/useContextWindow.test.js.map +0 -1
- package/execution/__tests__/useExecutionStream.test.d.ts +0 -2
- package/execution/__tests__/useExecutionStream.test.d.ts.map +0 -1
- package/execution/__tests__/useExecutionStream.test.js +0 -253
- package/execution/__tests__/useExecutionStream.test.js.map +0 -1
- package/execution/__tests__/useSessionVariables-stability.test.d.ts +0 -2
- package/execution/__tests__/useSessionVariables-stability.test.d.ts.map +0 -1
- package/execution/__tests__/useSessionVariables-stability.test.js +0 -69
- package/execution/__tests__/useSessionVariables-stability.test.js.map +0 -1
- package/execution/__tests__/virtualized-thread.test.d.ts +0 -2
- package/execution/__tests__/virtualized-thread.test.d.ts.map +0 -1
- package/execution/__tests__/virtualized-thread.test.js +0 -274
- package/execution/__tests__/virtualized-thread.test.js.map +0 -1
- package/file-reference/__tests__/FileReferenceChipList.test.d.ts +0 -2
- package/file-reference/__tests__/FileReferenceChipList.test.d.ts.map +0 -1
- package/file-reference/__tests__/FileReferenceChipList.test.js +0 -48
- package/file-reference/__tests__/FileReferenceChipList.test.js.map +0 -1
- package/file-reference/__tests__/useFileReferences.test.d.ts +0 -2
- package/file-reference/__tests__/useFileReferences.test.d.ts.map +0 -1
- package/file-reference/__tests__/useFileReferences.test.js +0 -90
- package/file-reference/__tests__/useFileReferences.test.js.map +0 -1
- package/github/__tests__/parseGitUrl.test.d.ts +0 -2
- package/github/__tests__/parseGitUrl.test.d.ts.map +0 -1
- package/github/__tests__/parseGitUrl.test.js +0 -47
- package/github/__tests__/parseGitUrl.test.js.map +0 -1
- package/github/__tests__/useGitHubTreeLister.test.d.ts +0 -2
- package/github/__tests__/useGitHubTreeLister.test.d.ts.map +0 -1
- package/github/__tests__/useGitHubTreeLister.test.js +0 -112
- package/github/__tests__/useGitHubTreeLister.test.js.map +0 -1
- package/internal/__tests__/ResizableSplit.test.d.ts +0 -2
- package/internal/__tests__/ResizableSplit.test.d.ts.map +0 -1
- package/internal/__tests__/ResizableSplit.test.js +0 -118
- package/internal/__tests__/ResizableSplit.test.js.map +0 -1
- package/internal/__tests__/fetch-cache.test.d.ts +0 -2
- package/internal/__tests__/fetch-cache.test.d.ts.map +0 -1
- package/internal/__tests__/fetch-cache.test.js +0 -182
- package/internal/__tests__/fetch-cache.test.js.map +0 -1
- package/internal/__tests__/stream-controller.test.d.ts +0 -2
- package/internal/__tests__/stream-controller.test.d.ts.map +0 -1
- package/internal/__tests__/stream-controller.test.js +0 -327
- package/internal/__tests__/stream-controller.test.js.map +0 -1
- package/internal/__tests__/thread-animation.test.d.ts +0 -2
- package/internal/__tests__/thread-animation.test.d.ts.map +0 -1
- package/internal/__tests__/thread-animation.test.js +0 -79
- package/internal/__tests__/thread-animation.test.js.map +0 -1
- package/internal/__tests__/useAutoScroll.test.d.ts +0 -2
- package/internal/__tests__/useAutoScroll.test.d.ts.map +0 -1
- package/internal/__tests__/useAutoScroll.test.js +0 -188
- package/internal/__tests__/useAutoScroll.test.js.map +0 -1
- package/internal/__tests__/useFetch-cache.test.d.ts +0 -2
- package/internal/__tests__/useFetch-cache.test.d.ts.map +0 -1
- package/internal/__tests__/useFetch-cache.test.js +0 -137
- package/internal/__tests__/useFetch-cache.test.js.map +0 -1
- package/internal/__tests__/useFetch-identity-reset.test.d.ts +0 -2
- package/internal/__tests__/useFetch-identity-reset.test.d.ts.map +0 -1
- package/internal/__tests__/useFetch-identity-reset.test.js +0 -281
- package/internal/__tests__/useFetch-identity-reset.test.js.map +0 -1
- package/internal/__tests__/useFetch.test.d.ts +0 -2
- package/internal/__tests__/useFetch.test.d.ts.map +0 -1
- package/internal/__tests__/useFetch.test.js +0 -95
- package/internal/__tests__/useFetch.test.js.map +0 -1
- package/internal/dev/__tests__/use-key-stability.test.d.ts +0 -2
- package/internal/dev/__tests__/use-key-stability.test.d.ts.map +0 -1
- package/internal/dev/__tests__/use-key-stability.test.js +0 -72
- package/internal/dev/__tests__/use-key-stability.test.js.map +0 -1
- package/internal/dev/__tests__/use-render-tracer.test.d.ts +0 -2
- package/internal/dev/__tests__/use-render-tracer.test.d.ts.map +0 -1
- package/internal/dev/__tests__/use-render-tracer.test.js +0 -55
- package/internal/dev/__tests__/use-render-tracer.test.js.map +0 -1
- package/internal/file-tree/__tests__/FileTreeNode-drag.test.d.ts +0 -2
- package/internal/file-tree/__tests__/FileTreeNode-drag.test.d.ts.map +0 -1
- package/internal/file-tree/__tests__/FileTreeNode-drag.test.js +0 -55
- package/internal/file-tree/__tests__/FileTreeNode-drag.test.js.map +0 -1
- package/internal/file-tree/__tests__/buildFileTree.test.d.ts +0 -2
- package/internal/file-tree/__tests__/buildFileTree.test.d.ts.map +0 -1
- package/internal/file-tree/__tests__/buildFileTree.test.js +0 -102
- package/internal/file-tree/__tests__/buildFileTree.test.js.map +0 -1
- package/internal/file-tree/__tests__/filterFileTree.test.d.ts +0 -2
- package/internal/file-tree/__tests__/filterFileTree.test.d.ts.map +0 -1
- package/internal/file-tree/__tests__/filterFileTree.test.js +0 -120
- package/internal/file-tree/__tests__/filterFileTree.test.js.map +0 -1
- package/internal/store/__tests__/conversation-store.test.d.ts +0 -2
- package/internal/store/__tests__/conversation-store.test.d.ts.map +0 -1
- package/internal/store/__tests__/conversation-store.test.js +0 -200
- package/internal/store/__tests__/conversation-store.test.js.map +0 -1
- package/internal/store/__tests__/selection-store.test.d.ts +0 -2
- package/internal/store/__tests__/selection-store.test.d.ts.map +0 -1
- package/internal/store/__tests__/selection-store.test.js +0 -93
- package/internal/store/__tests__/selection-store.test.js.map +0 -1
- package/internal/store/__tests__/structural-share.test.d.ts +0 -2
- package/internal/store/__tests__/structural-share.test.d.ts.map +0 -1
- package/internal/store/__tests__/structural-share.test.js +0 -368
- package/internal/store/__tests__/structural-share.test.js.map +0 -1
- package/internal/store/__tests__/workflow-execution-event-store.test.d.ts +0 -2
- package/internal/store/__tests__/workflow-execution-event-store.test.d.ts.map +0 -1
- package/internal/store/__tests__/workflow-execution-event-store.test.js +0 -215
- package/internal/store/__tests__/workflow-execution-event-store.test.js.map +0 -1
- package/invitation/__tests__/useCreateInvitation.test.d.ts +0 -2
- package/invitation/__tests__/useCreateInvitation.test.d.ts.map +0 -1
- package/invitation/__tests__/useCreateInvitation.test.js +0 -152
- package/invitation/__tests__/useCreateInvitation.test.js.map +0 -1
- package/models/__tests__/HarnessSelector.test.d.ts +0 -2
- package/models/__tests__/HarnessSelector.test.d.ts.map +0 -1
- package/models/__tests__/HarnessSelector.test.js +0 -160
- package/models/__tests__/HarnessSelector.test.js.map +0 -1
- package/models/__tests__/harness.test.d.ts +0 -2
- package/models/__tests__/harness.test.d.ts.map +0 -1
- package/models/__tests__/harness.test.js +0 -50
- package/models/__tests__/harness.test.js.map +0 -1
- package/models/__tests__/useModelRegistry.test.d.ts +0 -2
- package/models/__tests__/useModelRegistry.test.d.ts.map +0 -1
- package/models/__tests__/useModelRegistry.test.js +0 -246
- package/models/__tests__/useModelRegistry.test.js.map +0 -1
- package/session/__tests__/execution-target.test.d.ts +0 -2
- package/session/__tests__/execution-target.test.d.ts.map +0 -1
- package/session/__tests__/execution-target.test.js +0 -34
- package/session/__tests__/execution-target.test.js.map +0 -1
- package/session/__tests__/group-sessions.test.d.ts +0 -2
- package/session/__tests__/group-sessions.test.d.ts.map +0 -1
- package/session/__tests__/group-sessions.test.js +0 -91
- package/session/__tests__/group-sessions.test.js.map +0 -1
- package/session/__tests__/session-spec-converters.test.d.ts +0 -2
- package/session/__tests__/session-spec-converters.test.d.ts.map +0 -1
- package/session/__tests__/session-spec-converters.test.js +0 -160
- package/session/__tests__/session-spec-converters.test.js.map +0 -1
- package/session/__tests__/useCreateSession.test.d.ts +0 -2
- package/session/__tests__/useCreateSession.test.d.ts.map +0 -1
- package/session/__tests__/useCreateSession.test.js +0 -228
- package/session/__tests__/useCreateSession.test.js.map +0 -1
- package/session/__tests__/useNewSessionFlow.test.d.ts +0 -2
- package/session/__tests__/useNewSessionFlow.test.d.ts.map +0 -1
- package/session/__tests__/useNewSessionFlow.test.js +0 -364
- package/session/__tests__/useNewSessionFlow.test.js.map +0 -1
- package/session/__tests__/usePersistedModel.test.d.ts +0 -2
- package/session/__tests__/usePersistedModel.test.d.ts.map +0 -1
- package/session/__tests__/usePersistedModel.test.js +0 -96
- package/session/__tests__/usePersistedModel.test.js.map +0 -1
- package/session/__tests__/useSession.test.d.ts +0 -2
- package/session/__tests__/useSession.test.d.ts.map +0 -1
- package/session/__tests__/useSession.test.js +0 -93
- package/session/__tests__/useSession.test.js.map +0 -1
- package/session/__tests__/useSessionConversation.test.d.ts +0 -2
- package/session/__tests__/useSessionConversation.test.d.ts.map +0 -1
- package/session/__tests__/useSessionConversation.test.js +0 -246
- package/session/__tests__/useSessionConversation.test.js.map +0 -1
- package/session/__tests__/useSessionList.test.d.ts +0 -2
- package/session/__tests__/useSessionList.test.d.ts.map +0 -1
- package/session/__tests__/useSessionList.test.js +0 -63
- package/session/__tests__/useSessionList.test.js.map +0 -1
- package/session/__tests__/useSessionUsage.test.d.ts +0 -2
- package/session/__tests__/useSessionUsage.test.d.ts.map +0 -1
- package/session/__tests__/useSessionUsage.test.js +0 -146
- package/session/__tests__/useSessionUsage.test.js.map +0 -1
- package/session/inspector/__tests__/useSessionInspector.test.d.ts +0 -2
- package/session/inspector/__tests__/useSessionInspector.test.d.ts.map +0 -1
- package/session/inspector/__tests__/useSessionInspector.test.js +0 -195
- package/session/inspector/__tests__/useSessionInspector.test.js.map +0 -1
- package/test/__tests__/samples.test.d.ts +0 -2
- package/test/__tests__/samples.test.d.ts.map +0 -1
- package/test/__tests__/samples.test.js +0 -152
- package/test/__tests__/samples.test.js.map +0 -1
- package/workflow/__tests__/ExecutionInspector.test.d.ts +0 -2
- package/workflow/__tests__/ExecutionInspector.test.d.ts.map +0 -1
- package/workflow/__tests__/ExecutionInspector.test.js +0 -91
- package/workflow/__tests__/ExecutionInspector.test.js.map +0 -1
- package/workflow/__tests__/WorkflowArchitectDialog.test.d.ts +0 -2
- package/workflow/__tests__/WorkflowArchitectDialog.test.d.ts.map +0 -1
- package/workflow/__tests__/WorkflowArchitectDialog.test.js +0 -126
- package/workflow/__tests__/WorkflowArchitectDialog.test.js.map +0 -1
- package/workflow/__tests__/WorkflowRefinePanel.test.d.ts +0 -2
- package/workflow/__tests__/WorkflowRefinePanel.test.d.ts.map +0 -1
- package/workflow/__tests__/WorkflowRefinePanel.test.js +0 -138
- package/workflow/__tests__/WorkflowRefinePanel.test.js.map +0 -1
- package/workflow/__tests__/WorkflowRepairCard.test.d.ts +0 -2
- package/workflow/__tests__/WorkflowRepairCard.test.d.ts.map +0 -1
- package/workflow/__tests__/WorkflowRepairCard.test.js +0 -158
- package/workflow/__tests__/WorkflowRepairCard.test.js.map +0 -1
- package/workflow/__tests__/WorkflowTaskApprovalCard.test.d.ts +0 -2
- package/workflow/__tests__/WorkflowTaskApprovalCard.test.d.ts.map +0 -1
- package/workflow/__tests__/WorkflowTaskApprovalCard.test.js +0 -221
- package/workflow/__tests__/WorkflowTaskApprovalCard.test.js.map +0 -1
- package/workflow/__tests__/WorkflowTaskApprovalSummary.test.d.ts +0 -2
- package/workflow/__tests__/WorkflowTaskApprovalSummary.test.d.ts.map +0 -1
- package/workflow/__tests__/WorkflowTaskApprovalSummary.test.js +0 -94
- package/workflow/__tests__/WorkflowTaskApprovalSummary.test.js.map +0 -1
- package/workflow/__tests__/agent-call-live-experience.test.d.ts +0 -11
- package/workflow/__tests__/agent-call-live-experience.test.d.ts.map +0 -1
- package/workflow/__tests__/agent-call-live-experience.test.js +0 -379
- package/workflow/__tests__/agent-call-live-experience.test.js.map +0 -1
- package/workflow/__tests__/branch-commands.test.d.ts +0 -2
- package/workflow/__tests__/branch-commands.test.d.ts.map +0 -1
- package/workflow/__tests__/branch-commands.test.js +0 -165
- package/workflow/__tests__/branch-commands.test.js.map +0 -1
- package/workflow/__tests__/caption-dimensions.test.d.ts +0 -2
- package/workflow/__tests__/caption-dimensions.test.d.ts.map +0 -1
- package/workflow/__tests__/caption-dimensions.test.js +0 -89
- package/workflow/__tests__/caption-dimensions.test.js.map +0 -1
- package/workflow/__tests__/clipboard.test.d.ts +0 -2
- package/workflow/__tests__/clipboard.test.d.ts.map +0 -1
- package/workflow/__tests__/clipboard.test.js +0 -172
- package/workflow/__tests__/clipboard.test.js.map +0 -1
- package/workflow/__tests__/cncf-yaml-to-graph.test.d.ts +0 -2
- package/workflow/__tests__/cncf-yaml-to-graph.test.d.ts.map +0 -1
- package/workflow/__tests__/cncf-yaml-to-graph.test.js +0 -479
- package/workflow/__tests__/cncf-yaml-to-graph.test.js.map +0 -1
- package/workflow/__tests__/context-menu-logic.test.d.ts +0 -2
- package/workflow/__tests__/context-menu-logic.test.d.ts.map +0 -1
- package/workflow/__tests__/context-menu-logic.test.js +0 -97
- package/workflow/__tests__/context-menu-logic.test.js.map +0 -1
- package/workflow/__tests__/derive-execution-overlays.test.d.ts +0 -2
- package/workflow/__tests__/derive-execution-overlays.test.d.ts.map +0 -1
- package/workflow/__tests__/derive-execution-overlays.test.js +0 -338
- package/workflow/__tests__/derive-execution-overlays.test.js.map +0 -1
- package/workflow/__tests__/derive-task-detail.test.d.ts +0 -2
- package/workflow/__tests__/derive-task-detail.test.d.ts.map +0 -1
- package/workflow/__tests__/derive-task-detail.test.js +0 -1035
- package/workflow/__tests__/derive-task-detail.test.js.map +0 -1
- package/workflow/__tests__/derive-waterfall-entries.test.d.ts +0 -2
- package/workflow/__tests__/derive-waterfall-entries.test.d.ts.map +0 -1
- package/workflow/__tests__/derive-waterfall-entries.test.js +0 -419
- package/workflow/__tests__/derive-waterfall-entries.test.js.map +0 -1
- package/workflow/__tests__/execution-graph.test.d.ts +0 -2
- package/workflow/__tests__/execution-graph.test.d.ts.map +0 -1
- package/workflow/__tests__/execution-graph.test.js +0 -251
- package/workflow/__tests__/execution-graph.test.js.map +0 -1
- package/workflow/__tests__/execution-inspector.test.d.ts +0 -2
- package/workflow/__tests__/execution-inspector.test.d.ts.map +0 -1
- package/workflow/__tests__/execution-inspector.test.js +0 -248
- package/workflow/__tests__/execution-inspector.test.js.map +0 -1
- package/workflow/__tests__/extract-workflow-yaml.test.d.ts +0 -2
- package/workflow/__tests__/extract-workflow-yaml.test.d.ts.map +0 -1
- package/workflow/__tests__/extract-workflow-yaml.test.js +0 -135
- package/workflow/__tests__/extract-workflow-yaml.test.js.map +0 -1
- package/workflow/__tests__/format-utils.test.d.ts +0 -2
- package/workflow/__tests__/format-utils.test.d.ts.map +0 -1
- package/workflow/__tests__/format-utils.test.js +0 -128
- package/workflow/__tests__/format-utils.test.js.map +0 -1
- package/workflow/__tests__/inspector-commands.test.d.ts +0 -2
- package/workflow/__tests__/inspector-commands.test.d.ts.map +0 -1
- package/workflow/__tests__/inspector-commands.test.js +0 -110
- package/workflow/__tests__/inspector-commands.test.js.map +0 -1
- package/workflow/__tests__/inspector-forms.test.d.ts +0 -2
- package/workflow/__tests__/inspector-forms.test.d.ts.map +0 -1
- package/workflow/__tests__/inspector-forms.test.js +0 -114
- package/workflow/__tests__/inspector-forms.test.js.map +0 -1
- package/workflow/__tests__/inspector-tabs.test.d.ts +0 -2
- package/workflow/__tests__/inspector-tabs.test.d.ts.map +0 -1
- package/workflow/__tests__/inspector-tabs.test.js +0 -81
- package/workflow/__tests__/inspector-tabs.test.js.map +0 -1
- package/workflow/__tests__/kind-metadata.test.d.ts +0 -2
- package/workflow/__tests__/kind-metadata.test.d.ts.map +0 -1
- package/workflow/__tests__/kind-metadata.test.js +0 -80
- package/workflow/__tests__/kind-metadata.test.js.map +0 -1
- package/workflow/__tests__/motion-preference.test.d.ts +0 -2
- package/workflow/__tests__/motion-preference.test.d.ts.map +0 -1
- package/workflow/__tests__/motion-preference.test.js +0 -42
- package/workflow/__tests__/motion-preference.test.js.map +0 -1
- package/workflow/__tests__/node-popover.test.d.ts +0 -2
- package/workflow/__tests__/node-popover.test.d.ts.map +0 -1
- package/workflow/__tests__/node-popover.test.js +0 -130
- package/workflow/__tests__/node-popover.test.js.map +0 -1
- package/workflow/__tests__/node-shell.test.d.ts +0 -2
- package/workflow/__tests__/node-shell.test.d.ts.map +0 -1
- package/workflow/__tests__/node-shell.test.js +0 -210
- package/workflow/__tests__/node-shell.test.js.map +0 -1
- package/workflow/__tests__/overview-graph.test.d.ts +0 -2
- package/workflow/__tests__/overview-graph.test.d.ts.map +0 -1
- package/workflow/__tests__/overview-graph.test.js +0 -83
- package/workflow/__tests__/overview-graph.test.js.map +0 -1
- package/workflow/__tests__/overview-summary.test.d.ts +0 -2
- package/workflow/__tests__/overview-summary.test.d.ts.map +0 -1
- package/workflow/__tests__/overview-summary.test.js +0 -73
- package/workflow/__tests__/overview-summary.test.js.map +0 -1
- package/workflow/__tests__/shortcut-registry.test.d.ts +0 -2
- package/workflow/__tests__/shortcut-registry.test.d.ts.map +0 -1
- package/workflow/__tests__/shortcut-registry.test.js +0 -111
- package/workflow/__tests__/shortcut-registry.test.js.map +0 -1
- package/workflow/__tests__/starter-workflow-yaml.test.d.ts +0 -2
- package/workflow/__tests__/starter-workflow-yaml.test.d.ts.map +0 -1
- package/workflow/__tests__/starter-workflow-yaml.test.js +0 -44
- package/workflow/__tests__/starter-workflow-yaml.test.js.map +0 -1
- package/workflow/__tests__/structured-data-viewer.test.d.ts +0 -2
- package/workflow/__tests__/structured-data-viewer.test.d.ts.map +0 -1
- package/workflow/__tests__/structured-data-viewer.test.js +0 -438
- package/workflow/__tests__/structured-data-viewer.test.js.map +0 -1
- package/workflow/__tests__/t09-branch-management.test.d.ts +0 -2
- package/workflow/__tests__/t09-branch-management.test.d.ts.map +0 -1
- package/workflow/__tests__/t09-branch-management.test.js +0 -433
- package/workflow/__tests__/t09-branch-management.test.js.map +0 -1
- package/workflow/__tests__/task-type-visual-registry.test.d.ts +0 -2
- package/workflow/__tests__/task-type-visual-registry.test.d.ts.map +0 -1
- package/workflow/__tests__/task-type-visual-registry.test.js +0 -99
- package/workflow/__tests__/task-type-visual-registry.test.js.map +0 -1
- package/workflow/__tests__/useActiveTaskName.test.d.ts +0 -2
- package/workflow/__tests__/useActiveTaskName.test.d.ts.map +0 -1
- package/workflow/__tests__/useActiveTaskName.test.js +0 -80
- package/workflow/__tests__/useActiveTaskName.test.js.map +0 -1
- package/workflow/__tests__/useDiagnoseExecutionFlow.test.d.ts +0 -2
- package/workflow/__tests__/useDiagnoseExecutionFlow.test.d.ts.map +0 -1
- package/workflow/__tests__/useDiagnoseExecutionFlow.test.js +0 -363
- package/workflow/__tests__/useDiagnoseExecutionFlow.test.js.map +0 -1
- package/workflow/__tests__/useExecutionAnnouncements.test.d.ts +0 -2
- package/workflow/__tests__/useExecutionAnnouncements.test.d.ts.map +0 -1
- package/workflow/__tests__/useExecutionAnnouncements.test.js +0 -85
- package/workflow/__tests__/useExecutionAnnouncements.test.js.map +0 -1
- package/workflow/__tests__/useFollowExecution.test.d.ts +0 -2
- package/workflow/__tests__/useFollowExecution.test.d.ts.map +0 -1
- package/workflow/__tests__/useFollowExecution.test.js +0 -130
- package/workflow/__tests__/useFollowExecution.test.js.map +0 -1
- package/workflow/__tests__/useRefineWorkflowFlow.test.d.ts +0 -2
- package/workflow/__tests__/useRefineWorkflowFlow.test.d.ts.map +0 -1
- package/workflow/__tests__/useRefineWorkflowFlow.test.js +0 -367
- package/workflow/__tests__/useRefineWorkflowFlow.test.js.map +0 -1
- package/workflow/__tests__/useRunWorkflowFlow.test.d.ts +0 -2
- package/workflow/__tests__/useRunWorkflowFlow.test.d.ts.map +0 -1
- package/workflow/__tests__/useRunWorkflowFlow.test.js +0 -385
- package/workflow/__tests__/useRunWorkflowFlow.test.js.map +0 -1
- package/workflow/__tests__/useWorkflowArchitectFlow.test.d.ts +0 -2
- package/workflow/__tests__/useWorkflowArchitectFlow.test.d.ts.map +0 -1
- package/workflow/__tests__/useWorkflowArchitectFlow.test.js +0 -376
- package/workflow/__tests__/useWorkflowArchitectFlow.test.js.map +0 -1
- package/workflow/__tests__/useWorkflowExecution.test.d.ts +0 -2
- package/workflow/__tests__/useWorkflowExecution.test.d.ts.map +0 -1
- package/workflow/__tests__/useWorkflowExecution.test.js +0 -229
- package/workflow/__tests__/useWorkflowExecution.test.js.map +0 -1
- package/workflow/__tests__/useWorkflowExecutionActions.test.d.ts +0 -2
- package/workflow/__tests__/useWorkflowExecutionActions.test.d.ts.map +0 -1
- package/workflow/__tests__/useWorkflowExecutionActions.test.js +0 -191
- package/workflow/__tests__/useWorkflowExecutionActions.test.js.map +0 -1
- package/workflow/__tests__/useWorkflowExecutionEventStream.test.d.ts +0 -2
- package/workflow/__tests__/useWorkflowExecutionEventStream.test.d.ts.map +0 -1
- package/workflow/__tests__/useWorkflowExecutionEventStream.test.js +0 -291
- package/workflow/__tests__/useWorkflowExecutionEventStream.test.js.map +0 -1
- package/workflow/__tests__/workflow-instance-hooks.test.d.ts +0 -2
- package/workflow/__tests__/workflow-instance-hooks.test.d.ts.map +0 -1
- package/workflow/__tests__/workflow-instance-hooks.test.js +0 -153
- package/workflow/__tests__/workflow-instance-hooks.test.js.map +0 -1
- package/workflow/__tests__/workflow-summary-panel.test.d.ts +0 -2
- package/workflow/__tests__/workflow-summary-panel.test.d.ts.map +0 -1
- package/workflow/__tests__/workflow-summary-panel.test.js +0 -85
- package/workflow/__tests__/workflow-summary-panel.test.js.map +0 -1
- package/workflow/__tests__/workflow-uses-trigger-input.test.d.ts +0 -2
- package/workflow/__tests__/workflow-uses-trigger-input.test.d.ts.map +0 -1
- package/workflow/__tests__/workflow-uses-trigger-input.test.js +0 -144
- package/workflow/__tests__/workflow-uses-trigger-input.test.js.map +0 -1
- package/workflow/__tests__/workflow-yaml-diff.test.d.ts +0 -2
- package/workflow/__tests__/workflow-yaml-diff.test.d.ts.map +0 -1
- package/workflow/__tests__/workflow-yaml-diff.test.js +0 -110
- package/workflow/__tests__/workflow-yaml-diff.test.js.map +0 -1
- package/workflow/diff/__tests__/build-diff-graph.test.d.ts +0 -2
- package/workflow/diff/__tests__/build-diff-graph.test.d.ts.map +0 -1
- package/workflow/diff/__tests__/build-diff-graph.test.js +0 -115
- package/workflow/diff/__tests__/build-diff-graph.test.js.map +0 -1
- package/workflow/diff/__tests__/graph-diff.test.d.ts +0 -2
- package/workflow/diff/__tests__/graph-diff.test.d.ts.map +0 -1
- package/workflow/diff/__tests__/graph-diff.test.js +0 -196
- package/workflow/diff/__tests__/graph-diff.test.js.map +0 -1
- package/workflow/execution-comparison/__tests__/derive-execution-comparison.test.d.ts +0 -2
- package/workflow/execution-comparison/__tests__/derive-execution-comparison.test.d.ts.map +0 -1
- package/workflow/execution-comparison/__tests__/derive-execution-comparison.test.js +0 -263
- package/workflow/execution-comparison/__tests__/derive-execution-comparison.test.js.map +0 -1
- package/workflow/execution-history/__tests__/derive-execution-row.test.d.ts +0 -2
- package/workflow/execution-history/__tests__/derive-execution-row.test.d.ts.map +0 -1
- package/workflow/execution-history/__tests__/derive-execution-row.test.js +0 -276
- package/workflow/execution-history/__tests__/derive-execution-row.test.js.map +0 -1
- package/workflow/execution-history/__tests__/derive-failure-analysis.test.d.ts +0 -2
- package/workflow/execution-history/__tests__/derive-failure-analysis.test.d.ts.map +0 -1
- package/workflow/execution-history/__tests__/derive-failure-analysis.test.js +0 -132
- package/workflow/execution-history/__tests__/derive-failure-analysis.test.js.map +0 -1
- package/workflow/layout/__tests__/dagre-layout-engine.test.d.ts +0 -2
- package/workflow/layout/__tests__/dagre-layout-engine.test.d.ts.map +0 -1
- package/workflow/layout/__tests__/dagre-layout-engine.test.js +0 -105
- package/workflow/layout/__tests__/dagre-layout-engine.test.js.map +0 -1
- package/workflow/layout/__tests__/layout-postprocessor.test.d.ts +0 -2
- package/workflow/layout/__tests__/layout-postprocessor.test.d.ts.map +0 -1
- package/workflow/layout/__tests__/layout-postprocessor.test.js +0 -123
- package/workflow/layout/__tests__/layout-postprocessor.test.js.map +0 -1
- package/workflow/layout/__tests__/port-assignment.test.d.ts +0 -2
- package/workflow/layout/__tests__/port-assignment.test.d.ts.map +0 -1
- package/workflow/layout/__tests__/port-assignment.test.js +0 -200
- package/workflow/layout/__tests__/port-assignment.test.js.map +0 -1
- package/workflow/layout/__tests__/registry-dimensions.test.d.ts +0 -2
- package/workflow/layout/__tests__/registry-dimensions.test.d.ts.map +0 -1
- package/workflow/layout/__tests__/registry-dimensions.test.js +0 -104
- package/workflow/layout/__tests__/registry-dimensions.test.js.map +0 -1
- package/workflow/layout/__tests__/useElkLayoutEngine.test.d.ts +0 -2
- package/workflow/layout/__tests__/useElkLayoutEngine.test.d.ts.map +0 -1
- package/workflow/layout/__tests__/useElkLayoutEngine.test.js +0 -106
- package/workflow/layout/__tests__/useElkLayoutEngine.test.js.map +0 -1
- package/workflow/layout/__tests__/workflow-preprocessor.test.d.ts +0 -2
- package/workflow/layout/__tests__/workflow-preprocessor.test.d.ts.map +0 -1
- package/workflow/layout/__tests__/workflow-preprocessor.test.js +0 -138
- package/workflow/layout/__tests__/workflow-preprocessor.test.js.map +0 -1
- package/workflow/picker/__tests__/compatibility.test.d.ts +0 -2
- package/workflow/picker/__tests__/compatibility.test.d.ts.map +0 -1
- package/workflow/picker/__tests__/compatibility.test.js +0 -93
- package/workflow/picker/__tests__/compatibility.test.js.map +0 -1
- package/workflow/picker/__tests__/insertion-context.test.d.ts +0 -2
- package/workflow/picker/__tests__/insertion-context.test.d.ts.map +0 -1
- package/workflow/picker/__tests__/insertion-context.test.js +0 -67
- package/workflow/picker/__tests__/insertion-context.test.js.map +0 -1
- package/workflow/picker/__tests__/recents.test.d.ts +0 -2
- package/workflow/picker/__tests__/recents.test.d.ts.map +0 -1
- package/workflow/picker/__tests__/recents.test.js +0 -81
- package/workflow/picker/__tests__/recents.test.js.map +0 -1
- package/workflow/picker/__tests__/suggestions.test.d.ts +0 -2
- package/workflow/picker/__tests__/suggestions.test.d.ts.map +0 -1
- package/workflow/picker/__tests__/suggestions.test.js +0 -111
- package/workflow/picker/__tests__/suggestions.test.js.map +0 -1
- package/workflow/templates/__tests__/derive-template-metadata.test.d.ts +0 -2
- package/workflow/templates/__tests__/derive-template-metadata.test.d.ts.map +0 -1
- package/workflow/templates/__tests__/derive-template-metadata.test.js +0 -317
- package/workflow/templates/__tests__/derive-template-metadata.test.js.map +0 -1
- package/workflow/templates/__tests__/workflow-template-gallery.test.d.ts +0 -2
- package/workflow/templates/__tests__/workflow-template-gallery.test.d.ts.map +0 -1
- package/workflow/templates/__tests__/workflow-template-gallery.test.js +0 -119
- package/workflow/templates/__tests__/workflow-template-gallery.test.js.map +0 -1
- package/workspace/__tests__/WorkspaceEditor-initialPanel.test.d.ts +0 -2
- package/workspace/__tests__/WorkspaceEditor-initialPanel.test.d.ts.map +0 -1
- package/workspace/__tests__/WorkspaceEditor-initialPanel.test.js +0 -82
- package/workspace/__tests__/WorkspaceEditor-initialPanel.test.js.map +0 -1
- package/workspace/__tests__/useWorkspaceEntries-stability.test.d.ts +0 -2
- package/workspace/__tests__/useWorkspaceEntries-stability.test.d.ts.map +0 -1
- package/workspace/__tests__/useWorkspaceEntries-stability.test.js +0 -57
- package/workspace/__tests__/useWorkspaceEntries-stability.test.js.map +0 -1
- package/workspace/__tests__/useWorkspaceFiles.test.d.ts +0 -2
- package/workspace/__tests__/useWorkspaceFiles.test.d.ts.map +0 -1
- package/workspace/__tests__/useWorkspaceFiles.test.js +0 -128
- package/workspace/__tests__/useWorkspaceFiles.test.js.map +0 -1
- package/workspace/__tests__/useWorkspaceSources.test.d.ts +0 -2
- package/workspace/__tests__/useWorkspaceSources.test.d.ts.map +0 -1
- package/workspace/__tests__/useWorkspaceSources.test.js +0 -98
- package/workspace/__tests__/useWorkspaceSources.test.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoScroll.test.d.ts","sourceRoot":"","sources":["../../../src/internal/__tests__/useAutoScroll.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
|
3
|
-
import { render, act, screen, cleanup } from "@testing-library/react";
|
|
4
|
-
import { useAutoScroll } from "../useAutoScroll";
|
|
5
|
-
// ---------------------------------------------------------------------------
|
|
6
|
-
// Test harness — renders actual DOM elements so refs get populated
|
|
7
|
-
// ---------------------------------------------------------------------------
|
|
8
|
-
let latestResult;
|
|
9
|
-
function Harness() {
|
|
10
|
-
const result = useAutoScroll();
|
|
11
|
-
latestResult = result;
|
|
12
|
-
return (_jsxs("div", { ref: result.scrollRef, "data-testid": "scroller", children: [_jsx("div", { ref: result.contentRef, "data-testid": "content", children: _jsx("p", { children: "Hello" }) }), _jsx("div", { ref: result.sentinelRef, "data-testid": "sentinel" })] }));
|
|
13
|
-
}
|
|
14
|
-
let ioCallback;
|
|
15
|
-
let ioDisconnect;
|
|
16
|
-
let ioObserve;
|
|
17
|
-
let roCallback;
|
|
18
|
-
let roDisconnect;
|
|
19
|
-
let roObserve;
|
|
20
|
-
beforeEach(() => {
|
|
21
|
-
ioDisconnect = vi.fn();
|
|
22
|
-
ioObserve = vi.fn();
|
|
23
|
-
roDisconnect = vi.fn();
|
|
24
|
-
roObserve = vi.fn();
|
|
25
|
-
vi.stubGlobal("IntersectionObserver", vi.fn((cb) => {
|
|
26
|
-
ioCallback = cb;
|
|
27
|
-
return {
|
|
28
|
-
observe: ioObserve,
|
|
29
|
-
unobserve: vi.fn(),
|
|
30
|
-
disconnect: ioDisconnect,
|
|
31
|
-
takeRecords: vi.fn(() => []),
|
|
32
|
-
root: null,
|
|
33
|
-
rootMargin: "",
|
|
34
|
-
thresholds: [0],
|
|
35
|
-
};
|
|
36
|
-
}));
|
|
37
|
-
vi.stubGlobal("ResizeObserver", vi.fn((cb) => {
|
|
38
|
-
roCallback = cb;
|
|
39
|
-
return {
|
|
40
|
-
observe: roObserve,
|
|
41
|
-
unobserve: vi.fn(),
|
|
42
|
-
disconnect: roDisconnect,
|
|
43
|
-
};
|
|
44
|
-
}));
|
|
45
|
-
vi.stubGlobal("requestAnimationFrame", vi.fn((cb) => {
|
|
46
|
-
cb(performance.now());
|
|
47
|
-
return 1;
|
|
48
|
-
}));
|
|
49
|
-
vi.stubGlobal("cancelAnimationFrame", vi.fn());
|
|
50
|
-
});
|
|
51
|
-
afterEach(() => {
|
|
52
|
-
cleanup();
|
|
53
|
-
vi.restoreAllMocks();
|
|
54
|
-
});
|
|
55
|
-
// ---------------------------------------------------------------------------
|
|
56
|
-
// Helpers
|
|
57
|
-
// ---------------------------------------------------------------------------
|
|
58
|
-
function fireIO(isIntersecting) {
|
|
59
|
-
act(() => {
|
|
60
|
-
ioCallback([{ isIntersecting }], {});
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
function fireRO() {
|
|
64
|
-
act(() => {
|
|
65
|
-
roCallback([], {});
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
// ---------------------------------------------------------------------------
|
|
69
|
-
// Tests
|
|
70
|
-
// ---------------------------------------------------------------------------
|
|
71
|
-
describe("useAutoScroll", () => {
|
|
72
|
-
it("starts in following state", () => {
|
|
73
|
-
render(_jsx(Harness, {}));
|
|
74
|
-
expect(latestResult.isFollowing).toBe(true);
|
|
75
|
-
});
|
|
76
|
-
it("observes sentinel with IntersectionObserver on mount", () => {
|
|
77
|
-
render(_jsx(Harness, {}));
|
|
78
|
-
expect(ioObserve).toHaveBeenCalledWith(screen.getByTestId("sentinel"));
|
|
79
|
-
});
|
|
80
|
-
it("observes content with ResizeObserver on mount", () => {
|
|
81
|
-
render(_jsx(Harness, {}));
|
|
82
|
-
expect(roObserve).toHaveBeenCalledWith(screen.getByTestId("content"));
|
|
83
|
-
});
|
|
84
|
-
it("configures IO with 80px bottom root margin", () => {
|
|
85
|
-
render(_jsx(Harness, {}));
|
|
86
|
-
const IOConstructor = vi.mocked(IntersectionObserver);
|
|
87
|
-
const options = IOConstructor.mock.calls[0]?.[1];
|
|
88
|
-
expect(options?.rootMargin).toBe("0px 0px 80px 0px");
|
|
89
|
-
});
|
|
90
|
-
it("configures IO with scroll container as root", () => {
|
|
91
|
-
render(_jsx(Harness, {}));
|
|
92
|
-
const IOConstructor = vi.mocked(IntersectionObserver);
|
|
93
|
-
const options = IOConstructor.mock.calls[0]?.[1];
|
|
94
|
-
expect(options?.root).toBe(screen.getByTestId("scroller"));
|
|
95
|
-
});
|
|
96
|
-
it("disengages when sentinel exits viewport", () => {
|
|
97
|
-
render(_jsx(Harness, {}));
|
|
98
|
-
fireIO(false);
|
|
99
|
-
expect(latestResult.isFollowing).toBe(false);
|
|
100
|
-
});
|
|
101
|
-
it("re-engages when sentinel enters viewport", () => {
|
|
102
|
-
render(_jsx(Harness, {}));
|
|
103
|
-
fireIO(false);
|
|
104
|
-
expect(latestResult.isFollowing).toBe(false);
|
|
105
|
-
fireIO(true);
|
|
106
|
-
expect(latestResult.isFollowing).toBe(true);
|
|
107
|
-
});
|
|
108
|
-
it("jumpToLatest re-engages follow mode", () => {
|
|
109
|
-
render(_jsx(Harness, {}));
|
|
110
|
-
fireIO(false);
|
|
111
|
-
expect(latestResult.isFollowing).toBe(false);
|
|
112
|
-
act(() => {
|
|
113
|
-
latestResult.jumpToLatest();
|
|
114
|
-
});
|
|
115
|
-
expect(latestResult.isFollowing).toBe(true);
|
|
116
|
-
});
|
|
117
|
-
it("jumpToLatest sets scrollTop to scrollHeight", () => {
|
|
118
|
-
render(_jsx(Harness, {}));
|
|
119
|
-
fireIO(false);
|
|
120
|
-
const scroller = screen.getByTestId("scroller");
|
|
121
|
-
Object.defineProperty(scroller, "scrollHeight", {
|
|
122
|
-
value: 1000,
|
|
123
|
-
configurable: true,
|
|
124
|
-
});
|
|
125
|
-
act(() => {
|
|
126
|
-
latestResult.jumpToLatest();
|
|
127
|
-
});
|
|
128
|
-
expect(scroller.scrollTop).toBe(1000);
|
|
129
|
-
});
|
|
130
|
-
it("scrolls via rAF on content resize while following", () => {
|
|
131
|
-
render(_jsx(Harness, {}));
|
|
132
|
-
fireIO(true);
|
|
133
|
-
const scroller = screen.getByTestId("scroller");
|
|
134
|
-
Object.defineProperty(scroller, "scrollHeight", {
|
|
135
|
-
value: 500,
|
|
136
|
-
configurable: true,
|
|
137
|
-
});
|
|
138
|
-
fireRO();
|
|
139
|
-
expect(requestAnimationFrame).toHaveBeenCalled();
|
|
140
|
-
expect(scroller.scrollTop).toBe(500);
|
|
141
|
-
});
|
|
142
|
-
it("does not scroll on content resize while disengaged", () => {
|
|
143
|
-
render(_jsx(Harness, {}));
|
|
144
|
-
fireIO(false);
|
|
145
|
-
const scroller = screen.getByTestId("scroller");
|
|
146
|
-
Object.defineProperty(scroller, "scrollHeight", {
|
|
147
|
-
value: 500,
|
|
148
|
-
configurable: true,
|
|
149
|
-
});
|
|
150
|
-
vi.mocked(requestAnimationFrame).mockClear();
|
|
151
|
-
fireRO();
|
|
152
|
-
expect(requestAnimationFrame).not.toHaveBeenCalled();
|
|
153
|
-
});
|
|
154
|
-
it("cancels pending rAF before scheduling a new one", () => {
|
|
155
|
-
render(_jsx(Harness, {}));
|
|
156
|
-
fireIO(true);
|
|
157
|
-
fireRO();
|
|
158
|
-
fireRO();
|
|
159
|
-
expect(cancelAnimationFrame).toHaveBeenCalled();
|
|
160
|
-
});
|
|
161
|
-
it("disconnects IO on unmount", () => {
|
|
162
|
-
const { unmount } = render(_jsx(Harness, {}));
|
|
163
|
-
unmount();
|
|
164
|
-
expect(ioDisconnect).toHaveBeenCalled();
|
|
165
|
-
});
|
|
166
|
-
it("disconnects RO on unmount", () => {
|
|
167
|
-
const { unmount } = render(_jsx(Harness, {}));
|
|
168
|
-
unmount();
|
|
169
|
-
expect(roDisconnect).toHaveBeenCalled();
|
|
170
|
-
});
|
|
171
|
-
it("cancels pending rAF on unmount", () => {
|
|
172
|
-
const { unmount } = render(_jsx(Harness, {}));
|
|
173
|
-
fireIO(true);
|
|
174
|
-
fireRO();
|
|
175
|
-
vi.mocked(cancelAnimationFrame).mockClear();
|
|
176
|
-
unmount();
|
|
177
|
-
expect(cancelAnimationFrame).toHaveBeenCalled();
|
|
178
|
-
});
|
|
179
|
-
it("scrolls to bottom on mount without error", () => {
|
|
180
|
-
// The hook sets scrollTop = scrollHeight in the IO setup effect.
|
|
181
|
-
// In jsdom both values are 0, so scrollTop stays 0. The important
|
|
182
|
-
// thing is that the code path executes without error; real scroll
|
|
183
|
-
// behavior is validated by integration tests.
|
|
184
|
-
render(_jsx(Harness, {}));
|
|
185
|
-
expect(screen.getByTestId("scroller").scrollTop).toBe(0);
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
//# sourceMappingURL=useAutoScroll.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoScroll.test.js","sourceRoot":"","sources":["../../../src/internal/__tests__/useAutoScroll.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,EAAE,aAAa,EAA4B,MAAM,kBAAkB,CAAC;AAE3E,8EAA8E;AAC9E,mEAAmE;AACnE,8EAA8E;AAE9E,IAAI,YAAiC,CAAC;AAEtC,SAAS,OAAO;IACd,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,YAAY,GAAG,MAAM,CAAC;IACtB,OAAO,CACL,eAAK,GAAG,EAAE,MAAM,CAAC,SAAS,iBAAc,UAAU,aAChD,cAAK,GAAG,EAAE,MAAM,CAAC,UAAU,iBAAc,SAAS,YAChD,gCAAY,GACR,EACN,cAAK,GAAG,EAAE,MAAM,CAAC,WAAW,iBAAc,UAAU,GAAG,IACnD,CACP,CAAC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AAC,OAAO,KAAG,CAAC,CAAC;QACxC,OAAO,EAAE,CAAC;QACV,MAAM,CAAC,YAAY,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,KAAC,OAAO,KAAG,CAAC,CAAC;QACxC,OAAO,EAAE,CAAC;QACV,MAAM,CAAC,YAAY,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,KAAC,OAAO,KAAG,CAAC,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC,CAAC;QACb,MAAM,EAAE,CAAC;QAET,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,SAAS,EAAE,CAAC;QAC5C,OAAO,EAAE,CAAC;QAEV,MAAM,CAAC,oBAAoB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,iEAAiE;QACjE,kEAAkE;QAClE,kEAAkE;QAClE,8CAA8C;QAC9C,MAAM,CAAC,KAAC,OAAO,KAAG,CAAC,CAAC;QACpB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFetch-cache.test.d.ts","sourceRoot":"","sources":["../../../src/internal/__tests__/useFetch-cache.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from "vitest";
|
|
2
|
-
import { renderHook, act } from "@testing-library/react";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { FetchCacheContext } from "../FetchCacheProvider";
|
|
5
|
-
import { FetchCache } from "../fetch-cache";
|
|
6
|
-
import { useFetch } from "../useFetch";
|
|
7
|
-
// ---------------------------------------------------------------------------
|
|
8
|
-
// Helpers
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
|
-
async function flush() {
|
|
11
|
-
await act(async () => {
|
|
12
|
-
await Promise.resolve();
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Build a wrapper that provides a specific FetchCache instance via
|
|
17
|
-
* context. Tests that need cross-mount caching share the same cache
|
|
18
|
-
* object, mirroring the production layout where FetchCacheProvider
|
|
19
|
-
* sits above the key-based remount boundary.
|
|
20
|
-
*/
|
|
21
|
-
function createCacheWrapper(cache) {
|
|
22
|
-
return function Wrapper({ children }) {
|
|
23
|
-
return createElement(FetchCacheContext.Provider, { value: cache }, children);
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
// ---------------------------------------------------------------------------
|
|
27
|
-
// Tests: useFetch + FetchCacheProvider
|
|
28
|
-
// ---------------------------------------------------------------------------
|
|
29
|
-
describe("useFetch — cache integration", () => {
|
|
30
|
-
it("serves cached data on mount and skips isLoading", async () => {
|
|
31
|
-
const cache = new FetchCache();
|
|
32
|
-
const wrapper = createCacheWrapper(cache);
|
|
33
|
-
// First mount: populate the cache via a normal fetch.
|
|
34
|
-
const fetchFn = vi.fn(async () => "fetched-value");
|
|
35
|
-
const { result, unmount } = renderHook(() => useFetch(fetchFn, [], "init", { cacheKey: "test:1" }), { wrapper });
|
|
36
|
-
expect(result.current.isLoading).toBe(true);
|
|
37
|
-
await flush();
|
|
38
|
-
expect(result.current.data).toBe("fetched-value");
|
|
39
|
-
expect(result.current.isLoading).toBe(false);
|
|
40
|
-
unmount();
|
|
41
|
-
// Second mount (simulating remount after key change): should
|
|
42
|
-
// seed state from cache and never show isLoading.
|
|
43
|
-
const fetchFn2 = vi.fn(async () => "fresh-value");
|
|
44
|
-
const { result: result2 } = renderHook(() => useFetch(fetchFn2, [], "init", { cacheKey: "test:1" }), { wrapper });
|
|
45
|
-
// On mount, cached data is available immediately.
|
|
46
|
-
expect(result2.current.data).toBe("fetched-value");
|
|
47
|
-
expect(result2.current.isLoading).toBe(false);
|
|
48
|
-
expect(result2.current.isRefetching).toBe(true);
|
|
49
|
-
// Background fetch completes and updates data.
|
|
50
|
-
await flush();
|
|
51
|
-
expect(result2.current.data).toBe("fresh-value");
|
|
52
|
-
expect(result2.current.isRefetching).toBe(false);
|
|
53
|
-
});
|
|
54
|
-
it("falls back to initialData on cache miss", async () => {
|
|
55
|
-
const cache = new FetchCache();
|
|
56
|
-
const wrapper = createCacheWrapper(cache);
|
|
57
|
-
const fetchFn = vi.fn(async () => "fetched");
|
|
58
|
-
const { result } = renderHook(() => useFetch(fetchFn, [], "init", { cacheKey: "miss:1" }), { wrapper });
|
|
59
|
-
expect(result.current.data).toBe("init");
|
|
60
|
-
expect(result.current.isLoading).toBe(true);
|
|
61
|
-
await flush();
|
|
62
|
-
expect(result.current.data).toBe("fetched");
|
|
63
|
-
});
|
|
64
|
-
it("writes to cache on fetch success", async () => {
|
|
65
|
-
const cache = new FetchCache();
|
|
66
|
-
const wrapper = createCacheWrapper(cache);
|
|
67
|
-
const fetchFn = vi.fn(async () => "data-1");
|
|
68
|
-
const { result } = renderHook(() => useFetch(fetchFn, [], "init", { cacheKey: "write:1" }), { wrapper });
|
|
69
|
-
expect(cache.has("write:1")).toBe(false);
|
|
70
|
-
await flush();
|
|
71
|
-
expect(result.current.data).toBe("data-1");
|
|
72
|
-
expect(cache.get("write:1")).toBe("data-1");
|
|
73
|
-
});
|
|
74
|
-
it("does not interact with cache when cacheKey is undefined", async () => {
|
|
75
|
-
const cache = new FetchCache();
|
|
76
|
-
const wrapper = createCacheWrapper(cache);
|
|
77
|
-
const fetchFn = vi.fn(async () => "val");
|
|
78
|
-
const { result } = renderHook(() => useFetch(fetchFn, [], "init"), { wrapper });
|
|
79
|
-
await flush();
|
|
80
|
-
expect(result.current.data).toBe("val");
|
|
81
|
-
expect(cache.size).toBe(0);
|
|
82
|
-
});
|
|
83
|
-
it("works without FetchCacheProvider (graceful degradation)", async () => {
|
|
84
|
-
const fetchFn = vi.fn(async () => "value");
|
|
85
|
-
// No wrapper — no provider.
|
|
86
|
-
const { result } = renderHook(() => useFetch(fetchFn, [], "init", { cacheKey: "no-provider:1" }));
|
|
87
|
-
expect(result.current.data).toBe("init");
|
|
88
|
-
expect(result.current.isLoading).toBe(true);
|
|
89
|
-
await flush();
|
|
90
|
-
expect(result.current.data).toBe("value");
|
|
91
|
-
expect(result.current.isLoading).toBe(false);
|
|
92
|
-
});
|
|
93
|
-
it("does not read cache when fetchFn is null", async () => {
|
|
94
|
-
const cache = new FetchCache();
|
|
95
|
-
const wrapper = createCacheWrapper(cache);
|
|
96
|
-
const fetchFn1 = vi.fn(async () => "cached-val");
|
|
97
|
-
// First: populate cache.
|
|
98
|
-
const { unmount } = renderHook(() => useFetch(fetchFn1, [], "init", { cacheKey: "null-fn:1" }), { wrapper });
|
|
99
|
-
await flush();
|
|
100
|
-
unmount();
|
|
101
|
-
// Second: mount with fetchFn=null — should reset to initialData
|
|
102
|
-
// even though cache has data for this key.
|
|
103
|
-
const { result } = renderHook(() => useFetch(null, [], "fallback", {
|
|
104
|
-
cacheKey: "null-fn:1",
|
|
105
|
-
}), { wrapper });
|
|
106
|
-
expect(result.current.data).toBe("fallback");
|
|
107
|
-
expect(result.current.isLoading).toBe(false);
|
|
108
|
-
});
|
|
109
|
-
it("does not write to cache on fetch error", async () => {
|
|
110
|
-
const cache = new FetchCache();
|
|
111
|
-
const wrapper = createCacheWrapper(cache);
|
|
112
|
-
const fetchFn = vi.fn(async () => {
|
|
113
|
-
throw new Error("fail");
|
|
114
|
-
});
|
|
115
|
-
const { result } = renderHook(() => useFetch(fetchFn, [], "init", { cacheKey: "err:1" }), { wrapper });
|
|
116
|
-
await flush();
|
|
117
|
-
expect(result.current.error?.message).toBe("fail");
|
|
118
|
-
expect(cache.has("err:1")).toBe(false);
|
|
119
|
-
});
|
|
120
|
-
it("independent cache keys do not interfere", async () => {
|
|
121
|
-
const cache = new FetchCache();
|
|
122
|
-
const wrapper = createCacheWrapper(cache);
|
|
123
|
-
const fetchA = vi.fn(async () => "session-A");
|
|
124
|
-
const fetchB = vi.fn(async () => "session-B");
|
|
125
|
-
const { unmount: unmountA } = renderHook(() => useFetch(fetchA, [], null, { cacheKey: "session:A" }), { wrapper });
|
|
126
|
-
await flush();
|
|
127
|
-
unmountA();
|
|
128
|
-
const { unmount: unmountB } = renderHook(() => useFetch(fetchB, [], null, { cacheKey: "session:B" }), { wrapper });
|
|
129
|
-
await flush();
|
|
130
|
-
unmountB();
|
|
131
|
-
// Remount A — should get A's cached data, not B's.
|
|
132
|
-
const { result } = renderHook(() => useFetch(vi.fn(async () => "fresh-A"), [], null, { cacheKey: "session:A" }), { wrapper });
|
|
133
|
-
expect(result.current.data).toBe("session-A");
|
|
134
|
-
expect(result.current.isLoading).toBe(false);
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
//# sourceMappingURL=useFetch-cache.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFetch-cache.test.js","sourceRoot":"","sources":["../../../src/internal/__tests__/useFetch-cache.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAiB,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,QAAQ,E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EX,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,UAAU,CACtC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,EAC3D,EAAE,OAAO,EAAE,CACZ,CAAC;QACF,MAAM,KAAK,EAAE,CAAC;QACd,QAAQ,EAAE,CAAC;QAEX,mDAAmD;QACnD,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAC3B,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,EACjF,EAAE,OAAO,EAAE,CACZ,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFetch-identity-reset.test.d.ts","sourceRoot":"","sources":["../../../src/internal/__tests__/useFetch-identity-reset.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from "vitest";
|
|
2
|
-
import { renderHook, act } from "@testing-library/react";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { FetchCacheContext } from "../FetchCacheProvider";
|
|
5
|
-
import { FetchCache } from "../fetch-cache";
|
|
6
|
-
import { useFetch } from "../useFetch";
|
|
7
|
-
// ---------------------------------------------------------------------------
|
|
8
|
-
// Helpers
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
|
-
async function flush() {
|
|
11
|
-
await act(async () => {
|
|
12
|
-
await Promise.resolve();
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
function createCacheWrapper(cache) {
|
|
16
|
-
return function Wrapper({ children }) {
|
|
17
|
-
return createElement(FetchCacheContext.Provider, { value: cache }, children);
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
// ---------------------------------------------------------------------------
|
|
21
|
-
// Tests: useFetch resets data on identity (dep) change
|
|
22
|
-
//
|
|
23
|
-
// These tests verify the Layer 1 fix for the premature worker shutdown bug.
|
|
24
|
-
// When deps change (e.g. executionId switches from A→B), useFetch must NOT
|
|
25
|
-
// keep showing A's terminal-phase data while B's fetch is in flight — that
|
|
26
|
-
// stale data caused useWorkflowExecution's termination effect to fire
|
|
27
|
-
// onWorkflowExecutionTerminated(B) using A's completed phase.
|
|
28
|
-
// ---------------------------------------------------------------------------
|
|
29
|
-
describe("useFetch — identity reset on dep change (no cache)", () => {
|
|
30
|
-
it("resets data to initialData when deps change without cache", async () => {
|
|
31
|
-
let currentId = "exec-A";
|
|
32
|
-
const results = {
|
|
33
|
-
"exec-A": "data-A",
|
|
34
|
-
"exec-B": "data-B",
|
|
35
|
-
};
|
|
36
|
-
const fetchFn = vi.fn(async () => results[currentId]);
|
|
37
|
-
const { result, rerender } = renderHook(() => useFetch(fetchFn, [currentId], "init"));
|
|
38
|
-
await flush();
|
|
39
|
-
expect(result.current.data).toBe("data-A");
|
|
40
|
-
// Switch identity — simulate navigating from execution A to B
|
|
41
|
-
currentId = "exec-B";
|
|
42
|
-
rerender();
|
|
43
|
-
// Immediately after dep change, data should reset to initialData
|
|
44
|
-
// (not keep stale "data-A")
|
|
45
|
-
expect(result.current.data).toBe("init");
|
|
46
|
-
await flush();
|
|
47
|
-
expect(result.current.data).toBe("data-B");
|
|
48
|
-
});
|
|
49
|
-
it("resets data between rapid identity switches", async () => {
|
|
50
|
-
let currentId = "id-1";
|
|
51
|
-
const fetchFn = vi.fn(async () => `result-${currentId}`);
|
|
52
|
-
const { result, rerender } = renderHook(() => useFetch(fetchFn, [currentId], null));
|
|
53
|
-
await flush();
|
|
54
|
-
expect(result.current.data).toBe("result-id-1");
|
|
55
|
-
// Switch to id-2
|
|
56
|
-
currentId = "id-2";
|
|
57
|
-
rerender();
|
|
58
|
-
expect(result.current.data).toBeNull();
|
|
59
|
-
await flush();
|
|
60
|
-
expect(result.current.data).toBe("result-id-2");
|
|
61
|
-
// Switch to id-3
|
|
62
|
-
currentId = "id-3";
|
|
63
|
-
rerender();
|
|
64
|
-
expect(result.current.data).toBeNull();
|
|
65
|
-
await flush();
|
|
66
|
-
expect(result.current.data).toBe("result-id-3");
|
|
67
|
-
});
|
|
68
|
-
it("does not leak old data during slow fetch on dep change", async () => {
|
|
69
|
-
let resolveFetch = null;
|
|
70
|
-
let currentId = "slow-A";
|
|
71
|
-
const fetchFn = vi.fn(() => new Promise((resolve) => {
|
|
72
|
-
resolveFetch = resolve;
|
|
73
|
-
}));
|
|
74
|
-
const { result, rerender } = renderHook(() => useFetch(fetchFn, [currentId], "init"));
|
|
75
|
-
// Resolve initial fetch
|
|
76
|
-
await act(async () => {
|
|
77
|
-
resolveFetch("data-slow-A");
|
|
78
|
-
await Promise.resolve();
|
|
79
|
-
});
|
|
80
|
-
expect(result.current.data).toBe("data-slow-A");
|
|
81
|
-
// Switch dep — new slow fetch starts
|
|
82
|
-
currentId = "slow-B";
|
|
83
|
-
rerender();
|
|
84
|
-
// Data must be reset to initialData, NOT keep "data-slow-A"
|
|
85
|
-
expect(result.current.data).toBe("init");
|
|
86
|
-
expect(result.current.isLoading).toBe(true);
|
|
87
|
-
// Resolve the second fetch
|
|
88
|
-
await act(async () => {
|
|
89
|
-
resolveFetch("data-slow-B");
|
|
90
|
-
await Promise.resolve();
|
|
91
|
-
});
|
|
92
|
-
expect(result.current.data).toBe("data-slow-B");
|
|
93
|
-
expect(result.current.isLoading).toBe(false);
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
describe("useFetch — identity reset on dep change (with cache)", () => {
|
|
97
|
-
it("shows cached data for new key if available, not stale data from old key", async () => {
|
|
98
|
-
const cache = new FetchCache();
|
|
99
|
-
const wrapper = createCacheWrapper(cache);
|
|
100
|
-
// Pre-populate cache for both keys
|
|
101
|
-
cache.set("exec:A", "cached-A");
|
|
102
|
-
cache.set("exec:B", "cached-B");
|
|
103
|
-
let currentId = "A";
|
|
104
|
-
const fetchFn = vi.fn(async () => `fresh-${currentId}`);
|
|
105
|
-
const { result, rerender } = renderHook(() => useFetch(fetchFn, [currentId], null, {
|
|
106
|
-
cacheKey: `exec:${currentId}`,
|
|
107
|
-
}), { wrapper });
|
|
108
|
-
// Initial mount: cache hit for A
|
|
109
|
-
expect(result.current.data).toBe("cached-A");
|
|
110
|
-
await flush();
|
|
111
|
-
expect(result.current.data).toBe("fresh-A");
|
|
112
|
-
// Switch to B — should show cached-B, NOT stale fresh-A
|
|
113
|
-
currentId = "B";
|
|
114
|
-
rerender();
|
|
115
|
-
expect(result.current.data).toBe("cached-B");
|
|
116
|
-
await flush();
|
|
117
|
-
expect(result.current.data).toBe("fresh-B");
|
|
118
|
-
});
|
|
119
|
-
it("falls back to initialData on cache miss for new key", async () => {
|
|
120
|
-
const cache = new FetchCache();
|
|
121
|
-
const wrapper = createCacheWrapper(cache);
|
|
122
|
-
// Only populate cache for A
|
|
123
|
-
cache.set("exec:A", "cached-A");
|
|
124
|
-
let currentId = "A";
|
|
125
|
-
const fetchFn = vi.fn(async () => `fresh-${currentId}`);
|
|
126
|
-
const { result, rerender } = renderHook(() => useFetch(fetchFn, [currentId], null, {
|
|
127
|
-
cacheKey: `exec:${currentId}`,
|
|
128
|
-
}), { wrapper });
|
|
129
|
-
await flush();
|
|
130
|
-
expect(result.current.data).toBe("fresh-A");
|
|
131
|
-
// Switch to B — no cache entry, should show initialData (null)
|
|
132
|
-
currentId = "B";
|
|
133
|
-
rerender();
|
|
134
|
-
expect(result.current.data).toBeNull();
|
|
135
|
-
expect(result.current.isLoading).toBe(true);
|
|
136
|
-
await flush();
|
|
137
|
-
expect(result.current.data).toBe("fresh-B");
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
describe("useFetch — cancelled fetch from previous identity", () => {
|
|
141
|
-
it("ignores resolved data from a cancelled previous-identity fetch", async () => {
|
|
142
|
-
let resolvers = [];
|
|
143
|
-
let callIdx = 0;
|
|
144
|
-
let currentId = "id-X";
|
|
145
|
-
const fetchFn = vi.fn(() => new Promise((resolve) => {
|
|
146
|
-
resolvers[callIdx++] = resolve;
|
|
147
|
-
}));
|
|
148
|
-
const { result, rerender } = renderHook(() => useFetch(fetchFn, [currentId], "init"));
|
|
149
|
-
// First fetch is in flight (for id-X)
|
|
150
|
-
expect(result.current.isLoading).toBe(true);
|
|
151
|
-
// Switch to id-Y before id-X resolves
|
|
152
|
-
currentId = "id-Y";
|
|
153
|
-
rerender();
|
|
154
|
-
expect(result.current.data).toBe("init");
|
|
155
|
-
// Resolve the OLD fetch (id-X) — should be ignored
|
|
156
|
-
await act(async () => {
|
|
157
|
-
resolvers[0]("stale-data-X");
|
|
158
|
-
await Promise.resolve();
|
|
159
|
-
});
|
|
160
|
-
// Data should still be "init" (waiting for id-Y), not "stale-data-X"
|
|
161
|
-
// The id-Y fetch is still in flight
|
|
162
|
-
expect(result.current.data).not.toBe("stale-data-X");
|
|
163
|
-
// Resolve the NEW fetch (id-Y)
|
|
164
|
-
await act(async () => {
|
|
165
|
-
resolvers[1]("fresh-data-Y");
|
|
166
|
-
await Promise.resolve();
|
|
167
|
-
});
|
|
168
|
-
expect(result.current.data).toBe("fresh-data-Y");
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
// ---------------------------------------------------------------------------
|
|
172
|
-
// Tests: refetch() preserves stale data (no skeleton flash)
|
|
173
|
-
//
|
|
174
|
-
// These tests verify that imperative refetch() — triggered by the sidebar's
|
|
175
|
-
// navigation effect and staggered timers — does NOT reset data or flash
|
|
176
|
-
// isLoading. The stale-while-revalidate contract requires that existing
|
|
177
|
-
// data remains visible during background refetches, with only isRefetching
|
|
178
|
-
// signaling the in-flight state.
|
|
179
|
-
// ---------------------------------------------------------------------------
|
|
180
|
-
describe("useFetch — refetch preserves stale data (no skeleton flash)", () => {
|
|
181
|
-
it("keeps stale data visible during refetch (no cacheKey)", async () => {
|
|
182
|
-
let callCount = 0;
|
|
183
|
-
const fetchFn = vi.fn(async () => `data-${++callCount}`);
|
|
184
|
-
const { result } = renderHook(() => useFetch(fetchFn, [], "init"));
|
|
185
|
-
await flush();
|
|
186
|
-
expect(result.current.data).toBe("data-1");
|
|
187
|
-
expect(result.current.isLoading).toBe(false);
|
|
188
|
-
// Trigger refetch — stale data must stay visible
|
|
189
|
-
act(() => result.current.refetch());
|
|
190
|
-
expect(result.current.data).toBe("data-1");
|
|
191
|
-
expect(result.current.isLoading).toBe(false);
|
|
192
|
-
expect(result.current.isRefetching).toBe(true);
|
|
193
|
-
await flush();
|
|
194
|
-
expect(result.current.data).toBe("data-2");
|
|
195
|
-
expect(result.current.isRefetching).toBe(false);
|
|
196
|
-
});
|
|
197
|
-
it("keeps isLoading false across multiple consecutive refetches", async () => {
|
|
198
|
-
let callCount = 0;
|
|
199
|
-
const fetchFn = vi.fn(async () => `v${++callCount}`);
|
|
200
|
-
const { result } = renderHook(() => useFetch(fetchFn, [], "init"));
|
|
201
|
-
await flush();
|
|
202
|
-
expect(result.current.data).toBe("v1");
|
|
203
|
-
// Three rapid refetches — none should flash isLoading
|
|
204
|
-
for (let i = 0; i < 3; i++) {
|
|
205
|
-
act(() => result.current.refetch());
|
|
206
|
-
expect(result.current.isLoading).toBe(false);
|
|
207
|
-
expect(result.current.data).not.toBe("init");
|
|
208
|
-
await flush();
|
|
209
|
-
}
|
|
210
|
-
expect(result.current.data).toBe("v4");
|
|
211
|
-
});
|
|
212
|
-
it("correctly resets on identity dep change after refetch", async () => {
|
|
213
|
-
let currentId = "A";
|
|
214
|
-
const fetchFn = vi.fn(async () => `data-${currentId}`);
|
|
215
|
-
const { result, rerender } = renderHook(() => useFetch(fetchFn, [currentId], "init"));
|
|
216
|
-
await flush();
|
|
217
|
-
expect(result.current.data).toBe("data-A");
|
|
218
|
-
// Refetch — should preserve stale data
|
|
219
|
-
act(() => result.current.refetch());
|
|
220
|
-
expect(result.current.data).toBe("data-A");
|
|
221
|
-
expect(result.current.isLoading).toBe(false);
|
|
222
|
-
await flush();
|
|
223
|
-
// Identity dep change — should reset to initialData
|
|
224
|
-
currentId = "B";
|
|
225
|
-
rerender();
|
|
226
|
-
expect(result.current.data).toBe("init");
|
|
227
|
-
expect(result.current.isLoading).toBe(true);
|
|
228
|
-
await flush();
|
|
229
|
-
expect(result.current.data).toBe("data-B");
|
|
230
|
-
expect(result.current.isLoading).toBe(false);
|
|
231
|
-
});
|
|
232
|
-
it("preserves stale data during slow refetch", async () => {
|
|
233
|
-
let resolveFetch = null;
|
|
234
|
-
let callCount = 0;
|
|
235
|
-
const fetchFn = vi.fn(() => new Promise((resolve) => {
|
|
236
|
-
resolveFetch = resolve;
|
|
237
|
-
}));
|
|
238
|
-
const { result } = renderHook(() => useFetch(fetchFn, [], "init"));
|
|
239
|
-
// Resolve initial fetch
|
|
240
|
-
await act(async () => {
|
|
241
|
-
resolveFetch("first");
|
|
242
|
-
await Promise.resolve();
|
|
243
|
-
});
|
|
244
|
-
expect(result.current.data).toBe("first");
|
|
245
|
-
// Trigger refetch — slow fetch starts, stale data stays
|
|
246
|
-
act(() => result.current.refetch());
|
|
247
|
-
expect(result.current.data).toBe("first");
|
|
248
|
-
expect(result.current.isLoading).toBe(false);
|
|
249
|
-
expect(result.current.isRefetching).toBe(true);
|
|
250
|
-
// Resolve the refetch
|
|
251
|
-
await act(async () => {
|
|
252
|
-
resolveFetch("second");
|
|
253
|
-
await Promise.resolve();
|
|
254
|
-
});
|
|
255
|
-
expect(result.current.data).toBe("second");
|
|
256
|
-
expect(result.current.isRefetching).toBe(false);
|
|
257
|
-
});
|
|
258
|
-
it("does not flash skeleton during refetchInterval polling", async () => {
|
|
259
|
-
vi.useFakeTimers();
|
|
260
|
-
let callCount = 0;
|
|
261
|
-
const fetchFn = vi.fn(async () => `poll-${++callCount}`);
|
|
262
|
-
const { result } = renderHook(() => useFetch(fetchFn, [], "init", { refetchInterval: 1000 }));
|
|
263
|
-
await flush();
|
|
264
|
-
expect(result.current.data).toBe("poll-1");
|
|
265
|
-
expect(result.current.isLoading).toBe(false);
|
|
266
|
-
// Advance past poll interval — data should update without skeleton
|
|
267
|
-
await act(async () => {
|
|
268
|
-
await vi.advanceTimersByTimeAsync(1000);
|
|
269
|
-
});
|
|
270
|
-
expect(result.current.isLoading).toBe(false);
|
|
271
|
-
expect(result.current.data).toBe("poll-2");
|
|
272
|
-
// Another tick
|
|
273
|
-
await act(async () => {
|
|
274
|
-
await vi.advanceTimersByTimeAsync(1000);
|
|
275
|
-
});
|
|
276
|
-
expect(result.current.isLoading).toBe(false);
|
|
277
|
-
expect(result.current.data).toBe("poll-3");
|
|
278
|
-
vi.useRealTimers();
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
//# sourceMappingURL=useFetch-identity-reset.test.js.map
|