@probelabs/visor 0.1.183-ee → 0.1.184-ee

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 (241) hide show
  1. package/dist/agent-protocol/task-live-update-slack.d.ts +24 -0
  2. package/dist/agent-protocol/task-live-update-slack.d.ts.map +1 -0
  3. package/dist/agent-protocol/task-live-update-teams.d.ts +25 -0
  4. package/dist/agent-protocol/task-live-update-teams.d.ts.map +1 -0
  5. package/dist/agent-protocol/task-live-update-telegram.d.ts +25 -0
  6. package/dist/agent-protocol/task-live-update-telegram.d.ts.map +1 -0
  7. package/dist/agent-protocol/task-live-updates.d.ts +102 -0
  8. package/dist/agent-protocol/task-live-updates.d.ts.map +1 -0
  9. package/dist/agent-protocol/task-progress-tool.d.ts.map +1 -1
  10. package/dist/agent-protocol/task-trace-resolution.d.ts +11 -0
  11. package/dist/agent-protocol/task-trace-resolution.d.ts.map +1 -0
  12. package/dist/agent-protocol/trace-serializer.d.ts.map +1 -1
  13. package/dist/agent-protocol/track-execution.d.ts +8 -0
  14. package/dist/agent-protocol/track-execution.d.ts.map +1 -1
  15. package/dist/cli-main.d.ts.map +1 -1
  16. package/dist/cli.d.ts.map +1 -1
  17. package/dist/config.d.ts.map +1 -1
  18. package/dist/frontends/slack-frontend.d.ts +2 -0
  19. package/dist/frontends/slack-frontend.d.ts.map +1 -1
  20. package/dist/frontends/teams-frontend.d.ts.map +1 -1
  21. package/dist/frontends/telegram-frontend.d.ts.map +1 -1
  22. package/dist/generated/config-schema.d.ts +110 -6
  23. package/dist/generated/config-schema.d.ts.map +1 -1
  24. package/dist/index.js +2239 -261
  25. package/dist/logger.d.ts +4 -1
  26. package/dist/logger.d.ts.map +1 -1
  27. package/dist/mcp-job-manager.d.ts +70 -0
  28. package/dist/mcp-job-manager.d.ts.map +1 -0
  29. package/dist/mcp-server.d.ts +6 -0
  30. package/dist/mcp-server.d.ts.map +1 -1
  31. package/dist/runners/mcp-server-runner.d.ts +4 -0
  32. package/dist/runners/mcp-server-runner.d.ts.map +1 -1
  33. package/dist/runners/runner-factory.d.ts.map +1 -1
  34. package/dist/sdk/{a2a-frontend-5YDHFQXD.mjs → a2a-frontend-OI4OVSKC.mjs} +4 -4
  35. package/dist/sdk/check-provider-registry-RITJW67U.mjs +32 -0
  36. package/dist/sdk/check-provider-registry-ZZ6N4GDP.mjs +32 -0
  37. package/dist/sdk/{chunk-4BN2XI4X.mjs → chunk-4HIWZA6M.mjs} +2 -2
  38. package/dist/sdk/{chunk-RI4ONH5X.mjs → chunk-4MHHELVZ.mjs} +2 -2
  39. package/dist/sdk/{chunk-J27D43HS.mjs → chunk-4ZLYHSN4.mjs} +2 -2
  40. package/dist/sdk/{chunk-ZPYODGYA.mjs → chunk-6E625R3C.mjs} +19 -4
  41. package/dist/sdk/chunk-6E625R3C.mjs.map +1 -0
  42. package/dist/sdk/{chunk-GA2TYKSR.mjs → chunk-7XKHFRPN.mjs} +4 -4
  43. package/dist/sdk/{chunk-6C3R6E42.mjs → chunk-IY5PQ5EN.mjs} +30 -6
  44. package/dist/sdk/chunk-IY5PQ5EN.mjs.map +1 -0
  45. package/dist/sdk/{chunk-MFXPJUUE.mjs → chunk-PUHU6UY6.mjs} +4 -3
  46. package/dist/sdk/chunk-PUHU6UY6.mjs.map +1 -0
  47. package/dist/sdk/{chunk-XOAEKFKB.mjs → chunk-QLT42TX7.mjs} +2 -2
  48. package/dist/sdk/chunk-SRU5TFNY.mjs +620 -0
  49. package/dist/sdk/chunk-SRU5TFNY.mjs.map +1 -0
  50. package/dist/sdk/{chunk-P2K4VOMU.mjs → chunk-TSX3YS3F.mjs} +3 -3
  51. package/dist/sdk/{chunk-WKLJ57WF.mjs → chunk-UM7LGO2P.mjs} +6 -6
  52. package/dist/sdk/{chunk-7VTZDC2X.mjs → chunk-VPPBOKBQ.mjs} +2 -2
  53. package/dist/sdk/chunk-WZQMTD7W.mjs +33 -0
  54. package/dist/sdk/chunk-WZQMTD7W.mjs.map +1 -0
  55. package/dist/sdk/{chunk-ZOF5QT6U.mjs → chunk-YBXNG75V.mjs} +118 -10
  56. package/dist/sdk/chunk-YBXNG75V.mjs.map +1 -0
  57. package/dist/sdk/{chunk-UXB4XWEE.mjs → chunk-YYFSAAD6.mjs} +53 -51
  58. package/dist/sdk/chunk-YYFSAAD6.mjs.map +1 -0
  59. package/dist/sdk/{chunk-RHKPFJLG.mjs → chunk-ZNKL6ESZ.mjs} +2 -2
  60. package/dist/sdk/{chunk-IDL3AA3G.mjs → chunk-ZYDRR6PZ.mjs} +1150 -403
  61. package/dist/sdk/chunk-ZYDRR6PZ.mjs.map +1 -0
  62. package/dist/sdk/{command-executor-YNJOS77A.mjs → command-executor-LHUW77GR.mjs} +3 -3
  63. package/dist/sdk/{config-PCP6O6Y6.mjs → config-TVU5RWR5.mjs} +3 -3
  64. package/dist/sdk/{dist-3UGGEZB3.mjs → dist-PN5UHL6A.mjs} +429 -429
  65. package/dist/sdk/dist-PN5UHL6A.mjs.map +1 -0
  66. package/dist/sdk/{email-frontend-WSNADJPI.mjs → email-frontend-ECHQCFTR.mjs} +2 -2
  67. package/dist/sdk/{failure-condition-evaluator-IRFKTYZD.mjs → failure-condition-evaluator-USY3ISVA.mjs} +6 -6
  68. package/dist/sdk/{github-auth-BJQBLK2V.mjs → github-auth-UO4DMNCC.mjs} +2 -2
  69. package/dist/sdk/{github-frontend-DECYOBRN.mjs → github-frontend-2T5PWYD5.mjs} +6 -6
  70. package/dist/sdk/{host-CFM2ASDI.mjs → host-OJSMCLKK.mjs} +6 -6
  71. package/dist/sdk/{host-T4LNVU2H.mjs → host-RM6UJEPP.mjs} +7 -7
  72. package/dist/sdk/{knex-store-OEWSZEBY.mjs → knex-store-KCMFAMH5.mjs} +2 -2
  73. package/dist/sdk/{liquid-extensions-E3AKRX7P.mjs → liquid-extensions-KZIRR4OY.mjs} +4 -4
  74. package/dist/sdk/{loader-WRGI244P.mjs → loader-35YWX5UQ.mjs} +4 -4
  75. package/dist/sdk/{memory-store-OHUIXCWJ.mjs → memory-store-3JONK7AF.mjs} +3 -3
  76. package/dist/sdk/{opa-policy-engine-IVMCGVNA.mjs → opa-policy-engine-FY5D45YS.mjs} +2 -2
  77. package/dist/sdk/{prompt-state-LN57DQF3.mjs → prompt-state-VVJMONT3.mjs} +3 -3
  78. package/dist/sdk/{renderer-schema-BT2IXMLW.mjs → renderer-schema-JZRRU5CW.mjs} +2 -2
  79. package/dist/sdk/{routing-H2PQ57OA.mjs → routing-NNQQSLWA.mjs} +8 -8
  80. package/dist/sdk/{schedule-tool-2DPNSU63.mjs → schedule-tool-ADZ2ON4I.mjs} +15 -14
  81. package/dist/sdk/schedule-tool-EMNF3FPQ.mjs +38 -0
  82. package/dist/sdk/{schedule-tool-handler-NBEO46RV.mjs → schedule-tool-handler-3R3IC6VA.mjs} +15 -14
  83. package/dist/sdk/{schedule-tool-handler-KLHE2SOW.mjs → schedule-tool-handler-F76ZD2WU.mjs} +17 -16
  84. package/dist/sdk/sdk.d.mts +40 -0
  85. package/dist/sdk/sdk.d.ts +40 -0
  86. package/dist/sdk/sdk.js +1154 -176
  87. package/dist/sdk/sdk.js.map +1 -1
  88. package/dist/sdk/sdk.mjs +14 -13
  89. package/dist/sdk/sdk.mjs.map +1 -1
  90. package/dist/sdk/{slack-frontend-DF5VL4OF.mjs → slack-frontend-K3TPGERM.mjs} +65 -9
  91. package/dist/sdk/slack-frontend-K3TPGERM.mjs.map +1 -0
  92. package/dist/sdk/{task-evaluator-OVMG7S56.mjs → task-evaluator-H3BXC7SE.mjs} +3 -3
  93. package/dist/sdk/{teams-frontend-DNW5GZP3.mjs → teams-frontend-6RRW533K.mjs} +54 -1
  94. package/dist/sdk/teams-frontend-6RRW533K.mjs.map +1 -0
  95. package/dist/sdk/{telegram-frontend-GA7OLADB.mjs → telegram-frontend-5UA77YAT.mjs} +48 -1
  96. package/dist/sdk/telegram-frontend-5UA77YAT.mjs.map +1 -0
  97. package/dist/sdk/{trace-helpers-26ZCAE2V.mjs → trace-helpers-OMF4C24T.mjs} +3 -3
  98. package/dist/sdk/{trace-serializer-KKBJHM7J.mjs → trace-serializer-EBHTHZYT.mjs} +3 -3
  99. package/dist/sdk/track-execution-3CHMGEPH.mjs +249 -0
  100. package/dist/sdk/track-execution-3CHMGEPH.mjs.map +1 -0
  101. package/dist/sdk/{utcp-check-provider-WI3QZ3W6.mjs → utcp-check-provider-Q4PD5EP2.mjs} +5 -5
  102. package/dist/sdk/workflow-check-provider-TC2G33WF.mjs +32 -0
  103. package/dist/sdk/workflow-check-provider-U4UXZ5YS.mjs +32 -0
  104. package/dist/sdk/{workflow-registry-YCZ3FCJC.mjs → workflow-registry-K56UTX36.mjs} +3 -3
  105. package/dist/slack/client.d.ts +14 -0
  106. package/dist/slack/client.d.ts.map +1 -1
  107. package/dist/slack/socket-runner.d.ts.map +1 -1
  108. package/dist/teams/client.d.ts +16 -0
  109. package/dist/teams/client.d.ts.map +1 -1
  110. package/dist/teams/webhook-runner.d.ts.map +1 -1
  111. package/dist/telegram/client.d.ts +17 -0
  112. package/dist/telegram/client.d.ts.map +1 -1
  113. package/dist/telegram/polling-runner.d.ts.map +1 -1
  114. package/dist/types/cli.d.ts +2 -0
  115. package/dist/types/cli.d.ts.map +1 -1
  116. package/dist/types/config.d.ts +40 -0
  117. package/dist/types/config.d.ts.map +1 -1
  118. package/package.json +4 -3
  119. package/dist/generated/config-schema.json +0 -4027
  120. package/dist/sdk/a2a-frontend-6LWBIPMS.mjs +0 -1734
  121. package/dist/sdk/a2a-frontend-6LWBIPMS.mjs.map +0 -1
  122. package/dist/sdk/check-provider-registry-WSEVHJEV.mjs +0 -31
  123. package/dist/sdk/check-provider-registry-YRADEEQY.mjs +0 -31
  124. package/dist/sdk/chunk-34QX63WK.mjs +0 -244
  125. package/dist/sdk/chunk-34QX63WK.mjs.map +0 -1
  126. package/dist/sdk/chunk-54KOAC4W.mjs +0 -665
  127. package/dist/sdk/chunk-6C3R6E42.mjs.map +0 -1
  128. package/dist/sdk/chunk-7W5QCO4Y.mjs +0 -5943
  129. package/dist/sdk/chunk-7W5QCO4Y.mjs.map +0 -1
  130. package/dist/sdk/chunk-7XRSCOKE.mjs +0 -825
  131. package/dist/sdk/chunk-FT3I25QV.mjs +0 -251
  132. package/dist/sdk/chunk-FT3I25QV.mjs.map +0 -1
  133. package/dist/sdk/chunk-G7GSN3SK.mjs +0 -390
  134. package/dist/sdk/chunk-G7GSN3SK.mjs.map +0 -1
  135. package/dist/sdk/chunk-IDL3AA3G.mjs.map +0 -1
  136. package/dist/sdk/chunk-J27D43HS.mjs.map +0 -1
  137. package/dist/sdk/chunk-MEB2TTIE.mjs +0 -157
  138. package/dist/sdk/chunk-MEB2TTIE.mjs.map +0 -1
  139. package/dist/sdk/chunk-MFXPJUUE.mjs.map +0 -1
  140. package/dist/sdk/chunk-NPSLGKXB.mjs +0 -1502
  141. package/dist/sdk/chunk-P2K4VOMU.mjs.map +0 -1
  142. package/dist/sdk/chunk-PQWZ6NFL.mjs +0 -459
  143. package/dist/sdk/chunk-PQWZ6NFL.mjs.map +0 -1
  144. package/dist/sdk/chunk-S5FSRHMY.mjs +0 -139
  145. package/dist/sdk/chunk-S5FSRHMY.mjs.map +0 -1
  146. package/dist/sdk/chunk-TFUQ2D5L.mjs +0 -307
  147. package/dist/sdk/chunk-TFUQ2D5L.mjs.map +0 -1
  148. package/dist/sdk/chunk-UCMJJ3IM.mjs +0 -227
  149. package/dist/sdk/chunk-UCMJJ3IM.mjs.map +0 -1
  150. package/dist/sdk/chunk-UFHOIB3R.mjs +0 -482
  151. package/dist/sdk/chunk-UFHOIB3R.mjs.map +0 -1
  152. package/dist/sdk/chunk-UXB4XWEE.mjs.map +0 -1
  153. package/dist/sdk/chunk-V45TITKX.mjs +0 -739
  154. package/dist/sdk/chunk-V45TITKX.mjs.map +0 -1
  155. package/dist/sdk/chunk-WKLJ57WF.mjs.map +0 -1
  156. package/dist/sdk/chunk-ZOF5QT6U.mjs.map +0 -1
  157. package/dist/sdk/chunk-ZPYODGYA.mjs.map +0 -1
  158. package/dist/sdk/command-executor-3AHGIYQG.mjs +0 -14
  159. package/dist/sdk/config-JE4HKTWW.mjs +0 -16
  160. package/dist/sdk/dist-3UGGEZB3.mjs.map +0 -1
  161. package/dist/sdk/failure-condition-evaluator-H3PBFBYT.mjs +0 -18
  162. package/dist/sdk/github-auth-27SZGPEC.mjs +0 -196
  163. package/dist/sdk/github-auth-BJQBLK2V.mjs.map +0 -1
  164. package/dist/sdk/github-frontend-TZRBOQCN.mjs +0 -1394
  165. package/dist/sdk/github-frontend-TZRBOQCN.mjs.map +0 -1
  166. package/dist/sdk/lazy-otel-5NH4ZJJM.mjs +0 -24
  167. package/dist/sdk/liquid-extensions-P6KDYILF.mjs +0 -25
  168. package/dist/sdk/memory-store-K5N7MC7U.mjs +0 -12
  169. package/dist/sdk/metrics-JTOG2HNO.mjs +0 -41
  170. package/dist/sdk/prompt-state-YPICX7PI.mjs +0 -16
  171. package/dist/sdk/renderer-schema-KOIH75RZ.mjs +0 -51
  172. package/dist/sdk/renderer-schema-KOIH75RZ.mjs.map +0 -1
  173. package/dist/sdk/routing-JMZ7HDCC.mjs +0 -26
  174. package/dist/sdk/schedule-tool-4M45RK3E.mjs +0 -37
  175. package/dist/sdk/schedule-tool-4M45RK3E.mjs.map +0 -1
  176. package/dist/sdk/schedule-tool-handler-KLHE2SOW.mjs.map +0 -1
  177. package/dist/sdk/schedule-tool-handler-NBEO46RV.mjs.map +0 -1
  178. package/dist/sdk/slack-frontend-BPWXNIHE.mjs +0 -929
  179. package/dist/sdk/slack-frontend-BPWXNIHE.mjs.map +0 -1
  180. package/dist/sdk/slack-frontend-DF5VL4OF.mjs.map +0 -1
  181. package/dist/sdk/task-evaluator-GQYDOSGT.mjs +0 -1392
  182. package/dist/sdk/task-evaluator-GQYDOSGT.mjs.map +0 -1
  183. package/dist/sdk/teams-frontend-DNW5GZP3.mjs.map +0 -1
  184. package/dist/sdk/telegram-frontend-GA7OLADB.mjs.map +0 -1
  185. package/dist/sdk/trace-helpers-26ZCAE2V.mjs.map +0 -1
  186. package/dist/sdk/trace-helpers-XV5GAX5L.mjs +0 -29
  187. package/dist/sdk/trace-helpers-XV5GAX5L.mjs.map +0 -1
  188. package/dist/sdk/trace-serializer-KKBJHM7J.mjs.map +0 -1
  189. package/dist/sdk/track-execution-3EC24C2X.mjs +0 -163
  190. package/dist/sdk/track-execution-3EC24C2X.mjs.map +0 -1
  191. package/dist/sdk/track-execution-66RLL6QT.mjs +0 -143
  192. package/dist/sdk/track-execution-66RLL6QT.mjs.map +0 -1
  193. package/dist/sdk/utcp-check-provider-JLIYF5HH.mjs +0 -16
  194. package/dist/sdk/utcp-check-provider-JLIYF5HH.mjs.map +0 -1
  195. package/dist/sdk/utcp-check-provider-WI3QZ3W6.mjs.map +0 -1
  196. package/dist/sdk/workflow-check-provider-X2UREEH7.mjs +0 -31
  197. package/dist/sdk/workflow-check-provider-X2UREEH7.mjs.map +0 -1
  198. package/dist/sdk/workflow-check-provider-YXALZNAQ.mjs +0 -31
  199. package/dist/sdk/workflow-check-provider-YXALZNAQ.mjs.map +0 -1
  200. package/dist/sdk/workflow-registry-X2IPY35M.mjs +0 -12
  201. package/dist/sdk/workflow-registry-X2IPY35M.mjs.map +0 -1
  202. package/dist/sdk/workflow-registry-YCZ3FCJC.mjs.map +0 -1
  203. /package/dist/sdk/{a2a-frontend-5YDHFQXD.mjs.map → a2a-frontend-OI4OVSKC.mjs.map} +0 -0
  204. /package/dist/sdk/{check-provider-registry-WSEVHJEV.mjs.map → check-provider-registry-RITJW67U.mjs.map} +0 -0
  205. /package/dist/sdk/{check-provider-registry-YRADEEQY.mjs.map → check-provider-registry-ZZ6N4GDP.mjs.map} +0 -0
  206. /package/dist/sdk/{chunk-4BN2XI4X.mjs.map → chunk-4HIWZA6M.mjs.map} +0 -0
  207. /package/dist/sdk/{chunk-RI4ONH5X.mjs.map → chunk-4MHHELVZ.mjs.map} +0 -0
  208. /package/dist/sdk/{chunk-54KOAC4W.mjs.map → chunk-4ZLYHSN4.mjs.map} +0 -0
  209. /package/dist/sdk/{chunk-GA2TYKSR.mjs.map → chunk-7XKHFRPN.mjs.map} +0 -0
  210. /package/dist/sdk/{chunk-XOAEKFKB.mjs.map → chunk-QLT42TX7.mjs.map} +0 -0
  211. /package/dist/sdk/{chunk-7XRSCOKE.mjs.map → chunk-TSX3YS3F.mjs.map} +0 -0
  212. /package/dist/sdk/{chunk-NPSLGKXB.mjs.map → chunk-UM7LGO2P.mjs.map} +0 -0
  213. /package/dist/sdk/{chunk-7VTZDC2X.mjs.map → chunk-VPPBOKBQ.mjs.map} +0 -0
  214. /package/dist/sdk/{chunk-RHKPFJLG.mjs.map → chunk-ZNKL6ESZ.mjs.map} +0 -0
  215. /package/dist/sdk/{command-executor-3AHGIYQG.mjs.map → command-executor-LHUW77GR.mjs.map} +0 -0
  216. /package/dist/sdk/{command-executor-YNJOS77A.mjs.map → config-TVU5RWR5.mjs.map} +0 -0
  217. /package/dist/sdk/{email-frontend-WSNADJPI.mjs.map → email-frontend-ECHQCFTR.mjs.map} +0 -0
  218. /package/dist/sdk/{config-JE4HKTWW.mjs.map → failure-condition-evaluator-USY3ISVA.mjs.map} +0 -0
  219. /package/dist/sdk/{github-auth-27SZGPEC.mjs.map → github-auth-UO4DMNCC.mjs.map} +0 -0
  220. /package/dist/sdk/{github-frontend-DECYOBRN.mjs.map → github-frontend-2T5PWYD5.mjs.map} +0 -0
  221. /package/dist/sdk/{host-CFM2ASDI.mjs.map → host-OJSMCLKK.mjs.map} +0 -0
  222. /package/dist/sdk/{host-T4LNVU2H.mjs.map → host-RM6UJEPP.mjs.map} +0 -0
  223. /package/dist/sdk/{knex-store-OEWSZEBY.mjs.map → knex-store-KCMFAMH5.mjs.map} +0 -0
  224. /package/dist/sdk/{config-PCP6O6Y6.mjs.map → liquid-extensions-KZIRR4OY.mjs.map} +0 -0
  225. /package/dist/sdk/{loader-WRGI244P.mjs.map → loader-35YWX5UQ.mjs.map} +0 -0
  226. /package/dist/sdk/{failure-condition-evaluator-H3PBFBYT.mjs.map → memory-store-3JONK7AF.mjs.map} +0 -0
  227. /package/dist/sdk/{opa-policy-engine-IVMCGVNA.mjs.map → opa-policy-engine-FY5D45YS.mjs.map} +0 -0
  228. /package/dist/sdk/{failure-condition-evaluator-IRFKTYZD.mjs.map → prompt-state-VVJMONT3.mjs.map} +0 -0
  229. /package/dist/sdk/{renderer-schema-BT2IXMLW.mjs.map → renderer-schema-JZRRU5CW.mjs.map} +0 -0
  230. /package/dist/sdk/{lazy-otel-5NH4ZJJM.mjs.map → routing-NNQQSLWA.mjs.map} +0 -0
  231. /package/dist/sdk/{liquid-extensions-E3AKRX7P.mjs.map → schedule-tool-ADZ2ON4I.mjs.map} +0 -0
  232. /package/dist/sdk/{liquid-extensions-P6KDYILF.mjs.map → schedule-tool-EMNF3FPQ.mjs.map} +0 -0
  233. /package/dist/sdk/{memory-store-K5N7MC7U.mjs.map → schedule-tool-handler-3R3IC6VA.mjs.map} +0 -0
  234. /package/dist/sdk/{memory-store-OHUIXCWJ.mjs.map → schedule-tool-handler-F76ZD2WU.mjs.map} +0 -0
  235. /package/dist/sdk/{task-evaluator-OVMG7S56.mjs.map → task-evaluator-H3BXC7SE.mjs.map} +0 -0
  236. /package/dist/sdk/{metrics-JTOG2HNO.mjs.map → trace-helpers-OMF4C24T.mjs.map} +0 -0
  237. /package/dist/sdk/{prompt-state-LN57DQF3.mjs.map → trace-serializer-EBHTHZYT.mjs.map} +0 -0
  238. /package/dist/sdk/{prompt-state-YPICX7PI.mjs.map → utcp-check-provider-Q4PD5EP2.mjs.map} +0 -0
  239. /package/dist/sdk/{routing-H2PQ57OA.mjs.map → workflow-check-provider-TC2G33WF.mjs.map} +0 -0
  240. /package/dist/sdk/{routing-JMZ7HDCC.mjs.map → workflow-check-provider-U4UXZ5YS.mjs.map} +0 -0
  241. /package/dist/sdk/{schedule-tool-2DPNSU63.mjs.map → workflow-registry-K56UTX36.mjs.map} +0 -0
