luxlabs 1.0.21 → 1.0.24

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 (37) hide show
  1. package/README.md +16 -21
  2. package/commands/ab-tests.js +14 -11
  3. package/commands/agents.js +11 -11
  4. package/commands/data.js +19 -17
  5. package/commands/deploy.js +145 -82
  6. package/commands/flows.js +152 -133
  7. package/commands/interface/init.js +36 -35
  8. package/commands/interface.js +135 -10
  9. package/commands/knowledge.js +3 -3
  10. package/commands/list.js +6 -24
  11. package/commands/login.js +31 -26
  12. package/commands/logout.js +13 -4
  13. package/commands/logs.js +17 -66
  14. package/commands/project.js +74 -47
  15. package/commands/secrets.js +1 -1
  16. package/commands/servers.js +9 -113
  17. package/commands/storage.js +1 -1
  18. package/commands/tools.js +4 -4
  19. package/commands/validate-data-lux.js +5 -2
  20. package/commands/voice-agents.js +22 -18
  21. package/lib/config.js +235 -83
  22. package/lib/helpers.js +6 -4
  23. package/lux.js +4 -94
  24. package/package.json +6 -1
  25. package/templates/interface-boilerplate/components/auth/sign-in-form.tsx +41 -34
  26. package/templates/interface-boilerplate/components/auth/sign-up-form.tsx +41 -34
  27. package/templates/interface-boilerplate/components/providers/posthog-provider.tsx +41 -26
  28. package/templates/interface-boilerplate/gitignore.template +4 -0
  29. package/templates/interface-boilerplate/lib/auth.config.ts +3 -2
  30. package/templates/interface-boilerplate/lib/knowledge.ts +2 -2
  31. package/templates/interface-boilerplate/middleware.ts +14 -3
  32. package/templates/interface-boilerplate/next-env.d.ts +6 -0
  33. package/templates/interface-boilerplate/package-lock.json +432 -8
  34. package/commands/dev.js +0 -578
  35. package/commands/init.js +0 -126
  36. package/commands/link.js +0 -127
  37. package/commands/up.js +0 -211
package/commands/tools.js CHANGED
@@ -50,7 +50,7 @@ async function handleTools(args) {
50
50
  // Check authentication
51
51
  if (!isAuthenticated()) {
52
52
  console.log(
53
- chalk.red('Not authenticated. Run'),
53
+ chalk.red('Not authenticated. Run'),
54
54
  chalk.white('lux login'),
55
55
  chalk.red('first.')
56
56
  );
@@ -130,7 +130,7 @@ ${chalk.bold('Examples:')}
130
130
  })));
131
131
  }
132
132
 
133
- console.log(`\n${chalk.green('✓')} Total: ${tools.length} tool(s) (${defaultTools.length} default, ${customTools.length} custom)\n`);
133
+ console.log(`\nTotal: ${tools.length} tool(s) (${defaultTools.length} default, ${customTools.length} custom)\n`);
134
134
  break;
135
135
  }
136
136
 
@@ -175,7 +175,7 @@ ${chalk.bold('Examples:')}
175
175
  console.log('');
176
176
  }
177
177
 
178
- console.log(`${chalk.green('✓')} ${defaultTools.length} default tool(s)\n`);
178
+ console.log(`${defaultTools.length} default tool(s)\n`);
179
179
  break;
180
180
  }
181
181
 
@@ -224,7 +224,7 @@ ${chalk.bold('Examples:')}
224
224
  console.log('');
225
225
  }
226
226
 
227
- console.log(`${chalk.green('✓')} ${customTools.length} custom tool(s)\n`);
227
+ console.log(`${customTools.length} custom tool(s)\n`);
228
228
  break;
229
229
  }
230
230
 
@@ -18,6 +18,7 @@ const {
18
18
  getOrgId,
19
19
  getProjectId,
20
20
  LUX_STUDIO_DIR,
21
+ getShortId,
21
22
  } = require('../lib/config');
22
23
  const { error, success, info, warn } = require('../lib/helpers');
23
24
 
