codehere 0.4.0 → 0.5.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +113 -30
- package/dist/application/agents/execution-agent.js +2 -2
- package/dist/application/agents/execution-agent.js.map +1 -1
- package/dist/application/agents/multi-agent-orchestrator.d.ts +1 -0
- package/dist/application/agents/multi-agent-orchestrator.d.ts.map +1 -1
- package/dist/application/agents/multi-agent-orchestrator.js +10 -3
- package/dist/application/agents/multi-agent-orchestrator.js.map +1 -1
- package/dist/application/agents/planning-agent.d.ts.map +1 -1
- package/dist/application/agents/planning-agent.js +22 -10
- package/dist/application/agents/planning-agent.js.map +1 -1
- package/dist/application/agents/validation-agent.js +2 -2
- package/dist/application/agents/validation-agent.js.map +1 -1
- package/dist/application/reasoning/multi-model-planning-strategy.d.ts +21 -0
- package/dist/application/reasoning/multi-model-planning-strategy.d.ts.map +1 -0
- package/dist/application/reasoning/multi-model-planning-strategy.js +158 -0
- package/dist/application/reasoning/multi-model-planning-strategy.js.map +1 -0
- package/dist/application/reasoning/reasoning-config.d.ts +15 -0
- package/dist/application/reasoning/reasoning-config.d.ts.map +1 -0
- package/dist/application/reasoning/reasoning-config.js +50 -0
- package/dist/application/reasoning/reasoning-config.js.map +1 -0
- package/dist/application/reasoning/reasoning-orchestrator.d.ts +18 -0
- package/dist/application/reasoning/reasoning-orchestrator.d.ts.map +1 -0
- package/dist/application/reasoning/reasoning-orchestrator.js +170 -0
- package/dist/application/reasoning/reasoning-orchestrator.js.map +1 -0
- package/dist/application/reasoning/reasoning-strategy.interface.d.ts +24 -0
- package/dist/application/reasoning/reasoning-strategy.interface.d.ts.map +1 -0
- package/dist/application/reasoning/reasoning-strategy.interface.js +6 -0
- package/dist/application/reasoning/reasoning-strategy.interface.js.map +1 -0
- package/dist/application/reasoning/role-provider-resolver.d.ts +36 -0
- package/dist/application/reasoning/role-provider-resolver.d.ts.map +1 -0
- package/dist/application/reasoning/role-provider-resolver.js +74 -0
- package/dist/application/reasoning/role-provider-resolver.js.map +1 -0
- package/dist/application/reasoning/simple-planning-strategy.d.ts +22 -0
- package/dist/application/reasoning/simple-planning-strategy.d.ts.map +1 -0
- package/dist/application/reasoning/simple-planning-strategy.js +217 -0
- package/dist/application/reasoning/simple-planning-strategy.js.map +1 -0
- package/dist/application/reasoning/types.d.ts +65 -0
- package/dist/application/reasoning/types.d.ts.map +1 -0
- package/dist/application/reasoning/types.js +6 -0
- package/dist/application/reasoning/types.js.map +1 -0
- package/dist/application/reasoning/validator-strategy.d.ts +56 -0
- package/dist/application/reasoning/validator-strategy.d.ts.map +1 -0
- package/dist/application/reasoning/validator-strategy.js +103 -0
- package/dist/application/reasoning/validator-strategy.js.map +1 -0
- package/dist/application/services/dependency-container.d.ts +30 -6
- package/dist/application/services/dependency-container.d.ts.map +1 -1
- package/dist/application/services/dependency-container.js +96 -44
- package/dist/application/services/dependency-container.js.map +1 -1
- package/dist/application/services/intelligent-router.d.ts +6 -0
- package/dist/application/services/intelligent-router.d.ts.map +1 -1
- package/dist/application/services/intelligent-router.js +98 -9
- package/dist/application/services/intelligent-router.js.map +1 -1
- package/dist/application/use-cases/ask-question-use-case.d.ts +1 -0
- package/dist/application/use-cases/ask-question-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/ask-question-use-case.js +4 -3
- package/dist/application/use-cases/ask-question-use-case.js.map +1 -1
- package/dist/application/use-cases/planning-use-case.d.ts +14 -1
- package/dist/application/use-cases/planning-use-case.d.ts.map +1 -1
- package/dist/application/use-cases/planning-use-case.js +109 -2
- package/dist/application/use-cases/planning-use-case.js.map +1 -1
- package/dist/domain/entities/memory.d.ts.map +1 -1
- package/dist/domain/entities/task.d.ts +1 -1
- package/dist/domain/entities/task.d.ts.map +1 -1
- package/dist/domain/entities/task.js +2 -2
- package/dist/domain/entities/task.js.map +1 -1
- package/dist/domain/errors/embeddings-not-found-error.d.ts +9 -0
- package/dist/domain/errors/embeddings-not-found-error.d.ts.map +1 -0
- package/dist/domain/errors/embeddings-not-found-error.js +13 -0
- package/dist/domain/errors/embeddings-not-found-error.js.map +1 -0
- package/dist/domain/interfaces/embedding-repository.interface.d.ts +5 -0
- package/dist/domain/interfaces/embedding-repository.interface.d.ts.map +1 -1
- package/dist/domain/services/environment-mode-manager.d.ts +4 -10
- package/dist/domain/services/environment-mode-manager.d.ts.map +1 -1
- package/dist/domain/services/environment-mode-manager.js +7 -22
- package/dist/domain/services/environment-mode-manager.js.map +1 -1
- package/dist/domain/services/query-intent-classifier.d.ts.map +1 -1
- package/dist/domain/services/query-intent-classifier.js +20 -1
- package/dist/domain/services/query-intent-classifier.js.map +1 -1
- package/dist/domain/services/risk-tier-detector.d.ts +8 -9
- package/dist/domain/services/risk-tier-detector.d.ts.map +1 -1
- package/dist/domain/services/risk-tier-detector.js +53 -40
- package/dist/domain/services/risk-tier-detector.js.map +1 -1
- package/dist/embed.d.ts.map +1 -1
- package/dist/embed.js +18 -8
- package/dist/embed.js.map +1 -1
- package/dist/index.js +405 -52
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/ai/cohere-ai-service.js +4 -4
- package/dist/infrastructure/ai/cohere-ai-service.js.map +1 -1
- package/dist/infrastructure/ai/provider-ai-service.d.ts.map +1 -1
- package/dist/infrastructure/ai/provider-ai-service.js +7 -7
- package/dist/infrastructure/ai/provider-ai-service.js.map +1 -1
- package/dist/infrastructure/cache/query-result-cache.d.ts +14 -55
- package/dist/infrastructure/cache/query-result-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/query-result-cache.js +40 -112
- package/dist/infrastructure/cache/query-result-cache.js.map +1 -1
- package/dist/infrastructure/cache/response-cache.d.ts +10 -78
- package/dist/infrastructure/cache/response-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/response-cache.js +22 -198
- package/dist/infrastructure/cache/response-cache.js.map +1 -1
- package/dist/infrastructure/cache/security-scan-cache.d.ts +8 -49
- package/dist/infrastructure/cache/security-scan-cache.d.ts.map +1 -1
- package/dist/infrastructure/cache/security-scan-cache.js +25 -102
- package/dist/infrastructure/cache/security-scan-cache.js.map +1 -1
- package/dist/infrastructure/completion/bash-completion.d.ts +2 -3
- package/dist/infrastructure/completion/bash-completion.d.ts.map +1 -1
- package/dist/infrastructure/completion/bash-completion.js +11 -87
- package/dist/infrastructure/completion/bash-completion.js.map +1 -1
- package/dist/infrastructure/completion/fish-completion.d.ts +2 -3
- package/dist/infrastructure/completion/fish-completion.d.ts.map +1 -1
- package/dist/infrastructure/completion/fish-completion.js +15 -58
- package/dist/infrastructure/completion/fish-completion.js.map +1 -1
- package/dist/infrastructure/completion/zsh-completion.d.ts +2 -3
- package/dist/infrastructure/completion/zsh-completion.d.ts.map +1 -1
- package/dist/infrastructure/completion/zsh-completion.js +18 -73
- package/dist/infrastructure/completion/zsh-completion.js.map +1 -1
- package/dist/infrastructure/config/config-manager.d.ts +10 -0
- package/dist/infrastructure/config/config-manager.d.ts.map +1 -1
- package/dist/infrastructure/config/config-manager.js +13 -2
- package/dist/infrastructure/config/config-manager.js.map +1 -1
- package/dist/infrastructure/context/conversation-context.d.ts +27 -31
- package/dist/infrastructure/context/conversation-context.d.ts.map +1 -1
- package/dist/infrastructure/context/conversation-context.js +95 -136
- package/dist/infrastructure/context/conversation-context.js.map +1 -1
- package/dist/infrastructure/context/session-manager.d.ts +27 -11
- package/dist/infrastructure/context/session-manager.d.ts.map +1 -1
- package/dist/infrastructure/context/session-manager.js +69 -73
- package/dist/infrastructure/context/session-manager.js.map +1 -1
- package/dist/infrastructure/protocols/a2a-metadata.js +1 -1
- package/dist/infrastructure/protocols/mcp-oauth.js +1 -1
- package/dist/infrastructure/providers/cohere-provider.d.ts.map +1 -1
- package/dist/infrastructure/providers/cohere-provider.js +102 -17
- package/dist/infrastructure/providers/cohere-provider.js.map +1 -1
- package/dist/infrastructure/providers/openrouter-provider.d.ts +42 -0
- package/dist/infrastructure/providers/openrouter-provider.d.ts.map +1 -0
- package/dist/infrastructure/providers/openrouter-provider.js +401 -0
- package/dist/infrastructure/providers/openrouter-provider.js.map +1 -0
- package/dist/infrastructure/providers/operation-provider-resolver.d.ts.map +1 -1
- package/dist/infrastructure/providers/operation-provider-resolver.js +33 -7
- package/dist/infrastructure/providers/operation-provider-resolver.js.map +1 -1
- package/dist/infrastructure/security/input-validator.d.ts.map +1 -1
- package/dist/infrastructure/security/input-validator.js +19 -6
- package/dist/infrastructure/security/input-validator.js.map +1 -1
- package/dist/infrastructure/serialization/toon-serializer.d.ts +45 -0
- package/dist/infrastructure/serialization/toon-serializer.d.ts.map +1 -0
- package/dist/infrastructure/serialization/toon-serializer.js +119 -0
- package/dist/infrastructure/serialization/toon-serializer.js.map +1 -0
- package/dist/infrastructure/storage/embeddings-path.d.ts +18 -0
- package/dist/infrastructure/storage/embeddings-path.d.ts.map +1 -0
- package/dist/infrastructure/storage/embeddings-path.js +37 -0
- package/dist/infrastructure/storage/embeddings-path.js.map +1 -0
- package/dist/infrastructure/storage/plan-repository.d.ts +2 -0
- package/dist/infrastructure/storage/plan-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/plan-repository.js +36 -73
- package/dist/infrastructure/storage/plan-repository.js.map +1 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts +10 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/sqlite-embedding-repository.js +37 -3
- package/dist/infrastructure/storage/sqlite-embedding-repository.js.map +1 -1
- package/dist/infrastructure/storage/task-helpers.d.ts +12 -1
- package/dist/infrastructure/storage/task-helpers.d.ts.map +1 -1
- package/dist/infrastructure/storage/task-helpers.js +48 -8
- package/dist/infrastructure/storage/task-helpers.js.map +1 -1
- package/dist/infrastructure/storage/task-repository.d.ts +2 -1
- package/dist/infrastructure/storage/task-repository.d.ts.map +1 -1
- package/dist/infrastructure/storage/task-repository.js +14 -3
- package/dist/infrastructure/storage/task-repository.js.map +1 -1
- package/dist/infrastructure/telemetry/telemetry-service.d.ts +74 -0
- package/dist/infrastructure/telemetry/telemetry-service.d.ts.map +1 -0
- package/dist/infrastructure/telemetry/telemetry-service.js +167 -0
- package/dist/infrastructure/telemetry/telemetry-service.js.map +1 -0
- package/dist/infrastructure/ux/capability-boundaries.d.ts +9 -37
- package/dist/infrastructure/ux/capability-boundaries.d.ts.map +1 -1
- package/dist/infrastructure/ux/capability-boundaries.js +23 -148
- package/dist/infrastructure/ux/capability-boundaries.js.map +1 -1
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts +12 -54
- package/dist/infrastructure/ux/comprehensive-formatter.d.ts.map +1 -1
- package/dist/infrastructure/ux/comprehensive-formatter.js +87 -182
- package/dist/infrastructure/ux/comprehensive-formatter.js.map +1 -1
- package/dist/infrastructure/ux/contextual-feature-discovery.d.ts +5 -18
- package/dist/infrastructure/ux/contextual-feature-discovery.d.ts.map +1 -1
- package/dist/infrastructure/ux/contextual-feature-discovery.js +5 -139
- package/dist/infrastructure/ux/contextual-feature-discovery.js.map +1 -1
- package/dist/infrastructure/ux/feature-discovery.d.ts +3 -33
- package/dist/infrastructure/ux/feature-discovery.d.ts.map +1 -1
- package/dist/infrastructure/ux/feature-discovery.js +5 -181
- package/dist/infrastructure/ux/feature-discovery.js.map +1 -1
- package/dist/infrastructure/ux/feedback-prompt.d.ts +15 -31
- package/dist/infrastructure/ux/feedback-prompt.d.ts.map +1 -1
- package/dist/infrastructure/ux/feedback-prompt.js +30 -166
- package/dist/infrastructure/ux/feedback-prompt.js.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.d.ts +4 -6
- package/dist/infrastructure/ux/progress-indicator.d.ts.map +1 -1
- package/dist/infrastructure/ux/progress-indicator.js +35 -50
- package/dist/infrastructure/ux/progress-indicator.js.map +1 -1
- package/dist/infrastructure/ux/review-checkpoint.d.ts +3 -1
- package/dist/infrastructure/ux/review-checkpoint.d.ts.map +1 -1
- package/dist/infrastructure/ux/review-checkpoint.js +33 -80
- package/dist/infrastructure/ux/review-checkpoint.js.map +1 -1
- package/dist/infrastructure/ux/staged-feature-intro.d.ts +14 -39
- package/dist/infrastructure/ux/staged-feature-intro.d.ts.map +1 -1
- package/dist/infrastructure/ux/staged-feature-intro.js +12 -132
- package/dist/infrastructure/ux/staged-feature-intro.js.map +1 -1
- package/dist/infrastructure/ux/syntax-highlighter.d.ts +1 -2
- package/dist/infrastructure/ux/syntax-highlighter.d.ts.map +1 -1
- package/dist/infrastructure/ux/syntax-highlighter.js +67 -148
- package/dist/infrastructure/ux/syntax-highlighter.js.map +1 -1
- package/dist/infrastructure/validation/agent-feedback.d.ts +25 -89
- package/dist/infrastructure/validation/agent-feedback.d.ts.map +1 -1
- package/dist/infrastructure/validation/agent-feedback.js +32 -204
- package/dist/infrastructure/validation/agent-feedback.js.map +1 -1
- package/dist/infrastructure/validation/agent-validation-helper.d.ts +53 -53
- package/dist/infrastructure/validation/agent-validation-helper.d.ts.map +1 -1
- package/dist/infrastructure/validation/agent-validation-helper.js +110 -61
- package/dist/infrastructure/validation/agent-validation-helper.js.map +1 -1
- package/dist/infrastructure/validation/review-handler.d.ts +13 -41
- package/dist/infrastructure/validation/review-handler.d.ts.map +1 -1
- package/dist/infrastructure/validation/review-handler.js +23 -189
- package/dist/infrastructure/validation/review-handler.js.map +1 -1
- package/dist/infrastructure/validation/summary-aggregator.d.ts +25 -22
- package/dist/infrastructure/validation/summary-aggregator.d.ts.map +1 -1
- package/dist/infrastructure/validation/summary-aggregator.js +47 -133
- package/dist/infrastructure/validation/summary-aggregator.js.map +1 -1
- package/dist/infrastructure/validation/summary-extractor.d.ts +13 -48
- package/dist/infrastructure/validation/summary-extractor.d.ts.map +1 -1
- package/dist/infrastructure/validation/summary-extractor.js +32 -89
- package/dist/infrastructure/validation/summary-extractor.js.map +1 -1
- package/dist/infrastructure/validation/trace-summary.d.ts +30 -57
- package/dist/infrastructure/validation/trace-summary.d.ts.map +1 -1
- package/dist/infrastructure/validation/trace-summary.js +37 -356
- package/dist/infrastructure/validation/trace-summary.js.map +1 -1
- package/dist/monitoring.d.ts +1 -1
- package/dist/monitoring.d.ts.map +1 -1
- package/dist/monitoring.js +12 -9
- package/dist/monitoring.js.map +1 -1
- package/dist/parallel-processor.d.ts.map +1 -1
- package/dist/parallel-processor.js +124 -45
- package/dist/parallel-processor.js.map +1 -1
- package/dist/presentation/cli/commands/ask-command.d.ts +2 -0
- package/dist/presentation/cli/commands/ask-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/ask-command.js +316 -129
- package/dist/presentation/cli/commands/ask-command.js.map +1 -1
- package/dist/presentation/cli/commands/config-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/config-command.js +22 -8
- package/dist/presentation/cli/commands/config-command.js.map +1 -1
- package/dist/presentation/cli/commands/decision-command.js +23 -6
- package/dist/presentation/cli/commands/decision-command.js.map +1 -1
- package/dist/presentation/cli/commands/docs-command.d.ts +3 -1
- package/dist/presentation/cli/commands/docs-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/docs-command.js +13 -184
- package/dist/presentation/cli/commands/docs-command.js.map +1 -1
- package/dist/presentation/cli/commands/fix-command.d.ts +2 -0
- package/dist/presentation/cli/commands/fix-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/fix-command.js +61 -276
- package/dist/presentation/cli/commands/fix-command.js.map +1 -1
- package/dist/presentation/cli/commands/help-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/help-command.js +21 -1
- package/dist/presentation/cli/commands/help-command.js.map +1 -1
- package/dist/presentation/cli/commands/memory-command.d.ts +17 -0
- package/dist/presentation/cli/commands/memory-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/memory-command.js +252 -0
- package/dist/presentation/cli/commands/memory-command.js.map +1 -0
- package/dist/presentation/cli/commands/models-command.d.ts +13 -0
- package/dist/presentation/cli/commands/models-command.d.ts.map +1 -0
- package/dist/presentation/cli/commands/models-command.js +194 -0
- package/dist/presentation/cli/commands/models-command.js.map +1 -0
- package/dist/presentation/cli/commands/orchestrate-command.d.ts +1 -0
- package/dist/presentation/cli/commands/orchestrate-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/orchestrate-command.js +129 -14
- 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 +134 -25
- package/dist/presentation/cli/commands/plan-command.js.map +1 -1
- package/dist/presentation/cli/commands/product-command.d.ts +6 -4
- package/dist/presentation/cli/commands/product-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/product-command.js +12 -178
- package/dist/presentation/cli/commands/product-command.js.map +1 -1
- package/dist/presentation/cli/commands/react-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/react-command.js +5 -1
- package/dist/presentation/cli/commands/react-command.js.map +1 -1
- package/dist/presentation/cli/commands/review-command.d.ts +7 -7
- package/dist/presentation/cli/commands/review-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/review-command.js +167 -16
- package/dist/presentation/cli/commands/review-command.js.map +1 -1
- package/dist/presentation/cli/commands/run-command.d.ts +6 -8
- package/dist/presentation/cli/commands/run-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/run-command.js +182 -23
- package/dist/presentation/cli/commands/run-command.js.map +1 -1
- package/dist/presentation/cli/commands/setup-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/setup-command.js +15 -0
- package/dist/presentation/cli/commands/setup-command.js.map +1 -1
- package/dist/presentation/cli/commands/smart-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/smart-command.js +74 -6
- package/dist/presentation/cli/commands/smart-command.js.map +1 -1
- package/dist/presentation/cli/commands/status-command.d.ts +3 -0
- package/dist/presentation/cli/commands/status-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/status-command.js +151 -156
- package/dist/presentation/cli/commands/status-command.js.map +1 -1
- package/dist/presentation/cli/commands/suggest-command.d.ts +3 -5
- package/dist/presentation/cli/commands/suggest-command.d.ts.map +1 -1
- package/dist/presentation/cli/commands/suggest-command.js +132 -19
- package/dist/presentation/cli/commands/suggest-command.js.map +1 -1
- package/dist/presentation/cli/error-display.d.ts.map +1 -1
- package/dist/presentation/cli/error-display.js +75 -17
- package/dist/presentation/cli/error-display.js.map +1 -1
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +6 -1
- package/dist/search.js.map +1 -1
- package/dist/session.d.ts +1 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +55 -7
- package/dist/session.js.map +1 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +3 -0
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/git-tool.js +7 -7
- package/dist/tools/git-tool.js.map +1 -1
- package/dist/ui.d.ts +11 -0
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +54 -1
- package/dist/ui.js.map +1 -1
- package/package.json +14 -4
|
@@ -1,115 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Agent Feedback
|
|
3
|
+
* Records and manages feedback about agent operations
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* - Record success/failure, user approval, user modifications, errors
|
|
7
|
-
* - Store anonymously in local memory for pattern improvements
|
|
8
|
-
* - JSON-based, appended per operation
|
|
9
|
-
* - Privacy-first design with opt-out support
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
10
6
|
*/
|
|
11
|
-
export
|
|
12
|
-
export type UserAction = 'approved' | 'rejected' | 'modified' | 'skipped' | 'not_required';
|
|
13
|
-
export interface AgentFeedback {
|
|
14
|
-
feedbackId: string;
|
|
7
|
+
export interface FeedbackRecord {
|
|
15
8
|
runId: string;
|
|
16
9
|
agentName: string;
|
|
17
|
-
timestamp: number;
|
|
18
10
|
operation: string;
|
|
19
11
|
query?: string;
|
|
20
|
-
outcome:
|
|
21
|
-
userAction
|
|
12
|
+
outcome: 'success' | 'failure' | 'cancelled' | 'partial';
|
|
13
|
+
userAction?: 'approved' | 'rejected' | 'not_required' | 'cancelled';
|
|
22
14
|
filesChanged?: string[];
|
|
23
15
|
filesCreated?: string[];
|
|
24
16
|
filesDeleted?: string[];
|
|
25
|
-
userModifications?: Array<{
|
|
26
|
-
filepath: string;
|
|
27
|
-
modificationType: 'edited' | 'reverted' | 'accepted' | 'rejected';
|
|
28
|
-
description?: string;
|
|
29
|
-
}>;
|
|
30
17
|
errors?: string[];
|
|
31
18
|
warnings?: string[];
|
|
32
|
-
validationChecks?:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
message?: string;
|
|
36
|
-
}>;
|
|
37
|
-
metrics?: {
|
|
38
|
-
tokensUsed?: number;
|
|
39
|
-
duration?: number;
|
|
40
|
-
filesAnalyzed?: number;
|
|
41
|
-
changesProposed?: number;
|
|
42
|
-
changesApplied?: number;
|
|
43
|
-
};
|
|
44
|
-
context?: {
|
|
45
|
-
codebaseType?: string;
|
|
46
|
-
fileCount?: number;
|
|
47
|
-
operationType?: string;
|
|
48
|
-
};
|
|
49
|
-
userFeedback?: {
|
|
50
|
-
rating?: number;
|
|
51
|
-
comment?: string;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export interface AgentFeedbackConfig {
|
|
55
|
-
enabled: boolean;
|
|
56
|
-
storagePath?: string;
|
|
57
|
-
anonymize: boolean;
|
|
58
|
-
optOut: boolean;
|
|
19
|
+
validationChecks?: any[];
|
|
20
|
+
metrics?: Record<string, any>;
|
|
21
|
+
timestamp?: number;
|
|
59
22
|
}
|
|
60
23
|
/**
|
|
61
24
|
* Agent Feedback Manager
|
|
62
|
-
* Lightweight, privacy-first feedback capture
|
|
63
25
|
*/
|
|
64
|
-
|
|
65
|
-
private
|
|
66
|
-
private
|
|
67
|
-
private feedbackHistory;
|
|
68
|
-
constructor(config?: Partial<AgentFeedbackConfig>);
|
|
26
|
+
declare class AgentFeedbackManager {
|
|
27
|
+
private feedbackRecords;
|
|
28
|
+
private readonly maxRecords;
|
|
69
29
|
/**
|
|
70
30
|
* Record feedback for an agent operation
|
|
71
|
-
* userAction is required - must be provided by caller
|
|
72
|
-
*/
|
|
73
|
-
recordFeedback(feedback: Omit<AgentFeedback, 'feedbackId' | 'timestamp'> & {
|
|
74
|
-
userAction: UserAction;
|
|
75
|
-
}): string;
|
|
76
|
-
/**
|
|
77
|
-
* Get feedback for a run
|
|
78
|
-
*/
|
|
79
|
-
getFeedbackForRun(runId: string): AgentFeedback | null;
|
|
80
|
-
/**
|
|
81
|
-
* Get recent feedback patterns (for learning)
|
|
82
|
-
*/
|
|
83
|
-
getRecentFeedback(limit?: number): AgentFeedback[];
|
|
84
|
-
/**
|
|
85
|
-
* Get feedback statistics
|
|
86
|
-
*/
|
|
87
|
-
getFeedbackStats(): {
|
|
88
|
-
total: number;
|
|
89
|
-
byOutcome: Record<FeedbackOutcome, number>;
|
|
90
|
-
byAgent: Record<string, number>;
|
|
91
|
-
averageRating?: number;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* Anonymize feedback (remove sensitive data)
|
|
95
|
-
*/
|
|
96
|
-
private anonymizeFeedback;
|
|
97
|
-
/**
|
|
98
|
-
* Anonymize file path (keep structure, not actual names)
|
|
99
|
-
*/
|
|
100
|
-
private anonymizePath;
|
|
101
|
-
/**
|
|
102
|
-
* Load recent feedback from disk
|
|
103
31
|
*/
|
|
104
|
-
|
|
32
|
+
recordFeedback(feedback: FeedbackRecord): void;
|
|
105
33
|
/**
|
|
106
|
-
*
|
|
34
|
+
* Get feedback records for an agent
|
|
107
35
|
*/
|
|
108
|
-
|
|
36
|
+
getFeedbackForAgent(agentName: string, limit?: number): FeedbackRecord[];
|
|
109
37
|
/**
|
|
110
|
-
*
|
|
38
|
+
* Get all feedback records
|
|
111
39
|
*/
|
|
112
|
-
|
|
40
|
+
getAllFeedback(limit?: number): FeedbackRecord[];
|
|
113
41
|
}
|
|
114
42
|
export declare const agentFeedbackManager: AgentFeedbackManager;
|
|
43
|
+
/**
|
|
44
|
+
* AgentFeedback class (kept for backward compatibility)
|
|
45
|
+
*/
|
|
46
|
+
export declare class AgentFeedback {
|
|
47
|
+
data: FeedbackRecord;
|
|
48
|
+
constructor(data: FeedbackRecord);
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
115
51
|
//# sourceMappingURL=agent-feedback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-feedback.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/agent-feedback.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agent-feedback.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/agent-feedback.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IACzD,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,WAAW,CAAC;IACpE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,cAAM,oBAAoB;IACxB,OAAO,CAAC,eAAe,CAAwB;IAC/C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IAEnC;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAiB9C;;OAEG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,cAAc,EAAE;IAO5E;;OAEG;IACH,cAAc,CAAC,KAAK,GAAE,MAAY,GAAG,cAAc,EAAE;CAGtD;AAED,eAAO,MAAM,oBAAoB,sBAA6B,CAAC;AAE/D;;GAEG;AACH,qBAAa,aAAa;IACL,IAAI,EAAE,cAAc;gBAApB,IAAI,EAAE,cAAc;CACxC"}
|
|
@@ -1,227 +1,55 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Agent Feedback
|
|
3
|
+
* Records and manages feedback about agent operations
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* - Record success/failure, user approval, user modifications, errors
|
|
7
|
-
* - Store anonymously in local memory for pattern improvements
|
|
8
|
-
* - JSON-based, appended per operation
|
|
9
|
-
* - Privacy-first design with opt-out support
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
10
6
|
*/
|
|
11
|
-
import { writeFileSync, readFileSync, existsSync, mkdirSync, appendFileSync } from 'fs';
|
|
12
|
-
import { join, dirname } from 'path';
|
|
13
|
-
import { fileURLToPath } from 'url';
|
|
14
|
-
import { randomUUID } from 'crypto';
|
|
15
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
-
const __dirname = dirname(__filename);
|
|
17
7
|
/**
|
|
18
8
|
* Agent Feedback Manager
|
|
19
|
-
* Lightweight, privacy-first feedback capture
|
|
20
9
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
feedbackHistory = [];
|
|
25
|
-
constructor(config) {
|
|
26
|
-
// Check opt-out preference
|
|
27
|
-
const optOut = process.env.CODEHERE_FEEDBACK_OPT_OUT === 'true' ||
|
|
28
|
-
process.env.CODEHERE_TELEMETRY_DISABLED === 'true';
|
|
29
|
-
this.config = {
|
|
30
|
-
enabled: !optOut && (config?.enabled !== false),
|
|
31
|
-
anonymize: config?.anonymize !== false,
|
|
32
|
-
optOut: optOut || (config?.optOut === true),
|
|
33
|
-
storagePath: config?.storagePath,
|
|
34
|
-
};
|
|
35
|
-
if (this.config.optOut || !this.config.enabled) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
// Set up feedback storage directory
|
|
39
|
-
if (this.config.storagePath) {
|
|
40
|
-
this.feedbackDir = this.config.storagePath;
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
const agentDir = join(__dirname, '../../..');
|
|
44
|
-
this.feedbackDir = join(agentDir, 'data', 'feedback');
|
|
45
|
-
}
|
|
46
|
-
if (!existsSync(this.feedbackDir)) {
|
|
47
|
-
mkdirSync(this.feedbackDir, { recursive: true });
|
|
48
|
-
}
|
|
49
|
-
// Load recent feedback history (for pattern analysis)
|
|
50
|
-
this.loadRecentFeedback();
|
|
51
|
-
}
|
|
10
|
+
class AgentFeedbackManager {
|
|
11
|
+
feedbackRecords = [];
|
|
12
|
+
maxRecords = 1000;
|
|
52
13
|
/**
|
|
53
14
|
* Record feedback for an agent operation
|
|
54
|
-
* userAction is required - must be provided by caller
|
|
55
15
|
*/
|
|
56
16
|
recordFeedback(feedback) {
|
|
57
|
-
|
|
58
|
-
return 'feedback-disabled';
|
|
59
|
-
}
|
|
60
|
-
const feedbackId = randomUUID();
|
|
61
|
-
const fullFeedback = {
|
|
17
|
+
const record = {
|
|
62
18
|
...feedback,
|
|
63
|
-
|
|
64
|
-
timestamp: Date.now(),
|
|
19
|
+
timestamp: feedback.timestamp || Date.now(),
|
|
65
20
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
// Store in memory
|
|
71
|
-
this.feedbackHistory.push(processedFeedback);
|
|
72
|
-
if (this.feedbackHistory.length > 1000) {
|
|
73
|
-
// Keep only last 1000 in memory
|
|
74
|
-
this.feedbackHistory = this.feedbackHistory.slice(-1000);
|
|
75
|
-
}
|
|
76
|
-
// Append to JSON file (one JSON object per line for easy parsing)
|
|
77
|
-
const feedbackFile = join(this.feedbackDir, 'agent-feedback.jsonl');
|
|
78
|
-
try {
|
|
79
|
-
appendFileSync(feedbackFile, JSON.stringify(processedFeedback) + '\n', 'utf-8');
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
// Silent failure - don't break user workflow
|
|
83
|
-
console.error('[AgentFeedback] Failed to write feedback:', error);
|
|
84
|
-
}
|
|
85
|
-
return feedbackId;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Get feedback for a run
|
|
89
|
-
*/
|
|
90
|
-
getFeedbackForRun(runId) {
|
|
91
|
-
return this.feedbackHistory.find(f => f.runId === runId) || null;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Get recent feedback patterns (for learning)
|
|
95
|
-
*/
|
|
96
|
-
getRecentFeedback(limit = 100) {
|
|
97
|
-
return this.feedbackHistory.slice(-limit);
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Get feedback statistics
|
|
101
|
-
*/
|
|
102
|
-
getFeedbackStats() {
|
|
103
|
-
const stats = {
|
|
104
|
-
total: this.feedbackHistory.length,
|
|
105
|
-
byOutcome: {},
|
|
106
|
-
byAgent: {},
|
|
107
|
-
averageRating: undefined,
|
|
108
|
-
};
|
|
109
|
-
let totalRating = 0;
|
|
110
|
-
let ratingCount = 0;
|
|
111
|
-
for (const feedback of this.feedbackHistory) {
|
|
112
|
-
// Count by outcome
|
|
113
|
-
stats.byOutcome[feedback.outcome] = (stats.byOutcome[feedback.outcome] || 0) + 1;
|
|
114
|
-
// Count by agent
|
|
115
|
-
stats.byAgent[feedback.agentName] = (stats.byAgent[feedback.agentName] || 0) + 1;
|
|
116
|
-
// Calculate average rating
|
|
117
|
-
if (feedback.userFeedback?.rating) {
|
|
118
|
-
totalRating += feedback.userFeedback.rating;
|
|
119
|
-
ratingCount++;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (ratingCount > 0) {
|
|
123
|
-
stats.averageRating = totalRating / ratingCount;
|
|
21
|
+
this.feedbackRecords.push(record);
|
|
22
|
+
// Trim old records if too many
|
|
23
|
+
if (this.feedbackRecords.length > this.maxRecords) {
|
|
24
|
+
this.feedbackRecords = this.feedbackRecords.slice(-this.maxRecords);
|
|
124
25
|
}
|
|
125
|
-
|
|
26
|
+
// In alpha, feedback is stored in memory only
|
|
27
|
+
// Can be enhanced later to persist to disk
|
|
126
28
|
}
|
|
127
29
|
/**
|
|
128
|
-
*
|
|
30
|
+
* Get feedback records for an agent
|
|
129
31
|
*/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const keywords = anonymized.query
|
|
136
|
-
.split(/\s+/)
|
|
137
|
-
.filter(w => w.length > 3)
|
|
138
|
-
.slice(0, 5)
|
|
139
|
-
.join(' ');
|
|
140
|
-
anonymized.query = keywords || '[anonymized]';
|
|
141
|
-
}
|
|
142
|
-
// Remove file contents from modifications
|
|
143
|
-
if (anonymized.userModifications) {
|
|
144
|
-
anonymized.userModifications = anonymized.userModifications.map(mod => ({
|
|
145
|
-
filepath: this.anonymizePath(mod.filepath),
|
|
146
|
-
modificationType: mod.modificationType,
|
|
147
|
-
description: mod.description ? '[anonymized]' : undefined,
|
|
148
|
-
}));
|
|
149
|
-
}
|
|
150
|
-
// Anonymize file paths (keep structure, not names)
|
|
151
|
-
if (anonymized.filesChanged) {
|
|
152
|
-
anonymized.filesChanged = anonymized.filesChanged.map(p => this.anonymizePath(p));
|
|
153
|
-
}
|
|
154
|
-
if (anonymized.filesCreated) {
|
|
155
|
-
anonymized.filesCreated = anonymized.filesCreated.map(p => this.anonymizePath(p));
|
|
156
|
-
}
|
|
157
|
-
return anonymized;
|
|
32
|
+
getFeedbackForAgent(agentName, limit = 10) {
|
|
33
|
+
return this.feedbackRecords
|
|
34
|
+
.filter(r => r.agentName === agentName)
|
|
35
|
+
.slice(-limit)
|
|
36
|
+
.reverse();
|
|
158
37
|
}
|
|
159
38
|
/**
|
|
160
|
-
*
|
|
39
|
+
* Get all feedback records
|
|
161
40
|
*/
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
const parts = filepath.split('/');
|
|
165
|
-
return parts.map((part, index) => {
|
|
166
|
-
if (index === parts.length - 1) {
|
|
167
|
-
// Last part is filename
|
|
168
|
-
const ext = part.split('.').pop();
|
|
169
|
-
return `file${ext ? '.' + ext : ''}`;
|
|
170
|
-
}
|
|
171
|
-
return part;
|
|
172
|
-
}).join('/');
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Load recent feedback from disk
|
|
176
|
-
*/
|
|
177
|
-
loadRecentFeedback() {
|
|
178
|
-
const feedbackFile = join(this.feedbackDir, 'agent-feedback.jsonl');
|
|
179
|
-
if (!existsSync(feedbackFile)) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
try {
|
|
183
|
-
const content = readFileSync(feedbackFile, 'utf-8');
|
|
184
|
-
const lines = content.trim().split('\n').filter(line => line.trim());
|
|
185
|
-
// Load last 100 entries
|
|
186
|
-
const recentLines = lines.slice(-100);
|
|
187
|
-
this.feedbackHistory = recentLines
|
|
188
|
-
.map(line => {
|
|
189
|
-
try {
|
|
190
|
-
return JSON.parse(line);
|
|
191
|
-
}
|
|
192
|
-
catch {
|
|
193
|
-
return null;
|
|
194
|
-
}
|
|
195
|
-
})
|
|
196
|
-
.filter((f) => f !== null);
|
|
197
|
-
}
|
|
198
|
-
catch (error) {
|
|
199
|
-
// Silent failure
|
|
200
|
-
console.error('[AgentFeedback] Failed to load feedback history:', error);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Clear all feedback (privacy control)
|
|
205
|
-
*/
|
|
206
|
-
clearFeedback() {
|
|
207
|
-
this.feedbackHistory = [];
|
|
208
|
-
const feedbackFile = join(this.feedbackDir, 'agent-feedback.jsonl');
|
|
209
|
-
if (existsSync(feedbackFile)) {
|
|
210
|
-
try {
|
|
211
|
-
writeFileSync(feedbackFile, '', 'utf-8');
|
|
212
|
-
}
|
|
213
|
-
catch {
|
|
214
|
-
// Silent failure
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Check if feedback collection is enabled
|
|
220
|
-
*/
|
|
221
|
-
isEnabled() {
|
|
222
|
-
return !this.config.optOut && this.config.enabled;
|
|
41
|
+
getAllFeedback(limit = 100) {
|
|
42
|
+
return this.feedbackRecords.slice(-limit).reverse();
|
|
223
43
|
}
|
|
224
44
|
}
|
|
225
|
-
// Singleton instance
|
|
226
45
|
export const agentFeedbackManager = new AgentFeedbackManager();
|
|
46
|
+
/**
|
|
47
|
+
* AgentFeedback class (kept for backward compatibility)
|
|
48
|
+
*/
|
|
49
|
+
export class AgentFeedback {
|
|
50
|
+
data;
|
|
51
|
+
constructor(data) {
|
|
52
|
+
this.data = data;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
227
55
|
//# sourceMappingURL=agent-feedback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-feedback.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/agent-feedback.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agent-feedback.js","sourceRoot":"","sources":["../../../src/infrastructure/validation/agent-feedback.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAmBH;;GAEG;AACH,MAAM,oBAAoB;IAChB,eAAe,GAAqB,EAAE,CAAC;IAC9B,UAAU,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,cAAc,CAAC,QAAwB;QACrC,MAAM,MAAM,GAAmB;YAC7B,GAAG,QAAQ;YACX,SAAS,EAAE,QAAQ,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE;SAC5C,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAElC,+BAA+B;QAC/B,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YAClD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtE,CAAC;QAED,8CAA8C;QAC9C,2CAA2C;IAC7C,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,SAAiB,EAAE,QAAgB,EAAE;QACvD,OAAO,IAAI,CAAC,eAAe;aACxB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC;aACtC,KAAK,CAAC,CAAC,KAAK,CAAC;aACb,OAAO,EAAE,CAAC;IACf,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,QAAgB,GAAG;QAChC,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;IACtD,CAAC;CACF;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAE/D;;GAEG;AACH,MAAM,OAAO,aAAa;IACL;IAAnB,YAAmB,IAAoB;QAApB,SAAI,GAAJ,IAAI,CAAgB;IAAG,CAAC;CAC5C"}
|
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Agent Validation Helper
|
|
3
|
+
* Validates agent outputs and checks trust scores
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* - Automatic TraceSummary generation
|
|
7
|
-
* - AgentFeedback recording
|
|
8
|
-
* - Run context tracking
|
|
5
|
+
* Phase 1: v0.5.0-alpha.0
|
|
9
6
|
*/
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
import { TraceSummary } from './trace-summary.js';
|
|
8
|
+
export interface ValidationResult {
|
|
9
|
+
passed: boolean;
|
|
10
|
+
issues?: string[];
|
|
11
|
+
warnings?: string[];
|
|
12
|
+
score?: number;
|
|
13
|
+
summary?: TraceSummary;
|
|
14
|
+
feedbackId?: string | null;
|
|
15
|
+
runId?: string | null;
|
|
16
|
+
}
|
|
17
|
+
export interface TrustCheckResult {
|
|
18
|
+
passed: boolean;
|
|
19
|
+
trustScore?: number;
|
|
20
|
+
threshold?: number;
|
|
21
|
+
message?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ValidationContext {
|
|
14
24
|
agentName: string;
|
|
15
25
|
operation: string;
|
|
16
26
|
startTime: number;
|
|
27
|
+
metadata?: Record<string, any>;
|
|
17
28
|
}
|
|
18
|
-
export interface
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
export interface TraceData {
|
|
30
|
+
operationType: string;
|
|
31
|
+
operationName: string;
|
|
32
|
+
input?: any;
|
|
33
|
+
output?: any;
|
|
34
|
+
error?: Error;
|
|
35
|
+
metadata?: Record<string, any>;
|
|
23
36
|
}
|
|
24
37
|
/**
|
|
25
|
-
*
|
|
38
|
+
* Agent validation helper
|
|
26
39
|
*/
|
|
27
|
-
export declare
|
|
40
|
+
export declare const agentValidationHelper: {
|
|
28
41
|
/**
|
|
29
|
-
* Start
|
|
42
|
+
* Start an agent operation and return validation context
|
|
30
43
|
*/
|
|
31
|
-
startAgentOperation(agentName: string, operation: string,
|
|
32
|
-
query?: string;
|
|
33
|
-
codebaseId?: string;
|
|
34
|
-
}): AgentValidationContext;
|
|
44
|
+
startAgentOperation(agentName: string, operation: string, metadata?: Record<string, any>): ValidationContext;
|
|
35
45
|
/**
|
|
36
|
-
* Complete agent operation and
|
|
46
|
+
* Complete an agent operation and return validation result
|
|
37
47
|
*/
|
|
38
|
-
completeAgentOperation
|
|
39
|
-
outcome
|
|
40
|
-
userAction?: UserAction;
|
|
41
|
-
filesChanged?: string[];
|
|
42
|
-
filesCreated?: string[];
|
|
43
|
-
filesDeleted?: string[];
|
|
44
|
-
errors?: string[];
|
|
45
|
-
warnings?: string[];
|
|
48
|
+
completeAgentOperation(context: ValidationContext, result: Record<string, any> | null, options?: {
|
|
49
|
+
outcome?: "success" | "failure" | "partial_success";
|
|
46
50
|
validationChecks?: Array<{
|
|
47
51
|
check: string;
|
|
48
52
|
passed: boolean;
|
|
49
53
|
message?: string;
|
|
50
|
-
critical?: boolean;
|
|
51
54
|
}>;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
additionalContext?: Record<string, any>;
|
|
60
|
-
}): Promise<AgentValidationResult<T>>;
|
|
55
|
+
filesChanged?: string[];
|
|
56
|
+
filesCreated?: string[];
|
|
57
|
+
filesDeleted?: string[];
|
|
58
|
+
errors?: any[];
|
|
59
|
+
warnings?: any[];
|
|
60
|
+
[key: string]: any;
|
|
61
|
+
}): Promise<ValidationResult>;
|
|
61
62
|
/**
|
|
62
|
-
*
|
|
63
|
+
* Trace an operation step
|
|
63
64
|
*/
|
|
64
|
-
trace(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
export declare const agentValidationHelper: AgentValidationHelper;
|
|
65
|
+
trace(data: TraceData): void;
|
|
66
|
+
/**
|
|
67
|
+
* Validate agent output
|
|
68
|
+
*/
|
|
69
|
+
validate(output: any, context?: any): ValidationResult;
|
|
70
|
+
/**
|
|
71
|
+
* Check trust score for an agent
|
|
72
|
+
*/
|
|
73
|
+
checkTrust(agentName: string, operation: string): TrustCheckResult;
|
|
74
|
+
};
|
|
75
75
|
//# sourceMappingURL=agent-validation-helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-validation-helper.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/agent-validation-helper.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agent-validation-helper.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/validation/agent-validation-helper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAyB,MAAM,oBAAoB,CAAC;AAIzE,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,SAAS;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;IAChC;;OAEG;mCAEU,MAAM,aACN,MAAM,aACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC7B,iBAAiB;IASpB;;OAEG;oCAEQ,iBAAiB,UAClB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,YACxB;QACR,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,iBAAiB,CAAC;QACpD,gBAAgB,CAAC,EAAE,KAAK,CAAC;YACvB,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,OAAO,CAAC;YAChB,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAC,CAAC;QACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;QACf,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,GACA,OAAO,CAAC,gBAAgB,CAAC;IAsF5B;;OAEG;gBACS,SAAS,GAAG,IAAI;IAK5B;;OAEG;qBACc,GAAG,YAAY,GAAG,GAAG,gBAAgB;IAetD;;OAEG;0BACmB,MAAM,aAAa,MAAM,GAAG,gBAAgB;CASnE,CAAC"}
|