sessioncast-cli 2.0.2 → 2.0.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.
Files changed (45) hide show
  1. package/dist/agent/runner.js +24 -2
  2. package/dist/agent/session-handler.d.ts +3 -2
  3. package/dist/agent/session-handler.js +60 -53
  4. package/dist/agent/tmux-executor.d.ts +19 -33
  5. package/dist/agent/tmux-executor.js +51 -38
  6. package/dist/agent/tmux.d.ts +12 -6
  7. package/dist/agent/tmux.js +16 -9
  8. package/dist/agent/types.d.ts +0 -10
  9. package/dist/agent/websocket.d.ts +6 -13
  10. package/dist/agent/websocket.js +36 -37
  11. package/dist/commands/agent.js +3 -0
  12. package/dist/index.js +14 -0
  13. package/dist/sentry.d.ts +4 -0
  14. package/dist/sentry.js +87 -0
  15. package/package.json +2 -1
  16. package/dist/autopilot/index.d.ts +0 -94
  17. package/dist/autopilot/index.js +0 -322
  18. package/dist/autopilot/mission-analyzer.d.ts +0 -27
  19. package/dist/autopilot/mission-analyzer.js +0 -232
  20. package/dist/autopilot/project-detector.d.ts +0 -12
  21. package/dist/autopilot/project-detector.js +0 -326
  22. package/dist/autopilot/source-scanner.d.ts +0 -26
  23. package/dist/autopilot/source-scanner.js +0 -285
  24. package/dist/autopilot/speckit-generator.d.ts +0 -60
  25. package/dist/autopilot/speckit-generator.js +0 -511
  26. package/dist/autopilot/types.d.ts +0 -110
  27. package/dist/autopilot/types.js +0 -6
  28. package/dist/autopilot/workflow-generator.d.ts +0 -33
  29. package/dist/autopilot/workflow-generator.js +0 -278
  30. package/dist/commands/autopilot.d.ts +0 -30
  31. package/dist/commands/autopilot.js +0 -262
  32. package/dist/commands/project.d.ts +0 -33
  33. package/dist/commands/project.js +0 -350
  34. package/dist/project/executor.d.ts +0 -73
  35. package/dist/project/executor.js +0 -437
  36. package/dist/project/index.d.ts +0 -4
  37. package/dist/project/index.js +0 -20
  38. package/dist/project/manager.d.ts +0 -66
  39. package/dist/project/manager.js +0 -290
  40. package/dist/project/relay-client.d.ts +0 -37
  41. package/dist/project/relay-client.js +0 -204
  42. package/dist/project/types.d.ts +0 -48
  43. package/dist/project/types.js +0 -3
  44. package/dist/utils/fileUtils.d.ts +0 -28
  45. package/dist/utils/fileUtils.js +0 -159
