@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.
- package/ai.mjs +8 -0
- package/package.json +48 -0
- package/src/cli/cli-interface.mjs +271 -0
- package/src/config.mjs +64 -0
- package/src/core/ai-assistant.mjs +540 -0
- package/src/core/ai-provider.mjs +579 -0
- package/src/core/history-manager.mjs +330 -0
- package/src/core/system-prompt.mjs +182 -0
- package/src/custom-tools/custom-tools-manager.mjs +310 -0
- package/src/execution/tool-executor.mjs +892 -0
- package/src/lib/README.md +114 -0
- package/src/lib/adapters/console-status-adapter.mjs +48 -0
- package/src/lib/adapters/network-llm-adapter.mjs +37 -0
- package/src/lib/index.mjs +101 -0
- package/src/lib/interfaces.d.ts +98 -0
- package/src/main.mjs +61 -0
- package/src/package/package-manager.mjs +223 -0
- package/src/quality/code-validator.mjs +126 -0
- package/src/quality/quality-evaluator.mjs +248 -0
- package/src/reasoning/reasoning-system.mjs +258 -0
- package/src/structured-dev/flow-manager.mjs +321 -0
- package/src/structured-dev/implementation-planner.mjs +223 -0
- package/src/structured-dev/manifest-manager.mjs +423 -0
- package/src/structured-dev/plan-executor.mjs +113 -0
- package/src/structured-dev/project-bootstrapper.mjs +523 -0
- package/src/tools/desktop-automation-tools.mjs +172 -0
- package/src/tools/file-tools.mjs +141 -0
- package/src/tools/tool-definitions.mjs +872 -0
- package/src/ui/console-styler.mjs +503 -0
- package/src/workspace/workspace-manager.mjs +215 -0
- package/themes.json +66 -0
|
@@ -0,0 +1,872 @@
|
|
|
1
|
+
// Tool definitions for the AI assistant
|
|
2
|
+
// This module contains all the built-in tool schemas used by the AI
|
|
3
|
+
|
|
4
|
+
export const CORE_TOOLS = [
|
|
5
|
+
{
|
|
6
|
+
type: "function",
|
|
7
|
+
function: {
|
|
8
|
+
name: "execute_javascript",
|
|
9
|
+
description: "Executes a string of JavaScript code using eval(). Use this for simple calculations or for writing complex scripts that compose multiple functions or packages. You can specify dependent npm packages that must be installed. Optionally save useful code as a reusable tool.",
|
|
10
|
+
parameters: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {
|
|
13
|
+
code: {
|
|
14
|
+
type: "string",
|
|
15
|
+
description: "The JavaScript code to execute. Must be an async IIFE (Immediately Invoked Function Expression) if it uses imports, e.g., (async () => { const axios = await import('axios'); /* ... */ })();",
|
|
16
|
+
},
|
|
17
|
+
npm_packages: {
|
|
18
|
+
type: "array",
|
|
19
|
+
description: "An optional array of npm package names that need to be installed before the script is run (e.g., ['axios', 'chalk']).",
|
|
20
|
+
items: {
|
|
21
|
+
type: "string"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
save_as_tool: {
|
|
25
|
+
type: "boolean",
|
|
26
|
+
description: "Whether to save this code as a reusable tool for future use.",
|
|
27
|
+
default: false
|
|
28
|
+
},
|
|
29
|
+
tool_name: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Name for the tool (snake_case, e.g. 'get_weather'). Required if save_as_tool is true."
|
|
32
|
+
},
|
|
33
|
+
tool_description: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "Description of what this tool does. Required if save_as_tool is true."
|
|
36
|
+
},
|
|
37
|
+
tool_category: {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Category for the tool (e.g. 'file', 'web', 'data', 'utility'). Optional.",
|
|
40
|
+
default: "utility"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
required: ["code"],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type: "function",
|
|
49
|
+
function: {
|
|
50
|
+
name: "execute_npm_function",
|
|
51
|
+
description: "Dynamically installs an npm package if needed, imports it, and executes a specific function from it with given arguments. Use this for single, specific package functions.",
|
|
52
|
+
parameters: {
|
|
53
|
+
type: "object",
|
|
54
|
+
properties: {
|
|
55
|
+
packageName: {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "The name of the npm package to use (e.g., 'axios', 'uuid').",
|
|
58
|
+
},
|
|
59
|
+
functionName: {
|
|
60
|
+
type: "string",
|
|
61
|
+
description: "The name of the function to call from the package (e.g., 'get', 'v4'). If the package itself is a function, use 'default'.",
|
|
62
|
+
},
|
|
63
|
+
args: {
|
|
64
|
+
type: "array",
|
|
65
|
+
description: "An array of arguments to pass to the function.",
|
|
66
|
+
items: {
|
|
67
|
+
type: "any"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
required: ["packageName", "functionName", "args"],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
export const WORKFLOW_TOOLS = [
|
|
78
|
+
{
|
|
79
|
+
type: "function",
|
|
80
|
+
function: {
|
|
81
|
+
name: "create_todo_list",
|
|
82
|
+
description: "Creates a todo list for complex tasks that need to be broken down into steps. Use this when a user request requires multiple sequential actions.",
|
|
83
|
+
parameters: {
|
|
84
|
+
type: "object",
|
|
85
|
+
properties: {
|
|
86
|
+
task_description: {
|
|
87
|
+
type: "string",
|
|
88
|
+
description: "Brief description of the overall task."
|
|
89
|
+
},
|
|
90
|
+
todos: {
|
|
91
|
+
type: "array",
|
|
92
|
+
description: "Array of todo items in execution order.",
|
|
93
|
+
items: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
step: {
|
|
97
|
+
type: "string",
|
|
98
|
+
description: "Description of this step."
|
|
99
|
+
},
|
|
100
|
+
status: {
|
|
101
|
+
type: "string",
|
|
102
|
+
enum: ["pending", "in_progress", "completed"],
|
|
103
|
+
description: "Status of this step."
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
required: ["step", "status"]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
required: ["task_description", "todos"],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: "function",
|
|
116
|
+
function: {
|
|
117
|
+
name: "update_todo_status",
|
|
118
|
+
description: "Updates the status of a todo item and moves to the next step if completed.",
|
|
119
|
+
parameters: {
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {
|
|
122
|
+
step_index: {
|
|
123
|
+
type: "number",
|
|
124
|
+
description: "Zero-based index of the step to update."
|
|
125
|
+
},
|
|
126
|
+
status: {
|
|
127
|
+
type: "string",
|
|
128
|
+
enum: ["pending", "in_progress", "completed"],
|
|
129
|
+
description: "New status for this step."
|
|
130
|
+
},
|
|
131
|
+
result: {
|
|
132
|
+
type: "string",
|
|
133
|
+
description: "Brief result or outcome of completing this step."
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
required: ["step_index", "status"],
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
}
|
|
140
|
+
];
|
|
141
|
+
|
|
142
|
+
export const RECOVERY_TOOLS = [
|
|
143
|
+
{
|
|
144
|
+
type: "function",
|
|
145
|
+
function: {
|
|
146
|
+
name: "analyze_and_recover",
|
|
147
|
+
description: "Analyzes the last error and attempts recovery with alternative approaches.",
|
|
148
|
+
parameters: {
|
|
149
|
+
type: "object",
|
|
150
|
+
properties: {
|
|
151
|
+
error_message: {
|
|
152
|
+
type: "string",
|
|
153
|
+
description: "The error message to analyze."
|
|
154
|
+
},
|
|
155
|
+
failed_approach: {
|
|
156
|
+
type: "string",
|
|
157
|
+
description: "Description of what was attempted that failed."
|
|
158
|
+
},
|
|
159
|
+
recovery_strategy: {
|
|
160
|
+
type: "string",
|
|
161
|
+
enum: ["retry_with_alternative", "simplify_approach", "change_method", "install_dependencies", "fix_syntax"],
|
|
162
|
+
description: "The recovery strategy to attempt."
|
|
163
|
+
},
|
|
164
|
+
alternative_code: {
|
|
165
|
+
type: "string",
|
|
166
|
+
description: "Alternative code to try if using retry_with_alternative strategy.",
|
|
167
|
+
required: false
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
required: ["error_message", "failed_approach", "recovery_strategy"],
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
}
|
|
174
|
+
];
|
|
175
|
+
|
|
176
|
+
export const ENHANCEMENT_TOOLS = [
|
|
177
|
+
{
|
|
178
|
+
type: "function",
|
|
179
|
+
function: {
|
|
180
|
+
name: "embellish_request",
|
|
181
|
+
description: "Takes a user's high-level request and rewrites it with specific technical implementation details, tools, and methodologies needed to accomplish the task. Also predicts the appropriate reasoning effort level.",
|
|
182
|
+
parameters: {
|
|
183
|
+
type: "object",
|
|
184
|
+
properties: {
|
|
185
|
+
original_request: {
|
|
186
|
+
type: "string",
|
|
187
|
+
description: "The user's original request."
|
|
188
|
+
},
|
|
189
|
+
embellished_request: {
|
|
190
|
+
type: "string",
|
|
191
|
+
description: "Detailed technical rewrite specifying exact tools, methods, libraries, file formats, data structures, and step-by-step approach needed."
|
|
192
|
+
},
|
|
193
|
+
technical_requirements: {
|
|
194
|
+
type: "array",
|
|
195
|
+
description: "List of specific technical requirements identified.",
|
|
196
|
+
items: {
|
|
197
|
+
type: "string"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
reasoning_effort: {
|
|
201
|
+
type: "string",
|
|
202
|
+
enum: ["low", "medium", "high"],
|
|
203
|
+
description: "Predicted reasoning effort needed based on: 'low' for simple/quick tasks, 'medium' for standard implementation, 'high' for complex analysis/debugging. Respect user preferences like 'quickly' (low) or 'thoroughly' (high)."
|
|
204
|
+
},
|
|
205
|
+
reasoning_justification: {
|
|
206
|
+
type: "string",
|
|
207
|
+
description: "Brief explanation of why this reasoning level was chosen, considering task complexity and user preferences."
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
required: ["original_request", "embellished_request", "technical_requirements", "reasoning_effort", "reasoning_justification"],
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
type: "function",
|
|
216
|
+
function: {
|
|
217
|
+
name: "evaluate_response_quality",
|
|
218
|
+
description: "Evaluates whether the AI's response appropriately addresses the user's original query and resembles what a typical, helpful response should look like.",
|
|
219
|
+
parameters: {
|
|
220
|
+
type: "object",
|
|
221
|
+
properties: {
|
|
222
|
+
original_query: {
|
|
223
|
+
type: "string",
|
|
224
|
+
description: "The user's original request/question."
|
|
225
|
+
},
|
|
226
|
+
ai_response: {
|
|
227
|
+
type: "string",
|
|
228
|
+
description: "The AI's generated response to evaluate."
|
|
229
|
+
},
|
|
230
|
+
quality_rating: {
|
|
231
|
+
type: "number",
|
|
232
|
+
minimum: 1,
|
|
233
|
+
maximum: 10,
|
|
234
|
+
description: "Quality rating from 1-10 where 10 = perfect response that fully addresses the query, 1 = completely inappropriate/unhelpful response."
|
|
235
|
+
},
|
|
236
|
+
evaluation_reasoning: {
|
|
237
|
+
type: "string",
|
|
238
|
+
description: "Brief explanation of why this rating was given."
|
|
239
|
+
},
|
|
240
|
+
remedy_suggestion: {
|
|
241
|
+
type: "string",
|
|
242
|
+
description: "If rating < 4, specific suggestion on how to improve the response or what should be done differently."
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
required: ["original_query", "ai_response", "quality_rating", "evaluation_reasoning"],
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
}
|
|
249
|
+
];
|
|
250
|
+
|
|
251
|
+
export const TTS_TOOLS = [
|
|
252
|
+
{
|
|
253
|
+
type: "function",
|
|
254
|
+
function: {
|
|
255
|
+
name: "speak_text",
|
|
256
|
+
description: "Converts text to speech using ElevenLabs and plays it aloud. Use this when the user asks to hear the response spoken or wants text-to-speech.",
|
|
257
|
+
parameters: {
|
|
258
|
+
type: "object",
|
|
259
|
+
properties: {
|
|
260
|
+
text: {
|
|
261
|
+
type: "string",
|
|
262
|
+
description: "The text to convert to speech. Should be clean text without markdown formatting."
|
|
263
|
+
},
|
|
264
|
+
voice_id: {
|
|
265
|
+
type: "string",
|
|
266
|
+
description: "ElevenLabs voice ID to use. Default is 'tQ4MEZFJOzsahSEEZtHK'.",
|
|
267
|
+
default: "tQ4MEZFJOzsahSEEZtHK"
|
|
268
|
+
},
|
|
269
|
+
stability: {
|
|
270
|
+
type: "number",
|
|
271
|
+
description: "Voice stability (0.0-1.0). Higher values = more stable. Default: 0.5",
|
|
272
|
+
minimum: 0.0,
|
|
273
|
+
maximum: 1.0,
|
|
274
|
+
default: 0.5
|
|
275
|
+
},
|
|
276
|
+
similarity_boost: {
|
|
277
|
+
type: "number",
|
|
278
|
+
description: "Similarity boost (0.0-1.0). Higher values = more similar to original voice. Default: 0.75",
|
|
279
|
+
minimum: 0.0,
|
|
280
|
+
maximum: 1.0,
|
|
281
|
+
default: 0.75
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
required: ["text"],
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
}
|
|
288
|
+
];
|
|
289
|
+
|
|
290
|
+
export const CUSTOM_TOOL_MANAGEMENT = [
|
|
291
|
+
{
|
|
292
|
+
type: "function",
|
|
293
|
+
function: {
|
|
294
|
+
name: "list_custom_tools",
|
|
295
|
+
description: "List all custom tools that have been created and saved, with optional filtering by category",
|
|
296
|
+
parameters: {
|
|
297
|
+
type: "object",
|
|
298
|
+
properties: {
|
|
299
|
+
category: {
|
|
300
|
+
type: "string",
|
|
301
|
+
description: "Filter tools by category (optional)"
|
|
302
|
+
},
|
|
303
|
+
show_usage: {
|
|
304
|
+
type: "boolean",
|
|
305
|
+
description: "Include usage statistics in the output",
|
|
306
|
+
default: false
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
type: "function",
|
|
314
|
+
function: {
|
|
315
|
+
name: "remove_custom_tool",
|
|
316
|
+
description: "Remove a custom tool from the toolbox permanently",
|
|
317
|
+
parameters: {
|
|
318
|
+
type: "object",
|
|
319
|
+
properties: {
|
|
320
|
+
tool_name: {
|
|
321
|
+
type: "string",
|
|
322
|
+
description: "Name of the tool to remove"
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
required: ["tool_name"]
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
type: "function",
|
|
331
|
+
function: {
|
|
332
|
+
name: "export_tools",
|
|
333
|
+
description: "Export custom tools to a shareable JSON file",
|
|
334
|
+
parameters: {
|
|
335
|
+
type: "object",
|
|
336
|
+
properties: {
|
|
337
|
+
output_file: {
|
|
338
|
+
type: "string",
|
|
339
|
+
description: "Path where to save the exported tools file"
|
|
340
|
+
},
|
|
341
|
+
tools: {
|
|
342
|
+
type: "array",
|
|
343
|
+
description: "Specific tools to export (exports all if not specified)",
|
|
344
|
+
items: { type: "string" }
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
];
|
|
351
|
+
|
|
352
|
+
export const WORKSPACE_TOOLS = [
|
|
353
|
+
{
|
|
354
|
+
type: "function",
|
|
355
|
+
function: {
|
|
356
|
+
name: "manage_workspace",
|
|
357
|
+
description: "Create, update, or clear persistent workspace data for complex multi-step tasks. Use this to maintain context across retries and quality evaluations.",
|
|
358
|
+
parameters: {
|
|
359
|
+
type: "object",
|
|
360
|
+
properties: {
|
|
361
|
+
action: {
|
|
362
|
+
type: "string",
|
|
363
|
+
enum: ["create", "update", "clear", "show"],
|
|
364
|
+
description: "Action to perform: create new workspace, update existing, clear workspace, or show current workspace"
|
|
365
|
+
},
|
|
366
|
+
task_goal: {
|
|
367
|
+
type: "string",
|
|
368
|
+
description: "The main goal/objective of the current task (required for 'create')"
|
|
369
|
+
},
|
|
370
|
+
current_step: {
|
|
371
|
+
type: "string",
|
|
372
|
+
description: "Description of the current step being worked on"
|
|
373
|
+
},
|
|
374
|
+
progress_data: {
|
|
375
|
+
type: "object",
|
|
376
|
+
description: "Data collected so far (files found, analysis results, etc.)"
|
|
377
|
+
},
|
|
378
|
+
next_steps: {
|
|
379
|
+
type: "array",
|
|
380
|
+
description: "Planned next steps",
|
|
381
|
+
items: { type: "string" }
|
|
382
|
+
},
|
|
383
|
+
status: {
|
|
384
|
+
type: "string",
|
|
385
|
+
enum: ["in_progress", "completed", "failed"],
|
|
386
|
+
description: "Current status of the task"
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
required: ["action"]
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
];
|
|
394
|
+
|
|
395
|
+
export const STRUCTURED_DEV_TOOLS = [
|
|
396
|
+
{
|
|
397
|
+
type: "function",
|
|
398
|
+
function: {
|
|
399
|
+
name: "init_structured_dev",
|
|
400
|
+
description: "Initializes the Structured Development process by creating a SYSTEM_MAP.md manifest. If a DESIGN.md or ARCHITECTURE.md exists in the target directory, it will pre-populate the manifest with extracted features and constraints.",
|
|
401
|
+
parameters: {
|
|
402
|
+
type: "object",
|
|
403
|
+
properties: {
|
|
404
|
+
target_dir: {
|
|
405
|
+
type: "string",
|
|
406
|
+
description: "Optional target directory to initialize in. Defaults to current working directory. If a design document exists here, features and invariants will be extracted automatically."
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
required: []
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
type: "function",
|
|
415
|
+
function: {
|
|
416
|
+
name: "bootstrap_project",
|
|
417
|
+
description: "Initializes structured development in a target directory by discovering and parsing a design document (DESIGN.md, ARCHITECTURE.md, or README.md). Extracts features, invariants, and constraints to pre-populate the SYSTEM_MAP.md manifest, effectively pre-loading the structured development process with the provided design.",
|
|
418
|
+
parameters: {
|
|
419
|
+
type: "object",
|
|
420
|
+
properties: {
|
|
421
|
+
target_dir: {
|
|
422
|
+
type: "string",
|
|
423
|
+
description: "Path to the project directory to bootstrap. Defaults to current working directory."
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
required: []
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
type: "function",
|
|
432
|
+
function: {
|
|
433
|
+
name: "submit_technical_design",
|
|
434
|
+
description: "Submits a technical design document. This transitions the feature to the 'Design Review' phase.",
|
|
435
|
+
parameters: {
|
|
436
|
+
type: "object",
|
|
437
|
+
properties: {
|
|
438
|
+
feature_id: {
|
|
439
|
+
type: "string",
|
|
440
|
+
description: "ID of the feature being designed (e.g., FEAT-001)"
|
|
441
|
+
},
|
|
442
|
+
design_doc: {
|
|
443
|
+
type: "string",
|
|
444
|
+
description: "The comprehensive technical design document content"
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
required: ["feature_id", "design_doc"]
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
type: "function",
|
|
453
|
+
function: {
|
|
454
|
+
name: "approve_design",
|
|
455
|
+
description: "Approves a feature's design, moving it from 'Design Review' to 'Interface' phase. This step confirms that the user is satisfied with the proposed design.",
|
|
456
|
+
parameters: {
|
|
457
|
+
type: "object",
|
|
458
|
+
properties: {
|
|
459
|
+
feature_id: {
|
|
460
|
+
type: "string",
|
|
461
|
+
description: "ID of the feature to approve"
|
|
462
|
+
},
|
|
463
|
+
feedback: {
|
|
464
|
+
type: "string",
|
|
465
|
+
description: "Optional feedback or notes about the approval"
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
required: ["feature_id"]
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
type: "function",
|
|
474
|
+
function: {
|
|
475
|
+
name: "lock_interfaces",
|
|
476
|
+
description: "Locks the API signatures and type definitions (Phase II). Validates that all interfaces have JSDoc documentation. Once locked, these cannot be changed without a formal refactor process.",
|
|
477
|
+
parameters: {
|
|
478
|
+
type: "object",
|
|
479
|
+
properties: {
|
|
480
|
+
feature_id: {
|
|
481
|
+
type: "string",
|
|
482
|
+
description: "ID of the feature"
|
|
483
|
+
},
|
|
484
|
+
interface_definitions: {
|
|
485
|
+
type: "string",
|
|
486
|
+
description: "The type definitions (e.g., contents of a .d.ts file). Must include JSDoc comments."
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
required: ["feature_id", "interface_definitions"]
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
type: "function",
|
|
495
|
+
function: {
|
|
496
|
+
name: "submit_critique",
|
|
497
|
+
description: "Submits a mandatory self-critique (Phase III) identifying at least 3 flaws before final implementation.",
|
|
498
|
+
parameters: {
|
|
499
|
+
type: "object",
|
|
500
|
+
properties: {
|
|
501
|
+
feature_id: {
|
|
502
|
+
type: "string",
|
|
503
|
+
description: "ID of the feature"
|
|
504
|
+
},
|
|
505
|
+
critique: {
|
|
506
|
+
type: "string",
|
|
507
|
+
description: "The critique identifying at least 3 potential flaws"
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
required: ["feature_id", "critique"]
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
type: "function",
|
|
516
|
+
function: {
|
|
517
|
+
name: "read_manifest",
|
|
518
|
+
description: "Reads the current SYSTEM_MAP.md manifest to understand global invariants, feature status, and dependency graph.",
|
|
519
|
+
parameters: {
|
|
520
|
+
type: "object",
|
|
521
|
+
properties: {},
|
|
522
|
+
required: []
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
type: "function",
|
|
528
|
+
function: {
|
|
529
|
+
name: "create_implementation_plan",
|
|
530
|
+
description: "Analyzes the SYSTEM_MAP.md to generate a parallel execution plan based on feature dependencies. Outputs a JSON plan file.",
|
|
531
|
+
parameters: {
|
|
532
|
+
type: "object",
|
|
533
|
+
properties: {
|
|
534
|
+
output_file: {
|
|
535
|
+
type: "string",
|
|
536
|
+
description: "Path to save the plan JSON file (default: implementation-plan.json)"
|
|
537
|
+
},
|
|
538
|
+
num_developers: {
|
|
539
|
+
type: "number",
|
|
540
|
+
description: "Number of concurrent developers/agents to schedule for (default: 3).",
|
|
541
|
+
default: 3
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
required: []
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
type: "function",
|
|
550
|
+
function: {
|
|
551
|
+
name: "execute_implementation_plan",
|
|
552
|
+
description: "Executes a multi-agent implementation plan. Spawns concurrent AI agents to implement features in parallel according to the plan.",
|
|
553
|
+
parameters: {
|
|
554
|
+
type: "object",
|
|
555
|
+
properties: {
|
|
556
|
+
plan_file: {
|
|
557
|
+
type: "string",
|
|
558
|
+
description: "Path to the plan JSON file to execute (default: implementation-plan.json)"
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
required: []
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
type: "function",
|
|
567
|
+
function: {
|
|
568
|
+
name: "visualize_architecture",
|
|
569
|
+
description: "Generates a Mermaid JS Flowchart syntax representing the system's architecture and dependencies based on the manifest.",
|
|
570
|
+
parameters: {
|
|
571
|
+
type: "object",
|
|
572
|
+
properties: {},
|
|
573
|
+
required: []
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
type: "function",
|
|
579
|
+
function: {
|
|
580
|
+
name: "rollback_to_snapshot",
|
|
581
|
+
description: "Restores the system manifest (SYSTEM_MAP.md) to a previous state from a snapshot.",
|
|
582
|
+
parameters: {
|
|
583
|
+
type: "object",
|
|
584
|
+
properties: {
|
|
585
|
+
snapshot_id: {
|
|
586
|
+
type: "string",
|
|
587
|
+
description: "The filename or partial identifier of the snapshot to restore (e.g. 'SYSTEM_MAP.2023-10-27T10-00-00-000Z.md' or just the timestamp part)"
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
required: ["snapshot_id"]
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
];
|
|
595
|
+
|
|
596
|
+
export const RECURSIVE_TOOLS = [
|
|
597
|
+
{
|
|
598
|
+
type: "function",
|
|
599
|
+
function: {
|
|
600
|
+
name: "call_ai_assistant",
|
|
601
|
+
description: "Recursively calls the AI assistant to handle a sub-task or specialized query. Useful for breaking down complex problems or getting specialized analysis. Maximum recursion depth is 3 levels.",
|
|
602
|
+
parameters: {
|
|
603
|
+
type: "object",
|
|
604
|
+
properties: {
|
|
605
|
+
query: {
|
|
606
|
+
type: "string",
|
|
607
|
+
description: "The specific query or task to send to the recursive AI assistant"
|
|
608
|
+
},
|
|
609
|
+
context: {
|
|
610
|
+
type: "string",
|
|
611
|
+
description: "Additional context about why this recursive call is needed and how it relates to the main task"
|
|
612
|
+
},
|
|
613
|
+
recursion_level: {
|
|
614
|
+
type: "number",
|
|
615
|
+
description: "Current recursion level (automatically managed, do not set manually)",
|
|
616
|
+
default: 0
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
required: ["query", "context"]
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
];
|
|
624
|
+
|
|
625
|
+
export const WEB_TOOLS = [
|
|
626
|
+
{
|
|
627
|
+
type: "function",
|
|
628
|
+
function: {
|
|
629
|
+
name: "search_web",
|
|
630
|
+
description: "Searches the web using Serper.dev API to find current information, news, or answer questions that require up-to-date data. Provides comprehensive search results with snippets and links.",
|
|
631
|
+
parameters: {
|
|
632
|
+
type: "object",
|
|
633
|
+
properties: {
|
|
634
|
+
query: {
|
|
635
|
+
type: "string",
|
|
636
|
+
description: "The search query to find information on the web"
|
|
637
|
+
},
|
|
638
|
+
type: {
|
|
639
|
+
type: "string",
|
|
640
|
+
enum: ["search", "news", "images", "videos", "places", "shopping"],
|
|
641
|
+
description: "Type of search to perform",
|
|
642
|
+
default: "search"
|
|
643
|
+
},
|
|
644
|
+
num: {
|
|
645
|
+
type: "number",
|
|
646
|
+
description: "Number of results to return (1-100)",
|
|
647
|
+
minimum: 1,
|
|
648
|
+
maximum: 100,
|
|
649
|
+
default: 10
|
|
650
|
+
},
|
|
651
|
+
location: {
|
|
652
|
+
type: "string",
|
|
653
|
+
description: "Geographic location for localized results (e.g., 'New York, NY, USA')"
|
|
654
|
+
},
|
|
655
|
+
lang: {
|
|
656
|
+
type: "string",
|
|
657
|
+
description: "Language code for results (e.g., 'en', 'es', 'fr')",
|
|
658
|
+
default: "en"
|
|
659
|
+
},
|
|
660
|
+
safe: {
|
|
661
|
+
type: "string",
|
|
662
|
+
enum: ["active", "off"],
|
|
663
|
+
description: "Safe search setting",
|
|
664
|
+
default: "active"
|
|
665
|
+
}
|
|
666
|
+
},
|
|
667
|
+
required: ["query"]
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
];
|
|
672
|
+
|
|
673
|
+
export const FILE_TOOLS = [
|
|
674
|
+
{
|
|
675
|
+
type: "function",
|
|
676
|
+
function: {
|
|
677
|
+
name: "read_file",
|
|
678
|
+
description: "Reads content from a file within the workspace.",
|
|
679
|
+
parameters: {
|
|
680
|
+
type: "object",
|
|
681
|
+
properties: {
|
|
682
|
+
path: {
|
|
683
|
+
type: "string",
|
|
684
|
+
description: "Relative path to the file to read"
|
|
685
|
+
},
|
|
686
|
+
encoding: {
|
|
687
|
+
type: "string",
|
|
688
|
+
description: "File encoding (default: utf8)",
|
|
689
|
+
default: "utf8"
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
required: ["path"]
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
type: "function",
|
|
698
|
+
function: {
|
|
699
|
+
name: "write_file",
|
|
700
|
+
description: "Writes content to a file within the workspace. Creates directories if needed.",
|
|
701
|
+
parameters: {
|
|
702
|
+
type: "object",
|
|
703
|
+
properties: {
|
|
704
|
+
path: {
|
|
705
|
+
type: "string",
|
|
706
|
+
description: "Relative path to the file to write"
|
|
707
|
+
},
|
|
708
|
+
content: {
|
|
709
|
+
type: "string",
|
|
710
|
+
description: "Content to write to the file"
|
|
711
|
+
},
|
|
712
|
+
encoding: {
|
|
713
|
+
type: "string",
|
|
714
|
+
description: "File encoding (default: utf8)",
|
|
715
|
+
default: "utf8"
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
required: ["path", "content"]
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
type: "function",
|
|
724
|
+
function: {
|
|
725
|
+
name: "list_files",
|
|
726
|
+
description: "Lists files and directories in a specified path within the workspace.",
|
|
727
|
+
parameters: {
|
|
728
|
+
type: "object",
|
|
729
|
+
properties: {
|
|
730
|
+
path: {
|
|
731
|
+
type: "string",
|
|
732
|
+
description: "Relative path to list (default: root)",
|
|
733
|
+
default: "."
|
|
734
|
+
},
|
|
735
|
+
recursive: {
|
|
736
|
+
type: "boolean",
|
|
737
|
+
description: "Whether to list recursively",
|
|
738
|
+
default: false
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
required: ["path"]
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
];
|
|
746
|
+
|
|
747
|
+
// Combine all tools into the main TOOLS array
|
|
748
|
+
export const DESKTOP_TOOLS = [
|
|
749
|
+
{
|
|
750
|
+
type: "function",
|
|
751
|
+
function: {
|
|
752
|
+
name: "mouse_move",
|
|
753
|
+
description: "Moves the mouse cursor to specific screen coordinates.",
|
|
754
|
+
parameters: {
|
|
755
|
+
type: "object",
|
|
756
|
+
properties: {
|
|
757
|
+
x: {
|
|
758
|
+
type: "number",
|
|
759
|
+
description: "X coordinate (pixels)"
|
|
760
|
+
},
|
|
761
|
+
y: {
|
|
762
|
+
type: "number",
|
|
763
|
+
description: "Y coordinate (pixels)"
|
|
764
|
+
},
|
|
765
|
+
speed: {
|
|
766
|
+
type: "number",
|
|
767
|
+
description: "Movement speed (pixels/sec). Default: 1000",
|
|
768
|
+
default: 1000
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
required: ["x", "y"]
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
type: "function",
|
|
777
|
+
function: {
|
|
778
|
+
name: "mouse_click",
|
|
779
|
+
description: "Clicks a mouse button at the current cursor location.",
|
|
780
|
+
parameters: {
|
|
781
|
+
type: "object",
|
|
782
|
+
properties: {
|
|
783
|
+
button: {
|
|
784
|
+
type: "string",
|
|
785
|
+
enum: ["left", "right", "middle"],
|
|
786
|
+
description: "Button to click. Default: left",
|
|
787
|
+
default: "left"
|
|
788
|
+
},
|
|
789
|
+
double_click: {
|
|
790
|
+
type: "boolean",
|
|
791
|
+
description: "Whether to perform a double-click. Default: false",
|
|
792
|
+
default: false
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
type: "function",
|
|
800
|
+
function: {
|
|
801
|
+
name: "keyboard_type",
|
|
802
|
+
description: "Types text using the keyboard.",
|
|
803
|
+
parameters: {
|
|
804
|
+
type: "object",
|
|
805
|
+
properties: {
|
|
806
|
+
text: {
|
|
807
|
+
type: "string",
|
|
808
|
+
description: "Text string to type"
|
|
809
|
+
},
|
|
810
|
+
delay: {
|
|
811
|
+
type: "number",
|
|
812
|
+
description: "Delay between keystrokes (ms). Default: 0",
|
|
813
|
+
default: 0
|
|
814
|
+
}
|
|
815
|
+
},
|
|
816
|
+
required: ["text"]
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
type: "function",
|
|
822
|
+
function: {
|
|
823
|
+
name: "keyboard_press",
|
|
824
|
+
description: "Presses and releases specific keys (e.g., 'enter', 'control', 'c'). Use for shortcuts.",
|
|
825
|
+
parameters: {
|
|
826
|
+
type: "object",
|
|
827
|
+
properties: {
|
|
828
|
+
keys: {
|
|
829
|
+
type: "array",
|
|
830
|
+
items: {
|
|
831
|
+
type: "string"
|
|
832
|
+
},
|
|
833
|
+
description: "Array of key names to press simultaneously"
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
required: ["keys"]
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
type: "function",
|
|
842
|
+
function: {
|
|
843
|
+
name: "screen_capture",
|
|
844
|
+
description: "Captures a screenshot of the entire desktop.",
|
|
845
|
+
parameters: {
|
|
846
|
+
type: "object",
|
|
847
|
+
properties: {
|
|
848
|
+
filename: {
|
|
849
|
+
type: "string",
|
|
850
|
+
description: "Output filename (e.g., 'screenshot.png'). Default: 'screenshot.png'",
|
|
851
|
+
default: "screenshot.png"
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
];
|
|
858
|
+
|
|
859
|
+
export const TOOLS = [
|
|
860
|
+
...CORE_TOOLS,
|
|
861
|
+
...WORKFLOW_TOOLS,
|
|
862
|
+
...RECOVERY_TOOLS,
|
|
863
|
+
...ENHANCEMENT_TOOLS,
|
|
864
|
+
...TTS_TOOLS,
|
|
865
|
+
...CUSTOM_TOOL_MANAGEMENT,
|
|
866
|
+
...WORKSPACE_TOOLS,
|
|
867
|
+
...STRUCTURED_DEV_TOOLS,
|
|
868
|
+
...RECURSIVE_TOOLS,
|
|
869
|
+
...WEB_TOOLS,
|
|
870
|
+
...FILE_TOOLS,
|
|
871
|
+
...DESKTOP_TOOLS
|
|
872
|
+
];
|