centaurus-cli 2.9.3 → 2.9.5
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 +74 -10
- package/dist/cli-adapter.d.ts.map +1 -1
- package/dist/cli-adapter.js +898 -244
- package/dist/cli-adapter.js.map +1 -1
- package/dist/commands/CommandParser.d.ts +1 -1
- package/dist/commands/CommandParser.d.ts.map +1 -1
- package/dist/commands/CommandParser.js +113 -0
- package/dist/commands/CommandParser.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 +28 -0
- package/dist/config/slash-commands.js.map +1 -1
- package/dist/context/context-manager.d.ts +7 -1
- package/dist/context/context-manager.d.ts.map +1 -1
- package/dist/context/context-manager.js +14 -1
- package/dist/context/context-manager.js.map +1 -1
- package/dist/context/handlers/docker-handler.d.ts +11 -0
- package/dist/context/handlers/docker-handler.d.ts.map +1 -1
- package/dist/context/handlers/docker-handler.js +159 -14
- package/dist/context/handlers/docker-handler.js.map +1 -1
- package/dist/context/handlers/ssh-handler.d.ts +20 -0
- package/dist/context/handlers/ssh-handler.d.ts.map +1 -1
- package/dist/context/handlers/ssh-handler.js +129 -1
- package/dist/context/handlers/ssh-handler.js.map +1 -1
- package/dist/context/subshell-handler.d.ts +15 -0
- package/dist/context/subshell-handler.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/services/ai-service-client.d.ts.map +1 -1
- package/dist/services/ai-service-client.js +33 -11
- package/dist/services/ai-service-client.js.map +1 -1
- package/dist/services/api-client.js +1 -1
- package/dist/services/api-client.js.map +1 -1
- package/dist/services/local-chat-storage.d.ts +3 -1
- package/dist/services/local-chat-storage.d.ts.map +1 -1
- package/dist/services/local-chat-storage.js +8 -3
- package/dist/services/local-chat-storage.js.map +1 -1
- package/dist/services/warpify-detector.d.ts +43 -0
- package/dist/services/warpify-detector.d.ts.map +1 -0
- package/dist/services/warpify-detector.js +203 -0
- package/dist/services/warpify-detector.js.map +1 -0
- package/dist/services/workflow-storage.d.ts +72 -0
- package/dist/services/workflow-storage.d.ts.map +1 -0
- package/dist/services/workflow-storage.js +239 -0
- package/dist/services/workflow-storage.js.map +1 -0
- package/dist/tools/command.d.ts.map +1 -1
- package/dist/tools/command.js +106 -38
- package/dist/tools/command.js.map +1 -1
- package/dist/tools/enter-remote-session.d.ts +13 -0
- package/dist/tools/enter-remote-session.d.ts.map +1 -0
- package/dist/tools/enter-remote-session.js +226 -0
- package/dist/tools/enter-remote-session.js.map +1 -0
- package/dist/tools/find-files.d.ts.map +1 -1
- package/dist/tools/find-files.js +9 -2
- package/dist/tools/find-files.js.map +1 -1
- package/dist/tools/grep-search.d.ts +104 -31
- package/dist/tools/grep-search.d.ts.map +1 -1
- package/dist/tools/grep-search.js +779 -431
- package/dist/tools/grep-search.js.map +1 -1
- package/dist/tools/workflow-tool.d.ts +11 -0
- package/dist/tools/workflow-tool.d.ts.map +1 -0
- package/dist/tools/workflow-tool.js +87 -0
- package/dist/tools/workflow-tool.js.map +1 -0
- package/dist/types/workflow.d.ts +110 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/types/workflow.js +8 -0
- package/dist/types/workflow.js.map +1 -0
- package/dist/ui/components/App.d.ts +10 -1
- package/dist/ui/components/App.d.ts.map +1 -1
- package/dist/ui/components/App.js +135 -8
- package/dist/ui/components/App.js.map +1 -1
- package/dist/ui/components/Breadcrumbs.d.ts +4 -3
- package/dist/ui/components/Breadcrumbs.d.ts.map +1 -1
- package/dist/ui/components/Breadcrumbs.js +80 -54
- package/dist/ui/components/Breadcrumbs.js.map +1 -1
- package/dist/ui/components/ConnectionStatusMessage.js +2 -2
- package/dist/ui/components/ConnectionStatusMessage.js.map +1 -1
- package/dist/ui/components/InputBox.d.ts +1 -0
- package/dist/ui/components/InputBox.d.ts.map +1 -1
- package/dist/ui/components/InputBox.js +226 -19
- package/dist/ui/components/InputBox.js.map +1 -1
- package/dist/ui/components/InteractiveShell.d.ts +4 -0
- package/dist/ui/components/InteractiveShell.d.ts.map +1 -1
- package/dist/ui/components/InteractiveShell.js +52 -15
- package/dist/ui/components/InteractiveShell.js.map +1 -1
- package/dist/ui/components/KeyboardHelp.d.ts.map +1 -1
- package/dist/ui/components/KeyboardHelp.js +14 -6
- package/dist/ui/components/KeyboardHelp.js.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.d.ts.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.js +165 -27
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
- package/dist/ui/components/WorkflowCreatorScreen.d.ts +25 -0
- package/dist/ui/components/WorkflowCreatorScreen.d.ts.map +1 -0
- package/dist/ui/components/WorkflowCreatorScreen.js +164 -0
- package/dist/ui/components/WorkflowCreatorScreen.js.map +1 -0
- package/dist/utils/ansi-encoder.d.ts.map +1 -1
- package/dist/utils/ansi-encoder.js +7 -0
- package/dist/utils/ansi-encoder.js.map +1 -1
- package/dist/utils/editor-utils.d.ts +9 -0
- package/dist/utils/editor-utils.d.ts.map +1 -1
- package/dist/utils/editor-utils.js +105 -0
- package/dist/utils/editor-utils.js.map +1 -1
- package/dist/utils/input-classifier.d.ts.map +1 -1
- package/dist/utils/input-classifier.js +2 -1
- package/dist/utils/input-classifier.js.map +1 -1
- package/dist/utils/terminal-output.d.ts +3 -1
- package/dist/utils/terminal-output.d.ts.map +1 -1
- package/dist/utils/terminal-output.js +138 -157
- package/dist/utils/terminal-output.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,77 +6,150 @@ export interface GrepSearchParams {
|
|
|
6
6
|
CaseInsensitive?: boolean;
|
|
7
7
|
IsRegex?: boolean;
|
|
8
8
|
MatchPerLine?: boolean;
|
|
9
|
+
MaxResults?: number;
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Context line with explicit line number tracking
|
|
13
|
+
*/
|
|
14
|
+
export interface ContextLine {
|
|
15
|
+
lineNumber: number;
|
|
16
|
+
text: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Enhanced match with column/offset information
|
|
20
|
+
*/
|
|
10
21
|
export interface GrepMatch {
|
|
11
22
|
file: string;
|
|
12
23
|
line: number;
|
|
24
|
+
column?: number;
|
|
25
|
+
byteOffset?: number;
|
|
13
26
|
match: string;
|
|
14
|
-
|
|
15
|
-
|
|
27
|
+
matchIndices?: [number, number][];
|
|
28
|
+
contextBefore: ContextLine[];
|
|
29
|
+
contextAfter: ContextLine[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Backend type - now includes powershell and nodejs
|
|
33
|
+
*/
|
|
34
|
+
export type GrepBackend = 'ripgrep' | 'grep' | 'powershell' | 'findstr' | 'nodejs' | 'remote';
|
|
35
|
+
/**
|
|
36
|
+
* Reason for result truncation
|
|
37
|
+
*/
|
|
38
|
+
export type TruncationReason = 'max_matches' | 'backend_limit' | 'timeout';
|
|
39
|
+
/**
|
|
40
|
+
* Search metadata for debugging and transparency
|
|
41
|
+
*/
|
|
42
|
+
export interface GrepSearchMetadata {
|
|
43
|
+
backend: GrepBackend;
|
|
44
|
+
searchDurationMs: number;
|
|
45
|
+
filesSearched?: number;
|
|
46
|
+
queriesExecuted: string[];
|
|
47
|
+
matchesPerQuery: Record<string, number>;
|
|
48
|
+
encodingFallback?: boolean;
|
|
16
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Enhanced search result with structured data and metadata
|
|
52
|
+
*/
|
|
17
53
|
export interface GrepSearchResult {
|
|
54
|
+
matches: GrepMatch[];
|
|
55
|
+
totalMatches: number;
|
|
56
|
+
uniqueMatchesCount: number;
|
|
57
|
+
truncated: boolean;
|
|
58
|
+
truncationReason?: TruncationReason;
|
|
59
|
+
searchPattern: string;
|
|
60
|
+
metadata: GrepSearchMetadata;
|
|
61
|
+
formattedOutput: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Internal result before formatting
|
|
65
|
+
*/
|
|
66
|
+
interface InternalSearchResult {
|
|
18
67
|
matches: GrepMatch[];
|
|
19
68
|
totalMatches: number;
|
|
20
69
|
truncated: boolean;
|
|
70
|
+
truncationReason?: TruncationReason;
|
|
21
71
|
searchPattern: string;
|
|
72
|
+
filesSearched?: number;
|
|
73
|
+
encodingFallback?: boolean;
|
|
22
74
|
}
|
|
23
75
|
/**
|
|
24
|
-
* GrepSearchTool -
|
|
76
|
+
* GrepSearchTool - Cross-platform text search with multiple backends
|
|
77
|
+
*
|
|
78
|
+
* Backend priority:
|
|
79
|
+
* 1. ripgrep (fastest, cross-platform)
|
|
80
|
+
* 2. grep (Linux/macOS native)
|
|
81
|
+
* 3. PowerShell Select-String (Windows, good Unicode support)
|
|
82
|
+
* 4. Pure Node.js (universal fallback, no dependencies)
|
|
25
83
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
84
|
+
* Features:
|
|
85
|
+
* - Streaming output to handle large repos
|
|
86
|
+
* - Early abort when MAX_MATCHES reached
|
|
87
|
+
* - Proper encoding handling (UTF-8 with fallback)
|
|
88
|
+
* - CRLF normalization
|
|
89
|
+
* - Windows path support (drive letters, UNC)
|
|
31
90
|
*/
|
|
32
91
|
export declare class GrepSearchTool {
|
|
33
|
-
|
|
92
|
+
static readonly DEFAULT_MAX_MATCHES = 50;
|
|
34
93
|
private static readonly MAX_LINE_LENGTH;
|
|
35
94
|
private static readonly CONTEXT_LINES;
|
|
95
|
+
private static readonly SEARCH_TIMEOUT;
|
|
96
|
+
private static toolCache;
|
|
36
97
|
/**
|
|
37
|
-
* Check if
|
|
98
|
+
* Check if a command is available
|
|
38
99
|
*/
|
|
100
|
+
private hasCommand;
|
|
39
101
|
private hasRipgrep;
|
|
40
|
-
/**
|
|
41
|
-
* Check if native grep is available (Linux/Mac)
|
|
42
|
-
*/
|
|
43
102
|
private hasGrep;
|
|
103
|
+
private hasPowerShell;
|
|
44
104
|
/**
|
|
45
|
-
*
|
|
105
|
+
* Get the PowerShell executable name
|
|
46
106
|
*/
|
|
47
|
-
private
|
|
107
|
+
private getPowerShellExe;
|
|
48
108
|
/**
|
|
49
|
-
*
|
|
50
|
-
* Returns true if there are no patterns or if the file matches at least one pattern
|
|
109
|
+
* Normalize file path to forward slashes
|
|
51
110
|
*/
|
|
52
|
-
private
|
|
111
|
+
private normalizePath;
|
|
53
112
|
/**
|
|
54
113
|
* Truncate long lines
|
|
55
114
|
*/
|
|
56
115
|
private truncateLine;
|
|
57
116
|
/**
|
|
58
|
-
*
|
|
117
|
+
* Normalize line endings (CRLF -> LF)
|
|
118
|
+
*/
|
|
119
|
+
private normalizeLineEndings;
|
|
120
|
+
/**
|
|
121
|
+
* Parse file:line:content format robustly, handling Windows paths
|
|
122
|
+
* E.g., "C:\foo\bar.ts:42:content" or "/foo/bar.ts:42:content"
|
|
123
|
+
*/
|
|
124
|
+
private parseGrepLine;
|
|
125
|
+
/**
|
|
126
|
+
* Create regex from pattern
|
|
59
127
|
*/
|
|
60
|
-
private
|
|
128
|
+
private createSearchRegex;
|
|
61
129
|
/**
|
|
62
|
-
*
|
|
130
|
+
* Escape regex special characters
|
|
63
131
|
*/
|
|
64
|
-
private
|
|
132
|
+
private escapeRegex;
|
|
65
133
|
/**
|
|
66
|
-
*
|
|
134
|
+
* Check if file matches include patterns
|
|
67
135
|
*/
|
|
68
|
-
private
|
|
69
|
-
private parseGrepOutput;
|
|
136
|
+
private matchesIncludesFilter;
|
|
70
137
|
/**
|
|
71
|
-
*
|
|
72
|
-
* NOTE: Context is DISABLED for findstr to avoid performance/encoding issues.
|
|
138
|
+
* Check if file is likely binary
|
|
73
139
|
*/
|
|
74
|
-
private
|
|
75
|
-
private
|
|
140
|
+
private isBinaryFile;
|
|
141
|
+
private searchWithRipgrepStreaming;
|
|
142
|
+
private searchWithGrepStreaming;
|
|
143
|
+
private searchWithPowerShell;
|
|
144
|
+
private searchWithNodeJS;
|
|
76
145
|
/**
|
|
77
|
-
*
|
|
146
|
+
* Recursively collect files from directory
|
|
78
147
|
*/
|
|
79
|
-
|
|
148
|
+
private collectFiles;
|
|
149
|
+
execute(params: GrepSearchParams, cwd: string): Promise<InternalSearchResult & {
|
|
150
|
+
backend: GrepBackend;
|
|
151
|
+
}>;
|
|
80
152
|
}
|
|
81
153
|
export declare const grepSearchTool: Tool;
|
|
154
|
+
export {};
|
|
82
155
|
//# sourceMappingURL=grep-search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grep-search.d.ts","sourceRoot":"","sources":["../../src/tools/grep-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAwB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"grep-search.d.ts","sourceRoot":"","sources":["../../src/tools/grep-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAwB,MAAM,YAAY,CAAC;AAexD,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAClC,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