@lanonasis/cli 3.9.2 → 3.9.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/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog - @lanonasis/cli
2
2
 
3
+ ## [3.9.3] - 2026-02-02
4
+
5
+ ### ✨ Features
6
+
7
+ - **Non-Interactive Vendor Key Auth**: Added `-k, --vendor-key <key>` option to `auth login` command
8
+ - Enables non-interactive authentication in CI/CD pipelines and automation scripts
9
+ - Example: `onasis auth login --vendor-key <your-key>`
10
+
11
+ ### 🐛 Bug Fixes
12
+
13
+ - **JWT Authentication Routing**: Fixed API routing for JWT/OAuth authenticated sessions
14
+ - JWT tokens from username/password or OAuth login now correctly route to MCP server
15
+ - Memory operations (list, create, search, update, delete) work with JWT authentication
16
+ - Path translation handles endpoint differences between API and MCP servers
17
+ - Vendor key authentication continues to route to main API server
18
+
19
+ - **Missing CLI Option**: The `--vendor-key` option was defined in code but not exposed in CLI
20
+ - Now properly registered in command-line interface
21
+
22
+ ### ⚠️ Known Limitations
23
+
24
+ - `memory stats` command not available with JWT authentication (MCP server limitation)
25
+ - For full API access including stats, use vendor key authentication
26
+
3
27
  ## [3.9.2] - 2026-02-02
4
28
 
5
29
  ### 🐛 Bug Fixes
package/dist/index.js CHANGED
@@ -221,6 +221,7 @@ authCmd
221
221
  .description('Login to your MaaS account')
222
222
  .option('-e, --email <email>', 'email address')
223
223
  .option('-p, --password <password>', 'password')
224
+ .option('-k, --vendor-key <key>', 'vendor key for API access')
224
225
  .action(loginCommand);
225
226
  authCmd
226
227
  .command('logout')
package/dist/utils/api.js CHANGED
@@ -15,19 +15,43 @@ export class APIClient {
15
15
  await this.config.init();
16
16
  // Service Discovery
17
17
  await this.config.discoverServices();
18
- // Use appropriate base URL based on endpoint
18
+ // Use appropriate base URL based on endpoint and auth method
19
19
  const isAuthEndpoint = config.url?.includes('/auth/') || config.url?.includes('/login') || config.url?.includes('/register') || config.url?.includes('/oauth/');
20
20
  const discoveredServices = this.config.get('discoveredServices');
21
- config.baseURL = isAuthEndpoint ?
22
- (discoveredServices?.auth_base || 'https://auth.lanonasis.com') :
23
- this.config.getApiUrl();
21
+ const authMethod = this.config.get('authMethod');
22
+ const vendorKey = await this.config.getVendorKeyAsync();
23
+ // Determine the correct API base URL:
24
+ // - Auth endpoints -> auth.lanonasis.com
25
+ // - JWT auth (no vendor key) -> mcp.lanonasis.com (supports JWT tokens)
26
+ // - Vendor key auth -> api.lanonasis.com (requires vendor key)
27
+ let apiBaseUrl;
28
+ const useMcpServer = !vendorKey && (authMethod === 'jwt' || authMethod === 'oauth' || authMethod === 'oauth2');
29
+ if (isAuthEndpoint) {
30
+ apiBaseUrl = discoveredServices?.auth_base || 'https://auth.lanonasis.com';
31
+ }
32
+ else if (vendorKey) {
33
+ // Vendor key works with api.lanonasis.com
34
+ apiBaseUrl = this.config.getApiUrl();
35
+ }
36
+ else if (useMcpServer) {
37
+ // JWT/OAuth tokens work with mcp.lanonasis.com
38
+ apiBaseUrl = 'https://mcp.lanonasis.com/api/v1';
39
+ }
40
+ else {
41
+ apiBaseUrl = this.config.getApiUrl();
42
+ }
43
+ config.baseURL = apiBaseUrl;
44
+ // Path translation for MCP server:
45
+ // MCP uses /memory (singular) while main API uses /memories (plural)
46
+ if (useMcpServer && config.url) {
47
+ config.url = config.url.replace(/\/api\/v1\/memories/g, '/memory');
48
+ }
24
49
  // Add project scope header for auth endpoints
25
50
  if (isAuthEndpoint) {
26
51
  config.headers['X-Project-Scope'] = 'lanonasis-maas';
27
52
  }
28
53
  // Enhanced Authentication Support
29
54
  const token = this.config.getToken();
30
- const vendorKey = await this.config.getVendorKeyAsync();
31
55
  if (vendorKey) {
32
56
  // Vendor key authentication (validated server-side)
33
57
  // Send raw key - server handles hashing for comparison
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanonasis/cli",
3
- "version": "3.9.2",
3
+ "version": "3.9.3",
4
4
  "description": "Professional CLI for LanOnasis Memory as a Service (MaaS) with MCP support, seamless inline editing, and enterprise-grade security",
5
5
  "keywords": [
6
6
  "lanonasis",