@output.ai/cli 0.7.15 → 0.8.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.
@@ -155,12 +155,27 @@ export type PostWorkflowRunBody = {
155
155
  /** (Optional) The max time to wait for the execution, defaults to 30s */
156
156
  timeout?: number;
157
157
  };
158
+ /**
159
+ * The workflow execution status
160
+ */
161
+ export type PostWorkflowRun200Status = typeof PostWorkflowRun200Status[keyof typeof PostWorkflowRun200Status];
162
+ export declare const PostWorkflowRun200Status: {
163
+ readonly completed: "completed";
164
+ readonly failed: "failed";
165
+ };
158
166
  export type PostWorkflowRun200 = {
159
167
  /** The workflow execution id */
160
168
  workflowId?: string;
161
- /** The output of the workflow */
169
+ /** The output of the workflow, null if workflow failed */
162
170
  output?: unknown;
163
171
  trace?: TraceInfo;
172
+ /** The workflow execution status */
173
+ status?: PostWorkflowRun200Status;
174
+ /**
175
+ * Error message if workflow failed, null otherwise
176
+ * @nullable
177
+ */
178
+ error?: string | null;
164
179
  };
165
180
  export type PostWorkflowStartBody = {
166
181
  /** The name of the workflow to execute */
@@ -208,12 +223,31 @@ export type PostWorkflowIdTerminate200 = {
208
223
  terminated?: boolean;
209
224
  workflowId?: string;
210
225
  };
226
+ /**
227
+ * The workflow execution status
228
+ */
229
+ export type GetWorkflowIdResult200Status = typeof GetWorkflowIdResult200Status[keyof typeof GetWorkflowIdResult200Status];
230
+ export declare const GetWorkflowIdResult200Status: {
231
+ readonly completed: "completed";
232
+ readonly failed: "failed";
233
+ readonly canceled: "canceled";
234
+ readonly terminated: "terminated";
235
+ readonly timed_out: "timed_out";
236
+ readonly continued: "continued";
237
+ };
211
238
  export type GetWorkflowIdResult200 = {
212
239
  /** The workflow execution id */
213
240
  workflowId?: string;
214
- /** The result of workflow */
241
+ /** The result of workflow, null if workflow failed */
215
242
  output?: unknown;
216
243
  trace?: TraceInfo;
244
+ /** The workflow execution status */
245
+ status?: GetWorkflowIdResult200Status;
246
+ /**
247
+ * Error message if workflow failed, null otherwise
248
+ * @nullable
249
+ */
250
+ error?: string | null;
217
251
  };
218
252
  export type GetWorkflowIdTraceLog200 = TraceLogRemoteResponse | TraceLogLocalResponse;
219
253
  export type GetWorkflowIdTraceLog404 = {
@@ -25,6 +25,11 @@ export const WorkflowRunInfoStatus = {
25
25
  continued: 'continued',
26
26
  };
27
27
  // eslint-disable-next-line @typescript-eslint/no-redeclare
28
+ export const PostWorkflowRun200Status = {
29
+ completed: 'completed',
30
+ failed: 'failed',
31
+ };
32
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
28
33
  export const GetWorkflowIdStatus200Status = {
29
34
  canceled: 'canceled',
30
35
  completed: 'completed',
@@ -35,6 +40,15 @@ export const GetWorkflowIdStatus200Status = {
35
40
  timed_out: 'timed_out',
36
41
  unspecified: 'unspecified',
37
42
  };
43
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
44
+ export const GetWorkflowIdResult200Status = {
45
+ completed: 'completed',
46
+ failed: 'failed',
47
+ canceled: 'canceled',
48
+ terminated: 'terminated',
49
+ timed_out: 'timed_out',
50
+ continued: 'continued',
51
+ };
38
52
  ;
39
53
  export const getGetHealthUrl = () => {
40
54
  return `/health`;
@@ -85,13 +85,13 @@ services:
85
85
  - main
86
86
  env_file: ./.env
87
87
  environment:
88
- - PORT=3001
89
- - CATALOG_ID=${CATALOG_ID:-main}
90
- - TEMPORAL_ADDRESS=temporal:7233
91
88
  - NODE_ENV=development
92
- - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
93
- - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
94
- - AWS_REGION=${AWS_REGION:-us-west-1}
89
+ - OUTPUT_API_PORT=3001
90
+ - OUTPUT_CATALOG_ID=${OUTPUT_CATALOG_ID:-main}
91
+ - OUTPUT_AWS_REGION=${AWS_REGION:-us-west-1}
92
+ - OUTPUT_AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
93
+ - OUTPUT_AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
94
+ - TEMPORAL_ADDRESS=temporal:7233
95
95
  ports:
96
96
  - '3001:3001'
97
97
 
@@ -105,22 +105,13 @@ services:
105
105
  - main
106
106
  env_file: ./.env
107
107
  environment:
108
- - CATALOG_ID=${CATALOG_ID:-main}
109
- - LOG_HTTP_VERBOSE=${LOG_HTTP_VERBOSE:-true}
110
- - REDIS_URL=redis://redis:6379
108
+ - NODE_ENV=development
109
+ - OUTPUT_CATALOG_ID=${OUTPUT_CATALOG_ID:-main}
110
+ - OUTPUT_REDIS_URL=redis://redis:6379
111
+ - OUTPUT_TRACE_LOCAL_ON=${OUTPUT_TRACE_LOCAL_ON:-true}
112
+ - OUTPUT_TRACE_HOST_PATH=${PWD}/logs
113
+ - OUTPUT_TRACE_HTTP_VERBOSE=${OUTPUT_TRACE_HTTP_VERBOSE:-true}
111
114
  - TEMPORAL_ADDRESS=temporal:7233
112
- - TRACE_LOCAL_ON=${TRACE_LOCAL_ON:-true}
113
- - TRACE_REMOTE_ON=${TRACE_REMOTE_ON:-}
114
- - TRACE_REMOTE_S3_BUCKET=${TRACE_REMOTE_S3_BUCKET:-}
115
- - TRACE_HOST_PATH=${PWD}/logs
116
- - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
117
- - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
118
- - AWS_REGION=${AWS_REGION:-us-west-1}
119
- - MAX_CONCURRENT_ACTIVITY_TASKS=${MAX_CONCURRENT_ACTIVITY_TASKS:-40}
120
- - MAX_CONCURRENT_WORKFLOW_TASKS=${MAX_CONCURRENT_WORKFLOW_TASKS:-200}
121
- - MAX_CACHED_WORKFLOWS=${MAX_CACHED_WORKFLOWS:-1000}
122
- - MAX_CONCURRENT_ACTIVITY_POLLS=${MAX_CONCURRENT_ACTIVITY_POLLS:-5}
123
- - MAX_CONCURRENT_WORKFLOW_POLLS=${MAX_CONCURRENT_WORKFLOW_POLLS:-5}
124
115
  - NODE_OPTIONS=${NODE_OPTIONS:---max-old-space-size=4096}
125
116
  command: >
126
117
  sh -c "
package/dist/config.d.ts CHANGED
@@ -4,12 +4,12 @@
4
4
  export declare const config: {
5
5
  /**
6
6
  * Base URL for the Output.ai API server
7
- * Can be overridden with API_URL environment variable
7
+ * Can be overridden with OUTPUT_API_URL environment variable
8
8
  */
9
9
  apiUrl: string;
10
10
  /**
11
11
  * API authentication token
12
- * Set via API_AUTH_TOKEN environment variable
12
+ * Set via OUTPUT_API_AUTH_TOKEN environment variable
13
13
  */
14
14
  apiToken: string | undefined;
15
15
  /**
@@ -21,8 +21,16 @@ export declare const config: {
21
21
  * Can be overridden with DOCKER_SERVICE_NAME environment variable
22
22
  */
23
23
  dockerServiceName: string;
24
+ /**
25
+ * Set the debug mode
26
+ */
27
+ debugMode: boolean;
28
+ /**
29
+ * Where the env vars are stored, defaults to `.env`
30
+ */
31
+ envFile: string;
32
+ /**
33
+ * Agent configuration directory name
34
+ */
35
+ agentConfigDir: string;
24
36
  };
25
- /**
26
- * Agent configuration directory name
27
- */
28
- export declare const AGENT_CONFIG_DIR = ".outputai";
package/dist/config.js CHANGED
@@ -4,14 +4,14 @@
4
4
  export const config = {
5
5
  /**
6
6
  * Base URL for the Output.ai API server
7
- * Can be overridden with API_URL environment variable
7
+ * Can be overridden with OUTPUT_API_URL environment variable
8
8
  */
9
- apiUrl: process.env.API_URL || 'http://localhost:3001',
9
+ apiUrl: process.env.OUTPUT_API_URL || 'http://localhost:3001',
10
10
  /**
11
11
  * API authentication token
12
- * Set via API_AUTH_TOKEN environment variable
12
+ * Set via OUTPUT_API_AUTH_TOKEN environment variable
13
13
  */
14
- apiToken: process.env.API_AUTH_TOKEN,
14
+ apiToken: process.env.OUTPUT_API_AUTH_TOKEN,
15
15
  /**
16
16
  * Default timeout for API requests (in milliseconds)
17
17
  */
@@ -20,9 +20,17 @@ export const config = {
20
20
  * Docker Compose project name
21
21
  * Can be overridden with DOCKER_SERVICE_NAME environment variable
22
22
  */
23
- dockerServiceName: process.env.DOCKER_SERVICE_NAME || 'output-sdk'
23
+ dockerServiceName: process.env.DOCKER_SERVICE_NAME || 'output-sdk',
24
+ /**
25
+ * Set the debug mode
26
+ */
27
+ debugMode: process.env.OUTPUT_DEBUG === 'true',
28
+ /**
29
+ * Where the env vars are stored, defaults to `.env`
30
+ */
31
+ envFile: process.env.OUTPUT_CLI_ENV || '.env',
32
+ /**
33
+ * Agent configuration directory name
34
+ */
35
+ agentConfigDir: '.outputai'
24
36
  };
25
- /**
26
- * Agent configuration directory name
27
- */
28
- export const AGENT_CONFIG_DIR = '.outputai';
@@ -1,6 +1,6 @@
1
1
  {
2
- "core": "0.3.6",
2
+ "core": "0.4.0",
3
3
  "llm": "0.2.12",
4
- "http": "0.1.2",
5
- "cli": "0.7.15"
4
+ "http": "0.2.0",
5
+ "cli": "0.8.0"
6
6
  }
@@ -5,6 +5,7 @@ import { query } from '@anthropic-ai/claude-agent-sdk';
5
5
  import { ux } from '@oclif/core';
6
6
  import * as cliProgress from 'cli-progress';
7
7
  import { getErrorMessage, toError } from '#utils/error_utils.js';
8
+ import { config } from '#config.js';
8
9
  const ADDITIONAL_INSTRUCTIONS = `
9
10
  ! IMPORTANT !
10
11
  1. Use TodoWrite to track your progress through plan creation.
@@ -143,7 +144,7 @@ function getProgressUpdate(message) {
143
144
  };
144
145
  }
145
146
  function debugMessage(message) {
146
- if (process.env.DEBUG !== 'true') {
147
+ if (!config.debugMode) {
147
148
  return;
148
149
  }
149
150
  ux.stdout(ux.colorize('teal', `[Message]: ${message.type}`));
@@ -8,7 +8,7 @@ import path from 'node:path';
8
8
  import { join } from 'node:path';
9
9
  import { ux } from '@oclif/core';
10
10
  import { confirm } from '@inquirer/prompts';
11
- import { AGENT_CONFIG_DIR } from '#config.js';
11
+ import { config } from '#config.js';
12
12
  import { getTemplateDir } from '#utils/paths.js';
13
13
  import { executeClaudeCommand } from '#utils/claude.js';
14
14
  import { processTemplate } from '#utils/template.js';
@@ -18,7 +18,7 @@ const EXPECTED_MARKETPLACE_REPO = 'growthxai/output-claude-plugins';
18
18
  * Get the full path to the agent configuration directory
19
19
  */
20
20
  export function getAgentConfigDir(projectRoot) {
21
- return join(projectRoot, AGENT_CONFIG_DIR);
21
+ return join(projectRoot, config.agentConfigDir);
22
22
  }
23
23
  /**
24
24
  * Check if .outputai directory exists
@@ -157,14 +157,14 @@ async function createSymlink(source, target, projectRoot) {
157
157
  * Create .outputai/AGENTS.md file from template
158
158
  */
159
159
  async function createAgentsMdFile(projectRoot, force, variables) {
160
- const outputaiDir = join(projectRoot, AGENT_CONFIG_DIR);
160
+ const outputaiDir = join(projectRoot, config.agentConfigDir);
161
161
  await ensureDirectoryExists(outputaiDir);
162
162
  const agentsMdPath = join(outputaiDir, 'AGENTS.md');
163
163
  if (force || !await fileExists(agentsMdPath)) {
164
164
  await createFromTemplate('dotoutputai/AGENTS.md.template', agentsMdPath, variables);
165
165
  }
166
166
  else {
167
- ux.warn(`File already exists: ${AGENT_CONFIG_DIR}/AGENTS.md (use --force to overwrite)`);
167
+ ux.warn(`File already exists: ${config.agentConfigDir}/AGENTS.md (use --force to overwrite)`);
168
168
  }
169
169
  }
170
170
  /**
@@ -188,7 +188,7 @@ async function createSettingsFile(projectRoot, force) {
188
188
  async function createClaudeMdSymlink(projectRoot, force) {
189
189
  const claudeMdPath = join(projectRoot, 'CLAUDE.md');
190
190
  if (force || !await fileExists(claudeMdPath)) {
191
- await createSymlink(`${AGENT_CONFIG_DIR}/AGENTS.md`, claudeMdPath, projectRoot);
191
+ await createSymlink(`${config.agentConfigDir}/AGENTS.md`, claudeMdPath, projectRoot);
192
192
  }
193
193
  else {
194
194
  ux.warn('File already exists: CLAUDE.md (use --force to overwrite)');
@@ -2,7 +2,7 @@ import { initializeAgentConfig } from './coding_agents.js';
2
2
  import { generateText } from '@output.ai/llm';
3
3
  import fs from 'node:fs/promises';
4
4
  import path from 'node:path';
5
- import { AGENT_CONFIG_DIR } from '#config.js';
5
+ import { config } from '#config.js';
6
6
  export async function generatePlanName(description, date = new Date()) {
7
7
  const year = date.getFullYear();
8
8
  const month = String(date.getMonth() + 1).padStart(2, '0');
@@ -29,7 +29,7 @@ export async function generatePlanName(description, date = new Date()) {
29
29
  * @returns Full path to the created PLAN.md file
30
30
  */
31
31
  export async function writePlanFile(planName, content, projectRoot) {
32
- const planDir = path.join(projectRoot, AGENT_CONFIG_DIR, 'plans', planName);
32
+ const planDir = path.join(projectRoot, config.agentConfigDir, 'plans', planName);
33
33
  const planFilePath = path.join(planDir, 'PLAN.md');
34
34
  await fs.mkdir(planDir, { recursive: true });
35
35
  await fs.writeFile(planFilePath, content, 'utf-8');
@@ -7,10 +7,11 @@ import { existsSync } from 'node:fs';
7
7
  import { resolve } from 'node:path';
8
8
  import * as dotenv from 'dotenv';
9
9
  import debugFactory from 'debug';
10
+ import { config } from '#config.js';
10
11
  const debug = debugFactory('output-cli:env-loader');
11
12
  export function loadEnvironment() {
12
13
  const cwd = process.cwd();
13
- const envFile = process.env.OUTPUT_CLI_ENV || '.env';
14
+ const envFile = config.envFile;
14
15
  const envPath = resolve(cwd, envFile);
15
16
  if (!existsSync(envPath)) {
16
17
  debug(`Warning: Env file not found: ${envPath}`);
@@ -25,7 +25,7 @@ describe('loadEnvironment', () => {
25
25
  process.env.OUTPUT_CLI_ENV = '.env.prod';
26
26
  const expectedPath = resolve(mockCwd, '.env.prod');
27
27
  vi.mocked(existsSync).mockReturnValue(true);
28
- vi.mocked(dotenv.config).mockReturnValue({ parsed: { API_URL: 'https://prod.api.com' } });
28
+ vi.mocked(dotenv.config).mockReturnValue({ parsed: { OUTPUT_API_URL: 'https://prod.api.com' } });
29
29
  const { loadEnvironment } = await import('./env_loader.js');
30
30
  loadEnvironment();
31
31
  expect(dotenv.config).toHaveBeenCalledWith({ path: expectedPath });
@@ -1,7 +1,7 @@
1
1
  import { config } from '#config.js';
2
2
  const DEFAULT_MESSAGES = {
3
3
  ECONNREFUSED: `Connection refused to ${config.apiUrl}. Is the API server running?`,
4
- 401: 'Authentication failed. Check your API_AUTH_TOKEN.',
4
+ 401: 'Authentication failed. Check your OUTPUT_API_AUTH_TOKEN.',
5
5
  404: 'Resource not found.',
6
6
  500: 'Server error.',
7
7
  UNKNOWN: 'An unknown error occurred.'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@output.ai/cli",
3
- "version": "0.7.15",
3
+ "version": "0.8.0",
4
4
  "description": "CLI for Output.ai workflow generation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",