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
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Warpify Detector Service
|
|
3
|
+
*
|
|
4
|
+
* Detects if the current PTY session has an active warpifiable remote session
|
|
5
|
+
* (SSH, WSL, Docker) by analyzing:
|
|
6
|
+
* 1. The command that started the shell (most reliable)
|
|
7
|
+
* 2. Terminal output patterns (fallback)
|
|
8
|
+
*/
|
|
9
|
+
import stripAnsi from 'strip-ansi';
|
|
10
|
+
/**
|
|
11
|
+
* SSH command patterns - detect based on the shell command
|
|
12
|
+
*/
|
|
13
|
+
const SSH_COMMAND_PATTERNS = [
|
|
14
|
+
// ssh user@host, ssh -p port user@host, ssh -i key user@host
|
|
15
|
+
/^ssh\s+(?:(?:-\w+\s+\S+\s+)*)?(?:(\S+)@)?(\S+)/i,
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* WSL command patterns
|
|
19
|
+
*/
|
|
20
|
+
const WSL_COMMAND_PATTERNS = [
|
|
21
|
+
// wsl, wsl -d distro, wsl --distribution distro
|
|
22
|
+
/^wsl(?:\s+(?:-d|--distribution)\s+(\S+))?/i,
|
|
23
|
+
// bash (when on Windows, often means WSL)
|
|
24
|
+
/^bash$/i,
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* Docker command patterns
|
|
28
|
+
*/
|
|
29
|
+
const DOCKER_COMMAND_PATTERNS = [
|
|
30
|
+
// docker exec -it container bash
|
|
31
|
+
/^docker\s+exec\s+(?:(?:-\w+\s+)*)?(\S+)/i,
|
|
32
|
+
// docker run -it image bash
|
|
33
|
+
/^docker\s+run\s+(?:(?:-\w+(?:\s+\S+)?\s+)*)?(\S+)/i,
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* Detect warpifiable session - PRIMARY METHOD
|
|
37
|
+
* Uses the command that started the shell for reliable detection
|
|
38
|
+
*
|
|
39
|
+
* @param command - The command that started the shell session (e.g., "ssh rohan@localhost")
|
|
40
|
+
* @param output - Optional PTY output for fallback detection
|
|
41
|
+
*/
|
|
42
|
+
export function detectWarpifySession(command, output) {
|
|
43
|
+
// First, try command-based detection (most reliable)
|
|
44
|
+
const commandSession = detectFromCommand(command);
|
|
45
|
+
if (commandSession.type !== 'none') {
|
|
46
|
+
return commandSession;
|
|
47
|
+
}
|
|
48
|
+
// Fallback: try output-based detection
|
|
49
|
+
if (output) {
|
|
50
|
+
const outputSession = detectFromOutput(output);
|
|
51
|
+
if (outputSession.type !== 'none') {
|
|
52
|
+
return outputSession;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
type: 'none',
|
|
57
|
+
detectedFrom: 'none',
|
|
58
|
+
confidence: 'high',
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Detect session type from the shell command
|
|
63
|
+
*/
|
|
64
|
+
function detectFromCommand(command) {
|
|
65
|
+
if (!command) {
|
|
66
|
+
return { type: 'none', detectedFrom: 'none', confidence: 'high' };
|
|
67
|
+
}
|
|
68
|
+
const trimmedCommand = command.trim();
|
|
69
|
+
// Check for SSH command
|
|
70
|
+
for (const pattern of SSH_COMMAND_PATTERNS) {
|
|
71
|
+
const match = trimmedCommand.match(pattern);
|
|
72
|
+
if (match) {
|
|
73
|
+
const user = match[1] || 'user';
|
|
74
|
+
const host = match[2] || 'remote';
|
|
75
|
+
return {
|
|
76
|
+
type: 'ssh',
|
|
77
|
+
connectionString: `${user}@${host}`,
|
|
78
|
+
detectedFrom: 'command',
|
|
79
|
+
confidence: 'high',
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Check for WSL command
|
|
84
|
+
for (const pattern of WSL_COMMAND_PATTERNS) {
|
|
85
|
+
const match = trimmedCommand.match(pattern);
|
|
86
|
+
if (match) {
|
|
87
|
+
const distro = match[1] || 'Ubuntu';
|
|
88
|
+
return {
|
|
89
|
+
type: 'wsl',
|
|
90
|
+
connectionString: distro,
|
|
91
|
+
detectedFrom: 'command',
|
|
92
|
+
confidence: 'high',
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// Check for Docker command
|
|
97
|
+
for (const pattern of DOCKER_COMMAND_PATTERNS) {
|
|
98
|
+
const match = trimmedCommand.match(pattern);
|
|
99
|
+
if (match) {
|
|
100
|
+
const container = match[1]?.substring(0, 12) || 'container';
|
|
101
|
+
return {
|
|
102
|
+
type: 'docker',
|
|
103
|
+
connectionString: container,
|
|
104
|
+
detectedFrom: 'command',
|
|
105
|
+
confidence: 'high',
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return { type: 'none', detectedFrom: 'none', confidence: 'high' };
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Detect session from PTY output (fallback method)
|
|
113
|
+
* Used when the command was not an obvious SSH/WSL/Docker command
|
|
114
|
+
*/
|
|
115
|
+
function detectFromOutput(output) {
|
|
116
|
+
// Strip ANSI codes for reliable pattern matching
|
|
117
|
+
const cleanOutput = stripAnsi(output);
|
|
118
|
+
const recentOutput = getRecentLines(cleanOutput, 30);
|
|
119
|
+
// Check for SSH environment variables (very reliable)
|
|
120
|
+
if (/SSH_CLIENT=|SSH_CONNECTION=|SSH_TTY=/.test(recentOutput)) {
|
|
121
|
+
// Try to extract connection info from prompt
|
|
122
|
+
const promptMatch = recentOutput.match(/([a-zA-Z0-9_-]+)@([a-zA-Z0-9._-]+)/);
|
|
123
|
+
return {
|
|
124
|
+
type: 'ssh',
|
|
125
|
+
connectionString: promptMatch ? `${promptMatch[1]}@${promptMatch[2]}` : undefined,
|
|
126
|
+
detectedFrom: 'env',
|
|
127
|
+
confidence: 'high',
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
// Check for WSL indicators
|
|
131
|
+
if (/\/mnt\/[a-z]\//.test(recentOutput) || /microsoft-standard-WSL/i.test(recentOutput)) {
|
|
132
|
+
const promptMatch = recentOutput.match(/([a-zA-Z0-9_-]+)@([a-zA-Z0-9._-]+)/);
|
|
133
|
+
return {
|
|
134
|
+
type: 'wsl',
|
|
135
|
+
connectionString: promptMatch?.[2] || 'WSL',
|
|
136
|
+
detectedFrom: 'prompt',
|
|
137
|
+
confidence: 'high',
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
// Check for Docker indicators
|
|
141
|
+
if (/docker|container/i.test(recentOutput) || /^[a-f0-9]{12}:/.test(recentOutput)) {
|
|
142
|
+
const containerMatch = recentOutput.match(/@([a-f0-9]{12})/);
|
|
143
|
+
return {
|
|
144
|
+
type: 'docker',
|
|
145
|
+
connectionString: containerMatch?.[1] || 'container',
|
|
146
|
+
detectedFrom: 'prompt',
|
|
147
|
+
confidence: 'medium',
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
return { type: 'none', detectedFrom: 'none', confidence: 'high' };
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Get the last N lines of output
|
|
154
|
+
*/
|
|
155
|
+
function getRecentLines(output, n) {
|
|
156
|
+
const lines = output.split('\n');
|
|
157
|
+
return lines.slice(-n).join('\n');
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Get a human-readable description of the detected session
|
|
161
|
+
*/
|
|
162
|
+
export function getSessionDescription(session) {
|
|
163
|
+
switch (session.type) {
|
|
164
|
+
case 'ssh':
|
|
165
|
+
return session.connectionString
|
|
166
|
+
? `SSH session: ${session.connectionString}`
|
|
167
|
+
: 'SSH session detected';
|
|
168
|
+
case 'wsl':
|
|
169
|
+
return session.connectionString
|
|
170
|
+
? `WSL: ${session.connectionString}`
|
|
171
|
+
: 'WSL session detected';
|
|
172
|
+
case 'docker':
|
|
173
|
+
return session.connectionString
|
|
174
|
+
? `Docker container: ${session.connectionString}`
|
|
175
|
+
: 'Docker session detected';
|
|
176
|
+
default:
|
|
177
|
+
return 'No remote session detected';
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* WarpifyDetector class for stateful detection
|
|
182
|
+
*/
|
|
183
|
+
export class WarpifyDetector {
|
|
184
|
+
lastDetection = null;
|
|
185
|
+
/**
|
|
186
|
+
* Detect warpifiable session
|
|
187
|
+
* @param command - The shell command that started the session
|
|
188
|
+
* @param output - Optional PTY output for fallback detection
|
|
189
|
+
*/
|
|
190
|
+
detect(command, output) {
|
|
191
|
+
const session = detectWarpifySession(command, output);
|
|
192
|
+
this.lastDetection = session;
|
|
193
|
+
return session;
|
|
194
|
+
}
|
|
195
|
+
getLastDetection() {
|
|
196
|
+
return this.lastDetection;
|
|
197
|
+
}
|
|
198
|
+
reset() {
|
|
199
|
+
this.lastDetection = null;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
export const warpifyDetector = new WarpifyDetector();
|
|
203
|
+
//# sourceMappingURL=warpify-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warpify-detector.js","sourceRoot":"","sources":["../../src/services/warpify-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,SAAS,MAAM,YAAY,CAAC;AAWnC;;GAEG;AACH,MAAM,oBAAoB,GAAG;IACzB,6DAA6D;IAC7D,iDAAiD;CACpD,CAAC;AAEF;;GAEG;AACH,MAAM,oBAAoB,GAAG;IACzB,gDAAgD;IAChD,4CAA4C;IAC5C,0CAA0C;IAC1C,SAAS;CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,uBAAuB,GAAG;IAC5B,iCAAiC;IACjC,0CAA0C;IAC1C,4BAA4B;IAC5B,oDAAoD;CACvD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,MAAe;IACjE,qDAAqD;IACrD,MAAM,cAAc,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,cAAc,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACjC,OAAO,cAAc,CAAC;IAC1B,CAAC;IAED,uCAAuC;IACvC,IAAI,MAAM,EAAE,CAAC;QACT,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,aAAa,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAChC,OAAO,aAAa,CAAC;QACzB,CAAC;IACL,CAAC;IAED,OAAO;QACH,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,MAAM;KACrB,CAAC;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qBAAqB,OAAO,CAAC,gBAAgB,EAAE;gBACjD,CAAC,CAAC,yBAAyB,CAAC;QACpC;YACI,OAAO,4BAA4B,CAAC;IAC5C,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,eAAe;IAChB,aAAa,GAA0B,IAAI,CAAC;IAEpD;;;;OAIG;IACH,MAAM,CAAC,OAAe,EAAE,MAAe;QACnC,MAAM,OAAO,GAAG,oBAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAC7B,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,gBAAgB;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,KAAK;QACD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC9B,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Storage Service
|
|
3
|
+
*
|
|
4
|
+
* Handles saving, loading, listing, and deleting workflows.
|
|
5
|
+
* Workflows are stored as JSON files in ~/.centaurus/workflows/
|
|
6
|
+
*/
|
|
7
|
+
import { Workflow, WorkflowMeta, WorkflowStep } from '../types/workflow.js';
|
|
8
|
+
/**
|
|
9
|
+
* Workflow Storage Service
|
|
10
|
+
*/
|
|
11
|
+
export declare class WorkflowStorageService {
|
|
12
|
+
private static instance;
|
|
13
|
+
private constructor();
|
|
14
|
+
/**
|
|
15
|
+
* Get the singleton instance
|
|
16
|
+
*/
|
|
17
|
+
static getInstance(): WorkflowStorageService;
|
|
18
|
+
/**
|
|
19
|
+
* Create a new workflow from steps
|
|
20
|
+
*/
|
|
21
|
+
createWorkflow(name: string, steps: Array<{
|
|
22
|
+
type: 'command' | 'instruction';
|
|
23
|
+
content: string;
|
|
24
|
+
}>, description?: string): Workflow;
|
|
25
|
+
/**
|
|
26
|
+
* Save a workflow to disk
|
|
27
|
+
*/
|
|
28
|
+
save(workflow: Workflow): {
|
|
29
|
+
success: boolean;
|
|
30
|
+
error?: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Load a workflow by name
|
|
34
|
+
*/
|
|
35
|
+
load(name: string): Workflow | null;
|
|
36
|
+
/**
|
|
37
|
+
* Check if a workflow exists
|
|
38
|
+
*/
|
|
39
|
+
exists(name: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* List all workflows (metadata only)
|
|
42
|
+
*/
|
|
43
|
+
list(): WorkflowMeta[];
|
|
44
|
+
/**
|
|
45
|
+
* Delete a workflow by name
|
|
46
|
+
*/
|
|
47
|
+
delete(name: string): {
|
|
48
|
+
success: boolean;
|
|
49
|
+
error?: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Rename a workflow
|
|
53
|
+
*/
|
|
54
|
+
rename(oldName: string, newName: string): {
|
|
55
|
+
success: boolean;
|
|
56
|
+
error?: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Format a workflow for display
|
|
60
|
+
*/
|
|
61
|
+
formatWorkflowForDisplay(workflow: Workflow): string;
|
|
62
|
+
/**
|
|
63
|
+
* Format a workflow step for prompting the AI
|
|
64
|
+
*/
|
|
65
|
+
formatStepForAI(step: WorkflowStep, stepNumber: number, totalSteps: number): string;
|
|
66
|
+
/**
|
|
67
|
+
* Format the entire workflow for the initial AI prompt
|
|
68
|
+
*/
|
|
69
|
+
formatWorkflowForAI(workflow: Workflow): string;
|
|
70
|
+
}
|
|
71
|
+
export declare const workflowStorage: WorkflowStorageService;
|
|
72
|
+
//# sourceMappingURL=workflow-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-storage.d.ts","sourceRoot":"","sources":["../../src/services/workflow-storage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAA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O,MAAM,eAAe,wBAAuC,CAAC"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Storage Service
|
|
3
|
+
*
|
|
4
|
+
* Handles saving, loading, listing, and deleting workflows.
|
|
5
|
+
* Workflows are stored as JSON files in ~/.centaurus/workflows/
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from 'fs';
|
|
8
|
+
import * as path from 'path';
|
|
9
|
+
import * as os from 'os';
|
|
10
|
+
const WORKFLOW_DIR = path.join(os.homedir(), '.centaurus', 'workflows');
|
|
11
|
+
const WORKFLOW_EXT = '.centaurus-flow';
|
|
12
|
+
/**
|
|
13
|
+
* Ensure the workflows directory exists
|
|
14
|
+
*/
|
|
15
|
+
function ensureWorkflowDir() {
|
|
16
|
+
if (!fs.existsSync(WORKFLOW_DIR)) {
|
|
17
|
+
fs.mkdirSync(WORKFLOW_DIR, { recursive: true });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Sanitize workflow name for use as filename
|
|
22
|
+
*/
|
|
23
|
+
function sanitizeName(name) {
|
|
24
|
+
return name
|
|
25
|
+
.toLowerCase()
|
|
26
|
+
.replace(/[^a-z0-9_-]/g, '-')
|
|
27
|
+
.replace(/-+/g, '-')
|
|
28
|
+
.replace(/^-|-$/g, '');
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the file path for a workflow
|
|
32
|
+
*/
|
|
33
|
+
function getWorkflowPath(name) {
|
|
34
|
+
return path.join(WORKFLOW_DIR, `${sanitizeName(name)}${WORKFLOW_EXT}`);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Generate a unique ID for workflows and steps
|
|
38
|
+
*/
|
|
39
|
+
function generateId() {
|
|
40
|
+
return `${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Workflow Storage Service
|
|
44
|
+
*/
|
|
45
|
+
export class WorkflowStorageService {
|
|
46
|
+
static instance;
|
|
47
|
+
constructor() {
|
|
48
|
+
ensureWorkflowDir();
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get the singleton instance
|
|
52
|
+
*/
|
|
53
|
+
static getInstance() {
|
|
54
|
+
if (!WorkflowStorageService.instance) {
|
|
55
|
+
WorkflowStorageService.instance = new WorkflowStorageService();
|
|
56
|
+
}
|
|
57
|
+
return WorkflowStorageService.instance;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Create a new workflow from steps
|
|
61
|
+
*/
|
|
62
|
+
createWorkflow(name, steps, description) {
|
|
63
|
+
const now = new Date().toISOString();
|
|
64
|
+
const workflow = {
|
|
65
|
+
id: generateId(),
|
|
66
|
+
name: name.trim(),
|
|
67
|
+
description,
|
|
68
|
+
steps: steps.map((step, index) => ({
|
|
69
|
+
id: generateId(),
|
|
70
|
+
type: step.type,
|
|
71
|
+
content: step.content,
|
|
72
|
+
order: index
|
|
73
|
+
})),
|
|
74
|
+
createdAt: now,
|
|
75
|
+
updatedAt: now
|
|
76
|
+
};
|
|
77
|
+
return workflow;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Save a workflow to disk
|
|
81
|
+
*/
|
|
82
|
+
save(workflow) {
|
|
83
|
+
try {
|
|
84
|
+
ensureWorkflowDir();
|
|
85
|
+
const filePath = getWorkflowPath(workflow.name);
|
|
86
|
+
// Check if workflow with this name already exists
|
|
87
|
+
if (fs.existsSync(filePath)) {
|
|
88
|
+
// Update the existing workflow's updatedAt
|
|
89
|
+
workflow.updatedAt = new Date().toISOString();
|
|
90
|
+
}
|
|
91
|
+
fs.writeFileSync(filePath, JSON.stringify(workflow, null, 2), 'utf-8');
|
|
92
|
+
return { success: true };
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
return { success: false, error: error.message };
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Load a workflow by name
|
|
100
|
+
*/
|
|
101
|
+
load(name) {
|
|
102
|
+
try {
|
|
103
|
+
const filePath = getWorkflowPath(name);
|
|
104
|
+
if (!fs.existsSync(filePath)) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
108
|
+
return JSON.parse(content);
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Check if a workflow exists
|
|
116
|
+
*/
|
|
117
|
+
exists(name) {
|
|
118
|
+
return fs.existsSync(getWorkflowPath(name));
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* List all workflows (metadata only)
|
|
122
|
+
*/
|
|
123
|
+
list() {
|
|
124
|
+
try {
|
|
125
|
+
ensureWorkflowDir();
|
|
126
|
+
const files = fs.readdirSync(WORKFLOW_DIR).filter(f => f.endsWith(WORKFLOW_EXT));
|
|
127
|
+
const workflows = [];
|
|
128
|
+
for (const file of files) {
|
|
129
|
+
try {
|
|
130
|
+
const filePath = path.join(WORKFLOW_DIR, file);
|
|
131
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
132
|
+
const workflow = JSON.parse(content);
|
|
133
|
+
workflows.push({
|
|
134
|
+
id: workflow.id,
|
|
135
|
+
name: workflow.name,
|
|
136
|
+
description: workflow.description,
|
|
137
|
+
stepCount: workflow.steps.length,
|
|
138
|
+
createdAt: workflow.createdAt,
|
|
139
|
+
updatedAt: workflow.updatedAt
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
// Skip invalid files
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// Sort by most recently updated
|
|
147
|
+
return workflows.sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
return [];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Delete a workflow by name
|
|
155
|
+
*/
|
|
156
|
+
delete(name) {
|
|
157
|
+
try {
|
|
158
|
+
const filePath = getWorkflowPath(name);
|
|
159
|
+
if (!fs.existsSync(filePath)) {
|
|
160
|
+
return { success: false, error: `Workflow '${name}' not found` };
|
|
161
|
+
}
|
|
162
|
+
fs.unlinkSync(filePath);
|
|
163
|
+
return { success: true };
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
return { success: false, error: error.message };
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Rename a workflow
|
|
171
|
+
*/
|
|
172
|
+
rename(oldName, newName) {
|
|
173
|
+
try {
|
|
174
|
+
const workflow = this.load(oldName);
|
|
175
|
+
if (!workflow) {
|
|
176
|
+
return { success: false, error: `Workflow '${oldName}' not found` };
|
|
177
|
+
}
|
|
178
|
+
const newPath = getWorkflowPath(newName);
|
|
179
|
+
if (fs.existsSync(newPath)) {
|
|
180
|
+
return { success: false, error: `Workflow '${newName}' already exists` };
|
|
181
|
+
}
|
|
182
|
+
// Update the workflow name and save to new location
|
|
183
|
+
workflow.name = newName.trim();
|
|
184
|
+
workflow.updatedAt = new Date().toISOString();
|
|
185
|
+
const saveResult = this.save(workflow);
|
|
186
|
+
if (!saveResult.success) {
|
|
187
|
+
return saveResult;
|
|
188
|
+
}
|
|
189
|
+
// Delete the old file
|
|
190
|
+
return this.delete(oldName);
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
return { success: false, error: error.message };
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Format a workflow for display
|
|
198
|
+
*/
|
|
199
|
+
formatWorkflowForDisplay(workflow) {
|
|
200
|
+
let output = `📋 **${workflow.name}**\n`;
|
|
201
|
+
if (workflow.description) {
|
|
202
|
+
output += ` ${workflow.description}\n`;
|
|
203
|
+
}
|
|
204
|
+
output += `\n**Steps (${workflow.steps.length}):**\n`;
|
|
205
|
+
for (const step of workflow.steps) {
|
|
206
|
+
const typeIcon = step.type === 'command' ? '⚡' : '📝';
|
|
207
|
+
const typeLabel = step.type === 'command' ? 'COMMAND' : 'INSTRUCTION';
|
|
208
|
+
output += `\n${step.order + 1}. ${typeIcon} [${typeLabel}]\n`;
|
|
209
|
+
output += ` ${step.content}\n`;
|
|
210
|
+
}
|
|
211
|
+
return output;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Format a workflow step for prompting the AI
|
|
215
|
+
*/
|
|
216
|
+
formatStepForAI(step, stepNumber, totalSteps) {
|
|
217
|
+
const typeLabel = step.type === 'command' ? 'COMMAND' : 'INSTRUCTION';
|
|
218
|
+
return `**Step ${stepNumber} of ${totalSteps} [${typeLabel}]:**\n${step.content}`;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Format the entire workflow for the initial AI prompt
|
|
222
|
+
*/
|
|
223
|
+
formatWorkflowForAI(workflow) {
|
|
224
|
+
let output = `# Workflow: ${workflow.name}\n\n`;
|
|
225
|
+
if (workflow.description) {
|
|
226
|
+
output += `Description: ${workflow.description}\n\n`;
|
|
227
|
+
}
|
|
228
|
+
output += `Total Steps: ${workflow.steps.length}\n\n`;
|
|
229
|
+
output += `## Steps Overview:\n\n`;
|
|
230
|
+
for (const step of workflow.steps) {
|
|
231
|
+
const typeLabel = step.type === 'command' ? 'COMMAND' : 'INSTRUCTION';
|
|
232
|
+
output += `Step ${step.order + 1} [${typeLabel}]: ${step.content}\n`;
|
|
233
|
+
}
|
|
234
|
+
return output;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// Export singleton instance
|
|
238
|
+
export const workflowStorage = WorkflowStorageService.getInstance();
|
|
239
|
+
//# sourceMappingURL=workflow-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-storage.js","sourceRoot":"","sources":["../../src/services/workflow-storage.ts"],"names":[],"mappings":"AAAA;;;;;GA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C,CAAC,aAAa,CAAC;YACtE,MAAM,IAAI,QAAQ,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,SAAS,MAAM,IAAI,CAAC,OAAO,IAAI,CAAC;QACzE,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAED,4BAA4B;AAC5B,MAAM,CAAC,MAAM,eAAe,GAAG,sBAAsB,CAAC,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/tools/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAwClC,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/tools/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAwClC,eAAO,MAAM,cAAc,EAAE,IAmf5B,CAAC"}
|