oneie 1.1.0 → 1.2.1

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/one/tools/cli.js CHANGED
@@ -5,11 +5,15 @@ import { promises as fs } from 'fs';
5
5
  import path from 'path';
6
6
  import { fileURLToPath } from 'url';
7
7
  import process from 'process';
8
+ import { BackgroundAgentLoader } from './background-agent-loader.js';
8
9
 
9
10
  const __filename = fileURLToPath(import.meta.url);
10
11
  const __dirname = path.dirname(__filename);
11
12
  const program = new Command();
12
13
 
14
+ // Initialize Background Agent Loader
15
+ const agentLoader = new BackgroundAgentLoader();
16
+
13
17
  // Responsive Display Functions
14
18
  function getTerminalWidth() {
15
19
  // Check environment variable first, then stdout.columns, then default to 80
@@ -826,17 +830,133 @@ program
826
830
  displayONEInterface();
827
831
  });
828
832
 
829
- // Dynamic agent launch command - matches any agent name
833
+ // Dynamic agent launch command - matches any agent name (includes one:agent-name support)
830
834
  program
831
- .arguments('<agent-name>')
832
- .description('Launch a specific agent')
833
- .action(async (agentName) => {
835
+ .arguments('<agent-name> [args...]')
836
+ .description('Launch a specific agent (supports both legacy and one:agent-name patterns)')
837
+ .action(async (agentName, args) => {
834
838
  // Check if it's the special "/one" command
835
839
  if (agentName === '/one' || agentName === 'one') {
836
840
  displayONEInterface();
837
841
  return;
838
842
  }
839
843
 
844
+ // Check if this is a one:agent-name pattern - handle with BackgroundAgentLoader
845
+ if (agentName.startsWith('one:')) {
846
+ const command = agentName.replace('one:', '');
847
+
848
+ console.log(`šŸ¤– Executing agent command: ${agentName}`);
849
+ console.log('šŸ“ Agent execution via BackgroundAgentLoader...\n');
850
+
851
+ try {
852
+ // Check if agent exists before attempting to load
853
+ const availableAgents = await agentLoader.listAvailableAgents();
854
+ const validAgents = availableAgents.filter(agent => agent !== 'README' && !agent.startsWith('.'));
855
+
856
+ if (!validAgents.includes(command)) {
857
+ console.error(`āŒ Agent '${command}' not found in .claude/agents/`);
858
+ console.error('\nšŸ“‹ Available agents:');
859
+ validAgents.forEach(agent => {
860
+ console.error(` - one:${agent}`);
861
+ });
862
+ process.exit(1);
863
+ }
864
+
865
+ // Load agent using BackgroundAgentLoader
866
+ const agent = await agentLoader.loadAgent(command);
867
+
868
+ if (!agent) {
869
+ console.error(`āŒ Failed to load agent '${command}'`);
870
+ process.exit(1);
871
+ }
872
+
873
+ // Get agent arguments
874
+ const agentArgs = args && args.length > 0 ? args.join(' ') : '';
875
+
876
+ // Execute agent with context and arguments
877
+ const context = {
878
+ command: agentName,
879
+ timestamp: new Date().toISOString(),
880
+ arguments: agentArgs,
881
+ workingDirectory: process.cwd()
882
+ };
883
+
884
+ console.log(`āœ… Agent loaded: ${agent.name || command}`);
885
+ console.log(`šŸ“ Description: ${agent.description || 'No description available'}`);
886
+ console.log(`šŸ¢ Team: ${agent.team || 'Core'}`);
887
+
888
+ if (agentArgs) {
889
+ console.log(`šŸ’¬ Arguments: ${agentArgs}`);
890
+ }
891
+
892
+ // Execute the agent with coordination enabled
893
+ const executionOptions = {
894
+ enableCoordination: true,
895
+ maxSpawn: 2,
896
+ executeSpawnedAgents: false // Don't execute spawned agents immediately
897
+ };
898
+
899
+ const result = await agentLoader.executeAgent(command, context, agentArgs, executionOptions);
900
+
901
+ console.log('\nšŸŽÆ Agent execution completed successfully!');
902
+ console.log(`ā±ļø Execution time: ${result.executionTime || 'N/A'}`);
903
+
904
+ // Display coordination results if available
905
+ if (result.coordination) {
906
+ console.log('\nšŸ¤ Agent Coordination:');
907
+ console.log(` šŸ“” Session ID: ${result.coordination.sessionId}`);
908
+ console.log(` šŸ¤– Spawned Agents: ${result.coordination.spawnedAgents.length}`);
909
+ if (result.coordination.spawnedAgents.length > 0) {
910
+ result.coordination.spawnedAgents.forEach(agent => {
911
+ console.log(` • ${agent.name} (${agent.role})`);
912
+ });
913
+ }
914
+ console.log(` šŸ¤ Coordinated Agents: ${result.coordination.coordinatedAgents.length}`);
915
+ if (result.coordination.coordinatedAgents.length > 0) {
916
+ result.coordination.coordinatedAgents.forEach(agent => {
917
+ console.log(` • ${agent.name} (${agent.role})`);
918
+ });
919
+ }
920
+ console.log(` ā±ļø Coordination Duration: ${result.coordination.duration}ms`);
921
+ }
922
+
923
+ if (result.output) {
924
+ console.log('\nšŸ“¤ Agent output:');
925
+ console.log(result.output);
926
+ }
927
+
928
+ } catch (error) {
929
+ // Handle premium agent access errors specially
930
+ if (error.code === 'PREMIUM_ACCESS_REQUIRED') {
931
+ console.error('šŸ”’ Premium Agent Access Required\n');
932
+
933
+ // Generate and display upgrade prompt
934
+ const upgradePrompt = await agentLoader.generateUpgradePrompt(command);
935
+ console.log(upgradePrompt);
936
+
937
+ process.exit(1);
938
+ }
939
+
940
+ console.error('āŒ Agent execution failed:', error.message);
941
+
942
+ // Provide helpful debugging information
943
+ console.log('\nšŸ” Troubleshooting:');
944
+ console.log(' • Ensure agent exists in .claude/agents/ directory');
945
+ console.log(' • Check agent file format and structure');
946
+ console.log(' • Try: node one/tools/cli.js one:engineering-director');
947
+ console.log(' • View available agents with: one agent --list --claude');
948
+
949
+ if (process.env.NODE_ENV === 'development' && error.stack) {
950
+ console.log('\nšŸ› Stack trace:');
951
+ console.log(error.stack);
952
+ }
953
+
954
+ process.exit(1);
955
+ }
956
+
957
+ return;
958
+ }
959
+
840
960
  const { default: WebBuilder } = await import('./builders/web-builder.js');
841
961
  const builder = new WebBuilder({ rootDir: process.cwd() });
842
962
 
@@ -1494,6 +1614,16 @@ program
1494
1614
  await handleFormatsCommand(options);
1495
1615
  });
1496
1616
 
1617
+ program
1618
+ .command('one:license')
1619
+ .description('Manage premium agent licensing')
1620
+ .option('-s, --status', 'Show license status')
1621
+ .option('-t, --trial [days]', 'Create trial license (default: 7 days)')
1622
+ .option('-l, --list', 'List agents with premium status')
1623
+ .action(async (options) => {
1624
+ await handleLicenseCommand(options);
1625
+ });
1626
+
1497
1627
 
1498
1628
  // ONE Command Handler
1499
1629
  async function handleOneCommand(type, subcommand) {
@@ -1643,6 +1773,167 @@ async function handlePdfCommand(file, options) {
1643
1773
  });
1644
1774
  }
1645
1775
 
1776
+ // Handle license management command
1777
+ async function handleLicenseCommand(options) {
1778
+ console.log('šŸ“„ ONE Framework License Manager\n');
1779
+
1780
+ if (options.status) {
1781
+ const status = await agentLoader.getLicenseStatus();
1782
+
1783
+ console.log(`Status: ${status.status}`);
1784
+ console.log(`Message: ${status.message}`);
1785
+
1786
+ if (status.licenseType) {
1787
+ console.log(`License Type: ${status.licenseType}`);
1788
+ console.log(`Expires: ${status.expiresAt ? new Date(status.expiresAt).toLocaleDateString() : 'N/A'}`);
1789
+ if (status.daysUntilExpiry) {
1790
+ console.log(`Days until expiry: ${status.daysUntilExpiry}`);
1791
+ }
1792
+ }
1793
+
1794
+ console.log(`Free agents: ${status.freeAgents || 0}`);
1795
+ console.log(`Premium agents: ${status.premiumAgents || 0}`);
1796
+
1797
+ if (status.status === 'unlicensed') {
1798
+ console.log('\nšŸ’” To try premium agents:');
1799
+ console.log(' node one/tools/cli.js one:license --trial');
1800
+ console.log('\nšŸ’³ For full access:');
1801
+ console.log(' Visit: https://one.ie/upgrade');
1802
+ }
1803
+
1804
+ return;
1805
+ }
1806
+
1807
+ if (options.trial !== undefined) {
1808
+ const days = parseInt(options.trial) || 7;
1809
+ console.log(`šŸŽÆ Creating ${days}-day trial license...\n`);
1810
+
1811
+ try {
1812
+ const trialLicense = await agentLoader.createTrialLicense(days);
1813
+
1814
+ console.log('āœ… Trial license created successfully!');
1815
+ console.log(`šŸ“… Valid until: ${new Date(trialLicense.expiresAt).toLocaleDateString()}`);
1816
+ console.log(`šŸ”‘ License Key: ${trialLicense.key}`);
1817
+ console.log('\nšŸš€ You now have access to premium agents:');
1818
+ console.log(' • Complete Marketing Team');
1819
+ console.log(' • Crypto Trading Specialists');
1820
+ console.log(' • Viral Growth Engine');
1821
+ console.log('\nTry: node one/tools/cli.js one:marketing-director');
1822
+
1823
+ } catch (error) {
1824
+ console.error('āŒ Failed to create trial license:', error.message);
1825
+ process.exit(1);
1826
+ }
1827
+
1828
+ return;
1829
+ }
1830
+
1831
+ if (options.list) {
1832
+ console.log('šŸ“‹ Agents with Premium Status:\n');
1833
+
1834
+ try {
1835
+ const agentList = await agentLoader.listAgentsWithStatus();
1836
+ const freeAgents = agentList.filter(a => !a.isPremium);
1837
+ const premiumAgents = agentList.filter(a => a.isPremium);
1838
+
1839
+ if (freeAgents.length > 0) {
1840
+ console.log('šŸ†“ Free Agents:');
1841
+ freeAgents.forEach(agent => {
1842
+ const status = agent.hasAccess ? 'āœ…' : 'āŒ';
1843
+ console.log(` ${status} ${agent.name}`);
1844
+ });
1845
+ console.log();
1846
+ }
1847
+
1848
+ if (premiumAgents.length > 0) {
1849
+ console.log('šŸ’Ž Premium Agents:');
1850
+ premiumAgents.forEach(agent => {
1851
+ const status = agent.hasAccess ? 'āœ…' : 'šŸ”’';
1852
+ console.log(` ${status} ${agent.name}`);
1853
+ });
1854
+ console.log();
1855
+ }
1856
+
1857
+ console.log(`Total: ${freeAgents.length} free, ${premiumAgents.length} premium`);
1858
+
1859
+ } catch (error) {
1860
+ console.error('āŒ Failed to list agents:', error.message);
1861
+ process.exit(1);
1862
+ }
1863
+
1864
+ return;
1865
+ }
1866
+
1867
+ // Default: show license status
1868
+ await handleLicenseCommand({ status: true });
1869
+ }
1870
+
1871
+ // Add coordination stats command
1872
+ program
1873
+ .command('one:coordination')
1874
+ .alias('one:coord')
1875
+ .description('šŸ“Š View agent coordination statistics and active sessions')
1876
+ .option('--sessions', 'Show active coordination sessions')
1877
+ .option('--stats', 'Show coordination statistics')
1878
+ .action(async (options) => {
1879
+ const agentLoader = new BackgroundAgentLoader();
1880
+
1881
+ if (options.sessions) {
1882
+ console.log(chalk.cyan('šŸ¤ Active Agent Coordination Sessions:\n'));
1883
+
1884
+ const activeSessions = agentLoader.getActiveCoordinationSessions();
1885
+
1886
+ if (activeSessions.length === 0) {
1887
+ console.log(chalk.yellow('ā³ No active coordination sessions'));
1888
+ return;
1889
+ }
1890
+
1891
+ activeSessions.forEach(session => {
1892
+ console.log(chalk.blue(`šŸ“” Session ${session.id}:`));
1893
+ console.log(` šŸŽÆ Primary Agent: ${session.primaryAgent}`);
1894
+ console.log(` šŸ“ Context: ${session.context.substring(0, 60)}${session.context.length > 60 ? '...' : ''}`);
1895
+ console.log(` ā° Started: ${new Date(session.startTime).toLocaleTimeString()}`);
1896
+ console.log(` šŸ“Š Status: ${session.status}`);
1897
+ if (session.spawnedAgents?.length > 0) {
1898
+ console.log(` šŸ¤– Spawned: ${session.spawnedAgents.map(a => a.name).join(', ')}`);
1899
+ }
1900
+ if (session.coordinatedAgents?.length > 0) {
1901
+ console.log(` šŸ¤ Coordinated: ${session.coordinatedAgents.map(a => a.name).join(', ')}`);
1902
+ }
1903
+ console.log('');
1904
+ });
1905
+ return;
1906
+ }
1907
+
1908
+ if (options.stats || (!options.sessions && !options.stats)) {
1909
+ console.log(chalk.cyan('šŸ“Š Agent Coordination Statistics:\n'));
1910
+
1911
+ const stats = agentLoader.getCoordinationStats();
1912
+
1913
+ if (!stats.enabled) {
1914
+ console.log(chalk.yellow('āš ļø Agent coordination is disabled'));
1915
+ return;
1916
+ }
1917
+
1918
+ console.log(chalk.blue('šŸ“ˆ Overall Statistics:'));
1919
+ console.log(` šŸ“” Total Sessions: ${stats.totalSessions}`);
1920
+ console.log(` āœ… Completed: ${stats.completed}`);
1921
+ console.log(` āŒ Failed: ${stats.failed}`);
1922
+ console.log(` ⚔ Active: ${stats.active}`);
1923
+ console.log(` šŸ“Š Success Rate: ${stats.successRate}%`);
1924
+ console.log(` ā±ļø Average Duration: ${stats.averageDuration}ms`);
1925
+
1926
+ console.log(chalk.blue('\nšŸ¤– Agent Activity:'));
1927
+ console.log(` šŸ“” Total Agents Spawned: ${stats.totalAgentsSpawned}`);
1928
+ console.log(` šŸ¤ Total Agents Coordinated: ${stats.totalAgentsCoordinated}`);
1929
+
1930
+ if (stats.totalSessions === 0) {
1931
+ console.log(chalk.gray('\nšŸ’” Try running an agent with a complex request to see coordination in action:'));
1932
+ console.log(' node one/tools/cli.js one:engineering-director "Design a scalable microservice architecture"');
1933
+ }
1934
+ }
1935
+ });
1936
+
1646
1937
  // Handle multi-format generation command
1647
1938
  async function handleFormatsCommand(options) {
1648
1939
  const { spawn } = await import('child_process');
@@ -2084,29 +2375,41 @@ async function listAgents(teamFilter, claudeOnly) {
2084
2375
 
2085
2376
  if (claudeOnly) {
2086
2377
  console.log('šŸŽ­ \\x1b[1mClaude Code Agents\\x1b[0m (.claude/agents/)\\n');
2087
- displayAgentsByTeam(claudeAgents, teamFilter);
2378
+ await displayAgentsByTeam(claudeAgents, teamFilter, true);
2088
2379
  } else {
2089
2380
  console.log('šŸŽ­ \\x1b[1mAgent Symphony - Beautiful Simplicity\\x1b[0m\\n');
2090
2381
 
2091
2382
  if (claudeAgents.length > 0) {
2092
2383
  console.log('\\x1b[36mšŸŽŖ Claude Code Agents\\x1b[0m (.claude/agents/)');
2093
- displayAgentsByTeam(claudeAgents, teamFilter);
2384
+ await displayAgentsByTeam(claudeAgents, teamFilter, true);
2094
2385
  console.log();
2095
2386
  }
2096
2387
 
2097
2388
  if (oneAgents.length > 0) {
2098
2389
  console.log('\\x1b[33mšŸŽŖ ONE Framework Agents\\x1b[0m (one/agents/)');
2099
- displayAgentsByTeam(oneAgents, teamFilter);
2390
+ await displayAgentsByTeam(oneAgents, teamFilter);
2100
2391
  }
2101
2392
 
2102
2393
  console.log(`\\n\\x1b[32m✨ Total: ${claudeAgents.length + oneAgents.length} specialized agents ready\\x1b[0m`);
2103
- console.log('\\x1b[2mUse: one agent <name> to invoke, one agent -i <name> for details\\x1b[0m');
2394
+ console.log('\\x1b[2mUse: one:agent-name for background execution, one agent <name> for legacy mode\\x1b[0m');
2395
+
2396
+ // Show license status
2397
+ try {
2398
+ const licenseStatus = await agentLoader.getLicenseStatus();
2399
+ console.log(`\\nšŸ“„ License: ${licenseStatus.status} (${licenseStatus.freeAgents || 0} free, ${licenseStatus.premiumAgents || 0} premium)`);
2400
+ if (licenseStatus.status === 'unlicensed') {
2401
+ console.log('\\x1b[33mšŸ’” Tip: Premium agents require upgrade. Try: node one/tools/cli.js one:marketing-director\\x1b[0m');
2402
+ }
2403
+ } catch (error) {
2404
+ // License status is optional, don't fail the listing
2405
+ }
2104
2406
  }
2105
2407
  }
2106
2408
 
2107
- function displayAgentsByTeam(agents, teamFilter) {
2409
+ async function displayAgentsByTeam(agents, teamFilter, showOnePattern = false) {
2108
2410
  const teams = {};
2109
2411
 
2412
+ // Group agents by team
2110
2413
  agents.forEach(agent => {
2111
2414
  const team = extractTeam(agent);
2112
2415
  if (!teamFilter || team.toLowerCase().includes(teamFilter.toLowerCase())) {
@@ -2115,12 +2418,27 @@ function displayAgentsByTeam(agents, teamFilter) {
2115
2418
  }
2116
2419
  });
2117
2420
 
2118
- Object.entries(teams).sort().forEach(([team, teamAgents]) => {
2421
+ // Display agents with premium indicators
2422
+ for (const [team, teamAgents] of Object.entries(teams).sort()) {
2119
2423
  console.log(`\\n \\x1b[1m${team}\\x1b[0m`);
2120
- teamAgents.sort().forEach(agent => {
2121
- console.log(` • ${agent}`);
2122
- });
2123
- });
2424
+
2425
+ for (const agent of teamAgents.sort()) {
2426
+ const isPremium = agentLoader.isPremiumAgent(agent);
2427
+ const premiumIcon = isPremium ? ' šŸ’Ž' : '';
2428
+
2429
+ if (showOnePattern) {
2430
+ console.log(` • one:${agent}${premiumIcon}`);
2431
+ } else {
2432
+ console.log(` • ${agent}${premiumIcon}`);
2433
+ }
2434
+ }
2435
+ }
2436
+
2437
+ // Show legend for premium indicators
2438
+ const hasPremium = agents.some(agent => agentLoader.isPremiumAgent(agent));
2439
+ if (hasPremium) {
2440
+ console.log('\\n \\x1b[2mšŸ’Ž = Premium agent (requires upgrade)\\x1b[0m');
2441
+ }
2124
2442
  }
2125
2443
 
2126
2444
  async function discoverOneAgents() {
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.1",
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",
@@ -120,7 +112,7 @@
120
112
  "universal-installer",
121
113
  "equal-participation",
122
114
  "mission-driven",
123
- "development",
115
+ "development",
124
116
  "ai-agents",
125
117
  "project-management",
126
118
  "claude-code",
@@ -168,4 +160,4 @@
168
160
  "prettier --write"
169
161
  ]
170
162
  }
171
- }
163
+ }
@@ -1,14 +0,0 @@
1
- bundle:
2
- name: Team All
3
- icon: šŸ‘„
4
- description: Includes every core system agent.
5
- agents:
6
- - one-orchestrator
7
- - '*'
8
- workflows:
9
- - brownfield-fullstack.yaml
10
- - brownfield-service.yaml
11
- - brownfield-ui.yaml
12
- - greenfield-fullstack.yaml
13
- - greenfield-service.yaml
14
- - greenfield-ui.yaml
@@ -1,18 +0,0 @@
1
- bundle:
2
- name: Team Fullstack
3
- icon: šŸš€
4
- description: Team capable of full stack, front end only, or service development.
5
- agents:
6
- - one-orchestrator
7
- - analyst
8
- - pm
9
- - ux-expert
10
- - architect
11
- - po
12
- workflows:
13
- - brownfield-fullstack.yaml
14
- - brownfield-service.yaml
15
- - brownfield-ui.yaml
16
- - greenfield-fullstack.yaml
17
- - greenfield-service.yaml
18
- - greenfield-ui.yaml
@@ -1,10 +0,0 @@
1
- bundle:
2
- name: Team IDE Minimal
3
- icon: ⚔
4
- description: Only the bare minimum for the IDE PO SM dev qa cycle.
5
- agents:
6
- - po
7
- - sm
8
- - dev
9
- - qa
10
- workflows: null
@@ -1,21 +0,0 @@
1
- bundle:
2
- name: Elevate Marketing Team
3
- icon: šŸ“ˆ
4
- description: Complete Elevate Marketing Framework team with specialists for each phase
5
- agents:
6
- - one-orchestrator
7
- - brand-identity-specialist
8
- - market-research-analyst
9
- - customer-journey-designer
10
- - content-hook-specialist
11
- - lead-magnet-creator
12
- - lead-capture-expert
13
- - engagement-specialist
14
- - sales-environment-optimizer
15
- - nurture-campaign-manager
16
- - upsell-strategist
17
- - customer-success-manager
18
- - advocacy-campaign-designer
19
- workflows:
20
- - elevate-greenfield-workflow.yaml
21
- - elevate-brownfield-workflow.yaml
@@ -1,13 +0,0 @@
1
- bundle:
2
- name: Team No UI
3
- icon: šŸ”§
4
- description: Team with no UX or UI Planning.
5
- agents:
6
- - one-orchestrator
7
- - analyst
8
- - pm
9
- - architect
10
- - po
11
- workflows:
12
- - greenfield-service.yaml
13
- - brownfield-service.yaml