@shipfox/client-workflows 16.0.0 → 17.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/.turbo/turbo-type.log +1 -0
- package/CHANGELOG.md +20 -0
- package/dist/components/identifier/identifier.js +2 -2
- package/dist/components/identifier/identifier.js.map +1 -1
- package/dist/components/job-detail/agent-config-failure-callout.d.ts.map +1 -1
- package/dist/components/job-detail/agent-config-failure-callout.js +1 -1
- package/dist/components/job-detail/agent-config-failure-callout.js.map +1 -1
- package/dist/components/job-detail/job-context-panel.d.ts +6 -0
- package/dist/components/job-detail/job-context-panel.d.ts.map +1 -0
- package/dist/components/job-detail/job-context-panel.js +224 -0
- package/dist/components/job-detail/job-context-panel.js.map +1 -0
- package/dist/components/job-detail/job-detail-header.d.ts +3 -1
- package/dist/components/job-detail/job-detail-header.d.ts.map +1 -1
- package/dist/components/job-detail/job-detail-header.js +54 -48
- package/dist/components/job-detail/job-detail-header.js.map +1 -1
- package/dist/components/job-detail/job-detail-view.d.ts +1 -1
- package/dist/components/job-detail/job-detail-view.d.ts.map +1 -1
- package/dist/components/job-detail/job-detail-view.js +80 -44
- package/dist/components/job-detail/job-detail-view.js.map +1 -1
- package/dist/components/job-detail/job-empty-states.d.ts.map +1 -1
- package/dist/components/job-detail/job-empty-states.js +19 -10
- package/dist/components/job-detail/job-empty-states.js.map +1 -1
- package/dist/components/job-detail/job-execution-switcher.js +4 -4
- package/dist/components/job-detail/job-execution-switcher.js.map +1 -1
- package/dist/components/job-detail/json-code.d.ts +14 -0
- package/dist/components/job-detail/json-code.d.ts.map +1 -0
- package/dist/components/job-detail/json-code.js +93 -0
- package/dist/components/job-detail/json-code.js.map +1 -0
- package/dist/components/job-detail/step-attempt-log-panel.d.ts.map +1 -1
- package/dist/components/job-detail/step-attempt-log-panel.js +9 -6
- package/dist/components/job-detail/step-attempt-log-panel.js.map +1 -1
- package/dist/components/job-detail/step-troubleshooting.d.ts +18 -0
- package/dist/components/job-detail/step-troubleshooting.d.ts.map +1 -0
- package/dist/components/job-detail/step-troubleshooting.js +493 -0
- package/dist/components/job-detail/step-troubleshooting.js.map +1 -0
- package/dist/components/job-graph/job-graph-content.d.ts.map +1 -1
- package/dist/components/job-graph/job-graph-content.js +5 -4
- package/dist/components/job-graph/job-graph-content.js.map +1 -1
- package/dist/components/job-graph/job-node.js +3 -3
- package/dist/components/job-graph/job-node.js.map +1 -1
- package/dist/components/step-list/index.d.ts +1 -0
- package/dist/components/step-list/index.d.ts.map +1 -1
- package/dist/components/step-list/index.js.map +1 -1
- package/dist/components/step-list/step-list-model.d.ts.map +1 -1
- package/dist/components/step-list/step-list-model.js +5 -0
- package/dist/components/step-list/step-list-model.js.map +1 -1
- package/dist/components/step-list/step-list.d.ts +5 -1
- package/dist/components/step-list/step-list.d.ts.map +1 -1
- package/dist/components/step-list/step-list.js +117 -82
- package/dist/components/step-list/step-list.js.map +1 -1
- package/dist/components/workflow-run-duration-label.js +1 -1
- package/dist/components/workflow-run-duration-label.js.map +1 -1
- package/dist/components/workflow-run-list/job-status-strip.js +6 -6
- package/dist/components/workflow-run-list/job-status-strip.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-filter-menu.js +1 -1
- package/dist/components/workflow-run-list/workflow-run-filter-menu.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-filters.js +4 -4
- package/dist/components/workflow-run-list/workflow-run-filters.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-states.js +6 -6
- package/dist/components/workflow-run-list/workflow-run-list-states.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.js +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.js +7 -7
- package/dist/components/workflow-run-list/workflow-run-row.js.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js +1 -1
- 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 +0 -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 +8 -13
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
- package/dist/components/workflow-run-tabs/index.d.ts +1 -1
- package/dist/components/workflow-run-tabs/index.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/index.js.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotation-count-chip.js +2 -2
- package/dist/components/workflow-run-tabs/run-annotation-count-chip.js.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotation-list.d.ts +9 -2
- package/dist/components/workflow-run-tabs/run-annotation-list.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotation-list.js +28 -19
- package/dist/components/workflow-run-tabs/run-annotation-list.js.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.js +5 -5
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.js.map +1 -1
- package/dist/components/workflow-run-view/run-workspace-nav.js +7 -7
- package/dist/components/workflow-run-view/run-workspace-nav.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-states.js +6 -6
- package/dist/components/workflow-run-view/workflow-run-states.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.js +72 -12
- package/dist/components/workflow-run-view/workflow-run-view.js.map +1 -1
- package/dist/core/entities/job-execution.d.ts +7 -0
- package/dist/core/entities/job-execution.d.ts.map +1 -1
- package/dist/core/entities/job-execution.js.map +1 -1
- package/dist/core/entities/job.d.ts +9 -0
- package/dist/core/entities/job.d.ts.map +1 -1
- package/dist/core/entities/job.js.map +1 -1
- package/dist/core/entities/step-attempt.d.ts +29 -0
- package/dist/core/entities/step-attempt.d.ts.map +1 -1
- package/dist/core/entities/step-attempt.js.map +1 -1
- package/dist/core/entities/step.d.ts +3 -1
- package/dist/core/entities/step.d.ts.map +1 -1
- package/dist/core/entities/step.js.map +1 -1
- package/dist/core/run-annotation.d.ts +6 -0
- package/dist/core/run-annotation.d.ts.map +1 -1
- package/dist/core/run-annotation.js.map +1 -1
- package/dist/core/workflow-run.d.ts +1 -1
- package/dist/core/workflow-run.d.ts.map +1 -1
- package/dist/core/workflow-run.js.map +1 -1
- package/dist/hooks/api/annotations.d.ts +63 -0
- package/dist/hooks/api/annotations.d.ts.map +1 -0
- package/dist/hooks/api/annotations.js +145 -0
- package/dist/hooks/api/annotations.js.map +1 -0
- package/dist/hooks/api/step-attempt-detail.d.ts +14 -0
- package/dist/hooks/api/step-attempt-detail.d.ts.map +1 -0
- package/dist/hooks/api/step-attempt-detail.js +43 -0
- package/dist/hooks/api/step-attempt-detail.js.map +1 -0
- package/dist/hooks/api/workflow-run-mapper.d.ts +9 -2
- package/dist/hooks/api/workflow-run-mapper.d.ts.map +1 -1
- package/dist/hooks/api/workflow-run-mapper.js +47 -0
- package/dist/hooks/api/workflow-run-mapper.js.map +1 -1
- package/dist/pages/project-workflows-page.js +19 -19
- package/dist/pages/project-workflows-page.js.map +1 -1
- package/dist/pages/workflow-run-list-page.js +1 -1
- package/dist/pages/workflow-run-list-page.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/components/identifier/identifier.tsx +2 -2
- package/src/components/job-detail/agent-config-failure-callout.tsx +5 -1
- package/src/components/job-detail/job-context-panel.test.tsx +72 -0
- package/src/components/job-detail/job-context-panel.tsx +237 -0
- package/src/components/job-detail/job-detail-header.tsx +52 -46
- package/src/components/job-detail/job-detail-view.stories.tsx +555 -53
- package/src/components/job-detail/job-detail-view.tsx +87 -45
- package/src/components/job-detail/job-empty-states.tsx +23 -10
- package/src/components/job-detail/job-execution-switcher.tsx +5 -5
- package/src/components/job-detail/json-code.tsx +120 -0
- package/src/components/job-detail/step-attempt-log-panel.test.tsx +1 -0
- package/src/components/job-detail/step-attempt-log-panel.tsx +17 -6
- package/src/components/job-detail/step-troubleshooting.stories.tsx +120 -0
- package/src/components/job-detail/step-troubleshooting.test.tsx +337 -0
- package/src/components/job-detail/step-troubleshooting.tsx +537 -0
- package/src/components/job-graph/job-graph-content.tsx +4 -3
- package/src/components/job-graph/job-node.tsx +3 -3
- package/src/components/step-list/index.ts +1 -0
- package/src/components/step-list/step-list-model.ts +5 -0
- package/src/components/step-list/step-list.test.tsx +75 -2
- package/src/components/step-list/step-list.tsx +73 -20
- package/src/components/workflow-run-duration-label.tsx +1 -1
- package/src/components/workflow-run-list/job-status-strip.tsx +6 -6
- package/src/components/workflow-run-list/workflow-run-filter-menu.tsx +1 -1
- package/src/components/workflow-run-list/workflow-run-filters.tsx +4 -4
- package/src/components/workflow-run-list/workflow-run-list-states.tsx +6 -6
- package/src/components/workflow-run-list/workflow-run-list-view.tsx +1 -1
- package/src/components/workflow-run-list/workflow-run-row.tsx +7 -7
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.tsx +1 -1
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +1 -1
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +11 -11
- package/src/components/workflow-run-tabs/index.ts +5 -1
- package/src/components/workflow-run-tabs/run-annotation-count-chip.tsx +2 -2
- package/src/components/workflow-run-tabs/run-annotation-list.tsx +25 -10
- package/src/components/workflow-run-tabs/run-annotation-summary-line.tsx +5 -5
- package/src/components/workflow-run-view/run-workspace-nav.tsx +7 -7
- package/src/components/workflow-run-view/workflow-run-states.tsx +6 -6
- package/src/components/workflow-run-view/workflow-run-view.tsx +114 -14
- package/src/core/entities/job-execution.ts +7 -0
- package/src/core/entities/job.ts +9 -0
- package/src/core/entities/step-attempt.ts +33 -0
- package/src/core/entities/step.ts +3 -1
- package/src/core/run-annotation.ts +6 -0
- package/src/core/workflow-run.ts +4 -0
- package/src/hooks/api/annotations.test.ts +84 -0
- package/src/hooks/api/annotations.ts +240 -0
- package/src/hooks/api/step-attempt-detail.ts +67 -0
- package/src/hooks/api/workflow-run-mapper.ts +46 -0
- package/src/hooks/api/workflow-runs.test.tsx +61 -1
- package/src/pages/project-workflows-page.tsx +19 -19
- package/src/pages/workflow-job-detail-page.test.tsx +52 -1
- package/src/pages/workflow-run-list-page.tsx +1 -1
- package/test/fixtures/workflow-run.ts +7 -0
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { annotationSummaryResponseSchema, readAnnotationsResponseSchema } from '@shipfox/annotations-dto';
|
|
2
|
+
import { checkedApiRequest } from '@shipfox/client-api';
|
|
3
|
+
import { infiniteQueryOptions, queryOptions, useInfiniteQuery, useQuery } from '@tanstack/react-query';
|
|
4
|
+
const ANNOTATIONS_PAGE_SIZE = 100;
|
|
5
|
+
const ANNOTATIONS_REFRESH_INTERVAL_MS = 5_000;
|
|
6
|
+
export const workflowRunAnnotationsQueryKeys = {
|
|
7
|
+
all: [
|
|
8
|
+
'workflow-run-annotations'
|
|
9
|
+
],
|
|
10
|
+
list: (workflowRunId, attempt, jobExecutionId)=>[
|
|
11
|
+
...workflowRunAnnotationsQueryKeys.all,
|
|
12
|
+
'list',
|
|
13
|
+
workflowRunId,
|
|
14
|
+
attempt,
|
|
15
|
+
jobExecutionId ?? null
|
|
16
|
+
],
|
|
17
|
+
summary: (workflowRunId, attempt, jobExecutionId)=>[
|
|
18
|
+
...workflowRunAnnotationsQueryKeys.all,
|
|
19
|
+
'summary',
|
|
20
|
+
workflowRunId,
|
|
21
|
+
attempt,
|
|
22
|
+
jobExecutionId ?? null
|
|
23
|
+
]
|
|
24
|
+
};
|
|
25
|
+
function annotationParams({ workflowRunId, attempt, jobExecutionId, cursor }) {
|
|
26
|
+
const params = new URLSearchParams({
|
|
27
|
+
workflow_run_id: workflowRunId,
|
|
28
|
+
attempt: String(attempt),
|
|
29
|
+
limit: String(ANNOTATIONS_PAGE_SIZE)
|
|
30
|
+
});
|
|
31
|
+
if (jobExecutionId) params.set('job_execution_id', jobExecutionId);
|
|
32
|
+
if (cursor) params.set('cursor', cursor);
|
|
33
|
+
return params;
|
|
34
|
+
}
|
|
35
|
+
async function getWorkflowRunAnnotationsPage({ workflowRunId, attempt, jobExecutionId, cursor, signal }) {
|
|
36
|
+
const response = await checkedApiRequest(readAnnotationsResponseSchema, `/annotations?${annotationParams({
|
|
37
|
+
workflowRunId,
|
|
38
|
+
attempt,
|
|
39
|
+
jobExecutionId,
|
|
40
|
+
cursor
|
|
41
|
+
}).toString()}`, {
|
|
42
|
+
signal
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
annotations: response.annotations.map(toWorkflowRunAnnotation),
|
|
46
|
+
hasMore: response.has_more,
|
|
47
|
+
nextCursor: response.next_cursor
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
async function getWorkflowRunAnnotationSummary({ workflowRunId, attempt, jobExecutionId, signal }) {
|
|
51
|
+
const params = annotationParams({
|
|
52
|
+
workflowRunId,
|
|
53
|
+
attempt,
|
|
54
|
+
jobExecutionId
|
|
55
|
+
});
|
|
56
|
+
params.delete('limit');
|
|
57
|
+
const response = await checkedApiRequest(annotationSummaryResponseSchema, `/annotations/summary?${params.toString()}`, {
|
|
58
|
+
signal
|
|
59
|
+
});
|
|
60
|
+
return {
|
|
61
|
+
total: response.total,
|
|
62
|
+
error: response.error,
|
|
63
|
+
warning: response.warning,
|
|
64
|
+
info: response.info,
|
|
65
|
+
success: response.success,
|
|
66
|
+
truncated: false,
|
|
67
|
+
stepCounts: response.step_counts.map((step)=>({
|
|
68
|
+
stepId: step.origin_step_id,
|
|
69
|
+
attempt: step.origin_step_attempt,
|
|
70
|
+
total: step.total
|
|
71
|
+
}))
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function workflowRunAnnotationsQueryOptions(workflowRunId, attempt, jobExecutionId, options) {
|
|
75
|
+
const enabled = Boolean(workflowRunId) && attempt !== undefined && (options?.enabled ?? true);
|
|
76
|
+
const polling = options?.polling ?? true;
|
|
77
|
+
return infiniteQueryOptions({
|
|
78
|
+
queryKey: workflowRunId && attempt !== undefined ? workflowRunAnnotationsQueryKeys.list(workflowRunId, attempt, jobExecutionId) : [
|
|
79
|
+
...workflowRunAnnotationsQueryKeys.all,
|
|
80
|
+
'list'
|
|
81
|
+
],
|
|
82
|
+
enabled,
|
|
83
|
+
initialPageParam: null,
|
|
84
|
+
queryFn: ({ pageParam, signal })=>getWorkflowRunAnnotationsPage({
|
|
85
|
+
workflowRunId: workflowRunId ?? '',
|
|
86
|
+
attempt: attempt ?? 0,
|
|
87
|
+
...jobExecutionId ? {
|
|
88
|
+
jobExecutionId
|
|
89
|
+
} : {},
|
|
90
|
+
cursor: pageParam,
|
|
91
|
+
signal
|
|
92
|
+
}),
|
|
93
|
+
getNextPageParam: (lastPage)=>lastPage.nextCursor,
|
|
94
|
+
staleTime: 2_000,
|
|
95
|
+
refetchInterval: enabled && polling ? (query)=>{
|
|
96
|
+
const pages = query.state.data?.pages;
|
|
97
|
+
return pages && pages.length > 1 ? false : ANNOTATIONS_REFRESH_INTERVAL_MS;
|
|
98
|
+
} : false
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
export function useWorkflowRunAnnotationsQuery(workflowRunId, attempt, jobExecutionId, options) {
|
|
102
|
+
return useInfiniteQuery(workflowRunAnnotationsQueryOptions(workflowRunId, attempt, jobExecutionId, options));
|
|
103
|
+
}
|
|
104
|
+
export function workflowRunAnnotationSummaryQueryOptions(workflowRunId, attempt, jobExecutionId, options) {
|
|
105
|
+
const enabled = Boolean(workflowRunId) && attempt !== undefined && (options?.enabled ?? true);
|
|
106
|
+
const polling = options?.polling ?? true;
|
|
107
|
+
return queryOptions({
|
|
108
|
+
queryKey: workflowRunId && attempt !== undefined ? workflowRunAnnotationsQueryKeys.summary(workflowRunId, attempt, jobExecutionId) : [
|
|
109
|
+
...workflowRunAnnotationsQueryKeys.all,
|
|
110
|
+
'summary'
|
|
111
|
+
],
|
|
112
|
+
enabled,
|
|
113
|
+
queryFn: ({ signal })=>getWorkflowRunAnnotationSummary({
|
|
114
|
+
workflowRunId: workflowRunId ?? '',
|
|
115
|
+
attempt: attempt ?? 0,
|
|
116
|
+
...jobExecutionId ? {
|
|
117
|
+
jobExecutionId
|
|
118
|
+
} : {},
|
|
119
|
+
signal
|
|
120
|
+
}),
|
|
121
|
+
staleTime: 2_000,
|
|
122
|
+
refetchInterval: enabled && polling ? ANNOTATIONS_REFRESH_INTERVAL_MS : false
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
export function useWorkflowRunAnnotationSummaryQuery(workflowRunId, attempt, jobExecutionId, options) {
|
|
126
|
+
return useQuery(workflowRunAnnotationSummaryQueryOptions(workflowRunId, attempt, jobExecutionId, options));
|
|
127
|
+
}
|
|
128
|
+
export function flattenWorkflowRunAnnotations(data) {
|
|
129
|
+
return data?.pages.flatMap((page)=>page.annotations) ?? [];
|
|
130
|
+
}
|
|
131
|
+
function toWorkflowRunAnnotation(annotation) {
|
|
132
|
+
return {
|
|
133
|
+
id: annotation.id,
|
|
134
|
+
jobId: annotation.job_id,
|
|
135
|
+
jobExecutionId: annotation.job_execution_id,
|
|
136
|
+
originStepId: annotation.origin_step_id,
|
|
137
|
+
originStepAttempt: annotation.origin_step_attempt,
|
|
138
|
+
context: annotation.context,
|
|
139
|
+
style: annotation.style,
|
|
140
|
+
sequence: annotation.sequence,
|
|
141
|
+
body: annotation.body
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
//# sourceMappingURL=annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/annotations.ts"],"sourcesContent":["import {\n type AnnotationStyleDto,\n annotationSummaryResponseSchema,\n readAnnotationsResponseSchema,\n} from '@shipfox/annotations-dto';\nimport {checkedApiRequest} from '@shipfox/client-api';\nimport {\n infiniteQueryOptions,\n queryOptions,\n useInfiniteQuery,\n useQuery,\n} from '@tanstack/react-query';\nimport type {RunAnnotationSummary} from '#core/run-annotation.js';\n\nconst ANNOTATIONS_PAGE_SIZE = 100;\nconst ANNOTATIONS_REFRESH_INTERVAL_MS = 5_000;\n\nexport interface WorkflowRunAnnotation {\n id: string;\n jobId: string;\n jobExecutionId: string;\n originStepId: string;\n originStepAttempt: number;\n context: string;\n style: AnnotationStyleDto;\n sequence: number;\n body: string;\n}\n\nexport interface WorkflowRunAnnotationsPage {\n annotations: WorkflowRunAnnotation[];\n hasMore: boolean;\n nextCursor: string | null;\n}\n\nexport const workflowRunAnnotationsQueryKeys = {\n all: ['workflow-run-annotations'] as const,\n list: (workflowRunId: string, attempt: number, jobExecutionId?: string) =>\n [\n ...workflowRunAnnotationsQueryKeys.all,\n 'list',\n workflowRunId,\n attempt,\n jobExecutionId ?? null,\n ] as const,\n summary: (workflowRunId: string, attempt: number, jobExecutionId?: string) =>\n [\n ...workflowRunAnnotationsQueryKeys.all,\n 'summary',\n workflowRunId,\n attempt,\n jobExecutionId ?? null,\n ] as const,\n};\n\nfunction annotationParams({\n workflowRunId,\n attempt,\n jobExecutionId,\n cursor,\n}: {\n workflowRunId: string;\n attempt: number;\n jobExecutionId?: string | undefined;\n cursor?: string | null | undefined;\n}): URLSearchParams {\n const params = new URLSearchParams({\n workflow_run_id: workflowRunId,\n attempt: String(attempt),\n limit: String(ANNOTATIONS_PAGE_SIZE),\n });\n if (jobExecutionId) params.set('job_execution_id', jobExecutionId);\n if (cursor) params.set('cursor', cursor);\n return params;\n}\n\nasync function getWorkflowRunAnnotationsPage({\n workflowRunId,\n attempt,\n jobExecutionId,\n cursor,\n signal,\n}: {\n workflowRunId: string;\n attempt: number;\n jobExecutionId?: string | undefined;\n cursor?: string | null | undefined;\n signal?: AbortSignal;\n}): Promise<WorkflowRunAnnotationsPage> {\n const response = await checkedApiRequest(\n readAnnotationsResponseSchema,\n `/annotations?${annotationParams({workflowRunId, attempt, jobExecutionId, cursor}).toString()}`,\n {signal},\n );\n return {\n annotations: response.annotations.map(toWorkflowRunAnnotation),\n hasMore: response.has_more,\n nextCursor: response.next_cursor,\n };\n}\n\nasync function getWorkflowRunAnnotationSummary({\n workflowRunId,\n attempt,\n jobExecutionId,\n signal,\n}: {\n workflowRunId: string;\n attempt: number;\n jobExecutionId?: string | undefined;\n signal?: AbortSignal;\n}): Promise<RunAnnotationSummary> {\n const params = annotationParams({workflowRunId, attempt, jobExecutionId});\n params.delete('limit');\n const response = await checkedApiRequest(\n annotationSummaryResponseSchema,\n `/annotations/summary?${params.toString()}`,\n {signal},\n );\n return {\n total: response.total,\n error: response.error,\n warning: response.warning,\n info: response.info,\n success: response.success,\n truncated: false,\n stepCounts: response.step_counts.map((step) => ({\n stepId: step.origin_step_id,\n attempt: step.origin_step_attempt,\n total: step.total,\n })),\n };\n}\n\nexport function workflowRunAnnotationsQueryOptions(\n workflowRunId: string | undefined,\n attempt: number | undefined,\n jobExecutionId?: string | undefined,\n options?: {enabled?: boolean | undefined; polling?: boolean | undefined},\n) {\n const enabled = Boolean(workflowRunId) && attempt !== undefined && (options?.enabled ?? true);\n const polling = options?.polling ?? true;\n return infiniteQueryOptions({\n queryKey:\n workflowRunId && attempt !== undefined\n ? workflowRunAnnotationsQueryKeys.list(workflowRunId, attempt, jobExecutionId)\n : ([...workflowRunAnnotationsQueryKeys.all, 'list'] as const),\n enabled,\n initialPageParam: null as string | null,\n queryFn: ({pageParam, signal}) =>\n getWorkflowRunAnnotationsPage({\n workflowRunId: workflowRunId ?? '',\n attempt: attempt ?? 0,\n ...(jobExecutionId ? {jobExecutionId} : {}),\n cursor: pageParam,\n signal,\n }),\n getNextPageParam: (lastPage) => lastPage.nextCursor,\n staleTime: 2_000,\n refetchInterval:\n enabled && polling\n ? (query) => {\n const pages = query.state.data?.pages;\n return pages && pages.length > 1 ? false : ANNOTATIONS_REFRESH_INTERVAL_MS;\n }\n : false,\n });\n}\n\nexport function useWorkflowRunAnnotationsQuery(\n workflowRunId: string | undefined,\n attempt: number | undefined,\n jobExecutionId?: string | undefined,\n options?: {enabled?: boolean | undefined; polling?: boolean | undefined},\n) {\n return useInfiniteQuery(\n workflowRunAnnotationsQueryOptions(workflowRunId, attempt, jobExecutionId, options),\n );\n}\n\nexport function workflowRunAnnotationSummaryQueryOptions(\n workflowRunId: string | undefined,\n attempt: number | undefined,\n jobExecutionId?: string | undefined,\n options?: {enabled?: boolean | undefined; polling?: boolean | undefined},\n) {\n const enabled = Boolean(workflowRunId) && attempt !== undefined && (options?.enabled ?? true);\n const polling = options?.polling ?? true;\n return queryOptions({\n queryKey:\n workflowRunId && attempt !== undefined\n ? workflowRunAnnotationsQueryKeys.summary(workflowRunId, attempt, jobExecutionId)\n : ([...workflowRunAnnotationsQueryKeys.all, 'summary'] as const),\n enabled,\n queryFn: ({signal}) =>\n getWorkflowRunAnnotationSummary({\n workflowRunId: workflowRunId ?? '',\n attempt: attempt ?? 0,\n ...(jobExecutionId ? {jobExecutionId} : {}),\n signal,\n }),\n staleTime: 2_000,\n refetchInterval: enabled && polling ? ANNOTATIONS_REFRESH_INTERVAL_MS : false,\n });\n}\n\nexport function useWorkflowRunAnnotationSummaryQuery(\n workflowRunId: string | undefined,\n attempt: number | undefined,\n jobExecutionId?: string | undefined,\n options?: {enabled?: boolean | undefined; polling?: boolean | undefined},\n) {\n return useQuery(\n workflowRunAnnotationSummaryQueryOptions(workflowRunId, attempt, jobExecutionId, options),\n );\n}\n\nexport function flattenWorkflowRunAnnotations(\n data: {pages: readonly WorkflowRunAnnotationsPage[]} | undefined,\n): WorkflowRunAnnotation[] {\n return data?.pages.flatMap((page) => page.annotations) ?? [];\n}\n\nfunction toWorkflowRunAnnotation(\n annotation: Awaited<\n ReturnType<typeof readAnnotationsResponseSchema.parse>\n >['annotations'][number],\n): WorkflowRunAnnotation {\n return {\n id: annotation.id,\n jobId: annotation.job_id,\n jobExecutionId: annotation.job_execution_id,\n originStepId: annotation.origin_step_id,\n originStepAttempt: annotation.origin_step_attempt,\n context: annotation.context,\n style: annotation.style,\n sequence: annotation.sequence,\n body: annotation.body,\n };\n}\n"],"names":["annotationSummaryResponseSchema","readAnnotationsResponseSchema","checkedApiRequest","infiniteQueryOptions","queryOptions","useInfiniteQuery","useQuery","ANNOTATIONS_PAGE_SIZE","ANNOTATIONS_REFRESH_INTERVAL_MS","workflowRunAnnotationsQueryKeys","all","list","workflowRunId","attempt","jobExecutionId","summary","annotationParams","cursor","params","URLSearchParams","workflow_run_id","String","limit","set","getWorkflowRunAnnotationsPage","signal","response","toString","annotations","map","toWorkflowRunAnnotation","hasMore","has_more","nextCursor","next_cursor","getWorkflowRunAnnotationSummary","delete","total","error","warning","info","success","truncated","stepCounts","step_counts","step","stepId","origin_step_id","origin_step_attempt","workflowRunAnnotationsQueryOptions","options","enabled","Boolean","undefined","polling","queryKey","initialPageParam","queryFn","pageParam","getNextPageParam","lastPage","staleTime","refetchInterval","query","pages","state","data","length","useWorkflowRunAnnotationsQuery","workflowRunAnnotationSummaryQueryOptions","useWorkflowRunAnnotationSummaryQuery","flattenWorkflowRunAnnotations","flatMap","page","annotation","id","jobId","job_id","job_execution_id","originStepId","originStepAttempt","context","style","sequence","body"],"mappings":"AAAA,SAEEA,+BAA+B,EAC/BC,6BAA6B,QACxB,2BAA2B;AAClC,SAAQC,iBAAiB,QAAO,sBAAsB;AACtD,SACEC,oBAAoB,EACpBC,YAAY,EACZC,gBAAgB,EAChBC,QAAQ,QACH,wBAAwB;AAG/B,MAAMC,wBAAwB;AAC9B,MAAMC,kCAAkC;AAoBxC,OAAO,MAAMC,kCAAkC;IAC7CC,KAAK;QAAC;KAA2B;IACjCC,MAAM,CAACC,eAAuBC,SAAiBC,iBAC7C;eACKL,gCAAgCC,GAAG;YACtC;YACAE;YACAC;YACAC,kBAAkB;SACnB;IACHC,SAAS,CAACH,eAAuBC,SAAiBC,iBAChD;eACKL,gCAAgCC,GAAG;YACtC;YACAE;YACAC;YACAC,kBAAkB;SACnB;AACL,E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AASC,kBAC/D;eAAIL,gCAAgCC,GAAG;YAAE;SAAU;QAC1DyC;QACAM,SAAS,CAAC,EAAChC,MAAM,EAAC,GAChBU,gCAAgC;gBAC9BvB,eAAeA,iBAAiB;gBAChCC,SAASA,WAAW;gBACpB,GAAIC,iBAAiB;oBAACA;gBAAc,IAAI,CAAC,CAAC;gBAC1CW;YACF;QACFoC,WAAW;QACXC,iBAAiBX,WAAWG,UAAU9C,kCAAkC;IAC1E;AACF;AAEA,OAAO,SAAS8D,qCACd1D,aAAiC,EACjCC,OAA2B,EAC3BC,cAAmC,EACnCoC,OAAwE;IAExE,OAAO5C,SACL+D,yCAAyCzD,eAAeC,SAASC,gBAAgBoC;AAErF;AAEA,OAAO,SAASqB,8BACdL,IAAgE;IAEhE,OAAOA,MAAMF,MAAMQ,QAAQ,CAACC,OAASA,KAAK7C,WAAW,KAAK,EAAE;AAC9D;AAEA,SAASE,wBACP4C,UAEwB;IAExB,OAAO;QACLC,IAAID,WAAWC,EAAE;QACjBC,OAAOF,WAAWG,MAAM;QACxB/D,gBAAgB4D,WAAWI,gBAAgB;QAC3CC,cAAcL,WAAW3B,cAAc;QACvCiC,mBAAmBN,WAAW1B,mBAAmB;QACjDiC,SAASP,WAAWO,OAAO;QAC3BC,OAAOR,WAAWQ,KAAK;QACvBC,UAAUT,WAAWS,QAAQ;QAC7BC,MAAMV,WAAWU,IAAI;IACvB;AACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { StepAttemptDetail } from '#core/workflow-run.js';
|
|
3
|
+
export declare const stepAttemptDetailQueryKeys: {
|
|
4
|
+
all: readonly ['workflow-step-attempt-details'];
|
|
5
|
+
detail: (stepId: string, attempt: number) => readonly ["workflow-step-attempt-details", string, number];
|
|
6
|
+
};
|
|
7
|
+
type StepAttemptDetailQueryKey = ReturnType<typeof stepAttemptDetailQueryKeys.detail> | readonly ['workflow-step-attempt-details'];
|
|
8
|
+
type StepAttemptDetailQueryOptions = UseQueryOptions<StepAttemptDetail, Error, StepAttemptDetail, StepAttemptDetailQueryKey>;
|
|
9
|
+
export declare function stepAttemptDetailQueryOptions(stepId: string | undefined, attempt: number | undefined): StepAttemptDetailQueryOptions;
|
|
10
|
+
export declare function useStepAttemptDetailQuery(stepId: string | undefined, attempt: number | undefined, options?: {
|
|
11
|
+
enabled?: boolean | undefined;
|
|
12
|
+
}): import("@tanstack/react-query").UseQueryResult<NoInfer<StepAttemptDetail>, Error>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=step-attempt-detail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-attempt-detail.d.ts","sourceRoot":"","sources":["../../../src/hooks/api/step-attempt-detail.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,eAAe,EAAW,MAAM,uBAAuB,CAAC;AACnF,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AAG7D,eAAO,MAAM,0BAA0B;IACrC,GAAG,YAAG,+BAA+B;IACrC,MAAM,WAAW,MAAM,WAAW,MAAM;CAEzC,CAAC;AAEF,KAAK,yBAAyB,GAC1B,UAAU,CAAC,OAAO,0BAA0B,CAAC,MAAM,CAAC,GACpD,SAAS,CAAC,+BAA+B,CAAC,CAAC;AAE/C,KAAK,6BAA6B,GAAG,eAAe,CAClD,iBAAiB,EACjB,KAAK,EACL,iBAAiB,EACjB,yBAAyB,CAC1B,CAAC;AAmBF,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,6BAA6B,CAW/B;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,CAAC,EAAE;IAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAC,qFAO1C"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { stepAttemptDetailResponseSchema } from '@shipfox/api-workflows-dto';
|
|
2
|
+
import { checkedApiRequest } from '@shipfox/client-api';
|
|
3
|
+
import { queryOptions, useQuery } from '@tanstack/react-query';
|
|
4
|
+
import { toStepAttemptDetail } from './workflow-run-mapper.js';
|
|
5
|
+
export const stepAttemptDetailQueryKeys = {
|
|
6
|
+
all: [
|
|
7
|
+
'workflow-step-attempt-details'
|
|
8
|
+
],
|
|
9
|
+
detail: (stepId, attempt)=>[
|
|
10
|
+
...stepAttemptDetailQueryKeys.all,
|
|
11
|
+
stepId,
|
|
12
|
+
attempt
|
|
13
|
+
]
|
|
14
|
+
};
|
|
15
|
+
async function getStepAttemptDetail({ stepId, attempt, signal }) {
|
|
16
|
+
const response = await checkedApiRequest(stepAttemptDetailResponseSchema, `/workflows/runs/steps/${stepId}/attempts/${attempt}`, {
|
|
17
|
+
signal
|
|
18
|
+
});
|
|
19
|
+
return toStepAttemptDetail(response);
|
|
20
|
+
}
|
|
21
|
+
export function stepAttemptDetailQueryOptions(stepId, attempt) {
|
|
22
|
+
return queryOptions({
|
|
23
|
+
queryKey: stepId && attempt !== undefined ? stepAttemptDetailQueryKeys.detail(stepId, attempt) : [
|
|
24
|
+
...stepAttemptDetailQueryKeys.all
|
|
25
|
+
],
|
|
26
|
+
enabled: Boolean(stepId) && attempt !== undefined,
|
|
27
|
+
queryFn: ({ signal })=>getStepAttemptDetail({
|
|
28
|
+
stepId: stepId ?? '',
|
|
29
|
+
attempt: attempt ?? 0,
|
|
30
|
+
signal
|
|
31
|
+
}),
|
|
32
|
+
staleTime: Infinity
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export function useStepAttemptDetailQuery(stepId, attempt, options) {
|
|
36
|
+
return useQuery({
|
|
37
|
+
...stepAttemptDetailQueryOptions(stepId, attempt),
|
|
38
|
+
...options,
|
|
39
|
+
enabled: Boolean(stepId) && attempt !== undefined && (options?.enabled ?? true)
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=step-attempt-detail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/api/step-attempt-detail.ts"],"sourcesContent":["import {stepAttemptDetailResponseSchema} from '@shipfox/api-workflows-dto';\nimport {checkedApiRequest} from '@shipfox/client-api';\nimport {queryOptions, type UseQueryOptions, useQuery} from '@tanstack/react-query';\nimport type {StepAttemptDetail} from '#core/workflow-run.js';\nimport {toStepAttemptDetail} from './workflow-run-mapper.js';\n\nexport const stepAttemptDetailQueryKeys = {\n all: ['workflow-step-attempt-details'] as const,\n detail: (stepId: string, attempt: number) =>\n [...stepAttemptDetailQueryKeys.all, stepId, attempt] as const,\n};\n\ntype StepAttemptDetailQueryKey =\n | ReturnType<typeof stepAttemptDetailQueryKeys.detail>\n | readonly ['workflow-step-attempt-details'];\n\ntype StepAttemptDetailQueryOptions = UseQueryOptions<\n StepAttemptDetail,\n Error,\n StepAttemptDetail,\n StepAttemptDetailQueryKey\n>;\n\nasync function getStepAttemptDetail({\n stepId,\n attempt,\n signal,\n}: {\n stepId: string;\n attempt: number;\n signal?: AbortSignal;\n}): Promise<StepAttemptDetail> {\n const response = await checkedApiRequest(\n stepAttemptDetailResponseSchema,\n `/workflows/runs/steps/${stepId}/attempts/${attempt}`,\n {signal},\n );\n return toStepAttemptDetail(response);\n}\n\nexport function stepAttemptDetailQueryOptions(\n stepId: string | undefined,\n attempt: number | undefined,\n): StepAttemptDetailQueryOptions {\n return queryOptions({\n queryKey:\n stepId && attempt !== undefined\n ? stepAttemptDetailQueryKeys.detail(stepId, attempt)\n : ([...stepAttemptDetailQueryKeys.all] as const),\n enabled: Boolean(stepId) && attempt !== undefined,\n queryFn: ({signal}) =>\n getStepAttemptDetail({stepId: stepId ?? '', attempt: attempt ?? 0, signal}),\n staleTime: Infinity,\n });\n}\n\nexport function useStepAttemptDetailQuery(\n stepId: string | undefined,\n attempt: number | undefined,\n options?: {enabled?: boolean | undefined},\n) {\n return useQuery({\n ...stepAttemptDetailQueryOptions(stepId, attempt),\n ...options,\n enabled: Boolean(stepId) && attempt !== undefined && (options?.enabled ?? true),\n });\n}\n"],"names":["stepAttemptDetailResponseSchema","checkedApiRequest","queryOptions","useQuery","toStepAttemptDetail","stepAttemptDetailQueryKeys","all","detail","stepId","attempt","getStepAttemptDetail","signal","response","stepAttemptDetailQueryOptions","queryKey","undefined","enabled","Boolean","queryFn","staleTime","Infinity","useStepAttemptDetailQuery","options"],"mappings":"AAAA,SAAQA,+BAA+B,QAAO,6BAA6B;AAC3E,SAAQC,iBAAiB,QAAO,sBAAsB;AACtD,SAAQC,YAAY,EAAwBC,QAAQ,QAAO,wBAAwB;AAEnF,SAAQC,mBAAmB,QAAO,2BAA2B;AAE7D,OAAO,MAAMC,6BAA6B;IACxCC,KAAK;QAAC;KAAgC;IACtCC,QAAQ,CAACC,QAAgBC,UACvB;eAAIJ,2BAA2BC,GAAG;YAAEE;YAAQC;SAAQ;AACxD,EAAE;AAaF,eAAeC,qBAAqB,EAClCF,MAAM,EACNC,OAAO,EACPE,MAAM,EAKP;IACC,MAAMC,WAAW,MAAMX,kBACrBD,iCACA,CAAC,sBAAsB,EAAEQ,OAAO,UAAU,EAAEC,SAAS,EACrD;QAACE;IAAM;IAET,OAAOP,oBAAoBQ;AAC7B;AAEA,OAAO,SAASC,8BACdL,MAA0B,EAC1BC,OAA2B;IAE3B,OAAOP,aAAa;QAClBY,UACEN,UAAUC,YAAYM,YAClBV,2BAA2BE,MAAM,CAACC,QAAQC,WACzC;eAAIJ,2BAA2BC,GAAG;SAAC;QAC1CU,SAASC,QAAQT,WAAWC,YAAYM;QACxCG,SAAS,CAAC,EAACP,MAAM,EAAC,GAChBD,qBAAqB;gBAACF,QAAQA,UAAU;gBAAIC,SAASA,WAAW;gBAAGE;YAAM;QAC3EQ,WAAWC;IACb;AACF;AAEA,OAAO,SAASC,0BACdb,MAA0B,EAC1BC,OAA2B,EAC3Ba,OAAyC;IAEzC,OAAOnB,SAAS;QACd,GAAGU,8BAA8BL,QAAQC,QAAQ;QACjD,GAAGa,OAAO;QACVN,SAASC,QAAQT,WAAWC,YAAYM,aAAcO,CAAAA,SAASN,WAAW,IAAG;IAC/E;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { StepAttemptDto, WorkflowRunAttemptDto, WorkflowRunDetailResponseDto, WorkflowRunJobDetailDto, WorkflowRunJobExecutionDetailDto, WorkflowRunListItemDto, WorkflowRunListResponseDto, WorkflowRunResponseDto, WorkflowRunStepDetailDto } from '@shipfox/api-workflows-dto';
|
|
2
|
-
import { Job, JobExecution, type Step, StepAttempt, type WorkflowRun, WorkflowRunAttempt, type WorkflowRunDetail, type WorkflowRunListItem, type WorkflowRunListPage, type WorkflowRunRecord } from '#core/workflow-run.js';
|
|
1
|
+
import type { StepAttemptDetailResponseDto, StepAttemptDto, WorkflowRunAttemptDto, WorkflowRunDetailResponseDto, WorkflowRunJobDetailDto, WorkflowRunJobExecutionDetailDto, WorkflowRunListItemDto, WorkflowRunListResponseDto, WorkflowRunResponseDto, WorkflowRunStepDetailDto } from '@shipfox/api-workflows-dto';
|
|
2
|
+
import { type EvaluationTraceEntry, Job, JobExecution, type Step, StepAttempt, type WorkflowRun, WorkflowRunAttempt, type WorkflowRunDetail, type WorkflowRunListItem, type WorkflowRunListPage, type WorkflowRunRecord } from '#core/workflow-run.js';
|
|
3
3
|
export declare function toWorkflowRun(dto: WorkflowRunResponseDto): WorkflowRun;
|
|
4
4
|
export declare function toWorkflowRunAttempt(dto: WorkflowRunAttemptDto): WorkflowRunAttempt;
|
|
5
5
|
export declare function toWorkflowRunRecord(dto: WorkflowRunResponseDto): WorkflowRunRecord;
|
|
@@ -10,4 +10,11 @@ export declare function toJob(dto: WorkflowRunJobDetailDto): Job;
|
|
|
10
10
|
export declare function toJobExecution(dto: WorkflowRunJobExecutionDetailDto): JobExecution;
|
|
11
11
|
export declare function toStep(dto: WorkflowRunStepDetailDto): Step;
|
|
12
12
|
export declare function toStepAttempt(dto: StepAttemptDto, jobExecutionId: string): StepAttempt;
|
|
13
|
+
export declare function toStepAttemptDetail(dto: StepAttemptDetailResponseDto): {
|
|
14
|
+
stepId: string;
|
|
15
|
+
attempt: number;
|
|
16
|
+
authoredConfig: Record<string, unknown> | null;
|
|
17
|
+
config: Record<string, unknown> | null;
|
|
18
|
+
evaluationTrace: EvaluationTraceEntry[] | null;
|
|
19
|
+
};
|
|
13
20
|
//# sourceMappingURL=workflow-run-mapper.d.ts.map
|
|
@@ -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,
|
|
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,mBAAmB,CAkBtF;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,0BAA0B,GAAG,mBAAmB,CAM1F;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,4BAA4B,GAAG,iBAAiB,CAOxF;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,uBAAuB,GAAG,GAAG,CAuBvD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,gCAAgC,GAAG,YAAY,CAoBlF;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,wBAAwB,GAAG,IAAI,CA+B1D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,GAAG,WAAW,CAkBtF;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,4BAA4B;IAEjE,MAAM;IACN,OAAO;IACP,cAAc;IACd,MAAM;IACN,eAAe;EAElB"}
|
|
@@ -105,6 +105,10 @@ export function toJob(dto) {
|
|
|
105
105
|
status: dto.status,
|
|
106
106
|
statusReason: dto.status_reason,
|
|
107
107
|
carriedOver: dto.carried_over,
|
|
108
|
+
outputs: dto.outputs ?? null,
|
|
109
|
+
success: dto.success ?? null,
|
|
110
|
+
runner: dto.runner ?? null,
|
|
111
|
+
evaluationTrace: toEvaluationTrace(dto.evaluation_trace),
|
|
108
112
|
listening: dto.listening ? toJobListening(dto.listening) : null,
|
|
109
113
|
listenerStatus: dto.listener_status,
|
|
110
114
|
resolutionReason: dto.resolution_reason,
|
|
@@ -123,11 +127,14 @@ export function toJobExecution(dto) {
|
|
|
123
127
|
name: dto.name,
|
|
124
128
|
status: dto.status,
|
|
125
129
|
statusReason: dto.status_reason,
|
|
130
|
+
runner: dto.runner ?? null,
|
|
131
|
+
outputs: dto.outputs ?? null,
|
|
126
132
|
triggerEvents: (dto.trigger_events ?? []).map(toWorkflowExecutionEvent),
|
|
127
133
|
queuedAt: dto.queued_at ?? null,
|
|
128
134
|
startedAt: dto.started_at ?? null,
|
|
129
135
|
finishedAt: dto.finished_at ?? null,
|
|
130
136
|
timedOutAt: dto.timed_out_at ?? null,
|
|
137
|
+
evaluationTrace: toEvaluationTrace(dto.evaluation_trace),
|
|
131
138
|
createdAt: dto.created_at,
|
|
132
139
|
updatedAt: dto.updated_at,
|
|
133
140
|
steps: dto.steps.map(toStep)
|
|
@@ -144,8 +151,10 @@ export function toStep(dto) {
|
|
|
144
151
|
endLine: dto.source_location.end_line
|
|
145
152
|
} : null,
|
|
146
153
|
status: dto.status,
|
|
154
|
+
statusReason: dto.status_reason,
|
|
147
155
|
type: dto.type,
|
|
148
156
|
config: dto.config,
|
|
157
|
+
evaluationTrace: toEvaluationTrace(dto.evaluation_trace),
|
|
149
158
|
agentConfig: toAgentStepConfig(dto),
|
|
150
159
|
error: dto.error ? {
|
|
151
160
|
message: dto.error.message,
|
|
@@ -172,6 +181,8 @@ export function toStepAttempt(dto, jobExecutionId) {
|
|
|
172
181
|
status: dto.status,
|
|
173
182
|
exitCode: dto.exit_code ?? null,
|
|
174
183
|
output: dto.output ?? null,
|
|
184
|
+
outputs: dto.outputs ?? dto.output ?? null,
|
|
185
|
+
response: dto.response ?? null,
|
|
175
186
|
error: dto.error ?? null,
|
|
176
187
|
gateResult: toStepGateResult(dto.gate_result),
|
|
177
188
|
restartFeedback: dto.restart_feedback ?? null,
|
|
@@ -179,6 +190,15 @@ export function toStepAttempt(dto, jobExecutionId) {
|
|
|
179
190
|
finishedAt: dto.finished_at ?? null
|
|
180
191
|
});
|
|
181
192
|
}
|
|
193
|
+
export function toStepAttemptDetail(dto) {
|
|
194
|
+
return {
|
|
195
|
+
stepId: dto.step_id,
|
|
196
|
+
attempt: dto.attempt,
|
|
197
|
+
authoredConfig: dto.authored_config,
|
|
198
|
+
config: dto.config,
|
|
199
|
+
evaluationTrace: toEvaluationTrace(dto.evaluation_trace)
|
|
200
|
+
};
|
|
201
|
+
}
|
|
182
202
|
function toJobListening(dto) {
|
|
183
203
|
return {
|
|
184
204
|
on: dto.on,
|
|
@@ -220,6 +240,33 @@ function toStepGateResult(dto) {
|
|
|
220
240
|
};
|
|
221
241
|
return dto;
|
|
222
242
|
}
|
|
243
|
+
function toEvaluationTrace(trace) {
|
|
244
|
+
return trace?.map((entry)=>'dropped' in entry ? entry : {
|
|
245
|
+
expression: entry.expression,
|
|
246
|
+
roots: entry.roots,
|
|
247
|
+
fillTarget: entry.fill_target,
|
|
248
|
+
evaluatedAt: entry.evaluated_at,
|
|
249
|
+
field: entry.field,
|
|
250
|
+
...entry.value === undefined ? {} : {
|
|
251
|
+
value: entry.value
|
|
252
|
+
},
|
|
253
|
+
...entry.truncated === undefined ? {} : {
|
|
254
|
+
truncated: entry.truncated
|
|
255
|
+
},
|
|
256
|
+
...entry.expr_truncated === undefined ? {} : {
|
|
257
|
+
exprTruncated: entry.expr_truncated
|
|
258
|
+
},
|
|
259
|
+
...entry.reference === undefined ? {} : {
|
|
260
|
+
reference: entry.reference
|
|
261
|
+
},
|
|
262
|
+
...entry.degraded === undefined ? {} : {
|
|
263
|
+
degraded: entry.degraded
|
|
264
|
+
},
|
|
265
|
+
...entry.env_key === undefined ? {} : {
|
|
266
|
+
envKey: entry.env_key
|
|
267
|
+
}
|
|
268
|
+
}) ?? null;
|
|
269
|
+
}
|
|
223
270
|
function toAgentStepConfig(dto) {
|
|
224
271
|
if (dto.type !== 'agent') return null;
|
|
225
272
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/hooks/api/workflow-run-mapper.ts"],"sourcesContent":["import type {\n JobListeningDto,\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 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 statusCounts = dto.job_status_counts.map(({status, count}) => ({status, count}));\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 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\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 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 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 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 type: dto.type,\n config: dto.config,\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 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\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 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","statusCounts","job_status_counts","map","count","jobs","preview","job","key","position","total","reduce","sum","entry","toWorkflowRunListPage","runs","nextCursor","next_cursor","filteredTotalCount","filtered_total_count","toWorkflowRunDetail","run_attempt","toJob","runAttemptId","run_attempt_id","mode","statusReason","status_reason","carriedOver","carried_over","listening","toJobListening","listenerStatus","listener_status","resolutionReason","resolution_reason","dependencies","jobExecutions","job_executions","toJobExecution","jobId","job_id","sequence","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","gateResult","toStepGateResult","gate_result","restartFeedback","restart_feedback","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","provider","stringConfigValue","model","thinking","value","trim"],"mappings":"AAcA,SACEA,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,IAA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AOD,kBAAkBrK,IAAI+G,MAAM,CAACuD,KAAK;QACzCC,UAAUF,kBAAkBrK,IAAI+G,MAAM,CAACwD,QAAQ;IACjD;AACF;AAEA,SAASF,kBAAkBG,KAAc;IACvC,OAAO,OAAOA,UAAU,YAAYA,MAAMC,IAAI,KAAKD,MAAMC,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 statusCounts = dto.job_status_counts.map(({status, count}) => ({status, count}));\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 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\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 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","statusCounts","job_status_counts","map","count","jobs","preview","job","key","position","total","reduce","sum","entry","toWorkflowRunListPage","runs","nextCursor","next_cursor","filteredTotalCount","filtered_total_count","toWorkflowRunDetail","run_attempt","toJob","runAttemptId","run_attempt_id","mode","statusReason","status_reason","carriedOver","carried_over","outputs","success","runner","evaluationTrace","toEvaluationTrace","evaluation_trace","listening","toJobListening","listenerStatus","listener_status","resolutionReason","resolution_reason","dependencies","jobExecutions","job_executions","toJobExecution","jobId","job_id","sequence","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","undefined","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;QAC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GAAIvH,MAAMyH,SAAS,KAAKD,YAAY,CAAC,IAAI;gBAACC,WAAWzH,MAAMyH,SAAS;YAAA,CAAC;YACrE,GAAIzH,MAAM0H,cAAc,KAAKF,YAAY,CAAC,IAAI;gBAACG,eAAe3H,MAAM0H,cAAc;YAAA,CAAC;YACnF,GAAI1H,MAAM4H,SAAS,KAAKJ,YAAY,CAAC,IAAI;gBAACI,WAAW5H,MAAM4H,SAAS;YAAA,CAAC;YACrE,GAAI5H,MAAM6H,QAAQ,KAAKL,YAAY,CAAC,IAAI;gBAACK,UAAU7H,MAAM6H,QAAQ;YAAA,CAAC;YAClE,GAAI7H,MAAM8H,OAAO,KAAKN,YAAY,CAAC,IAAI;gBAACO,QAAQ/H,MAAM8H,OAAO;YAAA,CAAC;QAChE,MACD;AAET;AAEA,SAAStE,kBAAkBvH,GAA6B;IACtD,IAAIA,IAAIoH,IAAI,KAAK,SAAS,OAAO;IACjC,OAAO;QACL2E,UAAUC,kBAAkBhM,IAAIqH,MAAM,CAAC0E,QAAQ;QAC/CE,OAAOD,kBAAkBhM,IAAIqH,MAAM,CAAC4E,KAAK;QACzCC,UAAUF,kBAAkBhM,IAAIqH,MAAM,CAAC6E,QAAQ;IACjD;AACF;AAEA,SAASF,kBAAkBV,KAAc;IACvC,OAAO,OAAOA,UAAU,YAAYA,MAAMa,IAAI,KAAKb,MAAMa,IAAI,KAAK;AACpE"}
|
|
@@ -49,10 +49,10 @@ function ProjectWorkflowsPageInner({ projectId }) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
return /*#__PURE__*/ _jsxs("div", {
|
|
52
|
-
className: "flex w-full flex-col gap-
|
|
52
|
+
className: "flex w-full flex-col gap-section",
|
|
53
53
|
children: [
|
|
54
54
|
projectQuery.isPending ? /*#__PURE__*/ _jsxs("div", {
|
|
55
|
-
className: "flex flex-col gap-
|
|
55
|
+
className: "flex flex-col gap-cluster",
|
|
56
56
|
children: [
|
|
57
57
|
/*#__PURE__*/ _jsx(Skeleton, {
|
|
58
58
|
className: "h-28 w-1/3"
|
|
@@ -73,7 +73,7 @@ function ProjectWorkflowsPageInner({ projectId }) {
|
|
|
73
73
|
projectQuery.data ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
74
74
|
children: [
|
|
75
75
|
/*#__PURE__*/ _jsxs("header", {
|
|
76
|
-
className: "flex flex-col gap-
|
|
76
|
+
className: "flex flex-col gap-tight",
|
|
77
77
|
children: [
|
|
78
78
|
/*#__PURE__*/ _jsx(Header, {
|
|
79
79
|
variant: "h2",
|
|
@@ -129,7 +129,7 @@ function ProjectWorkflowsPageInner({ projectId }) {
|
|
|
129
129
|
function WorkflowDefinitionsList({ definitions, isPending, isError, sync, runError, runningDefinitionId, hasNextPage, isFetchingNextPage, isFetchNextPageError, onRetry, onLoadMore, onOpenDefinition, onRun }) {
|
|
130
130
|
if (isPending) {
|
|
131
131
|
return /*#__PURE__*/ _jsxs("div", {
|
|
132
|
-
className: "flex flex-col gap-
|
|
132
|
+
className: "flex flex-col gap-inline",
|
|
133
133
|
children: [
|
|
134
134
|
/*#__PURE__*/ _jsx(Skeleton, {
|
|
135
135
|
className: "h-40 w-full"
|
|
@@ -205,12 +205,12 @@ function WorkflowDefinitionsList({ definitions, isPending, isError, sync, runErr
|
|
|
205
205
|
/*#__PURE__*/ _jsx(TableCell, {
|
|
206
206
|
className: "max-w-260",
|
|
207
207
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
208
|
-
className: "flex min-w-0 flex-col gap-
|
|
208
|
+
className: "flex min-w-0 flex-col gap-tight",
|
|
209
209
|
children: [
|
|
210
210
|
/*#__PURE__*/ _jsxs("button", {
|
|
211
211
|
type: "button",
|
|
212
212
|
onClick: ()=>onOpenDefinition(definition),
|
|
213
|
-
className: "flex min-w-0 flex-col gap-
|
|
213
|
+
className: "flex min-w-0 flex-col gap-tight text-left outline-none focus-visible:shadow-border-interactive-with-active rounded-4",
|
|
214
214
|
children: [
|
|
215
215
|
/*#__PURE__*/ _jsx(Text, {
|
|
216
216
|
size: "sm",
|
|
@@ -262,11 +262,11 @@ function WorkflowDefinitionsList({ definitions, isPending, isError, sync, runErr
|
|
|
262
262
|
const runErrorMessage = runError?.definitionId === definition.id ? runError.message : null;
|
|
263
263
|
const isRunning = runningDefinitionId === definition.id;
|
|
264
264
|
return /*#__PURE__*/ _jsxs("div", {
|
|
265
|
-
className: "flex flex-col gap-
|
|
265
|
+
className: "flex flex-col gap-inline border-b border-border-neutral-base p-panel-compact last:border-b-0",
|
|
266
266
|
children: [
|
|
267
267
|
/*#__PURE__*/ _jsxs("button", {
|
|
268
268
|
type: "button",
|
|
269
|
-
className: "flex min-w-0 items-start gap-
|
|
269
|
+
className: "flex min-w-0 items-start gap-inline text-left",
|
|
270
270
|
onClick: ()=>onOpenDefinition(definition),
|
|
271
271
|
children: [
|
|
272
272
|
/*#__PURE__*/ _jsx(Icon, {
|
|
@@ -275,7 +275,7 @@ function WorkflowDefinitionsList({ definitions, isPending, isError, sync, runErr
|
|
|
275
275
|
"aria-hidden": "true"
|
|
276
276
|
}),
|
|
277
277
|
/*#__PURE__*/ _jsxs("div", {
|
|
278
|
-
className: "flex min-w-0 flex-col gap-
|
|
278
|
+
className: "flex min-w-0 flex-col gap-tight",
|
|
279
279
|
children: [
|
|
280
280
|
/*#__PURE__*/ _jsx(Text, {
|
|
281
281
|
size: "sm",
|
|
@@ -292,7 +292,7 @@ function WorkflowDefinitionsList({ definitions, isPending, isError, sync, runErr
|
|
|
292
292
|
]
|
|
293
293
|
}),
|
|
294
294
|
/*#__PURE__*/ _jsxs("div", {
|
|
295
|
-
className: "flex items-center justify-between gap-
|
|
295
|
+
className: "flex items-center justify-between gap-inline",
|
|
296
296
|
children: [
|
|
297
297
|
/*#__PURE__*/ _jsxs(Text, {
|
|
298
298
|
size: "xs",
|
|
@@ -325,7 +325,7 @@ function WorkflowDefinitionsList({ definitions, isPending, isError, sync, runErr
|
|
|
325
325
|
role: "alert",
|
|
326
326
|
type: "error",
|
|
327
327
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
328
|
-
className: "flex items-center justify-between gap-
|
|
328
|
+
className: "flex items-center justify-between gap-cluster",
|
|
329
329
|
children: [
|
|
330
330
|
/*#__PURE__*/ _jsx(Text, {
|
|
331
331
|
size: "sm",
|
|
@@ -370,7 +370,7 @@ function WorkflowSyncAlert({ sync }) {
|
|
|
370
370
|
role: "alert",
|
|
371
371
|
type: "error",
|
|
372
372
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
373
|
-
className: "flex flex-col gap-
|
|
373
|
+
className: "flex flex-col gap-tight",
|
|
374
374
|
children: [
|
|
375
375
|
/*#__PURE__*/ _jsx(Text, {
|
|
376
376
|
size: "sm",
|
|
@@ -401,7 +401,7 @@ function WorkflowSyncWarnings({ sync }) {
|
|
|
401
401
|
role: "status",
|
|
402
402
|
type: "warning",
|
|
403
403
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
404
|
-
className: "flex flex-col gap-
|
|
404
|
+
className: "flex flex-col gap-inline",
|
|
405
405
|
children: [
|
|
406
406
|
/*#__PURE__*/ _jsx(Text, {
|
|
407
407
|
size: "sm",
|
|
@@ -409,7 +409,7 @@ function WorkflowSyncWarnings({ sync }) {
|
|
|
409
409
|
children: "Workflow definition warnings"
|
|
410
410
|
}),
|
|
411
411
|
/*#__PURE__*/ _jsx("ul", {
|
|
412
|
-
className: "flex flex-col gap-
|
|
412
|
+
className: "flex flex-col gap-tight",
|
|
413
413
|
children: warningItems.map(({ key, warning })=>/*#__PURE__*/ _jsxs("li", {
|
|
414
414
|
children: [
|
|
415
415
|
/*#__PURE__*/ _jsx(Text, {
|
|
@@ -450,10 +450,10 @@ function DefinitionSheet({ definition, onOpenChange }) {
|
|
|
450
450
|
]
|
|
451
451
|
}),
|
|
452
452
|
/*#__PURE__*/ _jsxs(SheetBody, {
|
|
453
|
-
className: "gap-
|
|
453
|
+
className: "gap-group",
|
|
454
454
|
children: [
|
|
455
455
|
/*#__PURE__*/ _jsxs("div", {
|
|
456
|
-
className: "grid w-full gap-
|
|
456
|
+
className: "grid w-full gap-inline",
|
|
457
457
|
children: [
|
|
458
458
|
/*#__PURE__*/ _jsx(Metadata, {
|
|
459
459
|
label: "Definition id",
|
|
@@ -474,7 +474,7 @@ function DefinitionSheet({ definition, onOpenChange }) {
|
|
|
474
474
|
]
|
|
475
475
|
}),
|
|
476
476
|
/*#__PURE__*/ _jsxs("div", {
|
|
477
|
-
className: "flex w-full flex-col gap-
|
|
477
|
+
className: "flex w-full flex-col gap-inline",
|
|
478
478
|
children: [
|
|
479
479
|
/*#__PURE__*/ _jsx(Text, {
|
|
480
480
|
size: "sm",
|
|
@@ -482,7 +482,7 @@ function DefinitionSheet({ definition, onOpenChange }) {
|
|
|
482
482
|
children: "Normalized definition"
|
|
483
483
|
}),
|
|
484
484
|
/*#__PURE__*/ _jsx("pre", {
|
|
485
|
-
className: "max-h-[52vh] w-full overflow-auto rounded-8 border border-border-neutral-base bg-background-neutral-subtle p-
|
|
485
|
+
className: "max-h-[52vh] w-full overflow-auto rounded-8 border border-border-neutral-base bg-background-neutral-subtle p-panel-compact scrollbar",
|
|
486
486
|
children: /*#__PURE__*/ _jsx(Code, {
|
|
487
487
|
as: "code",
|
|
488
488
|
className: "whitespace-pre text-foreground-neutral-base",
|
|
@@ -500,7 +500,7 @@ function DefinitionSheet({ definition, onOpenChange }) {
|
|
|
500
500
|
}
|
|
501
501
|
function Metadata({ label, value }) {
|
|
502
502
|
return /*#__PURE__*/ _jsxs("div", {
|
|
503
|
-
className: "min-w-0 py-
|
|
503
|
+
className: "min-w-0 py-row first:pt-0 last:pb-0",
|
|
504
504
|
children: [
|
|
505
505
|
/*#__PURE__*/ _jsx(Text, {
|
|
506
506
|
size: "xs",
|