@flanksource/clicky-ui 0.3.52 → 0.3.54
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/dist/components/clipboard.cjs +76 -11
- package/dist/components/clipboard.cjs.map +1 -1
- package/dist/components/clipboard.d.ts +37 -6
- package/dist/components/clipboard.d.ts.map +1 -1
- package/dist/components/clipboard.js +75 -12
- package/dist/components/clipboard.js.map +1 -1
- package/dist/components.cjs +2 -0
- package/dist/components.d.ts +1 -1
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +2 -2
- package/dist/data/MatrixTreeTable.cjs +94 -0
- package/dist/data/MatrixTreeTable.cjs.map +1 -0
- package/dist/data/MatrixTreeTable.d.ts +40 -0
- package/dist/data/MatrixTreeTable.d.ts.map +1 -0
- package/dist/data/MatrixTreeTable.js +92 -0
- package/dist/data/MatrixTreeTable.js.map +1 -0
- package/dist/data/TaskManager.cjs +39 -32
- package/dist/data/TaskManager.cjs.map +1 -1
- package/dist/data/TaskManager.d.ts +6 -1
- package/dist/data/TaskManager.d.ts.map +1 -1
- package/dist/data/TaskManager.js +39 -32
- package/dist/data/TaskManager.js.map +1 -1
- package/dist/data/TreeDataTable.cjs +52 -0
- package/dist/data/TreeDataTable.cjs.map +1 -0
- package/dist/data/TreeDataTable.d.ts +17 -0
- package/dist/data/TreeDataTable.d.ts.map +1 -0
- package/dist/data/TreeDataTable.js +52 -0
- package/dist/data/TreeDataTable.js.map +1 -0
- package/dist/data/clicky-export/ClickyExportDialog.cjs +4 -3
- package/dist/data/clicky-export/ClickyExportDialog.cjs.map +1 -1
- package/dist/data/clicky-export/ClickyExportDialog.d.ts +4 -1
- package/dist/data/clicky-export/ClickyExportDialog.d.ts.map +1 -1
- package/dist/data/clicky-export/ClickyExportDialog.js +4 -3
- package/dist/data/clicky-export/ClickyExportDialog.js.map +1 -1
- package/dist/data/test-runner/MatrixMarks.cjs +212 -0
- package/dist/data/test-runner/MatrixMarks.cjs.map +1 -0
- package/dist/data/test-runner/MatrixMarks.d.ts +76 -0
- package/dist/data/test-runner/MatrixMarks.d.ts.map +1 -0
- package/dist/data/test-runner/MatrixMarks.js +205 -0
- package/dist/data/test-runner/MatrixMarks.js.map +1 -0
- package/dist/data/test-runner/TestDetailPanel.cjs +3 -0
- package/dist/data/test-runner/TestDetailPanel.cjs.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.d.ts.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.js +3 -0
- package/dist/data/test-runner/TestDetailPanel.js.map +1 -1
- package/dist/data/test-runner/index.d.ts +2 -0
- package/dist/data/test-runner/index.d.ts.map +1 -1
- package/dist/data/test-runner/matrix-marks.cjs +119 -0
- package/dist/data/test-runner/matrix-marks.cjs.map +1 -0
- package/dist/data/test-runner/matrix-marks.d.ts +154 -0
- package/dist/data/test-runner/matrix-marks.d.ts.map +1 -0
- package/dist/data/test-runner/matrix-marks.js +113 -0
- package/dist/data/test-runner/matrix-marks.js.map +1 -0
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +27 -0
- package/dist/data.d.ts +3 -0
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +6 -1
- package/dist/hooks/use-task-run.cjs +22 -9
- package/dist/hooks/use-task-run.cjs.map +1 -1
- package/dist/hooks/use-task-run.d.ts +2 -0
- package/dist/hooks/use-task-run.d.ts.map +1 -1
- package/dist/hooks/use-task-run.js +22 -9
- package/dist/hooks/use-task-run.js.map +1 -1
- package/dist/index.cjs +29 -0
- package/dist/index.js +7 -2
- package/dist/lib/tree-rows.cjs +63 -0
- package/dist/lib/tree-rows.cjs.map +1 -0
- package/dist/lib/tree-rows.d.ts +36 -0
- package/dist/lib/tree-rows.d.ts.map +1 -0
- package/dist/lib/tree-rows.js +60 -0
- package/dist/lib/tree-rows.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/data.js
CHANGED
|
@@ -638,6 +638,9 @@ import { LogViewer } from "./data/LogViewer.js";
|
|
|
638
638
|
import { normalizeLogsTableRows } from "./data/logs-normalize.js";
|
|
639
639
|
import { LogsTable } from "./data/LogsTable.js";
|
|
640
640
|
import { MatrixTable } from "./data/MatrixTable.js";
|
|
641
|
+
import { collectTreeKeys, expandAllTree, visibleTreeRows } from "./lib/tree-rows.js";
|
|
642
|
+
import { MatrixTreeTable, TreeRowLead, TreeRowToggle } from "./data/MatrixTreeTable.js";
|
|
643
|
+
import { TreeDataTable } from "./data/TreeDataTable.js";
|
|
641
644
|
import { countObjectGraphNodes, pruneNullNodes } from "./data/object-graph-nodes.js";
|
|
642
645
|
import { ObjectGraph } from "./data/ObjectGraph.js";
|
|
643
646
|
import { ExecutionTree } from "./data/ExecutionTree.js";
|
|
@@ -720,6 +723,8 @@ import { TestRunSummary } from "./data/test-runner/TestRunSummary.js";
|
|
|
720
723
|
import { TestFilterBar } from "./data/test-runner/TestFilterBar.js";
|
|
721
724
|
import { TestRunner } from "./data/test-runner/TestRunner.js";
|
|
722
725
|
import { TestAttempts } from "./data/test-runner/TestAttempts.js";
|
|
726
|
+
import { MATRIX_MARKS, MATRIX_ORDER, MATRIX_PLAN_BAR, formatMatrixDuration, matrixBarClass, matrixMarkKey, repeatsMark } from "./data/test-runner/matrix-marks.js";
|
|
727
|
+
import { EmptyMatrixCell, EnvChip, MatrixElapsed, MatrixEnvHeader, MatrixLegend, MatrixMark, MatrixMix, MatrixUnavailableEnvHeader } from "./data/test-runner/MatrixMarks.js";
|
|
723
728
|
import { annotateRoutePaths, findNodeByRoutePath, slugify } from "./data/test-runner/routePath.js";
|
|
724
729
|
import { collectFolderLintStats, folderPattern, lintFileActions, lintFolderActions, lintNodeActions, violationIgnoreAction } from "./data/lint/actions.js";
|
|
725
730
|
import { collectLintLinters, countLintByLinter, countLintBySeverity, isLinterErrored, lintNodeCount, lintNodeSeverity, totalLintViolations } from "./data/lint/stats.js";
|
|
@@ -783,4 +788,4 @@ import { SAMPLE_FACETS, SAMPLE_FACET_ORDER, armedFacets, diskSeries, facetCountS
|
|
|
783
788
|
import { ProcessFacetTable } from "./data/traces/ProcessFacetTable.js";
|
|
784
789
|
import { ProcessTraceDetail } from "./data/traces/ProcessTraceDetail.js";
|
|
785
790
|
import { TraceWindowList } from "./data/traces/TraceWindowList.js";
|
|
786
|
-
export { AccessMark, AnsiHtml, Avatar, AvatarBadge, Badge, CALLOUT_TONES, CALLOUT_VARIANTS, CALLOUT_VARIANT_LABELS, CALL_GRAPH_ACCESS, CALL_GRAPH_DATA_GLYPHS, DATA_KIND_WORDS as CALL_GRAPH_DATA_KIND_WORDS, CALL_GRAPH_DEFAULT_DEPTH, EXCLUDE_EXTERNAL as CALL_GRAPH_EXCLUDE_EXTERNAL, CALL_GRAPH_MAX_DEPTH, CacheAdapterRegistry, CacheBrowser, CacheDetailPanel, CacheNodeRow, CacheStatsOverview, CacheTree, CacheValue, CallGraph, Callout, CellFilterActions, ClickyExportDialog, CodeBlock, CodeDiff, CodeLine, CompactRecord, CompactRecordList, CopyBadge, DATA_MEMBER_OWNER, DATA_TABLE_FILTER_LOOKUP_LIMIT, DEBUG_CAPTURE_HEADER, DEBUG_REFRESH_INSPECTION_HEADER, DEFAULT_LINT_GROUPING, DataTable, DetailTabSelectProvider, DiagnosticsDetailPanel, DiagnosticsTree, EntityCell, ErrorDetails, ExecutionTree, Expectation, FilterPill, FilterPillGroup, FilterSeparator, FixtureEditor, FrameSourceWindow, GROUP_MEMBER_WINDOW, Gauge, GaugeHoverCard, GitBranchPicker, GitChangedFilesSummary, GitCommitList, GitCommitPicker, GitConnectionPicker, GitDiffPanel, GitFileList, GitFilePicker, GitPathPicker, GitPipelineExecutionPicker, GitPipelinePicker, GitRefPicker, GitRepositoryPicker, GitSourcePicker, GoProfileView, GoroutineCard, GraphDiagram, HarEntryDetails, HarPanel, Icon, JsonView, JvmStackTrace, KeyValueList, LINT_GROUPINGS, LINT_GROUPING_OPTIONS, LINT_SEVERITIES, LabelIcon, LabeledSparkline, LintDetailPanel, LintFilterBar, LintResults, LintSeverityIcon, LintTreeNode, LogViewer, LogsTable, MARKDOWN_EDITOR_PREVIEW_FORMATS, MARKDOWN_SYNTAX_DOCUMENT, MARKDOWN_SYNTAX_SECTIONS, MAX_INLINE_SELECTION_ACTIONS, Markdown, MarkdownEditor, MatrixTable, MethodBadge, MetricTile, ObjectGraph, OutcomeIcon, PrettyStackTrace, ProcessFacetTable, ProcessNotFoundError, ProcessTraceDetail, ProcessTraceTree, ProfileTopTable, ProgressBar, ProgressBars, PromptBanner, PromptDialog, Properties, QueryBrowser, QueryBrowserExecutionError, RUNTIME_PREFIXES, RadialGauge, SAMPLE_FACETS, SAMPLE_FACET_ORDER, STATUS_LABELS, STATUS_TOKEN_GROUPS, SchemaViewer as SchemaBrowser, SchemaFieldMetaPanel, SchemaReference, SchemaViewer, SchemaViewerRow, SelectionActionBar, ServerTimingBadge, SignedDeltaBar, SortableHeader, Sparkline, SqlTraceTable, StackDumpView, StackFrameRow, StackTrace, StackedStatusBar, StatStrip, StatusDot, StatusRows, StepKindSections, StepOutputs, StepWait, SymbolBadge, TEST_OUTCOMES, TEST_TOOLS, TabButton, TagActionsProvider, TagList, TaskManager, TaskManagerButton, TaskMetadata, TaskMetadataChips, TaskProgress, TaskStreamTabs, TerminalCastPlayer, TestAttemptDetail, TestAttempts, TestDetailPanel, TestFailureDetail, TestFilterBar, TestNodeAdapterRegistry, TestOutput, TestRunSummary, TestRunner, TestRunnerProvider, TestTree, TestTreeNode, ThreadCard, Timeline, TimeseriesCoreBars, TimeseriesGauge, TimeseriesPanel, Timestamp, ToolIcon, TraceHarView, TraceView, TraceWindowList, Tree, TreeGroupHeader, TreeNode, UIR_CALL_GRAPH_VOCABULARY, UiAccessProtected, UiAccessProtectedDark, UiAccessPublic, UiAccessPublicDark, UiActivity, UiAdd, UiAddChangeset, UiAddChangesetDark, UiAddFilled, UiAggregate, UiAggregateDark, UiAlias, UiAliasDark, UiAnnotation, UiAnnotationDark, UiAopAroundAdvice, UiAopBeforeAdvice, UiAopPointcut, UiArchive, UiArchiveFilled, UiArray, UiArrowDown, UiArrowDownFilled, UiArrowDownRight, UiArrowFatUp, UiArrowFatUpFilled, UiArrowLeft, UiArrowLeftFilled, UiArrowRight, UiArrowRightFilled, UiArrowUp, UiArrowUpFilled, UiArrowUpRight, UiArrowsCounterClockwise, UiArrowsCounterClockwiseFilled, UiArtifact, UiArtifactDark, UiAsterisk, UiAsteriskFilled, UiAsyncFn, UiAt, UiAtFilled, UiAtom, UiAtomFilled, UiAttachDebugger, UiAttachDebuggerDark, UiAttachToProcess, UiAttachToProcessDark, UiAuditLog, UiAzureRepos, UiBank, UiBankFilled, UiBatteryChargingVertical, UiBatteryChargingVerticalFilled, UiBatteryVerticalEmpty, UiBatteryVerticalEmptyFilled, UiBatteryVerticalFull, UiBatteryVerticalFullFilled, UiBatteryVerticalHigh, UiBatteryVerticalHighFilled, UiBatteryVerticalLow, UiBatteryVerticalLowFilled, UiBatteryVerticalMedium, UiBatteryVerticalMediumFilled, UiBeaker, UiBeakerFilled, UiBell, UiBellFilled, UiBellSlash, UiBellSlashFilled, UiBinary, UiBinaryFilled, UiBlueKey, UiBlueKeyDark, UiBoolean, UiBox, UiBoxFilled, UiBoxes, UiBoxesFilled, UiBraces, UiBrain, UiBrainFilled, UiBreakpoint, UiBreakpoint1, UiBreakpoint1Dark, UiBreakpoint2, UiBreakpoint2Dark, UiBreakpoint3, UiBreakpoint3Dark, UiBreakpoint4, UiBreakpoint4Dark, UiBreakpointDisabled, UiBreakpointField, UiBreakpointMethod, UiBroadcast, UiBroadcastFilled, UiBug, UiBugFilled, UiCache, UiCalculator, UiCalendar, UiCalendarBlank, UiCalendarBlankFilled, UiCalendarCheck, UiCalendarCheckFilled, UiCalendarFilled, UiCamera, UiCameraFilled, UiCancel, UiCancelFilled, UiChartBar, UiChartBarFilled, UiChartLineUp, UiChartLineUpFilled, UiChartOfAccounts, UiChartOfAccountsFilled, UiChartPie, UiChartPieFilled, UiChatDots, UiChatDotsFilled, UiCheck, UiCheckConstraint, UiCheckConstraintDark, UiCheckFilled, UiChevronDown, UiChevronDownFilled, UiChevronRight, UiChevronRightFilled, UiChevronUp, UiChevronUpFilled, UiChevronsDown, UiChevronsDownFilled, UiChevronsUp, UiChevronsUpFilled, UiChip, UiChipFilled, UiCircleFilled, UiCircleFilledFilled, UiCircleOutline, UiCircleOutlineFilled, UiCircleX, UiCircleXFilled, UiClass, UiClass1, UiClass1Dark, UiClass2, UiClass2Dark, UiClass3, UiClass3Dark, UiClass4, UiClass4Dark, UiClass5, UiClass5Dark, UiClass6, UiClass6Dark, UiClass7, UiClass7Dark, UiClearCash, UiClearCashDark, UiClipboardText, UiClipboardTextFilled, UiClock, UiClockCountdown, UiClockCountdownFilled, UiClockFilled, UiClose, UiCloseFilled, UiCloud, UiCloudDownload, UiCloudDownloadFilled, UiCloudFilled, UiCloudUpload, UiCloudUploadFilled, UiCode2, UiCode2Filled, UiCog, UiCogFilled, UiCoins, UiCoinsFilled, UiCollapseAll, UiCollection, UiCollectionDark, UiCollectionType, UiCollectionTypeDark, UiColumn, UiColumn1, UiColumn1Dark, UiColumn2, UiColumn2Dark, UiColumn3, UiColumn3Dark, UiColumn4, UiColumn4Dark, UiColumn5, UiColumn5Dark, UiColumnDark, UiColumns, UiColumnsFilled, UiCommand, UiCommandFilled, UiComment, UiCompass, UiCompassFilled, UiConfig, UiConfigFilled, UiConfigMap, UiConfigMapDark, UiConnector, UiConnectorDark, UiConstant, UiConstant1, UiConstant1Dark, UiConstructor, UiConverter, UiConverter1, UiConverter1Dark, UiConverterDark, UiCopy, UiCopyFilled, UiCreateConstraint, UiCreateConstraintDark, UiCurrencyDollar, UiCurrencyDollarFilled, UiCursorClick, UiCursorClickFilled, UiCursorText, UiCursorTextFilled, UiCustomResource, UiCustomResourceDark, UiDataSchema, UiDataSchemaDark, UiDataShare, UiDataShareDark, UiDatabase, UiDatabaseCheck, UiDatabaseCheckFilled, UiDatabaseCross, UiDatabaseCrossFilled, UiDatabaseDown, UiDatabaseDownFilled, UiDatabaseError, UiDatabaseErrorFilled, UiDatabaseEventStream, UiDatabaseFilled, UiDatabaseInfo, UiDatabaseInfoFilled, UiDatabaseLink, UiDatabaseLinkDark, UiDatabaseMinus, UiDatabaseMinusFilled, UiDatabasePending, UiDatabasePendingFilled, UiDatabasePlus, UiDatabasePlusFilled, UiDatabaseTrash, UiDatabaseTrashFilled, UiDatabaseUp, UiDatabaseUpFilled, UiDatabaseWarning, UiDatabaseWarningFilled, UiDatabaseZap, UiDebug, UiDebugContinue, UiDebugDisabled, UiDebugDisabledDark, UiDebugFilled, UiDebugSelection, UiDebugSelectionDark, UiDebugSmall, UiDebugStepInto, UiDebugStepOut, UiDebugStepOver, UiDebugStop, UiDecorator, UiDeploy, UiDeployDark, UiDesktop, UiDesktopFilled, UiDetach, UiDetachDark, UiDiagramDiff, UiDiagramDiffDark, UiDiff, UiDotsVertical, UiDotsVerticalFilled, UiDownload, UiDownloadFilled, UiDumpThreads, UiDumpThreadsDark, UiEdit, UiEditFilled, UiEditMode, UiEditModeDark, UiEllipsis, UiEllipsisBold, UiEllipsisFilled, UiEndpoint, UiEnum, UiEnumMember, UiEnvelope, UiEnvelopeFilled, UiError, UiEvaluateExpression, UiEvaluateExpressionDark, UiEvent, UiException, UiExceptionAnalyzerImportant, UiExceptionAnalyzerImportantDark, UiExceptionDark, UiExcludedGenerated, UiExcludedGeneratedDark, UiExpandAll, UiExport, UiExtension, UiExtensionDark, UiExternalLink, UiEye, UiEyeClosed, UiEyeClosedFilled, UiEyeFilled, UiFactory, UiFactoryFilled, UiFailedInProgress, UiFailedInProgressDark, UiFastForwardCircle, UiFastForwardCircleFilled, UiField, UiField1, UiField1Dark, UiField2, UiField2Dark, UiField3, UiField3Dark, UiField4, UiField4Dark, UiField5, UiField5Dark, UiField6, UiField6Dark, UiFieldProtected, UiFieldReadAccess, UiFieldType, UiFieldWriteAccess, UiFile, UiFileCode, UiFileCodeFilled, UiFileCog, UiFileFilled, UiFileFormat, UiFileFormatDark, UiFileJson, UiFilePlus, UiFilePlusFilled, UiFileSearch, UiFileSpreadsheet, UiFileText, UiFileTextFilled, UiFileType, UiFilter, UiFilterFilled, UiFingerprint, UiFingerprintFilled, UiFolder, UiFolderFilled, UiFolderGit, UiFolderGit2, UiFolderGit2Filled, UiFolderGitFilled, UiForeignServer, UiForeignServerDark, UiForm, UiFormFilled, UiFreemarker, UiFreemarkerDark, UiFullscreen, UiFullscreenFilled, UiFunction, UiFunction1, UiFunction1Dark, UiFunction2, UiFunction2Dark, UiFunction3, UiFunction3Dark, UiFunction4, UiFunction4Dark, UiFunctionSquare, UiFunctionSquareFilled, UiFunnelData, UiFunnelDataFilled, UiGavel, UiGavelFilled, UiGearSix, UiGearSixFilled, UiGitBranch, UiGitBranchFilled, UiGitCommit, UiGitCommitFilled, UiGitGraph, UiGitGraphFilled, UiGitMerge, UiGitMergeFilled, UiGitPr, UiGitPrFilled, UiGlobe, UiGraph, UiGraphFilled, UiGreyKey, UiGreyKeyDark, UiGrid, UiGridFilled, UiGroupByModuleGroup, UiGroupByModuleGroupDark, UiGroupByPackage, UiGroupByPackageDark, UiGroupByTestProduction, UiGroupByTestProductionDark, UiHandCoins, UiHandCoinsFilled, UiHandPalm, UiHandPalmFilled, UiHardDrive, UiHibernate, UiHibernateDark, UiHibernateEvent, UiHibernateEventDark, UiHistory, UiHistoryFilled, UiHome, UiHomeFilled, UiHourglass, UiHourglassFilled, UiHubot, UiHubotFilled, UiId, UiIdDark, UiIdentificationCard, UiIdentificationCardFilled, UiImage, UiImageFilled, UiImport, UiInbox, UiInboxFilled, UiIndex, UiIndex1, UiIndex1Dark, UiIndex2, UiIndex2Dark, UiIndex3, UiIndex3Dark, UiIndex4, UiIndex4Dark, UiIndex5, UiIndex5Dark, UiIndex6, UiIndex6Dark, UiIndexDark, UiInfo, UiInfoFilled, UiInsightAvailability, UiInsightAvailabilityFilled, UiInsightCompliance, UiInsightCost, UiInsightCostFilled, UiInsightIntegration, UiInsightPerformance, UiInsightPerformanceFilled, UiInsightRecommendation, UiInsightRecommendationFilled, UiInsightReliability, UiInsightReliabilityFilled, UiInsightSecurity, UiInsightSecurityFilled, UiInsightTechnicalDebt, UiInsightTechnicalDebtFilled, UiInspectionsGrammar, UiInspectionsGrammarDark, UiInterface, UiInvoice, UiInvoiceFilled, UiJpaAttribute, UiJpaId, UiJpaRelationship, UiJson, UiKanban, UiKanbanFilled, UiKey, UiKeyFilled, UiKeyboard, UiKeyboardFilled, UiKeyword, UiKillDataSourceProcess, UiKillDataSourceProcessDark, UiKubeConfigMap, UiKubeDeployment, UiKubeJob, UiKubeNamespace, UiKubePod, UiLambda, UiLangJava, UiLangJavascript, UiLangPython, UiLayers, UiLayoutDashboard, UiLayoutDashboardFilled, UiLedger, UiLedgerFilled, UiLightbulb, UiLightbulbFilled, UiLink, UiLinkExternal, UiLinkExternalFilled, UiLinkFilled, UiListChecks, UiListChecksFilled, UiListDashes, UiListDashesFilled, UiListFlat, UiListFlatFilled, UiListOrdered, UiListTree, UiListTreeFilled, UiLoader, UiLoaderFilled, UiLocation, UiLocationFilled, UiLock, UiLockFilled, UiLockKey, UiLockKeyFilled, UiLockOpen, UiLockOpenFilled, UiLogoAnthropic, UiLogoClaude, UiLogoDeepseek, UiLogoEslint, UiLogoGemini, UiLogoGo, UiLogoGoogle, UiLogoHuggingface, UiLogoJest, UiLogoMarkdown, UiLogoMeta, UiLogoMistral, UiLogoOllama, UiLogoOpenai, UiLogoOxc, UiLogoPerplexity, UiLogoPlaywright, UiLogoPython, UiLogoReact, UiLogoRuff, UiLogoTypescript, UiLogoVitest, UiMagicWand, UiMagicWandFilled, UiMarkdown, UiMaterializedLog, UiMaterializedLogDark, UiMemoryProfile, UiMemoryStick, UiMenu, UiMenuFilled, UiMessageQueue, UiMessageQueue1, UiMessageQueue1Dark, UiMethod, UiMethod1, UiMethod10, UiMethod10Dark, UiMethod11, UiMethod11Dark, UiMethod1Dark, UiMethod2, UiMethod2Dark, UiMethod3, UiMethod3Dark, UiMethod4, UiMethod4Dark, UiMethod5, UiMethod5Dark, UiMethod6, UiMethod6Dark, UiMethod7, UiMethod7Dark, UiMethod8, UiMethod8Dark, UiMethod9, UiMethod9Dark, UiModels, UiModelsDark, UiModule, UiModule1, UiModule1Dark, UiMoon, UiMoonFilled, UiName, UiNameDark, UiNamespace, UiNetwork, UiNetworkFilled, UiNull, UiNumeric, UiObject, UiOpenBlock, UiOpenBlockDark, UiOpenScad, UiOperator, UiOperator1, UiOperator1Dark, UiOrganization, UiOrganizationCheck, UiOrganizationCheckFilled, UiOrganizationCross, UiOrganizationCrossFilled, UiOrganizationFilled, UiOrganizationMinus, UiOrganizationMinusFilled, UiOrganizationPlus, UiOrganizationPlusFilled, UiPackage, UiPackageFilled, UiPalette, UiPaletteFilled, UiParameter, UiPartition, UiPartitionDark, UiPass, UiPassFilled, UiPause, UiPauseCircle, UiPauseCircleFilled, UiPencilSimpleLine, UiPencilSimpleLineFilled, UiPending, UiPendingDark, UiPercent, UiPhone, UiPhoneFilled, UiPlay, UiPlayCircle, UiPlayCircleFilled, UiPlaybook, UiPlug, UiPluginModule, UiPluginModuleDark, UiPluginV2, UiPluginV2Dark, UiPlugsConnected, UiPlugsConnectedFilled, UiPointcut, UiPointcutDark, UiProcedure, UiProcedureDark, UiProfile, UiProfile1, UiProfile1Dark, UiProfile2, UiProfile2Dark, UiProfile3, UiProfile3Dark, UiProfile4, UiProfile4Dark, UiProfileDark, UiProfiler, UiProfilerBackTrace, UiProfilerMergeCallees, UiProhibit, UiProhibitFilled, UiProjectStructure, UiProjectStructureDark, UiProjection, UiProjectionDark, UiProperty, UiPulse, UiPulseFilled, UiPuzzle, UiPuzzleFilled, UiQuestion, UiQuestionFilled, UiQueue, UiQueueFilled, UiReadAccess, UiReadAccessDark, UiReceipt, UiReceiptFilled, UiRecord, UiRecord1, UiRecord1Dark, UiRefresh, UiRefreshFilled, UiRegex, UiRegexDark, UiRelationship, UiRelationshipDark, UiRelay, UiRelayDark, UiRemove, UiRemoveFilled, UiRepeat, UiRepeatFilled, UiResizeVertical, UiResizeVerticalFilled, UiRestart, UiRobotAi, UiRobotAiFilled, UiRocket, UiRocketFilled, UiRole, UiRoleDark, UiRollback, UiRollbackDark, UiRoute, UiRouteFilled, UiRoutine, UiRoutineDark, UiRows, UiRowsFilled, UiRun, UiRun1, UiRun10, UiRun10Dark, UiRun11, UiRun11Dark, UiRun12, UiRun12Dark, UiRun13, UiRun13Dark, UiRun14, UiRun14Dark, UiRun1Dark, UiRun2, UiRun2Dark, UiRun3, UiRun3Dark, UiRun4, UiRun4Dark, UiRun5, UiRun5Dark, UiRun6, UiRun6Dark, UiRun7, UiRun7Dark, UiRun8, UiRun8Dark, UiRun9, UiRun9Dark, UiRunDark, UiSave, UiSaveFilled, UiScale, UiScan, UiScanFilled, UiScroll, UiScrollFilled, UiSealCheck, UiSealCheckFilled, UiSearch, UiSecurityRole, UiSecurityRoleDark, UiSelect, UiSelectFilled, UiSequence, UiSequence1, UiSequence1Dark, UiSequence2, UiSequence2Dark, UiSequence3, UiSequence3Dark, UiSequence4, UiSequence4Dark, UiSequenceDark, UiServer, UiServerProcess, UiServerProcessFilled, UiSetKey, UiSetKeyDark, UiSeverityBlocker, UiSeverityBlockerFilled, UiSeverityCritical, UiSeverityCriticalFilled, UiSeverityHigh, UiSeverityHighFilled, UiSeverityInfo, UiSeverityInfoFilled, UiSeverityLow, UiSeverityLowFilled, UiSeverityMedium, UiSeverityMediumFilled, UiSeverityWarning, UiSeverityWarningFilled, UiShare, UiShareFilled, UiShield, UiShieldCheck, UiShieldCheckFilled, UiShieldCross, UiShieldCrossFilled, UiShieldFilled, UiShieldInfo, UiShieldInfoFilled, UiShieldMinus, UiShieldMinusFilled, UiShieldPending, UiShieldPendingFilled, UiShieldPlus, UiShieldPlusFilled, UiShieldSlash, UiShieldSlashFilled, UiShieldWarning, UiShieldWarningFilled, UiShipWheel, UiShortcutFilter, UiShortcutFilterDark, UiShowCurrentFrame, UiShowCurrentFrameDark, UiShowMembers, UiShowMembersDark, UiShowToImplement, UiShowToImplementDark, UiSidebar, UiSidebarFilled, UiSigma, UiSignIn, UiSignInFilled, UiSignOut, UiSignOutFilled, UiSiren, UiSirenFilled, UiSkipForward, UiSkipForwardFilled, UiSkull, UiSkullFilled, UiSliders, UiSlidersFilled, UiSortAlphabetically, UiSortAlphabeticallyDark, UiSortByType, UiSortByTypeDark, UiSortByUsage, UiSortByUsageDark, UiSortByVisibility, UiSortByVisibilityDark, UiSparkles, UiSparklesFilled, UiSpeaker, UiSpeakerFilled, UiSpringBoot, UiSpringBootDark, UiSqlArray, UiSqlColumn, UiSqlConstraint, UiSqlDatabase, UiSqlForeignKey, UiSqlFunction, UiSqlIndex, UiSqlPrimaryKey, UiSqlQuery, UiSqlSchema, UiSqlSequence, UiSqlStoredProc, UiSqlTable, UiSqlTableFilled, UiSqlTrigger, UiSqlView, UiSquare, UiSquareFilled, UiStack, UiStackFilled, UiStackFrameDot, UiStackTrace, UiStar, UiStarFilled, UiStartTimer, UiStartTimerDark, UiStatic, UiStaticDark, UiStep, UiStep1, UiStep1Dark, UiStep2, UiStep2Dark, UiStep3, UiStep3Dark, UiStep4, UiStep4Dark, UiStep5, UiStep5Dark, UiStep6, UiStep6Dark, UiStep7, UiStep7Dark, UiStep8, UiStep8Dark, UiStep9, UiStep9Dark, UiStepDark, UiSteps, UiStepsFilled, UiStop, UiStrategy, UiStrategyFilled, UiStream, UiStreamDark, UiStreamKey, UiStreamKeyDark, UiString, UiStruct, UiSubmitDB, UiSubmitDBDark, UiSubscription, UiSubscriptionDark, UiSun, UiSunFilled, UiSwap, UiSymbol, UiSymbolDark, UiSync, UiTable, UiTable1, UiTable10, UiTable10Dark, UiTable11, UiTable11Dark, UiTable12, UiTable12Dark, UiTable1Dark, UiTable2, UiTable2Dark, UiTable3, UiTable3Dark, UiTable4, UiTable4Dark, UiTable5, UiTable5Dark, UiTable6, UiTable6Dark, UiTable7, UiTable7Dark, UiTable8, UiTable8Dark, UiTable9, UiTable9Dark, UiTableFilled, UiTableProperties, UiTablePropertiesFilled, UiTag, UiTagFilled, UiTax, UiTaxFilled, UiTemplate, UiTemplateDark, UiTerminal, UiTerminalFilled, UiTest, UiTest1, UiTest1Dark, UiTest2, UiTest2Dark, UiTest3, UiTest3Dark, UiTest4, UiTest4Dark, UiTest5, UiTest5Dark, UiTest6, UiTest6Dark, UiTest7, UiTest7Dark, UiText, UiTextDark, UiThermometer, UiThermometerFilled, UiThumbsDown, UiThumbsDownFilled, UiThumbsUp, UiThumbsUpFilled, UiTimer, UiTimerFilled, UiToggleOff, UiToggleOffFilled, UiToggleOn, UiToggleOnFilled, UiTrait, UiTransactionStart, UiTransactionStartDark, UiTrash, UiTrashFilled, UiTrendDown, UiTrendDownFilled, UiTrendUp, UiTrendUpFilled, UiTypeAlias, UiTypeParameter, UiTypeScriptIndexSignature, UiTypeScriptIndexSignatureDark, UiUndeploy, UiUndeployDark, UiUnknown, UiUpload, UiUploadFilled, UiUser, UiUserCheck, UiUserCheckFilled, UiUserCircle, UiUserCircleCheck, UiUserCircleCheckFilled, UiUserCircleFilled, UiUserCircleMinus, UiUserCircleMinusFilled, UiUserCirclePlus, UiUserCirclePlusFilled, UiUserCog, UiUserFilled, UiUserGear, UiUserGearFilled, UiUserMinus, UiUserMinusFilled, UiUserPlus, UiUserPlusFilled, UiUsersFour, UiUsersFourFilled, UiUsersThree, UiUsersThreeCheck, UiUsersThreeCheckFilled, UiUsersThreeCross, UiUsersThreeCrossFilled, UiUsersThreeFilled, UiUsersThreeMinus, UiUsersThreeMinusFilled, UiUsersThreePlus, UiUsersThreePlusFilled, UiVariable, UiVariable1, UiVariable1Dark, UiVariable2, UiVariable2Dark, UiVariable3, UiVariable3Dark, UiVariable4, UiVariable4Dark, UiVariable5, UiVariable5Dark, UiVariable6, UiVariable6Dark, UiVideo, UiVideoFilled, UiVirtualForeignKey, UiVirtualForeignKeyDark, UiWarningCircle, UiWarningCircleFilled, UiWarningTriangle, UiWarningTriangleFilled, UiWatch, UiWatchFilled, UiWebArtifact, UiWebArtifactDark, UiWebServiceClient, UiWebServiceClientDark, UiWorkflow, UiWrench, UiWrenchFilled, UiWriteAccess, UiWriteAccessDark, UiXpath, UiXpath1, UiXpath1Dark, UiXpathDark, UiZap, UiZapFilled, UiZoomIn, UiZoomInFilled, UiZoomOut, UiZoomOutFilled, VerificationResults, Version, WorkloadCard, aggregateProfile, aggregateStatusCounts, allGroupsTerminal, annotateRoutePaths, answerPrompt, applyFixtureFrontmatterRaw, applyFixtureFrontmatterState, applyTaskOutputDelta, armedFacets, assertCalloutValue, assignAxes, attemptStatus, badgeVariants, baseAccess as baseCallGraphAccess, bucketTasks, buildBrief, buildLintTree, buildMarkdownPreviewUrl, buildNodeBrief, buildNodeJson, buildProcessForest, buildSchemaTree, buildSchemaViewerTree, buildStepBranchTree, cacheQueryKeys, callGraphGroupFacts, calloutVariantStyles, callsItself, changeIconAliases, chooseTimestampFormat, clickyFormatForMarkdownPreview, clickyIconProvider, clockTime, collapseSingleChildChains, collectFolderLintStats, collectFrameworks, collectLintLinters, columnsLayout, compactStackPath, computeLineDiff, countGoroutinesByState, countLintByLinter, countLintBySeverity, countObjectGraphNodes, countProcesses, countStackByState, countThreadsByState, cpuTone, createCacheClient, createCacheRegistry, createChecklistMarkdown, createFenceMarkdown, createTestRunnerRegistry, cycleFilterState, dataMemberAside, dataNodeBacking, dataNodeGlyph, dataNodeStatus, debugCaptureHeaders, debugConsoleAvailable, debugConsoleOpen, decodeFilterState, deriveProgressBars, detectDumpFormat, diskSeries, emptyLintFilters, emptyTaskStreams, emptyTestFilters, emptyVerifySummary, encodeFilterState, exchangeToHarEntry, facetCountSeries, filterStateToRecord, filterTests, findLintNode, findNodeByRoutePath, findProcessByPID, fixtureFenceKind, fixtureFenceSchemaAliases, fixtureFenceSnippetInfo, fixtureFrontmatterState, flattenForest, folderPattern, formatExclude as formatCallGraphExclude, formatCount, formatCpuPercent, formatDateTimeRelative, formatDelay, formatExportValue, formatGitCommitDateHeader, formatProcessTimestamp, formatProfileValue, formatPropertyLabel, formatRelativeTime, formatReplicaCounts, formatServerTimingDuration, formatStatementDuration, formatTestDuration, formatTimestamp, frameHasSource, frameLocation, genericCopySections, getChangeIcon, getVersionInfo, groupRecords, groupStatements, hasFailed, hasHoverMeta, hasPending, humanizeName, iconsByConsumerName, inferColumns, interfaceMethods, isApplicationStackFrame, isAttemptLive, isDataMember, isDataNode, isFailedOrWarn, isFlatMetadata, isGroupCollapsedByDefault, isLeaf, isLinterErrored, isMetadataLink, isProcessExited, isRuntimeFrame, isTerminalStatus, latestFacetReading, latestOf, lintFileActions, lintFolderActions, lintNodeActions, lintNodeCount, lintNodeSeverity, logLevelColor, markdownDocumentStats, matchesExclude as matchesCallGraphExclude, matchesFilterState, memoryTone, mergeAccess, mergeGraph as mergeCallGraph, mergeCopySections, mergeSeries, metadataEntries, mockMarkdownPreview, modeToFormat, normalizeErrorDiagnostics, normalizeLogsTableRows, normalizeStatus, normalizeTags, outcomeFor, parseBoundsValue, parseExclude as parseCallGraphExclude, parseCast, parseDiagnosticsStackTrace, parseDurationBoundsValue, parseFixtureFrontmatter, parseFixtureYaml, parseGoroutineDump, parseInlineJsonContextValue, parseJavaStackTrace, parseJvmThreadDump, parseMultiFilterValue, parseServerTiming, parseStackDump, parseTimestamp, parseUnifiedDiff, policySummary, prefixAdapter, processLabel, processLifetimeMs, processSeries, processStateColor, processStateIcon, profileValueTypes, programmingIconCatalog, pruneExitedProcesses, pruneNullNodes, readStepDetail, recordToFilterState, registerDebugConsole, resolveBreakdown, resolveFixtureFenceSchema, resolveSelectionActionDisplay, resolveSeries, revealDebugConsole, ringLayout, routeEdges, schemaKeys, segment, serializeBoundsValue, serializeDurationBoundsValue, serializeMultiFilterValue, seriesStats, serverColumnsToDataTableColumns, serverFiltersToFilterBar, serverTimingCounterSummary, serverTimingMetricLabel, setDebugCaptureLevel, setDebugConsoleOpen, setDebugRefreshInspection, setFallbackIconProvider, shortFrameName, slugify, splitCommaValues, splitSelectionActions, splitTagToken, stackCheckpoints, stacksThrough, statusToneFor, stringifyFixtureYaml, subscribeToDebugConsole, sum, sumNonTaskTests, summarizeVerifyNodes, tagActionsFromRecord, tagFilterTokens, taskGroupErrorCount, taskGroupErrors, taskGroupJson, taskGroupMarkdown, taskMarkdown, taskQueryKeys, taskSegments, taskStatusBg, taskStatusColor, taskStatusIcon, testAttemptViews, testStatus, toggleAccess as toggleCallGraphAccess, toolKeyFor, toolMark, totalDuration, totalLintViolations, updateFilterSelection, useClickyExport, useDebugAction, usePrompts, useSelectDetailTab, useTagActions, useTagActionsValue, useTestRunner, verificationAdapters, verifyNodeTest, verifyReportCounts, verifyReportTests, violationIgnoreAction, withTaskStreams, workloadKindLabel, workloadStatusLabel, workloadStatusTone, workloadTypeLabel };
|
|
791
|
+
export { AccessMark, AnsiHtml, Avatar, AvatarBadge, Badge, CALLOUT_TONES, CALLOUT_VARIANTS, CALLOUT_VARIANT_LABELS, CALL_GRAPH_ACCESS, CALL_GRAPH_DATA_GLYPHS, DATA_KIND_WORDS as CALL_GRAPH_DATA_KIND_WORDS, CALL_GRAPH_DEFAULT_DEPTH, EXCLUDE_EXTERNAL as CALL_GRAPH_EXCLUDE_EXTERNAL, CALL_GRAPH_MAX_DEPTH, CacheAdapterRegistry, CacheBrowser, CacheDetailPanel, CacheNodeRow, CacheStatsOverview, CacheTree, CacheValue, CallGraph, Callout, CellFilterActions, ClickyExportDialog, CodeBlock, CodeDiff, CodeLine, CompactRecord, CompactRecordList, CopyBadge, DATA_MEMBER_OWNER, DATA_TABLE_FILTER_LOOKUP_LIMIT, DEBUG_CAPTURE_HEADER, DEBUG_REFRESH_INSPECTION_HEADER, DEFAULT_LINT_GROUPING, DataTable, DetailTabSelectProvider, DiagnosticsDetailPanel, DiagnosticsTree, EmptyMatrixCell, EntityCell, EnvChip, ErrorDetails, ExecutionTree, Expectation, FilterPill, FilterPillGroup, FilterSeparator, FixtureEditor, FrameSourceWindow, GROUP_MEMBER_WINDOW, Gauge, GaugeHoverCard, GitBranchPicker, GitChangedFilesSummary, GitCommitList, GitCommitPicker, GitConnectionPicker, GitDiffPanel, GitFileList, GitFilePicker, GitPathPicker, GitPipelineExecutionPicker, GitPipelinePicker, GitRefPicker, GitRepositoryPicker, GitSourcePicker, GoProfileView, GoroutineCard, GraphDiagram, HarEntryDetails, HarPanel, Icon, JsonView, JvmStackTrace, KeyValueList, LINT_GROUPINGS, LINT_GROUPING_OPTIONS, LINT_SEVERITIES, LabelIcon, LabeledSparkline, LintDetailPanel, LintFilterBar, LintResults, LintSeverityIcon, LintTreeNode, LogViewer, LogsTable, MARKDOWN_EDITOR_PREVIEW_FORMATS, MARKDOWN_SYNTAX_DOCUMENT, MARKDOWN_SYNTAX_SECTIONS, MATRIX_MARKS, MATRIX_ORDER, MATRIX_PLAN_BAR, MAX_INLINE_SELECTION_ACTIONS, Markdown, MarkdownEditor, MatrixElapsed, MatrixEnvHeader, MatrixLegend, MatrixMark, MatrixMix, MatrixTable, MatrixTreeTable, MatrixUnavailableEnvHeader, MethodBadge, MetricTile, ObjectGraph, OutcomeIcon, PrettyStackTrace, ProcessFacetTable, ProcessNotFoundError, ProcessTraceDetail, ProcessTraceTree, ProfileTopTable, ProgressBar, ProgressBars, PromptBanner, PromptDialog, Properties, QueryBrowser, QueryBrowserExecutionError, RUNTIME_PREFIXES, RadialGauge, SAMPLE_FACETS, SAMPLE_FACET_ORDER, STATUS_LABELS, STATUS_TOKEN_GROUPS, SchemaViewer as SchemaBrowser, SchemaFieldMetaPanel, SchemaReference, SchemaViewer, SchemaViewerRow, SelectionActionBar, ServerTimingBadge, SignedDeltaBar, SortableHeader, Sparkline, SqlTraceTable, StackDumpView, StackFrameRow, StackTrace, StackedStatusBar, StatStrip, StatusDot, StatusRows, StepKindSections, StepOutputs, StepWait, SymbolBadge, TEST_OUTCOMES, TEST_TOOLS, TabButton, TagActionsProvider, TagList, TaskManager, TaskManagerButton, TaskMetadata, TaskMetadataChips, TaskProgress, TaskStreamTabs, TerminalCastPlayer, TestAttemptDetail, TestAttempts, TestDetailPanel, TestFailureDetail, TestFilterBar, TestNodeAdapterRegistry, TestOutput, TestRunSummary, TestRunner, TestRunnerProvider, TestTree, TestTreeNode, ThreadCard, Timeline, TimeseriesCoreBars, TimeseriesGauge, TimeseriesPanel, Timestamp, ToolIcon, TraceHarView, TraceView, TraceWindowList, Tree, TreeDataTable, TreeGroupHeader, TreeNode, TreeRowLead, TreeRowToggle, UIR_CALL_GRAPH_VOCABULARY, UiAccessProtected, UiAccessProtectedDark, UiAccessPublic, UiAccessPublicDark, UiActivity, UiAdd, UiAddChangeset, UiAddChangesetDark, UiAddFilled, UiAggregate, UiAggregateDark, UiAlias, UiAliasDark, UiAnnotation, UiAnnotationDark, UiAopAroundAdvice, UiAopBeforeAdvice, UiAopPointcut, UiArchive, UiArchiveFilled, UiArray, UiArrowDown, UiArrowDownFilled, UiArrowDownRight, UiArrowFatUp, UiArrowFatUpFilled, UiArrowLeft, UiArrowLeftFilled, UiArrowRight, UiArrowRightFilled, UiArrowUp, UiArrowUpFilled, UiArrowUpRight, UiArrowsCounterClockwise, UiArrowsCounterClockwiseFilled, UiArtifact, UiArtifactDark, UiAsterisk, UiAsteriskFilled, UiAsyncFn, UiAt, UiAtFilled, UiAtom, UiAtomFilled, UiAttachDebugger, UiAttachDebuggerDark, UiAttachToProcess, UiAttachToProcessDark, UiAuditLog, UiAzureRepos, UiBank, UiBankFilled, UiBatteryChargingVertical, UiBatteryChargingVerticalFilled, UiBatteryVerticalEmpty, UiBatteryVerticalEmptyFilled, UiBatteryVerticalFull, UiBatteryVerticalFullFilled, UiBatteryVerticalHigh, UiBatteryVerticalHighFilled, UiBatteryVerticalLow, UiBatteryVerticalLowFilled, UiBatteryVerticalMedium, UiBatteryVerticalMediumFilled, UiBeaker, UiBeakerFilled, UiBell, UiBellFilled, UiBellSlash, UiBellSlashFilled, UiBinary, UiBinaryFilled, UiBlueKey, UiBlueKeyDark, UiBoolean, UiBox, UiBoxFilled, UiBoxes, UiBoxesFilled, UiBraces, UiBrain, UiBrainFilled, UiBreakpoint, UiBreakpoint1, UiBreakpoint1Dark, UiBreakpoint2, UiBreakpoint2Dark, UiBreakpoint3, UiBreakpoint3Dark, UiBreakpoint4, UiBreakpoint4Dark, UiBreakpointDisabled, UiBreakpointField, UiBreakpointMethod, UiBroadcast, UiBroadcastFilled, UiBug, UiBugFilled, UiCache, UiCalculator, UiCalendar, UiCalendarBlank, UiCalendarBlankFilled, UiCalendarCheck, UiCalendarCheckFilled, UiCalendarFilled, UiCamera, UiCameraFilled, UiCancel, UiCancelFilled, UiChartBar, UiChartBarFilled, UiChartLineUp, UiChartLineUpFilled, UiChartOfAccounts, UiChartOfAccountsFilled, UiChartPie, UiChartPieFilled, UiChatDots, UiChatDotsFilled, UiCheck, UiCheckConstraint, UiCheckConstraintDark, UiCheckFilled, UiChevronDown, UiChevronDownFilled, UiChevronRight, UiChevronRightFilled, UiChevronUp, UiChevronUpFilled, UiChevronsDown, UiChevronsDownFilled, UiChevronsUp, UiChevronsUpFilled, UiChip, UiChipFilled, UiCircleFilled, UiCircleFilledFilled, UiCircleOutline, UiCircleOutlineFilled, UiCircleX, UiCircleXFilled, UiClass, UiClass1, UiClass1Dark, UiClass2, UiClass2Dark, UiClass3, UiClass3Dark, UiClass4, UiClass4Dark, UiClass5, UiClass5Dark, UiClass6, UiClass6Dark, UiClass7, UiClass7Dark, UiClearCash, UiClearCashDark, UiClipboardText, UiClipboardTextFilled, UiClock, UiClockCountdown, UiClockCountdownFilled, UiClockFilled, UiClose, UiCloseFilled, UiCloud, UiCloudDownload, UiCloudDownloadFilled, UiCloudFilled, UiCloudUpload, UiCloudUploadFilled, UiCode2, UiCode2Filled, UiCog, UiCogFilled, UiCoins, UiCoinsFilled, UiCollapseAll, UiCollection, UiCollectionDark, UiCollectionType, UiCollectionTypeDark, UiColumn, UiColumn1, UiColumn1Dark, UiColumn2, UiColumn2Dark, UiColumn3, UiColumn3Dark, UiColumn4, UiColumn4Dark, UiColumn5, UiColumn5Dark, UiColumnDark, UiColumns, UiColumnsFilled, UiCommand, UiCommandFilled, UiComment, UiCompass, UiCompassFilled, UiConfig, UiConfigFilled, UiConfigMap, UiConfigMapDark, UiConnector, UiConnectorDark, UiConstant, UiConstant1, UiConstant1Dark, UiConstructor, UiConverter, UiConverter1, UiConverter1Dark, UiConverterDark, UiCopy, UiCopyFilled, UiCreateConstraint, UiCreateConstraintDark, UiCurrencyDollar, UiCurrencyDollarFilled, UiCursorClick, UiCursorClickFilled, UiCursorText, UiCursorTextFilled, UiCustomResource, UiCustomResourceDark, UiDataSchema, UiDataSchemaDark, UiDataShare, UiDataShareDark, UiDatabase, UiDatabaseCheck, UiDatabaseCheckFilled, UiDatabaseCross, UiDatabaseCrossFilled, UiDatabaseDown, UiDatabaseDownFilled, UiDatabaseError, UiDatabaseErrorFilled, UiDatabaseEventStream, UiDatabaseFilled, UiDatabaseInfo, UiDatabaseInfoFilled, UiDatabaseLink, UiDatabaseLinkDark, UiDatabaseMinus, UiDatabaseMinusFilled, UiDatabasePending, UiDatabasePendingFilled, UiDatabasePlus, UiDatabasePlusFilled, UiDatabaseTrash, UiDatabaseTrashFilled, UiDatabaseUp, UiDatabaseUpFilled, UiDatabaseWarning, UiDatabaseWarningFilled, UiDatabaseZap, UiDebug, UiDebugContinue, UiDebugDisabled, UiDebugDisabledDark, UiDebugFilled, UiDebugSelection, UiDebugSelectionDark, UiDebugSmall, UiDebugStepInto, UiDebugStepOut, UiDebugStepOver, UiDebugStop, UiDecorator, UiDeploy, UiDeployDark, UiDesktop, UiDesktopFilled, UiDetach, UiDetachDark, UiDiagramDiff, UiDiagramDiffDark, UiDiff, UiDotsVertical, UiDotsVerticalFilled, UiDownload, UiDownloadFilled, UiDumpThreads, UiDumpThreadsDark, UiEdit, UiEditFilled, UiEditMode, UiEditModeDark, UiEllipsis, UiEllipsisBold, UiEllipsisFilled, UiEndpoint, UiEnum, UiEnumMember, UiEnvelope, UiEnvelopeFilled, UiError, UiEvaluateExpression, UiEvaluateExpressionDark, UiEvent, UiException, UiExceptionAnalyzerImportant, UiExceptionAnalyzerImportantDark, UiExceptionDark, UiExcludedGenerated, UiExcludedGeneratedDark, UiExpandAll, UiExport, UiExtension, UiExtensionDark, UiExternalLink, UiEye, UiEyeClosed, UiEyeClosedFilled, UiEyeFilled, UiFactory, UiFactoryFilled, UiFailedInProgress, UiFailedInProgressDark, UiFastForwardCircle, UiFastForwardCircleFilled, UiField, UiField1, UiField1Dark, UiField2, UiField2Dark, UiField3, UiField3Dark, UiField4, UiField4Dark, UiField5, UiField5Dark, UiField6, UiField6Dark, UiFieldProtected, UiFieldReadAccess, UiFieldType, UiFieldWriteAccess, UiFile, UiFileCode, UiFileCodeFilled, UiFileCog, UiFileFilled, UiFileFormat, UiFileFormatDark, UiFileJson, UiFilePlus, UiFilePlusFilled, UiFileSearch, UiFileSpreadsheet, UiFileText, UiFileTextFilled, UiFileType, UiFilter, UiFilterFilled, UiFingerprint, UiFingerprintFilled, UiFolder, UiFolderFilled, UiFolderGit, UiFolderGit2, UiFolderGit2Filled, UiFolderGitFilled, UiForeignServer, UiForeignServerDark, UiForm, UiFormFilled, UiFreemarker, UiFreemarkerDark, UiFullscreen, UiFullscreenFilled, UiFunction, UiFunction1, UiFunction1Dark, UiFunction2, UiFunction2Dark, UiFunction3, UiFunction3Dark, UiFunction4, UiFunction4Dark, UiFunctionSquare, UiFunctionSquareFilled, UiFunnelData, UiFunnelDataFilled, UiGavel, UiGavelFilled, UiGearSix, UiGearSixFilled, UiGitBranch, UiGitBranchFilled, UiGitCommit, UiGitCommitFilled, UiGitGraph, UiGitGraphFilled, UiGitMerge, UiGitMergeFilled, UiGitPr, UiGitPrFilled, UiGlobe, UiGraph, UiGraphFilled, UiGreyKey, UiGreyKeyDark, UiGrid, UiGridFilled, UiGroupByModuleGroup, UiGroupByModuleGroupDark, UiGroupByPackage, UiGroupByPackageDark, UiGroupByTestProduction, UiGroupByTestProductionDark, UiHandCoins, UiHandCoinsFilled, UiHandPalm, UiHandPalmFilled, UiHardDrive, UiHibernate, UiHibernateDark, UiHibernateEvent, UiHibernateEventDark, UiHistory, UiHistoryFilled, UiHome, UiHomeFilled, UiHourglass, UiHourglassFilled, UiHubot, UiHubotFilled, UiId, UiIdDark, UiIdentificationCard, UiIdentificationCardFilled, UiImage, UiImageFilled, UiImport, UiInbox, UiInboxFilled, UiIndex, UiIndex1, UiIndex1Dark, UiIndex2, UiIndex2Dark, UiIndex3, UiIndex3Dark, UiIndex4, UiIndex4Dark, UiIndex5, UiIndex5Dark, UiIndex6, UiIndex6Dark, UiIndexDark, UiInfo, UiInfoFilled, UiInsightAvailability, UiInsightAvailabilityFilled, UiInsightCompliance, UiInsightCost, UiInsightCostFilled, UiInsightIntegration, UiInsightPerformance, UiInsightPerformanceFilled, UiInsightRecommendation, UiInsightRecommendationFilled, UiInsightReliability, UiInsightReliabilityFilled, UiInsightSecurity, UiInsightSecurityFilled, UiInsightTechnicalDebt, UiInsightTechnicalDebtFilled, UiInspectionsGrammar, UiInspectionsGrammarDark, UiInterface, UiInvoice, UiInvoiceFilled, UiJpaAttribute, UiJpaId, UiJpaRelationship, UiJson, UiKanban, UiKanbanFilled, UiKey, UiKeyFilled, UiKeyboard, UiKeyboardFilled, UiKeyword, UiKillDataSourceProcess, UiKillDataSourceProcessDark, UiKubeConfigMap, UiKubeDeployment, UiKubeJob, UiKubeNamespace, UiKubePod, UiLambda, UiLangJava, UiLangJavascript, UiLangPython, UiLayers, UiLayoutDashboard, UiLayoutDashboardFilled, UiLedger, UiLedgerFilled, UiLightbulb, UiLightbulbFilled, UiLink, UiLinkExternal, UiLinkExternalFilled, UiLinkFilled, UiListChecks, UiListChecksFilled, UiListDashes, UiListDashesFilled, UiListFlat, UiListFlatFilled, UiListOrdered, UiListTree, UiListTreeFilled, UiLoader, UiLoaderFilled, UiLocation, UiLocationFilled, UiLock, UiLockFilled, UiLockKey, UiLockKeyFilled, UiLockOpen, UiLockOpenFilled, UiLogoAnthropic, UiLogoClaude, UiLogoDeepseek, UiLogoEslint, UiLogoGemini, UiLogoGo, UiLogoGoogle, UiLogoHuggingface, UiLogoJest, UiLogoMarkdown, UiLogoMeta, UiLogoMistral, UiLogoOllama, UiLogoOpenai, UiLogoOxc, UiLogoPerplexity, UiLogoPlaywright, UiLogoPython, UiLogoReact, UiLogoRuff, UiLogoTypescript, UiLogoVitest, UiMagicWand, UiMagicWandFilled, UiMarkdown, UiMaterializedLog, UiMaterializedLogDark, UiMemoryProfile, UiMemoryStick, UiMenu, UiMenuFilled, UiMessageQueue, UiMessageQueue1, UiMessageQueue1Dark, UiMethod, UiMethod1, UiMethod10, UiMethod10Dark, UiMethod11, UiMethod11Dark, UiMethod1Dark, UiMethod2, UiMethod2Dark, UiMethod3, UiMethod3Dark, UiMethod4, UiMethod4Dark, UiMethod5, UiMethod5Dark, UiMethod6, UiMethod6Dark, UiMethod7, UiMethod7Dark, UiMethod8, UiMethod8Dark, UiMethod9, UiMethod9Dark, UiModels, UiModelsDark, UiModule, UiModule1, UiModule1Dark, UiMoon, UiMoonFilled, UiName, UiNameDark, UiNamespace, UiNetwork, UiNetworkFilled, UiNull, UiNumeric, UiObject, UiOpenBlock, UiOpenBlockDark, UiOpenScad, UiOperator, UiOperator1, UiOperator1Dark, UiOrganization, UiOrganizationCheck, UiOrganizationCheckFilled, UiOrganizationCross, UiOrganizationCrossFilled, UiOrganizationFilled, UiOrganizationMinus, UiOrganizationMinusFilled, UiOrganizationPlus, UiOrganizationPlusFilled, UiPackage, UiPackageFilled, UiPalette, UiPaletteFilled, UiParameter, UiPartition, UiPartitionDark, UiPass, UiPassFilled, UiPause, UiPauseCircle, UiPauseCircleFilled, UiPencilSimpleLine, UiPencilSimpleLineFilled, UiPending, UiPendingDark, UiPercent, UiPhone, UiPhoneFilled, UiPlay, UiPlayCircle, UiPlayCircleFilled, UiPlaybook, UiPlug, UiPluginModule, UiPluginModuleDark, UiPluginV2, UiPluginV2Dark, UiPlugsConnected, UiPlugsConnectedFilled, UiPointcut, UiPointcutDark, UiProcedure, UiProcedureDark, UiProfile, UiProfile1, UiProfile1Dark, UiProfile2, UiProfile2Dark, UiProfile3, UiProfile3Dark, UiProfile4, UiProfile4Dark, UiProfileDark, UiProfiler, UiProfilerBackTrace, UiProfilerMergeCallees, UiProhibit, UiProhibitFilled, UiProjectStructure, UiProjectStructureDark, UiProjection, UiProjectionDark, UiProperty, UiPulse, UiPulseFilled, UiPuzzle, UiPuzzleFilled, UiQuestion, UiQuestionFilled, UiQueue, UiQueueFilled, UiReadAccess, UiReadAccessDark, UiReceipt, UiReceiptFilled, UiRecord, UiRecord1, UiRecord1Dark, UiRefresh, UiRefreshFilled, UiRegex, UiRegexDark, UiRelationship, UiRelationshipDark, UiRelay, UiRelayDark, UiRemove, UiRemoveFilled, UiRepeat, UiRepeatFilled, UiResizeVertical, UiResizeVerticalFilled, UiRestart, UiRobotAi, UiRobotAiFilled, UiRocket, UiRocketFilled, UiRole, UiRoleDark, UiRollback, UiRollbackDark, UiRoute, UiRouteFilled, UiRoutine, UiRoutineDark, UiRows, UiRowsFilled, UiRun, UiRun1, UiRun10, UiRun10Dark, UiRun11, UiRun11Dark, UiRun12, UiRun12Dark, UiRun13, UiRun13Dark, UiRun14, UiRun14Dark, UiRun1Dark, UiRun2, UiRun2Dark, UiRun3, UiRun3Dark, UiRun4, UiRun4Dark, UiRun5, UiRun5Dark, UiRun6, UiRun6Dark, UiRun7, UiRun7Dark, UiRun8, UiRun8Dark, UiRun9, UiRun9Dark, UiRunDark, UiSave, UiSaveFilled, UiScale, UiScan, UiScanFilled, UiScroll, UiScrollFilled, UiSealCheck, UiSealCheckFilled, UiSearch, UiSecurityRole, UiSecurityRoleDark, UiSelect, UiSelectFilled, UiSequence, UiSequence1, UiSequence1Dark, UiSequence2, UiSequence2Dark, UiSequence3, UiSequence3Dark, UiSequence4, UiSequence4Dark, UiSequenceDark, UiServer, UiServerProcess, UiServerProcessFilled, UiSetKey, UiSetKeyDark, UiSeverityBlocker, UiSeverityBlockerFilled, UiSeverityCritical, UiSeverityCriticalFilled, UiSeverityHigh, UiSeverityHighFilled, UiSeverityInfo, UiSeverityInfoFilled, UiSeverityLow, UiSeverityLowFilled, UiSeverityMedium, UiSeverityMediumFilled, UiSeverityWarning, UiSeverityWarningFilled, UiShare, UiShareFilled, UiShield, UiShieldCheck, UiShieldCheckFilled, UiShieldCross, UiShieldCrossFilled, UiShieldFilled, UiShieldInfo, UiShieldInfoFilled, UiShieldMinus, UiShieldMinusFilled, UiShieldPending, UiShieldPendingFilled, UiShieldPlus, UiShieldPlusFilled, UiShieldSlash, UiShieldSlashFilled, UiShieldWarning, UiShieldWarningFilled, UiShipWheel, UiShortcutFilter, UiShortcutFilterDark, UiShowCurrentFrame, UiShowCurrentFrameDark, UiShowMembers, UiShowMembersDark, UiShowToImplement, UiShowToImplementDark, UiSidebar, UiSidebarFilled, UiSigma, UiSignIn, UiSignInFilled, UiSignOut, UiSignOutFilled, UiSiren, UiSirenFilled, UiSkipForward, UiSkipForwardFilled, UiSkull, UiSkullFilled, UiSliders, UiSlidersFilled, UiSortAlphabetically, UiSortAlphabeticallyDark, UiSortByType, UiSortByTypeDark, UiSortByUsage, UiSortByUsageDark, UiSortByVisibility, UiSortByVisibilityDark, UiSparkles, UiSparklesFilled, UiSpeaker, UiSpeakerFilled, UiSpringBoot, UiSpringBootDark, UiSqlArray, UiSqlColumn, UiSqlConstraint, UiSqlDatabase, UiSqlForeignKey, UiSqlFunction, UiSqlIndex, UiSqlPrimaryKey, UiSqlQuery, UiSqlSchema, UiSqlSequence, UiSqlStoredProc, UiSqlTable, UiSqlTableFilled, UiSqlTrigger, UiSqlView, UiSquare, UiSquareFilled, UiStack, UiStackFilled, UiStackFrameDot, UiStackTrace, UiStar, UiStarFilled, UiStartTimer, UiStartTimerDark, UiStatic, UiStaticDark, UiStep, UiStep1, UiStep1Dark, UiStep2, UiStep2Dark, UiStep3, UiStep3Dark, UiStep4, UiStep4Dark, UiStep5, UiStep5Dark, UiStep6, UiStep6Dark, UiStep7, UiStep7Dark, UiStep8, UiStep8Dark, UiStep9, UiStep9Dark, UiStepDark, UiSteps, UiStepsFilled, UiStop, UiStrategy, UiStrategyFilled, UiStream, UiStreamDark, UiStreamKey, UiStreamKeyDark, UiString, UiStruct, UiSubmitDB, UiSubmitDBDark, UiSubscription, UiSubscriptionDark, UiSun, UiSunFilled, UiSwap, UiSymbol, UiSymbolDark, UiSync, UiTable, UiTable1, UiTable10, UiTable10Dark, UiTable11, UiTable11Dark, UiTable12, UiTable12Dark, UiTable1Dark, UiTable2, UiTable2Dark, UiTable3, UiTable3Dark, UiTable4, UiTable4Dark, UiTable5, UiTable5Dark, UiTable6, UiTable6Dark, UiTable7, UiTable7Dark, UiTable8, UiTable8Dark, UiTable9, UiTable9Dark, UiTableFilled, UiTableProperties, UiTablePropertiesFilled, UiTag, UiTagFilled, UiTax, UiTaxFilled, UiTemplate, UiTemplateDark, UiTerminal, UiTerminalFilled, UiTest, UiTest1, UiTest1Dark, UiTest2, UiTest2Dark, UiTest3, UiTest3Dark, UiTest4, UiTest4Dark, UiTest5, UiTest5Dark, UiTest6, UiTest6Dark, UiTest7, UiTest7Dark, UiText, UiTextDark, UiThermometer, UiThermometerFilled, UiThumbsDown, UiThumbsDownFilled, UiThumbsUp, UiThumbsUpFilled, UiTimer, UiTimerFilled, UiToggleOff, UiToggleOffFilled, UiToggleOn, UiToggleOnFilled, UiTrait, UiTransactionStart, UiTransactionStartDark, UiTrash, UiTrashFilled, UiTrendDown, UiTrendDownFilled, UiTrendUp, UiTrendUpFilled, UiTypeAlias, UiTypeParameter, UiTypeScriptIndexSignature, UiTypeScriptIndexSignatureDark, UiUndeploy, UiUndeployDark, UiUnknown, UiUpload, UiUploadFilled, UiUser, UiUserCheck, UiUserCheckFilled, UiUserCircle, UiUserCircleCheck, UiUserCircleCheckFilled, UiUserCircleFilled, UiUserCircleMinus, UiUserCircleMinusFilled, UiUserCirclePlus, UiUserCirclePlusFilled, UiUserCog, UiUserFilled, UiUserGear, UiUserGearFilled, UiUserMinus, UiUserMinusFilled, UiUserPlus, UiUserPlusFilled, UiUsersFour, UiUsersFourFilled, UiUsersThree, UiUsersThreeCheck, UiUsersThreeCheckFilled, UiUsersThreeCross, UiUsersThreeCrossFilled, UiUsersThreeFilled, UiUsersThreeMinus, UiUsersThreeMinusFilled, UiUsersThreePlus, UiUsersThreePlusFilled, UiVariable, UiVariable1, UiVariable1Dark, UiVariable2, UiVariable2Dark, UiVariable3, UiVariable3Dark, UiVariable4, UiVariable4Dark, UiVariable5, UiVariable5Dark, UiVariable6, UiVariable6Dark, UiVideo, UiVideoFilled, UiVirtualForeignKey, UiVirtualForeignKeyDark, UiWarningCircle, UiWarningCircleFilled, UiWarningTriangle, UiWarningTriangleFilled, UiWatch, UiWatchFilled, UiWebArtifact, UiWebArtifactDark, UiWebServiceClient, UiWebServiceClientDark, UiWorkflow, UiWrench, UiWrenchFilled, UiWriteAccess, UiWriteAccessDark, UiXpath, UiXpath1, UiXpath1Dark, UiXpathDark, UiZap, UiZapFilled, UiZoomIn, UiZoomInFilled, UiZoomOut, UiZoomOutFilled, VerificationResults, Version, WorkloadCard, aggregateProfile, aggregateStatusCounts, allGroupsTerminal, annotateRoutePaths, answerPrompt, applyFixtureFrontmatterRaw, applyFixtureFrontmatterState, applyTaskOutputDelta, armedFacets, assertCalloutValue, assignAxes, attemptStatus, badgeVariants, baseAccess as baseCallGraphAccess, bucketTasks, buildBrief, buildLintTree, buildMarkdownPreviewUrl, buildNodeBrief, buildNodeJson, buildProcessForest, buildSchemaTree, buildSchemaViewerTree, buildStepBranchTree, cacheQueryKeys, callGraphGroupFacts, calloutVariantStyles, callsItself, changeIconAliases, chooseTimestampFormat, clickyFormatForMarkdownPreview, clickyIconProvider, clockTime, collapseSingleChildChains, collectFolderLintStats, collectFrameworks, collectLintLinters, collectTreeKeys, columnsLayout, compactStackPath, computeLineDiff, countGoroutinesByState, countLintByLinter, countLintBySeverity, countObjectGraphNodes, countProcesses, countStackByState, countThreadsByState, cpuTone, createCacheClient, createCacheRegistry, createChecklistMarkdown, createFenceMarkdown, createTestRunnerRegistry, cycleFilterState, dataMemberAside, dataNodeBacking, dataNodeGlyph, dataNodeStatus, debugCaptureHeaders, debugConsoleAvailable, debugConsoleOpen, decodeFilterState, deriveProgressBars, detectDumpFormat, diskSeries, emptyLintFilters, emptyTaskStreams, emptyTestFilters, emptyVerifySummary, encodeFilterState, exchangeToHarEntry, expandAllTree, facetCountSeries, filterStateToRecord, filterTests, findLintNode, findNodeByRoutePath, findProcessByPID, fixtureFenceKind, fixtureFenceSchemaAliases, fixtureFenceSnippetInfo, fixtureFrontmatterState, flattenForest, folderPattern, formatExclude as formatCallGraphExclude, formatCount, formatCpuPercent, formatDateTimeRelative, formatDelay, formatExportValue, formatGitCommitDateHeader, formatMatrixDuration, formatProcessTimestamp, formatProfileValue, formatPropertyLabel, formatRelativeTime, formatReplicaCounts, formatServerTimingDuration, formatStatementDuration, formatTestDuration, formatTimestamp, frameHasSource, frameLocation, genericCopySections, getChangeIcon, getVersionInfo, groupRecords, groupStatements, hasFailed, hasHoverMeta, hasPending, humanizeName, iconsByConsumerName, inferColumns, interfaceMethods, isApplicationStackFrame, isAttemptLive, isDataMember, isDataNode, isFailedOrWarn, isFlatMetadata, isGroupCollapsedByDefault, isLeaf, isLinterErrored, isMetadataLink, isProcessExited, isRuntimeFrame, isTerminalStatus, latestFacetReading, latestOf, lintFileActions, lintFolderActions, lintNodeActions, lintNodeCount, lintNodeSeverity, logLevelColor, markdownDocumentStats, matchesExclude as matchesCallGraphExclude, matchesFilterState, matrixBarClass, matrixMarkKey, memoryTone, mergeAccess, mergeGraph as mergeCallGraph, mergeCopySections, mergeSeries, metadataEntries, mockMarkdownPreview, modeToFormat, normalizeErrorDiagnostics, normalizeLogsTableRows, normalizeStatus, normalizeTags, outcomeFor, parseBoundsValue, parseExclude as parseCallGraphExclude, parseCast, parseDiagnosticsStackTrace, parseDurationBoundsValue, parseFixtureFrontmatter, parseFixtureYaml, parseGoroutineDump, parseInlineJsonContextValue, parseJavaStackTrace, parseJvmThreadDump, parseMultiFilterValue, parseServerTiming, parseStackDump, parseTimestamp, parseUnifiedDiff, policySummary, prefixAdapter, processLabel, processLifetimeMs, processSeries, processStateColor, processStateIcon, profileValueTypes, programmingIconCatalog, pruneExitedProcesses, pruneNullNodes, readStepDetail, recordToFilterState, registerDebugConsole, repeatsMark, resolveBreakdown, resolveFixtureFenceSchema, resolveSelectionActionDisplay, resolveSeries, revealDebugConsole, ringLayout, routeEdges, schemaKeys, segment, serializeBoundsValue, serializeDurationBoundsValue, serializeMultiFilterValue, seriesStats, serverColumnsToDataTableColumns, serverFiltersToFilterBar, serverTimingCounterSummary, serverTimingMetricLabel, setDebugCaptureLevel, setDebugConsoleOpen, setDebugRefreshInspection, setFallbackIconProvider, shortFrameName, slugify, splitCommaValues, splitSelectionActions, splitTagToken, stackCheckpoints, stacksThrough, statusToneFor, stringifyFixtureYaml, subscribeToDebugConsole, sum, sumNonTaskTests, summarizeVerifyNodes, tagActionsFromRecord, tagFilterTokens, taskGroupErrorCount, taskGroupErrors, taskGroupJson, taskGroupMarkdown, taskMarkdown, taskQueryKeys, taskSegments, taskStatusBg, taskStatusColor, taskStatusIcon, testAttemptViews, testStatus, toggleAccess as toggleCallGraphAccess, toolKeyFor, toolMark, totalDuration, totalLintViolations, updateFilterSelection, useClickyExport, useDebugAction, usePrompts, useSelectDetailTab, useTagActions, useTagActionsValue, useTestRunner, verificationAdapters, verifyNodeTest, verifyReportCounts, verifyReportTests, violationIgnoreAction, visibleTreeRows, withTaskStreams, workloadKindLabel, workloadStatusLabel, workloadStatusTone, workloadTypeLabel };
|
|
@@ -13,13 +13,15 @@ function hasEventSource() {
|
|
|
13
13
|
return typeof globalThis !== "undefined" && typeof globalThis.EventSource !== "undefined";
|
|
14
14
|
}
|
|
15
15
|
function useTaskRun(options = {}) {
|
|
16
|
-
const { id, ids, kind, basePath = DEFAULT_BASE, enabled = true, pollMs = DEFAULT_POLL_MS, forcePoll = false } = options;
|
|
16
|
+
const { id, ids, kind, basePath = DEFAULT_BASE, enabled = true, pollMs = DEFAULT_POLL_MS, forcePoll = false, headers } = options;
|
|
17
|
+
const headersKey = JSON.stringify(headers ?? {});
|
|
17
18
|
const runIdsKey = (ids?.filter(Boolean) ?? (id ? [id] : [])).join(",");
|
|
18
19
|
const subscriptionKey = JSON.stringify([
|
|
19
20
|
runIdsKey,
|
|
20
21
|
kind ?? "",
|
|
21
22
|
basePath,
|
|
22
|
-
enabled
|
|
23
|
+
enabled,
|
|
24
|
+
headersKey
|
|
23
25
|
]);
|
|
24
26
|
const [stateKey, setStateKey] = (0, react.useState)(subscriptionKey);
|
|
25
27
|
const [byId, setById] = (0, react.useState)({});
|
|
@@ -30,6 +32,7 @@ function useTaskRun(options = {}) {
|
|
|
30
32
|
const eventSourceFactoryRef = (0, react.useRef)(eventSourceFactory);
|
|
31
33
|
eventSourceFactoryRef.current = eventSourceFactory;
|
|
32
34
|
(0, react.useEffect)(() => {
|
|
35
|
+
const requestHeaders = JSON.parse(headersKey);
|
|
33
36
|
const runIds = runIdsKey ? runIdsKey.split(",") : [];
|
|
34
37
|
setStateKey(subscriptionKey);
|
|
35
38
|
if (!enabled || runIds.length === 0 && !kind) {
|
|
@@ -59,12 +62,15 @@ function useTaskRun(options = {}) {
|
|
|
59
62
|
[delta.id]: require_task_streams.applyTaskOutputDelta(prev[delta.id] ?? require_task_streams.emptyTaskStreams, delta)
|
|
60
63
|
}));
|
|
61
64
|
};
|
|
62
|
-
if (forcePoll || !hasEventSource()) {
|
|
65
|
+
if (forcePoll || headersKey !== "{}" || !hasEventSource()) {
|
|
63
66
|
let stopped = false;
|
|
64
67
|
let timer;
|
|
65
68
|
const tick = async () => {
|
|
66
69
|
try {
|
|
67
|
-
const responses = await Promise.all(runIds.map((runId) => fetch(`${basePath}/tasks/${encodeURIComponent(runId)}`, { headers: {
|
|
70
|
+
const responses = await Promise.all(runIds.map((runId) => fetch(`${basePath}/tasks/${encodeURIComponent(runId)}`, { headers: {
|
|
71
|
+
Accept: "application/json",
|
|
72
|
+
...requestHeaders
|
|
73
|
+
} })));
|
|
68
74
|
if (responses.some((response) => !response.ok)) throw new Error("Task request failed");
|
|
69
75
|
if (responses.every((response) => response.ok)) {
|
|
70
76
|
const snaps = (await Promise.all(responses.map(async (response) => await response.json()))).flat();
|
|
@@ -119,7 +125,8 @@ function useTaskRun(options = {}) {
|
|
|
119
125
|
basePath,
|
|
120
126
|
enabled,
|
|
121
127
|
pollMs,
|
|
122
|
-
forcePoll
|
|
128
|
+
forcePoll,
|
|
129
|
+
headersKey
|
|
123
130
|
]);
|
|
124
131
|
const current = stateKey === subscriptionKey;
|
|
125
132
|
return {
|
|
@@ -133,7 +140,8 @@ function useTaskRun(options = {}) {
|
|
|
133
140
|
};
|
|
134
141
|
}
|
|
135
142
|
function useTaskRuns(options = {}) {
|
|
136
|
-
const { kind, status: statusFilter, labels, basePath = DEFAULT_BASE, enabled = true, pollMs = DEFAULT_POLL_MS, forcePoll = false } = options;
|
|
143
|
+
const { kind, status: statusFilter, labels, basePath = DEFAULT_BASE, enabled = true, pollMs = DEFAULT_POLL_MS, forcePoll = false, headers } = options;
|
|
144
|
+
const headersKey = JSON.stringify(headers ?? {});
|
|
137
145
|
const [received, setReceived] = (0, react.useState)({
|
|
138
146
|
key: null,
|
|
139
147
|
runs: []
|
|
@@ -144,6 +152,7 @@ function useTaskRuns(options = {}) {
|
|
|
144
152
|
eventSourceFactoryRef.current = eventSourceFactory;
|
|
145
153
|
(0, react.useEffect)(() => {
|
|
146
154
|
if (!enabled) return;
|
|
155
|
+
const requestHeaders = JSON.parse(headersKey);
|
|
147
156
|
const params = new URLSearchParams();
|
|
148
157
|
if (kind) params.set("kind", kind);
|
|
149
158
|
if (statusFilter) params.set("status", statusFilter);
|
|
@@ -159,12 +168,15 @@ function useTaskRuns(options = {}) {
|
|
|
159
168
|
key: requestKey,
|
|
160
169
|
runs: next
|
|
161
170
|
});
|
|
162
|
-
if (forcePoll || !hasEventSource()) {
|
|
171
|
+
if (forcePoll || headersKey !== "{}" || !hasEventSource()) {
|
|
163
172
|
let stopped = false;
|
|
164
173
|
let timer;
|
|
165
174
|
const tick = async () => {
|
|
166
175
|
try {
|
|
167
|
-
const res = await fetch(`${basePath}/tasks${query ? `?${query}` : ""}`, { headers: {
|
|
176
|
+
const res = await fetch(`${basePath}/tasks${query ? `?${query}` : ""}`, { headers: {
|
|
177
|
+
Accept: "application/json",
|
|
178
|
+
...requestHeaders
|
|
179
|
+
} });
|
|
168
180
|
if (!res.ok) throw new Error(`Task listing failed with ${res.status}`);
|
|
169
181
|
if (res.ok) {
|
|
170
182
|
const next = await res.json();
|
|
@@ -203,7 +215,8 @@ function useTaskRuns(options = {}) {
|
|
|
203
215
|
basePath,
|
|
204
216
|
enabled,
|
|
205
217
|
pollMs,
|
|
206
|
-
forcePoll
|
|
218
|
+
forcePoll,
|
|
219
|
+
headersKey
|
|
207
220
|
]);
|
|
208
221
|
return {
|
|
209
222
|
runs: received.runs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-task-run.cjs","names":["useState","useEventSourceFactory","useRef","applyTaskOutputDelta","emptyTaskStreams","allGroupsTerminal","useMemo","withTaskStreams","taskQueryKeys"],"sources":["../../src/hooks/use-task-run.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from \"react\";\nimport {\n allGroupsTerminal,\n type TaskRunMeta,\n type TaskSnapshot,\n} from \"../data/TaskSnapshot\";\nimport {\n applyTaskOutputDelta,\n emptyTaskStreams,\n type TaskOutputDelta,\n type TaskStreams,\n withTaskStreams,\n} from \"../data/task-streams\";\nimport { taskQueryKeys } from \"../data/task-query-keys\";\nimport { useEventSourceFactory } from \"./event-source\";\n\n// use-task-run / use-task-runs are the generic clicky-ui task clients. They are\n// SSE-first: they subscribe to clicky's SSEHandler (event: task / event: done)\n// and fall back to polling the JSON endpoints only when EventSource is\n// unavailable. They speak only TaskSnapshot / TaskRunMeta — no app concepts.\n\nexport interface TaskTransportOptions {\n /** Base path of the clicky task API, e.g. \"/api/v1\". */\n basePath?: string | undefined;\n /** Disable the subscription entirely (e.g. before an id is known). */\n enabled?: boolean | undefined;\n /** Poll interval (ms) for the fallback / runs listing. */\n pollMs?: number | undefined;\n /** Force the polling transport even when EventSource exists (mainly tests). */\n forcePoll?: boolean | undefined;\n}\n\nconst DEFAULT_BASE = \"/api/v1\";\nconst DEFAULT_POLL_MS = 2_000;\n\nfunction streamUrl(base: string, query: string): string {\n return `${base}/tasks/stream${query ? `?${query}` : \"\"}`;\n}\n\nfunction hasEventSource(): boolean {\n return typeof globalThis !== \"undefined\" && typeof globalThis.EventSource !== \"undefined\";\n}\n\nexport interface UseTaskRunResult {\n snapshots: TaskSnapshot[];\n status: string;\n isComplete: boolean;\n}\n\nexport interface UseTaskRunOptions extends TaskTransportOptions {\n /** Stable run id to follow (drill-down). Mutually exclusive with ids/kind. */\n id?: string | undefined;\n /** Stable run ids to follow together. Mutually exclusive with id/kind. */\n ids?: string[] | undefined;\n /** Follow every run of a kind. */\n kind?: string | undefined;\n}\n\n// useTaskRun follows one or more runs (by id) or a kind, SSE-first. It accumulates the\n// latest snapshot per task/group id and reports completion once every group is\n// terminal.\nexport function useTaskRun(options: UseTaskRunOptions = {}): UseTaskRunResult {\n const {\n id,\n ids,\n kind,\n basePath = DEFAULT_BASE,\n enabled = true,\n pollMs = DEFAULT_POLL_MS,\n forcePoll = false,\n } = options;\n const runIdsKey = (ids?.filter(Boolean) ?? (id ? [id] : [])).join(\",\");\n // State is reset in an effect, so the first render after the subscription\n // changes still holds the previous run's snapshots and completion; stateKey\n // hides them until the reset lands.\n const subscriptionKey = JSON.stringify([runIdsKey, kind ?? \"\", basePath, enabled]);\n const [stateKey, setStateKey] = useState(subscriptionKey);\n\n const [byId, setById] = useState<Record<string, TaskSnapshot>>({});\n // Streams are held beside the snapshots, never inside them: a task frame\n // replaces its snapshot wholesale and would take the accumulated output with\n // it. See ../data/task-streams.\n const [streamsById, setStreamsById] = useState<Record<string, TaskStreams>>({});\n const [status, setStatus] = useState(\"idle\");\n const [isComplete, setIsComplete] = useState(false);\n\n // Read through a ref so a host's inline `value={(url) => ...}` factory prop\n // does not restart the subscription every render — only the effect's own\n // deps below do that.\n const eventSourceFactory = useEventSourceFactory();\n const eventSourceFactoryRef = useRef(eventSourceFactory);\n eventSourceFactoryRef.current = eventSourceFactory;\n\n useEffect(() => {\n const runIds = runIdsKey ? runIdsKey.split(\",\") : [];\n setStateKey(subscriptionKey);\n if (!enabled || (runIds.length === 0 && !kind)) {\n setById({});\n setStreamsById({});\n setStatus(\"idle\");\n setIsComplete(false);\n return;\n }\n setById({});\n setStreamsById({});\n setIsComplete(false);\n\n const params = new URLSearchParams();\n if (runIds.length > 0) params.set(\"tasks\", runIdsKey);\n if (kind) params.set(\"kind\", kind);\n const query = params.toString();\n\n const merge = (incoming: TaskSnapshot[]) => {\n setById((prev) => {\n const next = { ...prev };\n for (const snap of incoming) next[snap.type === \"group\" ? `group:${snap.groupId ?? snap.id}` : snap.id] = snap;\n return next;\n });\n };\n\n // Deltas are applied whether or not the task frame has landed yet: the\n // stream is keyed by task id on its own, so output that arrives first is\n // held rather than dropped.\n const mergeOutput = (delta: TaskOutputDelta) => {\n setStreamsById((prev) => ({\n ...prev,\n [delta.id]: applyTaskOutputDelta(prev[delta.id] ?? emptyTaskStreams, delta),\n }));\n };\n\n // Polling fallback transport.\n if (forcePoll || !hasEventSource()) {\n let stopped = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const tick = async () => {\n try {\n const responses = await Promise.all(runIds.map((runId) => fetch(\n `${basePath}/tasks/${encodeURIComponent(runId)}`,\n { headers: { Accept: \"application/json\" } },\n )));\n if (responses.some((response) => !response.ok)) throw new Error(\"Task request failed\");\n if (responses.every((response) => response.ok)) {\n const snaps = (await Promise.all(responses.map(\n async (response) => (await response.json()) as TaskSnapshot[],\n ))).flat();\n if (stopped) return;\n merge(snaps);\n setStatus(\"polling\");\n if (allGroupsTerminal(snaps)) {\n setIsComplete(true);\n return; // stop polling\n }\n }\n } catch {\n if (!stopped) setStatus(\"connection lost — retrying\");\n }\n if (!stopped) timer = setTimeout(tick, pollMs);\n };\n void tick();\n return () => {\n stopped = true;\n if (timer) clearTimeout(timer);\n };\n }\n\n // SSE transport (default).\n const es = eventSourceFactoryRef.current(streamUrl(basePath, query));\n setStatus(\"connecting\");\n es.onopen = () => setStatus(\"connected\");\n es.addEventListener(\"task\", (e) => {\n try {\n merge([JSON.parse((e as MessageEvent).data) as TaskSnapshot]);\n setStatus(\"connected\");\n } catch {\n setStatus(\"invalid task stream data\");\n }\n });\n es.addEventListener(\"output\", (e) => {\n try {\n mergeOutput(JSON.parse((e as MessageEvent).data) as TaskOutputDelta);\n } catch {\n setStatus(\"invalid task output data\");\n }\n });\n es.addEventListener(\"done\", () => {\n setStatus(\"complete\");\n setIsComplete(true);\n es.close();\n });\n es.onerror = () => setStatus(\"connection lost — retrying\");\n return () => es.close();\n }, [subscriptionKey, runIdsKey, kind, basePath, enabled, pollMs, forcePoll]);\n\n const current = stateKey === subscriptionKey;\n // The streams are merged back in only here, at the boundary. The polling\n // fallback never populates them — its JSON snapshots already carry the full\n // output — so this is a no-op on that transport.\n const snapshots = useMemo(\n () => current\n ? Object.values(byId).map((snapshot) => withTaskStreams(snapshot, streamsById[snapshot.id]))\n : [],\n [current, byId, streamsById],\n );\n\n return { snapshots, status: current ? status : \"idle\", isComplete: current && isComplete };\n}\n\nexport interface UseTaskRunsOptions extends TaskTransportOptions {\n kind?: string | undefined;\n status?: string | undefined;\n /** Label equality filters (k=v). */\n labels?: Record<string, string> | undefined;\n}\n\n/** The identity of the listing request that produced a given `runs` array. */\nexport type TaskRunsKey = ReturnType<typeof taskQueryKeys.runs>;\n\nexport interface UseTaskRunsResult {\n runs: TaskRunMeta[];\n status: string;\n /**\n * Query key of the request that actually produced `runs`, or null before the\n * first frame arrives. Changing `kind`/`status`/`labels` re-subscribes but\n * keeps the previous listing on screen until the new transport delivers, so\n * this key lags `taskQueryKeys.runs(options)` during that window. A consumer\n * mirroring `runs` into a cache must compare the two and skip the write while\n * they differ, or it publishes rows that do not match the requested filters.\n */\n runsKey: TaskRunsKey | null;\n}\n\n// useTaskRuns lists all runs (TaskRunMeta) for the manager view. It is SSE-first:\n// it subscribes to clicky's runs stream (event: runs carrying the full listing)\n// and falls back to polling the JSON runs endpoint only when EventSource is\n// unavailable or forced off. The listing has no completion terminal of its own —\n// a manager view stays subscribed to observe new and changing runs.\nexport function useTaskRuns(options: UseTaskRunsOptions = {}): UseTaskRunsResult {\n const {\n kind,\n status: statusFilter,\n labels,\n basePath = DEFAULT_BASE,\n enabled = true,\n pollMs = DEFAULT_POLL_MS,\n forcePoll = false,\n } = options;\n\n // Runs are stored together with the key of the request that delivered them, so\n // a stale listing can never be mistaken for the current filters' result.\n const [received, setReceived] = useState<{\n key: TaskRunsKey | null;\n runs: TaskRunMeta[];\n }>({ key: null, runs: [] });\n const [status, setStatus] = useState(\"idle\");\n\n const eventSourceFactory = useEventSourceFactory();\n const eventSourceFactoryRef = useRef(eventSourceFactory);\n eventSourceFactoryRef.current = eventSourceFactory;\n\n useEffect(() => {\n if (!enabled) return;\n\n const params = new URLSearchParams();\n if (kind) params.set(\"kind\", kind);\n if (statusFilter) params.set(\"status\", statusFilter);\n for (const [k, v] of Object.entries(labels ?? {})) params.append(\"label\", `${k}=${v}`);\n const query = params.toString();\n const requestKey = taskQueryKeys.runs({ basePath, kind, status: statusFilter, labels });\n const receive = (next: TaskRunMeta[]) => setReceived({ key: requestKey, runs: next });\n\n // Polling fallback transport.\n if (forcePoll || !hasEventSource()) {\n let stopped = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const tick = async () => {\n try {\n const res = await fetch(`${basePath}/tasks${query ? `?${query}` : \"\"}`, {\n headers: { Accept: \"application/json\" },\n });\n if (!res.ok) throw new Error(`Task listing failed with ${res.status}`);\n if (res.ok) {\n const next = (await res.json()) as TaskRunMeta[];\n if (stopped) return;\n receive(next);\n setStatus(\"polling\");\n }\n } catch {\n if (!stopped) setStatus(\"connection lost — retrying\");\n }\n if (!stopped) timer = setTimeout(tick, pollMs);\n };\n void tick();\n return () => {\n stopped = true;\n if (timer) clearTimeout(timer);\n };\n }\n\n // SSE transport (default).\n const es = eventSourceFactoryRef.current(`${basePath}/tasks/runs/stream${query ? `?${query}` : \"\"}`);\n setStatus(\"connecting\");\n es.onopen = () => setStatus(\"connected\");\n es.addEventListener(\"runs\", (e) => {\n try {\n receive(JSON.parse((e as MessageEvent).data) as TaskRunMeta[]);\n setStatus(\"connected\");\n } catch {\n setStatus(\"invalid task listing data\");\n }\n });\n es.onerror = () => setStatus(\"connection lost — retrying\");\n return () => es.close();\n }, [kind, statusFilter, JSON.stringify(labels ?? {}), basePath, enabled, pollMs, forcePoll]);\n\n return { runs: received.runs, status, runsKey: received.key };\n}\n"],"mappings":";;;;;;AAgCA,IAAM,eAAe;AACrB,IAAM,kBAAkB;AAExB,SAAS,UAAU,MAAc,OAAuB;CACtD,OAAO,GAAG,KAAK,eAAe,QAAQ,IAAI,UAAU;AACtD;AAEA,SAAS,iBAA0B;CACjC,OAAO,OAAO,eAAe,eAAe,OAAO,WAAW,gBAAgB;AAChF;AAoBA,SAAgB,WAAW,UAA6B,CAAC,GAAqB;CAC5E,MAAM,EACJ,IACA,KACA,MACA,WAAW,cACX,UAAU,MACV,SAAS,iBACT,YAAY,UACV;CACJ,MAAM,aAAa,KAAK,OAAO,OAAO,MAAM,KAAK,CAAC,EAAE,IAAI,CAAC,GAAA,CAAI,KAAK,GAAG;CAIrE,MAAM,kBAAkB,KAAK,UAAU;EAAC;EAAW,QAAQ;EAAI;EAAU;CAAO,CAAC;CACjF,MAAM,CAAC,UAAU,gBAAA,GAAeA,MAAAA,SAAAA,C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AS;EAAM;EAAQ,SAAS,SAAS;CAAI;AAC9D"}
|
|
1
|
+
{"version":3,"file":"use-task-run.cjs","names":["useState","useEventSourceFactory","useRef","applyTaskOutputDelta","emptyTaskStreams","allGroupsTerminal","useMemo","withTaskStreams","taskQueryKeys"],"sources":["../../src/hooks/use-task-run.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from \"react\";\nimport {\n allGroupsTerminal,\n type TaskRunMeta,\n type TaskSnapshot,\n} from \"../data/TaskSnapshot\";\nimport {\n applyTaskOutputDelta,\n emptyTaskStreams,\n type TaskOutputDelta,\n type TaskStreams,\n withTaskStreams,\n} from \"../data/task-streams\";\nimport { taskQueryKeys } from \"../data/task-query-keys\";\nimport { useEventSourceFactory } from \"./event-source\";\n\n// use-task-run / use-task-runs are the generic clicky-ui task clients. They are\n// SSE-first: they subscribe to clicky's SSEHandler (event: task / event: done)\n// and fall back to polling the JSON endpoints only when EventSource is\n// unavailable. They speak only TaskSnapshot / TaskRunMeta — no app concepts.\n\nexport interface TaskTransportOptions {\n /** Base path of the clicky task API, e.g. \"/api/v1\". */\n basePath?: string | undefined;\n /** Disable the subscription entirely (e.g. before an id is known). */\n enabled?: boolean | undefined;\n /** Poll interval (ms) for the fallback / runs listing. */\n pollMs?: number | undefined;\n /** Force the polling transport even when EventSource exists (mainly tests). */\n forcePoll?: boolean | undefined;\n /** Headers for context-scoped task endpoints. Supplying headers uses polling. */\n headers?: Record<string, string> | undefined;\n}\n\nconst DEFAULT_BASE = \"/api/v1\";\nconst DEFAULT_POLL_MS = 2_000;\n\nfunction streamUrl(base: string, query: string): string {\n return `${base}/tasks/stream${query ? `?${query}` : \"\"}`;\n}\n\nfunction hasEventSource(): boolean {\n return typeof globalThis !== \"undefined\" && typeof globalThis.EventSource !== \"undefined\";\n}\n\nexport interface UseTaskRunResult {\n snapshots: TaskSnapshot[];\n status: string;\n isComplete: boolean;\n}\n\nexport interface UseTaskRunOptions extends TaskTransportOptions {\n /** Stable run id to follow (drill-down). Mutually exclusive with ids/kind. */\n id?: string | undefined;\n /** Stable run ids to follow together. Mutually exclusive with id/kind. */\n ids?: string[] | undefined;\n /** Follow every run of a kind. */\n kind?: string | undefined;\n}\n\n// useTaskRun follows one or more runs (by id) or a kind, SSE-first. It accumulates the\n// latest snapshot per task/group id and reports completion once every group is\n// terminal.\nexport function useTaskRun(options: UseTaskRunOptions = {}): UseTaskRunResult {\n const {\n id,\n ids,\n kind,\n basePath = DEFAULT_BASE,\n enabled = true,\n pollMs = DEFAULT_POLL_MS,\n forcePoll = false,\n headers,\n } = options;\n const headersKey = JSON.stringify(headers ?? {});\n const runIdsKey = (ids?.filter(Boolean) ?? (id ? [id] : [])).join(\",\");\n // State is reset in an effect, so the first render after the subscription\n // changes still holds the previous run's snapshots and completion; stateKey\n // hides them until the reset lands.\n const subscriptionKey = JSON.stringify([runIdsKey, kind ?? \"\", basePath, enabled, headersKey]);\n const [stateKey, setStateKey] = useState(subscriptionKey);\n\n const [byId, setById] = useState<Record<string, TaskSnapshot>>({});\n // Streams are held beside the snapshots, never inside them: a task frame\n // replaces its snapshot wholesale and would take the accumulated output with\n // it. See ../data/task-streams.\n const [streamsById, setStreamsById] = useState<Record<string, TaskStreams>>({});\n const [status, setStatus] = useState(\"idle\");\n const [isComplete, setIsComplete] = useState(false);\n\n // Read through a ref so a host's inline `value={(url) => ...}` factory prop\n // does not restart the subscription every render — only the effect's own\n // deps below do that.\n const eventSourceFactory = useEventSourceFactory();\n const eventSourceFactoryRef = useRef(eventSourceFactory);\n eventSourceFactoryRef.current = eventSourceFactory;\n\n useEffect(() => {\n const requestHeaders = JSON.parse(headersKey) as Record<string, string>;\n const runIds = runIdsKey ? runIdsKey.split(\",\") : [];\n setStateKey(subscriptionKey);\n if (!enabled || (runIds.length === 0 && !kind)) {\n setById({});\n setStreamsById({});\n setStatus(\"idle\");\n setIsComplete(false);\n return;\n }\n setById({});\n setStreamsById({});\n setIsComplete(false);\n\n const params = new URLSearchParams();\n if (runIds.length > 0) params.set(\"tasks\", runIdsKey);\n if (kind) params.set(\"kind\", kind);\n const query = params.toString();\n\n const merge = (incoming: TaskSnapshot[]) => {\n setById((prev) => {\n const next = { ...prev };\n for (const snap of incoming) next[snap.type === \"group\" ? `group:${snap.groupId ?? snap.id}` : snap.id] = snap;\n return next;\n });\n };\n\n // Deltas are applied whether or not the task frame has landed yet: the\n // stream is keyed by task id on its own, so output that arrives first is\n // held rather than dropped.\n const mergeOutput = (delta: TaskOutputDelta) => {\n setStreamsById((prev) => ({\n ...prev,\n [delta.id]: applyTaskOutputDelta(prev[delta.id] ?? emptyTaskStreams, delta),\n }));\n };\n\n // Polling fallback transport.\n if (forcePoll || headersKey !== \"{}\" || !hasEventSource()) {\n let stopped = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const tick = async () => {\n try {\n const responses = await Promise.all(runIds.map((runId) => fetch(\n `${basePath}/tasks/${encodeURIComponent(runId)}`,\n { headers: { Accept: \"application/json\", ...requestHeaders } },\n )));\n if (responses.some((response) => !response.ok)) throw new Error(\"Task request failed\");\n if (responses.every((response) => response.ok)) {\n const snaps = (await Promise.all(responses.map(\n async (response) => (await response.json()) as TaskSnapshot[],\n ))).flat();\n if (stopped) return;\n merge(snaps);\n setStatus(\"polling\");\n if (allGroupsTerminal(snaps)) {\n setIsComplete(true);\n return; // stop polling\n }\n }\n } catch {\n if (!stopped) setStatus(\"connection lost — retrying\");\n }\n if (!stopped) timer = setTimeout(tick, pollMs);\n };\n void tick();\n return () => {\n stopped = true;\n if (timer) clearTimeout(timer);\n };\n }\n\n // SSE transport (default).\n const es = eventSourceFactoryRef.current(streamUrl(basePath, query));\n setStatus(\"connecting\");\n es.onopen = () => setStatus(\"connected\");\n es.addEventListener(\"task\", (e) => {\n try {\n merge([JSON.parse((e as MessageEvent).data) as TaskSnapshot]);\n setStatus(\"connected\");\n } catch {\n setStatus(\"invalid task stream data\");\n }\n });\n es.addEventListener(\"output\", (e) => {\n try {\n mergeOutput(JSON.parse((e as MessageEvent).data) as TaskOutputDelta);\n } catch {\n setStatus(\"invalid task output data\");\n }\n });\n es.addEventListener(\"done\", () => {\n setStatus(\"complete\");\n setIsComplete(true);\n es.close();\n });\n es.onerror = () => setStatus(\"connection lost — retrying\");\n return () => es.close();\n }, [subscriptionKey, runIdsKey, kind, basePath, enabled, pollMs, forcePoll, headersKey]);\n\n const current = stateKey === subscriptionKey;\n // The streams are merged back in only here, at the boundary. The polling\n // fallback never populates them — its JSON snapshots already carry the full\n // output — so this is a no-op on that transport.\n const snapshots = useMemo(\n () => current\n ? Object.values(byId).map((snapshot) => withTaskStreams(snapshot, streamsById[snapshot.id]))\n : [],\n [current, byId, streamsById],\n );\n\n return { snapshots, status: current ? status : \"idle\", isComplete: current && isComplete };\n}\n\nexport interface UseTaskRunsOptions extends TaskTransportOptions {\n kind?: string | undefined;\n status?: string | undefined;\n /** Label equality filters (k=v). */\n labels?: Record<string, string> | undefined;\n}\n\n/** The identity of the listing request that produced a given `runs` array. */\nexport type TaskRunsKey = ReturnType<typeof taskQueryKeys.runs>;\n\nexport interface UseTaskRunsResult {\n runs: TaskRunMeta[];\n status: string;\n /**\n * Query key of the request that actually produced `runs`, or null before the\n * first frame arrives. Changing `kind`/`status`/`labels` re-subscribes but\n * keeps the previous listing on screen until the new transport delivers, so\n * this key lags `taskQueryKeys.runs(options)` during that window. A consumer\n * mirroring `runs` into a cache must compare the two and skip the write while\n * they differ, or it publishes rows that do not match the requested filters.\n */\n runsKey: TaskRunsKey | null;\n}\n\n// useTaskRuns lists all runs (TaskRunMeta) for the manager view. It is SSE-first:\n// it subscribes to clicky's runs stream (event: runs carrying the full listing)\n// and falls back to polling the JSON runs endpoint only when EventSource is\n// unavailable or forced off. The listing has no completion terminal of its own —\n// a manager view stays subscribed to observe new and changing runs.\nexport function useTaskRuns(options: UseTaskRunsOptions = {}): UseTaskRunsResult {\n const {\n kind,\n status: statusFilter,\n labels,\n basePath = DEFAULT_BASE,\n enabled = true,\n pollMs = DEFAULT_POLL_MS,\n forcePoll = false,\n headers,\n } = options;\n const headersKey = JSON.stringify(headers ?? {});\n\n // Runs are stored together with the key of the request that delivered them, so\n // a stale listing can never be mistaken for the current filters' result.\n const [received, setReceived] = useState<{\n key: TaskRunsKey | null;\n runs: TaskRunMeta[];\n }>({ key: null, runs: [] });\n const [status, setStatus] = useState(\"idle\");\n\n const eventSourceFactory = useEventSourceFactory();\n const eventSourceFactoryRef = useRef(eventSourceFactory);\n eventSourceFactoryRef.current = eventSourceFactory;\n\n useEffect(() => {\n if (!enabled) return;\n const requestHeaders = JSON.parse(headersKey) as Record<string, string>;\n\n const params = new URLSearchParams();\n if (kind) params.set(\"kind\", kind);\n if (statusFilter) params.set(\"status\", statusFilter);\n for (const [k, v] of Object.entries(labels ?? {})) params.append(\"label\", `${k}=${v}`);\n const query = params.toString();\n const requestKey = taskQueryKeys.runs({ basePath, kind, status: statusFilter, labels });\n const receive = (next: TaskRunMeta[]) => setReceived({ key: requestKey, runs: next });\n\n // Polling fallback transport.\n if (forcePoll || headersKey !== \"{}\" || !hasEventSource()) {\n let stopped = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const tick = async () => {\n try {\n const res = await fetch(`${basePath}/tasks${query ? `?${query}` : \"\"}`, {\n headers: { Accept: \"application/json\", ...requestHeaders },\n });\n if (!res.ok) throw new Error(`Task listing failed with ${res.status}`);\n if (res.ok) {\n const next = (await res.json()) as TaskRunMeta[];\n if (stopped) return;\n receive(next);\n setStatus(\"polling\");\n }\n } catch {\n if (!stopped) setStatus(\"connection lost — retrying\");\n }\n if (!stopped) timer = setTimeout(tick, pollMs);\n };\n void tick();\n return () => {\n stopped = true;\n if (timer) clearTimeout(timer);\n };\n }\n\n // SSE transport (default).\n const es = eventSourceFactoryRef.current(`${basePath}/tasks/runs/stream${query ? `?${query}` : \"\"}`);\n setStatus(\"connecting\");\n es.onopen = () => setStatus(\"connected\");\n es.addEventListener(\"runs\", (e) => {\n try {\n receive(JSON.parse((e as MessageEvent).data) as TaskRunMeta[]);\n setStatus(\"connected\");\n } catch {\n setStatus(\"invalid task listing data\");\n }\n });\n es.onerror = () => setStatus(\"connection lost — retrying\");\n return () => es.close();\n }, [kind, statusFilter, JSON.stringify(labels ?? {}), basePath, enabled, pollMs, forcePoll, headersKey]);\n\n return { runs: received.runs, status, runsKey: received.key };\n}\n"],"mappings":";;;;;;AAkCA,IAAM,eAAe;AACrB,IAAM,kBAAkB;AAExB,SAAS,UAAU,MAAc,OAAuB;CACtD,OAAO,GAAG,KAAK,eAAe,QAAQ,IAAI,UAAU;AACtD;AAEA,SAAS,iBAA0B;CACjC,OAAO,OAAO,eAAe,eAAe,OAAO,WAAW,gBAAgB;AAChF;AAoBA,SAAgB,WAAW,UAA6B,CAAC,GAAqB;CAC5E,MAAM,EACJ,IACA,KACA,MACA,WAAW,cACX,UAAU,MACV,SAAS,iBACT,YAAY,OACZ,YACE;CACJ,MAAM,aAAa,KAAK,UAAU,WAAW,CAAC,CAAC;CAC/C,MAAM,aAAa,KAAK,OAAO,OAAO,MAAM,KAAK,CAAC,EAAE,IAAI,CAAC,GAAA,CAAI,KAAK,GAAG;CAIrE,MAAM,kBAAkB,KAAK,UAAU;EAAC;EAAW,QAAQ;EAAI;EAAU;EAAS;CAAU,CAAC;CAC7F,MAAM,CAAC,UAAU,gBAAA,GAAeA,MAAAA,SAAAA,CAAS,eAAe;CAExD,MAAM,CAAC,MAAM,YAAA,GAAWA,MAAAA,SAAAA,CAAuC,CAAC,CAAC;CAIjE,MAAM,CAAC,aAAa,mBAAA,GAAkBA,MAAAA,SAAAA,CAAsC,CAAC,CAAC;CAC9E,MAAM,CAAC,QAAQ,cAAA,GAAaA,MAAAA,SAAAA,CAAS,MAAM;CAC3C,MAAM,CAAC,YAAY,kBAAA,GAAiBA,MAAAA,SAAAA,CAAS,KAAK;CAKlD,MAAM,qBAAqBC,qBAAAA,sBAAsB;CACjD,MAAM,yBAAA,GAAwBC,MAAAA,OAAAA,CAAO,kBAAkB;CACvD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I,UAAU;GACd,IAAI;GACJ,MAAM,OAAO,YAAY;IACvB,IAAI;KACF,MAAM,MAAM,MAAM,MAAM,GAAG,SAAS,QAAQ,QAAQ,IAAI,UAAU,MAAM,EACtE,SAAS;MAAE,QAAQ;MAAoB,GAAG;KAAe,EAC3D,CAAC;KACD,IAAI,CAAC,IAAI,IAAI,MAAM,IAAI,MAAM,4BAA4B,IAAI,QAAQ;KACrE,IAAI,IAAI,IAAI;MACV,MAAM,OAAQ,MAAM,IAAI,KAAK;MAC7B,IAAI,SAAS;MACb,QAAQ,IAAI;MACZ,UAAU,SAAS;KACrB;IACF,QAAQ;KACN,IAAI,CAAC,SAAS,UAAU,4BAA4B;IACtD;IACA,IAAI,CAAC,SAAS,QAAQ,WAAW,MAAM,MAAM;GAC/C;GACA,KAAU;GACV,aAAa;IACX,UAAU;IACV,IAAI,OAAO,aAAa,KAAK;GAC/B;EACF;EAGA,MAAM,KAAK,sBAAsB,QAAQ,GAAG,SAAS,oBAAoB,QAAQ,IAAI,UAAU,IAAI;EACnG,UAAU,YAAY;EACtB,GAAG,eAAe,UAAU,WAAW;EACvC,GAAG,iBAAiB,SAAS,MAAM;GACjC,IAAI;IACF,QAAQ,KAAK,MAAO,EAAmB,IAAI,CAAkB;IAC7D,UAAU,WAAW;GACvB,QAAQ;IACN,UAAU,2BAA2B;GACvC;EACF,CAAC;EACD,GAAG,gBAAgB,UAAU,4BAA4B;EACzD,aAAa,GAAG,MAAM;CACxB,GAAG;EAAC;EAAM;EAAc,KAAK,UAAU,UAAU,CAAC,CAAC;EAAG;EAAU;EAAS;EAAQ;EAAW;CAAU,CAAC;CAEvG,OAAO;EAAE,MAAM,SAAS;EAAM;EAAQ,SAAS,SAAS;CAAI;AAC9D"}
|
|
@@ -9,6 +9,8 @@ export interface TaskTransportOptions {
|
|
|
9
9
|
pollMs?: number | undefined;
|
|
10
10
|
/** Force the polling transport even when EventSource exists (mainly tests). */
|
|
11
11
|
forcePoll?: boolean | undefined;
|
|
12
|
+
/** Headers for context-scoped task endpoints. Supplying headers uses polling. */
|
|
13
|
+
headers?: Record<string, string> | undefined;
|
|
12
14
|
}
|
|
13
15
|
export interface UseTaskRunResult {
|
|
14
16
|
snapshots: TaskSnapshot[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-task-run.d.ts","sourceRoot":"","sources":["../../src/hooks/use-task-run.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAQ9B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAQxD,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,+EAA+E;IAC/E,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"use-task-run.d.ts","sourceRoot":"","sources":["../../src/hooks/use-task-run.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAQ9B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAQxD,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,+EAA+E;IAC/E,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CAC9C;AAaD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;IAC7D,8EAA8E;IAC9E,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,0EAA0E;IAC1E,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC3B,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAKD,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,gBAAgB,CAmJ5E;AAED,MAAM,WAAW,kBAAmB,SAAQ,oBAAoB;IAC9D,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CAC7C;AAED,8EAA8E;AAC9E,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;AAEhE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,WAAW,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7B;AAOD,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,iBAAiB,CAkF/E"}
|
|
@@ -13,13 +13,15 @@ function hasEventSource() {
|
|
|
13
13
|
return typeof globalThis !== "undefined" && typeof globalThis.EventSource !== "undefined";
|
|
14
14
|
}
|
|
15
15
|
function useTaskRun(options = {}) {
|
|
16
|
-
const { id, ids, kind, basePath = DEFAULT_BASE, enabled = true, pollMs = DEFAULT_POLL_MS, forcePoll = false } = options;
|
|
16
|
+
const { id, ids, kind, basePath = DEFAULT_BASE, enabled = true, pollMs = DEFAULT_POLL_MS, forcePoll = false, headers } = options;
|
|
17
|
+
const headersKey = JSON.stringify(headers ?? {});
|
|
17
18
|
const runIdsKey = (ids?.filter(Boolean) ?? (id ? [id] : [])).join(",");
|
|
18
19
|
const subscriptionKey = JSON.stringify([
|
|
19
20
|
runIdsKey,
|
|
20
21
|
kind ?? "",
|
|
21
22
|
basePath,
|
|
22
|
-
enabled
|
|
23
|
+
enabled,
|
|
24
|
+
headersKey
|
|
23
25
|
]);
|
|
24
26
|
const [stateKey, setStateKey] = useState(subscriptionKey);
|
|
25
27
|
const [byId, setById] = useState({});
|
|
@@ -30,6 +32,7 @@ function useTaskRun(options = {}) {
|
|
|
30
32
|
const eventSourceFactoryRef = useRef(eventSourceFactory);
|
|
31
33
|
eventSourceFactoryRef.current = eventSourceFactory;
|
|
32
34
|
useEffect(() => {
|
|
35
|
+
const requestHeaders = JSON.parse(headersKey);
|
|
33
36
|
const runIds = runIdsKey ? runIdsKey.split(",") : [];
|
|
34
37
|
setStateKey(subscriptionKey);
|
|
35
38
|
if (!enabled || runIds.length === 0 && !kind) {
|
|
@@ -59,12 +62,15 @@ function useTaskRun(options = {}) {
|
|
|
59
62
|
[delta.id]: applyTaskOutputDelta(prev[delta.id] ?? emptyTaskStreams, delta)
|
|
60
63
|
}));
|
|
61
64
|
};
|
|
62
|
-
if (forcePoll || !hasEventSource()) {
|
|
65
|
+
if (forcePoll || headersKey !== "{}" || !hasEventSource()) {
|
|
63
66
|
let stopped = false;
|
|
64
67
|
let timer;
|
|
65
68
|
const tick = async () => {
|
|
66
69
|
try {
|
|
67
|
-
const responses = await Promise.all(runIds.map((runId) => fetch(`${basePath}/tasks/${encodeURIComponent(runId)}`, { headers: {
|
|
70
|
+
const responses = await Promise.all(runIds.map((runId) => fetch(`${basePath}/tasks/${encodeURIComponent(runId)}`, { headers: {
|
|
71
|
+
Accept: "application/json",
|
|
72
|
+
...requestHeaders
|
|
73
|
+
} })));
|
|
68
74
|
if (responses.some((response) => !response.ok)) throw new Error("Task request failed");
|
|
69
75
|
if (responses.every((response) => response.ok)) {
|
|
70
76
|
const snaps = (await Promise.all(responses.map(async (response) => await response.json()))).flat();
|
|
@@ -119,7 +125,8 @@ function useTaskRun(options = {}) {
|
|
|
119
125
|
basePath,
|
|
120
126
|
enabled,
|
|
121
127
|
pollMs,
|
|
122
|
-
forcePoll
|
|
128
|
+
forcePoll,
|
|
129
|
+
headersKey
|
|
123
130
|
]);
|
|
124
131
|
const current = stateKey === subscriptionKey;
|
|
125
132
|
return {
|
|
@@ -133,7 +140,8 @@ function useTaskRun(options = {}) {
|
|
|
133
140
|
};
|
|
134
141
|
}
|
|
135
142
|
function useTaskRuns(options = {}) {
|
|
136
|
-
const { kind, status: statusFilter, labels, basePath = DEFAULT_BASE, enabled = true, pollMs = DEFAULT_POLL_MS, forcePoll = false } = options;
|
|
143
|
+
const { kind, status: statusFilter, labels, basePath = DEFAULT_BASE, enabled = true, pollMs = DEFAULT_POLL_MS, forcePoll = false, headers } = options;
|
|
144
|
+
const headersKey = JSON.stringify(headers ?? {});
|
|
137
145
|
const [received, setReceived] = useState({
|
|
138
146
|
key: null,
|
|
139
147
|
runs: []
|
|
@@ -144,6 +152,7 @@ function useTaskRuns(options = {}) {
|
|
|
144
152
|
eventSourceFactoryRef.current = eventSourceFactory;
|
|
145
153
|
useEffect(() => {
|
|
146
154
|
if (!enabled) return;
|
|
155
|
+
const requestHeaders = JSON.parse(headersKey);
|
|
147
156
|
const params = new URLSearchParams();
|
|
148
157
|
if (kind) params.set("kind", kind);
|
|
149
158
|
if (statusFilter) params.set("status", statusFilter);
|
|
@@ -159,12 +168,15 @@ function useTaskRuns(options = {}) {
|
|
|
159
168
|
key: requestKey,
|
|
160
169
|
runs: next
|
|
161
170
|
});
|
|
162
|
-
if (forcePoll || !hasEventSource()) {
|
|
171
|
+
if (forcePoll || headersKey !== "{}" || !hasEventSource()) {
|
|
163
172
|
let stopped = false;
|
|
164
173
|
let timer;
|
|
165
174
|
const tick = async () => {
|
|
166
175
|
try {
|
|
167
|
-
const res = await fetch(`${basePath}/tasks${query ? `?${query}` : ""}`, { headers: {
|
|
176
|
+
const res = await fetch(`${basePath}/tasks${query ? `?${query}` : ""}`, { headers: {
|
|
177
|
+
Accept: "application/json",
|
|
178
|
+
...requestHeaders
|
|
179
|
+
} });
|
|
168
180
|
if (!res.ok) throw new Error(`Task listing failed with ${res.status}`);
|
|
169
181
|
if (res.ok) {
|
|
170
182
|
const next = await res.json();
|
|
@@ -203,7 +215,8 @@ function useTaskRuns(options = {}) {
|
|
|
203
215
|
basePath,
|
|
204
216
|
enabled,
|
|
205
217
|
pollMs,
|
|
206
|
-
forcePoll
|
|
218
|
+
forcePoll,
|
|
219
|
+
headersKey
|
|
207
220
|
]);
|
|
208
221
|
return {
|
|
209
222
|
runs: received.runs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-task-run.js","names":[],"sources":["../../src/hooks/use-task-run.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from \"react\";\nimport {\n allGroupsTerminal,\n type TaskRunMeta,\n type TaskSnapshot,\n} from \"../data/TaskSnapshot\";\nimport {\n applyTaskOutputDelta,\n emptyTaskStreams,\n type TaskOutputDelta,\n type TaskStreams,\n withTaskStreams,\n} from \"../data/task-streams\";\nimport { taskQueryKeys } from \"../data/task-query-keys\";\nimport { useEventSourceFactory } from \"./event-source\";\n\n// use-task-run / use-task-runs are the generic clicky-ui task clients. They are\n// SSE-first: they subscribe to clicky's SSEHandler (event: task / event: done)\n// and fall back to polling the JSON endpoints only when EventSource is\n// unavailable. They speak only TaskSnapshot / TaskRunMeta — no app concepts.\n\nexport interface TaskTransportOptions {\n /** Base path of the clicky task API, e.g. \"/api/v1\". */\n basePath?: string | undefined;\n /** Disable the subscription entirely (e.g. before an id is known). */\n enabled?: boolean | undefined;\n /** Poll interval (ms) for the fallback / runs listing. */\n pollMs?: number | undefined;\n /** Force the polling transport even when EventSource exists (mainly tests). */\n forcePoll?: boolean | undefined;\n}\n\nconst DEFAULT_BASE = \"/api/v1\";\nconst DEFAULT_POLL_MS = 2_000;\n\nfunction streamUrl(base: string, query: string): string {\n return `${base}/tasks/stream${query ? `?${query}` : \"\"}`;\n}\n\nfunction hasEventSource(): boolean {\n return typeof globalThis !== \"undefined\" && typeof globalThis.EventSource !== \"undefined\";\n}\n\nexport interface UseTaskRunResult {\n snapshots: TaskSnapshot[];\n status: string;\n isComplete: boolean;\n}\n\nexport interface UseTaskRunOptions extends TaskTransportOptions {\n /** Stable run id to follow (drill-down). Mutually exclusive with ids/kind. */\n id?: string | undefined;\n /** Stable run ids to follow together. Mutually exclusive with id/kind. */\n ids?: string[] | undefined;\n /** Follow every run of a kind. */\n kind?: string | undefined;\n}\n\n// useTaskRun follows one or more runs (by id) or a kind, SSE-first. It accumulates the\n// latest snapshot per task/group id and reports completion once every group is\n// terminal.\nexport function useTaskRun(options: UseTaskRunOptions = {}): UseTaskRunResult {\n const {\n id,\n ids,\n kind,\n basePath = DEFAULT_BASE,\n enabled = true,\n pollMs = DEFAULT_POLL_MS,\n forcePoll = false,\n } = options;\n const runIdsKey = (ids?.filter(Boolean) ?? (id ? [id] : [])).join(\",\");\n // State is reset in an effect, so the first render after the subscription\n // changes still holds the previous run's snapshots and completion; stateKey\n // hides them until the reset lands.\n const subscriptionKey = JSON.stringify([runIdsKey, kind ?? \"\", basePath, enabled]);\n const [stateKey, setStateKey] = useState(subscriptionKey);\n\n const [byId, setById] = useState<Record<string, TaskSnapshot>>({});\n // Streams are held beside the snapshots, never inside them: a task frame\n // replaces its snapshot wholesale and would take the accumulated output with\n // it. See ../data/task-streams.\n const [streamsById, setStreamsById] = useState<Record<string, TaskStreams>>({});\n const [status, setStatus] = useState(\"idle\");\n const [isComplete, setIsComplete] = useState(false);\n\n // Read through a ref so a host's inline `value={(url) => ...}` factory prop\n // does not restart the subscription every render — only the effect's own\n // deps below do that.\n const eventSourceFactory = useEventSourceFactory();\n const eventSourceFactoryRef = useRef(eventSourceFactory);\n eventSourceFactoryRef.current = eventSourceFactory;\n\n useEffect(() => {\n const runIds = runIdsKey ? runIdsKey.split(\",\") : [];\n setStateKey(subscriptionKey);\n if (!enabled || (runIds.length === 0 && !kind)) {\n setById({});\n setStreamsById({});\n setStatus(\"idle\");\n setIsComplete(false);\n return;\n }\n setById({});\n setStreamsById({});\n setIsComplete(false);\n\n const params = new URLSearchParams();\n if (runIds.length > 0) params.set(\"tasks\", runIdsKey);\n if (kind) params.set(\"kind\", kind);\n const query = params.toString();\n\n const merge = (incoming: TaskSnapshot[]) => {\n setById((prev) => {\n const next = { ...prev };\n for (const snap of incoming) next[snap.type === \"group\" ? `group:${snap.groupId ?? snap.id}` : snap.id] = snap;\n return next;\n });\n };\n\n // Deltas are applied whether or not the task frame has landed yet: the\n // stream is keyed by task id on its own, so output that arrives first is\n // held rather than dropped.\n const mergeOutput = (delta: TaskOutputDelta) => {\n setStreamsById((prev) => ({\n ...prev,\n [delta.id]: applyTaskOutputDelta(prev[delta.id] ?? emptyTaskStreams, delta),\n }));\n };\n\n // Polling fallback transport.\n if (forcePoll || !hasEventSource()) {\n let stopped = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const tick = async () => {\n try {\n const responses = await Promise.all(runIds.map((runId) => fetch(\n `${basePath}/tasks/${encodeURIComponent(runId)}`,\n { headers: { Accept: \"application/json\" } },\n )));\n if (responses.some((response) => !response.ok)) throw new Error(\"Task request failed\");\n if (responses.every((response) => response.ok)) {\n const snaps = (await Promise.all(responses.map(\n async (response) => (await response.json()) as TaskSnapshot[],\n ))).flat();\n if (stopped) return;\n merge(snaps);\n setStatus(\"polling\");\n if (allGroupsTerminal(snaps)) {\n setIsComplete(true);\n return; // stop polling\n }\n }\n } catch {\n if (!stopped) setStatus(\"connection lost — retrying\");\n }\n if (!stopped) timer = setTimeout(tick, pollMs);\n };\n void tick();\n return () => {\n stopped = true;\n if (timer) clearTimeout(timer);\n };\n }\n\n // SSE transport (default).\n const es = eventSourceFactoryRef.current(streamUrl(basePath, query));\n setStatus(\"connecting\");\n es.onopen = () => setStatus(\"connected\");\n es.addEventListener(\"task\", (e) => {\n try {\n merge([JSON.parse((e as MessageEvent).data) as TaskSnapshot]);\n setStatus(\"connected\");\n } catch {\n setStatus(\"invalid task stream data\");\n }\n });\n es.addEventListener(\"output\", (e) => {\n try {\n mergeOutput(JSON.parse((e as MessageEvent).data) as TaskOutputDelta);\n } catch {\n setStatus(\"invalid task output data\");\n }\n });\n es.addEventListener(\"done\", () => {\n setStatus(\"complete\");\n setIsComplete(true);\n es.close();\n });\n es.onerror = () => setStatus(\"connection lost — retrying\");\n return () => es.close();\n }, [subscriptionKey, runIdsKey, kind, basePath, enabled, pollMs, forcePoll]);\n\n const current = stateKey === subscriptionKey;\n // The streams are merged back in only here, at the boundary. The polling\n // fallback never populates them — its JSON snapshots already carry the full\n // output — so this is a no-op on that transport.\n const snapshots = useMemo(\n () => current\n ? Object.values(byId).map((snapshot) => withTaskStreams(snapshot, streamsById[snapshot.id]))\n : [],\n [current, byId, streamsById],\n );\n\n return { snapshots, status: current ? status : \"idle\", isComplete: current && isComplete };\n}\n\nexport interface UseTaskRunsOptions extends TaskTransportOptions {\n kind?: string | undefined;\n status?: string | undefined;\n /** Label equality filters (k=v). */\n labels?: Record<string, string> | undefined;\n}\n\n/** The identity of the listing request that produced a given `runs` array. */\nexport type TaskRunsKey = ReturnType<typeof taskQueryKeys.runs>;\n\nexport interface UseTaskRunsResult {\n runs: TaskRunMeta[];\n status: string;\n /**\n * Query key of the request that actually produced `runs`, or null before the\n * first frame arrives. Changing `kind`/`status`/`labels` re-subscribes but\n * keeps the previous listing on screen until the new transport delivers, so\n * this key lags `taskQueryKeys.runs(options)` during that window. A consumer\n * mirroring `runs` into a cache must compare the two and skip the write while\n * they differ, or it publishes rows that do not match the requested filters.\n */\n runsKey: TaskRunsKey | null;\n}\n\n// useTaskRuns lists all runs (TaskRunMeta) for the manager view. It is SSE-first:\n// it subscribes to clicky's runs stream (event: runs carrying the full listing)\n// and falls back to polling the JSON runs endpoint only when EventSource is\n// unavailable or forced off. The listing has no completion terminal of its own —\n// a manager view stays subscribed to observe new and changing runs.\nexport function useTaskRuns(options: UseTaskRunsOptions = {}): UseTaskRunsResult {\n const {\n kind,\n status: statusFilter,\n labels,\n basePath = DEFAULT_BASE,\n enabled = true,\n pollMs = DEFAULT_POLL_MS,\n forcePoll = false,\n } = options;\n\n // Runs are stored together with the key of the request that delivered them, so\n // a stale listing can never be mistaken for the current filters' result.\n const [received, setReceived] = useState<{\n key: TaskRunsKey | null;\n runs: TaskRunMeta[];\n }>({ key: null, runs: [] });\n const [status, setStatus] = useState(\"idle\");\n\n const eventSourceFactory = useEventSourceFactory();\n const eventSourceFactoryRef = useRef(eventSourceFactory);\n eventSourceFactoryRef.current = eventSourceFactory;\n\n useEffect(() => {\n if (!enabled) return;\n\n const params = new URLSearchParams();\n if (kind) params.set(\"kind\", kind);\n if (statusFilter) params.set(\"status\", statusFilter);\n for (const [k, v] of Object.entries(labels ?? {})) params.append(\"label\", `${k}=${v}`);\n const query = params.toString();\n const requestKey = taskQueryKeys.runs({ basePath, kind, status: statusFilter, labels });\n const receive = (next: TaskRunMeta[]) => setReceived({ key: requestKey, runs: next });\n\n // Polling fallback transport.\n if (forcePoll || !hasEventSource()) {\n let stopped = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const tick = async () => {\n try {\n const res = await fetch(`${basePath}/tasks${query ? `?${query}` : \"\"}`, {\n headers: { Accept: \"application/json\" },\n });\n if (!res.ok) throw new Error(`Task listing failed with ${res.status}`);\n if (res.ok) {\n const next = (await res.json()) as TaskRunMeta[];\n if (stopped) return;\n receive(next);\n setStatus(\"polling\");\n }\n } catch {\n if (!stopped) setStatus(\"connection lost — retrying\");\n }\n if (!stopped) timer = setTimeout(tick, pollMs);\n };\n void tick();\n return () => {\n stopped = true;\n if (timer) clearTimeout(timer);\n };\n }\n\n // SSE transport (default).\n const es = eventSourceFactoryRef.current(`${basePath}/tasks/runs/stream${query ? `?${query}` : \"\"}`);\n setStatus(\"connecting\");\n es.onopen = () => setStatus(\"connected\");\n es.addEventListener(\"runs\", (e) => {\n try {\n receive(JSON.parse((e as MessageEvent).data) as TaskRunMeta[]);\n setStatus(\"connected\");\n } catch {\n setStatus(\"invalid task listing data\");\n }\n });\n es.onerror = () => setStatus(\"connection lost — retrying\");\n return () => es.close();\n }, [kind, statusFilter, JSON.stringify(labels ?? {}), basePath, enabled, pollMs, forcePoll]);\n\n return { runs: received.runs, status, runsKey: received.key };\n}\n"],"mappings":";;;;;;AAgCA,IAAM,eAAe;AACrB,IAAM,kBAAkB;AAExB,SAAS,UAAU,MAAc,OAAuB;CACtD,OAAO,GAAG,KAAK,eAAe,QAAQ,IAAI,UAAU;AACtD;AAEA,SAAS,iBAA0B;CACjC,OAAO,OAAO,eAAe,eAAe,OAAO,WAAW,gBAAgB;AAChF;AAoBA,SAAgB,WAAW,UAA6B,CAAC,GAAqB;CAC5E,MAAM,EACJ,IACA,KACA,MACA,WAAW,cACX,UAAU,MACV,SAAS,iBACT,YAAY,UACV;CACJ,MAAM,aAAa,KAAK,OAAO,OAAO,MAAM,KAAK,CAAC,EAAE,IAAI,CAAC,GAAA,CAAI,KAAK,GAAG;CAIrE,MAAM,kBAAkB,KAAK,UAAU;EAAC;EAAW,QAAQ;EAAI;EAAU;CAAO,CAAC;CACjF,MAAM,CAAC,UAAU,eAAe,SAAS,eAAe;CAExD,MAAM,CAAC,MAAM,WAAW,SAAuC,CAAC,CAAC;CAIjE,MAAM,CAAC,aAAa,kBAAkB,SAAsC,CAAC,CAAC;CAC9E,MAAM,CAAC,QAAQ,aAAa,SAAS,MAAM;CAC3C,MAAM,CAAC,YAAY,iBAAiB,SAAS,KAAK;CAKlD,MAAM,qBAAqB,sBAAsB;CACjD,MAAM,w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MACZ,UAAU,SAAS;KACrB;IACF,QAAQ;KACN,IAAI,CAAC,SAAS,UAAU,4BAA4B;IACtD;IACA,IAAI,CAAC,SAAS,QAAQ,WAAW,MAAM,MAAM;GAC/C;GACA,KAAU;GACV,aAAa;IACX,UAAU;IACV,IAAI,OAAO,aAAa,KAAK;GAC/B;EACF;EAGA,MAAM,KAAK,sBAAsB,QAAQ,GAAG,SAAS,oBAAoB,QAAQ,IAAI,UAAU,IAAI;EACnG,UAAU,YAAY;EACtB,GAAG,eAAe,UAAU,WAAW;EACvC,GAAG,iBAAiB,SAAS,MAAM;GACjC,IAAI;IACF,QAAQ,KAAK,MAAO,EAAmB,IAAI,CAAkB;IAC7D,UAAU,WAAW;GACvB,QAAQ;IACN,UAAU,2BAA2B;GACvC;EACF,CAAC;EACD,GAAG,gBAAgB,UAAU,4BAA4B;EACzD,aAAa,GAAG,MAAM;CACxB,GAAG;EAAC;EAAM;EAAc,KAAK,UAAU,UAAU,CAAC,CAAC;EAAG;EAAU;EAAS;EAAQ;CAAS,CAAC;CAE3F,OAAO;EAAE,MAAM,SAAS;EAAM;EAAQ,SAAS,SAAS;CAAI;AAC9D"}
|
|
1
|
+
{"version":3,"file":"use-task-run.js","names":[],"sources":["../../src/hooks/use-task-run.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from \"react\";\nimport {\n allGroupsTerminal,\n type TaskRunMeta,\n type TaskSnapshot,\n} from \"../data/TaskSnapshot\";\nimport {\n applyTaskOutputDelta,\n emptyTaskStreams,\n type TaskOutputDelta,\n type TaskStreams,\n withTaskStreams,\n} from \"../data/task-streams\";\nimport { taskQueryKeys } from \"../data/task-query-keys\";\nimport { useEventSourceFactory } from \"./event-source\";\n\n// use-task-run / use-task-runs are the generic clicky-ui task clients. They are\n// SSE-first: they subscribe to clicky's SSEHandler (event: task / event: done)\n// and fall back to polling the JSON endpoints only when EventSource is\n// unavailable. They speak only TaskSnapshot / TaskRunMeta — no app concepts.\n\nexport interface TaskTransportOptions {\n /** Base path of the clicky task API, e.g. \"/api/v1\". */\n basePath?: string | undefined;\n /** Disable the subscription entirely (e.g. before an id is known). */\n enabled?: boolean | undefined;\n /** Poll interval (ms) for the fallback / runs listing. */\n pollMs?: number | undefined;\n /** Force the polling transport even when EventSource exists (mainly tests). */\n forcePoll?: boolean | undefined;\n /** Headers for context-scoped task endpoints. Supplying headers uses polling. */\n headers?: Record<string, string> | undefined;\n}\n\nconst DEFAULT_BASE = \"/api/v1\";\nconst DEFAULT_POLL_MS = 2_000;\n\nfunction streamUrl(base: string, query: string): string {\n return `${base}/tasks/stream${query ? `?${query}` : \"\"}`;\n}\n\nfunction hasEventSource(): boolean {\n return typeof globalThis !== \"undefined\" && typeof globalThis.EventSource !== \"undefined\";\n}\n\nexport interface UseTaskRunResult {\n snapshots: TaskSnapshot[];\n status: string;\n isComplete: boolean;\n}\n\nexport interface UseTaskRunOptions extends TaskTransportOptions {\n /** Stable run id to follow (drill-down). Mutually exclusive with ids/kind. */\n id?: string | undefined;\n /** Stable run ids to follow together. Mutually exclusive with id/kind. */\n ids?: string[] | undefined;\n /** Follow every run of a kind. */\n kind?: string | undefined;\n}\n\n// useTaskRun follows one or more runs (by id) or a kind, SSE-first. It accumulates the\n// latest snapshot per task/group id and reports completion once every group is\n// terminal.\nexport function useTaskRun(options: UseTaskRunOptions = {}): UseTaskRunResult {\n const {\n id,\n ids,\n kind,\n basePath = DEFAULT_BASE,\n enabled = true,\n pollMs = DEFAULT_POLL_MS,\n forcePoll = false,\n headers,\n } = options;\n const headersKey = JSON.stringify(headers ?? {});\n const runIdsKey = (ids?.filter(Boolean) ?? (id ? [id] : [])).join(\",\");\n // State is reset in an effect, so the first render after the subscription\n // changes still holds the previous run's snapshots and completion; stateKey\n // hides them until the reset lands.\n const subscriptionKey = JSON.stringify([runIdsKey, kind ?? \"\", basePath, enabled, headersKey]);\n const [stateKey, setStateKey] = useState(subscriptionKey);\n\n const [byId, setById] = useState<Record<string, TaskSnapshot>>({});\n // Streams are held beside the snapshots, never inside them: a task frame\n // replaces its snapshot wholesale and would take the accumulated output with\n // it. See ../data/task-streams.\n const [streamsById, setStreamsById] = useState<Record<string, TaskStreams>>({});\n const [status, setStatus] = useState(\"idle\");\n const [isComplete, setIsComplete] = useState(false);\n\n // Read through a ref so a host's inline `value={(url) => ...}` factory prop\n // does not restart the subscription every render — only the effect's own\n // deps below do that.\n const eventSourceFactory = useEventSourceFactory();\n const eventSourceFactoryRef = useRef(eventSourceFactory);\n eventSourceFactoryRef.current = eventSourceFactory;\n\n useEffect(() => {\n const requestHeaders = JSON.parse(headersKey) as Record<string, string>;\n const runIds = runIdsKey ? runIdsKey.split(\",\") : [];\n setStateKey(subscriptionKey);\n if (!enabled || (runIds.length === 0 && !kind)) {\n setById({});\n setStreamsById({});\n setStatus(\"idle\");\n setIsComplete(false);\n return;\n }\n setById({});\n setStreamsById({});\n setIsComplete(false);\n\n const params = new URLSearchParams();\n if (runIds.length > 0) params.set(\"tasks\", runIdsKey);\n if (kind) params.set(\"kind\", kind);\n const query = params.toString();\n\n const merge = (incoming: TaskSnapshot[]) => {\n setById((prev) => {\n const next = { ...prev };\n for (const snap of incoming) next[snap.type === \"group\" ? `group:${snap.groupId ?? snap.id}` : snap.id] = snap;\n return next;\n });\n };\n\n // Deltas are applied whether or not the task frame has landed yet: the\n // stream is keyed by task id on its own, so output that arrives first is\n // held rather than dropped.\n const mergeOutput = (delta: TaskOutputDelta) => {\n setStreamsById((prev) => ({\n ...prev,\n [delta.id]: applyTaskOutputDelta(prev[delta.id] ?? emptyTaskStreams, delta),\n }));\n };\n\n // Polling fallback transport.\n if (forcePoll || headersKey !== \"{}\" || !hasEventSource()) {\n let stopped = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const tick = async () => {\n try {\n const responses = await Promise.all(runIds.map((runId) => fetch(\n `${basePath}/tasks/${encodeURIComponent(runId)}`,\n { headers: { Accept: \"application/json\", ...requestHeaders } },\n )));\n if (responses.some((response) => !response.ok)) throw new Error(\"Task request failed\");\n if (responses.every((response) => response.ok)) {\n const snaps = (await Promise.all(responses.map(\n async (response) => (await response.json()) as TaskSnapshot[],\n ))).flat();\n if (stopped) return;\n merge(snaps);\n setStatus(\"polling\");\n if (allGroupsTerminal(snaps)) {\n setIsComplete(true);\n return; // stop polling\n }\n }\n } catch {\n if (!stopped) setStatus(\"connection lost — retrying\");\n }\n if (!stopped) timer = setTimeout(tick, pollMs);\n };\n void tick();\n return () => {\n stopped = true;\n if (timer) clearTimeout(timer);\n };\n }\n\n // SSE transport (default).\n const es = eventSourceFactoryRef.current(streamUrl(basePath, query));\n setStatus(\"connecting\");\n es.onopen = () => setStatus(\"connected\");\n es.addEventListener(\"task\", (e) => {\n try {\n merge([JSON.parse((e as MessageEvent).data) as TaskSnapshot]);\n setStatus(\"connected\");\n } catch {\n setStatus(\"invalid task stream data\");\n }\n });\n es.addEventListener(\"output\", (e) => {\n try {\n mergeOutput(JSON.parse((e as MessageEvent).data) as TaskOutputDelta);\n } catch {\n setStatus(\"invalid task output data\");\n }\n });\n es.addEventListener(\"done\", () => {\n setStatus(\"complete\");\n setIsComplete(true);\n es.close();\n });\n es.onerror = () => setStatus(\"connection lost — retrying\");\n return () => es.close();\n }, [subscriptionKey, runIdsKey, kind, basePath, enabled, pollMs, forcePoll, headersKey]);\n\n const current = stateKey === subscriptionKey;\n // The streams are merged back in only here, at the boundary. The polling\n // fallback never populates them — its JSON snapshots already carry the full\n // output — so this is a no-op on that transport.\n const snapshots = useMemo(\n () => current\n ? Object.values(byId).map((snapshot) => withTaskStreams(snapshot, streamsById[snapshot.id]))\n : [],\n [current, byId, streamsById],\n );\n\n return { snapshots, status: current ? status : \"idle\", isComplete: current && isComplete };\n}\n\nexport interface UseTaskRunsOptions extends TaskTransportOptions {\n kind?: string | undefined;\n status?: string | undefined;\n /** Label equality filters (k=v). */\n labels?: Record<string, string> | undefined;\n}\n\n/** The identity of the listing request that produced a given `runs` array. */\nexport type TaskRunsKey = ReturnType<typeof taskQueryKeys.runs>;\n\nexport interface UseTaskRunsResult {\n runs: TaskRunMeta[];\n status: string;\n /**\n * Query key of the request that actually produced `runs`, or null before the\n * first frame arrives. Changing `kind`/`status`/`labels` re-subscribes but\n * keeps the previous listing on screen until the new transport delivers, so\n * this key lags `taskQueryKeys.runs(options)` during that window. A consumer\n * mirroring `runs` into a cache must compare the two and skip the write while\n * they differ, or it publishes rows that do not match the requested filters.\n */\n runsKey: TaskRunsKey | null;\n}\n\n// useTaskRuns lists all runs (TaskRunMeta) for the manager view. It is SSE-first:\n// it subscribes to clicky's runs stream (event: runs carrying the full listing)\n// and falls back to polling the JSON runs endpoint only when EventSource is\n// unavailable or forced off. The listing has no completion terminal of its own —\n// a manager view stays subscribed to observe new and changing runs.\nexport function useTaskRuns(options: UseTaskRunsOptions = {}): UseTaskRunsResult {\n const {\n kind,\n status: statusFilter,\n labels,\n basePath = DEFAULT_BASE,\n enabled = true,\n pollMs = DEFAULT_POLL_MS,\n forcePoll = false,\n headers,\n } = options;\n const headersKey = JSON.stringify(headers ?? {});\n\n // Runs are stored together with the key of the request that delivered them, so\n // a stale listing can never be mistaken for the current filters' result.\n const [received, setReceived] = useState<{\n key: TaskRunsKey | null;\n runs: TaskRunMeta[];\n }>({ key: null, runs: [] });\n const [status, setStatus] = useState(\"idle\");\n\n const eventSourceFactory = useEventSourceFactory();\n const eventSourceFactoryRef = useRef(eventSourceFactory);\n eventSourceFactoryRef.current = eventSourceFactory;\n\n useEffect(() => {\n if (!enabled) return;\n const requestHeaders = JSON.parse(headersKey) as Record<string, string>;\n\n const params = new URLSearchParams();\n if (kind) params.set(\"kind\", kind);\n if (statusFilter) params.set(\"status\", statusFilter);\n for (const [k, v] of Object.entries(labels ?? {})) params.append(\"label\", `${k}=${v}`);\n const query = params.toString();\n const requestKey = taskQueryKeys.runs({ basePath, kind, status: statusFilter, labels });\n const receive = (next: TaskRunMeta[]) => setReceived({ key: requestKey, runs: next });\n\n // Polling fallback transport.\n if (forcePoll || headersKey !== \"{}\" || !hasEventSource()) {\n let stopped = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const tick = async () => {\n try {\n const res = await fetch(`${basePath}/tasks${query ? `?${query}` : \"\"}`, {\n headers: { Accept: \"application/json\", ...requestHeaders },\n });\n if (!res.ok) throw new Error(`Task listing failed with ${res.status}`);\n if (res.ok) {\n const next = (await res.json()) as TaskRunMeta[];\n if (stopped) return;\n receive(next);\n setStatus(\"polling\");\n }\n } catch {\n if (!stopped) setStatus(\"connection lost — retrying\");\n }\n if (!stopped) timer = setTimeout(tick, pollMs);\n };\n void tick();\n return () => {\n stopped = true;\n if (timer) clearTimeout(timer);\n };\n }\n\n // SSE transport (default).\n const es = eventSourceFactoryRef.current(`${basePath}/tasks/runs/stream${query ? `?${query}` : \"\"}`);\n setStatus(\"connecting\");\n es.onopen = () => setStatus(\"connected\");\n es.addEventListener(\"runs\", (e) => {\n try {\n receive(JSON.parse((e as MessageEvent).data) as TaskRunMeta[]);\n setStatus(\"connected\");\n } catch {\n setStatus(\"invalid task listing data\");\n }\n });\n es.onerror = () => setStatus(\"connection lost — retrying\");\n return () => es.close();\n }, [kind, statusFilter, JSON.stringify(labels ?? {}), basePath, enabled, pollMs, forcePoll, headersKey]);\n\n return { runs: received.runs, status, runsKey: received.key };\n}\n"],"mappings":";;;;;;AAkCA,IAAM,eAAe;AACrB,IAAM,kBAAkB;AAExB,SAAS,UAAU,MAAc,OAAuB;CACtD,OAAO,GAAG,KAAK,eAAe,QAAQ,IAAI,UAAU;AACtD;AAEA,SAAS,iBAA0B;CACjC,OAAO,OAAO,eAAe,eAAe,OAAO,WAAW,gBAAgB;AAChF;AAoBA,SAAgB,WAAW,UAA6B,CAAC,GAAqB;CAC5E,MAAM,EACJ,IACA,KACA,MACA,WAAW,cACX,UAAU,MACV,SAAS,iBACT,YAAY,OACZ,YACE;CACJ,MAAM,aAAa,KAAK,UAAU,WAAW,CAAC,CAAC;CAC/C,MAAM,aAAa,KAAK,OAAO,OAAO,M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