@output.ai/cli 0.0.5 → 0.0.6
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/dist/api/http_client.js +1 -1
- package/dist/commands/agents/init.d.ts +2 -2
- package/dist/commands/agents/init.js +2 -2
- package/dist/commands/agents/init.spec.js +2 -2
- package/dist/commands/workflow/generate.d.ts +5 -5
- package/dist/commands/workflow/generate.js +2 -2
- package/dist/commands/workflow/generate.spec.js +2 -2
- package/dist/commands/workflow/list.d.ts +4 -4
- package/dist/commands/workflow/list.js +3 -3
- package/dist/commands/workflow/output.d.ts +2 -2
- package/dist/commands/workflow/output.js +4 -4
- package/dist/commands/workflow/plan.d.ts +2 -2
- package/dist/commands/workflow/plan.js +2 -2
- package/dist/commands/workflow/plan.spec.js +2 -2
- package/dist/commands/workflow/run.d.ts +4 -4
- package/dist/commands/workflow/run.js +5 -5
- package/dist/commands/workflow/start.d.ts +3 -3
- package/dist/commands/workflow/start.js +3 -3
- package/dist/commands/workflow/status.d.ts +2 -2
- package/dist/commands/workflow/status.js +4 -4
- package/dist/commands/workflow/stop.d.ts +1 -1
- package/dist/commands/workflow/stop.js +2 -2
- package/dist/services/claude_client.js +44 -13
- package/dist/services/coding_agents.js +3 -3
- package/dist/services/template_processor.d.ts +1 -1
- package/dist/services/template_processor.js +1 -1
- package/dist/services/workflow_generator.d.ts +1 -1
- package/dist/services/workflow_generator.js +4 -4
- package/dist/services/workflow_planner.js +1 -1
- package/dist/utils/error_handler.js +1 -1
- package/dist/utils/validation.js +1 -1
- package/package.json +7 -3
package/dist/api/http_client.js
CHANGED
|
@@ -4,8 +4,8 @@ export default class Init extends Command {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {};
|
|
6
6
|
static flags: {
|
|
7
|
-
'agent-provider': import("@oclif/core/lib/interfaces
|
|
8
|
-
force: import("@oclif/core/lib/interfaces
|
|
7
|
+
'agent-provider': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
};
|
|
10
10
|
run(): Promise<void>;
|
|
11
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
|
-
import { AGENT_CONFIG_DIR } from '
|
|
3
|
-
import { initializeAgentConfig, AGENT_CONFIGS } from '
|
|
2
|
+
import { AGENT_CONFIG_DIR } from '#config.js';
|
|
3
|
+
import { initializeAgentConfig, AGENT_CONFIGS } from '#services/coding_agents.js';
|
|
4
4
|
export default class Init extends Command {
|
|
5
5
|
static description = 'Initialize agent configuration files for AI assistant integration';
|
|
6
6
|
static examples = [
|
|
@@ -3,8 +3,8 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import Init from './init.js';
|
|
6
|
-
import { getTemplateDir } from '
|
|
7
|
-
import { processTemplate } from '
|
|
6
|
+
import { getTemplateDir } from '#utils/paths.js';
|
|
7
|
+
import { processTemplate } from '#utils/template.js';
|
|
8
8
|
vi.mock('node:fs/promises');
|
|
9
9
|
vi.mock('node:path', async () => {
|
|
10
10
|
const actual = await vi.importActual('node:path');
|
|
@@ -3,13 +3,13 @@ export default class Generate extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
skeleton: import("@oclif/core/lib/interfaces
|
|
7
|
-
description: import("@oclif/core/lib/interfaces
|
|
8
|
-
'output-dir': import("@oclif/core/lib/interfaces
|
|
9
|
-
force: import("@oclif/core/lib/interfaces
|
|
6
|
+
skeleton: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
};
|
|
11
11
|
static args: {
|
|
12
|
-
name: import("@oclif/core/lib/interfaces
|
|
12
|
+
name: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
13
13
|
};
|
|
14
14
|
run(): Promise<void>;
|
|
15
15
|
private displaySuccess;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
-
import { generateWorkflow } from '
|
|
3
|
-
import { DEFAULT_OUTPUT_DIRS } from '
|
|
2
|
+
import { generateWorkflow } from '#services/workflow_generator.js';
|
|
3
|
+
import { DEFAULT_OUTPUT_DIRS } from '#utils/paths.js';
|
|
4
4
|
export default class Generate extends Command {
|
|
5
5
|
static description = 'Generate a new Output SDK workflow';
|
|
6
6
|
static examples = [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable no-restricted-syntax, @typescript-eslint/no-explicit-any, init-declarations */
|
|
2
2
|
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
3
3
|
import Generate from './generate.js';
|
|
4
|
-
import { generateWorkflow } from '
|
|
5
|
-
import { InvalidNameError, WorkflowExistsError } from '
|
|
4
|
+
import { generateWorkflow } from '#services/workflow_generator.js';
|
|
5
|
+
import { InvalidNameError, WorkflowExistsError } from '#types/errors.js';
|
|
6
6
|
vi.mock('../../services/workflow_generator.js');
|
|
7
7
|
describe('Generate Command', () => {
|
|
8
8
|
let mockGenerateWorkflow;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
-
import { type Workflow } from '
|
|
2
|
+
import { type Workflow } from '#api/generated/api.js';
|
|
3
3
|
interface WorkflowDisplay {
|
|
4
4
|
name: string;
|
|
5
5
|
description: string;
|
|
@@ -11,9 +11,9 @@ export default class WorkflowList extends Command {
|
|
|
11
11
|
static description: string;
|
|
12
12
|
static examples: string[];
|
|
13
13
|
static flags: {
|
|
14
|
-
format: import("@oclif/core/lib/interfaces
|
|
15
|
-
detailed: import("@oclif/core/lib/interfaces
|
|
16
|
-
filter: import("@oclif/core/lib/interfaces
|
|
14
|
+
format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
detailed: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
filter: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
17
|
};
|
|
18
18
|
run(): Promise<void>;
|
|
19
19
|
catch(error: Error): Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
import Table from 'cli-table3';
|
|
3
|
-
import { getWorkflowCatalog } from '
|
|
4
|
-
import { parseWorkflowDefinition, formatParameters } from '
|
|
5
|
-
import { handleApiError } from '
|
|
3
|
+
import { getWorkflowCatalog } from '#api/generated/api.js';
|
|
4
|
+
import { parseWorkflowDefinition, formatParameters } from '#api/parser.js';
|
|
5
|
+
import { handleApiError } from '#utils/error_handler.js';
|
|
6
6
|
const OUTPUT_FORMAT = {
|
|
7
7
|
LIST: 'list',
|
|
8
8
|
TABLE: 'table',
|
|
@@ -3,10 +3,10 @@ export default class WorkflowOutput extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {
|
|
6
|
-
workflowId: import("@oclif/core/lib/interfaces
|
|
6
|
+
workflowId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
|
-
format: import("@oclif/core/lib/interfaces
|
|
9
|
+
format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
run(): Promise<void>;
|
|
12
12
|
catch(error: Error): Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
-
import { getWorkflowIdOutput } from '
|
|
3
|
-
import { OUTPUT_FORMAT } from '
|
|
4
|
-
import { formatOutput } from '
|
|
5
|
-
import { handleApiError } from '
|
|
2
|
+
import { getWorkflowIdOutput } from '#api/generated/api.js';
|
|
3
|
+
import { OUTPUT_FORMAT } from '#utils/constants.js';
|
|
4
|
+
import { formatOutput } from '#utils/output_formatter.js';
|
|
5
|
+
import { handleApiError } from '#utils/error_handler.js';
|
|
6
6
|
export default class WorkflowOutput extends Command {
|
|
7
7
|
static description = 'Get workflow execution output';
|
|
8
8
|
static examples = [
|
|
@@ -3,8 +3,8 @@ export default class WorkflowPlan extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
'force-agent-file-write': import("@oclif/core/lib/interfaces
|
|
7
|
-
description: import("@oclif/core/lib/interfaces
|
|
6
|
+
'force-agent-file-write': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
8
|
};
|
|
9
9
|
run(): Promise<void>;
|
|
10
10
|
private planModificationLoop;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command, Flags, ux } from '@oclif/core';
|
|
2
2
|
import { input } from '@inquirer/prompts';
|
|
3
|
-
import { ensureOutputAIStructure, generatePlanName, updateAgentTemplates, writePlanFile } from '
|
|
4
|
-
import { invokePlanWorkflow, replyToClaude } from '
|
|
3
|
+
import { ensureOutputAIStructure, generatePlanName, updateAgentTemplates, writePlanFile } from '#services/workflow_planner.js';
|
|
4
|
+
import { invokePlanWorkflow, replyToClaude } from '#services/claude_client.js';
|
|
5
5
|
export default class WorkflowPlan extends Command {
|
|
6
6
|
static description = 'Generate a workflow plan from a description';
|
|
7
7
|
static examples = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
|
|
2
2
|
import WorkflowPlan from './plan.js';
|
|
3
|
-
import { ensureOutputAIStructure, generatePlanName, writePlanFile, updateAgentTemplates } from '
|
|
4
|
-
import { invokePlanWorkflow, replyToClaude, ClaudeInvocationError } from '
|
|
3
|
+
import { ensureOutputAIStructure, generatePlanName, writePlanFile, updateAgentTemplates } from '#services/workflow_planner.js';
|
|
4
|
+
import { invokePlanWorkflow, replyToClaude, ClaudeInvocationError } from '#services/claude_client.js';
|
|
5
5
|
import { input } from '@inquirer/prompts';
|
|
6
6
|
vi.mock('../../services/workflow_planner.js');
|
|
7
7
|
vi.mock('../../services/claude_client.js');
|
|
@@ -3,12 +3,12 @@ export default class WorkflowRun extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {
|
|
6
|
-
workflowName: import("@oclif/core/lib/interfaces
|
|
6
|
+
workflowName: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
|
-
input: import("@oclif/core/lib/interfaces
|
|
10
|
-
'task-queue': import("@oclif/core/lib/interfaces
|
|
11
|
-
format: import("@oclif/core/lib/interfaces
|
|
9
|
+
input: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'task-queue': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
12
|
};
|
|
13
13
|
run(): Promise<void>;
|
|
14
14
|
catch(error: Error): Promise<void>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
-
import { postWorkflowRun } from '
|
|
3
|
-
import { OUTPUT_FORMAT } from '
|
|
4
|
-
import { parseInputFlag } from '
|
|
5
|
-
import { formatOutput } from '
|
|
6
|
-
import { handleApiError } from '
|
|
2
|
+
import { postWorkflowRun } from '#api/generated/api.js';
|
|
3
|
+
import { OUTPUT_FORMAT } from '#utils/constants.js';
|
|
4
|
+
import { parseInputFlag } from '#utils/input_parser.js';
|
|
5
|
+
import { formatOutput } from '#utils/output_formatter.js';
|
|
6
|
+
import { handleApiError } from '#utils/error_handler.js';
|
|
7
7
|
export default class WorkflowRun extends Command {
|
|
8
8
|
static description = 'Execute a workflow synchronously and wait for completion';
|
|
9
9
|
static examples = [
|
|
@@ -3,11 +3,11 @@ export default class WorkflowStart extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {
|
|
6
|
-
workflowName: import("@oclif/core/lib/interfaces
|
|
6
|
+
workflowName: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
|
-
input: import("@oclif/core/lib/interfaces
|
|
10
|
-
'task-queue': import("@oclif/core/lib/interfaces
|
|
9
|
+
input: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
'task-queue': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
catch(error: Error): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
-
import { postWorkflowStart } from '
|
|
3
|
-
import { parseInputFlag } from '
|
|
4
|
-
import { handleApiError } from '
|
|
2
|
+
import { postWorkflowStart } from '#api/generated/api.js';
|
|
3
|
+
import { parseInputFlag } from '#utils/input_parser.js';
|
|
4
|
+
import { handleApiError } from '#utils/error_handler.js';
|
|
5
5
|
export default class WorkflowStart extends Command {
|
|
6
6
|
static description = 'Start a workflow asynchronously without waiting for completion';
|
|
7
7
|
static examples = [
|
|
@@ -3,10 +3,10 @@ export default class WorkflowStatus extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {
|
|
6
|
-
workflowId: import("@oclif/core/lib/interfaces
|
|
6
|
+
workflowId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
static flags: {
|
|
9
|
-
format: import("@oclif/core/lib/interfaces
|
|
9
|
+
format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
run(): Promise<void>;
|
|
12
12
|
catch(error: Error): Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
-
import { getWorkflowIdStatus } from '
|
|
3
|
-
import { OUTPUT_FORMAT } from '
|
|
4
|
-
import { formatOutput } from '
|
|
5
|
-
import { handleApiError } from '
|
|
2
|
+
import { getWorkflowIdStatus } from '#api/generated/api.js';
|
|
3
|
+
import { OUTPUT_FORMAT } from '#utils/constants.js';
|
|
4
|
+
import { formatOutput } from '#utils/output_formatter.js';
|
|
5
|
+
import { handleApiError } from '#utils/error_handler.js';
|
|
6
6
|
export default class WorkflowStatus extends Command {
|
|
7
7
|
static description = 'Get workflow execution status';
|
|
8
8
|
static examples = [
|
|
@@ -3,7 +3,7 @@ export default class WorkflowStop extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {
|
|
6
|
-
workflowId: import("@oclif/core/lib/interfaces
|
|
6
|
+
workflowId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
7
|
};
|
|
8
8
|
run(): Promise<void>;
|
|
9
9
|
catch(error: Error): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Args, Command } from '@oclif/core';
|
|
2
|
-
import { patchWorkflowIdStop } from '
|
|
3
|
-
import { handleApiError } from '
|
|
2
|
+
import { patchWorkflowIdStop } from '#api/generated/api.js';
|
|
3
|
+
import { handleApiError } from '#utils/error_handler.js';
|
|
4
4
|
export default class WorkflowStop extends Command {
|
|
5
5
|
static description = 'Stop a workflow execution';
|
|
6
6
|
static examples = [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { query } from '@anthropic-ai/claude-agent-sdk';
|
|
5
5
|
import { ux } from '@oclif/core';
|
|
6
|
-
import
|
|
6
|
+
import * as cliProgress from 'cli-progress';
|
|
7
7
|
const ADDITIONAL_INSTRUCTIONS = `
|
|
8
8
|
! IMPORTANT !
|
|
9
9
|
1. Use TodoWrite to track your progress through plan creation.
|
|
@@ -71,20 +71,48 @@ function getTodoWriteMessage(message) {
|
|
|
71
71
|
const todoWriteMessage = message.message.content.find((c) => c?.type === 'tool_use' && c.name === 'TodoWrite');
|
|
72
72
|
return todoWriteMessage ?? null;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function applyInstructions(initialMessage) {
|
|
75
|
+
return `${initialMessage}\n\n${ADDITIONAL_INSTRUCTIONS}`;
|
|
76
|
+
}
|
|
77
|
+
function createProgressBar() {
|
|
78
|
+
return new cliProgress.SingleBar({
|
|
79
|
+
format: '{bar} | {message} ({percentage}%)',
|
|
80
|
+
barCompleteChar: '█',
|
|
81
|
+
barIncompleteChar: '░',
|
|
82
|
+
hideCursor: true,
|
|
83
|
+
barsize: 40,
|
|
84
|
+
fps: 10,
|
|
85
|
+
stopOnComplete: false
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function calculateProgress(completedCount, totalCount) {
|
|
89
|
+
if (totalCount === 0) {
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
const percentage = ((completedCount + 1) / (totalCount + 1)) * 100;
|
|
93
|
+
return Math.round(percentage * 10) / 10;
|
|
94
|
+
}
|
|
95
|
+
function getProgressUpdate(message) {
|
|
75
96
|
const todoWriteMessage = getTodoWriteMessage(message);
|
|
76
97
|
if (!todoWriteMessage) {
|
|
77
98
|
return null;
|
|
78
99
|
}
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
100
|
+
const allTodos = todoWriteMessage.input.todos;
|
|
101
|
+
const inProgressTodo = allTodos.find(t => t.status === 'in_progress');
|
|
102
|
+
if (!inProgressTodo?.content) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
const completedTodos = allTodos.filter(t => t.status === 'completed');
|
|
106
|
+
return {
|
|
107
|
+
message: `${inProgressTodo.content}...`,
|
|
108
|
+
completed: completedTodos.length,
|
|
109
|
+
total: allTodos.length
|
|
110
|
+
};
|
|
84
111
|
}
|
|
85
112
|
async function singleQuery(prompt, options = {}) {
|
|
86
113
|
validateEnvironment();
|
|
87
|
-
const
|
|
114
|
+
const progressBar = createProgressBar();
|
|
115
|
+
progressBar.start(100, 0, { message: 'Thinking...' });
|
|
88
116
|
try {
|
|
89
117
|
for await (const message of query({
|
|
90
118
|
prompt,
|
|
@@ -92,20 +120,23 @@ async function singleQuery(prompt, options = {}) {
|
|
|
92
120
|
})) {
|
|
93
121
|
if (message.type === 'system' && message.subtype === 'init') {
|
|
94
122
|
validateSystem(message);
|
|
95
|
-
|
|
123
|
+
progressBar.update(1, { message: 'Diving in...' });
|
|
96
124
|
}
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
|
|
125
|
+
const progressUpdate = getProgressUpdate(message);
|
|
126
|
+
if (progressUpdate) {
|
|
127
|
+
const percentage = calculateProgress(progressUpdate.completed, progressUpdate.total);
|
|
128
|
+
progressBar.update(percentage, { message: progressUpdate.message });
|
|
100
129
|
}
|
|
101
130
|
if (message.type === 'result' && message.subtype === 'success') {
|
|
102
|
-
|
|
131
|
+
progressBar.update(100, { message: 'Complete!' });
|
|
132
|
+
progressBar.stop();
|
|
103
133
|
return message.result;
|
|
104
134
|
}
|
|
105
135
|
}
|
|
106
136
|
throw new Error('No output received from claude-code');
|
|
107
137
|
}
|
|
108
138
|
catch (error) {
|
|
139
|
+
progressBar.stop();
|
|
109
140
|
throw new ClaudeInvocationError(`Failed to invoke claude-code: ${error.message}`, error);
|
|
110
141
|
}
|
|
111
142
|
}
|
|
@@ -7,9 +7,9 @@ import { access } from 'node:fs/promises';
|
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import { join } from 'node:path';
|
|
9
9
|
import { ux } from '@oclif/core';
|
|
10
|
-
import { AGENT_CONFIG_DIR } from '
|
|
11
|
-
import { getTemplateDir } from '
|
|
12
|
-
import { processTemplate } from '
|
|
10
|
+
import { AGENT_CONFIG_DIR } from '#config.js';
|
|
11
|
+
import { getTemplateDir } from '#utils/paths.js';
|
|
12
|
+
import { processTemplate } from '#utils/template.js';
|
|
13
13
|
/**
|
|
14
14
|
* Agent configuration mappings for different providers
|
|
15
15
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from 'node:fs/promises';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
|
-
import { processTemplate } from '
|
|
3
|
+
import { processTemplate } from '#utils/template.js';
|
|
4
4
|
const TEMPLATE_EXTENSION = '.template';
|
|
5
5
|
function isTemplateFile(file) {
|
|
6
6
|
return file.endsWith(TEMPLATE_EXTENSION);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as fs from 'node:fs/promises';
|
|
2
|
-
import { WorkflowExistsError } from '
|
|
3
|
-
import { createTargetDir, getTemplateDir } from '
|
|
4
|
-
import { validateWorkflowName, validateOutputDirectory } from '
|
|
5
|
-
import { prepareTemplateVariables } from '
|
|
2
|
+
import { WorkflowExistsError } from '#types/errors.js';
|
|
3
|
+
import { createTargetDir, getTemplateDir } from '#utils/paths.js';
|
|
4
|
+
import { validateWorkflowName, validateOutputDirectory } from '#utils/validation.js';
|
|
5
|
+
import { prepareTemplateVariables } from '#utils/template.js';
|
|
6
6
|
import { getTemplateFiles, processAllTemplates } from './template_processor.js';
|
|
7
7
|
/**
|
|
8
8
|
* Validate the generation configuration
|
|
@@ -6,7 +6,7 @@ import { format } from 'date-fns';
|
|
|
6
6
|
import fs from 'node:fs/promises';
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import { ux } from '@oclif/core';
|
|
9
|
-
import { AGENT_CONFIG_DIR } from '
|
|
9
|
+
import { AGENT_CONFIG_DIR } from '#config.js';
|
|
10
10
|
/**
|
|
11
11
|
* Invoke agents init programmatically
|
|
12
12
|
*/
|
package/dist/utils/validation.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvalidNameError, InvalidOutputDirectoryError } from '
|
|
1
|
+
import { InvalidNameError, InvalidOutputDirectoryError } from '#types/errors.js';
|
|
2
2
|
/**
|
|
3
3
|
* Validate workflow name format
|
|
4
4
|
* Must contain only letters, numbers, hyphens, and underscores
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@output.ai/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "CLI for Output.ai workflow generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,17 +26,18 @@
|
|
|
26
26
|
"@oclif/plugin-help": "^6",
|
|
27
27
|
"@oclif/plugin-plugins": "^5",
|
|
28
28
|
"change-case": "^5.4.4",
|
|
29
|
+
"cli-progress": "^3.12.0",
|
|
29
30
|
"cli-table3": "^0.6.5",
|
|
30
31
|
"date-fns": "^4.1.0",
|
|
31
32
|
"handlebars": "^4.7.8",
|
|
32
33
|
"json-schema-library": "^10.2.1",
|
|
33
34
|
"ky": "^1.11.0",
|
|
34
35
|
"local_llm": "file:../llm",
|
|
35
|
-
"local_prompt": "file:../prompt"
|
|
36
|
-
"ora": "^9.0.0"
|
|
36
|
+
"local_prompt": "file:../prompt"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@oclif/test": "^4",
|
|
40
|
+
"@types/cli-progress": "^3.11.6",
|
|
40
41
|
"@types/handlebars": "^4.0.40",
|
|
41
42
|
"@types/node": "^18",
|
|
42
43
|
"copyfiles": "^2.4.1",
|
|
@@ -45,6 +46,9 @@
|
|
|
45
46
|
"slash": "^5.1.0"
|
|
46
47
|
},
|
|
47
48
|
"license": "UNLICENSED",
|
|
49
|
+
"imports": {
|
|
50
|
+
"#*": "./dist/*"
|
|
51
|
+
},
|
|
48
52
|
"oclif": {
|
|
49
53
|
"bin": "output",
|
|
50
54
|
"dirname": "output",
|