@defai.digital/ax-cli 4.0.0 → 4.0.2

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.
Files changed (83) hide show
  1. package/README.md +32 -2
  2. package/config-defaults/prompts.yaml +5 -0
  3. package/dist/agent/execution/tool-executor.js +47 -1
  4. package/dist/agent/execution/tool-executor.js.map +1 -1
  5. package/dist/agent/llm-agent.js +4 -4
  6. package/dist/agent/llm-agent.js.map +1 -1
  7. package/dist/agent/parallel-tools.js +1 -0
  8. package/dist/agent/parallel-tools.js.map +1 -1
  9. package/dist/commands/cache.js +37 -34
  10. package/dist/commands/cache.js.map +1 -1
  11. package/dist/commands/doctor.js +111 -65
  12. package/dist/commands/doctor.js.map +1 -1
  13. package/dist/commands/init/wizard.js +10 -12
  14. package/dist/commands/init/wizard.js.map +1 -1
  15. package/dist/commands/init.js +7 -9
  16. package/dist/commands/init.js.map +1 -1
  17. package/dist/commands/mcp.js +106 -55
  18. package/dist/commands/mcp.js.map +1 -1
  19. package/dist/commands/setup.js +26 -55
  20. package/dist/commands/setup.js.map +1 -1
  21. package/dist/commands/usage.js +45 -51
  22. package/dist/commands/usage.js.map +1 -1
  23. package/dist/index.js +3 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/llm/tools.d.ts +2 -23
  26. package/dist/llm/tools.js +6 -590
  27. package/dist/llm/tools.js.map +1 -1
  28. package/dist/mcp/content-length-transport.d.ts +18 -0
  29. package/dist/mcp/content-length-transport.js +121 -3
  30. package/dist/mcp/content-length-transport.js.map +1 -1
  31. package/dist/mcp/error-remediation.js +54 -17
  32. package/dist/mcp/error-remediation.js.map +1 -1
  33. package/dist/schemas/settings-schemas.d.ts +5 -0
  34. package/dist/schemas/settings-schemas.js +4 -0
  35. package/dist/schemas/settings-schemas.js.map +1 -1
  36. package/dist/tools/ax-agent.d.ts +32 -0
  37. package/dist/tools/ax-agent.js +105 -0
  38. package/dist/tools/ax-agent.js.map +1 -1
  39. package/dist/tools/definitions/ax-agent.d.ts +1 -0
  40. package/dist/tools/definitions/ax-agent.js +129 -2
  41. package/dist/tools/definitions/ax-agent.js.map +1 -1
  42. package/dist/tools/definitions/index.d.ts +12 -11
  43. package/dist/tools/definitions/index.js +5 -14
  44. package/dist/tools/definitions/index.js.map +1 -1
  45. package/dist/tools/index.d.ts +0 -1
  46. package/dist/tools/index.js +0 -1
  47. package/dist/tools/index.js.map +1 -1
  48. package/dist/tools/types.d.ts +0 -74
  49. package/dist/ui/components/status-bar.js +74 -67
  50. package/dist/ui/components/status-bar.js.map +1 -1
  51. package/dist/ui/hooks/use-input-handler.js +72 -0
  52. package/dist/ui/hooks/use-input-handler.js.map +1 -1
  53. package/dist/ui/themes/index.d.ts +5 -0
  54. package/dist/ui/themes/index.js +5 -0
  55. package/dist/ui/themes/index.js.map +1 -0
  56. package/dist/ui/themes/theme-registry.d.ts +52 -0
  57. package/dist/ui/themes/theme-registry.js +148 -0
  58. package/dist/ui/themes/theme-registry.js.map +1 -0
  59. package/dist/ui/utils/colors.d.ts +27 -1
  60. package/dist/ui/utils/colors.js +70 -1
  61. package/dist/ui/utils/colors.js.map +1 -1
  62. package/dist/ui/utils/image-handler.js +3 -0
  63. package/dist/ui/utils/image-handler.js.map +1 -1
  64. package/dist/utils/enhanced-error-messages.js +43 -23
  65. package/dist/utils/enhanced-error-messages.js.map +1 -1
  66. package/dist/utils/init-validator.d.ts +4 -0
  67. package/dist/utils/init-validator.js +17 -13
  68. package/dist/utils/init-validator.js.map +1 -1
  69. package/dist/utils/llm-optimized-instruction-generator.js +97 -136
  70. package/dist/utils/llm-optimized-instruction-generator.js.map +1 -1
  71. package/dist/utils/project-analyzer.d.ts +6 -0
  72. package/dist/utils/project-analyzer.js +92 -189
  73. package/dist/utils/project-analyzer.js.map +1 -1
  74. package/dist/utils/settings-manager.d.ts +13 -1
  75. package/dist/utils/settings-manager.js +30 -0
  76. package/dist/utils/settings-manager.js.map +1 -1
  77. package/dist/utils/template-manager.d.ts +8 -0
  78. package/dist/utils/template-manager.js +54 -110
  79. package/dist/utils/template-manager.js.map +1 -1
  80. package/package.json +1 -1
  81. package/dist/tools/result-enhancer.d.ts +0 -64
  82. package/dist/tools/result-enhancer.js +0 -215
  83. package/dist/tools/result-enhancer.js.map +0 -1
