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