@outputai/cli 0.10.1-next.3d1f9bd.0 → 0.10.1-next.442c500.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.
Files changed (51) hide show
  1. package/dist/api/generated/api.d.ts +81 -26
  2. package/dist/api/generated/api.js +7 -4
  3. package/dist/assets/docker/docker-compose-dev.yml +2 -2
  4. package/dist/commands/workflow/monitor.d.ts +5 -20
  5. package/dist/commands/workflow/monitor.js +20 -182
  6. package/dist/commands/workflow/monitor.spec.js +82 -3
  7. package/dist/commands/workflow/result.js +2 -2
  8. package/dist/commands/workflow/result.spec.js +65 -1
  9. package/dist/commands/workflow/run.js +10 -3
  10. package/dist/commands/workflow/run.spec.js +42 -5
  11. package/dist/commands/workflow/start.d.ts +7 -1
  12. package/dist/commands/workflow/start.js +107 -12
  13. package/dist/commands/workflow/start.spec.js +282 -5
  14. package/dist/commands/workflow/status.spec.js +1 -1
  15. package/dist/commands/workflow/{test_eval.d.ts → test.d.ts} +0 -1
  16. package/dist/commands/workflow/{test_eval.js → test.js} +0 -1
  17. package/dist/commands/workflow/{test_eval.spec.js → test.spec.js} +4 -4
  18. package/dist/generated/framework_version.json +1 -1
  19. package/dist/services/monitor_stream.d.ts +62 -0
  20. package/dist/services/monitor_stream.js +285 -0
  21. package/dist/services/monitor_stream.spec.d.ts +1 -0
  22. package/dist/services/monitor_stream.spec.js +285 -0
  23. package/dist/services/workflow_history.js +2 -2
  24. package/dist/templates/agent_instructions/CLAUDE.md.template +4 -2
  25. package/dist/templates/project/README.md.template +3 -1
  26. package/dist/templates/project/package.json.template +2 -2
  27. package/dist/utils/env_loader.js +6 -2
  28. package/dist/utils/env_loader.spec.js +61 -32
  29. package/dist/utils/error_handler.d.ts +10 -0
  30. package/dist/utils/error_handler.js +14 -0
  31. package/dist/utils/error_handler.spec.d.ts +1 -0
  32. package/dist/utils/error_handler.spec.js +62 -0
  33. package/dist/utils/format_workflow_result.d.ts +15 -3
  34. package/dist/utils/format_workflow_result.js +39 -6
  35. package/dist/utils/format_workflow_result.spec.js +39 -6
  36. package/dist/utils/monitor_flags.d.ts +35 -0
  37. package/dist/utils/monitor_flags.js +76 -0
  38. package/dist/utils/normalize_workflow_status.d.ts +4 -3
  39. package/dist/utils/normalize_workflow_status.js +12 -3
  40. package/dist/utils/normalize_workflow_status.spec.js +3 -0
  41. package/dist/utils/resolve_input.d.ts +9 -1
  42. package/dist/utils/resolve_input.js +8 -2
  43. package/dist/utils/resolve_input.spec.d.ts +1 -0
  44. package/dist/utils/resolve_input.spec.js +75 -0
  45. package/dist/views/dev/components/workflow_status.js +1 -1
  46. package/dist/views/dev/hooks/use_run_detail.js +4 -4
  47. package/dist/views/dev/hooks/use_run_detail.spec.js +1 -1
  48. package/dist/views/dev/panels/runs_panel.js +2 -2
  49. package/oclif.manifest.json +54 -9
  50. package/package.json +6 -8
  51. /package/dist/commands/workflow/{test_eval.spec.d.ts → test.spec.d.ts} +0 -0
