codehere 0.5.1-alpha → 0.5.3-alpha
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 +1 -1
- package/README.md +126 -102
- package/dist/application/agents/execution-agent.js +2 -2
- package/dist/application/agents/multi-agent-orchestrator.d.ts +0 -1
- package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
- package/dist/application/agents/multi-agent-orchestrator.js +2 -9
- package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
- package/dist/application/agents/planning-agent.d.ts.map +1 -1
- package/dist/application/agents/planning-agent.js +11 -15
- package/dist/application/agents/planning-agent.js.map +1 -1
- package/dist/application/services/context-importer.d.ts +71 -0
- package/dist/application/services/context-importer.d.ts.map +1 -0
- package/dist/application/services/context-importer.js +436 -0
- package/dist/application/services/context-importer.js.map +1 -0
- package/dist/application/services/context-manager.d.ts +132 -0
- package/dist/application/services/context-manager.d.ts.map +1 -0
- package/dist/application/services/context-manager.js +369 -0
- package/dist/application/services/context-manager.js.map +1 -0
- package/dist/application/services/dependency-container.d.ts.map +1 -1
- package/dist/application/services/dependency-container.js +7 -5
- package/dist/application/services/dependency-container.js.map +1 -1
- package/dist/application/services/intelligent-router.d.ts +8 -5
- package/dist/application/services/intelligent-router.d.ts.map +1 -1
- package/dist/application/services/intelligent-router.js +78 -82
- package/dist/application/services/intelligent-router.js.map +1 -1
- package/dist/application/services/token-counting-service.d.ts +87 -0
- package/dist/application/services/token-counting-service.d.ts.map +1 -0
- package/dist/application/services/token-counting-service.js +196 -0
- package/dist/application/services/token-counting-service.js.map +1 -0
- package/dist/application/use-cases/ask-question-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/ask-question-use-case.js +109 -21
- package/dist/application/use-cases/ask-question-use-case.js.map +1 -1
- package/dist/application/use-cases/edit-file-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/edit-file-use-case.js +19 -0
- package/dist/application/use-cases/edit-file-use-case.js.map +1 -1
- package/dist/application/use-cases/planning-use-case.d.ts +1 -14
- package/dist/application/use-cases/planning-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/planning-use-case.js +2 -109
- package/dist/application/use-cases/planning-use-case.js.map +1 -1
- package/dist/chat.d.ts.map +1 -1
- package/dist/chat.js +6 -17
- package/dist/chat.js.map +1 -1
- package/dist/domain/entities/conversation-context.d.ts +245 -0
- package/dist/domain/entities/conversation-context.d.ts.map +1 -0
- package/dist/domain/entities/conversation-context.js +50 -0
- package/dist/domain/entities/conversation-context.js.map +1 -0
- package/dist/domain/entities/memory.d.ts.map +1 -1
- package/dist/domain/interfaces/context-repository.interface.d.ts +71 -0
- package/dist/domain/interfaces/context-repository.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/context-repository.interface.js +10 -0
- package/dist/domain/interfaces/context-repository.interface.js.map +1 -0
- package/dist/domain/services/query-intent-classifier.d.ts.map +1 -1
- package/dist/domain/services/query-intent-classifier.js +37 -23
- package/dist/domain/services/query-intent-classifier.js.map +1 -1
- package/dist/embed.d.ts.map +1 -1
- package/dist/embed.js +8 -3
- package/dist/embed.js.map +1 -1
- package/dist/index.js +267 -143
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.js +14 -5
- package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
- package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -1
- package/dist/infrastructure/ai/provider-ai-service.js +64 -14
- package/dist/infrastructure/ai/provider-ai-service.js.map +1 -1
- package/dist/infrastructure/config/config-manager.d.ts +78 -9
- package/dist/infrastructure/config/config-manager.d.ts.map +1 -1
- package/dist/infrastructure/config/config-manager.js +127 -9
- package/dist/infrastructure/config/config-manager.js.map +1 -1
- package/dist/infrastructure/context/conversation-context.d.ts +39 -12
- package/dist/infrastructure/context/conversation-context.d.ts.map +1 -1
- package/dist/infrastructure/context/conversation-context.js +91 -4
- package/dist/infrastructure/context/conversation-context.js.map +1 -1
- package/dist/infrastructure/context/direct-context-provider.d.ts +18 -0
- package/dist/infrastructure/context/direct-context-provider.d.ts.map +1 -0
- package/dist/infrastructure/context/direct-context-provider.js +222 -0
- package/dist/infrastructure/context/direct-context-provider.js.map +1 -0
- package/dist/infrastructure/context/git-context-provider.d.ts +30 -0
- package/dist/infrastructure/context/git-context-provider.d.ts.map +1 -0
- package/dist/infrastructure/context/git-context-provider.js +140 -0
- package/dist/infrastructure/context/git-context-provider.js.map +1 -0
- package/dist/infrastructure/context/project-context-loader.d.ts +35 -0
- package/dist/infrastructure/context/project-context-loader.d.ts.map +1 -0
- package/dist/infrastructure/context/project-context-loader.js +184 -0
- package/dist/infrastructure/context/project-context-loader.js.map +1 -0
- package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -1
- package/dist/infrastructure/cost/cost-tracker.js +3 -2
- package/dist/infrastructure/cost/cost-tracker.js.map +1 -1
- package/dist/infrastructure/cost/session-token-tracker.d.ts +68 -0
- package/dist/infrastructure/cost/session-token-tracker.d.ts.map +1 -0
- package/dist/infrastructure/cost/session-token-tracker.js +178 -0
- package/dist/infrastructure/cost/session-token-tracker.js.map +1 -0
- package/dist/infrastructure/index.d.ts +1 -0
- package/dist/infrastructure/index.d.ts.map +1 -1
- package/dist/infrastructure/index.js +1 -2
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/infrastructure/observability/execution-tracer.d.ts +21 -0
- package/dist/infrastructure/observability/execution-tracer.d.ts.map +1 -1
- package/dist/infrastructure/observability/execution-tracer.js +157 -4
- package/dist/infrastructure/observability/execution-tracer.js.map +1 -1
- package/dist/infrastructure/protocols/a2a-metadata.js +1 -1
- package/dist/infrastructure/protocols/mcp-oauth.js +1 -1
- package/dist/infrastructure/providers/cohere-provider.d.ts +1 -2
- package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/cohere-provider.js +44 -42
- package/dist/infrastructure/providers/cohere-provider.js.map +1 -1
- package/dist/infrastructure/providers/fake-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/fake-provider.js +8 -0
- package/dist/infrastructure/providers/fake-provider.js.map +1 -1
- package/dist/infrastructure/providers/local-llm-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/local-llm-provider.js +8 -2
- package/dist/infrastructure/providers/local-llm-provider.js.map +1 -1
- package/dist/infrastructure/providers/openai-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/openai-provider.js +40 -7
- package/dist/infrastructure/providers/openai-provider.js.map +1 -1
- package/dist/infrastructure/providers/openrouter-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/openrouter-provider.js +13 -7
- package/dist/infrastructure/providers/openrouter-provider.js.map +1 -1
- package/dist/infrastructure/security/enhanced-security-gate.d.ts +13 -0
- package/dist/infrastructure/security/enhanced-security-gate.d.ts.map +1 -1
- package/dist/infrastructure/security/enhanced-security-gate.js +56 -1
- package/dist/infrastructure/security/enhanced-security-gate.js.map +1 -1
- package/dist/infrastructure/security/input-validator.d.ts +17 -0
- package/dist/infrastructure/security/input-validator.d.ts.map +1 -1
- package/dist/infrastructure/security/input-validator.js +140 -25
- package/dist/infrastructure/security/input-validator.js.map +1 -1
- package/dist/infrastructure/storage/embeddings-path.d.ts.map +1 -1
- package/dist/infrastructure/storage/embeddings-path.js +14 -4
- package/dist/infrastructure/storage/embeddings-path.js.map +1 -1
- package/dist/infrastructure/storage/memory-stream-service.d.ts.map +1 -1
- package/dist/infrastructure/storage/memory-stream-service.js +58 -88
- package/dist/infrastructure/storage/memory-stream-service.js.map +1 -1
- package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/plan-repository.js +4 -5
- package/dist/infrastructure/storage/plan-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-context-repository.d.ts +95 -0
- package/dist/infrastructure/storage/sqlite-context-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/sqlite-context-repository.js +467 -0
- package/dist/infrastructure/storage/sqlite-context-repository.js.map +1 -0
- package/dist/infrastructure/storage/sqlite-decision-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-decision-repository.js +4 -8
- package/dist/infrastructure/storage/sqlite-decision-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.js +4 -8
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.js +4 -8
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-memory-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-memory-repository.js +4 -8
- package/dist/infrastructure/storage/sqlite-memory-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-pattern-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-pattern-repository.js +4 -8
- package/dist/infrastructure/storage/sqlite-pattern-repository.js.map +1 -1
- package/dist/infrastructure/storage/task-repository.d.ts +0 -1
- package/dist/infrastructure/storage/task-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/task-repository.js +2 -13
- package/dist/infrastructure/storage/task-repository.js.map +1 -1
- package/dist/infrastructure/ux/cli-style-guide.d.ts +105 -0
- package/dist/infrastructure/ux/cli-style-guide.d.ts.map +1 -0
- package/dist/infrastructure/ux/cli-style-guide.js +220 -0
- package/dist/infrastructure/ux/cli-style-guide.js.map +1 -0
- package/dist/infrastructure/ux/progress-indicator.d.ts +49 -10
- package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.js +112 -9
- package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
- package/dist/infrastructure/validation/agent-feedback.d.ts +14 -1
- package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -1
- package/dist/infrastructure/validation/agent-feedback.js +57 -3
- package/dist/infrastructure/validation/agent-feedback.js.map +1 -1
- package/dist/parallel-processor.d.ts.map +1 -1
- package/dist/parallel-processor.js +39 -11
- package/dist/parallel-processor.js.map +1 -1
- package/dist/presentation/cli/commands/ask-command.d.ts +1 -2
- package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/ask-command.js +66 -150
- package/dist/presentation/cli/commands/ask-command.js.map +1 -1
- package/dist/presentation/cli/commands/audit-command.d.ts +13 -0
- package/dist/presentation/cli/commands/audit-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/audit-command.js +96 -0
- package/dist/presentation/cli/commands/audit-command.js.map +1 -0
- package/dist/presentation/cli/commands/config-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/config-command.js +2 -14
- package/dist/presentation/cli/commands/config-command.js.map +1 -1
- package/dist/presentation/cli/commands/context-command.d.ts +32 -0
- package/dist/presentation/cli/commands/context-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/context-command.js +295 -0
- package/dist/presentation/cli/commands/context-command.js.map +1 -0
- package/dist/presentation/cli/commands/context-helper.d.ts +16 -0
- package/dist/presentation/cli/commands/context-helper.d.ts.map +1 -0
- package/dist/presentation/cli/commands/context-helper.js +88 -0
- package/dist/presentation/cli/commands/context-helper.js.map +1 -0
- package/dist/presentation/cli/commands/decision-command.js +6 -23
- package/dist/presentation/cli/commands/decision-command.js.map +1 -1
- package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/fix-command.js +19 -23
- package/dist/presentation/cli/commands/fix-command.js.map +1 -1
- package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/help-command.js +1 -21
- package/dist/presentation/cli/commands/help-command.js.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.d.ts +0 -1
- package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.js +19 -126
- package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
- package/dist/presentation/cli/commands/plan-command.d.ts +0 -1
- package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/plan-command.js +42 -132
- package/dist/presentation/cli/commands/plan-command.js.map +1 -1
- package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/react-command.js +1 -5
- package/dist/presentation/cli/commands/react-command.js.map +1 -1
- package/dist/presentation/cli/commands/review-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/review-command.js +2 -21
- package/dist/presentation/cli/commands/review-command.js.map +1 -1
- package/dist/presentation/cli/commands/smart-command.d.ts +3 -0
- package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/smart-command.js +127 -93
- package/dist/presentation/cli/commands/smart-command.js.map +1 -1
- package/dist/presentation/cli/commands/status-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/status-command.js +1 -5
- package/dist/presentation/cli/commands/status-command.js.map +1 -1
- package/dist/presentation/cli/commands/trust-command.d.ts +28 -0
- package/dist/presentation/cli/commands/trust-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/trust-command.js +301 -0
- package/dist/presentation/cli/commands/trust-command.js.map +1 -0
- package/dist/presentation/cli/error-display.d.ts.map +1 -1
- package/dist/presentation/cli/error-display.js +17 -75
- package/dist/presentation/cli/error-display.js.map +1 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +5 -18
- package/dist/search.js.map +1 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +221 -57
- package/dist/session.js.map +1 -1
- package/dist/token-optimizer.d.ts.map +1 -1
- package/dist/token-optimizer.js +6 -1
- package/dist/token-optimizer.js.map +1 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +0 -3
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/git-tool.js +7 -7
- package/dist/tools/git-tool.js.map +1 -1
- package/dist/ui.d.ts +0 -5
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +0 -19
- package/dist/ui.js.map +1 -1
- package/dist/utils/provider-check.d.ts +21 -0
- package/dist/utils/provider-check.d.ts.map +1 -0
- package/dist/utils/provider-check.js +124 -0
- package/dist/utils/provider-check.js.map +1 -0
- package/package.json +16 -13
- package/dist/application/agents/documentation-agent.d.ts +0 -24
- package/dist/application/agents/documentation-agent.d.ts.map +0 -1
- package/dist/application/agents/documentation-agent.js +0 -399
- package/dist/application/agents/documentation-agent.js.map +0 -1
- package/dist/application/agents/product-requirements-agent.d.ts +0 -21
- package/dist/application/agents/product-requirements-agent.d.ts.map +0 -1
- package/dist/application/agents/product-requirements-agent.js +0 -247
- package/dist/application/agents/product-requirements-agent.js.map +0 -1
- package/dist/application/reasoning/multi-model-planning-strategy.d.ts +0 -21
- package/dist/application/reasoning/multi-model-planning-strategy.d.ts.map +0 -1
- package/dist/application/reasoning/multi-model-planning-strategy.js +0 -158
- package/dist/application/reasoning/multi-model-planning-strategy.js.map +0 -1
- package/dist/application/reasoning/reasoning-config.d.ts +0 -15
- package/dist/application/reasoning/reasoning-config.d.ts.map +0 -1
- package/dist/application/reasoning/reasoning-config.js +0 -50
- package/dist/application/reasoning/reasoning-config.js.map +0 -1
- package/dist/application/reasoning/reasoning-orchestrator.d.ts +0 -18
- package/dist/application/reasoning/reasoning-orchestrator.d.ts.map +0 -1
- package/dist/application/reasoning/reasoning-orchestrator.js +0 -170
- package/dist/application/reasoning/reasoning-orchestrator.js.map +0 -1
- package/dist/application/reasoning/reasoning-strategy.interface.d.ts +0 -24
- package/dist/application/reasoning/reasoning-strategy.interface.d.ts.map +0 -1
- package/dist/application/reasoning/reasoning-strategy.interface.js +0 -6
- package/dist/application/reasoning/reasoning-strategy.interface.js.map +0 -1
- package/dist/application/reasoning/role-provider-resolver.d.ts +0 -36
- package/dist/application/reasoning/role-provider-resolver.d.ts.map +0 -1
- package/dist/application/reasoning/role-provider-resolver.js +0 -74
- package/dist/application/reasoning/role-provider-resolver.js.map +0 -1
- package/dist/application/reasoning/simple-planning-strategy.d.ts +0 -22
- package/dist/application/reasoning/simple-planning-strategy.d.ts.map +0 -1
- package/dist/application/reasoning/simple-planning-strategy.js +0 -217
- package/dist/application/reasoning/simple-planning-strategy.js.map +0 -1
- package/dist/application/reasoning/types.d.ts +0 -65
- package/dist/application/reasoning/types.d.ts.map +0 -1
- package/dist/application/reasoning/types.js +0 -6
- package/dist/application/reasoning/types.js.map +0 -1
- package/dist/application/reasoning/validator-strategy.d.ts +0 -56
- package/dist/application/reasoning/validator-strategy.d.ts.map +0 -1
- package/dist/application/reasoning/validator-strategy.js +0 -103
- package/dist/application/reasoning/validator-strategy.js.map +0 -1
- package/dist/domain/entities/documentation.d.ts +0 -35
- package/dist/domain/entities/documentation.d.ts.map +0 -1
- package/dist/domain/entities/documentation.js +0 -6
- package/dist/domain/entities/documentation.js.map +0 -1
- package/dist/domain/entities/product-requirements.d.ts +0 -50
- package/dist/domain/entities/product-requirements.d.ts.map +0 -1
- package/dist/domain/entities/product-requirements.js +0 -6
- package/dist/domain/entities/product-requirements.js.map +0 -1
- package/dist/domain/interfaces/agent.interface.d.ts +0 -15
- package/dist/domain/interfaces/agent.interface.d.ts.map +0 -1
- package/dist/domain/interfaces/agent.interface.js +0 -6
- package/dist/domain/interfaces/agent.interface.js.map +0 -1
- package/dist/infrastructure/ai/fake-ai-service.d.ts +0 -22
- package/dist/infrastructure/ai/fake-ai-service.d.ts.map +0 -1
- package/dist/infrastructure/ai/fake-ai-service.js +0 -59
- package/dist/infrastructure/ai/fake-ai-service.js.map +0 -1
- package/dist/infrastructure/completion/completion-generator.d.ts +0 -42
- package/dist/infrastructure/completion/completion-generator.d.ts.map +0 -1
- package/dist/infrastructure/completion/completion-generator.js +0 -184
- package/dist/infrastructure/completion/completion-generator.js.map +0 -1
- package/dist/infrastructure/security/network-guard.d.ts +0 -8
- package/dist/infrastructure/security/network-guard.d.ts.map +0 -1
- package/dist/infrastructure/security/network-guard.js +0 -70
- package/dist/infrastructure/security/network-guard.js.map +0 -1
- package/dist/infrastructure/security/offline.d.ts +0 -16
- package/dist/infrastructure/security/offline.d.ts.map +0 -1
- package/dist/infrastructure/security/offline.js +0 -24
- package/dist/infrastructure/security/offline.js.map +0 -1
- package/dist/infrastructure/storage/sqljs-init.d.ts +0 -8
- package/dist/infrastructure/storage/sqljs-init.d.ts.map +0 -1
- package/dist/infrastructure/storage/sqljs-init.js +0 -23
- package/dist/infrastructure/storage/sqljs-init.js.map +0 -1
- package/dist/infrastructure/ux/hitl-review-portal.d.ts +0 -47
- package/dist/infrastructure/ux/hitl-review-portal.d.ts.map +0 -1
- package/dist/infrastructure/ux/hitl-review-portal.js +0 -228
- package/dist/infrastructure/ux/hitl-review-portal.js.map +0 -1
- package/dist/infrastructure/ux/meta-query.d.ts +0 -9
- package/dist/infrastructure/ux/meta-query.d.ts.map +0 -1
- package/dist/infrastructure/ux/meta-query.js +0 -63
- package/dist/infrastructure/ux/meta-query.js.map +0 -1
- package/dist/infrastructure/ux/proportional-friction.d.ts +0 -73
- package/dist/infrastructure/ux/proportional-friction.d.ts.map +0 -1
- package/dist/infrastructure/ux/proportional-friction.js +0 -200
- package/dist/infrastructure/ux/proportional-friction.js.map +0 -1
- package/dist/infrastructure/ux/repo-fingerprint.d.ts +0 -10
- package/dist/infrastructure/ux/repo-fingerprint.d.ts.map +0 -1
- package/dist/infrastructure/ux/repo-fingerprint.js +0 -55
- package/dist/infrastructure/ux/repo-fingerprint.js.map +0 -1
- package/dist/infrastructure/validation/feedback-stats.d.ts +0 -99
- package/dist/infrastructure/validation/feedback-stats.d.ts.map +0 -1
- package/dist/infrastructure/validation/feedback-stats.js +0 -173
- package/dist/infrastructure/validation/feedback-stats.js.map +0 -1
- package/dist/infrastructure/validation/trust-config.d.ts +0 -27
- package/dist/infrastructure/validation/trust-config.d.ts.map +0 -1
- package/dist/infrastructure/validation/trust-config.js +0 -113
- package/dist/infrastructure/validation/trust-config.js.map +0 -1
- package/dist/presentation/cli/commands/memory-command.d.ts +0 -17
- package/dist/presentation/cli/commands/memory-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/memory-command.js +0 -252
- package/dist/presentation/cli/commands/memory-command.js.map +0 -1
- package/dist/presentation/cli/keyboard-shortcuts.d.ts +0 -27
- package/dist/presentation/cli/keyboard-shortcuts.d.ts.map +0 -1
- package/dist/presentation/cli/keyboard-shortcuts.js +0 -77
- package/dist/presentation/cli/keyboard-shortcuts.js.map +0 -1
- package/dist/test_cohere.d.ts +0 -2
- package/dist/test_cohere.d.ts.map +0 -1
- package/dist/test_cohere.js +0 -68
- package/dist/test_cohere.js.map +0 -1
- package/dist/test_env.d.ts +0 -2
- package/dist/test_env.d.ts.map +0 -1
- package/dist/test_env.js +0 -24
- package/dist/test_env.js.map +0 -1
- package/dist/test_retrieval.d.ts +0 -2
- package/dist/test_retrieval.d.ts.map +0 -1
- package/dist/test_retrieval.js +0 -84
- package/dist/test_retrieval.js.map +0 -1
- package/dist/tools/bash.d 2.ts +0 -53
- package/dist/tools/bash.js 2.map +0 -1
- package/dist/tools/edit 2.js +0 -235
- package/dist/tools/edit.d.ts 2.map +0 -1
- package/dist/utils/logger.d.ts +0 -34
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -56
- package/dist/utils/logger.js.map +0 -1
|
@@ -18,88 +18,72 @@ export class MemoryStreamService {
|
|
|
18
18
|
* Store observation
|
|
19
19
|
*/
|
|
20
20
|
async recordObservation(description, metadata, codebaseId, codebasePath) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
metadata
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
await this.repository.store(memory);
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
// Best-effort: skip memory storage if embedding fails (non-critical)
|
|
43
|
-
// Don't throw - memory is optional
|
|
44
|
-
}
|
|
21
|
+
const embedding = await this.aiService.embed(description);
|
|
22
|
+
if (Array.isArray(embedding[0])) {
|
|
23
|
+
throw new Error('Expected single embedding');
|
|
24
|
+
}
|
|
25
|
+
const memory = {
|
|
26
|
+
type: 'observation',
|
|
27
|
+
description,
|
|
28
|
+
embedding: embedding,
|
|
29
|
+
timestamp: new Date(),
|
|
30
|
+
importance: this.calculateImportance(description),
|
|
31
|
+
lastAccessed: new Date(),
|
|
32
|
+
metadata: {
|
|
33
|
+
...metadata,
|
|
34
|
+
...(codebaseId && { codebaseId }),
|
|
35
|
+
...(codebasePath && { codebasePath }),
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
await this.repository.store(memory);
|
|
45
39
|
}
|
|
46
40
|
/**
|
|
47
41
|
* Store reflection
|
|
48
42
|
*/
|
|
49
43
|
async recordReflection(description, trajectory, reward, errors, codebaseId, codebasePath) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
await this.repository.store(memory);
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
// Best-effort: skip memory storage if embedding fails (non-critical)
|
|
74
|
-
}
|
|
44
|
+
const embedding = await this.aiService.embed(description);
|
|
45
|
+
if (Array.isArray(embedding[0])) {
|
|
46
|
+
throw new Error('Expected single embedding');
|
|
47
|
+
}
|
|
48
|
+
const memory = {
|
|
49
|
+
type: 'reflection',
|
|
50
|
+
description,
|
|
51
|
+
embedding: embedding,
|
|
52
|
+
timestamp: new Date(),
|
|
53
|
+
importance: 8, // Reflections are high importance
|
|
54
|
+
lastAccessed: new Date(),
|
|
55
|
+
metadata: {
|
|
56
|
+
trajectory,
|
|
57
|
+
reward,
|
|
58
|
+
errors,
|
|
59
|
+
...(codebaseId && { codebaseId }),
|
|
60
|
+
...(codebasePath && { codebasePath }),
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
await this.repository.store(memory);
|
|
75
64
|
}
|
|
76
65
|
/**
|
|
77
66
|
* Store plan
|
|
78
67
|
*/
|
|
79
68
|
async recordPlan(description, plan, codebaseId, codebasePath) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
await this.repository.store(memory);
|
|
99
|
-
}
|
|
100
|
-
catch (error) {
|
|
101
|
-
// Best-effort: skip memory storage if embedding fails (non-critical)
|
|
102
|
-
}
|
|
69
|
+
const embedding = await this.aiService.embed(description);
|
|
70
|
+
if (Array.isArray(embedding[0])) {
|
|
71
|
+
throw new Error('Expected single embedding');
|
|
72
|
+
}
|
|
73
|
+
const memory = {
|
|
74
|
+
type: 'plan',
|
|
75
|
+
description,
|
|
76
|
+
embedding: embedding,
|
|
77
|
+
timestamp: new Date(),
|
|
78
|
+
importance: 7,
|
|
79
|
+
lastAccessed: new Date(),
|
|
80
|
+
metadata: {
|
|
81
|
+
plan,
|
|
82
|
+
...(codebaseId && { codebaseId }),
|
|
83
|
+
...(codebasePath && { codebasePath }),
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
await this.repository.store(memory);
|
|
103
87
|
}
|
|
104
88
|
/**
|
|
105
89
|
* Retrieve relevant memories with optional reranking
|
|
@@ -107,14 +91,7 @@ export class MemoryStreamService {
|
|
|
107
91
|
* Performance: Uses embedding cache to avoid redundant API calls
|
|
108
92
|
*/
|
|
109
93
|
async retrieve(query, limit = 10, useRerank = true) {
|
|
110
|
-
|
|
111
|
-
try {
|
|
112
|
-
allMemories = await this.repository.getAll();
|
|
113
|
-
}
|
|
114
|
-
catch (error) {
|
|
115
|
-
// Best-effort: return empty if repository access fails
|
|
116
|
-
return [];
|
|
117
|
-
}
|
|
94
|
+
const allMemories = await this.repository.getAll();
|
|
118
95
|
if (allMemories.length === 0) {
|
|
119
96
|
return [];
|
|
120
97
|
}
|
|
@@ -159,14 +136,7 @@ export class MemoryStreamService {
|
|
|
159
136
|
*/
|
|
160
137
|
async retrieveByCodebase(query, codebaseId, limit = 10, useRerank = true) {
|
|
161
138
|
// Get all memories for this codebase first
|
|
162
|
-
|
|
163
|
-
try {
|
|
164
|
-
codebaseMemories = await this.repository.getAllByCodebase(codebaseId);
|
|
165
|
-
}
|
|
166
|
-
catch (error) {
|
|
167
|
-
// Best-effort: return empty if repository access fails
|
|
168
|
-
return [];
|
|
169
|
-
}
|
|
139
|
+
const codebaseMemories = await this.repository.getAllByCodebase(codebaseId);
|
|
170
140
|
if (codebaseMemories.length === 0) {
|
|
171
141
|
return [];
|
|
172
142
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-stream-service.js","sourceRoot":"","sources":["../../../src/infrastructure/storage/memory-stream-service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAG5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,OAAO,mBAAmB;IACtB,UAAU,CAAyB;IACnC,SAAS,CAAkB;IAC3B,SAAS,CAAa;IACtB,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAE7C,YAAY,UAAkC,EAAE,SAAqB;QACnE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,IAAI,eAAe,EAAE,CAAC,CAAC,uCAAuC;IACjF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB,CAAC,WAAmB,EAAE,QAAc,EAAE,UAAmB,EAAE,YAAqB;QACrG,
|
|
1
|
+
{"version":3,"file":"memory-stream-service.js","sourceRoot":"","sources":["../../../src/infrastructure/storage/memory-stream-service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAG5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,OAAO,mBAAmB;IACtB,UAAU,CAAyB;IACnC,SAAS,CAAkB;IAC3B,SAAS,CAAa;IACtB,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAE7C,YAAY,UAAkC,EAAE,SAAqB;QACnE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,IAAI,eAAe,EAAE,CAAC,CAAC,uCAAuC;IACjF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB,CAAC,WAAmB,EAAE,QAAc,EAAE,UAAmB,EAAE,YAAqB;QACrG,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAC1D,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,MAAM,MAAM,GAAW;YACrB,IAAI,EAAE,aAAa;YACnB,WAAW;YACX,SAAS,EAAE,SAAqB;YAChC,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,UAAU,EAAE,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC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,OAAO,CAAC,CAAC;QACX,CAAC;QAED,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;YAC7D,OAAO,CAAC,CAAC;QACX,CAAC;QAED,oBAAoB;QACpB,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnF,OAAO,CAAC,CAAC;QACX,CAAC;QAED,UAAU;QACV,OAAO,CAAC,CAAC;IACX,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-repository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/storage/plan-repository.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"plan-repository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/storage/plan-repository.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAgB1D,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACtC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAED,qBAAa,kBAAmB,YAAW,eAAe;IACxD,OAAO,CAAC,QAAQ,CAAS;;IASzB;;OAEG;IACG,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAcvC;;OAEG;IACG,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAgB/C;;OAEG;IACG,IAAI,CAAC,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAM/C;;OAEG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAUnE;;OAEG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAO5C;AAID,wBAAgB,iBAAiB,IAAI,eAAe,CAKnD"}
|
|
@@ -8,14 +8,13 @@ import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs';
|
|
|
8
8
|
import { join, dirname } from 'path';
|
|
9
9
|
import { fileURLToPath } from 'url';
|
|
10
10
|
import { randomUUID } from 'crypto';
|
|
11
|
+
import { getConfigManager } from '../config/config-manager.js';
|
|
11
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
13
|
const __dirname = dirname(__filename);
|
|
13
14
|
function getPlansDir() {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
return join(process.cwd(), '.codehere', 'plans');
|
|
15
|
+
const config = getConfigManager();
|
|
16
|
+
const dataDir = config.getDataDir();
|
|
17
|
+
return join(dataDir, 'plans');
|
|
19
18
|
}
|
|
20
19
|
export class FilePlanRepository {
|
|
21
20
|
plansDir;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-repository.js","sourceRoot":"","sources":["../../../src/infrastructure/storage/plan-repository.ts"],"names":[],"mappings":"AAAA;;;;;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AI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,QAAQ,MAAM,YAAY,CAAC,CAAC;QAC9C,CAAC;QAED,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC;QAC5C,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,MAAc;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,MAAM,OAAO,CAAC,CAAC;QACvD,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;YAC1C,UAAU,CAAC,QAAQ,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;CACF;AAED,IAAI,QAAQ,GAA2B,IAAI,CAAC;AAE5C,MAAM,UAAU,iBAAiB;IAC/B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;IACtC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infrastructure: SQLiteContextRepository
|
|
3
|
+
*
|
|
4
|
+
* Implements IContextRepository using SQLite for persistent storage
|
|
5
|
+
* of conversation contexts with auto-compaction support.
|
|
6
|
+
*
|
|
7
|
+
* Database Schema:
|
|
8
|
+
* - conversation_contexts: Main context metadata
|
|
9
|
+
* - conversation_messages: Individual messages
|
|
10
|
+
* - compaction_events: Compaction history
|
|
11
|
+
* - compacted_summaries: Summary information
|
|
12
|
+
*
|
|
13
|
+
* @since v0.5.0 (Context Continuity Feature)
|
|
14
|
+
*/
|
|
15
|
+
import type { IContextRepository } from '../../domain/interfaces/context-repository.interface.js';
|
|
16
|
+
import type { ConversationContext, ConversationMessage } from '../../domain/entities/conversation-context.js';
|
|
17
|
+
/**
|
|
18
|
+
* SQLite implementation of context repository
|
|
19
|
+
*/
|
|
20
|
+
export declare class SQLiteContextRepository implements IContextRepository {
|
|
21
|
+
private dbPath;
|
|
22
|
+
private db;
|
|
23
|
+
constructor();
|
|
24
|
+
/**
|
|
25
|
+
* Get or initialize database connection
|
|
26
|
+
*/
|
|
27
|
+
private getDb;
|
|
28
|
+
/**
|
|
29
|
+
* Initialize database schema
|
|
30
|
+
*/
|
|
31
|
+
private initializeSchema;
|
|
32
|
+
/**
|
|
33
|
+
* Save database to disk
|
|
34
|
+
*/
|
|
35
|
+
private saveDb;
|
|
36
|
+
/**
|
|
37
|
+
* Store a complete conversation context
|
|
38
|
+
*/
|
|
39
|
+
store(context: ConversationContext): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Store a single message
|
|
42
|
+
*/
|
|
43
|
+
private storeMessage;
|
|
44
|
+
/**
|
|
45
|
+
* Store compaction event
|
|
46
|
+
*/
|
|
47
|
+
private storeCompactionEvent;
|
|
48
|
+
/**
|
|
49
|
+
* Store summary
|
|
50
|
+
*/
|
|
51
|
+
private storeSummary;
|
|
52
|
+
/**
|
|
53
|
+
* Find context by session ID
|
|
54
|
+
*/
|
|
55
|
+
findById(sessionId: string): Promise<ConversationContext | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Find most recent context
|
|
58
|
+
*/
|
|
59
|
+
findLatest(): Promise<ConversationContext | null>;
|
|
60
|
+
/**
|
|
61
|
+
* Find all contexts
|
|
62
|
+
*/
|
|
63
|
+
findAll(limit?: number): Promise<ConversationContext[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Find contexts by source format
|
|
66
|
+
*/
|
|
67
|
+
findBySource(sourceFormat: string): Promise<ConversationContext[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Add message to existing context
|
|
70
|
+
*/
|
|
71
|
+
addMessage(sessionId: string, message: ConversationMessage): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Update context
|
|
74
|
+
*/
|
|
75
|
+
update(context: ConversationContext): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Delete context
|
|
78
|
+
*/
|
|
79
|
+
delete(sessionId: string): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Get session statistics
|
|
82
|
+
*/
|
|
83
|
+
getStats(sessionId: string): Promise<{
|
|
84
|
+
messageCount: number;
|
|
85
|
+
totalTokens: number;
|
|
86
|
+
compactionCount: number;
|
|
87
|
+
tokensSaved: number;
|
|
88
|
+
age: number;
|
|
89
|
+
} | null>;
|
|
90
|
+
/**
|
|
91
|
+
* Hydrate a complete context from database row
|
|
92
|
+
*/
|
|
93
|
+
private hydrateContext;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=sqlite-context-repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-context-repository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/storage/sqlite-context-repository.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EAIpB,MAAM,+CAA+C,CAAC;AAWvD;;GAEG;AACH,qBAAa,uBAAwB,YAAW,kBAAkB;IAChE,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,EAAE,CAAyB;;IAMnC;;OAEG;YACW,KAAK;IAuBnB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAoExB;;OAEG;IACH,OAAO,CAAC,MAAM;IAOd;;OAEG;IACG,KAAK,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IA6CxD;;OAEG;YACW,YAAY;IAqB1B;;OAEG;YACW,oBAAoB;IAsBlC;;OAEG;Y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