oneie 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/oneie.js ADDED
@@ -0,0 +1,402 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * ONE - Personal Collaborative Intelligence
5
+ * Main entry point for the ONE system
6
+ */
7
+
8
+ import { Command } from 'commander';
9
+ import chalk from 'chalk';
10
+ import fs from 'fs-extra';
11
+ import path from 'path';
12
+ import { OneInstaller } from './one-installer.js';
13
+ import { MissionSystem } from './mission-system.js';
14
+ import { StorySystem } from './story-system.js';
15
+ import { TaskSystem } from './task-system.js';
16
+
17
+ const program = new Command();
18
+
19
+ program
20
+ .name('oneie')
21
+ .description('šŸ¤ ONE - Personal Collaborative Intelligence')
22
+ .version('1.1.0');
23
+
24
+ // Main install command (default)
25
+ program
26
+ .command('install', { isDefault: true })
27
+ .description('Install ONE and create your personal workspace')
28
+ .option('-a, --auto', 'Skip interactive setup', false)
29
+ .action(async (options) => {
30
+ try {
31
+ const installer = new OneInstaller();
32
+ await installer.install(options);
33
+ } catch (error) {
34
+ console.error(chalk.red('āŒ Installation failed:'), error.message);
35
+ process.exit(1);
36
+ }
37
+ });
38
+
39
+ // Generate content from me.md
40
+ program
41
+ .command('generate')
42
+ .description('Generate personalized content from your me.md')
43
+ .action(async () => {
44
+ try {
45
+ const installer = new OneInstaller();
46
+ await installer.generate();
47
+ } catch (error) {
48
+ console.error(chalk.red('āŒ Generation failed:'), error.message);
49
+ process.exit(1);
50
+ }
51
+ });
52
+
53
+ // Update me.md profile
54
+ program
55
+ .command('update-me')
56
+ .alias('me')
57
+ .description('Update your personal me.md profile')
58
+ .action(async () => {
59
+ try {
60
+ const installer = new OneInstaller();
61
+ await installer.updateMe();
62
+ } catch (error) {
63
+ console.error(chalk.red('āŒ Profile update failed:'), error.message);
64
+ process.exit(1);
65
+ }
66
+ });
67
+
68
+ // Mission management
69
+ program
70
+ .command('mission')
71
+ .description('Mission management commands')
72
+ .argument('[command]', 'Mission command (create, list, status)')
73
+ .argument('[args...]', 'Mission arguments')
74
+ .action(async (command, args) => {
75
+ const missionSystem = new MissionSystem();
76
+
77
+ try {
78
+ if (!command || command === 'list') {
79
+ const missions = await missionSystem.listMissions();
80
+
81
+ if (missions.length === 0) {
82
+ console.log(chalk.yellow('\\nšŸ“‹ No missions yet'));
83
+ console.log(chalk.gray('Create your first mission: npx oneie mission create "Your goal"'));
84
+ return;
85
+ }
86
+
87
+ console.log(chalk.cyan.bold('\\nšŸŽÆ Your Missions\\n'));
88
+ missions.forEach(mission => {
89
+ const statusEmoji = {
90
+ 'planning': 'šŸ“‹',
91
+ 'active': 'šŸš€',
92
+ 'completed': 'āœ…'
93
+ }[mission.status] || 'šŸ“‹';
94
+
95
+ console.log(`${statusEmoji} ${mission.name}`);
96
+ console.log(chalk.gray(` ${mission.objective}`));
97
+ console.log(chalk.gray(` Status: ${mission.status} | Created: ${new Date(mission.created).toLocaleDateString()}`));
98
+ console.log('');
99
+ });
100
+
101
+ } else if (command === 'create') {
102
+ const objective = args.join(' ') || 'Complete current project';
103
+ console.log(chalk.cyan(`\\nšŸŽÆ Creating mission: ${objective}`));
104
+
105
+ const mission = await missionSystem.createMission(objective, {
106
+ interactive: false
107
+ });
108
+
109
+ console.log(chalk.green(`\\nāœ… Mission created: ${mission.name}`));
110
+ console.log(chalk.blue(`šŸ“‹ ID: ${mission.id}`));
111
+ console.log(chalk.gray('Next: npx oneie story create ' + mission.id + ' "Story objective"'));
112
+
113
+ } else if (command === 'status') {
114
+ const missionId = args[0];
115
+ if (!missionId) {
116
+ console.log(chalk.red('āŒ Please provide mission ID'));
117
+ return;
118
+ }
119
+
120
+ const mission = await missionSystem.getMission(missionId);
121
+ if (!mission) {
122
+ console.log(chalk.red(`āŒ Mission not found: ${missionId}`));
123
+ return;
124
+ }
125
+
126
+ console.log(chalk.cyan.bold(`\\nšŸŽÆ Mission: ${mission.name}`));
127
+ console.log(`Objective: ${mission.objective}`);
128
+ console.log(`Status: ${mission.status}`);
129
+ console.log(`Created: ${new Date(mission.created).toLocaleDateString()}`);
130
+ console.log(`Agents: ${mission.agents.join(', ')}`);
131
+
132
+ } else {
133
+ console.log(chalk.red(`āŒ Unknown mission command: ${command}`));
134
+ console.log(chalk.gray('Available: create, list, status'));
135
+ }
136
+
137
+ } catch (error) {
138
+ console.error(chalk.red('āŒ Mission command failed:'), error.message);
139
+ process.exit(1);
140
+ }
141
+ });
142
+
143
+ // Story management
144
+ program
145
+ .command('story')
146
+ .description('Story management commands')
147
+ .argument('[command]', 'Story command (create, list, status)')
148
+ .argument('[args...]', 'Story arguments')
149
+ .action(async (command, args) => {
150
+ const storySystem = new StorySystem();
151
+
152
+ try {
153
+ if (!command || command === 'list') {
154
+ const stories = await storySystem.listStories();
155
+
156
+ if (stories.length === 0) {
157
+ console.log(chalk.yellow('\\nšŸ“š No stories yet'));
158
+ console.log(chalk.gray('Create your first story: npx oneie story create <mission-id> "Story goal"'));
159
+ return;
160
+ }
161
+
162
+ console.log(chalk.cyan.bold('\\nšŸ“š Your Stories\\n'));
163
+ stories.forEach(story => {
164
+ const statusEmoji = {
165
+ 'planning': 'šŸ“‹',
166
+ 'active': 'šŸš€',
167
+ 'completed': 'āœ…'
168
+ }[story.status] || 'šŸ“‹';
169
+
170
+ console.log(`${statusEmoji} ${story.name}`);
171
+ console.log(chalk.gray(` Mission: ${story.missionId} | Status: ${story.status}`));
172
+ console.log(chalk.gray(` Agents: ${story.agents?.join(', ') || 'None'} | Tasks: ${story.tasks?.length || 0}`));
173
+ console.log('');
174
+ });
175
+
176
+ } else if (command === 'create') {
177
+ const missionId = args[0];
178
+ const objective = args.slice(1).join(' ');
179
+
180
+ if (!missionId) {
181
+ console.log(chalk.red('āŒ Please provide mission ID'));
182
+ console.log(chalk.gray('Usage: npx oneie story create <mission-id> "Story objective"'));
183
+ return;
184
+ }
185
+
186
+ if (!objective) {
187
+ console.log(chalk.red('āŒ Please provide story objective'));
188
+ return;
189
+ }
190
+
191
+ console.log(chalk.cyan(`\\nšŸ“š Creating story: ${objective}`));
192
+
193
+ const story = await storySystem.createStory(missionId, objective, {
194
+ interactive: false
195
+ });
196
+
197
+ console.log(chalk.green(`\\nāœ… Story created: ${story.name}`));
198
+ console.log(chalk.blue(`šŸ“š ID: ${story.id}`));
199
+ console.log(chalk.gray('Next: npx oneie task create ' + story.id + ' "Task to complete"'));
200
+
201
+ } else {
202
+ console.log(chalk.red(`āŒ Unknown story command: ${command}`));
203
+ console.log(chalk.gray('Available: create, list'));
204
+ }
205
+
206
+ } catch (error) {
207
+ console.error(chalk.red('āŒ Story command failed:'), error.message);
208
+ process.exit(1);
209
+ }
210
+ });
211
+
212
+ // Task management
213
+ program
214
+ .command('task')
215
+ .description('Task management commands')
216
+ .argument('[command]', 'Task command (create, list, status)')
217
+ .argument('[args...]', 'Task arguments')
218
+ .action(async (command, args) => {
219
+ const taskSystem = new TaskSystem();
220
+
221
+ try {
222
+ if (!command || command === 'list') {
223
+ const tasks = await taskSystem.listTasks();
224
+
225
+ if (tasks.length === 0) {
226
+ console.log(chalk.yellow('\\nšŸ“‹ No tasks yet'));
227
+ console.log(chalk.gray('Create your first task: npx oneie task create <story-id> "Task description"'));
228
+ return;
229
+ }
230
+
231
+ console.log(chalk.cyan.bold('\\nšŸ“‹ Your Tasks\\n'));
232
+
233
+ const activeTasks = tasks.filter(t => t.status === 'active');
234
+ const pendingTasks = tasks.filter(t => t.status === 'pending');
235
+ const completedTasks = tasks.filter(t => t.status === 'completed');
236
+
237
+ if (activeTasks.length > 0) {
238
+ console.log(chalk.green('šŸš€ Active Tasks'));
239
+ activeTasks.forEach(task => {
240
+ console.log(` ⚔ ${task.name}`);
241
+ console.log(chalk.gray(` Agents: ${task.agents.join(', ')}`));
242
+ });
243
+ console.log('');
244
+ }
245
+
246
+ if (pendingTasks.length > 0) {
247
+ console.log(chalk.yellow('ā³ Pending Tasks'));
248
+ pendingTasks.slice(0, 5).forEach(task => {
249
+ console.log(` šŸ“‹ ${task.name}`);
250
+ console.log(chalk.gray(` Story: ${task.storyId}`));
251
+ });
252
+ if (pendingTasks.length > 5) {
253
+ console.log(chalk.gray(` ... and ${pendingTasks.length - 5} more`));
254
+ }
255
+ console.log('');
256
+ }
257
+
258
+ console.log(chalk.blue(`šŸ“Š Summary: ${activeTasks.length} active, ${pendingTasks.length} pending, ${completedTasks.length} completed`));
259
+
260
+ } else if (command === 'create') {
261
+ const storyId = args[0];
262
+ const taskName = args.slice(1).join(' ');
263
+
264
+ if (!storyId) {
265
+ console.log(chalk.red('āŒ Please provide story ID'));
266
+ console.log(chalk.gray('Usage: npx oneie task create <story-id> "Task description"'));
267
+ return;
268
+ }
269
+
270
+ if (!taskName) {
271
+ console.log(chalk.red('āŒ Please provide task description'));
272
+ return;
273
+ }
274
+
275
+ console.log(chalk.cyan(`\\nšŸ“‹ Creating task: ${taskName}`));
276
+
277
+ const task = await taskSystem.createTask(storyId, taskName, {
278
+ interactive: false
279
+ });
280
+
281
+ console.log(chalk.green(`\\nāœ… Task created: ${task.name}`));
282
+ console.log(chalk.blue(`šŸ“‹ ID: ${task.id}`));
283
+ console.log(chalk.gray(`šŸ¤– Agents: ${task.agents.join(', ')}`));
284
+ console.log(chalk.gray('Next: npx oneie task status ' + task.id));
285
+
286
+ } else {
287
+ console.log(chalk.red(`āŒ Unknown task command: ${command}`));
288
+ console.log(chalk.gray('Available: create, list'));
289
+ }
290
+
291
+ } catch (error) {
292
+ console.error(chalk.red('āŒ Task command failed:'), error.message);
293
+ process.exit(1);
294
+ }
295
+ });
296
+
297
+ // Show personal agents
298
+ program
299
+ .command('agents')
300
+ .description('View your personalized AI agents')
301
+ .action(async () => {
302
+ try {
303
+ const installer = new OneInstaller();
304
+
305
+ if (!await installer.isInstalled()) {
306
+ console.log(chalk.red('āŒ ONE is not installed here.'));
307
+ console.log(chalk.gray('Run: npx oneie'));
308
+ return;
309
+ }
310
+
311
+ console.log(chalk.cyan.bold('\\nšŸ¤– Your Personal AI Agents\\n'));
312
+
313
+ const agentsDir = path.join(process.cwd(), '.one', 'agents');
314
+ if (await fs.pathExists(agentsDir)) {
315
+ const agentFiles = await fs.readdir(agentsDir);
316
+ const yamlFiles = agentFiles.filter(file => file.endsWith('.yaml'));
317
+
318
+ if (yamlFiles.length === 0) {
319
+ console.log(chalk.yellow('No agents found. Run: npx oneie generate'));
320
+ return;
321
+ }
322
+
323
+ for (const file of yamlFiles) {
324
+ const agentPath = path.join(agentsDir, file);
325
+ const content = await fs.readFile(agentPath, 'utf8');
326
+ const frontMatter = content.match(/^---\\n([\\s\\S]*?)\\n---/);
327
+
328
+ if (frontMatter) {
329
+ try {
330
+ const yaml = await import('js-yaml');
331
+ const config = yaml.default.load(frontMatter[1]);
332
+
333
+ console.log(chalk.blue(`šŸ¤– ${config.name}`));
334
+ console.log(chalk.gray(` ${config.description.split('\\n')[0]}`));
335
+ if (config.expertise) {
336
+ console.log(chalk.gray(` Expertise: ${JSON.parse(config.expertise).join(', ')}`));
337
+ }
338
+ console.log('');
339
+ } catch (e) {
340
+ console.log(chalk.gray(`šŸ¤– ${file.replace('.yaml', '')}`));
341
+ }
342
+ }
343
+ }
344
+ } else {
345
+ console.log(chalk.yellow('No agents directory found. Run: npx oneie generate'));
346
+ }
347
+
348
+ } catch (error) {
349
+ console.error(chalk.red('āŒ Failed to show agents:'), error.message);
350
+ }
351
+ });
352
+
353
+ // Help command
354
+ program
355
+ .command('help')
356
+ .description('Show help and usage examples')
357
+ .action(() => {
358
+ console.log(chalk.cyan.bold('\\nšŸ¤ ONE - Personal Collaborative Intelligence\\n'));
359
+
360
+ console.log(chalk.blue('šŸš€ Getting Started:'));
361
+ console.log(' npx oneie # Install and setup your personal workspace');
362
+ console.log(' npx oneie update-me # Update your me.md profile');
363
+ console.log(' npx oneie generate # Generate content from your profile');
364
+ console.log('');
365
+
366
+ console.log(chalk.blue('šŸŽÆ Mission-Story-Task Workflow:'));
367
+ console.log(' npx oneie mission create "Build my app" # Create a mission');
368
+ console.log(' npx oneie story create <mission-id> "Setup" # Add stories to mission');
369
+ console.log(' npx oneie task create <story-id> "Code API" # Add tasks to story');
370
+ console.log('');
371
+
372
+ console.log(chalk.blue('šŸ¤– Your Personalized Workspace:'));
373
+ console.log(' npx oneie agents # View your AI agents');
374
+ console.log(' npx oneie mission list # See your missions');
375
+ console.log(' npx oneie story list # See your stories');
376
+ console.log(' npx oneie task list # See your tasks');
377
+ console.log('');
378
+
379
+ console.log(chalk.yellow('šŸ’” How it works:'));
380
+ console.log('1. ONE reads your me.md profile (name, role, skills, goals)');
381
+ console.log('2. Creates personalized AI agents and workflows just for you');
382
+ console.log('3. Helps you organize work into missions → stories → tasks');
383
+ console.log('4. Agents help execute tasks based on your context and preferences');
384
+ console.log('');
385
+
386
+ console.log(chalk.gray('Your workspace adapts as you update me.md - try it!'));
387
+ });
388
+
389
+ // Handle no command (default to install)
390
+ program.action(async (options) => {
391
+ try {
392
+ const installer = new OneInstaller();
393
+ await installer.install(options);
394
+ } catch (error) {
395
+ console.error(chalk.red('āŒ Installation failed:'), error.message);
396
+ process.exit(1);
397
+ }
398
+ });
399
+
400
+ program.parse();
401
+
402
+ export { program };
package/package.json CHANGED
@@ -1,19 +1,11 @@
1
1
  {
2
2
  "name": "oneie",
3
- "version": "1.1.0",
4
- "description": "šŸ¤ Universal Collaborative Intelligence - Complete Mission → Story → Task → Agent workflow system. Transform any project into a space where humans and AI agents work as equals. From kids' homework to enterprise systems, ONE adapts to your context and enables true collaborative intelligence through `npx oneie`.",
3
+ "version": "1.2.0",
4
+ "description": "šŸ¤ ONE Personal Collaborative Intelligence - Creates personalized AI workspace from your me.md profile. Simple: npx oneie → edit me.md → generate personalized agents, workflows & missions. From students to enterprises, ONE adapts to your context.",
5
5
  "type": "module",
6
6
  "main": "one/tools/one-cli.js",
7
7
  "bin": {
8
- "oneie": "bin/collaborative-install.js",
9
- "one:agent": "one/tools/bin/one-agent.js",
10
- "one:mission": "bin/one-mission.js",
11
- "one:story": "bin/one-story.js",
12
- "one:task": "bin/one-task.js",
13
- "one:workflow": "bin/workflow-orchestration.js",
14
- "one:team": "one/tools/bin/one-team.js",
15
- "one:playbook": "one/tools/bin/one-playbook.js",
16
- "one:tools": "one/tools/bin/one-tools.js"
8
+ "oneie": "bin/oneie.js"
17
9
  },
18
10
  "scripts": {
19
11
  "build": "node one/tools/cli.js build-bundles",
@@ -1,247 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * ONE Mission CLI Command
5
- * Interactive mission creation and management
6
- */
7
-
8
- import { Command } from 'commander';
9
- import chalk from 'chalk';
10
- import { MissionSystem } from './mission-system.js';
11
-
12
- const program = new Command();
13
-
14
- program
15
- .name('one:mission')
16
- .description('šŸŽÆ Mission management for ONE collaborative intelligence')
17
- .version('1.0.0');
18
-
19
- program
20
- .command('create [objective]')
21
- .description('Create a new collaborative mission')
22
- .option('-i, --interactive', 'Interactive mission design', true)
23
- .option('-a, --auto', 'Auto-generate mission without interaction', false)
24
- .action(async (objective, options) => {
25
- console.log(chalk.cyan.bold('\nšŸŽÆ ONE Mission Creator\n'));
26
-
27
- try {
28
- if (!objective) {
29
- const { default: inquirer } = await import('inquirer');
30
- const answers = await inquirer.prompt([
31
- {
32
- type: 'input',
33
- name: 'objective',
34
- message: 'What is your mission objective?',
35
- validate: input => input.length > 0 || 'Please enter a mission objective'
36
- }
37
- ]);
38
- objective = answers.objective;
39
- }
40
-
41
- const missionSystem = new MissionSystem();
42
- const mission = await missionSystem.createMission(objective, {
43
- interactive: !options.auto
44
- });
45
-
46
- console.log(chalk.green.bold('\nšŸŽ‰ Mission created successfully!'));
47
- console.log(chalk.blue(`šŸ“‹ Mission ID: ${mission.id}`));
48
- console.log(chalk.blue(`šŸ“ Location: .one/missions/${mission.id}/`));
49
- console.log(chalk.blue(`šŸ¤– Agents: ${mission.agents.join(', ')}`));
50
- console.log(chalk.blue(`šŸ“š Stories: ${mission.suggestedStories.length} generated`));
51
-
52
- console.log(chalk.yellow('\nšŸš€ Next steps:'));
53
- console.log(' 1. Review generated stories: one:story list');
54
- console.log(' 2. Start first story: one:story start <story-id>');
55
- console.log(' 3. Check mission status: one:mission status ' + mission.id);
56
-
57
- } catch (error) {
58
- console.error(chalk.red('āŒ Failed to create mission:'), error.message);
59
- process.exit(1);
60
- }
61
- });
62
-
63
- program
64
- .command('list')
65
- .description('List all missions')
66
- .option('-s, --status <status>', 'Filter by status (planning, active, completed)')
67
- .action(async (options) => {
68
- try {
69
- const missionSystem = new MissionSystem();
70
- const missions = await missionSystem.listMissions();
71
-
72
- if (missions.length === 0) {
73
- console.log(chalk.yellow('\nšŸ“‹ No missions found'));
74
- console.log(chalk.gray('Create your first mission: one:mission create "Your objective"'));
75
- return;
76
- }
77
-
78
- console.log(chalk.cyan.bold('\nšŸŽÆ Your Missions\n'));
79
-
80
- missions
81
- .filter(mission => !options.status || mission.status === options.status)
82
- .forEach(mission => {
83
- const statusColor = {
84
- 'planning': 'yellow',
85
- 'active': 'green',
86
- 'completed': 'blue',
87
- 'paused': 'gray'
88
- }[mission.status] || 'white';
89
-
90
- console.log(chalk[statusColor](`šŸ“‹ ${mission.name}`));
91
- console.log(chalk.gray(` ID: ${mission.id}`));
92
- console.log(chalk.gray(` Status: ${mission.status}`));
93
- console.log(chalk.gray(` Agents: ${mission.agents.join(', ')}`));
94
- console.log(chalk.gray(` Stories: ${mission.stories.length}`));
95
- console.log(chalk.gray(` Created: ${new Date(mission.created).toLocaleDateString()}`));
96
- console.log('');
97
- });
98
- } catch (error) {
99
- console.error(chalk.red('āŒ Failed to list missions:'), error.message);
100
- process.exit(1);
101
- }
102
- });
103
-
104
- program
105
- .command('status <missionId>')
106
- .description('Show detailed mission status')
107
- .action(async (missionId) => {
108
- try {
109
- const missionSystem = new MissionSystem();
110
- const mission = await missionSystem.getMission(missionId);
111
-
112
- if (!mission) {
113
- console.log(chalk.red(`āŒ Mission not found: ${missionId}`));
114
- console.log(chalk.gray('List missions: one:mission list'));
115
- return;
116
- }
117
-
118
- console.log(chalk.cyan.bold(`\nšŸŽÆ Mission: ${mission.name}\n`));
119
-
120
- console.log(chalk.blue('šŸ“‹ Overview'));
121
- console.log(` Objective: ${mission.objective}`);
122
- console.log(` Status: ${mission.status}`);
123
- console.log(` Duration: ${mission.duration}`);
124
- console.log(` Complexity: ${mission.complexity}`);
125
- console.log(` Created: ${new Date(mission.created).toLocaleDateString()}`);
126
-
127
- console.log(chalk.blue('\nšŸ¤– Agents'));
128
- mission.agents.forEach(agent => {
129
- console.log(` • ${agent}`);
130
- });
131
-
132
- console.log(chalk.blue('\nšŸ“š Stories'));
133
- if (mission.stories.length > 0) {
134
- mission.stories.forEach(story => {
135
- console.log(` • ${story}`);
136
- });
137
- } else {
138
- console.log(chalk.gray(' No stories yet'));
139
- }
140
-
141
- console.log(chalk.blue('\nšŸ—ļø Architecture Context'));
142
- console.log(` Tech Stack: ${JSON.stringify(mission.architecture.techStack.languages)} + ${JSON.stringify(mission.architecture.techStack.frameworks)}`);
143
- console.log(` Project Type: ${mission.architecture.projectStructure.type}`);
144
-
145
- } catch (error) {
146
- console.error(chalk.red('āŒ Failed to get mission status:'), error.message);
147
- process.exit(1);
148
- }
149
- });
150
-
151
- program
152
- .command('start <missionId>')
153
- .description('Start a mission (change status to active)')
154
- .action(async (missionId) => {
155
- try {
156
- console.log(chalk.yellow(`šŸš€ Starting mission ${missionId}...`));
157
- // TODO: Implement mission start logic
158
- console.log(chalk.green('āœ… Mission started!'));
159
- console.log(chalk.gray('Next: Begin working on stories'));
160
- } catch (error) {
161
- console.error(chalk.red('āŒ Failed to start mission:'), error.message);
162
- process.exit(1);
163
- }
164
- });
165
-
166
- program
167
- .command('complete <missionId>')
168
- .description('Mark a mission as completed')
169
- .action(async (missionId) => {
170
- try {
171
- console.log(chalk.blue(`šŸŽ‰ Completing mission ${missionId}...`));
172
- // TODO: Implement mission completion logic
173
- console.log(chalk.green('āœ… Mission completed!'));
174
- console.log(chalk.gray('Great work! Ready for the next mission.'));
175
- } catch (error) {
176
- console.error(chalk.red('āŒ Failed to complete mission:'), error.message);
177
- process.exit(1);
178
- }
179
- });
180
-
181
- // Interactive mission dashboard
182
- program
183
- .command('dashboard')
184
- .alias('dash')
185
- .description('Interactive mission dashboard')
186
- .action(async () => {
187
- console.log(chalk.cyan.bold('\nšŸŽÆ Mission Dashboard\n'));
188
-
189
- try {
190
- const missionSystem = new MissionSystem();
191
- const missions = await missionSystem.listMissions();
192
-
193
- if (missions.length === 0) {
194
- console.log(chalk.yellow('šŸ“‹ No missions yet'));
195
- console.log(chalk.gray('Create your first mission to get started!'));
196
- return;
197
- }
198
-
199
- // Show mission summary
200
- const statusCounts = missions.reduce((acc, mission) => {
201
- acc[mission.status] = (acc[mission.status] || 0) + 1;
202
- return acc;
203
- }, {});
204
-
205
- console.log(chalk.blue('šŸ“Š Mission Summary'));
206
- Object.entries(statusCounts).forEach(([status, count]) => {
207
- const color = {
208
- 'planning': 'yellow',
209
- 'active': 'green',
210
- 'completed': 'blue'
211
- }[status] || 'white';
212
- console.log(chalk[color](` ${status}: ${count}`));
213
- });
214
-
215
- console.log(chalk.blue('\nšŸš€ Recent Missions'));
216
- missions.slice(0, 5).forEach(mission => {
217
- const statusEmoji = {
218
- 'planning': 'šŸ“‹',
219
- 'active': 'šŸš€',
220
- 'completed': 'āœ…'
221
- }[mission.status] || 'šŸ“‹';
222
-
223
- console.log(` ${statusEmoji} ${mission.name}`);
224
- console.log(chalk.gray(` ${mission.agents.length} agents • ${mission.stories.length} stories • ${mission.status}`));
225
- });
226
-
227
- } catch (error) {
228
- console.error(chalk.red('āŒ Dashboard error:'), error.message);
229
- process.exit(1);
230
- }
231
- });
232
-
233
- // Handle no command
234
- program.action(() => {
235
- console.log(chalk.cyan.bold('\nšŸŽÆ ONE Mission System\n'));
236
- console.log('Available commands:');
237
- console.log(' create [objective] Create a new mission');
238
- console.log(' list List all missions');
239
- console.log(' status <id> Show mission details');
240
- console.log(' dashboard Mission dashboard');
241
- console.log('');
242
- console.log(chalk.gray('Example: one:mission create "Build user authentication system"'));
243
- });
244
-
245
- program.parse();
246
-
247
- export { program };