@@ -371,7 +372,9 @@ function validateFile(filePath, repoDir) {
371
372
  * Validate an interface
372
373
  */
373
374
  function validateInterface(interfaceId, interfacesDir) {
374
- const interfaceDir = path.join(interfacesDir, interfaceId);
375
+ // Use short ID for path construction
376
+ const shortInterfaceId = getShortId(interfaceId);
377
+ const interfaceDir = path.join(interfacesDir, shortInterfaceId);
375
378
  const repoDir = path.join(interfaceDir, 'repo');
376
379
 
377
380
  if (!fs.existsSync(repoDir)) {
@@ -440,7 +443,7 @@ function printResults(results, outputJson = false) {
440
443
  success('All interactive elements have data-lux attributes!');
441
444
  return { valid: true, totalIssues: 0 };
442
445
  } else {
443
- console.log(chalk.red(`\n${totalIssues} element(s) missing data-lux attributes`));
446
+ console.log(chalk.red(`\n${totalIssues} element(s) missing data-lux attributes`));
444
447
  console.log('');
445
448
  console.log(chalk.gray('To fix, add data-lux attributes using the createLux helper:'));
446
449
  console.log(chalk.gray(" 1. import { createLux } from '@/lib/lux';"));
@@ -18,6 +18,8 @@ const {
18
18
  getOrgId,
19
19
  getProjectId,
20
20
  LUX_STUDIO_DIR,
21
+ FOLDER_NAMES,
22
+ getShortId,
21
23
  } = require('../lib/config');
22
24
  const {
23
25
  error,
@@ -43,15 +45,17 @@ const BUILT_IN_VOICES = [
43
45
 
44
46
  /**
45
47
  * Get the voice agents cache path for the current project
48
+ * Uses short IDs and folder names to keep paths short
46
49
  */
47
50
  function getCachePath() {
48
51
  const orgId = getOrgId();
49
52
  const projectId = getProjectId();
50
53
  if (!orgId || !projectId) return null;
51
54
 
52
- // Handle org ID format (might have org_ prefix or not)
53
- const orgDir = orgId.startsWith('org_') ? orgId : `org_${orgId}`;
54
- return path.join(LUX_STUDIO_DIR, orgDir, 'projects', projectId, 'voice-agents-cache.json');
55
+ // Use short IDs for path construction
56
+ const shortOrgId = getShortId(orgId);
57
+ const shortProjectId = getShortId(projectId);
58
+ return path.join(LUX_STUDIO_DIR, shortOrgId, FOLDER_NAMES.projects, shortProjectId, 'voice-agents-cache.json');
55
59
  }
56
60
 
57
61
  /**
@@ -270,7 +274,7 @@ async function createAgent(apiKey, config) {
270
274
 
271
275
  return {
272
276
  id: data.agent_id,
273
- name: data.name,
277
+ name: config.name || data.name,
274
278
  };
275
279
  }
276
280
 
@@ -354,7 +358,7 @@ async function updateAgent(apiKey, agentId, config) {
354
358
 
355
359
  return {
356
360
  id: data.agent_id,
357
- name: data.name,
361
+ name: config.name || data.name,
358
362
  };
359
363
  }
360
364
 
@@ -535,7 +539,7 @@ async function handleVoiceAgents(args) {
535
539
  // Check authentication
536
540
  if (!isAuthenticated()) {
537
541
  console.log(
538
- chalk.red('Not authenticated. Run'),
542
+ chalk.red('Not authenticated. Run'),
539
543
  chalk.white('lux login'),
540
544
  chalk.red('first.')
541
545
  );
@@ -638,7 +642,7 @@ ${chalk.bold('Available Voices:')}
638
642
  info(`Loading agent: ${agentId}`);
639
643
  const agent = await getAgent(apiKey, agentId);
640
644
 
641
- console.log(`\n🤖 Agent Details:\n`);
645
+ console.log(`\nAgent Details:\n`);
642
646
  console.log(` ID: ${agent.id}`);
643
647
  console.log(` Name: ${agent.name}`);
644
648
  console.log(` Voice: ${agent.voice || '(default)'}`);
@@ -646,7 +650,7 @@ ${chalk.bold('Available Voices:')}
646
650
  console.log(` Temperature: ${agent.temperature}`);
647
651
  console.log(` Max Duration: ${agent.maxDurationSeconds}s`);
648
652
  console.log(` Greeting: ${agent.greeting || '(none)'}`);
649
- console.log(`\n📝 System Prompt:\n`);
653
+ console.log(`\nSystem Prompt:\n`);
650
654
  console.log(agent.systemPrompt || '(empty)');
651
655
  console.log('');
652
656
  break;
@@ -854,7 +858,7 @@ ${chalk.bold('Available Voices:')}
854
858
  error(`Phone number ${phoneNumber} not found in your Twilio account`);
855
859
  }
856
860
 
857
- console.log(`\n📞 Inbound Status for ${phoneNumber}\n`);
861
+ console.log(`\nInbound Status for ${phoneNumber}\n`);
858
862
  console.log(` SID: ${target.sid}`);
859
863
  console.log(` Friendly Name: ${target.friendlyName}`);
860
864
  console.log(` Voice URL: ${target.voiceUrl || '(not configured)'}`);
@@ -904,7 +908,7 @@ ${chalk.bold('Available Voices:')}
904
908
 
905
909
  // Check ElevenLabs/Voice Agent credentials
906
910
  const elevenLabsOk = !!apiKey;
907
- console.log(`ElevenLabs API: ${elevenLabsOk ? chalk.green('configured') : chalk.red('not configured')}`);
911
+ console.log(`ElevenLabs API: ${elevenLabsOk ? chalk.green('configured') : chalk.red('not configured')}`);
908
912
 
909
913
  // Check Twilio credentials
910
914
  let twilioOk = false;
@@ -918,7 +922,7 @@ ${chalk.bold('Available Voices:')}
918
922
  } catch {
919
923
  twilioOk = false;
920
924
  }
921
- console.log(`Twilio API: ${twilioOk ? chalk.green('configured') : chalk.red('not configured')}`);
925
+ console.log(`Twilio API: ${twilioOk ? chalk.green('configured') : chalk.red('not configured')}`);
922
926
 
923
927
  // Check phone numbers
924
928
  let importedNumbers = [];
@@ -931,25 +935,25 @@ ${chalk.bold('Available Voices:')}
931
935
  }
932
936
 
933
937
  const totalPhones = Math.max(twilioNumbers.length, importedNumbers.length);
934
- console.log(`Phone Numbers: ${totalPhones > 0 ? chalk.green(`✓ ${totalPhones} available`) : chalk.yellow('none available')}`);
938
+ console.log(`Phone Numbers: ${totalPhones > 0 ? chalk.green(`${totalPhones} available`) : chalk.yellow('none available')}`);
935
939
 
936
940
  // Summary and next steps
937
941
  console.log('');
938
942
 
939
943
  if (!elevenLabsOk) {
940
- console.log(chalk.yellow('Voice agent credentials not available.'));
944
+ console.log(chalk.yellow('Voice agent credentials not available.'));
941
945
  console.log(' Voice agents may not be enabled for this project.');
942
946
  console.log('');
943
947
  }
944
948
 
945
949
  if (!twilioOk) {
946
- console.log(chalk.yellow('Twilio not configured - inbound calls will not work.'));
950
+ console.log(chalk.yellow('Twilio not configured - inbound calls will not work.'));
947
951
  console.log(' Add credentials in: Settings → Credentials → Twilio');
948
952
  console.log('');
949
953
  }
950
954
 
951
955
  if (totalPhones === 0 && twilioOk) {
952
- console.log(chalk.yellow('No phone numbers available.'));
956
+ console.log(chalk.yellow('No phone numbers available.'));
953
957
  console.log(' Import a Twilio number in the Voice Agents panel.');
954
958
  console.log('');
955
959
  }
@@ -959,8 +963,8 @@ ${chalk.bold('Available Voices:')}
959
963
  const inboundReady = elevenLabsOk && twilioOk && totalPhones > 0;
960
964
 
961
965
  console.log(chalk.bold('Capabilities:'));
962
- console.log(` Outbound calls: ${outboundReady ? chalk.green('ready') : chalk.red('not ready')}`);
963
- console.log(` Inbound calls: ${inboundReady ? chalk.green('ready') : chalk.red('not ready')}`);
966
+ console.log(` Outbound calls: ${outboundReady ? chalk.green('ready') : chalk.red('not ready')}`);
967
+ console.log(` Inbound calls: ${inboundReady ? chalk.green('ready') : chalk.red('not ready')}`);
964
968
  console.log('');
965
969
 
966
970
  break;
@@ -970,7 +974,7 @@ ${chalk.bold('Available Voices:')}
970
974
  const cache = readCache();
971
975
  const cachePath = getCachePath();
972
976
 
973
- console.log(`\n📁 Cache Location: ${cachePath || '(not available)'}\n`);
977
+ console.log(`\nCache Location: ${cachePath || '(not available)'}\n`);
974
978
 
975
979
  if (cache.lastUpdated) {
976
980
  console.log(`Last Updated: ${cache.lastUpdated}\n`);