@llm-dev-ops/agentics-cli 1.4.53 → 1.4.55

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.
Files changed (325) hide show
  1. package/dist/bundled-agents/connector-hub-agents/package-lock.json +11697 -0
  2. package/dist/bundled-agents/connector-hub-agents/package.json +75 -0
  3. package/dist/bundled-agents/connector-hub-agents/tsconfig.build.json +22 -0
  4. package/dist/bundled-agents/connector-hub-agents/tsconfig.json +57 -0
  5. package/dist/bundled-agents/copilot-agents/functions/.gcloudignore +17 -0
  6. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.d.ts +14 -0
  7. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.js +35 -0
  8. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.js.map +1 -0
  9. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.d.ts +55 -0
  10. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.js +40 -0
  11. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.js.map +1 -0
  12. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.d.ts +22 -0
  13. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.js +38 -0
  14. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.js.map +1 -0
  15. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.d.ts +34 -0
  16. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.js +186 -0
  17. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.js.map +1 -0
  18. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.d.ts +36 -0
  19. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.js +121 -0
  20. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.js.map +1 -0
  21. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.d.ts +157 -0
  22. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.js +948 -0
  23. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.js.map +1 -0
  24. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.d.ts +9 -0
  25. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.js +27 -0
  26. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.js.map +1 -0
  27. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.d.ts +23 -0
  28. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.js +50 -0
  29. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.js.map +1 -0
  30. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.d.ts +214 -0
  31. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.js +91 -0
  32. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.js.map +1 -0
  33. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.d.ts +1166 -0
  34. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.js +308 -0
  35. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.js.map +1 -0
  36. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.d.ts +59 -0
  37. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.js +62 -0
  38. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.js.map +1 -0
  39. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.d.ts +400 -0
  40. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.js +113 -0
  41. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.js.map +1 -0
  42. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.d.ts +250 -0
  43. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.js +169 -0
  44. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.js.map +1 -0
  45. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.d.ts +17 -0
  46. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.js +97 -0
  47. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.js.map +1 -0
  48. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.d.ts +1674 -0
  49. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.js +246 -0
  50. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.js.map +1 -0
  51. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.d.ts +1085 -0
  52. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.js +218 -0
  53. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.js.map +1 -0
  54. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.d.ts +949 -0
  55. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.js +253 -0
  56. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.js.map +1 -0
  57. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.d.ts +657 -0
  58. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.js +205 -0
  59. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.js.map +1 -0
  60. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.d.ts +285 -0
  61. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.js +106 -0
  62. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.js.map +1 -0
  63. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.d.ts +581 -0
  64. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.js +136 -0
  65. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.js.map +1 -0
  66. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.d.ts +791 -0
  67. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.js +225 -0
  68. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.js.map +1 -0
  69. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.d.ts +120 -0
  70. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.js +535 -0
  71. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.js.map +1 -0
  72. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.d.ts +9 -0
  73. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.js +18 -0
  74. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.js.map +1 -0
  75. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.d.ts +4 -0
  76. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.js +9 -0
  77. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.js.map +1 -0
  78. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.d.ts +123 -0
  79. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.js +609 -0
  80. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.js.map +1 -0
  81. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.d.ts +10 -0
  82. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.js +25 -0
  83. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.js.map +1 -0
  84. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.d.ts +111 -0
  85. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.js +686 -0
  86. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.js.map +1 -0
  87. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.d.ts +11 -0
  88. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.js +25 -0
  89. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.js.map +1 -0
  90. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.d.ts +6 -0
  91. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.js +15 -0
  92. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.js.map +1 -0
  93. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.d.ts +126 -0
  94. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.js +780 -0
  95. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.js.map +1 -0
  96. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.d.ts +49 -0
  97. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.js +125 -0
  98. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.js.map +1 -0
  99. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.d.ts +73 -0
  100. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.js +192 -0
  101. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.js.map +1 -0
  102. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.d.ts +11 -0
  103. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.js +25 -0
  104. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.js.map +1 -0
  105. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.d.ts +127 -0
  106. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.js +483 -0
  107. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.js.map +1 -0
  108. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.d.ts +49 -0
  109. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.js +125 -0
  110. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.js.map +1 -0
  111. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.d.ts +73 -0
  112. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.js +192 -0
  113. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.js.map +1 -0
  114. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.d.ts +11 -0
  115. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.js +27 -0
  116. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.js.map +1 -0
  117. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.d.ts +122 -0
  118. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.js +645 -0
  119. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.js.map +1 -0
  120. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.d.ts +59 -0
  121. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.js +156 -0
  122. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.js.map +1 -0
  123. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.d.ts +88 -0
  124. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.js +246 -0
  125. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.js.map +1 -0
  126. package/dist/bundled-agents/copilot-agents/functions/index.js +4 -0
  127. package/dist/bundled-agents/copilot-agents/functions/jest.config.js +29 -0
  128. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.d.ts +14 -0
  129. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.js +35 -0
  130. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.js.map +1 -0
  131. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.d.ts +27 -0
  132. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.js +21 -0
  133. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.js.map +1 -0
  134. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.d.ts +22 -0
  135. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.js +38 -0
  136. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.js.map +1 -0
  137. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.d.ts +34 -0
  138. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.js +174 -0
  139. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.js.map +1 -0
  140. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.d.ts +27 -0
  141. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.js +107 -0
  142. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.js.map +1 -0
  143. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.d.ts +157 -0
  144. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.js +941 -0
  145. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.js.map +1 -0
  146. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.d.ts +9 -0
  147. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.js +27 -0
  148. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.js.map +1 -0
  149. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.d.ts +23 -0
  150. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.js +50 -0
  151. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.js.map +1 -0
  152. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.d.ts +185 -0
  153. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.js +86 -0
  154. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.js.map +1 -0
  155. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.d.ts +1081 -0
  156. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.js +305 -0
  157. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.js.map +1 -0
  158. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.d.ts +59 -0
  159. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.js +62 -0
  160. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.js.map +1 -0
  161. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.d.ts +315 -0
  162. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.js +110 -0
  163. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.js.map +1 -0
  164. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.d.ts +250 -0
  165. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.js +169 -0
  166. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.js.map +1 -0
  167. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.d.ts +16 -0
  168. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.js +88 -0
  169. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.js.map +1 -0
  170. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.d.ts +1674 -0
  171. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.js +246 -0
  172. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.js.map +1 -0
  173. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.d.ts +1000 -0
  174. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.js +215 -0
  175. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.js.map +1 -0
  176. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.d.ts +864 -0
  177. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.js +250 -0
  178. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.js.map +1 -0
  179. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.d.ts +572 -0
  180. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.js +202 -0
  181. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.js.map +1 -0
  182. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.d.ts +496 -0
  183. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.js +133 -0
  184. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.js.map +1 -0
  185. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.d.ts +706 -0
  186. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.js +222 -0
  187. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.js.map +1 -0
  188. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.d.ts +107 -0
  189. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.js +360 -0
  190. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.js.map +1 -0
  191. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.d.ts +9 -0
  192. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.js +18 -0
  193. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.js.map +1 -0
  194. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.d.ts +4 -0
  195. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.js +9 -0
  196. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.js.map +1 -0
  197. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.d.ts +123 -0
  198. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.js +609 -0
  199. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.js.map +1 -0
  200. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.d.ts +10 -0
  201. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.js +25 -0
  202. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.js.map +1 -0
  203. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.d.ts +111 -0
  204. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.js +686 -0
  205. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.js.map +1 -0
  206. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.d.ts +11 -0
  207. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.js +25 -0
  208. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.js.map +1 -0
  209. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.d.ts +6 -0
  210. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.js +15 -0
  211. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.js.map +1 -0
  212. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.d.ts +126 -0
  213. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.js +780 -0
  214. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.js.map +1 -0
  215. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.d.ts +49 -0
  216. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.js +125 -0
  217. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.js.map +1 -0
  218. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.d.ts +73 -0
  219. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.js +192 -0
  220. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.js.map +1 -0
  221. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.d.ts +11 -0
  222. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.js +25 -0
  223. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.js.map +1 -0
  224. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.d.ts +119 -0
  225. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.js +421 -0
  226. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.js.map +1 -0
  227. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.d.ts +49 -0
  228. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.js +125 -0
  229. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.js.map +1 -0
  230. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.d.ts +73 -0
  231. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.js +192 -0
  232. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.js.map +1 -0
  233. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.d.ts +11 -0
  234. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.js +27 -0
  235. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.js.map +1 -0
  236. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.d.ts +122 -0
  237. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.js +645 -0
  238. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.js.map +1 -0
  239. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.d.ts +59 -0
  240. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.js +156 -0
  241. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.js.map +1 -0
  242. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.d.ts +88 -0
  243. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.js +246 -0
  244. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.js.map +1 -0
  245. package/dist/bundled-agents/copilot-agents/functions/package-lock.json +5473 -0
  246. package/dist/bundled-agents/copilot-agents/functions/package.json +40 -0
  247. package/dist/bundled-agents/copilot-agents/functions/src/claude.ts +71 -0
  248. package/dist/bundled-agents/copilot-agents/functions/src/cors.ts +36 -0
  249. package/dist/bundled-agents/copilot-agents/functions/src/envelope.ts +77 -0
  250. package/dist/bundled-agents/copilot-agents/functions/src/handler.test.ts +340 -0
  251. package/dist/bundled-agents/copilot-agents/functions/src/health.ts +53 -0
  252. package/dist/bundled-agents/copilot-agents/functions/src/index.ts +201 -0
  253. package/dist/bundled-agents/copilot-agents/functions/src/router.ts +148 -0
  254. package/dist/bundled-agents/copilot-agents/functions/tsconfig.json +31 -0
  255. package/dist/bundled-agents/copilot-agents/package-lock.json +11825 -0
  256. package/dist/bundled-agents/copilot-agents/package.json +5 -0
  257. package/dist/bundled-agents/governance-dashboard-agents/package-lock.json +8282 -0
  258. package/dist/bundled-agents/governance-dashboard-agents/package.json +13 -0
  259. package/dist/bundled-agents/orchestrator-agents/functions/contracts/index.js +590 -0
  260. package/dist/bundled-agents/orchestrator-agents/functions/index.js +442 -0
  261. package/dist/bundled-agents/orchestrator-agents/functions/test.js +325 -0
  262. package/dist/bundled-agents/orchestrator-agents/index.js +6 -0
  263. package/dist/bundled-agents/orchestrator-agents/package-lock.json +13254 -0
  264. package/dist/bundled-agents/orchestrator-agents/package.json +20 -0
  265. package/dist/bundled-agents/platform-agents/package-lock.json +1723 -0
  266. package/dist/bundled-agents/platform-agents/package.json +22 -0
  267. package/dist/bundled-agents/platform-agents/src/agents/decision-memo.ts +463 -0
  268. package/dist/bundled-agents/platform-agents/src/agents/decision.ts +234 -0
  269. package/dist/bundled-agents/platform-agents/src/agents/executive-summary.ts +229 -0
  270. package/dist/bundled-agents/platform-agents/src/agents/risk-score.ts +327 -0
  271. package/dist/bundled-agents/platform-agents/src/claude.ts +71 -0
  272. package/dist/bundled-agents/platform-agents/src/cors.ts +24 -0
  273. package/dist/bundled-agents/platform-agents/src/envelope.ts +37 -0
  274. package/dist/bundled-agents/platform-agents/src/health.ts +20 -0
  275. package/dist/bundled-agents/platform-agents/src/index.ts +171 -0
  276. package/dist/bundled-agents/platform-agents/src/router.ts +38 -0
  277. package/dist/bundled-agents/platform-agents/src/text-analysis.ts +238 -0
  278. package/dist/bundled-agents/platform-agents/tsconfig.json +19 -0
  279. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.d.ts +3 -0
  280. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.d.ts.map +1 -0
  281. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.js +43 -0
  282. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.js.map +1 -0
  283. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.d.ts +3 -0
  284. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.d.ts.map +1 -0
  285. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.js +30 -0
  286. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.js.map +1 -0
  287. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.d.ts +3 -0
  288. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.d.ts.map +1 -0
  289. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.js +53 -0
  290. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.js.map +1 -0
  291. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.d.ts +3 -0
  292. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.d.ts.map +1 -0
  293. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.js +51 -0
  294. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.js.map +1 -0
  295. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.d.ts +3 -0
  296. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.d.ts.map +1 -0
  297. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.js +36 -0
  298. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.js.map +1 -0
  299. package/dist/bundled-agents/sentinel-agents/lib/index.d.ts +2 -0
  300. package/dist/bundled-agents/sentinel-agents/lib/index.d.ts.map +1 -0
  301. package/dist/bundled-agents/sentinel-agents/lib/index.js +70 -0
  302. package/dist/bundled-agents/sentinel-agents/lib/index.js.map +1 -0
  303. package/dist/bundled-agents/sentinel-agents/package-lock.json +12591 -0
  304. package/dist/bundled-agents/sentinel-agents/package.json +62 -0
  305. package/dist/bundled-agents/sentinel-agents/src/agents/alert.ts +46 -0
  306. package/dist/bundled-agents/sentinel-agents/src/agents/anomaly.ts +33 -0
  307. package/dist/bundled-agents/sentinel-agents/src/agents/correlation.ts +56 -0
  308. package/dist/bundled-agents/sentinel-agents/src/agents/drift.ts +54 -0
  309. package/dist/bundled-agents/sentinel-agents/src/agents/rca.ts +38 -0
  310. package/dist/bundled-agents/sentinel-agents/src/claude.ts +71 -0
  311. package/dist/bundled-agents/sentinel-agents/src/index.ts +77 -0
  312. package/dist/bundled-agents/sentinel-agents/tsconfig.json +20 -0
  313. package/dist/pipeline/auto-chain.d.ts.map +1 -1
  314. package/dist/pipeline/auto-chain.js +52 -0
  315. package/dist/pipeline/auto-chain.js.map +1 -1
  316. package/dist/pipeline/phase2/phases/ddd-generator.d.ts.map +1 -1
  317. package/dist/pipeline/phase2/phases/ddd-generator.js +194 -2
  318. package/dist/pipeline/phase2/phases/ddd-generator.js.map +1 -1
  319. package/dist/pipeline/phase2/phases/sparc-specification.d.ts.map +1 -1
  320. package/dist/pipeline/phase2/phases/sparc-specification.js +42 -33
  321. package/dist/pipeline/phase2/phases/sparc-specification.js.map +1 -1
  322. package/dist/pipeline/phase3/phases/domain-codegen.d.ts.map +1 -1
  323. package/dist/pipeline/phase3/phases/domain-codegen.js +438 -0
  324. package/dist/pipeline/phase3/phases/domain-codegen.js.map +1 -1
  325. package/package.json +1 -1
@@ -0,0 +1,780 @@
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