@lanonasis/cli 3.0.13 → 3.2.14

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.
@@ -4,18 +4,64 @@ interface UserProfile {
4
4
  role: string;
5
5
  plan: string;
6
6
  }
7
+ interface CLIConfigData {
8
+ version?: string;
9
+ apiUrl?: string;
10
+ token?: string | undefined;
11
+ user?: UserProfile | undefined;
12
+ lastUpdated?: string;
13
+ mcpServerPath?: string;
14
+ mcpServerUrl?: string;
15
+ mcpUseRemote?: boolean;
16
+ mcpPreference?: 'local' | 'remote' | 'auto';
17
+ discoveredServices?: {
18
+ auth_base: string;
19
+ memory_base: string;
20
+ mcp_base?: string;
21
+ mcp_ws_base: string;
22
+ mcp_sse_base?: string;
23
+ project_scope: string;
24
+ };
25
+ lastServiceDiscovery?: string;
26
+ manualEndpointOverrides?: boolean;
27
+ lastManualEndpointUpdate?: string;
28
+ vendorKey?: string | undefined;
29
+ authMethod?: 'jwt' | 'vendor_key' | 'oauth' | undefined;
30
+ tokenExpiry?: number | undefined;
31
+ lastValidated?: string | undefined;
32
+ deviceId?: string;
33
+ authFailureCount?: number;
34
+ lastAuthFailure?: string | undefined;
35
+ [key: string]: unknown;
36
+ }
7
37
  export declare class CLIConfig {
8
38
  private configDir;
9
39
  private configPath;
10
40
  private config;
41
+ private lockFile;
42
+ private static readonly CONFIG_VERSION;
43
+ private authCheckCache;
44
+ private readonly AUTH_CACHE_TTL;
11
45
  constructor();
12
46
  init(): Promise<void>;
13
47
  load(): Promise<void>;
48
+ private migrateConfigIfNeeded;
14
49
  save(): Promise<void>;
50
+ atomicSave(): Promise<void>;
51
+ backupConfig(): Promise<string>;
52
+ private acquireLock;
53
+ private releaseLock;
15
54
  getApiUrl(): string;
16
- discoverServices(): Promise<void>;
55
+ discoverServices(verbose?: boolean): Promise<void>;
56
+ private handleServiceDiscoveryFailure;
57
+ private categorizeServiceDiscoveryError;
58
+ setManualEndpoints(endpoints: Partial<CLIConfigData['discoveredServices']>): Promise<void>;
59
+ hasManualEndpointOverrides(): boolean;
60
+ clearManualEndpointOverrides(): Promise<void>;
17
61
  getDiscoveredApiUrl(): string;
18
62
  setVendorKey(vendorKey: string): Promise<void>;
63
+ validateVendorKeyFormat(vendorKey: string): string | boolean;
64
+ private validateVendorKeyWithServer;
19
65
  getVendorKey(): string | undefined;
20
66
  hasVendorKey(): boolean;
21
67
  setApiUrl(url: string): Promise<void>;
@@ -27,6 +73,16 @@ export declare class CLIConfig {
27
73
  clear(): Promise<void>;
28
74
  getConfigPath(): string;
29
75
  exists(): Promise<boolean>;
76
+ validateStoredCredentials(): Promise<boolean>;
77
+ refreshTokenIfNeeded(): Promise<void>;
78
+ clearInvalidCredentials(): Promise<void>;
79
+ incrementFailureCount(): Promise<void>;
80
+ resetFailureCount(): Promise<void>;
81
+ getFailureCount(): number;
82
+ getLastAuthFailure(): string | undefined;
83
+ shouldDelayAuth(): boolean;
84
+ getAuthDelayMs(): number;
85
+ getDeviceId(): Promise<string>;
30
86
  get<T = unknown>(key: string): T;
31
87
  set(key: string, value: unknown): void;
32
88
  setAndSave(key: string, value: unknown): Promise<void>;