@withgateway/sdk 0.1.20 → 0.2.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 (1222) hide show
  1. package/README.md +165 -2
  2. package/dist/cli.js +14075 -1326
  3. package/dist/cli.js.map +1 -1
  4. package/dist/cli.mjs +14073 -1325
  5. package/dist/cli.mjs.map +1 -1
  6. package/dist/files/index.d.mts +2 -0
  7. package/dist/files/index.d.ts +2 -0
  8. package/dist/files/index.js +446 -0
  9. package/dist/files/index.js.map +1 -0
  10. package/dist/files/index.mjs +395 -0
  11. package/dist/files/index.mjs.map +1 -0
  12. package/dist/index-BgvvQ3BC.d.ts +170 -0
  13. package/dist/index-CLkMr6VG.d.ts +171 -0
  14. package/dist/index-CdbmO4aX.d.mts +171 -0
  15. package/dist/index-CiKWoroJ.d.mts +170 -0
  16. package/dist/index.d.mts +3 -1
  17. package/dist/index.d.ts +3 -1
  18. package/dist/index.js +3341 -241
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +3279 -235
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/traces/index.d.mts +2 -0
  23. package/dist/traces/index.d.ts +2 -0
  24. package/dist/traces/index.js +320 -0
  25. package/dist/traces/index.js.map +1 -0
  26. package/dist/traces/index.mjs +278 -0
  27. package/dist/traces/index.mjs.map +1 -0
  28. package/dist/tracing/index.js +24 -2
  29. package/dist/tracing/index.js.map +1 -1
  30. package/dist/tracing/index.mjs +24 -2
  31. package/dist/tracing/index.mjs.map +1 -1
  32. package/dist/worlds/index.d.mts +1419 -25
  33. package/dist/worlds/index.d.ts +1419 -25
  34. package/dist/worlds/index.js +2829 -87
  35. package/dist/worlds/index.js.map +1 -1
  36. package/dist/worlds/index.mjs +2824 -83
  37. package/dist/worlds/index.mjs.map +1 -1
  38. package/package.json +24 -2
  39. package/runtime/gatewaysdk/__init__.py +0 -0
  40. package/runtime/gatewaysdk/environment/__init__.py +108 -0
  41. package/runtime/gatewaysdk/environment/_bundle.py +281 -0
  42. package/runtime/gatewaysdk/environment/_harbor.py +276 -0
  43. package/runtime/gatewaysdk/environment/_materialize.py +97 -0
  44. package/runtime/gatewaysdk/environment/_tar.py +33 -0
  45. package/runtime/gatewaysdk/environment/_world.py +359 -0
  46. package/runtime/gatewaysdk/environment/core.py +527 -0
  47. package/runtime/gatewaysdk/environment/errors.py +58 -0
  48. package/runtime/gatewaysdk/environment/runtime.py +150 -0
  49. package/runtime/gatewaysdk/environment/schema/__init__.py +43 -0
  50. package/runtime/gatewaysdk/environment/schema/__main__.py +360 -0
  51. package/runtime/gatewaysdk/environment/schema/_slack_fidelity.py +116 -0
  52. package/runtime/gatewaysdk/environment/schema/_slack_scenario.py +183 -0
  53. package/runtime/gatewaysdk/environment/schema/api.py +1824 -0
  54. package/runtime/gatewaysdk/environment/schema/batch.py +785 -0
  55. package/runtime/gatewaysdk/environment/schema/compiler.py +693 -0
  56. package/runtime/gatewaysdk/environment/schema/conform.py +520 -0
  57. package/runtime/gatewaysdk/environment/schema/connector.py +1116 -0
  58. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/api/handlers.py +778 -0
  59. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/connector.toml +671 -0
  60. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/handlers.py +18 -0
  61. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/parity.json +34 -0
  62. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/provenance.json +1768 -0
  63. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/instruction.md +7 -0
  64. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/scenario.toml +2 -0
  65. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_activities.json +24 -0
  66. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_activity_devices.json +12 -0
  67. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_applecare_coverages.json +52 -0
  68. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_apps.json +35 -0
  69. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_audit_events.json +139 -0
  70. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_apps.json +12 -0
  71. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_configurations.json +20 -0
  72. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_devices.json +16 -0
  73. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_packages.json +8 -0
  74. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_user_groups.json +12 -0
  75. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_users.json +12 -0
  76. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprints.json +39 -0
  77. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_configurations.json +64 -0
  78. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_device_assignments.json +20 -0
  79. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_mdm_device_details.json +55 -0
  80. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_mdm_devices.json +33 -0
  81. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_mdm_servers.json +56 -0
  82. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_org_devices.json +178 -0
  83. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_organizational_unit_memberships.json +16 -0
  84. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_organizational_units.json +24 -0
  85. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_packages.json +20 -0
  86. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_user_group_memberships.json +16 -0
  87. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_user_groups.json +30 -0
  88. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_users.json +115 -0
  89. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scope.toml +139 -0
  90. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/tests/tools.json +48 -0
  91. package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/world.json +2366 -0
  92. package/runtime/gatewaysdk/environment/schema/connectors/asana/api/handlers.py +1026 -0
  93. package/runtime/gatewaysdk/environment/schema/connectors/asana/connector.toml +511 -0
  94. package/runtime/gatewaysdk/environment/schema/connectors/asana/fidelity.json +89 -0
  95. package/runtime/gatewaysdk/environment/schema/connectors/asana/handlers.py +40 -0
  96. package/runtime/gatewaysdk/environment/schema/connectors/asana/provenance.json +101 -0
  97. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/scenario.toml +2 -0
  98. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/account_settings.json +12 -0
  99. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/custom_field_settings.json +60 -0
  100. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/custom_fields.json +43 -0
  101. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/enum_options.json +52 -0
  102. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/notifications.json +103 -0
  103. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/project_favorites.json +12 -0
  104. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/project_memberships.json +144 -0
  105. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/projects.json +120 -0
  106. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/recent_projects.json +19 -0
  107. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/sections.json +102 -0
  108. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/stories.json +852 -0
  109. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/task_custom_fields.json +508 -0
  110. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/task_followers.json +368 -0
  111. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/task_memberships.json +184 -0
  112. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/tasks.json +1921 -0
  113. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/teams.json +22 -0
  114. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/user_task_list_sections.json +32 -0
  115. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/user_task_lists.json +11 -0
  116. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/users.json +60 -0
  117. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/workspace_memberships.json +76 -0
  118. package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/workspaces.json +13 -0
  119. package/runtime/gatewaysdk/environment/schema/connectors/asana/scope.toml +156 -0
  120. package/runtime/gatewaysdk/environment/schema/connectors/asana/tests/routes.json +298 -0
  121. package/runtime/gatewaysdk/environment/schema/connectors/asana/tests/tools.json +152 -0
  122. package/runtime/gatewaysdk/environment/schema/connectors/asana/ui/static/assets/index-DTTTJ6a4.css +1 -0
  123. package/runtime/gatewaysdk/environment/schema/connectors/asana/ui/static/assets/index-WS8dLEjv.js +67 -0
  124. package/runtime/gatewaysdk/environment/schema/connectors/asana/ui/static/index.html +40 -0
  125. package/runtime/gatewaysdk/environment/schema/connectors/asana/world.json +1911 -0
  126. package/runtime/gatewaysdk/environment/schema/connectors/base.json +28 -0
  127. package/runtime/gatewaysdk/environment/schema/connectors/confluence/api/handlers.py +847 -0
  128. package/runtime/gatewaysdk/environment/schema/connectors/confluence/connector.toml +457 -0
  129. package/runtime/gatewaysdk/environment/schema/connectors/confluence/handlers.py +176 -0
  130. package/runtime/gatewaysdk/environment/schema/connectors/confluence/provenance.json +187 -0
  131. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/instruction.md +39 -0
  132. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/scenario.toml +3 -0
  133. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_favourites.json +29 -0
  134. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_footer_comments.json +984 -0
  135. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_inline_comments.json +355 -0
  136. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_labels.json +99 -0
  137. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_notifications.json +40 -0
  138. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_page_labels.json +209 -0
  139. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_page_versions.json +828 -0
  140. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_pages.json +949 -0
  141. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_recently_viewed_pages.json +59 -0
  142. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_sites.json +12 -0
  143. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_spaces.json +128 -0
  144. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_users.json +100 -0
  145. package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_watches.json +96 -0
  146. package/runtime/gatewaysdk/environment/schema/connectors/confluence/tests/routes.json +212 -0
  147. package/runtime/gatewaysdk/environment/schema/connectors/confluence/tests/tools.json +140 -0
  148. package/runtime/gatewaysdk/environment/schema/connectors/confluence/tests/writes.json +201 -0
  149. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/assets/index-BWaOVdpn.js +70 -0
  150. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/assets/index-CKyfi3i5.css +1 -0
  151. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-01.svg +1 -0
  152. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-02.svg +1 -0
  153. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-03.svg +1 -0
  154. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-04.svg +1 -0
  155. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-05.svg +1 -0
  156. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-06.svg +1 -0
  157. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-DES.svg +1 -0
  158. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-ENG.svg +1 -0
  159. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-OPS.svg +1 -0
  160. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-ORB.svg +1 -0
  161. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-PN.svg +1 -0
  162. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/fonts/AtlassianMono-latin.woff2 +0 -0
  163. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/fonts/AtlassianSans-latin.woff2 +0 -0
  164. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/fonts/AtlassianSansItalic-latin.woff2 +0 -0
  165. package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/index.html +47 -0
  166. package/runtime/gatewaysdk/environment/schema/connectors/confluence/world.json +1346 -0
  167. package/runtime/gatewaysdk/environment/schema/connectors/custom/handlers.py +18 -0
  168. package/runtime/gatewaysdk/environment/schema/connectors/custom/provenance.json +35 -0
  169. package/runtime/gatewaysdk/environment/schema/connectors/custom/tests/tools.json +123 -0
  170. package/runtime/gatewaysdk/environment/schema/connectors/custom/world.json +211 -0
  171. package/runtime/gatewaysdk/environment/schema/connectors/github/api/handlers.py +2923 -0
  172. package/runtime/gatewaysdk/environment/schema/connectors/github/connector.toml +2091 -0
  173. package/runtime/gatewaysdk/environment/schema/connectors/github/handlers.py +81 -0
  174. package/runtime/gatewaysdk/environment/schema/connectors/github/parity.json +37 -0
  175. package/runtime/gatewaysdk/environment/schema/connectors/github/provenance.json +162 -0
  176. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/instruction.md +18 -0
  177. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/scenario.toml +2 -0
  178. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_apps.json +49 -0
  179. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_artifacts.json +26 -0
  180. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_branches.json +443 -0
  181. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_check_runs.json +220 -0
  182. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_check_suites.json +404 -0
  183. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_code_scanning_alerts.json +126 -0
  184. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_collaborators.json +100 -0
  185. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_commit_comments.json +43 -0
  186. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_commit_statuses.json +80 -0
  187. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_commits.json +461 -0
  188. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_dependabot_alerts.json +168 -0
  189. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_deployment_statuses.json +86 -0
  190. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_deployments.json +94 -0
  191. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_environments.json +31 -0
  192. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_gist_comments.json +38 -0
  193. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_gists.json +118 -0
  194. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_git_refs.json +59 -0
  195. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_installations.json +54 -0
  196. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_issue_comments.json +151 -0
  197. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_issue_events.json +606 -0
  198. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_issue_types.json +26 -0
  199. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_issues.json +758 -0
  200. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_labels.json +64 -0
  201. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_licenses.json +54 -0
  202. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_milestones.json +130 -0
  203. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_organization_memberships.json +139 -0
  204. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_organizations.json +38 -0
  205. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_pull_requests.json +874 -0
  206. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_release_assets.json +45 -0
  207. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_releases.json +92 -0
  208. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_repositories.json +797 -0
  209. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_repository_invitations.json +184 -0
  210. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_review_comments.json +66 -0
  211. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_reviews.json +138 -0
  212. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_secret_scanning_alerts.json +50 -0
  213. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_stargazers.json +88 -0
  214. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_tags.json +28 -0
  215. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_team_memberships.json +25 -0
  216. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_team_repositories.json +258 -0
  217. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_teams.json +130 -0
  218. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_users.json +174 -0
  219. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_webhooks.json +31 -0
  220. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_workflow_jobs.json +115 -0
  221. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_workflow_runs.json +1021 -0
  222. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_workflows.json +30 -0
  223. package/runtime/gatewaysdk/environment/schema/connectors/github/scope.toml +597 -0
  224. package/runtime/gatewaysdk/environment/schema/connectors/github/tests/tools.json +79 -0
  225. package/runtime/gatewaysdk/environment/schema/connectors/github/vendor-openapi.json +1 -0
  226. package/runtime/gatewaysdk/environment/schema/connectors/github/world.json +15762 -0
  227. package/runtime/gatewaysdk/environment/schema/connectors/gmail/api/handlers.py +1413 -0
  228. package/runtime/gatewaysdk/environment/schema/connectors/gmail/connector.toml +630 -0
  229. package/runtime/gatewaysdk/environment/schema/connectors/gmail/handlers.py +136 -0
  230. package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/scenario.toml +1 -0
  231. package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/10-gmail_profiles.json +10 -0
  232. package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/20-gmail_labels.json +205 -0
  233. package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/30-gmail_contacts.json +234 -0
  234. package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/40-gmail_threads.json +374 -0
  235. package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/50-gmail_messages.json +1015 -0
  236. package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/60-gmail_message_parts.json +3039 -0
  237. package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/70-gmail_attachments.json +28 -0
  238. package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/80-gmail_drafts.json +39 -0
  239. package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/90-gmail_client_settings.json +103 -0
  240. package/runtime/gatewaysdk/environment/schema/connectors/gmail/world.json +784 -0
  241. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/api/handlers.py +454 -0
  242. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/connector.toml +519 -0
  243. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/handlers.py +23 -0
  244. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/provenance.json +229 -0
  245. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/instruction.md +25 -0
  246. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/scenario.toml +1 -0
  247. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/10-calendar_calendars.json +75 -0
  248. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/20-calendar_calendar_list_entries.json +115 -0
  249. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/30-calendar_acl_rules.json +124 -0
  250. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/40-calendar_events.json +810 -0
  251. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/50-calendar_settings.json +76 -0
  252. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/60-calendar_channels.json +26 -0
  253. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/70-calendar_colors.json +48 -0
  254. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scope.toml +105 -0
  255. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/tests/tools.json +53 -0
  256. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/vendor-openapi.json +4185 -0
  257. package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/world.json +1384 -0
  258. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/api/handlers.py +782 -0
  259. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/connector.toml +373 -0
  260. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/google-docs-types.json +4939 -0
  261. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/handlers.py +197 -0
  262. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/provenance.json +191 -0
  263. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/instruction.md +29 -0
  264. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/scenario.toml +2 -0
  265. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_comments.json +50 -0
  266. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_documents.json +8096 -0
  267. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_files.json +1187 -0
  268. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_permissions.json +543 -0
  269. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_replies.json +22 -0
  270. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_revisions.json +643 -0
  271. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_users.json +32 -0
  272. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scope.toml +148 -0
  273. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/tests/api.json +319 -0
  274. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/tests/tools.json +262 -0
  275. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/assets/index-BH9fmZSS.css +1 -0
  276. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/assets/index-CU4Fk9dX.js +67 -0
  277. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/README.md +20 -0
  278. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/google-sans-variable.woff2 +0 -0
  279. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/roboto-italic-variable-latin.woff2 +0 -0
  280. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/roboto-variable-latin-ext.woff2 +0 -0
  281. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/roboto-variable-latin.woff2 +0 -0
  282. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/icons/material_common_sprite1038_gm3_grey_medium.svg +1 -0
  283. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/index.html +13 -0
  284. package/runtime/gatewaysdk/environment/schema/connectors/google-docs/world.json +4489 -0
  285. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/api/handlers.py +466 -0
  286. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/connector.toml +626 -0
  287. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/handlers.py +55 -0
  288. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/provenance.json +342 -0
  289. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/instruction.md +11 -0
  290. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/scenario.toml +2 -0
  291. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_access_proposals.json +31 -0
  292. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_approvals.json +145 -0
  293. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_apps.json +81 -0
  294. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_comments.json +70 -0
  295. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_drives.json +71 -0
  296. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_files.json +700 -0
  297. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_labels.json +75 -0
  298. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_permissions.json +93 -0
  299. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_replies.json +66 -0
  300. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_revisions.json +82 -0
  301. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scope.toml +126 -0
  302. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/tests/tools.json +101 -0
  303. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/vendor-openapi.json +6193 -0
  304. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/world.json +2150 -0
  305. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/api/handlers.py +1645 -0
  306. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/connector.toml +414 -0
  307. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/handlers.py +200 -0
  308. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/scenario.toml +2 -0
  309. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_cells.json +10252 -0
  310. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_charts.json +103 -0
  311. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_conditional_formats.json +138 -0
  312. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_dimensions.json +256 -0
  313. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_named_ranges.json +16 -0
  314. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_permissions.json +31 -0
  315. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_sheets.json +95 -0
  316. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_spreadsheets.json +14 -0
  317. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_view_states.json +26 -0
  318. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/tests/page.json +311 -0
  319. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/tests/vendor.json +843 -0
  320. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/assets/index-CUpfKgm_.js +40 -0
  321. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/assets/index-D3VhwBIC.css +1 -0
  322. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSans-400.woff2 +0 -0
  323. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSans-500.woff2 +0 -0
  324. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSans-700.woff2 +0 -0
  325. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSansText-400.woff2 +0 -0
  326. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSansText-500.woff2 +0 -0
  327. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSansText-700.woff2 +0 -0
  328. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/Roboto-400.woff2 +0 -0
  329. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/Roboto-500.woff2 +0 -0
  330. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/Roboto-700.woff2 +0 -0
  331. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/index.html +26 -0
  332. package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/world.json +4029 -0
  333. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/api/handlers.py +800 -0
  334. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/connector.toml +776 -0
  335. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/handlers.py +226 -0
  336. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/instruction.md +11 -0
  337. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/scenario.toml +2 -0
  338. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_accounts.json +17 -0
  339. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_associations.json +1478 -0
  340. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_calls.json +147 -0
  341. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_companies.json +144 -0
  342. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_contacts.json +284 -0
  343. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_deals.json +204 -0
  344. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_emails.json +160 -0
  345. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_meetings.json +147 -0
  346. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_nav_items.json +204 -0
  347. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_notes.json +160 -0
  348. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_notifications.json +25 -0
  349. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_object_views.json +334 -0
  350. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_owners.json +76 -0
  351. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_pipeline_stages.json +109 -0
  352. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_pipelines.json +13 -0
  353. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_properties.json +1220 -0
  354. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_tasks.json +394 -0
  355. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_tickets.json +34 -0
  356. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/assets/index-hdb5vB78.css +1 -0
  357. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/assets/index-xhg5ASqE.js +68 -0
  358. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-300.ttf +0 -0
  359. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-400.ttf +0 -0
  360. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-500.ttf +0 -0
  361. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-600.ttf +0 -0
  362. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-700.ttf +0 -0
  363. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-latin.woff2 +0 -0
  364. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/add.svg +1 -0
  365. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/avatar.svg +1 -0
  366. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/bell.svg +3 -0
  367. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/breeze.svg +4 -0
  368. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/call.svg +1 -0
  369. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/chevron-up.svg +3 -0
  370. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/companies.svg +1 -0
  371. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/contact.svg +1 -0
  372. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/contacts.svg +1 -0
  373. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/date.svg +1 -0
  374. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/deals.svg +1 -0
  375. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/duplicate.svg +1 -0
  376. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/export.svg +3 -0
  377. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/external-link.svg +1 -0
  378. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/filter-lines.svg +3 -0
  379. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/frame-expand.svg +3 -0
  380. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/funnel.svg +3 -0
  381. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/help.svg +1 -0
  382. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/hierarchy.svg +4 -0
  383. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/home.svg +1 -0
  384. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/hubspot-logo.svg +1 -0
  385. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/info.svg +1 -0
  386. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/kanban.svg +1 -0
  387. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/marketing-email.svg +1 -0
  388. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/marketplace.svg +1 -0
  389. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/meetings.svg +1 -0
  390. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/more.svg +1 -0
  391. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/pencil.svg +3 -0
  392. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/pin.svg +3 -0
  393. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/prospecting.svg +1 -0
  394. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/refresh.svg +1 -0
  395. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/search.svg +1 -0
  396. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/settings.svg +1 -0
  397. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/sidebar-collapse.svg +3 -0
  398. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/sort.svg +3 -0
  399. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/table.svg +1 -0
  400. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/tasks.svg +1 -0
  401. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/thumbs-down.svg +1 -0
  402. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/thumbs-up.svg +1 -0
  403. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/undo.svg +3 -0
  404. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/upgrade-arrow.svg +1 -0
  405. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/vertical-dots.svg +5 -0
  406. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/workflows.svg +1 -0
  407. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/index.html +37 -0
  408. package/runtime/gatewaysdk/environment/schema/connectors/hubspot/world.json +1347 -0
  409. package/runtime/gatewaysdk/environment/schema/connectors/jamf/api/handlers.py +987 -0
  410. package/runtime/gatewaysdk/environment/schema/connectors/jamf/connector.toml +3057 -0
  411. package/runtime/gatewaysdk/environment/schema/connectors/jamf/handlers.py +34 -0
  412. package/runtime/gatewaysdk/environment/schema/connectors/jamf/parity.json +49 -0
  413. package/runtime/gatewaysdk/environment/schema/connectors/jamf/provenance.json +9495 -0
  414. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/scenario.toml +4 -0
  415. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_account_groups.json +64 -0
  416. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_accounts.json +58 -0
  417. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_advanced_computer_searches.json +139 -0
  418. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_advanced_mobile_device_searches.json +61 -0
  419. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_advanced_user_content_searches.json +61 -0
  420. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_advanced_user_searches.json +124 -0
  421. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_api_integrations.json +37 -0
  422. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_api_roles.json +25 -0
  423. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_app_request_form_input_fields.json +22 -0
  424. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_buildings.json +34 -0
  425. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_byo_profiles.json +46 -0
  426. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_categories.json +19 -0
  427. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_classes.json +217 -0
  428. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_cloud_idps.json +19 -0
  429. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computer_group_members.json +16 -0
  430. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computer_groups.json +38 -0
  431. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computer_invitations.json +82 -0
  432. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computer_prestages.json +274 -0
  433. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computers.json +1537 -0
  434. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_configuration_profiles.json +649 -0
  435. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_departments.json +16 -0
  436. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_device_enrollment_devices.json +70 -0
  437. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_device_enrollments.json +46 -0
  438. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_directory_bindings.json +34 -0
  439. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_disk_encryption_configurations.json +22 -0
  440. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_distribution_points.json +91 -0
  441. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_dock_items.json +25 -0
  442. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_ebooks.json +43 -0
  443. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_enrollment_customizations.json +43 -0
  444. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_extension_attributes.json +52 -0
  445. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_ibeacons.json +25 -0
  446. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_inventory_preload_records.json +100 -0
  447. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_ios_branding_configurations.json +31 -0
  448. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_ldap_servers.json +16 -0
  449. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_licensed_software_records.json +244 -0
  450. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mac_applications.json +610 -0
  451. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_macos_branding_configurations.json +34 -0
  452. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_managed_software_update_plans.json +67 -0
  453. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mdm_commands.json +58 -0
  454. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_applications.json +700 -0
  455. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_configuration_profiles.json +652 -0
  456. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_enrollment_profiles.json +160 -0
  457. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_extension_attributes.json +43 -0
  458. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_group_members.json +16 -0
  459. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_groups.json +38 -0
  460. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_prestages.json +280 -0
  461. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_provisioning_profiles.json +31 -0
  462. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_devices.json +1558 -0
  463. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_network_segments.json +46 -0
  464. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_packages.json +118 -0
  465. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_patch_software_title_configurations.json +88 -0
  466. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_policies.json +1054 -0
  467. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_printers.json +52 -0
  468. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_removable_mac_addresses.json +16 -0
  469. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_restricted_software_titles.json +289 -0
  470. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_return_to_service_configurations.json +19 -0
  471. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_scripts.json +61 -0
  472. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_sites.json +19 -0
  473. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_software_update_servers.json +25 -0
  474. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_supervision_identities.json +22 -0
  475. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_user_extension_attributes.json +31 -0
  476. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_user_groups.json +112 -0
  477. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_users.json +37 -0
  478. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_volume_purchasing_locations.json +106 -0
  479. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_volume_purchasing_subscriptions.json +76 -0
  480. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_webhooks.json +70 -0
  481. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scope.toml +900 -0
  482. package/runtime/gatewaysdk/environment/schema/connectors/jamf/tests/tools.json +95 -0
  483. package/runtime/gatewaysdk/environment/schema/connectors/jamf/vendor-openapi.json +1 -0
  484. package/runtime/gatewaysdk/environment/schema/connectors/jamf/world.json +11559 -0
  485. package/runtime/gatewaysdk/environment/schema/connectors/jira/api/handlers.py +1056 -0
  486. package/runtime/gatewaysdk/environment/schema/connectors/jira/connector.toml +955 -0
  487. package/runtime/gatewaysdk/environment/schema/connectors/jira/handlers.py +87 -0
  488. package/runtime/gatewaysdk/environment/schema/connectors/jira/parity.json +27 -0
  489. package/runtime/gatewaysdk/environment/schema/connectors/jira/provenance.json +166 -0
  490. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/instruction.md +22 -0
  491. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/scenario.toml +3 -0
  492. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_boards.json +61 -0
  493. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_changelogs.json +136 -0
  494. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_comments.json +205 -0
  495. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_components.json +78 -0
  496. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_fields.json +498 -0
  497. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_issue_link_types.json +25 -0
  498. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_issue_links.json +190 -0
  499. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_issue_types.json +44 -0
  500. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_issues.json +1448 -0
  501. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_priorities.json +40 -0
  502. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_project_categories.json +16 -0
  503. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_projects.json +111 -0
  504. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_resolutions.json +22 -0
  505. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_sprint_issues.json +20 -0
  506. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_sprints.json +39 -0
  507. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_status_categories.json +25 -0
  508. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_statuses.json +60 -0
  509. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_transitions.json +179 -0
  510. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_users.json +83 -0
  511. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_versions.json +30 -0
  512. package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_worklogs.json +96 -0
  513. package/runtime/gatewaysdk/environment/schema/connectors/jira/scope.toml +255 -0
  514. package/runtime/gatewaysdk/environment/schema/connectors/jira/tests/tools.json +151 -0
  515. package/runtime/gatewaysdk/environment/schema/connectors/jira/vendor-openapi.json +13562 -0
  516. package/runtime/gatewaysdk/environment/schema/connectors/jira/world.json +3587 -0
  517. package/runtime/gatewaysdk/environment/schema/connectors/kandji/api/handlers.py +406 -0
  518. package/runtime/gatewaysdk/environment/schema/connectors/kandji/connector.toml +531 -0
  519. package/runtime/gatewaysdk/environment/schema/connectors/kandji/handlers.py +38 -0
  520. package/runtime/gatewaysdk/environment/schema/connectors/kandji/parity.json +29 -0
  521. package/runtime/gatewaysdk/environment/schema/connectors/kandji/provenance.json +335 -0
  522. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/scenario.toml +2 -0
  523. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_blueprint_items.json +22 -0
  524. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_blueprint_template_categories.json +14 -0
  525. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_blueprint_templates.json +38 -0
  526. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_blueprints.json +52 -0
  527. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_custom_apps.json +45 -0
  528. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_custom_profiles.json +32 -0
  529. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_custom_scripts.json +27 -0
  530. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_activities.json +43 -0
  531. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_apps.json +52 -0
  532. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_commands.json +41 -0
  533. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_notes.json +20 -0
  534. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_parameters.json +28 -0
  535. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_tags.json +16 -0
  536. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_devices.json +122 -0
  537. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_in_house_apps.json +33 -0
  538. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_library_item_activities.json +33 -0
  539. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_library_item_statuses.json +98 -0
  540. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_library_items.json +24 -0
  541. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_self_service_categories.json +12 -0
  542. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_tags.json +16 -0
  543. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_users.json +61 -0
  544. package/runtime/gatewaysdk/environment/schema/connectors/kandji/scope.toml +199 -0
  545. package/runtime/gatewaysdk/environment/schema/connectors/kandji/tests/tools.json +64 -0
  546. package/runtime/gatewaysdk/environment/schema/connectors/kandji/vendor-openapi.json +5463 -0
  547. package/runtime/gatewaysdk/environment/schema/connectors/kandji/world.json +1817 -0
  548. package/runtime/gatewaysdk/environment/schema/connectors/linear/api/handlers.py +139 -0
  549. package/runtime/gatewaysdk/environment/schema/connectors/linear/connector.toml +1574 -0
  550. package/runtime/gatewaysdk/environment/schema/connectors/linear/handlers.py +23 -0
  551. package/runtime/gatewaysdk/environment/schema/connectors/linear/provenance.json +142 -0
  552. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/scenario.toml +2 -0
  553. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/attachments.json +21 -0
  554. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/comments.json +79 -0
  555. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/customer_needs.json +21 -0
  556. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/customer_statuses.json +26 -0
  557. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/customer_tiers.json +26 -0
  558. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/customers.json +48 -0
  559. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/cycles.json +86 -0
  560. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/documents.json +27 -0
  561. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/initiative_projects.json +13 -0
  562. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/initiative_updates.json +23 -0
  563. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/initiatives.json +41 -0
  564. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/issue_labels.json +16 -0
  565. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/issue_relations.json +13 -0
  566. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/issues.json +264 -0
  567. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/labels.json +52 -0
  568. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/organizations.json +53 -0
  569. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_labels.json +34 -0
  570. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_members.json +16 -0
  571. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_milestones.json +30 -0
  572. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_relations.json +18 -0
  573. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_statuses.json +76 -0
  574. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_updates.json +42 -0
  575. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/projects.json +110 -0
  576. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/reactions.json +28 -0
  577. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/roadmap_projects.json +13 -0
  578. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/roadmaps.json +19 -0
  579. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/team_memberships.json +34 -0
  580. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/teams.json +114 -0
  581. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/templates.json +27 -0
  582. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/users.json +106 -0
  583. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/webhooks.json +21 -0
  584. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/workflow_states.json +108 -0
  585. package/runtime/gatewaysdk/environment/schema/connectors/linear/scope.toml +87 -0
  586. package/runtime/gatewaysdk/environment/schema/connectors/linear/tests/tools.json +52 -0
  587. package/runtime/gatewaysdk/environment/schema/connectors/linear/world.json +6148 -0
  588. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/api/handlers.py +1218 -0
  589. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/connector.toml +1246 -0
  590. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/fidelity.json +75 -0
  591. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/handlers.py +1 -0
  592. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/provenance.json +1632 -0
  593. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/instruction.md +12 -0
  594. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/scenario.toml +2 -0
  595. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_async_operations.json +47 -0
  596. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channel_hosted_contents.json +12 -0
  597. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channel_members.json +88 -0
  598. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channel_messages.json +313 -0
  599. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channel_replies.json +128 -0
  600. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channels.json +319 -0
  601. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chat_hosted_contents.json +18 -0
  602. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chat_members.json +155 -0
  603. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chat_messages.json +265 -0
  604. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chat_views.json +37 -0
  605. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chats.json +167 -0
  606. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_incoming_channels.json +25 -0
  607. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_pinned_messages.json +9 -0
  608. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_reply_hosted_contents.json +13 -0
  609. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_shared_channel_teams.json +32 -0
  610. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_tag_members.json +31 -0
  611. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_tags.json +32 -0
  612. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_team_members.json +117 -0
  613. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_teams.json +193 -0
  614. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scope.md +303 -0
  615. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/teams-types.json +1739 -0
  616. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/tests/routes.json +101 -0
  617. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/vendor-openapi.json +11280 -0
  618. package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/world.json +926 -0
  619. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/api/handlers.py +571 -0
  620. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/connector.toml +1484 -0
  621. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/handlers.py +32 -0
  622. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/parity.json +77 -0
  623. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/provenance.json +303 -0
  624. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/instruction.md +11 -0
  625. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/scenario.toml +2 -0
  626. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_accounting_periods.json +107 -0
  627. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_accounts.json +514 -0
  628. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_classifications.json +64 -0
  629. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_contacts.json +90 -0
  630. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_credit_memos.json +112 -0
  631. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_currencies.json +37 -0
  632. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_customer_payments.json +108 -0
  633. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_customers.json +232 -0
  634. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_departments.json +80 -0
  635. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_employees.json +124 -0
  636. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_invoices.json +229 -0
  637. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_item_fulfillments.json +85 -0
  638. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_items.json +237 -0
  639. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_journal_entries.json +217 -0
  640. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_locations.json +62 -0
  641. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_price_levels.json +28 -0
  642. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_purchase_orders.json +152 -0
  643. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_sales_order_lines.json +235 -0
  644. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_sales_orders.json +219 -0
  645. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_subsidiaries.json +85 -0
  646. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_terms.json +48 -0
  647. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_vendor_bills.json +170 -0
  648. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_vendors.json +140 -0
  649. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scope.toml +296 -0
  650. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/tests/tools.json +82 -0
  651. package/runtime/gatewaysdk/environment/schema/connectors/netsuite/world.json +39076 -0
  652. package/runtime/gatewaysdk/environment/schema/connectors/notion/api/handlers.py +1330 -0
  653. package/runtime/gatewaysdk/environment/schema/connectors/notion/connector.toml +386 -0
  654. package/runtime/gatewaysdk/environment/schema/connectors/notion/handlers.py +54 -0
  655. package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/scenario.toml +2 -0
  656. package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/blocks.json +4197 -0
  657. package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/calendar_events.json +18 -0
  658. package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/collection_views.json +175 -0
  659. package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/comments.json +109 -0
  660. package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/databases.json +417 -0
  661. package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/favorites.json +3 -0
  662. package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/notifications.json +49 -0
  663. package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/pages.json +3758 -0
  664. package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/spaces.json +28 -0
  665. package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/teamspaces.json +3 -0
  666. package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/users.json +92 -0
  667. package/runtime/gatewaysdk/environment/schema/connectors/notion/tests/01-reads.json +165 -0
  668. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/assets/index-DQ36W7RG.css +1 -0
  669. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/assets/index-DythuuUy.js +67 -0
  670. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000002.svg +1 -0
  671. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000003.svg +1 -0
  672. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000004.svg +1 -0
  673. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000005.svg +1 -0
  674. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000006.svg +1 -0
  675. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000007.svg +1 -0
  676. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000008.svg +1 -0
  677. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/covers/dusk-harbor.png +0 -0
  678. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/covers/ember-coast.png +0 -0
  679. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/covers/green-ridge.png +0 -0
  680. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f30a.svg +1 -0
  681. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f331.svg +1 -0
  682. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f373.svg +1 -0
  683. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3a7.svg +1 -0
  684. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3a8.svg +1 -0
  685. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3ac.svg +1 -0
  686. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3af.svg +1 -0
  687. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3c4.svg +1 -0
  688. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3d6.svg +1 -0
  689. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3e0.svg +1 -0
  690. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f44b.svg +1 -0
  691. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4a1.svg +1 -0
  692. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4b0.svg +1 -0
  693. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4bc.svg +1 -0
  694. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4c5.svg +1 -0
  695. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4c8.svg +1 -0
  696. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4cb.svg +1 -0
  697. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4ce.svg +1 -0
  698. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4d1.svg +1 -0
  699. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4d3.svg +1 -0
  700. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4d6.svg +1 -0
  701. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4da.svg +1 -0
  702. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4dd.svg +1 -0
  703. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4ec.svg +1 -0
  704. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4f7.svg +1 -0
  705. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f527.svg +1 -0
  706. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f55b.svg +1 -0
  707. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f5c2.svg +1 -0
  708. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f5d3.svg +1 -0
  709. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f680.svg +1 -0
  710. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f6a2.svg +1 -0
  711. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9ca.svg +1 -0
  712. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9e0.svg +1 -0
  713. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9ea.svg +1 -0
  714. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9ed.svg +1 -0
  715. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9f0.svg +1 -0
  716. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1fab6.svg +1 -0
  717. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2600.svg +1 -0
  718. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2693.svg +1 -0
  719. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2705.svg +1 -0
  720. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2708.svg +1 -0
  721. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/270f.svg +1 -0
  722. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2b50.svg +1 -0
  723. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/favicon.svg +1 -0
  724. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/fonts/SourceSerif4-latin.woff2 +0 -0
  725. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/index.html +31 -0
  726. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/learn/content-blocks.png +0 -0
  727. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/learn/databases.png +0 -0
  728. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/learn/sharing.png +0 -0
  729. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/learn/style-content.png +0 -0
  730. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/photos/home-icon.png +0 -0
  731. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/photos/viewer.png +0 -0
  732. package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/photos/workspace.png +0 -0
  733. package/runtime/gatewaysdk/environment/schema/connectors/notion/world.json +2796 -0
  734. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_admin_role_assignments.json +44 -0
  735. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_app_assignments.json +40 -0
  736. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_app_group_assignments.json +59 -0
  737. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_applications.json +265 -0
  738. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_console_dashboards.json +91 -0
  739. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_device_users.json +32 -0
  740. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_devices.json +89 -0
  741. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_group_memberships.json +156 -0
  742. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_groups.json +100 -0
  743. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_orgs.json +20 -0
  744. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_policies.json +84 -0
  745. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_system_log_events.json +9656 -0
  746. package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_users.json +744 -0
  747. package/runtime/gatewaysdk/environment/schema/connectors/outlook/api/handlers.py +624 -0
  748. package/runtime/gatewaysdk/environment/schema/connectors/outlook/connector.toml +381 -0
  749. package/runtime/gatewaysdk/environment/schema/connectors/outlook/handlers.py +54 -0
  750. package/runtime/gatewaysdk/environment/schema/connectors/outlook/provenance.json +408 -0
  751. package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/instruction.md +22 -0
  752. package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/scenario.toml +2 -0
  753. package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_attachments.json +44 -0
  754. package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_calendars.json +52 -0
  755. package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_contacts.json +326 -0
  756. package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_events.json +3050 -0
  757. package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_mail_folders.json +84 -0
  758. package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_mailbox_settings.json +35 -0
  759. package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_mailboxes.json +14 -0
  760. package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_messages.json +1400 -0
  761. package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_system_senders.json +44 -0
  762. package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_users.json +256 -0
  763. package/runtime/gatewaysdk/environment/schema/connectors/outlook/tests/routes.json +333 -0
  764. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/assets/index-DRVA5ahH.js +67 -0
  765. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/assets/index-kOnvVBhA.css +1 -0
  766. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/FluentSystemIcons-Filled.woff2 +0 -0
  767. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/FluentSystemIcons-Regular.woff2 +0 -0
  768. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/FluentSystemIcons-Resizable.woff2 +0 -0
  769. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/controlIcons.woff +0 -0
  770. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-bold.woff2 +0 -0
  771. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-light.woff2 +0 -0
  772. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-regular.woff2 +0 -0
  773. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-semibold.woff2 +0 -0
  774. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-semilight.woff2 +0 -0
  775. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/bookings.svg +1 -0
  776. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/calendar.svg +35 -0
  777. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/copilot.png +0 -0
  778. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/excel.svg +1 -0
  779. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/mail.svg +32 -0
  780. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/my-day.svg +1 -0
  781. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/newsletters.svg +37 -0
  782. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/no-mail-selected-dark.svg +1 -0
  783. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/no-mail-selected.svg +1 -0
  784. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/onedrive.svg +1 -0
  785. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/onenote.svg +1 -0
  786. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/org-explorer.png +0 -0
  787. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/outlook.svg +1 -0
  788. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/people.svg +34 -0
  789. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/powerpoint.svg +1 -0
  790. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/ribbon-layout.svg +1 -0
  791. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/sharepoint.svg +1 -0
  792. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/teams-chat.svg +1 -0
  793. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/teams.svg +1 -0
  794. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/to-do.png +0 -0
  795. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/viva.svg +1 -0
  796. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/word.svg +1 -0
  797. package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/index.html +34 -0
  798. package/runtime/gatewaysdk/environment/schema/connectors/outlook/world.json +686 -0
  799. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/api/handlers.py +447 -0
  800. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/connector.toml +3478 -0
  801. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/handlers.py +885 -0
  802. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/parity.json +46 -0
  803. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/provenance.json +4286 -0
  804. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/instruction.md +8 -0
  805. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/scenario.toml +2 -0
  806. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_account_contact_relations.json +20 -0
  807. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_account_contact_roles.json +16 -0
  808. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_account_partners.json +18 -0
  809. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_account_team_members.json +16 -0
  810. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_accounts.json +38 -0
  811. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_assets.json +35 -0
  812. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_attachments.json +16 -0
  813. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_business_hours.json +16 -0
  814. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_campaign_member_statuses.json +16 -0
  815. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_campaign_members.json +38 -0
  816. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_campaigns.json +35 -0
  817. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_comments.json +14 -0
  818. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_histories.json +18 -0
  819. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_milestones.json +18 -0
  820. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_statuses.json +16 -0
  821. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_team_members.json +14 -0
  822. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_team_roles.json +12 -0
  823. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_cases.json +42 -0
  824. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_collaboration_group_members.json +16 -0
  825. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_collaboration_groups.json +16 -0
  826. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contact_point_addresses.json +14 -0
  827. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contact_point_emails.json +14 -0
  828. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contact_point_phones.json +14 -0
  829. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contacts.json +34 -0
  830. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_document_links.json +14 -0
  831. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_documents.json +18 -0
  832. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_folders.json +13 -0
  833. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_notes.json +12 -0
  834. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_versions.json +24 -0
  835. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_workspaces.json +16 -0
  836. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contract_contact_roles.json +16 -0
  837. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contract_line_items.json +32 -0
  838. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contracts.json +40 -0
  839. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_dashboards.json +20 -0
  840. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_documents.json +22 -0
  841. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_email_message_relations.json +14 -0
  842. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_email_messages.json +21 -0
  843. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_email_templates.json +24 -0
  844. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_entitlements.json +32 -0
  845. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_events.json +26 -0
  846. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_feed_comments.json +19 -0
  847. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_feed_items.json +24 -0
  848. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_fiscal_year_settings.json +20 -0
  849. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_folders.json +18 -0
  850. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_group_members.json +12 -0
  851. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_groups.json +20 -0
  852. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_holidays.json +16 -0
  853. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_individuals.json +21 -0
  854. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_lead_statuses.json +14 -0
  855. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_leads.json +45 -0
  856. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_list_views.json +16 -0
  857. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_login_histories.json +18 -0
  858. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_milestone_types.json +14 -0
  859. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_notes.json +16 -0
  860. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_object_territory_associations.json +14 -0
  861. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunities.json +48 -0
  862. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_competitors.json +12 -0
  863. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_contact_roles.json +16 -0
  864. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_field_histories.json +18 -0
  865. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_histories.json +20 -0
  866. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_line_items.json +32 -0
  867. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_partners.json +16 -0
  868. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_stages.json +22 -0
  869. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_team_members.json +18 -0
  870. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_order_items.json +33 -0
  871. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_orders.json +44 -0
  872. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_organizations.json +18 -0
  873. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_partners.json +18 -0
  874. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_periods.json +18 -0
  875. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_permission_set_assignments.json +16 -0
  876. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_permission_sets.json +18 -0
  877. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_pricebook_entries.json +22 -0
  878. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_pricebooks.json +16 -0
  879. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_products.json +20 -0
  880. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_profiles.json +14 -0
  881. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_queue_sobjects.json +12 -0
  882. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_quote_line_items.json +43 -0
  883. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_quotes.json +40 -0
  884. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_record_actions.json +16 -0
  885. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_record_types.json +18 -0
  886. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_reports.json +18 -0
  887. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_service_contracts.json +32 -0
  888. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_sla_processes.json +18 -0
  889. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_solutions.json +18 -0
  890. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_task_priorities.json +14 -0
  891. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_task_relations.json +14 -0
  892. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_task_statuses.json +16 -0
  893. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_tasks.json +26 -0
  894. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_territories.json +20 -0
  895. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_territory_models.json +16 -0
  896. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_territory_types.json +18 -0
  897. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_topic_assignments.json +12 -0
  898. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_topics.json +14 -0
  899. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_user_roles.json +16 -0
  900. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_user_territory_associations.json +16 -0
  901. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_users.json +57 -0
  902. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_web_links.json +26 -0
  903. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_work_order_line_items.json +42 -0
  904. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_work_orders.json +46 -0
  905. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scope.toml +694 -0
  906. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/tests/tools.json +69 -0
  907. package/runtime/gatewaysdk/environment/schema/connectors/salesforce/world.json +21263 -0
  908. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/api/handlers.py +630 -0
  909. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/connector.toml +266 -0
  910. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/handlers.py +3 -0
  911. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/provenance.json +245 -0
  912. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/instruction.md +15 -0
  913. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/scenario.toml +1 -0
  914. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/10-snow_users.json +268 -0
  915. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/11-snow_user_groups.json +40 -0
  916. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/20-snow_configuration_items.json +684 -0
  917. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/30-snow_catalog_categories.json +52 -0
  918. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/31-snow_catalog_items.json +334 -0
  919. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/40-snow_incidents.json +3086 -0
  920. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/41-snow_incident_tasks.json +54 -0
  921. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/42-snow_task_slas.json +64 -0
  922. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/43-snow_problems.json +148 -0
  923. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/44-snow_change_requests.json +364 -0
  924. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/45-snow_knowledge_articles.json +214 -0
  925. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/46-snow_journal_entries.json +1612 -0
  926. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/60-snow_ui_current_users.json +19 -0
  927. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/61-snow_ui_navigation_applications.json +187 -0
  928. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/62-snow_ui_home_widgets.json +91 -0
  929. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/63-snow_ui_notifications.json +3 -0
  930. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/64-snow_ui_employee_center_pages.json +74 -0
  931. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/65-snow_ui_list_layouts.json +54 -0
  932. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/66-snow_ui_search_facets.json +29 -0
  933. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/67-snow_ui_activity_entries.json +1076 -0
  934. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/68-snow_ui_instances.json +9 -0
  935. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scope.toml +166 -0
  936. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/tests/routes.json +272 -0
  937. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/assets/index-5QHcQLCI.css +1 -0
  938. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/assets/index-BzeVnzFt.js +67 -0
  939. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/cabin-400-700-italic.woff2 +0 -0
  940. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/cabin-400-700.woff2 +0 -0
  941. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-0-lato-v17-latin-ext_latin-100.woff2 +0 -0
  942. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-1-lato-v17-latin-ext_latin-100.woff +0 -0
  943. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-10-lato-v17-latin-ext_latin-italic.woff2 +0 -0
  944. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-11-lato-v17-latin-ext_latin-italic.woff +0 -0
  945. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-12-lato-v17-latin-ext_latin-700.woff2 +0 -0
  946. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-13-lato-v17-latin-ext_latin-700.woff +0 -0
  947. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-14-lato-v17-latin-ext_latin-700italic.woff2 +0 -0
  948. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-15-lato-v17-latin-ext_latin-700italic.woff +0 -0
  949. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-16-source-sans-pro-v11-latin-300.woff2 +0 -0
  950. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-17-source-sans-pro-v11-latin-300.woff +0 -0
  951. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-18-source-sans-pro-v11-latin-regular.woff2 +0 -0
  952. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-19-source-sans-pro-v11-latin-regular.woff +0 -0
  953. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-2-lato-v17-latin-ext_latin-100italic.woff2 +0 -0
  954. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-20-source-sans-pro-v11-latin-600.woff2 +0 -0
  955. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-21-source-sans-pro-v11-latin-600.woff +0 -0
  956. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-22-source-sans-pro-v11-latin-700.woff2 +0 -0
  957. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-23-source-sans-pro-v11-latin-700.woff +0 -0
  958. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-3-lato-v17-latin-ext_latin-100italic.woff +0 -0
  959. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-4-lato-v17-latin-ext_latin-300.woff2 +0 -0
  960. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-5-lato-v17-latin-ext_latin-300.woff +0 -0
  961. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-6-lato-v17-latin-ext_latin-300italic.woff2 +0 -0
  962. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-7-lato-v17-latin-ext_latin-300italic.woff +0 -0
  963. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-8-lato-v17-latin-ext_latin-regular.woff2 +0 -0
  964. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-9-lato-v17-latin-ext_latin-regular.woff +0 -0
  965. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/index.json +122 -0
  966. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-300.woff2 +0 -0
  967. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-600-italic.woff2 +0 -0
  968. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-600.woff2 +0 -0
  969. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-bold-italic.woff2 +0 -0
  970. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-bold.woff2 +0 -0
  971. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-normal-italic.woff2 +0 -0
  972. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-normal.woff2 +0 -0
  973. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/appsee-outline.svg +1 -0
  974. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/arrow-up-outline.svg +1 -0
  975. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/available.svg +1 -0
  976. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/bell-outline.svg +1 -0
  977. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/caret-down-fill.svg +1 -0
  978. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/check-fill.svg +1 -0
  979. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/chevron-right-outline.svg +1 -0
  980. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/circle-close-outline.svg +1 -0
  981. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/circle-info-outline.svg +1 -0
  982. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/circle-question-outline.svg +1 -0
  983. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/circleinfooutline.svg +1 -0
  984. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/ellipsis-v-outline.svg +1 -0
  985. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/eye-outline.svg +1 -0
  986. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-bell-fill.svg +1 -0
  987. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-caret-down-fill.svg +1 -0
  988. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-check-square.svg +1 -0
  989. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-chevron-right.svg +1 -0
  990. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-clock-outline.svg +1 -0
  991. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-comment-chat.svg +1 -0
  992. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-external-link.svg +1 -0
  993. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-facebook.svg +1 -0
  994. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-heart-fill.svg +1 -0
  995. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-heart-outline.svg +1 -0
  996. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-home-fill-teal.svg +1 -0
  997. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-home-fill.svg +1 -0
  998. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-linkedin.svg +1 -0
  999. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-list-alt-fill.svg +1 -0
  1000. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-pencil-square.svg +1 -0
  1001. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-question-circle-fill.svg +1 -0
  1002. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-times.svg +1 -0
  1003. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-twitter.svg +1 -0
  1004. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/filter-outline.svg +1 -0
  1005. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/gear-outline.svg +1 -0
  1006. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/globe-outline.svg +1 -0
  1007. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/home-outline.svg +1 -0
  1008. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/icon-2.svg +17 -0
  1009. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/icon-3.svg +1 -0
  1010. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/icon-4.svg +1 -0
  1011. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/icon.svg +45 -0
  1012. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/keyboard-outline.svg +1 -0
  1013. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/link-icon-associated-to-view-all-adoption-blueprints.svg +1 -0
  1014. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/link-icon-associated-to-view-all-applications.svg +1 -0
  1015. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/list-fill.svg +1 -0
  1016. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/loading-2.svg +1 -0
  1017. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/loading.svg +1 -0
  1018. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/magnifying-glass-outline.svg +1 -0
  1019. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/ongoing-outline.svg +1 -0
  1020. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/open-link-right-fill.svg +1 -0
  1021. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/open-link-right-outline.svg +1 -0
  1022. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/pencil-page-outline.svg +1 -0
  1023. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/plus-fill.svg +1 -0
  1024. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/serverbox-outline.svg +1 -0
  1025. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/servicenow-wordmark.svg +20 -0
  1026. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/signal-live-outline.svg +1 -0
  1027. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/square-arrow-left-outline.svg +1 -0
  1028. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/star-outline.svg +1 -0
  1029. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/sync-outline.svg +1 -0
  1030. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/task-slas-related-list.svg +24 -0
  1031. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/thumbtack-outline.svg +1 -0
  1032. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/trending-downward.svg +1 -0
  1033. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/trending-neutral.svg +1 -0
  1034. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/unpinned-all-menu.svg +1 -0
  1035. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/unpinned-favorites-menu.svg +1 -0
  1036. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/unpinned-history-menu.svg +1 -0
  1037. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/user-outline.svg +1 -0
  1038. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/adoption-blueprints.svg +40 -0
  1039. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/avatar-admin.jpg +0 -0
  1040. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/now-assist-admin.svg +17 -0
  1041. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/quick-link-desk.jpg +0 -0
  1042. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/quick-link-password.jpg +0 -0
  1043. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/quick-link-status.jpg +0 -0
  1044. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-accessories.svg +1 -0
  1045. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-computers.svg +1 -0
  1046. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-developer.svg +1 -0
  1047. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-email.svg +1 -0
  1048. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-phone.svg +1 -0
  1049. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-software-catalog.svg +1 -0
  1050. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-software.svg +1 -0
  1051. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-technology.svg +1 -0
  1052. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/index.html +36 -0
  1053. package/runtime/gatewaysdk/environment/schema/connectors/servicenow/world.json +2004 -0
  1054. package/runtime/gatewaysdk/environment/schema/connectors/slack/MODEL.md +264 -0
  1055. package/runtime/gatewaysdk/environment/schema/connectors/slack/api/handlers.py +1880 -0
  1056. package/runtime/gatewaysdk/environment/schema/connectors/slack/capabilities.json +1056 -0
  1057. package/runtime/gatewaysdk/environment/schema/connectors/slack/connector.toml +892 -0
  1058. package/runtime/gatewaysdk/environment/schema/connectors/slack/handlers.py +762 -0
  1059. package/runtime/gatewaysdk/environment/schema/connectors/slack/parity.json +65 -0
  1060. package/runtime/gatewaysdk/environment/schema/connectors/slack/provenance.json +349 -0
  1061. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/scenario.toml +1 -0
  1062. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_apps.json +22 -0
  1063. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_bookmarks.json +22 -0
  1064. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_bots.json +19 -0
  1065. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_channels.json +206 -0
  1066. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_conversation_states.json +50 -0
  1067. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_emojis.json +19 -0
  1068. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_ephemeral_message_files.json +12 -0
  1069. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_ephemeral_message_threads.json +11 -0
  1070. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_ephemeral_messages.json +16 -0
  1071. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_channel_observations.json +16 -0
  1072. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_reaction_summaries.json +10 -0
  1073. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_reaction_users.json +10 -0
  1074. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_shares.json +29 -0
  1075. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_user_states.json +10 -0
  1076. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_files.json +64 -0
  1077. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_memberships.json +79 -0
  1078. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_message_files.json +18 -0
  1079. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_message_threads.json +10 -0
  1080. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_message_user_states.json +14 -0
  1081. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_messages.json +127 -0
  1082. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_pins.json +11 -0
  1083. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_presence.json +35 -0
  1084. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_reaction_summaries.json +25 -0
  1085. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_reaction_users.json +32 -0
  1086. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_scheduled_message_threads.json +10 -0
  1087. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_scheduled_messages.json +15 -0
  1088. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_unavailable_message_files.json +14 -0
  1089. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_user_profile_fields.json +28 -0
  1090. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_usergroup_channels.json +10 -0
  1091. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_usergroup_memberships.json +14 -0
  1092. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_usergroups.json +33 -0
  1093. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_users.json +228 -0
  1094. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_view_state_entries.json +22 -0
  1095. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_views.json +53 -0
  1096. package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_workspaces.json +37 -0
  1097. package/runtime/gatewaysdk/environment/schema/connectors/slack/scope.toml +48 -0
  1098. package/runtime/gatewaysdk/environment/schema/connectors/slack/tests/api.json +177 -0
  1099. package/runtime/gatewaysdk/environment/schema/connectors/slack/tests/test_threads.py +49 -0
  1100. package/runtime/gatewaysdk/environment/schema/connectors/slack/tests/tools.json +92 -0
  1101. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/assets/index-BSqGskph.css +1 -0
  1102. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/assets/index-CKQh1igo.js +81 -0
  1103. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/README.md +15 -0
  1104. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-black.woff2 +0 -0
  1105. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-bold.woff2 +0 -0
  1106. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-italic-black.woff2 +0 -0
  1107. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-italic-bold.woff2 +0 -0
  1108. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-italic-light.woff2 +0 -0
  1109. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-italic.woff2 +0 -0
  1110. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-light.woff2 +0 -0
  1111. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-regular.woff2 +0 -0
  1112. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/slack-icons-v2.woff2 +0 -0
  1113. package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/index.html +35 -0
  1114. package/runtime/gatewaysdk/environment/schema/connectors/slack/vendor-openapi.json +12515 -0
  1115. package/runtime/gatewaysdk/environment/schema/connectors/slack/world.json +5381 -0
  1116. package/runtime/gatewaysdk/environment/schema/connectors/workday/api/handlers.py +175 -0
  1117. package/runtime/gatewaysdk/environment/schema/connectors/workday/connector.toml +610 -0
  1118. package/runtime/gatewaysdk/environment/schema/connectors/workday/handlers.py +75 -0
  1119. package/runtime/gatewaysdk/environment/schema/connectors/workday/parity.json +69 -0
  1120. package/runtime/gatewaysdk/environment/schema/connectors/workday/provenance.json +407 -0
  1121. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/instruction.md +10 -0
  1122. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/scenario.toml +2 -0
  1123. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_compensations.json +219 -0
  1124. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_job_profiles.json +76 -0
  1125. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_locations.json +142 -0
  1126. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_organizations.json +124 -0
  1127. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_positions.json +280 -0
  1128. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_absence_leaves.json +66 -0
  1129. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_business_title_changes.json +44 -0
  1130. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_check_in_topics.json +48 -0
  1131. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_check_ins.json +46 -0
  1132. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_countries.json +28 -0
  1133. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_currencies.json +25 -0
  1134. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_job_change_reasons.json +28 -0
  1135. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_job_families.json +40 -0
  1136. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_job_profiles.json +202 -0
  1137. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_jobs.json +120 -0
  1138. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_organization_types.json +19 -0
  1139. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_organizations.json +24 -0
  1140. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_persons.json +100 -0
  1141. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_scorecard_results.json +57 -0
  1142. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_scorecards.json +68 -0
  1143. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_supervisory_organizations.json +64 -0
  1144. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_time_off_details.json +112 -0
  1145. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_time_off_entries.json +91 -0
  1146. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_worker_history_events.json +58 -0
  1147. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_workers.json +90 -0
  1148. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_time_off_requests.json +181 -0
  1149. package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_workers.json +492 -0
  1150. package/runtime/gatewaysdk/environment/schema/connectors/workday/scope.toml +344 -0
  1151. package/runtime/gatewaysdk/environment/schema/connectors/workday/tests/tools.json +81 -0
  1152. package/runtime/gatewaysdk/environment/schema/connectors/workday/vendor-openapi.json +10646 -0
  1153. package/runtime/gatewaysdk/environment/schema/connectors/workday/world.json +4186 -0
  1154. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/api/handlers.py +1183 -0
  1155. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/connector.toml +645 -0
  1156. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/handlers.py +377 -0
  1157. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/instruction.md +22 -0
  1158. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/scenario.toml +3 -0
  1159. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_brands.json +25 -0
  1160. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_group_memberships.json +49 -0
  1161. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_groups.json +37 -0
  1162. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_macros.json +154 -0
  1163. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_organizations.json +65 -0
  1164. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_ticket_audits.json +3328 -0
  1165. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_ticket_comments.json +2642 -0
  1166. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_tickets.json +1439 -0
  1167. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_users.json +624 -0
  1168. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_views.json +510 -0
  1169. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_workspace_tabs.json +10 -0
  1170. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/ui/static/assets/index-JWq7XNO5.css +1 -0
  1171. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/ui/static/assets/index-bn8ezNTi.js +67 -0
  1172. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/ui/static/index.html +22 -0
  1173. package/runtime/gatewaysdk/environment/schema/connectors/zendesk/world.json +1707 -0
  1174. package/runtime/gatewaysdk/environment/schema/data.py +907 -0
  1175. package/runtime/gatewaysdk/environment/schema/dependencies.py +235 -0
  1176. package/runtime/gatewaysdk/environment/schema/extract.py +263 -0
  1177. package/runtime/gatewaysdk/environment/schema/host.py +2571 -0
  1178. package/runtime/gatewaysdk/environment/schema/host_surfaces.py +320 -0
  1179. package/runtime/gatewaysdk/environment/schema/ingest.py +528 -0
  1180. package/runtime/gatewaysdk/environment/schema/local.py +536 -0
  1181. package/runtime/gatewaysdk/environment/schema/mapping.py +944 -0
  1182. package/runtime/gatewaysdk/environment/schema/platform.py +1748 -0
  1183. package/runtime/gatewaysdk/environment/schema/reconcile.py +202 -0
  1184. package/runtime/gatewaysdk/environment/schema/redaction.py +378 -0
  1185. package/runtime/gatewaysdk/environment/schema/scaffold.py +311 -0
  1186. package/runtime/gatewaysdk/environment/schema/skill.py +119 -0
  1187. package/runtime/gatewaysdk/environment/schema/skills/agents/connector-template-author.md +202 -0
  1188. package/runtime/gatewaysdk/environment/schema/skills/benchmarks-getting-started/SKILL.md +391 -0
  1189. package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/CONNECTORS.md +364 -0
  1190. package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/CONVENTIONS.md +100 -0
  1191. package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/SKILL.md +363 -0
  1192. package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/ROWS.md +243 -0
  1193. package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +460 -0
  1194. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +500 -0
  1195. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +49 -0
  1196. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/ui-map.md +18 -0
  1197. package/runtime/gatewaysdk/environment/schema/slack.py +757 -0
  1198. package/runtime/gatewaysdk/environment/schema/snapshot.py +479 -0
  1199. package/runtime/gatewaysdk/environment/schema/store.py +1004 -0
  1200. package/runtime/gatewaysdk/environment/schema/tasks.py +530 -0
  1201. package/runtime/gatewaysdk/environment/schema/tools_world.py +689 -0
  1202. package/runtime/gatewaysdk/environment/schema/transform.py +200 -0
  1203. package/runtime/gatewaysdk/environment/schema/transforms.py +103 -0
  1204. package/runtime/gatewaysdk/environment/schema/ui.py +455 -0
  1205. package/runtime/gatewaysdk/environment/schema/ui_static/app.js +581 -0
  1206. package/runtime/gatewaysdk/environment/schema/ui_static/index.html +72 -0
  1207. package/runtime/gatewaysdk/environment/schema/validation.py +624 -0
  1208. package/runtime/gatewaysdk/environment/schema/worker.py +78 -0
  1209. package/runtime/gatewaysdk/environment/schema/workers.py +500 -0
  1210. package/runtime/gatewaysdk/environment/schema/world_tests.py +530 -0
  1211. package/skills/agents/connector-template-author.md +202 -0
  1212. package/skills/benchmarks-getting-started/SKILL.md +391 -0
  1213. package/skills/connector-schema-authoring/CONNECTORS.md +364 -0
  1214. package/skills/connector-schema-authoring/CONVENTIONS.md +100 -0
  1215. package/skills/connector-schema-authoring/SKILL.md +363 -0
  1216. package/skills/connector-schema-authoring/connector-worlds.md +355 -0
  1217. package/skills/connector-schema-authoring/world-schema.md +620 -0
  1218. package/skills/world-data-ingestion/ROWS.md +243 -0
  1219. package/skills/world-data-ingestion/SKILL.md +460 -0
  1220. package/skills/worlds-getting-started/SKILL.md +500 -0
  1221. package/skills/worlds-getting-started/references/cli-mcp-map.md +49 -0
  1222. package/skills/worlds-getting-started/references/ui-map.md +18 -0
