@outputai/cli 0.10.1-next.2e221c7.0 → 0.10.1-next.3c76007.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.
@@ -80,7 +80,7 @@ services:
80
80
  condition: service_healthy
81
81
  worker:
82
82
  condition: service_healthy
83
- image: outputai/api:${OUTPUT_API_VERSION:-0.10.1-next.2e221c7.0}
83
+ image: outputai/api:${OUTPUT_API_VERSION:-0.10.1-next.3c76007.0}
84
84
  init: true
85
85
  networks:
86
86
  - main
@@ -1,3 +1,3 @@
1
1
  {
2
- "framework": "0.10.1-next.2e221c7.0"
2
+ "framework": "0.10.1-next.3c76007.0"
3
3
  }
@@ -17,10 +17,12 @@ claude plugin install outputai@outputai --scope project
17
17
  npm run output:dev # Start dev environment (worker + Temporal)
18
18
  npm run output:worker:build # Build TypeScript to dist/
19
19
  npm run output:worker:check # Optional: bundle-check workflows for bad imports (node: built-ins)
20
- npm run output:worker:watch # Build + restart on file changes
21
- npm run output:worker # Install, build, and start worker
20
+ npm run output:worker:watch # Build + restart on src/ file changes
21
+ npm run output:worker # Build and start worker
22
22
  ```
23
23
 
24
+ Hot-reload watches `src/` only. After changing dependencies (`package.json` / lockfile), run `npm install`, then `npx output dev down` and `npm run output:dev` again so the worker container reinstalls. A hot-reload alone is not enough; if the stack is still running, `npx output dev down` is required.
25
+
24
26
  ## Project Structure
25
27
 
26
28
  ```
