@exellix/ai-tasks 7.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (524) hide show
  1. package/.env.example +3 -0
  2. package/.metadata/instructions-builders/create-expected-output-instructions.md +195 -0
  3. package/.metadata/readme.md +48 -0
  4. package/.metadata/shared/audit.md +29 -0
  5. package/.metadata/skills/professional-answer +32 -0
  6. package/.metadata/skills/professional-answer.compressed.md +11 -0
  7. package/.metadata/skills/professional-answer.instructions +33 -0
  8. package/.metadata/skills/professional-answer.instructions.md +33 -0
  9. package/.metadata/skills/professional-answer.l2.md +28 -0
  10. package/.metadata/skills/professional-answer.md +32 -0
  11. package/.metadata/skills/professional-answer.prompt +1 -0
  12. package/.metadata/skills/professional-answer.prompt.md +1 -0
  13. package/.metadata/skills/professional-decision.md +26 -0
  14. package/BREAKING-CHANGES.md +43 -0
  15. package/CHANGELOG.md +147 -0
  16. package/README.md +2497 -0
  17. package/RUNTASK_REQUEST.md +369 -0
  18. package/dist/activix/activixClient.d.ts +6 -0
  19. package/dist/activix/activixClient.d.ts.map +1 -0
  20. package/dist/activix/activixClient.js +131 -0
  21. package/dist/activix/activixClient.js.map +1 -0
  22. package/dist/activix/getTaskActivities.d.ts +10 -0
  23. package/dist/activix/getTaskActivities.d.ts.map +1 -0
  24. package/dist/activix/getTaskActivities.js +17 -0
  25. package/dist/activix/getTaskActivities.js.map +1 -0
  26. package/dist/activix/phaseTracking.d.ts +17 -0
  27. package/dist/activix/phaseTracking.d.ts.map +1 -0
  28. package/dist/activix/phaseTracking.js +85 -0
  29. package/dist/activix/phaseTracking.js.map +1 -0
  30. package/dist/aiScoping/index.d.ts +6 -0
  31. package/dist/aiScoping/index.d.ts.map +1 -0
  32. package/dist/aiScoping/index.js +4 -0
  33. package/dist/aiScoping/index.js.map +1 -0
  34. package/dist/aiScoping/runAiScoping.d.ts +36 -0
  35. package/dist/aiScoping/runAiScoping.d.ts.map +1 -0
  36. package/dist/aiScoping/runAiScoping.js +100 -0
  37. package/dist/aiScoping/runAiScoping.js.map +1 -0
  38. package/dist/aiScoping/runScopingCall.d.ts +23 -0
  39. package/dist/aiScoping/runScopingCall.d.ts.map +1 -0
  40. package/dist/aiScoping/runScopingCall.js +50 -0
  41. package/dist/aiScoping/runScopingCall.js.map +1 -0
  42. package/dist/aiScoping/validateAiScoping.d.ts +7 -0
  43. package/dist/aiScoping/validateAiScoping.d.ts.map +1 -0
  44. package/dist/aiScoping/validateAiScoping.js +33 -0
  45. package/dist/aiScoping/validateAiScoping.js.map +1 -0
  46. package/dist/aiSkillsUpstreamExports.d.ts +13 -0
  47. package/dist/aiSkillsUpstreamExports.d.ts.map +1 -0
  48. package/dist/aiSkillsUpstreamExports.js +12 -0
  49. package/dist/aiSkillsUpstreamExports.js.map +1 -0
  50. package/dist/analysis/analyzeRunTaskRequest.d.ts +29 -0
  51. package/dist/analysis/analyzeRunTaskRequest.d.ts.map +1 -0
  52. package/dist/analysis/analyzeRunTaskRequest.js +85 -0
  53. package/dist/analysis/analyzeRunTaskRequest.js.map +1 -0
  54. package/dist/analysis/index.d.ts +3 -0
  55. package/dist/analysis/index.d.ts.map +1 -0
  56. package/dist/analysis/index.js +2 -0
  57. package/dist/analysis/index.js.map +1 -0
  58. package/dist/builders/task-request-builder.d.ts +310 -0
  59. package/dist/builders/task-request-builder.d.ts.map +1 -0
  60. package/dist/builders/task-request-builder.js +581 -0
  61. package/dist/builders/task-request-builder.js.map +1 -0
  62. package/dist/compile/compileTaskConfiguration.d.ts +15 -0
  63. package/dist/compile/compileTaskConfiguration.d.ts.map +1 -0
  64. package/dist/compile/compileTaskConfiguration.js +184 -0
  65. package/dist/compile/compileTaskConfiguration.js.map +1 -0
  66. package/dist/compile/index.d.ts +2 -0
  67. package/dist/compile/index.d.ts.map +1 -0
  68. package/dist/compile/index.js +2 -0
  69. package/dist/compile/index.js.map +1 -0
  70. package/dist/core/task-sdk.d.ts +36 -0
  71. package/dist/core/task-sdk.d.ts.map +1 -0
  72. package/dist/core/task-sdk.js +2432 -0
  73. package/dist/core/task-sdk.js.map +1 -0
  74. package/dist/errors/smartInputValidationError.d.ts +39 -0
  75. package/dist/errors/smartInputValidationError.d.ts.map +1 -0
  76. package/dist/errors/smartInputValidationError.js +97 -0
  77. package/dist/errors/smartInputValidationError.js.map +1 -0
  78. package/dist/errors/taskConfigurationCompileError.d.ts +16 -0
  79. package/dist/errors/taskConfigurationCompileError.d.ts.map +1 -0
  80. package/dist/errors/taskConfigurationCompileError.js +20 -0
  81. package/dist/errors/taskConfigurationCompileError.js.map +1 -0
  82. package/dist/execution-strategies/applyExecutionStrategyOutputs.d.ts +17 -0
  83. package/dist/execution-strategies/applyExecutionStrategyOutputs.d.ts.map +1 -0
  84. package/dist/execution-strategies/applyExecutionStrategyOutputs.js +63 -0
  85. package/dist/execution-strategies/applyExecutionStrategyOutputs.js.map +1 -0
  86. package/dist/execution-strategies/constants.d.ts +14 -0
  87. package/dist/execution-strategies/constants.d.ts.map +1 -0
  88. package/dist/execution-strategies/constants.js +13 -0
  89. package/dist/execution-strategies/constants.js.map +1 -0
  90. package/dist/execution-strategies/executionStrategyCatalogMetadata.d.ts +9 -0
  91. package/dist/execution-strategies/executionStrategyCatalogMetadata.d.ts.map +1 -0
  92. package/dist/execution-strategies/executionStrategyCatalogMetadata.js +37 -0
  93. package/dist/execution-strategies/executionStrategyCatalogMetadata.js.map +1 -0
  94. package/dist/execution-strategies/genericExecutionFuncxEnvelope.d.ts +94 -0
  95. package/dist/execution-strategies/genericExecutionFuncxEnvelope.d.ts.map +1 -0
  96. package/dist/execution-strategies/genericExecutionFuncxEnvelope.js +306 -0
  97. package/dist/execution-strategies/genericExecutionFuncxEnvelope.js.map +1 -0
  98. package/dist/execution-strategies/resolveExecutionStrategies.d.ts +14 -0
  99. package/dist/execution-strategies/resolveExecutionStrategies.d.ts.map +1 -0
  100. package/dist/execution-strategies/resolveExecutionStrategies.js +108 -0
  101. package/dist/execution-strategies/resolveExecutionStrategies.js.map +1 -0
  102. package/dist/execution-strategies/runFuncxExecutionStrategy.d.ts +37 -0
  103. package/dist/execution-strategies/runFuncxExecutionStrategy.d.ts.map +1 -0
  104. package/dist/execution-strategies/runFuncxExecutionStrategy.js +72 -0
  105. package/dist/execution-strategies/runFuncxExecutionStrategy.js.map +1 -0
  106. package/dist/index.d.ts +99 -0
  107. package/dist/index.d.ts.map +1 -0
  108. package/dist/index.js +106 -0
  109. package/dist/index.js.map +1 -0
  110. package/dist/internal/resolveLlmCallForXynthesis.d.ts +52 -0
  111. package/dist/internal/resolveLlmCallForXynthesis.d.ts.map +1 -0
  112. package/dist/internal/resolveLlmCallForXynthesis.js +81 -0
  113. package/dist/internal/resolveLlmCallForXynthesis.js.map +1 -0
  114. package/dist/internal/resolveRunTaskRuntimeKnobs.d.ts +19 -0
  115. package/dist/internal/resolveRunTaskRuntimeKnobs.d.ts.map +1 -0
  116. package/dist/internal/resolveRunTaskRuntimeKnobs.js +52 -0
  117. package/dist/internal/resolveRunTaskRuntimeKnobs.js.map +1 -0
  118. package/dist/internal/runPostStepLlmCall.d.ts +52 -0
  119. package/dist/internal/runPostStepLlmCall.d.ts.map +1 -0
  120. package/dist/internal/runPostStepLlmCall.js +170 -0
  121. package/dist/internal/runPostStepLlmCall.js.map +1 -0
  122. package/dist/localTasks/collectEvidence.d.ts +3 -0
  123. package/dist/localTasks/collectEvidence.d.ts.map +1 -0
  124. package/dist/localTasks/collectEvidence.js +364 -0
  125. package/dist/localTasks/collectEvidence.js.map +1 -0
  126. package/dist/localTasks/decideWebScope.d.ts +3 -0
  127. package/dist/localTasks/decideWebScope.d.ts.map +1 -0
  128. package/dist/localTasks/decideWebScope.js +56 -0
  129. package/dist/localTasks/decideWebScope.js.map +1 -0
  130. package/dist/localTasks/index.d.ts +5 -0
  131. package/dist/localTasks/index.d.ts.map +1 -0
  132. package/dist/localTasks/index.js +19 -0
  133. package/dist/localTasks/index.js.map +1 -0
  134. package/dist/localTasks/narrixAssetPlayground.d.ts +13 -0
  135. package/dist/localTasks/narrixAssetPlayground.d.ts.map +1 -0
  136. package/dist/localTasks/narrixAssetPlayground.js +161 -0
  137. package/dist/localTasks/narrixAssetPlayground.js.map +1 -0
  138. package/dist/localTasks/narrixSubnetPlayground.d.ts +14 -0
  139. package/dist/localTasks/narrixSubnetPlayground.d.ts.map +1 -0
  140. package/dist/localTasks/narrixSubnetPlayground.js +168 -0
  141. package/dist/localTasks/narrixSubnetPlayground.js.map +1 -0
  142. package/dist/localTasks/narrixVulnGroupPlayground.d.ts +13 -0
  143. package/dist/localTasks/narrixVulnGroupPlayground.d.ts.map +1 -0
  144. package/dist/localTasks/narrixVulnGroupPlayground.js +161 -0
  145. package/dist/localTasks/narrixVulnGroupPlayground.js.map +1 -0
  146. package/dist/localTasks/narrixVulnInstancePlayground.d.ts +13 -0
  147. package/dist/localTasks/narrixVulnInstancePlayground.d.ts.map +1 -0
  148. package/dist/localTasks/narrixVulnInstancePlayground.js +165 -0
  149. package/dist/localTasks/narrixVulnInstancePlayground.js.map +1 -0
  150. package/dist/localTasks/nodeCallExport.d.ts +6 -0
  151. package/dist/localTasks/nodeCallExport.d.ts.map +1 -0
  152. package/dist/localTasks/nodeCallExport.js +99 -0
  153. package/dist/localTasks/nodeCallExport.js.map +1 -0
  154. package/dist/localTasks/nodeCallExportBatch.d.ts +3 -0
  155. package/dist/localTasks/nodeCallExportBatch.d.ts.map +1 -0
  156. package/dist/localTasks/nodeCallExportBatch.js +52 -0
  157. package/dist/localTasks/nodeCallExportBatch.js.map +1 -0
  158. package/dist/localTasks/normalizeNarrixResult.d.ts +3 -0
  159. package/dist/localTasks/normalizeNarrixResult.d.ts.map +1 -0
  160. package/dist/localTasks/normalizeNarrixResult.js +106 -0
  161. package/dist/localTasks/normalizeNarrixResult.js.map +1 -0
  162. package/dist/localTasks/registry.d.ts +4 -0
  163. package/dist/localTasks/registry.d.ts.map +1 -0
  164. package/dist/localTasks/registry.js +8 -0
  165. package/dist/localTasks/registry.js.map +1 -0
  166. package/dist/localTasks/types.d.ts +28 -0
  167. package/dist/localTasks/types.d.ts.map +1 -0
  168. package/dist/localTasks/types.js +2 -0
  169. package/dist/localTasks/types.js.map +1 -0
  170. package/dist/localTasks/validateInput.d.ts +3 -0
  171. package/dist/localTasks/validateInput.d.ts.map +1 -0
  172. package/dist/localTasks/validateInput.js +66 -0
  173. package/dist/localTasks/validateInput.js.map +1 -0
  174. package/dist/methods/convenience-methods.d.ts +45 -0
  175. package/dist/methods/convenience-methods.d.ts.map +1 -0
  176. package/dist/methods/convenience-methods.js +39 -0
  177. package/dist/methods/convenience-methods.js.map +1 -0
  178. package/dist/narrix/applyNarrixScope.d.ts +10 -0
  179. package/dist/narrix/applyNarrixScope.d.ts.map +1 -0
  180. package/dist/narrix/applyNarrixScope.js +69 -0
  181. package/dist/narrix/applyNarrixScope.js.map +1 -0
  182. package/dist/narrix/buildNarrixAttachment.d.ts +9 -0
  183. package/dist/narrix/buildNarrixAttachment.d.ts.map +1 -0
  184. package/dist/narrix/buildNarrixAttachment.js +29 -0
  185. package/dist/narrix/buildNarrixAttachment.js.map +1 -0
  186. package/dist/narrix/buildWebScopeScopeInput.d.ts +39 -0
  187. package/dist/narrix/buildWebScopeScopeInput.d.ts.map +1 -0
  188. package/dist/narrix/buildWebScopeScopeInput.js +193 -0
  189. package/dist/narrix/buildWebScopeScopeInput.js.map +1 -0
  190. package/dist/narrix/flags.d.ts +4 -0
  191. package/dist/narrix/flags.d.ts.map +1 -0
  192. package/dist/narrix/flags.js +4 -0
  193. package/dist/narrix/flags.js.map +1 -0
  194. package/dist/narrix/index.d.ts +11 -0
  195. package/dist/narrix/index.d.ts.map +1 -0
  196. package/dist/narrix/index.js +14 -0
  197. package/dist/narrix/index.js.map +1 -0
  198. package/dist/narrix/narrixClient.d.ts +9 -0
  199. package/dist/narrix/narrixClient.d.ts.map +1 -0
  200. package/dist/narrix/narrixClient.js +46 -0
  201. package/dist/narrix/narrixClient.js.map +1 -0
  202. package/dist/narrix/narrixContextMarkdown.d.ts +15 -0
  203. package/dist/narrix/narrixContextMarkdown.d.ts.map +1 -0
  204. package/dist/narrix/narrixContextMarkdown.js +98 -0
  205. package/dist/narrix/narrixContextMarkdown.js.map +1 -0
  206. package/dist/narrix/narrixRunnerModule.d.ts +11 -0
  207. package/dist/narrix/narrixRunnerModule.d.ts.map +1 -0
  208. package/dist/narrix/narrixRunnerModule.js +17 -0
  209. package/dist/narrix/narrixRunnerModule.js.map +1 -0
  210. package/dist/narrix/runNarrixForChat.d.ts +3 -0
  211. package/dist/narrix/runNarrixForChat.d.ts.map +1 -0
  212. package/dist/narrix/runNarrixForChat.js +51 -0
  213. package/dist/narrix/runNarrixForChat.js.map +1 -0
  214. package/dist/narrix/runNarrixForDocs.d.ts +3 -0
  215. package/dist/narrix/runNarrixForDocs.d.ts.map +1 -0
  216. package/dist/narrix/runNarrixForDocs.js +50 -0
  217. package/dist/narrix/runNarrixForDocs.js.map +1 -0
  218. package/dist/narrix/runNarrixForRecord.d.ts +3 -0
  219. package/dist/narrix/runNarrixForRecord.d.ts.map +1 -0
  220. package/dist/narrix/runNarrixForRecord.js +47 -0
  221. package/dist/narrix/runNarrixForRecord.js.map +1 -0
  222. package/dist/narrix/runNarrixForText.d.ts +3 -0
  223. package/dist/narrix/runNarrixForText.d.ts.map +1 -0
  224. package/dist/narrix/runNarrixForText.js +49 -0
  225. package/dist/narrix/runNarrixForText.js.map +1 -0
  226. package/dist/narrix/runnerDispatch.d.ts +12 -0
  227. package/dist/narrix/runnerDispatch.d.ts.map +1 -0
  228. package/dist/narrix/runnerDispatch.js +19 -0
  229. package/dist/narrix/runnerDispatch.js.map +1 -0
  230. package/dist/narrix/seedBundleRouting.d.ts +15 -0
  231. package/dist/narrix/seedBundleRouting.d.ts.map +1 -0
  232. package/dist/narrix/seedBundleRouting.js +46 -0
  233. package/dist/narrix/seedBundleRouting.js.map +1 -0
  234. package/dist/narrix/task.d.ts +4 -0
  235. package/dist/narrix/task.d.ts.map +1 -0
  236. package/dist/narrix/task.js +143 -0
  237. package/dist/narrix/task.js.map +1 -0
  238. package/dist/narrix/types.d.ts +104 -0
  239. package/dist/narrix/types.d.ts.map +1 -0
  240. package/dist/narrix/types.js +3 -0
  241. package/dist/narrix/types.js.map +1 -0
  242. package/dist/narrix/webContextMarkdown.d.ts +54 -0
  243. package/dist/narrix/webContextMarkdown.d.ts.map +1 -0
  244. package/dist/narrix/webContextMarkdown.js +206 -0
  245. package/dist/narrix/webContextMarkdown.js.map +1 -0
  246. package/dist/narrix/webScoper.d.ts +43 -0
  247. package/dist/narrix/webScoper.d.ts.map +1 -0
  248. package/dist/narrix/webScoper.js +144 -0
  249. package/dist/narrix/webScoper.js.map +1 -0
  250. package/dist/observability/debugTrace.d.ts +31 -0
  251. package/dist/observability/debugTrace.d.ts.map +1 -0
  252. package/dist/observability/debugTrace.js +117 -0
  253. package/dist/observability/debugTrace.js.map +1 -0
  254. package/dist/observability/extractAiTasksObservability.d.ts +7 -0
  255. package/dist/observability/extractAiTasksObservability.d.ts.map +1 -0
  256. package/dist/observability/extractAiTasksObservability.js +98 -0
  257. package/dist/observability/extractAiTasksObservability.js.map +1 -0
  258. package/dist/observability/graphExecutionRunLogContract.d.ts +19 -0
  259. package/dist/observability/graphExecutionRunLogContract.d.ts.map +1 -0
  260. package/dist/observability/graphExecutionRunLogContract.js +11 -0
  261. package/dist/observability/graphExecutionRunLogContract.js.map +1 -0
  262. package/dist/packaged-tasks-client.d.ts +66 -0
  263. package/dist/packaged-tasks-client.d.ts.map +1 -0
  264. package/dist/packaged-tasks-client.js +100 -0
  265. package/dist/packaged-tasks-client.js.map +1 -0
  266. package/dist/planWebScopeQuestions/index.d.ts +78 -0
  267. package/dist/planWebScopeQuestions/index.d.ts.map +1 -0
  268. package/dist/planWebScopeQuestions/index.js +282 -0
  269. package/dist/planWebScopeQuestions/index.js.map +1 -0
  270. package/dist/planWebScopeQuestions/runResearchPlanQuestionsFuncx.d.ts +18 -0
  271. package/dist/planWebScopeQuestions/runResearchPlanQuestionsFuncx.d.ts.map +1 -0
  272. package/dist/planWebScopeQuestions/runResearchPlanQuestionsFuncx.js +42 -0
  273. package/dist/planWebScopeQuestions/runResearchPlanQuestionsFuncx.js.map +1 -0
  274. package/dist/post-steps/audit/loadAuditTemplates.d.ts +72 -0
  275. package/dist/post-steps/audit/loadAuditTemplates.d.ts.map +1 -0
  276. package/dist/post-steps/audit/loadAuditTemplates.js +62 -0
  277. package/dist/post-steps/audit/loadAuditTemplates.js.map +1 -0
  278. package/dist/post-steps/audit/parseAuditOutput.d.ts +11 -0
  279. package/dist/post-steps/audit/parseAuditOutput.d.ts.map +1 -0
  280. package/dist/post-steps/audit/parseAuditOutput.js +50 -0
  281. package/dist/post-steps/audit/parseAuditOutput.js.map +1 -0
  282. package/dist/post-steps/audit/runAudit.d.ts +22 -0
  283. package/dist/post-steps/audit/runAudit.d.ts.map +1 -0
  284. package/dist/post-steps/audit/runAudit.js +406 -0
  285. package/dist/post-steps/audit/runAudit.js.map +1 -0
  286. package/dist/post-steps/audit/runAuditCall.d.ts +23 -0
  287. package/dist/post-steps/audit/runAuditCall.d.ts.map +1 -0
  288. package/dist/post-steps/audit/runAuditCall.js +32 -0
  289. package/dist/post-steps/audit/runAuditCall.js.map +1 -0
  290. package/dist/post-steps/polish/loadPolishTemplates.d.ts +35 -0
  291. package/dist/post-steps/polish/loadPolishTemplates.d.ts.map +1 -0
  292. package/dist/post-steps/polish/loadPolishTemplates.js +38 -0
  293. package/dist/post-steps/polish/loadPolishTemplates.js.map +1 -0
  294. package/dist/post-steps/polish/parsePolishOutput.d.ts +6 -0
  295. package/dist/post-steps/polish/parsePolishOutput.d.ts.map +1 -0
  296. package/dist/post-steps/polish/parsePolishOutput.js +47 -0
  297. package/dist/post-steps/polish/parsePolishOutput.js.map +1 -0
  298. package/dist/post-steps/polish/runPolish.d.ts +24 -0
  299. package/dist/post-steps/polish/runPolish.d.ts.map +1 -0
  300. package/dist/post-steps/polish/runPolish.js +147 -0
  301. package/dist/post-steps/polish/runPolish.js.map +1 -0
  302. package/dist/post-steps/polish/runPolishCall.d.ts +22 -0
  303. package/dist/post-steps/polish/runPolishCall.d.ts.map +1 -0
  304. package/dist/post-steps/polish/runPolishCall.js +32 -0
  305. package/dist/post-steps/polish/runPolishCall.js.map +1 -0
  306. package/dist/post-steps/resolvePostStepConfig.d.ts +58 -0
  307. package/dist/post-steps/resolvePostStepConfig.d.ts.map +1 -0
  308. package/dist/post-steps/resolvePostStepConfig.js +105 -0
  309. package/dist/post-steps/resolvePostStepConfig.js.map +1 -0
  310. package/dist/rendrixUpstreamExports.d.ts +7 -0
  311. package/dist/rendrixUpstreamExports.d.ts.map +1 -0
  312. package/dist/rendrixUpstreamExports.js +6 -0
  313. package/dist/rendrixUpstreamExports.js.map +1 -0
  314. package/dist/skillCatalogExports.d.ts +8 -0
  315. package/dist/skillCatalogExports.d.ts.map +1 -0
  316. package/dist/skillCatalogExports.js +8 -0
  317. package/dist/skillCatalogExports.js.map +1 -0
  318. package/dist/strategies/direct-execution-strategy.d.ts +31 -0
  319. package/dist/strategies/direct-execution-strategy.d.ts.map +1 -0
  320. package/dist/strategies/direct-execution-strategy.js +107 -0
  321. package/dist/strategies/direct-execution-strategy.js.map +1 -0
  322. package/dist/strategies/execution-strategy.interface.d.ts +31 -0
  323. package/dist/strategies/execution-strategy.interface.d.ts.map +1 -0
  324. package/dist/strategies/execution-strategy.interface.js +2 -0
  325. package/dist/strategies/execution-strategy.interface.js.map +1 -0
  326. package/dist/strategies/index.d.ts +9 -0
  327. package/dist/strategies/index.d.ts.map +1 -0
  328. package/dist/strategies/index.js +8 -0
  329. package/dist/strategies/index.js.map +1 -0
  330. package/dist/strategies/strategy-factory.d.ts +45 -0
  331. package/dist/strategies/strategy-factory.d.ts.map +1 -0
  332. package/dist/strategies/strategy-factory.js +59 -0
  333. package/dist/strategies/strategy-factory.js.map +1 -0
  334. package/dist/synthesis/index.d.ts +9 -0
  335. package/dist/synthesis/index.d.ts.map +1 -0
  336. package/dist/synthesis/index.js +8 -0
  337. package/dist/synthesis/index.js.map +1 -0
  338. package/dist/synthesis/resolveSourceMaterial.d.ts +35 -0
  339. package/dist/synthesis/resolveSourceMaterial.d.ts.map +1 -0
  340. package/dist/synthesis/resolveSourceMaterial.js +152 -0
  341. package/dist/synthesis/resolveSourceMaterial.js.map +1 -0
  342. package/dist/synthesis/runStructuredSynthesisRobust.d.ts +42 -0
  343. package/dist/synthesis/runStructuredSynthesisRobust.d.ts.map +1 -0
  344. package/dist/synthesis/runStructuredSynthesisRobust.js +303 -0
  345. package/dist/synthesis/runStructuredSynthesisRobust.js.map +1 -0
  346. package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.d.ts +19 -0
  347. package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.d.ts.map +1 -0
  348. package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.js +242 -0
  349. package/dist/task-strategies/buildTaskStrategyCatalogDescriptor.js.map +1 -0
  350. package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts +171 -0
  351. package/dist/task-strategies/canonicalInputExecutionStrategies.d.ts.map +1 -0
  352. package/dist/task-strategies/canonicalInputExecutionStrategies.js +117 -0
  353. package/dist/task-strategies/canonicalInputExecutionStrategies.js.map +1 -0
  354. package/dist/task-strategies/canonicalNarrixModes.d.ts +31 -0
  355. package/dist/task-strategies/canonicalNarrixModes.d.ts.map +1 -0
  356. package/dist/task-strategies/canonicalNarrixModes.js +35 -0
  357. package/dist/task-strategies/canonicalNarrixModes.js.map +1 -0
  358. package/dist/task-strategies/canonicalTaskStrategies.d.ts +104 -0
  359. package/dist/task-strategies/canonicalTaskStrategies.d.ts.map +1 -0
  360. package/dist/task-strategies/canonicalTaskStrategies.js +77 -0
  361. package/dist/task-strategies/canonicalTaskStrategies.js.map +1 -0
  362. package/dist/task-strategies/cataloxCatalogViews.d.ts +55 -0
  363. package/dist/task-strategies/cataloxCatalogViews.d.ts.map +1 -0
  364. package/dist/task-strategies/cataloxCatalogViews.js +65 -0
  365. package/dist/task-strategies/cataloxCatalogViews.js.map +1 -0
  366. package/dist/task-strategies/constants.d.ts +49 -0
  367. package/dist/task-strategies/constants.d.ts.map +1 -0
  368. package/dist/task-strategies/constants.js +49 -0
  369. package/dist/task-strategies/constants.js.map +1 -0
  370. package/dist/task-strategies/index.d.ts +22 -0
  371. package/dist/task-strategies/index.d.ts.map +1 -0
  372. package/dist/task-strategies/index.js +13 -0
  373. package/dist/task-strategies/index.js.map +1 -0
  374. package/dist/task-strategies/listAiTaskStrategies.d.ts +43 -0
  375. package/dist/task-strategies/listAiTaskStrategies.d.ts.map +1 -0
  376. package/dist/task-strategies/listAiTaskStrategies.js +74 -0
  377. package/dist/task-strategies/listAiTaskStrategies.js.map +1 -0
  378. package/dist/task-strategies/normalize.d.ts +7 -0
  379. package/dist/task-strategies/normalize.d.ts.map +1 -0
  380. package/dist/task-strategies/normalize.js +44 -0
  381. package/dist/task-strategies/normalize.js.map +1 -0
  382. package/dist/task-strategies/types.d.ts +37 -0
  383. package/dist/task-strategies/types.d.ts.map +1 -0
  384. package/dist/task-strategies/types.js +2 -0
  385. package/dist/task-strategies/types.js.map +1 -0
  386. package/dist/types/decision-contracts.d.ts +31 -0
  387. package/dist/types/decision-contracts.d.ts.map +1 -0
  388. package/dist/types/decision-contracts.js +23 -0
  389. package/dist/types/decision-contracts.js.map +1 -0
  390. package/dist/types/evidence-types.d.ts +108 -0
  391. package/dist/types/evidence-types.d.ts.map +1 -0
  392. package/dist/types/evidence-types.js +9 -0
  393. package/dist/types/evidence-types.js.map +1 -0
  394. package/dist/types/executionType.d.ts +9 -0
  395. package/dist/types/executionType.d.ts.map +1 -0
  396. package/dist/types/executionType.js +8 -0
  397. package/dist/types/executionType.js.map +1 -0
  398. package/dist/types/index.d.ts +28 -0
  399. package/dist/types/index.d.ts.map +1 -0
  400. package/dist/types/index.js +12 -0
  401. package/dist/types/index.js.map +1 -0
  402. package/dist/types/llmCall.d.ts +121 -0
  403. package/dist/types/llmCall.d.ts.map +1 -0
  404. package/dist/types/llmCall.js +39 -0
  405. package/dist/types/llmCall.js.map +1 -0
  406. package/dist/types/task-configuration.d.ts +60 -0
  407. package/dist/types/task-configuration.d.ts.map +1 -0
  408. package/dist/types/task-configuration.js +3 -0
  409. package/dist/types/task-configuration.js.map +1 -0
  410. package/dist/types/task-types.d.ts +887 -0
  411. package/dist/types/task-types.d.ts.map +1 -0
  412. package/dist/types/task-types.js +21 -0
  413. package/dist/types/task-types.js.map +1 -0
  414. package/dist/utilities/runUtility.d.ts +3 -0
  415. package/dist/utilities/runUtility.d.ts.map +1 -0
  416. package/dist/utilities/runUtility.js +204 -0
  417. package/dist/utilities/runUtility.js.map +1 -0
  418. package/dist/utils/assertRequiredRunSkillCorrelation.d.ts +7 -0
  419. package/dist/utils/assertRequiredRunSkillCorrelation.d.ts.map +1 -0
  420. package/dist/utils/assertRequiredRunSkillCorrelation.js +17 -0
  421. package/dist/utils/assertRequiredRunSkillCorrelation.js.map +1 -0
  422. package/dist/utils/assertValidSmartInputConfig.d.ts +5 -0
  423. package/dist/utils/assertValidSmartInputConfig.d.ts.map +1 -0
  424. package/dist/utils/assertValidSmartInputConfig.js +71 -0
  425. package/dist/utils/assertValidSmartInputConfig.js.map +1 -0
  426. package/dist/utils/bridgeRunSkillGatewayMemory.d.ts +13 -0
  427. package/dist/utils/bridgeRunSkillGatewayMemory.d.ts.map +1 -0
  428. package/dist/utils/bridgeRunSkillGatewayMemory.js +65 -0
  429. package/dist/utils/bridgeRunSkillGatewayMemory.js.map +1 -0
  430. package/dist/utils/extractSmartInputRenderResult.d.ts +7 -0
  431. package/dist/utils/extractSmartInputRenderResult.d.ts.map +1 -0
  432. package/dist/utils/extractSmartInputRenderResult.js +30 -0
  433. package/dist/utils/extractSmartInputRenderResult.js.map +1 -0
  434. package/dist/utils/jsonPaths.d.ts +6 -0
  435. package/dist/utils/jsonPaths.d.ts.map +1 -0
  436. package/dist/utils/jsonPaths.js +32 -0
  437. package/dist/utils/jsonPaths.js.map +1 -0
  438. package/dist/utils/normalizeSmartInputConfig.d.ts +5 -0
  439. package/dist/utils/normalizeSmartInputConfig.d.ts.map +1 -0
  440. package/dist/utils/normalizeSmartInputConfig.js +30 -0
  441. package/dist/utils/normalizeSmartInputConfig.js.map +1 -0
  442. package/dist/utils/outputValidation.d.ts +19 -0
  443. package/dist/utils/outputValidation.d.ts.map +1 -0
  444. package/dist/utils/outputValidation.js +75 -0
  445. package/dist/utils/outputValidation.js.map +1 -0
  446. package/dist/utils/runTaskRequestShape.d.ts +16 -0
  447. package/dist/utils/runTaskRequestShape.d.ts.map +1 -0
  448. package/dist/utils/runTaskRequestShape.js +80 -0
  449. package/dist/utils/runTaskRequestShape.js.map +1 -0
  450. package/dist/utils/skillTemplateVariables.d.ts +20 -0
  451. package/dist/utils/skillTemplateVariables.d.ts.map +1 -0
  452. package/dist/utils/skillTemplateVariables.js +63 -0
  453. package/dist/utils/skillTemplateVariables.js.map +1 -0
  454. package/dist/utils/xynthesizedSmartInputPaths.d.ts +16 -0
  455. package/dist/utils/xynthesizedSmartInputPaths.d.ts.map +1 -0
  456. package/dist/utils/xynthesizedSmartInputPaths.js +56 -0
  457. package/dist/utils/xynthesizedSmartInputPaths.js.map +1 -0
  458. package/dist/utils/xynthesizedWrite.d.ts +10 -0
  459. package/dist/utils/xynthesizedWrite.d.ts.map +1 -0
  460. package/dist/utils/xynthesizedWrite.js +61 -0
  461. package/dist/utils/xynthesizedWrite.js.map +1 -0
  462. package/dist/validation/analyzeExpectedRunTaskInput.d.ts +41 -0
  463. package/dist/validation/analyzeExpectedRunTaskInput.d.ts.map +1 -0
  464. package/dist/validation/analyzeExpectedRunTaskInput.js +133 -0
  465. package/dist/validation/analyzeExpectedRunTaskInput.js.map +1 -0
  466. package/dist/validation/collectSmartInputValidationIssues.d.ts +6 -0
  467. package/dist/validation/collectSmartInputValidationIssues.d.ts.map +1 -0
  468. package/dist/validation/collectSmartInputValidationIssues.js +38 -0
  469. package/dist/validation/collectSmartInputValidationIssues.js.map +1 -0
  470. package/dist/validation/helpers.d.ts +15 -0
  471. package/dist/validation/helpers.d.ts.map +1 -0
  472. package/dist/validation/helpers.js +184 -0
  473. package/dist/validation/helpers.js.map +1 -0
  474. package/dist/validation/index.d.ts +9 -0
  475. package/dist/validation/index.d.ts.map +1 -0
  476. package/dist/validation/index.js +6 -0
  477. package/dist/validation/index.js.map +1 -0
  478. package/dist/validation/types.d.ts +51 -0
  479. package/dist/validation/types.d.ts.map +1 -0
  480. package/dist/validation/types.js +5 -0
  481. package/dist/validation/types.js.map +1 -0
  482. package/dist/validation/validateRunTaskConfig.d.ts +8 -0
  483. package/dist/validation/validateRunTaskConfig.d.ts.map +1 -0
  484. package/dist/validation/validateRunTaskConfig.js +158 -0
  485. package/dist/validation/validateRunTaskConfig.js.map +1 -0
  486. package/dist/validation/validateRunTaskInvoke.d.ts +30 -0
  487. package/dist/validation/validateRunTaskInvoke.d.ts.map +1 -0
  488. package/dist/validation/validateRunTaskInvoke.js +108 -0
  489. package/dist/validation/validateRunTaskInvoke.js.map +1 -0
  490. package/documenations/activix-feature-request-identity.md +123 -0
  491. package/documenations/activix.md +175 -0
  492. package/documenations/bug-report-xynthesis-and-synthesis-call.md +217 -0
  493. package/documenations/core-runtime-tokens-and-strategies.md +123 -0
  494. package/documenations/downstream-environment.md +48 -0
  495. package/documenations/downstream-test-runtime-teardown-cleanup.md +73 -0
  496. package/documenations/examples/xynthesis-run-task-request.example.json +170 -0
  497. package/documenations/feature-request-ai-skills-raw-template-access.md +82 -0
  498. package/documenations/feature-request-athenix-core-directive.md +145 -0
  499. package/documenations/feature-request-athenix-token-extraction.md +124 -0
  500. package/documenations/funcx-catalog-hosting-checklist.md +107 -0
  501. package/documenations/funcx-scoping-integration-gaps.md +120 -0
  502. package/documenations/funcx-upstream-github-issues-draft.md +153 -0
  503. package/documenations/identity-metadata-contract.md +165 -0
  504. package/documenations/intermediate-steps.md +33 -0
  505. package/documenations/record-and-template-variables.md +32 -0
  506. package/documenations/run-task-execution-flow.md +153 -0
  507. package/documenations/run-task-single-run-checklist.md +109 -0
  508. package/documenations/schemas/README.md +40 -0
  509. package/documenations/schemas/openapi-3.1-components.yaml +24 -0
  510. package/documenations/schemas/v1/output-schema.json +55 -0
  511. package/documenations/schemas/v1/output-validation-result.json +41 -0
  512. package/documenations/schemas/v1/run-task-request.json +219 -0
  513. package/documenations/schemas/v1/synthesized-artifacts.json +133 -0
  514. package/documenations/synthesis-invocation-notes.md +26 -0
  515. package/documenations/synthesized-context-guide.md +84 -0
  516. package/documenations/task-core-and-core-aware-synthesis.md +58 -0
  517. package/documenations/upstream-feature-requests/ai-skills-llm-observability.md +129 -0
  518. package/documenations/upstream-feature-requests/xynthesis-llm-observability.md +125 -0
  519. package/documenations/upstream-feedback-request-shape-clarification.md +101 -0
  520. package/documenations/web-context-precedence.md +33 -0
  521. package/documenations/web-scoping-in-ai-tasks.md +503 -0
  522. package/documenations/xynthesis-activix-telemetry.md +28 -0
  523. package/documenations/xynthesis-upstream-fixes-checklist.md +71 -0
  524. package/package.json +92 -0
