@lanonasis/cli 3.8.1 → 3.9.0
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 +195 -0
- package/README.md +65 -2
- package/dist/commands/init.js +12 -0
- package/dist/commands/mcp.js +27 -0
- package/dist/commands/memory.js +49 -23
- package/dist/index.js +20 -0
- package/dist/mcp/schemas/tool-schemas.d.ts +4 -4
- package/dist/utils/mcp-client.d.ts +2 -0
- package/dist/utils/mcp-client.js +33 -15
- package/dist/ux/implementations/ConnectionManagerImpl.d.ts +72 -0
- package/dist/ux/implementations/ConnectionManagerImpl.js +352 -0
- package/dist/ux/implementations/OnboardingFlowImpl.d.ts +72 -0
- package/dist/ux/implementations/OnboardingFlowImpl.js +415 -0
- package/dist/ux/implementations/TextInputHandlerImpl.d.ts +74 -0
- package/dist/ux/implementations/TextInputHandlerImpl.js +342 -0
- package/dist/ux/implementations/index.d.ts +11 -0
- package/dist/ux/implementations/index.js +11 -0
- package/dist/ux/index.d.ts +15 -0
- package/dist/ux/index.js +22 -0
- package/dist/ux/interfaces/ConnectionManager.d.ts +112 -0
- package/dist/ux/interfaces/ConnectionManager.js +7 -0
- package/dist/ux/interfaces/OnboardingFlow.d.ts +103 -0
- package/dist/ux/interfaces/OnboardingFlow.js +7 -0
- package/dist/ux/interfaces/TextInputHandler.d.ts +87 -0
- package/dist/ux/interfaces/TextInputHandler.js +7 -0
- package/dist/ux/interfaces/index.d.ts +10 -0
- package/dist/ux/interfaces/index.js +8 -0
- package/package.json +34 -4
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text Input Handler Interface
|
|
3
|
+
*
|
|
4
|
+
* Provides seamless multi-line text input without external editors
|
|
5
|
+
* for CLI UX improvements as specified in the design document.
|
|
6
|
+
*/
|
|
7
|
+
export interface KeyEvent {
|
|
8
|
+
name?: string;
|
|
9
|
+
ctrl?: boolean;
|
|
10
|
+
meta?: boolean;
|
|
11
|
+
shift?: boolean;
|
|
12
|
+
sequence?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CursorPosition {
|
|
15
|
+
line: number;
|
|
16
|
+
column: number;
|
|
17
|
+
}
|
|
18
|
+
export interface InputOptions {
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
defaultContent?: string;
|
|
21
|
+
maxLines?: number;
|
|
22
|
+
submitKeys?: string[];
|
|
23
|
+
cancelKeys?: string[];
|
|
24
|
+
showLineNumbers?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface InputSession {
|
|
27
|
+
id: string;
|
|
28
|
+
prompt: string;
|
|
29
|
+
content: string[];
|
|
30
|
+
cursorPosition: CursorPosition;
|
|
31
|
+
startTime: Date;
|
|
32
|
+
options: InputOptions;
|
|
33
|
+
status: 'active' | 'completed' | 'cancelled';
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* TextInputHandler provides seamless multi-line text input without external editors
|
|
37
|
+
*
|
|
38
|
+
* Key Methods:
|
|
39
|
+
* - collectMultilineInput(): Main method for collecting multi-line text input
|
|
40
|
+
* - enableRawMode(): Enable raw terminal mode for keystroke capture
|
|
41
|
+
* - disableRawMode(): Disable raw terminal mode
|
|
42
|
+
* - handleSpecialKeys(): Process special keyboard events
|
|
43
|
+
* - displayInputPrompt(): Show visual feedback for input
|
|
44
|
+
*
|
|
45
|
+
* Implementation Strategy:
|
|
46
|
+
* - Use process.stdin.setRawMode(true) to capture individual keystrokes
|
|
47
|
+
* - Handle special characters manually (Ctrl+C, Enter, Backspace, Arrow keys)
|
|
48
|
+
* - Provide visual feedback for multi-line editing with line numbers
|
|
49
|
+
* - Support common editing shortcuts (Ctrl+A, Ctrl+E, Ctrl+U)
|
|
50
|
+
*/
|
|
51
|
+
export interface TextInputHandler {
|
|
52
|
+
/**
|
|
53
|
+
* Collect multi-line text input from the user
|
|
54
|
+
* @param prompt The prompt to display to the user
|
|
55
|
+
* @param options Optional configuration for input behavior
|
|
56
|
+
* @returns Promise that resolves to the collected text
|
|
57
|
+
*/
|
|
58
|
+
collectMultilineInput(prompt: string, options?: InputOptions): Promise<string>;
|
|
59
|
+
/**
|
|
60
|
+
* Enable raw mode for direct keystroke capture
|
|
61
|
+
*/
|
|
62
|
+
enableRawMode(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Disable raw mode and return to normal terminal behavior
|
|
65
|
+
*/
|
|
66
|
+
disableRawMode(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Handle special keyboard events (Ctrl+C, arrows, etc.)
|
|
69
|
+
* @param key The keyboard event to process
|
|
70
|
+
* @returns true if the key was handled, false otherwise
|
|
71
|
+
*/
|
|
72
|
+
handleSpecialKeys(key: KeyEvent): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Display the input prompt with current content
|
|
75
|
+
* @param content The current input content to display
|
|
76
|
+
*/
|
|
77
|
+
displayInputPrompt(content: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Get the current input session
|
|
80
|
+
* @returns The active input session or null if none
|
|
81
|
+
*/
|
|
82
|
+
getCurrentSession(): InputSession | null;
|
|
83
|
+
/**
|
|
84
|
+
* Cancel the current input session
|
|
85
|
+
*/
|
|
86
|
+
cancelInput(): void;
|
|
87
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI UX Improvements - Core Interfaces
|
|
3
|
+
*
|
|
4
|
+
* This module exports all the TypeScript interfaces for the CLI UX improvements
|
|
5
|
+
* as specified in the design document. These interfaces define the contracts
|
|
6
|
+
* for the TextInputHandler, ConnectionManager, and OnboardingFlow components.
|
|
7
|
+
*/
|
|
8
|
+
export type { TextInputHandler, KeyEvent, CursorPosition, InputOptions, InputSession, } from './TextInputHandler.js';
|
|
9
|
+
export type { ConnectionManager, ConnectionResult, ConfigResult, ServerInstance, ConnectionStatus, MCPConfig, } from './ConnectionManager.js';
|
|
10
|
+
export type { OnboardingFlow, SetupResult, TestResult, UserPreferences, OnboardingState, } from './OnboardingFlow.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI UX Improvements - Core Interfaces
|
|
3
|
+
*
|
|
4
|
+
* This module exports all the TypeScript interfaces for the CLI UX improvements
|
|
5
|
+
* as specified in the design document. These interfaces define the contracts
|
|
6
|
+
* for the TextInputHandler, ConnectionManager, and OnboardingFlow components.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lanonasis/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
|
+
"description": "Professional CLI for LanOnasis Memory as a Service (MaaS) with MCP support, seamless inline editing, and enterprise-grade security",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"lanonasis",
|
|
7
|
+
"memory",
|
|
8
|
+
"maas",
|
|
9
|
+
"mcp",
|
|
10
|
+
"cli",
|
|
11
|
+
"model-context-protocol",
|
|
12
|
+
"semantic-search",
|
|
13
|
+
"vector-database",
|
|
14
|
+
"knowledge-management",
|
|
15
|
+
"enterprise"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://docs.lanonasis.com",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/lanonasis/lanonasis-maas.git",
|
|
21
|
+
"directory": "cli"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/lanonasis/lanonasis-maas/issues"
|
|
25
|
+
},
|
|
26
|
+
"author": "LanOnasis Team",
|
|
27
|
+
"license": "MIT",
|
|
4
28
|
"type": "module",
|
|
5
29
|
"main": "dist/index.js",
|
|
6
30
|
"types": "dist/index.d.ts",
|
|
@@ -17,10 +41,15 @@
|
|
|
17
41
|
}
|
|
18
42
|
},
|
|
19
43
|
"files": [
|
|
20
|
-
"dist",
|
|
44
|
+
"dist/**/*.js",
|
|
45
|
+
"dist/**/*.d.ts",
|
|
46
|
+
"!dist/**/__tests__",
|
|
47
|
+
"!dist/**/*.test.*",
|
|
48
|
+
"!dist/**/*.spec.*",
|
|
21
49
|
"scripts",
|
|
22
50
|
"README.md",
|
|
23
|
-
"LICENSE"
|
|
51
|
+
"LICENSE",
|
|
52
|
+
"CHANGELOG.md"
|
|
24
53
|
],
|
|
25
54
|
"dependencies": {
|
|
26
55
|
"@lanonasis/oauth-client": "1.2.5",
|
|
@@ -49,6 +78,7 @@
|
|
|
49
78
|
"@types/inquirer": "^9.0.7",
|
|
50
79
|
"@types/node": "^22.19.3",
|
|
51
80
|
"@types/ws": "^8.5.12",
|
|
81
|
+
"fast-check": "^3.15.1",
|
|
52
82
|
"jest": "^29.7.0",
|
|
53
83
|
"rimraf": "^5.0.7",
|
|
54
84
|
"ts-jest": "^29.1.1",
|
|
@@ -62,4 +92,4 @@
|
|
|
62
92
|
"test:watch": "npm test -- --watch",
|
|
63
93
|
"test:coverage": "npm test -- --coverage"
|
|
64
94
|
}
|
|
65
|
-
}
|
|
95
|
+
}
|