@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,369 @@
1
+ # RunTask request contract (`@exellix/ai-tasks`)
2
+
3
+ Normative wire/SDK shape for `WorexClientTasks.runTask()` and the `runTask()` function wrapper.
4
+ There is **no HTTP server** in this package: hosts (e.g. graph-engine) must forward JSON equivalent to this contract into the SDK or executor.
5
+
6
+ **Related artifacts**
7
+
8
+ - Types: `RunTaskRequest` in [`src/types/task-types.ts`](src/types/task-types.ts) (extends `RunSkillRequest` from `@exellix/ai-skills`).
9
+ - Template merge: [`mergeSkillTemplateVariables`](src/utils/skillTemplateVariables.ts).
10
+ - Optional warnings / pipeline hints: [`normalizeRunTaskRequest`, `collectRunTaskRequestWarnings`, …](src/utils/runTaskRequestShape.ts) (`normalizeRunTaskRequest` is a shallow clone; no legacy field folding).
11
+ - Hard validation: [`assertRequiredRunSkillCorrelation`](src/utils/assertRequiredRunSkillCorrelation.ts) runs at the start of every `runTask()` (throws if `agentId` / `jobTypeId` / `taskTypeId` are missing or blank).
12
+ - **Execution strategies:** validation in [`resolveExecutionStrategies`](src/execution-strategies/resolveExecutionStrategies.ts); FuncX integration [`runFuncxExecutionStrategy`](src/execution-strategies/runFuncxExecutionStrategy.ts). **FR / function contracts:** [`documenations/funcx-scoping-integration-gaps.md`](documenations/funcx-scoping-integration-gaps.md) §**6**. **Catalog / hosting** so `run()` resolves `execution/plan` etc.: [`documenations/funcx-catalog-hosting-checklist.md`](documenations/funcx-catalog-hosting-checklist.md).
13
+ - JSON Schema fragment: [`documenations/schemas/v1/run-task-request.json`](documenations/schemas/v1/run-task-request.json).
14
+ - Graph authoring vs this payload: [Graph task node (authoring) → `RunTaskRequest` (invoke)](#graph-task-node-authoring--runtaskrequest-invoke).
15
+ - Orchestrator / other repos (dated tasks): [.docs/investigation/external-packages-assignments.md](.docs/investigation/external-packages-assignments.md).
16
+
17
+ ---
18
+
19
+ ## Deprecation policy
20
+
21
+ - **`RunTaskRequest` v7** aligns with the closed JSON Schema: **no** root `question`, top-level `inputs`, `jobInput`, or `executionType` — hosts must compile authoring into `input`, `variables`, `jobContext`, `narrixMode` / `narrixInput`, **`executionStrategies`** (required array), and `executionPipeline` / strategy keys.
22
+ - Set **`AI_TASKS_REQUEST_WARNINGS=1`** (or `true` / `yes`) to log structured JSON lines for ignored pipeline steps and observability hints.
23
+
24
+ ---
25
+
26
+ ## Canonical input bucket
27
+
28
+ | Bucket | Role |
29
+ |--------|------|
30
+ | **`input`** | **Canonical task payload** (compiled from `inputsConfig` + `taskVariable` on graph nodes). Passed to handlers, NARRIX, synthesis, and the gateway **as its own field** — ai-tasks does **not** fold `input` into `variables` on the MAIN path. |
31
+ | **`variables`** | **Job/graph template bucket only** (same content as `executionMemory.jobVariables` when graph-engine compiles the request). Forwarded **as-is** on `runTask` MAIN; **node-scoped** values belong on **`executionMemory.taskVariables`**, not here. |
32
+ | **`jobContext`** | Optional host/graph seed for templates. **Not** merged into `variables` by ai-tasks; compile into **`variables`** / **`executionMemory.jobVariables`** before invoke (graph-engine) or use [`mergeSkillTemplateVariables`](src/utils/skillTemplateVariables.ts) outside `runTask`. Omitted from the executor spread when only used for pre-compile. |
33
+
34
+ **Pass-through on MAIN (graph-engine 5.13+)**
35
+
36
+ - **`variables`**, **`input`**, **`executionMemory`** (including **`jobVariables`** and **`taskVariables`**), **`xynthesized`**, and **`smartInput`** are sent to `@exellix/ai-skills` **without** flattening scopes into one bag.
37
+ - Path prefixes **`jobVariables.*`** / **`taskVariables.*`** resolve downstream (Rendrix / gateway) against **`executionMemory`**. **`@exellix/ai-skills` ≥ 5.5.0** merges top-level `executionMemory` into gateway `workingMemory`; ai-tasks forwards it via [`pickRunSkillRequestFields`](src/utils/bridgeRunSkillGatewayMemory.ts) (requires **ai-skills ≥ 5.5.0** in `package.json`). Legacy **`variables.*`** ≡ **`jobVariables.*`** when the engine resolves paths.
38
+ - [`mergeSkillTemplateVariables`](src/utils/skillTemplateVariables.ts) remains exported for hosts that want a single merged template map **outside** the default `runTask` MAIN path.
39
+
40
+ **Templates vs handlers**
41
+
42
+ - Gateway templates may read **`input.*`**, **`variables.*`** (job bucket), **`executionMemory.jobVariables.*`**, **`executionMemory.taskVariables.*`**, and top-level **`xynthesized`** / **`smartInput`**.
43
+ - **`input.question`** is what handlers / NARRIX / synthesis read from **`request.input`**.
44
+
45
+ ---
46
+
47
+ ## `executionMemory` vs `execution`
48
+
49
+ | Surface | Meaning |
50
+ |---------|---------|
51
+ | **Request `executionMemory`** | Canonical execution-scoped blob on `RunTaskRequest`. Graph-engine **5.13+** mirrors template variables in separate buckets: **`jobVariables`** (whole run) and **`taskVariables`** (current node). ai-tasks forwards both **as-is** (no flattening). Legacy path prefix **`variables.*`** ≡ **`jobVariables.*`** when the engine resolves paths. |
52
+ | **`jobMemory.execution`** | Populated internally by merging **`executionMemory`** into existing `jobMemory.execution` (deep merge) before memory enrichment. |
53
+ | **Response `executionMemory`** | Merged snapshot: request execution memory plus any `executionMemory` extracted from the skill response / `parsed`. |
54
+ | **Response `executionState.executionMemory`** | Alias mirror of the same merged blob for callers expecting a nested `executionState`. |
55
+ | **`parsed.executionMemory`** | If present on structured output, merged into the response top-level `executionMemory` when attaching execution state. |
56
+ | **`metadata` / `meta`** | `meta` aliases `metadata` on the response for observability consumers. |
57
+
58
+ ---
59
+
60
+ ## `executionPipeline`
61
+
62
+ - **Phases:** `"pre"` | `"main"` | `"post"` (`ExecutionPhase`).
63
+ - **Rule:** If `executionPipeline` is non-empty, there must be **exactly one** step with **`phase: "main"`** or `runTask` throws.
64
+ - **MAIN step `type`:** **Ignored** at runtime — MAIN always runs the same direct/gateway path (`runDirect` → executor). Conventionally `type: "direct"`.
65
+ - **PRE:** Only **`type: "synthesized-context"`** runs. The implementation executes **at most one** such PRE step (the first in pipeline order), then **`break`s** — additional PRE steps are **skipped** (warn with `AI_TASKS_REQUEST_WARNINGS=1`).
66
+ - **PRE types other than `synthesized-context`:** **Ignored** (warn when warnings enabled).
67
+ - **POST:** Only **`audit`** and **`polish`** are implemented; other POST types are **ignored** (warn when warnings enabled).
68
+
69
+ **Utilities:** `runUtility()` (e.g. `xynthesis-finalize`) is **not** a pipeline step; it is a separate API.
70
+
71
+ Default when `executionPipeline` is omitted: MAIN runs once via the gateway (`runSkill`). **`executionStrategies`** controls optional FuncX planners (before MAIN) and optimizers (after each MAIN attempt); use **`[]`** for plain MAIN.
72
+
73
+ ---
74
+
75
+ ## Field inventory (runtime reads)
76
+
77
+ Properties are classified for **default MAIN path** unless noted. Inherited **`RunSkillRequest`** fields follow `@exellix/ai-skills`; task extensions are in `RunTaskRequest`.
78
+
79
+ ### Required (always)
80
+
81
+ | Property | Notes |
82
+ |----------|--------|
83
+ | `skillKey` | Routing: local registry vs gateway skill id. |
84
+ | `agentId` | Non-empty string — `@exellix/ai-skills` activity / routing correlation. |
85
+ | `jobTypeId` | Non-empty string — upstream job classification (catalog / telemetry). |
86
+ | `taskTypeId` | Non-empty string — upstream task classification (catalog / telemetry). |
87
+ | `executionStrategies` | Array of MAIN wrappers: **`planner`** (`phase: "before"`) and **`optimizer`** (`phase: "after"`), each with **`priority`** (sort ascending). Use **`[]`** for plain MAIN. |
88
+
89
+ ### Optional — core execution
90
+
91
+ | Property | Classification |
92
+ |----------|----------------|
93
+ | `input` | Optional task payload (`string` or object). |
94
+ | `variables` | Job/graph template bucket; forwarded as-is on MAIN (see [Canonical input bucket](#canonical-input-bucket)). |
95
+ | `jobMemory`, `taskMemory` | Enriched and forwarded; see executor payload. |
96
+ | `modelConfig` | Forwarded to ai-skills; composed with `llmCall` on MAIN (see DirectExecutionStrategy). |
97
+ | `llmCall` | MAIN skill overlay + trace semantics; stripped before `runSkill`, merged into `modelConfig`. |
98
+ | `timeoutMs` | Forwarded when set (also overlaid from `llmCall.timeoutMs`). |
99
+ | `coreSkillId` | Maps to `skillId` on `RunSkillRequest` for gateway. |
100
+ | `graphId`, `nodeId`, `prevNodeId`, `masterSkillId`, `masterSkillActivityId` | Graph / activity telemetry (read in task-sdk & tracing). |
101
+ | `jobId`, `taskId` | Assigned UUIDs when omitted before gateway. |
102
+ | `identity` | Opaque envelope; enriched with task/skill ids. |
103
+ | `executionMode` | `"default"` \| `"trace"` — trace enables debug trace collection and forwards trace flags downstream. |
104
+ | `jobContext` | Merged into template variables only (stripped from top-level executor payload in `_executeDirect`). |
105
+ | `includeContextInPrompt` | Context markdown generation for MAIN (and required for synthesis PRE unless `autoEnableContext`). |
106
+ | `executionPipeline` | Multi-step PRE / MAIN / POST orchestration. |
107
+ | `narrixMode` | Narrix invocation mode (catalog key); inferred from `narrix` / `narrixInput` when omitted (see `resolveRunTaskRuntimeKnobs`). |
108
+ | `inputStrategyKey` | Input-strategy catalog key (authoring / UX); does **not** select `narrixMode`. |
109
+ | `executionMemory` | Canonical execution blob; merged into `jobMemory.execution`. |
110
+ | `narrix` | Task-level NARRIX pre-processor; mutates `executionMemory` / `jobMemory`. May include web scoping fields such as **`enableWebScope`**, **`webScopeTemplates`**, **`webScopeQuestionTemplate`**, **`webScopeObjects`**, **`webScopeQuestions`** (`Array<{ id?: string; question: string; source?: "manual" \| "ai-driven" }>` when using explicit question-pack mode — see [documenations/web-scoping-in-ai-tasks.md](documenations/web-scoping-in-ai-tasks.md)). |
111
+ | `narrixInput`, `narrixScope` | Structured Narrix **handler** input (`$path` allowed); scope filters into `taskMemory.narrix`. |
112
+ | `aiScoping`, `aiScopingOptions` | PRE MAIN scoped memory → `input.aiScoped`. |
113
+ | `taskKind`, `outputValidation`, `autoValidateDecisionOutput` | Decision/utility/content semantics and **`parsed` validation inside `runTask` only** — **not** forwarded on `RunSkillRequest`; **`@exellix/ai-skills` does not read or validate these fields** (see [.docs/investigation/ai-skills.md](.docs/investigation/ai-skills.md)). |
114
+ | `templateTokens`, `templateRenderOptions` | Inherited from `RunSkillRequest` (@exellix/ai-skills): gateway template overlay / render options per invoke. |
115
+
116
+ ### Invalid on `RunTaskRequest` (v7)
117
+
118
+ These are **not** part of the typed request or closed schema: root `question`, top-level `inputs`, `jobInput`, `executionType`. Compile them away in the graph/runtime layer.
119
+
120
+ ## `executionStrategies` (FuncX wrappers around MAIN)
121
+
122
+ - **`planner`:** runs **once** per entry (in global `priority` order among `before` rows) **before** the first MAIN attempt. Invokes FuncX function id **`execution/plan`** via **`run()`** from **`@x12i/funcx/functions`** with the **generic envelope** (`goal`, `input`, `context`, `args`, `attribution`). Override with `args.functionId` only when the target function accepts that **same** envelope. Responses are normalized with **`getRunJsonResult`** from **`@x12i/funcx/functions`** (≥3.8.2; also re-exported from `@exellix/ai-tasks`). `@exellix/ai-tasks` maps the JSON into gateway merge fields (`instructions` / `prompt` / `variables` / `templateTokens`); see [`genericExecutionFuncxEnvelope.ts`](src/execution-strategies/genericExecutionFuncxEnvelope.ts).
123
+ - **`optimizer`:** runs **after** each MAIN attempt. The **first** `optimizer` row after sort drives the retry loop: FuncX **`execution/evaluate-result`** (same `run()` / generic envelope pattern; **`result`** carries the MAIN output summary). The package maps responses into `{ satisfied, feedback?, variables?, templateTokens? }` for merge; `suggestedChanges` / `issues` from FuncX are folded into **`feedback`** / **`variables.optimizerSuggestedChanges`**. If not satisfied, MAIN runs again with feedback in `variables` / `executionMemory` until **`maxIterations`** MAIN attempts (per-invocation `maxIterations`, else env `AI_TASKS_OPTIMIZER_MAX_ITERATIONS`, else default **3**). Additional optimizer rows are reserved (warning when `AI_TASKS_REQUEST_WARNINGS=1`).
124
+ - Catalox catalogs **`ai-task-main-execution-wrappers`** (preferred) and **`ai-task-execution-strategies`** (same seeded rows) list **`direct`** (plain MAIN, `[]`), **`planner`**, **`optimizer`** for authoring metadata.
125
+ - **FuncX FR specs** (stable **`functionId`** values, JSON input/output envelopes, behavior, **`ask()` correlation**): [`documenations/funcx-scoping-integration-gaps.md`](documenations/funcx-scoping-integration-gaps.md) §**6**.
126
+
127
+ ### Executor passthrough
128
+
129
+ - Only keys listed in `RunTaskRequest` / the schema are guaranteed; extra keys are **not** part of the contract.
130
+ - **`job.input`** as a distinct concept is **not** a first-class field — use `jobMemory` / `jobContext` / `input`.
131
+
132
+ ---
133
+
134
+ ## Xynthesis vs MAIN skill
135
+
136
+ | Path | Xynthesis involvement |
137
+ |------|------------------------|
138
+ | PRE **`synthesized-context`** | Uses xynthesis `executeXynthesisAction` / structured gateway helpers. |
139
+ | POST **audit** / **polish** | Uses xynthesis `executeXynthesisAction` via post-step LLM helpers. |
140
+ | **aiScoping** | Internal scoping calls via xynthesis. |
141
+ | **MAIN** gateway skill | Delegated to `@exellix/ai-skills` `runSkill` — may or may not use xynthesis inside the gateway depending on skill implementation. |
142
+ | **Local tasks** | No gateway / no pipeline POST unless returning early — **no** xynthesis from MAIN path. |
143
+ | **`runUtility`** | Separate entry (e.g. `xynthesis/finalize`). |
144
+
145
+ **Why a run might show no “xynthesis actions”**
146
+
147
+ 1. **Local handler** short-circuits before enrichment/gateway.
148
+ 2. **MAIN-only** request with no PRE/POST pipeline and no ai-scoping — synthesis simply does not run in ai-tasks.
149
+ 3. **`executionMode` not `"trace"`** — fewer diagnostics / `debugTrace` surfaces even when xynthesis runs.
150
+ 4. **Pipeline steps ignored** — unsupported PRE/POST types or extra PRE synthesis steps after the first.
151
+
152
+ ---
153
+
154
+ ## Examples
155
+
156
+ **Minimal valid**
157
+
158
+ ```json
159
+ {
160
+ "skillKey": "skills/example",
161
+ "agentId": "my-agent",
162
+ "jobTypeId": "my-job-type",
163
+ "taskTypeId": "my-task-type",
164
+ "executionStrategies": [],
165
+ "input": { "question": "Hello?" }
166
+ }
167
+ ```
168
+
169
+ **Graph-shaped (correlation + memory)**
170
+
171
+ ```json
172
+ {
173
+ "skillKey": "skills/example",
174
+ "agentId": "my-agent",
175
+ "jobTypeId": "my-job-type",
176
+ "taskTypeId": "my-task-type",
177
+ "executionStrategies": [],
178
+ "jobId": "…",
179
+ "taskId": "…",
180
+ "graphId": "g1",
181
+ "nodeId": "n1",
182
+ "input": { "assetId": "a1" },
183
+ "variables": { "orgName": "Acme", "locale": "en" },
184
+ "jobContext": { "tenantId": "t1" },
185
+ "jobMemory": {},
186
+ "taskMemory": {},
187
+ "executionMemory": {
188
+ "input": { "raw": {} },
189
+ "jobVariables": { "orgName": "Acme", "locale": "en" },
190
+ "taskVariables": { "tone": "concise" }
191
+ }
192
+ }
193
+ ```
194
+
195
+ ---
196
+
197
+ ## Graph task node (authoring) → `RunTaskRequest` (invoke)
198
+
199
+ Graph stores **`TaskNode`** model objects; `@exellix/ai-tasks` accepts only **`RunTaskRequest`**. Graph-engine compiles authoring into the wire shape; ai-tasks forwards fields **without** flattening **`jobVariables`** / **`taskVariables`** or merging **`input`** into **`variables`**.
200
+
201
+ ### Three “inputs” on a task node (do not confuse)
202
+
203
+ | Name | On model | Compiled into |
204
+ |------|----------|-----------------|
205
+ | **`inputsConfig`** | Runtime payload bindings (`executionMemoryPath`, …) | **`RunTaskRequest.input`** (wires only) |
206
+ | **`taskVariable`** | Prompts, literals, `{ "$path": "jobVariables.*" \| "taskVariables.*" }` | Merged into **`RunTaskRequest.input`** |
207
+ | **`runtime.input`** / caller bag | Per-run MAIN payload | **`RunTaskRequest.input`** (+ mirrored `executionMemory.input`) |
208
+
209
+ Deprecated on nodes: **`inputs`** (dual-read → **`inputsConfig`**). Not on request: top-level **`inputs`**.
210
+
211
+ ### Template variable scopes (two buckets)
212
+
213
+ | Scope | Authored on | On `executionMemory` | `RunTaskRequest` |
214
+ |-------|-------------|----------------------|------------------|
215
+ | Job / graph (whole run) | `model.variables`, `runtime.variables`, `runtime.jobVariables` | **`jobVariables`** | **`variables`** (same bucket; forwarded as-is) |
216
+ | Task / node (this step only) | `node.variables`, `runtime.taskVariables` | **`taskVariables`** | *(no top-level field yet — bucket only on `executionMemory`)* |
217
+
218
+ Legacy path alias: **`variables.*`** ≡ **`jobVariables.*`** (prefer **`jobVariables.*`** in new graphs).
219
+
220
+ ### Node fields (authoring → request)
221
+
222
+ | Node field | Role | On `RunTaskRequest`? |
223
+ |------------|------|----------------------|
224
+ | **`id`** | Stable node id | **Indirect:** **`nodeId`**, fresh **`taskId`** per invoke |
225
+ | **`type`** | `task` \| `finalizer` | **No** — routing uses **`skillKey`** |
226
+ | **`skillKey`** | Skill / local handler key | **Yes** — required; use **`node.skillKey`** only (not `metadata.skillKey`) |
227
+ | **`taskKnowledge`** | Static knowledge refs | **No** — resolved into outbound **`taskMemory.knowledge`** by graph-engine |
228
+ | **`inputsConfig`** | Execution-memory wires | **No** — compiled into **`input`** |
229
+ | **`taskVariable`** | Dynamic task config / prompt | **No** — compiled into **`input`** |
230
+ | **`variables`** | Node template overrides | **No** — mirrored to **`executionMemory.taskVariables`** |
231
+ | **`inputs`** | Deprecated bindings name | **Do not author** — use **`inputsConfig`** |
232
+ | **`metadata`** | Planning / readability only | **No** opaque passthrough — see forbidden table |
233
+ | **`taskConfiguration`** | Execution-facing config | **Lifted** — see table below |
234
+ | **`smartInput`** | Rendrix path list | **Yes** — **`smartInput`** (`paths`, optional **`strict`**) |
235
+ | **`executionMapping`** | Post-run writes to execution memory | **No** — graph-engine after response |
236
+ | **`jobContextMapping`** | Template variable seeds | **No** — compile to **`jobContext`** / **`jobVariables`** before invoke |
237
+ | **`outputMapping`** | Finalizer / graph outputs | **No** — apply after response (finalizers only on finalizer type) |
238
+ | **`scope`** | List-scoping declaration | **No** — compile to **`input`** / memory paths / **`narrixScope`** / **`aiScoping`** |
239
+ | **`outputValidation`** | Local graph post-check (rules) | **No** on request — engine **`executeNode`** only |
240
+ | **`conditions`** | Run gates | **No** — graph-engine |
241
+ | **`memory`** | Rare per-node memory override | **No** — stays on model; engine applies to outbound memory copies |
242
+
243
+ ### Lifting `taskConfiguration` → `RunTaskRequest`
244
+
245
+ | `node.taskConfiguration.*` | `RunTaskRequest` property |
246
+ |------------------------------|---------------------------|
247
+ | `taskTypeId` | **`taskTypeId`** |
248
+ | `executionStrategies` | **`executionStrategies`** (required; use **`[]`** for plain MAIN) |
249
+ | `executionStrategyCatalogItems` | **`executionStrategyCatalogItems`** |
250
+ | `modelConfig` (+ `runtime.nodes[id].modelConfig`) | **`modelConfig`** (flat; aliases resolved by engine) |
251
+ | `llmCall`, `timeoutMs` | same |
252
+ | `narrix`, `narrixMode`, `narrixInput` | **`narrix`**, **`narrixMode`**, **`narrixInput`**, **`narrixScope`** |
253
+ | `inputStrategyKey` | **`inputStrategyKey`** |
254
+ | `aiTasksOutputValidation` | **`outputValidation`** (server-side in `runTask`) |
255
+ | `executionPipeline` | **`executionPipeline`** |
256
+ | `runTaskIdentity` | **`identity`** |
257
+ | `taskKind`, `autoValidateDecisionOutput` | same |
258
+ | `aiTaskProfile.webScoping` | **`narrix.webScoping`** (when preprocessor runs) |
259
+ | `taskConfiguration.aiTaskProfile.inputSynthesis` | PRE **`synthesized-context`** — see compile table |
260
+ | `taskConfiguration.aiTaskStrategies` | Forward on **`RunTaskRequest.taskConfiguration`** for ai-tasks compile (see below) |
261
+ | `taskConfiguration.aiTaskProfile.preStrategyKey` / `postStrategyKey` | Engine utility `runTask` calls (not extra request fields) |
262
+
263
+ ### `inputSynthesis` → PRE pipeline (graph-engine compile)
264
+
265
+ | `aiTaskProfile.inputSynthesis` | Effect |
266
+ |--------------------------------|--------|
267
+ | `enabled: true` | Insert PRE `{ phase: "pre", type: "synthesized-context" }`; set **`includeContextInPrompt: true`** |
268
+ | `sources[]` | `SynthesisConfig.memoryPaths` |
269
+ | `destination` + `outputKey` | `SynthesisConfig.xynthesizedOutput` |
270
+ | Conflicts with explicit `executionPipeline` | Engine / compile rejects (`INPUT_SYNTHESIS_PIPELINE_CONFLICT`) |
271
+
272
+ ### `aiTaskStrategies` → PRE pipeline (ai-tasks compile at `runTask`)
273
+
274
+ Graph-engine forwards the node blob on **`RunTaskRequest.taskConfiguration`** (stripped after compile). Alternatively call **`compileTaskConfigurationOnRunTaskRequest`** before invoke.
275
+
276
+ | `taskConfiguration.aiTaskStrategies` | Effect |
277
+ |--------------------------------------|--------|
278
+ | `pre: "synthesis"` or `pre` array containing `"synthesis"` | Insert PRE `{ phase: "pre", type: "synthesized-context" }`; set **`includeContextInPrompt: true`** |
279
+ | `preInputStrategy` | `SynthesisConfig.synthesisInputStrategy` (`policy`, `task-memory-only`, …) |
280
+ | Conflicts with `inputSynthesis.enabled` + explicit PRE in `taskConfiguration.executionPipeline` | **`INPUT_SYNTHESIS_PIPELINE_CONFLICT`** |
281
+
282
+ **Note:** `"synthesis"` on `pre` **enables** PRE; it is not an input-strategy catalog key. Post-audit strategy `"synthesis"` is unrelated.
283
+
284
+ See [`reports/graph-engine-task-pre-synthesis-compile.md`](reports/graph-engine-task-pre-synthesis-compile.md) for the **graph-engine** work item (graph model, compile, runtime, CI).
285
+
286
+ ### Dual `outputValidation`
287
+
288
+ | Authoring | Where it runs |
289
+ |-----------|----------------|
290
+ | **`node.outputValidation`** (rules) | Graph-engine **local** check before mappings — **not** forwarded to ai-tasks |
291
+ | **`taskConfiguration.aiTasksOutputValidation`** | **`RunTaskRequest.outputValidation`** — validated inside **`runTask`** on **`response.parsed`** |
292
+
293
+ ### Forbidden on `node.metadata` (execution config)
294
+
295
+ | Wrong | Correct |
296
+ |-------|---------|
297
+ | `metadata.modelConfig` | `taskConfiguration.modelConfig` |
298
+ | `metadata.narrix` | `taskConfiguration.narrix` |
299
+ | `metadata.aiTaskProfile` | `taskConfiguration.aiTaskProfile` |
300
+ | `metadata.executionStrategyKey` | `taskConfiguration.executionStrategies` |
301
+ | `metadata.outputConstraints` | `taskConfiguration.aiTasksOutputValidation` |
302
+ | `metadata.taskKnowledge` | `node.taskKnowledge` |
303
+ | `metadata.skillKey` | `node.skillKey` |
304
+ | `metadata.variables` | `node.variables` |
305
+
306
+ ### `smartInput.paths` (engine allowlist)
307
+
308
+ `input.*`, `inputs.*`, **`jobVariables.*`**, **`taskVariables.*`**, `jobMemory.*`, `taskMemory.*`, `executionMemory.*`, `xynthesized.job|task|execution.*`. Legacy **`variables.*`** ≡ **`jobVariables.*`**.
309
+
310
+ ### Gaps (not on `RunTaskRequest`)
311
+
312
+ 1. **`jobContextMapping`** — evaluate → **`jobContext`** / **`executionMemory.jobVariables`** before invoke.
313
+ 2. **`executionMapping`** / **`outputMapping`** — apply after `runTask`.
314
+ 3. **`conditions`**, **`stepRetryPolicy`**, opaque **`metadata`** execution passthrough.
315
+ 4. Per-node **`taskVariables`** top-level field — use **`executionMemory.taskVariables`** until a future request field exists.
316
+
317
+ Correlations and memories on invoke: **`agentId`**, **`jobTypeId`**, **`taskTypeId`** (required); **`jobId`**, **`taskId`**; **`graphId`**, **`nodeId`**, **`prevNodeId`**; **`jobMemory`**, **`taskMemory`**, **`executionMemory`**; **`variables`**, **`includeContextInPrompt`**, **`xynthesized`**, **`smartInput`**, **`templateTokens`**, **`templateRenderOptions`**, and other **`RunSkillRequest`** fields forwarded by **`@exellix/ai-skills`**.
318
+
319
+ ---
320
+
321
+ ## Orchestrator integration (graph-engine and hosts)
322
+
323
+ This package **does not declare** a tested minimum **`@exellix/graph-engine`** (or other orchestrator) semver. **Consume the orchestrator’s own `package.json` / lockfile** line for **`@exellix/ai-tasks`**. Breaking **`RunTaskRequest`** / runtime validation changes are **`CHANGELOG.md`** / **`BREAKING-CHANGES.md`** (typically **major** bumps). A joint **“graph-engine X ↔ ai-tasks Y tested in CI”** matrix lives with the **orchestrator** when you add CI for it — not in this repo today.
324
+
325
+ ### Metadata passthrough into `RunTaskRequest`
326
+
327
+ There is **no machine-generated allowlist** or parity CI in **`@exellix/ai-tasks`**. Hosts that whitelist fields (e.g. `extractRunTaskMetadataPassthrough`) must **update manually** when [`documenations/schemas/v1/run-task-request.json`](documenations/schemas/v1/run-task-request.json) gains keys, or adopt broader forwarding policy. Optional future: export schema top-level keys from a small script for downstream CI diffs.
328
+
329
+ ### `taskTypeId` vs `skillKey`
330
+
331
+ **`@exellix/ai-skills`** requires **`taskTypeId`** as a **non-empty opaque string** independent of **`skillKey`** (routing uses **`skillKey`** only). Orchestrators may set root **`taskTypeId`** from authoring **`metadata.taskTypeId`** when non-empty, else default **`taskTypeId === skillKey`** — both are valid. **`@exellix/ai-tasks`** does not validate **`taskTypeId`** against a Catalox catalog.
332
+
333
+ ### `RunTaskResponse.xynthesizedPatch` and optimizer / retries
334
+
335
+ - **`xynthesizedPatch`** is populated only from **PRE pipeline `synthesized-context`** steps that set **`xynthesizedOutput`** (see [`src/utils/xynthesizedWrite.ts`](src/utils/xynthesizedWrite.ts): **`replace`** vs **`merge`** on **`outputKey`**; **`mergeXynthesizedPatchSlices`** merges **`job` / `task` / `execution` buckets**).
336
+ - **`RunTaskRequest.xynthesized`** and **`RunTaskResponse.xynthesizedPatch`** use the same shape: **`{ job?, task?, execution? }`**, each a **`Record<string, unknown>`** keyed by synthesis **`outputKey`** (or caller-supplied keys). **`SynthesisConfig.xynthesizedOutput.destination`** may be **`"job"`**, **`"task"`**, or **`"execution"`** — ai-tasks does **not** redirect execution scope into job or task buckets.
337
+ - **`smartInput.paths`** entries under **`xynthesized.*`** must use scope **`job`**, **`task`**, or **`execution`** (validated in [`src/utils/xynthesizedSmartInputPaths.ts`](src/utils/xynthesizedSmartInputPaths.ts)); path resolution against live memory remains downstream (Rendrix / gateway).
338
+ - The **optimizer** loop (**`executionStrategies`** `optimizer`) runs **multiple MAIN attempts inside one `runTask`** but **does not append** additional **`xynthesizedPatch`** slices — patches reflect **PRE writes for that invocation**, not per-MAIN-attempt deltas.
339
+ - Each **new** **`runTask`** call from an orchestrator **starts fresh** (optimizer iteration counter resets) unless the host **replays** **`executionMemory`**, **`xynthesized`**, etc. Worst-case MAIN executions ≈ **orchestrator retry count × inner optimizer iterations**.
340
+
341
+ ### Narrix web scoping
342
+
343
+ When **`narrix.enableWebScope === true`**, **`@exellix/ai-tasks`** runs **`@exellix/narrix-web-scoper`** after the Narrix preprocessor unless **`narrix.skipWebScopeWhenExternalWebMarkdownPresent`** is set and **`executionMemory.webContextMarkdown`** is already a non-empty string. There is **no cross-process URL dedupe**; avoiding double fetch is a **configuration** concern (see [documenations/web-scoping-in-ai-tasks.md](documenations/web-scoping-in-ai-tasks.md)).
344
+
345
+ ### Buffered run logs and Logxer correlation on **`metadata`**
346
+
347
+ **`runTask()`** in this package **does not set** orchestrator-specific keys such as buffered **`runLog`** / **`exellixRunLog`** or **`logxerRunId`** / **`logxerCorrelationId`** on the response. If those appear on merged **`response.metadata`**, that is **consumer/orchestrator + logging stack** behavior — not part of **`RunSkillResponse`** types from **`@exellix/ai-skills`**. Stable schema / deprecation policy for those keys should be documented **next to the orchestrator** (and **`@x12i/logxer`** if viewers depend on them).
348
+
349
+ ### PRE/POST utility-style **`runTask`** calls
350
+
351
+ **`runTask`** does **not** forbid **`executionStrategies`** or a richer **`executionPipeline`** for **`taskKind: "utility"`**; isolating utilities to **`executionStrategies: []`** and a single MAIN pipeline step is an **orchestrator policy**, not an **`@exellix/ai-tasks`** runtime restriction.
352
+
353
+ ### Scope vs **`aiScoping`** vs **`narrixScope`**
354
+
355
+ | Mechanism | Role in **`@exellix/ai-tasks`** |
356
+ |-----------|-----------------------------------|
357
+ | **`narrixScope`** | Filters what lands in **`taskMemory.narrix`** after the structured Narrix handler. |
358
+ | **`aiScoping`** | PRE-MAIN LLM calls → **`input.aiScoped[]`**. |
359
+ | Authoring **`scope`** / in-memory lists | No dedicated request field — compile into **`input`**, **`variables`**, **`jobContext`**, or **`executionMemory`** (see [Graph task node](#graph-task-node-authoring--runtaskrequest-invoke)). |
360
+
361
+ ### Cross-package assignment tracker
362
+
363
+ Remaining work owned by **other packages** (docs, CI, log contracts) is listed with **target dates** in [.docs/investigation/external-packages-assignments.md](.docs/investigation/external-packages-assignments.md).
364
+
365
+ ---
366
+
367
+ ## Cross-package coordination
368
+
369
+ **Orchestrator minimum version:** not declared in **`@exellix/ai-tasks`** — follow the consuming app’s dependency range and [**Orchestrator integration**](#orchestrator-integration-graph-engine-and-hosts) above. [**external-packages-assignments.md**](.docs/investigation/external-packages-assignments.md) tracks follow-ups outside this repo.
@@ -0,0 +1,6 @@
1
+ import { Activix } from "@x12i/activix";
2
+ /** MongoDB collection name for task activity records (must match `getActivixClient` and `getTaskActivities`). */
3
+ export declare function getActivixCollectionName(): string;
4
+ export declare function isActivixEnabled(): boolean;
5
+ export declare function getActivixClient(): Promise<Activix | null>;
6
+ //# sourceMappingURL=activixClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activixClient.d.ts","sourceRoot":"","sources":["../../src/activix/activixClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAQxC,iHAAiH;AACjH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AA+BD,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CA+FhE"}
@@ -0,0 +1,131 @@
1
+ import { Activix } from "@x12i/activix";
2
+ import { resolvePackageLogsLevel } from "@x12i/logxer";
3
+ let _client = null;
4
+ let _initPromise = null;
5
+ /** MongoDB collection name for task activity records (must match `getActivixClient` and `getTaskActivities`). */
6
+ export function getActivixCollectionName() {
7
+ return process.env.ACTIVIX_COLLECTION ?? "task-activities";
8
+ }
9
+ export function isActivixEnabled() {
10
+ return process.env.ACTIVIX_ENABLED === "true";
11
+ }
12
+ /** Maps injected logger methods to `@x12i/logxer` `LogLevel` ordering (verbose…error). */
13
+ function shouldEmitActivixLog(method, packageLogsDisabled, threshold) {
14
+ if (packageLogsDisabled)
15
+ return method === "error";
16
+ const rank = {
17
+ debug: 1,
18
+ info: 2,
19
+ warn: 3,
20
+ error: 4,
21
+ };
22
+ // `@x12i/logxer` may expand `LogLevel` over time (e.g. "off"/"silent"/"none").
23
+ // If an unknown level appears, default to "warn" to avoid breaking Activix logging.
24
+ const thresholdRank = {
25
+ verbose: 0,
26
+ debug: 1,
27
+ info: 2,
28
+ warn: 3,
29
+ error: 4,
30
+ off: Number.POSITIVE_INFINITY,
31
+ silent: Number.POSITIVE_INFINITY,
32
+ none: Number.POSITIVE_INFINITY,
33
+ };
34
+ const resolvedThresholdRank = thresholdRank[String(threshold)] ?? thresholdRank.warn;
35
+ return rank[method] >= resolvedThresholdRank;
36
+ }
37
+ export async function getActivixClient() {
38
+ if (!isActivixEnabled())
39
+ return null;
40
+ if (_client) {
41
+ if (!_initPromise)
42
+ return _client;
43
+ }
44
+ const mongoUri = process.env.MONGO_URI ?? process.env.MONGO_LOGS_URI;
45
+ if (!mongoUri)
46
+ return null;
47
+ const staleRecordTTL = process.env.ACTIVIX_STALE_TTL_MS
48
+ ? parseInt(process.env.ACTIVIX_STALE_TTL_MS, 10)
49
+ : 300_000;
50
+ const collectionName = getActivixCollectionName();
51
+ // Indexes help queries that group by correlationId and/or phase.
52
+ const correlationIdIndex = {
53
+ keys: { correlationId: 1 },
54
+ options: { name: "byCorrelationId" },
55
+ };
56
+ const phaseIndex = {
57
+ keys: { phase: 1 },
58
+ options: { name: "byPhase" },
59
+ };
60
+ const correlationPhaseIndex = {
61
+ keys: { correlationId: 1, phase: 1 },
62
+ options: { name: "byCorrelationIdAndPhase" },
63
+ };
64
+ const collectionConfig = {
65
+ name: collectionName,
66
+ primaryKey: "recordId",
67
+ primaryKeyPrefix: "act-",
68
+ statusField: "status",
69
+ startTimeField: "startTime",
70
+ endTimeField: "endTime",
71
+ durationField: "duration",
72
+ statusValues: {
73
+ started: "started",
74
+ completed: "completed",
75
+ failed: "failed",
76
+ timeout: "timeout",
77
+ },
78
+ indexes: [correlationIdIndex, phaseIndex, correlationPhaseIndex],
79
+ cache: {
80
+ // Activix passes this to xronox-store; caching is helpful but not required.
81
+ maxSize: 1_000,
82
+ ttlMs: 60_000,
83
+ },
84
+ };
85
+ const { packageLogsDisabled, logLevel } = resolvePackageLogsLevel({ envPrefix: "ACTIVIX" });
86
+ const ax = new Activix({
87
+ mongoUri,
88
+ storageMode: "database",
89
+ collections: [collectionConfig],
90
+ defaultCollection: collectionName,
91
+ staleRecordTTL,
92
+ logger: {
93
+ debug: (msg, meta) => {
94
+ if (!shouldEmitActivixLog("debug", packageLogsDisabled, logLevel))
95
+ return;
96
+ // eslint-disable-next-line no-console
97
+ console.debug(`[activix] ${msg}`, meta ?? "");
98
+ },
99
+ info: (msg, meta) => {
100
+ if (!shouldEmitActivixLog("info", packageLogsDisabled, logLevel))
101
+ return;
102
+ // eslint-disable-next-line no-console
103
+ console.info(`[activix] ${msg}`, meta ?? "");
104
+ },
105
+ warn: (msg, meta) => {
106
+ if (!shouldEmitActivixLog("warn", packageLogsDisabled, logLevel))
107
+ return;
108
+ // eslint-disable-next-line no-console
109
+ console.warn(`[activix] ${msg}`, meta ?? "");
110
+ },
111
+ error: (msg, meta) => {
112
+ if (!shouldEmitActivixLog("error", packageLogsDisabled, logLevel))
113
+ return;
114
+ // eslint-disable-next-line no-console
115
+ console.error(`[activix] ${msg}`, meta ?? "");
116
+ },
117
+ },
118
+ });
119
+ _client = ax;
120
+ if (!_initPromise) {
121
+ _initPromise = _client.init().catch(() => {
122
+ // Non-fatal: if init fails, we still allow call sites to ignore by receiving `null`.
123
+ // We keep the init promise cleared so future calls can try again.
124
+ _initPromise = null;
125
+ return;
126
+ });
127
+ }
128
+ await _initPromise;
129
+ return _client;
130
+ }
131
+ //# sourceMappingURL=activixClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activixClient.js","sourceRoot":"","sources":["../../src/activix/activixClient.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,10 @@
1
+ export type TaskActivityRecord = Record<string, unknown>;
2
+ /**
3
+ * Retrieve Activix phase records for a single logical task run.
4
+ *
5
+ * Notes:
6
+ * - Requires `ACTIVIX_ENABLED=true` and Mongo configured (same as tracking).
7
+ * - `taskId` is the runtime task identifier and also the Activix `correlationId`.
8
+ */
9
+ export declare function getTaskActivities(taskId: string): Promise<TaskActivityRecord[]>;
10
+ //# sourceMappingURL=getTaskActivities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTaskActivities.d.ts","sourceRoot":"","sources":["../../src/activix/getTaskActivities.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAWrF"}
@@ -0,0 +1,17 @@
1
+ import { getActivixClient, getActivixCollectionName } from "./activixClient.js";
2
+ /**
3
+ * Retrieve Activix phase records for a single logical task run.
4
+ *
5
+ * Notes:
6
+ * - Requires `ACTIVIX_ENABLED=true` and Mongo configured (same as tracking).
7
+ * - `taskId` is the runtime task identifier and also the Activix `correlationId`.
8
+ */
9
+ export async function getTaskActivities(taskId) {
10
+ const ax = await getActivixClient().catch(() => null);
11
+ if (!ax)
12
+ return [];
13
+ // See docs/activix.md — records are grouped by correlationId.
14
+ const records = await ax.findRecords({ correlationId: taskId }, { collection: getActivixCollectionName(), sort: { startTime: 1 } });
15
+ return Array.isArray(records) ? records : [];
16
+ }
17
+ //# sourceMappingURL=getTaskActivities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTaskActivities.js","sourceRoot":"","sources":["../../src/activix/getTaskActivities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAIhF;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAc;IACpD,MAAM,EAAE,GAAG,MAAM,gBAAgB,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACtD,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,CAAC;IAEnB,8DAA8D;IAC9D,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,WAAW,CAClC,EAAE,aAAa,EAAE,MAAM,EAAE,EACzB,EAAE,UAAU,EAAE,wBAAwB,EAAE,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,CACnE,CAAC;IAEF,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,OAAgC,CAAC,CAAC,CAAC,EAAE,CAAC;AACzE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { Activix } from "@x12i/activix";
2
+ export type ActivixPhase = "local" | "narrix" | "narrix_then_direct" | "pipeline_pre" | "direct" | "audit" | "polish";
3
+ export declare function createPhaseMeta(args: {
4
+ correlationId: string;
5
+ phase: ActivixPhase;
6
+ [k: string]: unknown;
7
+ }): Record<string, unknown>;
8
+ export declare function withPhaseRecord<T>(args: {
9
+ ax: Activix | null;
10
+ correlationId: string | undefined;
11
+ phase: ActivixPhase;
12
+ meta?: Record<string, unknown>;
13
+ onSuccessUpdates?: (result: T) => Record<string, unknown> | undefined;
14
+ onErrorUpdates?: (error: unknown) => Record<string, unknown> | undefined;
15
+ fn: () => Promise<T>;
16
+ }): Promise<T>;
17
+ //# sourceMappingURL=phaseTracking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phaseTracking.d.ts","sourceRoot":"","sources":["../../src/activix/phaseTracking.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,MAAM,YAAY,GACpB,OAAO,GACP,QAAQ,GACR,oBAAoB,GACpB,cAAc,GACd,QAAQ,GACR,OAAO,GACP,QAAQ,CAAC;AAEb,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,YAAY,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAG1B;AAwCD,wBAAsB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE;IAC7C,EAAE,EAAE,OAAO,GAAG,IAAI,CAAC;IACnB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACtE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACzE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;CACtB,GAAG,OAAO,CAAC,CAAC,CAAC,CA+Db"}