@mc1global/opencode-jarvis 0.1.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 +10 -0
- package/README.md +171 -0
- package/dist/application/context-memory/dtos.d.ts +100 -0
- package/dist/application/context-memory/dtos.d.ts.map +1 -0
- package/dist/application/context-memory/dtos.js +11 -0
- package/dist/application/context-memory/dtos.js.map +1 -0
- package/dist/application/context-memory/note-use-cases.d.ts +22 -0
- package/dist/application/context-memory/note-use-cases.d.ts.map +1 -0
- package/dist/application/context-memory/note-use-cases.js +76 -0
- package/dist/application/context-memory/note-use-cases.js.map +1 -0
- package/dist/application/context-memory/session-use-cases.d.ts +23 -0
- package/dist/application/context-memory/session-use-cases.d.ts.map +1 -0
- package/dist/application/context-memory/session-use-cases.js +63 -0
- package/dist/application/context-memory/session-use-cases.js.map +1 -0
- package/dist/application/context-memory/todo-use-cases.d.ts +25 -0
- package/dist/application/context-memory/todo-use-cases.d.ts.map +1 -0
- package/dist/application/context-memory/todo-use-cases.js +100 -0
- package/dist/application/context-memory/todo-use-cases.js.map +1 -0
- package/dist/application/domain-map/dtos.d.ts +58 -0
- package/dist/application/domain-map/dtos.d.ts.map +1 -0
- package/dist/application/domain-map/dtos.js +11 -0
- package/dist/application/domain-map/dtos.js.map +1 -0
- package/dist/application/domain-map/use-cases.d.ts +64 -0
- package/dist/application/domain-map/use-cases.d.ts.map +1 -0
- package/dist/application/domain-map/use-cases.js +217 -0
- package/dist/application/domain-map/use-cases.js.map +1 -0
- package/dist/application/environment/dtos.d.ts +74 -0
- package/dist/application/environment/dtos.d.ts.map +1 -0
- package/dist/application/environment/dtos.js +10 -0
- package/dist/application/environment/dtos.js.map +1 -0
- package/dist/application/environment/use-cases.d.ts +29 -0
- package/dist/application/environment/use-cases.d.ts.map +1 -0
- package/dist/application/environment/use-cases.js +232 -0
- package/dist/application/environment/use-cases.js.map +1 -0
- package/dist/application/governance/validation-use-cases.d.ts +45 -0
- package/dist/application/governance/validation-use-cases.d.ts.map +1 -0
- package/dist/application/governance/validation-use-cases.js +51 -0
- package/dist/application/governance/validation-use-cases.js.map +1 -0
- package/dist/application/kanban/board-use-cases.d.ts +45 -0
- package/dist/application/kanban/board-use-cases.d.ts.map +1 -0
- package/dist/application/kanban/board-use-cases.js +124 -0
- package/dist/application/kanban/board-use-cases.js.map +1 -0
- package/dist/application/kanban/card-use-cases.d.ts +32 -0
- package/dist/application/kanban/card-use-cases.d.ts.map +1 -0
- package/dist/application/kanban/card-use-cases.js +204 -0
- package/dist/application/kanban/card-use-cases.js.map +1 -0
- package/dist/application/kanban/dtos.d.ts +165 -0
- package/dist/application/kanban/dtos.d.ts.map +1 -0
- package/dist/application/kanban/dtos.js +11 -0
- package/dist/application/kanban/dtos.js.map +1 -0
- package/dist/application/kanban/sprint-use-cases.d.ts +34 -0
- package/dist/application/kanban/sprint-use-cases.d.ts.map +1 -0
- package/dist/application/kanban/sprint-use-cases.js +243 -0
- package/dist/application/kanban/sprint-use-cases.js.map +1 -0
- package/dist/application/rag/dtos.d.ts +113 -0
- package/dist/application/rag/dtos.d.ts.map +1 -0
- package/dist/application/rag/dtos.js +11 -0
- package/dist/application/rag/dtos.js.map +1 -0
- package/dist/application/rag/oracle-use-cases.d.ts +30 -0
- package/dist/application/rag/oracle-use-cases.d.ts.map +1 -0
- package/dist/application/rag/oracle-use-cases.js +91 -0
- package/dist/application/rag/oracle-use-cases.js.map +1 -0
- package/dist/application/rag/use-cases.d.ts +34 -0
- package/dist/application/rag/use-cases.d.ts.map +1 -0
- package/dist/application/rag/use-cases.js +234 -0
- package/dist/application/rag/use-cases.js.map +1 -0
- package/dist/application/token-metrics/dtos.d.ts +126 -0
- package/dist/application/token-metrics/dtos.d.ts.map +1 -0
- package/dist/application/token-metrics/dtos.js +11 -0
- package/dist/application/token-metrics/dtos.js.map +1 -0
- package/dist/application/token-metrics/tracking-use-cases.d.ts +33 -0
- package/dist/application/token-metrics/tracking-use-cases.d.ts.map +1 -0
- package/dist/application/token-metrics/tracking-use-cases.js +220 -0
- package/dist/application/token-metrics/tracking-use-cases.js.map +1 -0
- package/dist/application/vault/dtos.d.ts +91 -0
- package/dist/application/vault/dtos.d.ts.map +1 -0
- package/dist/application/vault/dtos.js +11 -0
- package/dist/application/vault/dtos.js.map +1 -0
- package/dist/application/vault/use-cases.d.ts +30 -0
- package/dist/application/vault/use-cases.d.ts.map +1 -0
- package/dist/application/vault/use-cases.js +307 -0
- package/dist/application/vault/use-cases.js.map +1 -0
- package/dist/application/vault/vault-manager.d.ts +47 -0
- package/dist/application/vault/vault-manager.d.ts.map +1 -0
- package/dist/application/vault/vault-manager.js +272 -0
- package/dist/application/vault/vault-manager.js.map +1 -0
- package/dist/application/workspace-registry/dtos.d.ts +91 -0
- package/dist/application/workspace-registry/dtos.d.ts.map +1 -0
- package/dist/application/workspace-registry/dtos.js +11 -0
- package/dist/application/workspace-registry/dtos.js.map +1 -0
- package/dist/application/workspace-registry/use-cases.d.ts +29 -0
- package/dist/application/workspace-registry/use-cases.d.ts.map +1 -0
- package/dist/application/workspace-registry/use-cases.js +249 -0
- package/dist/application/workspace-registry/use-cases.js.map +1 -0
- package/dist/domain/context-memory/entities.d.ts +123 -0
- package/dist/domain/context-memory/entities.d.ts.map +1 -0
- package/dist/domain/context-memory/entities.js +229 -0
- package/dist/domain/context-memory/entities.js.map +1 -0
- package/dist/domain/context-memory/repositories.d.ts +46 -0
- package/dist/domain/context-memory/repositories.d.ts.map +1 -0
- package/dist/domain/context-memory/repositories.js +2 -0
- package/dist/domain/context-memory/repositories.js.map +1 -0
- package/dist/domain/context-memory/services.d.ts +62 -0
- package/dist/domain/context-memory/services.d.ts.map +1 -0
- package/dist/domain/context-memory/services.js +162 -0
- package/dist/domain/context-memory/services.js.map +1 -0
- package/dist/domain/context-memory/value-objects.d.ts +65 -0
- package/dist/domain/context-memory/value-objects.d.ts.map +1 -0
- package/dist/domain/context-memory/value-objects.js +105 -0
- package/dist/domain/context-memory/value-objects.js.map +1 -0
- package/dist/domain/domain-map/repositories.d.ts +126 -0
- package/dist/domain/domain-map/repositories.d.ts.map +1 -0
- package/dist/domain/domain-map/repositories.js +2 -0
- package/dist/domain/domain-map/repositories.js.map +1 -0
- package/dist/domain/domain-map/services.d.ts +108 -0
- package/dist/domain/domain-map/services.d.ts.map +1 -0
- package/dist/domain/domain-map/services.js +335 -0
- package/dist/domain/domain-map/services.js.map +1 -0
- package/dist/domain/domain-map/value-objects.d.ts +186 -0
- package/dist/domain/domain-map/value-objects.d.ts.map +1 -0
- package/dist/domain/domain-map/value-objects.js +215 -0
- package/dist/domain/domain-map/value-objects.js.map +1 -0
- package/dist/domain/environment/entities.d.ts +93 -0
- package/dist/domain/environment/entities.d.ts.map +1 -0
- package/dist/domain/environment/entities.js +207 -0
- package/dist/domain/environment/entities.js.map +1 -0
- package/dist/domain/environment/renderers.d.ts +30 -0
- package/dist/domain/environment/renderers.d.ts.map +1 -0
- package/dist/domain/environment/renderers.js +139 -0
- package/dist/domain/environment/renderers.js.map +1 -0
- package/dist/domain/environment/repositories.d.ts +73 -0
- package/dist/domain/environment/repositories.d.ts.map +1 -0
- package/dist/domain/environment/repositories.js +16 -0
- package/dist/domain/environment/repositories.js.map +1 -0
- package/dist/domain/environment/services.d.ts +62 -0
- package/dist/domain/environment/services.d.ts.map +1 -0
- package/dist/domain/environment/services.js +282 -0
- package/dist/domain/environment/services.js.map +1 -0
- package/dist/domain/environment/value-objects.d.ts +127 -0
- package/dist/domain/environment/value-objects.d.ts.map +1 -0
- package/dist/domain/environment/value-objects.js +179 -0
- package/dist/domain/environment/value-objects.js.map +1 -0
- package/dist/domain/governance/policies.d.ts +42 -0
- package/dist/domain/governance/policies.d.ts.map +1 -0
- package/dist/domain/governance/policies.js +304 -0
- package/dist/domain/governance/policies.js.map +1 -0
- package/dist/domain/governance/services.d.ts +38 -0
- package/dist/domain/governance/services.d.ts.map +1 -0
- package/dist/domain/governance/services.js +42 -0
- package/dist/domain/governance/services.js.map +1 -0
- package/dist/domain/kanban/entities.d.ts +105 -0
- package/dist/domain/kanban/entities.d.ts.map +1 -0
- package/dist/domain/kanban/entities.js +211 -0
- package/dist/domain/kanban/entities.js.map +1 -0
- package/dist/domain/kanban/grooming.d.ts +40 -0
- package/dist/domain/kanban/grooming.d.ts.map +1 -0
- package/dist/domain/kanban/grooming.js +50 -0
- package/dist/domain/kanban/grooming.js.map +1 -0
- package/dist/domain/kanban/repositories.d.ts +41 -0
- package/dist/domain/kanban/repositories.d.ts.map +1 -0
- package/dist/domain/kanban/repositories.js +2 -0
- package/dist/domain/kanban/repositories.js.map +1 -0
- package/dist/domain/kanban/services.d.ts +49 -0
- package/dist/domain/kanban/services.d.ts.map +1 -0
- package/dist/domain/kanban/services.js +154 -0
- package/dist/domain/kanban/services.js.map +1 -0
- package/dist/domain/kanban/sprint.d.ts +103 -0
- package/dist/domain/kanban/sprint.d.ts.map +1 -0
- package/dist/domain/kanban/sprint.js +192 -0
- package/dist/domain/kanban/sprint.js.map +1 -0
- package/dist/domain/kanban/value-objects.d.ts +91 -0
- package/dist/domain/kanban/value-objects.d.ts.map +1 -0
- package/dist/domain/kanban/value-objects.js +167 -0
- package/dist/domain/kanban/value-objects.js.map +1 -0
- package/dist/domain/rag/repositories.d.ts +152 -0
- package/dist/domain/rag/repositories.d.ts.map +1 -0
- package/dist/domain/rag/repositories.js +2 -0
- package/dist/domain/rag/repositories.js.map +1 -0
- package/dist/domain/rag/services.d.ts +57 -0
- package/dist/domain/rag/services.d.ts.map +1 -0
- package/dist/domain/rag/services.js +224 -0
- package/dist/domain/rag/services.js.map +1 -0
- package/dist/domain/rag/value-objects.d.ts +118 -0
- package/dist/domain/rag/value-objects.d.ts.map +1 -0
- package/dist/domain/rag/value-objects.js +114 -0
- package/dist/domain/rag/value-objects.js.map +1 -0
- package/dist/domain/shared/value-objects.d.ts +56 -0
- package/dist/domain/shared/value-objects.d.ts.map +1 -0
- package/dist/domain/shared/value-objects.js +89 -0
- package/dist/domain/shared/value-objects.js.map +1 -0
- package/dist/domain/token-metrics/entities.d.ts +90 -0
- package/dist/domain/token-metrics/entities.d.ts.map +1 -0
- package/dist/domain/token-metrics/entities.js +115 -0
- package/dist/domain/token-metrics/entities.js.map +1 -0
- package/dist/domain/token-metrics/repositories.d.ts +93 -0
- package/dist/domain/token-metrics/repositories.d.ts.map +1 -0
- package/dist/domain/token-metrics/repositories.js +2 -0
- package/dist/domain/token-metrics/repositories.js.map +1 -0
- package/dist/domain/token-metrics/value-objects.d.ts +81 -0
- package/dist/domain/token-metrics/value-objects.d.ts.map +1 -0
- package/dist/domain/token-metrics/value-objects.js +144 -0
- package/dist/domain/token-metrics/value-objects.js.map +1 -0
- package/dist/domain/vault/canvas.d.ts +70 -0
- package/dist/domain/vault/canvas.d.ts.map +1 -0
- package/dist/domain/vault/canvas.js +70 -0
- package/dist/domain/vault/canvas.js.map +1 -0
- package/dist/domain/vault/document.d.ts +71 -0
- package/dist/domain/vault/document.d.ts.map +1 -0
- package/dist/domain/vault/document.js +244 -0
- package/dist/domain/vault/document.js.map +1 -0
- package/dist/domain/vault/repositories.d.ts +35 -0
- package/dist/domain/vault/repositories.d.ts.map +1 -0
- package/dist/domain/vault/repositories.js +2 -0
- package/dist/domain/vault/repositories.js.map +1 -0
- package/dist/domain/vault/section.d.ts +33 -0
- package/dist/domain/vault/section.d.ts.map +1 -0
- package/dist/domain/vault/section.js +39 -0
- package/dist/domain/vault/section.js.map +1 -0
- package/dist/domain/vault/services.d.ts +48 -0
- package/dist/domain/vault/services.d.ts.map +1 -0
- package/dist/domain/vault/services.js +249 -0
- package/dist/domain/vault/services.js.map +1 -0
- package/dist/domain/vault/table.d.ts +58 -0
- package/dist/domain/vault/table.d.ts.map +1 -0
- package/dist/domain/vault/table.js +204 -0
- package/dist/domain/vault/table.js.map +1 -0
- package/dist/domain/vault/timeline.d.ts +53 -0
- package/dist/domain/vault/timeline.d.ts.map +1 -0
- package/dist/domain/vault/timeline.js +214 -0
- package/dist/domain/vault/timeline.js.map +1 -0
- package/dist/domain/vault/value-objects.d.ts +45 -0
- package/dist/domain/vault/value-objects.d.ts.map +1 -0
- package/dist/domain/vault/value-objects.js +89 -0
- package/dist/domain/vault/value-objects.js.map +1 -0
- package/dist/domain/workspace-registry/entities.d.ts +57 -0
- package/dist/domain/workspace-registry/entities.d.ts.map +1 -0
- package/dist/domain/workspace-registry/entities.js +148 -0
- package/dist/domain/workspace-registry/entities.js.map +1 -0
- package/dist/domain/workspace-registry/repositories.d.ts +57 -0
- package/dist/domain/workspace-registry/repositories.d.ts.map +1 -0
- package/dist/domain/workspace-registry/repositories.js +12 -0
- package/dist/domain/workspace-registry/repositories.js.map +1 -0
- package/dist/domain/workspace-registry/services.d.ts +56 -0
- package/dist/domain/workspace-registry/services.d.ts.map +1 -0
- package/dist/domain/workspace-registry/services.js +283 -0
- package/dist/domain/workspace-registry/services.js.map +1 -0
- package/dist/domain/workspace-registry/value-objects.d.ts +113 -0
- package/dist/domain/workspace-registry/value-objects.d.ts.map +1 -0
- package/dist/domain/workspace-registry/value-objects.js +235 -0
- package/dist/domain/workspace-registry/value-objects.js.map +1 -0
- package/dist/hooks/context-compacting.d.ts +35 -0
- package/dist/hooks/context-compacting.d.ts.map +1 -0
- package/dist/hooks/context-compacting.js +48 -0
- package/dist/hooks/context-compacting.js.map +1 -0
- package/dist/hooks/event-handlers.d.ts +39 -0
- package/dist/hooks/event-handlers.d.ts.map +1 -0
- package/dist/hooks/event-handlers.js +75 -0
- package/dist/hooks/event-handlers.js.map +1 -0
- package/dist/hooks/guardrails.d.ts +33 -0
- package/dist/hooks/guardrails.d.ts.map +1 -0
- package/dist/hooks/guardrails.js +22 -0
- package/dist/hooks/guardrails.js.map +1 -0
- package/dist/hooks/shell-env.d.ts +28 -0
- package/dist/hooks/shell-env.d.ts.map +1 -0
- package/dist/hooks/shell-env.js +17 -0
- package/dist/hooks/shell-env.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +349 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/context-memory/note-repository.d.ts +26 -0
- package/dist/infrastructure/context-memory/note-repository.d.ts.map +1 -0
- package/dist/infrastructure/context-memory/note-repository.js +87 -0
- package/dist/infrastructure/context-memory/note-repository.js.map +1 -0
- package/dist/infrastructure/context-memory/search-repository.d.ts +20 -0
- package/dist/infrastructure/context-memory/search-repository.d.ts.map +1 -0
- package/dist/infrastructure/context-memory/search-repository.js +44 -0
- package/dist/infrastructure/context-memory/search-repository.js.map +1 -0
- package/dist/infrastructure/context-memory/session-repository.d.ts +26 -0
- package/dist/infrastructure/context-memory/session-repository.d.ts.map +1 -0
- package/dist/infrastructure/context-memory/session-repository.js +79 -0
- package/dist/infrastructure/context-memory/session-repository.js.map +1 -0
- package/dist/infrastructure/context-memory/todo-repository.d.ts +26 -0
- package/dist/infrastructure/context-memory/todo-repository.d.ts.map +1 -0
- package/dist/infrastructure/context-memory/todo-repository.js +105 -0
- package/dist/infrastructure/context-memory/todo-repository.js.map +1 -0
- package/dist/infrastructure/database/sqlite-adapter.d.ts +60 -0
- package/dist/infrastructure/database/sqlite-adapter.d.ts.map +1 -0
- package/dist/infrastructure/database/sqlite-adapter.js +93 -0
- package/dist/infrastructure/database/sqlite-adapter.js.map +1 -0
- package/dist/infrastructure/domain-map/llm-analyzer.d.ts +60 -0
- package/dist/infrastructure/domain-map/llm-analyzer.d.ts.map +1 -0
- package/dist/infrastructure/domain-map/llm-analyzer.js +249 -0
- package/dist/infrastructure/domain-map/llm-analyzer.js.map +1 -0
- package/dist/infrastructure/domain-map/lsp-adapter.d.ts +61 -0
- package/dist/infrastructure/domain-map/lsp-adapter.d.ts.map +1 -0
- package/dist/infrastructure/domain-map/lsp-adapter.js +210 -0
- package/dist/infrastructure/domain-map/lsp-adapter.js.map +1 -0
- package/dist/infrastructure/domain-map/lsp-configs.d.ts +53 -0
- package/dist/infrastructure/domain-map/lsp-configs.d.ts.map +1 -0
- package/dist/infrastructure/domain-map/lsp-configs.js +274 -0
- package/dist/infrastructure/domain-map/lsp-configs.js.map +1 -0
- package/dist/infrastructure/domain-map/lsp-json-rpc.d.ts +132 -0
- package/dist/infrastructure/domain-map/lsp-json-rpc.d.ts.map +1 -0
- package/dist/infrastructure/domain-map/lsp-json-rpc.js +320 -0
- package/dist/infrastructure/domain-map/lsp-json-rpc.js.map +1 -0
- package/dist/infrastructure/domain-map/project-scanner.d.ts +43 -0
- package/dist/infrastructure/domain-map/project-scanner.d.ts.map +1 -0
- package/dist/infrastructure/domain-map/project-scanner.js +193 -0
- package/dist/infrastructure/domain-map/project-scanner.js.map +1 -0
- package/dist/infrastructure/environment/environment-repository.d.ts +33 -0
- package/dist/infrastructure/environment/environment-repository.d.ts.map +1 -0
- package/dist/infrastructure/environment/environment-repository.js +161 -0
- package/dist/infrastructure/environment/environment-repository.js.map +1 -0
- package/dist/infrastructure/environment/scanner-adapter.d.ts +23 -0
- package/dist/infrastructure/environment/scanner-adapter.d.ts.map +1 -0
- package/dist/infrastructure/environment/scanner-adapter.js +102 -0
- package/dist/infrastructure/environment/scanner-adapter.js.map +1 -0
- package/dist/infrastructure/kanban/card-repository.d.ts +41 -0
- package/dist/infrastructure/kanban/card-repository.d.ts.map +1 -0
- package/dist/infrastructure/kanban/card-repository.js +185 -0
- package/dist/infrastructure/kanban/card-repository.js.map +1 -0
- package/dist/infrastructure/kanban/sprint-repository.d.ts +40 -0
- package/dist/infrastructure/kanban/sprint-repository.d.ts.map +1 -0
- package/dist/infrastructure/kanban/sprint-repository.js +186 -0
- package/dist/infrastructure/kanban/sprint-repository.js.map +1 -0
- package/dist/infrastructure/rag/file-discovery.d.ts +19 -0
- package/dist/infrastructure/rag/file-discovery.d.ts.map +1 -0
- package/dist/infrastructure/rag/file-discovery.js +201 -0
- package/dist/infrastructure/rag/file-discovery.js.map +1 -0
- package/dist/infrastructure/rag/ollama-embeddings.d.ts +18 -0
- package/dist/infrastructure/rag/ollama-embeddings.d.ts.map +1 -0
- package/dist/infrastructure/rag/ollama-embeddings.js +54 -0
- package/dist/infrastructure/rag/ollama-embeddings.js.map +1 -0
- package/dist/infrastructure/rag/text-splitter.d.ts +19 -0
- package/dist/infrastructure/rag/text-splitter.d.ts.map +1 -0
- package/dist/infrastructure/rag/text-splitter.js +38 -0
- package/dist/infrastructure/rag/text-splitter.js.map +1 -0
- package/dist/infrastructure/rag/vectra-adapter.d.ts +38 -0
- package/dist/infrastructure/rag/vectra-adapter.d.ts.map +1 -0
- package/dist/infrastructure/rag/vectra-adapter.js +275 -0
- package/dist/infrastructure/rag/vectra-adapter.js.map +1 -0
- package/dist/infrastructure/token-metrics/token-metrics-repository.d.ts +29 -0
- package/dist/infrastructure/token-metrics/token-metrics-repository.d.ts.map +1 -0
- package/dist/infrastructure/token-metrics/token-metrics-repository.js +254 -0
- package/dist/infrastructure/token-metrics/token-metrics-repository.js.map +1 -0
- package/dist/infrastructure/vault/markdown-parser.d.ts +35 -0
- package/dist/infrastructure/vault/markdown-parser.d.ts.map +1 -0
- package/dist/infrastructure/vault/markdown-parser.js +145 -0
- package/dist/infrastructure/vault/markdown-parser.js.map +1 -0
- package/dist/infrastructure/vault/vault-fs-adapter.d.ts +17 -0
- package/dist/infrastructure/vault/vault-fs-adapter.d.ts.map +1 -0
- package/dist/infrastructure/vault/vault-fs-adapter.js +105 -0
- package/dist/infrastructure/vault/vault-fs-adapter.js.map +1 -0
- package/dist/infrastructure/workspace-registry/dependency-repository.d.ts +27 -0
- package/dist/infrastructure/workspace-registry/dependency-repository.d.ts.map +1 -0
- package/dist/infrastructure/workspace-registry/dependency-repository.js +89 -0
- package/dist/infrastructure/workspace-registry/dependency-repository.js.map +1 -0
- package/dist/infrastructure/workspace-registry/workspace-repository.d.ts +28 -0
- package/dist/infrastructure/workspace-registry/workspace-repository.d.ts.map +1 -0
- package/dist/infrastructure/workspace-registry/workspace-repository.js +108 -0
- package/dist/infrastructure/workspace-registry/workspace-repository.js.map +1 -0
- package/dist/tools/agent-tools.d.ts +14 -0
- package/dist/tools/agent-tools.d.ts.map +1 -0
- package/dist/tools/agent-tools.js +238 -0
- package/dist/tools/agent-tools.js.map +1 -0
- package/dist/tools/context-memory-tools.d.ts +16 -0
- package/dist/tools/context-memory-tools.d.ts.map +1 -0
- package/dist/tools/context-memory-tools.js +242 -0
- package/dist/tools/context-memory-tools.js.map +1 -0
- package/dist/tools/data-tools.d.ts +3 -0
- package/dist/tools/data-tools.d.ts.map +1 -0
- package/dist/tools/data-tools.js +383 -0
- package/dist/tools/data-tools.js.map +1 -0
- package/dist/tools/domain-map-tools.d.ts +41 -0
- package/dist/tools/domain-map-tools.d.ts.map +1 -0
- package/dist/tools/domain-map-tools.js +134 -0
- package/dist/tools/domain-map-tools.js.map +1 -0
- package/dist/tools/environment-tools.d.ts +85 -0
- package/dist/tools/environment-tools.d.ts.map +1 -0
- package/dist/tools/environment-tools.js +223 -0
- package/dist/tools/environment-tools.js.map +1 -0
- package/dist/tools/governance-tools.d.ts +7 -0
- package/dist/tools/governance-tools.d.ts.map +1 -0
- package/dist/tools/governance-tools.js +73 -0
- package/dist/tools/governance-tools.js.map +1 -0
- package/dist/tools/kanban-board-tools.d.ts +11 -0
- package/dist/tools/kanban-board-tools.d.ts.map +1 -0
- package/dist/tools/kanban-board-tools.js +354 -0
- package/dist/tools/kanban-board-tools.js.map +1 -0
- package/dist/tools/kanban-card-tools.d.ts +11 -0
- package/dist/tools/kanban-card-tools.d.ts.map +1 -0
- package/dist/tools/kanban-card-tools.js +407 -0
- package/dist/tools/kanban-card-tools.js.map +1 -0
- package/dist/tools/rag-tools.d.ts +10 -0
- package/dist/tools/rag-tools.d.ts.map +1 -0
- package/dist/tools/rag-tools.js +279 -0
- package/dist/tools/rag-tools.js.map +1 -0
- package/dist/tools/token-metrics-tools.d.ts +98 -0
- package/dist/tools/token-metrics-tools.d.ts.map +1 -0
- package/dist/tools/token-metrics-tools.js +287 -0
- package/dist/tools/token-metrics-tools.js.map +1 -0
- package/dist/tools/vault-manage-tool.d.ts +7 -0
- package/dist/tools/vault-manage-tool.d.ts.map +1 -0
- package/dist/tools/vault-manage-tool.js +193 -0
- package/dist/tools/vault-manage-tool.js.map +1 -0
- package/dist/tools/vault-tools.d.ts +7 -0
- package/dist/tools/vault-tools.d.ts.map +1 -0
- package/dist/tools/vault-tools.js +348 -0
- package/dist/tools/vault-tools.js.map +1 -0
- package/dist/tools/workspace-registry-tools.d.ts +93 -0
- package/dist/tools/workspace-registry-tools.d.ts.map +1 -0
- package/dist/tools/workspace-registry-tools.js +217 -0
- package/dist/tools/workspace-registry-tools.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain Map — Domain Services
|
|
3
|
+
*
|
|
4
|
+
* Stateless domain services for the Domain Map bounded context.
|
|
5
|
+
* Zero external dependencies (pure domain logic).
|
|
6
|
+
*
|
|
7
|
+
* Responsibilities:
|
|
8
|
+
* - Detect analysis mode (greenfield vs legacy) from scan results
|
|
9
|
+
* - Build greenfield domain map from directory structure (Path A)
|
|
10
|
+
* - Build structural graph from LSP data (shared utility for Path B)
|
|
11
|
+
* - Generate the final DomainMapDocument from analysis results
|
|
12
|
+
*
|
|
13
|
+
* SOLID: SRP — each function has a single responsibility
|
|
14
|
+
* DDD: Domain Services — stateless operations on domain concepts
|
|
15
|
+
*/
|
|
16
|
+
import type { AnalysisConfig, AnalysisMode, BoundedContext, CodeSymbol, DomainMapDocument, LanguageId, ProjectScanResult, ScannedFile, SrpViolation, StructuralGraph, SymbolReference } from "./value-objects.js";
|
|
17
|
+
/**
|
|
18
|
+
* Directory names that indicate DDD structure in a greenfield codebase.
|
|
19
|
+
* If a project root contains several of these, it's likely DDD-structured.
|
|
20
|
+
*/
|
|
21
|
+
export declare const GREENFIELD_INDICATORS: readonly string[];
|
|
22
|
+
/**
|
|
23
|
+
* Patterns that indicate a legacy codebase with structural problems.
|
|
24
|
+
* Files matching these patterns suggest monolithic architecture.
|
|
25
|
+
*/
|
|
26
|
+
export declare const LEGACY_INDICATORS: readonly string[];
|
|
27
|
+
/**
|
|
28
|
+
* Detect whether a project should use greenfield (Path A) or legacy (Path B)
|
|
29
|
+
* analysis based on scan results and configuration thresholds.
|
|
30
|
+
*
|
|
31
|
+
* Greenfield criteria (ALL must be true):
|
|
32
|
+
* 1. DDD directory structure detected (domain/, application/, etc.)
|
|
33
|
+
* 2. SOLID patterns present (small files, clear separation)
|
|
34
|
+
* 3. Low ratio of large files (below legacyRatio threshold)
|
|
35
|
+
*
|
|
36
|
+
* If any criterion fails → legacy mode.
|
|
37
|
+
*
|
|
38
|
+
* @param scan - Project scan result with file stats and structure indicators
|
|
39
|
+
* @param config - Analysis configuration with thresholds
|
|
40
|
+
* @returns The detected analysis mode
|
|
41
|
+
*/
|
|
42
|
+
export declare function detectAnalysisMode(scan: ProjectScanResult, config: AnalysisConfig): AnalysisMode;
|
|
43
|
+
/**
|
|
44
|
+
* Build a domain map for a greenfield (DDD-structured) codebase.
|
|
45
|
+
* Infers bounded contexts from directory structure without LSP or LLM.
|
|
46
|
+
*
|
|
47
|
+
* Strategy: Look for directories under DDD layer folders.
|
|
48
|
+
* e.g., src/domain/kanban/ → bounded context "kanban"
|
|
49
|
+
* src/domain/rag/ → bounded context "rag"
|
|
50
|
+
*
|
|
51
|
+
* @param scan - Project scan result
|
|
52
|
+
* @param config - Analysis configuration
|
|
53
|
+
* @returns Array of bounded contexts inferred from paths
|
|
54
|
+
*/
|
|
55
|
+
export declare function buildGreenfieldMap(scan: ProjectScanResult, config: AnalysisConfig): readonly BoundedContext[];
|
|
56
|
+
/**
|
|
57
|
+
* Infer bounded context name from a file's relative path.
|
|
58
|
+
* Looks for directories immediately under DDD layer folders.
|
|
59
|
+
*
|
|
60
|
+
* Examples:
|
|
61
|
+
* - "src/domain/kanban/entities.ts" → "kanban"
|
|
62
|
+
* - "src/application/rag/use-cases.ts" → "rag"
|
|
63
|
+
* - "src/tools/governance-tools.ts" → "governance" (from filename)
|
|
64
|
+
* - "src/index.ts" → "unknown"
|
|
65
|
+
*/
|
|
66
|
+
export declare function inferBoundedContext(relativePath: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* Build a StructuralGraph from LSP-extracted symbols and references.
|
|
69
|
+
* Used by Path B after LSP extraction to create the input for LLM analysis.
|
|
70
|
+
*
|
|
71
|
+
* @param fileSymbols - Map of file paths to their extracted symbols
|
|
72
|
+
* @param references - Cross-file references
|
|
73
|
+
* @returns Complete structural graph
|
|
74
|
+
*/
|
|
75
|
+
export declare function buildStructuralGraph(fileSymbols: ReadonlyMap<string, readonly CodeSymbol[]>, references: readonly SymbolReference[]): StructuralGraph;
|
|
76
|
+
/**
|
|
77
|
+
* Detect SRP violations from scanned files based on line count thresholds.
|
|
78
|
+
* Files exceeding maxFileLines are flagged.
|
|
79
|
+
*
|
|
80
|
+
* @param files - Scanned files with line counts
|
|
81
|
+
* @param config - Configuration with maxFileLines threshold
|
|
82
|
+
* @returns Array of detected violations
|
|
83
|
+
*/
|
|
84
|
+
export declare function detectSrpViolations(files: readonly ScannedFile[], config: AnalysisConfig): readonly SrpViolation[];
|
|
85
|
+
/**
|
|
86
|
+
* Generate the final DomainMapDocument from analysis results.
|
|
87
|
+
* Combines structural and semantic analysis into a unified report.
|
|
88
|
+
*
|
|
89
|
+
* @param projectName - Name of the project
|
|
90
|
+
* @param mode - Analysis mode used
|
|
91
|
+
* @param language - Primary language of the project
|
|
92
|
+
* @param scan - Project scan result
|
|
93
|
+
* @param contexts - Identified bounded contexts
|
|
94
|
+
* @param graph - Structural graph (may be empty for greenfield)
|
|
95
|
+
* @param violations - SRP violations detected
|
|
96
|
+
* @param recommendedStructure - Recommended DDD structure
|
|
97
|
+
* @returns Complete domain map document
|
|
98
|
+
*/
|
|
99
|
+
export declare function generateMapDocument(projectName: string, mode: AnalysisMode, language: LanguageId, scan: ProjectScanResult, contexts: readonly BoundedContext[], graph: StructuralGraph, violations: readonly SrpViolation[], recommendedStructure: string): DomainMapDocument;
|
|
100
|
+
/**
|
|
101
|
+
* Render a DomainMapDocument as a markdown string.
|
|
102
|
+
* Produces a human-readable report suitable for display or saving.
|
|
103
|
+
*
|
|
104
|
+
* @param doc - The domain map document to render
|
|
105
|
+
* @returns Formatted markdown string
|
|
106
|
+
*/
|
|
107
|
+
export declare function renderDocumentAsMarkdown(doc: DomainMapDocument): string;
|
|
108
|
+
//# sourceMappingURL=services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../src/domain/domain-map/services.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAI5B;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAclD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAO9C,CAAC;AAIF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,cAAc,GACrB,YAAY,CAcd;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,cAAc,GACrB,SAAS,cAAc,EAAE,CA+B3B;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAkBhE;AAsCD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC,EACvD,UAAU,EAAE,SAAS,eAAe,EAAE,GACrC,eAAe,CAYjB;AAcD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,MAAM,EAAE,cAAc,GACrB,SAAS,YAAY,EAAE,CAgBzB;AAyBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,iBAAiB,EACvB,QAAQ,EAAE,SAAS,cAAc,EAAE,EACnC,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,SAAS,YAAY,EAAE,EACnC,oBAAoB,EAAE,MAAM,GAC3B,iBAAiB,CAYnB;AAID;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAoEvE"}
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
// ── Greenfield Detection Indicators ───────────────────────────────────
|
|
2
|
+
/**
|
|
3
|
+
* Directory names that indicate DDD structure in a greenfield codebase.
|
|
4
|
+
* If a project root contains several of these, it's likely DDD-structured.
|
|
5
|
+
*/
|
|
6
|
+
export const GREENFIELD_INDICATORS = [
|
|
7
|
+
"domain",
|
|
8
|
+
"application",
|
|
9
|
+
"infrastructure",
|
|
10
|
+
"presentation",
|
|
11
|
+
"interfaces",
|
|
12
|
+
"use-cases",
|
|
13
|
+
"usecases",
|
|
14
|
+
"use_cases",
|
|
15
|
+
"entities",
|
|
16
|
+
"value-objects",
|
|
17
|
+
"repositories",
|
|
18
|
+
"services",
|
|
19
|
+
"aggregates",
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Patterns that indicate a legacy codebase with structural problems.
|
|
23
|
+
* Files matching these patterns suggest monolithic architecture.
|
|
24
|
+
*/
|
|
25
|
+
export const LEGACY_INDICATORS = [
|
|
26
|
+
"utils",
|
|
27
|
+
"helpers",
|
|
28
|
+
"common",
|
|
29
|
+
"misc",
|
|
30
|
+
"lib",
|
|
31
|
+
"shared",
|
|
32
|
+
];
|
|
33
|
+
// ── Analysis Mode Detection ───────────────────────────────────────────
|
|
34
|
+
/**
|
|
35
|
+
* Detect whether a project should use greenfield (Path A) or legacy (Path B)
|
|
36
|
+
* analysis based on scan results and configuration thresholds.
|
|
37
|
+
*
|
|
38
|
+
* Greenfield criteria (ALL must be true):
|
|
39
|
+
* 1. DDD directory structure detected (domain/, application/, etc.)
|
|
40
|
+
* 2. SOLID patterns present (small files, clear separation)
|
|
41
|
+
* 3. Low ratio of large files (below legacyRatio threshold)
|
|
42
|
+
*
|
|
43
|
+
* If any criterion fails → legacy mode.
|
|
44
|
+
*
|
|
45
|
+
* @param scan - Project scan result with file stats and structure indicators
|
|
46
|
+
* @param config - Analysis configuration with thresholds
|
|
47
|
+
* @returns The detected analysis mode
|
|
48
|
+
*/
|
|
49
|
+
export function detectAnalysisMode(scan, config) {
|
|
50
|
+
if (!scan.hasDddStructure) {
|
|
51
|
+
return "legacy";
|
|
52
|
+
}
|
|
53
|
+
if (!scan.hasSolidPatterns) {
|
|
54
|
+
return "legacy";
|
|
55
|
+
}
|
|
56
|
+
if (scan.largeFileRatio >= config.legacyRatio) {
|
|
57
|
+
return "legacy";
|
|
58
|
+
}
|
|
59
|
+
return "greenfield";
|
|
60
|
+
}
|
|
61
|
+
// ── Greenfield Map Building (Path A) ──────────────────────────────────
|
|
62
|
+
/** DDD layer names for directory-based domain inference. */
|
|
63
|
+
const DDD_LAYERS = [
|
|
64
|
+
"domain",
|
|
65
|
+
"application",
|
|
66
|
+
"infrastructure",
|
|
67
|
+
"tools",
|
|
68
|
+
"hooks",
|
|
69
|
+
"presentation",
|
|
70
|
+
"interfaces",
|
|
71
|
+
];
|
|
72
|
+
/**
|
|
73
|
+
* Build a domain map for a greenfield (DDD-structured) codebase.
|
|
74
|
+
* Infers bounded contexts from directory structure without LSP or LLM.
|
|
75
|
+
*
|
|
76
|
+
* Strategy: Look for directories under DDD layer folders.
|
|
77
|
+
* e.g., src/domain/kanban/ → bounded context "kanban"
|
|
78
|
+
* src/domain/rag/ → bounded context "rag"
|
|
79
|
+
*
|
|
80
|
+
* @param scan - Project scan result
|
|
81
|
+
* @param config - Analysis configuration
|
|
82
|
+
* @returns Array of bounded contexts inferred from paths
|
|
83
|
+
*/
|
|
84
|
+
export function buildGreenfieldMap(scan, config) {
|
|
85
|
+
// Respect maxFiles limit from configuration
|
|
86
|
+
const filesToAnalyze = scan.files.slice(0, config.maxFiles);
|
|
87
|
+
// Group files by inferred bounded context
|
|
88
|
+
const contextMap = new Map();
|
|
89
|
+
for (const file of filesToAnalyze) {
|
|
90
|
+
const contextName = inferBoundedContext(file.relativePath);
|
|
91
|
+
if (contextName !== "unknown") {
|
|
92
|
+
const files = contextMap.get(contextName) ?? [];
|
|
93
|
+
files.push(file.relativePath);
|
|
94
|
+
contextMap.set(contextName, files);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Build BoundedContext objects
|
|
98
|
+
const contexts = [];
|
|
99
|
+
for (const [name, files] of contextMap) {
|
|
100
|
+
const entities = extractEntitiesFromPaths(files);
|
|
101
|
+
contexts.push({
|
|
102
|
+
name,
|
|
103
|
+
responsibility: `Bounded context "${name}" inferred from directory structure`,
|
|
104
|
+
files,
|
|
105
|
+
entities,
|
|
106
|
+
aggregates: [],
|
|
107
|
+
dependencies: [],
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return contexts;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Infer bounded context name from a file's relative path.
|
|
114
|
+
* Looks for directories immediately under DDD layer folders.
|
|
115
|
+
*
|
|
116
|
+
* Examples:
|
|
117
|
+
* - "src/domain/kanban/entities.ts" → "kanban"
|
|
118
|
+
* - "src/application/rag/use-cases.ts" → "rag"
|
|
119
|
+
* - "src/tools/governance-tools.ts" → "governance" (from filename)
|
|
120
|
+
* - "src/index.ts" → "unknown"
|
|
121
|
+
*/
|
|
122
|
+
export function inferBoundedContext(relativePath) {
|
|
123
|
+
const normalized = relativePath.replace(/\\/g, "/").toLowerCase();
|
|
124
|
+
const parts = normalized.split("/");
|
|
125
|
+
// Look for DDD layer → next directory is the bounded context
|
|
126
|
+
for (const layer of DDD_LAYERS) {
|
|
127
|
+
const idx = parts.indexOf(layer);
|
|
128
|
+
if (idx !== -1 && idx + 1 < parts.length) {
|
|
129
|
+
const candidate = parts[idx + 1];
|
|
130
|
+
// If the next part is a file (has extension), extract context from filename
|
|
131
|
+
if (candidate.includes(".")) {
|
|
132
|
+
return extractContextFromFilename(candidate);
|
|
133
|
+
}
|
|
134
|
+
return candidate;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return "unknown";
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Extract a bounded context name from a tool/hook filename.
|
|
141
|
+
* e.g., "kanban-tools.ts" → "kanban", "rag-tools.ts" → "rag"
|
|
142
|
+
*/
|
|
143
|
+
function extractContextFromFilename(filename) {
|
|
144
|
+
const withoutExt = filename.replace(/\.[^.]+$/, "");
|
|
145
|
+
const withoutSuffix = withoutExt.replace(/[-_](tools|hooks|tool|hook)$/, "");
|
|
146
|
+
return withoutSuffix || "unknown";
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Extract entity names from file paths within a bounded context.
|
|
150
|
+
* Looks for common DDD file naming patterns.
|
|
151
|
+
*/
|
|
152
|
+
function extractEntitiesFromPaths(files) {
|
|
153
|
+
const entities = [];
|
|
154
|
+
for (const file of files) {
|
|
155
|
+
const filename = file.split("/").pop() ?? "";
|
|
156
|
+
const withoutExt = filename.replace(/\.[^.]+$/, "");
|
|
157
|
+
if (withoutExt === "entities" ||
|
|
158
|
+
withoutExt === "entity" ||
|
|
159
|
+
withoutExt.endsWith("-entity") ||
|
|
160
|
+
withoutExt.endsWith("_entity")) {
|
|
161
|
+
entities.push(withoutExt);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return entities;
|
|
165
|
+
}
|
|
166
|
+
// ── Structural Graph Building ─────────────────────────────────────────
|
|
167
|
+
/**
|
|
168
|
+
* Build a StructuralGraph from LSP-extracted symbols and references.
|
|
169
|
+
* Used by Path B after LSP extraction to create the input for LLM analysis.
|
|
170
|
+
*
|
|
171
|
+
* @param fileSymbols - Map of file paths to their extracted symbols
|
|
172
|
+
* @param references - Cross-file references
|
|
173
|
+
* @returns Complete structural graph
|
|
174
|
+
*/
|
|
175
|
+
export function buildStructuralGraph(fileSymbols, references) {
|
|
176
|
+
let totalSymbols = 0;
|
|
177
|
+
for (const symbols of fileSymbols.values()) {
|
|
178
|
+
totalSymbols += countSymbols(symbols);
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
fileSymbolMap: fileSymbols,
|
|
182
|
+
references,
|
|
183
|
+
totalSymbols,
|
|
184
|
+
totalFiles: fileSymbols.size,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/** Recursively count symbols including children. */
|
|
188
|
+
function countSymbols(symbols) {
|
|
189
|
+
let count = 0;
|
|
190
|
+
for (const symbol of symbols) {
|
|
191
|
+
count += 1;
|
|
192
|
+
count += countSymbols(symbol.children);
|
|
193
|
+
}
|
|
194
|
+
return count;
|
|
195
|
+
}
|
|
196
|
+
// ── SRP Violation Detection ───────────────────────────────────────────
|
|
197
|
+
/**
|
|
198
|
+
* Detect SRP violations from scanned files based on line count thresholds.
|
|
199
|
+
* Files exceeding maxFileLines are flagged.
|
|
200
|
+
*
|
|
201
|
+
* @param files - Scanned files with line counts
|
|
202
|
+
* @param config - Configuration with maxFileLines threshold
|
|
203
|
+
* @returns Array of detected violations
|
|
204
|
+
*/
|
|
205
|
+
export function detectSrpViolations(files, config) {
|
|
206
|
+
const violations = [];
|
|
207
|
+
for (const file of files) {
|
|
208
|
+
if (file.lineCount > config.maxFileLines) {
|
|
209
|
+
const suggestedSplit = suggestFileSplit(file);
|
|
210
|
+
violations.push({
|
|
211
|
+
file: file.relativePath,
|
|
212
|
+
lines: file.lineCount,
|
|
213
|
+
issue: `File exceeds ${config.maxFileLines} line limit (${file.lineCount} lines)`,
|
|
214
|
+
suggestedSplit,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return violations;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Suggest how a large file might be split.
|
|
222
|
+
* Simple heuristic: propose splitting by DDD layer patterns.
|
|
223
|
+
*/
|
|
224
|
+
function suggestFileSplit(file) {
|
|
225
|
+
const filename = file.relativePath.split("/").pop() ?? "";
|
|
226
|
+
const withoutExt = filename.replace(/\.[^.]+$/, "");
|
|
227
|
+
const ext = file.extension;
|
|
228
|
+
// If file is very large, suggest common split patterns
|
|
229
|
+
if (file.lineCount > 2000) {
|
|
230
|
+
return [
|
|
231
|
+
`${withoutExt}-types${ext}`,
|
|
232
|
+
`${withoutExt}-helpers${ext}`,
|
|
233
|
+
`${withoutExt}-core${ext}`,
|
|
234
|
+
];
|
|
235
|
+
}
|
|
236
|
+
return [`${withoutExt}-a${ext}`, `${withoutExt}-b${ext}`];
|
|
237
|
+
}
|
|
238
|
+
// ── Document Generation ───────────────────────────────────────────────
|
|
239
|
+
/**
|
|
240
|
+
* Generate the final DomainMapDocument from analysis results.
|
|
241
|
+
* Combines structural and semantic analysis into a unified report.
|
|
242
|
+
*
|
|
243
|
+
* @param projectName - Name of the project
|
|
244
|
+
* @param mode - Analysis mode used
|
|
245
|
+
* @param language - Primary language of the project
|
|
246
|
+
* @param scan - Project scan result
|
|
247
|
+
* @param contexts - Identified bounded contexts
|
|
248
|
+
* @param graph - Structural graph (may be empty for greenfield)
|
|
249
|
+
* @param violations - SRP violations detected
|
|
250
|
+
* @param recommendedStructure - Recommended DDD structure
|
|
251
|
+
* @returns Complete domain map document
|
|
252
|
+
*/
|
|
253
|
+
export function generateMapDocument(projectName, mode, language, scan, contexts, graph, violations, recommendedStructure) {
|
|
254
|
+
return {
|
|
255
|
+
projectName,
|
|
256
|
+
mode,
|
|
257
|
+
language,
|
|
258
|
+
filesAnalyzed: scan.files.length,
|
|
259
|
+
boundedContexts: contexts,
|
|
260
|
+
structuralGraph: graph,
|
|
261
|
+
violations,
|
|
262
|
+
recommendedStructure,
|
|
263
|
+
generatedAt: new Date().toISOString(),
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
// ── Document Rendering ────────────────────────────────────────────────
|
|
267
|
+
/**
|
|
268
|
+
* Render a DomainMapDocument as a markdown string.
|
|
269
|
+
* Produces a human-readable report suitable for display or saving.
|
|
270
|
+
*
|
|
271
|
+
* @param doc - The domain map document to render
|
|
272
|
+
* @returns Formatted markdown string
|
|
273
|
+
*/
|
|
274
|
+
export function renderDocumentAsMarkdown(doc) {
|
|
275
|
+
const lines = [];
|
|
276
|
+
lines.push(`# Domain Map: ${doc.projectName}`);
|
|
277
|
+
lines.push("");
|
|
278
|
+
lines.push(`**Mode:** ${doc.mode}`);
|
|
279
|
+
lines.push(`**Language:** ${doc.language}`);
|
|
280
|
+
lines.push(`**Files Analyzed:** ${doc.filesAnalyzed}`);
|
|
281
|
+
lines.push(`**Generated:** ${doc.generatedAt}`);
|
|
282
|
+
lines.push("");
|
|
283
|
+
// Bounded Contexts
|
|
284
|
+
lines.push("## Bounded Contexts");
|
|
285
|
+
lines.push("");
|
|
286
|
+
if (doc.boundedContexts.length === 0) {
|
|
287
|
+
lines.push("_No bounded contexts identified._");
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
for (const ctx of doc.boundedContexts) {
|
|
291
|
+
lines.push(`### ${ctx.name}`);
|
|
292
|
+
lines.push("");
|
|
293
|
+
lines.push(`**Responsibility:** ${ctx.responsibility}`);
|
|
294
|
+
lines.push(`**Files:** ${ctx.files.length}`);
|
|
295
|
+
if (ctx.entities.length > 0) {
|
|
296
|
+
lines.push(`**Entities:** ${ctx.entities.join(", ")}`);
|
|
297
|
+
}
|
|
298
|
+
if (ctx.aggregates.length > 0) {
|
|
299
|
+
lines.push(`**Aggregates:** ${ctx.aggregates.join(", ")}`);
|
|
300
|
+
}
|
|
301
|
+
if (ctx.dependencies.length > 0) {
|
|
302
|
+
lines.push(`**Dependencies:** ${ctx.dependencies.join(", ")}`);
|
|
303
|
+
}
|
|
304
|
+
lines.push("");
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
// SRP Violations
|
|
308
|
+
if (doc.violations.length > 0) {
|
|
309
|
+
lines.push("## SRP Violations");
|
|
310
|
+
lines.push("");
|
|
311
|
+
for (const v of doc.violations) {
|
|
312
|
+
lines.push(`- **${v.file}** (${v.lines} lines): ${v.issue}`);
|
|
313
|
+
if (v.suggestedSplit.length > 0) {
|
|
314
|
+
lines.push(` - Suggested split: ${v.suggestedSplit.join(", ")}`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
lines.push("");
|
|
318
|
+
}
|
|
319
|
+
// Structural Graph Summary
|
|
320
|
+
lines.push("## Structural Summary");
|
|
321
|
+
lines.push("");
|
|
322
|
+
lines.push(`- Total symbols: ${doc.structuralGraph.totalSymbols}`);
|
|
323
|
+
lines.push(`- Total files: ${doc.structuralGraph.totalFiles}`);
|
|
324
|
+
lines.push(`- Cross-file references: ${doc.structuralGraph.references.length}`);
|
|
325
|
+
lines.push("");
|
|
326
|
+
// Recommended Structure
|
|
327
|
+
if (doc.recommendedStructure.length > 0) {
|
|
328
|
+
lines.push("## Recommended Structure");
|
|
329
|
+
lines.push("");
|
|
330
|
+
lines.push(doc.recommendedStructure);
|
|
331
|
+
lines.push("");
|
|
332
|
+
}
|
|
333
|
+
return lines.join("\n");
|
|
334
|
+
}
|
|
335
|
+
//# sourceMappingURL=services.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../../src/domain/domain-map/services.ts"],"names":[],"mappings":"AA6BA,yEAAyE;AAEzE;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACtD,QAAQ;IACR,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,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AAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QACrC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain Map — Value Objects
|
|
3
|
+
*
|
|
4
|
+
* Immutable value objects for the Domain Map bounded context.
|
|
5
|
+
* Zero external dependencies (pure domain).
|
|
6
|
+
*
|
|
7
|
+
* Supports two analysis paths:
|
|
8
|
+
* - Path A (Greenfield): DDD+SOLID codebases, <500 line files, path-based inference
|
|
9
|
+
* - Path B (Legacy): Monolithic codebases, 2000+ line files, LSP + LLM analysis
|
|
10
|
+
*
|
|
11
|
+
* SOLID: SRP — value object definitions only
|
|
12
|
+
* DDD: Value Objects compared by value, no identity
|
|
13
|
+
*/
|
|
14
|
+
/** Analysis mode determined by codebase structure heuristics. */
|
|
15
|
+
export type AnalysisMode = "greenfield" | "legacy";
|
|
16
|
+
/**
|
|
17
|
+
* Supported programming/config languages for LSP analysis.
|
|
18
|
+
* 18 languages, 16 distinct LSP server configurations.
|
|
19
|
+
*/
|
|
20
|
+
export type LanguageId = "typescript" | "javascript" | "python" | "swift" | "java" | "kotlin" | "csharp" | "go" | "c" | "cpp" | "objectivec" | "dart" | "html" | "json" | "yaml" | "shell" | "xml" | "rust";
|
|
21
|
+
/** All valid language IDs as a readonly array for runtime validation. */
|
|
22
|
+
export declare const ALL_LANGUAGE_IDS: readonly LanguageId[];
|
|
23
|
+
/**
|
|
24
|
+
* Map from file extension to LanguageId.
|
|
25
|
+
* Used to determine which LSP server to spawn for a given file.
|
|
26
|
+
*/
|
|
27
|
+
export declare const LANGUAGE_EXTENSIONS: ReadonlyMap<string, LanguageId>;
|
|
28
|
+
/** Check if a string is a valid LanguageId. */
|
|
29
|
+
export declare function isValidLanguageId(value: string): value is LanguageId;
|
|
30
|
+
/**
|
|
31
|
+
* Symbol kinds from the LSP specification (subset used for domain mapping).
|
|
32
|
+
* Maps to LSP SymbolKind enum values.
|
|
33
|
+
*/
|
|
34
|
+
export type SymbolKind = "file" | "module" | "namespace" | "package" | "class" | "method" | "property" | "field" | "constructor" | "enum" | "interface" | "function" | "variable" | "constant" | "string" | "number" | "boolean" | "array" | "object" | "key" | "null" | "enumMember" | "struct" | "event" | "operator" | "typeParameter";
|
|
35
|
+
/**
|
|
36
|
+
* Mapping from LSP SymbolKind numeric values to our domain SymbolKind strings.
|
|
37
|
+
* LSP spec: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#symbolKind
|
|
38
|
+
*/
|
|
39
|
+
export declare const LSP_SYMBOL_KIND_MAP: ReadonlyMap<number, SymbolKind>;
|
|
40
|
+
/**
|
|
41
|
+
* A range in a source file (0-based line/character positions).
|
|
42
|
+
* Matches LSP Range type for seamless integration.
|
|
43
|
+
*/
|
|
44
|
+
export interface SourceRange {
|
|
45
|
+
readonly startLine: number;
|
|
46
|
+
readonly startCharacter: number;
|
|
47
|
+
readonly endLine: number;
|
|
48
|
+
readonly endCharacter: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A code symbol extracted from LSP document symbols.
|
|
52
|
+
* Represents a class, function, method, interface, etc.
|
|
53
|
+
* Children form a hierarchy (e.g., class → methods).
|
|
54
|
+
*/
|
|
55
|
+
export interface CodeSymbol {
|
|
56
|
+
readonly name: string;
|
|
57
|
+
readonly kind: SymbolKind;
|
|
58
|
+
readonly range: SourceRange;
|
|
59
|
+
readonly children: readonly CodeSymbol[];
|
|
60
|
+
readonly containerName?: string;
|
|
61
|
+
}
|
|
62
|
+
/** Type of reference relationship between symbols. */
|
|
63
|
+
export type ReferenceType = "uses" | "implements" | "extends" | "calls";
|
|
64
|
+
/**
|
|
65
|
+
* A directional reference between two symbols.
|
|
66
|
+
* Used to build the dependency graph.
|
|
67
|
+
*/
|
|
68
|
+
export interface SymbolReference {
|
|
69
|
+
readonly fromFile: string;
|
|
70
|
+
readonly fromSymbol: string;
|
|
71
|
+
readonly toFile: string;
|
|
72
|
+
readonly toSymbol: string;
|
|
73
|
+
readonly type: ReferenceType;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The structural graph extracted from LSP analysis.
|
|
77
|
+
* Contains symbols per file and cross-file references.
|
|
78
|
+
* This is the input to the LLM semantic analysis stage.
|
|
79
|
+
*/
|
|
80
|
+
export interface StructuralGraph {
|
|
81
|
+
/** Map from file path to its symbols (hierarchy). */
|
|
82
|
+
readonly fileSymbolMap: ReadonlyMap<string, readonly CodeSymbol[]>;
|
|
83
|
+
/** Cross-file references extracted from LSP. */
|
|
84
|
+
readonly references: readonly SymbolReference[];
|
|
85
|
+
/** Total number of symbols across all files. */
|
|
86
|
+
readonly totalSymbols: number;
|
|
87
|
+
/** Total number of files analyzed. */
|
|
88
|
+
readonly totalFiles: number;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A bounded context identified in the domain map.
|
|
92
|
+
* In greenfield codebases, these map directly to directory structure.
|
|
93
|
+
* In legacy codebases, the LLM proposes these from structural analysis.
|
|
94
|
+
*/
|
|
95
|
+
export interface BoundedContext {
|
|
96
|
+
readonly name: string;
|
|
97
|
+
readonly responsibility: string;
|
|
98
|
+
readonly files: readonly string[];
|
|
99
|
+
readonly entities: readonly string[];
|
|
100
|
+
readonly aggregates: readonly string[];
|
|
101
|
+
readonly dependencies: readonly string[];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A Single Responsibility Principle violation detected in the codebase.
|
|
105
|
+
* Files exceeding line thresholds or containing multiple unrelated concerns.
|
|
106
|
+
*/
|
|
107
|
+
export interface SrpViolation {
|
|
108
|
+
readonly file: string;
|
|
109
|
+
readonly lines: number;
|
|
110
|
+
readonly issue: string;
|
|
111
|
+
readonly suggestedSplit: readonly string[];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Result of the LLM semantic analysis stage.
|
|
115
|
+
* The LLM examines the structural graph and proposes a DDD decomposition.
|
|
116
|
+
*/
|
|
117
|
+
export interface SemanticAnalysis {
|
|
118
|
+
readonly boundedContexts: readonly BoundedContext[];
|
|
119
|
+
readonly violations: readonly SrpViolation[];
|
|
120
|
+
readonly recommendedStructure: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The final output of the domain map analysis.
|
|
124
|
+
* Contains everything needed to render the domain map report.
|
|
125
|
+
*/
|
|
126
|
+
export interface DomainMapDocument {
|
|
127
|
+
readonly projectName: string;
|
|
128
|
+
readonly mode: AnalysisMode;
|
|
129
|
+
readonly language: LanguageId;
|
|
130
|
+
readonly filesAnalyzed: number;
|
|
131
|
+
readonly boundedContexts: readonly BoundedContext[];
|
|
132
|
+
readonly structuralGraph: StructuralGraph;
|
|
133
|
+
readonly violations: readonly SrpViolation[];
|
|
134
|
+
readonly recommendedStructure: string;
|
|
135
|
+
readonly generatedAt: string;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Configuration for the domain map analysis process.
|
|
139
|
+
* Controls thresholds, limits, and behavior.
|
|
140
|
+
*/
|
|
141
|
+
export interface AnalysisConfig {
|
|
142
|
+
/** Max lines before a file is flagged for SRP violation (default: 500). */
|
|
143
|
+
readonly maxFileLines: number;
|
|
144
|
+
/** Max files to analyze in a single run (default: 200). */
|
|
145
|
+
readonly maxFiles: number;
|
|
146
|
+
/** Threshold line count for legacy detection (default: 2000). */
|
|
147
|
+
readonly legacyThresholdLines: number;
|
|
148
|
+
/** Minimum ratio of large files to trigger legacy mode (default: 0.1). */
|
|
149
|
+
readonly legacyRatio: number;
|
|
150
|
+
}
|
|
151
|
+
/** Default analysis configuration. */
|
|
152
|
+
export declare const DEFAULT_ANALYSIS_CONFIG: AnalysisConfig;
|
|
153
|
+
/**
|
|
154
|
+
* Result of scanning a project directory.
|
|
155
|
+
* Used by the AnalysisRouter to detect the analysis mode.
|
|
156
|
+
*/
|
|
157
|
+
export interface ProjectScanResult {
|
|
158
|
+
/** Root directory of the project. */
|
|
159
|
+
readonly rootDir: string;
|
|
160
|
+
/** All source files discovered. */
|
|
161
|
+
readonly files: readonly ScannedFile[];
|
|
162
|
+
/** Detected primary language. */
|
|
163
|
+
readonly primaryLanguage: LanguageId;
|
|
164
|
+
/** Detected languages with file counts. */
|
|
165
|
+
readonly languageDistribution: ReadonlyMap<string, number>;
|
|
166
|
+
/** Whether DDD directory structure indicators are present. */
|
|
167
|
+
readonly hasDddStructure: boolean;
|
|
168
|
+
/** Whether SOLID patterns are detected (small files, clear separation). */
|
|
169
|
+
readonly hasSolidPatterns: boolean;
|
|
170
|
+
/** Ratio of files exceeding legacyThresholdLines. */
|
|
171
|
+
readonly largeFileRatio: number;
|
|
172
|
+
}
|
|
173
|
+
/** A single file discovered during project scanning. */
|
|
174
|
+
export interface ScannedFile {
|
|
175
|
+
readonly absolutePath: string;
|
|
176
|
+
readonly relativePath: string;
|
|
177
|
+
readonly extension: string;
|
|
178
|
+
readonly language: LanguageId;
|
|
179
|
+
readonly lineCount: number;
|
|
180
|
+
readonly sizeBytes: number;
|
|
181
|
+
}
|
|
182
|
+
/** Directories that should be skipped during project scanning. */
|
|
183
|
+
export declare const SCAN_SKIP_DIRECTORIES: ReadonlySet<string>;
|
|
184
|
+
/** Binary/non-source extensions to skip during scanning. */
|
|
185
|
+
export declare const SCAN_SKIP_EXTENSIONS: ReadonlySet<string>;
|
|
186
|
+
//# sourceMappingURL=value-objects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-objects.d.ts","sourceRoot":"","sources":["../../../src/domain/domain-map/value-objects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,iEAAiE;AACjE,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,QAAQ,CAAC;AAInD;;;GAGG;AACH,MAAM,MA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