centaurus-cli 2.8.6 → 2.8.7
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/cli-adapter.d.ts +85 -0
- package/dist/cli-adapter.d.ts.map +1 -1
- package/dist/cli-adapter.js +769 -28
- package/dist/cli-adapter.js.map +1 -1
- package/dist/config/slash-commands.d.ts +2 -0
- package/dist/config/slash-commands.d.ts.map +1 -1
- package/dist/config/slash-commands.js +31 -1
- package/dist/config/slash-commands.js.map +1 -1
- package/dist/context/handlers/docker-handler.js.map +1 -1
- package/dist/context/handlers/ssh-handler.d.ts +16 -1
- package/dist/context/handlers/ssh-handler.d.ts.map +1 -1
- package/dist/context/handlers/ssh-handler.js +57 -12
- package/dist/context/handlers/ssh-handler.js.map +1 -1
- package/dist/context/subshell-handler.d.ts +14 -0
- package/dist/context/subshell-handler.d.ts.map +1 -1
- package/dist/hooks/useTerminalDimensions.d.ts +41 -0
- package/dist/hooks/useTerminalDimensions.d.ts.map +1 -0
- package/dist/hooks/useTerminalDimensions.js +84 -0
- package/dist/hooks/useTerminalDimensions.js.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -1
- package/dist/services/api-client.d.ts +24 -0
- package/dist/services/api-client.d.ts.map +1 -1
- package/dist/services/api-client.js +27 -0
- package/dist/services/api-client.js.map +1 -1
- package/dist/services/auth-handler.js +1 -1
- package/dist/services/auth-handler.js.map +1 -1
- package/dist/services/clipboard-service.d.ts +42 -0
- package/dist/services/clipboard-service.d.ts.map +1 -0
- package/dist/services/clipboard-service.js +217 -0
- package/dist/services/clipboard-service.js.map +1 -0
- package/dist/services/local-chat-storage.d.ts +154 -0
- package/dist/services/local-chat-storage.d.ts.map +1 -0
- package/dist/services/local-chat-storage.js +258 -0
- package/dist/services/local-chat-storage.js.map +1 -0
- package/dist/tools/grep-search.d.ts +5 -0
- package/dist/tools/grep-search.d.ts.map +1 -1
- package/dist/tools/grep-search.js +68 -16
- package/dist/tools/grep-search.js.map +1 -1
- package/dist/tools/plan-mode.d.ts +57 -6
- package/dist/tools/plan-mode.d.ts.map +1 -1
- package/dist/tools/plan-mode.js +297 -46
- package/dist/tools/plan-mode.js.map +1 -1
- package/dist/tools/read-binary-file.d.ts +10 -0
- package/dist/tools/read-binary-file.d.ts.map +1 -0
- package/dist/tools/read-binary-file.js +210 -0
- package/dist/tools/read-binary-file.js.map +1 -0
- package/dist/types/index.d.ts +7 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/components/App.d.ts +35 -0
- package/dist/ui/components/App.d.ts.map +1 -1
- package/dist/ui/components/App.js +608 -16
- package/dist/ui/components/App.js.map +1 -1
- package/dist/ui/components/ClipboardImageAutocomplete.d.ts +14 -0
- package/dist/ui/components/ClipboardImageAutocomplete.d.ts.map +1 -0
- package/dist/ui/components/ClipboardImageAutocomplete.js +39 -0
- package/dist/ui/components/ClipboardImageAutocomplete.js.map +1 -0
- package/dist/ui/components/ConnectionStatusMessage.d.ts +1 -1
- package/dist/ui/components/ConnectionStatusMessage.d.ts.map +1 -1
- package/dist/ui/components/ConnectionStatusMessage.js +21 -0
- package/dist/ui/components/ConnectionStatusMessage.js.map +1 -1
- package/dist/ui/components/DetailedPlanReviewScreen.d.ts +17 -0
- package/dist/ui/components/DetailedPlanReviewScreen.d.ts.map +1 -0
- package/dist/ui/components/DetailedPlanReviewScreen.js +110 -0
- package/dist/ui/components/DetailedPlanReviewScreen.js.map +1 -0
- package/dist/ui/components/InputBox.d.ts +2 -1
- package/dist/ui/components/InputBox.d.ts.map +1 -1
- package/dist/ui/components/InputBox.js +399 -28
- package/dist/ui/components/InputBox.js.map +1 -1
- package/dist/ui/components/InteractiveShell.d.ts.map +1 -1
- package/dist/ui/components/InteractiveShell.js +20 -6
- package/dist/ui/components/InteractiveShell.js.map +1 -1
- package/dist/ui/components/MessageDisplay.d.ts +6 -0
- package/dist/ui/components/MessageDisplay.d.ts.map +1 -1
- package/dist/ui/components/MessageDisplay.js +66 -3
- package/dist/ui/components/MessageDisplay.js.map +1 -1
- package/dist/ui/components/PlanAcceptedMessage.d.ts +8 -0
- package/dist/ui/components/PlanAcceptedMessage.d.ts.map +1 -1
- package/dist/ui/components/PlanAcceptedMessage.js +26 -8
- package/dist/ui/components/PlanAcceptedMessage.js.map +1 -1
- package/dist/ui/components/StreamingMessageDisplay.d.ts +3 -0
- package/dist/ui/components/StreamingMessageDisplay.d.ts.map +1 -1
- package/dist/ui/components/StreamingMessageDisplay.js +10 -6
- package/dist/ui/components/StreamingMessageDisplay.js.map +1 -1
- package/dist/ui/components/TaskCompletedMessage.d.ts.map +1 -1
- package/dist/ui/components/TaskCompletedMessage.js +4 -4
- package/dist/ui/components/TaskCompletedMessage.js.map +1 -1
- package/dist/ui/components/TaskProgressIndicator.d.ts +18 -0
- package/dist/ui/components/TaskProgressIndicator.d.ts.map +1 -0
- package/dist/ui/components/TaskProgressIndicator.js +72 -0
- package/dist/ui/components/TaskProgressIndicator.js.map +1 -0
- package/dist/ui/components/ThinkingDisplay.d.ts +3 -0
- package/dist/ui/components/ThinkingDisplay.d.ts.map +1 -1
- package/dist/ui/components/ThinkingDisplay.js +6 -4
- package/dist/ui/components/ThinkingDisplay.js.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.d.ts.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.js +85 -15
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
- package/dist/utils/custom-commands-manager.d.ts +59 -0
- package/dist/utils/custom-commands-manager.d.ts.map +1 -0
- package/dist/utils/custom-commands-manager.js +142 -0
- package/dist/utils/custom-commands-manager.js.map +1 -0
- package/dist/utils/input-classifier.d.ts +10 -11
- package/dist/utils/input-classifier.d.ts.map +1 -1
- package/dist/utils/input-classifier.js +299 -75
- package/dist/utils/input-classifier.js.map +1 -1
- package/dist/utils/terminal-output.d.ts.map +1 -1
- package/dist/utils/terminal-output.js +110 -14
- package/dist/utils/terminal-output.js.map +1 -1
- package/dist/utils/unicode-sanitizer.d.ts +44 -0
- package/dist/utils/unicode-sanitizer.d.ts.map +1 -0
- package/dist/utils/unicode-sanitizer.js +211 -0
- package/dist/utils/unicode-sanitizer.js.map +1 -0
- package/models-config.json +2 -3
- package/package.json +4 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom Commands Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages user-defined custom terminal commands for auto-mode detection.
|
|
5
|
+
* Custom commands are stored persistently and included in terminal command detection.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from 'fs/promises';
|
|
8
|
+
import * as fsSync from 'fs';
|
|
9
|
+
import * as path from 'path';
|
|
10
|
+
import * as os from 'os';
|
|
11
|
+
export class CustomCommandsManager {
|
|
12
|
+
static instance;
|
|
13
|
+
configPath;
|
|
14
|
+
data;
|
|
15
|
+
loaded = false;
|
|
16
|
+
constructor() {
|
|
17
|
+
const configDir = path.join(os.homedir(), '.centaurus');
|
|
18
|
+
this.configPath = path.join(configDir, 'custom-commands.json');
|
|
19
|
+
this.data = { commands: [], version: 1 };
|
|
20
|
+
}
|
|
21
|
+
static getInstance() {
|
|
22
|
+
if (!CustomCommandsManager.instance) {
|
|
23
|
+
CustomCommandsManager.instance = new CustomCommandsManager();
|
|
24
|
+
}
|
|
25
|
+
return CustomCommandsManager.instance;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Initialize and load custom commands from disk
|
|
29
|
+
*/
|
|
30
|
+
async initialize() {
|
|
31
|
+
if (this.loaded)
|
|
32
|
+
return;
|
|
33
|
+
await this.load();
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Sync load for use in detectIntent (must be fast)
|
|
37
|
+
*/
|
|
38
|
+
loadSync() {
|
|
39
|
+
if (this.loaded)
|
|
40
|
+
return;
|
|
41
|
+
try {
|
|
42
|
+
if (fsSync.existsSync(this.configPath)) {
|
|
43
|
+
const content = fsSync.readFileSync(this.configPath, 'utf-8');
|
|
44
|
+
const parsed = JSON.parse(content);
|
|
45
|
+
if (parsed.commands && Array.isArray(parsed.commands)) {
|
|
46
|
+
this.data = parsed;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
// Ignore errors - use empty array
|
|
52
|
+
}
|
|
53
|
+
this.loaded = true;
|
|
54
|
+
}
|
|
55
|
+
async ensureConfigDir() {
|
|
56
|
+
const configDir = path.dirname(this.configPath);
|
|
57
|
+
try {
|
|
58
|
+
await fs.access(configDir);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
await fs.mkdir(configDir, { recursive: true });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async load() {
|
|
65
|
+
try {
|
|
66
|
+
const content = await fs.readFile(this.configPath, 'utf-8');
|
|
67
|
+
const parsed = JSON.parse(content);
|
|
68
|
+
if (parsed.commands && Array.isArray(parsed.commands)) {
|
|
69
|
+
this.data = parsed;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
// File doesn't exist or is invalid - use defaults
|
|
74
|
+
this.data = { commands: [], version: 1 };
|
|
75
|
+
}
|
|
76
|
+
this.loaded = true;
|
|
77
|
+
}
|
|
78
|
+
async save() {
|
|
79
|
+
await this.ensureConfigDir();
|
|
80
|
+
await fs.writeFile(this.configPath, JSON.stringify(this.data, null, 2), 'utf-8');
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Add a custom command word
|
|
84
|
+
* @returns true if added, false if already exists
|
|
85
|
+
*/
|
|
86
|
+
async addCommand(command) {
|
|
87
|
+
const normalized = command.toLowerCase().trim();
|
|
88
|
+
if (!normalized) {
|
|
89
|
+
return { success: false, message: 'Command cannot be empty' };
|
|
90
|
+
}
|
|
91
|
+
if (normalized.includes(' ')) {
|
|
92
|
+
return { success: false, message: 'Command must be a single word (no spaces)' };
|
|
93
|
+
}
|
|
94
|
+
if (this.data.commands.includes(normalized)) {
|
|
95
|
+
return { success: false, message: `Command "${normalized}" already exists` };
|
|
96
|
+
}
|
|
97
|
+
this.data.commands.push(normalized);
|
|
98
|
+
this.data.commands.sort();
|
|
99
|
+
await this.save();
|
|
100
|
+
return { success: true, message: `Added "${normalized}" to custom commands` };
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Delete a custom command word
|
|
104
|
+
* @returns true if deleted, false if not found
|
|
105
|
+
*/
|
|
106
|
+
async deleteCommand(command) {
|
|
107
|
+
const normalized = command.toLowerCase().trim();
|
|
108
|
+
const index = this.data.commands.indexOf(normalized);
|
|
109
|
+
if (index === -1) {
|
|
110
|
+
return { success: false, message: `Command "${normalized}" not found` };
|
|
111
|
+
}
|
|
112
|
+
this.data.commands.splice(index, 1);
|
|
113
|
+
await this.save();
|
|
114
|
+
return { success: true, message: `Deleted "${normalized}" from custom commands` };
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* List all custom commands
|
|
118
|
+
*/
|
|
119
|
+
listCommands() {
|
|
120
|
+
return [...this.data.commands];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Check if a command exists
|
|
124
|
+
*/
|
|
125
|
+
hasCommand(command) {
|
|
126
|
+
return this.data.commands.includes(command.toLowerCase().trim());
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Get all commands as a Set for fast lookup
|
|
130
|
+
*/
|
|
131
|
+
getCommandsSet() {
|
|
132
|
+
return new Set(this.data.commands);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Get the number of custom commands
|
|
136
|
+
*/
|
|
137
|
+
getCount() {
|
|
138
|
+
return this.data.commands.length;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
export default CustomCommandsManager;
|
|
142
|
+
//# sourceMappingURL=custom-commands-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-commands-manager.js","sourceRoot":"","sources":["../../src/utils/custom-commands-manager.ts"],"names":[],"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C,OAAO,CAAC,UAAU,CAAC,CAAC;QAErD,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACf,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,UAAU,aAAa,EAAE,CAAC;QAC5E,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACpC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAElB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,UAAU,wBAAwB,EAAE,CAAC;IACtF,CAAC;IAED;;OAEG;IACH,YAAY;QACR,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,OAAe;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACH,cAAc;QACV,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,QAAQ;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;IACrC,CAAC;CACJ;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Input Classification Utilities
|
|
3
3
|
*
|
|
4
|
-
* Provides heuristic-based detection of user intent (Terminal Command vs AI Message).
|
|
5
|
-
*
|
|
4
|
+
* Provides intelligent heuristic-based detection of user intent (Terminal Command vs AI Message).
|
|
5
|
+
* Uses sentence structure analysis, command syntax detection, and context-aware disambiguation.
|
|
6
6
|
*/
|
|
7
7
|
export type InputIntent = 'command' | 'ai';
|
|
8
8
|
/**
|
|
9
|
-
* Detects the intent of the user input using
|
|
9
|
+
* Detects the intent of the user input using intelligent heuristics.
|
|
10
10
|
*
|
|
11
|
-
* Logic:
|
|
11
|
+
* Logic Priority:
|
|
12
12
|
* 1. Slash Commands: If starts with '/', check if valid command -> AI
|
|
13
13
|
* 2. Prefixes: '?' -> AI, '.', '/', '$', '~' -> Command
|
|
14
|
-
* 3.
|
|
15
|
-
* 4. Syntax
|
|
16
|
-
* 5.
|
|
17
|
-
* 6.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* - Default -> AI (Safer to assume chat if unsure)
|
|
14
|
+
* 3. Strong AI Indicators: Question marks, AI keywords
|
|
15
|
+
* 4. Strong Command Syntax: Flags, pipes, redirects, quotes, env vars
|
|
16
|
+
* 5. Definite Commands: Known command binaries that aren't ambiguous
|
|
17
|
+
* 6. Ambiguous Command Disambiguation: Context-aware analysis
|
|
18
|
+
* 7. Natural Language Detection: Sentence structure analysis
|
|
19
|
+
* 8. Fallback: Multi-word without command syntax -> AI
|
|
21
20
|
*
|
|
22
21
|
* @param input The user input string
|
|
23
22
|
* @returns 'command' | 'ai'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-classifier.d.ts","sourceRoot":"","sources":["../../src/utils/input-classifier.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"input-classifier.d.ts","sourceRoot":"","sources":["../../src/utils/input-classifier.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;AAgU3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CA4FvD"}
|