@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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analyzers/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA4G1E"}
|
|
@@ -0,0 +1,684 @@
|
|
|
1
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'fs';
|
|
2
|
+
import { join, basename } from 'path';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
export async function analyzeProject(cwd) {
|
|
5
|
+
// Prefer project name from existing .uap.json config, then git remote, then directory name
|
|
6
|
+
let initialName = basename(cwd);
|
|
7
|
+
const uapConfigPath = join(cwd, '.uap.json');
|
|
8
|
+
if (existsSync(uapConfigPath)) {
|
|
9
|
+
try {
|
|
10
|
+
const uapConfig = JSON.parse(readFileSync(uapConfigPath, 'utf-8'));
|
|
11
|
+
if (uapConfig.project?.name) {
|
|
12
|
+
initialName = uapConfig.project.name;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
/* ignore parse errors */
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const analysis = {
|
|
20
|
+
projectName: initialName,
|
|
21
|
+
description: '',
|
|
22
|
+
defaultBranch: 'main',
|
|
23
|
+
languages: [],
|
|
24
|
+
frameworks: [],
|
|
25
|
+
packageManagers: [],
|
|
26
|
+
directories: {
|
|
27
|
+
source: [],
|
|
28
|
+
tests: [],
|
|
29
|
+
infrastructure: [],
|
|
30
|
+
docs: [],
|
|
31
|
+
workflows: [],
|
|
32
|
+
},
|
|
33
|
+
urls: [],
|
|
34
|
+
components: [],
|
|
35
|
+
commands: {},
|
|
36
|
+
databases: [],
|
|
37
|
+
infrastructure: {
|
|
38
|
+
cloud: [],
|
|
39
|
+
},
|
|
40
|
+
existingDroids: [],
|
|
41
|
+
existingSkills: [],
|
|
42
|
+
existingCommands: [],
|
|
43
|
+
troubleshootingHints: [],
|
|
44
|
+
keyFiles: [],
|
|
45
|
+
securityNotes: [],
|
|
46
|
+
};
|
|
47
|
+
// Detect git info
|
|
48
|
+
try {
|
|
49
|
+
analysis.defaultBranch = execSync('git rev-parse --abbrev-ref HEAD', {
|
|
50
|
+
cwd,
|
|
51
|
+
encoding: 'utf-8',
|
|
52
|
+
}).trim();
|
|
53
|
+
// Use git remote origin as a better project name fallback than directory name
|
|
54
|
+
if (analysis.projectName === basename(cwd)) {
|
|
55
|
+
try {
|
|
56
|
+
const remoteUrl = execSync('git remote get-url origin', { cwd, encoding: 'utf-8' }).trim();
|
|
57
|
+
// Extract repo name from URL: git@github.com:user/repo.git or https://github.com/user/repo.git
|
|
58
|
+
const repoMatch = remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);
|
|
59
|
+
if (repoMatch) {
|
|
60
|
+
analysis.projectName = repoMatch[1];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
/* no remote configured */
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
// Not a git repo or git not available
|
|
70
|
+
}
|
|
71
|
+
// Analyze package files
|
|
72
|
+
await analyzePackageFiles(cwd, analysis);
|
|
73
|
+
// Analyze directory structure
|
|
74
|
+
analyzeDirectoryStructure(cwd, analysis);
|
|
75
|
+
// Analyze CI/CD
|
|
76
|
+
analyzeCiCd(cwd, analysis);
|
|
77
|
+
// Analyze existing droids/agents
|
|
78
|
+
analyzeExistingAgents(cwd, analysis);
|
|
79
|
+
// Analyze README for description and URLs
|
|
80
|
+
analyzeReadme(cwd, analysis);
|
|
81
|
+
// Detect databases
|
|
82
|
+
detectDatabases(cwd, analysis);
|
|
83
|
+
// Detect infrastructure
|
|
84
|
+
detectInfrastructure(cwd, analysis);
|
|
85
|
+
// Detect MCP plugins
|
|
86
|
+
detectMcpPlugins(cwd, analysis);
|
|
87
|
+
// Detect key configuration files
|
|
88
|
+
detectKeyConfigFiles(cwd, analysis);
|
|
89
|
+
// Detect authentication
|
|
90
|
+
detectAuthentication(cwd, analysis);
|
|
91
|
+
// Detect clusters (Kubernetes)
|
|
92
|
+
detectClusters(cwd, analysis);
|
|
93
|
+
// Detect components from apps/services directories
|
|
94
|
+
detectComponents(cwd, analysis);
|
|
95
|
+
// Detect file type routing from languages
|
|
96
|
+
detectFileTypeRouting(analysis);
|
|
97
|
+
return analysis;
|
|
98
|
+
}
|
|
99
|
+
async function analyzePackageFiles(cwd, analysis) {
|
|
100
|
+
// package.json (Node.js)
|
|
101
|
+
const packageJsonPath = join(cwd, 'package.json');
|
|
102
|
+
if (existsSync(packageJsonPath)) {
|
|
103
|
+
try {
|
|
104
|
+
const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
|
|
105
|
+
analysis.projectName = pkg.name || analysis.projectName;
|
|
106
|
+
analysis.description = pkg.description || '';
|
|
107
|
+
analysis.packageManagers.push('npm');
|
|
108
|
+
analysis.languages.push('JavaScript');
|
|
109
|
+
// Detect TypeScript
|
|
110
|
+
if (pkg.devDependencies?.typescript || existsSync(join(cwd, 'tsconfig.json'))) {
|
|
111
|
+
analysis.languages.push('TypeScript');
|
|
112
|
+
}
|
|
113
|
+
// Detect frameworks
|
|
114
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
115
|
+
if (deps.react)
|
|
116
|
+
analysis.frameworks.push('React');
|
|
117
|
+
if (deps.next)
|
|
118
|
+
analysis.frameworks.push('Next.js');
|
|
119
|
+
if (deps.vue)
|
|
120
|
+
analysis.frameworks.push('Vue');
|
|
121
|
+
if (deps.express)
|
|
122
|
+
analysis.frameworks.push('Express');
|
|
123
|
+
if (deps.fastify)
|
|
124
|
+
analysis.frameworks.push('Fastify');
|
|
125
|
+
if (deps.nest)
|
|
126
|
+
analysis.frameworks.push('NestJS');
|
|
127
|
+
// Extract commands
|
|
128
|
+
if (pkg.scripts) {
|
|
129
|
+
if (pkg.scripts.test)
|
|
130
|
+
analysis.commands.test = `npm test`;
|
|
131
|
+
if (pkg.scripts.lint)
|
|
132
|
+
analysis.commands.lint = `npm run lint`;
|
|
133
|
+
if (pkg.scripts.build)
|
|
134
|
+
analysis.commands.build = `npm run build`;
|
|
135
|
+
if (pkg.scripts.dev)
|
|
136
|
+
analysis.commands.dev = `npm run dev`;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
// Invalid package.json
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// pyproject.toml (Python)
|
|
144
|
+
const pyprojectPath = join(cwd, 'pyproject.toml');
|
|
145
|
+
if (existsSync(pyprojectPath)) {
|
|
146
|
+
analysis.languages.push('Python');
|
|
147
|
+
analysis.packageManagers.push('pip');
|
|
148
|
+
const content = readFileSync(pyprojectPath, 'utf-8');
|
|
149
|
+
if (content.includes('fastapi'))
|
|
150
|
+
analysis.frameworks.push('FastAPI');
|
|
151
|
+
if (content.includes('django'))
|
|
152
|
+
analysis.frameworks.push('Django');
|
|
153
|
+
if (content.includes('flask'))
|
|
154
|
+
analysis.frameworks.push('Flask');
|
|
155
|
+
analysis.commands.test = analysis.commands.test || 'pytest';
|
|
156
|
+
}
|
|
157
|
+
// requirements.txt
|
|
158
|
+
if (existsSync(join(cwd, 'requirements.txt'))) {
|
|
159
|
+
if (!analysis.languages.includes('Python')) {
|
|
160
|
+
analysis.languages.push('Python');
|
|
161
|
+
}
|
|
162
|
+
if (!analysis.packageManagers.includes('pip')) {
|
|
163
|
+
analysis.packageManagers.push('pip');
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// Cargo.toml (Rust)
|
|
167
|
+
if (existsSync(join(cwd, 'Cargo.toml'))) {
|
|
168
|
+
analysis.languages.push('Rust');
|
|
169
|
+
analysis.packageManagers.push('cargo');
|
|
170
|
+
}
|
|
171
|
+
// go.mod (Go)
|
|
172
|
+
if (existsSync(join(cwd, 'go.mod'))) {
|
|
173
|
+
analysis.languages.push('Go');
|
|
174
|
+
analysis.packageManagers.push('go mod');
|
|
175
|
+
}
|
|
176
|
+
// CMakeLists.txt (C/C++)
|
|
177
|
+
if (existsSync(join(cwd, 'CMakeLists.txt'))) {
|
|
178
|
+
analysis.languages.push('C++');
|
|
179
|
+
analysis.packageManagers.push('cmake');
|
|
180
|
+
}
|
|
181
|
+
// pom.xml (Java/Maven)
|
|
182
|
+
if (existsSync(join(cwd, 'pom.xml'))) {
|
|
183
|
+
analysis.languages.push('Java');
|
|
184
|
+
analysis.packageManagers.push('maven');
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function analyzeDirectoryStructure(cwd, analysis) {
|
|
188
|
+
const sourceDirs = ['src', 'lib', 'app', 'packages', 'platform', 'services'];
|
|
189
|
+
const testDirs = ['tests', 'test', '__tests__', 'spec'];
|
|
190
|
+
const infraDirs = ['infra', 'terraform', 'infrastructure', 'deploy', 'k8s', 'kubernetes'];
|
|
191
|
+
const docDirs = ['docs', 'documentation', 'doc'];
|
|
192
|
+
for (const dir of sourceDirs) {
|
|
193
|
+
if (existsSync(join(cwd, dir))) {
|
|
194
|
+
analysis.directories.source.push(dir);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
for (const dir of testDirs) {
|
|
198
|
+
if (existsSync(join(cwd, dir))) {
|
|
199
|
+
analysis.directories.tests.push(dir);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
for (const dir of infraDirs) {
|
|
203
|
+
if (existsSync(join(cwd, dir))) {
|
|
204
|
+
analysis.directories.infrastructure.push(dir);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
for (const dir of docDirs) {
|
|
208
|
+
if (existsSync(join(cwd, dir))) {
|
|
209
|
+
analysis.directories.docs.push(dir);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// Check for UI directories
|
|
213
|
+
if (existsSync(join(cwd, 'ui'))) {
|
|
214
|
+
const uiPath = join(cwd, 'ui');
|
|
215
|
+
try {
|
|
216
|
+
const subdirs = readdirSync(uiPath).filter((f) => statSync(join(uiPath, f)).isDirectory());
|
|
217
|
+
for (const subdir of subdirs) {
|
|
218
|
+
analysis.components.push({
|
|
219
|
+
name: `UI - ${subdir}`,
|
|
220
|
+
path: `ui/${subdir}`,
|
|
221
|
+
language: 'JavaScript',
|
|
222
|
+
description: `Frontend component: ${subdir}`,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
// Can't read ui directory
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
function analyzeCiCd(cwd, analysis) {
|
|
232
|
+
// GitHub Actions
|
|
233
|
+
const ghWorkflowsPath = join(cwd, '.github/workflows');
|
|
234
|
+
if (existsSync(ghWorkflowsPath)) {
|
|
235
|
+
analysis.directories.workflows.push('.github/workflows');
|
|
236
|
+
try {
|
|
237
|
+
const workflows = readdirSync(ghWorkflowsPath).filter((f) => f.endsWith('.yml') || f.endsWith('.yaml'));
|
|
238
|
+
analysis.ciCd = {
|
|
239
|
+
platform: 'GitHub Actions',
|
|
240
|
+
workflows: workflows.map((f) => ({
|
|
241
|
+
file: f,
|
|
242
|
+
purpose: inferWorkflowPurpose(f),
|
|
243
|
+
})),
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
// Can't read workflows
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
// GitLab CI
|
|
251
|
+
if (existsSync(join(cwd, '.gitlab-ci.yml'))) {
|
|
252
|
+
analysis.ciCd = {
|
|
253
|
+
platform: 'GitLab CI',
|
|
254
|
+
workflows: [{ file: '.gitlab-ci.yml', purpose: 'CI/CD pipeline' }],
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
function inferWorkflowPurpose(filename) {
|
|
259
|
+
const name = filename.toLowerCase();
|
|
260
|
+
if (name.includes('test'))
|
|
261
|
+
return 'Testing';
|
|
262
|
+
if (name.includes('lint'))
|
|
263
|
+
return 'Linting';
|
|
264
|
+
if (name.includes('build'))
|
|
265
|
+
return 'Build';
|
|
266
|
+
if (name.includes('deploy') || name.includes('cd'))
|
|
267
|
+
return 'Deployment';
|
|
268
|
+
if (name.includes('security'))
|
|
269
|
+
return 'Security scanning';
|
|
270
|
+
if (name.includes('release'))
|
|
271
|
+
return 'Release automation';
|
|
272
|
+
if (name.includes('ci'))
|
|
273
|
+
return 'Continuous Integration';
|
|
274
|
+
return 'Workflow';
|
|
275
|
+
}
|
|
276
|
+
function analyzeExistingAgents(cwd, analysis) {
|
|
277
|
+
// Factory droids
|
|
278
|
+
const factoryDroidsPath = join(cwd, '.factory/droids');
|
|
279
|
+
if (existsSync(factoryDroidsPath)) {
|
|
280
|
+
try {
|
|
281
|
+
const droids = readdirSync(factoryDroidsPath)
|
|
282
|
+
.filter((f) => f.endsWith('.md'))
|
|
283
|
+
.map((f) => basename(f, '.md'));
|
|
284
|
+
analysis.existingDroids.push(...droids);
|
|
285
|
+
}
|
|
286
|
+
catch {
|
|
287
|
+
// Can't read droids
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
// Factory skills
|
|
291
|
+
const factorySkillsPath = join(cwd, '.factory/skills');
|
|
292
|
+
if (existsSync(factorySkillsPath)) {
|
|
293
|
+
try {
|
|
294
|
+
const skills = readdirSync(factorySkillsPath)
|
|
295
|
+
.filter((f) => statSync(join(factorySkillsPath, f)).isDirectory())
|
|
296
|
+
.map((f) => f);
|
|
297
|
+
analysis.existingSkills.push(...skills);
|
|
298
|
+
}
|
|
299
|
+
catch {
|
|
300
|
+
// Can't read skills
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
// Factory commands
|
|
304
|
+
const factoryCommandsPath = join(cwd, '.factory/commands');
|
|
305
|
+
if (existsSync(factoryCommandsPath)) {
|
|
306
|
+
try {
|
|
307
|
+
const commands = readdirSync(factoryCommandsPath)
|
|
308
|
+
.filter((f) => f.endsWith('.md'))
|
|
309
|
+
.map((f) => basename(f, '.md'));
|
|
310
|
+
analysis.existingCommands.push(...commands);
|
|
311
|
+
}
|
|
312
|
+
catch {
|
|
313
|
+
// Can't read commands
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
// Claude Code agents
|
|
317
|
+
const claudeAgentsPath = join(cwd, '.claude/agents');
|
|
318
|
+
if (existsSync(claudeAgentsPath)) {
|
|
319
|
+
try {
|
|
320
|
+
const agents = readdirSync(claudeAgentsPath)
|
|
321
|
+
.filter((f) => f.endsWith('.md'))
|
|
322
|
+
.map((f) => basename(f, '.md'));
|
|
323
|
+
analysis.existingDroids.push(...agents);
|
|
324
|
+
}
|
|
325
|
+
catch {
|
|
326
|
+
// Can't read agents
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function analyzeReadme(cwd, analysis) {
|
|
331
|
+
const readmePaths = ['README.md', 'readme.md', 'Readme.md'];
|
|
332
|
+
for (const readmePath of readmePaths) {
|
|
333
|
+
const fullPath = join(cwd, readmePath);
|
|
334
|
+
if (existsSync(fullPath)) {
|
|
335
|
+
try {
|
|
336
|
+
const content = readFileSync(fullPath, 'utf-8');
|
|
337
|
+
// Extract first paragraph as description
|
|
338
|
+
const firstParagraph = content.split('\n\n')[1]?.trim();
|
|
339
|
+
if (firstParagraph && !analysis.description) {
|
|
340
|
+
analysis.description = firstParagraph.substring(0, 200);
|
|
341
|
+
}
|
|
342
|
+
// Extract URLs
|
|
343
|
+
const urlRegex = /https?:\/\/[^\s\)]+/g;
|
|
344
|
+
const urls = content.match(urlRegex) || [];
|
|
345
|
+
for (const url of urls.slice(0, 5)) {
|
|
346
|
+
// Limit to first 5 URLs
|
|
347
|
+
if (url.includes('github.com'))
|
|
348
|
+
continue; // Skip GitHub links
|
|
349
|
+
analysis.urls.push({
|
|
350
|
+
name: 'URL',
|
|
351
|
+
value: url,
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
analysis.keyFiles.push({
|
|
355
|
+
file: readmePath,
|
|
356
|
+
purpose: 'Project documentation',
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
catch {
|
|
360
|
+
// Can't read README
|
|
361
|
+
}
|
|
362
|
+
break;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
function detectDatabases(cwd, analysis) {
|
|
367
|
+
// Check for database-related files
|
|
368
|
+
if (existsSync(join(cwd, 'docker-compose.yml'))) {
|
|
369
|
+
try {
|
|
370
|
+
const content = readFileSync(join(cwd, 'docker-compose.yml'), 'utf-8');
|
|
371
|
+
if (content.includes('postgres')) {
|
|
372
|
+
analysis.databases.push({ type: 'PostgreSQL', purpose: 'Database' });
|
|
373
|
+
}
|
|
374
|
+
if (content.includes('mysql')) {
|
|
375
|
+
analysis.databases.push({ type: 'MySQL', purpose: 'Database' });
|
|
376
|
+
}
|
|
377
|
+
if (content.includes('mongo')) {
|
|
378
|
+
analysis.databases.push({ type: 'MongoDB', purpose: 'Database' });
|
|
379
|
+
}
|
|
380
|
+
if (content.includes('redis')) {
|
|
381
|
+
analysis.databases.push({ type: 'Redis', purpose: 'Cache' });
|
|
382
|
+
}
|
|
383
|
+
if (content.includes('qdrant')) {
|
|
384
|
+
analysis.databases.push({ type: 'Qdrant', purpose: 'Vector database' });
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
catch {
|
|
388
|
+
// Can't read docker-compose
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
// Check for SQLite
|
|
392
|
+
if (existsSync(join(cwd, 'agents/data/memory/short_term.db'))) {
|
|
393
|
+
analysis.databases.push({ type: 'SQLite', purpose: 'Agent memory' });
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
function detectInfrastructure(cwd, analysis) {
|
|
397
|
+
// Terraform
|
|
398
|
+
const terraformPath = join(cwd, 'infra/terraform');
|
|
399
|
+
if (existsSync(terraformPath) || existsSync(join(cwd, 'terraform'))) {
|
|
400
|
+
analysis.infrastructure.iac = 'Terraform';
|
|
401
|
+
}
|
|
402
|
+
// Kubernetes
|
|
403
|
+
if (existsSync(join(cwd, 'k8s')) || existsSync(join(cwd, 'kubernetes'))) {
|
|
404
|
+
analysis.infrastructure.containerOrchestration = 'Kubernetes';
|
|
405
|
+
}
|
|
406
|
+
// Docker
|
|
407
|
+
if (existsSync(join(cwd, 'Dockerfile')) || existsSync(join(cwd, 'docker-compose.yml'))) {
|
|
408
|
+
if (!analysis.infrastructure.containerOrchestration) {
|
|
409
|
+
analysis.infrastructure.containerOrchestration = 'Docker';
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
function detectMcpPlugins(cwd, analysis) {
|
|
414
|
+
const mcpPath = join(cwd, '.mcp.json');
|
|
415
|
+
if (!existsSync(mcpPath))
|
|
416
|
+
return;
|
|
417
|
+
try {
|
|
418
|
+
const mcp = JSON.parse(readFileSync(mcpPath, 'utf-8'));
|
|
419
|
+
const plugins = mcp.mcpServers || mcp.plugins || {};
|
|
420
|
+
analysis.mcpPlugins = [];
|
|
421
|
+
for (const [name, config] of Object.entries(plugins)) {
|
|
422
|
+
const cfg = config;
|
|
423
|
+
analysis.mcpPlugins.push({
|
|
424
|
+
name,
|
|
425
|
+
purpose: cfg.description || cfg.purpose || 'MCP plugin',
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
catch {
|
|
430
|
+
// Can't read or parse .mcp.json
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
function detectKeyConfigFiles(cwd, analysis) {
|
|
434
|
+
// Common configuration files to detect
|
|
435
|
+
const configFiles = [
|
|
436
|
+
{ file: '.uap.json', purpose: 'UAP agent memory configuration' },
|
|
437
|
+
{ file: 'package.json', purpose: 'Node.js project configuration' },
|
|
438
|
+
{ file: 'tsconfig.json', purpose: 'TypeScript configuration' },
|
|
439
|
+
{ file: '.mcp.json', purpose: 'MCP plugins configuration' },
|
|
440
|
+
{ file: 'docker-compose.yml', purpose: 'Docker Compose services' },
|
|
441
|
+
{ file: 'Dockerfile', purpose: 'Container build definition' },
|
|
442
|
+
{ file: '.env.example', purpose: 'Environment variable template' },
|
|
443
|
+
{ file: '.gitignore', purpose: 'Git ignore patterns' },
|
|
444
|
+
{ file: 'pyproject.toml', purpose: 'Python project configuration' },
|
|
445
|
+
{ file: 'Cargo.toml', purpose: 'Rust project configuration' },
|
|
446
|
+
{ file: 'go.mod', purpose: 'Go module definition' },
|
|
447
|
+
{ file: 'pom.xml', purpose: 'Maven project configuration' },
|
|
448
|
+
{ file: '.eslintrc.json', purpose: 'ESLint configuration' },
|
|
449
|
+
{ file: '.eslintrc.js', purpose: 'ESLint configuration' },
|
|
450
|
+
{ file: '.prettierrc', purpose: 'Prettier configuration' },
|
|
451
|
+
{ file: 'vitest.config.ts', purpose: 'Vitest test configuration' },
|
|
452
|
+
{ file: 'jest.config.js', purpose: 'Jest test configuration' },
|
|
453
|
+
{ file: 'vite.config.ts', purpose: 'Vite build configuration' },
|
|
454
|
+
{ file: 'webpack.config.js', purpose: 'Webpack build configuration' },
|
|
455
|
+
];
|
|
456
|
+
for (const cfg of configFiles) {
|
|
457
|
+
if (existsSync(join(cwd, cfg.file))) {
|
|
458
|
+
// Check if not already added
|
|
459
|
+
if (!analysis.keyFiles.some((kf) => kf.file === cfg.file)) {
|
|
460
|
+
analysis.keyFiles.push(cfg);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
// Detect infrastructure-specific config files
|
|
465
|
+
if (analysis.infrastructure.iac === 'Terraform') {
|
|
466
|
+
const terraformConfigs = [
|
|
467
|
+
{ file: 'main.tf', purpose: 'Terraform main configuration' },
|
|
468
|
+
{ file: 'variables.tf', purpose: 'Terraform variables' },
|
|
469
|
+
{ file: 'outputs.tf', purpose: 'Terraform outputs' },
|
|
470
|
+
{ file: 'production.tfvars', purpose: 'Production environment variables' },
|
|
471
|
+
];
|
|
472
|
+
const infraPath = analysis.directories.infrastructure[0] || 'infra/terraform';
|
|
473
|
+
for (const cfg of terraformConfigs) {
|
|
474
|
+
const fullPath = join(cwd, infraPath, cfg.file);
|
|
475
|
+
if (existsSync(fullPath)) {
|
|
476
|
+
analysis.keyFiles.push({
|
|
477
|
+
file: `${infraPath}/${cfg.file}`,
|
|
478
|
+
purpose: cfg.purpose,
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
function detectAuthentication(cwd, analysis) {
|
|
485
|
+
// Check for common auth providers
|
|
486
|
+
const authPatterns = [
|
|
487
|
+
{ pattern: 'zitadel', provider: 'Zitadel', description: 'OIDC/OAuth2 authentication' },
|
|
488
|
+
{ pattern: 'keycloak', provider: 'Keycloak', description: 'Identity and access management' },
|
|
489
|
+
{ pattern: 'auth0', provider: 'Auth0', description: 'Authentication platform' },
|
|
490
|
+
{
|
|
491
|
+
pattern: 'oauth2-proxy',
|
|
492
|
+
provider: 'OAuth2 Proxy',
|
|
493
|
+
description: 'OAuth2 authentication proxy',
|
|
494
|
+
},
|
|
495
|
+
{ pattern: 'firebase-auth', provider: 'Firebase Auth', description: 'Firebase authentication' },
|
|
496
|
+
{ pattern: 'supabase', provider: 'Supabase', description: 'Supabase authentication' },
|
|
497
|
+
{ pattern: 'clerk', provider: 'Clerk', description: 'Clerk authentication' },
|
|
498
|
+
{
|
|
499
|
+
pattern: 'passport',
|
|
500
|
+
provider: 'Passport.js',
|
|
501
|
+
description: 'Node.js authentication middleware',
|
|
502
|
+
},
|
|
503
|
+
];
|
|
504
|
+
// Check in various config files
|
|
505
|
+
const filesToCheck = ['docker-compose.yml', 'package.json', 'requirements.txt', '.env.example'];
|
|
506
|
+
for (const file of filesToCheck) {
|
|
507
|
+
const filePath = join(cwd, file);
|
|
508
|
+
if (existsSync(filePath)) {
|
|
509
|
+
try {
|
|
510
|
+
const content = readFileSync(filePath, 'utf-8').toLowerCase();
|
|
511
|
+
for (const auth of authPatterns) {
|
|
512
|
+
if (content.includes(auth.pattern)) {
|
|
513
|
+
analysis.authentication = {
|
|
514
|
+
provider: auth.provider,
|
|
515
|
+
description: auth.description,
|
|
516
|
+
};
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
catch {
|
|
522
|
+
// Ignore
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
// Check for Istio with OAuth2
|
|
527
|
+
const k8sPath = join(cwd, 'infra/k8s');
|
|
528
|
+
if (existsSync(k8sPath)) {
|
|
529
|
+
try {
|
|
530
|
+
const files = readdirSync(k8sPath, { recursive: true });
|
|
531
|
+
for (const file of files) {
|
|
532
|
+
if (typeof file === 'string' && (file.includes('oauth') || file.includes('auth'))) {
|
|
533
|
+
analysis.authentication = {
|
|
534
|
+
provider: 'OAuth2',
|
|
535
|
+
description: 'OAuth2 authentication via Kubernetes/Istio',
|
|
536
|
+
};
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
catch {
|
|
542
|
+
// Ignore
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
function detectClusters(cwd, analysis) {
|
|
547
|
+
// Check for kubeconfig references or cluster configs
|
|
548
|
+
const k8sPath = join(cwd, 'infra/k8s');
|
|
549
|
+
const terraformPath = join(cwd, 'infra/terraform');
|
|
550
|
+
if (!existsSync(k8sPath) && !existsSync(terraformPath)) {
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
// Look for cluster context patterns in terraform files
|
|
554
|
+
if (existsSync(terraformPath)) {
|
|
555
|
+
try {
|
|
556
|
+
const files = readdirSync(terraformPath).filter((f) => f.endsWith('.tf'));
|
|
557
|
+
const contexts = [];
|
|
558
|
+
for (const file of files) {
|
|
559
|
+
const content = readFileSync(join(terraformPath, file), 'utf-8');
|
|
560
|
+
// Look for digitalocean_kubernetes_cluster or similar
|
|
561
|
+
const doClusterMatch = content.match(/do-[\w-]+/g);
|
|
562
|
+
if (doClusterMatch) {
|
|
563
|
+
for (const match of [...new Set(doClusterMatch)]) {
|
|
564
|
+
if (!contexts.find((c) => c.context === match)) {
|
|
565
|
+
const purpose = match.includes('openobserve')
|
|
566
|
+
? 'Observability'
|
|
567
|
+
: match.includes('zitadel')
|
|
568
|
+
? 'Authentication'
|
|
569
|
+
: 'Applications';
|
|
570
|
+
contexts.push({
|
|
571
|
+
name: match.replace(/^do-\w+-/, '').replace(/-/g, ' '),
|
|
572
|
+
context: match,
|
|
573
|
+
purpose,
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
if (contexts.length > 0) {
|
|
580
|
+
analysis.clusters = {
|
|
581
|
+
enabled: true,
|
|
582
|
+
contexts,
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
catch {
|
|
587
|
+
// Ignore
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
function detectComponents(cwd, analysis) {
|
|
592
|
+
// Scan apps/ and services/ directories for components
|
|
593
|
+
const componentDirs = ['apps', 'services', 'packages', 'libs'];
|
|
594
|
+
for (const dir of componentDirs) {
|
|
595
|
+
const dirPath = join(cwd, dir);
|
|
596
|
+
if (!existsSync(dirPath))
|
|
597
|
+
continue;
|
|
598
|
+
try {
|
|
599
|
+
const subdirs = readdirSync(dirPath, { withFileTypes: true }).filter((d) => d.isDirectory() && !d.name.startsWith('.'));
|
|
600
|
+
for (const subdir of subdirs) {
|
|
601
|
+
const compPath = join(dirPath, subdir.name);
|
|
602
|
+
// Detect language and framework
|
|
603
|
+
let language = 'Unknown';
|
|
604
|
+
let framework = '';
|
|
605
|
+
let description = '';
|
|
606
|
+
// Check for package.json
|
|
607
|
+
const pkgPath = join(compPath, 'package.json');
|
|
608
|
+
if (existsSync(pkgPath)) {
|
|
609
|
+
try {
|
|
610
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
611
|
+
description = pkg.description || '';
|
|
612
|
+
language = 'TypeScript';
|
|
613
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
614
|
+
if (deps.react)
|
|
615
|
+
framework = 'React';
|
|
616
|
+
else if (deps.vue)
|
|
617
|
+
framework = 'Vue';
|
|
618
|
+
else if (deps.express)
|
|
619
|
+
framework = 'Express';
|
|
620
|
+
else if (deps.fastify)
|
|
621
|
+
framework = 'Fastify';
|
|
622
|
+
else if (deps.next)
|
|
623
|
+
framework = 'Next.js';
|
|
624
|
+
}
|
|
625
|
+
catch {
|
|
626
|
+
// Ignore
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
// Check for pyproject.toml or requirements.txt
|
|
630
|
+
if (existsSync(join(compPath, 'pyproject.toml')) ||
|
|
631
|
+
existsSync(join(compPath, 'requirements.txt'))) {
|
|
632
|
+
language = 'Python';
|
|
633
|
+
if (existsSync(join(compPath, 'pyproject.toml'))) {
|
|
634
|
+
const content = readFileSync(join(compPath, 'pyproject.toml'), 'utf-8');
|
|
635
|
+
if (content.includes('fastapi'))
|
|
636
|
+
framework = 'FastAPI';
|
|
637
|
+
else if (content.includes('flask'))
|
|
638
|
+
framework = 'Flask';
|
|
639
|
+
else if (content.includes('django'))
|
|
640
|
+
framework = 'Django';
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
// Check for CMakeLists.txt (C++)
|
|
644
|
+
if (existsSync(join(compPath, 'CMakeLists.txt'))) {
|
|
645
|
+
language = 'C++';
|
|
646
|
+
const content = readFileSync(join(compPath, 'CMakeLists.txt'), 'utf-8');
|
|
647
|
+
if (content.includes('crow') || content.includes('Crow'))
|
|
648
|
+
framework = 'Crow';
|
|
649
|
+
}
|
|
650
|
+
// Check for Cargo.toml (Rust)
|
|
651
|
+
if (existsSync(join(compPath, 'Cargo.toml'))) {
|
|
652
|
+
language = 'Rust';
|
|
653
|
+
}
|
|
654
|
+
// Check for go.mod (Go)
|
|
655
|
+
if (existsSync(join(compPath, 'go.mod'))) {
|
|
656
|
+
language = 'Go';
|
|
657
|
+
}
|
|
658
|
+
// Only add if not already present
|
|
659
|
+
const compFullPath = `${dir}/${subdir.name}`;
|
|
660
|
+
if (!analysis.components.find((c) => c.path === compFullPath)) {
|
|
661
|
+
analysis.components.push({
|
|
662
|
+
name: subdir.name,
|
|
663
|
+
path: compFullPath,
|
|
664
|
+
language,
|
|
665
|
+
framework: framework || undefined,
|
|
666
|
+
description: description || `${language}${framework ? ` ${framework}` : ''} component`,
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
catch {
|
|
672
|
+
// Ignore
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
function detectFileTypeRouting(analysis) {
|
|
677
|
+
// This function doesn't modify analysis directly but ensures languages are properly detected
|
|
678
|
+
// The FILE_TYPE_ROUTING template variable is built by the generator based on detected languages
|
|
679
|
+
// Ensure unique languages
|
|
680
|
+
analysis.languages = [...new Set(analysis.languages)];
|
|
681
|
+
// Ensure frameworks are unique
|
|
682
|
+
analysis.frameworks = [...new Set(analysis.frameworks)];
|
|
683
|
+
}
|
|
684
|
+
//# sourceMappingURL=index.js.map
|