kynjal-cli 3.1.3 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/core/coder.md +1 -1
- package/.claude/agents/core/planner.md +2 -2
- package/.claude/agents/core/researcher.md +1 -1
- package/.claude/agents/core/reviewer.md +1 -1
- package/.claude/agents/core/tester.md +1 -1
- package/.claude/agents/data/data-ml-model.md +4 -4
- package/.claude/agents/development/dev-backend-api.md +4 -4
- package/.claude/agents/documentation/docs-api-openapi.md +4 -4
- package/.claude/agents/github/code-review-swarm.md +2 -2
- package/.claude/agents/github/issue-tracker.md +2 -2
- package/.claude/agents/github/pr-manager.md +2 -2
- package/.claude/agents/github/release-manager.md +2 -2
- package/.claude/agents/github/workflow-automation.md +2 -2
- package/.claude/agents/sparc/architecture.md +3 -3
- package/.claude/agents/sparc/pseudocode.md +2 -2
- package/.claude/agents/sparc/refinement.md +3 -3
- package/.claude/agents/sparc/specification.md +2 -2
- package/.claude/agents/swarm/adaptive-coordinator.md +1 -1
- package/.claude/agents/swarm/hierarchical-coordinator.md +1 -1
- package/.claude/agents/swarm/mesh-coordinator.md +1 -1
- package/.claude/agents/templates/base-template-generator.md +25 -4
- package/.claude/agents/templates/sparc-coordinator.md +3 -3
- package/.claude/helpers/auto-commit.sh +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +27 -9
- package/.claude/helpers/hook-handler.cjs +58 -18
- package/.claude/helpers/statusline.cjs +14 -33
- package/.claude/helpers/statusline.js +3 -3
- package/.claude/settings.json +9 -9
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +2 -2
- package/.claude/skills/swarm-orchestration/SKILL.md +1 -1
- package/README.md +383 -170
- package/bin/cli.js +6 -6
- package/bin/mcp-server.js +1 -1
- package/bin/preinstall.cjs +2 -0
- package/dist/src/appliance/gguf-engine.js +664 -0
- package/dist/src/appliance/gguf-engine.js.map +1 -0
- package/dist/src/appliance/ruvllm-bridge.js +492 -0
- package/dist/src/appliance/ruvllm-bridge.js.map +1 -0
- package/dist/src/appliance/rvfa-builder.js +383 -0
- package/dist/src/appliance/rvfa-builder.js.map +1 -0
- package/dist/src/appliance/rvfa-distribution.js +533 -0
- package/dist/src/appliance/rvfa-distribution.js.map +1 -0
- package/dist/src/appliance/rvfa-format.js +465 -0
- package/dist/src/appliance/rvfa-format.js.map +1 -0
- package/dist/src/appliance/rvfa-runner.js +373 -0
- package/dist/src/appliance/rvfa-runner.js.map +1 -0
- package/dist/src/appliance/rvfa-signing.js +469 -0
- package/dist/src/appliance/rvfa-signing.js.map +1 -0
- package/dist/src/benchmarks/pretrain/index.js +542 -331
- package/dist/src/benchmarks/pretrain/index.js.map +1 -1
- package/dist/src/commands/agent.d.ts.map +1 -1
- package/dist/src/commands/agent.js +725 -502
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze.js +1548 -1218
- package/dist/src/commands/analyze.js.map +1 -1
- package/dist/src/commands/appliance-advanced.d.ts +9 -0
- package/dist/src/commands/appliance-advanced.d.ts.map +1 -0
- package/dist/src/commands/appliance-advanced.js +324 -0
- package/dist/src/commands/appliance-advanced.js.map +1 -0
- package/dist/src/commands/appliance.d.ts +8 -0
- package/dist/src/commands/appliance.d.ts.map +1 -0
- package/dist/src/commands/appliance.js +581 -0
- package/dist/src/commands/appliance.js.map +1 -0
- package/dist/src/commands/benchmark.js +523 -372
- package/dist/src/commands/benchmark.js.map +1 -1
- package/dist/src/commands/claims.js +364 -274
- package/dist/src/commands/claims.js.map +1 -1
- package/dist/src/commands/cleanup.d.ts +13 -0
- package/dist/src/commands/cleanup.d.ts.map +1 -0
- package/dist/src/commands/cleanup.js +262 -0
- package/dist/src/commands/cleanup.js.map +1 -0
- package/dist/src/commands/completions.js +118 -477
- package/dist/src/commands/completions.js.map +1 -1
- package/dist/src/commands/config.js +303 -237
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/daemon.d.ts.map +1 -1
- package/dist/src/commands/daemon.js +597 -425
- package/dist/src/commands/daemon.js.map +1 -1
- package/dist/src/commands/deployment.js +275 -194
- package/dist/src/commands/deployment.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +690 -460
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/embeddings.js +1543 -1293
- package/dist/src/commands/embeddings.js.map +1 -1
- package/dist/src/commands/guidance.js +596 -449
- package/dist/src/commands/guidance.js.map +1 -1
- package/dist/src/commands/hive-mind.js +938 -854
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +3677 -2570
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.js +322 -122
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init.d.ts +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +943 -787
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/issues.js +558 -383
- package/dist/src/commands/issues.js.map +1 -1
- package/dist/src/commands/mcp.d.ts.map +1 -1
- package/dist/src/commands/mcp.js +605 -475
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +1031 -814
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/migrate.js +347 -282
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/neural.d.ts.map +1 -1
- package/dist/src/commands/neural.js +1563 -1283
- package/dist/src/commands/neural.js.map +1 -1
- package/dist/src/commands/performance.js +643 -497
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/plugins.js +841 -668
- package/dist/src/commands/plugins.js.map +1 -1
- package/dist/src/commands/process.js +447 -392
- package/dist/src/commands/process.js.map +1 -1
- package/dist/src/commands/progress.js +256 -162
- package/dist/src/commands/progress.js.map +1 -1
- package/dist/src/commands/providers.js +220 -150
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/route.js +665 -520
- package/dist/src/commands/route.js.map +1 -1
- package/dist/src/commands/ruvector/backup.js +651 -505
- package/dist/src/commands/ruvector/backup.js.map +1 -1
- package/dist/src/commands/ruvector/benchmark.js +401 -349
- package/dist/src/commands/ruvector/benchmark.js.map +1 -1
- package/dist/src/commands/ruvector/import.js +267 -225
- package/dist/src/commands/ruvector/import.js.map +1 -1
- package/dist/src/commands/ruvector/index.js +75 -37
- package/dist/src/commands/ruvector/index.js.map +1 -1
- package/dist/src/commands/ruvector/init.js +359 -336
- package/dist/src/commands/ruvector/init.js.map +1 -1
- package/dist/src/commands/ruvector/migrate.js +322 -335
- package/dist/src/commands/ruvector/migrate.js.map +1 -1
- package/dist/src/commands/ruvector/optimize.js +431 -375
- package/dist/src/commands/ruvector/optimize.js.map +1 -1
- package/dist/src/commands/ruvector/setup.js +117 -703
- package/dist/src/commands/ruvector/setup.js.map +1 -1
- package/dist/src/commands/ruvector/status.js +419 -364
- package/dist/src/commands/ruvector/status.js.map +1 -1
- package/dist/src/commands/security.d.ts.map +1 -1
- package/dist/src/commands/security.js +610 -456
- package/dist/src/commands/security.js.map +1 -1
- package/dist/src/commands/session.d.ts +1 -1
- package/dist/src/commands/session.js +627 -505
- package/dist/src/commands/session.js.map +1 -1
- package/dist/src/commands/start.d.ts +1 -1
- package/dist/src/commands/start.js +368 -271
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.d.ts +1 -1
- package/dist/src/commands/status.d.ts.map +1 -1
- package/dist/src/commands/status.js +492 -379
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.js +488 -408
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/commands/task.d.ts +1 -1
- package/dist/src/commands/task.js +539 -424
- package/dist/src/commands/task.js.map +1 -1
- package/dist/src/commands/transfer-store.js +412 -322
- package/dist/src/commands/transfer-store.js.map +1 -1
- package/dist/src/commands/update.js +291 -196
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/workflow.js +486 -386
- package/dist/src/commands/workflow.js.map +1 -1
- package/dist/src/config-adapter.js +40 -39
- package/dist/src/config-adapter.js.map +1 -1
- package/dist/src/index.js +416 -312
- package/dist/src/index.js.map +1 -1
- package/dist/src/infrastructure/in-memory-repositories.js +507 -246
- package/dist/src/infrastructure/in-memory-repositories.js.map +1 -1
- package/dist/src/init/claudemd-generator.js +78 -368
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.js +1019 -1345
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.js +60 -635
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/index.d.ts +1 -1
- package/dist/src/init/index.d.ts.map +1 -1
- package/dist/src/init/index.js +1 -1
- package/dist/src/init/index.js.map +1 -1
- package/dist/src/init/mcp-generator.d.ts +0 -1
- package/dist/src/init/mcp-generator.d.ts.map +1 -1
- package/dist/src/init/mcp-generator.js +62 -42
- package/dist/src/init/mcp-generator.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +167 -100
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.d.ts +16 -8
- package/dist/src/init/statusline-generator.d.ts.map +1 -1
- package/dist/src/init/statusline-generator.js +20 -1300
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +15 -5
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +66 -76
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/mcp-client.js +130 -76
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.js +758 -445
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +492 -391
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/agentdb-tools.d.ts +30 -0
- package/dist/src/mcp-tools/agentdb-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/agentdb-tools.js +758 -0
- package/dist/src/mcp-tools/agentdb-tools.js.map +1 -0
- package/dist/src/mcp-tools/analyze-tools.js +236 -172
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
- package/dist/src/mcp-tools/auto-install.js +142 -80
- package/dist/src/mcp-tools/auto-install.js.map +1 -1
- package/dist/src/mcp-tools/browser-tools.js +375 -252
- package/dist/src/mcp-tools/browser-tools.js.map +1 -1
- package/dist/src/mcp-tools/claims-tools.js +565 -473
- package/dist/src/mcp-tools/claims-tools.js.map +1 -1
- package/dist/src/mcp-tools/config-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +284 -190
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/coordination-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/coordination-tools.js +600 -349
- package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
- package/dist/src/mcp-tools/daa-tools.js +367 -289
- package/dist/src/mcp-tools/daa-tools.js.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +693 -582
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/mcp-tools/github-tools.js +312 -261
- package/dist/src/mcp-tools/github-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.js +718 -423
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +2726 -1978
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +2 -0
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +2 -0
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +514 -329
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/neural-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/neural-tools.js +428 -326
- package/dist/src/mcp-tools/neural-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +480 -420
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/mcp-tools/progress-tools.js +278 -204
- package/dist/src/mcp-tools/progress-tools.js.map +1 -1
- package/dist/src/mcp-tools/ruvllm-tools.d.ts +9 -0
- package/dist/src/mcp-tools/ruvllm-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/ruvllm-tools.js +399 -0
- package/dist/src/mcp-tools/ruvllm-tools.js.map +1 -0
- package/dist/src/mcp-tools/security-tools.js +429 -297
- package/dist/src/mcp-tools/security-tools.js.map +1 -1
- package/dist/src/mcp-tools/session-tools.js +234 -185
- package/dist/src/mcp-tools/session-tools.js.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.d.ts +2 -1
- package/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.js +303 -64
- package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
- package/dist/src/mcp-tools/system-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/system-tools.js +352 -200
- package/dist/src/mcp-tools/system-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/task-tools.js +357 -189
- package/dist/src/mcp-tools/task-tools.js.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.js +196 -148
- package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
- package/dist/src/mcp-tools/transfer-tools.js +333 -186
- package/dist/src/mcp-tools/transfer-tools.js.map +1 -1
- package/dist/src/mcp-tools/wasm-agent-tools.d.ts +9 -0
- package/dist/src/mcp-tools/wasm-agent-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/wasm-agent-tools.js +377 -0
- package/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/workflow-tools.js +471 -335
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
- package/dist/src/memory/ewc-consolidation.js +345 -173
- package/dist/src/memory/ewc-consolidation.js.map +1 -1
- package/dist/src/memory/intelligence.js +841 -359
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.js +1964 -0
- package/dist/src/memory/memory-bridge.js.map +1 -0
- package/dist/src/memory/memory-initializer.js +1895 -1602
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/memory/sona-optimizer.js +329 -199
- package/dist/src/memory/sona-optimizer.js.map +1 -1
- package/dist/src/output.d.ts +2 -2
- package/dist/src/output.d.ts.map +1 -1
- package/dist/src/output.js +273 -242
- package/dist/src/output.js.map +1 -1
- package/dist/src/parser.js +217 -124
- package/dist/src/parser.js.map +1 -1
- package/dist/src/plugins/manager.js +531 -278
- package/dist/src/plugins/manager.js.map +1 -1
- package/dist/src/plugins/store/discovery.js +362 -275
- package/dist/src/plugins/store/discovery.js.map +1 -1
- package/dist/src/plugins/store/index.js +105 -48
- package/dist/src/plugins/store/index.js.map +1 -1
- package/dist/src/plugins/store/search.js +107 -69
- package/dist/src/plugins/store/search.js.map +1 -1
- package/dist/src/plugins/tests/demo-plugin-store.js +160 -113
- package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -1
- package/dist/src/plugins/tests/standalone-test.js +223 -172
- package/dist/src/plugins/tests/standalone-test.js.map +1 -1
- package/dist/src/plugins/tests/test-plugin-store.js +228 -190
- package/dist/src/plugins/tests/test-plugin-store.js.map +1 -1
- package/dist/src/production/circuit-breaker.js +126 -62
- package/dist/src/production/circuit-breaker.js.map +1 -1
- package/dist/src/production/error-handler.js +156 -86
- package/dist/src/production/error-handler.js.map +1 -1
- package/dist/src/production/monitoring.js +220 -139
- package/dist/src/production/monitoring.js.map +1 -1
- package/dist/src/production/rate-limiter.js +93 -74
- package/dist/src/production/rate-limiter.js.map +1 -1
- package/dist/src/production/retry.js +167 -75
- package/dist/src/production/retry.js.map +1 -1
- package/dist/src/prompt.js +560 -436
- package/dist/src/prompt.js.map +1 -1
- package/dist/src/runtime/headless.js +289 -200
- package/dist/src/runtime/headless.js.map +1 -1
- package/dist/src/ruvector/agent-wasm.js +511 -0
- package/dist/src/ruvector/agent-wasm.js.map +1 -0
- package/dist/src/ruvector/ast-analyzer.js +232 -145
- package/dist/src/ruvector/ast-analyzer.js.map +1 -1
- package/dist/src/ruvector/coverage-router.js +419 -287
- package/dist/src/ruvector/coverage-router.js.map +1 -1
- package/dist/src/ruvector/coverage-tools.js +101 -56
- package/dist/src/ruvector/coverage-tools.js.map +1 -1
- package/dist/src/ruvector/diff-classifier.js +451 -324
- package/dist/src/ruvector/diff-classifier.js.map +1 -1
- package/dist/src/ruvector/enhanced-model-router.js +337 -251
- package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
- package/dist/src/ruvector/flash-attention.js +254 -223
- package/dist/src/ruvector/flash-attention.js.map +1 -1
- package/dist/src/ruvector/graph-analyzer.js +680 -486
- package/dist/src/ruvector/graph-analyzer.js.map +1 -1
- package/dist/src/ruvector/index.js +113 -27
- package/dist/src/ruvector/index.js.map +1 -1
- package/dist/src/ruvector/lora-adapter.js +248 -155
- package/dist/src/ruvector/lora-adapter.js.map +1 -1
- package/dist/src/ruvector/model-router.js +248 -175
- package/dist/src/ruvector/model-router.js.map +1 -1
- package/dist/src/ruvector/moe-router.js +286 -228
- package/dist/src/ruvector/moe-router.js.map +1 -1
- package/dist/src/ruvector/q-learning-router.js +338 -257
- package/dist/src/ruvector/q-learning-router.js.map +1 -1
- package/dist/src/ruvector/ruvllm-wasm.js +527 -0
- package/dist/src/ruvector/ruvllm-wasm.js.map +1 -0
- package/dist/src/ruvector/semantic-router.js +67 -60
- package/dist/src/ruvector/semantic-router.js.map +1 -1
- package/dist/src/ruvector/vector-db.js +205 -119
- package/dist/src/ruvector/vector-db.js.map +1 -1
- package/dist/src/services/agentic-flow-bridge.js +168 -0
- package/dist/src/services/agentic-flow-bridge.js.map +1 -0
- package/dist/src/services/claim-service.js +940 -615
- package/dist/src/services/claim-service.js.map +1 -1
- package/dist/src/services/container-worker-pool.js +669 -399
- package/dist/src/services/container-worker-pool.js.map +1 -1
- package/dist/src/services/headless-worker-executor.js +467 -441
- package/dist/src/services/headless-worker-executor.js.map +1 -1
- package/dist/src/services/index.d.ts +5 -5
- package/dist/src/services/index.d.ts.map +1 -1
- package/dist/src/services/index.js +4 -4
- package/dist/src/services/index.js.map +1 -1
- package/dist/src/services/registry-api.js +201 -93
- package/dist/src/services/registry-api.js.map +1 -1
- package/dist/src/services/ruvector-training.js +414 -144
- package/dist/src/services/ruvector-training.js.map +1 -1
- package/dist/src/services/worker-daemon.js +928 -531
- package/dist/src/services/worker-daemon.js.map +1 -1
- package/dist/src/services/worker-queue.js +550 -331
- package/dist/src/services/worker-queue.js.map +1 -1
- package/dist/src/suggest.js +55 -45
- package/dist/src/suggest.js.map +1 -1
- package/dist/src/transfer/anonymization/index.js +37 -29
- package/dist/src/transfer/anonymization/index.js.map +1 -1
- package/dist/src/transfer/deploy-seraphine.d.ts +1 -1
- package/dist/src/transfer/deploy-seraphine.js +156 -129
- package/dist/src/transfer/deploy-seraphine.js.map +1 -1
- package/dist/src/transfer/export.js +142 -84
- package/dist/src/transfer/export.js.map +1 -1
- package/dist/src/transfer/index.d.ts +1 -1
- package/dist/src/transfer/index.d.ts.map +1 -1
- package/dist/src/transfer/index.js +2 -0
- package/dist/src/transfer/index.js.map +1 -1
- package/dist/src/transfer/ipfs/client.js +337 -179
- package/dist/src/transfer/ipfs/client.js.map +1 -1
- package/dist/src/transfer/ipfs/upload.js +434 -290
- package/dist/src/transfer/ipfs/upload.js.map +1 -1
- package/dist/src/transfer/models/seraphine.js +58 -58
- package/dist/src/transfer/models/seraphine.js.map +1 -1
- package/dist/src/transfer/serialization/cfp.js +37 -33
- package/dist/src/transfer/serialization/cfp.js.map +1 -1
- package/dist/src/transfer/storage/gcs.js +248 -139
- package/dist/src/transfer/storage/gcs.js.map +1 -1
- package/dist/src/transfer/store/discovery.js +353 -243
- package/dist/src/transfer/store/discovery.js.map +1 -1
- package/dist/src/transfer/store/download.js +365 -243
- package/dist/src/transfer/store/download.js.map +1 -1
- package/dist/src/transfer/store/index.js +130 -63
- package/dist/src/transfer/store/index.js.map +1 -1
- package/dist/src/transfer/store/publish.js +258 -184
- package/dist/src/transfer/store/publish.js.map +1 -1
- package/dist/src/transfer/store/registry.js +73 -51
- package/dist/src/transfer/store/registry.js.map +1 -1
- package/dist/src/transfer/store/search.js +96 -64
- package/dist/src/transfer/store/search.js.map +1 -1
- package/dist/src/transfer/store/tests/standalone-test.js +231 -174
- package/dist/src/transfer/store/tests/standalone-test.js.map +1 -1
- package/dist/src/transfer/test-seraphine.js +130 -95
- package/dist/src/transfer/test-seraphine.js.map +1 -1
- package/dist/src/transfer/tests/test-store.js +239 -194
- package/dist/src/transfer/tests/test-store.js.map +1 -1
- package/dist/src/types.js +56 -27
- package/dist/src/types.js.map +1 -1
- package/dist/src/update/checker.js +183 -106
- package/dist/src/update/checker.js.map +1 -1
- package/dist/src/update/executor.js +198 -135
- package/dist/src/update/executor.js.map +1 -1
- package/dist/src/update/index.js +85 -38
- package/dist/src/update/index.js.map +1 -1
- package/dist/src/update/rate-limiter.js +31 -19
- package/dist/src/update/rate-limiter.js.map +1 -1
- package/dist/src/update/validator.js +64 -38
- package/dist/src/update/validator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -10
- package/.claude/agents/custom/accessibility-auditor.yaml +0 -56
- package/.claude/agents/custom/design-architect.yaml +0 -48
- package/.claude/agents/custom/ui-developer.yaml +0 -46
- package/.claude/agents/custom/ux-researcher.yaml +0 -60
- package/dist/src/benchmarks/pretrain/index.d.ts +0 -58
- package/dist/src/benchmarks/pretrain/index.d.ts.map +0 -1
- package/dist/src/commands/index.d.ts +0 -108
- package/dist/src/commands/index.d.ts.map +0 -1
- package/dist/src/config-adapter.d.ts +0 -15
- package/dist/src/config-adapter.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -76
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
- package/dist/src/infrastructure/in-memory-repositories.d.ts.map +0 -1
- package/dist/src/init/claudemd-generator.d.ts +0 -25
- package/dist/src/init/claudemd-generator.d.ts.map +0 -1
- package/dist/src/init/executor.d.ts +0 -41
- package/dist/src/init/executor.d.ts.map +0 -1
- package/dist/src/init/helpers-generator.d.ts +0 -60
- package/dist/src/init/helpers-generator.d.ts.map +0 -1
- package/dist/src/mcp-client.d.ts +0 -92
- package/dist/src/mcp-client.d.ts.map +0 -1
- package/dist/src/mcp-server.d.ts +0 -161
- package/dist/src/mcp-server.d.ts.map +0 -1
- package/dist/src/mcp-tools/auto-install.d.ts +0 -83
- package/dist/src/mcp-tools/auto-install.d.ts.map +0 -1
- package/dist/src/mcp-tools/types.d.ts +0 -31
- package/dist/src/mcp-tools/types.d.ts.map +0 -1
- package/dist/src/memory/ewc-consolidation.d.ts +0 -271
- package/dist/src/memory/ewc-consolidation.d.ts.map +0 -1
- package/dist/src/memory/intelligence.d.ts +0 -285
- package/dist/src/memory/intelligence.d.ts.map +0 -1
- package/dist/src/memory/memory-initializer.d.ts +0 -396
- package/dist/src/memory/memory-initializer.d.ts.map +0 -1
- package/dist/src/memory/sona-optimizer.d.ts +0 -227
- package/dist/src/memory/sona-optimizer.d.ts.map +0 -1
- package/dist/src/parser.d.ts +0 -41
- package/dist/src/parser.d.ts.map +0 -1
- package/dist/src/plugins/manager.d.ts +0 -133
- package/dist/src/plugins/manager.d.ts.map +0 -1
- package/dist/src/plugins/store/discovery.d.ts +0 -88
- package/dist/src/plugins/store/discovery.d.ts.map +0 -1
- package/dist/src/plugins/store/index.d.ts +0 -76
- package/dist/src/plugins/store/index.d.ts.map +0 -1
- package/dist/src/plugins/store/search.d.ts +0 -46
- package/dist/src/plugins/store/search.d.ts.map +0 -1
- package/dist/src/plugins/store/types.d.ts +0 -274
- package/dist/src/plugins/store/types.d.ts.map +0 -1
- package/dist/src/production/circuit-breaker.d.ts +0 -101
- package/dist/src/production/circuit-breaker.d.ts.map +0 -1
- package/dist/src/production/error-handler.d.ts +0 -92
- package/dist/src/production/error-handler.d.ts.map +0 -1
- package/dist/src/production/monitoring.d.ts +0 -161
- package/dist/src/production/monitoring.d.ts.map +0 -1
- package/dist/src/production/rate-limiter.d.ts +0 -80
- package/dist/src/production/rate-limiter.d.ts.map +0 -1
- package/dist/src/production/retry.d.ts +0 -48
- package/dist/src/production/retry.d.ts.map +0 -1
- package/dist/src/prompt.d.ts +0 -44
- package/dist/src/prompt.d.ts.map +0 -1
- package/dist/src/runtime/headless.d.ts +0 -60
- package/dist/src/runtime/headless.d.ts.map +0 -1
- package/dist/src/ruvector/ast-analyzer.d.ts +0 -67
- package/dist/src/ruvector/ast-analyzer.d.ts.map +0 -1
- package/dist/src/ruvector/coverage-router.d.ts +0 -160
- package/dist/src/ruvector/coverage-router.d.ts.map +0 -1
- package/dist/src/ruvector/diff-classifier.d.ts +0 -175
- package/dist/src/ruvector/diff-classifier.d.ts.map +0 -1
- package/dist/src/ruvector/enhanced-model-router.d.ts +0 -146
- package/dist/src/ruvector/enhanced-model-router.d.ts.map +0 -1
- package/dist/src/ruvector/flash-attention.d.ts +0 -195
- package/dist/src/ruvector/flash-attention.d.ts.map +0 -1
- package/dist/src/ruvector/graph-analyzer.d.ts +0 -187
- package/dist/src/ruvector/graph-analyzer.d.ts.map +0 -1
- package/dist/src/ruvector/index.d.ts +0 -34
- package/dist/src/ruvector/index.d.ts.map +0 -1
- package/dist/src/ruvector/lora-adapter.d.ts +0 -218
- package/dist/src/ruvector/lora-adapter.d.ts.map +0 -1
- package/dist/src/ruvector/model-router.d.ts +0 -220
- package/dist/src/ruvector/model-router.d.ts.map +0 -1
- package/dist/src/ruvector/moe-router.d.ts +0 -206
- package/dist/src/ruvector/moe-router.d.ts.map +0 -1
- package/dist/src/ruvector/q-learning-router.d.ts +0 -211
- package/dist/src/ruvector/q-learning-router.d.ts.map +0 -1
- package/dist/src/ruvector/semantic-router.d.ts +0 -77
- package/dist/src/ruvector/semantic-router.d.ts.map +0 -1
- package/dist/src/ruvector/vector-db.d.ts +0 -69
- package/dist/src/ruvector/vector-db.d.ts.map +0 -1
- package/dist/src/services/claim-service.d.ts +0 -204
- package/dist/src/services/claim-service.d.ts.map +0 -1
- package/dist/src/services/container-worker-pool.d.ts +0 -197
- package/dist/src/services/container-worker-pool.d.ts.map +0 -1
- package/dist/src/services/headless-worker-executor.d.ts +0 -304
- package/dist/src/services/headless-worker-executor.d.ts.map +0 -1
- package/dist/src/services/registry-api.d.ts +0 -58
- package/dist/src/services/registry-api.d.ts.map +0 -1
- package/dist/src/services/ruvector-training.d.ts +0 -213
- package/dist/src/services/ruvector-training.d.ts.map +0 -1
- package/dist/src/services/worker-daemon.d.ts +0 -203
- package/dist/src/services/worker-daemon.d.ts.map +0 -1
- package/dist/src/services/worker-queue.d.ts +0 -194
- package/dist/src/services/worker-queue.d.ts.map +0 -1
- package/dist/src/suggest.d.ts +0 -53
- package/dist/src/suggest.d.ts.map +0 -1
- package/dist/src/transfer/export.d.ts +0 -25
- package/dist/src/transfer/export.d.ts.map +0 -1
- package/dist/src/transfer/ipfs/client.d.ts +0 -109
- package/dist/src/transfer/ipfs/client.d.ts.map +0 -1
- package/dist/src/transfer/ipfs/upload.d.ts +0 -95
- package/dist/src/transfer/ipfs/upload.d.ts.map +0 -1
- package/dist/src/transfer/models/seraphine.d.ts +0 -72
- package/dist/src/transfer/models/seraphine.d.ts.map +0 -1
- package/dist/src/transfer/serialization/cfp.d.ts +0 -49
- package/dist/src/transfer/serialization/cfp.d.ts.map +0 -1
- package/dist/src/transfer/storage/gcs.d.ts +0 -82
- package/dist/src/transfer/storage/gcs.d.ts.map +0 -1
- package/dist/src/transfer/store/discovery.d.ts +0 -84
- package/dist/src/transfer/store/discovery.d.ts.map +0 -1
- package/dist/src/transfer/store/download.d.ts +0 -70
- package/dist/src/transfer/store/download.d.ts.map +0 -1
- package/dist/src/transfer/store/index.d.ts +0 -84
- package/dist/src/transfer/store/index.d.ts.map +0 -1
- package/dist/src/transfer/store/publish.d.ts +0 -76
- package/dist/src/transfer/store/publish.d.ts.map +0 -1
- package/dist/src/transfer/store/search.d.ts +0 -54
- package/dist/src/transfer/store/search.d.ts.map +0 -1
- package/dist/src/transfer/types.d.ts +0 -245
- package/dist/src/transfer/types.d.ts.map +0 -1
- package/dist/src/types.d.ts +0 -198
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/update/checker.d.ts +0 -34
- package/dist/src/update/checker.d.ts.map +0 -1
- package/dist/src/update/executor.d.ts +0 -32
- package/dist/src/update/executor.d.ts.map +0 -1
- package/dist/src/update/index.d.ts +0 -33
- package/dist/src/update/index.d.ts.map +0 -1
- package/dist/src/update/rate-limiter.d.ts +0 -20
- package/dist/src/update/rate-limiter.d.ts.map +0 -1
- package/dist/src/update/validator.d.ts +0 -17
- package/dist/src/update/validator.d.ts.map +0 -1
|
@@ -8,6 +8,53 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module enhanced-model-router
|
|
10
10
|
*/
|
|
11
|
+
var __assign = (this && this.__assign) || function () {
|
|
12
|
+
__assign = Object.assign || function(t) {
|
|
13
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14
|
+
s = arguments[i];
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
}
|
|
18
|
+
return t;
|
|
19
|
+
};
|
|
20
|
+
return __assign.apply(this, arguments);
|
|
21
|
+
};
|
|
22
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
23
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
24
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
25
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
26
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
27
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
28
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
32
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
33
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
34
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
35
|
+
function step(op) {
|
|
36
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
37
|
+
while (_) try {
|
|
38
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
39
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
40
|
+
switch (op[0]) {
|
|
41
|
+
case 0: case 1: t = op; break;
|
|
42
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
43
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
44
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
45
|
+
default:
|
|
46
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
47
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
48
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
49
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
50
|
+
if (t[2]) _.ops.pop();
|
|
51
|
+
_.trys.pop(); continue;
|
|
52
|
+
}
|
|
53
|
+
op = body.call(thisArg, _);
|
|
54
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
55
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
56
|
+
}
|
|
57
|
+
};
|
|
11
58
|
import { existsSync, readFileSync } from 'fs';
|
|
12
59
|
import { extname } from 'path';
|
|
13
60
|
import { getModelRouter } from './model-router.js';
|
|
@@ -17,7 +64,7 @@ import { getModelRouter } from './model-router.js';
|
|
|
17
64
|
/**
|
|
18
65
|
* Pattern definitions for Agent Booster intent detection
|
|
19
66
|
*/
|
|
20
|
-
|
|
67
|
+
var INTENT_PATTERNS = {
|
|
21
68
|
'var-to-const': {
|
|
22
69
|
patterns: [
|
|
23
70
|
/convert\s+var\s+to\s+const/i,
|
|
@@ -28,7 +75,7 @@ const INTENT_PATTERNS = {
|
|
|
28
75
|
/use\s+const\s+instead\s+of\s+var/i,
|
|
29
76
|
],
|
|
30
77
|
weight: 1.0,
|
|
31
|
-
description: 'Convert var declarations to const/let'
|
|
78
|
+
description: 'Convert var declarations to const/let'
|
|
32
79
|
},
|
|
33
80
|
'add-types': {
|
|
34
81
|
patterns: [
|
|
@@ -39,7 +86,7 @@ const INTENT_PATTERNS = {
|
|
|
39
86
|
/annotate\s+with\s+types?/i,
|
|
40
87
|
],
|
|
41
88
|
weight: 0.9,
|
|
42
|
-
description: 'Add TypeScript type annotations'
|
|
89
|
+
description: 'Add TypeScript type annotations'
|
|
43
90
|
},
|
|
44
91
|
'add-error-handling': {
|
|
45
92
|
patterns: [
|
|
@@ -49,8 +96,8 @@ const INTENT_PATTERNS = {
|
|
|
49
96
|
/handle\s+errors?/i,
|
|
50
97
|
/add\s+exception\s+handling/i,
|
|
51
98
|
],
|
|
52
|
-
weight: 0.7,
|
|
53
|
-
description: 'Wrap code in try/catch blocks'
|
|
99
|
+
weight: 0.7,
|
|
100
|
+
description: 'Wrap code in try/catch blocks'
|
|
54
101
|
},
|
|
55
102
|
'async-await': {
|
|
56
103
|
patterns: [
|
|
@@ -64,7 +111,7 @@ const INTENT_PATTERNS = {
|
|
|
64
111
|
/callbacks?\s+to\s+async/i,
|
|
65
112
|
],
|
|
66
113
|
weight: 0.8,
|
|
67
|
-
description: 'Convert callbacks/promises to async/await'
|
|
114
|
+
description: 'Convert callbacks/promises to async/await'
|
|
68
115
|
},
|
|
69
116
|
'add-logging': {
|
|
70
117
|
patterns: [
|
|
@@ -75,7 +122,7 @@ const INTENT_PATTERNS = {
|
|
|
75
122
|
/add\s+trace\s+logging/i,
|
|
76
123
|
],
|
|
77
124
|
weight: 0.85,
|
|
78
|
-
description: 'Add console.log or logging statements'
|
|
125
|
+
description: 'Add console.log or logging statements'
|
|
79
126
|
},
|
|
80
127
|
'remove-console': {
|
|
81
128
|
patterns: [
|
|
@@ -89,13 +136,13 @@ const INTENT_PATTERNS = {
|
|
|
89
136
|
/delete\s+(?:all\s+)?console\.log/i,
|
|
90
137
|
],
|
|
91
138
|
weight: 0.95,
|
|
92
|
-
description: 'Remove console.* calls'
|
|
93
|
-
}
|
|
139
|
+
description: 'Remove console.* calls'
|
|
140
|
+
}
|
|
94
141
|
};
|
|
95
142
|
/**
|
|
96
143
|
* File path extraction patterns
|
|
97
144
|
*/
|
|
98
|
-
|
|
145
|
+
var FILE_PATH_PATTERNS = [
|
|
99
146
|
/(?:in|from|to|file|path)\s+[`"']?([a-zA-Z0-9_./\\-]+\.[a-zA-Z]+)[`"']?/i,
|
|
100
147
|
/[`"']([a-zA-Z0-9_./\\-]+\.[a-zA-Z]+)[`"']/,
|
|
101
148
|
/(\S+\.[tj]sx?)\b/i,
|
|
@@ -108,7 +155,7 @@ const FILE_PATH_PATTERNS = [
|
|
|
108
155
|
* High-complexity keywords that indicate Tier 3 (Opus) routing
|
|
109
156
|
* These tasks require deep reasoning and architectural understanding
|
|
110
157
|
*/
|
|
111
|
-
|
|
158
|
+
var TIER3_KEYWORDS = [
|
|
112
159
|
// Architecture & Design
|
|
113
160
|
/\b(microservices?|architecture|system\s+design|distributed)\b/i,
|
|
114
161
|
/\b(design|architect|plan)\s+(a|an|the|complex)\b/i,
|
|
@@ -134,7 +181,7 @@ const TIER3_KEYWORDS = [
|
|
|
134
181
|
/\b(performance\s+critical|low\s+latency|high\s+throughput)\b/i,
|
|
135
182
|
/\b(memory\s+optimi|cache\s+strateg|concurrent)\b/i,
|
|
136
183
|
];
|
|
137
|
-
|
|
184
|
+
var LANGUAGE_MAP = {
|
|
138
185
|
'.js': 'javascript',
|
|
139
186
|
'.jsx': 'javascript',
|
|
140
187
|
'.ts': 'typescript',
|
|
@@ -148,7 +195,7 @@ const LANGUAGE_MAP = {
|
|
|
148
195
|
'.swift': 'swift',
|
|
149
196
|
'.c': 'c',
|
|
150
197
|
'.cpp': 'cpp',
|
|
151
|
-
'.h': 'c'
|
|
198
|
+
'.h': 'c'
|
|
152
199
|
};
|
|
153
200
|
// ============================================================================
|
|
154
201
|
// Enhanced Model Router Implementation
|
|
@@ -161,52 +208,44 @@ const LANGUAGE_MAP = {
|
|
|
161
208
|
* - Tier 2: Haiku for low complexity tasks
|
|
162
209
|
* - Tier 3: Sonnet/Opus for complex reasoning tasks
|
|
163
210
|
*/
|
|
164
|
-
|
|
165
|
-
config
|
|
166
|
-
|
|
167
|
-
constructor(config) {
|
|
168
|
-
this.config = {
|
|
169
|
-
agentBoosterEnabled: true,
|
|
170
|
-
agentBoosterConfidenceThreshold: 0.7,
|
|
171
|
-
enabledIntents: [
|
|
211
|
+
var EnhancedModelRouter = /** @class */ (function () {
|
|
212
|
+
function EnhancedModelRouter(config) {
|
|
213
|
+
this.config = __assign({ agentBoosterEnabled: true, agentBoosterConfidenceThreshold: 0.7, enabledIntents: [
|
|
172
214
|
'var-to-const',
|
|
173
215
|
'add-types',
|
|
174
216
|
'add-error-handling',
|
|
175
217
|
'async-await',
|
|
176
218
|
'add-logging',
|
|
177
219
|
'remove-console',
|
|
178
|
-
],
|
|
179
|
-
complexityThresholds: {
|
|
220
|
+
], complexityThresholds: {
|
|
180
221
|
haiku: 0.3,
|
|
181
222
|
sonnet: 0.6,
|
|
182
|
-
opus: 1.0
|
|
183
|
-
},
|
|
184
|
-
preferCost: false,
|
|
185
|
-
preferQuality: false,
|
|
186
|
-
...config,
|
|
187
|
-
};
|
|
223
|
+
opus: 1.0
|
|
224
|
+
}, preferCost: false, preferQuality: false }, config);
|
|
188
225
|
this.tinyDancerRouter = getModelRouter();
|
|
189
226
|
}
|
|
190
227
|
/**
|
|
191
228
|
* Detect code editing intent from task description
|
|
192
229
|
*/
|
|
193
|
-
detectIntent(task) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
for (
|
|
230
|
+
EnhancedModelRouter.prototype.detectIntent = function (task) {
|
|
231
|
+
var taskLower = task.toLowerCase();
|
|
232
|
+
var bestIntent = null;
|
|
233
|
+
var bestScore = 0;
|
|
234
|
+
for (var _i = 0, _a = Object.entries(INTENT_PATTERNS); _i < _a.length; _i++) {
|
|
235
|
+
var _b = _a[_i], intentType = _b[0], config = _b[1];
|
|
198
236
|
if (!this.config.enabledIntents.includes(intentType)) {
|
|
199
237
|
continue;
|
|
200
238
|
}
|
|
201
|
-
for (
|
|
239
|
+
for (var _c = 0, _d = config.patterns; _c < _d.length; _c++) {
|
|
240
|
+
var pattern = _d[_c];
|
|
202
241
|
if (pattern.test(taskLower)) {
|
|
203
|
-
|
|
242
|
+
var score = config.weight;
|
|
204
243
|
if (score > bestScore) {
|
|
205
244
|
bestScore = score;
|
|
206
245
|
bestIntent = {
|
|
207
246
|
type: intentType,
|
|
208
247
|
confidence: score,
|
|
209
|
-
description: config.description
|
|
248
|
+
description: config.description
|
|
210
249
|
};
|
|
211
250
|
}
|
|
212
251
|
}
|
|
@@ -214,7 +253,7 @@ export class EnhancedModelRouter {
|
|
|
214
253
|
}
|
|
215
254
|
// Extract file path if intent found
|
|
216
255
|
if (bestIntent) {
|
|
217
|
-
|
|
256
|
+
var filePath = this.extractFilePath(task);
|
|
218
257
|
if (filePath) {
|
|
219
258
|
bestIntent.filePath = filePath;
|
|
220
259
|
bestIntent.language = this.detectLanguage(filePath);
|
|
@@ -225,255 +264,297 @@ export class EnhancedModelRouter {
|
|
|
225
264
|
}
|
|
226
265
|
}
|
|
227
266
|
return bestIntent;
|
|
228
|
-
}
|
|
267
|
+
};
|
|
229
268
|
/**
|
|
230
269
|
* Extract file path from task description
|
|
231
270
|
*/
|
|
232
|
-
extractFilePath(task) {
|
|
233
|
-
for (
|
|
234
|
-
|
|
271
|
+
EnhancedModelRouter.prototype.extractFilePath = function (task) {
|
|
272
|
+
for (var _i = 0, FILE_PATH_PATTERNS_1 = FILE_PATH_PATTERNS; _i < FILE_PATH_PATTERNS_1.length; _i++) {
|
|
273
|
+
var pattern = FILE_PATH_PATTERNS_1[_i];
|
|
274
|
+
var match = task.match(pattern);
|
|
235
275
|
if (match && match[1]) {
|
|
236
276
|
return match[1];
|
|
237
277
|
}
|
|
238
278
|
}
|
|
239
279
|
return null;
|
|
240
|
-
}
|
|
280
|
+
};
|
|
241
281
|
/**
|
|
242
282
|
* Detect language from file extension
|
|
243
283
|
*/
|
|
244
|
-
detectLanguage(filePath) {
|
|
245
|
-
|
|
284
|
+
EnhancedModelRouter.prototype.detectLanguage = function (filePath) {
|
|
285
|
+
var ext = extname(filePath).toLowerCase();
|
|
246
286
|
return LANGUAGE_MAP[ext] || 'javascript';
|
|
247
|
-
}
|
|
287
|
+
};
|
|
248
288
|
/**
|
|
249
289
|
* Check if task contains Tier 3 (Opus) keywords
|
|
250
290
|
*/
|
|
251
|
-
containsTier3Keywords(task) {
|
|
252
|
-
|
|
253
|
-
for (
|
|
291
|
+
EnhancedModelRouter.prototype.containsTier3Keywords = function (task) {
|
|
292
|
+
var count = 0;
|
|
293
|
+
for (var _i = 0, TIER3_KEYWORDS_1 = TIER3_KEYWORDS; _i < TIER3_KEYWORDS_1.length; _i++) {
|
|
294
|
+
var pattern = TIER3_KEYWORDS_1[_i];
|
|
254
295
|
if (pattern.test(task)) {
|
|
255
296
|
count++;
|
|
256
297
|
}
|
|
257
298
|
}
|
|
258
|
-
return { matches: count > 0, count };
|
|
259
|
-
}
|
|
299
|
+
return { matches: count > 0, count: count };
|
|
300
|
+
};
|
|
260
301
|
/**
|
|
261
302
|
* Route a task to the optimal tier and handler
|
|
262
303
|
*/
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
304
|
+
EnhancedModelRouter.prototype.route = function (task, context) {
|
|
305
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
306
|
+
var intent, tier3Check, astComplexity, targetFile, _a, tinyDancerResult, finalComplexity, _b, haiku, sonnet;
|
|
307
|
+
return __generator(this, function (_c) {
|
|
308
|
+
switch (_c.label) {
|
|
309
|
+
case 0:
|
|
310
|
+
// Step 1: Try Agent Booster intent detection
|
|
311
|
+
if (this.config.agentBoosterEnabled) {
|
|
312
|
+
intent = this.detectIntent(task);
|
|
313
|
+
if (intent && intent.confidence >= this.config.agentBoosterConfidenceThreshold) {
|
|
314
|
+
return [2 /*return*/, {
|
|
315
|
+
tier: 1,
|
|
316
|
+
handler: 'agent-booster',
|
|
317
|
+
confidence: intent.confidence,
|
|
318
|
+
reasoning: "Agent Booster can handle \"" + intent.type + "\" with " + (intent.confidence * 100).toFixed(0) + "% confidence",
|
|
319
|
+
agentBoosterIntent: intent,
|
|
320
|
+
canSkipLLM: true,
|
|
321
|
+
estimatedLatencyMs: 1,
|
|
322
|
+
estimatedCost: 0
|
|
323
|
+
}];
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
tier3Check = this.containsTier3Keywords(task);
|
|
327
|
+
if (tier3Check.matches && tier3Check.count >= 2) {
|
|
328
|
+
// Strong signal for Opus - multiple complex keywords
|
|
329
|
+
return [2 /*return*/, {
|
|
330
|
+
tier: 3,
|
|
331
|
+
handler: 'opus',
|
|
332
|
+
model: 'opus',
|
|
333
|
+
confidence: Math.min(0.95, 0.7 + tier3Check.count * 0.1),
|
|
334
|
+
complexity: 0.8 + tier3Check.count * 0.05,
|
|
335
|
+
reasoning: "High complexity task (" + tier3Check.count + " architectural keywords) - using opus",
|
|
336
|
+
canSkipLLM: false,
|
|
337
|
+
estimatedLatencyMs: 5000,
|
|
338
|
+
estimatedCost: 0.015
|
|
339
|
+
}];
|
|
340
|
+
}
|
|
341
|
+
targetFile = (context === null || context === void 0 ? void 0 : context.filePath) || this.extractFilePath(task);
|
|
342
|
+
if (!(targetFile && existsSync(targetFile))) return [3 /*break*/, 4];
|
|
343
|
+
_c.label = 1;
|
|
344
|
+
case 1:
|
|
345
|
+
_c.trys.push([1, 3, , 4]);
|
|
346
|
+
return [4 /*yield*/, this.analyzeASTComplexity(targetFile)];
|
|
347
|
+
case 2:
|
|
348
|
+
astComplexity = _c.sent();
|
|
349
|
+
return [3 /*break*/, 4];
|
|
350
|
+
case 3:
|
|
351
|
+
_a = _c.sent();
|
|
352
|
+
return [3 /*break*/, 4];
|
|
353
|
+
case 4: return [4 /*yield*/, this.tinyDancerRouter.route(task)];
|
|
354
|
+
case 5:
|
|
355
|
+
tinyDancerResult = _c.sent();
|
|
356
|
+
finalComplexity = astComplexity !== undefined
|
|
357
|
+
? (astComplexity + tinyDancerResult.complexity) / 2
|
|
358
|
+
: tinyDancerResult.complexity;
|
|
359
|
+
// Boost complexity if tier3 keywords found (even just one)
|
|
360
|
+
if (tier3Check.matches) {
|
|
361
|
+
finalComplexity = Math.min(1.0, finalComplexity + 0.25);
|
|
362
|
+
}
|
|
363
|
+
_b = this.config.complexityThresholds, haiku = _b.haiku, sonnet = _b.sonnet;
|
|
364
|
+
if (finalComplexity < haiku) {
|
|
365
|
+
return [2 /*return*/, {
|
|
366
|
+
tier: 2,
|
|
367
|
+
handler: 'haiku',
|
|
368
|
+
model: 'haiku',
|
|
369
|
+
confidence: tinyDancerResult.confidence,
|
|
370
|
+
complexity: finalComplexity,
|
|
371
|
+
reasoning: "Low complexity (" + (finalComplexity * 100).toFixed(0) + "%) - using haiku",
|
|
372
|
+
canSkipLLM: false,
|
|
373
|
+
estimatedLatencyMs: 500,
|
|
374
|
+
estimatedCost: 0.0002
|
|
375
|
+
}];
|
|
376
|
+
}
|
|
377
|
+
if (finalComplexity < sonnet) {
|
|
378
|
+
return [2 /*return*/, {
|
|
379
|
+
tier: 2,
|
|
380
|
+
handler: 'sonnet',
|
|
381
|
+
model: 'sonnet',
|
|
382
|
+
confidence: tinyDancerResult.confidence,
|
|
383
|
+
complexity: finalComplexity,
|
|
384
|
+
reasoning: "Medium complexity (" + (finalComplexity * 100).toFixed(0) + "%) - using sonnet",
|
|
385
|
+
canSkipLLM: false,
|
|
386
|
+
estimatedLatencyMs: 2000,
|
|
387
|
+
estimatedCost: 0.003
|
|
388
|
+
}];
|
|
389
|
+
}
|
|
390
|
+
return [2 /*return*/, {
|
|
391
|
+
tier: 3,
|
|
392
|
+
handler: 'opus',
|
|
393
|
+
model: 'opus',
|
|
394
|
+
confidence: tinyDancerResult.confidence,
|
|
395
|
+
complexity: finalComplexity,
|
|
396
|
+
reasoning: "High complexity (" + (finalComplexity * 100).toFixed(0) + "%) - using opus",
|
|
397
|
+
canSkipLLM: false,
|
|
398
|
+
estimatedLatencyMs: 5000,
|
|
399
|
+
estimatedCost: 0.015
|
|
400
|
+
}];
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
});
|
|
404
|
+
};
|
|
358
405
|
/**
|
|
359
406
|
* Analyze AST complexity of a file
|
|
360
407
|
* Returns normalized complexity score (0-1)
|
|
361
408
|
*/
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
409
|
+
EnhancedModelRouter.prototype.analyzeASTComplexity = function (filePath) {
|
|
410
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
411
|
+
var content, lines, complexity, avgIndent, controlFlowCount, functionCount;
|
|
412
|
+
return __generator(this, function (_a) {
|
|
413
|
+
try {
|
|
414
|
+
content = readFileSync(filePath, 'utf-8');
|
|
415
|
+
lines = content.split('\n');
|
|
416
|
+
complexity = 0;
|
|
417
|
+
// Line count contribution
|
|
418
|
+
complexity += Math.min(0.3, lines.length / 1000);
|
|
419
|
+
avgIndent = lines
|
|
420
|
+
.filter(function (l) { return l.trim().length > 0; })
|
|
421
|
+
.map(function (l) { var _a; return ((_a = l.match(/^(\s*)/)) === null || _a === void 0 ? void 0 : _a[1].length) || 0; })
|
|
422
|
+
.reduce(function (sum, indent) { return sum + indent; }, 0) / Math.max(1, lines.length);
|
|
423
|
+
complexity += Math.min(0.2, avgIndent / 20);
|
|
424
|
+
controlFlowCount = (content.match(/\b(if|else|for|while|switch|case|try|catch|async|await)\b/g) || []).length;
|
|
425
|
+
complexity += Math.min(0.3, controlFlowCount / 100);
|
|
426
|
+
functionCount = (content.match(/\b(function|class|=>)\b/g) || []).length;
|
|
427
|
+
complexity += Math.min(0.2, functionCount / 50);
|
|
428
|
+
return [2 /*return*/, Math.min(1, complexity)];
|
|
429
|
+
}
|
|
430
|
+
catch (_b) {
|
|
431
|
+
return [2 /*return*/, 0.5]; // Default to medium complexity on error
|
|
432
|
+
}
|
|
433
|
+
return [2 /*return*/];
|
|
434
|
+
});
|
|
435
|
+
});
|
|
436
|
+
};
|
|
388
437
|
/**
|
|
389
438
|
* Execute task using the appropriate tier
|
|
390
439
|
* Returns the result and routing information
|
|
391
440
|
*/
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
441
|
+
EnhancedModelRouter.prototype.execute = function (task, context) {
|
|
442
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
443
|
+
var routeResult, abResult;
|
|
444
|
+
return __generator(this, function (_a) {
|
|
445
|
+
switch (_a.label) {
|
|
446
|
+
case 0: return [4 /*yield*/, this.route(task, context)];
|
|
447
|
+
case 1:
|
|
448
|
+
routeResult = _a.sent();
|
|
449
|
+
if (!(routeResult.tier === 1 && routeResult.agentBoosterIntent)) return [3 /*break*/, 3];
|
|
450
|
+
return [4 /*yield*/, this.tryAgentBooster(routeResult.agentBoosterIntent, context)];
|
|
451
|
+
case 2:
|
|
452
|
+
abResult = _a.sent();
|
|
453
|
+
if (abResult.success) {
|
|
454
|
+
return [2 /*return*/, {
|
|
455
|
+
result: { applied: true, confidence: abResult.confidence },
|
|
456
|
+
routeResult: routeResult
|
|
457
|
+
}];
|
|
458
|
+
}
|
|
459
|
+
// Agent Booster failed, fall back to LLM
|
|
460
|
+
routeResult.tier = 2;
|
|
461
|
+
routeResult.handler = 'sonnet';
|
|
462
|
+
routeResult.model = 'sonnet';
|
|
463
|
+
routeResult.canSkipLLM = false;
|
|
464
|
+
routeResult.reasoning += ' (Agent Booster fallback to LLM)';
|
|
465
|
+
_a.label = 3;
|
|
466
|
+
case 3:
|
|
467
|
+
// Return routing result - caller handles LLM invocation
|
|
468
|
+
return [2 /*return*/, { result: routeResult.reasoning, routeResult: routeResult }];
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
});
|
|
472
|
+
};
|
|
413
473
|
/**
|
|
414
474
|
* Try to apply edit using Agent Booster
|
|
415
475
|
*/
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
476
|
+
EnhancedModelRouter.prototype.tryAgentBooster = function (intent, context) {
|
|
477
|
+
var _a, _b;
|
|
478
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
479
|
+
var filePath, originalCode, intentToInstruction, instruction, language, boosterModule, result_1, SAFE_LANGUAGES, safeLang, execSync, cmd, result, parsed, _c;
|
|
480
|
+
return __generator(this, function (_d) {
|
|
481
|
+
switch (_d.label) {
|
|
482
|
+
case 0:
|
|
483
|
+
_d.trys.push([0, 5, , 6]);
|
|
484
|
+
filePath = intent.filePath || (context === null || context === void 0 ? void 0 : context.filePath);
|
|
485
|
+
if (!filePath || !existsSync(filePath)) {
|
|
486
|
+
return [2 /*return*/, { success: false, confidence: 0 }];
|
|
487
|
+
}
|
|
488
|
+
originalCode = (context === null || context === void 0 ? void 0 : context.originalCode) || readFileSync(filePath, 'utf-8');
|
|
489
|
+
intentToInstruction = {
|
|
490
|
+
'var-to-const': 'Convert all var declarations to const',
|
|
491
|
+
'add-types': 'Add TypeScript type annotations',
|
|
492
|
+
'add-error-handling': 'Wrap in try/catch blocks',
|
|
493
|
+
'async-await': 'Convert to async/await',
|
|
494
|
+
'add-logging': 'Add console.log statements',
|
|
495
|
+
'remove-console': 'Remove all console.* statements'
|
|
496
|
+
};
|
|
497
|
+
instruction = intentToInstruction[intent.type];
|
|
498
|
+
language = intent.language || 'javascript';
|
|
499
|
+
return [4 /*yield*/, import('agentic-flow/agent-booster')["catch"](function () { return import(/* @vite-ignore */ 'agentic-flow/intelligence/agent-booster-enhanced'); })["catch"](function () { return null; })];
|
|
500
|
+
case 1:
|
|
501
|
+
boosterModule = _d.sent();
|
|
502
|
+
if (!(boosterModule === null || boosterModule === void 0 ? void 0 : boosterModule.enhancedApply)) return [3 /*break*/, 3];
|
|
503
|
+
return [4 /*yield*/, boosterModule.enhancedApply({
|
|
504
|
+
code: originalCode,
|
|
505
|
+
edit: instruction,
|
|
506
|
+
language: language
|
|
507
|
+
})];
|
|
508
|
+
case 2:
|
|
509
|
+
result_1 = _d.sent();
|
|
510
|
+
if (result_1 && result_1.confidence >= this.config.agentBoosterConfidenceThreshold) {
|
|
511
|
+
return [2 /*return*/, { success: true, confidence: result_1.confidence, output: result_1.output }];
|
|
512
|
+
}
|
|
513
|
+
return [2 /*return*/, { success: false, confidence: (_a = result_1 === null || result_1 === void 0 ? void 0 : result_1.confidence) !== null && _a !== void 0 ? _a : 0 }];
|
|
514
|
+
case 3:
|
|
515
|
+
SAFE_LANGUAGES = ['javascript', 'typescript', 'python', 'rust', 'go', 'java', 'c', 'cpp', 'ruby', 'swift', 'kotlin'];
|
|
516
|
+
safeLang = SAFE_LANGUAGES.includes(language) ? language : 'javascript';
|
|
517
|
+
return [4 /*yield*/, import('child_process')];
|
|
518
|
+
case 4:
|
|
519
|
+
execSync = (_d.sent()).execSync;
|
|
520
|
+
cmd = "npx --yes agent-booster@0.2.2 apply --language " + safeLang;
|
|
521
|
+
result = execSync(cmd, {
|
|
522
|
+
encoding: 'utf-8',
|
|
523
|
+
input: JSON.stringify({ code: originalCode, edit: instruction }),
|
|
524
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
525
|
+
timeout: 5000,
|
|
526
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
527
|
+
});
|
|
528
|
+
parsed = JSON.parse(result);
|
|
529
|
+
if (parsed.confidence >= this.config.agentBoosterConfidenceThreshold) {
|
|
530
|
+
return [2 /*return*/, { success: true, confidence: parsed.confidence, output: parsed.output }];
|
|
531
|
+
}
|
|
532
|
+
return [2 /*return*/, { success: false, confidence: (_b = parsed.confidence) !== null && _b !== void 0 ? _b : 0 }];
|
|
533
|
+
case 5:
|
|
534
|
+
_c = _d.sent();
|
|
535
|
+
// Agent Booster not available or failed
|
|
536
|
+
return [2 /*return*/, { success: false, confidence: 0 }];
|
|
537
|
+
case 6: return [2 /*return*/];
|
|
538
|
+
}
|
|
447
539
|
});
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
return {
|
|
451
|
-
success: true,
|
|
452
|
-
confidence: parsed.confidence,
|
|
453
|
-
output: parsed.output,
|
|
454
|
-
};
|
|
455
|
-
}
|
|
456
|
-
return { success: false, confidence: parsed.confidence || 0 };
|
|
457
|
-
}
|
|
458
|
-
catch {
|
|
459
|
-
// Agent Booster not available or failed
|
|
460
|
-
return { success: false, confidence: 0 };
|
|
461
|
-
}
|
|
462
|
-
}
|
|
540
|
+
});
|
|
541
|
+
};
|
|
463
542
|
/**
|
|
464
543
|
* Get router statistics
|
|
465
544
|
*/
|
|
466
|
-
getStats() {
|
|
545
|
+
EnhancedModelRouter.prototype.getStats = function () {
|
|
467
546
|
return {
|
|
468
|
-
config: {
|
|
469
|
-
tinyDancerStats: this.tinyDancerRouter.getStats()
|
|
547
|
+
config: __assign({}, this.config),
|
|
548
|
+
tinyDancerStats: this.tinyDancerRouter.getStats()
|
|
470
549
|
};
|
|
471
|
-
}
|
|
472
|
-
|
|
550
|
+
};
|
|
551
|
+
return EnhancedModelRouter;
|
|
552
|
+
}());
|
|
553
|
+
export { EnhancedModelRouter };
|
|
473
554
|
// ============================================================================
|
|
474
555
|
// Singleton & Factory Functions
|
|
475
556
|
// ============================================================================
|
|
476
|
-
|
|
557
|
+
var enhancedRouterInstance = null;
|
|
477
558
|
/**
|
|
478
559
|
* Get or create the singleton EnhancedModelRouter instance
|
|
479
560
|
*/
|
|
@@ -501,18 +582,23 @@ export function createEnhancedModelRouter(config) {
|
|
|
501
582
|
/**
|
|
502
583
|
* Quick route function with enhanced routing
|
|
503
584
|
*/
|
|
504
|
-
export
|
|
505
|
-
|
|
506
|
-
|
|
585
|
+
export function enhancedRouteToModel(task, context) {
|
|
586
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
587
|
+
var router;
|
|
588
|
+
return __generator(this, function (_a) {
|
|
589
|
+
router = getEnhancedModelRouter();
|
|
590
|
+
return [2 /*return*/, router.route(task, context)];
|
|
591
|
+
});
|
|
592
|
+
});
|
|
507
593
|
}
|
|
508
594
|
/**
|
|
509
595
|
* Detect if a task can be handled by Agent Booster
|
|
510
596
|
*/
|
|
511
597
|
export function canUseAgentBooster(task) {
|
|
512
|
-
|
|
513
|
-
|
|
598
|
+
var router = getEnhancedModelRouter();
|
|
599
|
+
var intent = router.detectIntent(task);
|
|
514
600
|
if (intent && intent.confidence >= 0.7) {
|
|
515
|
-
return { canUse: true, intent };
|
|
601
|
+
return { canUse: true, intent: intent };
|
|
516
602
|
}
|
|
517
603
|
return { canUse: false };
|
|
518
604
|
}
|