@shipfox/client-workflows 13.0.0 → 14.0.1
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/workspace-source.ts +31 -0
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +37 -0
- 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.js +5 -5
- 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/workflow-run-duration-label.js +1 -1
- package/dist/components/workflow-run-duration-label.js.map +1 -1
- package/dist/components/workflow-run-number-label.js +1 -1
- package/dist/components/workflow-run-number-label.js.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js +2 -2
- 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 +2 -7
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.js +92 -68
- 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/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 +8 -4
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.js +125 -78
- 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/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/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/pages/workflow-run-detail-page.d.ts.map +1 -1
- package/dist/pages/workflow-run-detail-page.js +28 -6
- package/dist/pages/workflow-run-detail-page.js.map +1 -1
- package/dist/routes/inputs.d.ts +33 -0
- package/dist/routes/inputs.d.ts.map +1 -1
- package/dist/routes/inputs.js +49 -0
- package/dist/routes/inputs.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +9 -9
- 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.tsx +6 -3
- package/src/components/job-graph/job-graph.stories.tsx +1 -1
- package/src/components/job-graph/job-node.stories.tsx +1 -1
- package/src/components/job-graph/job-node.test.tsx +27 -2
- package/src/components/job-graph/job-node.tsx +6 -6
- package/src/components/job-graph/types.ts +5 -1
- package/src/components/workflow-run-duration-label.tsx +1 -1
- package/src/components/workflow-run-number-label.tsx +1 -1
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.tsx +2 -2
- package/src/components/workflow-run-summary/workflow-run-summary.stories.tsx +23 -30
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +3 -22
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +84 -69
- 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/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 +64 -64
- package/src/components/workflow-run-view/workflow-run-view.tsx +199 -85
- 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/core/entities/step.ts +4 -0
- package/src/core/workflow-run-tabs.ts +8 -0
- package/src/pages/workflow-run-detail-page.tsx +31 -4
- package/src/pages/workflow-run-pages.test.tsx +185 -45
- package/src/routes/inputs.test.ts +47 -0
- package/src/routes/inputs.ts +45 -0
- package/src/storybook-config.test.ts +27 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.test.json +7 -1
|
@@ -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,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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EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,WAAW,EAAE,eAAe,GAAG,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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Counts used by the run detail tab strip before the annotations query owns the data. */
|
|
2
|
+
export interface RunAnnotationSummary {
|
|
3
|
+
total: number;
|
|
4
|
+
error: number;
|
|
5
|
+
warning: number;
|
|
6
|
+
info: number;
|
|
7
|
+
success: number;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=workflow-run-tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-run-tabs.d.ts","sourceRoot":"","sources":["../../src/core/workflow-run-tabs.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/workflow-run-tabs.ts"],"sourcesContent":["/** Counts used by the run detail tab strip before the annotations query owns the data. */\nexport interface RunAnnotationSummary {\n total: number;\n error: number;\n warning: number;\n info: number;\n success: number;\n}\n"],"names":[],"mappings":"AAAA,wFAAwF,GACxF,WAMC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run-detail-page.d.ts","sourceRoot":"","sources":["../../src/pages/workflow-run-detail-page.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"workflow-run-detail-page.d.ts","sourceRoot":"","sources":["../../src/pages/workflow-run-detail-page.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,kBAAkB,EAIxB,MAAM,mBAAmB,CAAC;AAE3B,UAAU,0BAA0B;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,aAAa,EACb,WAAW,EACX,aAAa,EACb,MAAW,GACZ,EAAE,0BAA0B,+BA6C5B"}
|
|
@@ -2,27 +2,49 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useNavigate } from '@tanstack/react-router';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { WorkflowRunView } from '#components/workflow-run-view/index.js';
|
|
5
|
-
import { workflowRunSearchParams } from '#routes/inputs.js';
|
|
5
|
+
import { validateWorkflowRunsSearch, workflowRunSearchParams, workflowRunTab } from '#routes/inputs.js';
|
|
6
6
|
export function WorkflowRunDetailPage({ projectId, workspaceSlug, projectSlug, workflowRunId, search = {} }) {
|
|
7
7
|
const navigate = useNavigate();
|
|
8
8
|
const selection = search;
|
|
9
9
|
const onSelectionChange = useCallback((nextSelection)=>{
|
|
10
10
|
navigate({
|
|
11
|
-
search:
|
|
11
|
+
search: (previous)=>{
|
|
12
|
+
const current = validateWorkflowRunsSearch(previous);
|
|
13
|
+
return workflowRunSearchParams(current, nextSelection);
|
|
14
|
+
},
|
|
15
|
+
replace: true
|
|
12
16
|
});
|
|
13
17
|
}, [
|
|
14
|
-
navigate
|
|
15
|
-
|
|
18
|
+
navigate
|
|
19
|
+
]);
|
|
20
|
+
const onTabChange = useCallback((nextTab)=>{
|
|
21
|
+
navigate({
|
|
22
|
+
search: (previous)=>{
|
|
23
|
+
const current = validateWorkflowRunsSearch(previous);
|
|
24
|
+
const nextSearch = workflowRunSearchParams({
|
|
25
|
+
...current,
|
|
26
|
+
tab: nextTab
|
|
27
|
+
}, current);
|
|
28
|
+
return nextTab === 'summary' && (current.jobId || current.jobExecutionId || current.stepId || current.stepAttemptId) ? {
|
|
29
|
+
...nextSearch,
|
|
30
|
+
tab: nextTab
|
|
31
|
+
} : nextSearch;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}, [
|
|
35
|
+
navigate
|
|
16
36
|
]);
|
|
17
37
|
return /*#__PURE__*/ _jsx("div", {
|
|
18
|
-
className: "flex min-h-0 flex-1 overflow-hidden bg-background-neutral-
|
|
38
|
+
className: "flex min-h-0 flex-1 overflow-hidden bg-background-neutral-background",
|
|
19
39
|
children: /*#__PURE__*/ _jsx(WorkflowRunView, {
|
|
20
40
|
projectId: projectId,
|
|
21
41
|
workspaceSlug: workspaceSlug,
|
|
22
42
|
projectSlug: projectSlug,
|
|
23
43
|
workflowRunId: workflowRunId,
|
|
24
44
|
selection: selection,
|
|
25
|
-
onSelectionChange: onSelectionChange
|
|
45
|
+
onSelectionChange: onSelectionChange,
|
|
46
|
+
tab: workflowRunTab(search),
|
|
47
|
+
onTabChange: onTabChange
|
|
26
48
|
})
|
|
27
49
|
});
|
|
28
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pages/workflow-run-detail-page.tsx"],"sourcesContent":["import {useNavigate} from '@tanstack/react-router';\nimport {useCallback} from 'react';\nimport {WorkflowRunView} from '#components/workflow-run-view/index.js';\nimport type {WorkflowRunSelectionInput} from '#core/workflow-run-url-state.js';\nimport {type WorkflowRunsSearch
|
|
1
|
+
{"version":3,"sources":["../../src/pages/workflow-run-detail-page.tsx"],"sourcesContent":["import {useNavigate} from '@tanstack/react-router';\nimport {useCallback} from 'react';\nimport {WorkflowRunView} from '#components/workflow-run-view/index.js';\nimport type {WorkflowRunSelectionInput} from '#core/workflow-run-url-state.js';\nimport {\n validateWorkflowRunsSearch,\n type WorkflowRunsSearch,\n type WorkflowRunTab,\n workflowRunSearchParams,\n workflowRunTab,\n} from '#routes/inputs.js';\n\ninterface WorkflowRunDetailPageProps {\n projectId: string;\n workspaceSlug: string;\n projectSlug: string;\n workflowRunId?: string | undefined;\n search?: WorkflowRunsSearch;\n}\n\nexport function WorkflowRunDetailPage({\n projectId,\n workspaceSlug,\n projectSlug,\n workflowRunId,\n search = {},\n}: WorkflowRunDetailPageProps) {\n const navigate = useNavigate();\n const selection: WorkflowRunSelectionInput = search;\n const onSelectionChange = useCallback(\n (nextSelection: WorkflowRunSelectionInput) => {\n navigate({\n search: ((previous: Record<string, unknown>) => {\n const current = validateWorkflowRunsSearch(previous);\n return workflowRunSearchParams(current, nextSelection);\n }) as never,\n replace: true,\n });\n },\n [navigate],\n );\n const onTabChange = useCallback(\n (nextTab: WorkflowRunTab) => {\n navigate({\n search: ((previous: Record<string, unknown>) => {\n const current = validateWorkflowRunsSearch(previous);\n const nextSearch = workflowRunSearchParams({...current, tab: nextTab}, current);\n return nextTab === 'summary' &&\n (current.jobId || current.jobExecutionId || current.stepId || current.stepAttemptId)\n ? {...nextSearch, tab: nextTab}\n : nextSearch;\n }) as never,\n });\n },\n [navigate],\n );\n\n return (\n <div className=\"flex min-h-0 flex-1 overflow-hidden bg-background-neutral-background\">\n <WorkflowRunView\n projectId={projectId}\n workspaceSlug={workspaceSlug}\n projectSlug={projectSlug}\n workflowRunId={workflowRunId}\n selection={selection}\n onSelectionChange={onSelectionChange}\n tab={workflowRunTab(search)}\n onTabChange={onTabChange}\n />\n </div>\n );\n}\n"],"names":["useNavigate","useCallback","WorkflowRunView","validateWorkflowRunsSearch","workflowRunSearchParams","workflowRunTab","WorkflowRunDetailPage","projectId","workspaceSlug","projectSlug","workflowRunId","search","navigate","selection","onSelectionChange","nextSelection","previous","current","replace","onTabChange","nextTab","nextSearch","tab","jobId","jobExecutionId","stepId","stepAttemptId","div","className"],"mappings":";AAAA,SAAQA,WAAW,QAAO,yBAAyB;AACnD,SAAQC,WAAW,QAAO,QAAQ;AAClC,SAAQC,eAAe,QAAO,yCAAyC;AAEvE,SACEC,0BAA0B,EAG1BC,uBAAuB,EACvBC,cAAc,QACT,oBAAoB;AAU3B,OAAO,SAASC,sBAAsB,EACpCC,SAAS,EACTC,aAAa,EACbC,WAAW,EACXC,aAAa,EACbC,SAAS,CAAC,CAAC,EACgB;IAC3B,MAAMC,WAAWZ;IACjB,MAAMa,YAAuCF;IAC7C,MAAMG,oBAAoBb,YACxB,CAACc;QACCH,SAAS;YACPD,QAAS,CAACK;gBACR,MAAMC,UAAUd,2BAA2Ba;gBAC3C,OAAOZ,wBAAwBa,SAASF;YAC1C;YACAG,SAAS;QACX;IACF,GACA;QAACN;KAAS;IAEZ,MAAMO,cAAclB,YAClB,CAACmB;QACCR,SAAS;YACPD,QAAS,CAACK;gBACR,MAAMC,UAAUd,2BAA2Ba;gBAC3C,MAAMK,aAAajB,wBAAwB;oBAAC,GAAGa,OAAO;oBAAEK,KAAKF;gBAAO,GAAGH;gBACvE,OAAOG,YAAY,aAChBH,CAAAA,QAAQM,KAAK,IAAIN,QAAQO,cAAc,IAAIP,QAAQQ,MAAM,IAAIR,QAAQS,aAAa,AAAD,IAChF;oBAAC,GAAGL,UAAU;oBAAEC,KAAKF;gBAAO,IAC5BC;YACN;QACF;IACF,GACA;QAACT;KAAS;IAGZ,qBACE,KAACe;QAAIC,WAAU;kBACb,cAAA,KAAC1B;YACCK,WAAWA;YACXC,eAAeA;YACfC,aAAaA;YACbC,eAAeA;YACfG,WAAWA;YACXC,mBAAmBA;YACnBQ,KAAKjB,eAAeM;YACpBQ,aAAaA;;;AAIrB"}
|
package/dist/routes/inputs.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ import type { WorkflowRunSelectionInput } from '#core/workflow-run-url-state.js'
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const WORKFLOW_RUN_LIST_STATUSES: readonly ["succeeded", "failed", "running", "cancelled"];
|
|
7
7
|
export type WorkflowRunListStatus = (typeof WORKFLOW_RUN_LIST_STATUSES)[number];
|
|
8
|
+
export declare const WORKFLOW_RUN_TABS: readonly ["summary", "jobs", "annotations", "source"];
|
|
9
|
+
export type WorkflowRunTab = (typeof WORKFLOW_RUN_TABS)[number];
|
|
10
|
+
export declare const WORKFLOW_RUN_ANNOTATION_SEVERITIES: readonly ["error", "warning", "info", "success"];
|
|
11
|
+
export type WorkflowRunAnnotationSeverity = (typeof WORKFLOW_RUN_ANNOTATION_SEVERITIES)[number];
|
|
8
12
|
export interface WorkflowRunsSearch extends WorkflowRunSelectionInput {
|
|
9
13
|
search?: string;
|
|
10
14
|
status?: WorkflowRunListStatus[];
|
|
@@ -15,6 +19,9 @@ export interface WorkflowRunsSearch extends WorkflowRunSelectionInput {
|
|
|
15
19
|
after?: string;
|
|
16
20
|
/** Inclusive upper bound on the run's local calendar date, `YYYY-MM-DD`. */
|
|
17
21
|
before?: string;
|
|
22
|
+
tab?: WorkflowRunTab;
|
|
23
|
+
annotation?: string;
|
|
24
|
+
severity?: WorkflowRunAnnotationSeverity;
|
|
18
25
|
}
|
|
19
26
|
/**
|
|
20
27
|
* Reads the run list and run detail query string.
|
|
@@ -36,6 +43,32 @@ export declare function workflowRunSearchParams(search: WorkflowRunsSearch, sele
|
|
|
36
43
|
step?: string;
|
|
37
44
|
jobExecution?: string;
|
|
38
45
|
job?: string;
|
|
46
|
+
severity?: "error" | "success" | "warning" | "info";
|
|
47
|
+
annotation?: string;
|
|
48
|
+
tab?: "jobs" | "annotations" | "source";
|
|
49
|
+
before?: string;
|
|
50
|
+
after?: string;
|
|
51
|
+
event?: string[];
|
|
52
|
+
actor?: string[];
|
|
53
|
+
branch?: string[];
|
|
54
|
+
status?: ("running" | "succeeded" | "failed" | "cancelled")[];
|
|
55
|
+
search?: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Resolves the detail surface for a URL. Explicit tabs win; legacy selection-only URLs belong
|
|
59
|
+
* to Jobs so their selected detail remains visible instead of silently landing on Summary.
|
|
60
|
+
*/
|
|
61
|
+
export declare function workflowRunTab(search: Pick<WorkflowRunsSearch, 'tab' | 'jobId' | 'jobExecutionId' | 'stepId' | 'stepAttemptId'>): WorkflowRunTab;
|
|
62
|
+
/** Serializes only list filters when leaving a run detail page for the run list. */
|
|
63
|
+
export declare function workflowRunListSearchParams(search: WorkflowRunsSearch): {
|
|
64
|
+
runAttempt?: string;
|
|
65
|
+
stepAttempt?: string;
|
|
66
|
+
step?: string;
|
|
67
|
+
jobExecution?: string;
|
|
68
|
+
job?: string;
|
|
69
|
+
severity?: "error" | "success" | "warning" | "info";
|
|
70
|
+
annotation?: string;
|
|
71
|
+
tab?: "jobs" | "annotations" | "source";
|
|
39
72
|
before?: string;
|
|
40
73
|
after?: string;
|
|
41
74
|
event?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/routes/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,iCAA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BAAkB,EAC1B,KAAK,EAAE,sBAAsB,GAC5B,kBAAkB,CAUpB;AAED,2FAA2F;AAC3F,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAUtF;AAED,wFAAwF;AACxF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAUzE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACnE,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAOA"}
|
package/dist/routes/inputs.js
CHANGED
|
@@ -7,7 +7,21 @@
|
|
|
7
7
|
'running',
|
|
8
8
|
'cancelled'
|
|
9
9
|
];
|
|
10
|
+
export const WORKFLOW_RUN_TABS = [
|
|
11
|
+
'summary',
|
|
12
|
+
'jobs',
|
|
13
|
+
'annotations',
|
|
14
|
+
'source'
|
|
15
|
+
];
|
|
16
|
+
export const WORKFLOW_RUN_ANNOTATION_SEVERITIES = [
|
|
17
|
+
'error',
|
|
18
|
+
'warning',
|
|
19
|
+
'info',
|
|
20
|
+
'success'
|
|
21
|
+
];
|
|
10
22
|
const STATUS_VALUES = new Set(WORKFLOW_RUN_LIST_STATUSES);
|
|
23
|
+
const TAB_VALUES = new Set(WORKFLOW_RUN_TABS);
|
|
24
|
+
const ANNOTATION_SEVERITY_VALUES = new Set(WORKFLOW_RUN_ANNOTATION_SEVERITIES);
|
|
11
25
|
const CALENDAR_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/u;
|
|
12
26
|
/**
|
|
13
27
|
* Reads the run list and run detail query string.
|
|
@@ -24,6 +38,11 @@ const CALENDAR_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/u;
|
|
|
24
38
|
const after = calendarDate(input.after);
|
|
25
39
|
const before = calendarDate(input.before);
|
|
26
40
|
const runAttempt = positiveInteger(input.runAttempt);
|
|
41
|
+
const tabValue = string(input.tab);
|
|
42
|
+
const tab = tabValue && TAB_VALUES.has(tabValue) ? tabValue : undefined;
|
|
43
|
+
const annotation = string(input.annotation);
|
|
44
|
+
const severityValue = string(input.severity);
|
|
45
|
+
const severity = severityValue && ANNOTATION_SEVERITY_VALUES.has(severityValue) ? severityValue : undefined;
|
|
27
46
|
return {
|
|
28
47
|
...search ? {
|
|
29
48
|
search
|
|
@@ -46,6 +65,15 @@ const CALENDAR_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/u;
|
|
|
46
65
|
...before ? {
|
|
47
66
|
before
|
|
48
67
|
} : {},
|
|
68
|
+
...tab ? {
|
|
69
|
+
tab
|
|
70
|
+
} : {},
|
|
71
|
+
...annotation ? {
|
|
72
|
+
annotation
|
|
73
|
+
} : {},
|
|
74
|
+
...severity ? {
|
|
75
|
+
severity
|
|
76
|
+
} : {},
|
|
49
77
|
...string(input.job) ? {
|
|
50
78
|
jobId: string(input.job)
|
|
51
79
|
} : {},
|
|
@@ -91,6 +119,15 @@ const CALENDAR_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/u;
|
|
|
91
119
|
...search.before ? {
|
|
92
120
|
before: search.before
|
|
93
121
|
} : {},
|
|
122
|
+
...search.tab && search.tab !== 'summary' ? {
|
|
123
|
+
tab: search.tab
|
|
124
|
+
} : {},
|
|
125
|
+
...search.annotation ? {
|
|
126
|
+
annotation: search.annotation
|
|
127
|
+
} : {},
|
|
128
|
+
...search.severity ? {
|
|
129
|
+
severity: search.severity
|
|
130
|
+
} : {},
|
|
94
131
|
...selection.jobId ? {
|
|
95
132
|
job: selection.jobId
|
|
96
133
|
} : {},
|
|
@@ -108,6 +145,18 @@ const CALENDAR_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/u;
|
|
|
108
145
|
} : {}
|
|
109
146
|
};
|
|
110
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Resolves the detail surface for a URL. Explicit tabs win; legacy selection-only URLs belong
|
|
150
|
+
* to Jobs so their selected detail remains visible instead of silently landing on Summary.
|
|
151
|
+
*/ export function workflowRunTab(search) {
|
|
152
|
+
if (search.tab) return search.tab;
|
|
153
|
+
if (search.jobId || search.jobExecutionId || search.stepId || search.stepAttemptId) return 'jobs';
|
|
154
|
+
return 'summary';
|
|
155
|
+
}
|
|
156
|
+
/** Serializes only list filters when leaving a run detail page for the run list. */ export function workflowRunListSearchParams(search) {
|
|
157
|
+
const { tab: _tab, annotation: _annotation, severity: _severity, ...listSearch } = search;
|
|
158
|
+
return workflowRunSearchParams(listSearch, {});
|
|
159
|
+
}
|
|
111
160
|
/**
|
|
112
161
|
* Applies a filter change.
|
|
113
162
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/routes/inputs.ts"],"sourcesContent":["import type {WorkflowRunSelectionInput} from '#core/workflow-run-url-state.js';\n\n/**\n * Statuses the run list can filter by. Absent means all; there is deliberately no `all`\n * value, so \"no filter\" and \"every filter\" are the same URL rather than two.\n */\nexport const WORKFLOW_RUN_LIST_STATUSES = ['succeeded', 'failed', 'running', 'cancelled'] as const;\n\nexport type WorkflowRunListStatus = (typeof WORKFLOW_RUN_LIST_STATUSES)[number];\n\nexport interface WorkflowRunsSearch extends WorkflowRunSelectionInput {\n search?: string;\n status?: WorkflowRunListStatus[];\n branch?: string[];\n actor?: string[];\n event?: string[];\n /** Inclusive lower bound on the run's local calendar date, `YYYY-MM-DD`. */\n after?: string;\n /** Inclusive upper bound on the run's local calendar date, `YYYY-MM-DD`. */\n before?: string;\n}\n\nconst STATUS_VALUES = new Set<string>(WORKFLOW_RUN_LIST_STATUSES);\nconst CALENDAR_DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/u;\n\n/**\n * Reads the run list and run detail query string.\n *\n * Every value is dropped rather than rejected when it does not fit: a truncated or\n * hand-edited URL should degrade to a sensible page, never to an error screen. Unknown\n * parameters are ignored for the same reason.\n */\nexport function validateWorkflowRunsSearch(input: Record<string, unknown>): WorkflowRunsSearch {\n const search = string(input.search);\n const status = repeatable(input.status).filter(isWorkflowRunListStatus);\n const branch = repeatable(input.branch);\n const actor = repeatable(input.actor);\n const event = repeatable(input.event);\n const after = calendarDate(input.after);\n const before = calendarDate(input.before);\n const runAttempt = positiveInteger(input.runAttempt);\n\n return {\n ...(search ? {search} : {}),\n ...(status.length > 0 ? {status} : {}),\n ...(branch.length > 0 ? {branch} : {}),\n ...(actor.length > 0 ? {actor} : {}),\n ...(event.length > 0 ? {event} : {}),\n ...(after ? {after} : {}),\n ...(before ? {before} : {}),\n ...(string(input.job) ? {jobId: string(input.job)} : {}),\n ...(string(input.jobExecution) ? {jobExecutionId: string(input.jobExecution)} : {}),\n ...(string(input.step) ? {stepId: string(input.step)} : {}),\n ...(string(input.stepAttempt) ? {stepAttemptId: string(input.stepAttempt)} : {}),\n ...(runAttempt ? {runAttempt} : {}),\n };\n}\n\n/**\n * Writes the query string back.\n *\n * Array values reach the router as arrays and the app's `stringifySearch` expands each into\n * repeated keys; joining them here would defeat that and break on branch names with commas.\n */\nexport function workflowRunSearchParams(\n search: WorkflowRunsSearch,\n selection: WorkflowRunSelectionInput = search,\n) {\n return {\n ...(search.search ? {search: search.search} : {}),\n ...(search.status?.length ? {status: search.status} : {}),\n ...(search.branch?.length ? {branch: search.branch} : {}),\n ...(search.actor?.length ? {actor: search.actor} : {}),\n ...(search.event?.length ? {event: search.event} : {}),\n ...(search.after ? {after: search.after} : {}),\n ...(search.before ? {before: search.before} : {}),\n ...(selection.jobId ? {job: selection.jobId} : {}),\n ...(selection.jobExecutionId ? {jobExecution: selection.jobExecutionId} : {}),\n ...(selection.stepId ? {step: selection.stepId} : {}),\n ...(selection.stepAttemptId ? {stepAttempt: selection.stepAttemptId} : {}),\n ...(selection.runAttempt ? {runAttempt: String(selection.runAttempt)} : {}),\n };\n}\n\n/**\n * A filter change. Each member is explicitly optional-or-undefined so that \"present and\n * undefined\" (clear this filter) stays distinguishable from \"absent\" (leave it alone) under\n * `exactOptionalPropertyTypes`.\n */\nexport interface WorkflowRunFilterPatch {\n search?: string | undefined;\n status?: WorkflowRunListStatus[] | undefined;\n branch?: string[] | undefined;\n actor?: string[] | undefined;\n event?: string[] | undefined;\n after?: string | undefined;\n before?: string | undefined;\n}\n\n/**\n * Applies a filter change.\n *\n * A key present with `undefined`, an empty string, or an empty array clears that filter; a\n * key left out is untouched. Cleared filters are deleted rather than stored empty, so \"no\n * filter\" is one URL instead of several that render the same list.\n */\nexport function applyWorkflowRunFilterPatch(\n search: WorkflowRunsSearch,\n patch: WorkflowRunFilterPatch,\n): WorkflowRunsSearch {\n const next: WorkflowRunsSearch = {...search};\n if ('search' in patch) setOrDelete(next, 'search', patch.search || undefined);\n if ('status' in patch) setOrDelete(next, 'status', nonEmptyList(patch.status));\n if ('branch' in patch) setOrDelete(next, 'branch', nonEmptyList(patch.branch));\n if ('actor' in patch) setOrDelete(next, 'actor', nonEmptyList(patch.actor));\n if ('event' in patch) setOrDelete(next, 'event', nonEmptyList(patch.event));\n if ('after' in patch) setOrDelete(next, 'after', patch.after || undefined);\n if ('before' in patch) setOrDelete(next, 'before', patch.before || undefined);\n return next;\n}\n\n/** Drops every filter while keeping the run-selection parameters the detail route owns. */\nexport function clearWorkflowRunFilters(search: WorkflowRunsSearch): WorkflowRunsSearch {\n return applyWorkflowRunFilterPatch(search, {\n search: undefined,\n status: undefined,\n branch: undefined,\n actor: undefined,\n event: undefined,\n after: undefined,\n before: undefined,\n });\n}\n\n/** True when any list filter is active, which separates \"no matches\" from \"no runs\". */\nexport function hasWorkflowRunFilters(search: WorkflowRunsSearch): boolean {\n return Boolean(\n search.search ||\n search.status?.length ||\n search.branch?.length ||\n search.actor?.length ||\n search.event?.length ||\n search.after ||\n search.before,\n );\n}\n\nexport function workflowRouteParams(input: Record<string, unknown>): {\n workspaceSlug: string;\n projectSlug: string;\n workflowRunId?: string;\n} {\n const workspaceSlug = string(input.workspaceSlug);\n const projectSlug = string(input.projectSlug);\n if (!workspaceSlug || !projectSlug)\n throw new Error('Workflow route is missing required path parameters.');\n const workflowRunId = string(input.workflowRunId);\n return workflowRunId ? {workspaceSlug, projectSlug, workflowRunId} : {workspaceSlug, projectSlug};\n}\n\nfunction setOrDelete<TKey extends keyof WorkflowRunsSearch>(\n target: WorkflowRunsSearch,\n key: TKey,\n value: WorkflowRunsSearch[TKey] | undefined,\n): void {\n if (value === undefined) delete target[key];\n else target[key] = value;\n}\n\nfunction nonEmptyList<TValue>(value: readonly TValue[] | undefined): TValue[] | undefined {\n return value && value.length > 0 ? [...value] : undefined;\n}\n\nfunction isWorkflowRunListStatus(value: string): value is WorkflowRunListStatus {\n return STATUS_VALUES.has(value);\n}\n\n/**\n * Normalizes a repeatable parameter into a deduplicated list.\n *\n * A single occurrence parses as a scalar rather than a one-element array, and the parser\n * coerces bare digits to numbers, so `?branch=2024` has to survive as the string `\"2024\"`.\n */\nfunction repeatable(value: unknown): string[] {\n const values = Array.isArray(value) ? value : [value];\n const normalized = values.flatMap((entry) => {\n if (typeof entry === 'string') return entry.length > 0 ? [entry] : [];\n if (typeof entry === 'number' && Number.isFinite(entry)) return [String(entry)];\n if (typeof entry === 'boolean') return [String(entry)];\n return [];\n });\n return [...new Set(normalized)];\n}\n\nfunction calendarDate(value: unknown): string | undefined {\n if (typeof value !== 'string' || !CALENDAR_DATE_PATTERN.test(value)) return undefined;\n // Rejects a well-shaped but impossible date such as 2026-02-31, which Date rolls forward.\n // Parsed as UTC: whether `2026-05-01` is a real date does not depend on the reader's zone,\n // and a local-time parse would reject a day the reader's zone skipped outright.\n const [year, month, day] = value.split('-').map(Number) as [number, number, number];\n const parsed = new Date(`${value}T00:00:00.000Z`);\n const isRealDate =\n !Number.isNaN(parsed.getTime()) &&\n parsed.getUTCFullYear() === year &&\n parsed.getUTCMonth() === month - 1 &&\n parsed.getUTCDate() === day;\n return isRealDate ? value : undefined;\n}\n\nfunction string(value: unknown): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\nfunction positiveInteger(value: unknown): number | undefined {\n const number = typeof value === 'string' ? Number(value) : value;\n return typeof number === 'number' && Number.isInteger(number) && number > 0 ? number : undefined;\n}\n"],"names":["WORKFLOW_RUN_LIST_STATUSES","STATUS_VALUES","Set","CALENDAR_DATE_PATTERN","validateWorkflowRunsSearch","input","search","string","status","repeatable","filter","isWorkflowRunListStatus","branch","actor","event","after","calendarDate","before","runAttempt","positiveInteger","length","job","jobId","jobExecution","jobExecutionId","step","stepId","stepAttempt","stepAttemptId","workflowRunSearchParams","selection","String","applyWorkflowRunFilterPatch","patch","next","setOrDelete","undefined","nonEmptyList","clearWorkflowRunFilters","hasWorkflowRunFilters","Boolean","workflowRouteParams","workspaceSlug","projectSlug","Error","workflowRunId","target","key","value","has","values","Array","isArray","normalized","flatMap","entry","Number","isFinite","test","year","month","day","split","map","parsed","Date","isRealDate","isNaN","getTime","getUTCFullYear","getUTCMonth","getUTCDate","number","isInteger"],"mappings":"AAEA;;;CAGC,GACD,OAAO,MAAMA,6BAA6B;IAAC;IAAa;IAAU;IAAW;CAAY,CAAU;AAgBnG,MAAMC,gBAAgB,IAAIC,IAAYF;AACtC,MAAMG,wBAAwB;AAE9B;;;;;;CAMC,GACD,OAAO,SAASC,2BAA2BC,KAA8B;IACvE,MAAMC,SAASC,OAAOF,MAAMC,MAAM;IAClC,MAAME,SAASC,WAAWJ,MAAMG,MAAM,EAAEE,MAAM,CAACC;IAC/C,MAAMC,SAASH,WAAWJ,MAAMO,MAAM;IACtC,MAAMC,QAAQJ,WAAWJ,MAAMQ,KAAK;IACpC,MAAMC,QAAQL,WAAWJ,MAAMS,KAAK;IACpC,MAAMC,QAAQC,aAAaX,MAAMU,KAAK;IACtC,MAAME,SAASD,aAAaX,MAAMY,MAAM;IACxC,MAAMC,aAAaC,gBAAgBd,MAAMa,UAAU;IAEnD,OAAO;QACL,GAAIZ,SAAS;YAACA;QAAM,IAAI,CAAC,CAAC;QAC1B,GAAIE,OA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,"sources":["../../src/routes/inputs.ts"],"sourcesContent":["import type {WorkflowRunSelectionInput} from '#core/workflow-run-url-state.js';\n\n/**\n * Statuses the run list can filter by. Absent means all; there is deliberately no `all`\n * value, so \"no filter\" and \"every filter\" are the same URL rather than two.\n */\nexport const WORKFLOW_RUN_LIST_STATUSES = ['succeeded', 'failed', 'running', 'cancelled'] as const;\n\nexport type WorkflowRunListStatus = (typeof WORKFLOW_RUN_LIST_STATUSES)[number];\n\nexport const WORKFLOW_RUN_TABS = ['summary', 'jobs', 'annotations', 'source'] as const;\n\nexport type WorkflowRunTab = (typeof WORKFLOW_RUN_TABS)[number];\n\nexport const WORKFLOW_RUN_ANNOTATION_SEVERITIES = ['error', 'warning', 'info', 'success'] as const;\n\nexport type WorkflowRunAnnotationSeverity = (typeof WORKFLOW_RUN_ANNOTATION_SEVERITIES)[number];\n\nexport interface WorkflowRunsSearch extends WorkflowRunSelectionInput {\n search?: string;\n status?: WorkflowRunListStatus[];\n branch?: string[];\n actor?: string[];\n event?: string[];\n /** Inclusive lower bound on the run's local calendar date, `YYYY-MM-DD`. */\n after?: string;\n /** Inclusive upper bound on the run's local calendar date, `YYYY-MM-DD`. */\n before?: string;\n tab?: WorkflowRunTab;\n annotation?: string;\n severity?: WorkflowRunAnnotationSeverity;\n}\n\nconst STATUS_VALUES = new Set<string>(WORKFLOW_RUN_LIST_STATUSES);\nconst TAB_VALUES = new Set<string>(WORKFLOW_RUN_TABS);\nconst ANNOTATION_SEVERITY_VALUES = new Set<string>(WORKFLOW_RUN_ANNOTATION_SEVERITIES);\nconst CALENDAR_DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/u;\n\n/**\n * Reads the run list and run detail query string.\n *\n * Every value is dropped rather than rejected when it does not fit: a truncated or\n * hand-edited URL should degrade to a sensible page, never to an error screen. Unknown\n * parameters are ignored for the same reason.\n */\nexport function validateWorkflowRunsSearch(input: Record<string, unknown>): WorkflowRunsSearch {\n const search = string(input.search);\n const status = repeatable(input.status).filter(isWorkflowRunListStatus);\n const branch = repeatable(input.branch);\n const actor = repeatable(input.actor);\n const event = repeatable(input.event);\n const after = calendarDate(input.after);\n const before = calendarDate(input.before);\n const runAttempt = positiveInteger(input.runAttempt);\n const tabValue = string(input.tab);\n const tab = tabValue && TAB_VALUES.has(tabValue) ? (tabValue as WorkflowRunTab) : undefined;\n const annotation = string(input.annotation);\n const severityValue = string(input.severity);\n const severity =\n severityValue && ANNOTATION_SEVERITY_VALUES.has(severityValue)\n ? (severityValue as WorkflowRunAnnotationSeverity)\n : undefined;\n\n return {\n ...(search ? {search} : {}),\n ...(status.length > 0 ? {status} : {}),\n ...(branch.length > 0 ? {branch} : {}),\n ...(actor.length > 0 ? {actor} : {}),\n ...(event.length > 0 ? {event} : {}),\n ...(after ? {after} : {}),\n ...(before ? {before} : {}),\n ...(tab ? {tab} : {}),\n ...(annotation ? {annotation} : {}),\n ...(severity ? {severity} : {}),\n ...(string(input.job) ? {jobId: string(input.job)} : {}),\n ...(string(input.jobExecution) ? {jobExecutionId: string(input.jobExecution)} : {}),\n ...(string(input.step) ? {stepId: string(input.step)} : {}),\n ...(string(input.stepAttempt) ? {stepAttemptId: string(input.stepAttempt)} : {}),\n ...(runAttempt ? {runAttempt} : {}),\n };\n}\n\n/**\n * Writes the query string back.\n *\n * Array values reach the router as arrays and the app's `stringifySearch` expands each into\n * repeated keys; joining them here would defeat that and break on branch names with commas.\n */\nexport function workflowRunSearchParams(\n search: WorkflowRunsSearch,\n selection: WorkflowRunSelectionInput = search,\n) {\n return {\n ...(search.search ? {search: search.search} : {}),\n ...(search.status?.length ? {status: search.status} : {}),\n ...(search.branch?.length ? {branch: search.branch} : {}),\n ...(search.actor?.length ? {actor: search.actor} : {}),\n ...(search.event?.length ? {event: search.event} : {}),\n ...(search.after ? {after: search.after} : {}),\n ...(search.before ? {before: search.before} : {}),\n ...(search.tab && search.tab !== 'summary' ? {tab: search.tab} : {}),\n ...(search.annotation ? {annotation: search.annotation} : {}),\n ...(search.severity ? {severity: search.severity} : {}),\n ...(selection.jobId ? {job: selection.jobId} : {}),\n ...(selection.jobExecutionId ? {jobExecution: selection.jobExecutionId} : {}),\n ...(selection.stepId ? {step: selection.stepId} : {}),\n ...(selection.stepAttemptId ? {stepAttempt: selection.stepAttemptId} : {}),\n ...(selection.runAttempt ? {runAttempt: String(selection.runAttempt)} : {}),\n };\n}\n\n/**\n * Resolves the detail surface for a URL. Explicit tabs win; legacy selection-only URLs belong\n * to Jobs so their selected detail remains visible instead of silently landing on Summary.\n */\nexport function workflowRunTab(\n search: Pick<WorkflowRunsSearch, 'tab' | 'jobId' | 'jobExecutionId' | 'stepId' | 'stepAttemptId'>,\n): WorkflowRunTab {\n if (search.tab) return search.tab;\n if (search.jobId || search.jobExecutionId || search.stepId || search.stepAttemptId) return 'jobs';\n return 'summary';\n}\n\n/** Serializes only list filters when leaving a run detail page for the run list. */\nexport function workflowRunListSearchParams(search: WorkflowRunsSearch) {\n const {tab: _tab, annotation: _annotation, severity: _severity, ...listSearch} = search;\n return workflowRunSearchParams(listSearch, {});\n}\n\n/**\n * A filter change. Each member is explicitly optional-or-undefined so that \"present and\n * undefined\" (clear this filter) stays distinguishable from \"absent\" (leave it alone) under\n * `exactOptionalPropertyTypes`.\n */\nexport interface WorkflowRunFilterPatch {\n search?: string | undefined;\n status?: WorkflowRunListStatus[] | undefined;\n branch?: string[] | undefined;\n actor?: string[] | undefined;\n event?: string[] | undefined;\n after?: string | undefined;\n before?: string | undefined;\n}\n\n/**\n * Applies a filter change.\n *\n * A key present with `undefined`, an empty string, or an empty array clears that filter; a\n * key left out is untouched. Cleared filters are deleted rather than stored empty, so \"no\n * filter\" is one URL instead of several that render the same list.\n */\nexport function applyWorkflowRunFilterPatch(\n search: WorkflowRunsSearch,\n patch: WorkflowRunFilterPatch,\n): WorkflowRunsSearch {\n const next: WorkflowRunsSearch = {...search};\n if ('search' in patch) setOrDelete(next, 'search', patch.search || undefined);\n if ('status' in patch) setOrDelete(next, 'status', nonEmptyList(patch.status));\n if ('branch' in patch) setOrDelete(next, 'branch', nonEmptyList(patch.branch));\n if ('actor' in patch) setOrDelete(next, 'actor', nonEmptyList(patch.actor));\n if ('event' in patch) setOrDelete(next, 'event', nonEmptyList(patch.event));\n if ('after' in patch) setOrDelete(next, 'after', patch.after || undefined);\n if ('before' in patch) setOrDelete(next, 'before', patch.before || undefined);\n return next;\n}\n\n/** Drops every filter while keeping the run-selection parameters the detail route owns. */\nexport function clearWorkflowRunFilters(search: WorkflowRunsSearch): WorkflowRunsSearch {\n return applyWorkflowRunFilterPatch(search, {\n search: undefined,\n status: undefined,\n branch: undefined,\n actor: undefined,\n event: undefined,\n after: undefined,\n before: undefined,\n });\n}\n\n/** True when any list filter is active, which separates \"no matches\" from \"no runs\". */\nexport function hasWorkflowRunFilters(search: WorkflowRunsSearch): boolean {\n return Boolean(\n search.search ||\n search.status?.length ||\n search.branch?.length ||\n search.actor?.length ||\n search.event?.length ||\n search.after ||\n search.before,\n );\n}\n\nexport function workflowRouteParams(input: Record<string, unknown>): {\n workspaceSlug: string;\n projectSlug: string;\n workflowRunId?: string;\n} {\n const workspaceSlug = string(input.workspaceSlug);\n const projectSlug = string(input.projectSlug);\n if (!workspaceSlug || !projectSlug)\n throw new Error('Workflow route is missing required path parameters.');\n const workflowRunId = string(input.workflowRunId);\n return workflowRunId ? {workspaceSlug, projectSlug, workflowRunId} : {workspaceSlug, projectSlug};\n}\n\nfunction setOrDelete<TKey extends keyof WorkflowRunsSearch>(\n target: WorkflowRunsSearch,\n key: TKey,\n value: WorkflowRunsSearch[TKey] | undefined,\n): void {\n if (value === undefined) delete target[key];\n else target[key] = value;\n}\n\nfunction nonEmptyList<TValue>(value: readonly TValue[] | undefined): TValue[] | undefined {\n return value && value.length > 0 ? [...value] : undefined;\n}\n\nfunction isWorkflowRunListStatus(value: string): value is WorkflowRunListStatus {\n return STATUS_VALUES.has(value);\n}\n\n/**\n * Normalizes a repeatable parameter into a deduplicated list.\n *\n * A single occurrence parses as a scalar rather than a one-element array, and the parser\n * coerces bare digits to numbers, so `?branch=2024` has to survive as the string `\"2024\"`.\n */\nfunction repeatable(value: unknown): string[] {\n const values = Array.isArray(value) ? value : [value];\n const normalized = values.flatMap((entry) => {\n if (typeof entry === 'string') return entry.length > 0 ? [entry] : [];\n if (typeof entry === 'number' && Number.isFinite(entry)) return [String(entry)];\n if (typeof entry === 'boolean') return [String(entry)];\n return [];\n });\n return [...new Set(normalized)];\n}\n\nfunction calendarDate(value: unknown): string | undefined {\n if (typeof value !== 'string' || !CALENDAR_DATE_PATTERN.test(value)) return undefined;\n // Rejects a well-shaped but impossible date such as 2026-02-31, which Date rolls forward.\n // Parsed as UTC: whether `2026-05-01` is a real date does not depend on the reader's zone,\n // and a local-time parse would reject a day the reader's zone skipped outright.\n const [year, month, day] = value.split('-').map(Number) as [number, number, number];\n const parsed = new Date(`${value}T00:00:00.000Z`);\n const isRealDate =\n !Number.isNaN(parsed.getTime()) &&\n parsed.getUTCFullYear() === year &&\n parsed.getUTCMonth() === month - 1 &&\n parsed.getUTCDate() === day;\n return isRealDate ? value : undefined;\n}\n\nfunction string(value: unknown): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\nfunction positiveInteger(value: unknown): number | undefined {\n const number = typeof value === 'string' ? Number(value) : value;\n return typeof number === 'number' && Number.isInteger(number) && number > 0 ? number : undefined;\n}\n"],"names":["WORKFLOW_RUN_LIST_STATUSES","WORKFLOW_RUN_TABS","WORKFLOW_RUN_ANNOTATION_SEVERITIES","STATUS_VALUES","Set","TAB_VALUES","ANNOTATION_SEVERITY_VALUES","CALENDAR_DATE_PATTERN","validateWorkflowRunsSearch","input","search","string","status","repeatable","filter","isWorkflowRunListStatus","branch","actor","event","after","calendarDate","before","runAttempt","positiveInteger","tabValue","tab","has","undefined","annotation","severityValue","severity","length","job","jobId","jobExecution","jobExecutionId","step","stepId","stepAttempt","stepAttemptId","workflowRunSearchParams","selection","String","workflowRunTab","workflowRunListSearchParams","_tab","_annotation","_severity","listSearch","applyWorkflowRunFilterPatch","patch","next","setOrDelete","nonEmptyList","clearWorkflowRunFilters","hasWorkflowRunFilters","Boolean","workflowRouteParams","workspaceSlug","projectSlug","Error","workflowRunId","target","key","value","values","Array","isArray","normalized","flatMap","entry","Number","isFinite","test","year","month","day","split","map","parsed","Date","isRealDate","isNaN","getTime","getUTCFullYear","getUTCMonth","getUTCDate","number","isInteger"],"mappings":"AAEA;;;CAGC,GACD,OAAO,MAAMA,6BAA6B;IAAC;IAAa;IAAU;IAAW;CAAY,CAAU;AAInG,OAAO,MAAMC,oBAAoB;IAAC;IAAW;IAAQ;IAAe;CAAS,CAAU;AAIvF,OAAO,MAAMC,qCAAqC;IAAC;IAAS;IAAW;IAAQ;CAAU,CAAU;AAmBnG,MAAMC,gBAAgB,IAAIC,IAAYJ;AACtC,MAAMK,aAAa,IAAID,IAAYH;AACnC,MAAMK,6BAA6B,IAAIF,IAAYF;AACnD,MAAMK,wBAAwB;AAE9B;;;;;;CAMC,GACD,OAAO,SAASC,2BAA2BC,KAA8B;IACvE,MAAMC,SAASC,OAAOF,MAAMC,MAAM;IAClC,MAAME,SAASC,WAAWJ,MAAMG,MAAM,EAAEE,MAAM,CAACC;IAC/C,MAAMC,SAASH,WAAWJ,MAAMO,MAAM;IACtC,MAAMC,QAAQJ,WAAWJ,MAAMQ,KAAK;IACpC,MAAMC,QAAQL,WAAWJ,MAAMS,KAAK;IACpC,MAAMC,QAAQC,aAAaX,MAAMU,KAAK;IACtC,MAAME,SAASD,aAAaX,MAAMY,MAAM;IACxC,MAAMC,aAAaC,gBAAgBd,MAAMa,UAAU;IACnD,MAAME,WAAWb,OAAOF,MAAMgB,GAAG;IACjC,MAAMA,MAAMD,YAAYnB,WAAWqB,GAAG,CAACF,YAAaA,WAA8BG;IAClF,MAAMC,aAAajB,OAAOF,MAAMmB,UAAU;IAC1C,MAAMC,gBAAgBlB,OAAOF,MAAMqB,QAAQ;IAC3C,MAAMA,WACJ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