@shipfox/client-workflows 19.0.0 → 20.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/components/workflow-run-duration-label.d.ts +8 -7
- package/dist/components/workflow-run-duration-label.d.ts.map +1 -1
- package/dist/components/workflow-run-duration-label.js +15 -31
- package/dist/components/workflow-run-duration-label.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.d.ts.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.js +9 -6
- package/dist/components/workflow-run-list/workflow-run-row.js.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.js +7 -34
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
- package/dist/components/workflow-status/status-visuals.d.ts.map +1 -1
- package/dist/components/workflow-status/status-visuals.js +0 -9
- package/dist/components/workflow-status/status-visuals.js.map +1 -1
- package/dist/components/workflow-status/workflow-status-icon.d.ts.map +1 -1
- package/dist/components/workflow-status/workflow-status-icon.js +0 -11
- package/dist/components/workflow-status/workflow-status-icon.js.map +1 -1
- package/dist/core/entities/workflow-run.d.ts +10 -55
- package/dist/core/entities/workflow-run.d.ts.map +1 -1
- package/dist/core/entities/workflow-run.js +1 -94
- package/dist/core/entities/workflow-run.js.map +1 -1
- package/dist/core/workflow-run.d.ts +2 -2
- package/dist/core/workflow-run.d.ts.map +1 -1
- package/dist/core/workflow-run.js +1 -1
- package/dist/core/workflow-run.js.map +1 -1
- package/dist/hooks/api/workflow-run-mapper.d.ts.map +1 -1
- package/dist/hooks/api/workflow-run-mapper.js +3 -1
- package/dist/hooks/api/workflow-run-mapper.js.map +1 -1
- package/dist/hooks/api/workflow-runs.js +1 -0
- package/dist/hooks/api/workflow-runs.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/workflow-run-duration-label.tsx +21 -44
- package/src/components/workflow-run-list/workflow-run-list-view.test.tsx +48 -0
- package/src/components/workflow-run-list/workflow-run-row.tsx +7 -6
- package/src/components/workflow-run-summary/workflow-run-summary.stories.tsx +0 -38
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +73 -21
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +6 -27
- package/src/components/workflow-status/status-visuals.ts +0 -4
- package/src/components/workflow-status/workflow-status-icon.stories.tsx +0 -1
- package/src/components/workflow-status/workflow-status-icon.tsx +0 -18
- package/src/core/entities/workflow-run.ts +9 -136
- package/src/core/workflow-run.test.ts +2 -0
- package/src/core/workflow-run.ts +0 -8
- package/src/hooks/api/workflow-run-mapper.ts +2 -0
- package/src/hooks/api/workflow-runs.ts +1 -1
- package/test/fixtures/workflow-run.ts +30 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/src/core/entities/workflow-run-display.test.ts +0 -187
|
@@ -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 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 /** Accessible status label when the surrounding surface needs to name its scope. */\n ariaLabel?: string | undefined;\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 ariaLabel,\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 === '
|
|
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 /** Accessible status label when the surrounding surface needs to name its scope. */\n ariaLabel?: string | undefined;\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 ariaLabel,\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\n role=\"img\"\n aria-label={ariaLabel ?? visual.label}\n className={cn('inline-flex shrink-0', className)}\n >\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","ariaLabel","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;IACXC,QAAQ;IACRC,WAAW;IACXC,SAAS;AACX;AAEA,0FAA0F;AAC1F,gGAAgG;AAChG,MAAMC,aAAgD;IACpDC,kBAAkB;IAClBC,cAAc;IACdC,aAAa;AACf;AAEA,+FAA+F;AAC/F,MAAMC,eAAuC;IAC3C,IAAI;IACJ,IAAI;IACJ,IAAI;AACN;AAEA,6FAA6F;AAC7F,yFAAyF;AACzF,yFAAyF;AACzF,MAAMC,oBAAoB;AAkB1B;;;;CAIC,GACD,OAAO,SAASC,mBAAmB,EACjCC,MAAM,EACN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C,KAACE;gBAAe8C,OAAO;0BAAEJ;;0BACzB,KAAC3C;0BAAgB6B,OAAOiB,KAAK;;;;AAGnC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { type Job, type JobDisplayStatus, type JobMode, type JobStatus, type ListenerStatus, WORKFLOW_JOB_STATUSES } from './job.js';
|
|
2
|
-
import
|
|
2
|
+
import type { JobExecutionStatus } from './job-execution.js';
|
|
3
3
|
import type { WorkflowRunAttempt, WorkflowRunAttemptSummary } from './workflow-run-attempt.js';
|
|
4
4
|
export type WorkflowRunStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
5
5
|
export type WorkflowRunRerunMode = 'all' | 'failed';
|
|
6
6
|
export type WorkflowStatus = WorkflowRunStatus | (typeof WORKFLOW_JOB_STATUSES)[number];
|
|
7
7
|
/**
|
|
8
|
-
* `listening`
|
|
9
|
-
*
|
|
8
|
+
* `listening` is display-only: the API never returns it, and it is derived from the listener
|
|
9
|
+
* state a job already carries.
|
|
10
10
|
*/
|
|
11
|
-
export type WorkflowDisplayStatus = WorkflowStatus | 'listening'
|
|
11
|
+
export type WorkflowDisplayStatus = WorkflowStatus | 'listening';
|
|
12
12
|
export declare const WORKFLOW_RUN_STATUSES: readonly ["pending", "running", "succeeded", "failed", "cancelled"];
|
|
13
|
-
export declare const WORKFLOW_DISPLAY_STATUSES: readonly ["pending", "running", "succeeded", "failed", "cancelled", "pending", "running", "succeeded", "failed", "cancelled", "skipped", "listening"
|
|
13
|
+
export declare const WORKFLOW_DISPLAY_STATUSES: readonly ["pending", "running", "succeeded", "failed", "cancelled", "pending", "running", "succeeded", "failed", "cancelled", "skipped", "listening"];
|
|
14
14
|
export declare const TERMINAL_WORKFLOW_RUN_STATUSES: readonly ["succeeded", "failed", "cancelled"];
|
|
15
15
|
export interface WorkflowSourceSnapshot {
|
|
16
16
|
content: string;
|
|
@@ -46,11 +46,14 @@ export interface WorkflowRunJobStatusCount {
|
|
|
46
46
|
* of them.
|
|
47
47
|
*
|
|
48
48
|
* `preview` is capped by the API, so `preview.length` is not the job count and the strip
|
|
49
|
-
* reads `total` and `statusCounts` for anything it says rather than anything it draws.
|
|
49
|
+
* reads `total` and `statusCounts` for anything it says rather than anything it draws. The API
|
|
50
|
+
* also reports whether any job execution has started because a terminal `cancelled` job can have
|
|
51
|
+
* started work even though its job status does not preserve that distinction.
|
|
50
52
|
*/
|
|
51
53
|
export interface WorkflowRunJobs {
|
|
52
54
|
preview: WorkflowRunJobSummary[];
|
|
53
55
|
statusCounts: WorkflowRunJobStatusCount[];
|
|
56
|
+
hasStartedJobExecution: boolean;
|
|
54
57
|
total: number;
|
|
55
58
|
}
|
|
56
59
|
export interface WorkflowRun {
|
|
@@ -87,6 +90,7 @@ export interface WorkflowRunDetail extends WorkflowRun {
|
|
|
87
90
|
latestAttempt: number;
|
|
88
91
|
runAttempt: WorkflowRunAttempt;
|
|
89
92
|
jobs: Job[];
|
|
93
|
+
hasStartedJobExecution: boolean;
|
|
90
94
|
}
|
|
91
95
|
export interface WorkflowRunListPage {
|
|
92
96
|
runs: WorkflowRunListItem[];
|
|
@@ -114,53 +118,4 @@ export declare function workflowRunCommitLabel(run: Pick<WorkflowRun, 'triggerRe
|
|
|
114
118
|
export declare function workflowRunActor(run: Pick<WorkflowRun, 'triggerReference'>): string | null;
|
|
115
119
|
export declare function isWorkflowRunTerminal(status: WorkflowRunStatus): boolean;
|
|
116
120
|
export declare function isWorkflowStatus(status: string): status is WorkflowStatus;
|
|
117
|
-
/**
|
|
118
|
-
* A run's headline duration, split the way a job's already is. An attempt's `startedAt` marks
|
|
119
|
-
* when the orchestrator picked the run up, not when work began, so a run whose jobs are all
|
|
120
|
-
* still waiting for a runner reads as queue time rather than as run time.
|
|
121
|
-
*/
|
|
122
|
-
export type WorkflowRunDisplayDuration = JobExecutionDisplayDuration;
|
|
123
|
-
/** What every surface shows for a run, derived together so status and duration cannot disagree. */
|
|
124
|
-
export interface WorkflowRunDisplay {
|
|
125
|
-
status: WorkflowDisplayStatus;
|
|
126
|
-
duration: WorkflowRunDisplayDuration | null;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* The evidence a surface can offer about a run's progress.
|
|
130
|
-
*
|
|
131
|
-
* `jobStatuses` is what every surface has: the list carries status counts, the detail carries
|
|
132
|
-
* whole jobs. `firstStartedAt` is the detail's extra precision, and where it is absent the
|
|
133
|
-
* attempt's own mark stands in.
|
|
134
|
-
*/
|
|
135
|
-
export interface WorkflowRunProgress {
|
|
136
|
-
runStatus: WorkflowRunStatus;
|
|
137
|
-
startedAt: string | null;
|
|
138
|
-
finishedAt: string | null;
|
|
139
|
-
jobStatuses: JobDisplayStatus[];
|
|
140
|
-
firstStartedAt?: string | null | undefined;
|
|
141
|
-
}
|
|
142
|
-
/** When the run's earliest execution began, or null while none of them has. */
|
|
143
|
-
export declare function workflowRunFirstStartedAt(jobs: Job[]): string | null;
|
|
144
|
-
/**
|
|
145
|
-
* The single rule behind every run readout. An attempt's `startedAt` marks when the
|
|
146
|
-
* orchestrator picked the run up, not when work began, so a run whose jobs are all still
|
|
147
|
-
* waiting reads as `Queued` for queue time. Calling that "running for 2h" sends an operator to
|
|
148
|
-
* debug a build that never began.
|
|
149
|
-
*/
|
|
150
|
-
export declare function deriveWorkflowRunDisplay(progress: WorkflowRunProgress): WorkflowRunDisplay;
|
|
151
|
-
/** The run detail's reading: whole jobs, so queue and run time split on the first execution. */
|
|
152
|
-
export declare function workflowRunDetailDisplay(run: {
|
|
153
|
-
runAttempt: Pick<WorkflowRunAttemptSummary, 'status' | 'startedAt' | 'finishedAt'>;
|
|
154
|
-
jobs: Job[];
|
|
155
|
-
}): WorkflowRunDisplay;
|
|
156
|
-
/**
|
|
157
|
-
* The run list's reading: status counts cover every job, not just the drawn preview, so a row
|
|
158
|
-
* reaches the same verdict as the detail page without fetching a single timestamp more.
|
|
159
|
-
*/
|
|
160
|
-
export declare function workflowRunListItemDisplay(run: WorkflowRunListItem): WorkflowRunDisplay;
|
|
161
|
-
/**
|
|
162
|
-
* The job the run is waiting on: the one queued longest without starting. Named only so a
|
|
163
|
-
* queued run says what it waits for instead of showing a number with no subject.
|
|
164
|
-
*/
|
|
165
|
-
export declare function workflowRunBlockingJob(jobs: Job[]): Job | null;
|
|
166
121
|
//# sourceMappingURL=workflow-run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../../src/core/entities/workflow-run.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAClB,OAAO,
|
|
1
|
+
{"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../../src/core/entities/workflow-run.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAC,kBAAkB,EAAE,yBAAyB,EAAC,MAAM,2BAA2B,CAAC;AAE7F,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAC7F,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,QAAQ,CAAC;AACpD,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AACxF;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG,WAAW,CAAC;AAEjE,eAAO,MAAM,qBAAqB,qEAMe,CAAC;AAElD,eAAO,MAAM,yBAAyB,uJAIe,CA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BAAgB,8BAA8B,CAAC,EAC7C,aAAa,EACb,YAAY,GACb,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CAET;AAKD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,GAAG,MAAM,GAAG,IAAI,CAQhG;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,GAAG,MAAM,GAAG,IAAI,CAGhG;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,GAAG,MAAM,GAAG,IAAI,CAE1F;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAExE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,cAAc,CAEzE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WORKFLOW_JOB_STATUSES } from './job.js';
|
|
2
|
-
import { elapsedTimeFromTimestamps } from './job-execution.js';
|
|
3
2
|
export const WORKFLOW_RUN_STATUSES = [
|
|
4
3
|
'pending',
|
|
5
4
|
'running',
|
|
@@ -10,8 +9,7 @@ export const WORKFLOW_RUN_STATUSES = [
|
|
|
10
9
|
export const WORKFLOW_DISPLAY_STATUSES = [
|
|
11
10
|
...WORKFLOW_RUN_STATUSES,
|
|
12
11
|
...WORKFLOW_JOB_STATUSES,
|
|
13
|
-
'listening'
|
|
14
|
-
'queued'
|
|
12
|
+
'listening'
|
|
15
13
|
];
|
|
16
14
|
export const TERMINAL_WORKFLOW_RUN_STATUSES = [
|
|
17
15
|
'succeeded',
|
|
@@ -60,96 +58,5 @@ export function isWorkflowRunTerminal(status) {
|
|
|
60
58
|
export function isWorkflowStatus(status) {
|
|
61
59
|
return WORKFLOW_STATUSES.has(status);
|
|
62
60
|
}
|
|
63
|
-
/** When the run's earliest execution began, or null while none of them has. */ export function workflowRunFirstStartedAt(jobs) {
|
|
64
|
-
let earliest = null;
|
|
65
|
-
let earliestMs = Number.POSITIVE_INFINITY;
|
|
66
|
-
for (const job of jobs){
|
|
67
|
-
for (const { startedAt } of job.jobExecutions){
|
|
68
|
-
if (startedAt === null) continue;
|
|
69
|
-
const startedMs = new Date(startedAt).getTime();
|
|
70
|
-
if (!Number.isFinite(startedMs) || startedMs >= earliestMs) continue;
|
|
71
|
-
earliest = startedAt;
|
|
72
|
-
earliestMs = startedMs;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return earliest;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Whether any work has begun. A run with no jobs on hand is a run whose jobs were not fetched,
|
|
79
|
-
* which is no evidence that nothing started, so it counts as started rather than claiming a
|
|
80
|
-
* queue this surface cannot see.
|
|
81
|
-
*/ function workflowRunHasStarted({ jobStatuses, firstStartedAt }) {
|
|
82
|
-
if (firstStartedAt != null) return true;
|
|
83
|
-
if (jobStatuses.length === 0) return true;
|
|
84
|
-
return jobStatuses.some((status)=>status !== 'pending' && status !== 'skipped');
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* The single rule behind every run readout. An attempt's `startedAt` marks when the
|
|
88
|
-
* orchestrator picked the run up, not when work began, so a run whose jobs are all still
|
|
89
|
-
* waiting reads as `Queued` for queue time. Calling that "running for 2h" sends an operator to
|
|
90
|
-
* debug a build that never began.
|
|
91
|
-
*/ export function deriveWorkflowRunDisplay(progress) {
|
|
92
|
-
const { runStatus, startedAt, finishedAt, firstStartedAt } = progress;
|
|
93
|
-
const hasStarted = workflowRunHasStarted(progress);
|
|
94
|
-
const status = runStatus === 'running' && !hasStarted ? 'queued' : runStatus;
|
|
95
|
-
if (startedAt === null) return {
|
|
96
|
-
status,
|
|
97
|
-
duration: null
|
|
98
|
-
};
|
|
99
|
-
// A run cancelled before anything started keeps its queue reading rather than reporting a
|
|
100
|
-
// run that never was.
|
|
101
|
-
const time = elapsedTimeFromTimestamps({
|
|
102
|
-
from: firstStartedAt ?? startedAt,
|
|
103
|
-
to: finishedAt
|
|
104
|
-
});
|
|
105
|
-
if (time === null) return {
|
|
106
|
-
status,
|
|
107
|
-
duration: null
|
|
108
|
-
};
|
|
109
|
-
return {
|
|
110
|
-
status,
|
|
111
|
-
duration: {
|
|
112
|
-
kind: hasStarted ? 'run' : 'queue',
|
|
113
|
-
...time
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
/** The run detail's reading: whole jobs, so queue and run time split on the first execution. */ export function workflowRunDetailDisplay(run) {
|
|
118
|
-
return deriveWorkflowRunDisplay({
|
|
119
|
-
runStatus: run.runAttempt.status,
|
|
120
|
-
startedAt: run.runAttempt.startedAt,
|
|
121
|
-
finishedAt: run.runAttempt.finishedAt,
|
|
122
|
-
jobStatuses: run.jobs.map((job)=>job.status),
|
|
123
|
-
firstStartedAt: workflowRunFirstStartedAt(run.jobs)
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* The run list's reading: status counts cover every job, not just the drawn preview, so a row
|
|
128
|
-
* reaches the same verdict as the detail page without fetching a single timestamp more.
|
|
129
|
-
*/ export function workflowRunListItemDisplay(run) {
|
|
130
|
-
return deriveWorkflowRunDisplay({
|
|
131
|
-
runStatus: run.status,
|
|
132
|
-
startedAt: run.runAttempt.startedAt,
|
|
133
|
-
finishedAt: run.runAttempt.finishedAt,
|
|
134
|
-
jobStatuses: run.jobs.statusCounts.filter(({ count })=>count > 0).map(({ status })=>status)
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* The job the run is waiting on: the one queued longest without starting. Named only so a
|
|
139
|
-
* queued run says what it waits for instead of showing a number with no subject.
|
|
140
|
-
*/ export function workflowRunBlockingJob(jobs) {
|
|
141
|
-
let blocking = null;
|
|
142
|
-
let queuedMs = Number.POSITIVE_INFINITY;
|
|
143
|
-
for (const job of jobs){
|
|
144
|
-
for (const { queuedAt, startedAt, finishedAt } of job.jobExecutions){
|
|
145
|
-
if (queuedAt === null || startedAt !== null || finishedAt !== null) continue;
|
|
146
|
-
const candidateMs = new Date(queuedAt).getTime();
|
|
147
|
-
if (!Number.isFinite(candidateMs) || candidateMs >= queuedMs) continue;
|
|
148
|
-
blocking = job;
|
|
149
|
-
queuedMs = candidateMs;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return blocking;
|
|
153
|
-
}
|
|
154
61
|
|
|
155
62
|
//# sourceMappingURL=workflow-run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/entities/workflow-run.ts"],"sourcesContent":["import {\n type Job,\n type JobDisplayStatus,\n type JobMode,\n type JobStatus,\n type ListenerStatus,\n WORKFLOW_JOB_STATUSES,\n} from './job.js';\nimport {\n elapsedTimeFromTimestamps,\n type JobExecutionDisplayDuration,\n type JobExecutionStatus,\n} from './job-execution.js';\nimport type {WorkflowRunAttempt, WorkflowRunAttemptSummary} from './workflow-run-attempt.js';\n\nexport type WorkflowRunStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';\nexport type WorkflowRunRerunMode = 'all' | 'failed';\nexport type WorkflowStatus = WorkflowRunStatus | (typeof WORKFLOW_JOB_STATUSES)[number];\n/**\n * `listening` and `queued` are display-only: the API never returns them, and both are derived\n * from the jobs a run already carries.\n */\nexport type WorkflowDisplayStatus = WorkflowStatus | 'listening' | 'queued';\n\nexport const WORKFLOW_RUN_STATUSES = [\n 'pending',\n 'running',\n 'succeeded',\n 'failed',\n 'cancelled',\n] as const satisfies readonly WorkflowRunStatus[];\n\nexport const WORKFLOW_DISPLAY_STATUSES = [\n ...WORKFLOW_RUN_STATUSES,\n ...WORKFLOW_JOB_STATUSES,\n 'listening',\n 'queued',\n] as const satisfies readonly WorkflowDisplayStatus[];\n\nexport const TERMINAL_WORKFLOW_RUN_STATUSES = [\n 'succeeded',\n 'failed',\n 'cancelled',\n] as const satisfies readonly WorkflowRunStatus[];\n\nconst WORKFLOW_STATUSES = new Set<WorkflowStatus>([\n ...WORKFLOW_RUN_STATUSES,\n ...WORKFLOW_JOB_STATUSES,\n]);\nconst TERMINAL_WORKFLOW_RUN_STATUS_SET = new Set<WorkflowRunStatus>(TERMINAL_WORKFLOW_RUN_STATUSES);\n\nexport interface WorkflowSourceSnapshot {\n content: string;\n format: 'yaml';\n}\n\n/**\n * Provider-neutral trigger facts. Every field is nullable: only source-control triggers\n * resolve a reference at all, and a payload can name a ref without naming an actor.\n */\nexport interface WorkflowRunTriggerReference {\n repository: string | null;\n ref: string | null;\n commit: string | null;\n actor: string | null;\n}\n\n/** One glyph in a run row's job status strip: enough to draw and label it, nothing more. */\nexport interface WorkflowRunJobSummary {\n id: string;\n key: string;\n name: string | null;\n status: JobStatus;\n mode: JobMode;\n listenerStatus: ListenerStatus;\n executionStatus: JobExecutionStatus | null;\n position: number;\n}\n\nexport interface WorkflowRunJobStatusCount {\n status: JobDisplayStatus;\n count: number;\n}\n\n/**\n * A run's jobs as the list receives them: a bounded slice to draw, plus totals covering all\n * of them.\n *\n * `preview` is capped by the API, so `preview.length` is not the job count and the strip\n * reads `total` and `statusCounts` for anything it says rather than anything it draws.\n */\nexport interface WorkflowRunJobs {\n preview: WorkflowRunJobSummary[];\n statusCounts: WorkflowRunJobStatusCount[];\n total: number;\n}\n\nexport interface WorkflowRun {\n id: string;\n projectId: string;\n definitionId: string;\n number: number | null;\n name: string;\n workflowName: string;\n currentAttempt: number;\n triggerProvider: string | null;\n triggerSource: string;\n triggerEvent: string;\n triggerDisplayLabel: string;\n triggerLabel: string;\n triggerPayload: Record<string, unknown>;\n triggerReference: WorkflowRunTriggerReference | null;\n inputs: Record<string, unknown> | null;\n sourceSnapshot: WorkflowSourceSnapshot | null;\n createdAt: string;\n updatedAt: string;\n isTemporary: boolean;\n}\n\n/** A run as the API returns it outside the list: no job strip, because none was fetched. */\nexport interface WorkflowRunRecord extends WorkflowRun {\n status: WorkflowRunStatus;\n latestAttempt: number;\n runAttempt: WorkflowRunAttemptSummary;\n}\n\nexport interface WorkflowRunListItem extends WorkflowRunRecord {\n jobs: WorkflowRunJobs;\n}\n\nexport interface WorkflowRunDetail extends WorkflowRun {\n latestAttempt: number;\n runAttempt: WorkflowRunAttempt;\n jobs: Job[];\n}\n\nexport interface WorkflowRunListPage {\n runs: WorkflowRunListItem[];\n nextCursor: string | null;\n filteredTotalCount: number | null;\n}\n\nexport interface ManualWorkflowLaunch {\n workflowRunId: string;\n}\n\nexport function workflowRunTriggerLabel({\n triggerSource,\n triggerEvent,\n}: {\n triggerSource: string;\n triggerEvent: string;\n}): string {\n return [triggerSource, triggerEvent].filter(Boolean).join(' · ');\n}\n\nexport function workflowRunTriggerDisplayLabel({\n triggerSource,\n triggerEvent,\n}: {\n triggerSource: string;\n triggerEvent: string;\n}): string {\n return triggerEvent || triggerSource;\n}\n\nconst SHORT_COMMIT_LENGTH = 7;\nconst PULL_REQUEST_REF_PATTERN = /^refs\\/pull\\/(\\d+)\\/head$/u;\n\n/**\n * The ref as a person names it: `main` for a branch, `#42` for a pull request, the tag for a\n * tag. An unrecognized ref is shown verbatim rather than hidden, since a ref nobody can read\n * is still better evidence than a blank cell.\n */\nexport function workflowRunBranchLabel(run: Pick<WorkflowRun, 'triggerReference'>): string | null {\n const ref = run.triggerReference?.ref;\n if (!ref) return null;\n const pullRequest = PULL_REQUEST_REF_PATTERN.exec(ref);\n if (pullRequest) return `#${pullRequest[1]}`;\n if (ref.startsWith('refs/heads/')) return ref.slice('refs/heads/'.length);\n if (ref.startsWith('refs/tags/')) return ref.slice('refs/tags/'.length);\n return ref;\n}\n\nexport function workflowRunCommitLabel(run: Pick<WorkflowRun, 'triggerReference'>): string | null {\n const commit = run.triggerReference?.commit;\n return commit ? commit.slice(0, SHORT_COMMIT_LENGTH) : null;\n}\n\nexport function workflowRunActor(run: Pick<WorkflowRun, 'triggerReference'>): string | null {\n return run.triggerReference?.actor ?? null;\n}\n\nexport function isWorkflowRunTerminal(status: WorkflowRunStatus): boolean {\n return TERMINAL_WORKFLOW_RUN_STATUS_SET.has(status);\n}\n\nexport function isWorkflowStatus(status: string): status is WorkflowStatus {\n return WORKFLOW_STATUSES.has(status as WorkflowStatus);\n}\n\n/**\n * A run's headline duration, split the way a job's already is. An attempt's `startedAt` marks\n * when the orchestrator picked the run up, not when work began, so a run whose jobs are all\n * still waiting for a runner reads as queue time rather than as run time.\n */\nexport type WorkflowRunDisplayDuration = JobExecutionDisplayDuration;\n\n/** What every surface shows for a run, derived together so status and duration cannot disagree. */\nexport interface WorkflowRunDisplay {\n status: WorkflowDisplayStatus;\n duration: WorkflowRunDisplayDuration | null;\n}\n\n/**\n * The evidence a surface can offer about a run's progress.\n *\n * `jobStatuses` is what every surface has: the list carries status counts, the detail carries\n * whole jobs. `firstStartedAt` is the detail's extra precision, and where it is absent the\n * attempt's own mark stands in.\n */\nexport interface WorkflowRunProgress {\n runStatus: WorkflowRunStatus;\n startedAt: string | null;\n finishedAt: string | null;\n jobStatuses: JobDisplayStatus[];\n firstStartedAt?: string | null | undefined;\n}\n\n/** When the run's earliest execution began, or null while none of them has. */\nexport function workflowRunFirstStartedAt(jobs: Job[]): string | null {\n let earliest: string | null = null;\n let earliestMs = Number.POSITIVE_INFINITY;\n\n for (const job of jobs) {\n for (const {startedAt} of job.jobExecutions) {\n if (startedAt === null) continue;\n const startedMs = new Date(startedAt).getTime();\n if (!Number.isFinite(startedMs) || startedMs >= earliestMs) continue;\n earliest = startedAt;\n earliestMs = startedMs;\n }\n }\n\n return earliest;\n}\n\n/**\n * Whether any work has begun. A run with no jobs on hand is a run whose jobs were not fetched,\n * which is no evidence that nothing started, so it counts as started rather than claiming a\n * queue this surface cannot see.\n */\nfunction workflowRunHasStarted({jobStatuses, firstStartedAt}: WorkflowRunProgress): boolean {\n if (firstStartedAt != null) return true;\n if (jobStatuses.length === 0) return true;\n return jobStatuses.some((status) => status !== 'pending' && status !== 'skipped');\n}\n\n/**\n * The single rule behind every run readout. An attempt's `startedAt` marks when the\n * orchestrator picked the run up, not when work began, so a run whose jobs are all still\n * waiting reads as `Queued` for queue time. Calling that \"running for 2h\" sends an operator to\n * debug a build that never began.\n */\nexport function deriveWorkflowRunDisplay(progress: WorkflowRunProgress): WorkflowRunDisplay {\n const {runStatus, startedAt, finishedAt, firstStartedAt} = progress;\n const hasStarted = workflowRunHasStarted(progress);\n const status = runStatus === 'running' && !hasStarted ? 'queued' : runStatus;\n\n if (startedAt === null) return {status, duration: null};\n\n // A run cancelled before anything started keeps its queue reading rather than reporting a\n // run that never was.\n const time = elapsedTimeFromTimestamps({from: firstStartedAt ?? startedAt, to: finishedAt});\n if (time === null) return {status, duration: null};\n\n return {status, duration: {kind: hasStarted ? 'run' : 'queue', ...time}};\n}\n\n/** The run detail's reading: whole jobs, so queue and run time split on the first execution. */\nexport function workflowRunDetailDisplay(run: {\n runAttempt: Pick<WorkflowRunAttemptSummary, 'status' | 'startedAt' | 'finishedAt'>;\n jobs: Job[];\n}): WorkflowRunDisplay {\n return deriveWorkflowRunDisplay({\n runStatus: run.runAttempt.status,\n startedAt: run.runAttempt.startedAt,\n finishedAt: run.runAttempt.finishedAt,\n jobStatuses: run.jobs.map((job) => job.status),\n firstStartedAt: workflowRunFirstStartedAt(run.jobs),\n });\n}\n\n/**\n * The run list's reading: status counts cover every job, not just the drawn preview, so a row\n * reaches the same verdict as the detail page without fetching a single timestamp more.\n */\nexport function workflowRunListItemDisplay(run: WorkflowRunListItem): WorkflowRunDisplay {\n return deriveWorkflowRunDisplay({\n runStatus: run.status,\n startedAt: run.runAttempt.startedAt,\n finishedAt: run.runAttempt.finishedAt,\n jobStatuses: run.jobs.statusCounts.filter(({count}) => count > 0).map(({status}) => status),\n });\n}\n\n/**\n * The job the run is waiting on: the one queued longest without starting. Named only so a\n * queued run says what it waits for instead of showing a number with no subject.\n */\nexport function workflowRunBlockingJob(jobs: Job[]): Job | null {\n let blocking: Job | null = null;\n let queuedMs = Number.POSITIVE_INFINITY;\n\n for (const job of jobs) {\n for (const {queuedAt, startedAt, finishedAt} of job.jobExecutions) {\n if (queuedAt === null || startedAt !== null || finishedAt !== null) continue;\n const candidateMs = new Date(queuedAt).getTime();\n if (!Number.isFinite(candidateMs) || candidateMs >= queuedMs) continue;\n blocking = job;\n queuedMs = candidateMs;\n }\n }\n\n return blocking;\n}\n"],"names":["WORKFLOW_JOB_STATUSES","elapsedTimeFromTimestamps","WORKFLOW_RUN_STATUSES","WORKFLOW_DISPLAY_STATUSES","TERMINAL_WORKFLOW_RUN_STATUSES","WORKFLOW_STATUSES","Set","TERMINAL_WORKFLOW_RUN_STATUS_SET","workflowRunTriggerLabel","triggerSource","triggerEvent","filter","Boolean","join","workflowRunTriggerDisplayLabel","SHORT_COMMIT_LENGTH","PULL_REQUEST_REF_PATTERN","workflowRunBranchLabel","run","ref","triggerReference","pullRequest","exec","startsWith","slice","length","workflowRunCommitLabel","commit","workflowRunActor","actor","isWorkflowRunTerminal","status","has","isWorkflowStatus","workflowRunFirstStartedAt","jobs","earliest","earliestMs","Number","POSITIVE_INFINITY","job","startedAt","jobExecutions","startedMs","Date","getTime","isFinite","workflowRunHasStarted","jobStatuses","firstStartedAt","some","deriveWorkflowRunDisplay","progress","runStatus","finishedAt","hasStarted","duration","time","from","to","kind","workflowRunDetailDisplay","runAttempt","map","workflowRunListItemDisplay","statusCounts","count","workflowRunBlockingJob","blocking","queuedMs","queuedAt","candidateMs"],"mappings":"AAAA,SAMEA,qBAAqB,QAChB,WAAW;AAClB,SACEC,yBAAyB,QAGpB,qBAAqB;AAY5B,OAAO,MAAMC,wBAAwB;IACnC;IACA;IACA;IACA;IACA;CACD,CAAiD;AAElD,OAAO,MAAMC,4BAA4B;OACpCD;OACAF;IACH;IACA;CACD,CAAqD;AAEtD,OAAO,MAAMI,iCAAiC;IAC5C;IACA;IACA;CACD,CAAiD;AAElD,M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AAYpC,IAAI4C,UAAU,CAACR,UAAU;QACrCN,aAAa9B,IAAIiB,IAAI,CAAC4B,GAAG,CAAC,CAACvB,MAAQA,IAAIT,MAAM;QAC7CkB,gBAAgBf,0BAA0BhB,IAAIiB,IAAI;IACpD;AACF;AAEA;;;CAGC,GACD,OAAO,SAAS6B,2BAA2B9C,GAAwB;IACjE,OAAOiC,yBAAyB;QAC9BE,WAAWnC,IAAIa,MAAM;QACrBU,WAAWvB,IAAI4C,UAAU,CAACrB,SAAS;QACnCa,YAAYpC,IAAI4C,UAAU,CAACR,UAAU;QACrCN,aAAa9B,IAAIiB,IAAI,CAAC8B,YAAY,CAACtD,MAAM,CAAC,CAAC,EAACuD,KAAK,EAAC,GAAKA,QAAQ,GAAGH,GAAG,CAAC,CAAC,EAAChC,MAAM,EAAC,GAAKA;IACtF;AACF;AAEA;;;CAGC,GACD,OAAO,SAASoC,uBAAuBhC,IAAW;IAChD,IAAIiC,WAAuB;IAC3B,IAAIC,WAAW/B,OAAOC,iBAAiB;IAEvC,KAAK,MAAMC,OAAOL,KAAM;QACtB,KAAK,MAAM,EAACmC,QAAQ,EAAE7B,SAAS,EAAEa,UAAU,EAAC,IAAId,IAAIE,aAAa,CAAE;YACjE,IAAI4B,aAAa,QAAQ7B,cAAc,QAAQa,eAAe,MAAM;YACpE,MAAMiB,cAAc,IAAI3B,KAAK0B,UAAUzB,OAAO;YAC9C,IAAI,CAACP,OAAOQ,QAAQ,CAACyB,gBAAgBA,eAAeF,UAAU;YAC9DD,WAAW5B;YACX6B,WAAWE;QACb;IACF;IAEA,OAAOH;AACT"}
|
|
1
|
+
{"version":3,"sources":["../../../src/core/entities/workflow-run.ts"],"sourcesContent":["import {\n type Job,\n type JobDisplayStatus,\n type JobMode,\n type JobStatus,\n type ListenerStatus,\n WORKFLOW_JOB_STATUSES,\n} from './job.js';\nimport type {JobExecutionStatus} from './job-execution.js';\nimport type {WorkflowRunAttempt, WorkflowRunAttemptSummary} from './workflow-run-attempt.js';\n\nexport type WorkflowRunStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';\nexport type WorkflowRunRerunMode = 'all' | 'failed';\nexport type WorkflowStatus = WorkflowRunStatus | (typeof WORKFLOW_JOB_STATUSES)[number];\n/**\n * `listening` is display-only: the API never returns it, and it is derived from the listener\n * state a job already carries.\n */\nexport type WorkflowDisplayStatus = WorkflowStatus | 'listening';\n\nexport const WORKFLOW_RUN_STATUSES = [\n 'pending',\n 'running',\n 'succeeded',\n 'failed',\n 'cancelled',\n] as const satisfies readonly WorkflowRunStatus[];\n\nexport const WORKFLOW_DISPLAY_STATUSES = [\n ...WORKFLOW_RUN_STATUSES,\n ...WORKFLOW_JOB_STATUSES,\n 'listening',\n] as const satisfies readonly WorkflowDisplayStatus[];\n\nexport const TERMINAL_WORKFLOW_RUN_STATUSES = [\n 'succeeded',\n 'failed',\n 'cancelled',\n] as const satisfies readonly WorkflowRunStatus[];\n\nconst WORKFLOW_STATUSES = new Set<WorkflowStatus>([\n ...WORKFLOW_RUN_STATUSES,\n ...WORKFLOW_JOB_STATUSES,\n]);\nconst TERMINAL_WORKFLOW_RUN_STATUS_SET = new Set<WorkflowRunStatus>(TERMINAL_WORKFLOW_RUN_STATUSES);\n\nexport interface WorkflowSourceSnapshot {\n content: string;\n format: 'yaml';\n}\n\n/**\n * Provider-neutral trigger facts. Every field is nullable: only source-control triggers\n * resolve a reference at all, and a payload can name a ref without naming an actor.\n */\nexport interface WorkflowRunTriggerReference {\n repository: string | null;\n ref: string | null;\n commit: string | null;\n actor: string | null;\n}\n\n/** One glyph in a run row's job status strip: enough to draw and label it, nothing more. */\nexport interface WorkflowRunJobSummary {\n id: string;\n key: string;\n name: string | null;\n status: JobStatus;\n mode: JobMode;\n listenerStatus: ListenerStatus;\n executionStatus: JobExecutionStatus | null;\n position: number;\n}\n\nexport interface WorkflowRunJobStatusCount {\n status: JobDisplayStatus;\n count: number;\n}\n\n/**\n * A run's jobs as the list receives them: a bounded slice to draw, plus totals covering all\n * of them.\n *\n * `preview` is capped by the API, so `preview.length` is not the job count and the strip\n * reads `total` and `statusCounts` for anything it says rather than anything it draws. The API\n * also reports whether any job execution has started because a terminal `cancelled` job can have\n * started work even though its job status does not preserve that distinction.\n */\nexport interface WorkflowRunJobs {\n preview: WorkflowRunJobSummary[];\n statusCounts: WorkflowRunJobStatusCount[];\n hasStartedJobExecution: boolean;\n total: number;\n}\n\nexport interface WorkflowRun {\n id: string;\n projectId: string;\n definitionId: string;\n number: number | null;\n name: string;\n workflowName: string;\n currentAttempt: number;\n triggerProvider: string | null;\n triggerSource: string;\n triggerEvent: string;\n triggerDisplayLabel: string;\n triggerLabel: string;\n triggerPayload: Record<string, unknown>;\n triggerReference: WorkflowRunTriggerReference | null;\n inputs: Record<string, unknown> | null;\n sourceSnapshot: WorkflowSourceSnapshot | null;\n createdAt: string;\n updatedAt: string;\n isTemporary: boolean;\n}\n\n/** A run as the API returns it outside the list: no job strip, because none was fetched. */\nexport interface WorkflowRunRecord extends WorkflowRun {\n status: WorkflowRunStatus;\n latestAttempt: number;\n runAttempt: WorkflowRunAttemptSummary;\n}\n\nexport interface WorkflowRunListItem extends WorkflowRunRecord {\n jobs: WorkflowRunJobs;\n}\n\nexport interface WorkflowRunDetail extends WorkflowRun {\n latestAttempt: number;\n runAttempt: WorkflowRunAttempt;\n jobs: Job[];\n hasStartedJobExecution: boolean;\n}\n\nexport interface WorkflowRunListPage {\n runs: WorkflowRunListItem[];\n nextCursor: string | null;\n filteredTotalCount: number | null;\n}\n\nexport interface ManualWorkflowLaunch {\n workflowRunId: string;\n}\n\nexport function workflowRunTriggerLabel({\n triggerSource,\n triggerEvent,\n}: {\n triggerSource: string;\n triggerEvent: string;\n}): string {\n return [triggerSource, triggerEvent].filter(Boolean).join(' · ');\n}\n\nexport function workflowRunTriggerDisplayLabel({\n triggerSource,\n triggerEvent,\n}: {\n triggerSource: string;\n triggerEvent: string;\n}): string {\n return triggerEvent || triggerSource;\n}\n\nconst SHORT_COMMIT_LENGTH = 7;\nconst PULL_REQUEST_REF_PATTERN = /^refs\\/pull\\/(\\d+)\\/head$/u;\n\n/**\n * The ref as a person names it: `main` for a branch, `#42` for a pull request, the tag for a\n * tag. An unrecognized ref is shown verbatim rather than hidden, since a ref nobody can read\n * is still better evidence than a blank cell.\n */\nexport function workflowRunBranchLabel(run: Pick<WorkflowRun, 'triggerReference'>): string | null {\n const ref = run.triggerReference?.ref;\n if (!ref) return null;\n const pullRequest = PULL_REQUEST_REF_PATTERN.exec(ref);\n if (pullRequest) return `#${pullRequest[1]}`;\n if (ref.startsWith('refs/heads/')) return ref.slice('refs/heads/'.length);\n if (ref.startsWith('refs/tags/')) return ref.slice('refs/tags/'.length);\n return ref;\n}\n\nexport function workflowRunCommitLabel(run: Pick<WorkflowRun, 'triggerReference'>): string | null {\n const commit = run.triggerReference?.commit;\n return commit ? commit.slice(0, SHORT_COMMIT_LENGTH) : null;\n}\n\nexport function workflowRunActor(run: Pick<WorkflowRun, 'triggerReference'>): string | null {\n return run.triggerReference?.actor ?? null;\n}\n\nexport function isWorkflowRunTerminal(status: WorkflowRunStatus): boolean {\n return TERMINAL_WORKFLOW_RUN_STATUS_SET.has(status);\n}\n\nexport function isWorkflowStatus(status: string): status is WorkflowStatus {\n return WORKFLOW_STATUSES.has(status as WorkflowStatus);\n}\n"],"names":["WORKFLOW_JOB_STATUSES","WORKFLOW_RUN_STATUSES","WORKFLOW_DISPLAY_STATUSES","TERMINAL_WORKFLOW_RUN_STATUSES","WORKFLOW_STATUSES","Set","TERMINAL_WORKFLOW_RUN_STATUS_SET","workflowRunTriggerLabel","triggerSource","triggerEvent","filter","Boolean","join","workflowRunTriggerDisplayLabel","SHORT_COMMIT_LENGTH","PULL_REQUEST_REF_PATTERN","workflowRunBranchLabel","run","ref","triggerReference","pullRequest","exec","startsWith","slice","length","workflowRunCommitLabel","commit","workflowRunActor","actor","isWorkflowRunTerminal","status","has","isWorkflowStatus"],"mappings":"AAAA,SAMEA,qBAA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B,iCAAiCyB,GAAG,CAACD;AAC9C;AAEA,OAAO,SAASE,iBAAiBF,MAAc;IAC7C,OAAO1B,kBAAkB2B,GAAG,CAACD;AAC/B"}
|
|
@@ -6,8 +6,8 @@ export type { AgentConfigIssue, AgentStepConfig, Step, StepError, StepErrorCateg
|
|
|
6
6
|
export { AGENT_CONFIG_ISSUES, compareStepAttempts, resolveStepAttempt, STEP_ERROR_REASONS, } from './entities/step.js';
|
|
7
7
|
export type { EvaluationTraceEntry, EvaluationTraceLimitEntry, EvaluationTraceValueEntry, StepAttemptDetail, StepAttemptDisplayDuration, StepGateResult, } from './entities/step-attempt.js';
|
|
8
8
|
export { StepAttempt } from './entities/step-attempt.js';
|
|
9
|
-
export type { ManualWorkflowLaunch, WorkflowDisplayStatus, WorkflowRun, WorkflowRunDetail,
|
|
10
|
-
export {
|
|
9
|
+
export type { ManualWorkflowLaunch, WorkflowDisplayStatus, WorkflowRun, WorkflowRunDetail, WorkflowRunJobStatusCount, WorkflowRunJobSummary, WorkflowRunJobs, WorkflowRunListItem, WorkflowRunListPage, WorkflowRunRecord, WorkflowRunRerunMode, WorkflowRunStatus, WorkflowRunTriggerReference, WorkflowSourceSnapshot, WorkflowStatus, } from './entities/workflow-run.js';
|
|
10
|
+
export { isWorkflowRunTerminal, isWorkflowStatus, TERMINAL_WORKFLOW_RUN_STATUSES, WORKFLOW_DISPLAY_STATUSES, WORKFLOW_RUN_STATUSES, workflowRunActor, workflowRunBranchLabel, workflowRunCommitLabel, workflowRunTriggerDisplayLabel, workflowRunTriggerLabel, } from './entities/workflow-run.js';
|
|
11
11
|
export type { WorkflowRunAttemptDisplayDuration } from './entities/workflow-run-attempt.js';
|
|
12
12
|
export { WorkflowRunAttempt, WorkflowRunAttemptSummary } from './entities/workflow-run-attempt.js';
|
|
13
13
|
//# sourceMappingURL=workflow-run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../src/core/workflow-run.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,SAAS,EACT,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,GAAG,EACH,mBAAmB,EACnB,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,4BAA4B,EAC5B,YAAY,GACb,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,0BAA0B,EAC1B,cAAc,GACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../src/core/workflow-run.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,SAAS,EACT,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,sBAAsB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,oCAAoC,CAAC"}
|
|
@@ -2,7 +2,7 @@ export { defaultJobExecution, deriveJobDisplayStatus, isTerminalJobStatus, Job,
|
|
|
2
2
|
export { deriveJobExecutionDisplayStatus, elapsedTimeFromTimestamps, isTerminalJobExecutionStatus, JobExecution } from './entities/job-execution.js';
|
|
3
3
|
export { AGENT_CONFIG_ISSUES, compareStepAttempts, resolveStepAttempt, STEP_ERROR_REASONS } from './entities/step.js';
|
|
4
4
|
export { StepAttempt } from './entities/step-attempt.js';
|
|
5
|
-
export {
|
|
5
|
+
export { isWorkflowRunTerminal, isWorkflowStatus, TERMINAL_WORKFLOW_RUN_STATUSES, WORKFLOW_DISPLAY_STATUSES, WORKFLOW_RUN_STATUSES, workflowRunActor, workflowRunBranchLabel, workflowRunCommitLabel, workflowRunTriggerDisplayLabel, workflowRunTriggerLabel } from './entities/workflow-run.js';
|
|
6
6
|
export { WorkflowRunAttempt, WorkflowRunAttemptSummary } from './entities/workflow-run-attempt.js';
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=workflow-run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/workflow-run.ts"],"sourcesContent":["export type {\n JobDisplayDuration,\n JobDisplayStatus,\n JobListening,\n JobMode,\n JobStatus,\n JobStatusReason,\n ListenerStatus,\n ResolutionReason,\n} from './entities/job.js';\nexport {\n defaultJobExecution,\n deriveJobDisplayStatus,\n isTerminalJobStatus,\n Job,\n resolveJobExecution,\n TERMINAL_WORKFLOW_JOB_STATUSES,\n WORKFLOW_JOB_STATUSES,\n} from './entities/job.js';\nexport type {\n JobExecutionDisplayDuration,\n JobExecutionDisplayStatus,\n JobExecutionStatus,\n JobExecutionTime,\n WorkflowExecutionEvent,\n} from './entities/job-execution.js';\nexport {\n deriveJobExecutionDisplayStatus,\n elapsedTimeFromTimestamps,\n isTerminalJobExecutionStatus,\n JobExecution,\n} from './entities/job-execution.js';\nexport type {\n AgentConfigIssue,\n AgentStepConfig,\n Step,\n StepError,\n StepErrorCategory,\n StepErrorReason,\n StepSourceLocation,\n} from './entities/step.js';\nexport {\n AGENT_CONFIG_ISSUES,\n compareStepAttempts,\n resolveStepAttempt,\n STEP_ERROR_REASONS,\n} from './entities/step.js';\nexport type {\n EvaluationTraceEntry,\n EvaluationTraceLimitEntry,\n EvaluationTraceValueEntry,\n StepAttemptDetail,\n StepAttemptDisplayDuration,\n StepGateResult,\n} from './entities/step-attempt.js';\nexport {StepAttempt} from './entities/step-attempt.js';\nexport type {\n ManualWorkflowLaunch,\n WorkflowDisplayStatus,\n WorkflowRun,\n WorkflowRunDetail,\n
|
|
1
|
+
{"version":3,"sources":["../../src/core/workflow-run.ts"],"sourcesContent":["export type {\n JobDisplayDuration,\n JobDisplayStatus,\n JobListening,\n JobMode,\n JobStatus,\n JobStatusReason,\n ListenerStatus,\n ResolutionReason,\n} from './entities/job.js';\nexport {\n defaultJobExecution,\n deriveJobDisplayStatus,\n isTerminalJobStatus,\n Job,\n resolveJobExecution,\n TERMINAL_WORKFLOW_JOB_STATUSES,\n WORKFLOW_JOB_STATUSES,\n} from './entities/job.js';\nexport type {\n JobExecutionDisplayDuration,\n JobExecutionDisplayStatus,\n JobExecutionStatus,\n JobExecutionTime,\n WorkflowExecutionEvent,\n} from './entities/job-execution.js';\nexport {\n deriveJobExecutionDisplayStatus,\n elapsedTimeFromTimestamps,\n isTerminalJobExecutionStatus,\n JobExecution,\n} from './entities/job-execution.js';\nexport type {\n AgentConfigIssue,\n AgentStepConfig,\n Step,\n StepError,\n StepErrorCategory,\n StepErrorReason,\n StepSourceLocation,\n} from './entities/step.js';\nexport {\n AGENT_CONFIG_ISSUES,\n compareStepAttempts,\n resolveStepAttempt,\n STEP_ERROR_REASONS,\n} from './entities/step.js';\nexport type {\n EvaluationTraceEntry,\n EvaluationTraceLimitEntry,\n EvaluationTraceValueEntry,\n StepAttemptDetail,\n StepAttemptDisplayDuration,\n StepGateResult,\n} from './entities/step-attempt.js';\nexport {StepAttempt} from './entities/step-attempt.js';\nexport type {\n ManualWorkflowLaunch,\n WorkflowDisplayStatus,\n WorkflowRun,\n WorkflowRunDetail,\n WorkflowRunJobStatusCount,\n WorkflowRunJobSummary,\n WorkflowRunJobs,\n WorkflowRunListItem,\n WorkflowRunListPage,\n WorkflowRunRecord,\n WorkflowRunRerunMode,\n WorkflowRunStatus,\n WorkflowRunTriggerReference,\n WorkflowSourceSnapshot,\n WorkflowStatus,\n} from './entities/workflow-run.js';\nexport {\n isWorkflowRunTerminal,\n isWorkflowStatus,\n TERMINAL_WORKFLOW_RUN_STATUSES,\n WORKFLOW_DISPLAY_STATUSES,\n WORKFLOW_RUN_STATUSES,\n workflowRunActor,\n workflowRunBranchLabel,\n workflowRunCommitLabel,\n workflowRunTriggerDisplayLabel,\n workflowRunTriggerLabel,\n} from './entities/workflow-run.js';\nexport type {WorkflowRunAttemptDisplayDuration} from './entities/workflow-run-attempt.js';\nexport {WorkflowRunAttempt, WorkflowRunAttemptSummary} from './entities/workflow-run-attempt.js';\n"],"names":["defaultJobExecution","deriveJobDisplayStatus","isTerminalJobStatus","Job","resolveJobExecution","TERMINAL_WORKFLOW_JOB_STATUSES","WORKFLOW_JOB_STATUSES","deriveJobExecutionDisplayStatus","elapsedTimeFromTimestamps","isTerminalJobExecutionStatus","JobExecution","AGENT_CONFIG_ISSUES","compareStepAttempts","resolveStepAttempt","STEP_ERROR_REASONS","StepAttempt","isWorkflowRunTerminal","isWorkflowStatus","TERMINAL_WORKFLOW_RUN_STATUSES","WORKFLOW_DISPLAY_STATUSES","WORKFLOW_RUN_STATUSES","workflowRunActor","workflowRunBranchLabel","workflowRunCommitLabel","workflowRunTriggerDisplayLabel","workflowRunTriggerLabel","WorkflowRunAttempt","WorkflowRunAttemptSummary"],"mappings":"AAUA,SACEA,mBAAmB,EACnBC,sBAAsB,EACtBC,mBAAmB,EACnBC,GAAG,EACHC,mBAAmB,EACnBC,8BAA8B,EAC9BC,qBAAqB,QAChB,oBAAoB;AAQ3B,SACEC,+BAA+B,EAC/BC,yBAAyB,EACzBC,4BAA4B,EAC5BC,YAAY,QACP,8BAA8B;AAUrC,SACEC,mBAAmB,EACnBC,mBAAmB,EACnBC,kBAAkB,EAClBC,kBAAkB,QACb,qBAAqB;AAS5B,SAAQC,WAAW,QAAO,6BAA6B;AAkBvD,SACEC,qBAAqB,EACrBC,gBAAgB,EAChBC,8BAA8B,EAC9BC,yBAAyB,EACzBC,qBAAqB,EACrBC,gBAAgB,EAChBC,sBAAsB,EACtBC,sBAAsB,EACtBC,8BAA8B,EAC9BC,uBAAuB,QAClB,6BAA6B;AAEpC,SAAQC,kBAAkB,EAAEC,yBAAyB,QAAO,qCAAqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run-mapper.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/workflow-run-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,4BAA4B,EAC5B,cAAc,EAGd,qBAAqB,EACrB,4BAA4B,EAC5B,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,oBAAoB,EACzB,GAAG,EACH,YAAY,EAEZ,KAAK,IAAI,EACT,WAAW,EAGX,KAAK,WAAW,EAChB,kBAAkB,EAElB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EAGvB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,aAAa,CAAC,GAAG,EAAE,sBAAsB,GAAG,WAAW,CA8BtE;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,qBAAqB,GAAG,kBAAkB,CAWnF;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,sBAAsB,GAAG,iBAAiB,CAclF;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,sBAAsB,GAAG,mBA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,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,4BAA4B;IAEjE,MAAM;IACN,OAAO;IACP,cAAc;IACd,MAAM;IACN,eAAe;EAElB"}
|
|
@@ -81,6 +81,7 @@ export function toWorkflowRunListItem(dto) {
|
|
|
81
81
|
position: job.position
|
|
82
82
|
})),
|
|
83
83
|
statusCounts,
|
|
84
|
+
hasStartedJobExecution: dto.has_started_job_execution ?? true,
|
|
84
85
|
// Derived rather than sent: the counts already cover every job, and a separate total
|
|
85
86
|
// would be a second source of truth that could disagree with them.
|
|
86
87
|
total: statusCounts.reduce((sum, entry)=>sum + entry.count, 0)
|
|
@@ -102,7 +103,8 @@ export function toWorkflowRunDetail(dto) {
|
|
|
102
103
|
...toWorkflowRun(dto),
|
|
103
104
|
latestAttempt: dto.latest_attempt,
|
|
104
105
|
runAttempt: toWorkflowRunAttempt(dto.run_attempt),
|
|
105
|
-
jobs: dto.jobs.map(toJob)
|
|
106
|
+
jobs: dto.jobs.map(toJob),
|
|
107
|
+
hasStartedJobExecution: dto.has_started_job_execution ?? true
|
|
106
108
|
};
|
|
107
109
|
}
|
|
108
110
|
export function toJob(dto) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/api/workflow-run-mapper.ts"],"sourcesContent":["import type {\n EvaluationTraceDto,\n JobListeningDto,\n StepAttemptDetailResponseDto,\n StepAttemptDto,\n StepGateResultDto,\n WorkflowExecutionEventDto,\n WorkflowRunAttemptDto,\n WorkflowRunDetailResponseDto,\n WorkflowRunJobDetailDto,\n WorkflowRunJobExecutionDetailDto,\n WorkflowRunListItemDto,\n WorkflowRunListResponseDto,\n WorkflowRunResponseDto,\n WorkflowRunStepDetailDto,\n} from '@shipfox/api-workflows-dto';\nimport {\n type EvaluationTraceEntry,\n Job,\n JobExecution,\n type JobListening,\n type Step,\n StepAttempt,\n type StepGateResult,\n type WorkflowExecutionEvent,\n type WorkflowRun,\n WorkflowRunAttempt,\n WorkflowRunAttemptSummary,\n type WorkflowRunDetail,\n type WorkflowRunListItem,\n type WorkflowRunListPage,\n type WorkflowRunRecord,\n workflowRunTriggerDisplayLabel,\n workflowRunTriggerLabel,\n} from '#core/workflow-run.js';\n\nexport function toWorkflowRun(dto: WorkflowRunResponseDto): WorkflowRun {\n return {\n id: dto.id,\n projectId: dto.project_id,\n definitionId: dto.definition_id,\n number: dto.number,\n name: dto.name,\n workflowName: dto.workflow_name,\n currentAttempt: dto.current_attempt,\n triggerProvider: dto.trigger_provider,\n triggerSource: dto.trigger_source,\n triggerEvent: dto.trigger_event,\n triggerDisplayLabel: workflowRunTriggerDisplayLabel({\n triggerSource: dto.trigger_source,\n triggerEvent: dto.trigger_event,\n }),\n triggerLabel: workflowRunTriggerLabel({\n triggerSource: dto.trigger_source,\n triggerEvent: dto.trigger_event,\n }),\n triggerPayload: dto.trigger_payload,\n triggerReference: dto.trigger_reference,\n inputs: dto.inputs ?? null,\n sourceSnapshot: dto.source_snapshot\n ? {content: dto.source_snapshot.content, format: dto.source_snapshot.format}\n : null,\n createdAt: dto.created_at,\n updatedAt: dto.updated_at,\n isTemporary: dto.id.startsWith('temp-'),\n };\n}\n\nexport function toWorkflowRunAttempt(dto: WorkflowRunAttemptDto): WorkflowRunAttempt {\n return new WorkflowRunAttempt({\n id: dto.id,\n workflowRunId: dto.workflow_run_id,\n attempt: dto.attempt,\n status: dto.status,\n createdAt: dto.created_at,\n startedAt: dto.started_at ?? null,\n finishedAt: dto.finished_at ?? null,\n rerunMode: dto.rerun_mode,\n });\n}\n\nexport function toWorkflowRunRecord(dto: WorkflowRunResponseDto): WorkflowRunRecord {\n return {\n ...toWorkflowRun(dto),\n status: dto.status,\n latestAttempt: dto.latest_attempt,\n runAttempt: new WorkflowRunAttemptSummary({\n workflowRunId: dto.id,\n attempt: dto.current_attempt,\n status: dto.status,\n createdAt: dto.created_at,\n startedAt: dto.started_at ?? null,\n finishedAt: dto.finished_at ?? null,\n }),\n };\n}\n\nexport function toWorkflowRunListItem(dto: WorkflowRunListItemDto): WorkflowRunListItem {\n const hasDisplayStatusCounts = dto.job_display_status_counts !== undefined;\n const statusCounts = (dto.job_display_status_counts ?? dto.job_status_counts).map(\n ({status, count}) => ({status, count}),\n );\n return {\n ...toWorkflowRunRecord(dto),\n jobs: {\n preview: dto.jobs.map((job) => ({\n id: job.id,\n key: job.key,\n name: job.name,\n status: job.status,\n mode: job.mode ?? 'one_shot',\n listenerStatus: job.listener_status ?? 'inactive',\n // The optional display-count field is the rollout capability signal. Pre-display API\n // responses only carry raw verdict counts, so mirror their non-terminal verdict into\n // execution evidence to keep each legacy glyph aligned with those fallback counts.\n executionStatus: hasDisplayStatusCounts\n ? (job.execution_status ?? null)\n : legacyExecutionStatus(job.status),\n position: job.position,\n })),\n statusCounts,\n // Derived rather than sent: the counts already cover every job, and a separate total\n // would be a second source of truth that could disagree with them.\n total: statusCounts.reduce((sum, entry) => sum + entry.count, 0),\n },\n };\n}\n\nfunction legacyExecutionStatus(\n status: WorkflowRunListItemDto['jobs'][number]['status'],\n): 'pending' | 'running' | null {\n return status === 'pending' || status === 'running' ? status : null;\n}\n\nexport function toWorkflowRunListPage(dto: WorkflowRunListResponseDto): WorkflowRunListPage {\n return {\n runs: dto.runs.map(toWorkflowRunListItem),\n nextCursor: dto.next_cursor,\n filteredTotalCount: dto.filtered_total_count,\n };\n}\n\nexport function toWorkflowRunDetail(dto: WorkflowRunDetailResponseDto): WorkflowRunDetail {\n return {\n ...toWorkflowRun(dto),\n latestAttempt: dto.latest_attempt,\n runAttempt: toWorkflowRunAttempt(dto.run_attempt),\n jobs: dto.jobs.map(toJob),\n };\n}\n\nexport function toJob(dto: WorkflowRunJobDetailDto): Job {\n return new Job({\n id: dto.id,\n runAttemptId: dto.run_attempt_id,\n key: dto.key,\n name: dto.name,\n mode: dto.mode,\n status: dto.status,\n statusReason: dto.status_reason,\n carriedOver: dto.carried_over,\n outputs: dto.outputs ?? null,\n success: dto.success ?? null,\n runner: dto.runner ?? null,\n evaluationTrace: toEvaluationTrace(dto.evaluation_trace),\n listening: dto.listening ? toJobListening(dto.listening) : null,\n listenerStatus: dto.listener_status,\n resolutionReason: dto.resolution_reason,\n dependencies: dto.dependencies,\n position: dto.position,\n createdAt: dto.created_at,\n updatedAt: dto.updated_at,\n jobExecutions: dto.job_executions.map(toJobExecution),\n });\n}\n\nexport function toJobExecution(dto: WorkflowRunJobExecutionDetailDto): JobExecution {\n return new JobExecution({\n id: dto.id,\n jobId: dto.job_id,\n sequence: dto.sequence,\n name: dto.name,\n status: dto.status,\n statusReason: dto.status_reason,\n statusReasonMessage: dto.status_reason_message ?? null,\n runner: dto.runner ?? null,\n outputs: dto.outputs ?? null,\n triggerEvents: (dto.trigger_events ?? []).map(toWorkflowExecutionEvent),\n queuedAt: dto.queued_at ?? null,\n startedAt: dto.started_at ?? null,\n finishedAt: dto.finished_at ?? null,\n timedOutAt: dto.timed_out_at ?? null,\n evaluationTrace: toEvaluationTrace(dto.evaluation_trace),\n createdAt: dto.created_at,\n updatedAt: dto.updated_at,\n steps: dto.steps.map(toStep),\n });\n}\n\nexport function toStep(dto: WorkflowRunStepDetailDto): Step {\n return {\n id: dto.id,\n jobExecutionId: dto.job_execution_id,\n key: dto.key,\n name: dto.name,\n sourceLocation: dto.source_location\n ? {startLine: dto.source_location.start_line, endLine: dto.source_location.end_line}\n : null,\n status: dto.status,\n statusReason: dto.status_reason,\n type: dto.type,\n config: dto.config,\n evaluationTrace: toEvaluationTrace(dto.evaluation_trace),\n agentConfig: toAgentStepConfig(dto),\n error: dto.error\n ? {\n message: dto.error.message,\n exitCode: dto.error.exit_code ?? null,\n signal: dto.error.signal,\n reason: dto.error.reason,\n agentConfigIssue: dto.error.agent_config_issue,\n category: dto.error.category,\n }\n : null,\n position: dto.position,\n currentAttempt: dto.current_attempt,\n createdAt: dto.created_at,\n updatedAt: dto.updated_at,\n attempts: dto.attempts.map((attempt) => toStepAttempt(attempt, dto.job_execution_id)),\n };\n}\n\nexport function toStepAttempt(dto: StepAttemptDto, jobExecutionId: string): StepAttempt {\n return new StepAttempt({\n id: dto.id,\n stepId: dto.step_id,\n jobExecutionId,\n attempt: dto.attempt,\n executionOrder: dto.execution_order,\n status: dto.status,\n exitCode: dto.exit_code ?? null,\n output: dto.output ?? null,\n outputs: dto.outputs ?? dto.output ?? null,\n response: dto.response ?? null,\n error: dto.error ?? null,\n gateResult: toStepGateResult(dto.gate_result),\n restartFeedback: dto.restart_feedback ?? null,\n startedAt: dto.started_at,\n finishedAt: dto.finished_at ?? null,\n });\n}\n\nexport function toStepAttemptDetail(dto: StepAttemptDetailResponseDto) {\n return {\n stepId: dto.step_id,\n attempt: dto.attempt,\n authoredConfig: dto.authored_config,\n config: dto.config,\n evaluationTrace: toEvaluationTrace(dto.evaluation_trace),\n };\n}\n\nfunction toJobListening(dto: JobListeningDto): JobListening {\n return {\n on: dto.on,\n until: dto.until,\n timeoutMs: dto.timeout_ms,\n maxExecutions: dto.max_executions,\n batch: dto.batch\n ? {\n debounceMs: dto.batch.debounce_ms,\n maxSize: dto.batch.max_size,\n maxWaitMs: dto.batch.max_wait_ms,\n }\n : null,\n onResolve: dto.on_resolve,\n executionTimeoutMs: dto.execution_timeout_ms,\n name: dto.name,\n };\n}\n\nfunction toWorkflowExecutionEvent(dto: WorkflowExecutionEventDto): WorkflowExecutionEvent {\n return {\n source: dto.source,\n event: dto.event,\n deliveryId: dto.delivery_id,\n receivedAt: dto.received_at,\n project: dto.project,\n repository: dto.repository,\n ref: dto.ref,\n commit: dto.commit,\n data: dto.data,\n };\n}\n\nfunction toStepGateResult(dto: StepGateResultDto): StepGateResult {\n if (dto === null || dto.kind === 'none' || dto.kind === 'not_evaluated') return dto;\n if (dto.kind === 'passed' || dto.kind === 'failed') return {...dto, exitCode: dto.exit_code};\n if (dto.kind === 'uncheckable' || dto.kind === 'evaluation_error')\n return {...dto, exitCode: dto.exit_code};\n return dto;\n}\n\nfunction toEvaluationTrace(trace: EvaluationTraceDto | null): EvaluationTraceEntry[] | null {\n return (\n trace?.map((entry) =>\n 'dropped' in entry\n ? entry\n : {\n expression: entry.expression,\n roots: entry.roots,\n fillTarget: entry.fill_target,\n evaluatedAt: entry.evaluated_at,\n field: entry.field,\n ...(entry.value === undefined ? {} : {value: entry.value}),\n ...(entry.truncated === undefined ? {} : {truncated: entry.truncated}),\n ...(entry.expr_truncated === undefined ? {} : {exprTruncated: entry.expr_truncated}),\n ...(entry.reference === undefined ? {} : {reference: entry.reference}),\n ...(entry.degraded === undefined ? {} : {degraded: entry.degraded}),\n ...(entry.env_key === undefined ? {} : {envKey: entry.env_key}),\n },\n ) ?? null\n );\n}\n\nfunction toAgentStepConfig(dto: WorkflowRunStepDetailDto): Step['agentConfig'] {\n if (dto.type !== 'agent') return null;\n return {\n provider: stringConfigValue(dto.config.provider),\n model: stringConfigValue(dto.config.model),\n thinking: stringConfigValue(dto.config.thinking),\n };\n}\n\nfunction stringConfigValue(value: unknown): string | null {\n return typeof value === 'string' && value.trim() ? value.trim() : null;\n}\n"],"names":["Job","JobExecution","StepAttempt","WorkflowRunAttempt","WorkflowRunAttemptSummary","workflowRunTriggerDisplayLabel","workflowRunTriggerLabel","toWorkflowRun","dto","id","projectId","project_id","definitionId","definition_id","number","name","workflowName","workflow_name","currentAttempt","current_attempt","triggerProvider","trigger_provider","triggerSource","trigger_source","triggerEvent","trigger_event","triggerDisplayLabel","triggerLabel","triggerPayload","trigger_payload","triggerReference","trigger_reference","inputs","sourceSnapshot","source_snapshot","content","format","createdAt","created_at","updatedAt","updated_at","isTemporary","startsWith","toWorkflowRunAttempt","workflowRunId","workflow_run_id","attempt","status","startedAt","started_at","finishedAt","finished_at","rerunMode","rerun_mode","toWorkflowRunRecord","latestAttempt","latest_attempt","runAttempt","toWorkflowRunListItem","hasDisplayStatusCounts","job_display_status_counts","undefined","statusCounts","job_status_counts","map","count","jobs","preview","job","key","mode","listenerStatus","listener_status","executionStatus","execution_status","legacyExecutionStatus","position","total","reduce","sum","entry","toWorkflowRunListPage","runs","nextCursor","next_cursor","filteredTotalCount","filtered_total_count","toWorkflowRunDetail","run_attempt","toJob","runAttemptId","run_attempt_id","statusReason","status_reason","carriedOver","carried_over","outputs","success","runner","evaluationTrace","toEvaluationTrace","evaluation_trace","listening","toJobListening","resolutionReason","resolution_reason","dependencies","jobExecutions","job_executions","toJobExecution","jobId","job_id","sequence","statusReasonMessage","status_reason_message","triggerEvents","trigger_events","toWorkflowExecutionEvent","queuedAt","queued_at","timedOutAt","timed_out_at","steps","toStep","jobExecutionId","job_execution_id","sourceLocation","source_location","startLine","start_line","endLine","end_line","type","config","agentConfig","toAgentStepConfig","error","message","exitCode","exit_code","signal","reason","agentConfigIssue","agent_config_issue","category","attempts","toStepAttempt","stepId","step_id","executionOrder","execution_order","output","response","gateResult","toStepGateResult","gate_result","restartFeedback","restart_feedback","toStepAttemptDetail","authoredConfig","authored_config","on","until","timeoutMs","timeout_ms","maxExecutions","max_executions","batch","debounceMs","debounce_ms","maxSize","max_size","maxWaitMs","max_wait_ms","onResolve","on_resolve","executionTimeoutMs","execution_timeout_ms","source","event","deliveryId","delivery_id","receivedAt","received_at","project","repository","ref","commit","data","kind","trace","expression","roots","fillTarget","fill_target","evaluatedAt","evaluated_at","field","value","truncated","expr_truncated","exprTruncated","reference","degraded","env_key","envKey","provider","stringConfigValue","model","thinking","trim"],"mappings":"AAgBA,SAEEA,GAAG,EACHC,YAAY,EAGZC,WAAW,EAIXC,kBAAkB,EAClBC,yBAAyB,EAKzBC,8BAA8B,EAC9BC,uBAAuB,QAClB,wBAAwB;AAE/B,OAAO,SAASC,cAAcC,GAA2B;IACvD,OAAO;QACLC,IAAID,IAAIC,EAAE;QACVC,WAAWF,IAAIG,UAAU;QACzBC,cAAcJ,IAAIK,aAAa;QAC/BC,QAAQN,IAAIM,MAAM;QAClBC,MAAMP,IAAIO,IAAI;QACdC,cAAcR,IAAIS,aAAa;QAC/BC,gBAAgBV,IAAIW,eAAe;QACnCC,iBAAiBZ,IAAIa,gBAAg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AAMgH,KAAK;YAClBC,YAAYjH,MAAMkH,WAAW;YAC7BC,aAAanH,MAAMoH,YAAY;YAC/BC,OAAOrH,MAAMqH,KAAK;YAClB,GAAIrH,MAAMsH,KAAK,KAAKzI,YAAY,CAAC,IAAI;gBAACyI,OAAOtH,MAAMsH,KAAK;YAAA,CAAC;YACzD,GAAItH,MAAMuH,SAAS,KAAK1I,YAAY,CAAC,IAAI;gBAAC0I,WAAWvH,MAAMuH,SAAS;YAAA,CAAC;YACrE,GAAIvH,MAAMwH,cAAc,KAAK3I,YAAY,CAAC,IAAI;gBAAC4I,eAAezH,MAAMwH,cAAc;YAAA,CAAC;YACnF,GAAIxH,MAAM0H,SAAS,KAAK7I,YAAY,CAAC,IAAI;gBAAC6I,WAAW1H,MAAM0H,SAAS;YAAA,CAAC;YACrE,GAAI1H,MAAM2H,QAAQ,KAAK9I,YAAY,CAAC,IAAI;gBAAC8I,UAAU3H,MAAM2H,QAAQ;YAAA,CAAC;YAClE,GAAI3H,MAAM4H,OAAO,KAAK/I,YAAY,CAAC,IAAI;gBAACgJ,QAAQ7H,MAAM4H,OAAO;YAAA,CAAC;QAChE,MACD;AAET;AAEA,SAASrE,kBAAkB/H,GAA6B;IACtD,IAAIA,IAAI4H,IAAI,KAAK,SAAS,OAAO;IACjC,OAAO;QACL0E,UAAUC,kBAAkBvM,IAAI6H,MAAM,CAACyE,QAAQ;QAC/CE,OAAOD,kBAAkBvM,IAAI6H,MAAM,CAAC2E,KAAK;QACzCC,UAAUF,kBAAkBvM,IAAI6H,MAAM,CAAC4E,QAAQ;IACjD;AACF;AAEA,SAASF,kBAAkBT,KAAc;IACvC,OAAO,OAAOA,UAAU,YAAYA,MAAMY,IAAI,KAAKZ,MAAMY,IAAI,KAAK;AACpE"}
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/workflow-run-mapper.ts"],"sourcesContent":["import type {\n EvaluationTraceDto,\n JobListeningDto,\n StepAttemptDetailResponseDto,\n StepAttemptDto,\n StepGateResultDto,\n WorkflowExecutionEventDto,\n WorkflowRunAttemptDto,\n WorkflowRunDetailResponseDto,\n WorkflowRunJobDetailDto,\n WorkflowRunJobExecutionDetailDto,\n WorkflowRunListItemDto,\n WorkflowRunListResponseDto,\n WorkflowRunResponseDto,\n WorkflowRunStepDetailDto,\n} from '@shipfox/api-workflows-dto';\nimport {\n type EvaluationTraceEntry,\n Job,\n JobExecution,\n type JobListening,\n type Step,\n StepAttempt,\n type StepGateResult,\n type WorkflowExecutionEvent,\n type WorkflowRun,\n WorkflowRunAttempt,\n WorkflowRunAttemptSummary,\n type WorkflowRunDetail,\n type WorkflowRunListItem,\n type WorkflowRunListPage,\n type WorkflowRunRecord,\n workflowRunTriggerDisplayLabel,\n workflowRunTriggerLabel,\n} from '#core/workflow-run.js';\n\nexport function toWorkflowRun(dto: WorkflowRunResponseDto): WorkflowRun {\n return {\n id: dto.id,\n projectId: dto.project_id,\n definitionId: dto.definition_id,\n number: dto.number,\n name: dto.name,\n workflowName: dto.workflow_name,\n currentAttempt: dto.current_attempt,\n triggerProvider: dto.trigger_provider,\n triggerSource: dto.trigger_source,\n triggerEvent: dto.trigger_event,\n triggerDisplayLabel: workflowRunTriggerDisplayLabel({\n triggerSource: dto.trigger_source,\n triggerEvent: dto.trigger_event,\n }),\n triggerLabel: workflowRunTriggerLabel({\n triggerSource: dto.trigger_source,\n triggerEvent: dto.trigger_event,\n }),\n triggerPayload: dto.trigger_payload,\n triggerReference: dto.trigger_reference,\n inputs: dto.inputs ?? null,\n sourceSnapshot: dto.source_snapshot\n ? {content: dto.source_snapshot.content, format: dto.source_snapshot.format}\n : null,\n createdAt: dto.created_at,\n updatedAt: dto.updated_at,\n isTemporary: dto.id.startsWith('temp-'),\n };\n}\n\nexport function toWorkflowRunAttempt(dto: WorkflowRunAttemptDto): WorkflowRunAttempt {\n return new WorkflowRunAttempt({\n id: dto.id,\n workflowRunId: dto.workflow_run_id,\n attempt: dto.attempt,\n status: dto.status,\n createdAt: dto.created_at,\n startedAt: dto.started_at ?? null,\n finishedAt: dto.finished_at ?? null,\n rerunMode: dto.rerun_mode,\n });\n}\n\nexport function toWorkflowRunRecord(dto: WorkflowRunResponseDto): WorkflowRunRecord {\n return {\n ...toWorkflowRun(dto),\n status: dto.status,\n latestAttempt: dto.latest_attempt,\n runAttempt: new WorkflowRunAttemptSummary({\n workflowRunId: dto.id,\n attempt: dto.current_attempt,\n status: dto.status,\n createdAt: dto.created_at,\n startedAt: dto.started_at ?? null,\n finishedAt: dto.finished_at ?? null,\n }),\n };\n}\n\nexport function toWorkflowRunListItem(dto: WorkflowRunListItemDto): WorkflowRunListItem {\n const hasDisplayStatusCounts = dto.job_display_status_counts !== undefined;\n const statusCounts = (dto.job_display_status_counts ?? dto.job_status_counts).map(\n ({status, count}) => ({status, count}),\n );\n return {\n ...toWorkflowRunRecord(dto),\n jobs: {\n preview: dto.jobs.map((job) => ({\n id: job.id,\n key: job.key,\n name: job.name,\n status: job.status,\n mode: job.mode ?? 'one_shot',\n listenerStatus: job.listener_status ?? 'inactive',\n // The optional display-count field is the rollout capability signal. Pre-display API\n // responses only carry raw verdict counts, so mirror their non-terminal verdict into\n // execution evidence to keep each legacy glyph aligned with those fallback counts.\n executionStatus: hasDisplayStatusCounts\n ? (job.execution_status ?? null)\n : legacyExecutionStatus(job.status),\n position: job.position,\n })),\n statusCounts,\n hasStartedJobExecution: dto.has_started_job_execution ?? true,\n // Derived rather than sent: the counts already cover every job, and a separate total\n // would be a second source of truth that could disagree with them.\n total: statusCounts.reduce((sum, entry) => sum + entry.count, 0),\n },\n };\n}\n\nfunction legacyExecutionStatus(\n status: WorkflowRunListItemDto['jobs'][number]['status'],\n): 'pending' | 'running' | null {\n return status === 'pending' || status === 'running' ? status : null;\n}\n\nexport function toWorkflowRunListPage(dto: WorkflowRunListResponseDto): WorkflowRunListPage {\n return {\n runs: dto.runs.map(toWorkflowRunListItem),\n nextCursor: dto.next_cursor,\n filteredTotalCount: dto.filtered_total_count,\n };\n}\n\nexport function toWorkflowRunDetail(dto: WorkflowRunDetailResponseDto): WorkflowRunDetail {\n return {\n ...toWorkflowRun(dto),\n latestAttempt: dto.latest_attempt,\n runAttempt: toWorkflowRunAttempt(dto.run_attempt),\n jobs: dto.jobs.map(toJob),\n hasStartedJobExecution: dto.has_started_job_execution ?? true,\n };\n}\n\nexport function toJob(dto: WorkflowRunJobDetailDto): Job {\n return new Job({\n id: dto.id,\n runAttemptId: dto.run_attempt_id,\n key: dto.key,\n name: dto.name,\n mode: dto.mode,\n status: dto.status,\n statusReason: dto.status_reason,\n carriedOver: dto.carried_over,\n outputs: dto.outputs ?? null,\n success: dto.success ?? null,\n runner: dto.runner ?? null,\n evaluationTrace: toEvaluationTrace(dto.evaluation_trace),\n listening: dto.listening ? toJobListening(dto.listening) : null,\n listenerStatus: dto.listener_status,\n resolutionReason: dto.resolution_reason,\n dependencies: dto.dependencies,\n position: dto.position,\n createdAt: dto.created_at,\n updatedAt: dto.updated_at,\n jobExecutions: dto.job_executions.map(toJobExecution),\n });\n}\n\nexport function toJobExecution(dto: WorkflowRunJobExecutionDetailDto): JobExecution {\n return new JobExecution({\n id: dto.id,\n jobId: dto.job_id,\n sequence: dto.sequence,\n name: dto.name,\n status: dto.status,\n statusReason: dto.status_reason,\n statusReasonMessage: dto.status_reason_message ?? null,\n runner: dto.runner ?? null,\n outputs: dto.outputs ?? null,\n triggerEvents: (dto.trigger_events ?? []).map(toWorkflowExecutionEvent),\n queuedAt: dto.queued_at ?? null,\n startedAt: dto.started_at ?? null,\n finishedAt: dto.finished_at ?? null,\n timedOutAt: dto.timed_out_at ?? null,\n evaluationTrace: toEvaluationTrace(dto.evaluation_trace),\n createdAt: dto.created_at,\n updatedAt: dto.updated_at,\n steps: dto.steps.map(toStep),\n });\n}\n\nexport function toStep(dto: WorkflowRunStepDetailDto): Step {\n return {\n id: dto.id,\n jobExecutionId: dto.job_execution_id,\n key: dto.key,\n name: dto.name,\n sourceLocation: dto.source_location\n ? {startLine: dto.source_location.start_line, endLine: dto.source_location.end_line}\n : null,\n status: dto.status,\n statusReason: dto.status_reason,\n type: dto.type,\n config: dto.config,\n evaluationTrace: toEvaluationTrace(dto.evaluation_trace),\n agentConfig: toAgentStepConfig(dto),\n error: dto.error\n ? {\n message: dto.error.message,\n exitCode: dto.error.exit_code ?? null,\n signal: dto.error.signal,\n reason: dto.error.reason,\n agentConfigIssue: dto.error.agent_config_issue,\n category: dto.error.category,\n }\n : null,\n position: dto.position,\n currentAttempt: dto.current_attempt,\n createdAt: dto.created_at,\n updatedAt: dto.updated_at,\n attempts: dto.attempts.map((attempt) => toStepAttempt(attempt, dto.job_execution_id)),\n };\n}\n\nexport function toStepAttempt(dto: StepAttemptDto, jobExecutionId: string): StepAttempt {\n return new StepAttempt({\n id: dto.id,\n stepId: dto.step_id,\n jobExecutionId,\n attempt: dto.attempt,\n executionOrder: dto.execution_order,\n status: dto.status,\n exitCode: dto.exit_code ?? null,\n output: dto.output ?? null,\n outputs: dto.outputs ?? dto.output ?? null,\n response: dto.response ?? null,\n error: dto.error ?? null,\n gateResult: toStepGateResult(dto.gate_result),\n restartFeedback: dto.restart_feedback ?? null,\n startedAt: dto.started_at,\n finishedAt: dto.finished_at ?? null,\n });\n}\n\nexport function toStepAttemptDetail(dto: StepAttemptDetailResponseDto) {\n return {\n stepId: dto.step_id,\n attempt: dto.attempt,\n authoredConfig: dto.authored_config,\n config: dto.config,\n evaluationTrace: toEvaluationTrace(dto.evaluation_trace),\n };\n}\n\nfunction toJobListening(dto: JobListeningDto): JobListening {\n return {\n on: dto.on,\n until: dto.until,\n timeoutMs: dto.timeout_ms,\n maxExecutions: dto.max_executions,\n batch: dto.batch\n ? {\n debounceMs: dto.batch.debounce_ms,\n maxSize: dto.batch.max_size,\n maxWaitMs: dto.batch.max_wait_ms,\n }\n : null,\n onResolve: dto.on_resolve,\n executionTimeoutMs: dto.execution_timeout_ms,\n name: dto.name,\n };\n}\n\nfunction toWorkflowExecutionEvent(dto: WorkflowExecutionEventDto): WorkflowExecutionEvent {\n return {\n source: dto.source,\n event: dto.event,\n deliveryId: dto.delivery_id,\n receivedAt: dto.received_at,\n project: dto.project,\n repository: dto.repository,\n ref: dto.ref,\n commit: dto.commit,\n data: dto.data,\n };\n}\n\nfunction toStepGateResult(dto: StepGateResultDto): StepGateResult {\n if (dto === null || dto.kind === 'none' || dto.kind === 'not_evaluated') return dto;\n if (dto.kind === 'passed' || dto.kind === 'failed') return {...dto, exitCode: dto.exit_code};\n if (dto.kind === 'uncheckable' || dto.kind === 'evaluation_error')\n return {...dto, exitCode: dto.exit_code};\n return dto;\n}\n\nfunction toEvaluationTrace(trace: EvaluationTraceDto | null): EvaluationTraceEntry[] | null {\n return (\n trace?.map((entry) =>\n 'dropped' in entry\n ? entry\n : {\n expression: entry.expression,\n roots: entry.roots,\n fillTarget: entry.fill_target,\n evaluatedAt: entry.evaluated_at,\n field: entry.field,\n ...(entry.value === undefined ? {} : {value: entry.value}),\n ...(entry.truncated === undefined ? {} : {truncated: entry.truncated}),\n ...(entry.expr_truncated === undefined ? {} : {exprTruncated: entry.expr_truncated}),\n ...(entry.reference === undefined ? {} : {reference: entry.reference}),\n ...(entry.degraded === undefined ? {} : {degraded: entry.degraded}),\n ...(entry.env_key === undefined ? {} : {envKey: entry.env_key}),\n },\n ) ?? null\n );\n}\n\nfunction toAgentStepConfig(dto: WorkflowRunStepDetailDto): Step['agentConfig'] {\n if (dto.type !== 'agent') return null;\n return {\n provider: stringConfigValue(dto.config.provider),\n model: stringConfigValue(dto.config.model),\n thinking: stringConfigValue(dto.config.thinking),\n };\n}\n\nfunction stringConfigValue(value: unknown): string | null {\n return typeof value === 'string' && value.trim() ? value.trim() : null;\n}\n"],"names":["Job","JobExecution","StepAttempt","WorkflowRunAttempt","WorkflowRunAttemptSummary","workflowRunTriggerDisplayLabel","workflowRunTriggerLabel","toWorkflowRun","dto","id","projectId","project_id","definitionId","definition_id","number","name","workflowName","workflow_name","currentAttempt","current_attempt","triggerProvider","trigger_provider","triggerSource","trigger_source","triggerEvent","trigger_event","triggerDisplayLabel","triggerLabel","triggerPayload","trigger_payload","triggerReference","trigger_reference","inputs","sourceSnapshot","source_snapshot","content","format","createdAt","created_at","updatedAt","updated_at","isTemporary","startsWith","toWorkflowRunAttempt","workflowRunId","workflow_run_id","attempt","status","startedAt","started_at","finishedAt","finished_at","rerunMode","rerun_mode","toWorkflowRunRecord","latestAttempt","latest_attempt","runAttempt","toWorkflowRunListItem","hasDisplayStatusCounts","job_display_status_counts","undefined","statusCounts","job_status_counts","map","count","jobs","preview","job","key","mode","listenerStatus","listener_status","executionStatus","execution_status","legacyExecutionStatus","position","hasStartedJobExecution","has_started_job_execution","total","reduce","sum","entry","toWorkflowRunListPage","runs","nextCursor","next_cursor","filteredTotalCount","filtered_total_count","toWorkflowRunDetail","run_attempt","toJob","runAttemptId","run_attempt_id","statusReason","status_reason","carriedOver","carried_over","outputs","success","runner","evaluationTrace","toEvaluationTrace","evaluation_trace","listening","toJobListening","resolutionReason","resolution_reason","dependencies","jobExecutions","job_executions","toJobExecution","jobId","job_id","sequence","statusReasonMessage","status_reason_message","triggerEvents","trigger_events","toWorkflowExecutionEvent","queuedAt","queued_at","timedOutAt","timed_out_at","steps","toStep","jobExecutionId","job_execution_id","sourceLocation","source_location","startLine","start_line","endLine","end_line","type","config","agentConfig","toAgentStepConfig","error","message","exitCode","exit_code","signal","reason","agentConfigIssue","agent_config_issue","category","attempts","toStepAttempt","stepId","step_id","executionOrder","execution_order","output","response","gateResult","toStepGateResult","gate_result","restartFeedback","restart_feedback","toStepAttemptDetail","authoredConfig","authored_config","on","until","timeoutMs","timeout_ms","maxExecutions","max_executions","batch","debounceMs","debounce_ms","maxSize","max_size","maxWaitMs","max_wait_ms","onResolve","on_resolve","executionTimeoutMs","execution_timeout_ms","source","event","deliveryId","delivery_id","receivedAt","received_at","project","repository","ref","commit","data","kind","trace","expression","roots","fillTarget","fill_target","evaluatedAt","evaluated_at","field","value","truncated","expr_truncated","exprTruncated","reference","degraded","env_key","envKey","provider","stringConfigValue","model","thinking","trim"],"mappings":"AAgBA,SAEEA,GAAG,EACHC,YAAY,EAGZC,WAAW,EAIXC,kBAAkB,EAClBC,yBAAyB,EAKzBC,8BAA8B,EAC9BC,uBAAuB,QAClB,wBAAwB;AAE/B,OAAO,SAASC,cAAcC,GAA2B;IACvD,OAAO;QACLC,IAAID,IAAIC,EAAE;QACVC,WAAWF,IAAIG,UAAU;QACzBC,cAAcJ,IAAIK,aAAa;QAC/BC,QAAQN,IAAIM,MAAM;QAClBC,MAAMP,IAAIO,IAAI;QACdC,cAAcR,IAAIS,aAAa;QAC/BC,gBAAgBV,IAAIW,eAAe;QACnCC,iBAAiBZ,IAAIa,gBAAgB;QACrCC,eAAed,IAAIe,cAAc;QACjCC,cAAchB,IAAIiB,aAAa;QAC/BC,qBAAqBrB,+BAA+B;YAClDiB,eAAed,IAAIe,cAAc;YACjCC,cAAchB,IAAIiB,aAAa;QACjC;QACAE,cAAcrB,wBAAwB;YACpCgB,eAAed,IAAIe,cAAc;YACjCC,cAAchB,IAAIiB,aAAa;QACjC;QACAG,gBAAgBpB,IAAIqB,eAAe;QACnCC,kBAAkBtB,IAAIuB,iBAAiB;QACvCC,QAAQxB,IAAIwB,MAAM,IAAI;QACtBC,gBAAgBzB,IAAI0B,eAAe,GAC/B;YAACC,SAAS3B,IAAI0B,eAAe,CAACC,OAAO;YAAEC,QAAQ5B,IAAI0B,eAAe,CAACE,MAAM;QAAA,IACzE;QACJC,WAAW7B,IAAI8B,UAAU;QACzBC,WAAW/B,IAAIgC,UAAU;QACzBC,aAAajC,IAAIC,EAAE,CAACiC,UAAU,CAAC;IACjC;AACF;AAEA,OAAO,SAASC,qBAAqBnC,GAA0B;IAC7D,OAAO,IAAIL,mBAAmB;QAC5BM,IAAID,IAAIC,EAAE;QACVmC,eAAepC,IAAIqC,eAAe;QAClCC,SAAStC,IAAIsC,OAAO;QACpBC,QAAQvC,IAAIuC,MAAM;QAClBV,W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