@lanonasis/cli 3.6.3 → 3.6.5

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 (41) hide show
  1. package/dist/commands/api-keys.d.ts +1 -2
  2. package/dist/commands/api-keys.js +78 -73
  3. package/dist/commands/auth.js +167 -160
  4. package/dist/commands/completion.js +39 -31
  5. package/dist/commands/config.js +201 -162
  6. package/dist/commands/enhanced-memory.js +17 -11
  7. package/dist/commands/guide.js +88 -79
  8. package/dist/commands/init.js +20 -14
  9. package/dist/commands/mcp.js +173 -142
  10. package/dist/commands/memory.js +83 -77
  11. package/dist/commands/organization.js +21 -15
  12. package/dist/commands/topics.js +58 -52
  13. package/dist/core/achievements.js +26 -19
  14. package/dist/core/architecture.js +59 -42
  15. package/dist/core/dashboard.js +81 -71
  16. package/dist/core/error-handler.js +39 -30
  17. package/dist/core/power-mode.js +53 -46
  18. package/dist/core/progress.js +44 -35
  19. package/dist/core/welcome.js +64 -56
  20. package/dist/enhanced-cli.js +58 -49
  21. package/dist/index-simple.js +112 -74
  22. package/dist/index.js +68 -63
  23. package/dist/mcp/access-control.js +17 -13
  24. package/dist/mcp/client/enhanced-client.js +23 -16
  25. package/dist/mcp/enhanced-server.js +14 -10
  26. package/dist/mcp/logger.js +6 -2
  27. package/dist/mcp/memory-state.js +17 -13
  28. package/dist/mcp/schemas/tool-schemas.d.ts +28 -28
  29. package/dist/mcp/schemas/tool-schemas.js +126 -122
  30. package/dist/mcp/server/lanonasis-server.js +51 -44
  31. package/dist/mcp/transports/transport-manager.js +25 -18
  32. package/dist/mcp/vector-store.js +10 -6
  33. package/dist/mcp-server.js +21 -17
  34. package/dist/utils/api.js +30 -21
  35. package/dist/utils/config.js +61 -15
  36. package/dist/utils/formatting.js +14 -6
  37. package/dist/utils/mcp-client.js +132 -77
  38. package/package.json +17 -92
  39. package/dist/completions/bash-completion.sh +0 -88
  40. package/dist/completions/fish-completion.fish +0 -132
  41. package/dist/completions/zsh-completion.zsh +0 -196
@@ -1,45 +1,83 @@
1
1
  #!/usr/bin/env node
2
- import { Command } from 'commander';
3
- import chalk from 'chalk';
4
- import { config } from 'dotenv';
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __importDefault = (this && this.__importDefault) || function (mod) {
37
+ return (mod && mod.__esModule) ? mod : { "default": mod };
38
+ };
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ const commander_1 = require("commander");
41
+ const chalk_1 = __importDefault(require("chalk"));
42
+ const dotenv_1 = require("dotenv");
5
43
  // Load environment variables silently
6
- config({ quiet: true });
7
- import { initCommand } from './commands/init.js';
8
- import { loginCommand } from './commands/auth.js';
9
- import { memoryCommands } from './commands/memory.js';
10
- import { topicCommands } from './commands/topics.js';
11
- import { configCommands } from './commands/config.js';
12
- import { orgCommands } from './commands/organization.js';
13
- import { mcpCommands } from './commands/mcp.js';
14
- import apiKeysCommand from './commands/api-keys.js';
15
- import { completionCommand, installCompletionsCommand } from './commands/completion.js';
16
- import { guideCommand, quickStartCommand } from './commands/guide.js';
17
- import { CLIConfig } from './utils/config.js';
18
- import { getMCPClient } from './utils/mcp-client.js';
19
- import * as fs from 'fs';
20
- import * as path from 'path';
21
- import { fileURLToPath } from 'url';
22
- const __filename = fileURLToPath(import.meta.url);
44
+ (0, dotenv_1.config)({ quiet: true });
45
+ const init_js_1 = require("./commands/init.js");
46
+ const auth_js_1 = require("./commands/auth.js");
47
+ const memory_js_1 = require("./commands/memory.js");
48
+ const topics_js_1 = require("./commands/topics.js");
49
+ const config_js_1 = require("./commands/config.js");
50
+ const organization_js_1 = require("./commands/organization.js");
51
+ const mcp_js_1 = require("./commands/mcp.js");
52
+ const api_keys_js_1 = __importDefault(require("./commands/api-keys.js"));
53
+ const completion_js_1 = require("./commands/completion.js");
54
+ const guide_js_1 = require("./commands/guide.js");
55
+ const config_js_2 = require("./utils/config.js");
56
+ const mcp_client_js_1 = require("./utils/mcp-client.js");
57
+ const fs = __importStar(require("fs"));
58
+ const path = __importStar(require("path"));
59
+ const url_1 = require("url");
60
+ const __filename = (0, url_1.fileURLToPath)(import.meta.url);
23
61
  const __dirname = path.dirname(__filename);
