moflo 4.8.31 → 4.8.32
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/generate-code-map.mjs +1 -1
- package/bin/index-guidance.mjs +1 -1
- package/bin/index-tests.mjs +1 -1
- package/bin/setup-project.mjs +1 -1
- package/package.json +6 -7
- package/src/@claude-flow/cli/package.json +106 -106
- package/.claude/agents/browser/browser-agent.yaml +0 -182
- package/.claude/agents/database-specialist.yaml +0 -21
- package/.claude/agents/index.yaml +0 -17
- package/.claude/agents/project-coordinator.yaml +0 -15
- package/.claude/agents/python-specialist.yaml +0 -21
- package/.claude/agents/security-auditor.yaml +0 -20
- package/.claude/agents/typescript-specialist.yaml +0 -21
- package/.claude/checkpoints/1767754460.json +0 -8
- package/.claude/config/v3-dependency-optimization.json +0 -266
- package/.claude/config/v3-performance-targets.json +0 -251
- package/.claude/guidance/moflo-bootstrap.md +0 -129
- package/.claude/mcp.json +0 -13
- package/.claude/settings.json +0 -351
- package/.claude/settings.local.json +0 -18
- package/.claude/skills/agentdb-advanced/SKILL.md +0 -550
- package/.claude/skills/agentdb-learning/SKILL.md +0 -545
- package/.claude/skills/agentdb-memory-patterns/SKILL.md +0 -339
- package/.claude/skills/agentdb-optimization/SKILL.md +0 -509
- package/.claude/skills/agentdb-vector-search/SKILL.md +0 -339
- package/.claude/skills/browser/SKILL.md +0 -204
- package/.claude/skills/fl/SKILL.md +0 -583
- package/.claude/skills/flo/SKILL.md +0 -583
- package/.claude/skills/github-code-review/SKILL.md +0 -1140
- package/.claude/skills/github-multi-repo/SKILL.md +0 -874
- package/.claude/skills/github-project-management/SKILL.md +0 -1277
- package/.claude/skills/github-release-management/SKILL.md +0 -1081
- package/.claude/skills/github-workflow-automation/SKILL.md +0 -1065
- package/.claude/skills/hive-mind-advanced/SKILL.md +0 -712
- package/.claude/skills/hooks-automation/SKILL.md +0 -1201
- package/.claude/skills/pair-programming/SKILL.md +0 -1202
- package/.claude/skills/performance-analysis/SKILL.md +0 -563
- package/.claude/skills/reasoningbank-agentdb/SKILL.md +0 -446
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +0 -201
- package/.claude/skills/skill-builder/SKILL.md +0 -910
- package/.claude/skills/sparc-methodology/SKILL.md +0 -1115
- package/.claude/skills/stream-chain/SKILL.md +0 -563
- package/.claude/skills/swarm-advanced/SKILL.md +0 -973
- package/.claude/skills/swarm-orchestration/SKILL.md +0 -179
- package/.claude/skills/v3-cli-modernization/SKILL.md +0 -872
- package/.claude/skills/v3-core-implementation/SKILL.md +0 -797
- package/.claude/skills/v3-ddd-architecture/SKILL.md +0 -442
- package/.claude/skills/v3-integration-deep/SKILL.md +0 -241
- package/.claude/skills/v3-mcp-optimization/SKILL.md +0 -777
- package/.claude/skills/v3-memory-unification/SKILL.md +0 -174
- package/.claude/skills/v3-performance-optimization/SKILL.md +0 -390
- package/.claude/skills/v3-security-overhaul/SKILL.md +0 -82
- package/.claude/skills/v3-swarm-coordination/SKILL.md +0 -340
- package/.claude/skills/verification-quality/SKILL.md +0 -649
- package/.claude/skills/worker-benchmarks/skill.md +0 -135
- package/.claude/skills/worker-integration/skill.md +0 -154
- package/.claude/workflow-state.json +0 -9
- package/src/@claude-flow/cli/dist/src/appliance/gguf-engine.d.ts +0 -91
- package/src/@claude-flow/cli/dist/src/appliance/ruvllm-bridge.d.ts +0 -102
- package/src/@claude-flow/cli/dist/src/appliance/rvfa-builder.d.ts +0 -44
- package/src/@claude-flow/cli/dist/src/appliance/rvfa-distribution.d.ts +0 -97
- package/src/@claude-flow/cli/dist/src/appliance/rvfa-format.d.ts +0 -111
- package/src/@claude-flow/cli/dist/src/appliance/rvfa-runner.d.ts +0 -69
- package/src/@claude-flow/cli/dist/src/appliance/rvfa-signing.d.ts +0 -123
- package/src/@claude-flow/cli/dist/src/benchmarks/pretrain/index.d.ts +0 -58
- package/src/@claude-flow/cli/dist/src/commands/agent.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/analyze.d.ts +0 -19
- package/src/@claude-flow/cli/dist/src/commands/appliance-advanced.d.ts +0 -9
- package/src/@claude-flow/cli/dist/src/commands/appliance.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/benchmark.d.ts +0 -10
- package/src/@claude-flow/cli/dist/src/commands/claims.d.ts +0 -10
- package/src/@claude-flow/cli/dist/src/commands/completions.d.ts +0 -10
- package/src/@claude-flow/cli/dist/src/commands/config.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/daemon.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/deployment.d.ts +0 -10
- package/src/@claude-flow/cli/dist/src/commands/diagnose.d.ts +0 -16
- package/src/@claude-flow/cli/dist/src/commands/doctor.d.ts +0 -10
- package/src/@claude-flow/cli/dist/src/commands/embeddings.d.ts +0 -18
- package/src/@claude-flow/cli/dist/src/commands/gate.d.ts +0 -23
- package/src/@claude-flow/cli/dist/src/commands/github.d.ts +0 -12
- package/src/@claude-flow/cli/dist/src/commands/guidance.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/hive-mind.d.ts +0 -11
- package/src/@claude-flow/cli/dist/src/commands/hooks.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/index.d.ts +0 -115
- package/src/@claude-flow/cli/dist/src/commands/init.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/issues.d.ts +0 -21
- package/src/@claude-flow/cli/dist/src/commands/mcp.d.ts +0 -11
- package/src/@claude-flow/cli/dist/src/commands/memory.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/migrate.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/neural.d.ts +0 -10
- package/src/@claude-flow/cli/dist/src/commands/orc.d.ts +0 -21
- package/src/@claude-flow/cli/dist/src/commands/performance.d.ts +0 -10
- package/src/@claude-flow/cli/dist/src/commands/plugins.d.ts +0 -11
- package/src/@claude-flow/cli/dist/src/commands/process.d.ts +0 -10
- package/src/@claude-flow/cli/dist/src/commands/progress.d.ts +0 -11
- package/src/@claude-flow/cli/dist/src/commands/providers.d.ts +0 -10
- package/src/@claude-flow/cli/dist/src/commands/route.d.ts +0 -16
- package/src/@claude-flow/cli/dist/src/commands/ruvector/backup.d.ts +0 -11
- package/src/@claude-flow/cli/dist/src/commands/ruvector/benchmark.d.ts +0 -11
- package/src/@claude-flow/cli/dist/src/commands/ruvector/import.d.ts +0 -18
- package/src/@claude-flow/cli/dist/src/commands/ruvector/index.d.ts +0 -29
- package/src/@claude-flow/cli/dist/src/commands/ruvector/init.d.ts +0 -11
- package/src/@claude-flow/cli/dist/src/commands/ruvector/migrate.d.ts +0 -11
- package/src/@claude-flow/cli/dist/src/commands/ruvector/optimize.d.ts +0 -11
- package/src/@claude-flow/cli/dist/src/commands/ruvector/setup.d.ts +0 -18
- package/src/@claude-flow/cli/dist/src/commands/ruvector/status.d.ts +0 -11
- package/src/@claude-flow/cli/dist/src/commands/security.d.ts +0 -10
- package/src/@claude-flow/cli/dist/src/commands/session.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/start.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/status.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/swarm.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/task.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/transfer-store.d.ts +0 -13
- package/src/@claude-flow/cli/dist/src/commands/update.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/commands/workflow.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/config/moflo-config.d.ts +0 -93
- package/src/@claude-flow/cli/dist/src/config-adapter.d.ts +0 -15
- package/src/@claude-flow/cli/dist/src/index.d.ts +0 -81
- package/src/@claude-flow/cli/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
- package/src/@claude-flow/cli/dist/src/init/claudemd-generator.d.ts +0 -30
- package/src/@claude-flow/cli/dist/src/init/executor.d.ts +0 -41
- package/src/@claude-flow/cli/dist/src/init/helpers-generator.d.ts +0 -51
- package/src/@claude-flow/cli/dist/src/init/index.d.ts +0 -13
- package/src/@claude-flow/cli/dist/src/init/mcp-generator.d.ts +0 -29
- package/src/@claude-flow/cli/dist/src/init/moflo-init.d.ts +0 -31
- package/src/@claude-flow/cli/dist/src/init/settings-generator.d.ts +0 -14
- package/src/@claude-flow/cli/dist/src/init/statusline-generator.d.ts +0 -28
- package/src/@claude-flow/cli/dist/src/init/types.d.ts +0 -285
- package/src/@claude-flow/cli/dist/src/mcp-client.d.ts +0 -92
- package/src/@claude-flow/cli/dist/src/mcp-server.d.ts +0 -161
- package/src/@claude-flow/cli/dist/src/mcp-tools/agent-tools.d.ts +0 -9
- package/src/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.d.ts +0 -30
- package/src/@claude-flow/cli/dist/src/mcp-tools/analyze-tools.d.ts +0 -38
- package/src/@claude-flow/cli/dist/src/mcp-tools/auto-install.d.ts +0 -83
- package/src/@claude-flow/cli/dist/src/mcp-tools/browser-tools.d.ts +0 -13
- package/src/@claude-flow/cli/dist/src/mcp-tools/claims-tools.d.ts +0 -12
- package/src/@claude-flow/cli/dist/src/mcp-tools/config-tools.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.d.ts +0 -13
- package/src/@claude-flow/cli/dist/src/mcp-tools/daa-tools.d.ts +0 -13
- package/src/@claude-flow/cli/dist/src/mcp-tools/embeddings-tools.d.ts +0 -9
- package/src/@claude-flow/cli/dist/src/mcp-tools/github-tools.d.ts +0 -13
- package/src/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.d.ts +0 -44
- package/src/@claude-flow/cli/dist/src/mcp-tools/index.d.ts +0 -23
- package/src/@claude-flow/cli/dist/src/mcp-tools/memory-tools.d.ts +0 -14
- package/src/@claude-flow/cli/dist/src/mcp-tools/neural-tools.d.ts +0 -16
- package/src/@claude-flow/cli/dist/src/mcp-tools/performance-tools.d.ts +0 -16
- package/src/@claude-flow/cli/dist/src/mcp-tools/progress-tools.d.ts +0 -14
- package/src/@claude-flow/cli/dist/src/mcp-tools/security-tools.d.ts +0 -18
- package/src/@claude-flow/cli/dist/src/mcp-tools/session-tools.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/mcp-tools/swarm-tools.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/mcp-tools/system-tools.d.ts +0 -13
- package/src/@claude-flow/cli/dist/src/mcp-tools/task-tools.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/mcp-tools/terminal-tools.d.ts +0 -13
- package/src/@claude-flow/cli/dist/src/mcp-tools/transfer-tools.d.ts +0 -14
- package/src/@claude-flow/cli/dist/src/mcp-tools/types.d.ts +0 -31
- package/src/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.d.ts +0 -8
- package/src/@claude-flow/cli/dist/src/memory/ewc-consolidation.d.ts +0 -271
- package/src/@claude-flow/cli/dist/src/memory/intelligence.d.ts +0 -285
- package/src/@claude-flow/cli/dist/src/memory/memory-bridge.d.ts +0 -413
- package/src/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +0 -405
- package/src/@claude-flow/cli/dist/src/memory/sona-optimizer.d.ts +0 -227
- package/src/@claude-flow/cli/dist/src/output.d.ts +0 -133
- package/src/@claude-flow/cli/dist/src/parser.d.ts +0 -51
- package/src/@claude-flow/cli/dist/src/plugins/manager.d.ts +0 -133
- package/src/@claude-flow/cli/dist/src/plugins/store/discovery.d.ts +0 -88
- package/src/@claude-flow/cli/dist/src/plugins/store/index.d.ts +0 -76
- package/src/@claude-flow/cli/dist/src/plugins/store/search.d.ts +0 -46
- package/src/@claude-flow/cli/dist/src/plugins/store/types.d.ts +0 -274
- package/src/@claude-flow/cli/dist/src/plugins/tests/demo-plugin-store.d.ts +0 -7
- package/src/@claude-flow/cli/dist/src/plugins/tests/standalone-test.d.ts +0 -12
- package/src/@claude-flow/cli/dist/src/plugins/tests/test-plugin-store.d.ts +0 -7
- package/src/@claude-flow/cli/dist/src/production/circuit-breaker.d.ts +0 -101
- package/src/@claude-flow/cli/dist/src/production/error-handler.d.ts +0 -92
- package/src/@claude-flow/cli/dist/src/production/index.d.ts +0 -23
- package/src/@claude-flow/cli/dist/src/production/monitoring.d.ts +0 -161
- package/src/@claude-flow/cli/dist/src/production/rate-limiter.d.ts +0 -80
- package/src/@claude-flow/cli/dist/src/production/retry.d.ts +0 -48
- package/src/@claude-flow/cli/dist/src/prompt.d.ts +0 -44
- package/src/@claude-flow/cli/dist/src/runtime/headless.d.ts +0 -60
- package/src/@claude-flow/cli/dist/src/ruvector/ast-analyzer.d.ts +0 -67
- package/src/@claude-flow/cli/dist/src/ruvector/coverage-router.d.ts +0 -160
- package/src/@claude-flow/cli/dist/src/ruvector/coverage-tools.d.ts +0 -33
- package/src/@claude-flow/cli/dist/src/ruvector/diff-classifier.d.ts +0 -175
- package/src/@claude-flow/cli/dist/src/ruvector/enhanced-model-router.d.ts +0 -146
- package/src/@claude-flow/cli/dist/src/ruvector/flash-attention.d.ts +0 -195
- package/src/@claude-flow/cli/dist/src/ruvector/graph-analyzer.d.ts +0 -187
- package/src/@claude-flow/cli/dist/src/ruvector/index.d.ts +0 -34
- package/src/@claude-flow/cli/dist/src/ruvector/lora-adapter.d.ts +0 -218
- package/src/@claude-flow/cli/dist/src/ruvector/model-router.d.ts +0 -220
- package/src/@claude-flow/cli/dist/src/ruvector/moe-router.d.ts +0 -206
- package/src/@claude-flow/cli/dist/src/ruvector/q-learning-router.d.ts +0 -211
- package/src/@claude-flow/cli/dist/src/ruvector/semantic-router.d.ts +0 -77
- package/src/@claude-flow/cli/dist/src/ruvector/vector-db.d.ts +0 -69
- package/src/@claude-flow/cli/dist/src/services/agent-router.d.ts +0 -63
- package/src/@claude-flow/cli/dist/src/services/agentic-flow-bridge.d.ts +0 -50
- package/src/@claude-flow/cli/dist/src/services/claim-service.d.ts +0 -204
- package/src/@claude-flow/cli/dist/src/services/container-worker-pool.d.ts +0 -197
- package/src/@claude-flow/cli/dist/src/services/daemon-lock.d.ts +0 -60
- package/src/@claude-flow/cli/dist/src/services/headless-worker-executor.d.ts +0 -304
- package/src/@claude-flow/cli/dist/src/services/index.d.ts +0 -13
- package/src/@claude-flow/cli/dist/src/services/learning-service.d.ts +0 -161
- package/src/@claude-flow/cli/dist/src/services/moflo-require.d.ts +0 -34
- package/src/@claude-flow/cli/dist/src/services/registry-api.d.ts +0 -58
- package/src/@claude-flow/cli/dist/src/services/ruvector-training.d.ts +0 -214
- package/src/@claude-flow/cli/dist/src/services/worker-daemon.d.ts +0 -225
- package/src/@claude-flow/cli/dist/src/services/worker-queue.d.ts +0 -194
- package/src/@claude-flow/cli/dist/src/services/workflow-gate.d.ts +0 -88
- package/src/@claude-flow/cli/dist/src/suggest.d.ts +0 -53
- package/src/@claude-flow/cli/dist/src/transfer/anonymization/index.d.ts +0 -25
- package/src/@claude-flow/cli/dist/src/transfer/deploy-seraphine.d.ts +0 -13
- package/src/@claude-flow/cli/dist/src/transfer/export.d.ts +0 -25
- package/src/@claude-flow/cli/dist/src/transfer/index.d.ts +0 -12
- package/src/@claude-flow/cli/dist/src/transfer/ipfs/client.d.ts +0 -109
- package/src/@claude-flow/cli/dist/src/transfer/ipfs/upload.d.ts +0 -95
- package/src/@claude-flow/cli/dist/src/transfer/models/seraphine.d.ts +0 -72
- package/src/@claude-flow/cli/dist/src/transfer/serialization/cfp.d.ts +0 -49
- package/src/@claude-flow/cli/dist/src/transfer/storage/gcs.d.ts +0 -82
- package/src/@claude-flow/cli/dist/src/transfer/storage/index.d.ts +0 -6
- package/src/@claude-flow/cli/dist/src/transfer/store/discovery.d.ts +0 -84
- package/src/@claude-flow/cli/dist/src/transfer/store/download.d.ts +0 -70
- package/src/@claude-flow/cli/dist/src/transfer/store/index.d.ts +0 -84
- package/src/@claude-flow/cli/dist/src/transfer/store/publish.d.ts +0 -76
- package/src/@claude-flow/cli/dist/src/transfer/store/registry.d.ts +0 -58
- package/src/@claude-flow/cli/dist/src/transfer/store/search.d.ts +0 -54
- package/src/@claude-flow/cli/dist/src/transfer/store/tests/standalone-test.d.ts +0 -12
- package/src/@claude-flow/cli/dist/src/transfer/store/types.d.ts +0 -193
- package/src/@claude-flow/cli/dist/src/transfer/test-seraphine.d.ts +0 -6
- package/src/@claude-flow/cli/dist/src/transfer/tests/test-store.d.ts +0 -7
- package/src/@claude-flow/cli/dist/src/transfer/types.d.ts +0 -245
- package/src/@claude-flow/cli/dist/src/types.d.ts +0 -198
- package/src/@claude-flow/cli/dist/src/update/checker.d.ts +0 -34
- package/src/@claude-flow/cli/dist/src/update/executor.d.ts +0 -32
- package/src/@claude-flow/cli/dist/src/update/index.d.ts +0 -33
- package/src/@claude-flow/cli/dist/src/update/rate-limiter.d.ts +0 -20
- package/src/@claude-flow/cli/dist/src/update/validator.d.ts +0 -17
- package/src/@claude-flow/guidance/dist/adversarial.d.ts +0 -284
- package/src/@claude-flow/guidance/dist/analyzer.d.ts +0 -530
- package/src/@claude-flow/guidance/dist/artifacts.d.ts +0 -283
- package/src/@claude-flow/guidance/dist/authority.d.ts +0 -290
- package/src/@claude-flow/guidance/dist/capabilities.d.ts +0 -209
- package/src/@claude-flow/guidance/dist/coherence.d.ts +0 -233
- package/src/@claude-flow/guidance/dist/compiler.d.ts +0 -87
- package/src/@claude-flow/guidance/dist/conformance-kit.d.ts +0 -225
- package/src/@claude-flow/guidance/dist/continue-gate.d.ts +0 -214
- package/src/@claude-flow/guidance/dist/crypto-utils.d.ts +0 -17
- package/src/@claude-flow/guidance/dist/evolution.d.ts +0 -282
- package/src/@claude-flow/guidance/dist/gates.d.ts +0 -79
- package/src/@claude-flow/guidance/dist/gateway.d.ts +0 -206
- package/src/@claude-flow/guidance/dist/generators.d.ts +0 -153
- package/src/@claude-flow/guidance/dist/headless.d.ts +0 -177
- package/src/@claude-flow/guidance/dist/hooks.d.ts +0 -109
- package/src/@claude-flow/guidance/dist/index.d.ts +0 -205
- package/src/@claude-flow/guidance/dist/ledger.d.ts +0 -162
- package/src/@claude-flow/guidance/dist/manifest-validator.d.ts +0 -289
- package/src/@claude-flow/guidance/dist/memory-gate.d.ts +0 -222
- package/src/@claude-flow/guidance/dist/meta-governance.d.ts +0 -265
- package/src/@claude-flow/guidance/dist/optimizer.d.ts +0 -104
- package/src/@claude-flow/guidance/dist/persistence.d.ts +0 -189
- package/src/@claude-flow/guidance/dist/proof.d.ts +0 -185
- package/src/@claude-flow/guidance/dist/retriever.d.ts +0 -116
- package/src/@claude-flow/guidance/dist/ruvbot-integration.d.ts +0 -370
- package/src/@claude-flow/guidance/dist/temporal.d.ts +0 -426
- package/src/@claude-flow/guidance/dist/trust.d.ts +0 -283
- package/src/@claude-flow/guidance/dist/truth-anchors.d.ts +0 -276
- package/src/@claude-flow/guidance/dist/types.d.ts +0 -378
- package/src/@claude-flow/guidance/dist/uncertainty.d.ts +0 -372
- package/src/@claude-flow/guidance/dist/wasm-kernel.d.ts +0 -48
- package/src/@claude-flow/memory/dist/agent-memory-scope.d.ts +0 -131
- package/src/@claude-flow/memory/dist/agent-memory-scope.test.d.ts +0 -8
- package/src/@claude-flow/memory/dist/agentdb-adapter.d.ts +0 -165
- package/src/@claude-flow/memory/dist/agentdb-backend.d.ts +0 -212
- package/src/@claude-flow/memory/dist/agentdb-backend.test.d.ts +0 -7
- package/src/@claude-flow/memory/dist/application/commands/delete-memory.command.d.ts +0 -65
- package/src/@claude-flow/memory/dist/application/commands/store-memory.command.d.ts +0 -48
- package/src/@claude-flow/memory/dist/application/index.d.ts +0 -12
- package/src/@claude-flow/memory/dist/application/queries/search-memory.query.d.ts +0 -72
- package/src/@claude-flow/memory/dist/application/services/memory-application-service.d.ts +0 -121
- package/src/@claude-flow/memory/dist/auto-memory-bridge.d.ts +0 -226
- package/src/@claude-flow/memory/dist/auto-memory-bridge.test.d.ts +0 -8
- package/src/@claude-flow/memory/dist/benchmark.test.d.ts +0 -2
- package/src/@claude-flow/memory/dist/cache-manager.d.ts +0 -134
- package/src/@claude-flow/memory/dist/controller-registry.d.ts +0 -216
- package/src/@claude-flow/memory/dist/controller-registry.test.d.ts +0 -14
- package/src/@claude-flow/memory/dist/database-provider.d.ts +0 -87
- package/src/@claude-flow/memory/dist/database-provider.test.d.ts +0 -7
- package/src/@claude-flow/memory/dist/domain/entities/memory-entry.d.ts +0 -143
- package/src/@claude-flow/memory/dist/domain/index.d.ts +0 -11
- package/src/@claude-flow/memory/dist/domain/repositories/memory-repository.interface.d.ts +0 -102
- package/src/@claude-flow/memory/dist/domain/services/memory-domain-service.d.ts +0 -105
- package/src/@claude-flow/memory/dist/hnsw-index.d.ts +0 -111
- package/src/@claude-flow/memory/dist/hnsw-lite.d.ts +0 -23
- package/src/@claude-flow/memory/dist/hybrid-backend.d.ts +0 -245
- package/src/@claude-flow/memory/dist/hybrid-backend.test.d.ts +0 -8
- package/src/@claude-flow/memory/dist/index.d.ts +0 -204
- package/src/@claude-flow/memory/dist/infrastructure/index.d.ts +0 -17
- package/src/@claude-flow/memory/dist/infrastructure/repositories/hybrid-memory-repository.d.ts +0 -66
- package/src/@claude-flow/memory/dist/learning-bridge.d.ts +0 -137
- package/src/@claude-flow/memory/dist/learning-bridge.test.d.ts +0 -8
- package/src/@claude-flow/memory/dist/memory-graph.d.ts +0 -100
- package/src/@claude-flow/memory/dist/memory-graph.test.d.ts +0 -8
- package/src/@claude-flow/memory/dist/migration.d.ts +0 -68
- package/src/@claude-flow/memory/dist/persistent-sona.d.ts +0 -144
- package/src/@claude-flow/memory/dist/query-builder.d.ts +0 -211
- package/src/@claude-flow/memory/dist/rvf-backend.d.ts +0 -51
- package/src/@claude-flow/memory/dist/rvf-learning-store.d.ts +0 -139
- package/src/@claude-flow/memory/dist/rvf-migration.d.ts +0 -45
- package/src/@claude-flow/memory/dist/sqlite-backend.d.ts +0 -121
- package/src/@claude-flow/memory/dist/sqljs-backend.d.ts +0 -127
- package/src/@claude-flow/memory/dist/types.d.ts +0 -484
- package/src/@claude-flow/shared/dist/core/config/defaults.d.ts +0 -41
- package/src/@claude-flow/shared/dist/core/config/index.d.ts +0 -8
- package/src/@claude-flow/shared/dist/core/config/loader.d.ts +0 -45
- package/src/@claude-flow/shared/dist/core/config/schema.d.ts +0 -1134
- package/src/@claude-flow/shared/dist/core/config/validator.d.ts +0 -92
- package/src/@claude-flow/shared/dist/core/event-bus.d.ts +0 -31
- package/src/@claude-flow/shared/dist/core/index.d.ts +0 -15
- package/src/@claude-flow/shared/dist/core/interfaces/agent.interface.d.ts +0 -200
- package/src/@claude-flow/shared/dist/core/interfaces/coordinator.interface.d.ts +0 -310
- package/src/@claude-flow/shared/dist/core/interfaces/event.interface.d.ts +0 -224
- package/src/@claude-flow/shared/dist/core/interfaces/index.d.ts +0 -10
- package/src/@claude-flow/shared/dist/core/interfaces/memory.interface.d.ts +0 -298
- package/src/@claude-flow/shared/dist/core/interfaces/task.interface.d.ts +0 -185
- package/src/@claude-flow/shared/dist/core/orchestrator/event-coordinator.d.ts +0 -35
- package/src/@claude-flow/shared/dist/core/orchestrator/health-monitor.d.ts +0 -60
- package/src/@claude-flow/shared/dist/core/orchestrator/index.d.ts +0 -46
- package/src/@claude-flow/shared/dist/core/orchestrator/lifecycle-manager.d.ts +0 -56
- package/src/@claude-flow/shared/dist/core/orchestrator/session-manager.d.ts +0 -83
- package/src/@claude-flow/shared/dist/core/orchestrator/task-manager.d.ts +0 -49
- package/src/@claude-flow/shared/dist/events/domain-events.d.ts +0 -282
- package/src/@claude-flow/shared/dist/events/event-store.d.ts +0 -126
- package/src/@claude-flow/shared/dist/events/event-store.test.d.ts +0 -8
- package/src/@claude-flow/shared/dist/events/example-usage.d.ts +0 -10
- package/src/@claude-flow/shared/dist/events/index.d.ts +0 -21
- package/src/@claude-flow/shared/dist/events/projections.d.ts +0 -177
- package/src/@claude-flow/shared/dist/events/rvf-event-log.d.ts +0 -82
- package/src/@claude-flow/shared/dist/events/state-reconstructor.d.ts +0 -101
- package/src/@claude-flow/shared/dist/events.d.ts +0 -80
- package/src/@claude-flow/shared/dist/hooks/example-usage.d.ts +0 -42
- package/src/@claude-flow/shared/dist/hooks/executor.d.ts +0 -100
- package/src/@claude-flow/shared/dist/hooks/hooks.test.d.ts +0 -9
- package/src/@claude-flow/shared/dist/hooks/index.d.ts +0 -52
- package/src/@claude-flow/shared/dist/hooks/registry.d.ts +0 -133
- package/src/@claude-flow/shared/dist/hooks/safety/bash-safety.d.ts +0 -105
- package/src/@claude-flow/shared/dist/hooks/safety/file-organization.d.ts +0 -144
- package/src/@claude-flow/shared/dist/hooks/safety/git-commit.d.ts +0 -158
- package/src/@claude-flow/shared/dist/hooks/safety/index.d.ts +0 -17
- package/src/@claude-flow/shared/dist/hooks/session-hooks.d.ts +0 -234
- package/src/@claude-flow/shared/dist/hooks/task-hooks.d.ts +0 -163
- package/src/@claude-flow/shared/dist/hooks/types.d.ts +0 -267
- package/src/@claude-flow/shared/dist/hooks/verify-exports.test.d.ts +0 -9
- package/src/@claude-flow/shared/dist/index.d.ts +0 -20
- package/src/@claude-flow/shared/dist/mcp/connection-pool.d.ts +0 -98
- package/src/@claude-flow/shared/dist/mcp/index.d.ts +0 -69
- package/src/@claude-flow/shared/dist/mcp/server.d.ts +0 -166
- package/src/@claude-flow/shared/dist/mcp/session-manager.d.ts +0 -136
- package/src/@claude-flow/shared/dist/mcp/tool-registry.d.ts +0 -178
- package/src/@claude-flow/shared/dist/mcp/transport/http.d.ts +0 -104
- package/src/@claude-flow/shared/dist/mcp/transport/index.d.ts +0 -102
- package/src/@claude-flow/shared/dist/mcp/transport/stdio.d.ts +0 -104
- package/src/@claude-flow/shared/dist/mcp/transport/websocket.d.ts +0 -133
- package/src/@claude-flow/shared/dist/mcp/types.d.ts +0 -438
- package/src/@claude-flow/shared/dist/plugin-interface.d.ts +0 -544
- package/src/@claude-flow/shared/dist/plugin-loader.d.ts +0 -139
- package/src/@claude-flow/shared/dist/plugin-registry.d.ts +0 -183
- package/src/@claude-flow/shared/dist/plugins/index.d.ts +0 -10
- package/src/@claude-flow/shared/dist/plugins/official/hive-mind-plugin.d.ts +0 -106
- package/src/@claude-flow/shared/dist/plugins/official/index.d.ts +0 -10
- package/src/@claude-flow/shared/dist/plugins/official/maestro-plugin.d.ts +0 -121
- package/src/@claude-flow/shared/dist/plugins/types.d.ts +0 -93
- package/src/@claude-flow/shared/dist/resilience/bulkhead.d.ts +0 -105
- package/src/@claude-flow/shared/dist/resilience/circuit-breaker.d.ts +0 -132
- package/src/@claude-flow/shared/dist/resilience/index.d.ts +0 -19
- package/src/@claude-flow/shared/dist/resilience/rate-limiter.d.ts +0 -168
- package/src/@claude-flow/shared/dist/resilience/retry.d.ts +0 -91
- package/src/@claude-flow/shared/dist/security/index.d.ts +0 -10
- package/src/@claude-flow/shared/dist/security/input-validation.d.ts +0 -73
- package/src/@claude-flow/shared/dist/security/secure-random.d.ts +0 -92
- package/src/@claude-flow/shared/dist/services/index.d.ts +0 -7
- package/src/@claude-flow/shared/dist/services/v3-progress.service.d.ts +0 -124
- package/src/@claude-flow/shared/dist/types/agent.types.d.ts +0 -137
- package/src/@claude-flow/shared/dist/types/index.d.ts +0 -11
- package/src/@claude-flow/shared/dist/types/mcp.types.d.ts +0 -266
- package/src/@claude-flow/shared/dist/types/memory.types.d.ts +0 -236
- package/src/@claude-flow/shared/dist/types/swarm.types.d.ts +0 -186
- package/src/@claude-flow/shared/dist/types/task.types.d.ts +0 -178
- package/src/@claude-flow/shared/dist/types.d.ts +0 -197
- package/src/@claude-flow/shared/dist/utils/secure-logger.d.ts +0 -69
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LoRA (Low-Rank Adaptation) Implementation
|
|
3
|
-
*
|
|
4
|
-
* Enables efficient fine-tuning by decomposing weight updates into low-rank matrices.
|
|
5
|
-
* Dramatically reduces memory requirements while maintaining adaptation quality.
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - Rank decomposition (r << d) for memory efficiency
|
|
9
|
-
* - Additive weight updates: W' = W + BA (where B ∈ R^{d×r}, A ∈ R^{r×k})
|
|
10
|
-
* - Support for multiple adaptation heads
|
|
11
|
-
* - Persistence to .swarm/lora-weights.json
|
|
12
|
-
*
|
|
13
|
-
* Memory savings:
|
|
14
|
-
* - Original: d × k parameters
|
|
15
|
-
* - LoRA: r × (d + k) parameters
|
|
16
|
-
* - For d=384, k=384, r=8: 786,432 → 6,144 (128x reduction)
|
|
17
|
-
*
|
|
18
|
-
* @module lora-adapter
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Default LoRA rank (determines memory/quality tradeoff)
|
|
22
|
-
*/
|
|
23
|
-
export declare const DEFAULT_RANK = 8;
|
|
24
|
-
/**
|
|
25
|
-
* Input dimension (384 from ONNX MiniLM-L6-v2)
|
|
26
|
-
*/
|
|
27
|
-
export declare const INPUT_DIM = 384;
|
|
28
|
-
/**
|
|
29
|
-
* Default output dimension (same as input for adapter)
|
|
30
|
-
*/
|
|
31
|
-
export declare const OUTPUT_DIM = 384;
|
|
32
|
-
/**
|
|
33
|
-
* Default alpha scaling factor
|
|
34
|
-
*/
|
|
35
|
-
export declare const DEFAULT_ALPHA = 16;
|
|
36
|
-
/**
|
|
37
|
-
* LoRA configuration
|
|
38
|
-
*/
|
|
39
|
-
export interface LoRAConfig {
|
|
40
|
-
/** Rank of decomposition (lower = more compression) */
|
|
41
|
-
rank: number;
|
|
42
|
-
/** Alpha scaling factor for output */
|
|
43
|
-
alpha: number;
|
|
44
|
-
/** Input dimension */
|
|
45
|
-
inputDim: number;
|
|
46
|
-
/** Output dimension */
|
|
47
|
-
outputDim: number;
|
|
48
|
-
/** Learning rate for updates */
|
|
49
|
-
learningRate: number;
|
|
50
|
-
/** Path for weight persistence */
|
|
51
|
-
weightsPath: string;
|
|
52
|
-
/** Enable dropout for regularization */
|
|
53
|
-
enableDropout: boolean;
|
|
54
|
-
/** Dropout probability */
|
|
55
|
-
dropoutProb: number;
|
|
56
|
-
/** Auto-save interval in updates */
|
|
57
|
-
autoSaveInterval: number;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* LoRA adapter weights
|
|
61
|
-
*/
|
|
62
|
-
export interface LoRAWeights {
|
|
63
|
-
/** A matrix (rank × inputDim) - down projection */
|
|
64
|
-
A: Float32Array;
|
|
65
|
-
/** B matrix (outputDim × rank) - up projection */
|
|
66
|
-
B: Float32Array;
|
|
67
|
-
/** Scaling factor (alpha / rank) */
|
|
68
|
-
scaling: number;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Adaptation result
|
|
72
|
-
*/
|
|
73
|
-
export interface AdaptationResult {
|
|
74
|
-
/** Adapted embedding */
|
|
75
|
-
adapted: Float32Array;
|
|
76
|
-
/** Magnitude of adaptation */
|
|
77
|
-
adaptationNorm: number;
|
|
78
|
-
/** Time taken in ms */
|
|
79
|
-
timeMs: number;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* LoRA statistics
|
|
83
|
-
*/
|
|
84
|
-
export interface LoRAStats {
|
|
85
|
-
/** Total adaptations performed */
|
|
86
|
-
totalAdaptations: number;
|
|
87
|
-
/** Total training updates */
|
|
88
|
-
totalUpdates: number;
|
|
89
|
-
/** Current rank */
|
|
90
|
-
rank: number;
|
|
91
|
-
/** Memory savings ratio */
|
|
92
|
-
compressionRatio: number;
|
|
93
|
-
/** Average adaptation norm */
|
|
94
|
-
avgAdaptationNorm: number;
|
|
95
|
-
/** Last update timestamp */
|
|
96
|
-
lastUpdate: number | null;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Low-Rank Adaptation module for efficient embedding fine-tuning
|
|
100
|
-
*/
|
|
101
|
-
export declare class LoRAAdapter {
|
|
102
|
-
private config;
|
|
103
|
-
private weights;
|
|
104
|
-
private totalAdaptations;
|
|
105
|
-
private totalUpdates;
|
|
106
|
-
private adaptationNormSum;
|
|
107
|
-
private lastUpdate;
|
|
108
|
-
private updatesSinceLastSave;
|
|
109
|
-
constructor(config?: Partial<LoRAConfig>);
|
|
110
|
-
/**
|
|
111
|
-
* Initialize weights with Kaiming/He initialization
|
|
112
|
-
*/
|
|
113
|
-
private initializeWeights;
|
|
114
|
-
/**
|
|
115
|
-
* Box-Muller transform for Gaussian random numbers
|
|
116
|
-
*/
|
|
117
|
-
private gaussianRandom;
|
|
118
|
-
/**
|
|
119
|
-
* Initialize adapter and load persisted weights
|
|
120
|
-
*/
|
|
121
|
-
initialize(): Promise<{
|
|
122
|
-
success: boolean;
|
|
123
|
-
weightsLoaded: boolean;
|
|
124
|
-
}>;
|
|
125
|
-
/**
|
|
126
|
-
* Apply LoRA adaptation to an embedding
|
|
127
|
-
* output = input + scaling * (B @ A @ input)
|
|
128
|
-
*/
|
|
129
|
-
adapt(input: Float32Array): AdaptationResult;
|
|
130
|
-
/**
|
|
131
|
-
* Train the adapter with a gradient signal
|
|
132
|
-
* Uses simplified update: A += lr * hidden^T @ grad, B += lr * grad @ hidden^T
|
|
133
|
-
*/
|
|
134
|
-
train(input: Float32Array, gradOutput: Float32Array, reward?: number): {
|
|
135
|
-
updated: boolean;
|
|
136
|
-
loss: number;
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* Merge LoRA weights into base weights (for deployment)
|
|
140
|
-
* Returns: W' = W + scaling * B @ A
|
|
141
|
-
*/
|
|
142
|
-
merge(baseWeights: Float32Array): Float32Array;
|
|
143
|
-
/**
|
|
144
|
-
* Get current statistics
|
|
145
|
-
*/
|
|
146
|
-
getStats(): LoRAStats;
|
|
147
|
-
/**
|
|
148
|
-
* Reset adapter to initial state
|
|
149
|
-
*/
|
|
150
|
-
reset(): void;
|
|
151
|
-
/**
|
|
152
|
-
* Save weights to disk
|
|
153
|
-
*/
|
|
154
|
-
saveWeights(): boolean;
|
|
155
|
-
/**
|
|
156
|
-
* Load weights from disk
|
|
157
|
-
*/
|
|
158
|
-
loadWeights(): boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Export weights as JSON
|
|
161
|
-
*/
|
|
162
|
-
exportWeights(): {
|
|
163
|
-
A: number[];
|
|
164
|
-
B: number[];
|
|
165
|
-
scaling: number;
|
|
166
|
-
config: Partial<LoRAConfig>;
|
|
167
|
-
};
|
|
168
|
-
/**
|
|
169
|
-
* Import weights from JSON
|
|
170
|
-
*/
|
|
171
|
-
importWeights(data: {
|
|
172
|
-
A: number[];
|
|
173
|
-
B: number[];
|
|
174
|
-
scaling: number;
|
|
175
|
-
}): boolean;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Get or create singleton LoRA adapter instance
|
|
179
|
-
*/
|
|
180
|
-
export declare function getLoRAAdapter(): Promise<LoRAAdapter>;
|
|
181
|
-
/**
|
|
182
|
-
* Reset singleton instance (for testing)
|
|
183
|
-
*/
|
|
184
|
-
export declare function resetLoRAAdapter(): void;
|
|
185
|
-
/**
|
|
186
|
-
* Create new LoRA adapter instance (factory)
|
|
187
|
-
*/
|
|
188
|
-
export declare function createLoRAAdapter(config?: Partial<LoRAConfig>): LoRAAdapter;
|
|
189
|
-
/**
|
|
190
|
-
* Quick adaptation (convenience function)
|
|
191
|
-
*/
|
|
192
|
-
export declare function adaptEmbedding(input: Float32Array): Promise<AdaptationResult>;
|
|
193
|
-
/**
|
|
194
|
-
* Quick training (convenience function)
|
|
195
|
-
*/
|
|
196
|
-
export declare function trainLoRA(input: Float32Array, gradOutput: Float32Array, reward?: number): Promise<{
|
|
197
|
-
updated: boolean;
|
|
198
|
-
loss: number;
|
|
199
|
-
}>;
|
|
200
|
-
/**
|
|
201
|
-
* Get LoRA statistics (convenience function)
|
|
202
|
-
*/
|
|
203
|
-
export declare function getLoRAStats(): Promise<LoRAStats>;
|
|
204
|
-
declare const _default: {
|
|
205
|
-
LoRAAdapter: typeof LoRAAdapter;
|
|
206
|
-
getLoRAAdapter: typeof getLoRAAdapter;
|
|
207
|
-
resetLoRAAdapter: typeof resetLoRAAdapter;
|
|
208
|
-
createLoRAAdapter: typeof createLoRAAdapter;
|
|
209
|
-
adaptEmbedding: typeof adaptEmbedding;
|
|
210
|
-
trainLoRA: typeof trainLoRA;
|
|
211
|
-
getLoRAStats: typeof getLoRAStats;
|
|
212
|
-
DEFAULT_RANK: number;
|
|
213
|
-
DEFAULT_ALPHA: number;
|
|
214
|
-
INPUT_DIM: number;
|
|
215
|
-
OUTPUT_DIM: number;
|
|
216
|
-
};
|
|
217
|
-
export default _default;
|
|
218
|
-
//# sourceMappingURL=lora-adapter.d.ts.map
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Intelligent Model Router using Tiny Dancer
|
|
3
|
-
*
|
|
4
|
-
* Dynamically routes requests to optimal Claude model (haiku/sonnet/opus)
|
|
5
|
-
* based on task complexity, confidence scores, and historical performance.
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - FastGRNN-based routing decisions (<100μs)
|
|
9
|
-
* - Uncertainty quantification for model escalation
|
|
10
|
-
* - Circuit breaker for failover
|
|
11
|
-
* - Online learning from routing outcomes
|
|
12
|
-
* - Complexity scoring via embeddings
|
|
13
|
-
*
|
|
14
|
-
* Routing Strategy:
|
|
15
|
-
* - Haiku: High confidence, low complexity (fast, cheap)
|
|
16
|
-
* - Sonnet: Medium confidence, moderate complexity (balanced)
|
|
17
|
-
* - Opus: Low confidence, high complexity (most capable)
|
|
18
|
-
*
|
|
19
|
-
* @module model-router
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* Available Claude models for routing
|
|
23
|
-
*/
|
|
24
|
-
export type ClaudeModel = 'haiku' | 'sonnet' | 'opus' | 'inherit';
|
|
25
|
-
/**
|
|
26
|
-
* Model capabilities and characteristics
|
|
27
|
-
*/
|
|
28
|
-
export declare const MODEL_CAPABILITIES: Record<ClaudeModel, {
|
|
29
|
-
maxComplexity: number;
|
|
30
|
-
costMultiplier: number;
|
|
31
|
-
speedMultiplier: number;
|
|
32
|
-
description: string;
|
|
33
|
-
}>;
|
|
34
|
-
/**
|
|
35
|
-
* Complexity indicators for task classification
|
|
36
|
-
*/
|
|
37
|
-
export declare const COMPLEXITY_INDICATORS: {
|
|
38
|
-
high: string[];
|
|
39
|
-
medium: string[];
|
|
40
|
-
low: string[];
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Model router configuration
|
|
44
|
-
*/
|
|
45
|
-
export interface ModelRouterConfig {
|
|
46
|
-
/** Confidence threshold for model selection (default: 0.85) */
|
|
47
|
-
confidenceThreshold: number;
|
|
48
|
-
/** Maximum uncertainty before escalating (default: 0.15) */
|
|
49
|
-
maxUncertainty: number;
|
|
50
|
-
/** Enable circuit breaker (default: true) */
|
|
51
|
-
enableCircuitBreaker: boolean;
|
|
52
|
-
/** Failures before circuit opens (default: 5) */
|
|
53
|
-
circuitBreakerThreshold: number;
|
|
54
|
-
/** Path for router state persistence */
|
|
55
|
-
statePath: string;
|
|
56
|
-
/** Auto-save interval in decisions (default: 20) */
|
|
57
|
-
autoSaveInterval: number;
|
|
58
|
-
/** Enable cost optimization (default: true) */
|
|
59
|
-
enableCostOptimization: boolean;
|
|
60
|
-
/** Prefer faster models when confidence is high (default: true) */
|
|
61
|
-
preferSpeed: boolean;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Routing decision result
|
|
65
|
-
*/
|
|
66
|
-
export interface ModelRoutingResult {
|
|
67
|
-
/** Selected model */
|
|
68
|
-
model: ClaudeModel;
|
|
69
|
-
/** Confidence in the decision (0-1) */
|
|
70
|
-
confidence: number;
|
|
71
|
-
/** Uncertainty estimate (0-1) */
|
|
72
|
-
uncertainty: number;
|
|
73
|
-
/** Computed complexity score (0-1) */
|
|
74
|
-
complexity: number;
|
|
75
|
-
/** Reasoning for the selection */
|
|
76
|
-
reasoning: string;
|
|
77
|
-
/** Alternative models considered */
|
|
78
|
-
alternatives: Array<{
|
|
79
|
-
model: ClaudeModel;
|
|
80
|
-
score: number;
|
|
81
|
-
}>;
|
|
82
|
-
/** Inference time in microseconds */
|
|
83
|
-
inferenceTimeUs: number;
|
|
84
|
-
/** Estimated cost multiplier */
|
|
85
|
-
costMultiplier: number;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Complexity analysis result
|
|
89
|
-
*/
|
|
90
|
-
export interface ComplexityAnalysis {
|
|
91
|
-
/** Overall complexity score (0-1) */
|
|
92
|
-
score: number;
|
|
93
|
-
/** Indicators found */
|
|
94
|
-
indicators: {
|
|
95
|
-
high: string[];
|
|
96
|
-
medium: string[];
|
|
97
|
-
low: string[];
|
|
98
|
-
};
|
|
99
|
-
/** Feature breakdown */
|
|
100
|
-
features: {
|
|
101
|
-
lexicalComplexity: number;
|
|
102
|
-
semanticDepth: number;
|
|
103
|
-
taskScope: number;
|
|
104
|
-
uncertaintyLevel: number;
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Intelligent Model Router using complexity-based routing
|
|
109
|
-
*/
|
|
110
|
-
export declare class ModelRouter {
|
|
111
|
-
private config;
|
|
112
|
-
private state;
|
|
113
|
-
private decisionCount;
|
|
114
|
-
private consecutiveFailures;
|
|
115
|
-
constructor(config?: Partial<ModelRouterConfig>);
|
|
116
|
-
/**
|
|
117
|
-
* Route a task to the optimal model
|
|
118
|
-
*/
|
|
119
|
-
route(task: string, embedding?: number[]): Promise<ModelRoutingResult>;
|
|
120
|
-
/**
|
|
121
|
-
* Analyze task complexity
|
|
122
|
-
*/
|
|
123
|
-
analyzeComplexity(task: string, embedding?: number[]): ComplexityAnalysis;
|
|
124
|
-
/**
|
|
125
|
-
* Compute lexical complexity from text features
|
|
126
|
-
*/
|
|
127
|
-
private computeLexicalComplexity;
|
|
128
|
-
/**
|
|
129
|
-
* Compute semantic depth from indicators and embedding
|
|
130
|
-
*/
|
|
131
|
-
private computeSemanticDepth;
|
|
132
|
-
/**
|
|
133
|
-
* Compute task scope from content analysis
|
|
134
|
-
*/
|
|
135
|
-
private computeTaskScope;
|
|
136
|
-
/**
|
|
137
|
-
* Compute uncertainty level from task phrasing
|
|
138
|
-
*/
|
|
139
|
-
private computeUncertaintyLevel;
|
|
140
|
-
/**
|
|
141
|
-
* Compute scores for each model
|
|
142
|
-
*/
|
|
143
|
-
private computeModelScores;
|
|
144
|
-
/**
|
|
145
|
-
* Apply circuit breaker adjustments
|
|
146
|
-
*/
|
|
147
|
-
private applyCircuitBreaker;
|
|
148
|
-
/**
|
|
149
|
-
* Select the best model from scores
|
|
150
|
-
*/
|
|
151
|
-
private selectModel;
|
|
152
|
-
/**
|
|
153
|
-
* Build human-readable reasoning
|
|
154
|
-
*/
|
|
155
|
-
private buildReasoning;
|
|
156
|
-
/**
|
|
157
|
-
* Track routing decision for learning
|
|
158
|
-
*/
|
|
159
|
-
private trackDecision;
|
|
160
|
-
/**
|
|
161
|
-
* Record outcome for learning
|
|
162
|
-
*/
|
|
163
|
-
recordOutcome(task: string, model: ClaudeModel, outcome: 'success' | 'failure' | 'escalated'): void;
|
|
164
|
-
/**
|
|
165
|
-
* Get router statistics
|
|
166
|
-
*/
|
|
167
|
-
getStats(): {
|
|
168
|
-
totalDecisions: number;
|
|
169
|
-
modelDistribution: Record<ClaudeModel, number>;
|
|
170
|
-
avgComplexity: number;
|
|
171
|
-
avgConfidence: number;
|
|
172
|
-
circuitBreakerTrips: number;
|
|
173
|
-
consecutiveFailures: Record<ClaudeModel, number>;
|
|
174
|
-
};
|
|
175
|
-
/**
|
|
176
|
-
* Load state from disk
|
|
177
|
-
*/
|
|
178
|
-
private loadState;
|
|
179
|
-
/**
|
|
180
|
-
* Save state to disk
|
|
181
|
-
*/
|
|
182
|
-
private saveState;
|
|
183
|
-
/**
|
|
184
|
-
* Reset router state
|
|
185
|
-
*/
|
|
186
|
-
reset(): void;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Get or create the singleton ModelRouter instance
|
|
190
|
-
*/
|
|
191
|
-
export declare function getModelRouter(config?: Partial<ModelRouterConfig>): ModelRouter;
|
|
192
|
-
/**
|
|
193
|
-
* Reset the singleton instance
|
|
194
|
-
*/
|
|
195
|
-
export declare function resetModelRouter(): void;
|
|
196
|
-
/**
|
|
197
|
-
* Create a new ModelRouter instance (non-singleton)
|
|
198
|
-
*/
|
|
199
|
-
export declare function createModelRouter(config?: Partial<ModelRouterConfig>): ModelRouter;
|
|
200
|
-
/**
|
|
201
|
-
* Quick route function for common use case
|
|
202
|
-
*/
|
|
203
|
-
export declare function routeToModel(task: string): Promise<ClaudeModel>;
|
|
204
|
-
/**
|
|
205
|
-
* Route with full result
|
|
206
|
-
*/
|
|
207
|
-
export declare function routeToModelFull(task: string, embedding?: number[]): Promise<ModelRoutingResult>;
|
|
208
|
-
/**
|
|
209
|
-
* Analyze task complexity without routing
|
|
210
|
-
*/
|
|
211
|
-
export declare function analyzeTaskComplexity(task: string): ComplexityAnalysis;
|
|
212
|
-
/**
|
|
213
|
-
* Get model router statistics
|
|
214
|
-
*/
|
|
215
|
-
export declare function getModelRouterStats(): ReturnType<ModelRouter['getStats']>;
|
|
216
|
-
/**
|
|
217
|
-
* Record routing outcome for learning
|
|
218
|
-
*/
|
|
219
|
-
export declare function recordModelOutcome(task: string, model: ClaudeModel, outcome: 'success' | 'failure' | 'escalated'): void;
|
|
220
|
-
//# sourceMappingURL=model-router.d.ts.map
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mixture of Experts (MoE) Router for Dynamic Agent Routing
|
|
3
|
-
*
|
|
4
|
-
* Features:
|
|
5
|
-
* - 8 expert slots for specialized agent types
|
|
6
|
-
* - Gating network for soft expert selection (top-k)
|
|
7
|
-
* - Online weight updates via reward signals
|
|
8
|
-
* - Load balancing with auxiliary loss
|
|
9
|
-
* - Weight persistence to .swarm/moe-weights.json
|
|
10
|
-
*
|
|
11
|
-
* Architecture:
|
|
12
|
-
* - Input: 384-dim task embedding (from ONNX)
|
|
13
|
-
* - Hidden: 128-dim layer with ReLU
|
|
14
|
-
* - Output: 8-dim softmax weights
|
|
15
|
-
*
|
|
16
|
-
* @module moe-router
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* Expert type definitions (8 experts)
|
|
20
|
-
*/
|
|
21
|
-
export type ExpertType = 'coder' | 'tester' | 'reviewer' | 'architect' | 'security' | 'performance' | 'researcher' | 'coordinator';
|
|
22
|
-
/**
|
|
23
|
-
* Expert names in order (index corresponds to expert slot)
|
|
24
|
-
*/
|
|
25
|
-
export declare const EXPERT_NAMES: ExpertType[];
|
|
26
|
-
/**
|
|
27
|
-
* Number of experts (fixed at 8)
|
|
28
|
-
*/
|
|
29
|
-
export declare const NUM_EXPERTS = 8;
|
|
30
|
-
/**
|
|
31
|
-
* Input dimension (384 from ONNX MiniLM-L6-v2)
|
|
32
|
-
*/
|
|
33
|
-
export declare const INPUT_DIM = 384;
|
|
34
|
-
/**
|
|
35
|
-
* Hidden layer dimension
|
|
36
|
-
*/
|
|
37
|
-
export declare const HIDDEN_DIM = 128;
|
|
38
|
-
/**
|
|
39
|
-
* MoE Router configuration
|
|
40
|
-
*/
|
|
41
|
-
export interface MoERouterConfig {
|
|
42
|
-
/** Top-k experts to route to (default: 2) */
|
|
43
|
-
topK: number;
|
|
44
|
-
/** Learning rate for online updates (default: 0.01) */
|
|
45
|
-
learningRate: number;
|
|
46
|
-
/** Temperature for softmax (default: 1.0) */
|
|
47
|
-
temperature: number;
|
|
48
|
-
/** Load balancing coefficient (default: 0.01) */
|
|
49
|
-
loadBalanceCoef: number;
|
|
50
|
-
/** Path for weight persistence (default: '.swarm/moe-weights.json') */
|
|
51
|
-
weightsPath: string;
|
|
52
|
-
/** Auto-save interval in updates (default: 50) */
|
|
53
|
-
autoSaveInterval: number;
|
|
54
|
-
/** Enable noise for exploration (default: true) */
|
|
55
|
-
enableNoise: boolean;
|
|
56
|
-
/** Noise standard deviation (default: 0.1) */
|
|
57
|
-
noiseStd: number;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Expert routing result
|
|
61
|
-
*/
|
|
62
|
-
export interface RoutingResult {
|
|
63
|
-
/** Selected experts with weights */
|
|
64
|
-
experts: Array<{
|
|
65
|
-
name: ExpertType;
|
|
66
|
-
index: number;
|
|
67
|
-
weight: number;
|
|
68
|
-
score: number;
|
|
69
|
-
}>;
|
|
70
|
-
/** Raw gating scores (all experts) */
|
|
71
|
-
allScores: number[];
|
|
72
|
-
/** Load balance loss */
|
|
73
|
-
loadBalanceLoss: number;
|
|
74
|
-
/** Entropy of routing distribution */
|
|
75
|
-
entropy: number;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Expert utilization statistics
|
|
79
|
-
*/
|
|
80
|
-
export interface LoadBalanceStats {
|
|
81
|
-
/** Per-expert utilization (0-1) */
|
|
82
|
-
utilization: Record<ExpertType, number>;
|
|
83
|
-
/** Total routing count */
|
|
84
|
-
totalRoutings: number;
|
|
85
|
-
/** Per-expert routing count */
|
|
86
|
-
routingCounts: Record<ExpertType, number>;
|
|
87
|
-
/** Gini coefficient of load (0 = perfect balance, 1 = all to one) */
|
|
88
|
-
giniCoefficient: number;
|
|
89
|
-
/** Coefficient of variation */
|
|
90
|
-
coefficientOfVariation: number;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Mixture of Experts Router
|
|
94
|
-
*
|
|
95
|
-
* Implements a two-layer gating network:
|
|
96
|
-
* - Layer 1: Linear(384, 128) + ReLU
|
|
97
|
-
* - Layer 2: Linear(128, 8) + Softmax
|
|
98
|
-
*
|
|
99
|
-
* Uses top-k expert selection with load balancing.
|
|
100
|
-
*/
|
|
101
|
-
export declare class MoERouter {
|
|
102
|
-
private config;
|
|
103
|
-
private W1;
|
|
104
|
-
private b1;
|
|
105
|
-
private W2;
|
|
106
|
-
private b2;
|
|
107
|
-
private hidden;
|
|
108
|
-
private hiddenWithBias;
|
|
109
|
-
private hiddenActivated;
|
|
110
|
-
private logits;
|
|
111
|
-
private logitsWithBias;
|
|
112
|
-
private noisyLogits;
|
|
113
|
-
private probs;
|
|
114
|
-
private gradW2;
|
|
115
|
-
private gradb2;
|
|
116
|
-
private gradW1;
|
|
117
|
-
private gradb1;
|
|
118
|
-
private gradHidden;
|
|
119
|
-
private routingCounts;
|
|
120
|
-
private totalRoutings;
|
|
121
|
-
private updateCount;
|
|
122
|
-
private avgReward;
|
|
123
|
-
private lastInput;
|
|
124
|
-
private lastHiddenActivated;
|
|
125
|
-
private lastProbs;
|
|
126
|
-
private lastSelectedExperts;
|
|
127
|
-
constructor(config?: Partial<MoERouterConfig>);
|
|
128
|
-
/**
|
|
129
|
-
* Initialize router, loading persisted weights if available
|
|
130
|
-
*/
|
|
131
|
-
initialize(): Promise<void>;
|
|
132
|
-
/**
|
|
133
|
-
* Route task to top-k experts based on embedding
|
|
134
|
-
*
|
|
135
|
-
* @param taskEmbedding - 384-dim task embedding from ONNX
|
|
136
|
-
* @returns Routing result with selected experts and weights
|
|
137
|
-
*/
|
|
138
|
-
route(taskEmbedding: Float32Array | number[]): RoutingResult;
|
|
139
|
-
/**
|
|
140
|
-
* Update expert weights based on reward signal
|
|
141
|
-
*
|
|
142
|
-
* Uses REINFORCE-style gradient update:
|
|
143
|
-
* gradient = reward * d_log_prob / d_weights
|
|
144
|
-
*
|
|
145
|
-
* @param expert - Expert that received the reward
|
|
146
|
-
* @param reward - Reward signal (-1 to 1, positive = good)
|
|
147
|
-
*/
|
|
148
|
-
updateExpertWeights(expert: ExpertType | number, reward: number): void;
|
|
149
|
-
/**
|
|
150
|
-
* Get load balance statistics across all experts
|
|
151
|
-
*/
|
|
152
|
-
getLoadBalance(): LoadBalanceStats;
|
|
153
|
-
/**
|
|
154
|
-
* Get router statistics
|
|
155
|
-
*/
|
|
156
|
-
getStats(): Record<string, number | string>;
|
|
157
|
-
/**
|
|
158
|
-
* Reset all statistics and routing counts
|
|
159
|
-
*/
|
|
160
|
-
resetStats(): void;
|
|
161
|
-
/**
|
|
162
|
-
* Load weights from persistence file
|
|
163
|
-
*/
|
|
164
|
-
loadWeights(path?: string): Promise<boolean>;
|
|
165
|
-
/**
|
|
166
|
-
* Save weights to persistence file
|
|
167
|
-
*/
|
|
168
|
-
saveWeights(path?: string): Promise<boolean>;
|
|
169
|
-
/**
|
|
170
|
-
* Reset weights to random initialization
|
|
171
|
-
*/
|
|
172
|
-
resetWeights(): void;
|
|
173
|
-
/**
|
|
174
|
-
* Select top-k indices from probabilities
|
|
175
|
-
*/
|
|
176
|
-
private selectTopK;
|
|
177
|
-
/**
|
|
178
|
-
* Compute load balance loss for regularization
|
|
179
|
-
*
|
|
180
|
-
* Uses auxiliary loss from Switch Transformer:
|
|
181
|
-
* L_balance = N * sum(f_i * P_i)
|
|
182
|
-
* where f_i = fraction of tokens routed to expert i
|
|
183
|
-
* P_i = average routing probability to expert i
|
|
184
|
-
*/
|
|
185
|
-
private computeLoadBalanceLoss;
|
|
186
|
-
/**
|
|
187
|
-
* Compute Gini coefficient for load distribution
|
|
188
|
-
*/
|
|
189
|
-
private computeGiniCoefficient;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Get singleton MoE router instance
|
|
193
|
-
*
|
|
194
|
-
* @param config - Optional configuration (only used on first call)
|
|
195
|
-
* @returns MoE router instance
|
|
196
|
-
*/
|
|
197
|
-
export declare function getMoERouter(config?: Partial<MoERouterConfig>): MoERouter;
|
|
198
|
-
/**
|
|
199
|
-
* Reset singleton instance (for testing)
|
|
200
|
-
*/
|
|
201
|
-
export declare function resetMoERouter(): void;
|
|
202
|
-
/**
|
|
203
|
-
* Factory function to create new router
|
|
204
|
-
*/
|
|
205
|
-
export declare function createMoERouter(config?: Partial<MoERouterConfig>): MoERouter;
|
|
206
|
-
//# sourceMappingURL=moe-router.d.ts.map
|