@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,22 @@
1
+ {
2
+ "name": "platform-agents",
3
+ "version": "1.0.0",
4
+ "description": "Platform agents Cloud Function (decision, executive-summary, decision-memo, risk-score)",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "build": "tsc",
8
+ "start": "node dist/index.js",
9
+ "dev": "ts-node src/index.ts"
10
+ },
11
+ "engines": {
12
+ "node": ">=20"
13
+ },
14
+ "dependencies": {
15
+ "@google-cloud/functions-framework": "^3.3.0",
16
+ "zod": "^3.22.4"
17
+ },
18
+ "devDependencies": {
19
+ "@types/node": "^20.11.0",
20
+ "typescript": "^5.3.3"
21
+ }
22
+ }
@@ -0,0 +1,463 @@
1
+ import crypto from "crypto";
2
+ import { z } from "zod";
3
+ import { callClaude, extractJson } from "../claude";
4
+ import { analyzeText } from "../text-analysis";
5
+
6
+ const InputSchema = z
7
+ .object({
8
+ objective: z.string(),
9
+ context: z.record(z.unknown()).optional(),
10
+ })
11
+ .strict();
12
+
13
+ interface MemoOption {
14
+ option: string;
15
+ description: string;
16
+ pros: string[];
17
+ cons: string[];
18
+ }
19
+
20
+ interface MemoResult {
21
+ background: string;
22
+ analysis: string;
23
+ options: MemoOption[];
24
+ recommendation: string;
25
+ risks: string[];
26
+ next_steps: string[];
27
+ }
28
+
29
+ // ---------------------------------------------------------------------------
30
+ // Claude-powered analysis
31
+ // ---------------------------------------------------------------------------
32
+
33
+ const SYSTEM_PROMPT = `You are a senior strategy consultant preparing a decision memo. Analyze the given objective and produce a structured decision memo with real analysis.
34
+
35
+ Return ONLY valid JSON (no markdown fences, no explanation) with this exact structure:
36
+ {
37
+ "background": "<2-3 paragraph context and background section explaining why this decision is needed, derived from the objective>",
38
+ "analysis": "<2-3 paragraph analysis section examining the key factors, trade-offs, and considerations specific to this objective>",
39
+ "options": [
40
+ {
41
+ "option": "<option name>",
42
+ "description": "<1-2 sentence description of this approach>",
43
+ "pros": ["<specific advantage>"],
44
+ "cons": ["<specific disadvantage>"]
45
+ }
46
+ ],
47
+ "recommendation": "<2-3 sentence recommended action with specific justification tied to the objective>",
48
+ "risks": ["<specific risk>"],
49
+ "next_steps": ["<specific, actionable next step>"]
50
+ }
51
+
52
+ Rules:
53
+ - Background must establish context specific to the objective, not generic project management text.
54
+ - Analysis must examine actual trade-offs and considerations for this specific initiative.
55
+ - Provide 2-4 options that are genuinely different approaches to achieving the objective. Options must be specific to the domain (not generic "full/phased/MVP" unless that's genuinely appropriate).
56
+ - Each option needs 2-4 specific pros and 2-4 specific cons referencing the objective's context.
57
+ - The recommendation must choose one option and explain why, referencing specific factors from the analysis.
58
+ - Provide 3-6 risks specific to this initiative.
59
+ - Provide 4-7 concrete, actionable next steps.
60
+ - All content must be specific to the objective, not boilerplate.`;
61
+
62
+ async function analyzeWithClaude(
63
+ objective: string,
64
+ apiKey: string
65
+ ): Promise<MemoResult> {
66
+ const raw = await callClaude(apiKey, SYSTEM_PROMPT, `Objective: ${objective}`);
67
+ return extractJson<MemoResult>(raw);
68
+ }
69
+
70
+ // ---------------------------------------------------------------------------
71
+ // Heuristic analysis (no API key)
72
+ // ---------------------------------------------------------------------------
73
+
74
+ function analyzeHeuristic(
75
+ objective: string,
76
+ context: Record<string, unknown> | undefined
77
+ ): MemoResult {
78
+ const ta = analyzeText(objective);
79
+ const entityRef = ta.entities.length > 0
80
+ ? ta.entities.slice(0, 4).join(", ")
81
+ : "the proposed system";
82
+ const actionDesc = ta.actionType !== "general" ? ta.actionType : "initiative";
83
+
84
+ // --- Background ---
85
+ const background =
86
+ `This decision memo addresses: "${truncate(objective, 150)}". ` +
87
+ `The initiative falls within the ${ta.domain} domain and involves a ${actionDesc} effort` +
88
+ `${ta.entities.length > 0 ? ` with ${entityRef}` : ""}. ` +
89
+ `${ta.constraints.length > 0 ? `Key constraints shaping this decision include ${ta.constraints.join(", ")}. ` : ""}` +
90
+ `${ta.riskSignals.length > 0 ? `Notable risk factors identified include ${ta.riskSignals.join(", ")}. ` : ""}` +
91
+ `This memo evaluates multiple approaches and provides a recommendation based on the available information.`;
92
+
93
+ // --- Analysis ---
94
+ const analysis = buildAnalysis(ta, objective, actionDesc, entityRef);
95
+
96
+ // --- Options (domain-specific) ---
97
+ const options = buildOptions(ta, actionDesc, entityRef);
98
+
99
+ // --- Recommendation ---
100
+ const recommendation = buildRecommendation(ta, options, actionDesc, entityRef);
101
+
102
+ // --- Risks ---
103
+ const risks: string[] = [];
104
+ for (const signal of ta.riskSignals) {
105
+ risks.push(riskFromSignal(signal, ta, actionDesc));
106
+ }
107
+ if (ta.actionType === "migration" && !ta.riskSignals.includes("data integrity/migration risk")) {
108
+ risks.push("Data integrity must be validated throughout the migration process to prevent loss or corruption");
109
+ }
110
+ if (ta.entities.length > 2) {
111
+ risks.push(`Integration complexity across ${ta.entities.slice(0, 3).join(", ")} may introduce unforeseen dependencies`);
112
+ }
113
+ // Minimum risks
114
+ if (risks.length < 3) {
115
+ risks.push(`Scope of the ${actionDesc} may evolve as implementation reveals additional requirements`);
116
+ }
117
+ if (risks.length < 3) {
118
+ risks.push("Team capacity and competing priorities could impact delivery timeline");
119
+ }
120
+ if (risks.length < 3) {
121
+ risks.push(`Organizational adoption and change management for the ${actionDesc} requires proactive attention`);
122
+ }
123
+
124
+ // --- Next steps ---
125
+ const nextSteps = buildNextSteps(ta, actionDesc, entityRef, context);
126
+
127
+ return { background, analysis, options, recommendation, risks, next_steps: nextSteps };
128
+ }
129
+
130
+ function buildAnalysis(
131
+ ta: ReturnType<typeof analyzeText>,
132
+ objective: string,
133
+ actionDesc: string,
134
+ entityRef: string
135
+ ): string {
136
+ const parts: string[] = [];
137
+
138
+ parts.push(
139
+ `The proposed ${actionDesc} involves ${ta.complexity} complexity` +
140
+ `${ta.entities.length > 0 ? `, touching ${entityRef}` : ""}. ` +
141
+ `${ta.wordCount > 30 ? "The objective describes a multi-faceted initiative requiring coordinated execution across several dimensions." : "The objective scope appears focused and well-defined."}`
142
+ );
143
+
144
+ if (ta.riskSignals.length > 0 && ta.positiveSignals.length > 0) {
145
+ parts.push(
146
+ `The analysis reveals both risk factors (${ta.riskSignals.slice(0, 3).join(", ")}) and ` +
147
+ `positive indicators (${ta.positiveSignals.slice(0, 2).join(", ")}). ` +
148
+ `Balancing these factors is central to selecting the right approach.`
149
+ );
150
+ } else if (ta.riskSignals.length > 0) {
151
+ parts.push(
152
+ `Key risk factors include ${ta.riskSignals.slice(0, 3).join(", ")}. ` +
153
+ `These risks inform the option evaluation and weigh toward approaches that include risk mitigation mechanisms.`
154
+ );
155
+ } else if (ta.positiveSignals.length > 0) {
156
+ parts.push(
157
+ `Favorable indicators include ${ta.positiveSignals.join(", ")}. ` +
158
+ `These factors support a more aggressive execution approach.`
159
+ );
160
+ }
161
+
162
+ if (ta.constraints.length > 0) {
163
+ parts.push(
164
+ `Constraints shaping the decision: ${ta.constraints.join(", ")}. ` +
165
+ `Each option below has been evaluated against these constraints.`
166
+ );
167
+ }
168
+
169
+ return parts.join(" ");
170
+ }
171
+
172
+ function buildOptions(
173
+ ta: ReturnType<typeof analyzeText>,
174
+ actionDesc: string,
175
+ entityRef: string
176
+ ): MemoOption[] {
177
+ const options: MemoOption[] = [];
178
+
179
+ if (ta.actionType === "migration") {
180
+ options.push(
181
+ {
182
+ option: `Big-bang ${actionDesc}`,
183
+ description: `Execute the ${entityRef} migration in a single coordinated cutover event`,
184
+ pros: [
185
+ "Shortest total migration timeline",
186
+ "Avoids running dual systems in parallel",
187
+ `Clean break to new ${ta.entities.length > 1 ? ta.entities[ta.entities.length - 1] : "target"} environment`,
188
+ ],
189
+ cons: [
190
+ "Highest risk of disruption if issues occur",
191
+ "Requires extensive pre-migration testing",
192
+ "No gradual validation — problems surface post-cutover",
193
+ ],
194
+ },
195
+ {
196
+ option: `Phased ${actionDesc}`,
197
+ description: `Migrate ${entityRef} in planned stages, validating each before proceeding`,
198
+ pros: [
199
+ "Risk is contained to each phase",
200
+ "Learnings from early phases improve later phases",
201
+ "Allows partial rollback without full reversion",
202
+ ],
203
+ cons: [
204
+ "Extended total timeline with dual-system operation",
205
+ "Integration overhead between migrated and unmigrated components",
206
+ "Requires careful phase boundary design",
207
+ ],
208
+ },
209
+ {
210
+ option: "Parallel run with gradual cutover",
211
+ description: `Run old and new systems simultaneously, shifting traffic to ${ta.entities.length > 1 ? ta.entities[ta.entities.length - 1] : "the new system"} incrementally`,
212
+ pros: [
213
+ "Lowest risk — instant rollback available at all times",
214
+ "Real-world validation with production traffic",
215
+ "No big-bang cutover event",
216
+ ],
217
+ cons: [
218
+ "Highest infrastructure cost during parallel period",
219
+ "Data synchronization between systems adds complexity",
220
+ "Longest total migration duration",
221
+ ],
222
+ }
223
+ );
224
+ } else if (ta.actionType === "optimization" || ta.actionType === "transformation") {
225
+ options.push(
226
+ {
227
+ option: `Comprehensive ${actionDesc}`,
228
+ description: `Full-scope ${actionDesc} addressing all identified areas simultaneously`,
229
+ pros: [
230
+ "Addresses all improvement areas in one effort",
231
+ `Maximizes impact of ${entityRef} changes`,
232
+ "Avoids incremental rework",
233
+ ],
234
+ cons: [
235
+ "Larger investment of time and resources upfront",
236
+ "Higher execution risk due to broad scope",
237
+ "Longer time to first measurable results",
238
+ ],
239
+ },
240
+ {
241
+ option: "Targeted quick wins first",
242
+ description: `Prioritize highest-impact ${actionDesc} items for immediate execution, defer lower-priority items`,
243
+ pros: [
244
+ "Fastest time to measurable improvement",
245
+ "Builds momentum and organizational confidence",
246
+ "Lower initial resource requirement",
247
+ ],
248
+ cons: [
249
+ "May miss systemic issues addressable only through broader changes",
250
+ "Risk of local optimizations that don't compound",
251
+ "Deferred items may never get addressed",
252
+ ],
253
+ },
254
+ {
255
+ option: "Platform-level redesign",
256
+ description: `Re-architect the underlying platform before optimizing individual components`,
257
+ pros: [
258
+ "Addresses root causes rather than symptoms",
259
+ `Creates foundation for sustained ${entityRef} improvement`,
260
+ "Prevents accumulation of technical debt",
261
+ ],
262
+ cons: [
263
+ "Significant upfront investment before visible results",
264
+ "Higher technical risk and complexity",
265
+ "May over-engineer for current needs",
266
+ ],
267
+ }
268
+ );
269
+ } else {
270
+ // General options for implementation/evaluation/integration
271
+ options.push(
272
+ {
273
+ option: `Full-scope ${actionDesc}`,
274
+ description: `Complete ${actionDesc} of ${entityRef} as described in the objective`,
275
+ pros: [
276
+ "Comprehensive solution addressing all stated requirements",
277
+ `Full value realization from ${entityRef}`,
278
+ "Clear alignment with the stated objective",
279
+ ],
280
+ cons: [
281
+ "Higher initial resource and time investment",
282
+ `Complexity of full ${entityRef} scope may introduce risks`,
283
+ "Longer timeline to initial delivery",
284
+ ],
285
+ },
286
+ {
287
+ option: `Incremental ${actionDesc}`,
288
+ description: `Execute the ${actionDesc} in defined stages with validation between each`,
289
+ pros: [
290
+ "Reduced risk through staged delivery",
291
+ "Allows course correction between stages",
292
+ "Earlier delivery of partial value",
293
+ ],
294
+ cons: [
295
+ "Extended total timeline",
296
+ "Integration overhead between stages",
297
+ `Partial ${actionDesc} may not demonstrate full value`,
298
+ ],
299
+ },
300
+ {
301
+ option: "Minimum viable scope",
302
+ description: `Deliver core capabilities first, expand scope based on validated results`,
303
+ pros: [
304
+ "Fastest path to initial value delivery",
305
+ "Lowest initial resource requirement",
306
+ "Quick validation of approach and assumptions",
307
+ ],
308
+ cons: [
309
+ "Limited scope may not meet all stakeholder needs",
310
+ "Possible rework if expansion requires architectural changes",
311
+ "May not demonstrate strategic value of the full initiative",
312
+ ],
313
+ }
314
+ );
315
+ }
316
+
317
+ return options;
318
+ }
319
+
320
+ function buildRecommendation(
321
+ ta: ReturnType<typeof analyzeText>,
322
+ options: MemoOption[],
323
+ actionDesc: string,
324
+ entityRef: string
325
+ ): string {
326
+ // Recommend based on complexity and risk profile
327
+ if (ta.complexity === "high" || ta.riskSignals.length >= 3) {
328
+ const option = options.find(
329
+ (o) => o.option.toLowerCase().includes("phased") || o.option.toLowerCase().includes("incremental")
330
+ ) || options[1];
331
+ return (
332
+ `"${option.option}" is recommended given the ${ta.complexity} complexity and ${ta.riskSignals.length} identified risk factor(s). ` +
333
+ `This approach provides risk containment through staged execution while maintaining a path to full ${actionDesc} of ${entityRef}. ` +
334
+ `Each phase should have defined success criteria and go/no-go gates.`
335
+ );
336
+ }
337
+
338
+ if (ta.riskSignals.length === 0 && ta.positiveSignals.length > 0) {
339
+ const option = options[0];
340
+ return (
341
+ `"${option.option}" is recommended based on favorable indicators (${ta.positiveSignals.slice(0, 2).join(", ")}) and manageable risk profile. ` +
342
+ `The conditions support a direct approach to ${actionDesc}. ` +
343
+ `Standard project governance and milestone tracking should be maintained throughout.`
344
+ );
345
+ }
346
+
347
+ // Default: middle option
348
+ const option = options[1] || options[0];
349
+ return (
350
+ `"${option.option}" is recommended as the most balanced approach for this ${actionDesc}. ` +
351
+ `It provides meaningful risk mitigation while maintaining reasonable delivery timelines for ${entityRef}. ` +
352
+ `${ta.constraints.length > 0 ? `This approach best accommodates the identified constraints: ${ta.constraints.join(", ")}.` : "Progress should be tracked against defined milestones."}`
353
+ );
354
+ }
355
+
356
+ function riskFromSignal(
357
+ signal: string,
358
+ ta: ReturnType<typeof analyzeText>,
359
+ actionDesc: string
360
+ ): string {
361
+ switch (signal) {
362
+ case "tight timeline pressure":
363
+ return `Timeline pressure on the ${actionDesc} may force trade-offs between scope, quality, and delivery date`;
364
+ case "resource constraints":
365
+ return "Resource limitations could create bottlenecks in delivery or force scope reduction";
366
+ case "technical complexity":
367
+ return `Technical complexity of ${ta.entities.length > 0 ? ta.entities.slice(0, 2).join(" and ") : "the solution"} increases probability of integration issues and extended debugging`;
368
+ case "vendor/third-party dependency":
369
+ return "External vendor dependencies introduce risks outside direct control, including schedule slippage and API changes";
370
+ case "regulatory/compliance exposure":
371
+ return `Compliance requirements${ta.entities.some((e) => /PCI|HIPAA|GDPR|SOC|SOX/i.test(e)) ? ` (${ta.entities.filter((e) => /PCI|HIPAA|GDPR|SOC|SOX/i.test(e)).join(", ")})` : ""} may extend timelines and require specialized expertise`;
372
+ case "data integrity/migration risk":
373
+ return "Data migration carries inherent risk of data loss, corruption, or inconsistency that must be actively managed";
374
+ case "uncertainty or unproven approach":
375
+ return "Unproven or experimental elements increase the probability of unforeseen technical challenges";
376
+ case "security exposure":
377
+ return "Security implications require dedicated review and testing cycles to prevent vulnerability introduction";
378
+ case "organizational change risk":
379
+ return "Organizational change and adoption challenges may slow realization of expected benefits";
380
+ case "scope creep potential":
381
+ return "Requirements may evolve during execution, requiring a formal change management process";
382
+ default:
383
+ return `${signal.charAt(0).toUpperCase() + signal.slice(1)} presents a risk to successful ${actionDesc} delivery`;
384
+ }
385
+ }
386
+
387
+ function buildNextSteps(
388
+ ta: ReturnType<typeof analyzeText>,
389
+ actionDesc: string,
390
+ entityRef: string,
391
+ context: Record<string, unknown> | undefined
392
+ ): string[] {
393
+ const steps: string[] = [];
394
+
395
+ if (context) {
396
+ if (context.deadline) steps.push(`Validate ${actionDesc} timeline against the ${context.deadline} deadline`);
397
+ if (context.budget) steps.push(`Confirm budget allocation of ${context.budget} for the recommended approach`);
398
+ }
399
+
400
+ steps.push(`Obtain stakeholder approval for the recommended ${actionDesc} approach`);
401
+
402
+ if (ta.entities.length > 0) {
403
+ steps.push(`Validate technical feasibility and readiness of ${ta.entities.slice(0, 3).join(", ")}`);
404
+ }
405
+
406
+ if (ta.actionType === "migration") {
407
+ steps.push("Develop detailed migration plan including data mapping, rollback procedures, and cutover schedule");
408
+ steps.push("Execute proof-of-concept migration with representative data subset");
409
+ } else if (ta.actionType === "integration") {
410
+ steps.push(`Design integration architecture and define API contracts for ${entityRef}`);
411
+ } else if (ta.actionType === "implementation") {
412
+ steps.push(`Complete technical design document and architecture review for ${entityRef}`);
413
+ }
414
+
415
+ steps.push("Assemble implementation team and confirm resource availability");
416
+ steps.push("Define success metrics, acceptance criteria, and reporting cadence");
417
+
418
+ if (ta.constraints.includes("regulatory requirement")) {
419
+ steps.push("Initiate compliance review and obtain regulatory guidance for the implementation approach");
420
+ }
421
+
422
+ steps.push(`Schedule project kickoff and establish governance structure for the ${actionDesc}`);
423
+
424
+ return steps.slice(0, 8);
425
+ }
426
+
427
+ function truncate(s: string, len: number): string {
428
+ return s.length > len ? s.slice(0, len) + "..." : s;
429
+ }
430
+
431
+ // ---------------------------------------------------------------------------
432
+ // Handler
433
+ // ---------------------------------------------------------------------------
434
+
435
+ export async function handleDecisionMemo(
436
+ body: Record<string, unknown>,
437
+ traceId?: string,
438
+ apiKey?: string
439
+ ): Promise<Record<string, unknown>> {
440
+ const parsed = InputSchema.parse(body);
441
+
442
+ let result: MemoResult;
443
+ if (apiKey) {
444
+ try {
445
+ result = await analyzeWithClaude(parsed.objective, apiKey);
446
+ } catch {
447
+ result = analyzeHeuristic(parsed.objective, parsed.context);
448
+ }
449
+ } else {
450
+ result = analyzeHeuristic(parsed.objective, parsed.context);
451
+ }
452
+
453
+ return {
454
+ memo_id: crypto.randomUUID(),
455
+ objective: parsed.objective,
456
+ background: result.background,
457
+ analysis: result.analysis,
458
+ options: result.options,
459
+ recommendation: result.recommendation,
460
+ risks: result.risks,
461
+ next_steps: result.next_steps,
462
+ };
463
+ }