@outputai/cli 0.1.13-dev.98dfd72.0 → 0.1.13-dev.e3e3291.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/bin/run.js +0 -2
- package/dist/api/generated/api.d.ts +319 -85
- package/dist/api/generated/api.js +66 -8
- package/dist/assets/docker/docker-compose-dev.yml +1 -1
- package/dist/commands/fix.js +1 -1
- package/dist/commands/fix.spec.js +2 -2
- package/dist/commands/update.js +1 -1
- package/dist/commands/update.spec.js +2 -2
- package/dist/commands/workflow/plan.js +1 -5
- package/dist/commands/workflow/plan.spec.js +2 -3
- package/dist/commands/workflow/run.js +1 -2
- package/dist/commands/workflow/run.spec.js +0 -1
- package/dist/commands/workflow/start.js +1 -2
- package/dist/commands/workflow/start.spec.js +0 -1
- package/dist/commands/workflow/test_eval.js +2 -2
- package/dist/generated/framework_version.json +1 -1
- package/dist/hooks/init.js +0 -4
- package/dist/services/coding_agents.js +1 -1
- package/dist/services/coding_agents.spec.js +6 -6
- package/dist/services/credentials_configurator.js +1 -1
- package/dist/services/datasets.d.ts +1 -1
- package/dist/services/datasets.js +41 -37
- package/dist/services/datasets.test.js +202 -0
- package/dist/services/env_configurator.js +1 -1
- package/dist/services/env_configurator.spec.js +12 -12
- package/dist/services/project_scaffold.js +2 -2
- package/dist/services/project_scaffold.spec.js +6 -6
- package/dist/services/workflow_builder.js +1 -5
- package/dist/services/workflow_builder.spec.js +2 -3
- package/dist/utils/format_workflow_result.d.ts +3 -3
- package/package.json +4 -5
- package/dist/commands/credentials/set.d.ts +0 -14
- package/dist/commands/credentials/set.js +0 -57
- package/dist/commands/credentials/set.spec.js +0 -95
- package/dist/utils/interactive.d.ts +0 -2
- package/dist/utils/interactive.js +0 -5
- package/dist/utils/interactive.spec.d.ts +0 -1
- package/dist/utils/interactive.spec.js +0 -40
- package/dist/utils/prompt.d.ts +0 -17
- package/dist/utils/prompt.js +0 -20
- package/dist/utils/prompt.spec.d.ts +0 -1
- package/dist/utils/prompt.spec.js +0 -74
- package/dist/utils/proxy.d.ts +0 -1
- package/dist/utils/proxy.js +0 -9
- package/dist/utils/proxy.spec.d.ts +0 -1
- package/dist/utils/proxy.spec.js +0 -39
- /package/dist/{commands/credentials/set.spec.d.ts → services/datasets.test.d.ts} +0 -0
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
-
describe('interactive', () => {
|
|
3
|
-
beforeEach(async () => {
|
|
4
|
-
// Re-import to reset singleton state
|
|
5
|
-
const mod = await import('./interactive.js');
|
|
6
|
-
mod.setNonInteractive(false);
|
|
7
|
-
});
|
|
8
|
-
it('isInteractive returns true by default when TTY is available', async () => {
|
|
9
|
-
const originalIsTTY = process.stdin.isTTY;
|
|
10
|
-
Object.defineProperty(process.stdin, 'isTTY', { value: true, configurable: true });
|
|
11
|
-
const { isInteractive } = await import('./interactive.js');
|
|
12
|
-
expect(isInteractive()).toBe(true);
|
|
13
|
-
Object.defineProperty(process.stdin, 'isTTY', { value: originalIsTTY, configurable: true });
|
|
14
|
-
});
|
|
15
|
-
it('isInteractive returns false when no TTY', async () => {
|
|
16
|
-
const originalIsTTY = process.stdin.isTTY;
|
|
17
|
-
Object.defineProperty(process.stdin, 'isTTY', { value: undefined, configurable: true });
|
|
18
|
-
const { isInteractive } = await import('./interactive.js');
|
|
19
|
-
expect(isInteractive()).toBe(false);
|
|
20
|
-
Object.defineProperty(process.stdin, 'isTTY', { value: originalIsTTY, configurable: true });
|
|
21
|
-
});
|
|
22
|
-
it('isInteractive returns false after setNonInteractive(true)', async () => {
|
|
23
|
-
const originalIsTTY = process.stdin.isTTY;
|
|
24
|
-
Object.defineProperty(process.stdin, 'isTTY', { value: true, configurable: true });
|
|
25
|
-
const { isInteractive, setNonInteractive } = await import('./interactive.js');
|
|
26
|
-
setNonInteractive(true);
|
|
27
|
-
expect(isInteractive()).toBe(false);
|
|
28
|
-
Object.defineProperty(process.stdin, 'isTTY', { value: originalIsTTY, configurable: true });
|
|
29
|
-
});
|
|
30
|
-
it('setNonInteractive(false) restores interactive mode', async () => {
|
|
31
|
-
const originalIsTTY = process.stdin.isTTY;
|
|
32
|
-
Object.defineProperty(process.stdin, 'isTTY', { value: true, configurable: true });
|
|
33
|
-
const { isInteractive, setNonInteractive } = await import('./interactive.js');
|
|
34
|
-
setNonInteractive(true);
|
|
35
|
-
expect(isInteractive()).toBe(false);
|
|
36
|
-
setNonInteractive(false);
|
|
37
|
-
expect(isInteractive()).toBe(true);
|
|
38
|
-
Object.defineProperty(process.stdin, 'isTTY', { value: originalIsTTY, configurable: true });
|
|
39
|
-
});
|
|
40
|
-
});
|
package/dist/utils/prompt.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
type ConfirmOptions = {
|
|
2
|
-
message: string;
|
|
3
|
-
default?: boolean;
|
|
4
|
-
};
|
|
5
|
-
type InputOptions = {
|
|
6
|
-
message: string;
|
|
7
|
-
default?: string;
|
|
8
|
-
validate?: (value: string) => boolean | string;
|
|
9
|
-
};
|
|
10
|
-
type PasswordOptions = {
|
|
11
|
-
message: string;
|
|
12
|
-
mask?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare const confirm: (options: ConfirmOptions) => Promise<boolean>;
|
|
15
|
-
export declare const input: (options: InputOptions) => Promise<string>;
|
|
16
|
-
export declare const password: (options: PasswordOptions) => Promise<string>;
|
|
17
|
-
export {};
|
package/dist/utils/prompt.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { confirm as inquirerConfirm, input as inquirerInput, password as inquirerPassword } from '@inquirer/prompts';
|
|
2
|
-
import { isInteractive } from './interactive.js';
|
|
3
|
-
export const confirm = async (options) => {
|
|
4
|
-
if (!isInteractive()) {
|
|
5
|
-
return options.default ?? true;
|
|
6
|
-
}
|
|
7
|
-
return inquirerConfirm(options);
|
|
8
|
-
};
|
|
9
|
-
export const input = async (options) => {
|
|
10
|
-
if (!isInteractive()) {
|
|
11
|
-
return options.default ?? '';
|
|
12
|
-
}
|
|
13
|
-
return inquirerInput(options);
|
|
14
|
-
};
|
|
15
|
-
export const password = async (options) => {
|
|
16
|
-
if (!isInteractive()) {
|
|
17
|
-
return '';
|
|
18
|
-
}
|
|
19
|
-
return inquirerPassword(options);
|
|
20
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
-
import { confirm as inquirerConfirm, input as inquirerInput, password as inquirerPassword } from '@inquirer/prompts';
|
|
3
|
-
vi.mock('@inquirer/prompts', () => ({
|
|
4
|
-
confirm: vi.fn(),
|
|
5
|
-
input: vi.fn(),
|
|
6
|
-
password: vi.fn()
|
|
7
|
-
}));
|
|
8
|
-
vi.mock('./interactive.js', () => ({
|
|
9
|
-
isInteractive: vi.fn()
|
|
10
|
-
}));
|
|
11
|
-
describe('prompt wrapper', () => {
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
vi.clearAllMocks();
|
|
14
|
-
});
|
|
15
|
-
describe('when interactive', () => {
|
|
16
|
-
beforeEach(async () => {
|
|
17
|
-
const { isInteractive } = await import('./interactive.js');
|
|
18
|
-
vi.mocked(isInteractive).mockReturnValue(true);
|
|
19
|
-
});
|
|
20
|
-
it('confirm delegates to inquirer', async () => {
|
|
21
|
-
vi.mocked(inquirerConfirm).mockResolvedValue(false);
|
|
22
|
-
const { confirm } = await import('./prompt.js');
|
|
23
|
-
const result = await confirm({ message: 'Continue?', default: true });
|
|
24
|
-
expect(inquirerConfirm).toHaveBeenCalledWith({ message: 'Continue?', default: true });
|
|
25
|
-
expect(result).toBe(false);
|
|
26
|
-
});
|
|
27
|
-
it('input delegates to inquirer', async () => {
|
|
28
|
-
vi.mocked(inquirerInput).mockResolvedValue('user input');
|
|
29
|
-
const { input } = await import('./prompt.js');
|
|
30
|
-
const result = await input({ message: 'Name?', default: 'default' });
|
|
31
|
-
expect(inquirerInput).toHaveBeenCalledWith({ message: 'Name?', default: 'default' });
|
|
32
|
-
expect(result).toBe('user input');
|
|
33
|
-
});
|
|
34
|
-
it('password delegates to inquirer', async () => {
|
|
35
|
-
vi.mocked(inquirerPassword).mockResolvedValue('secret');
|
|
36
|
-
const { password } = await import('./prompt.js');
|
|
37
|
-
const result = await password({ message: 'Token?' });
|
|
38
|
-
expect(inquirerPassword).toHaveBeenCalledWith({ message: 'Token?' });
|
|
39
|
-
expect(result).toBe('secret');
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
describe('when non-interactive', () => {
|
|
43
|
-
beforeEach(async () => {
|
|
44
|
-
const { isInteractive } = await import('./interactive.js');
|
|
45
|
-
vi.mocked(isInteractive).mockReturnValue(false);
|
|
46
|
-
});
|
|
47
|
-
it('confirm returns default value', async () => {
|
|
48
|
-
const { confirm } = await import('./prompt.js');
|
|
49
|
-
expect(await confirm({ message: 'Continue?', default: false })).toBe(false);
|
|
50
|
-
expect(await confirm({ message: 'Continue?', default: true })).toBe(true);
|
|
51
|
-
expect(inquirerConfirm).not.toHaveBeenCalled();
|
|
52
|
-
});
|
|
53
|
-
it('confirm defaults to true when no default specified', async () => {
|
|
54
|
-
const { confirm } = await import('./prompt.js');
|
|
55
|
-
expect(await confirm({ message: 'Continue?' })).toBe(true);
|
|
56
|
-
expect(inquirerConfirm).not.toHaveBeenCalled();
|
|
57
|
-
});
|
|
58
|
-
it('input returns default value', async () => {
|
|
59
|
-
const { input } = await import('./prompt.js');
|
|
60
|
-
expect(await input({ message: 'Name?', default: 'fallback' })).toBe('fallback');
|
|
61
|
-
expect(inquirerInput).not.toHaveBeenCalled();
|
|
62
|
-
});
|
|
63
|
-
it('input returns empty string when no default', async () => {
|
|
64
|
-
const { input } = await import('./prompt.js');
|
|
65
|
-
expect(await input({ message: 'Name?' })).toBe('');
|
|
66
|
-
expect(inquirerInput).not.toHaveBeenCalled();
|
|
67
|
-
});
|
|
68
|
-
it('password returns empty string', async () => {
|
|
69
|
-
const { password } = await import('./prompt.js');
|
|
70
|
-
expect(await password({ message: 'Token?' })).toBe('');
|
|
71
|
-
expect(inquirerPassword).not.toHaveBeenCalled();
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
});
|
package/dist/utils/proxy.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const bootstrapProxy: () => void;
|
package/dist/utils/proxy.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { EnvHttpProxyAgent, setGlobalDispatcher } from 'undici';
|
|
2
|
-
export const bootstrapProxy = () => {
|
|
3
|
-
const proxyUrl = process.env.HTTPS_PROXY || process.env.https_proxy ||
|
|
4
|
-
process.env.HTTP_PROXY || process.env.http_proxy;
|
|
5
|
-
if (!proxyUrl) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
setGlobalDispatcher(new EnvHttpProxyAgent());
|
|
9
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/utils/proxy.spec.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
2
|
-
const mockSetGlobalDispatcher = vi.fn();
|
|
3
|
-
const MockEnvHttpProxyAgent = vi.fn();
|
|
4
|
-
vi.mock('undici', () => ({
|
|
5
|
-
EnvHttpProxyAgent: MockEnvHttpProxyAgent,
|
|
6
|
-
setGlobalDispatcher: mockSetGlobalDispatcher
|
|
7
|
-
}));
|
|
8
|
-
describe('proxy bootstrap', () => {
|
|
9
|
-
const originalEnv = { ...process.env };
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
vi.clearAllMocks();
|
|
12
|
-
delete process.env.HTTPS_PROXY;
|
|
13
|
-
delete process.env.https_proxy;
|
|
14
|
-
delete process.env.HTTP_PROXY;
|
|
15
|
-
delete process.env.http_proxy;
|
|
16
|
-
});
|
|
17
|
-
afterEach(() => {
|
|
18
|
-
process.env = { ...originalEnv };
|
|
19
|
-
});
|
|
20
|
-
it('does nothing when no proxy env vars are set', async () => {
|
|
21
|
-
const { bootstrapProxy } = await import('./proxy.js');
|
|
22
|
-
bootstrapProxy();
|
|
23
|
-
expect(mockSetGlobalDispatcher).not.toHaveBeenCalled();
|
|
24
|
-
});
|
|
25
|
-
it('sets global dispatcher when HTTPS_PROXY is set', async () => {
|
|
26
|
-
process.env.HTTPS_PROXY = 'http://proxy:8080';
|
|
27
|
-
const { bootstrapProxy } = await import('./proxy.js');
|
|
28
|
-
bootstrapProxy();
|
|
29
|
-
expect(MockEnvHttpProxyAgent).toHaveBeenCalled();
|
|
30
|
-
expect(mockSetGlobalDispatcher).toHaveBeenCalledTimes(1);
|
|
31
|
-
});
|
|
32
|
-
it('sets global dispatcher when HTTP_PROXY is set', async () => {
|
|
33
|
-
process.env.HTTP_PROXY = 'http://proxy:8080';
|
|
34
|
-
const { bootstrapProxy } = await import('./proxy.js');
|
|
35
|
-
bootstrapProxy();
|
|
36
|
-
expect(MockEnvHttpProxyAgent).toHaveBeenCalled();
|
|
37
|
-
expect(mockSetGlobalDispatcher).toHaveBeenCalledTimes(1);
|
|
38
|
-
});
|
|
39
|
-
});
|
|
File without changes
|