@@ -1,25 +1,10 @@
1
1
  import { LLMTool } from "./client.js";
2
2
  import { MCPManager, MCPTool } from "../mcp/client.js";
3
3
  /**
4
- * Legacy tool definitions for the LLM agent
5
- * @deprecated Kept for reference - now using TOOL_DEFINITIONS from definitions/index.ts
6
- * Named _BASE_LLM_TOOLS (prefixed with _ to indicate unused)
4
+ * LLM tool definitions derived from rich Tool System v3.0 definitions
5
+ * These are the primary exports for tool registration with LLM providers
7
6
  */
8
- declare const _BASE_LLM_TOOLS: LLMTool[];
9
- /**
10
- * Rich tool definitions converted to OpenAI format
11
- * These are derived from the TOOL_DEFINITIONS using format generators
12
- */
13
- declare const RICH_LLM_TOOLS: LLMTool[];
14
- /**
15
- * Exported tool definitions
16
- * Now using rich definitions from Tool System v3.0
17
- * @deprecated Use LLM_TOOLS instead of GROK_TOOLS (legacy name kept for backwards compatibility)
18
- */
19
- export declare const GROK_TOOLS: LLMTool[];
20
7
  export declare const LLM_TOOLS: LLMTool[];
21
- export { RICH_LLM_TOOLS as BASE_LLM_TOOLS_V3 };
22
- export { _BASE_LLM_TOOLS as LEGACY_LLM_TOOLS };
23
8
  /**
24
9
  * Get or create the MCP manager singleton
25
10
  * Note: MCPManager constructor is synchronous, so no race condition is possible
@@ -42,21 +27,15 @@ export declare function initializeMCPServers(): Promise<void>;
42
27
  * MCP 2025-06-18: Includes output schema in description for LLM awareness
43
28
  */
44
29
  export declare function convertMCPToolToLLMTool(mcpTool: MCPTool): LLMTool;
45
- /** @deprecated Use convertMCPToolToLLMTool instead */
46
- export declare const convertMCPToolToGrokTool: typeof convertMCPToolToLLMTool;
47
30
  /**
48
31
  * Merge base tools with MCP tools
49
32
  */
50
33
  export declare function mergeWithMCPTools(baseTools: LLMTool[]): LLMTool[];
51
- /** @deprecated Use mergeWithMCPTools instead */
52
- export declare const addMCPToolsToGrokTools: typeof mergeWithMCPTools;
53
34
  /**
54
35
  * Get all available tools (base + MCP)
55
36
  * Handles MCP initialization with timeout
56
37
  */
57
38
  export declare function getAllTools(): Promise<LLMTool[]>;