24
62
  // Load environment variables
25
- config();
26
- import { createRequire } from 'module';
27
- const require = createRequire(import.meta.url);
63
+ (0, dotenv_1.config)();
64
+ const module_1 = require("module");
65
+ const require = (0, module_1.createRequire)(import.meta.url);
28
66
  const packageJson = require('../package.json');
29
67
  // Enhanced color scheme (VPS-style)
30
68
  const colors = {
31
- primary: chalk.blue.bold,
32
- success: chalk.green,
33
- warning: chalk.yellow,
34
- error: chalk.red,
35
- info: chalk.cyan,
36
- accent: chalk.magenta,
37
- muted: chalk.gray,
38
- highlight: chalk.white.bold
69
+ primary: chalk_1.default.blue.bold,
70
+ success: chalk_1.default.green,
71
+ warning: chalk_1.default.yellow,
72
+ error: chalk_1.default.red,
73
+ info: chalk_1.default.cyan,
74
+ accent: chalk_1.default.magenta,
75
+ muted: chalk_1.default.gray,
76
+ highlight: chalk_1.default.white.bold
39
77
  };
40
- const program = new Command();
78
+ const program = new commander_1.Command();
41
79
  // CLI Configuration
42
- const cliConfig = new CLIConfig();
80
+ const cliConfig = new config_js_2.CLIConfig();
43
81
  // Detect which command was used to invoke the CLI
44
82
  const invocationName = process.argv[1] ? path.basename(process.argv[1]) : 'lanonasis';
45
83
  const isOnasisInvocation = invocationName === 'onasis';
@@ -71,7 +109,7 @@ program
71
109
  actionCommand.parent?.name?.() === 'mcp-server';
