codehere 0.5.2-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 +17 -14
- 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
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shell Completion Generator
|
|
3
|
-
* Generates completion scripts for bash, zsh, and fish shells
|
|
4
|
-
*/
|
|
5
|
-
import { readFileSync, existsSync } from 'fs';
|
|
6
|
-
import { join } from 'path';
|
|
7
|
-
// All commands and their definitions
|
|
8
|
-
export const COMMAND_DEFINITIONS = {
|
|
9
|
-
'ask': {
|
|
10
|
-
name: 'ask',
|
|
11
|
-
description: 'Ask questions about your codebase',
|
|
12
|
-
options: [
|
|
13
|
-
{ flag: '--stream', description: 'Enable streaming output' },
|
|
14
|
-
{ flag: '--no-stream', description: 'Disable streaming output' },
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
'explain': {
|
|
18
|
-
name: 'explain',
|
|
19
|
-
description: 'Get detailed explanations of code files',
|
|
20
|
-
},
|
|
21
|
-
'plan': {
|
|
22
|
-
name: 'plan',
|
|
23
|
-
description: 'Generate hierarchical plan',
|
|
24
|
-
options: [
|
|
25
|
-
{ flag: '--execute', description: 'Execute the plan after generation' },
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
'orchestrate': {
|
|
29
|
-
name: 'orchestrate',
|
|
30
|
-
description: 'Orchestrate multi-agent workflows',
|
|
31
|
-
options: [
|
|
32
|
-
{ flag: '--mode <mode>', description: 'Mode: plan-only, execute-only, full' },
|
|
33
|
-
{ flag: '--plan-id <id>', description: 'Plan ID to load' },
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
'react': {
|
|
37
|
-
name: 'react',
|
|
38
|
-
description: 'Use ReAct reasoning loop',
|
|
39
|
-
options: [
|
|
40
|
-
{ flag: '--stream', description: 'Enable streaming output' },
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
'setup': {
|
|
44
|
-
name: 'setup',
|
|
45
|
-
description: 'Interactive setup wizard',
|
|
46
|
-
options: [
|
|
47
|
-
{ flag: '--force, -f', description: 'Force reconfiguration' },
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
'config': {
|
|
51
|
-
name: 'config',
|
|
52
|
-
description: 'Manage configuration',
|
|
53
|
-
subcommands: ['get', 'set', 'reset'],
|
|
54
|
-
dynamicCompletions: async (context) => {
|
|
55
|
-
// Dynamic completion for config keys
|
|
56
|
-
if (context.subcommand === 'get' || context.subcommand === 'set') {
|
|
57
|
-
return getConfigKeys();
|
|
58
|
-
}
|
|
59
|
-
return [];
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
'index': {
|
|
63
|
-
name: 'index',
|
|
64
|
-
description: 'Build semantic embeddings index',
|
|
65
|
-
options: [
|
|
66
|
-
{ flag: '--repo <path>, -r <path>', description: 'Repository path' },
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
'help': {
|
|
70
|
-
name: 'help',
|
|
71
|
-
description: 'Show help for commands',
|
|
72
|
-
},
|
|
73
|
-
'undo': {
|
|
74
|
-
name: 'undo',
|
|
75
|
-
description: 'Undo file changes',
|
|
76
|
-
subcommands: ['undo', 'list', 'restore'],
|
|
77
|
-
},
|
|
78
|
-
'trace': {
|
|
79
|
-
name: 'trace',
|
|
80
|
-
description: 'View execution traces',
|
|
81
|
-
subcommands: ['show', 'reproduce', 'list'],
|
|
82
|
-
},
|
|
83
|
-
'decision': {
|
|
84
|
-
name: 'decision',
|
|
85
|
-
description: 'Record and query architectural decisions',
|
|
86
|
-
subcommands: ['record', 'list', 'query', 'explain'],
|
|
87
|
-
},
|
|
88
|
-
'knowledge': {
|
|
89
|
-
name: 'knowledge',
|
|
90
|
-
description: 'Query preserved knowledge',
|
|
91
|
-
subcommands: ['query', 'list', 'summary', 'extract'],
|
|
92
|
-
},
|
|
93
|
-
'learning': {
|
|
94
|
-
name: 'learning',
|
|
95
|
-
description: 'View learning dashboard',
|
|
96
|
-
subcommands: ['overview', 'patterns', 'knowledge', 'insights'],
|
|
97
|
-
},
|
|
98
|
-
'cost': {
|
|
99
|
-
name: 'cost',
|
|
100
|
-
description: 'View API cost tracking',
|
|
101
|
-
subcommands: ['status', 'summary', 'run', 'reset'],
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Get all command names
|
|
106
|
-
*/
|
|
107
|
-
export function getAllCommands() {
|
|
108
|
-
return Object.keys(COMMAND_DEFINITIONS);
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Get command definition
|
|
112
|
-
*/
|
|
113
|
-
export function getCommandDefinition(command) {
|
|
114
|
-
return COMMAND_DEFINITIONS[command];
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Get subcommands for a command
|
|
118
|
-
*/
|
|
119
|
-
export function getSubcommands(command) {
|
|
120
|
-
const def = getCommandDefinition(command);
|
|
121
|
-
return def?.subcommands || [];
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Get options for a command
|
|
125
|
-
*/
|
|
126
|
-
export function getCommandOptions(command) {
|
|
127
|
-
const def = getCommandDefinition(command);
|
|
128
|
-
if (!def?.options)
|
|
129
|
-
return [];
|
|
130
|
-
return def.options.map(opt => {
|
|
131
|
-
// Extract flag names (e.g., "--force, -f" -> ["--force", "-f"])
|
|
132
|
-
const flags = opt.flag.split(',').map(f => f.trim());
|
|
133
|
-
// Return short and long flags
|
|
134
|
-
return flags.map(f => {
|
|
135
|
-
if (f.includes('<') || f.includes('[')) {
|
|
136
|
-
// Option with argument, return base flag
|
|
137
|
-
return f.split(/[<\[ ]/)[0];
|
|
138
|
-
}
|
|
139
|
-
return f;
|
|
140
|
-
});
|
|
141
|
-
}).flat();
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Get config keys dynamically
|
|
145
|
-
*/
|
|
146
|
-
async function getConfigKeys() {
|
|
147
|
-
try {
|
|
148
|
-
const configPath = join(process.cwd(), 'data', 'config.json');
|
|
149
|
-
if (existsSync(configPath)) {
|
|
150
|
-
const config = JSON.parse(readFileSync(configPath, 'utf-8'));
|
|
151
|
-
return Object.keys(config.preferences || {});
|
|
152
|
-
}
|
|
153
|
-
// Default config keys
|
|
154
|
-
return [
|
|
155
|
-
'autoCommit',
|
|
156
|
-
'temperature',
|
|
157
|
-
'maxResults',
|
|
158
|
-
'model',
|
|
159
|
-
'enableStreaming',
|
|
160
|
-
'enableSecurityScan',
|
|
161
|
-
'enableVerification',
|
|
162
|
-
];
|
|
163
|
-
}
|
|
164
|
-
catch {
|
|
165
|
-
return [
|
|
166
|
-
'autoCommit',
|
|
167
|
-
'temperature',
|
|
168
|
-
'maxResults',
|
|
169
|
-
'model',
|
|
170
|
-
'enableStreaming',
|
|
171
|
-
'enableSecurityScan',
|
|
172
|
-
'enableVerification',
|
|
173
|
-
];
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Generate file completions (for filepath arguments)
|
|
178
|
-
*/
|
|
179
|
-
export async function getFileCompletions(prefix) {
|
|
180
|
-
// This would need filesystem access - simplified for now
|
|
181
|
-
// In a real implementation, you'd list files matching the prefix
|
|
182
|
-
return [];
|
|
183
|
-
}
|
|
184
|
-
//# sourceMappingURL=completion-generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"completion-generator.js","sourceRoot":"","sources":["../../../src/infrastructure/completion/completion-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAiB5B,qCAAqC;AACrC,MAAM,CAAC,MAAM,mBAAmB,GAAsC;IACpE,KAAK,EAAE;QACL,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,yBAAyB,EAAE;YAC5D,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,0BAA0B,EAAE;SACjE;KACF;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,yCAAyC;KACvD;IACD,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,4BAA4B;QACzC,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,mCAAmC,EAAE;SACxE;KACF;IACD,aAAa,EAAE;QACb,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,qCAAqC,EAAE;YAC7E,EAAE,IAAI,EAA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,kBAAkB,CAAC,MAAc;IACrD,yDAAyD;IACzD,iEAAiE;IACjE,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type NetworkGuardOptions = {
|
|
2
|
-
allowLocalhost?: boolean;
|
|
3
|
-
allowHosts?: string[];
|
|
4
|
-
};
|
|
5
|
-
export declare function installNetworkGuard(options?: NetworkGuardOptions): void;
|
|
6
|
-
export declare function uninstallNetworkGuardForTestsOnly(): void;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=network-guard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"network-guard.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/security/network-guard.ts"],"names":[],"mappings":"AAYA,KAAK,mBAAmB,GAAG;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAsBF,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAkCvE;AAED,wBAAgB,iCAAiC,IAAI,IAAI,CAOxD"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Security: Network Guard
|
|
3
|
-
* Blocks outbound network calls when offline mode is enabled.
|
|
4
|
-
*
|
|
5
|
-
* Implementation strategy:
|
|
6
|
-
* - Patch global fetch (Node >= 18) to enforce a deny-by-default policy.
|
|
7
|
-
* - Allow localhost by default so local providers (Ollama/LM Studio) keep working.
|
|
8
|
-
*
|
|
9
|
-
* No new dependencies.
|
|
10
|
-
*/
|
|
11
|
-
import { isOfflineModeEnabled, getOfflineModeReason } from './offline.js';
|
|
12
|
-
let installed = false;
|
|
13
|
-
let originalFetch = null;
|
|
14
|
-
function isLocalhostHost(hostname) {
|
|
15
|
-
return hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '::1';
|
|
16
|
-
}
|
|
17
|
-
function getUrlFromInput(input) {
|
|
18
|
-
try {
|
|
19
|
-
if (typeof input === 'string')
|
|
20
|
-
return new URL(input);
|
|
21
|
-
if (input instanceof URL)
|
|
22
|
-
return input;
|
|
23
|
-
// Request
|
|
24
|
-
const anyInput = input;
|
|
25
|
-
if (anyInput?.url)
|
|
26
|
-
return new URL(String(anyInput.url));
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export function installNetworkGuard(options) {
|
|
34
|
-
if (installed)
|
|
35
|
-
return;
|
|
36
|
-
// Only install guard if offline mode is enabled.
|
|
37
|
-
if (!isOfflineModeEnabled())
|
|
38
|
-
return;
|
|
39
|
-
if (typeof globalThis.fetch !== 'function') {
|
|
40
|
-
// Nothing to guard (older runtime); offline enforcement will rely on provider gating.
|
|
41
|
-
installed = true;
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const allowLocalhost = options?.allowLocalhost !== false;
|
|
45
|
-
const allowHosts = new Set((options?.allowHosts || []).map(h => h.toLowerCase()));
|
|
46
|
-
originalFetch = globalThis.fetch.bind(globalThis);
|
|
47
|
-
globalThis.fetch = (async (input, init) => {
|
|
48
|
-
const url = getUrlFromInput(input);
|
|
49
|
-
if (url) {
|
|
50
|
-
const hostname = url.hostname.toLowerCase();
|
|
51
|
-
const allowed = (allowLocalhost && isLocalhostHost(hostname)) ||
|
|
52
|
-
allowHosts.has(hostname);
|
|
53
|
-
if (!allowed) {
|
|
54
|
-
throw new Error(`${getOfflineModeReason()} Blocked request to ${url.origin}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return await originalFetch(input, init);
|
|
58
|
-
});
|
|
59
|
-
installed = true;
|
|
60
|
-
}
|
|
61
|
-
export function uninstallNetworkGuardForTestsOnly() {
|
|
62
|
-
if (!installed)
|
|
63
|
-
return;
|
|
64
|
-
if (originalFetch) {
|
|
65
|
-
globalThis.fetch = originalFetch;
|
|
66
|
-
}
|
|
67
|
-
installed = false;
|
|
68
|
-
originalFetch = null;
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=network-guard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"network-guard.js","sourceRoot":"","sources":["../../../src/infrastructure/security/network-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAO1E,IAAI,SAAS,GAAG,KAAK,CAAC;AACtB,IAAI,aAAa,GAAwB,IAAI,CAAC;AAE9C,SAAS,eAAe,CAAC,QAAgB;IACvC,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,KAAK,CAAC;AACpF,CAAC;AAED,SAAS,eAAe,CAAC,KAAkC;IACzD,IAAI,CAAC;QACH,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QACrD,IAAI,KAAK,YAAY,GAAG;YAAE,OAAO,KAAK,CAAC;QACvC,UAAU;QACV,MAAM,QAAQ,GAAG,KAAY,CAAC;QAC9B,IAAI,QAAQ,EAAE,GAAG;YAAE,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAA6B;IAC/D,IAAI,SAAS;QAAE,OAAO;IAEtB,iDAAiD;IACjD,IAAI,CAAC,oBAAoB,EAAE;QAAE,OAAO;IAEpC,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;QAC3C,sFAAsF;QACtF,SAAS,GAAG,IAAI,CAAC;QACjB,OAAO;IACT,CAAC;IAED,MAAM,cAAc,GAAG,OAA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|
|
4
|
-
*
|
|
5
|
-
* IMPORTANT:
|
|
6
|
-
* - Keep logic minimal and dependency-free.
|
|
7
|
-
* - This is an execution contract, not just UX copy.
|
|
8
|
-
*/
|
|
9
|
-
export declare function isOfflineModeEnabled(): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Enable offline mode early when `--offline` is passed.
|
|
12
|
-
* We set an env var so downstream modules (DI / providers) can react without plumbing.
|
|
13
|
-
*/
|
|
14
|
-
export declare function enableOfflineModeFromArgv(argv?: string[]): void;
|
|
15
|
-
export declare function getOfflineModeReason(): string;
|
|
16
|
-
//# sourceMappingURL=offline.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"offline.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/security/offline.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,IAAI,CAI7E;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Security: Offline Mode
|
|
3
|
-
* Centralized detection for "no network" execution.
|
|
4
|
-
*
|
|
5
|
-
* IMPORTANT:
|
|
6
|
-
* - Keep logic minimal and dependency-free.
|
|
7
|
-
* - This is an execution contract, not just UX copy.
|
|
8
|
-
*/
|
|
9
|
-
export function isOfflineModeEnabled() {
|
|
10
|
-
return process.env.CODEHERE_OFFLINE === '1' || process.env.CODEHERE_OFFLINE === 'true';
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Enable offline mode early when `--offline` is passed.
|
|
14
|
-
* We set an env var so downstream modules (DI / providers) can react without plumbing.
|
|
15
|
-
*/
|
|
16
|
-
export function enableOfflineModeFromArgv(argv = process.argv) {
|
|
17
|
-
if (argv.includes('--offline')) {
|
|
18
|
-
process.env.CODEHERE_OFFLINE = '1';
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export function getOfflineModeReason() {
|
|
22
|
-
return 'Offline mode is enabled (no outbound network calls allowed).';
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=offline.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"offline.js","sourceRoot":"","sources":["../../../src/infrastructure/security/offline.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,MAAM,CAAC;AACzF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAiB,OAAO,CAAC,IAAI;IACrE,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,GAAG,CAAC;IACrC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,8DAA8D,CAAC;AACxE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sqljs-init.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/storage/sqljs-init.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE;QACR,KAAK,IAAI,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;KACnC,CAAC;CACH,CAAC;AAEF,wBAAsB,aAAa,IAAI,OAAO,CAAC,eAAe,CAAC,CAkC9D"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* sql.js initialization helper
|
|
3
|
-
* Ensures the wasm file can be located reliably in Node (especially in non-TTY / spawned processes).
|
|
4
|
-
*
|
|
5
|
-
* NOTE: sql.js requires locateFile in some environments to avoid hanging while resolving sql-wasm.wasm.
|
|
6
|
-
*/
|
|
7
|
-
import initSqlJs from 'sql.js';
|
|
8
|
-
import { createRequire } from 'module';
|
|
9
|
-
export async function initSqlJsSafe() {
|
|
10
|
-
try {
|
|
11
|
-
const require = createRequire(import.meta.url);
|
|
12
|
-
const wasmPath = require.resolve('sql.js/dist/sql-wasm.wasm');
|
|
13
|
-
return (await initSqlJs({
|
|
14
|
-
locateFile: (file) => (file.endsWith('.wasm') ? wasmPath : file),
|
|
15
|
-
}));
|
|
16
|
-
}
|
|
17
|
-
catch {
|
|
18
|
-
// Fallback: let sql.js try its default resolution strategy.
|
|
19
|
-
// If that fails in the current environment, callers should surface the error quickly.
|
|
20
|
-
return (await initSqlJs());
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=sqljs-init.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sqljs-init.js","sourceRoot":"","sources":["../../../src/infrastructure/storage/sqljs-init.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AASvC,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE;QACtB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC;QACvD,IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,CAAC;QACtB,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC,EAAE,CAAC;IAEL,MAAM,WAAW,GAAG,KAAK,EAAK,CAAa,EAAE,EAAU,EAAc,E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|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Infrastructure: Enhanced HITL Review Portal
|
|
3
|
-
* Task 4.1: Centralized review portal for batch approval/rejection
|
|
4
|
-
*
|
|
5
|
-
* Features:
|
|
6
|
-
* - Display all pending checkpoints
|
|
7
|
-
* - Batch approval/rejection
|
|
8
|
-
* - Risk assessment visualization
|
|
9
|
-
* - Diff preview
|
|
10
|
-
*/
|
|
11
|
-
import { HITLValidation, ReviewCheckpoint, ReviewPriority } from './hitl-validation.js';
|
|
12
|
-
export interface BatchDecision {
|
|
13
|
-
checkpointIds: string[];
|
|
14
|
-
decision: 'approve' | 'reject';
|
|
15
|
-
comment?: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Display centralized HITL review portal
|
|
19
|
-
*/
|
|
20
|
-
export declare function displayReviewPortal(hitlValidation: HITLValidation): {
|
|
21
|
-
checkpoints: ReviewCheckpoint[];
|
|
22
|
-
status: {
|
|
23
|
-
total: number;
|
|
24
|
-
pending: number;
|
|
25
|
-
byPriority: Record<ReviewPriority, number>;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Display detailed checkpoint view
|
|
30
|
-
*/
|
|
31
|
-
export declare function displayCheckpointDetails(checkpoint: ReviewCheckpoint): void;
|
|
32
|
-
/**
|
|
33
|
-
* Display batch approval prompt
|
|
34
|
-
*/
|
|
35
|
-
export declare function displayBatchApprovalPrompt(checkpointIds: string[]): void;
|
|
36
|
-
/**
|
|
37
|
-
* Display batch decision summary
|
|
38
|
-
*/
|
|
39
|
-
export declare function displayBatchDecisionSummary(decisions: Array<{
|
|
40
|
-
checkpointId: string;
|
|
41
|
-
decision: 'approve' | 'reject';
|
|
42
|
-
}>): void;
|
|
43
|
-
/**
|
|
44
|
-
* Format checkpoint for batch display
|
|
45
|
-
*/
|
|
46
|
-
export declare function formatCheckpointForBatch(checkpoint: ReviewCheckpoint): string;
|
|
47
|
-
//# sourceMappingURL=hitl-review-portal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hitl-review-portal.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/ux/hitl-review-portal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAcH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,cAAc,EAEf,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,GAC7B;IACD,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;CACxF,CAyCA;AAiCD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CA0D3E;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,IAAI,CAYxE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,KAAK,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAA;CAAE,CAAC,GACzE,IAAI,CAgBN;AAwDD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,gBAAgB,GAAG,MAAM,CAW7E"}
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Infrastructure: Enhanced HITL Review Portal
|
|
3
|
-
* Task 4.1: Centralized review portal for batch approval/rejection
|
|
4
|
-
*
|
|
5
|
-
* Features:
|
|
6
|
-
* - Display all pending checkpoints
|
|
7
|
-
* - Batch approval/rejection
|
|
8
|
-
* - Risk assessment visualization
|
|
9
|
-
* - Diff preview
|
|
10
|
-
*/
|
|
11
|
-
import { colors, separator, success, warning, error, info, createTable, createBox, } from '../../ui.js';
|
|
12
|
-
/**
|
|
13
|
-
* Display centralized HITL review portal
|
|
14
|
-
*/
|
|
15
|
-
export function displayReviewPortal(hitlValidation) {
|
|
16
|
-
const status = hitlValidation.getReviewQueueStatus();
|
|
17
|
-
const checkpoints = hitlValidation.getPendingCheckpoints();
|
|
18
|
-
if (checkpoints.length === 0) {
|
|
19
|
-
console.log(colors.green('✓ No pending checkpoints to review'));
|
|
20
|
-
return { checkpoints: [], status };
|
|
21
|
-
}
|
|
22
|
-
// Display portal header
|
|
23
|
-
console.log('');
|
|
24
|
-
console.log(separator('═', 80));
|
|
25
|
-
console.log(colors.bold('⚠️ Human-in-the-Loop Review Portal'));
|
|
26
|
-
console.log(separator('═', 80));
|
|
27
|
-
console.log('');
|
|
28
|
-
// Display queue status
|
|
29
|
-
console.log(colors.bold('Review Queue Status:'));
|
|
30
|
-
console.log(` Total checkpoints: ${status.total}`);
|
|
31
|
-
console.log(` Pending review: ${status.pending}`);
|
|
32
|
-
console.log('');
|
|
33
|
-
// Priority breakdown
|
|
34
|
-
if (status.byPriority.critical > 0) {
|
|
35
|
-
console.log(error(` 🔴 Critical: ${status.byPriority.critical}`));
|
|
36
|
-
}
|
|
37
|
-
if (status.byPriority.high > 0) {
|
|
38
|
-
console.log(warning(` 🟡 High: ${status.byPriority.high}`));
|
|
39
|
-
}
|
|
40
|
-
if (status.byPriority.normal > 0) {
|
|
41
|
-
console.log(info(` 🔵 Normal: ${status.byPriority.normal}`));
|
|
42
|
-
}
|
|
43
|
-
if (status.byPriority.low > 0) {
|
|
44
|
-
console.log(success(` 🟢 Low: ${status.byPriority.low}`));
|
|
45
|
-
}
|
|
46
|
-
console.log('');
|
|
47
|
-
// Display checkpoints summary
|
|
48
|
-
displayCheckpointsSummary(checkpoints);
|
|
49
|
-
return { checkpoints, status };
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Display summary table of all checkpoints
|
|
53
|
-
*/
|
|
54
|
-
function displayCheckpointsSummary(checkpoints) {
|
|
55
|
-
const rows = checkpoints.map(checkpoint => {
|
|
56
|
-
const priorityColor = getPriorityColor(checkpoint.priority);
|
|
57
|
-
const riskColor = getRiskColor(checkpoint.context.riskLevel);
|
|
58
|
-
return [
|
|
59
|
-
checkpoint.checkpointId.substring(checkpoint.checkpointId.length - 8),
|
|
60
|
-
checkpoint.operation.substring(0, 30),
|
|
61
|
-
priorityColor(getPriorityLabel(checkpoint.priority)),
|
|
62
|
-
riskColor(checkpoint.context.riskLevel.toUpperCase()),
|
|
63
|
-
checkpoint.isMandatory ? colors.red('MANDATORY') : colors.yellow('OPTIONAL'),
|
|
64
|
-
`${checkpoint.changes.length} file(s)`,
|
|
65
|
-
checkpoint.context.uncertainty
|
|
66
|
-
? `${(checkpoint.context.uncertainty * 100).toFixed(0)}%`
|
|
67
|
-
: '-',
|
|
68
|
-
];
|
|
69
|
-
});
|
|
70
|
-
const table = createTable(['ID', 'Operation', 'Priority', 'Risk', 'Review Type', 'Files', 'Uncertainty'], rows);
|
|
71
|
-
console.log(colors.bold('Pending Checkpoints:'));
|
|
72
|
-
console.log(table.toString());
|
|
73
|
-
console.log('');
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Display detailed checkpoint view
|
|
77
|
-
*/
|
|
78
|
-
export function displayCheckpointDetails(checkpoint) {
|
|
79
|
-
console.log('');
|
|
80
|
-
console.log(separator('═', 80));
|
|
81
|
-
console.log(colors.bold(`Review Checkpoint: ${checkpoint.checkpointId.substring(checkpoint.checkpointId.length - 8)}`));
|
|
82
|
-
console.log(separator('═', 80));
|
|
83
|
-
console.log('');
|
|
84
|
-
// Operation info
|
|
85
|
-
console.log(colors.bold('Operation:'));
|
|
86
|
-
console.log(` ${checkpoint.operation}`);
|
|
87
|
-
console.log('');
|
|
88
|
-
// Priority and risk
|
|
89
|
-
const priorityColor = getPriorityColor(checkpoint.priority);
|
|
90
|
-
const riskColor = getRiskColor(checkpoint.context.riskLevel);
|
|
91
|
-
console.log(colors.bold('Risk Assessment:'));
|
|
92
|
-
console.log(` Priority: ${priorityColor(getPriorityLabel(checkpoint.priority))}`);
|
|
93
|
-
console.log(` Risk Level: ${riskColor(checkpoint.context.riskLevel.toUpperCase())}`);
|
|
94
|
-
// Task 4.2: Show mandatory vs optional status
|
|
95
|
-
console.log(` Review Type: ${checkpoint.isMandatory ? colors.red('MANDATORY') : colors.yellow('OPTIONAL')}`);
|
|
96
|
-
if (checkpoint.context.uncertainty) {
|
|
97
|
-
const uncertaintyPercent = (checkpoint.context.uncertainty * 100).toFixed(0);
|
|
98
|
-
const uncertaintyColor = checkpoint.context.uncertainty > 0.7 ? error : warning;
|
|
99
|
-
console.log(` Uncertainty: ${uncertaintyColor(`${uncertaintyPercent}%`)}`);
|
|
100
|
-
}
|
|
101
|
-
console.log('');
|
|
102
|
-
// Changes summary
|
|
103
|
-
console.log(colors.bold(`Changes (${checkpoint.changes.length} file(s)):`));
|
|
104
|
-
checkpoint.changes.forEach((change, idx) => {
|
|
105
|
-
console.log(` ${idx + 1}. ${change.type.toUpperCase()}: ${change.filepath || 'N/A'}`);
|
|
106
|
-
console.log(` ${colors.dim(change.summary)}`);
|
|
107
|
-
if (change.diff) {
|
|
108
|
-
console.log(` ${colors.cyan('View diff with --diff flag')}`);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
console.log('');
|
|
112
|
-
// Context
|
|
113
|
-
console.log(colors.bold('Context:'));
|
|
114
|
-
console.log(` Query: ${colors.cyan(checkpoint.context.query)}`);
|
|
115
|
-
if (checkpoint.context.securityFindings && checkpoint.context.securityFindings.length > 0) {
|
|
116
|
-
console.log(warning(` ⚠️ Security Findings: ${checkpoint.context.securityFindings.length}`));
|
|
117
|
-
}
|
|
118
|
-
if (checkpoint.context.licenseFindings && checkpoint.context.licenseFindings.length > 0) {
|
|
119
|
-
console.log(warning(` ⚠️ License Findings: ${checkpoint.context.licenseFindings.length}`));
|
|
120
|
-
}
|
|
121
|
-
console.log('');
|
|
122
|
-
// Decision options
|
|
123
|
-
console.log(separator('─', 80));
|
|
124
|
-
console.log(colors.bold('Decision Options:'));
|
|
125
|
-
console.log(` [A]pprove [R]eject [S]kip [D]iff [Q]uit`);
|
|
126
|
-
console.log(separator('─', 80));
|
|
127
|
-
console.log('');
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Display batch approval prompt
|
|
131
|
-
*/
|
|
132
|
-
export function displayBatchApprovalPrompt(checkpointIds) {
|
|
133
|
-
console.log('');
|
|
134
|
-
const content = [
|
|
135
|
-
`Batch Review: ${checkpointIds.length} checkpoint(s)`,
|
|
136
|
-
'',
|
|
137
|
-
`You are about to review ${checkpointIds.length} checkpoint(s).`,
|
|
138
|
-
'',
|
|
139
|
-
'Options:',
|
|
140
|
-
` [A]pprove all [R]eject all [I]ndividual review [C]ancel`,
|
|
141
|
-
].join('\n');
|
|
142
|
-
console.log(createBox(content));
|
|
143
|
-
console.log('');
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Display batch decision summary
|
|
147
|
-
*/
|
|
148
|
-
export function displayBatchDecisionSummary(decisions) {
|
|
149
|
-
const approved = decisions.filter(d => d.decision === 'approve').length;
|
|
150
|
-
const rejected = decisions.filter(d => d.decision === 'reject').length;
|
|
151
|
-
console.log('');
|
|
152
|
-
console.log(separator('═', 80));
|
|
153
|
-
console.log(colors.bold('Batch Decision Summary'));
|
|
154
|
-
console.log(separator('═', 80));
|
|
155
|
-
console.log('');
|
|
156
|
-
console.log(`Total reviewed: ${decisions.length}`);
|
|
157
|
-
console.log(success(` ✓ Approved: ${approved}`));
|
|
158
|
-
if (rejected > 0) {
|
|
159
|
-
console.log(error(` ✗ Rejected: ${rejected}`));
|
|
160
|
-
}
|
|
161
|
-
console.log('');
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Helper: Get priority color
|
|
165
|
-
*/
|
|
166
|
-
function getPriorityColor(priority) {
|
|
167
|
-
switch (priority) {
|
|
168
|
-
case 'critical':
|
|
169
|
-
return error;
|
|
170
|
-
case 'high':
|
|
171
|
-
return warning;
|
|
172
|
-
case 'normal':
|
|
173
|
-
return info;
|
|
174
|
-
case 'low':
|
|
175
|
-
return success;
|
|
176
|
-
default:
|
|
177
|
-
return colors.gray;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Helper: Get priority label
|
|
182
|
-
*/
|
|
183
|
-
function getPriorityLabel(priority) {
|
|
184
|
-
switch (priority) {
|
|
185
|
-
case 'critical':
|
|
186
|
-
return 'CRITICAL';
|
|
187
|
-
case 'high':
|
|
188
|
-
return 'HIGH';
|
|
189
|
-
case 'normal':
|
|
190
|
-
return 'NORMAL';
|
|
191
|
-
case 'low':
|
|
192
|
-
return 'LOW';
|
|
193
|
-
default:
|
|
194
|
-
return String(priority).toUpperCase();
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Helper: Get risk color
|
|
199
|
-
*/
|
|
200
|
-
function getRiskColor(riskLevel) {
|
|
201
|
-
switch (riskLevel.toLowerCase()) {
|
|
202
|
-
case 'critical':
|
|
203
|
-
return error;
|
|
204
|
-
case 'high':
|
|
205
|
-
return warning;
|
|
206
|
-
case 'medium':
|
|
207
|
-
return info;
|
|
208
|
-
case 'low':
|
|
209
|
-
return success;
|
|
210
|
-
default:
|
|
211
|
-
return colors.gray;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Format checkpoint for batch display
|
|
216
|
-
*/
|
|
217
|
-
export function formatCheckpointForBatch(checkpoint) {
|
|
218
|
-
const priorityColor = getPriorityColor(checkpoint.priority);
|
|
219
|
-
const riskColor = getRiskColor(checkpoint.context.riskLevel);
|
|
220
|
-
return [
|
|
221
|
-
`${checkpoint.checkpointId.substring(checkpoint.checkpointId.length - 8)} |`,
|
|
222
|
-
`${checkpoint.operation.substring(0, 25)} |`,
|
|
223
|
-
`${priorityColor(getPriorityLabel(checkpoint.priority))} |`,
|
|
224
|
-
`${riskColor(checkpoint.context.riskLevel.toUpperCase())} |`,
|
|
225
|
-
`${checkpoint.changes.length} file(s)`,
|
|
226
|
-
].join(' ');
|
|
227
|
-
}
|
|
228
|
-
//# sourceMappingURL=hitl-review-portal.js.map
|