@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
package/LICENSE
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Copyright (c) 2026 MC1 Global. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Developed by Julio Fabio de O. Chagas <julio.fabio@mc1global.com>
|
|
4
|
+
|
|
5
|
+
This software is proprietary and confidential.
|
|
6
|
+
Unauthorized copying, distribution, modification, or use of this software,
|
|
7
|
+
via any medium, is strictly prohibited.
|
|
8
|
+
|
|
9
|
+
This package is licensed exclusively for use by MC1 Global
|
|
10
|
+
and its authorized teams.
|
package/README.md
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# @mc1global/opencode-jarvis
|
|
2
|
+
|
|
3
|
+
A native [OpenCode](https://opencode.ai) plugin providing multi-agent development infrastructure: session memory, kanban project management, governance guardrails, token metrics tracking, RAG semantic search, Obsidian vault management, domain map analysis, workspace registry, environment management, and structured data tools.
|
|
4
|
+
|
|
5
|
+
Built with **Domain-Driven Design**, **SOLID principles**, and strict TypeScript.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
### 82 Tools across 11 categories
|
|
10
|
+
|
|
11
|
+
| Category | Count | Tools | Description |
|
|
12
|
+
| ----------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
13
|
+
| **Context Memory** | 8 | `context-session-*`, `context-todo-*`, `context-note-*`, `context-search` | Session lifecycle, todos, notes, cross-context search |
|
|
14
|
+
| **Kanban Cards** | 12 | `kanban-card-create`, `kanban-card-move`, `kanban-card-list`, `kanban-card-get`, `kanban-card-assign`, `kanban-card-assign-sprint`, `kanban-card-assign-epic`, `kanban-card-estimate`, `kanban-card-criteria`, `kanban-card-criteria-meet`, `kanban-card-delete`, `kanban-card-brief` | Card state machine, assignments, estimation, acceptance criteria, deletion, context briefings |
|
|
15
|
+
| **Kanban Board** | 15 | `kanban-sprint-*`, `kanban-epic-*`, `kanban-board-*`, `kanban-wip-check` | Sprint lifecycle, epic lifecycle (start/complete/update), board views, WIP limit checks |
|
|
16
|
+
| **Governance** | 2 | `governance-validate`, `governance-policies` | Policy validation and rule introspection |
|
|
17
|
+
| **Token Metrics** | 7 | `metrics-record`, `metrics-history`, `metrics-agent-report`, `metrics-card-report`, `metrics-sprint-report`, `metrics-summary`, `metrics-estimate` | Usage tracking, cost reports by agent/card/sprint, workspace summaries with recommendations |
|
|
18
|
+
| **RAG** | 8 | `rag-search`, `rag-index`, `rag-snippet`, `rag-update`, `rag-delete`, `rag-status`, `rag-oracle-search`, `rag-oracle-index` | Semantic code search via Vectra + Ollama embeddings |
|
|
19
|
+
| **Data** | 3 | `data-yaml-get`, `data-json-get`, `data-csv-query` | Structured data file access with dot-notation paths and CSV filtering |
|
|
20
|
+
| **Vault** | 11 | `vault-doc-*`, `vault-frontmatter-*`, `vault-table-*`, `vault-manage` | Obsidian vault document management, frontmatter, tables, smart facade |
|
|
21
|
+
| **Agent Communication** | 4 | `agent-sessions`, `agent-send`, `agent-notify`, `agent-dispatch` | Inter-session communication, card dispatch to other agents |
|
|
22
|
+
| **Domain Map** | 2 | `domain-map-analyze`, `domain-map-view` | DDD domain map analysis (greenfield + legacy modes) |
|
|
23
|
+
| **Workspace Registry** | 4 | `workspace-info`, `workspace-list`, `workspace-update`, `workspace-link` | Cross-project workspace registry with dependency tracking |
|
|
24
|
+
| **Environment** | 6 | `env-init`, `env-create`, `env-list`, `env-status`, `env-merge`, `env-delete` | Isolated container-use environments with kanban card linkage |
|
|
25
|
+
|
|
26
|
+
### 4 Hooks
|
|
27
|
+
|
|
28
|
+
| Hook | Type | Description |
|
|
29
|
+
| ---------------------- | --------------------------------- | ----------------------------------------------------- |
|
|
30
|
+
| **Context Compacting** | `experimental.session.compacting` | Injects session context when context window compacts |
|
|
31
|
+
| **Shell Environment** | `shell.env` | Injects JARVIS env vars into shell sessions |
|
|
32
|
+
| **Guardrails** | `tool.execute.before` | Governance policy enforcement on tool invocations |
|
|
33
|
+
| **Event Handlers** | `event` | Token usage tracking and cross-context event handling |
|
|
34
|
+
|
|
35
|
+
### 10 Governance Policies
|
|
36
|
+
|
|
37
|
+
6 core policies (file size, tool validation, grooming, WIP limits, test requirements, naming conventions) + 4 security policies (env dump prevention, shell env file access, sensitive file protection, shell sensitive command blocking).
|
|
38
|
+
|
|
39
|
+
## Architecture
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
jarvis-plugin/
|
|
43
|
+
src/
|
|
44
|
+
domain/ # Pure business logic, zero external deps
|
|
45
|
+
shared/ # WorkspaceId, EntityId, Result<T>
|
|
46
|
+
context-memory/ # Session, Todo, Note entities + services
|
|
47
|
+
kanban/ # Card state machine, Sprint, Epic, Grooming
|
|
48
|
+
governance/ # 10 policy rules, validation service
|
|
49
|
+
token-metrics/ # Token usage tracking entities
|
|
50
|
+
rag/ # RAG value objects, configuration
|
|
51
|
+
vault/ # Vault document, section, table entities
|
|
52
|
+
domain-map/ # Bounded context detection, domain analysis
|
|
53
|
+
workspace-registry/ # Cross-project workspace registration
|
|
54
|
+
environment/ # Container-use environment management
|
|
55
|
+
application/ # Use cases with DTOs (9 bounded contexts)
|
|
56
|
+
infrastructure/ # SQLite repos, Vectra, Ollama, filesystem adapters
|
|
57
|
+
tools/ # 13 tool modules (82 tools total)
|
|
58
|
+
hooks/ # 4 hooks (guardrails, compacting, events, shell-env)
|
|
59
|
+
tests/ # 1145+ tests across 37 test suites
|
|
60
|
+
obsidian-vault/ # 62+ documentation files
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Key constraints:**
|
|
64
|
+
|
|
65
|
+
- Max 500 lines per file (no exceptions)
|
|
66
|
+
- Domain layer has zero external dependencies
|
|
67
|
+
- ESM modules (`"type": "module"`)
|
|
68
|
+
- `exactOptionalPropertyTypes: true` + `verbatimModuleSyntax: true`
|
|
69
|
+
- 9 bounded contexts with strict DDD boundaries
|
|
70
|
+
|
|
71
|
+
## Installation
|
|
72
|
+
|
|
73
|
+
### Prerequisites
|
|
74
|
+
|
|
75
|
+
- [OpenCode](https://opencode.ai) CLI installed
|
|
76
|
+
- Node.js >= 20
|
|
77
|
+
- For RAG tools: [Ollama](https://ollama.ai) with `embeddinggemma` model
|
|
78
|
+
|
|
79
|
+
### From npm (recommended)
|
|
80
|
+
|
|
81
|
+
Add to your project's `opencode.json`:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"plugin": ["@mc1global/opencode-jarvis"]
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
OpenCode installs npm plugins automatically at startup. Requires access to the `@mc1global` org on npm.
|
|
90
|
+
|
|
91
|
+
### From local files (development)
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Clone
|
|
95
|
+
git clone <repo-url> jarvis-plugin
|
|
96
|
+
cd jarvis-plugin
|
|
97
|
+
|
|
98
|
+
# Install dependencies
|
|
99
|
+
npm install
|
|
100
|
+
|
|
101
|
+
# Build
|
|
102
|
+
npm run build
|
|
103
|
+
|
|
104
|
+
# Configure in OpenCode (add to your opencode.json)
|
|
105
|
+
{
|
|
106
|
+
"plugin": {
|
|
107
|
+
"jarvis": {
|
|
108
|
+
"path": "/path/to/jarvis-plugin"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### RAG Setup (Optional)
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Pull embedding model for semantic search
|
|
118
|
+
ollama pull embeddinggemma
|
|
119
|
+
|
|
120
|
+
# Index your workspace (from within OpenCode)
|
|
121
|
+
# Use the rag-index tool
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Development
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Run tests
|
|
128
|
+
npm test
|
|
129
|
+
|
|
130
|
+
# Type check
|
|
131
|
+
npm run lint
|
|
132
|
+
|
|
133
|
+
# Watch mode
|
|
134
|
+
npm run dev
|
|
135
|
+
|
|
136
|
+
# Check file line counts
|
|
137
|
+
npm run check:lines
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Storage
|
|
141
|
+
|
|
142
|
+
All data is stored locally:
|
|
143
|
+
|
|
144
|
+
- `.jarvis/jarvis.db` — SQLite database (sessions, todos, notes, kanban, metrics, environments)
|
|
145
|
+
- `.jarvis/rag/<workspace>/` — Vectra vector stores (RAG indexes)
|
|
146
|
+
- `~/.jarvis/registry.db` — Central workspace registry (cross-project)
|
|
147
|
+
|
|
148
|
+
The `JARVIS_HOME` environment variable overrides `~/.jarvis/` default.
|
|
149
|
+
|
|
150
|
+
## Dependencies
|
|
151
|
+
|
|
152
|
+
| Dependency | Purpose |
|
|
153
|
+
| -------------------------- | ---------------------------------------------- |
|
|
154
|
+
| `better-sqlite3` | Local SQLite database for all persistent state |
|
|
155
|
+
| `js-yaml` | YAML file parsing for data tools |
|
|
156
|
+
| `vectra` | Local vector store for RAG semantic search |
|
|
157
|
+
| `ollama` | Embedding generation via local Ollama models |
|
|
158
|
+
| `@langchain/textsplitters` | Code-aware text chunking for RAG indexing |
|
|
159
|
+
| `@opencode-ai/plugin` | OpenCode plugin SDK (peer dependency) |
|
|
160
|
+
|
|
161
|
+
## Test Coverage
|
|
162
|
+
|
|
163
|
+
- **1145+ tests** across 37 test suites
|
|
164
|
+
- Domain, application, infrastructure, and tools layers tested
|
|
165
|
+
- In-memory SQLite for fast, isolated integration tests
|
|
166
|
+
- `tsc --noEmit` zero errors
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
Copyright (c) 2026 MC1 Global. All rights reserved.
|
|
171
|
+
Developed by Julio Fabio de O. Chagas. See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Memory DTOs (Data Transfer Objects)
|
|
3
|
+
*
|
|
4
|
+
* Plain objects for crossing layer boundaries.
|
|
5
|
+
* Tools -> Use Cases (request DTOs), Use Cases -> Tools (response DTOs).
|
|
6
|
+
*
|
|
7
|
+
* SOLID: SRP - DTOs carry data, no logic
|
|
8
|
+
* DDD: Application layer boundary objects
|
|
9
|
+
*/
|
|
10
|
+
export interface StartSessionRequest {
|
|
11
|
+
readonly purpose: string;
|
|
12
|
+
readonly workspace: string;
|
|
13
|
+
readonly agentName?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface FinishSessionRequest {
|
|
16
|
+
readonly sessionId: string;
|
|
17
|
+
readonly summary?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CancelSessionRequest {
|
|
20
|
+
readonly sessionId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SessionResponse {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly workspace: string;
|
|
25
|
+
readonly purpose: string;
|
|
26
|
+
readonly state: string;
|
|
27
|
+
readonly agentName: string | undefined;
|
|
28
|
+
readonly startedAt: string;
|
|
29
|
+
readonly finishedAt: string | undefined;
|
|
30
|
+
readonly summary: string | undefined;
|
|
31
|
+
}
|
|
32
|
+
export interface ListSessionsRequest {
|
|
33
|
+
readonly workspace: string;
|
|
34
|
+
}
|
|
35
|
+
export interface GetActiveSessionRequest {
|
|
36
|
+
readonly workspace: string;
|
|
37
|
+
}
|
|
38
|
+
export interface CreateTodoRequest {
|
|
39
|
+
readonly content: string;
|
|
40
|
+
readonly workspace: string;
|
|
41
|
+
readonly priority?: number;
|
|
42
|
+
readonly sessionId?: string;
|
|
43
|
+
readonly tags?: readonly string[];
|
|
44
|
+
}
|
|
45
|
+
export interface CompleteTodoRequest {
|
|
46
|
+
readonly todoId: string;
|
|
47
|
+
}
|
|
48
|
+
export interface StartTodoRequest {
|
|
49
|
+
readonly todoId: string;
|
|
50
|
+
}
|
|
51
|
+
export interface CancelTodoRequest {
|
|
52
|
+
readonly todoId: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ListTodosRequest {
|
|
55
|
+
readonly workspace: string;
|
|
56
|
+
readonly status?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface TodoResponse {
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly content: string;
|
|
61
|
+
readonly status: string;
|
|
62
|
+
readonly priority: number;
|
|
63
|
+
readonly workspace: string;
|
|
64
|
+
readonly sessionId: string | undefined;
|
|
65
|
+
readonly tags: readonly string[];
|
|
66
|
+
readonly createdAt: string;
|
|
67
|
+
readonly updatedAt: string | undefined;
|
|
68
|
+
readonly completedAt: string | undefined;
|
|
69
|
+
}
|
|
70
|
+
export interface AddNoteRequest {
|
|
71
|
+
readonly content: string;
|
|
72
|
+
readonly workspace: string;
|
|
73
|
+
readonly type?: string;
|
|
74
|
+
readonly sessionId?: string;
|
|
75
|
+
readonly tags?: readonly string[];
|
|
76
|
+
}
|
|
77
|
+
export interface NoteResponse {
|
|
78
|
+
readonly id: string;
|
|
79
|
+
readonly content: string;
|
|
80
|
+
readonly type: string;
|
|
81
|
+
readonly workspace: string;
|
|
82
|
+
readonly sessionId: string | undefined;
|
|
83
|
+
readonly tags: readonly string[];
|
|
84
|
+
readonly createdAt: string;
|
|
85
|
+
}
|
|
86
|
+
export interface GetRecentNotesRequest {
|
|
87
|
+
readonly workspace: string;
|
|
88
|
+
readonly limit?: number;
|
|
89
|
+
}
|
|
90
|
+
export interface SearchContextRequest {
|
|
91
|
+
readonly query: string;
|
|
92
|
+
readonly workspace: string;
|
|
93
|
+
}
|
|
94
|
+
export interface SearchResultResponse {
|
|
95
|
+
readonly sourceType: string;
|
|
96
|
+
readonly sourceId: string;
|
|
97
|
+
readonly content: string;
|
|
98
|
+
readonly relevance: number;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=dtos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dtos.d.ts","sourceRoot":"","sources":["../../../src/application/context-memory/dtos.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WA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(request DTOs), Use Cases -> Tools (response DTOs).
|
|
6
|
+
*
|
|
7
|
+
* SOLID: SRP - DTOs carry data, no logic
|
|
8
|
+
* DDD: Application layer boundary objects
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=dtos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dtos.js","sourceRoot":"","sources":["../../../src/application/context-memory/dtos.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note Use Cases
|
|
3
|
+
*
|
|
4
|
+
* Application layer orchestration for notes and context search.
|
|
5
|
+
* Converts DTOs <-> domain types, delegates to domain services.
|
|
6
|
+
*
|
|
7
|
+
* SOLID: SRP - note operations and context search
|
|
8
|
+
* SOLID: DIP - depends on domain service abstractions
|
|
9
|
+
* DDD: Application Service pattern
|
|
10
|
+
*/
|
|
11
|
+
import type { Result } from "../../domain/shared/value-objects.js";
|
|
12
|
+
import type { NoteDomainService, ContextSearchService } from "../../domain/context-memory/services.js";
|
|
13
|
+
import type { AddNoteRequest, NoteResponse, GetRecentNotesRequest, SearchContextRequest, SearchResultResponse } from "./dtos.js";
|
|
14
|
+
export declare class NoteUseCases {
|
|
15
|
+
private readonly noteService;
|
|
16
|
+
private readonly searchService;
|
|
17
|
+
constructor(noteService: NoteDomainService, searchService: ContextSearchService);
|
|
18
|
+
addNote(request: AddNoteRequest): Promise<Result<NoteResponse>>;
|
|
19
|
+
getRecentNotes(request: GetRecentNotesRequest): Promise<Result<readonly NoteResponse[]>>;
|
|
20
|
+
searchContext(request: SearchContextRequest): Promise<Result<readonly SearchResultResponse[]>>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=note-use-cases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note-use-cases.d.ts","sourceRoot":"","sources":["../../../src/application/context-memory/note-use-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAOnE,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,WAAW,CAAC;AA0BnB,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,aAAa;gBADb,WAAW,EAAE,iBAAiB,EAC9B,aAAa,EAAE,oBAAoB;IAGhD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IA2B/D,cAAc,CAClB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,SAAS,YAAY,EAAE,CAAC,CAAC;IAQrC,aAAa,CACjB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,MAAM,CAAC,SAAS,oBAAoB,EAAE,CAAC,CAAC;CAapD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { WorkspaceId, ok, fail } from "../../domain/shared/value-objects.js";
|
|
2
|
+
import { NoteType, SessionId, } from "../../domain/context-memory/value-objects.js";
|
|
3
|
+
/** Maps a Note entity to a NoteResponse DTO. */
|
|
4
|
+
function toNoteResponse(note) {
|
|
5
|
+
return {
|
|
6
|
+
id: note.id.value,
|
|
7
|
+
content: note.content,
|
|
8
|
+
type: note.type,
|
|
9
|
+
workspace: note.workspace.value,
|
|
10
|
+
sessionId: note.sessionId?.value,
|
|
11
|
+
tags: note.tags,
|
|
12
|
+
createdAt: note.createdAt.toISO(),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** Validate and convert type string to NoteType enum. */
|
|
16
|
+
function parseNoteType(type) {
|
|
17
|
+
const valid = {
|
|
18
|
+
note: NoteType.Note,
|
|
19
|
+
decision: NoteType.Decision,
|
|
20
|
+
discovery: NoteType.Discovery,
|
|
21
|
+
blocker: NoteType.Blocker,
|
|
22
|
+
};
|
|
23
|
+
return valid[type] ?? null;
|
|
24
|
+
}
|
|
25
|
+
export class NoteUseCases {
|
|
26
|
+
noteService;
|
|
27
|
+
searchService;
|
|
28
|
+
constructor(noteService, searchService) {
|
|
29
|
+
this.noteService = noteService;
|
|
30
|
+
this.searchService = searchService;
|
|
31
|
+
}
|
|
32
|
+
async addNote(request) {
|
|
33
|
+
const workspace = WorkspaceId.create(request.workspace);
|
|
34
|
+
let noteType;
|
|
35
|
+
if (request.type !== undefined) {
|
|
36
|
+
const parsed = parseNoteType(request.type);
|
|
37
|
+
if (parsed === null) {
|
|
38
|
+
return fail(`Invalid note type: ${request.type}. Valid: note, decision, discovery, blocker`);
|
|
39
|
+
}
|
|
40
|
+
noteType = parsed;
|
|
41
|
+
}
|
|
42
|
+
const result = await this.noteService.addNote({
|
|
43
|
+
content: request.content,
|
|
44
|
+
workspace,
|
|
45
|
+
...(noteType !== undefined ? { type: noteType } : {}),
|
|
46
|
+
...(request.sessionId !== undefined
|
|
47
|
+
? { sessionId: SessionId.from(request.sessionId) }
|
|
48
|
+
: {}),
|
|
49
|
+
...(request.tags !== undefined ? { tags: request.tags } : {}),
|
|
50
|
+
});
|
|
51
|
+
if (!result.success)
|
|
52
|
+
return fail(result.error);
|
|
53
|
+
return ok(toNoteResponse(result.data));
|
|
54
|
+
}
|
|
55
|
+
async getRecentNotes(request) {
|
|
56
|
+
const workspace = WorkspaceId.create(request.workspace);
|
|
57
|
+
const limit = request.limit ?? 10;
|
|
58
|
+
const result = await this.noteService.getRecentNotes(workspace, limit);
|
|
59
|
+
if (!result.success)
|
|
60
|
+
return fail(result.error);
|
|
61
|
+
return ok(result.data.map(toNoteResponse));
|
|
62
|
+
}
|
|
63
|
+
async searchContext(request) {
|
|
64
|
+
const workspace = WorkspaceId.create(request.workspace);
|
|
65
|
+
const result = await this.searchService.search(request.query, workspace);
|
|
66
|
+
if (!result.success)
|
|
67
|
+
return fail(result.error);
|
|
68
|
+
return ok(result.data.map((r) => ({
|
|
69
|
+
sourceType: r.sourceType,
|
|
70
|
+
sourceId: r.sourceId,
|
|
71
|
+
content: r.content,
|
|
72
|
+
relevance: r.relevance,
|
|
73
|
+
})));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=note-use-cases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note-use-cases.js","sourceRoot":"","sources":["../../../src/application/context-memory/note-use-cases.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAE7E,OAAO,EACL,QAAQ,EACR,SAAS,GACV,MAAM,8CAA8C,CAAC;AAatD,gDAAgD;AAChD,SAAS,cAAc,CAAC,IAAU;IAChC,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK;QACjB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK;QAC/B,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK;QAChC,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;KAClC,CAAC;AACJ,CAAC;AAED,yDAAyD;AACzD,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,KAAK,GAA6B;QACtC,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,OAAO,EAAE,QAAQ,CAAC,OAAO;KAC1B,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC7B,CA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|
4
|
+
* Application layer orchestration for session lifecycle.
|
|
5
|
+
* Converts DTOs <-> domain types, delegates to domain services.
|
|
6
|
+
*
|
|
7
|
+
* SOLID: SRP - session operations only
|
|
8
|
+
* SOLID: DIP - depends on domain service abstractions
|
|
9
|
+
* DDD: Application Service pattern
|
|
10
|
+
*/
|
|
11
|
+
import type { Result } from "../../domain/shared/value-objects.js";
|
|
12
|
+
import type { SessionDomainService } from "../../domain/context-memory/services.js";
|
|
13
|
+
import type { StartSessionRequest, FinishSessionRequest, CancelSessionRequest, SessionResponse, ListSessionsRequest, GetActiveSessionRequest } from "./dtos.js";
|
|
14
|
+
export declare class SessionUseCases {
|
|
15
|
+
private readonly sessionService;
|
|
16
|
+
constructor(sessionService: SessionDomainService);
|
|
17
|
+
startSession(request: StartSessionRequest): Promise<Result<SessionResponse>>;
|
|
18
|
+
finishSession(request: FinishSessionRequest): Promise<Result<SessionResponse>>;
|
|
19
|
+
cancelSession(request: CancelSessionRequest): Promise<Result<SessionResponse>>;
|
|
20
|
+
listSessions(request: ListSessionsRequest): Promise<Result<readonly SessionResponse[]>>;
|
|
21
|
+
getActiveSession(request: GetActiveSessionRequest): Promise<Result<SessionResponse | null>>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=session-use-cases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-use-cases.d.ts","sourceRoot":"","sources":["../../../src/application/context-memory/session-use-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAInE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,WAAW,CAAC;AAgBnB,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,oBAAoB;IAE3D,YAAY,CAChB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IAa7B,aAAa,CACjB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IAU7B,aAAa,CACjB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IAO7B,YAAY,CAChB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,SAAS,eAAe,EAAE,CAAC,CAAC;IAOxC,gBAAgB,CACpB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;CAM3C"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { WorkspaceId, ok, fail } from "../../domain/shared/value-objects.js";
|
|
2
|
+
import { SessionId } from "../../domain/context-memory/value-objects.js";
|
|
3
|
+
/** Maps a Session entity to a SessionResponse DTO. */
|
|
4
|
+
function toResponse(session) {
|
|
5
|
+
return {
|
|
6
|
+
id: session.id.value,
|
|
7
|
+
workspace: session.workspace.value,
|
|
8
|
+
purpose: session.purpose,
|
|
9
|
+
state: session.state,
|
|
10
|
+
agentName: session.agentName,
|
|
11
|
+
startedAt: session.startedAt.toISO(),
|
|
12
|
+
finishedAt: session.finishedAt?.toISO(),
|
|
13
|
+
summary: session.summary,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export class SessionUseCases {
|
|
17
|
+
sessionService;
|
|
18
|
+
constructor(sessionService) {
|
|
19
|
+
this.sessionService = sessionService;
|
|
20
|
+
}
|
|
21
|
+
async startSession(request) {
|
|
22
|
+
const workspace = WorkspaceId.create(request.workspace);
|
|
23
|
+
const result = await this.sessionService.startSession({
|
|
24
|
+
purpose: request.purpose,
|
|
25
|
+
workspace,
|
|
26
|
+
...(request.agentName !== undefined
|
|
27
|
+
? { agentName: request.agentName }
|
|
28
|
+
: {}),
|
|
29
|
+
});
|
|
30
|
+
if (!result.success)
|
|
31
|
+
return fail(result.error);
|
|
32
|
+
return ok(toResponse(result.data));
|
|
33
|
+
}
|
|
34
|
+
async finishSession(request) {
|
|
35
|
+
const sessionId = SessionId.from(request.sessionId);
|
|
36
|
+
const result = await this.sessionService.finishSession(sessionId, request.summary);
|
|
37
|
+
if (!result.success)
|
|
38
|
+
return fail(result.error);
|
|
39
|
+
return ok(toResponse(result.data));
|
|
40
|
+
}
|
|
41
|
+
async cancelSession(request) {
|
|
42
|
+
const sessionId = SessionId.from(request.sessionId);
|
|
43
|
+
const result = await this.sessionService.cancelSession(sessionId);
|
|
44
|
+
if (!result.success)
|
|
45
|
+
return fail(result.error);
|
|
46
|
+
return ok(toResponse(result.data));
|
|
47
|
+
}
|
|
48
|
+
async listSessions(request) {
|
|
49
|
+
const workspace = WorkspaceId.create(request.workspace);
|
|
50
|
+
const result = await this.sessionService.listSessions(workspace);
|
|
51
|
+
if (!result.success)
|
|
52
|
+
return fail(result.error);
|
|
53
|
+
return ok(result.data.map(toResponse));
|
|
54
|
+
}
|
|
55
|
+
async getActiveSession(request) {
|
|
56
|
+
const workspace = WorkspaceId.create(request.workspace);
|
|
57
|
+
const result = await this.sessionService.getActiveSession(workspace);
|
|
58
|
+
if (!result.success)
|
|
59
|
+
return fail(result.error);
|
|
60
|
+
return ok(result.data ? toResponse(result.data) : null);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=session-use-cases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-use-cases.js","sourceRoot":"","sources":["../../../src/application/context-memory/session-use-cases.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAE7E,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAWzE,s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AM,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/C,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Todo Use Cases
|
|
3
|
+
*
|
|
4
|
+
* Application layer orchestration for todo lifecycle.
|
|
5
|
+
* Converts DTOs <-> domain types, delegates to domain services.
|
|
6
|
+
*
|
|
7
|
+
* SOLID: SRP - todo operations only
|
|
8
|
+
* SOLID: DIP - depends on domain service abstractions
|
|
9
|
+
* DDD: Application Service pattern
|
|
10
|
+
*/
|
|
11
|
+
import type { Result } from "../../domain/shared/value-objects.js";
|
|
12
|
+
import type { TodoDomainService } from "../../domain/context-memory/services.js";
|
|
13
|
+
import type { TodoRepository } from "../../domain/context-memory/repositories.js";
|
|
14
|
+
import type { CreateTodoRequest, CompleteTodoRequest, StartTodoRequest, CancelTodoRequest, ListTodosRequest, TodoResponse } from "./dtos.js";
|
|
15
|
+
export declare class TodoUseCases {
|
|
16
|
+
private readonly todoService;
|
|
17
|
+
private readonly todoRepo;
|
|
18
|
+
constructor(todoService: TodoDomainService, todoRepo: TodoRepository);
|
|
19
|
+
createTodo(request: CreateTodoRequest): Promise<Result<TodoResponse>>;
|
|
20
|
+
completeTodo(request: CompleteTodoRequest): Promise<Result<TodoResponse>>;
|
|
21
|
+
startTodo(request: StartTodoRequest): Promise<Result<TodoResponse>>;
|
|
22
|
+
cancelTodo(request: CancelTodoRequest): Promise<Result<TodoResponse>>;
|
|
23
|
+
listTodos(request: ListTodosRequest): Promise<Result<readonly TodoResponse[]>>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=todo-use-cases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"todo-use-cases.d.ts","sourceRoot":"","sources":["../../../src/application/context-memory/todo-use-cases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAQnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACb,MAAM,WAAW,CAAC;AA6BnB,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADR,WAAW,EAAE,iBAAiB,EAC9B,QAAQ,EAAE,cAAc;IAGrC,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAerE,YAAY,CAChB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAQ1B,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAYnE,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAYrE,SAAS,CACb,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,SAAS,YAAY,EAAE,CAAC,CAAC;CAiB5C"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { WorkspaceId, ok, fail } from "../../domain/shared/value-objects.js";
|
|
2
|
+
import { TodoId, TodoStatus, SessionId, } from "../../domain/context-memory/value-objects.js";
|
|
3
|
+
/** Maps a Todo entity to a TodoResponse DTO. */
|
|
4
|
+
function toResponse(todo) {
|
|
5
|
+
return {
|
|
6
|
+
id: todo.id.value,
|
|
7
|
+
content: todo.content,
|
|
8
|
+
status: todo.status,
|
|
9
|
+
priority: todo.priority,
|
|
10
|
+
workspace: todo.workspace.value,
|
|
11
|
+
sessionId: todo.sessionId?.value,
|
|
12
|
+
tags: todo.tags,
|
|
13
|
+
createdAt: todo.createdAt.toISO(),
|
|
14
|
+
updatedAt: todo.updatedAt?.toISO(),
|
|
15
|
+
completedAt: todo.completedAt?.toISO(),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** Validate and convert status string to TodoStatus enum. */
|
|
19
|
+
function parseStatus(status) {
|
|
20
|
+
const valid = {
|
|
21
|
+
pending: TodoStatus.Pending,
|
|
22
|
+
in_progress: TodoStatus.InProgress,
|
|
23
|
+
completed: TodoStatus.Completed,
|
|
24
|
+
cancelled: TodoStatus.Cancelled,
|
|
25
|
+
};
|
|
26
|
+
return valid[status] ?? null;
|
|
27
|
+
}
|
|
28
|
+
export class TodoUseCases {
|
|
29
|
+
todoService;
|
|
30
|
+
todoRepo;
|
|
31
|
+
constructor(todoService, todoRepo) {
|
|
32
|
+
this.todoService = todoService;
|
|
33
|
+
this.todoRepo = todoRepo;
|
|
34
|
+
}
|
|
35
|
+
async createTodo(request) {
|
|
36
|
+
const workspace = WorkspaceId.create(request.workspace);
|
|
37
|
+
const result = await this.todoService.createTodo({
|
|
38
|
+
content: request.content,
|
|
39
|
+
workspace,
|
|
40
|
+
...(request.priority !== undefined ? { priority: request.priority } : {}),
|
|
41
|
+
...(request.sessionId !== undefined
|
|
42
|
+
? { sessionId: SessionId.from(request.sessionId) }
|
|
43
|
+
: {}),
|
|
44
|
+
...(request.tags !== undefined ? { tags: request.tags } : {}),
|
|
45
|
+
});
|
|
46
|
+
if (!result.success)
|
|
47
|
+
return fail(result.error);
|
|
48
|
+
return ok(toResponse(result.data));
|
|
49
|
+
}
|
|
50
|
+
async completeTodo(request) {
|
|
51
|
+
const result = await this.todoService.completeTodo(TodoId.from(request.todoId));
|
|
52
|
+
if (!result.success)
|
|
53
|
+
return fail(result.error);
|
|
54
|
+
return ok(toResponse(result.data));
|
|
55
|
+
}
|
|
56
|
+
async startTodo(request) {
|
|
57
|
+
try {
|
|
58
|
+
const todo = await this.todoRepo.findById(TodoId.from(request.todoId));
|
|
59
|
+
if (todo === null)
|
|
60
|
+
return fail(`Todo not found: ${request.todoId}`);
|
|
61
|
+
todo.start();
|
|
62
|
+
await this.todoRepo.save(todo);
|
|
63
|
+
return ok(toResponse(todo));
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
return fail(`Failed to start todo: ${String(error)}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async cancelTodo(request) {
|
|
70
|
+
try {
|
|
71
|
+
const todo = await this.todoRepo.findById(TodoId.from(request.todoId));
|
|
72
|
+
if (todo === null)
|
|
73
|
+
return fail(`Todo not found: ${request.todoId}`);
|
|
74
|
+
todo.cancel();
|
|
75
|
+
await this.todoRepo.save(todo);
|
|
76
|
+
return ok(toResponse(todo));
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
return fail(`Failed to cancel todo: ${String(error)}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async listTodos(request) {
|
|
83
|
+
const workspace = WorkspaceId.create(request.workspace);
|
|
84
|
+
if (request.status !== undefined) {
|
|
85
|
+
const status = parseStatus(request.status);
|
|
86
|
+
if (status === null) {
|
|
87
|
+
return fail(`Invalid status: ${request.status}. Valid: pending, in_progress, completed, cancelled`);
|
|
88
|
+
}
|
|
89
|
+
const result = await this.todoService.listTodos(workspace, status);
|
|
90
|
+
if (!result.success)
|
|
91
|
+
return fail(result.error);
|
|
92
|
+
return ok(result.data.map(toResponse));
|
|
93
|
+
}
|
|
94
|
+
const result = await this.todoService.listTodos(workspace);
|
|
95
|
+
if (!result.success)
|
|
96
|
+
return fail(result.error);
|
|
97
|
+
return ok(result.data.map(toResponse));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=todo-use-cases.js.map
|