72
110
  if (opts.mcp !== false && !isMcpFlow && !['init', 'auth', 'login', 'health', 'status'].includes(actionCommand.name())) {
73
111
  try {
74
- const client = getMCPClient();
112
+ const client = (0, mcp_client_js_1.getMCPClient)();
75
113
  if (!client.isConnectedToServer()) {
76
114
  const useRemote = await cliConfig.isAuthenticated();
77
115
  await client.connect({ useRemote });
@@ -174,7 +212,7 @@ const healthCheck = async () => {
174
212
  console.log();
175
213
  process.stdout.write('MCP Server status: ');
176
214
  try {
177
- const client = getMCPClient();
215
+ const client = (0, mcp_client_js_1.getMCPClient)();
178
216
  const status = client.getConnectionStatus();
179
217
  const mcpPreference = await cliConfig.get('mcpPreference') || 'auto';
180
218
  if (client.isConnectedToServer()) {
@@ -220,8 +258,8 @@ const requireAuth = (command) => {
220
258
  await cliConfig.init();
221
259
  const isAuthenticated = await cliConfig.isAuthenticated();
222
260
  if (!isAuthenticated) {
223
- console.error(chalk.red('✖ Authentication required'));
224
- console.log(chalk.yellow('Please run:'), chalk.white('lanonasis auth login'));
261
+ console.error(chalk_1.default.red('✖ Authentication required'));
262
+ console.log(chalk_1.default.yellow('Please run:'), chalk_1.default.white('lanonasis auth login'));
225
263
  process.exit(1);
226
264
  }
227
265
  });
@@ -231,7 +269,7 @@ program
231
269
  .command('init')
232
270
  .description('Initialize CLI configuration')
233
271
  .option('-f, --force', 'overwrite existing configuration')
234
- .action(initCommand);
272
+ .action(init_js_1.initCommand);
235
273
  // Authentication commands (no auth required)
236
274
  const authCmd = program
237
275
  .command('auth')
@@ -249,14 +287,14 @@ authCmd
249
287
  if (options.oauth) {
250
288
  options.useWebAuth = true;
251
289
  }
252
- await loginCommand(options);
290
+ await (0, auth_js_1.loginCommand)(options);
253
291
  });
254
292
  authCmd
255
293
  .command('logout')
256
294
  .description('Logout from your account')
257
295
  .action(async () => {
258
296
  await cliConfig.logout();
259
- console.log(chalk.green('✓ Logged out successfully'));
297
+ console.log(chalk_1.default.green('✓ Logged out successfully'));
260
298
  });
261
299
  authCmd
262
300
  .command('status')
@@ -270,10 +308,10 @@ authCmd
270
308
  const lastFailure = cliConfig.getLastAuthFailure();
271
309
  const authMethod = cliConfig.get('authMethod');
272
310
  const lastValidated = cliConfig.get('lastValidated');
273
- console.log(chalk.blue.bold('🔐 Authentication Status'));
311
+ console.log(chalk_1.default.blue.bold('🔐 Authentication Status'));
274
312
  console.log('━'.repeat(40));
275
313
  if (isAuth && user) {
276
- console.log(chalk.green('✓ Authenticated'));
314
+ console.log(chalk_1.default.green('✓ Authenticated'));
277
315
  console.log(`Email: ${user.email}`);
278
316
  console.log(`Organization: ${user.organization_id}`);
279
317
  console.log(`Plan: ${user.plan}`);
@@ -286,13 +324,13 @@ authCmd
286
324
  }
287
325
  }
288
326
  else {
289
- console.log(chalk.red('✖ Not authenticated'));
290
- console.log(chalk.yellow('Run:'), chalk.white('memory login'));
327
+ console.log(chalk_1.default.red('✖ Not authenticated'));
328
+ console.log(chalk_1.default.yellow('Run:'), chalk_1.default.white('memory login'));
291
329
  }
292
330
  // Show failure tracking information
293
331
  if (failureCount > 0) {
294
332
  console.log();
295
- console.log(chalk.yellow('⚠️ Authentication Issues:'));
333
+ console.log(chalk_1.default.yellow('⚠️ Authentication Issues:'));
296
334
  console.log(`Failed attempts: ${failureCount}`);
297
335
  if (lastFailure) {
298
336
  const failureDate = new Date(lastFailure);
@@ -300,22 +338,22 @@ authCmd
300
338
  }
301
339
  if (cliConfig.shouldDelayAuth()) {
302
340
  const delayMs = cliConfig.getAuthDelayMs();
303
- console.log(chalk.yellow(`Next retry delay: ${Math.round(delayMs / 1000)} seconds`));
341
+ console.log(chalk_1.default.yellow(`Next retry delay: ${Math.round(delayMs / 1000)} seconds`));
304
342
  }
305
343
  console.log();
306
- console.log(chalk.cyan('💡 To reset failure count:'));
307
- console.log(chalk.white(' lanonasis auth logout && lanonasis auth login'));
344
+ console.log(chalk_1.default.cyan('💡 To reset failure count:'));
345
+ console.log(chalk_1.default.white(' lanonasis auth logout && lanonasis auth login'));
308
346
  }
309
347
  });
310
348
  // MCP Commands (primary interface)
311
- mcpCommands(program);
349
+ (0, mcp_js_1.mcpCommands)(program);
312
350
  // Memory commands (require auth) - now MCP-powered by default
313
351
  const memoryCmd = program
314
352
  .command('memory')
315
353
  .alias('mem')
316
354
  .description('Memory management commands');
317
355
  requireAuth(memoryCmd);
318
- memoryCommands(memoryCmd);
356
+ (0, memory_js_1.memoryCommands)(memoryCmd);
319
357
  // Note: Memory commands are now MCP-powered when available
320
358
  // Topic commands (require auth)
321
359
  const topicCmd = program
@@ -323,23 +361,23 @@ const topicCmd = program
323
361
  .alias('topics')
324
362
  .description('Topic management commands');
325
363
  requireAuth(topicCmd);
326
- topicCommands(topicCmd);
364
+ (0, topics_js_1.topicCommands)(topicCmd);
327
365
  // Configuration commands (require auth)
328
366
  const configCmd = program
