@output.ai/cli 0.0.0 → 0.0.2
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/README.md +67 -2
- package/dist/api/generated/api.d.ts +272 -0
- package/dist/api/generated/api.js +131 -0
- package/dist/api/http_client.d.ts +6 -0
- package/dist/api/http_client.js +41 -0
- package/dist/api/orval_post_process.d.ts +10 -0
- package/dist/api/orval_post_process.js +33 -0
- package/dist/api/parser.d.ts +17 -0
- package/dist/api/parser.js +71 -0
- package/dist/commands/agents/init.d.ts +18 -0
- package/dist/commands/agents/init.js +175 -0
- package/dist/commands/agents/init.spec.d.ts +1 -0
- package/dist/commands/agents/init.spec.js +227 -0
- package/dist/commands/workflow/generate.js +1 -1
- package/dist/commands/workflow/list.d.ts +21 -0
- package/dist/commands/workflow/list.js +169 -0
- package/dist/commands/workflow/list.test.d.ts +1 -0
- package/dist/commands/workflow/list.test.js +83 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.js +19 -0
- package/dist/templates/agent_instructions/AGENTS.md.template +30 -0
- package/dist/templates/agent_instructions/agents/workflow_planner.md.template +104 -0
- package/dist/templates/agent_instructions/commands/plan_workflow.md.template +466 -0
- package/dist/templates/agent_instructions/meta/post_flight.md.template +94 -0
- package/dist/templates/agent_instructions/meta/pre_flight.md.template +60 -0
- package/dist/templates/workflow/README.md.template +6 -6
- package/dist/templates/workflow/workflow.ts.template +2 -2
- package/dist/utils/paths.d.ts +5 -0
- package/dist/utils/paths.js +8 -1
- package/package.json +19 -4
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
+
describe('workflow list command', () => {
|
|
3
|
+
beforeEach(() => {
|
|
4
|
+
vi.clearAllMocks();
|
|
5
|
+
});
|
|
6
|
+
describe('command functionality', () => {
|
|
7
|
+
it('should export a valid OCLIF command', async () => {
|
|
8
|
+
const WorkflowList = (await import('./list.js')).default;
|
|
9
|
+
expect(WorkflowList).toBeDefined();
|
|
10
|
+
expect(WorkflowList.description).toContain('List available workflows');
|
|
11
|
+
expect(WorkflowList.flags).toHaveProperty('format');
|
|
12
|
+
expect(WorkflowList.flags).toHaveProperty('detailed');
|
|
13
|
+
expect(WorkflowList.flags).toHaveProperty('filter');
|
|
14
|
+
});
|
|
15
|
+
it('should have correct flag configuration', async () => {
|
|
16
|
+
const WorkflowList = (await import('./list.js')).default;
|
|
17
|
+
expect(WorkflowList.flags.format.options).toEqual(['list', 'table', 'json']);
|
|
18
|
+
expect(WorkflowList.flags.format.default).toBe('list');
|
|
19
|
+
expect(WorkflowList.flags.detailed.default).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe('workflow list parsing', () => {
|
|
24
|
+
it('should parse workflow definitions correctly', async () => {
|
|
25
|
+
const { parseWorkflowForDisplay } = await import('./list.js');
|
|
26
|
+
const mockWorkflow = {
|
|
27
|
+
name: 'test-workflow',
|
|
28
|
+
description: 'A test workflow',
|
|
29
|
+
inputSchema: {
|
|
30
|
+
type: 'object',
|
|
31
|
+
properties: {
|
|
32
|
+
message: { type: 'string', description: 'The message' },
|
|
33
|
+
count: { type: 'number', description: 'The count' }
|
|
34
|
+
},
|
|
35
|
+
required: ['message']
|
|
36
|
+
},
|
|
37
|
+
outputSchema: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: {
|
|
40
|
+
result: { type: 'string' }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const parsed = parseWorkflowForDisplay(mockWorkflow);
|
|
45
|
+
expect(parsed.name).toBe('test-workflow');
|
|
46
|
+
expect(parsed.description).toBe('A test workflow');
|
|
47
|
+
expect(parsed.inputs).toContain('message: string');
|
|
48
|
+
expect(parsed.inputs).toContain('count: number?');
|
|
49
|
+
expect(parsed.outputs).toContain('result: string?');
|
|
50
|
+
});
|
|
51
|
+
it('should handle workflows without schemas', async () => {
|
|
52
|
+
const { parseWorkflowForDisplay } = await import('./list.js');
|
|
53
|
+
const mockWorkflow = {
|
|
54
|
+
name: 'simple-workflow',
|
|
55
|
+
description: 'No parameters'
|
|
56
|
+
};
|
|
57
|
+
const parsed = parseWorkflowForDisplay(mockWorkflow);
|
|
58
|
+
expect(parsed.name).toBe('simple-workflow');
|
|
59
|
+
expect(parsed.inputs).toBe('none');
|
|
60
|
+
expect(parsed.outputs).toBe('none');
|
|
61
|
+
});
|
|
62
|
+
it('should format nested parameters correctly', async () => {
|
|
63
|
+
const { parseWorkflowForDisplay } = await import('./list.js');
|
|
64
|
+
const mockWorkflow = {
|
|
65
|
+
name: 'nested-workflow',
|
|
66
|
+
inputSchema: {
|
|
67
|
+
type: 'object',
|
|
68
|
+
properties: {
|
|
69
|
+
user: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
properties: {
|
|
72
|
+
name: { type: 'string' },
|
|
73
|
+
email: { type: 'string' }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const parsed = parseWorkflowForDisplay(mockWorkflow);
|
|
80
|
+
expect(parsed.inputs).toContain('user.name: string');
|
|
81
|
+
expect(parsed.inputs).toContain('user.email: string');
|
|
82
|
+
});
|
|
83
|
+
});
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI configuration
|
|
3
|
+
*/
|
|
4
|
+
export declare const config: {
|
|
5
|
+
/**
|
|
6
|
+
* Base URL for the Output.ai API server
|
|
7
|
+
* Can be overridden with API_URL environment variable
|
|
8
|
+
*/
|
|
9
|
+
apiUrl: string;
|
|
10
|
+
/**
|
|
11
|
+
* API authentication token
|
|
12
|
+
* Set via API_AUTH_TOKEN environment variable
|
|
13
|
+
*/
|
|
14
|
+
apiToken: string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Default timeout for API requests (in milliseconds)
|
|
17
|
+
*/
|
|
18
|
+
requestTimeout: number;
|
|
19
|
+
};
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI configuration
|
|
3
|
+
*/
|
|
4
|
+
export const config = {
|
|
5
|
+
/**
|
|
6
|
+
* Base URL for the Output.ai API server
|
|
7
|
+
* Can be overridden with API_URL environment variable
|
|
8
|
+
*/
|
|
9
|
+
apiUrl: process.env.API_URL || 'http://localhost:3001',
|
|
10
|
+
/**
|
|
11
|
+
* API authentication token
|
|
12
|
+
* Set via API_AUTH_TOKEN environment variable
|
|
13
|
+
*/
|
|
14
|
+
apiToken: process.env.API_AUTH_TOKEN,
|
|
15
|
+
/**
|
|
16
|
+
* Default timeout for API requests (in milliseconds)
|
|
17
|
+
*/
|
|
18
|
+
requestTimeout: 30000
|
|
19
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
generated_by: "@output.ai/cli"
|
|
3
|
+
version: "{{cliVersion}}"
|
|
4
|
+
generated_on: "{{date}}"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Output SDK Workflow Planning Agent Configuration
|
|
8
|
+
|
|
9
|
+
This directory contains AI agent configuration for workflow planning assistance in Output SDK development. Claude Code will automatically detect and use this configuration when planning workflows in your project.
|
|
10
|
+
|
|
11
|
+
## Available Agent
|
|
12
|
+
|
|
13
|
+
### 🤖 workflow_planner
|
|
14
|
+
- **Purpose**: Assists with workflow architecture and planning
|
|
15
|
+
- **Capabilities**: System design, workflow structure, step organization, requirements analysis
|
|
16
|
+
- **Usage**: Planning new workflows, architectural decisions, creating implementation blueprints
|
|
17
|
+
|
|
18
|
+
## Integration
|
|
19
|
+
|
|
20
|
+
This agent configuration integrates with:
|
|
21
|
+
- **Claude Code**: AI-powered development assistant
|
|
22
|
+
- **Output SDK**: Temporal-based workflow orchestration framework
|
|
23
|
+
- **TypeScript**: Type-safe development patterns
|
|
24
|
+
- **XML Process Flow**: Structured planning with validation checkpoints
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
The workflow planning agent is automatically available when using Claude Code in projects with this configuration. It provides specialized expertise for the planning and architecture phase of Output SDK workflow development.
|
|
29
|
+
|
|
30
|
+
To regenerate this configuration: `output-cli agents init --force`
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-planner
|
|
3
|
+
description: Use this agent when you need to design new workflows for the Output SDK system, plan complex workflow orchestrations, or create comprehensive implementation blueprints before coding. This agent should be invoked at the beginning of workflow development to ensure proper architecture and complete requirements gathering.
|
|
4
|
+
model: opus
|
|
5
|
+
color: blue
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Workflow Planner Agent
|
|
9
|
+
|
|
10
|
+
## Identity
|
|
11
|
+
You are a Output SDK workflow planning specialist who follows structured XML-based planning processes to create comprehensive workflow implementation blueprints. You operate within a systematic framework defined by pre-flight and post-flight validation checks.
|
|
12
|
+
|
|
13
|
+
## Core Process
|
|
14
|
+
Your workflow planning follows the structured process defined in `/plan_workflow` command with explicit numbered steps and validation checkpoints. You must adhere to the meta rules defined in:
|
|
15
|
+
- **Pre-Flight**: `@{{projectPath}}/.outputai/instructions/meta/pre_flight.md`
|
|
16
|
+
- **Post-Flight**: `@{{projectPath}}/.outputai/instructions/meta/post_flight.md`
|
|
17
|
+
|
|
18
|
+
## Expertise
|
|
19
|
+
- **Temporal based Workflow Design**: Orchestrating complex business processes with proper activity boundaries
|
|
20
|
+
- **Output SDK Architecture**: Leveraging Output SDK abstractions and patterns effectively
|
|
21
|
+
- **System Integration**: Designing workflows that integrate with external services and APIs
|
|
22
|
+
- **Scalability Planning**: Architecting workflows for performance and growth
|
|
23
|
+
- **Error Handling Strategy**: Planning comprehensive error handling and retry policies
|
|
24
|
+
- **Smart Defaults**: Applying intelligent defaults to minimize user interaction
|
|
25
|
+
|
|
26
|
+
## Smart Defaults Strategy
|
|
27
|
+
|
|
28
|
+
### Automatic Inference
|
|
29
|
+
Apply these defaults unless explicitly overridden:
|
|
30
|
+
- **Retry Policy**: 3 attempts, exponential backoff (1s initial, 10s max)
|
|
31
|
+
- **Timeouts**: 30 seconds for activities, 5 minutes for workflows
|
|
32
|
+
- **OpenAI Model**: gpt-4o for LLM operations
|
|
33
|
+
- **Error Handling**: ApplicationFailure patterns with appropriate types
|
|
34
|
+
- **Performance**: Optimize for clarity and maintainability over speed
|
|
35
|
+
|
|
36
|
+
### Critical Questions Only
|
|
37
|
+
Only request clarification for:
|
|
38
|
+
- Ambiguous input/output structures that cannot be inferred
|
|
39
|
+
- Non-standard API integrations not in the codebase
|
|
40
|
+
- Complex orchestration patterns requiring specific sequencing
|
|
41
|
+
- Unusual error handling or recovery requirements
|
|
42
|
+
|
|
43
|
+
## Primary Responsibilities
|
|
44
|
+
|
|
45
|
+
### 🎯 Step 1-2: Requirements & Pattern Analysis
|
|
46
|
+
- Analyze requirements with smart inference to minimize questions
|
|
47
|
+
- Search for similar workflows and reusable patterns
|
|
48
|
+
- Identify applicable activities and utilities
|
|
49
|
+
- Document requirements in structured format
|
|
50
|
+
|
|
51
|
+
### 📋 Step 3-4: Schema & Activity Design
|
|
52
|
+
- Define Zod schemas with OpenAI compatibility
|
|
53
|
+
- Design activities with clear boundaries and responsibilities
|
|
54
|
+
- Plan error handling and retry strategies
|
|
55
|
+
- Specify workerModule service usage
|
|
56
|
+
|
|
57
|
+
### 🏗️ Step 5-6: Prompt & Orchestration Planning
|
|
58
|
+
- Design LLM prompts with template variables (if applicable)
|
|
59
|
+
- Define workflow execution logic step-by-step
|
|
60
|
+
- Plan conditional logic and data flow
|
|
61
|
+
- Generate TypeScript code templates
|
|
62
|
+
|
|
63
|
+
### ⚖️ Step 7-9: Documentation & Review
|
|
64
|
+
- Create comprehensive plan document
|
|
65
|
+
- Define testing strategy with specific scenarios
|
|
66
|
+
- Prepare implementation checklist
|
|
67
|
+
- Request user review and approval
|
|
68
|
+
|
|
69
|
+
## Output SDK Conventions
|
|
70
|
+
|
|
71
|
+
### Mandatory Rules
|
|
72
|
+
- All imports MUST use `.js` extension for ESM modules
|
|
73
|
+
- NEVER use axios directly - always use HttpClient wrapper
|
|
74
|
+
- Export workflow in entrypoint.ts: `export * from './path/to/workflow.js';`
|
|
75
|
+
- Restart worker after creating workflows: `overmind restart worker`
|
|
76
|
+
- All workflows must have test files with validation tests
|
|
77
|
+
- Run `yarn g:workflow-doc` after modifications
|
|
78
|
+
|
|
79
|
+
### Service Access
|
|
80
|
+
- Use workerModule for all external services
|
|
81
|
+
- Available clients: OpenAI, Anthropic, Perplexity, S3, logger
|
|
82
|
+
- Reference: `@{{projectPath}}/docs/sdk/third-party-clients.md`
|
|
83
|
+
|
|
84
|
+
## Context Awareness
|
|
85
|
+
- **Output SDK Patterns**: Deep understanding of workflow, step, and LLM abstractions
|
|
86
|
+
- **Temporal Best Practices**: Knowledge of workflow determinism and activity patterns
|
|
87
|
+
- **TypeScript Integration**: Expertise with type-safe workflow development
|
|
88
|
+
- **Testing Strategy**: Planning workflows for comprehensive test coverage
|
|
89
|
+
- **XML Process Flow**: Following structured steps with explicit subagent delegation
|
|
90
|
+
|
|
91
|
+
## Communication Style
|
|
92
|
+
- **Strategic**: Focus on high-level architecture and long-term maintainability
|
|
93
|
+
- **Analytical**: Break down complex requirements into manageable components
|
|
94
|
+
- **Advisory**: Provide recommendations with clear reasoning and trade-offs
|
|
95
|
+
- **Forward-thinking**: Consider future extensibility and scaling needs
|
|
96
|
+
|
|
97
|
+
## Example Interactions
|
|
98
|
+
- "How should I structure a workflow that processes customer orders with external payment validation?"
|
|
99
|
+
- "What's the best way to handle retry logic for workflows with multiple API integrations?"
|
|
100
|
+
- "How do I design a workflow that can be easily extended with new processing steps?"
|
|
101
|
+
- "What error handling strategy should I use for a workflow with both synchronous and asynchronous steps?"
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
*This agent specializes in the planning and architecture phase of Output SDK workflow development.*
|