asm-mcp-proxy 2.0.0 → 3.0.1

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,1284 @@
1
+ "use strict";
2
+ /**
3
+ * ASM Consolidated Tools for MCP Proxy
4
+ *
5
+ * Maps the 40 consolidated tool names (same as ASM-MCP local) to gateway API endpoints.
6
+ * Each tool uses an `action` parameter to route to the correct gateway endpoint.
7
+ *
8
+ * This replaces the previous approach of exposing 98+ individual gateway tools,
9
+ * keeping us well under Windsurf's 100 tool limit.
10
+ *
11
+ * Structure (matches ASM-MCP local consolidated-tools.ts):
12
+ * - Core (5): asm_start, asm_query, asm_learn, asm_do, asm_config
13
+ * - Domain (10): asm_generate, asm_validate, asm_git, asm_sandbox, asm_semantic,
14
+ * asm_knowledge, asm_workflow, asm_rls, asm_deploy, asm_figma
15
+ * - AI (2): asm_ollama, asm_health
16
+ * - Orchestrator (7): asm_rules, asm_hooks, asm_catalog, asm_metrics, asm_obsidian, asm_personas, asm_learning
17
+ * - Proactive (1): asm_proactive
18
+ * - Agent (3): asm_agent_start_session, asm_agent_analyze, asm_agent_validate
19
+ * - Framework (1): asm_framework
20
+ * - Snapshot (1): asm_snapshot
21
+ * - MCP Master (1): asm_mcp
22
+ * - Terminal (1): asm_terminal
23
+ * - Gateway (1): asm_gateway
24
+ * - Roo Code (2): asm_write, asm_propose
25
+ * - Intent (1): asm_intent
26
+ * - Execution (1): asm_execution
27
+ * - AI Chat/Plan/Review (3): asm_ai_chat, asm_ai_plan, asm_ai_review
28
+ *
29
+ * Total: ~40 consolidated tools + 9 local tools = ~49 tools (limit: 100)
30
+ */
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.CONSOLIDATED_TOOLS = void 0;
33
+ exports.getConsolidatedToolDefinitions = getConsolidatedToolDefinitions;
34
+ exports.findConsolidatedTool = findConsolidatedTool;
35
+ exports.resolveGatewayCall = resolveGatewayCall;
36
+ exports.isConsolidatedTool = isConsolidatedTool;
37
+ exports.getConsolidatedToolCount = getConsolidatedToolCount;
38
+ /**
39
+ * Build the action map for a tool where all actions map to the same gateway tool name
40
+ */
41
+ function sameToolMap(gatewayTool, actions) {
42
+ const map = {};
43
+ for (const action of actions) {
44
+ map[action] = { gatewayTool };
45
+ }
46
+ return map;
47
+ }
48
+ // ============================================
49
+ // CONSOLIDATED TOOL DEFINITIONS
50
+ // ============================================
51
+ exports.CONSOLIDATED_TOOLS = [
52
+ // ============================================
53
+ // CORE TOOLS (5)
54
+ // ============================================
55
+ {
56
+ name: 'asm_start',
57
+ description: `Initialize ASM session or get context/health.
58
+
59
+ Actions:
60
+ - session: Start session with full context recovery
61
+ - context: Get current working context
62
+ - health: Get ASM health dashboard
63
+
64
+ Example: asm_start({ action: "session" })`,
65
+ inputSchema: {
66
+ type: 'object',
67
+ properties: {
68
+ action: { type: 'string', enum: ['session', 'context', 'health'], description: 'Action to perform' },
69
+ module: { type: 'string', description: 'Optional module filter for context' },
70
+ },
71
+ required: ['action'],
72
+ },
73
+ actionMap: {
74
+ 'session': { gatewayTool: 'asm_start' },
75
+ 'context': { gatewayTool: 'asm_get_working_context' },
76
+ 'health': { gatewayTool: 'asm_get_asm_health' },
77
+ },
78
+ defaultGatewayTool: 'asm_start',
79
+ },
80
+ {
81
+ name: 'asm_query',
82
+ description: `Query ASM memory and get recommendations.
83
+
84
+ Actions:
85
+ - patterns: Search patterns in memory
86
+ - pattern_full: Get full pattern content by ID
87
+ - stats: Get memory statistics
88
+ - patterns_by_type: Get patterns by type
89
+
90
+ Example: asm_query({ action: "patterns", query: "nuxt component" })`,
91
+ inputSchema: {
92
+ type: 'object',
93
+ properties: {
94
+ action: { type: 'string', enum: ['patterns', 'pattern_full', 'stats', 'patterns_by_type'], description: 'Query action' },
95
+ query: { type: 'string', description: 'Search query' },
96
+ patternId: { type: 'string', description: 'Pattern ID for pattern_full' },
97
+ type: { type: 'string', description: 'Pattern type filter' },
98
+ limit: { type: 'number', description: 'Max results' },
99
+ },
100
+ required: ['action'],
101
+ },
102
+ actionMap: {
103
+ 'patterns': { gatewayTool: 'asm_search_patterns' },
104
+ 'pattern_full': { gatewayTool: 'asm_get_pattern_full' },
105
+ 'stats': { gatewayTool: 'asm_get_memory_stats' },
106
+ 'patterns_by_type': { gatewayTool: 'asm_search_patterns' },
107
+ },
108
+ defaultGatewayTool: 'asm_search_patterns',
109
+ },
110
+ {
111
+ name: 'asm_learn',
112
+ description: `Store patterns, lessons, intentions and feedback.
113
+
114
+ Actions:
115
+ - pattern: Store a reusable code pattern
116
+ - intention: Store user intention
117
+ - lesson: Store a lesson learned
118
+
119
+ Example: asm_learn({ action: "pattern", type: "component", content: "...", name: "UserCard" })`,
120
+ inputSchema: {
121
+ type: 'object',
122
+ properties: {
123
+ action: { type: 'string', enum: ['pattern', 'intention', 'lesson'], description: 'Learn action' },
124
+ type: { type: 'string', description: 'Pattern type' },
125
+ content: { type: 'string', description: 'Pattern content' },
126
+ name: { type: 'string', description: 'Pattern name' },
127
+ description: { type: 'string', description: 'Intention/lesson description' },
128
+ context: { type: 'string', description: 'Context' },
129
+ category: { type: 'string', description: 'Lesson category' },
130
+ lesson: { type: 'string', description: 'Lesson content' },
131
+ solution: { type: 'string', description: 'Solution' },
132
+ },
133
+ required: ['action'],
134
+ },
135
+ actionMap: {
136
+ 'pattern': { gatewayTool: 'asm_store_pattern' },
137
+ 'intention': { gatewayTool: 'asm_store_intention' },
138
+ 'lesson': { gatewayTool: 'asm_store_lesson' },
139
+ },
140
+ defaultGatewayTool: 'asm_store_pattern',
141
+ },
142
+ {
143
+ name: 'asm_do',
144
+ description: `Execute any registered action via the ASM router.
145
+
146
+ Actions:
147
+ - action: Execute a specific domain:action
148
+ - list: List available actions
149
+
150
+ Example: asm_do({ action: "list" })`,
151
+ inputSchema: {
152
+ type: 'object',
153
+ properties: {
154
+ action: { type: 'string', enum: ['action', 'list'], description: 'Router action' },
155
+ domain: { type: 'string', description: 'Target domain' },
156
+ targetAction: { type: 'string', description: 'Target action within domain' },
157
+ params: { type: 'object', description: 'Action parameters' },
158
+ },
159
+ required: ['action'],
160
+ },
161
+ actionMap: {},
162
+ defaultGatewayTool: 'asm_orchestrate',
163
+ },
164
+ {
165
+ name: 'asm_config',
166
+ description: `Configure ASM settings.
167
+
168
+ Actions:
169
+ - get: Get configuration value
170
+ - set: Set configuration value
171
+ - sync: Sync memory between L2 and L3
172
+
173
+ Example: asm_config({ action: "sync", direction: "both" })`,
174
+ inputSchema: {
175
+ type: 'object',
176
+ properties: {
177
+ action: { type: 'string', enum: ['get', 'set', 'sync'], description: 'Config action' },
178
+ key: { type: 'string', description: 'Config key' },
179
+ value: { type: 'string', description: 'Config value' },
180
+ direction: { type: 'string', enum: ['upload', 'download', 'both'], description: 'Sync direction' },
181
+ },
182
+ required: ['action'],
183
+ },
184
+ actionMap: {
185
+ 'get': { gatewayTool: 'asm_config', mapParams: (p) => ({ action: 'get', key: p.key }) },
186
+ 'set': { gatewayTool: 'asm_config', mapParams: (p) => ({ action: 'set', key: p.key, value: p.value }) },
187
+ 'sync': { gatewayTool: 'asm_sync_memory', mapParams: (p) => ({ direction: p.direction || 'both' }) },
188
+ },
189
+ defaultGatewayTool: 'asm_config',
190
+ },
191
+ // ============================================
192
+ // DOMAIN TOOLS (10)
193
+ // ============================================
194
+ {
195
+ name: 'asm_generate',
196
+ description: `Generate Nuxt 4 code, entities, or tests.
197
+
198
+ Actions:
199
+ - nuxt: Generate page/component/composable/api/middleware/plugin (use 'type' param)
200
+ - entity: Scaffold complete CRUD entity
201
+ - tests: Generate test suite
202
+ - analyze_project: Analyze a Nuxt 4 project structure
203
+ - suggest_improvements: Suggest improvements for a Nuxt 4 project
204
+
205
+ Example: asm_generate({ action: "nuxt", type: "component", name: "UserCard" })`,
206
+ inputSchema: {
207
+ type: 'object',
208
+ properties: {
209
+ action: { type: 'string', enum: ['nuxt', 'entity', 'tests', 'analyze_project', 'suggest_improvements'], description: 'Generate action' },
210
+ type: { type: 'string', enum: ['page', 'component', 'composable', 'api', 'middleware', 'plugin'], description: 'Nuxt type' },
211
+ name: { type: 'string', description: 'Name' },
212
+ fields: { type: 'array', items: { type: 'object' }, description: 'Entity fields' },
213
+ props: { type: 'array', items: { type: 'object' }, description: 'Component props' },
214
+ emits: { type: 'array', items: { type: 'string' }, description: 'Component emits' },
215
+ features: { type: 'array', items: { type: 'string' }, description: 'Features to include' },
216
+ file: { type: 'string', description: 'File to test' },
217
+ framework: { type: 'string', description: 'Test framework' },
218
+ path: { type: 'string', description: 'Project path' },
219
+ },
220
+ required: ['action'],
221
+ },
222
+ actionMap: {
223
+ 'nuxt': { gatewayTool: 'asm_generate', mapParams: (p) => ({ type: p.type, name: p.name, ...p }) },
224
+ 'entity': { gatewayTool: 'asm_scaffold_entity', mapParams: (p) => ({ name: p.name, fields: p.fields }) },
225
+ 'tests': { gatewayTool: 'asm_generate_tests', mapParams: (p) => ({ file: p.file || p.name, framework: p.framework }) },
226
+ 'analyze_project': { gatewayTool: 'asm_nuxt_analyze_project', mapParams: (p) => ({ path: p.path }) },
227
+ 'suggest_improvements': { gatewayTool: 'asm_nuxt_suggest_improvements', mapParams: (p) => ({ path: p.path }) },
228
+ },
229
+ defaultGatewayTool: 'asm_generate',
230
+ },
231
+ {
232
+ name: 'asm_validate',
233
+ description: `Validate code quality, security, and architecture.
234
+
235
+ Actions:
236
+ - gate5: Run Gate 5 validation
237
+ - review: AI code review
238
+ - fix: Validate and auto-fix
239
+ - hexagonal: Validate clean architecture
240
+
241
+ Example: asm_validate({ action: "gate5", target: "src/", threshold: 70 })`,
242
+ inputSchema: {
243
+ type: 'object',
244
+ properties: {
245
+ action: { type: 'string', enum: ['gate5', 'review', 'fix', 'hexagonal'], description: 'Validate action' },
246
+ target: { type: 'string', description: 'Target file/folder' },
247
+ files: { type: 'array', items: { type: 'string' }, description: 'Files to validate' },
248
+ threshold: { type: 'number', description: 'Quality threshold' },
249
+ focusAreas: { type: 'array', items: { type: 'string' }, description: 'Focus areas' },
250
+ strictness: { type: 'string', enum: ['lenient', 'normal', 'strict'], description: 'Review strictness' },
251
+ dryRun: { type: 'boolean', description: 'Preview fixes without applying' },
252
+ path: { type: 'string', description: 'Project path for hexagonal' },
253
+ },
254
+ required: ['action'],
255
+ },
256
+ actionMap: {
257
+ 'gate5': { gatewayTool: 'asm_gate5_validate', mapParams: (p) => ({ target: p.target, threshold: p.threshold }) },
258
+ 'review': { gatewayTool: 'asm_ai_code_review', mapParams: (p) => ({ files: p.files, focus_areas: p.focusAreas, strictness: p.strictness }) },
259
+ 'fix': { gatewayTool: 'asm_validate_and_fix', mapParams: (p) => ({ files: p.files, dry_run: p.dryRun }) },
260
+ 'hexagonal': { gatewayTool: 'asm_validate_hexagonal_isolation', mapParams: (p) => ({ path: p.path }) },
261
+ },
262
+ defaultGatewayTool: 'asm_validate',
263
+ },
264
+ {
265
+ name: 'asm_git',
266
+ description: `Git context and deployment tracking.
267
+
268
+ Actions:
269
+ - context: Get Git context (branch, commits, changes)
270
+ - conflicts: Predict merge conflicts
271
+ - deploy_track: Track deployment
272
+ - deploy_history: Get deployment history
273
+
274
+ Example: asm_git({ action: "context" })`,
275
+ inputSchema: {
276
+ type: 'object',
277
+ properties: {
278
+ action: { type: 'string', enum: ['context', 'conflicts', 'deploy_track', 'deploy_history'], description: 'Git action' },
279
+ path: { type: 'string', description: 'Repository path' },
280
+ branch: { type: 'string', description: 'Branch name' },
281
+ environment: { type: 'string', description: 'Deploy environment' },
282
+ version: { type: 'string', description: 'Deploy version' },
283
+ limit: { type: 'number', description: 'Max results' },
284
+ },
285
+ required: ['action'],
286
+ },
287
+ actionMap: {
288
+ 'context': { gatewayTool: 'asm_get_git_context', mapParams: (p) => ({ path: p.path }) },
289
+ 'conflicts': { gatewayTool: 'asm_predict_merge_conflicts', mapParams: (p) => ({ branch: p.branch }) },
290
+ 'deploy_track': { gatewayTool: 'asm_track_deployment', mapParams: (p) => ({ environment: p.environment, version: p.version }) },
291
+ 'deploy_history': { gatewayTool: 'asm_get_deployment_history', mapParams: (p) => ({ limit: p.limit }) },
292
+ },
293
+ defaultGatewayTool: 'asm_get_git_context',
294
+ },
295
+ {
296
+ name: 'asm_sandbox',
297
+ description: `Sandbox for safe code changes.
298
+
299
+ Actions:
300
+ - create: Create sandbox session
301
+ - change: Add change to sandbox
302
+ - preview: Preview changes
303
+ - apply: Apply changes
304
+ - revert: Revert changes
305
+
306
+ Example: asm_sandbox({ action: "create", name: "feature-x", description: "New feature" })`,
307
+ inputSchema: {
308
+ type: 'object',
309
+ properties: {
310
+ action: { type: 'string', enum: ['create', 'change', 'preview', 'apply', 'revert'], description: 'Sandbox action' },
311
+ name: { type: 'string', description: 'Sandbox name' },
312
+ description: { type: 'string', description: 'Sandbox description' },
313
+ session_id: { type: 'string', description: 'Session ID' },
314
+ path: { type: 'string', description: 'File path' },
315
+ operation: { type: 'string', enum: ['add', 'modify', 'delete'], description: 'Change operation' },
316
+ old_content: { type: 'string', description: 'Original content' },
317
+ new_content: { type: 'string', description: 'New content' },
318
+ project_path: { type: 'string', description: 'Project path' },
319
+ },
320
+ required: ['action'],
321
+ },
322
+ actionMap: {
323
+ 'create': { gatewayTool: 'asm_create_sandbox' },
324
+ 'change': { gatewayTool: 'asm_add_sandbox_change' },
325
+ 'preview': { gatewayTool: 'asm_preview_sandbox' },
326
+ 'apply': { gatewayTool: 'asm_apply_sandbox' },
327
+ 'revert': { gatewayTool: 'asm_revert_sandbox' },
328
+ },
329
+ defaultGatewayTool: 'asm_create_sandbox',
330
+ },
331
+ {
332
+ name: 'asm_semantic',
333
+ description: `Semantic code analysis.
334
+
335
+ Actions:
336
+ - analyze: Analyze file semantics
337
+ - references: Find all references
338
+ - definition: Go to definition
339
+ - symbols: Search workspace symbols
340
+ - prepare_rename: Prepare rename
341
+
342
+ Example: asm_semantic({ action: "analyze", target: "src/app.ts" })`,
343
+ inputSchema: {
344
+ type: 'object',
345
+ properties: {
346
+ action: { type: 'string', enum: ['analyze', 'references', 'definition', 'symbols', 'prepare_rename'], description: 'Semantic action' },
347
+ target: { type: 'string', description: 'Target to analyze' },
348
+ },
349
+ required: ['action'],
350
+ },
351
+ actionMap: {},
352
+ defaultGatewayTool: 'asm_semantic',
353
+ },
354
+ {
355
+ name: 'asm_knowledge',
356
+ description: `Knowledge base operations.
357
+
358
+ Actions:
359
+ - search: Search knowledge base
360
+ - index: Index content into knowledge base
361
+
362
+ Example: asm_knowledge({ action: "search", params: { query: "nuxt routing" } })`,
363
+ inputSchema: {
364
+ type: 'object',
365
+ properties: {
366
+ action: { type: 'string', enum: ['search', 'index'], description: 'Knowledge action' },
367
+ params: { type: 'object', description: 'Parameters' },
368
+ },
369
+ required: ['action'],
370
+ },
371
+ actionMap: {},
372
+ defaultGatewayTool: 'asm_knowledge',
373
+ },
374
+ {
375
+ name: 'asm_workflow',
376
+ description: `Gate workflow management.
377
+
378
+ Actions:
379
+ - start: Start workflow
380
+ - status: Get workflow status
381
+
382
+ Example: asm_workflow({ action: "start", workflow: "development" })`,
383
+ inputSchema: {
384
+ type: 'object',
385
+ properties: {
386
+ action: { type: 'string', enum: ['start', 'status'], description: 'Workflow action' },
387
+ workflow: { type: 'string', description: 'Workflow name' },
388
+ params: { type: 'object', description: 'Parameters' },
389
+ },
390
+ required: ['action'],
391
+ },
392
+ actionMap: {},
393
+ defaultGatewayTool: 'asm_workflow',
394
+ },
395
+ {
396
+ name: 'asm_rls',
397
+ description: `Supabase RLS policy management.
398
+
399
+ Actions:
400
+ - generate: Generate RLS policy
401
+ - audit: Audit existing RLS policies
402
+ - check: Check RLS status
403
+
404
+ Example: asm_rls({ action: "generate", table: "users", policy: "owner only" })`,
405
+ inputSchema: {
406
+ type: 'object',
407
+ properties: {
408
+ action: { type: 'string', enum: ['generate', 'audit', 'check'], description: 'RLS action' },
409
+ table: { type: 'string', description: 'Table name' },
410
+ policy: { type: 'string', description: 'Policy type' },
411
+ tables: { type: 'array', description: 'Tables to audit' },
412
+ },
413
+ required: ['action'],
414
+ },
415
+ actionMap: {
416
+ 'generate': { gatewayTool: 'asm_generate_rls_policy' },
417
+ 'audit': { gatewayTool: 'asm_audit_security_rls' },
418
+ 'check': { gatewayTool: 'asm_rls' },
419
+ },
420
+ defaultGatewayTool: 'asm_rls',
421
+ },
422
+ {
423
+ name: 'asm_deploy',
424
+ description: `Deployment, runbooks, and quality tracking.
425
+
426
+ Actions:
427
+ - deploy: Deploy application
428
+ - bug_track: Track a bug
429
+ - quality_metrics: Get quality metrics
430
+ - runbook_get: Get runbook
431
+ - runbook_store: Store runbook
432
+
433
+ Example: asm_deploy({ action: "deploy", target: "production" })`,
434
+ inputSchema: {
435
+ type: 'object',
436
+ properties: {
437
+ action: { type: 'string', enum: ['deploy', 'bug_track', 'quality_metrics', 'runbook_get', 'runbook_store'], description: 'Deploy action' },
438
+ target: { type: 'string', description: 'Deploy target' },
439
+ environment: { type: 'string', description: 'Environment' },
440
+ title: { type: 'string', description: 'Bug title' },
441
+ description: { type: 'string', description: 'Description' },
442
+ severity: { type: 'string', description: 'Severity' },
443
+ period: { type: 'string', description: 'Time period' },
444
+ name: { type: 'string', description: 'Runbook name' },
445
+ content: { type: 'string', description: 'Runbook content' },
446
+ },
447
+ required: ['action'],
448
+ },
449
+ actionMap: {
450
+ 'deploy': { gatewayTool: 'asm_deploy' },
451
+ 'bug_track': { gatewayTool: 'asm_track_bug' },
452
+ 'quality_metrics': { gatewayTool: 'asm_get_quality_metrics' },
453
+ 'runbook_get': { gatewayTool: 'asm_get_runbook' },
454
+ 'runbook_store': { gatewayTool: 'asm_store_runbook' },
455
+ },
456
+ defaultGatewayTool: 'asm_deploy',
457
+ },
458
+ {
459
+ name: 'asm_figma',
460
+ description: `Figma design integration.
461
+
462
+ Actions:
463
+ - analyze: Analyze Figma node structure
464
+ - generate: Generate component from Figma
465
+ - extract: Extract data from Figma
466
+ - live: Figma Live connector
467
+
468
+ Example: asm_figma({ action: "analyze", params: { node: {...} } })`,
469
+ inputSchema: {
470
+ type: 'object',
471
+ properties: {
472
+ action: { type: 'string', enum: ['analyze', 'generate', 'extract', 'live'], description: 'Figma action' },
473
+ node: { type: 'object', description: 'Figma node data' },
474
+ framework: { type: 'string', description: 'Target framework' },
475
+ componentName: { type: 'string', description: 'Component name' },
476
+ useTailwind: { type: 'boolean', description: 'Use Tailwind CSS' },
477
+ params: { type: 'object', description: 'Additional parameters' },
478
+ },
479
+ required: ['action'],
480
+ },
481
+ actionMap: {
482
+ 'analyze': { gatewayTool: 'asm_analyze_figma_node' },
483
+ 'generate': { gatewayTool: 'asm_generate_from_figma' },
484
+ 'extract': { gatewayTool: 'asm_figma' },
485
+ 'live': { gatewayTool: 'asm_figma_live' },
486
+ },
487
+ defaultGatewayTool: 'asm_figma',
488
+ },
489
+ // ============================================
490
+ // AI/OLLAMA TOOLS (2)
491
+ // ============================================
492
+ {
493
+ name: 'asm_ollama',
494
+ description: `Ollama AI integration for code review and fine-tuning.
495
+
496
+ Actions:
497
+ - status: Check Ollama availability
498
+ - review: Run AI code review
499
+ - feedback: Record review feedback
500
+ - metrics: Get review metrics
501
+ - export: Export training data
502
+ - finetune_check: Check fine-tuning readiness
503
+ - finetune_preview: Preview fine-tuning
504
+ - finetune_execute: Execute fine-tuning
505
+
506
+ Example: asm_ollama({ action: "review", files: ["src/app.ts"] })`,
507
+ inputSchema: {
508
+ type: 'object',
509
+ properties: {
510
+ action: { type: 'string', enum: ['status', 'review', 'feedback', 'metrics', 'export', 'finetune_check', 'finetune_preview', 'finetune_execute'], description: 'Ollama action' },
511
+ files: { type: 'array', items: { type: 'string' }, description: 'Files to review' },
512
+ focus_areas: { type: 'array', items: { type: 'string' }, description: 'Focus areas' },
513
+ model: { type: 'string', description: 'Model name' },
514
+ review_id: { type: 'string', description: 'Review ID' },
515
+ issue_id: { type: 'string', description: 'Issue ID' },
516
+ accepted: { type: 'boolean', description: 'Whether accepted' },
517
+ reason: { type: 'string', description: 'Reason' },
518
+ format: { type: 'string', description: 'Export format' },
519
+ confirmed: { type: 'boolean', description: 'Confirm execution' },
520
+ },
521
+ required: ['action'],
522
+ },
523
+ actionMap: {
524
+ 'status': { gatewayTool: 'asm_ollama_status' },
525
+ 'review': { gatewayTool: 'asm_ollama_review' },
526
+ 'feedback': { gatewayTool: 'asm_review_feedback' },
527
+ 'metrics': { gatewayTool: 'asm_get_review_metrics' },
528
+ 'export': { gatewayTool: 'asm_export_training_data' },
529
+ 'finetune_check': { gatewayTool: 'asm_finetune_check' },
530
+ 'finetune_preview': { gatewayTool: 'asm_finetune_preview' },
531
+ 'finetune_execute': { gatewayTool: 'asm_finetune_execute' },
532
+ },
533
+ defaultGatewayTool: 'asm_ollama',
534
+ },
535
+ {
536
+ name: 'asm_health',
537
+ description: `Get complete ASM health dashboard with all metrics.
538
+
539
+ Returns overall health score, memory stats, pattern progress, sync status, recommendations.
540
+
541
+ Example: asm_health({ includeRecommendations: true })`,
542
+ inputSchema: {
543
+ type: 'object',
544
+ properties: {
545
+ includeRecommendations: { type: 'boolean', description: 'Include recommendations' },
546
+ },
547
+ },
548
+ actionMap: {},
549
+ defaultGatewayTool: 'asm_get_asm_health',
550
+ },
551
+ // ============================================
552
+ // ORCHESTRATOR TOOLS (7)
553
+ // ============================================
554
+ {
555
+ name: 'asm_rules',
556
+ description: `Business and project rules management.
557
+
558
+ Actions:
559
+ - business_store: Store a business rule
560
+ - business_search: Search business rules
561
+ - business_validate: Validate code against rules
562
+ - business_get: Get rules for a domain
563
+ - project_store: Store a project rule
564
+ - project_get: Get project rules
565
+ - project_export: Export project rules
566
+
567
+ Example: asm_rules({ action: "business_store", name: "Daily limit", domain: "financial", description: "Max 5000" })`,
568
+ inputSchema: {
569
+ type: 'object',
570
+ properties: {
571
+ action: { type: 'string', enum: ['business_store', 'business_search', 'business_validate', 'business_get', 'project_store', 'project_get', 'project_export'], description: 'Rules action' },
572
+ name: { type: 'string', description: 'Rule name' },
573
+ domain: { type: 'string', description: 'Business domain' },
574
+ description: { type: 'string', description: 'Rule description' },
575
+ condition: { type: 'string', description: 'Condition expression' },
576
+ ruleAction: { type: 'string', description: 'Action when rule triggers' },
577
+ query: { type: 'string', description: 'Search query' },
578
+ code: { type: 'string', description: 'Code to validate' },
579
+ project: { type: 'string', description: 'Project name' },
580
+ category: { type: 'string', description: 'Rule category' },
581
+ rule: { type: 'string', description: 'Rule statement' },
582
+ rationale: { type: 'string', description: 'Rationale' },
583
+ format: { type: 'string', enum: ['md', 'json'], description: 'Export format' },
584
+ },
585
+ required: ['action'],
586
+ },
587
+ actionMap: {
588
+ 'business_store': { gatewayTool: 'asm_store_business_rule' },
589
+ 'business_search': { gatewayTool: 'asm_search_business_rules' },
590
+ 'business_validate': { gatewayTool: 'asm_validate_against_business_rules' },
591
+ 'business_get': { gatewayTool: 'asm_get_domain_rules' },
592
+ 'project_store': { gatewayTool: 'asm_store_project_rule' },
593
+ 'project_get': { gatewayTool: 'asm_get_project_rules' },
594
+ 'project_export': { gatewayTool: 'asm_export_project_rules' },
595
+ },
596
+ defaultGatewayTool: 'asm_rules',
597
+ },
598
+ {
599
+ name: 'asm_hooks',
600
+ description: `Git hooks management.
601
+
602
+ Actions:
603
+ - configure: Configure a git hook
604
+ - list: List configured hooks
605
+ - install: Install hooks in project
606
+
607
+ Example: asm_hooks({ action: "list" })`,
608
+ inputSchema: {
609
+ type: 'object',
610
+ properties: {
611
+ action: { type: 'string', enum: ['configure', 'list', 'install'], description: 'Hooks action' },
612
+ type: { type: 'string', description: 'Hook type (pre-commit, pre-push, etc)' },
613
+ actions: { type: 'array', items: { type: 'object' }, description: 'Hook actions' },
614
+ enabled: { type: 'boolean', description: 'Enable/disable' },
615
+ project_path: { type: 'string', description: 'Project path' },
616
+ },
617
+ required: ['action'],
618
+ },
619
+ actionMap: {
620
+ 'configure': { gatewayTool: 'asm_configure_git_hook' },
621
+ 'list': { gatewayTool: 'asm_list_git_hooks' },
622
+ 'install': { gatewayTool: 'asm_install_git_hooks' },
623
+ },
624
+ defaultGatewayTool: 'asm_list_git_hooks',
625
+ },
626
+ {
627
+ name: 'asm_catalog',
628
+ description: `Component catalog management.
629
+
630
+ Actions:
631
+ - get: Get component catalog
632
+ - suggest: Search for matching component
633
+
634
+ Example: asm_catalog({ action: "suggest", description: "button with loading" })`,
635
+ inputSchema: {
636
+ type: 'object',
637
+ properties: {
638
+ action: { type: 'string', enum: ['get', 'suggest'], description: 'Catalog action' },
639
+ category: { type: 'string', description: 'Category filter' },
640
+ description: { type: 'string', description: 'Component description' },
641
+ },
642
+ required: ['action'],
643
+ },
644
+ actionMap: {},
645
+ defaultGatewayTool: 'asm_orchestrate',
646
+ },
647
+ {
648
+ name: 'asm_metrics',
649
+ description: `Metrics and analytics.
650
+
651
+ Actions:
652
+ - get: Get metrics
653
+ - define: Define custom metric
654
+ - recommendations: Get metric recommendations
655
+
656
+ Example: asm_metrics({ action: "get", type: "quality" })`,
657
+ inputSchema: {
658
+ type: 'object',
659
+ properties: {
660
+ action: { type: 'string', enum: ['get', 'define', 'recommendations'], description: 'Metrics action' },
661
+ type: { type: 'string', description: 'Metric type' },
662
+ period: { type: 'string', description: 'Time period' },
663
+ name: { type: 'string', description: 'Metric name' },
664
+ description: { type: 'string', description: 'Metric description' },
665
+ },
666
+ required: ['action'],
667
+ },
668
+ actionMap: {},
669
+ defaultGatewayTool: 'asm_metrics',
670
+ },
671
+ {
672
+ name: 'asm_obsidian',
673
+ description: `Obsidian vault integration.
674
+
675
+ Actions:
676
+ - sync: Sync ASM data to Obsidian vault
677
+ - dashboard: Generate Dataview dashboard
678
+ - configure: Configure integration
679
+ - status: Get integration status
680
+
681
+ Example: asm_obsidian({ action: "sync", vaultPath: "/path/to/vault" })`,
682
+ inputSchema: {
683
+ type: 'object',
684
+ properties: {
685
+ action: { type: 'string', enum: ['sync', 'dashboard', 'configure', 'status'], description: 'Obsidian action' },
686
+ vaultPath: { type: 'string', description: 'Vault path' },
687
+ },
688
+ required: ['action'],
689
+ },
690
+ actionMap: {},
691
+ defaultGatewayTool: 'asm_orchestrate',
692
+ },
693
+ {
694
+ name: 'asm_personas',
695
+ description: `Agent personas management.
696
+
697
+ Actions:
698
+ - activate: Activate persona
699
+ - deactivate: Deactivate persona
700
+ - list: List personas
701
+
702
+ Example: asm_personas({ action: "list" })`,
703
+ inputSchema: {
704
+ type: 'object',
705
+ properties: {
706
+ action: { type: 'string', enum: ['activate', 'deactivate', 'list'], description: 'Personas action' },
707
+ personaId: { type: 'string', description: 'Persona ID' },
708
+ },
709
+ required: ['action'],
710
+ },
711
+ actionMap: {
712
+ 'list': { gatewayTool: 'asm_list_personas' },
713
+ },
714
+ defaultGatewayTool: 'asm_list_personas',
715
+ },
716
+ {
717
+ name: 'asm_learning',
718
+ description: `Learning mode management.
719
+
720
+ Actions:
721
+ - enable: Enable learning mode
722
+ - disable: Disable learning mode
723
+ - status: Get learning status
724
+ - explain: Explain a pattern
725
+
726
+ Example: asm_learning({ action: "enable", level: "junior" })`,
727
+ inputSchema: {
728
+ type: 'object',
729
+ properties: {
730
+ action: { type: 'string', enum: ['enable', 'disable', 'status', 'explain'], description: 'Learning action' },
731
+ level: { type: 'string', enum: ['junior', 'mid', 'senior'], description: 'Learning level' },
732
+ patternId: { type: 'string', description: 'Pattern ID to explain' },
733
+ },
734
+ required: ['action'],
735
+ },
736
+ actionMap: {},
737
+ defaultGatewayTool: 'asm_orchestrate',
738
+ },
739
+ // ============================================
740
+ // PROACTIVE TOOL (1)
741
+ // ============================================
742
+ {
743
+ name: 'asm_proactive',
744
+ description: `Proactive suggestions, recommendations, and impact analysis.
745
+
746
+ Actions:
747
+ - suggestions: Get proactive suggestions
748
+ - recommendations: Get file recommendations
749
+ - feedback: Record recommendation feedback
750
+ - impact: Analyze change impact
751
+ - lessons: Store lesson learned
752
+ - vision: Discover product vision
753
+
754
+ Example: asm_proactive({ action: "suggestions", context: { task: "criar API" } })`,
755
+ inputSchema: {
756
+ type: 'object',
757
+ properties: {
758
+ action: { type: 'string', enum: ['suggestions', 'recommendations', 'feedback', 'impact', 'lessons', 'vision'], description: 'Proactive action' },
759
+ context: { type: 'object', description: 'Current context' },
760
+ file: { type: 'string', description: 'File for recommendations/impact' },
761
+ types: { type: 'array', items: { type: 'string' }, description: 'Recommendation types' },
762
+ recommendation_id: { type: 'string', description: 'Recommendation ID' },
763
+ files: { type: 'array', items: { type: 'string' }, description: 'Files changed' },
764
+ category: { type: 'string', description: 'Lesson category' },
765
+ lesson: { type: 'string', description: 'Lesson content' },
766
+ },
767
+ required: ['action'],
768
+ },
769
+ actionMap: {
770
+ 'suggestions': { gatewayTool: 'asm_proactive' },
771
+ 'recommendations': { gatewayTool: 'asm_get_recommendations' },
772
+ 'feedback': { gatewayTool: 'asm_recommendation_feedback' },
773
+ 'impact': { gatewayTool: 'asm_analyze_impact' },
774
+ 'lessons': { gatewayTool: 'asm_store_lesson' },
775
+ 'vision': { gatewayTool: 'asm_discover_product_vision' },
776
+ },
777
+ defaultGatewayTool: 'asm_proactive',
778
+ },
779
+ // ============================================
780
+ // AGENT CO-PILOT TOOLS (3)
781
+ // ============================================
782
+ {
783
+ name: 'asm_agent_start_session',
784
+ description: `Start an ASM Agent session with full context recovery.
785
+
786
+ Example: asm_agent_start_session({ message: "criar API de pagamentos" })`,
787
+ inputSchema: {
788
+ type: 'object',
789
+ properties: {
790
+ message: { type: 'string', description: 'Initial message or intent' },
791
+ mode: { type: 'string', enum: ['assisted', 'semi_autonomous', 'autonomous'], description: 'Agent mode' },
792
+ },
793
+ required: ['message'],
794
+ },
795
+ actionMap: {},
796
+ defaultGatewayTool: 'asm_orchestrate',
797
+ },
798
+ {
799
+ name: 'asm_agent_analyze',
800
+ description: `Analyze a user message and get intelligent suggestions.
801
+
802
+ Example: asm_agent_analyze({ message: "corrigir bug no login" })`,
803
+ inputSchema: {
804
+ type: 'object',
805
+ properties: {
806
+ message: { type: 'string', description: 'User message to analyze' },
807
+ context: { type: 'object', description: 'Additional context' },
808
+ },
809
+ required: ['message'],
810
+ },
811
+ actionMap: {},
812
+ defaultGatewayTool: 'asm_orchestrate',
813
+ },
814
+ {
815
+ name: 'asm_agent_validate',
816
+ description: `Validate code through the mitigation pipeline.
817
+
818
+ Example: asm_agent_validate({ code: "const x = 1;" })`,
819
+ inputSchema: {
820
+ type: 'object',
821
+ properties: {
822
+ code: { type: 'string', description: 'Code to validate' },
823
+ context: { type: 'object', description: 'Validation context' },
824
+ },
825
+ required: ['code'],
826
+ },
827
+ actionMap: {},
828
+ defaultGatewayTool: 'asm_validate',
829
+ },
830
+ // ============================================
831
+ // FRAMEWORK TOOL (1)
832
+ // ============================================
833
+ {
834
+ name: 'asm_framework',
835
+ description: `Agent Framework - Unified tool for session, intent, context, action, and event management.
836
+
837
+ Domains: session, intent, context, action, event
838
+
839
+ Examples:
840
+ - asm_framework({ domain: "context", action: "get" })
841
+ - asm_framework({ domain: "intent", action: "analyze", message: "criar componente" })`,
842
+ inputSchema: {
843
+ type: 'object',
844
+ properties: {
845
+ domain: { type: 'string', enum: ['session', 'intent', 'context', 'action', 'event'], description: 'Domain' },
846
+ action: { type: 'string', description: 'Action within domain' },
847
+ message: { type: 'string', description: 'User message' },
848
+ config: { type: 'object', description: 'Session config' },
849
+ context: { type: 'object', description: 'Context' },
850
+ sessionId: { type: 'string', description: 'Session ID' },
851
+ },
852
+ required: ['domain', 'action'],
853
+ },
854
+ actionMap: {},
855
+ defaultGatewayTool: 'asm_framework',
856
+ },
857
+ // ============================================
858
+ // SESSION SNAPSHOT (1)
859
+ // ============================================
860
+ {
861
+ name: 'asm_snapshot',
862
+ description: `Session snapshot management for auto-recovery.
863
+
864
+ Actions:
865
+ - save: Save snapshot
866
+ - auto_recover: Auto-recovery on startup
867
+ - get: Get last snapshot
868
+ - flush: Force save
869
+ - clear: Clear snapshot
870
+
871
+ Example: asm_snapshot({ action: "auto_recover", projectPath: "/" })`,
872
+ inputSchema: {
873
+ type: 'object',
874
+ properties: {
875
+ action: { type: 'string', enum: ['save', 'auto_recover', 'get', 'flush', 'clear', 'add_action', 'add_intention', 'update_intention', 'remove_intention', 'update_metrics'], description: 'Snapshot action' },
876
+ projectPath: { type: 'string', description: 'Project path' },
877
+ what: { type: 'string', description: 'What is being done' },
878
+ context: { type: 'string', description: 'Current context' },
879
+ nextStep: { type: 'string', description: 'Next step' },
880
+ },
881
+ required: ['action'],
882
+ },
883
+ actionMap: {},
884
+ defaultGatewayTool: 'asm_snapshot',
885
+ },
886
+ // ============================================
887
+ // MCP MASTER (1)
888
+ // ============================================
889
+ {
890
+ name: 'asm_mcp',
891
+ description: `Master MCP Orchestrator - ASM as orchestrator of external MCPs.
892
+
893
+ Actions: list, connect, disconnect, call, auto, orchestrate, status, register
894
+
895
+ Example: asm_mcp({ action: "list" })`,
896
+ inputSchema: {
897
+ type: 'object',
898
+ properties: {
899
+ action: { type: 'string', enum: ['list', 'connect', 'disconnect', 'call', 'auto', 'orchestrate', 'status', 'register'], description: 'MCP action' },
900
+ mcp: { type: 'string', description: 'MCP name' },
901
+ tool: { type: 'string', description: 'Tool name' },
902
+ params: { type: 'object', description: 'Parameters' },
903
+ },
904
+ required: ['action'],
905
+ },
906
+ actionMap: {},
907
+ defaultGatewayTool: 'asm_orchestrate',
908
+ },
909
+ // ============================================
910
+ // TERMINAL (1)
911
+ // ============================================
912
+ {
913
+ name: 'asm_terminal',
914
+ description: `Execute terminal commands safely.
915
+
916
+ Actions: exec, batch, npm, git, sqlite, build, test, lint
917
+
918
+ Example: asm_terminal({ action: "exec", command: "ls -la" })`,
919
+ inputSchema: {
920
+ type: 'object',
921
+ properties: {
922
+ action: { type: 'string', enum: ['exec', 'batch', 'npm', 'git', 'sqlite', 'build', 'test', 'lint'], description: 'Terminal action' },
923
+ command: { type: 'string', description: 'Command to execute' },
924
+ commands: { type: 'array', items: { type: 'string' }, description: 'Commands for batch' },
925
+ cwd: { type: 'string', description: 'Working directory' },
926
+ timeout: { type: 'number', description: 'Timeout in ms' },
927
+ },
928
+ required: ['action'],
929
+ },
930
+ actionMap: {},
931
+ defaultGatewayTool: 'asm_orchestrate',
932
+ },
933
+ // ============================================
934
+ // GATEWAY BRIDGE (1)
935
+ // ============================================
936
+ {
937
+ name: 'asm_gateway',
938
+ description: `AI Gateway Bridge - Access cloud AI models.
939
+
940
+ Actions: plan, code_generate, code_review, quick, discover, architecture, models, health
941
+
942
+ Example: asm_gateway({ action: "quick", question: "How to use Nuxt 4?" })`,
943
+ inputSchema: {
944
+ type: 'object',
945
+ properties: {
946
+ action: { type: 'string', enum: ['plan', 'code_generate', 'code_review', 'quick', 'discover', 'architecture', 'models', 'health'], description: 'Gateway action' },
947
+ objective: { type: 'string', description: 'Objective for planning' },
948
+ task: { type: 'string', description: 'Task for code generation' },
949
+ language: { type: 'string', description: 'Programming language' },
950
+ code: { type: 'string', description: 'Code to review' },
951
+ question: { type: 'string', description: 'Question for quick answer' },
952
+ context: { type: 'string', description: 'Context' },
953
+ requirements: { type: 'string', description: 'Requirements' },
954
+ },
955
+ required: ['action'],
956
+ },
957
+ actionMap: {},
958
+ defaultGatewayTool: 'asm_gateway',
959
+ },
960
+ // ============================================
961
+ // ROO CODE INTEGRATION (2)
962
+ // ============================================
963
+ {
964
+ name: 'asm_write',
965
+ description: `Write file with ASM enforcement and pattern validation.
966
+
967
+ Example: asm_write({ action: "file", path: "src/app.ts", content: "...", reason: "Create module" })`,
968
+ inputSchema: {
969
+ type: 'object',
970
+ properties: {
971
+ action: { type: 'string', enum: ['file'], description: 'Write action' },
972
+ path: { type: 'string', description: 'File path' },
973
+ content: { type: 'string', description: 'File content' },
974
+ reason: { type: 'string', description: 'Reason for write' },
975
+ },
976
+ required: ['action', 'path', 'content'],
977
+ },
978
+ actionMap: {},
979
+ defaultGatewayTool: 'asm_orchestrate',
980
+ },
981
+ {
982
+ name: 'asm_propose',
983
+ description: `Propose file write without executing (for discovery mode).
984
+
985
+ Example: asm_propose({ action: "file", path: "src/app.ts", content: "...", reason: "Propose module" })`,
986
+ inputSchema: {
987
+ type: 'object',
988
+ properties: {
989
+ action: { type: 'string', enum: ['file'], description: 'Propose action' },
990
+ path: { type: 'string', description: 'File path' },
991
+ content: { type: 'string', description: 'File content' },
992
+ reason: { type: 'string', description: 'Reason' },
993
+ },
994
+ required: ['action', 'path', 'content'],
995
+ },
996
+ actionMap: {},
997
+ defaultGatewayTool: 'asm_orchestrate',
998
+ },
999
+ // ============================================
1000
+ // INTENT ROUTER (1)
1001
+ // ============================================
1002
+ {
1003
+ name: 'asm_intent',
1004
+ description: `Classify user intent and suggest gate/tools.
1005
+
1006
+ Actions: classify, stats, suggestGate, suggestTools
1007
+
1008
+ Example: asm_intent({ action: "classify", message: "Criar componente Vue" })`,
1009
+ inputSchema: {
1010
+ type: 'object',
1011
+ properties: {
1012
+ action: { type: 'string', enum: ['classify', 'stats', 'suggestGate', 'suggestTools'], description: 'Intent action' },
1013
+ message: { type: 'string', description: 'User message' },
1014
+ context: { type: 'object', description: 'Additional context' },
1015
+ },
1016
+ required: ['action'],
1017
+ },
1018
+ actionMap: {},
1019
+ defaultGatewayTool: 'asm_intent',
1020
+ },
1021
+ // ============================================
1022
+ // EXECUTION ENGINE (1)
1023
+ // ============================================
1024
+ {
1025
+ name: 'asm_execution',
1026
+ description: `Execute task with autonomous reasoning loop.
1027
+
1028
+ Actions: execute, stats
1029
+
1030
+ Example: asm_execution({ action: "execute", description: "Create login component" })`,
1031
+ inputSchema: {
1032
+ type: 'object',
1033
+ properties: {
1034
+ action: { type: 'string', enum: ['execute', 'stats'], description: 'Execution action' },
1035
+ description: { type: 'string', description: 'Task description' },
1036
+ context: { type: 'object', description: 'Task context' },
1037
+ maxIterations: { type: 'number', description: 'Max iterations' },
1038
+ timeout: { type: 'number', description: 'Timeout in ms' },
1039
+ },
1040
+ required: ['action'],
1041
+ },
1042
+ actionMap: {},
1043
+ defaultGatewayTool: 'asm_orchestrate',
1044
+ },
1045
+ // ============================================
1046
+ // AI DIRECT TOOLS (3) - from gateway
1047
+ // ============================================
1048
+ {
1049
+ name: 'asm_ai_chat',
1050
+ description: `Chat with AI (Llama 3.1 8B or configured model).
1051
+
1052
+ Example: asm_ai_chat({ messages: [{ role: "user", content: "Hello" }] })`,
1053
+ inputSchema: {
1054
+ type: 'object',
1055
+ properties: {
1056
+ messages: { type: 'array', description: 'Chat messages' },
1057
+ model: { type: 'string', description: 'Model name' },
1058
+ },
1059
+ required: ['messages'],
1060
+ },
1061
+ actionMap: {},
1062
+ defaultGatewayTool: 'asm_ai_chat',
1063
+ },
1064
+ {
1065
+ name: 'asm_ai_plan',
1066
+ description: `Generate implementation plan.
1067
+
1068
+ Example: asm_ai_plan({ task: "Create user API" })`,
1069
+ inputSchema: {
1070
+ type: 'object',
1071
+ properties: {
1072
+ task: { type: 'string', description: 'Task description' },
1073
+ context: { type: 'object', description: 'Context' },
1074
+ },
1075
+ required: ['task'],
1076
+ },
1077
+ actionMap: {},
1078
+ defaultGatewayTool: 'asm_ai_plan',
1079
+ },
1080
+ {
1081
+ name: 'asm_ai_review',
1082
+ description: `Review code with AI.
1083
+
1084
+ Example: asm_ai_review({ code: "const x = 1;", focus: "security" })`,
1085
+ inputSchema: {
1086
+ type: 'object',
1087
+ properties: {
1088
+ code: { type: 'string', description: 'Code to review' },
1089
+ focus: { type: 'string', description: 'Review focus' },
1090
+ },
1091
+ required: ['code'],
1092
+ },
1093
+ actionMap: {},
1094
+ defaultGatewayTool: 'asm_ai_review',
1095
+ },
1096
+ // ============================================
1097
+ // ADDITIONAL CLOUD TOOLS (storage, vectors, cache, browser, etc.)
1098
+ // ============================================
1099
+ {
1100
+ name: 'asm_storage',
1101
+ description: `R2 storage operations.
1102
+
1103
+ Actions:
1104
+ - put: Store file in R2
1105
+ - get: Get file from R2
1106
+ - delete: Delete file from R2
1107
+
1108
+ Example: asm_storage({ action: "put", key: "data/file.json", content: "{}" })`,
1109
+ inputSchema: {
1110
+ type: 'object',
1111
+ properties: {
1112
+ action: { type: 'string', enum: ['put', 'get', 'delete'], description: 'Storage action' },
1113
+ key: { type: 'string', description: 'File key/path' },
1114
+ content: { type: 'string', description: 'File content' },
1115
+ contentType: { type: 'string', description: 'Content type' },
1116
+ },
1117
+ required: ['action', 'key'],
1118
+ },
1119
+ actionMap: {
1120
+ 'put': { gatewayTool: 'asm_storage_put' },
1121
+ 'get': { gatewayTool: 'asm_storage_get' },
1122
+ 'delete': { gatewayTool: 'asm_storage_delete' },
1123
+ },
1124
+ defaultGatewayTool: 'asm_storage_get',
1125
+ },
1126
+ {
1127
+ name: 'asm_vectors',
1128
+ description: `Vector database operations (Vectorize).
1129
+
1130
+ Actions:
1131
+ - upsert: Upsert vector
1132
+ - query: Query similar vectors
1133
+ - embeddings: Generate embeddings
1134
+
1135
+ Example: asm_vectors({ action: "query", values: [0.1, 0.2], topK: 5 })`,
1136
+ inputSchema: {
1137
+ type: 'object',
1138
+ properties: {
1139
+ action: { type: 'string', enum: ['upsert', 'query', 'embeddings'], description: 'Vector action' },
1140
+ id: { type: 'string', description: 'Vector ID' },
1141
+ values: { type: 'array', description: 'Vector values' },
1142
+ metadata: { type: 'object', description: 'Metadata' },
1143
+ topK: { type: 'number', description: 'Number of results' },
1144
+ filter: { type: 'object', description: 'Metadata filter' },
1145
+ text: { type: 'string', description: 'Text to embed' },
1146
+ },
1147
+ required: ['action'],
1148
+ },
1149
+ actionMap: {
1150
+ 'upsert': { gatewayTool: 'asm_vector_upsert' },
1151
+ 'query': { gatewayTool: 'asm_vector_query' },
1152
+ 'embeddings': { gatewayTool: 'asm_generate_embeddings' },
1153
+ },
1154
+ defaultGatewayTool: 'asm_vector_query',
1155
+ },
1156
+ {
1157
+ name: 'asm_cache',
1158
+ description: `Cache operations (KV).
1159
+
1160
+ Actions:
1161
+ - get: Get value from cache
1162
+ - set: Set value in cache
1163
+
1164
+ Example: asm_cache({ action: "get", key: "my-key" })`,
1165
+ inputSchema: {
1166
+ type: 'object',
1167
+ properties: {
1168
+ action: { type: 'string', enum: ['get', 'set'], description: 'Cache action' },
1169
+ key: { type: 'string', description: 'Cache key' },
1170
+ value: { type: 'object', description: 'Value to cache' },
1171
+ ttl: { type: 'number', description: 'TTL in seconds' },
1172
+ },
1173
+ required: ['action', 'key'],
1174
+ },
1175
+ actionMap: {
1176
+ 'get': { gatewayTool: 'asm_cache_get' },
1177
+ 'set': { gatewayTool: 'asm_cache_set' },
1178
+ },
1179
+ defaultGatewayTool: 'asm_cache_get',
1180
+ },
1181
+ {
1182
+ name: 'asm_browser',
1183
+ description: `Browser automation and platform discovery.
1184
+
1185
+ Actions: discover, navigate, etc.
1186
+
1187
+ Example: asm_browser({ action: "discover", url: "https://example.com" })`,
1188
+ inputSchema: {
1189
+ type: 'object',
1190
+ properties: {
1191
+ action: { type: 'string', description: 'Browser action' },
1192
+ url: { type: 'string', description: 'URL' },
1193
+ params: { type: 'object', description: 'Parameters' },
1194
+ },
1195
+ required: ['action'],
1196
+ },
1197
+ actionMap: {},
1198
+ defaultGatewayTool: 'asm_browser',
1199
+ },
1200
+ {
1201
+ name: 'asm_generate_text',
1202
+ description: `Generate text using AI.
1203
+
1204
+ Example: asm_generate_text({ prompt: "Explain Nuxt 4 routing" })`,
1205
+ inputSchema: {
1206
+ type: 'object',
1207
+ properties: {
1208
+ prompt: { type: 'string', description: 'Prompt for generation' },
1209
+ max_tokens: { type: 'number', description: 'Max tokens' },
1210
+ },
1211
+ required: ['prompt'],
1212
+ },
1213
+ actionMap: {},
1214
+ defaultGatewayTool: 'asm_generate_text',
1215
+ },
1216
+ {
1217
+ name: 'asm_orchestrate',
1218
+ description: `Dynamic tool orchestration - analyze, execute, or route complex requests.
1219
+
1220
+ Actions: analyze, execute, figma, etc.
1221
+
1222
+ Example: asm_orchestrate({ action: "analyze", message: "Create user API" })`,
1223
+ inputSchema: {
1224
+ type: 'object',
1225
+ properties: {
1226
+ action: { type: 'string', description: 'Orchestration action' },
1227
+ message: { type: 'string', description: 'User message' },
1228
+ params: { type: 'object', description: 'Parameters' },
1229
+ },
1230
+ required: ['action'],
1231
+ },
1232
+ actionMap: {},
1233
+ defaultGatewayTool: 'asm_orchestrate',
1234
+ },
1235
+ ];
1236
+ /**
1237
+ * Get all consolidated tool definitions formatted for MCP tools/list
1238
+ */
1239
+ function getConsolidatedToolDefinitions() {
1240
+ return exports.CONSOLIDATED_TOOLS.map(tool => ({
1241
+ name: tool.name,
1242
+ description: tool.description,
1243
+ inputSchema: tool.inputSchema,
1244
+ }));
1245
+ }
1246
+ /**
1247
+ * Find a consolidated tool by name
1248
+ */
1249
+ function findConsolidatedTool(name) {
1250
+ return exports.CONSOLIDATED_TOOLS.find(t => t.name === name);
1251
+ }
1252
+ /**
1253
+ * Resolve a consolidated tool call to the actual gateway tool name and params
1254
+ */
1255
+ function resolveGatewayCall(toolName, args) {
1256
+ const tool = findConsolidatedTool(toolName);
1257
+ if (!tool)
1258
+ return null;
1259
+ const action = args.action;
1260
+ // Check action map first
1261
+ if (action && tool.actionMap[action]) {
1262
+ const mapping = tool.actionMap[action];
1263
+ const gatewayArgs = mapping.mapParams ? mapping.mapParams(args) : args;
1264
+ return { gatewayTool: mapping.gatewayTool, gatewayArgs };
1265
+ }
1266
+ // Fall back to default gateway tool
1267
+ if (tool.defaultGatewayTool) {
1268
+ return { gatewayTool: tool.defaultGatewayTool, gatewayArgs: args };
1269
+ }
1270
+ return null;
1271
+ }
1272
+ /**
1273
+ * Check if a tool name is a consolidated tool
1274
+ */
1275
+ function isConsolidatedTool(name) {
1276
+ return exports.CONSOLIDATED_TOOLS.some(t => t.name === name);
1277
+ }
1278
+ /**
1279
+ * Get count of consolidated tools
1280
+ */
1281
+ function getConsolidatedToolCount() {
1282
+ return exports.CONSOLIDATED_TOOLS.length;
1283
+ }
1284
+ //# sourceMappingURL=consolidated-tools.js.map