@defai.digital/ax-cli 4.4.6 → 4.4.10
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/bin/ax-cli +1 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +158 -9
- package/dist/index.js.map +1 -1
- package/dist/setup.d.ts +27 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +591 -0
- package/dist/setup.js.map +1 -0
- package/package.json +43 -135
- package/LICENSE +0 -22
- package/README.md +0 -387
- package/config-defaults/messages.yaml +0 -75
- package/config-defaults/models.yaml +0 -57
- package/config-defaults/prompts.yaml +0 -948
- package/config-defaults/settings.yaml +0 -157
- package/dist/agent/agent-executor.d.ts +0 -61
- package/dist/agent/agent-executor.js +0 -194
- package/dist/agent/agent-executor.js.map +0 -1
- package/dist/agent/agent-router.d.ts +0 -68
- package/dist/agent/agent-router.js +0 -242
- package/dist/agent/agent-router.js.map +0 -1
- package/dist/agent/context-manager.d.ts +0 -122
- package/dist/agent/context-manager.js +0 -406
- package/dist/agent/context-manager.js.map +0 -1
- package/dist/agent/core/index.d.ts +0 -8
- package/dist/agent/core/index.js +0 -9
- package/dist/agent/core/index.js.map +0 -1
- package/dist/agent/core/types.d.ts +0 -92
- package/dist/agent/core/types.js +0 -11
- package/dist/agent/core/types.js.map +0 -1
- package/dist/agent/dependency-resolver.d.ts +0 -90
- package/dist/agent/dependency-resolver.js +0 -366
- package/dist/agent/dependency-resolver.js.map +0 -1
- package/dist/agent/execution/index.d.ts +0 -9
- package/dist/agent/execution/index.js +0 -9
- package/dist/agent/execution/index.js.map +0 -1
- package/dist/agent/execution/tool-executor.d.ts +0 -93
- package/dist/agent/execution/tool-executor.js +0 -552
- package/dist/agent/execution/tool-executor.js.map +0 -1
- package/dist/agent/index.d.ts +0 -14
- package/dist/agent/index.js +0 -145
- package/dist/agent/index.js.map +0 -1
- package/dist/agent/llm-agent.d.ts +0 -368
- package/dist/agent/llm-agent.js +0 -1931
- package/dist/agent/llm-agent.js.map +0 -1
- package/dist/agent/loop-detector.d.ts +0 -72
- package/dist/agent/loop-detector.js +0 -335
- package/dist/agent/loop-detector.js.map +0 -1
- package/dist/agent/parallel-tools.d.ts +0 -69
- package/dist/agent/parallel-tools.js +0 -188
- package/dist/agent/parallel-tools.js.map +0 -1
- package/dist/agent/planning/index.d.ts +0 -9
- package/dist/agent/planning/index.js +0 -9
- package/dist/agent/planning/index.js.map +0 -1
- package/dist/agent/planning/plan-executor.d.ts +0 -79
- package/dist/agent/planning/plan-executor.js +0 -240
- package/dist/agent/planning/plan-executor.js.map +0 -1
- package/dist/agent/progress-tracker.d.ts +0 -94
- package/dist/agent/progress-tracker.js +0 -225
- package/dist/agent/progress-tracker.js.map +0 -1
- package/dist/agent/specialized/analysis-agent.d.ts +0 -11
- package/dist/agent/specialized/analysis-agent.js +0 -24
- package/dist/agent/specialized/analysis-agent.js.map +0 -1
- package/dist/agent/specialized/debug-agent.d.ts +0 -11
- package/dist/agent/specialized/debug-agent.js +0 -46
- package/dist/agent/specialized/debug-agent.js.map +0 -1
- package/dist/agent/specialized/documentation-agent.d.ts +0 -11
- package/dist/agent/specialized/documentation-agent.js +0 -24
- package/dist/agent/specialized/documentation-agent.js.map +0 -1
- package/dist/agent/specialized/index.d.ts +0 -11
- package/dist/agent/specialized/index.js +0 -12
- package/dist/agent/specialized/index.js.map +0 -1
- package/dist/agent/specialized/performance-agent.d.ts +0 -11
- package/dist/agent/specialized/performance-agent.js +0 -24
- package/dist/agent/specialized/performance-agent.js.map +0 -1
- package/dist/agent/specialized/refactoring-agent.d.ts +0 -11
- package/dist/agent/specialized/refactoring-agent.js +0 -24
- package/dist/agent/specialized/refactoring-agent.js.map +0 -1
- package/dist/agent/specialized/testing-agent.d.ts +0 -11
- package/dist/agent/specialized/testing-agent.js +0 -24
- package/dist/agent/specialized/testing-agent.js.map +0 -1
- package/dist/agent/status-reporter.d.ts +0 -114
- package/dist/agent/status-reporter.js +0 -335
- package/dist/agent/status-reporter.js.map +0 -1
- package/dist/agent/streaming/index.d.ts +0 -9
- package/dist/agent/streaming/index.js +0 -9
- package/dist/agent/streaming/index.js.map +0 -1
- package/dist/agent/streaming/stream-handler.d.ts +0 -62
- package/dist/agent/streaming/stream-handler.js +0 -217
- package/dist/agent/streaming/stream-handler.js.map +0 -1
- package/dist/agent/subagent-orchestrator.d.ts +0 -166
- package/dist/agent/subagent-orchestrator.js +0 -487
- package/dist/agent/subagent-orchestrator.js.map +0 -1
- package/dist/agent/subagent-types.d.ts +0 -261
- package/dist/agent/subagent-types.js +0 -257
- package/dist/agent/subagent-types.js.map +0 -1
- package/dist/agent/subagent.d.ts +0 -116
- package/dist/agent/subagent.js +0 -507
- package/dist/agent/subagent.js.map +0 -1
- package/dist/checkpoint/index.d.ts +0 -9
- package/dist/checkpoint/index.js +0 -11
- package/dist/checkpoint/index.js.map +0 -1
- package/dist/checkpoint/manager.d.ts +0 -101
- package/dist/checkpoint/manager.js +0 -407
- package/dist/checkpoint/manager.js.map +0 -1
- package/dist/checkpoint/storage.d.ts +0 -39
- package/dist/checkpoint/storage.js +0 -350
- package/dist/checkpoint/storage.js.map +0 -1
- package/dist/checkpoint/types.d.ts +0 -111
- package/dist/checkpoint/types.js +0 -17
- package/dist/checkpoint/types.js.map +0 -1
- package/dist/commands/cache.d.ts +0 -7
- package/dist/commands/cache.js +0 -284
- package/dist/commands/cache.js.map +0 -1
- package/dist/commands/custom-commands.d.ts +0 -77
- package/dist/commands/custom-commands.js +0 -251
- package/dist/commands/custom-commands.js.map +0 -1
- package/dist/commands/design.d.ts +0 -18
- package/dist/commands/design.js +0 -511
- package/dist/commands/design.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -6
- package/dist/commands/doctor.js +0 -773
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/frontend.d.ts +0 -9
- package/dist/commands/frontend.js +0 -645
- package/dist/commands/frontend.js.map +0 -1
- package/dist/commands/init/wizard.d.ts +0 -55
- package/dist/commands/init/wizard.js +0 -189
- package/dist/commands/init/wizard.js.map +0 -1
- package/dist/commands/init.d.ts +0 -8
- package/dist/commands/init.js +0 -195
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/mcp-migrate.d.ts +0 -9
- package/dist/commands/mcp-migrate.js +0 -175
- package/dist/commands/mcp-migrate.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -2
- package/dist/commands/mcp.js +0 -1292
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/memory.d.ts +0 -6
- package/dist/commands/memory.js +0 -555
- package/dist/commands/memory.js.map +0 -1
- package/dist/commands/models.d.ts +0 -5
- package/dist/commands/models.js +0 -213
- package/dist/commands/models.js.map +0 -1
- package/dist/commands/plan.d.ts +0 -43
- package/dist/commands/plan.js +0 -362
- package/dist/commands/plan.js.map +0 -1
- package/dist/commands/rewind.d.ts +0 -19
- package/dist/commands/rewind.js +0 -221
- package/dist/commands/rewind.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -14
- package/dist/commands/setup.js +0 -733
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/status.d.ts +0 -7
- package/dist/commands/status.js +0 -437
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/templates.d.ts +0 -5
- package/dist/commands/templates.js +0 -245
- package/dist/commands/templates.js.map +0 -1
- package/dist/commands/update.d.ts +0 -49
- package/dist/commands/update.js +0 -366
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/usage.d.ts +0 -8
- package/dist/commands/usage.js +0 -264
- package/dist/commands/usage.js.map +0 -1
- package/dist/commands/vscode.d.ts +0 -7
- package/dist/commands/vscode.js +0 -419
- package/dist/commands/vscode.js.map +0 -1
- package/dist/constants.d.ts +0 -236
- package/dist/constants.js +0 -288
- package/dist/constants.js.map +0 -1
- package/dist/design/figma-alias.d.ts +0 -170
- package/dist/design/figma-alias.js +0 -577
- package/dist/design/figma-alias.js.map +0 -1
- package/dist/design/figma-audit.d.ts +0 -40
- package/dist/design/figma-audit.js +0 -383
- package/dist/design/figma-audit.js.map +0 -1
- package/dist/design/figma-client.d.ts +0 -131
- package/dist/design/figma-client.js +0 -369
- package/dist/design/figma-client.js.map +0 -1
- package/dist/design/figma-map.d.ts +0 -29
- package/dist/design/figma-map.js +0 -346
- package/dist/design/figma-map.js.map +0 -1
- package/dist/design/figma-tokens.d.ts +0 -73
- package/dist/design/figma-tokens.js +0 -448
- package/dist/design/figma-tokens.js.map +0 -1
- package/dist/design/index.d.ts +0 -13
- package/dist/design/index.js +0 -20
- package/dist/design/index.js.map +0 -1
- package/dist/design/types.d.ts +0 -98
- package/dist/design/types.js +0 -9
- package/dist/design/types.js.map +0 -1
- package/dist/hooks/hook-runner.d.ts +0 -142
- package/dist/hooks/hook-runner.js +0 -436
- package/dist/hooks/hook-runner.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -9
- package/dist/hooks/index.js +0 -10
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/manager.d.ts +0 -84
- package/dist/hooks/manager.js +0 -348
- package/dist/hooks/manager.js.map +0 -1
- package/dist/hooks/types.d.ts +0 -134
- package/dist/hooks/types.js +0 -9
- package/dist/hooks/types.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/ipc/index.d.ts +0 -9
- package/dist/ipc/index.js +0 -10
- package/dist/ipc/index.js.map +0 -1
- package/dist/ipc/vscode-client.d.ts +0 -200
- package/dist/ipc/vscode-client.js +0 -495
- package/dist/ipc/vscode-client.js.map +0 -1
- package/dist/llm/client.d.ts +0 -205
- package/dist/llm/client.js +0 -735
- package/dist/llm/client.js.map +0 -1
- package/dist/llm/tools.d.ts +0 -102
- package/dist/llm/tools.js +0 -275
- package/dist/llm/tools.js.map +0 -1
- package/dist/llm/types.d.ts +0 -428
- package/dist/llm/types.js +0 -194
- package/dist/llm/types.js.map +0 -1
- package/dist/mcp/automatosx-auto-discovery.d.ts +0 -66
- package/dist/mcp/automatosx-auto-discovery.js +0 -169
- package/dist/mcp/automatosx-auto-discovery.js.map +0 -1
- package/dist/mcp/automatosx-loader.d.ts +0 -99
- package/dist/mcp/automatosx-loader.js +0 -250
- package/dist/mcp/automatosx-loader.js.map +0 -1
- package/dist/mcp/cancellation.d.ts +0 -182
- package/dist/mcp/cancellation.js +0 -275
- package/dist/mcp/cancellation.js.map +0 -1
- package/dist/mcp/client-v2.d.ts +0 -500
- package/dist/mcp/client-v2.js +0 -1433
- package/dist/mcp/client-v2.js.map +0 -1
- package/dist/mcp/client.d.ts +0 -170
- package/dist/mcp/client.js +0 -232
- package/dist/mcp/client.js.map +0 -1
- package/dist/mcp/config-detector.d.ts +0 -90
- package/dist/mcp/config-detector.js +0 -250
- package/dist/mcp/config-detector.js.map +0 -1
- package/dist/mcp/config-migrator.d.ts +0 -68
- package/dist/mcp/config-migrator.js +0 -291
- package/dist/mcp/config-migrator.js.map +0 -1
- package/dist/mcp/config.d.ts +0 -24
- package/dist/mcp/config.js +0 -273
- package/dist/mcp/config.js.map +0 -1
- package/dist/mcp/constants.d.ts +0 -66
- package/dist/mcp/constants.js +0 -85
- package/dist/mcp/constants.js.map +0 -1
- package/dist/mcp/content-length-transport.d.ts +0 -106
- package/dist/mcp/content-length-transport.js +0 -413
- package/dist/mcp/content-length-transport.js.map +0 -1
- package/dist/mcp/debug.d.ts +0 -211
- package/dist/mcp/debug.js +0 -404
- package/dist/mcp/debug.js.map +0 -1
- package/dist/mcp/error-formatter.d.ts +0 -40
- package/dist/mcp/error-formatter.js +0 -207
- package/dist/mcp/error-formatter.js.map +0 -1
- package/dist/mcp/error-remediation.d.ts +0 -45
- package/dist/mcp/error-remediation.js +0 -291
- package/dist/mcp/error-remediation.js.map +0 -1
- package/dist/mcp/health.d.ts +0 -120
- package/dist/mcp/health.js +0 -267
- package/dist/mcp/health.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -56
- package/dist/mcp/index.js +0 -89
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/invariants.d.ts +0 -141
- package/dist/mcp/invariants.js +0 -243
- package/dist/mcp/invariants.js.map +0 -1
- package/dist/mcp/mutex-safe.d.ts +0 -151
- package/dist/mcp/mutex-safe.js +0 -260
- package/dist/mcp/mutex-safe.js.map +0 -1
- package/dist/mcp/progress.d.ts +0 -155
- package/dist/mcp/progress.js +0 -252
- package/dist/mcp/progress.js.map +0 -1
- package/dist/mcp/prompts.d.ts +0 -68
- package/dist/mcp/prompts.js +0 -129
- package/dist/mcp/prompts.js.map +0 -1
- package/dist/mcp/provider-mcp-loader.d.ts +0 -130
- package/dist/mcp/provider-mcp-loader.js +0 -292
- package/dist/mcp/provider-mcp-loader.js.map +0 -1
- package/dist/mcp/reconnection.d.ts +0 -101
- package/dist/mcp/reconnection.js +0 -253
- package/dist/mcp/reconnection.js.map +0 -1
- package/dist/mcp/registry.d.ts +0 -75
- package/dist/mcp/registry.js +0 -276
- package/dist/mcp/registry.js.map +0 -1
- package/dist/mcp/resources.d.ts +0 -58
- package/dist/mcp/resources.js +0 -144
- package/dist/mcp/resources.js.map +0 -1
- package/dist/mcp/schema-validator.d.ts +0 -82
- package/dist/mcp/schema-validator.js +0 -161
- package/dist/mcp/schema-validator.js.map +0 -1
- package/dist/mcp/ssrf-protection.d.ts +0 -86
- package/dist/mcp/ssrf-protection.js +0 -311
- package/dist/mcp/ssrf-protection.js.map +0 -1
- package/dist/mcp/subscriptions.d.ts +0 -168
- package/dist/mcp/subscriptions.js +0 -248
- package/dist/mcp/subscriptions.js.map +0 -1
- package/dist/mcp/templates.d.ts +0 -52
- package/dist/mcp/templates.js +0 -627
- package/dist/mcp/templates.js.map +0 -1
- package/dist/mcp/transports.d.ts +0 -80
- package/dist/mcp/transports.js +0 -237
- package/dist/mcp/transports.js.map +0 -1
- package/dist/mcp/type-safety.d.ts +0 -225
- package/dist/mcp/type-safety.js +0 -237
- package/dist/mcp/type-safety.js.map +0 -1
- package/dist/mcp/validation.d.ts +0 -29
- package/dist/mcp/validation.js +0 -339
- package/dist/mcp/validation.js.map +0 -1
- package/dist/mcp/zai-detector.d.ts +0 -63
- package/dist/mcp/zai-detector.js +0 -193
- package/dist/mcp/zai-detector.js.map +0 -1
- package/dist/mcp/zai-templates.d.ts +0 -90
- package/dist/mcp/zai-templates.js +0 -157
- package/dist/mcp/zai-templates.js.map +0 -1
- package/dist/memory/context-generator.d.ts +0 -84
- package/dist/memory/context-generator.js +0 -546
- package/dist/memory/context-generator.js.map +0 -1
- package/dist/memory/context-injector.d.ts +0 -97
- package/dist/memory/context-injector.js +0 -159
- package/dist/memory/context-injector.js.map +0 -1
- package/dist/memory/context-store.d.ts +0 -103
- package/dist/memory/context-store.js +0 -264
- package/dist/memory/context-store.js.map +0 -1
- package/dist/memory/index.d.ts +0 -43
- package/dist/memory/index.js +0 -49
- package/dist/memory/index.js.map +0 -1
- package/dist/memory/provider-context-store.d.ts +0 -127
- package/dist/memory/provider-context-store.js +0 -385
- package/dist/memory/provider-context-store.js.map +0 -1
- package/dist/memory/schemas.d.ts +0 -118
- package/dist/memory/schemas.js +0 -106
- package/dist/memory/schemas.js.map +0 -1
- package/dist/memory/stats-collector.d.ts +0 -73
- package/dist/memory/stats-collector.js +0 -170
- package/dist/memory/stats-collector.js.map +0 -1
- package/dist/memory/types.d.ts +0 -177
- package/dist/memory/types.js +0 -73
- package/dist/memory/types.js.map +0 -1
- package/dist/permissions/index.d.ts +0 -6
- package/dist/permissions/index.js +0 -7
- package/dist/permissions/index.js.map +0 -1
- package/dist/permissions/permission-manager.d.ts +0 -149
- package/dist/permissions/permission-manager.js +0 -410
- package/dist/permissions/permission-manager.js.map +0 -1
- package/dist/planner/dependency-resolver.d.ts +0 -72
- package/dist/planner/dependency-resolver.js +0 -272
- package/dist/planner/dependency-resolver.js.map +0 -1
- package/dist/planner/index.d.ts +0 -12
- package/dist/planner/index.js +0 -28
- package/dist/planner/index.js.map +0 -1
- package/dist/planner/plan-generator.d.ts +0 -74
- package/dist/planner/plan-generator.js +0 -244
- package/dist/planner/plan-generator.js.map +0 -1
- package/dist/planner/plan-storage.d.ts +0 -113
- package/dist/planner/plan-storage.js +0 -398
- package/dist/planner/plan-storage.js.map +0 -1
- package/dist/planner/prompts/planning-prompt.d.ts +0 -62
- package/dist/planner/prompts/planning-prompt.js +0 -414
- package/dist/planner/prompts/planning-prompt.js.map +0 -1
- package/dist/planner/task-planner.d.ts +0 -139
- package/dist/planner/task-planner.js +0 -532
- package/dist/planner/task-planner.js.map +0 -1
- package/dist/planner/token-estimator.d.ts +0 -63
- package/dist/planner/token-estimator.js +0 -295
- package/dist/planner/token-estimator.js.map +0 -1
- package/dist/planner/types.d.ts +0 -425
- package/dist/planner/types.js +0 -213
- package/dist/planner/types.js.map +0 -1
- package/dist/provider/config.d.ts +0 -227
- package/dist/provider/config.js +0 -430
- package/dist/provider/config.js.map +0 -1
- package/dist/schemas/api-schemas.d.ts +0 -45
- package/dist/schemas/api-schemas.js +0 -129
- package/dist/schemas/api-schemas.js.map +0 -1
- package/dist/schemas/confirmation-schemas.d.ts +0 -39
- package/dist/schemas/confirmation-schemas.js +0 -48
- package/dist/schemas/confirmation-schemas.js.map +0 -1
- package/dist/schemas/index-unified.d.ts +0 -12
- package/dist/schemas/index-unified.js +0 -17
- package/dist/schemas/index-unified.js.map +0 -1
- package/dist/schemas/index.d.ts +0 -83
- package/dist/schemas/index.js +0 -139
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/settings-schemas.d.ts +0 -186
- package/dist/schemas/settings-schemas.js +0 -324
- package/dist/schemas/settings-schemas.js.map +0 -1
- package/dist/schemas/tool-schemas.d.ts +0 -127
- package/dist/schemas/tool-schemas.js +0 -84
- package/dist/schemas/tool-schemas.js.map +0 -1
- package/dist/schemas/yaml-schemas.d.ts +0 -231
- package/dist/schemas/yaml-schemas.js +0 -199
- package/dist/schemas/yaml-schemas.js.map +0 -1
- package/dist/sdk/errors.d.ts +0 -100
- package/dist/sdk/errors.js +0 -138
- package/dist/sdk/errors.js.map +0 -1
- package/dist/sdk/index.d.ts +0 -901
- package/dist/sdk/index.js +0 -1272
- package/dist/sdk/index.js.map +0 -1
- package/dist/sdk/progress-reporter.d.ts +0 -123
- package/dist/sdk/progress-reporter.js +0 -220
- package/dist/sdk/progress-reporter.js.map +0 -1
- package/dist/sdk/testing.d.ts +0 -427
- package/dist/sdk/testing.js +0 -725
- package/dist/sdk/testing.js.map +0 -1
- package/dist/sdk/tool-registry.d.ts +0 -194
- package/dist/sdk/tool-registry.js +0 -326
- package/dist/sdk/tool-registry.js.map +0 -1
- package/dist/sdk/types.d.ts +0 -53
- package/dist/sdk/types.js +0 -8
- package/dist/sdk/types.js.map +0 -1
- package/dist/sdk/unified-logger.d.ts +0 -173
- package/dist/sdk/unified-logger.js +0 -327
- package/dist/sdk/unified-logger.js.map +0 -1
- package/dist/sdk/version.d.ts +0 -163
- package/dist/sdk/version.js +0 -205
- package/dist/sdk/version.js.map +0 -1
- package/dist/tools/ask-user.d.ts +0 -126
- package/dist/tools/ask-user.js +0 -290
- package/dist/tools/ask-user.js.map +0 -1
- package/dist/tools/ax-agent.d.ts +0 -71
- package/dist/tools/ax-agent.js +0 -283
- package/dist/tools/ax-agent.js.map +0 -1
- package/dist/tools/bash-output.d.ts +0 -25
- package/dist/tools/bash-output.js +0 -146
- package/dist/tools/bash-output.js.map +0 -1
- package/dist/tools/bash.d.ts +0 -67
- package/dist/tools/bash.js +0 -522
- package/dist/tools/bash.js.map +0 -1
- package/dist/tools/confirmation-tool.d.ts +0 -16
- package/dist/tools/confirmation-tool.js +0 -76
- package/dist/tools/confirmation-tool.js.map +0 -1
- package/dist/tools/definitions/ask-user.d.ts +0 -8
- package/dist/tools/definitions/ask-user.js +0 -168
- package/dist/tools/definitions/ask-user.js.map +0 -1
- package/dist/tools/definitions/ax-agent.d.ts +0 -8
- package/dist/tools/definitions/ax-agent.js +0 -276
- package/dist/tools/definitions/ax-agent.js.map +0 -1
- package/dist/tools/definitions/bash-output.d.ts +0 -7
- package/dist/tools/definitions/bash-output.js +0 -78
- package/dist/tools/definitions/bash-output.js.map +0 -1
- package/dist/tools/definitions/bash.d.ts +0 -8
- package/dist/tools/definitions/bash.js +0 -152
- package/dist/tools/definitions/bash.js.map +0 -1
- package/dist/tools/definitions/create-file.d.ts +0 -7
- package/dist/tools/definitions/create-file.js +0 -129
- package/dist/tools/definitions/create-file.js.map +0 -1
- package/dist/tools/definitions/design.d.ts +0 -12
- package/dist/tools/definitions/design.js +0 -368
- package/dist/tools/definitions/design.js.map +0 -1
- package/dist/tools/definitions/index.d.ts +0 -49
- package/dist/tools/definitions/index.js +0 -87
- package/dist/tools/definitions/index.js.map +0 -1
- package/dist/tools/definitions/multi-edit.d.ts +0 -7
- package/dist/tools/definitions/multi-edit.js +0 -123
- package/dist/tools/definitions/multi-edit.js.map +0 -1
- package/dist/tools/definitions/search.d.ts +0 -7
- package/dist/tools/definitions/search.js +0 -159
- package/dist/tools/definitions/search.js.map +0 -1
- package/dist/tools/definitions/str-replace-editor.d.ts +0 -7
- package/dist/tools/definitions/str-replace-editor.js +0 -145
- package/dist/tools/definitions/str-replace-editor.js.map +0 -1
- package/dist/tools/definitions/todo.d.ts +0 -8
- package/dist/tools/definitions/todo.js +0 -261
- package/dist/tools/definitions/todo.js.map +0 -1
- package/dist/tools/definitions/view-file.d.ts +0 -7
- package/dist/tools/definitions/view-file.js +0 -111
- package/dist/tools/definitions/view-file.js.map +0 -1
- package/dist/tools/design-tool.d.ts +0 -68
- package/dist/tools/design-tool.js +0 -299
- package/dist/tools/design-tool.js.map +0 -1
- package/dist/tools/format-generators.d.ts +0 -62
- package/dist/tools/format-generators.js +0 -291
- package/dist/tools/format-generators.js.map +0 -1
- package/dist/tools/index.d.ts +0 -8
- package/dist/tools/index.js +0 -11
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/priority-registry.d.ts +0 -124
- package/dist/tools/priority-registry.js +0 -401
- package/dist/tools/priority-registry.js.map +0 -1
- package/dist/tools/priority.d.ts +0 -158
- package/dist/tools/priority.js +0 -350
- package/dist/tools/priority.js.map +0 -1
- package/dist/tools/registry.d.ts +0 -146
- package/dist/tools/registry.js +0 -171
- package/dist/tools/registry.js.map +0 -1
- package/dist/tools/search.d.ts +0 -85
- package/dist/tools/search.js +0 -430
- package/dist/tools/search.js.map +0 -1
- package/dist/tools/text-editor.d.ts +0 -87
- package/dist/tools/text-editor.js +0 -1369
- package/dist/tools/text-editor.js.map +0 -1
- package/dist/tools/todo-tool.d.ts +0 -20
- package/dist/tools/todo-tool.js +0 -186
- package/dist/tools/todo-tool.js.map +0 -1
- package/dist/tools/types.d.ts +0 -175
- package/dist/tools/types.js +0 -11
- package/dist/tools/types.js.map +0 -1
- package/dist/types/index.d.ts +0 -30
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/types/project-analysis.d.ts +0 -84
- package/dist/types/project-analysis.js +0 -5
- package/dist/types/project-analysis.js.map +0 -1
- package/dist/types/template.d.ts +0 -53
- package/dist/types/template.js +0 -5
- package/dist/types/template.js.map +0 -1
- package/dist/ui/app.d.ts +0 -7
- package/dist/ui/app.js +0 -102
- package/dist/ui/app.js.map +0 -1
- package/dist/ui/components/api-key-input.d.ts +0 -7
- package/dist/ui/components/api-key-input.js +0 -92
- package/dist/ui/components/api-key-input.js.map +0 -1
- package/dist/ui/components/chat-history.d.ts +0 -12
- package/dist/ui/components/chat-history.js +0 -391
- package/dist/ui/components/chat-history.js.map +0 -1
- package/dist/ui/components/chat-input.d.ts +0 -13
- package/dist/ui/components/chat-input.js +0 -179
- package/dist/ui/components/chat-input.js.map +0 -1
- package/dist/ui/components/chat-interface.d.ts +0 -11
- package/dist/ui/components/chat-interface.js +0 -830
- package/dist/ui/components/chat-interface.js.map +0 -1
- package/dist/ui/components/collapsible-tool-result.d.ts +0 -42
- package/dist/ui/components/collapsible-tool-result.js +0 -216
- package/dist/ui/components/collapsible-tool-result.js.map +0 -1
- package/dist/ui/components/command-suggestions.d.ts +0 -29
- package/dist/ui/components/command-suggestions.js +0 -88
- package/dist/ui/components/command-suggestions.js.map +0 -1
- package/dist/ui/components/confirmation-dialog.d.ts +0 -11
- package/dist/ui/components/confirmation-dialog.js +0 -100
- package/dist/ui/components/confirmation-dialog.js.map +0 -1
- package/dist/ui/components/context-breakdown.d.ts +0 -23
- package/dist/ui/components/context-breakdown.js +0 -124
- package/dist/ui/components/context-breakdown.js.map +0 -1
- package/dist/ui/components/diff-renderer.d.ts +0 -13
- package/dist/ui/components/diff-renderer.js +0 -192
- package/dist/ui/components/diff-renderer.js.map +0 -1
- package/dist/ui/components/index.d.ts +0 -18
- package/dist/ui/components/index.js +0 -20
- package/dist/ui/components/index.js.map +0 -1
- package/dist/ui/components/keyboard-help.d.ts +0 -17
- package/dist/ui/components/keyboard-help.js +0 -122
- package/dist/ui/components/keyboard-help.js.map +0 -1
- package/dist/ui/components/keyboard-hints.d.ts +0 -35
- package/dist/ui/components/keyboard-hints.js +0 -142
- package/dist/ui/components/keyboard-hints.js.map +0 -1
- package/dist/ui/components/loading-spinner.d.ts +0 -9
- package/dist/ui/components/loading-spinner.js +0 -120
- package/dist/ui/components/loading-spinner.js.map +0 -1
- package/dist/ui/components/mcp-dashboard.d.ts +0 -15
- package/dist/ui/components/mcp-dashboard.js +0 -520
- package/dist/ui/components/mcp-dashboard.js.map +0 -1
- package/dist/ui/components/mcp-status.d.ts +0 -5
- package/dist/ui/components/mcp-status.js +0 -58
- package/dist/ui/components/mcp-status.js.map +0 -1
- package/dist/ui/components/model-selection.d.ts +0 -12
- package/dist/ui/components/model-selection.js +0 -17
- package/dist/ui/components/model-selection.js.map +0 -1
- package/dist/ui/components/phase-progress.d.ts +0 -21
- package/dist/ui/components/phase-progress.js +0 -185
- package/dist/ui/components/phase-progress.js.map +0 -1
- package/dist/ui/components/question-dialog.d.ts +0 -17
- package/dist/ui/components/question-dialog.js +0 -181
- package/dist/ui/components/question-dialog.js.map +0 -1
- package/dist/ui/components/quick-actions.d.ts +0 -12
- package/dist/ui/components/quick-actions.js +0 -171
- package/dist/ui/components/quick-actions.js.map +0 -1
- package/dist/ui/components/reasoning-display.d.ts +0 -36
- package/dist/ui/components/reasoning-display.js +0 -46
- package/dist/ui/components/reasoning-display.js.map +0 -1
- package/dist/ui/components/status-bar.d.ts +0 -47
- package/dist/ui/components/status-bar.js +0 -310
- package/dist/ui/components/status-bar.js.map +0 -1
- package/dist/ui/components/subagent-monitor.d.ts +0 -41
- package/dist/ui/components/subagent-monitor.js +0 -122
- package/dist/ui/components/subagent-monitor.js.map +0 -1
- package/dist/ui/components/toast-notification.d.ts +0 -197
- package/dist/ui/components/toast-notification.js +0 -190
- package/dist/ui/components/toast-notification.js.map +0 -1
- package/dist/ui/components/tool-group-display.d.ts +0 -19
- package/dist/ui/components/tool-group-display.js +0 -222
- package/dist/ui/components/tool-group-display.js.map +0 -1
- package/dist/ui/components/virtualized-chat-history.d.ts +0 -33
- package/dist/ui/components/virtualized-chat-history.js +0 -182
- package/dist/ui/components/virtualized-chat-history.js.map +0 -1
- package/dist/ui/components/welcome-panel.d.ts +0 -11
- package/dist/ui/components/welcome-panel.js +0 -225
- package/dist/ui/components/welcome-panel.js.map +0 -1
- package/dist/ui/hooks/use-chat-reducer.d.ts +0 -69
- package/dist/ui/hooks/use-chat-reducer.js +0 -118
- package/dist/ui/hooks/use-chat-reducer.js.map +0 -1
- package/dist/ui/hooks/use-enhanced-input.d.ts +0 -53
- package/dist/ui/hooks/use-enhanced-input.js +0 -1275
- package/dist/ui/hooks/use-enhanced-input.js.map +0 -1
- package/dist/ui/hooks/use-input-handler.d.ts +0 -79
- package/dist/ui/hooks/use-input-handler.js +0 -2251
- package/dist/ui/hooks/use-input-handler.js.map +0 -1
- package/dist/ui/hooks/use-input-history.d.ts +0 -9
- package/dist/ui/hooks/use-input-history.js +0 -168
- package/dist/ui/hooks/use-input-history.js.map +0 -1
- package/dist/ui/shared/max-sized-box.d.ts +0 -17
- package/dist/ui/shared/max-sized-box.js +0 -14
- package/dist/ui/shared/max-sized-box.js.map +0 -1
- package/dist/ui/themes/index.d.ts +0 -5
- package/dist/ui/themes/index.js +0 -5
- package/dist/ui/themes/index.js.map +0 -1
- package/dist/ui/themes/theme-registry.d.ts +0 -55
- package/dist/ui/themes/theme-registry.js +0 -202
- package/dist/ui/themes/theme-registry.js.map +0 -1
- package/dist/ui/utils/bracketed-paste-handler.d.ts +0 -97
- package/dist/ui/utils/bracketed-paste-handler.js +0 -322
- package/dist/ui/utils/bracketed-paste-handler.js.map +0 -1
- package/dist/ui/utils/change-summarizer.d.ts +0 -20
- package/dist/ui/utils/change-summarizer.js +0 -282
- package/dist/ui/utils/change-summarizer.js.map +0 -1
- package/dist/ui/utils/code-colorizer.d.ts +0 -9
- package/dist/ui/utils/code-colorizer.js +0 -13
- package/dist/ui/utils/code-colorizer.js.map +0 -1
- package/dist/ui/utils/colors.d.ts +0 -41
- package/dist/ui/utils/colors.js +0 -80
- package/dist/ui/utils/colors.js.map +0 -1
- package/dist/ui/utils/image-handler.d.ts +0 -29
- package/dist/ui/utils/image-handler.js +0 -129
- package/dist/ui/utils/image-handler.js.map +0 -1
- package/dist/ui/utils/markdown-renderer.d.ts +0 -4
- package/dist/ui/utils/markdown-renderer.js +0 -40
- package/dist/ui/utils/markdown-renderer.js.map +0 -1
- package/dist/ui/utils/semantic-action-detector.d.ts +0 -49
- package/dist/ui/utils/semantic-action-detector.js +0 -339
- package/dist/ui/utils/semantic-action-detector.js.map +0 -1
- package/dist/ui/utils/tool-grouper.d.ts +0 -94
- package/dist/ui/utils/tool-grouper.js +0 -618
- package/dist/ui/utils/tool-grouper.js.map +0 -1
- package/dist/utils/api-error.d.ts +0 -61
- package/dist/utils/api-error.js +0 -176
- package/dist/utils/api-error.js.map +0 -1
- package/dist/utils/audit-logger.d.ts +0 -206
- package/dist/utils/audit-logger.js +0 -286
- package/dist/utils/audit-logger.js.map +0 -1
- package/dist/utils/auto-accept-logger.d.ts +0 -175
- package/dist/utils/auto-accept-logger.js +0 -423
- package/dist/utils/auto-accept-logger.js.map +0 -1
- package/dist/utils/automatosx-detector.d.ts +0 -19
- package/dist/utils/automatosx-detector.js +0 -52
- package/dist/utils/automatosx-detector.js.map +0 -1
- package/dist/utils/background-task-manager.d.ts +0 -114
- package/dist/utils/background-task-manager.js +0 -470
- package/dist/utils/background-task-manager.js.map +0 -1
- package/dist/utils/cache.d.ts +0 -77
- package/dist/utils/cache.js +0 -180
- package/dist/utils/cache.js.map +0 -1
- package/dist/utils/command-security.d.ts +0 -85
- package/dist/utils/command-security.js +0 -210
- package/dist/utils/command-security.js.map +0 -1
- package/dist/utils/config-loader.d.ts +0 -190
- package/dist/utils/config-loader.js +0 -108
- package/dist/utils/config-loader.js.map +0 -1
- package/dist/utils/confirmation-service.d.ts +0 -51
- package/dist/utils/confirmation-service.js +0 -220
- package/dist/utils/confirmation-service.js.map +0 -1
- package/dist/utils/console-messenger.d.ts +0 -80
- package/dist/utils/console-messenger.js +0 -142
- package/dist/utils/console-messenger.js.map +0 -1
- package/dist/utils/custom-instructions.d.ts +0 -1
- package/dist/utils/custom-instructions.js +0 -24
- package/dist/utils/custom-instructions.js.map +0 -1
- package/dist/utils/encryption.d.ts +0 -86
- package/dist/utils/encryption.js +0 -236
- package/dist/utils/encryption.js.map +0 -1
- package/dist/utils/enhanced-error-messages.d.ts +0 -33
- package/dist/utils/enhanced-error-messages.js +0 -440
- package/dist/utils/enhanced-error-messages.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -65
- package/dist/utils/error-handler.js +0 -148
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/error-translator.d.ts +0 -25
- package/dist/utils/error-translator.js +0 -203
- package/dist/utils/error-translator.js.map +0 -1
- package/dist/utils/external-editor.d.ts +0 -47
- package/dist/utils/external-editor.js +0 -179
- package/dist/utils/external-editor.js.map +0 -1
- package/dist/utils/file-cache.d.ts +0 -148
- package/dist/utils/file-cache.js +0 -413
- package/dist/utils/file-cache.js.map +0 -1
- package/dist/utils/file-lock.d.ts +0 -141
- package/dist/utils/file-lock.js +0 -554
- package/dist/utils/file-lock.js.map +0 -1
- package/dist/utils/file-mentions.d.ts +0 -68
- package/dist/utils/file-mentions.js +0 -225
- package/dist/utils/file-mentions.js.map +0 -1
- package/dist/utils/history-manager.d.ts +0 -52
- package/dist/utils/history-manager.js +0 -211
- package/dist/utils/history-manager.js.map +0 -1
- package/dist/utils/history-migration.d.ts +0 -9
- package/dist/utils/history-migration.js +0 -37
- package/dist/utils/history-migration.js.map +0 -1
- package/dist/utils/image-processor.d.ts +0 -33
- package/dist/utils/image-processor.js +0 -124
- package/dist/utils/image-processor.js.map +0 -1
- package/dist/utils/index.d.ts +0 -92
- package/dist/utils/index.js +0 -111
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/init-previewer.d.ts +0 -56
- package/dist/utils/init-previewer.js +0 -239
- package/dist/utils/init-previewer.js.map +0 -1
- package/dist/utils/init-validator.d.ts +0 -65
- package/dist/utils/init-validator.js +0 -252
- package/dist/utils/init-validator.js.map +0 -1
- package/dist/utils/input-sanitizer.d.ts +0 -210
- package/dist/utils/input-sanitizer.js +0 -362
- package/dist/utils/input-sanitizer.js.map +0 -1
- package/dist/utils/instruction-generator.d.ts +0 -21
- package/dist/utils/instruction-generator.js +0 -233
- package/dist/utils/instruction-generator.js.map +0 -1
- package/dist/utils/json-utils.d.ts +0 -72
- package/dist/utils/json-utils.js +0 -226
- package/dist/utils/json-utils.js.map +0 -1
- package/dist/utils/llm-optimized-instruction-generator.d.ts +0 -36
- package/dist/utils/llm-optimized-instruction-generator.js +0 -365
- package/dist/utils/llm-optimized-instruction-generator.js.map +0 -1
- package/dist/utils/message-optimizer.d.ts +0 -100
- package/dist/utils/message-optimizer.js +0 -297
- package/dist/utils/message-optimizer.js.map +0 -1
- package/dist/utils/onboarding-manager.d.ts +0 -45
- package/dist/utils/onboarding-manager.js +0 -131
- package/dist/utils/onboarding-manager.js.map +0 -1
- package/dist/utils/parallel-analyzer.d.ts +0 -123
- package/dist/utils/parallel-analyzer.js +0 -241
- package/dist/utils/parallel-analyzer.js.map +0 -1
- package/dist/utils/paste-utils.d.ts +0 -99
- package/dist/utils/paste-utils.js +0 -295
- package/dist/utils/paste-utils.js.map +0 -1
- package/dist/utils/path-helpers.d.ts +0 -8
- package/dist/utils/path-helpers.js +0 -35
- package/dist/utils/path-helpers.js.map +0 -1
- package/dist/utils/path-security.d.ts +0 -92
- package/dist/utils/path-security.js +0 -300
- package/dist/utils/path-security.js.map +0 -1
- package/dist/utils/path-utils.d.ts +0 -83
- package/dist/utils/path-utils.js +0 -122
- package/dist/utils/path-utils.js.map +0 -1
- package/dist/utils/path-validator.d.ts +0 -66
- package/dist/utils/path-validator.js +0 -141
- package/dist/utils/path-validator.js.map +0 -1
- package/dist/utils/performance.d.ts +0 -74
- package/dist/utils/performance.js +0 -133
- package/dist/utils/performance.js.map +0 -1
- package/dist/utils/process-pool.d.ts +0 -109
- package/dist/utils/process-pool.js +0 -332
- package/dist/utils/process-pool.js.map +0 -1
- package/dist/utils/progress-tracker.d.ts +0 -51
- package/dist/utils/progress-tracker.js +0 -152
- package/dist/utils/progress-tracker.js.map +0 -1
- package/dist/utils/project-analyzer.d.ts +0 -49
- package/dist/utils/project-analyzer.js +0 -396
- package/dist/utils/project-analyzer.js.map +0 -1
- package/dist/utils/prompt-builder.d.ts +0 -14
- package/dist/utils/prompt-builder.js +0 -100
- package/dist/utils/prompt-builder.js.map +0 -1
- package/dist/utils/provider-context.d.ts +0 -243
- package/dist/utils/provider-context.js +0 -421
- package/dist/utils/provider-context.js.map +0 -1
- package/dist/utils/provider-file-cache.d.ts +0 -91
- package/dist/utils/provider-file-cache.js +0 -165
- package/dist/utils/provider-file-cache.js.map +0 -1
- package/dist/utils/provider-settings.d.ts +0 -181
- package/dist/utils/provider-settings.js +0 -450
- package/dist/utils/provider-settings.js.map +0 -1
- package/dist/utils/rate-limiter.d.ts +0 -222
- package/dist/utils/rate-limiter.js +0 -338
- package/dist/utils/rate-limiter.js.map +0 -1
- package/dist/utils/retry-helper.d.ts +0 -81
- package/dist/utils/retry-helper.js +0 -244
- package/dist/utils/retry-helper.js.map +0 -1
- package/dist/utils/safety-rules.d.ts +0 -64
- package/dist/utils/safety-rules.js +0 -225
- package/dist/utils/safety-rules.js.map +0 -1
- package/dist/utils/settings-manager.d.ts +0 -256
- package/dist/utils/settings-manager.js +0 -967
- package/dist/utils/settings-manager.js.map +0 -1
- package/dist/utils/setup-validator.d.ts +0 -47
- package/dist/utils/setup-validator.js +0 -304
- package/dist/utils/setup-validator.js.map +0 -1
- package/dist/utils/string-utils.d.ts +0 -19
- package/dist/utils/string-utils.js +0 -28
- package/dist/utils/string-utils.js.map +0 -1
- package/dist/utils/template-manager.d.ts +0 -62
- package/dist/utils/template-manager.js +0 -366
- package/dist/utils/template-manager.js.map +0 -1
- package/dist/utils/text-utils.d.ts +0 -82
- package/dist/utils/text-utils.js +0 -203
- package/dist/utils/text-utils.js.map +0 -1
- package/dist/utils/token-counter.d.ts +0 -76
- package/dist/utils/token-counter.js +0 -231
- package/dist/utils/token-counter.js.map +0 -1
- package/dist/utils/usage-tracker.d.ts +0 -78
- package/dist/utils/usage-tracker.js +0 -126
- package/dist/utils/usage-tracker.js.map +0 -1
- package/dist/utils/version.d.ts +0 -14
- package/dist/utils/version.js +0 -70
- package/dist/utils/version.js.map +0 -1
package/dist/tools/priority.d.ts
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool Priority System
|
|
3
|
-
*
|
|
4
|
-
* Defines priority levels and capability types for intelligent tool selection.
|
|
5
|
-
* When multiple tools can handle the same task, the system prefers higher-priority tools.
|
|
6
|
-
*
|
|
7
|
-
* Priority Order:
|
|
8
|
-
* 1. Native API capabilities (e.g., Grok's built-in search)
|
|
9
|
-
* 2. Provider-specific MCP (e.g., Z.AI MCP for GLM)
|
|
10
|
-
* 3. Domain-specific MCP (e.g., Figma MCP for design)
|
|
11
|
-
* 4. Official MCP servers
|
|
12
|
-
* 5. Community MCP servers
|
|
13
|
-
* 6. General-purpose MCP (e.g., AutomatosX)
|
|
14
|
-
* 7. Built-in tools (fallback)
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Capability types that tools can provide
|
|
18
|
-
*/
|
|
19
|
-
export type ToolCapability = 'web-search' | 'web-fetch' | 'vision' | 'code-generation' | 'file-operations' | 'git-operations' | 'design-figma' | 'design-general' | 'database' | 'deployment' | 'memory' | 'agent-delegation' | 'testing' | 'monitoring';
|
|
20
|
-
/**
|
|
21
|
-
* Priority levels for tool selection
|
|
22
|
-
* Higher values = higher priority = preferred tool
|
|
23
|
-
*/
|
|
24
|
-
export declare enum ToolPriority {
|
|
25
|
-
/** Built into provider API (highest priority) */
|
|
26
|
-
NATIVE_API = 100,
|
|
27
|
-
/** Provider-specific MCP (e.g., Z.AI for GLM) */
|
|
28
|
-
PROVIDER_MCP = 80,
|
|
29
|
-
/** Domain-specific MCP (e.g., Figma for design) */
|
|
30
|
-
DOMAIN_SPECIFIC = 60,
|
|
31
|
-
/** Official MCP servers (e.g., @modelcontextprotocol/*) */
|
|
32
|
-
OFFICIAL_MCP = 40,
|
|
33
|
-
/** Community MCP servers */
|
|
34
|
-
COMMUNITY_MCP = 20,
|
|
35
|
-
/** General-purpose MCP (e.g., AutomatosX) */
|
|
36
|
-
GENERAL_MCP = 10,
|
|
37
|
-
/** Built-in ax-cli tools (fallback) */
|
|
38
|
-
BUILTIN_TOOL = 5
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Priority boost applied when a server has affinity for the current provider.
|
|
42
|
-
* This ensures provider-affinity servers beat same-level servers without affinity.
|
|
43
|
-
*/
|
|
44
|
-
export declare const PROVIDER_AFFINITY_BOOST = 10;
|
|
45
|
-
/**
|
|
46
|
-
* Minimum priority difference required to consider a capability superseded.
|
|
47
|
-
* Prevents minor priority differences from hiding useful tools.
|
|
48
|
-
*/
|
|
49
|
-
export declare const SUPERSEDE_THRESHOLD = 15;
|
|
50
|
-
/**
|
|
51
|
-
* Delimiters used to separate base names from variant suffixes.
|
|
52
|
-
* e.g., 'grok-beta' uses '-', 'automatosx_glm' uses '_'
|
|
53
|
-
*/
|
|
54
|
-
export declare const VARIANT_DELIMITERS: readonly ["-", "_"];
|
|
55
|
-
/**
|
|
56
|
-
* Prefix used for virtual native capability tool names.
|
|
57
|
-
* e.g., 'native_web-search' represents Grok's native search capability
|
|
58
|
-
*/
|
|
59
|
-
export declare const NATIVE_CAPABILITY_PREFIX = "native_";
|
|
60
|
-
/**
|
|
61
|
-
* Check if a name starts with a base name followed by a variant delimiter.
|
|
62
|
-
* Used to match variant names like 'grok-beta' to base name 'grok'.
|
|
63
|
-
*
|
|
64
|
-
* @param fullName - The full name to check (e.g., 'grok-beta')
|
|
65
|
-
* @param baseName - The base name to match against (e.g., 'grok')
|
|
66
|
-
* @returns True if fullName is a variant of baseName
|
|
67
|
-
*/
|
|
68
|
-
export declare function isVariantOf(fullName: string, baseName: string): boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Provider names for capability mapping
|
|
71
|
-
*/
|
|
72
|
-
export type ProviderName = 'grok' | 'glm' | 'claude' | 'openai' | 'gemini';
|
|
73
|
-
/**
|
|
74
|
-
* Native capabilities built into provider APIs
|
|
75
|
-
* These don't require MCP - they're part of the API itself
|
|
76
|
-
*/
|
|
77
|
-
export declare const PROVIDER_NATIVE_CAPABILITIES: Record<ProviderName, ToolCapability[]>;
|
|
78
|
-
/**
|
|
79
|
-
* MCP server capability mapping
|
|
80
|
-
* Defines which capabilities each MCP server provides and its priority
|
|
81
|
-
*/
|
|
82
|
-
export interface MCPCapabilityMapping {
|
|
83
|
-
/** MCP server name (e.g., 'figma', 'github', 'automatosx') */
|
|
84
|
-
serverName: string;
|
|
85
|
-
/** Capabilities this server provides */
|
|
86
|
-
capabilities: ToolCapability[];
|
|
87
|
-
/** Priority level for this server */
|
|
88
|
-
priority: ToolPriority;
|
|
89
|
-
/** Preferred providers for this server (if any) */
|
|
90
|
-
providerAffinity?: ProviderName[];
|
|
91
|
-
/** Whether this is an official MCP server */
|
|
92
|
-
isOfficial?: boolean;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Known MCP server capability registry
|
|
96
|
-
* Add new servers here as they become available
|
|
97
|
-
*/
|
|
98
|
-
export declare const MCP_CAPABILITY_REGISTRY: MCPCapabilityMapping[];
|
|
99
|
-
/**
|
|
100
|
-
* Get capability mapping for a server by name.
|
|
101
|
-
* Supports exact matches and variant matches (e.g., 'automatosx-glm' matches 'automatosx').
|
|
102
|
-
* Case-insensitive matching for robustness.
|
|
103
|
-
*
|
|
104
|
-
* @param serverName - The server name to look up (may include variant suffix)
|
|
105
|
-
* @returns The capability mapping, or undefined if not found
|
|
106
|
-
*/
|
|
107
|
-
export declare function getServerCapabilityMapping(serverName: string): MCPCapabilityMapping | undefined;
|
|
108
|
-
/**
|
|
109
|
-
* Check if a provider has native support for a capability.
|
|
110
|
-
* Supports provider variants (e.g., 'grok-beta' matches 'grok' native capabilities)
|
|
111
|
-
*
|
|
112
|
-
* @param providerName - The provider name (may include variant suffix)
|
|
113
|
-
* @param capability - The capability to check
|
|
114
|
-
* @returns True if the provider natively supports the capability
|
|
115
|
-
*/
|
|
116
|
-
export declare function hasNativeCapability(providerName: string, capability: ToolCapability): boolean;
|
|
117
|
-
/**
|
|
118
|
-
* Check if a provider matches a base provider name.
|
|
119
|
-
* e.g., 'grok-beta' matches 'grok', 'glm-4' matches 'glm'
|
|
120
|
-
*
|
|
121
|
-
* @param providerName - The provider name to check (may include variant suffix)
|
|
122
|
-
* @param baseProvider - The base provider to match against
|
|
123
|
-
* @returns True if the provider matches the base provider
|
|
124
|
-
*/
|
|
125
|
-
export declare function providerMatches(providerName: string, baseProvider: ProviderName): boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Get the priority for a server, considering provider affinity.
|
|
128
|
-
*
|
|
129
|
-
* @param serverName - The MCP server name
|
|
130
|
-
* @param providerName - Optional provider name for affinity boosting
|
|
131
|
-
* @returns The priority value (higher = more preferred)
|
|
132
|
-
*/
|
|
133
|
-
export declare function getServerPriority(serverName: string, providerName?: string): number;
|
|
134
|
-
/**
|
|
135
|
-
* Check if a server should be preferred for a given capability and provider.
|
|
136
|
-
*
|
|
137
|
-
* A server is preferred if:
|
|
138
|
-
* 1. The provider does NOT have native support for this capability, AND
|
|
139
|
-
* 2. Either:
|
|
140
|
-
* a. It has provider affinity for the current provider, OR
|
|
141
|
-
* b. It has the highest priority among all servers providing this capability
|
|
142
|
-
*
|
|
143
|
-
* Note: If the provider has native capability support, NO MCP server should be preferred.
|
|
144
|
-
*
|
|
145
|
-
* @param serverName - The MCP server name
|
|
146
|
-
* @param capability - The capability to check
|
|
147
|
-
* @param providerName - The current provider name
|
|
148
|
-
* @returns True if the server should be preferred for this capability
|
|
149
|
-
*/
|
|
150
|
-
export declare function shouldPreferServer(serverName: string, capability: ToolCapability, providerName: string): boolean;
|
|
151
|
-
/**
|
|
152
|
-
* Get all servers that provide a given capability, sorted by priority.
|
|
153
|
-
*
|
|
154
|
-
* @param capability - The capability to search for
|
|
155
|
-
* @param providerName - Optional provider name for affinity-based priority boosting
|
|
156
|
-
* @returns Array of server mappings sorted by priority (highest first)
|
|
157
|
-
*/
|
|
158
|
-
export declare function getServersForCapability(capability: ToolCapability, providerName?: string): MCPCapabilityMapping[];
|
package/dist/tools/priority.js
DELETED
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool Priority System
|
|
3
|
-
*
|
|
4
|
-
* Defines priority levels and capability types for intelligent tool selection.
|
|
5
|
-
* When multiple tools can handle the same task, the system prefers higher-priority tools.
|
|
6
|
-
*
|
|
7
|
-
* Priority Order:
|
|
8
|
-
* 1. Native API capabilities (e.g., Grok's built-in search)
|
|
9
|
-
* 2. Provider-specific MCP (e.g., Z.AI MCP for GLM)
|
|
10
|
-
* 3. Domain-specific MCP (e.g., Figma MCP for design)
|
|
11
|
-
* 4. Official MCP servers
|
|
12
|
-
* 5. Community MCP servers
|
|
13
|
-
* 6. General-purpose MCP (e.g., AutomatosX)
|
|
14
|
-
* 7. Built-in tools (fallback)
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Priority levels for tool selection
|
|
18
|
-
* Higher values = higher priority = preferred tool
|
|
19
|
-
*/
|
|
20
|
-
export var ToolPriority;
|
|
21
|
-
(function (ToolPriority) {
|
|
22
|
-
/** Built into provider API (highest priority) */
|
|
23
|
-
ToolPriority[ToolPriority["NATIVE_API"] = 100] = "NATIVE_API";
|
|
24
|
-
/** Provider-specific MCP (e.g., Z.AI for GLM) */
|
|
25
|
-
ToolPriority[ToolPriority["PROVIDER_MCP"] = 80] = "PROVIDER_MCP";
|
|
26
|
-
/** Domain-specific MCP (e.g., Figma for design) */
|
|
27
|
-
ToolPriority[ToolPriority["DOMAIN_SPECIFIC"] = 60] = "DOMAIN_SPECIFIC";
|
|
28
|
-
/** Official MCP servers (e.g., @modelcontextprotocol/*) */
|
|
29
|
-
ToolPriority[ToolPriority["OFFICIAL_MCP"] = 40] = "OFFICIAL_MCP";
|
|
30
|
-
/** Community MCP servers */
|
|
31
|
-
ToolPriority[ToolPriority["COMMUNITY_MCP"] = 20] = "COMMUNITY_MCP";
|
|
32
|
-
/** General-purpose MCP (e.g., AutomatosX) */
|
|
33
|
-
ToolPriority[ToolPriority["GENERAL_MCP"] = 10] = "GENERAL_MCP";
|
|
34
|
-
/** Built-in ax-cli tools (fallback) */
|
|
35
|
-
ToolPriority[ToolPriority["BUILTIN_TOOL"] = 5] = "BUILTIN_TOOL";
|
|
36
|
-
})(ToolPriority || (ToolPriority = {}));
|
|
37
|
-
/**
|
|
38
|
-
* Priority boost applied when a server has affinity for the current provider.
|
|
39
|
-
* This ensures provider-affinity servers beat same-level servers without affinity.
|
|
40
|
-
*/
|
|
41
|
-
export const PROVIDER_AFFINITY_BOOST = 10;
|
|
42
|
-
/**
|
|
43
|
-
* Minimum priority difference required to consider a capability superseded.
|
|
44
|
-
* Prevents minor priority differences from hiding useful tools.
|
|
45
|
-
*/
|
|
46
|
-
export const SUPERSEDE_THRESHOLD = 15;
|
|
47
|
-
/**
|
|
48
|
-
* Delimiters used to separate base names from variant suffixes.
|
|
49
|
-
* e.g., 'grok-beta' uses '-', 'automatosx_glm' uses '_'
|
|
50
|
-
*/
|
|
51
|
-
export const VARIANT_DELIMITERS = ['-', '_'];
|
|
52
|
-
/**
|
|
53
|
-
* Prefix used for virtual native capability tool names.
|
|
54
|
-
* e.g., 'native_web-search' represents Grok's native search capability
|
|
55
|
-
*/
|
|
56
|
-
export const NATIVE_CAPABILITY_PREFIX = 'native_';
|
|
57
|
-
/**
|
|
58
|
-
* Check if a name starts with a base name followed by a variant delimiter.
|
|
59
|
-
* Used to match variant names like 'grok-beta' to base name 'grok'.
|
|
60
|
-
*
|
|
61
|
-
* @param fullName - The full name to check (e.g., 'grok-beta')
|
|
62
|
-
* @param baseName - The base name to match against (e.g., 'grok')
|
|
63
|
-
* @returns True if fullName is a variant of baseName
|
|
64
|
-
*/
|
|
65
|
-
export function isVariantOf(fullName, baseName) {
|
|
66
|
-
return VARIANT_DELIMITERS.some(delimiter => fullName.startsWith(baseName + delimiter));
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Native capabilities built into provider APIs
|
|
70
|
-
* These don't require MCP - they're part of the API itself
|
|
71
|
-
*/
|
|
72
|
-
export const PROVIDER_NATIVE_CAPABILITIES = {
|
|
73
|
-
grok: ['web-search'], // Grok has native live search via API
|
|
74
|
-
glm: [], // GLM uses Z.AI MCP for web search
|
|
75
|
-
claude: [], // Claude has no native search in API
|
|
76
|
-
openai: [], // OpenAI standard API has no search
|
|
77
|
-
gemini: ['web-search'], // Gemini has grounding/search
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Known MCP server capability registry
|
|
81
|
-
* Add new servers here as they become available
|
|
82
|
-
*/
|
|
83
|
-
export const MCP_CAPABILITY_REGISTRY = [
|
|
84
|
-
// ========================================
|
|
85
|
-
// Z.AI MCP Servers (Provider-specific for GLM)
|
|
86
|
-
// ========================================
|
|
87
|
-
{
|
|
88
|
-
serverName: 'zai-web-search',
|
|
89
|
-
capabilities: ['web-search'],
|
|
90
|
-
priority: ToolPriority.PROVIDER_MCP,
|
|
91
|
-
providerAffinity: ['glm'],
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
serverName: 'zai-web-reader',
|
|
95
|
-
capabilities: ['web-fetch'],
|
|
96
|
-
priority: ToolPriority.PROVIDER_MCP,
|
|
97
|
-
providerAffinity: ['glm'],
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
serverName: 'zai-vision',
|
|
101
|
-
capabilities: ['vision'],
|
|
102
|
-
priority: ToolPriority.PROVIDER_MCP,
|
|
103
|
-
providerAffinity: ['glm'],
|
|
104
|
-
},
|
|
105
|
-
// ========================================
|
|
106
|
-
// Domain-Specific MCPs
|
|
107
|
-
// ========================================
|
|
108
|
-
{
|
|
109
|
-
serverName: 'figma',
|
|
110
|
-
capabilities: ['design-figma', 'design-general'],
|
|
111
|
-
priority: ToolPriority.DOMAIN_SPECIFIC,
|
|
112
|
-
},
|
|
113
|
-
// ========================================
|
|
114
|
-
// Official MCP Servers
|
|
115
|
-
// ========================================
|
|
116
|
-
{
|
|
117
|
-
serverName: 'github',
|
|
118
|
-
capabilities: ['git-operations'],
|
|
119
|
-
priority: ToolPriority.OFFICIAL_MCP,
|
|
120
|
-
isOfficial: true,
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
serverName: 'postgres',
|
|
124
|
-
capabilities: ['database'],
|
|
125
|
-
priority: ToolPriority.OFFICIAL_MCP,
|
|
126
|
-
isOfficial: true,
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
serverName: 'sqlite',
|
|
130
|
-
capabilities: ['database'],
|
|
131
|
-
priority: ToolPriority.OFFICIAL_MCP,
|
|
132
|
-
isOfficial: true,
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
serverName: 'puppeteer',
|
|
136
|
-
// Note: Puppeteer is primarily for browser automation and testing.
|
|
137
|
-
// It can fetch web content but via a full browser, which is heavyweight.
|
|
138
|
-
// Don't mark as 'web-fetch' to avoid superseding lightweight HTTP fetchers.
|
|
139
|
-
capabilities: ['testing'],
|
|
140
|
-
priority: ToolPriority.OFFICIAL_MCP,
|
|
141
|
-
isOfficial: true,
|
|
142
|
-
},
|
|
143
|
-
// ========================================
|
|
144
|
-
// Community MCPs
|
|
145
|
-
// ========================================
|
|
146
|
-
{
|
|
147
|
-
serverName: 'vercel',
|
|
148
|
-
capabilities: ['deployment'],
|
|
149
|
-
priority: ToolPriority.COMMUNITY_MCP,
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
serverName: 'netlify',
|
|
153
|
-
capabilities: ['deployment'],
|
|
154
|
-
priority: ToolPriority.COMMUNITY_MCP,
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
serverName: 'supabase',
|
|
158
|
-
capabilities: ['database'],
|
|
159
|
-
priority: ToolPriority.COMMUNITY_MCP,
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
serverName: 'firebase',
|
|
163
|
-
capabilities: ['database', 'deployment'],
|
|
164
|
-
priority: ToolPriority.COMMUNITY_MCP,
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
serverName: 'sentry',
|
|
168
|
-
capabilities: ['monitoring'],
|
|
169
|
-
priority: ToolPriority.COMMUNITY_MCP,
|
|
170
|
-
},
|
|
171
|
-
// ========================================
|
|
172
|
-
// General-Purpose MCPs (lowest priority)
|
|
173
|
-
// ========================================
|
|
174
|
-
{
|
|
175
|
-
serverName: 'automatosx',
|
|
176
|
-
capabilities: ['web-search', 'web-fetch', 'memory', 'agent-delegation'],
|
|
177
|
-
priority: ToolPriority.GENERAL_MCP,
|
|
178
|
-
},
|
|
179
|
-
];
|
|
180
|
-
/**
|
|
181
|
-
* Cached lowercase server name index for O(1) exact lookups.
|
|
182
|
-
* Maps lowercase server name to its MCPCapabilityMapping.
|
|
183
|
-
*/
|
|
184
|
-
const serverNameIndex = new Map(MCP_CAPABILITY_REGISTRY.map(mapping => [mapping.serverName.toLowerCase(), mapping]));
|
|
185
|
-
/**
|
|
186
|
-
* Pre-computed lowercase server names sorted by length (longest first).
|
|
187
|
-
* Used for efficient variant matching.
|
|
188
|
-
*/
|
|
189
|
-
const sortedServerNames = MCP_CAPABILITY_REGISTRY
|
|
190
|
-
.map(mapping => mapping.serverName.toLowerCase())
|
|
191
|
-
.sort((a, b) => b.length - a.length);
|
|
192
|
-
/**
|
|
193
|
-
* Pre-computed capability to servers index for O(1) capability lookups.
|
|
194
|
-
* Maps capability to array of servers that provide it.
|
|
195
|
-
*/
|
|
196
|
-
const capabilityIndex = new Map();
|
|
197
|
-
for (const mapping of MCP_CAPABILITY_REGISTRY) {
|
|
198
|
-
for (const capability of mapping.capabilities) {
|
|
199
|
-
let servers = capabilityIndex.get(capability);
|
|
200
|
-
if (!servers) {
|
|
201
|
-
servers = [];
|
|
202
|
-
capabilityIndex.set(capability, servers);
|
|
203
|
-
}
|
|
204
|
-
servers.push(mapping);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Get capability mapping for a server by name.
|
|
209
|
-
* Supports exact matches and variant matches (e.g., 'automatosx-glm' matches 'automatosx').
|
|
210
|
-
* Case-insensitive matching for robustness.
|
|
211
|
-
*
|
|
212
|
-
* @param serverName - The server name to look up (may include variant suffix)
|
|
213
|
-
* @returns The capability mapping, or undefined if not found
|
|
214
|
-
*/
|
|
215
|
-
export function getServerCapabilityMapping(serverName) {
|
|
216
|
-
const normalizedName = serverName.toLowerCase();
|
|
217
|
-
// O(1) exact match lookup
|
|
218
|
-
const exactMatch = serverNameIndex.get(normalizedName);
|
|
219
|
-
if (exactMatch) {
|
|
220
|
-
return exactMatch;
|
|
221
|
-
}
|
|
222
|
-
// Variant match - find longest matching base name
|
|
223
|
-
for (const baseName of sortedServerNames) {
|
|
224
|
-
if (isVariantOf(normalizedName, baseName)) {
|
|
225
|
-
return serverNameIndex.get(baseName);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return undefined;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* List of known provider names derived from PROVIDER_NATIVE_CAPABILITIES.
|
|
232
|
-
* Used for flexible provider name matching.
|
|
233
|
-
*/
|
|
234
|
-
const KNOWN_PROVIDERS = Object.keys(PROVIDER_NATIVE_CAPABILITIES);
|
|
235
|
-
/**
|
|
236
|
-
* Get the base provider name from a potentially variant provider string.
|
|
237
|
-
* e.g., 'grok-beta' -> 'grok', 'glm-4' -> 'glm', 'openai' -> 'openai'
|
|
238
|
-
*
|
|
239
|
-
* @param providerName - The provider name (may include variant suffix)
|
|
240
|
-
* @returns The base provider name, or undefined if not recognized
|
|
241
|
-
*/
|
|
242
|
-
function getBaseProviderName(providerName) {
|
|
243
|
-
const normalizedName = providerName.toLowerCase();
|
|
244
|
-
for (const knownProvider of KNOWN_PROVIDERS) {
|
|
245
|
-
if (normalizedName === knownProvider || isVariantOf(normalizedName, knownProvider)) {
|
|
246
|
-
return knownProvider;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return undefined;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Check if a provider has native support for a capability.
|
|
253
|
-
* Supports provider variants (e.g., 'grok-beta' matches 'grok' native capabilities)
|
|
254
|
-
*
|
|
255
|
-
* @param providerName - The provider name (may include variant suffix)
|
|
256
|
-
* @param capability - The capability to check
|
|
257
|
-
* @returns True if the provider natively supports the capability
|
|
258
|
-
*/
|
|
259
|
-
export function hasNativeCapability(providerName, capability) {
|
|
260
|
-
const baseProvider = getBaseProviderName(providerName);
|
|
261
|
-
if (!baseProvider) {
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
return PROVIDER_NATIVE_CAPABILITIES[baseProvider].includes(capability);
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Check if a provider matches a base provider name.
|
|
268
|
-
* e.g., 'grok-beta' matches 'grok', 'glm-4' matches 'glm'
|
|
269
|
-
*
|
|
270
|
-
* @param providerName - The provider name to check (may include variant suffix)
|
|
271
|
-
* @param baseProvider - The base provider to match against
|
|
272
|
-
* @returns True if the provider matches the base provider
|
|
273
|
-
*/
|
|
274
|
-
export function providerMatches(providerName, baseProvider) {
|
|
275
|
-
return getBaseProviderName(providerName) === baseProvider;
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Get the priority for a server, considering provider affinity.
|
|
279
|
-
*
|
|
280
|
-
* @param serverName - The MCP server name
|
|
281
|
-
* @param providerName - Optional provider name for affinity boosting
|
|
282
|
-
* @returns The priority value (higher = more preferred)
|
|
283
|
-
*/
|
|
284
|
-
export function getServerPriority(serverName, providerName) {
|
|
285
|
-
const mapping = getServerCapabilityMapping(serverName);
|
|
286
|
-
if (!mapping) {
|
|
287
|
-
// Unknown server - assign community priority
|
|
288
|
-
return ToolPriority.COMMUNITY_MCP;
|
|
289
|
-
}
|
|
290
|
-
// Boost priority if this server has affinity for the current provider
|
|
291
|
-
if (providerName && mapping.providerAffinity?.some(affinity => providerMatches(providerName, affinity))) {
|
|
292
|
-
return mapping.priority + PROVIDER_AFFINITY_BOOST;
|
|
293
|
-
}
|
|
294
|
-
return mapping.priority;
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Check if a server should be preferred for a given capability and provider.
|
|
298
|
-
*
|
|
299
|
-
* A server is preferred if:
|
|
300
|
-
* 1. The provider does NOT have native support for this capability, AND
|
|
301
|
-
* 2. Either:
|
|
302
|
-
* a. It has provider affinity for the current provider, OR
|
|
303
|
-
* b. It has the highest priority among all servers providing this capability
|
|
304
|
-
*
|
|
305
|
-
* Note: If the provider has native capability support, NO MCP server should be preferred.
|
|
306
|
-
*
|
|
307
|
-
* @param serverName - The MCP server name
|
|
308
|
-
* @param capability - The capability to check
|
|
309
|
-
* @param providerName - The current provider name
|
|
310
|
-
* @returns True if the server should be preferred for this capability
|
|
311
|
-
*/
|
|
312
|
-
export function shouldPreferServer(serverName, capability, providerName) {
|
|
313
|
-
const mapping = getServerCapabilityMapping(serverName);
|
|
314
|
-
if (!mapping)
|
|
315
|
-
return false;
|
|
316
|
-
// Check if server provides this capability
|
|
317
|
-
if (!mapping.capabilities.includes(capability))
|
|
318
|
-
return false;
|
|
319
|
-
// If the provider has native support for this capability, no MCP server should be preferred
|
|
320
|
-
if (hasNativeCapability(providerName, capability)) {
|
|
321
|
-
return false;
|
|
322
|
-
}
|
|
323
|
-
// Check if server has affinity for this provider
|
|
324
|
-
if (mapping.providerAffinity?.some(affinity => providerMatches(providerName, affinity))) {
|
|
325
|
-
return true;
|
|
326
|
-
}
|
|
327
|
-
// Even without affinity, check if this server has the highest priority for this capability
|
|
328
|
-
const serversForCapability = getServersForCapability(capability, providerName);
|
|
329
|
-
const topServer = serversForCapability[0];
|
|
330
|
-
if (topServer && topServer.serverName.toLowerCase() === serverName.toLowerCase()) {
|
|
331
|
-
return true;
|
|
332
|
-
}
|
|
333
|
-
return false;
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* Get all servers that provide a given capability, sorted by priority.
|
|
337
|
-
*
|
|
338
|
-
* @param capability - The capability to search for
|
|
339
|
-
* @param providerName - Optional provider name for affinity-based priority boosting
|
|
340
|
-
* @returns Array of server mappings sorted by priority (highest first)
|
|
341
|
-
*/
|
|
342
|
-
export function getServersForCapability(capability, providerName) {
|
|
343
|
-
const servers = capabilityIndex.get(capability);
|
|
344
|
-
if (!servers?.length) {
|
|
345
|
-
return [];
|
|
346
|
-
}
|
|
347
|
-
// Clone and sort to avoid mutating the cached array
|
|
348
|
-
return [...servers].sort((a, b) => getServerPriority(b.serverName, providerName) - getServerPriority(a.serverName, providerName));
|
|
349
|
-
}
|
|
350
|
-
//# sourceMappingURL=priority.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"priority.js","sourceRoot":"","sources":["../../src/tools/priority.ts"],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;AACJ,CAAC"}
|
package/dist/tools/registry.d.ts
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tool Registry for dynamic tool management
|
|
3
|
-
*
|
|
4
|
-
* Provides a centralized registry for tools, enabling:
|
|
5
|
-
* - Dynamic tool registration/unregistration
|
|
6
|
-
* - Dependency validation
|
|
7
|
-
* - Category-based organization
|
|
8
|
-
* - Custom tool development
|
|
9
|
-
*/
|
|
10
|
-
import type { ToolResult } from '../types/index.js';
|
|
11
|
-
import { Result } from '../mcp/type-safety.js';
|
|
12
|
-
/**
|
|
13
|
-
* Tool category classification
|
|
14
|
-
*/
|
|
15
|
-
export type ToolCategory = 'file' | 'command' | 'search' | 'analysis' | 'custom';
|
|
16
|
-
/**
|
|
17
|
-
* Complete tool definition for registration
|
|
18
|
-
*/
|
|
19
|
-
export interface ToolDefinition {
|
|
20
|
-
/** Unique tool name (lowercase with underscores) */
|
|
21
|
-
name: string;
|
|
22
|
-
/** Human-readable description */
|
|
23
|
-
description: string;
|
|
24
|
-
/** Semantic version (e.g., "1.0.0") */
|
|
25
|
-
version: string;
|
|
26
|
-
/** Tool category for organization */
|
|
27
|
-
category: ToolCategory;
|
|
28
|
-
/** Tool execution function */
|
|
29
|
-
execute: (args: Record<string, unknown>) => Promise<ToolResult>;
|
|
30
|
-
/** JSON Schema for tool parameters */
|
|
31
|
-
schema: {
|
|
32
|
-
type: 'object';
|
|
33
|
-
properties: Record<string, unknown>;
|
|
34
|
-
required?: string[];
|
|
35
|
-
};
|
|
36
|
-
/** Optional dependencies on other tools */
|
|
37
|
-
dependencies?: string[];
|
|
38
|
-
/** Optional metadata */
|
|
39
|
-
metadata?: {
|
|
40
|
-
author?: string;
|
|
41
|
-
license?: string;
|
|
42
|
-
homepage?: string;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* LLM Tool format (OpenAI function calling format)
|
|
47
|
-
*/
|
|
48
|
-
export interface LLMTool {
|
|
49
|
-
type: 'function';
|
|
50
|
-
function: {
|
|
51
|
-
name: string;
|
|
52
|
-
description: string;
|
|
53
|
-
parameters: {
|
|
54
|
-
type: 'object';
|
|
55
|
-
properties: Record<string, any>;
|
|
56
|
-
required?: string[];
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Tool Registry for dynamic tool management
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```typescript
|
|
65
|
-
* const registry = new ToolRegistry();
|
|
66
|
-
*
|
|
67
|
-
* registry.register({
|
|
68
|
-
* name: 'my_tool',
|
|
69
|
-
* description: 'Does something',
|
|
70
|
-
* version: '1.0.0',
|
|
71
|
-
* category: 'custom',
|
|
72
|
-
* async execute(args) {
|
|
73
|
-
* return { success: true, output: 'Done!' };
|
|
74
|
-
* },
|
|
75
|
-
* schema: {
|
|
76
|
-
* type: 'object',
|
|
77
|
-
* properties: {
|
|
78
|
-
* input: { type: 'string' }
|
|
79
|
-
* }
|
|
80
|
-
* }
|
|
81
|
-
* });
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
export declare class ToolRegistry {
|
|
85
|
-
private tools;
|
|
86
|
-
/**
|
|
87
|
-
* Register a new tool
|
|
88
|
-
*
|
|
89
|
-
* Validates:
|
|
90
|
-
* - Tool name format (lowercase with underscores)
|
|
91
|
-
* - No duplicate names
|
|
92
|
-
* - All dependencies exist
|
|
93
|
-
* - Schema is valid
|
|
94
|
-
*
|
|
95
|
-
* @param tool Tool definition to register
|
|
96
|
-
* @returns Ok(void) on success, Err(Error) on failure
|
|
97
|
-
*/
|
|
98
|
-
register(tool: ToolDefinition): Result<void, Error>;
|
|
99
|
-
/**
|
|
100
|
-
* Unregister a tool
|
|
101
|
-
*
|
|
102
|
-
* Validates that no other tools depend on this tool before removal.
|
|
103
|
-
*
|
|
104
|
-
* @param name Tool name to unregister
|
|
105
|
-
* @returns Ok(void) on success, Err(Error) on failure
|
|
106
|
-
*/
|
|
107
|
-
unregister(name: string): Result<void, Error>;
|
|
108
|
-
/**
|
|
109
|
-
* Get a tool by name
|
|
110
|
-
*
|
|
111
|
-
* @param name Tool name
|
|
112
|
-
* @returns Tool definition or undefined if not found
|
|
113
|
-
*/
|
|
114
|
-
get(name: string): ToolDefinition | undefined;
|
|
115
|
-
/**
|
|
116
|
-
* List all tools, optionally filtered by category
|
|
117
|
-
*
|
|
118
|
-
* @param category Optional category filter
|
|
119
|
-
* @returns Array of tool definitions
|
|
120
|
-
*/
|
|
121
|
-
list(category?: ToolCategory): ToolDefinition[];
|
|
122
|
-
/**
|
|
123
|
-
* Convert registered tools to LLM tool format
|
|
124
|
-
*
|
|
125
|
-
* Transforms internal ToolDefinition format to OpenAI function calling format.
|
|
126
|
-
*
|
|
127
|
-
* @returns Array of LLM tools
|
|
128
|
-
*/
|
|
129
|
-
toLLMTools(): LLMTool[];
|
|
130
|
-
/**
|
|
131
|
-
* Execute a tool by name
|
|
132
|
-
*
|
|
133
|
-
* @param name Tool name
|
|
134
|
-
* @param args Tool arguments
|
|
135
|
-
* @returns Tool result
|
|
136
|
-
*/
|
|
137
|
-
execute(name: string, args: any): Promise<ToolResult>;
|
|
138
|
-
/**
|
|
139
|
-
* Get tool count
|
|
140
|
-
*/
|
|
141
|
-
get size(): number;
|
|
142
|
-
/**
|
|
143
|
-
* Clear all tools
|
|
144
|
-
*/
|
|
145
|
-
clear(): void;
|
|
146
|
-
}
|