@outputai/cli 0.10.1-dev.b7b2fbe.0 → 0.10.1-next.09ed166.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/dist/api/generated/api.d.ts +12 -0
- package/dist/assets/docker/docker-compose-dev.yml +1 -1
- package/dist/commands/workflow/history.js +3 -3
- package/dist/commands/workflow/history.spec.js +31 -2
- package/dist/commands/workflow/monitor.d.ts +49 -0
- package/dist/commands/workflow/monitor.js +230 -0
- package/dist/commands/workflow/monitor.spec.d.ts +1 -0
- package/dist/commands/workflow/monitor.spec.js +243 -0
- package/dist/generated/framework_version.json +1 -1
- package/dist/services/workflow_history/correlator.d.ts +2 -0
- package/dist/services/workflow_history/correlator.js +2 -2
- package/dist/services/workflow_history.d.ts +28 -0
- package/dist/services/workflow_history.js +95 -12
- package/dist/services/workflow_history.spec.js +183 -1
- package/dist/utils/color.d.ts +7 -0
- package/dist/utils/color.js +12 -0
- package/dist/utils/color.spec.d.ts +1 -0
- package/dist/utils/color.spec.js +43 -0
- package/dist/utils/format_workflow_result.d.ts +1 -0
- package/dist/utils/format_workflow_result.js +4 -0
- package/dist/utils/monitor_log.d.ts +20 -0
- package/dist/utils/monitor_log.js +48 -0
- package/dist/utils/monitor_log.spec.d.ts +1 -0
- package/dist/utils/monitor_log.spec.js +71 -0
- package/dist/utils/waterfall.d.ts +3 -1
- package/dist/utils/waterfall.js +8 -2
- package/dist/views/dev/hooks/use_run_detail.js +4 -7
- package/oclif.manifest.json +75 -1
- package/package.json +4 -4
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Atlas's `StepGantt`; the bar geometry mirrors its leftPct/widthPct as integer
|
|
9
9
|
* terminal columns.
|
|
10
10
|
*/
|
|
11
|
-
import type { Span } from '#services/workflow_history/correlator.js';
|
|
11
|
+
import type { Span, SpanStatus } from '#services/workflow_history/correlator.js';
|
|
12
12
|
export interface WaterfallOptions {
|
|
13
13
|
width: number;
|
|
14
14
|
color: boolean;
|
|
@@ -22,6 +22,8 @@ export interface BarGeometry {
|
|
|
22
22
|
}
|
|
23
23
|
export declare const FULL_BLOCK = "\u2588";
|
|
24
24
|
export declare const THIN_BLOCK = "\u258F";
|
|
25
|
+
export declare const ANSI: Record<SpanStatus | 'dim' | 'reset', string>;
|
|
26
|
+
export declare function makeTint(color: boolean): (text: string, code: string) => string;
|
|
25
27
|
export declare function pickTickStep(totalMs: number): number;
|
|
26
28
|
export declare function buildTicks(totalMs: number): number[];
|
|
27
29
|
export declare function formatTickLabel(ms: number): string;
|
package/dist/utils/waterfall.js
CHANGED
|
@@ -12,7 +12,7 @@ const TICK_STEPS_MS = [
|
|
|
12
12
|
60 * 60_000, 2 * 60 * 60_000, 6 * 60 * 60_000, 12 * 60 * 60_000, 24 * 60 * 60_000
|
|
13
13
|
];
|
|
14
14
|
const TARGET_TICKS = 8;
|
|
15
|
-
const ANSI = {
|
|
15
|
+
export const ANSI = {
|
|
16
16
|
completed: '[92m',
|
|
17
17
|
running: '[33m',
|
|
18
18
|
failed: '[31m',
|
|
@@ -20,6 +20,12 @@ const ANSI = {
|
|
|
20
20
|
dim: '[2m',
|
|
21
21
|
reset: '[0m'
|
|
22
22
|
};
|
|
23
|
+
// Shared by renderWaterfall and monitor_log's live status lines so there's one
|
|
24
|
+
// place that knows how to wrap text in an ANSI code (and reset it) -- or not,
|
|
25
|
+
// when color is disabled.
|
|
26
|
+
export function makeTint(color) {
|
|
27
|
+
return (text, code) => (color ? `${code}${text}${ANSI.reset}` : text);
|
|
28
|
+
}
|
|
23
29
|
function clamp(value, lo, hi) {
|
|
24
30
|
return Math.min(Math.max(value, lo), hi);
|
|
25
31
|
}
|
|
@@ -162,7 +168,7 @@ export default function renderWaterfall(spans, totalDurationMs, options) {
|
|
|
162
168
|
if (spans.length === 0) {
|
|
163
169
|
return [header, 'No steps found for this run.'].filter(Boolean).join('\n\n');
|
|
164
170
|
}
|
|
165
|
-
const tint = (
|
|
171
|
+
const tint = makeTint(color);
|
|
166
172
|
const labelFor = (span) => labels?.get(span.id) ?? span.name;
|
|
167
173
|
const durationFor = (span) => formatDurationLabel(Math.max(0, span.durationMs));
|
|
168
174
|
const longestLabel = Math.max(...spans.map(s => labelFor(s).length));
|
|
@@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { getWorkflowIdResult, getWorkflowIdRunsRidResult, getWorkflowIdTraceLog, getWorkflowIdRunsRidTraceLog } from '#api/generated/api.js';
|
|
4
4
|
import { normalizeWorkflowStatus } from '#utils/normalize_workflow_status.js';
|
|
5
|
+
import { TERMINAL_STATUSES } from '#utils/format_workflow_result.js';
|
|
5
6
|
const EMPTY_DETAIL = {
|
|
6
7
|
result: null,
|
|
7
8
|
trace: null,
|
|
@@ -99,13 +100,9 @@ const fetchResult = async (workflowId, runId) => {
|
|
|
99
100
|
return null;
|
|
100
101
|
}
|
|
101
102
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
* running workflow would otherwise stick and stall the UI when the run
|
|
106
|
-
* eventually finishes.
|
|
107
|
-
*/
|
|
108
|
-
const TERMINAL_STATUSES = new Set(['completed', 'failed', 'canceled', 'terminated', 'timed_out']);
|
|
103
|
+
// The cache is intentionally only populated for terminal statuses — partial results
|
|
104
|
+
// from a still-running workflow would otherwise stick and stall the UI when the run
|
|
105
|
+
// eventually finishes. `TERMINAL_STATUSES` is shared with `workflow monitor`.
|
|
109
106
|
export const isTerminalRunStatus = (status) => Boolean(status && TERMINAL_STATUSES.has(status));
|
|
110
107
|
export const useRunDetail = (workflowId, runId, status) => {
|
|
111
108
|
const [detail, setDetail] = useState(EMPTY_DETAIL);
|
package/oclif.manifest.json
CHANGED
|
@@ -905,6 +905,80 @@
|
|
|
905
905
|
"list.js"
|
|
906
906
|
]
|
|
907
907
|
},
|
|
908
|
+
"workflow:monitor": {
|
|
909
|
+
"aliases": [],
|
|
910
|
+
"args": {
|
|
911
|
+
"workflowId": {
|
|
912
|
+
"description": "The workflow ID to monitor",
|
|
913
|
+
"name": "workflowId",
|
|
914
|
+
"required": true
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
"description": "Attach to a workflow run and stream status updates until it ends",
|
|
918
|
+
"examples": [
|
|
919
|
+
"<%= config.bin %> <%= command.id %> wf-12345",
|
|
920
|
+
"<%= config.bin %> <%= command.id %> wf-12345 --run-id 2fe0b36b-...",
|
|
921
|
+
"<%= config.bin %> <%= command.id %> wf-12345 --format json"
|
|
922
|
+
],
|
|
923
|
+
"flags": {
|
|
924
|
+
"run-id": {
|
|
925
|
+
"char": "r",
|
|
926
|
+
"description": "Monitor a specific run (defaults to the latest run; continue-as-new chains are followed regardless)",
|
|
927
|
+
"name": "run-id",
|
|
928
|
+
"hasDynamicHelp": false,
|
|
929
|
+
"multiple": false,
|
|
930
|
+
"type": "option"
|
|
931
|
+
},
|
|
932
|
+
"format": {
|
|
933
|
+
"char": "f",
|
|
934
|
+
"description": "Output format",
|
|
935
|
+
"name": "format",
|
|
936
|
+
"default": "text",
|
|
937
|
+
"hasDynamicHelp": false,
|
|
938
|
+
"multiple": false,
|
|
939
|
+
"options": [
|
|
940
|
+
"text",
|
|
941
|
+
"json"
|
|
942
|
+
],
|
|
943
|
+
"type": "option"
|
|
944
|
+
},
|
|
945
|
+
"include-payloads": {
|
|
946
|
+
"description": "Include decoded step input/output payloads",
|
|
947
|
+
"name": "include-payloads",
|
|
948
|
+
"allowNo": false,
|
|
949
|
+
"type": "boolean"
|
|
950
|
+
},
|
|
951
|
+
"interval": {
|
|
952
|
+
"description": "Poll interval in milliseconds. Once a resumed poll is long-polling server-side for new events, this also bounds how long that block may last (capped at the server's configured max), so an idle workflow's update cadence is roughly twice this value (the long-poll bound, then this sleep) rather than a much longer, separate server default.",
|
|
953
|
+
"name": "interval",
|
|
954
|
+
"default": 2500,
|
|
955
|
+
"hasDynamicHelp": false,
|
|
956
|
+
"multiple": false,
|
|
957
|
+
"type": "option"
|
|
958
|
+
},
|
|
959
|
+
"color": {
|
|
960
|
+
"description": "Colorize status output (use --no-color to disable)",
|
|
961
|
+
"name": "color",
|
|
962
|
+
"allowNo": true,
|
|
963
|
+
"type": "boolean"
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
"hasDynamicHelp": false,
|
|
967
|
+
"hiddenAliases": [],
|
|
968
|
+
"id": "workflow:monitor",
|
|
969
|
+
"pluginAlias": "@outputai/cli",
|
|
970
|
+
"pluginName": "@outputai/cli",
|
|
971
|
+
"pluginType": "core",
|
|
972
|
+
"strict": true,
|
|
973
|
+
"enableJsonFlag": false,
|
|
974
|
+
"isESM": true,
|
|
975
|
+
"relativePath": [
|
|
976
|
+
"dist",
|
|
977
|
+
"commands",
|
|
978
|
+
"workflow",
|
|
979
|
+
"monitor.js"
|
|
980
|
+
]
|
|
981
|
+
},
|
|
908
982
|
"workflow:plan": {
|
|
909
983
|
"aliases": [],
|
|
910
984
|
"args": {},
|
|
@@ -1597,5 +1671,5 @@
|
|
|
1597
1671
|
]
|
|
1598
1672
|
}
|
|
1599
1673
|
},
|
|
1600
|
-
"version": "0.10.1-
|
|
1674
|
+
"version": "0.10.1-next.09ed166.0"
|
|
1601
1675
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outputai/cli",
|
|
3
|
-
"version": "0.10.1-
|
|
3
|
+
"version": "0.10.1-next.09ed166.0",
|
|
4
4
|
"description": "CLI for Output.ai workflow generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"semver": "7.7.4",
|
|
39
39
|
"undici": "8.5.0",
|
|
40
40
|
"yaml": "^2.8.3",
|
|
41
|
-
"@outputai/credentials": "0.10.1-
|
|
42
|
-
"@outputai/
|
|
43
|
-
"@outputai/
|
|
41
|
+
"@outputai/credentials": "0.10.1-next.09ed166.0",
|
|
42
|
+
"@outputai/llm": "0.10.1-next.09ed166.0",
|
|
43
|
+
"@outputai/evals": "0.10.1-next.09ed166.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/cli-progress": "3.11.6",
|