@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,887 @@
1
+ import type { RunSkillRequest, RunSkillResponse, ModelConfig, SmartInputConfig, SmartInputRenderOptions } from "@exellix/ai-skills";
2
+ import type { SmartInputRenderResult } from "@x12i/rendrix";
3
+ export type { SmartInputRenderResult };
4
+ import type { WebScoperConfig } from "@exellix/narrix-web-scoper";
5
+ import type { NarrixRunInput } from "../narrix/types.js";
6
+ import type { PostCoreTaskStrategyKey, TaskStrategyKey } from "../task-strategies/canonicalTaskStrategies.js";
7
+ import type { InputStrategyKey } from "../task-strategies/canonicalInputExecutionStrategies.js";
8
+ import type { NarrixModeKey } from "../task-strategies/canonicalNarrixModes.js";
9
+ import type { TaskStrategyItemData } from "../task-strategies/types.js";
10
+ import type { LlmCallConfig, LlmCallObservation } from "./llmCall.js";
11
+ /**
12
+ * @deprecated Use `narrixMode: "handler"` with `narrixInput` instead of any legacy “narrix-then-direct” execution label.
13
+ */
14
+ export declare const NARRIX_THEN_DIRECT: "narrix-then-direct";
15
+ /** Step type for PRE step: synthesize context before main task. */
16
+ export declare const SYNTHESIZED_CONTEXT: "synthesized-context";
17
+ /** Phase of a step in the execution pipeline. */
18
+ export type ExecutionPhase = "pre" | "main" | "post";
19
+ /** One step in the execution pipeline. */
20
+ export interface ExecutionStep {
21
+ phase: ExecutionPhase;
22
+ type: string;
23
+ config?: SynthesisConfig | AuditConfig | PolishConfig;
24
+ }
25
+ /** One check in the audit gateway (must or should). */
26
+ export interface AuditCheck {
27
+ /** Human-readable description of what to check. */
28
+ check: string;
29
+ /** Relative weight for scoring. Higher = more impact on weighted score. */
30
+ weight: number;
31
+ }
32
+ /** Result for a single check from the audit LLM (parsed from Flex-MD or fallback). */
33
+ export interface AuditCheckResult {
34
+ check: string;
35
+ kind: "must" | "should";
36
+ passed: boolean;
37
+ feedback: string;
38
+ }
39
+ /** Logical shape of audit LLM output (parsed from structured markdown). */
40
+ export interface AuditLLMOutput {
41
+ checks: AuditCheckResult[];
42
+ overallFeedback: string;
43
+ }
44
+ /** Full runtime audit result including computed weighted score. */
45
+ export interface AuditResult {
46
+ checks: AuditCheckResult[];
47
+ overallFeedback: string;
48
+ weightedScore: number;
49
+ }
50
+ /** Config for the audit POST step. */
51
+ export interface AuditConfig {
52
+ gateway: {
53
+ must: AuditCheck[];
54
+ should: AuditCheck[];
55
+ };
56
+ threshold?: number;
57
+ minCycles?: number;
58
+ maxCycles?: number;
59
+ /** How to pick or combine audit candidates after the core task. Keys match `CANONICAL_POST_CORE_TASK_STRATEGIES` / Catalox `ai-task-strategies-post`. */
60
+ selectionStrategy?: PostCoreTaskStrategyKey;
61
+ auditModelConfig?: ModelConfig;
62
+ synthesisModelConfig?: ModelConfig;
63
+ customAuditGuidelines?: string;
64
+ customSynthesisGuidelines?: string;
65
+ fallbackToBest?: boolean;
66
+ auditTimeoutMs?: number;
67
+ /**
68
+ * Per-role {@link LlmCallConfig} (model / maxTokensCap / temperature / topP / outputExpectation / timeoutMs / maxOutputLength).
69
+ * Forwarded to xynthesis `executeXynthesisAction` for the audit evaluator and synthesis-merge calls. Resolution
70
+ * order at the call site: `llmCall.<role>.X` → step env (e.g. `AUDIT_*`) → shared `POST_STEP_*` env → fallback.
71
+ */
72
+ llmCall?: {
73
+ audit?: LlmCallConfig;
74
+ synthesis?: LlmCallConfig;
75
+ };
76
+ }
77
+ /** Metadata attached to response.metadata.postSteps.audit after audit POST step. */
78
+ export interface AuditPostStepMetadata {
79
+ totalCycles: number;
80
+ candidateScores: number[];
81
+ selectedCycleIndex: number;
82
+ allMustPassed: boolean;
83
+ synthesisUsed: boolean;
84
+ auditResults: AuditResult[];
85
+ durationMs: number;
86
+ /**
87
+ * Trace-mode-only: ordered list of `LlmCallObservation` for every audit-evaluator and synthesis-merge call
88
+ * the post-step performed. Includes failures (e.g. silent merge fallbacks) so callers can see what was asked,
89
+ * what was used, and why it failed. Omitted outside trace mode.
90
+ */
91
+ llmCalls?: LlmCallObservation[];
92
+ }
93
+ /** One item in the polish checklist. */
94
+ export interface PolishChecklistItem {
95
+ instruction: string;
96
+ priority: "high" | "medium" | "low";
97
+ }
98
+ /** Config for the polish POST step. */
99
+ export interface PolishConfig {
100
+ checklist: PolishChecklistItem[];
101
+ maxPasses?: number;
102
+ modelConfig?: ModelConfig;
103
+ customGuidelines?: string;
104
+ includeOriginalContext?: boolean;
105
+ timeoutMs?: number;
106
+ /**
107
+ * {@link LlmCallConfig} (model / maxTokensCap / temperature / topP / outputExpectation / timeoutMs / maxOutputLength)
108
+ * for the polish LLM call. Forwarded to xynthesis `executeXynthesisAction`. Resolution order at the call site:
109
+ * `llmCall.X` → step env (`POLISH_*`) → shared `POST_STEP_*` env → fallback.
110
+ */
111
+ llmCall?: LlmCallConfig;
112
+ }
113
+ /** Polish LLM output (JSON). */
114
+ export interface PolishLLMOutput {
115
+ polishedOutput: string;
116
+ changeNotes: {
117
+ instruction: string;
118
+ action: "changed" | "no-change";
119
+ note: string;
120
+ }[];
121
+ }
122
+ /** Metadata attached to response.metadata.postSteps.polish after polish POST step. */
123
+ export interface PolishPostStepMetadata {
124
+ totalPasses: number;
125
+ changeNotes: PolishLLMOutput["changeNotes"][];
126
+ durationMs: number;
127
+ /**
128
+ * Trace-mode-only: ordered list of `LlmCallObservation` for every polish pass call.
129
+ * Includes failures so callers can see what was asked / used / why it failed. Omitted outside trace mode.
130
+ */
131
+ llmCalls?: LlmCallObservation[];
132
+ }
133
+ /**
134
+ * When POST steps run, response.metadata may be extended with postSteps.
135
+ * Attached at runtime in task-sdk; RunTaskResponse aliases RunSkillResponse from ai-skills.
136
+ */
137
+ export interface RunTaskResponsePostStepsMetadata {
138
+ audit?: AuditPostStepMetadata;
139
+ polish?: PolishPostStepMetadata;
140
+ }
141
+ /**
142
+ * AI scoping failure (per-item) surfaced in `response.metadata.aiScopingFailures` (trace mode only).
143
+ * Carries the originating instruction location and the upstream typed error so callers can read
144
+ * `error.invokeSummary` / `error.observation` without losing the rich payload.
145
+ */
146
+ export interface AiScopingFailureRecord {
147
+ /** Index into `request.aiScoping[]`. */
148
+ index: number;
149
+ /** Same as `instruction.targetToken`. */
150
+ targetToken: string;
151
+ /** Same as `instruction.source`. */
152
+ source: string;
153
+ error: {
154
+ name: string;
155
+ message: string;
156
+ /** When the upstream threw `XynthesisInvokeError` / `XynthesisResponseParseError`, carries `invokeSummary`. */
157
+ invokeSummary?: import("./llmCall.js").InvokeAttemptSummary;
158
+ /** When wrapped with `LlmCallContextError`, carries the structured observation. */
159
+ observation?: LlmCallObservation;
160
+ };
161
+ }
162
+ /**
163
+ * Trace-mode-only top-level task response metadata extensions. Attached at runtime in `task-sdk` /
164
+ * post-steps; never appended outside trace mode (lean payload).
165
+ */
166
+ export interface RunTaskResponseTraceMetadata {
167
+ /** Per-item `LlmCallObservation` for every PRE synthesis call (markdown / question-driven / structured). */
168
+ synthesizedContextLlmCalls?: LlmCallObservation[];
169
+ /** Per-item `LlmCallObservation` for every AI scoping call (success + failure). */
170
+ aiScopingLlmCalls?: LlmCallObservation[];
171
+ /** Per-item failure record for AI scoping items that did not complete successfully. */
172
+ aiScopingFailures?: AiScopingFailureRecord[];
173
+ }
174
+ /**
175
+ * What feeds the synthesis PRE step: Narrix markdown, web evidence markdown, and/or memory JSON.
176
+ * Legacy: `narrix-only` / `narrix+memory` are aliases for `narrix-web` / `narrix-web-memory`.
177
+ * `auto`: narrix-web-memory if Narrix output exists; else memory-web if web scoping hit; else memory-only.
178
+ */
179
+ export type ContextSourcePolicy = "auto" | "narrix-only" | "narrix+memory" | "memory-only" | "narrix-web" | "narrix-web-memory" | "memory-web";
180
+ /** Options for serializing `executionMemory.webContext` into synthesis source material. */
181
+ export type WebEvidenceConfig = {
182
+ /** Prefer cleaned text over raw HTML in excerpts. Default true. */
183
+ preferCleanContent?: boolean;
184
+ /** Max sources after URL dedupe. Default 5. */
185
+ maxSources?: number;
186
+ /** Dedupe by normalized URL (first wins). Default true. */
187
+ dedupeByUrl?: boolean;
188
+ /** Hard cap on markdown size (Unicode code units). */
189
+ maxTotalChars?: number;
190
+ };
191
+ export type SynthesisMode = "markdown" | "structured";
192
+ /**
193
+ * Job-scoped, task-scoped, and execution-scoped synthesized material for graph execution
194
+ * (logically separate from raw memories).
195
+ */
196
+ export type XynthesizedMemory = {
197
+ job?: Record<string, unknown>;
198
+ task?: Record<string, unknown>;
199
+ /** Run-wide execution bucket (distinct from job and per-node task scopes). */
200
+ execution?: Record<string, unknown>;
201
+ };
202
+ export type { SmartInputConfig, SmartInputRenderOptions };
203
+ /**
204
+ * Rendrix-native {@link SmartInputConfig} or wire form with `paths` (string[] or `{ title, path, required? }[]`)
205
+ * and optional `strict` (forwarded to gateway / Rendrix after normalization).
206
+ */
207
+ export type RunTaskSmartInput = SmartInputConfig | {
208
+ paths: string[] | SmartInputConfig["paths"];
209
+ strict?: boolean;
210
+ };
211
+ export type XynthesizedDestinationScope = "job" | "task" | "execution";
212
+ /** Optional PRE synthesis destination for graph-mergeable xynthesized memory. */
213
+ export type XynthesizedOutputConfig = {
214
+ destination: XynthesizedDestinationScope;
215
+ outputKey: string;
216
+ mode?: "replace" | "merge";
217
+ /**
218
+ * When false, skip persisting to executionMemory.synthesizedContext / synthesizedInput for this PRE step.
219
+ * When omitted or true, preserve legacy MAIN context persistence.
220
+ */
221
+ alsoWriteLegacySynthesizedContext?: boolean;
222
+ };
223
+ /** Keys match `CANONICAL_PRE_CORE_TASK_STRATEGIES` and Catalox catalog `ai-task-strategies-pre`. */
224
+ export type { TaskStrategyKey as SynthesisInputStrategy } from "../task-strategies/canonicalTaskStrategies.js";
225
+ export type { PostCoreTaskStrategyKey } from "../task-strategies/canonicalTaskStrategies.js";
226
+ export type TaskCore = "question" | "action" | "plan" | "objective" | "decision" | "comparison" | "classification" | "evaluation" | "analysis" | "summary" | "generation" | "extraction";
227
+ export declare const TASK_CORES: readonly ["question", "action", "plan", "objective", "decision", "comparison", "classification", "evaluation", "analysis", "summary", "generation", "extraction"];
228
+ /**
229
+ * Config for the synthesized-context PRE step (step.config when type is "synthesized-context").
230
+ */
231
+ export interface SynthesisConfig {
232
+ modelConfig?: ModelConfig;
233
+ contextSourcePolicy?: ContextSourcePolicy;
234
+ /**
235
+ * Controls what raw input is provided to the synthesizer.
236
+ * - `policy` (default): use contextSourcePolicy + narrix/web/memory composition.
237
+ * - `execution-memory-only`: synthesize from executionMemory only.
238
+ * - `job-memory-only`: synthesize from jobMemory only.
239
+ * - `task-memory-only`: synthesize from taskMemory only.
240
+ * - `full-memory-bundle`: synthesize from {jobMemory, taskMemory, executionMemory}.
241
+ */
242
+ synthesisInputStrategy?: TaskStrategyKey;
243
+ autoEnableContext?: boolean;
244
+ synthesisPromptOverride?: string;
245
+ timeoutMs?: number;
246
+ maxOutputLength?: number;
247
+ memoryPaths?: string[];
248
+ customSynthesizingGuidelines?: string;
249
+ /** When true, on synthesis failure run main step without synthesized context. Default false. */
250
+ fallbackToDirect?: boolean;
251
+ /** Controls web excerpt markdown when web scoping is present (synthesis source material). */
252
+ webEvidence?: WebEvidenceConfig;
253
+ /**
254
+ * `markdown` (default): free-form synthesized context.
255
+ * `structured`: model returns JSON matching SynthesizedPromptPayload; main context via buildSynthesizedContextMarkdown.
256
+ */
257
+ synthesisMode?: SynthesisMode;
258
+ /**
259
+ * Dot-path into `request.input` for the task question (structured mode / explicit question field). Default `question`.
260
+ */
261
+ questionPath?: string;
262
+ /**
263
+ * Override question resolution for structured synthesis. Takes precedence over questionPath when it returns a non-empty string.
264
+ */
265
+ getQuestion?: (request: RunTaskRequest) => string | undefined;
266
+ /** Max synthesized items per side (local/supporting) after validation. Default 50. */
267
+ structuredMaxItemsPerSide?: number;
268
+ /** Max characters per item content. Default 8000. */
269
+ structuredMaxItemContentChars?: number;
270
+ /**
271
+ * Structured mode only: enable best-effort recovery when the provider returns non-JSON (or JSON wrapped in prose/markdown)
272
+ * and strict response normalization fails upstream. Default true.
273
+ */
274
+ structuredRepair?: boolean;
275
+ /**
276
+ * Structured mode only: max number of repair retries after a normalization failure. Default 1.
277
+ * A retry re-asks with a minimal "return ONLY valid JSON object" instruction.
278
+ */
279
+ structuredRepairMaxRetries?: number;
280
+ /** Structured mode only: max chars of raw output included in error diagnostics. Default 4000. */
281
+ structuredDiagnosticsMaxChars?: number;
282
+ /**
283
+ * When true, synthesize answers for multiple explicit questions and store them under
284
+ * executionMemory.synthesizedContext as a structured artifact (mode: "questionDriven").
285
+ * Backward compatible: when omitted/false, behavior is unchanged.
286
+ */
287
+ questionDriven?: boolean;
288
+ /**
289
+ * Questions to answer in question-driven mode. Each question can restrict which inputs are allowed:
290
+ * - record: only record-derived input (executionMemory.input.raw)
291
+ * - web: only web-derived input (executionMemory.webContext)
292
+ * - both: combine both when available
293
+ */
294
+ questions?: Array<{
295
+ id: string;
296
+ question: string;
297
+ source?: "record" | "web" | "both";
298
+ }>;
299
+ /**
300
+ * When true, if `request.executionMemory.synthesizedContext` is already a non-null object with a usable
301
+ * `contextMarkdown` string (or question-driven artifact including `contextMarkdown`), skip the PRE synthesis
302
+ * LLM call and reuse the cached artifact. Opt-in only; callers are responsible for cache validity.
303
+ */
304
+ reuseCachedSynthesizedContext?: boolean;
305
+ /**
306
+ * {@link LlmCallConfig} (model / maxTokensCap / temperature / topP / outputExpectation / timeoutMs / maxOutputLength)
307
+ * for the PRE synthesis LLM call (markdown / question-driven / structured branches). Forwarded to xynthesis
308
+ * `executeXynthesisAction` / `runStructuredSynthesisGatewayCallRobust`. Resolution order at the call site:
309
+ * `llmCall.X` → existing field on this config (e.g. `modelConfig.X`, `timeoutMs`, `maxOutputLength`) → env → fallback.
310
+ */
311
+ llmCall?: LlmCallConfig;
312
+ /** When set, write synthesis output under request.xynthesized.job|task|execution[outputKey] and return xynthesizedPatch. */
313
+ xynthesizedOutput?: XynthesizedOutputConfig;
314
+ }
315
+ /**
316
+ * One entry in taskMemory.narrix — output of a single Narrix run (possibly filtered by narrixScope).
317
+ */
318
+ export type TaskMemoryNarrixEntry = {
319
+ entity: {
320
+ entityKind: string;
321
+ entityKey: string;
322
+ };
323
+ signals: unknown[];
324
+ stories: unknown[];
325
+ meta: Record<string, unknown>;
326
+ };
327
+ /**
328
+ * Filters which signals and stories from Narrix output are written into task memory.
329
+ * When includeSignals is set, only signals whose code is in the array are kept; excludeSignals is ignored.
330
+ * Same for includeStories / excludeStories with narrativeTypeId. When neither include nor exclude is set for a dimension, all pass through.
331
+ */
332
+ export interface NarrixScope {
333
+ includeSignals?: string[];
334
+ excludeSignals?: string[];
335
+ includeStories?: string[];
336
+ excludeStories?: string[];
337
+ }
338
+ /**
339
+ * One explicit web search question for `@exellix/narrix-web-scoper` question-pack mode
340
+ * (`scopeQuestionPack`). Used when `webScopeTemplates` is unset.
341
+ */
342
+ export interface NarrixWebScopeQuestion {
343
+ id?: string;
344
+ question: string;
345
+ source?: "manual" | "ai-driven";
346
+ }
347
+ /**
348
+ * Task-level NARRIX pre-processor config (e.g. from graph node `taskConfiguration.narrix`).
349
+ * When present, ai-tasks runs the NARRIX enrichment pipeline before the task and injects
350
+ * the result into executionMemory (and optionally jobMemory) so the handler can use it.
351
+ * Defaults: attachToField = "_narrix", deterministicSort = true.
352
+ * engineConfigPath / packsRoot are reserved for future use when runner supports them.
353
+ */
354
+ export interface NarrixPreProcessorConfig {
355
+ datasetId: string;
356
+ /** Reserved for future use when @exellix/narrix-runner supports loading from path. */
357
+ engineConfigPath?: string;
358
+ /** Reserved for future use when packs can be loaded from a path. */
359
+ packsRoot?: string;
360
+ /** Field name on executionMemory for the _narrix attachment; default "_narrix". */
361
+ attachToField?: string;
362
+ /** Default true. */
363
+ deterministicSort?: boolean;
364
+ /** Reserved for future use when runner exposes an API. */
365
+ assumptionsPolicy?: {
366
+ allowAssumptions?: boolean;
367
+ requireAssumptionMarking?: boolean;
368
+ requireEvidenceForAssumptions?: boolean;
369
+ };
370
+ /**
371
+ * When true, run @exellix/narrix-web-scoper after CNI is built and inject the result into
372
+ * executionMemory.webContext. Requires TAVILY_API_KEY env. On failure, logs and continues
373
+ * with only NARRIX narrative (lenient fallback). Default false.
374
+ */
375
+ enableWebScope?: boolean;
376
+ /**
377
+ * When true with `enableWebScope`, skip the internal web-scoper if `executionMemory.webContextMarkdown` is a
378
+ * non-empty string (caller already supplied web markdown). Narrix narrative still runs.
379
+ */
380
+ skipWebScopeWhenExternalWebMarkdownPresent?: boolean;
381
+ /**
382
+ * When set (non-empty), passed to the web-scoper as `webScopeTemplates` and replaces normal query planning.
383
+ * Tokens use athenix-parser syntax (same as `@exellix/narrix-web-scoper`). Takes precedence over enriched `question`.
384
+ */
385
+ webScopeTemplates?: string[];
386
+ /**
387
+ * Optional Handlebars template for the search `question` when `webScopeTemplates` is not set.
388
+ * Rendered with context from CNI knownFacts, entity, `input.question`, plus `input` (full task input).
389
+ */
390
+ webScopeQuestionTemplate?: string;
391
+ /**
392
+ * Merged on top of auto-built template context when using `webScopeTemplates` (caller overrides).
393
+ */
394
+ webScopeObjects?: Record<string, unknown>;
395
+ /**
396
+ * Non-empty after normalization: run `scopeQuestionPack` with these questions instead of
397
+ * `scopeGeneric` / single `question` planning. Ignored when `webScopeTemplates` is non-empty.
398
+ */
399
+ webScopeQuestions?: NarrixWebScopeQuestion[];
400
+ /**
401
+ * Per-request web-scoper retrieval options (same shape as `WebScoperConfig.scoping` in
402
+ * `@exellix/narrix-web-scoper`): snippets, caps, raw body, max queries, freshness, etc.
403
+ * Forwarded when building the scoper for this call so defaults stay backward compatible.
404
+ */
405
+ webScoping?: WebScoperConfig["scoping"];
406
+ }
407
+ /**
408
+ * Execution-level memory type.
409
+ *
410
+ * Contains history of execution context (e.g., execution state, intermediate results,
411
+ * execution-level variables) that persists across execution attempts or retries.
412
+ */
413
+ export type ExecutionHistory = Record<string, any>;
414
+ /** Structured synthesis fills `templateCores` and validated `payload`; markdown synthesis uses `[]` and `payload.kind === "markdown-synthesis"`. */
415
+ export type SynthesizedContextArtifact = {
416
+ templateCores: TaskCore[];
417
+ question: string;
418
+ mode: SynthesisMode;
419
+ payload: unknown;
420
+ contextMarkdown: string;
421
+ };
422
+ export type QuestionDrivenSynthesizedContext = {
423
+ mode: "questionDriven";
424
+ /** Same markdown fed to MAIN as synthesized context; set for persistence and `reuseCachedSynthesizedContext`. */
425
+ contextMarkdown?: string;
426
+ record?: Record<string, unknown>;
427
+ web?: Record<string, unknown>;
428
+ answers?: Record<string, {
429
+ question: string;
430
+ source: "record" | "web" | "both";
431
+ synthesis: string;
432
+ evidence?: {
433
+ recordPaths?: string[];
434
+ webScopeIds?: string[];
435
+ sources?: Array<{
436
+ url?: string;
437
+ title?: string;
438
+ }>;
439
+ };
440
+ }>;
441
+ };
442
+ /** Union for executionMemory.synthesizedContext. */
443
+ export type AnySynthesizedContextArtifact = SynthesizedContextArtifact | QuestionDrivenSynthesizedContext;
444
+ /**
445
+ * Material resolved for the synthesis PRE step (persistence / debugging). Stored at `executionMemory.synthesizedInput`.
446
+ * Large `sourceMaterial` may be truncated per `SYNTHESIZED_INPUT_MAX_CHARS` (default 200_000).
447
+ */
448
+ export type SynthesizedInputArtifact = {
449
+ synthesisMode: SynthesisMode | "questionDriven";
450
+ sourceMaterial: string;
451
+ localMarkdown?: string;
452
+ supportingMarkdown?: string;
453
+ question?: string;
454
+ templateCores?: TaskCore[];
455
+ truncated?: boolean;
456
+ };
457
+ /**
458
+ * One instruction for AI scoping: which memory path to read and how to scope it.
459
+ * Used in RunTaskRequest.aiScoping.
460
+ */
461
+ export type AIScopingInstruction = {
462
+ /** Dot-path to memory value (e.g. jobMemory.customerProfile, taskMemory.previousFindings). */
463
+ source: string;
464
+ /** Natural-language instructions for the internal scoping AI call. */
465
+ instructions: string;
466
+ /** Label for the scoped result; appears as aiScoped[].token. */
467
+ targetToken: string;
468
+ /**
469
+ * Optional per-instruction {@link LlmCallConfig} (overrides `RunTaskRequest.aiScopingOptions.llmCall`).
470
+ * Forwarded to the internal scoping AI call (`runScopingCall`).
471
+ */
472
+ llmCall?: LlmCallConfig;
473
+ };
474
+ /**
475
+ * One scoped result from an AI scoping call.
476
+ * Injected into main task input as input.aiScoped[].
477
+ */
478
+ export type AIScopedItem = {
479
+ token: string;
480
+ scopedInfo: string;
481
+ };
482
+ /** Array of scoped results; injected into main task input as input.aiScoped. */
483
+ export type AIScoped = AIScopedItem[];
484
+ /** Phase relative to the MAIN gateway skill (`runSkill`) invocation. */
485
+ export type ExecutionStrategyPhase = "before" | "after";
486
+ /** Wrapper strategies implemented around MAIN (catalog rows `planner` / `optimizer`). */
487
+ export type ExecutionStrategyWrapperKey = "planner" | "optimizer";
488
+ /**
489
+ * One configured wrapper around MAIN: FuncX planner (once before MAIN) or optimizer (evaluates after each MAIN attempt).
490
+ * Sort within each phase by ascending `priority`; ties preserve request order.
491
+ */
492
+ export interface ExecutionStrategyInvocation {
493
+ strategyKey: ExecutionStrategyWrapperKey;
494
+ phase: ExecutionStrategyPhase;
495
+ priority: number;
496
+ /** Optimizer only: max MAIN attempts when unsatisfied (minimum 1). Omitted uses env / package default. */
497
+ maxIterations?: number;
498
+ /** Per-invocation knobs (e.g. `functionId` override for FuncX). */
499
+ args?: Record<string, unknown>;
500
+ }
501
+ /**
502
+ * One step in a combined/multi-step task execution.
503
+ * Used when a task (or skill) runs multiple logical steps in one invocation
504
+ * (e.g. "to-cni + enrich + triage") so consumers can inspect and report the chain
505
+ * without extra round-trips.
506
+ */
507
+ export interface IntermediateStep {
508
+ /** 1-based order in the execution chain. */
509
+ step: number;
510
+ /** Stable identifier for the step (e.g. "to-cni", "engine-enrich", "triage-q1-q6"). */
511
+ id: string;
512
+ /** Whether this step completed successfully. */
513
+ ok: boolean;
514
+ /** Optional short summary (e.g. "cni built", "enriched", "answers Q1,Q6"). */
515
+ summary?: string;
516
+ /** Optional error message when ok is false. */
517
+ error?: string;
518
+ /** Optional summary input (e.g. keys/ids) for reporting. */
519
+ inputSummary?: Record<string, unknown> | string;
520
+ /** Optional excerpt of step output for debugging; keep small to avoid payload bloat. */
521
+ outputExcerpt?: Record<string, unknown>;
522
+ /**
523
+ * Trace-mode-only: structured `LlmCallObservation` for this step (model / token resolution / usage / cost / error).
524
+ * Populated for failed audit-cycle / polish-pass steps so consumers see the request snapshot + upstream
525
+ * `invokeSummary` / `diagnostics` without inspecting the thrown error.
526
+ */
527
+ observation?: LlmCallObservation;
528
+ }
529
+ /** Optional list of intermediate steps, in execution order. */
530
+ export type IntermediateSteps = IntermediateStep[];
531
+ /**
532
+ * Task execution request for `WorexClientTasks.runTask()`.
533
+ *
534
+ * Extends `RunSkillRequest` with pipeline, NARRIX, synthesis, and related fields. `skillId` is omitted;
535
+ * `coreSkillId`, `graphId`, `nodeId`, and `prevNodeId` remain for graph execution and activity tracking.
536
+ *
537
+ * **Upstream-required correlation ids:** `agentId`, `jobTypeId`, and `taskTypeId` are **required** (same as `RunSkillRequest`).
538
+ * `runTask()` validates them at runtime; omitting them throws before execution.
539
+ *
540
+ * **Template variables (graph-engine 5.13+):** On MAIN, `variables` is the **job/graph bucket** only (forwarded as-is;
541
+ * same as `executionMemory.jobVariables`). Node scope lives on `executionMemory.taskVariables`. `input`, `xynthesized`,
542
+ * and `smartInput` are separate top-level fields — not folded into `variables`. Optional host merge:
543
+ * `mergeSkillTemplateVariables` (not used on default `runTask` MAIN).
544
+ *
545
+ * **Model:** `modelConfig` is forwarded on the request to the skills layer and gateway unchanged (per-invocation
546
+ * overrides for provider, model name, temperature, and other `ModelConfig` fields).
547
+ *
548
+ * **taskMemory:** May include `narrix` entries after the structured Narrix handler runs.
549
+ *
550
+ * **Wire contract:** Matches `documenations/schemas/v1/run-task-request.json` (closed object; no root `question`, `inputs`, `jobInput`, or `executionType`).
551
+ *
552
+ * **Graph task nodes:** Authoring may use `id`, `type`, `metadata`, `jobContextMapping`, `outputMapping`, and duplicate `inputs` labels — compile those into this interface before `runTask`. Mapping specs (`jobContextMapping`, `outputMapping`) are runtime-only. Only fields on this type (plus allowed `RunSkillRequest` fields such as `templateTokens` / `templateRenderOptions`) are valid. Split authoring `metadata` into the typed properties below (`narrixMode`, `inputStrategyKey`, `executionStrategies`, pipeline, scoping, validation, etc.).
553
+ */
554
+ export interface RunTaskRequest extends Omit<RunSkillRequest, "skillId" | "jobId" | "taskId" | "executionType" | "smartInput"> {
555
+ /**
556
+ * Execution mode for task diagnostics behavior.
557
+ *
558
+ * - default: return the normal task response only.
559
+ * - trace: return the normal task response plus an authoritative ordered debug trace.
560
+ */
561
+ executionMode?: "default" | "trace";
562
+ /**
563
+ * Job correlation for skills gateway / logs. When omitted, `WorexClientTasks.runTask` assigns a UUID before
564
+ * invoking `@exellix/ai-skills` (required there on each request).
565
+ */
566
+ jobId?: string;
567
+ /**
568
+ * Task instance id (also used as Activix correlation when enabled). When omitted, `runTask` assigns a UUID.
569
+ */
570
+ taskId?: string;
571
+ /**
572
+ * Optional identity envelope for this task instance.
573
+ *
574
+ * This is treated as an opaque JSON object and is preserved through execution.
575
+ * Runtime may enrich it per-run (e.g. taskId, skillId) and attach it to downstream
576
+ * activity/phase tracking.
577
+ */
578
+ identity?: Record<string, unknown>;
579
+ /**
580
+ * Execution pipeline: array of steps (pre → main → post). When omitted, MAIN direct execution is implied.
581
+ */
582
+ executionPipeline?: ExecutionStep[];
583
+ /**
584
+ * Whether and which Narrix path runs at the **start** of `runTask` (before local tasks and pipeline PRE).
585
+ * Canonical keys match Catalox `ai-task-narrix-modes`. When omitted, inferred from `narrix` / `narrixInput`
586
+ * (see `resolveRunTaskRuntimeKnobs`).
587
+ */
588
+ narrixMode?: NarrixModeKey | (string & {});
589
+ /**
590
+ * Optional **authoring / UX / template-hint** metadata (e.g. for consoles or Xynthesis templates).
591
+ * Does **not** select Narrix invocation (`narrixMode`) and does **not** decide what slices PRE receives by default
592
+ * (PRE gets the full available context bundle; see product D6).
593
+ * Canonical keys match Catalox `ai-task-input-strategies`. Omitted: defaults to `no-narrative` (not inferred from Narrix wiring).
594
+ */
595
+ inputStrategyKey?: InputStrategyKey | (string & {});
596
+ /**
597
+ * **Required.** Wrappers around MAIN (`runSkill`): planners run once each before the first MAIN attempt (sorted by `priority`);
598
+ * optimizers run after each MAIN attempt — the first optimizer after sort drives the retry loop. Use `[]` for plain MAIN (no FuncX wrappers).
599
+ */
600
+ executionStrategies: ExecutionStrategyInvocation[];
601
+ /**
602
+ * Optional catalog item metadata from preferred catalog `execution-strategy`.
603
+ * Runtime uses only safe allowlisted fields after normal code validation passes; malformed or conflicting rows are ignored.
604
+ */
605
+ executionStrategyCatalogItems?: TaskStrategyItemData[];
606
+ /**
607
+ * Execution-scoped memory. Graph-engine mirrors template variables here as **`jobVariables`** (whole run) and
608
+ * **`taskVariables`** (current node). Forwarded unchanged; ai-tasks does not flatten buckets into `variables`.
609
+ */
610
+ executionMemory?: ExecutionHistory;
611
+ /** Required when `narrixMode` is `"handler"` (or inferred handler — see runtime knobs). May use `{ $path }` against jobMemory. */
612
+ narrixInput?: NarrixRunInput | {
613
+ $path: string;
614
+ };
615
+ /** Filters which signals/stories are written to `taskMemory.narrix` after the Narrix handler. */
616
+ narrixScope?: NarrixScope;
617
+ /** Optional: run internal AI calls to scope memory content into input.aiScoped before main task. */
618
+ aiScoping?: AIScopingInstruction[];
619
+ /**
620
+ * Optional global config for the AI scoping step (applies to every `aiScoping[]` instruction unless that
621
+ * instruction sets its own `llmCall`). Concurrency / per-item timeout are also configurable here (today
622
+ * they are env-only — `AI_SCOPING_CONCURRENCY` / `AI_SCOPING_TIMEOUT_MS_PER_ITEM`).
623
+ */
624
+ aiScopingOptions?: {
625
+ llmCall?: LlmCallConfig;
626
+ /** Max concurrent scoping calls; falls back to env `AI_SCOPING_CONCURRENCY`. */
627
+ concurrency?: number;
628
+ /** Per-item timeout in ms; falls back to env `AI_SCOPING_TIMEOUT_MS_PER_ITEM`. */
629
+ timeoutMsPerItem?: number;
630
+ };
631
+ /**
632
+ * Optional canonical {@link LlmCallConfig} for the **main skill** invocation (the underlying `runSkill` call).
633
+ *
634
+ * Composes with the legacy `modelConfig` field — when both are present, `llmCall.*` wins for fields it
635
+ * defines (`model`, `temperature`, `topP`, `maxTokensCap`/`maxTokens`, `timeoutMs`). `modelConfig` is still
636
+ * forwarded as-is to `@exellix/ai-skills` so all of its `[key: string]: any` extras (e.g. `frequencyPenalty`,
637
+ * `presencePenalty`, `stop`) keep working.
638
+ *
639
+ * Trace mode (`executionMode: "trace"`) returns the underlying ai-skills `RunSkillDiagnostics` /
640
+ * `SkillDiagnosticsTrace` on success, and a `SkillExecutionTraceError` (passed through unchanged) on
641
+ * failure — both of which carry the full `invokeRequest`, `usage`, `routing`, `costUsd`, `attempts[]`.
642
+ * Outside trace mode, raw underlying errors are wrapped in `LlmCallContextError` with a request snapshot.
643
+ */
644
+ llmCall?: LlmCallConfig;
645
+ /** Optional: run NARRIX enrichment before this task; inject result into executionMemory (and optionally jobMemory). */
646
+ narrix?: NarrixPreProcessorConfig;
647
+ /** When true, add context to the prompt (opt-in; default is no context). Set to false or omit to omit. */
648
+ includeContextInPrompt?: boolean;
649
+ /**
650
+ * Optional classification for stricter output semantics.
651
+ *
652
+ * - decision: routing-critical. `response.parsed` MUST be canonical and schema-valid.
653
+ * - utility: structured helper step. Validation recommended; may be strict by convention.
654
+ * - content: user-facing content generation. Structured fallbacks may be acceptable.
655
+ */
656
+ taskKind?: "decision" | "utility" | "content";
657
+ /**
658
+ * Optional runtime validation for the task's structured output (`response.parsed`).
659
+ * This is intended for deterministic graph mapping (e.g. output.parsed.shouldUseWeb).
660
+ *
661
+ * Integrators: specs that refer to **outputConstraints** for structured answers use the same minimal schema
662
+ * language as **`schema: OutputSchema`** here (no separate request field).
663
+ *
664
+ * - mode "fail" (default): throw an error when validation fails.
665
+ * - mode "warn": attach validation errors to response.metadata.outputValidation and continue.
666
+ */
667
+ outputValidation?: {
668
+ schema: OutputSchema;
669
+ mode?: "fail" | "warn";
670
+ /** When true, validation runs even if parsed is undefined/null (treated as missing). Default true. */
671
+ validateWhenMissing?: boolean;
672
+ };
673
+ /**
674
+ * When true (default), decision tasks may have default output validation injected by runtime.
675
+ * Set to false to disable auto-injected validation (not recommended for routing-critical nodes).
676
+ */
677
+ autoValidateDecisionOutput?: boolean;
678
+ /**
679
+ * Optional low-precedence template seed from graph `jobContextMapping`. Compile into `variables` /
680
+ * `executionMemory.jobVariables` before invoke; ai-tasks does not merge `jobContext` into `variables` on MAIN.
681
+ */
682
+ jobContext?: Record<string, unknown>;
683
+ /**
684
+ * Synthesized execution context: job-scoped (shared across graph nodes), task-scoped (this node only),
685
+ * or execution-scoped (run-wide). Distinct from jobMemory / taskMemory / executionMemory.
686
+ */
687
+ xynthesized?: XynthesizedMemory;
688
+ /** Smart-input config (Rendrix paths or legacy strings); normalized before MAIN executor. */
689
+ smartInput?: RunTaskSmartInput;
690
+ /**
691
+ * Optional graph node `taskConfiguration` forwarded by graph-engine for compile-only use.
692
+ * {@link compileTaskConfigurationOnRunTaskRequest} maps `aiTaskStrategies` / `aiTaskProfile.inputSynthesis`
693
+ * into `executionPipeline` and strips this field before execution.
694
+ */
695
+ taskConfiguration?: import("./task-configuration.js").TaskConfigurationAuthoring;
696
+ }
697
+ /** Versioned digest of synthesis / pipeline / memory signals for UIs (stable fields only). */
698
+ export type AiTasksObservabilityDigest = {
699
+ schemaVersion: 1;
700
+ synthesisEnabled: boolean;
701
+ effectiveExecutionPipeline?: ExecutionStep[];
702
+ synthesizedContextPresent: boolean;
703
+ mainContextSource: "synthesizedContext" | "unsynthesized";
704
+ detectedTemplateCores?: string[];
705
+ synthesisMode?: SynthesisMode;
706
+ /** Shallow summary of merged execution memory (keys + size), not full content unless requested. */
707
+ executionMemorySummary?: {
708
+ topLevelKeys: string[];
709
+ approxJsonChars?: number;
710
+ };
711
+ /** Optional Narrix hints when metadata carries narrix blocks. */
712
+ narrixSummary?: {
713
+ durationMs?: number;
714
+ ok?: boolean;
715
+ };
716
+ /** Effective {@link RunTaskRequest.inputStrategyKey} (defaults applied by runtime when attached). */
717
+ inputStrategyKey?: InputStrategyKey | string;
718
+ /** Compact summary of resolved execution strategies (when attached by runtime). */
719
+ executionStrategiesSummary?: {
720
+ beforeKeys: ExecutionStrategyWrapperKey[];
721
+ afterKeys: ExecutionStrategyWrapperKey[];
722
+ primaryOptimizerMaxIterations?: number;
723
+ };
724
+ /** Effective {@link RunTaskRequest.narrixMode} after legacy resolution (when attached by runtime). */
725
+ narrixMode?: NarrixModeKey | string;
726
+ };
727
+ /**
728
+ * Task execution response type.
729
+ *
730
+ * This is the response format returned by runTask methods.
731
+ * Currently aliases RunSkillResponse but provides semantic clarity for tasks.
732
+ *
733
+ * For combined/multi-step tasks, the response MAY include an optional
734
+ * `intermediateSteps` array (see RunTaskResponseWithSteps). Consumers (e.g.
735
+ * worox-graphs reporter) can use it to render a chain view without separate
736
+ * graph nodes for each step.
737
+ */
738
+ export type RunTaskResponse<TParsed = any> = RunSkillResponse<TParsed> & {
739
+ /**
740
+ * Resolved smart-input markdown and path diagnostics when downstream returns them
741
+ * (see also `metadata.smartInputRenderResult`).
742
+ */
743
+ smartInputRenderResult?: SmartInputRenderResult;
744
+ /**
745
+ * Optional identity envelope returned by downstream execution.
746
+ * When present, it is also mirrored into response.metadata.identity.
747
+ */
748
+ identity?: Record<string, unknown>;
749
+ /**
750
+ * Denormalized observability digest for graph consoles. Orchestrators should set this with
751
+ * {@link extractAiTasksObservabilityFromRunTaskResponse}; ai-tasks does not attach it by default.
752
+ */
753
+ aiTasksObservability?: AiTasksObservabilityDigest;
754
+ /**
755
+ * Patch for graph-engine to merge into durable xynthesized memory after PRE synthesis writes.
756
+ */
757
+ xynthesizedPatch?: XynthesizedMemory;
758
+ };
759
+ export type DebugTraceTask = {
760
+ taskType: "ai-task" | "pre-execution" | "post-execution";
761
+ details: string;
762
+ /**
763
+ * Structured metadata with stable top-level keys.
764
+ *
765
+ * Required keys (when available for the step):
766
+ * - step: { phase, type, stepId }
767
+ * - timing: { startedAt, endedAt, durationMs }
768
+ * - routing: { provider, region, retryCount, requestIds }
769
+ * - usage: { maxTokensRequested, tokensPrompt, tokensCompletion, tokensTotal, cachedTokens*?, costUsd? }
770
+ * - ok: boolean
771
+ */
772
+ metadata: Record<string, unknown>;
773
+ modelUsed?: string | null;
774
+ };
775
+ export type RunTaskTraceResponse<TParsed = unknown> = RunTaskResponse<TParsed> & {
776
+ debugTrace: {
777
+ tasks: DebugTraceTask[];
778
+ };
779
+ };
780
+ /**
781
+ * Explicit, testable execution policy for ai-tasks "utility" invocations.
782
+ *
783
+ * - debug: local dev / template debugging (more repair + diagnostics)
784
+ * - standard: normal interactive runs
785
+ * - batch-prod: large-scale cost-sensitive runs (minimize retries/repair)
786
+ */
787
+ export type UtilityExecutionPolicy = "debug" | "standard" | "batch-prod";
788
+ export type XynthesisFinalizeUtilityInput = {
789
+ /** For observability / tracing. */
790
+ finalizerNodeId: string;
791
+ templateId: string;
792
+ inputs: Record<string, unknown>;
793
+ outputContractId?: string;
794
+ };
795
+ export type XynthesisFinalizeUtilityRequest = {
796
+ utilityKind: "xynthesis-finalize";
797
+ /** Must be the public stable xynthesis utility key. */
798
+ utilityKey: "xynthesis/finalize";
799
+ input: XynthesisFinalizeUtilityInput;
800
+ /**
801
+ * Explicit policy; when omitted, runtime defaults to env-derived policy.
802
+ * Keep behavior explicit and unit-testable by passing this from upstream.
803
+ */
804
+ executionPolicy?: UtilityExecutionPolicy;
805
+ /**
806
+ * Optional global/shared repair budget (e.g. batch processing).
807
+ * When present and <= 0, repair is disabled even for debug/standard.
808
+ */
809
+ repairBudgetRemaining?: number;
810
+ /** Optional per-call execution config. */
811
+ exec?: {
812
+ model?: string;
813
+ timeoutMs?: number;
814
+ /** Hard ceiling on the auto-resolved max tokens (`callerMaxTokens` in xynthesis `resolveMaxTokens`). */
815
+ maxTokensCap?: number;
816
+ temperature?: number;
817
+ topP?: number;
818
+ /** Drives xynthesis `resolveMaxTokens`. When omitted, picks per-stage default via `resolveOutputExpectation`. */
819
+ outputExpectation?: import("./llmCall.js").OutputExpectation;
820
+ templatesBasePath?: string;
821
+ /** Forwarded to `runXynthesisFinalize`; opt-in for verbose upstream `debugTrace` (lifted into metadata). */
822
+ executionMode?: "default" | "trace";
823
+ };
824
+ };
825
+ export type RunUtilityRequest = XynthesisFinalizeUtilityRequest;
826
+ export type RunUtilityResponse<TParsed = any> = {
827
+ utilityKind: RunUtilityRequest["utilityKind"];
828
+ utilityKey: RunUtilityRequest["utilityKey"];
829
+ /**
830
+ * Canonical business output. For xynthesis/finalize structured mode, this MUST
831
+ * come from the xynthesis response `parsed` field (no salvage/fallback).
832
+ */
833
+ parsed?: TParsed;
834
+ /**
835
+ * Free-form metadata sidecar. Trace-mode-populated keys (when `exec.executionMode === "trace"`):
836
+ * - `exec`: snapshot of the resolved `RunUtilityRequest.exec` (model / cap / temperature / topP / outputExpectation / timeoutMs).
837
+ * - `executionPolicy`: the resolved `UtilityExecutionPolicy`.
838
+ * - `llmCalls`: per-attempt `LlmCallObservation[]` (success + failure).
839
+ * - `debugTrace`: verbatim `XynthesisDebugTrace` from the underlying `runXynthesisFinalize` call.
840
+ * - `attempts`: per-attempt `{ ok, repairCount, error?, invokeSummary? }` summaries.
841
+ *
842
+ * Non-trace mode: only the lean default upstream metadata + business fields are present.
843
+ */
844
+ metadata?: Record<string, unknown>;
845
+ };
846
+ /**
847
+ * Minimal schema for validating `response.parsed` without pulling in a JSON-schema dependency.
848
+ * Intended for decision/utility nodes producing stable structured artifacts.
849
+ */
850
+ export type OutputSchema = {
851
+ type: "any";
852
+ } | {
853
+ type: "string";
854
+ } | {
855
+ type: "number";
856
+ } | {
857
+ type: "boolean";
858
+ } | {
859
+ type: "null";
860
+ } | {
861
+ type: "array";
862
+ items?: OutputSchema;
863
+ minItems?: number;
864
+ maxItems?: number;
865
+ } | {
866
+ type: "object";
867
+ properties?: Record<string, OutputSchema>;
868
+ required?: string[];
869
+ additionalProperties?: boolean;
870
+ };
871
+ /**
872
+ * Task response that may include structured intermediate steps.
873
+ * When a task performs multiple logical steps in one invocation, it can
874
+ * return this shape so consumers can inspect the chain (e.g. step 1: to-cni
875
+ * → step 2: engine-enrich → step 3: triage-q1-q6).
876
+ */
877
+ export interface RunTaskResponseWithSteps<TParsed = any> extends RunSkillResponse<TParsed> {
878
+ /** Optional list of steps performed in order; only present for multi-step tasks. */
879
+ intermediateSteps?: IntermediateSteps;
880
+ }
881
+ /**
882
+ * Re-export RunSkillResponse from the package for backward compatibility.
883
+ *
884
+ * This is the response format returned by both runSkill and runTask methods.
885
+ */
886
+ export type { RunSkillResponse } from "@exellix/ai-skills";
887
+ //# sourceMappingURL=task-types.d.ts.map