@lanonasis/cli 3.6.1 → 3.6.3
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/dist/commands/auth.js
CHANGED
|
@@ -65,7 +65,7 @@ async function handleAuthenticationFailure(error, config, authMethod = 'jwt') {
|
|
|
65
65
|
case 'network_error':
|
|
66
66
|
console.log(chalk.red('Network connection failed'));
|
|
67
67
|
console.log(chalk.gray('• Check your internet connection'));
|
|
68
|
-
console.log(chalk.gray('• Verify you can access https://
|
|
68
|
+
console.log(chalk.gray('• Verify you can access https://auth.lanonasis.com'));
|
|
69
69
|
console.log(chalk.gray('• Try again in a few moments'));
|
|
70
70
|
if (failureCount >= 2) {
|
|
71
71
|
console.log(chalk.gray('• Consider using a different network if issues persist'));
|
|
@@ -101,7 +101,7 @@ async function handleAuthenticationFailure(error, config, authMethod = 'jwt') {
|
|
|
101
101
|
if (authMethod === 'vendor_key') {
|
|
102
102
|
console.log(chalk.cyan('• Generate a new vendor key from your dashboard'));
|
|
103
103
|
console.log(chalk.cyan('• Try: lanonasis auth logout && lanonasis auth login'));
|
|
104
|
-
console.log(chalk.cyan('• Switch to browser login: lanonasis auth login
|
|
104
|
+
console.log(chalk.cyan('• Switch to browser login: lanonasis auth login (choose Browser Login)'));
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
107
|
console.log(chalk.cyan('• Reset your password if you\'re unsure'));
|
|
@@ -485,7 +485,7 @@ export async function diagnoseCommand() {
|
|
|
485
485
|
console.log(chalk.gray('\n🔧 Additional troubleshooting:'));
|
|
486
486
|
console.log(chalk.gray(' • Verify the vendor key matches the value shown in your dashboard'));
|
|
487
487
|
console.log(chalk.gray(' • Check if your key is active in the dashboard'));
|
|
488
|
-
console.log(chalk.gray(' • Try browser authentication: lanonasis auth login
|
|
488
|
+
console.log(chalk.gray(' • Try browser authentication: lanonasis auth login (choose Browser Login)'));
|
|
489
489
|
console.log(chalk.gray(' • Contact support if issues persist'));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
@@ -574,7 +574,7 @@ async function handleVendorKeyFlow(config) {
|
|
|
574
574
|
console.log();
|
|
575
575
|
// Enhanced guidance for obtaining vendor keys
|
|
576
576
|
console.log(chalk.cyan('📋 How to get your vendor key:'));
|
|
577
|
-
console.log(chalk.gray('1. Visit your Lanonasis dashboard at https://
|
|
577
|
+
console.log(chalk.gray('1. Visit your Lanonasis dashboard at https://dashboard.lanonasis.com'));
|
|
578
578
|
console.log(chalk.gray('2. Navigate to Settings → API Keys'));
|
|
579
579
|
console.log(chalk.gray('3. Click "Generate New Key" and copy the full key value'));
|
|
580
580
|
console.log();
|
|
@@ -649,6 +649,7 @@ async function handleOAuthFlow(config) {
|
|
|
649
649
|
console.log();
|
|
650
650
|
console.log(chalk.green('✓ OAuth2 authentication successful'));
|
|
651
651
|
console.log(colors.info('You can now use Lanonasis services'));
|
|
652
|
+
process.exit(0);
|
|
652
653
|
}
|
|
653
654
|
catch (error) {
|
|
654
655
|
console.error(chalk.red('✖ OAuth2 authentication failed'));
|
package/dist/commands/mcp.js
CHANGED
|
@@ -45,14 +45,17 @@ export function mcpCommands(program) {
|
|
|
45
45
|
const connected = await client.connect({ useRemote: isAuthenticated });
|
|
46
46
|
if (connected) {
|
|
47
47
|
spinner.succeed(chalk.green(`Connected to ${isAuthenticated ? 'remote' : 'local'} MCP server`));
|
|
48
|
+
process.exit(0);
|
|
48
49
|
}
|
|
49
50
|
else {
|
|
50
51
|
spinner.fail('Failed to auto-connect to MCP');
|
|
52
|
+
process.exit(1);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
catch {
|
|
54
56
|
spinner.fail('MCP auto-connect failed');
|
|
55
57
|
}
|
|
58
|
+
process.exit(1);
|
|
56
59
|
});
|
|
57
60
|
// Connect command
|
|
58
61
|
mcp.command('connect')
|
|
@@ -109,6 +112,7 @@ export function mcpCommands(program) {
|
|
|
109
112
|
connected = await enhancedClient.connectSingle(serverConfig);
|
|
110
113
|
if (connected) {
|
|
111
114
|
spinner.succeed(chalk.green(`Connected to MCP server at ${options.url}`));
|
|
115
|
+
process.exit(0);
|
|
112
116
|
return;
|
|
113
117
|
}
|
|
114
118
|
}
|
|
@@ -127,6 +131,7 @@ export function mcpCommands(program) {
|
|
|
127
131
|
}
|
|
128
132
|
if (connected) {
|
|
129
133
|
spinner.succeed(chalk.green(`Connected to MCP server in ${connectionMode} mode`));
|
|
134
|
+
process.exit(0);
|
|
130
135
|
if (connectionMode === 'remote') {
|
|
131
136
|
console.log(chalk.cyan('ℹ️ Using remote MCP via mcp.lanonasis.com'));
|
|
132
137
|
console.log(chalk.cyan('📡 SSE endpoint active for real-time updates'));
|
|
@@ -141,6 +146,7 @@ export function mcpCommands(program) {
|
|
|
141
146
|
}
|
|
142
147
|
}
|
|
143
148
|
catch (error) {
|
|
149
|
+
process.exit(1);
|
|
144
150
|
spinner.fail(`Connection failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
145
151
|
process.exit(1);
|
|
146
152
|
}
|
|
@@ -341,15 +347,15 @@ export function mcpCommands(program) {
|
|
|
341
347
|
.action(async (options) => {
|
|
342
348
|
const config = new CLIConfig();
|
|
343
349
|
if (options.preferRemote) {
|
|
344
|
-
config.
|
|
350
|
+
await config.setAndSave('mcpPreference', 'remote');
|
|
345
351
|
console.log(chalk.green('✓ Set MCP preference to remote'));
|
|
346
352
|
}
|
|
347
353
|
else if (options.preferLocal) {
|
|
348
|
-
config.
|
|
354
|
+
await config.setAndSave('mcpPreference', 'local');
|
|
349
355
|
console.log(chalk.green('✓ Set MCP preference to local'));
|
|
350
356
|
}
|
|
351
357
|
else if (options.auto) {
|
|
352
|
-
config.
|
|
358
|
+
await config.setAndSave('mcpPreference', 'auto');
|
|
353
359
|
console.log(chalk.green('✓ Set MCP preference to auto-detect'));
|
|
354
360
|
}
|
|
355
361
|
else {
|
package/dist/index.js
CHANGED
|
@@ -111,16 +111,16 @@ export declare const TopicCreateSchema: z.ZodObject<{
|
|
|
111
111
|
color: z.ZodOptional<z.ZodString>;
|
|
112
112
|
icon: z.ZodOptional<z.ZodString>;
|
|
113
113
|
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
description?: string;
|
|
114
115
|
icon?: string;
|
|
115
116
|
name?: string;
|
|
116
117
|
color?: string;
|
|
117
|
-
description?: string;
|
|
118
118
|
parent_id?: string;
|
|
119
119
|
}, {
|
|
120
|
+
description?: string;
|
|
120
121
|
icon?: string;
|
|
121
122
|
name?: string;
|
|
122
123
|
color?: string;
|
|
123
|
-
description?: string;
|
|
124
124
|
parent_id?: string;
|
|
125
125
|
}>;
|
|
126
126
|
export declare const TopicUpdateSchema: z.ZodObject<{
|
|
@@ -131,18 +131,18 @@ export declare const TopicUpdateSchema: z.ZodObject<{
|
|
|
131
131
|
color: z.ZodOptional<z.ZodString>;
|
|
132
132
|
icon: z.ZodOptional<z.ZodString>;
|
|
133
133
|
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
description?: string;
|
|
134
135
|
icon?: string;
|
|
135
136
|
name?: string;
|
|
136
137
|
color?: string;
|
|
137
138
|
topic_id?: string;
|
|
138
|
-
description?: string;
|
|
139
139
|
parent_id?: string;
|
|
140
140
|
}, {
|
|
141
|
+
description?: string;
|
|
141
142
|
icon?: string;
|
|
142
143
|
name?: string;
|
|
143
144
|
color?: string;
|
|
144
145
|
topic_id?: string;
|
|
145
|
-
description?: string;
|
|
146
146
|
parent_id?: string;
|
|
147
147
|
}>;
|
|
148
148
|
export declare const TopicListSchema: z.ZodObject<{
|
|
@@ -485,16 +485,16 @@ export declare const MCPSchemas: {
|
|
|
485
485
|
color: z.ZodOptional<z.ZodString>;
|
|
486
486
|
icon: z.ZodOptional<z.ZodString>;
|
|
487
487
|
}, "strip", z.ZodTypeAny, {
|
|
488
|
+
description?: string;
|
|
488
489
|
icon?: string;
|
|
489
490
|
name?: string;
|
|
490
491
|
color?: string;
|
|
491
|
-
description?: string;
|
|
492
492
|
parent_id?: string;
|
|
493
493
|
}, {
|
|
494
|
+
description?: string;
|
|
494
495
|
icon?: string;
|
|
495
496
|
name?: string;
|
|
496
497
|
color?: string;
|
|
497
|
-
description?: string;
|
|
498
498
|
parent_id?: string;
|
|
499
499
|
}>;
|
|
500
500
|
update: z.ZodObject<{
|
|
@@ -505,18 +505,18 @@ export declare const MCPSchemas: {
|
|
|
505
505
|
color: z.ZodOptional<z.ZodString>;
|
|
506
506
|
icon: z.ZodOptional<z.ZodString>;
|
|
507
507
|
}, "strip", z.ZodTypeAny, {
|
|
508
|
+
description?: string;
|
|
508
509
|
icon?: string;
|
|
509
510
|
name?: string;
|
|
510
511
|
color?: string;
|
|
511
512
|
topic_id?: string;
|
|
512
|
-
description?: string;
|
|
513
513
|
parent_id?: string;
|
|
514
514
|
}, {
|
|
515
|
+
description?: string;
|
|
515
516
|
icon?: string;
|
|
516
517
|
name?: string;
|
|
517
518
|
color?: string;
|
|
518
519
|
topic_id?: string;
|
|
519
|
-
description?: string;
|
|
520
520
|
parent_id?: string;
|
|
521
521
|
}>;
|
|
522
522
|
list: z.ZodObject<{
|
package/dist/utils/config.js
CHANGED
|
@@ -292,7 +292,7 @@ export class CLIConfig {
|
|
|
292
292
|
const hasEnvOverrides = Boolean(envAuthBase || envMemoryBase || envMcpBase || envMcpWsBase || envMcpSseBase);
|
|
293
293
|
const nodeEnv = (process.env.NODE_ENV ?? '').toLowerCase();
|
|
294
294
|
const isDevEnvironment = nodeEnv === 'development' || nodeEnv === 'test';
|
|
295
|
-
const defaultAuthBase = isDevEnvironment ? 'http://localhost:4000' : 'https://
|
|
295
|
+
const defaultAuthBase = isDevEnvironment ? 'http://localhost:4000' : 'https://auth.lanonasis.com';
|
|
296
296
|
const defaultMemoryBase = isDevEnvironment ? 'http://localhost:4000/api/v1' : 'https://api.lanonasis.com/api/v1';
|
|
297
297
|
const defaultMcpBase = isDevEnvironment ? 'http://localhost:4100/api/v1' : 'https://mcp.lanonasis.com/api/v1';
|
|
298
298
|
const defaultMcpWsBase = isDevEnvironment ? 'ws://localhost:4100/ws' : 'wss://mcp.lanonasis.com/ws';
|
|
@@ -397,16 +397,16 @@ export class CLIConfig {
|
|
|
397
397
|
if (error.response?.status === 401) {
|
|
398
398
|
const errorData = error.response.data;
|
|
399
399
|
if (errorData?.error?.includes('expired') || errorData?.message?.includes('expired')) {
|
|
400
|
-
throw new Error('Vendor key has expired. Please generate a new key from your dashboard.');
|
|
400
|
+
throw new Error('Vendor key validation failed: Key has expired. Please generate a new key from your dashboard.');
|
|
401
401
|
}
|
|
402
402
|
else if (errorData?.error?.includes('revoked') || errorData?.message?.includes('revoked')) {
|
|
403
|
-
throw new Error('Vendor key has been revoked. Please generate a new key from your dashboard.');
|
|
403
|
+
throw new Error('Vendor key validation failed: Key has been revoked. Please generate a new key from your dashboard.');
|
|
404
404
|
}
|
|
405
405
|
else if (errorData?.error?.includes('invalid') || errorData?.message?.includes('invalid')) {
|
|
406
|
-
throw new Error('Vendor key is invalid. Please check the key format and ensure it was copied correctly.');
|
|
406
|
+
throw new Error('Vendor key validation failed: Key is invalid. Please check the key format and ensure it was copied correctly.');
|
|
407
407
|
}
|
|
408
408
|
else {
|
|
409
|
-
throw new Error('Vendor key
|
|
409
|
+
throw new Error('Vendor key validation failed: Authentication failed. The key may be invalid, expired, or revoked.');
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
else if (error.response?.status === 403) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lanonasis/cli",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.3",
|
|
4
4
|
"description": "LanOnasis Enterprise CLI - Memory as a Service, API Key Management, and Infrastructure Orchestration",
|
|
5
5
|
"main": "dist/index-simple.js",
|
|
6
6
|
"bin": {
|
|
@@ -21,9 +21,11 @@
|
|
|
21
21
|
"build:mcp-client": "tsc src/mcp/client/enhanced-client.ts --outDir dist/mcp/client",
|
|
22
22
|
"start": "node dist/index.js",
|
|
23
23
|
"start:mcp-server": "node dist/mcp/server/lanonasis-server.js",
|
|
24
|
-
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
24
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\"integration|reliability|persistence\"",
|
|
25
|
+
"test:all": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
25
26
|
"test:mcp": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=mcp",
|
|
26
|
-
"test:integration": "
|
|
27
|
+
"test:integration": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\"integration|reliability|persistence\"",
|
|
28
|
+
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage --testPathIgnorePatterns=\"integration|reliability|persistence\"",
|
|
27
29
|
"lint": "eslint .",
|
|
28
30
|
"type-check": "tsc --noEmit",
|
|
29
31
|
"prepare": "npm run build",
|