@@ -4,7 +4,7 @@ const WORKFLOW_STATUS_MAP = {
4
4
  running: { icon: '●', color: 'yellow' },
5
5
  completed: { icon: '●', color: 'green' },
6
6
  failed: { icon: '✗', color: 'red' },
7
- canceled: { icon: '○', color: 'gray' },
7
+ cancelled: { icon: '○', color: 'gray' },
8
8
  terminated: { icon: '✗', color: 'gray' },
9
9
  timed_out: { icon: '✗', color: 'red' },
10
10
  continued_as_new: { icon: '↻', color: 'blue' }
@@ -2,7 +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
+ import { isTerminalStatus } from '#utils/format_workflow_result.js';
6
6
  import { createBoundedCache } from '#views/dev/utils/bounded_cache.js';
7
7
  const EMPTY_DETAIL = {
8
8
  result: null,
@@ -73,7 +73,7 @@ const readTraceLog = async (source) => {
73
73
  return JSON.parse(content);
74
74
  };
75
75
  // Run detail and trace fetches are best-effort. Many statuses (in-progress,
76
- // failed, canceled) don't have a fully-formed result or trace available at
76
+ // failed, cancelled) don't have a fully-formed result or trace available at
77
77
  // any given moment, and that's expected — the caller falls back to
78
78
  // EMPTY_DETAIL and the UI renders whatever's there. Swallow everything.
79
79
  const fetchTrace = async (workflowId, runId) => {
@@ -104,8 +104,8 @@ const fetchResult = async (workflowId, runId) => {
104
104
  };
105
105
  // The cache is intentionally only populated for terminal statuses — partial results
106
106
  // from a still-running workflow would otherwise stick and stall the UI when the run
107
- // eventually finishes. `TERMINAL_STATUSES` is shared with `workflow monitor`.
108
- export const isTerminalRunStatus = (status) => Boolean(status && TERMINAL_STATUSES.has(status));
107
+ // eventually finishes. `isTerminalStatus` is shared with `workflow monitor`.
108
+ export const isTerminalRunStatus = (status) => isTerminalStatus(status) !== undefined;
109
109
  export const useRunDetail = (workflowId, runId, status) => {
110
110
  const [detail, setDetail] = useState(EMPTY_DETAIL);
111
111
  const fetchIdRef = useRef(0);
@@ -4,7 +4,7 @@ describe('isTerminalRunStatus', () => {
4
4
  it('returns true for completed states', () => {
5
5
  expect(isTerminalRunStatus('completed')).toBe(true);
6
6
  expect(isTerminalRunStatus('failed')).toBe(true);
7
- expect(isTerminalRunStatus('canceled')).toBe(true);
7
+ expect(isTerminalRunStatus('cancelled')).toBe(true);
8
8
  expect(isTerminalRunStatus('terminated')).toBe(true);
9
9
  expect(isTerminalRunStatus('timed_out')).toBe(true);
10
10
  });
@@ -21,7 +21,7 @@ const STATUS_ORDER = {
21
21
  failed: 1,
22
22
  timed_out: 2,
23
23
  terminated: 3,
24
- canceled: 4,
24
+ cancelled: 4,
25
25
  continued_as_new: 5,
26
26
  completed: 6
27
27
  };
@@ -110,7 +110,7 @@ const DetailPane = ({ run, pane, rows }) => {
110
110
  }
111
111
  return _jsx(Text, { dimColor: true, children: "\u2014" });
112
112
  }
113
- if (activePane === 'output' && hasJsonValue(pane.error)) {
113
+ if (activePane === 'output' && typeof pane.error === 'string') {
114
114
  const lines = String(pane.error).split('\n').slice(0, tabContentRows);
115
115
  return (_jsx(Box, { flexDirection: "column", children: lines.map((line, i) => (_jsx(Text, { color: "red", wrap: "truncate-end", children: line }, i))) }));
116
116
  }
@@ -1236,9 +1236,18 @@
1236
1236
  "<%= config.bin %> <%= command.id %> simple basic_input",
1237
1237
  "<%= config.bin %> <%= command.id %> simple --input '{\"values\":[1,2,3]}'",
1238
1238
  "<%= config.bin %> <%= command.id %> simple --input input.json",
1239
- "<%= config.bin %> <%= command.id %> simple --input '{\"key\":\"value\"}' --catalog my-catalog"
1239
+ "<%= config.bin %> <%= command.id %> simple --input input.json --monitor",
1240
+ "<%= config.bin %> <%= command.id %> simple --input '{\"key\":\"value\"}' --catalog my-catalog",
1241
+ "<%= config.bin %> <%= command.id %> simple --json"
1240
1242
  ],
1241
1243
  "flags": {
1244
+ "json": {
1245
+ "description": "Format output as json.",
1246
+ "helpGroup": "GLOBAL",
1247
+ "name": "json",
1248
+ "allowNo": false,
1249
+ "type": "boolean"
1250
+ },
1242
1251
  "input": {
1243
1252
  "char": "i",
1244
1253
  "description": "Workflow input as JSON string or file path (overrides scenario)",
@@ -1263,6 +1272,44 @@
1263
1272
  "hasDynamicHelp": false,
1264
1273
  "multiple": false,
1265
1274
  "type": "option"
1275
+ },
1276
+ "monitor": {
1277
+ "char": "m",
1278
+ "description": "After starting, attach and stream status updates until the workflow ends (Ctrl+C detaches; the workflow keeps running). Cannot be combined with --json",
1279
+ "name": "monitor",
1280
+ "allowNo": false,
1281
+ "type": "boolean"
1282
+ },
1283
+ "include-payloads": {
1284
+ "dependsOn": [
1285
+ "monitor"
1286
+ ],
1287
+ "description": "Include decoded step input/output payloads (requires --monitor)",
1288
+ "helpGroup": "MONITOR",
1289
+ "name": "include-payloads",
1290
+ "allowNo": false,
1291
+ "type": "boolean"
1292
+ },
1293
+ "interval": {
1294
+ "dependsOn": [
1295
+ "monitor"
1296
+ ],
1297
+ "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. (requires --monitor) [default: 2500]",
1298
+ "helpGroup": "MONITOR",
1299
+ "name": "interval",
1300
+ "hasDynamicHelp": false,
1301
+ "multiple": false,
1302
+ "type": "option"
1303
+ },
1304
+ "color": {
1305
+ "dependsOn": [
1306
+ "monitor"
1307
+ ],
1308
+ "description": "Colorize status output (use --no-color to disable) (requires --monitor)",
1309
+ "helpGroup": "MONITOR",
1310
+ "name": "color",
1311
+ "allowNo": true,
1312
+ "type": "boolean"
1266
1313
  }
1267
1314
  },
1268
1315
  "hasDynamicHelp": false,
@@ -1272,7 +1319,7 @@
1272
1319
  "pluginName": "@outputai/cli",
1273
1320
  "pluginType": "core",
1274
1321
  "strict": true,
1275
- "enableJsonFlag": false,
1322
+ "enableJsonFlag": true,
1276
1323
  "isESM": true,
1277
1324
  "relativePath": [
1278
1325
  "dist",
@@ -1390,10 +1437,8 @@
1390
1437
  "terminate.js"
1391
1438
  ]
1392
1439
  },
1393
- "workflow:test_eval": {
1394
- "aliases": [
1395
- "workflow:test"
1396
- ],
1440
+ "workflow:test": {
1441
+ "aliases": [],
1397
1442
  "args": {
1398
1443
  "workflowName": {
1399
1444
  "description": "Name of the workflow to test",
@@ -1462,7 +1507,7 @@
1462
1507
  },
1463
1508
  "hasDynamicHelp": false,
1464
1509
  "hiddenAliases": [],
1465
- "id": "workflow:test_eval",
1510
+ "id": "workflow:test",
1466
1511
  "pluginAlias": "@outputai/cli",
1467
1512
  "pluginName": "@outputai/cli",
1468
1513
  "pluginType": "core",
@@ -1473,7 +1518,7 @@
1473
1518
  "dist",
1474
1519
  "commands",
1475
1520
  "workflow",
1476
- "test_eval.js"
1521
+ "test.js"
1477
1522
  ]
1478
1523
  },
1479
1524
  "workflow:dataset:generate": {
@@ -1707,5 +1752,5 @@
1707
1752
  ]
1708
1753
  }
1709
1754
  },
1710
- "version": "0.10.1-next.3d1f9bd.0"
1755
+ "version": "0.10.1-next.442c500.0"
1711
1756
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outputai/cli",
3
- "version": "0.10.1-next.3d1f9bd.0",
3
+ "version": "0.10.1-next.442c500.0",
4
4
  "description": "CLI for Output.ai workflow generation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -27,20 +27,18 @@
27
27
  "cli-table3": "0.6.5",
28
28
  "date-fns": "4.1.0",
29
29
  "debug": "4.4.3",
30
- "dotenv": "17.4.2",
31
30
  "handlebars": "4.7.9",
32
31
  "ink": "7.0.1",
33
32
  "ink-spinner": "5.0.0",
34
- "js-yaml": "4.1.1",
33
+ "js-yaml": "4.3.1",
35
34
  "json-schema-library": "11.4.0",
36
35
  "ky": "2.0.2",
37
36
  "react": "19.2.5",
38
37
  "semver": "7.7.4",
39
- "undici": "8.5.0",
40
- "yaml": "^2.8.3",
41
- "@outputai/credentials": "0.10.1-next.3d1f9bd.0",
42
- "@outputai/evals": "0.10.1-next.3d1f9bd.0",
43
- "@outputai/llm": "0.10.1-next.3d1f9bd.0"
38
+ "undici": "8.9.0",
39
+ "@outputai/credentials": "0.10.1-next.442c500.0",
40
+ "@outputai/evals": "0.10.1-next.442c500.0",
41
+ "@outputai/llm": "0.10.1-next.442c500.0"
44
42
  },
45
43
  "devDependencies": {
46
44
  "@types/cli-progress": "3.11.6",