codehere 0.1.1 → 0.2.2
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/README.md +68 -329
- package/dist/application/agents/execution-agent.js +4 -30
- package/dist/application/agents/multi-agent-orchestrator.js +0 -1
- package/dist/application/agents/planning-agent.js +79 -199
- package/dist/application/services/dependency-container.js +9 -20
- package/dist/application/services/intelligent-router.js +56 -64
- package/dist/application/use-cases/ask-question-use-case.js +22 -121
- package/dist/application/use-cases/edit-file-use-case.js +171 -160
- package/dist/application/use-cases/react-orchestration-use-case.js +10 -43
- package/dist/chat.js +130 -54
- package/dist/domain/services/query-intent-classifier.js +3 -36
- package/dist/embed.js +61 -74
- package/dist/index.js +1299 -259
- package/dist/infrastructure/ai/cohere-ai-service.js +9 -78
- package/dist/infrastructure/ai/provider-ai-service.js +18 -121
- package/dist/infrastructure/config/config-manager.js +14 -135
- package/dist/infrastructure/config/product-context.js +66 -0
- package/dist/infrastructure/context/conversation-context.js +1 -86
- package/dist/infrastructure/cost/cost-router.js +104 -0
- package/dist/infrastructure/cost/cost-tracker.js +2 -3
- package/dist/infrastructure/governance/policy-as-code.js +2 -1
- package/dist/infrastructure/hooks/claude-sdk-hook.js +253 -0
- package/dist/infrastructure/hooks/session-analyzer.js +111 -0
- package/dist/infrastructure/observability/execution-tracer.js +7 -180
- package/dist/infrastructure/protocols/mcp-helpers.js +45 -0
- package/dist/infrastructure/protocols/mcp-server-impl.js +286 -0
- package/dist/infrastructure/providers/cohere-provider.js +5 -31
- package/dist/infrastructure/providers/fake-provider.js +0 -8
- package/dist/infrastructure/providers/local-llm-provider.js +2 -8
- package/dist/infrastructure/providers/openai-provider.js +5 -37
- package/dist/infrastructure/providers/openrouter-provider.js +3 -11
- package/dist/infrastructure/safety/pattern-detector.js +133 -0
- package/dist/infrastructure/security/ai-sast-scanner.js +62 -13
- package/dist/infrastructure/security/enhanced-security-gate.js +2 -61
- package/dist/infrastructure/security/input-validator.js +29 -146
- package/dist/infrastructure/security/trust-scorer.js +337 -0
- package/dist/infrastructure/storage/embeddings-path.js +4 -14
- package/dist/infrastructure/storage/plan-repository.js +5 -4
- package/dist/infrastructure/storage/sqlite-decision-repository.js +8 -4
- package/dist/infrastructure/storage/sqlite-embedding-repository.js +11 -23
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.js +8 -4
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.js +8 -4
- package/dist/infrastructure/storage/sqlite-memory-repository.js +8 -4
- package/dist/infrastructure/storage/sqlite-pattern-repository.js +8 -4
- package/dist/infrastructure/ux/stream-markdown.js +151 -0
- package/dist/infrastructure/ux/transparency.js +71 -0
- package/dist/infrastructure/validation/agent-feedback.js +12 -57
- package/dist/monitoring.js +8 -17
- package/dist/parallel-processor.js +50 -122
- package/dist/presentation/cli/commands/ask-command.js +39 -80
- package/dist/presentation/cli/commands/config-command.js +1 -1
- package/dist/presentation/cli/commands/cost-command.js +6 -6
- package/dist/presentation/cli/commands/decision-command.js +5 -5
- package/dist/presentation/cli/commands/fix-command.js +4 -44
- package/dist/presentation/cli/commands/help-command.js +151 -100
- package/dist/presentation/cli/commands/hook-command.js +272 -0
- package/dist/presentation/cli/commands/knowledge-command.js +4 -4
- package/dist/presentation/cli/commands/learning-dashboard-command.js +3 -3
- package/dist/presentation/cli/commands/orchestrate-command.js +6 -48
- package/dist/presentation/cli/commands/plan-command.js +1 -1
- package/dist/presentation/cli/commands/product-command.js +193 -16
- package/dist/presentation/cli/commands/report-command.js +353 -0
- package/dist/presentation/cli/commands/run-command.js +3 -3
- package/dist/presentation/cli/commands/scan-tool-command.js +65 -0
- package/dist/presentation/cli/commands/setup-command.js +34 -81
- package/dist/presentation/cli/commands/smart-command.js +50 -172
- package/dist/presentation/cli/commands/status-command.js +304 -119
- package/dist/presentation/cli/commands/trust-command.js +267 -274
- package/dist/presentation/cli/commands/undo-command.js +2 -2
- package/dist/search.js +37 -67
- package/dist/session.js +595 -484
- package/dist/task-verification.js +4 -4
- package/dist/token-optimizer.js +1 -6
- package/dist/ui.js +132 -16
- package/dist/utils/check-api-status.js +30 -12
- package/dist/utils/diff-parser.js +18 -48
- package/dist/verification/compiler.js +12 -11
- package/package.json +36 -43
- package/dist/agents/base.d.ts +0 -107
- package/dist/agents/base.d.ts.map +0 -1
- package/dist/agents/base.js.map +0 -1
- package/dist/agents/orchestrator-model-driven.d.ts +0 -41
- package/dist/agents/orchestrator-model-driven.d.ts.map +0 -1
- package/dist/agents/orchestrator-model-driven.js.map +0 -1
- package/dist/agents/react-orchestrator-agent.d.ts +0 -15
- package/dist/agents/react-orchestrator-agent.d.ts.map +0 -1
- package/dist/agents/react-orchestrator-agent.js.map +0 -1
- package/dist/application/agents/execution-agent.d.ts +0 -79
- package/dist/application/agents/execution-agent.d.ts.map +0 -1
- package/dist/application/agents/execution-agent.js.map +0 -1
- package/dist/application/agents/multi-agent-orchestrator.d.ts +0 -69
- package/dist/application/agents/multi-agent-orchestrator.d.ts.map +0 -1
- package/dist/application/agents/multi-agent-orchestrator.js.map +0 -1
- package/dist/application/agents/planning-agent.d.ts +0 -65
- package/dist/application/agents/planning-agent.d.ts.map +0 -1
- package/dist/application/agents/planning-agent.js.map +0 -1
- package/dist/application/agents/validation-agent.d.ts +0 -68
- package/dist/application/agents/validation-agent.d.ts.map +0 -1
- package/dist/application/agents/validation-agent.js.map +0 -1
- package/dist/application/architectures/plan-and-act.d.ts +0 -94
- package/dist/application/architectures/plan-and-act.d.ts.map +0 -1
- package/dist/application/architectures/plan-and-act.js.map +0 -1
- package/dist/application/index.d.ts +0 -12
- package/dist/application/index.d.ts.map +0 -1
- package/dist/application/index.js.map +0 -1
- package/dist/application/services/agent-factory.d.ts +0 -9
- package/dist/application/services/agent-factory.d.ts.map +0 -1
- package/dist/application/services/agent-factory.js.map +0 -1
- package/dist/application/services/context-importer.d.ts +0 -71
- package/dist/application/services/context-importer.d.ts.map +0 -1
- package/dist/application/services/context-importer.js +0 -436
- package/dist/application/services/context-importer.js.map +0 -1
- package/dist/application/services/context-manager.d.ts +0 -132
- package/dist/application/services/context-manager.d.ts.map +0 -1
- package/dist/application/services/context-manager.js +0 -369
- package/dist/application/services/context-manager.js.map +0 -1
- package/dist/application/services/dependency-container.d.ts +0 -187
- package/dist/application/services/dependency-container.d.ts.map +0 -1
- package/dist/application/services/dependency-container.js.map +0 -1
- package/dist/application/services/git-context-service.d.ts +0 -30
- package/dist/application/services/git-context-service.d.ts.map +0 -1
- package/dist/application/services/git-context-service.js.map +0 -1
- package/dist/application/services/intelligent-router.d.ts +0 -90
- package/dist/application/services/intelligent-router.d.ts.map +0 -1
- package/dist/application/services/intelligent-router.js.map +0 -1
- package/dist/application/services/token-counting-service.d.ts +0 -87
- package/dist/application/services/token-counting-service.d.ts.map +0 -1
- package/dist/application/services/token-counting-service.js +0 -196
- package/dist/application/services/token-counting-service.js.map +0 -1
- package/dist/application/services/tool-executor-service.d.ts +0 -14
- package/dist/application/services/tool-executor-service.d.ts.map +0 -1
- package/dist/application/services/tool-executor-service.js.map +0 -1
- package/dist/application/use-cases/ask-question-use-case.d.ts +0 -67
- package/dist/application/use-cases/ask-question-use-case.d.ts.map +0 -1
- package/dist/application/use-cases/ask-question-use-case.js.map +0 -1
- package/dist/application/use-cases/edit-file-use-case.d.ts +0 -92
- package/dist/application/use-cases/edit-file-use-case.d.ts.map +0 -1
- package/dist/application/use-cases/edit-file-use-case.js.map +0 -1
- package/dist/application/use-cases/explain-file-use-case.d.ts +0 -21
- package/dist/application/use-cases/explain-file-use-case.d.ts.map +0 -1
- package/dist/application/use-cases/explain-file-use-case.js.map +0 -1
- package/dist/application/use-cases/index-codebase-use-case.d.ts +0 -46
- package/dist/application/use-cases/index-codebase-use-case.d.ts.map +0 -1
- package/dist/application/use-cases/index-codebase-use-case.js.map +0 -1
- package/dist/application/use-cases/planning-use-case.d.ts +0 -46
- package/dist/application/use-cases/planning-use-case.d.ts.map +0 -1
- package/dist/application/use-cases/planning-use-case.js.map +0 -1
- package/dist/application/use-cases/react-orchestration-use-case.d.ts +0 -51
- package/dist/application/use-cases/react-orchestration-use-case.d.ts.map +0 -1
- package/dist/application/use-cases/react-orchestration-use-case.js.map +0 -1
- package/dist/application/use-cases/reflexion-use-case.d.ts +0 -24
- package/dist/application/use-cases/reflexion-use-case.d.ts.map +0 -1
- package/dist/application/use-cases/reflexion-use-case.js.map +0 -1
- package/dist/application/workflows/deterministic-workflows.d.ts +0 -61
- package/dist/application/workflows/deterministic-workflows.d.ts.map +0 -1
- package/dist/application/workflows/deterministic-workflows.js.map +0 -1
- package/dist/ast-parser.d 2.ts +0 -55
- package/dist/ast-parser.d.ts +0 -55
- package/dist/ast-parser.d.ts.map +0 -1
- package/dist/ast-parser.js.map +0 -1
- package/dist/cache.d.ts +0 -45
- package/dist/cache.d.ts.map +0 -1
- package/dist/cache.js.map +0 -1
- package/dist/chat.d.ts +0 -4
- package/dist/chat.d.ts.map +0 -1
- package/dist/chat.js.map +0 -1
- package/dist/code-analysis 2.js +0 -327
- package/dist/code-analysis.d.ts +0 -50
- package/dist/code-analysis.d.ts.map +0 -1
- package/dist/code-analysis.js.map +0 -1
- package/dist/context.d.ts +0 -44
- package/dist/context.d.ts 2.map +0 -1
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/docs.d.ts +0 -21
- package/dist/docs.d.ts.map +0 -1
- package/dist/docs.js.map +0 -1
- package/dist/domain/entities/code-chunk.d.ts +0 -26
- package/dist/domain/entities/code-chunk.d.ts.map +0 -1
- package/dist/domain/entities/code-chunk.js.map +0 -1
- package/dist/domain/entities/conversation-context.d.ts +0 -245
- package/dist/domain/entities/conversation-context.d.ts.map +0 -1
- package/dist/domain/entities/conversation-context.js +0 -50
- package/dist/domain/entities/conversation-context.js.map +0 -1
- package/dist/domain/entities/decision.d.ts +0 -37
- package/dist/domain/entities/decision.d.ts.map +0 -1
- package/dist/domain/entities/decision.js.map +0 -1
- package/dist/domain/entities/edit.d.ts +0 -35
- package/dist/domain/entities/edit.d.ts.map +0 -1
- package/dist/domain/entities/edit.js.map +0 -1
- package/dist/domain/entities/knowledge-node.d.ts +0 -83
- package/dist/domain/entities/knowledge-node.d.ts.map +0 -1
- package/dist/domain/entities/knowledge-node.js.map +0 -1
- package/dist/domain/entities/knowledge-preservation.d.ts +0 -42
- package/dist/domain/entities/knowledge-preservation.d.ts.map +0 -1
- package/dist/domain/entities/knowledge-preservation.js.map +0 -1
- package/dist/domain/entities/memory.d.ts +0 -36
- package/dist/domain/entities/memory.d.ts.map +0 -1
- package/dist/domain/entities/memory.js.map +0 -1
- package/dist/domain/entities/pattern.d.ts +0 -49
- package/dist/domain/entities/pattern.d.ts.map +0 -1
- package/dist/domain/entities/pattern.js.map +0 -1
- package/dist/domain/entities/plan.d.ts +0 -42
- package/dist/domain/entities/plan.d.ts.map +0 -1
- package/dist/domain/entities/plan.js.map +0 -1
- package/dist/domain/entities/query.d.ts +0 -17
- package/dist/domain/entities/query.d.ts.map +0 -1
- package/dist/domain/entities/query.js.map +0 -1
- package/dist/domain/entities/task.d.ts +0 -152
- package/dist/domain/entities/task.d.ts.map +0 -1
- package/dist/domain/entities/task.js.map +0 -1
- package/dist/domain/errors/embeddings-not-found-error.d.ts +0 -9
- package/dist/domain/errors/embeddings-not-found-error.d.ts.map +0 -1
- package/dist/domain/errors/embeddings-not-found-error.js.map +0 -1
- package/dist/domain/index.d.ts +0 -16
- package/dist/domain/index.d.ts.map +0 -1
- package/dist/domain/index.js.map +0 -1
- package/dist/domain/interfaces/ai-service.interface.d.ts +0 -72
- package/dist/domain/interfaces/ai-service.interface.d.ts.map +0 -1
- package/dist/domain/interfaces/ai-service.interface.js.map +0 -1
- package/dist/domain/interfaces/code-analyzer.interface.d.ts +0 -38
- package/dist/domain/interfaces/code-analyzer.interface.d.ts.map +0 -1
- package/dist/domain/interfaces/code-analyzer.interface.js.map +0 -1
- package/dist/domain/interfaces/context-repository.interface.d.ts +0 -71
- package/dist/domain/interfaces/context-repository.interface.d.ts.map +0 -1
- package/dist/domain/interfaces/context-repository.interface.js +0 -10
- package/dist/domain/interfaces/context-repository.interface.js.map +0 -1
- package/dist/domain/interfaces/decision-repository.interface.d.ts +0 -51
- package/dist/domain/interfaces/decision-repository.interface.d.ts.map +0 -1
- package/dist/domain/interfaces/decision-repository.interface.js.map +0 -1
- package/dist/domain/interfaces/embedding-repository.interface.d.ts +0 -33
- package/dist/domain/interfaces/embedding-repository.interface.d.ts.map +0 -1
- package/dist/domain/interfaces/embedding-repository.interface.js.map +0 -1
- package/dist/domain/interfaces/knowledge-graph-repository.interface.d.ts +0 -91
- package/dist/domain/interfaces/knowledge-graph-repository.interface.d.ts.map +0 -1
- package/dist/domain/interfaces/knowledge-graph-repository.interface.js.map +0 -1
- package/dist/domain/interfaces/knowledge-preservation-repository.interface.d.ts +0 -50
- package/dist/domain/interfaces/knowledge-preservation-repository.interface.d.ts.map +0 -1
- package/dist/domain/interfaces/knowledge-preservation-repository.interface.js.map +0 -1
- package/dist/domain/interfaces/memory-repository.interface.d.ts +0 -49
- package/dist/domain/interfaces/memory-repository.interface.d.ts.map +0 -1
- package/dist/domain/interfaces/memory-repository.interface.js.map +0 -1
- package/dist/domain/interfaces/pattern-repository.interface.d.ts +0 -48
- package/dist/domain/interfaces/pattern-repository.interface.d.ts.map +0 -1
- package/dist/domain/interfaces/pattern-repository.interface.js.map +0 -1
- package/dist/domain/interfaces/verification-service.interface.d.ts +0 -20
- package/dist/domain/interfaces/verification-service.interface.d.ts.map +0 -1
- package/dist/domain/interfaces/verification-service.interface.js.map +0 -1
- package/dist/domain/services/codebase-detector.d.ts +0 -18
- package/dist/domain/services/codebase-detector.d.ts.map +0 -1
- package/dist/domain/services/codebase-detector.js.map +0 -1
- package/dist/domain/services/cross-team-pattern-sharing.d.ts +0 -65
- package/dist/domain/services/cross-team-pattern-sharing.d.ts.map +0 -1
- package/dist/domain/services/cross-team-pattern-sharing.js.map +0 -1
- package/dist/domain/services/decision-recorder.d.ts +0 -76
- package/dist/domain/services/decision-recorder.d.ts.map +0 -1
- package/dist/domain/services/decision-recorder.js.map +0 -1
- package/dist/domain/services/decision-retriever.d.ts +0 -75
- package/dist/domain/services/decision-retriever.d.ts.map +0 -1
- package/dist/domain/services/decision-retriever.js.map +0 -1
- package/dist/domain/services/environment-mode-manager.d.ts +0 -12
- package/dist/domain/services/environment-mode-manager.d.ts.map +0 -1
- package/dist/domain/services/environment-mode-manager.js.map +0 -1
- package/dist/domain/services/graded-memory-activation.d.ts +0 -37
- package/dist/domain/services/graded-memory-activation.d.ts.map +0 -1
- package/dist/domain/services/graded-memory-activation.js.map +0 -1
- package/dist/domain/services/knowledge-access.d.ts +0 -63
- package/dist/domain/services/knowledge-access.d.ts.map +0 -1
- package/dist/domain/services/knowledge-access.js.map +0 -1
- package/dist/domain/services/knowledge-extractor.d.ts +0 -54
- package/dist/domain/services/knowledge-extractor.d.ts.map +0 -1
- package/dist/domain/services/knowledge-extractor.js.map +0 -1
- package/dist/domain/services/knowledge-graph-builder.d.ts +0 -70
- package/dist/domain/services/knowledge-graph-builder.d.ts.map +0 -1
- package/dist/domain/services/knowledge-graph-builder.js.map +0 -1
- package/dist/domain/services/knowledge-graph-query.d.ts +0 -69
- package/dist/domain/services/knowledge-graph-query.d.ts.map +0 -1
- package/dist/domain/services/knowledge-graph-query.js.map +0 -1
- package/dist/domain/services/memory-retriever.d.ts +0 -30
- package/dist/domain/services/memory-retriever.d.ts.map +0 -1
- package/dist/domain/services/memory-retriever.js.map +0 -1
- package/dist/domain/services/memory-synthesizer.d.ts +0 -57
- package/dist/domain/services/memory-synthesizer.d.ts.map +0 -1
- package/dist/domain/services/memory-synthesizer.js.map +0 -1
- package/dist/domain/services/pattern-extractor.d.ts +0 -108
- package/dist/domain/services/pattern-extractor.d.ts.map +0 -1
- package/dist/domain/services/pattern-extractor.js.map +0 -1
- package/dist/domain/services/query-intent-classifier.d.ts +0 -16
- package/dist/domain/services/query-intent-classifier.d.ts.map +0 -1
- package/dist/domain/services/query-intent-classifier.js.map +0 -1
- package/dist/domain/services/react-loop.d.ts +0 -52
- package/dist/domain/services/react-loop.d.ts.map +0 -1
- package/dist/domain/services/react-loop.js.map +0 -1
- package/dist/domain/services/risk-tier-detector.d.ts +0 -17
- package/dist/domain/services/risk-tier-detector.d.ts.map +0 -1
- package/dist/domain/services/risk-tier-detector.js.map +0 -1
- package/dist/edit.d.ts +0 -26
- package/dist/edit.d.ts 2.map +0 -1
- package/dist/edit.d.ts.map +0 -1
- package/dist/edit.js.map +0 -1
- package/dist/embed.d 2.ts +0 -14
- package/dist/embed.d.ts +0 -14
- package/dist/embed.d.ts.map +0 -1
- package/dist/embed.js.map +0 -1
- package/dist/error-handler.d 2.ts +0 -77
- package/dist/error-handler.d.ts +0 -77
- package/dist/error-handler.d.ts.map +0 -1
- package/dist/error-handler.js.map +0 -1
- package/dist/formatter 2.js +0 -168
- package/dist/formatter.d.ts +0 -25
- package/dist/formatter.d.ts 2.map +0 -1
- package/dist/formatter.d.ts.map +0 -1
- package/dist/formatter.js.map +0 -1
- package/dist/git 2.js +0 -198
- package/dist/git.d 2.ts +0 -55
- package/dist/git.d.ts +0 -55
- package/dist/git.d.ts.map +0 -1
- package/dist/git.js.map +0 -1
- package/dist/index 2.d.ts +0 -16
- package/dist/index 2.d.ts.map +0 -1
- package/dist/index 2.js +0 -429
- package/dist/index 2.js.map +0 -1
- package/dist/index-backup-before-lazy-loading.d.ts +0 -3
- package/dist/index-backup-before-lazy-loading.d.ts.map +0 -1
- package/dist/index-backup-before-lazy-loading.js +0 -1551
- package/dist/index-backup-before-lazy-loading.js.map +0 -1
- package/dist/index.d.ts +0 -16
- package/dist/index.d.ts 2.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js 2.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/infrastructure/ai/cohere-ai-service.d.ts +0 -71
- package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +0 -1
- package/dist/infrastructure/ai/cohere-ai-service.js.map +0 -1
- package/dist/infrastructure/ai/command-r-evaluation.d.ts +0 -42
- package/dist/infrastructure/ai/command-r-evaluation.d.ts.map +0 -1
- package/dist/infrastructure/ai/command-r-evaluation.js.map +0 -1
- package/dist/infrastructure/ai/model-config.d.ts +0 -47
- package/dist/infrastructure/ai/model-config.d.ts.map +0 -1
- package/dist/infrastructure/ai/model-config.js.map +0 -1
- package/dist/infrastructure/ai/provider-ai-service.d.ts +0 -67
- package/dist/infrastructure/ai/provider-ai-service.d.ts.map +0 -1
- package/dist/infrastructure/ai/provider-ai-service.js.map +0 -1
- package/dist/infrastructure/cache/embedding-cache.d.ts +0 -58
- package/dist/infrastructure/cache/embedding-cache.d.ts.map +0 -1
- package/dist/infrastructure/cache/embedding-cache.js.map +0 -1
- package/dist/infrastructure/cache/query-result-cache.d.ts +0 -27
- package/dist/infrastructure/cache/query-result-cache.d.ts.map +0 -1
- package/dist/infrastructure/cache/query-result-cache.js.map +0 -1
- package/dist/infrastructure/cache/response-cache.d.ts +0 -18
- package/dist/infrastructure/cache/response-cache.d.ts.map +0 -1
- package/dist/infrastructure/cache/response-cache.js.map +0 -1
- package/dist/infrastructure/cache/security-scan-cache.d.ts +0 -16
- package/dist/infrastructure/cache/security-scan-cache.d.ts.map +0 -1
- package/dist/infrastructure/cache/security-scan-cache.js.map +0 -1
- package/dist/infrastructure/chunking/ast-code-chunker.d.ts +0 -12
- package/dist/infrastructure/chunking/ast-code-chunker.d.ts.map +0 -1
- package/dist/infrastructure/chunking/ast-code-chunker.js.map +0 -1
- package/dist/infrastructure/chunking/code-aware-chunker.d.ts +0 -63
- package/dist/infrastructure/chunking/code-aware-chunker.d.ts.map +0 -1
- package/dist/infrastructure/chunking/code-aware-chunker.js.map +0 -1
- package/dist/infrastructure/completion/bash-completion.d.ts +0 -7
- package/dist/infrastructure/completion/bash-completion.d.ts.map +0 -1
- package/dist/infrastructure/completion/bash-completion.js.map +0 -1
- package/dist/infrastructure/completion/fish-completion.d.ts +0 -7
- package/dist/infrastructure/completion/fish-completion.d.ts.map +0 -1
- package/dist/infrastructure/completion/fish-completion.js.map +0 -1
- package/dist/infrastructure/completion/zsh-completion.d.ts +0 -7
- package/dist/infrastructure/completion/zsh-completion.d.ts.map +0 -1
- package/dist/infrastructure/completion/zsh-completion.js.map +0 -1
- package/dist/infrastructure/config/config-manager.d.ts +0 -158
- package/dist/infrastructure/config/config-manager.d.ts.map +0 -1
- package/dist/infrastructure/config/config-manager.js.map +0 -1
- package/dist/infrastructure/context/context-compressor.d.ts +0 -94
- package/dist/infrastructure/context/context-compressor.d.ts.map +0 -1
- package/dist/infrastructure/context/context-compressor.js.map +0 -1
- package/dist/infrastructure/context/conversation-context.d.ts +0 -82
- package/dist/infrastructure/context/conversation-context.d.ts.map +0 -1
- package/dist/infrastructure/context/conversation-context.js.map +0 -1
- package/dist/infrastructure/context/direct-context-provider.d.ts +0 -18
- package/dist/infrastructure/context/direct-context-provider.d.ts.map +0 -1
- package/dist/infrastructure/context/direct-context-provider.js +0 -222
- package/dist/infrastructure/context/direct-context-provider.js.map +0 -1
- package/dist/infrastructure/context/git-context-provider.d.ts +0 -30
- package/dist/infrastructure/context/git-context-provider.d.ts.map +0 -1
- package/dist/infrastructure/context/git-context-provider.js +0 -140
- package/dist/infrastructure/context/git-context-provider.js.map +0 -1
- package/dist/infrastructure/context/project-context-loader.d.ts +0 -35
- package/dist/infrastructure/context/project-context-loader.d.ts.map +0 -1
- package/dist/infrastructure/context/project-context-loader.js +0 -184
- package/dist/infrastructure/context/project-context-loader.js.map +0 -1
- package/dist/infrastructure/context/session-manager.d.ts +0 -42
- package/dist/infrastructure/context/session-manager.d.ts.map +0 -1
- package/dist/infrastructure/context/session-manager.js.map +0 -1
- package/dist/infrastructure/cost/cost-tracker.d.ts +0 -91
- package/dist/infrastructure/cost/cost-tracker.d.ts.map +0 -1
- package/dist/infrastructure/cost/cost-tracker.js.map +0 -1
- package/dist/infrastructure/cost/session-token-tracker.d.ts +0 -68
- package/dist/infrastructure/cost/session-token-tracker.d.ts.map +0 -1
- package/dist/infrastructure/cost/session-token-tracker.js +0 -178
- package/dist/infrastructure/cost/session-token-tracker.js.map +0 -1
- package/dist/infrastructure/cost-calculator.d.ts +0 -34
- package/dist/infrastructure/cost-calculator.d.ts.map +0 -1
- package/dist/infrastructure/cost-calculator.js +0 -145
- package/dist/infrastructure/cost-calculator.js.map +0 -1
- package/dist/infrastructure/cost-estimator.d.ts +0 -48
- package/dist/infrastructure/cost-estimator.d.ts.map +0 -1
- package/dist/infrastructure/cost-estimator.js +0 -201
- package/dist/infrastructure/cost-estimator.js.map +0 -1
- package/dist/infrastructure/file-scanner/file-scanner.d.ts +0 -31
- package/dist/infrastructure/file-scanner/file-scanner.d.ts.map +0 -1
- package/dist/infrastructure/file-scanner/file-scanner.js.map +0 -1
- package/dist/infrastructure/governance/nist-ai-rmf.d.ts +0 -105
- package/dist/infrastructure/governance/nist-ai-rmf.d.ts.map +0 -1
- package/dist/infrastructure/governance/nist-ai-rmf.js.map +0 -1
- package/dist/infrastructure/governance/policy-as-code.d.ts +0 -88
- package/dist/infrastructure/governance/policy-as-code.d.ts.map +0 -1
- package/dist/infrastructure/governance/policy-as-code.js.map +0 -1
- package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts +0 -136
- package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts.map +0 -1
- package/dist/infrastructure/governance/prompt-to-code-lineage.js.map +0 -1
- package/dist/infrastructure/index.d.ts +0 -7
- package/dist/infrastructure/index.d.ts.map +0 -1
- package/dist/infrastructure/index.js.map +0 -1
- package/dist/infrastructure/observability/execution-tracer.d.ts +0 -130
- package/dist/infrastructure/observability/execution-tracer.d.ts.map +0 -1
- package/dist/infrastructure/observability/execution-tracer.js.map +0 -1
- package/dist/infrastructure/observability/prompt-versioner.d.ts +0 -67
- package/dist/infrastructure/observability/prompt-versioner.d.ts.map +0 -1
- package/dist/infrastructure/observability/prompt-versioner.js.map +0 -1
- package/dist/infrastructure/protocols/a2a-metadata.d.ts +0 -278
- package/dist/infrastructure/protocols/a2a-metadata.d.ts.map +0 -1
- package/dist/infrastructure/protocols/a2a-metadata.js.map +0 -1
- package/dist/infrastructure/protocols/a2a-protocol.d.ts +0 -132
- package/dist/infrastructure/protocols/a2a-protocol.d.ts.map +0 -1
- package/dist/infrastructure/protocols/a2a-protocol.js.map +0 -1
- package/dist/infrastructure/protocols/mcp-oauth.d.ts +0 -91
- package/dist/infrastructure/protocols/mcp-oauth.d.ts.map +0 -1
- package/dist/infrastructure/protocols/mcp-oauth.js.map +0 -1
- package/dist/infrastructure/protocols/mcp-server.d.ts +0 -126
- package/dist/infrastructure/protocols/mcp-server.d.ts.map +0 -1
- package/dist/infrastructure/protocols/mcp-server.js.map +0 -1
- package/dist/infrastructure/protocols/streaming-handler.d.ts +0 -57
- package/dist/infrastructure/protocols/streaming-handler.d.ts.map +0 -1
- package/dist/infrastructure/protocols/streaming-handler.js.map +0 -1
- package/dist/infrastructure/providers/cohere-provider.d.ts +0 -39
- package/dist/infrastructure/providers/cohere-provider.d.ts.map +0 -1
- package/dist/infrastructure/providers/cohere-provider.js.map +0 -1
- package/dist/infrastructure/providers/fake-provider.d.ts +0 -43
- package/dist/infrastructure/providers/fake-provider.d.ts.map +0 -1
- package/dist/infrastructure/providers/fake-provider.js.map +0 -1
- package/dist/infrastructure/providers/local-llm-provider.d.ts +0 -49
- package/dist/infrastructure/providers/local-llm-provider.d.ts.map +0 -1
- package/dist/infrastructure/providers/local-llm-provider.js.map +0 -1
- package/dist/infrastructure/providers/model-config.types.d.ts +0 -70
- package/dist/infrastructure/providers/model-config.types.d.ts.map +0 -1
- package/dist/infrastructure/providers/model-config.types.js.map +0 -1
- package/dist/infrastructure/providers/model-provider.interface.d.ts +0 -113
- package/dist/infrastructure/providers/model-provider.interface.d.ts.map +0 -1
- package/dist/infrastructure/providers/model-provider.interface.js.map +0 -1
- package/dist/infrastructure/providers/openai-provider.d.ts +0 -38
- package/dist/infrastructure/providers/openai-provider.d.ts.map +0 -1
- package/dist/infrastructure/providers/openai-provider.js.map +0 -1
- package/dist/infrastructure/providers/openrouter-provider.d.ts +0 -42
- package/dist/infrastructure/providers/openrouter-provider.d.ts.map +0 -1
- package/dist/infrastructure/providers/openrouter-provider.js.map +0 -1
- package/dist/infrastructure/providers/operation-provider-resolver.d.ts +0 -48
- package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +0 -1
- package/dist/infrastructure/providers/operation-provider-resolver.js.map +0 -1
- package/dist/infrastructure/providers/provider-config-loader.d.ts +0 -37
- package/dist/infrastructure/providers/provider-config-loader.d.ts.map +0 -1
- package/dist/infrastructure/providers/provider-config-loader.js.map +0 -1
- package/dist/infrastructure/providers/provider-registry.d.ts +0 -53
- package/dist/infrastructure/providers/provider-registry.d.ts.map +0 -1
- package/dist/infrastructure/providers/provider-registry.js.map +0 -1
- package/dist/infrastructure/security/ai-sast-scanner.d.ts +0 -59
- package/dist/infrastructure/security/ai-sast-scanner.d.ts.map +0 -1
- package/dist/infrastructure/security/ai-sast-scanner.js.map +0 -1
- package/dist/infrastructure/security/docker-sandbox.d.ts +0 -57
- package/dist/infrastructure/security/docker-sandbox.d.ts.map +0 -1
- package/dist/infrastructure/security/docker-sandbox.js.map +0 -1
- package/dist/infrastructure/security/enhanced-security-gate.d.ts +0 -66
- package/dist/infrastructure/security/enhanced-security-gate.d.ts.map +0 -1
- package/dist/infrastructure/security/enhanced-security-gate.js.map +0 -1
- package/dist/infrastructure/security/input-validator.d.ts +0 -46
- package/dist/infrastructure/security/input-validator.d.ts.map +0 -1
- package/dist/infrastructure/security/input-validator.js.map +0 -1
- package/dist/infrastructure/security/license-scanner.d.ts +0 -55
- package/dist/infrastructure/security/license-scanner.d.ts.map +0 -1
- package/dist/infrastructure/security/license-scanner.js.map +0 -1
- package/dist/infrastructure/security/provider-bias-detector.d.ts +0 -53
- package/dist/infrastructure/security/provider-bias-detector.d.ts.map +0 -1
- package/dist/infrastructure/security/provider-bias-detector.js.map +0 -1
- package/dist/infrastructure/security/sandbox-executor.d.ts +0 -34
- package/dist/infrastructure/security/sandbox-executor.d.ts.map +0 -1
- package/dist/infrastructure/security/sandbox-executor.js.map +0 -1
- package/dist/infrastructure/serialization/toon-serializer.d.ts +0 -45
- package/dist/infrastructure/serialization/toon-serializer.d.ts.map +0 -1
- package/dist/infrastructure/serialization/toon-serializer.js.map +0 -1
- package/dist/infrastructure/storage/embeddings-path.d.ts +0 -18
- package/dist/infrastructure/storage/embeddings-path.d.ts.map +0 -1
- package/dist/infrastructure/storage/embeddings-path.js.map +0 -1
- package/dist/infrastructure/storage/memory-stream-service.d.ts +0 -47
- package/dist/infrastructure/storage/memory-stream-service.d.ts.map +0 -1
- package/dist/infrastructure/storage/memory-stream-service.js.map +0 -1
- package/dist/infrastructure/storage/plan-repository.d.ts +0 -40
- package/dist/infrastructure/storage/plan-repository.d.ts.map +0 -1
- package/dist/infrastructure/storage/plan-repository.js.map +0 -1
- package/dist/infrastructure/storage/sqlite-context-repository.d.ts +0 -95
- package/dist/infrastructure/storage/sqlite-context-repository.d.ts.map +0 -1
- package/dist/infrastructure/storage/sqlite-context-repository.js +0 -467
- package/dist/infrastructure/storage/sqlite-context-repository.js.map +0 -1
- package/dist/infrastructure/storage/sqlite-decision-repository.d.ts +0 -29
- package/dist/infrastructure/storage/sqlite-decision-repository.d.ts.map +0 -1
- package/dist/infrastructure/storage/sqlite-decision-repository.js.map +0 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +0 -47
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +0 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +0 -1
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.d.ts +0 -41
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.d.ts.map +0 -1
- package/dist/infrastructure/storage/sqlite-knowledge-graph-repository.js.map +0 -1
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.d.ts +0 -29
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.d.ts.map +0 -1
- package/dist/infrastructure/storage/sqlite-knowledge-preservation-repository.js.map +0 -1
- package/dist/infrastructure/storage/sqlite-memory-repository.d.ts +0 -40
- package/dist/infrastructure/storage/sqlite-memory-repository.d.ts.map +0 -1
- package/dist/infrastructure/storage/sqlite-memory-repository.js.map +0 -1
- package/dist/infrastructure/storage/sqlite-pattern-repository.d.ts +0 -25
- package/dist/infrastructure/storage/sqlite-pattern-repository.d.ts.map +0 -1
- package/dist/infrastructure/storage/sqlite-pattern-repository.js.map +0 -1
- package/dist/infrastructure/storage/task-helpers.d.ts +0 -69
- package/dist/infrastructure/storage/task-helpers.d.ts.map +0 -1
- package/dist/infrastructure/storage/task-helpers.js.map +0 -1
- package/dist/infrastructure/storage/task-repository.d.ts +0 -67
- package/dist/infrastructure/storage/task-repository.d.ts.map +0 -1
- package/dist/infrastructure/storage/task-repository.js.map +0 -1
- package/dist/infrastructure/telemetry/telemetry-service.d.ts +0 -74
- package/dist/infrastructure/telemetry/telemetry-service.d.ts.map +0 -1
- package/dist/infrastructure/telemetry/telemetry-service.js.map +0 -1
- package/dist/infrastructure/ux/appropriate-friction.d.ts +0 -77
- package/dist/infrastructure/ux/appropriate-friction.d.ts.map +0 -1
- package/dist/infrastructure/ux/appropriate-friction.js.map +0 -1
- package/dist/infrastructure/ux/bi-directional-learning.d.ts +0 -131
- package/dist/infrastructure/ux/bi-directional-learning.d.ts.map +0 -1
- package/dist/infrastructure/ux/bi-directional-learning.js.map +0 -1
- package/dist/infrastructure/ux/capability-boundaries.d.ts +0 -22
- package/dist/infrastructure/ux/capability-boundaries.d.ts.map +0 -1
- package/dist/infrastructure/ux/capability-boundaries.js.map +0 -1
- package/dist/infrastructure/ux/cli-style-guide.d.ts +0 -105
- package/dist/infrastructure/ux/cli-style-guide.d.ts.map +0 -1
- package/dist/infrastructure/ux/cli-style-guide.js +0 -220
- package/dist/infrastructure/ux/cli-style-guide.js.map +0 -1
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts +0 -21
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +0 -1
- package/dist/infrastructure/ux/comprehensive-formatter.js.map +0 -1
- package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +0 -11
- package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +0 -1
- package/dist/infrastructure/ux/contextual-feature-discovery.js.map +0 -1
- package/dist/infrastructure/ux/expectation-management.d.ts +0 -98
- package/dist/infrastructure/ux/expectation-management.d.ts.map +0 -1
- package/dist/infrastructure/ux/expectation-management.js.map +0 -1
- package/dist/infrastructure/ux/feature-discovery.d.ts +0 -17
- package/dist/infrastructure/ux/feature-discovery.d.ts.map +0 -1
- package/dist/infrastructure/ux/feature-discovery.js.map +0 -1
- package/dist/infrastructure/ux/feedback-prompt.d.ts +0 -26
- package/dist/infrastructure/ux/feedback-prompt.d.ts.map +0 -1
- package/dist/infrastructure/ux/feedback-prompt.js.map +0 -1
- package/dist/infrastructure/ux/hitl-validation.d.ts +0 -139
- package/dist/infrastructure/ux/hitl-validation.d.ts.map +0 -1
- package/dist/infrastructure/ux/hitl-validation.js.map +0 -1
- package/dist/infrastructure/ux/progress-indicator.d.ts +0 -53
- package/dist/infrastructure/ux/progress-indicator.d.ts.map +0 -1
- package/dist/infrastructure/ux/progress-indicator.js.map +0 -1
- package/dist/infrastructure/ux/progressive-disclosure.d.ts +0 -84
- package/dist/infrastructure/ux/progressive-disclosure.d.ts.map +0 -1
- package/dist/infrastructure/ux/progressive-disclosure.js.map +0 -1
- package/dist/infrastructure/ux/review-checkpoint.d.ts +0 -37
- package/dist/infrastructure/ux/review-checkpoint.d.ts.map +0 -1
- package/dist/infrastructure/ux/review-checkpoint.js.map +0 -1
- package/dist/infrastructure/ux/staged-feature-intro.d.ts +0 -22
- package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +0 -1
- package/dist/infrastructure/ux/staged-feature-intro.js.map +0 -1
- package/dist/infrastructure/ux/syntax-highlighter.d.ts +0 -20
- package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +0 -1
- package/dist/infrastructure/ux/syntax-highlighter.js.map +0 -1
- package/dist/infrastructure/ux/team-standards.d.ts +0 -94
- package/dist/infrastructure/ux/team-standards.d.ts.map +0 -1
- package/dist/infrastructure/ux/team-standards.js.map +0 -1
- package/dist/infrastructure/validation/agent-feedback.d.ts +0 -57
- package/dist/infrastructure/validation/agent-feedback.d.ts.map +0 -1
- package/dist/infrastructure/validation/agent-feedback.js.map +0 -1
- package/dist/infrastructure/validation/agent-validation-helper.d.ts +0 -75
- package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +0 -1
- package/dist/infrastructure/validation/agent-validation-helper.js.map +0 -1
- package/dist/infrastructure/validation/hallucination-detector.d.ts +0 -121
- package/dist/infrastructure/validation/hallucination-detector.d.ts.map +0 -1
- package/dist/infrastructure/validation/hallucination-detector.js +0 -388
- package/dist/infrastructure/validation/hallucination-detector.js.map +0 -1
- package/dist/infrastructure/validation/review-handler.d.ts +0 -26
- package/dist/infrastructure/validation/review-handler.d.ts.map +0 -1
- package/dist/infrastructure/validation/review-handler.js.map +0 -1
- package/dist/infrastructure/validation/summary-aggregator.d.ts +0 -45
- package/dist/infrastructure/validation/summary-aggregator.d.ts.map +0 -1
- package/dist/infrastructure/validation/summary-aggregator.js.map +0 -1
- package/dist/infrastructure/validation/summary-extractor.d.ts +0 -24
- package/dist/infrastructure/validation/summary-extractor.d.ts.map +0 -1
- package/dist/infrastructure/validation/summary-extractor.js.map +0 -1
- package/dist/infrastructure/validation/trace-summary.d.ts +0 -45
- package/dist/infrastructure/validation/trace-summary.d.ts.map +0 -1
- package/dist/infrastructure/validation/trace-summary.js.map +0 -1
- package/dist/infrastructure/verification/verification-service.d.ts +0 -12
- package/dist/infrastructure/verification/verification-service.d.ts.map +0 -1
- package/dist/infrastructure/verification/verification-service.js.map +0 -1
- package/dist/infrastructure/xai/attention-visualizer.d.ts +0 -71
- package/dist/infrastructure/xai/attention-visualizer.d.ts.map +0 -1
- package/dist/infrastructure/xai/attention-visualizer.js.map +0 -1
- package/dist/infrastructure/xai/cot-visualizer.d.ts +0 -103
- package/dist/infrastructure/xai/cot-visualizer.d.ts.map +0 -1
- package/dist/infrastructure/xai/cot-visualizer.js.map +0 -1
- package/dist/infrastructure/xai/decision-tree-log.d.ts +0 -100
- package/dist/infrastructure/xai/decision-tree-log.d.ts.map +0 -1
- package/dist/infrastructure/xai/decision-tree-log.js.map +0 -1
- package/dist/infrastructure/xai/interactive-xai.d.ts +0 -104
- package/dist/infrastructure/xai/interactive-xai.d.ts.map +0 -1
- package/dist/infrastructure/xai/interactive-xai.js.map +0 -1
- package/dist/infrastructure/xai/uncertainty-quantifier.d.ts +0 -77
- package/dist/infrastructure/xai/uncertainty-quantifier.d.ts.map +0 -1
- package/dist/infrastructure/xai/uncertainty-quantifier.js.map +0 -1
- package/dist/intelligent-retrieval 2.js +0 -272
- package/dist/intelligent-retrieval.d.ts +0 -41
- package/dist/intelligent-retrieval.d.ts 2.map +0 -1
- package/dist/intelligent-retrieval.d.ts.map +0 -1
- package/dist/intelligent-retrieval.js.map +0 -1
- package/dist/intent/classifier.d.ts +0 -6
- package/dist/intent/classifier.d.ts.map +0 -1
- package/dist/intent/classifier.js.map +0 -1
- package/dist/intent/context.d.ts +0 -4
- package/dist/intent/context.d.ts.map +0 -1
- package/dist/intent/context.js.map +0 -1
- package/dist/iterative-refinement.d.ts +0 -31
- package/dist/iterative-refinement.d.ts.map +0 -1
- package/dist/iterative-refinement.js.map +0 -1
- package/dist/learning.d.ts +0 -69
- package/dist/learning.d.ts.map +0 -1
- package/dist/learning.js.map +0 -1
- package/dist/log.d.ts +0 -4
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js 2.map +0 -1
- package/dist/log.js.map +0 -1
- package/dist/migrate.d.ts +0 -33
- package/dist/migrate.d.ts.map +0 -1
- package/dist/migrate.js 2.map +0 -1
- package/dist/migrate.js.map +0 -1
- package/dist/monitoring.d.ts +0 -75
- package/dist/monitoring.d.ts.map +0 -1
- package/dist/monitoring.js.map +0 -1
- package/dist/parallel-processor.d 2.ts +0 -44
- package/dist/parallel-processor.d.ts +0 -44
- package/dist/parallel-processor.d.ts.map +0 -1
- package/dist/parallel-processor.js.map +0 -1
- package/dist/planner.d.ts +0 -47
- package/dist/planner.d.ts.map +0 -1
- package/dist/planner.js.map +0 -1
- package/dist/policy.d 2.ts +0 -3
- package/dist/policy.d.ts +0 -3
- package/dist/policy.d.ts.map +0 -1
- package/dist/policy.js.map +0 -1
- package/dist/presentation/cli/commands/ask-command.d.ts +0 -9
- package/dist/presentation/cli/commands/ask-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/ask-command.js.map +0 -1
- package/dist/presentation/cli/commands/audit-command.d.ts +0 -13
- package/dist/presentation/cli/commands/audit-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/audit-command.js +0 -96
- package/dist/presentation/cli/commands/audit-command.js.map +0 -1
- package/dist/presentation/cli/commands/config-command.d.ts +0 -9
- package/dist/presentation/cli/commands/config-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/config-command.js.map +0 -1
- package/dist/presentation/cli/commands/context-command.d.ts +0 -32
- package/dist/presentation/cli/commands/context-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/context-command.js +0 -295
- package/dist/presentation/cli/commands/context-command.js.map +0 -1
- package/dist/presentation/cli/commands/context-helper.d.ts +0 -16
- package/dist/presentation/cli/commands/context-helper.d.ts.map +0 -1
- package/dist/presentation/cli/commands/context-helper.js +0 -88
- package/dist/presentation/cli/commands/context-helper.js.map +0 -1
- package/dist/presentation/cli/commands/cost-command.d.ts +0 -8
- package/dist/presentation/cli/commands/cost-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/cost-command.js.map +0 -1
- package/dist/presentation/cli/commands/decision-command.d.ts +0 -12
- package/dist/presentation/cli/commands/decision-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/decision-command.js.map +0 -1
- package/dist/presentation/cli/commands/docs-command.d.ts +0 -14
- package/dist/presentation/cli/commands/docs-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/docs-command.js.map +0 -1
- package/dist/presentation/cli/commands/fix-command.d.ts +0 -15
- package/dist/presentation/cli/commands/fix-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/fix-command.js.map +0 -1
- package/dist/presentation/cli/commands/help-command.d.ts +0 -9
- package/dist/presentation/cli/commands/help-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/help-command.js.map +0 -1
- package/dist/presentation/cli/commands/knowledge-command.d.ts +0 -13
- package/dist/presentation/cli/commands/knowledge-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/knowledge-command.js.map +0 -1
- package/dist/presentation/cli/commands/learning-dashboard-command.d.ts +0 -8
- package/dist/presentation/cli/commands/learning-dashboard-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/learning-dashboard-command.js.map +0 -1
- package/dist/presentation/cli/commands/models-command.d.ts +0 -13
- package/dist/presentation/cli/commands/models-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/models-command.js.map +0 -1
- package/dist/presentation/cli/commands/orchestrate-command.d.ts +0 -10
- package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/orchestrate-command.js.map +0 -1
- package/dist/presentation/cli/commands/plan-command.d.ts +0 -9
- package/dist/presentation/cli/commands/plan-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/plan-command.js.map +0 -1
- package/dist/presentation/cli/commands/product-command.d.ts +0 -14
- package/dist/presentation/cli/commands/product-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/product-command.js.map +0 -1
- package/dist/presentation/cli/commands/react-command.d.ts +0 -8
- package/dist/presentation/cli/commands/react-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/react-command.js.map +0 -1
- package/dist/presentation/cli/commands/review-command.d.ts +0 -14
- package/dist/presentation/cli/commands/review-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/review-command.js.map +0 -1
- package/dist/presentation/cli/commands/run-command.d.ts +0 -13
- package/dist/presentation/cli/commands/run-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/run-command.js.map +0 -1
- package/dist/presentation/cli/commands/setup-command.d.ts +0 -10
- package/dist/presentation/cli/commands/setup-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/setup-command.js.map +0 -1
- package/dist/presentation/cli/commands/smart-command.d.ts +0 -11
- package/dist/presentation/cli/commands/smart-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/smart-command.js.map +0 -1
- package/dist/presentation/cli/commands/status-command.d.ts +0 -14
- package/dist/presentation/cli/commands/status-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/status-command.js.map +0 -1
- package/dist/presentation/cli/commands/suggest-command.d.ts +0 -11
- package/dist/presentation/cli/commands/suggest-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/suggest-command.js.map +0 -1
- package/dist/presentation/cli/commands/trace-command.d.ts +0 -8
- package/dist/presentation/cli/commands/trace-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/trace-command.js.map +0 -1
- package/dist/presentation/cli/commands/trust-command.d.ts +0 -28
- package/dist/presentation/cli/commands/trust-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/trust-command.js.map +0 -1
- package/dist/presentation/cli/commands/undo-command.d.ts +0 -8
- package/dist/presentation/cli/commands/undo-command.d.ts.map +0 -1
- package/dist/presentation/cli/commands/undo-command.js.map +0 -1
- package/dist/presentation/cli/error-display.d.ts +0 -25
- package/dist/presentation/cli/error-display.d.ts.map +0 -1
- package/dist/presentation/cli/error-display.js.map +0 -1
- package/dist/query-optimizer.d.ts +0 -32
- package/dist/query-optimizer.d.ts.map +0 -1
- package/dist/query-optimizer.js.map +0 -1
- package/dist/refactor.d.ts +0 -27
- package/dist/refactor.d.ts.map +0 -1
- package/dist/refactor.js.map +0 -1
- package/dist/review 2.js +0 -206
- package/dist/review.d.ts +0 -31
- package/dist/review.d.ts.map +0 -1
- package/dist/review.js.map +0 -1
- package/dist/search.d.ts +0 -19
- package/dist/search.d.ts.map +0 -1
- package/dist/search.js 2.map +0 -1
- package/dist/search.js.map +0 -1
- package/dist/session 2.js +0 -593
- package/dist/session.d.ts +0 -17
- package/dist/session.d.ts 2.map +0 -1
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js.map +0 -1
- package/dist/task-verification 2.js +0 -336
- package/dist/task-verification.d.ts +0 -39
- package/dist/task-verification.d.ts 2.map +0 -1
- package/dist/task-verification.d.ts.map +0 -1
- package/dist/task-verification.js.map +0 -1
- package/dist/test-minimal.d.ts +0 -2
- package/dist/test-minimal.d.ts.map +0 -1
- package/dist/test-minimal.js +0 -2
- package/dist/test-minimal.js.map +0 -1
- package/dist/testgen.d.ts +0 -24
- package/dist/testgen.d.ts.map +0 -1
- package/dist/testgen.js 2.map +0 -1
- package/dist/testgen.js.map +0 -1
- package/dist/token-optimizer.d 2.ts +0 -20
- package/dist/token-optimizer.d.ts +0 -20
- package/dist/token-optimizer.d.ts.map +0 -1
- package/dist/token-optimizer.js.map +0 -1
- package/dist/tools/bash.d.ts +0 -53
- package/dist/tools/bash.d.ts.map +0 -1
- package/dist/tools/bash.js.map +0 -1
- package/dist/tools/edit.d.ts +0 -48
- package/dist/tools/edit.d.ts.map +0 -1
- package/dist/tools/edit.js.map +0 -1
- package/dist/tools/executor.d.ts +0 -29
- package/dist/tools/executor.d.ts.map +0 -1
- package/dist/tools/executor.js.map +0 -1
- package/dist/tools/git-tool.d.ts +0 -87
- package/dist/tools/git-tool.d.ts.map +0 -1
- package/dist/tools/git-tool.js.map +0 -1
- package/dist/tools/parser.d.ts +0 -33
- package/dist/tools/parser.d.ts.map +0 -1
- package/dist/tools/parser.js.map +0 -1
- package/dist/tools/registry.d.ts +0 -74
- package/dist/tools/registry.d.ts.map +0 -1
- package/dist/tools/registry.js.map +0 -1
- package/dist/tools/search.d.ts +0 -41
- package/dist/tools/search.d.ts.map +0 -1
- package/dist/tools/search.js.map +0 -1
- package/dist/types.d.ts +0 -36
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/ui.d.ts +0 -60
- package/dist/ui.d.ts 2.map +0 -1
- package/dist/ui.d.ts.map +0 -1
- package/dist/ui.js.map +0 -1
- package/dist/utils/check-api-status.d.ts +0 -12
- package/dist/utils/check-api-status.d.ts.map +0 -1
- package/dist/utils/check-api-status.js.map +0 -1
- package/dist/utils/debug.d.ts +0 -7
- package/dist/utils/debug.d.ts.map +0 -1
- package/dist/utils/debug.js +0 -24
- package/dist/utils/debug.js.map +0 -1
- package/dist/utils/diff-parser.d.ts +0 -22
- package/dist/utils/diff-parser.d.ts.map +0 -1
- package/dist/utils/diff-parser.js.map +0 -1
- package/dist/utils/provider-check.d.ts +0 -21
- package/dist/utils/provider-check.d.ts.map +0 -1
- package/dist/utils/provider-check.js +0 -124
- package/dist/utils/provider-check.js.map +0 -1
- package/dist/utils/version.d.ts +0 -21
- package/dist/utils/version.d.ts.map +0 -1
- package/dist/utils/version.js.map +0 -1
- package/dist/verification/backup.d.ts +0 -30
- package/dist/verification/backup.d.ts.map +0 -1
- package/dist/verification/backup.js.map +0 -1
- package/dist/verification/compiler.d.ts +0 -20
- package/dist/verification/compiler.d.ts.map +0 -1
- package/dist/verification/compiler.js.map +0 -1
- package/dist/verification/index.d.ts +0 -59
- package/dist/verification/index.d.ts.map +0 -1
- package/dist/verification/index.js.map +0 -1
- package/dist/verification/test-runner.d.ts +0 -27
- package/dist/verification/test-runner.d.ts.map +0 -1
- package/dist/verification/test-runner.js.map +0 -1
- package/dist/verify_db.d.ts +0 -2
- package/dist/verify_db.d.ts.map +0 -1
- package/dist/verify_db.js +0 -52
- package/dist/verify_db.js 2.map +0 -1
- package/dist/verify_db.js.map +0 -1
|
@@ -141,13 +141,13 @@ function checkJavaScript(filepath) {
|
|
|
141
141
|
try {
|
|
142
142
|
// Try to parse with node
|
|
143
143
|
const content = readFileSync(filepath, 'utf-8');
|
|
144
|
-
// Basic syntax check:
|
|
144
|
+
// Basic syntax check: use node --check (parse-only, no execution)
|
|
145
145
|
try {
|
|
146
|
-
|
|
147
|
-
new Function(content);
|
|
146
|
+
execSync(`node --check "${filepath}"`, { stdio: 'pipe' });
|
|
148
147
|
}
|
|
149
148
|
catch (parseError) {
|
|
150
|
-
|
|
149
|
+
const msg = parseError instanceof Error ? parseError.message : String(parseError);
|
|
150
|
+
errors.push(`Syntax error: ${msg}`);
|
|
151
151
|
return { success: false, errors, warnings };
|
|
152
152
|
}
|
|
153
153
|
return { success: true, errors, warnings };
|
package/dist/token-optimizer.js
CHANGED
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
* 80-90% token reduction through smart compression
|
|
4
4
|
*/
|
|
5
5
|
import { encoding_for_model } from 'tiktoken';
|
|
6
|
-
|
|
7
|
-
// Token encoder - tiktoken is OpenAI-specific, use GPT model
|
|
8
|
-
const tokenConfig = getConfigManager();
|
|
9
|
-
const defaultModel = tokenConfig.getModel('default') || tokenConfig.getPreference('defaultModel');
|
|
10
|
-
const tiktokenModel = (defaultModel && defaultModel.includes('gpt')) ? defaultModel : 'gpt-3.5-turbo';
|
|
11
|
-
const enc = encoding_for_model(tiktokenModel);
|
|
6
|
+
const enc = encoding_for_model('gpt-3.5-turbo');
|
|
12
7
|
/**
|
|
13
8
|
* Optimize context to minimize tokens while preserving relevance
|
|
14
9
|
*/
|
package/dist/ui.js
CHANGED
|
@@ -19,7 +19,12 @@ export function isMinimalStyle() {
|
|
|
19
19
|
}
|
|
20
20
|
// Minimal header for commands (used in minimal style)
|
|
21
21
|
export function printMinimalHeader(command, query) {
|
|
22
|
-
|
|
22
|
+
if (query) {
|
|
23
|
+
console.log(colors.cyan(`codehere ${command}`) + colors.dim(' ▸ ') + query);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
console.log(colors.cyan(`codehere ${command}`));
|
|
27
|
+
}
|
|
23
28
|
console.log();
|
|
24
29
|
}
|
|
25
30
|
// Minimal safety note (used at end of AI responses)
|
|
@@ -210,6 +215,35 @@ export function newline(count = 1) {
|
|
|
210
215
|
console.log();
|
|
211
216
|
}
|
|
212
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* Show a human-voice "you need an API key" message and exit.
|
|
220
|
+
* Covers all supported providers — not just Cohere.
|
|
221
|
+
*/
|
|
222
|
+
export function hasAnyApiKey() {
|
|
223
|
+
return !!(process.env.ANTHROPIC_API_KEY ||
|
|
224
|
+
process.env.OPENAI_API_KEY ||
|
|
225
|
+
process.env.COHERE_API_KEY ||
|
|
226
|
+
process.env.OPENROUTER_API_KEY ||
|
|
227
|
+
process.env.CODEHERE_AI_PROVIDER === 'local' ||
|
|
228
|
+
process.env.CODEHERE_FAKE_AI === '1');
|
|
229
|
+
}
|
|
230
|
+
export function requireApiKey() {
|
|
231
|
+
newline();
|
|
232
|
+
console.log(error('You need an API key to use this command.'));
|
|
233
|
+
newline();
|
|
234
|
+
console.log(' Fastest options:');
|
|
235
|
+
console.log(colors.cyan(' export ANTHROPIC_API_KEY=sk-ant-...') + colors.dim(' (Claude models — recommended)'));
|
|
236
|
+
console.log(colors.cyan(' export OPENAI_API_KEY=sk-...'));
|
|
237
|
+
console.log(colors.cyan(' export COHERE_API_KEY=...'));
|
|
238
|
+
console.log(colors.cyan(' export CODEHERE_AI_PROVIDER=local') + colors.dim(' (Ollama — no key needed)'));
|
|
239
|
+
newline();
|
|
240
|
+
console.log(colors.dim(' These work right now, no key needed:'));
|
|
241
|
+
console.log(colors.dim(' codehere trust .'));
|
|
242
|
+
console.log(colors.dim(' codehere hook status'));
|
|
243
|
+
console.log(colors.dim(' codehere serve'));
|
|
244
|
+
newline();
|
|
245
|
+
process.exit(1);
|
|
246
|
+
}
|
|
213
247
|
// Status indicator
|
|
214
248
|
export function statusIndicator(status) {
|
|
215
249
|
const map = {
|
|
@@ -225,17 +259,16 @@ export function statusIndicator(status) {
|
|
|
225
259
|
export function createCodehereLogo() {
|
|
226
260
|
const text = 'codehere';
|
|
227
261
|
const letters = text.split('');
|
|
228
|
-
// Color stops: coral →
|
|
229
|
-
// RGB values for smooth gradient
|
|
262
|
+
// Color stops: coral → blue (matches landing page #ff9a76 → #4a90e2)
|
|
230
263
|
const colorStops = [
|
|
231
|
-
{ r: 255, g:
|
|
232
|
-
{ r: 255, g:
|
|
233
|
-
{ r: 230, g:
|
|
234
|
-
{ r: 200, g:
|
|
235
|
-
{ r:
|
|
236
|
-
{ r:
|
|
237
|
-
{ r:
|
|
238
|
-
{ r:
|
|
264
|
+
{ r: 255, g: 154, b: 118 }, // #ff9a76 coral
|
|
265
|
+
{ r: 255, g: 148, b: 110 },
|
|
266
|
+
{ r: 230, g: 148, b: 130 },
|
|
267
|
+
{ r: 200, g: 150, b: 155 },
|
|
268
|
+
{ r: 160, g: 155, b: 190 },
|
|
269
|
+
{ r: 120, g: 158, b: 218 },
|
|
270
|
+
{ r: 85, g: 150, b: 232 },
|
|
271
|
+
{ r: 74, g: 144, b: 226 }, // #4a90e2 blue
|
|
239
272
|
];
|
|
240
273
|
// Map each letter to a color
|
|
241
274
|
const coloredLetters = letters.map((letter, index) => {
|
|
@@ -252,7 +285,7 @@ import { getVersionWithPrefix } from './utils/version.js';
|
|
|
252
285
|
export function createWelcomeMessage() {
|
|
253
286
|
const logo = createCodehereLogo();
|
|
254
287
|
const version = getVersionWithPrefix();
|
|
255
|
-
const tagline = 'AI
|
|
288
|
+
const tagline = 'AI coding agent with built-in safety';
|
|
256
289
|
return `
|
|
257
290
|
${colors.bold(logo)} ${colors.dim(version)}
|
|
258
291
|
${colors.dim(tagline)}
|
|
@@ -320,15 +353,98 @@ export function createSessionWelcome() {
|
|
|
320
353
|
welcomeBox += createLine(colors.dim(tip2));
|
|
321
354
|
welcomeBox += borderColor('│') + ' '.repeat(width - 2) + borderColor('│\n');
|
|
322
355
|
// Quick examples
|
|
323
|
-
const examplesHeader = 'Quick
|
|
356
|
+
const examplesHeader = 'Quick start:';
|
|
324
357
|
welcomeBox += createLine(colors.cyan(examplesHeader));
|
|
325
|
-
const example1 = ' •
|
|
358
|
+
const example1 = ' • codehere hook install — activate pre-execution scanning';
|
|
326
359
|
welcomeBox += createLine(colors.dim(example1));
|
|
327
|
-
const example2 = ' •
|
|
360
|
+
const example2 = ' • codehere trust . — score this codebase (no API key needed)';
|
|
328
361
|
welcomeBox += createLine(colors.dim(example2));
|
|
329
|
-
const example3 = ' •
|
|
362
|
+
const example3 = ' • codehere report — generate shareable audit report';
|
|
330
363
|
welcomeBox += createLine(colors.dim(example3));
|
|
331
364
|
welcomeBox += borderColor('└' + '─'.repeat(width - 2) + '┘');
|
|
332
365
|
return welcomeBox;
|
|
333
366
|
}
|
|
367
|
+
// ── Delight utilities ─────────────────────────────────────────────────────────
|
|
368
|
+
const THINKING_MESSAGES = [
|
|
369
|
+
'On it...',
|
|
370
|
+
'Let me look...',
|
|
371
|
+
'Thinking...',
|
|
372
|
+
'One sec...',
|
|
373
|
+
'Reading your code...',
|
|
374
|
+
'Working through this...',
|
|
375
|
+
'Bear with me...',
|
|
376
|
+
'Pulling it together...',
|
|
377
|
+
];
|
|
378
|
+
const FAREWELL_MESSAGES = [
|
|
379
|
+
'See you later! 👋',
|
|
380
|
+
'Happy shipping!',
|
|
381
|
+
'Good luck out there.',
|
|
382
|
+
'Back to building.',
|
|
383
|
+
'See you on the next one.',
|
|
384
|
+
'Later! Go build something great.',
|
|
385
|
+
'Until next time.',
|
|
386
|
+
];
|
|
387
|
+
const CLEAN_SCAN_CELEBRATIONS = [
|
|
388
|
+
'Perfect score. Nothing to worry about.',
|
|
389
|
+
'All clear — clean scan.',
|
|
390
|
+
'Zero findings. Enjoy the green.',
|
|
391
|
+
'Nothing suspicious. Carry on.',
|
|
392
|
+
'Clean as a whistle.',
|
|
393
|
+
];
|
|
394
|
+
export function randomThinkingMessage() {
|
|
395
|
+
return colors.dim(THINKING_MESSAGES[Math.floor(Math.random() * THINKING_MESSAGES.length)]);
|
|
396
|
+
}
|
|
397
|
+
export function randomFarewell() {
|
|
398
|
+
return info(FAREWELL_MESSAGES[Math.floor(Math.random() * FAREWELL_MESSAGES.length)]);
|
|
399
|
+
}
|
|
400
|
+
export function randomCleanScan() {
|
|
401
|
+
return CLEAN_SCAN_CELEBRATIONS[Math.floor(Math.random() * CLEAN_SCAN_CELEBRATIONS.length)];
|
|
402
|
+
}
|
|
403
|
+
export const SLASH_COMMANDS = [
|
|
404
|
+
// AI-powered
|
|
405
|
+
{ name: 'ask', args: '<question>', description: 'Ask anything about your codebase' },
|
|
406
|
+
{ name: 'explain', args: '<file>', description: 'Explain a file' },
|
|
407
|
+
{ name: 'fix', args: '<file> <hint>', description: 'Apply a targeted fix' },
|
|
408
|
+
{ name: 'review', args: '<file>', description: 'Code review with findings' },
|
|
409
|
+
{ name: 'plan', args: '<goal>', description: 'Break a goal into steps' },
|
|
410
|
+
{ name: 'suggest', args: '<query>', description: 'Read-only assistant — no changes' },
|
|
411
|
+
{ name: 'test', args: '<file>', description: 'Generate tests for a file' },
|
|
412
|
+
{ name: 'docs', args: '<type>', description: 'Generate documentation' },
|
|
413
|
+
{ name: 'refactor', args: '<pattern> <instr>', description: 'Refactor across files' },
|
|
414
|
+
{ name: 'orchestrate', args: '<goal>', description: 'Multi-agent workflow' },
|
|
415
|
+
{ name: 'run', args: '<goal>', description: 'Execute a task or goal' },
|
|
416
|
+
{ name: 'git-review', args: '', description: 'Review git changes' },
|
|
417
|
+
// Safety & config (no key)
|
|
418
|
+
{ name: 'trust', args: '[path]', description: 'Scan for vulnerabilities', noKey: true },
|
|
419
|
+
{ name: 'report', args: '[path]', description: 'Security audit report', noKey: true },
|
|
420
|
+
{ name: 'hook', args: '[install|status]', description: 'Safety hook management', noKey: true },
|
|
421
|
+
{ name: 'status', args: '', description: 'Dashboard — hook activity', noKey: true },
|
|
422
|
+
{ name: 'health', args: '', description: 'System health check', noKey: true },
|
|
423
|
+
{ name: 'index', args: '', description: 'Build the search index' },
|
|
424
|
+
{ name: 'serve', args: '', description: 'Start MCP server', noKey: true },
|
|
425
|
+
{ name: 'setup', args: '', description: 'Configure API provider', noKey: true },
|
|
426
|
+
{ name: 'config', args: '[key] [value]', description: 'Manage preferences', noKey: true },
|
|
427
|
+
{ name: 'cost', args: '', description: 'View API cost tracking', noKey: true },
|
|
428
|
+
{ name: 'models', args: '', description: 'List available AI models', noKey: true },
|
|
429
|
+
{ name: 'undo', args: '<file>', description: 'Undo file changes', noKey: true },
|
|
430
|
+
// Utility
|
|
431
|
+
{ name: 'help', args: '', description: 'Command reference', noKey: true },
|
|
432
|
+
{ name: 'clear', args: '', description: 'Clear the screen', noKey: true },
|
|
433
|
+
{ name: 'exit', args: '', description: 'Leave the session', noKey: true },
|
|
434
|
+
];
|
|
435
|
+
export function showSlashCommandMenu() {
|
|
436
|
+
newline();
|
|
437
|
+
console.log(colors.bold(' Slash commands'));
|
|
438
|
+
newline();
|
|
439
|
+
const maxNameLen = Math.max(...SLASH_COMMANDS.map(c => c.name.length + c.args.length)) + 1;
|
|
440
|
+
for (const cmd of SLASH_COMMANDS) {
|
|
441
|
+
const signature = `/${cmd.name}${cmd.args ? ' ' + cmd.args : ''}`;
|
|
442
|
+
const pad = ' '.repeat(Math.max(0, maxNameLen + 2 - signature.length + 8));
|
|
443
|
+
const badge = cmd.noKey ? colors.dim(' (no key)') : '';
|
|
444
|
+
console.log(` ${colors.cyan(signature)}${pad}${colors.dim(cmd.description)}${badge}`);
|
|
445
|
+
}
|
|
446
|
+
newline();
|
|
447
|
+
console.log(colors.dim(' Type any command with / prefix, or just ask a question directly.'));
|
|
448
|
+
newline();
|
|
449
|
+
}
|
|
334
450
|
//# sourceMappingURL=ui.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utility: Check API Status
|
|
3
|
-
* Checks if
|
|
3
|
+
* Checks if any AI provider API is available
|
|
4
4
|
*/
|
|
5
|
-
import { CohereClient } from 'cohere-ai';
|
|
6
5
|
import { config } from 'dotenv';
|
|
7
6
|
import { join, dirname } from 'path';
|
|
8
7
|
import { fileURLToPath } from 'url';
|
|
@@ -16,23 +15,42 @@ try {
|
|
|
16
15
|
catch { }
|
|
17
16
|
config();
|
|
18
17
|
export async function checkAPIStatus() {
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
18
|
+
const hasKey = !!(process.env.ANTHROPIC_API_KEY || process.env.OPENAI_API_KEY || process.env.COHERE_API_KEY);
|
|
19
|
+
if (!hasKey) {
|
|
21
20
|
return {
|
|
22
21
|
available: false,
|
|
23
22
|
rateLimited: false,
|
|
24
|
-
message: '
|
|
23
|
+
message: 'No API key found (ANTHROPIC_API_KEY, OPENAI_API_KEY, or COHERE_API_KEY)',
|
|
25
24
|
canProceed: false,
|
|
26
25
|
};
|
|
27
26
|
}
|
|
28
27
|
try {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
// Quick health check with whichever provider is available
|
|
29
|
+
if (process.env.ANTHROPIC_API_KEY) {
|
|
30
|
+
const r = await fetch('https://api.anthropic.com/v1/messages', {
|
|
31
|
+
method: 'POST',
|
|
32
|
+
headers: { 'x-api-key': process.env.ANTHROPIC_API_KEY, 'anthropic-version': '2023-06-01', 'content-type': 'application/json' },
|
|
33
|
+
body: JSON.stringify({ model: 'claude-sonnet-4-20250514', max_tokens: 1, messages: [{ role: 'user', content: 'hi' }] }),
|
|
34
|
+
});
|
|
35
|
+
if (!r.ok && r.status === 429)
|
|
36
|
+
throw Object.assign(new Error('Rate limited'), { status: 429 });
|
|
37
|
+
if (!r.ok)
|
|
38
|
+
throw new Error(`Anthropic API error: ${r.status}`);
|
|
39
|
+
}
|
|
40
|
+
else if (process.env.OPENAI_API_KEY) {
|
|
41
|
+
const r = await fetch('https://api.openai.com/v1/models', {
|
|
42
|
+
headers: { 'Authorization': `Bearer ${process.env.OPENAI_API_KEY}` },
|
|
43
|
+
});
|
|
44
|
+
if (!r.ok && r.status === 429)
|
|
45
|
+
throw Object.assign(new Error('Rate limited'), { status: 429 });
|
|
46
|
+
if (!r.ok)
|
|
47
|
+
throw new Error(`OpenAI API error: ${r.status}`);
|
|
48
|
+
}
|
|
49
|
+
else if (process.env.COHERE_API_KEY) {
|
|
50
|
+
const { CohereClient } = require('cohere-ai');
|
|
51
|
+
const client = new CohereClient({ token: process.env.COHERE_API_KEY });
|
|
52
|
+
await client.embed({ texts: ['test'], model: 'embed-english-v3.0', inputType: 'search_document' });
|
|
53
|
+
}
|
|
36
54
|
return {
|
|
37
55
|
available: true,
|
|
38
56
|
rateLimited: false,
|
|
@@ -112,51 +112,26 @@ export function applyEditFallback(originalContent, diff) {
|
|
|
112
112
|
}
|
|
113
113
|
// Clean the diff
|
|
114
114
|
let cleanDiff = diff.trim();
|
|
115
|
-
// Strategy 1: Extract from markdown code blocks
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const blockContent = match[1].trim();
|
|
120
|
-
if (blockContent.length > largestBlock.length) {
|
|
121
|
-
largestBlock = blockContent;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (largestBlock) {
|
|
125
|
-
console.log('[DiffParser] Strategy 1: Extracted from code block, length:', largestBlock.length);
|
|
126
|
-
cleanDiff = largestBlock;
|
|
115
|
+
// Strategy 1: Extract from markdown code blocks
|
|
116
|
+
const codeBlockMatch = cleanDiff.match(/```(?:\w+)?\n([\s\S]*?)\n```/);
|
|
117
|
+
if (codeBlockMatch) {
|
|
118
|
+
cleanDiff = codeBlockMatch[1].trim();
|
|
127
119
|
}
|
|
128
120
|
// Strategy 2: Check if it's a complete file (no diff markers)
|
|
129
121
|
const hasDiffMarkers = cleanDiff.includes('---') || cleanDiff.includes('+++') || cleanDiff.includes('@@');
|
|
130
122
|
// If no diff markers and substantial content, treat as complete file
|
|
131
123
|
if (!hasDiffMarkers) {
|
|
132
|
-
//
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const looksLikeCode = /\bfunction\b/i.test(cleanDiff) ||
|
|
141
|
-
/\bclass\b/i.test(cleanDiff) ||
|
|
142
|
-
/\bimport\b/i.test(cleanDiff) ||
|
|
143
|
-
/\bexport\b/i.test(cleanDiff) ||
|
|
144
|
-
/\bconst\b/i.test(cleanDiff) ||
|
|
145
|
-
/\basync\b/i.test(cleanDiff) ||
|
|
146
|
-
/\bconsole\b/i.test(cleanDiff) ||
|
|
147
|
-
/\breturn\b/i.test(cleanDiff) ||
|
|
148
|
-
/\bif\s+/i.test(cleanDiff) ||
|
|
149
|
-
/\btry\s*{/i.test(cleanDiff) ||
|
|
150
|
-
/\bcatch\s*\(/i.test(cleanDiff) ||
|
|
151
|
-
cleanDiff.includes('{') && cleanDiff.includes('}'); // Has code blocks
|
|
152
|
-
if (isSubstantial && (looksLikeCode || isDifferent)) {
|
|
124
|
+
// Verify it looks like code (has common patterns)
|
|
125
|
+
const looksLikeCode = cleanDiff.includes('function') ||
|
|
126
|
+
cleanDiff.includes('class') ||
|
|
127
|
+
cleanDiff.includes('import') ||
|
|
128
|
+
cleanDiff.includes('export') ||
|
|
129
|
+
cleanDiff.includes('const') ||
|
|
130
|
+
cleanDiff.includes('async');
|
|
131
|
+
if (looksLikeCode && cleanDiff.length > 100) {
|
|
153
132
|
// Likely complete file content
|
|
154
|
-
console.log('[DiffParser] Strategy 2 matched: complete file content detected');
|
|
155
133
|
return cleanDiff;
|
|
156
134
|
}
|
|
157
|
-
else {
|
|
158
|
-
console.log('[DiffParser] Strategy 2 failed:', { isSubstantial, looksLikeCode, isDifferent, cleanDiffLength: cleanDiff.length, originalLength: originalContent.length });
|
|
159
|
-
}
|
|
160
135
|
}
|
|
161
136
|
// Strategy 3: Try unified diff parsing if it has diff markers
|
|
162
137
|
if (hasDiffMarkers) {
|
|
@@ -171,22 +146,17 @@ export function applyEditFallback(originalContent, diff) {
|
|
|
171
146
|
}
|
|
172
147
|
}
|
|
173
148
|
catch (error) {
|
|
174
|
-
|
|
149
|
+
if (process.env.CODEHERE_DEBUG === '1')
|
|
150
|
+
console.warn('[DiffParser] Unified diff parsing failed:', error);
|
|
175
151
|
}
|
|
176
152
|
}
|
|
177
|
-
// Strategy 4: Last resort - if it's substantial content
|
|
178
|
-
if (cleanDiff.length >
|
|
179
|
-
cleanDiff !== originalContent.trim() &&
|
|
180
|
-
!cleanDiff.startsWith('---') &&
|
|
181
|
-
!cleanDiff.startsWith('+++') &&
|
|
182
|
-
!cleanDiff.toLowerCase().includes('here is') &&
|
|
183
|
-
!cleanDiff.toLowerCase().includes('here\'s') &&
|
|
184
|
-
!cleanDiff.toLowerCase().startsWith('the modified')) {
|
|
153
|
+
// Strategy 4: Last resort - if it's substantial content, use it
|
|
154
|
+
if (cleanDiff.length > 200 && !cleanDiff.startsWith('---') && !cleanDiff.startsWith('+++')) {
|
|
185
155
|
return cleanDiff;
|
|
186
156
|
}
|
|
187
157
|
// Strategy 5: If all else fails, return original (safer than broken code)
|
|
188
|
-
|
|
189
|
-
|
|
158
|
+
if (process.env.CODEHERE_DEBUG === '1')
|
|
159
|
+
console.warn('[DiffParser] Could not parse diff, returning original content');
|
|
190
160
|
return originalContent;
|
|
191
161
|
}
|
|
192
162
|
//# sourceMappingURL=diff-parser.js.map
|
|
@@ -193,23 +193,24 @@ async function verifyJavaScriptSyntax(filepath, code, options = {}) {
|
|
|
193
193
|
const errors = [];
|
|
194
194
|
const warnings = [];
|
|
195
195
|
try {
|
|
196
|
-
//
|
|
197
|
-
|
|
196
|
+
// Syntax check: write to temp file and use node --check (parse-only, no execution)
|
|
197
|
+
const tmpFile = join(tmpdir(), `codehere-syntax-${Date.now()}.js`);
|
|
198
198
|
try {
|
|
199
|
-
|
|
199
|
+
writeFileSync(tmpFile, code, 'utf-8');
|
|
200
|
+
execSync(`node --check "${tmpFile}"`, { stdio: 'pipe' });
|
|
200
201
|
}
|
|
201
202
|
catch (parseError) {
|
|
202
|
-
|
|
203
|
-
const errorMsg = parseError.message || String(parseError);
|
|
204
|
-
// Try to extract line number if available
|
|
203
|
+
const errorMsg = parseError instanceof Error ? parseError.message : String(parseError);
|
|
205
204
|
const lineMatch = errorMsg.match(/line (\d+)/i) || errorMsg.match(/:(\d+):/);
|
|
206
205
|
const lineNum = lineMatch ? lineMatch[1] : '?';
|
|
207
206
|
errors.push(`Syntax error at line ${lineNum}: ${errorMsg}`);
|
|
208
|
-
return {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
207
|
+
return { success: false, errors, warnings };
|
|
208
|
+
}
|
|
209
|
+
finally {
|
|
210
|
+
try {
|
|
211
|
+
unlinkSync(tmpFile);
|
|
212
|
+
}
|
|
213
|
+
catch { /* ignore */ }
|
|
213
214
|
}
|
|
214
215
|
// Additional check: Try to parse as ES module
|
|
215
216
|
// This catches import/export syntax errors
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codehere",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Know what your AI agent actually did — scans every AI write before it touches your codebase",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
@@ -13,17 +13,20 @@
|
|
|
13
13
|
"LICENSE"
|
|
14
14
|
],
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"prepublishOnly": "npm run build && find dist -name '*.map' -delete && find dist -name '*.d.ts' -delete",
|
|
17
18
|
"start": "node dist/index.js",
|
|
18
19
|
"start:api": "npm run build && node dist/api/server.js",
|
|
19
20
|
"dev": "tsx src/index.ts",
|
|
20
21
|
"dev:api": "tsx api/server.ts",
|
|
21
|
-
"test": "npm run build &&
|
|
22
|
-
"test:
|
|
23
|
-
"test:execution": "npm run build && tsx ./test/run-comprehensive-test-execution.ts",
|
|
24
|
-
"test:suite": "npm run build && tsx test/test-suite.ts",
|
|
25
|
-
"test:integration": "npm run build && tsx test/integration/run-integration-tests.ts",
|
|
22
|
+
"test": "npm run build && vitest run",
|
|
23
|
+
"test:unit": "npm run build && tsx test/unit/run-unit-tests.ts",
|
|
26
24
|
"test:cli": "npm run build && tsx test/integration/run-cli-tests.ts",
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"lint": "eslint src/ --ext .ts",
|
|
27
|
+
"format": "prettier --write 'src/**/*.ts' 'test/**/*.ts'",
|
|
28
|
+
"format:check": "prettier --check 'src/**/*.ts' 'test/**/*.ts'",
|
|
29
|
+
"test:integration": "npm run build && tsx test/integration/run-integration-tests.ts",
|
|
27
30
|
"test:scenarios": "npm run build && tsx test/scenarios/real-world-scenarios.ts",
|
|
28
31
|
"test:security": "npm run build && tsx test/security/sast-scanner.test.ts",
|
|
29
32
|
"test:security-gate": "npm run build && tsx test/security/security-gate.test.ts",
|
|
@@ -35,8 +38,7 @@
|
|
|
35
38
|
"test:compound-instruction": "npm run build && tsx test/compound-instruction/compound-instruction.test.ts",
|
|
36
39
|
"check-api": "npm run build && tsx -e \"import('./dist/utils/check-api-status.js').then(m => m.checkAPIStatus().then(s => { console.log(s.canProceed ? '✅ ' + s.message : '❌ ' + s.message); process.exit(s.canProceed ? 0 : 1); }))\"",
|
|
37
40
|
"test:all": "npm run build && npm run test:integration && npm run test:scenarios && npm run test:security && npm run test:security-gate && npm run test:git-workflow && npm run test:memory && npm run test:performance",
|
|
38
|
-
"test:
|
|
39
|
-
"test:coverage": "jest --coverage",
|
|
41
|
+
"test:coverage": "c8 npm run test:unit && c8 report --reporter=text --reporter=html",
|
|
40
42
|
"test:rerank": "tsx test/rerank-integration.test.ts",
|
|
41
43
|
"eval:command-r": "tsx test/command-a-evaluation.test.ts",
|
|
42
44
|
"test:verification": "npm run build && node test-verification-simple.js",
|
|
@@ -46,33 +48,24 @@
|
|
|
46
48
|
"smoke:cohere": "npm run build && tsx scripts/smoke-cohere.ts",
|
|
47
49
|
"smoke:openai": "npm run build && tsx scripts/smoke-openai.ts",
|
|
48
50
|
"test:real-providers": "npm run build && tsx test/integration/real-provider-comprehensive.test.ts",
|
|
49
|
-
"test:user-flows": "npm run build && tsx test/integration/user-flow-validation.test.ts"
|
|
50
|
-
"test:jest": "jest",
|
|
51
|
-
"test:integration:jest": "jest --testPathPatterns=integration",
|
|
52
|
-
"test:watch": "jest --watch"
|
|
51
|
+
"test:user-flows": "npm run build && tsx test/integration/user-flow-validation.test.ts"
|
|
53
52
|
},
|
|
54
53
|
"keywords": [
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
54
|
+
"ai-coding-agent",
|
|
55
|
+
"code-security",
|
|
56
|
+
"sast",
|
|
57
|
+
"trust-scoring",
|
|
58
|
+
"ai-safety",
|
|
58
59
|
"multi-agent",
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"cohere",
|
|
64
|
-
"openai",
|
|
65
|
-
"openrouter",
|
|
66
|
-
"ollama",
|
|
67
|
-
"local-llm",
|
|
68
|
-
"provider-abstraction",
|
|
69
|
-
"multi-provider",
|
|
70
|
-
"typescript",
|
|
60
|
+
"orchestration",
|
|
61
|
+
"claude-code",
|
|
62
|
+
"cursor",
|
|
63
|
+
"coding-assistant",
|
|
71
64
|
"cli-tool",
|
|
72
|
-
"code-
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
65
|
+
"code-review",
|
|
66
|
+
"hook-system",
|
|
67
|
+
"audit-trail",
|
|
68
|
+
"typescript"
|
|
76
69
|
],
|
|
77
70
|
"author": "Muhammad Ega",
|
|
78
71
|
"license": "MIT",
|
|
@@ -86,12 +79,11 @@
|
|
|
86
79
|
"homepage": "https://codehere.uk",
|
|
87
80
|
"logo": "https://codehere.uk/icon.svg",
|
|
88
81
|
"dependencies": {
|
|
89
|
-
"@aws-sdk/credential-providers": "^3.955.0",
|
|
90
82
|
"boxen": "^8.0.1",
|
|
91
83
|
"chalk": "^5.3.0",
|
|
92
84
|
"cli-progress": "^3.12.0",
|
|
93
85
|
"cli-table3": "^0.6.5",
|
|
94
|
-
"cohere-ai": "^7.
|
|
86
|
+
"cohere-ai": "^7.7.0",
|
|
95
87
|
"commander": "^11.1.0",
|
|
96
88
|
"cors": "^2.8.5",
|
|
97
89
|
"diff": "^5.1.0",
|
|
@@ -99,27 +91,28 @@
|
|
|
99
91
|
"express": "^5.1.0",
|
|
100
92
|
"get-tsconfig": "^4.13.0",
|
|
101
93
|
"inquirer": "^13.0.1",
|
|
102
|
-
"ora": "^
|
|
94
|
+
"ora": "^7.0.1",
|
|
103
95
|
"resolve-pkg-maps": "^1.0.0",
|
|
104
96
|
"sql.js": "^1.10.3",
|
|
105
97
|
"tiktoken": "^1.0.10",
|
|
106
|
-
"typescript": "^5.9.3",
|
|
107
98
|
"wrap-ansi": "^9.0.2"
|
|
108
99
|
},
|
|
109
100
|
"devDependencies": {
|
|
110
|
-
"@
|
|
101
|
+
"@eslint/js": "^10.0.1",
|
|
111
102
|
"@types/cli-progress": "^3.11.5",
|
|
112
103
|
"@types/cors": "^2.8.19",
|
|
113
104
|
"@types/diff": "^5.0.8",
|
|
114
105
|
"@types/express": "^5.0.5",
|
|
115
|
-
"@types/
|
|
116
|
-
"@types/node": "^20.19.27",
|
|
106
|
+
"@types/node": "^20.19.25",
|
|
117
107
|
"@types/sql.js": "^1.4.8",
|
|
118
108
|
"@types/supertest": "^6.0.3",
|
|
119
109
|
"c8": "^10.1.3",
|
|
120
|
-
"
|
|
110
|
+
"eslint": "^10.2.0",
|
|
111
|
+
"prettier": "^3.8.3",
|
|
121
112
|
"supertest": "^7.1.4",
|
|
122
|
-
"
|
|
123
|
-
"
|
|
113
|
+
"tsx": "^4.21.0",
|
|
114
|
+
"typescript": "^5.9.3",
|
|
115
|
+
"typescript-eslint": "^8.58.2",
|
|
116
|
+
"vitest": "^4.1.4"
|
|
124
117
|
}
|
|
125
118
|
}
|