codehere 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of codehere might be problematic. Click here for more details.
- package/README.md +223 -42
- package/dist/application/agents/documentation-agent.d.ts +24 -0
- package/dist/application/agents/documentation-agent.d.ts.map +1 -0
- package/dist/application/agents/documentation-agent.js +399 -0
- package/dist/application/agents/documentation-agent.js.map +1 -0
- package/dist/application/agents/execution-agent.d.ts +11 -0
- package/dist/application/agents/execution-agent.d.ts.map +1 -1
- package/dist/application/agents/execution-agent.js +289 -80
- package/dist/application/agents/execution-agent.js.map +1 -1
- package/dist/application/agents/multi-agent-orchestrator.d.ts +4 -0
- package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
- package/dist/application/agents/multi-agent-orchestrator.js +86 -0
- package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
- package/dist/application/agents/planning-agent.d.ts +3 -0
- package/dist/application/agents/planning-agent.d.ts.map +1 -1
- package/dist/application/agents/planning-agent.js +132 -64
- package/dist/application/agents/planning-agent.js.map +1 -1
- package/dist/application/agents/product-requirements-agent.d.ts +21 -0
- package/dist/application/agents/product-requirements-agent.d.ts.map +1 -0
- package/dist/application/agents/product-requirements-agent.js +247 -0
- package/dist/application/agents/product-requirements-agent.js.map +1 -0
- package/dist/application/agents/validation-agent.d.ts +5 -1
- package/dist/application/agents/validation-agent.d.ts.map +1 -1
- package/dist/application/agents/validation-agent.js +156 -21
- package/dist/application/agents/validation-agent.js.map +1 -1
- package/dist/application/services/dependency-container.d.ts +25 -2
- package/dist/application/services/dependency-container.d.ts.map +1 -1
- package/dist/application/services/dependency-container.js +163 -1
- package/dist/application/services/dependency-container.js.map +1 -1
- package/dist/application/services/intelligent-router.d.ts +13 -0
- package/dist/application/services/intelligent-router.d.ts.map +1 -1
- package/dist/application/services/intelligent-router.js +300 -87
- package/dist/application/services/intelligent-router.js.map +1 -1
- package/dist/application/use-cases/ask-question-use-case.d.ts +31 -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 +254 -55
- 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 +86 -4
- package/dist/application/use-cases/edit-file-use-case.js.map +1 -1
- package/dist/application/use-cases/planning-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/planning-use-case.js +10 -1
- package/dist/application/use-cases/planning-use-case.js.map +1 -1
- package/dist/application/use-cases/react-orchestration-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/react-orchestration-use-case.js +6 -2
- package/dist/application/use-cases/react-orchestration-use-case.js.map +1 -1
- package/dist/domain/entities/documentation.d.ts +35 -0
- package/dist/domain/entities/documentation.d.ts.map +1 -0
- package/dist/domain/entities/documentation.js +6 -0
- package/dist/domain/entities/documentation.js.map +1 -0
- package/dist/domain/entities/product-requirements.d.ts +50 -0
- package/dist/domain/entities/product-requirements.d.ts.map +1 -0
- package/dist/domain/entities/product-requirements.js +6 -0
- package/dist/domain/entities/product-requirements.js.map +1 -0
- package/dist/domain/entities/task.d.ts +152 -0
- package/dist/domain/entities/task.d.ts.map +1 -0
- package/dist/domain/entities/task.js +61 -0
- package/dist/domain/entities/task.js.map +1 -0
- package/dist/domain/interfaces/agent.interface.d.ts +15 -0
- package/dist/domain/interfaces/agent.interface.d.ts.map +1 -0
- package/dist/domain/interfaces/agent.interface.js +6 -0
- package/dist/domain/interfaces/agent.interface.js.map +1 -0
- package/dist/domain/services/environment-mode-manager.d.ts +18 -0
- package/dist/domain/services/environment-mode-manager.d.ts.map +1 -0
- package/dist/domain/services/environment-mode-manager.js +37 -0
- package/dist/domain/services/environment-mode-manager.js.map +1 -0
- package/dist/domain/services/react-loop.d.ts +8 -0
- package/dist/domain/services/react-loop.d.ts.map +1 -1
- package/dist/domain/services/react-loop.js +82 -6
- package/dist/domain/services/react-loop.js.map +1 -1
- package/dist/domain/services/risk-tier-detector.d.ts +18 -0
- package/dist/domain/services/risk-tier-detector.d.ts.map +1 -0
- package/dist/domain/services/risk-tier-detector.js +65 -0
- package/dist/domain/services/risk-tier-detector.js.map +1 -0
- package/dist/formatter.d.ts +2 -2
- package/dist/formatter.d.ts.map +1 -1
- package/dist/formatter.js +40 -20
- package/dist/formatter.js.map +1 -1
- package/dist/index.js +218 -125
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.d.ts +3 -1
- package/dist/infrastructure/ai/cohere-ai-service.d.ts.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.js +65 -5
- package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
- package/dist/infrastructure/ai/fake-ai-service.d.ts +22 -0
- package/dist/infrastructure/ai/fake-ai-service.d.ts.map +1 -0
- package/dist/infrastructure/ai/fake-ai-service.js +59 -0
- package/dist/infrastructure/ai/fake-ai-service.js.map +1 -0
- package/dist/infrastructure/ai/provider-ai-service.d.ts +59 -0
- package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -0
- package/dist/infrastructure/ai/provider-ai-service.js +477 -0
- package/dist/infrastructure/ai/provider-ai-service.js.map +1 -0
- package/dist/infrastructure/cache/embedding-cache.d.ts +13 -1
- package/dist/infrastructure/cache/embedding-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/embedding-cache.js +80 -9
- package/dist/infrastructure/cache/embedding-cache.js.map +1 -1
- package/dist/infrastructure/cache/query-result-cache.d.ts +68 -0
- package/dist/infrastructure/cache/query-result-cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/query-result-cache.js +138 -0
- package/dist/infrastructure/cache/query-result-cache.js.map +1 -0
- package/dist/infrastructure/cache/response-cache.d.ts +86 -0
- package/dist/infrastructure/cache/response-cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/response-cache.js +224 -0
- package/dist/infrastructure/cache/response-cache.js.map +1 -0
- package/dist/infrastructure/cache/security-scan-cache.d.ts +57 -0
- package/dist/infrastructure/cache/security-scan-cache.d.ts.map +1 -0
- package/dist/infrastructure/cache/security-scan-cache.js +124 -0
- package/dist/infrastructure/cache/security-scan-cache.js.map +1 -0
- package/dist/infrastructure/completion/bash-completion.d.ts +8 -0
- package/dist/infrastructure/completion/bash-completion.d.ts.map +1 -0
- package/dist/infrastructure/completion/bash-completion.js +101 -0
- package/dist/infrastructure/completion/bash-completion.js.map +1 -0
- package/dist/infrastructure/completion/completion-generator.d.ts +42 -0
- package/dist/infrastructure/completion/completion-generator.d.ts.map +1 -0
- package/dist/infrastructure/completion/completion-generator.js +184 -0
- package/dist/infrastructure/completion/completion-generator.js.map +1 -0
- package/dist/infrastructure/completion/fish-completion.d.ts +8 -0
- package/dist/infrastructure/completion/fish-completion.d.ts.map +1 -0
- package/dist/infrastructure/completion/fish-completion.js +65 -0
- package/dist/infrastructure/completion/fish-completion.js.map +1 -0
- package/dist/infrastructure/completion/zsh-completion.d.ts +8 -0
- package/dist/infrastructure/completion/zsh-completion.d.ts.map +1 -0
- package/dist/infrastructure/completion/zsh-completion.js +85 -0
- package/dist/infrastructure/completion/zsh-completion.js.map +1 -0
- package/dist/infrastructure/context/context-compressor.d.ts +94 -0
- package/dist/infrastructure/context/context-compressor.d.ts.map +1 -0
- package/dist/infrastructure/context/context-compressor.js +329 -0
- package/dist/infrastructure/context/context-compressor.js.map +1 -0
- package/dist/infrastructure/context/conversation-context.d.ts +58 -0
- package/dist/infrastructure/context/conversation-context.d.ts.map +1 -0
- package/dist/infrastructure/context/conversation-context.js +170 -0
- package/dist/infrastructure/context/conversation-context.js.map +1 -0
- package/dist/infrastructure/context/session-manager.d.ts +26 -0
- package/dist/infrastructure/context/session-manager.d.ts.map +1 -0
- package/dist/infrastructure/context/session-manager.js +98 -0
- package/dist/infrastructure/context/session-manager.js.map +1 -0
- package/dist/infrastructure/cost/cost-tracker.d.ts +1 -0
- package/dist/infrastructure/cost/cost-tracker.d.ts.map +1 -1
- package/dist/infrastructure/cost/cost-tracker.js +12 -5
- package/dist/infrastructure/cost/cost-tracker.js.map +1 -1
- package/dist/infrastructure/governance/nist-ai-rmf.d.ts +6 -8
- package/dist/infrastructure/governance/nist-ai-rmf.d.ts.map +1 -1
- package/dist/infrastructure/governance/nist-ai-rmf.js +6 -8
- package/dist/infrastructure/governance/nist-ai-rmf.js.map +1 -1
- package/dist/infrastructure/governance/policy-as-code.d.ts +6 -8
- package/dist/infrastructure/governance/policy-as-code.d.ts.map +1 -1
- package/dist/infrastructure/governance/policy-as-code.js +24 -11
- package/dist/infrastructure/governance/policy-as-code.js.map +1 -1
- package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts +7 -9
- package/dist/infrastructure/governance/prompt-to-code-lineage.d.ts.map +1 -1
- package/dist/infrastructure/governance/prompt-to-code-lineage.js +7 -9
- package/dist/infrastructure/governance/prompt-to-code-lineage.js.map +1 -1
- package/dist/infrastructure/observability/execution-tracer.d.ts +5 -2
- package/dist/infrastructure/observability/execution-tracer.d.ts.map +1 -1
- package/dist/infrastructure/observability/execution-tracer.js +45 -8
- package/dist/infrastructure/observability/execution-tracer.js.map +1 -1
- package/dist/infrastructure/providers/cohere-provider.d.ts +39 -0
- package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/cohere-provider.js +359 -0
- package/dist/infrastructure/providers/cohere-provider.js.map +1 -0
- package/dist/infrastructure/providers/fake-provider.d.ts +43 -0
- package/dist/infrastructure/providers/fake-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/fake-provider.js +130 -0
- package/dist/infrastructure/providers/fake-provider.js.map +1 -0
- package/dist/infrastructure/providers/local-llm-provider.d.ts +49 -0
- package/dist/infrastructure/providers/local-llm-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/local-llm-provider.js +330 -0
- package/dist/infrastructure/providers/local-llm-provider.js.map +1 -0
- package/dist/infrastructure/providers/model-config.types.d.ts +70 -0
- package/dist/infrastructure/providers/model-config.types.d.ts.map +1 -0
- package/dist/infrastructure/providers/model-config.types.js +9 -0
- package/dist/infrastructure/providers/model-config.types.js.map +1 -0
- package/dist/infrastructure/providers/model-provider.interface.d.ts +113 -0
- package/dist/infrastructure/providers/model-provider.interface.d.ts.map +1 -0
- package/dist/infrastructure/providers/model-provider.interface.js +8 -0
- package/dist/infrastructure/providers/model-provider.interface.js.map +1 -0
- package/dist/infrastructure/providers/openai-provider.d.ts +38 -0
- package/dist/infrastructure/providers/openai-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/openai-provider.js +413 -0
- package/dist/infrastructure/providers/openai-provider.js.map +1 -0
- package/dist/infrastructure/providers/operation-provider-resolver.d.ts +48 -0
- package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -0
- package/dist/infrastructure/providers/operation-provider-resolver.js +105 -0
- package/dist/infrastructure/providers/operation-provider-resolver.js.map +1 -0
- package/dist/infrastructure/providers/provider-config-loader.d.ts +37 -0
- package/dist/infrastructure/providers/provider-config-loader.d.ts.map +1 -0
- package/dist/infrastructure/providers/provider-config-loader.js +120 -0
- package/dist/infrastructure/providers/provider-config-loader.js.map +1 -0
- package/dist/infrastructure/providers/provider-registry.d.ts +53 -0
- package/dist/infrastructure/providers/provider-registry.d.ts.map +1 -0
- package/dist/infrastructure/providers/provider-registry.js +88 -0
- package/dist/infrastructure/providers/provider-registry.js.map +1 -0
- package/dist/infrastructure/security/ai-sast-scanner.d.ts +4 -0
- package/dist/infrastructure/security/ai-sast-scanner.d.ts.map +1 -1
- package/dist/infrastructure/security/ai-sast-scanner.js +82 -4
- package/dist/infrastructure/security/ai-sast-scanner.js.map +1 -1
- package/dist/infrastructure/security/enhanced-security-gate.d.ts +2 -0
- package/dist/infrastructure/security/enhanced-security-gate.d.ts.map +1 -1
- package/dist/infrastructure/security/enhanced-security-gate.js +74 -15
- package/dist/infrastructure/security/enhanced-security-gate.js.map +1 -1
- package/dist/infrastructure/storage/plan-repository.d.ts +38 -0
- package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/plan-repository.js +133 -0
- package/dist/infrastructure/storage/plan-repository.js.map +1 -0
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +11 -0
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.js +121 -6
- package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -1
- package/dist/infrastructure/storage/task-helpers.d.ts +58 -0
- package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -0
- package/dist/infrastructure/storage/task-helpers.js +157 -0
- package/dist/infrastructure/storage/task-helpers.js.map +1 -0
- package/dist/infrastructure/storage/task-repository.d.ts +67 -0
- package/dist/infrastructure/storage/task-repository.d.ts.map +1 -0
- package/dist/infrastructure/storage/task-repository.js +205 -0
- package/dist/infrastructure/storage/task-repository.js.map +1 -0
- package/dist/infrastructure/ux/bi-directional-learning.d.ts +22 -0
- package/dist/infrastructure/ux/bi-directional-learning.d.ts.map +1 -1
- package/dist/infrastructure/ux/bi-directional-learning.js +144 -7
- package/dist/infrastructure/ux/bi-directional-learning.js.map +1 -1
- package/dist/infrastructure/ux/capability-boundaries.d.ts +50 -0
- package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -0
- package/dist/infrastructure/ux/capability-boundaries.js +167 -0
- package/dist/infrastructure/ux/capability-boundaries.js.map +1 -0
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts +63 -0
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -0
- package/dist/infrastructure/ux/comprehensive-formatter.js +212 -0
- package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -0
- package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +24 -0
- package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +1 -0
- package/dist/infrastructure/ux/contextual-feature-discovery.js +144 -0
- package/dist/infrastructure/ux/contextual-feature-discovery.js.map +1 -0
- package/dist/infrastructure/ux/expectation-management.d.ts +33 -0
- package/dist/infrastructure/ux/expectation-management.d.ts.map +1 -1
- package/dist/infrastructure/ux/expectation-management.js +138 -4
- package/dist/infrastructure/ux/expectation-management.js.map +1 -1
- package/dist/infrastructure/ux/feature-discovery.d.ts +47 -0
- package/dist/infrastructure/ux/feature-discovery.d.ts.map +1 -0
- package/dist/infrastructure/ux/feature-discovery.js +190 -0
- package/dist/infrastructure/ux/feature-discovery.js.map +1 -0
- package/dist/infrastructure/ux/feedback-prompt.d.ts +42 -0
- package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -0
- package/dist/infrastructure/ux/feedback-prompt.js +181 -0
- package/dist/infrastructure/ux/feedback-prompt.js.map +1 -0
- package/dist/infrastructure/ux/hitl-review-portal.d.ts +47 -0
- package/dist/infrastructure/ux/hitl-review-portal.d.ts.map +1 -0
- package/dist/infrastructure/ux/hitl-review-portal.js +228 -0
- package/dist/infrastructure/ux/hitl-review-portal.js.map +1 -0
- package/dist/infrastructure/ux/hitl-validation.d.ts +35 -0
- package/dist/infrastructure/ux/hitl-validation.d.ts.map +1 -1
- package/dist/infrastructure/ux/hitl-validation.js +86 -0
- package/dist/infrastructure/ux/hitl-validation.js.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.d.ts +55 -0
- package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -0
- package/dist/infrastructure/ux/progress-indicator.js +131 -0
- package/dist/infrastructure/ux/progress-indicator.js.map +1 -0
- package/dist/infrastructure/ux/progressive-disclosure.d.ts.map +1 -1
- package/dist/infrastructure/ux/progressive-disclosure.js +2 -1
- package/dist/infrastructure/ux/progressive-disclosure.js.map +1 -1
- package/dist/infrastructure/ux/proportional-friction.d.ts +73 -0
- package/dist/infrastructure/ux/proportional-friction.d.ts.map +1 -0
- package/dist/infrastructure/ux/proportional-friction.js +200 -0
- package/dist/infrastructure/ux/proportional-friction.js.map +1 -0
- package/dist/infrastructure/ux/review-checkpoint.d.ts +35 -0
- package/dist/infrastructure/ux/review-checkpoint.d.ts.map +1 -0
- package/dist/infrastructure/ux/review-checkpoint.js +119 -0
- package/dist/infrastructure/ux/review-checkpoint.js.map +1 -0
- package/dist/infrastructure/ux/staged-feature-intro.d.ts +47 -0
- package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +1 -0
- package/dist/infrastructure/ux/staged-feature-intro.js +144 -0
- package/dist/infrastructure/ux/staged-feature-intro.js.map +1 -0
- package/dist/infrastructure/ux/syntax-highlighter.d.ts +21 -0
- package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +1 -0
- package/dist/infrastructure/ux/syntax-highlighter.js +172 -0
- package/dist/infrastructure/ux/syntax-highlighter.js.map +1 -0
- package/dist/infrastructure/validation/agent-feedback.d.ts +115 -0
- package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -0
- package/dist/infrastructure/validation/agent-feedback.js +227 -0
- package/dist/infrastructure/validation/agent-feedback.js.map +1 -0
- package/dist/infrastructure/validation/agent-validation-helper.d.ts +75 -0
- package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -0
- package/dist/infrastructure/validation/agent-validation-helper.js +88 -0
- package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -0
- package/dist/infrastructure/validation/feedback-stats.d.ts +99 -0
- package/dist/infrastructure/validation/feedback-stats.d.ts.map +1 -0
- package/dist/infrastructure/validation/feedback-stats.js +173 -0
- package/dist/infrastructure/validation/feedback-stats.js.map +1 -0
- package/dist/infrastructure/validation/review-handler.d.ts +54 -0
- package/dist/infrastructure/validation/review-handler.d.ts.map +1 -0
- package/dist/infrastructure/validation/review-handler.js +206 -0
- package/dist/infrastructure/validation/review-handler.js.map +1 -0
- package/dist/infrastructure/validation/summary-aggregator.d.ts +42 -0
- package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -0
- package/dist/infrastructure/validation/summary-aggregator.js +156 -0
- package/dist/infrastructure/validation/summary-aggregator.js.map +1 -0
- package/dist/infrastructure/validation/summary-extractor.d.ts +59 -0
- package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -0
- package/dist/infrastructure/validation/summary-extractor.js +102 -0
- package/dist/infrastructure/validation/summary-extractor.js.map +1 -0
- package/dist/infrastructure/validation/trace-summary.d.ts +72 -0
- package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -0
- package/dist/infrastructure/validation/trace-summary.js +371 -0
- package/dist/infrastructure/validation/trace-summary.js.map +1 -0
- package/dist/infrastructure/validation/trust-config.d.ts +27 -0
- package/dist/infrastructure/validation/trust-config.d.ts.map +1 -0
- package/dist/infrastructure/validation/trust-config.js +113 -0
- package/dist/infrastructure/validation/trust-config.js.map +1 -0
- package/dist/infrastructure/xai/attention-visualizer.d.ts +6 -8
- package/dist/infrastructure/xai/attention-visualizer.d.ts.map +1 -1
- package/dist/infrastructure/xai/attention-visualizer.js +6 -8
- package/dist/infrastructure/xai/attention-visualizer.js.map +1 -1
- package/dist/infrastructure/xai/cot-visualizer.d.ts +6 -8
- package/dist/infrastructure/xai/cot-visualizer.d.ts.map +1 -1
- package/dist/infrastructure/xai/cot-visualizer.js +62 -18
- package/dist/infrastructure/xai/cot-visualizer.js.map +1 -1
- package/dist/infrastructure/xai/decision-tree-log.d.ts +6 -10
- package/dist/infrastructure/xai/decision-tree-log.d.ts.map +1 -1
- package/dist/infrastructure/xai/decision-tree-log.js +6 -10
- package/dist/infrastructure/xai/decision-tree-log.js.map +1 -1
- package/dist/infrastructure/xai/interactive-xai.d.ts +6 -8
- package/dist/infrastructure/xai/interactive-xai.d.ts.map +1 -1
- package/dist/infrastructure/xai/interactive-xai.js +6 -8
- package/dist/infrastructure/xai/interactive-xai.js.map +1 -1
- package/dist/infrastructure/xai/uncertainty-quantifier.d.ts +6 -9
- package/dist/infrastructure/xai/uncertainty-quantifier.d.ts.map +1 -1
- package/dist/infrastructure/xai/uncertainty-quantifier.js +6 -9
- package/dist/infrastructure/xai/uncertainty-quantifier.js.map +1 -1
- package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/ask-command.js +152 -13
- package/dist/presentation/cli/commands/ask-command.js.map +1 -1
- package/dist/presentation/cli/commands/docs-command.d.ts +12 -0
- package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/docs-command.js +196 -0
- package/dist/presentation/cli/commands/docs-command.js.map +1 -0
- package/dist/presentation/cli/commands/fix-command.d.ts +8 -0
- package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/fix-command.js +309 -0
- package/dist/presentation/cli/commands/fix-command.js.map +1 -0
- package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/help-command.js +2 -0
- package/dist/presentation/cli/commands/help-command.js.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.d.ts +2 -0
- package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.js +88 -1
- package/dist/presentation/cli/commands/orchestrate-command.js.map +1 -1
- package/dist/presentation/cli/commands/plan-command.d.ts +1 -0
- package/dist/presentation/cli/commands/plan-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/plan-command.js +136 -7
- package/dist/presentation/cli/commands/plan-command.js.map +1 -1
- package/dist/presentation/cli/commands/product-command.d.ts +12 -0
- package/dist/presentation/cli/commands/product-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/product-command.js +188 -0
- package/dist/presentation/cli/commands/product-command.js.map +1 -0
- package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/react-command.js +98 -16
- package/dist/presentation/cli/commands/react-command.js.map +1 -1
- package/dist/presentation/cli/commands/review-command.d.ts +14 -0
- package/dist/presentation/cli/commands/review-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/review-command.js +22 -0
- package/dist/presentation/cli/commands/review-command.js.map +1 -0
- package/dist/presentation/cli/commands/run-command.d.ts +15 -0
- package/dist/presentation/cli/commands/run-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/run-command.js +29 -0
- package/dist/presentation/cli/commands/run-command.js.map +1 -0
- package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/setup-command.js +67 -12
- package/dist/presentation/cli/commands/setup-command.js.map +1 -1
- package/dist/presentation/cli/commands/smart-command.d.ts +3 -1
- package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/smart-command.js +227 -23
- package/dist/presentation/cli/commands/smart-command.js.map +1 -1
- package/dist/presentation/cli/commands/status-command.d.ts +11 -0
- package/dist/presentation/cli/commands/status-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/status-command.js +176 -0
- package/dist/presentation/cli/commands/status-command.js.map +1 -0
- package/dist/presentation/cli/commands/suggest-command.d.ts +13 -0
- package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/suggest-command.js +25 -0
- package/dist/presentation/cli/commands/suggest-command.js.map +1 -0
- package/dist/presentation/cli/commands/trace-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/trace-command.js +9 -5
- package/dist/presentation/cli/commands/trace-command.js.map +1 -1
- package/dist/presentation/cli/commands/undo-command.js +15 -6
- package/dist/presentation/cli/commands/undo-command.js.map +1 -1
- package/dist/presentation/cli/error-display.d.ts +2 -0
- package/dist/presentation/cli/error-display.d.ts.map +1 -1
- package/dist/presentation/cli/error-display.js +220 -2
- package/dist/presentation/cli/error-display.js.map +1 -1
- package/dist/presentation/cli/keyboard-shortcuts.d.ts +27 -0
- package/dist/presentation/cli/keyboard-shortcuts.d.ts.map +1 -0
- package/dist/presentation/cli/keyboard-shortcuts.js +77 -0
- package/dist/presentation/cli/keyboard-shortcuts.js.map +1 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +39 -2
- package/dist/session.js.map +1 -1
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +8 -5
- package/dist/ui.js.map +1 -1
- package/dist/utils/version.js +2 -2
- package/dist/verification/backup.d.ts.map +1 -1
- package/dist/verification/backup.js +24 -3
- package/dist/verification/backup.js.map +1 -1
- package/dist/verification/compiler.js +47 -12
- package/dist/verification/compiler.js.map +1 -1
- package/package.json +10 -2
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain Entity: CodehereTask
|
|
3
|
+
* Task and workflow entities for the 4-mode interaction model
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha
|
|
6
|
+
* See: docs/ARCHITECTURE/TASK_MODEL.md
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Task Mode - The interaction mode that created this task
|
|
10
|
+
*/
|
|
11
|
+
export var TaskMode;
|
|
12
|
+
(function (TaskMode) {
|
|
13
|
+
TaskMode["SUGGEST"] = "suggest";
|
|
14
|
+
TaskMode["PLAN"] = "plan";
|
|
15
|
+
TaskMode["RUN"] = "run";
|
|
16
|
+
TaskMode["REVIEW"] = "review"; // HITL mode - inspection/approval
|
|
17
|
+
})(TaskMode || (TaskMode = {}));
|
|
18
|
+
/**
|
|
19
|
+
* Task Status - Current lifecycle state
|
|
20
|
+
*/
|
|
21
|
+
export var TaskStatus;
|
|
22
|
+
(function (TaskStatus) {
|
|
23
|
+
TaskStatus["CREATED"] = "created";
|
|
24
|
+
TaskStatus["PLANNED"] = "planned";
|
|
25
|
+
TaskStatus["RUNNING"] = "running";
|
|
26
|
+
TaskStatus["COMPLETED"] = "completed";
|
|
27
|
+
TaskStatus["FAILED"] = "failed";
|
|
28
|
+
TaskStatus["NEEDS_REVIEW"] = "needs_review";
|
|
29
|
+
TaskStatus["APPROVED"] = "approved";
|
|
30
|
+
TaskStatus["REJECTED"] = "rejected";
|
|
31
|
+
TaskStatus["CANCELLED"] = "cancelled"; // User cancelled task
|
|
32
|
+
})(TaskStatus || (TaskStatus = {}));
|
|
33
|
+
/**
|
|
34
|
+
* Risk Tier - Risk level for operation
|
|
35
|
+
*/
|
|
36
|
+
export var RiskTier;
|
|
37
|
+
(function (RiskTier) {
|
|
38
|
+
RiskTier["T1"] = "t1";
|
|
39
|
+
RiskTier["T2"] = "t2";
|
|
40
|
+
RiskTier["T3"] = "t3"; // High risk - explicit warning + confirmation
|
|
41
|
+
})(RiskTier || (RiskTier = {}));
|
|
42
|
+
/**
|
|
43
|
+
* Environment Mode - Data access boundaries
|
|
44
|
+
*/
|
|
45
|
+
export var EnvironmentMode;
|
|
46
|
+
(function (EnvironmentMode) {
|
|
47
|
+
EnvironmentMode["LOCAL"] = "local";
|
|
48
|
+
EnvironmentMode["ORG"] = "org";
|
|
49
|
+
EnvironmentMode["INTERNET"] = "internet"; // Full internet access (explicit opt-in)
|
|
50
|
+
})(EnvironmentMode || (EnvironmentMode = {}));
|
|
51
|
+
/**
|
|
52
|
+
* Review Status
|
|
53
|
+
*/
|
|
54
|
+
export var ReviewStatus;
|
|
55
|
+
(function (ReviewStatus) {
|
|
56
|
+
ReviewStatus["NOT_REQUIRED"] = "not_required";
|
|
57
|
+
ReviewStatus["PENDING"] = "pending";
|
|
58
|
+
ReviewStatus["APPROVED"] = "approved";
|
|
59
|
+
ReviewStatus["REJECTED"] = "rejected"; // User rejected
|
|
60
|
+
})(ReviewStatus || (ReviewStatus = {}));
|
|
61
|
+
//# sourceMappingURL=task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../../src/domain/entities/task.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,yBAAa,CAAA;IACb,uBAAW,CAAA;IACX,6BAAiB,CAAA,CAAK,kCAAkC;AAC1D,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,UAUX;AAVD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,2CAA6B,CAAA;IAC7B,mCAAqB,CAAA;IACrB,mCAAqB,CAAA;IACrB,qCAAuB,CAAA,CAAQ,sBAAsB;AACvD,CAAC,EAVW,UAAU,KAAV,UAAU,QAUrB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,qBAAS,CAAA;IACT,qBAAS,CAAA;IACT,qBAAS,CAAA,CAAG,8CAA8C;AAC5D,CAAC,EAJW,QAAQ,KAAR,QAAQ,QAInB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,8BAAW,CAAA;IACX,wCAAqB,CAAA,CAAE,yCAAyC;AAClE,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,6CAA6B,CAAA;IAC7B,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA,CAAW,gBAAgB;AAClD,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain Interface: IAgent
|
|
3
|
+
* Minimal agent abstraction for Codehere agents
|
|
4
|
+
*/
|
|
5
|
+
export type AgentType = 'engineering' | 'non-engineering';
|
|
6
|
+
/**
|
|
7
|
+
* Minimal agent interface
|
|
8
|
+
* Agents execute requests and return structured responses
|
|
9
|
+
*/
|
|
10
|
+
export interface IAgent<TRequest, TResponse> {
|
|
11
|
+
name: string;
|
|
12
|
+
type: AgentType;
|
|
13
|
+
execute(request: TRequest): Promise<TResponse>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=agent.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.interface.d.ts","sourceRoot":"","sources":["../../../src/domain/interfaces/agent.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,MAAM,CAAC,QAAQ,EAAE,SAAS;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAEhB,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.interface.js","sourceRoot":"","sources":["../../../src/domain/interfaces/agent.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain Service: Environment Mode Manager
|
|
3
|
+
* Manages environment mode (LOCAL/ORG/INTERNET) for data access boundaries
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha (minimal implementation)
|
|
6
|
+
* See: docs/ARCHITECTURE/INTERACTION_MODEL_MAPPING.md section 5
|
|
7
|
+
*/
|
|
8
|
+
import { EnvironmentMode } from '../entities/task.js';
|
|
9
|
+
/**
|
|
10
|
+
* Get current environment mode from config
|
|
11
|
+
* Phase 1: Simple default to LOCAL (full implementation deferred)
|
|
12
|
+
*/
|
|
13
|
+
export declare function getCurrentEnvironmentMode(): EnvironmentMode;
|
|
14
|
+
/**
|
|
15
|
+
* Get environment mode indicator string
|
|
16
|
+
*/
|
|
17
|
+
export declare function getEnvironmentModeIndicator(mode: EnvironmentMode): string;
|
|
18
|
+
//# sourceMappingURL=environment-mode-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-mode-manager.d.ts","sourceRoot":"","sources":["../../../src/domain/services/environment-mode-manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,eAAe,CAe3D;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAOzE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain Service: Environment Mode Manager
|
|
3
|
+
* Manages environment mode (LOCAL/ORG/INTERNET) for data access boundaries
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha (minimal implementation)
|
|
6
|
+
* See: docs/ARCHITECTURE/INTERACTION_MODEL_MAPPING.md section 5
|
|
7
|
+
*/
|
|
8
|
+
import { EnvironmentMode } from '../entities/task.js';
|
|
9
|
+
/**
|
|
10
|
+
* Get current environment mode from config
|
|
11
|
+
* Phase 1: Simple default to LOCAL (full implementation deferred)
|
|
12
|
+
*/
|
|
13
|
+
export function getCurrentEnvironmentMode() {
|
|
14
|
+
// TODO: Read from config in Phase 1
|
|
15
|
+
// For now, default to LOCAL (safest)
|
|
16
|
+
const envFromConfig = process.env.CODEHERE_ENVIRONMENT_MODE;
|
|
17
|
+
if (envFromConfig === 'org' || envFromConfig === 'ORG') {
|
|
18
|
+
return EnvironmentMode.ORG;
|
|
19
|
+
}
|
|
20
|
+
if (envFromConfig === 'internet' || envFromConfig === 'INTERNET') {
|
|
21
|
+
return EnvironmentMode.INTERNET;
|
|
22
|
+
}
|
|
23
|
+
// Default to LOCAL
|
|
24
|
+
return EnvironmentMode.LOCAL;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get environment mode indicator string
|
|
28
|
+
*/
|
|
29
|
+
export function getEnvironmentModeIndicator(mode) {
|
|
30
|
+
const indicators = {
|
|
31
|
+
[EnvironmentMode.LOCAL]: '[LOCAL]',
|
|
32
|
+
[EnvironmentMode.ORG]: '[ORG]',
|
|
33
|
+
[EnvironmentMode.INTERNET]: '[INTERNET] ⚠️',
|
|
34
|
+
};
|
|
35
|
+
return indicators[mode];
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=environment-mode-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-mode-manager.js","sourceRoot":"","sources":["../../../src/domain/services/environment-mode-manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;GAGG;AACH,MAAM,UAAU,yBAAyB;IACvC,oCAAoC;IACpC,qCAAqC;IACrC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC;IAE5D,IAAI,aAAa,KAAK,KAAK,IAAI,aAAa,KAAK,KAAK,EAAE,CAAC;QACvD,OAAO,eAAe,CAAC,GAAG,CAAC;IAC7B,CAAC;IAED,IAAI,aAAa,KAAK,UAAU,IAAI,aAAa,KAAK,UAAU,EAAE,CAAC;QACjE,OAAO,eAAe,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED,mBAAmB;IACnB,OAAO,eAAe,CAAC,KAAK,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,IAAqB;IAC/D,MAAM,UAAU,GAAG;QACjB,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,SAAS;QAClC,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,OAAO;QAC9B,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,eAAe;KAC5C,CAAC;IACF,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -34,11 +34,19 @@ export declare class ReActLoop {
|
|
|
34
34
|
private consecutiveFailures;
|
|
35
35
|
private maxConsecutiveFailures;
|
|
36
36
|
private recentToolCalls;
|
|
37
|
+
private recentActions;
|
|
38
|
+
private noProgressTurns;
|
|
39
|
+
private maxNoProgressTurns;
|
|
40
|
+
private lastObservationHash;
|
|
37
41
|
constructor(maxTurns?: number);
|
|
38
42
|
/**
|
|
39
43
|
* Execute ReAct loop with infinite loop prevention
|
|
40
44
|
*/
|
|
41
45
|
execute(query: string, context: any, generateThought: (query: string, context: any, trajectory: ReActTrajectory) => Promise<Thought>, generateAction: (thought: Thought, context: any) => Promise<Action>, executeAction: (action: Action) => Promise<Observation>, isFinalAnswer: (observation: Observation) => boolean): Promise<ReActTrajectory>;
|
|
42
46
|
getTrajectory(): ReActTrajectory;
|
|
47
|
+
/**
|
|
48
|
+
* Hash observation to detect if it's changed (progress detection)
|
|
49
|
+
*/
|
|
50
|
+
private hashObservation;
|
|
43
51
|
}
|
|
44
52
|
//# sourceMappingURL=react-loop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-loop.d.ts","sourceRoot":"","sources":["../../../src/domain/services/react-loop.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,mBAAmB,CAAa;IACxC,OAAO,CAAC,sBAAsB,CAAa;IAC3C,OAAO,CAAC,eAAe,CAAkC;
|
|
1
|
+
{"version":3,"file":"react-loop.d.ts","sourceRoot":"","sources":["../../../src/domain/services/react-loop.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,mBAAmB,CAAa;IACxC,OAAO,CAAC,sBAAsB,CAAa;IAC3C,OAAO,CAAC,eAAe,CAAkC;IACzD,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,eAAe,CAAa;IACpC,OAAO,CAAC,kBAAkB,CAAa;IACvC,OAAO,CAAC,mBAAmB,CAAuB;gBAEtC,QAAQ,GAAE,MAAW;IAIjC;;OAEG;IACG,OAAO,CACX,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,GAAG,EACZ,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,eAAe,KAAK,OAAO,CAAC,OAAO,CAAC,EAC/F,cAAc,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,CAAC,EACnE,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,EACvD,aAAa,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,OAAO,GACnD,OAAO,CAAC,eAAe,CAAC;IA8J3B,aAAa,IAAI,eAAe;IAOhC;;OAEG;IACH,OAAO,CAAC,eAAe;CAWxB"}
|
|
@@ -8,6 +8,10 @@ export class ReActLoop {
|
|
|
8
8
|
consecutiveFailures = 0;
|
|
9
9
|
maxConsecutiveFailures = 3;
|
|
10
10
|
recentToolCalls = new Map(); // Track repeated tool calls
|
|
11
|
+
recentActions = []; // Track recent action types for diversity check
|
|
12
|
+
noProgressTurns = 0; // Track turns with no progress
|
|
13
|
+
maxNoProgressTurns = 5; // Max turns without progress before early termination
|
|
14
|
+
lastObservationHash = null; // Track if observations are changing
|
|
11
15
|
constructor(maxTurns = 20) {
|
|
12
16
|
this.maxTurns = maxTurns;
|
|
13
17
|
}
|
|
@@ -22,12 +26,37 @@ export class ReActLoop {
|
|
|
22
26
|
};
|
|
23
27
|
this.consecutiveFailures = 0;
|
|
24
28
|
this.recentToolCalls.clear();
|
|
29
|
+
this.recentActions = [];
|
|
30
|
+
this.noProgressTurns = 0;
|
|
31
|
+
this.lastObservationHash = null;
|
|
25
32
|
for (let turn = 0; turn < this.maxTurns; turn++) {
|
|
26
33
|
// 1. Generate Thought
|
|
27
34
|
const thought = await generateThought(query, context, this.trajectory);
|
|
28
35
|
// 2. Generate Action
|
|
29
36
|
const action = await generateAction(thought, context);
|
|
30
|
-
// 3. Check
|
|
37
|
+
// 3. Action Diversity Check - Don't repeat same action type consecutively
|
|
38
|
+
const actionKey = `${action.type}:${action.name}`;
|
|
39
|
+
if (this.recentActions.length > 0 && this.recentActions[this.recentActions.length - 1] === actionKey) {
|
|
40
|
+
// Same action type repeated consecutively - likely stuck
|
|
41
|
+
this.trajectory.steps.push({
|
|
42
|
+
thought,
|
|
43
|
+
action,
|
|
44
|
+
observation: {
|
|
45
|
+
result: null,
|
|
46
|
+
success: false,
|
|
47
|
+
error: `Action diversity violation: Same action "${actionKey}" repeated consecutively. Stopping to prevent infinite loop.`,
|
|
48
|
+
},
|
|
49
|
+
timestamp: new Date(),
|
|
50
|
+
});
|
|
51
|
+
this.trajectory.success = false;
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
this.recentActions.push(actionKey);
|
|
55
|
+
// Keep only last 5 actions for diversity check
|
|
56
|
+
if (this.recentActions.length > 5) {
|
|
57
|
+
this.recentActions.shift();
|
|
58
|
+
}
|
|
59
|
+
// 4. Check for repeated tool calls (infinite loop detection)
|
|
31
60
|
if (action.type === 'tool') {
|
|
32
61
|
const toolKey = `${action.name}:${JSON.stringify(action.parameters || {})}`;
|
|
33
62
|
const callCount = this.recentToolCalls.get(toolKey) || 0;
|
|
@@ -47,10 +76,18 @@ export class ReActLoop {
|
|
|
47
76
|
break;
|
|
48
77
|
}
|
|
49
78
|
this.recentToolCalls.set(toolKey, callCount + 1);
|
|
79
|
+
// Clean old entries (keep only last 10 unique tool calls)
|
|
80
|
+
if (this.recentToolCalls.size > 10) {
|
|
81
|
+
const entries = Array.from(this.recentToolCalls.entries());
|
|
82
|
+
this.recentToolCalls.clear();
|
|
83
|
+
entries.slice(-10).forEach(([key, value]) => {
|
|
84
|
+
this.recentToolCalls.set(key, value);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
50
87
|
}
|
|
51
|
-
//
|
|
88
|
+
// 5. Execute Action
|
|
52
89
|
const observation = await executeAction(action);
|
|
53
|
-
//
|
|
90
|
+
// 6. Track consecutive failures
|
|
54
91
|
if (!observation.success) {
|
|
55
92
|
this.consecutiveFailures++;
|
|
56
93
|
if (this.consecutiveFailures >= this.maxConsecutiveFailures) {
|
|
@@ -73,7 +110,32 @@ export class ReActLoop {
|
|
|
73
110
|
// Reset failure counter on success
|
|
74
111
|
this.consecutiveFailures = 0;
|
|
75
112
|
}
|
|
76
|
-
//
|
|
113
|
+
// 7. Check for progress (observation changed)
|
|
114
|
+
const observationHash = this.hashObservation(observation);
|
|
115
|
+
if (observationHash === this.lastObservationHash && !observation.success) {
|
|
116
|
+
// Same observation result repeated - no progress
|
|
117
|
+
this.noProgressTurns++;
|
|
118
|
+
if (this.noProgressTurns >= this.maxNoProgressTurns) {
|
|
119
|
+
this.trajectory.steps.push({
|
|
120
|
+
thought,
|
|
121
|
+
action,
|
|
122
|
+
observation: {
|
|
123
|
+
result: observation.result,
|
|
124
|
+
success: false,
|
|
125
|
+
error: `No progress detected after ${this.noProgressTurns} turns. Stopping to prevent infinite loop.`,
|
|
126
|
+
},
|
|
127
|
+
timestamp: new Date(),
|
|
128
|
+
});
|
|
129
|
+
this.trajectory.success = false;
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
// Progress detected - reset counter
|
|
135
|
+
this.noProgressTurns = 0;
|
|
136
|
+
this.lastObservationHash = observationHash;
|
|
137
|
+
}
|
|
138
|
+
// 8. Record step
|
|
77
139
|
const step = {
|
|
78
140
|
thought,
|
|
79
141
|
action,
|
|
@@ -81,13 +143,13 @@ export class ReActLoop {
|
|
|
81
143
|
timestamp: new Date(),
|
|
82
144
|
};
|
|
83
145
|
this.trajectory.steps.push(step);
|
|
84
|
-
//
|
|
146
|
+
// 9. Check if done
|
|
85
147
|
if (isFinalAnswer(observation)) {
|
|
86
148
|
this.trajectory.finalAnswer = observation.result;
|
|
87
149
|
this.trajectory.success = true;
|
|
88
150
|
break;
|
|
89
151
|
}
|
|
90
|
-
//
|
|
152
|
+
// 10. Update context with observation
|
|
91
153
|
context = { ...context, lastObservation: observation };
|
|
92
154
|
}
|
|
93
155
|
// Check if we hit max turns without success
|
|
@@ -106,5 +168,19 @@ export class ReActLoop {
|
|
|
106
168
|
}
|
|
107
169
|
return this.trajectory;
|
|
108
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Hash observation to detect if it's changed (progress detection)
|
|
173
|
+
*/
|
|
174
|
+
hashObservation(observation) {
|
|
175
|
+
const key = `${observation.success}:${observation.error || ''}:${JSON.stringify(observation.result || '').substring(0, 100)}`;
|
|
176
|
+
// Simple hash function
|
|
177
|
+
let hash = 0;
|
|
178
|
+
for (let i = 0; i < key.length; i++) {
|
|
179
|
+
const char = key.charCodeAt(i);
|
|
180
|
+
hash = ((hash << 5) - hash) + char;
|
|
181
|
+
hash = hash & hash; // Convert to 32-bit integer
|
|
182
|
+
}
|
|
183
|
+
return hash.toString();
|
|
184
|
+
}
|
|
109
185
|
}
|
|
110
186
|
//# sourceMappingURL=react-loop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-loop.js","sourceRoot":"","sources":["../../../src/domain/services/react-loop.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiCH,MAAM,OAAO,SAAS;IACZ,QAAQ,CAAS;IACjB,UAAU,GAA2B,IAAI,CAAC;IAC1C,mBAAmB,GAAW,CAAC,CAAC;IAChC,sBAAsB,GAAW,CAAC,CAAC;IACnC,eAAe,GAAwB,IAAI,GAAG,EAAE,CAAC,CAAC,4BAA4B;
|
|
1
|
+
{"version":3,"file":"react-loop.js","sourceRoot":"","sources":["../../../src/domain/services/react-loop.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiCH,MAAM,OAAO,SAAS;IACZ,QAAQ,CAAS;IACjB,UAAU,GAA2B,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C,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QAC9H,uBAAuB;QACvB,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACpC,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;YACnC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,4BAA4B;QAClD,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain Service: Risk Tier Detector
|
|
3
|
+
* Detects risk tier (T1/T2/T3) for operations using static rules
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha (static rule-based only)
|
|
6
|
+
* See: docs/ARCHITECTURE/TASK_MODEL.md section 1.4
|
|
7
|
+
*/
|
|
8
|
+
import { RiskTier } from '../entities/task.js';
|
|
9
|
+
/**
|
|
10
|
+
* Detect risk tier from file paths and plan
|
|
11
|
+
* Phase 1: Simple static rule-based detection
|
|
12
|
+
*/
|
|
13
|
+
export declare function detectRiskTier(files?: string[], plan?: any): RiskTier;
|
|
14
|
+
/**
|
|
15
|
+
* Detect risk tier from plan structure
|
|
16
|
+
*/
|
|
17
|
+
export declare function detectRiskTierFromPlan(plan: any): RiskTier;
|
|
18
|
+
//# sourceMappingURL=risk-tier-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk-tier-detector.d.ts","sourceRoot":"","sources":["../../../src/domain/services/risk-tier-detector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAgB/C;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,GAAE,MAAM,EAAO,EACpB,IAAI,CAAC,EAAE,GAAG,GACT,QAAQ,CAsBV;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,GAAG,GAAG,QAAQ,CAsB1D"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain Service: Risk Tier Detector
|
|
3
|
+
* Detects risk tier (T1/T2/T3) for operations using static rules
|
|
4
|
+
*
|
|
5
|
+
* Phase 1: v0.5.0-alpha (static rule-based only)
|
|
6
|
+
* See: docs/ARCHITECTURE/TASK_MODEL.md section 1.4
|
|
7
|
+
*/
|
|
8
|
+
import { RiskTier } from '../entities/task.js';
|
|
9
|
+
/**
|
|
10
|
+
* High-risk file patterns that indicate T3 operations
|
|
11
|
+
*/
|
|
12
|
+
const HIGH_RISK_PATTERNS = [
|
|
13
|
+
/auth\//i,
|
|
14
|
+
/payment\//i,
|
|
15
|
+
/billing\//i,
|
|
16
|
+
/config\//i,
|
|
17
|
+
/migrations\//i,
|
|
18
|
+
/infrastructure\//i,
|
|
19
|
+
/\.env/i,
|
|
20
|
+
/secret/i,
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* Detect risk tier from file paths and plan
|
|
24
|
+
* Phase 1: Simple static rule-based detection
|
|
25
|
+
*/
|
|
26
|
+
export function detectRiskTier(files = [], plan) {
|
|
27
|
+
// Check for high-risk file patterns (T3)
|
|
28
|
+
const hasHighRiskPattern = files.some(file => HIGH_RISK_PATTERNS.some(pattern => pattern.test(file)));
|
|
29
|
+
if (hasHighRiskPattern) {
|
|
30
|
+
return RiskTier.T3;
|
|
31
|
+
}
|
|
32
|
+
// Check file count
|
|
33
|
+
const fileCount = files.length;
|
|
34
|
+
if (fileCount > 20) {
|
|
35
|
+
return RiskTier.T3;
|
|
36
|
+
}
|
|
37
|
+
if (fileCount >= 2 && fileCount <= 20) {
|
|
38
|
+
return RiskTier.T2;
|
|
39
|
+
}
|
|
40
|
+
// Single file or no files: default to T1 (low risk)
|
|
41
|
+
return RiskTier.T1;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Detect risk tier from plan structure
|
|
45
|
+
*/
|
|
46
|
+
export function detectRiskTierFromPlan(plan) {
|
|
47
|
+
if (!plan) {
|
|
48
|
+
return RiskTier.T1;
|
|
49
|
+
}
|
|
50
|
+
// Check plan complexity/metadata
|
|
51
|
+
const complexity = plan.metadata?.complexity || 'medium';
|
|
52
|
+
if (complexity === 'high') {
|
|
53
|
+
return RiskTier.T3;
|
|
54
|
+
}
|
|
55
|
+
// Check sub-plans count
|
|
56
|
+
const subPlans = plan.subPlans || [];
|
|
57
|
+
if (subPlans.length > 10) {
|
|
58
|
+
return RiskTier.T3;
|
|
59
|
+
}
|
|
60
|
+
if (subPlans.length > 1) {
|
|
61
|
+
return RiskTier.T2;
|
|
62
|
+
}
|
|
63
|
+
return RiskTier.T1;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=risk-tier-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk-tier-detector.js","sourceRoot":"","sources":["../../../src/domain/services/risk-tier-detector.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;GAEG;AACH,MAAM,kBAAkB,GAAG;IACzB,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,eAAe;IACf,mBAAmB;IACnB,QAAQ;IACR,SAAS;CACV,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC5B,QAAkB,EAAE,EACpB,IAAU;IAEV,yCAAyC;IACzC,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC3C,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,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10
|
-
* Format code block for terminal
|
|
10
|
+
* Format code block for terminal with syntax highlighting
|
|
11
11
|
*/
|
|
12
|
-
export declare function formatCodeBlock(code: string, language?: string): string;
|
|
12
|
+
export declare function formatCodeBlock(code: string, language?: string, filepath?: string): string;
|
|
13
13
|
/**
|
|
14
14
|
* Format list items nicely
|
|
15
15
|
*/
|
package/dist/formatter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAoFnD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAuB1F;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAW,GAAG,MAAM,CAmC1E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAetD"}
|
package/dist/formatter.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Converts markdown to beautifully formatted terminal output
|
|
4
4
|
*/
|
|
5
5
|
import { colors } from './ui.js';
|
|
6
|
+
import { formatCodeBlockWithHighlight } from './infrastructure/ux/syntax-highlighter.js';
|
|
6
7
|
/**
|
|
7
8
|
* Format markdown text for terminal display
|
|
8
9
|
*/
|
|
@@ -10,9 +11,15 @@ export function formatMarkdown(text) {
|
|
|
10
11
|
if (!text)
|
|
11
12
|
return '';
|
|
12
13
|
let formatted = text;
|
|
13
|
-
// Remove markdown code blocks but preserve content
|
|
14
|
-
formatted = formatted.replace(/```
|
|
15
|
-
|
|
14
|
+
// Remove markdown code blocks but preserve content with syntax highlighting
|
|
15
|
+
formatted = formatted.replace(/```(\w*)\n?([\s\S]*?)```/g, (match, lang, code) => {
|
|
16
|
+
try {
|
|
17
|
+
// Use formatCodeBlock for better formatting with borders
|
|
18
|
+
return '\n' + formatCodeBlock(code.trim(), lang || 'text') + '\n';
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return '\n' + colors.cyan(code.trim()) + '\n';
|
|
22
|
+
}
|
|
16
23
|
});
|
|
17
24
|
// Remove inline code but style it
|
|
18
25
|
formatted = formatted.replace(/`([^`]+)`/g, (match, code) => {
|
|
@@ -29,6 +36,10 @@ export function formatMarkdown(text) {
|
|
|
29
36
|
return '\n' + colors.bold(text) + '\n';
|
|
30
37
|
});
|
|
31
38
|
// Convert bold (**text** or __text__) to colored bold
|
|
39
|
+
// But preserve numbered lists in bold (e.g., **1. Title** -> 1. Title in bold)
|
|
40
|
+
formatted = formatted.replace(/\*\*(\d+)\. (.+?)\*\*/g, (match, num, text) => {
|
|
41
|
+
return colors.bold(`${num}. ${text}`);
|
|
42
|
+
});
|
|
32
43
|
formatted = formatted.replace(/\*\*(.+?)\*\*/g, (match, text) => {
|
|
33
44
|
return colors.bold(text);
|
|
34
45
|
});
|
|
@@ -52,9 +63,12 @@ export function formatMarkdown(text) {
|
|
|
52
63
|
formatted = formatted.replace(/^[\*\-\+] (.+)$/gim, (match, text) => {
|
|
53
64
|
return ' • ' + text.trim();
|
|
54
65
|
});
|
|
55
|
-
// Convert numbered lists
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
// Convert numbered lists - preserve numbering with proper indentation
|
|
67
|
+
// Handle both plain numbered lists and those that might have been bold
|
|
68
|
+
formatted = formatted.replace(/^(\d+)\. (.+)$/gim, (match, num, text) => {
|
|
69
|
+
// If text is already bold (from previous processing), keep it bold
|
|
70
|
+
const trimmed = text.trim();
|
|
71
|
+
return ` ${num}. ${trimmed}`;
|
|
58
72
|
});
|
|
59
73
|
// Clean up multiple newlines (max 2)
|
|
60
74
|
formatted = formatted.replace(/\n{3,}/g, '\n\n');
|
|
@@ -70,22 +84,28 @@ export function formatMarkdown(text) {
|
|
|
70
84
|
return formatted.trim();
|
|
71
85
|
}
|
|
72
86
|
/**
|
|
73
|
-
* Format code block for terminal
|
|
87
|
+
* Format code block for terminal with syntax highlighting
|
|
74
88
|
*/
|
|
75
|
-
export function formatCodeBlock(code, language) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
export function formatCodeBlock(code, language, filepath) {
|
|
90
|
+
try {
|
|
91
|
+
return formatCodeBlockWithHighlight(code, language, filepath);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
// Fallback to basic formatting if highlighter not available
|
|
95
|
+
const lines = code.split('\n');
|
|
96
|
+
const maxWidth = process.stdout.columns || 80;
|
|
97
|
+
const indent = ' ';
|
|
98
|
+
let output = colors.dim('┌─ Code ──────────────────────────────────────┐\n');
|
|
99
|
+
for (const line of lines) {
|
|
100
|
+
// Truncate very long lines
|
|
101
|
+
const displayLine = line.length > maxWidth - 10
|
|
102
|
+
? line.substring(0, maxWidth - 13) + '...'
|
|
103
|
+
: line;
|
|
104
|
+
output += indent + colors.cyan(displayLine) + '\n';
|
|
105
|
+
}
|
|
106
|
+
output += colors.dim('└──────────────────────────────────────────────┘');
|
|
107
|
+
return output;
|
|
86
108
|
}
|
|
87
|
-
output += colors.dim('└──────────────────────────────────────────────┘');
|
|
88
|
-
return output;
|
|
89
109
|
}
|
|
90
110
|
/**
|
|
91
111
|
* Format list items nicely
|
package/dist/formatter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,4BAA4B,EAAiB,MAAM,2CAA2C,CAAC;AAExG;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,IAAI,SAAS,GAAG,IAAI,CAAC;IAErB,4EAA4E;IAC5E,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,2BAA2B,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAC/E,IAAI,CAAC;YACH,yDAAyD;YACzD,OAAO,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,IAAI,MAAM,CAAC,GAAG,IAAI,CAAC;QACpE,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;QAChD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,kCAAkC;IAClC,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAC1D,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,0BAA0B;IAC1B,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAC7D,OAAO,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IA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