@outputai/cli 0.1.4-dev.0 → 0.1.4
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/package.json +4 -4
- package/dist/api/generated/api.d.ts +0 -820
- package/dist/api/generated/api.js +0 -226
- package/dist/api/http_client.d.ts +0 -27
- package/dist/api/http_client.js +0 -71
- package/dist/api/orval_post_process.d.ts +0 -11
- package/dist/api/orval_post_process.js +0 -46
- package/dist/api/parser.d.ts +0 -17
- package/dist/api/parser.js +0 -68
- package/dist/assets/config/costs.yml +0 -309
- package/dist/assets/docker/docker-compose-dev.yml +0 -146
- package/dist/commands/credentials/edit.d.ts +0 -10
- package/dist/commands/credentials/edit.js +0 -67
- package/dist/commands/credentials/edit.spec.d.ts +0 -1
- package/dist/commands/credentials/edit.spec.js +0 -73
- package/dist/commands/credentials/get.d.ts +0 -13
- package/dist/commands/credentials/get.js +0 -46
- package/dist/commands/credentials/get.spec.d.ts +0 -1
- package/dist/commands/credentials/get.spec.js +0 -74
- package/dist/commands/credentials/init.d.ts +0 -11
- package/dist/commands/credentials/init.js +0 -45
- package/dist/commands/credentials/init.spec.d.ts +0 -1
- package/dist/commands/credentials/init.spec.js +0 -68
- package/dist/commands/credentials/show.d.ts +0 -10
- package/dist/commands/credentials/show.js +0 -33
- package/dist/commands/credentials/show.spec.d.ts +0 -1
- package/dist/commands/credentials/show.spec.js +0 -57
- package/dist/commands/dev/eject.d.ts +0 -11
- package/dist/commands/dev/eject.js +0 -58
- package/dist/commands/dev/eject.spec.d.ts +0 -1
- package/dist/commands/dev/eject.spec.js +0 -109
- package/dist/commands/dev/index.d.ts +0 -14
- package/dist/commands/dev/index.js +0 -173
- package/dist/commands/dev/index.spec.d.ts +0 -1
- package/dist/commands/dev/index.spec.js +0 -239
- package/dist/commands/init.d.ts +0 -12
- package/dist/commands/init.js +0 -37
- package/dist/commands/init.spec.d.ts +0 -1
- package/dist/commands/init.spec.js +0 -100
- package/dist/commands/update.d.ts +0 -14
- package/dist/commands/update.js +0 -120
- package/dist/commands/update.spec.d.ts +0 -1
- package/dist/commands/update.spec.js +0 -178
- package/dist/commands/workflow/cost.d.ts +0 -16
- package/dist/commands/workflow/cost.js +0 -71
- package/dist/commands/workflow/cost.spec.d.ts +0 -1
- package/dist/commands/workflow/cost.spec.js +0 -47
- package/dist/commands/workflow/dataset/generate.d.ts +0 -22
- package/dist/commands/workflow/dataset/generate.js +0 -143
- package/dist/commands/workflow/dataset/list.d.ts +0 -12
- package/dist/commands/workflow/dataset/list.js +0 -87
- package/dist/commands/workflow/debug.d.ts +0 -16
- package/dist/commands/workflow/debug.js +0 -60
- package/dist/commands/workflow/debug.spec.d.ts +0 -1
- package/dist/commands/workflow/debug.spec.js +0 -34
- package/dist/commands/workflow/generate.d.ts +0 -17
- package/dist/commands/workflow/generate.js +0 -85
- package/dist/commands/workflow/generate.spec.d.ts +0 -1
- package/dist/commands/workflow/generate.spec.js +0 -115
- package/dist/commands/workflow/list.d.ts +0 -22
- package/dist/commands/workflow/list.js +0 -152
- package/dist/commands/workflow/list.spec.d.ts +0 -1
- package/dist/commands/workflow/list.spec.js +0 -99
- package/dist/commands/workflow/plan.d.ts +0 -12
- package/dist/commands/workflow/plan.js +0 -66
- package/dist/commands/workflow/plan.spec.d.ts +0 -1
- package/dist/commands/workflow/plan.spec.js +0 -341
- package/dist/commands/workflow/reset.d.ts +0 -14
- package/dist/commands/workflow/reset.js +0 -51
- package/dist/commands/workflow/result.d.ts +0 -13
- package/dist/commands/workflow/result.js +0 -46
- package/dist/commands/workflow/result.spec.d.ts +0 -1
- package/dist/commands/workflow/result.spec.js +0 -23
- package/dist/commands/workflow/run.d.ts +0 -16
- package/dist/commands/workflow/run.js +0 -97
- package/dist/commands/workflow/run.spec.d.ts +0 -1
- package/dist/commands/workflow/run.spec.js +0 -110
- package/dist/commands/workflow/runs/list.d.ts +0 -14
- package/dist/commands/workflow/runs/list.js +0 -104
- package/dist/commands/workflow/start.d.ts +0 -15
- package/dist/commands/workflow/start.js +0 -62
- package/dist/commands/workflow/start.spec.d.ts +0 -1
- package/dist/commands/workflow/start.spec.js +0 -28
- package/dist/commands/workflow/status.d.ts +0 -13
- package/dist/commands/workflow/status.js +0 -57
- package/dist/commands/workflow/status.spec.d.ts +0 -1
- package/dist/commands/workflow/status.spec.js +0 -33
- package/dist/commands/workflow/stop.d.ts +0 -10
- package/dist/commands/workflow/stop.js +0 -31
- package/dist/commands/workflow/stop.spec.d.ts +0 -1
- package/dist/commands/workflow/stop.spec.js +0 -17
- package/dist/commands/workflow/terminate.d.ts +0 -13
- package/dist/commands/workflow/terminate.js +0 -39
- package/dist/commands/workflow/test_eval.d.ts +0 -20
- package/dist/commands/workflow/test_eval.js +0 -151
- package/dist/config.d.ts +0 -47
- package/dist/config.js +0 -47
- package/dist/generated/framework_version.json +0 -3
- package/dist/hooks/init.d.ts +0 -3
- package/dist/hooks/init.js +0 -30
- package/dist/hooks/init.spec.d.ts +0 -1
- package/dist/hooks/init.spec.js +0 -54
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.spec.d.ts +0 -1
- package/dist/index.spec.js +0 -6
- package/dist/services/claude_client.d.ts +0 -30
- package/dist/services/claude_client.integration.test.d.ts +0 -1
- package/dist/services/claude_client.integration.test.js +0 -43
- package/dist/services/claude_client.js +0 -215
- package/dist/services/claude_client.spec.d.ts +0 -1
- package/dist/services/claude_client.spec.js +0 -145
- package/dist/services/coding_agents.d.ts +0 -36
- package/dist/services/coding_agents.js +0 -236
- package/dist/services/coding_agents.spec.d.ts +0 -1
- package/dist/services/coding_agents.spec.js +0 -256
- package/dist/services/copy_assets.spec.d.ts +0 -1
- package/dist/services/copy_assets.spec.js +0 -22
- package/dist/services/cost_calculator.d.ts +0 -18
- package/dist/services/cost_calculator.js +0 -359
- package/dist/services/cost_calculator.spec.d.ts +0 -1
- package/dist/services/cost_calculator.spec.js +0 -540
- package/dist/services/credentials_service.d.ts +0 -12
- package/dist/services/credentials_service.integration.test.d.ts +0 -1
- package/dist/services/credentials_service.integration.test.js +0 -66
- package/dist/services/credentials_service.js +0 -64
- package/dist/services/credentials_service.spec.d.ts +0 -1
- package/dist/services/credentials_service.spec.js +0 -106
- package/dist/services/datasets.d.ts +0 -20
- package/dist/services/datasets.js +0 -132
- package/dist/services/docker.d.ts +0 -39
- package/dist/services/docker.js +0 -160
- package/dist/services/docker.spec.d.ts +0 -1
- package/dist/services/docker.spec.js +0 -124
- package/dist/services/env_configurator.d.ts +0 -15
- package/dist/services/env_configurator.js +0 -163
- package/dist/services/env_configurator.spec.d.ts +0 -1
- package/dist/services/env_configurator.spec.js +0 -192
- package/dist/services/generate_plan_name@v1.prompt +0 -24
- package/dist/services/messages.d.ts +0 -9
- package/dist/services/messages.js +0 -338
- package/dist/services/messages.spec.d.ts +0 -1
- package/dist/services/messages.spec.js +0 -55
- package/dist/services/npm_update_service.d.ts +0 -6
- package/dist/services/npm_update_service.js +0 -87
- package/dist/services/npm_update_service.spec.d.ts +0 -1
- package/dist/services/npm_update_service.spec.js +0 -104
- package/dist/services/project_scaffold.d.ts +0 -31
- package/dist/services/project_scaffold.js +0 -212
- package/dist/services/project_scaffold.spec.d.ts +0 -1
- package/dist/services/project_scaffold.spec.js +0 -122
- package/dist/services/s3_trace_downloader.d.ts +0 -12
- package/dist/services/s3_trace_downloader.js +0 -57
- package/dist/services/template_processor.d.ts +0 -14
- package/dist/services/template_processor.js +0 -57
- package/dist/services/trace_reader.d.ts +0 -16
- package/dist/services/trace_reader.js +0 -57
- package/dist/services/trace_reader.spec.d.ts +0 -1
- package/dist/services/trace_reader.spec.js +0 -78
- package/dist/services/version_check.d.ts +0 -6
- package/dist/services/version_check.js +0 -52
- package/dist/services/version_check.spec.d.ts +0 -1
- package/dist/services/version_check.spec.js +0 -106
- package/dist/services/workflow_builder.d.ts +0 -16
- package/dist/services/workflow_builder.js +0 -86
- package/dist/services/workflow_builder.spec.d.ts +0 -1
- package/dist/services/workflow_builder.spec.js +0 -165
- package/dist/services/workflow_generator.d.ts +0 -5
- package/dist/services/workflow_generator.js +0 -40
- package/dist/services/workflow_generator.spec.d.ts +0 -1
- package/dist/services/workflow_generator.spec.js +0 -77
- package/dist/services/workflow_planner.d.ts +0 -15
- package/dist/services/workflow_planner.js +0 -48
- package/dist/services/workflow_planner.spec.d.ts +0 -1
- package/dist/services/workflow_planner.spec.js +0 -122
- package/dist/services/workflow_runs.d.ts +0 -14
- package/dist/services/workflow_runs.js +0 -25
- package/dist/templates/agent_instructions/CLAUDE.md.template +0 -19
- package/dist/templates/agent_instructions/dotclaude/settings.json.template +0 -29
- package/dist/templates/project/.env.example.template +0 -9
- package/dist/templates/project/.gitignore.template +0 -35
- package/dist/templates/project/README.md.template +0 -100
- package/dist/templates/project/config/costs.yml.template +0 -29
- package/dist/templates/project/package.json.template +0 -25
- package/dist/templates/project/src/clients/jina.ts.template +0 -30
- package/dist/templates/project/src/shared/utils/string.ts.template +0 -3
- package/dist/templates/project/src/shared/utils/url.ts.template +0 -15
- package/dist/templates/project/src/workflows/blog_evaluator/evaluators.ts.template +0 -23
- package/dist/templates/project/src/workflows/blog_evaluator/prompts/signal_noise@v1.prompt.template +0 -26
- package/dist/templates/project/src/workflows/blog_evaluator/scenarios/paulgraham_hwh.json.template +0 -3
- package/dist/templates/project/src/workflows/blog_evaluator/steps.ts.template +0 -27
- package/dist/templates/project/src/workflows/blog_evaluator/types.ts.template +0 -30
- package/dist/templates/project/src/workflows/blog_evaluator/utils.ts.template +0 -15
- package/dist/templates/project/src/workflows/blog_evaluator/workflow.ts.template +0 -27
- package/dist/templates/project/tsconfig.json.template +0 -20
- package/dist/templates/workflow/README.md.template +0 -216
- package/dist/templates/workflow/evaluators.ts.template +0 -21
- package/dist/templates/workflow/prompts/example@v1.prompt.template +0 -15
- package/dist/templates/workflow/scenarios/test_input.json.template +0 -3
- package/dist/templates/workflow/steps.ts.template +0 -20
- package/dist/templates/workflow/types.ts.template +0 -13
- package/dist/templates/workflow/workflow.ts.template +0 -23
- package/dist/test_helpers/mocks.d.ts +0 -38
- package/dist/test_helpers/mocks.js +0 -77
- package/dist/types/cost.d.ts +0 -149
- package/dist/types/cost.js +0 -6
- package/dist/types/domain.d.ts +0 -20
- package/dist/types/domain.js +0 -4
- package/dist/types/errors.d.ts +0 -68
- package/dist/types/errors.js +0 -100
- package/dist/types/errors.spec.d.ts +0 -1
- package/dist/types/errors.spec.js +0 -18
- package/dist/types/generator.d.ts +0 -26
- package/dist/types/generator.js +0 -1
- package/dist/types/trace.d.ts +0 -161
- package/dist/types/trace.js +0 -18
- package/dist/utils/claude.d.ts +0 -5
- package/dist/utils/claude.js +0 -19
- package/dist/utils/claude.spec.d.ts +0 -1
- package/dist/utils/claude.spec.js +0 -119
- package/dist/utils/constants.d.ts +0 -5
- package/dist/utils/constants.js +0 -4
- package/dist/utils/cost_formatter.d.ts +0 -5
- package/dist/utils/cost_formatter.js +0 -218
- package/dist/utils/date_formatter.d.ts +0 -23
- package/dist/utils/date_formatter.js +0 -49
- package/dist/utils/env_loader.d.ts +0 -1
- package/dist/utils/env_loader.js +0 -22
- package/dist/utils/env_loader.spec.d.ts +0 -1
- package/dist/utils/env_loader.spec.js +0 -43
- package/dist/utils/error_handler.d.ts +0 -8
- package/dist/utils/error_handler.js +0 -71
- package/dist/utils/error_utils.d.ts +0 -24
- package/dist/utils/error_utils.js +0 -87
- package/dist/utils/file_system.d.ts +0 -3
- package/dist/utils/file_system.js +0 -33
- package/dist/utils/format_workflow_result.d.ts +0 -5
- package/dist/utils/format_workflow_result.js +0 -18
- package/dist/utils/format_workflow_result.spec.d.ts +0 -1
- package/dist/utils/format_workflow_result.spec.js +0 -81
- package/dist/utils/framework_version.d.ts +0 -4
- package/dist/utils/framework_version.js +0 -4
- package/dist/utils/framework_version.spec.d.ts +0 -1
- package/dist/utils/framework_version.spec.js +0 -13
- package/dist/utils/header_utils.d.ts +0 -12
- package/dist/utils/header_utils.js +0 -29
- package/dist/utils/header_utils.spec.d.ts +0 -1
- package/dist/utils/header_utils.spec.js +0 -52
- package/dist/utils/input_parser.d.ts +0 -1
- package/dist/utils/input_parser.js +0 -19
- package/dist/utils/output_formatter.d.ts +0 -2
- package/dist/utils/output_formatter.js +0 -11
- package/dist/utils/paths.d.ts +0 -25
- package/dist/utils/paths.js +0 -36
- package/dist/utils/process.d.ts +0 -4
- package/dist/utils/process.js +0 -50
- package/dist/utils/resolve_input.d.ts +0 -1
- package/dist/utils/resolve_input.js +0 -22
- package/dist/utils/scenario_resolver.d.ts +0 -9
- package/dist/utils/scenario_resolver.js +0 -93
- package/dist/utils/scenario_resolver.spec.d.ts +0 -1
- package/dist/utils/scenario_resolver.spec.js +0 -214
- package/dist/utils/secret_sanitizer.d.ts +0 -1
- package/dist/utils/secret_sanitizer.js +0 -29
- package/dist/utils/sleep.d.ts +0 -5
- package/dist/utils/sleep.js +0 -5
- package/dist/utils/template.d.ts +0 -9
- package/dist/utils/template.js +0 -30
- package/dist/utils/template.spec.d.ts +0 -1
- package/dist/utils/template.spec.js +0 -77
- package/dist/utils/trace_extractor.d.ts +0 -27
- package/dist/utils/trace_extractor.js +0 -53
- package/dist/utils/trace_formatter.d.ts +0 -11
- package/dist/utils/trace_formatter.js +0 -402
- package/dist/utils/validation.d.ts +0 -13
- package/dist/utils/validation.js +0 -25
- package/dist/utils/validation.spec.d.ts +0 -1
- package/dist/utils/validation.spec.js +0 -140
package/dist/types/errors.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error thrown when a workflow already exists
|
|
3
|
-
*/
|
|
4
|
-
export class WorkflowExistsError extends Error {
|
|
5
|
-
constructor(workflowName, targetPath) {
|
|
6
|
-
super(`Workflow "${workflowName}" already exists at ${targetPath}. Use --force to overwrite.`);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Error thrown when workflow name is invalid
|
|
11
|
-
*/
|
|
12
|
-
export class InvalidNameError extends Error {
|
|
13
|
-
constructor(name) {
|
|
14
|
-
super(`Invalid workflow name "${name}". Name must contain only letters, numbers, hyphens, and underscores.`);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Error thrown when template file is not found
|
|
19
|
-
*/
|
|
20
|
-
export class TemplateNotFoundError extends Error {
|
|
21
|
-
constructor(templateFile) {
|
|
22
|
-
super(`Template file "${templateFile}" not found. Please ensure CLI is properly installed.`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Error thrown when output directory is invalid or inaccessible
|
|
27
|
-
*/
|
|
28
|
-
export class InvalidOutputDirectoryError extends Error {
|
|
29
|
-
constructor(outputDir, reason) {
|
|
30
|
-
const message = reason ?
|
|
31
|
-
`Invalid output directory "${outputDir}": ${reason}` :
|
|
32
|
-
`Invalid output directory "${outputDir}"`;
|
|
33
|
-
super(message);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Error thrown when folder already exists during initialization
|
|
38
|
-
*/
|
|
39
|
-
export class FolderAlreadyExistsError extends Error {
|
|
40
|
-
folderPath;
|
|
41
|
-
constructor(folderPath) {
|
|
42
|
-
super(`Folder already exists: ${folderPath}`);
|
|
43
|
-
this.folderPath = folderPath;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Error thrown when user cancels initialization
|
|
48
|
-
*/
|
|
49
|
-
export class UserCancelledError extends Error {
|
|
50
|
-
constructor() {
|
|
51
|
-
super('Init cancelled by user.');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Type-safe error wrapper that preserves original error with context
|
|
56
|
-
*/
|
|
57
|
-
export class ProjectInitError extends Error {
|
|
58
|
-
originalError;
|
|
59
|
-
projectPath;
|
|
60
|
-
constructor(message, originalError, projectPath = null) {
|
|
61
|
-
super(message);
|
|
62
|
-
this.originalError = originalError;
|
|
63
|
-
this.projectPath = projectPath;
|
|
64
|
-
// Preserve original stack trace
|
|
65
|
-
if (originalError.stack) {
|
|
66
|
-
this.stack = originalError.stack;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Error thrown when directory creation fails with project context
|
|
72
|
-
*/
|
|
73
|
-
export class DirectoryCreationError extends Error {
|
|
74
|
-
projectPath;
|
|
75
|
-
/**
|
|
76
|
-
* @param message - The error message
|
|
77
|
-
* @param projectPath - The path where directory creation failed
|
|
78
|
-
*/
|
|
79
|
-
constructor(message, projectPath) {
|
|
80
|
-
super(message);
|
|
81
|
-
this.projectPath = projectPath;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Error thrown when a Claude CLI plugin command fails
|
|
86
|
-
*/
|
|
87
|
-
export class ClaudePluginError extends Error {
|
|
88
|
-
commandName;
|
|
89
|
-
originalError;
|
|
90
|
-
/**
|
|
91
|
-
* @param commandName - The Claude command that failed (e.g., 'plugin update outputai')
|
|
92
|
-
* @param originalError - The underlying error from the command execution
|
|
93
|
-
*/
|
|
94
|
-
constructor(commandName, originalError) {
|
|
95
|
-
const originalMessage = originalError?.message || 'Unknown error';
|
|
96
|
-
super(`Claude command '${commandName}' failed: ${originalMessage}`);
|
|
97
|
-
this.commandName = commandName;
|
|
98
|
-
this.originalError = originalError;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { ClaudePluginError } from './errors.js';
|
|
3
|
-
describe('ClaudePluginError', () => {
|
|
4
|
-
it('should instantiate with command name and original error', () => {
|
|
5
|
-
const originalError = new Error('Connection failed');
|
|
6
|
-
const error = new ClaudePluginError('plugin update outputai', originalError);
|
|
7
|
-
expect(error).toBeInstanceOf(Error);
|
|
8
|
-
expect(error).toBeInstanceOf(ClaudePluginError);
|
|
9
|
-
expect(error.commandName).toBe('plugin update outputai');
|
|
10
|
-
expect(error.originalError).toBe(originalError);
|
|
11
|
-
});
|
|
12
|
-
it('should format error message to include command context', () => {
|
|
13
|
-
const originalError = new Error('Command not found');
|
|
14
|
-
const error = new ClaudePluginError('plugin install outputai@outputai', originalError);
|
|
15
|
-
expect(error.message).toContain('plugin install outputai@outputai');
|
|
16
|
-
expect(error.message).toContain('Command not found');
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration for workflow generation
|
|
3
|
-
*/
|
|
4
|
-
export interface WorkflowGenerationConfig {
|
|
5
|
-
name: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
outputDir: string;
|
|
8
|
-
skeleton: boolean;
|
|
9
|
-
force: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Result of workflow generation
|
|
13
|
-
*/
|
|
14
|
-
export interface WorkflowGenerationResult {
|
|
15
|
-
workflowName: string;
|
|
16
|
-
targetDir: string;
|
|
17
|
-
filesCreated: string[];
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Template file information
|
|
21
|
-
*/
|
|
22
|
-
export interface TemplateFile {
|
|
23
|
-
name: string;
|
|
24
|
-
path: string;
|
|
25
|
-
outputName: string;
|
|
26
|
-
}
|
package/dist/types/generator.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/types/trace.d.ts
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trace types for workflow execution data.
|
|
3
|
-
*
|
|
4
|
-
* These types represent the structure of trace files generated during workflow execution,
|
|
5
|
-
* used for debugging, visualization, and analysis of workflow runs.
|
|
6
|
-
*/
|
|
7
|
-
/** Node kind values for trace events */
|
|
8
|
-
export type NodeKind = 'workflow' | 'activity' | 'step' | 'internal_step' | string;
|
|
9
|
-
/** Phase of a trace event lifecycle */
|
|
10
|
-
export type NodePhase = 'start' | 'end' | 'error' | string;
|
|
11
|
-
/** Execution status of a node */
|
|
12
|
-
export type NodeStatus = 'completed' | 'failed' | 'running' | string;
|
|
13
|
-
/**
|
|
14
|
-
* Details associated with a trace event.
|
|
15
|
-
* Contains input/output data and identifying information for the event.
|
|
16
|
-
*/
|
|
17
|
-
export interface TraceDetails {
|
|
18
|
-
/** Input data passed to the step/activity */
|
|
19
|
-
input?: unknown;
|
|
20
|
-
/** Output data returned from the step/activity */
|
|
21
|
-
output?: unknown;
|
|
22
|
-
/** Name of the activity (for activity events) */
|
|
23
|
-
activityName?: string;
|
|
24
|
-
/** Name of the step (for step events) */
|
|
25
|
-
stepName?: string;
|
|
26
|
-
/** Generic name field */
|
|
27
|
-
name?: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* A trace event representing a point in workflow execution.
|
|
31
|
-
* Used for timeline display and event-based analysis.
|
|
32
|
-
*/
|
|
33
|
-
export interface TraceEvent {
|
|
34
|
-
/** The type of event (workflow, activity, step, etc.) */
|
|
35
|
-
kind: NodeKind;
|
|
36
|
-
/** The lifecycle phase of the event */
|
|
37
|
-
phase: NodePhase;
|
|
38
|
-
/** Unix timestamp when the event occurred */
|
|
39
|
-
timestamp: number;
|
|
40
|
-
/** Unique identifier for the workflow run */
|
|
41
|
-
workflowId: string;
|
|
42
|
-
/** Name of the workflow being executed */
|
|
43
|
-
workflowName: string;
|
|
44
|
-
/** Additional event details including input/output */
|
|
45
|
-
details?: TraceDetails;
|
|
46
|
-
/** Child events for nested executions */
|
|
47
|
-
children?: TraceEvent[];
|
|
48
|
-
/** Error information if the event represents a failure */
|
|
49
|
-
error?: unknown;
|
|
50
|
-
/** Duration of the event in milliseconds */
|
|
51
|
-
duration?: number;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* A node in the debug tree representation of workflow execution.
|
|
55
|
-
* Contains more detailed timing and state information than TraceEvent.
|
|
56
|
-
*/
|
|
57
|
-
export interface DebugNode {
|
|
58
|
-
/** The type of node (workflow, activity, step, internal_step) */
|
|
59
|
-
kind?: NodeKind;
|
|
60
|
-
/** Alternative type field */
|
|
61
|
-
type?: string;
|
|
62
|
-
/** The name of the step or activity */
|
|
63
|
-
name?: string;
|
|
64
|
-
/** Name of the workflow (for workflow nodes) */
|
|
65
|
-
workflowName?: string;
|
|
66
|
-
/** Name of the step (for step nodes) */
|
|
67
|
-
stepName?: string;
|
|
68
|
-
/** Name of the activity (for activity nodes) */
|
|
69
|
-
activityName?: string;
|
|
70
|
-
/** The lifecycle phase of the node */
|
|
71
|
-
phase?: NodePhase;
|
|
72
|
-
/** Execution status (completed, failed, running) */
|
|
73
|
-
status?: NodeStatus;
|
|
74
|
-
/** Unix timestamp or ISO string when execution started */
|
|
75
|
-
startedAt?: number | string;
|
|
76
|
-
/** Unix timestamp when the event occurred */
|
|
77
|
-
timestamp?: number | string;
|
|
78
|
-
/** Unix timestamp or ISO string when execution ended */
|
|
79
|
-
endedAt?: number | string;
|
|
80
|
-
/** Unix timestamp when execution started (alternative field) */
|
|
81
|
-
startTime?: number;
|
|
82
|
-
/** Unix timestamp when execution ended (alternative field) */
|
|
83
|
-
endTime?: number;
|
|
84
|
-
/** Execution duration in milliseconds */
|
|
85
|
-
duration?: number;
|
|
86
|
-
/** Input data passed to the step/activity */
|
|
87
|
-
input?: unknown;
|
|
88
|
-
/** Output data returned from the step/activity */
|
|
89
|
-
output?: unknown;
|
|
90
|
-
/** Additional execution details */
|
|
91
|
-
details?: Record<string, unknown>;
|
|
92
|
-
/** Error information if the node failed */
|
|
93
|
-
error?: unknown;
|
|
94
|
-
/** Child nodes representing nested executions */
|
|
95
|
-
children?: DebugNode[];
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Root structure of a workflow trace.
|
|
99
|
-
* Contains the execution tree and optional flat event list.
|
|
100
|
-
*/
|
|
101
|
-
export interface TraceStructure {
|
|
102
|
-
/** Root node of the execution tree */
|
|
103
|
-
root?: TraceEvent | DebugNode;
|
|
104
|
-
/** Flat list of execution events for timeline display */
|
|
105
|
-
events?: TraceEvent[];
|
|
106
|
-
/** Hierarchical tree of execution nodes (alternative to root.children) */
|
|
107
|
-
children?: DebugNode[];
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* The structure of a workflow trace file generated by Output.ai workflow runs.
|
|
111
|
-
* This file is written to the local filesystem during workflow execution and contains
|
|
112
|
-
* the complete execution history including timing, inputs, outputs, and any errors.
|
|
113
|
-
*/
|
|
114
|
-
export interface TraceData {
|
|
115
|
-
/** Root workflow execution information */
|
|
116
|
-
root: {
|
|
117
|
-
/** The name of the workflow that was executed */
|
|
118
|
-
workflowName: string;
|
|
119
|
-
/** Unique identifier for this workflow run */
|
|
120
|
-
workflowId: string;
|
|
121
|
-
/** Unix timestamp when the workflow started */
|
|
122
|
-
startTime: number;
|
|
123
|
-
/** Unix timestamp when the workflow ended */
|
|
124
|
-
endTime?: number;
|
|
125
|
-
/** Total workflow duration in milliseconds */
|
|
126
|
-
duration?: number;
|
|
127
|
-
/** Final workflow status */
|
|
128
|
-
status?: string;
|
|
129
|
-
/** Error information if the workflow failed */
|
|
130
|
-
error?: unknown;
|
|
131
|
-
};
|
|
132
|
-
/** Flat list of execution events for timeline display */
|
|
133
|
-
events?: Array<{
|
|
134
|
-
name: string;
|
|
135
|
-
phase: string;
|
|
136
|
-
timestamp: number;
|
|
137
|
-
details?: unknown;
|
|
138
|
-
}>;
|
|
139
|
-
/** Hierarchical tree of execution nodes */
|
|
140
|
-
children?: DebugNode[];
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Extracted node information for display formatting.
|
|
144
|
-
* Used internally by the trace formatter.
|
|
145
|
-
*/
|
|
146
|
-
export interface NodeInfo {
|
|
147
|
-
/** Display name for the node */
|
|
148
|
-
name: string;
|
|
149
|
-
/** Formatted phase indicator */
|
|
150
|
-
phase: string;
|
|
151
|
-
/** Formatted duration string */
|
|
152
|
-
duration: string;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Type guard to check if a node is a TraceEvent.
|
|
156
|
-
*/
|
|
157
|
-
export declare const isTraceEvent: (node: TraceEvent | DebugNode) => node is TraceEvent;
|
|
158
|
-
/**
|
|
159
|
-
* Type guard to check if a value is a valid timestamp.
|
|
160
|
-
*/
|
|
161
|
-
export declare const isValidTimestamp: (value: unknown) => value is number | string;
|
package/dist/types/trace.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trace types for workflow execution data.
|
|
3
|
-
*
|
|
4
|
-
* These types represent the structure of trace files generated during workflow execution,
|
|
5
|
-
* used for debugging, visualization, and analysis of workflow runs.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Type guard to check if a node is a TraceEvent.
|
|
9
|
-
*/
|
|
10
|
-
export const isTraceEvent = (node) => {
|
|
11
|
-
return 'workflowId' in node && 'timestamp' in node;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Type guard to check if a value is a valid timestamp.
|
|
15
|
-
*/
|
|
16
|
-
export const isValidTimestamp = (value) => {
|
|
17
|
-
return typeof value === 'number' || typeof value === 'string';
|
|
18
|
-
};
|
package/dist/utils/claude.d.ts
DELETED
package/dist/utils/claude.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { spawnSync } from 'node:child_process';
|
|
2
|
-
import { executeCommand } from './process.js';
|
|
3
|
-
export function isClaudeCliAvailable() {
|
|
4
|
-
const result = spawnSync('claude', ['--version'], { encoding: 'utf8' });
|
|
5
|
-
return result.status === 0;
|
|
6
|
-
}
|
|
7
|
-
export async function executeClaudeCommand(args, cwd, options) {
|
|
8
|
-
if (!isClaudeCliAvailable()) {
|
|
9
|
-
throw new Error('Claude CLI not found. Please install Claude Code CLI and ensure \'claude\' is in your PATH.');
|
|
10
|
-
}
|
|
11
|
-
try {
|
|
12
|
-
await executeCommand('claude', args, cwd);
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
if (!options?.ignoreFailure) {
|
|
16
|
-
throw error;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
|
-
import { isClaudeCliAvailable, executeClaudeCommand } from './claude.js';
|
|
3
|
-
import { spawnSync } from 'node:child_process';
|
|
4
|
-
import * as processModule from './process.js';
|
|
5
|
-
vi.mock('node:child_process', () => ({
|
|
6
|
-
spawnSync: vi.fn()
|
|
7
|
-
}));
|
|
8
|
-
vi.mock('./process.js', () => ({
|
|
9
|
-
executeCommand: vi.fn()
|
|
10
|
-
}));
|
|
11
|
-
describe('claude utilities', () => {
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
vi.clearAllMocks();
|
|
14
|
-
});
|
|
15
|
-
describe('isClaudeCliAvailable', () => {
|
|
16
|
-
it('should return true when claude CLI is available', () => {
|
|
17
|
-
vi.mocked(spawnSync).mockReturnValue({
|
|
18
|
-
status: 0,
|
|
19
|
-
stdout: 'claude 1.0.0',
|
|
20
|
-
stderr: '',
|
|
21
|
-
pid: 1234,
|
|
22
|
-
output: [],
|
|
23
|
-
signal: null
|
|
24
|
-
});
|
|
25
|
-
const result = isClaudeCliAvailable();
|
|
26
|
-
expect(result).toBe(true);
|
|
27
|
-
expect(spawnSync).toHaveBeenCalledWith('claude', ['--version'], { encoding: 'utf8' });
|
|
28
|
-
});
|
|
29
|
-
it('should return false when claude CLI is not found', () => {
|
|
30
|
-
vi.mocked(spawnSync).mockReturnValue({
|
|
31
|
-
status: 1,
|
|
32
|
-
stdout: '',
|
|
33
|
-
stderr: 'command not found',
|
|
34
|
-
pid: 1234,
|
|
35
|
-
output: [],
|
|
36
|
-
signal: null
|
|
37
|
-
});
|
|
38
|
-
const result = isClaudeCliAvailable();
|
|
39
|
-
expect(result).toBe(false);
|
|
40
|
-
});
|
|
41
|
-
it('should return false when status is null', () => {
|
|
42
|
-
vi.mocked(spawnSync).mockReturnValue({
|
|
43
|
-
status: null,
|
|
44
|
-
stdout: '',
|
|
45
|
-
stderr: '',
|
|
46
|
-
pid: 1234,
|
|
47
|
-
output: [],
|
|
48
|
-
signal: 'SIGTERM'
|
|
49
|
-
});
|
|
50
|
-
const result = isClaudeCliAvailable();
|
|
51
|
-
expect(result).toBe(false);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
describe('executeClaudeCommand', () => {
|
|
55
|
-
it('should throw error when Claude CLI is not available', async () => {
|
|
56
|
-
vi.mocked(spawnSync).mockReturnValue({
|
|
57
|
-
status: 1,
|
|
58
|
-
stdout: '',
|
|
59
|
-
stderr: '',
|
|
60
|
-
pid: 1234,
|
|
61
|
-
output: [],
|
|
62
|
-
signal: null
|
|
63
|
-
});
|
|
64
|
-
await expect(executeClaudeCommand(['plugin', 'list'], '/test'))
|
|
65
|
-
.rejects.toThrow('Claude CLI not found');
|
|
66
|
-
expect(processModule.executeCommand).not.toHaveBeenCalled();
|
|
67
|
-
});
|
|
68
|
-
it('should call executeCommand with correct arguments when CLI is available', async () => {
|
|
69
|
-
vi.mocked(spawnSync).mockReturnValue({
|
|
70
|
-
status: 0,
|
|
71
|
-
stdout: '',
|
|
72
|
-
stderr: '',
|
|
73
|
-
pid: 1234,
|
|
74
|
-
output: [],
|
|
75
|
-
signal: null
|
|
76
|
-
});
|
|
77
|
-
vi.mocked(processModule.executeCommand).mockResolvedValue({ stderr: [] });
|
|
78
|
-
await executeClaudeCommand(['plugin', 'install', 'test'], '/project');
|
|
79
|
-
expect(processModule.executeCommand).toHaveBeenCalledWith('claude', ['plugin', 'install', 'test'], '/project');
|
|
80
|
-
});
|
|
81
|
-
it('should propagate errors when ignoreFailure is not set', async () => {
|
|
82
|
-
vi.mocked(spawnSync).mockReturnValue({
|
|
83
|
-
status: 0,
|
|
84
|
-
stdout: '',
|
|
85
|
-
stderr: '',
|
|
86
|
-
pid: 1234,
|
|
87
|
-
output: [],
|
|
88
|
-
signal: null
|
|
89
|
-
});
|
|
90
|
-
vi.mocked(processModule.executeCommand).mockRejectedValue(new Error('Command failed'));
|
|
91
|
-
await expect(executeClaudeCommand(['plugin', 'list'], '/test'))
|
|
92
|
-
.rejects.toThrow('Command failed');
|
|
93
|
-
});
|
|
94
|
-
it('should suppress errors when ignoreFailure is true', async () => {
|
|
95
|
-
vi.mocked(spawnSync).mockReturnValue({
|
|
96
|
-
status: 0,
|
|
97
|
-
stdout: '',
|
|
98
|
-
stderr: '',
|
|
99
|
-
pid: 1234,
|
|
100
|
-
output: [],
|
|
101
|
-
signal: null
|
|
102
|
-
});
|
|
103
|
-
vi.mocked(processModule.executeCommand).mockRejectedValue(new Error('Command failed'));
|
|
104
|
-
await expect(executeClaudeCommand(['plugin', 'list'], '/test', { ignoreFailure: true })).resolves.toBeUndefined();
|
|
105
|
-
});
|
|
106
|
-
it('should not suppress errors when ignoreFailure is false', async () => {
|
|
107
|
-
vi.mocked(spawnSync).mockReturnValue({
|
|
108
|
-
status: 0,
|
|
109
|
-
stdout: '',
|
|
110
|
-
stderr: '',
|
|
111
|
-
pid: 1234,
|
|
112
|
-
output: [],
|
|
113
|
-
signal: null
|
|
114
|
-
});
|
|
115
|
-
vi.mocked(processModule.executeCommand).mockRejectedValue(new Error('Command failed'));
|
|
116
|
-
await expect(executeClaudeCommand(['plugin', 'list'], '/test', { ignoreFailure: false })).rejects.toThrow('Command failed');
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
});
|
package/dist/utils/constants.js
DELETED