329
367
  .command('config')
330
368
  .description('Configuration management');
331
369
  requireAuth(configCmd);
332
- configCommands(configCmd);
370
+ (0, config_js_1.configCommands)(configCmd);
333
371
  // Organization commands (require auth)
334
372
  const orgCmd = program
335
373
  .command('org')
336
374
  .alias('organization')
337
375
  .description('Organization management');
338
376
  requireAuth(orgCmd);
339
- orgCommands(orgCmd);
377
+ (0, organization_js_1.orgCommands)(orgCmd);
340
378
  // API Key management commands (require auth)
341
- requireAuth(apiKeysCommand);
342
- program.addCommand(apiKeysCommand);
379
+ requireAuth(api_keys_js_1.default);
380
+ program.addCommand(api_keys_js_1.default);
343
381
  // Dashboard management commands (require auth)
344
382
  const dashboardCmd = program
345
383
  .command('dashboard')
@@ -542,9 +580,9 @@ program
542
580
  await cliConfig.init();
543
581
  const isAuth = await cliConfig.isAuthenticated();
544
582
  const apiUrl = cliConfig.getApiUrl();
545
- console.log(chalk.blue.bold('MaaS CLI Status'));
583
+ console.log(chalk_1.default.blue.bold('MaaS CLI Status'));
546
584
  console.log(`API URL: ${apiUrl}`);