@@ -79,7 +79,9 @@ This starts:
79
79
  - Temporal server and UI (http://localhost:8080)
80
80
  - PostgreSQL and Redis databases
81
81
  - Output.ai API server (http://localhost:3001)
82
- - Worker process for executing workflows
82
+ - Worker process for executing workflows (auto-reloads on `src/` changes)
83
+
84
+ Dependency changes (`package.json` / lockfile) are not picked up by hot-reload. Run `npm install`, then `npx output dev down` and `npm run output:dev` again so the worker container reinstalls. A hot-reload alone is not enough; if the stack is still running, `npx output dev down` is required.
83
85
 
84
86
  ### 4. Run a workflow
85
87
 
@@ -9,8 +9,8 @@
9
9
  "output:worker:build": "rm -rf dist/* && tsc -p ./ && output-copy-assets",
10
10
  "output:worker:start": "output-worker",
11
11
  "output:worker:check": "output-worker --check",
12
- "output:worker": "npm run output:worker:install && npm run output:worker:build && npm run output:worker:start",
13
- "output:worker:watch": "npx nodemon --watch src --watch package.json --ext ts,js,json,prompt,md --ignore 'dist/**' --ignore '**/*.spec.*' --ignore '**/*.test.*' --exec 'npm run output:worker'",
12
+ "output:worker": "npm run output:worker:build && npm run output:worker:start",
13
+ "output:worker:watch": "npx nodemon --watch src --ext ts,js,json,prompt,md --ignore 'dist/**' --ignore '**/*.spec.*' --ignore '**/*.test.*' --exec 'npm run output:worker'",
14
14
  "output:dev": "output dev"
15
15
  },
16
16
  "dependencies": {
@@ -5,7 +5,6 @@
5
5
  */
6
6
  import { existsSync } from 'node:fs';
7
7
  import { resolve } from 'node:path';
8
- import * as dotenv from 'dotenv';
9
8
  import debugFactory from 'debug';
10
9
  const debug = debugFactory('output-cli:env-loader');
11
10
  export function loadEnvironment() {
@@ -17,5 +16,10 @@ export function loadEnvironment() {
17
16
  return;
18
17
  }
19
18
  debug(`Loading env from: ${envPath}`);
20
- dotenv.config({ path: envPath, quiet: true });
19
+ try {
20
+ process.loadEnvFile(envPath);
21
+ }
22
+ catch (err) {
23
+ debug(`Warning: Failed to load env file ${envPath}: ${err}`);
24
+ }
21
25
  }
@@ -1,43 +1,72 @@
1
- /**
2
- * Tests for the env loader utility
3
- */
4
- import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
5
- import { existsSync } from 'node:fs';
6
- import { resolve } from 'node:path';
7
- import * as dotenv from 'dotenv';
8
- vi.mock('node:fs');
9
- vi.mock('dotenv');
1
+ import { afterAll, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
2
+ import { mkdirSync, mkdtempSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
3
+ import { tmpdir } from 'node:os';
4
+ import { join } from 'node:path';
5
+ import { loadEnvironment } from './env_loader.js';
10
6
  describe('loadEnvironment', () => {
11
- const originalEnv = { ...process.env };
12
- const mockCwd = '/mock/project';
7
+ const mockCwd = mkdtempSync(join(tmpdir(), 'output-env-loader-'));
13
8
  beforeEach(() => {
14
- vi.resetModules();
15
- vi.clearAllMocks();
9
+ for (const name of readdirSync(mockCwd)) {
10
+ rmSync(join(mockCwd, name), { recursive: true, force: true });
11
+ }
16
12
  vi.spyOn(process, 'cwd').mockReturnValue(mockCwd);
17
- vi.spyOn(console, 'log').mockImplementation(() => { });
18
- vi.spyOn(console, 'warn').mockImplementation(() => { });
13
+ vi.stubEnv('OUTPUT_CLI_ENV', undefined);
14
+ vi.stubEnv('OUTPUT_API_URL', undefined);
15
+ vi.stubEnv('OUTPUT_API_TOKEN', undefined);
19
16
  });
20
17
  afterEach(() => {
21
- process.env = { ...originalEnv };
22
18
  vi.restoreAllMocks();
19
+ vi.unstubAllEnvs();
23
20
  });
24
- it('should load from OUTPUT_CLI_ENV when set and file exists', async () => {
25
- process.env.OUTPUT_CLI_ENV = '.env.prod';
26
- const expectedPath = resolve(mockCwd, '.env.prod');
27
- vi.mocked(existsSync).mockReturnValue(true);
28
- vi.mocked(dotenv.config).mockReturnValue({ parsed: { OUTPUT_API_URL: 'https://prod.api.com' } });
29
- const { loadEnvironment } = await import('./env_loader.js');
21
+ afterAll(() => {
22
+ rmSync(mockCwd, { recursive: true, force: true });
23
+ });
24
+ it('loads variables from OUTPUT_CLI_ENV', () => {
25
+ writeFileSync(join(mockCwd, '.env'), [
26
+ 'OUTPUT_API_URL=https://default.api.com',
27
+ 'OUTPUT_API_TOKEN=default-token'
28
+ ].join('\n'));
29
+ writeFileSync(join(mockCwd, '.env.mock'), [
30
+ 'OUTPUT_API_URL=https://mock.api.com',
31
+ 'OUTPUT_API_TOKEN=mock-token'
32
+ ].join('\n'));
33
+ process.env.OUTPUT_CLI_ENV = '.env.mock';
34
+ loadEnvironment();
35
+ expect(process.env.OUTPUT_API_URL).toBe('https://mock.api.com');
36
+ expect(process.env.OUTPUT_API_TOKEN).toBe('mock-token');
37
+ });
38
+ it('loads variables from .env by default', () => {
39
+ writeFileSync(join(mockCwd, '.env'), [
40
+ 'OUTPUT_API_URL=https://default.api.com',
41
+ 'OUTPUT_API_TOKEN=default-token'
42
+ ].join('\n'));
43
+ writeFileSync(join(mockCwd, '.env.mock'), [
44
+ 'OUTPUT_API_URL=https://mock.api.com',
45
+ 'OUTPUT_API_TOKEN=mock-token'
46
+ ].join('\n'));
30
47
  loadEnvironment();
31
- expect(dotenv.config).toHaveBeenCalledWith({ path: expectedPath, quiet: true });
32
- });
33
- it('should load .env by default and log', async () => {
34
- delete process.env.OUTPUT_CLI_ENV;
35
- const envPath = resolve(mockCwd, '.env');
36
- vi.mocked(existsSync).mockImplementation(p => p === envPath);
37
- vi.mocked(dotenv.config).mockReturnValue({ parsed: {} });
38
- const { loadEnvironment } = await import('./env_loader.js');
48
+ expect(process.env.OUTPUT_API_URL).toBe('https://default.api.com');
49
+ expect(process.env.OUTPUT_API_TOKEN).toBe('default-token');
50
+ });
51
+ it('does nothing when the env file is missing', () => {
52
+ expect(() => loadEnvironment()).not.toThrow();
53
+ expect(process.env.OUTPUT_API_URL).toBeUndefined();
54
+ expect(process.env.OUTPUT_API_TOKEN).toBeUndefined();
55
+ });
56
+ it('does not throw when the env path is not a readable file', () => {
57
+ mkdirSync(join(mockCwd, 'not-a-file.env'));
58
+ process.env.OUTPUT_CLI_ENV = 'not-a-file.env';
59
+ expect(() => loadEnvironment()).not.toThrow();
60
+ expect(process.env.OUTPUT_API_URL).toBeUndefined();
61
+ });
62
+ it('does not overwrite already-set process.env values', () => {
63
+ vi.stubEnv('OUTPUT_API_URL', 'https://ambient.api.com');
64
+ writeFileSync(join(mockCwd, '.env'), [
65
+ 'OUTPUT_API_URL=https://file.api.com',
66
+ 'OUTPUT_API_TOKEN=file-token'
67
+ ].join('\n'));
39
68
  loadEnvironment();
40
- expect(dotenv.config).toHaveBeenCalledTimes(1);
41
- expect(dotenv.config).toHaveBeenCalledWith({ path: envPath, quiet: true });
69
+ expect(process.env.OUTPUT_API_URL).toBe('https://ambient.api.com');
70
+ expect(process.env.OUTPUT_API_TOKEN).toBe('file-token');
42
71
  });
43
72
  });
@@ -1715,5 +1715,5 @@
1715
1715
  ]
1716
1716
  }
1717
1717
  },
1718
- "version": "0.10.1-next.2e221c7.0"
1718
+ "version": "0.10.1-next.3c76007.0"
1719
1719
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outputai/cli",
3
- "version": "0.10.1-next.2e221c7.0",
3
+ "version": "0.10.1-next.3c76007.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.0",
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/evals": "0.10.1-next.2e221c7.0",
42
- "@outputai/credentials": "0.10.1-next.2e221c7.0",
43
- "@outputai/llm": "0.10.1-next.2e221c7.0"
38
+ "undici": "8.9.0",
39
+ "@outputai/credentials": "0.10.1-next.3c76007.0",
40
+ "@outputai/evals": "0.10.1-next.3c76007.0",
41
+ "@outputai/llm": "0.10.1-next.3c76007.0"
44
42
  },
45
43
  "devDependencies": {
46
44
  "@types/cli-progress": "3.11.6",