@@ -1,278 +0,0 @@
1
- "use strict";
2
- /**
3
- * WorkflowGenerator - Convert mission analysis into executable workflow
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.generateWorkflow = generateWorkflow;
40
- exports.toExecutableWorkflow = toExecutableWorkflow;
41
- exports.createQuickWorkflow = createQuickWorkflow;
42
- const path = __importStar(require("path"));
43
- /**
44
- * Generate workflow from mission analysis
45
- */
46
- function generateWorkflow(analysis, context) {
47
- // Generate unique workflow name
48
- const timestamp = new Date().toISOString().replace(/[-:T]/g, '').slice(0, 14);
49
- const workflowName = `autopilot-${timestamp}`;
50
- // Determine required agents based on steps
51
- const agents = createAgents(analysis.steps, context);
52
- // Create workflow steps with proper IDs and dependencies
53
- const steps = createSteps(analysis.steps, agents);
54
- return {
55
- name: workflowName,
56
- mission: analysis.mission,
57
- agents,
58
- steps
59
- };
60
- }
61
- /**
62
- * Create agent configurations based on step types
63
- */
64
- function createAgents(steps, context) {
65
- const agentTypes = new Set();
66
- for (const step of steps) {
67
- agentTypes.add(step.type);
68
- }
69
- const agents = [];
70
- for (const type of agentTypes) {
71
- const agentId = `agent-${type}`;
72
- const workDir = getWorkDirForType(type, context);
73
- agents.push({
74
- id: agentId,
75
- name: getAgentName(type, context.projectType),
76
- role: getAgentRole(type),
77
- workingDir: workDir
78
- });
79
- }
80
- // If only one agent, use a generic name
81
- if (agents.length === 1) {
82
- agents[0].name = `${context.projectName} Developer`;
83
- agents[0].id = 'agent-main';
84
- }
85
- return agents;
86
- }
87
- /**
88
- * Get working directory for agent type
89
- */
90
- function getWorkDirForType(type, context) {
91
- const { workingDir, projectType } = context;
92
- switch (type) {
93
- case 'frontend':
94
- // React/Vue/Next projects might have frontend in root or src
95
- if (['react', 'next', 'vue'].includes(projectType)) {
96
- return workingDir;
97
- }
98
- // Full-stack projects might have separate frontend dir
99
- return path.join(workingDir, 'frontend');
100
- case 'backend':
101
- if (['spring', 'go', 'rust', 'python', 'node'].includes(projectType)) {
102
- return workingDir;
103
- }
104
- return path.join(workingDir, 'backend');
105
- case 'mobile':
106
- if (projectType === 'android') {
107
- return path.join(workingDir, 'app');
108
- }
109
- if (projectType === 'ios') {
110
- return workingDir;
111
- }
112
- return workingDir;
113
- case 'infra':
114
- return workingDir;
115
- case 'test':
116
- return workingDir;
117
- case 'fullstack':
118
- default:
119
- return workingDir;
120
- }
121
- }
122
- /**
123
- * Get agent display name
124
- */
125
- function getAgentName(type, projectType) {
126
- const typeNames = {
127
- frontend: 'Frontend Developer',
128
- backend: 'Backend Developer',
129
- fullstack: 'Full-Stack Developer',
130
- mobile: getMobileAgentName(projectType),
131
- infra: 'DevOps Engineer',
132
- test: 'QA Engineer'
133
- };
134
- return typeNames[type];
135
- }
136
- /**
137
- * Get mobile agent name based on platform
138
- */
139
- function getMobileAgentName(projectType) {
140
- if (projectType === 'android')
141
- return 'Android Developer';
142
- if (projectType === 'ios')
143
- return 'iOS Developer';
144
- return 'Mobile Developer';
145
- }
146
- /**
147
- * Get agent role description
148
- */
149
- function getAgentRole(type) {
150
- const roles = {
151
- frontend: 'Implements UI components and client-side logic',
152
- backend: 'Implements server-side logic and APIs',
153
- fullstack: 'Handles both frontend and backend development',
154
- mobile: 'Develops mobile application features',
155
- infra: 'Manages infrastructure and deployment',
156
- test: 'Creates and runs tests'
157
- };
158
- return roles[type];
159
- }
160
- /**
161
- * Create workflow steps from analyzed steps
162
- */
163
- function createSteps(analyzedSteps, agents) {
164
- const steps = [];
165
- const stepIdMap = new Map();
166
- // First pass: create steps and generate IDs
167
- for (let i = 0; i < analyzedSteps.length; i++) {
168
- const analyzed = analyzedSteps[i];
169
- const stepId = `step-${i + 1}`;
170
- stepIdMap.set(analyzed.name, stepId);
171
- // Find the agent for this step type
172
- const agent = findAgentForType(analyzed.type, agents);
173
- steps.push({
174
- id: stepId,
175
- name: analyzed.name,
176
- description: analyzed.description,
177
- agentId: agent.id,
178
- prompt: buildAgentPrompt(analyzed),
179
- status: 'pending'
180
- });
181
- }
182
- // Second pass: resolve dependencies
183
- for (let i = 0; i < analyzedSteps.length; i++) {
184
- const analyzed = analyzedSteps[i];
185
- if (analyzed.dependsOn && analyzed.dependsOn.length > 0) {
186
- steps[i].dependsOn = analyzed.dependsOn
187
- .map(name => stepIdMap.get(name))
188
- .filter((id) => id !== undefined);
189
- }
190
- }
191
- return steps;
192
- }
193
- /**
194
- * Find the appropriate agent for a step type
195
- */
196
- function findAgentForType(type, agents) {
197
- // First try exact match
198
- const exact = agents.find(a => a.id === `agent-${type}`);
199
- if (exact)
200
- return exact;
201
- // If only one agent, use it
202
- if (agents.length === 1)
203
- return agents[0];
204
- // Fallback to fullstack or first available
205
- const fullstack = agents.find(a => a.id === 'agent-fullstack');
206
- return fullstack || agents[0];
207
- }
208
- /**
209
- * Build detailed prompt for agent execution
210
- */
211
- function buildAgentPrompt(step) {
212
- let prompt = step.prompt;
213
- // Add context if not already present
214
- if (!prompt.toLowerCase().includes('step') && !prompt.toLowerCase().includes('task')) {
215
- prompt = `Task: ${step.name}\n\n${step.description}\n\nDetails:\n${step.prompt}`;
216
- }
217
- return prompt;
218
- }
219
- /**
220
- * Convert GeneratedWorkflow to existing Workflow format
221
- */
222
- function toExecutableWorkflow(generated) {
223
- // Group steps by agent
224
- const agentTasks = new Map();
225
- const agentDeps = new Map();
226
- for (const step of generated.steps) {
227
- const tasks = agentTasks.get(step.agentId) || [];
228
- tasks.push(step.prompt);
229
- agentTasks.set(step.agentId, tasks);
230
- // Collect dependencies (other agents this agent depends on)
231
- if (step.dependsOn) {
232
- const deps = agentDeps.get(step.agentId) || new Set();
233
- for (const depStepId of step.dependsOn) {
234
- const depStep = generated.steps.find(s => s.id === depStepId);
235
- if (depStep && depStep.agentId !== step.agentId) {
236
- deps.add(depStep.agentId);
237
- }
238
- }
239
- agentDeps.set(step.agentId, deps);
240
- }
241
- }
242
- return {
243
- name: generated.name,
244
- mission: generated.mission,
245
- created: new Date().toISOString(),
246
- agents: generated.agents.map(agent => ({
247
- id: agent.id,
248
- name: agent.name,
249
- workDir: agent.workingDir,
250
- tasks: agentTasks.get(agent.id) || [],
251
- dependsOn: Array.from(agentDeps.get(agent.id) || [])
252
- }))
253
- };
254
- }
255
- /**
256
- * Create a simple single-agent workflow for quick execution
257
- */
258
- function createQuickWorkflow(prompt, context) {
259
- const timestamp = new Date().toISOString().replace(/[-:T]/g, '').slice(0, 14);
260
- return {
261
- name: `quick-${timestamp}`,
262
- mission: prompt,
263
- agents: [{
264
- id: 'agent-main',
265
- name: `${context.projectName} Developer`,
266
- role: 'Full-stack developer for this project',
267
- workingDir: context.workingDir
268
- }],
269
- steps: [{
270
- id: 'step-1',
271
- name: 'Execute task',
272
- description: prompt,
273
- agentId: 'agent-main',
274
- prompt: prompt,
275
- status: 'pending'
276
- }]
277
- };
278
- }
@@ -1,30 +0,0 @@
1
- /**
2
- * AutoPilot CLI Command
3
- * Single-prompt execution: sessioncast auto "implement feature X"
4
- */
5
- interface AutoPilotCommandOptions {
6
- path?: string;
7
- quick?: boolean;
8
- dryRun?: boolean;
9
- verbose?: boolean;
10
- relay?: string;
11
- relayToken?: string;
12
- save?: boolean;
13
- speckit?: boolean;
14
- }
15
- /**
16
- * Main autopilot command handler
17
- */
18
- export declare function autoPilotCommand(prompt: string, options: AutoPilotCommandOptions): Promise<void>;
19
- /**
20
- * Auto-run command - single prompt with immediate execution
21
- */
22
- export declare function autoRunCommand(prompt: string, options: AutoPilotCommandOptions): Promise<void>;
23
- /**
24
- * Detect command - just show project detection results
25
- */
26
- export declare function detectCommand(options: {
27
- path?: string;
28
- verbose?: boolean;
29
- }): Promise<void>;
30
- export {};
@@ -1,262 +0,0 @@
1
- "use strict";
2
- /**
3
- * AutoPilot CLI Command
4
- * Single-prompt execution: sessioncast auto "implement feature X"
5
- */
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || (function () {
23
- var ownKeys = function(o) {
24
- ownKeys = Object.getOwnPropertyNames || function (o) {
25
- var ar = [];
26
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
- return ar;
28
- };
29
- return ownKeys(o);
30
- };
31
- return function (mod) {
32
- if (mod && mod.__esModule) return mod;
33
- var result = {};
34
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
- __setModuleDefault(result, mod);
36
- return result;
37
- };
38
- })();
39
- var __importDefault = (this && this.__importDefault) || function (mod) {
40
- return (mod && mod.__esModule) ? mod : { "default": mod };
41
- };
42
- Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.autoPilotCommand = autoPilotCommand;
44
- exports.autoRunCommand = autoRunCommand;
45
- exports.detectCommand = detectCommand;
46
- const chalk_1 = __importDefault(require("chalk"));
47
- const path = __importStar(require("path"));
48
- const fs = __importStar(require("fs"));
49
- const ora_1 = __importDefault(require("ora"));
50
- const autopilot_1 = require("../autopilot");
51
- /**
52
- * Main autopilot command handler
53
- */
54
- async function autoPilotCommand(prompt, options) {
55
- const workingDir = path.resolve(options.path || process.cwd());
56
- // Validate directory
57
- if (!fs.existsSync(workingDir)) {
58
- console.error(chalk_1.default.red(`Directory not found: ${workingDir}`));
59
- process.exit(1);
60
- }
61
- console.log(chalk_1.default.bold('\n SessionCast AutoPilot\n'));
62
- console.log(chalk_1.default.gray(` Working directory: ${workingDir}`));
63
- console.log(chalk_1.default.cyan(` Mission: ${prompt}\n`));
64
- const spinner = (0, ora_1.default)({ text: 'Initializing...', spinner: 'dots' }).start();
65
- try {
66
- const pilot = new autopilot_1.AutoPilot({
67
- workingDir,
68
- verbose: options.verbose,
69
- dryRun: options.dryRun,
70
- relayUrl: options.relay,
71
- token: options.relayToken
72
- });
73
- // Listen to phase events
74
- pilot.on('phase', (phase, message) => {
75
- spinner.text = message;
76
- });
77
- // Execute
78
- let workflow;
79
- if (options.quick) {
80
- spinner.text = 'Quick mode: generating workflow...';
81
- workflow = await pilot.quickExecute(prompt);
82
- }
83
- else {
84
- workflow = await pilot.execute(prompt);
85
- }
86
- spinner.succeed('Analysis complete');
87
- // Display summary
88
- console.log(chalk_1.default.bold('\n Analysis Summary\n'));
89
- console.log(pilot.getSummary());
90
- console.log('');
91
- // Save workflow if requested
92
- if (options.save) {
93
- const savedPath = await pilot.saveWorkflow();
94
- console.log(chalk_1.default.green(` Workflow saved: ${savedPath}\n`));
95
- }
96
- // Generate Speckit format if requested
97
- if (options.speckit) {
98
- const { planPath, tasksPath } = pilot.saveSpeckit();
99
- console.log(chalk_1.default.bold('\n Speckit Generated\n'));
100
- console.log(chalk_1.default.green(` Plan: ${planPath}`));
101
- console.log(chalk_1.default.green(` Tasks: ${tasksPath}\n`));
102
- }
103
- // Dry run - just show what would happen
104
- if (options.dryRun) {
105
- console.log(chalk_1.default.yellow(' [Dry run] Workflow not executed.\n'));
106
- console.log(chalk_1.default.gray(' Remove --dry-run to execute the workflow.\n'));
107
- return;
108
- }
109
- // Execute the workflow using ProjectManager
110
- const executableWorkflow = pilot.toExecutableFormat();
111
- if (!executableWorkflow) {
112
- console.error(chalk_1.default.red(' Failed to generate executable workflow'));
113
- process.exit(1);
114
- }
115
- // Check if project is initialized
116
- const sessioncastDir = path.join(workingDir, '.sessioncast');
117
- if (!fs.existsSync(sessioncastDir)) {
118
- console.log(chalk_1.default.yellow(' Project not initialized. Initializing now...\n'));
119
- fs.mkdirSync(sessioncastDir, { recursive: true });
120
- fs.mkdirSync(path.join(sessioncastDir, 'workflows'), { recursive: true });
121
- }
122
- // Save workflow
123
- const workflowPath = path.join(sessioncastDir, 'workflows', `${executableWorkflow.name}.json`);
124
- fs.writeFileSync(workflowPath, JSON.stringify(executableWorkflow, null, 2));
125
- // Update project.json to use this workflow
126
- const projectJsonPath = path.join(sessioncastDir, 'project.json');
127
- const projectJson = fs.existsSync(projectJsonPath)
128
- ? JSON.parse(fs.readFileSync(projectJsonPath, 'utf-8'))
129
- : { name: path.basename(workingDir), created: new Date().toISOString() };
130
- projectJson.workflow = executableWorkflow.name;
131
- projectJson.lastUpdated = new Date().toISOString();
132
- fs.writeFileSync(projectJsonPath, JSON.stringify(projectJson, null, 2));
133
- console.log(chalk_1.default.bold(' Ready to Execute\n'));
134
- console.log(chalk_1.default.gray(` Workflow: ${executableWorkflow.name}`));
135
- console.log(chalk_1.default.gray(` Agents: ${executableWorkflow.agents.length}`));
136
- console.log('');
137
- // Ask for confirmation unless skipConfirm
138
- console.log(chalk_1.default.cyan(' Run `sessioncast project run .` to execute the workflow.\n'));
139
- }
140
- catch (error) {
141
- spinner.fail('AutoPilot failed');
142
- console.error(chalk_1.default.red(`\n Error: ${error instanceof Error ? error.message : 'Unknown error'}\n`));
143
- if (options.verbose) {
144
- console.error(error);
145
- }
146
- process.exit(1);
147
- }
148
- }
149
- /**
150
- * Auto-run command - single prompt with immediate execution
151
- */
152
- async function autoRunCommand(prompt, options) {
153
- const workingDir = path.resolve(options.path || process.cwd());
154
- console.log(chalk_1.default.bold('\n SessionCast AutoRun\n'));
155
- console.log(chalk_1.default.gray(` Working directory: ${workingDir}`));
156
- console.log(chalk_1.default.cyan(` Mission: ${prompt}\n`));
157
- const spinner = (0, ora_1.default)({ text: 'Initializing...', spinner: 'dots' }).start();
158
- try {
159
- // Phase 1: Generate workflow with AutoPilot
160
- const pilot = new autopilot_1.AutoPilot({
161
- workingDir,
162
- verbose: options.verbose,
163
- relayUrl: options.relay,
164
- token: options.relayToken
165
- });
166
- pilot.on('phase', (phase, message) => {
167
- spinner.text = message;
168
- });
169
- const workflow = options.quick
170
- ? await pilot.quickExecute(prompt)
171
- : await pilot.execute(prompt);
172
- spinner.succeed('Workflow generated');
173
- // Display summary
174
- console.log(chalk_1.default.bold('\n Workflow\n'));
175
- for (const agent of workflow.agents) {
176
- console.log(chalk_1.default.cyan(` ${agent.name}`));
177
- console.log(chalk_1.default.gray(` ${agent.role}`));
178
- }
179
- console.log('');
180
- // Phase 2: Initialize project if needed
181
- const sessioncastDir = path.join(workingDir, '.sessioncast');
182
- if (!fs.existsSync(sessioncastDir)) {
183
- fs.mkdirSync(sessioncastDir, { recursive: true });
184
- fs.mkdirSync(path.join(sessioncastDir, 'workflows'), { recursive: true });
185
- }
186
- // Save workflow
187
- const executableWorkflow = pilot.toExecutableFormat();
188
- if (!executableWorkflow) {
189
- throw new Error('Failed to convert workflow');
190
- }
191
- const workflowPath = path.join(sessioncastDir, 'workflows', `${executableWorkflow.name}.json`);
192
- fs.writeFileSync(workflowPath, JSON.stringify(executableWorkflow, null, 2));
193
- // Update project.json
194
- const projectJsonPath = path.join(sessioncastDir, 'project.json');
195
- const projectJson = fs.existsSync(projectJsonPath)
196
- ? JSON.parse(fs.readFileSync(projectJsonPath, 'utf-8'))
197
- : { name: path.basename(workingDir), created: new Date().toISOString() };
198
- projectJson.workflow = executableWorkflow.name;
199
- projectJson.lastUpdated = new Date().toISOString();
200
- fs.writeFileSync(projectJsonPath, JSON.stringify(projectJson, null, 2));
201
- console.log(chalk_1.default.bold('\n Workflow Saved\n'));
202
- console.log(chalk_1.default.gray(` Path: ${workflowPath}\n`));
203
- // Generate Speckit format if requested
204
- if (options.speckit) {
205
- const { planPath, tasksPath } = pilot.saveSpeckit();
206
- console.log(chalk_1.default.bold(' Speckit Generated\n'));
207
- console.log(chalk_1.default.green(` Plan: ${planPath}`));
208
- console.log(chalk_1.default.green(` Tasks: ${tasksPath}\n`));
209
- }
210
- // Build relay args
211
- let relayArgs = '';
212
- if (options.relay) {
213
- relayArgs = ` -r ${options.relay}`;
214
- if (options.relayToken) {
215
- relayArgs += ` -t ${options.relayToken}`;
216
- }
217
- }
218
- console.log(chalk_1.default.cyan(' To execute, run:\n'));
219
- console.log(chalk_1.default.white(` sessioncast project run .${relayArgs}\n`));
220
- }
221
- catch (error) {
222
- spinner.fail('AutoRun failed');
223
- console.error(chalk_1.default.red(`\n Error: ${error instanceof Error ? error.message : 'Unknown error'}\n`));
224
- if (options.verbose) {
225
- console.error(error);
226
- }
227
- process.exit(1);
228
- }
229
- }
230
- /**
231
- * Detect command - just show project detection results
232
- */
233
- async function detectCommand(options) {
234
- const workingDir = path.resolve(options.path || process.cwd());
235
- console.log(chalk_1.default.bold('\n Project Detection\n'));
236
- console.log(chalk_1.default.gray(` Directory: ${workingDir}\n`));
237
- const pilot = new autopilot_1.AutoPilot({
238
- workingDir,
239
- verbose: options.verbose
240
- });
241
- try {
242
- // Just run detection phase
243
- await pilot.execute('detect');
244
- const context = pilot.getContext();
245
- console.log(chalk_1.default.cyan(' Project Type: ') + context.projectType);
246
- console.log(chalk_1.default.cyan(' Project Name: ') + context.projectName);
247
- console.log(chalk_1.default.cyan(' Sources: ') + context.sources.length + ' files');
248
- console.log('');
249
- if (options.verbose) {
250
- console.log(chalk_1.default.gray(' Structure:\n'));
251
- console.log(context.projectStructure.split('\n').map(l => ' ' + l).join('\n'));
252
- console.log('');
253
- }
254
- }
255
- catch {
256
- // Detection only, ignore errors
257
- const context = pilot.getContext();
258
- console.log(chalk_1.default.cyan(' Project Type: ') + context.projectType);
259
- console.log(chalk_1.default.cyan(' Project Name: ') + context.projectName);
260
- console.log('');
261
- }
262
- }
@@ -1,33 +0,0 @@
1
- /**
2
- * Initialize a new project
3
- */
4
- export declare function projectInit(projectPath: string, options: {
5
- name?: string;
6
- }): Promise<void>;
7
- /**
8
- * Run workflow
9
- */
10
- export declare function projectRun(projectPath: string, options: {
11
- watch?: boolean;
12
- noClaude?: boolean;
13
- relay?: string;
14
- relayToken?: string;
15
- }): Promise<void>;
16
- /**
17
- * Show project status
18
- */
19
- export declare function projectStatus(projectPath: string): Promise<void>;
20
- /**
21
- * Stop workflow and kill sessions
22
- */
23
- export declare function projectStop(projectPath: string): Promise<void>;
24
- /**
25
- * List agents and send commands
26
- */
27
- export declare function projectSend(projectPath: string, agentId: string, message: string): Promise<void>;
28
- /**
29
- * Create a sample workflow
30
- */
31
- export declare function projectCreateWorkflow(projectPath: string, options: {
32
- template?: string;
33
- }): Promise<void>;