@@ -1,825 +0,0 @@
1
- import {
2
- createExtendedLiquid,
3
- init_liquid_extensions
4
- } from "./chunk-PQWZ6NFL.mjs";
5
- import {
6
- compileAndRun,
7
- createSecureSandbox,
8
- init_sandbox
9
- } from "./chunk-LW3INISN.mjs";
10
- import {
11
- init_logger,
12
- logger
13
- } from "./chunk-FT3I25QV.mjs";
14
- import {
15
- __esm,
16
- __export,
17
- __toCommonJS
18
- } from "./chunk-J7LXIPZS.mjs";
19
-
20
- // src/providers/check-provider.interface.ts
21
- var CheckProvider;
22
- var init_check_provider_interface = __esm({
23
- "src/providers/check-provider.interface.ts"() {
24
- "use strict";
25
- CheckProvider = class {
26
- };
27
- }
28
- });
29
-
30
- // src/utils/env-resolver.ts
31
- var EnvironmentResolver;
32
- var init_env_resolver = __esm({
33
- "src/utils/env-resolver.ts"() {
34
- "use strict";
35
- EnvironmentResolver = class {
36
- /**
37
- * Resolves a single configuration value that may contain environment variable references
38
- */
39
- static resolveValue(value) {
40
- if (typeof value !== "string") {
41
- return value;
42
- }
43
- let resolved = value.replace(/\$\{\{\s*env\.([A-Z_][A-Z0-9_]*)\s*\}\}/g, (match, envVar) => {
44
- return process.env[envVar] || match;
45
- });
46
- resolved = resolved.replace(/\$\{([A-Z_][A-Z0-9_]*)\}/g, (match, envVar) => {
47
- return process.env[envVar] || match;
48
- });
49
- resolved = resolved.replace(/\$([A-Z_][A-Z0-9_]*)/g, (match, envVar) => {
50
- return process.env[envVar] || match;
51
- });
52
- return resolved;
53
- }
54
- /**
55
- * Resolves all environment variables in an EnvConfig object
56
- */
57
- static resolveEnvConfig(envConfig) {
58
- const resolved = {};
59
- for (const [key, value] of Object.entries(envConfig)) {
60
- resolved[key] = this.resolveValue(value);
61
- }
62
- return resolved;
63
- }
64
- /**
65
- * Applies environment configuration to the process environment
66
- * This allows checks to access their specific environment variables
67
- */
68
- static applyEnvConfig(envConfig) {
69
- const resolved = this.resolveEnvConfig(envConfig);
70
- for (const [key, value] of Object.entries(resolved)) {
71
- if (value !== void 0) {
72
- process.env[key] = String(value);
73
- }
74
- }
75
- }
76
- /**
77
- * Creates a temporary environment for a specific check execution
78
- * Returns a cleanup function to restore the original environment
79
- */
80
- static withTemporaryEnv(envConfig, callback) {
81
- const resolved = this.resolveEnvConfig(envConfig);
82
- const originalValues = {};
83
- for (const [key, value] of Object.entries(resolved)) {
84
- originalValues[key] = process.env[key];
85
- if (value !== void 0) {
86
- process.env[key] = String(value);
87
- }
88
- }
89
- try {
90
- const result = callback();
91
- if (result instanceof Promise) {
92
- return result.finally(() => {
93
- for (const [key, originalValue] of Object.entries(originalValues)) {
94
- if (originalValue === void 0) {
95
- delete process.env[key];
96
- } else {
97
- process.env[key] = originalValue;
98
- }
99
- }
100
- });
101
- }
102
- for (const [key, originalValue] of Object.entries(originalValues)) {
103
- if (originalValue === void 0) {
104
- delete process.env[key];
105
- } else {
106
- process.env[key] = originalValue;
107
- }
108
- }
109
- return result;
110
- } catch (error) {
111
- for (const [key, originalValue] of Object.entries(originalValues)) {
112
- if (originalValue === void 0) {
113
- delete process.env[key];
114
- } else {
115
- process.env[key] = originalValue;
116
- }
117
- }
118
- throw error;
119
- }
120
- }
121
- /**
122
- * Validates that all required environment variables are available
123
- */
124
- static validateRequiredEnvVars(envConfig, requiredVars) {
125
- const resolved = this.resolveEnvConfig(envConfig);
126
- const missing = [];
127
- for (const varName of requiredVars) {
128
- const value = resolved[varName] || process.env[varName];
129
- if (!value) {
130
- missing.push(varName);
131
- }
132
- }
133
- return missing;
134
- }
135
- /**
136
- * Resolves environment variables in HTTP headers
137
- * Each header value is processed through resolveValue to replace env var references
138
- */
139
- static resolveHeaders(headers) {
140
- const resolved = {};
141
- for (const [key, value] of Object.entries(headers)) {
142
- resolved[key] = String(this.resolveValue(value));
143
- }
144
- return resolved;
145
- }
146
- /**
147
- * Sanitizes headers for logging/telemetry by redacting sensitive values
148
- * Headers like Authorization, API keys, and cookies are replaced with [REDACTED]
149
- */
150
- static sanitizeHeaders(headers) {
151
- const sensitiveHeaders = ["authorization", "x-api-key", "cookie", "set-cookie"];
152
- const sanitized = {};
153
- for (const [key, value] of Object.entries(headers)) {
154
- if (sensitiveHeaders.includes(key.toLowerCase())) {
155
- sanitized[key] = "[REDACTED]";
156
- } else {
157
- sanitized[key] = value;
158
- }
159
- }
160
- return sanitized;
161
- }
162
- };
163
- }
164
- });
165
-
166
- // src/utils/issue-normalizer.ts
167
- function extractIssuesFromOutput(output, defaultRuleId) {
168
- if (output === null || output === void 0) {
169
- return null;
170
- }
171
- if (typeof output === "string") {
172
- try {
173
- const parsed = JSON.parse(output);
174
- return extractIssuesFromOutput(parsed, defaultRuleId);
175
- } catch {
176
- return null;
177
- }
178
- }
179
- if (Array.isArray(output)) {
180
- const issues = normalizeIssueArray(output, defaultRuleId);
181
- if (issues) {
182
- return { issues, remainingOutput: void 0 };
183
- }
184
- return null;
185
- }
186
- if (typeof output === "object") {
187
- const record = output;
188
- if (Array.isArray(record.issues)) {
189
- const issues = normalizeIssueArray(record.issues, defaultRuleId);
190
- if (!issues) {
191
- return null;
192
- }
193
- const remaining = { ...record };
194
- delete remaining.issues;
195
- return {
196
- issues,
197
- remainingOutput: Object.keys(remaining).length > 0 ? remaining : void 0
198
- };
199
- }
200
- const singleIssue = normalizeIssue(record, defaultRuleId);
201
- if (singleIssue) {
202
- return { issues: [singleIssue], remainingOutput: void 0 };
203
- }
204
- }
205
- return null;
206
- }
207
- function normalizeIssueArray(values, defaultRuleId) {
208
- const normalized = [];
209
- for (const value of values) {
210
- const issue = normalizeIssue(value, defaultRuleId);
211
- if (!issue) {
212
- return null;
213
- }
214
- normalized.push(issue);
215
- }
216
- return normalized;
217
- }
218
- function normalizeIssue(raw, defaultRuleId = "tool") {
219
- if (!raw || typeof raw !== "object") {
220
- return null;
221
- }
222
- const data = raw;
223
- const rawMessage = data.message || data.text || data.description || data.summary;
224
- if (typeof rawMessage !== "string") {
225
- return null;
226
- }
227
- const message = rawMessage.trim();
228
- if (!message) {
229
- return null;
230
- }
231
- const allowedSeverities = /* @__PURE__ */ new Set(["info", "warning", "error", "critical"]);
232
- const severityRaw = toTrimmedString(data.severity || data.level || data.priority);
233
- let severity = "warning";
234
- if (severityRaw) {
235
- const lower = severityRaw.toLowerCase();
236
- if (allowedSeverities.has(lower)) {
237
- severity = lower;
238
- }
239
- }
240
- const allowedCategories = /* @__PURE__ */ new Set(["security", "performance", "style", "logic", "documentation"]);
241
- const categoryRaw = toTrimmedString(data.category || data.type || data.group);
242
- let category = "logic";
243
- if (categoryRaw && allowedCategories.has(categoryRaw.toLowerCase())) {
244
- category = categoryRaw.toLowerCase();
245
- }
246
- const file = toTrimmedString(data.file || data.path || data.filename) || "system";
247
- const line = toNumber(data.line || data.startLine || data.lineNumber) ?? 0;
248
- const endLine = toNumber(data.endLine || data.end_line || data.stopLine);
249
- const suggestion = toTrimmedString(data.suggestion);
250
- const replacement = toTrimmedString(data.replacement);
251
- const ruleId = toTrimmedString(data.ruleId || data.rule || data.id || data.check) || defaultRuleId;
252
- return {
253
- file,
254
- line,
255
- endLine: endLine ?? void 0,
256
- ruleId,
257
- message,
258
- severity,
259
- category,
260
- suggestion: suggestion || void 0,
261
- replacement: replacement || void 0
262
- };
263
- }
264
- function toTrimmedString(value) {
265
- if (typeof value === "string") {
266
- const trimmed = value.trim();
267
- return trimmed.length > 0 ? trimmed : null;
268
- }
269
- if (value !== null && value !== void 0 && typeof value.toString === "function") {
270
- const converted = String(value).trim();
271
- return converted.length > 0 ? converted : null;
272
- }
273
- return null;
274
- }
275
- function toNumber(value) {
276
- if (value === null || value === void 0) {
277
- return null;
278
- }
279
- const num = Number(value);
280
- if (Number.isFinite(num)) {
281
- return Math.trunc(num);
282
- }
283
- return null;
284
- }
285
- var init_issue_normalizer = __esm({
286
- "src/utils/issue-normalizer.ts"() {
287
- "use strict";
288
- }
289
- });
290
-
291
- // src/utils/env-exposure.ts
292
- var env_exposure_exports = {};
293
- __export(env_exposure_exports, {
294
- buildSandboxEnv: () => buildSandboxEnv
295
- });
296
- function buildSandboxEnv(input) {
297
- const denyDefaults = [
298
- "GITHUB_TOKEN",
299
- "INPUT_GITHUB-TOKEN",
300
- "ACTIONS_RUNTIME_TOKEN",
301
- "ACTIONS_ID_TOKEN_REQUEST_TOKEN",
302
- "AWS_ACCESS_KEY_ID",
303
- "AWS_SECRET_ACCESS_KEY",
304
- "AWS_SESSION_TOKEN",
305
- "AZURE_CLIENT_SECRET",
306
- "GOOGLE_APPLICATION_CREDENTIALS",
307
- "OPENAI_API_KEY",
308
- "ANTHROPIC_API_KEY",
309
- "HUGGINGFACE_API_KEY",
310
- "CLAUDE_CODE_API_KEY",
311
- "PROBE_API_KEY"
312
- ];
313
- const denyExtra = (input.VISOR_DENY_ENV || "").split(",").map((s) => s.trim()).filter(Boolean);
314
- const deny = Array.from(/* @__PURE__ */ new Set([...denyDefaults, ...denyExtra]));
315
- const allowSpec = (input.VISOR_ALLOW_ENV || "*").trim();
316
- const denyMatch = (key) => {
317
- for (const pat of deny) {
318
- if (!pat) continue;
319
- if (pat.endsWith("*")) {
320
- const prefix = pat.slice(0, -1);
321
- if (key.startsWith(prefix)) return true;
322
- } else if (key === pat) {
323
- return true;
324
- }
325
- }
326
- if (/(_TOKEN|_SECRET|_PASSWORD|_PRIVATE_KEY)$/i.test(key)) return true;
327
- return false;
328
- };
329
- const out = {};
330
- if (allowSpec !== "*") {
331
- const allow = allowSpec.split(",").map((s) => s.trim()).filter(Boolean);
332
- for (const key of allow) {
333
- const val = input[key];
334
- if (key && val !== void 0 && !denyMatch(key)) out[key] = String(val);
335
- }
336
- return out;
337
- }
338
- for (const [k, v] of Object.entries(input)) {
339
- if (v === void 0 || v === null) continue;
340
- if (denyMatch(k)) continue;
341
- out[k] = String(v);
342
- }
343
- return out;
344
- }
345
- var init_env_exposure = __esm({
346
- "src/utils/env-exposure.ts"() {
347
- "use strict";
348
- }
349
- });
350
-
351
- // src/providers/utcp-check-provider.ts
352
- import * as fs from "fs";
353
- import * as path from "path";
354
- var UtcpCheckProvider;
355
- var init_utcp_check_provider = __esm({
356
- "src/providers/utcp-check-provider.ts"() {
357
- init_check_provider_interface();
358
- init_logger();
359
- init_liquid_extensions();
360
- init_sandbox();
361
- init_env_resolver();
362
- init_issue_normalizer();
363
- UtcpCheckProvider = class _UtcpCheckProvider extends CheckProvider {
364
- liquid;
365
- sandbox;
366
- sdkAvailable = null;
367
- constructor() {
368
- super();
369
- this.liquid = createExtendedLiquid({
370
- cache: false,
371
- strictFilters: false,
372
- strictVariables: false
373
- });
374
- }
375
- getName() {
376
- return "utcp";
377
- }
378
- getDescription() {
379
- return "Call UTCP tools directly using their native protocols (HTTP, CLI, SSE)";
380
- }
381
- async validateConfig(config) {
382
- if (!config || typeof config !== "object") {
383
- return false;
384
- }
385
- const cfg = config;
386
- if (cfg.type !== "utcp") {
387
- return false;
388
- }
389
- if (!cfg.manual) {
390
- logger.error("UTCP check requires a manual (URL, file path, or inline call template)");
391
- return false;
392
- }
393
- if (!cfg.method || typeof cfg.method !== "string") {
394
- logger.error("UTCP check requires a method name");
395
- return false;
396
- }
397
- if (typeof cfg.manual === "string") {
398
- if (cfg.manual.startsWith("http://") || cfg.manual.startsWith("https://")) {
399
- try {
400
- const parsedUrl = new URL(cfg.manual);
401
- if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") {
402
- logger.error(`Invalid URL protocol for UTCP manual: ${parsedUrl.protocol}`);
403
- return false;
404
- }
405
- } catch {
406
- logger.error(`Invalid URL format for UTCP manual: ${cfg.manual}`);
407
- return false;
408
- }
409
- }
410
- } else if (typeof cfg.manual === "object") {
411
- if (!cfg.manual.call_template_type) {
412
- logger.error("Inline UTCP manual must have call_template_type");
413
- return false;
414
- }
415
- } else {
416
- logger.error("UTCP manual must be a URL string, file path, or inline call template object");
417
- return false;
418
- }
419
- return true;
420
- }
421
- async execute(prInfo, config, dependencyResults, sessionInfo) {
422
- const cfg = config;
423
- try {
424
- const stepName = config.checkName || "unknown";
425
- const mock = sessionInfo?.hooks?.mockForStep?.(String(stepName));
426
- if (mock !== void 0) {
427
- const ms = mock;
428
- const issuesArr = Array.isArray(ms?.issues) ? ms.issues : [];
429
- const out = ms && typeof ms === "object" && "output" in ms ? ms.output : ms;
430
- return {
431
- issues: issuesArr,
432
- ...out !== void 0 ? { output: out } : {}
433
- };
434
- }
435
- } catch {
436
- }
437
- try {
438
- const templateContext = {
439
- pr: {
440
- number: prInfo.number,
441
- title: prInfo.title,
442
- author: prInfo.author,
443
- branch: prInfo.head,
444
- base: prInfo.base
445
- },
446
- files: prInfo.files,
447
- fileCount: prInfo.files.length,
448
- outputs: this.buildOutputContext(dependencyResults),
449
- args: sessionInfo?.args || {},
450
- env: this.getSafeEnvironmentVariables(),
451
- inputs: config.workflowInputs || sessionInfo?.workflowInputs || {}
452
- };
453
- let methodArgs = cfg.methodArgs || {};
454
- if (cfg.argsTransform) {
455
- const rendered = await this.liquid.parseAndRender(cfg.argsTransform, templateContext);
456
- try {
457
- methodArgs = JSON.parse(rendered);
458
- } catch (error) {
459
- logger.error(`Failed to parse argsTransform as JSON: ${error}`);
460
- return {
461
- issues: [
462
- {
463
- file: "utcp",
464
- line: 0,
465
- ruleId: "utcp/args_transform_error",
466
- message: `Failed to parse argsTransform: ${error instanceof Error ? error.message : "Unknown error"}`,
467
- severity: "error",
468
- category: "logic"
469
- }
470
- ]
471
- };
472
- }
473
- } else if (methodArgs && typeof methodArgs === "object") {
474
- const renderValue = async (val) => {
475
- if (typeof val === "string" && (val.includes("{{") || val.includes("{%"))) {
476
- return await this.liquid.parseAndRender(val, templateContext);
477
- } else if (val && typeof val === "object" && !Array.isArray(val)) {
478
- const rendered = {};
479
- for (const [k, v] of Object.entries(val)) {
480
- rendered[k] = await renderValue(v);
481
- }
482
- return rendered;
483
- } else if (Array.isArray(val)) {
484
- return Promise.all(val.map((item) => renderValue(item)));
485
- }
486
- return val;
487
- };
488
- methodArgs = await renderValue(methodArgs);
489
- }
490
- const resolvedVariables = {};
491
- if (cfg.variables) {
492
- for (const [key, value] of Object.entries(cfg.variables)) {
493
- resolvedVariables[key] = String(EnvironmentResolver.resolveValue(value));
494
- }
495
- }
496
- const result = await _UtcpCheckProvider.callTool(cfg.manual, cfg.method, methodArgs, {
497
- variables: resolvedVariables,
498
- plugins: cfg.plugins || ["http"],
499
- timeoutMs: (cfg.timeout || 60) * 1e3
500
- });
501
- {
502
- let finalOutput = result;
503
- if (cfg.transform) {
504
- try {
505
- const transformContext = {
506
- ...templateContext,
507
- output: result
508
- };
509
- const rendered = await this.liquid.parseAndRender(cfg.transform, transformContext);
510
- try {
511
- finalOutput = JSON.parse(rendered.trim());
512
- } catch {
513
- finalOutput = rendered.trim();
514
- }
515
- } catch (error) {
516
- logger.error(`Failed to apply Liquid transform: ${error}`);
517
- throw new Error(
518
- `Failed to apply transform: ${error instanceof Error ? error.message : "Unknown error"}`
519
- );
520
- }
521
- }
522
- if (cfg.transform_js) {
523
- try {
524
- this.sandbox = createSecureSandbox();
525
- const scope = {
526
- output: finalOutput,
527
- pr: templateContext.pr,
528
- files: templateContext.files,
529
- outputs: templateContext.outputs,
530
- env: templateContext.env
531
- };
532
- finalOutput = compileAndRun(
533
- this.sandbox,
534
- `return (${cfg.transform_js});`,
535
- scope,
536
- { injectLog: true, wrapFunction: false, logPrefix: "[utcp:transform_js]" }
537
- );
538
- } catch (error) {
539
- logger.error(`Failed to apply JavaScript transform: ${error}`);
540
- throw new Error(
541
- `Failed to apply JavaScript transform: ${error instanceof Error ? error.message : "Unknown error"}`
542
- );
543
- }
544
- }
545
- const extracted = extractIssuesFromOutput(finalOutput, "utcp");
546
- if (extracted) {
547
- return {
548
- issues: extracted.issues,
549
- ...extracted.remainingOutput ? { output: extracted.remainingOutput } : {}
550
- };
551
- }
552
- return {
553
- issues: [],
554
- ...finalOutput ? { output: finalOutput } : {}
555
- };
556
- }
557
- } catch (error) {
558
- const errorMessage = error instanceof Error ? error.message : "Unknown error";
559
- const isTimeout = this.isTimeoutError(error);
560
- const severity = isTimeout ? "warning" : "error";
561
- const ruleId = isTimeout ? "utcp/timeout" : "utcp/execution_error";
562
- if (isTimeout) {
563
- logger.warn(`UTCP check timed out: ${errorMessage}`);
564
- } else {
565
- logger.error(`UTCP check failed: ${errorMessage}`);
566
- }
567
- return {
568
- issues: [
569
- {
570
- file: "utcp",
571
- line: 0,
572
- ruleId,
573
- message: isTimeout ? `UTCP check timed out: ${errorMessage}` : `UTCP check failed: ${errorMessage}`,
574
- severity,
575
- category: "logic"
576
- }
577
- ]
578
- };
579
- }
580
- }
581
- /**
582
- * Resolve manual config to a UTCP call template object.
583
- * Shared utility used by both the standalone UTCP provider and the AI check provider's UTCP-to-MCP bridge.
584
- */
585
- static async resolveManualCallTemplate(manual) {
586
- if (typeof manual === "object") {
587
- if (!manual.call_template_type) {
588
- throw new Error("Inline manual must have call_template_type");
589
- }
590
- if (!manual.name) {
591
- manual.name = "inline";
592
- }
593
- return manual;
594
- }
595
- if (manual.startsWith("http://") || manual.startsWith("https://")) {
596
- return {
597
- name: _UtcpCheckProvider.deriveManualName(manual),
598
- call_template_type: "http",
599
- url: manual,
600
- http_method: "GET"
601
- };
602
- }
603
- if (manual.includes("\0")) {
604
- throw new Error("Invalid UTCP manual path: null bytes are not allowed");
605
- }
606
- const resolvedPath = path.resolve(manual);
607
- const cwd = path.resolve(process.cwd());
608
- const normalizedResolved = path.normalize(resolvedPath);
609
- const cwdPrefix = cwd.endsWith(path.sep) ? cwd : cwd + path.sep;
610
- if (normalizedResolved !== cwd && !normalizedResolved.startsWith(cwdPrefix)) {
611
- throw new Error(
612
- `Path traversal detected: "${manual}" resolves outside the project directory. UTCP manual paths must be within the project directory.`
613
- );
614
- }
615
- if (fs.existsSync(resolvedPath)) {
616
- const realPath = fs.realpathSync(resolvedPath);
617
- if (realPath !== cwd && !realPath.startsWith(cwdPrefix)) {
618
- throw new Error(
619
- `Symlink traversal detected: "${manual}" points outside the project directory via symlink.`
620
- );
621
- }
622
- }
623
- if (!fs.existsSync(resolvedPath)) {
624
- throw new Error(`UTCP manual file not found: ${resolvedPath}`);
625
- }
626
- let content;
627
- try {
628
- content = fs.readFileSync(resolvedPath, "utf-8");
629
- } catch (err) {
630
- throw new Error(
631
- `Failed to read UTCP manual file: ${resolvedPath}: ${err instanceof Error ? err.message : "Unknown error"}`
632
- );
633
- }
634
- let parsed;
635
- try {
636
- parsed = JSON.parse(content);
637
- } catch (err) {
638
- throw new Error(
639
- `Failed to parse UTCP manual file as JSON: ${resolvedPath}: ${err instanceof Error ? err.message : "Unknown error"}`
640
- );
641
- }
642
- if (parsed.call_template_type) {
643
- if (!parsed.name) {
644
- parsed.name = path.basename(resolvedPath, path.extname(resolvedPath));
645
- }
646
- return parsed;
647
- }
648
- try {
649
- await import("@utcp/file");
650
- } catch {
651
- logger.debug("UTCP @utcp/file plugin not available, attempting direct parse");
652
- }
653
- return {
654
- name: parsed.name || path.basename(resolvedPath, path.extname(resolvedPath)),
655
- call_template_type: "file",
656
- file_path: resolvedPath,
657
- allowed_communication_protocols: ["file", "http", "https"]
658
- };
659
- }
660
- /**
661
- * Derive a manual name from a URL.
662
- * Shared utility for UTCP manual name derivation.
663
- */
664
- static deriveManualName(url) {
665
- try {
666
- const parsed = new URL(url);
667
- return parsed.hostname.replace(/\./g, "_").replace(/-/g, "_");
668
- } catch {
669
- return "utcp_manual";
670
- }
671
- }
672
- /**
673
- * Call a UTCP tool directly. Shared by both the standalone provider and the MCP-bridge SSE server.
674
- * Handles SDK import, plugin loading, client creation, tool calling, and cleanup.
675
- */
676
- static async callTool(manual, toolName, args, options) {
677
- const variables = options?.variables || {};
678
- const plugins = options?.plugins || ["http"];
679
- const timeoutMs = options?.timeoutMs || 6e4;
680
- const { UtcpClient } = await import("@utcp/sdk");
681
- for (const plugin of plugins) {
682
- try {
683
- await import(`@utcp/${plugin}`);
684
- } catch {
685
- logger.debug(`UTCP plugin @utcp/${plugin} not available`);
686
- }
687
- }
688
- const callTemplate = await _UtcpCheckProvider.resolveManualCallTemplate(manual);
689
- const client = await UtcpClient.create(process.cwd(), {
690
- manual_call_templates: [callTemplate],
691
- variables
692
- });
693
- try {
694
- let resolvedToolName = toolName;
695
- try {
696
- const tools = await client.getTools();
697
- const toolNames = tools.map((t) => t.name);
698
- logger.debug(`UTCP tools available: ${JSON.stringify(toolNames)}`);
699
- if (!toolNames.includes(resolvedToolName)) {
700
- const suffixMatch = toolNames.find(
701
- (name) => name.endsWith(`.${resolvedToolName}`)
702
- );
703
- if (suffixMatch) {
704
- logger.debug(
705
- `UTCP method '${resolvedToolName}' resolved to '${suffixMatch}' via suffix match`
706
- );
707
- resolvedToolName = suffixMatch;
708
- }
709
- }
710
- } catch (err) {
711
- logger.debug(`Failed to list UTCP tools for name resolution: ${err}`);
712
- }
713
- let timer;
714
- const result = await Promise.race([
715
- client.callTool(resolvedToolName, args),
716
- new Promise((_, reject) => {
717
- timer = setTimeout(
718
- () => reject(new Error(`UTCP tool '${toolName}' timed out after ${timeoutMs}ms`)),
719
- timeoutMs
720
- );
721
- })
722
- ]).finally(() => clearTimeout(timer));
723
- return result;
724
- } finally {
725
- try {
726
- if (typeof client.close === "function") {
727
- await client.close();
728
- }
729
- } catch {
730
- }
731
- }
732
- }
733
- /**
734
- * Check if an error is a timeout error
735
- */
736
- isTimeoutError(error) {
737
- const err = error;
738
- const message = typeof err?.message === "string" ? err.message.toLowerCase() : "";
739
- const code = typeof err?.code === "string" ? err.code.toLowerCase() : "";
740
- return message.includes("timeout") || message.includes("timed out") || code.includes("timeout");
741
- }
742
- /**
743
- * Build output context from dependency results
744
- */
745
- buildOutputContext(dependencyResults) {
746
- if (!dependencyResults) {
747
- return {};
748
- }
749
- const outputs = {};
750
- for (const [checkName, result] of dependencyResults) {
751
- const summary = result;
752
- outputs[checkName] = summary.output !== void 0 ? summary.output : summary;
753
- }
754
- return outputs;
755
- }
756
- /**
757
- * Get safe environment variables
758
- */
759
- getSafeEnvironmentVariables() {
760
- const safeVars = {};
761
- const { buildSandboxEnv: buildSandboxEnv2 } = (init_env_exposure(), __toCommonJS(env_exposure_exports));
762
- const merged = buildSandboxEnv2(process.env);
763
- for (const [key, value] of Object.entries(merged)) {
764
- safeVars[key] = String(value);
765
- }
766
- safeVars["PWD"] = process.cwd();
767
- return safeVars;
768
- }
769
- getSupportedConfigKeys() {
770
- return [
771
- "type",
772
- "manual",
773
- "method",
774
- "methodArgs",
775
- "argsTransform",
776
- "variables",
777
- "plugins",
778
- "transform",
779
- "transform_js",
780
- "timeout",
781
- "depends_on",
782
- "on",
783
- "if",
784
- "group"
785
- ];
786
- }
787
- async isAvailable() {
788
- if (this.sdkAvailable !== null) {
789
- return this.sdkAvailable;
790
- }
791
- try {
792
- await import("@utcp/sdk");
793
- this.sdkAvailable = true;
794
- } catch {
795
- this.sdkAvailable = false;
796
- }
797
- return this.sdkAvailable;
798
- }
799
- getRequirements() {
800
- return [
801
- "@utcp/sdk package installed",
802
- "UTCP manual source (URL, file path, or inline)",
803
- "Tool method name"
804
- ];
805
- }
806
- };
807
- }
808
- });
809
-
810
- export {
811
- CheckProvider,
812
- init_check_provider_interface,
813
- EnvironmentResolver,
814
- init_env_resolver,
815
- extractIssuesFromOutput,
816
- normalizeIssueArray,
817
- normalizeIssue,
818
- init_issue_normalizer,
819
- buildSandboxEnv,
820
- env_exposure_exports,
821
- init_env_exposure,
822
- UtcpCheckProvider,
823
- init_utcp_check_provider
824
- };
825
- //# sourceMappingURL=chunk-7XRSCOKE.mjs.map