@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.js
CHANGED
|
@@ -41,9 +41,9 @@ function surfaceKinds(s) {
|
|
|
41
41
|
if (s.browser) kinds.push("browser");
|
|
42
42
|
return kinds;
|
|
43
43
|
}
|
|
44
|
-
function uiUrl(ui,
|
|
44
|
+
function uiUrl(ui, path9) {
|
|
45
45
|
const base = ui.url.replace(/\/+$/, "");
|
|
46
|
-
const rel =
|
|
46
|
+
const rel = path9.startsWith("/") ? path9 : `/${path9}`;
|
|
47
47
|
if (!ui.token) return base + rel;
|
|
48
48
|
const [beforeHash, hash] = splitHash(rel);
|
|
49
49
|
const joiner = beforeHash.includes("?") ? "&" : "?";
|
|
@@ -127,12 +127,12 @@ async function openBrowser(surfaces, opts = {}) {
|
|
|
127
127
|
function computerUseToolkit(browser, opts = {}) {
|
|
128
128
|
const maxText = opts.maxText ?? 2e4;
|
|
129
129
|
const observe2 = async (selector = "body") => {
|
|
130
|
-
const
|
|
130
|
+
const text2 = await browser.text(selector);
|
|
131
131
|
return {
|
|
132
132
|
url: browser.url,
|
|
133
133
|
title: await browser.title(),
|
|
134
|
-
text:
|
|
135
|
-
truncated:
|
|
134
|
+
text: text2.slice(0, maxText),
|
|
135
|
+
truncated: text2.length > maxText
|
|
136
136
|
};
|
|
137
137
|
};
|
|
138
138
|
const impls = {
|
|
@@ -216,8 +216,8 @@ var init_browser = __esm({
|
|
|
216
216
|
}
|
|
217
217
|
resolveBase() {
|
|
218
218
|
if (this.base === null) {
|
|
219
|
-
const
|
|
220
|
-
this.base =
|
|
219
|
+
const resolve7 = this.opts.resumeFrom ?? (async () => 0);
|
|
220
|
+
this.base = resolve7().then((n) => {
|
|
221
221
|
if (!Number.isInteger(n) || n < 0)
|
|
222
222
|
throw new Error(
|
|
223
223
|
`browser event base seq must be a non-negative integer, got ${String(n)}`
|
|
@@ -418,11 +418,11 @@ var init_browser = __esm({
|
|
|
418
418
|
await this.settle();
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
|
-
async type(selector,
|
|
421
|
+
async type(selector, text2) {
|
|
422
422
|
await this.act(
|
|
423
423
|
"browser_type",
|
|
424
|
-
{ selector, text },
|
|
425
|
-
() => this.page.fill(selector,
|
|
424
|
+
{ selector, text: text2 },
|
|
425
|
+
() => this.page.fill(selector, text2)
|
|
426
426
|
);
|
|
427
427
|
}
|
|
428
428
|
async press(key) {
|
|
@@ -725,6 +725,11 @@ var init_session = __esm({
|
|
|
725
725
|
get taskName() {
|
|
726
726
|
return this.current.taskName;
|
|
727
727
|
}
|
|
728
|
+
/** The platform's notices about the world this session runs on (empty
|
|
729
|
+
* for a schema world). Printed by the CLI on stderr at open. */
|
|
730
|
+
get deprecations() {
|
|
731
|
+
return this.current.deprecations ?? [];
|
|
732
|
+
}
|
|
728
733
|
/** The task this session runs: bundled scenario, stored task or inline
|
|
729
734
|
* spec, its name, hash and the caller's metadata. */
|
|
730
735
|
get taskInfo() {
|
|
@@ -756,20 +761,20 @@ var init_session = __esm({
|
|
|
756
761
|
}
|
|
757
762
|
/** Base URL of the world's own HTTP API for this session. */
|
|
758
763
|
async api() {
|
|
759
|
-
const { api } = await this.surfaces();
|
|
760
|
-
if (!
|
|
764
|
+
const { api: api2 } = await this.surfaces();
|
|
765
|
+
if (!api2)
|
|
761
766
|
throw new WorldSurfaceUnavailable(
|
|
762
767
|
"api",
|
|
763
768
|
"open the session with surfaces: ['api'] on an api-type world"
|
|
764
769
|
);
|
|
765
|
-
return
|
|
770
|
+
return api2.url;
|
|
766
771
|
}
|
|
767
772
|
/** Headers every request to `api()` needs. A World Host session gates its
|
|
768
773
|
* api surface on a per-session token; a pod or hosted twin answers with the
|
|
769
774
|
* world's own declared auth and this is `{}`. */
|
|
770
775
|
async apiHeaders() {
|
|
771
|
-
const { api } = await this.surfaces();
|
|
772
|
-
return
|
|
776
|
+
const { api: api2 } = await this.surfaces();
|
|
777
|
+
return api2?.token ? { Authorization: `Bearer ${api2.token}` } : {};
|
|
773
778
|
}
|
|
774
779
|
/** URL of the world's UI entry page for this session. */
|
|
775
780
|
async ui() {
|
|
@@ -798,18 +803,18 @@ var init_session = __esm({
|
|
|
798
803
|
}
|
|
799
804
|
/** The reporter `browser()` uses; exposed for a page you drive yourself. */
|
|
800
805
|
browserRecorder(agentId) {
|
|
801
|
-
const
|
|
806
|
+
const path9 = `/api/public/world-sessions/${encodeURIComponent(this.sessionId)}/browser-events`;
|
|
802
807
|
const id = agentId ?? process.env.GATEWAY_AGENT_ID ?? `agent-${(0, import_node_crypto.randomUUID)().replace(/-/g, "").slice(0, 8)}`;
|
|
803
808
|
return new BrowserActionRecorder(
|
|
804
809
|
async (events) => {
|
|
805
|
-
await apiRequest(this.options, "POST",
|
|
810
|
+
await apiRequest(this.options, "POST", path9, { events });
|
|
806
811
|
},
|
|
807
812
|
id,
|
|
808
813
|
{
|
|
809
814
|
// Continue this agent's timeline where the platform has it, so the
|
|
810
815
|
// same id reopened later never re-numbers from zero.
|
|
811
816
|
resumeFrom: async () => {
|
|
812
|
-
const summary = await apiRequest(this.options, "GET",
|
|
817
|
+
const summary = await apiRequest(this.options, "GET", path9);
|
|
813
818
|
return summary.agents.find((a) => a.agentId === id)?.nextSeq ?? 0;
|
|
814
819
|
}
|
|
815
820
|
}
|
|
@@ -866,7 +871,7 @@ var init_session = __esm({
|
|
|
866
871
|
const { callId } = enqueued;
|
|
867
872
|
const judged = enqueued.pending === true;
|
|
868
873
|
const budgetMs = timeoutMs ?? (judged ? JUDGED_GRADE_TIMEOUT_MS : CALL_TIMEOUT_MS);
|
|
869
|
-
const
|
|
874
|
+
const pollMs2 = judged ? JUDGED_GRADE_POLL_MS : CALL_POLL_MS;
|
|
870
875
|
const deadline = Date.now() + budgetMs;
|
|
871
876
|
for (; ; ) {
|
|
872
877
|
const call = await apiRequest(
|
|
@@ -882,7 +887,7 @@ var init_session = __esm({
|
|
|
882
887
|
throw new WorldSessionTimeout(
|
|
883
888
|
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.`
|
|
884
889
|
);
|
|
885
|
-
await sleep2(
|
|
890
|
+
await sleep2(pollMs2);
|
|
886
891
|
}
|
|
887
892
|
}
|
|
888
893
|
/**
|
|
@@ -957,8 +962,12 @@ var init_session = __esm({
|
|
|
957
962
|
*/
|
|
958
963
|
async seed(rows, opts = {}) {
|
|
959
964
|
const mode = opts.mode ?? "append";
|
|
965
|
+
const redact = opts.redact ?? "off";
|
|
960
966
|
return await this.exchange(
|
|
961
|
-
{
|
|
967
|
+
{
|
|
968
|
+
kind: "seed",
|
|
969
|
+
args: { mode, rows, ...redact !== "off" ? { redact } : {} }
|
|
970
|
+
},
|
|
962
971
|
opts.timeoutMs
|
|
963
972
|
);
|
|
964
973
|
}
|
|
@@ -1129,6 +1138,22 @@ var init_tasks = __esm({
|
|
|
1129
1138
|
});
|
|
1130
1139
|
|
|
1131
1140
|
// src/worlds/hub.ts
|
|
1141
|
+
var hub_exports = {};
|
|
1142
|
+
__export(hub_exports, {
|
|
1143
|
+
DEFAULT_BRANCH: () => DEFAULT_BRANCH,
|
|
1144
|
+
buildSourceTarball: () => buildSourceTarball,
|
|
1145
|
+
collectArchiveRelPaths: () => collectArchiveRelPaths,
|
|
1146
|
+
computeContentHash: () => computeContentHash,
|
|
1147
|
+
createRef: () => createRef,
|
|
1148
|
+
isIncludedInContentHash: () => isIncludedInContentHash,
|
|
1149
|
+
localTreeState: () => localTreeState,
|
|
1150
|
+
propose: () => propose,
|
|
1151
|
+
pull: () => pull,
|
|
1152
|
+
push: () => push,
|
|
1153
|
+
readLocalMeta: () => readLocalMeta,
|
|
1154
|
+
snapshotTreeHashes: () => snapshotTreeHashes,
|
|
1155
|
+
writeLocalMeta: () => writeLocalMeta
|
|
1156
|
+
});
|
|
1132
1157
|
function isExcludedDirComponent(component) {
|
|
1133
1158
|
return component.startsWith(".") || ROOT_EXCLUDED_DIRS.has(component) || component.endsWith(".egg-info");
|
|
1134
1159
|
}
|
|
@@ -1262,8 +1287,8 @@ function localTreeState(dir) {
|
|
|
1262
1287
|
}
|
|
1263
1288
|
function readPyproject(dir) {
|
|
1264
1289
|
try {
|
|
1265
|
-
const
|
|
1266
|
-
const section = /\[project\]([\s\S]*?)(\n\[|$)/.exec(
|
|
1290
|
+
const text2 = fs.readFileSync(path.join(dir, "pyproject.toml"), "utf-8");
|
|
1291
|
+
const section = /\[project\]([\s\S]*?)(\n\[|$)/.exec(text2)?.[1] ?? "";
|
|
1267
1292
|
const name = /\bname\s*=\s*"([^"]+)"/.exec(section)?.[1];
|
|
1268
1293
|
const version = /\bversion\s*=\s*"([^"]+)"/.exec(section)?.[1];
|
|
1269
1294
|
return { name, version };
|
|
@@ -1271,6 +1296,17 @@ function readPyproject(dir) {
|
|
|
1271
1296
|
return {};
|
|
1272
1297
|
}
|
|
1273
1298
|
}
|
|
1299
|
+
function readWorldContractVersion(dir) {
|
|
1300
|
+
for (const rel of ["schema/world.json", path.join("server", "world", "schema", "world.json")]) {
|
|
1301
|
+
try {
|
|
1302
|
+
const parsed = JSON.parse(fs.readFileSync(path.join(dir, rel), "utf-8"));
|
|
1303
|
+
const pkg = parsed["x-gateway"]?.package;
|
|
1304
|
+
if (pkg?.version) return { name: pkg.id, version: pkg.version };
|
|
1305
|
+
} catch {
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
return {};
|
|
1309
|
+
}
|
|
1274
1310
|
function buildFileManifest(dir) {
|
|
1275
1311
|
const entries = [];
|
|
1276
1312
|
const walk = (rel) => {
|
|
@@ -1316,8 +1352,10 @@ async function push(dir, opts = {}) {
|
|
|
1316
1352
|
const baseVersionId = opts.baseVersionId ?? localMeta.versionId ?? null;
|
|
1317
1353
|
const contentHash = computeContentHash(dir);
|
|
1318
1354
|
const pyproject = readPyproject(dir);
|
|
1355
|
+
const contractVersion = pyproject.version ? void 0 : readWorldContractVersion(dir).version;
|
|
1356
|
+
if (contractVersion) pyproject.version = contractVersion;
|
|
1319
1357
|
const slug = opts.slug ?? pyproject.name ?? path.basename(path.resolve(dir));
|
|
1320
|
-
const
|
|
1358
|
+
const resolve7 = await apiRequest(
|
|
1321
1359
|
options,
|
|
1322
1360
|
"POST",
|
|
1323
1361
|
"/api/public/benchmark-containers/resolve",
|
|
@@ -1332,7 +1370,7 @@ async function push(dir, opts = {}) {
|
|
|
1332
1370
|
const tarball = buildSourceTarball(dir);
|
|
1333
1371
|
const bundleSha256 = sha256b64(tarball);
|
|
1334
1372
|
const version = await apiRequest(options, "POST", "/api/public/benchmark-containers/versions", {
|
|
1335
|
-
containerId:
|
|
1373
|
+
containerId: resolve7.containerId,
|
|
1336
1374
|
contentHash,
|
|
1337
1375
|
bundleSha256,
|
|
1338
1376
|
bundleSizeBytes: tarball.length,
|
|
@@ -1365,7 +1403,7 @@ async function push(dir, opts = {}) {
|
|
|
1365
1403
|
baseFiles: snapshotTreeHashes(dir)
|
|
1366
1404
|
});
|
|
1367
1405
|
return {
|
|
1368
|
-
containerId:
|
|
1406
|
+
containerId: resolve7.containerId,
|
|
1369
1407
|
slug,
|
|
1370
1408
|
versionId: version.versionId,
|
|
1371
1409
|
contentHash,
|
|
@@ -1692,6 +1730,1756 @@ var init_validate = __esm({
|
|
|
1692
1730
|
}
|
|
1693
1731
|
});
|
|
1694
1732
|
|
|
1733
|
+
// src/worlds/describe.ts
|
|
1734
|
+
async function describeWorld(slug, options = {}) {
|
|
1735
|
+
if (slug.includes("@"))
|
|
1736
|
+
throw new Error(
|
|
1737
|
+
`describeWorld reads a world's head version: pass the slug without @ref (got ${slug})`
|
|
1738
|
+
);
|
|
1739
|
+
return apiRequest(
|
|
1740
|
+
options,
|
|
1741
|
+
"GET",
|
|
1742
|
+
`/api/public/worlds/${encodeURIComponent(slug)}`
|
|
1743
|
+
);
|
|
1744
|
+
}
|
|
1745
|
+
var init_describe = __esm({
|
|
1746
|
+
"src/worlds/describe.ts"() {
|
|
1747
|
+
"use strict";
|
|
1748
|
+
init_worlds();
|
|
1749
|
+
}
|
|
1750
|
+
});
|
|
1751
|
+
|
|
1752
|
+
// src/cli/platform/worldData/json.ts
|
|
1753
|
+
function parseJson(text2) {
|
|
1754
|
+
const p = new Parser(text2);
|
|
1755
|
+
p.skipWs();
|
|
1756
|
+
const value = p.value();
|
|
1757
|
+
p.skipWs();
|
|
1758
|
+
if (p.i < text2.length) throw new JsonSyntaxError(`Extra data at ${p.i}`);
|
|
1759
|
+
return value;
|
|
1760
|
+
}
|
|
1761
|
+
function dumps(value) {
|
|
1762
|
+
if (value === null) return "null";
|
|
1763
|
+
if (value === true) return "true";
|
|
1764
|
+
if (value === false) return "false";
|
|
1765
|
+
if (typeof value === "string") return JSON.stringify(value);
|
|
1766
|
+
if (value instanceof JsonNumber) return numberText(value);
|
|
1767
|
+
if (Array.isArray(value)) return "[" + value.map(dumps).join(",") + "]";
|
|
1768
|
+
const parts = [];
|
|
1769
|
+
for (const [key, item] of value) parts.push(JSON.stringify(key) + ":" + dumps(item));
|
|
1770
|
+
return "{" + parts.join(",") + "}";
|
|
1771
|
+
}
|
|
1772
|
+
function numberText(n) {
|
|
1773
|
+
if (!n.isFloat) return /^-0+$/.test(n.text) ? "0" : n.text;
|
|
1774
|
+
const value = n.value;
|
|
1775
|
+
if (Number.isNaN(value)) return "NaN";
|
|
1776
|
+
if (value === Infinity) return "Infinity";
|
|
1777
|
+
if (value === -Infinity) return "-Infinity";
|
|
1778
|
+
return pyFloatRepr(value);
|
|
1779
|
+
}
|
|
1780
|
+
function pyFloatRepr(x) {
|
|
1781
|
+
if (x === 0) return Object.is(x, -0) ? "-0.0" : "0.0";
|
|
1782
|
+
const sign = x < 0 ? "-" : "";
|
|
1783
|
+
const js = String(Math.abs(x));
|
|
1784
|
+
const [mantissa, exponentPart] = js.split("e");
|
|
1785
|
+
let exponent = exponentPart ? Number(exponentPart) : 0;
|
|
1786
|
+
const [intPart, fracPart = ""] = mantissa.split(".");
|
|
1787
|
+
let digits = intPart + fracPart;
|
|
1788
|
+
let decpt = intPart.length + exponent;
|
|
1789
|
+
const leading = digits.match(/^0*/)[0].length;
|
|
1790
|
+
digits = digits.slice(leading);
|
|
1791
|
+
decpt -= leading;
|
|
1792
|
+
digits = digits.replace(/0+$/, "");
|
|
1793
|
+
if (digits === "") return sign + "0.0";
|
|
1794
|
+
const sci = decpt - 1;
|
|
1795
|
+
if (sci >= -4 && sci < 16) {
|
|
1796
|
+
if (decpt <= 0) return sign + "0." + "0".repeat(-decpt) + digits;
|
|
1797
|
+
if (decpt >= digits.length) return sign + digits + "0".repeat(decpt - digits.length) + ".0";
|
|
1798
|
+
return sign + digits.slice(0, decpt) + "." + digits.slice(decpt);
|
|
1799
|
+
}
|
|
1800
|
+
exponent = sci;
|
|
1801
|
+
const mag = String(Math.abs(exponent)).padStart(2, "0");
|
|
1802
|
+
return sign + digits[0] + (digits.length > 1 ? "." + digits.slice(1) : "") + "e" + (exponent < 0 ? "-" : "+") + mag;
|
|
1803
|
+
}
|
|
1804
|
+
function pyRound(n, ndigits) {
|
|
1805
|
+
if (!n.isFloat) return n;
|
|
1806
|
+
const x = n.value;
|
|
1807
|
+
if (!Number.isFinite(x)) return n;
|
|
1808
|
+
const sign = x < 0 ? -1 : 1;
|
|
1809
|
+
const magnitude = Math.abs(x);
|
|
1810
|
+
if (magnitude >= 9007199254740992) return new JsonNumber(pyFloatRepr(x));
|
|
1811
|
+
const { m, k } = exactFraction(magnitude);
|
|
1812
|
+
let rounded;
|
|
1813
|
+
if (k <= ndigits) rounded = magnitude;
|
|
1814
|
+
else if (k !== ndigits + 1) rounded = Number(magnitude.toFixed(ndigits));
|
|
1815
|
+
else {
|
|
1816
|
+
const scaled = m * 5n ** BigInt(k);
|
|
1817
|
+
let kept = scaled / 10n;
|
|
1818
|
+
if (kept % 2n === 1n) kept += 1n;
|
|
1819
|
+
const text2 = kept.toString().padStart(ndigits + 1, "0");
|
|
1820
|
+
rounded = ndigits === 0 ? Number(text2) : Number(text2.slice(0, -ndigits) + "." + text2.slice(-ndigits));
|
|
1821
|
+
}
|
|
1822
|
+
return new JsonNumber(pyFloatRepr(sign * rounded));
|
|
1823
|
+
}
|
|
1824
|
+
function exactFraction(x) {
|
|
1825
|
+
if (x === 0) return { m: 0n, k: 0 };
|
|
1826
|
+
const view = new DataView(new ArrayBuffer(8));
|
|
1827
|
+
view.setFloat64(0, x);
|
|
1828
|
+
const bits = view.getBigUint64(0);
|
|
1829
|
+
const exponent = Number(bits >> 52n & 0x7ffn);
|
|
1830
|
+
let mantissa = bits & (1n << 52n) - 1n;
|
|
1831
|
+
let e;
|
|
1832
|
+
if (exponent === 0) e = -1074;
|
|
1833
|
+
else {
|
|
1834
|
+
mantissa |= 1n << 52n;
|
|
1835
|
+
e = exponent - 1075;
|
|
1836
|
+
}
|
|
1837
|
+
while (mantissa !== 0n && (mantissa & 1n) === 0n) {
|
|
1838
|
+
mantissa >>= 1n;
|
|
1839
|
+
e += 1;
|
|
1840
|
+
}
|
|
1841
|
+
if (e >= 0) return { m: mantissa << BigInt(e), k: 0 };
|
|
1842
|
+
return { m: mantissa, k: -e };
|
|
1843
|
+
}
|
|
1844
|
+
var JsonNumber, JsonSyntaxError, Parser, isDigit;
|
|
1845
|
+
var init_json = __esm({
|
|
1846
|
+
"src/cli/platform/worldData/json.ts"() {
|
|
1847
|
+
"use strict";
|
|
1848
|
+
JsonNumber = class {
|
|
1849
|
+
/** The lexeme as it appeared, e.g. "1.0", "-0", "1e21". */
|
|
1850
|
+
constructor(text2) {
|
|
1851
|
+
this.text = text2;
|
|
1852
|
+
}
|
|
1853
|
+
/** A float in Python's eyes: a fraction, an exponent, or a non-finite literal. */
|
|
1854
|
+
get isFloat() {
|
|
1855
|
+
return /[.eE]/.test(this.text) || /[nN]/.test(this.text);
|
|
1856
|
+
}
|
|
1857
|
+
get value() {
|
|
1858
|
+
return Number(this.text);
|
|
1859
|
+
}
|
|
1860
|
+
};
|
|
1861
|
+
JsonSyntaxError = class extends Error {
|
|
1862
|
+
};
|
|
1863
|
+
Parser = class {
|
|
1864
|
+
constructor(s) {
|
|
1865
|
+
this.s = s;
|
|
1866
|
+
}
|
|
1867
|
+
i = 0;
|
|
1868
|
+
skipWs() {
|
|
1869
|
+
const s = this.s;
|
|
1870
|
+
while (this.i < s.length) {
|
|
1871
|
+
const c = s.charCodeAt(this.i);
|
|
1872
|
+
if (c === 32 || c === 10 || c === 13 || c === 9) this.i++;
|
|
1873
|
+
else break;
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
fail(what) {
|
|
1877
|
+
throw new JsonSyntaxError(`${what} at ${this.i}`);
|
|
1878
|
+
}
|
|
1879
|
+
value() {
|
|
1880
|
+
const s = this.s;
|
|
1881
|
+
if (this.i >= s.length) this.fail("Expecting value");
|
|
1882
|
+
const c = s[this.i];
|
|
1883
|
+
if (c === "{") return this.object();
|
|
1884
|
+
if (c === "[") return this.array();
|
|
1885
|
+
if (c === '"') return this.string();
|
|
1886
|
+
if (c === "t") return this.literal("true", true);
|
|
1887
|
+
if (c === "f") return this.literal("false", false);
|
|
1888
|
+
if (c === "n") return this.literal("null", null);
|
|
1889
|
+
if (c === "N") return this.literal("NaN", new JsonNumber("NaN"));
|
|
1890
|
+
if (c === "I") return this.literal("Infinity", new JsonNumber("Infinity"));
|
|
1891
|
+
return this.number();
|
|
1892
|
+
}
|
|
1893
|
+
literal(word, value) {
|
|
1894
|
+
if (!this.s.startsWith(word, this.i)) this.fail("Expecting value");
|
|
1895
|
+
this.i += word.length;
|
|
1896
|
+
return value;
|
|
1897
|
+
}
|
|
1898
|
+
number() {
|
|
1899
|
+
const s = this.s;
|
|
1900
|
+
const start = this.i;
|
|
1901
|
+
if (s[this.i] === "-") {
|
|
1902
|
+
this.i++;
|
|
1903
|
+
if (s.startsWith("Infinity", this.i)) {
|
|
1904
|
+
this.i += 8;
|
|
1905
|
+
return new JsonNumber("-Infinity");
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
const intStart = this.i;
|
|
1909
|
+
if (s[this.i] === "0") this.i++;
|
|
1910
|
+
else {
|
|
1911
|
+
while (this.i < s.length && isDigit(s.charCodeAt(this.i))) this.i++;
|
|
1912
|
+
if (this.i === intStart) this.fail("Expecting value");
|
|
1913
|
+
}
|
|
1914
|
+
if (s[this.i] === ".") {
|
|
1915
|
+
this.i++;
|
|
1916
|
+
const fracStart = this.i;
|
|
1917
|
+
while (this.i < s.length && isDigit(s.charCodeAt(this.i))) this.i++;
|
|
1918
|
+
if (this.i === fracStart) this.fail("Invalid number");
|
|
1919
|
+
}
|
|
1920
|
+
if (s[this.i] === "e" || s[this.i] === "E") {
|
|
1921
|
+
this.i++;
|
|
1922
|
+
if (s[this.i] === "+" || s[this.i] === "-") this.i++;
|
|
1923
|
+
const expStart = this.i;
|
|
1924
|
+
while (this.i < s.length && isDigit(s.charCodeAt(this.i))) this.i++;
|
|
1925
|
+
if (this.i === expStart) this.fail("Invalid number");
|
|
1926
|
+
}
|
|
1927
|
+
return new JsonNumber(s.slice(start, this.i));
|
|
1928
|
+
}
|
|
1929
|
+
string() {
|
|
1930
|
+
const s = this.s;
|
|
1931
|
+
this.i++;
|
|
1932
|
+
let out = "";
|
|
1933
|
+
let runStart = this.i;
|
|
1934
|
+
for (; ; ) {
|
|
1935
|
+
if (this.i >= s.length) this.fail("Unterminated string");
|
|
1936
|
+
const c = s.charCodeAt(this.i);
|
|
1937
|
+
if (c === 34) {
|
|
1938
|
+
out += s.slice(runStart, this.i);
|
|
1939
|
+
this.i++;
|
|
1940
|
+
return out;
|
|
1941
|
+
}
|
|
1942
|
+
if (c < 32) this.fail("Invalid control character");
|
|
1943
|
+
if (c !== 92) {
|
|
1944
|
+
this.i++;
|
|
1945
|
+
continue;
|
|
1946
|
+
}
|
|
1947
|
+
out += s.slice(runStart, this.i);
|
|
1948
|
+
this.i++;
|
|
1949
|
+
const e = s[this.i];
|
|
1950
|
+
switch (e) {
|
|
1951
|
+
case '"':
|
|
1952
|
+
case "\\":
|
|
1953
|
+
case "/":
|
|
1954
|
+
out += e;
|
|
1955
|
+
break;
|
|
1956
|
+
case "b":
|
|
1957
|
+
out += "\b";
|
|
1958
|
+
break;
|
|
1959
|
+
case "f":
|
|
1960
|
+
out += "\f";
|
|
1961
|
+
break;
|
|
1962
|
+
case "n":
|
|
1963
|
+
out += "\n";
|
|
1964
|
+
break;
|
|
1965
|
+
case "r":
|
|
1966
|
+
out += "\r";
|
|
1967
|
+
break;
|
|
1968
|
+
case "t":
|
|
1969
|
+
out += " ";
|
|
1970
|
+
break;
|
|
1971
|
+
case "u": {
|
|
1972
|
+
const hex2 = s.slice(this.i + 1, this.i + 5);
|
|
1973
|
+
if (!/^[0-9a-fA-F]{4}$/.test(hex2)) this.fail("Invalid \\u escape");
|
|
1974
|
+
out += String.fromCharCode(parseInt(hex2, 16));
|
|
1975
|
+
this.i += 4;
|
|
1976
|
+
break;
|
|
1977
|
+
}
|
|
1978
|
+
default:
|
|
1979
|
+
this.fail("Invalid escape");
|
|
1980
|
+
}
|
|
1981
|
+
this.i++;
|
|
1982
|
+
runStart = this.i;
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
array() {
|
|
1986
|
+
this.i++;
|
|
1987
|
+
const out = [];
|
|
1988
|
+
this.skipWs();
|
|
1989
|
+
if (this.s[this.i] === "]") {
|
|
1990
|
+
this.i++;
|
|
1991
|
+
return out;
|
|
1992
|
+
}
|
|
1993
|
+
for (; ; ) {
|
|
1994
|
+
this.skipWs();
|
|
1995
|
+
out.push(this.value());
|
|
1996
|
+
this.skipWs();
|
|
1997
|
+
const c = this.s[this.i];
|
|
1998
|
+
if (c === ",") {
|
|
1999
|
+
this.i++;
|
|
2000
|
+
continue;
|
|
2001
|
+
}
|
|
2002
|
+
if (c === "]") {
|
|
2003
|
+
this.i++;
|
|
2004
|
+
return out;
|
|
2005
|
+
}
|
|
2006
|
+
this.fail("Expecting ',' delimiter");
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
object() {
|
|
2010
|
+
this.i++;
|
|
2011
|
+
const out = /* @__PURE__ */ new Map();
|
|
2012
|
+
this.skipWs();
|
|
2013
|
+
if (this.s[this.i] === "}") {
|
|
2014
|
+
this.i++;
|
|
2015
|
+
return out;
|
|
2016
|
+
}
|
|
2017
|
+
for (; ; ) {
|
|
2018
|
+
this.skipWs();
|
|
2019
|
+
if (this.s[this.i] !== '"') this.fail("Expecting property name enclosed in double quotes");
|
|
2020
|
+
const key = this.string();
|
|
2021
|
+
this.skipWs();
|
|
2022
|
+
if (this.s[this.i] !== ":") this.fail("Expecting ':' delimiter");
|
|
2023
|
+
this.i++;
|
|
2024
|
+
this.skipWs();
|
|
2025
|
+
out.set(key, this.value());
|
|
2026
|
+
this.skipWs();
|
|
2027
|
+
const c = this.s[this.i];
|
|
2028
|
+
if (c === ",") {
|
|
2029
|
+
this.i++;
|
|
2030
|
+
continue;
|
|
2031
|
+
}
|
|
2032
|
+
if (c === "}") {
|
|
2033
|
+
this.i++;
|
|
2034
|
+
return out;
|
|
2035
|
+
}
|
|
2036
|
+
this.fail("Expecting ',' delimiter");
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
};
|
|
2040
|
+
isDigit = (c) => c >= 48 && c <= 57;
|
|
2041
|
+
}
|
|
2042
|
+
});
|
|
2043
|
+
|
|
2044
|
+
// src/worlds/transforms.ts
|
|
2045
|
+
function parseTransform(name) {
|
|
2046
|
+
const simple = Object.prototype.hasOwnProperty.call(SIMPLE, name) ? SIMPLE[name] : void 0;
|
|
2047
|
+
if (simple) return simple;
|
|
2048
|
+
const colon = name.indexOf(":");
|
|
2049
|
+
if (colon !== -1) {
|
|
2050
|
+
const head = name.slice(0, colon);
|
|
2051
|
+
const prefix = name.slice(colon + 1);
|
|
2052
|
+
if (head === STRIP_PREFIX && prefix && !prefix.includes(",")) return stripPrefix(prefix);
|
|
2053
|
+
}
|
|
2054
|
+
throw new Error(`Unknown transform '${name}'; choose one of ${TRANSFORMS.join(", ")}`);
|
|
2055
|
+
}
|
|
2056
|
+
function applyTransforms(value, chain) {
|
|
2057
|
+
const steps = chain.map(parseTransform);
|
|
2058
|
+
let out = text(value);
|
|
2059
|
+
for (const step of steps) out = step(out);
|
|
2060
|
+
return out;
|
|
2061
|
+
}
|
|
2062
|
+
var import_node_crypto3, WHITESPACE, WHITESPACE_EDGES, WHITESPACE_RUN, NOT_DIGIT, STRIP_PREFIX, trim, emailLocalPart, emailDomain, stripPrefix, hex, SIMPLE, TRANSFORMS, text;
|
|
2063
|
+
var init_transforms = __esm({
|
|
2064
|
+
"src/worlds/transforms.ts"() {
|
|
2065
|
+
"use strict";
|
|
2066
|
+
import_node_crypto3 = require("crypto");
|
|
2067
|
+
init_json();
|
|
2068
|
+
WHITESPACE = " \n\r\f\v";
|
|
2069
|
+
WHITESPACE_EDGES = /^[ \t\n\r\f\v]+|[ \t\n\r\f\v]+$/g;
|
|
2070
|
+
WHITESPACE_RUN = /[ \t\n\r\f\v]+/g;
|
|
2071
|
+
NOT_DIGIT = /[^0-9]/g;
|
|
2072
|
+
STRIP_PREFIX = "strip_prefix";
|
|
2073
|
+
trim = (value) => value.replace(WHITESPACE_EDGES, "");
|
|
2074
|
+
emailLocalPart = (value) => {
|
|
2075
|
+
const at = value.lastIndexOf("@");
|
|
2076
|
+
return at === -1 ? value : value.slice(0, at);
|
|
2077
|
+
};
|
|
2078
|
+
emailDomain = (value) => {
|
|
2079
|
+
const at = value.lastIndexOf("@");
|
|
2080
|
+
return at === -1 ? "" : value.slice(at + 1).toLowerCase();
|
|
2081
|
+
};
|
|
2082
|
+
stripPrefix = (prefix) => (value) => value.startsWith(prefix) ? value.slice(prefix.length) : value;
|
|
2083
|
+
hex = (algorithm, value) => (0, import_node_crypto3.createHash)(algorithm).update(value, "utf8").digest("hex");
|
|
2084
|
+
SIMPLE = {
|
|
2085
|
+
lower: (value) => value.toLowerCase(),
|
|
2086
|
+
upper: (value) => value.toUpperCase(),
|
|
2087
|
+
trim,
|
|
2088
|
+
collapse_ws: (value) => trim(value).replace(WHITESPACE_RUN, " "),
|
|
2089
|
+
nfkc: (value) => value.normalize("NFKC"),
|
|
2090
|
+
digits: (value) => value.replace(NOT_DIGIT, ""),
|
|
2091
|
+
email_local_part: emailLocalPart,
|
|
2092
|
+
email_domain: emailDomain,
|
|
2093
|
+
// Vendor-style digests: lowercase hex of the utf-8 bytes, unsalted. This is
|
|
2094
|
+
// how SpyCloud accepts a hashed selector (`_digests` in its api_handlers).
|
|
2095
|
+
sha1: (value) => hex("sha1", value),
|
|
2096
|
+
sha256: (value) => hex("sha256", value)
|
|
2097
|
+
};
|
|
2098
|
+
TRANSFORMS = [...Object.keys(SIMPLE), `${STRIP_PREFIX}:<prefix>`];
|
|
2099
|
+
text = (value) => {
|
|
2100
|
+
if (typeof value === "string") return value;
|
|
2101
|
+
return Number.isInteger(value) ? String(value) : pyFloatRepr(value);
|
|
2102
|
+
};
|
|
2103
|
+
}
|
|
2104
|
+
});
|
|
2105
|
+
|
|
2106
|
+
// src/worlds/redaction.ts
|
|
2107
|
+
function pyText(value) {
|
|
2108
|
+
if (typeof value === "string") return value;
|
|
2109
|
+
if (Number.isInteger(value)) return String(value);
|
|
2110
|
+
if (Number.isNaN(value)) return "nan";
|
|
2111
|
+
if (!Number.isFinite(value)) return value > 0 ? "inf" : "-inf";
|
|
2112
|
+
return pyFloatRepr(value);
|
|
2113
|
+
}
|
|
2114
|
+
function hashForm(slug, plaintext) {
|
|
2115
|
+
return "sha256:" + (0, import_node_crypto4.createHash)("sha256").update(`${slug}:${pyText(plaintext)}`, "utf8").digest("hex");
|
|
2116
|
+
}
|
|
2117
|
+
function preserveForm(slug, plaintext) {
|
|
2118
|
+
const kind = typeof plaintext === "string" ? "str" : isInt(plaintext) ? "int" : "float";
|
|
2119
|
+
const shaped = shapeText(slug, pyText(plaintext), kind);
|
|
2120
|
+
return kind === "str" ? shaped : Number(shaped);
|
|
2121
|
+
}
|
|
2122
|
+
function shapeText(slug, text2, kind) {
|
|
2123
|
+
const seed = Buffer.from(`${slug}:${text2}`, "utf8");
|
|
2124
|
+
let digest = (0, import_node_crypto4.createHash)("sha256").update(seed).digest();
|
|
2125
|
+
let cursor = 0;
|
|
2126
|
+
const out = [];
|
|
2127
|
+
for (const char of text2) {
|
|
2128
|
+
if (cursor === digest.length) {
|
|
2129
|
+
digest = (0, import_node_crypto4.createHash)("sha256").update(Buffer.concat([digest, seed])).digest();
|
|
2130
|
+
cursor = 0;
|
|
2131
|
+
}
|
|
2132
|
+
const byte = digest[cursor];
|
|
2133
|
+
cursor += 1;
|
|
2134
|
+
if (char >= "0" && char <= "9") out.push(String(byte % 10));
|
|
2135
|
+
else if (kind === "str" && char >= "a" && char <= "z") out.push(String.fromCharCode(97 + byte % 26));
|
|
2136
|
+
else if (kind === "str" && char >= "A" && char <= "Z") out.push(String.fromCharCode(65 + byte % 26));
|
|
2137
|
+
else out.push(char);
|
|
2138
|
+
}
|
|
2139
|
+
if (kind === "int" && out.length > 1 && out[0] === "0") out[0] = String(1 + digest[0] % 9);
|
|
2140
|
+
return out.join("");
|
|
2141
|
+
}
|
|
2142
|
+
function roundForm(plaintext, decimals) {
|
|
2143
|
+
if (typeof plaintext === "string" || isInt(plaintext) || !Number.isFinite(plaintext)) return plaintext;
|
|
2144
|
+
return pyRound(new JsonNumber(pyFloatRepr(plaintext)), decimals).value;
|
|
2145
|
+
}
|
|
2146
|
+
function redactionOf(redact, field) {
|
|
2147
|
+
if (!redact) return null;
|
|
2148
|
+
const named = (names) => (names ?? []).some((name) => name === field || name.slice(name.lastIndexOf(".") + 1) === field);
|
|
2149
|
+
if (named(redact.drop)) return "drop";
|
|
2150
|
+
if (named(redact.hash)) return "hash";
|
|
2151
|
+
if (named(redact.preserve)) return "preserve";
|
|
2152
|
+
const decimals = redact.round?.[field];
|
|
2153
|
+
if (typeof decimals === "number") return `round:${decimals}`;
|
|
2154
|
+
return null;
|
|
2155
|
+
}
|
|
2156
|
+
function storedForms(world, field, plaintext, transform) {
|
|
2157
|
+
if (transform?.length) plaintext = applyTransforms(plaintext, transform);
|
|
2158
|
+
const policy = redactionOf(world.redact, field);
|
|
2159
|
+
const salt = world.redact?.slug ?? world.slug;
|
|
2160
|
+
if (policy === "drop") return [];
|
|
2161
|
+
if (policy === "hash") return [hashForm(salt, plaintext)];
|
|
2162
|
+
if (policy === "preserve") return [preserveForm(salt, plaintext)];
|
|
2163
|
+
if (policy !== null) return [roundForm(plaintext, world.redact.round[field])];
|
|
2164
|
+
return [plaintext];
|
|
2165
|
+
}
|
|
2166
|
+
var import_node_crypto4, isInt;
|
|
2167
|
+
var init_redaction = __esm({
|
|
2168
|
+
"src/worlds/redaction.ts"() {
|
|
2169
|
+
"use strict";
|
|
2170
|
+
import_node_crypto4 = require("crypto");
|
|
2171
|
+
init_json();
|
|
2172
|
+
init_transforms();
|
|
2173
|
+
isInt = (value) => typeof value === "number" && Number.isInteger(value);
|
|
2174
|
+
}
|
|
2175
|
+
});
|
|
2176
|
+
|
|
2177
|
+
// src/worlds/query.ts
|
|
2178
|
+
function queryRowsSearch(entity, opts = {}) {
|
|
2179
|
+
const search = new URLSearchParams();
|
|
2180
|
+
search.set("entity", entity);
|
|
2181
|
+
if (opts.where && Object.keys(opts.where).length) search.set("where", JSON.stringify(opts.where));
|
|
2182
|
+
if (opts.limit !== void 0) search.set("limit", String(opts.limit));
|
|
2183
|
+
if (opts.offset !== void 0) search.set("offset", String(opts.offset));
|
|
2184
|
+
if (opts.resolve) search.set("resolve", "true");
|
|
2185
|
+
if (opts.across) search.set("across", "true");
|
|
2186
|
+
if (opts.compare) search.set("compare", "true");
|
|
2187
|
+
return `?${search.toString()}`;
|
|
2188
|
+
}
|
|
2189
|
+
async function queryRows(slug, entity, opts = {}, options = {}) {
|
|
2190
|
+
if (slug.includes("@"))
|
|
2191
|
+
throw new Error(
|
|
2192
|
+
`queryRows reads a world's head version: pass the slug without @ref (got ${slug})`
|
|
2193
|
+
);
|
|
2194
|
+
if (!entity) throw new Error("queryRows needs an entity");
|
|
2195
|
+
if (opts.compare && !opts.across) throw new Error("queryRows: compare needs across");
|
|
2196
|
+
return apiRequest(
|
|
2197
|
+
options,
|
|
2198
|
+
"GET",
|
|
2199
|
+
`/api/public/worlds/${encodeURIComponent(slug)}/data${queryRowsSearch(entity, opts)}`
|
|
2200
|
+
);
|
|
2201
|
+
}
|
|
2202
|
+
var init_query = __esm({
|
|
2203
|
+
"src/worlds/query.ts"() {
|
|
2204
|
+
"use strict";
|
|
2205
|
+
init_worlds();
|
|
2206
|
+
}
|
|
2207
|
+
});
|
|
2208
|
+
|
|
2209
|
+
// src/worlds/migrate.ts
|
|
2210
|
+
async function migrateWorld(slug, input = {}, options = {}) {
|
|
2211
|
+
if (slug.includes("@"))
|
|
2212
|
+
throw new Error(
|
|
2213
|
+
`migrateWorld converts a world's head version: pass the slug without @ref (got ${slug})`
|
|
2214
|
+
);
|
|
2215
|
+
return apiRequest(
|
|
2216
|
+
options,
|
|
2217
|
+
"POST",
|
|
2218
|
+
`/api/public/worlds/${encodeURIComponent(slug)}/migrate`,
|
|
2219
|
+
{
|
|
2220
|
+
...input.apply === void 0 ? {} : { apply: input.apply },
|
|
2221
|
+
...input.force === void 0 ? {} : { force: input.force }
|
|
2222
|
+
}
|
|
2223
|
+
);
|
|
2224
|
+
}
|
|
2225
|
+
async function migrateProjectWorlds(input = {}, options = {}) {
|
|
2226
|
+
return apiRequest(
|
|
2227
|
+
options,
|
|
2228
|
+
"POST",
|
|
2229
|
+
"/api/public/worlds/migrate",
|
|
2230
|
+
input.apply === void 0 ? {} : { apply: input.apply }
|
|
2231
|
+
);
|
|
2232
|
+
}
|
|
2233
|
+
var init_migrate = __esm({
|
|
2234
|
+
"src/worlds/migrate.ts"() {
|
|
2235
|
+
"use strict";
|
|
2236
|
+
init_worlds();
|
|
2237
|
+
}
|
|
2238
|
+
});
|
|
2239
|
+
|
|
2240
|
+
// src/cli/router.ts
|
|
2241
|
+
var CliError;
|
|
2242
|
+
var init_router = __esm({
|
|
2243
|
+
"src/cli/router.ts"() {
|
|
2244
|
+
"use strict";
|
|
2245
|
+
CliError = class extends Error {
|
|
2246
|
+
constructor(message, exitCode = 2) {
|
|
2247
|
+
super(message);
|
|
2248
|
+
this.exitCode = exitCode;
|
|
2249
|
+
}
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
});
|
|
2253
|
+
|
|
2254
|
+
// src/cli/config.ts
|
|
2255
|
+
async function api(creds, method, route, body, init3 = {}) {
|
|
2256
|
+
const controller = new AbortController();
|
|
2257
|
+
const timer = setTimeout(() => controller.abort(), init3.timeoutMs ?? 12e4);
|
|
2258
|
+
try {
|
|
2259
|
+
const res = await fetch(`${creds.host}${route}`, {
|
|
2260
|
+
method,
|
|
2261
|
+
headers: {
|
|
2262
|
+
"content-type": "application/json",
|
|
2263
|
+
accept: "application/json",
|
|
2264
|
+
authorization: "Basic " + Buffer.from(`${creds.publicKey}:${creds.secretKey}`).toString("base64")
|
|
2265
|
+
},
|
|
2266
|
+
...body === void 0 ? {} : { body: JSON.stringify(body) },
|
|
2267
|
+
signal: controller.signal
|
|
2268
|
+
});
|
|
2269
|
+
const text2 = await res.text();
|
|
2270
|
+
if (!res.ok) throw new ApiError(res.status, method, route, text2);
|
|
2271
|
+
return text2 ? JSON.parse(text2) : {};
|
|
2272
|
+
} finally {
|
|
2273
|
+
clearTimeout(timer);
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
var fs2, os, path2, ApiError;
|
|
2277
|
+
var init_config = __esm({
|
|
2278
|
+
"src/cli/config.ts"() {
|
|
2279
|
+
"use strict";
|
|
2280
|
+
fs2 = __toESM(require("fs"));
|
|
2281
|
+
os = __toESM(require("os"));
|
|
2282
|
+
path2 = __toESM(require("path"));
|
|
2283
|
+
init_router();
|
|
2284
|
+
ApiError = class extends CliError {
|
|
2285
|
+
constructor(status, method, route, text2) {
|
|
2286
|
+
super(`${method} ${route} -> ${status}: ${text2.slice(0, 600)}`, 1);
|
|
2287
|
+
this.status = status;
|
|
2288
|
+
this.method = method;
|
|
2289
|
+
this.route = route;
|
|
2290
|
+
this.text = text2;
|
|
2291
|
+
}
|
|
2292
|
+
};
|
|
2293
|
+
}
|
|
2294
|
+
});
|
|
2295
|
+
|
|
2296
|
+
// src/cli/runtime/local.ts
|
|
2297
|
+
function tailOf(output) {
|
|
2298
|
+
return output.length > DIAGNOSTIC_TAIL ? `\u2026${output.slice(-DIAGNOSTIC_TAIL)}` : output;
|
|
2299
|
+
}
|
|
2300
|
+
function runtimeMode() {
|
|
2301
|
+
const raw = (process.env.GATEWAY_RUNTIME ?? "auto").toLowerCase();
|
|
2302
|
+
if (raw === "local" || raw === "platform" || raw === "auto") return raw;
|
|
2303
|
+
throw new CliError(
|
|
2304
|
+
`GATEWAY_RUNTIME must be local, platform or auto (got ${raw})`
|
|
2305
|
+
);
|
|
2306
|
+
}
|
|
2307
|
+
function runtimeRoot() {
|
|
2308
|
+
const candidates = [];
|
|
2309
|
+
if (process.env.GATEWAY_RUNTIME_PATH)
|
|
2310
|
+
candidates.push(process.env.GATEWAY_RUNTIME_PATH);
|
|
2311
|
+
const entry = process.argv[1] && fs3.existsSync(process.argv[1]) ? path3.dirname(fs3.realpathSync(process.argv[1])) : null;
|
|
2312
|
+
if (entry) {
|
|
2313
|
+
candidates.push(path3.resolve(entry, "..", "runtime"));
|
|
2314
|
+
candidates.push(path3.resolve(entry, "..", "..", "runtime"));
|
|
2315
|
+
candidates.push(path3.resolve(entry, "..", "..", "sdk", "src"));
|
|
2316
|
+
}
|
|
2317
|
+
candidates.push(path3.resolve(process.cwd(), "runtime"));
|
|
2318
|
+
for (const root of candidates)
|
|
2319
|
+
if (fs3.existsSync(
|
|
2320
|
+
path3.join(root, "gatewaysdk", "environment", "schema", "platform.py")
|
|
2321
|
+
))
|
|
2322
|
+
return root;
|
|
2323
|
+
return null;
|
|
2324
|
+
}
|
|
2325
|
+
function probeVersion(name) {
|
|
2326
|
+
const probe = (0, import_node_child_process.spawnSync)(
|
|
2327
|
+
name,
|
|
2328
|
+
["-c", "import sys;print(sys.version_info[0],sys.version_info[1])"],
|
|
2329
|
+
{ encoding: "utf8", timeout: 1e4 }
|
|
2330
|
+
);
|
|
2331
|
+
if (probe.status !== 0) return null;
|
|
2332
|
+
const [major, minor] = probe.stdout.trim().split(/\s+/).map(Number);
|
|
2333
|
+
return Number.isInteger(major) && Number.isInteger(minor) ? `${major}.${minor}` : null;
|
|
2334
|
+
}
|
|
2335
|
+
function atLeastMinimum(version) {
|
|
2336
|
+
const [major, minor] = version.split(".").map(Number);
|
|
2337
|
+
return major > MIN_PYTHON[0] || major === MIN_PYTHON[0] && minor >= MIN_PYTHON[1];
|
|
2338
|
+
}
|
|
2339
|
+
function uvPython() {
|
|
2340
|
+
const found = (0, import_node_child_process.spawnSync)("uv", UV_FIND, { encoding: "utf8", timeout: 1e4 });
|
|
2341
|
+
if (found.status !== 0) return null;
|
|
2342
|
+
const line = found.stdout.trim().split(/\r?\n/)[0] ?? "";
|
|
2343
|
+
return line || null;
|
|
2344
|
+
}
|
|
2345
|
+
function findPython() {
|
|
2346
|
+
if (pythonCache !== void 0) return pythonCache;
|
|
2347
|
+
const named = process.env.GATEWAY_PYTHON;
|
|
2348
|
+
const candidates = named ? [named] : PYTHON_CANDIDATES;
|
|
2349
|
+
for (const name of candidates) {
|
|
2350
|
+
const version = probeVersion(name);
|
|
2351
|
+
pythonProbes.push({ name, version });
|
|
2352
|
+
if (version && atLeastMinimum(version)) {
|
|
2353
|
+
pythonCache = name;
|
|
2354
|
+
return name;
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
if (!named) {
|
|
2358
|
+
const fromUv = uvPython();
|
|
2359
|
+
const version = fromUv ? probeVersion(fromUv) : null;
|
|
2360
|
+
pythonProbes.push({ name: fromUv ?? "uv python find", version });
|
|
2361
|
+
if (fromUv && version && atLeastMinimum(version)) {
|
|
2362
|
+
pythonCache = fromUv;
|
|
2363
|
+
return fromUv;
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
pythonCache = null;
|
|
2367
|
+
return null;
|
|
2368
|
+
}
|
|
2369
|
+
function pythonAdvice() {
|
|
2370
|
+
findPython();
|
|
2371
|
+
const floor = MIN_PYTHON.join(".");
|
|
2372
|
+
const named = process.env.GATEWAY_PYTHON;
|
|
2373
|
+
const seen = pythonProbes.filter((probe) => probe.version).map((probe) => `${probe.name} is ${probe.version}`);
|
|
2374
|
+
const found = seen.length ? seen.join(", ") : named ? `${named} did not run` : "none on PATH";
|
|
2375
|
+
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)".`;
|
|
2376
|
+
}
|
|
2377
|
+
function localRuntimeReason() {
|
|
2378
|
+
if (runtimeMode() === "platform")
|
|
2379
|
+
return "GATEWAY_RUNTIME=platform forces the hosted side.";
|
|
2380
|
+
if (!findPython()) return pythonAdvice();
|
|
2381
|
+
if (!runtimeRoot())
|
|
2382
|
+
return "The bundled runtime is missing (set GATEWAY_RUNTIME_PATH).";
|
|
2383
|
+
return "";
|
|
2384
|
+
}
|
|
2385
|
+
function localRuntime() {
|
|
2386
|
+
if (runtimeMode() === "platform") return null;
|
|
2387
|
+
const python = findPython();
|
|
2388
|
+
const root = runtimeRoot();
|
|
2389
|
+
if (!python || !root) {
|
|
2390
|
+
if (runtimeMode() === "local")
|
|
2391
|
+
throw new CliError(
|
|
2392
|
+
!python ? `GATEWAY_RUNTIME=local but ${pythonAdvice()}` : "GATEWAY_RUNTIME=local but the bundled runtime is missing (set GATEWAY_RUNTIME_PATH)"
|
|
2393
|
+
);
|
|
2394
|
+
return null;
|
|
2395
|
+
}
|
|
2396
|
+
return { python, root };
|
|
2397
|
+
}
|
|
2398
|
+
function localPythonHasYaml(python) {
|
|
2399
|
+
return (0, import_node_child_process.spawnSync)(python, ["-c", "import yaml"], { timeout: 1e4 }).status === 0;
|
|
2400
|
+
}
|
|
2401
|
+
async function localBridge(request, local, opts = {}) {
|
|
2402
|
+
const input = JSON.stringify(request);
|
|
2403
|
+
return await new Promise((resolve7, reject) => {
|
|
2404
|
+
const child = (0, import_node_child_process.spawn)(
|
|
2405
|
+
local.python,
|
|
2406
|
+
["-I", "-B", "-c", BRIDGE_BOOTSTRAP, local.root],
|
|
2407
|
+
{
|
|
2408
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
2409
|
+
// This is the author's machine running the author's world: the one
|
|
2410
|
+
// place the runtime may import and run a world's own Python (check's
|
|
2411
|
+
// handler execution, `worlds call`, `worlds test` tool cases).
|
|
2412
|
+
env: {
|
|
2413
|
+
PATH: process.env.PATH ?? "",
|
|
2414
|
+
HOME: process.env.HOME ?? "",
|
|
2415
|
+
TMPDIR: process.env.TMPDIR ?? "",
|
|
2416
|
+
GATEWAY_RUNTIME_EXECUTE: "1"
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
);
|
|
2420
|
+
const out = [];
|
|
2421
|
+
const err = [];
|
|
2422
|
+
const timer = setTimeout(
|
|
2423
|
+
() => child.kill("SIGKILL"),
|
|
2424
|
+
opts.timeoutMs ?? 3e5
|
|
2425
|
+
);
|
|
2426
|
+
child.stdout.on("data", (chunk) => out.push(chunk));
|
|
2427
|
+
child.stderr.on("data", (chunk) => err.push(chunk));
|
|
2428
|
+
child.on("error", (error) => {
|
|
2429
|
+
clearTimeout(timer);
|
|
2430
|
+
reject(
|
|
2431
|
+
new CliError(
|
|
2432
|
+
`local runtime could not start (${local.python}): ${error.message}`,
|
|
2433
|
+
1
|
|
2434
|
+
)
|
|
2435
|
+
);
|
|
2436
|
+
});
|
|
2437
|
+
child.on("close", (code) => {
|
|
2438
|
+
clearTimeout(timer);
|
|
2439
|
+
const text2 = Buffer.concat(out).toString("utf8");
|
|
2440
|
+
const stderr = Buffer.concat(err).toString("utf8");
|
|
2441
|
+
let payload = null;
|
|
2442
|
+
try {
|
|
2443
|
+
payload = text2 ? JSON.parse(text2) : null;
|
|
2444
|
+
} catch {
|
|
2445
|
+
payload = null;
|
|
2446
|
+
}
|
|
2447
|
+
if (payload && typeof payload === "object") {
|
|
2448
|
+
resolve7(payload);
|
|
2449
|
+
return;
|
|
2450
|
+
}
|
|
2451
|
+
reject(
|
|
2452
|
+
new CliError(
|
|
2453
|
+
`local runtime (${request.command}) exited ${code}: ${tailOf((stderr || text2).trim()) || "no output"}`,
|
|
2454
|
+
1
|
|
2455
|
+
)
|
|
2456
|
+
);
|
|
2457
|
+
});
|
|
2458
|
+
child.stdin.end(input);
|
|
2459
|
+
});
|
|
2460
|
+
}
|
|
2461
|
+
var import_node_child_process, fs3, net, path3, MIN_PYTHON, DIAGNOSTIC_TAIL, BRIDGE_BOOTSTRAP, pythonCache, pythonProbes, PYTHON_CANDIDATES, UV_FIND;
|
|
2462
|
+
var init_local = __esm({
|
|
2463
|
+
"src/cli/runtime/local.ts"() {
|
|
2464
|
+
"use strict";
|
|
2465
|
+
import_node_child_process = require("child_process");
|
|
2466
|
+
fs3 = __toESM(require("fs"));
|
|
2467
|
+
net = __toESM(require("net"));
|
|
2468
|
+
path3 = __toESM(require("path"));
|
|
2469
|
+
init_router();
|
|
2470
|
+
init_config();
|
|
2471
|
+
MIN_PYTHON = [3, 11];
|
|
2472
|
+
DIAGNOSTIC_TAIL = 600;
|
|
2473
|
+
BRIDGE_BOOTSTRAP = `import sys,runpy,types,os
|
|
2474
|
+
root=sys.argv[1]
|
|
2475
|
+
package=types.ModuleType('gatewaysdk')
|
|
2476
|
+
package.__path__=[os.path.join(root,'gatewaysdk')]
|
|
2477
|
+
sys.modules['gatewaysdk']=package
|
|
2478
|
+
runpy.run_module('gatewaysdk.environment.schema.platform',run_name='__main__')`;
|
|
2479
|
+
pythonProbes = [];
|
|
2480
|
+
PYTHON_CANDIDATES = [
|
|
2481
|
+
"python3.13",
|
|
2482
|
+
"python3.12",
|
|
2483
|
+
"python3.11",
|
|
2484
|
+
"python3",
|
|
2485
|
+
"python"
|
|
2486
|
+
];
|
|
2487
|
+
UV_FIND = ["python", "find", `>=${MIN_PYTHON.join(".")}`];
|
|
2488
|
+
}
|
|
2489
|
+
});
|
|
2490
|
+
|
|
2491
|
+
// src/cli/runtime/client.ts
|
|
2492
|
+
function isBuildOutput(relPath) {
|
|
2493
|
+
return BUILD_OUTPUT.test(relPath);
|
|
2494
|
+
}
|
|
2495
|
+
function readWorldFiles(dir, opts = {}) {
|
|
2496
|
+
if (!fs4.existsSync(dir) || !fs4.statSync(dir).isDirectory())
|
|
2497
|
+
throw new CliError(`Not a directory: ${dir}`);
|
|
2498
|
+
const out = [];
|
|
2499
|
+
const walk = (rel) => {
|
|
2500
|
+
const abs = rel ? path4.join(dir, rel) : dir;
|
|
2501
|
+
const entries = fs4.readdirSync(abs, { withFileTypes: true });
|
|
2502
|
+
entries.sort((a, b) => a.name.localeCompare(b.name));
|
|
2503
|
+
for (const entry of entries) {
|
|
2504
|
+
const childRel = rel ? `${rel}/${entry.name}` : entry.name;
|
|
2505
|
+
if (entry.isDirectory()) {
|
|
2506
|
+
if (!SKIP_DIRS2.has(entry.name)) walk(childRel);
|
|
2507
|
+
} else if (entry.isFile()) {
|
|
2508
|
+
if (!opts.buildOutputs && isBuildOutput(childRel)) continue;
|
|
2509
|
+
out.push({
|
|
2510
|
+
path: childRel,
|
|
2511
|
+
content: fs4.readFileSync(path4.join(dir, childRel)).toString("base64")
|
|
2512
|
+
});
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
};
|
|
2516
|
+
walk("");
|
|
2517
|
+
return out.sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
|
|
2518
|
+
}
|
|
2519
|
+
function assertSafeRelPath(rel) {
|
|
2520
|
+
const parts = rel.split("/");
|
|
2521
|
+
if (!rel || rel.startsWith("/") || rel.includes("\\") || /^[A-Za-z]:/.test(rel) || parts.some((p) => p === "" || p === "." || p === ".."))
|
|
2522
|
+
throw new CliError(`The runtime returned an unsafe file path: ${rel}`, 1);
|
|
2523
|
+
}
|
|
2524
|
+
function writeWorldFiles(dir, files, opts = {}) {
|
|
2525
|
+
for (const file of files) assertSafeRelPath(file.path);
|
|
2526
|
+
if (opts.clean && fs4.existsSync(dir)) {
|
|
2527
|
+
const keep = new Set(files.map((f) => f.path));
|
|
2528
|
+
for (const existing of readWorldFiles(dir)) {
|
|
2529
|
+
if (!keep.has(existing.path)) fs4.rmSync(path4.join(dir, existing.path));
|
|
2530
|
+
}
|
|
2531
|
+
pruneEmptyDirs(dir);
|
|
2532
|
+
}
|
|
2533
|
+
fs4.mkdirSync(dir, { recursive: true });
|
|
2534
|
+
const written = [];
|
|
2535
|
+
for (const file of files) {
|
|
2536
|
+
const target = path4.join(dir, file.path);
|
|
2537
|
+
fs4.mkdirSync(path4.dirname(target), { recursive: true });
|
|
2538
|
+
fs4.writeFileSync(target, Buffer.from(file.content, "base64"));
|
|
2539
|
+
written.push(file.path);
|
|
2540
|
+
}
|
|
2541
|
+
return written;
|
|
2542
|
+
}
|
|
2543
|
+
function pruneEmptyDirs(root) {
|
|
2544
|
+
const walk = (abs) => {
|
|
2545
|
+
let empty = true;
|
|
2546
|
+
for (const entry of fs4.readdirSync(abs, { withFileTypes: true })) {
|
|
2547
|
+
const child = path4.join(abs, entry.name);
|
|
2548
|
+
if (entry.isDirectory()) {
|
|
2549
|
+
if (SKIP_DIRS2.has(entry.name)) {
|
|
2550
|
+
empty = false;
|
|
2551
|
+
continue;
|
|
2552
|
+
}
|
|
2553
|
+
if (walk(child)) fs4.rmdirSync(child);
|
|
2554
|
+
else empty = false;
|
|
2555
|
+
} else empty = false;
|
|
2556
|
+
}
|
|
2557
|
+
return empty;
|
|
2558
|
+
};
|
|
2559
|
+
walk(root);
|
|
2560
|
+
}
|
|
2561
|
+
function formatBridgeError(detail) {
|
|
2562
|
+
const where = detail.schema_path || detail.path || "/";
|
|
2563
|
+
return `${detail.code} at ${where}: ${detail.message}`;
|
|
2564
|
+
}
|
|
2565
|
+
function detailFrom(payload) {
|
|
2566
|
+
if (!payload || typeof payload !== "object") return null;
|
|
2567
|
+
const error = payload.error;
|
|
2568
|
+
if (!error || typeof error !== "object") return null;
|
|
2569
|
+
const detail = error;
|
|
2570
|
+
if (typeof detail.code !== "string" || typeof detail.message !== "string") return null;
|
|
2571
|
+
return detail;
|
|
2572
|
+
}
|
|
2573
|
+
async function runtime(creds, request, opts = {}) {
|
|
2574
|
+
const local = localRuntime();
|
|
2575
|
+
const yamlSpec = request.command === "conform" && Array.isArray(request.openapi) && request.openapi.some((doc) => /\.ya?ml$/i.test(doc.path ?? ""));
|
|
2576
|
+
if (local && !(yamlSpec && !localPythonHasYaml(local.python))) {
|
|
2577
|
+
const payload = await localBridge(request, local, opts);
|
|
2578
|
+
const detail = detailFrom(payload);
|
|
2579
|
+
if (detail) throw new BridgeRejected(detail);
|
|
2580
|
+
return payload;
|
|
2581
|
+
}
|
|
2582
|
+
if (!creds)
|
|
2583
|
+
throw new CliError(
|
|
2584
|
+
"This needs the schema runtime (the CLI bundles it) or platform credentials (`gateway auth login`). " + localRuntimeReason()
|
|
2585
|
+
);
|
|
2586
|
+
const controller = new AbortController();
|
|
2587
|
+
const timer = setTimeout(() => controller.abort(), opts.timeoutMs ?? 18e4);
|
|
2588
|
+
const route = "/api/public/worlds/runtime";
|
|
2589
|
+
try {
|
|
2590
|
+
const res = await fetch(`${creds.host}${route}`, {
|
|
2591
|
+
method: "POST",
|
|
2592
|
+
headers: {
|
|
2593
|
+
"content-type": "application/json",
|
|
2594
|
+
accept: "application/json",
|
|
2595
|
+
authorization: "Basic " + Buffer.from(`${creds.publicKey}:${creds.secretKey}`).toString("base64")
|
|
2596
|
+
},
|
|
2597
|
+
body: JSON.stringify(request),
|
|
2598
|
+
signal: controller.signal
|
|
2599
|
+
});
|
|
2600
|
+
const text2 = await res.text();
|
|
2601
|
+
let payload = null;
|
|
2602
|
+
try {
|
|
2603
|
+
payload = text2 ? JSON.parse(text2) : {};
|
|
2604
|
+
} catch {
|
|
2605
|
+
payload = null;
|
|
2606
|
+
}
|
|
2607
|
+
const detail = detailFrom(payload);
|
|
2608
|
+
if (detail) throw new BridgeRejected(detail);
|
|
2609
|
+
if (!res.ok)
|
|
2610
|
+
throw new CliError(`POST ${route} (${request.command}) -> ${res.status}: ${text2.slice(0, 600)}`, 1);
|
|
2611
|
+
if (payload === null) throw new CliError(`POST ${route} (${request.command}) returned non-JSON`, 1);
|
|
2612
|
+
return payload;
|
|
2613
|
+
} finally {
|
|
2614
|
+
clearTimeout(timer);
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
var fs4, path4, SKIP_DIRS2, BUILD_OUTPUT, BridgeRejected;
|
|
2618
|
+
var init_client = __esm({
|
|
2619
|
+
"src/cli/runtime/client.ts"() {
|
|
2620
|
+
"use strict";
|
|
2621
|
+
fs4 = __toESM(require("fs"));
|
|
2622
|
+
path4 = __toESM(require("path"));
|
|
2623
|
+
init_router();
|
|
2624
|
+
init_local();
|
|
2625
|
+
SKIP_DIRS2 = /* @__PURE__ */ new Set(["__pycache__", ".git", "node_modules", ".gateway"]);
|
|
2626
|
+
BUILD_OUTPUT = /(^|\/)state\.(sqlite|json)$/;
|
|
2627
|
+
BridgeRejected = class extends CliError {
|
|
2628
|
+
constructor(detail) {
|
|
2629
|
+
super(formatBridgeError(detail), 1);
|
|
2630
|
+
this.detail = detail;
|
|
2631
|
+
}
|
|
2632
|
+
};
|
|
2633
|
+
}
|
|
2634
|
+
});
|
|
2635
|
+
|
|
2636
|
+
// src/cli/runtime/data.ts
|
|
2637
|
+
var data_exports = {};
|
|
2638
|
+
__export(data_exports, {
|
|
2639
|
+
checkLocalWorldData: () => checkLocalWorldData,
|
|
2640
|
+
dropBuildOutputs: () => dropBuildOutputs,
|
|
2641
|
+
importLocalWorldData: () => importLocalWorldData,
|
|
2642
|
+
ingestLocalToolCalls: () => ingestLocalToolCalls,
|
|
2643
|
+
queryLocalWorldData: () => queryLocalWorldData,
|
|
2644
|
+
queryLocalWorldDataAcross: () => queryLocalWorldDataAcross,
|
|
2645
|
+
showLocalWorldData: () => showLocalWorldData
|
|
2646
|
+
});
|
|
2647
|
+
async function importLocalWorldData(dir, rows, opts, creds) {
|
|
2648
|
+
const res = await runtime(creds, {
|
|
2649
|
+
command: "import-data",
|
|
2650
|
+
files: readWorldFiles(dir),
|
|
2651
|
+
rows,
|
|
2652
|
+
mode: opts.mode ?? "append",
|
|
2653
|
+
...opts.redact && opts.redact !== "off" ? { redact: opts.redact } : {}
|
|
2654
|
+
});
|
|
2655
|
+
if (res.files?.length) writeWorldFiles(dir, res.files);
|
|
2656
|
+
if (res.changed) dropBuildOutputs(dir);
|
|
2657
|
+
return {
|
|
2658
|
+
kind: res.kind ?? "unknown",
|
|
2659
|
+
entity_counts: res.entity_counts ?? {},
|
|
2660
|
+
changed: Boolean(res.changed)
|
|
2661
|
+
};
|
|
2662
|
+
}
|
|
2663
|
+
function dropBuildOutputs(dir) {
|
|
2664
|
+
const dropped = [];
|
|
2665
|
+
for (const file of readWorldFiles(dir, { buildOutputs: true })) {
|
|
2666
|
+
if (!BUILD_OUTPUT2.test(file.path)) continue;
|
|
2667
|
+
fs5.rmSync(path5.join(dir, file.path), { force: true });
|
|
2668
|
+
dropped.push(file.path);
|
|
2669
|
+
}
|
|
2670
|
+
return dropped;
|
|
2671
|
+
}
|
|
2672
|
+
async function checkLocalWorldData(dir, rows, creds, opts = {}) {
|
|
2673
|
+
const res = await runtime(creds, {
|
|
2674
|
+
command: "import-data",
|
|
2675
|
+
files: readWorldFiles(dir),
|
|
2676
|
+
rows,
|
|
2677
|
+
mode: "append",
|
|
2678
|
+
...opts.redact && opts.redact !== "off" ? { redact: opts.redact } : {}
|
|
2679
|
+
});
|
|
2680
|
+
return {
|
|
2681
|
+
kind: res.kind ?? "unknown",
|
|
2682
|
+
entity_counts: res.entity_counts ?? {},
|
|
2683
|
+
changed: Boolean(res.changed)
|
|
2684
|
+
};
|
|
2685
|
+
}
|
|
2686
|
+
async function showLocalWorldData(dir, entity, creds) {
|
|
2687
|
+
const res = await runtime(creds, {
|
|
2688
|
+
command: "counts",
|
|
2689
|
+
files: readWorldFiles(dir),
|
|
2690
|
+
...entity ? { entity } : {}
|
|
2691
|
+
});
|
|
2692
|
+
const out = { kind: res.kind ?? "unknown" };
|
|
2693
|
+
if (entity) {
|
|
2694
|
+
out.entity = entity;
|
|
2695
|
+
out.rows = res.rows ?? [];
|
|
2696
|
+
} else out.entity_counts = res.entity_counts ?? {};
|
|
2697
|
+
return out;
|
|
2698
|
+
}
|
|
2699
|
+
async function queryLocalWorldData(dir, entity, where, opts, creds) {
|
|
2700
|
+
const res = await runtime(creds, {
|
|
2701
|
+
command: "query",
|
|
2702
|
+
files: readWorldFiles(dir),
|
|
2703
|
+
entity,
|
|
2704
|
+
...Object.keys(where).length ? { where } : {},
|
|
2705
|
+
...opts.limit !== void 0 ? { limit: opts.limit } : {},
|
|
2706
|
+
...opts.offset !== void 0 ? { offset: opts.offset } : {},
|
|
2707
|
+
...opts.resolve ? { resolve: true } : {},
|
|
2708
|
+
...opts.scenario ? { scenario: opts.scenario } : {}
|
|
2709
|
+
});
|
|
2710
|
+
const rows = res.rows ?? [];
|
|
2711
|
+
return {
|
|
2712
|
+
...res.kind ? { kind: res.kind } : {},
|
|
2713
|
+
entity: res.entity ?? entity,
|
|
2714
|
+
...res.scenario ? { scenario: res.scenario } : {},
|
|
2715
|
+
rows,
|
|
2716
|
+
count: res.count ?? rows.length,
|
|
2717
|
+
total: res.total ?? null,
|
|
2718
|
+
limit: res.limit ?? opts.limit ?? rows.length,
|
|
2719
|
+
offset: res.offset ?? opts.offset ?? 0,
|
|
2720
|
+
...res.resolved ? { resolved: res.resolved } : {}
|
|
2721
|
+
};
|
|
2722
|
+
}
|
|
2723
|
+
async function queryLocalWorldDataAcross(dir, entity, where, opts) {
|
|
2724
|
+
const local = localRuntime();
|
|
2725
|
+
if (!local)
|
|
2726
|
+
throw new CliError(
|
|
2727
|
+
"`--across` on a directory reads the linked worlds at their paths, so it needs the bundled runtime on this machine. " + localRuntimeReason(),
|
|
2728
|
+
1
|
|
2729
|
+
);
|
|
2730
|
+
const payload = await localBridge(
|
|
2731
|
+
{
|
|
2732
|
+
command: "query",
|
|
2733
|
+
world: path5.resolve(dir),
|
|
2734
|
+
entity,
|
|
2735
|
+
across: true,
|
|
2736
|
+
...opts.compare ? { compare: true } : {},
|
|
2737
|
+
...Object.keys(where).length ? { where } : {},
|
|
2738
|
+
...opts.limit !== void 0 ? { limit: opts.limit } : {},
|
|
2739
|
+
...opts.offset !== void 0 ? { offset: opts.offset } : {},
|
|
2740
|
+
...opts.resolve ? { resolve: true } : {},
|
|
2741
|
+
...opts.scenario ? { scenario: opts.scenario } : {}
|
|
2742
|
+
},
|
|
2743
|
+
local
|
|
2744
|
+
);
|
|
2745
|
+
const detail = detailFrom(payload);
|
|
2746
|
+
if (detail) throw new BridgeRejected(detail);
|
|
2747
|
+
return payload;
|
|
2748
|
+
}
|
|
2749
|
+
async function ingestLocalToolCalls(dir, records, opts, creds) {
|
|
2750
|
+
const res = await runtime(creds, {
|
|
2751
|
+
command: "ingest-calls",
|
|
2752
|
+
files: readWorldFiles(dir),
|
|
2753
|
+
records,
|
|
2754
|
+
mode: opts.mode ?? "append",
|
|
2755
|
+
...opts.dryRun ? { dry_run: true } : {},
|
|
2756
|
+
...opts.redact && opts.redact !== "off" ? { redact: opts.redact } : {},
|
|
2757
|
+
...opts.map !== void 0 ? { map: opts.map } : {}
|
|
2758
|
+
});
|
|
2759
|
+
if (!opts.dryRun && res.files?.length) writeWorldFiles(dir, res.files);
|
|
2760
|
+
if (res.changed) dropBuildOutputs(dir);
|
|
2761
|
+
return {
|
|
2762
|
+
...res.via ? { via: res.via } : {},
|
|
2763
|
+
...res.sources ? { sources: res.sources } : {},
|
|
2764
|
+
...res.unmatched ? { unmatched: res.unmatched } : {},
|
|
2765
|
+
...res.note ? { note: res.note } : {},
|
|
2766
|
+
records: res.records ?? records.length,
|
|
2767
|
+
ingested: res.ingested ?? 0,
|
|
2768
|
+
skipped: res.skipped ?? {},
|
|
2769
|
+
refusals: res.refusals ?? [],
|
|
2770
|
+
rows: res.rows ?? {},
|
|
2771
|
+
...res.projected ? { projected: res.projected } : {},
|
|
2772
|
+
dry_run: Boolean(res.dry_run ?? opts.dryRun),
|
|
2773
|
+
redact: res.redact ?? opts.redact ?? "off",
|
|
2774
|
+
changed: Boolean(res.changed),
|
|
2775
|
+
...res.kind ? { kind: res.kind } : {},
|
|
2776
|
+
...res.entity_counts ? { entity_counts: res.entity_counts } : {},
|
|
2777
|
+
...res.batch !== void 0 ? { batch: res.batch } : {}
|
|
2778
|
+
};
|
|
2779
|
+
}
|
|
2780
|
+
var fs5, path5, BUILD_OUTPUT2;
|
|
2781
|
+
var init_data = __esm({
|
|
2782
|
+
"src/cli/runtime/data.ts"() {
|
|
2783
|
+
"use strict";
|
|
2784
|
+
fs5 = __toESM(require("fs"));
|
|
2785
|
+
path5 = __toESM(require("path"));
|
|
2786
|
+
init_router();
|
|
2787
|
+
init_client();
|
|
2788
|
+
init_local();
|
|
2789
|
+
BUILD_OUTPUT2 = /(^|\/)state\.(sqlite|json)$/;
|
|
2790
|
+
}
|
|
2791
|
+
});
|
|
2792
|
+
|
|
2793
|
+
// src/cli/platform/worldData/transform.ts
|
|
2794
|
+
var transform_exports = {};
|
|
2795
|
+
__export(transform_exports, {
|
|
2796
|
+
DEFAULT_TRANSFORM_TIMEOUT_MS: () => DEFAULT_TRANSFORM_TIMEOUT_MS,
|
|
2797
|
+
NODE_SUFFIXES: () => NODE_SUFFIXES,
|
|
2798
|
+
NODE_WRAPPER: () => NODE_WRAPPER,
|
|
2799
|
+
PYTHON_SUFFIXES: () => PYTHON_SUFFIXES,
|
|
2800
|
+
PY_WRAPPER: () => PY_WRAPPER,
|
|
2801
|
+
checkRows: () => checkRows,
|
|
2802
|
+
runTransform: () => runTransform,
|
|
2803
|
+
transformRecords: () => transformRecords
|
|
2804
|
+
});
|
|
2805
|
+
function checkRows(value, where) {
|
|
2806
|
+
if (!isObject(value)) throw new CliError(`${where} must return {entity: [rows]}; got ${value === null ? "null" : Array.isArray(value) ? "an array" : typeof value}`, 1);
|
|
2807
|
+
for (const [entity, listed] of Object.entries(value)) {
|
|
2808
|
+
if (!Array.isArray(listed)) throw new CliError(`${where}: ${entity} must be a list of rows; got ${listed === null ? "null" : typeof listed}`, 1);
|
|
2809
|
+
listed.forEach((row, index) => {
|
|
2810
|
+
if (!isObject(row)) throw new CliError(`${where}: ${entity}[${index}] is not an object`, 1);
|
|
2811
|
+
});
|
|
2812
|
+
}
|
|
2813
|
+
return value;
|
|
2814
|
+
}
|
|
2815
|
+
function typescriptPrefix() {
|
|
2816
|
+
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
2817
|
+
if (!process.env.GATEWAY_NODE && (major > 22 || major === 22 && minor >= 6)) return ["--experimental-strip-types", "--no-warnings"];
|
|
2818
|
+
try {
|
|
2819
|
+
return [(0, import_node_module.createRequire)(import_meta.url).resolve("tsx/cli")];
|
|
2820
|
+
} catch {
|
|
2821
|
+
throw new CliError(
|
|
2822
|
+
`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`,
|
|
2823
|
+
1
|
|
2824
|
+
);
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
function command(script, wrapperDir) {
|
|
2828
|
+
const suffix = path6.extname(script).toLowerCase();
|
|
2829
|
+
if (PYTHON_SUFFIXES.includes(suffix)) return { file: process.env.GATEWAY_PYTHON || "python3", args: ["-c", PY_WRAPPER, script] };
|
|
2830
|
+
if (NODE_SUFFIXES.includes(suffix)) {
|
|
2831
|
+
const wrapper = path6.join(wrapperDir, "transform-wrapper.mjs");
|
|
2832
|
+
fs6.writeFileSync(wrapper, NODE_WRAPPER);
|
|
2833
|
+
const flags = suffix === ".ts" || suffix === ".mts" ? typescriptPrefix() : [];
|
|
2834
|
+
return { file: process.env.GATEWAY_NODE || process.execPath, args: [...flags, wrapper, script] };
|
|
2835
|
+
}
|
|
2836
|
+
throw new CliError(`${path6.basename(script)}: a transform script is .py, .ts, .mjs, .js or .cjs`, 1);
|
|
2837
|
+
}
|
|
2838
|
+
async function runTransform(script, records, opts = {}) {
|
|
2839
|
+
if (!fs6.existsSync(script) || !fs6.statSync(script).isFile()) throw new CliError(`no transform script at ${script}`, 1);
|
|
2840
|
+
const resolved = path6.resolve(script);
|
|
2841
|
+
const name = path6.basename(script);
|
|
2842
|
+
const timeoutMs = opts.timeoutMs ?? DEFAULT_TRANSFORM_TIMEOUT_MS;
|
|
2843
|
+
const scratch = fs6.mkdtempSync(path6.join(os2.tmpdir(), "gateway-transform-"));
|
|
2844
|
+
try {
|
|
2845
|
+
const { file, args } = command(resolved, scratch);
|
|
2846
|
+
const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => !SCRUBBED.test(key)));
|
|
2847
|
+
const done = await new Promise((resolve7, reject) => {
|
|
2848
|
+
const child = (0, import_node_child_process2.spawn)(file, args, { cwd: path6.dirname(resolved), env, stdio: ["pipe", "pipe", "pipe"] });
|
|
2849
|
+
let stdout = "";
|
|
2850
|
+
let stderr = "";
|
|
2851
|
+
let timedOut = false;
|
|
2852
|
+
const timer = setTimeout(() => {
|
|
2853
|
+
timedOut = true;
|
|
2854
|
+
child.kill("SIGKILL");
|
|
2855
|
+
}, timeoutMs);
|
|
2856
|
+
child.stdout.setEncoding("utf8").on("data", (chunk) => stdout += chunk);
|
|
2857
|
+
child.stderr.setEncoding("utf8").on("data", (chunk) => stderr += chunk);
|
|
2858
|
+
child.on("error", (error) => {
|
|
2859
|
+
clearTimeout(timer);
|
|
2860
|
+
reject(new CliError(`${name}: cannot run ${file}: ${error.message}`, 1));
|
|
2861
|
+
});
|
|
2862
|
+
child.on("close", (code) => {
|
|
2863
|
+
clearTimeout(timer);
|
|
2864
|
+
resolve7({ code, stdout, stderr, timedOut });
|
|
2865
|
+
});
|
|
2866
|
+
child.stdin.on("error", () => void 0);
|
|
2867
|
+
child.stdin.end(records.map((record) => JSON.stringify(record) + "\n").join(""));
|
|
2868
|
+
});
|
|
2869
|
+
if (done.timedOut) throw new CliError(`${name} timed out after ${timeoutMs / 1e3}s${tail(done.stderr)}`, 1);
|
|
2870
|
+
if (done.code !== 0) throw new CliError(`${name} exited ${done.code ?? "?"}${tail(done.stderr)}`, 1);
|
|
2871
|
+
let value;
|
|
2872
|
+
try {
|
|
2873
|
+
value = done.stdout.trim() ? JSON.parse(done.stdout) : null;
|
|
2874
|
+
} catch {
|
|
2875
|
+
throw new CliError(`${name} printed something other than the rows document${tail(done.stderr)}`, 1);
|
|
2876
|
+
}
|
|
2877
|
+
return { rows: checkRows(value, name), stderr: done.stderr };
|
|
2878
|
+
} finally {
|
|
2879
|
+
fs6.rmSync(scratch, { recursive: true, force: true });
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
async function transformRecords(transform, records, opts = {}) {
|
|
2883
|
+
if (typeof transform === "function") return { rows: checkRows(await transform(records), "transform(records)"), stderr: "" };
|
|
2884
|
+
return runTransform(transform, records, opts);
|
|
2885
|
+
}
|
|
2886
|
+
var import_node_child_process2, fs6, os2, path6, import_node_module, import_meta, DEFAULT_TRANSFORM_TIMEOUT_MS, NODE_SUFFIXES, PYTHON_SUFFIXES, SCRUBBED, PY_WRAPPER, NODE_WRAPPER, isObject, tail;
|
|
2887
|
+
var init_transform = __esm({
|
|
2888
|
+
"src/cli/platform/worldData/transform.ts"() {
|
|
2889
|
+
"use strict";
|
|
2890
|
+
import_node_child_process2 = require("child_process");
|
|
2891
|
+
fs6 = __toESM(require("fs"));
|
|
2892
|
+
os2 = __toESM(require("os"));
|
|
2893
|
+
path6 = __toESM(require("path"));
|
|
2894
|
+
import_node_module = require("module");
|
|
2895
|
+
init_router();
|
|
2896
|
+
import_meta = {};
|
|
2897
|
+
DEFAULT_TRANSFORM_TIMEOUT_MS = 12e4;
|
|
2898
|
+
NODE_SUFFIXES = [".ts", ".mts", ".mjs", ".js", ".cjs"];
|
|
2899
|
+
PYTHON_SUFFIXES = [".py"];
|
|
2900
|
+
SCRUBBED = /^(GATEWAY_|HTTPS?_PROXY$|ALL_PROXY$|https?_proxy$|all_proxy$)/;
|
|
2901
|
+
PY_WRAPPER = `
|
|
2902
|
+
import io, json, runpy, socket, sys
|
|
2903
|
+
|
|
2904
|
+
def _deny(*args, **kwargs):
|
|
2905
|
+
raise RuntimeError("network is disabled in a transform")
|
|
2906
|
+
|
|
2907
|
+
class _Denied(socket.socket):
|
|
2908
|
+
def __init__(self, *args, **kwargs):
|
|
2909
|
+
_deny()
|
|
2910
|
+
|
|
2911
|
+
socket.socket = _Denied
|
|
2912
|
+
socket.SocketType = _Denied
|
|
2913
|
+
socket.create_connection = _deny
|
|
2914
|
+
socket.getaddrinfo = _deny
|
|
2915
|
+
|
|
2916
|
+
text = sys.stdin.read()
|
|
2917
|
+
records = [json.loads(line) for line in text.splitlines() if line.strip()]
|
|
2918
|
+
sys.stdin = io.StringIO(text)
|
|
2919
|
+
captured = io.StringIO()
|
|
2920
|
+
real = sys.stdout
|
|
2921
|
+
sys.stdout = captured
|
|
2922
|
+
try:
|
|
2923
|
+
namespace = runpy.run_path(sys.argv[1], run_name="__main__")
|
|
2924
|
+
finally:
|
|
2925
|
+
sys.stdout = real
|
|
2926
|
+
fn = namespace.get("transform")
|
|
2927
|
+
if callable(fn):
|
|
2928
|
+
out = fn(records)
|
|
2929
|
+
else:
|
|
2930
|
+
printed = captured.getvalue().strip()
|
|
2931
|
+
if not printed:
|
|
2932
|
+
sys.stderr.write("the transform defines no transform(records) and printed nothing\\n")
|
|
2933
|
+
sys.exit(3)
|
|
2934
|
+
out = json.loads(printed)
|
|
2935
|
+
real.write(json.dumps(out))
|
|
2936
|
+
`;
|
|
2937
|
+
NODE_WRAPPER = `
|
|
2938
|
+
import { pathToFileURL } from "node:url";
|
|
2939
|
+
import net from "node:net";
|
|
2940
|
+
import tls from "node:tls";
|
|
2941
|
+
import http from "node:http";
|
|
2942
|
+
import https from "node:https";
|
|
2943
|
+
import dgram from "node:dgram";
|
|
2944
|
+
|
|
2945
|
+
const deny = () => { throw new Error("network is disabled in a transform"); };
|
|
2946
|
+
net.Socket.prototype.connect = deny;
|
|
2947
|
+
net.connect = deny;
|
|
2948
|
+
net.createConnection = deny;
|
|
2949
|
+
tls.connect = deny;
|
|
2950
|
+
http.request = deny;
|
|
2951
|
+
http.get = deny;
|
|
2952
|
+
https.request = deny;
|
|
2953
|
+
https.get = deny;
|
|
2954
|
+
dgram.createSocket = deny;
|
|
2955
|
+
globalThis.fetch = deny;
|
|
2956
|
+
|
|
2957
|
+
const module = await import(pathToFileURL(process.argv[2]).href);
|
|
2958
|
+
const fn = typeof module.transform === "function" ? module.transform : typeof module.default === "function" ? module.default : null;
|
|
2959
|
+
if (fn) {
|
|
2960
|
+
const chunks = [];
|
|
2961
|
+
for await (const chunk of process.stdin) chunks.push(chunk);
|
|
2962
|
+
const text = Buffer.concat(chunks).toString("utf8");
|
|
2963
|
+
const records = text.split("\\n").filter((line) => line.trim()).map((line) => JSON.parse(line));
|
|
2964
|
+
const out = await fn(records);
|
|
2965
|
+
process.stdout.write(JSON.stringify(out));
|
|
2966
|
+
}
|
|
2967
|
+
`;
|
|
2968
|
+
isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2969
|
+
tail = (stderr, lines = 12) => {
|
|
2970
|
+
const kept = stderr.split("\n").filter((line) => line.trim()).slice(-lines);
|
|
2971
|
+
return kept.length ? "\n" + kept.join("\n") : "";
|
|
2972
|
+
};
|
|
2973
|
+
}
|
|
2974
|
+
});
|
|
2975
|
+
|
|
2976
|
+
// src/cli/platform/worldData/batches.ts
|
|
2977
|
+
function uploadHeadersFor(gz) {
|
|
2978
|
+
return {
|
|
2979
|
+
"content-type": "application/gzip",
|
|
2980
|
+
"content-length": String(gz.length),
|
|
2981
|
+
"x-amz-checksum-sha256": (0, import_node_crypto5.createHash)("sha256").update(gz).digest("base64")
|
|
2982
|
+
};
|
|
2983
|
+
}
|
|
2984
|
+
async function forEachLimited(items, limit, fn) {
|
|
2985
|
+
const inFlight = /* @__PURE__ */ new Set();
|
|
2986
|
+
let failure = null;
|
|
2987
|
+
const track = (p) => {
|
|
2988
|
+
const wrapped = p.then(
|
|
2989
|
+
() => {
|
|
2990
|
+
inFlight.delete(wrapped);
|
|
2991
|
+
},
|
|
2992
|
+
(error) => {
|
|
2993
|
+
failure ??= error;
|
|
2994
|
+
inFlight.delete(wrapped);
|
|
2995
|
+
}
|
|
2996
|
+
);
|
|
2997
|
+
inFlight.add(wrapped);
|
|
2998
|
+
};
|
|
2999
|
+
for await (const item of items) {
|
|
3000
|
+
if (failure) break;
|
|
3001
|
+
track(fn(item));
|
|
3002
|
+
if (inFlight.size >= limit) await Promise.race(inFlight);
|
|
3003
|
+
}
|
|
3004
|
+
await Promise.all(inFlight);
|
|
3005
|
+
if (failure) throw failure;
|
|
3006
|
+
}
|
|
3007
|
+
async function waitForBatch(client2, batchId, opts = {}) {
|
|
3008
|
+
const sleep3 = opts.sleep ?? client2.sleep;
|
|
3009
|
+
let delay = opts.initialDelayMs ?? 1e3;
|
|
3010
|
+
let last = "";
|
|
3011
|
+
for (; ; ) {
|
|
3012
|
+
const status = await client2.get(batchId);
|
|
3013
|
+
const phase = phaseLine(status);
|
|
3014
|
+
if (phase !== last) {
|
|
3015
|
+
opts.onPhase?.(phase);
|
|
3016
|
+
last = phase;
|
|
3017
|
+
}
|
|
3018
|
+
if (TERMINAL_STATES.has(status.state)) return status;
|
|
3019
|
+
await sleep3(delay);
|
|
3020
|
+
delay = Math.min(1e4, Math.round(delay * 1.5));
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
function phaseLine(status) {
|
|
3024
|
+
const phase = status.progress?.phase;
|
|
3025
|
+
return phase ? `${status.state} (${phase})` : status.state;
|
|
3026
|
+
}
|
|
3027
|
+
var import_node_crypto5, fs7, TERMINAL_STATES, sleepMs, WorldDataApi;
|
|
3028
|
+
var init_batches = __esm({
|
|
3029
|
+
"src/cli/platform/worldData/batches.ts"() {
|
|
3030
|
+
"use strict";
|
|
3031
|
+
import_node_crypto5 = require("crypto");
|
|
3032
|
+
fs7 = __toESM(require("fs"));
|
|
3033
|
+
init_config();
|
|
3034
|
+
init_router();
|
|
3035
|
+
TERMINAL_STATES = /* @__PURE__ */ new Set(["applied", "refused", "published", "failed"]);
|
|
3036
|
+
sleepMs = (ms) => new Promise((resolve7) => setTimeout(resolve7, ms));
|
|
3037
|
+
WorldDataApi = class {
|
|
3038
|
+
constructor(creds, slug, sleep3 = sleepMs) {
|
|
3039
|
+
this.creds = creds;
|
|
3040
|
+
this.slug = slug;
|
|
3041
|
+
this.sleep = sleep3;
|
|
3042
|
+
this.base = `/api/public/worlds/${encodeURIComponent(slug)}/data`;
|
|
3043
|
+
}
|
|
3044
|
+
base;
|
|
3045
|
+
open(body) {
|
|
3046
|
+
return api(this.creds, "POST", `${this.base}/batches`, body);
|
|
3047
|
+
}
|
|
3048
|
+
register(batchId, chunk) {
|
|
3049
|
+
return api(this.creds, "POST", `${this.base}/batches/${batchId}/chunks`, {
|
|
3050
|
+
ordinal: chunk.ordinal,
|
|
3051
|
+
digest: chunk.digest,
|
|
3052
|
+
bytes: chunk.bytes,
|
|
3053
|
+
rows: chunk.rows,
|
|
3054
|
+
...chunk.entity ? { entity: chunk.entity } : {}
|
|
3055
|
+
});
|
|
3056
|
+
}
|
|
3057
|
+
markUploaded(batchId, chunkId) {
|
|
3058
|
+
return api(this.creds, "POST", `${this.base}/batches/${batchId}/chunks/${chunkId}/uploaded`);
|
|
3059
|
+
}
|
|
3060
|
+
complete(batchId) {
|
|
3061
|
+
return api(this.creds, "POST", `${this.base}/batches/${batchId}/complete`);
|
|
3062
|
+
}
|
|
3063
|
+
get(batchId) {
|
|
3064
|
+
return api(this.creds, "GET", `${this.base}/batches/${batchId}`);
|
|
3065
|
+
}
|
|
3066
|
+
list(limit, cursor) {
|
|
3067
|
+
const params = new URLSearchParams();
|
|
3068
|
+
if (limit !== void 0) params.set("limit", String(limit));
|
|
3069
|
+
if (cursor) params.set("cursor", cursor);
|
|
3070
|
+
const q = params.toString();
|
|
3071
|
+
return api(this.creds, "GET", `${this.base}/batches${q ? `?${q}` : ""}`);
|
|
3072
|
+
}
|
|
3073
|
+
publish(message) {
|
|
3074
|
+
return api(this.creds, "POST", `${this.base}/publish`, message ? { message } : {});
|
|
3075
|
+
}
|
|
3076
|
+
/**
|
|
3077
|
+
* PUT the gzipped chunk to its presigned URL with exactly the headers the
|
|
3078
|
+
* URL was signed for (the platform's `uploadHeaders`; the same three when it
|
|
3079
|
+
* sends none), with backoff on a dropped connection or a 5xx.
|
|
3080
|
+
*/
|
|
3081
|
+
async put(uploadUrl, gz, signed) {
|
|
3082
|
+
const headers = signed ?? uploadHeadersFor(gz);
|
|
3083
|
+
const delays = [500, 1500, 4e3];
|
|
3084
|
+
for (let attempt = 0; ; attempt++) {
|
|
3085
|
+
try {
|
|
3086
|
+
const res = await fetch(uploadUrl, { method: "PUT", body: new Uint8Array(gz), headers });
|
|
3087
|
+
if (res.ok) return;
|
|
3088
|
+
if (res.status < 500 || attempt >= delays.length) throw new CliError(`chunk upload -> ${res.status}: ${(await res.text()).slice(0, 300)}`, 1);
|
|
3089
|
+
} catch (error) {
|
|
3090
|
+
if (error instanceof CliError || attempt >= delays.length) throw error instanceof CliError ? error : new CliError(`chunk upload failed: ${error.message}`, 1);
|
|
3091
|
+
}
|
|
3092
|
+
await this.sleep(delays[attempt]);
|
|
3093
|
+
}
|
|
3094
|
+
}
|
|
3095
|
+
/** Register, upload unless the server already holds the content, confirm. */
|
|
3096
|
+
async upload(batchId, chunk) {
|
|
3097
|
+
const registered = await this.register(batchId, chunk);
|
|
3098
|
+
if (!registered.uploaded) {
|
|
3099
|
+
if (!registered.uploadUrl) throw new CliError(`the server registered chunk ${chunk.ordinal} without an upload URL`, 1);
|
|
3100
|
+
await this.put(registered.uploadUrl, chunk.gz, registered.uploadHeaders);
|
|
3101
|
+
await this.markUploaded(batchId, registered.chunkId);
|
|
3102
|
+
}
|
|
3103
|
+
return { ordinal: chunk.ordinal, digest: chunk.digest, bytes: chunk.bytes, rows: chunk.rows, entity: chunk.entity, chunkId: registered.chunkId, uploaded: true };
|
|
3104
|
+
}
|
|
3105
|
+
};
|
|
3106
|
+
}
|
|
3107
|
+
});
|
|
3108
|
+
|
|
3109
|
+
// src/cli/platform/worldData/chunker.ts
|
|
3110
|
+
function chunkLine(row, declared) {
|
|
3111
|
+
if (declared !== null) return dumps(row.row) + "\n";
|
|
3112
|
+
const tagged = /* @__PURE__ */ new Map();
|
|
3113
|
+
tagged.set("entity", row.entity);
|
|
3114
|
+
tagged.set("row", row.row);
|
|
3115
|
+
return dumps(tagged) + "\n";
|
|
3116
|
+
}
|
|
3117
|
+
async function* buildChunks(rows, plan) {
|
|
3118
|
+
let lines = [];
|
|
3119
|
+
let rawBytes = 0;
|
|
3120
|
+
let ordinal = 0;
|
|
3121
|
+
let seen = 0;
|
|
3122
|
+
const flush2 = () => {
|
|
3123
|
+
const raw = Buffer.concat(lines);
|
|
3124
|
+
const built = finishChunk(ordinal++, raw, lines.length, plan.entity, seen - lines.length);
|
|
3125
|
+
lines = [];
|
|
3126
|
+
rawBytes = 0;
|
|
3127
|
+
return built;
|
|
3128
|
+
};
|
|
3129
|
+
for await (const row of rows) {
|
|
3130
|
+
const line = Buffer.from(chunkLine(row, plan.entity), "utf8");
|
|
3131
|
+
const full = lines.length > 0 && (plan.chunkRows !== null && lines.length >= plan.chunkRows || rawBytes + line.length > plan.chunkBytes);
|
|
3132
|
+
if (full) yield flush2();
|
|
3133
|
+
lines.push(line);
|
|
3134
|
+
rawBytes += line.length;
|
|
3135
|
+
seen++;
|
|
3136
|
+
}
|
|
3137
|
+
if (lines.length) yield flush2();
|
|
3138
|
+
}
|
|
3139
|
+
function finishChunk(ordinal, raw, rows, entity, firstRow = 0) {
|
|
3140
|
+
const gz = gzipDeterministic(raw, { name: chunkName(ordinal) });
|
|
3141
|
+
return {
|
|
3142
|
+
ordinal,
|
|
3143
|
+
digest: (0, import_node_crypto6.createHash)("sha256").update(gz).digest("hex"),
|
|
3144
|
+
bytes: gz.length,
|
|
3145
|
+
rows,
|
|
3146
|
+
entity,
|
|
3147
|
+
rawBytes: raw.length,
|
|
3148
|
+
contentSha256: (0, import_node_crypto6.createHash)("sha256").update(raw).digest("hex"),
|
|
3149
|
+
firstRow,
|
|
3150
|
+
gz
|
|
3151
|
+
};
|
|
3152
|
+
}
|
|
3153
|
+
function gzipDeterministic(raw, opts = {}) {
|
|
3154
|
+
const level = opts.level ?? GZIP_LEVEL;
|
|
3155
|
+
const name = opts.name ? Buffer.concat([Buffer.from(opts.name, "latin1"), Buffer.from([0])]) : Buffer.alloc(0);
|
|
3156
|
+
const header = Buffer.from([31, 139, 8, opts.name ? 8 : 0, 0, 0, 0, 0, level === 9 ? 2 : level === 1 ? 4 : 0, 255]);
|
|
3157
|
+
const body = (0, import_node_zlib2.deflateRawSync)(raw, { level });
|
|
3158
|
+
const trailer = Buffer.alloc(8);
|
|
3159
|
+
trailer.writeUInt32LE(crc32(raw), 0);
|
|
3160
|
+
trailer.writeUInt32LE(raw.length >>> 0, 4);
|
|
3161
|
+
return Buffer.concat([header, name, body, trailer]);
|
|
3162
|
+
}
|
|
3163
|
+
function crc32(data) {
|
|
3164
|
+
if (!table) {
|
|
3165
|
+
table = new Uint32Array(256);
|
|
3166
|
+
for (let n = 0; n < 256; n++) {
|
|
3167
|
+
let c = n;
|
|
3168
|
+
for (let k = 0; k < 8; k++) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
3169
|
+
table[n] = c >>> 0;
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3172
|
+
let crc = 4294967295;
|
|
3173
|
+
for (let i = 0; i < data.length; i++) crc = table[(crc ^ data[i]) & 255] ^ crc >>> 8;
|
|
3174
|
+
return (crc ^ 4294967295) >>> 0;
|
|
3175
|
+
}
|
|
3176
|
+
var import_node_crypto6, import_node_zlib2, DEFAULT_CHUNK_BYTES, GZIP_LEVEL, chunkName, table;
|
|
3177
|
+
var init_chunker = __esm({
|
|
3178
|
+
"src/cli/platform/worldData/chunker.ts"() {
|
|
3179
|
+
"use strict";
|
|
3180
|
+
import_node_crypto6 = require("crypto");
|
|
3181
|
+
import_node_zlib2 = require("zlib");
|
|
3182
|
+
init_json();
|
|
3183
|
+
DEFAULT_CHUNK_BYTES = 64 * 1024 * 1024;
|
|
3184
|
+
GZIP_LEVEL = 9;
|
|
3185
|
+
chunkName = (ordinal) => `chunk-${String(ordinal).padStart(5, "0")}.jsonl`;
|
|
3186
|
+
table = null;
|
|
3187
|
+
}
|
|
3188
|
+
});
|
|
3189
|
+
|
|
3190
|
+
// src/cli/platform/worldData/push.ts
|
|
3191
|
+
var push_exports = {};
|
|
3192
|
+
__export(push_exports, {
|
|
3193
|
+
pushRows: () => pushRows
|
|
3194
|
+
});
|
|
3195
|
+
async function pushRows(creds, slug, rows, opts = {}) {
|
|
3196
|
+
const client2 = opts.sleep ? new WorldDataApi(creds, slug, opts.sleep) : new WorldDataApi(creds, slug);
|
|
3197
|
+
const opened = await client2.open({
|
|
3198
|
+
mode: opts.mode ?? "append",
|
|
3199
|
+
merge: "upsert",
|
|
3200
|
+
...opts.redact && opts.redact !== "off" ? { redact: opts.redact } : {},
|
|
3201
|
+
atomic: true,
|
|
3202
|
+
dryRun: Boolean(opts.dryRun),
|
|
3203
|
+
publish: opts.publish ?? "now",
|
|
3204
|
+
...opts.message ? { message: opts.message } : {}
|
|
3205
|
+
});
|
|
3206
|
+
if (!opened.batchId) throw new Error("the platform opened no batch (no batchId in the answer)");
|
|
3207
|
+
const tagged = (async function* () {
|
|
3208
|
+
for (const [entity, listed] of Object.entries(rows))
|
|
3209
|
+
for (let index = 0; index < listed.length; index++)
|
|
3210
|
+
yield { entity, row: parseJson(JSON.stringify(listed[index])), where: `${entity}[${index}]` };
|
|
3211
|
+
})();
|
|
3212
|
+
const chunks = buildChunks(tagged, { chunkBytes: opts.chunkBytes ?? DEFAULT_CHUNK_BYTES, chunkRows: null, entity: null });
|
|
3213
|
+
await forEachLimited(chunks, Math.max(1, opts.parallel ?? 4), async (chunk) => {
|
|
3214
|
+
await client2.upload(opened.batchId, chunk);
|
|
3215
|
+
});
|
|
3216
|
+
await client2.complete(opened.batchId);
|
|
3217
|
+
return waitForBatch(client2, opened.batchId, { initialDelayMs: pollMs() });
|
|
3218
|
+
}
|
|
3219
|
+
function pollMs() {
|
|
3220
|
+
const raw = Number(process.env.GATEWAY_WORLD_DATA_POLL_MS ?? 1e3);
|
|
3221
|
+
return Number.isFinite(raw) && raw >= 0 ? raw : 1e3;
|
|
3222
|
+
}
|
|
3223
|
+
var init_push = __esm({
|
|
3224
|
+
"src/cli/platform/worldData/push.ts"() {
|
|
3225
|
+
"use strict";
|
|
3226
|
+
init_batches();
|
|
3227
|
+
init_chunker();
|
|
3228
|
+
init_json();
|
|
3229
|
+
}
|
|
3230
|
+
});
|
|
3231
|
+
|
|
3232
|
+
// src/worlds/ingest.ts
|
|
3233
|
+
function parseToolCallRecord(raw) {
|
|
3234
|
+
const none = { record: null, skip: null };
|
|
3235
|
+
if (!isObject2(raw)) return { ...none, refusal: "record is not an object" };
|
|
3236
|
+
const kind = raw.kind;
|
|
3237
|
+
if (kind !== void 0 && kind !== null && kind !== "call") return { record: null, skip: `kind ${String(kind)}`, refusal: null };
|
|
3238
|
+
const tool = raw.tool;
|
|
3239
|
+
if (typeof tool !== "string" || !tool) return { ...none, refusal: "record has no tool name" };
|
|
3240
|
+
if (raw.error !== void 0 && raw.error !== null && raw.error !== "") return { record: null, skip: "call failed", refusal: null };
|
|
3241
|
+
const args = raw.args ?? {};
|
|
3242
|
+
if (!isObject2(args)) return { ...none, refusal: `args of ${tool} is not an object` };
|
|
3243
|
+
if (!("result" in raw)) return { ...none, refusal: `record of ${tool} has no result` };
|
|
3244
|
+
const at = raw.at ?? raw.completedAt;
|
|
3245
|
+
const record = { tool, args, result: raw.result };
|
|
3246
|
+
if (typeof at === "string") record.at = at;
|
|
3247
|
+
if (typeof raw.session === "string") record.session = raw.session;
|
|
3248
|
+
if (typeof raw.source === "string") record.source = raw.source;
|
|
3249
|
+
return { record, skip: null, refusal: null };
|
|
3250
|
+
}
|
|
3251
|
+
function readToolCallRecords(paths) {
|
|
3252
|
+
const records = [];
|
|
3253
|
+
for (const file of paths) records.push(...toolCallRecordsIn(fs8.readFileSync(file, "utf8"), file));
|
|
3254
|
+
return records;
|
|
3255
|
+
}
|
|
3256
|
+
function toolCallRecordsIn(text2, where) {
|
|
3257
|
+
const stripped = text2.trim();
|
|
3258
|
+
if (!stripped) return [];
|
|
3259
|
+
if (stripped.startsWith("[")) {
|
|
3260
|
+
const listed = JSON.parse(stripped);
|
|
3261
|
+
if (!Array.isArray(listed)) throw new Error(`${where} is neither a JSON array nor JSON Lines`);
|
|
3262
|
+
listed.forEach((item, index) => {
|
|
3263
|
+
if (!isObject2(item)) throw new Error(`${where}[${index}] is not an object`);
|
|
3264
|
+
});
|
|
3265
|
+
return listed;
|
|
3266
|
+
}
|
|
3267
|
+
const records = [];
|
|
3268
|
+
const lines = text2.split(/\r?\n/);
|
|
3269
|
+
for (let index = 0; index < lines.length; index++) {
|
|
3270
|
+
const line = lines[index];
|
|
3271
|
+
if (!line.trim()) continue;
|
|
3272
|
+
let item;
|
|
3273
|
+
try {
|
|
3274
|
+
item = JSON.parse(line);
|
|
3275
|
+
} catch {
|
|
3276
|
+
throw new Error(`${where}:${index + 1} is not JSON`);
|
|
3277
|
+
}
|
|
3278
|
+
if (!isObject2(item)) throw new Error(`${where}:${index + 1} is not an object`);
|
|
3279
|
+
records.push(item);
|
|
3280
|
+
}
|
|
3281
|
+
return records;
|
|
3282
|
+
}
|
|
3283
|
+
async function emit(sink, record) {
|
|
3284
|
+
if (Array.isArray(sink)) {
|
|
3285
|
+
sink.push(record);
|
|
3286
|
+
return;
|
|
3287
|
+
}
|
|
3288
|
+
if (typeof sink === "string") {
|
|
3289
|
+
fs8.appendFileSync(sink, JSON.stringify(record) + "\n");
|
|
3290
|
+
return;
|
|
3291
|
+
}
|
|
3292
|
+
if (typeof sink === "function") {
|
|
3293
|
+
await sink(record);
|
|
3294
|
+
return;
|
|
3295
|
+
}
|
|
3296
|
+
throw new TypeError("sink must be an array, a file path, or a function");
|
|
3297
|
+
}
|
|
3298
|
+
function captureToolCalls(tools, sink, opts = {}) {
|
|
3299
|
+
const wrapped = /* @__PURE__ */ Object.create(null);
|
|
3300
|
+
for (const [name, fn] of Object.entries(tools)) {
|
|
3301
|
+
wrapped[name] = async (args = {}) => {
|
|
3302
|
+
const record = { tool: name, args, at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
3303
|
+
if (opts.session) record.session = opts.session;
|
|
3304
|
+
if (opts.source) record.source = opts.source;
|
|
3305
|
+
let result;
|
|
3306
|
+
try {
|
|
3307
|
+
result = await fn(args);
|
|
3308
|
+
} catch (error) {
|
|
3309
|
+
record.error = error instanceof Error ? error.message || error.name : String(error);
|
|
3310
|
+
await emit(sink, record);
|
|
3311
|
+
throw error;
|
|
3312
|
+
}
|
|
3313
|
+
record.result = result;
|
|
3314
|
+
await emit(sink, record);
|
|
3315
|
+
return result;
|
|
3316
|
+
};
|
|
3317
|
+
}
|
|
3318
|
+
return wrapped;
|
|
3319
|
+
}
|
|
3320
|
+
function jsonish(value) {
|
|
3321
|
+
if (typeof value !== "string") return value;
|
|
3322
|
+
try {
|
|
3323
|
+
return JSON.parse(value);
|
|
3324
|
+
} catch {
|
|
3325
|
+
return value;
|
|
3326
|
+
}
|
|
3327
|
+
}
|
|
3328
|
+
function toolCallsFromObservations(observations, opts = {}) {
|
|
3329
|
+
const known = opts.tools ? new Set(opts.tools) : null;
|
|
3330
|
+
const sinceMs = opts.since ? Date.parse(opts.since) : NaN;
|
|
3331
|
+
const out = { records: [], unknownTools: {}, skipped: {} };
|
|
3332
|
+
const skip = (reason) => {
|
|
3333
|
+
out.skipped[reason] = (out.skipped[reason] ?? 0) + 1;
|
|
3334
|
+
};
|
|
3335
|
+
for (const observation of observations) {
|
|
3336
|
+
if (observation.type !== "TOOL") {
|
|
3337
|
+
skip(`type ${observation.type ?? "unknown"}`);
|
|
3338
|
+
continue;
|
|
3339
|
+
}
|
|
3340
|
+
const tool = observation.name;
|
|
3341
|
+
if (typeof tool !== "string" || !tool) {
|
|
3342
|
+
skip("no name");
|
|
3343
|
+
continue;
|
|
3344
|
+
}
|
|
3345
|
+
const at = isoOf(observation.startTime);
|
|
3346
|
+
if (!Number.isNaN(sinceMs) && at !== void 0 && Date.parse(at) < sinceMs) {
|
|
3347
|
+
skip("before since");
|
|
3348
|
+
continue;
|
|
3349
|
+
}
|
|
3350
|
+
if (known && !known.has(tool)) {
|
|
3351
|
+
out.unknownTools[tool] = (out.unknownTools[tool] ?? 0) + 1;
|
|
3352
|
+
continue;
|
|
3353
|
+
}
|
|
3354
|
+
const input = jsonish(observation.input);
|
|
3355
|
+
const record = { tool, args: isObject2(input) ? input : {} };
|
|
3356
|
+
if (observation.level === "ERROR") record.error = observation.statusMessage || "ERROR";
|
|
3357
|
+
else record.result = jsonish(observation.output);
|
|
3358
|
+
if (at !== void 0) record.at = at;
|
|
3359
|
+
if (opts.session) record.session = opts.session;
|
|
3360
|
+
record.source = `trace:${observation.traceId ?? "?"}/${observation.id ?? "?"}`;
|
|
3361
|
+
out.records.push(record);
|
|
3362
|
+
}
|
|
3363
|
+
return out;
|
|
3364
|
+
}
|
|
3365
|
+
function credentialsOf(options) {
|
|
3366
|
+
const host = (options.host ?? process.env.GATEWAY_HOST ?? "https://withgateway.ai").replace(/\/+$/, "");
|
|
3367
|
+
const publicKey = options.publicKey ?? process.env.GATEWAY_PUBLIC_KEY;
|
|
3368
|
+
const secretKey = options.secretKey ?? process.env.GATEWAY_SECRET_KEY;
|
|
3369
|
+
return publicKey && secretKey ? { host, publicKey, secretKey } : null;
|
|
3370
|
+
}
|
|
3371
|
+
async function ingest(world, records, options = {}) {
|
|
3372
|
+
const { ingestLocalToolCalls: ingestLocalToolCalls2, importLocalWorldData: importLocalWorldData2, checkLocalWorldData: checkLocalWorldData2 } = await Promise.resolve().then(() => (init_data(), data_exports));
|
|
3373
|
+
if (options.transform !== void 0 && options.map !== void 0) throw new Error("records go through one of transform, map");
|
|
3374
|
+
const redact = options.redact ?? "off";
|
|
3375
|
+
const mode = options.mode ?? "append";
|
|
3376
|
+
const dryRun = Boolean(options.dryRun);
|
|
3377
|
+
const creds = credentialsOf(options);
|
|
3378
|
+
const local = fs8.existsSync(world) && fs8.statSync(world).isDirectory();
|
|
3379
|
+
const map = options.map === void 0 ? void 0 : options.map;
|
|
3380
|
+
let rows = null;
|
|
3381
|
+
let stderr = "";
|
|
3382
|
+
if (options.transform !== void 0) {
|
|
3383
|
+
const { transformRecords: transformRecords2 } = await Promise.resolve().then(() => (init_transform(), transform_exports));
|
|
3384
|
+
({ rows, stderr } = await transformRecords2(options.transform, records, { timeoutMs: options.timeoutMs }));
|
|
3385
|
+
}
|
|
3386
|
+
if (local) {
|
|
3387
|
+
if (rows === null) return reportOf(world, await ingestLocalToolCalls2(world, records, { redact, dryRun, mode, map }, creds), redact);
|
|
3388
|
+
const landed = dryRun ? await checkLocalWorldData2(world, rows, creds, { redact }) : await importLocalWorldData2(world, rows, { mode, redact }, creds);
|
|
3389
|
+
return transformReport(world, records.length, rows, stderr, { dryRun, redact, changed: !dryRun && landed.changed, kind: landed.kind, entityCounts: landed.entity_counts });
|
|
3390
|
+
}
|
|
3391
|
+
if (!creds) throw new Error("Gateway keys missing: set GATEWAY_PUBLIC_KEY / GATEWAY_SECRET_KEY (or pass publicKey/secretKey).");
|
|
3392
|
+
const { pull: pull2 } = await Promise.resolve().then(() => (init_hub(), hub_exports));
|
|
3393
|
+
const slug = world.split("@", 1)[0];
|
|
3394
|
+
const scratch = fs8.mkdtempSync(path7.join(os3.tmpdir(), "gateway-ingest-"));
|
|
3395
|
+
try {
|
|
3396
|
+
const pulled = await pull2(world, path7.join(scratch, slug), options);
|
|
3397
|
+
let report;
|
|
3398
|
+
let projected;
|
|
3399
|
+
if (rows === null) {
|
|
3400
|
+
const proven = await ingestLocalToolCalls2(pulled.dir, records, { redact: "off", dryRun: true, mode, map }, creds);
|
|
3401
|
+
report = reportOf(world, proven, redact);
|
|
3402
|
+
projected = proven.projected ?? {};
|
|
3403
|
+
} else {
|
|
3404
|
+
const proven = await checkLocalWorldData2(pulled.dir, rows, creds);
|
|
3405
|
+
report = transformReport(world, records.length, rows, stderr, { dryRun, redact, changed: false, kind: proven.kind, entityCounts: proven.entity_counts });
|
|
3406
|
+
projected = rows;
|
|
3407
|
+
}
|
|
3408
|
+
report.dryRun = dryRun;
|
|
3409
|
+
if (dryRun || report.refusals.length || !Object.keys(projected).length) return report;
|
|
3410
|
+
const { pushRows: pushRows2 } = await Promise.resolve().then(() => (init_push(), push_exports));
|
|
3411
|
+
const status = await pushRows2(creds, slug, projected, { mode, redact, message: options.message });
|
|
3412
|
+
report.batch = status;
|
|
3413
|
+
report.changed = status.state === "applied" || status.state === "published";
|
|
3414
|
+
if (status.entityCounts) report.entityCounts = status.entityCounts;
|
|
3415
|
+
return report;
|
|
3416
|
+
} finally {
|
|
3417
|
+
fs8.rmSync(scratch, { recursive: true, force: true });
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
async function ingestToolCalls(world, records, options = {}) {
|
|
3421
|
+
return ingest(world, records, options);
|
|
3422
|
+
}
|
|
3423
|
+
function transformReport(world, records, rows, stderr, outcome) {
|
|
3424
|
+
return {
|
|
3425
|
+
world,
|
|
3426
|
+
via: "transform",
|
|
3427
|
+
...stderr ? { stderr } : {},
|
|
3428
|
+
records,
|
|
3429
|
+
ingested: records,
|
|
3430
|
+
skipped: {},
|
|
3431
|
+
refusals: [],
|
|
3432
|
+
rows: Object.fromEntries(Object.entries(rows).map(([entity, listed]) => [entity, listed.length])),
|
|
3433
|
+
dryRun: outcome.dryRun,
|
|
3434
|
+
redact: outcome.redact,
|
|
3435
|
+
changed: outcome.changed,
|
|
3436
|
+
...outcome.kind ? { kind: outcome.kind } : {},
|
|
3437
|
+
...outcome.entityCounts ? { entityCounts: outcome.entityCounts } : {}
|
|
3438
|
+
};
|
|
3439
|
+
}
|
|
3440
|
+
function reportOf(world, local, redact) {
|
|
3441
|
+
return {
|
|
3442
|
+
world,
|
|
3443
|
+
...local.via ? { via: local.via } : {},
|
|
3444
|
+
...local.sources ? { sources: local.sources.map(({ unmapped_fields, unset_fields, ...rest }) => ({ ...rest, unmappedFields: unmapped_fields, unsetFields: unset_fields })) } : {},
|
|
3445
|
+
...local.unmatched ? { unmatched: local.unmatched } : {},
|
|
3446
|
+
...local.note ? { note: local.note } : {},
|
|
3447
|
+
records: local.records,
|
|
3448
|
+
ingested: local.ingested,
|
|
3449
|
+
skipped: local.skipped,
|
|
3450
|
+
refusals: local.refusals,
|
|
3451
|
+
rows: local.rows,
|
|
3452
|
+
dryRun: local.dry_run,
|
|
3453
|
+
redact,
|
|
3454
|
+
changed: local.changed,
|
|
3455
|
+
...local.kind ? { kind: local.kind } : {},
|
|
3456
|
+
...local.entity_counts ? { entityCounts: local.entity_counts } : {}
|
|
3457
|
+
};
|
|
3458
|
+
}
|
|
3459
|
+
async function sessionToolObservations(sessionId, options = {}) {
|
|
3460
|
+
const session = await apiRequest(
|
|
3461
|
+
options,
|
|
3462
|
+
"GET",
|
|
3463
|
+
`/api/public/sessions/${encodeURIComponent(sessionId)}?includeIO=true`
|
|
3464
|
+
);
|
|
3465
|
+
const out = [];
|
|
3466
|
+
for (const trace5 of session.traces ?? [])
|
|
3467
|
+
for (const observation of trace5.observations ?? []) out.push({ traceId: trace5.id ?? null, ...observation });
|
|
3468
|
+
return out;
|
|
3469
|
+
}
|
|
3470
|
+
var fs8, os3, path7, isObject2, isoOf;
|
|
3471
|
+
var init_ingest = __esm({
|
|
3472
|
+
"src/worlds/ingest.ts"() {
|
|
3473
|
+
"use strict";
|
|
3474
|
+
fs8 = __toESM(require("fs"));
|
|
3475
|
+
os3 = __toESM(require("os"));
|
|
3476
|
+
path7 = __toESM(require("path"));
|
|
3477
|
+
init_worlds();
|
|
3478
|
+
isObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3479
|
+
isoOf = (value) => value instanceof Date ? value.toISOString() : typeof value === "string" ? value : void 0;
|
|
3480
|
+
}
|
|
3481
|
+
});
|
|
3482
|
+
|
|
1695
3483
|
// src/worlds/index.ts
|
|
1696
3484
|
var worlds_exports = {};
|
|
1697
3485
|
__export(worlds_exports, {
|
|
@@ -1702,7 +3490,10 @@ __export(worlds_exports, {
|
|
|
1702
3490
|
EVENT_BATCH_SIZE: () => EVENT_BATCH_SIZE,
|
|
1703
3491
|
EVENT_FLUSH_INTERVAL_MS: () => EVENT_FLUSH_INTERVAL_MS,
|
|
1704
3492
|
EVENT_MAX_RETRIES: () => EVENT_MAX_RETRIES,
|
|
3493
|
+
STRIP_PREFIX: () => STRIP_PREFIX,
|
|
1705
3494
|
SURFACE_KINDS: () => SURFACE_KINDS,
|
|
3495
|
+
TRANSFORMS: () => TRANSFORMS,
|
|
3496
|
+
WHITESPACE: () => WHITESPACE,
|
|
1706
3497
|
WorldBrowser: () => WorldBrowser,
|
|
1707
3498
|
WorldSession: () => WorldSession,
|
|
1708
3499
|
WorldSessionCallError: () => WorldSessionCallError,
|
|
@@ -1711,8 +3502,10 @@ __export(worlds_exports, {
|
|
|
1711
3502
|
WorldSurfaceUnavailable: () => WorldSurfaceUnavailable,
|
|
1712
3503
|
WorldTask: () => WorldTask,
|
|
1713
3504
|
apiRequest: () => apiRequest,
|
|
3505
|
+
applyTransforms: () => applyTransforms,
|
|
1714
3506
|
attachSession: () => attachSession,
|
|
1715
3507
|
buildSourceTarball: () => buildSourceTarball,
|
|
3508
|
+
captureToolCalls: () => captureToolCalls,
|
|
1716
3509
|
collectArchiveRelPaths: () => collectArchiveRelPaths,
|
|
1717
3510
|
computeContentHash: () => computeContentHash,
|
|
1718
3511
|
computerUseToolkit: () => computerUseToolkit,
|
|
@@ -1720,9 +3513,13 @@ __export(worlds_exports, {
|
|
|
1720
3513
|
createTask: () => createTask,
|
|
1721
3514
|
deleteEnvSecret: () => deleteEnvSecret,
|
|
1722
3515
|
deleteTask: () => deleteTask,
|
|
3516
|
+
describeWorld: () => describeWorld,
|
|
1723
3517
|
detectProvenance: () => detectProvenance,
|
|
1724
3518
|
getRun: () => getRun,
|
|
1725
3519
|
getTask: () => getTask,
|
|
3520
|
+
hashForm: () => hashForm,
|
|
3521
|
+
ingest: () => ingest,
|
|
3522
|
+
ingestToolCalls: () => ingestToolCalls,
|
|
1726
3523
|
isIncludedInContentHash: () => isIncludedInContentHash,
|
|
1727
3524
|
isTaskIdRef: () => isTaskIdRef,
|
|
1728
3525
|
isTaskSpec: () => isTaskSpec,
|
|
@@ -1730,22 +3527,38 @@ __export(worlds_exports, {
|
|
|
1730
3527
|
listRunConfigs: () => listRunConfigs,
|
|
1731
3528
|
listTasks: () => listTasks,
|
|
1732
3529
|
localTreeState: () => localTreeState,
|
|
3530
|
+
migrateProjectWorlds: () => migrateProjectWorlds,
|
|
3531
|
+
migrateWorld: () => migrateWorld,
|
|
1733
3532
|
openBrowser: () => openBrowser,
|
|
1734
3533
|
openSession: () => openSession,
|
|
1735
3534
|
openWorld: () => openWorld,
|
|
3535
|
+
parseToolCallRecord: () => parseToolCallRecord,
|
|
3536
|
+
parseTransform: () => parseTransform,
|
|
1736
3537
|
parseWorldTaskRefs: () => parseWorldTaskRefs,
|
|
3538
|
+
preserveForm: () => preserveForm,
|
|
1737
3539
|
propose: () => propose,
|
|
1738
3540
|
pull: () => pull,
|
|
1739
3541
|
push: () => push,
|
|
3542
|
+
pyText: () => pyText,
|
|
3543
|
+
queryRows: () => queryRows,
|
|
3544
|
+
queryRowsSearch: () => queryRowsSearch,
|
|
1740
3545
|
readLocalMeta: () => readLocalMeta,
|
|
3546
|
+
readToolCallRecords: () => readToolCallRecords,
|
|
1741
3547
|
redactActionArgs: () => redactActionArgs,
|
|
3548
|
+
redactionOf: () => redactionOf,
|
|
1742
3549
|
resolveBrowserMode: () => resolveBrowserMode,
|
|
3550
|
+
roundForm: () => roundForm,
|
|
1743
3551
|
runSessions: () => runSessions,
|
|
1744
3552
|
schemaFromSignature: () => schemaFromSignature,
|
|
3553
|
+
sessionToolObservations: () => sessionToolObservations,
|
|
1745
3554
|
setEnvSecret: () => setEnvSecret,
|
|
3555
|
+
shapeText: () => shapeText,
|
|
1746
3556
|
snapshotTreeHashes: () => snapshotTreeHashes,
|
|
3557
|
+
storedForms: () => storedForms,
|
|
1747
3558
|
surfaceKinds: () => surfaceKinds,
|
|
1748
3559
|
taskLabel: () => taskLabel,
|
|
3560
|
+
toolCallRecordsIn: () => toolCallRecordsIn,
|
|
3561
|
+
toolCallsFromObservations: () => toolCallsFromObservations,
|
|
1749
3562
|
uiEntryUrl: () => uiEntryUrl,
|
|
1750
3563
|
uiUrl: () => uiUrl,
|
|
1751
3564
|
updateTask: () => updateTask,
|
|
@@ -1767,9 +3580,9 @@ function resolveEnv(options) {
|
|
|
1767
3580
|
}
|
|
1768
3581
|
return { host: host.replace(/\/+$/, ""), publicKey, secretKey };
|
|
1769
3582
|
}
|
|
1770
|
-
async function apiRequest(options, method,
|
|
3583
|
+
async function apiRequest(options, method, path9, body) {
|
|
1771
3584
|
const { host, publicKey, secretKey } = resolveEnv(options);
|
|
1772
|
-
const res = await fetch(`${host}${
|
|
3585
|
+
const res = await fetch(`${host}${path9}`, {
|
|
1773
3586
|
method,
|
|
1774
3587
|
headers: {
|
|
1775
3588
|
"content-type": "application/json",
|
|
@@ -1777,13 +3590,13 @@ async function apiRequest(options, method, path2, body) {
|
|
|
1777
3590
|
},
|
|
1778
3591
|
...body === void 0 ? {} : { body: JSON.stringify(body) }
|
|
1779
3592
|
});
|
|
1780
|
-
const
|
|
3593
|
+
const text2 = await res.text();
|
|
1781
3594
|
if (!res.ok) {
|
|
1782
3595
|
throw new Error(
|
|
1783
|
-
`${method} ${
|
|
3596
|
+
`${method} ${path9} -> ${res.status}: ${text2.slice(0, 400)}`
|
|
1784
3597
|
);
|
|
1785
3598
|
}
|
|
1786
|
-
return JSON.parse(
|
|
3599
|
+
return JSON.parse(text2);
|
|
1787
3600
|
}
|
|
1788
3601
|
async function setEnvSecret(slug, key, value, options = {}) {
|
|
1789
3602
|
return apiRequest(
|
|
@@ -1864,7 +3677,7 @@ async function waitForRun(runId, opts = {}) {
|
|
|
1864
3677
|
);
|
|
1865
3678
|
opts.onTick?.(run);
|
|
1866
3679
|
await new Promise(
|
|
1867
|
-
(
|
|
3680
|
+
(resolve7) => setTimeout(resolve7, (opts.intervalSeconds ?? 20) * 1e3)
|
|
1868
3681
|
);
|
|
1869
3682
|
}
|
|
1870
3683
|
}
|
|
@@ -1943,6 +3756,12 @@ var init_worlds = __esm({
|
|
|
1943
3756
|
init_browser();
|
|
1944
3757
|
init_hub();
|
|
1945
3758
|
init_validate();
|
|
3759
|
+
init_describe();
|
|
3760
|
+
init_redaction();
|
|
3761
|
+
init_transforms();
|
|
3762
|
+
init_query();
|
|
3763
|
+
init_migrate();
|
|
3764
|
+
init_ingest();
|
|
1946
3765
|
WorldTask = class {
|
|
1947
3766
|
constructor(world, name, variant) {
|
|
1948
3767
|
this.world = world;
|
|
@@ -2013,7 +3832,7 @@ var require_package = __commonJS({
|
|
|
2013
3832
|
"package.json"(exports2, module2) {
|
|
2014
3833
|
module2.exports = {
|
|
2015
3834
|
name: "@withgateway/sdk",
|
|
2016
|
-
version: "0.2.
|
|
3835
|
+
version: "0.2.1",
|
|
2017
3836
|
description: "Gateway SDK for TypeScript - A/B experiments, tracing, and observability",
|
|
2018
3837
|
main: "./dist/index.js",
|
|
2019
3838
|
module: "./dist/index.mjs",
|
|
@@ -2078,6 +3897,21 @@ var require_package = __commonJS({
|
|
|
2078
3897
|
types: "./dist/worlds/index.d.ts",
|
|
2079
3898
|
import: "./dist/worlds/index.mjs",
|
|
2080
3899
|
require: "./dist/worlds/index.js"
|
|
3900
|
+
},
|
|
3901
|
+
"./files": {
|
|
3902
|
+
types: "./dist/files/index.d.ts",
|
|
3903
|
+
import: "./dist/files/index.mjs",
|
|
3904
|
+
require: "./dist/files/index.js"
|
|
3905
|
+
},
|
|
3906
|
+
"./traces": {
|
|
3907
|
+
types: "./dist/traces/index.d.ts",
|
|
3908
|
+
import: "./dist/traces/index.mjs",
|
|
3909
|
+
require: "./dist/traces/index.js"
|
|
3910
|
+
},
|
|
3911
|
+
"./cli": {
|
|
3912
|
+
types: "./dist/cli.d.ts",
|
|
3913
|
+
import: "./dist/cli.mjs",
|
|
3914
|
+
require: "./dist/cli.js"
|
|
2081
3915
|
}
|
|
2082
3916
|
},
|
|
2083
3917
|
files: [
|
|
@@ -2227,6 +4061,7 @@ __export(src_exports, {
|
|
|
2227
4061
|
ReplayReport: () => ReplayReport,
|
|
2228
4062
|
ReplaySuite: () => ReplaySuite,
|
|
2229
4063
|
ReplayTask: () => ReplayTask,
|
|
4064
|
+
STRIP_PREFIX: () => STRIP_PREFIX,
|
|
2230
4065
|
SUCCESS_METRIC_NAME_KEY: () => SUCCESS_METRIC_NAME_KEY,
|
|
2231
4066
|
SUCCESS_SIGNAL_KEY: () => SUCCESS_SIGNAL_KEY,
|
|
2232
4067
|
SURFACE_KINDS: () => SURFACE_KINDS,
|
|
@@ -2236,10 +4071,12 @@ __export(src_exports, {
|
|
|
2236
4071
|
SessionRecording: () => SessionRecording,
|
|
2237
4072
|
SessionTrace: () => SessionTrace,
|
|
2238
4073
|
StubMissError: () => StubMissError,
|
|
4074
|
+
TRANSFORMS: () => TRANSFORMS,
|
|
2239
4075
|
ToolStubRegistry: () => ToolStubRegistry,
|
|
2240
4076
|
TraceDiff: () => TraceDiff,
|
|
2241
4077
|
UserProfileError: () => UserProfileError,
|
|
2242
4078
|
UsersClient: () => UsersClient,
|
|
4079
|
+
WHITESPACE: () => WHITESPACE,
|
|
2243
4080
|
WorldBrowser: () => WorldBrowser,
|
|
2244
4081
|
WorldSession: () => WorldSession,
|
|
2245
4082
|
WorldSessionCallError: () => WorldSessionCallError,
|
|
@@ -2249,12 +4086,14 @@ __export(src_exports, {
|
|
|
2249
4086
|
WorldTask: () => WorldTask,
|
|
2250
4087
|
addExperimentAttributes: () => addExperimentAttributes,
|
|
2251
4088
|
apiRequest: () => apiRequest,
|
|
4089
|
+
applyTransforms: () => applyTransforms,
|
|
2252
4090
|
assembleManifest: () => assembleManifest,
|
|
2253
4091
|
assignVariant: () => assignVariant,
|
|
2254
4092
|
attachSession: () => attachSession,
|
|
2255
4093
|
basicAuthHeader: () => basicAuthHeader,
|
|
2256
4094
|
buildSourceTarball: () => buildSourceTarball,
|
|
2257
4095
|
canonicalJson: () => canonicalJson,
|
|
4096
|
+
captureToolCalls: () => captureToolCalls,
|
|
2258
4097
|
clearExperimentContext: () => clearExperimentContext,
|
|
2259
4098
|
collectArchiveRelPaths: () => collectArchiveRelPaths,
|
|
2260
4099
|
computeBuildHash: () => computeBuildHash,
|
|
@@ -2268,9 +4107,11 @@ __export(src_exports, {
|
|
|
2268
4107
|
defineTool: () => defineTool,
|
|
2269
4108
|
deleteEnvSecret: () => deleteEnvSecret,
|
|
2270
4109
|
deleteTask: () => deleteTask,
|
|
4110
|
+
describeWorld: () => describeWorld,
|
|
2271
4111
|
detectProvenance: () => detectProvenance,
|
|
2272
4112
|
experimentContextStorage: () => experimentContextStorage,
|
|
2273
4113
|
experiments: () => singleton_exports,
|
|
4114
|
+
files: () => files_exports,
|
|
2274
4115
|
gateway: () => gateway,
|
|
2275
4116
|
getExperimentContext: () => getExperimentContext,
|
|
2276
4117
|
getRegisteredArtifacts: () => getRegisteredArtifacts,
|
|
@@ -2279,7 +4120,10 @@ __export(src_exports, {
|
|
|
2279
4120
|
getRegisteredTools: () => getRegisteredTools,
|
|
2280
4121
|
getRun: () => getRun,
|
|
2281
4122
|
getTask: () => getTask,
|
|
4123
|
+
hashForm: () => hashForm,
|
|
2282
4124
|
identify: () => identify,
|
|
4125
|
+
ingest: () => ingest,
|
|
4126
|
+
ingestToolCalls: () => ingestToolCalls,
|
|
2283
4127
|
isIncludedInContentHash: () => isIncludedInContentHash,
|
|
2284
4128
|
isTaskIdRef: () => isTaskIdRef,
|
|
2285
4129
|
isTaskSpec: () => isTaskSpec,
|
|
@@ -2289,16 +4133,26 @@ __export(src_exports, {
|
|
|
2289
4133
|
loadSession: () => loadSession,
|
|
2290
4134
|
localTreeState: () => localTreeState,
|
|
2291
4135
|
memory: () => memory,
|
|
4136
|
+
migrateProjectWorlds: () => migrateProjectWorlds,
|
|
4137
|
+
migrateWorld: () => migrateWorld,
|
|
2292
4138
|
openBrowser: () => openBrowser,
|
|
2293
4139
|
openSession: () => openSession,
|
|
2294
4140
|
openWorld: () => openWorld,
|
|
4141
|
+
parseToolCallRecord: () => parseToolCallRecord,
|
|
4142
|
+
parseTransform: () => parseTransform,
|
|
2295
4143
|
parseWorldTaskRefs: () => parseWorldTaskRefs,
|
|
2296
4144
|
personas: () => personas,
|
|
4145
|
+
preserveForm: () => preserveForm,
|
|
2297
4146
|
propose: () => propose,
|
|
2298
4147
|
pull: () => pull,
|
|
2299
4148
|
push: () => push,
|
|
4149
|
+
pyText: () => pyText,
|
|
4150
|
+
queryRows: () => queryRows,
|
|
4151
|
+
queryRowsSearch: () => queryRowsSearch,
|
|
2300
4152
|
readLocalMeta: () => readLocalMeta,
|
|
4153
|
+
readToolCallRecords: () => readToolCallRecords,
|
|
2301
4154
|
redactActionArgs: () => redactActionArgs,
|
|
4155
|
+
redactionOf: () => redactionOf,
|
|
2302
4156
|
registerArtifact: () => registerArtifact,
|
|
2303
4157
|
registerPrompt: () => registerPrompt,
|
|
2304
4158
|
registerSkill: () => registerSkill,
|
|
@@ -2307,20 +4161,27 @@ __export(src_exports, {
|
|
|
2307
4161
|
resetBuildRegistry: () => resetBuildRegistry,
|
|
2308
4162
|
resolveBrowserMode: () => resolveBrowserMode,
|
|
2309
4163
|
resolveUserId: () => resolveUserId,
|
|
4164
|
+
roundForm: () => roundForm,
|
|
2310
4165
|
runSessions: () => runSessions,
|
|
2311
4166
|
runSuite: () => runSuite,
|
|
2312
4167
|
runWithExperimentContext: () => runWithExperimentContext,
|
|
2313
4168
|
schemaFromSignature: () => schemaFromSignature,
|
|
2314
4169
|
scores: () => scores,
|
|
2315
4170
|
sessionObservationFromApi: () => sessionObservationFromApi,
|
|
4171
|
+
sessionToolObservations: () => sessionToolObservations,
|
|
2316
4172
|
sessions: () => sessions,
|
|
2317
4173
|
setEnvSecret: () => setEnvSecret,
|
|
2318
4174
|
setExperimentContext: () => setExperimentContext,
|
|
4175
|
+
shapeText: () => shapeText,
|
|
2319
4176
|
snapshotTreeHashes: () => snapshotTreeHashes,
|
|
4177
|
+
storedForms: () => storedForms,
|
|
2320
4178
|
success: () => success,
|
|
2321
4179
|
suite: () => suite,
|
|
2322
4180
|
surfaceKinds: () => surfaceKinds,
|
|
2323
4181
|
taskLabel: () => taskLabel,
|
|
4182
|
+
toolCallRecordsIn: () => toolCallRecordsIn,
|
|
4183
|
+
toolCallsFromObservations: () => toolCallsFromObservations,
|
|
4184
|
+
traces: () => traces_exports,
|
|
2324
4185
|
tracing: () => tracing,
|
|
2325
4186
|
uiEntryUrl: () => uiEntryUrl,
|
|
2326
4187
|
uiUrl: () => uiUrl,
|
|
@@ -2593,9 +4454,9 @@ var ExperimentClient = class {
|
|
|
2593
4454
|
})
|
|
2594
4455
|
});
|
|
2595
4456
|
if (!response.ok) {
|
|
2596
|
-
const
|
|
4457
|
+
const text2 = await response.text();
|
|
2597
4458
|
throw new Error(
|
|
2598
|
-
`Failed to sync experiment: ${response.status} ${response.statusText} - ${
|
|
4459
|
+
`Failed to sync experiment: ${response.status} ${response.statusText} - ${text2}`
|
|
2599
4460
|
);
|
|
2600
4461
|
}
|
|
2601
4462
|
console.log(`[gateway] Synced experiment '${config.key}' to backend`);
|
|
@@ -2905,8 +4766,8 @@ var GatewayContext = class _GatewayContext {
|
|
|
2905
4766
|
}
|
|
2906
4767
|
return resolved;
|
|
2907
4768
|
}
|
|
2908
|
-
async requestJson(method,
|
|
2909
|
-
const response = await fetch(`${this.host}${
|
|
4769
|
+
async requestJson(method, path9, payload) {
|
|
4770
|
+
const response = await fetch(`${this.host}${path9}`, {
|
|
2910
4771
|
method,
|
|
2911
4772
|
headers: {
|
|
2912
4773
|
Authorization: this.authHeader(),
|
|
@@ -2914,10 +4775,10 @@ var GatewayContext = class _GatewayContext {
|
|
|
2914
4775
|
},
|
|
2915
4776
|
...payload ? { body: JSON.stringify(payload) } : {}
|
|
2916
4777
|
});
|
|
2917
|
-
const
|
|
2918
|
-
const body =
|
|
4778
|
+
const text2 = await response.text();
|
|
4779
|
+
const body = text2 ? safeJson(text2) : {};
|
|
2919
4780
|
if (!response.ok) {
|
|
2920
|
-
const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${
|
|
4781
|
+
const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${path9}`;
|
|
2921
4782
|
if (response.status === 409) {
|
|
2922
4783
|
throw new GatewayContextConflictError(
|
|
2923
4784
|
message,
|
|
@@ -2926,7 +4787,7 @@ var GatewayContext = class _GatewayContext {
|
|
|
2926
4787
|
}
|
|
2927
4788
|
throw new GatewayContextError(message);
|
|
2928
4789
|
}
|
|
2929
|
-
this.log("%s %s -> %s", method,
|
|
4790
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
2930
4791
|
return body;
|
|
2931
4792
|
}
|
|
2932
4793
|
authHeader() {
|
|
@@ -3033,11 +4894,11 @@ function primaryPathForKind(kind, snapshot) {
|
|
|
3033
4894
|
const preferred = kind === "agent" ? "AGENTS.md" : kind === "prompt" ? "PROMPT.md" : kind === "skill" ? "SKILL.md" : "MEMORY.md";
|
|
3034
4895
|
if (readFile(snapshot, preferred)) return preferred;
|
|
3035
4896
|
return Object.entries(snapshot.files).find(
|
|
3036
|
-
([
|
|
4897
|
+
([path9, entry]) => entry.type === "file" && path9.endsWith(".md")
|
|
3037
4898
|
)?.[0] ?? null;
|
|
3038
4899
|
}
|
|
3039
|
-
function parseJsonFile(snapshot,
|
|
3040
|
-
const content = readFile(snapshot,
|
|
4900
|
+
function parseJsonFile(snapshot, path9) {
|
|
4901
|
+
const content = readFile(snapshot, path9);
|
|
3041
4902
|
if (!content) return {};
|
|
3042
4903
|
try {
|
|
3043
4904
|
const parsed = JSON.parse(content);
|
|
@@ -3046,8 +4907,8 @@ function parseJsonFile(snapshot, path2) {
|
|
|
3046
4907
|
return {};
|
|
3047
4908
|
}
|
|
3048
4909
|
}
|
|
3049
|
-
function readFile(snapshot,
|
|
3050
|
-
const entry = snapshot.files[
|
|
4910
|
+
function readFile(snapshot, path9) {
|
|
4911
|
+
const entry = snapshot.files[path9];
|
|
3051
4912
|
return entry?.type === "file" ? entry.content : null;
|
|
3052
4913
|
}
|
|
3053
4914
|
function provenanceFor(snapshot, label) {
|
|
@@ -3149,16 +5010,16 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3149
5010
|
`/api/public/context/memory/${encodeIdentifier2(identifier)}${suffix}`
|
|
3150
5011
|
);
|
|
3151
5012
|
}
|
|
3152
|
-
async read(target,
|
|
5013
|
+
async read(target, path9, options = {}) {
|
|
3153
5014
|
const snapshot = typeof target === "string" ? await this.pull(target, options) : target;
|
|
3154
|
-
const file = snapshot.files[
|
|
5015
|
+
const file = snapshot.files[path9];
|
|
3155
5016
|
return file?.type === "file" ? file.content : null;
|
|
3156
5017
|
}
|
|
3157
|
-
async write(target,
|
|
5018
|
+
async write(target, path9, content, options = {}) {
|
|
3158
5019
|
const snapshot = typeof target === "string" ? await this.pull(target) : target;
|
|
3159
5020
|
return this.push(snapshot.repo.repoHandle, {
|
|
3160
5021
|
files: {
|
|
3161
|
-
[
|
|
5022
|
+
[path9]: {
|
|
3162
5023
|
content,
|
|
3163
5024
|
...options.mimeType ? { mimeType: options.mimeType } : {}
|
|
3164
5025
|
}
|
|
@@ -3168,10 +5029,10 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3168
5029
|
...runtimeContextPayload2(options)
|
|
3169
5030
|
});
|
|
3170
5031
|
}
|
|
3171
|
-
async delete(target,
|
|
5032
|
+
async delete(target, path9, options = {}) {
|
|
3172
5033
|
const snapshot = typeof target === "string" ? await this.pull(target) : target;
|
|
3173
5034
|
return this.push(snapshot.repo.repoHandle, {
|
|
3174
|
-
files: { [
|
|
5035
|
+
files: { [path9]: null },
|
|
3175
5036
|
parentCommit: options.parentCommit ?? snapshot.commit.commitHash,
|
|
3176
5037
|
message: options.message,
|
|
3177
5038
|
...runtimeContextPayload2(options)
|
|
@@ -3184,8 +5045,8 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3184
5045
|
payload
|
|
3185
5046
|
);
|
|
3186
5047
|
}
|
|
3187
|
-
async requestJson(method,
|
|
3188
|
-
const response = await fetch(`${this.host}${
|
|
5048
|
+
async requestJson(method, path9, payload) {
|
|
5049
|
+
const response = await fetch(`${this.host}${path9}`, {
|
|
3189
5050
|
method,
|
|
3190
5051
|
headers: {
|
|
3191
5052
|
Authorization: this.authHeader(),
|
|
@@ -3193,10 +5054,10 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3193
5054
|
},
|
|
3194
5055
|
...payload ? { body: JSON.stringify(payload) } : {}
|
|
3195
5056
|
});
|
|
3196
|
-
const
|
|
3197
|
-
const body =
|
|
5057
|
+
const text2 = await response.text();
|
|
5058
|
+
const body = text2 ? safeJson2(text2) : {};
|
|
3198
5059
|
if (!response.ok) {
|
|
3199
|
-
const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${
|
|
5060
|
+
const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${path9}`;
|
|
3200
5061
|
if (response.status === 409) {
|
|
3201
5062
|
throw new GatewayMemoryConflictError(
|
|
3202
5063
|
message,
|
|
@@ -3205,7 +5066,7 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3205
5066
|
}
|
|
3206
5067
|
throw new GatewayMemoryError(message);
|
|
3207
5068
|
}
|
|
3208
|
-
this.log("%s %s -> %s", method,
|
|
5069
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
3209
5070
|
return body;
|
|
3210
5071
|
}
|
|
3211
5072
|
authHeader() {
|
|
@@ -3367,10 +5228,10 @@ var PersonasClient = class _PersonasClient {
|
|
|
3367
5228
|
done: Boolean(payload.done)
|
|
3368
5229
|
};
|
|
3369
5230
|
}
|
|
3370
|
-
async requestJson(method,
|
|
5231
|
+
async requestJson(method, path9, payload) {
|
|
3371
5232
|
let response;
|
|
3372
5233
|
try {
|
|
3373
|
-
response = await fetch(`${this.host}${
|
|
5234
|
+
response = await fetch(`${this.host}${path9}`, {
|
|
3374
5235
|
method,
|
|
3375
5236
|
headers: {
|
|
3376
5237
|
Authorization: this.authHeader(),
|
|
@@ -3381,19 +5242,19 @@ var PersonasClient = class _PersonasClient {
|
|
|
3381
5242
|
});
|
|
3382
5243
|
} catch (error) {
|
|
3383
5244
|
const reason = error instanceof Error ? error.message : String(error);
|
|
3384
|
-
throw new PersonaError(`${method} ${
|
|
5245
|
+
throw new PersonaError(`${method} ${path9} failed: ${reason}`, {
|
|
3385
5246
|
cause: error
|
|
3386
5247
|
});
|
|
3387
5248
|
}
|
|
3388
|
-
const
|
|
5249
|
+
const text2 = await response.text();
|
|
3389
5250
|
if (!response.ok) {
|
|
3390
|
-
const detail =
|
|
5251
|
+
const detail = text2.slice(0, 500);
|
|
3391
5252
|
throw new PersonaError(
|
|
3392
|
-
`${method} ${
|
|
5253
|
+
`${method} ${path9} failed (${response.status}): ${detail}`
|
|
3393
5254
|
);
|
|
3394
5255
|
}
|
|
3395
|
-
this.log("%s %s -> %s", method,
|
|
3396
|
-
return safeJson3(
|
|
5256
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
5257
|
+
return safeJson3(text2);
|
|
3397
5258
|
}
|
|
3398
5259
|
authHeader() {
|
|
3399
5260
|
return `Basic ${Buffer.from(`${this.publicKey}:${this.secretKey}`).toString(
|
|
@@ -3617,10 +5478,10 @@ var SessionRecording = class _SessionRecording {
|
|
|
3617
5478
|
};
|
|
3618
5479
|
}
|
|
3619
5480
|
/** Dump the full session as a JSON fixture (for regression tests). */
|
|
3620
|
-
toFixture(
|
|
3621
|
-
(0, import_node_fs.mkdirSync)((0, import_node_path.dirname)(
|
|
3622
|
-
(0, import_node_fs.writeFileSync)(
|
|
3623
|
-
return
|
|
5481
|
+
toFixture(path9) {
|
|
5482
|
+
(0, import_node_fs.mkdirSync)((0, import_node_path.dirname)(path9), { recursive: true });
|
|
5483
|
+
(0, import_node_fs.writeFileSync)(path9, JSON.stringify(this.toJSON(), null, 2), "utf-8");
|
|
5484
|
+
return path9;
|
|
3624
5485
|
}
|
|
3625
5486
|
static fromApi(raw) {
|
|
3626
5487
|
return new _SessionRecording({
|
|
@@ -3661,15 +5522,15 @@ async function loadSession(sessionId, options = {}) {
|
|
|
3661
5522
|
if (response.status === 404) {
|
|
3662
5523
|
throw new SessionLoadError(`Session not found: ${sessionId}`);
|
|
3663
5524
|
}
|
|
3664
|
-
const
|
|
5525
|
+
const text2 = await response.text();
|
|
3665
5526
|
if (!response.ok) {
|
|
3666
5527
|
throw new SessionLoadError(
|
|
3667
|
-
`Failed to load session ${sessionId}: HTTP ${response.status} \u2014 ${
|
|
5528
|
+
`Failed to load session ${sessionId}: HTTP ${response.status} \u2014 ${text2.slice(0, 300)}`
|
|
3668
5529
|
);
|
|
3669
5530
|
}
|
|
3670
5531
|
let payload;
|
|
3671
5532
|
try {
|
|
3672
|
-
payload = JSON.parse(
|
|
5533
|
+
payload = JSON.parse(text2);
|
|
3673
5534
|
} catch (error) {
|
|
3674
5535
|
throw new SessionLoadError(
|
|
3675
5536
|
`Failed to load session ${sessionId}: response is not valid JSON`,
|
|
@@ -4217,13 +6078,13 @@ var ReplaySuite = class _ReplaySuite {
|
|
|
4217
6078
|
if (response.status === 404) {
|
|
4218
6079
|
return null;
|
|
4219
6080
|
}
|
|
4220
|
-
const
|
|
6081
|
+
const text2 = await response.text();
|
|
4221
6082
|
if (!response.ok) {
|
|
4222
6083
|
throw new ReplayError(
|
|
4223
|
-
`Failed to list tasks for ${datasetId}: HTTP ${response.status} \u2014 ${
|
|
6084
|
+
`Failed to list tasks for ${datasetId}: HTTP ${response.status} \u2014 ${text2.slice(0, 300)}`
|
|
4224
6085
|
);
|
|
4225
6086
|
}
|
|
4226
|
-
const payload = parseJsonObject(
|
|
6087
|
+
const payload = parseJsonObject(text2);
|
|
4227
6088
|
const pageTasks = Array.isArray(payload.tasks) ? payload.tasks : [];
|
|
4228
6089
|
tasks.push(...pageTasks.filter(isPlainObject2));
|
|
4229
6090
|
if (tasks.length >= Number(payload.totalTasks ?? 0)) {
|
|
@@ -4240,13 +6101,13 @@ var ReplaySuite = class _ReplaySuite {
|
|
|
4240
6101
|
`${host}/api/public/task-sets?name=${encodeURIComponent(nameOrId)}`,
|
|
4241
6102
|
{ headers, signal: AbortSignal.timeout(timeoutSeconds * 1e3) }
|
|
4242
6103
|
);
|
|
4243
|
-
const
|
|
6104
|
+
const text2 = await response.text();
|
|
4244
6105
|
if (!response.ok) {
|
|
4245
6106
|
throw new ReplayError(
|
|
4246
|
-
`Failed to resolve task set '${nameOrId}': HTTP ${response.status} \u2014 ${
|
|
6107
|
+
`Failed to resolve task set '${nameOrId}': HTTP ${response.status} \u2014 ${text2.slice(0, 300)}`
|
|
4247
6108
|
);
|
|
4248
6109
|
}
|
|
4249
|
-
const payload = parseJsonObject(
|
|
6110
|
+
const payload = parseJsonObject(text2);
|
|
4250
6111
|
const matches = Array.isArray(payload.taskSets) ? payload.taskSets.filter(isPlainObject2) : [];
|
|
4251
6112
|
if (matches.length === 0) {
|
|
4252
6113
|
throw new ReplayError(`Task set not found: ${nameOrId}`);
|
|
@@ -4369,8 +6230,8 @@ async function recordRunItem(suiteToRecord, testCase, runName, traceId, triage,
|
|
|
4369
6230
|
if (response.status === 200) {
|
|
4370
6231
|
return null;
|
|
4371
6232
|
}
|
|
4372
|
-
const
|
|
4373
|
-
lastError = `HTTP ${response.status}: ${
|
|
6233
|
+
const text2 = await response.text();
|
|
6234
|
+
lastError = `HTTP ${response.status}: ${text2.slice(0, 200)}`;
|
|
4374
6235
|
if (response.status !== 404) {
|
|
4375
6236
|
return lastError;
|
|
4376
6237
|
}
|
|
@@ -4443,9 +6304,9 @@ function suite(nameOrId, options = {}) {
|
|
|
4443
6304
|
function isPlainObject2(value) {
|
|
4444
6305
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4445
6306
|
}
|
|
4446
|
-
function parseJsonObject(
|
|
6307
|
+
function parseJsonObject(text2) {
|
|
4447
6308
|
try {
|
|
4448
|
-
const parsed = JSON.parse(
|
|
6309
|
+
const parsed = JSON.parse(text2);
|
|
4449
6310
|
return isPlainObject2(parsed) ? parsed : {};
|
|
4450
6311
|
} catch {
|
|
4451
6312
|
return {};
|
|
@@ -4455,7 +6316,7 @@ function randomHex() {
|
|
|
4455
6316
|
return crypto.randomUUID().replace(/-/g, "");
|
|
4456
6317
|
}
|
|
4457
6318
|
function sleep(ms) {
|
|
4458
|
-
return new Promise((
|
|
6319
|
+
return new Promise((resolve7) => setTimeout(resolve7, ms));
|
|
4459
6320
|
}
|
|
4460
6321
|
var replay = {
|
|
4461
6322
|
suite,
|
|
@@ -4542,7 +6403,7 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4542
6403
|
const descriptors = entries.map(
|
|
4543
6404
|
([key, tool]) => this.describeTool(key, tool, options)
|
|
4544
6405
|
);
|
|
4545
|
-
const
|
|
6406
|
+
const resolve7 = await this.resolveToolset({
|
|
4546
6407
|
agent: this.agent,
|
|
4547
6408
|
toolsetId: options.toolsetId,
|
|
4548
6409
|
toolsetName: options.toolsetName,
|
|
@@ -4552,8 +6413,8 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4552
6413
|
});
|
|
4553
6414
|
const securedEntries = entries.flatMap(([key, tool]) => {
|
|
4554
6415
|
const descriptor = descriptors.find((item) => item.name === key);
|
|
4555
|
-
if (!this.shouldExposeTool(
|
|
4556
|
-
this.log("Hiding tool %s in %s mode", descriptor.id,
|
|
6416
|
+
if (!this.shouldExposeTool(resolve7, descriptor.id)) {
|
|
6417
|
+
this.log("Hiding tool %s in %s mode", descriptor.id, resolve7.mode);
|
|
4557
6418
|
return [];
|
|
4558
6419
|
}
|
|
4559
6420
|
return [
|
|
@@ -4563,7 +6424,7 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4563
6424
|
toolId: descriptor.id,
|
|
4564
6425
|
toolsetId: options.toolsetId,
|
|
4565
6426
|
context: this.normalizeContext(options.context),
|
|
4566
|
-
resolve:
|
|
6427
|
+
resolve: resolve7
|
|
4567
6428
|
})
|
|
4568
6429
|
]
|
|
4569
6430
|
];
|
|
@@ -4651,8 +6512,8 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4651
6512
|
);
|
|
4652
6513
|
}
|
|
4653
6514
|
}
|
|
4654
|
-
async postJson(
|
|
4655
|
-
const response = await fetch(`${this.host}${
|
|
6515
|
+
async postJson(path9, payload) {
|
|
6516
|
+
const response = await fetch(`${this.host}${path9}`, {
|
|
4656
6517
|
method: "POST",
|
|
4657
6518
|
headers: {
|
|
4658
6519
|
Authorization: this.authHeader(),
|
|
@@ -4663,7 +6524,7 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4663
6524
|
if (!response.ok) {
|
|
4664
6525
|
const body = await response.text();
|
|
4665
6526
|
throw new GatewaySecurityError(
|
|
4666
|
-
`Gateway API ${response.status} on ${
|
|
6527
|
+
`Gateway API ${response.status} on ${path9}: ${body || response.statusText}`
|
|
4667
6528
|
);
|
|
4668
6529
|
}
|
|
4669
6530
|
return await response.json();
|
|
@@ -4678,9 +6539,9 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4678
6539
|
metadata: options.toolMetadata?.[key] ?? {}
|
|
4679
6540
|
};
|
|
4680
6541
|
}
|
|
4681
|
-
shouldExposeTool(
|
|
4682
|
-
if (
|
|
4683
|
-
if (
|
|
6542
|
+
shouldExposeTool(resolve7, toolId) {
|
|
6543
|
+
if (resolve7.mode === "observe") return true;
|
|
6544
|
+
if (resolve7.blockedToolIds.includes(toolId)) return false;
|
|
4684
6545
|
return true;
|
|
4685
6546
|
}
|
|
4686
6547
|
normalizeContext(context4) {
|
|
@@ -4832,10 +6693,10 @@ var UsersClient = class _UsersClient {
|
|
|
4832
6693
|
params.set("toTimestamp", filter.toTimestamp.toISOString());
|
|
4833
6694
|
if (filter.page) params.set("page", String(filter.page));
|
|
4834
6695
|
if (filter.limit) params.set("limit", String(filter.limit));
|
|
4835
|
-
const
|
|
6696
|
+
const qs3 = params.toString();
|
|
4836
6697
|
const payload = await this.requestJson(
|
|
4837
6698
|
"GET",
|
|
4838
|
-
`/api/public/user-events${
|
|
6699
|
+
`/api/public/user-events${qs3 ? `?${qs3}` : ""}`
|
|
4839
6700
|
);
|
|
4840
6701
|
const rows = Array.isArray(payload.data) ? payload.data : [];
|
|
4841
6702
|
const meta = payload.meta && typeof payload.meta === "object" ? payload.meta : {};
|
|
@@ -4844,10 +6705,10 @@ var UsersClient = class _UsersClient {
|
|
|
4844
6705
|
totalItems: Number(meta.totalItems ?? rows.length)
|
|
4845
6706
|
};
|
|
4846
6707
|
}
|
|
4847
|
-
async requestJson(method,
|
|
6708
|
+
async requestJson(method, path9, payload) {
|
|
4848
6709
|
let response;
|
|
4849
6710
|
try {
|
|
4850
|
-
response = await fetch(`${this.host}${
|
|
6711
|
+
response = await fetch(`${this.host}${path9}`, {
|
|
4851
6712
|
method,
|
|
4852
6713
|
headers: {
|
|
4853
6714
|
Authorization: this.authHeader(),
|
|
@@ -4858,18 +6719,18 @@ var UsersClient = class _UsersClient {
|
|
|
4858
6719
|
});
|
|
4859
6720
|
} catch (error) {
|
|
4860
6721
|
throw new UserProfileError(
|
|
4861
|
-
`${method} ${
|
|
6722
|
+
`${method} ${path9} failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
4862
6723
|
{ cause: error }
|
|
4863
6724
|
);
|
|
4864
6725
|
}
|
|
4865
|
-
const
|
|
6726
|
+
const text2 = await response.text();
|
|
4866
6727
|
if (!response.ok) {
|
|
4867
6728
|
throw new UserProfileError(
|
|
4868
|
-
`${method} ${
|
|
6729
|
+
`${method} ${path9} failed (${response.status}): ${text2.slice(0, 500)}`
|
|
4869
6730
|
);
|
|
4870
6731
|
}
|
|
4871
|
-
this.log("%s %s -> %s", method,
|
|
4872
|
-
return safeJson4(
|
|
6732
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
6733
|
+
return safeJson4(text2);
|
|
4873
6734
|
}
|
|
4874
6735
|
authHeader() {
|
|
4875
6736
|
return `Basic ${Buffer.from(`${this.publicKey}:${this.secretKey}`).toString(
|
|
@@ -5072,10 +6933,10 @@ var ScoresClient = class _ScoresClient {
|
|
|
5072
6933
|
metadata: signalMetadata
|
|
5073
6934
|
});
|
|
5074
6935
|
}
|
|
5075
|
-
async request(method,
|
|
6936
|
+
async request(method, path9, payload) {
|
|
5076
6937
|
let response;
|
|
5077
6938
|
try {
|
|
5078
|
-
response = await fetch(`${this.host}${
|
|
6939
|
+
response = await fetch(`${this.host}${path9}`, {
|
|
5079
6940
|
method,
|
|
5080
6941
|
headers: {
|
|
5081
6942
|
Authorization: this.authHeader(),
|
|
@@ -5086,17 +6947,17 @@ var ScoresClient = class _ScoresClient {
|
|
|
5086
6947
|
});
|
|
5087
6948
|
} catch (error) {
|
|
5088
6949
|
throw new ScoreError(
|
|
5089
|
-
`${method} ${
|
|
6950
|
+
`${method} ${path9} failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
5090
6951
|
{ cause: error }
|
|
5091
6952
|
);
|
|
5092
6953
|
}
|
|
5093
|
-
const
|
|
6954
|
+
const text2 = await response.text();
|
|
5094
6955
|
if (!response.ok) {
|
|
5095
6956
|
throw new ScoreError(
|
|
5096
|
-
`${method} ${
|
|
6957
|
+
`${method} ${path9} failed (${response.status}): ${text2.slice(0, 500)}`
|
|
5097
6958
|
);
|
|
5098
6959
|
}
|
|
5099
|
-
this.log("%s %s -> %s", method,
|
|
6960
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
5100
6961
|
}
|
|
5101
6962
|
authHeader() {
|
|
5102
6963
|
return `Basic ${Buffer.from(`${this.publicKey}:${this.secretKey}`).toString(
|
|
@@ -5137,8 +6998,287 @@ var scores = {
|
|
|
5137
6998
|
init_worlds();
|
|
5138
6999
|
init_session();
|
|
5139
7000
|
|
|
7001
|
+
// src/files/index.ts
|
|
7002
|
+
var files_exports = {};
|
|
7003
|
+
__export(files_exports, {
|
|
7004
|
+
DRIVE_PREFIX: () => DRIVE_PREFIX,
|
|
7005
|
+
confirmUpload: () => confirmUpload,
|
|
7006
|
+
contentTypeFor: () => contentTypeFor,
|
|
7007
|
+
createFolder: () => createFolder,
|
|
7008
|
+
deleteFile: () => deleteFile,
|
|
7009
|
+
downloadFile: () => downloadFile,
|
|
7010
|
+
drivePath: () => drivePath,
|
|
7011
|
+
getFile: () => getFile,
|
|
7012
|
+
isDriveRef: () => isDriveRef,
|
|
7013
|
+
iterateFiles: () => iterateFiles,
|
|
7014
|
+
listFileConnectors: () => listFileConnectors,
|
|
7015
|
+
listFiles: () => listFiles,
|
|
7016
|
+
moveFile: () => moveFile,
|
|
7017
|
+
readFile: () => readFile2,
|
|
7018
|
+
requestUpload: () => requestUpload,
|
|
7019
|
+
sha256Base64: () => sha256Base64,
|
|
7020
|
+
syncFileConnector: () => syncFileConnector,
|
|
7021
|
+
uploadBytes: () => uploadBytes,
|
|
7022
|
+
uploadFile: () => uploadFile
|
|
7023
|
+
});
|
|
7024
|
+
var import_node_crypto7 = require("crypto");
|
|
7025
|
+
var fs9 = __toESM(require("fs"));
|
|
7026
|
+
var path8 = __toESM(require("path"));
|
|
7027
|
+
var import_node_stream = require("stream");
|
|
7028
|
+
var import_promises = require("stream/promises");
|
|
7029
|
+
init_worlds();
|
|
7030
|
+
var DRIVE_PREFIX = "drive:";
|
|
7031
|
+
function isDriveRef(value) {
|
|
7032
|
+
return value.startsWith(DRIVE_PREFIX);
|
|
7033
|
+
}
|
|
7034
|
+
function drivePath(ref) {
|
|
7035
|
+
const raw = isDriveRef(ref) ? ref.slice(DRIVE_PREFIX.length) : ref;
|
|
7036
|
+
const trimmed = raw.replace(/^\/+/, "");
|
|
7037
|
+
if (!trimmed) throw new Error(`${ref} names no file in the drive`);
|
|
7038
|
+
return trimmed;
|
|
7039
|
+
}
|
|
7040
|
+
var PAGE_LIMIT = 200;
|
|
7041
|
+
var BASE = "/api/public/files";
|
|
7042
|
+
function qs(params) {
|
|
7043
|
+
const search = new URLSearchParams();
|
|
7044
|
+
for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== "") search.set(key, String(value));
|
|
7045
|
+
const text2 = search.toString();
|
|
7046
|
+
return text2 ? `?${text2}` : "";
|
|
7047
|
+
}
|
|
7048
|
+
async function listFiles(options = {}, params = {}) {
|
|
7049
|
+
return apiRequest(options, "GET", `${BASE}${qs({ prefix: params.prefix, page: params.page, limit: params.limit })}`);
|
|
7050
|
+
}
|
|
7051
|
+
async function* iterateFiles(options = {}, prefix) {
|
|
7052
|
+
for (let page = 0; ; page++) {
|
|
7053
|
+
const listing = await listFiles(options, { prefix, page, limit: PAGE_LIMIT });
|
|
7054
|
+
yield* listing.files;
|
|
7055
|
+
const seen = (page + 1) * listing.limit;
|
|
7056
|
+
if (!listing.files.length || seen >= listing.totalFiles) return;
|
|
7057
|
+
}
|
|
7058
|
+
}
|
|
7059
|
+
async function getFile(options = {}, filePath) {
|
|
7060
|
+
return apiRequest(options, "GET", `${BASE}/download${qs({ path: drivePath(filePath) })}`);
|
|
7061
|
+
}
|
|
7062
|
+
async function openDownload(url) {
|
|
7063
|
+
const res = await fetch(url);
|
|
7064
|
+
if (!res.ok || !res.body) throw new Error(`download failed: storage answered HTTP ${res.status}`);
|
|
7065
|
+
return res;
|
|
7066
|
+
}
|
|
7067
|
+
async function readFile2(options = {}, filePath) {
|
|
7068
|
+
const file = await getFile(options, filePath);
|
|
7069
|
+
const res = await openDownload(file.url);
|
|
7070
|
+
return Buffer.from(await res.arrayBuffer());
|
|
7071
|
+
}
|
|
7072
|
+
async function downloadFile(options = {}, filePath, outPath, onProgress) {
|
|
7073
|
+
const file = await getFile(options, filePath);
|
|
7074
|
+
const res = await openDownload(file.url);
|
|
7075
|
+
fs9.mkdirSync(path8.dirname(path8.resolve(outPath)), { recursive: true });
|
|
7076
|
+
const source = import_node_stream.Readable.fromWeb(res.body);
|
|
7077
|
+
await (0, import_promises.pipeline)(source, counting((n) => onProgress?.(n, file.sizeBytes)), fs9.createWriteStream(outPath));
|
|
7078
|
+
return { ...file, out: outPath };
|
|
7079
|
+
}
|
|
7080
|
+
async function requestUpload(options = {}, body) {
|
|
7081
|
+
return apiRequest(options, "POST", BASE, body);
|
|
7082
|
+
}
|
|
7083
|
+
async function confirmUpload(options = {}, fileId, ok = true) {
|
|
7084
|
+
return apiRequest(options, "POST", `${BASE}/confirm`, { fileId, ok });
|
|
7085
|
+
}
|
|
7086
|
+
async function sha256Base64(localPath) {
|
|
7087
|
+
const hash = (0, import_node_crypto7.createHash)("sha256");
|
|
7088
|
+
for await (const chunk of fs9.createReadStream(localPath)) hash.update(chunk);
|
|
7089
|
+
return hash.digest("base64");
|
|
7090
|
+
}
|
|
7091
|
+
var CONTENT_TYPES = {
|
|
7092
|
+
".json": "application/json",
|
|
7093
|
+
".jsonl": "application/x-ndjson",
|
|
7094
|
+
".ndjson": "application/x-ndjson",
|
|
7095
|
+
".csv": "text/csv",
|
|
7096
|
+
".tsv": "text/tab-separated-values",
|
|
7097
|
+
".txt": "text/plain",
|
|
7098
|
+
".md": "text/markdown",
|
|
7099
|
+
".toml": "application/toml",
|
|
7100
|
+
".yaml": "application/yaml",
|
|
7101
|
+
".yml": "application/yaml",
|
|
7102
|
+
".xml": "application/xml",
|
|
7103
|
+
".html": "text/html",
|
|
7104
|
+
".sql": "application/sql",
|
|
7105
|
+
".py": "text/x-python",
|
|
7106
|
+
".ts": "text/plain",
|
|
7107
|
+
".js": "text/javascript",
|
|
7108
|
+
".pdf": "application/pdf",
|
|
7109
|
+
".png": "image/png",
|
|
7110
|
+
".jpg": "image/jpeg",
|
|
7111
|
+
".jpeg": "image/jpeg",
|
|
7112
|
+
".gif": "image/gif",
|
|
7113
|
+
".webp": "image/webp",
|
|
7114
|
+
".svg": "image/svg+xml",
|
|
7115
|
+
".zip": "application/zip",
|
|
7116
|
+
".gz": "application/gzip",
|
|
7117
|
+
".tar": "application/x-tar",
|
|
7118
|
+
".parquet": "application/vnd.apache.parquet",
|
|
7119
|
+
".wav": "audio/wav",
|
|
7120
|
+
".mp3": "audio/mpeg",
|
|
7121
|
+
".mp4": "video/mp4"
|
|
7122
|
+
};
|
|
7123
|
+
function contentTypeFor(name) {
|
|
7124
|
+
return CONTENT_TYPES[path8.extname(name).toLowerCase()] ?? "application/octet-stream";
|
|
7125
|
+
}
|
|
7126
|
+
function counting(report) {
|
|
7127
|
+
let seen = 0;
|
|
7128
|
+
return new import_node_stream.Transform({
|
|
7129
|
+
transform(chunk, _encoding, callback) {
|
|
7130
|
+
seen += chunk.length;
|
|
7131
|
+
report(seen);
|
|
7132
|
+
callback(null, chunk);
|
|
7133
|
+
}
|
|
7134
|
+
});
|
|
7135
|
+
}
|
|
7136
|
+
async function putPresigned(uploadUrl, body, headers) {
|
|
7137
|
+
const res = await fetch(uploadUrl, {
|
|
7138
|
+
method: "PUT",
|
|
7139
|
+
headers: {
|
|
7140
|
+
"content-type": headers.contentType,
|
|
7141
|
+
"content-length": String(headers.contentLength),
|
|
7142
|
+
"x-amz-checksum-sha256": headers.sha256
|
|
7143
|
+
},
|
|
7144
|
+
body,
|
|
7145
|
+
// A streamed request body needs the half-duplex declaration (Node's fetch).
|
|
7146
|
+
duplex: "half"
|
|
7147
|
+
});
|
|
7148
|
+
if (!res.ok) throw new Error(`upload failed: storage answered HTTP ${res.status}: ${(await res.text()).slice(0, 300)}`);
|
|
7149
|
+
}
|
|
7150
|
+
async function uploadFile(options = {}, localPath, targetPath, upload = {}) {
|
|
7151
|
+
const stat = fs9.statSync(localPath);
|
|
7152
|
+
if (!stat.isFile()) throw new Error(`${localPath} is not a file`);
|
|
7153
|
+
if (stat.size === 0) throw new Error(`${localPath} is empty; the drive refuses zero-byte uploads`);
|
|
7154
|
+
const contentType = upload.contentType ?? contentTypeFor(localPath);
|
|
7155
|
+
const sha2562 = await sha256Base64(localPath);
|
|
7156
|
+
const target = drivePath(targetPath);
|
|
7157
|
+
const granted = await requestUpload(options, { path: target, contentLength: stat.size, contentType, sha256: sha2562, ...upload.overwrite ? { overwrite: true } : {} });
|
|
7158
|
+
try {
|
|
7159
|
+
const stream = fs9.createReadStream(localPath).pipe(counting((n) => upload.onProgress?.(n, stat.size)));
|
|
7160
|
+
await putPresigned(granted.uploadUrl, import_node_stream.Readable.toWeb(stream), { contentType, contentLength: stat.size, sha256: sha2562 });
|
|
7161
|
+
} catch (error) {
|
|
7162
|
+
await confirmUpload(options, granted.fileId, false).catch(() => void 0);
|
|
7163
|
+
throw error;
|
|
7164
|
+
}
|
|
7165
|
+
const confirmed = await confirmUpload(options, granted.fileId, true);
|
|
7166
|
+
return { path: confirmed.path, fileId: granted.fileId, sizeBytes: stat.size, sha256: sha2562, contentType };
|
|
7167
|
+
}
|
|
7168
|
+
async function uploadBytes(options = {}, bytes, targetPath, upload = {}) {
|
|
7169
|
+
if (!bytes.length) throw new Error("nothing to upload: the content is empty");
|
|
7170
|
+
const target = drivePath(targetPath);
|
|
7171
|
+
const contentType = upload.contentType ?? contentTypeFor(target);
|
|
7172
|
+
const sha2562 = (0, import_node_crypto7.createHash)("sha256").update(bytes).digest("base64");
|
|
7173
|
+
const granted = await requestUpload(options, { path: target, contentLength: bytes.length, contentType, sha256: sha2562, ...upload.overwrite ? { overwrite: true } : {} });
|
|
7174
|
+
try {
|
|
7175
|
+
await putPresigned(granted.uploadUrl, new Uint8Array(bytes), { contentType, contentLength: bytes.length, sha256: sha2562 });
|
|
7176
|
+
} catch (error) {
|
|
7177
|
+
await confirmUpload(options, granted.fileId, false).catch(() => void 0);
|
|
7178
|
+
throw error;
|
|
7179
|
+
}
|
|
7180
|
+
const confirmed = await confirmUpload(options, granted.fileId, true);
|
|
7181
|
+
return { path: confirmed.path, fileId: granted.fileId, sizeBytes: bytes.length, sha256: sha2562, contentType };
|
|
7182
|
+
}
|
|
7183
|
+
async function deleteFile(options = {}, filePath) {
|
|
7184
|
+
return apiRequest(options, "DELETE", `${BASE}${qs({ path: drivePath(filePath) })}`);
|
|
7185
|
+
}
|
|
7186
|
+
async function moveFile(options = {}, fromPath, toPath) {
|
|
7187
|
+
return apiRequest(options, "POST", `${BASE}/move`, { fromPath: drivePath(fromPath), toPath: drivePath(toPath) });
|
|
7188
|
+
}
|
|
7189
|
+
async function createFolder(options = {}, folderPath) {
|
|
7190
|
+
return apiRequest(options, "POST", `${BASE}/folders`, { path: drivePath(folderPath) });
|
|
7191
|
+
}
|
|
7192
|
+
async function listFileConnectors(options = {}) {
|
|
7193
|
+
return apiRequest(options, "GET", `${BASE}/connectors`);
|
|
7194
|
+
}
|
|
7195
|
+
async function syncFileConnector(options = {}, connectorId) {
|
|
7196
|
+
return apiRequest(options, "POST", `${BASE}/connectors/sync`, { connectorId });
|
|
7197
|
+
}
|
|
7198
|
+
|
|
7199
|
+
// src/traces/index.ts
|
|
7200
|
+
var traces_exports = {};
|
|
7201
|
+
__export(traces_exports, {
|
|
7202
|
+
PAGE_LIMIT: () => PAGE_LIMIT2,
|
|
7203
|
+
exportTraces: () => exportTraces,
|
|
7204
|
+
getSession: () => getSession,
|
|
7205
|
+
getTrace: () => getTrace,
|
|
7206
|
+
iterateObservations: () => iterateObservations,
|
|
7207
|
+
iterateSessions: () => iterateSessions,
|
|
7208
|
+
iterateTraces: () => iterateTraces,
|
|
7209
|
+
listObservations: () => listObservations,
|
|
7210
|
+
listSessions: () => listSessions,
|
|
7211
|
+
listTraces: () => listTraces
|
|
7212
|
+
});
|
|
7213
|
+
init_worlds();
|
|
7214
|
+
var PAGE_LIMIT2 = 100;
|
|
7215
|
+
function qs2(params) {
|
|
7216
|
+
const search = new URLSearchParams();
|
|
7217
|
+
for (const [key, value] of Object.entries(params)) {
|
|
7218
|
+
if (value === void 0 || value === null || value === "") continue;
|
|
7219
|
+
if (Array.isArray(value)) for (const item of value) search.append(key, item);
|
|
7220
|
+
else search.set(key, String(value));
|
|
7221
|
+
}
|
|
7222
|
+
const text2 = search.toString();
|
|
7223
|
+
return text2 ? `?${text2}` : "";
|
|
7224
|
+
}
|
|
7225
|
+
async function listTraces(options = {}, filters = {}, page = {}) {
|
|
7226
|
+
const { tags, ...rest } = filters;
|
|
7227
|
+
return apiRequest(options, "GET", `/api/public/traces${qs2({ ...rest, tags, page: page.page ?? 1, limit: page.limit ?? 50, fields: page.fields })}`);
|
|
7228
|
+
}
|
|
7229
|
+
async function* iterateTraces(options = {}, filters = {}, limits = {}) {
|
|
7230
|
+
yield* paged((page) => listTraces(options, filters, { page, limit: PAGE_LIMIT2, fields: limits.fields }), limits.max);
|
|
7231
|
+
}
|
|
7232
|
+
async function getTrace(options = {}, traceId) {
|
|
7233
|
+
return apiRequest(options, "GET", `/api/public/traces/${encodeURIComponent(traceId)}`);
|
|
7234
|
+
}
|
|
7235
|
+
async function listObservations(options = {}, filters = {}, page = {}) {
|
|
7236
|
+
return apiRequest(options, "GET", `/api/public/observations${qs2({ ...filters, page: page.page ?? 1, limit: page.limit ?? 50 })}`);
|
|
7237
|
+
}
|
|
7238
|
+
async function* iterateObservations(options = {}, filters = {}, limits = {}) {
|
|
7239
|
+
yield* paged((page) => listObservations(options, filters, { page, limit: PAGE_LIMIT2 }), limits.max);
|
|
7240
|
+
}
|
|
7241
|
+
async function listSessions(options = {}, filters = {}, page = {}) {
|
|
7242
|
+
return apiRequest(options, "GET", `/api/public/sessions${qs2({ ...filters, page: page.page ?? 1, limit: page.limit ?? 50 })}`);
|
|
7243
|
+
}
|
|
7244
|
+
async function* iterateSessions(options = {}, filters = {}, limits = {}) {
|
|
7245
|
+
yield* paged((page) => listSessions(options, filters, { page, limit: PAGE_LIMIT2 }), limits.max);
|
|
7246
|
+
}
|
|
7247
|
+
async function getSession(options = {}, sessionId, detail = {}) {
|
|
7248
|
+
return apiRequest(options, "GET", `/api/public/sessions/${encodeURIComponent(sessionId)}${qs2({ includeIO: detail.includeIO ? "true" : void 0 })}`);
|
|
7249
|
+
}
|
|
7250
|
+
async function exportTraces(options = {}, filters = {}, exportOptions = {}, write) {
|
|
7251
|
+
const summary = { traces: 0, observations: 0 };
|
|
7252
|
+
const wantedType = exportOptions.type?.toUpperCase();
|
|
7253
|
+
for await (const trace5 of iterateTraces(options, filters, { max: exportOptions.max })) {
|
|
7254
|
+
let record = trace5;
|
|
7255
|
+
if (exportOptions.observations) {
|
|
7256
|
+
const detail = await getTrace(options, trace5.id);
|
|
7257
|
+
const observations = wantedType ? detail.observations.filter((o) => o.type?.toUpperCase() === wantedType) : detail.observations;
|
|
7258
|
+
summary.observations += observations.length;
|
|
7259
|
+
record = { ...detail, observations };
|
|
7260
|
+
}
|
|
7261
|
+
summary.traces++;
|
|
7262
|
+
write(record);
|
|
7263
|
+
}
|
|
7264
|
+
return summary;
|
|
7265
|
+
}
|
|
7266
|
+
async function* paged(fetchPage, max) {
|
|
7267
|
+
let yielded = 0;
|
|
7268
|
+
for (let page = 1; ; page++) {
|
|
7269
|
+
const answer = await fetchPage(page);
|
|
7270
|
+
for (const item of answer.data) {
|
|
7271
|
+
if (max !== void 0 && yielded >= max) return;
|
|
7272
|
+
yielded++;
|
|
7273
|
+
yield item;
|
|
7274
|
+
}
|
|
7275
|
+
const totalPages = answer.meta?.totalPages ?? (answer.data.length < PAGE_LIMIT2 ? page : page + 1);
|
|
7276
|
+
if (!answer.data.length || page >= totalPages) return;
|
|
7277
|
+
}
|
|
7278
|
+
}
|
|
7279
|
+
|
|
5140
7280
|
// src/build/index.ts
|
|
5141
|
-
var
|
|
7281
|
+
var import_node_crypto8 = require("crypto");
|
|
5142
7282
|
function canonicalJson(value) {
|
|
5143
7283
|
if (value === null || typeof value !== "object") {
|
|
5144
7284
|
return JSON.stringify(value);
|
|
@@ -5149,8 +7289,8 @@ function canonicalJson(value) {
|
|
|
5149
7289
|
const entries = Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
5150
7290
|
return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${canonicalJson(v)}`).join(",")}}`;
|
|
5151
7291
|
}
|
|
5152
|
-
function sha256(
|
|
5153
|
-
return `sha256:${(0,
|
|
7292
|
+
function sha256(text2) {
|
|
7293
|
+
return `sha256:${(0, import_node_crypto8.createHash)("sha256").update(text2).digest("hex")}`;
|
|
5154
7294
|
}
|
|
5155
7295
|
var registeredTools = /* @__PURE__ */ new Map();
|
|
5156
7296
|
var registeredPrompts = /* @__PURE__ */ new Map();
|
|
@@ -5915,12 +8055,12 @@ async function* observeClaude(stream, options) {
|
|
|
5915
8055
|
pendingTurnInput = "";
|
|
5916
8056
|
}
|
|
5917
8057
|
const childCtx = options.perTurn ? turnCtx : rootCtx;
|
|
5918
|
-
let
|
|
8058
|
+
let text2 = "";
|
|
5919
8059
|
const toolUses = [];
|
|
5920
8060
|
for (const block of message.message?.content ?? []) {
|
|
5921
8061
|
if (block?.type === "text") {
|
|
5922
8062
|
finalText += block.text;
|
|
5923
|
-
|
|
8063
|
+
text2 += block.text;
|
|
5924
8064
|
}
|
|
5925
8065
|
if (block?.type === "tool_use") {
|
|
5926
8066
|
toolUses.push({
|
|
@@ -5930,7 +8070,7 @@ async function* observeClaude(stream, options) {
|
|
|
5930
8070
|
});
|
|
5931
8071
|
}
|
|
5932
8072
|
}
|
|
5933
|
-
turnText +=
|
|
8073
|
+
turnText += text2;
|
|
5934
8074
|
const gen = tracer.startSpan(
|
|
5935
8075
|
"assistant",
|
|
5936
8076
|
{
|
|
@@ -5938,7 +8078,7 @@ async function* observeClaude(stream, options) {
|
|
|
5938
8078
|
"openinference.span.kind": "LLM",
|
|
5939
8079
|
"llm.model_name": model,
|
|
5940
8080
|
"llm.provider": "anthropic",
|
|
5941
|
-
"output.value":
|
|
8081
|
+
"output.value": text2 || toolUses.map((t) => `\u2192 ${cleanToolName(t.name)}`).join(", ")
|
|
5942
8082
|
}
|
|
5943
8083
|
},
|
|
5944
8084
|
childCtx
|
|
@@ -6055,6 +8195,7 @@ var tracing = {
|
|
|
6055
8195
|
ReplayReport,
|
|
6056
8196
|
ReplaySuite,
|
|
6057
8197
|
ReplayTask,
|
|
8198
|
+
STRIP_PREFIX,
|
|
6058
8199
|
SUCCESS_METRIC_NAME_KEY,
|
|
6059
8200
|
SUCCESS_SIGNAL_KEY,
|
|
6060
8201
|
SURFACE_KINDS,
|
|
@@ -6064,10 +8205,12 @@ var tracing = {
|
|
|
6064
8205
|
SessionRecording,
|
|
6065
8206
|
SessionTrace,
|
|
6066
8207
|
StubMissError,
|
|
8208
|
+
TRANSFORMS,
|
|
6067
8209
|
ToolStubRegistry,
|
|
6068
8210
|
TraceDiff,
|
|
6069
8211
|
UserProfileError,
|
|
6070
8212
|
UsersClient,
|
|
8213
|
+
WHITESPACE,
|
|
6071
8214
|
WorldBrowser,
|
|
6072
8215
|
WorldSession,
|
|
6073
8216
|
WorldSessionCallError,
|
|
@@ -6077,12 +8220,14 @@ var tracing = {
|
|
|
6077
8220
|
WorldTask,
|
|
6078
8221
|
addExperimentAttributes,
|
|
6079
8222
|
apiRequest,
|
|
8223
|
+
applyTransforms,
|
|
6080
8224
|
assembleManifest,
|
|
6081
8225
|
assignVariant,
|
|
6082
8226
|
attachSession,
|
|
6083
8227
|
basicAuthHeader,
|
|
6084
8228
|
buildSourceTarball,
|
|
6085
8229
|
canonicalJson,
|
|
8230
|
+
captureToolCalls,
|
|
6086
8231
|
clearExperimentContext,
|
|
6087
8232
|
collectArchiveRelPaths,
|
|
6088
8233
|
computeBuildHash,
|
|
@@ -6096,9 +8241,11 @@ var tracing = {
|
|
|
6096
8241
|
defineTool,
|
|
6097
8242
|
deleteEnvSecret,
|
|
6098
8243
|
deleteTask,
|
|
8244
|
+
describeWorld,
|
|
6099
8245
|
detectProvenance,
|
|
6100
8246
|
experimentContextStorage,
|
|
6101
8247
|
experiments,
|
|
8248
|
+
files,
|
|
6102
8249
|
gateway,
|
|
6103
8250
|
getExperimentContext,
|
|
6104
8251
|
getRegisteredArtifacts,
|
|
@@ -6107,7 +8254,10 @@ var tracing = {
|
|
|
6107
8254
|
getRegisteredTools,
|
|
6108
8255
|
getRun,
|
|
6109
8256
|
getTask,
|
|
8257
|
+
hashForm,
|
|
6110
8258
|
identify,
|
|
8259
|
+
ingest,
|
|
8260
|
+
ingestToolCalls,
|
|
6111
8261
|
isIncludedInContentHash,
|
|
6112
8262
|
isTaskIdRef,
|
|
6113
8263
|
isTaskSpec,
|
|
@@ -6117,16 +8267,26 @@ var tracing = {
|
|
|
6117
8267
|
loadSession,
|
|
6118
8268
|
localTreeState,
|
|
6119
8269
|
memory,
|
|
8270
|
+
migrateProjectWorlds,
|
|
8271
|
+
migrateWorld,
|
|
6120
8272
|
openBrowser,
|
|
6121
8273
|
openSession,
|
|
6122
8274
|
openWorld,
|
|
8275
|
+
parseToolCallRecord,
|
|
8276
|
+
parseTransform,
|
|
6123
8277
|
parseWorldTaskRefs,
|
|
6124
8278
|
personas,
|
|
8279
|
+
preserveForm,
|
|
6125
8280
|
propose,
|
|
6126
8281
|
pull,
|
|
6127
8282
|
push,
|
|
8283
|
+
pyText,
|
|
8284
|
+
queryRows,
|
|
8285
|
+
queryRowsSearch,
|
|
6128
8286
|
readLocalMeta,
|
|
8287
|
+
readToolCallRecords,
|
|
6129
8288
|
redactActionArgs,
|
|
8289
|
+
redactionOf,
|
|
6130
8290
|
registerArtifact,
|
|
6131
8291
|
registerPrompt,
|
|
6132
8292
|
registerSkill,
|
|
@@ -6135,20 +8295,27 @@ var tracing = {
|
|
|
6135
8295
|
resetBuildRegistry,
|
|
6136
8296
|
resolveBrowserMode,
|
|
6137
8297
|
resolveUserId,
|
|
8298
|
+
roundForm,
|
|
6138
8299
|
runSessions,
|
|
6139
8300
|
runSuite,
|
|
6140
8301
|
runWithExperimentContext,
|
|
6141
8302
|
schemaFromSignature,
|
|
6142
8303
|
scores,
|
|
6143
8304
|
sessionObservationFromApi,
|
|
8305
|
+
sessionToolObservations,
|
|
6144
8306
|
sessions,
|
|
6145
8307
|
setEnvSecret,
|
|
6146
8308
|
setExperimentContext,
|
|
8309
|
+
shapeText,
|
|
6147
8310
|
snapshotTreeHashes,
|
|
8311
|
+
storedForms,
|
|
6148
8312
|
success,
|
|
6149
8313
|
suite,
|
|
6150
8314
|
surfaceKinds,
|
|
6151
8315
|
taskLabel,
|
|
8316
|
+
toolCallRecordsIn,
|
|
8317
|
+
toolCallsFromObservations,
|
|
8318
|
+
traces,
|
|
6152
8319
|
tracing,
|
|
6153
8320
|
uiEntryUrl,
|
|
6154
8321
|
uiUrl,
|