@outputai/cli 0.4.1-dev.622e67b.0 → 0.4.1-dev.7aa9a5f.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.
@@ -207,6 +207,16 @@ export interface WorkflowStatusResponse {
207
207
  /** An epoch timestamp representing when the workflow ended */
208
208
  completedAt?: number;
209
209
  }
210
+ export type WorkflowResultResponseAttributesItem = {
211
+ [key: string]: unknown;
212
+ };
213
+ /**
214
+ * Convenience totals derived from attributes
215
+ * @nullable
216
+ */
217
+ export type WorkflowResultResponseAggregations = {
218
+ [key: string]: unknown;
219
+ } | null;
210
220
  /**
211
221
  * The workflow execution status
212
222
  */
@@ -229,6 +239,16 @@ export interface WorkflowResultResponse {
229
239
  /** The result of workflow, null if workflow failed */
230
240
  output?: unknown;
231
241
  trace?: TraceInfo;
242
+ /**
243
+ * Durable workflow attributes collected during execution
244
+ * @nullable
245
+ */
246
+ attributes?: WorkflowResultResponseAttributesItem[] | null;
247
+ /**
248
+ * Convenience totals derived from attributes
249
+ * @nullable
250
+ */
251
+ aggregations?: WorkflowResultResponseAggregations;
232
252
  /** The workflow execution status */
233
253
  status?: WorkflowResultResponseStatus;
234
254
  /**
@@ -303,28 +323,6 @@ export type PostWorkflowRunBody = {
303
323
  /** (Optional) The max time to wait for the execution, defaults to 30s */
304
324
  timeout?: number;
305
325
  };
306
- /**
307
- * The workflow execution status
308
- */
309
- export type PostWorkflowRun200Status = typeof PostWorkflowRun200Status[keyof typeof PostWorkflowRun200Status];
310
- export declare const PostWorkflowRun200Status: {
311
- readonly completed: "completed";
312
- readonly failed: "failed";
313
- };
314
- export type PostWorkflowRun200 = {
315
- /** The workflow execution id */
316
- workflowId?: string;
317
- /** The output of the workflow, null if workflow failed */
318
- output?: unknown;
319
- trace?: TraceInfo;
320
- /** The workflow execution status */
321
- status?: PostWorkflowRun200Status;
322
- /**
323
- * Error message if workflow failed, null otherwise
324
- * @nullable
325
- */
326
- error?: string | null;
327
- };
328
326
  export type PostWorkflowStartBody = {
329
327
  /** The name of the workflow to execute */
330
328
  workflowName: string;
@@ -518,7 +516,7 @@ export declare const getHealth: (options?: ApiRequestOptions) => Promise<getHeal
518
516
  * @summary Execute a workflow synchronously
519
517
  */
520
518
  export type postWorkflowRunResponse200 = {
521
- data: PostWorkflowRun200;
519
+ data: WorkflowResultResponse;
522
520
  status: 200;
523
521
  };
524
522
  export type postWorkflowRunResponse400 = {
@@ -42,10 +42,6 @@ export const WorkflowResultResponseStatus = {
42
42
  timed_out: 'timed_out',
43
43
  continued: 'continued',
44
44
  };
45
- export const PostWorkflowRun200Status = {
46
- completed: 'completed',
47
- failed: 'failed',
48
- };
49
45
  ;
50
46
  export const getGetHealthUrl = () => {
51
47
  return `/health`;
@@ -77,7 +77,7 @@ services:
77
77
  condition: service_healthy
78
78
  worker:
79
79
  condition: service_healthy
80
- image: outputai/api:${OUTPUT_API_VERSION:-0.4.1-dev.622e67b.0}
80
+ image: outputai/api:${OUTPUT_API_VERSION:-0.4.1-dev.7aa9a5f.0}
81
81
  init: true
82
82
  networks:
83
83
  - main
@@ -1,3 +1,3 @@
1
1
  {
2
- "framework": "0.4.1-dev.622e67b.0"
2
+ "framework": "0.4.1-dev.7aa9a5f.0"
3
3
  }
@@ -71,11 +71,15 @@ describe('formatWorkflowResult', () => {
71
71
  workflowId: 'wf-456',
72
72
  status: 'failed',
73
73
  output: null,
74
+ attributes: [{ type: 'llm:usage', total: 0.4 }],
75
+ aggregations: { cost: { total: 0.4 }, tokens: { total: 20 }, httpRequests: { total: 0 } },
74
76
  error: 'Activity task failed'
75
77
  };
76
78
  const output = formatOutput(data, 'json', formatWorkflowResult);
77
79
  const parsed = JSON.parse(output);
78
80
  expect(parsed.status).toBe('failed');
81
+ expect(parsed.attributes).toEqual([{ type: 'llm:usage', total: 0.4 }]);
82
+ expect(parsed.aggregations).toEqual({ cost: { total: 0.4 }, tokens: { total: 20 }, httpRequests: { total: 0 } });
79
83
  expect(parsed.error).toBe('Activity task failed');
80
84
  });
81
85
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outputai/cli",
3
- "version": "0.4.1-dev.622e67b.0",
3
+ "version": "0.4.1-dev.7aa9a5f.0",
4
4
  "description": "CLI for Output.ai workflow generation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -36,9 +36,9 @@
36
36
  "semver": "7.7.4",
37
37
  "undici": "8.1.0",
38
38
  "yaml": "^2.8.3",
39
- "@outputai/credentials": "0.4.1-dev.622e67b.0",
40
- "@outputai/evals": "0.4.1-dev.622e67b.0",
41
- "@outputai/llm": "0.4.1-dev.622e67b.0"
39
+ "@outputai/credentials": "0.4.1-dev.7aa9a5f.0",
40
+ "@outputai/llm": "0.4.1-dev.7aa9a5f.0",
41
+ "@outputai/evals": "0.4.1-dev.7aa9a5f.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/cli-progress": "3.11.6",