@apify/actors-mcp-server 0.18.4 → 0.18.5-beta.1

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 (354) hide show
  1. package/README.md +7 -2
  2. package/dist/apify_client.js +1 -4
  3. package/dist/apify_client.js.map +1 -1
  4. package/dist/const.d.ts +13 -4
  5. package/dist/const.d.ts.map +1 -1
  6. package/dist/const.js +15 -8
  7. package/dist/const.js.map +1 -1
  8. package/dist/dev_server.js +1 -4
  9. package/dist/dev_server.js.map +1 -1
  10. package/dist/errors.js +1 -4
  11. package/dist/errors.js.map +1 -1
  12. package/dist/index.js +1 -4
  13. package/dist/index.js.map +1 -1
  14. package/dist/index_internals.d.ts +4 -0
  15. package/dist/index_internals.d.ts.map +1 -1
  16. package/dist/index_internals.js +1 -4
  17. package/dist/index_internals.js.map +1 -1
  18. package/dist/index_internals_test_kit.js +1 -4
  19. package/dist/index_internals_test_kit.js.map +1 -1
  20. package/dist/input.js +1 -4
  21. package/dist/input.js.map +1 -1
  22. package/dist/instrument.js +1 -4
  23. package/dist/instrument.js.map +1 -1
  24. package/dist/mcp/actors.js +1 -4
  25. package/dist/mcp/actors.js.map +1 -1
  26. package/dist/mcp/client.js +1 -4
  27. package/dist/mcp/client.js.map +1 -1
  28. package/dist/mcp/client_context.js +1 -4
  29. package/dist/mcp/client_context.js.map +1 -1
  30. package/dist/mcp/const.js +1 -4
  31. package/dist/mcp/const.js.map +1 -1
  32. package/dist/mcp/errors.js +1 -4
  33. package/dist/mcp/errors.js.map +1 -1
  34. package/dist/mcp/legacy_server.js +1 -4
  35. package/dist/mcp/legacy_server.js.map +1 -1
  36. package/dist/mcp/proxy.js +1 -4
  37. package/dist/mcp/proxy.js.map +1 -1
  38. package/dist/mcp/remote_tool_call.js +1 -4
  39. package/dist/mcp/remote_tool_call.js.map +1 -1
  40. package/dist/mcp/server.js +1 -4
  41. package/dist/mcp/server.js.map +1 -1
  42. package/dist/mcp/stateless_server.js +1 -4
  43. package/dist/mcp/stateless_server.js.map +1 -1
  44. package/dist/mcp/task_execution.js +1 -4
  45. package/dist/mcp/task_execution.js.map +1 -1
  46. package/dist/mcp/tool_call_engine.js +1 -4
  47. package/dist/mcp/tool_call_engine.js.map +1 -1
  48. package/dist/mcp/tool_call_error_mapper.js +1 -4
  49. package/dist/mcp/tool_call_error_mapper.js.map +1 -1
  50. package/dist/mcp/tool_call_telemetry.js +1 -4
  51. package/dist/mcp/tool_call_telemetry.js.map +1 -1
  52. package/dist/mcp/tool_dispatch.js +1 -4
  53. package/dist/mcp/tool_dispatch.js.map +1 -1
  54. package/dist/mcp/utils.js +1 -4
  55. package/dist/mcp/utils.js.map +1 -1
  56. package/dist/payments/const.js +1 -4
  57. package/dist/payments/const.js.map +1 -1
  58. package/dist/payments/helpers.js +1 -4
  59. package/dist/payments/helpers.js.map +1 -1
  60. package/dist/payments/index.js +1 -4
  61. package/dist/payments/index.js.map +1 -1
  62. package/dist/payments/resolve.js +1 -4
  63. package/dist/payments/resolve.js.map +1 -1
  64. package/dist/payments/skyfire.js +1 -4
  65. package/dist/payments/skyfire.js.map +1 -1
  66. package/dist/payments/types.js +1 -4
  67. package/dist/payments/types.js.map +1 -1
  68. package/dist/payments/x402.js +1 -4
  69. package/dist/payments/x402.js.map +1 -1
  70. package/dist/prompts/index.js +1 -4
  71. package/dist/prompts/index.js.map +1 -1
  72. package/dist/prompts/prompt_service.js +1 -4
  73. package/dist/prompts/prompt_service.js.map +1 -1
  74. package/dist/resources/api_resources.js +1 -4
  75. package/dist/resources/api_resources.js.map +1 -1
  76. package/dist/resources/resource_service.js +1 -4
  77. package/dist/resources/resource_service.js.map +1 -1
  78. package/dist/resources/widgets.js +1 -4
  79. package/dist/resources/widgets.js.map +1 -1
  80. package/dist/server_card.js +1 -4
  81. package/dist/server_card.js.map +1 -1
  82. package/dist/state.js +1 -4
  83. package/dist/state.js.map +1 -1
  84. package/dist/stdio.js +1 -4
  85. package/dist/stdio.js.map +1 -1
  86. package/dist/telemetry.js +1 -4
  87. package/dist/telemetry.js.map +1 -1
  88. package/dist/test_kit/cases/actors.cases.js +1 -4
  89. package/dist/test_kit/cases/actors.cases.js.map +1 -1
  90. package/dist/test_kit/cases/apps.cases.js +1 -4
  91. package/dist/test_kit/cases/apps.cases.js.map +1 -1
  92. package/dist/test_kit/cases/payments.cases.js +1 -4
  93. package/dist/test_kit/cases/payments.cases.js.map +1 -1
  94. package/dist/test_kit/cases/registration.cases.js +1 -4
  95. package/dist/test_kit/cases/registration.cases.js.map +1 -1
  96. package/dist/test_kit/cases/schedules.cases.js +1 -4
  97. package/dist/test_kit/cases/schedules.cases.js.map +1 -1
  98. package/dist/test_kit/cases/storage.cases.js +1 -4
  99. package/dist/test_kit/cases/storage.cases.js.map +1 -1
  100. package/dist/test_kit/cases/tasks.cases.js +1 -4
  101. package/dist/test_kit/cases/tasks.cases.js.map +1 -1
  102. package/dist/test_kit/cases/tools.cases.js +1 -4
  103. package/dist/test_kit/cases/tools.cases.js.map +1 -1
  104. package/dist/test_kit/cases/versions.cases.d.ts +3 -0
  105. package/dist/test_kit/cases/versions.cases.d.ts.map +1 -0
  106. package/dist/test_kit/cases/versions.cases.js +738 -0
  107. package/dist/test_kit/cases/versions.cases.js.map +1 -0
  108. package/dist/test_kit/helpers.d.ts +1 -1
  109. package/dist/test_kit/helpers.d.ts.map +1 -1
  110. package/dist/test_kit/helpers.js +2 -5
  111. package/dist/test_kit/helpers.js.map +1 -1
  112. package/dist/test_kit/index.d.ts +1 -0
  113. package/dist/test_kit/index.d.ts.map +1 -1
  114. package/dist/test_kit/index.js +4 -4
  115. package/dist/test_kit/index.js.map +1 -1
  116. package/dist/test_kit/mcp_client.js +1 -4
  117. package/dist/test_kit/mcp_client.js.map +1 -1
  118. package/dist/test_kit/register.js +1 -4
  119. package/dist/test_kit/register.js.map +1 -1
  120. package/dist/test_kit/tsconfig.tsbuildinfo +1 -1
  121. package/dist/test_kit/types.js +1 -4
  122. package/dist/test_kit/types.js.map +1 -1
  123. package/dist/tools/actor_input_schema.js +1 -4
  124. package/dist/tools/actor_input_schema.js.map +1 -1
  125. package/dist/tools/actor_tool_naming.js +1 -4
  126. package/dist/tools/actor_tool_naming.js.map +1 -1
  127. package/dist/tools/actors/actor_definition.js +1 -4
  128. package/dist/tools/actors/actor_definition.js.map +1 -1
  129. package/dist/tools/actors/actor_executor.js +1 -4
  130. package/dist/tools/actors/actor_executor.js.map +1 -1
  131. package/dist/tools/actors/actor_run_response.js +1 -4
  132. package/dist/tools/actors/actor_run_response.js.map +1 -1
  133. package/dist/tools/actors/actor_tool_contract.js +1 -4
  134. package/dist/tools/actors/actor_tool_contract.js.map +1 -1
  135. package/dist/tools/actors/actor_tools_factory.js +1 -4
  136. package/dist/tools/actors/actor_tools_factory.js.map +1 -1
  137. package/dist/tools/actors/call_actor.js +1 -4
  138. package/dist/tools/actors/call_actor.js.map +1 -1
  139. package/dist/tools/actors/delete_actor.js +1 -4
  140. package/dist/tools/actors/delete_actor.js.map +1 -1
  141. package/dist/tools/actors/fetch_actor_details.js +1 -4
  142. package/dist/tools/actors/fetch_actor_details.js.map +1 -1
  143. package/dist/tools/actors/get_actor_list.js +1 -4
  144. package/dist/tools/actors/get_actor_list.js.map +1 -1
  145. package/dist/tools/actors/search_actors.js +1 -4
  146. package/dist/tools/actors/search_actors.js.map +1 -1
  147. package/dist/tools/api/apify_api_blocklist.js +1 -4
  148. package/dist/tools/api/apify_api_blocklist.js.map +1 -1
  149. package/dist/tools/api/apify_api_details.js +1 -4
  150. package/dist/tools/api/apify_api_details.js.map +1 -1
  151. package/dist/tools/api/apify_api_path.js +1 -4
  152. package/dist/tools/api/apify_api_path.js.map +1 -1
  153. package/dist/tools/api/apify_api_read.js +1 -4
  154. package/dist/tools/api/apify_api_read.js.map +1 -1
  155. package/dist/tools/api/apify_api_request.js +1 -4
  156. package/dist/tools/api/apify_api_request.js.map +1 -1
  157. package/dist/tools/api/apify_api_search.js +1 -4
  158. package/dist/tools/api/apify_api_search.js.map +1 -1
  159. package/dist/tools/api/apify_api_spec.js +1 -4
  160. package/dist/tools/api/apify_api_spec.js.map +1 -1
  161. package/dist/tools/api/apify_api_write.js +1 -4
  162. package/dist/tools/api/apify_api_write.js.map +1 -1
  163. package/dist/tools/builds/build_actor.d.ts.map +1 -1
  164. package/dist/tools/builds/build_actor.js +10 -8
  165. package/dist/tools/builds/build_actor.js.map +1 -1
  166. package/dist/tools/builds/build_helpers.js +1 -4
  167. package/dist/tools/builds/build_helpers.js.map +1 -1
  168. package/dist/tools/builds/get_actor_build.js +1 -4
  169. package/dist/tools/builds/get_actor_build.js.map +1 -1
  170. package/dist/tools/builds/get_actor_build_list.d.ts.map +1 -1
  171. package/dist/tools/builds/get_actor_build_list.js +6 -7
  172. package/dist/tools/builds/get_actor_build_list.js.map +1 -1
  173. package/dist/tools/builds/get_actor_build_log.js +1 -4
  174. package/dist/tools/builds/get_actor_build_log.js.map +1 -1
  175. package/dist/tools/dev/report_problem.js +1 -4
  176. package/dist/tools/dev/report_problem.js.map +1 -1
  177. package/dist/tools/docs/fetch_apify_docs.js +1 -4
  178. package/dist/tools/docs/fetch_apify_docs.js.map +1 -1
  179. package/dist/tools/docs/search_apify_docs.js +1 -4
  180. package/dist/tools/docs/search_apify_docs.js.map +1 -1
  181. package/dist/tools/index.js +1 -4
  182. package/dist/tools/index.js.map +1 -1
  183. package/dist/tools/registry.d.ts +1 -1
  184. package/dist/tools/registry.d.ts.map +1 -1
  185. package/dist/tools/registry.js +7 -6
  186. package/dist/tools/registry.js.map +1 -1
  187. package/dist/tools/runs/abort_actor_run.js +1 -4
  188. package/dist/tools/runs/abort_actor_run.js.map +1 -1
  189. package/dist/tools/runs/get_actor_run.js +1 -4
  190. package/dist/tools/runs/get_actor_run.js.map +1 -1
  191. package/dist/tools/runs/get_actor_run_list.d.ts.map +1 -1
  192. package/dist/tools/runs/get_actor_run_list.js +6 -7
  193. package/dist/tools/runs/get_actor_run_list.js.map +1 -1
  194. package/dist/tools/runs/get_actor_run_log.js +1 -4
  195. package/dist/tools/runs/get_actor_run_log.js.map +1 -1
  196. package/dist/tools/schedules/create_schedule.js +1 -4
  197. package/dist/tools/schedules/create_schedule.js.map +1 -1
  198. package/dist/tools/schedules/delete_schedule.js +1 -4
  199. package/dist/tools/schedules/delete_schedule.js.map +1 -1
  200. package/dist/tools/schedules/get_schedule.js +1 -4
  201. package/dist/tools/schedules/get_schedule.js.map +1 -1
  202. package/dist/tools/schedules/schedule_helpers.d.ts.map +1 -1
  203. package/dist/tools/schedules/schedule_helpers.js +3 -5
  204. package/dist/tools/schedules/schedule_helpers.js.map +1 -1
  205. package/dist/tools/schedules/update_schedule.js +2 -5
  206. package/dist/tools/schedules/update_schedule.js.map +1 -1
  207. package/dist/tools/storage/get_dataset.js +1 -4
  208. package/dist/tools/storage/get_dataset.js.map +1 -1
  209. package/dist/tools/storage/get_dataset_items.js +1 -4
  210. package/dist/tools/storage/get_dataset_items.js.map +1 -1
  211. package/dist/tools/storage/get_dataset_list.js +1 -4
  212. package/dist/tools/storage/get_dataset_list.js.map +1 -1
  213. package/dist/tools/storage/get_dataset_schema.js +1 -4
  214. package/dist/tools/storage/get_dataset_schema.js.map +1 -1
  215. package/dist/tools/storage/get_key_value_store.js +1 -4
  216. package/dist/tools/storage/get_key_value_store.js.map +1 -1
  217. package/dist/tools/storage/get_key_value_store_keys.js +1 -4
  218. package/dist/tools/storage/get_key_value_store_keys.js.map +1 -1
  219. package/dist/tools/storage/get_key_value_store_list.js +1 -4
  220. package/dist/tools/storage/get_key_value_store_list.js.map +1 -1
  221. package/dist/tools/storage/get_key_value_store_record.js +1 -4
  222. package/dist/tools/storage/get_key_value_store_record.js.map +1 -1
  223. package/dist/tools/storage/storage_helpers.js +1 -4
  224. package/dist/tools/storage/storage_helpers.js.map +1 -1
  225. package/dist/tools/structured_output_schemas.d.ts +308 -0
  226. package/dist/tools/structured_output_schemas.d.ts.map +1 -1
  227. package/dist/tools/structured_output_schemas.js +93 -4
  228. package/dist/tools/structured_output_schemas.js.map +1 -1
  229. package/dist/tools/tasks/create_actor_task.d.ts.map +1 -1
  230. package/dist/tools/tasks/create_actor_task.js +3 -5
  231. package/dist/tools/tasks/create_actor_task.js.map +1 -1
  232. package/dist/tools/tasks/get_actor_task.js +1 -4
  233. package/dist/tools/tasks/get_actor_task.js.map +1 -1
  234. package/dist/tools/tasks/publish_actor_task.js +1 -4
  235. package/dist/tools/tasks/publish_actor_task.js.map +1 -1
  236. package/dist/tools/tasks/task_helpers.d.ts +0 -16
  237. package/dist/tools/tasks/task_helpers.d.ts.map +1 -1
  238. package/dist/tools/tasks/task_helpers.js +2 -35
  239. package/dist/tools/tasks/task_helpers.js.map +1 -1
  240. package/dist/tools/tasks/unpublish_actor_task.js +1 -4
  241. package/dist/tools/tasks/unpublish_actor_task.js.map +1 -1
  242. package/dist/tools/tasks/update_actor_task.d.ts.map +1 -1
  243. package/dist/tools/tasks/update_actor_task.js +3 -5
  244. package/dist/tools/tasks/update_actor_task.js.map +1 -1
  245. package/dist/tools/versions/create_actor.d.ts +11 -0
  246. package/dist/tools/versions/create_actor.d.ts.map +1 -0
  247. package/dist/tools/versions/create_actor.js +133 -0
  248. package/dist/tools/versions/create_actor.js.map +1 -0
  249. package/dist/tools/versions/create_actor_version.d.ts +14 -0
  250. package/dist/tools/versions/create_actor_version.d.ts.map +1 -0
  251. package/dist/tools/versions/create_actor_version.js +168 -0
  252. package/dist/tools/versions/create_actor_version.js.map +1 -0
  253. package/dist/tools/versions/delete_actor_version.d.ts +12 -0
  254. package/dist/tools/versions/delete_actor_version.d.ts.map +1 -0
  255. package/dist/tools/versions/delete_actor_version.js +121 -0
  256. package/dist/tools/versions/delete_actor_version.js.map +1 -0
  257. package/dist/tools/versions/get_actor_version.d.ts.map +1 -0
  258. package/dist/tools/{source → versions}/get_actor_version.js +10 -93
  259. package/dist/tools/versions/get_actor_version.js.map +1 -0
  260. package/dist/tools/{source → versions}/source_files.d.ts +6 -2
  261. package/dist/tools/versions/source_files.d.ts.map +1 -0
  262. package/dist/tools/{source → versions}/source_files.js +8 -11
  263. package/dist/tools/versions/source_files.js.map +1 -0
  264. package/dist/tools/versions/source_helpers.d.ts +154 -0
  265. package/dist/tools/versions/source_helpers.d.ts.map +1 -0
  266. package/dist/tools/versions/source_helpers.js +439 -0
  267. package/dist/tools/versions/source_helpers.js.map +1 -0
  268. package/dist/tools/versions/update_actor_version.d.ts +15 -0
  269. package/dist/tools/versions/update_actor_version.d.ts.map +1 -0
  270. package/dist/tools/versions/update_actor_version.js +447 -0
  271. package/dist/tools/versions/update_actor_version.js.map +1 -0
  272. package/dist/tools/widgets/call_actor_widget.js +1 -4
  273. package/dist/tools/widgets/call_actor_widget.js.map +1 -1
  274. package/dist/tools/widgets/fetch_actor_details_widget.js +1 -4
  275. package/dist/tools/widgets/fetch_actor_details_widget.js.map +1 -1
  276. package/dist/tools/widgets/get_actor_run_widget.js +1 -4
  277. package/dist/tools/widgets/get_actor_run_widget.js.map +1 -1
  278. package/dist/tools/widgets/search_actors_widget.js +1 -4
  279. package/dist/tools/widgets/search_actors_widget.js.map +1 -1
  280. package/dist/tsconfig.tsbuildinfo +1 -1
  281. package/dist/types.js +1 -4
  282. package/dist/types.js.map +1 -1
  283. package/dist/utils/actor.js +1 -4
  284. package/dist/utils/actor.js.map +1 -1
  285. package/dist/utils/actor_card.js +1 -4
  286. package/dist/utils/actor_card.js.map +1 -1
  287. package/dist/utils/actor_details.js +1 -4
  288. package/dist/utils/actor_details.js.map +1 -1
  289. package/dist/utils/actor_search.js +1 -4
  290. package/dist/utils/actor_search.js.map +1 -1
  291. package/dist/utils/ajv.js +1 -4
  292. package/dist/utils/ajv.js.map +1 -1
  293. package/dist/utils/apify_docs.js +1 -4
  294. package/dist/utils/apify_docs.js.map +1 -1
  295. package/dist/utils/apify_errors.js +1 -4
  296. package/dist/utils/apify_errors.js.map +1 -1
  297. package/dist/utils/apify_properties.js +1 -4
  298. package/dist/utils/apify_properties.js.map +1 -1
  299. package/dist/utils/apify_resource_id.d.ts +18 -0
  300. package/dist/utils/apify_resource_id.d.ts.map +1 -0
  301. package/dist/utils/apify_resource_id.js +33 -0
  302. package/dist/utils/apify_resource_id.js.map +1 -0
  303. package/dist/utils/auth.js +1 -4
  304. package/dist/utils/auth.js.map +1 -1
  305. package/dist/utils/console_link.js +1 -4
  306. package/dist/utils/console_link.js.map +1 -1
  307. package/dist/utils/encode_text.js +1 -4
  308. package/dist/utils/encode_text.js.map +1 -1
  309. package/dist/utils/generic.js +1 -4
  310. package/dist/utils/generic.js.map +1 -1
  311. package/dist/utils/logging.js +1 -4
  312. package/dist/utils/logging.js.map +1 -1
  313. package/dist/utils/mcp.js +1 -4
  314. package/dist/utils/mcp.js.map +1 -1
  315. package/dist/utils/mcp_clients.js +1 -4
  316. package/dist/utils/mcp_clients.js.map +1 -1
  317. package/dist/utils/payment_errors.js +1 -4
  318. package/dist/utils/payment_errors.js.map +1 -1
  319. package/dist/utils/pricing_info.js +1 -4
  320. package/dist/utils/pricing_info.js.map +1 -1
  321. package/dist/utils/progress.js +1 -4
  322. package/dist/utils/progress.js.map +1 -1
  323. package/dist/utils/schema_generation.js +1 -4
  324. package/dist/utils/schema_generation.js.map +1 -1
  325. package/dist/utils/server-instructions/index.js +1 -4
  326. package/dist/utils/server-instructions/index.js.map +1 -1
  327. package/dist/utils/server_mode.js +1 -4
  328. package/dist/utils/server_mode.js.map +1 -1
  329. package/dist/utils/tool_categories_helpers.js +1 -4
  330. package/dist/utils/tool_categories_helpers.js.map +1 -1
  331. package/dist/utils/tool_status.js +1 -4
  332. package/dist/utils/tool_status.js.map +1 -1
  333. package/dist/utils/tools.js +1 -4
  334. package/dist/utils/tools.js.map +1 -1
  335. package/dist/utils/tools_loader.d.ts +2 -1
  336. package/dist/utils/tools_loader.d.ts.map +1 -1
  337. package/dist/utils/tools_loader.js +4 -6
  338. package/dist/utils/tools_loader.js.map +1 -1
  339. package/dist/utils/ttl_lru.js +1 -4
  340. package/dist/utils/ttl_lru.js.map +1 -1
  341. package/dist/utils/userid_cache.js +1 -4
  342. package/dist/utils/userid_cache.js.map +1 -1
  343. package/dist/utils/version.js +1 -4
  344. package/dist/utils/version.js.map +1 -1
  345. package/dist/web/dist/actor-run-widget.js +0 -2
  346. package/dist/web/dist/search-actors-widget.js +0 -2
  347. package/manifest.json +1 -1
  348. package/package.json +1 -1
  349. package/server.json +1 -1
  350. package/dist/tools/source/get_actor_version.d.ts.map +0 -1
  351. package/dist/tools/source/get_actor_version.js.map +0 -1
  352. package/dist/tools/source/source_files.d.ts.map +0 -1
  353. package/dist/tools/source/source_files.js.map +0 -1
  354. /package/dist/tools/{source → versions}/get_actor_version.d.ts +0 -0