package/dist/index.mjs CHANGED
@@ -19,6 +19,483 @@ var __export = (target, all) => {
19
19
  __defProp(target, name, { get: all[name], enumerable: true });
20
20
  };
21
21
 
22
+ // src/worlds/browser.ts
23
+ function surfaceKinds(s) {
24
+ const kinds = ["tools"];
25
+ if (s.api) kinds.push("api");
26
+ if (s.ui) kinds.push("ui");
27
+ if (s.browser) kinds.push("browser");
28
+ return kinds;
29
+ }
30
+ function uiUrl(ui, path9) {
31
+ const base = ui.url.replace(/\/+$/, "");
32
+ const rel = path9.startsWith("/") ? path9 : `/${path9}`;
33
+ if (!ui.token) return base + rel;
34
+ const [beforeHash, hash] = splitHash(rel);
35
+ const joiner = beforeHash.includes("?") ? "&" : "?";
36
+ const query = `${UI_TOKEN_QUERY}=${encodeURIComponent(ui.token)}`;
37
+ return base + beforeHash + joiner + query + hash;
38
+ }
39
+ function uiEntryUrl(ui) {
40
+ return uiUrl(ui, ui.entry || "/");
41
+ }
42
+ function withoutUiToken(url) {
43
+ const [beforeHash, hash] = splitHash(url);
44
+ const q = beforeHash.indexOf("?");
45
+ if (q < 0) return url;
46
+ const kept = beforeHash.slice(q + 1).split("&").filter((pair) => pair !== "" && pair.split("=")[0] !== UI_TOKEN_QUERY);
47
+ return beforeHash.slice(0, q) + (kept.length ? `?${kept.join("&")}` : "") + hash;
48
+ }
49
+ function splitHash(url) {
50
+ const h = url.indexOf("#");
51
+ return h < 0 ? [url, ""] : [url.slice(0, h), url.slice(h)];
52
+ }
53
+ function redactActionArgs(action, args) {
54
+ const secretField = action === "browser_type" && SECRET_KEY.test(String(args.selector ?? ""));
55
+ const out = {};
56
+ for (const [key, value] of Object.entries(args)) {
57
+ if (value === null || value === void 0) out[key] = null;
58
+ else if (typeof value === "boolean" || typeof value === "number")
59
+ out[key] = value;
60
+ else if (typeof value === "string") {
61
+ if (SECRET_KEY.test(key) || SECRET_VALUE.test(value) || secretField && key === "text")
62
+ out[key] = "[redacted]";
63
+ else
64
+ out[key] = value.length <= EVENT_MAX_STRING ? value : value.slice(0, EVENT_MAX_STRING) + "\u2026";
65
+ } else out[key] = "[omitted]";
66
+ }
67
+ return out;
68
+ }
69
+ async function loadPlaywright() {
70
+ try {
71
+ const name = "playwright";
72
+ return await import(name);
73
+ } catch (error) {
74
+ throw new Error(
75
+ "Driving a world UI needs Playwright: npm install playwright (and `npx playwright install chromium` for local mode).",
76
+ { cause: error }
77
+ );
78
+ }
79
+ }
80
+ function resolveBrowserMode(surfaces, mode) {
81
+ if (!surfaces.ui && !surfaces.browser)
82
+ throw new WorldSurfaceUnavailable(
83
+ "ui",
84
+ "open the session with surfaces: ['ui'] on a world that declares [ui]"
85
+ );
86
+ const resolved = mode === "auto" ? surfaces.browser ? "hosted" : "local" : mode;
87
+ if (resolved === "hosted" && !surfaces.browser)
88
+ throw new WorldSurfaceUnavailable(
89
+ "browser",
90
+ "open the session with surfaces: ['browser'] to get a hosted browser"
91
+ );
92
+ return resolved;
93
+ }
94
+ async function openBrowser(surfaces, opts = {}) {
95
+ const mode = resolveBrowserMode(surfaces, opts.mode ?? "auto");
96
+ const pw = opts.playwright ?? await loadPlaywright();
97
+ const viewport = surfaces.browser?.viewport ?? DEFAULT_VIEWPORT;
98
+ const browser = mode === "hosted" ? surfaces.browser.protocol === "playwright" ? await pw.chromium.connect(surfaces.browser.wsUrl) : await pw.chromium.connectOverCDP(surfaces.browser.wsUrl) : await pw.chromium.launch({ headless: opts.headless ?? true });
99
+ const context4 = await browser.newContext({ viewport });
100
+ const page = await context4.newPage();
101
+ return new WorldBrowser(
102
+ page,
103
+ surfaces.ui,
104
+ mode,
105
+ async () => {
106
+ await context4.close();
107
+ await browser.close();
108
+ },
109
+ viewport,
110
+ opts.recorder ?? null
111
+ );
112
+ }
113
+ function computerUseToolkit(browser, opts = {}) {
114
+ const maxText = opts.maxText ?? 2e4;
115
+ const observe2 = async (selector = "body") => {
116
+ const text2 = await browser.text(selector);
117
+ return {
118
+ url: browser.url,
119
+ title: await browser.title(),
120
+ text: text2.slice(0, maxText),
121
+ truncated: text2.length > maxText
122
+ };
123
+ };
124
+ const impls = {
125
+ browser_goto: async (a) => {
126
+ await browser.goto(typeof a.path === "string" ? a.path : void 0);
127
+ return observe2();
128
+ },
129
+ browser_click: async (a) => {
130
+ await browser.click(str(a.selector, ""));
131
+ return observe2();
132
+ },
133
+ browser_type: async (a) => {
134
+ await browser.type(str(a.selector, ""), String(a.text ?? ""));
135
+ return { ok: true, url: browser.url };
136
+ },
137
+ browser_press: async (a) => {
138
+ await browser.press(str(a.key, "Enter"));
139
+ return observe2();
140
+ },
141
+ browser_scroll: async (a) => {
142
+ await browser.scroll(typeof a.dy === "number" ? a.dy : 600);
143
+ return { ok: true, url: browser.url };
144
+ },
145
+ browser_screenshot: async (a) => ({
146
+ image_base64: await browser.screenshotBase64(a.full_page === true),
147
+ url: browser.url
148
+ }),
149
+ browser_read: async (a) => observe2(str(a.selector, "body")),
150
+ browser_back: async () => {
151
+ await browser.back();
152
+ return observe2();
153
+ }
154
+ };
155
+ const specs = COMPUTER_USE_SPECS.map((s) => ({ ...s }));
156
+ return {
157
+ schemas: specs.map((spec) => schemaFromSignature(spec)),
158
+ impls,
159
+ specs
160
+ };
161
+ }
162
+ var SURFACE_KINDS, DEFAULT_VIEWPORT, SETTLE_TIMEOUT_MS, SETTLE_QUIET_MS, SETTLE_POLL_MS, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, EVENT_SCREENSHOT_QUALITY, EVENT_MAX_STRING, SECRET_KEY, SECRET_VALUE, WorldSurfaceUnavailable, UI_TOKEN_QUERY, BrowserActionRecorder, WorldBrowser, COMPUTER_USE_SPECS, str;
163
+ var init_browser = __esm({
164
+ "src/worlds/browser.ts"() {
165
+ "use strict";
166
+ init_session();
167
+ SURFACE_KINDS = ["tools", "api", "ui", "browser"];
168
+ DEFAULT_VIEWPORT = { width: 1280, height: 800 };
169
+ SETTLE_TIMEOUT_MS = 5e3;
170
+ SETTLE_QUIET_MS = 150;
171
+ SETTLE_POLL_MS = 25;
172
+ EVENT_BATCH_SIZE = 10;
173
+ EVENT_FLUSH_INTERVAL_MS = 1e3;
174
+ EVENT_MAX_RETRIES = 3;
175
+ EVENT_SCREENSHOT_QUALITY = 60;
176
+ EVENT_MAX_STRING = 500;
177
+ SECRET_KEY = /pass(word|wd)?|secret|token|api[-_]?key|authorization|cookie|(^|[-_ #.\["'=])(otp|pin|cvv|ssn)([-_ \]"']|$)/i;
178
+ SECRET_VALUE = /^((sk|pk|ghp|xox[abp])[-_][-_A-Za-z0-9]{8,}|AKIA[0-9A-Z]{12,}|Bearer [-_.A-Za-z0-9]{8,})/;
179
+ WorldSurfaceUnavailable = class extends Error {
180
+ constructor(surface, reason) {
181
+ super(`World surface '${surface}' is unavailable: ${reason}`);
182
+ this.surface = surface;
183
+ }
184
+ };
185
+ UI_TOKEN_QUERY = "token";
186
+ BrowserActionRecorder = class {
187
+ constructor(post, agentId, opts = {}) {
188
+ this.post = post;
189
+ this.agentId = agentId;
190
+ this.opts = opts;
191
+ }
192
+ seq = 0;
193
+ base = null;
194
+ queue = [];
195
+ timer = null;
196
+ inflight = Promise.resolve();
197
+ sent = 0;
198
+ dropped = 0;
199
+ /** This recorder's next position; the wire seq is `resumeFrom() + this`. */
200
+ nextSeq() {
201
+ return this.seq++;
202
+ }
203
+ resolveBase() {
204
+ if (this.base === null) {
205
+ const resolve7 = this.opts.resumeFrom ?? (async () => 0);
206
+ this.base = resolve7().then((n) => {
207
+ if (!Number.isInteger(n) || n < 0)
208
+ throw new Error(
209
+ `browser event base seq must be a non-negative integer, got ${String(n)}`
210
+ );
211
+ return n;
212
+ });
213
+ this.base.catch(() => {
214
+ this.base = null;
215
+ });
216
+ }
217
+ return this.base;
218
+ }
219
+ record(event) {
220
+ this.queue.push(event);
221
+ if (this.queue.length >= (this.opts.batchSize ?? EVENT_BATCH_SIZE)) {
222
+ this.drain();
223
+ } else if (this.timer === null) {
224
+ this.timer = setTimeout(
225
+ () => this.drain(),
226
+ this.opts.flushIntervalMs ?? EVENT_FLUSH_INTERVAL_MS
227
+ );
228
+ if (typeof this.timer === "object" && "unref" in this.timer)
229
+ this.timer.unref();
230
+ }
231
+ }
232
+ /** Resolve once everything recorded so far has been posted (or dropped). */
233
+ async flush() {
234
+ this.drain();
235
+ await this.inflight;
236
+ }
237
+ async close() {
238
+ await this.flush();
239
+ }
240
+ drain() {
241
+ if (this.timer !== null) {
242
+ clearTimeout(this.timer);
243
+ this.timer = null;
244
+ }
245
+ if (this.queue.length === 0) return;
246
+ const batch = this.queue;
247
+ this.queue = [];
248
+ this.inflight = this.inflight.then(() => this.send(batch));
249
+ }
250
+ async send(batch) {
251
+ const retries = this.opts.maxRetries ?? EVENT_MAX_RETRIES;
252
+ const sleep3 = this.opts.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
253
+ for (let attempt = 0; attempt < retries; attempt++) {
254
+ try {
255
+ const base = await this.resolveBase();
256
+ await this.post(
257
+ base === 0 ? batch : batch.map((e) => ({ ...e, seq: base + e.seq }))
258
+ );
259
+ this.sent += batch.length;
260
+ return;
261
+ } catch (error) {
262
+ if (attempt + 1 === retries) {
263
+ this.dropped += batch.length;
264
+ (this.opts.warn ?? console.warn)(
265
+ `dropping ${batch.length} browser events after ${attempt + 1} attempts: ${String(error)}`
266
+ );
267
+ return;
268
+ }
269
+ await sleep3(500 * 2 ** attempt);
270
+ }
271
+ }
272
+ }
273
+ };
274
+ WorldBrowser = class {
275
+ constructor(page, ui, mode, teardown, viewport = DEFAULT_VIEWPORT, recorder = null) {
276
+ this.page = page;
277
+ this.ui = ui;
278
+ this.mode = mode;
279
+ this.teardown = teardown;
280
+ this.viewport = viewport;
281
+ this.recorder = recorder;
282
+ page.on("request", () => {
283
+ this.inflight += 1;
284
+ this.lastNetwork = Date.now();
285
+ });
286
+ const done = () => {
287
+ this.inflight = Math.max(0, this.inflight - 1);
288
+ this.lastNetwork = Date.now();
289
+ };
290
+ page.on("requestfinished", done);
291
+ page.on("requestfailed", done);
292
+ }
293
+ inflight = 0;
294
+ lastNetwork = Date.now();
295
+ get agentId() {
296
+ return this.recorder?.agentId ?? null;
297
+ }
298
+ /** Run one action and report it: the event carries what was asked,
299
+ * whether it worked, and the screen after — for failures too, so a
300
+ * reviewer sees what the agent saw when the selector did not match. */
301
+ async act(action, args, fn) {
302
+ const recorder = this.recorder;
303
+ if (!recorder) return fn();
304
+ const started = Date.now();
305
+ let ok = true;
306
+ let error = null;
307
+ try {
308
+ return await fn();
309
+ } catch (err) {
310
+ ok = false;
311
+ error = (err instanceof Error ? `${err.name}: ${err.message}` : String(err)).slice(0, 4e3);
312
+ throw err;
313
+ } finally {
314
+ recorder.record({
315
+ agentId: recorder.agentId,
316
+ seq: recorder.nextSeq(),
317
+ ts: (/* @__PURE__ */ new Date()).toISOString(),
318
+ action,
319
+ args: redactActionArgs(action, args),
320
+ ok,
321
+ error,
322
+ durationMs: Date.now() - started,
323
+ mode: this.mode,
324
+ viewport: { ...this.viewport },
325
+ ...await this.observeForEvent()
326
+ });
327
+ }
328
+ }
329
+ async observeForEvent() {
330
+ const out = {
331
+ url: null,
332
+ title: null,
333
+ screenshot: null
334
+ };
335
+ try {
336
+ out.url = this.page.url();
337
+ out.title = await this.page.title();
338
+ const jpeg = await this.page.screenshot({
339
+ type: "jpeg",
340
+ quality: EVENT_SCREENSHOT_QUALITY
341
+ });
342
+ out.screenshot = jpeg.toString("base64");
343
+ } catch {
344
+ }
345
+ return out;
346
+ }
347
+ /** Open a UI path (`/customers`), a full URL, or — with no argument — the
348
+ * UI's declared entry page. */
349
+ async goto(pathOrUrl) {
350
+ let target;
351
+ if (pathOrUrl === void 0) {
352
+ if (!this.ui)
353
+ throw new WorldSurfaceUnavailable(
354
+ "ui",
355
+ "this session has no UI to navigate to"
356
+ );
357
+ target = uiEntryUrl(this.ui);
358
+ } else if (/^https?:\/\//.test(pathOrUrl)) {
359
+ target = pathOrUrl;
360
+ } else {
361
+ if (!this.ui)
362
+ throw new WorldSurfaceUnavailable(
363
+ "ui",
364
+ "relative paths need a UI surface"
365
+ );
366
+ target = uiUrl(this.ui, pathOrUrl);
367
+ }
368
+ return this.act(
369
+ "browser_goto",
370
+ { path: pathOrUrl ?? null, url: withoutUiToken(target) },
371
+ async () => {
372
+ await this.page.goto(target, { waitUntil: "load" });
373
+ await this.settle();
374
+ return this.page.url();
375
+ }
376
+ );
377
+ }
378
+ async back() {
379
+ return this.act("browser_back", {}, async () => {
380
+ await this.page.goBack({ waitUntil: "load" });
381
+ await this.settle();
382
+ return this.page.url();
383
+ });
384
+ }
385
+ /** Wait for the page to finish reacting to an action. `load` alone is not
386
+ * enough for client-rendered UIs (React et al.): a click returns before the
387
+ * fetch that re-renders the page, so an agent would read stale text.
388
+ * Playwright's `networkidle` is per navigation and resolves at once after
389
+ * the first one, so this tracks requests itself: done when nothing is in
390
+ * flight and the network has been quiet for `SETTLE_QUIET_MS`, bounded so
391
+ * long-polling UIs cannot hang us. */
392
+ async settle() {
393
+ await this.page.waitForLoadState("load");
394
+ const deadline = Date.now() + SETTLE_TIMEOUT_MS;
395
+ while (Date.now() < deadline) {
396
+ const quiet = Date.now() - this.lastNetwork >= SETTLE_QUIET_MS;
397
+ if (this.inflight === 0 && quiet) return;
398
+ await this.page.waitForTimeout(SETTLE_POLL_MS);
399
+ }
400
+ }
401
+ async click(selector) {
402
+ await this.act("browser_click", { selector }, async () => {
403
+ await this.page.click(selector);
404
+ await this.settle();
405
+ });
406
+ }
407
+ async type(selector, text2) {
408
+ await this.act(
409
+ "browser_type",
410
+ { selector, text: text2 },
411
+ () => this.page.fill(selector, text2)
412
+ );
413
+ }
414
+ async press(key) {
415
+ await this.act("browser_press", { key }, async () => {
416
+ await this.page.keyboard.press(key);
417
+ await this.settle();
418
+ });
419
+ }
420
+ async scroll(dy) {
421
+ await this.act(
422
+ "browser_scroll",
423
+ { dy },
424
+ () => this.page.mouse.wheel(0, dy)
425
+ );
426
+ }
427
+ async screenshot(fullPage = false) {
428
+ return this.page.screenshot({ type: "png", fullPage });
429
+ }
430
+ async screenshotBase64(fullPage = false) {
431
+ return (await this.screenshot(fullPage)).toString("base64");
432
+ }
433
+ async text(selector = "body") {
434
+ return this.page.innerText(selector);
435
+ }
436
+ async html() {
437
+ return this.page.content();
438
+ }
439
+ get url() {
440
+ return this.page.url();
441
+ }
442
+ async title() {
443
+ return this.page.title();
444
+ }
445
+ async close() {
446
+ try {
447
+ await this.teardown();
448
+ } finally {
449
+ await this.recorder?.close();
450
+ }
451
+ }
452
+ };
453
+ COMPUTER_USE_SPECS = [
454
+ {
455
+ name: "browser_goto",
456
+ signature: "browser_goto(path=None)",
457
+ doc: "Open a page of the world's UI. `path` is a UI path like /customers, a full URL, or omitted for the entry page. Returns the URL and page text."
458
+ },
459
+ {
460
+ name: "browser_click",
461
+ signature: "browser_click(selector)",
462
+ doc: "Click an element by Playwright selector (CSS, `text=Refund`, `role=button[name=Save]`). Returns the page text after the click."
463
+ },
464
+ {
465
+ name: "browser_type",
466
+ signature: "browser_type(selector, text)",
467
+ doc: "Replace the value of an input/textarea found by selector with `text`."
468
+ },
469
+ {
470
+ name: "browser_press",
471
+ signature: "browser_press(key)",
472
+ doc: "Press a key (Enter, Tab, Escape, ArrowDown, ...). Returns the page text after."
473
+ },
474
+ {
475
+ name: "browser_scroll",
476
+ signature: "browser_scroll(dy=600)",
477
+ doc: "Scroll the page vertically by `dy` pixels (negative scrolls up)."
478
+ },
479
+ {
480
+ name: "browser_screenshot",
481
+ signature: "browser_screenshot(full_page=False)",
482
+ doc: "Take a PNG screenshot; returns {image_base64, url}."
483
+ },
484
+ {
485
+ name: "browser_read",
486
+ signature: "browser_read(selector='body')",
487
+ doc: "Return the visible text of an element (default: whole page) plus the URL and title."
488
+ },
489
+ {
490
+ name: "browser_back",
491
+ signature: "browser_back()",
492
+ doc: "Go back one page in history."
493
+ }
494
+ ];
495
+ str = (v, fallback) => typeof v === "string" && v.length > 0 ? v : fallback;
496
+ }
497
+ });
498
+
22
499
  // src/worlds/session.ts
23
500
  var session_exports = {};
24
501
  __export(session_exports, {
@@ -26,11 +503,24 @@ __export(session_exports, {
26
503
  WorldSessionCallError: () => WorldSessionCallError,
27
504
  WorldSessionTimeout: () => WorldSessionTimeout,
28
505
  attachSession: () => attachSession,
506
+ isTaskIdRef: () => isTaskIdRef,
507
+ isTaskSpec: () => isTaskSpec,
29
508
  openSession: () => openSession,
30
509
  runSessions: () => runSessions,
31
- schemaFromSignature: () => schemaFromSignature
510
+ schemaFromSignature: () => schemaFromSignature,
511
+ taskLabel: () => taskLabel
32
512
  });
513
+ import { randomUUID } from "crypto";
33
514
  function schemaFromSignature(spec) {
515
+ if (spec.inputSchema)
516
+ return {
517
+ type: "function",
518
+ function: {
519
+ name: modelToolName(spec.name),
520
+ description: spec.doc ?? spec.name,
521
+ parameters: spec.inputSchema
522
+ }
523
+ };
34
524
  const inside = /\(([\s\S]*)\)\s*$/.exec(spec.signature.trim())?.[1] ?? "";
35
525
  const properties = {};
36
526
  const required = [];
@@ -66,7 +556,7 @@ function schemaFromSignature(spec) {
66
556
  return {
67
557
  type: "function",
68
558
  function: {
69
- name: spec.name,
559
+ name: modelToolName(spec.name),
70
560
  description: spec.doc ?? spec.name,
71
561
  parameters: { type: "object", properties, required }
72
562
  }
@@ -80,8 +570,20 @@ async function attachSession(sessionId, options = {}) {
80
570
  );
81
571
  return new WorldSession(sessionId, state2, options);
82
572
  }
83
- async function openSession(slugOrRef, task, opts = {}) {
573
+ async function openSession(slugOrRef, taskOrOpts, positionalOpts = {}) {
574
+ const { task, ...opts } = typeof taskOrOpts === "object" && "task" in taskOrOpts ? taskOrOpts : { task: taskOrOpts, ...positionalOpts };
575
+ if (task === void 0 || task === null || typeof task === "string" && !task || isTaskIdRef(task) && !task.id || isTaskSpec(task) && !task.instruction || typeof task === "object" && !isTaskIdRef(task) && !isTaskSpec(task))
576
+ throw new Error(
577
+ "openSession needs a task: a bundled task name, a stored task { id, version? } or { instruction, seed?, grader?, metadata? }"
578
+ );
84
579
  const options = opts.options ?? {};
580
+ const unknown = (opts.surfaces ?? []).filter(
581
+ (s) => !SURFACE_KINDS.includes(s)
582
+ );
583
+ if (unknown.length)
584
+ throw new Error(
585
+ `Unknown world surfaces: ${unknown.join(", ")}; choose from ${SURFACE_KINDS.join(", ")}`
586
+ );
85
587
  const at = slugOrRef.indexOf("@");
86
588
  const slug = at === -1 ? slugOrRef : slugOrRef.slice(0, at);
87
589
  const state2 = await apiRequest(
@@ -91,7 +593,8 @@ async function openSession(slugOrRef, task, opts = {}) {
91
593
  {
92
594
  ...opts.versionId ? { versionId: opts.versionId } : { slug },
93
595
  task,
94
- ...opts.reuseWarm === void 0 ? {} : { reuseWarm: opts.reuseWarm }
596
+ ...opts.reuseWarm === void 0 ? {} : { reuseWarm: opts.reuseWarm },
597
+ ...opts.surfaces?.length ? { surfaces: opts.surfaces } : {}
95
598
  }
96
599
  );
97
600
  return new WorldSession(state2.sessionId, state2, options);
@@ -112,20 +615,24 @@ async function runSessions(opts) {
112
615
  await Promise.all(
113
616
  Array.from({ length: Math.min(concurrency, tasks.length) }, async () => {
114
617
  while (next < tasks.length) {
115
- const task = tasks[next++];
618
+ const taskRef = tasks[next++];
619
+ let task = taskLabel(taskRef);
116
620
  let session = null;
117
621
  try {
118
- session = await openSession(opts.world, task, {
622
+ session = await openSession(opts.world, {
623
+ task: taskRef,
119
624
  versionId,
120
625
  options
121
626
  });
627
+ task = taskLabel(taskRef, session.taskInfo);
122
628
  await session.ready();
123
629
  const toolkit = await session.toolkit();
124
630
  await opts.agent({
125
631
  session,
126
632
  toolkit,
127
- instruction: session.instruction ?? task,
128
- task
633
+ instruction: session.instruction ?? (isTaskSpec(taskRef) ? taskRef.instruction : task),
634
+ task,
635
+ taskRef
129
636
  });
130
637
  const graded = await session.grade();
131
638
  const result = {
@@ -161,35 +668,147 @@ async function runSessions(opts) {
161
668
  passed: opts.failUnder === void 0 ? true : mean >= opts.failUnder
162
669
  };
163
670
  }
164
- var READY_TIMEOUT_MS, READY_POLL_MS, CALL_TIMEOUT_MS, CALL_POLL_MS, sleep2, WorldSessionTimeout, WorldSessionCallError, WorldSession;
671
+ var isTaskIdRef, isTaskSpec, taskLabel, READY_TIMEOUT_MS, READY_POLL_MS, CALL_TIMEOUT_MS, CALL_POLL_MS, JUDGED_GRADE_TIMEOUT_MS, JUDGED_GRADE_POLL_MS, EXPORT_PAGE, sleep2, modelToolName, WorldSessionTimeout, WorldSessionCallError, WorldSession;
165
672
  var init_session = __esm({
166
673
  "src/worlds/session.ts"() {
167
674
  "use strict";
168
675
  init_worlds();
676
+ init_browser();
677
+ isTaskIdRef = (task) => typeof task === "object" && task !== null && "id" in task;
678
+ isTaskSpec = (task) => typeof task === "object" && task !== null && "instruction" in task;
679
+ taskLabel = (task, info) => {
680
+ if (typeof task === "string") return task;
681
+ if (isTaskIdRef(task)) return info?.name ?? task.id;
682
+ if (task.name) return task.name;
683
+ return info?.hash ? `inline:${info.hash.slice(0, 12)}` : "inline";
684
+ };
169
685
  READY_TIMEOUT_MS = 10 * 6e4;
170
686
  READY_POLL_MS = 2e3;
171
687
  CALL_TIMEOUT_MS = 3 * 6e4;
172
688
  CALL_POLL_MS = 400;
689
+ JUDGED_GRADE_TIMEOUT_MS = 15 * 6e4;
690
+ JUDGED_GRADE_POLL_MS = 2e3;
691
+ EXPORT_PAGE = 500;
173
692
  sleep2 = (ms) => new Promise((r) => setTimeout(r, ms));
693
+ modelToolName = (name) => name.replace(/[^A-Za-z0-9_-]/g, "_").slice(0, 64) || "tool";
174
694
  WorldSessionTimeout = class extends Error {
175
695
  };
176
696
  WorldSessionCallError = class extends Error {
177
697
  };
178
698
  WorldSession = class {
179
- constructor(sessionId, state2, options) {
699
+ constructor(sessionId, current, options) {
180
700
  this.sessionId = sessionId;
181
- this.state = state2;
701
+ this.current = current;
182
702
  this.options = options;
183
703
  }
704
+ /** The task's display name: a bundled scenario's, or the inline spec's
705
+ * `name` (null when the spec was unnamed). Same as `taskName`. */
184
706
  get task() {
185
- return this.state.taskName;
707
+ return this.current.taskName;
708
+ }
709
+ /** The task's display name: a bundled scenario's, or the inline spec's
710
+ * `name` (null when the spec was unnamed). */
711
+ get taskName() {
712
+ return this.current.taskName;
713
+ }
714
+ /** The platform's notices about the world this session runs on (empty
715
+ * for a schema world). Printed by the CLI on stderr at open. */
716
+ get deprecations() {
717
+ return this.current.deprecations ?? [];
186
718
  }
187
- /** What this task asks for — the bundle's own instruction.md. */
719
+ /** The task this session runs: bundled scenario, stored task or inline
720
+ * spec, its name, hash and the caller's metadata. */
721
+ get taskInfo() {
722
+ return this.current.task ?? {
723
+ source: "bundled",
724
+ name: this.current.taskName,
725
+ hash: null,
726
+ metadata: {}
727
+ };
728
+ }
729
+ /** What this task asks for — the bundle's instruction.md, or the inline
730
+ * spec's `instruction`. */
188
731
  get instruction() {
189
- return this.state.instruction ?? null;
732
+ return this.current.instruction ?? null;
190
733
  }
191
734
  get versionId() {
192
- return this.state.versionId;
735
+ return this.current.versionId;
736
+ }
737
+ /** Whether the session answered ready as of the last state read (the open,
738
+ * a `status()`, or the poll inside `ready()`); no request is made. */
739
+ get isReady() {
740
+ return this.current.ready;
741
+ }
742
+ /** `api` / `ui` / `browser` are present exactly when the world declares
743
+ * them AND the session was opened asking for them. */
744
+ async surfaces() {
745
+ if (!this.current.surfaces) await this.status();
746
+ return this.current.surfaces ?? { tools: { kind: "rendezvous" } };
747
+ }
748
+ /** Base URL of the world's own HTTP API for this session. */
749
+ async api() {
750
+ const { api: api2 } = await this.surfaces();
751
+ if (!api2)
752
+ throw new WorldSurfaceUnavailable(
753
+ "api",
754
+ "open the session with surfaces: ['api'] on an api-type world"
755
+ );
756
+ return api2.url;
757
+ }
758
+ /** Headers every request to `api()` needs. A World Host session gates its
759
+ * api surface on a per-session token; a pod or hosted twin answers with the
760
+ * world's own declared auth and this is `{}`. */
761
+ async apiHeaders() {
762
+ const { api: api2 } = await this.surfaces();
763
+ return api2?.token ? { Authorization: `Bearer ${api2.token}` } : {};
764
+ }
765
+ /** URL of the world's UI entry page for this session. */
766
+ async ui() {
767
+ const { ui } = await this.surfaces();
768
+ if (!ui)
769
+ throw new WorldSurfaceUnavailable(
770
+ "ui",
771
+ "open the session with surfaces: ['ui'] on a world that declares [ui]"
772
+ );
773
+ return uiEntryUrl(ui);
774
+ }
775
+ /** A Playwright browser on this session's UI: `hosted` drives the one the
776
+ * platform runs next to the world, `local` launches one here, `auto`
777
+ * prefers hosted. Call `close()` when done.
778
+ *
779
+ * Every action is reported to the platform under `agentId` (default:
780
+ * `GATEWAY_AGENT_ID` or a fresh `agent-<hex>`) so the session page shows
781
+ * this agent's own timeline — several agents may share one session and
782
+ * one hosted browser. `record: false` opts out. */
783
+ async browser(opts = {}) {
784
+ const { agentId, record = true, ...rest } = opts;
785
+ return openBrowser(await this.surfaces(), {
786
+ ...rest,
787
+ recorder: record ? this.browserRecorder(agentId) : null
788
+ });
789
+ }
790
+ /** The reporter `browser()` uses; exposed for a page you drive yourself. */
791
+ browserRecorder(agentId) {
792
+ const path9 = `/api/public/world-sessions/${encodeURIComponent(this.sessionId)}/browser-events`;
793
+ const id = agentId ?? process.env.GATEWAY_AGENT_ID ?? `agent-${randomUUID().replace(/-/g, "").slice(0, 8)}`;
794
+ return new BrowserActionRecorder(
795
+ async (events) => {
796
+ await apiRequest(this.options, "POST", path9, { events });
797
+ },
798
+ id,
799
+ {
800
+ // Continue this agent's timeline where the platform has it, so the
801
+ // same id reopened later never re-numbers from zero.
802
+ resumeFrom: async () => {
803
+ const summary = await apiRequest(this.options, "GET", path9);
804
+ return summary.agents.find((a) => a.agentId === id)?.nextSeq ?? 0;
805
+ }
806
+ }
807
+ );
808
+ }
809
+ /** Browser actions as model tools, in the same shape as `toolkit()`. */
810
+ computerUseTools(browser) {
811
+ return computerUseToolkit(browser);
193
812
  }
194
813
  /** The session's latest platform state (one request, no waiting). */
195
814
  async status() {
@@ -198,12 +817,14 @@ var init_session = __esm({
198
817
  "GET",
199
818
  `/api/public/world-sessions/${encodeURIComponent(this.sessionId)}`
200
819
  );
201
- this.state = {
202
- instruction: this.state.instruction,
203
- tools: this.state.tools,
820
+ this.current = {
821
+ instruction: this.current.instruction,
822
+ tools: this.current.tools,
823
+ surfaces: this.current.surfaces,
824
+ task: this.current.task,
204
825
  ...fresh
205
826
  };
206
- return this.state;
827
+ return this.current;
207
828
  }
208
829
  /**
209
830
  * Wait until the container is warm — meaning the process inside it has
@@ -226,14 +847,18 @@ var init_session = __esm({
226
847
  }
227
848
  }
228
849
  /** Enqueue one interaction and wait for the container's answer. */
229
- async exchange(body, timeoutMs = CALL_TIMEOUT_MS) {
230
- const { callId } = await apiRequest(
850
+ async exchange(body, timeoutMs) {
851
+ const enqueued = await apiRequest(
231
852
  this.options,
232
853
  "POST",
233
854
  `/api/public/world-sessions/${encodeURIComponent(this.sessionId)}/calls`,
234
855
  body
235
856
  );
236
- const deadline = Date.now() + timeoutMs;
857
+ const { callId } = enqueued;
858
+ const judged = enqueued.pending === true;
859
+ const budgetMs = timeoutMs ?? (judged ? JUDGED_GRADE_TIMEOUT_MS : CALL_TIMEOUT_MS);
860
+ const pollMs2 = judged ? JUDGED_GRADE_POLL_MS : CALL_POLL_MS;
861
+ const deadline = Date.now() + budgetMs;
237
862
  for (; ; ) {
238
863
  const call = await apiRequest(
239
864
  this.options,
@@ -246,9 +871,9 @@ var init_session = __esm({
246
871
  }
247
872
  if (Date.now() > deadline)
248
873
  throw new WorldSessionTimeout(
249
- `Call ${callId} still ${call.state} after ${Math.round(timeoutMs / 1e3)}s \u2014 the container may have died.`
874
+ judged ? `Grade ${callId} still ${call.state} after ${Math.round(budgetMs / 1e3)}s \u2014 the judge has not answered; the platform finalizes the call on its own, read it back with export().` : `Call ${callId} still ${call.state} after ${Math.round(budgetMs / 1e3)}s \u2014 the container may have died.`
250
875
  );
251
- await sleep2(CALL_POLL_MS);
876
+ await sleep2(pollMs2);
252
877
  }
253
878
  }
254
879
  /**
@@ -272,15 +897,27 @@ var init_session = __esm({
272
897
  * hand-written map that still remembers the old name.
273
898
  */
274
899
  async toolkit() {
275
- let specs = this.state.tools;
900
+ let specs = this.current.tools;
276
901
  if (!specs) specs = (await this.status()).tools ?? [];
277
- const impls = {};
902
+ const impls = /* @__PURE__ */ Object.create(null);
278
903
  for (const spec of specs) {
279
- impls[spec.name] = (args = {}) => this.call(spec.name, args);
904
+ const alias = modelToolName(spec.name);
905
+ if (Object.hasOwn(impls, alias))
906
+ throw new WorldSessionCallError(`Model tool name collision: ${alias}`);
907
+ impls[alias] = (args = {}) => this.call(spec.name, args);
280
908
  }
281
909
  return { schemas: specs.map(schemaFromSignature), impls, specs };
282
910
  }
283
- /** Run the task's grader against the container's END STATE. */
911
+ /** Run the task's grader against the container's END STATE. Graders answer
912
+ * in one of two shapes: the scalar with named rewards beside it
913
+ * (`{reward, check_a, check_b}`, a task's own `grade.py`), or the named
914
+ * rewards nested under `rewards` (the api, mock-tools and World Host
915
+ * runners). Both land in `rewards`.
916
+ *
917
+ * A rubric grade is finalized by the platform's judge, not the container:
918
+ * the platform answers the enqueue with `pending: true`, and this waits on
919
+ * the judge's budget (15 min) instead of a call's. `timeoutMs` overrides
920
+ * either. */
284
921
  async grade(opts = {}) {
285
922
  const raw = await this.exchange(
286
923
  { kind: "grade" },
@@ -288,6 +925,12 @@ var init_session = __esm({
288
925
  );
289
926
  const record = raw && typeof raw === "object" ? raw : {};
290
927
  const rewards = {};
928
+ const nested = record.rewards;
929
+ if (nested && typeof nested === "object") {
930
+ for (const [key, value] of Object.entries(nested)) {
931
+ if (typeof value === "number") rewards[key] = value;
932
+ }
933
+ }
291
934
  for (const [key, value] of Object.entries(record)) {
292
935
  if (key !== "reward" && typeof value === "number") rewards[key] = value;
293
936
  }
@@ -297,6 +940,95 @@ var init_session = __esm({
297
940
  raw
298
941
  };
299
942
  }
943
+ /**
944
+ * Put rows into the LIVE world through its contract, in one batch:
945
+ * `append` (default) upserts by primary key, `replace` makes the named
946
+ * entities hold exactly these rows. Atomic — a refused row leaves the
947
+ * session unchanged and the error names the entity, row and field.
948
+ */
949
+ async seed(rows, opts = {}) {
950
+ const mode = opts.mode ?? "append";
951
+ const redact = opts.redact ?? "off";
952
+ return await this.exchange(
953
+ {
954
+ kind: "seed",
955
+ args: { mode, rows, ...redact !== "off" ? { redact } : {} }
956
+ },
957
+ opts.timeoutMs
958
+ );
959
+ }
960
+ /** Every entity's rows as the world holds them now — the same dump a
961
+ * grader reads. The shape is the world runtime's: a schema world answers
962
+ * `{<entity>: {<key>: row}, snapshot}`, a mock-tools world
963
+ * `{entities: {<entity>: [row]}}`. */
964
+ async state(opts = {}) {
965
+ return this.exchange({ kind: "state" }, opts.timeoutMs);
966
+ }
967
+ /** Back to the opening state: the version's data plus the bundled
968
+ * scenario's or the inline task's seed. Rows written since are gone; the
969
+ * call log stays. */
970
+ async reset(opts = {}) {
971
+ await this.exchange({ kind: "reset" }, opts.timeoutMs);
972
+ }
973
+ /** The session's call log, oldest first: every tool call, seed, reset,
974
+ * grade with its result — the record of the episode. */
975
+ async export() {
976
+ const calls = [];
977
+ let cursor;
978
+ do {
979
+ const params = new URLSearchParams({ limit: String(EXPORT_PAGE) });
980
+ if (cursor) params.set("cursor", cursor);
981
+ const page = await apiRequest(
982
+ this.options,
983
+ "GET",
984
+ `/api/public/world-sessions/${encodeURIComponent(this.sessionId)}/calls?${params.toString()}`
985
+ );
986
+ for (const call of page.calls) {
987
+ calls.push({
988
+ seq: Number(call.seq),
989
+ kind: String(call.kind ?? "call"),
990
+ tool: typeof call.tool === "string" ? call.tool : null,
991
+ args: call.args ?? null,
992
+ result: call.result ?? null,
993
+ error: typeof call.error === "string" ? call.error : null,
994
+ completedAt: typeof call.completedAt === "string" ? call.completedAt : null
995
+ });
996
+ }
997
+ cursor = page.nextCursor ?? void 0;
998
+ } while (cursor);
999
+ return calls;
1000
+ }
1001
+ /**
1002
+ * Promote this session's inline task into a stored task of the project
1003
+ * (version 1, pinned to the session's world unless `world` says otherwise),
1004
+ * so a task written for one end user can be reused and its grades
1005
+ * compared. The session then records the new task's id. A session on a
1006
+ * bundled task has nothing to save; one on a stored task is already saved.
1007
+ */
1008
+ async saveTask(opts = {}) {
1009
+ const task = await apiRequest(
1010
+ this.options,
1011
+ "POST",
1012
+ `/api/public/world-sessions/${encodeURIComponent(this.sessionId)}/task`,
1013
+ {
1014
+ ...opts.name !== void 0 ? { name: opts.name } : {},
1015
+ ...opts.world !== void 0 ? { world: opts.world } : {},
1016
+ ...opts.message !== void 0 ? { message: opts.message } : {}
1017
+ }
1018
+ );
1019
+ this.current = {
1020
+ ...this.current,
1021
+ taskName: task.name,
1022
+ task: {
1023
+ ...this.taskInfo,
1024
+ source: "stored",
1025
+ name: task.name,
1026
+ id: task.id,
1027
+ version: task.version
1028
+ }
1029
+ };
1030
+ return task;
1031
+ }
300
1032
  /**
301
1033
  * End the session. `keepWarm` hands the container back to the pool instead
302
1034
  * of tearing it down, so the next session for the same task starts warm —
@@ -314,7 +1046,100 @@ var init_session = __esm({
314
1046
  }
315
1047
  });
316
1048
 
1049
+ // src/worlds/tasks.ts
1050
+ async function createTask(input, options = {}) {
1051
+ return apiRequest(
1052
+ options,
1053
+ "POST",
1054
+ TASKS,
1055
+ compact({
1056
+ spec: input.spec,
1057
+ name: input.name,
1058
+ world: input.world,
1059
+ message: input.message
1060
+ })
1061
+ );
1062
+ }
1063
+ async function updateTask(taskId, input, options = {}) {
1064
+ if (input.spec === void 0 && input.name === void 0 && input.world === void 0)
1065
+ throw new Error("updateTask: nothing to update \u2014 pass spec, name or world");
1066
+ return apiRequest(
1067
+ options,
1068
+ "PATCH",
1069
+ taskRoute(taskId),
1070
+ compact({
1071
+ spec: input.spec,
1072
+ name: input.name,
1073
+ world: input.world,
1074
+ message: input.message
1075
+ })
1076
+ );
1077
+ }
1078
+ async function listTasks(filter = {}, options = {}) {
1079
+ const params = new URLSearchParams();
1080
+ if (filter.world) params.set("world", filter.world);
1081
+ if (filter.page !== void 0) params.set("page", String(filter.page));
1082
+ if (filter.limit !== void 0) params.set("limit", String(filter.limit));
1083
+ for (const [key, value] of Object.entries(filter.metadata ?? {}))
1084
+ params.set(`metadata.${key}`, value);
1085
+ const query = params.toString();
1086
+ return apiRequest(
1087
+ options,
1088
+ "GET",
1089
+ query ? `${TASKS}?${query}` : TASKS
1090
+ );
1091
+ }
1092
+ async function getTask(taskId, opts = {}, options = {}) {
1093
+ const query = opts.version === void 0 ? "" : `?version=${String(opts.version)}`;
1094
+ return apiRequest(
1095
+ options,
1096
+ "GET",
1097
+ `${taskRoute(taskId)}${query}`
1098
+ );
1099
+ }
1100
+ async function deleteTask(taskId, options = {}) {
1101
+ return apiRequest(options, "DELETE", taskRoute(taskId));
1102
+ }
1103
+ async function validateTask(taskId, target = {}, options = {}) {
1104
+ return apiRequest(
1105
+ options,
1106
+ "POST",
1107
+ `${taskRoute(taskId)}/validate`,
1108
+ compact({
1109
+ version: target.version,
1110
+ slug: target.slug,
1111
+ versionId: target.versionId
1112
+ })
1113
+ );
1114
+ }
1115
+ var TASKS, taskRoute, compact;
1116
+ var init_tasks = __esm({
1117
+ "src/worlds/tasks.ts"() {
1118
+ "use strict";
1119
+ init_worlds();
1120
+ TASKS = "/api/public/world-tasks";
1121
+ taskRoute = (id) => `${TASKS}/${encodeURIComponent(id)}`;
1122
+ compact = (body) => Object.fromEntries(Object.entries(body).filter(([, v]) => v !== void 0));
1123
+ }
1124
+ });
1125
+
317
1126
  // src/worlds/hub.ts
1127
+ var hub_exports = {};
1128
+ __export(hub_exports, {
1129
+ DEFAULT_BRANCH: () => DEFAULT_BRANCH,
1130
+ buildSourceTarball: () => buildSourceTarball,
1131
+ collectArchiveRelPaths: () => collectArchiveRelPaths,
1132
+ computeContentHash: () => computeContentHash,
1133
+ createRef: () => createRef,
1134
+ isIncludedInContentHash: () => isIncludedInContentHash,
1135
+ localTreeState: () => localTreeState,
1136
+ propose: () => propose,
1137
+ pull: () => pull,
1138
+ push: () => push,
1139
+ readLocalMeta: () => readLocalMeta,
1140
+ snapshotTreeHashes: () => snapshotTreeHashes,
1141
+ writeLocalMeta: () => writeLocalMeta
1142
+ });
318
1143
  import { createHash as createHash2 } from "crypto";
319
1144
  import { gzipSync, gunzipSync } from "zlib";
320
1145
  import * as fs from "fs";
@@ -452,8 +1277,8 @@ function localTreeState(dir) {
452
1277
  }
453
1278
  function readPyproject(dir) {
454
1279
  try {
455
- const text = fs.readFileSync(path.join(dir, "pyproject.toml"), "utf-8");
456
- const section = /\[project\]([\s\S]*?)(\n\[|$)/.exec(text)?.[1] ?? "";
1280
+ const text2 = fs.readFileSync(path.join(dir, "pyproject.toml"), "utf-8");
1281
+ const section = /\[project\]([\s\S]*?)(\n\[|$)/.exec(text2)?.[1] ?? "";
457
1282
  const name = /\bname\s*=\s*"([^"]+)"/.exec(section)?.[1];
458
1283
  const version = /\bversion\s*=\s*"([^"]+)"/.exec(section)?.[1];
459
1284
  return { name, version };
@@ -461,6 +1286,17 @@ function readPyproject(dir) {
461
1286
  return {};
462
1287
  }
463
1288
  }
1289
+ function readWorldContractVersion(dir) {
1290
+ for (const rel of ["schema/world.json", path.join("server", "world", "schema", "world.json")]) {
1291
+ try {
1292
+ const parsed = JSON.parse(fs.readFileSync(path.join(dir, rel), "utf-8"));
1293
+ const pkg = parsed["x-gateway"]?.package;
1294
+ if (pkg?.version) return { name: pkg.id, version: pkg.version };
1295
+ } catch {
1296
+ }
1297
+ }
1298
+ return {};
1299
+ }
464
1300
  function buildFileManifest(dir) {
465
1301
  const entries = [];
466
1302
  const walk = (rel) => {
@@ -506,17 +1342,25 @@ async function push(dir, opts = {}) {
506
1342
  const baseVersionId = opts.baseVersionId ?? localMeta.versionId ?? null;
507
1343
  const contentHash = computeContentHash(dir);
508
1344
  const pyproject = readPyproject(dir);
1345
+ const contractVersion = pyproject.version ? void 0 : readWorldContractVersion(dir).version;
1346
+ if (contractVersion) pyproject.version = contractVersion;
509
1347
  const slug = opts.slug ?? pyproject.name ?? path.basename(path.resolve(dir));
510
- const resolve2 = await apiRequest(
1348
+ const resolve7 = await apiRequest(
511
1349
  options,
512
1350
  "POST",
513
1351
  "/api/public/benchmark-containers/resolve",
514
- { slug, name: pyproject.name ?? slug }
1352
+ {
1353
+ slug,
1354
+ name: opts.name ?? pyproject.name ?? slug,
1355
+ ...opts.description ? { description: opts.description } : {},
1356
+ ...opts.tags?.length ? { tags: opts.tags } : {},
1357
+ ...opts.visibility ? { visibility: opts.visibility } : {}
1358
+ }
515
1359
  );
516
1360
  const tarball = buildSourceTarball(dir);
517
1361
  const bundleSha256 = sha256b64(tarball);
518
1362
  const version = await apiRequest(options, "POST", "/api/public/benchmark-containers/versions", {
519
- containerId: resolve2.containerId,
1363
+ containerId: resolve7.containerId,
520
1364
  contentHash,
521
1365
  bundleSha256,
522
1366
  bundleSizeBytes: tarball.length,
@@ -527,10 +1371,11 @@ async function push(dir, opts = {}) {
527
1371
  baseVersionId,
528
1372
  ...opts.force ? { force: true } : {},
529
1373
  ...opts.message ? { changeReason: opts.message } : {},
530
- ...opts.author ? { author: opts.author } : {}
1374
+ ...opts.author ? { author: opts.author } : {},
1375
+ ...opts.imageRef ? { imageRef: opts.imageRef } : {}
531
1376
  });
532
1377
  if (version.uploadUrl) await putObject(version.uploadUrl, tarball, bundleSha256);
533
- await apiRequest(
1378
+ const final = await apiRequest(
534
1379
  options,
535
1380
  "POST",
536
1381
  `/api/public/benchmark-containers/versions/${version.versionId}/finalize`,
@@ -547,7 +1392,15 @@ async function push(dir, opts = {}) {
547
1392
  forkedFromVersionId: baseVersionId,
548
1393
  baseFiles: snapshotTreeHashes(dir)
549
1394
  });
550
- return { slug, versionId: version.versionId, contentHash, branch };
1395
+ return {
1396
+ containerId: resolve7.containerId,
1397
+ slug,
1398
+ versionId: version.versionId,
1399
+ contentHash,
1400
+ branch: final.branch ?? branch,
1401
+ state: final.state ?? null,
1402
+ alreadyUploaded: Boolean(version.alreadyUploaded)
1403
+ };
551
1404
  }
552
1405
  function extractBundle(bundle, dir) {
553
1406
  const tar = gunzipSync(bundle);
@@ -735,168 +1588,1970 @@ function buildMarkdown(report, minScore, source) {
735
1588
  lines.push("</details>");
736
1589
  }
737
1590
  }
738
- return lines.join("\n");
1591
+ return lines.join("\n");
1592
+ }
1593
+ async function validateWorld(dir, opts) {
1594
+ const options = opts.options ?? {};
1595
+ const progress = opts.onProgress ?? (() => {
1596
+ });
1597
+ const minScore = opts.minScore ?? null;
1598
+ const provenance = detectProvenance();
1599
+ const branch = opts.branch ?? provenance.branch;
1600
+ if (!branch)
1601
+ throw new Error(
1602
+ "No branch to validate on: pass --branch or run inside a git checkout / GitHub Actions."
1603
+ );
1604
+ progress(`pushing ${dir} as ${opts.slug ?? "(pyproject name)"}@${branch}\u2026`);
1605
+ let tipVersionId = null;
1606
+ if (opts.slug) {
1607
+ try {
1608
+ const tip = await apiRequest(
1609
+ options,
1610
+ "POST",
1611
+ "/api/public/benchmark-containers/resolve-version",
1612
+ { slug: opts.slug, ref: branch }
1613
+ );
1614
+ tipVersionId = tip.versionId ?? null;
1615
+ } catch {
1616
+ tipVersionId = null;
1617
+ }
1618
+ }
1619
+ const pushed = await push(dir, {
1620
+ slug: opts.slug,
1621
+ branch,
1622
+ baseVersionId: tipVersionId,
1623
+ message: `PR validation push (${provenance.commit?.slice(0, 12) ?? "local"})`,
1624
+ ...provenance.actor?.name ? { author: provenance.actor.name } : {},
1625
+ options
1626
+ });
1627
+ progress(`pushed version ${pushed.versionId} (${pushed.contentHash.slice(0, 12)})`);
1628
+ const configs = await listRunConfigs(options);
1629
+ const runConfig = configs.find((c) => c.id === opts.runConfig) ?? configs.find((c) => c.name === opts.runConfig);
1630
+ if (!runConfig) {
1631
+ const known = configs.map((c) => c.name).join(", ") || "(none)";
1632
+ throw new Error(
1633
+ `Run config "${opts.runConfig}" not found in this project. Have: ${known}`
1634
+ );
1635
+ }
1636
+ progress(`dispatching run config "${runConfig.name}" (${runConfig.models.join(", ")})\u2026`);
1637
+ const dispatched = await apiRequest(options, "POST", "/api/public/benchmark-containers/run-configs/dispatch", {
1638
+ runConfigId: runConfig.id,
1639
+ versionId: pushed.versionId,
1640
+ ...provenance
1641
+ });
1642
+ const host = (options.host ?? process.env.GATEWAY_HOST ?? "https://withgateway.ai").replace(/\/+$/, "");
1643
+ let projectId = null;
1644
+ try {
1645
+ const projects = await apiRequest(
1646
+ options,
1647
+ "GET",
1648
+ "/api/public/projects"
1649
+ );
1650
+ projectId = projects.data?.[0]?.id ?? null;
1651
+ } catch {
1652
+ projectId = null;
1653
+ }
1654
+ const fallbackUrl = (report) => {
1655
+ if (report.url) return report.url;
1656
+ const evaluationId = report.evaluations[0]?.id;
1657
+ return projectId && evaluationId ? `${host}/project/${projectId}/environment/runs/${encodeURIComponent(evaluationId)}` : null;
1658
+ };
1659
+ const runs = [];
1660
+ for (const run of dispatched.runs) {
1661
+ if (!run.ok) {
1662
+ runs.push({
1663
+ model: run.model,
1664
+ runId: run.runId,
1665
+ report: null,
1666
+ failure: `dispatch failed: ${run.error ?? "unknown error"}`
1667
+ });
1668
+ continue;
1669
+ }
1670
+ progress(`waiting on ${run.model} (run ${run.runId})\u2026`);
1671
+ let report = null;
1672
+ let failure = null;
1673
+ try {
1674
+ report = await waitForRun(run.runId, {
1675
+ timeoutMinutes: opts.timeoutMinutes ?? 45,
1676
+ options,
1677
+ onTick: (r) => progress(
1678
+ `\u2026${run.model}: ${r.status.toLowerCase()} (${r.shardsCompleted ?? 0}/${r.parallelism} shards)`
1679
+ )
1680
+ });
1681
+ report = { ...report, url: fallbackUrl(report) };
1682
+ if (report.status.toUpperCase() !== "COMPLETED") {
1683
+ failure = report.status;
1684
+ } else if (minScore !== null) {
1685
+ if (report.score === null) failure = "completed without a score";
1686
+ else if (report.score < minScore)
1687
+ failure = `score ${fmtScore(report.score)} < ${minScore}`;
1688
+ }
1689
+ } catch (error) {
1690
+ failure = error instanceof Error ? error.message : String(error);
1691
+ }
1692
+ runs.push({ model: run.model, runId: run.runId, report, failure });
1693
+ }
1694
+ const base = {
1695
+ ok: runs.length > 0 && runs.every((r) => r.failure === null),
1696
+ slug: pushed.slug,
1697
+ branch,
1698
+ versionId: pushed.versionId,
1699
+ contentHash: pushed.contentHash,
1700
+ runConfig: { id: runConfig.id, name: runConfig.name },
1701
+ runs
1702
+ };
1703
+ return {
1704
+ ...base,
1705
+ markdown: buildMarkdown(base, minScore, {
1706
+ repoUrl: provenance.repoUrl,
1707
+ commit: provenance.commit
1708
+ })
1709
+ };
1710
+ }
1711
+ var init_validate = __esm({
1712
+ "src/worlds/validate.ts"() {
1713
+ "use strict";
1714
+ init_worlds();
1715
+ init_hub();
1716
+ }
1717
+ });
1718
+
1719
+ // src/worlds/describe.ts
1720
+ async function describeWorld(slug, options = {}) {
1721
+ if (slug.includes("@"))
1722
+ throw new Error(
1723
+ `describeWorld reads a world's head version: pass the slug without @ref (got ${slug})`
1724
+ );
1725
+ return apiRequest(
1726
+ options,
1727
+ "GET",
1728
+ `/api/public/worlds/${encodeURIComponent(slug)}`
1729
+ );
1730
+ }
1731
+ var init_describe = __esm({
1732
+ "src/worlds/describe.ts"() {
1733
+ "use strict";
1734
+ init_worlds();
1735
+ }
1736
+ });
1737
+
1738
+ // src/cli/platform/worldData/json.ts
1739
+ function parseJson(text2) {
1740
+ const p = new Parser(text2);
1741
+ p.skipWs();
1742
+ const value = p.value();
1743
+ p.skipWs();
1744
+ if (p.i < text2.length) throw new JsonSyntaxError(`Extra data at ${p.i}`);
1745
+ return value;
1746
+ }
1747
+ function dumps(value) {
1748
+ if (value === null) return "null";
1749
+ if (value === true) return "true";
1750
+ if (value === false) return "false";
1751
+ if (typeof value === "string") return JSON.stringify(value);
1752
+ if (value instanceof JsonNumber) return numberText(value);
1753
+ if (Array.isArray(value)) return "[" + value.map(dumps).join(",") + "]";
1754
+ const parts = [];
1755
+ for (const [key, item] of value) parts.push(JSON.stringify(key) + ":" + dumps(item));
1756
+ return "{" + parts.join(",") + "}";
1757
+ }
1758
+ function numberText(n) {
1759
+ if (!n.isFloat) return /^-0+$/.test(n.text) ? "0" : n.text;
1760
+ const value = n.value;
1761
+ if (Number.isNaN(value)) return "NaN";
1762
+ if (value === Infinity) return "Infinity";
1763
+ if (value === -Infinity) return "-Infinity";
1764
+ return pyFloatRepr(value);
1765
+ }
1766
+ function pyFloatRepr(x) {
1767
+ if (x === 0) return Object.is(x, -0) ? "-0.0" : "0.0";
1768
+ const sign = x < 0 ? "-" : "";
1769
+ const js = String(Math.abs(x));
1770
+ const [mantissa, exponentPart] = js.split("e");
1771
+ let exponent = exponentPart ? Number(exponentPart) : 0;
1772
+ const [intPart, fracPart = ""] = mantissa.split(".");
1773
+ let digits = intPart + fracPart;
1774
+ let decpt = intPart.length + exponent;
1775
+ const leading = digits.match(/^0*/)[0].length;
1776
+ digits = digits.slice(leading);
1777
+ decpt -= leading;
1778
+ digits = digits.replace(/0+$/, "");
1779
+ if (digits === "") return sign + "0.0";
1780
+ const sci = decpt - 1;
1781
+ if (sci >= -4 && sci < 16) {
1782
+ if (decpt <= 0) return sign + "0." + "0".repeat(-decpt) + digits;
1783
+ if (decpt >= digits.length) return sign + digits + "0".repeat(decpt - digits.length) + ".0";
1784
+ return sign + digits.slice(0, decpt) + "." + digits.slice(decpt);
1785
+ }
1786
+ exponent = sci;
1787
+ const mag = String(Math.abs(exponent)).padStart(2, "0");
1788
+ return sign + digits[0] + (digits.length > 1 ? "." + digits.slice(1) : "") + "e" + (exponent < 0 ? "-" : "+") + mag;
1789
+ }
1790
+ function pyRound(n, ndigits) {
1791
+ if (!n.isFloat) return n;
1792
+ const x = n.value;
1793
+ if (!Number.isFinite(x)) return n;
1794
+ const sign = x < 0 ? -1 : 1;
1795
+ const magnitude = Math.abs(x);
1796
+ if (magnitude >= 9007199254740992) return new JsonNumber(pyFloatRepr(x));
1797
+ const { m, k } = exactFraction(magnitude);
1798
+ let rounded;
1799
+ if (k <= ndigits) rounded = magnitude;
1800
+ else if (k !== ndigits + 1) rounded = Number(magnitude.toFixed(ndigits));
1801
+ else {
1802
+ const scaled = m * 5n ** BigInt(k);
1803
+ let kept = scaled / 10n;
1804
+ if (kept % 2n === 1n) kept += 1n;
1805
+ const text2 = kept.toString().padStart(ndigits + 1, "0");
1806
+ rounded = ndigits === 0 ? Number(text2) : Number(text2.slice(0, -ndigits) + "." + text2.slice(-ndigits));
1807
+ }
1808
+ return new JsonNumber(pyFloatRepr(sign * rounded));
1809
+ }
1810
+ function exactFraction(x) {
1811
+ if (x === 0) return { m: 0n, k: 0 };
1812
+ const view = new DataView(new ArrayBuffer(8));
1813
+ view.setFloat64(0, x);
1814
+ const bits = view.getBigUint64(0);
1815
+ const exponent = Number(bits >> 52n & 0x7ffn);
1816
+ let mantissa = bits & (1n << 52n) - 1n;
1817
+ let e;
1818
+ if (exponent === 0) e = -1074;
1819
+ else {
1820
+ mantissa |= 1n << 52n;
1821
+ e = exponent - 1075;
1822
+ }
1823
+ while (mantissa !== 0n && (mantissa & 1n) === 0n) {
1824
+ mantissa >>= 1n;
1825
+ e += 1;
1826
+ }
1827
+ if (e >= 0) return { m: mantissa << BigInt(e), k: 0 };
1828
+ return { m: mantissa, k: -e };
1829
+ }
1830
+ var JsonNumber, JsonSyntaxError, Parser, isDigit;
1831
+ var init_json = __esm({
1832
+ "src/cli/platform/worldData/json.ts"() {
1833
+ "use strict";
1834
+ JsonNumber = class {
1835
+ /** The lexeme as it appeared, e.g. "1.0", "-0", "1e21". */
1836
+ constructor(text2) {
1837
+ this.text = text2;
1838
+ }
1839
+ /** A float in Python's eyes: a fraction, an exponent, or a non-finite literal. */
1840
+ get isFloat() {
1841
+ return /[.eE]/.test(this.text) || /[nN]/.test(this.text);
1842
+ }
1843
+ get value() {
1844
+ return Number(this.text);
1845
+ }
1846
+ };
1847
+ JsonSyntaxError = class extends Error {
1848
+ };
1849
+ Parser = class {
1850
+ constructor(s) {
1851
+ this.s = s;
1852
+ }
1853
+ i = 0;
1854
+ skipWs() {
1855
+ const s = this.s;
1856
+ while (this.i < s.length) {
1857
+ const c = s.charCodeAt(this.i);
1858
+ if (c === 32 || c === 10 || c === 13 || c === 9) this.i++;
1859
+ else break;
1860
+ }
1861
+ }
1862
+ fail(what) {
1863
+ throw new JsonSyntaxError(`${what} at ${this.i}`);
1864
+ }
1865
+ value() {
1866
+ const s = this.s;
1867
+ if (this.i >= s.length) this.fail("Expecting value");
1868
+ const c = s[this.i];
1869
+ if (c === "{") return this.object();
1870
+ if (c === "[") return this.array();
1871
+ if (c === '"') return this.string();
1872
+ if (c === "t") return this.literal("true", true);
1873
+ if (c === "f") return this.literal("false", false);
1874
+ if (c === "n") return this.literal("null", null);
1875
+ if (c === "N") return this.literal("NaN", new JsonNumber("NaN"));
1876
+ if (c === "I") return this.literal("Infinity", new JsonNumber("Infinity"));
1877
+ return this.number();
1878
+ }
1879
+ literal(word, value) {
1880
+ if (!this.s.startsWith(word, this.i)) this.fail("Expecting value");
1881
+ this.i += word.length;
1882
+ return value;
1883
+ }
1884
+ number() {
1885
+ const s = this.s;
1886
+ const start = this.i;
1887
+ if (s[this.i] === "-") {
1888
+ this.i++;
1889
+ if (s.startsWith("Infinity", this.i)) {
1890
+ this.i += 8;
1891
+ return new JsonNumber("-Infinity");
1892
+ }
1893
+ }
1894
+ const intStart = this.i;
1895
+ if (s[this.i] === "0") this.i++;
1896
+ else {
1897
+ while (this.i < s.length && isDigit(s.charCodeAt(this.i))) this.i++;
1898
+ if (this.i === intStart) this.fail("Expecting value");
1899
+ }
1900
+ if (s[this.i] === ".") {
1901
+ this.i++;
1902
+ const fracStart = this.i;
1903
+ while (this.i < s.length && isDigit(s.charCodeAt(this.i))) this.i++;
1904
+ if (this.i === fracStart) this.fail("Invalid number");
1905
+ }
1906
+ if (s[this.i] === "e" || s[this.i] === "E") {
1907
+ this.i++;
1908
+ if (s[this.i] === "+" || s[this.i] === "-") this.i++;
1909
+ const expStart = this.i;
1910
+ while (this.i < s.length && isDigit(s.charCodeAt(this.i))) this.i++;
1911
+ if (this.i === expStart) this.fail("Invalid number");
1912
+ }
1913
+ return new JsonNumber(s.slice(start, this.i));
1914
+ }
1915
+ string() {
1916
+ const s = this.s;
1917
+ this.i++;
1918
+ let out = "";
1919
+ let runStart = this.i;
1920
+ for (; ; ) {
1921
+ if (this.i >= s.length) this.fail("Unterminated string");
1922
+ const c = s.charCodeAt(this.i);
1923
+ if (c === 34) {
1924
+ out += s.slice(runStart, this.i);
1925
+ this.i++;
1926
+ return out;
1927
+ }
1928
+ if (c < 32) this.fail("Invalid control character");
1929
+ if (c !== 92) {
1930
+ this.i++;
1931
+ continue;
1932
+ }
1933
+ out += s.slice(runStart, this.i);
1934
+ this.i++;
1935
+ const e = s[this.i];
1936
+ switch (e) {
1937
+ case '"':
1938
+ case "\\":
1939
+ case "/":
1940
+ out += e;
1941
+ break;
1942
+ case "b":
1943
+ out += "\b";
1944
+ break;
1945
+ case "f":
1946
+ out += "\f";
1947
+ break;
1948
+ case "n":
1949
+ out += "\n";
1950
+ break;
1951
+ case "r":
1952
+ out += "\r";
1953
+ break;
1954
+ case "t":
1955
+ out += " ";
1956
+ break;
1957
+ case "u": {
1958
+ const hex2 = s.slice(this.i + 1, this.i + 5);
1959
+ if (!/^[0-9a-fA-F]{4}$/.test(hex2)) this.fail("Invalid \\u escape");
1960
+ out += String.fromCharCode(parseInt(hex2, 16));
1961
+ this.i += 4;
1962
+ break;
1963
+ }
1964
+ default:
1965
+ this.fail("Invalid escape");
1966
+ }
1967
+ this.i++;
1968
+ runStart = this.i;
1969
+ }
1970
+ }
1971
+ array() {
1972
+ this.i++;
1973
+ const out = [];
1974
+ this.skipWs();
1975
+ if (this.s[this.i] === "]") {
1976
+ this.i++;
1977
+ return out;
1978
+ }
1979
+ for (; ; ) {
1980
+ this.skipWs();
1981
+ out.push(this.value());
1982
+ this.skipWs();
1983
+ const c = this.s[this.i];
1984
+ if (c === ",") {
1985
+ this.i++;
1986
+ continue;
1987
+ }
1988
+ if (c === "]") {
1989
+ this.i++;
1990
+ return out;
1991
+ }
1992
+ this.fail("Expecting ',' delimiter");
1993
+ }
1994
+ }
1995
+ object() {
1996
+ this.i++;
1997
+ const out = /* @__PURE__ */ new Map();
1998
+ this.skipWs();
1999
+ if (this.s[this.i] === "}") {
2000
+ this.i++;
2001
+ return out;
2002
+ }
2003
+ for (; ; ) {
2004
+ this.skipWs();
2005
+ if (this.s[this.i] !== '"') this.fail("Expecting property name enclosed in double quotes");
2006
+ const key = this.string();
2007
+ this.skipWs();
2008
+ if (this.s[this.i] !== ":") this.fail("Expecting ':' delimiter");
2009
+ this.i++;
2010
+ this.skipWs();
2011
+ out.set(key, this.value());
2012
+ this.skipWs();
2013
+ const c = this.s[this.i];
2014
+ if (c === ",") {
2015
+ this.i++;
2016
+ continue;
2017
+ }
2018
+ if (c === "}") {
2019
+ this.i++;
2020
+ return out;
2021
+ }
2022
+ this.fail("Expecting ',' delimiter");
2023
+ }
2024
+ }
2025
+ };
2026
+ isDigit = (c) => c >= 48 && c <= 57;
2027
+ }
2028
+ });
2029
+
2030
+ // src/worlds/transforms.ts
2031
+ import { createHash as createHash3 } from "crypto";
2032
+ function parseTransform(name) {
2033
+ const simple = Object.prototype.hasOwnProperty.call(SIMPLE, name) ? SIMPLE[name] : void 0;
2034
+ if (simple) return simple;
2035
+ const colon = name.indexOf(":");
2036
+ if (colon !== -1) {
2037
+ const head = name.slice(0, colon);
2038
+ const prefix = name.slice(colon + 1);
2039
+ if (head === STRIP_PREFIX && prefix && !prefix.includes(",")) return stripPrefix(prefix);
2040
+ }
2041
+ throw new Error(`Unknown transform '${name}'; choose one of ${TRANSFORMS.join(", ")}`);
2042
+ }
2043
+ function applyTransforms(value, chain) {
2044
+ const steps = chain.map(parseTransform);
2045
+ let out = text(value);
2046
+ for (const step of steps) out = step(out);
2047
+ return out;
2048
+ }
2049
+ var WHITESPACE, WHITESPACE_EDGES, WHITESPACE_RUN, NOT_DIGIT, STRIP_PREFIX, trim, emailLocalPart, emailDomain, stripPrefix, hex, SIMPLE, TRANSFORMS, text;
2050
+ var init_transforms = __esm({
2051
+ "src/worlds/transforms.ts"() {
2052
+ "use strict";
2053
+ init_json();
2054
+ WHITESPACE = " \n\r\f\v";
2055
+ WHITESPACE_EDGES = /^[ \t\n\r\f\v]+|[ \t\n\r\f\v]+$/g;
2056
+ WHITESPACE_RUN = /[ \t\n\r\f\v]+/g;
2057
+ NOT_DIGIT = /[^0-9]/g;
2058
+ STRIP_PREFIX = "strip_prefix";
2059
+ trim = (value) => value.replace(WHITESPACE_EDGES, "");
2060
+ emailLocalPart = (value) => {
2061
+ const at = value.lastIndexOf("@");
2062
+ return at === -1 ? value : value.slice(0, at);
2063
+ };
2064
+ emailDomain = (value) => {
2065
+ const at = value.lastIndexOf("@");
2066
+ return at === -1 ? "" : value.slice(at + 1).toLowerCase();
2067
+ };
2068
+ stripPrefix = (prefix) => (value) => value.startsWith(prefix) ? value.slice(prefix.length) : value;
2069
+ hex = (algorithm, value) => createHash3(algorithm).update(value, "utf8").digest("hex");
2070
+ SIMPLE = {
2071
+ lower: (value) => value.toLowerCase(),
2072
+ upper: (value) => value.toUpperCase(),
2073
+ trim,
2074
+ collapse_ws: (value) => trim(value).replace(WHITESPACE_RUN, " "),
2075
+ nfkc: (value) => value.normalize("NFKC"),
2076
+ digits: (value) => value.replace(NOT_DIGIT, ""),
2077
+ email_local_part: emailLocalPart,
2078
+ email_domain: emailDomain,
2079
+ // Vendor-style digests: lowercase hex of the utf-8 bytes, unsalted. This is
2080
+ // how SpyCloud accepts a hashed selector (`_digests` in its api_handlers).
2081
+ sha1: (value) => hex("sha1", value),
2082
+ sha256: (value) => hex("sha256", value)
2083
+ };
2084
+ TRANSFORMS = [...Object.keys(SIMPLE), `${STRIP_PREFIX}:<prefix>`];
2085
+ text = (value) => {
2086
+ if (typeof value === "string") return value;
2087
+ return Number.isInteger(value) ? String(value) : pyFloatRepr(value);
2088
+ };
2089
+ }
2090
+ });
2091
+
2092
+ // src/worlds/redaction.ts
2093
+ import { createHash as createHash4 } from "crypto";
2094
+ function pyText(value) {
2095
+ if (typeof value === "string") return value;
2096
+ if (Number.isInteger(value)) return String(value);
2097
+ if (Number.isNaN(value)) return "nan";
2098
+ if (!Number.isFinite(value)) return value > 0 ? "inf" : "-inf";
2099
+ return pyFloatRepr(value);
2100
+ }
2101
+ function hashForm(slug, plaintext) {
2102
+ return "sha256:" + createHash4("sha256").update(`${slug}:${pyText(plaintext)}`, "utf8").digest("hex");
2103
+ }
2104
+ function preserveForm(slug, plaintext) {
2105
+ const kind = typeof plaintext === "string" ? "str" : isInt(plaintext) ? "int" : "float";
2106
+ const shaped = shapeText(slug, pyText(plaintext), kind);
2107
+ return kind === "str" ? shaped : Number(shaped);
2108
+ }
2109
+ function shapeText(slug, text2, kind) {
2110
+ const seed = Buffer.from(`${slug}:${text2}`, "utf8");
2111
+ let digest = createHash4("sha256").update(seed).digest();
2112
+ let cursor = 0;
2113
+ const out = [];
2114
+ for (const char of text2) {
2115
+ if (cursor === digest.length) {
2116
+ digest = createHash4("sha256").update(Buffer.concat([digest, seed])).digest();
2117
+ cursor = 0;
2118
+ }
2119
+ const byte = digest[cursor];
2120
+ cursor += 1;
2121
+ if (char >= "0" && char <= "9") out.push(String(byte % 10));
2122
+ else if (kind === "str" && char >= "a" && char <= "z") out.push(String.fromCharCode(97 + byte % 26));
2123
+ else if (kind === "str" && char >= "A" && char <= "Z") out.push(String.fromCharCode(65 + byte % 26));
2124
+ else out.push(char);
2125
+ }
2126
+ if (kind === "int" && out.length > 1 && out[0] === "0") out[0] = String(1 + digest[0] % 9);
2127
+ return out.join("");
2128
+ }
2129
+ function roundForm(plaintext, decimals) {
2130
+ if (typeof plaintext === "string" || isInt(plaintext) || !Number.isFinite(plaintext)) return plaintext;
2131
+ return pyRound(new JsonNumber(pyFloatRepr(plaintext)), decimals).value;
2132
+ }
2133
+ function redactionOf(redact, field) {
2134
+ if (!redact) return null;
2135
+ const named = (names) => (names ?? []).some((name) => name === field || name.slice(name.lastIndexOf(".") + 1) === field);
2136
+ if (named(redact.drop)) return "drop";
2137
+ if (named(redact.hash)) return "hash";
2138
+ if (named(redact.preserve)) return "preserve";
2139
+ const decimals = redact.round?.[field];
2140
+ if (typeof decimals === "number") return `round:${decimals}`;
2141
+ return null;
2142
+ }
2143
+ function storedForms(world, field, plaintext, transform) {
2144
+ if (transform?.length) plaintext = applyTransforms(plaintext, transform);
2145
+ const policy = redactionOf(world.redact, field);
2146
+ const salt = world.redact?.slug ?? world.slug;
2147
+ if (policy === "drop") return [];
2148
+ if (policy === "hash") return [hashForm(salt, plaintext)];
2149
+ if (policy === "preserve") return [preserveForm(salt, plaintext)];
2150
+ if (policy !== null) return [roundForm(plaintext, world.redact.round[field])];
2151
+ return [plaintext];
2152
+ }
2153
+ var isInt;
2154
+ var init_redaction = __esm({
2155
+ "src/worlds/redaction.ts"() {
2156
+ "use strict";
2157
+ init_json();
2158
+ init_transforms();
2159
+ isInt = (value) => typeof value === "number" && Number.isInteger(value);
2160
+ }
2161
+ });
2162
+
2163
+ // src/worlds/query.ts
2164
+ function queryRowsSearch(entity, opts = {}) {
2165
+ const search = new URLSearchParams();
2166
+ search.set("entity", entity);
2167
+ if (opts.where && Object.keys(opts.where).length) search.set("where", JSON.stringify(opts.where));
2168
+ if (opts.limit !== void 0) search.set("limit", String(opts.limit));
2169
+ if (opts.offset !== void 0) search.set("offset", String(opts.offset));
2170
+ if (opts.resolve) search.set("resolve", "true");
2171
+ if (opts.across) search.set("across", "true");
2172
+ if (opts.compare) search.set("compare", "true");
2173
+ return `?${search.toString()}`;
2174
+ }
2175
+ async function queryRows(slug, entity, opts = {}, options = {}) {
2176
+ if (slug.includes("@"))
2177
+ throw new Error(
2178
+ `queryRows reads a world's head version: pass the slug without @ref (got ${slug})`
2179
+ );
2180
+ if (!entity) throw new Error("queryRows needs an entity");
2181
+ if (opts.compare && !opts.across) throw new Error("queryRows: compare needs across");
2182
+ return apiRequest(
2183
+ options,
2184
+ "GET",
2185
+ `/api/public/worlds/${encodeURIComponent(slug)}/data${queryRowsSearch(entity, opts)}`
2186
+ );
2187
+ }
2188
+ var init_query = __esm({
2189
+ "src/worlds/query.ts"() {
2190
+ "use strict";
2191
+ init_worlds();
2192
+ }
2193
+ });
2194
+
2195
+ // src/worlds/migrate.ts
2196
+ async function migrateWorld(slug, input = {}, options = {}) {
2197
+ if (slug.includes("@"))
2198
+ throw new Error(
2199
+ `migrateWorld converts a world's head version: pass the slug without @ref (got ${slug})`
2200
+ );
2201
+ return apiRequest(
2202
+ options,
2203
+ "POST",
2204
+ `/api/public/worlds/${encodeURIComponent(slug)}/migrate`,
2205
+ {
2206
+ ...input.apply === void 0 ? {} : { apply: input.apply },
2207
+ ...input.force === void 0 ? {} : { force: input.force }
2208
+ }
2209
+ );
2210
+ }
2211
+ async function migrateProjectWorlds(input = {}, options = {}) {
2212
+ return apiRequest(
2213
+ options,
2214
+ "POST",
2215
+ "/api/public/worlds/migrate",
2216
+ input.apply === void 0 ? {} : { apply: input.apply }
2217
+ );
2218
+ }
2219
+ var init_migrate = __esm({
2220
+ "src/worlds/migrate.ts"() {
2221
+ "use strict";
2222
+ init_worlds();
2223
+ }
2224
+ });
2225
+
2226
+ // src/cli/router.ts
2227
+ var CliError;
2228
+ var init_router = __esm({
2229
+ "src/cli/router.ts"() {
2230
+ "use strict";
2231
+ CliError = class extends Error {
2232
+ constructor(message, exitCode = 2) {
2233
+ super(message);
2234
+ this.exitCode = exitCode;
2235
+ }
2236
+ };
2237
+ }
2238
+ });
2239
+
2240
+ // src/cli/config.ts
2241
+ import * as fs2 from "fs";
2242
+ import * as os from "os";
2243
+ import * as path2 from "path";
2244
+ async function api(creds, method, route, body, init3 = {}) {
2245
+ const controller = new AbortController();
2246
+ const timer = setTimeout(() => controller.abort(), init3.timeoutMs ?? 12e4);
2247
+ try {
2248
+ const res = await fetch(`${creds.host}${route}`, {
2249
+ method,
2250
+ headers: {
2251
+ "content-type": "application/json",
2252
+ accept: "application/json",
2253
+ authorization: "Basic " + Buffer.from(`${creds.publicKey}:${creds.secretKey}`).toString("base64")
2254
+ },
2255
+ ...body === void 0 ? {} : { body: JSON.stringify(body) },
2256
+ signal: controller.signal
2257
+ });
2258
+ const text2 = await res.text();
2259
+ if (!res.ok) throw new ApiError(res.status, method, route, text2);
2260
+ return text2 ? JSON.parse(text2) : {};
2261
+ } finally {
2262
+ clearTimeout(timer);
2263
+ }
2264
+ }
2265
+ var ApiError;
2266
+ var init_config = __esm({
2267
+ "src/cli/config.ts"() {
2268
+ "use strict";
2269
+ init_router();
2270
+ ApiError = class extends CliError {
2271
+ constructor(status, method, route, text2) {
2272
+ super(`${method} ${route} -> ${status}: ${text2.slice(0, 600)}`, 1);
2273
+ this.status = status;
2274
+ this.method = method;
2275
+ this.route = route;
2276
+ this.text = text2;
2277
+ }
2278
+ };
2279
+ }
2280
+ });
2281
+
2282
+ // src/cli/runtime/local.ts
2283
+ import { spawn, spawnSync } from "child_process";
2284
+ import * as fs3 from "fs";
2285
+ import * as net from "net";
2286
+ import * as path3 from "path";
2287
+ function tailOf(output) {
2288
+ return output.length > DIAGNOSTIC_TAIL ? `\u2026${output.slice(-DIAGNOSTIC_TAIL)}` : output;
2289
+ }
2290
+ function runtimeMode() {
2291
+ const raw = (process.env.GATEWAY_RUNTIME ?? "auto").toLowerCase();
2292
+ if (raw === "local" || raw === "platform" || raw === "auto") return raw;
2293
+ throw new CliError(
2294
+ `GATEWAY_RUNTIME must be local, platform or auto (got ${raw})`
2295
+ );
2296
+ }
2297
+ function runtimeRoot() {
2298
+ const candidates = [];
2299
+ if (process.env.GATEWAY_RUNTIME_PATH)
2300
+ candidates.push(process.env.GATEWAY_RUNTIME_PATH);
2301
+ const entry = process.argv[1] && fs3.existsSync(process.argv[1]) ? path3.dirname(fs3.realpathSync(process.argv[1])) : null;
2302
+ if (entry) {
2303
+ candidates.push(path3.resolve(entry, "..", "runtime"));
2304
+ candidates.push(path3.resolve(entry, "..", "..", "runtime"));
2305
+ candidates.push(path3.resolve(entry, "..", "..", "sdk", "src"));
2306
+ }
2307
+ candidates.push(path3.resolve(process.cwd(), "runtime"));
2308
+ for (const root of candidates)
2309
+ if (fs3.existsSync(
2310
+ path3.join(root, "gatewaysdk", "environment", "schema", "platform.py")
2311
+ ))
2312
+ return root;
2313
+ return null;
2314
+ }
2315
+ function probeVersion(name) {
2316
+ const probe = spawnSync(
2317
+ name,
2318
+ ["-c", "import sys;print(sys.version_info[0],sys.version_info[1])"],
2319
+ { encoding: "utf8", timeout: 1e4 }
2320
+ );
2321
+ if (probe.status !== 0) return null;
2322
+ const [major, minor] = probe.stdout.trim().split(/\s+/).map(Number);
2323
+ return Number.isInteger(major) && Number.isInteger(minor) ? `${major}.${minor}` : null;
2324
+ }
2325
+ function atLeastMinimum(version) {
2326
+ const [major, minor] = version.split(".").map(Number);
2327
+ return major > MIN_PYTHON[0] || major === MIN_PYTHON[0] && minor >= MIN_PYTHON[1];
2328
+ }
2329
+ function uvPython() {
2330
+ const found = spawnSync("uv", UV_FIND, { encoding: "utf8", timeout: 1e4 });
2331
+ if (found.status !== 0) return null;
2332
+ const line = found.stdout.trim().split(/\r?\n/)[0] ?? "";
2333
+ return line || null;
2334
+ }
2335
+ function findPython() {
2336
+ if (pythonCache !== void 0) return pythonCache;
2337
+ const named = process.env.GATEWAY_PYTHON;
2338
+ const candidates = named ? [named] : PYTHON_CANDIDATES;
2339
+ for (const name of candidates) {
2340
+ const version = probeVersion(name);
2341
+ pythonProbes.push({ name, version });
2342
+ if (version && atLeastMinimum(version)) {
2343
+ pythonCache = name;
2344
+ return name;
2345
+ }
2346
+ }
2347
+ if (!named) {
2348
+ const fromUv = uvPython();
2349
+ const version = fromUv ? probeVersion(fromUv) : null;
2350
+ pythonProbes.push({ name: fromUv ?? "uv python find", version });
2351
+ if (fromUv && version && atLeastMinimum(version)) {
2352
+ pythonCache = fromUv;
2353
+ return fromUv;
2354
+ }
2355
+ }
2356
+ pythonCache = null;
2357
+ return null;
2358
+ }
2359
+ function pythonAdvice() {
2360
+ findPython();
2361
+ const floor = MIN_PYTHON.join(".");
2362
+ const named = process.env.GATEWAY_PYTHON;
2363
+ const seen = pythonProbes.filter((probe) => probe.version).map((probe) => `${probe.name} is ${probe.version}`);
2364
+ const found = seen.length ? seen.join(", ") : named ? `${named} did not run` : "none on PATH";
2365
+ return `No python3 >= ${floor} usable (${found}); set GATEWAY_PYTHON to a newer interpreter, e.g. GATEWAY_PYTHON="$(brew --prefix python@3.12)/bin/python3.12" or GATEWAY_PYTHON="$(uv python find 3.12)".`;
2366
+ }
2367
+ function localRuntimeReason() {
2368
+ if (runtimeMode() === "platform")
2369
+ return "GATEWAY_RUNTIME=platform forces the hosted side.";
2370
+ if (!findPython()) return pythonAdvice();
2371
+ if (!runtimeRoot())
2372
+ return "The bundled runtime is missing (set GATEWAY_RUNTIME_PATH).";
2373
+ return "";
2374
+ }
2375
+ function localRuntime() {
2376
+ if (runtimeMode() === "platform") return null;
2377
+ const python = findPython();
2378
+ const root = runtimeRoot();
2379
+ if (!python || !root) {
2380
+ if (runtimeMode() === "local")
2381
+ throw new CliError(
2382
+ !python ? `GATEWAY_RUNTIME=local but ${pythonAdvice()}` : "GATEWAY_RUNTIME=local but the bundled runtime is missing (set GATEWAY_RUNTIME_PATH)"
2383
+ );
2384
+ return null;
2385
+ }
2386
+ return { python, root };
2387
+ }
2388
+ function localPythonHasYaml(python) {
2389
+ return spawnSync(python, ["-c", "import yaml"], { timeout: 1e4 }).status === 0;
2390
+ }
2391
+ async function localBridge(request, local, opts = {}) {
2392
+ const input = JSON.stringify(request);
2393
+ return await new Promise((resolve7, reject) => {
2394
+ const child = spawn(
2395
+ local.python,
2396
+ ["-I", "-B", "-c", BRIDGE_BOOTSTRAP, local.root],
2397
+ {
2398
+ stdio: ["pipe", "pipe", "pipe"],
2399
+ // This is the author's machine running the author's world: the one
2400
+ // place the runtime may import and run a world's own Python (check's
2401
+ // handler execution, `worlds call`, `worlds test` tool cases).
2402
+ env: {
2403
+ PATH: process.env.PATH ?? "",
2404
+ HOME: process.env.HOME ?? "",
2405
+ TMPDIR: process.env.TMPDIR ?? "",
2406
+ GATEWAY_RUNTIME_EXECUTE: "1"
2407
+ }
2408
+ }
2409
+ );
2410
+ const out = [];
2411
+ const err = [];
2412
+ const timer = setTimeout(
2413
+ () => child.kill("SIGKILL"),
2414
+ opts.timeoutMs ?? 3e5
2415
+ );
2416
+ child.stdout.on("data", (chunk) => out.push(chunk));
2417
+ child.stderr.on("data", (chunk) => err.push(chunk));
2418
+ child.on("error", (error) => {
2419
+ clearTimeout(timer);
2420
+ reject(
2421
+ new CliError(
2422
+ `local runtime could not start (${local.python}): ${error.message}`,
2423
+ 1
2424
+ )
2425
+ );
2426
+ });
2427
+ child.on("close", (code) => {
2428
+ clearTimeout(timer);
2429
+ const text2 = Buffer.concat(out).toString("utf8");
2430
+ const stderr = Buffer.concat(err).toString("utf8");
2431
+ let payload = null;
2432
+ try {
2433
+ payload = text2 ? JSON.parse(text2) : null;
2434
+ } catch {
2435
+ payload = null;
2436
+ }
2437
+ if (payload && typeof payload === "object") {
2438
+ resolve7(payload);
2439
+ return;
2440
+ }
2441
+ reject(
2442
+ new CliError(
2443
+ `local runtime (${request.command}) exited ${code}: ${tailOf((stderr || text2).trim()) || "no output"}`,
2444
+ 1
2445
+ )
2446
+ );
2447
+ });
2448
+ child.stdin.end(input);
2449
+ });
2450
+ }
2451
+ var MIN_PYTHON, DIAGNOSTIC_TAIL, BRIDGE_BOOTSTRAP, pythonCache, pythonProbes, PYTHON_CANDIDATES, UV_FIND;
2452
+ var init_local = __esm({
2453
+ "src/cli/runtime/local.ts"() {
2454
+ "use strict";
2455
+ init_router();
2456
+ init_config();
2457
+ MIN_PYTHON = [3, 11];
2458
+ DIAGNOSTIC_TAIL = 600;
2459
+ BRIDGE_BOOTSTRAP = `import sys,runpy,types,os
2460
+ root=sys.argv[1]
2461
+ package=types.ModuleType('gatewaysdk')
2462
+ package.__path__=[os.path.join(root,'gatewaysdk')]
2463
+ sys.modules['gatewaysdk']=package
2464
+ runpy.run_module('gatewaysdk.environment.schema.platform',run_name='__main__')`;
2465
+ pythonProbes = [];
2466
+ PYTHON_CANDIDATES = [
2467
+ "python3.13",
2468
+ "python3.12",
2469
+ "python3.11",
2470
+ "python3",
2471
+ "python"
2472
+ ];
2473
+ UV_FIND = ["python", "find", `>=${MIN_PYTHON.join(".")}`];
2474
+ }
2475
+ });
2476
+
2477
+ // src/cli/runtime/client.ts
2478
+ import * as fs4 from "fs";
2479
+ import * as path4 from "path";
2480
+ function isBuildOutput(relPath) {
2481
+ return BUILD_OUTPUT.test(relPath);
2482
+ }
2483
+ function readWorldFiles(dir, opts = {}) {
2484
+ if (!fs4.existsSync(dir) || !fs4.statSync(dir).isDirectory())
2485
+ throw new CliError(`Not a directory: ${dir}`);
2486
+ const out = [];
2487
+ const walk = (rel) => {
2488
+ const abs = rel ? path4.join(dir, rel) : dir;
2489
+ const entries = fs4.readdirSync(abs, { withFileTypes: true });
2490
+ entries.sort((a, b) => a.name.localeCompare(b.name));
2491
+ for (const entry of entries) {
2492
+ const childRel = rel ? `${rel}/${entry.name}` : entry.name;
2493
+ if (entry.isDirectory()) {
2494
+ if (!SKIP_DIRS2.has(entry.name)) walk(childRel);
2495
+ } else if (entry.isFile()) {
2496
+ if (!opts.buildOutputs && isBuildOutput(childRel)) continue;
2497
+ out.push({
2498
+ path: childRel,
2499
+ content: fs4.readFileSync(path4.join(dir, childRel)).toString("base64")
2500
+ });
2501
+ }
2502
+ }
2503
+ };
2504
+ walk("");
2505
+ return out.sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
2506
+ }
2507
+ function assertSafeRelPath(rel) {
2508
+ const parts = rel.split("/");
2509
+ if (!rel || rel.startsWith("/") || rel.includes("\\") || /^[A-Za-z]:/.test(rel) || parts.some((p) => p === "" || p === "." || p === ".."))
2510
+ throw new CliError(`The runtime returned an unsafe file path: ${rel}`, 1);
2511
+ }
2512
+ function writeWorldFiles(dir, files, opts = {}) {
2513
+ for (const file of files) assertSafeRelPath(file.path);
2514
+ if (opts.clean && fs4.existsSync(dir)) {
2515
+ const keep = new Set(files.map((f) => f.path));
2516
+ for (const existing of readWorldFiles(dir)) {
2517
+ if (!keep.has(existing.path)) fs4.rmSync(path4.join(dir, existing.path));
2518
+ }
2519
+ pruneEmptyDirs(dir);
2520
+ }
2521
+ fs4.mkdirSync(dir, { recursive: true });
2522
+ const written = [];
2523
+ for (const file of files) {
2524
+ const target = path4.join(dir, file.path);
2525
+ fs4.mkdirSync(path4.dirname(target), { recursive: true });
2526
+ fs4.writeFileSync(target, Buffer.from(file.content, "base64"));
2527
+ written.push(file.path);
2528
+ }
2529
+ return written;
2530
+ }
2531
+ function pruneEmptyDirs(root) {
2532
+ const walk = (abs) => {
2533
+ let empty = true;
2534
+ for (const entry of fs4.readdirSync(abs, { withFileTypes: true })) {
2535
+ const child = path4.join(abs, entry.name);
2536
+ if (entry.isDirectory()) {
2537
+ if (SKIP_DIRS2.has(entry.name)) {
2538
+ empty = false;
2539
+ continue;
2540
+ }
2541
+ if (walk(child)) fs4.rmdirSync(child);
2542
+ else empty = false;
2543
+ } else empty = false;
2544
+ }
2545
+ return empty;
2546
+ };
2547
+ walk(root);
2548
+ }
2549
+ function formatBridgeError(detail) {
2550
+ const where = detail.schema_path || detail.path || "/";
2551
+ return `${detail.code} at ${where}: ${detail.message}`;
2552
+ }
2553
+ function detailFrom(payload) {
2554
+ if (!payload || typeof payload !== "object") return null;
2555
+ const error = payload.error;
2556
+ if (!error || typeof error !== "object") return null;
2557
+ const detail = error;
2558
+ if (typeof detail.code !== "string" || typeof detail.message !== "string") return null;
2559
+ return detail;
2560
+ }
2561
+ async function runtime(creds, request, opts = {}) {
2562
+ const local = localRuntime();
2563
+ const yamlSpec = request.command === "conform" && Array.isArray(request.openapi) && request.openapi.some((doc) => /\.ya?ml$/i.test(doc.path ?? ""));
2564
+ if (local && !(yamlSpec && !localPythonHasYaml(local.python))) {
2565
+ const payload = await localBridge(request, local, opts);
2566
+ const detail = detailFrom(payload);
2567
+ if (detail) throw new BridgeRejected(detail);
2568
+ return payload;
2569
+ }
2570
+ if (!creds)
2571
+ throw new CliError(
2572
+ "This needs the schema runtime (the CLI bundles it) or platform credentials (`gateway auth login`). " + localRuntimeReason()
2573
+ );
2574
+ const controller = new AbortController();
2575
+ const timer = setTimeout(() => controller.abort(), opts.timeoutMs ?? 18e4);
2576
+ const route = "/api/public/worlds/runtime";
2577
+ try {
2578
+ const res = await fetch(`${creds.host}${route}`, {
2579
+ method: "POST",
2580
+ headers: {
2581
+ "content-type": "application/json",
2582
+ accept: "application/json",
2583
+ authorization: "Basic " + Buffer.from(`${creds.publicKey}:${creds.secretKey}`).toString("base64")
2584
+ },
2585
+ body: JSON.stringify(request),
2586
+ signal: controller.signal
2587
+ });
2588
+ const text2 = await res.text();
2589
+ let payload = null;
2590
+ try {
2591
+ payload = text2 ? JSON.parse(text2) : {};
2592
+ } catch {
2593
+ payload = null;
2594
+ }
2595
+ const detail = detailFrom(payload);
2596
+ if (detail) throw new BridgeRejected(detail);
2597
+ if (!res.ok)
2598
+ throw new CliError(`POST ${route} (${request.command}) -> ${res.status}: ${text2.slice(0, 600)}`, 1);
2599
+ if (payload === null) throw new CliError(`POST ${route} (${request.command}) returned non-JSON`, 1);
2600
+ return payload;
2601
+ } finally {
2602
+ clearTimeout(timer);
2603
+ }
2604
+ }
2605
+ var SKIP_DIRS2, BUILD_OUTPUT, BridgeRejected;
2606
+ var init_client = __esm({
2607
+ "src/cli/runtime/client.ts"() {
2608
+ "use strict";
2609
+ init_router();
2610
+ init_local();
2611
+ SKIP_DIRS2 = /* @__PURE__ */ new Set(["__pycache__", ".git", "node_modules", ".gateway"]);
2612
+ BUILD_OUTPUT = /(^|\/)state\.(sqlite|json)$/;
2613
+ BridgeRejected = class extends CliError {
2614
+ constructor(detail) {
2615
+ super(formatBridgeError(detail), 1);
2616
+ this.detail = detail;
2617
+ }
2618
+ };
2619
+ }
2620
+ });
2621
+
2622
+ // src/cli/runtime/data.ts
2623
+ var data_exports = {};
2624
+ __export(data_exports, {
2625
+ checkLocalWorldData: () => checkLocalWorldData,
2626
+ dropBuildOutputs: () => dropBuildOutputs,
2627
+ importLocalWorldData: () => importLocalWorldData,
2628
+ ingestLocalToolCalls: () => ingestLocalToolCalls,
2629
+ queryLocalWorldData: () => queryLocalWorldData,
2630
+ queryLocalWorldDataAcross: () => queryLocalWorldDataAcross,
2631
+ showLocalWorldData: () => showLocalWorldData
2632
+ });
2633
+ import * as fs5 from "fs";
2634
+ import * as path5 from "path";
2635
+ async function importLocalWorldData(dir, rows, opts, creds) {
2636
+ const res = await runtime(creds, {
2637
+ command: "import-data",
2638
+ files: readWorldFiles(dir),
2639
+ rows,
2640
+ mode: opts.mode ?? "append",
2641
+ ...opts.redact && opts.redact !== "off" ? { redact: opts.redact } : {}
2642
+ });
2643
+ if (res.files?.length) writeWorldFiles(dir, res.files);
2644
+ if (res.changed) dropBuildOutputs(dir);
2645
+ return {
2646
+ kind: res.kind ?? "unknown",
2647
+ entity_counts: res.entity_counts ?? {},
2648
+ changed: Boolean(res.changed)
2649
+ };
2650
+ }
2651
+ function dropBuildOutputs(dir) {
2652
+ const dropped = [];
2653
+ for (const file of readWorldFiles(dir, { buildOutputs: true })) {
2654
+ if (!BUILD_OUTPUT2.test(file.path)) continue;
2655
+ fs5.rmSync(path5.join(dir, file.path), { force: true });
2656
+ dropped.push(file.path);
2657
+ }
2658
+ return dropped;
2659
+ }
2660
+ async function checkLocalWorldData(dir, rows, creds, opts = {}) {
2661
+ const res = await runtime(creds, {
2662
+ command: "import-data",
2663
+ files: readWorldFiles(dir),
2664
+ rows,
2665
+ mode: "append",
2666
+ ...opts.redact && opts.redact !== "off" ? { redact: opts.redact } : {}
2667
+ });
2668
+ return {
2669
+ kind: res.kind ?? "unknown",
2670
+ entity_counts: res.entity_counts ?? {},
2671
+ changed: Boolean(res.changed)
2672
+ };
2673
+ }
2674
+ async function showLocalWorldData(dir, entity, creds) {
2675
+ const res = await runtime(creds, {
2676
+ command: "counts",
2677
+ files: readWorldFiles(dir),
2678
+ ...entity ? { entity } : {}
2679
+ });
2680
+ const out = { kind: res.kind ?? "unknown" };
2681
+ if (entity) {
2682
+ out.entity = entity;
2683
+ out.rows = res.rows ?? [];
2684
+ } else out.entity_counts = res.entity_counts ?? {};
2685
+ return out;
2686
+ }
2687
+ async function queryLocalWorldData(dir, entity, where, opts, creds) {
2688
+ const res = await runtime(creds, {
2689
+ command: "query",
2690
+ files: readWorldFiles(dir),
2691
+ entity,
2692
+ ...Object.keys(where).length ? { where } : {},
2693
+ ...opts.limit !== void 0 ? { limit: opts.limit } : {},
2694
+ ...opts.offset !== void 0 ? { offset: opts.offset } : {},
2695
+ ...opts.resolve ? { resolve: true } : {},
2696
+ ...opts.scenario ? { scenario: opts.scenario } : {}
2697
+ });
2698
+ const rows = res.rows ?? [];
2699
+ return {
2700
+ ...res.kind ? { kind: res.kind } : {},
2701
+ entity: res.entity ?? entity,
2702
+ ...res.scenario ? { scenario: res.scenario } : {},
2703
+ rows,
2704
+ count: res.count ?? rows.length,
2705
+ total: res.total ?? null,
2706
+ limit: res.limit ?? opts.limit ?? rows.length,
2707
+ offset: res.offset ?? opts.offset ?? 0,
2708
+ ...res.resolved ? { resolved: res.resolved } : {}
2709
+ };
2710
+ }
2711
+ async function queryLocalWorldDataAcross(dir, entity, where, opts) {
2712
+ const local = localRuntime();
2713
+ if (!local)
2714
+ throw new CliError(
2715
+ "`--across` on a directory reads the linked worlds at their paths, so it needs the bundled runtime on this machine. " + localRuntimeReason(),
2716
+ 1
2717
+ );
2718
+ const payload = await localBridge(
2719
+ {
2720
+ command: "query",
2721
+ world: path5.resolve(dir),
2722
+ entity,
2723
+ across: true,
2724
+ ...opts.compare ? { compare: true } : {},
2725
+ ...Object.keys(where).length ? { where } : {},
2726
+ ...opts.limit !== void 0 ? { limit: opts.limit } : {},
2727
+ ...opts.offset !== void 0 ? { offset: opts.offset } : {},
2728
+ ...opts.resolve ? { resolve: true } : {},
2729
+ ...opts.scenario ? { scenario: opts.scenario } : {}
2730
+ },
2731
+ local
2732
+ );
2733
+ const detail = detailFrom(payload);
2734
+ if (detail) throw new BridgeRejected(detail);
2735
+ return payload;
2736
+ }
2737
+ async function ingestLocalToolCalls(dir, records, opts, creds) {
2738
+ const res = await runtime(creds, {
2739
+ command: "ingest-calls",
2740
+ files: readWorldFiles(dir),
2741
+ records,
2742
+ mode: opts.mode ?? "append",
2743
+ ...opts.dryRun ? { dry_run: true } : {},
2744
+ ...opts.redact && opts.redact !== "off" ? { redact: opts.redact } : {},
2745
+ ...opts.map !== void 0 ? { map: opts.map } : {}
2746
+ });
2747
+ if (!opts.dryRun && res.files?.length) writeWorldFiles(dir, res.files);
2748
+ if (res.changed) dropBuildOutputs(dir);
2749
+ return {
2750
+ ...res.via ? { via: res.via } : {},
2751
+ ...res.sources ? { sources: res.sources } : {},
2752
+ ...res.unmatched ? { unmatched: res.unmatched } : {},
2753
+ ...res.note ? { note: res.note } : {},
2754
+ records: res.records ?? records.length,
2755
+ ingested: res.ingested ?? 0,
2756
+ skipped: res.skipped ?? {},
2757
+ refusals: res.refusals ?? [],
2758
+ rows: res.rows ?? {},
2759
+ ...res.projected ? { projected: res.projected } : {},
2760
+ dry_run: Boolean(res.dry_run ?? opts.dryRun),
2761
+ redact: res.redact ?? opts.redact ?? "off",
2762
+ changed: Boolean(res.changed),
2763
+ ...res.kind ? { kind: res.kind } : {},
2764
+ ...res.entity_counts ? { entity_counts: res.entity_counts } : {},
2765
+ ...res.batch !== void 0 ? { batch: res.batch } : {}
2766
+ };
2767
+ }
2768
+ var BUILD_OUTPUT2;
2769
+ var init_data = __esm({
2770
+ "src/cli/runtime/data.ts"() {
2771
+ "use strict";
2772
+ init_router();
2773
+ init_client();
2774
+ init_local();
2775
+ BUILD_OUTPUT2 = /(^|\/)state\.(sqlite|json)$/;
2776
+ }
2777
+ });
2778
+
2779
+ // src/cli/platform/worldData/transform.ts
2780
+ var transform_exports = {};
2781
+ __export(transform_exports, {
2782
+ DEFAULT_TRANSFORM_TIMEOUT_MS: () => DEFAULT_TRANSFORM_TIMEOUT_MS,
2783
+ NODE_SUFFIXES: () => NODE_SUFFIXES,
2784
+ NODE_WRAPPER: () => NODE_WRAPPER,
2785
+ PYTHON_SUFFIXES: () => PYTHON_SUFFIXES,
2786
+ PY_WRAPPER: () => PY_WRAPPER,
2787
+ checkRows: () => checkRows,
2788
+ runTransform: () => runTransform,
2789
+ transformRecords: () => transformRecords
2790
+ });
2791
+ import { spawn as spawn2 } from "child_process";
2792
+ import * as fs6 from "fs";
2793
+ import * as os2 from "os";
2794
+ import * as path6 from "path";
2795
+ import { createRequire } from "module";
2796
+ function checkRows(value, where) {
2797
+ if (!isObject(value)) throw new CliError(`${where} must return {entity: [rows]}; got ${value === null ? "null" : Array.isArray(value) ? "an array" : typeof value}`, 1);
2798
+ for (const [entity, listed] of Object.entries(value)) {
2799
+ if (!Array.isArray(listed)) throw new CliError(`${where}: ${entity} must be a list of rows; got ${listed === null ? "null" : typeof listed}`, 1);
2800
+ listed.forEach((row, index) => {
2801
+ if (!isObject(row)) throw new CliError(`${where}: ${entity}[${index}] is not an object`, 1);
2802
+ });
2803
+ }
2804
+ return value;
2805
+ }
2806
+ function typescriptPrefix() {
2807
+ const [major, minor] = process.versions.node.split(".").map(Number);
2808
+ if (!process.env.GATEWAY_NODE && (major > 22 || major === 22 && minor >= 6)) return ["--experimental-strip-types", "--no-warnings"];
2809
+ try {
2810
+ return [createRequire(import.meta.url).resolve("tsx/cli")];
2811
+ } catch {
2812
+ throw new CliError(
2813
+ `a .ts transform needs Node 22.6 or newer (built-in type stripping; this is ${process.versions.node}) or the tsx package installed beside the CLI; write the transform as .mjs or .py, or set GATEWAY_NODE to a newer node`,
2814
+ 1
2815
+ );
2816
+ }
2817
+ }
2818
+ function command(script, wrapperDir) {
2819
+ const suffix = path6.extname(script).toLowerCase();
2820
+ if (PYTHON_SUFFIXES.includes(suffix)) return { file: process.env.GATEWAY_PYTHON || "python3", args: ["-c", PY_WRAPPER, script] };
2821
+ if (NODE_SUFFIXES.includes(suffix)) {
2822
+ const wrapper = path6.join(wrapperDir, "transform-wrapper.mjs");
2823
+ fs6.writeFileSync(wrapper, NODE_WRAPPER);
2824
+ const flags = suffix === ".ts" || suffix === ".mts" ? typescriptPrefix() : [];
2825
+ return { file: process.env.GATEWAY_NODE || process.execPath, args: [...flags, wrapper, script] };
2826
+ }
2827
+ throw new CliError(`${path6.basename(script)}: a transform script is .py, .ts, .mjs, .js or .cjs`, 1);
2828
+ }
2829
+ async function runTransform(script, records, opts = {}) {
2830
+ if (!fs6.existsSync(script) || !fs6.statSync(script).isFile()) throw new CliError(`no transform script at ${script}`, 1);
2831
+ const resolved = path6.resolve(script);
2832
+ const name = path6.basename(script);
2833
+ const timeoutMs = opts.timeoutMs ?? DEFAULT_TRANSFORM_TIMEOUT_MS;
2834
+ const scratch = fs6.mkdtempSync(path6.join(os2.tmpdir(), "gateway-transform-"));
2835
+ try {
2836
+ const { file, args } = command(resolved, scratch);
2837
+ const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => !SCRUBBED.test(key)));
2838
+ const done = await new Promise((resolve7, reject) => {
2839
+ const child = spawn2(file, args, { cwd: path6.dirname(resolved), env, stdio: ["pipe", "pipe", "pipe"] });
2840
+ let stdout = "";
2841
+ let stderr = "";
2842
+ let timedOut = false;
2843
+ const timer = setTimeout(() => {
2844
+ timedOut = true;
2845
+ child.kill("SIGKILL");
2846
+ }, timeoutMs);
2847
+ child.stdout.setEncoding("utf8").on("data", (chunk) => stdout += chunk);
2848
+ child.stderr.setEncoding("utf8").on("data", (chunk) => stderr += chunk);
2849
+ child.on("error", (error) => {
2850
+ clearTimeout(timer);
2851
+ reject(new CliError(`${name}: cannot run ${file}: ${error.message}`, 1));
2852
+ });
2853
+ child.on("close", (code) => {
2854
+ clearTimeout(timer);
2855
+ resolve7({ code, stdout, stderr, timedOut });
2856
+ });
2857
+ child.stdin.on("error", () => void 0);
2858
+ child.stdin.end(records.map((record) => JSON.stringify(record) + "\n").join(""));
2859
+ });
2860
+ if (done.timedOut) throw new CliError(`${name} timed out after ${timeoutMs / 1e3}s${tail(done.stderr)}`, 1);
2861
+ if (done.code !== 0) throw new CliError(`${name} exited ${done.code ?? "?"}${tail(done.stderr)}`, 1);
2862
+ let value;
2863
+ try {
2864
+ value = done.stdout.trim() ? JSON.parse(done.stdout) : null;
2865
+ } catch {
2866
+ throw new CliError(`${name} printed something other than the rows document${tail(done.stderr)}`, 1);
2867
+ }
2868
+ return { rows: checkRows(value, name), stderr: done.stderr };
2869
+ } finally {
2870
+ fs6.rmSync(scratch, { recursive: true, force: true });
2871
+ }
2872
+ }
2873
+ async function transformRecords(transform, records, opts = {}) {
2874
+ if (typeof transform === "function") return { rows: checkRows(await transform(records), "transform(records)"), stderr: "" };
2875
+ return runTransform(transform, records, opts);
2876
+ }
2877
+ var DEFAULT_TRANSFORM_TIMEOUT_MS, NODE_SUFFIXES, PYTHON_SUFFIXES, SCRUBBED, PY_WRAPPER, NODE_WRAPPER, isObject, tail;
2878
+ var init_transform = __esm({
2879
+ "src/cli/platform/worldData/transform.ts"() {
2880
+ "use strict";
2881
+ init_router();
2882
+ DEFAULT_TRANSFORM_TIMEOUT_MS = 12e4;
2883
+ NODE_SUFFIXES = [".ts", ".mts", ".mjs", ".js", ".cjs"];
2884
+ PYTHON_SUFFIXES = [".py"];
2885
+ SCRUBBED = /^(GATEWAY_|HTTPS?_PROXY$|ALL_PROXY$|https?_proxy$|all_proxy$)/;
2886
+ PY_WRAPPER = `
2887
+ import io, json, runpy, socket, sys
2888
+
2889
+ def _deny(*args, **kwargs):
2890
+ raise RuntimeError("network is disabled in a transform")
2891
+
2892
+ class _Denied(socket.socket):
2893
+ def __init__(self, *args, **kwargs):
2894
+ _deny()
2895
+
2896
+ socket.socket = _Denied
2897
+ socket.SocketType = _Denied
2898
+ socket.create_connection = _deny
2899
+ socket.getaddrinfo = _deny
2900
+
2901
+ text = sys.stdin.read()
2902
+ records = [json.loads(line) for line in text.splitlines() if line.strip()]
2903
+ sys.stdin = io.StringIO(text)
2904
+ captured = io.StringIO()
2905
+ real = sys.stdout
2906
+ sys.stdout = captured
2907
+ try:
2908
+ namespace = runpy.run_path(sys.argv[1], run_name="__main__")
2909
+ finally:
2910
+ sys.stdout = real
2911
+ fn = namespace.get("transform")
2912
+ if callable(fn):
2913
+ out = fn(records)
2914
+ else:
2915
+ printed = captured.getvalue().strip()
2916
+ if not printed:
2917
+ sys.stderr.write("the transform defines no transform(records) and printed nothing\\n")
2918
+ sys.exit(3)
2919
+ out = json.loads(printed)
2920
+ real.write(json.dumps(out))
2921
+ `;
2922
+ NODE_WRAPPER = `
2923
+ import { pathToFileURL } from "node:url";
2924
+ import net from "node:net";
2925
+ import tls from "node:tls";
2926
+ import http from "node:http";
2927
+ import https from "node:https";
2928
+ import dgram from "node:dgram";
2929
+
2930
+ const deny = () => { throw new Error("network is disabled in a transform"); };
2931
+ net.Socket.prototype.connect = deny;
2932
+ net.connect = deny;
2933
+ net.createConnection = deny;
2934
+ tls.connect = deny;
2935
+ http.request = deny;
2936
+ http.get = deny;
2937
+ https.request = deny;
2938
+ https.get = deny;
2939
+ dgram.createSocket = deny;
2940
+ globalThis.fetch = deny;
2941
+
2942
+ const module = await import(pathToFileURL(process.argv[2]).href);
2943
+ const fn = typeof module.transform === "function" ? module.transform : typeof module.default === "function" ? module.default : null;
2944
+ if (fn) {
2945
+ const chunks = [];
2946
+ for await (const chunk of process.stdin) chunks.push(chunk);
2947
+ const text = Buffer.concat(chunks).toString("utf8");
2948
+ const records = text.split("\\n").filter((line) => line.trim()).map((line) => JSON.parse(line));
2949
+ const out = await fn(records);
2950
+ process.stdout.write(JSON.stringify(out));
2951
+ }
2952
+ `;
2953
+ isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
2954
+ tail = (stderr, lines = 12) => {
2955
+ const kept = stderr.split("\n").filter((line) => line.trim()).slice(-lines);
2956
+ return kept.length ? "\n" + kept.join("\n") : "";
2957
+ };
2958
+ }
2959
+ });
2960
+
2961
+ // src/cli/platform/worldData/batches.ts
2962
+ import { createHash as createHash5 } from "crypto";
2963
+ import * as fs7 from "fs";
2964
+ function uploadHeadersFor(gz) {
2965
+ return {
2966
+ "content-type": "application/gzip",
2967
+ "content-length": String(gz.length),
2968
+ "x-amz-checksum-sha256": createHash5("sha256").update(gz).digest("base64")
2969
+ };
2970
+ }
2971
+ async function forEachLimited(items, limit, fn) {
2972
+ const inFlight = /* @__PURE__ */ new Set();
2973
+ let failure = null;
2974
+ const track = (p) => {
2975
+ const wrapped = p.then(
2976
+ () => {
2977
+ inFlight.delete(wrapped);
2978
+ },
2979
+ (error) => {
2980
+ failure ??= error;
2981
+ inFlight.delete(wrapped);
2982
+ }
2983
+ );
2984
+ inFlight.add(wrapped);
2985
+ };
2986
+ for await (const item of items) {
2987
+ if (failure) break;
2988
+ track(fn(item));
2989
+ if (inFlight.size >= limit) await Promise.race(inFlight);
2990
+ }
2991
+ await Promise.all(inFlight);
2992
+ if (failure) throw failure;
2993
+ }
2994
+ async function waitForBatch(client2, batchId, opts = {}) {
2995
+ const sleep3 = opts.sleep ?? client2.sleep;
2996
+ let delay = opts.initialDelayMs ?? 1e3;
2997
+ let last = "";
2998
+ for (; ; ) {
2999
+ const status = await client2.get(batchId);
3000
+ const phase = phaseLine(status);
3001
+ if (phase !== last) {
3002
+ opts.onPhase?.(phase);
3003
+ last = phase;
3004
+ }
3005
+ if (TERMINAL_STATES.has(status.state)) return status;
3006
+ await sleep3(delay);
3007
+ delay = Math.min(1e4, Math.round(delay * 1.5));
3008
+ }
739
3009
  }
740
- async function validateWorld(dir, opts) {
741
- const options = opts.options ?? {};
742
- const progress = opts.onProgress ?? (() => {
3010
+ function phaseLine(status) {
3011
+ const phase = status.progress?.phase;
3012
+ return phase ? `${status.state} (${phase})` : status.state;
3013
+ }
3014
+ var TERMINAL_STATES, sleepMs, WorldDataApi;
3015
+ var init_batches = __esm({
3016
+ "src/cli/platform/worldData/batches.ts"() {
3017
+ "use strict";
3018
+ init_config();
3019
+ init_router();
3020
+ TERMINAL_STATES = /* @__PURE__ */ new Set(["applied", "refused", "published", "failed"]);
3021
+ sleepMs = (ms) => new Promise((resolve7) => setTimeout(resolve7, ms));
3022
+ WorldDataApi = class {
3023
+ constructor(creds, slug, sleep3 = sleepMs) {
3024
+ this.creds = creds;
3025
+ this.slug = slug;
3026
+ this.sleep = sleep3;
3027
+ this.base = `/api/public/worlds/${encodeURIComponent(slug)}/data`;
3028
+ }
3029
+ base;
3030
+ open(body) {
3031
+ return api(this.creds, "POST", `${this.base}/batches`, body);
3032
+ }
3033
+ register(batchId, chunk) {
3034
+ return api(this.creds, "POST", `${this.base}/batches/${batchId}/chunks`, {
3035
+ ordinal: chunk.ordinal,
3036
+ digest: chunk.digest,
3037
+ bytes: chunk.bytes,
3038
+ rows: chunk.rows,
3039
+ ...chunk.entity ? { entity: chunk.entity } : {}
3040
+ });
3041
+ }
3042
+ markUploaded(batchId, chunkId) {
3043
+ return api(this.creds, "POST", `${this.base}/batches/${batchId}/chunks/${chunkId}/uploaded`);
3044
+ }
3045
+ complete(batchId) {
3046
+ return api(this.creds, "POST", `${this.base}/batches/${batchId}/complete`);
3047
+ }
3048
+ get(batchId) {
3049
+ return api(this.creds, "GET", `${this.base}/batches/${batchId}`);
3050
+ }
3051
+ list(limit, cursor) {
3052
+ const params = new URLSearchParams();
3053
+ if (limit !== void 0) params.set("limit", String(limit));
3054
+ if (cursor) params.set("cursor", cursor);
3055
+ const q = params.toString();
3056
+ return api(this.creds, "GET", `${this.base}/batches${q ? `?${q}` : ""}`);
3057
+ }
3058
+ publish(message) {
3059
+ return api(this.creds, "POST", `${this.base}/publish`, message ? { message } : {});
3060
+ }
3061
+ /**
3062
+ * PUT the gzipped chunk to its presigned URL with exactly the headers the
3063
+ * URL was signed for (the platform's `uploadHeaders`; the same three when it
3064
+ * sends none), with backoff on a dropped connection or a 5xx.
3065
+ */
3066
+ async put(uploadUrl, gz, signed) {
3067
+ const headers = signed ?? uploadHeadersFor(gz);
3068
+ const delays = [500, 1500, 4e3];
3069
+ for (let attempt = 0; ; attempt++) {
3070
+ try {
3071
+ const res = await fetch(uploadUrl, { method: "PUT", body: new Uint8Array(gz), headers });
3072
+ if (res.ok) return;
3073
+ if (res.status < 500 || attempt >= delays.length) throw new CliError(`chunk upload -> ${res.status}: ${(await res.text()).slice(0, 300)}`, 1);
3074
+ } catch (error) {
3075
+ if (error instanceof CliError || attempt >= delays.length) throw error instanceof CliError ? error : new CliError(`chunk upload failed: ${error.message}`, 1);
3076
+ }
3077
+ await this.sleep(delays[attempt]);
3078
+ }
3079
+ }
3080
+ /** Register, upload unless the server already holds the content, confirm. */
3081
+ async upload(batchId, chunk) {
3082
+ const registered = await this.register(batchId, chunk);
3083
+ if (!registered.uploaded) {
3084
+ if (!registered.uploadUrl) throw new CliError(`the server registered chunk ${chunk.ordinal} without an upload URL`, 1);
3085
+ await this.put(registered.uploadUrl, chunk.gz, registered.uploadHeaders);
3086
+ await this.markUploaded(batchId, registered.chunkId);
3087
+ }
3088
+ return { ordinal: chunk.ordinal, digest: chunk.digest, bytes: chunk.bytes, rows: chunk.rows, entity: chunk.entity, chunkId: registered.chunkId, uploaded: true };
3089
+ }
3090
+ };
3091
+ }
3092
+ });
3093
+
3094
+ // src/cli/platform/worldData/chunker.ts
3095
+ import { createHash as createHash6 } from "crypto";
3096
+ import { deflateRawSync } from "zlib";
3097
+ function chunkLine(row, declared) {
3098
+ if (declared !== null) return dumps(row.row) + "\n";
3099
+ const tagged = /* @__PURE__ */ new Map();
3100
+ tagged.set("entity", row.entity);
3101
+ tagged.set("row", row.row);
3102
+ return dumps(tagged) + "\n";
3103
+ }
3104
+ async function* buildChunks(rows, plan) {
3105
+ let lines = [];
3106
+ let rawBytes = 0;
3107
+ let ordinal = 0;
3108
+ let seen = 0;
3109
+ const flush2 = () => {
3110
+ const raw = Buffer.concat(lines);
3111
+ const built = finishChunk(ordinal++, raw, lines.length, plan.entity, seen - lines.length);
3112
+ lines = [];
3113
+ rawBytes = 0;
3114
+ return built;
3115
+ };
3116
+ for await (const row of rows) {
3117
+ const line = Buffer.from(chunkLine(row, plan.entity), "utf8");
3118
+ const full = lines.length > 0 && (plan.chunkRows !== null && lines.length >= plan.chunkRows || rawBytes + line.length > plan.chunkBytes);
3119
+ if (full) yield flush2();
3120
+ lines.push(line);
3121
+ rawBytes += line.length;
3122
+ seen++;
3123
+ }
3124
+ if (lines.length) yield flush2();
3125
+ }
3126
+ function finishChunk(ordinal, raw, rows, entity, firstRow = 0) {
3127
+ const gz = gzipDeterministic(raw, { name: chunkName(ordinal) });
3128
+ return {
3129
+ ordinal,
3130
+ digest: createHash6("sha256").update(gz).digest("hex"),
3131
+ bytes: gz.length,
3132
+ rows,
3133
+ entity,
3134
+ rawBytes: raw.length,
3135
+ contentSha256: createHash6("sha256").update(raw).digest("hex"),
3136
+ firstRow,
3137
+ gz
3138
+ };
3139
+ }
3140
+ function gzipDeterministic(raw, opts = {}) {
3141
+ const level = opts.level ?? GZIP_LEVEL;
3142
+ const name = opts.name ? Buffer.concat([Buffer.from(opts.name, "latin1"), Buffer.from([0])]) : Buffer.alloc(0);
3143
+ const header = Buffer.from([31, 139, 8, opts.name ? 8 : 0, 0, 0, 0, 0, level === 9 ? 2 : level === 1 ? 4 : 0, 255]);
3144
+ const body = deflateRawSync(raw, { level });
3145
+ const trailer = Buffer.alloc(8);
3146
+ trailer.writeUInt32LE(crc32(raw), 0);
3147
+ trailer.writeUInt32LE(raw.length >>> 0, 4);
3148
+ return Buffer.concat([header, name, body, trailer]);
3149
+ }
3150
+ function crc32(data) {
3151
+ if (!table) {
3152
+ table = new Uint32Array(256);
3153
+ for (let n = 0; n < 256; n++) {
3154
+ let c = n;
3155
+ for (let k = 0; k < 8; k++) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
3156
+ table[n] = c >>> 0;
3157
+ }
3158
+ }
3159
+ let crc = 4294967295;
3160
+ for (let i = 0; i < data.length; i++) crc = table[(crc ^ data[i]) & 255] ^ crc >>> 8;
3161
+ return (crc ^ 4294967295) >>> 0;
3162
+ }
3163
+ var DEFAULT_CHUNK_BYTES, GZIP_LEVEL, chunkName, table;
3164
+ var init_chunker = __esm({
3165
+ "src/cli/platform/worldData/chunker.ts"() {
3166
+ "use strict";
3167
+ init_json();
3168
+ DEFAULT_CHUNK_BYTES = 64 * 1024 * 1024;
3169
+ GZIP_LEVEL = 9;
3170
+ chunkName = (ordinal) => `chunk-${String(ordinal).padStart(5, "0")}.jsonl`;
3171
+ table = null;
3172
+ }
3173
+ });
3174
+
3175
+ // src/cli/platform/worldData/push.ts
3176
+ var push_exports = {};
3177
+ __export(push_exports, {
3178
+ pushRows: () => pushRows
3179
+ });
3180
+ async function pushRows(creds, slug, rows, opts = {}) {
3181
+ const client2 = opts.sleep ? new WorldDataApi(creds, slug, opts.sleep) : new WorldDataApi(creds, slug);
3182
+ const opened = await client2.open({
3183
+ mode: opts.mode ?? "append",
3184
+ merge: "upsert",
3185
+ ...opts.redact && opts.redact !== "off" ? { redact: opts.redact } : {},
3186
+ atomic: true,
3187
+ dryRun: Boolean(opts.dryRun),
3188
+ publish: opts.publish ?? "now",
3189
+ ...opts.message ? { message: opts.message } : {}
743
3190
  });
744
- const minScore = opts.minScore ?? null;
745
- const provenance = detectProvenance();
746
- const branch = opts.branch ?? provenance.branch;
747
- if (!branch)
748
- throw new Error(
749
- "No branch to validate on: pass --branch or run inside a git checkout / GitHub Actions."
750
- );
751
- progress(`pushing ${dir} as ${opts.slug ?? "(pyproject name)"}@${branch}\u2026`);
752
- let tipVersionId = null;
753
- if (opts.slug) {
3191
+ if (!opened.batchId) throw new Error("the platform opened no batch (no batchId in the answer)");
3192
+ const tagged = (async function* () {
3193
+ for (const [entity, listed] of Object.entries(rows))
3194
+ for (let index = 0; index < listed.length; index++)
3195
+ yield { entity, row: parseJson(JSON.stringify(listed[index])), where: `${entity}[${index}]` };
3196
+ })();
3197
+ const chunks = buildChunks(tagged, { chunkBytes: opts.chunkBytes ?? DEFAULT_CHUNK_BYTES, chunkRows: null, entity: null });
3198
+ await forEachLimited(chunks, Math.max(1, opts.parallel ?? 4), async (chunk) => {
3199
+ await client2.upload(opened.batchId, chunk);
3200
+ });
3201
+ await client2.complete(opened.batchId);
3202
+ return waitForBatch(client2, opened.batchId, { initialDelayMs: pollMs() });
3203
+ }
3204
+ function pollMs() {
3205
+ const raw = Number(process.env.GATEWAY_WORLD_DATA_POLL_MS ?? 1e3);
3206
+ return Number.isFinite(raw) && raw >= 0 ? raw : 1e3;
3207
+ }
3208
+ var init_push = __esm({
3209
+ "src/cli/platform/worldData/push.ts"() {
3210
+ "use strict";
3211
+ init_batches();
3212
+ init_chunker();
3213
+ init_json();
3214
+ }
3215
+ });
3216
+
3217
+ // src/worlds/ingest.ts
3218
+ import * as fs8 from "fs";
3219
+ import * as os3 from "os";
3220
+ import * as path7 from "path";
3221
+ function parseToolCallRecord(raw) {
3222
+ const none = { record: null, skip: null };
3223
+ if (!isObject2(raw)) return { ...none, refusal: "record is not an object" };
3224
+ const kind = raw.kind;
3225
+ if (kind !== void 0 && kind !== null && kind !== "call") return { record: null, skip: `kind ${String(kind)}`, refusal: null };
3226
+ const tool = raw.tool;
3227
+ if (typeof tool !== "string" || !tool) return { ...none, refusal: "record has no tool name" };
3228
+ if (raw.error !== void 0 && raw.error !== null && raw.error !== "") return { record: null, skip: "call failed", refusal: null };
3229
+ const args = raw.args ?? {};
3230
+ if (!isObject2(args)) return { ...none, refusal: `args of ${tool} is not an object` };
3231
+ if (!("result" in raw)) return { ...none, refusal: `record of ${tool} has no result` };
3232
+ const at = raw.at ?? raw.completedAt;
3233
+ const record = { tool, args, result: raw.result };
3234
+ if (typeof at === "string") record.at = at;
3235
+ if (typeof raw.session === "string") record.session = raw.session;
3236
+ if (typeof raw.source === "string") record.source = raw.source;
3237
+ return { record, skip: null, refusal: null };
3238
+ }
3239
+ function readToolCallRecords(paths) {
3240
+ const records = [];
3241
+ for (const file of paths) records.push(...toolCallRecordsIn(fs8.readFileSync(file, "utf8"), file));
3242
+ return records;
3243
+ }
3244
+ function toolCallRecordsIn(text2, where) {
3245
+ const stripped = text2.trim();
3246
+ if (!stripped) return [];
3247
+ if (stripped.startsWith("[")) {
3248
+ const listed = JSON.parse(stripped);
3249
+ if (!Array.isArray(listed)) throw new Error(`${where} is neither a JSON array nor JSON Lines`);
3250
+ listed.forEach((item, index) => {
3251
+ if (!isObject2(item)) throw new Error(`${where}[${index}] is not an object`);
3252
+ });
3253
+ return listed;
3254
+ }
3255
+ const records = [];
3256
+ const lines = text2.split(/\r?\n/);
3257
+ for (let index = 0; index < lines.length; index++) {
3258
+ const line = lines[index];
3259
+ if (!line.trim()) continue;
3260
+ let item;
754
3261
  try {
755
- const tip = await apiRequest(
756
- options,
757
- "POST",
758
- "/api/public/benchmark-containers/resolve-version",
759
- { slug: opts.slug, ref: branch }
760
- );
761
- tipVersionId = tip.versionId ?? null;
3262
+ item = JSON.parse(line);
762
3263
  } catch {
763
- tipVersionId = null;
3264
+ throw new Error(`${where}:${index + 1} is not JSON`);
764
3265
  }
3266
+ if (!isObject2(item)) throw new Error(`${where}:${index + 1} is not an object`);
3267
+ records.push(item);
765
3268
  }
766
- const pushed = await push(dir, {
767
- slug: opts.slug,
768
- branch,
769
- baseVersionId: tipVersionId,
770
- message: `PR validation push (${provenance.commit?.slice(0, 12) ?? "local"})`,
771
- ...provenance.actor?.name ? { author: provenance.actor.name } : {},
772
- options
773
- });
774
- progress(`pushed version ${pushed.versionId} (${pushed.contentHash.slice(0, 12)})`);
775
- const configs = await listRunConfigs(options);
776
- const runConfig = configs.find((c) => c.id === opts.runConfig) ?? configs.find((c) => c.name === opts.runConfig);
777
- if (!runConfig) {
778
- const known = configs.map((c) => c.name).join(", ") || "(none)";
779
- throw new Error(
780
- `Run config "${opts.runConfig}" not found in this project. Have: ${known}`
781
- );
3269
+ return records;
3270
+ }
3271
+ async function emit(sink, record) {
3272
+ if (Array.isArray(sink)) {
3273
+ sink.push(record);
3274
+ return;
782
3275
  }
783
- progress(`dispatching run config "${runConfig.name}" (${runConfig.models.join(", ")})\u2026`);
784
- const dispatched = await apiRequest(options, "POST", "/api/public/benchmark-containers/run-configs/dispatch", {
785
- runConfigId: runConfig.id,
786
- versionId: pushed.versionId,
787
- ...provenance
788
- });
789
- const host = (options.host ?? process.env.GATEWAY_HOST ?? "https://withgateway.ai").replace(/\/+$/, "");
790
- let projectId = null;
3276
+ if (typeof sink === "string") {
3277
+ fs8.appendFileSync(sink, JSON.stringify(record) + "\n");
3278
+ return;
3279
+ }
3280
+ if (typeof sink === "function") {
3281
+ await sink(record);
3282
+ return;
3283
+ }
3284
+ throw new TypeError("sink must be an array, a file path, or a function");
3285
+ }
3286
+ function captureToolCalls(tools, sink, opts = {}) {
3287
+ const wrapped = /* @__PURE__ */ Object.create(null);
3288
+ for (const [name, fn] of Object.entries(tools)) {
3289
+ wrapped[name] = async (args = {}) => {
3290
+ const record = { tool: name, args, at: (/* @__PURE__ */ new Date()).toISOString() };
3291
+ if (opts.session) record.session = opts.session;
3292
+ if (opts.source) record.source = opts.source;
3293
+ let result;
3294
+ try {
3295
+ result = await fn(args);
3296
+ } catch (error) {
3297
+ record.error = error instanceof Error ? error.message || error.name : String(error);
3298
+ await emit(sink, record);
3299
+ throw error;
3300
+ }
3301
+ record.result = result;
3302
+ await emit(sink, record);
3303
+ return result;
3304
+ };
3305
+ }
3306
+ return wrapped;
3307
+ }
3308
+ function jsonish(value) {
3309
+ if (typeof value !== "string") return value;
791
3310
  try {
792
- const projects = await apiRequest(
793
- options,
794
- "GET",
795
- "/api/public/projects"
796
- );
797
- projectId = projects.data?.[0]?.id ?? null;
3311
+ return JSON.parse(value);
798
3312
  } catch {
799
- projectId = null;
3313
+ return value;
800
3314
  }
801
- const fallbackUrl = (report) => {
802
- if (report.url) return report.url;
803
- const evaluationId = report.evaluations[0]?.id;
804
- return projectId && evaluationId ? `${host}/project/${projectId}/environment/runs/${encodeURIComponent(evaluationId)}` : null;
3315
+ }
3316
+ function toolCallsFromObservations(observations, opts = {}) {
3317
+ const known = opts.tools ? new Set(opts.tools) : null;
3318
+ const sinceMs = opts.since ? Date.parse(opts.since) : NaN;
3319
+ const out = { records: [], unknownTools: {}, skipped: {} };
3320
+ const skip = (reason) => {
3321
+ out.skipped[reason] = (out.skipped[reason] ?? 0) + 1;
805
3322
  };
806
- const runs = [];
807
- for (const run of dispatched.runs) {
808
- if (!run.ok) {
809
- runs.push({
810
- model: run.model,
811
- runId: run.runId,
812
- report: null,
813
- failure: `dispatch failed: ${run.error ?? "unknown error"}`
814
- });
3323
+ for (const observation of observations) {
3324
+ if (observation.type !== "TOOL") {
3325
+ skip(`type ${observation.type ?? "unknown"}`);
815
3326
  continue;
816
3327
  }
817
- progress(`waiting on ${run.model} (run ${run.runId})\u2026`);
818
- let report = null;
819
- let failure = null;
820
- try {
821
- report = await waitForRun(run.runId, {
822
- timeoutMinutes: opts.timeoutMinutes ?? 45,
823
- options,
824
- onTick: (r) => progress(
825
- `\u2026${run.model}: ${r.status.toLowerCase()} (${r.shardsCompleted ?? 0}/${r.parallelism} shards)`
826
- )
827
- });
828
- report = { ...report, url: fallbackUrl(report) };
829
- if (report.status.toUpperCase() !== "COMPLETED") {
830
- failure = report.status;
831
- } else if (minScore !== null) {
832
- if (report.score === null) failure = "completed without a score";
833
- else if (report.score < minScore)
834
- failure = `score ${fmtScore(report.score)} < ${minScore}`;
835
- }
836
- } catch (error) {
837
- failure = error instanceof Error ? error.message : String(error);
3328
+ const tool = observation.name;
3329
+ if (typeof tool !== "string" || !tool) {
3330
+ skip("no name");
3331
+ continue;
838
3332
  }
839
- runs.push({ model: run.model, runId: run.runId, report, failure });
3333
+ const at = isoOf(observation.startTime);
3334
+ if (!Number.isNaN(sinceMs) && at !== void 0 && Date.parse(at) < sinceMs) {
3335
+ skip("before since");
3336
+ continue;
3337
+ }
3338
+ if (known && !known.has(tool)) {
3339
+ out.unknownTools[tool] = (out.unknownTools[tool] ?? 0) + 1;
3340
+ continue;
3341
+ }
3342
+ const input = jsonish(observation.input);
3343
+ const record = { tool, args: isObject2(input) ? input : {} };
3344
+ if (observation.level === "ERROR") record.error = observation.statusMessage || "ERROR";
3345
+ else record.result = jsonish(observation.output);
3346
+ if (at !== void 0) record.at = at;
3347
+ if (opts.session) record.session = opts.session;
3348
+ record.source = `trace:${observation.traceId ?? "?"}/${observation.id ?? "?"}`;
3349
+ out.records.push(record);
840
3350
  }
841
- const base = {
842
- ok: runs.length > 0 && runs.every((r) => r.failure === null),
843
- slug: pushed.slug,
844
- branch,
845
- versionId: pushed.versionId,
846
- contentHash: pushed.contentHash,
847
- runConfig: { id: runConfig.id, name: runConfig.name },
848
- runs
3351
+ return out;
3352
+ }
3353
+ function credentialsOf(options) {
3354
+ const host = (options.host ?? process.env.GATEWAY_HOST ?? "https://withgateway.ai").replace(/\/+$/, "");
3355
+ const publicKey = options.publicKey ?? process.env.GATEWAY_PUBLIC_KEY;
3356
+ const secretKey = options.secretKey ?? process.env.GATEWAY_SECRET_KEY;
3357
+ return publicKey && secretKey ? { host, publicKey, secretKey } : null;
3358
+ }
3359
+ async function ingest(world, records, options = {}) {
3360
+ const { ingestLocalToolCalls: ingestLocalToolCalls2, importLocalWorldData: importLocalWorldData2, checkLocalWorldData: checkLocalWorldData2 } = await Promise.resolve().then(() => (init_data(), data_exports));
3361
+ if (options.transform !== void 0 && options.map !== void 0) throw new Error("records go through one of transform, map");
3362
+ const redact = options.redact ?? "off";
3363
+ const mode = options.mode ?? "append";
3364
+ const dryRun = Boolean(options.dryRun);
3365
+ const creds = credentialsOf(options);
3366
+ const local = fs8.existsSync(world) && fs8.statSync(world).isDirectory();
3367
+ const map = options.map === void 0 ? void 0 : options.map;
3368
+ let rows = null;
3369
+ let stderr = "";
3370
+ if (options.transform !== void 0) {
3371
+ const { transformRecords: transformRecords2 } = await Promise.resolve().then(() => (init_transform(), transform_exports));
3372
+ ({ rows, stderr } = await transformRecords2(options.transform, records, { timeoutMs: options.timeoutMs }));
3373
+ }
3374
+ if (local) {
3375
+ if (rows === null) return reportOf(world, await ingestLocalToolCalls2(world, records, { redact, dryRun, mode, map }, creds), redact);
3376
+ const landed = dryRun ? await checkLocalWorldData2(world, rows, creds, { redact }) : await importLocalWorldData2(world, rows, { mode, redact }, creds);
3377
+ return transformReport(world, records.length, rows, stderr, { dryRun, redact, changed: !dryRun && landed.changed, kind: landed.kind, entityCounts: landed.entity_counts });
3378
+ }
3379
+ if (!creds) throw new Error("Gateway keys missing: set GATEWAY_PUBLIC_KEY / GATEWAY_SECRET_KEY (or pass publicKey/secretKey).");
3380
+ const { pull: pull2 } = await Promise.resolve().then(() => (init_hub(), hub_exports));
3381
+ const slug = world.split("@", 1)[0];
3382
+ const scratch = fs8.mkdtempSync(path7.join(os3.tmpdir(), "gateway-ingest-"));
3383
+ try {
3384
+ const pulled = await pull2(world, path7.join(scratch, slug), options);
3385
+ let report;
3386
+ let projected;
3387
+ if (rows === null) {
3388
+ const proven = await ingestLocalToolCalls2(pulled.dir, records, { redact: "off", dryRun: true, mode, map }, creds);
3389
+ report = reportOf(world, proven, redact);
3390
+ projected = proven.projected ?? {};
3391
+ } else {
3392
+ const proven = await checkLocalWorldData2(pulled.dir, rows, creds);
3393
+ report = transformReport(world, records.length, rows, stderr, { dryRun, redact, changed: false, kind: proven.kind, entityCounts: proven.entity_counts });
3394
+ projected = rows;
3395
+ }
3396
+ report.dryRun = dryRun;
3397
+ if (dryRun || report.refusals.length || !Object.keys(projected).length) return report;
3398
+ const { pushRows: pushRows2 } = await Promise.resolve().then(() => (init_push(), push_exports));
3399
+ const status = await pushRows2(creds, slug, projected, { mode, redact, message: options.message });
3400
+ report.batch = status;
3401
+ report.changed = status.state === "applied" || status.state === "published";
3402
+ if (status.entityCounts) report.entityCounts = status.entityCounts;
3403
+ return report;
3404
+ } finally {
3405
+ fs8.rmSync(scratch, { recursive: true, force: true });
3406
+ }
3407
+ }
3408
+ async function ingestToolCalls(world, records, options = {}) {
3409
+ return ingest(world, records, options);
3410
+ }
3411
+ function transformReport(world, records, rows, stderr, outcome) {
3412
+ return {
3413
+ world,
3414
+ via: "transform",
3415
+ ...stderr ? { stderr } : {},
3416
+ records,
3417
+ ingested: records,
3418
+ skipped: {},
3419
+ refusals: [],
3420
+ rows: Object.fromEntries(Object.entries(rows).map(([entity, listed]) => [entity, listed.length])),
3421
+ dryRun: outcome.dryRun,
3422
+ redact: outcome.redact,
3423
+ changed: outcome.changed,
3424
+ ...outcome.kind ? { kind: outcome.kind } : {},
3425
+ ...outcome.entityCounts ? { entityCounts: outcome.entityCounts } : {}
849
3426
  };
3427
+ }
3428
+ function reportOf(world, local, redact) {
850
3429
  return {
851
- ...base,
852
- markdown: buildMarkdown(base, minScore, {
853
- repoUrl: provenance.repoUrl,
854
- commit: provenance.commit
855
- })
3430
+ world,
3431
+ ...local.via ? { via: local.via } : {},
3432
+ ...local.sources ? { sources: local.sources.map(({ unmapped_fields, unset_fields, ...rest }) => ({ ...rest, unmappedFields: unmapped_fields, unsetFields: unset_fields })) } : {},
3433
+ ...local.unmatched ? { unmatched: local.unmatched } : {},
3434
+ ...local.note ? { note: local.note } : {},
3435
+ records: local.records,
3436
+ ingested: local.ingested,
3437
+ skipped: local.skipped,
3438
+ refusals: local.refusals,
3439
+ rows: local.rows,
3440
+ dryRun: local.dry_run,
3441
+ redact,
3442
+ changed: local.changed,
3443
+ ...local.kind ? { kind: local.kind } : {},
3444
+ ...local.entity_counts ? { entityCounts: local.entity_counts } : {}
856
3445
  };
857
3446
  }
858
- var init_validate = __esm({
859
- "src/worlds/validate.ts"() {
3447
+ async function sessionToolObservations(sessionId, options = {}) {
3448
+ const session = await apiRequest(
3449
+ options,
3450
+ "GET",
3451
+ `/api/public/sessions/${encodeURIComponent(sessionId)}?includeIO=true`
3452
+ );
3453
+ const out = [];
3454
+ for (const trace5 of session.traces ?? [])
3455
+ for (const observation of trace5.observations ?? []) out.push({ traceId: trace5.id ?? null, ...observation });
3456
+ return out;
3457
+ }
3458
+ var isObject2, isoOf;
3459
+ var init_ingest = __esm({
3460
+ "src/worlds/ingest.ts"() {
860
3461
  "use strict";
861
3462
  init_worlds();
862
- init_hub();
3463
+ isObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
3464
+ isoOf = (value) => value instanceof Date ? value.toISOString() : typeof value === "string" ? value : void 0;
863
3465
  }
864
3466
  });
865
3467
 
866
3468
  // src/worlds/index.ts
867
3469
  var worlds_exports = {};
868
3470
  __export(worlds_exports, {
3471
+ BrowserActionRecorder: () => BrowserActionRecorder,
3472
+ COMPUTER_USE_SPECS: () => COMPUTER_USE_SPECS,
869
3473
  DEFAULT_BRANCH: () => DEFAULT_BRANCH,
3474
+ DEFAULT_VIEWPORT: () => DEFAULT_VIEWPORT,
3475
+ EVENT_BATCH_SIZE: () => EVENT_BATCH_SIZE,
3476
+ EVENT_FLUSH_INTERVAL_MS: () => EVENT_FLUSH_INTERVAL_MS,
3477
+ EVENT_MAX_RETRIES: () => EVENT_MAX_RETRIES,
3478
+ STRIP_PREFIX: () => STRIP_PREFIX,
3479
+ SURFACE_KINDS: () => SURFACE_KINDS,
3480
+ TRANSFORMS: () => TRANSFORMS,
3481
+ WHITESPACE: () => WHITESPACE,
3482
+ WorldBrowser: () => WorldBrowser,
870
3483
  WorldSession: () => WorldSession,
871
3484
  WorldSessionCallError: () => WorldSessionCallError,
872
3485
  WorldSessionTimeout: () => WorldSessionTimeout,
873
3486
  WorldSet: () => WorldSet,
3487
+ WorldSurfaceUnavailable: () => WorldSurfaceUnavailable,
874
3488
  WorldTask: () => WorldTask,
875
3489
  apiRequest: () => apiRequest,
3490
+ applyTransforms: () => applyTransforms,
876
3491
  attachSession: () => attachSession,
877
3492
  buildSourceTarball: () => buildSourceTarball,
3493
+ captureToolCalls: () => captureToolCalls,
878
3494
  collectArchiveRelPaths: () => collectArchiveRelPaths,
879
3495
  computeContentHash: () => computeContentHash,
3496
+ computerUseToolkit: () => computerUseToolkit,
880
3497
  createRef: () => createRef,
3498
+ createTask: () => createTask,
881
3499
  deleteEnvSecret: () => deleteEnvSecret,
3500
+ deleteTask: () => deleteTask,
3501
+ describeWorld: () => describeWorld,
882
3502
  detectProvenance: () => detectProvenance,
883
3503
  getRun: () => getRun,
3504
+ getTask: () => getTask,
3505
+ hashForm: () => hashForm,
3506
+ ingest: () => ingest,
3507
+ ingestToolCalls: () => ingestToolCalls,
884
3508
  isIncludedInContentHash: () => isIncludedInContentHash,
3509
+ isTaskIdRef: () => isTaskIdRef,
3510
+ isTaskSpec: () => isTaskSpec,
885
3511
  listEnvSecretKeys: () => listEnvSecretKeys,
886
3512
  listRunConfigs: () => listRunConfigs,
3513
+ listTasks: () => listTasks,
887
3514
  localTreeState: () => localTreeState,
3515
+ migrateProjectWorlds: () => migrateProjectWorlds,
3516
+ migrateWorld: () => migrateWorld,
3517
+ openBrowser: () => openBrowser,
888
3518
  openSession: () => openSession,
889
3519
  openWorld: () => openWorld,
3520
+ parseToolCallRecord: () => parseToolCallRecord,
3521
+ parseTransform: () => parseTransform,
3522
+ parseWorldTaskRefs: () => parseWorldTaskRefs,
3523
+ preserveForm: () => preserveForm,
890
3524
  propose: () => propose,
891
3525
  pull: () => pull,
892
3526
  push: () => push,
3527
+ pyText: () => pyText,
3528
+ queryRows: () => queryRows,
3529
+ queryRowsSearch: () => queryRowsSearch,
893
3530
  readLocalMeta: () => readLocalMeta,
3531
+ readToolCallRecords: () => readToolCallRecords,
3532
+ redactActionArgs: () => redactActionArgs,
3533
+ redactionOf: () => redactionOf,
3534
+ resolveBrowserMode: () => resolveBrowserMode,
3535
+ roundForm: () => roundForm,
894
3536
  runSessions: () => runSessions,
895
3537
  schemaFromSignature: () => schemaFromSignature,
3538
+ sessionToolObservations: () => sessionToolObservations,
896
3539
  setEnvSecret: () => setEnvSecret,
3540
+ shapeText: () => shapeText,
897
3541
  snapshotTreeHashes: () => snapshotTreeHashes,
3542
+ storedForms: () => storedForms,
3543
+ surfaceKinds: () => surfaceKinds,
3544
+ taskLabel: () => taskLabel,
3545
+ toolCallRecordsIn: () => toolCallRecordsIn,
3546
+ toolCallsFromObservations: () => toolCallsFromObservations,
3547
+ uiEntryUrl: () => uiEntryUrl,
3548
+ uiUrl: () => uiUrl,
3549
+ updateTask: () => updateTask,
3550
+ upsertRunConfig: () => upsertRunConfig,
3551
+ validateTask: () => validateTask,
898
3552
  validateWorld: () => validateWorld,
899
3553
  waitForRun: () => waitForRun,
3554
+ withoutUiToken: () => withoutUiToken,
900
3555
  writeLocalMeta: () => writeLocalMeta
901
3556
  });
902
3557
  function resolveEnv(options) {
@@ -910,9 +3565,9 @@ function resolveEnv(options) {
910
3565
  }
911
3566
  return { host: host.replace(/\/+$/, ""), publicKey, secretKey };
912
3567
  }
913
- async function apiRequest(options, method, path2, body) {
3568
+ async function apiRequest(options, method, path9, body) {
914
3569
  const { host, publicKey, secretKey } = resolveEnv(options);
915
- const res = await fetch(`${host}${path2}`, {
3570
+ const res = await fetch(`${host}${path9}`, {
916
3571
  method,
917
3572
  headers: {
918
3573
  "content-type": "application/json",
@@ -920,13 +3575,13 @@ async function apiRequest(options, method, path2, body) {
920
3575
  },
921
3576
  ...body === void 0 ? {} : { body: JSON.stringify(body) }
922
3577
  });
923
- const text = await res.text();
3578
+ const text2 = await res.text();
924
3579
  if (!res.ok) {
925
3580
  throw new Error(
926
- `${method} ${path2} -> ${res.status}: ${text.slice(0, 400)}`
3581
+ `${method} ${path9} -> ${res.status}: ${text2.slice(0, 400)}`
927
3582
  );
928
3583
  }
929
- return JSON.parse(text);
3584
+ return JSON.parse(text2);
930
3585
  }
931
3586
  async function setEnvSecret(slug, key, value, options = {}) {
932
3587
  return apiRequest(
@@ -967,6 +3622,28 @@ async function listRunConfigs(options = {}) {
967
3622
  );
968
3623
  return res.runConfigs;
969
3624
  }
3625
+ async function upsertRunConfig(input, options = {}) {
3626
+ return apiRequest(
3627
+ options,
3628
+ "POST",
3629
+ "/api/public/benchmark-containers/run-configs",
3630
+ input
3631
+ );
3632
+ }
3633
+ function parseWorldTaskRefs(spec) {
3634
+ const items = (Array.isArray(spec) ? spec : spec.split(",")).map((s) => s.trim()).filter(Boolean);
3635
+ return items.map((item) => {
3636
+ const at = item.lastIndexOf("@");
3637
+ if (at < 0) return { id: item };
3638
+ const id = item.slice(0, at);
3639
+ const version = Number(item.slice(at + 1));
3640
+ if (!id || !Number.isInteger(version) || version < 1)
3641
+ throw new Error(
3642
+ `stored task ref '${item}' is not <id> or <id>@<version> (version a positive integer)`
3643
+ );
3644
+ return { id, version };
3645
+ });
3646
+ }
970
3647
  async function getRun(runId, options = {}) {
971
3648
  return apiRequest(
972
3649
  options,
@@ -985,7 +3662,7 @@ async function waitForRun(runId, opts = {}) {
985
3662
  );
986
3663
  opts.onTick?.(run);
987
3664
  await new Promise(
988
- (resolve2) => setTimeout(resolve2, (opts.intervalSeconds ?? 20) * 1e3)
3665
+ (resolve7) => setTimeout(resolve7, (opts.intervalSeconds ?? 20) * 1e3)
989
3666
  );
990
3667
  }
991
3668
  }
@@ -1060,8 +3737,16 @@ var init_worlds = __esm({
1060
3737
  "src/worlds/index.ts"() {
1061
3738
  "use strict";
1062
3739
  init_session();
3740
+ init_tasks();
3741
+ init_browser();
1063
3742
  init_hub();
1064
3743
  init_validate();
3744
+ init_describe();
3745
+ init_redaction();
3746
+ init_transforms();
3747
+ init_query();
3748
+ init_migrate();
3749
+ init_ingest();
1065
3750
  WorldTask = class {
1066
3751
  constructor(world, name, variant) {
1067
3752
  this.world = world;
@@ -1089,15 +3774,18 @@ var init_worlds = __esm({
1089
3774
  return hit;
1090
3775
  }
1091
3776
  /**
1092
- * Open a LIVE session against one of this world's tasks: the platform boots
1093
- * (or reuses) a warm container, and your agent calls its tools through the
1094
- * platform. See worlds/session.ts.
3777
+ * Open a LIVE session against one of this world's tasks — a bundled task's
3778
+ * name or an inline `WorldTaskSpec`: the platform boots (or reuses) a warm
3779
+ * container, and your agent calls its tools through the platform. See
3780
+ * worlds/session.ts.
1095
3781
  */
1096
3782
  async open(task, opts = {}) {
1097
3783
  const { openSession: openSession2 } = await Promise.resolve().then(() => (init_session(), session_exports));
1098
- return openSession2(this.slug, task, {
3784
+ return openSession2(this.slug, {
3785
+ task,
1099
3786
  versionId: this.version.versionId,
1100
3787
  reuseWarm: opts.reuseWarm,
3788
+ surfaces: opts.surfaces,
1101
3789
  options: this.options
1102
3790
  });
1103
3791
  }
@@ -1129,7 +3817,7 @@ var require_package = __commonJS({
1129
3817
  "package.json"(exports, module) {
1130
3818
  module.exports = {
1131
3819
  name: "@withgateway/sdk",
1132
- version: "0.1.20",
3820
+ version: "0.2.1",
1133
3821
  description: "Gateway SDK for TypeScript - A/B experiments, tracing, and observability",
1134
3822
  main: "./dist/index.js",
1135
3823
  module: "./dist/index.mjs",
@@ -1194,16 +3882,34 @@ var require_package = __commonJS({
1194
3882
  types: "./dist/worlds/index.d.ts",
1195
3883
  import: "./dist/worlds/index.mjs",
1196
3884
  require: "./dist/worlds/index.js"
3885
+ },
3886
+ "./files": {
3887
+ types: "./dist/files/index.d.ts",
3888
+ import: "./dist/files/index.mjs",
3889
+ require: "./dist/files/index.js"
3890
+ },
3891
+ "./traces": {
3892
+ types: "./dist/traces/index.d.ts",
3893
+ import: "./dist/traces/index.mjs",
3894
+ require: "./dist/traces/index.js"
3895
+ },
3896
+ "./cli": {
3897
+ types: "./dist/cli.d.ts",
3898
+ import: "./dist/cli.mjs",
3899
+ require: "./dist/cli.js"
1197
3900
  }
1198
3901
  },
1199
3902
  files: [
1200
3903
  "dist",
3904
+ "skills",
3905
+ "runtime",
1201
3906
  "README.md"
1202
3907
  ],
1203
3908
  publishConfig: {
1204
3909
  access: "public"
1205
3910
  },
1206
3911
  scripts: {
3912
+ prebuild: "node scripts/copy-skills.mjs && node scripts/copy-runtime.mjs",
1207
3913
  build: "tsup",
1208
3914
  dev: "tsup --watch",
1209
3915
  typecheck: "tsc --noEmit",
@@ -1236,7 +3942,8 @@ var require_package = __commonJS({
1236
3942
  "@opentelemetry/exporter-trace-otlp-http": ">=0.50.0",
1237
3943
  "@opentelemetry/resources": ">=1.0.0",
1238
3944
  "@opentelemetry/sdk-trace-base": ">=1.0.0",
1239
- "@opentelemetry/sdk-trace-node": ">=1.0.0"
3945
+ "@opentelemetry/sdk-trace-node": ">=1.0.0",
3946
+ playwright: ">=1.40.0"
1240
3947
  },
1241
3948
  peerDependenciesMeta: {
1242
3949
  "@opentelemetry/api": {
@@ -1253,6 +3960,9 @@ var require_package = __commonJS({
1253
3960
  },
1254
3961
  "@opentelemetry/resources": {
1255
3962
  optional: true
3963
+ },
3964
+ playwright: {
3965
+ optional: true
1256
3966
  }
1257
3967
  },
1258
3968
  optionalDependencies: {
@@ -1554,9 +4264,9 @@ var ExperimentClient = class {
1554
4264
  })
1555
4265
  });
1556
4266
  if (!response.ok) {
1557
- const text = await response.text();
4267
+ const text2 = await response.text();
1558
4268
  throw new Error(
1559
- `Failed to sync experiment: ${response.status} ${response.statusText} - ${text}`
4269
+ `Failed to sync experiment: ${response.status} ${response.statusText} - ${text2}`
1560
4270
  );
1561
4271
  }
1562
4272
  console.log(`[gateway] Synced experiment '${config.key}' to backend`);
@@ -1866,8 +4576,8 @@ var GatewayContext = class _GatewayContext {
1866
4576
  }
1867
4577
  return resolved;
1868
4578
  }
1869
- async requestJson(method, path2, payload) {
1870
- const response = await fetch(`${this.host}${path2}`, {
4579
+ async requestJson(method, path9, payload) {
4580
+ const response = await fetch(`${this.host}${path9}`, {
1871
4581
  method,
1872
4582
  headers: {
1873
4583
  Authorization: this.authHeader(),
@@ -1875,10 +4585,10 @@ var GatewayContext = class _GatewayContext {
1875
4585
  },
1876
4586
  ...payload ? { body: JSON.stringify(payload) } : {}
1877
4587
  });
1878
- const text = await response.text();
1879
- const body = text ? safeJson(text) : {};
4588
+ const text2 = await response.text();
4589
+ const body = text2 ? safeJson(text2) : {};
1880
4590
  if (!response.ok) {
1881
- const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${path2}`;
4591
+ const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${path9}`;
1882
4592
  if (response.status === 409) {
1883
4593
  throw new GatewayContextConflictError(
1884
4594
  message,
@@ -1887,7 +4597,7 @@ var GatewayContext = class _GatewayContext {
1887
4597
  }
1888
4598
  throw new GatewayContextError(message);
1889
4599
  }
1890
- this.log("%s %s -> %s", method, path2, response.status);
4600
+ this.log("%s %s -> %s", method, path9, response.status);
1891
4601
  return body;
1892
4602
  }
1893
4603
  authHeader() {
@@ -1994,11 +4704,11 @@ function primaryPathForKind(kind, snapshot) {
1994
4704
  const preferred = kind === "agent" ? "AGENTS.md" : kind === "prompt" ? "PROMPT.md" : kind === "skill" ? "SKILL.md" : "MEMORY.md";
1995
4705
  if (readFile(snapshot, preferred)) return preferred;
1996
4706
  return Object.entries(snapshot.files).find(
1997
- ([path2, entry]) => entry.type === "file" && path2.endsWith(".md")
4707
+ ([path9, entry]) => entry.type === "file" && path9.endsWith(".md")
1998
4708
  )?.[0] ?? null;
1999
4709
  }
2000
- function parseJsonFile(snapshot, path2) {
2001
- const content = readFile(snapshot, path2);
4710
+ function parseJsonFile(snapshot, path9) {
4711
+ const content = readFile(snapshot, path9);
2002
4712
  if (!content) return {};
2003
4713
  try {
2004
4714
  const parsed = JSON.parse(content);
@@ -2007,8 +4717,8 @@ function parseJsonFile(snapshot, path2) {
2007
4717
  return {};
2008
4718
  }
2009
4719
  }
2010
- function readFile(snapshot, path2) {
2011
- const entry = snapshot.files[path2];
4720
+ function readFile(snapshot, path9) {
4721
+ const entry = snapshot.files[path9];
2012
4722
  return entry?.type === "file" ? entry.content : null;
2013
4723
  }
2014
4724
  function provenanceFor(snapshot, label) {
@@ -2110,16 +4820,16 @@ var GatewayMemory = class _GatewayMemory {
2110
4820
  `/api/public/context/memory/${encodeIdentifier2(identifier)}${suffix}`
2111
4821
  );
2112
4822
  }
2113
- async read(target, path2, options = {}) {
4823
+ async read(target, path9, options = {}) {
2114
4824
  const snapshot = typeof target === "string" ? await this.pull(target, options) : target;
2115
- const file = snapshot.files[path2];
4825
+ const file = snapshot.files[path9];
2116
4826
  return file?.type === "file" ? file.content : null;
2117
4827
  }
2118
- async write(target, path2, content, options = {}) {
4828
+ async write(target, path9, content, options = {}) {
2119
4829
  const snapshot = typeof target === "string" ? await this.pull(target) : target;
2120
4830
  return this.push(snapshot.repo.repoHandle, {
2121
4831
  files: {
2122
- [path2]: {
4832
+ [path9]: {
2123
4833
  content,
2124
4834
  ...options.mimeType ? { mimeType: options.mimeType } : {}
2125
4835
  }
@@ -2129,10 +4839,10 @@ var GatewayMemory = class _GatewayMemory {
2129
4839
  ...runtimeContextPayload2(options)
2130
4840
  });
2131
4841
  }
2132
- async delete(target, path2, options = {}) {
4842
+ async delete(target, path9, options = {}) {
2133
4843
  const snapshot = typeof target === "string" ? await this.pull(target) : target;
2134
4844
  return this.push(snapshot.repo.repoHandle, {
2135
- files: { [path2]: null },
4845
+ files: { [path9]: null },
2136
4846
  parentCommit: options.parentCommit ?? snapshot.commit.commitHash,
2137
4847
  message: options.message,
2138
4848
  ...runtimeContextPayload2(options)
@@ -2145,8 +4855,8 @@ var GatewayMemory = class _GatewayMemory {
2145
4855
  payload
2146
4856
  );
2147
4857
  }
2148
- async requestJson(method, path2, payload) {
2149
- const response = await fetch(`${this.host}${path2}`, {
4858
+ async requestJson(method, path9, payload) {
4859
+ const response = await fetch(`${this.host}${path9}`, {
2150
4860
  method,
2151
4861
  headers: {
2152
4862
  Authorization: this.authHeader(),
@@ -2154,10 +4864,10 @@ var GatewayMemory = class _GatewayMemory {
2154
4864
  },
2155
4865
  ...payload ? { body: JSON.stringify(payload) } : {}
2156
4866
  });
2157
- const text = await response.text();
2158
- const body = text ? safeJson2(text) : {};
4867
+ const text2 = await response.text();
4868
+ const body = text2 ? safeJson2(text2) : {};
2159
4869
  if (!response.ok) {
2160
- const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${path2}`;
4870
+ const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${path9}`;
2161
4871
  if (response.status === 409) {
2162
4872
  throw new GatewayMemoryConflictError(
2163
4873
  message,
@@ -2166,7 +4876,7 @@ var GatewayMemory = class _GatewayMemory {
2166
4876
  }
2167
4877
  throw new GatewayMemoryError(message);
2168
4878
  }
2169
- this.log("%s %s -> %s", method, path2, response.status);
4879
+ this.log("%s %s -> %s", method, path9, response.status);
2170
4880
  return body;
2171
4881
  }
2172
4882
  authHeader() {
@@ -2328,10 +5038,10 @@ var PersonasClient = class _PersonasClient {
2328
5038
  done: Boolean(payload.done)
2329
5039
  };
2330
5040
  }
2331
- async requestJson(method, path2, payload) {
5041
+ async requestJson(method, path9, payload) {
2332
5042
  let response;
2333
5043
  try {
2334
- response = await fetch(`${this.host}${path2}`, {
5044
+ response = await fetch(`${this.host}${path9}`, {
2335
5045
  method,
2336
5046
  headers: {
2337
5047
  Authorization: this.authHeader(),
@@ -2342,19 +5052,19 @@ var PersonasClient = class _PersonasClient {
2342
5052
  });
2343
5053
  } catch (error) {
2344
5054
  const reason = error instanceof Error ? error.message : String(error);
2345
- throw new PersonaError(`${method} ${path2} failed: ${reason}`, {
5055
+ throw new PersonaError(`${method} ${path9} failed: ${reason}`, {
2346
5056
  cause: error
2347
5057
  });
2348
5058
  }
2349
- const text = await response.text();
5059
+ const text2 = await response.text();
2350
5060
  if (!response.ok) {
2351
- const detail = text.slice(0, 500);
5061
+ const detail = text2.slice(0, 500);
2352
5062
  throw new PersonaError(
2353
- `${method} ${path2} failed (${response.status}): ${detail}`
5063
+ `${method} ${path9} failed (${response.status}): ${detail}`
2354
5064
  );
2355
5065
  }
2356
- this.log("%s %s -> %s", method, path2, response.status);
2357
- return safeJson3(text);
5066
+ this.log("%s %s -> %s", method, path9, response.status);
5067
+ return safeJson3(text2);
2358
5068
  }
2359
5069
  authHeader() {
2360
5070
  return `Basic ${Buffer.from(`${this.publicKey}:${this.secretKey}`).toString(
@@ -2578,10 +5288,10 @@ var SessionRecording = class _SessionRecording {
2578
5288
  };
2579
5289
  }
2580
5290
  /** Dump the full session as a JSON fixture (for regression tests). */
2581
- toFixture(path2) {
2582
- mkdirSync(dirname(path2), { recursive: true });
2583
- writeFileSync(path2, JSON.stringify(this.toJSON(), null, 2), "utf-8");
2584
- return path2;
5291
+ toFixture(path9) {
5292
+ mkdirSync(dirname(path9), { recursive: true });
5293
+ writeFileSync(path9, JSON.stringify(this.toJSON(), null, 2), "utf-8");
5294
+ return path9;
2585
5295
  }
2586
5296
  static fromApi(raw) {
2587
5297
  return new _SessionRecording({
@@ -2622,15 +5332,15 @@ async function loadSession(sessionId, options = {}) {
2622
5332
  if (response.status === 404) {
2623
5333
  throw new SessionLoadError(`Session not found: ${sessionId}`);
2624
5334
  }
2625
- const text = await response.text();
5335
+ const text2 = await response.text();
2626
5336
  if (!response.ok) {
2627
5337
  throw new SessionLoadError(
2628
- `Failed to load session ${sessionId}: HTTP ${response.status} \u2014 ${text.slice(0, 300)}`
5338
+ `Failed to load session ${sessionId}: HTTP ${response.status} \u2014 ${text2.slice(0, 300)}`
2629
5339
  );
2630
5340
  }
2631
5341
  let payload;
2632
5342
  try {
2633
- payload = JSON.parse(text);
5343
+ payload = JSON.parse(text2);
2634
5344
  } catch (error) {
2635
5345
  throw new SessionLoadError(
2636
5346
  `Failed to load session ${sessionId}: response is not valid JSON`,
@@ -3178,13 +5888,13 @@ var ReplaySuite = class _ReplaySuite {
3178
5888
  if (response.status === 404) {
3179
5889
  return null;
3180
5890
  }
3181
- const text = await response.text();
5891
+ const text2 = await response.text();
3182
5892
  if (!response.ok) {
3183
5893
  throw new ReplayError(
3184
- `Failed to list tasks for ${datasetId}: HTTP ${response.status} \u2014 ${text.slice(0, 300)}`
5894
+ `Failed to list tasks for ${datasetId}: HTTP ${response.status} \u2014 ${text2.slice(0, 300)}`
3185
5895
  );
3186
5896
  }
3187
- const payload = parseJsonObject(text);
5897
+ const payload = parseJsonObject(text2);
3188
5898
  const pageTasks = Array.isArray(payload.tasks) ? payload.tasks : [];
3189
5899
  tasks.push(...pageTasks.filter(isPlainObject2));
3190
5900
  if (tasks.length >= Number(payload.totalTasks ?? 0)) {
@@ -3201,13 +5911,13 @@ var ReplaySuite = class _ReplaySuite {
3201
5911
  `${host}/api/public/task-sets?name=${encodeURIComponent(nameOrId)}`,
3202
5912
  { headers, signal: AbortSignal.timeout(timeoutSeconds * 1e3) }
3203
5913
  );
3204
- const text = await response.text();
5914
+ const text2 = await response.text();
3205
5915
  if (!response.ok) {
3206
5916
  throw new ReplayError(
3207
- `Failed to resolve task set '${nameOrId}': HTTP ${response.status} \u2014 ${text.slice(0, 300)}`
5917
+ `Failed to resolve task set '${nameOrId}': HTTP ${response.status} \u2014 ${text2.slice(0, 300)}`
3208
5918
  );
3209
5919
  }
3210
- const payload = parseJsonObject(text);
5920
+ const payload = parseJsonObject(text2);
3211
5921
  const matches = Array.isArray(payload.taskSets) ? payload.taskSets.filter(isPlainObject2) : [];
3212
5922
  if (matches.length === 0) {
3213
5923
  throw new ReplayError(`Task set not found: ${nameOrId}`);
@@ -3330,8 +6040,8 @@ async function recordRunItem(suiteToRecord, testCase, runName, traceId, triage,
3330
6040
  if (response.status === 200) {
3331
6041
  return null;
3332
6042
  }
3333
- const text = await response.text();
3334
- lastError = `HTTP ${response.status}: ${text.slice(0, 200)}`;
6043
+ const text2 = await response.text();
6044
+ lastError = `HTTP ${response.status}: ${text2.slice(0, 200)}`;
3335
6045
  if (response.status !== 404) {
3336
6046
  return lastError;
3337
6047
  }
@@ -3404,9 +6114,9 @@ function suite(nameOrId, options = {}) {
3404
6114
  function isPlainObject2(value) {
3405
6115
  return typeof value === "object" && value !== null && !Array.isArray(value);
3406
6116
  }
3407
- function parseJsonObject(text) {
6117
+ function parseJsonObject(text2) {
3408
6118
  try {
3409
- const parsed = JSON.parse(text);
6119
+ const parsed = JSON.parse(text2);
3410
6120
  return isPlainObject2(parsed) ? parsed : {};
3411
6121
  } catch {
3412
6122
  return {};
@@ -3416,7 +6126,7 @@ function randomHex() {
3416
6126
  return crypto.randomUUID().replace(/-/g, "");
3417
6127
  }
3418
6128
  function sleep(ms) {
3419
- return new Promise((resolve2) => setTimeout(resolve2, ms));
6129
+ return new Promise((resolve7) => setTimeout(resolve7, ms));
3420
6130
  }
3421
6131
  var replay = {
3422
6132
  suite,
@@ -3503,7 +6213,7 @@ var GatewaySecurity = class _GatewaySecurity {
3503
6213
  const descriptors = entries.map(
3504
6214
  ([key, tool]) => this.describeTool(key, tool, options)
3505
6215
  );
3506
- const resolve2 = await this.resolveToolset({
6216
+ const resolve7 = await this.resolveToolset({
3507
6217
  agent: this.agent,
3508
6218
  toolsetId: options.toolsetId,
3509
6219
  toolsetName: options.toolsetName,
@@ -3513,8 +6223,8 @@ var GatewaySecurity = class _GatewaySecurity {
3513
6223
  });
3514
6224
  const securedEntries = entries.flatMap(([key, tool]) => {
3515
6225
  const descriptor = descriptors.find((item) => item.name === key);
3516
- if (!this.shouldExposeTool(resolve2, descriptor.id)) {
3517
- this.log("Hiding tool %s in %s mode", descriptor.id, resolve2.mode);
6226
+ if (!this.shouldExposeTool(resolve7, descriptor.id)) {
6227
+ this.log("Hiding tool %s in %s mode", descriptor.id, resolve7.mode);
3518
6228
  return [];
3519
6229
  }
3520
6230
  return [
@@ -3524,7 +6234,7 @@ var GatewaySecurity = class _GatewaySecurity {
3524
6234
  toolId: descriptor.id,
3525
6235
  toolsetId: options.toolsetId,
3526
6236
  context: this.normalizeContext(options.context),
3527
- resolve: resolve2
6237
+ resolve: resolve7
3528
6238
  })
3529
6239
  ]
3530
6240
  ];
@@ -3612,8 +6322,8 @@ var GatewaySecurity = class _GatewaySecurity {
3612
6322
  );
3613
6323
  }
3614
6324
  }
3615
- async postJson(path2, payload) {
3616
- const response = await fetch(`${this.host}${path2}`, {
6325
+ async postJson(path9, payload) {
6326
+ const response = await fetch(`${this.host}${path9}`, {
3617
6327
  method: "POST",
3618
6328
  headers: {
3619
6329
  Authorization: this.authHeader(),
@@ -3624,7 +6334,7 @@ var GatewaySecurity = class _GatewaySecurity {
3624
6334
  if (!response.ok) {
3625
6335
  const body = await response.text();
3626
6336
  throw new GatewaySecurityError(
3627
- `Gateway API ${response.status} on ${path2}: ${body || response.statusText}`
6337
+ `Gateway API ${response.status} on ${path9}: ${body || response.statusText}`
3628
6338
  );
3629
6339
  }
3630
6340
  return await response.json();
@@ -3639,9 +6349,9 @@ var GatewaySecurity = class _GatewaySecurity {
3639
6349
  metadata: options.toolMetadata?.[key] ?? {}
3640
6350
  };
3641
6351
  }
3642
- shouldExposeTool(resolve2, toolId) {
3643
- if (resolve2.mode === "observe") return true;
3644
- if (resolve2.blockedToolIds.includes(toolId)) return false;
6352
+ shouldExposeTool(resolve7, toolId) {
6353
+ if (resolve7.mode === "observe") return true;
6354
+ if (resolve7.blockedToolIds.includes(toolId)) return false;
3645
6355
  return true;
3646
6356
  }
3647
6357
  normalizeContext(context4) {
@@ -3793,10 +6503,10 @@ var UsersClient = class _UsersClient {
3793
6503
  params.set("toTimestamp", filter.toTimestamp.toISOString());
3794
6504
  if (filter.page) params.set("page", String(filter.page));
3795
6505
  if (filter.limit) params.set("limit", String(filter.limit));
3796
- const qs = params.toString();
6506
+ const qs3 = params.toString();
3797
6507
  const payload = await this.requestJson(
3798
6508
  "GET",
3799
- `/api/public/user-events${qs ? `?${qs}` : ""}`
6509
+ `/api/public/user-events${qs3 ? `?${qs3}` : ""}`
3800
6510
  );
3801
6511
  const rows = Array.isArray(payload.data) ? payload.data : [];
3802
6512
  const meta = payload.meta && typeof payload.meta === "object" ? payload.meta : {};
@@ -3805,10 +6515,10 @@ var UsersClient = class _UsersClient {
3805
6515
  totalItems: Number(meta.totalItems ?? rows.length)
3806
6516
  };
3807
6517
  }
3808
- async requestJson(method, path2, payload) {
6518
+ async requestJson(method, path9, payload) {
3809
6519
  let response;
3810
6520
  try {
3811
- response = await fetch(`${this.host}${path2}`, {
6521
+ response = await fetch(`${this.host}${path9}`, {
3812
6522
  method,
3813
6523
  headers: {
3814
6524
  Authorization: this.authHeader(),
@@ -3819,18 +6529,18 @@ var UsersClient = class _UsersClient {
3819
6529
  });
3820
6530
  } catch (error) {
3821
6531
  throw new UserProfileError(
3822
- `${method} ${path2} failed: ${error instanceof Error ? error.message : String(error)}`,
6532
+ `${method} ${path9} failed: ${error instanceof Error ? error.message : String(error)}`,
3823
6533
  { cause: error }
3824
6534
  );
3825
6535
  }
3826
- const text = await response.text();
6536
+ const text2 = await response.text();
3827
6537
  if (!response.ok) {
3828
6538
  throw new UserProfileError(
3829
- `${method} ${path2} failed (${response.status}): ${text.slice(0, 500)}`
6539
+ `${method} ${path9} failed (${response.status}): ${text2.slice(0, 500)}`
3830
6540
  );
3831
6541
  }
3832
- this.log("%s %s -> %s", method, path2, response.status);
3833
- return safeJson4(text);
6542
+ this.log("%s %s -> %s", method, path9, response.status);
6543
+ return safeJson4(text2);
3834
6544
  }
3835
6545
  authHeader() {
3836
6546
  return `Basic ${Buffer.from(`${this.publicKey}:${this.secretKey}`).toString(
@@ -4033,10 +6743,10 @@ var ScoresClient = class _ScoresClient {
4033
6743
  metadata: signalMetadata
4034
6744
  });
4035
6745
  }
4036
- async request(method, path2, payload) {
6746
+ async request(method, path9, payload) {
4037
6747
  let response;
4038
6748
  try {
4039
- response = await fetch(`${this.host}${path2}`, {
6749
+ response = await fetch(`${this.host}${path9}`, {
4040
6750
  method,
4041
6751
  headers: {
4042
6752
  Authorization: this.authHeader(),
@@ -4047,17 +6757,17 @@ var ScoresClient = class _ScoresClient {
4047
6757
  });
4048
6758
  } catch (error) {
4049
6759
  throw new ScoreError(
4050
- `${method} ${path2} failed: ${error instanceof Error ? error.message : String(error)}`,
6760
+ `${method} ${path9} failed: ${error instanceof Error ? error.message : String(error)}`,
4051
6761
  { cause: error }
4052
6762
  );
4053
6763
  }
4054
- const text = await response.text();
6764
+ const text2 = await response.text();
4055
6765
  if (!response.ok) {
4056
6766
  throw new ScoreError(
4057
- `${method} ${path2} failed (${response.status}): ${text.slice(0, 500)}`
6767
+ `${method} ${path9} failed (${response.status}): ${text2.slice(0, 500)}`
4058
6768
  );
4059
6769
  }
4060
- this.log("%s %s -> %s", method, path2, response.status);
6770
+ this.log("%s %s -> %s", method, path9, response.status);
4061
6771
  }
4062
6772
  authHeader() {
4063
6773
  return `Basic ${Buffer.from(`${this.publicKey}:${this.secretKey}`).toString(
@@ -4098,8 +6808,287 @@ var scores = {
4098
6808
  init_worlds();
4099
6809
  init_session();
4100
6810
 
6811
+ // src/files/index.ts
6812
+ var files_exports = {};
6813
+ __export(files_exports, {
6814
+ DRIVE_PREFIX: () => DRIVE_PREFIX,
6815
+ confirmUpload: () => confirmUpload,
6816
+ contentTypeFor: () => contentTypeFor,
6817
+ createFolder: () => createFolder,
6818
+ deleteFile: () => deleteFile,
6819
+ downloadFile: () => downloadFile,
6820
+ drivePath: () => drivePath,
6821
+ getFile: () => getFile,
6822
+ isDriveRef: () => isDriveRef,
6823
+ iterateFiles: () => iterateFiles,
6824
+ listFileConnectors: () => listFileConnectors,
6825
+ listFiles: () => listFiles,
6826
+ moveFile: () => moveFile,
6827
+ readFile: () => readFile2,
6828
+ requestUpload: () => requestUpload,
6829
+ sha256Base64: () => sha256Base64,
6830
+ syncFileConnector: () => syncFileConnector,
6831
+ uploadBytes: () => uploadBytes,
6832
+ uploadFile: () => uploadFile
6833
+ });
6834
+ init_worlds();
6835
+ import { createHash as createHash7 } from "crypto";
6836
+ import * as fs9 from "fs";
6837
+ import * as path8 from "path";
6838
+ import { Readable, Transform } from "stream";
6839
+ import { pipeline } from "stream/promises";
6840
+ var DRIVE_PREFIX = "drive:";
6841
+ function isDriveRef(value) {
6842
+ return value.startsWith(DRIVE_PREFIX);
6843
+ }
6844
+ function drivePath(ref) {
6845
+ const raw = isDriveRef(ref) ? ref.slice(DRIVE_PREFIX.length) : ref;
6846
+ const trimmed = raw.replace(/^\/+/, "");
6847
+ if (!trimmed) throw new Error(`${ref} names no file in the drive`);
6848
+ return trimmed;
6849
+ }
6850
+ var PAGE_LIMIT = 200;
6851
+ var BASE = "/api/public/files";
6852
+ function qs(params) {
6853
+ const search = new URLSearchParams();
6854
+ for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== "") search.set(key, String(value));
6855
+ const text2 = search.toString();
6856
+ return text2 ? `?${text2}` : "";
6857
+ }
6858
+ async function listFiles(options = {}, params = {}) {
6859
+ return apiRequest(options, "GET", `${BASE}${qs({ prefix: params.prefix, page: params.page, limit: params.limit })}`);
6860
+ }
6861
+ async function* iterateFiles(options = {}, prefix) {
6862
+ for (let page = 0; ; page++) {
6863
+ const listing = await listFiles(options, { prefix, page, limit: PAGE_LIMIT });
6864
+ yield* listing.files;
6865
+ const seen = (page + 1) * listing.limit;
6866
+ if (!listing.files.length || seen >= listing.totalFiles) return;
6867
+ }
6868
+ }
6869
+ async function getFile(options = {}, filePath) {
6870
+ return apiRequest(options, "GET", `${BASE}/download${qs({ path: drivePath(filePath) })}`);
6871
+ }
6872
+ async function openDownload(url) {
6873
+ const res = await fetch(url);
6874
+ if (!res.ok || !res.body) throw new Error(`download failed: storage answered HTTP ${res.status}`);
6875
+ return res;
6876
+ }
6877
+ async function readFile2(options = {}, filePath) {
6878
+ const file = await getFile(options, filePath);
6879
+ const res = await openDownload(file.url);
6880
+ return Buffer.from(await res.arrayBuffer());
6881
+ }
6882
+ async function downloadFile(options = {}, filePath, outPath, onProgress) {
6883
+ const file = await getFile(options, filePath);
6884
+ const res = await openDownload(file.url);
6885
+ fs9.mkdirSync(path8.dirname(path8.resolve(outPath)), { recursive: true });
6886
+ const source = Readable.fromWeb(res.body);
6887
+ await pipeline(source, counting((n) => onProgress?.(n, file.sizeBytes)), fs9.createWriteStream(outPath));
6888
+ return { ...file, out: outPath };
6889
+ }
6890
+ async function requestUpload(options = {}, body) {
6891
+ return apiRequest(options, "POST", BASE, body);
6892
+ }
6893
+ async function confirmUpload(options = {}, fileId, ok = true) {
6894
+ return apiRequest(options, "POST", `${BASE}/confirm`, { fileId, ok });
6895
+ }
6896
+ async function sha256Base64(localPath) {
6897
+ const hash = createHash7("sha256");
6898
+ for await (const chunk of fs9.createReadStream(localPath)) hash.update(chunk);
6899
+ return hash.digest("base64");
6900
+ }
6901
+ var CONTENT_TYPES = {
6902
+ ".json": "application/json",
6903
+ ".jsonl": "application/x-ndjson",
6904
+ ".ndjson": "application/x-ndjson",
6905
+ ".csv": "text/csv",
6906
+ ".tsv": "text/tab-separated-values",
6907
+ ".txt": "text/plain",
6908
+ ".md": "text/markdown",
6909
+ ".toml": "application/toml",
6910
+ ".yaml": "application/yaml",
6911
+ ".yml": "application/yaml",
6912
+ ".xml": "application/xml",
6913
+ ".html": "text/html",
6914
+ ".sql": "application/sql",
6915
+ ".py": "text/x-python",
6916
+ ".ts": "text/plain",
6917
+ ".js": "text/javascript",
6918
+ ".pdf": "application/pdf",
6919
+ ".png": "image/png",
6920
+ ".jpg": "image/jpeg",
6921
+ ".jpeg": "image/jpeg",
6922
+ ".gif": "image/gif",
6923
+ ".webp": "image/webp",
6924
+ ".svg": "image/svg+xml",
6925
+ ".zip": "application/zip",
6926
+ ".gz": "application/gzip",
6927
+ ".tar": "application/x-tar",
6928
+ ".parquet": "application/vnd.apache.parquet",
6929
+ ".wav": "audio/wav",
6930
+ ".mp3": "audio/mpeg",
6931
+ ".mp4": "video/mp4"
6932
+ };
6933
+ function contentTypeFor(name) {
6934
+ return CONTENT_TYPES[path8.extname(name).toLowerCase()] ?? "application/octet-stream";
6935
+ }
6936
+ function counting(report) {
6937
+ let seen = 0;
6938
+ return new Transform({
6939
+ transform(chunk, _encoding, callback) {
6940
+ seen += chunk.length;
6941
+ report(seen);
6942
+ callback(null, chunk);
6943
+ }
6944
+ });
6945
+ }
6946
+ async function putPresigned(uploadUrl, body, headers) {
6947
+ const res = await fetch(uploadUrl, {
6948
+ method: "PUT",
6949
+ headers: {
6950
+ "content-type": headers.contentType,
6951
+ "content-length": String(headers.contentLength),
6952
+ "x-amz-checksum-sha256": headers.sha256
6953
+ },
6954
+ body,
6955
+ // A streamed request body needs the half-duplex declaration (Node's fetch).
6956
+ duplex: "half"
6957
+ });
6958
+ if (!res.ok) throw new Error(`upload failed: storage answered HTTP ${res.status}: ${(await res.text()).slice(0, 300)}`);
6959
+ }
6960
+ async function uploadFile(options = {}, localPath, targetPath, upload = {}) {
6961
+ const stat = fs9.statSync(localPath);
6962
+ if (!stat.isFile()) throw new Error(`${localPath} is not a file`);
6963
+ if (stat.size === 0) throw new Error(`${localPath} is empty; the drive refuses zero-byte uploads`);
6964
+ const contentType = upload.contentType ?? contentTypeFor(localPath);
6965
+ const sha2562 = await sha256Base64(localPath);
6966
+ const target = drivePath(targetPath);
6967
+ const granted = await requestUpload(options, { path: target, contentLength: stat.size, contentType, sha256: sha2562, ...upload.overwrite ? { overwrite: true } : {} });
6968
+ try {
6969
+ const stream = fs9.createReadStream(localPath).pipe(counting((n) => upload.onProgress?.(n, stat.size)));
6970
+ await putPresigned(granted.uploadUrl, Readable.toWeb(stream), { contentType, contentLength: stat.size, sha256: sha2562 });
6971
+ } catch (error) {
6972
+ await confirmUpload(options, granted.fileId, false).catch(() => void 0);
6973
+ throw error;
6974
+ }
6975
+ const confirmed = await confirmUpload(options, granted.fileId, true);
6976
+ return { path: confirmed.path, fileId: granted.fileId, sizeBytes: stat.size, sha256: sha2562, contentType };
6977
+ }
6978
+ async function uploadBytes(options = {}, bytes, targetPath, upload = {}) {
6979
+ if (!bytes.length) throw new Error("nothing to upload: the content is empty");
6980
+ const target = drivePath(targetPath);
6981
+ const contentType = upload.contentType ?? contentTypeFor(target);
6982
+ const sha2562 = createHash7("sha256").update(bytes).digest("base64");
6983
+ const granted = await requestUpload(options, { path: target, contentLength: bytes.length, contentType, sha256: sha2562, ...upload.overwrite ? { overwrite: true } : {} });
6984
+ try {
6985
+ await putPresigned(granted.uploadUrl, new Uint8Array(bytes), { contentType, contentLength: bytes.length, sha256: sha2562 });
6986
+ } catch (error) {
6987
+ await confirmUpload(options, granted.fileId, false).catch(() => void 0);
6988
+ throw error;
6989
+ }
6990
+ const confirmed = await confirmUpload(options, granted.fileId, true);
6991
+ return { path: confirmed.path, fileId: granted.fileId, sizeBytes: bytes.length, sha256: sha2562, contentType };
6992
+ }
6993
+ async function deleteFile(options = {}, filePath) {
6994
+ return apiRequest(options, "DELETE", `${BASE}${qs({ path: drivePath(filePath) })}`);
6995
+ }
6996
+ async function moveFile(options = {}, fromPath, toPath) {
6997
+ return apiRequest(options, "POST", `${BASE}/move`, { fromPath: drivePath(fromPath), toPath: drivePath(toPath) });
6998
+ }
6999
+ async function createFolder(options = {}, folderPath) {
7000
+ return apiRequest(options, "POST", `${BASE}/folders`, { path: drivePath(folderPath) });
7001
+ }
7002
+ async function listFileConnectors(options = {}) {
7003
+ return apiRequest(options, "GET", `${BASE}/connectors`);
7004
+ }
7005
+ async function syncFileConnector(options = {}, connectorId) {
7006
+ return apiRequest(options, "POST", `${BASE}/connectors/sync`, { connectorId });
7007
+ }
7008
+
7009
+ // src/traces/index.ts
7010
+ var traces_exports = {};
7011
+ __export(traces_exports, {
7012
+ PAGE_LIMIT: () => PAGE_LIMIT2,
7013
+ exportTraces: () => exportTraces,
7014
+ getSession: () => getSession,
7015
+ getTrace: () => getTrace,
7016
+ iterateObservations: () => iterateObservations,
7017
+ iterateSessions: () => iterateSessions,
7018
+ iterateTraces: () => iterateTraces,
7019
+ listObservations: () => listObservations,
7020
+ listSessions: () => listSessions,
7021
+ listTraces: () => listTraces
7022
+ });
7023
+ init_worlds();
7024
+ var PAGE_LIMIT2 = 100;
7025
+ function qs2(params) {
7026
+ const search = new URLSearchParams();
7027
+ for (const [key, value] of Object.entries(params)) {
7028
+ if (value === void 0 || value === null || value === "") continue;
7029
+ if (Array.isArray(value)) for (const item of value) search.append(key, item);
7030
+ else search.set(key, String(value));
7031
+ }
7032
+ const text2 = search.toString();
7033
+ return text2 ? `?${text2}` : "";
7034
+ }
7035
+ async function listTraces(options = {}, filters = {}, page = {}) {
7036
+ const { tags, ...rest } = filters;
7037
+ return apiRequest(options, "GET", `/api/public/traces${qs2({ ...rest, tags, page: page.page ?? 1, limit: page.limit ?? 50, fields: page.fields })}`);
7038
+ }
7039
+ async function* iterateTraces(options = {}, filters = {}, limits = {}) {
7040
+ yield* paged((page) => listTraces(options, filters, { page, limit: PAGE_LIMIT2, fields: limits.fields }), limits.max);
7041
+ }
7042
+ async function getTrace(options = {}, traceId) {
7043
+ return apiRequest(options, "GET", `/api/public/traces/${encodeURIComponent(traceId)}`);
7044
+ }
7045
+ async function listObservations(options = {}, filters = {}, page = {}) {
7046
+ return apiRequest(options, "GET", `/api/public/observations${qs2({ ...filters, page: page.page ?? 1, limit: page.limit ?? 50 })}`);
7047
+ }
7048
+ async function* iterateObservations(options = {}, filters = {}, limits = {}) {
7049
+ yield* paged((page) => listObservations(options, filters, { page, limit: PAGE_LIMIT2 }), limits.max);
7050
+ }
7051
+ async function listSessions(options = {}, filters = {}, page = {}) {
7052
+ return apiRequest(options, "GET", `/api/public/sessions${qs2({ ...filters, page: page.page ?? 1, limit: page.limit ?? 50 })}`);
7053
+ }
7054
+ async function* iterateSessions(options = {}, filters = {}, limits = {}) {
7055
+ yield* paged((page) => listSessions(options, filters, { page, limit: PAGE_LIMIT2 }), limits.max);
7056
+ }
7057
+ async function getSession(options = {}, sessionId, detail = {}) {
7058
+ return apiRequest(options, "GET", `/api/public/sessions/${encodeURIComponent(sessionId)}${qs2({ includeIO: detail.includeIO ? "true" : void 0 })}`);
7059
+ }
7060
+ async function exportTraces(options = {}, filters = {}, exportOptions = {}, write) {
7061
+ const summary = { traces: 0, observations: 0 };
7062
+ const wantedType = exportOptions.type?.toUpperCase();
7063
+ for await (const trace5 of iterateTraces(options, filters, { max: exportOptions.max })) {
7064
+ let record = trace5;
7065
+ if (exportOptions.observations) {
7066
+ const detail = await getTrace(options, trace5.id);
7067
+ const observations = wantedType ? detail.observations.filter((o) => o.type?.toUpperCase() === wantedType) : detail.observations;
7068
+ summary.observations += observations.length;
7069
+ record = { ...detail, observations };
7070
+ }
7071
+ summary.traces++;
7072
+ write(record);
7073
+ }
7074
+ return summary;
7075
+ }
7076
+ async function* paged(fetchPage, max) {
7077
+ let yielded = 0;
7078
+ for (let page = 1; ; page++) {
7079
+ const answer = await fetchPage(page);
7080
+ for (const item of answer.data) {
7081
+ if (max !== void 0 && yielded >= max) return;
7082
+ yielded++;
7083
+ yield item;
7084
+ }
7085
+ const totalPages = answer.meta?.totalPages ?? (answer.data.length < PAGE_LIMIT2 ? page : page + 1);
7086
+ if (!answer.data.length || page >= totalPages) return;
7087
+ }
7088
+ }
7089
+
4101
7090
  // src/build/index.ts
4102
- import { createHash as createHash3 } from "crypto";
7091
+ import { createHash as createHash8 } from "crypto";
4103
7092
  function canonicalJson(value) {
4104
7093
  if (value === null || typeof value !== "object") {
4105
7094
  return JSON.stringify(value);
@@ -4110,8 +7099,8 @@ function canonicalJson(value) {
4110
7099
  const entries = Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
4111
7100
  return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${canonicalJson(v)}`).join(",")}}`;
4112
7101
  }
4113
- function sha256(text) {
4114
- return `sha256:${createHash3("sha256").update(text).digest("hex")}`;
7102
+ function sha256(text2) {
7103
+ return `sha256:${createHash8("sha256").update(text2).digest("hex")}`;
4115
7104
  }
4116
7105
  var registeredTools = /* @__PURE__ */ new Map();
4117
7106
  var registeredPrompts = /* @__PURE__ */ new Map();
@@ -4880,12 +7869,12 @@ async function* observeClaude(stream, options) {
4880
7869
  pendingTurnInput = "";
4881
7870
  }
4882
7871
  const childCtx = options.perTurn ? turnCtx : rootCtx;
4883
- let text = "";
7872
+ let text2 = "";
4884
7873
  const toolUses = [];
4885
7874
  for (const block of message.message?.content ?? []) {
4886
7875
  if (block?.type === "text") {
4887
7876
  finalText += block.text;
4888
- text += block.text;
7877
+ text2 += block.text;
4889
7878
  }
4890
7879
  if (block?.type === "tool_use") {
4891
7880
  toolUses.push({
@@ -4895,7 +7884,7 @@ async function* observeClaude(stream, options) {
4895
7884
  });
4896
7885
  }
4897
7886
  }
4898
- turnText += text;
7887
+ turnText += text2;
4899
7888
  const gen = tracer.startSpan(
4900
7889
  "assistant",
4901
7890
  {
@@ -4903,7 +7892,7 @@ async function* observeClaude(stream, options) {
4903
7892
  "openinference.span.kind": "LLM",
4904
7893
  "llm.model_name": model,
4905
7894
  "llm.provider": "anthropic",
4906
- "output.value": text || toolUses.map((t) => `\u2192 ${cleanToolName(t.name)}`).join(", ")
7895
+ "output.value": text2 || toolUses.map((t) => `\u2192 ${cleanToolName(t.name)}`).join(", ")
4907
7896
  }
4908
7897
  },
4909
7898
  childCtx
@@ -4983,12 +7972,18 @@ var tracing = {
4983
7972
  };
4984
7973
  export {
4985
7974
  AGENT_ID_KEY,
7975
+ BrowserActionRecorder,
7976
+ COMPUTER_USE_SPECS,
4986
7977
  DEFAULT_BRANCH,
4987
7978
  DEFAULT_TIMEOUT_SECONDS,
7979
+ DEFAULT_VIEWPORT,
4988
7980
  DriftError,
4989
7981
  ENV_GATEWAY_HOST,
4990
7982
  ENV_GATEWAY_PUBLIC_KEY,
4991
7983
  ENV_GATEWAY_SECRET_KEY,
7984
+ EVENT_BATCH_SIZE,
7985
+ EVENT_FLUSH_INTERVAL_MS,
7986
+ EVENT_MAX_RETRIES,
4992
7987
  EXPERIMENT_ATTRIBUTES,
4993
7988
  ExperimentClient,
4994
7989
  ExperimentSpanProcessor,
@@ -5013,44 +8008,57 @@ export {
5013
8008
  ReplayReport,
5014
8009
  ReplaySuite,
5015
8010
  ReplayTask,
8011
+ STRIP_PREFIX,
5016
8012
  SUCCESS_METRIC_NAME_KEY,
5017
8013
  SUCCESS_SIGNAL_KEY,
8014
+ SURFACE_KINDS,
5018
8015
  ScoreError,
5019
8016
  ScoresClient,
5020
8017
  SessionLoadError,
5021
8018
  SessionRecording,
5022
8019
  SessionTrace,
5023
8020
  StubMissError,
8021
+ TRANSFORMS,
5024
8022
  ToolStubRegistry,
5025
8023
  TraceDiff,
5026
8024
  UserProfileError,
5027
8025
  UsersClient,
8026
+ WHITESPACE,
8027
+ WorldBrowser,
5028
8028
  WorldSession,
5029
8029
  WorldSessionCallError,
5030
8030
  WorldSessionTimeout,
5031
8031
  WorldSet,
8032
+ WorldSurfaceUnavailable,
5032
8033
  WorldTask,
5033
8034
  addExperimentAttributes,
5034
8035
  apiRequest,
8036
+ applyTransforms,
5035
8037
  assembleManifest,
5036
8038
  assignVariant,
5037
8039
  attachSession,
5038
8040
  basicAuthHeader,
5039
8041
  buildSourceTarball,
5040
8042
  canonicalJson,
8043
+ captureToolCalls,
5041
8044
  clearExperimentContext,
5042
8045
  collectArchiveRelPaths,
5043
8046
  computeBuildHash,
5044
8047
  computeContentHash,
5045
8048
  computeHash,
8049
+ computerUseToolkit,
5046
8050
  context,
5047
8051
  createRef,
8052
+ createTask,
5048
8053
  currentTraceId,
5049
8054
  defineTool,
5050
8055
  deleteEnvSecret,
8056
+ deleteTask,
8057
+ describeWorld,
5051
8058
  detectProvenance,
5052
8059
  experimentContextStorage,
5053
8060
  singleton_exports as experiments,
8061
+ files_exports as files,
5054
8062
  gateway,
5055
8063
  getExperimentContext,
5056
8064
  getRegisteredArtifacts,
@@ -5058,43 +8066,79 @@ export {
5058
8066
  getRegisteredSkills,
5059
8067
  getRegisteredTools,
5060
8068
  getRun,
8069
+ getTask,
8070
+ hashForm,
5061
8071
  identify,
8072
+ ingest,
8073
+ ingestToolCalls,
5062
8074
  isIncludedInContentHash,
8075
+ isTaskIdRef,
8076
+ isTaskSpec,
5063
8077
  listEnvSecretKeys,
5064
8078
  listRunConfigs,
8079
+ listTasks,
5065
8080
  loadSession,
5066
8081
  localTreeState,
5067
8082
  memory,
8083
+ migrateProjectWorlds,
8084
+ migrateWorld,
8085
+ openBrowser,
5068
8086
  openSession,
5069
8087
  openWorld,
8088
+ parseToolCallRecord,
8089
+ parseTransform,
8090
+ parseWorldTaskRefs,
5070
8091
  personas,
8092
+ preserveForm,
5071
8093
  propose,
5072
8094
  pull,
5073
8095
  push,
8096
+ pyText,
8097
+ queryRows,
8098
+ queryRowsSearch,
5074
8099
  readLocalMeta,
8100
+ readToolCallRecords,
8101
+ redactActionArgs,
8102
+ redactionOf,
5075
8103
  registerArtifact,
5076
8104
  registerPrompt,
5077
8105
  registerSkill,
5078
8106
  renderAgentSystem,
5079
8107
  replay,
5080
8108
  resetBuildRegistry,
8109
+ resolveBrowserMode,
5081
8110
  resolveUserId,
8111
+ roundForm,
5082
8112
  runSessions,
5083
8113
  runSuite,
5084
8114
  runWithExperimentContext,
5085
8115
  schemaFromSignature,
5086
8116
  scores,
5087
8117
  sessionObservationFromApi,
8118
+ sessionToolObservations,
5088
8119
  sessions,
5089
8120
  setEnvSecret,
5090
8121
  setExperimentContext,
8122
+ shapeText,
5091
8123
  snapshotTreeHashes,
8124
+ storedForms,
5092
8125
  success,
5093
8126
  suite,
8127
+ surfaceKinds,
8128
+ taskLabel,
8129
+ toolCallRecordsIn,
8130
+ toolCallsFromObservations,
8131
+ traces_exports as traces,
5094
8132
  tracing,
8133
+ uiEntryUrl,
8134
+ uiUrl,
8135
+ updateTask,
8136
+ upsertRunConfig,
5095
8137
  users,
8138
+ validateTask,
5096
8139
  validateWorld,
5097
8140
  waitForRun,
8141
+ withoutUiToken,
5098
8142
  writeLocalMeta
5099
8143
  };
5100
8144
  //# sourceMappingURL=index.mjs.map