@llm-dev-ops/agentics-cli 1.4.59 → 1.4.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +167 -0
- package/dist/commands/agents.js.map +1 -1
- package/dist/pipeline/auto-chain.d.ts +1 -0
- package/dist/pipeline/auto-chain.d.ts.map +1 -1
- package/dist/pipeline/auto-chain.js +124 -37
- package/dist/pipeline/auto-chain.js.map +1 -1
- package/dist/pipeline/execution-context.d.ts.map +1 -1
- package/dist/pipeline/execution-context.js +12 -37
- package/dist/pipeline/execution-context.js.map +1 -1
- package/dist/pipeline/phase2/phases/adr-generator.d.ts.map +1 -1
- package/dist/pipeline/phase2/phases/adr-generator.js +160 -1
- package/dist/pipeline/phase2/phases/adr-generator.js.map +1 -1
- package/dist/pipeline/phase2/phases/ddd-generator.d.ts.map +1 -1
- package/dist/pipeline/phase2/phases/ddd-generator.js +400 -3
- package/dist/pipeline/phase2/phases/ddd-generator.js.map +1 -1
- package/dist/pipeline/phase2/phases/ddd-quality-gate.d.ts +43 -0
- package/dist/pipeline/phase2/phases/ddd-quality-gate.d.ts.map +1 -0
- package/dist/pipeline/phase2/phases/ddd-quality-gate.js +413 -0
- package/dist/pipeline/phase2/phases/ddd-quality-gate.js.map +1 -0
- package/dist/pipeline/phase2/phases/research-dossier.d.ts +0 -13
- package/dist/pipeline/phase2/phases/research-dossier.d.ts.map +1 -1
- package/dist/pipeline/phase2/phases/research-dossier.js +114 -1
- package/dist/pipeline/phase2/phases/research-dossier.js.map +1 -1
- package/dist/pipeline/phase2/phases/research-quality-gate.d.ts +48 -0
- package/dist/pipeline/phase2/phases/research-quality-gate.d.ts.map +1 -0
- package/dist/pipeline/phase2/phases/research-quality-gate.js +322 -0
- package/dist/pipeline/phase2/phases/research-quality-gate.js.map +1 -0
- package/dist/pipeline/phase2/phases/sparc-quality-gate.d.ts +41 -0
- package/dist/pipeline/phase2/phases/sparc-quality-gate.d.ts.map +1 -0
- package/dist/pipeline/phase2/phases/sparc-quality-gate.js +350 -0
- package/dist/pipeline/phase2/phases/sparc-quality-gate.js.map +1 -0
- package/dist/pipeline/phase2/phases/sparc-specification.d.ts +14 -0
- package/dist/pipeline/phase2/phases/sparc-specification.d.ts.map +1 -1
- package/dist/pipeline/phase2/phases/sparc-specification.js +500 -10
- package/dist/pipeline/phase2/phases/sparc-specification.js.map +1 -1
- package/dist/pipeline/phase2/phases/tdd-plan-generator.js +1 -1
- package/dist/pipeline/phase2/phases/tdd-plan-generator.js.map +1 -1
- package/dist/pipeline/phase2/phases/tech-stack-detector.d.ts +72 -0
- package/dist/pipeline/phase2/phases/tech-stack-detector.d.ts.map +1 -0
- package/dist/pipeline/phase2/phases/tech-stack-detector.js +332 -0
- package/dist/pipeline/phase2/phases/tech-stack-detector.js.map +1 -0
- package/dist/pipeline/phase2/types.d.ts +2 -0
- package/dist/pipeline/phase2/types.d.ts.map +1 -1
- package/dist/pipeline/phase3/phases/domain-codegen.d.ts.map +1 -1
- package/dist/pipeline/phase3/phases/domain-codegen.js +169 -4
- package/dist/pipeline/phase3/phases/domain-codegen.js.map +1 -1
- package/dist/pipeline/phase3/phases/test-generator.d.ts.map +1 -1
- package/dist/pipeline/phase3/phases/test-generator.js +12 -2
- package/dist/pipeline/phase3/phases/test-generator.js.map +1 -1
- package/dist/pipeline/phase3-sparc/phase3-sparc-coordinator.d.ts.map +1 -1
- package/dist/pipeline/phase3-sparc/phase3-sparc-coordinator.js +99 -1
- package/dist/pipeline/phase3-sparc/phase3-sparc-coordinator.js.map +1 -1
- package/dist/pipeline/phase4/phases/deployment-generator.d.ts +17 -4
- package/dist/pipeline/phase4/phases/deployment-generator.d.ts.map +1 -1
- package/dist/pipeline/phase4/phases/deployment-generator.js +364 -44
- package/dist/pipeline/phase4/phases/deployment-generator.js.map +1 -1
- package/dist/pipeline/phase4/phases/erp-client-generator.d.ts.map +1 -1
- package/dist/pipeline/phase4/phases/erp-client-generator.js +27 -15
- package/dist/pipeline/phase4/phases/erp-client-generator.js.map +1 -1
- package/dist/pipeline/phase4/phases/erp-target-resolver.d.ts.map +1 -1
- package/dist/pipeline/phase4/phases/erp-target-resolver.js +49 -2
- package/dist/pipeline/phase4/phases/erp-target-resolver.js.map +1 -1
- package/dist/pipeline/phase4/phases/http-server-generator.d.ts.map +1 -1
- package/dist/pipeline/phase4/phases/http-server-generator.js +263 -3
- package/dist/pipeline/phase4/phases/http-server-generator.js.map +1 -1
- package/dist/pipeline/phase4/phases/infra-adapter-generator.d.ts.map +1 -1
- package/dist/pipeline/phase4/phases/infra-adapter-generator.js +335 -37
- package/dist/pipeline/phase4/phases/infra-adapter-generator.js.map +1 -1
- package/dist/pipeline/phase4/types.d.ts +3 -1
- package/dist/pipeline/phase4/types.d.ts.map +1 -1
- package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.d.ts.map +1 -1
- package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.js +211 -2
- package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.js.map +1 -1
- package/dist/pipeline/phase5-build/phases/implementation-quality-gate.d.ts +54 -0
- package/dist/pipeline/phase5-build/phases/implementation-quality-gate.d.ts.map +1 -0
- package/dist/pipeline/phase5-build/phases/implementation-quality-gate.js +417 -0
- package/dist/pipeline/phase5-build/phases/implementation-quality-gate.js.map +1 -0
- package/dist/pipeline/phases/prompt-generator.js +1 -1
- package/dist/pipeline/phases/prompt-generator.js.map +1 -1
- package/dist/pipeline/ruflo-phase-executor.d.ts +116 -1
- package/dist/pipeline/ruflo-phase-executor.d.ts.map +1 -1
- package/dist/pipeline/ruflo-phase-executor.js +666 -159
- package/dist/pipeline/ruflo-phase-executor.js.map +1 -1
- package/dist/pipeline/swarm-orchestrator.d.ts.map +1 -1
- package/dist/pipeline/swarm-orchestrator.js +62 -6
- package/dist/pipeline/swarm-orchestrator.js.map +1 -1
- package/dist/routing/capability-classifier.d.ts +43 -0
- package/dist/routing/capability-classifier.d.ts.map +1 -0
- package/dist/routing/capability-classifier.js +157 -0
- package/dist/routing/capability-classifier.js.map +1 -0
- package/dist/routing/composition-engine.d.ts +77 -0
- package/dist/routing/composition-engine.d.ts.map +1 -0
- package/dist/routing/composition-engine.js +249 -0
- package/dist/routing/composition-engine.js.map +1 -0
- package/dist/routing/graph-federation.d.ts +71 -0
- package/dist/routing/graph-federation.d.ts.map +1 -0
- package/dist/routing/graph-federation.js +210 -0
- package/dist/routing/graph-federation.js.map +1 -0
- package/dist/routing/graph-loader.d.ts +74 -0
- package/dist/routing/graph-loader.d.ts.map +1 -0
- package/dist/routing/graph-loader.js +383 -0
- package/dist/routing/graph-loader.js.map +1 -0
- package/dist/routing/graph-router.d.ts +103 -0
- package/dist/routing/graph-router.d.ts.map +1 -0
- package/dist/routing/graph-router.js +415 -0
- package/dist/routing/graph-router.js.map +1 -0
- package/dist/routing/graph-validator.d.ts +44 -0
- package/dist/routing/graph-validator.d.ts.map +1 -0
- package/dist/routing/graph-validator.js +329 -0
- package/dist/routing/graph-validator.js.map +1 -0
- package/dist/routing/index.d.ts +52 -0
- package/dist/routing/index.d.ts.map +1 -0
- package/dist/routing/index.js +68 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/routing/outcome-recorder.d.ts +71 -0
- package/dist/routing/outcome-recorder.d.ts.map +1 -0
- package/dist/routing/outcome-recorder.js +133 -0
- package/dist/routing/outcome-recorder.js.map +1 -0
- package/dist/routing/weight-adjuster.d.ts +59 -0
- package/dist/routing/weight-adjuster.d.ts.map +1 -0
- package/dist/routing/weight-adjuster.js +167 -0
- package/dist/routing/weight-adjuster.js.map +1 -0
- package/dist/routing/weighted-resolver.d.ts +55 -0
- package/dist/routing/weighted-resolver.d.ts.map +1 -0
- package/dist/routing/weighted-resolver.js +133 -0
- package/dist/routing/weighted-resolver.js.map +1 -0
- package/dist/synthesis/ask-artifact-writer.d.ts.map +1 -1
- package/dist/synthesis/ask-artifact-writer.js +8 -0
- package/dist/synthesis/ask-artifact-writer.js.map +1 -1
- package/dist/synthesis/simulation-artifact-generator.d.ts +14 -0
- package/dist/synthesis/simulation-artifact-generator.d.ts.map +1 -1
- package/dist/synthesis/simulation-artifact-generator.js +224 -1
- package/dist/synthesis/simulation-artifact-generator.js.map +1 -1
- package/dist/synthesis/simulation-renderers.d.ts.map +1 -1
- package/dist/synthesis/simulation-renderers.js +211 -40
- package/dist/synthesis/simulation-renderers.js.map +1 -1
- package/package.json +3 -1
- package/scripts/postinstall.sh +25 -0
- package/dist/bundled-agents/connector-hub-agents/package-lock.json +0 -11697
- package/dist/bundled-agents/connector-hub-agents/package.json +0 -75
- package/dist/bundled-agents/connector-hub-agents/tsconfig.build.json +0 -22
- package/dist/bundled-agents/connector-hub-agents/tsconfig.json +0 -57
- package/dist/bundled-agents/copilot-agents/functions/.gcloudignore +0 -17
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.d.ts +0 -14
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.js +0 -35
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.d.ts +0 -55
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.js +0 -40
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.d.ts +0 -22
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.js +0 -38
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.d.ts +0 -34
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.js +0 -186
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.d.ts +0 -36
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.js +0 -121
- package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.d.ts +0 -157
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.js +0 -948
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.d.ts +0 -9
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.js +0 -27
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.d.ts +0 -23
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.js +0 -50
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.d.ts +0 -214
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.js +0 -91
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.d.ts +0 -1166
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.js +0 -308
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.d.ts +0 -59
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.js +0 -62
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.d.ts +0 -400
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.js +0 -113
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.d.ts +0 -250
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.js +0 -169
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.d.ts +0 -17
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.js +0 -97
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.d.ts +0 -1674
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.js +0 -246
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.d.ts +0 -1085
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.js +0 -218
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.d.ts +0 -949
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.js +0 -253
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.d.ts +0 -657
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.js +0 -205
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.d.ts +0 -285
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.js +0 -106
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.d.ts +0 -581
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.js +0 -136
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.d.ts +0 -791
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.js +0 -225
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.d.ts +0 -120
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.js +0 -535
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.d.ts +0 -9
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.js +0 -18
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.d.ts +0 -4
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.js +0 -9
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.d.ts +0 -123
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.js +0 -609
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.d.ts +0 -10
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.js +0 -25
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.d.ts +0 -111
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.js +0 -686
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.d.ts +0 -11
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.js +0 -25
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.d.ts +0 -6
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.js +0 -15
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.d.ts +0 -126
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.js +0 -780
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.d.ts +0 -49
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.js +0 -125
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.d.ts +0 -73
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.js +0 -192
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.d.ts +0 -11
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.js +0 -25
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.d.ts +0 -127
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.js +0 -483
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.d.ts +0 -49
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.js +0 -125
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.d.ts +0 -73
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.js +0 -192
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.d.ts +0 -11
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.js +0 -27
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.d.ts +0 -122
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.js +0 -645
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.d.ts +0 -59
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.js +0 -156
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.d.ts +0 -88
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.js +0 -246
- package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/index.js +0 -4
- package/dist/bundled-agents/copilot-agents/functions/jest.config.js +0 -29
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.d.ts +0 -14
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.js +0 -35
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.d.ts +0 -27
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.js +0 -21
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.d.ts +0 -22
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.js +0 -38
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.d.ts +0 -34
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.js +0 -174
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.d.ts +0 -27
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.js +0 -107
- package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.d.ts +0 -157
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.js +0 -941
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.d.ts +0 -9
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.js +0 -27
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.d.ts +0 -23
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.js +0 -50
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.d.ts +0 -185
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.js +0 -86
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.d.ts +0 -1081
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.js +0 -305
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.d.ts +0 -59
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.js +0 -62
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.d.ts +0 -315
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.js +0 -110
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.d.ts +0 -250
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.js +0 -169
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.d.ts +0 -16
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.js +0 -88
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.d.ts +0 -1674
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.js +0 -246
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.d.ts +0 -1000
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.js +0 -215
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.d.ts +0 -864
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.js +0 -250
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.d.ts +0 -572
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.js +0 -202
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.d.ts +0 -496
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.js +0 -133
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.d.ts +0 -706
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.js +0 -222
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.d.ts +0 -107
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.js +0 -360
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.d.ts +0 -9
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.js +0 -18
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.d.ts +0 -4
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.js +0 -9
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.d.ts +0 -123
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.js +0 -609
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.d.ts +0 -10
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.js +0 -25
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.d.ts +0 -111
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.js +0 -686
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.d.ts +0 -11
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.js +0 -25
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.d.ts +0 -6
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.js +0 -15
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.d.ts +0 -126
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.js +0 -780
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.d.ts +0 -49
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.js +0 -125
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.d.ts +0 -73
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.js +0 -192
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.d.ts +0 -11
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.js +0 -25
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.d.ts +0 -119
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.js +0 -421
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.d.ts +0 -49
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.js +0 -125
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.d.ts +0 -73
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.js +0 -192
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.d.ts +0 -11
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.js +0 -27
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.d.ts +0 -122
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.js +0 -645
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.d.ts +0 -59
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.js +0 -156
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.d.ts +0 -88
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.js +0 -246
- package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.js.map +0 -1
- package/dist/bundled-agents/copilot-agents/functions/package-lock.json +0 -5473
- package/dist/bundled-agents/copilot-agents/functions/package.json +0 -40
- package/dist/bundled-agents/copilot-agents/functions/src/claude.ts +0 -71
- package/dist/bundled-agents/copilot-agents/functions/src/cors.ts +0 -36
- package/dist/bundled-agents/copilot-agents/functions/src/envelope.ts +0 -77
- package/dist/bundled-agents/copilot-agents/functions/src/handler.test.ts +0 -340
- package/dist/bundled-agents/copilot-agents/functions/src/health.ts +0 -53
- package/dist/bundled-agents/copilot-agents/functions/src/index.ts +0 -201
- package/dist/bundled-agents/copilot-agents/functions/src/router.ts +0 -148
- package/dist/bundled-agents/copilot-agents/functions/tsconfig.json +0 -31
- package/dist/bundled-agents/copilot-agents/package-lock.json +0 -11825
- package/dist/bundled-agents/copilot-agents/package.json +0 -5
- package/dist/bundled-agents/governance-dashboard-agents/package-lock.json +0 -8282
- package/dist/bundled-agents/governance-dashboard-agents/package.json +0 -13
- package/dist/bundled-agents/orchestrator-agents/functions/contracts/index.js +0 -590
- package/dist/bundled-agents/orchestrator-agents/functions/index.js +0 -442
- package/dist/bundled-agents/orchestrator-agents/functions/test.js +0 -325
- package/dist/bundled-agents/orchestrator-agents/index.js +0 -6
- package/dist/bundled-agents/orchestrator-agents/package-lock.json +0 -13254
- package/dist/bundled-agents/orchestrator-agents/package.json +0 -20
- package/dist/bundled-agents/platform-agents/package-lock.json +0 -1723
- package/dist/bundled-agents/platform-agents/package.json +0 -22
- package/dist/bundled-agents/platform-agents/src/agents/decision-memo.ts +0 -463
- package/dist/bundled-agents/platform-agents/src/agents/decision.ts +0 -234
- package/dist/bundled-agents/platform-agents/src/agents/executive-summary.ts +0 -229
- package/dist/bundled-agents/platform-agents/src/agents/risk-score.ts +0 -327
- package/dist/bundled-agents/platform-agents/src/claude.ts +0 -71
- package/dist/bundled-agents/platform-agents/src/cors.ts +0 -24
- package/dist/bundled-agents/platform-agents/src/envelope.ts +0 -37
- package/dist/bundled-agents/platform-agents/src/health.ts +0 -20
- package/dist/bundled-agents/platform-agents/src/index.ts +0 -171
- package/dist/bundled-agents/platform-agents/src/router.ts +0 -38
- package/dist/bundled-agents/platform-agents/src/text-analysis.ts +0 -238
- package/dist/bundled-agents/platform-agents/tsconfig.json +0 -19
- package/dist/bundled-agents/sentinel-agents/lib/agents/alert.d.ts +0 -3
- package/dist/bundled-agents/sentinel-agents/lib/agents/alert.d.ts.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/alert.js +0 -43
- package/dist/bundled-agents/sentinel-agents/lib/agents/alert.js.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.d.ts +0 -3
- package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.d.ts.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.js +0 -30
- package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.js.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.d.ts +0 -3
- package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.d.ts.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.js +0 -53
- package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.js.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/drift.d.ts +0 -3
- package/dist/bundled-agents/sentinel-agents/lib/agents/drift.d.ts.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/drift.js +0 -51
- package/dist/bundled-agents/sentinel-agents/lib/agents/drift.js.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/rca.d.ts +0 -3
- package/dist/bundled-agents/sentinel-agents/lib/agents/rca.d.ts.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/agents/rca.js +0 -36
- package/dist/bundled-agents/sentinel-agents/lib/agents/rca.js.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/index.d.ts +0 -2
- package/dist/bundled-agents/sentinel-agents/lib/index.d.ts.map +0 -1
- package/dist/bundled-agents/sentinel-agents/lib/index.js +0 -70
- package/dist/bundled-agents/sentinel-agents/lib/index.js.map +0 -1
- package/dist/bundled-agents/sentinel-agents/package-lock.json +0 -12591
- package/dist/bundled-agents/sentinel-agents/package.json +0 -62
- package/dist/bundled-agents/sentinel-agents/src/agents/alert.ts +0 -46
- package/dist/bundled-agents/sentinel-agents/src/agents/anomaly.ts +0 -33
- package/dist/bundled-agents/sentinel-agents/src/agents/correlation.ts +0 -56
- package/dist/bundled-agents/sentinel-agents/src/agents/drift.ts +0 -54
- package/dist/bundled-agents/sentinel-agents/src/agents/rca.ts +0 -38
- package/dist/bundled-agents/sentinel-agents/src/claude.ts +0 -71
- package/dist/bundled-agents/sentinel-agents/src/index.ts +0 -77
- package/dist/bundled-agents/sentinel-agents/tsconfig.json +0 -20
|
@@ -1,780 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Objective Clarifier Agent
|
|
4
|
-
*
|
|
5
|
-
* Purpose: Clarify ambiguous or incomplete objectives
|
|
6
|
-
* Classification: INTENT_ANALYSIS, DECOMPOSITION
|
|
7
|
-
* decision_type: objective_clarification
|
|
8
|
-
*
|
|
9
|
-
* Scope:
|
|
10
|
-
* - Resolve ambiguity
|
|
11
|
-
* - Normalize goals
|
|
12
|
-
* - Identify missing constraints
|
|
13
|
-
*
|
|
14
|
-
* CONSTITUTION COMPLIANCE:
|
|
15
|
-
* ✓ Stateless at runtime
|
|
16
|
-
* ✓ Emits exactly ONE DecisionEvent per invocation
|
|
17
|
-
* ✓ Persists ONLY via ruvector-service
|
|
18
|
-
* ✓ NEVER connects directly to databases
|
|
19
|
-
* ✓ NEVER executes SQL
|
|
20
|
-
* ✓ NEVER modifies runtime behavior
|
|
21
|
-
* ✓ NEVER orchestrates other agents
|
|
22
|
-
* ✓ NEVER enforces policy
|
|
23
|
-
* ✓ NEVER intercepts execution paths
|
|
24
|
-
*
|
|
25
|
-
* Must Never:
|
|
26
|
-
* - Generate plans
|
|
27
|
-
* - Define solutions
|
|
28
|
-
* - Execute logic
|
|
29
|
-
*/
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.ObjectiveClarifierAgent = void 0;
|
|
32
|
-
const uuid_1 = require("uuid");
|
|
33
|
-
const contracts_1 = require("../contracts");
|
|
34
|
-
const objective_clarifier_schemas_1 = require("../contracts/objective-clarifier-schemas");
|
|
35
|
-
const AGENT_ID = 'objective-clarifier-agent';
|
|
36
|
-
const AGENT_VERSION = '1.0.0';
|
|
37
|
-
const DECISION_TYPE = 'objective_clarification';
|
|
38
|
-
/**
|
|
39
|
-
* Objective Clarifier Agent Implementation
|
|
40
|
-
*
|
|
41
|
-
* This agent analyzes objectives and identifies ambiguities, missing constraints,
|
|
42
|
-
* and normalizes goals. It is purely analytical - it NEVER generates plans,
|
|
43
|
-
* defines solutions, or executes any logic.
|
|
44
|
-
*/
|
|
45
|
-
class ObjectiveClarifierAgent {
|
|
46
|
-
metadata = {
|
|
47
|
-
id: AGENT_ID,
|
|
48
|
-
name: 'Objective Clarifier Agent',
|
|
49
|
-
version: AGENT_VERSION,
|
|
50
|
-
classifications: [
|
|
51
|
-
contracts_1.AgentClassification.INTENT_ANALYSIS,
|
|
52
|
-
contracts_1.AgentClassification.DECOMPOSITION,
|
|
53
|
-
],
|
|
54
|
-
decision_type: DECISION_TYPE,
|
|
55
|
-
description: 'Clarifies ambiguous or incomplete objectives by identifying ambiguities, missing constraints, and normalizing goals.',
|
|
56
|
-
};
|
|
57
|
-
persistence;
|
|
58
|
-
telemetry;
|
|
59
|
-
constructor(persistence, telemetry) {
|
|
60
|
-
this.persistence = persistence;
|
|
61
|
-
this.telemetry = telemetry;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Validate input against ObjectiveClarifierInputSchema
|
|
65
|
-
*/
|
|
66
|
-
validateInput(input) {
|
|
67
|
-
return objective_clarifier_schemas_1.ObjectiveClarifierInputSchema.parse(input);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Invoke the objective clarifier agent
|
|
71
|
-
*
|
|
72
|
-
* DETERMINISTIC: Same input always produces same output structure
|
|
73
|
-
* STATELESS: No internal state modified
|
|
74
|
-
* NON-BLOCKING: Fully async
|
|
75
|
-
*/
|
|
76
|
-
async invoke(input, executionRef) {
|
|
77
|
-
const startTime = Date.now();
|
|
78
|
-
try {
|
|
79
|
-
// Emit telemetry start
|
|
80
|
-
this.telemetry.recordStart(AGENT_ID, executionRef, input);
|
|
81
|
-
// Perform clarification analysis (pure analysis, no side effects)
|
|
82
|
-
const output = this.clarifyObjective(input);
|
|
83
|
-
// Validate output
|
|
84
|
-
const validatedOutput = objective_clarifier_schemas_1.ObjectiveClarifierOutputSchema.parse(output);
|
|
85
|
-
// Calculate confidence based on analysis quality
|
|
86
|
-
const confidence = this.calculateConfidence(validatedOutput);
|
|
87
|
-
// Constraints applied during clarification
|
|
88
|
-
const constraintsApplied = this.getAppliedConstraints(input);
|
|
89
|
-
// Create the DecisionEvent
|
|
90
|
-
const event = (0, contracts_1.createDecisionEvent)(AGENT_ID, AGENT_VERSION, DECISION_TYPE, input, validatedOutput, confidence, constraintsApplied, executionRef);
|
|
91
|
-
// Persist via ruvector-service (best-effort, non-blocking)
|
|
92
|
-
let persistence_status;
|
|
93
|
-
try {
|
|
94
|
-
await this.persistence.store(event);
|
|
95
|
-
persistence_status = { status: 'persisted' };
|
|
96
|
-
}
|
|
97
|
-
catch (persistError) {
|
|
98
|
-
const persistMessage = persistError instanceof Error ? persistError.message : 'Unknown persistence error';
|
|
99
|
-
console.error(`[${AGENT_ID}] RuVector persistence failed (non-blocking): ${persistMessage}`);
|
|
100
|
-
persistence_status = { status: 'skipped', error: persistMessage };
|
|
101
|
-
}
|
|
102
|
-
// Emit telemetry success
|
|
103
|
-
this.telemetry.recordSuccess(AGENT_ID, executionRef, Date.now() - startTime);
|
|
104
|
-
return {
|
|
105
|
-
status: 'success',
|
|
106
|
-
event,
|
|
107
|
-
persistence_status,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
catch (error) {
|
|
111
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
112
|
-
const errorCode = this.classifyError(error);
|
|
113
|
-
// Emit telemetry failure
|
|
114
|
-
this.telemetry.recordFailure(AGENT_ID, executionRef, errorCode, errorMessage);
|
|
115
|
-
return (0, contracts_1.createErrorResult)(errorCode, errorMessage, executionRef);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Clarify the objective - Core analysis logic
|
|
120
|
-
*
|
|
121
|
-
* This is purely analytical. It NEVER:
|
|
122
|
-
* - Generates plans
|
|
123
|
-
* - Defines solutions
|
|
124
|
-
* - Executes logic
|
|
125
|
-
*/
|
|
126
|
-
clarifyObjective(input) {
|
|
127
|
-
const clarificationId = (0, uuid_1.v4)();
|
|
128
|
-
const objective = input.objective;
|
|
129
|
-
// Detect ambiguities
|
|
130
|
-
const ambiguities = this.detectAmbiguities(objective, input.context);
|
|
131
|
-
// Identify missing constraints
|
|
132
|
-
const missingConstraints = this.identifyMissingConstraints(objective, input.context);
|
|
133
|
-
// Normalize goals
|
|
134
|
-
const normalizedGoals = this.normalizeGoals(objective);
|
|
135
|
-
// Determine status
|
|
136
|
-
const status = this.determineStatus(ambiguities, missingConstraints, normalizedGoals, objective);
|
|
137
|
-
// Generate clarified objective
|
|
138
|
-
const clarifiedObjective = this.generateClarifiedObjective(objective, ambiguities, missingConstraints, normalizedGoals, input.config?.auto_resolve_low_severity);
|
|
139
|
-
// Generate prioritized clarification questions
|
|
140
|
-
const clarificationQuestions = this.generateClarificationQuestions(ambiguities, missingConstraints, input.config?.max_questions ?? 10);
|
|
141
|
-
// Compute analysis metrics
|
|
142
|
-
const analysis = this.computeAnalysisMetrics(objective, ambiguities, missingConstraints, normalizedGoals);
|
|
143
|
-
return {
|
|
144
|
-
clarification_id: clarificationId,
|
|
145
|
-
original_objective: objective,
|
|
146
|
-
status,
|
|
147
|
-
ambiguities,
|
|
148
|
-
missing_constraints: missingConstraints,
|
|
149
|
-
normalized_goals: normalizedGoals,
|
|
150
|
-
clarified_objective: clarifiedObjective,
|
|
151
|
-
clarification_questions: clarificationQuestions,
|
|
152
|
-
analysis,
|
|
153
|
-
version: '1.0.0',
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Detect ambiguities in the objective
|
|
158
|
-
*/
|
|
159
|
-
detectAmbiguities(objective, context) {
|
|
160
|
-
const ambiguities = [];
|
|
161
|
-
const words = objective.toLowerCase().split(/\s+/);
|
|
162
|
-
// Pattern-based ambiguity detection (deterministic)
|
|
163
|
-
// 1. Vague quantifiers
|
|
164
|
-
const vagueQuantifiers = ['some', 'many', 'few', 'several', 'various', 'multiple', 'numerous'];
|
|
165
|
-
for (const quantifier of vagueQuantifiers) {
|
|
166
|
-
if (objective.toLowerCase().includes(quantifier)) {
|
|
167
|
-
ambiguities.push({
|
|
168
|
-
id: `amb-quant-${quantifier}`,
|
|
169
|
-
type: 'quantitative',
|
|
170
|
-
source_text: this.findContextForWord(objective, quantifier),
|
|
171
|
-
description: `The quantifier "${quantifier}" is vague and does not specify an exact amount.`,
|
|
172
|
-
interpretations: [
|
|
173
|
-
{ interpretation: '2-5 items', likelihood: 0.4, assumptions: ['Small scale'] },
|
|
174
|
-
{ interpretation: '5-10 items', likelihood: 0.3, assumptions: ['Medium scale'] },
|
|
175
|
-
{ interpretation: '10+ items', likelihood: 0.3, assumptions: ['Larger scale'] },
|
|
176
|
-
],
|
|
177
|
-
severity: 'medium',
|
|
178
|
-
clarification_prompt: `How many specifically is meant by "${quantifier}"?`,
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
// 2. Temporal ambiguity
|
|
183
|
-
const vagueTemporals = ['soon', 'quickly', 'fast', 'later', 'eventually', 'asap'];
|
|
184
|
-
for (const temporal of vagueTemporals) {
|
|
185
|
-
if (objective.toLowerCase().includes(temporal)) {
|
|
186
|
-
ambiguities.push({
|
|
187
|
-
id: `amb-temp-${temporal}`,
|
|
188
|
-
type: 'temporal',
|
|
189
|
-
source_text: this.findContextForWord(objective, temporal),
|
|
190
|
-
description: `The temporal term "${temporal}" does not specify a concrete timeframe.`,
|
|
191
|
-
interpretations: [
|
|
192
|
-
{ interpretation: 'Within hours', likelihood: 0.2, assumptions: ['Urgent'] },
|
|
193
|
-
{ interpretation: 'Within days', likelihood: 0.4, assumptions: ['Standard priority'] },
|
|
194
|
-
{ interpretation: 'Within weeks', likelihood: 0.4, assumptions: ['Lower priority'] },
|
|
195
|
-
],
|
|
196
|
-
severity: 'medium',
|
|
197
|
-
clarification_prompt: `What is the specific timeframe for "${temporal}"?`,
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
// 3. Scope ambiguity
|
|
202
|
-
const scopeIndicators = ['all', 'everything', 'entire', 'whole', 'complete'];
|
|
203
|
-
for (const indicator of scopeIndicators) {
|
|
204
|
-
if (objective.toLowerCase().includes(indicator)) {
|
|
205
|
-
ambiguities.push({
|
|
206
|
-
id: `amb-scope-${indicator}`,
|
|
207
|
-
type: 'scope',
|
|
208
|
-
source_text: this.findContextForWord(objective, indicator),
|
|
209
|
-
description: `The scope indicator "${indicator}" may have different interpretations of boundaries.`,
|
|
210
|
-
interpretations: [
|
|
211
|
-
{ interpretation: 'Full system scope', likelihood: 0.5, assumptions: ['No exclusions'] },
|
|
212
|
-
{ interpretation: 'Primary components only', likelihood: 0.3, assumptions: ['Standard interpretation'] },
|
|
213
|
-
{ interpretation: 'Core functionality', likelihood: 0.2, assumptions: ['Minimal scope'] },
|
|
214
|
-
],
|
|
215
|
-
severity: 'low',
|
|
216
|
-
clarification_prompt: `What specifically is included in "${indicator}"? Are there any exclusions?`,
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
// 4. Referential ambiguity (pronouns without clear antecedents)
|
|
221
|
-
const pronouns = ['it', 'they', 'them', 'this', 'that', 'these', 'those'];
|
|
222
|
-
for (const pronoun of pronouns) {
|
|
223
|
-
const regex = new RegExp(`\\b${pronoun}\\b`, 'gi');
|
|
224
|
-
if (regex.test(objective) && !context?.existing_context) {
|
|
225
|
-
ambiguities.push({
|
|
226
|
-
id: `amb-ref-${pronoun}`,
|
|
227
|
-
type: 'referential',
|
|
228
|
-
source_text: this.findContextForWord(objective, pronoun),
|
|
229
|
-
description: `The pronoun "${pronoun}" has no clear antecedent in the provided context.`,
|
|
230
|
-
interpretations: [
|
|
231
|
-
{ interpretation: 'Refers to the main subject', likelihood: 0.6, assumptions: ['Most recent noun'] },
|
|
232
|
-
{ interpretation: 'Refers to the system/project', likelihood: 0.4, assumptions: ['Contextual inference'] },
|
|
233
|
-
],
|
|
234
|
-
severity: 'high',
|
|
235
|
-
clarification_prompt: `What does "${pronoun}" refer to specifically?`,
|
|
236
|
-
});
|
|
237
|
-
break; // Only flag once
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
// 5. Conditional ambiguity
|
|
241
|
-
const conditionalIndicators = ['if', 'when', 'unless', 'depending'];
|
|
242
|
-
for (const indicator of conditionalIndicators) {
|
|
243
|
-
if (objective.toLowerCase().includes(indicator)) {
|
|
244
|
-
// Check if condition is fully specified
|
|
245
|
-
const conditionalContext = this.findContextForWord(objective, indicator);
|
|
246
|
-
if (!conditionalContext.includes('then') && !conditionalContext.includes(',')) {
|
|
247
|
-
ambiguities.push({
|
|
248
|
-
id: `amb-cond-${indicator}`,
|
|
249
|
-
type: 'conditional',
|
|
250
|
-
source_text: conditionalContext,
|
|
251
|
-
description: `The conditional "${indicator}" may have an incomplete or ambiguous outcome.`,
|
|
252
|
-
interpretations: [
|
|
253
|
-
{ interpretation: 'Proceed with action', likelihood: 0.5, assumptions: ['Positive case'] },
|
|
254
|
-
{ interpretation: 'Skip/alternative action', likelihood: 0.5, assumptions: ['Negative case'] },
|
|
255
|
-
],
|
|
256
|
-
severity: 'medium',
|
|
257
|
-
clarification_prompt: `What should happen ${indicator.toLowerCase()} the condition is not met?`,
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
// 6. Semantic ambiguity (words with multiple meanings)
|
|
263
|
-
const polysemousWords = {
|
|
264
|
-
'run': ['execute', 'manage', 'operate'],
|
|
265
|
-
'handle': ['process', 'manage', 'grip'],
|
|
266
|
-
'service': ['API service', 'customer service', 'maintenance'],
|
|
267
|
-
'table': ['database table', 'UI table', 'data structure'],
|
|
268
|
-
'model': ['data model', 'ML model', 'business model'],
|
|
269
|
-
};
|
|
270
|
-
for (const [word, meanings] of Object.entries(polysemousWords)) {
|
|
271
|
-
if (words.includes(word)) {
|
|
272
|
-
ambiguities.push({
|
|
273
|
-
id: `amb-sem-${word}`,
|
|
274
|
-
type: 'semantic',
|
|
275
|
-
source_text: this.findContextForWord(objective, word),
|
|
276
|
-
description: `The word "${word}" has multiple possible meanings in this context.`,
|
|
277
|
-
interpretations: meanings.map((meaning, i) => ({
|
|
278
|
-
interpretation: meaning,
|
|
279
|
-
likelihood: 1 / meanings.length,
|
|
280
|
-
assumptions: [`Interpretation ${i + 1}`],
|
|
281
|
-
})),
|
|
282
|
-
severity: 'medium',
|
|
283
|
-
clarification_prompt: `Which meaning of "${word}" is intended: ${meanings.join(', ')}?`,
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
return ambiguities;
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Identify missing constraints
|
|
291
|
-
*/
|
|
292
|
-
identifyMissingConstraints(objective, context) {
|
|
293
|
-
const constraints = [];
|
|
294
|
-
const objectiveLower = objective.toLowerCase();
|
|
295
|
-
const knownConstraints = context?.known_constraints || [];
|
|
296
|
-
// 1. Temporal constraints
|
|
297
|
-
const hasTemporalConstraint = knownConstraints.some(c => c.toLowerCase().includes('deadline') ||
|
|
298
|
-
c.toLowerCase().includes('by ') ||
|
|
299
|
-
c.toLowerCase().includes('within')) || /\b(by|within|before|after|deadline|due)\b/i.test(objective);
|
|
300
|
-
if (!hasTemporalConstraint) {
|
|
301
|
-
constraints.push({
|
|
302
|
-
id: 'missing-temporal',
|
|
303
|
-
category: 'temporal',
|
|
304
|
-
description: 'No timeline or deadline specified for completion.',
|
|
305
|
-
impact: 'Cannot prioritize or schedule work without knowing time constraints.',
|
|
306
|
-
severity: 'high',
|
|
307
|
-
clarification_prompt: 'What is the expected timeline or deadline for this objective?',
|
|
308
|
-
default_assumption: 'Standard project timeline will be applied.',
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
// 2. Resource constraints (budget, team, tools)
|
|
312
|
-
if (!objectiveLower.includes('budget') && !objectiveLower.includes('cost') &&
|
|
313
|
-
!knownConstraints.some(c => c.toLowerCase().includes('budget'))) {
|
|
314
|
-
constraints.push({
|
|
315
|
-
id: 'missing-budget',
|
|
316
|
-
category: 'resource',
|
|
317
|
-
description: 'No budget or cost constraints specified.',
|
|
318
|
-
impact: 'Cannot determine feasibility or scope without budget information.',
|
|
319
|
-
severity: 'medium',
|
|
320
|
-
clarification_prompt: 'Are there any budget or cost constraints for this objective?',
|
|
321
|
-
default_assumption: 'Standard budget allocation will be assumed.',
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
// 3. Quality constraints
|
|
325
|
-
if (!objectiveLower.includes('quality') && !objectiveLower.includes('standard') &&
|
|
326
|
-
!objectiveLower.includes('requirement') && !objectiveLower.includes('criteria')) {
|
|
327
|
-
constraints.push({
|
|
328
|
-
id: 'missing-quality',
|
|
329
|
-
category: 'quality',
|
|
330
|
-
description: 'No quality standards or acceptance criteria specified.',
|
|
331
|
-
impact: 'Cannot determine when the objective is satisfactorily achieved.',
|
|
332
|
-
severity: 'high',
|
|
333
|
-
clarification_prompt: 'What are the quality standards or acceptance criteria for this objective?',
|
|
334
|
-
default_assumption: 'Industry-standard quality practices will be followed.',
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
// 4. Scope boundaries
|
|
338
|
-
if (!objectiveLower.includes('scope') && !objectiveLower.includes('exclude') &&
|
|
339
|
-
!objectiveLower.includes('only') && !objectiveLower.includes('limit')) {
|
|
340
|
-
constraints.push({
|
|
341
|
-
id: 'missing-scope',
|
|
342
|
-
category: 'scope',
|
|
343
|
-
description: 'No explicit scope boundaries or exclusions defined.',
|
|
344
|
-
impact: 'Risk of scope creep without clear boundaries.',
|
|
345
|
-
severity: 'medium',
|
|
346
|
-
clarification_prompt: 'What is explicitly out of scope for this objective?',
|
|
347
|
-
default_assumption: 'Scope will be interpreted conservatively.',
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
// 5. Dependencies
|
|
351
|
-
if (!objectiveLower.includes('depend') && !objectiveLower.includes('prerequisite') &&
|
|
352
|
-
!objectiveLower.includes('require') && !objectiveLower.includes('after')) {
|
|
353
|
-
constraints.push({
|
|
354
|
-
id: 'missing-dependency',
|
|
355
|
-
category: 'dependency',
|
|
356
|
-
description: 'No dependencies or prerequisites mentioned.',
|
|
357
|
-
impact: 'Unknown blockers may delay or prevent completion.',
|
|
358
|
-
severity: 'low',
|
|
359
|
-
clarification_prompt: 'Are there any dependencies or prerequisites for this objective?',
|
|
360
|
-
default_assumption: 'No external dependencies assumed.',
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
// 6. Technical constraints
|
|
364
|
-
const technicalKeywords = ['api', 'database', 'system', 'application', 'service', 'platform'];
|
|
365
|
-
const hasTechnicalContext = technicalKeywords.some(kw => objectiveLower.includes(kw));
|
|
366
|
-
if (hasTechnicalContext && !objectiveLower.includes('technology') &&
|
|
367
|
-
!objectiveLower.includes('stack') && !objectiveLower.includes('language') &&
|
|
368
|
-
!knownConstraints.some(c => c.toLowerCase().includes('tech'))) {
|
|
369
|
-
constraints.push({
|
|
370
|
-
id: 'missing-technical',
|
|
371
|
-
category: 'technical',
|
|
372
|
-
description: 'Technical objective without specified technology constraints.',
|
|
373
|
-
impact: 'Technology choices may conflict with existing systems or preferences.',
|
|
374
|
-
severity: 'medium',
|
|
375
|
-
clarification_prompt: 'Are there any technology preferences or constraints (languages, frameworks, platforms)?',
|
|
376
|
-
default_assumption: 'Appropriate technologies will be selected based on requirements.',
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
// 7. Performance constraints
|
|
380
|
-
if (hasTechnicalContext && !objectiveLower.includes('performance') &&
|
|
381
|
-
!objectiveLower.includes('latency') && !objectiveLower.includes('throughput') &&
|
|
382
|
-
!objectiveLower.includes('scale')) {
|
|
383
|
-
constraints.push({
|
|
384
|
-
id: 'missing-performance',
|
|
385
|
-
category: 'performance',
|
|
386
|
-
description: 'No performance requirements specified.',
|
|
387
|
-
impact: 'Cannot optimize or test for specific performance targets.',
|
|
388
|
-
severity: 'low',
|
|
389
|
-
clarification_prompt: 'Are there any performance requirements (response time, throughput, scale)?',
|
|
390
|
-
default_assumption: 'Standard performance levels will be targeted.',
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
// 8. Compliance constraints
|
|
394
|
-
const complianceKeywords = ['user', 'data', 'personal', 'customer', 'financial', 'health'];
|
|
395
|
-
const mayNeedCompliance = complianceKeywords.some(kw => objectiveLower.includes(kw));
|
|
396
|
-
if (mayNeedCompliance && !objectiveLower.includes('compliance') &&
|
|
397
|
-
!objectiveLower.includes('regulation') && !objectiveLower.includes('gdpr') &&
|
|
398
|
-
!objectiveLower.includes('hipaa')) {
|
|
399
|
-
constraints.push({
|
|
400
|
-
id: 'missing-compliance',
|
|
401
|
-
category: 'compliance',
|
|
402
|
-
description: 'Potential compliance requirements not addressed.',
|
|
403
|
-
impact: 'May face legal or regulatory issues if compliance requirements exist.',
|
|
404
|
-
severity: 'high',
|
|
405
|
-
clarification_prompt: 'Are there any compliance or regulatory requirements (GDPR, HIPAA, SOC2, etc.)?',
|
|
406
|
-
default_assumption: 'Standard data protection practices will be followed.',
|
|
407
|
-
});
|
|
408
|
-
}
|
|
409
|
-
return constraints;
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* Normalize goals from the objective
|
|
413
|
-
*/
|
|
414
|
-
normalizeGoals(objective) {
|
|
415
|
-
const goals = [];
|
|
416
|
-
// Split objective into potential goal statements
|
|
417
|
-
const statements = this.splitIntoStatements(objective);
|
|
418
|
-
for (let i = 0; i < statements.length; i++) {
|
|
419
|
-
const statement = statements[i].trim();
|
|
420
|
-
if (statement.length < 5)
|
|
421
|
-
continue;
|
|
422
|
-
const analysis = this.analyzeStatement(statement);
|
|
423
|
-
if (analysis.action) {
|
|
424
|
-
goals.push({
|
|
425
|
-
goal_id: `goal-${i + 1}`,
|
|
426
|
-
statement: this.normalizeStatement(statement),
|
|
427
|
-
type: this.classifyGoalType(statement, analysis),
|
|
428
|
-
action: analysis.action,
|
|
429
|
-
subject: analysis.subject || 'system',
|
|
430
|
-
object: analysis.object,
|
|
431
|
-
qualifiers: analysis.qualifiers,
|
|
432
|
-
confidence: analysis.confidence,
|
|
433
|
-
source_text: statement,
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
return goals;
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* Split objective into individual statements
|
|
441
|
-
*/
|
|
442
|
-
splitIntoStatements(objective) {
|
|
443
|
-
// Split by common delimiters
|
|
444
|
-
return objective
|
|
445
|
-
.split(/[.;]\s*/)
|
|
446
|
-
.flatMap(s => s.split(/\s*(?:and|,)\s+(?=[A-Z])/))
|
|
447
|
-
.filter(s => s.length > 0);
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Analyze a statement to extract components
|
|
451
|
-
*/
|
|
452
|
-
analyzeStatement(statement) {
|
|
453
|
-
const words = statement.toLowerCase().split(/\s+/);
|
|
454
|
-
// Action verbs to look for
|
|
455
|
-
const actionVerbs = [
|
|
456
|
-
'create', 'build', 'develop', 'implement', 'design', 'deploy',
|
|
457
|
-
'update', 'modify', 'change', 'improve', 'enhance', 'optimize',
|
|
458
|
-
'remove', 'delete', 'deprecate', 'migrate', 'refactor',
|
|
459
|
-
'integrate', 'connect', 'link', 'sync',
|
|
460
|
-
'test', 'validate', 'verify', 'check', 'audit',
|
|
461
|
-
'document', 'describe', 'explain', 'define',
|
|
462
|
-
'configure', 'setup', 'initialize', 'enable', 'disable',
|
|
463
|
-
'monitor', 'track', 'log', 'measure', 'analyze',
|
|
464
|
-
];
|
|
465
|
-
let action = null;
|
|
466
|
-
let actionIndex = -1;
|
|
467
|
-
for (let i = 0; i < words.length; i++) {
|
|
468
|
-
if (actionVerbs.includes(words[i])) {
|
|
469
|
-
action = words[i];
|
|
470
|
-
actionIndex = i;
|
|
471
|
-
break;
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
if (!action) {
|
|
475
|
-
// Try to find verb-like words at start
|
|
476
|
-
if (words.length > 0 && words[0].endsWith('e')) {
|
|
477
|
-
action = words[0];
|
|
478
|
-
actionIndex = 0;
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
// Extract subject (usually before action or after "for")
|
|
482
|
-
let subject = null;
|
|
483
|
-
const forIndex = words.indexOf('for');
|
|
484
|
-
if (forIndex !== -1 && forIndex < words.length - 1) {
|
|
485
|
-
subject = words.slice(forIndex + 1, Math.min(forIndex + 4, words.length)).join(' ');
|
|
486
|
-
}
|
|
487
|
-
else if (actionIndex > 0) {
|
|
488
|
-
subject = words.slice(0, actionIndex).join(' ');
|
|
489
|
-
}
|
|
490
|
-
// Extract object (usually after action)
|
|
491
|
-
let object = null;
|
|
492
|
-
if (actionIndex !== -1 && actionIndex < words.length - 1) {
|
|
493
|
-
const afterAction = words.slice(actionIndex + 1);
|
|
494
|
-
const stopWords = ['for', 'to', 'with', 'using', 'by', 'that', 'which'];
|
|
495
|
-
const stopIndex = afterAction.findIndex(w => stopWords.includes(w));
|
|
496
|
-
if (stopIndex !== -1) {
|
|
497
|
-
object = afterAction.slice(0, stopIndex).join(' ');
|
|
498
|
-
}
|
|
499
|
-
else {
|
|
500
|
-
object = afterAction.slice(0, 4).join(' ');
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
// Extract qualifiers
|
|
504
|
-
const qualifiers = [];
|
|
505
|
-
const qualifierPatterns = [
|
|
506
|
-
/\bwith\s+(.+?)(?:\s+and|\s+for|$)/i,
|
|
507
|
-
/\busing\s+(.+?)(?:\s+and|\s+for|$)/i,
|
|
508
|
-
/\bthat\s+(.+?)(?:\s+and|\s+for|$)/i,
|
|
509
|
-
];
|
|
510
|
-
for (const pattern of qualifierPatterns) {
|
|
511
|
-
const match = statement.match(pattern);
|
|
512
|
-
if (match) {
|
|
513
|
-
qualifiers.push(match[1].trim());
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
// Calculate confidence
|
|
517
|
-
let confidence = 0.5;
|
|
518
|
-
if (action)
|
|
519
|
-
confidence += 0.2;
|
|
520
|
-
if (subject || object)
|
|
521
|
-
confidence += 0.15;
|
|
522
|
-
if (qualifiers.length > 0)
|
|
523
|
-
confidence += 0.1;
|
|
524
|
-
confidence = Math.min(1.0, confidence);
|
|
525
|
-
return { action, subject, object, qualifiers, confidence };
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* Classify goal type
|
|
529
|
-
*/
|
|
530
|
-
classifyGoalType(statement, analysis) {
|
|
531
|
-
const lower = statement.toLowerCase();
|
|
532
|
-
// Non-functional indicators
|
|
533
|
-
const nfIndicators = [
|
|
534
|
-
'performance', 'scalab', 'secur', 'reliab', 'availab', 'maintain',
|
|
535
|
-
'usab', 'access', 'portab', 'fast', 'quick', 'efficient',
|
|
536
|
-
];
|
|
537
|
-
if (nfIndicators.some(ind => lower.includes(ind))) {
|
|
538
|
-
return 'non_functional';
|
|
539
|
-
}
|
|
540
|
-
// Constraint indicators
|
|
541
|
-
const constraintIndicators = ['must', 'shall', 'require', 'limit', 'restrict', 'only', 'cannot', 'never'];
|
|
542
|
-
if (constraintIndicators.some(ind => lower.includes(ind))) {
|
|
543
|
-
return 'constraint';
|
|
544
|
-
}
|
|
545
|
-
// Assumption indicators
|
|
546
|
-
const assumptionIndicators = ['assume', 'expect', 'given', 'provided that', 'if '];
|
|
547
|
-
if (assumptionIndicators.some(ind => lower.includes(ind))) {
|
|
548
|
-
return 'assumption';
|
|
549
|
-
}
|
|
550
|
-
// Default to functional
|
|
551
|
-
return 'functional';
|
|
552
|
-
}
|
|
553
|
-
/**
|
|
554
|
-
* Normalize a statement to standard form
|
|
555
|
-
*/
|
|
556
|
-
normalizeStatement(statement) {
|
|
557
|
-
return statement
|
|
558
|
-
.trim()
|
|
559
|
-
.replace(/\s+/g, ' ')
|
|
560
|
-
.replace(/^(the|a|an)\s+/i, '')
|
|
561
|
-
.replace(/[.;,]$/, '');
|
|
562
|
-
}
|
|
563
|
-
/**
|
|
564
|
-
* Determine the overall status
|
|
565
|
-
*/
|
|
566
|
-
determineStatus(ambiguities, missingConstraints, normalizedGoals, objective) {
|
|
567
|
-
// Check for insufficient input
|
|
568
|
-
if (objective.split(/\s+/).length < 3) {
|
|
569
|
-
return 'insufficient';
|
|
570
|
-
}
|
|
571
|
-
// Check if too complex (needs decomposition)
|
|
572
|
-
if (normalizedGoals.length > 7 || objective.length > 2000) {
|
|
573
|
-
return 'requires_decomposition';
|
|
574
|
-
}
|
|
575
|
-
// Check for critical issues
|
|
576
|
-
const hasCriticalAmbiguity = ambiguities.some(a => a.severity === 'critical');
|
|
577
|
-
const hasCriticalConstraint = missingConstraints.some(c => c.severity === 'critical');
|
|
578
|
-
const hasHighSeverityIssues = ambiguities.filter(a => a.severity === 'high').length > 2 ||
|
|
579
|
-
missingConstraints.filter(c => c.severity === 'high').length > 2;
|
|
580
|
-
if (hasCriticalAmbiguity || hasCriticalConstraint || hasHighSeverityIssues) {
|
|
581
|
-
return 'needs_clarification';
|
|
582
|
-
}
|
|
583
|
-
// Check for moderate issues
|
|
584
|
-
const totalIssues = ambiguities.length + missingConstraints.length;
|
|
585
|
-
if (totalIssues > 5) {
|
|
586
|
-
return 'needs_clarification';
|
|
587
|
-
}
|
|
588
|
-
// Seems clear
|
|
589
|
-
return 'clear';
|
|
590
|
-
}
|
|
591
|
-
/**
|
|
592
|
-
* Generate clarified objective
|
|
593
|
-
*/
|
|
594
|
-
generateClarifiedObjective(originalObjective, ambiguities, missingConstraints, normalizedGoals, autoResolveLowSeverity) {
|
|
595
|
-
const assumptions = [];
|
|
596
|
-
const unresolved = [];
|
|
597
|
-
// Process ambiguities
|
|
598
|
-
for (const ambiguity of ambiguities) {
|
|
599
|
-
if (autoResolveLowSeverity && ambiguity.severity === 'low') {
|
|
600
|
-
// Auto-resolve with highest likelihood interpretation
|
|
601
|
-
const bestInterpretation = ambiguity.interpretations.reduce((a, b) => a.likelihood > b.likelihood ? a : b);
|
|
602
|
-
assumptions.push(`Assumed "${ambiguity.source_text}" means: ${bestInterpretation.interpretation}`);
|
|
603
|
-
}
|
|
604
|
-
else if (ambiguity.severity === 'high' || ambiguity.severity === 'critical') {
|
|
605
|
-
unresolved.push(`Ambiguous: ${ambiguity.description}`);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
// Process missing constraints
|
|
609
|
-
for (const constraint of missingConstraints) {
|
|
610
|
-
if (constraint.default_assumption) {
|
|
611
|
-
assumptions.push(constraint.default_assumption);
|
|
612
|
-
}
|
|
613
|
-
if (constraint.severity === 'high' || constraint.severity === 'critical') {
|
|
614
|
-
unresolved.push(`Missing: ${constraint.description}`);
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
// Build clarified statement from normalized goals
|
|
618
|
-
let statement = originalObjective;
|
|
619
|
-
if (normalizedGoals.length > 0 && normalizedGoals.length <= 5) {
|
|
620
|
-
const goalStatements = normalizedGoals.map(g => g.statement);
|
|
621
|
-
statement = goalStatements.join('; ');
|
|
622
|
-
}
|
|
623
|
-
// Calculate confidence
|
|
624
|
-
let confidence = 1.0;
|
|
625
|
-
confidence -= ambiguities.filter(a => a.severity === 'critical').length * 0.2;
|
|
626
|
-
confidence -= ambiguities.filter(a => a.severity === 'high').length * 0.1;
|
|
627
|
-
confidence -= missingConstraints.filter(c => c.severity === 'critical').length * 0.15;
|
|
628
|
-
confidence -= missingConstraints.filter(c => c.severity === 'high').length * 0.08;
|
|
629
|
-
confidence = Math.max(0.1, confidence);
|
|
630
|
-
return {
|
|
631
|
-
statement,
|
|
632
|
-
assumptions,
|
|
633
|
-
unresolved,
|
|
634
|
-
confidence,
|
|
635
|
-
};
|
|
636
|
-
}
|
|
637
|
-
/**
|
|
638
|
-
* Generate prioritized clarification questions
|
|
639
|
-
*/
|
|
640
|
-
generateClarificationQuestions(ambiguities, missingConstraints, maxQuestions) {
|
|
641
|
-
const questions = [];
|
|
642
|
-
// Add questions from ambiguities
|
|
643
|
-
for (const ambiguity of ambiguities) {
|
|
644
|
-
questions.push({
|
|
645
|
-
question: ambiguity.clarification_prompt,
|
|
646
|
-
priority: ambiguity.severity,
|
|
647
|
-
related_ambiguity_id: ambiguity.id,
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
// Add questions from missing constraints
|
|
651
|
-
for (const constraint of missingConstraints) {
|
|
652
|
-
questions.push({
|
|
653
|
-
question: constraint.clarification_prompt,
|
|
654
|
-
priority: constraint.severity,
|
|
655
|
-
related_constraint_id: constraint.id,
|
|
656
|
-
});
|
|
657
|
-
}
|
|
658
|
-
// Sort by priority and limit
|
|
659
|
-
const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
660
|
-
return questions
|
|
661
|
-
.sort((a, b) => priorityOrder[a.priority] - priorityOrder[b.priority])
|
|
662
|
-
.slice(0, maxQuestions);
|
|
663
|
-
}
|
|
664
|
-
/**
|
|
665
|
-
* Compute analysis metrics
|
|
666
|
-
*/
|
|
667
|
-
computeAnalysisMetrics(objective, ambiguities, missingConstraints, normalizedGoals) {
|
|
668
|
-
const wordCount = objective.split(/\s+/).length;
|
|
669
|
-
// Clarity score (inverse of ambiguity severity)
|
|
670
|
-
let clarityScore = 1.0;
|
|
671
|
-
clarityScore -= ambiguities.filter(a => a.severity === 'critical').length * 0.25;
|
|
672
|
-
clarityScore -= ambiguities.filter(a => a.severity === 'high').length * 0.15;
|
|
673
|
-
clarityScore -= ambiguities.filter(a => a.severity === 'medium').length * 0.08;
|
|
674
|
-
clarityScore -= ambiguities.filter(a => a.severity === 'low').length * 0.03;
|
|
675
|
-
clarityScore = Math.max(0, clarityScore);
|
|
676
|
-
// Completeness score (inverse of missing constraints severity)
|
|
677
|
-
let completenessScore = 1.0;
|
|
678
|
-
completenessScore -= missingConstraints.filter(c => c.severity === 'critical').length * 0.2;
|
|
679
|
-
completenessScore -= missingConstraints.filter(c => c.severity === 'high').length * 0.12;
|
|
680
|
-
completenessScore -= missingConstraints.filter(c => c.severity === 'medium').length * 0.06;
|
|
681
|
-
completenessScore -= missingConstraints.filter(c => c.severity === 'low').length * 0.02;
|
|
682
|
-
completenessScore = Math.max(0, completenessScore);
|
|
683
|
-
// Complexity assessment
|
|
684
|
-
let complexity;
|
|
685
|
-
if (normalizedGoals.length <= 2 && wordCount < 50) {
|
|
686
|
-
complexity = 'simple';
|
|
687
|
-
}
|
|
688
|
-
else if (normalizedGoals.length <= 4 && wordCount < 150) {
|
|
689
|
-
complexity = 'moderate';
|
|
690
|
-
}
|
|
691
|
-
else if (normalizedGoals.length <= 7 && wordCount < 500) {
|
|
692
|
-
complexity = 'complex';
|
|
693
|
-
}
|
|
694
|
-
else {
|
|
695
|
-
complexity = 'very_complex';
|
|
696
|
-
}
|
|
697
|
-
return {
|
|
698
|
-
total_ambiguities: ambiguities.length,
|
|
699
|
-
total_missing_constraints: missingConstraints.length,
|
|
700
|
-
total_goals: normalizedGoals.length,
|
|
701
|
-
clarity_score: clarityScore,
|
|
702
|
-
completeness_score: completenessScore,
|
|
703
|
-
word_count: wordCount,
|
|
704
|
-
complexity,
|
|
705
|
-
};
|
|
706
|
-
}
|
|
707
|
-
/**
|
|
708
|
-
* Find context around a word in the objective
|
|
709
|
-
*/
|
|
710
|
-
findContextForWord(objective, word) {
|
|
711
|
-
const regex = new RegExp(`(?:\\S+\\s+){0,3}\\b${word}\\b(?:\\s+\\S+){0,3}`, 'i');
|
|
712
|
-
const match = objective.match(regex);
|
|
713
|
-
return match ? match[0] : word;
|
|
714
|
-
}
|
|
715
|
-
/**
|
|
716
|
-
* Calculate overall confidence
|
|
717
|
-
*/
|
|
718
|
-
calculateConfidence(output) {
|
|
719
|
-
let confidence = 0.6; // Base confidence
|
|
720
|
-
// Boost for clear status
|
|
721
|
-
if (output.status === 'clear') {
|
|
722
|
-
confidence += 0.2;
|
|
723
|
-
}
|
|
724
|
-
// Boost for normalized goals extracted
|
|
725
|
-
if (output.normalized_goals.length > 0 && output.normalized_goals.length <= 5) {
|
|
726
|
-
confidence += 0.1;
|
|
727
|
-
}
|
|
728
|
-
// Reduce for many ambiguities
|
|
729
|
-
if (output.ambiguities.length > 5) {
|
|
730
|
-
confidence -= 0.15;
|
|
731
|
-
}
|
|
732
|
-
// Reduce for critical issues
|
|
733
|
-
if (output.ambiguities.some(a => a.severity === 'critical')) {
|
|
734
|
-
confidence -= 0.1;
|
|
735
|
-
}
|
|
736
|
-
// Adjust based on clarity score
|
|
737
|
-
confidence = confidence * 0.7 + output.analysis.clarity_score * 0.3;
|
|
738
|
-
return Math.min(1.0, Math.max(0.0, confidence));
|
|
739
|
-
}
|
|
740
|
-
/**
|
|
741
|
-
* Get constraints applied during clarification
|
|
742
|
-
*/
|
|
743
|
-
getAppliedConstraints(input) {
|
|
744
|
-
const constraints = [
|
|
745
|
-
'read_only_analysis',
|
|
746
|
-
'no_plan_generation',
|
|
747
|
-
'no_solution_definition',
|
|
748
|
-
'no_logic_execution',
|
|
749
|
-
'deterministic_output',
|
|
750
|
-
'semantic_normalization',
|
|
751
|
-
'intent_clarification',
|
|
752
|
-
];
|
|
753
|
-
if (input.context?.known_constraints) {
|
|
754
|
-
constraints.push(...input.context.known_constraints.map(c => `user_constraint:${c}`));
|
|
755
|
-
}
|
|
756
|
-
if (input.config?.min_severity) {
|
|
757
|
-
constraints.push(`min_severity:${input.config.min_severity}`);
|
|
758
|
-
}
|
|
759
|
-
if (input.config?.auto_resolve_low_severity) {
|
|
760
|
-
constraints.push('auto_resolve_low_severity');
|
|
761
|
-
}
|
|
762
|
-
return constraints;
|
|
763
|
-
}
|
|
764
|
-
/**
|
|
765
|
-
* Classify error for proper error code
|
|
766
|
-
*/
|
|
767
|
-
classifyError(error) {
|
|
768
|
-
if (error instanceof Error) {
|
|
769
|
-
if (error.name === 'ZodError') {
|
|
770
|
-
return contracts_1.AgentErrorCodes.VALIDATION_FAILED;
|
|
771
|
-
}
|
|
772
|
-
if (error.message.includes('persistence') || error.message.includes('ruvector')) {
|
|
773
|
-
return contracts_1.AgentErrorCodes.PERSISTENCE_ERROR;
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
return contracts_1.AgentErrorCodes.PROCESSING_ERROR;
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
exports.ObjectiveClarifierAgent = ObjectiveClarifierAgent;
|
|
780
|
-
//# sourceMappingURL=objective-clarifier-agent.js.map
|