@@ -0,0 +1,439 @@
1
+ import { posix } from 'node:path';
2
+ import { ActorSourceType, ApifyApiError } from 'apify-client';
3
+ import { z } from 'zod';
4
+ import { APIFY_ERROR_TYPE_TOO_MANY_VERSIONS, APIFY_ERROR_TYPE_VERSION_ALREADY_EXISTS, APIFY_ERROR_TYPE_VERSIONS_SIZE_EXCEEDED, HELPER_TOOLS, } from '../../const.js';
5
+ import { UserInputError } from '../../errors.js';
6
+ import { REDACTED } from '../../resources/api_resources.js';
7
+ import { getResourceByIdOrName } from '../../utils/apify_resource_id.js';
8
+ import { getConsoleLinkContext } from '../../utils/console_link.js';
9
+ import { logHttpError } from '../../utils/logging.js';
10
+ import { respondAborted, respondUserError } from '../../utils/mcp.js';
11
+ import { isRecord } from '../api/apify_api_spec.js';
12
+ import { buildNextStepForBuild, listVersionNumbers, respondWithBuild, toBuildResult } from '../builds/build_helpers.js';
13
+ import { buildFilesManifest, buildFilesRevision, hasBinaryExtension } from './source_files.js';
14
+ /** The input shape of one file sent whole. */
15
+ export const sourceFileArgs = z.object({
16
+ path: z.string().min(1).describe('Path relative to the Actor root, for example src/main.js.'),
17
+ content: z.string().describe('The whole file content: text as is, or base64 when encoding is base64.'),
18
+ encoding: z
19
+ .enum(['utf8', 'base64'])
20
+ .optional()
21
+ .describe('utf8 for text, base64 for binary files. Defaults to base64 for binary extensions such as .png and to utf8 otherwise.'),
22
+ });
23
+ /** `keys` of `record` that are set: a string, number, or boolean as is, any other value as `REDACTED`. */
24
+ function pickLoggedValues(record, keys) {
25
+ return Object.fromEntries(keys.flatMap((key) => {
26
+ const value = record[key];
27
+ if (value === undefined)
28
+ return [];
29
+ return [[key, ['string', 'number', 'boolean'].includes(typeof value) ? value : REDACTED]];
30
+ }));
31
+ }
32
+ /** `keys` of `record` that are set, each as `REDACTED`. */
33
+ function maskLoggedValues(record, keys) {
34
+ return Object.fromEntries(keys.filter((key) => record[key] !== undefined).map((key) => [key, REDACTED]));
35
+ }
36
+ /** The logged copy of an entry's edits, each with its oldText and newText as `REDACTED`. */
37
+ function redactEdits(edits) {
38
+ if (!Array.isArray(edits))
39
+ return REDACTED;
40
+ return edits.map((textEdit) => isRecord(textEdit) ? maskLoggedValues(textEdit, ['oldText', 'newText']) : REDACTED);
41
+ }
42
+ /**
43
+ * The logged copy of a source tool's arguments (`redactArgs`), built as an allowlist: `keys`, and each entry of the
44
+ * list under `listKey` with its `entryKeys`, and with its content and its edits' oldText and newText as `REDACTED`.
45
+ * File content can hold secrets, such as an API key written into the code.
46
+ */
47
+ export function redactSourceToolArgs(args, fields) {
48
+ const { keys, listKey, entryKeys } = fields;
49
+ const redactEntry = (entry) => {
50
+ if (!isRecord(entry))
51
+ return REDACTED;
52
+ const { edits } = entry;
53
+ return {
54
+ ...pickLoggedValues(entry, entryKeys),
55
+ ...maskLoggedValues(entry, ['content']),
56
+ ...(edits !== undefined && { edits: redactEdits(edits) }),
57
+ };
58
+ };
59
+ const list = args[listKey];
60
+ return {
61
+ ...pickLoggedValues(args, keys),
62
+ ...(list !== undefined && { [listKey]: Array.isArray(list) ? list.map(redactEntry) : REDACTED }),
63
+ };
64
+ }
65
+ /**
66
+ * The Actor by its ID, its name (resolved against the token's own Actors), or its full name, `username/name` or
67
+ * `username~name` (apify-client turns username/name into the API's username~name); throws `UserInputError` when there
68
+ * is none.
69
+ */
70
+ export async function fetchActor(client, actorSelector) {
71
+ const actor = await getResourceByIdOrName(actorSelector, async (safeId) => client.actor(safeId).get());
72
+ // Extra path segments, such as username/name/runs/last, reach a sub-resource that is not an Actor.
73
+ if (!actor || typeof actor.name !== 'string' || typeof actor.username !== 'string') {
74
+ throw new UserInputError(`Actor '${actorSelector}' not found. The actor argument takes an ID, a name (resolved against your own Actors), or a full name as username/name.`);
75
+ }
76
+ return { actor, fullName: `${actor.username}/${actor.name}` };
77
+ }
78
+ /** The requested version, or the only one when none is requested; throws `UserInputError` otherwise. */
79
+ export function resolveVersion(actor, requestedVersionNumber, actorSelector) {
80
+ const versionNumbers = listVersionNumbers(actor);
81
+ // AJV turns a null versionNumber into an empty string, which no version has, so it counts as not given.
82
+ const requested = requestedVersionNumber || undefined;
83
+ if (requested === undefined && versionNumbers.length !== 1) {
84
+ // The source type and build tag tell the caller which version holds the code it is after.
85
+ const versions = actor.versions
86
+ .filter((version) => version.versionNumber !== undefined)
87
+ .map(({ versionNumber, sourceType, buildTag }) => {
88
+ const tag = buildTag ? `, build tag ${buildTag}` : '';
89
+ return `${versionNumber} (${sourceType}${tag})`;
90
+ });
91
+ throw new UserInputError(`Specify versionNumber; this Actor has versions: ${versions.join(', ')}.`);
92
+ }
93
+ const versionNumber = requested !== null && requested !== void 0 ? requested : versionNumbers[0];
94
+ const version = actor.versions.find((candidate) => candidate.versionNumber === versionNumber);
95
+ if (!version) {
96
+ throw new UserInputError(`Actor '${actorSelector}' has no version ${versionNumber}; available versions: ${versionNumbers.join(', ')}.`);
97
+ }
98
+ return { ...version, versionNumber };
99
+ }
100
+ /**
101
+ * The URL without what can grant access to it: the query string, the password, and, for http and https, the user. An
102
+ * SSH user such as `git@` is not a secret and stays. A URL the parser cannot read, such as
103
+ * `git@github.com:user/repo.git`, loses only its query string.
104
+ */
105
+ function formatUrlWithoutSecrets(url) {
106
+ if (URL.canParse(url)) {
107
+ const parsed = new URL(url);
108
+ parsed.search = '';
109
+ parsed.password = '';
110
+ if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {
111
+ parsed.username = '';
112
+ }
113
+ return parsed.href;
114
+ }
115
+ const queryIndex = url.indexOf('?');
116
+ if (queryIndex === -1)
117
+ return url;
118
+ const hashIndex = url.indexOf('#', queryIndex);
119
+ return url.slice(0, queryIndex) + (hashIndex === -1 ? '' : url.slice(hashIndex));
120
+ }
121
+ /**
122
+ * Why a version not stored as files is refused, and what to use instead. A version keeps the URL fields of a source
123
+ * type it used before, so only the URL of its current type is named.
124
+ */
125
+ function formatSourceTypeRefusal(version, versionLabel) {
126
+ if (version.sourceType === ActorSourceType.GitRepo) {
127
+ const url = version.gitRepoUrl ? ` ${formatUrlWithoutSecrets(version.gitRepoUrl)}` : '';
128
+ return `${versionLabel} has its files in the Git repository${url}, not stored on Apify, so this tool cannot work on them; use the repository.`;
129
+ }
130
+ if (version.sourceType === ActorSourceType.GitHubGist) {
131
+ const url = version.gitHubGistUrl ? ` ${formatUrlWithoutSecrets(version.gitHubGistUrl)}` : '';
132
+ return `${versionLabel} has its files in the GitHub gist${url}, not stored on Apify, so this tool cannot work on them; use the gist.`;
133
+ }
134
+ // TODO(#1452): Read and write zip-stored (TARBALL) versions with adm-zip 0.6.1 or later, within the download and
135
+ // unpacking limits the issue lists.
136
+ if (version.sourceType === ActorSourceType.Tarball) {
137
+ return `${versionLabel} is stored as a zip archive (apify push does this for sources over 3 MiB), and this tool cannot work on zip-stored versions yet.`;
138
+ }
139
+ // The API's legacy SOURCE_CODE type and any type added later are not in apify-client's enum.
140
+ const { sourceType } = version;
141
+ return `${versionLabel} has source type ${sourceType}, which this tool cannot work on; only versions stored as files are supported.`;
142
+ }
143
+ /**
144
+ * The version's stored entries, folders included. Throws `UserInputError` for a version not stored as files and for
145
+ * one whose source the API hides.
146
+ */
147
+ export function extractSourceFiles(version, versionLabel) {
148
+ if (version.sourceType !== ActorSourceType.SourceFiles) {
149
+ throw new UserInputError(formatSourceTypeRefusal(version, versionLabel));
150
+ }
151
+ // The API returns only the number, type, and build tag of a version whose source it hides from this account.
152
+ if (!version.sourceFiles) {
153
+ throw new UserInputError(`${versionLabel} came back without its source: the API hides it from accounts that cannot modify the Actor. Ask the Actor's owner for the source.`);
154
+ }
155
+ return version.sourceFiles;
156
+ }
157
+ /**
158
+ * The entry to store for a file sent whole: TEXT for utf8, BASE64 for base64, where no encoding means base64 for a
159
+ * binary extension, the rule get-actor-version reads by. The path is normalized the way get-actor-version lists it.
160
+ */
161
+ export function buildSourceFileEntry({ path, content, encoding, }) {
162
+ const isBase64 = (encoding !== null && encoding !== void 0 ? encoding : (hasBinaryExtension(path) ? 'base64' : 'utf8')) === 'base64';
163
+ return { name: posix.normalize(path), format: isBase64 ? 'BASE64' : 'TEXT', content };
164
+ }
165
+ /**
166
+ * Base64 that decodes to its bytes without loss: Node and the build worker skip characters they cannot decode and stop
167
+ * at padding, so text sent as base64 would be stored as other bytes. Line breaks, missing padding, and the URL-safe
168
+ * alphabet decode without loss.
169
+ */
170
+ function isBase64(content) {
171
+ const compact = content.replace(/\s/g, '').replace(/-/g, '+').replace(/_/g, '/');
172
+ return Buffer.from(compact, 'base64').toString('base64').replace(/=+$/, '') === compact.replace(/=+$/, '');
173
+ }
174
+ /**
175
+ * Throws `UserInputError` for content the stored file would not hold as sent: base64 that does not decode without
176
+ * loss, and text with a lone UTF-16 surrogate, which UTF-8 stores as U+FFFD.
177
+ */
178
+ export function validateFileContent({ format, content }, label) {
179
+ if (format === 'BASE64' && !isBase64(content)) {
180
+ throw new UserInputError(`${label} has content that is not valid base64; encoding base64 takes binary content as base64, and text takes encoding utf8.`);
181
+ }
182
+ if (format === 'TEXT' && !content.isWellFormed()) {
183
+ throw new UserInputError(`${label} has text with a lone UTF-16 surrogate, which UTF-8 cannot store.`);
184
+ }
185
+ }
186
+ /**
187
+ * Throws `UserInputError` for a path with a control character, U+0000 to U+001F or U+007F, or with a lone UTF-16
188
+ * surrogate. The build writes the files to disk, where a file name cannot hold NUL, and UTF-8 stores a lone surrogate
189
+ * as U+FFFD.
190
+ */
191
+ export function validatePathCharacters(path, label) {
192
+ if (!path.isWellFormed()) {
193
+ throw new UserInputError(`${label} has a lone UTF-16 surrogate in its path, which UTF-8 cannot store.`);
194
+ }
195
+ const character = [...path].find((char) => char <= '\u001f' || char === '\u007f');
196
+ if (character === undefined)
197
+ return;
198
+ const codePoint = `U+${character.charCodeAt(0).toString(16).toUpperCase().padStart(4, '0')}`;
199
+ throw new UserInputError(`${label} has the control character ${codePoint} in its path; a path cannot hold characters U+0000 to U+001F or U+007F.`);
200
+ }
201
+ /**
202
+ * Throws `UserInputError` for a normalized path no file can be written at. The build worker refuses a version with a
203
+ * path outside the Actor root, so every build of it would fail; `.` and a path ending in a slash name a folder. A
204
+ * backslash is refused too: the build takes it as part of the file name, so src\main.js would land in the Actor root.
205
+ */
206
+ export function validateFilePath(path, label) {
207
+ if (path.includes('\\')) {
208
+ throw new UserInputError(`${label} has a backslash in its path; paths use / as the separator.`);
209
+ }
210
+ if (path.startsWith('/') || path === '..' || path.startsWith('../')) {
211
+ throw new UserInputError(`${label} has a path outside the Actor root; paths are relative to it, such as src/main.js.`);
212
+ }
213
+ if (path === '.' || path.endsWith('/')) {
214
+ throw new UserInputError(`${label} has a path that names a folder, not a file.`);
215
+ }
216
+ }
217
+ /** The folders above a file, outermost first: `a` and `a/b` for `a/b/c.js`. */
218
+ function listFolders(path) {
219
+ const folders = [];
220
+ for (let slashIndex = path.indexOf('/'); slashIndex !== -1; slashIndex = path.indexOf('/', slashIndex + 1)) {
221
+ folders.push(path.slice(0, slashIndex));
222
+ }
223
+ return folders;
224
+ }
225
+ /**
226
+ * The paths of a version's files and folder entries, to check where a new file can go: one path cannot be both a file
227
+ * and a folder, and the build worker fails to write such a file. Each check and change looks up only the folders of
228
+ * its path, since comparing each file with every other took 8 s for 20,000 files.
229
+ */
230
+ export class SourcePathIndex {
231
+ constructor(filePaths, folderPaths = []) {
232
+ Object.defineProperty(this, "filePaths", {
233
+ enumerable: true,
234
+ configurable: true,
235
+ writable: true,
236
+ value: new Set()
237
+ });
238
+ /** The files under each folder, at any depth, in the order they were added. */
239
+ Object.defineProperty(this, "filePathsByFolder", {
240
+ enumerable: true,
241
+ configurable: true,
242
+ writable: true,
243
+ value: new Map()
244
+ });
245
+ Object.defineProperty(this, "folderPaths", {
246
+ enumerable: true,
247
+ configurable: true,
248
+ writable: true,
249
+ value: void 0
250
+ });
251
+ this.folderPaths = folderPaths;
252
+ for (const path of filePaths)
253
+ this.addFile(path);
254
+ }
255
+ hasFile(path) {
256
+ return this.filePaths.has(path);
257
+ }
258
+ /** A file added again keeps its place in the order. */
259
+ addFile(path) {
260
+ var _a;
261
+ this.filePaths.add(path);
262
+ for (const folder of listFolders(path)) {
263
+ this.filePathsByFolder.set(folder, ((_a = this.filePathsByFolder.get(folder)) !== null && _a !== void 0 ? _a : new Set()).add(path));
264
+ }
265
+ }
266
+ deleteFile(path) {
267
+ var _a;
268
+ this.filePaths.delete(path);
269
+ for (const folder of listFolders(path))
270
+ (_a = this.filePathsByFolder.get(folder)) === null || _a === void 0 ? void 0 : _a.delete(path);
271
+ }
272
+ /**
273
+ * Throws `UserInputError` when a new file at `path` collides with another file or folder: a file at a folder of
274
+ * `path`, or else the first file added under `path`, or else the first folder entry at or under `path`. A file at
275
+ * `path` itself is for the caller to check.
276
+ */
277
+ validateNewFilePath(path, label) {
278
+ var _a, _b, _c;
279
+ const collision = (_c = (_a = listFolders(path).find((folder) => this.filePaths.has(folder))) !== null && _a !== void 0 ? _a : (_b = this.filePathsByFolder.get(path)) === null || _b === void 0 ? void 0 : _b.values().next().value) !== null && _c !== void 0 ? _c : this.folderPaths.find((folderPath) => folderPath === path || folderPath.startsWith(`${path}/`));
280
+ if (collision === undefined)
281
+ return;
282
+ throw new UserInputError(`${label} collides with ${collision}; one path cannot be both a file and a folder.`);
283
+ }
284
+ }
285
+ /**
286
+ * The entries to send, one per file; throws `UserInputError` for a path no file can be written at, for content the
287
+ * stored file would not hold as sent, and for a path given twice, which leaves the version with two entries where the
288
+ * build uses the last.
289
+ */
290
+ export function buildSourceFileEntries(files) {
291
+ const entries = [];
292
+ const pathIndex = new SourcePathIndex([]);
293
+ for (const [index, file] of files.entries()) {
294
+ validatePathCharacters(file.path, `files[${index}]`);
295
+ const entry = buildSourceFileEntry(file);
296
+ const label = `files[${index}] (${file.path})`;
297
+ validateFilePath(entry.name, label);
298
+ validateFileContent(entry, label);
299
+ if (pathIndex.hasFile(entry.name)) {
300
+ throw new UserInputError(`${label} repeats the path ${entry.name}; each path can be sent only once.`);
301
+ }
302
+ pathIndex.validateNewFilePath(entry.name, label);
303
+ pathIndex.addFile(entry.name);
304
+ entries.push(entry);
305
+ }
306
+ return entries;
307
+ }
308
+ /** The build worker skips a file whose content is empty, so the caller hears of such files. */
309
+ export function buildEmptyFilesWarnings(paths) {
310
+ if (paths.length === 0)
311
+ return {};
312
+ const warning = `These files are empty, and the build skips empty files, so they will not exist in the build: ${paths.join(', ')}.`;
313
+ return { warnings: [warning] };
314
+ }
315
+ /**
316
+ * Starts a build of the version after a committed write, with no tag so the version's buildTag applies, and does not
317
+ * wait for it. The write stands either way, so a failed start is returned as `buildError` rather than thrown: a caller
318
+ * told the call failed would retry writes that were saved. A cancel that arrives before the start starts no build.
319
+ */
320
+ async function startBuildAfterWrite(toolArgs, target) {
321
+ const { apifyClient: client, apifyToken, signal } = toolArgs;
322
+ try {
323
+ // Resolved before the start, so a failed lookup leaves no build behind.
324
+ const linkContext = await getConsoleLinkContext(apifyToken, client);
325
+ // Per the MCP spec a cancelled request gets no response; the write stands.
326
+ if (signal === null || signal === void 0 ? void 0 : signal.aborted)
327
+ return { aborted: true };
328
+ // Started without the request's signal: a committed write never aborts the build it started.
329
+ const build = await client.actor(target.actorId).build(target.versionNumber, { useCache: true });
330
+ return { build, linkContext };
331
+ }
332
+ catch (error) {
333
+ // The API's refusal is the caller's to read; anything else, such as a network failure, is logged too.
334
+ if (!(error instanceof ApifyApiError))
335
+ logHttpError(error, 'Failed to start a build after a source write', target);
336
+ return { buildError: error instanceof Error ? error.message : String(error) };
337
+ }
338
+ }
339
+ /**
340
+ * The response to a committed write. With autoBuild, a build of the version starts first; a cancel that arrives before
341
+ * the start gets the cancelled-call response. When the build starts, `buildStartedWarnings`, if given, replaces the
342
+ * warnings in `structuredContent`.
343
+ */
344
+ export async function respondAfterWrite(params) {
345
+ const { toolArgs, autoBuild, target, structuredContent, buildStartedWarnings, summary } = params;
346
+ if (!autoBuild) {
347
+ return respondWithBuild({
348
+ structuredContent,
349
+ summary,
350
+ nextStep: 'No build was started; runs use these files only after the version is built.',
351
+ });
352
+ }
353
+ const started = await startBuildAfterWrite(toolArgs, target);
354
+ if ('aborted' in started)
355
+ return respondAborted();
356
+ if ('buildError' in started) {
357
+ return respondWithBuild({
358
+ structuredContent: { ...structuredContent, buildError: started.buildError },
359
+ summary,
360
+ nextStep: 'The build could not be started; runs use these files only after the version is built.',
361
+ });
362
+ }
363
+ return respondWithBuild({
364
+ structuredContent: {
365
+ ...structuredContent,
366
+ ...(buildStartedWarnings && { warnings: buildStartedWarnings }),
367
+ build: toBuildResult(started.build, started.linkContext),
368
+ },
369
+ summary,
370
+ nextStep: buildNextStepForBuild(started.build, { loadedToolNames: toolArgs.loadedToolNames }),
371
+ });
372
+ }
373
+ /**
374
+ * The response to a POST that created a version from `sourceFiles`, as `respondAfterWrite` gives it: their manifest
375
+ * and revision as get-actor-version gives them, and the warnings about empty files followed by
376
+ * `extraWarning.withoutBuild`, or by `extraWarning.withBuild` when autoBuild starts a build.
377
+ */
378
+ export async function respondAfterCreate(params) {
379
+ const { toolArgs, autoBuild, created, sourceFiles, extraWarning, summary } = params;
380
+ const { actorId, fullName, versionNumber } = created;
381
+ const files = buildFilesManifest(sourceFiles);
382
+ const emptyPaths = files.filter(({ sizeBytes }) => sizeBytes === 0).map(({ path }) => path);
383
+ const { warnings = [] } = buildEmptyFilesWarnings(emptyPaths);
384
+ const allWarnings = extraWarning ? [...warnings, extraWarning.withoutBuild] : warnings;
385
+ return await respondAfterWrite({
386
+ toolArgs,
387
+ autoBuild,
388
+ target: { actorId, versionNumber },
389
+ structuredContent: {
390
+ actorId,
391
+ fullName,
392
+ versionNumber,
393
+ revision: buildFilesRevision(files),
394
+ files: files.map(({ path, sizeBytes, hash }) => ({ path, sizeBytes, hash })),
395
+ ...(allWarnings.length > 0 && { warnings: allWarnings }),
396
+ },
397
+ ...(extraWarning && { buildStartedWarnings: [...warnings, extraWarning.withBuild] }),
398
+ summary,
399
+ });
400
+ }
401
+ /** The platform's 403 refusals of a version write that are not about access. */
402
+ const VERSION_REFUSAL_ERROR_TYPE_SET = new Set([
403
+ APIFY_ERROR_TYPE_VERSION_ALREADY_EXISTS,
404
+ APIFY_ERROR_TYPE_TOO_MANY_VERSIONS,
405
+ APIFY_ERROR_TYPE_VERSIONS_SIZE_EXCEEDED,
406
+ ]);
407
+ /**
408
+ * A `UserInputError`, or the platform's refusal of a taken version number or of a version over the limit on the
409
+ * number of versions or on their combined size, as a soft failure with the platform's own message; anything else is
410
+ * rethrown for the tool-call engine to report. The engine would add a token-access hint to these 403s, which
411
+ * contradicts their reason.
412
+ */
413
+ export function respondToSourceToolError(error) {
414
+ if (error instanceof UserInputError)
415
+ return respondUserError(error.message);
416
+ if (error instanceof ApifyApiError && VERSION_REFUSAL_ERROR_TYPE_SET.has(error.type)) {
417
+ return respondUserError(`${error.message} (API error type: ${error.type})`, { httpStatus: error.statusCode });
418
+ }
419
+ throw error;
420
+ }
421
+ /**
422
+ * The response to an error of a create POST. apify-client retries the POST after a network error, a timeout, a 429,
423
+ * or a 5xx, so when the platform refuses a retry as taken (`takenErrorType`), an attempt it saved but did not answer
424
+ * may have created what it refused (`refused`, such as `version 0.2`): the response says so, then adds `note` when
425
+ * given. Any other error goes to `respondToSourceToolError`.
426
+ */
427
+ export function respondToCreateError(error, params) {
428
+ const { takenErrorType, loadedToolNames, refused, created, sentFiles, note } = params;
429
+ if (!(error instanceof ApifyApiError && error.type === takenErrorType && error.attempt > 1)) {
430
+ return respondToSourceToolError(error);
431
+ }
432
+ const readTool = loadedToolNames.includes(HELPER_TOOLS.ACTOR_VERSION_GET)
433
+ ? `; ${HELPER_TOOLS.ACTOR_VERSION_GET} reads its files`
434
+ : '';
435
+ const noteText = note === undefined ? '' : ` ${note}`;
436
+ return respondUserError(`The platform refused ${refused} as taken when the request was retried, so an earlier attempt of this call ` +
437
+ `may have created ${created}. If it holds ${sentFiles}, this call created it${readTool}.${noteText}`, { httpStatus: error.statusCode });
438
+ }
439
+ //# sourceMappingURL=source_helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source_helpers.js","sourceRoot":"","sources":["../../../src/tools/versions/source_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGlC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EACH,kCAAkC,EAClC,uCAAuC,EACvC,uCAAuC,EACvC,YAAY,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;A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gB,CAAC,GAAG,KAAK,CAAC,OAAO,qBAAqB,KAAK,CAAC,IAAI,GAAG,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;IAClH,CAAC;IACD,MAAM,KAAK,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAChC,KAAc,EACd,MAOC;IAED,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACtF,IAAI,CAAC,CAAC,KAAK,YAAY,aAAa,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,IAAI,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC;QAC1F,OAAO,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,iBAAiB,CAAC;QACrE,CAAC,CAAC,KAAK,YAAY,CAAC,iBAAiB,kBAAkB;QACvD,CAAC,CAAC,EAAE,CAAC;IACT,MAAM,QAAQ,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;IACtD,OAAO,gBAAgB,CACnB,wBAAwB,OAAO,6EAA6E;QACxG,oBAAoB,OAAO,iBAAiB,SAAS,yBAAyB,QAAQ,IAAI,QAAQ,EAAE,EACxG,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CACnC,CAAC;AACN,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ToolEntry } from '../../types.js';
2
+ /**
3
+ * https://docs.apify.com/api/v2/actor-get
4
+ * /v2/actors/{actorId}
5
+ * https://docs.apify.com/api/v2/actor-version-put
6
+ * /v2/actors/{actorId}/versions/{versionNumber}
7
+ *
8
+ * The operations apply to the version as read in this call, and the result is stored with one version PUT that
9
+ * carries only the source keys, never envVars or buildTag. Conflicts are caught by each operation's check and by
10
+ * expectedRevision. A save from Apify Console, `apify push`, or another MCP server that lands between this call's read
11
+ * and its PUT is not detected: the platform's version PUT takes no precondition, and this stays so until it gets a
12
+ * conditional one.
13
+ */
14
+ export declare const updateActorVersion: ToolEntry;
15
+ //# sourceMappingURL=update_actor_version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update_actor_version.d.ts","sourceRoot":"","sources":["../../../src/tools/versions/update_actor_version.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAoB,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AAgYnF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAoHtB,CAAC"}