58
- /** @deprecated Use getAllTools instead */
59
- export declare const getAllGrokTools: typeof getAllTools;
60
39
  /**
61
40
  * Get MCP connection status for UI display
62
41
  * Returns { connected, failed, connecting, total } counts
package/dist/llm/tools.js CHANGED
@@ -4,12 +4,8 @@ import { extractErrorMessage } from "../utils/error-handler.js";
4
4
  import { TIMEOUT_CONFIG } from "../constants.js";
5
5
  import { TOOL_DEFINITIONS } from "../tools/definitions/index.js";
6
6
  import { toOpenAIFormat } from "../tools/format-generators.js";
7
- // Tool configuration constants
8
- const TOOL_DEFAULTS = {
9
- BASH_TIMEOUT_MS: TIMEOUT_CONFIG.BASH_DEFAULT,
10
- MCP_INIT_TIMEOUT_MS: TIMEOUT_CONFIG.MCP_INIT,
11
- SEARCH_MAX_RESULTS: 50,
12
- };
7
+ // MCP initialization timeout
8
+ const MCP_INIT_TIMEOUT_MS = TIMEOUT_CONFIG.MCP_INIT;
13
9
  // MCP log messages to suppress (verbose connection logs)
14
10
  const MCP_SUPPRESSED_LOG_PATTERNS = [
15
11
  'Using existing client port',
@@ -22,584 +18,10 @@ const MCP_SUPPRESSED_LOG_PATTERNS = [
22
18
  'Remote→Local',
23
19
  ];
24
20
  /**
25
- * Legacy tool definitions for the LLM agent
26
- * @deprecated Kept for reference - now using TOOL_DEFINITIONS from definitions/index.ts
27
- * Named _BASE_LLM_TOOLS (prefixed with _ to indicate unused)
21
+ * LLM tool definitions derived from rich Tool System v3.0 definitions
22
+ * These are the primary exports for tool registration with LLM providers
28
23
  */
