oneie 1.0.2 → 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/lib/validator.js DELETED
@@ -1,419 +0,0 @@
1
- const fs = require('fs-extra');
2
- const path = require('path');
3
- const chalk = require('chalk');
4
-
5
- /**
6
- * Validates ONE installation completeness and correctness
7
- * @param {Object} progress - Progress bar instance
8
- */
9
- async function validateInstallation(progress) {
10
- const validationResults = {
11
- passed: 0,
12
- failed: 0,
13
- warnings: 0,
14
- details: []
15
- };
16
-
17
- const validations = [
18
- { name: 'Directory Structure', fn: validateDirectoryStructure },
19
- { name: 'Me Configuration', fn: validateMeConfiguration },
20
- { name: 'Agent Setup', fn: validateAgentSetup },
21
- { name: 'CLI Integration', fn: validateCLIIntegration },
22
- { name: 'Package Integration', fn: validatePackageIntegration },
23
- { name: 'File Permissions', fn: validateFilePermissions }
24
- ];
25
-
26
- for (const validation of validations) {
27
- try {
28
- const result = await validation.fn();
29
- if (result.passed) {
30
- validationResults.passed++;
31
- } else {
32
- validationResults.failed++;
33
- }
34
- validationResults.details.push({
35
- name: validation.name,
36
- ...result
37
- });
38
- } catch (error) {
39
- validationResults.failed++;
40
- validationResults.details.push({
41
- name: validation.name,
42
- passed: false,
43
- message: error.message,
44
- severity: 'error'
45
- });
46
- }
47
- }
48
-
49
- progress.update(100);
50
-
51
- // Display validation results
52
- displayValidationResults(validationResults);
53
-
54
- return validationResults;
55
- }
56
-
57
- async function validateDirectoryStructure() {
58
- const requiredDirs = [
59
- '.one',
60
- '.one/core',
61
- '.one/agents',
62
- '.one/workflows',
63
- '.one/apps',
64
- 'one',
65
- 'one/agents',
66
- 'one/spaces',
67
- 'one/missions',
68
- 'one/stories',
69
- 'one/tools',
70
- 'me',
71
- 'me/assets',
72
- 'me/themes'
73
- ];
74
-
75
- const missing = [];
76
-
77
- for (const dir of requiredDirs) {
78
- if (!await fs.pathExists(dir)) {
79
- missing.push(dir);
80
- }
81
- }
82
-
83
- return {
84
- passed: missing.length === 0,
85
- message: missing.length > 0
86
- ? `Missing directories: ${missing.join(', ')}`
87
- : 'All required directories present',
88
- severity: missing.length > 0 ? 'error' : 'success',
89
- details: { missing, required: requiredDirs.length, found: requiredDirs.length - missing.length }
90
- };
91
- }
92
-
93
- async function validateMeConfiguration() {
94
- const mePath = path.join(process.cwd(), 'me', 'me.md');
95
-
96
- if (!await fs.pathExists(mePath)) {
97
- return {
98
- passed: false,
99
- message: 'me/me.md file not found',
100
- severity: 'error'
101
- };
102
- }
103
-
104
- try {
105
- const content = await fs.readFile(mePath, 'utf8');
106
- const issues = [];
107
-
108
- // Check for required sections
109
- const requiredSections = [
110
- 'company:',
111
- 'brand:',
112
- 'top_agents:',
113
- 'spaces:',
114
- 'goals:'
115
- ];
116
-
117
- for (const section of requiredSections) {
118
- if (!content.includes(section)) {
119
- issues.push(`Missing section: ${section}`);
120
- }
121
- }
122
-
123
- // Check for basic YAML structure
124
- if (!content.includes('---') && content.includes(':')) {
125
- issues.push('Consider using YAML frontmatter for better structure');
126
- }
127
-
128
- return {
129
- passed: issues.length === 0,
130
- message: issues.length > 0
131
- ? `Configuration issues: ${issues.join(', ')}`
132
- : 'me.md configuration is valid',
133
- severity: issues.length > 0 ? 'warning' : 'success',
134
- details: { issues, size: content.length }
135
- };
136
-
137
- } catch (error) {
138
- return {
139
- passed: false,
140
- message: `Failed to read me.md: ${error.message}`,
141
- severity: 'error'
142
- };
143
- }
144
- }
145
-
146
- async function validateAgentSetup() {
147
- const agentsDir = path.join(process.cwd(), 'one', 'agents');
148
-
149
- if (!await fs.pathExists(agentsDir)) {
150
- return {
151
- passed: false,
152
- message: 'Agents directory not found',
153
- severity: 'error'
154
- };
155
- }
156
-
157
- try {
158
- const agentFiles = await fs.readdir(agentsDir);
159
- const yamlFiles = agentFiles.filter(f => f.endsWith('.yaml') || f.endsWith('.yml'));
160
-
161
- if (yamlFiles.length === 0) {
162
- return {
163
- passed: false,
164
- message: 'No agent configuration files found',
165
- severity: 'error'
166
- };
167
- }
168
-
169
- // Validate at least one agent has slot 1 (ARIA)
170
- let hasSlot1 = false;
171
- const invalidAgents = [];
172
-
173
- for (const file of yamlFiles) {
174
- try {
175
- const content = await fs.readFile(path.join(agentsDir, file), 'utf8');
176
- if (content.includes('slot: 1')) {
177
- hasSlot1 = true;
178
- }
179
-
180
- // Basic validation - check for required fields
181
- const required = ['name:', 'role:', 'personality:'];
182
- const missing = required.filter(field => !content.includes(field));
183
- if (missing.length > 0) {
184
- invalidAgents.push(`${file}: missing ${missing.join(', ')}`);
185
- }
186
- } catch (error) {
187
- invalidAgents.push(`${file}: ${error.message}`);
188
- }
189
- }
190
-
191
- const issues = [];
192
- if (!hasSlot1) issues.push('No agent assigned to slot 1 (Primary Assistant)');
193
- if (invalidAgents.length > 0) issues.push(...invalidAgents);
194
-
195
- return {
196
- passed: issues.length === 0,
197
- message: issues.length > 0
198
- ? `Agent issues: ${issues.join('; ')}`
199
- : `${yamlFiles.length} agents configured successfully`,
200
- severity: issues.length > 0 ? 'error' : 'success',
201
- details: { agentCount: yamlFiles.length, hasSlot1, invalidAgents }
202
- };
203
-
204
- } catch (error) {
205
- return {
206
- passed: false,
207
- message: `Failed to validate agents: ${error.message}`,
208
- severity: 'error'
209
- };
210
- }
211
- }
212
-
213
- async function validateCLIIntegration() {
214
- const cliPath = path.join(process.cwd(), 'one', 'tools', 'cli.js');
215
-
216
- if (!await fs.pathExists(cliPath)) {
217
- return {
218
- passed: false,
219
- message: 'CLI integration file not found',
220
- severity: 'error'
221
- };
222
- }
223
-
224
- try {
225
- const content = await fs.readFile(cliPath, 'utf8');
226
- const issues = [];
227
-
228
- // Check for required CLI features
229
- const requiredFeatures = [
230
- 'dashboard',
231
- 'generate',
232
- 'dev',
233
- 'publish',
234
- 'agents'
235
- ];
236
-
237
- for (const feature of requiredFeatures) {
238
- if (!content.includes(feature)) {
239
- issues.push(`Missing CLI command: ${feature}`);
240
- }
241
- }
242
-
243
- // Check if file is executable
244
- try {
245
- const stats = await fs.stat(cliPath);
246
- const isExecutable = (stats.mode & parseInt('111', 8)) !== 0;
247
- if (!isExecutable) {
248
- issues.push('CLI file is not executable');
249
- }
250
- } catch (error) {
251
- issues.push('Cannot check CLI file permissions');
252
- }
253
-
254
- return {
255
- passed: issues.length === 0,
256
- message: issues.length > 0
257
- ? `CLI issues: ${issues.join(', ')}`
258
- : 'CLI integration is properly configured',
259
- severity: issues.length > 0 ? 'warning' : 'success',
260
- details: { issues, size: content.length }
261
- };
262
-
263
- } catch (error) {
264
- return {
265
- passed: false,
266
- message: `Failed to validate CLI: ${error.message}`,
267
- severity: 'error'
268
- };
269
- }
270
- }
271
-
272
- async function validatePackageIntegration() {
273
- const packagePath = path.join(process.cwd(), 'package.json');
274
-
275
- if (!await fs.pathExists(packagePath)) {
276
- return {
277
- passed: false,
278
- message: 'package.json not found',
279
- severity: 'error'
280
- };
281
- }
282
-
283
- try {
284
- const pkg = await fs.readJSON(packagePath);
285
- const issues = [];
286
-
287
- // Check for ONE scripts
288
- const requiredScripts = [
289
- 'one',
290
- 'one:generate',
291
- 'one:dev',
292
- 'one:publish'
293
- ];
294
-
295
- for (const script of requiredScripts) {
296
- if (!pkg.scripts || !pkg.scripts[script]) {
297
- issues.push(`Missing script: ${script}`);
298
- }
299
- }
300
-
301
- // Check for ONE configuration
302
- if (!pkg.one) {
303
- issues.push('Missing ONE configuration section');
304
- }
305
-
306
- // Check Node.js version requirement
307
- if (!pkg.engines || !pkg.engines.node) {
308
- issues.push('Missing Node.js version requirement');
309
- } else {
310
- const nodeVersion = pkg.engines.node;
311
- if (!nodeVersion.includes('18') && !nodeVersion.includes('>=18')) {
312
- issues.push('Node.js version should be >=18.0.0');
313
- }
314
- }
315
-
316
- return {
317
- passed: issues.length === 0,
318
- message: issues.length > 0
319
- ? `Package issues: ${issues.join(', ')}`
320
- : 'Package.json is properly configured for ONE',
321
- severity: issues.length === 0 ? 'success' : 'warning',
322
- details: {
323
- issues,
324
- hasONEConfig: !!pkg.one,
325
- scriptCount: pkg.scripts ? Object.keys(pkg.scripts).length : 0
326
- }
327
- };
328
-
329
- } catch (error) {
330
- return {
331
- passed: false,
332
- message: `Failed to validate package.json: ${error.message}`,
333
- severity: 'error'
334
- };
335
- }
336
- }
337
-
338
- async function validateFilePermissions() {
339
- const criticalFiles = [
340
- 'one/tools/cli.js',
341
- 'me/me.md'
342
- ];
343
-
344
- const issues = [];
345
-
346
- for (const file of criticalFiles) {
347
- try {
348
- if (await fs.pathExists(file)) {
349
- const stats = await fs.stat(file);
350
-
351
- // Check if file is readable
352
- try {
353
- await fs.access(file, fs.constants.R_OK);
354
- } catch (error) {
355
- issues.push(`${file} is not readable`);
356
- }
357
-
358
- // Check if CLI is executable
359
- if (file.includes('cli.js')) {
360
- try {
361
- await fs.access(file, fs.constants.X_OK);
362
- } catch (error) {
363
- issues.push(`${file} is not executable`);
364
- }
365
- }
366
-
367
- // Check if me.md is writable
368
- if (file.includes('me.md')) {
369
- try {
370
- await fs.access(file, fs.constants.W_OK);
371
- } catch (error) {
372
- issues.push(`${file} is not writable`);
373
- }
374
- }
375
- } else {
376
- issues.push(`${file} does not exist`);
377
- }
378
- } catch (error) {
379
- issues.push(`Cannot check ${file}: ${error.message}`);
380
- }
381
- }
382
-
383
- return {
384
- passed: issues.length === 0,
385
- message: issues.length > 0
386
- ? `Permission issues: ${issues.join(', ')}`
387
- : 'All file permissions are correct',
388
- severity: issues.length > 0 ? 'warning' : 'success',
389
- details: { issues, checkedFiles: criticalFiles.length }
390
- };
391
- }
392
-
393
- function displayValidationResults(results) {
394
- console.log(chalk.white('\\n🔍 Installation Validation Results:\\n'));
395
-
396
- for (const detail of results.details) {
397
- const icon = detail.passed ? '✅' : '❌';
398
- const color = detail.severity === 'error' ? chalk.red :
399
- detail.severity === 'warning' ? chalk.yellow : chalk.green;
400
-
401
- console.log(`${icon} ${chalk.white(detail.name)}: ${color(detail.message)}`);
402
- }
403
-
404
- const totalChecks = results.passed + results.failed;
405
- const successRate = Math.round((results.passed / totalChecks) * 100);
406
-
407
- console.log(chalk.white(`\\n📊 Validation Summary:`));
408
- console.log(chalk.green(`✅ Passed: ${results.passed}`));
409
- console.log(chalk.red(`❌ Failed: ${results.failed}`));
410
- console.log(chalk.white(`📈 Success Rate: ${successRate}%`));
411
-
412
- if (results.failed === 0) {
413
- console.log(chalk.green('\\n🎉 Installation validation passed! Your ONE universe is ready.'));
414
- } else {
415
- console.log(chalk.yellow('\\n⚠️ Some issues detected. Please review and fix before proceeding.'));
416
- }
417
- }
418
-
419
- module.exports = { validateInstallation };
@@ -1,87 +0,0 @@
1
- # /agent Command - Personal Agent Management
2
-
3
- Access and manage your personalized Top 8 AI agents.
4
-
5
- ## Personalized Agent Interface
6
-
7
- When this command is used:
8
-
9
- 1. **Read User Agents**: Parse `one/me/me.md` for user's configured Top 8 agents
10
- 2. **Show Agent Roster**: Display user's personalized agents with custom names and roles
11
- 3. **Direct Access**: Enable immediate connection to user's favorite agents
12
- 4. **Customization Options**: Allow user to modify agent configurations
13
-
14
- ```yaml
15
- activation:
16
- - Read user's top_agents configuration from me.md
17
- - Display user's personalized agent roster
18
- - Show agent availability and current assignments
19
- - Enable direct agent access and customization
20
-
21
- display:
22
- agent_roster: |
23
- 🤖 {{USER_NAME}}'s AI Agent Team
24
-
25
- Your Top 8 Agents:
26
- {{#each TOP_AGENTS}}
27
- [{{slot}}] {{name}} - {{role}}
28
- Personality: {{personality}}
29
- Catchphrase: "{{catchphrase}}"
30
- Status: {{status}}
31
- {{/each}}
32
-
33
- Available Commands:
34
- [1-8] Connect to agent by slot
35
- [list] Show all agents
36
- [customize] Edit agent configuration
37
- [add] Add new agent to roster
38
- [swap] Change agent positions
39
-
40
- behavior:
41
- direct_agent_access: |
42
- # Connect to user's configured agents
43
- - Launch agent with user's custom name and personality
44
- - Apply agent's configured catchphrase and behavior
45
- - Reference user's goals and mission context
46
- - Maintain agent's assigned role and specialization
47
-
48
- agent_customization: |
49
- # Allow users to personalize their agents
50
- - Edit agent names, roles, and personalities
51
- - Modify agent catchphrases and behavior patterns
52
- - Assign agents to specific missions or tasks
53
- - Save customizations back to me.md configuration
54
-
55
- roster_management: |
56
- # Manage the Top 8 agent slots
57
- - Add/remove agents from roster
58
- - Reorder agents by preference/usage
59
- - Import agents from the 43+ agent library
60
- - Create custom agent configurations
61
-
62
- commands:
63
- - connect [slot]: Connect to agent by slot number (1-8)
64
- - list: Show all available agents
65
- - roster: Display your Top 8 roster
66
- - customize [slot]: Edit agent configuration
67
- - add: Add agent to your roster
68
- - remove [slot]: Remove agent from roster
69
- - swap [slot1] [slot2]: Swap agent positions
70
- - import: Import from agent library
71
- - export: Export your agent configurations
72
-
73
- agent_templates:
74
- custom_agent: |
75
- slot: {{SLOT_NUMBER}}
76
- name: "{{AGENT_NAME}}"
77
- base: "{{BASE_SPECIALIZATION}}"
78
- role: "{{CUSTOM_ROLE}}"
79
- personality: "{{PERSONALITY_DESCRIPTION}}"
80
- catchphrase: "{{AGENT_CATCHPHRASE}}"
81
- specializations:
82
- - {{SKILL_1}}
83
- - {{SKILL_2}}
84
- mission_alignment: {{USER_GOALS}}
85
- ```
86
-
87
- Connect directly to your personalized AI agents or customize your agent roster to match your unique needs and working style.
@@ -1,65 +0,0 @@
1
- # /mission Command - Personal Mission Management
2
-
3
- Create and manage missions personalized to your goals and AI universe.
4
-
5
- ## Personalized Mission Interface
6
-
7
- When this command is used:
8
-
9
- 1. **Read User Context**: Parse `one/me/me.md` for user's personal goals and theme
10
- 2. **Show Personal Missions**: Display user's active missions from `one/missions/`
11
- 3. **Goal Alignment**: Suggest missions that align with user's configured goals
12
- 4. **Brand Consistency**: Apply user's theme and voice to mission interface
13
-
14
- ```yaml
15
- activation:
16
- - Read user's me.md for goal alignment and theme
17
- - Scan one/missions/ for existing user missions
18
- - Display personalized mission management interface
19
- - Show mission options that align with user's goals
20
-
21
- display:
22
- header: |
23
- 🎯 {{USER_NAME}} Mission Control
24
- {{USER_TAGLINE}}
25
-
26
- 📊 Your Goals:
27
- {{#each USER_GOALS}}
28
- • {{this}}
29
- {{/each}}
30
-
31
- behavior:
32
- goal_aligned_suggestions: |
33
- # Suggest missions based on user's configured goals
34
- - Analyze user's goals from me.md
35
- - Recommend mission types that advance those goals
36
- - Show how each mission contributes to goal achievement
37
- - Prioritize missions by goal alignment score
38
-
39
- personalized_mission_creation: |
40
- # Create missions that reflect user's style and objectives
41
- - Use user's brand voice for mission descriptions
42
- - Align mission objectives with user's personal goals
43
- - Reference user's configured spaces and agents
44
- - Apply user's theme colors to mission documentation
45
-
46
- commands:
47
- - create: Create new mission aligned with your goals
48
- - list: Show your active missions
49
- - status: Mission progress toward your goals
50
- - align: Check mission alignment with your goals
51
- - update: Update mission with new objectives
52
- - complete: Mark mission as completed
53
- - archive: Archive completed missions
54
-
55
- mission_templates:
56
- goal_based: |
57
- # Mission: {{MISSION_NAME}}
58
- **Goal Alignment**: {{ALIGNED_GOALS}}
59
- **Your Role**: {{USER_ROLE}}
60
- **Success Metric**: {{SUCCESS_CRITERIA}}
61
- **Timeline**: {{TIMELINE}}
62
- **Agents Assigned**: {{ASSIGNED_AGENTS}}
63
- ```
64
-
65
- Transform user requests into personalized missions that advance their specific goals using their configured AI agents and spaces.