@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,217 @@
1
+ # Bug report bundle: `@exellix/xynthesis` + `@exellix/ai-tasks` (synthesis / `runSynthesisCall`)
2
+
3
+ > **Superseded (xynthesis ≥ 3.6):** `runSynthesisCall` was removed upstream; ai-tasks now uses **`executeXynthesisAction`** (`ExecuteXynthesisActionRequest`). See [BREAKING-CHANGES.md](../BREAKING-CHANGES.md).
4
+
5
+ Use this document to open **GitHub issues** (xynthesis repo vs ai-tasks repo) or as an internal RCA. Each section is written so you can paste the **Issue** block into a tracker.
6
+
7
+ **Thread coverage (everything we discussed maps here):**
8
+
9
+ | Topic | Where |
10
+ |--------|--------|
11
+ | Failures: `flattenRunSynthesisCallRequest` / `systemPrompt` undefined; flat vs nested API | **§A** |
12
+ | Root cause: **ai-tasks** still used legacy flat `runSynthesisCall` args after xynthesis 3.5+ nested contract | **§A** |
13
+ | Why “synthesis” / **Xynthesis** naming and overload of `runSynthesisCall` | **§B** |
14
+ | “We don’t pass prompts—we pass catalog / skill refs” vs reality (resolution in ai-tasks today) | **§C** + **Target** |
15
+ | **Target API:** `actionId` + pre/post phase, **identity** object (not “workScope” as product term), **`config`** for model/tokens/timeout, **one** host entrypoint, xynthesis resolves content | **Target** (top) |
16
+ | E2E: **resolved model id** required | **§D** |
17
+ | Finalize warnings; **`missinngFields`** typo | **§E** |
18
+ | Activix owner, sidekick `trim`, required `jobId`/`taskId` types | **§F** → checklist |
19
+ | Paste-ready GitHub titles | Bottom list |
20
+
21
+ ---
22
+
23
+ ## Target: one clear AI-call contract (what we want vs what exists)
24
+
25
+ This section states the **intended** host-facing shape for “do an LLM hop through Xynthesis,” independent of today’s split between `runSynthesisCall`, sidekick gateway calls, and ai-tasks template resolution.
26
+
27
+ ### What we need (desired)
28
+
29
+ 1. **Single logical identifier for the step**
30
+ - Today you might think in terms of **`preActionId`** vs **`postActionId`**.
31
+ - **Unify** to one field, e.g. **`actionId`**, plus an explicit **phase**: **`"pre" | "post"`** (or an enum).
32
+ - Xynthesis (or a thin resolver next to it) uses **`actionId` + `phase`** to know **which catalog row / template bundle / evaluator** applies—**not** the caller shipping full system/user prompt text as the primary input.
33
+
34
+ 2. **Runtime identity is not “workScope” in product language**
35
+ - Callers pass one **`identityObject`** (or keep the name **`identity`**): the **runtime correlation / run-context** object (session, job, task, agent, correlation ids, skill linkage—whatever the pipeline already carries).
36
+ - **Internally**, Activix / gateway may still map subsets of this to `jobId` / `taskId` / `runContext`; that is an **implementation detail**. The **public** story should be: “here is the **identity object** for this call,” not “here is workScope” as the mental model for product engineers.
37
+
38
+ 3. **All LLM knobs live under `config`**
39
+ - **`model`**, **`maxTokens`** (and caps), **`timeoutMs`**, **`maxOutputLength`**, **`temperature`**, **`topP`**, **`outputExpectation`**, etc. should be grouped in a single **`config`** object on the request, not scattered as top-level siblings mixed with identity and action selection.
40
+
41
+ 4. **One primary entrypoint for “AI calls” from hosts**
42
+ - However many modules exist inside `@exellix/xynthesis` today, **hosts (e.g. ai-tasks) should converge on one documented function** for: *given **action** + **phase** + **identity** + **config**, resolve prompts from the registry and invoke the gateway.*
43
+ - Optional escape hatch: **`overrides.prompts`** only for tests or extraordinary cases—not the default path.
44
+
45
+ **Illustrative target shape (conceptual TypeScript, not implemented):**
46
+
47
+ ```ts
48
+ runXynthesisAiAction({
49
+ actionId: string; // catalog / strategy id for this pre or post step
50
+ actionPhase: "pre" | "post";
51
+ identity: IdentityObject; // full runtime correlation object (see above)
52
+ config: {
53
+ model?: string;
54
+ maxTokens?: number;
55
+ timeoutMs?: number;
56
+ maxOutputLength?: number;
57
+ temperature?: number;
58
+ topP?: number;
59
+ outputExpectation?: OutputExpectation;
60
+ // …
61
+ };
62
+ /** Optional: variables merged into resolved templates (record, web snippets, etc.) */
63
+ templateContext?: Record<string, unknown>;
64
+ /** Optional: gateway wire ids if not derived from `identity` */
65
+ gateway?: Partial<SynthesisCallGatewayContext>;
66
+ });
67
+ ```
68
+
69
+ Xynthesis (or a dedicated resolver it calls) is responsible for: **`(actionId, actionPhase)` → load template / instructions → build prompts → call invoker** using **`config`** and **`identity`** for logging and gateway requests.
70
+
71
+ ### What we have today (reality)
72
+
73
+ | Area | Today |
74
+ |------|--------|
75
+ | **Entrypoints** | Multiple: **`runSynthesisCall`**, **`runSidekickGatewayCall`**, **`runStructuredSynthesisGatewayCall`**, finalize/repair paths, etc. Hosts must learn several shapes. |
76
+ | **Prompt source** | **Callers often materialize** `systemPrompt` / `userPrompt` (or `renderedInstructions` / `renderedPrompt`) **before** Xynthesis. Catalog/skill resolution for ai-tasks lives largely in **ai-tasks** (`skillKey`, `resolveRawTemplate`, `getRenderedTemplates`), not behind a single **`actionId`** API in Xynthesis. |
77
+ | **Identity** | **`workScope`** + **`gateway`** on `RunSynthesisCallRequest`: `workScope.jobId` / `taskId` / optional `identity`, plus separate **`gateway`** `{ aiRequestId, agentId, sessionId, temperature }`. Product-wise this splits “who/where” across two buckets. |
78
+ | **Config** | **`model`**, **`timeoutMs`**, **`maxTokens`**, **`maxOutputLength`**, **`topP`**, **`outputExpectation`** are **top-level** fields on `RunSynthesisCallRequest` (and duplicated patterns elsewhere)—not grouped under a single **`config`**. |
79
+ | **Pre vs post** | Expressed indirectly (different code paths, step types, env prefixes like `SYNTHESIS` vs `POST_STEP_*`), not as **`actionId` + `actionPhase`**. |
80
+
81
+ ### What we need to do (gap closure)
82
+
83
+ | Step | Owner | Note |
84
+ |------|--------|------|
85
+ | Specify **catalog binding**: how **`actionId`** maps to rows (Catalox catalog id? strategy key? composite key including app id). | Architecture | Without this, Xynthesis cannot “know where to look.” |
86
+ | Either **implement resolution inside Xynthesis** or **define a single resolver interface** (injected) that Xynthesis calls so the **host does not pass raw prompts** on the default path. | Xynthesis (+ ai-tasks) | Pure ai-tasks-only resolver preserves one package boundary but does not unify “one Xynthesis entry” unless Xynthesis exports the façade. |
87
+ | Introduce **`runXynthesisAiAction`** (name TBD) that maps internally to today’s invoker + Activix, and **deprecate** scattered public shapes over time. | Xynthesis | Reduces host cognitive load; internal adapter can build `RunSynthesisCallRequest` for a transition period. |
88
+ | Refactor **ai-tasks** to pass **`actionId` + `actionPhase` + `identity` + `config`** into that façade; keep **`skillKey`** and pipeline context on **`identity`** or **`templateContext`** as needed. | ai-tasks | Aligns runtime with this document. |
89
+ | Document that **`workScope`** in low-level types is the **wire/Activix projection** of **`identity`**, not the product name for the object. | Docs | Reduces “it isn’t workScope” confusion. |
90
+
91
+ ### Feasible ways to get there (short list)
92
+
93
+ 1. **Facade in Xynthesis (preferred for “one thing”)** — New API resolves **`actionId` + `phase`** via Catalox/skills client injected at init; builds prompts; calls existing invoker. Legacy APIs remain as `@deprecated` wrappers.
94
+ 2. **Facade in ai-tasks only** — Faster locally, but **does not** give “Xynthesis knows where to look” as a package guarantee; Xynthesis stays low-level.
95
+ 3. **Hybrid** — Xynthesis exports the unified **`runXynthesisAiAction`** signature; default implementation delegates template fetch to a callback registered by ai-tasks (inversion of control), still one host call site.
96
+
97
+ ---
98
+
99
+ ## A. What is the *actual* `runSynthesisCall` API? (not the flat shape)
100
+
101
+ **Answer for engineers:** The **only** supported input type is `RunSynthesisCallRequest` — **nested** `gateway`, `prompts`, and `workScope`. The package’s own `.d.ts` states: *“This is the only supported input shape for `runSynthesisCall`.”*
102
+
103
+ **Correct shape (conceptual):**
104
+
105
+ ```ts
106
+ runSynthesisCall({
107
+ gateway: {
108
+ aiRequestId: string,
109
+ agentId: string,
110
+ sessionId: string,
111
+ temperature: number,
112
+ },
113
+ prompts: {
114
+ systemPrompt: string,
115
+ userPrompt: string,
116
+ },
117
+ workScope: {
118
+ jobId: string,
119
+ taskId: string,
120
+ identity?: ActivityRunContext,
121
+ },
122
+ model?: string | OpenRouterModel | ModelPick,
123
+ timeoutMs?: number,
124
+ maxTokens?: number,
125
+ // …see `RunSynthesisCallRequest` in `@exellix/xynthesis`
126
+ });
127
+ ```
128
+
129
+ **Legacy / wrong shape (still seen in some consumers):**
130
+
131
+ ```ts
132
+ // NOT supported — was never the typed public contract after the nested migration
133
+ runSynthesisCall({
134
+ systemPrompt,
135
+ userPrompt,
136
+ jobId,
137
+ taskId,
138
+ agentId,
139
+ ...
140
+ });
141
+ ```
142
+
143
+ Passing the flat object makes `flattenRunSynthesisCallRequest` read `r.prompts.systemPrompt` when `prompts` is missing → **`TypeError: Cannot read properties of undefined (reading 'systemPrompt')`**.
144
+
145
+ **Where this showed up:** ai-tasks **`npm test`** — multiple failures under **`intermediateSteps`** (and any path using **`runPostStepLlmCall`** → **`runSynthesisCall`**) with that stack trace; not a bug in “reading templates” inside xynthesis flatten—it is **missing `prompts` on the request object**.
146
+
147
+ | Repo | Issue type | Action |
148
+ |------------|------------|--------|
149
+ | **ai-tasks** | Defect | Migrate all `runSynthesisCall` call sites to `RunSynthesisCallRequest` (e.g. `runPostStepLlmCall.ts`). |
150
+ | **xynthesis** | DX / compat (optional) | At runtime, detect flat legacy objects and either adapt or throw a **single clear error** (“use `prompts` + `workScope` + `gateway`”). |
151
+
152
+ ---
153
+
154
+ ## B. Why is it called *synthesis* (and the package *Xynthesis*)?
155
+
156
+ - **English domain term:** In this product line, “synthesis” means **combining multiple sources** (Narrix, memory, web evidence, templates) into a **unified context** before or alongside LLM steps. The Greek root is σύνθεσις → English **synthesis** (standard spelling: **s-y-n-t-h-e-s-i-s**).
157
+ - **Package name `xynthesis`:** Branding (leading **X**) on the same concept; it is not a different technical term.
158
+ - **Naming overload (real confusion):** `runSynthesisCall` is also used for **any** single completion that goes through the same invoker path (e.g. audit / polish / question-driven PRE calls in ai-tasks). So the name reads like “only context synthesis,” but operationally it is **“one gateway-backed LLM completion with synthesis-style telemetry/config.”** That overload is a **documentation and API naming** problem, not a typo.
159
+
160
+ **Suggested upstream issue (xynthesis):** Document in JSDoc that `runSynthesisCall` is the **generic single-hop LLM invoke** for the package; optionally alias or document `runGatewayLlmCall` / similar in a future major if you want clearer vocabulary.
161
+
162
+ ---
163
+
164
+ ## C. Product expectation: “catalog id only, never materialized prompts”
165
+
166
+ **Observation:** `@exellix/xynthesis` does **not** expose a first-class API of the form “Catalox catalog id + row id → fetch template → invoke.” Template/skill resolution for **ai-tasks** happens **before** xynthesis (e.g. `skillKey`, `resolveRawTemplate`, `getRenderedTemplates`), then **materialized** `systemPrompt` / `userPrompt` (or sidekick `renderedInstructions` / `renderedPrompt`) are passed in.
167
+
168
+ **This is architectural layering**, not necessarily a bug—unless the product mandate is that **no** layer below the catalog resolver may accept prompt strings. If that mandate is firm:
169
+
170
+ | Repo | Issue |
171
+ |------------|--------|
172
+ | **xynthesis** (feature) | Optional higher-level entry: accept **skill/catalog handles** and delegate resolution (or document explicitly that resolution is **out of scope**). |
173
+ | **ai-tasks** (docs) | State clearly: “xynthesis executes; ai-tasks + skills resolve templates.” |
174
+
175
+ ---
176
+
177
+ ## D. Resolved model id required (`runSynthesisCall requires a resolved model id`)
178
+
179
+ **Symptom:** E2E / real gateway tests fail with
180
+ `Error: runSynthesisCall requires a resolved model id (set model on the request or use a strategy pick that maps to a concrete model).`
181
+
182
+ **Classification:** Expected when **`model`** is omitted and no strategy/env resolves one. Fix is **callers/tests/env** (`SYNTHESIS_MODEL`, `LLM_MODEL_*`, or explicit `model` on the request), unless xynthesis intentionally guarantees a default (today it does not).
183
+
184
+ | Repo | Action |
185
+ |----------|--------|
186
+ | **ai-tasks** | Ensure E2E sets a resolvable model when the test is not skipped. |
187
+ | **xynthesis** (DX) | Optionally document default resolution order in one place. |
188
+
189
+ ---
190
+
191
+ ## E. Finalize / work-scope warnings and log typo
192
+
193
+ **Symptom:** Warnings such as missing `jobId` / `taskId` on `runXynthesisFinalize` when test payloads omit work scope.
194
+
195
+ **Symptom:** Log field typo **`missinngFields`** (double **n**) in warning payloads — hurts grep and professionalism.
196
+
197
+ | Repo | Action |
198
+ |------------|--------|
199
+ | **xynthesis** | Fix typo `missinngFields` → `missingFields` (consider backward compat if anything parses logs). |
200
+ | **ai-tasks / tests** | Pass `jobId` / `taskId` into finalize in tests where the contract requires them. |
201
+
202
+ ---
203
+
204
+ ## F. Related items already tracked in-repo
205
+
206
+ See [`xynthesis-upstream-fixes-checklist.md`](./xynthesis-upstream-fixes-checklist.md) for Activix `diagnostics.owner`, `runSidekickGatewayCall` `.trim()` on undefined ids, and TypeScript required `jobId`/`taskId` on structured params.
207
+
208
+ ---
209
+
210
+ ## Paste-ready issue titles (suggested)
211
+
212
+ 1. **xynthesis:** `runSynthesisCall`: validate request shape / deprecate flat args with clear error (avoid `TypeError` on `prompts.systemPrompt`).
213
+ 2. **xynthesis:** Document that `runSynthesisCall` is the generic single-hop LLM API; clarify “synthesis” vs audit/polish use cases.
214
+ 3. **xynthesis:** Fix typo `missinngFields` in finalize / warning metadata.
215
+ 4. **ai-tasks:** Migrate `runPostStepLlmCall` (and any other callers) to `RunSynthesisCallRequest` + full `SynthesisCallGatewayContext`.
216
+ 5. **ai-tasks:** E2E synthesis: require resolvable `model` or skip with explicit reason (align with env docs).
217
+ 6. **xynthesis (+ ai-tasks):** Design and implement a **single host-facing LLM entry** (`actionId` + `pre`/`post` phase, **`identity` object**, **`config`** blob, resolver for catalog content); deprecate multiple parallel public shapes over time.
@@ -0,0 +1,123 @@
1
+ # Core Token and Strategies
2
+
3
+ This document explains two "core" topics in `@exellix/ai-tasks`:
4
+
5
+ 1. Token-related fields and behavior in the task runtime.
6
+ 2. Execution strategy behavior (legacy strategy layer and current core path).
7
+
8
+ ## 1) Core token behavior
9
+
10
+ In this codebase, token-related behavior appears in three practical places:
11
+
12
+ - **Template tokens** (`templateTokens`) for prompt rendering overlays.
13
+ - **AI scoping tokens** (`aiScoped[].token`) for scoped enrichment labels.
14
+ - **Model usage** metadata on third-party responses where applicable (observability only; not used for strategy selection).
15
+
16
+ ### 1.1 Template tokens (`templateTokens`)
17
+
18
+ `RunTaskRequest` supports `templateTokens` and `templateRenderOptions` and passes them downstream to skill execution.
19
+
20
+ - Purpose: override/overlay render-time template values for a single invoke.
21
+ - Scope: per `runTask` call.
22
+ - Precedence: intended as top-priority overlay during template rendering (gateway side).
23
+
24
+ Related request fields:
25
+
26
+ - `templateRenderOptions`
27
+ - `templateTokens`
28
+
29
+ Where it matters:
30
+
31
+ - `runTask` builds `enrichedInput` and forwards request fields to executor.
32
+ - DIRECT execution ultimately calls skills/gateway path where templates are rendered.
33
+
34
+ ### 1.2 AI scoping tokens (`aiScoped[].token`)
35
+
36
+ When `input.aiScoping` is present, `runTask` executes AI scoping and injects results into task input:
37
+
38
+ - Field injected into input: `input.aiScoped`
39
+ - Shape: array of `{ token, scopedInfo }`
40
+ - Meaning:
41
+ - `token`: label/key for a scoped target
42
+ - `scopedInfo`: generated scoped context text
43
+
44
+ This is token-like labeling for downstream prompts/logic, not provider token counting.
45
+
46
+ ## 2) Core execution path vs strategy layer
47
+
48
+ There are two layers in the repo:
49
+
50
+ - **Core runtime path** in `src/core/task-sdk.ts` (canonical behavior).
51
+ - **Strategy abstraction** in `src/strategies/*` (factory + direct strategy).
52
+
53
+ ### 2.1 Canonical runtime branch logic (current behavior)
54
+
55
+ `WorexClientTasks.runTask()` in `src/core/task-sdk.ts` is the primary orchestrator:
56
+
57
+ 1. Early **`resolveRunTaskRuntimeKnobs`**: `narrixMode` (`off` \| `preprocessor` \| `handler`), `inputStrategyKey` (defaults `no-narrative`, not inferred from Narrix), and validated **`executionStrategies`** (required array; `[]` = plain MAIN).
58
+ 2. Optional Narrix **preprocessor** when `narrixMode === "preprocessor"` and `request.narrix` (record path + optional web scope after Narrix).
59
+ 3. Optional structured Narrix **handler** when `narrixMode === "handler"` (set explicitly, or inferred when only `narrixInput` is present without `request.narrix`).
60
+ 4. Local task short-circuit (`getLocalTask(skillKey)`).
61
+ 5. Optional `executionPipeline` (**PRE** Xynthesis steps → **MAIN** → **POST**). PRE receives the post–Narrix / post–web request state.
62
+ 6. MAIN execution via **`runMainWithExecutionStrategies`**: optional FuncX **planner** chain (once each, sorted by `priority`), then **`runDirect`** / `_executeDirect`; optional **optimizer** loop retries MAIN until satisfied or `maxIterations`.
63
+
64
+ This is the main production flow for memory enrichment, context generation, ai scoping, and executor invocation.
65
+
66
+ ### 2.2 Strategy abstraction (`src/strategies`)
67
+
68
+ The strategy layer defines an extensible interface:
69
+
70
+ - `IExecutionStrategy`:
71
+ - `execute(request)`
72
+ - `getType()`
73
+ - `canHandle(request)`
74
+
75
+ `ExecutionStrategyFactory` currently:
76
+
77
+ - Registers the direct strategy under the ai-skills `ExecutionType.DIRECT` key.
78
+ - Picks the first strategy whose `canHandle(request)` is true (today: when `executionStrategies` is an array — convenience **`executeDirect`** passes `[]`).
79
+
80
+ `DirectExecutionStrategy` currently:
81
+
82
+ - Sets `executionType: DIRECT` on the **`RunSkillRequest`** sent to ai-skills.
83
+ - Converts `RunTaskRequest` to `RunSkillRequest` shape.
84
+ - Calls `skillsClient.runSkill()`.
85
+
86
+ ## 3) How strategy and core fields interact
87
+
88
+ ### 3.1 `executionStrategies`
89
+
90
+ - **Required** array on **`RunTaskRequest`**: **`planner`** rows (`phase: "before"`) and **`optimizer`** rows (`phase: "after"`), each with **`priority`**. **`[]`** means plain MAIN (no FuncX wrappers).
91
+ - Resolved and sorted in **`resolveExecutionStrategies`** (called from **`resolveRunTaskRuntimeKnobs`**).
92
+
93
+ ### 3.2 `executionPipeline`
94
+
95
+ - Preferred orchestration path when provided.
96
+ - Requires exactly one MAIN step.
97
+ - PRE supports `synthesized-context`.
98
+ - POST supports `audit` and `polish`.
99
+
100
+ ### 3.3 `coreSkillId`
101
+
102
+ `coreSkillId` is a graph/runtime identity field (node identity mapping), not a token field.
103
+
104
+ - In direct strategy helper, it may map to `skillId` for skills compatibility.
105
+ - In core runtime, identity fields (`graphId`, `nodeId`, `coreSkillId`, etc.) are passed for tracking/context.
106
+
107
+ ## 4) Practical guidance
108
+
109
+ - Use `templateTokens` when you need per-invocation template overrides.
110
+ - Use `aiScoping` when you need scoped context fragments (`aiScoped[].token`/`scopedInfo`).
111
+ - Prefer `executionPipeline` for multi-step flows.
112
+ - Use `narrixMode` + `narrixInput` / `narrix` instead of any legacy execution-type label on `RunTaskRequest`.
113
+ - Treat strategy classes as extension points; treat `task-sdk.ts` as canonical behavior source.
114
+
115
+ ## 5) Related files
116
+
117
+ - `src/core/task-sdk.ts`
118
+ - `src/types/task-types.ts`
119
+ - `src/strategies/execution-strategy.interface.ts`
120
+ - `src/strategies/strategy-factory.ts`
121
+ - `src/strategies/direct-execution-strategy.ts`
122
+ - `src/methods/convenience-methods.ts`
123
+ - `src/execution-strategies/*`
@@ -0,0 +1,48 @@
1
+ # Downstream Environment
2
+
3
+ This appendix summarizes env ownership between `@exellix/ai-tasks` and downstream layers.
4
+
5
+ ## Env read directly by ai-tasks
6
+
7
+ Common examples used directly in this package:
8
+
9
+ - `MONGO_LOGS_DB`
10
+ - `SYNTHESIS_MODEL`
11
+ - `SYNTHESIS_TIMEOUT_MS`
12
+ - `SYNTHESIS_MAX_OUTPUT_LENGTH`
13
+ - `SYNTHESIS_TEMPLATES_PATH`
14
+ - `POST_STEP_MODEL`
15
+ - `POST_STEP_TIMEOUT_MS`
16
+ - `AUDIT_*` and `POLISH_*` post-step settings
17
+ - `USE_NARRIX_INGEST`
18
+ - `NARRIX_DEBUG`
19
+ - `TAVILY_API_KEY`
20
+ - `WEB_CONTEXT_MARKDOWN_MAX_CHARS`
21
+ - `ACTIVIX_*`
22
+
23
+ ## Env used downstream (via ai-skills/gateway/providers)
24
+
25
+ Examples typically consumed by downstream services/libraries:
26
+
27
+ - `OPENAI_API_KEY`, `GROK_API_KEY`
28
+ - `OPEN_ROUTER_KEY` / `OPENROUTER_API_KEY`
29
+
30
+ ## Xynthesis / Mongo / Activix
31
+
32
+ - Telemetry and registry requirements: [`xynthesis-activix-telemetry.md`](./xynthesis-activix-telemetry.md)
33
+ - **Upstream fix and test checklist** (xynthesis repo): [`xynthesis-upstream-fixes-checklist.md`](./xynthesis-upstream-fixes-checklist.md)
34
+
35
+ Other downstream examples:
36
+
37
+ - `GITHUB_TOKEN`, `GITHUB_REPO_URL`
38
+ - Mongo collection-level activity settings from tracking libs
39
+
40
+ ## Practical rule
41
+
42
+ - Configure provider/content env vars for downstream execution.
43
+ - Configure ai-tasks env vars for orchestration behavior (synthesis, post-steps, Narrix/web scope, activity tracking).
44
+
45
+ ## Related appendices
46
+
47
+ - `documenations/web-scoping-in-ai-tasks.md`
48
+ - `documenations/activix.md`
@@ -0,0 +1,73 @@
1
+ # Downstream Fix: Test/Runtime Teardown Cleanup (Open Handles)
2
+
3
+ ## Summary
4
+
5
+ `@exellix/ai-tasks` feature behavior is working, but test/runtime process shutdown can be noisy or slow because downstream services may keep active handles after assertions complete.
6
+
7
+ This is a **downstream lifecycle hygiene** issue (primarily in `@woroces/ai-skills` initialization/teardown), not a blocker for template core discovery functionality.
8
+
9
+ ## Observed Behavior
10
+
11
+ - Functional tests pass assertions.
12
+ - Node process can keep running longer than expected due to active resources.
13
+ - Typical symptoms include long tail logs after tests are "done" and occasional CI timeout/hang patterns.
14
+
15
+ ## Likely Active Handles
16
+
17
+ - MongoDB client pools/connections.
18
+ - Activity tracking pipelines (Xronox/logging managers).
19
+ - Timers/retry loops/background intervals.
20
+ - Stream/event listeners that are never removed.
21
+
22
+ ## Why This Matters
23
+
24
+ - Slower local feedback loops.
25
+ - Flaky CI behavior (non-deterministic process exit).
26
+ - Harder diagnosis when real failures are mixed with lifecycle noise.
27
+
28
+ ## Downstream Fix Scope (`@woroces/ai-skills`)
29
+
30
+ ## 1) Add explicit shutdown API
31
+
32
+ Expose a deterministic cleanup method (name may vary), for example:
33
+
34
+ - `await skillsClient.shutdown()`
35
+
36
+ Expected responsibilities:
37
+
38
+ - close DB clients and pools
39
+ - stop timers/intervals/retries
40
+ - flush/close activity/log pipelines
41
+ - detach listeners/subscriptions
42
+
43
+ ## 2) Ensure idempotent cleanup
44
+
45
+ - Calling shutdown multiple times should be safe.
46
+ - Partial initialization should still allow shutdown without throwing.
47
+
48
+ ## 3) Add test-mode guardrails
49
+
50
+ Provide config/env to avoid starting long-lived infra in unit tests when not required.
51
+
52
+ Examples:
53
+
54
+ - disable activity tracking in unit tests
55
+ - disable external telemetry transports
56
+ - lazy-init only when actually needed
57
+
58
+ ## 4) Wire teardown in test harness
59
+
60
+ In integration/e2e tests that instantiate `WorecesSkillsClient`, ensure `after/afterEach` invokes cleanup.
61
+
62
+ ## Acceptance Criteria
63
+
64
+ 1. Test suites complete and process exits without manual interruption.
65
+ 2. No lingering DB/activity logs after final test summary.
66
+ 3. Repeated test runs do not increase leaked handles.
67
+ 4. CI job runtime is stable and no timeout due to open handles.
68
+
69
+ ## Notes for `@exellix/ai-tasks`
70
+
71
+ - No additional feature-level change is required for template core discovery.
72
+ - This document is tracked as downstream operational hardening only.
73
+
@@ -0,0 +1,170 @@
1
+ {
2
+ "skillKey": "skills/compliance/vendor-risk-quarterly-review",
3
+ "executionStrategies": [],
4
+ "executionPipeline": [
5
+ {
6
+ "phase": "pre",
7
+ "type": "synthesized-context",
8
+ "config": {
9
+ "contextSourcePolicy": "narrix-web-memory",
10
+ "synthesisInputStrategy": "policy",
11
+ "synthesisMode": "markdown",
12
+ "modelConfig": {
13
+ "model": "gpt-5-nano",
14
+ "temperature": 0.2
15
+ },
16
+ "timeoutMs": 45000,
17
+ "maxOutputLength": 12000,
18
+ "webEvidence": {
19
+ "preferCleanContent": true,
20
+ "maxSources": 5,
21
+ "dedupeByUrl": true,
22
+ "maxTotalChars": 24000
23
+ },
24
+ "customSynthesizingGuidelines": "Prefer cited facts from local memory and Narrix signals; treat web snippets as supporting only. Flag contradictions explicitly.",
25
+ "fallbackToDirect": false
26
+ }
27
+ },
28
+ {
29
+ "phase": "main",
30
+ "type": "direct"
31
+ }
32
+ ],
33
+ "includeContextInPrompt": true,
34
+ "jobId": "job_01k6f9a2b3c4d5e6f7g8h9i0",
35
+ "agentId": "agent_graph_runner_prod_east",
36
+ "graphId": "wf_vendor_due_diligence_v3",
37
+ "nodeId": "node_synthesis_gate_14",
38
+ "prevNodeId": "node_entity_resolver_13",
39
+ "coreSkillId": "skills/compliance/vendor-risk-quarterly-review",
40
+ "masterSkillId": "skills/compliance/vendor-due-diligence-pack",
41
+ "masterSkillActivityId": "act_8r2m1n0p9q8r7s6t",
42
+ "identity": {
43
+ "tenantId": "org_acme_security",
44
+ "workspaceId": "ws_governance_na",
45
+ "runPurpose": "quarterly_vendor_reassessment",
46
+ "requestedBy": "governance-console",
47
+ "correlationHint": "tkt-44821"
48
+ },
49
+ "variables": {
50
+ "reviewQuarter": "2026-Q1",
51
+ "priority": "P2",
52
+ "locale": "en-US"
53
+ },
54
+ "jobContext": {
55
+ "engagementCode": "VDR-2026-0142",
56
+ "policyPackVersion": "2025.12.1"
57
+ },
58
+ "input": {
59
+ "question": "Given current signals and open web mentions, should we escalate Acme Analytics from monitored to conditional approval for PHI-adjacent workloads?",
60
+ "vendorLegalName": "Acme Analytics LLC",
61
+ "vendorDuns": "123456789",
62
+ "dataClassificationsHandled": ["PHI", "PII"],
63
+ "deadlineIso": "2026-04-02T17:00:00.000Z"
64
+ },
65
+ "jobMemory": {
66
+ "engagement": {
67
+ "id": "VDR-2026-0142",
68
+ "openedAt": "2026-01-08T14:22:11.000Z",
69
+ "ownerTeam": "third_party_risk"
70
+ },
71
+ "vendorProfile": {
72
+ "displayName": "Acme Analytics",
73
+ "headquarters": "Austin, TX",
74
+ "lastAssessmentScore": 78,
75
+ "openFindingsCount": 3
76
+ },
77
+ "rawSummary": "Prior assessment (2025-Q4): SOC 2 Type II in scope; two medium findings on access reviews; one low on logging retention. Business sponsor: RevOps. Data flows: product analytics only — new request adds de-identified healthcare cohort exports (BA under review).",
78
+ "controlsMatrix": {
79
+ "encryptionAtRest": "AES-256-GCM",
80
+ "encryptionInTransit": "TLS1.2+",
81
+ "mfaAdminConsole": true,
82
+ "customerManagedKeys": false
83
+ }
84
+ },
85
+ "taskMemory": {
86
+ "previousFindings": [
87
+ {
88
+ "id": "fnd_91a",
89
+ "severity": "medium",
90
+ "title": "Quarterly access review evidence lagged 12 days"
91
+ }
92
+ ],
93
+ "narrix": [
94
+ {
95
+ "entity": {
96
+ "entityKind": "vendor",
97
+ "entityKey": "vendor_acme_analytics_llc"
98
+ },
99
+ "signals": [
100
+ {
101
+ "code": "SUBPROCESSOR_COUNT_DELTA",
102
+ "severity": "medium",
103
+ "observedAt": "2026-03-18T09:41:00.000Z",
104
+ "detail": "Net +2 subprocessors in last 60 days vs prior baseline."
105
+ },
106
+ {
107
+ "code": "INCIDENT_PUBLIC_MENTION",
108
+ "severity": "low",
109
+ "observedAt": "2026-03-21T16:05:00.000Z",
110
+ "detail": "Industry forum thread references a regional outage; vendor status page shows maintenance, not breach."
111
+ }
112
+ ],
113
+ "stories": [
114
+ {
115
+ "narrativeTypeId": "vendor-risk-summary",
116
+ "summary": "Overall posture stable; watch subprocessor churn and new data use cases touching regulated data."
117
+ }
118
+ ],
119
+ "meta": {
120
+ "datasetId": "vendor_risk_graph_prod",
121
+ "packVersion": "2026.03.0"
122
+ }
123
+ }
124
+ ]
125
+ },
126
+ "executionMemory": {
127
+ "bindingDefaultsDb": "logs-db",
128
+ "runAttempt": 1,
129
+ "priorStepOutputs": {
130
+ "entityResolution": {
131
+ "canonicalVendorId": "vendor_acme_analytics_llc",
132
+ "confidence": 0.94
133
+ }
134
+ },
135
+ "webContext": {
136
+ "available": true,
137
+ "context": {
138
+ "summary": "Recent public pages emphasize enterprise SLA tiers and a March 2026 maintenance window; no regulator or breach disclosures located in the retrieved set.",
139
+ "findings": [
140
+ "Vendor status blog documents planned DB failover practice on 2026-03-22.",
141
+ "Help center article states HIPAA BAA available for enterprise tier — pricing not public."
142
+ ],
143
+ "sources": [
144
+ {
145
+ "url": "https://status.acmeanalytics.example/incidents/2026-03-maintenance",
146
+ "title": "Scheduled maintenance — US-East analytics cluster",
147
+ "snippet": "Customers may see up to 15 minutes of read-only mode during failover rehearsal.",
148
+ "content": "Full maintenance notice: failover rehearsal for analytics cluster us-east-1. Read-only window expected 02:00–02:15 UTC. No customer data migration."
149
+ },
150
+ {
151
+ "url": "https://trust.acmeanalytics.example/compliance",
152
+ "title": "Trust & compliance overview",
153
+ "snippet": "SOC 2 Type II, HIPAA BAA for eligible contracts, subprocessors listed in annex C.",
154
+ "content": "We maintain SOC 2 Type II. HIPAA BAA is offered for enterprise agreements where regulated data is in scope. Subprocessor list updated monthly."
155
+ },
156
+ {
157
+ "url": "https://community.secforum.example/t/acme-analytics-outage-march-21/88421",
158
+ "title": "Thread: Acme Analytics latency spike",
159
+ "snippet": "Several users reported elevated latency; vendor attributed to maintenance overlap.",
160
+ "content": "Discussion thread — anecdotal reports only; links back to vendor status page for official narrative."
161
+ }
162
+ ]
163
+ }
164
+ }
165
+ },
166
+ "modelConfig": {
167
+ "model": "gpt-5.1",
168
+ "temperature": 0.1
169
+ }
170
+ }