29
- const _BASE_LLM_TOOLS = [
30
- {
31
- type: "function",
32
- function: {
33
- name: "view_file",
34
- description: "View contents of a file or list directory contents",
35
- parameters: {
36
- type: "object",
37
- properties: {
38
- path: {
39
- type: "string",
40
- description: "Path to file or directory to view",
41
- },
42
- start_line: {
43
- type: "number",
44
- description: "Starting line number for partial file view (optional)",
45
- },
46
- end_line: {
47
- type: "number",
48
- description: "Ending line number for partial file view (optional)",
49
- },
50
- },
51
- required: ["path"],
52
- },
53
- },
54
- },
55
- {
56
- type: "function",
57
- function: {
58
- name: "create_file",
59
- description: "Create a new file with specified content",
60
- parameters: {
61
- type: "object",
62
- properties: {
63
- path: {
64
- type: "string",
65
- description: "Path where the file should be created",
66
- },
67
- content: {
68
- type: "string",
69
- description: "Content to write to the file",
70
- },
71
- },
72
- required: ["path", "content"],
73
- },
74
- },
75
- },
76
- {
77
- type: "function",
78
- function: {
79
- name: "str_replace_editor",
80
- description: "Edit existing files with precise string replacement. Can replace single or multi-line text blocks. For multiple changes to the same file, include more context in old_str to make a single comprehensive edit rather than multiple separate calls.",
81
- parameters: {
82
- type: "object",
83
- properties: {
84
- path: {
85
- type: "string",
86
- description: "Path to the file to edit",
87
- },
88
- old_str: {
89
- type: "string",
90
- description: "Text to replace - can be single line or multi-line block. Include sufficient context (surrounding lines) to uniquely identify the location and enable consolidated edits.",
91
- },
92
- new_str: {
93
- type: "string",
94
- description: "Replacement text - can be single line or entire function/block",
95
- },
96
- replace_all: {
97
- type: "boolean",
98
- description: "Replace all occurrences (default: false, only replaces first occurrence). Useful for variable renaming across file.",
99
- },
100
- },
101
- required: ["path", "old_str", "new_str"],
102
- },
103
- },
104
- },
105
- {
106
- type: "function",
107
- function: {
108
- name: "multi_edit",
109
- description: "Make multiple edits to a single file in one atomic operation. Use this instead of multiple str_replace_editor calls when you need to make several changes to the same file. Edits are applied sequentially and the operation fails entirely if any edit is invalid (all-or-nothing).",
110
- parameters: {
111
- type: "object",
112
- properties: {
113
- path: {
114
- type: "string",
115
- description: "Path to the file to edit",
116
- },
117
- edits: {
118
- type: "array",
119
- description: "Array of edits to apply sequentially. Each edit operates on the result of the previous edit.",
120
- items: {
121
- type: "object",
122
- properties: {
123
- old_str: {
124
- type: "string",
125
- description: "Text to replace",
126
- },
127
- new_str: {
128
- type: "string",
129
- description: "Replacement text",
130
- },
131
- },
132
- required: ["old_str", "new_str"],
133
- },
134
- },
135
- },
136
- required: ["path", "edits"],
137
- },
138
- },
139
- },
140
- {
141
- type: "function",
142
- function: {
143
- name: "bash",
144
- description: "Execute a bash command. Append ' &' to run in background.",
145
- parameters: {
146
- type: "object",
147
- properties: {
148
- command: {
149
- type: "string",
150
- description: "The bash command to execute. Append ' &' to run in background (e.g., 'npm run dev &')",
151
- },
152
- background: {
153
- type: "boolean",
154
- description: "Run command in background (alternative to appending ' &'). Useful for long-running processes like dev servers.",
155
- },
156
- timeout: {
157
- type: "number",
158
- description: `Timeout in milliseconds (default: ${TOOL_DEFAULTS.BASH_TIMEOUT_MS}). Ignored for background commands.`,
159
- },
160
- },
161
- required: ["command"],
162
- },
163
- },
164
- },
165
- {
166
- type: "function",
167
- function: {
168
- name: "bash_output",
169
- description: "Get output from a background task. Use after running a command with ' &' or background:true",
170
- parameters: {
171
- type: "object",
172
- properties: {
173
- task_id: {
174
- type: "string",
175
- description: "The background task ID (returned when starting a background command)",
176
- },
177
- wait: {
178
- type: "boolean",
179
- description: "Wait for task to complete before returning output (default: false)",
180
- },
181
- timeout: {
182
- type: "number",
183
- description: `Maximum time to wait in milliseconds if wait is true (default: ${TOOL_DEFAULTS.BASH_TIMEOUT_MS})`,
184
- },
185
- },
186
- required: ["task_id"],
187
- },
188
- },
189
- },
190
- {
191
- type: "function",
192
- function: {
193
- name: "search",
194
- description: "Unified search tool for finding text content or files (similar to Cursor's search)",
195
- parameters: {
196
- type: "object",
197
- properties: {
198
- query: {
199
- type: "string",
200
- description: "Text to search for or file name/path pattern",
201
- },
202
- search_type: {
203
- type: "string",
204
- enum: ["text", "files", "both"],
205
- description: "Type of search: 'text' for content search, 'files' for file names, 'both' for both (default: 'both')",
206
- },
207
- include_pattern: {
208
- type: "string",
209
- description: "Glob pattern for files to include (e.g. '*.ts', '*.js')",
210
- },
211
- exclude_pattern: {
212
- type: "string",
213
- description: "Glob pattern for files to exclude (e.g. '*.log', 'node_modules')",
214
- },
215
- case_sensitive: {
216
- type: "boolean",
217
- description: "Whether search should be case sensitive (default: false)",
218
- },
219
- whole_word: {
220
- type: "boolean",
221
- description: "Whether to match whole words only (default: false)",
222
- },
223
- regex: {
224
- type: "boolean",
225
- description: "Whether query is a regex pattern (default: false)",
226
- },
227
- max_results: {
228
- type: "number",
229
- description: `Maximum number of results to return (default: ${TOOL_DEFAULTS.SEARCH_MAX_RESULTS})`,
230
- },
231
- file_types: {
232
- type: "array",
233
- items: { type: "string" },
234
- description: "File types to search (e.g. ['js', 'ts', 'py'])",
235
- },
236
- include_hidden: {
237
- type: "boolean",
238
- description: "Whether to include hidden files (default: false)",
239
- },
240
- },
241
- required: ["query"],
242
- },
243
- },
244
- },
245
- {
246
- type: "function",
247
- function: {
248
- name: "create_todo_list",
249
- description: "Create a new todo list for planning and tracking tasks",
250
- parameters: {
251
- type: "object",
252
- properties: {
253
- todos: {
254
- type: "array",
255
- description: "Array of todo items",
256
- items: {
257
- type: "object",
258
- properties: {
259
- id: {
260
- type: "string",
261
- description: "Unique identifier for the todo item",
262
- },
263
- content: {
264
- type: "string",
265
- description: "Description of the todo item",
266
- },
267
- status: {
268
- type: "string",
269
- enum: ["pending", "in_progress", "completed"],
270
- description: "Current status of the todo item",
271
- },
272
- priority: {
273
- type: "string",
274
- enum: ["high", "medium", "low"],
275
- description: "Priority level of the todo item",
276
- },
277
- },
278
- required: ["id", "content", "status", "priority"],
279
- },
280
- },
281
- },
282
- required: ["todos"],
283
- },
284
- },
285
- },
286
- {
287
- type: "function",
288
- function: {
289
- name: "update_todo_list",
290
- description: "Update existing todos in the todo list",
291
- parameters: {
292
- type: "object",
293
- properties: {
294
- updates: {
295
- type: "array",
296
- description: "Array of todo updates",
297
- items: {
298
- type: "object",
299
- properties: {
300
- id: {
301
- type: "string",
302
- description: "ID of the todo item to update",
303
- },
304
- status: {
305
- type: "string",
306
- enum: ["pending", "in_progress", "completed"],
307
- description: "New status for the todo item",
308
- },
309
- content: {
310
- type: "string",
311
- description: "New content for the todo item",
312
- },
313
- priority: {
314
- type: "string",
315
- enum: ["high", "medium", "low"],
316
- description: "New priority for the todo item",
317
- },
318
- },
319
- required: ["id"],
320
- },
321
- },
322
- },
323
- required: ["updates"],
324
- },
325
- },
326
- },
327
- // NOTE: analyze_architecture and validate_best_practices were removed.
328
- // The backend analyzers were deleted. Use ax_agent with avery/stan instead.
329
- {
330
- type: "function",
331
- function: {
332
- name: "ask_user",
333
- description: "Ask the user questions to gather preferences, clarify requirements, or get decisions on implementation choices. Use this when you need user input before proceeding. Supports multiple choice questions with 2-4 options per question.",
334
- parameters: {
335
- type: "object",
336
- properties: {
337
- questions: {
338
- type: "array",
339
- description: "Questions to ask the user (1-4 questions)",
340
- items: {
341
- type: "object",
342
- properties: {
343
- question: {
344
- type: "string",
345
- description: "The complete question to ask the user. Should be clear and specific.",
346
- },
347
- header: {
348
- type: "string",
349
- description: "Short label for the question (max 12 chars). E.g., 'Auth method', 'Library'.",
350
- },
351
- options: {
352
- type: "array",
353
- description: "Available choices (2-4 options). 'Other' is added automatically.",
354
- items: {
355
- type: "object",
356
- properties: {
357
- label: {
358
- type: "string",
359
- description: "Display text for this option (1-5 words).",
360
- },
361
- description: {
362
- type: "string",
363
- description: "Explanation of what this option means.",
364
- },
365
- },
366
- required: ["label", "description"],
367
- },
368
- },
369
- multiSelect: {
370
- type: "boolean",
371
- description: "Allow multiple selections (default: false).",
372
- },
373
- },
374
- required: ["question", "options"],
375
- },
376
- },
377
- },
378
- required: ["questions"],
379
- },
380
- },
381
- },
382
- // ==========================================================================
383
- // AutomatosX Agent Invocation
384
- // ==========================================================================
385
- {
386
- type: "function",
387
- function: {
388
- name: "ax_agent",
389
- description: "Invoke an AutomatosX AI agent for collaborative analysis, code review, architecture advice, or strategic guidance. USE THIS when the user wants to WORK WITH a specific agent persona (Tony/CTO, Bob/Backend, Avery/Architect, Stan/Standards, Steve/Security, etc.). Returns the agent's AI-generated response. IMPORTANT: When the user asks to work with MULTIPLE agents, invoke ALL agents IN PARALLEL by making multiple ax_agent calls in the same response - they will execute concurrently for faster results.",
390
- parameters: {
391
- type: "object",
392
- properties: {
393
- agent: {
394
- type: "string",
395
- enum: ["tony", "bob", "avery", "stan", "steve", "felix", "frank", "queenie", "wendy", "oliver", "paris", "maya", "dana", "daisy", "debbee", "eric", "rodman", "candy", "quinn", "astrid"],
396
- description: "Agent to invoke: tony (CTO/strategy), bob (backend), avery (architect), stan (code standards), steve (security), felix (fullstack), frank (frontend), queenie (QA), wendy (writer), oliver (devops), paris (product), maya (mobile), dana (data science), daisy (data eng), debbee (design), eric (exec), rodman (research), candy (marketing), quinn (quantum), astrid (aerospace)",
397
- },
398
- task: {
399
- type: "string",
400
- description: "Task or question for the agent. Be specific about what you want analyzed or reviewed.",
401
- },
402
- format: {
403
- type: "string",
404
- enum: ["text", "markdown"],
405
- description: "Output format (default: markdown)",
406
- },
407
- save: {
408
- type: "string",
409
- description: "Optional file path to save output (e.g., automatosx/tmp/review.md)",
410
- },
411
- },
412
- required: ["agent", "task"],
413
- },
414
- },
415
- },
416
- // ==========================================================================
417
- // Design Tools (Figma Integration)
418
- // ==========================================================================
419
- {
420
- type: "function",
421
- function: {
422
- name: "figma_map",
423
- description: "Map a Figma file structure to see its pages, frames, and components. Requires FIGMA_ACCESS_TOKEN environment variable.",
424
- parameters: {
425
- type: "object",
426
- properties: {
427
- file_key: {
428
- type: "string",
429
- description: "Figma file key (from the URL: figma.com/file/FILE_KEY/...)",
430
- },
431
- depth: {
432
- type: "number",
433
- description: "Maximum depth to traverse (optional)",
434
- },
435
- format: {
436
- type: "string",
437
- enum: ["tree", "json", "flat"],
438
- description: "Output format (default: tree)",
439
- },
440
- show_ids: {
441
- type: "boolean",
442
- description: "Include node IDs in output",
443
- },
444
- show_types: {
445
- type: "boolean",
446
- description: "Include node types in output",
447
- },
448
- frames_only: {
449
- type: "boolean",
450
- description: "Show only frames and components",
451
- },
452
- },
453
- required: ["file_key"],
454
- },
455
- },
456
- },
457
- {
458
- type: "function",
459
- function: {
460
- name: "figma_tokens",
461
- description: "Extract design tokens (colors, spacing, radii) from a Figma file's variables. Requires FIGMA_ACCESS_TOKEN environment variable.",
462
- parameters: {
463
- type: "object",
464
- properties: {
465
- file_key: {
466
- type: "string",
467
- description: "Figma file key containing design tokens/variables",
468
- },
469
- format: {
470
- type: "string",
471
- enum: ["json", "tailwind", "css", "scss"],
472
- description: "Output format (default: json)",
473
- },
474
- color_format: {
475
- type: "string",
476
- enum: ["hex", "rgb", "hsl"],
477
- description: "Color output format (default: hex)",
478
- },
479
- dimension_unit: {
480
- type: "string",
481
- enum: ["px", "rem"],
482
- description: "Dimension unit (default: px)",
483
- },
484
- rem_base: {
485
- type: "number",
486
- description: "Base value for rem conversion (default: 16)",
487
- },
488
- },
489
- required: ["file_key"],
490
- },
491
- },
492
- },
493
- {
494
- type: "function",
495
- function: {
496
- name: "figma_audit",
497
- description: "Run a design audit on a Figma file to check for naming conventions, missing auto-layout, and other best practices. Requires FIGMA_ACCESS_TOKEN environment variable.",
498
- parameters: {
499
- type: "object",
500
- properties: {
501
- file_key: {
502
- type: "string",
503
- description: "Figma file key to audit",
504
- },
505
- depth: {
506
- type: "number",
507
- description: "Maximum depth to traverse (optional)",
508
- },
509
- rules: {
510
- type: "array",
511
- items: { type: "string" },
512
- description: "Specific rules to run (e.g., ['layer-naming', 'missing-autolayout']). Runs all by default.",
513
- },
514
- exclude_rules: {
515
- type: "array",
516
- items: { type: "string" },
517
- description: "Rules to exclude from the audit",
518
- },
519
- },
520
- required: ["file_key"],
521
- },
522
- },
523
- },
524
- {
525
- type: "function",
526
- function: {
527
- name: "figma_search",
528
- description: "Search for nodes in a Figma file by name, type, or text content. Requires FIGMA_ACCESS_TOKEN environment variable.",
529
- parameters: {
530
- type: "object",
531
- properties: {
532
- file_key: {
533
- type: "string",
534
- description: "Figma file key to search in",
535
- },
536
- name: {
537
- type: "string",
538
- description: "Search by node name (partial match)",
539
- },
540
- type: {
541
- type: "string",
542
- description: "Filter by node type (e.g., FRAME, TEXT, COMPONENT)",
543
- },
544
- text: {
545
- type: "string",
546
- description: "Search text nodes by content",
547
- },
548
- limit: {
549
- type: "number",
550
- description: "Maximum results to return (default: 10)",
551
- },
552
- },
553
- required: ["file_key"],
554
- },
555
- },
556
- },
557
- {
558
- type: "function",
559
- function: {
560
- name: "figma_alias_list",
561
- description: "List all saved Figma design aliases (shortcuts to specific files/nodes)",
562
- parameters: {
563
- type: "object",
564
- properties: {},
565
- required: [],
566
- },
567
- },
568
- },
569
- {
570
- type: "function",
571
- function: {
572
- name: "figma_alias_resolve",
573
- description: "Resolve a design alias to its Figma file key and node ID",
574
- parameters: {
575
- type: "object",
576
- properties: {
577
- alias: {
578
- type: "string",
579
- description: "Alias name to resolve",
580
- },
581
- },
582
- required: ["alias"],
583
- },
584
- },
585
- },
586
- ];
587
- /**
588
- * Rich tool definitions converted to OpenAI format
589
- * These are derived from the TOOL_DEFINITIONS using format generators
590
- */
591
- const RICH_LLM_TOOLS = TOOL_DEFINITIONS.map(toOpenAIFormat);
592
- /**
593
- * Exported tool definitions
594
- * Now using rich definitions from Tool System v3.0
595
- * @deprecated Use LLM_TOOLS instead of GROK_TOOLS (legacy name kept for backwards compatibility)
596
- */
597
- export const GROK_TOOLS = [...RICH_LLM_TOOLS];
598
- export const LLM_TOOLS = GROK_TOOLS; // Preferred name
599
- // Keep legacy BASE_LLM_TOOLS reference for any code that imports it directly
600
- export { RICH_LLM_TOOLS as BASE_LLM_TOOLS_V3 };
601
- // Export legacy definitions for backward compatibility (if any code still uses them)
602
- export { _BASE_LLM_TOOLS as LEGACY_LLM_TOOLS };
24
+ export const LLM_TOOLS = TOOL_DEFINITIONS.map(toOpenAIFormat);
603
25
  // Global MCP manager instance (singleton pattern)