547
- console.log(`Authenticated: ${isAuth ? chalk.green('Yes') : chalk.red('No')}`);
585
+ console.log(`Authenticated: ${isAuth ? chalk_1.default.green('Yes') : chalk_1.default.red('No')}`);
548
586
  if (isAuth) {
549
587
  const user = await cliConfig.getCurrentUser();
550
588
  if (user) {
@@ -576,15 +614,15 @@ program
576
614
  .description('Open documentation in browser')
577
615
  .action(() => {
578
616
  const url = 'https://api.lanonasis.com/docs';
579
- console.log(chalk.blue(`Opening documentation: ${url}`));
617
+ console.log(chalk_1.default.blue(`Opening documentation: ${url}`));
580
618
  // Try to open in browser
581
619
  import('open').then(open => {
582
620
  open.default(url).catch(() => {
583
- console.log(chalk.yellow('Could not open browser automatically.'));
584
- console.log(chalk.white(`Please visit: ${url}`));
621
+ console.log(chalk_1.default.yellow('Could not open browser automatically.'));
622
+ console.log(chalk_1.default.white(`Please visit: ${url}`));
585
623
  });
586
624
  }).catch(() => {
587
- console.log(chalk.white(`Please visit: ${url}`));
625
+ console.log(chalk_1.default.white(`Please visit: ${url}`));
588
626
  });
589
627
  });
590
628
  // Completion commands
@@ -594,7 +632,7 @@ program
594
632
  .argument('[shell]', 'shell type (bash, zsh, fish)')
595
633
  .action(async (shell) => {
596
634
  if (!shell) {
597
- await installCompletionsCommand();
635
+ await (0, completion_js_1.installCompletionsCommand)();
598
636
  return;
599
637
  }
600
638
  const completionsDir = path.join(__dirname, 'completions');
@@ -628,44 +666,44 @@ program
628
666
  .command('guide')
629
667
  .alias('setup')
630
668
  .description('Interactive setup guide for new users')
631
- .action(guideCommand);
669
+ .action(guide_js_1.guideCommand);
632
670
  program
633
671
  .command('quickstart')
634
672
  .alias('quick')
635
673
  .description('Show essential commands for quick start')
636
- .action(quickStartCommand);
674
+ .action(guide_js_1.quickStartCommand);
637
675
  // Help customization
638
676
  program.configureHelp({
639
677
  formatHelp: (cmd, helper) => {
640
- let help = chalk.blue.bold('🧠 Memory as a Service CLI\n\n');
678
+ let help = chalk_1.default.blue.bold('🧠 Memory as a Service CLI\n\n');
641
679
  help += helper.commandUsage(cmd) + '\n\n';
642
680
  if (cmd.description()) {
643
- help += chalk.yellow('Description:\n');
681
+ help += chalk_1.default.yellow('Description:\n');
644
682
  help += ` ${cmd.description()}\n\n`;
645
683
  }
646
684
  const commands = helper.visibleCommands(cmd);
647
685
  if (commands.length > 0) {
648
- help += chalk.yellow('Commands:\n');
686
+ help += chalk_1.default.yellow('Commands:\n');
649
687
  const maxNameLength = Math.max(...commands.map(c => c.name().length));
650
688
  commands.forEach(c => {
651
689
  const name = c.name().padEnd(maxNameLength);
652
- help += ` ${chalk.white(name)} ${c.description()}\n`;
690
+ help += ` ${chalk_1.default.white(name)} ${c.description()}\n`;
653
691
  });
654
692
  help += '\n';
655
693
  }
656
694
  const options = helper.visibleOptions(cmd);
657
695
  if (options.length > 0) {
658
- help += chalk.yellow('Options:\n');
696
+ help += chalk_1.default.yellow('Options:\n');
659
697
  options.forEach(option => {
660
698
  help += ` ${option.flags.padEnd(20)} ${option.description}\n`;
661
699
  });
662
700
  help += '\n';
663
701
  }
664
702
  const cmdName = isOnasisInvocation ? 'onasis' : program.name();
665
- help += chalk.gray(`For more help on a specific command, run: ${cmdName} <command> --help\n`);
666
- help += chalk.gray('Documentation: https://api.lanonasis.com/docs\n');
703
+ help += chalk_1.default.gray(`For more help on a specific command, run: ${cmdName} <command> --help\n`);
704
+ help += chalk_1.default.gray('Documentation: https://api.lanonasis.com/docs\n');
667
705
  if (isOnasisInvocation) {
668
- help += chalk.gray('Golden Contract: Onasis-Core v0.1 Compliant\n');
706
+ help += chalk_1.default.gray('Golden Contract: Onasis-Core v0.1 Compliant\n');
669
707
  }
670
708
  return help;
671
709
  }
@@ -674,7 +712,7 @@ program.configureHelp({
674
712
  async function main() {
675
713
  // Check for special flags first
676
714
  if (process.argv.includes('--completion-data')) {
677
- await completionCommand();
715
+ await (0, completion_js_1.completionCommand)();
678
716
  return;
679
717
  }
680
718
  if (process.argv.includes('--completion')) {
@@ -719,7 +757,7 @@ async function main() {
719
757
  }
720
758
  catch (error) {
721
759
  if (error instanceof Error) {
722
- console.error(chalk.red('✖ Error:'), error.message);
760
+ console.error(chalk_1.default.red('✖ Error:'), error.message);
723
761
  if (process.env.CLI_VERBOSE === 'true') {
724
762
  console.error(error.stack);
725
763
  }
package/dist/index.js CHANGED
@@ -1,36 +1,41 @@
1
1
  #!/usr/bin/env node
2
- import { Command } from 'commander';
3
- import chalk from 'chalk';
4
- import { config } from 'dotenv';
5
- import { initCommand } from './commands/init.js';
6
- import { loginCommand, diagnoseCommand } from './commands/auth.js';
7
- import { memoryCommands } from './commands/memory.js';
8
- import { topicCommands } from './commands/topics.js';
9
- import { configCommands } from './commands/config.js';
10
- import { orgCommands } from './commands/organization.js';
11
- import { mcpCommands } from './commands/mcp.js';
12
- import apiKeysCommand from './commands/api-keys.js';
13
- import { CLIConfig } from './utils/config.js';
14
- import { getMCPClient } from './utils/mcp-client.js';
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const commander_1 = require("commander");
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ const dotenv_1 = require("dotenv");
10
+ const init_js_1 = require("./commands/init.js");
11
+ const auth_js_1 = require("./commands/auth.js");
12
+ const memory_js_1 = require("./commands/memory.js");
13
+ const topics_js_1 = require("./commands/topics.js");
14
+ const config_js_1 = require("./commands/config.js");
15
+ const organization_js_1 = require("./commands/organization.js");
16
+ const mcp_js_1 = require("./commands/mcp.js");
17
+ const api_keys_js_1 = __importDefault(require("./commands/api-keys.js"));
18
+ const config_js_2 = require("./utils/config.js");
19
+ const mcp_client_js_1 = require("./utils/mcp-client.js");
15
20
  // Load environment variables
16
- config();
17
- import { createRequire } from 'module';
18
- const require = createRequire(import.meta.url);
21
+ (0, dotenv_1.config)();
22
+ const module_1 = require("module");
23
+ const require = (0, module_1.createRequire)(import.meta.url);
19
24
  const packageJson = require('../package.json');
20
25
  // Enhanced color scheme (VPS-style)
21
26
  const colors = {
22
- primary: chalk.blue.bold,
23
- success: chalk.green,
24
- warning: chalk.yellow,
25
- error: chalk.red,
26
- info: chalk.cyan,
27
- accent: chalk.magenta,
28
- muted: chalk.gray,
29
- highlight: chalk.white.bold
27
+ primary: chalk_1.default.blue.bold,
28
+ success: chalk_1.default.green,
29
+ warning: chalk_1.default.yellow,
30
+ error: chalk_1.default.red,
31
+ info: chalk_1.default.cyan,
32
+ accent: chalk_1.default.magenta,
33
+ muted: chalk_1.default.gray,
34
+ highlight: chalk_1.default.white.bold
30
35
  };
31
- const program = new Command();
36
+ const program = new commander_1.Command();
32
37
  // CLI Configuration
33
- const cliConfig = new CLIConfig();
38
+ const cliConfig = new config_js_2.CLIConfig();
34
39
  program
35
40
  .name('lanonasis')
36
41
  .alias('memory')
@@ -58,7 +63,7 @@ program
58
63
  actionCommand.parent?.name?.() === 'mcp-server';
59
64
  if (opts.mcp !== false && !isMcpFlow && !['init', 'auth', 'login', 'health', 'status'].includes(actionCommand.name())) {
60
65
  try {
61
- const client = getMCPClient();
66
+ const client = (0, mcp_client_js_1.getMCPClient)();
62
67
  if (!client.isConnectedToServer()) {
63
68
  const useRemote = await cliConfig.isAuthenticated();
64
69
  await client.connect({ useRemote });
@@ -146,7 +151,7 @@ const healthCheck = async () => {
146
151
  console.log();
147
152
  process.stdout.write('MCP Server status: ');
148
153
  try {
149
- const client = getMCPClient();
154
+ const client = (0, mcp_client_js_1.getMCPClient)();
150
155
  if (client.isConnectedToServer()) {
151
156
  console.log(colors.success('✅ Connected'));
152
157
  }
@@ -179,8 +184,8 @@ const requireAuth = (command) => {
179
184
  await cliConfig.init();
180
185
  const isAuthenticated = await cliConfig.isAuthenticated();
181
186
  if (!isAuthenticated) {
182
- console.error(chalk.red('✖ Authentication required'));
183
- console.log(chalk.yellow('Please run:'), chalk.white('lanonasis auth login'));
187
+ console.error(chalk_1.default.red('✖ Authentication required'));
188
+ console.log(chalk_1.default.yellow('Please run:'), chalk_1.default.white('lanonasis auth login'));
184
189
  process.exit(1);
185
190
  }
186
191
  });
@@ -190,7 +195,7 @@ program
190
195
  .command('init')
191
196
  .description('Initialize CLI configuration')
192
197
  .option('-f, --force', 'overwrite existing configuration')
193
- .action(initCommand);
198
+ .action(init_js_1.initCommand);
194
199
  // Authentication commands (no auth required)
195
200
  const authCmd = program
196
201
  .command('auth')
@@ -201,13 +206,13 @@ authCmd
201
206
  .description('Login to your MaaS account')
202
207
  .option('-e, --email <email>', 'email address')
203
208
  .option('-p, --password <password>', 'password')
204
- .action(loginCommand);
209
+ .action(auth_js_1.loginCommand);
205
210
  authCmd
206
211
  .command('logout')
207
212
  .description('Logout from your account')
208
213
  .action(async () => {
209
214
  await cliConfig.logout();
210
- console.log(chalk.green('✓ Logged out successfully'));
215
+ console.log(chalk_1.default.green('✓ Logged out successfully'));
211
216
  process.exit(0);
212
217
  });
213
218
  authCmd
@@ -220,10 +225,10 @@ authCmd
220
225
  const lastFailure = cliConfig.getLastAuthFailure();
221
226
  const authMethod = cliConfig.get('authMethod');
222
227
  const lastValidated = cliConfig.get('lastValidated');
223
- console.log(chalk.blue.bold('🔐 Authentication Status'));
228
+ console.log(chalk_1.default.blue.bold('🔐 Authentication Status'));
224
229
  console.log('━'.repeat(40));
225
230
  if (isAuth && user) {
226
- console.log(chalk.green('✓ Authenticated'));
231
+ console.log(chalk_1.default.green('✓ Authenticated'));
227
232
  console.log(`Email: ${user.email}`);
228
233
  console.log(`Organization: ${user.organization_id}`);
229
234
  console.log(`Plan: ${user.plan}`);
@@ -236,13 +241,13 @@ authCmd
236
241
  }
237
242
  }
238
243
  else {
239
- console.log(chalk.red('✖ Not authenticated'));
240
- console.log(chalk.yellow('Run:'), chalk.white('memory login'));
244
+ console.log(chalk_1.default.red('✖ Not authenticated'));
245
+ console.log(chalk_1.default.yellow('Run:'), chalk_1.default.white('memory login'));
241
246
  }
242
247
  // Show failure tracking information
243
248
  if (failureCount > 0) {
244
249
  console.log();
245
- console.log(chalk.yellow('⚠️ Authentication Issues:'));
250
+ console.log(chalk_1.default.yellow('⚠️ Authentication Issues:'));
246
251
  console.log(`Failed attempts: ${failureCount}`);
247
252
  if (lastFailure) {
248
253
  const failureDate = new Date(lastFailure);
@@ -250,26 +255,26 @@ authCmd
250
255
  }
251
256
  if (cliConfig.shouldDelayAuth()) {
252
257
  const delayMs = cliConfig.getAuthDelayMs();
253
- console.log(chalk.yellow(`Next retry delay: ${Math.round(delayMs / 1000)} seconds`));
258
+ console.log(chalk_1.default.yellow(`Next retry delay: ${Math.round(delayMs / 1000)} seconds`));
254
259
  }
255
260
  console.log();
256
- console.log(chalk.cyan('💡 To reset failure count:'));
257
- console.log(chalk.white(' lanonasis auth logout && lanonasis auth login'));
261
+ console.log(chalk_1.default.cyan('💡 To reset failure count:'));
262
+ console.log(chalk_1.default.white(' lanonasis auth logout && lanonasis auth login'));
258
263
  }
259
264
  });
260
265
  authCmd
261
266
  .command('diagnose')
262
267
  .description('Diagnose authentication issues')
263
- .action(diagnoseCommand);
268
+ .action(auth_js_1.diagnoseCommand);
264
269
  // MCP Commands (primary interface)
265
- mcpCommands(program);
270
+ (0, mcp_js_1.mcpCommands)(program);
266
271
  // Memory commands (require auth) - now MCP-powered by default
267
272
  const memoryCmd = program
268
273
  .command('memory')
269
274
  .alias('mem')
270
275
  .description('Memory management commands');
271
276
  requireAuth(memoryCmd);
272
- memoryCommands(memoryCmd);
277
+ (0, memory_js_1.memoryCommands)(memoryCmd);
273
278
  // Note: Memory commands are now MCP-powered when available
274
279
  // REPL command (lightweight REPL for memory operations)
275
280
  program
@@ -318,23 +323,23 @@ const topicCmd = program
318
323
  .alias('topics')
319
324
  .description('Topic management commands');
320
325
  requireAuth(topicCmd);
321
- topicCommands(topicCmd);
326
+ (0, topics_js_1.topicCommands)(topicCmd);
322
327
  // Configuration commands (require auth)
323
328
  const configCmd = program
324
329
  .command('config')
325
330
  .description('Configuration management');
326
331
  requireAuth(configCmd);
327
- configCommands(configCmd);
332
+ (0, config_js_1.configCommands)(configCmd);
328
333
  // Organization commands (require auth)
329
334
  const orgCmd = program
330
335
  .command('org')
331
336
  .alias('organization')
332
337
  .description('Organization management');
333
338
  requireAuth(orgCmd);
334
- orgCommands(orgCmd);
339
+ (0, organization_js_1.orgCommands)(orgCmd);
335
340
  // API Key management commands (require auth)
336
- requireAuth(apiKeysCommand);
337
- program.addCommand(apiKeysCommand);
341
+ requireAuth(api_keys_js_1.default);
342
+ program.addCommand(api_keys_js_1.default);
338
343
  // Dashboard management commands (require auth)
339
344
  const dashboardCmd = program
340
345
  .command('dashboard')
@@ -536,9 +541,9 @@ program
536
541
  await cliConfig.init();
537
542
  const isAuth = await cliConfig.isAuthenticated();
538
543
  const apiUrl = cliConfig.getApiUrl();
539
- console.log(chalk.blue.bold('MaaS CLI Status'));
544
+ console.log(chalk_1.default.blue.bold('MaaS CLI Status'));
540
545
  console.log(`API URL: ${apiUrl}`);
541
- console.log(`Authenticated: ${isAuth ? chalk.green('Yes') : chalk.red('No')}`);
546
+ console.log(`Authenticated: ${isAuth ? chalk_1.default.green('Yes') : chalk_1.default.red('No')}`);
542
547
  if (isAuth) {
543
548
  const user = await cliConfig.getCurrentUser();
544
549
  if (user) {
@@ -570,46 +575,46 @@ program
570
575
  .description('Open documentation in browser')
571
576
  .action(() => {
572
577
  const url = 'https://api.lanonasis.com/docs';
573
- console.log(chalk.blue(`Opening documentation: ${url}`));
578
+ console.log(chalk_1.default.blue(`Opening documentation: ${url}`));
574
579
  // Try to open in browser
575
580
  import('open').then(open => {
576
581
  open.default(url).catch(() => {
577
- console.log(chalk.yellow('Could not open browser automatically.'));
578
- console.log(chalk.white(`Please visit: ${url}`));
582
+ console.log(chalk_1.default.yellow('Could not open browser automatically.'));
583
+ console.log(chalk_1.default.white(`Please visit: ${url}`));
579
584
  });
580
585
  }).catch(() => {
581
- console.log(chalk.white(`Please visit: ${url}`));
586
+ console.log(chalk_1.default.white(`Please visit: ${url}`));
582
587
  });
583
588
  });
584
589
  // Help customization
585
590
  program.configureHelp({
586
591
  formatHelp: (cmd, helper) => {
587
- let help = chalk.blue.bold('🧠 Memory as a Service CLI\n\n');
592
+ let help = chalk_1.default.blue.bold('🧠 Memory as a Service CLI\n\n');
588
593
  help += helper.commandUsage(cmd) + '\n\n';
589
594
  if (cmd.description()) {
590
- help += chalk.yellow('Description:\n');
595
+ help += chalk_1.default.yellow('Description:\n');
591
596
  help += ` ${cmd.description()}\n\n`;
592
597
  }
593
598
  const commands = helper.visibleCommands(cmd);
594
599
  if (commands.length > 0) {
595
- help += chalk.yellow('Commands:\n');
600
+ help += chalk_1.default.yellow('Commands:\n');
596
601
  const maxNameLength = Math.max(...commands.map(c => c.name().length));
597
602
  commands.forEach(c => {
598
603
  const name = c.name().padEnd(maxNameLength);
599
- help += ` ${chalk.white(name)} ${c.description()}\n`;
604
+ help += ` ${chalk_1.default.white(name)} ${c.description()}\n`;
600
605
  });
601
606
  help += '\n';
602
607
  }
603
608
  const options = helper.visibleOptions(cmd);
604
609
  if (options.length > 0) {
605
- help += chalk.yellow('Options:\n');
610
+ help += chalk_1.default.yellow('Options:\n');
606
611
  options.forEach(option => {
607
612
  help += ` ${option.flags.padEnd(20)} ${option.description}\n`;
608
613
  });
609
614
  help += '\n';
610
615
  }
611
- help += chalk.gray('For more help on a specific command, run: memory <command> --help\n');
612
- help += chalk.gray('Documentation: https://api.lanonasis.com/docs\n');
616
+ help += chalk_1.default.gray('For more help on a specific command, run: memory <command> --help\n');
617
+ help += chalk_1.default.gray('Documentation: https://api.lanonasis.com/docs\n');
613
618
  return help;
614
619
  }
615
620
  });
@@ -625,7 +630,7 @@ async function main() {
625
630
  }
626
631
  catch (error) {
627
632
  if (error instanceof Error) {
628
- console.error(chalk.red('✖ Error:'), error.message);
633
+ console.error(chalk_1.default.red('✖ Error:'), error.message);
629
634
  if (process.env.CLI_VERBOSE === 'true') {
630
635
  console.error(error.stack);
631
636
  }