@@ -0,0 +1,78 @@
1
+ /**
2
+ * AI-driven planning of explicit web-scope questions (Studio → `narrix.webScopeQuestions`).
3
+ * FuncX **`research/plan-questions`** uses the generic envelope (see `runResearchPlanQuestionsViaFuncx`).
4
+ */
5
+ import { setResearchPlanQuestionsFuncxInvoker } from "./runResearchPlanQuestionsFuncx.js";
6
+ export { setResearchPlanQuestionsFuncxInvoker };
7
+ import type { DebugTraceCollector } from "../observability/debugTrace.js";
8
+ import type { DebugTraceTask } from "../types/task-types.js";
9
+ import type { LlmCallConfig, LlmCallObservation } from "../types/llmCall.js";
10
+ /** Stable machine reason codes for `PlanWebScopeQuestionsOutput.reasonCodes`. */
11
+ export declare const PlanWebScopeQuestionsReasonCode: {
12
+ readonly OUTPUT_INVALID: "OUTPUT_INVALID";
13
+ readonly PARSE_FAILED: "PARSE_FAILED";
14
+ readonly LLM_ERROR: "LLM_ERROR";
15
+ readonly INPUT_TOO_THIN: "INPUT_TOO_THIN";
16
+ };
17
+ export type PlanWebScopeQuestionsReasonCode = (typeof PlanWebScopeQuestionsReasonCode)[keyof typeof PlanWebScopeQuestionsReasonCode];
18
+ export type PlanWebScopeQuestionsMemorySummary = {
19
+ jobMemory?: unknown;
20
+ taskMemory?: unknown;
21
+ executionMemory?: unknown;
22
+ };
23
+ export type PlanWebScopeQuestionsInput = {
24
+ nodeQuestion: string;
25
+ nodeInput?: unknown;
26
+ rawRecord?: unknown;
27
+ memorySummary?: PlanWebScopeQuestionsMemorySummary;
28
+ xynthesized?: {
29
+ job?: unknown;
30
+ task?: unknown;
31
+ };
32
+ maxQuestions: number;
33
+ };
34
+ export type PlanWebScopeQuestionItem = {
35
+ id: string;
36
+ question: string;
37
+ reason: string;
38
+ source: "ai-driven";
39
+ };
40
+ export type PlanWebScopeQuestionsOutput = {
41
+ questions: PlanWebScopeQuestionItem[];
42
+ confidence: number;
43
+ skipped?: boolean;
44
+ reasonCodes?: string[];
45
+ };
46
+ export type ParsePlanWebScopeQuestionsResult = {
47
+ ok: true;
48
+ value: PlanWebScopeQuestionsOutput;
49
+ } | {
50
+ ok: false;
51
+ errors: string[];
52
+ };
53
+ /**
54
+ * Parse and validate model JSON for plan-web-scope-questions. `maxQuestions` is clamped to 1–20 before checking counts.
55
+ */
56
+ export declare function parseAndValidatePlanWebScopeQuestionsOutput(rawText: string, maxQuestions: number): ParsePlanWebScopeQuestionsResult;
57
+ export declare function buildPlanWebScopeQuestionsUserPrompt(input: PlanWebScopeQuestionsInput): string;
58
+ export type RunPlanWebScopeQuestionsParams = {
59
+ input: PlanWebScopeQuestionsInput;
60
+ /** `xynthesis`: local gateway via `@exellix/xynthesis` (default). `funcx`: `research/plan-questions` generic envelope. */
61
+ backend?: "xynthesis" | "funcx";
62
+ /** Override FuncX function id when `backend` is `funcx` (must use the same generic request shape). */
63
+ funcxFunctionId?: string;
64
+ llmCall?: LlmCallConfig;
65
+ jobId?: string;
66
+ taskId?: string;
67
+ agentId?: string;
68
+ traceCollector?: DebugTraceCollector | null;
69
+ traceTask?: Omit<DebugTraceTask, "metadata"> & {
70
+ metadata?: Record<string, unknown>;
71
+ };
72
+ observationSink?: (obs: LlmCallObservation) => void;
73
+ };
74
+ /**
75
+ * Plans web-scope questions via Xynthesis (default) or FuncX `research/plan-questions`.
76
+ */
77
+ export declare function runPlanWebScopeQuestions(params: RunPlanWebScopeQuestionsParams): Promise<PlanWebScopeQuestionsOutput>;
78
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/planWebScopeQuestions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAGL,oCAAoC,EACrC,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,oCAAoC,EAAE,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE7E,iFAAiF;AACjF,eAAO,MAAM,+BAA+B;;;;;CAKlC,CAAC;AAEX,MAAM,MAAM,+BAA+B,GACzC,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,OAAO,+BAA+B,CAAC,CAAC;AAEzF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,E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E,mBAAmB,GAAG,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IACtF,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,2BAA2B,CAAC,CAqGtC"}
@@ -0,0 +1,282 @@
1
+ /**
2
+ * AI-driven planning of explicit web-scope questions (Studio → `narrix.webScopeQuestions`).
3
+ * FuncX **`research/plan-questions`** uses the generic envelope (see `runResearchPlanQuestionsViaFuncx`).
4
+ */
5
+ import { randomUUID } from "node:crypto";
6
+ import { runPostStepLlmCall } from "../internal/runPostStepLlmCall.js";
7
+ import { adaptFuncxResearchPlanToOutput, runResearchPlanQuestionsViaFuncx, setResearchPlanQuestionsFuncxInvoker, } from "./runResearchPlanQuestionsFuncx.js";
8
+ export { setResearchPlanQuestionsFuncxInvoker };
9
+ /** Stable machine reason codes for `PlanWebScopeQuestionsOutput.reasonCodes`. */
10
+ export const PlanWebScopeQuestionsReasonCode = {
11
+ OUTPUT_INVALID: "OUTPUT_INVALID",
12
+ PARSE_FAILED: "PARSE_FAILED",
13
+ LLM_ERROR: "LLM_ERROR",
14
+ INPUT_TOO_THIN: "INPUT_TOO_THIN",
15
+ };
16
+ const MAX_JSON_SNIPPET = 24_000;
17
+ function clampInt(n, lo, hi) {
18
+ if (!Number.isFinite(n))
19
+ return lo;
20
+ return Math.min(hi, Math.max(lo, Math.floor(n)));
21
+ }
22
+ function jsonSnippet(label, value) {
23
+ try {
24
+ const s = JSON.stringify(value, null, 0);
25
+ if (s.length <= MAX_JSON_SNIPPET)
26
+ return `${label}:\n${s}`;
27
+ return `${label}:\n${s.slice(0, MAX_JSON_SNIPPET)}\n…(truncated)`;
28
+ }
29
+ catch {
30
+ return `${label}:\n<unserializable>`;
31
+ }
32
+ }
33
+ function stripJsonFences(s) {
34
+ let t = s.trim();
35
+ if (t.startsWith("```")) {
36
+ t = t.replace(/^```(?:json)?\s*/i, "").replace(/\s*```\s*$/i, "");
37
+ }
38
+ return t.trim();
39
+ }
40
+ function extractJsonObject(raw) {
41
+ const t = stripJsonFences(raw);
42
+ const start = t.indexOf("{");
43
+ const end = t.lastIndexOf("}");
44
+ if (start < 0 || end <= start)
45
+ return null;
46
+ try {
47
+ return JSON.parse(t.slice(start, end + 1));
48
+ }
49
+ catch {
50
+ return null;
51
+ }
52
+ }
53
+ function isRecord(v) {
54
+ return v !== null && typeof v === "object" && !Array.isArray(v);
55
+ }
56
+ /**
57
+ * Parse and validate model JSON for plan-web-scope-questions. `maxQuestions` is clamped to 1–20 before checking counts.
58
+ */
59
+ export function parseAndValidatePlanWebScopeQuestionsOutput(rawText, maxQuestions) {
60
+ const errors = [];
61
+ const maxQ = clampInt(maxQuestions, 1, 20);
62
+ const parsed = extractJsonObject(rawText);
63
+ if (parsed == null) {
64
+ errors.push("Could not parse JSON object from model output");
65
+ return { ok: false, errors };
66
+ }
67
+ if (!isRecord(parsed)) {
68
+ errors.push("Root must be a JSON object");
69
+ return { ok: false, errors };
70
+ }
71
+ let confidence = 0;
72
+ const confidenceRaw = parsed.confidence;
73
+ if (typeof confidenceRaw !== "number" || !Number.isFinite(confidenceRaw)) {
74
+ errors.push("confidence must be a finite number");
75
+ }
76
+ else if (confidenceRaw < 0 || confidenceRaw > 1) {
77
+ errors.push("confidence must be between 0 and 1 inclusive");
78
+ }
79
+ else {
80
+ confidence = confidenceRaw;
81
+ }
82
+ const questionsRaw = parsed.questions;
83
+ let questionsIn = [];
84
+ if (!Array.isArray(questionsRaw)) {
85
+ errors.push("questions must be an array");
86
+ }
87
+ else if (questionsRaw.length > maxQ) {
88
+ errors.push(`questions length ${questionsRaw.length} exceeds maxQuestions (${maxQ})`);
89
+ }
90
+ else {
91
+ questionsIn = questionsRaw;
92
+ for (let i = 0; i < questionsRaw.length; i++) {
93
+ const q = questionsRaw[i];
94
+ if (!isRecord(q)) {
95
+ errors.push(`questions[${i}] must be an object`);
96
+ continue;
97
+ }
98
+ if (typeof q.question !== "string" || !q.question.trim()) {
99
+ errors.push(`questions[${i}].question must be a non-empty string`);
100
+ }
101
+ if (typeof q.reason !== "string" || !q.reason.trim()) {
102
+ errors.push(`questions[${i}].reason must be a non-empty string`);
103
+ }
104
+ if (q.source !== undefined && q.source !== "ai-driven") {
105
+ errors.push(`questions[${i}].source must be "ai-driven" when set`);
106
+ }
107
+ if (q.id !== undefined && typeof q.id !== "string") {
108
+ errors.push(`questions[${i}].id must be a string when set`);
109
+ }
110
+ }
111
+ }
112
+ const skipped = parsed.skipped === true;
113
+ const reasonCodesRaw = parsed.reasonCodes;
114
+ if (reasonCodesRaw !== undefined && !Array.isArray(reasonCodesRaw)) {
115
+ errors.push("reasonCodes must be an array of strings when set");
116
+ }
117
+ else if (Array.isArray(reasonCodesRaw)) {
118
+ for (let i = 0; i < reasonCodesRaw.length; i++) {
119
+ if (typeof reasonCodesRaw[i] !== "string") {
120
+ errors.push(`reasonCodes[${i}] must be a string`);
121
+ }
122
+ }
123
+ }
124
+ if (errors.length)
125
+ return { ok: false, errors };
126
+ const questions = questionsIn.map((q) => {
127
+ const o = q;
128
+ const id = typeof o.id === "string" && o.id.trim()
129
+ ? o.id.trim()
130
+ : randomUUID();
131
+ return {
132
+ id,
133
+ question: String(o.question).trim(),
134
+ reason: String(o.reason).trim(),
135
+ source: "ai-driven",
136
+ };
137
+ });
138
+ const reasonCodes = Array.isArray(reasonCodesRaw) && reasonCodesRaw.length
139
+ ? reasonCodesRaw.map(String)
140
+ : undefined;
141
+ return {
142
+ ok: true,
143
+ value: {
144
+ questions,
145
+ confidence,
146
+ ...(skipped ? { skipped: true } : {}),
147
+ ...(reasonCodes ? { reasonCodes } : {}),
148
+ },
149
+ };
150
+ }
151
+ const PLAN_WEB_SCOPE_SYSTEM = `You are a planning assistant for web evidence collection.
152
+ Return ONLY a single JSON object (no markdown fences, no prose) with this exact shape:
153
+ {
154
+ "questions": Array<{ "id"?: string, "question": string, "reason": string, "source": "ai-driven" }>,
155
+ "confidence": number,
156
+ "skipped"?: boolean,
157
+ "reasonCodes"?: string[]
158
+ }
159
+ Rules:
160
+ - "confidence" is a number from 0 to 1.
161
+ - Each "question" must be a concrete web search or research question (non-empty string).
162
+ - Each "reason" briefly explains why that question helps (non-empty string).
163
+ - "source" must be the literal string "ai-driven" for every question entry.
164
+ - Produce at most the requested maxQuestions items in "questions".
165
+ - If you cannot propose useful questions, set "skipped": true, "questions": [], "confidence" <= 0.5, and include "reasonCodes" such as ["INPUT_TOO_THIN"].`;
166
+ export function buildPlanWebScopeQuestionsUserPrompt(input) {
167
+ const maxQ = clampInt(input.maxQuestions, 1, 20);
168
+ const nq = typeof input.nodeQuestion === "string" ? input.nodeQuestion.trim() : "";
169
+ const lines = [
170
+ `maxQuestions: ${maxQ}`,
171
+ "",
172
+ "nodeQuestion:",
173
+ nq || "(empty)",
174
+ "",
175
+ "nodeInput:",
176
+ jsonSnippet("nodeInput", input.nodeInput ?? null),
177
+ ];
178
+ if (input.rawRecord !== undefined) {
179
+ lines.push("", "rawRecord:", jsonSnippet("rawRecord", input.rawRecord));
180
+ }
181
+ if (input.memorySummary !== undefined) {
182
+ lines.push("", "memorySummary:", jsonSnippet("memorySummary", input.memorySummary));
183
+ }
184
+ if (input.xynthesized !== undefined) {
185
+ lines.push("", "xynthesized:", jsonSnippet("xynthesized", input.xynthesized));
186
+ }
187
+ return lines.join("\n");
188
+ }
189
+ /**
190
+ * Plans web-scope questions via Xynthesis (default) or FuncX `research/plan-questions`.
191
+ */
192
+ export async function runPlanWebScopeQuestions(params) {
193
+ const { input, backend = "xynthesis", funcxFunctionId, llmCall, jobId, taskId, agentId, traceCollector, traceTask, observationSink, } = params;
194
+ const nq = typeof input.nodeQuestion === "string" ? input.nodeQuestion.trim() : "";
195
+ const maxQ = clampInt(input.maxQuestions, 1, 20);
196
+ if (!nq) {
197
+ return {
198
+ questions: [],
199
+ confidence: 0,
200
+ skipped: true,
201
+ reasonCodes: [PlanWebScopeQuestionsReasonCode.INPUT_TOO_THIN],
202
+ };
203
+ }
204
+ if (backend === "funcx") {
205
+ try {
206
+ const raw = await runResearchPlanQuestionsViaFuncx({
207
+ input: { ...input, nodeQuestion: nq, maxQuestions: maxQ },
208
+ jobId,
209
+ taskId,
210
+ agentId,
211
+ funcxFunctionId,
212
+ });
213
+ const adapted = adaptFuncxResearchPlanToOutput(raw);
214
+ const maxAllowed = maxQ;
215
+ if (adapted.questions.length > maxAllowed) {
216
+ return {
217
+ questions: [],
218
+ confidence: 0,
219
+ skipped: true,
220
+ reasonCodes: [PlanWebScopeQuestionsReasonCode.OUTPUT_INVALID],
221
+ };
222
+ }
223
+ if (adapted.questions.length === 0 && adapted.skipped !== true) {
224
+ return {
225
+ questions: [],
226
+ confidence: 0,
227
+ skipped: true,
228
+ reasonCodes: [PlanWebScopeQuestionsReasonCode.OUTPUT_INVALID],
229
+ };
230
+ }
231
+ return {
232
+ questions: adapted.questions,
233
+ confidence: adapted.confidence,
234
+ ...(adapted.skipped ? { skipped: true } : {}),
235
+ ...(adapted.reasonCodes?.length ? { reasonCodes: adapted.reasonCodes } : {}),
236
+ };
237
+ }
238
+ catch {
239
+ return {
240
+ questions: [],
241
+ confidence: 0,
242
+ skipped: true,
243
+ reasonCodes: [PlanWebScopeQuestionsReasonCode.LLM_ERROR],
244
+ };
245
+ }
246
+ }
247
+ const userPrompt = buildPlanWebScopeQuestionsUserPrompt({ ...input, nodeQuestion: nq, maxQuestions: maxQ });
248
+ try {
249
+ const { text } = await runPostStepLlmCall({
250
+ systemPrompt: PLAN_WEB_SCOPE_SYSTEM,
251
+ userPrompt,
252
+ llmCall,
253
+ stage: "plan-web-scope-questions",
254
+ structuredOutput: true,
255
+ jobId: jobId ?? "plan-web-scope-questions",
256
+ taskId,
257
+ agentId: agentId ?? "plan-web-scope-questions",
258
+ traceCollector,
259
+ traceTask,
260
+ observationSink,
261
+ });
262
+ const parsed = parseAndValidatePlanWebScopeQuestionsOutput(text, maxQ);
263
+ if (!parsed.ok) {
264
+ return {
265
+ questions: [],
266
+ confidence: 0,
267
+ skipped: true,
268
+ reasonCodes: [PlanWebScopeQuestionsReasonCode.OUTPUT_INVALID],
269
+ };
270
+ }
271
+ return parsed.value;
272
+ }
273
+ catch {
274
+ return {
275
+ questions: [],
276
+ confidence: 0,
277
+ skipped: true,
278
+ reasonCodes: [PlanWebScopeQuestionsReasonCode.LLM_ERROR],
279
+ };
280
+ }
281
+ }
282
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/planWebScopeQuestions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EACL,8BAA8B,EAC9B,gCAAgC,EAChC,oCAAoC,GACrC,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,oCAAoC,EAAE,CAAC;AAKhD,iFAAiF;AACjF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,cAAc,EAAE,gBAAgB;IAChC,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,cAAc,EAAE,gBAAgB;CACxB,CAAC;AAkCX,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEhC,SAAS,QAAQ,CAAC,CAAS,EAAE,EAAU,EAAE,EAAU;IACjD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAA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AC;YACP,OAAO;gBACL,SAAS,EAAE,EAAE;gBACb,UAAU,EAAE,CAAC;gBACb,OAAO,EAAE,IAAI;gBACb,WAAW,EAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;aACzD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,oCAAoC,CAAC,EAAE,GAAG,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IAE5G,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,kBAAkB,CAAC;YACxC,YAAY,EAAE,qBAAqB;YACnC,UAAU;YACV,OAAO;YACP,KAAK,EAAE,0BAA0B;YACjC,gBAAgB,EAAE,IAAI;YACtB,KAAK,EAAE,KAAK,IAAI,0BAA0B;YAC1C,MAAM;YACN,OAAO,EAAE,OAAO,IAAI,0BAA0B;YAC9C,cAAc;YACd,SAAS;YACT,eAAe;SAChB,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,2CAA2C,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO;gBACL,SAAS,EAAE,EAAE;gBACb,UAAU,EAAE,CAAC;gBACb,OAAO,EAAE,IAAI;gBACb,WAAW,EAAE,CAAC,+BAA+B,CAAC,cAAc,CAAC;aAC9D,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;YACL,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,CAAC;YACb,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;SACzD,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { adaptResearchPlanQuestionsResult, type ResearchPlanQuestionsInputShape } from "../execution-strategies/genericExecutionFuncxEnvelope.js";
2
+ export type ResearchPlanQuestionsFuncxInvokeContext = {
3
+ functionId: string;
4
+ payload: unknown;
5
+ };
6
+ /**
7
+ * Test-only override for FuncX `research/plan-questions` calls from {@link runPlanWebScopeQuestions} when `backend: "funcx"`.
8
+ */
9
+ export declare function setResearchPlanQuestionsFuncxInvoker(fn: ((ctx: ResearchPlanQuestionsFuncxInvokeContext) => Promise<unknown>) | null): void;
10
+ export declare function runResearchPlanQuestionsViaFuncx(params: {
11
+ input: ResearchPlanQuestionsInputShape;
12
+ jobId?: string;
13
+ taskId?: string;
14
+ agentId?: string;
15
+ funcxFunctionId?: string;
16
+ }): Promise<unknown>;
17
+ export declare function adaptFuncxResearchPlanToOutput(raw: unknown): ReturnType<typeof adaptResearchPlanQuestionsResult>;
18
+ //# sourceMappingURL=runResearchPlanQuestionsFuncx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runResearchPlanQuestionsFuncx.d.ts","sourceRoot":"","sources":["../../src/planWebScopeQuestions/runResearchPlanQuestionsFuncx.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gCAAgC,EAGhC,KAAK,+BAA+B,EACrC,MAAM,0DAA0D,CAAC;AAElE,MAAM,MAAM,uCAAuC,GAAG;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAIF;;GAEG;AACH,wBAAgB,oCAAoC,CAClD,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,uCAAuC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,GAC9E,IAAI,CAEN;AAgBD,wBAAsB,gCAAgC,CAAC,MAAM,EAAE;IAC7D,KAAK,EAAE,+BAA+B,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,OAAO,CAAC,CAgBnB;AAED,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,CAAC,OAAO,gCAAgC,CAAC,CAEhH"}
@@ -0,0 +1,42 @@
1
+ import { createClient } from "@x12i/funcx";
2
+ import { run } from "@x12i/funcx/functions";
3
+ import { FUNCX_RESEARCH_PLAN_QUESTIONS_FUNCTION_ID } from "../execution-strategies/constants.js";
4
+ import { adaptResearchPlanQuestionsResult, buildResearchPlanQuestionsPayload, unwrapFuncxRunValue, } from "../execution-strategies/genericExecutionFuncxEnvelope.js";
5
+ let injectedInvoker = null;
6
+ /**
7
+ * Test-only override for FuncX `research/plan-questions` calls from {@link runPlanWebScopeQuestions} when `backend: "funcx"`.
8
+ */
9
+ export function setResearchPlanQuestionsFuncxInvoker(fn) {
10
+ injectedInvoker = fn;
11
+ }
12
+ let cachedClient = null;
13
+ function defaultOpenRouterClient() {
14
+ if (!cachedClient) {
15
+ cachedClient = createClient({ backend: "openrouter" });
16
+ }
17
+ return cachedClient;
18
+ }
19
+ function pickFunctionId(explicit) {
20
+ if (typeof explicit === "string" && explicit.trim())
21
+ return explicit.trim();
22
+ return FUNCX_RESEARCH_PLAN_QUESTIONS_FUNCTION_ID;
23
+ }
24
+ export async function runResearchPlanQuestionsViaFuncx(params) {
25
+ const functionId = pickFunctionId(params.funcxFunctionId);
26
+ const payload = buildResearchPlanQuestionsPayload({
27
+ input: params.input,
28
+ jobId: params.jobId,
29
+ taskId: params.taskId,
30
+ agentId: params.agentId,
31
+ });
32
+ if (injectedInvoker) {
33
+ return injectedInvoker({ functionId, payload });
34
+ }
35
+ const client = defaultOpenRouterClient();
36
+ const raw = await run(functionId, payload, { client });
37
+ return unwrapFuncxRunValue(raw);
38
+ }
39
+ export function adaptFuncxResearchPlanToOutput(raw) {
40
+ return adaptResearchPlanQuestionsResult(raw);
41
+ }
42
+ //# sourceMappingURL=runResearchPlanQuestionsFuncx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runResearchPlanQuestionsF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E,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IACzC,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACvD,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,GAAY;IACzD,OAAO,gCAAgC,CAAC,GAAG,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Load audit POST step templates from disk. Base path = AUDIT_TEMPLATES_PATH or cwd/templates/post-steps/audit.
3
+ */
4
+ export type AuditTemplates = {
5
+ system: string;
6
+ user: string;
7
+ feedbackInjection: string;
8
+ synthesis: string;
9
+ };
10
+ export declare function loadAuditTemplates(): Promise<AuditTemplates>;
11
+ export declare function renderAuditSystem(template: string, data: {
12
+ customGuidelines?: string;
13
+ }): string;
14
+ export declare function renderAuditUser(template: string, data: {
15
+ originalInput: string;
16
+ promptContext: string;
17
+ candidateOutput: string;
18
+ mustChecks: {
19
+ check: string;
20
+ weight: number;
21
+ }[];
22
+ shouldChecks: {
23
+ check: string;
24
+ weight: number;
25
+ }[];
26
+ previousFeedback?: string;
27
+ previousCycle?: number;
28
+ }): string;
29
+ export declare function renderFeedbackInjection(template: string, data: {
30
+ cycle: number;
31
+ maxCycles: number;
32
+ failedChecks: {
33
+ kind: string;
34
+ check: string;
35
+ feedback: string;
36
+ }[];
37
+ overallFeedback: string;
38
+ }): string;
39
+ export declare function renderSynthesis(template: string, data: {
40
+ originalInput: string;
41
+ promptContext: string;
42
+ candidateA: {
43
+ cycle: number;
44
+ score: number;
45
+ output: string;
46
+ failedChecks: {
47
+ kind: string;
48
+ check: string;
49
+ feedback: string;
50
+ }[];
51
+ passedChecks: {
52
+ kind: string;
53
+ check: string;
54
+ }[];
55
+ };
56
+ candidateB: {
57
+ cycle: number;
58
+ score: number;
59
+ output: string;
60
+ failedChecks: {
61
+ kind: string;
62
+ check: string;
63
+ feedback: string;
64
+ }[];
65
+ passedChecks: {
66
+ kind: string;
67
+ check: string;
68
+ }[];
69
+ };
70
+ customSynthesisGuidelines?: string;
71
+ }): string;
72
+ //# sourceMappingURL=loadAuditTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadAuditTemplates.d.ts","sourceRoot":"","sources":["../../../src/post-steps/audit/loadAuditTemplates.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAMF,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,cAAc,CAAC,CA2BlE;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAG/F;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAChD,YAAY,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,CAGT;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAClE,eAAe,EAAE,MAAM,CAAC;CACzB,GAAG,MAAM,CAGT;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAAC,YAAY,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,CAAC;IACjL,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAAC,YAAY,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,CAAC;IACjL,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,GAAG,MAAM,CAGT"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Load audit POST step templates from disk. Base path = AUDIT_TEMPLATES_PATH or cwd/templates/post-steps/audit.
3
+ */
4
+ import { readFile } from "fs/promises";
5
+ import { join } from "path";
6
+ import Handlebars from "handlebars";
7
+ const DEFAULT_SYSTEM = `You are a strict quality auditor. Evaluate every check, output structured markdown with "### Checks" and "### Overall feedback" sections.`;
8
+ const DEFAULT_USER = `Original input: {{originalInput}}\n\nContext: {{promptContext}}\n\nCandidate: {{candidateOutput}}\n\nMust: {{mustChecks}}\nShould: {{shouldChecks}}`;
9
+ const DEFAULT_FEEDBACK = `## Audit Feedback (cycle {{cycle}} of {{maxCycles}})\n\n{{overallFeedback}}\n\nFailed: {{failedChecks}}`;
10
+ const DEFAULT_SYNTHESIS = `Merge the best of two candidates. Output only the merged task output.`;
11
+ function getBasePath() {
12
+ return process.env.AUDIT_TEMPLATES_PATH ?? process.cwd();
13
+ }
14
+ export async function loadAuditTemplates() {
15
+ const base = join(getBasePath(), "templates", "post-steps", "audit");
16
+ let system = DEFAULT_SYSTEM;
17
+ let user = DEFAULT_USER;
18
+ let feedbackInjection = DEFAULT_FEEDBACK;
19
+ let synthesis = DEFAULT_SYNTHESIS;
20
+ try {
21
+ system = await readFile(join(base, "system.md"), "utf-8");
22
+ }
23
+ catch {
24
+ /* use default */
25
+ }
26
+ try {
27
+ user = await readFile(join(base, "user.txt"), "utf-8");
28
+ }
29
+ catch {
30
+ /* use default */
31
+ }
32
+ try {
33
+ feedbackInjection = await readFile(join(base, "feedback-injection.md"), "utf-8");
34
+ }
35
+ catch {
36
+ /* use default */
37
+ }
38
+ try {
39
+ synthesis = await readFile(join(base, "synthesis.md"), "utf-8");
40
+ }
41
+ catch {
42
+ /* use default */
43
+ }
44
+ return { system, user, feedbackInjection, synthesis };
45
+ }
46
+ export function renderAuditSystem(template, data) {
47
+ const t = Handlebars.compile(template);
48
+ return t(data);
49
+ }
50
+ export function renderAuditUser(template, data) {
51
+ const t = Handlebars.compile(template);
52
+ return t(data);
53
+ }
54
+ export function renderFeedbackInjection(template, data) {
55
+ const t = Handlebars.compile(template);
56
+ return t(data);
57
+ }
58
+ export function renderSynthesis(template, data) {
59
+ const t = Handlebars.compile(template);
60
+ return t(data);
61
+ }
62
+ //# sourceMappingURL=loadAuditTemplates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadAuditTemplates.js","sourceRoot":"","sources":["../../../src/post-steps/audit/loadAuditTemplates.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,MAAM,cAAc,GAAG,2IAA2I,CAAC;AACnK,MAAM,YAAY,GAAG,qJAAqJ,CAAC;AAC3K,MAAM,gBAAgB,GAAG,yGAAyG,CAAC;AACnI,MAAM,iBAAiB,GAAG,uEAAuE,CAAC;AASlG,SAAS,WAAW;IAClB,OAAO,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;AAC3D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IACrE,IAAI,MAAM,GAAG,cAAc,CAAC;IAC5B,IAAI,IAAI,GAAG,YAAY,CAAC;IACxB,IAAI,iBAAiB,GAAG,gBAAgB,CAAC;IACzC,IAAI,SAAS,GAAG,iBAAiB,CAAC;IAClC,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAAC,MAAM,CAAC;QACP,iBAAiB;IACnB,CAAC;IACD,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,iBAAiB;IACnB,CAAC;IACD,IAAI,CAAC;QACH,iBAAiB,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,uBAAuB,CAAC,EAAE,OAAO,CAAC,CAAC;IACnF,CAAC;IAAC,MAAM,CAAC;QACP,iBAAiB;IACnB,CAAC;IACD,IAAI,CAAC;QACH,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAAC,MAAM,CAAC;QACP,iBAAiB;IACnB,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAgB,EAAE,IAAmC;IACrF,MAAM,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,IAQjD;IACC,MAAM,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,QAAgB,EAAE,IAKzD;IACC,MAAM,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,IAMjD;IACC,MAAM,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Parse audit LLM output (structured markdown / Flex-MD style) into AuditLLMOutput.
3
+ * Fallback: section-based markdown parser when Flex-MD is not used or parse fails.
4
+ */
5
+ import type { AuditLLMOutput } from "../../types/task-types.js";
6
+ /**
7
+ * Parse structured markdown from audit model into checks and overall feedback.
8
+ * Expects sections: "### Checks" with blocks of Check/Kind/Passed/Feedback, then "### Overall feedback".
9
+ */
10
+ export declare function parseAuditOutputFromMarkdown(text: string): AuditLLMOutput;
11
+ //# sourceMappingURL=parseAuditOutput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseAuditOutput.d.ts","sourceRoot":"","sources":["../../../src/post-steps/audit/parseAuditOutput.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAElF;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CA2CzE"}