604
26
  let mcpManager = null;
605
27
  /**
@@ -723,8 +145,6 @@ export function convertMCPToolToLLMTool(mcpTool) {
723
145
  }
724
146
  };
725
147
  }
726
- /** @deprecated Use convertMCPToolToLLMTool instead */
727
- export const convertMCPToolToGrokTool = convertMCPToolToLLMTool;
728
148
  /**
729
149
  * Merge base tools with MCP tools
730
150
  */
@@ -735,8 +155,6 @@ export function mergeWithMCPTools(baseTools) {
735
155
  const mcpTools = mcpManager.getTools().map(convertMCPToolToLLMTool);
736
156
  return [...baseTools, ...mcpTools];
737
157
  }
738
- /** @deprecated Use mergeWithMCPTools instead */
739
- export const addMCPToolsToGrokTools = mergeWithMCPTools;
740
158
  /**
741
159
  * Get all available tools (base + MCP)
742
160
  * Handles MCP initialization with timeout
@@ -746,7 +164,7 @@ export async function getAllTools() {
746
164
  try {
747
165
  let timeoutId;
748
166
  const timeoutPromise = new Promise((_, reject) => {
749
- timeoutId = setTimeout(() => reject(new Error('MCP init timeout')), TOOL_DEFAULTS.MCP_INIT_TIMEOUT_MS);
167
+ timeoutId = setTimeout(() => reject(new Error('MCP init timeout')), MCP_INIT_TIMEOUT_MS);
750
168
  });
751
169
  // Prevent unhandled rejection if timeout loses race
752
170
  timeoutPromise.catch(() => { });
@@ -763,8 +181,6 @@ export async function getAllTools() {
763
181
  }
764
182
  return mergeWithMCPTools(LLM_TOOLS);
765
183
  }
766
- /** @deprecated Use getAllTools instead */
767
- export const getAllGrokTools = getAllTools;
768
184
  /**
769
185
  * Get MCP connection status for UI display
770
186
  * Returns { connected, failed, connecting, total } counts