@sschepis/robodev 1.0.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.
@@ -0,0 +1,215 @@
1
+ // Workspace management system
2
+ // Handles persistent workspace data for complex multi-step tasks
3
+
4
+ import { consoleStyler } from '../ui/console-styler.mjs';
5
+
6
+ export class WorkspaceManager {
7
+ constructor() {
8
+ this.workspace = null;
9
+ this.workspaceActive = false;
10
+ }
11
+
12
+ // Manage workspace operations
13
+ async manageWorkspace(args) {
14
+ const { action, task_goal, current_step, progress_data, next_steps, status } = args;
15
+
16
+ try {
17
+ switch (action) {
18
+ case 'create':
19
+ return this.createWorkspace(task_goal, current_step, progress_data, next_steps, status);
20
+
21
+ case 'update':
22
+ return this.updateWorkspace(current_step, progress_data, next_steps, status);
23
+
24
+ case 'show':
25
+ return this.showWorkspace();
26
+
27
+ case 'clear':
28
+ return this.clearWorkspace();
29
+
30
+ default:
31
+ return `Error: Unknown action '${action}'`;
32
+ }
33
+ } catch (error) {
34
+ return `Error managing workspace: ${error.message}`;
35
+ }
36
+ }
37
+
38
+ // Create a new workspace
39
+ createWorkspace(task_goal, current_step, progress_data, next_steps, status) {
40
+ if (!task_goal) {
41
+ return "Error: task_goal is required for 'create' action";
42
+ }
43
+
44
+ this.workspace = {
45
+ task_goal: task_goal,
46
+ created_at: new Date().toISOString(),
47
+ current_step: current_step || "Starting task",
48
+ progress_data: progress_data || {},
49
+ next_steps: next_steps || [],
50
+ status: status || "in_progress",
51
+ updated_at: new Date().toISOString()
52
+ };
53
+
54
+ this.workspaceActive = true;
55
+ consoleStyler.log('workspace', `Created workspace for: ${task_goal}`);
56
+ return `✓ Workspace created for task: ${task_goal}`;
57
+ }
58
+
59
+ // Update existing workspace
60
+ updateWorkspace(current_step, progress_data, next_steps, status) {
61
+ if (!this.workspace) {
62
+ return "Error: No active workspace to update. Use 'create' first.";
63
+ }
64
+
65
+ if (current_step) this.workspace.current_step = current_step;
66
+ if (progress_data) this.workspace.progress_data = { ...this.workspace.progress_data, ...progress_data };
67
+ if (next_steps) this.workspace.next_steps = next_steps;
68
+ if (status) this.workspace.status = status;
69
+ this.workspace.updated_at = new Date().toISOString();
70
+
71
+ consoleStyler.log('workspace', `Updated workspace: ${current_step || 'progress updated'}`);
72
+ return `✓ Workspace updated: ${current_step || 'Progress data updated'}`;
73
+ }
74
+
75
+ // Show current workspace
76
+ showWorkspace() {
77
+ if (!this.workspace) {
78
+ return "No active workspace";
79
+ }
80
+
81
+ return `Current Workspace:
82
+ • Task: ${this.workspace.task_goal}
83
+ • Status: ${this.workspace.status}
84
+ • Current Step: ${this.workspace.current_step}
85
+ • Progress Data: ${JSON.stringify(this.workspace.progress_data, null, 2)}
86
+ • Next Steps: ${this.workspace.next_steps.join(', ')}
87
+ • Last Updated: ${new Date(this.workspace.updated_at).toLocaleString()}`;
88
+ }
89
+
90
+ // Clear workspace
91
+ clearWorkspace() {
92
+ if (this.workspace) {
93
+ consoleStyler.log('workspace', `Cleared workspace: ${this.workspace.task_goal}`);
94
+ const clearedTask = this.workspace.task_goal;
95
+ this.workspace = null;
96
+ this.workspaceActive = false;
97
+ return `✓ Cleared workspace: ${clearedTask}`;
98
+ } else {
99
+ return "No active workspace to clear";
100
+ }
101
+ }
102
+
103
+ // Get current workspace
104
+ getCurrentWorkspace() {
105
+ return this.workspace;
106
+ }
107
+
108
+ // Check if workspace is active
109
+ isWorkspaceActive() {
110
+ return this.workspaceActive;
111
+ }
112
+
113
+ // Get workspace context for system prompt
114
+ getWorkspaceContext() {
115
+ if (!this.workspace) {
116
+ return null;
117
+ }
118
+
119
+ return {
120
+ task_goal: this.workspace.task_goal,
121
+ current_step: this.workspace.current_step,
122
+ status: this.workspace.status,
123
+ progress_data: this.workspace.progress_data,
124
+ next_steps: this.workspace.next_steps
125
+ };
126
+ }
127
+
128
+ // Update workspace status
129
+ updateStatus(status) {
130
+ if (this.workspace) {
131
+ this.workspace.status = status;
132
+ this.workspace.updated_at = new Date().toISOString();
133
+ consoleStyler.log('workspace', `Status updated to: ${status}`);
134
+ }
135
+ }
136
+
137
+ // Add progress data
138
+ addProgressData(key, value) {
139
+ if (this.workspace) {
140
+ this.workspace.progress_data[key] = value;
141
+ this.workspace.updated_at = new Date().toISOString();
142
+ consoleStyler.log('workspace', `Added progress data: ${key}`);
143
+ }
144
+ }
145
+
146
+ // Update next steps
147
+ updateNextSteps(steps) {
148
+ if (this.workspace) {
149
+ this.workspace.next_steps = steps;
150
+ this.workspace.updated_at = new Date().toISOString();
151
+ consoleStyler.log('workspace', `Updated next steps (${steps.length} items)`);
152
+ }
153
+ }
154
+
155
+ // Set current step
156
+ setCurrentStep(step) {
157
+ if (this.workspace) {
158
+ this.workspace.current_step = step;
159
+ this.workspace.updated_at = new Date().toISOString();
160
+ consoleStyler.log('workspace', `Current step: ${step}`);
161
+ }
162
+ }
163
+
164
+ // Get workspace summary for logging
165
+ getWorkspaceSummary() {
166
+ if (!this.workspace) {
167
+ return "No active workspace";
168
+ }
169
+
170
+ return `${this.workspace.task_goal} (${this.workspace.status}) - ${this.workspace.current_step}`;
171
+ }
172
+
173
+ // Save workspace to a file
174
+ async save(filePath) {
175
+ if (!this.workspaceActive || !this.workspace) {
176
+ return false;
177
+ }
178
+
179
+ try {
180
+ const fs = await import('fs');
181
+ const data = {
182
+ timestamp: new Date().toISOString(),
183
+ workspace: this.workspace,
184
+ workspaceActive: this.workspaceActive
185
+ };
186
+ fs.writeFileSync(filePath, JSON.stringify(data, null, 2), 'utf8');
187
+ return true;
188
+ } catch (error) {
189
+ consoleStyler.log('error', `Failed to save workspace: ${error.message}`);
190
+ return false;
191
+ }
192
+ }
193
+
194
+ // Load workspace from a file
195
+ async load(filePath) {
196
+ try {
197
+ const fs = await import('fs');
198
+ if (!fs.existsSync(filePath)) {
199
+ return false;
200
+ }
201
+
202
+ const data = JSON.parse(fs.readFileSync(filePath, 'utf8'));
203
+
204
+ if (data.workspace) {
205
+ this.workspace = data.workspace;
206
+ this.workspaceActive = data.workspaceActive !== false;
207
+ return true;
208
+ }
209
+ return false;
210
+ } catch (error) {
211
+ consoleStyler.log('error', `Failed to load workspace: ${error.message}`);
212
+ return false;
213
+ }
214
+ }
215
+ }
package/themes.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "cyberpunk": {
3
+ "primary": ["#ff0080", "#7928ca", "#0070f3"],
4
+ "secondary": ["#00d4ff", "#0070f3"],
5
+ "success": ["#00ff88", "#00d4aa"],
6
+ "warning": ["#ffaa00", "#ff6b35"],
7
+ "error": ["#ff4757", "#c44569"],
8
+ "info": ["#5352ed", "#3742fa"],
9
+ "system": ["#747d8c", "#57606f"],
10
+ "accent": ["#ffa502", "#ff6348"],
11
+ "todo": ["#ff6b9d", "#c44569"],
12
+ "workspace": ["#6c5ce7", "#a29bfe"],
13
+ "tools": ["#00cec9", "#00b894"],
14
+ "reasoning": ["#fd79a8", "#e84393"],
15
+ "quality": ["#fdcb6e", "#e17055"],
16
+ "progress": ["#74b9ff", "#0984e3"]
17
+ },
18
+ "ocean": {
19
+ "primary": ["#667eea", "#764ba2"],
20
+ "secondary": ["#30e8bf", "#ff8235"],
21
+ "success": ["#4ecdc4", "#26d0ce"],
22
+ "warning": ["#f9ca24", "#f0932b"],
23
+ "error": ["#eb4d4b", "#c44569"],
24
+ "info": ["#6c5ce7", "#74b9ff"],
25
+ "system": ["#636e72", "#2d3436"],
26
+ "accent": ["#00b894", "#00cec9"],
27
+ "todo": ["#a29bfe", "#6c5ce7"],
28
+ "workspace": ["#fd79a8", "#fdcb6e"],
29
+ "tools": ["#00cec9", "#55a3ff"],
30
+ "reasoning": ["#fd79a8", "#fdcb6e"],
31
+ "quality": ["#fdcb6e", "#f0932b"],
32
+ "progress": ["#74b9ff", "#0984e3"]
33
+ },
34
+ "sunset": {
35
+ "primary": ["#fa709a", "#fee140"],
36
+ "secondary": ["#a8edea", "#fed6e3"],
37
+ "success": ["#d299c2", "#fef9d7"],
38
+ "warning": ["#fc4a1a", "#f7b733"],
39
+ "error": ["#fc4a1a", "#cf6679"],
40
+ "info": ["#667eea", "#764ba2"],
41
+ "system": ["#bdc3c7", "#2c3e50"],
42
+ "accent": ["#f093fb", "#f5576c"],
43
+ "todo": ["#f093fb", "#f5576c"],
44
+ "workspace": ["#4facfe", "#00f2fe"],
45
+ "tools": ["#43e97b", "#38f9d7"],
46
+ "reasoning": ["#fa709a", "#fee140"],
47
+ "quality": ["#f7b733", "#fc4a1a"],
48
+ "progress": ["#667eea", "#764ba2"]
49
+ },
50
+ "matrix": {
51
+ "primary": ["#00ff41", "#00d4aa"],
52
+ "secondary": ["#39ff14", "#00ff88"],
53
+ "success": ["#00ff88", "#39ff14"],
54
+ "warning": ["#ffff00", "#fff200"],
55
+ "error": ["#ff0040", "#ff4757"],
56
+ "info": ["#00ffff", "#00d4ff"],
57
+ "system": ["#808080", "#404040"],
58
+ "accent": ["#ff6b35", "#f9ca24"],
59
+ "todo": ["#00ff88", "#39ff14"],
60
+ "workspace": ["#00d4ff", "#0070f3"],
61
+ "tools": ["#39ff14", "#00ff88"],
62
+ "reasoning": ["#00ffff", "#39ff14"],
63
+ "quality": ["#fff200", "#ffff00"],
64
+ "progress": ["#00ff41", "#00d4aa"]
65
+ }
66
+ }