@shipfox/client-workflows 12.0.2 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +16 -1
- package/.storybook/preview.tsx +3 -3
- package/.storybook/workspace-source.ts +31 -0
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +79 -0
- package/dist/components/job-graph/job-duration-format.d.ts +2 -2
- package/dist/components/job-graph/job-duration-format.d.ts.map +1 -1
- package/dist/components/job-graph/job-duration-format.js +4 -2
- package/dist/components/job-graph/job-duration-format.js.map +1 -1
- package/dist/components/job-graph/job-duration-label.js +1 -1
- package/dist/components/job-graph/job-duration-label.js.map +1 -1
- package/dist/components/job-graph/job-graph-content.d.ts +2 -1
- package/dist/components/job-graph/job-graph-content.d.ts.map +1 -1
- package/dist/components/job-graph/job-graph-content.js +3 -3
- package/dist/components/job-graph/job-graph-content.js.map +1 -1
- package/dist/components/job-graph/job-graph-view.d.ts +2 -1
- package/dist/components/job-graph/job-graph-view.d.ts.map +1 -1
- package/dist/components/job-graph/job-graph-view.js +2 -2
- package/dist/components/job-graph/job-graph-view.js.map +1 -1
- package/dist/components/job-graph/job-node.d.ts +1 -1
- package/dist/components/job-graph/job-node.d.ts.map +1 -1
- package/dist/components/job-graph/job-node.js +10 -9
- package/dist/components/job-graph/job-node.js.map +1 -1
- package/dist/components/job-graph/types.d.ts +2 -1
- package/dist/components/job-graph/types.d.ts.map +1 -1
- package/dist/components/job-graph/types.js.map +1 -1
- package/dist/components/step-list/step-list.d.ts +2 -2
- package/dist/components/step-list/step-list.d.ts.map +1 -1
- package/dist/components/step-list/step-list.js.map +1 -1
- package/dist/components/workflow-run-duration-label.js +1 -1
- package/dist/components/workflow-run-duration-label.js.map +1 -1
- package/dist/components/workflow-run-list/job-status-strip.d.ts +21 -0
- package/dist/components/workflow-run-list/job-status-strip.d.ts.map +1 -0
- package/dist/components/workflow-run-list/job-status-strip.js +185 -0
- package/dist/components/workflow-run-list/job-status-strip.js.map +1 -0
- package/dist/components/workflow-run-list/run-display.d.ts +27 -3
- package/dist/components/workflow-run-list/run-display.d.ts.map +1 -1
- package/dist/components/workflow-run-list/run-display.js +78 -7
- package/dist/components/workflow-run-list/run-display.js.map +1 -1
- package/dist/components/workflow-run-list/types.d.ts +23 -24
- package/dist/components/workflow-run-list/types.d.ts.map +1 -1
- package/dist/components/workflow-run-list/types.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-filter-menu.d.ts +22 -0
- package/dist/components/workflow-run-list/workflow-run-filter-menu.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-filter-menu.js +68 -0
- package/dist/components/workflow-run-list/workflow-run-filter-menu.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-filters.d.ts +18 -0
- package/dist/components/workflow-run-list/workflow-run-filters.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-filters.js +236 -0
- package/dist/components/workflow-run-list/workflow-run-filters.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-content.d.ts +8 -4
- package/dist/components/workflow-run-list/workflow-run-list-content.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-content.js +40 -12
- package/dist/components/workflow-run-list/workflow-run-list-content.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-states.d.ts +29 -2
- package/dist/components/workflow-run-list/workflow-run-list-states.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-states.js +103 -44
- package/dist/components/workflow-run-list/workflow-run-list-states.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.d.ts +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.js +60 -43
- package/dist/components/workflow-run-list/workflow-run-list-view.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list.d.ts +1 -1
- package/dist/components/workflow-run-list/workflow-run-list.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list.js +20 -8
- package/dist/components/workflow-run-list/workflow-run-list.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.d.ts +19 -9
- package/dist/components/workflow-run-list/workflow-run-row.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.js +179 -112
- package/dist/components/workflow-run-list/workflow-run-row.js.map +1 -1
- package/dist/components/workflow-run-number-label.d.ts +15 -0
- package/dist/components/workflow-run-number-label.d.ts.map +1 -0
- package/dist/components/workflow-run-number-label.js +41 -0
- package/dist/components/workflow-run-number-label.js.map +1 -0
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.d.ts +3 -3
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.d.ts.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js +10 -9
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts +4 -9
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.js +107 -74
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
- package/dist/components/workflow-run-tabs/index.d.ts +6 -0
- package/dist/components/workflow-run-tabs/index.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/index.js +7 -0
- package/dist/components/workflow-run-tabs/index.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.d.ts +11 -0
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.js +71 -0
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotations-empty.d.ts +2 -0
- package/dist/components/workflow-run-tabs/run-annotations-empty.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotations-empty.js +11 -0
- package/dist/components/workflow-run-tabs/run-annotations-empty.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-jobs-list.d.ts +18 -0
- package/dist/components/workflow-run-tabs/run-jobs-list.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-jobs-list.js +107 -0
- package/dist/components/workflow-run-tabs/run-jobs-list.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-tab-count.d.ts +6 -0
- package/dist/components/workflow-run-tabs/run-tab-count.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-tab-count.js +27 -0
- package/dist/components/workflow-run-tabs/run-tab-count.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-tab-strip.d.ts +8 -0
- package/dist/components/workflow-run-tabs/run-tab-strip.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-tab-strip.js +82 -0
- package/dist/components/workflow-run-tabs/run-tab-strip.js.map +1 -0
- package/dist/components/workflow-run-view/agent-config-failure-callout.d.ts +2 -2
- package/dist/components/workflow-run-view/agent-config-failure-callout.d.ts.map +1 -1
- package/dist/components/workflow-run-view/agent-config-failure-callout.js +4 -4
- package/dist/components/workflow-run-view/agent-config-failure-callout.js.map +1 -1
- package/dist/components/workflow-run-view/job-card.d.ts +2 -2
- package/dist/components/workflow-run-view/job-card.d.ts.map +1 -1
- package/dist/components/workflow-run-view/job-card.js +51 -32
- package/dist/components/workflow-run-view/job-card.js.map +1 -1
- package/dist/components/workflow-run-view/job-execution-switcher.d.ts +1 -1
- package/dist/components/workflow-run-view/job-execution-switcher.d.ts.map +1 -1
- package/dist/components/workflow-run-view/job-execution-switcher.js +20 -8
- package/dist/components/workflow-run-view/job-execution-switcher.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-selection.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-selection.js +40 -1
- package/dist/components/workflow-run-view/workflow-run-selection.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-states.d.ts +1 -0
- package/dist/components/workflow-run-view/workflow-run-states.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-states.js +10 -1
- package/dist/components/workflow-run-view/workflow-run-states.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.d.ts +10 -5
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.js +136 -85
- package/dist/components/workflow-run-view/workflow-run-view.js.map +1 -1
- package/dist/components/workflow-source-panel/index.d.ts +1 -0
- package/dist/components/workflow-source-panel/index.d.ts.map +1 -1
- package/dist/components/workflow-source-panel/index.js +1 -0
- package/dist/components/workflow-source-panel/index.js.map +1 -1
- package/dist/components/workflow-source-panel/workflow-source-content.d.ts +12 -0
- package/dist/components/workflow-source-panel/workflow-source-content.d.ts.map +1 -0
- package/dist/components/workflow-source-panel/workflow-source-content.js +53 -0
- package/dist/components/workflow-source-panel/workflow-source-content.js.map +1 -0
- package/dist/components/workflow-source-panel/workflow-source-panel.d.ts +1 -1
- package/dist/components/workflow-source-panel/workflow-source-panel.d.ts.map +1 -1
- package/dist/components/workflow-source-panel/workflow-source-panel.js +7 -54
- package/dist/components/workflow-source-panel/workflow-source-panel.js.map +1 -1
- package/dist/components/workflow-status/status-visuals.d.ts +4 -4
- package/dist/components/workflow-status/status-visuals.d.ts.map +1 -1
- package/dist/components/workflow-status/status-visuals.js +7 -0
- package/dist/components/workflow-status/status-visuals.js.map +1 -1
- package/dist/components/workflow-status/workflow-status-icon.d.ts +3 -4
- package/dist/components/workflow-status/workflow-status-icon.d.ts.map +1 -1
- package/dist/components/workflow-status/workflow-status-icon.js +6 -4
- package/dist/components/workflow-status/workflow-status-icon.js.map +1 -1
- package/dist/core/entities/job-execution.d.ts +10 -0
- package/dist/core/entities/job-execution.d.ts.map +1 -1
- package/dist/core/entities/job-execution.js +11 -0
- package/dist/core/entities/job-execution.js.map +1 -1
- package/dist/core/entities/job.d.ts +4 -2
- package/dist/core/entities/job.d.ts.map +1 -1
- package/dist/core/entities/job.js +8 -1
- package/dist/core/entities/job.js.map +1 -1
- package/dist/core/entities/step.d.ts +1 -1
- package/dist/core/entities/step.d.ts.map +1 -1
- package/dist/core/entities/step.js +2 -0
- package/dist/core/entities/step.js.map +1 -1
- package/dist/core/entities/workflow-run.d.ts +52 -4
- package/dist/core/entities/workflow-run.d.ts.map +1 -1
- package/dist/core/entities/workflow-run.js +22 -3
- package/dist/core/entities/workflow-run.js.map +1 -1
- package/dist/core/workflow-run-tabs.d.ts +9 -0
- package/dist/core/workflow-run-tabs.d.ts.map +1 -0
- package/dist/core/workflow-run-tabs.js +3 -0
- package/dist/core/workflow-run-tabs.js.map +1 -0
- package/dist/core/workflow-run.d.ts +6 -6
- package/dist/core/workflow-run.d.ts.map +1 -1
- package/dist/core/workflow-run.js +3 -3
- package/dist/core/workflow-run.js.map +1 -1
- package/dist/feature.d.ts +7 -7
- package/dist/feature.js +5 -5
- package/dist/feature.js.map +1 -1
- package/dist/hooks/api/workflow-run-mapper.d.ts +4 -3
- package/dist/hooks/api/workflow-run-mapper.d.ts.map +1 -1
- package/dist/hooks/api/workflow-run-mapper.js +31 -3
- package/dist/hooks/api/workflow-run-mapper.js.map +1 -1
- package/dist/hooks/api/workflow-runs.d.ts +4 -4
- package/dist/hooks/api/workflow-runs.d.ts.map +1 -1
- package/dist/hooks/api/workflow-runs.js +12 -4
- package/dist/hooks/api/workflow-runs.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/pages/project-workflows-page.js +46 -1
- package/dist/pages/project-workflows-page.js.map +1 -1
- package/dist/pages/workflow-run-detail-page.d.ts +11 -0
- package/dist/pages/workflow-run-detail-page.d.ts.map +1 -0
- package/dist/pages/workflow-run-detail-page.js +52 -0
- package/dist/pages/workflow-run-detail-page.js.map +1 -0
- package/dist/pages/workflow-run-list-page.d.ts +10 -0
- package/dist/pages/workflow-run-list-page.d.ts.map +1 -0
- package/dist/pages/workflow-run-list-page.js +43 -0
- package/dist/pages/workflow-run-list-page.js.map +1 -0
- package/dist/routes/inputs.d.ts +94 -5
- package/dist/routes/inputs.d.ts.map +1 -1
- package/dist/routes/inputs.js +199 -13
- package/dist/routes/inputs.js.map +1 -1
- package/dist/routes/project-route.d.ts +6 -0
- package/dist/routes/project-route.d.ts.map +1 -0
- package/dist/routes/project-route.js +25 -0
- package/dist/routes/project-route.js.map +1 -0
- package/dist/routes/run-detail.d.ts.map +1 -1
- package/dist/routes/run-detail.js +12 -7
- package/dist/routes/run-detail.js.map +1 -1
- package/dist/routes/runs.d.ts.map +1 -1
- package/dist/routes/runs.js +11 -6
- package/dist/routes/runs.js.map +1 -1
- package/dist/routes/workflows.d.ts.map +1 -1
- package/dist/routes/workflows.js +6 -5
- package/dist/routes/workflows.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/components/job-graph/job-duration-format.ts +11 -2
- package/src/components/job-graph/job-duration-label.tsx +5 -1
- package/src/components/job-graph/job-graph-content.tsx +7 -4
- package/src/components/job-graph/job-graph-view.test.tsx +19 -8
- package/src/components/job-graph/job-graph-view.tsx +6 -3
- package/src/components/job-graph/job-graph.stories.tsx +24 -20
- package/src/components/job-graph/job-node.stories.tsx +11 -6
- package/src/components/job-graph/job-node.test.tsx +82 -12
- package/src/components/job-graph/job-node.tsx +22 -15
- package/src/components/job-graph/types.ts +5 -1
- package/src/components/step-list/step-list.stories.tsx +2 -3
- package/src/components/step-list/step-list.tsx +3 -2
- package/src/components/workflow-run-duration-label.tsx +1 -1
- package/src/components/workflow-run-list/job-status-strip.tsx +189 -0
- package/src/components/workflow-run-list/run-display.test.ts +169 -30
- package/src/components/workflow-run-list/run-display.ts +116 -9
- package/src/components/workflow-run-list/types.ts +21 -17
- package/src/components/workflow-run-list/workflow-run-filter-menu.tsx +100 -0
- package/src/components/workflow-run-list/workflow-run-filters.tsx +243 -0
- package/src/components/workflow-run-list/workflow-run-list-content.tsx +44 -16
- package/src/components/workflow-run-list/workflow-run-list-states.tsx +128 -27
- package/src/components/workflow-run-list/workflow-run-list-view.test.tsx +441 -104
- package/src/components/workflow-run-list/workflow-run-list-view.tsx +73 -43
- package/src/components/workflow-run-list/workflow-run-list.stories.tsx +140 -20
- package/src/components/workflow-run-list/workflow-run-list.tsx +20 -10
- package/src/components/workflow-run-list/workflow-run-row.tsx +173 -106
- package/src/components/workflow-run-number-label.test.tsx +45 -0
- package/src/components/workflow-run-number-label.tsx +47 -0
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.test.tsx +7 -8
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.tsx +15 -14
- package/src/components/workflow-run-summary/workflow-run-summary.stories.tsx +29 -38
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +30 -24
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +102 -77
- package/src/components/workflow-run-tabs/index.ts +5 -0
- package/src/components/workflow-run-tabs/run-annotation-summary-line.test.tsx +69 -0
- package/src/components/workflow-run-tabs/run-annotation-summary-line.tsx +97 -0
- package/src/components/workflow-run-tabs/run-annotations-empty.tsx +11 -0
- package/src/components/workflow-run-tabs/run-jobs-list.tsx +151 -0
- package/src/components/workflow-run-tabs/run-tab-count.tsx +28 -0
- package/src/components/workflow-run-tabs/run-tab-strip.stories.tsx +52 -0
- package/src/components/workflow-run-tabs/run-tab-strip.test.tsx +117 -0
- package/src/components/workflow-run-tabs/run-tab-strip.tsx +97 -0
- package/src/components/workflow-run-view/agent-config-failure-callout.stories.tsx +2 -3
- package/src/components/workflow-run-view/agent-config-failure-callout.tsx +4 -4
- package/src/components/workflow-run-view/job-card.stories.tsx +11 -10
- package/src/components/workflow-run-view/job-card.test.tsx +115 -0
- package/src/components/workflow-run-view/job-card.tsx +74 -35
- package/src/components/workflow-run-view/job-execution-switcher.tsx +31 -9
- package/src/components/workflow-run-view/workflow-run-selection.test.ts +48 -0
- package/src/components/workflow-run-view/workflow-run-selection.ts +48 -1
- package/src/components/workflow-run-view/workflow-run-states.tsx +12 -1
- package/src/components/workflow-run-view/workflow-run-view.test.tsx +152 -94
- package/src/components/workflow-run-view/workflow-run-view.tsx +219 -95
- package/src/components/workflow-source-panel/index.ts +1 -0
- package/src/components/workflow-source-panel/workflow-source-content.tsx +84 -0
- package/src/components/workflow-source-panel/workflow-source-panel.tsx +14 -81
- package/src/components/workflow-status/status-visuals.test.ts +9 -0
- package/src/components/workflow-status/status-visuals.ts +6 -4
- package/src/components/workflow-status/workflow-status-icon.stories.tsx +10 -2
- package/src/components/workflow-status/workflow-status-icon.test.tsx +18 -0
- package/src/components/workflow-status/workflow-status-icon.tsx +17 -24
- package/src/core/entities/job-execution.ts +22 -0
- package/src/core/entities/job-status.test.ts +104 -0
- package/src/core/entities/job.ts +18 -3
- package/src/core/entities/step.ts +4 -0
- package/src/core/entities/workflow-run.ts +76 -7
- package/src/core/workflow-run-tabs.ts +8 -0
- package/src/core/workflow-run.test.ts +24 -9
- package/src/core/workflow-run.ts +17 -2
- package/src/feature.ts +5 -5
- package/src/hooks/api/workflow-run-mapper.ts +30 -3
- package/src/hooks/api/workflow-runs.test.tsx +2 -0
- package/src/hooks/api/workflow-runs.ts +12 -7
- package/src/index.ts +7 -2
- package/src/page-harness-budget.test.ts +1 -1
- package/src/pages/project-workflows-page.test.tsx +59 -5
- package/src/pages/project-workflows-page.tsx +34 -1
- package/src/pages/workflow-run-detail-page.tsx +72 -0
- package/src/pages/workflow-run-list-page.tsx +65 -0
- package/src/pages/workflow-run-pages.test.tsx +823 -0
- package/src/routes/inputs.test.ts +240 -12
- package/src/routes/inputs.ts +215 -11
- package/src/routes/project-route.tsx +25 -0
- package/src/routes/run-detail.tsx +15 -8
- package/src/routes/runs.tsx +14 -7
- package/src/routes/workflows.tsx +5 -4
- package/src/storybook-config.test.ts +27 -0
- package/test/fixtures/workflow-run.ts +76 -7
- package/test/pages.tsx +18 -8
- package/test/render.tsx +8 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.test.json +7 -1
- package/dist/components/workflow-run-list/workflow-run-list-header.d.ts +0 -10
- package/dist/components/workflow-run-list/workflow-run-list-header.d.ts.map +0 -1
- package/dist/components/workflow-run-list/workflow-run-list-header.js +0 -55
- package/dist/components/workflow-run-list/workflow-run-list-header.js.map +0 -1
- package/dist/pages/workflow-run-first-time-use.d.ts +0 -6
- package/dist/pages/workflow-run-first-time-use.d.ts.map +0 -1
- package/dist/pages/workflow-run-first-time-use.js +0 -17
- package/dist/pages/workflow-run-first-time-use.js.map +0 -1
- package/dist/pages/workflow-run-page.d.ts +0 -10
- package/dist/pages/workflow-run-page.d.ts.map +0 -1
- package/dist/pages/workflow-run-page.js +0 -90
- package/dist/pages/workflow-run-page.js.map +0 -1
- package/src/components/workflow-run-list/workflow-run-list-header.tsx +0 -53
- package/src/pages/workflow-run-first-time-use.tsx +0 -17
- package/src/pages/workflow-run-page.test.tsx +0 -519
- package/src/pages/workflow-run-page.tsx +0 -94
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from '@shipfox/react-ui/button';
|
|
3
|
-
import { CodeBlock, CodeBlockBody, CodeBlockContent, CodeBlockCopyButton, CodeBlockFilename, CodeBlockFiles, CodeBlockHeader, CodeBlockItem } from '@shipfox/react-ui/code-block';
|
|
4
3
|
import { Sheet, SheetClose, SheetContent, SheetTitle } from '@shipfox/react-ui/sheet';
|
|
5
4
|
import { cn } from '@shipfox/react-ui/utils';
|
|
6
|
-
|
|
7
|
-
const WORKFLOW_SOURCE_CODE_THEMES = {
|
|
8
|
-
light: 'vitesse-dark',
|
|
9
|
-
dark: 'vitesse-dark'
|
|
10
|
-
};
|
|
5
|
+
import { WorkflowSourceContent } from './workflow-source-content.js';
|
|
11
6
|
export function WorkflowSourcePanel({ id, source, open, onClose, highlightedLineRange, scrollHighlightedIntoView, className }) {
|
|
12
7
|
const sheetOpen = open && source !== null;
|
|
13
8
|
if (!sheetOpen) return null;
|
|
@@ -26,38 +21,11 @@ export function WorkflowSourcePanel({ id, source, open, onClose, highlightedLine
|
|
|
26
21
|
className: "sr-only",
|
|
27
22
|
children: "Workflow source"
|
|
28
23
|
}),
|
|
29
|
-
/*#__PURE__*/ _jsx(
|
|
24
|
+
/*#__PURE__*/ _jsx(WorkflowSourceContent, {
|
|
30
25
|
source: source,
|
|
31
26
|
highlightedLineRange: highlightedLineRange,
|
|
32
|
-
scrollHighlightedIntoView: scrollHighlightedIntoView
|
|
33
|
-
|
|
34
|
-
]
|
|
35
|
-
}) : null
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function WorkflowSourcePanelContent({ source, highlightedLineRange, scrollHighlightedIntoView }) {
|
|
39
|
-
const data = [
|
|
40
|
-
{
|
|
41
|
-
language: 'yaml',
|
|
42
|
-
filename: WORKFLOW_SOURCE_FILENAME,
|
|
43
|
-
code: source.content
|
|
44
|
-
}
|
|
45
|
-
];
|
|
46
|
-
return /*#__PURE__*/ _jsxs(CodeBlock, {
|
|
47
|
-
data: data,
|
|
48
|
-
className: "flex size-full flex-col rounded-none bg-background-contrast-base shadow-none",
|
|
49
|
-
children: [
|
|
50
|
-
/*#__PURE__*/ _jsxs(CodeBlockHeader, {
|
|
51
|
-
className: "shrink-0 border-b border-border-contrast-base bg-background-contrast-base",
|
|
52
|
-
children: [
|
|
53
|
-
/*#__PURE__*/ _jsx(CodeBlockFiles, {
|
|
54
|
-
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockFilename, {
|
|
55
|
-
value: item.filename,
|
|
56
|
-
children: item.filename
|
|
57
|
-
})
|
|
58
|
-
}),
|
|
59
|
-
/*#__PURE__*/ _jsx(CodeBlockCopyButton, {}),
|
|
60
|
-
/*#__PURE__*/ _jsx(SheetClose, {
|
|
27
|
+
scrollHighlightedIntoView: scrollHighlightedIntoView,
|
|
28
|
+
headerAction: /*#__PURE__*/ _jsx(SheetClose, {
|
|
61
29
|
asChild: true,
|
|
62
30
|
children: /*#__PURE__*/ _jsx(Button, {
|
|
63
31
|
type: "button",
|
|
@@ -67,24 +35,9 @@ function WorkflowSourcePanelContent({ source, highlightedLineRange, scrollHighli
|
|
|
67
35
|
"aria-label": "Close source"
|
|
68
36
|
})
|
|
69
37
|
})
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
className: "flex min-h-0 flex-1 overflow-auto scrollbar",
|
|
74
|
-
children: (item)=>/*#__PURE__*/ _jsx(CodeBlockItem, {
|
|
75
|
-
value: item.filename,
|
|
76
|
-
className: cn('min-h-full px-0 pb-0', '[&>div]:rounded-none [&>div]:border-0 [&>div]:bg-background-contrast-base [&>div]:dark:bg-background-contrast-base', '[&_code]:!text-sm [&_code]:!text-foreground-neutral-on-inverted [&_.line]:!text-sm [&_.line]:before:!text-sm [&_.line]:before:!text-foreground-neutral-muted'),
|
|
77
|
-
children: /*#__PURE__*/ _jsx(CodeBlockContent, {
|
|
78
|
-
language: "yaml",
|
|
79
|
-
themes: WORKFLOW_SOURCE_CODE_THEMES,
|
|
80
|
-
syntaxHighlighting: true,
|
|
81
|
-
highlightedLineRange: highlightedLineRange,
|
|
82
|
-
scrollHighlightedIntoView: scrollHighlightedIntoView,
|
|
83
|
-
children: item.code
|
|
84
|
-
})
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
]
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
}) : null
|
|
88
41
|
});
|
|
89
42
|
}
|
|
90
43
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/workflow-source-panel/workflow-source-panel.tsx"],"sourcesContent":["import {Button} from '@shipfox/react-ui/button';\nimport
|
|
1
|
+
{"version":3,"sources":["../../../src/components/workflow-source-panel/workflow-source-panel.tsx"],"sourcesContent":["import {Button} from '@shipfox/react-ui/button';\nimport type {CodeBlockHighlightedLineRange} from '@shipfox/react-ui/code-block';\nimport {Sheet, SheetClose, SheetContent, SheetTitle} from '@shipfox/react-ui/sheet';\nimport {cn} from '@shipfox/react-ui/utils';\nimport type {WorkflowSourceSnapshot} from '#core/workflow-run.js';\nimport {WorkflowSourceContent} from './workflow-source-content.js';\n\nexport interface WorkflowSourcePanelProps {\n id: string;\n source: WorkflowSourceSnapshot | null;\n open: boolean;\n onClose: () => void;\n highlightedLineRange?: CodeBlockHighlightedLineRange | null | undefined;\n scrollHighlightedIntoView?: boolean | undefined;\n className?: string | undefined;\n}\n\nexport function WorkflowSourcePanel({\n id,\n source,\n open,\n onClose,\n highlightedLineRange,\n scrollHighlightedIntoView,\n className,\n}: WorkflowSourcePanelProps) {\n const sheetOpen = open && source !== null;\n\n if (!sheetOpen) return null;\n\n return (\n <Sheet\n open\n onOpenChange={(nextOpen) => {\n if (!nextOpen) onClose();\n }}\n >\n {source ? (\n <SheetContent\n id={id}\n side=\"right\"\n aria-describedby={undefined}\n className={cn(\n 'w-screen max-w-none border-l-0 bg-background-contrast-base p-0 shadow-none sm:w-[min(85vw,1120px)] sm:max-w-none [&_.shadow-separator-inset]:shadow-none',\n className,\n )}\n >\n <SheetTitle className=\"sr-only\">Workflow source</SheetTitle>\n <WorkflowSourceContent\n source={source}\n highlightedLineRange={highlightedLineRange}\n scrollHighlightedIntoView={scrollHighlightedIntoView}\n headerAction={\n <SheetClose asChild>\n <Button\n type=\"button\"\n variant=\"transparentMuted\"\n size=\"sm\"\n iconLeft=\"close\"\n aria-label=\"Close source\"\n />\n </SheetClose>\n }\n />\n </SheetContent>\n ) : null}\n </Sheet>\n );\n}\n"],"names":["Button","Sheet","SheetClose","SheetContent","SheetTitle","cn","WorkflowSourceContent","WorkflowSourcePanel","id","source","open","onClose","highlightedLineRange","scrollHighlightedIntoView","className","sheetOpen","onOpenChange","nextOpen","side","aria-describedby","undefined","headerAction","asChild","type","variant","size","iconLeft","aria-label"],"mappings":";AAAA,SAAQA,MAAM,QAAO,2BAA2B;AAEhD,SAAQC,KAAK,EAAEC,UAAU,EAAEC,YAAY,EAAEC,UAAU,QAAO,0BAA0B;AACpF,SAAQC,EAAE,QAAO,0BAA0B;AAE3C,SAAQC,qBAAqB,QAAO,+BAA+B;AAYnE,OAAO,SAASC,oBAAoB,EAClCC,EAAE,EACFC,MAAM,EACNC,IAAI,EACJC,OAAO,EACPC,oBAAoB,EACpBC,yBAAyB,EACzBC,SAAS,EACgB;IACzB,MAAMC,YAAYL,QAAQD,WAAW;IAErC,IAAI,CAACM,WAAW,OAAO;IAEvB,qBACE,KAACd;QACCS,IAAI;QACJM,cAAc,CAACC;YACb,IAAI,CAACA,UAAUN;QACjB;kBAECF,uBACC,MAACN;YACCK,IAAIA;YACJU,MAAK;YACLC,oBAAkBC;YAClBN,WAAWT,GACT,4JACAS;;8BAGF,KAACV;oBAAWU,WAAU;8BAAU;;8BAChC,KAACR;oBACCG,QAAQA;oBACRG,sBAAsBA;oBACtBC,2BAA2BA;oBAC3BQ,4BACE,KAACnB;wBAAWoB,OAAO;kCACjB,cAAA,KAACtB;4BACCuB,MAAK;4BACLC,SAAQ;4BACRC,MAAK;4BACLC,UAAS;4BACTC,cAAW;;;;;aAMnB;;AAGV"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { BadgeVariant } from '@shipfox/react-ui/badge';
|
|
2
2
|
import type { DotVariant } from '@shipfox/react-ui/dot';
|
|
3
|
-
import type {
|
|
4
|
-
export type {
|
|
3
|
+
import type { WorkflowDisplayStatus } from '#core/workflow-run.js';
|
|
4
|
+
export type { WorkflowDisplayStatus };
|
|
5
5
|
export interface WorkflowStatusVisual {
|
|
6
|
-
kind:
|
|
6
|
+
kind: WorkflowDisplayStatus;
|
|
7
7
|
label: string;
|
|
8
8
|
dot: DotVariant;
|
|
9
9
|
badge: BadgeVariant;
|
|
10
10
|
}
|
|
11
|
-
export declare function getWorkflowStatusVisual(status:
|
|
11
|
+
export declare function getWorkflowStatusVisual(status: WorkflowDisplayStatus): WorkflowStatusVisual;
|
|
12
12
|
//# sourceMappingURL=status-visuals.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-visuals.d.ts","sourceRoot":"","sources":["../../../src/components/workflow-status/status-visuals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"status-visuals.d.ts","sourceRoot":"","sources":["../../../src/components/workflow-status/status-visuals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,uBAAuB,CAAC;AAEjE,YAAY,EAAC,qBAAqB,EAAC,CAAC;AAEpC,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,UAAU,CAAC;IAChB,KAAK,EAAE,YAAY,CAAC;CACrB;AAMD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,qBAAqB,GAAG,oBAAoB,CAoB3F"}
|
|
@@ -18,6 +18,13 @@ export function getWorkflowStatusVisual(status) {
|
|
|
18
18
|
dot: 'info',
|
|
19
19
|
badge: 'info'
|
|
20
20
|
};
|
|
21
|
+
case 'listening':
|
|
22
|
+
return {
|
|
23
|
+
kind: 'listening',
|
|
24
|
+
label: 'Listening',
|
|
25
|
+
dot: 'info',
|
|
26
|
+
badge: 'info'
|
|
27
|
+
};
|
|
21
28
|
case 'succeeded':
|
|
22
29
|
return {
|
|
23
30
|
kind: 'succeeded',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/workflow-status/status-visuals.ts"],"sourcesContent":["import type {BadgeVariant} from '@shipfox/react-ui/badge';\nimport type {DotVariant} from '@shipfox/react-ui/dot';\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/workflow-status/status-visuals.ts"],"sourcesContent":["import type {BadgeVariant} from '@shipfox/react-ui/badge';\nimport type {DotVariant} from '@shipfox/react-ui/dot';\nimport type {WorkflowDisplayStatus} from '#core/workflow-run.js';\n\nexport type {WorkflowDisplayStatus};\n\nexport interface WorkflowStatusVisual {\n kind: WorkflowDisplayStatus;\n label: string;\n dot: DotVariant;\n badge: BadgeVariant;\n}\n\n// The status -> visual mapping shared by the run-header pill (color + label) and\n// WorkflowStatusIcon (which renders the glyph per kind). The exhaustive switch turns any new\n// status the API grows into (DESIGN.md section 9) into a compile error; reserve the `warning`\n// tone for the queued/awaiting-* states when they land.\nexport function getWorkflowStatusVisual(status: WorkflowDisplayStatus): WorkflowStatusVisual {\n switch (status) {\n case 'pending':\n return {kind: 'pending', label: 'Pending', dot: 'neutral', badge: 'neutral'};\n case 'running':\n return {kind: 'running', label: 'Running', dot: 'info', badge: 'info'};\n case 'listening':\n return {kind: 'listening', label: 'Listening', dot: 'info', badge: 'info'};\n case 'succeeded':\n return {kind: 'succeeded', label: 'Succeeded', dot: 'success', badge: 'success'};\n case 'failed':\n return {kind: 'failed', label: 'Failed', dot: 'error', badge: 'error'};\n case 'cancelled':\n return {kind: 'cancelled', label: 'Cancelled', dot: 'neutral', badge: 'neutral'};\n case 'skipped':\n return {kind: 'skipped', label: 'Skipped', dot: 'neutral', badge: 'neutral'};\n }\n\n const exhaustive: never = status;\n return exhaustive;\n}\n"],"names":["getWorkflowStatusVisual","status","kind","label","dot","badge","exhaustive"],"mappings":"AAaA,iFAAiF;AACjF,6FAA6F;AAC7F,8FAA8F;AAC9F,wDAAwD;AACxD,OAAO,SAASA,wBAAwBC,MAA6B;IACnE,OAAQA;QACN,KAAK;YACH,OAAO;gBAACC,MAAM;gBAAWC,OAAO;gBAAWC,KAAK;gBAAWC,OAAO;YAAS;QAC7E,KAAK;YACH,OAAO;gBAACH,MAAM;gBAAWC,OAAO;gBAAWC,KAAK;gBAAQC,OAAO;YAAM;QACvE,KAAK;YACH,OAAO;gBAACH,MAAM;gBAAaC,OAAO;gBAAaC,KAAK;gBAAQC,OAAO;YAAM;QAC3E,KAAK;YACH,OAAO;gBAACH,MAAM;gBAAaC,OAAO;gBAAaC,KAAK;gBAAWC,OAAO;YAAS;QACjF,KAAK;YACH,OAAO;gBAACH,MAAM;gBAAUC,OAAO;gBAAUC,KAAK;gBAASC,OAAO;YAAO;QACvE,KAAK;YACH,OAAO;gBAACH,MAAM;gBAAaC,OAAO;gBAAaC,KAAK;gBAAWC,OAAO;YAAS;QACjF,KAAK;YACH,OAAO;gBAACH,MAAM;gBAAWC,OAAO;gBAAWC,KAAK;gBAAWC,OAAO;YAAS;IAC/E;IAEA,MAAMC,aAAoBL;IAC1B,OAAOK;AACT"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type WorkflowDisplayStatus } from './status-visuals.js';
|
|
2
2
|
export interface WorkflowStatusIconProps {
|
|
3
|
-
status:
|
|
4
|
-
jobMode?: 'one_shot' | 'listening';
|
|
3
|
+
status: WorkflowDisplayStatus;
|
|
5
4
|
/** Optical diameter in px: 14 in the DAG node and run row. */
|
|
6
5
|
size?: number;
|
|
7
6
|
/** Pulsing halo for the running state. */
|
|
@@ -18,5 +17,5 @@ export interface WorkflowStatusIconProps {
|
|
|
18
17
|
* names the state. Carries the status as its accessible name (`role="img"`) and, by default,
|
|
19
18
|
* a hover tooltip, so the state is reachable by pointer and assistive tech everywhere.
|
|
20
19
|
*/
|
|
21
|
-
export declare function WorkflowStatusIcon({ status,
|
|
20
|
+
export declare function WorkflowStatusIcon({ status, size, ripple, tooltip, className, }: WorkflowStatusIconProps): import("react").JSX.Element;
|
|
22
21
|
//# sourceMappingURL=workflow-status-icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-status-icon.d.ts","sourceRoot":"","sources":["../../../src/components/workflow-status/workflow-status-icon.tsx"],"names":[],"mappings":"AAKA,OAAO,EAA0B,KAAK,
|
|
1
|
+
{"version":3,"file":"workflow-status-icon.d.ts","sourceRoot":"","sources":["../../../src/components/workflow-status/workflow-status-icon.tsx"],"names":[],"mappings":"AAKA,OAAO,EAA0B,KAAK,qBAAqB,EAAC,MAAM,qBAAqB,CAAC;AAyCxF,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,IAAS,EACT,MAAa,EACb,OAAc,EACd,SAAS,GACV,EAAE,uBAAuB,+BAwDzB"}
|
|
@@ -42,19 +42,21 @@ const PENDING_RING_MASK = 'radial-gradient(circle closest-side, transparent 0 52
|
|
|
42
42
|
* The job/run/step state indicator: an icon-in-circle glyph whose shape (not just color)
|
|
43
43
|
* names the state. Carries the status as its accessible name (`role="img"`) and, by default,
|
|
44
44
|
* a hover tooltip, so the state is reachable by pointer and assistive tech everywhere.
|
|
45
|
-
*/ export function WorkflowStatusIcon({ status,
|
|
45
|
+
*/ export function WorkflowStatusIcon({ status, size = 14, ripple = true, tooltip = true, className }) {
|
|
46
46
|
const visual = getWorkflowStatusVisual(status);
|
|
47
47
|
const box = dotSizeClass[size] ?? 'size-14';
|
|
48
48
|
let glyph;
|
|
49
|
-
if (visual.kind === '
|
|
50
|
-
glyph =
|
|
49
|
+
if (visual.kind === 'listening') {
|
|
50
|
+
glyph = /*#__PURE__*/ _jsx("span", {
|
|
51
51
|
className: cn('inline-flex shrink-0 items-center justify-center rounded-full bg-current', box, toneByVariant.info),
|
|
52
52
|
children: /*#__PURE__*/ _jsx(Icon, {
|
|
53
53
|
name: "pulseLine",
|
|
54
54
|
size: Math.max(8, Math.round(size * 0.7)),
|
|
55
55
|
className: "text-white"
|
|
56
56
|
})
|
|
57
|
-
})
|
|
57
|
+
});
|
|
58
|
+
} else if (visual.kind === 'running') {
|
|
59
|
+
glyph = /*#__PURE__*/ _jsx(Dot, {
|
|
58
60
|
variant: "info",
|
|
59
61
|
ripple: ripple,
|
|
60
62
|
className: box
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/workflow-status/workflow-status-icon.tsx"],"sourcesContent":["import {Dot, type DotVariant} from '@shipfox/react-ui/dot';\nimport {Icon, type IconName} from '@shipfox/react-ui/icon';\nimport {Tooltip, TooltipContent, TooltipTrigger} from '@shipfox/react-ui/tooltip';\nimport {cn} from '@shipfox/react-ui/utils';\nimport type {ReactNode} from 'react';\nimport {getWorkflowStatusVisual, type
|
|
1
|
+
{"version":3,"sources":["../../../src/components/workflow-status/workflow-status-icon.tsx"],"sourcesContent":["import {Dot, type DotVariant} from '@shipfox/react-ui/dot';\nimport {Icon, type IconName} from '@shipfox/react-ui/icon';\nimport {Tooltip, TooltipContent, TooltipTrigger} from '@shipfox/react-ui/tooltip';\nimport {cn} from '@shipfox/react-ui/utils';\nimport type {ReactNode} from 'react';\nimport {getWorkflowStatusVisual, type WorkflowDisplayStatus} from './status-visuals.js';\n\n// Status glyphs use the same saturated accent tokens as IconBadge/StatusBadge.\nconst toneByVariant: Record<DotVariant, string> = {\n neutral: 'text-tag-neutral-icon',\n info: 'text-tag-blue-icon',\n feature: 'text-tag-purple-icon',\n success: 'text-tag-success-icon',\n warning: 'text-tag-warning-icon',\n error: 'text-tag-error-icon',\n};\n\n// Terminal states are self-contained solid discs; the shape names the state. Running and\n// pending render their own shapes (the live Dot and a bold ring), so they aren't here.\nconst glyphByKind: Partial<Record<WorkflowDisplayStatus, IconName>> = {\n succeeded: 'checkCircleSolid',\n failed: 'xCircleSolid',\n cancelled: 'forbid2Fill',\n skipped: 'forbid2Fill',\n};\n\n// The solid discs fill ~90-95% of their viewBox and forbid2Fill ~83%, so one numeric size\n// renders different diameters. These multipliers land every disc at the running Dot's diameter.\nconst glyphScale: Partial<Record<IconName, number>> = {\n checkCircleSolid: 1.12,\n xCircleSolid: 1.06,\n forbid2Fill: 1.22,\n};\n\n// Only the two sizes the app uses are mapped; both are literal strings so Tailwind emits them.\nconst dotSizeClass: Record<number, string> = {\n 12: 'size-12',\n 14: 'size-14',\n 20: 'size-20',\n};\n\n// Pending is a neutral ring: a filled disc with a transparent center punched out by a radial\n// mask. Reads as \"not started\" and stays visually consistent with the solid discs - much\n// bolder than a dotted outline. Tune the mask stops to make the band thicker or thinner.\nconst PENDING_RING_MASK = 'radial-gradient(circle closest-side, transparent 0 52%, #000 56%)';\n\nexport interface WorkflowStatusIconProps {\n status: WorkflowDisplayStatus;\n /** Optical diameter in px: 14 in the DAG node and run row. */\n size?: number;\n /** Pulsing halo for the running state. */\n ripple?: boolean;\n /**\n * Wrap the indicator in a hover tooltip naming the status. Defaults on. Pass false where\n * the status text is already visible next to it (the DAG node) to avoid a redundant tooltip.\n */\n tooltip?: boolean;\n className?: string;\n}\n\n/**\n * The job/run/step state indicator: an icon-in-circle glyph whose shape (not just color)\n * names the state. Carries the status as its accessible name (`role=\"img\"`) and, by default,\n * a hover tooltip, so the state is reachable by pointer and assistive tech everywhere.\n */\nexport function WorkflowStatusIcon({\n status,\n size = 14,\n ripple = true,\n tooltip = true,\n className,\n}: WorkflowStatusIconProps) {\n const visual = getWorkflowStatusVisual(status);\n const box = dotSizeClass[size] ?? 'size-14';\n\n let glyph: ReactNode;\n if (visual.kind === 'listening') {\n glyph = (\n <span\n className={cn(\n 'inline-flex shrink-0 items-center justify-center rounded-full bg-current',\n box,\n toneByVariant.info,\n )}\n >\n <Icon name=\"pulseLine\" size={Math.max(8, Math.round(size * 0.7))} className=\"text-white\" />\n </span>\n );\n } else if (visual.kind === 'running') {\n glyph = <Dot variant=\"info\" ripple={ripple} className={box} />;\n } else if (visual.kind === 'pending') {\n glyph = (\n <span\n className={cn('rounded-full bg-current', box, toneByVariant.neutral)}\n style={{maskImage: PENDING_RING_MASK, WebkitMaskImage: PENDING_RING_MASK}}\n />\n );\n } else {\n const name = glyphByKind[visual.kind] ?? 'forbid2Fill';\n glyph = (\n <span\n className={cn(\n 'inline-flex shrink-0 items-center justify-center',\n box,\n toneByVariant[visual.dot],\n (visual.kind === 'cancelled' || visual.kind === 'skipped') && 'opacity-70',\n )}\n >\n <Icon name={name} size={Math.round(size * (glyphScale[name] ?? 1))} />\n </span>\n );\n }\n\n const indicator = (\n <span role=\"img\" aria-label={visual.label} className={cn('inline-flex shrink-0', className)}>\n {glyph}\n </span>\n );\n\n if (!tooltip) return indicator;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{indicator}</TooltipTrigger>\n <TooltipContent>{visual.label}</TooltipContent>\n </Tooltip>\n );\n}\n"],"names":["Dot","Icon","Tooltip","TooltipContent","TooltipTrigger","cn","getWorkflowStatusVisual","toneByVariant","neutral","info","feature","success","warning","error","glyphByKind","succeeded","failed","cancelled","skipped","glyphScale","checkCircleSolid","xCircleSolid","forbid2Fill","dotSizeClass","PENDING_RING_MASK","WorkflowStatusIcon","status","size","ripple","tooltip","className","visual","box","glyph","kind","span","name","Math","max","round","variant","style","maskImage","WebkitMaskImage","dot","indicator","role","aria-label","label","asChild"],"mappings":";AAAA,SAAQA,GAAG,QAAwB,wBAAwB;AAC3D,SAAQC,IAAI,QAAsB,yBAAyB;AAC3D,SAAQC,OAAO,EAAEC,cAAc,EAAEC,cAAc,QAAO,4BAA4B;AAClF,SAAQC,EAAE,QAAO,0BAA0B;AAE3C,SAAQC,uBAAuB,QAAmC,sBAAsB;AAExF,+EAA+E;AAC/E,MAAMC,gBAA4C;IAChDC,SAAS;IACTC,MAAM;IACNC,SAAS;IACTC,SAAS;IACTC,SAAS;IACTC,OAAO;AACT;AAEA,yFAAyF;AACzF,uFAAuF;AACvF,MAAMC,cAAgE;IACpEC,WAAW;I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AI,KAAK,SAAQ,KAAM;sBAGhE,cAAA,KAACjC;gBAAKmC,MAAMA;gBAAMT,MAAMU,KAAKE,KAAK,CAACZ,OAAQR,CAAAA,UAAU,CAACiB,KAAK,IAAI,CAAA;;;IAGrE;IAEA,MAAMS,0BACJ,KAACV;QAAKW,MAAK;QAAMC,cAAYhB,OAAOiB,KAAK;QAAElB,WAAWzB,GAAG,wBAAwByB;kBAC9EG;;IAIL,IAAI,CAACJ,SAAS,OAAOgB;IAErB,qBACE,MAAC3C;;0BACC,KAACE;gBAAe6C,OAAO;0BAAEJ;;0BACzB,KAAC1C;0BAAgB4B,OAAOiB,KAAK;;;;AAGnC"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { type Duration } from 'date-fns';
|
|
2
2
|
import type { Step } from './step.js';
|
|
3
3
|
export type JobExecutionStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
4
|
+
export type JobExecutionDisplayStatus = JobExecutionStatus;
|
|
4
5
|
export interface WorkflowExecutionEvent {
|
|
5
6
|
source: string;
|
|
6
7
|
event: string;
|
|
7
8
|
deliveryId: string;
|
|
8
9
|
receivedAt: string;
|
|
10
|
+
project: {
|
|
11
|
+
id: string;
|
|
12
|
+
} | null;
|
|
13
|
+
repository: string | null;
|
|
14
|
+
ref: string | null;
|
|
15
|
+
commit: string | null;
|
|
9
16
|
data: unknown;
|
|
10
17
|
}
|
|
11
18
|
export type JobExecutionTime = {
|
|
@@ -52,10 +59,13 @@ export declare class JobExecution {
|
|
|
52
59
|
updatedAt: string;
|
|
53
60
|
steps: Step[];
|
|
54
61
|
constructor(fields: JobExecutionFields);
|
|
62
|
+
get displayName(): string;
|
|
55
63
|
get queueTime(): JobExecutionTime | null;
|
|
56
64
|
get runTime(): JobExecutionTime | null;
|
|
57
65
|
get displayDuration(): JobExecutionDisplayDuration | null;
|
|
58
66
|
}
|
|
67
|
+
export declare function deriveJobExecutionDisplayStatus({ status, steps, }: Pick<JobExecution, 'status' | 'steps'>): JobExecutionDisplayStatus;
|
|
68
|
+
export declare function isTerminalJobExecutionStatus(status: JobExecutionStatus): boolean;
|
|
59
69
|
export declare function jobExecutionQueueTimeFromTimestamps({ queuedAt, startedAt, finishedAt, }: {
|
|
60
70
|
queuedAt: string | null;
|
|
61
71
|
startedAt: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-execution.d.ts","sourceRoot":"","sources":["../../../src/core/entities/job-execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,QAAQ,EAAqB,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAC9F,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;CACf;AACD,MAAM,MAAM,gBAAgB,GACxB;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAC,GACnC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC;AACrC,MAAM,MAAM,2BAA2B,GACnC,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAC,GAAG,gBAAgB,CAAC,GACpC,CAAC;IAAC,IAAI,EAAE,KAAK,CAAA;CAAC,GAAG,gBAAgB,CAAC,CAAC;AAEvC,UAAU,kBAAkB;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,kBAAkB,CAAC;IAC3B,YAAY,EA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|
Object.assign(this, fields);
|
|
5
5
|
}
|
|
6
|
+
get displayName() {
|
|
7
|
+
return this.name;
|
|
8
|
+
}
|
|
6
9
|
get queueTime() {
|
|
7
10
|
return jobExecutionQueueTimeFromTimestamps(this);
|
|
8
11
|
}
|
|
@@ -13,6 +16,14 @@ export class JobExecution {
|
|
|
13
16
|
return jobExecutionDisplayDurationFromTimestamps(this);
|
|
14
17
|
}
|
|
15
18
|
}
|
|
19
|
+
export function deriveJobExecutionDisplayStatus({ status, steps }) {
|
|
20
|
+
if (isTerminalJobExecutionStatus(status)) return status;
|
|
21
|
+
if (steps.some((step)=>step.status === 'running')) return 'running';
|
|
22
|
+
return 'pending';
|
|
23
|
+
}
|
|
24
|
+
export function isTerminalJobExecutionStatus(status) {
|
|
25
|
+
return status === 'succeeded' || status === 'failed' || status === 'cancelled';
|
|
26
|
+
}
|
|
16
27
|
export function jobExecutionQueueTimeFromTimestamps({ queuedAt, startedAt, finishedAt }) {
|
|
17
28
|
if (queuedAt === null) return null;
|
|
18
29
|
if (finishedAt !== null && startedAt === null) return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/entities/job-execution.ts"],"sourcesContent":["import {type Duration, intervalToDuration} from 'date-fns';\nimport type {Step} from './step.js';\n\nexport type JobExecutionStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';\nexport interface WorkflowExecutionEvent {\n source: string;\n event: string;\n deliveryId: string;\n receivedAt: string;\n data: unknown;\n}\nexport type JobExecutionTime =\n | {state: 'fixed'; elapsed: Duration}\n | {state: 'live'; fromIso: string};\nexport type JobExecutionDisplayDuration =\n | ({kind: 'queue'} & JobExecutionTime)\n | ({kind: 'run'} & JobExecutionTime);\n\ninterface JobExecutionFields {\n id: string;\n jobId: string;\n sequence: number;\n name: string;\n status: JobExecutionStatus;\n statusReason: string | null;\n triggerEvents: WorkflowExecutionEvent[];\n queuedAt: string | null;\n startedAt: string | null;\n finishedAt: string | null;\n timedOutAt: string | null;\n createdAt: string;\n updatedAt: string;\n steps: Step[];\n}\n\nexport class JobExecution {\n id!: string;\n jobId!: string;\n sequence!: number;\n name!: string;\n status!: JobExecutionStatus;\n statusReason!: string | null;\n triggerEvents!: WorkflowExecutionEvent[];\n queuedAt!: string | null;\n startedAt!: string | null;\n finishedAt!: string | null;\n timedOutAt!: string | null;\n createdAt!: string;\n updatedAt!: string;\n steps!: Step[];\n\n constructor(fields: JobExecutionFields) {\n Object.assign(this, fields);\n }\n\n get queueTime(): JobExecutionTime | null {\n return jobExecutionQueueTimeFromTimestamps(this);\n }\n\n get runTime(): JobExecutionTime | null {\n return jobExecutionRunTimeFromTimestamps(this);\n }\n\n get displayDuration(): JobExecutionDisplayDuration | null {\n return jobExecutionDisplayDurationFromTimestamps(this);\n }\n}\n\nexport function jobExecutionQueueTimeFromTimestamps({\n queuedAt,\n startedAt,\n finishedAt,\n}: {\n queuedAt: string | null;\n startedAt: string | null;\n finishedAt: string | null;\n}): JobExecutionTime | null {\n if (queuedAt === null) return null;\n if (finishedAt !== null && startedAt === null) return null;\n if (startedAt === null) return {state: 'live', fromIso: queuedAt};\n\n const elapsed = durationBetween(queuedAt, startedAt);\n return elapsed === null ? null : {state: 'fixed', elapsed};\n}\n\nexport function jobExecutionRunTimeFromTimestamps({\n startedAt,\n finishedAt,\n}: {\n startedAt: string | null;\n finishedAt: string | null;\n}): JobExecutionTime | null {\n if (startedAt === null) return null;\n if (finishedAt === null) return {state: 'live', fromIso: startedAt};\n\n const elapsed = durationBetween(startedAt, finishedAt);\n return elapsed === null ? null : {state: 'fixed', elapsed};\n}\n\nexport function jobExecutionDisplayDurationFromTimestamps(timestamps: {\n queuedAt: string | null;\n startedAt: string | null;\n finishedAt: string | null;\n}): JobExecutionDisplayDuration | null {\n const runTime = jobExecutionRunTimeFromTimestamps(timestamps);\n if (runTime !== null) return {kind: 'run', ...runTime};\n\n const queueTime = jobExecutionQueueTimeFromTimestamps(timestamps);\n if (queueTime !== null) return {kind: 'queue', ...queueTime};\n\n return null;\n}\n\nfunction durationBetween(from: string, to: string): Duration | null {\n const start = new Date(from);\n const end = new Date(to);\n if (!Number.isFinite(start.getTime()) || !Number.isFinite(end.getTime())) return null;\n\n return intervalToDuration({\n start,\n end: end < start ? start : end,\n });\n}\n"],"names":["intervalToDuration","JobExecution","fields","Object","assign","queueTime","jobExecutionQueueTimeFromTimestamps","runTime","jobExecutionRunTimeFromTimestamps","displayDuration","jobExecutionDisplayDurationFromTimestamps","queuedAt","startedAt","finishedAt","state","fromIso","elapsed","durationBetween","timestamps","kind","from","to","start","Date","end","Number","isFinite","getTime"],"mappings":"AAAA,SAAuBA,kBAAkB,QAAO,WAAW;
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/job-execution.ts"],"sourcesContent":["import {type Duration, intervalToDuration} from 'date-fns';\nimport type {Step} from './step.js';\n\nexport type JobExecutionStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';\nexport type JobExecutionDisplayStatus = JobExecutionStatus;\nexport interface WorkflowExecutionEvent {\n source: string;\n event: string;\n deliveryId: string;\n receivedAt: string;\n project: {id: string} | null;\n repository: string | null;\n ref: string | null;\n commit: string | null;\n data: unknown;\n}\nexport type JobExecutionTime =\n | {state: 'fixed'; elapsed: Duration}\n | {state: 'live'; fromIso: string};\nexport type JobExecutionDisplayDuration =\n | ({kind: 'queue'} & JobExecutionTime)\n | ({kind: 'run'} & JobExecutionTime);\n\ninterface JobExecutionFields {\n id: string;\n jobId: string;\n sequence: number;\n name: string;\n status: JobExecutionStatus;\n statusReason: string | null;\n triggerEvents: WorkflowExecutionEvent[];\n queuedAt: string | null;\n startedAt: string | null;\n finishedAt: string | null;\n timedOutAt: string | null;\n createdAt: string;\n updatedAt: string;\n steps: Step[];\n}\n\nexport class JobExecution {\n id!: string;\n jobId!: string;\n sequence!: number;\n name!: string;\n status!: JobExecutionStatus;\n statusReason!: string | null;\n triggerEvents!: WorkflowExecutionEvent[];\n queuedAt!: string | null;\n startedAt!: string | null;\n finishedAt!: string | null;\n timedOutAt!: string | null;\n createdAt!: string;\n updatedAt!: string;\n steps!: Step[];\n\n constructor(fields: JobExecutionFields) {\n Object.assign(this, fields);\n }\n\n get displayName(): string {\n return this.name;\n }\n\n get queueTime(): JobExecutionTime | null {\n return jobExecutionQueueTimeFromTimestamps(this);\n }\n\n get runTime(): JobExecutionTime | null {\n return jobExecutionRunTimeFromTimestamps(this);\n }\n\n get displayDuration(): JobExecutionDisplayDuration | null {\n return jobExecutionDisplayDurationFromTimestamps(this);\n }\n}\n\nexport function deriveJobExecutionDisplayStatus({\n status,\n steps,\n}: Pick<JobExecution, 'status' | 'steps'>): JobExecutionDisplayStatus {\n if (isTerminalJobExecutionStatus(status)) return status;\n if (steps.some((step) => step.status === 'running')) return 'running';\n return 'pending';\n}\n\nexport function isTerminalJobExecutionStatus(status: JobExecutionStatus): boolean {\n return status === 'succeeded' || status === 'failed' || status === 'cancelled';\n}\n\nexport function jobExecutionQueueTimeFromTimestamps({\n queuedAt,\n startedAt,\n finishedAt,\n}: {\n queuedAt: string | null;\n startedAt: string | null;\n finishedAt: string | null;\n}): JobExecutionTime | null {\n if (queuedAt === null) return null;\n if (finishedAt !== null && startedAt === null) return null;\n if (startedAt === null) return {state: 'live', fromIso: queuedAt};\n\n const elapsed = durationBetween(queuedAt, startedAt);\n return elapsed === null ? null : {state: 'fixed', elapsed};\n}\n\nexport function jobExecutionRunTimeFromTimestamps({\n startedAt,\n finishedAt,\n}: {\n startedAt: string | null;\n finishedAt: string | null;\n}): JobExecutionTime | null {\n if (startedAt === null) return null;\n if (finishedAt === null) return {state: 'live', fromIso: startedAt};\n\n const elapsed = durationBetween(startedAt, finishedAt);\n return elapsed === null ? null : {state: 'fixed', elapsed};\n}\n\nexport function jobExecutionDisplayDurationFromTimestamps(timestamps: {\n queuedAt: string | null;\n startedAt: string | null;\n finishedAt: string | null;\n}): JobExecutionDisplayDuration | null {\n const runTime = jobExecutionRunTimeFromTimestamps(timestamps);\n if (runTime !== null) return {kind: 'run', ...runTime};\n\n const queueTime = jobExecutionQueueTimeFromTimestamps(timestamps);\n if (queueTime !== null) return {kind: 'queue', ...queueTime};\n\n return null;\n}\n\nfunction durationBetween(from: string, to: string): Duration | null {\n const start = new Date(from);\n const end = new Date(to);\n if (!Number.isFinite(start.getTime()) || !Number.isFinite(end.getTime())) return null;\n\n return intervalToDuration({\n start,\n end: end < start ? start : end,\n });\n}\n"],"names":["intervalToDuration","JobExecution","fields","Object","assign","displayName","name","queueTime","jobExecutionQueueTimeFromTimestamps","runTime","jobExecutionRunTimeFromTimestamps","displayDuration","jobExecutionDisplayDurationFromTimestamps","deriveJobExecutionDisplayStatus","status","steps","isTerminalJobExecutionStatus","some","step","queuedAt","startedAt","finishedAt","state","fromIso","elapsed","durationBetween","timestamps","kind","from","to","start","Date","end","Number","isFinite","getTime"],"mappings":"AAAA,SAAuBA,kBAAkB,QAAO,WAAW;AAwC3D,OAAO,MAAMC;IAgBX,YAAYC,MAA0B,CAAE;QACtCC,OAAOC,MAAM,CAAC,IAAI,EAAEF;IACtB;IAEA,IAAIG,cAAsB;QACxB,OAAO,IAAI,CAACC,IAAI;IAClB;IAEA,IAAIC,YAAqC;QACvC,OAAOC,oCAAoC,IAAI;IACjD;IAEA,IAAIC,UAAmC;QACrC,OAAOC,kCAAkC,IAAI;IAC/C;IAEA,IAAIC,kBAAsD;QACxD,OAAOC,0CAA0C,IAAI;IACvD;AACF;AAEA,OAAO,SAASC,gCAAgC,EAC9CC,MAAM,EACNC,KAAK,EACkC;IACvC,IAAIC,6BAA6BF,SAAS,OAAOA;IACjD,IAAIC,MAAME,IAAI,CAAC,CAACC,OAASA,KAAKJ,MAAM,KAAK,YAAY,OAAO;IAC5D,OAAO;AACT;AAEA,OAAO,SAASE,6BAA6BF,MAA0B;IACrE,OAAOA,WAAW,eAAeA,WAAW,YAAYA,WAAW;AACrE;AAEA,OAAO,SAASN,oCAAoC,EAClDW,QAAQ,EACRC,SAAS,EACTC,UAAU,EAKX;IACC,IAAIF,aAAa,MAAM,OAAO;IAC9B,IAAIE,eAAe,QAAQD,cAAc,MAAM,OAAO;IACtD,IAAIA,cAAc,MAAM,OAAO;QAACE,OAAO;QAAQC,SAASJ;IAAQ;IAEhE,MAAMK,UAAUC,gBAAgBN,UAAUC;IAC1C,OAAOI,YAAY,OAAO,OAAO;QAACF,OAAO;QAASE;IAAO;AAC3D;AAEA,OAAO,SAASd,kCAAkC,EAChDU,SAAS,EACTC,UAAU,EAIX;IACC,IAAID,cAAc,MAAM,OAAO;IAC/B,IAAIC,eAAe,MAAM,OAAO;QAACC,OAAO;QAAQC,SAASH;IAAS;IAElE,MAAMI,UAAUC,gBAAgBL,WAAWC;IAC3C,OAAOG,YAAY,OAAO,OAAO;QAACF,OAAO;QAASE;IAAO;AAC3D;AAEA,OAAO,SAASZ,0CAA0Cc,UAIzD;IACC,MAAMjB,UAAUC,kCAAkCgB;IAClD,IAAIjB,YAAY,MAAM,OAAO;QAACkB,MAAM;QAAO,GAAGlB,OAAO;IAAA;IAErD,MAAMF,YAAYC,oCAAoCkB;IACtD,IAAInB,cAAc,MAAM,OAAO;QAACoB,MAAM;QAAS,GAAGpB,SAAS;IAAA;IAE3D,OAAO;AACT;AAEA,SAASkB,gBAAgBG,IAAY,EAAEC,EAAU;IAC/C,MAAMC,QAAQ,IAAIC,KAAKH;IACvB,MAAMI,MAAM,IAAID,KAAKF;IACrB,IAAI,CAACI,OAAOC,QAAQ,CAACJ,MAAMK,OAAO,OAAO,CAACF,OAAOC,QAAQ,CAACF,IAAIG,OAAO,KAAK,OAAO;IAEjF,OAAOnC,mBAAmB;QACxB8B;QACAE,KAAKA,MAAMF,QAAQA,QAAQE;IAC7B;AACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type JobExecution, type JobExecutionDisplayDuration } from './job-execution.js';
|
|
2
2
|
export type JobStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'skipped';
|
|
3
|
+
export type JobDisplayStatus = JobStatus | 'listening';
|
|
3
4
|
export type JobMode = 'one_shot' | 'listening';
|
|
4
5
|
export type ListenerStatus = 'inactive' | 'listening' | 'resolved';
|
|
5
6
|
export type ResolutionReason = 'until' | 'timeout' | 'max_executions' | 'cancelled';
|
|
@@ -72,7 +73,8 @@ export declare class Job {
|
|
|
72
73
|
get executionCountVisible(): boolean;
|
|
73
74
|
}
|
|
74
75
|
export declare function isTerminalJobStatus(status: JobStatus): boolean;
|
|
76
|
+
export declare function deriveJobDisplayStatus(job: Pick<Job, 'mode' | 'status' | 'listenerStatus' | 'jobExecutions'>): JobDisplayStatus;
|
|
75
77
|
export declare function resolveJobExecution(job: Job, jobExecutionId: string | undefined): JobExecution | undefined;
|
|
76
|
-
export declare function defaultJobExecution(job: Job): JobExecution | undefined;
|
|
78
|
+
export declare function defaultJobExecution(job: Pick<Job, 'jobExecutions'>): JobExecution | undefined;
|
|
77
79
|
export {};
|
|
78
80
|
//# sourceMappingURL=job.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../../src/core/entities/job.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../../../src/core/entities/job.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,2BAA2B,EACjC,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;AACjG,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,WAAW,CAAC;AACvD,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC;AAC/C,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;AACnE,MAAM,MAAM,gBAAgB,GAA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;IAED,IAAI,eAAe,IAAI,kBAAkB,GAAG,IAAI,CAI/C;IAED,IAAI,qBAAqB,IAAI,OAAO,CAInC;CACF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAE9D;AAED,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,gBAAgB,GAAG,eAAe,CAAC,GACrE,gBAAgB,CAMlB;AAED,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,GAAG,EACR,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,YAAY,GAAG,SAAS,CAO1B;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,GAAG,YAAY,GAAG,SAAS,CAU7F"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { deriveJobExecutionDisplayStatus } from './job-execution.js';
|
|
1
2
|
export const WORKFLOW_JOB_STATUSES = [
|
|
2
3
|
'pending',
|
|
3
4
|
'running',
|
|
@@ -18,7 +19,7 @@ export class Job {
|
|
|
18
19
|
Object.assign(this, fields);
|
|
19
20
|
}
|
|
20
21
|
get displayName() {
|
|
21
|
-
return this.name
|
|
22
|
+
return this.name ?? this.key;
|
|
22
23
|
}
|
|
23
24
|
get displayDuration() {
|
|
24
25
|
if (this.mode === 'listening') return null;
|
|
@@ -32,6 +33,12 @@ export class Job {
|
|
|
32
33
|
export function isTerminalJobStatus(status) {
|
|
33
34
|
return TERMINAL_JOB_STATUS_SET.has(status);
|
|
34
35
|
}
|
|
36
|
+
export function deriveJobDisplayStatus(job) {
|
|
37
|
+
if (isTerminalJobStatus(job.status)) return job.status;
|
|
38
|
+
if (job.mode === 'listening' && job.listenerStatus === 'listening') return 'listening';
|
|
39
|
+
const execution = defaultJobExecution(job);
|
|
40
|
+
return execution ? deriveJobExecutionDisplayStatus(execution) : 'pending';
|
|
41
|
+
}
|
|
35
42
|
export function resolveJobExecution(job, jobExecutionId) {
|
|
36
43
|
const selectedExecution = jobExecutionId ? job.jobExecutions.find((jobExecution)=>jobExecution.id === jobExecutionId) : undefined;
|
|
37
44
|
if (selectedExecution) return selectedExecution;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/entities/job.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/job.ts"],"sourcesContent":["import {\n deriveJobExecutionDisplayStatus,\n type JobExecution,\n type JobExecutionDisplayDuration,\n} from './job-execution.js';\n\nexport type JobStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'skipped';\nexport type JobDisplayStatus = JobStatus | 'listening';\nexport type JobMode = 'one_shot' | 'listening';\nexport type ListenerStatus = 'inactive' | 'listening' | 'resolved';\nexport type ResolutionReason = 'until' | 'timeout' | 'max_executions' | 'cancelled';\nexport type JobStatusReason =\n | 'dependency_not_completed'\n | 'condition_false'\n | 'default_gate_rejected'\n | 'condition_rejected'\n | 'condition_errored'\n | 'user_cancelled'\n | 'run_cancelled'\n | 'timed_out'\n | 'runner_lost'\n | 'step_failed'\n | 'unknown';\nexport interface JobListening {\n on: Array<{\n source: string;\n event: string;\n inputs?: Record<string, unknown> | undefined;\n filter?: string | undefined;\n }>;\n until: Array<{\n source: string;\n event: string;\n inputs?: Record<string, unknown> | undefined;\n filter?: string | undefined;\n }> | null;\n timeoutMs: number | null;\n maxExecutions: number | null;\n batch: {\n debounceMs?: number | undefined;\n maxSize?: number | undefined;\n maxWaitMs?: number | undefined;\n } | null;\n onResolve: 'finish' | 'cancel';\n executionTimeoutMs: number | null;\n name: string | null;\n}\n\nexport type JobDisplayDuration = JobExecutionDisplayDuration;\n\nexport const WORKFLOW_JOB_STATUSES = [\n 'pending',\n 'running',\n 'succeeded',\n 'failed',\n 'cancelled',\n 'skipped',\n] as const satisfies readonly JobStatus[];\n\nexport const TERMINAL_WORKFLOW_JOB_STATUSES = [\n 'succeeded',\n 'failed',\n 'cancelled',\n 'skipped',\n] as const satisfies readonly JobStatus[];\n\nconst TERMINAL_JOB_STATUS_SET = new Set<JobStatus>(TERMINAL_WORKFLOW_JOB_STATUSES);\n\ninterface JobFields {\n id: string;\n runAttemptId: string;\n key: string;\n name: string | null;\n mode: JobMode;\n status: JobStatus;\n statusReason: JobStatusReason | null;\n carriedOver: boolean;\n listening: JobListening | null;\n listenerStatus: ListenerStatus;\n resolutionReason: ResolutionReason | null;\n dependencies: string[];\n position: number;\n createdAt: string;\n updatedAt: string;\n jobExecutions: JobExecution[];\n}\n\nexport class Job {\n id!: string;\n runAttemptId!: string;\n key!: string;\n name!: string | null;\n mode!: JobMode;\n status!: JobStatus;\n statusReason!: JobStatusReason | null;\n carriedOver!: boolean;\n listening!: JobListening | null;\n listenerStatus!: ListenerStatus;\n resolutionReason!: ResolutionReason | null;\n dependencies!: string[];\n position!: number;\n createdAt!: string;\n updatedAt!: string;\n jobExecutions!: JobExecution[];\n\n constructor(fields: JobFields) {\n Object.assign(this, fields);\n }\n\n get displayName(): string {\n return this.name ?? this.key;\n }\n\n get displayDuration(): JobDisplayDuration | null {\n if (this.mode === 'listening') return null;\n if (this.jobExecutions.length !== 1) return null;\n return this.jobExecutions[0]?.displayDuration ?? null;\n }\n\n get executionCountVisible(): boolean {\n return (\n this.jobExecutions.length > 0 && (this.mode === 'listening' || this.jobExecutions.length > 1)\n );\n }\n}\n\nexport function isTerminalJobStatus(status: JobStatus): boolean {\n return TERMINAL_JOB_STATUS_SET.has(status);\n}\n\nexport function deriveJobDisplayStatus(\n job: Pick<Job, 'mode' | 'status' | 'listenerStatus' | 'jobExecutions'>,\n): JobDisplayStatus {\n if (isTerminalJobStatus(job.status)) return job.status;\n if (job.mode === 'listening' && job.listenerStatus === 'listening') return 'listening';\n\n const execution = defaultJobExecution(job);\n return execution ? deriveJobExecutionDisplayStatus(execution) : 'pending';\n}\n\nexport function resolveJobExecution(\n job: Job,\n jobExecutionId: string | undefined,\n): JobExecution | undefined {\n const selectedExecution = jobExecutionId\n ? job.jobExecutions.find((jobExecution) => jobExecution.id === jobExecutionId)\n : undefined;\n if (selectedExecution) return selectedExecution;\n\n return defaultJobExecution(job);\n}\n\nexport function defaultJobExecution(job: Pick<Job, 'jobExecutions'>): JobExecution | undefined {\n const runningExecution = job.jobExecutions.find(\n (jobExecution) => jobExecution.status === 'running',\n );\n if (runningExecution) return runningExecution;\n\n return job.jobExecutions.reduce<JobExecution | undefined>((latest, jobExecution) => {\n if (!latest) return jobExecution;\n return jobExecution.sequence > latest.sequence ? jobExecution : latest;\n }, undefined);\n}\n"],"names":["deriveJobExecutionDisplayStatus","WORKFLOW_JOB_STATUSES","TERMINAL_WORKFLOW_JOB_STATUSES","TERMINAL_JOB_STATUS_SET","Set","Job","fields","Object","assign","displayName","name","key","displayDuration","mode","jobExecutions","length","executionCountVisible","isTerminalJobStatus","status","has","deriveJobDisplayStatus","job","listenerStatus","execution","defaultJobExecution","resolveJobExecution","jobExecutionId","selectedExecution","find","jobExecution","id","undefined","runningExecution","reduce","latest","sequence"],"mappings":"AAAA,SACEA,+BAA+B,QAG1B,qBAAqB;AA8C5B,OAAO,MAAMC,wBAAwB;IACnC;IACA;IACA;IACA;IACA;IACA;CACD,CAAyC;AAE1C,OAAO,MAAMC,iCAAiC;IAC5C;IACA;IACA;IACA;CACD,CAAyC;AAE1C,MAAMC,0BAA0B,IAAIC,IAAeF;AAqBnD,OAAO,MAAMG;IAkBX,YAAYC,MAAiB,CAAE;QAC7BC,OAAOC,MAAM,CAAC,IAAI,EAAEF;IACtB;IAEA,IAAIG,cAAsB;QACxB,OAAO,IAAI,CAACC,IAAI,IAAI,IAAI,CAACC,GAAG;IAC9B;IAEA,IAAIC,kBAA6C;QAC/C,IAAI,IAAI,CAACC,IAAI,KAAK,aAAa,OAAO;QACtC,IAAI,IAAI,CAACC,aAAa,CAACC,MAAM,KAAK,GAAG,OAAO;QAC5C,OAAO,IAAI,CAACD,aAAa,CAAC,EAAE,EAAEF,mBAAmB;IACnD;IAEA,IAAII,wBAAiC;QACnC,OACE,IAAI,CAACF,aAAa,CAACC,MAAM,GAAG,KAAM,CAAA,IAAI,CAACF,IAAI,KAAK,eAAe,IAAI,CAACC,aAAa,CAACC,MAAM,GAAG,CAAA;IAE/F;AACF;AAEA,OAAO,SAASE,oBAAoBC,MAAiB;IACnD,OAAOf,wBAAwBgB,GAAG,CAACD;AACrC;AAEA,OAAO,SAASE,uBACdC,GAAsE;IAEtE,IAAIJ,oBAAoBI,IAAIH,MAAM,GAAG,OAAOG,IAAIH,MAAM;IACtD,IAAIG,IAAIR,IAAI,KAAK,eAAeQ,IAAIC,cAAc,KAAK,aAAa,OAAO;IAE3E,MAAMC,YAAYC,oBAAoBH;IACtC,OAAOE,YAAYvB,gCAAgCuB,aAAa;AAClE;AAEA,OAAO,SAASE,oBACdJ,GAAQ,EACRK,cAAkC;IAElC,MAAMC,oBAAoBD,iBACtBL,IAAIP,aAAa,CAACc,IAAI,CAAC,CAACC,eAAiBA,aAAaC,EAAE,KAAKJ,kBAC7DK;IACJ,IAAIJ,mBAAmB,OAAOA;IAE9B,OAAOH,oBAAoBH;AAC7B;AAEA,OAAO,SAASG,oBAAoBH,GAA+B;IACjE,MAAMW,mBAAmBX,IAAIP,aAAa,CAACc,IAAI,CAC7C,CAACC,eAAiBA,aAAaX,MAAM,KAAK;IAE5C,IAAIc,kBAAkB,OAAOA;IAE7B,OAAOX,IAAIP,aAAa,CAACmB,MAAM,CAA2B,CAACC,QAAQL;QACjE,IAAI,CAACK,QAAQ,OAAOL;QACpB,OAAOA,aAAaM,QAAQ,GAAGD,OAAOC,QAAQ,GAAGN,eAAeK;IAClE,GAAGH;AACL"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StepAttempt } from './step-attempt.js';
|
|
2
|
-
export type StepErrorReason = 'checkout_failed' | 'checkout_auth_failed' | 'checkout_unavailable' | 'git_unavailable' | 'workspace_prep_failed' | 'setup_aborted' | 'config_unresolvable' | 'output_invalid' | 'agent_config_invalid' | 'agent_invocation_failed' | 'agent_harness_unavailable';
|
|
2
|
+
export type StepErrorReason = 'checkout_failed' | 'checkout_auth_failed' | 'checkout_unavailable' | 'checkout_path_invalid' | 'checkout_destination_occupied' | 'git_unavailable' | 'workspace_prep_failed' | 'setup_aborted' | 'config_unresolvable' | 'output_invalid' | 'agent_config_invalid' | 'agent_invocation_failed' | 'agent_harness_unavailable';
|
|
3
3
|
export type AgentConfigIssue = 'step_config_invalid' | 'provider_not_configured' | 'provider_unsupported' | 'model_unavailable' | 'credentials_invalid';
|
|
4
4
|
export type StepErrorCategory = 'setup' | 'user';
|
|
5
5
|
export declare const STEP_ERROR_REASONS: Set<StepErrorReason>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/core/entities/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAEnD,MAAM,MAAM,eAAe,GACvB,iBAAiB,GACjB,sBAAsB,GACtB,sBAAsB,GACtB,iBAAiB,GACjB,uBAAuB,GACvB,eAAe,GACf,qBAAqB,GACrB,gBAAgB,GAChB,sBAAsB,GACtB,yBAAyB,GACzB,2BAA2B,CAAC;AAChC,MAAM,MAAM,gBAAgB,GACxB,qBAAqB,GACrB,yBAAyB,GACzB,sBAAsB,GACtB,mBAAmB,GACnB,qBAAqB,CAAC;AAC1B,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,CAAC;AACjD,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/core/entities/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAEnD,MAAM,MAAM,eAAe,GACvB,iBAAiB,GACjB,sBAAsB,GACtB,sBAAsB,GACtB,uBAAuB,GACvB,+BAA+B,GAC/B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AG,IAAI,CAAC;IACpC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/entities/step.ts"],"sourcesContent":["import type {StepAttempt} from './step-attempt.js';\n\nexport type StepErrorReason =\n | 'checkout_failed'\n | 'checkout_auth_failed'\n | 'checkout_unavailable'\n | 'git_unavailable'\n | 'workspace_prep_failed'\n | 'setup_aborted'\n | 'config_unresolvable'\n | 'output_invalid'\n | 'agent_config_invalid'\n | 'agent_invocation_failed'\n | 'agent_harness_unavailable';\nexport type AgentConfigIssue =\n | 'step_config_invalid'\n | 'provider_not_configured'\n | 'provider_unsupported'\n | 'model_unavailable'\n | 'credentials_invalid';\nexport type StepErrorCategory = 'setup' | 'user';\nexport const STEP_ERROR_REASONS = new Set<StepErrorReason>([\n 'checkout_failed',\n 'checkout_auth_failed',\n 'checkout_unavailable',\n 'git_unavailable',\n 'workspace_prep_failed',\n 'setup_aborted',\n 'config_unresolvable',\n 'output_invalid',\n 'agent_config_invalid',\n 'agent_invocation_failed',\n 'agent_harness_unavailable',\n]);\nexport const AGENT_CONFIG_ISSUES = new Set<AgentConfigIssue>([\n 'step_config_invalid',\n 'provider_not_configured',\n 'provider_unsupported',\n 'model_unavailable',\n 'credentials_invalid',\n]);\n\nexport interface StepSourceLocation {\n startLine: number;\n endLine: number;\n}\n\nexport interface StepError {\n message: string;\n exitCode: number | null;\n signal: string | undefined;\n reason: StepErrorReason | undefined;\n agentConfigIssue: AgentConfigIssue | undefined;\n category: StepErrorCategory | undefined;\n}\n\nexport interface AgentStepConfig {\n provider: string | null;\n model: string | null;\n thinking: string | null;\n}\n\nexport interface Step {\n id: string;\n jobExecutionId: string;\n key: string | null;\n name: string;\n sourceLocation: StepSourceLocation | null;\n status: string;\n type: string;\n config: Record<string, unknown>;\n agentConfig: AgentStepConfig | null;\n error: StepError | null;\n position: number;\n currentAttempt: number;\n createdAt: string;\n updatedAt: string;\n attempts: StepAttempt[];\n}\n"],"names":["STEP_ERROR_REASONS","Set","AGENT_CONFIG_ISSUES"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/step.ts"],"sourcesContent":["import type {StepAttempt} from './step-attempt.js';\n\nexport type StepErrorReason =\n | 'checkout_failed'\n | 'checkout_auth_failed'\n | 'checkout_unavailable'\n | 'checkout_path_invalid'\n | 'checkout_destination_occupied'\n | 'git_unavailable'\n | 'workspace_prep_failed'\n | 'setup_aborted'\n | 'config_unresolvable'\n | 'output_invalid'\n | 'agent_config_invalid'\n | 'agent_invocation_failed'\n | 'agent_harness_unavailable';\nexport type AgentConfigIssue =\n | 'step_config_invalid'\n | 'provider_not_configured'\n | 'provider_unsupported'\n | 'model_unavailable'\n | 'credentials_invalid';\nexport type StepErrorCategory = 'setup' | 'user';\nexport const STEP_ERROR_REASONS = new Set<StepErrorReason>([\n 'checkout_failed',\n 'checkout_auth_failed',\n 'checkout_unavailable',\n 'checkout_path_invalid',\n 'checkout_destination_occupied',\n 'git_unavailable',\n 'workspace_prep_failed',\n 'setup_aborted',\n 'config_unresolvable',\n 'output_invalid',\n 'agent_config_invalid',\n 'agent_invocation_failed',\n 'agent_harness_unavailable',\n]);\nexport const AGENT_CONFIG_ISSUES = new Set<AgentConfigIssue>([\n 'step_config_invalid',\n 'provider_not_configured',\n 'provider_unsupported',\n 'model_unavailable',\n 'credentials_invalid',\n]);\n\nexport interface StepSourceLocation {\n startLine: number;\n endLine: number;\n}\n\nexport interface StepError {\n message: string;\n exitCode: number | null;\n signal: string | undefined;\n reason: StepErrorReason | undefined;\n agentConfigIssue: AgentConfigIssue | undefined;\n category: StepErrorCategory | undefined;\n}\n\nexport interface AgentStepConfig {\n provider: string | null;\n model: string | null;\n thinking: string | null;\n}\n\nexport interface Step {\n id: string;\n jobExecutionId: string;\n key: string | null;\n name: string;\n sourceLocation: StepSourceLocation | null;\n status: string;\n type: string;\n config: Record<string, unknown>;\n agentConfig: AgentStepConfig | null;\n error: StepError | null;\n position: number;\n currentAttempt: number;\n createdAt: string;\n updatedAt: string;\n attempts: StepAttempt[];\n}\n"],"names":["STEP_ERROR_REASONS","Set","AGENT_CONFIG_ISSUES"],"mappings":"AAuBA,OAAO,MAAMA,qBAAqB,IAAIC,IAAqB;IACzD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,EAAE;AACH,OAAO,MAAMC,sBAAsB,IAAID,IAAsB;IAC3D;IACA;IACA;IACA;IACA;CACD,EAAE"}
|