@withgateway/sdk 0.2.0 → 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.
- package/README.md +30 -6
- package/dist/cli.js +7815 -2406
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +7807 -2398
- package/dist/cli.mjs.map +1 -1
- package/dist/files/index.d.mts +2 -0
- package/dist/files/index.d.ts +2 -0
- package/dist/files/index.js +446 -0
- package/dist/files/index.js.map +1 -0
- package/dist/files/index.mjs +395 -0
- package/dist/files/index.mjs.map +1 -0
- package/dist/index-BgvvQ3BC.d.ts +170 -0
- package/dist/index-CLkMr6VG.d.ts +171 -0
- package/dist/index-CdbmO4aX.d.mts +171 -0
- package/dist/index-CiKWoroJ.d.mts +170 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2283 -116
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2255 -116
- package/dist/index.mjs.map +1 -1
- package/dist/traces/index.d.mts +2 -0
- package/dist/traces/index.d.ts +2 -0
- package/dist/traces/index.js +320 -0
- package/dist/traces/index.js.map +1 -0
- package/dist/traces/index.mjs +278 -0
- package/dist/traces/index.mjs.map +1 -0
- package/dist/tracing/index.js +16 -1
- package/dist/tracing/index.js.map +1 -1
- package/dist/tracing/index.mjs +16 -1
- package/dist/tracing/index.mjs.map +1 -1
- package/dist/worlds/index.d.mts +685 -1
- package/dist/worlds/index.d.ts +685 -1
- package/dist/worlds/index.js +1876 -32
- package/dist/worlds/index.js.map +1 -1
- package/dist/worlds/index.mjs +1875 -32
- package/dist/worlds/index.mjs.map +1 -1
- package/package.json +16 -1
- package/runtime/gatewaysdk/environment/_world.py +14 -1
- package/runtime/gatewaysdk/environment/schema/__init__.py +8 -0
- package/runtime/gatewaysdk/environment/schema/__main__.py +154 -19
- package/runtime/gatewaysdk/environment/schema/api.py +233 -37
- package/runtime/gatewaysdk/environment/schema/batch.py +38 -8
- package/runtime/gatewaysdk/environment/schema/compiler.py +89 -11
- package/runtime/gatewaysdk/environment/schema/conform.py +105 -13
- package/runtime/gatewaysdk/environment/schema/connector.py +442 -103
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/api/handlers.py +778 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/connector.toml +671 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/handlers.py +3 -2
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/parity.json +11 -5
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/provenance.json +1635 -100
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/instruction.md +7 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_activities.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_activity_devices.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_applecare_coverages.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_apps.json +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_audit_events.json +139 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_apps.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_configurations.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_devices.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_packages.json +8 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_user_groups.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprint_users.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_blueprints.json +39 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_configurations.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_device_assignments.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_mdm_device_details.json +55 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_mdm_devices.json +33 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_mdm_servers.json +56 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_org_devices.json +178 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_organizational_unit_memberships.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_organizational_units.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_packages.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_user_group_memberships.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_user_groups.json +30 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scenarios/default/seed/abm_users.json +115 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/scope.toml +49 -22
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/tests/tools.json +48 -0
- package/runtime/gatewaysdk/environment/schema/connectors/apple-business-manager/world.json +1180 -194
- package/runtime/gatewaysdk/environment/schema/connectors/asana/api/handlers.py +1026 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/connector.toml +511 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/fidelity.json +89 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/handlers.py +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/provenance.json +101 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/account_settings.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/custom_field_settings.json +60 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/custom_fields.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/enum_options.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/notifications.json +103 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/project_favorites.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/project_memberships.json +144 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/projects.json +120 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/recent_projects.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/sections.json +102 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/stories.json +852 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/task_custom_fields.json +508 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/task_followers.json +368 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/task_memberships.json +184 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/tasks.json +1921 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/teams.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/user_task_list_sections.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/user_task_lists.json +11 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/users.json +60 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/workspace_memberships.json +76 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scenarios/default/seed/workspaces.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/scope.toml +156 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/tests/routes.json +298 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/tests/tools.json +152 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/ui/static/assets/index-DTTTJ6a4.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/ui/static/assets/index-WS8dLEjv.js +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/ui/static/index.html +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/asana/world.json +1911 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/api/handlers.py +847 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/connector.toml +457 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/handlers.py +176 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/provenance.json +187 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/instruction.md +39 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/scenario.toml +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_favourites.json +29 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_footer_comments.json +984 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_inline_comments.json +355 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_labels.json +99 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_notifications.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_page_labels.json +209 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_page_versions.json +828 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_pages.json +949 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_recently_viewed_pages.json +59 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_sites.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_spaces.json +128 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_users.json +100 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/scenarios/default/seed/confluence_watches.json +96 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/tests/routes.json +212 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/tests/tools.json +140 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/tests/writes.json +201 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/assets/index-BWaOVdpn.js +70 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/assets/index-CKyfi3i5.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-01.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-02.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-03.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-04.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-05.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/acct-06.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-DES.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-ENG.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-OPS.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-ORB.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/avatars/space-PN.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/fonts/AtlassianMono-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/fonts/AtlassianSans-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/fonts/AtlassianSansItalic-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/ui/static/index.html +47 -0
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/world.json +1346 -0
- package/runtime/gatewaysdk/environment/schema/connectors/custom/provenance.json +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/custom/tests/tools.json +123 -0
- package/runtime/gatewaysdk/environment/schema/connectors/custom/world.json +112 -24
- package/runtime/gatewaysdk/environment/schema/connectors/github/api/handlers.py +2923 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/connector.toml +2091 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/provenance.json +109 -81
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/instruction.md +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_apps.json +49 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_artifacts.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_branches.json +443 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_check_runs.json +220 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_check_suites.json +404 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_code_scanning_alerts.json +126 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_collaborators.json +100 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_commit_comments.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_commit_statuses.json +80 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_commits.json +461 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_dependabot_alerts.json +168 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_deployment_statuses.json +86 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_deployments.json +94 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_environments.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_gist_comments.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_gists.json +118 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_git_refs.json +59 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_installations.json +54 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_issue_comments.json +151 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_issue_events.json +606 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_issue_types.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_issues.json +758 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_labels.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_licenses.json +54 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_milestones.json +130 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_organization_memberships.json +139 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_organizations.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_pull_requests.json +874 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_release_assets.json +45 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_releases.json +92 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_repositories.json +797 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_repository_invitations.json +184 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_review_comments.json +66 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_reviews.json +138 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_secret_scanning_alerts.json +50 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_stargazers.json +88 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_tags.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_team_memberships.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_team_repositories.json +258 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_teams.json +130 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_users.json +174 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_webhooks.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_workflow_jobs.json +115 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_workflow_runs.json +1021 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_workflows.json +30 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/scope.toml +501 -62
- package/runtime/gatewaysdk/environment/schema/connectors/github/tests/tools.json +79 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/vendor-openapi.json +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/github/world.json +14340 -4447
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/api/handlers.py +1413 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/connector.toml +630 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/handlers.py +136 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/scenario.toml +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/10-gmail_profiles.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/20-gmail_labels.json +205 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/30-gmail_contacts.json +234 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/40-gmail_threads.json +374 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/50-gmail_messages.json +1015 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/60-gmail_message_parts.json +3039 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/70-gmail_attachments.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/80-gmail_drafts.json +39 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/scenarios/default/seed/90-gmail_client_settings.json +103 -0
- package/runtime/gatewaysdk/environment/schema/connectors/gmail/world.json +784 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/api/handlers.py +454 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/connector.toml +519 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/provenance.json +229 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/instruction.md +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/scenario.toml +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/10-calendar_calendars.json +75 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/20-calendar_calendar_list_entries.json +115 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/30-calendar_acl_rules.json +124 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/40-calendar_events.json +810 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/50-calendar_settings.json +76 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/60-calendar_channels.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scenarios/default/seed/70-calendar_colors.json +48 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/scope.toml +105 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/tests/tools.json +53 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/vendor-openapi.json +4185 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-calendar/world.json +1255 -80
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/api/handlers.py +782 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/connector.toml +373 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/google-docs-types.json +4939 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/handlers.py +197 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/provenance.json +191 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/instruction.md +29 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_comments.json +50 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_documents.json +8096 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_files.json +1187 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_permissions.json +543 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_replies.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_revisions.json +643 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scenarios/default/seed/gdocs_users.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/scope.toml +148 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/tests/api.json +319 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/tests/tools.json +262 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/assets/index-BH9fmZSS.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/assets/index-CU4Fk9dX.js +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/README.md +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/google-sans-variable.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/roboto-italic-variable-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/roboto-variable-latin-ext.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/fonts/roboto-variable-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/icons/material_common_sprite1038_gm3_grey_medium.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/ui/static/index.html +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-docs/world.json +4489 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/api/handlers.py +466 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/connector.toml +626 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/handlers.py +42 -5
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/provenance.json +342 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/instruction.md +11 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_access_proposals.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_approvals.json +145 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_apps.json +81 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_comments.json +70 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_drives.json +71 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_files.json +700 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_labels.json +75 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_permissions.json +93 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_replies.json +66 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scenarios/default/seed/drive_revisions.json +82 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/scope.toml +126 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/tests/tools.json +101 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/vendor-openapi.json +6193 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/world.json +1972 -108
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/api/handlers.py +1645 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/connector.toml +414 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/handlers.py +200 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_cells.json +10252 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_charts.json +103 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_conditional_formats.json +138 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_dimensions.json +256 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_named_ranges.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_permissions.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_sheets.json +95 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_spreadsheets.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/scenarios/default/seed/gsheets_view_states.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/tests/page.json +311 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/tests/vendor.json +843 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/assets/index-CUpfKgm_.js +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/assets/index-D3VhwBIC.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSans-400.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSans-500.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSans-700.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSansText-400.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSansText-500.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/GoogleSansText-700.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/Roboto-400.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/Roboto-500.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/fonts/Roboto-700.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/ui/static/index.html +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-sheets/world.json +4029 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/api/handlers.py +800 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/connector.toml +776 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/handlers.py +226 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/instruction.md +11 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_accounts.json +17 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_associations.json +1478 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_calls.json +147 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_companies.json +144 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_contacts.json +284 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_deals.json +204 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_emails.json +160 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_meetings.json +147 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_nav_items.json +204 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_notes.json +160 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_notifications.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_object_views.json +334 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_owners.json +76 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_pipeline_stages.json +109 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_pipelines.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_properties.json +1220 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_tasks.json +394 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/scenarios/default/seed/hubspot_tickets.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/assets/index-hdb5vB78.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/assets/index-xhg5ASqE.js +68 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-300.ttf +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-400.ttf +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-500.ttf +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-600.ttf +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-700.ttf +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/fonts/lexend-deca-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/add.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/avatar.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/bell.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/breeze.svg +4 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/call.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/chevron-up.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/companies.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/contact.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/contacts.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/date.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/deals.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/duplicate.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/export.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/external-link.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/filter-lines.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/frame-expand.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/funnel.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/help.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/hierarchy.svg +4 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/home.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/hubspot-logo.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/info.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/kanban.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/marketing-email.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/marketplace.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/meetings.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/more.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/pencil.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/pin.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/prospecting.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/refresh.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/search.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/settings.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/sidebar-collapse.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/sort.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/table.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/tasks.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/thumbs-down.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/thumbs-up.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/undo.svg +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/upgrade-arrow.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/vertical-dots.svg +5 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/icons/workflows.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/ui/static/index.html +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/hubspot/world.json +1347 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/api/handlers.py +987 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/connector.toml +3057 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/provenance.json +9443 -129
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/scenario.toml +4 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_account_groups.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_accounts.json +58 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_advanced_computer_searches.json +139 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_advanced_mobile_device_searches.json +61 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_advanced_user_content_searches.json +61 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_advanced_user_searches.json +124 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_api_integrations.json +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_api_roles.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_app_request_form_input_fields.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_buildings.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_byo_profiles.json +46 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_categories.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_classes.json +217 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_cloud_idps.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computer_group_members.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computer_groups.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computer_invitations.json +82 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computer_prestages.json +274 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_computers.json +1537 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_configuration_profiles.json +649 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_departments.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_device_enrollment_devices.json +70 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_device_enrollments.json +46 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_directory_bindings.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_disk_encryption_configurations.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_distribution_points.json +91 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_dock_items.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_ebooks.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_enrollment_customizations.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_extension_attributes.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_ibeacons.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_inventory_preload_records.json +100 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_ios_branding_configurations.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_ldap_servers.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_licensed_software_records.json +244 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mac_applications.json +610 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_macos_branding_configurations.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_managed_software_update_plans.json +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mdm_commands.json +58 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_applications.json +700 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_configuration_profiles.json +652 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_enrollment_profiles.json +160 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_extension_attributes.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_group_members.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_groups.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_prestages.json +280 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_device_provisioning_profiles.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_mobile_devices.json +1558 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_network_segments.json +46 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_packages.json +118 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_patch_software_title_configurations.json +88 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_policies.json +1054 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_printers.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_removable_mac_addresses.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_restricted_software_titles.json +289 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_return_to_service_configurations.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_scripts.json +61 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_sites.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_software_update_servers.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_supervision_identities.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_user_extension_attributes.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_user_groups.json +112 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_users.json +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_volume_purchasing_locations.json +106 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_volume_purchasing_subscriptions.json +76 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_webhooks.json +70 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/scope.toml +839 -67
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/tests/tools.json +95 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/vendor-openapi.json +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jamf/world.json +10835 -1494
- package/runtime/gatewaysdk/environment/schema/connectors/jira/api/handlers.py +1056 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/connector.toml +955 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/handlers.py +73 -14
- package/runtime/gatewaysdk/environment/schema/connectors/jira/parity.json +27 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/provenance.json +166 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/instruction.md +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/scenario.toml +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_boards.json +61 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_changelogs.json +136 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_comments.json +205 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_components.json +78 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_fields.json +498 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_issue_link_types.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_issue_links.json +190 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_issue_types.json +44 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_issues.json +1448 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_priorities.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_project_categories.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_projects.json +111 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_resolutions.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_sprint_issues.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_sprints.json +39 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_status_categories.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_statuses.json +60 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_transitions.json +179 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_users.json +83 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_versions.json +30 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scenarios/default/seed/jira_worklogs.json +96 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/scope.toml +255 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/tests/tools.json +151 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/vendor-openapi.json +13562 -0
- package/runtime/gatewaysdk/environment/schema/connectors/jira/world.json +3381 -183
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/api/handlers.py +406 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/connector.toml +531 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/provenance.json +229 -46
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_blueprint_items.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_blueprint_template_categories.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_blueprint_templates.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_blueprints.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_custom_apps.json +45 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_custom_profiles.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_custom_scripts.json +27 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_activities.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_apps.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_commands.json +41 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_notes.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_parameters.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_device_tags.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_devices.json +122 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_in_house_apps.json +33 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_library_item_activities.json +33 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_library_item_statuses.json +98 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_library_items.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_self_service_categories.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_tags.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scenarios/default/seed/kandji_users.json +61 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/scope.toml +118 -39
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/tests/tools.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/vendor-openapi.json +5463 -0
- package/runtime/gatewaysdk/environment/schema/connectors/kandji/world.json +1257 -205
- package/runtime/gatewaysdk/environment/schema/connectors/linear/api/handlers.py +139 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/connector.toml +1574 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/handlers.py +8 -5
- package/runtime/gatewaysdk/environment/schema/connectors/linear/provenance.json +142 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/attachments.json +21 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/comments.json +79 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/customer_needs.json +21 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/customer_statuses.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/customer_tiers.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/customers.json +48 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/cycles.json +86 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/documents.json +27 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/initiative_projects.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/initiative_updates.json +23 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/initiatives.json +41 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/issue_labels.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/issue_relations.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/issues.json +264 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/labels.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/organizations.json +53 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_labels.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_members.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_milestones.json +30 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_relations.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_statuses.json +76 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/project_updates.json +42 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/projects.json +110 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/reactions.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/roadmap_projects.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/roadmaps.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/team_memberships.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/teams.json +114 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/templates.json +27 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/users.json +106 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/webhooks.json +21 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/workflow_states.json +108 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/scope.toml +87 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/tests/tools.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/linear/world.json +5957 -172
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/api/handlers.py +1218 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/connector.toml +1246 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/fidelity.json +49 -19
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/provenance.json +785 -4
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/instruction.md +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_async_operations.json +47 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channel_hosted_contents.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channel_members.json +88 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channel_messages.json +313 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channel_replies.json +128 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_channels.json +319 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chat_hosted_contents.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chat_members.json +155 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chat_messages.json +265 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chat_views.json +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_chats.json +167 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_incoming_channels.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_pinned_messages.json +9 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_reply_hosted_contents.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_shared_channel_teams.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_tag_members.json +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_tags.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_team_members.json +117 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scenarios/default/seed/teams_teams.json +193 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/scope.md +76 -4
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/teams-types.json +29 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/tests/routes.json +101 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/vendor-openapi.json +11280 -0
- package/runtime/gatewaysdk/environment/schema/connectors/microsoft-teams/world.json +74 -6
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/api/handlers.py +571 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/connector.toml +1484 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/parity.json +28 -1
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/provenance.json +215 -49
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/instruction.md +11 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_accounting_periods.json +107 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_accounts.json +514 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_classifications.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_contacts.json +90 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_credit_memos.json +112 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_currencies.json +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_customer_payments.json +108 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_customers.json +232 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_departments.json +80 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_employees.json +124 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_invoices.json +229 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_item_fulfillments.json +85 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_items.json +237 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_journal_entries.json +217 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_locations.json +62 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_price_levels.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_purchase_orders.json +152 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_sales_order_lines.json +235 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_sales_orders.json +219 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_subsidiaries.json +85 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_terms.json +48 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_vendor_bills.json +170 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scenarios/default/seed/netsuite_vendors.json +140 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/scope.toml +251 -33
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/tests/tools.json +82 -0
- package/runtime/gatewaysdk/environment/schema/connectors/netsuite/world.json +31065 -8232
- package/runtime/gatewaysdk/environment/schema/connectors/notion/api/handlers.py +1330 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/connector.toml +386 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/handlers.py +54 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/blocks.json +4197 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/calendar_events.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/collection_views.json +175 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/comments.json +109 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/databases.json +417 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/favorites.json +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/notifications.json +49 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/pages.json +3758 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/spaces.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/teamspaces.json +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/scenarios/default/seed/users.json +92 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/tests/01-reads.json +165 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/assets/index-DQ36W7RG.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/assets/index-DythuuUy.js +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000002.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000003.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000004.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000005.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000006.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000007.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/avatars/eeee0000000000000000000000000008.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/covers/dusk-harbor.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/covers/ember-coast.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/covers/green-ridge.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f30a.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f331.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f373.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3a7.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3a8.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3ac.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3af.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3c4.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3d6.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f3e0.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f44b.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4a1.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4b0.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4bc.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4c5.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4c8.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4cb.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4ce.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4d1.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4d3.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4d6.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4da.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4dd.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4ec.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f4f7.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f527.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f55b.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f5c2.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f5d3.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f680.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f6a2.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9ca.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9e0.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9ea.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9ed.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1f9f0.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/1fab6.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2600.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2693.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2705.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2708.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/270f.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/emoji/2b50.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/favicon.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/fonts/SourceSerif4-latin.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/index.html +31 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/learn/content-blocks.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/learn/databases.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/learn/sharing.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/learn/style-content.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/photos/home-icon.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/photos/viewer.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/ui/static/photos/workspace.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/notion/world.json +2796 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_admin_role_assignments.json +44 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_app_assignments.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_app_group_assignments.json +59 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_applications.json +265 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_console_dashboards.json +91 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_device_users.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_devices.json +89 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_group_memberships.json +156 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_groups.json +100 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_orgs.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_policies.json +84 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_system_log_events.json +9656 -0
- package/runtime/gatewaysdk/environment/schema/connectors/okta/scenarios/default/seed/okta_users.json +744 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/api/handlers.py +624 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/connector.toml +381 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/handlers.py +54 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/provenance.json +408 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/instruction.md +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_attachments.json +44 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_calendars.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_contacts.json +326 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_events.json +3050 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_mail_folders.json +84 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_mailbox_settings.json +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_mailboxes.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_messages.json +1400 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_system_senders.json +44 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/scenarios/default/seed/outlook_users.json +256 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/tests/routes.json +333 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/assets/index-DRVA5ahH.js +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/assets/index-kOnvVBhA.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/FluentSystemIcons-Filled.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/FluentSystemIcons-Regular.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/FluentSystemIcons-Resizable.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/controlIcons.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-bold.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-light.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-regular.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-semibold.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/fonts/segoeui-semilight.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/bookings.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/calendar.svg +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/copilot.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/excel.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/mail.svg +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/my-day.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/newsletters.svg +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/no-mail-selected-dark.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/no-mail-selected.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/onedrive.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/onenote.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/org-explorer.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/outlook.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/people.svg +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/powerpoint.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/ribbon-layout.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/sharepoint.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/teams-chat.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/teams.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/to-do.png +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/viva.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/img/word.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/ui/static/index.html +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/outlook/world.json +686 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/api/handlers.py +447 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/connector.toml +3478 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/handlers.py +695 -616
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/provenance.json +4254 -111
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/instruction.md +8 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_account_contact_relations.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_account_contact_roles.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_account_partners.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_account_team_members.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_accounts.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_assets.json +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_attachments.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_business_hours.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_campaign_member_statuses.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_campaign_members.json +38 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_campaigns.json +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_comments.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_histories.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_milestones.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_statuses.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_team_members.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_case_team_roles.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_cases.json +42 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_collaboration_group_members.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_collaboration_groups.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contact_point_addresses.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contact_point_emails.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contact_point_phones.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contacts.json +34 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_document_links.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_documents.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_folders.json +13 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_notes.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_versions.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_content_workspaces.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contract_contact_roles.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contract_line_items.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_contracts.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_dashboards.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_documents.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_email_message_relations.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_email_messages.json +21 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_email_templates.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_entitlements.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_events.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_feed_comments.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_feed_items.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_fiscal_year_settings.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_folders.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_group_members.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_groups.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_holidays.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_individuals.json +21 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_lead_statuses.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_leads.json +45 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_list_views.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_login_histories.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_milestone_types.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_notes.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_object_territory_associations.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunities.json +48 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_competitors.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_contact_roles.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_field_histories.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_histories.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_line_items.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_partners.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_stages.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_opportunity_team_members.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_order_items.json +33 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_orders.json +44 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_organizations.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_partners.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_periods.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_permission_set_assignments.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_permission_sets.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_pricebook_entries.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_pricebooks.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_products.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_profiles.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_queue_sobjects.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_quote_line_items.json +43 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_quotes.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_record_actions.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_record_types.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_reports.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_service_contracts.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_sla_processes.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_solutions.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_task_priorities.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_task_relations.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_task_statuses.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_tasks.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_territories.json +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_territory_models.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_territory_types.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_topic_assignments.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_topics.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_user_roles.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_user_territory_associations.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_users.json +57 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_web_links.json +26 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_work_order_line_items.json +42 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scenarios/default/seed/sf_work_orders.json +46 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/scope.toml +624 -104
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/tests/tools.json +69 -0
- package/runtime/gatewaysdk/environment/schema/connectors/salesforce/world.json +19222 -2654
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/api/handlers.py +630 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/connector.toml +266 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/handlers.py +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/provenance.json +245 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/instruction.md +15 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/scenario.toml +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/10-snow_users.json +268 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/11-snow_user_groups.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/20-snow_configuration_items.json +684 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/30-snow_catalog_categories.json +52 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/31-snow_catalog_items.json +334 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/40-snow_incidents.json +3086 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/41-snow_incident_tasks.json +54 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/42-snow_task_slas.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/43-snow_problems.json +148 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/44-snow_change_requests.json +364 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/45-snow_knowledge_articles.json +214 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/46-snow_journal_entries.json +1612 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/60-snow_ui_current_users.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/61-snow_ui_navigation_applications.json +187 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/62-snow_ui_home_widgets.json +91 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/63-snow_ui_notifications.json +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/64-snow_ui_employee_center_pages.json +74 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/65-snow_ui_list_layouts.json +54 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/66-snow_ui_search_facets.json +29 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/67-snow_ui_activity_entries.json +1076 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scenarios/default/seed/68-snow_ui_instances.json +9 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/scope.toml +166 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/tests/routes.json +272 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/assets/index-5QHcQLCI.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/assets/index-BzeVnzFt.js +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/cabin-400-700-italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/cabin-400-700.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-0-lato-v17-latin-ext_latin-100.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-1-lato-v17-latin-ext_latin-100.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-10-lato-v17-latin-ext_latin-italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-11-lato-v17-latin-ext_latin-italic.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-12-lato-v17-latin-ext_latin-700.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-13-lato-v17-latin-ext_latin-700.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-14-lato-v17-latin-ext_latin-700italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-15-lato-v17-latin-ext_latin-700italic.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-16-source-sans-pro-v11-latin-300.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-17-source-sans-pro-v11-latin-300.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-18-source-sans-pro-v11-latin-regular.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-19-source-sans-pro-v11-latin-regular.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-2-lato-v17-latin-ext_latin-100italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-20-source-sans-pro-v11-latin-600.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-21-source-sans-pro-v11-latin-600.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-22-source-sans-pro-v11-latin-700.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-23-source-sans-pro-v11-latin-700.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-3-lato-v17-latin-ext_latin-100italic.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-4-lato-v17-latin-ext_latin-300.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-5-lato-v17-latin-ext_latin-300.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-6-lato-v17-latin-ext_latin-300italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-7-lato-v17-latin-ext_latin-300italic.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-8-lato-v17-latin-ext_latin-regular.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/font-9-lato-v17-latin-ext_latin-regular.woff +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/index.json +122 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-300.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-600-italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-600.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-bold-italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-bold.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-normal-italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/fonts/lato-normal.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/appsee-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/arrow-up-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/available.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/bell-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/caret-down-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/check-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/chevron-right-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/circle-close-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/circle-info-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/circle-question-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/circleinfooutline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/ellipsis-v-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/eye-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-bell-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-caret-down-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-check-square.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-chevron-right.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-clock-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-comment-chat.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-external-link.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-facebook.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-heart-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-heart-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-home-fill-teal.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-home-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-linkedin.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-list-alt-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-pencil-square.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-question-circle-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-times.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/fa-twitter.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/filter-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/gear-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/globe-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/home-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/icon-2.svg +17 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/icon-3.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/icon-4.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/icon.svg +45 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/keyboard-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/link-icon-associated-to-view-all-adoption-blueprints.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/link-icon-associated-to-view-all-applications.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/list-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/loading-2.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/loading.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/magnifying-glass-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/ongoing-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/open-link-right-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/open-link-right-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/pencil-page-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/plus-fill.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/serverbox-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/servicenow-wordmark.svg +20 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/signal-live-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/square-arrow-left-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/star-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/sync-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/task-slas-related-list.svg +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/thumbtack-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/trending-downward.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/trending-neutral.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/unpinned-all-menu.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/unpinned-favorites-menu.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/unpinned-history-menu.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/icons/user-outline.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/adoption-blueprints.svg +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/avatar-admin.jpg +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/now-assist-admin.svg +17 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/quick-link-desk.jpg +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/quick-link-password.jpg +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/quick-link-status.jpg +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-accessories.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-computers.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-developer.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-email.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-phone.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-software-catalog.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-software.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/img/topic-technology.svg +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/ui/static/index.html +36 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/world.json +2004 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/MODEL.md +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/api/handlers.py +1880 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/capabilities.json +19 -2
- package/runtime/gatewaysdk/environment/schema/connectors/slack/connector.toml +892 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/provenance.json +65 -10
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/scenario.toml +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_apps.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_bookmarks.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_bots.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_channels.json +206 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_conversation_states.json +50 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_emojis.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_ephemeral_message_files.json +12 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_ephemeral_message_threads.json +11 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_ephemeral_messages.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_channel_observations.json +16 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_reaction_summaries.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_reaction_users.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_shares.json +29 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_file_user_states.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_files.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_memberships.json +79 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_message_files.json +18 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_message_threads.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_message_user_states.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_messages.json +127 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_pins.json +11 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_presence.json +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_reaction_summaries.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_reaction_users.json +32 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_scheduled_message_threads.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_scheduled_messages.json +15 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_unavailable_message_files.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_user_profile_fields.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_usergroup_channels.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_usergroup_memberships.json +14 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_usergroups.json +33 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_users.json +228 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_view_state_entries.json +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_views.json +53 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scenarios/default/seed/slack_workspaces.json +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/scope.toml +6 -2
- package/runtime/gatewaysdk/environment/schema/connectors/slack/tests/api.json +177 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/tests/test_threads.py +49 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/tests/tools.json +92 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/assets/index-BSqGskph.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/assets/index-CKQh1igo.js +81 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/README.md +15 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-black.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-bold.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-italic-black.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-italic-bold.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-italic-light.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-italic.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-light.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/lato-regular.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/fonts/slack-icons-v2.woff2 +0 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/ui/static/index.html +35 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/vendor-openapi.json +12515 -0
- package/runtime/gatewaysdk/environment/schema/connectors/slack/world.json +396 -8
- package/runtime/gatewaysdk/environment/schema/connectors/workday/api/handlers.py +175 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/connector.toml +610 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/parity.json +39 -6
- package/runtime/gatewaysdk/environment/schema/connectors/workday/provenance.json +253 -25
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/instruction.md +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/scenario.toml +2 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_compensations.json +219 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_job_profiles.json +76 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_locations.json +142 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_organizations.json +124 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_positions.json +280 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_absence_leaves.json +66 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_business_title_changes.json +44 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_check_in_topics.json +48 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_check_ins.json +46 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_countries.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_currencies.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_job_change_reasons.json +28 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_job_families.json +40 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_job_profiles.json +202 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_jobs.json +120 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_organization_types.json +19 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_organizations.json +24 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_persons.json +100 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_scorecard_results.json +57 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_scorecards.json +68 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_supervisory_organizations.json +64 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_time_off_details.json +112 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_time_off_entries.json +91 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_worker_history_events.json +58 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_rest_workers.json +90 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_time_off_requests.json +181 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scenarios/default/seed/workday_workers.json +492 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/scope.toml +178 -14
- package/runtime/gatewaysdk/environment/schema/connectors/workday/tests/tools.json +81 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/vendor-openapi.json +10646 -0
- package/runtime/gatewaysdk/environment/schema/connectors/workday/world.json +3787 -407
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/api/handlers.py +1183 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/connector.toml +645 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/handlers.py +377 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/instruction.md +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/scenario.toml +3 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_brands.json +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_group_memberships.json +49 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_groups.json +37 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_macros.json +154 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_organizations.json +65 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_ticket_audits.json +3328 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_ticket_comments.json +2642 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_tickets.json +1439 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_users.json +624 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_views.json +510 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/scenarios/default/seed/zendesk_workspace_tabs.json +10 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/ui/static/assets/index-JWq7XNO5.css +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/ui/static/assets/index-bn8ezNTi.js +67 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/ui/static/index.html +22 -0
- package/runtime/gatewaysdk/environment/schema/connectors/zendesk/world.json +1707 -0
- package/runtime/gatewaysdk/environment/schema/data.py +349 -35
- package/runtime/gatewaysdk/environment/schema/dependencies.py +235 -0
- package/runtime/gatewaysdk/environment/schema/extract.py +6 -6
- package/runtime/gatewaysdk/environment/schema/host.py +226 -62
- package/runtime/gatewaysdk/environment/schema/host_surfaces.py +62 -17
- package/runtime/gatewaysdk/environment/schema/ingest.py +528 -0
- package/runtime/gatewaysdk/environment/schema/local.py +536 -0
- package/runtime/gatewaysdk/environment/schema/mapping.py +944 -0
- package/runtime/gatewaysdk/environment/schema/platform.py +678 -202
- package/runtime/gatewaysdk/environment/schema/reconcile.py +202 -0
- package/runtime/gatewaysdk/environment/schema/redaction.py +378 -0
- package/runtime/gatewaysdk/environment/schema/scaffold.py +68 -7
- package/runtime/gatewaysdk/environment/schema/skill.py +1 -0
- package/runtime/gatewaysdk/environment/schema/skills/benchmarks-getting-started/SKILL.md +391 -0
- package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/CONNECTORS.md +64 -31
- package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/SKILL.md +86 -36
- package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/ROWS.md +20 -0
- package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +178 -11
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +184 -74
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +49 -0
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/ui-map.md +18 -0
- package/runtime/gatewaysdk/environment/schema/store.py +103 -3
- package/runtime/gatewaysdk/environment/schema/tasks.py +8 -3
- package/runtime/gatewaysdk/environment/schema/tools_world.py +424 -57
- package/runtime/gatewaysdk/environment/schema/transform.py +200 -0
- package/runtime/gatewaysdk/environment/schema/transforms.py +103 -0
- package/runtime/gatewaysdk/environment/schema/ui.py +455 -0
- package/runtime/gatewaysdk/environment/schema/ui_static/app.js +581 -0
- package/runtime/gatewaysdk/environment/schema/ui_static/index.html +72 -0
- package/runtime/gatewaysdk/environment/schema/validation.py +59 -12
- package/runtime/gatewaysdk/environment/schema/world_tests.py +245 -51
- package/skills/benchmarks-getting-started/SKILL.md +391 -0
- package/skills/connector-schema-authoring/CONNECTORS.md +64 -31
- package/skills/connector-schema-authoring/SKILL.md +86 -36
- package/skills/connector-schema-authoring/connector-worlds.md +355 -0
- package/skills/connector-schema-authoring/world-schema.md +620 -0
- package/skills/world-data-ingestion/ROWS.md +20 -0
- package/skills/world-data-ingestion/SKILL.md +178 -11
- package/skills/worlds-getting-started/SKILL.md +184 -74
- package/skills/worlds-getting-started/references/cli-mcp-map.md +49 -0
- package/skills/worlds-getting-started/references/ui-map.md +18 -0
package/dist/index.mjs
CHANGED
|
@@ -27,9 +27,9 @@ function surfaceKinds(s) {
|
|
|
27
27
|
if (s.browser) kinds.push("browser");
|
|
28
28
|
return kinds;
|
|
29
29
|
}
|
|
30
|
-
function uiUrl(ui,
|
|
30
|
+
function uiUrl(ui, path9) {
|
|
31
31
|
const base = ui.url.replace(/\/+$/, "");
|
|
32
|
-
const rel =
|
|
32
|
+
const rel = path9.startsWith("/") ? path9 : `/${path9}`;
|
|
33
33
|
if (!ui.token) return base + rel;
|
|
34
34
|
const [beforeHash, hash] = splitHash(rel);
|
|
35
35
|
const joiner = beforeHash.includes("?") ? "&" : "?";
|
|
@@ -113,12 +113,12 @@ async function openBrowser(surfaces, opts = {}) {
|
|
|
113
113
|
function computerUseToolkit(browser, opts = {}) {
|
|
114
114
|
const maxText = opts.maxText ?? 2e4;
|
|
115
115
|
const observe2 = async (selector = "body") => {
|
|
116
|
-
const
|
|
116
|
+
const text2 = await browser.text(selector);
|
|
117
117
|
return {
|
|
118
118
|
url: browser.url,
|
|
119
119
|
title: await browser.title(),
|
|
120
|
-
text:
|
|
121
|
-
truncated:
|
|
120
|
+
text: text2.slice(0, maxText),
|
|
121
|
+
truncated: text2.length > maxText
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
124
|
const impls = {
|
|
@@ -202,8 +202,8 @@ var init_browser = __esm({
|
|
|
202
202
|
}
|
|
203
203
|
resolveBase() {
|
|
204
204
|
if (this.base === null) {
|
|
205
|
-
const
|
|
206
|
-
this.base =
|
|
205
|
+
const resolve7 = this.opts.resumeFrom ?? (async () => 0);
|
|
206
|
+
this.base = resolve7().then((n) => {
|
|
207
207
|
if (!Number.isInteger(n) || n < 0)
|
|
208
208
|
throw new Error(
|
|
209
209
|
`browser event base seq must be a non-negative integer, got ${String(n)}`
|
|
@@ -404,11 +404,11 @@ var init_browser = __esm({
|
|
|
404
404
|
await this.settle();
|
|
405
405
|
});
|
|
406
406
|
}
|
|
407
|
-
async type(selector,
|
|
407
|
+
async type(selector, text2) {
|
|
408
408
|
await this.act(
|
|
409
409
|
"browser_type",
|
|
410
|
-
{ selector, text },
|
|
411
|
-
() => this.page.fill(selector,
|
|
410
|
+
{ selector, text: text2 },
|
|
411
|
+
() => this.page.fill(selector, text2)
|
|
412
412
|
);
|
|
413
413
|
}
|
|
414
414
|
async press(key) {
|
|
@@ -711,6 +711,11 @@ var init_session = __esm({
|
|
|
711
711
|
get taskName() {
|
|
712
712
|
return this.current.taskName;
|
|
713
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 ?? [];
|
|
718
|
+
}
|
|
714
719
|
/** The task this session runs: bundled scenario, stored task or inline
|
|
715
720
|
* spec, its name, hash and the caller's metadata. */
|
|
716
721
|
get taskInfo() {
|
|
@@ -742,20 +747,20 @@ var init_session = __esm({
|
|
|
742
747
|
}
|
|
743
748
|
/** Base URL of the world's own HTTP API for this session. */
|
|
744
749
|
async api() {
|
|
745
|
-
const { api } = await this.surfaces();
|
|
746
|
-
if (!
|
|
750
|
+
const { api: api2 } = await this.surfaces();
|
|
751
|
+
if (!api2)
|
|
747
752
|
throw new WorldSurfaceUnavailable(
|
|
748
753
|
"api",
|
|
749
754
|
"open the session with surfaces: ['api'] on an api-type world"
|
|
750
755
|
);
|
|
751
|
-
return
|
|
756
|
+
return api2.url;
|
|
752
757
|
}
|
|
753
758
|
/** Headers every request to `api()` needs. A World Host session gates its
|
|
754
759
|
* api surface on a per-session token; a pod or hosted twin answers with the
|
|
755
760
|
* world's own declared auth and this is `{}`. */
|
|
756
761
|
async apiHeaders() {
|
|
757
|
-
const { api } = await this.surfaces();
|
|
758
|
-
return
|
|
762
|
+
const { api: api2 } = await this.surfaces();
|
|
763
|
+
return api2?.token ? { Authorization: `Bearer ${api2.token}` } : {};
|
|
759
764
|
}
|
|
760
765
|
/** URL of the world's UI entry page for this session. */
|
|
761
766
|
async ui() {
|
|
@@ -784,18 +789,18 @@ var init_session = __esm({
|
|
|
784
789
|
}
|
|
785
790
|
/** The reporter `browser()` uses; exposed for a page you drive yourself. */
|
|
786
791
|
browserRecorder(agentId) {
|
|
787
|
-
const
|
|
792
|
+
const path9 = `/api/public/world-sessions/${encodeURIComponent(this.sessionId)}/browser-events`;
|
|
788
793
|
const id = agentId ?? process.env.GATEWAY_AGENT_ID ?? `agent-${randomUUID().replace(/-/g, "").slice(0, 8)}`;
|
|
789
794
|
return new BrowserActionRecorder(
|
|
790
795
|
async (events) => {
|
|
791
|
-
await apiRequest(this.options, "POST",
|
|
796
|
+
await apiRequest(this.options, "POST", path9, { events });
|
|
792
797
|
},
|
|
793
798
|
id,
|
|
794
799
|
{
|
|
795
800
|
// Continue this agent's timeline where the platform has it, so the
|
|
796
801
|
// same id reopened later never re-numbers from zero.
|
|
797
802
|
resumeFrom: async () => {
|
|
798
|
-
const summary = await apiRequest(this.options, "GET",
|
|
803
|
+
const summary = await apiRequest(this.options, "GET", path9);
|
|
799
804
|
return summary.agents.find((a) => a.agentId === id)?.nextSeq ?? 0;
|
|
800
805
|
}
|
|
801
806
|
}
|
|
@@ -852,7 +857,7 @@ var init_session = __esm({
|
|
|
852
857
|
const { callId } = enqueued;
|
|
853
858
|
const judged = enqueued.pending === true;
|
|
854
859
|
const budgetMs = timeoutMs ?? (judged ? JUDGED_GRADE_TIMEOUT_MS : CALL_TIMEOUT_MS);
|
|
855
|
-
const
|
|
860
|
+
const pollMs2 = judged ? JUDGED_GRADE_POLL_MS : CALL_POLL_MS;
|
|
856
861
|
const deadline = Date.now() + budgetMs;
|
|
857
862
|
for (; ; ) {
|
|
858
863
|
const call = await apiRequest(
|
|
@@ -868,7 +873,7 @@ var init_session = __esm({
|
|
|
868
873
|
throw new WorldSessionTimeout(
|
|
869
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.`
|
|
870
875
|
);
|
|
871
|
-
await sleep2(
|
|
876
|
+
await sleep2(pollMs2);
|
|
872
877
|
}
|
|
873
878
|
}
|
|
874
879
|
/**
|
|
@@ -943,8 +948,12 @@ var init_session = __esm({
|
|
|
943
948
|
*/
|
|
944
949
|
async seed(rows, opts = {}) {
|
|
945
950
|
const mode = opts.mode ?? "append";
|
|
951
|
+
const redact = opts.redact ?? "off";
|
|
946
952
|
return await this.exchange(
|
|
947
|
-
{
|
|
953
|
+
{
|
|
954
|
+
kind: "seed",
|
|
955
|
+
args: { mode, rows, ...redact !== "off" ? { redact } : {} }
|
|
956
|
+
},
|
|
948
957
|
opts.timeoutMs
|
|
949
958
|
);
|
|
950
959
|
}
|
|
@@ -1115,6 +1124,22 @@ var init_tasks = __esm({
|
|
|
1115
1124
|
});
|
|
1116
1125
|
|
|
1117
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
|
+
});
|
|
1118
1143
|
import { createHash as createHash2 } from "crypto";
|
|
1119
1144
|
import { gzipSync, gunzipSync } from "zlib";
|
|
1120
1145
|
import * as fs from "fs";
|
|
@@ -1252,8 +1277,8 @@ function localTreeState(dir) {
|
|
|
1252
1277
|
}
|
|
1253
1278
|
function readPyproject(dir) {
|
|
1254
1279
|
try {
|
|
1255
|
-
const
|
|
1256
|
-
const section = /\[project\]([\s\S]*?)(\n\[|$)/.exec(
|
|
1280
|
+
const text2 = fs.readFileSync(path.join(dir, "pyproject.toml"), "utf-8");
|
|
1281
|
+
const section = /\[project\]([\s\S]*?)(\n\[|$)/.exec(text2)?.[1] ?? "";
|
|
1257
1282
|
const name = /\bname\s*=\s*"([^"]+)"/.exec(section)?.[1];
|
|
1258
1283
|
const version = /\bversion\s*=\s*"([^"]+)"/.exec(section)?.[1];
|
|
1259
1284
|
return { name, version };
|
|
@@ -1261,6 +1286,17 @@ function readPyproject(dir) {
|
|
|
1261
1286
|
return {};
|
|
1262
1287
|
}
|
|
1263
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
|
+
}
|
|
1264
1300
|
function buildFileManifest(dir) {
|
|
1265
1301
|
const entries = [];
|
|
1266
1302
|
const walk = (rel) => {
|
|
@@ -1306,8 +1342,10 @@ async function push(dir, opts = {}) {
|
|
|
1306
1342
|
const baseVersionId = opts.baseVersionId ?? localMeta.versionId ?? null;
|
|
1307
1343
|
const contentHash = computeContentHash(dir);
|
|
1308
1344
|
const pyproject = readPyproject(dir);
|
|
1345
|
+
const contractVersion = pyproject.version ? void 0 : readWorldContractVersion(dir).version;
|
|
1346
|
+
if (contractVersion) pyproject.version = contractVersion;
|
|
1309
1347
|
const slug = opts.slug ?? pyproject.name ?? path.basename(path.resolve(dir));
|
|
1310
|
-
const
|
|
1348
|
+
const resolve7 = await apiRequest(
|
|
1311
1349
|
options,
|
|
1312
1350
|
"POST",
|
|
1313
1351
|
"/api/public/benchmark-containers/resolve",
|
|
@@ -1322,7 +1360,7 @@ async function push(dir, opts = {}) {
|
|
|
1322
1360
|
const tarball = buildSourceTarball(dir);
|
|
1323
1361
|
const bundleSha256 = sha256b64(tarball);
|
|
1324
1362
|
const version = await apiRequest(options, "POST", "/api/public/benchmark-containers/versions", {
|
|
1325
|
-
containerId:
|
|
1363
|
+
containerId: resolve7.containerId,
|
|
1326
1364
|
contentHash,
|
|
1327
1365
|
bundleSha256,
|
|
1328
1366
|
bundleSizeBytes: tarball.length,
|
|
@@ -1355,7 +1393,7 @@ async function push(dir, opts = {}) {
|
|
|
1355
1393
|
baseFiles: snapshotTreeHashes(dir)
|
|
1356
1394
|
});
|
|
1357
1395
|
return {
|
|
1358
|
-
containerId:
|
|
1396
|
+
containerId: resolve7.containerId,
|
|
1359
1397
|
slug,
|
|
1360
1398
|
versionId: version.versionId,
|
|
1361
1399
|
contentHash,
|
|
@@ -1678,6 +1716,1755 @@ var init_validate = __esm({
|
|
|
1678
1716
|
}
|
|
1679
1717
|
});
|
|
1680
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
|
+
}
|
|
3009
|
+
}
|
|
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 } : {}
|
|
3190
|
+
});
|
|
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;
|
|
3261
|
+
try {
|
|
3262
|
+
item = JSON.parse(line);
|
|
3263
|
+
} catch {
|
|
3264
|
+
throw new Error(`${where}:${index + 1} is not JSON`);
|
|
3265
|
+
}
|
|
3266
|
+
if (!isObject2(item)) throw new Error(`${where}:${index + 1} is not an object`);
|
|
3267
|
+
records.push(item);
|
|
3268
|
+
}
|
|
3269
|
+
return records;
|
|
3270
|
+
}
|
|
3271
|
+
async function emit(sink, record) {
|
|
3272
|
+
if (Array.isArray(sink)) {
|
|
3273
|
+
sink.push(record);
|
|
3274
|
+
return;
|
|
3275
|
+
}
|
|
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;
|
|
3310
|
+
try {
|
|
3311
|
+
return JSON.parse(value);
|
|
3312
|
+
} catch {
|
|
3313
|
+
return value;
|
|
3314
|
+
}
|
|
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;
|
|
3322
|
+
};
|
|
3323
|
+
for (const observation of observations) {
|
|
3324
|
+
if (observation.type !== "TOOL") {
|
|
3325
|
+
skip(`type ${observation.type ?? "unknown"}`);
|
|
3326
|
+
continue;
|
|
3327
|
+
}
|
|
3328
|
+
const tool = observation.name;
|
|
3329
|
+
if (typeof tool !== "string" || !tool) {
|
|
3330
|
+
skip("no name");
|
|
3331
|
+
continue;
|
|
3332
|
+
}
|
|
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);
|
|
3350
|
+
}
|
|
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 } : {}
|
|
3426
|
+
};
|
|
3427
|
+
}
|
|
3428
|
+
function reportOf(world, local, redact) {
|
|
3429
|
+
return {
|
|
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 } : {}
|
|
3445
|
+
};
|
|
3446
|
+
}
|
|
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"() {
|
|
3461
|
+
"use strict";
|
|
3462
|
+
init_worlds();
|
|
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;
|
|
3465
|
+
}
|
|
3466
|
+
});
|
|
3467
|
+
|
|
1681
3468
|
// src/worlds/index.ts
|
|
1682
3469
|
var worlds_exports = {};
|
|
1683
3470
|
__export(worlds_exports, {
|
|
@@ -1688,7 +3475,10 @@ __export(worlds_exports, {
|
|
|
1688
3475
|
EVENT_BATCH_SIZE: () => EVENT_BATCH_SIZE,
|
|
1689
3476
|
EVENT_FLUSH_INTERVAL_MS: () => EVENT_FLUSH_INTERVAL_MS,
|
|
1690
3477
|
EVENT_MAX_RETRIES: () => EVENT_MAX_RETRIES,
|
|
3478
|
+
STRIP_PREFIX: () => STRIP_PREFIX,
|
|
1691
3479
|
SURFACE_KINDS: () => SURFACE_KINDS,
|
|
3480
|
+
TRANSFORMS: () => TRANSFORMS,
|
|
3481
|
+
WHITESPACE: () => WHITESPACE,
|
|
1692
3482
|
WorldBrowser: () => WorldBrowser,
|
|
1693
3483
|
WorldSession: () => WorldSession,
|
|
1694
3484
|
WorldSessionCallError: () => WorldSessionCallError,
|
|
@@ -1697,8 +3487,10 @@ __export(worlds_exports, {
|
|
|
1697
3487
|
WorldSurfaceUnavailable: () => WorldSurfaceUnavailable,
|
|
1698
3488
|
WorldTask: () => WorldTask,
|
|
1699
3489
|
apiRequest: () => apiRequest,
|
|
3490
|
+
applyTransforms: () => applyTransforms,
|
|
1700
3491
|
attachSession: () => attachSession,
|
|
1701
3492
|
buildSourceTarball: () => buildSourceTarball,
|
|
3493
|
+
captureToolCalls: () => captureToolCalls,
|
|
1702
3494
|
collectArchiveRelPaths: () => collectArchiveRelPaths,
|
|
1703
3495
|
computeContentHash: () => computeContentHash,
|
|
1704
3496
|
computerUseToolkit: () => computerUseToolkit,
|
|
@@ -1706,9 +3498,13 @@ __export(worlds_exports, {
|
|
|
1706
3498
|
createTask: () => createTask,
|
|
1707
3499
|
deleteEnvSecret: () => deleteEnvSecret,
|
|
1708
3500
|
deleteTask: () => deleteTask,
|
|
3501
|
+
describeWorld: () => describeWorld,
|
|
1709
3502
|
detectProvenance: () => detectProvenance,
|
|
1710
3503
|
getRun: () => getRun,
|
|
1711
3504
|
getTask: () => getTask,
|
|
3505
|
+
hashForm: () => hashForm,
|
|
3506
|
+
ingest: () => ingest,
|
|
3507
|
+
ingestToolCalls: () => ingestToolCalls,
|
|
1712
3508
|
isIncludedInContentHash: () => isIncludedInContentHash,
|
|
1713
3509
|
isTaskIdRef: () => isTaskIdRef,
|
|
1714
3510
|
isTaskSpec: () => isTaskSpec,
|
|
@@ -1716,22 +3512,38 @@ __export(worlds_exports, {
|
|
|
1716
3512
|
listRunConfigs: () => listRunConfigs,
|
|
1717
3513
|
listTasks: () => listTasks,
|
|
1718
3514
|
localTreeState: () => localTreeState,
|
|
3515
|
+
migrateProjectWorlds: () => migrateProjectWorlds,
|
|
3516
|
+
migrateWorld: () => migrateWorld,
|
|
1719
3517
|
openBrowser: () => openBrowser,
|
|
1720
3518
|
openSession: () => openSession,
|
|
1721
3519
|
openWorld: () => openWorld,
|
|
3520
|
+
parseToolCallRecord: () => parseToolCallRecord,
|
|
3521
|
+
parseTransform: () => parseTransform,
|
|
1722
3522
|
parseWorldTaskRefs: () => parseWorldTaskRefs,
|
|
3523
|
+
preserveForm: () => preserveForm,
|
|
1723
3524
|
propose: () => propose,
|
|
1724
3525
|
pull: () => pull,
|
|
1725
3526
|
push: () => push,
|
|
3527
|
+
pyText: () => pyText,
|
|
3528
|
+
queryRows: () => queryRows,
|
|
3529
|
+
queryRowsSearch: () => queryRowsSearch,
|
|
1726
3530
|
readLocalMeta: () => readLocalMeta,
|
|
3531
|
+
readToolCallRecords: () => readToolCallRecords,
|
|
1727
3532
|
redactActionArgs: () => redactActionArgs,
|
|
3533
|
+
redactionOf: () => redactionOf,
|
|
1728
3534
|
resolveBrowserMode: () => resolveBrowserMode,
|
|
3535
|
+
roundForm: () => roundForm,
|
|
1729
3536
|
runSessions: () => runSessions,
|
|
1730
3537
|
schemaFromSignature: () => schemaFromSignature,
|
|
3538
|
+
sessionToolObservations: () => sessionToolObservations,
|
|
1731
3539
|
setEnvSecret: () => setEnvSecret,
|
|
3540
|
+
shapeText: () => shapeText,
|
|
1732
3541
|
snapshotTreeHashes: () => snapshotTreeHashes,
|
|
3542
|
+
storedForms: () => storedForms,
|
|
1733
3543
|
surfaceKinds: () => surfaceKinds,
|
|
1734
3544
|
taskLabel: () => taskLabel,
|
|
3545
|
+
toolCallRecordsIn: () => toolCallRecordsIn,
|
|
3546
|
+
toolCallsFromObservations: () => toolCallsFromObservations,
|
|
1735
3547
|
uiEntryUrl: () => uiEntryUrl,
|
|
1736
3548
|
uiUrl: () => uiUrl,
|
|
1737
3549
|
updateTask: () => updateTask,
|
|
@@ -1753,9 +3565,9 @@ function resolveEnv(options) {
|
|
|
1753
3565
|
}
|
|
1754
3566
|
return { host: host.replace(/\/+$/, ""), publicKey, secretKey };
|
|
1755
3567
|
}
|
|
1756
|
-
async function apiRequest(options, method,
|
|
3568
|
+
async function apiRequest(options, method, path9, body) {
|
|
1757
3569
|
const { host, publicKey, secretKey } = resolveEnv(options);
|
|
1758
|
-
const res = await fetch(`${host}${
|
|
3570
|
+
const res = await fetch(`${host}${path9}`, {
|
|
1759
3571
|
method,
|
|
1760
3572
|
headers: {
|
|
1761
3573
|
"content-type": "application/json",
|
|
@@ -1763,13 +3575,13 @@ async function apiRequest(options, method, path2, body) {
|
|
|
1763
3575
|
},
|
|
1764
3576
|
...body === void 0 ? {} : { body: JSON.stringify(body) }
|
|
1765
3577
|
});
|
|
1766
|
-
const
|
|
3578
|
+
const text2 = await res.text();
|
|
1767
3579
|
if (!res.ok) {
|
|
1768
3580
|
throw new Error(
|
|
1769
|
-
`${method} ${
|
|
3581
|
+
`${method} ${path9} -> ${res.status}: ${text2.slice(0, 400)}`
|
|
1770
3582
|
);
|
|
1771
3583
|
}
|
|
1772
|
-
return JSON.parse(
|
|
3584
|
+
return JSON.parse(text2);
|
|
1773
3585
|
}
|
|
1774
3586
|
async function setEnvSecret(slug, key, value, options = {}) {
|
|
1775
3587
|
return apiRequest(
|
|
@@ -1850,7 +3662,7 @@ async function waitForRun(runId, opts = {}) {
|
|
|
1850
3662
|
);
|
|
1851
3663
|
opts.onTick?.(run);
|
|
1852
3664
|
await new Promise(
|
|
1853
|
-
(
|
|
3665
|
+
(resolve7) => setTimeout(resolve7, (opts.intervalSeconds ?? 20) * 1e3)
|
|
1854
3666
|
);
|
|
1855
3667
|
}
|
|
1856
3668
|
}
|
|
@@ -1929,6 +3741,12 @@ var init_worlds = __esm({
|
|
|
1929
3741
|
init_browser();
|
|
1930
3742
|
init_hub();
|
|
1931
3743
|
init_validate();
|
|
3744
|
+
init_describe();
|
|
3745
|
+
init_redaction();
|
|
3746
|
+
init_transforms();
|
|
3747
|
+
init_query();
|
|
3748
|
+
init_migrate();
|
|
3749
|
+
init_ingest();
|
|
1932
3750
|
WorldTask = class {
|
|
1933
3751
|
constructor(world, name, variant) {
|
|
1934
3752
|
this.world = world;
|
|
@@ -1999,7 +3817,7 @@ var require_package = __commonJS({
|
|
|
1999
3817
|
"package.json"(exports, module) {
|
|
2000
3818
|
module.exports = {
|
|
2001
3819
|
name: "@withgateway/sdk",
|
|
2002
|
-
version: "0.2.
|
|
3820
|
+
version: "0.2.1",
|
|
2003
3821
|
description: "Gateway SDK for TypeScript - A/B experiments, tracing, and observability",
|
|
2004
3822
|
main: "./dist/index.js",
|
|
2005
3823
|
module: "./dist/index.mjs",
|
|
@@ -2064,6 +3882,21 @@ var require_package = __commonJS({
|
|
|
2064
3882
|
types: "./dist/worlds/index.d.ts",
|
|
2065
3883
|
import: "./dist/worlds/index.mjs",
|
|
2066
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"
|
|
2067
3900
|
}
|
|
2068
3901
|
},
|
|
2069
3902
|
files: [
|
|
@@ -2431,9 +4264,9 @@ var ExperimentClient = class {
|
|
|
2431
4264
|
})
|
|
2432
4265
|
});
|
|
2433
4266
|
if (!response.ok) {
|
|
2434
|
-
const
|
|
4267
|
+
const text2 = await response.text();
|
|
2435
4268
|
throw new Error(
|
|
2436
|
-
`Failed to sync experiment: ${response.status} ${response.statusText} - ${
|
|
4269
|
+
`Failed to sync experiment: ${response.status} ${response.statusText} - ${text2}`
|
|
2437
4270
|
);
|
|
2438
4271
|
}
|
|
2439
4272
|
console.log(`[gateway] Synced experiment '${config.key}' to backend`);
|
|
@@ -2743,8 +4576,8 @@ var GatewayContext = class _GatewayContext {
|
|
|
2743
4576
|
}
|
|
2744
4577
|
return resolved;
|
|
2745
4578
|
}
|
|
2746
|
-
async requestJson(method,
|
|
2747
|
-
const response = await fetch(`${this.host}${
|
|
4579
|
+
async requestJson(method, path9, payload) {
|
|
4580
|
+
const response = await fetch(`${this.host}${path9}`, {
|
|
2748
4581
|
method,
|
|
2749
4582
|
headers: {
|
|
2750
4583
|
Authorization: this.authHeader(),
|
|
@@ -2752,10 +4585,10 @@ var GatewayContext = class _GatewayContext {
|
|
|
2752
4585
|
},
|
|
2753
4586
|
...payload ? { body: JSON.stringify(payload) } : {}
|
|
2754
4587
|
});
|
|
2755
|
-
const
|
|
2756
|
-
const body =
|
|
4588
|
+
const text2 = await response.text();
|
|
4589
|
+
const body = text2 ? safeJson(text2) : {};
|
|
2757
4590
|
if (!response.ok) {
|
|
2758
|
-
const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${
|
|
4591
|
+
const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${path9}`;
|
|
2759
4592
|
if (response.status === 409) {
|
|
2760
4593
|
throw new GatewayContextConflictError(
|
|
2761
4594
|
message,
|
|
@@ -2764,7 +4597,7 @@ var GatewayContext = class _GatewayContext {
|
|
|
2764
4597
|
}
|
|
2765
4598
|
throw new GatewayContextError(message);
|
|
2766
4599
|
}
|
|
2767
|
-
this.log("%s %s -> %s", method,
|
|
4600
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
2768
4601
|
return body;
|
|
2769
4602
|
}
|
|
2770
4603
|
authHeader() {
|
|
@@ -2871,11 +4704,11 @@ function primaryPathForKind(kind, snapshot) {
|
|
|
2871
4704
|
const preferred = kind === "agent" ? "AGENTS.md" : kind === "prompt" ? "PROMPT.md" : kind === "skill" ? "SKILL.md" : "MEMORY.md";
|
|
2872
4705
|
if (readFile(snapshot, preferred)) return preferred;
|
|
2873
4706
|
return Object.entries(snapshot.files).find(
|
|
2874
|
-
([
|
|
4707
|
+
([path9, entry]) => entry.type === "file" && path9.endsWith(".md")
|
|
2875
4708
|
)?.[0] ?? null;
|
|
2876
4709
|
}
|
|
2877
|
-
function parseJsonFile(snapshot,
|
|
2878
|
-
const content = readFile(snapshot,
|
|
4710
|
+
function parseJsonFile(snapshot, path9) {
|
|
4711
|
+
const content = readFile(snapshot, path9);
|
|
2879
4712
|
if (!content) return {};
|
|
2880
4713
|
try {
|
|
2881
4714
|
const parsed = JSON.parse(content);
|
|
@@ -2884,8 +4717,8 @@ function parseJsonFile(snapshot, path2) {
|
|
|
2884
4717
|
return {};
|
|
2885
4718
|
}
|
|
2886
4719
|
}
|
|
2887
|
-
function readFile(snapshot,
|
|
2888
|
-
const entry = snapshot.files[
|
|
4720
|
+
function readFile(snapshot, path9) {
|
|
4721
|
+
const entry = snapshot.files[path9];
|
|
2889
4722
|
return entry?.type === "file" ? entry.content : null;
|
|
2890
4723
|
}
|
|
2891
4724
|
function provenanceFor(snapshot, label) {
|
|
@@ -2987,16 +4820,16 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
2987
4820
|
`/api/public/context/memory/${encodeIdentifier2(identifier)}${suffix}`
|
|
2988
4821
|
);
|
|
2989
4822
|
}
|
|
2990
|
-
async read(target,
|
|
4823
|
+
async read(target, path9, options = {}) {
|
|
2991
4824
|
const snapshot = typeof target === "string" ? await this.pull(target, options) : target;
|
|
2992
|
-
const file = snapshot.files[
|
|
4825
|
+
const file = snapshot.files[path9];
|
|
2993
4826
|
return file?.type === "file" ? file.content : null;
|
|
2994
4827
|
}
|
|
2995
|
-
async write(target,
|
|
4828
|
+
async write(target, path9, content, options = {}) {
|
|
2996
4829
|
const snapshot = typeof target === "string" ? await this.pull(target) : target;
|
|
2997
4830
|
return this.push(snapshot.repo.repoHandle, {
|
|
2998
4831
|
files: {
|
|
2999
|
-
[
|
|
4832
|
+
[path9]: {
|
|
3000
4833
|
content,
|
|
3001
4834
|
...options.mimeType ? { mimeType: options.mimeType } : {}
|
|
3002
4835
|
}
|
|
@@ -3006,10 +4839,10 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3006
4839
|
...runtimeContextPayload2(options)
|
|
3007
4840
|
});
|
|
3008
4841
|
}
|
|
3009
|
-
async delete(target,
|
|
4842
|
+
async delete(target, path9, options = {}) {
|
|
3010
4843
|
const snapshot = typeof target === "string" ? await this.pull(target) : target;
|
|
3011
4844
|
return this.push(snapshot.repo.repoHandle, {
|
|
3012
|
-
files: { [
|
|
4845
|
+
files: { [path9]: null },
|
|
3013
4846
|
parentCommit: options.parentCommit ?? snapshot.commit.commitHash,
|
|
3014
4847
|
message: options.message,
|
|
3015
4848
|
...runtimeContextPayload2(options)
|
|
@@ -3022,8 +4855,8 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3022
4855
|
payload
|
|
3023
4856
|
);
|
|
3024
4857
|
}
|
|
3025
|
-
async requestJson(method,
|
|
3026
|
-
const response = await fetch(`${this.host}${
|
|
4858
|
+
async requestJson(method, path9, payload) {
|
|
4859
|
+
const response = await fetch(`${this.host}${path9}`, {
|
|
3027
4860
|
method,
|
|
3028
4861
|
headers: {
|
|
3029
4862
|
Authorization: this.authHeader(),
|
|
@@ -3031,10 +4864,10 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3031
4864
|
},
|
|
3032
4865
|
...payload ? { body: JSON.stringify(payload) } : {}
|
|
3033
4866
|
});
|
|
3034
|
-
const
|
|
3035
|
-
const body =
|
|
4867
|
+
const text2 = await response.text();
|
|
4868
|
+
const body = text2 ? safeJson2(text2) : {};
|
|
3036
4869
|
if (!response.ok) {
|
|
3037
|
-
const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${
|
|
4870
|
+
const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${path9}`;
|
|
3038
4871
|
if (response.status === 409) {
|
|
3039
4872
|
throw new GatewayMemoryConflictError(
|
|
3040
4873
|
message,
|
|
@@ -3043,7 +4876,7 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3043
4876
|
}
|
|
3044
4877
|
throw new GatewayMemoryError(message);
|
|
3045
4878
|
}
|
|
3046
|
-
this.log("%s %s -> %s", method,
|
|
4879
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
3047
4880
|
return body;
|
|
3048
4881
|
}
|
|
3049
4882
|
authHeader() {
|
|
@@ -3205,10 +5038,10 @@ var PersonasClient = class _PersonasClient {
|
|
|
3205
5038
|
done: Boolean(payload.done)
|
|
3206
5039
|
};
|
|
3207
5040
|
}
|
|
3208
|
-
async requestJson(method,
|
|
5041
|
+
async requestJson(method, path9, payload) {
|
|
3209
5042
|
let response;
|
|
3210
5043
|
try {
|
|
3211
|
-
response = await fetch(`${this.host}${
|
|
5044
|
+
response = await fetch(`${this.host}${path9}`, {
|
|
3212
5045
|
method,
|
|
3213
5046
|
headers: {
|
|
3214
5047
|
Authorization: this.authHeader(),
|
|
@@ -3219,19 +5052,19 @@ var PersonasClient = class _PersonasClient {
|
|
|
3219
5052
|
});
|
|
3220
5053
|
} catch (error) {
|
|
3221
5054
|
const reason = error instanceof Error ? error.message : String(error);
|
|
3222
|
-
throw new PersonaError(`${method} ${
|
|
5055
|
+
throw new PersonaError(`${method} ${path9} failed: ${reason}`, {
|
|
3223
5056
|
cause: error
|
|
3224
5057
|
});
|
|
3225
5058
|
}
|
|
3226
|
-
const
|
|
5059
|
+
const text2 = await response.text();
|
|
3227
5060
|
if (!response.ok) {
|
|
3228
|
-
const detail =
|
|
5061
|
+
const detail = text2.slice(0, 500);
|
|
3229
5062
|
throw new PersonaError(
|
|
3230
|
-
`${method} ${
|
|
5063
|
+
`${method} ${path9} failed (${response.status}): ${detail}`
|
|
3231
5064
|
);
|
|
3232
5065
|
}
|
|
3233
|
-
this.log("%s %s -> %s", method,
|
|
3234
|
-
return safeJson3(
|
|
5066
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
5067
|
+
return safeJson3(text2);
|
|
3235
5068
|
}
|
|
3236
5069
|
authHeader() {
|
|
3237
5070
|
return `Basic ${Buffer.from(`${this.publicKey}:${this.secretKey}`).toString(
|
|
@@ -3455,10 +5288,10 @@ var SessionRecording = class _SessionRecording {
|
|
|
3455
5288
|
};
|
|
3456
5289
|
}
|
|
3457
5290
|
/** Dump the full session as a JSON fixture (for regression tests). */
|
|
3458
|
-
toFixture(
|
|
3459
|
-
mkdirSync(dirname(
|
|
3460
|
-
writeFileSync(
|
|
3461
|
-
return
|
|
5291
|
+
toFixture(path9) {
|
|
5292
|
+
mkdirSync(dirname(path9), { recursive: true });
|
|
5293
|
+
writeFileSync(path9, JSON.stringify(this.toJSON(), null, 2), "utf-8");
|
|
5294
|
+
return path9;
|
|
3462
5295
|
}
|
|
3463
5296
|
static fromApi(raw) {
|
|
3464
5297
|
return new _SessionRecording({
|
|
@@ -3499,15 +5332,15 @@ async function loadSession(sessionId, options = {}) {
|
|
|
3499
5332
|
if (response.status === 404) {
|
|
3500
5333
|
throw new SessionLoadError(`Session not found: ${sessionId}`);
|
|
3501
5334
|
}
|
|
3502
|
-
const
|
|
5335
|
+
const text2 = await response.text();
|
|
3503
5336
|
if (!response.ok) {
|
|
3504
5337
|
throw new SessionLoadError(
|
|
3505
|
-
`Failed to load session ${sessionId}: HTTP ${response.status} \u2014 ${
|
|
5338
|
+
`Failed to load session ${sessionId}: HTTP ${response.status} \u2014 ${text2.slice(0, 300)}`
|
|
3506
5339
|
);
|
|
3507
5340
|
}
|
|
3508
5341
|
let payload;
|
|
3509
5342
|
try {
|
|
3510
|
-
payload = JSON.parse(
|
|
5343
|
+
payload = JSON.parse(text2);
|
|
3511
5344
|
} catch (error) {
|
|
3512
5345
|
throw new SessionLoadError(
|
|
3513
5346
|
`Failed to load session ${sessionId}: response is not valid JSON`,
|
|
@@ -4055,13 +5888,13 @@ var ReplaySuite = class _ReplaySuite {
|
|
|
4055
5888
|
if (response.status === 404) {
|
|
4056
5889
|
return null;
|
|
4057
5890
|
}
|
|
4058
|
-
const
|
|
5891
|
+
const text2 = await response.text();
|
|
4059
5892
|
if (!response.ok) {
|
|
4060
5893
|
throw new ReplayError(
|
|
4061
|
-
`Failed to list tasks for ${datasetId}: HTTP ${response.status} \u2014 ${
|
|
5894
|
+
`Failed to list tasks for ${datasetId}: HTTP ${response.status} \u2014 ${text2.slice(0, 300)}`
|
|
4062
5895
|
);
|
|
4063
5896
|
}
|
|
4064
|
-
const payload = parseJsonObject(
|
|
5897
|
+
const payload = parseJsonObject(text2);
|
|
4065
5898
|
const pageTasks = Array.isArray(payload.tasks) ? payload.tasks : [];
|
|
4066
5899
|
tasks.push(...pageTasks.filter(isPlainObject2));
|
|
4067
5900
|
if (tasks.length >= Number(payload.totalTasks ?? 0)) {
|
|
@@ -4078,13 +5911,13 @@ var ReplaySuite = class _ReplaySuite {
|
|
|
4078
5911
|
`${host}/api/public/task-sets?name=${encodeURIComponent(nameOrId)}`,
|
|
4079
5912
|
{ headers, signal: AbortSignal.timeout(timeoutSeconds * 1e3) }
|
|
4080
5913
|
);
|
|
4081
|
-
const
|
|
5914
|
+
const text2 = await response.text();
|
|
4082
5915
|
if (!response.ok) {
|
|
4083
5916
|
throw new ReplayError(
|
|
4084
|
-
`Failed to resolve task set '${nameOrId}': HTTP ${response.status} \u2014 ${
|
|
5917
|
+
`Failed to resolve task set '${nameOrId}': HTTP ${response.status} \u2014 ${text2.slice(0, 300)}`
|
|
4085
5918
|
);
|
|
4086
5919
|
}
|
|
4087
|
-
const payload = parseJsonObject(
|
|
5920
|
+
const payload = parseJsonObject(text2);
|
|
4088
5921
|
const matches = Array.isArray(payload.taskSets) ? payload.taskSets.filter(isPlainObject2) : [];
|
|
4089
5922
|
if (matches.length === 0) {
|
|
4090
5923
|
throw new ReplayError(`Task set not found: ${nameOrId}`);
|
|
@@ -4207,8 +6040,8 @@ async function recordRunItem(suiteToRecord, testCase, runName, traceId, triage,
|
|
|
4207
6040
|
if (response.status === 200) {
|
|
4208
6041
|
return null;
|
|
4209
6042
|
}
|
|
4210
|
-
const
|
|
4211
|
-
lastError = `HTTP ${response.status}: ${
|
|
6043
|
+
const text2 = await response.text();
|
|
6044
|
+
lastError = `HTTP ${response.status}: ${text2.slice(0, 200)}`;
|
|
4212
6045
|
if (response.status !== 404) {
|
|
4213
6046
|
return lastError;
|
|
4214
6047
|
}
|
|
@@ -4281,9 +6114,9 @@ function suite(nameOrId, options = {}) {
|
|
|
4281
6114
|
function isPlainObject2(value) {
|
|
4282
6115
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4283
6116
|
}
|
|
4284
|
-
function parseJsonObject(
|
|
6117
|
+
function parseJsonObject(text2) {
|
|
4285
6118
|
try {
|
|
4286
|
-
const parsed = JSON.parse(
|
|
6119
|
+
const parsed = JSON.parse(text2);
|
|
4287
6120
|
return isPlainObject2(parsed) ? parsed : {};
|
|
4288
6121
|
} catch {
|
|
4289
6122
|
return {};
|
|
@@ -4293,7 +6126,7 @@ function randomHex() {
|
|
|
4293
6126
|
return crypto.randomUUID().replace(/-/g, "");
|
|
4294
6127
|
}
|
|
4295
6128
|
function sleep(ms) {
|
|
4296
|
-
return new Promise((
|
|
6129
|
+
return new Promise((resolve7) => setTimeout(resolve7, ms));
|
|
4297
6130
|
}
|
|
4298
6131
|
var replay = {
|
|
4299
6132
|
suite,
|
|
@@ -4380,7 +6213,7 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4380
6213
|
const descriptors = entries.map(
|
|
4381
6214
|
([key, tool]) => this.describeTool(key, tool, options)
|
|
4382
6215
|
);
|
|
4383
|
-
const
|
|
6216
|
+
const resolve7 = await this.resolveToolset({
|
|
4384
6217
|
agent: this.agent,
|
|
4385
6218
|
toolsetId: options.toolsetId,
|
|
4386
6219
|
toolsetName: options.toolsetName,
|
|
@@ -4390,8 +6223,8 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4390
6223
|
});
|
|
4391
6224
|
const securedEntries = entries.flatMap(([key, tool]) => {
|
|
4392
6225
|
const descriptor = descriptors.find((item) => item.name === key);
|
|
4393
|
-
if (!this.shouldExposeTool(
|
|
4394
|
-
this.log("Hiding tool %s in %s mode", descriptor.id,
|
|
6226
|
+
if (!this.shouldExposeTool(resolve7, descriptor.id)) {
|
|
6227
|
+
this.log("Hiding tool %s in %s mode", descriptor.id, resolve7.mode);
|
|
4395
6228
|
return [];
|
|
4396
6229
|
}
|
|
4397
6230
|
return [
|
|
@@ -4401,7 +6234,7 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4401
6234
|
toolId: descriptor.id,
|
|
4402
6235
|
toolsetId: options.toolsetId,
|
|
4403
6236
|
context: this.normalizeContext(options.context),
|
|
4404
|
-
resolve:
|
|
6237
|
+
resolve: resolve7
|
|
4405
6238
|
})
|
|
4406
6239
|
]
|
|
4407
6240
|
];
|
|
@@ -4489,8 +6322,8 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4489
6322
|
);
|
|
4490
6323
|
}
|
|
4491
6324
|
}
|
|
4492
|
-
async postJson(
|
|
4493
|
-
const response = await fetch(`${this.host}${
|
|
6325
|
+
async postJson(path9, payload) {
|
|
6326
|
+
const response = await fetch(`${this.host}${path9}`, {
|
|
4494
6327
|
method: "POST",
|
|
4495
6328
|
headers: {
|
|
4496
6329
|
Authorization: this.authHeader(),
|
|
@@ -4501,7 +6334,7 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4501
6334
|
if (!response.ok) {
|
|
4502
6335
|
const body = await response.text();
|
|
4503
6336
|
throw new GatewaySecurityError(
|
|
4504
|
-
`Gateway API ${response.status} on ${
|
|
6337
|
+
`Gateway API ${response.status} on ${path9}: ${body || response.statusText}`
|
|
4505
6338
|
);
|
|
4506
6339
|
}
|
|
4507
6340
|
return await response.json();
|
|
@@ -4516,9 +6349,9 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4516
6349
|
metadata: options.toolMetadata?.[key] ?? {}
|
|
4517
6350
|
};
|
|
4518
6351
|
}
|
|
4519
|
-
shouldExposeTool(
|
|
4520
|
-
if (
|
|
4521
|
-
if (
|
|
6352
|
+
shouldExposeTool(resolve7, toolId) {
|
|
6353
|
+
if (resolve7.mode === "observe") return true;
|
|
6354
|
+
if (resolve7.blockedToolIds.includes(toolId)) return false;
|
|
4522
6355
|
return true;
|
|
4523
6356
|
}
|
|
4524
6357
|
normalizeContext(context4) {
|
|
@@ -4670,10 +6503,10 @@ var UsersClient = class _UsersClient {
|
|
|
4670
6503
|
params.set("toTimestamp", filter.toTimestamp.toISOString());
|
|
4671
6504
|
if (filter.page) params.set("page", String(filter.page));
|
|
4672
6505
|
if (filter.limit) params.set("limit", String(filter.limit));
|
|
4673
|
-
const
|
|
6506
|
+
const qs3 = params.toString();
|
|
4674
6507
|
const payload = await this.requestJson(
|
|
4675
6508
|
"GET",
|
|
4676
|
-
`/api/public/user-events${
|
|
6509
|
+
`/api/public/user-events${qs3 ? `?${qs3}` : ""}`
|
|
4677
6510
|
);
|
|
4678
6511
|
const rows = Array.isArray(payload.data) ? payload.data : [];
|
|
4679
6512
|
const meta = payload.meta && typeof payload.meta === "object" ? payload.meta : {};
|
|
@@ -4682,10 +6515,10 @@ var UsersClient = class _UsersClient {
|
|
|
4682
6515
|
totalItems: Number(meta.totalItems ?? rows.length)
|
|
4683
6516
|
};
|
|
4684
6517
|
}
|
|
4685
|
-
async requestJson(method,
|
|
6518
|
+
async requestJson(method, path9, payload) {
|
|
4686
6519
|
let response;
|
|
4687
6520
|
try {
|
|
4688
|
-
response = await fetch(`${this.host}${
|
|
6521
|
+
response = await fetch(`${this.host}${path9}`, {
|
|
4689
6522
|
method,
|
|
4690
6523
|
headers: {
|
|
4691
6524
|
Authorization: this.authHeader(),
|
|
@@ -4696,18 +6529,18 @@ var UsersClient = class _UsersClient {
|
|
|
4696
6529
|
});
|
|
4697
6530
|
} catch (error) {
|
|
4698
6531
|
throw new UserProfileError(
|
|
4699
|
-
`${method} ${
|
|
6532
|
+
`${method} ${path9} failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
4700
6533
|
{ cause: error }
|
|
4701
6534
|
);
|
|
4702
6535
|
}
|
|
4703
|
-
const
|
|
6536
|
+
const text2 = await response.text();
|
|
4704
6537
|
if (!response.ok) {
|
|
4705
6538
|
throw new UserProfileError(
|
|
4706
|
-
`${method} ${
|
|
6539
|
+
`${method} ${path9} failed (${response.status}): ${text2.slice(0, 500)}`
|
|
4707
6540
|
);
|
|
4708
6541
|
}
|
|
4709
|
-
this.log("%s %s -> %s", method,
|
|
4710
|
-
return safeJson4(
|
|
6542
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
6543
|
+
return safeJson4(text2);
|
|
4711
6544
|
}
|
|
4712
6545
|
authHeader() {
|
|
4713
6546
|
return `Basic ${Buffer.from(`${this.publicKey}:${this.secretKey}`).toString(
|
|
@@ -4910,10 +6743,10 @@ var ScoresClient = class _ScoresClient {
|
|
|
4910
6743
|
metadata: signalMetadata
|
|
4911
6744
|
});
|
|
4912
6745
|
}
|
|
4913
|
-
async request(method,
|
|
6746
|
+
async request(method, path9, payload) {
|
|
4914
6747
|
let response;
|
|
4915
6748
|
try {
|
|
4916
|
-
response = await fetch(`${this.host}${
|
|
6749
|
+
response = await fetch(`${this.host}${path9}`, {
|
|
4917
6750
|
method,
|
|
4918
6751
|
headers: {
|
|
4919
6752
|
Authorization: this.authHeader(),
|
|
@@ -4924,17 +6757,17 @@ var ScoresClient = class _ScoresClient {
|
|
|
4924
6757
|
});
|
|
4925
6758
|
} catch (error) {
|
|
4926
6759
|
throw new ScoreError(
|
|
4927
|
-
`${method} ${
|
|
6760
|
+
`${method} ${path9} failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
4928
6761
|
{ cause: error }
|
|
4929
6762
|
);
|
|
4930
6763
|
}
|
|
4931
|
-
const
|
|
6764
|
+
const text2 = await response.text();
|
|
4932
6765
|
if (!response.ok) {
|
|
4933
6766
|
throw new ScoreError(
|
|
4934
|
-
`${method} ${
|
|
6767
|
+
`${method} ${path9} failed (${response.status}): ${text2.slice(0, 500)}`
|
|
4935
6768
|
);
|
|
4936
6769
|
}
|
|
4937
|
-
this.log("%s %s -> %s", method,
|
|
6770
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
4938
6771
|
}
|
|
4939
6772
|
authHeader() {
|
|
4940
6773
|
return `Basic ${Buffer.from(`${this.publicKey}:${this.secretKey}`).toString(
|
|
@@ -4975,8 +6808,287 @@ var scores = {
|
|
|
4975
6808
|
init_worlds();
|
|
4976
6809
|
init_session();
|
|
4977
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
|
+
|
|
4978
7090
|
// src/build/index.ts
|
|
4979
|
-
import { createHash as
|
|
7091
|
+
import { createHash as createHash8 } from "crypto";
|
|
4980
7092
|
function canonicalJson(value) {
|
|
4981
7093
|
if (value === null || typeof value !== "object") {
|
|
4982
7094
|
return JSON.stringify(value);
|
|
@@ -4987,8 +7099,8 @@ function canonicalJson(value) {
|
|
|
4987
7099
|
const entries = Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
4988
7100
|
return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${canonicalJson(v)}`).join(",")}}`;
|
|
4989
7101
|
}
|
|
4990
|
-
function sha256(
|
|
4991
|
-
return `sha256:${
|
|
7102
|
+
function sha256(text2) {
|
|
7103
|
+
return `sha256:${createHash8("sha256").update(text2).digest("hex")}`;
|
|
4992
7104
|
}
|
|
4993
7105
|
var registeredTools = /* @__PURE__ */ new Map();
|
|
4994
7106
|
var registeredPrompts = /* @__PURE__ */ new Map();
|
|
@@ -5757,12 +7869,12 @@ async function* observeClaude(stream, options) {
|
|
|
5757
7869
|
pendingTurnInput = "";
|
|
5758
7870
|
}
|
|
5759
7871
|
const childCtx = options.perTurn ? turnCtx : rootCtx;
|
|
5760
|
-
let
|
|
7872
|
+
let text2 = "";
|
|
5761
7873
|
const toolUses = [];
|
|
5762
7874
|
for (const block of message.message?.content ?? []) {
|
|
5763
7875
|
if (block?.type === "text") {
|
|
5764
7876
|
finalText += block.text;
|
|
5765
|
-
|
|
7877
|
+
text2 += block.text;
|
|
5766
7878
|
}
|
|
5767
7879
|
if (block?.type === "tool_use") {
|
|
5768
7880
|
toolUses.push({
|
|
@@ -5772,7 +7884,7 @@ async function* observeClaude(stream, options) {
|
|
|
5772
7884
|
});
|
|
5773
7885
|
}
|
|
5774
7886
|
}
|
|
5775
|
-
turnText +=
|
|
7887
|
+
turnText += text2;
|
|
5776
7888
|
const gen = tracer.startSpan(
|
|
5777
7889
|
"assistant",
|
|
5778
7890
|
{
|
|
@@ -5780,7 +7892,7 @@ async function* observeClaude(stream, options) {
|
|
|
5780
7892
|
"openinference.span.kind": "LLM",
|
|
5781
7893
|
"llm.model_name": model,
|
|
5782
7894
|
"llm.provider": "anthropic",
|
|
5783
|
-
"output.value":
|
|
7895
|
+
"output.value": text2 || toolUses.map((t) => `\u2192 ${cleanToolName(t.name)}`).join(", ")
|
|
5784
7896
|
}
|
|
5785
7897
|
},
|
|
5786
7898
|
childCtx
|
|
@@ -5896,6 +8008,7 @@ export {
|
|
|
5896
8008
|
ReplayReport,
|
|
5897
8009
|
ReplaySuite,
|
|
5898
8010
|
ReplayTask,
|
|
8011
|
+
STRIP_PREFIX,
|
|
5899
8012
|
SUCCESS_METRIC_NAME_KEY,
|
|
5900
8013
|
SUCCESS_SIGNAL_KEY,
|
|
5901
8014
|
SURFACE_KINDS,
|
|
@@ -5905,10 +8018,12 @@ export {
|
|
|
5905
8018
|
SessionRecording,
|
|
5906
8019
|
SessionTrace,
|
|
5907
8020
|
StubMissError,
|
|
8021
|
+
TRANSFORMS,
|
|
5908
8022
|
ToolStubRegistry,
|
|
5909
8023
|
TraceDiff,
|
|
5910
8024
|
UserProfileError,
|
|
5911
8025
|
UsersClient,
|
|
8026
|
+
WHITESPACE,
|
|
5912
8027
|
WorldBrowser,
|
|
5913
8028
|
WorldSession,
|
|
5914
8029
|
WorldSessionCallError,
|
|
@@ -5918,12 +8033,14 @@ export {
|
|
|
5918
8033
|
WorldTask,
|
|
5919
8034
|
addExperimentAttributes,
|
|
5920
8035
|
apiRequest,
|
|
8036
|
+
applyTransforms,
|
|
5921
8037
|
assembleManifest,
|
|
5922
8038
|
assignVariant,
|
|
5923
8039
|
attachSession,
|
|
5924
8040
|
basicAuthHeader,
|
|
5925
8041
|
buildSourceTarball,
|
|
5926
8042
|
canonicalJson,
|
|
8043
|
+
captureToolCalls,
|
|
5927
8044
|
clearExperimentContext,
|
|
5928
8045
|
collectArchiveRelPaths,
|
|
5929
8046
|
computeBuildHash,
|
|
@@ -5937,9 +8054,11 @@ export {
|
|
|
5937
8054
|
defineTool,
|
|
5938
8055
|
deleteEnvSecret,
|
|
5939
8056
|
deleteTask,
|
|
8057
|
+
describeWorld,
|
|
5940
8058
|
detectProvenance,
|
|
5941
8059
|
experimentContextStorage,
|
|
5942
8060
|
singleton_exports as experiments,
|
|
8061
|
+
files_exports as files,
|
|
5943
8062
|
gateway,
|
|
5944
8063
|
getExperimentContext,
|
|
5945
8064
|
getRegisteredArtifacts,
|
|
@@ -5948,7 +8067,10 @@ export {
|
|
|
5948
8067
|
getRegisteredTools,
|
|
5949
8068
|
getRun,
|
|
5950
8069
|
getTask,
|
|
8070
|
+
hashForm,
|
|
5951
8071
|
identify,
|
|
8072
|
+
ingest,
|
|
8073
|
+
ingestToolCalls,
|
|
5952
8074
|
isIncludedInContentHash,
|
|
5953
8075
|
isTaskIdRef,
|
|
5954
8076
|
isTaskSpec,
|
|
@@ -5958,16 +8080,26 @@ export {
|
|
|
5958
8080
|
loadSession,
|
|
5959
8081
|
localTreeState,
|
|
5960
8082
|
memory,
|
|
8083
|
+
migrateProjectWorlds,
|
|
8084
|
+
migrateWorld,
|
|
5961
8085
|
openBrowser,
|
|
5962
8086
|
openSession,
|
|
5963
8087
|
openWorld,
|
|
8088
|
+
parseToolCallRecord,
|
|
8089
|
+
parseTransform,
|
|
5964
8090
|
parseWorldTaskRefs,
|
|
5965
8091
|
personas,
|
|
8092
|
+
preserveForm,
|
|
5966
8093
|
propose,
|
|
5967
8094
|
pull,
|
|
5968
8095
|
push,
|
|
8096
|
+
pyText,
|
|
8097
|
+
queryRows,
|
|
8098
|
+
queryRowsSearch,
|
|
5969
8099
|
readLocalMeta,
|
|
8100
|
+
readToolCallRecords,
|
|
5970
8101
|
redactActionArgs,
|
|
8102
|
+
redactionOf,
|
|
5971
8103
|
registerArtifact,
|
|
5972
8104
|
registerPrompt,
|
|
5973
8105
|
registerSkill,
|
|
@@ -5976,20 +8108,27 @@ export {
|
|
|
5976
8108
|
resetBuildRegistry,
|
|
5977
8109
|
resolveBrowserMode,
|
|
5978
8110
|
resolveUserId,
|
|
8111
|
+
roundForm,
|
|
5979
8112
|
runSessions,
|
|
5980
8113
|
runSuite,
|
|
5981
8114
|
runWithExperimentContext,
|
|
5982
8115
|
schemaFromSignature,
|
|
5983
8116
|
scores,
|
|
5984
8117
|
sessionObservationFromApi,
|
|
8118
|
+
sessionToolObservations,
|
|
5985
8119
|
sessions,
|
|
5986
8120
|
setEnvSecret,
|
|
5987
8121
|
setExperimentContext,
|
|
8122
|
+
shapeText,
|
|
5988
8123
|
snapshotTreeHashes,
|
|
8124
|
+
storedForms,
|
|
5989
8125
|
success,
|
|
5990
8126
|
suite,
|
|
5991
8127
|
surfaceKinds,
|
|
5992
8128
|
taskLabel,
|
|
8129
|
+
toolCallRecordsIn,
|
|
8130
|
+
toolCallsFromObservations,
|
|
8131
|
+
traces_exports as traces,
|
|
5993
8132
|
tracing,
|
|
5994
8133
|
uiEntryUrl,
|
|
5995
8134
|
uiUrl,
|