@withgateway/sdk 0.2.0 → 0.2.2
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 +8950 -3291
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +8753 -3094
- 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 +2288 -116
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2260 -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 +1881 -32
- package/dist/worlds/index.js.map +1 -1
- package/dist/worlds/index.mjs +1880 -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 +294 -40
- package/runtime/gatewaysdk/environment/schema/batch.py +43 -9
- 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 +453 -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 +424 -36
- package/runtime/gatewaysdk/environment/schema/dependencies.py +245 -0
- package/runtime/gatewaysdk/environment/schema/extract.py +6 -6
- package/runtime/gatewaysdk/environment/schema/host.py +234 -79
- 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 +622 -0
- package/runtime/gatewaysdk/environment/schema/mapping.py +956 -0
- package/runtime/gatewaysdk/environment/schema/platform.py +708 -205
- 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 +394 -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 +429 -58
- 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 +63 -15
- package/runtime/gatewaysdk/environment/schema/world_tests.py +245 -51
- package/skills/benchmarks-getting-started/SKILL.md +394 -0
- package/skills/connector-schema-authoring/CONNECTORS.md +64 -31
- package/skills/connector-schema-authoring/SKILL.md +86 -36
- package/skills/connector-schema-authoring/connector-worlds.md +355 -0
- package/skills/connector-schema-authoring/world-schema.md +620 -0
- package/skills/world-data-ingestion/ROWS.md +20 -0
- package/skills/world-data-ingestion/SKILL.md +178 -11
- package/skills/worlds-getting-started/SKILL.md +184 -74
- package/skills/worlds-getting-started/references/cli-mcp-map.md +49 -0
- package/skills/worlds-getting-started/references/ui-map.md +18 -0
package/dist/index.mjs
CHANGED
|
@@ -27,9 +27,9 @@ function surfaceKinds(s) {
|
|
|
27
27
|
if (s.browser) kinds.push("browser");
|
|
28
28
|
return kinds;
|
|
29
29
|
}
|
|
30
|
-
function uiUrl(ui,
|
|
30
|
+
function uiUrl(ui, path9) {
|
|
31
31
|
const base = ui.url.replace(/\/+$/, "");
|
|
32
|
-
const rel =
|
|
32
|
+
const rel = path9.startsWith("/") ? path9 : `/${path9}`;
|
|
33
33
|
if (!ui.token) return base + rel;
|
|
34
34
|
const [beforeHash, hash] = splitHash(rel);
|
|
35
35
|
const joiner = beforeHash.includes("?") ? "&" : "?";
|
|
@@ -113,12 +113,12 @@ async function openBrowser(surfaces, opts = {}) {
|
|
|
113
113
|
function computerUseToolkit(browser, opts = {}) {
|
|
114
114
|
const maxText = opts.maxText ?? 2e4;
|
|
115
115
|
const observe2 = async (selector = "body") => {
|
|
116
|
-
const
|
|
116
|
+
const text2 = await browser.text(selector);
|
|
117
117
|
return {
|
|
118
118
|
url: browser.url,
|
|
119
119
|
title: await browser.title(),
|
|
120
|
-
text:
|
|
121
|
-
truncated:
|
|
120
|
+
text: text2.slice(0, maxText),
|
|
121
|
+
truncated: text2.length > maxText
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
124
|
const impls = {
|
|
@@ -202,8 +202,8 @@ var init_browser = __esm({
|
|
|
202
202
|
}
|
|
203
203
|
resolveBase() {
|
|
204
204
|
if (this.base === null) {
|
|
205
|
-
const
|
|
206
|
-
this.base =
|
|
205
|
+
const resolve7 = this.opts.resumeFrom ?? (async () => 0);
|
|
206
|
+
this.base = resolve7().then((n) => {
|
|
207
207
|
if (!Number.isInteger(n) || n < 0)
|
|
208
208
|
throw new Error(
|
|
209
209
|
`browser event base seq must be a non-negative integer, got ${String(n)}`
|
|
@@ -404,11 +404,11 @@ var init_browser = __esm({
|
|
|
404
404
|
await this.settle();
|
|
405
405
|
});
|
|
406
406
|
}
|
|
407
|
-
async type(selector,
|
|
407
|
+
async type(selector, text2) {
|
|
408
408
|
await this.act(
|
|
409
409
|
"browser_type",
|
|
410
|
-
{ selector, text },
|
|
411
|
-
() => this.page.fill(selector,
|
|
410
|
+
{ selector, text: text2 },
|
|
411
|
+
() => this.page.fill(selector, text2)
|
|
412
412
|
);
|
|
413
413
|
}
|
|
414
414
|
async press(key) {
|
|
@@ -711,6 +711,11 @@ var init_session = __esm({
|
|
|
711
711
|
get taskName() {
|
|
712
712
|
return this.current.taskName;
|
|
713
713
|
}
|
|
714
|
+
/** The platform's notices about the world this session runs on (empty
|
|
715
|
+
* for a schema world). Printed by the CLI on stderr at open. */
|
|
716
|
+
get deprecations() {
|
|
717
|
+
return this.current.deprecations ?? [];
|
|
718
|
+
}
|
|
714
719
|
/** The task this session runs: bundled scenario, stored task or inline
|
|
715
720
|
* spec, its name, hash and the caller's metadata. */
|
|
716
721
|
get taskInfo() {
|
|
@@ -742,20 +747,20 @@ var init_session = __esm({
|
|
|
742
747
|
}
|
|
743
748
|
/** Base URL of the world's own HTTP API for this session. */
|
|
744
749
|
async api() {
|
|
745
|
-
const { api } = await this.surfaces();
|
|
746
|
-
if (!
|
|
750
|
+
const { api: api2 } = await this.surfaces();
|
|
751
|
+
if (!api2)
|
|
747
752
|
throw new WorldSurfaceUnavailable(
|
|
748
753
|
"api",
|
|
749
754
|
"open the session with surfaces: ['api'] on an api-type world"
|
|
750
755
|
);
|
|
751
|
-
return
|
|
756
|
+
return api2.url;
|
|
752
757
|
}
|
|
753
758
|
/** Headers every request to `api()` needs. A World Host session gates its
|
|
754
759
|
* api surface on a per-session token; a pod or hosted twin answers with the
|
|
755
760
|
* world's own declared auth and this is `{}`. */
|
|
756
761
|
async apiHeaders() {
|
|
757
|
-
const { api } = await this.surfaces();
|
|
758
|
-
return
|
|
762
|
+
const { api: api2 } = await this.surfaces();
|
|
763
|
+
return api2?.token ? { Authorization: `Bearer ${api2.token}` } : {};
|
|
759
764
|
}
|
|
760
765
|
/** URL of the world's UI entry page for this session. */
|
|
761
766
|
async ui() {
|
|
@@ -784,18 +789,18 @@ var init_session = __esm({
|
|
|
784
789
|
}
|
|
785
790
|
/** The reporter `browser()` uses; exposed for a page you drive yourself. */
|
|
786
791
|
browserRecorder(agentId) {
|
|
787
|
-
const
|
|
792
|
+
const path9 = `/api/public/world-sessions/${encodeURIComponent(this.sessionId)}/browser-events`;
|
|
788
793
|
const id = agentId ?? process.env.GATEWAY_AGENT_ID ?? `agent-${randomUUID().replace(/-/g, "").slice(0, 8)}`;
|
|
789
794
|
return new BrowserActionRecorder(
|
|
790
795
|
async (events) => {
|
|
791
|
-
await apiRequest(this.options, "POST",
|
|
796
|
+
await apiRequest(this.options, "POST", path9, { events });
|
|
792
797
|
},
|
|
793
798
|
id,
|
|
794
799
|
{
|
|
795
800
|
// Continue this agent's timeline where the platform has it, so the
|
|
796
801
|
// same id reopened later never re-numbers from zero.
|
|
797
802
|
resumeFrom: async () => {
|
|
798
|
-
const summary = await apiRequest(this.options, "GET",
|
|
803
|
+
const summary = await apiRequest(this.options, "GET", path9);
|
|
799
804
|
return summary.agents.find((a) => a.agentId === id)?.nextSeq ?? 0;
|
|
800
805
|
}
|
|
801
806
|
}
|
|
@@ -852,7 +857,7 @@ var init_session = __esm({
|
|
|
852
857
|
const { callId } = enqueued;
|
|
853
858
|
const judged = enqueued.pending === true;
|
|
854
859
|
const budgetMs = timeoutMs ?? (judged ? JUDGED_GRADE_TIMEOUT_MS : CALL_TIMEOUT_MS);
|
|
855
|
-
const
|
|
860
|
+
const pollMs2 = judged ? JUDGED_GRADE_POLL_MS : CALL_POLL_MS;
|
|
856
861
|
const deadline = Date.now() + budgetMs;
|
|
857
862
|
for (; ; ) {
|
|
858
863
|
const call = await apiRequest(
|
|
@@ -868,7 +873,7 @@ var init_session = __esm({
|
|
|
868
873
|
throw new WorldSessionTimeout(
|
|
869
874
|
judged ? `Grade ${callId} still ${call.state} after ${Math.round(budgetMs / 1e3)}s \u2014 the judge has not answered; the platform finalizes the call on its own, read it back with export().` : `Call ${callId} still ${call.state} after ${Math.round(budgetMs / 1e3)}s \u2014 the container may have died.`
|
|
870
875
|
);
|
|
871
|
-
await sleep2(
|
|
876
|
+
await sleep2(pollMs2);
|
|
872
877
|
}
|
|
873
878
|
}
|
|
874
879
|
/**
|
|
@@ -943,8 +948,12 @@ var init_session = __esm({
|
|
|
943
948
|
*/
|
|
944
949
|
async seed(rows, opts = {}) {
|
|
945
950
|
const mode = opts.mode ?? "append";
|
|
951
|
+
const redact = opts.redact ?? "off";
|
|
946
952
|
return await this.exchange(
|
|
947
|
-
{
|
|
953
|
+
{
|
|
954
|
+
kind: "seed",
|
|
955
|
+
args: { mode, rows, ...redact !== "off" ? { redact } : {} }
|
|
956
|
+
},
|
|
948
957
|
opts.timeoutMs
|
|
949
958
|
);
|
|
950
959
|
}
|
|
@@ -1115,6 +1124,22 @@ var init_tasks = __esm({
|
|
|
1115
1124
|
});
|
|
1116
1125
|
|
|
1117
1126
|
// src/worlds/hub.ts
|
|
1127
|
+
var hub_exports = {};
|
|
1128
|
+
__export(hub_exports, {
|
|
1129
|
+
DEFAULT_BRANCH: () => DEFAULT_BRANCH,
|
|
1130
|
+
buildSourceTarball: () => buildSourceTarball,
|
|
1131
|
+
collectArchiveRelPaths: () => collectArchiveRelPaths,
|
|
1132
|
+
computeContentHash: () => computeContentHash,
|
|
1133
|
+
createRef: () => createRef,
|
|
1134
|
+
isIncludedInContentHash: () => isIncludedInContentHash,
|
|
1135
|
+
localTreeState: () => localTreeState,
|
|
1136
|
+
propose: () => propose,
|
|
1137
|
+
pull: () => pull,
|
|
1138
|
+
push: () => push,
|
|
1139
|
+
readLocalMeta: () => readLocalMeta,
|
|
1140
|
+
snapshotTreeHashes: () => snapshotTreeHashes,
|
|
1141
|
+
writeLocalMeta: () => writeLocalMeta
|
|
1142
|
+
});
|
|
1118
1143
|
import { createHash as createHash2 } from "crypto";
|
|
1119
1144
|
import { gzipSync, gunzipSync } from "zlib";
|
|
1120
1145
|
import * as fs from "fs";
|
|
@@ -1252,8 +1277,8 @@ function localTreeState(dir) {
|
|
|
1252
1277
|
}
|
|
1253
1278
|
function readPyproject(dir) {
|
|
1254
1279
|
try {
|
|
1255
|
-
const
|
|
1256
|
-
const section = /\[project\]([\s\S]*?)(\n\[|$)/.exec(
|
|
1280
|
+
const text2 = fs.readFileSync(path.join(dir, "pyproject.toml"), "utf-8");
|
|
1281
|
+
const section = /\[project\]([\s\S]*?)(\n\[|$)/.exec(text2)?.[1] ?? "";
|
|
1257
1282
|
const name = /\bname\s*=\s*"([^"]+)"/.exec(section)?.[1];
|
|
1258
1283
|
const version = /\bversion\s*=\s*"([^"]+)"/.exec(section)?.[1];
|
|
1259
1284
|
return { name, version };
|
|
@@ -1261,6 +1286,17 @@ function readPyproject(dir) {
|
|
|
1261
1286
|
return {};
|
|
1262
1287
|
}
|
|
1263
1288
|
}
|
|
1289
|
+
function readWorldContractVersion(dir) {
|
|
1290
|
+
for (const rel of ["schema/world.json", path.join("server", "world", "schema", "world.json")]) {
|
|
1291
|
+
try {
|
|
1292
|
+
const parsed = JSON.parse(fs.readFileSync(path.join(dir, rel), "utf-8"));
|
|
1293
|
+
const pkg = parsed["x-gateway"]?.package;
|
|
1294
|
+
if (pkg?.version) return { name: pkg.id, version: pkg.version };
|
|
1295
|
+
} catch {
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
return {};
|
|
1299
|
+
}
|
|
1264
1300
|
function buildFileManifest(dir) {
|
|
1265
1301
|
const entries = [];
|
|
1266
1302
|
const walk = (rel) => {
|
|
@@ -1306,8 +1342,10 @@ async function push(dir, opts = {}) {
|
|
|
1306
1342
|
const baseVersionId = opts.baseVersionId ?? localMeta.versionId ?? null;
|
|
1307
1343
|
const contentHash = computeContentHash(dir);
|
|
1308
1344
|
const pyproject = readPyproject(dir);
|
|
1345
|
+
const contractVersion = pyproject.version ? void 0 : readWorldContractVersion(dir).version;
|
|
1346
|
+
if (contractVersion) pyproject.version = contractVersion;
|
|
1309
1347
|
const slug = opts.slug ?? pyproject.name ?? path.basename(path.resolve(dir));
|
|
1310
|
-
const
|
|
1348
|
+
const resolve7 = await apiRequest(
|
|
1311
1349
|
options,
|
|
1312
1350
|
"POST",
|
|
1313
1351
|
"/api/public/benchmark-containers/resolve",
|
|
@@ -1322,7 +1360,7 @@ async function push(dir, opts = {}) {
|
|
|
1322
1360
|
const tarball = buildSourceTarball(dir);
|
|
1323
1361
|
const bundleSha256 = sha256b64(tarball);
|
|
1324
1362
|
const version = await apiRequest(options, "POST", "/api/public/benchmark-containers/versions", {
|
|
1325
|
-
containerId:
|
|
1363
|
+
containerId: resolve7.containerId,
|
|
1326
1364
|
contentHash,
|
|
1327
1365
|
bundleSha256,
|
|
1328
1366
|
bundleSizeBytes: tarball.length,
|
|
@@ -1355,7 +1393,7 @@ async function push(dir, opts = {}) {
|
|
|
1355
1393
|
baseFiles: snapshotTreeHashes(dir)
|
|
1356
1394
|
});
|
|
1357
1395
|
return {
|
|
1358
|
-
containerId:
|
|
1396
|
+
containerId: resolve7.containerId,
|
|
1359
1397
|
slug,
|
|
1360
1398
|
versionId: version.versionId,
|
|
1361
1399
|
contentHash,
|
|
@@ -1678,6 +1716,1760 @@ var init_validate = __esm({
|
|
|
1678
1716
|
}
|
|
1679
1717
|
});
|
|
1680
1718
|
|
|
1719
|
+
// src/worlds/describe.ts
|
|
1720
|
+
async function describeWorld(slug, options = {}) {
|
|
1721
|
+
if (slug.includes("@"))
|
|
1722
|
+
throw new Error(
|
|
1723
|
+
`describeWorld reads a world's head version: pass the slug without @ref (got ${slug})`
|
|
1724
|
+
);
|
|
1725
|
+
return apiRequest(
|
|
1726
|
+
options,
|
|
1727
|
+
"GET",
|
|
1728
|
+
`/api/public/worlds/${encodeURIComponent(slug)}`
|
|
1729
|
+
);
|
|
1730
|
+
}
|
|
1731
|
+
var init_describe = __esm({
|
|
1732
|
+
"src/worlds/describe.ts"() {
|
|
1733
|
+
"use strict";
|
|
1734
|
+
init_worlds();
|
|
1735
|
+
}
|
|
1736
|
+
});
|
|
1737
|
+
|
|
1738
|
+
// src/cli/platform/worldData/json.ts
|
|
1739
|
+
function parseJson(text2) {
|
|
1740
|
+
const p = new Parser(text2);
|
|
1741
|
+
p.skipWs();
|
|
1742
|
+
const value = p.value();
|
|
1743
|
+
p.skipWs();
|
|
1744
|
+
if (p.i < text2.length) throw new JsonSyntaxError(`Extra data at ${p.i}`);
|
|
1745
|
+
return value;
|
|
1746
|
+
}
|
|
1747
|
+
function dumps(value) {
|
|
1748
|
+
if (value === null) return "null";
|
|
1749
|
+
if (value === true) return "true";
|
|
1750
|
+
if (value === false) return "false";
|
|
1751
|
+
if (typeof value === "string") return JSON.stringify(value);
|
|
1752
|
+
if (value instanceof JsonNumber) return numberText(value);
|
|
1753
|
+
if (Array.isArray(value)) return "[" + value.map(dumps).join(",") + "]";
|
|
1754
|
+
const parts = [];
|
|
1755
|
+
for (const [key, item] of value) parts.push(JSON.stringify(key) + ":" + dumps(item));
|
|
1756
|
+
return "{" + parts.join(",") + "}";
|
|
1757
|
+
}
|
|
1758
|
+
function numberText(n) {
|
|
1759
|
+
if (!n.isFloat) return /^-0+$/.test(n.text) ? "0" : n.text;
|
|
1760
|
+
const value = n.value;
|
|
1761
|
+
if (Number.isNaN(value)) return "NaN";
|
|
1762
|
+
if (value === Infinity) return "Infinity";
|
|
1763
|
+
if (value === -Infinity) return "-Infinity";
|
|
1764
|
+
return pyFloatRepr(value);
|
|
1765
|
+
}
|
|
1766
|
+
function pyFloatRepr(x) {
|
|
1767
|
+
if (x === 0) return Object.is(x, -0) ? "-0.0" : "0.0";
|
|
1768
|
+
const sign = x < 0 ? "-" : "";
|
|
1769
|
+
const js = String(Math.abs(x));
|
|
1770
|
+
const [mantissa, exponentPart] = js.split("e");
|
|
1771
|
+
let exponent = exponentPart ? Number(exponentPart) : 0;
|
|
1772
|
+
const [intPart, fracPart = ""] = mantissa.split(".");
|
|
1773
|
+
let digits = intPart + fracPart;
|
|
1774
|
+
let decpt = intPart.length + exponent;
|
|
1775
|
+
const leading = digits.match(/^0*/)[0].length;
|
|
1776
|
+
digits = digits.slice(leading);
|
|
1777
|
+
decpt -= leading;
|
|
1778
|
+
digits = digits.replace(/0+$/, "");
|
|
1779
|
+
if (digits === "") return sign + "0.0";
|
|
1780
|
+
const sci = decpt - 1;
|
|
1781
|
+
if (sci >= -4 && sci < 16) {
|
|
1782
|
+
if (decpt <= 0) return sign + "0." + "0".repeat(-decpt) + digits;
|
|
1783
|
+
if (decpt >= digits.length) return sign + digits + "0".repeat(decpt - digits.length) + ".0";
|
|
1784
|
+
return sign + digits.slice(0, decpt) + "." + digits.slice(decpt);
|
|
1785
|
+
}
|
|
1786
|
+
exponent = sci;
|
|
1787
|
+
const mag = String(Math.abs(exponent)).padStart(2, "0");
|
|
1788
|
+
return sign + digits[0] + (digits.length > 1 ? "." + digits.slice(1) : "") + "e" + (exponent < 0 ? "-" : "+") + mag;
|
|
1789
|
+
}
|
|
1790
|
+
function pyRound(n, ndigits) {
|
|
1791
|
+
if (!n.isFloat) return n;
|
|
1792
|
+
const x = n.value;
|
|
1793
|
+
if (!Number.isFinite(x)) return n;
|
|
1794
|
+
const sign = x < 0 ? -1 : 1;
|
|
1795
|
+
const magnitude = Math.abs(x);
|
|
1796
|
+
if (magnitude >= 9007199254740992) return new JsonNumber(pyFloatRepr(x));
|
|
1797
|
+
const { m, k } = exactFraction(magnitude);
|
|
1798
|
+
let rounded;
|
|
1799
|
+
if (k <= ndigits) rounded = magnitude;
|
|
1800
|
+
else if (k !== ndigits + 1) rounded = Number(magnitude.toFixed(ndigits));
|
|
1801
|
+
else {
|
|
1802
|
+
const scaled = m * 5n ** BigInt(k);
|
|
1803
|
+
let kept = scaled / 10n;
|
|
1804
|
+
if (kept % 2n === 1n) kept += 1n;
|
|
1805
|
+
const text2 = kept.toString().padStart(ndigits + 1, "0");
|
|
1806
|
+
rounded = ndigits === 0 ? Number(text2) : Number(text2.slice(0, -ndigits) + "." + text2.slice(-ndigits));
|
|
1807
|
+
}
|
|
1808
|
+
return new JsonNumber(pyFloatRepr(sign * rounded));
|
|
1809
|
+
}
|
|
1810
|
+
function exactFraction(x) {
|
|
1811
|
+
if (x === 0) return { m: 0n, k: 0 };
|
|
1812
|
+
const view = new DataView(new ArrayBuffer(8));
|
|
1813
|
+
view.setFloat64(0, x);
|
|
1814
|
+
const bits = view.getBigUint64(0);
|
|
1815
|
+
const exponent = Number(bits >> 52n & 0x7ffn);
|
|
1816
|
+
let mantissa = bits & (1n << 52n) - 1n;
|
|
1817
|
+
let e;
|
|
1818
|
+
if (exponent === 0) e = -1074;
|
|
1819
|
+
else {
|
|
1820
|
+
mantissa |= 1n << 52n;
|
|
1821
|
+
e = exponent - 1075;
|
|
1822
|
+
}
|
|
1823
|
+
while (mantissa !== 0n && (mantissa & 1n) === 0n) {
|
|
1824
|
+
mantissa >>= 1n;
|
|
1825
|
+
e += 1;
|
|
1826
|
+
}
|
|
1827
|
+
if (e >= 0) return { m: mantissa << BigInt(e), k: 0 };
|
|
1828
|
+
return { m: mantissa, k: -e };
|
|
1829
|
+
}
|
|
1830
|
+
var JsonNumber, JsonSyntaxError, Parser, isDigit;
|
|
1831
|
+
var init_json = __esm({
|
|
1832
|
+
"src/cli/platform/worldData/json.ts"() {
|
|
1833
|
+
"use strict";
|
|
1834
|
+
JsonNumber = class {
|
|
1835
|
+
/** The lexeme as it appeared, e.g. "1.0", "-0", "1e21". */
|
|
1836
|
+
constructor(text2) {
|
|
1837
|
+
this.text = text2;
|
|
1838
|
+
}
|
|
1839
|
+
/** A float in Python's eyes: a fraction, an exponent, or a non-finite literal. */
|
|
1840
|
+
get isFloat() {
|
|
1841
|
+
return /[.eE]/.test(this.text) || /[nN]/.test(this.text);
|
|
1842
|
+
}
|
|
1843
|
+
get value() {
|
|
1844
|
+
return Number(this.text);
|
|
1845
|
+
}
|
|
1846
|
+
};
|
|
1847
|
+
JsonSyntaxError = class extends Error {
|
|
1848
|
+
};
|
|
1849
|
+
Parser = class {
|
|
1850
|
+
constructor(s) {
|
|
1851
|
+
this.s = s;
|
|
1852
|
+
}
|
|
1853
|
+
i = 0;
|
|
1854
|
+
skipWs() {
|
|
1855
|
+
const s = this.s;
|
|
1856
|
+
while (this.i < s.length) {
|
|
1857
|
+
const c = s.charCodeAt(this.i);
|
|
1858
|
+
if (c === 32 || c === 10 || c === 13 || c === 9) this.i++;
|
|
1859
|
+
else break;
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
fail(what) {
|
|
1863
|
+
throw new JsonSyntaxError(`${what} at ${this.i}`);
|
|
1864
|
+
}
|
|
1865
|
+
value() {
|
|
1866
|
+
const s = this.s;
|
|
1867
|
+
if (this.i >= s.length) this.fail("Expecting value");
|
|
1868
|
+
const c = s[this.i];
|
|
1869
|
+
if (c === "{") return this.object();
|
|
1870
|
+
if (c === "[") return this.array();
|
|
1871
|
+
if (c === '"') return this.string();
|
|
1872
|
+
if (c === "t") return this.literal("true", true);
|
|
1873
|
+
if (c === "f") return this.literal("false", false);
|
|
1874
|
+
if (c === "n") return this.literal("null", null);
|
|
1875
|
+
if (c === "N") return this.literal("NaN", new JsonNumber("NaN"));
|
|
1876
|
+
if (c === "I") return this.literal("Infinity", new JsonNumber("Infinity"));
|
|
1877
|
+
return this.number();
|
|
1878
|
+
}
|
|
1879
|
+
literal(word, value) {
|
|
1880
|
+
if (!this.s.startsWith(word, this.i)) this.fail("Expecting value");
|
|
1881
|
+
this.i += word.length;
|
|
1882
|
+
return value;
|
|
1883
|
+
}
|
|
1884
|
+
number() {
|
|
1885
|
+
const s = this.s;
|
|
1886
|
+
const start = this.i;
|
|
1887
|
+
if (s[this.i] === "-") {
|
|
1888
|
+
this.i++;
|
|
1889
|
+
if (s.startsWith("Infinity", this.i)) {
|
|
1890
|
+
this.i += 8;
|
|
1891
|
+
return new JsonNumber("-Infinity");
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
const intStart = this.i;
|
|
1895
|
+
if (s[this.i] === "0") this.i++;
|
|
1896
|
+
else {
|
|
1897
|
+
while (this.i < s.length && isDigit(s.charCodeAt(this.i))) this.i++;
|
|
1898
|
+
if (this.i === intStart) this.fail("Expecting value");
|
|
1899
|
+
}
|
|
1900
|
+
if (s[this.i] === ".") {
|
|
1901
|
+
this.i++;
|
|
1902
|
+
const fracStart = this.i;
|
|
1903
|
+
while (this.i < s.length && isDigit(s.charCodeAt(this.i))) this.i++;
|
|
1904
|
+
if (this.i === fracStart) this.fail("Invalid number");
|
|
1905
|
+
}
|
|
1906
|
+
if (s[this.i] === "e" || s[this.i] === "E") {
|
|
1907
|
+
this.i++;
|
|
1908
|
+
if (s[this.i] === "+" || s[this.i] === "-") this.i++;
|
|
1909
|
+
const expStart = this.i;
|
|
1910
|
+
while (this.i < s.length && isDigit(s.charCodeAt(this.i))) this.i++;
|
|
1911
|
+
if (this.i === expStart) this.fail("Invalid number");
|
|
1912
|
+
}
|
|
1913
|
+
return new JsonNumber(s.slice(start, this.i));
|
|
1914
|
+
}
|
|
1915
|
+
string() {
|
|
1916
|
+
const s = this.s;
|
|
1917
|
+
this.i++;
|
|
1918
|
+
let out = "";
|
|
1919
|
+
let runStart = this.i;
|
|
1920
|
+
for (; ; ) {
|
|
1921
|
+
if (this.i >= s.length) this.fail("Unterminated string");
|
|
1922
|
+
const c = s.charCodeAt(this.i);
|
|
1923
|
+
if (c === 34) {
|
|
1924
|
+
out += s.slice(runStart, this.i);
|
|
1925
|
+
this.i++;
|
|
1926
|
+
return out;
|
|
1927
|
+
}
|
|
1928
|
+
if (c < 32) this.fail("Invalid control character");
|
|
1929
|
+
if (c !== 92) {
|
|
1930
|
+
this.i++;
|
|
1931
|
+
continue;
|
|
1932
|
+
}
|
|
1933
|
+
out += s.slice(runStart, this.i);
|
|
1934
|
+
this.i++;
|
|
1935
|
+
const e = s[this.i];
|
|
1936
|
+
switch (e) {
|
|
1937
|
+
case '"':
|
|
1938
|
+
case "\\":
|
|
1939
|
+
case "/":
|
|
1940
|
+
out += e;
|
|
1941
|
+
break;
|
|
1942
|
+
case "b":
|
|
1943
|
+
out += "\b";
|
|
1944
|
+
break;
|
|
1945
|
+
case "f":
|
|
1946
|
+
out += "\f";
|
|
1947
|
+
break;
|
|
1948
|
+
case "n":
|
|
1949
|
+
out += "\n";
|
|
1950
|
+
break;
|
|
1951
|
+
case "r":
|
|
1952
|
+
out += "\r";
|
|
1953
|
+
break;
|
|
1954
|
+
case "t":
|
|
1955
|
+
out += " ";
|
|
1956
|
+
break;
|
|
1957
|
+
case "u": {
|
|
1958
|
+
const hex2 = s.slice(this.i + 1, this.i + 5);
|
|
1959
|
+
if (!/^[0-9a-fA-F]{4}$/.test(hex2)) this.fail("Invalid \\u escape");
|
|
1960
|
+
out += String.fromCharCode(parseInt(hex2, 16));
|
|
1961
|
+
this.i += 4;
|
|
1962
|
+
break;
|
|
1963
|
+
}
|
|
1964
|
+
default:
|
|
1965
|
+
this.fail("Invalid escape");
|
|
1966
|
+
}
|
|
1967
|
+
this.i++;
|
|
1968
|
+
runStart = this.i;
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
array() {
|
|
1972
|
+
this.i++;
|
|
1973
|
+
const out = [];
|
|
1974
|
+
this.skipWs();
|
|
1975
|
+
if (this.s[this.i] === "]") {
|
|
1976
|
+
this.i++;
|
|
1977
|
+
return out;
|
|
1978
|
+
}
|
|
1979
|
+
for (; ; ) {
|
|
1980
|
+
this.skipWs();
|
|
1981
|
+
out.push(this.value());
|
|
1982
|
+
this.skipWs();
|
|
1983
|
+
const c = this.s[this.i];
|
|
1984
|
+
if (c === ",") {
|
|
1985
|
+
this.i++;
|
|
1986
|
+
continue;
|
|
1987
|
+
}
|
|
1988
|
+
if (c === "]") {
|
|
1989
|
+
this.i++;
|
|
1990
|
+
return out;
|
|
1991
|
+
}
|
|
1992
|
+
this.fail("Expecting ',' delimiter");
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
object() {
|
|
1996
|
+
this.i++;
|
|
1997
|
+
const out = /* @__PURE__ */ new Map();
|
|
1998
|
+
this.skipWs();
|
|
1999
|
+
if (this.s[this.i] === "}") {
|
|
2000
|
+
this.i++;
|
|
2001
|
+
return out;
|
|
2002
|
+
}
|
|
2003
|
+
for (; ; ) {
|
|
2004
|
+
this.skipWs();
|
|
2005
|
+
if (this.s[this.i] !== '"') this.fail("Expecting property name enclosed in double quotes");
|
|
2006
|
+
const key = this.string();
|
|
2007
|
+
this.skipWs();
|
|
2008
|
+
if (this.s[this.i] !== ":") this.fail("Expecting ':' delimiter");
|
|
2009
|
+
this.i++;
|
|
2010
|
+
this.skipWs();
|
|
2011
|
+
out.set(key, this.value());
|
|
2012
|
+
this.skipWs();
|
|
2013
|
+
const c = this.s[this.i];
|
|
2014
|
+
if (c === ",") {
|
|
2015
|
+
this.i++;
|
|
2016
|
+
continue;
|
|
2017
|
+
}
|
|
2018
|
+
if (c === "}") {
|
|
2019
|
+
this.i++;
|
|
2020
|
+
return out;
|
|
2021
|
+
}
|
|
2022
|
+
this.fail("Expecting ',' delimiter");
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
};
|
|
2026
|
+
isDigit = (c) => c >= 48 && c <= 57;
|
|
2027
|
+
}
|
|
2028
|
+
});
|
|
2029
|
+
|
|
2030
|
+
// src/worlds/transforms.ts
|
|
2031
|
+
import { createHash as createHash3 } from "crypto";
|
|
2032
|
+
function parseTransform(name) {
|
|
2033
|
+
const simple = Object.prototype.hasOwnProperty.call(SIMPLE, name) ? SIMPLE[name] : void 0;
|
|
2034
|
+
if (simple) return simple;
|
|
2035
|
+
const colon = name.indexOf(":");
|
|
2036
|
+
if (colon !== -1) {
|
|
2037
|
+
const head = name.slice(0, colon);
|
|
2038
|
+
const prefix = name.slice(colon + 1);
|
|
2039
|
+
if (head === STRIP_PREFIX && prefix && !prefix.includes(",")) return stripPrefix(prefix);
|
|
2040
|
+
}
|
|
2041
|
+
throw new Error(`Unknown transform '${name}'; choose one of ${TRANSFORMS.join(", ")}`);
|
|
2042
|
+
}
|
|
2043
|
+
function applyTransforms(value, chain) {
|
|
2044
|
+
const steps = chain.map(parseTransform);
|
|
2045
|
+
let out = text(value);
|
|
2046
|
+
for (const step of steps) out = step(out);
|
|
2047
|
+
return out;
|
|
2048
|
+
}
|
|
2049
|
+
var WHITESPACE, WHITESPACE_EDGES, WHITESPACE_RUN, NOT_DIGIT, STRIP_PREFIX, trim, emailLocalPart, emailDomain, stripPrefix, hex, SIMPLE, TRANSFORMS, text;
|
|
2050
|
+
var init_transforms = __esm({
|
|
2051
|
+
"src/worlds/transforms.ts"() {
|
|
2052
|
+
"use strict";
|
|
2053
|
+
init_json();
|
|
2054
|
+
WHITESPACE = " \n\r\f\v";
|
|
2055
|
+
WHITESPACE_EDGES = /^[ \t\n\r\f\v]+|[ \t\n\r\f\v]+$/g;
|
|
2056
|
+
WHITESPACE_RUN = /[ \t\n\r\f\v]+/g;
|
|
2057
|
+
NOT_DIGIT = /[^0-9]/g;
|
|
2058
|
+
STRIP_PREFIX = "strip_prefix";
|
|
2059
|
+
trim = (value) => value.replace(WHITESPACE_EDGES, "");
|
|
2060
|
+
emailLocalPart = (value) => {
|
|
2061
|
+
const at = value.lastIndexOf("@");
|
|
2062
|
+
return at === -1 ? value : value.slice(0, at);
|
|
2063
|
+
};
|
|
2064
|
+
emailDomain = (value) => {
|
|
2065
|
+
const at = value.lastIndexOf("@");
|
|
2066
|
+
return at === -1 ? "" : value.slice(at + 1).toLowerCase();
|
|
2067
|
+
};
|
|
2068
|
+
stripPrefix = (prefix) => (value) => value.startsWith(prefix) ? value.slice(prefix.length) : value;
|
|
2069
|
+
hex = (algorithm, value) => createHash3(algorithm).update(value, "utf8").digest("hex");
|
|
2070
|
+
SIMPLE = {
|
|
2071
|
+
lower: (value) => value.toLowerCase(),
|
|
2072
|
+
upper: (value) => value.toUpperCase(),
|
|
2073
|
+
trim,
|
|
2074
|
+
collapse_ws: (value) => trim(value).replace(WHITESPACE_RUN, " "),
|
|
2075
|
+
nfkc: (value) => value.normalize("NFKC"),
|
|
2076
|
+
digits: (value) => value.replace(NOT_DIGIT, ""),
|
|
2077
|
+
email_local_part: emailLocalPart,
|
|
2078
|
+
email_domain: emailDomain,
|
|
2079
|
+
// Vendor-style digests: lowercase hex of the utf-8 bytes, unsalted. This is
|
|
2080
|
+
// how SpyCloud accepts a hashed selector (`_digests` in its api_handlers).
|
|
2081
|
+
sha1: (value) => hex("sha1", value),
|
|
2082
|
+
sha256: (value) => hex("sha256", value)
|
|
2083
|
+
};
|
|
2084
|
+
TRANSFORMS = [...Object.keys(SIMPLE), `${STRIP_PREFIX}:<prefix>`];
|
|
2085
|
+
text = (value) => {
|
|
2086
|
+
if (typeof value === "string") return value;
|
|
2087
|
+
return Number.isInteger(value) ? String(value) : pyFloatRepr(value);
|
|
2088
|
+
};
|
|
2089
|
+
}
|
|
2090
|
+
});
|
|
2091
|
+
|
|
2092
|
+
// src/worlds/redaction.ts
|
|
2093
|
+
import { createHash as createHash4 } from "crypto";
|
|
2094
|
+
function pyText(value) {
|
|
2095
|
+
if (typeof value === "string") return value;
|
|
2096
|
+
if (Number.isInteger(value)) return String(value);
|
|
2097
|
+
if (Number.isNaN(value)) return "nan";
|
|
2098
|
+
if (!Number.isFinite(value)) return value > 0 ? "inf" : "-inf";
|
|
2099
|
+
return pyFloatRepr(value);
|
|
2100
|
+
}
|
|
2101
|
+
function hashForm(slug, plaintext) {
|
|
2102
|
+
return "sha256:" + createHash4("sha256").update(`${slug}:${pyText(plaintext)}`, "utf8").digest("hex");
|
|
2103
|
+
}
|
|
2104
|
+
function preserveForm(slug, plaintext) {
|
|
2105
|
+
const kind = typeof plaintext === "string" ? "str" : isInt(plaintext) ? "int" : "float";
|
|
2106
|
+
const shaped = shapeText(slug, pyText(plaintext), kind);
|
|
2107
|
+
return kind === "str" ? shaped : Number(shaped);
|
|
2108
|
+
}
|
|
2109
|
+
function shapeText(slug, text2, kind) {
|
|
2110
|
+
const seed = Buffer.from(`${slug}:${text2}`, "utf8");
|
|
2111
|
+
let digest = createHash4("sha256").update(seed).digest();
|
|
2112
|
+
let cursor = 0;
|
|
2113
|
+
const out = [];
|
|
2114
|
+
for (const char of text2) {
|
|
2115
|
+
if (cursor === digest.length) {
|
|
2116
|
+
digest = createHash4("sha256").update(Buffer.concat([digest, seed])).digest();
|
|
2117
|
+
cursor = 0;
|
|
2118
|
+
}
|
|
2119
|
+
const byte = digest[cursor];
|
|
2120
|
+
cursor += 1;
|
|
2121
|
+
if (char >= "0" && char <= "9") out.push(String(byte % 10));
|
|
2122
|
+
else if (kind === "str" && char >= "a" && char <= "z") out.push(String.fromCharCode(97 + byte % 26));
|
|
2123
|
+
else if (kind === "str" && char >= "A" && char <= "Z") out.push(String.fromCharCode(65 + byte % 26));
|
|
2124
|
+
else out.push(char);
|
|
2125
|
+
}
|
|
2126
|
+
if (kind === "int" && out.length > 1 && out[0] === "0") out[0] = String(1 + digest[0] % 9);
|
|
2127
|
+
return out.join("");
|
|
2128
|
+
}
|
|
2129
|
+
function roundForm(plaintext, decimals) {
|
|
2130
|
+
if (typeof plaintext === "string" || isInt(plaintext) || !Number.isFinite(plaintext)) return plaintext;
|
|
2131
|
+
return pyRound(new JsonNumber(pyFloatRepr(plaintext)), decimals).value;
|
|
2132
|
+
}
|
|
2133
|
+
function redactionOf(redact, field) {
|
|
2134
|
+
if (!redact) return null;
|
|
2135
|
+
const named = (names) => (names ?? []).some((name) => name === field || name.slice(name.lastIndexOf(".") + 1) === field);
|
|
2136
|
+
if (named(redact.drop)) return "drop";
|
|
2137
|
+
if (named(redact.hash)) return "hash";
|
|
2138
|
+
if (named(redact.preserve)) return "preserve";
|
|
2139
|
+
const decimals = redact.round?.[field];
|
|
2140
|
+
if (typeof decimals === "number") return `round:${decimals}`;
|
|
2141
|
+
return null;
|
|
2142
|
+
}
|
|
2143
|
+
function storedForms(world, field, plaintext, transform) {
|
|
2144
|
+
if (transform?.length) plaintext = applyTransforms(plaintext, transform);
|
|
2145
|
+
const policy = redactionOf(world.redact, field);
|
|
2146
|
+
const salt = world.redact?.slug ?? world.slug;
|
|
2147
|
+
if (policy === "drop") return [];
|
|
2148
|
+
if (policy === "hash") return [hashForm(salt, plaintext)];
|
|
2149
|
+
if (policy === "preserve") return [preserveForm(salt, plaintext)];
|
|
2150
|
+
if (policy !== null) return [roundForm(plaintext, world.redact.round[field])];
|
|
2151
|
+
return [plaintext];
|
|
2152
|
+
}
|
|
2153
|
+
var isInt;
|
|
2154
|
+
var init_redaction = __esm({
|
|
2155
|
+
"src/worlds/redaction.ts"() {
|
|
2156
|
+
"use strict";
|
|
2157
|
+
init_json();
|
|
2158
|
+
init_transforms();
|
|
2159
|
+
isInt = (value) => typeof value === "number" && Number.isInteger(value);
|
|
2160
|
+
}
|
|
2161
|
+
});
|
|
2162
|
+
|
|
2163
|
+
// src/worlds/query.ts
|
|
2164
|
+
function queryRowsSearch(entity, opts = {}) {
|
|
2165
|
+
const search = new URLSearchParams();
|
|
2166
|
+
search.set("entity", entity);
|
|
2167
|
+
if (opts.where && Object.keys(opts.where).length) search.set("where", JSON.stringify(opts.where));
|
|
2168
|
+
if (opts.limit !== void 0) search.set("limit", String(opts.limit));
|
|
2169
|
+
if (opts.offset !== void 0) search.set("offset", String(opts.offset));
|
|
2170
|
+
if (opts.resolve) search.set("resolve", "true");
|
|
2171
|
+
if (opts.across) search.set("across", "true");
|
|
2172
|
+
if (opts.compare) search.set("compare", "true");
|
|
2173
|
+
return `?${search.toString()}`;
|
|
2174
|
+
}
|
|
2175
|
+
async function queryRows(slug, entity, opts = {}, options = {}) {
|
|
2176
|
+
if (slug.includes("@"))
|
|
2177
|
+
throw new Error(
|
|
2178
|
+
`queryRows reads a world's head version: pass the slug without @ref (got ${slug})`
|
|
2179
|
+
);
|
|
2180
|
+
if (!entity) throw new Error("queryRows needs an entity");
|
|
2181
|
+
if (opts.compare && !opts.across) throw new Error("queryRows: compare needs across");
|
|
2182
|
+
return apiRequest(
|
|
2183
|
+
options,
|
|
2184
|
+
"GET",
|
|
2185
|
+
`/api/public/worlds/${encodeURIComponent(slug)}/data${queryRowsSearch(entity, opts)}`
|
|
2186
|
+
);
|
|
2187
|
+
}
|
|
2188
|
+
var init_query = __esm({
|
|
2189
|
+
"src/worlds/query.ts"() {
|
|
2190
|
+
"use strict";
|
|
2191
|
+
init_worlds();
|
|
2192
|
+
}
|
|
2193
|
+
});
|
|
2194
|
+
|
|
2195
|
+
// src/worlds/migrate.ts
|
|
2196
|
+
async function migrateWorld(slug, input = {}, options = {}) {
|
|
2197
|
+
if (slug.includes("@"))
|
|
2198
|
+
throw new Error(
|
|
2199
|
+
`migrateWorld converts a world's head version: pass the slug without @ref (got ${slug})`
|
|
2200
|
+
);
|
|
2201
|
+
return apiRequest(
|
|
2202
|
+
options,
|
|
2203
|
+
"POST",
|
|
2204
|
+
`/api/public/worlds/${encodeURIComponent(slug)}/migrate`,
|
|
2205
|
+
{
|
|
2206
|
+
...input.apply === void 0 ? {} : { apply: input.apply },
|
|
2207
|
+
...input.force === void 0 ? {} : { force: input.force }
|
|
2208
|
+
}
|
|
2209
|
+
);
|
|
2210
|
+
}
|
|
2211
|
+
async function migrateProjectWorlds(input = {}, options = {}) {
|
|
2212
|
+
return apiRequest(
|
|
2213
|
+
options,
|
|
2214
|
+
"POST",
|
|
2215
|
+
"/api/public/worlds/migrate",
|
|
2216
|
+
input.apply === void 0 ? {} : { apply: input.apply }
|
|
2217
|
+
);
|
|
2218
|
+
}
|
|
2219
|
+
var init_migrate = __esm({
|
|
2220
|
+
"src/worlds/migrate.ts"() {
|
|
2221
|
+
"use strict";
|
|
2222
|
+
init_worlds();
|
|
2223
|
+
}
|
|
2224
|
+
});
|
|
2225
|
+
|
|
2226
|
+
// src/cli/router.ts
|
|
2227
|
+
var CliError;
|
|
2228
|
+
var init_router = __esm({
|
|
2229
|
+
"src/cli/router.ts"() {
|
|
2230
|
+
"use strict";
|
|
2231
|
+
CliError = class extends Error {
|
|
2232
|
+
constructor(message, exitCode = 2) {
|
|
2233
|
+
super(message);
|
|
2234
|
+
this.exitCode = exitCode;
|
|
2235
|
+
}
|
|
2236
|
+
};
|
|
2237
|
+
}
|
|
2238
|
+
});
|
|
2239
|
+
|
|
2240
|
+
// src/cli/config.ts
|
|
2241
|
+
import * as fs2 from "fs";
|
|
2242
|
+
import * as os from "os";
|
|
2243
|
+
import * as path2 from "path";
|
|
2244
|
+
async function api(creds, method, route, body, init3 = {}) {
|
|
2245
|
+
const controller = new AbortController();
|
|
2246
|
+
const timer = setTimeout(() => controller.abort(), init3.timeoutMs ?? 12e4);
|
|
2247
|
+
try {
|
|
2248
|
+
const res = await fetch(`${creds.host}${route}`, {
|
|
2249
|
+
method,
|
|
2250
|
+
headers: {
|
|
2251
|
+
"content-type": "application/json",
|
|
2252
|
+
accept: "application/json",
|
|
2253
|
+
authorization: "Basic " + Buffer.from(`${creds.publicKey}:${creds.secretKey}`).toString("base64")
|
|
2254
|
+
},
|
|
2255
|
+
...body === void 0 ? {} : { body: JSON.stringify(body) },
|
|
2256
|
+
signal: controller.signal
|
|
2257
|
+
});
|
|
2258
|
+
const text2 = await res.text();
|
|
2259
|
+
if (!res.ok) throw new ApiError(res.status, method, route, text2);
|
|
2260
|
+
return text2 ? JSON.parse(text2) : {};
|
|
2261
|
+
} finally {
|
|
2262
|
+
clearTimeout(timer);
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
var ApiError;
|
|
2266
|
+
var init_config = __esm({
|
|
2267
|
+
"src/cli/config.ts"() {
|
|
2268
|
+
"use strict";
|
|
2269
|
+
init_router();
|
|
2270
|
+
ApiError = class extends CliError {
|
|
2271
|
+
constructor(status, method, route, text2) {
|
|
2272
|
+
super(`${method} ${route} -> ${status}: ${text2.slice(0, 600)}`, 1);
|
|
2273
|
+
this.status = status;
|
|
2274
|
+
this.method = method;
|
|
2275
|
+
this.route = route;
|
|
2276
|
+
this.text = text2;
|
|
2277
|
+
}
|
|
2278
|
+
};
|
|
2279
|
+
}
|
|
2280
|
+
});
|
|
2281
|
+
|
|
2282
|
+
// src/cli/runtime/local.ts
|
|
2283
|
+
import { spawn, spawnSync } from "child_process";
|
|
2284
|
+
import * as fs3 from "fs";
|
|
2285
|
+
import * as net from "net";
|
|
2286
|
+
import * as path3 from "path";
|
|
2287
|
+
function tailOf(output) {
|
|
2288
|
+
return output.length > DIAGNOSTIC_TAIL ? `\u2026${output.slice(-DIAGNOSTIC_TAIL)}` : output;
|
|
2289
|
+
}
|
|
2290
|
+
function runtimeMode() {
|
|
2291
|
+
const raw = (process.env.GATEWAY_RUNTIME ?? "auto").toLowerCase();
|
|
2292
|
+
if (raw === "local" || raw === "platform" || raw === "auto") return raw;
|
|
2293
|
+
throw new CliError(
|
|
2294
|
+
`GATEWAY_RUNTIME must be local, platform or auto (got ${raw})`
|
|
2295
|
+
);
|
|
2296
|
+
}
|
|
2297
|
+
function runtimeRoot() {
|
|
2298
|
+
const candidates = [];
|
|
2299
|
+
if (process.env.GATEWAY_RUNTIME_PATH)
|
|
2300
|
+
candidates.push(process.env.GATEWAY_RUNTIME_PATH);
|
|
2301
|
+
const entry = process.argv[1] && fs3.existsSync(process.argv[1]) ? path3.dirname(fs3.realpathSync(process.argv[1])) : null;
|
|
2302
|
+
if (entry) {
|
|
2303
|
+
candidates.push(path3.resolve(entry, "..", "runtime"));
|
|
2304
|
+
candidates.push(path3.resolve(entry, "..", "..", "runtime"));
|
|
2305
|
+
candidates.push(path3.resolve(entry, "..", "..", "sdk", "src"));
|
|
2306
|
+
}
|
|
2307
|
+
candidates.push(path3.resolve(process.cwd(), "runtime"));
|
|
2308
|
+
for (const root of candidates)
|
|
2309
|
+
if (fs3.existsSync(
|
|
2310
|
+
path3.join(root, "gatewaysdk", "environment", "schema", "platform.py")
|
|
2311
|
+
))
|
|
2312
|
+
return root;
|
|
2313
|
+
return null;
|
|
2314
|
+
}
|
|
2315
|
+
function probeVersion(name) {
|
|
2316
|
+
const probe = spawnSync(
|
|
2317
|
+
name,
|
|
2318
|
+
["-c", "import sys;print(sys.version_info[0],sys.version_info[1])"],
|
|
2319
|
+
{ encoding: "utf8", timeout: 1e4 }
|
|
2320
|
+
);
|
|
2321
|
+
if (probe.status !== 0) return null;
|
|
2322
|
+
const [major, minor] = probe.stdout.trim().split(/\s+/).map(Number);
|
|
2323
|
+
return Number.isInteger(major) && Number.isInteger(minor) ? `${major}.${minor}` : null;
|
|
2324
|
+
}
|
|
2325
|
+
function atLeastMinimum(version) {
|
|
2326
|
+
const [major, minor] = version.split(".").map(Number);
|
|
2327
|
+
return major > MIN_PYTHON[0] || major === MIN_PYTHON[0] && minor >= MIN_PYTHON[1];
|
|
2328
|
+
}
|
|
2329
|
+
function uvPython() {
|
|
2330
|
+
const found = spawnSync("uv", UV_FIND, { encoding: "utf8", timeout: 1e4 });
|
|
2331
|
+
if (found.status !== 0) return null;
|
|
2332
|
+
const line = found.stdout.trim().split(/\r?\n/)[0] ?? "";
|
|
2333
|
+
return line || null;
|
|
2334
|
+
}
|
|
2335
|
+
function findPython() {
|
|
2336
|
+
if (pythonCache !== void 0) return pythonCache;
|
|
2337
|
+
const named = process.env.GATEWAY_PYTHON;
|
|
2338
|
+
const candidates = named ? [named] : PYTHON_CANDIDATES;
|
|
2339
|
+
for (const name of candidates) {
|
|
2340
|
+
const version = probeVersion(name);
|
|
2341
|
+
pythonProbes.push({ name, version });
|
|
2342
|
+
if (version && atLeastMinimum(version)) {
|
|
2343
|
+
pythonCache = name;
|
|
2344
|
+
return name;
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
if (!named) {
|
|
2348
|
+
const fromUv = uvPython();
|
|
2349
|
+
const version = fromUv ? probeVersion(fromUv) : null;
|
|
2350
|
+
pythonProbes.push({ name: fromUv ?? "uv python find", version });
|
|
2351
|
+
if (fromUv && version && atLeastMinimum(version)) {
|
|
2352
|
+
pythonCache = fromUv;
|
|
2353
|
+
return fromUv;
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
pythonCache = null;
|
|
2357
|
+
return null;
|
|
2358
|
+
}
|
|
2359
|
+
function pythonAdvice() {
|
|
2360
|
+
findPython();
|
|
2361
|
+
const floor = MIN_PYTHON.join(".");
|
|
2362
|
+
const named = process.env.GATEWAY_PYTHON;
|
|
2363
|
+
const seen = pythonProbes.filter((probe) => probe.version).map((probe) => `${probe.name} is ${probe.version}`);
|
|
2364
|
+
const found = seen.length ? seen.join(", ") : named ? `${named} did not run` : "none on PATH";
|
|
2365
|
+
return `No python3 >= ${floor} usable (${found}); set GATEWAY_PYTHON to a newer interpreter, e.g. GATEWAY_PYTHON="$(brew --prefix python@3.12)/bin/python3.12" or GATEWAY_PYTHON="$(uv python find 3.12)".`;
|
|
2366
|
+
}
|
|
2367
|
+
function localRuntimeReason() {
|
|
2368
|
+
if (runtimeMode() === "platform")
|
|
2369
|
+
return "GATEWAY_RUNTIME=platform forces the hosted side.";
|
|
2370
|
+
if (!findPython()) return pythonAdvice();
|
|
2371
|
+
if (!runtimeRoot())
|
|
2372
|
+
return "The bundled runtime is missing (set GATEWAY_RUNTIME_PATH).";
|
|
2373
|
+
return "";
|
|
2374
|
+
}
|
|
2375
|
+
function localRuntime() {
|
|
2376
|
+
if (runtimeMode() === "platform") return null;
|
|
2377
|
+
const python = findPython();
|
|
2378
|
+
const root = runtimeRoot();
|
|
2379
|
+
if (!python || !root) {
|
|
2380
|
+
if (runtimeMode() === "local")
|
|
2381
|
+
throw new CliError(
|
|
2382
|
+
!python ? `GATEWAY_RUNTIME=local but ${pythonAdvice()}` : "GATEWAY_RUNTIME=local but the bundled runtime is missing (set GATEWAY_RUNTIME_PATH)"
|
|
2383
|
+
);
|
|
2384
|
+
return null;
|
|
2385
|
+
}
|
|
2386
|
+
return { python, root };
|
|
2387
|
+
}
|
|
2388
|
+
function localPythonHasYaml(python) {
|
|
2389
|
+
return spawnSync(python, ["-c", "import yaml"], { timeout: 1e4 }).status === 0;
|
|
2390
|
+
}
|
|
2391
|
+
async function localBridge(request, local, opts = {}) {
|
|
2392
|
+
const input = JSON.stringify(request);
|
|
2393
|
+
return await new Promise((resolve7, reject) => {
|
|
2394
|
+
const child = spawn(
|
|
2395
|
+
local.python,
|
|
2396
|
+
["-I", "-B", "-c", BRIDGE_BOOTSTRAP, local.root],
|
|
2397
|
+
{
|
|
2398
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
2399
|
+
// This is the author's machine running the author's world: the one
|
|
2400
|
+
// place the runtime may import and run a world's own Python (check's
|
|
2401
|
+
// handler execution, `worlds call`, `worlds test` tool cases).
|
|
2402
|
+
env: {
|
|
2403
|
+
PATH: process.env.PATH ?? "",
|
|
2404
|
+
HOME: process.env.HOME ?? "",
|
|
2405
|
+
TMPDIR: process.env.TMPDIR ?? "",
|
|
2406
|
+
GATEWAY_RUNTIME_EXECUTE: "1"
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
);
|
|
2410
|
+
const out = [];
|
|
2411
|
+
const err = [];
|
|
2412
|
+
const timer = setTimeout(
|
|
2413
|
+
() => child.kill("SIGKILL"),
|
|
2414
|
+
opts.timeoutMs ?? 3e5
|
|
2415
|
+
);
|
|
2416
|
+
child.stdout.on("data", (chunk) => out.push(chunk));
|
|
2417
|
+
child.stderr.on("data", (chunk) => err.push(chunk));
|
|
2418
|
+
child.on("error", (error) => {
|
|
2419
|
+
clearTimeout(timer);
|
|
2420
|
+
reject(
|
|
2421
|
+
new CliError(
|
|
2422
|
+
`local runtime could not start (${local.python}): ${error.message}`,
|
|
2423
|
+
1
|
|
2424
|
+
)
|
|
2425
|
+
);
|
|
2426
|
+
});
|
|
2427
|
+
child.on("close", (code) => {
|
|
2428
|
+
clearTimeout(timer);
|
|
2429
|
+
const text2 = Buffer.concat(out).toString("utf8");
|
|
2430
|
+
const stderr = Buffer.concat(err).toString("utf8");
|
|
2431
|
+
let payload = null;
|
|
2432
|
+
try {
|
|
2433
|
+
payload = text2 ? JSON.parse(text2) : null;
|
|
2434
|
+
} catch {
|
|
2435
|
+
payload = null;
|
|
2436
|
+
}
|
|
2437
|
+
if (payload && typeof payload === "object") {
|
|
2438
|
+
resolve7(payload);
|
|
2439
|
+
return;
|
|
2440
|
+
}
|
|
2441
|
+
reject(
|
|
2442
|
+
new CliError(
|
|
2443
|
+
`local runtime (${request.command}) exited ${code}: ${tailOf((stderr || text2).trim()) || "no output"}`,
|
|
2444
|
+
1
|
|
2445
|
+
)
|
|
2446
|
+
);
|
|
2447
|
+
});
|
|
2448
|
+
child.stdin.end(input);
|
|
2449
|
+
});
|
|
2450
|
+
}
|
|
2451
|
+
var MIN_PYTHON, DIAGNOSTIC_TAIL, BRIDGE_BOOTSTRAP, pythonCache, pythonProbes, PYTHON_CANDIDATES, UV_FIND;
|
|
2452
|
+
var init_local = __esm({
|
|
2453
|
+
"src/cli/runtime/local.ts"() {
|
|
2454
|
+
"use strict";
|
|
2455
|
+
init_router();
|
|
2456
|
+
init_config();
|
|
2457
|
+
MIN_PYTHON = [3, 11];
|
|
2458
|
+
DIAGNOSTIC_TAIL = 600;
|
|
2459
|
+
BRIDGE_BOOTSTRAP = `import sys,runpy,types,os
|
|
2460
|
+
root=sys.argv[1]
|
|
2461
|
+
package=types.ModuleType('gatewaysdk')
|
|
2462
|
+
package.__path__=[os.path.join(root,'gatewaysdk')]
|
|
2463
|
+
sys.modules['gatewaysdk']=package
|
|
2464
|
+
runpy.run_module('gatewaysdk.environment.schema.platform',run_name='__main__')`;
|
|
2465
|
+
pythonProbes = [];
|
|
2466
|
+
PYTHON_CANDIDATES = [
|
|
2467
|
+
"python3.13",
|
|
2468
|
+
"python3.12",
|
|
2469
|
+
"python3.11",
|
|
2470
|
+
"python3",
|
|
2471
|
+
"python"
|
|
2472
|
+
];
|
|
2473
|
+
UV_FIND = ["python", "find", `>=${MIN_PYTHON.join(".")}`];
|
|
2474
|
+
}
|
|
2475
|
+
});
|
|
2476
|
+
|
|
2477
|
+
// src/cli/runtime/client.ts
|
|
2478
|
+
import * as fs4 from "fs";
|
|
2479
|
+
import * as path4 from "path";
|
|
2480
|
+
function isBuildOutput(relPath) {
|
|
2481
|
+
return BUILD_OUTPUT.test(relPath);
|
|
2482
|
+
}
|
|
2483
|
+
function readWorldFiles(dir, opts = {}) {
|
|
2484
|
+
if (!fs4.existsSync(dir) || !fs4.statSync(dir).isDirectory())
|
|
2485
|
+
throw new CliError(`Not a directory: ${dir}`);
|
|
2486
|
+
const out = [];
|
|
2487
|
+
const walk = (rel) => {
|
|
2488
|
+
const abs = rel ? path4.join(dir, rel) : dir;
|
|
2489
|
+
const entries = fs4.readdirSync(abs, { withFileTypes: true });
|
|
2490
|
+
entries.sort((a, b) => a.name.localeCompare(b.name));
|
|
2491
|
+
for (const entry of entries) {
|
|
2492
|
+
const childRel = rel ? `${rel}/${entry.name}` : entry.name;
|
|
2493
|
+
if (entry.isDirectory()) {
|
|
2494
|
+
if (!SKIP_DIRS2.has(entry.name)) walk(childRel);
|
|
2495
|
+
} else if (entry.isFile()) {
|
|
2496
|
+
if (!opts.buildOutputs && isBuildOutput(childRel)) continue;
|
|
2497
|
+
out.push({
|
|
2498
|
+
path: childRel,
|
|
2499
|
+
content: fs4.readFileSync(path4.join(dir, childRel)).toString("base64")
|
|
2500
|
+
});
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
};
|
|
2504
|
+
walk("");
|
|
2505
|
+
return out.sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
|
|
2506
|
+
}
|
|
2507
|
+
function assertSafeRelPath(rel) {
|
|
2508
|
+
const parts = rel.split("/");
|
|
2509
|
+
if (!rel || rel.startsWith("/") || rel.includes("\\") || /^[A-Za-z]:/.test(rel) || parts.some((p) => p === "" || p === "." || p === ".."))
|
|
2510
|
+
throw new CliError(`The runtime returned an unsafe file path: ${rel}`, 1);
|
|
2511
|
+
}
|
|
2512
|
+
function writeWorldFiles(dir, files, opts = {}) {
|
|
2513
|
+
for (const file of files) assertSafeRelPath(file.path);
|
|
2514
|
+
if (opts.clean && fs4.existsSync(dir)) {
|
|
2515
|
+
const keep = new Set(files.map((f) => f.path));
|
|
2516
|
+
for (const existing of readWorldFiles(dir)) {
|
|
2517
|
+
if (!keep.has(existing.path)) fs4.rmSync(path4.join(dir, existing.path));
|
|
2518
|
+
}
|
|
2519
|
+
pruneEmptyDirs(dir);
|
|
2520
|
+
}
|
|
2521
|
+
fs4.mkdirSync(dir, { recursive: true });
|
|
2522
|
+
const written = [];
|
|
2523
|
+
for (const file of files) {
|
|
2524
|
+
const target = path4.join(dir, file.path);
|
|
2525
|
+
fs4.mkdirSync(path4.dirname(target), { recursive: true });
|
|
2526
|
+
fs4.writeFileSync(target, Buffer.from(file.content, "base64"));
|
|
2527
|
+
written.push(file.path);
|
|
2528
|
+
}
|
|
2529
|
+
return written;
|
|
2530
|
+
}
|
|
2531
|
+
function pruneEmptyDirs(root) {
|
|
2532
|
+
const walk = (abs) => {
|
|
2533
|
+
let empty = true;
|
|
2534
|
+
for (const entry of fs4.readdirSync(abs, { withFileTypes: true })) {
|
|
2535
|
+
const child = path4.join(abs, entry.name);
|
|
2536
|
+
if (entry.isDirectory()) {
|
|
2537
|
+
if (SKIP_DIRS2.has(entry.name)) {
|
|
2538
|
+
empty = false;
|
|
2539
|
+
continue;
|
|
2540
|
+
}
|
|
2541
|
+
if (walk(child)) fs4.rmdirSync(child);
|
|
2542
|
+
else empty = false;
|
|
2543
|
+
} else empty = false;
|
|
2544
|
+
}
|
|
2545
|
+
return empty;
|
|
2546
|
+
};
|
|
2547
|
+
walk(root);
|
|
2548
|
+
}
|
|
2549
|
+
function formatBridgeError(detail) {
|
|
2550
|
+
const where = detail.schema_path || detail.path || "/";
|
|
2551
|
+
return `${detail.code} at ${where}: ${detail.message}`;
|
|
2552
|
+
}
|
|
2553
|
+
function detailFrom(payload) {
|
|
2554
|
+
if (!payload || typeof payload !== "object") return null;
|
|
2555
|
+
const error = payload.error;
|
|
2556
|
+
if (!error || typeof error !== "object") return null;
|
|
2557
|
+
const detail = error;
|
|
2558
|
+
if (typeof detail.code !== "string" || typeof detail.message !== "string") return null;
|
|
2559
|
+
return detail;
|
|
2560
|
+
}
|
|
2561
|
+
async function runtime(creds, request, opts = {}) {
|
|
2562
|
+
const local = localRuntime();
|
|
2563
|
+
const yamlSpec = request.command === "conform" && Array.isArray(request.openapi) && request.openapi.some((doc) => /\.ya?ml$/i.test(doc.path ?? ""));
|
|
2564
|
+
if (local && !(yamlSpec && !localPythonHasYaml(local.python))) {
|
|
2565
|
+
const payload = await localBridge(request, local, opts);
|
|
2566
|
+
const detail = detailFrom(payload);
|
|
2567
|
+
if (detail) throw new BridgeRejected(detail);
|
|
2568
|
+
return payload;
|
|
2569
|
+
}
|
|
2570
|
+
if (!creds)
|
|
2571
|
+
throw new CliError(
|
|
2572
|
+
"This needs the schema runtime (the CLI bundles it) or platform credentials (`gateway auth login`). " + localRuntimeReason()
|
|
2573
|
+
);
|
|
2574
|
+
const controller = new AbortController();
|
|
2575
|
+
const timer = setTimeout(() => controller.abort(), opts.timeoutMs ?? 18e4);
|
|
2576
|
+
const route = "/api/public/worlds/runtime";
|
|
2577
|
+
try {
|
|
2578
|
+
const res = await fetch(`${creds.host}${route}`, {
|
|
2579
|
+
method: "POST",
|
|
2580
|
+
headers: {
|
|
2581
|
+
"content-type": "application/json",
|
|
2582
|
+
accept: "application/json",
|
|
2583
|
+
authorization: "Basic " + Buffer.from(`${creds.publicKey}:${creds.secretKey}`).toString("base64")
|
|
2584
|
+
},
|
|
2585
|
+
body: JSON.stringify(request),
|
|
2586
|
+
signal: controller.signal
|
|
2587
|
+
});
|
|
2588
|
+
const text2 = await res.text();
|
|
2589
|
+
let payload = null;
|
|
2590
|
+
try {
|
|
2591
|
+
payload = text2 ? JSON.parse(text2) : {};
|
|
2592
|
+
} catch {
|
|
2593
|
+
payload = null;
|
|
2594
|
+
}
|
|
2595
|
+
const detail = detailFrom(payload);
|
|
2596
|
+
if (detail) throw new BridgeRejected(detail);
|
|
2597
|
+
if (!res.ok)
|
|
2598
|
+
throw new CliError(`POST ${route} (${request.command}) -> ${res.status}: ${text2.slice(0, 600)}`, 1);
|
|
2599
|
+
if (payload === null) throw new CliError(`POST ${route} (${request.command}) returned non-JSON`, 1);
|
|
2600
|
+
return payload;
|
|
2601
|
+
} finally {
|
|
2602
|
+
clearTimeout(timer);
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
var SKIP_DIRS2, BUILD_OUTPUT, BridgeRejected;
|
|
2606
|
+
var init_client = __esm({
|
|
2607
|
+
"src/cli/runtime/client.ts"() {
|
|
2608
|
+
"use strict";
|
|
2609
|
+
init_router();
|
|
2610
|
+
init_local();
|
|
2611
|
+
SKIP_DIRS2 = /* @__PURE__ */ new Set(["__pycache__", ".git", "node_modules", ".gateway"]);
|
|
2612
|
+
BUILD_OUTPUT = /(^|\/)state\.(sqlite|json)$/;
|
|
2613
|
+
BridgeRejected = class extends CliError {
|
|
2614
|
+
constructor(detail) {
|
|
2615
|
+
super(formatBridgeError(detail), 1);
|
|
2616
|
+
this.detail = detail;
|
|
2617
|
+
}
|
|
2618
|
+
};
|
|
2619
|
+
}
|
|
2620
|
+
});
|
|
2621
|
+
|
|
2622
|
+
// src/cli/runtime/data.ts
|
|
2623
|
+
var data_exports = {};
|
|
2624
|
+
__export(data_exports, {
|
|
2625
|
+
checkLocalWorldData: () => checkLocalWorldData,
|
|
2626
|
+
dropBuildOutputs: () => dropBuildOutputs,
|
|
2627
|
+
importLocalWorldData: () => importLocalWorldData,
|
|
2628
|
+
ingestLocalToolCalls: () => ingestLocalToolCalls,
|
|
2629
|
+
queryLocalWorldData: () => queryLocalWorldData,
|
|
2630
|
+
queryLocalWorldDataAcross: () => queryLocalWorldDataAcross,
|
|
2631
|
+
showLocalWorldData: () => showLocalWorldData
|
|
2632
|
+
});
|
|
2633
|
+
import * as fs5 from "fs";
|
|
2634
|
+
import * as path5 from "path";
|
|
2635
|
+
async function importLocalWorldData(dir, rows, opts, creds) {
|
|
2636
|
+
const res = await runtime(creds, {
|
|
2637
|
+
command: "import-data",
|
|
2638
|
+
files: readWorldFiles(dir),
|
|
2639
|
+
rows,
|
|
2640
|
+
mode: opts.mode ?? "append",
|
|
2641
|
+
...opts.merge && opts.merge !== "upsert" ? { merge: opts.merge } : {},
|
|
2642
|
+
...opts.redact && opts.redact !== "off" ? { redact: opts.redact } : {}
|
|
2643
|
+
});
|
|
2644
|
+
if (res.files?.length) writeWorldFiles(dir, res.files);
|
|
2645
|
+
const dropped = res.changed ? dropBuildOutputs(dir) : [];
|
|
2646
|
+
return {
|
|
2647
|
+
kind: res.kind ?? "unknown",
|
|
2648
|
+
entity_counts: res.entity_counts ?? {},
|
|
2649
|
+
changed: Boolean(res.changed),
|
|
2650
|
+
...dropped.length ? {
|
|
2651
|
+
dropped_build_outputs: dropped,
|
|
2652
|
+
next: `gateway worlds schema compile ${dir} # rebuilds the snapshots from the imported data`
|
|
2653
|
+
} : {}
|
|
2654
|
+
};
|
|
2655
|
+
}
|
|
2656
|
+
function dropBuildOutputs(dir) {
|
|
2657
|
+
const dropped = [];
|
|
2658
|
+
for (const file of readWorldFiles(dir, { buildOutputs: true })) {
|
|
2659
|
+
if (!BUILD_OUTPUT2.test(file.path)) continue;
|
|
2660
|
+
fs5.rmSync(path5.join(dir, file.path), { force: true });
|
|
2661
|
+
dropped.push(file.path);
|
|
2662
|
+
}
|
|
2663
|
+
return dropped;
|
|
2664
|
+
}
|
|
2665
|
+
async function checkLocalWorldData(dir, rows, creds, opts = {}) {
|
|
2666
|
+
const res = await runtime(creds, {
|
|
2667
|
+
command: "import-data",
|
|
2668
|
+
files: readWorldFiles(dir),
|
|
2669
|
+
rows,
|
|
2670
|
+
mode: "append",
|
|
2671
|
+
...opts.redact && opts.redact !== "off" ? { redact: opts.redact } : {}
|
|
2672
|
+
});
|
|
2673
|
+
return {
|
|
2674
|
+
kind: res.kind ?? "unknown",
|
|
2675
|
+
entity_counts: res.entity_counts ?? {},
|
|
2676
|
+
changed: Boolean(res.changed)
|
|
2677
|
+
};
|
|
2678
|
+
}
|
|
2679
|
+
async function showLocalWorldData(dir, entity, creds) {
|
|
2680
|
+
const res = await runtime(creds, {
|
|
2681
|
+
command: "counts",
|
|
2682
|
+
files: readWorldFiles(dir),
|
|
2683
|
+
...entity ? { entity } : {}
|
|
2684
|
+
});
|
|
2685
|
+
const out = { kind: res.kind ?? "unknown" };
|
|
2686
|
+
if (entity) {
|
|
2687
|
+
out.entity = entity;
|
|
2688
|
+
out.rows = res.rows ?? [];
|
|
2689
|
+
} else out.entity_counts = res.entity_counts ?? {};
|
|
2690
|
+
return out;
|
|
2691
|
+
}
|
|
2692
|
+
async function queryLocalWorldData(dir, entity, where, opts, creds) {
|
|
2693
|
+
const res = await runtime(creds, {
|
|
2694
|
+
command: "query",
|
|
2695
|
+
files: readWorldFiles(dir),
|
|
2696
|
+
entity,
|
|
2697
|
+
...Object.keys(where).length ? { where } : {},
|
|
2698
|
+
...opts.limit !== void 0 ? { limit: opts.limit } : {},
|
|
2699
|
+
...opts.offset !== void 0 ? { offset: opts.offset } : {},
|
|
2700
|
+
...opts.resolve ? { resolve: true } : {},
|
|
2701
|
+
...opts.scenario ? { scenario: opts.scenario } : {}
|
|
2702
|
+
});
|
|
2703
|
+
const rows = res.rows ?? [];
|
|
2704
|
+
return {
|
|
2705
|
+
...res.kind ? { kind: res.kind } : {},
|
|
2706
|
+
entity: res.entity ?? entity,
|
|
2707
|
+
...res.scenario ? { scenario: res.scenario } : {},
|
|
2708
|
+
rows,
|
|
2709
|
+
count: res.count ?? rows.length,
|
|
2710
|
+
total: res.total ?? null,
|
|
2711
|
+
limit: res.limit ?? opts.limit ?? rows.length,
|
|
2712
|
+
offset: res.offset ?? opts.offset ?? 0,
|
|
2713
|
+
...res.resolved ? { resolved: res.resolved } : {}
|
|
2714
|
+
};
|
|
2715
|
+
}
|
|
2716
|
+
async function queryLocalWorldDataAcross(dir, entity, where, opts) {
|
|
2717
|
+
const local = localRuntime();
|
|
2718
|
+
if (!local)
|
|
2719
|
+
throw new CliError(
|
|
2720
|
+
"`--across` on a directory reads the linked worlds at their paths, so it needs the bundled runtime on this machine. " + localRuntimeReason(),
|
|
2721
|
+
1
|
|
2722
|
+
);
|
|
2723
|
+
const payload = await localBridge(
|
|
2724
|
+
{
|
|
2725
|
+
command: "query",
|
|
2726
|
+
world: path5.resolve(dir),
|
|
2727
|
+
entity,
|
|
2728
|
+
across: true,
|
|
2729
|
+
...opts.compare ? { compare: true } : {},
|
|
2730
|
+
...Object.keys(where).length ? { where } : {},
|
|
2731
|
+
...opts.limit !== void 0 ? { limit: opts.limit } : {},
|
|
2732
|
+
...opts.offset !== void 0 ? { offset: opts.offset } : {},
|
|
2733
|
+
...opts.resolve ? { resolve: true } : {},
|
|
2734
|
+
...opts.scenario ? { scenario: opts.scenario } : {}
|
|
2735
|
+
},
|
|
2736
|
+
local
|
|
2737
|
+
);
|
|
2738
|
+
const detail = detailFrom(payload);
|
|
2739
|
+
if (detail) throw new BridgeRejected(detail);
|
|
2740
|
+
return payload;
|
|
2741
|
+
}
|
|
2742
|
+
async function ingestLocalToolCalls(dir, records, opts, creds) {
|
|
2743
|
+
const res = await runtime(creds, {
|
|
2744
|
+
command: "ingest-calls",
|
|
2745
|
+
files: readWorldFiles(dir),
|
|
2746
|
+
records,
|
|
2747
|
+
mode: opts.mode ?? "append",
|
|
2748
|
+
...opts.dryRun ? { dry_run: true } : {},
|
|
2749
|
+
...opts.redact && opts.redact !== "off" ? { redact: opts.redact } : {},
|
|
2750
|
+
...opts.map !== void 0 ? { map: opts.map } : {}
|
|
2751
|
+
});
|
|
2752
|
+
if (!opts.dryRun && res.files?.length) writeWorldFiles(dir, res.files);
|
|
2753
|
+
if (res.changed) dropBuildOutputs(dir);
|
|
2754
|
+
return {
|
|
2755
|
+
...res.via ? { via: res.via } : {},
|
|
2756
|
+
...res.sources ? { sources: res.sources } : {},
|
|
2757
|
+
...res.unmatched ? { unmatched: res.unmatched } : {},
|
|
2758
|
+
...res.note ? { note: res.note } : {},
|
|
2759
|
+
records: res.records ?? records.length,
|
|
2760
|
+
ingested: res.ingested ?? 0,
|
|
2761
|
+
skipped: res.skipped ?? {},
|
|
2762
|
+
refusals: res.refusals ?? [],
|
|
2763
|
+
rows: res.rows ?? {},
|
|
2764
|
+
...res.projected ? { projected: res.projected } : {},
|
|
2765
|
+
dry_run: Boolean(res.dry_run ?? opts.dryRun),
|
|
2766
|
+
redact: res.redact ?? opts.redact ?? "off",
|
|
2767
|
+
changed: Boolean(res.changed),
|
|
2768
|
+
...res.kind ? { kind: res.kind } : {},
|
|
2769
|
+
...res.entity_counts ? { entity_counts: res.entity_counts } : {},
|
|
2770
|
+
...res.batch !== void 0 ? { batch: res.batch } : {}
|
|
2771
|
+
};
|
|
2772
|
+
}
|
|
2773
|
+
var BUILD_OUTPUT2;
|
|
2774
|
+
var init_data = __esm({
|
|
2775
|
+
"src/cli/runtime/data.ts"() {
|
|
2776
|
+
"use strict";
|
|
2777
|
+
init_router();
|
|
2778
|
+
init_client();
|
|
2779
|
+
init_local();
|
|
2780
|
+
BUILD_OUTPUT2 = /(^|\/)state\.(sqlite|json)$/;
|
|
2781
|
+
}
|
|
2782
|
+
});
|
|
2783
|
+
|
|
2784
|
+
// src/cli/platform/worldData/transform.ts
|
|
2785
|
+
var transform_exports = {};
|
|
2786
|
+
__export(transform_exports, {
|
|
2787
|
+
DEFAULT_TRANSFORM_TIMEOUT_MS: () => DEFAULT_TRANSFORM_TIMEOUT_MS,
|
|
2788
|
+
NODE_SUFFIXES: () => NODE_SUFFIXES,
|
|
2789
|
+
NODE_WRAPPER: () => NODE_WRAPPER,
|
|
2790
|
+
PYTHON_SUFFIXES: () => PYTHON_SUFFIXES,
|
|
2791
|
+
PY_WRAPPER: () => PY_WRAPPER,
|
|
2792
|
+
checkRows: () => checkRows,
|
|
2793
|
+
runTransform: () => runTransform,
|
|
2794
|
+
transformRecords: () => transformRecords
|
|
2795
|
+
});
|
|
2796
|
+
import { spawn as spawn2 } from "child_process";
|
|
2797
|
+
import * as fs6 from "fs";
|
|
2798
|
+
import * as os2 from "os";
|
|
2799
|
+
import * as path6 from "path";
|
|
2800
|
+
import { createRequire } from "module";
|
|
2801
|
+
function checkRows(value, where) {
|
|
2802
|
+
if (!isObject(value)) throw new CliError(`${where} must return {entity: [rows]}; got ${value === null ? "null" : Array.isArray(value) ? "an array" : typeof value}`, 1);
|
|
2803
|
+
for (const [entity, listed] of Object.entries(value)) {
|
|
2804
|
+
if (!Array.isArray(listed)) throw new CliError(`${where}: ${entity} must be a list of rows; got ${listed === null ? "null" : typeof listed}`, 1);
|
|
2805
|
+
listed.forEach((row, index) => {
|
|
2806
|
+
if (!isObject(row)) throw new CliError(`${where}: ${entity}[${index}] is not an object`, 1);
|
|
2807
|
+
});
|
|
2808
|
+
}
|
|
2809
|
+
return value;
|
|
2810
|
+
}
|
|
2811
|
+
function typescriptPrefix() {
|
|
2812
|
+
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
2813
|
+
if (!process.env.GATEWAY_NODE && (major > 22 || major === 22 && minor >= 6)) return ["--experimental-strip-types", "--no-warnings"];
|
|
2814
|
+
try {
|
|
2815
|
+
return [createRequire(import.meta.url).resolve("tsx/cli")];
|
|
2816
|
+
} catch {
|
|
2817
|
+
throw new CliError(
|
|
2818
|
+
`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`,
|
|
2819
|
+
1
|
|
2820
|
+
);
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
function command(script, wrapperDir) {
|
|
2824
|
+
const suffix = path6.extname(script).toLowerCase();
|
|
2825
|
+
if (PYTHON_SUFFIXES.includes(suffix)) return { file: process.env.GATEWAY_PYTHON || "python3", args: ["-c", PY_WRAPPER, script] };
|
|
2826
|
+
if (NODE_SUFFIXES.includes(suffix)) {
|
|
2827
|
+
const wrapper = path6.join(wrapperDir, "transform-wrapper.mjs");
|
|
2828
|
+
fs6.writeFileSync(wrapper, NODE_WRAPPER);
|
|
2829
|
+
const flags = suffix === ".ts" || suffix === ".mts" ? typescriptPrefix() : [];
|
|
2830
|
+
return { file: process.env.GATEWAY_NODE || process.execPath, args: [...flags, wrapper, script] };
|
|
2831
|
+
}
|
|
2832
|
+
throw new CliError(`${path6.basename(script)}: a transform script is .py, .ts, .mjs, .js or .cjs`, 1);
|
|
2833
|
+
}
|
|
2834
|
+
async function runTransform(script, records, opts = {}) {
|
|
2835
|
+
if (!fs6.existsSync(script) || !fs6.statSync(script).isFile()) throw new CliError(`no transform script at ${script}`, 1);
|
|
2836
|
+
const resolved = path6.resolve(script);
|
|
2837
|
+
const name = path6.basename(script);
|
|
2838
|
+
const timeoutMs = opts.timeoutMs ?? DEFAULT_TRANSFORM_TIMEOUT_MS;
|
|
2839
|
+
const scratch = fs6.mkdtempSync(path6.join(os2.tmpdir(), "gateway-transform-"));
|
|
2840
|
+
try {
|
|
2841
|
+
const { file, args } = command(resolved, scratch);
|
|
2842
|
+
const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => !SCRUBBED.test(key)));
|
|
2843
|
+
const done = await new Promise((resolve7, reject) => {
|
|
2844
|
+
const child = spawn2(file, args, { cwd: path6.dirname(resolved), env, stdio: ["pipe", "pipe", "pipe"] });
|
|
2845
|
+
let stdout = "";
|
|
2846
|
+
let stderr = "";
|
|
2847
|
+
let timedOut = false;
|
|
2848
|
+
const timer = setTimeout(() => {
|
|
2849
|
+
timedOut = true;
|
|
2850
|
+
child.kill("SIGKILL");
|
|
2851
|
+
}, timeoutMs);
|
|
2852
|
+
child.stdout.setEncoding("utf8").on("data", (chunk) => stdout += chunk);
|
|
2853
|
+
child.stderr.setEncoding("utf8").on("data", (chunk) => stderr += chunk);
|
|
2854
|
+
child.on("error", (error) => {
|
|
2855
|
+
clearTimeout(timer);
|
|
2856
|
+
reject(new CliError(`${name}: cannot run ${file}: ${error.message}`, 1));
|
|
2857
|
+
});
|
|
2858
|
+
child.on("close", (code) => {
|
|
2859
|
+
clearTimeout(timer);
|
|
2860
|
+
resolve7({ code, stdout, stderr, timedOut });
|
|
2861
|
+
});
|
|
2862
|
+
child.stdin.on("error", () => void 0);
|
|
2863
|
+
child.stdin.end(records.map((record) => JSON.stringify(record) + "\n").join(""));
|
|
2864
|
+
});
|
|
2865
|
+
if (done.timedOut) throw new CliError(`${name} timed out after ${timeoutMs / 1e3}s${tail(done.stderr)}`, 1);
|
|
2866
|
+
if (done.code !== 0) throw new CliError(`${name} exited ${done.code ?? "?"}${tail(done.stderr)}`, 1);
|
|
2867
|
+
let value;
|
|
2868
|
+
try {
|
|
2869
|
+
value = done.stdout.trim() ? JSON.parse(done.stdout) : null;
|
|
2870
|
+
} catch {
|
|
2871
|
+
throw new CliError(`${name} printed something other than the rows document${tail(done.stderr)}`, 1);
|
|
2872
|
+
}
|
|
2873
|
+
return { rows: checkRows(value, name), stderr: done.stderr };
|
|
2874
|
+
} finally {
|
|
2875
|
+
fs6.rmSync(scratch, { recursive: true, force: true });
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
async function transformRecords(transform, records, opts = {}) {
|
|
2879
|
+
if (typeof transform === "function") return { rows: checkRows(await transform(records), "transform(records)"), stderr: "" };
|
|
2880
|
+
return runTransform(transform, records, opts);
|
|
2881
|
+
}
|
|
2882
|
+
var DEFAULT_TRANSFORM_TIMEOUT_MS, NODE_SUFFIXES, PYTHON_SUFFIXES, SCRUBBED, PY_WRAPPER, NODE_WRAPPER, isObject, tail;
|
|
2883
|
+
var init_transform = __esm({
|
|
2884
|
+
"src/cli/platform/worldData/transform.ts"() {
|
|
2885
|
+
"use strict";
|
|
2886
|
+
init_router();
|
|
2887
|
+
DEFAULT_TRANSFORM_TIMEOUT_MS = 12e4;
|
|
2888
|
+
NODE_SUFFIXES = [".ts", ".mts", ".mjs", ".js", ".cjs"];
|
|
2889
|
+
PYTHON_SUFFIXES = [".py"];
|
|
2890
|
+
SCRUBBED = /^(GATEWAY_|HTTPS?_PROXY$|ALL_PROXY$|https?_proxy$|all_proxy$)/;
|
|
2891
|
+
PY_WRAPPER = `
|
|
2892
|
+
import io, json, runpy, socket, sys
|
|
2893
|
+
|
|
2894
|
+
def _deny(*args, **kwargs):
|
|
2895
|
+
raise RuntimeError("network is disabled in a transform")
|
|
2896
|
+
|
|
2897
|
+
class _Denied(socket.socket):
|
|
2898
|
+
def __init__(self, *args, **kwargs):
|
|
2899
|
+
_deny()
|
|
2900
|
+
|
|
2901
|
+
socket.socket = _Denied
|
|
2902
|
+
socket.SocketType = _Denied
|
|
2903
|
+
socket.create_connection = _deny
|
|
2904
|
+
socket.getaddrinfo = _deny
|
|
2905
|
+
|
|
2906
|
+
text = sys.stdin.read()
|
|
2907
|
+
records = [json.loads(line) for line in text.splitlines() if line.strip()]
|
|
2908
|
+
sys.stdin = io.StringIO(text)
|
|
2909
|
+
captured = io.StringIO()
|
|
2910
|
+
real = sys.stdout
|
|
2911
|
+
sys.stdout = captured
|
|
2912
|
+
try:
|
|
2913
|
+
namespace = runpy.run_path(sys.argv[1], run_name="__main__")
|
|
2914
|
+
finally:
|
|
2915
|
+
sys.stdout = real
|
|
2916
|
+
fn = namespace.get("transform")
|
|
2917
|
+
if callable(fn):
|
|
2918
|
+
out = fn(records)
|
|
2919
|
+
else:
|
|
2920
|
+
printed = captured.getvalue().strip()
|
|
2921
|
+
if not printed:
|
|
2922
|
+
sys.stderr.write("the transform defines no transform(records) and printed nothing\\n")
|
|
2923
|
+
sys.exit(3)
|
|
2924
|
+
out = json.loads(printed)
|
|
2925
|
+
real.write(json.dumps(out))
|
|
2926
|
+
`;
|
|
2927
|
+
NODE_WRAPPER = `
|
|
2928
|
+
import { pathToFileURL } from "node:url";
|
|
2929
|
+
import net from "node:net";
|
|
2930
|
+
import tls from "node:tls";
|
|
2931
|
+
import http from "node:http";
|
|
2932
|
+
import https from "node:https";
|
|
2933
|
+
import dgram from "node:dgram";
|
|
2934
|
+
|
|
2935
|
+
const deny = () => { throw new Error("network is disabled in a transform"); };
|
|
2936
|
+
net.Socket.prototype.connect = deny;
|
|
2937
|
+
net.connect = deny;
|
|
2938
|
+
net.createConnection = deny;
|
|
2939
|
+
tls.connect = deny;
|
|
2940
|
+
http.request = deny;
|
|
2941
|
+
http.get = deny;
|
|
2942
|
+
https.request = deny;
|
|
2943
|
+
https.get = deny;
|
|
2944
|
+
dgram.createSocket = deny;
|
|
2945
|
+
globalThis.fetch = deny;
|
|
2946
|
+
|
|
2947
|
+
const module = await import(pathToFileURL(process.argv[2]).href);
|
|
2948
|
+
const fn = typeof module.transform === "function" ? module.transform : typeof module.default === "function" ? module.default : null;
|
|
2949
|
+
if (fn) {
|
|
2950
|
+
const chunks = [];
|
|
2951
|
+
for await (const chunk of process.stdin) chunks.push(chunk);
|
|
2952
|
+
const text = Buffer.concat(chunks).toString("utf8");
|
|
2953
|
+
const records = text.split("\\n").filter((line) => line.trim()).map((line) => JSON.parse(line));
|
|
2954
|
+
const out = await fn(records);
|
|
2955
|
+
process.stdout.write(JSON.stringify(out));
|
|
2956
|
+
}
|
|
2957
|
+
`;
|
|
2958
|
+
isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2959
|
+
tail = (stderr, lines = 12) => {
|
|
2960
|
+
const kept = stderr.split("\n").filter((line) => line.trim()).slice(-lines);
|
|
2961
|
+
return kept.length ? "\n" + kept.join("\n") : "";
|
|
2962
|
+
};
|
|
2963
|
+
}
|
|
2964
|
+
});
|
|
2965
|
+
|
|
2966
|
+
// src/cli/platform/worldData/batches.ts
|
|
2967
|
+
import { createHash as createHash5 } from "crypto";
|
|
2968
|
+
import * as fs7 from "fs";
|
|
2969
|
+
function uploadHeadersFor(gz) {
|
|
2970
|
+
return {
|
|
2971
|
+
"content-type": "application/gzip",
|
|
2972
|
+
"content-length": String(gz.length),
|
|
2973
|
+
"x-amz-checksum-sha256": createHash5("sha256").update(gz).digest("base64")
|
|
2974
|
+
};
|
|
2975
|
+
}
|
|
2976
|
+
async function forEachLimited(items, limit, fn) {
|
|
2977
|
+
const inFlight = /* @__PURE__ */ new Set();
|
|
2978
|
+
let failure = null;
|
|
2979
|
+
const track = (p) => {
|
|
2980
|
+
const wrapped = p.then(
|
|
2981
|
+
() => {
|
|
2982
|
+
inFlight.delete(wrapped);
|
|
2983
|
+
},
|
|
2984
|
+
(error) => {
|
|
2985
|
+
failure ??= error;
|
|
2986
|
+
inFlight.delete(wrapped);
|
|
2987
|
+
}
|
|
2988
|
+
);
|
|
2989
|
+
inFlight.add(wrapped);
|
|
2990
|
+
};
|
|
2991
|
+
for await (const item of items) {
|
|
2992
|
+
if (failure) break;
|
|
2993
|
+
track(fn(item));
|
|
2994
|
+
if (inFlight.size >= limit) await Promise.race(inFlight);
|
|
2995
|
+
}
|
|
2996
|
+
await Promise.all(inFlight);
|
|
2997
|
+
if (failure) throw failure;
|
|
2998
|
+
}
|
|
2999
|
+
async function waitForBatch(client2, batchId, opts = {}) {
|
|
3000
|
+
const sleep3 = opts.sleep ?? client2.sleep;
|
|
3001
|
+
let delay = opts.initialDelayMs ?? 1e3;
|
|
3002
|
+
let last = "";
|
|
3003
|
+
for (; ; ) {
|
|
3004
|
+
const status = await client2.get(batchId);
|
|
3005
|
+
const phase = phaseLine(status);
|
|
3006
|
+
if (phase !== last) {
|
|
3007
|
+
opts.onPhase?.(phase);
|
|
3008
|
+
last = phase;
|
|
3009
|
+
}
|
|
3010
|
+
if (TERMINAL_STATES.has(status.state)) return status;
|
|
3011
|
+
await sleep3(delay);
|
|
3012
|
+
delay = Math.min(1e4, Math.round(delay * 1.5));
|
|
3013
|
+
}
|
|
3014
|
+
}
|
|
3015
|
+
function phaseLine(status) {
|
|
3016
|
+
const phase = status.progress?.phase;
|
|
3017
|
+
return phase ? `${status.state} (${phase})` : status.state;
|
|
3018
|
+
}
|
|
3019
|
+
var TERMINAL_STATES, sleepMs, WorldDataApi;
|
|
3020
|
+
var init_batches = __esm({
|
|
3021
|
+
"src/cli/platform/worldData/batches.ts"() {
|
|
3022
|
+
"use strict";
|
|
3023
|
+
init_config();
|
|
3024
|
+
init_router();
|
|
3025
|
+
TERMINAL_STATES = /* @__PURE__ */ new Set(["applied", "refused", "published", "failed"]);
|
|
3026
|
+
sleepMs = (ms) => new Promise((resolve7) => setTimeout(resolve7, ms));
|
|
3027
|
+
WorldDataApi = class {
|
|
3028
|
+
constructor(creds, slug, sleep3 = sleepMs) {
|
|
3029
|
+
this.creds = creds;
|
|
3030
|
+
this.slug = slug;
|
|
3031
|
+
this.sleep = sleep3;
|
|
3032
|
+
this.base = `/api/public/worlds/${encodeURIComponent(slug)}/data`;
|
|
3033
|
+
}
|
|
3034
|
+
base;
|
|
3035
|
+
open(body) {
|
|
3036
|
+
return api(this.creds, "POST", `${this.base}/batches`, body);
|
|
3037
|
+
}
|
|
3038
|
+
register(batchId, chunk) {
|
|
3039
|
+
return api(this.creds, "POST", `${this.base}/batches/${batchId}/chunks`, {
|
|
3040
|
+
ordinal: chunk.ordinal,
|
|
3041
|
+
digest: chunk.digest,
|
|
3042
|
+
bytes: chunk.bytes,
|
|
3043
|
+
rows: chunk.rows,
|
|
3044
|
+
...chunk.entity ? { entity: chunk.entity } : {}
|
|
3045
|
+
});
|
|
3046
|
+
}
|
|
3047
|
+
markUploaded(batchId, chunkId) {
|
|
3048
|
+
return api(this.creds, "POST", `${this.base}/batches/${batchId}/chunks/${chunkId}/uploaded`);
|
|
3049
|
+
}
|
|
3050
|
+
complete(batchId) {
|
|
3051
|
+
return api(this.creds, "POST", `${this.base}/batches/${batchId}/complete`);
|
|
3052
|
+
}
|
|
3053
|
+
get(batchId) {
|
|
3054
|
+
return api(this.creds, "GET", `${this.base}/batches/${batchId}`);
|
|
3055
|
+
}
|
|
3056
|
+
list(limit, cursor) {
|
|
3057
|
+
const params = new URLSearchParams();
|
|
3058
|
+
if (limit !== void 0) params.set("limit", String(limit));
|
|
3059
|
+
if (cursor) params.set("cursor", cursor);
|
|
3060
|
+
const q = params.toString();
|
|
3061
|
+
return api(this.creds, "GET", `${this.base}/batches${q ? `?${q}` : ""}`);
|
|
3062
|
+
}
|
|
3063
|
+
publish(message) {
|
|
3064
|
+
return api(this.creds, "POST", `${this.base}/publish`, message ? { message } : {});
|
|
3065
|
+
}
|
|
3066
|
+
/**
|
|
3067
|
+
* PUT the gzipped chunk to its presigned URL with exactly the headers the
|
|
3068
|
+
* URL was signed for (the platform's `uploadHeaders`; the same three when it
|
|
3069
|
+
* sends none), with backoff on a dropped connection or a 5xx.
|
|
3070
|
+
*/
|
|
3071
|
+
async put(uploadUrl, gz, signed) {
|
|
3072
|
+
const headers = signed ?? uploadHeadersFor(gz);
|
|
3073
|
+
const delays = [500, 1500, 4e3];
|
|
3074
|
+
for (let attempt = 0; ; attempt++) {
|
|
3075
|
+
try {
|
|
3076
|
+
const res = await fetch(uploadUrl, { method: "PUT", body: new Uint8Array(gz), headers });
|
|
3077
|
+
if (res.ok) return;
|
|
3078
|
+
if (res.status < 500 || attempt >= delays.length) throw new CliError(`chunk upload -> ${res.status}: ${(await res.text()).slice(0, 300)}`, 1);
|
|
3079
|
+
} catch (error) {
|
|
3080
|
+
if (error instanceof CliError || attempt >= delays.length) throw error instanceof CliError ? error : new CliError(`chunk upload failed: ${error.message}`, 1);
|
|
3081
|
+
}
|
|
3082
|
+
await this.sleep(delays[attempt]);
|
|
3083
|
+
}
|
|
3084
|
+
}
|
|
3085
|
+
/** Register, upload unless the server already holds the content, confirm. */
|
|
3086
|
+
async upload(batchId, chunk) {
|
|
3087
|
+
const registered = await this.register(batchId, chunk);
|
|
3088
|
+
if (!registered.uploaded) {
|
|
3089
|
+
if (!registered.uploadUrl) throw new CliError(`the server registered chunk ${chunk.ordinal} without an upload URL`, 1);
|
|
3090
|
+
await this.put(registered.uploadUrl, chunk.gz, registered.uploadHeaders);
|
|
3091
|
+
await this.markUploaded(batchId, registered.chunkId);
|
|
3092
|
+
}
|
|
3093
|
+
return { ordinal: chunk.ordinal, digest: chunk.digest, bytes: chunk.bytes, rows: chunk.rows, entity: chunk.entity, chunkId: registered.chunkId, uploaded: true };
|
|
3094
|
+
}
|
|
3095
|
+
};
|
|
3096
|
+
}
|
|
3097
|
+
});
|
|
3098
|
+
|
|
3099
|
+
// src/cli/platform/worldData/chunker.ts
|
|
3100
|
+
import { createHash as createHash6 } from "crypto";
|
|
3101
|
+
import { deflateRawSync } from "zlib";
|
|
3102
|
+
function chunkLine(row, declared) {
|
|
3103
|
+
if (declared !== null) return dumps(row.row) + "\n";
|
|
3104
|
+
const tagged = /* @__PURE__ */ new Map();
|
|
3105
|
+
tagged.set("entity", row.entity);
|
|
3106
|
+
tagged.set("row", row.row);
|
|
3107
|
+
return dumps(tagged) + "\n";
|
|
3108
|
+
}
|
|
3109
|
+
async function* buildChunks(rows, plan) {
|
|
3110
|
+
let lines = [];
|
|
3111
|
+
let rawBytes = 0;
|
|
3112
|
+
let ordinal = 0;
|
|
3113
|
+
let seen = 0;
|
|
3114
|
+
const flush2 = () => {
|
|
3115
|
+
const raw = Buffer.concat(lines);
|
|
3116
|
+
const built = finishChunk(ordinal++, raw, lines.length, plan.entity, seen - lines.length);
|
|
3117
|
+
lines = [];
|
|
3118
|
+
rawBytes = 0;
|
|
3119
|
+
return built;
|
|
3120
|
+
};
|
|
3121
|
+
for await (const row of rows) {
|
|
3122
|
+
const line = Buffer.from(chunkLine(row, plan.entity), "utf8");
|
|
3123
|
+
const full = lines.length > 0 && (plan.chunkRows !== null && lines.length >= plan.chunkRows || rawBytes + line.length > plan.chunkBytes);
|
|
3124
|
+
if (full) yield flush2();
|
|
3125
|
+
lines.push(line);
|
|
3126
|
+
rawBytes += line.length;
|
|
3127
|
+
seen++;
|
|
3128
|
+
}
|
|
3129
|
+
if (lines.length) yield flush2();
|
|
3130
|
+
}
|
|
3131
|
+
function finishChunk(ordinal, raw, rows, entity, firstRow = 0) {
|
|
3132
|
+
const gz = gzipDeterministic(raw, { name: chunkName(ordinal) });
|
|
3133
|
+
return {
|
|
3134
|
+
ordinal,
|
|
3135
|
+
digest: createHash6("sha256").update(gz).digest("hex"),
|
|
3136
|
+
bytes: gz.length,
|
|
3137
|
+
rows,
|
|
3138
|
+
entity,
|
|
3139
|
+
rawBytes: raw.length,
|
|
3140
|
+
contentSha256: createHash6("sha256").update(raw).digest("hex"),
|
|
3141
|
+
firstRow,
|
|
3142
|
+
gz
|
|
3143
|
+
};
|
|
3144
|
+
}
|
|
3145
|
+
function gzipDeterministic(raw, opts = {}) {
|
|
3146
|
+
const level = opts.level ?? GZIP_LEVEL;
|
|
3147
|
+
const name = opts.name ? Buffer.concat([Buffer.from(opts.name, "latin1"), Buffer.from([0])]) : Buffer.alloc(0);
|
|
3148
|
+
const header = Buffer.from([31, 139, 8, opts.name ? 8 : 0, 0, 0, 0, 0, level === 9 ? 2 : level === 1 ? 4 : 0, 255]);
|
|
3149
|
+
const body = deflateRawSync(raw, { level });
|
|
3150
|
+
const trailer = Buffer.alloc(8);
|
|
3151
|
+
trailer.writeUInt32LE(crc32(raw), 0);
|
|
3152
|
+
trailer.writeUInt32LE(raw.length >>> 0, 4);
|
|
3153
|
+
return Buffer.concat([header, name, body, trailer]);
|
|
3154
|
+
}
|
|
3155
|
+
function crc32(data) {
|
|
3156
|
+
if (!table) {
|
|
3157
|
+
table = new Uint32Array(256);
|
|
3158
|
+
for (let n = 0; n < 256; n++) {
|
|
3159
|
+
let c = n;
|
|
3160
|
+
for (let k = 0; k < 8; k++) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
3161
|
+
table[n] = c >>> 0;
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
let crc = 4294967295;
|
|
3165
|
+
for (let i = 0; i < data.length; i++) crc = table[(crc ^ data[i]) & 255] ^ crc >>> 8;
|
|
3166
|
+
return (crc ^ 4294967295) >>> 0;
|
|
3167
|
+
}
|
|
3168
|
+
var DEFAULT_CHUNK_BYTES, GZIP_LEVEL, chunkName, table;
|
|
3169
|
+
var init_chunker = __esm({
|
|
3170
|
+
"src/cli/platform/worldData/chunker.ts"() {
|
|
3171
|
+
"use strict";
|
|
3172
|
+
init_json();
|
|
3173
|
+
DEFAULT_CHUNK_BYTES = 64 * 1024 * 1024;
|
|
3174
|
+
GZIP_LEVEL = 9;
|
|
3175
|
+
chunkName = (ordinal) => `chunk-${String(ordinal).padStart(5, "0")}.jsonl`;
|
|
3176
|
+
table = null;
|
|
3177
|
+
}
|
|
3178
|
+
});
|
|
3179
|
+
|
|
3180
|
+
// src/cli/platform/worldData/push.ts
|
|
3181
|
+
var push_exports = {};
|
|
3182
|
+
__export(push_exports, {
|
|
3183
|
+
pushRows: () => pushRows
|
|
3184
|
+
});
|
|
3185
|
+
async function pushRows(creds, slug, rows, opts = {}) {
|
|
3186
|
+
const client2 = opts.sleep ? new WorldDataApi(creds, slug, opts.sleep) : new WorldDataApi(creds, slug);
|
|
3187
|
+
const opened = await client2.open({
|
|
3188
|
+
mode: opts.mode ?? "append",
|
|
3189
|
+
merge: "upsert",
|
|
3190
|
+
...opts.redact && opts.redact !== "off" ? { redact: opts.redact } : {},
|
|
3191
|
+
atomic: true,
|
|
3192
|
+
dryRun: Boolean(opts.dryRun),
|
|
3193
|
+
publish: opts.publish ?? "now",
|
|
3194
|
+
...opts.message ? { message: opts.message } : {}
|
|
3195
|
+
});
|
|
3196
|
+
if (!opened.batchId) throw new Error("the platform opened no batch (no batchId in the answer)");
|
|
3197
|
+
const tagged = (async function* () {
|
|
3198
|
+
for (const [entity, listed] of Object.entries(rows))
|
|
3199
|
+
for (let index = 0; index < listed.length; index++)
|
|
3200
|
+
yield { entity, row: parseJson(JSON.stringify(listed[index])), where: `${entity}[${index}]` };
|
|
3201
|
+
})();
|
|
3202
|
+
const chunks = buildChunks(tagged, { chunkBytes: opts.chunkBytes ?? DEFAULT_CHUNK_BYTES, chunkRows: null, entity: null });
|
|
3203
|
+
await forEachLimited(chunks, Math.max(1, opts.parallel ?? 4), async (chunk) => {
|
|
3204
|
+
await client2.upload(opened.batchId, chunk);
|
|
3205
|
+
});
|
|
3206
|
+
await client2.complete(opened.batchId);
|
|
3207
|
+
return waitForBatch(client2, opened.batchId, { initialDelayMs: pollMs() });
|
|
3208
|
+
}
|
|
3209
|
+
function pollMs() {
|
|
3210
|
+
const raw = Number(process.env.GATEWAY_WORLD_DATA_POLL_MS ?? 1e3);
|
|
3211
|
+
return Number.isFinite(raw) && raw >= 0 ? raw : 1e3;
|
|
3212
|
+
}
|
|
3213
|
+
var init_push = __esm({
|
|
3214
|
+
"src/cli/platform/worldData/push.ts"() {
|
|
3215
|
+
"use strict";
|
|
3216
|
+
init_batches();
|
|
3217
|
+
init_chunker();
|
|
3218
|
+
init_json();
|
|
3219
|
+
}
|
|
3220
|
+
});
|
|
3221
|
+
|
|
3222
|
+
// src/worlds/ingest.ts
|
|
3223
|
+
import * as fs8 from "fs";
|
|
3224
|
+
import * as os3 from "os";
|
|
3225
|
+
import * as path7 from "path";
|
|
3226
|
+
function parseToolCallRecord(raw) {
|
|
3227
|
+
const none = { record: null, skip: null };
|
|
3228
|
+
if (!isObject2(raw)) return { ...none, refusal: "record is not an object" };
|
|
3229
|
+
const kind = raw.kind;
|
|
3230
|
+
if (kind !== void 0 && kind !== null && kind !== "call") return { record: null, skip: `kind ${String(kind)}`, refusal: null };
|
|
3231
|
+
const tool = raw.tool;
|
|
3232
|
+
if (typeof tool !== "string" || !tool) return { ...none, refusal: "record has no tool name" };
|
|
3233
|
+
if (raw.error !== void 0 && raw.error !== null && raw.error !== "") return { record: null, skip: "call failed", refusal: null };
|
|
3234
|
+
const args = raw.args ?? {};
|
|
3235
|
+
if (!isObject2(args)) return { ...none, refusal: `args of ${tool} is not an object` };
|
|
3236
|
+
if (!("result" in raw)) return { ...none, refusal: `record of ${tool} has no result` };
|
|
3237
|
+
const at = raw.at ?? raw.completedAt;
|
|
3238
|
+
const record = { tool, args, result: raw.result };
|
|
3239
|
+
if (typeof at === "string") record.at = at;
|
|
3240
|
+
if (typeof raw.session === "string") record.session = raw.session;
|
|
3241
|
+
if (typeof raw.source === "string") record.source = raw.source;
|
|
3242
|
+
return { record, skip: null, refusal: null };
|
|
3243
|
+
}
|
|
3244
|
+
function readToolCallRecords(paths) {
|
|
3245
|
+
const records = [];
|
|
3246
|
+
for (const file of paths) records.push(...toolCallRecordsIn(fs8.readFileSync(file, "utf8"), file));
|
|
3247
|
+
return records;
|
|
3248
|
+
}
|
|
3249
|
+
function toolCallRecordsIn(text2, where) {
|
|
3250
|
+
const stripped = text2.trim();
|
|
3251
|
+
if (!stripped) return [];
|
|
3252
|
+
if (stripped.startsWith("[")) {
|
|
3253
|
+
const listed = JSON.parse(stripped);
|
|
3254
|
+
if (!Array.isArray(listed)) throw new Error(`${where} is neither a JSON array nor JSON Lines`);
|
|
3255
|
+
listed.forEach((item, index) => {
|
|
3256
|
+
if (!isObject2(item)) throw new Error(`${where}[${index}] is not an object`);
|
|
3257
|
+
});
|
|
3258
|
+
return listed;
|
|
3259
|
+
}
|
|
3260
|
+
const records = [];
|
|
3261
|
+
const lines = text2.split(/\r?\n/);
|
|
3262
|
+
for (let index = 0; index < lines.length; index++) {
|
|
3263
|
+
const line = lines[index];
|
|
3264
|
+
if (!line.trim()) continue;
|
|
3265
|
+
let item;
|
|
3266
|
+
try {
|
|
3267
|
+
item = JSON.parse(line);
|
|
3268
|
+
} catch {
|
|
3269
|
+
throw new Error(`${where}:${index + 1} is not JSON`);
|
|
3270
|
+
}
|
|
3271
|
+
if (!isObject2(item)) throw new Error(`${where}:${index + 1} is not an object`);
|
|
3272
|
+
records.push(item);
|
|
3273
|
+
}
|
|
3274
|
+
return records;
|
|
3275
|
+
}
|
|
3276
|
+
async function emit(sink, record) {
|
|
3277
|
+
if (Array.isArray(sink)) {
|
|
3278
|
+
sink.push(record);
|
|
3279
|
+
return;
|
|
3280
|
+
}
|
|
3281
|
+
if (typeof sink === "string") {
|
|
3282
|
+
fs8.appendFileSync(sink, JSON.stringify(record) + "\n");
|
|
3283
|
+
return;
|
|
3284
|
+
}
|
|
3285
|
+
if (typeof sink === "function") {
|
|
3286
|
+
await sink(record);
|
|
3287
|
+
return;
|
|
3288
|
+
}
|
|
3289
|
+
throw new TypeError("sink must be an array, a file path, or a function");
|
|
3290
|
+
}
|
|
3291
|
+
function captureToolCalls(tools, sink, opts = {}) {
|
|
3292
|
+
const wrapped = /* @__PURE__ */ Object.create(null);
|
|
3293
|
+
for (const [name, fn] of Object.entries(tools)) {
|
|
3294
|
+
wrapped[name] = async (args = {}) => {
|
|
3295
|
+
const record = { tool: name, args, at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
3296
|
+
if (opts.session) record.session = opts.session;
|
|
3297
|
+
if (opts.source) record.source = opts.source;
|
|
3298
|
+
let result;
|
|
3299
|
+
try {
|
|
3300
|
+
result = await fn(args);
|
|
3301
|
+
} catch (error) {
|
|
3302
|
+
record.error = error instanceof Error ? error.message || error.name : String(error);
|
|
3303
|
+
await emit(sink, record);
|
|
3304
|
+
throw error;
|
|
3305
|
+
}
|
|
3306
|
+
record.result = result;
|
|
3307
|
+
await emit(sink, record);
|
|
3308
|
+
return result;
|
|
3309
|
+
};
|
|
3310
|
+
}
|
|
3311
|
+
return wrapped;
|
|
3312
|
+
}
|
|
3313
|
+
function jsonish(value) {
|
|
3314
|
+
if (typeof value !== "string") return value;
|
|
3315
|
+
try {
|
|
3316
|
+
return JSON.parse(value);
|
|
3317
|
+
} catch {
|
|
3318
|
+
return value;
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
function toolCallsFromObservations(observations, opts = {}) {
|
|
3322
|
+
const known = opts.tools ? new Set(opts.tools) : null;
|
|
3323
|
+
const sinceMs = opts.since ? Date.parse(opts.since) : NaN;
|
|
3324
|
+
const out = { records: [], unknownTools: {}, skipped: {} };
|
|
3325
|
+
const skip = (reason) => {
|
|
3326
|
+
out.skipped[reason] = (out.skipped[reason] ?? 0) + 1;
|
|
3327
|
+
};
|
|
3328
|
+
for (const observation of observations) {
|
|
3329
|
+
if (observation.type !== "TOOL") {
|
|
3330
|
+
skip(`type ${observation.type ?? "unknown"}`);
|
|
3331
|
+
continue;
|
|
3332
|
+
}
|
|
3333
|
+
const tool = observation.name;
|
|
3334
|
+
if (typeof tool !== "string" || !tool) {
|
|
3335
|
+
skip("no name");
|
|
3336
|
+
continue;
|
|
3337
|
+
}
|
|
3338
|
+
const at = isoOf(observation.startTime);
|
|
3339
|
+
if (!Number.isNaN(sinceMs) && at !== void 0 && Date.parse(at) < sinceMs) {
|
|
3340
|
+
skip("before since");
|
|
3341
|
+
continue;
|
|
3342
|
+
}
|
|
3343
|
+
if (known && !known.has(tool)) {
|
|
3344
|
+
out.unknownTools[tool] = (out.unknownTools[tool] ?? 0) + 1;
|
|
3345
|
+
continue;
|
|
3346
|
+
}
|
|
3347
|
+
const input = jsonish(observation.input);
|
|
3348
|
+
const record = { tool, args: isObject2(input) ? input : {} };
|
|
3349
|
+
if (observation.level === "ERROR") record.error = observation.statusMessage || "ERROR";
|
|
3350
|
+
else record.result = jsonish(observation.output);
|
|
3351
|
+
if (at !== void 0) record.at = at;
|
|
3352
|
+
if (opts.session) record.session = opts.session;
|
|
3353
|
+
record.source = `trace:${observation.traceId ?? "?"}/${observation.id ?? "?"}`;
|
|
3354
|
+
out.records.push(record);
|
|
3355
|
+
}
|
|
3356
|
+
return out;
|
|
3357
|
+
}
|
|
3358
|
+
function credentialsOf(options) {
|
|
3359
|
+
const host = (options.host ?? process.env.GATEWAY_HOST ?? "https://withgateway.ai").replace(/\/+$/, "");
|
|
3360
|
+
const publicKey = options.publicKey ?? process.env.GATEWAY_PUBLIC_KEY;
|
|
3361
|
+
const secretKey = options.secretKey ?? process.env.GATEWAY_SECRET_KEY;
|
|
3362
|
+
return publicKey && secretKey ? { host, publicKey, secretKey } : null;
|
|
3363
|
+
}
|
|
3364
|
+
async function ingest(world, records, options = {}) {
|
|
3365
|
+
const { ingestLocalToolCalls: ingestLocalToolCalls2, importLocalWorldData: importLocalWorldData2, checkLocalWorldData: checkLocalWorldData2 } = await Promise.resolve().then(() => (init_data(), data_exports));
|
|
3366
|
+
if (options.transform !== void 0 && options.map !== void 0) throw new Error("records go through one of transform, map");
|
|
3367
|
+
const redact = options.redact ?? "off";
|
|
3368
|
+
const mode = options.mode ?? "append";
|
|
3369
|
+
const dryRun = Boolean(options.dryRun);
|
|
3370
|
+
const creds = credentialsOf(options);
|
|
3371
|
+
const local = fs8.existsSync(world) && fs8.statSync(world).isDirectory();
|
|
3372
|
+
const map = options.map === void 0 ? void 0 : options.map;
|
|
3373
|
+
let rows = null;
|
|
3374
|
+
let stderr = "";
|
|
3375
|
+
if (options.transform !== void 0) {
|
|
3376
|
+
const { transformRecords: transformRecords2 } = await Promise.resolve().then(() => (init_transform(), transform_exports));
|
|
3377
|
+
({ rows, stderr } = await transformRecords2(options.transform, records, { timeoutMs: options.timeoutMs }));
|
|
3378
|
+
}
|
|
3379
|
+
if (local) {
|
|
3380
|
+
if (rows === null) return reportOf(world, await ingestLocalToolCalls2(world, records, { redact, dryRun, mode, map }, creds), redact);
|
|
3381
|
+
const landed = dryRun ? await checkLocalWorldData2(world, rows, creds, { redact }) : await importLocalWorldData2(world, rows, { mode, redact }, creds);
|
|
3382
|
+
return transformReport(world, records.length, rows, stderr, { dryRun, redact, changed: !dryRun && landed.changed, kind: landed.kind, entityCounts: landed.entity_counts });
|
|
3383
|
+
}
|
|
3384
|
+
if (!creds) throw new Error("Gateway keys missing: set GATEWAY_PUBLIC_KEY / GATEWAY_SECRET_KEY (or pass publicKey/secretKey).");
|
|
3385
|
+
const { pull: pull2 } = await Promise.resolve().then(() => (init_hub(), hub_exports));
|
|
3386
|
+
const slug = world.split("@", 1)[0];
|
|
3387
|
+
const scratch = fs8.mkdtempSync(path7.join(os3.tmpdir(), "gateway-ingest-"));
|
|
3388
|
+
try {
|
|
3389
|
+
const pulled = await pull2(world, path7.join(scratch, slug), options);
|
|
3390
|
+
let report;
|
|
3391
|
+
let projected;
|
|
3392
|
+
if (rows === null) {
|
|
3393
|
+
const proven = await ingestLocalToolCalls2(pulled.dir, records, { redact: "off", dryRun: true, mode, map }, creds);
|
|
3394
|
+
report = reportOf(world, proven, redact);
|
|
3395
|
+
projected = proven.projected ?? {};
|
|
3396
|
+
} else {
|
|
3397
|
+
const proven = await checkLocalWorldData2(pulled.dir, rows, creds);
|
|
3398
|
+
report = transformReport(world, records.length, rows, stderr, { dryRun, redact, changed: false, kind: proven.kind, entityCounts: proven.entity_counts });
|
|
3399
|
+
projected = rows;
|
|
3400
|
+
}
|
|
3401
|
+
report.dryRun = dryRun;
|
|
3402
|
+
if (dryRun || report.refusals.length || !Object.keys(projected).length) return report;
|
|
3403
|
+
const { pushRows: pushRows2 } = await Promise.resolve().then(() => (init_push(), push_exports));
|
|
3404
|
+
const status = await pushRows2(creds, slug, projected, { mode, redact, message: options.message });
|
|
3405
|
+
report.batch = status;
|
|
3406
|
+
report.changed = status.state === "applied" || status.state === "published";
|
|
3407
|
+
if (status.entityCounts) report.entityCounts = status.entityCounts;
|
|
3408
|
+
return report;
|
|
3409
|
+
} finally {
|
|
3410
|
+
fs8.rmSync(scratch, { recursive: true, force: true });
|
|
3411
|
+
}
|
|
3412
|
+
}
|
|
3413
|
+
async function ingestToolCalls(world, records, options = {}) {
|
|
3414
|
+
return ingest(world, records, options);
|
|
3415
|
+
}
|
|
3416
|
+
function transformReport(world, records, rows, stderr, outcome) {
|
|
3417
|
+
return {
|
|
3418
|
+
world,
|
|
3419
|
+
via: "transform",
|
|
3420
|
+
...stderr ? { stderr } : {},
|
|
3421
|
+
records,
|
|
3422
|
+
ingested: records,
|
|
3423
|
+
skipped: {},
|
|
3424
|
+
refusals: [],
|
|
3425
|
+
rows: Object.fromEntries(Object.entries(rows).map(([entity, listed]) => [entity, listed.length])),
|
|
3426
|
+
dryRun: outcome.dryRun,
|
|
3427
|
+
redact: outcome.redact,
|
|
3428
|
+
changed: outcome.changed,
|
|
3429
|
+
...outcome.kind ? { kind: outcome.kind } : {},
|
|
3430
|
+
...outcome.entityCounts ? { entityCounts: outcome.entityCounts } : {}
|
|
3431
|
+
};
|
|
3432
|
+
}
|
|
3433
|
+
function reportOf(world, local, redact) {
|
|
3434
|
+
return {
|
|
3435
|
+
world,
|
|
3436
|
+
...local.via ? { via: local.via } : {},
|
|
3437
|
+
...local.sources ? { sources: local.sources.map(({ unmapped_fields, unset_fields, ...rest }) => ({ ...rest, unmappedFields: unmapped_fields, unsetFields: unset_fields })) } : {},
|
|
3438
|
+
...local.unmatched ? { unmatched: local.unmatched } : {},
|
|
3439
|
+
...local.note ? { note: local.note } : {},
|
|
3440
|
+
records: local.records,
|
|
3441
|
+
ingested: local.ingested,
|
|
3442
|
+
skipped: local.skipped,
|
|
3443
|
+
refusals: local.refusals,
|
|
3444
|
+
rows: local.rows,
|
|
3445
|
+
dryRun: local.dry_run,
|
|
3446
|
+
redact,
|
|
3447
|
+
changed: local.changed,
|
|
3448
|
+
...local.kind ? { kind: local.kind } : {},
|
|
3449
|
+
...local.entity_counts ? { entityCounts: local.entity_counts } : {}
|
|
3450
|
+
};
|
|
3451
|
+
}
|
|
3452
|
+
async function sessionToolObservations(sessionId, options = {}) {
|
|
3453
|
+
const session = await apiRequest(
|
|
3454
|
+
options,
|
|
3455
|
+
"GET",
|
|
3456
|
+
`/api/public/sessions/${encodeURIComponent(sessionId)}?includeIO=true`
|
|
3457
|
+
);
|
|
3458
|
+
const out = [];
|
|
3459
|
+
for (const trace5 of session.traces ?? [])
|
|
3460
|
+
for (const observation of trace5.observations ?? []) out.push({ traceId: trace5.id ?? null, ...observation });
|
|
3461
|
+
return out;
|
|
3462
|
+
}
|
|
3463
|
+
var isObject2, isoOf;
|
|
3464
|
+
var init_ingest = __esm({
|
|
3465
|
+
"src/worlds/ingest.ts"() {
|
|
3466
|
+
"use strict";
|
|
3467
|
+
init_worlds();
|
|
3468
|
+
isObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3469
|
+
isoOf = (value) => value instanceof Date ? value.toISOString() : typeof value === "string" ? value : void 0;
|
|
3470
|
+
}
|
|
3471
|
+
});
|
|
3472
|
+
|
|
1681
3473
|
// src/worlds/index.ts
|
|
1682
3474
|
var worlds_exports = {};
|
|
1683
3475
|
__export(worlds_exports, {
|
|
@@ -1688,7 +3480,10 @@ __export(worlds_exports, {
|
|
|
1688
3480
|
EVENT_BATCH_SIZE: () => EVENT_BATCH_SIZE,
|
|
1689
3481
|
EVENT_FLUSH_INTERVAL_MS: () => EVENT_FLUSH_INTERVAL_MS,
|
|
1690
3482
|
EVENT_MAX_RETRIES: () => EVENT_MAX_RETRIES,
|
|
3483
|
+
STRIP_PREFIX: () => STRIP_PREFIX,
|
|
1691
3484
|
SURFACE_KINDS: () => SURFACE_KINDS,
|
|
3485
|
+
TRANSFORMS: () => TRANSFORMS,
|
|
3486
|
+
WHITESPACE: () => WHITESPACE,
|
|
1692
3487
|
WorldBrowser: () => WorldBrowser,
|
|
1693
3488
|
WorldSession: () => WorldSession,
|
|
1694
3489
|
WorldSessionCallError: () => WorldSessionCallError,
|
|
@@ -1697,8 +3492,10 @@ __export(worlds_exports, {
|
|
|
1697
3492
|
WorldSurfaceUnavailable: () => WorldSurfaceUnavailable,
|
|
1698
3493
|
WorldTask: () => WorldTask,
|
|
1699
3494
|
apiRequest: () => apiRequest,
|
|
3495
|
+
applyTransforms: () => applyTransforms,
|
|
1700
3496
|
attachSession: () => attachSession,
|
|
1701
3497
|
buildSourceTarball: () => buildSourceTarball,
|
|
3498
|
+
captureToolCalls: () => captureToolCalls,
|
|
1702
3499
|
collectArchiveRelPaths: () => collectArchiveRelPaths,
|
|
1703
3500
|
computeContentHash: () => computeContentHash,
|
|
1704
3501
|
computerUseToolkit: () => computerUseToolkit,
|
|
@@ -1706,9 +3503,13 @@ __export(worlds_exports, {
|
|
|
1706
3503
|
createTask: () => createTask,
|
|
1707
3504
|
deleteEnvSecret: () => deleteEnvSecret,
|
|
1708
3505
|
deleteTask: () => deleteTask,
|
|
3506
|
+
describeWorld: () => describeWorld,
|
|
1709
3507
|
detectProvenance: () => detectProvenance,
|
|
1710
3508
|
getRun: () => getRun,
|
|
1711
3509
|
getTask: () => getTask,
|
|
3510
|
+
hashForm: () => hashForm,
|
|
3511
|
+
ingest: () => ingest,
|
|
3512
|
+
ingestToolCalls: () => ingestToolCalls,
|
|
1712
3513
|
isIncludedInContentHash: () => isIncludedInContentHash,
|
|
1713
3514
|
isTaskIdRef: () => isTaskIdRef,
|
|
1714
3515
|
isTaskSpec: () => isTaskSpec,
|
|
@@ -1716,22 +3517,38 @@ __export(worlds_exports, {
|
|
|
1716
3517
|
listRunConfigs: () => listRunConfigs,
|
|
1717
3518
|
listTasks: () => listTasks,
|
|
1718
3519
|
localTreeState: () => localTreeState,
|
|
3520
|
+
migrateProjectWorlds: () => migrateProjectWorlds,
|
|
3521
|
+
migrateWorld: () => migrateWorld,
|
|
1719
3522
|
openBrowser: () => openBrowser,
|
|
1720
3523
|
openSession: () => openSession,
|
|
1721
3524
|
openWorld: () => openWorld,
|
|
3525
|
+
parseToolCallRecord: () => parseToolCallRecord,
|
|
3526
|
+
parseTransform: () => parseTransform,
|
|
1722
3527
|
parseWorldTaskRefs: () => parseWorldTaskRefs,
|
|
3528
|
+
preserveForm: () => preserveForm,
|
|
1723
3529
|
propose: () => propose,
|
|
1724
3530
|
pull: () => pull,
|
|
1725
3531
|
push: () => push,
|
|
3532
|
+
pyText: () => pyText,
|
|
3533
|
+
queryRows: () => queryRows,
|
|
3534
|
+
queryRowsSearch: () => queryRowsSearch,
|
|
1726
3535
|
readLocalMeta: () => readLocalMeta,
|
|
3536
|
+
readToolCallRecords: () => readToolCallRecords,
|
|
1727
3537
|
redactActionArgs: () => redactActionArgs,
|
|
3538
|
+
redactionOf: () => redactionOf,
|
|
1728
3539
|
resolveBrowserMode: () => resolveBrowserMode,
|
|
3540
|
+
roundForm: () => roundForm,
|
|
1729
3541
|
runSessions: () => runSessions,
|
|
1730
3542
|
schemaFromSignature: () => schemaFromSignature,
|
|
3543
|
+
sessionToolObservations: () => sessionToolObservations,
|
|
1731
3544
|
setEnvSecret: () => setEnvSecret,
|
|
3545
|
+
shapeText: () => shapeText,
|
|
1732
3546
|
snapshotTreeHashes: () => snapshotTreeHashes,
|
|
3547
|
+
storedForms: () => storedForms,
|
|
1733
3548
|
surfaceKinds: () => surfaceKinds,
|
|
1734
3549
|
taskLabel: () => taskLabel,
|
|
3550
|
+
toolCallRecordsIn: () => toolCallRecordsIn,
|
|
3551
|
+
toolCallsFromObservations: () => toolCallsFromObservations,
|
|
1735
3552
|
uiEntryUrl: () => uiEntryUrl,
|
|
1736
3553
|
uiUrl: () => uiUrl,
|
|
1737
3554
|
updateTask: () => updateTask,
|
|
@@ -1753,9 +3570,9 @@ function resolveEnv(options) {
|
|
|
1753
3570
|
}
|
|
1754
3571
|
return { host: host.replace(/\/+$/, ""), publicKey, secretKey };
|
|
1755
3572
|
}
|
|
1756
|
-
async function apiRequest(options, method,
|
|
3573
|
+
async function apiRequest(options, method, path9, body) {
|
|
1757
3574
|
const { host, publicKey, secretKey } = resolveEnv(options);
|
|
1758
|
-
const res = await fetch(`${host}${
|
|
3575
|
+
const res = await fetch(`${host}${path9}`, {
|
|
1759
3576
|
method,
|
|
1760
3577
|
headers: {
|
|
1761
3578
|
"content-type": "application/json",
|
|
@@ -1763,13 +3580,13 @@ async function apiRequest(options, method, path2, body) {
|
|
|
1763
3580
|
},
|
|
1764
3581
|
...body === void 0 ? {} : { body: JSON.stringify(body) }
|
|
1765
3582
|
});
|
|
1766
|
-
const
|
|
3583
|
+
const text2 = await res.text();
|
|
1767
3584
|
if (!res.ok) {
|
|
1768
3585
|
throw new Error(
|
|
1769
|
-
`${method} ${
|
|
3586
|
+
`${method} ${path9} -> ${res.status}: ${text2.slice(0, 400)}`
|
|
1770
3587
|
);
|
|
1771
3588
|
}
|
|
1772
|
-
return JSON.parse(
|
|
3589
|
+
return JSON.parse(text2);
|
|
1773
3590
|
}
|
|
1774
3591
|
async function setEnvSecret(slug, key, value, options = {}) {
|
|
1775
3592
|
return apiRequest(
|
|
@@ -1850,7 +3667,7 @@ async function waitForRun(runId, opts = {}) {
|
|
|
1850
3667
|
);
|
|
1851
3668
|
opts.onTick?.(run);
|
|
1852
3669
|
await new Promise(
|
|
1853
|
-
(
|
|
3670
|
+
(resolve7) => setTimeout(resolve7, (opts.intervalSeconds ?? 20) * 1e3)
|
|
1854
3671
|
);
|
|
1855
3672
|
}
|
|
1856
3673
|
}
|
|
@@ -1929,6 +3746,12 @@ var init_worlds = __esm({
|
|
|
1929
3746
|
init_browser();
|
|
1930
3747
|
init_hub();
|
|
1931
3748
|
init_validate();
|
|
3749
|
+
init_describe();
|
|
3750
|
+
init_redaction();
|
|
3751
|
+
init_transforms();
|
|
3752
|
+
init_query();
|
|
3753
|
+
init_migrate();
|
|
3754
|
+
init_ingest();
|
|
1932
3755
|
WorldTask = class {
|
|
1933
3756
|
constructor(world, name, variant) {
|
|
1934
3757
|
this.world = world;
|
|
@@ -1999,7 +3822,7 @@ var require_package = __commonJS({
|
|
|
1999
3822
|
"package.json"(exports, module) {
|
|
2000
3823
|
module.exports = {
|
|
2001
3824
|
name: "@withgateway/sdk",
|
|
2002
|
-
version: "0.2.
|
|
3825
|
+
version: "0.2.2",
|
|
2003
3826
|
description: "Gateway SDK for TypeScript - A/B experiments, tracing, and observability",
|
|
2004
3827
|
main: "./dist/index.js",
|
|
2005
3828
|
module: "./dist/index.mjs",
|
|
@@ -2064,6 +3887,21 @@ var require_package = __commonJS({
|
|
|
2064
3887
|
types: "./dist/worlds/index.d.ts",
|
|
2065
3888
|
import: "./dist/worlds/index.mjs",
|
|
2066
3889
|
require: "./dist/worlds/index.js"
|
|
3890
|
+
},
|
|
3891
|
+
"./files": {
|
|
3892
|
+
types: "./dist/files/index.d.ts",
|
|
3893
|
+
import: "./dist/files/index.mjs",
|
|
3894
|
+
require: "./dist/files/index.js"
|
|
3895
|
+
},
|
|
3896
|
+
"./traces": {
|
|
3897
|
+
types: "./dist/traces/index.d.ts",
|
|
3898
|
+
import: "./dist/traces/index.mjs",
|
|
3899
|
+
require: "./dist/traces/index.js"
|
|
3900
|
+
},
|
|
3901
|
+
"./cli": {
|
|
3902
|
+
types: "./dist/cli.d.ts",
|
|
3903
|
+
import: "./dist/cli.mjs",
|
|
3904
|
+
require: "./dist/cli.js"
|
|
2067
3905
|
}
|
|
2068
3906
|
},
|
|
2069
3907
|
files: [
|
|
@@ -2431,9 +4269,9 @@ var ExperimentClient = class {
|
|
|
2431
4269
|
})
|
|
2432
4270
|
});
|
|
2433
4271
|
if (!response.ok) {
|
|
2434
|
-
const
|
|
4272
|
+
const text2 = await response.text();
|
|
2435
4273
|
throw new Error(
|
|
2436
|
-
`Failed to sync experiment: ${response.status} ${response.statusText} - ${
|
|
4274
|
+
`Failed to sync experiment: ${response.status} ${response.statusText} - ${text2}`
|
|
2437
4275
|
);
|
|
2438
4276
|
}
|
|
2439
4277
|
console.log(`[gateway] Synced experiment '${config.key}' to backend`);
|
|
@@ -2743,8 +4581,8 @@ var GatewayContext = class _GatewayContext {
|
|
|
2743
4581
|
}
|
|
2744
4582
|
return resolved;
|
|
2745
4583
|
}
|
|
2746
|
-
async requestJson(method,
|
|
2747
|
-
const response = await fetch(`${this.host}${
|
|
4584
|
+
async requestJson(method, path9, payload) {
|
|
4585
|
+
const response = await fetch(`${this.host}${path9}`, {
|
|
2748
4586
|
method,
|
|
2749
4587
|
headers: {
|
|
2750
4588
|
Authorization: this.authHeader(),
|
|
@@ -2752,10 +4590,10 @@ var GatewayContext = class _GatewayContext {
|
|
|
2752
4590
|
},
|
|
2753
4591
|
...payload ? { body: JSON.stringify(payload) } : {}
|
|
2754
4592
|
});
|
|
2755
|
-
const
|
|
2756
|
-
const body =
|
|
4593
|
+
const text2 = await response.text();
|
|
4594
|
+
const body = text2 ? safeJson(text2) : {};
|
|
2757
4595
|
if (!response.ok) {
|
|
2758
|
-
const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${
|
|
4596
|
+
const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${path9}`;
|
|
2759
4597
|
if (response.status === 409) {
|
|
2760
4598
|
throw new GatewayContextConflictError(
|
|
2761
4599
|
message,
|
|
@@ -2764,7 +4602,7 @@ var GatewayContext = class _GatewayContext {
|
|
|
2764
4602
|
}
|
|
2765
4603
|
throw new GatewayContextError(message);
|
|
2766
4604
|
}
|
|
2767
|
-
this.log("%s %s -> %s", method,
|
|
4605
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
2768
4606
|
return body;
|
|
2769
4607
|
}
|
|
2770
4608
|
authHeader() {
|
|
@@ -2871,11 +4709,11 @@ function primaryPathForKind(kind, snapshot) {
|
|
|
2871
4709
|
const preferred = kind === "agent" ? "AGENTS.md" : kind === "prompt" ? "PROMPT.md" : kind === "skill" ? "SKILL.md" : "MEMORY.md";
|
|
2872
4710
|
if (readFile(snapshot, preferred)) return preferred;
|
|
2873
4711
|
return Object.entries(snapshot.files).find(
|
|
2874
|
-
([
|
|
4712
|
+
([path9, entry]) => entry.type === "file" && path9.endsWith(".md")
|
|
2875
4713
|
)?.[0] ?? null;
|
|
2876
4714
|
}
|
|
2877
|
-
function parseJsonFile(snapshot,
|
|
2878
|
-
const content = readFile(snapshot,
|
|
4715
|
+
function parseJsonFile(snapshot, path9) {
|
|
4716
|
+
const content = readFile(snapshot, path9);
|
|
2879
4717
|
if (!content) return {};
|
|
2880
4718
|
try {
|
|
2881
4719
|
const parsed = JSON.parse(content);
|
|
@@ -2884,8 +4722,8 @@ function parseJsonFile(snapshot, path2) {
|
|
|
2884
4722
|
return {};
|
|
2885
4723
|
}
|
|
2886
4724
|
}
|
|
2887
|
-
function readFile(snapshot,
|
|
2888
|
-
const entry = snapshot.files[
|
|
4725
|
+
function readFile(snapshot, path9) {
|
|
4726
|
+
const entry = snapshot.files[path9];
|
|
2889
4727
|
return entry?.type === "file" ? entry.content : null;
|
|
2890
4728
|
}
|
|
2891
4729
|
function provenanceFor(snapshot, label) {
|
|
@@ -2987,16 +4825,16 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
2987
4825
|
`/api/public/context/memory/${encodeIdentifier2(identifier)}${suffix}`
|
|
2988
4826
|
);
|
|
2989
4827
|
}
|
|
2990
|
-
async read(target,
|
|
4828
|
+
async read(target, path9, options = {}) {
|
|
2991
4829
|
const snapshot = typeof target === "string" ? await this.pull(target, options) : target;
|
|
2992
|
-
const file = snapshot.files[
|
|
4830
|
+
const file = snapshot.files[path9];
|
|
2993
4831
|
return file?.type === "file" ? file.content : null;
|
|
2994
4832
|
}
|
|
2995
|
-
async write(target,
|
|
4833
|
+
async write(target, path9, content, options = {}) {
|
|
2996
4834
|
const snapshot = typeof target === "string" ? await this.pull(target) : target;
|
|
2997
4835
|
return this.push(snapshot.repo.repoHandle, {
|
|
2998
4836
|
files: {
|
|
2999
|
-
[
|
|
4837
|
+
[path9]: {
|
|
3000
4838
|
content,
|
|
3001
4839
|
...options.mimeType ? { mimeType: options.mimeType } : {}
|
|
3002
4840
|
}
|
|
@@ -3006,10 +4844,10 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3006
4844
|
...runtimeContextPayload2(options)
|
|
3007
4845
|
});
|
|
3008
4846
|
}
|
|
3009
|
-
async delete(target,
|
|
4847
|
+
async delete(target, path9, options = {}) {
|
|
3010
4848
|
const snapshot = typeof target === "string" ? await this.pull(target) : target;
|
|
3011
4849
|
return this.push(snapshot.repo.repoHandle, {
|
|
3012
|
-
files: { [
|
|
4850
|
+
files: { [path9]: null },
|
|
3013
4851
|
parentCommit: options.parentCommit ?? snapshot.commit.commitHash,
|
|
3014
4852
|
message: options.message,
|
|
3015
4853
|
...runtimeContextPayload2(options)
|
|
@@ -3022,8 +4860,8 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3022
4860
|
payload
|
|
3023
4861
|
);
|
|
3024
4862
|
}
|
|
3025
|
-
async requestJson(method,
|
|
3026
|
-
const response = await fetch(`${this.host}${
|
|
4863
|
+
async requestJson(method, path9, payload) {
|
|
4864
|
+
const response = await fetch(`${this.host}${path9}`, {
|
|
3027
4865
|
method,
|
|
3028
4866
|
headers: {
|
|
3029
4867
|
Authorization: this.authHeader(),
|
|
@@ -3031,10 +4869,10 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3031
4869
|
},
|
|
3032
4870
|
...payload ? { body: JSON.stringify(payload) } : {}
|
|
3033
4871
|
});
|
|
3034
|
-
const
|
|
3035
|
-
const body =
|
|
4872
|
+
const text2 = await response.text();
|
|
4873
|
+
const body = text2 ? safeJson2(text2) : {};
|
|
3036
4874
|
if (!response.ok) {
|
|
3037
|
-
const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${
|
|
4875
|
+
const message = typeof body.message === "string" ? body.message : `Gateway API ${response.status} on ${path9}`;
|
|
3038
4876
|
if (response.status === 409) {
|
|
3039
4877
|
throw new GatewayMemoryConflictError(
|
|
3040
4878
|
message,
|
|
@@ -3043,7 +4881,7 @@ var GatewayMemory = class _GatewayMemory {
|
|
|
3043
4881
|
}
|
|
3044
4882
|
throw new GatewayMemoryError(message);
|
|
3045
4883
|
}
|
|
3046
|
-
this.log("%s %s -> %s", method,
|
|
4884
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
3047
4885
|
return body;
|
|
3048
4886
|
}
|
|
3049
4887
|
authHeader() {
|
|
@@ -3205,10 +5043,10 @@ var PersonasClient = class _PersonasClient {
|
|
|
3205
5043
|
done: Boolean(payload.done)
|
|
3206
5044
|
};
|
|
3207
5045
|
}
|
|
3208
|
-
async requestJson(method,
|
|
5046
|
+
async requestJson(method, path9, payload) {
|
|
3209
5047
|
let response;
|
|
3210
5048
|
try {
|
|
3211
|
-
response = await fetch(`${this.host}${
|
|
5049
|
+
response = await fetch(`${this.host}${path9}`, {
|
|
3212
5050
|
method,
|
|
3213
5051
|
headers: {
|
|
3214
5052
|
Authorization: this.authHeader(),
|
|
@@ -3219,19 +5057,19 @@ var PersonasClient = class _PersonasClient {
|
|
|
3219
5057
|
});
|
|
3220
5058
|
} catch (error) {
|
|
3221
5059
|
const reason = error instanceof Error ? error.message : String(error);
|
|
3222
|
-
throw new PersonaError(`${method} ${
|
|
5060
|
+
throw new PersonaError(`${method} ${path9} failed: ${reason}`, {
|
|
3223
5061
|
cause: error
|
|
3224
5062
|
});
|
|
3225
5063
|
}
|
|
3226
|
-
const
|
|
5064
|
+
const text2 = await response.text();
|
|
3227
5065
|
if (!response.ok) {
|
|
3228
|
-
const detail =
|
|
5066
|
+
const detail = text2.slice(0, 500);
|
|
3229
5067
|
throw new PersonaError(
|
|
3230
|
-
`${method} ${
|
|
5068
|
+
`${method} ${path9} failed (${response.status}): ${detail}`
|
|
3231
5069
|
);
|
|
3232
5070
|
}
|
|
3233
|
-
this.log("%s %s -> %s", method,
|
|
3234
|
-
return safeJson3(
|
|
5071
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
5072
|
+
return safeJson3(text2);
|
|
3235
5073
|
}
|
|
3236
5074
|
authHeader() {
|
|
3237
5075
|
return `Basic ${Buffer.from(`${this.publicKey}:${this.secretKey}`).toString(
|
|
@@ -3455,10 +5293,10 @@ var SessionRecording = class _SessionRecording {
|
|
|
3455
5293
|
};
|
|
3456
5294
|
}
|
|
3457
5295
|
/** Dump the full session as a JSON fixture (for regression tests). */
|
|
3458
|
-
toFixture(
|
|
3459
|
-
mkdirSync(dirname(
|
|
3460
|
-
writeFileSync(
|
|
3461
|
-
return
|
|
5296
|
+
toFixture(path9) {
|
|
5297
|
+
mkdirSync(dirname(path9), { recursive: true });
|
|
5298
|
+
writeFileSync(path9, JSON.stringify(this.toJSON(), null, 2), "utf-8");
|
|
5299
|
+
return path9;
|
|
3462
5300
|
}
|
|
3463
5301
|
static fromApi(raw) {
|
|
3464
5302
|
return new _SessionRecording({
|
|
@@ -3499,15 +5337,15 @@ async function loadSession(sessionId, options = {}) {
|
|
|
3499
5337
|
if (response.status === 404) {
|
|
3500
5338
|
throw new SessionLoadError(`Session not found: ${sessionId}`);
|
|
3501
5339
|
}
|
|
3502
|
-
const
|
|
5340
|
+
const text2 = await response.text();
|
|
3503
5341
|
if (!response.ok) {
|
|
3504
5342
|
throw new SessionLoadError(
|
|
3505
|
-
`Failed to load session ${sessionId}: HTTP ${response.status} \u2014 ${
|
|
5343
|
+
`Failed to load session ${sessionId}: HTTP ${response.status} \u2014 ${text2.slice(0, 300)}`
|
|
3506
5344
|
);
|
|
3507
5345
|
}
|
|
3508
5346
|
let payload;
|
|
3509
5347
|
try {
|
|
3510
|
-
payload = JSON.parse(
|
|
5348
|
+
payload = JSON.parse(text2);
|
|
3511
5349
|
} catch (error) {
|
|
3512
5350
|
throw new SessionLoadError(
|
|
3513
5351
|
`Failed to load session ${sessionId}: response is not valid JSON`,
|
|
@@ -4055,13 +5893,13 @@ var ReplaySuite = class _ReplaySuite {
|
|
|
4055
5893
|
if (response.status === 404) {
|
|
4056
5894
|
return null;
|
|
4057
5895
|
}
|
|
4058
|
-
const
|
|
5896
|
+
const text2 = await response.text();
|
|
4059
5897
|
if (!response.ok) {
|
|
4060
5898
|
throw new ReplayError(
|
|
4061
|
-
`Failed to list tasks for ${datasetId}: HTTP ${response.status} \u2014 ${
|
|
5899
|
+
`Failed to list tasks for ${datasetId}: HTTP ${response.status} \u2014 ${text2.slice(0, 300)}`
|
|
4062
5900
|
);
|
|
4063
5901
|
}
|
|
4064
|
-
const payload = parseJsonObject(
|
|
5902
|
+
const payload = parseJsonObject(text2);
|
|
4065
5903
|
const pageTasks = Array.isArray(payload.tasks) ? payload.tasks : [];
|
|
4066
5904
|
tasks.push(...pageTasks.filter(isPlainObject2));
|
|
4067
5905
|
if (tasks.length >= Number(payload.totalTasks ?? 0)) {
|
|
@@ -4078,13 +5916,13 @@ var ReplaySuite = class _ReplaySuite {
|
|
|
4078
5916
|
`${host}/api/public/task-sets?name=${encodeURIComponent(nameOrId)}`,
|
|
4079
5917
|
{ headers, signal: AbortSignal.timeout(timeoutSeconds * 1e3) }
|
|
4080
5918
|
);
|
|
4081
|
-
const
|
|
5919
|
+
const text2 = await response.text();
|
|
4082
5920
|
if (!response.ok) {
|
|
4083
5921
|
throw new ReplayError(
|
|
4084
|
-
`Failed to resolve task set '${nameOrId}': HTTP ${response.status} \u2014 ${
|
|
5922
|
+
`Failed to resolve task set '${nameOrId}': HTTP ${response.status} \u2014 ${text2.slice(0, 300)}`
|
|
4085
5923
|
);
|
|
4086
5924
|
}
|
|
4087
|
-
const payload = parseJsonObject(
|
|
5925
|
+
const payload = parseJsonObject(text2);
|
|
4088
5926
|
const matches = Array.isArray(payload.taskSets) ? payload.taskSets.filter(isPlainObject2) : [];
|
|
4089
5927
|
if (matches.length === 0) {
|
|
4090
5928
|
throw new ReplayError(`Task set not found: ${nameOrId}`);
|
|
@@ -4207,8 +6045,8 @@ async function recordRunItem(suiteToRecord, testCase, runName, traceId, triage,
|
|
|
4207
6045
|
if (response.status === 200) {
|
|
4208
6046
|
return null;
|
|
4209
6047
|
}
|
|
4210
|
-
const
|
|
4211
|
-
lastError = `HTTP ${response.status}: ${
|
|
6048
|
+
const text2 = await response.text();
|
|
6049
|
+
lastError = `HTTP ${response.status}: ${text2.slice(0, 200)}`;
|
|
4212
6050
|
if (response.status !== 404) {
|
|
4213
6051
|
return lastError;
|
|
4214
6052
|
}
|
|
@@ -4281,9 +6119,9 @@ function suite(nameOrId, options = {}) {
|
|
|
4281
6119
|
function isPlainObject2(value) {
|
|
4282
6120
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4283
6121
|
}
|
|
4284
|
-
function parseJsonObject(
|
|
6122
|
+
function parseJsonObject(text2) {
|
|
4285
6123
|
try {
|
|
4286
|
-
const parsed = JSON.parse(
|
|
6124
|
+
const parsed = JSON.parse(text2);
|
|
4287
6125
|
return isPlainObject2(parsed) ? parsed : {};
|
|
4288
6126
|
} catch {
|
|
4289
6127
|
return {};
|
|
@@ -4293,7 +6131,7 @@ function randomHex() {
|
|
|
4293
6131
|
return crypto.randomUUID().replace(/-/g, "");
|
|
4294
6132
|
}
|
|
4295
6133
|
function sleep(ms) {
|
|
4296
|
-
return new Promise((
|
|
6134
|
+
return new Promise((resolve7) => setTimeout(resolve7, ms));
|
|
4297
6135
|
}
|
|
4298
6136
|
var replay = {
|
|
4299
6137
|
suite,
|
|
@@ -4380,7 +6218,7 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4380
6218
|
const descriptors = entries.map(
|
|
4381
6219
|
([key, tool]) => this.describeTool(key, tool, options)
|
|
4382
6220
|
);
|
|
4383
|
-
const
|
|
6221
|
+
const resolve7 = await this.resolveToolset({
|
|
4384
6222
|
agent: this.agent,
|
|
4385
6223
|
toolsetId: options.toolsetId,
|
|
4386
6224
|
toolsetName: options.toolsetName,
|
|
@@ -4390,8 +6228,8 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4390
6228
|
});
|
|
4391
6229
|
const securedEntries = entries.flatMap(([key, tool]) => {
|
|
4392
6230
|
const descriptor = descriptors.find((item) => item.name === key);
|
|
4393
|
-
if (!this.shouldExposeTool(
|
|
4394
|
-
this.log("Hiding tool %s in %s mode", descriptor.id,
|
|
6231
|
+
if (!this.shouldExposeTool(resolve7, descriptor.id)) {
|
|
6232
|
+
this.log("Hiding tool %s in %s mode", descriptor.id, resolve7.mode);
|
|
4395
6233
|
return [];
|
|
4396
6234
|
}
|
|
4397
6235
|
return [
|
|
@@ -4401,7 +6239,7 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4401
6239
|
toolId: descriptor.id,
|
|
4402
6240
|
toolsetId: options.toolsetId,
|
|
4403
6241
|
context: this.normalizeContext(options.context),
|
|
4404
|
-
resolve:
|
|
6242
|
+
resolve: resolve7
|
|
4405
6243
|
})
|
|
4406
6244
|
]
|
|
4407
6245
|
];
|
|
@@ -4489,8 +6327,8 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4489
6327
|
);
|
|
4490
6328
|
}
|
|
4491
6329
|
}
|
|
4492
|
-
async postJson(
|
|
4493
|
-
const response = await fetch(`${this.host}${
|
|
6330
|
+
async postJson(path9, payload) {
|
|
6331
|
+
const response = await fetch(`${this.host}${path9}`, {
|
|
4494
6332
|
method: "POST",
|
|
4495
6333
|
headers: {
|
|
4496
6334
|
Authorization: this.authHeader(),
|
|
@@ -4501,7 +6339,7 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4501
6339
|
if (!response.ok) {
|
|
4502
6340
|
const body = await response.text();
|
|
4503
6341
|
throw new GatewaySecurityError(
|
|
4504
|
-
`Gateway API ${response.status} on ${
|
|
6342
|
+
`Gateway API ${response.status} on ${path9}: ${body || response.statusText}`
|
|
4505
6343
|
);
|
|
4506
6344
|
}
|
|
4507
6345
|
return await response.json();
|
|
@@ -4516,9 +6354,9 @@ var GatewaySecurity = class _GatewaySecurity {
|
|
|
4516
6354
|
metadata: options.toolMetadata?.[key] ?? {}
|
|
4517
6355
|
};
|
|
4518
6356
|
}
|
|
4519
|
-
shouldExposeTool(
|
|
4520
|
-
if (
|
|
4521
|
-
if (
|
|
6357
|
+
shouldExposeTool(resolve7, toolId) {
|
|
6358
|
+
if (resolve7.mode === "observe") return true;
|
|
6359
|
+
if (resolve7.blockedToolIds.includes(toolId)) return false;
|
|
4522
6360
|
return true;
|
|
4523
6361
|
}
|
|
4524
6362
|
normalizeContext(context4) {
|
|
@@ -4670,10 +6508,10 @@ var UsersClient = class _UsersClient {
|
|
|
4670
6508
|
params.set("toTimestamp", filter.toTimestamp.toISOString());
|
|
4671
6509
|
if (filter.page) params.set("page", String(filter.page));
|
|
4672
6510
|
if (filter.limit) params.set("limit", String(filter.limit));
|
|
4673
|
-
const
|
|
6511
|
+
const qs3 = params.toString();
|
|
4674
6512
|
const payload = await this.requestJson(
|
|
4675
6513
|
"GET",
|
|
4676
|
-
`/api/public/user-events${
|
|
6514
|
+
`/api/public/user-events${qs3 ? `?${qs3}` : ""}`
|
|
4677
6515
|
);
|
|
4678
6516
|
const rows = Array.isArray(payload.data) ? payload.data : [];
|
|
4679
6517
|
const meta = payload.meta && typeof payload.meta === "object" ? payload.meta : {};
|
|
@@ -4682,10 +6520,10 @@ var UsersClient = class _UsersClient {
|
|
|
4682
6520
|
totalItems: Number(meta.totalItems ?? rows.length)
|
|
4683
6521
|
};
|
|
4684
6522
|
}
|
|
4685
|
-
async requestJson(method,
|
|
6523
|
+
async requestJson(method, path9, payload) {
|
|
4686
6524
|
let response;
|
|
4687
6525
|
try {
|
|
4688
|
-
response = await fetch(`${this.host}${
|
|
6526
|
+
response = await fetch(`${this.host}${path9}`, {
|
|
4689
6527
|
method,
|
|
4690
6528
|
headers: {
|
|
4691
6529
|
Authorization: this.authHeader(),
|
|
@@ -4696,18 +6534,18 @@ var UsersClient = class _UsersClient {
|
|
|
4696
6534
|
});
|
|
4697
6535
|
} catch (error) {
|
|
4698
6536
|
throw new UserProfileError(
|
|
4699
|
-
`${method} ${
|
|
6537
|
+
`${method} ${path9} failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
4700
6538
|
{ cause: error }
|
|
4701
6539
|
);
|
|
4702
6540
|
}
|
|
4703
|
-
const
|
|
6541
|
+
const text2 = await response.text();
|
|
4704
6542
|
if (!response.ok) {
|
|
4705
6543
|
throw new UserProfileError(
|
|
4706
|
-
`${method} ${
|
|
6544
|
+
`${method} ${path9} failed (${response.status}): ${text2.slice(0, 500)}`
|
|
4707
6545
|
);
|
|
4708
6546
|
}
|
|
4709
|
-
this.log("%s %s -> %s", method,
|
|
4710
|
-
return safeJson4(
|
|
6547
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
6548
|
+
return safeJson4(text2);
|
|
4711
6549
|
}
|
|
4712
6550
|
authHeader() {
|
|
4713
6551
|
return `Basic ${Buffer.from(`${this.publicKey}:${this.secretKey}`).toString(
|
|
@@ -4910,10 +6748,10 @@ var ScoresClient = class _ScoresClient {
|
|
|
4910
6748
|
metadata: signalMetadata
|
|
4911
6749
|
});
|
|
4912
6750
|
}
|
|
4913
|
-
async request(method,
|
|
6751
|
+
async request(method, path9, payload) {
|
|
4914
6752
|
let response;
|
|
4915
6753
|
try {
|
|
4916
|
-
response = await fetch(`${this.host}${
|
|
6754
|
+
response = await fetch(`${this.host}${path9}`, {
|
|
4917
6755
|
method,
|
|
4918
6756
|
headers: {
|
|
4919
6757
|
Authorization: this.authHeader(),
|
|
@@ -4924,17 +6762,17 @@ var ScoresClient = class _ScoresClient {
|
|
|
4924
6762
|
});
|
|
4925
6763
|
} catch (error) {
|
|
4926
6764
|
throw new ScoreError(
|
|
4927
|
-
`${method} ${
|
|
6765
|
+
`${method} ${path9} failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
4928
6766
|
{ cause: error }
|
|
4929
6767
|
);
|
|
4930
6768
|
}
|
|
4931
|
-
const
|
|
6769
|
+
const text2 = await response.text();
|
|
4932
6770
|
if (!response.ok) {
|
|
4933
6771
|
throw new ScoreError(
|
|
4934
|
-
`${method} ${
|
|
6772
|
+
`${method} ${path9} failed (${response.status}): ${text2.slice(0, 500)}`
|
|
4935
6773
|
);
|
|
4936
6774
|
}
|
|
4937
|
-
this.log("%s %s -> %s", method,
|
|
6775
|
+
this.log("%s %s -> %s", method, path9, response.status);
|
|
4938
6776
|
}
|
|
4939
6777
|
authHeader() {
|
|
4940
6778
|
return `Basic ${Buffer.from(`${this.publicKey}:${this.secretKey}`).toString(
|
|
@@ -4975,8 +6813,287 @@ var scores = {
|
|
|
4975
6813
|
init_worlds();
|
|
4976
6814
|
init_session();
|
|
4977
6815
|
|
|
6816
|
+
// src/files/index.ts
|
|
6817
|
+
var files_exports = {};
|
|
6818
|
+
__export(files_exports, {
|
|
6819
|
+
DRIVE_PREFIX: () => DRIVE_PREFIX,
|
|
6820
|
+
confirmUpload: () => confirmUpload,
|
|
6821
|
+
contentTypeFor: () => contentTypeFor,
|
|
6822
|
+
createFolder: () => createFolder,
|
|
6823
|
+
deleteFile: () => deleteFile,
|
|
6824
|
+
downloadFile: () => downloadFile,
|
|
6825
|
+
drivePath: () => drivePath,
|
|
6826
|
+
getFile: () => getFile,
|
|
6827
|
+
isDriveRef: () => isDriveRef,
|
|
6828
|
+
iterateFiles: () => iterateFiles,
|
|
6829
|
+
listFileConnectors: () => listFileConnectors,
|
|
6830
|
+
listFiles: () => listFiles,
|
|
6831
|
+
moveFile: () => moveFile,
|
|
6832
|
+
readFile: () => readFile2,
|
|
6833
|
+
requestUpload: () => requestUpload,
|
|
6834
|
+
sha256Base64: () => sha256Base64,
|
|
6835
|
+
syncFileConnector: () => syncFileConnector,
|
|
6836
|
+
uploadBytes: () => uploadBytes,
|
|
6837
|
+
uploadFile: () => uploadFile
|
|
6838
|
+
});
|
|
6839
|
+
init_worlds();
|
|
6840
|
+
import { createHash as createHash7 } from "crypto";
|
|
6841
|
+
import * as fs9 from "fs";
|
|
6842
|
+
import * as path8 from "path";
|
|
6843
|
+
import { Readable, Transform } from "stream";
|
|
6844
|
+
import { pipeline } from "stream/promises";
|
|
6845
|
+
var DRIVE_PREFIX = "drive:";
|
|
6846
|
+
function isDriveRef(value) {
|
|
6847
|
+
return value.startsWith(DRIVE_PREFIX);
|
|
6848
|
+
}
|
|
6849
|
+
function drivePath(ref) {
|
|
6850
|
+
const raw = isDriveRef(ref) ? ref.slice(DRIVE_PREFIX.length) : ref;
|
|
6851
|
+
const trimmed = raw.replace(/^\/+/, "");
|
|
6852
|
+
if (!trimmed) throw new Error(`${ref} names no file in the drive`);
|
|
6853
|
+
return trimmed;
|
|
6854
|
+
}
|
|
6855
|
+
var PAGE_LIMIT = 200;
|
|
6856
|
+
var BASE = "/api/public/files";
|
|
6857
|
+
function qs(params) {
|
|
6858
|
+
const search = new URLSearchParams();
|
|
6859
|
+
for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== "") search.set(key, String(value));
|
|
6860
|
+
const text2 = search.toString();
|
|
6861
|
+
return text2 ? `?${text2}` : "";
|
|
6862
|
+
}
|
|
6863
|
+
async function listFiles(options = {}, params = {}) {
|
|
6864
|
+
return apiRequest(options, "GET", `${BASE}${qs({ prefix: params.prefix, page: params.page, limit: params.limit })}`);
|
|
6865
|
+
}
|
|
6866
|
+
async function* iterateFiles(options = {}, prefix) {
|
|
6867
|
+
for (let page = 0; ; page++) {
|
|
6868
|
+
const listing = await listFiles(options, { prefix, page, limit: PAGE_LIMIT });
|
|
6869
|
+
yield* listing.files;
|
|
6870
|
+
const seen = (page + 1) * listing.limit;
|
|
6871
|
+
if (!listing.files.length || seen >= listing.totalFiles) return;
|
|
6872
|
+
}
|
|
6873
|
+
}
|
|
6874
|
+
async function getFile(options = {}, filePath) {
|
|
6875
|
+
return apiRequest(options, "GET", `${BASE}/download${qs({ path: drivePath(filePath) })}`);
|
|
6876
|
+
}
|
|
6877
|
+
async function openDownload(url) {
|
|
6878
|
+
const res = await fetch(url);
|
|
6879
|
+
if (!res.ok || !res.body) throw new Error(`download failed: storage answered HTTP ${res.status}`);
|
|
6880
|
+
return res;
|
|
6881
|
+
}
|
|
6882
|
+
async function readFile2(options = {}, filePath) {
|
|
6883
|
+
const file = await getFile(options, filePath);
|
|
6884
|
+
const res = await openDownload(file.url);
|
|
6885
|
+
return Buffer.from(await res.arrayBuffer());
|
|
6886
|
+
}
|
|
6887
|
+
async function downloadFile(options = {}, filePath, outPath, onProgress) {
|
|
6888
|
+
const file = await getFile(options, filePath);
|
|
6889
|
+
const res = await openDownload(file.url);
|
|
6890
|
+
fs9.mkdirSync(path8.dirname(path8.resolve(outPath)), { recursive: true });
|
|
6891
|
+
const source = Readable.fromWeb(res.body);
|
|
6892
|
+
await pipeline(source, counting((n) => onProgress?.(n, file.sizeBytes)), fs9.createWriteStream(outPath));
|
|
6893
|
+
return { ...file, out: outPath };
|
|
6894
|
+
}
|
|
6895
|
+
async function requestUpload(options = {}, body) {
|
|
6896
|
+
return apiRequest(options, "POST", BASE, body);
|
|
6897
|
+
}
|
|
6898
|
+
async function confirmUpload(options = {}, fileId, ok = true) {
|
|
6899
|
+
return apiRequest(options, "POST", `${BASE}/confirm`, { fileId, ok });
|
|
6900
|
+
}
|
|
6901
|
+
async function sha256Base64(localPath) {
|
|
6902
|
+
const hash = createHash7("sha256");
|
|
6903
|
+
for await (const chunk of fs9.createReadStream(localPath)) hash.update(chunk);
|
|
6904
|
+
return hash.digest("base64");
|
|
6905
|
+
}
|
|
6906
|
+
var CONTENT_TYPES = {
|
|
6907
|
+
".json": "application/json",
|
|
6908
|
+
".jsonl": "application/x-ndjson",
|
|
6909
|
+
".ndjson": "application/x-ndjson",
|
|
6910
|
+
".csv": "text/csv",
|
|
6911
|
+
".tsv": "text/tab-separated-values",
|
|
6912
|
+
".txt": "text/plain",
|
|
6913
|
+
".md": "text/markdown",
|
|
6914
|
+
".toml": "application/toml",
|
|
6915
|
+
".yaml": "application/yaml",
|
|
6916
|
+
".yml": "application/yaml",
|
|
6917
|
+
".xml": "application/xml",
|
|
6918
|
+
".html": "text/html",
|
|
6919
|
+
".sql": "application/sql",
|
|
6920
|
+
".py": "text/x-python",
|
|
6921
|
+
".ts": "text/plain",
|
|
6922
|
+
".js": "text/javascript",
|
|
6923
|
+
".pdf": "application/pdf",
|
|
6924
|
+
".png": "image/png",
|
|
6925
|
+
".jpg": "image/jpeg",
|
|
6926
|
+
".jpeg": "image/jpeg",
|
|
6927
|
+
".gif": "image/gif",
|
|
6928
|
+
".webp": "image/webp",
|
|
6929
|
+
".svg": "image/svg+xml",
|
|
6930
|
+
".zip": "application/zip",
|
|
6931
|
+
".gz": "application/gzip",
|
|
6932
|
+
".tar": "application/x-tar",
|
|
6933
|
+
".parquet": "application/vnd.apache.parquet",
|
|
6934
|
+
".wav": "audio/wav",
|
|
6935
|
+
".mp3": "audio/mpeg",
|
|
6936
|
+
".mp4": "video/mp4"
|
|
6937
|
+
};
|
|
6938
|
+
function contentTypeFor(name) {
|
|
6939
|
+
return CONTENT_TYPES[path8.extname(name).toLowerCase()] ?? "application/octet-stream";
|
|
6940
|
+
}
|
|
6941
|
+
function counting(report) {
|
|
6942
|
+
let seen = 0;
|
|
6943
|
+
return new Transform({
|
|
6944
|
+
transform(chunk, _encoding, callback) {
|
|
6945
|
+
seen += chunk.length;
|
|
6946
|
+
report(seen);
|
|
6947
|
+
callback(null, chunk);
|
|
6948
|
+
}
|
|
6949
|
+
});
|
|
6950
|
+
}
|
|
6951
|
+
async function putPresigned(uploadUrl, body, headers) {
|
|
6952
|
+
const res = await fetch(uploadUrl, {
|
|
6953
|
+
method: "PUT",
|
|
6954
|
+
headers: {
|
|
6955
|
+
"content-type": headers.contentType,
|
|
6956
|
+
"content-length": String(headers.contentLength),
|
|
6957
|
+
"x-amz-checksum-sha256": headers.sha256
|
|
6958
|
+
},
|
|
6959
|
+
body,
|
|
6960
|
+
// A streamed request body needs the half-duplex declaration (Node's fetch).
|
|
6961
|
+
duplex: "half"
|
|
6962
|
+
});
|
|
6963
|
+
if (!res.ok) throw new Error(`upload failed: storage answered HTTP ${res.status}: ${(await res.text()).slice(0, 300)}`);
|
|
6964
|
+
}
|
|
6965
|
+
async function uploadFile(options = {}, localPath, targetPath, upload = {}) {
|
|
6966
|
+
const stat = fs9.statSync(localPath);
|
|
6967
|
+
if (!stat.isFile()) throw new Error(`${localPath} is not a file`);
|
|
6968
|
+
if (stat.size === 0) throw new Error(`${localPath} is empty; the drive refuses zero-byte uploads`);
|
|
6969
|
+
const contentType = upload.contentType ?? contentTypeFor(localPath);
|
|
6970
|
+
const sha2562 = await sha256Base64(localPath);
|
|
6971
|
+
const target = drivePath(targetPath);
|
|
6972
|
+
const granted = await requestUpload(options, { path: target, contentLength: stat.size, contentType, sha256: sha2562, ...upload.overwrite ? { overwrite: true } : {} });
|
|
6973
|
+
try {
|
|
6974
|
+
const stream = fs9.createReadStream(localPath).pipe(counting((n) => upload.onProgress?.(n, stat.size)));
|
|
6975
|
+
await putPresigned(granted.uploadUrl, Readable.toWeb(stream), { contentType, contentLength: stat.size, sha256: sha2562 });
|
|
6976
|
+
} catch (error) {
|
|
6977
|
+
await confirmUpload(options, granted.fileId, false).catch(() => void 0);
|
|
6978
|
+
throw error;
|
|
6979
|
+
}
|
|
6980
|
+
const confirmed = await confirmUpload(options, granted.fileId, true);
|
|
6981
|
+
return { path: confirmed.path, fileId: granted.fileId, sizeBytes: stat.size, sha256: sha2562, contentType };
|
|
6982
|
+
}
|
|
6983
|
+
async function uploadBytes(options = {}, bytes, targetPath, upload = {}) {
|
|
6984
|
+
if (!bytes.length) throw new Error("nothing to upload: the content is empty");
|
|
6985
|
+
const target = drivePath(targetPath);
|
|
6986
|
+
const contentType = upload.contentType ?? contentTypeFor(target);
|
|
6987
|
+
const sha2562 = createHash7("sha256").update(bytes).digest("base64");
|
|
6988
|
+
const granted = await requestUpload(options, { path: target, contentLength: bytes.length, contentType, sha256: sha2562, ...upload.overwrite ? { overwrite: true } : {} });
|
|
6989
|
+
try {
|
|
6990
|
+
await putPresigned(granted.uploadUrl, new Uint8Array(bytes), { contentType, contentLength: bytes.length, sha256: sha2562 });
|
|
6991
|
+
} catch (error) {
|
|
6992
|
+
await confirmUpload(options, granted.fileId, false).catch(() => void 0);
|
|
6993
|
+
throw error;
|
|
6994
|
+
}
|
|
6995
|
+
const confirmed = await confirmUpload(options, granted.fileId, true);
|
|
6996
|
+
return { path: confirmed.path, fileId: granted.fileId, sizeBytes: bytes.length, sha256: sha2562, contentType };
|
|
6997
|
+
}
|
|
6998
|
+
async function deleteFile(options = {}, filePath) {
|
|
6999
|
+
return apiRequest(options, "DELETE", `${BASE}${qs({ path: drivePath(filePath) })}`);
|
|
7000
|
+
}
|
|
7001
|
+
async function moveFile(options = {}, fromPath, toPath) {
|
|
7002
|
+
return apiRequest(options, "POST", `${BASE}/move`, { fromPath: drivePath(fromPath), toPath: drivePath(toPath) });
|
|
7003
|
+
}
|
|
7004
|
+
async function createFolder(options = {}, folderPath) {
|
|
7005
|
+
return apiRequest(options, "POST", `${BASE}/folders`, { path: drivePath(folderPath) });
|
|
7006
|
+
}
|
|
7007
|
+
async function listFileConnectors(options = {}) {
|
|
7008
|
+
return apiRequest(options, "GET", `${BASE}/connectors`);
|
|
7009
|
+
}
|
|
7010
|
+
async function syncFileConnector(options = {}, connectorId) {
|
|
7011
|
+
return apiRequest(options, "POST", `${BASE}/connectors/sync`, { connectorId });
|
|
7012
|
+
}
|
|
7013
|
+
|
|
7014
|
+
// src/traces/index.ts
|
|
7015
|
+
var traces_exports = {};
|
|
7016
|
+
__export(traces_exports, {
|
|
7017
|
+
PAGE_LIMIT: () => PAGE_LIMIT2,
|
|
7018
|
+
exportTraces: () => exportTraces,
|
|
7019
|
+
getSession: () => getSession,
|
|
7020
|
+
getTrace: () => getTrace,
|
|
7021
|
+
iterateObservations: () => iterateObservations,
|
|
7022
|
+
iterateSessions: () => iterateSessions,
|
|
7023
|
+
iterateTraces: () => iterateTraces,
|
|
7024
|
+
listObservations: () => listObservations,
|
|
7025
|
+
listSessions: () => listSessions,
|
|
7026
|
+
listTraces: () => listTraces
|
|
7027
|
+
});
|
|
7028
|
+
init_worlds();
|
|
7029
|
+
var PAGE_LIMIT2 = 100;
|
|
7030
|
+
function qs2(params) {
|
|
7031
|
+
const search = new URLSearchParams();
|
|
7032
|
+
for (const [key, value] of Object.entries(params)) {
|
|
7033
|
+
if (value === void 0 || value === null || value === "") continue;
|
|
7034
|
+
if (Array.isArray(value)) for (const item of value) search.append(key, item);
|
|
7035
|
+
else search.set(key, String(value));
|
|
7036
|
+
}
|
|
7037
|
+
const text2 = search.toString();
|
|
7038
|
+
return text2 ? `?${text2}` : "";
|
|
7039
|
+
}
|
|
7040
|
+
async function listTraces(options = {}, filters = {}, page = {}) {
|
|
7041
|
+
const { tags, ...rest } = filters;
|
|
7042
|
+
return apiRequest(options, "GET", `/api/public/traces${qs2({ ...rest, tags, page: page.page ?? 1, limit: page.limit ?? 50, fields: page.fields })}`);
|
|
7043
|
+
}
|
|
7044
|
+
async function* iterateTraces(options = {}, filters = {}, limits = {}) {
|
|
7045
|
+
yield* paged((page) => listTraces(options, filters, { page, limit: PAGE_LIMIT2, fields: limits.fields }), limits.max);
|
|
7046
|
+
}
|
|
7047
|
+
async function getTrace(options = {}, traceId) {
|
|
7048
|
+
return apiRequest(options, "GET", `/api/public/traces/${encodeURIComponent(traceId)}`);
|
|
7049
|
+
}
|
|
7050
|
+
async function listObservations(options = {}, filters = {}, page = {}) {
|
|
7051
|
+
return apiRequest(options, "GET", `/api/public/observations${qs2({ ...filters, page: page.page ?? 1, limit: page.limit ?? 50 })}`);
|
|
7052
|
+
}
|
|
7053
|
+
async function* iterateObservations(options = {}, filters = {}, limits = {}) {
|
|
7054
|
+
yield* paged((page) => listObservations(options, filters, { page, limit: PAGE_LIMIT2 }), limits.max);
|
|
7055
|
+
}
|
|
7056
|
+
async function listSessions(options = {}, filters = {}, page = {}) {
|
|
7057
|
+
return apiRequest(options, "GET", `/api/public/sessions${qs2({ ...filters, page: page.page ?? 1, limit: page.limit ?? 50 })}`);
|
|
7058
|
+
}
|
|
7059
|
+
async function* iterateSessions(options = {}, filters = {}, limits = {}) {
|
|
7060
|
+
yield* paged((page) => listSessions(options, filters, { page, limit: PAGE_LIMIT2 }), limits.max);
|
|
7061
|
+
}
|
|
7062
|
+
async function getSession(options = {}, sessionId, detail = {}) {
|
|
7063
|
+
return apiRequest(options, "GET", `/api/public/sessions/${encodeURIComponent(sessionId)}${qs2({ includeIO: detail.includeIO ? "true" : void 0 })}`);
|
|
7064
|
+
}
|
|
7065
|
+
async function exportTraces(options = {}, filters = {}, exportOptions = {}, write) {
|
|
7066
|
+
const summary = { traces: 0, observations: 0 };
|
|
7067
|
+
const wantedType = exportOptions.type?.toUpperCase();
|
|
7068
|
+
for await (const trace5 of iterateTraces(options, filters, { max: exportOptions.max })) {
|
|
7069
|
+
let record = trace5;
|
|
7070
|
+
if (exportOptions.observations) {
|
|
7071
|
+
const detail = await getTrace(options, trace5.id);
|
|
7072
|
+
const observations = wantedType ? detail.observations.filter((o) => o.type?.toUpperCase() === wantedType) : detail.observations;
|
|
7073
|
+
summary.observations += observations.length;
|
|
7074
|
+
record = { ...detail, observations };
|
|
7075
|
+
}
|
|
7076
|
+
summary.traces++;
|
|
7077
|
+
write(record);
|
|
7078
|
+
}
|
|
7079
|
+
return summary;
|
|
7080
|
+
}
|
|
7081
|
+
async function* paged(fetchPage, max) {
|
|
7082
|
+
let yielded = 0;
|
|
7083
|
+
for (let page = 1; ; page++) {
|
|
7084
|
+
const answer = await fetchPage(page);
|
|
7085
|
+
for (const item of answer.data) {
|
|
7086
|
+
if (max !== void 0 && yielded >= max) return;
|
|
7087
|
+
yielded++;
|
|
7088
|
+
yield item;
|
|
7089
|
+
}
|
|
7090
|
+
const totalPages = answer.meta?.totalPages ?? (answer.data.length < PAGE_LIMIT2 ? page : page + 1);
|
|
7091
|
+
if (!answer.data.length || page >= totalPages) return;
|
|
7092
|
+
}
|
|
7093
|
+
}
|
|
7094
|
+
|
|
4978
7095
|
// src/build/index.ts
|
|
4979
|
-
import { createHash as
|
|
7096
|
+
import { createHash as createHash8 } from "crypto";
|
|
4980
7097
|
function canonicalJson(value) {
|
|
4981
7098
|
if (value === null || typeof value !== "object") {
|
|
4982
7099
|
return JSON.stringify(value);
|
|
@@ -4987,8 +7104,8 @@ function canonicalJson(value) {
|
|
|
4987
7104
|
const entries = Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
4988
7105
|
return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${canonicalJson(v)}`).join(",")}}`;
|
|
4989
7106
|
}
|
|
4990
|
-
function sha256(
|
|
4991
|
-
return `sha256:${
|
|
7107
|
+
function sha256(text2) {
|
|
7108
|
+
return `sha256:${createHash8("sha256").update(text2).digest("hex")}`;
|
|
4992
7109
|
}
|
|
4993
7110
|
var registeredTools = /* @__PURE__ */ new Map();
|
|
4994
7111
|
var registeredPrompts = /* @__PURE__ */ new Map();
|
|
@@ -5757,12 +7874,12 @@ async function* observeClaude(stream, options) {
|
|
|
5757
7874
|
pendingTurnInput = "";
|
|
5758
7875
|
}
|
|
5759
7876
|
const childCtx = options.perTurn ? turnCtx : rootCtx;
|
|
5760
|
-
let
|
|
7877
|
+
let text2 = "";
|
|
5761
7878
|
const toolUses = [];
|
|
5762
7879
|
for (const block of message.message?.content ?? []) {
|
|
5763
7880
|
if (block?.type === "text") {
|
|
5764
7881
|
finalText += block.text;
|
|
5765
|
-
|
|
7882
|
+
text2 += block.text;
|
|
5766
7883
|
}
|
|
5767
7884
|
if (block?.type === "tool_use") {
|
|
5768
7885
|
toolUses.push({
|
|
@@ -5772,7 +7889,7 @@ async function* observeClaude(stream, options) {
|
|
|
5772
7889
|
});
|
|
5773
7890
|
}
|
|
5774
7891
|
}
|
|
5775
|
-
turnText +=
|
|
7892
|
+
turnText += text2;
|
|
5776
7893
|
const gen = tracer.startSpan(
|
|
5777
7894
|
"assistant",
|
|
5778
7895
|
{
|
|
@@ -5780,7 +7897,7 @@ async function* observeClaude(stream, options) {
|
|
|
5780
7897
|
"openinference.span.kind": "LLM",
|
|
5781
7898
|
"llm.model_name": model,
|
|
5782
7899
|
"llm.provider": "anthropic",
|
|
5783
|
-
"output.value":
|
|
7900
|
+
"output.value": text2 || toolUses.map((t) => `\u2192 ${cleanToolName(t.name)}`).join(", ")
|
|
5784
7901
|
}
|
|
5785
7902
|
},
|
|
5786
7903
|
childCtx
|
|
@@ -5896,6 +8013,7 @@ export {
|
|
|
5896
8013
|
ReplayReport,
|
|
5897
8014
|
ReplaySuite,
|
|
5898
8015
|
ReplayTask,
|
|
8016
|
+
STRIP_PREFIX,
|
|
5899
8017
|
SUCCESS_METRIC_NAME_KEY,
|
|
5900
8018
|
SUCCESS_SIGNAL_KEY,
|
|
5901
8019
|
SURFACE_KINDS,
|
|
@@ -5905,10 +8023,12 @@ export {
|
|
|
5905
8023
|
SessionRecording,
|
|
5906
8024
|
SessionTrace,
|
|
5907
8025
|
StubMissError,
|
|
8026
|
+
TRANSFORMS,
|
|
5908
8027
|
ToolStubRegistry,
|
|
5909
8028
|
TraceDiff,
|
|
5910
8029
|
UserProfileError,
|
|
5911
8030
|
UsersClient,
|
|
8031
|
+
WHITESPACE,
|
|
5912
8032
|
WorldBrowser,
|
|
5913
8033
|
WorldSession,
|
|
5914
8034
|
WorldSessionCallError,
|
|
@@ -5918,12 +8038,14 @@ export {
|
|
|
5918
8038
|
WorldTask,
|
|
5919
8039
|
addExperimentAttributes,
|
|
5920
8040
|
apiRequest,
|
|
8041
|
+
applyTransforms,
|
|
5921
8042
|
assembleManifest,
|
|
5922
8043
|
assignVariant,
|
|
5923
8044
|
attachSession,
|
|
5924
8045
|
basicAuthHeader,
|
|
5925
8046
|
buildSourceTarball,
|
|
5926
8047
|
canonicalJson,
|
|
8048
|
+
captureToolCalls,
|
|
5927
8049
|
clearExperimentContext,
|
|
5928
8050
|
collectArchiveRelPaths,
|
|
5929
8051
|
computeBuildHash,
|
|
@@ -5937,9 +8059,11 @@ export {
|
|
|
5937
8059
|
defineTool,
|
|
5938
8060
|
deleteEnvSecret,
|
|
5939
8061
|
deleteTask,
|
|
8062
|
+
describeWorld,
|
|
5940
8063
|
detectProvenance,
|
|
5941
8064
|
experimentContextStorage,
|
|
5942
8065
|
singleton_exports as experiments,
|
|
8066
|
+
files_exports as files,
|
|
5943
8067
|
gateway,
|
|
5944
8068
|
getExperimentContext,
|
|
5945
8069
|
getRegisteredArtifacts,
|
|
@@ -5948,7 +8072,10 @@ export {
|
|
|
5948
8072
|
getRegisteredTools,
|
|
5949
8073
|
getRun,
|
|
5950
8074
|
getTask,
|
|
8075
|
+
hashForm,
|
|
5951
8076
|
identify,
|
|
8077
|
+
ingest,
|
|
8078
|
+
ingestToolCalls,
|
|
5952
8079
|
isIncludedInContentHash,
|
|
5953
8080
|
isTaskIdRef,
|
|
5954
8081
|
isTaskSpec,
|
|
@@ -5958,16 +8085,26 @@ export {
|
|
|
5958
8085
|
loadSession,
|
|
5959
8086
|
localTreeState,
|
|
5960
8087
|
memory,
|
|
8088
|
+
migrateProjectWorlds,
|
|
8089
|
+
migrateWorld,
|
|
5961
8090
|
openBrowser,
|
|
5962
8091
|
openSession,
|
|
5963
8092
|
openWorld,
|
|
8093
|
+
parseToolCallRecord,
|
|
8094
|
+
parseTransform,
|
|
5964
8095
|
parseWorldTaskRefs,
|
|
5965
8096
|
personas,
|
|
8097
|
+
preserveForm,
|
|
5966
8098
|
propose,
|
|
5967
8099
|
pull,
|
|
5968
8100
|
push,
|
|
8101
|
+
pyText,
|
|
8102
|
+
queryRows,
|
|
8103
|
+
queryRowsSearch,
|
|
5969
8104
|
readLocalMeta,
|
|
8105
|
+
readToolCallRecords,
|
|
5970
8106
|
redactActionArgs,
|
|
8107
|
+
redactionOf,
|
|
5971
8108
|
registerArtifact,
|
|
5972
8109
|
registerPrompt,
|
|
5973
8110
|
registerSkill,
|
|
@@ -5976,20 +8113,27 @@ export {
|
|
|
5976
8113
|
resetBuildRegistry,
|
|
5977
8114
|
resolveBrowserMode,
|
|
5978
8115
|
resolveUserId,
|
|
8116
|
+
roundForm,
|
|
5979
8117
|
runSessions,
|
|
5980
8118
|
runSuite,
|
|
5981
8119
|
runWithExperimentContext,
|
|
5982
8120
|
schemaFromSignature,
|
|
5983
8121
|
scores,
|
|
5984
8122
|
sessionObservationFromApi,
|
|
8123
|
+
sessionToolObservations,
|
|
5985
8124
|
sessions,
|
|
5986
8125
|
setEnvSecret,
|
|
5987
8126
|
setExperimentContext,
|
|
8127
|
+
shapeText,
|
|
5988
8128
|
snapshotTreeHashes,
|
|
8129
|
+
storedForms,
|
|
5989
8130
|
success,
|
|
5990
8131
|
suite,
|
|
5991
8132
|
surfaceKinds,
|
|
5992
8133
|
taskLabel,
|
|
8134
|
+
toolCallRecordsIn,
|
|
8135
|
+
toolCallsFromObservations,
|
|
8136
|
+
traces_exports as traces,
|
|
5993
8137
|
tracing,
|
|
5994
8138
|
uiEntryUrl,
|
|
5995
8139
|
uiUrl,
|