@miller-tech/uap 1.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/LICENSE +21 -0
- package/README.md +888 -0
- package/dist/analyzers/index.d.ts +3 -0
- package/dist/analyzers/index.d.ts.map +1 -0
- package/dist/analyzers/index.js +684 -0
- package/dist/analyzers/index.js.map +1 -0
- package/dist/benchmarks/agents/naive-agent.d.ts +60 -0
- package/dist/benchmarks/agents/naive-agent.d.ts.map +1 -0
- package/dist/benchmarks/agents/naive-agent.js +144 -0
- package/dist/benchmarks/agents/naive-agent.js.map +1 -0
- package/dist/benchmarks/agents/uap-agent.d.ts +167 -0
- package/dist/benchmarks/agents/uap-agent.d.ts.map +1 -0
- package/dist/benchmarks/agents/uap-agent.js +437 -0
- package/dist/benchmarks/agents/uap-agent.js.map +1 -0
- package/dist/benchmarks/benchmark.d.ts +328 -0
- package/dist/benchmarks/benchmark.d.ts.map +1 -0
- package/dist/benchmarks/benchmark.js +112 -0
- package/dist/benchmarks/benchmark.js.map +1 -0
- package/dist/benchmarks/execution-verifier.d.ts +41 -0
- package/dist/benchmarks/execution-verifier.d.ts.map +1 -0
- package/dist/benchmarks/execution-verifier.js +340 -0
- package/dist/benchmarks/execution-verifier.js.map +1 -0
- package/dist/benchmarks/hierarchical-prompting.d.ts +37 -0
- package/dist/benchmarks/hierarchical-prompting.d.ts.map +1 -0
- package/dist/benchmarks/hierarchical-prompting.js +246 -0
- package/dist/benchmarks/hierarchical-prompting.js.map +1 -0
- package/dist/benchmarks/improved-benchmark.d.ts +89 -0
- package/dist/benchmarks/improved-benchmark.d.ts.map +1 -0
- package/dist/benchmarks/improved-benchmark.js +585 -0
- package/dist/benchmarks/improved-benchmark.js.map +1 -0
- package/dist/benchmarks/index.d.ts +11 -0
- package/dist/benchmarks/index.d.ts.map +1 -0
- package/dist/benchmarks/index.js +11 -0
- package/dist/benchmarks/index.js.map +1 -0
- package/dist/benchmarks/model-integration.d.ts +111 -0
- package/dist/benchmarks/model-integration.d.ts.map +1 -0
- package/dist/benchmarks/model-integration.js +904 -0
- package/dist/benchmarks/model-integration.js.map +1 -0
- package/dist/benchmarks/multi-turn-agent.d.ts +44 -0
- package/dist/benchmarks/multi-turn-agent.d.ts.map +1 -0
- package/dist/benchmarks/multi-turn-agent.js +254 -0
- package/dist/benchmarks/multi-turn-agent.js.map +1 -0
- package/dist/benchmarks/multi-turn-loop.d.ts +57 -0
- package/dist/benchmarks/multi-turn-loop.d.ts.map +1 -0
- package/dist/benchmarks/multi-turn-loop.js +167 -0
- package/dist/benchmarks/multi-turn-loop.js.map +1 -0
- package/dist/benchmarks/tasks.d.ts +19 -0
- package/dist/benchmarks/tasks.d.ts.map +1 -0
- package/dist/benchmarks/tasks.js +435 -0
- package/dist/benchmarks/tasks.js.map +1 -0
- package/dist/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +546 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/bin/llama-server-optimize.d.ts +18 -0
- package/dist/bin/llama-server-optimize.d.ts.map +1 -0
- package/dist/bin/llama-server-optimize.js +708 -0
- package/dist/bin/llama-server-optimize.js.map +1 -0
- package/dist/bin/policy.d.ts +3 -0
- package/dist/bin/policy.d.ts.map +1 -0
- package/dist/bin/policy.js +143 -0
- package/dist/bin/policy.js.map +1 -0
- package/dist/bin/tool-calls.d.ts +3 -0
- package/dist/bin/tool-calls.d.ts.map +1 -0
- package/dist/bin/tool-calls.js +4 -0
- package/dist/bin/tool-calls.js.map +1 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/web-browser.d.ts +30 -0
- package/dist/browser/web-browser.d.ts.map +1 -0
- package/dist/browser/web-browser.js +93 -0
- package/dist/browser/web-browser.js.map +1 -0
- package/dist/cli/agent.d.ts +20 -0
- package/dist/cli/agent.d.ts.map +1 -0
- package/dist/cli/agent.js +474 -0
- package/dist/cli/agent.js.map +1 -0
- package/dist/cli/analyze.d.ts +7 -0
- package/dist/cli/analyze.d.ts.map +1 -0
- package/dist/cli/analyze.js +103 -0
- package/dist/cli/analyze.js.map +1 -0
- package/dist/cli/completion-gates.d.ts +51 -0
- package/dist/cli/completion-gates.d.ts.map +1 -0
- package/dist/cli/completion-gates.js +201 -0
- package/dist/cli/completion-gates.js.map +1 -0
- package/dist/cli/compliance.d.ts +8 -0
- package/dist/cli/compliance.d.ts.map +1 -0
- package/dist/cli/compliance.js +509 -0
- package/dist/cli/compliance.js.map +1 -0
- package/dist/cli/coord.d.ts +7 -0
- package/dist/cli/coord.d.ts.map +1 -0
- package/dist/cli/coord.js +138 -0
- package/dist/cli/coord.js.map +1 -0
- package/dist/cli/dashboard.d.ts +21 -0
- package/dist/cli/dashboard.d.ts.map +1 -0
- package/dist/cli/dashboard.js +1508 -0
- package/dist/cli/dashboard.js.map +1 -0
- package/dist/cli/deploy.d.ts +19 -0
- package/dist/cli/deploy.d.ts.map +1 -0
- package/dist/cli/deploy.js +387 -0
- package/dist/cli/deploy.js.map +1 -0
- package/dist/cli/droids.d.ts +9 -0
- package/dist/cli/droids.d.ts.map +1 -0
- package/dist/cli/droids.js +227 -0
- package/dist/cli/droids.js.map +1 -0
- package/dist/cli/generate.d.ts +17 -0
- package/dist/cli/generate.d.ts.map +1 -0
- package/dist/cli/generate.js +432 -0
- package/dist/cli/generate.js.map +1 -0
- package/dist/cli/hooks.d.ts +9 -0
- package/dist/cli/hooks.d.ts.map +1 -0
- package/dist/cli/hooks.js +464 -0
- package/dist/cli/hooks.js.map +1 -0
- package/dist/cli/init.d.ts +12 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +364 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/mcp-router.d.ts +16 -0
- package/dist/cli/mcp-router.d.ts.map +1 -0
- package/dist/cli/mcp-router.js +143 -0
- package/dist/cli/mcp-router.js.map +1 -0
- package/dist/cli/memory.d.ts +24 -0
- package/dist/cli/memory.d.ts.map +1 -0
- package/dist/cli/memory.js +885 -0
- package/dist/cli/memory.js.map +1 -0
- package/dist/cli/model.d.ts +15 -0
- package/dist/cli/model.d.ts.map +1 -0
- package/dist/cli/model.js +290 -0
- package/dist/cli/model.js.map +1 -0
- package/dist/cli/patterns.d.ts +26 -0
- package/dist/cli/patterns.d.ts.map +1 -0
- package/dist/cli/patterns.js +862 -0
- package/dist/cli/patterns.js.map +1 -0
- package/dist/cli/rtk-validation.d.ts +9 -0
- package/dist/cli/rtk-validation.d.ts.map +1 -0
- package/dist/cli/rtk-validation.js +9 -0
- package/dist/cli/rtk-validation.js.map +1 -0
- package/dist/cli/rtk.d.ts +34 -0
- package/dist/cli/rtk.d.ts.map +1 -0
- package/dist/cli/rtk.js +401 -0
- package/dist/cli/rtk.js.map +1 -0
- package/dist/cli/schema-diff.d.ts +7 -0
- package/dist/cli/schema-diff.d.ts.map +1 -0
- package/dist/cli/schema-diff.js +11 -0
- package/dist/cli/schema-diff.js.map +1 -0
- package/dist/cli/setup-mcp-router.d.ts +8 -0
- package/dist/cli/setup-mcp-router.d.ts.map +1 -0
- package/dist/cli/setup-mcp-router.js +163 -0
- package/dist/cli/setup-mcp-router.js.map +1 -0
- package/dist/cli/setup-wizard.d.ts +2 -0
- package/dist/cli/setup-wizard.d.ts.map +1 -0
- package/dist/cli/setup-wizard.js +806 -0
- package/dist/cli/setup-wizard.js.map +1 -0
- package/dist/cli/setup.d.ts +15 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +154 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/sync.d.ts +8 -0
- package/dist/cli/sync.d.ts.map +1 -0
- package/dist/cli/sync.js +395 -0
- package/dist/cli/sync.js.map +1 -0
- package/dist/cli/task.d.ts +33 -0
- package/dist/cli/task.d.ts.map +1 -0
- package/dist/cli/task.js +672 -0
- package/dist/cli/task.js.map +1 -0
- package/dist/cli/tool-calls.d.ts +20 -0
- package/dist/cli/tool-calls.d.ts.map +1 -0
- package/dist/cli/tool-calls.js +605 -0
- package/dist/cli/tool-calls.js.map +1 -0
- package/dist/cli/uap.d.ts +10 -0
- package/dist/cli/uap.d.ts.map +1 -0
- package/dist/cli/uap.js +398 -0
- package/dist/cli/uap.js.map +1 -0
- package/dist/cli/update.d.ts +10 -0
- package/dist/cli/update.d.ts.map +1 -0
- package/dist/cli/update.js +300 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/cli/visualize.d.ts +77 -0
- package/dist/cli/visualize.d.ts.map +1 -0
- package/dist/cli/visualize.js +287 -0
- package/dist/cli/visualize.js.map +1 -0
- package/dist/cli/worktree.d.ts +9 -0
- package/dist/cli/worktree.d.ts.map +1 -0
- package/dist/cli/worktree.js +213 -0
- package/dist/cli/worktree.js.map +1 -0
- package/dist/coordination/adaptive-patterns.d.ts +65 -0
- package/dist/coordination/adaptive-patterns.d.ts.map +1 -0
- package/dist/coordination/adaptive-patterns.js +108 -0
- package/dist/coordination/adaptive-patterns.js.map +1 -0
- package/dist/coordination/auto-agent.d.ts +82 -0
- package/dist/coordination/auto-agent.d.ts.map +1 -0
- package/dist/coordination/auto-agent.js +145 -0
- package/dist/coordination/auto-agent.js.map +1 -0
- package/dist/coordination/capability-router.d.ts +79 -0
- package/dist/coordination/capability-router.d.ts.map +1 -0
- package/dist/coordination/capability-router.js +334 -0
- package/dist/coordination/capability-router.js.map +1 -0
- package/dist/coordination/database.d.ts +13 -0
- package/dist/coordination/database.d.ts.map +1 -0
- package/dist/coordination/database.js +136 -0
- package/dist/coordination/database.js.map +1 -0
- package/dist/coordination/deploy-batcher.d.ts +122 -0
- package/dist/coordination/deploy-batcher.d.ts.map +1 -0
- package/dist/coordination/deploy-batcher.js +718 -0
- package/dist/coordination/deploy-batcher.js.map +1 -0
- package/dist/coordination/droid-validator.d.ts +59 -0
- package/dist/coordination/droid-validator.d.ts.map +1 -0
- package/dist/coordination/droid-validator.js +142 -0
- package/dist/coordination/droid-validator.js.map +1 -0
- package/dist/coordination/index.d.ts +10 -0
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +10 -0
- package/dist/coordination/index.js.map +1 -0
- package/dist/coordination/pattern-router.d.ts +50 -0
- package/dist/coordination/pattern-router.d.ts.map +1 -0
- package/dist/coordination/pattern-router.js +118 -0
- package/dist/coordination/pattern-router.js.map +1 -0
- package/dist/coordination/service.d.ts +81 -0
- package/dist/coordination/service.d.ts.map +1 -0
- package/dist/coordination/service.js +619 -0
- package/dist/coordination/service.js.map +1 -0
- package/dist/coordination/worktree-enforcer.d.ts +22 -0
- package/dist/coordination/worktree-enforcer.d.ts.map +1 -0
- package/dist/coordination/worktree-enforcer.js +71 -0
- package/dist/coordination/worktree-enforcer.js.map +1 -0
- package/dist/generators/claude-md.d.ts +3 -0
- package/dist/generators/claude-md.d.ts.map +1 -0
- package/dist/generators/claude-md.js +1020 -0
- package/dist/generators/claude-md.js.map +1 -0
- package/dist/generators/template-loader.d.ts +105 -0
- package/dist/generators/template-loader.d.ts.map +1 -0
- package/dist/generators/template-loader.js +291 -0
- package/dist/generators/template-loader.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-router/config/parser.d.ts +9 -0
- package/dist/mcp-router/config/parser.d.ts.map +1 -0
- package/dist/mcp-router/config/parser.js +174 -0
- package/dist/mcp-router/config/parser.js.map +1 -0
- package/dist/mcp-router/executor/client.d.ts +31 -0
- package/dist/mcp-router/executor/client.d.ts.map +1 -0
- package/dist/mcp-router/executor/client.js +189 -0
- package/dist/mcp-router/executor/client.js.map +1 -0
- package/dist/mcp-router/index.d.ts +22 -0
- package/dist/mcp-router/index.d.ts.map +1 -0
- package/dist/mcp-router/index.js +18 -0
- package/dist/mcp-router/index.js.map +1 -0
- package/dist/mcp-router/output-compressor.d.ts +26 -0
- package/dist/mcp-router/output-compressor.d.ts.map +1 -0
- package/dist/mcp-router/output-compressor.js +236 -0
- package/dist/mcp-router/output-compressor.js.map +1 -0
- package/dist/mcp-router/search/fuzzy.d.ts +26 -0
- package/dist/mcp-router/search/fuzzy.d.ts.map +1 -0
- package/dist/mcp-router/search/fuzzy.js +94 -0
- package/dist/mcp-router/search/fuzzy.js.map +1 -0
- package/dist/mcp-router/server.d.ts +50 -0
- package/dist/mcp-router/server.d.ts.map +1 -0
- package/dist/mcp-router/server.js +229 -0
- package/dist/mcp-router/server.js.map +1 -0
- package/dist/mcp-router/session-stats.d.ts +37 -0
- package/dist/mcp-router/session-stats.d.ts.map +1 -0
- package/dist/mcp-router/session-stats.js +56 -0
- package/dist/mcp-router/session-stats.js.map +1 -0
- package/dist/mcp-router/tools/discover.d.ts +37 -0
- package/dist/mcp-router/tools/discover.d.ts.map +1 -0
- package/dist/mcp-router/tools/discover.js +65 -0
- package/dist/mcp-router/tools/discover.js.map +1 -0
- package/dist/mcp-router/tools/execute.d.ts +43 -0
- package/dist/mcp-router/tools/execute.d.ts.map +1 -0
- package/dist/mcp-router/tools/execute.js +144 -0
- package/dist/mcp-router/tools/execute.js.map +1 -0
- package/dist/mcp-router/types.d.ts +62 -0
- package/dist/mcp-router/types.d.ts.map +1 -0
- package/dist/mcp-router/types.js +6 -0
- package/dist/mcp-router/types.js.map +1 -0
- package/dist/memory/adaptive-context.d.ts +149 -0
- package/dist/memory/adaptive-context.d.ts.map +1 -0
- package/dist/memory/adaptive-context.js +1095 -0
- package/dist/memory/adaptive-context.js.map +1 -0
- package/dist/memory/agent-scoped-memory.d.ts +67 -0
- package/dist/memory/agent-scoped-memory.d.ts.map +1 -0
- package/dist/memory/agent-scoped-memory.js +126 -0
- package/dist/memory/agent-scoped-memory.js.map +1 -0
- package/dist/memory/ambiguity-detector.d.ts +54 -0
- package/dist/memory/ambiguity-detector.d.ts.map +1 -0
- package/dist/memory/ambiguity-detector.js +401 -0
- package/dist/memory/ambiguity-detector.js.map +1 -0
- package/dist/memory/backends/base.d.ts +18 -0
- package/dist/memory/backends/base.d.ts.map +1 -0
- package/dist/memory/backends/base.js +2 -0
- package/dist/memory/backends/base.js.map +1 -0
- package/dist/memory/backends/factory.d.ts +4 -0
- package/dist/memory/backends/factory.d.ts.map +1 -0
- package/dist/memory/backends/factory.js +53 -0
- package/dist/memory/backends/factory.js.map +1 -0
- package/dist/memory/backends/github.d.ts +27 -0
- package/dist/memory/backends/github.d.ts.map +1 -0
- package/dist/memory/backends/github.js +134 -0
- package/dist/memory/backends/github.js.map +1 -0
- package/dist/memory/backends/qdrant-cloud.d.ts +32 -0
- package/dist/memory/backends/qdrant-cloud.d.ts.map +1 -0
- package/dist/memory/backends/qdrant-cloud.js +167 -0
- package/dist/memory/backends/qdrant-cloud.js.map +1 -0
- package/dist/memory/context-compressor.d.ts +116 -0
- package/dist/memory/context-compressor.d.ts.map +1 -0
- package/dist/memory/context-compressor.js +430 -0
- package/dist/memory/context-compressor.js.map +1 -0
- package/dist/memory/context-pruner.d.ts +55 -0
- package/dist/memory/context-pruner.d.ts.map +1 -0
- package/dist/memory/context-pruner.js +85 -0
- package/dist/memory/context-pruner.js.map +1 -0
- package/dist/memory/correction-propagator.d.ts +44 -0
- package/dist/memory/correction-propagator.d.ts.map +1 -0
- package/dist/memory/correction-propagator.js +156 -0
- package/dist/memory/correction-propagator.js.map +1 -0
- package/dist/memory/daily-log.d.ts +67 -0
- package/dist/memory/daily-log.d.ts.map +1 -0
- package/dist/memory/daily-log.js +143 -0
- package/dist/memory/daily-log.js.map +1 -0
- package/dist/memory/dynamic-retrieval.d.ts +112 -0
- package/dist/memory/dynamic-retrieval.d.ts.map +1 -0
- package/dist/memory/dynamic-retrieval.js +908 -0
- package/dist/memory/dynamic-retrieval.js.map +1 -0
- package/dist/memory/embeddings.d.ts +172 -0
- package/dist/memory/embeddings.d.ts.map +1 -0
- package/dist/memory/embeddings.js +780 -0
- package/dist/memory/embeddings.js.map +1 -0
- package/dist/memory/generic-uap-patterns.d.ts +7 -0
- package/dist/memory/generic-uap-patterns.d.ts.map +1 -0
- package/dist/memory/generic-uap-patterns.js +43 -0
- package/dist/memory/generic-uap-patterns.js.map +1 -0
- package/dist/memory/hierarchical-memory.d.ts +141 -0
- package/dist/memory/hierarchical-memory.d.ts.map +1 -0
- package/dist/memory/hierarchical-memory.js +485 -0
- package/dist/memory/hierarchical-memory.js.map +1 -0
- package/dist/memory/knowledge-graph.d.ts +98 -0
- package/dist/memory/knowledge-graph.d.ts.map +1 -0
- package/dist/memory/knowledge-graph.js +275 -0
- package/dist/memory/knowledge-graph.js.map +1 -0
- package/dist/memory/memory-consolidator.d.ts +124 -0
- package/dist/memory/memory-consolidator.d.ts.map +1 -0
- package/dist/memory/memory-consolidator.js +514 -0
- package/dist/memory/memory-consolidator.js.map +1 -0
- package/dist/memory/memory-maintenance.d.ts +39 -0
- package/dist/memory/memory-maintenance.d.ts.map +1 -0
- package/dist/memory/memory-maintenance.js +336 -0
- package/dist/memory/memory-maintenance.js.map +1 -0
- package/dist/memory/model-router.d.ts +105 -0
- package/dist/memory/model-router.d.ts.map +1 -0
- package/dist/memory/model-router.js +474 -0
- package/dist/memory/model-router.js.map +1 -0
- package/dist/memory/multi-view-memory.d.ts +134 -0
- package/dist/memory/multi-view-memory.d.ts.map +1 -0
- package/dist/memory/multi-view-memory.js +430 -0
- package/dist/memory/multi-view-memory.js.map +1 -0
- package/dist/memory/predictive-memory.d.ts +79 -0
- package/dist/memory/predictive-memory.d.ts.map +1 -0
- package/dist/memory/predictive-memory.js +294 -0
- package/dist/memory/predictive-memory.js.map +1 -0
- package/dist/memory/prepopulate.d.ts +76 -0
- package/dist/memory/prepopulate.d.ts.map +1 -0
- package/dist/memory/prepopulate.js +832 -0
- package/dist/memory/prepopulate.js.map +1 -0
- package/dist/memory/semantic-compression.d.ts +77 -0
- package/dist/memory/semantic-compression.d.ts.map +1 -0
- package/dist/memory/semantic-compression.js +359 -0
- package/dist/memory/semantic-compression.js.map +1 -0
- package/dist/memory/serverless-qdrant.d.ts +102 -0
- package/dist/memory/serverless-qdrant.d.ts.map +1 -0
- package/dist/memory/serverless-qdrant.js +369 -0
- package/dist/memory/serverless-qdrant.js.map +1 -0
- package/dist/memory/short-term/factory.d.ts +26 -0
- package/dist/memory/short-term/factory.d.ts.map +1 -0
- package/dist/memory/short-term/factory.js +28 -0
- package/dist/memory/short-term/factory.js.map +1 -0
- package/dist/memory/short-term/indexeddb.d.ts +25 -0
- package/dist/memory/short-term/indexeddb.d.ts.map +1 -0
- package/dist/memory/short-term/indexeddb.js +64 -0
- package/dist/memory/short-term/indexeddb.js.map +1 -0
- package/dist/memory/short-term/schema.d.ts +6 -0
- package/dist/memory/short-term/schema.d.ts.map +1 -0
- package/dist/memory/short-term/schema.js +141 -0
- package/dist/memory/short-term/schema.js.map +1 -0
- package/dist/memory/short-term/sqlite.d.ts +64 -0
- package/dist/memory/short-term/sqlite.d.ts.map +1 -0
- package/dist/memory/short-term/sqlite.js +274 -0
- package/dist/memory/short-term/sqlite.js.map +1 -0
- package/dist/memory/speculative-cache.d.ts +111 -0
- package/dist/memory/speculative-cache.d.ts.map +1 -0
- package/dist/memory/speculative-cache.js +457 -0
- package/dist/memory/speculative-cache.js.map +1 -0
- package/dist/memory/task-classifier.d.ts +40 -0
- package/dist/memory/task-classifier.d.ts.map +1 -0
- package/dist/memory/task-classifier.js +342 -0
- package/dist/memory/task-classifier.js.map +1 -0
- package/dist/memory/terminal-bench-knowledge.d.ts +48 -0
- package/dist/memory/terminal-bench-knowledge.d.ts.map +1 -0
- package/dist/memory/terminal-bench-knowledge.js +622 -0
- package/dist/memory/terminal-bench-knowledge.js.map +1 -0
- package/dist/memory/write-gate.d.ts +39 -0
- package/dist/memory/write-gate.d.ts.map +1 -0
- package/dist/memory/write-gate.js +190 -0
- package/dist/memory/write-gate.js.map +1 -0
- package/dist/models/api-client.d.ts +46 -0
- package/dist/models/api-client.d.ts.map +1 -0
- package/dist/models/api-client.js +182 -0
- package/dist/models/api-client.js.map +1 -0
- package/dist/models/execution-profiles.d.ts +64 -0
- package/dist/models/execution-profiles.d.ts.map +1 -0
- package/dist/models/execution-profiles.js +403 -0
- package/dist/models/execution-profiles.js.map +1 -0
- package/dist/models/executor.d.ts +130 -0
- package/dist/models/executor.d.ts.map +1 -0
- package/dist/models/executor.js +382 -0
- package/dist/models/executor.js.map +1 -0
- package/dist/models/index.d.ts +19 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +23 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/plan-validator.d.ts +37 -0
- package/dist/models/plan-validator.d.ts.map +1 -0
- package/dist/models/plan-validator.js +179 -0
- package/dist/models/plan-validator.js.map +1 -0
- package/dist/models/planner.d.ts +73 -0
- package/dist/models/planner.d.ts.map +1 -0
- package/dist/models/planner.js +375 -0
- package/dist/models/planner.js.map +1 -0
- package/dist/models/router.d.ts +96 -0
- package/dist/models/router.d.ts.map +1 -0
- package/dist/models/router.js +523 -0
- package/dist/models/router.js.map +1 -0
- package/dist/models/types.d.ts +370 -0
- package/dist/models/types.d.ts.map +1 -0
- package/dist/models/types.js +232 -0
- package/dist/models/types.js.map +1 -0
- package/dist/models/unified-router.d.ts +152 -0
- package/dist/models/unified-router.d.ts.map +1 -0
- package/dist/models/unified-router.js +313 -0
- package/dist/models/unified-router.js.map +1 -0
- package/dist/policies/convert-policy-to-claude.d.ts +3 -0
- package/dist/policies/convert-policy-to-claude.d.ts.map +1 -0
- package/dist/policies/convert-policy-to-claude.js +87 -0
- package/dist/policies/convert-policy-to-claude.js.map +1 -0
- package/dist/policies/database-manager.d.ts +27 -0
- package/dist/policies/database-manager.d.ts.map +1 -0
- package/dist/policies/database-manager.js +198 -0
- package/dist/policies/database-manager.js.map +1 -0
- package/dist/policies/enforced-tool-router.d.ts +53 -0
- package/dist/policies/enforced-tool-router.d.ts.map +1 -0
- package/dist/policies/enforced-tool-router.js +80 -0
- package/dist/policies/enforced-tool-router.js.map +1 -0
- package/dist/policies/index.d.ts +10 -0
- package/dist/policies/index.d.ts.map +1 -0
- package/dist/policies/index.js +8 -0
- package/dist/policies/index.js.map +1 -0
- package/dist/policies/policy-gate.d.ts +59 -0
- package/dist/policies/policy-gate.d.ts.map +1 -0
- package/dist/policies/policy-gate.js +171 -0
- package/dist/policies/policy-gate.js.map +1 -0
- package/dist/policies/policy-memory.d.ts +18 -0
- package/dist/policies/policy-memory.d.ts.map +1 -0
- package/dist/policies/policy-memory.js +126 -0
- package/dist/policies/policy-memory.js.map +1 -0
- package/dist/policies/policy-tools.d.ts +11 -0
- package/dist/policies/policy-tools.d.ts.map +1 -0
- package/dist/policies/policy-tools.js +66 -0
- package/dist/policies/policy-tools.js.map +1 -0
- package/dist/policies/schemas/policy.d.ts +69 -0
- package/dist/policies/schemas/policy.d.ts.map +1 -0
- package/dist/policies/schemas/policy.js +31 -0
- package/dist/policies/schemas/policy.js.map +1 -0
- package/dist/tasks/coordination.d.ts +83 -0
- package/dist/tasks/coordination.d.ts.map +1 -0
- package/dist/tasks/coordination.js +291 -0
- package/dist/tasks/coordination.js.map +1 -0
- package/dist/tasks/database.d.ts +19 -0
- package/dist/tasks/database.d.ts.map +1 -0
- package/dist/tasks/database.js +149 -0
- package/dist/tasks/database.js.map +1 -0
- package/dist/tasks/decoder-gate.d.ts +64 -0
- package/dist/tasks/decoder-gate.d.ts.map +1 -0
- package/dist/tasks/decoder-gate.js +268 -0
- package/dist/tasks/decoder-gate.js.map +1 -0
- package/dist/tasks/index.d.ts +6 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +6 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/tasks/service.d.ts +40 -0
- package/dist/tasks/service.d.ts.map +1 -0
- package/dist/tasks/service.js +671 -0
- package/dist/tasks/service.js.map +1 -0
- package/dist/tasks/types.d.ts +238 -0
- package/dist/tasks/types.d.ts.map +1 -0
- package/dist/tasks/types.js +74 -0
- package/dist/tasks/types.js.map +1 -0
- package/dist/telemetry/index.d.ts +2 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +2 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/session-telemetry.d.ts +56 -0
- package/dist/telemetry/session-telemetry.d.ts.map +1 -0
- package/dist/telemetry/session-telemetry.js +807 -0
- package/dist/telemetry/session-telemetry.js.map +1 -0
- package/dist/types/analysis.d.ts +82 -0
- package/dist/types/analysis.d.ts.map +1 -0
- package/dist/types/analysis.js +2 -0
- package/dist/types/analysis.js.map +1 -0
- package/dist/types/config.d.ts +3324 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +418 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/coordination.d.ts +240 -0
- package/dist/types/coordination.d.ts.map +1 -0
- package/dist/types/coordination.js +43 -0
- package/dist/types/coordination.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/uap-droids-strict.d.ts +59 -0
- package/dist/uap-droids-strict.d.ts.map +1 -0
- package/dist/uap-droids-strict.js +200 -0
- package/dist/uap-droids-strict.js.map +1 -0
- package/dist/utils/config-manager.d.ts +30 -0
- package/dist/utils/config-manager.d.ts.map +1 -0
- package/dist/utils/config-manager.js +41 -0
- package/dist/utils/config-manager.js.map +1 -0
- package/dist/utils/fetch-with-retry.d.ts +5 -0
- package/dist/utils/fetch-with-retry.d.ts.map +1 -0
- package/dist/utils/fetch-with-retry.js +61 -0
- package/dist/utils/fetch-with-retry.js.map +1 -0
- package/dist/utils/merge-claude-md.d.ts +28 -0
- package/dist/utils/merge-claude-md.d.ts.map +1 -0
- package/dist/utils/merge-claude-md.js +342 -0
- package/dist/utils/merge-claude-md.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +58 -0
- package/dist/utils/rate-limiter.d.ts.map +1 -0
- package/dist/utils/rate-limiter.js +100 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/string-similarity.d.ts +37 -0
- package/dist/utils/string-similarity.d.ts.map +1 -0
- package/dist/utils/string-similarity.js +114 -0
- package/dist/utils/string-similarity.js.map +1 -0
- package/dist/utils/validate-json.d.ts +51 -0
- package/dist/utils/validate-json.d.ts.map +1 -0
- package/dist/utils/validate-json.js +94 -0
- package/dist/utils/validate-json.js.map +1 -0
- package/docs/INDEX.md +66 -0
- package/docs/architecture/MULTI_MODEL.md +224 -0
- package/docs/architecture/SYSTEM_ANALYSIS.md +1117 -0
- package/docs/architecture/UAP_COMPLIANCE.md +217 -0
- package/docs/architecture/UAP_PROTOCOL.md +339 -0
- package/docs/architecture/UAP_STRICT_DROIDS.md +172 -0
- package/docs/archive/BALLS_MODE_SELF_ANALYSIS.md +260 -0
- package/docs/archive/FAILING_TASKS_SOLUTION_PLAN.md +668 -0
- package/docs/archive/JINJA2-SYSTEM-MESSAGE-FIX.md +209 -0
- package/docs/archive/NPM-PUBLISH-V0.9.1.md +240 -0
- package/docs/archive/OPTIMIZATION_OPTIONS.md +334 -0
- package/docs/archive/SETUP_IMPROVEMENTS.md +213 -0
- package/docs/archive/UAP_GENERIC_OPTIMIZATION_PLAN.md +270 -0
- package/docs/archive/UAP_V103_PATTERN_DESIGN.md +315 -0
- package/docs/archive/UAP_V104_COMPLIANCE_DESIGN.md +223 -0
- package/docs/archive/changelog/2026-03-10_uap-100-compliance.md +77 -0
- package/docs/archive/changelog/2026-03-10_uap-full-system-verification.md +109 -0
- package/docs/benchmarks/ACCURACY_ANALYSIS.md +471 -0
- package/docs/benchmarks/TOKEN_OPTIMIZATION.md +572 -0
- package/docs/benchmarks/VALIDATION_PLAN.md +568 -0
- package/docs/benchmarks/VALIDATION_RESULTS.md +161 -0
- package/docs/deployment/DEPLOYMENT.md +895 -0
- package/docs/deployment/DEPLOYMENT_STRATEGIES.md +518 -0
- package/docs/deployment/DEPLOY_BATCHER_ANALYSIS.md +856 -0
- package/docs/deployment/DEPLOY_BATCHING.md +273 -0
- package/docs/deployment/DEPLOY_BUCKETING_ANALYSIS.md +420 -0
- package/docs/deployment/QWEN35_LLAMA_CPP.md +265 -0
- package/docs/getting-started/INTEGRATION.md +449 -0
- package/docs/getting-started/OVERVIEW.md +344 -0
- package/docs/getting-started/SETUP.md +203 -0
- package/docs/integrations/MCP_ROUTER_SETUP.md +445 -0
- package/docs/integrations/RTK_INTEGRATION.md +468 -0
- package/docs/operations/TROUBLESHOOTING.md +660 -0
- package/docs/reference/API_REFERENCE.md +903 -0
- package/docs/reference/FEATURES.md +472 -0
- package/docs/reference/HARNESS-MATRIX.md +318 -0
- package/docs/reference/UAP_CLI_REFERENCE.md +600 -0
- package/docs/research/BEHAVIORAL_PATTERNS.md +228 -0
- package/docs/research/DOMAIN_STRATEGIES.md +316 -0
- package/docs/research/MEMORY_SYSTEMS_COMPARISON.md +812 -0
- package/docs/research/PATTERN_ANALYSIS_2026-01-18.md +436 -0
- package/docs/research/PERFORMANCE_ANALYSIS_2026-01-18.md +209 -0
- package/docs/research/PERFORMANCE_TEST_PLAN.md +383 -0
- package/docs/research/TERMINAL_BENCH_LEARNINGS.md +217 -0
- package/package.json +113 -0
- package/scripts/README.md +161 -0
- package/templates/CLAUDE.template.md +10 -0
- package/templates/CLAUDE_ARCHITECTURE.template.md +103 -0
- package/templates/CLAUDE_CODING.template.md +127 -0
- package/templates/CLAUDE_DROIDS.template.md +109 -0
- package/templates/CLAUDE_MEMORY.template.md +131 -0
- package/templates/CLAUDE_WORKFLOWS.template.md +139 -0
- package/templates/PROJECT.template.md +209 -0
- package/templates/SCHEMA.md +57 -0
- package/templates/archive/CLAUDE.template.root-v6.md +534 -0
- package/templates/archive/CLAUDE.template.v6.md +534 -0
- package/templates/hooks/forgecode/pre-compact.sh +68 -0
- package/templates/hooks/forgecode/session-start.sh +169 -0
- package/templates/hooks/forgecode.plugin.sh +128 -0
- package/templates/hooks/pre-compact.sh +74 -0
- package/templates/hooks/session-start.sh +366 -0
- package/tools/agents/README.md +224 -0
- package/tools/agents/UAP/README.md +386 -0
- package/tools/agents/UAP/__init__.py +9 -0
- package/tools/agents/UAP/cli.py +901 -0
- package/tools/agents/UAP/compliance_verify.sh +108 -0
- package/tools/agents/UAP/full_verification.sh +126 -0
- package/tools/agents/UAP/version.py +32 -0
- package/tools/agents/benchmarks/benchmark_memory_systems.py +730 -0
- package/tools/agents/benchmarks/results/benchmark_20260106_064817.json +170 -0
- package/tools/agents/benchmarks/results/benchmark_20260106_064817.md +51 -0
- package/tools/agents/config/chat_template.jinja +77 -0
- package/tools/agents/config/tool-call-schema.json +19 -0
- package/tools/agents/config/tool-call.gbnf +58 -0
- package/tools/agents/docker/Dockerfile.python +52 -0
- package/tools/agents/docker/Dockerfile.ubuntu +55 -0
- package/tools/agents/docker-compose.qdrant.yml +24 -0
- package/tools/agents/install-opencode-local.sh.j2 +135 -0
- package/tools/agents/migrations/apply.py +256 -0
- package/tools/agents/opencode_uap_agent.py +1505 -0
- package/tools/agents/plugin/README.md +91 -0
- package/tools/agents/plugin/index.ts +46 -0
- package/tools/agents/plugin/pre-compact.sh +68 -0
- package/tools/agents/plugin/session-start.sh +175 -0
- package/tools/agents/plugin/uap-commands.ts +45 -0
- package/tools/agents/plugin/uap-droids.ts +54 -0
- package/tools/agents/plugin/uap-patterns.ts +54 -0
- package/tools/agents/plugin/uap-skills.ts +52 -0
- package/tools/agents/plugins/uap-enforce.ts +314 -0
- package/tools/agents/scripts/__pycache__/tool_call_wrapper.cpython-313.pyc +0 -0
- package/tools/agents/scripts/chat_template_verifier.py +343 -0
- package/tools/agents/scripts/fix-qwen-template.js +38 -0
- package/tools/agents/scripts/fix_qwen_chat_template.py +316 -0
- package/tools/agents/scripts/generate_lora_training_data.py +412 -0
- package/tools/agents/scripts/init_qdrant.py +151 -0
- package/tools/agents/scripts/memory_migration.py +560 -0
- package/tools/agents/scripts/migrate_memory_to_qdrant.py +110 -0
- package/tools/agents/scripts/prepare_lora.sh +512 -0
- package/tools/agents/scripts/query_memory.py +200 -0
- package/tools/agents/scripts/qwen-tool-call-test.js +38 -0
- package/tools/agents/scripts/qwen-tool-call-wrapper.js +38 -0
- package/tools/agents/scripts/qwen_tool_call_test.py +464 -0
- package/tools/agents/scripts/qwen_tool_call_wrapper.py +686 -0
- package/tools/agents/scripts/start-services.sh +96 -0
- package/tools/agents/scripts/tool-choice-proxy.cjs +296 -0
- package/tools/agents/scripts/tool_call_test.py +656 -0
- package/tools/agents/scripts/tool_call_wrapper.py +799 -0
- package/tools/agents/tests/test_uap_compliance.py +257 -0
- package/tools/agents/uap_agent.py +122 -0
- package/tools/agents/uap_agent_install.sh +12 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
# RTK Integration Analysis & Implementation Plan
|
|
2
|
+
|
|
3
|
+
## Executive Summary
|
|
4
|
+
|
|
5
|
+
**RTK (Rust Token Killer)** is a high-performance CLI proxy that reduces LLM token consumption by **60-90%** on common development commands. It achieves this through intelligent output filtering, compression, and smart routing of CLI commands.
|
|
6
|
+
|
|
7
|
+
### Key Metrics
|
|
8
|
+
|
|
9
|
+
- **Token Savings**: 60-90% average (up to 99% for specific commands)
|
|
10
|
+
- **Performance**: <10ms overhead per command
|
|
11
|
+
- **Architecture**: Single Rust binary, zero dependencies
|
|
12
|
+
- **Ecosystem**: 30+ command modules covering Git, JS/TS, Python, Go, Containers, and more
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Current UAP Status vs RTK Capabilities
|
|
17
|
+
|
|
18
|
+
### What UAP Already Has (v2.0.1)
|
|
19
|
+
|
|
20
|
+
✅ **MCP Router** - Token reduction via hierarchical routing (~98% token reduction)
|
|
21
|
+
|
|
22
|
+
- Exposes 2 meta-tools: `discover_tools`, `execute_tool`
|
|
23
|
+
- Hides individual tool definitions from LLM context
|
|
24
|
+
- Works at the MCP protocol level
|
|
25
|
+
|
|
26
|
+
### What RTK Brings (Complementary Layer)
|
|
27
|
+
|
|
28
|
+
✅ **CLI Output Filtering** - Direct command output compression
|
|
29
|
+
|
|
30
|
+
- Filters raw stdout/stderr before it reaches LLM
|
|
31
|
+
- Applies language-specific strategies (stats extraction, error grouping, deduplication)
|
|
32
|
+
- Works at the shell command execution level
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Strategic Integration Options
|
|
37
|
+
|
|
38
|
+
### Option 1: Parallel Implementation (Recommended)
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
┌────────────────────────────────────────────────────────────────────────┐
|
|
42
|
+
│ TWO-LAYER TOKEN OPTIMIZATION │
|
|
43
|
+
└────────────────────────────────────────────────────────────────────────┘
|
|
44
|
+
|
|
45
|
+
Layer 1: MCP Router (UAP v2.0.1)
|
|
46
|
+
────────────────────────────────
|
|
47
|
+
LLM → [Discover Tools] → [Execute Tool] → Backend Services
|
|
48
|
+
↓ ↓
|
|
49
|
+
~483 tokens ~700 tokens
|
|
50
|
+
Total: ~1,200 tokens
|
|
51
|
+
|
|
52
|
+
Layer 2: RTK CLI Proxy (New)
|
|
53
|
+
─────────────────────────────
|
|
54
|
+
Command Execution:
|
|
55
|
+
LLM → rtk git status → [Filter/Compress] → Shell → Git
|
|
56
|
+
↓
|
|
57
|
+
~200 tokens (vs ~2,000 raw)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Benefits**:
|
|
61
|
+
|
|
62
|
+
- **Synergy**: MCP Router reduces tool definition overhead; RTK reduces command output overhead
|
|
63
|
+
- **Coverage**: All token consumption vectors addressed (tool discovery + command execution)
|
|
64
|
+
- **Zero Conflict**: Independent layers with different scopes
|
|
65
|
+
- **Best of Both**: Rust performance (RTK) + TypeScript ecosystem (UAP)
|
|
66
|
+
|
|
67
|
+
**Estimated Combined Savings**: 95%+ total token reduction
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
### Option 2: RTK as UAP Subcommand
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Proposed syntax
|
|
75
|
+
uap rtk git status # Uses RTK binary internally
|
|
76
|
+
uap rtk install # Install RTK to ~/.local/bin/rtk
|
|
77
|
+
uap rtk gain # Show token savings analytics
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Benefits**:
|
|
81
|
+
|
|
82
|
+
- Unified CLI experience
|
|
83
|
+
- Single installation command
|
|
84
|
+
- Integrated analytics dashboard
|
|
85
|
+
|
|
86
|
+
**Implementation Complexity**: Medium (requires bundling Rust binary)
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### Option 3: Pure TypeScript Implementation
|
|
91
|
+
|
|
92
|
+
Re-implement RTK filtering logic in TypeScript/Node.js within UAP.
|
|
93
|
+
|
|
94
|
+
**Benefits**:
|
|
95
|
+
|
|
96
|
+
- No Rust dependency
|
|
97
|
+
- Easier maintenance for JS/TS team
|
|
98
|
+
- Single codebase
|
|
99
|
+
|
|
100
|
+
**Drawbacks**:
|
|
101
|
+
|
|
102
|
+
- Slower performance (Node.js vs Rust)
|
|
103
|
+
- Loss of <10ms overhead guarantee
|
|
104
|
+
- Larger binary size
|
|
105
|
+
|
|
106
|
+
**Estimated Performance**: ~50-100ms overhead (vs <10ms in RTK)
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Recommended Implementation: Option 1 (Parallel)
|
|
111
|
+
|
|
112
|
+
### Architecture Overview
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
┌────────────────────────────────────────────────────────────────────────┐
|
|
116
|
+
│ UAP + RTK Integration │
|
|
117
|
+
└────────────────────────────────────────────────────────────────────────┘
|
|
118
|
+
|
|
119
|
+
User Workflow:
|
|
120
|
+
|
|
121
|
+
1. Install RTK via Homebrew or cargo
|
|
122
|
+
$ brew install rtk
|
|
123
|
+
|
|
124
|
+
2. Initialize hook for Claude Code
|
|
125
|
+
$ rtk init --global
|
|
126
|
+
# Registers PreToolUse hook in ~/.claude/settings.json
|
|
127
|
+
|
|
128
|
+
3. UAP MCP Router runs in background
|
|
129
|
+
$ uap mcp-router start &
|
|
130
|
+
|
|
131
|
+
4. All commands transparently optimized:
|
|
132
|
+
- Git operations → RTK git (85-99% savings)
|
|
133
|
+
- Tool discovery → MCP Router (~98% savings)
|
|
134
|
+
- Test output → RTK test (90%+ savings)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Implementation Phases
|
|
138
|
+
|
|
139
|
+
#### Phase 1: Documentation & Setup (Week 1)
|
|
140
|
+
|
|
141
|
+
**Tasks**:
|
|
142
|
+
|
|
143
|
+
- [ ] Document RTK installation in UAP README
|
|
144
|
+
- [ ] Add `uap install rtk` helper script (auto-installs RTK)
|
|
145
|
+
- [ ] Create integration guide for MCP Router + RTK synergy
|
|
146
|
+
|
|
147
|
+
**Deliverables**:
|
|
148
|
+
|
|
149
|
+
- Updated documentation
|
|
150
|
+
- Installation scripts
|
|
151
|
+
- Example configurations
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
#### Phase 2: CLI Integration (Week 2-3)
|
|
156
|
+
|
|
157
|
+
**Tasks**:
|
|
158
|
+
|
|
159
|
+
- [ ] Add `uap rtk` subcommand wrapper
|
|
160
|
+
- [ ] Implement auto-detection of RTK installation
|
|
161
|
+
- [ ] Create unified analytics dashboard (`uap token-savings`)
|
|
162
|
+
|
|
163
|
+
**Code Structure**:
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
// src/cli/rtk.ts
|
|
167
|
+
export async function rtkCommand(args: string[]) {
|
|
168
|
+
const rtkPath = detectRtkInstall();
|
|
169
|
+
|
|
170
|
+
if (!rtkPath) {
|
|
171
|
+
console.log('RTK not installed. Run: uap install rtk');
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Spawn RTK process with args
|
|
176
|
+
await spawn(rtkPath, args, { stdio: 'inherit' });
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**Deliverables**:
|
|
181
|
+
|
|
182
|
+
- `uap rtk` command
|
|
183
|
+
- Auto-detection logic
|
|
184
|
+
- Installation helper
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
#### Phase 3: Analytics Integration (Week 4)
|
|
189
|
+
|
|
190
|
+
**Tasks**:
|
|
191
|
+
|
|
192
|
+
- [ ] Merge RTK token tracking with UAP analytics
|
|
193
|
+
- [ ] Create unified dashboard showing MCP Router + RTK savings
|
|
194
|
+
- [ ] Add export functionality (JSON, CSV, Markdown)
|
|
195
|
+
|
|
196
|
+
**Data Model**:
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
interface TokenSavingsReport {
|
|
200
|
+
mcpRouter: {
|
|
201
|
+
totalTools: number;
|
|
202
|
+
traditionalTokens: number;
|
|
203
|
+
routerTokens: number;
|
|
204
|
+
savingsPercent: number;
|
|
205
|
+
};
|
|
206
|
+
rtk: {
|
|
207
|
+
totalCommands: number;
|
|
208
|
+
inputTokens: number;
|
|
209
|
+
outputTokens: number;
|
|
210
|
+
savingsPercent: number;
|
|
211
|
+
};
|
|
212
|
+
combined: {
|
|
213
|
+
totalSaved: number;
|
|
214
|
+
overallSavingsPercent: number;
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**Deliverables**:
|
|
220
|
+
|
|
221
|
+
- Unified analytics dashboard
|
|
222
|
+
- Export functionality
|
|
223
|
+
- Visual reports (ASCII charts)
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
#### Phase 4: Advanced Features (Week 5-6)
|
|
228
|
+
|
|
229
|
+
**Tasks**:
|
|
230
|
+
|
|
231
|
+
- [ ] Implement RTK hook auto-configuration in UAP setup
|
|
232
|
+
- [ ] Add RTK command suggestions based on usage patterns
|
|
233
|
+
- [ ] Create custom filter strategies for UAP-specific commands
|
|
234
|
+
|
|
235
|
+
**Example**:
|
|
236
|
+
|
|
237
|
+
```rust
|
|
238
|
+
// Custom rtk module for UAP
|
|
239
|
+
#[command(name = "uap-command")]
|
|
240
|
+
fn run_uap_command() {
|
|
241
|
+
// Analyze UAP command output
|
|
242
|
+
// Apply UAP-specific filtering rules
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**Deliverables**:
|
|
247
|
+
|
|
248
|
+
- Auto-configured hooks
|
|
249
|
+
- Smart suggestions
|
|
250
|
+
- Custom filters
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## RTK Module Coverage Analysis
|
|
255
|
+
|
|
256
|
+
### Commands Already Supported by RTK (30+ modules)
|
|
257
|
+
|
|
258
|
+
| Category | Modules | Avg Savings | UAP Relevance |
|
|
259
|
+
| --------------- | ----------------------------------------------------------- | ----------- | --------------- |
|
|
260
|
+
| **Git** | status, diff, log, add, commit, push, pull | 85-99% | ⭐⭐⭐ Critical |
|
|
261
|
+
| **Code Search** | grep, find, diff | 60-85% | ⭐⭐ High |
|
|
262
|
+
| **JS/TS Stack** | lint, tsc, next, prettier, playwright, prisma, vitest, pnpm | 70-99% | ⭐⭐⭐ Critical |
|
|
263
|
+
| **Python** | ruff, pytest, pip | 80-95% | ⭐⭐ High |
|
|
264
|
+
| **Go** | go test/build/vet, golangci-lint | 75-90% | ⭐⭐ High |
|
|
265
|
+
| **Containers** | docker, podman, kubectl | 60-80% | ⭐⭐ High |
|
|
266
|
+
| **VCS** | gh (GitHub CLI) | 26-87% | ⭐⭐ High |
|
|
267
|
+
| **Build/Lint** | cargo, ruff, tsc | 80-90% | ⭐⭐⭐ Critical |
|
|
268
|
+
| **Tests** | vitest, pytest, playwright, go test | 90-99% | ⭐⭐⭐ Critical |
|
|
269
|
+
|
|
270
|
+
### Commands UAP Should Add (Custom Modules)
|
|
271
|
+
|
|
272
|
+
1. **UAP Memory Operations**
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
rtk uap memory query "session context"
|
|
276
|
+
rtk uap task list
|
|
277
|
+
rtk uap worktree status
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
2. **UAP Hook Management**
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
rtk uap hooks list
|
|
284
|
+
rtk uap plugins install opencode
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
3. **UAP Droid/Agent Coordination**
|
|
288
|
+
```bash
|
|
289
|
+
rtk uap agent status
|
|
290
|
+
rtk uap coord query
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Performance Benchmarks (RTK)
|
|
296
|
+
|
|
297
|
+
### Typical Command Savings
|
|
298
|
+
|
|
299
|
+
| Command | Raw Tokens | RTK Tokens | Savings |
|
|
300
|
+
| ------------------------- | ---------- | ---------- | ------- |
|
|
301
|
+
| `git status` | 2,000 | 400 | **80%** |
|
|
302
|
+
| `cat file.rs` (100 lines) | 40,000 | 12,000 | **70%** |
|
|
303
|
+
| `cargo test` | 25,000 | 2,500 | **90%** |
|
|
304
|
+
| `npm test` | 25,000 | 2,500 | **90%** |
|
|
305
|
+
| `git diff` | 10,000 | 2,500 | **75%** |
|
|
306
|
+
| `docker logs <container>` | 8,000 | 800 | **90%** |
|
|
307
|
+
|
|
308
|
+
### Overhead Analysis
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
Command Execution Time:
|
|
312
|
+
┌───────────────────────────────────────────────────────────────┐
|
|
313
|
+
│ git status (raw) │ 5ms execution + 2,000 tokens │
|
|
314
|
+
│ rtk git status │ 15ms execution + 400 tokens │
|
|
315
|
+
│ Overhead │ +10ms (~2x slower, but 80% less │
|
|
316
|
+
│ │ context) │
|
|
317
|
+
└───────────────────────────────────────────────────────────────┘
|
|
318
|
+
|
|
319
|
+
Trade-off: 10ms delay vs 1,600 token savings = ~$0.003 cost reduction
|
|
320
|
+
(per million tokens @ $0.03/M)
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Installation & Configuration
|
|
326
|
+
|
|
327
|
+
### Recommended UAP + RTK Setup
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
# Step 1: Install UAP (already done)
|
|
331
|
+
npm install -g universal-agent-protocol@2.0.1
|
|
332
|
+
uap init
|
|
333
|
+
|
|
334
|
+
# Step 2: Install RTK
|
|
335
|
+
brew install rtk # macOS/Linux
|
|
336
|
+
# OR
|
|
337
|
+
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh | sh
|
|
338
|
+
# OR
|
|
339
|
+
cargo install --git https://github.com/rtk-ai/rtk
|
|
340
|
+
|
|
341
|
+
# Step 3: Initialize RTK hook for Claude Code
|
|
342
|
+
rtk init --global
|
|
343
|
+
|
|
344
|
+
# Step 4: Start MCP Router (UAP)
|
|
345
|
+
uap mcp-router start &
|
|
346
|
+
|
|
347
|
+
# Step 5: Verify installation
|
|
348
|
+
uap token-savings # Unified analytics
|
|
349
|
+
rtk gain # RTK-specific stats
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### Configuration Files
|
|
353
|
+
|
|
354
|
+
**RTK**: `~/.config/rtk/config.toml`
|
|
355
|
+
|
|
356
|
+
```toml
|
|
357
|
+
[tracking]
|
|
358
|
+
database_path = "~/.local/share/rtk/history.db"
|
|
359
|
+
|
|
360
|
+
[hooks]
|
|
361
|
+
exclude_commands = ["curl", "wget"] # Skip these commands
|
|
362
|
+
|
|
363
|
+
[tee]
|
|
364
|
+
enabled = true # Save full output on failure
|
|
365
|
+
mode = "failures"
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
**UAP**: `~/.opencode/config.json` (auto-created by `uap install opencode`)
|
|
369
|
+
|
|
370
|
+
```json
|
|
371
|
+
{
|
|
372
|
+
"uapEnabled": true,
|
|
373
|
+
"mcpRouterEnabled": true,
|
|
374
|
+
"rtkIntegration": {
|
|
375
|
+
"enabled": true,
|
|
376
|
+
"path": "~/.local/bin/rtk",
|
|
377
|
+
"autoDetect": true
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## Risk Assessment
|
|
385
|
+
|
|
386
|
+
### Low Risk Items ✅
|
|
387
|
+
|
|
388
|
+
- **Documentation Updates**: Safe to add RTK references
|
|
389
|
+
- **Installation Scripts**: Non-invasive, easy to revert
|
|
390
|
+
- **Analytics Dashboard**: Read-only integration with RTK data
|
|
391
|
+
|
|
392
|
+
### Medium Risk Items ⚠️
|
|
393
|
+
|
|
394
|
+
- **CLI Wrappers**: Requires careful error handling for missing RTK binary
|
|
395
|
+
- **Auto-detection**: May fail if RTK installed in non-standard location
|
|
396
|
+
|
|
397
|
+
### High Risk Items ❌
|
|
398
|
+
|
|
399
|
+
- **Custom UAP RTK Modules**: Could conflict with existing RTK modules
|
|
400
|
+
- **Bundling Rust Binary**: Increases package size, complicates distribution
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
## Recommendation & Next Steps
|
|
405
|
+
|
|
406
|
+
### Immediate Actions (Week 1)
|
|
407
|
+
|
|
408
|
+
1. **Update Documentation**
|
|
409
|
+
- Add "RTK Integration" section to UAP README
|
|
410
|
+
- Create installation guide for both tools
|
|
411
|
+
- Document token savings expectations
|
|
412
|
+
|
|
413
|
+
2. **Create Installation Helper**
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
# scripts/install-rtk.sh
|
|
417
|
+
# Auto-detects OS and installs RTK via Homebrew/cargo
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
3. **Add `uap install rtk` Command**
|
|
421
|
+
```typescript
|
|
422
|
+
// src/cli/rtk.ts
|
|
423
|
+
export async function installRtk() {
|
|
424
|
+
const installer = detectOS();
|
|
425
|
+
await installer.run();
|
|
426
|
+
}
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### Short-term Goals (Weeks 2-4)
|
|
430
|
+
|
|
431
|
+
4. **Implement `uap rtk` Wrapper**
|
|
432
|
+
- Pass-through to RTK binary
|
|
433
|
+
- Auto-detection and installation prompts
|
|
434
|
+
|
|
435
|
+
5. **Create Unified Analytics**
|
|
436
|
+
- Merge MCP Router + RTK stats
|
|
437
|
+
- Add export functionality
|
|
438
|
+
|
|
439
|
+
### Long-term Vision (Months 2-3)
|
|
440
|
+
|
|
441
|
+
6. **Custom UAP RTK Modules**
|
|
442
|
+
- Memory operations, task management, droid coordination
|
|
443
|
+
|
|
444
|
+
7. **Advanced Features**
|
|
445
|
+
- Smart command suggestions based on usage patterns
|
|
446
|
+
- Custom filter strategies for UAP-specific workflows
|
|
447
|
+
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
## Conclusion
|
|
451
|
+
|
|
452
|
+
**RTK and UAP MCP Router are complementary tools** that address different layers of token optimization:
|
|
453
|
+
|
|
454
|
+
- **MCP Router**: Reduces tool definition overhead at the protocol level (~98% savings)
|
|
455
|
+
- **RTK**: Compresses CLI command output before it reaches the LLM (60-90% savings)
|
|
456
|
+
|
|
457
|
+
**Recommended Approach**: Parallel implementation with unified analytics and CLI integration. This provides maximum token savings without architectural complexity or risk.
|
|
458
|
+
|
|
459
|
+
**Estimated Combined Savings**: 95%+ total token reduction across all LLM interactions.
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## References
|
|
464
|
+
|
|
465
|
+
- **RTK Repository**: https://github.com/rtk-ai/rtk
|
|
466
|
+
- **RTK Documentation**: https://www.rtk-ai.app
|
|
467
|
+
- **MCP Router Docs**: `/src/mcp-router/README.md` (UAP v2.0.1)
|
|
468
|
+
- **Architecture Deep Dive**: See RTK's `ARCHITECTURE.md` for implementation details
|