@opengeni/api-router 0.30.1 → 1.0.0
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/dist/access-grant-rls.d.ts +3 -0
- package/dist/admission-trace.d.ts +8 -0
- package/dist/api-websocket.d.ts +18 -0
- package/dist/app.d.ts +50 -2
- package/dist/app.js +12 -1
- package/dist/artifact-catalog-cursor.d.ts +27 -0
- package/dist/auth/managed-auth-attempt-context.d.ts +10 -0
- package/dist/auth/managed-auth-rate-limits.d.ts +167 -0
- package/dist/auth/managed-auth-session-adapter.d.ts +6 -0
- package/dist/auth/managed-auth.d.ts +102 -3
- package/dist/auth/managed-email.d.ts +29 -0
- package/dist/auth/managed-sign-in-notifications.d.ts +4 -0
- package/dist/auth/new-signups-gate.d.ts +23 -0
- package/dist/auth/organization-user-setup.d.ts +80 -0
- package/dist/auth/signup-funnel-metrics.d.ts +44 -0
- package/dist/browser-controller-authority.d.ts +1 -61
- package/dist/browser-ephemeral.d.ts +5 -0
- package/dist/browser-state-authority.d.ts +1 -27
- package/dist/chunk-6TZ5LG3O.js +123948 -0
- package/dist/chunk-6TZ5LG3O.js.map +1 -0
- package/dist/chunk-OGQDXVXY.js +18 -0
- package/dist/chunk-OGQDXVXY.js.map +1 -0
- package/dist/claude-subscription-account-conflicts.d.ts +1 -0
- package/dist/claude-subscription-account-usage.d.ts +39 -0
- package/dist/claude-subscription-oauth.d.ts +25 -0
- package/dist/claude-subscription-profile.d.ts +9 -0
- package/dist/claude-subscription-usage.d.ts +44 -0
- package/dist/claude-workspace-connection.d.ts +15 -0
- package/dist/codemode.d.ts +32 -1
- package/dist/company-brain-okf.d.ts +24 -0
- package/dist/connected-machine-computer-access.d.ts +11 -0
- package/dist/connection-ownership.d.ts +54 -0
- package/dist/controller-data-plane.d.ts +32 -0
- package/dist/editable-artifact-office-import.d.ts +7 -4
- package/dist/editable-artifact-source-session.d.ts +3 -0
- package/dist/editable-artifact-websocket.d.ts +10 -18
- package/dist/editable-artifact-workspace-files.d.ts +1 -1
- package/dist/fatal-process-boundary.d.ts +25 -0
- package/dist/github-access.d.ts +31 -2
- package/dist/http/acting-person.d.ts +24 -0
- package/dist/http/api-contract-compat.d.ts +19 -0
- package/dist/http/api-error.d.ts +27 -1
- package/dist/http/cors.d.ts +17 -0
- package/dist/http/deprecation.d.ts +42 -0
- package/dist/http/interaction-control-error.d.ts +13 -0
- package/dist/http/keyed-admission.d.ts +12 -0
- package/dist/http/local-browser-boundary.d.ts +72 -0
- package/dist/http/metrics-listener.d.ts +22 -0
- package/dist/http/path-identifier.d.ts +17 -0
- package/dist/http/registered-route-label.d.ts +16 -0
- package/dist/http/request-body.d.ts +27 -0
- package/dist/http/request-source.d.ts +52 -0
- package/dist/http/sse.d.ts +17 -6
- package/dist/http/unmatched-route.d.ts +18 -0
- package/dist/http/user-content.d.ts +36 -0
- package/dist/http/websocket-upgrade-dispatch.d.ts +18 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.js +1129 -166
- package/dist/index.js.map +1 -1
- package/dist/integration-endpoint-test.d.ts +20 -0
- package/dist/integrations/api-integrations.d.ts +2 -2
- package/dist/integrations/atlassian.d.ts +29 -3
- package/dist/integrations/connect-authority.d.ts +1 -0
- package/dist/integrations/connect-callback-return.d.ts +6 -0
- package/dist/integrations/fiken.d.ts +16 -2
- package/dist/integrations/github-app-connect.d.ts +47 -0
- package/dist/integrations/github-installation-proof.d.ts +3 -0
- package/dist/integrations/github-lens-connect.d.ts +116 -0
- package/dist/integrations/github-skill-source.d.ts +1 -5
- package/dist/integrations/google-drive.d.ts +25 -0
- package/dist/integrations/integration-commit-authority.d.ts +13 -0
- package/dist/integrations/marketplace-plugin.d.ts +2691 -0
- package/dist/integrations/oauth-client.d.ts +178 -18
- package/dist/integrations/oauth-profiles.d.ts +222 -0
- package/dist/integrations/oauth-return-path.d.ts +1 -0
- package/dist/integrations/personal-github-repositories.d.ts +84 -0
- package/dist/integrations/personal-github.d.ts +42 -0
- package/dist/integrations/pr-review-provider.d.ts +22 -0
- package/dist/integrations/provider-oauth.d.ts +19 -1
- package/dist/integrations/slack-app-home.d.ts +24 -0
- package/dist/integrations/slack-bot.d.ts +367 -12
- package/dist/integrations/slack-file-upload-flow.d.ts +62 -0
- package/dist/integrations/slack-install.d.ts +20 -0
- package/dist/integrations/slack-interactions.d.ts +113 -10
- package/dist/integrations/slack-mrkdwn.d.ts +41 -0
- package/dist/integrations/slack-routing.d.ts +120 -0
- package/dist/integrations/slack-session-defaults.d.ts +58 -0
- package/dist/integrations/slack-task-file-upload.d.ts +36 -0
- package/dist/integrations/social-oauth.d.ts +7 -0
- package/dist/interaction-agent-access.d.ts +15 -0
- package/dist/interaction-frame-proxy.d.ts +68 -0
- package/dist/interaction-metrics.d.ts +2 -0
- package/dist/mcp/action-catalog-types.d.ts +9 -0
- package/dist/mcp/action-catalog.gen.d.ts +2 -0
- package/dist/mcp/capability-account-readiness.d.ts +7 -0
- package/dist/mcp/child-read-evidence.d.ts +9 -0
- package/dist/mcp/command-read.d.ts +24 -0
- package/dist/mcp/company-profile-agent-admin.d.ts +44 -0
- package/dist/mcp/contract-input.d.ts +11 -0
- package/dist/mcp/documents.d.ts +7 -5
- package/dist/mcp/files.d.ts +2 -2
- package/dist/mcp/first-party-tool-permissions.d.ts +650 -0
- package/dist/mcp/knowledge-entries.d.ts +5 -0
- package/dist/mcp/orchestration-failure-diagnostic.d.ts +43 -0
- package/dist/mcp/receipts.d.ts +9 -0
- package/dist/mcp/request-abort.d.ts +19 -0
- package/dist/mcp/scheduled-task-input.d.ts +1189 -0
- package/dist/mcp/scheduled-task-view.d.ts +22 -4
- package/dist/mcp/server.d.ts +255 -3
- package/dist/mcp/session-event-view.d.ts +94 -0
- package/dist/mcp/session-view.d.ts +66 -2
- package/dist/mcp/session-wait.d.ts +174 -0
- package/dist/mcp-oauth.d.ts +52 -0
- package/dist/model-catalog.d.ts +11 -31
- package/dist/observability.d.ts +3 -1
- package/dist/organization-mcp.d.ts +52 -0
- package/dist/organization-recovery-notifications.d.ts +41 -0
- package/dist/routes/analytics-consent.d.ts +26 -0
- package/dist/routes/api-integrations.d.ts +25 -0
- package/dist/routes/api-keys.d.ts +17 -0
- package/dist/routes/artifact-catalog.d.ts +6 -0
- package/dist/routes/automations.d.ts +19 -0
- package/dist/routes/billing.d.ts +49 -0
- package/dist/routes/browser-sessions.d.ts +71 -3
- package/dist/routes/claude-subscription-accounts.d.ts +3 -0
- package/dist/routes/claude-subscription-oauth.d.ts +3 -0
- package/dist/routes/client-errors.d.ts +146 -0
- package/dist/routes/codex.d.ts +76 -2
- package/dist/routes/company-brain.d.ts +3 -0
- package/dist/routes/company-profile.d.ts +2 -1
- package/dist/routes/computer-sessions.d.ts +14 -0
- package/dist/routes/connect.d.ts +5 -0
- package/dist/routes/editable-artifacts.d.ts +2 -0
- package/dist/routes/external-identity-links.d.ts +6 -0
- package/dist/routes/feedback.d.ts +3 -0
- package/dist/routes/files.d.ts +4 -0
- package/dist/routes/github-browser-pages.d.ts +12 -0
- package/dist/routes/github.d.ts +2 -0
- package/dist/routes/insights-response-cache.d.ts +10 -0
- package/dist/routes/insights-usage.d.ts +12 -0
- package/dist/routes/insights.d.ts +30 -1
- package/dist/routes/knowledge.d.ts +3 -0
- package/dist/routes/managed-auth-session-sets.d.ts +26 -0
- package/dist/routes/managed-onboarding.d.ts +29 -0
- package/dist/routes/managed-sign-in-methods.d.ts +6 -0
- package/dist/routes/model-connection-access.d.ts +3 -0
- package/dist/routes/organization-integration-policy.d.ts +3 -0
- package/dist/routes/organization-integrations.d.ts +6 -0
- package/dist/routes/organization-mcp-connections.d.ts +3 -0
- package/dist/routes/organization-model-providers.d.ts +3 -0
- package/dist/routes/organization-recovery.d.ts +19 -0
- package/dist/routes/organization-service-accounts.d.ts +3 -0
- package/dist/routes/organization-sessions.d.ts +26 -0
- package/dist/routes/personal-github-git-broker.d.ts +29 -0
- package/dist/routes/personal-github.d.ts +3 -0
- package/dist/routes/pr-review-github.d.ts +3 -0
- package/dist/routes/pr-review.d.ts +3 -0
- package/dist/routes/session-artifact-associations.d.ts +4 -0
- package/dist/routes/session-history-imports.d.ts +9 -0
- package/dist/routes/sessions.d.ts +44 -6
- package/dist/routes/skill-content.d.ts +4 -0
- package/dist/routes/skill-install-authority.d.ts +6 -0
- package/dist/routes/subscription-account-pools.d.ts +34 -0
- package/dist/routes/subscription-pool-access.d.ts +16 -0
- package/dist/routes/supergrok.d.ts +6 -1
- package/dist/routes/usage-allowances.d.ts +12 -0
- package/dist/routes/user-resource-authorities.d.ts +3 -0
- package/dist/routes/workspace-artifacts.d.ts +2 -1
- package/dist/routes/workspace-capture.d.ts +10 -2
- package/dist/routes/workspace-integrations.d.ts +35 -0
- package/dist/routes/workspace-learning.d.ts +3 -0
- package/dist/routes/workspace-model-providers.d.ts +4 -0
- package/dist/routes/workspaces.d.ts +29 -0
- package/dist/sandbox/auth-callout.d.ts +8 -0
- package/dist/sandbox/channel-a.d.ts +19 -1
- package/dist/sandbox/connection-authority.d.ts +3 -0
- package/dist/sandbox/enrollment.d.ts +9 -1
- package/dist/sandbox/machines.d.ts +5 -2
- package/dist/sandbox/metrics-ingestion.d.ts +28 -20
- package/dist/sandbox/rematerialize.d.ts +2 -0
- package/dist/sandbox/session-attach-variable-sets.d.ts +30 -0
- package/dist/sandbox/viewer.d.ts +26 -1
- package/dist/sandbox-file-artifacts.d.ts +50 -0
- package/dist/scheduled-task-deletion.d.ts +13 -0
- package/dist/session-create-observability.d.ts +5 -0
- package/dist/session-event-view-MPS2OZD3.js +292 -0
- package/dist/session-event-view-MPS2OZD3.js.map +1 -0
- package/dist/site-session-origin.d.ts +13 -0
- package/dist/site-uploads.d.ts +41 -0
- package/dist/slack-reaction-files.d.ts +1 -1
- package/dist/temporal-schedule-cleanup.d.ts +1 -0
- package/dist/temporal-schedule-sync.d.ts +26 -0
- package/dist/transcription/providers/xai-subscription.d.ts +1 -0
- package/dist/transcription/service.d.ts +2 -1
- package/dist/work-discovery-observability.d.ts +33 -0
- package/dist/workspace-artifact-content.d.ts +28 -0
- package/dist/workspace-artifact-provenance.d.ts +7 -0
- package/dist/workspace-delete-observability.d.ts +10 -0
- package/dist/workspace-deletion.d.ts +6 -0
- package/dist/workspace-state-projection.d.ts +3 -5
- package/dist/workspace-tool-gateway-observability.d.ts +17 -0
- package/dist/workspace-tool-gateway.d.ts +123 -0
- package/dist/workspace-webhook-dispatch.d.ts +26 -0
- package/package.json +23 -19
- package/src/access-grant-rls.ts +75 -0
- package/src/admission-trace.ts +14 -0
- package/src/api-websocket.ts +23 -0
- package/src/app.ts +1974 -256
- package/src/artifact-catalog-cursor.ts +60 -0
- package/src/auth/managed-auth-attempt-context.ts +70 -0
- package/src/auth/managed-auth-rate-limits.ts +252 -0
- package/src/auth/managed-auth-session-adapter.ts +222 -0
- package/src/auth/managed-auth.ts +536 -60
- package/src/auth/managed-email.ts +174 -0
- package/src/auth/managed-sign-in-notifications.ts +81 -0
- package/src/auth/new-signups-gate.ts +49 -0
- package/src/auth/organization-user-setup.ts +307 -0
- package/src/auth/signup-funnel-metrics.ts +164 -0
- package/src/browser-controller-authority.ts +1 -186
- package/src/browser-ephemeral.ts +39 -0
- package/src/browser-state-authority.ts +1 -236
- package/src/claude-subscription-account-conflicts.ts +12 -0
- package/src/claude-subscription-account-usage.ts +48 -0
- package/src/claude-subscription-oauth.ts +362 -0
- package/src/claude-subscription-profile.ts +73 -0
- package/src/claude-subscription-usage.ts +97 -0
- package/src/claude-workspace-connection.ts +82 -0
- package/src/codemode.ts +194 -30
- package/src/codex-realtime.ts +8 -2
- package/src/company-brain-okf.ts +340 -0
- package/src/connected-machine-computer-access.ts +33 -0
- package/src/connection-ownership.ts +199 -0
- package/src/controller-data-plane.ts +81 -0
- package/src/editable-artifact-native-kernel.ts +26 -15
- package/src/editable-artifact-office-import.ts +77 -9
- package/src/editable-artifact-production.ts +23 -7
- package/src/editable-artifact-source-session.ts +123 -0
- package/src/editable-artifact-websocket.ts +27 -21
- package/src/editable-artifact-workspace-files.ts +31 -6
- package/src/fatal-process-boundary.ts +246 -0
- package/src/gateway-realtime.ts +1 -1
- package/src/github-access.ts +147 -5
- package/src/http/acting-person.ts +71 -0
- package/src/http/api-contract-compat.ts +49 -0
- package/src/http/api-error.ts +115 -1
- package/src/http/auth.ts +48 -0
- package/src/http/cors.ts +67 -0
- package/src/http/deprecation.ts +118 -0
- package/src/http/interaction-control-error.ts +164 -0
- package/src/http/keyed-admission.ts +29 -0
- package/src/http/local-browser-boundary.ts +343 -0
- package/src/http/metrics-listener.ts +57 -0
- package/src/http/path-identifier.ts +54 -0
- package/src/http/registered-route-label.ts +34 -0
- package/src/http/request-body.ts +127 -0
- package/src/http/request-source.ts +178 -0
- package/src/http/sse.ts +486 -132
- package/src/http/unmatched-route.ts +60 -0
- package/src/http/user-content.ts +158 -0
- package/src/http/websocket-upgrade-dispatch.ts +29 -0
- package/src/index.ts +157 -52
- package/src/integration-endpoint-test.ts +291 -0
- package/src/integrations/api-integrations.ts +98 -11
- package/src/integrations/atlassian.ts +474 -136
- package/src/integrations/connect-authority.ts +2 -0
- package/src/integrations/connect-callback-return.ts +86 -0
- package/src/integrations/fiken.ts +354 -64
- package/src/integrations/github-app-connect.ts +435 -0
- package/src/integrations/github-installation-proof.ts +60 -0
- package/src/integrations/github-lens-connect.ts +76 -0
- package/src/integrations/github-skill-source.ts +2 -142
- package/src/integrations/google-drive.ts +820 -222
- package/src/integrations/integration-commit-authority.ts +69 -0
- package/src/integrations/marketplace-plugin.ts +48 -0
- package/src/integrations/oauth-client.ts +1356 -459
- package/src/integrations/oauth-profiles.ts +537 -0
- package/src/integrations/oauth-return-path.ts +18 -0
- package/src/integrations/personal-github-repositories.ts +674 -0
- package/src/integrations/personal-github.ts +825 -0
- package/src/integrations/pr-review-provider.ts +246 -0
- package/src/integrations/provider-oauth.ts +250 -22
- package/src/integrations/slack-app-home.ts +300 -0
- package/src/integrations/slack-bot.ts +963 -239
- package/src/integrations/slack-file-upload-flow.ts +147 -0
- package/src/integrations/slack-install.ts +83 -0
- package/src/integrations/slack-interactions.ts +3170 -474
- package/src/integrations/slack-mrkdwn.ts +193 -0
- package/src/integrations/slack-routing.ts +337 -0
- package/src/integrations/slack-session-defaults.ts +224 -0
- package/src/integrations/slack-task-file-upload.ts +323 -0
- package/src/integrations/social-oauth.ts +213 -15
- package/src/interaction-agent-access.ts +48 -0
- package/src/interaction-frame-proxy.ts +409 -0
- package/src/interaction-metrics.ts +30 -0
- package/src/mcp/action-catalog-types.ts +9 -0
- package/src/mcp/action-catalog.gen.ts +6696 -0
- package/src/mcp/capability-account-readiness.ts +17 -0
- package/src/mcp/child-read-evidence.ts +19 -0
- package/src/mcp/command-read.ts +109 -0
- package/src/mcp/company-profile-agent-admin.ts +198 -0
- package/src/mcp/contract-input.ts +141 -0
- package/src/mcp/documents.ts +65 -377
- package/src/mcp/editable-artifacts.ts +12 -6
- package/src/mcp/files.ts +80 -38
- package/src/mcp/first-party-tool-permissions.ts +305 -0
- package/src/mcp/knowledge-entries.ts +322 -0
- package/src/mcp/orchestration-failure-diagnostic.ts +43 -0
- package/src/mcp/receipts.ts +34 -0
- package/src/mcp/request-abort.ts +44 -0
- package/src/mcp/scheduled-task-input.ts +76 -0
- package/src/mcp/scheduled-task-view.ts +44 -3
- package/src/mcp/server.ts +3030 -1267
- package/src/mcp/session-event-view.ts +383 -0
- package/src/mcp/session-view.ts +84 -3
- package/src/mcp/session-wait.ts +665 -0
- package/src/mcp-oauth.ts +1123 -0
- package/src/model-catalog.ts +91 -333
- package/src/observability.ts +15 -1
- package/src/organization-mcp.ts +397 -0
- package/src/organization-recovery-notifications.ts +103 -0
- package/src/routes/analytics-consent.ts +123 -0
- package/src/routes/api-integrations.ts +364 -74
- package/src/routes/api-keys.ts +336 -10
- package/src/routes/artifact-catalog.ts +279 -0
- package/src/routes/automations.ts +768 -0
- package/src/routes/billing.ts +461 -46
- package/src/routes/browser-sessions.ts +839 -131
- package/src/routes/canonical-human-identities.ts +90 -14
- package/src/routes/capabilities.ts +107 -6
- package/src/routes/channels.ts +20 -3
- package/src/routes/claude-subscription-accounts.ts +334 -0
- package/src/routes/claude-subscription-oauth.ts +142 -0
- package/src/routes/client-errors.ts +362 -0
- package/src/routes/codex.ts +833 -116
- package/src/routes/company-brain.ts +322 -0
- package/src/routes/company-profile.ts +65 -1
- package/src/routes/computer-sessions.ts +557 -106
- package/src/routes/connect.ts +1938 -0
- package/src/routes/connections.ts +1040 -349
- package/src/routes/documents.ts +488 -287
- package/src/routes/editable-artifacts.ts +79 -9
- package/src/routes/enrollments.ts +135 -39
- package/src/routes/environments.ts +154 -58
- package/src/routes/external-identity-links.ts +201 -0
- package/src/routes/feedback.ts +113 -0
- package/src/routes/files.ts +337 -39
- package/src/routes/github-browser-pages.ts +162 -0
- package/src/routes/github.ts +446 -144
- package/src/routes/insights-response-cache.ts +83 -0
- package/src/routes/insights-usage.ts +345 -0
- package/src/routes/insights.ts +153 -19
- package/src/routes/install.ts +133 -38
- package/src/routes/integration-facets.ts +107 -33
- package/src/routes/interaction-resources.ts +30 -3
- package/src/routes/knowledge.ts +488 -0
- package/src/routes/machines.ts +313 -15
- package/src/routes/managed-auth-session-sets.ts +1218 -0
- package/src/routes/managed-onboarding.ts +337 -0
- package/src/routes/managed-sign-in-methods.ts +433 -0
- package/src/routes/memory-slack-publications.ts +3 -2
- package/src/routes/model-connection-access.ts +208 -0
- package/src/routes/organization-integration-policy.ts +116 -0
- package/src/routes/organization-integrations.ts +326 -0
- package/src/routes/organization-mcp-connections.ts +178 -0
- package/src/routes/organization-memberships.ts +1019 -27
- package/src/routes/organization-model-providers.ts +293 -0
- package/src/routes/organization-recovery.ts +325 -0
- package/src/routes/organization-service-accounts.ts +128 -0
- package/src/routes/organization-sessions.ts +350 -0
- package/src/routes/personal-github-git-broker.ts +785 -0
- package/src/routes/personal-github.ts +370 -0
- package/src/routes/plugins.ts +251 -22
- package/src/routes/pr-review-github.ts +881 -0
- package/src/routes/pr-review.ts +622 -0
- package/src/routes/preference-registry.ts +12 -93
- package/src/routes/rigs.ts +167 -50
- package/src/routes/scheduled-tasks.ts +346 -41
- package/src/routes/session-artifact-associations.ts +87 -0
- package/src/routes/session-history-imports.ts +280 -0
- package/src/routes/sessions.ts +2306 -264
- package/src/routes/skill-content.ts +297 -0
- package/src/routes/skill-install-authority.ts +64 -0
- package/src/routes/skills.ts +62 -9
- package/src/routes/social.ts +46 -18
- package/src/routes/subscription-account-pools.ts +436 -0
- package/src/routes/subscription-pool-access.ts +126 -0
- package/src/routes/supergrok.ts +219 -303
- package/src/routes/transcription-recordings.ts +38 -3
- package/src/routes/transcriptions.ts +4 -0
- package/src/routes/usage-allowances.ts +378 -0
- package/src/routes/user-resource-authorities.ts +138 -0
- package/src/routes/video-generation.ts +14 -10
- package/src/routes/workspace-artifacts.ts +275 -69
- package/src/routes/workspace-capture.ts +21 -0
- package/src/routes/workspace-integrations.ts +576 -0
- package/src/routes/workspace-learning.ts +159 -0
- package/src/routes/workspace-model-providers.ts +148 -0
- package/src/routes/workspace-state.ts +38 -25
- package/src/routes/workspaces.ts +1004 -127
- package/src/sandbox/auth-callout.ts +96 -19
- package/src/sandbox/channel-a.ts +323 -24
- package/src/sandbox/connection-authority.ts +3 -0
- package/src/sandbox/enrollment.ts +81 -6
- package/src/sandbox/machines.ts +218 -76
- package/src/sandbox/metrics-ingestion.ts +411 -62
- package/src/sandbox/rematerialize.ts +121 -19
- package/src/sandbox/session-attach-variable-sets.ts +131 -0
- package/src/sandbox/viewer.ts +280 -25
- package/src/sandbox-file-artifacts.ts +413 -0
- package/src/scheduled-task-deletion.ts +138 -0
- package/src/session-create-observability.ts +46 -0
- package/src/session-realtime-context.ts +6 -3
- package/src/site-session-origin.ts +48 -0
- package/src/site-uploads.ts +224 -0
- package/src/slack-reaction-files.ts +16 -5
- package/src/temporal-schedule-cleanup.ts +13 -0
- package/src/temporal-schedule-sync.ts +74 -0
- package/src/transcription/providers/codex-subscription.ts +2 -0
- package/src/transcription/providers/openai.ts +1 -0
- package/src/transcription/providers/xai-subscription.ts +49 -3
- package/src/transcription/segmenter.ts +8 -2
- package/src/transcription/service.ts +43 -6
- package/src/work-discovery-observability.ts +121 -0
- package/src/workspace-artifact-content.ts +144 -0
- package/src/workspace-artifact-provenance.ts +104 -0
- package/src/workspace-delete-observability.ts +75 -0
- package/src/workspace-deletion.ts +73 -0
- package/src/workspace-state-projection.ts +18 -148
- package/src/workspace-tool-gateway-observability.ts +100 -0
- package/src/workspace-tool-gateway.ts +870 -0
- package/src/workspace-webhook-dispatch.ts +190 -0
- package/src/xai-subscription-auth.ts +9 -2
- package/dist/chunk-2PQMSRCB.js +0 -49759
- package/dist/chunk-2PQMSRCB.js.map +0 -1
- package/dist/routes/packs.d.ts +0 -3
- package/src/routes/packs.ts +0 -729
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { withOrganizationIntegrationAcquisition } from "@opengeni/db/organization-integration-policy";
|
|
2
|
+
import { claimOAuthAcquisition, finishOAuthAcquisition } from "./oauth-client";
|
|
1
3
|
import { parseSocialOauthClientsJson, type Settings } from "@opengeni/config";
|
|
2
4
|
import {
|
|
3
5
|
OAuthStartResponse,
|
|
@@ -15,6 +17,8 @@ import {
|
|
|
15
17
|
loadSocialConnectionCredential,
|
|
16
18
|
updateSocialConnectionCredential,
|
|
17
19
|
upsertSocialOAuthConnection,
|
|
20
|
+
finishConnectOperation,
|
|
21
|
+
getConnectAttempt,
|
|
18
22
|
type Database,
|
|
19
23
|
} from "@opengeni/db";
|
|
20
24
|
import { createSignedState, readSignedState } from "@opengeni/github";
|
|
@@ -22,11 +26,20 @@ import { OAUTH_MAX_RESPONSE_BYTES, pinnedFetch, readResponseJsonBounded } from "
|
|
|
22
26
|
import { Buffer } from "node:buffer";
|
|
23
27
|
import { createHash, randomBytes } from "node:crypto";
|
|
24
28
|
import { HTTPException } from "hono/http-exception";
|
|
29
|
+
import {
|
|
30
|
+
personalOwnerStateAccepted,
|
|
31
|
+
personalOwnerVerifiedInState,
|
|
32
|
+
PERSONAL_CONNECTION_PRINCIPAL_MESSAGE,
|
|
33
|
+
PERSONAL_OWNER_VERIFIED_STATE_CLAIM,
|
|
34
|
+
} from "../connection-ownership";
|
|
25
35
|
import { ApiHttpError } from "../http/api-error";
|
|
36
|
+
import { requireConnectOwnerAuthority } from "./connect-authority";
|
|
26
37
|
import {
|
|
27
38
|
integrationBaseUrl,
|
|
39
|
+
oauthStateFailureReturn,
|
|
28
40
|
oauthStateTtlMs,
|
|
29
41
|
requireIntegrationsStateSecret,
|
|
42
|
+
workspaceIntegrationsPath,
|
|
30
43
|
} from "./oauth-client";
|
|
31
44
|
|
|
32
45
|
// Reddit requires a descriptive, stable User-Agent on every request (token
|
|
@@ -129,19 +142,28 @@ function socialProviderFetch(
|
|
|
129
142
|
}
|
|
130
143
|
|
|
131
144
|
export type SocialOAuthStartContext = {
|
|
145
|
+
connectAttemptId?: string;
|
|
132
146
|
accountId: string;
|
|
133
147
|
workspaceId: string;
|
|
134
148
|
subjectId: string;
|
|
149
|
+
/**
|
|
150
|
+
* False for every principal that cannot own a personal Connection. Resolved
|
|
151
|
+
* by the route from the live authenticated principal, never inferred here.
|
|
152
|
+
*/
|
|
153
|
+
personalOwnershipAllowed: boolean;
|
|
135
154
|
requestUrl: string;
|
|
136
155
|
payload: SocialOAuthStartRequest;
|
|
137
156
|
};
|
|
138
157
|
|
|
139
158
|
type SocialOAuthStatePayload = {
|
|
159
|
+
connectAttemptId?: string;
|
|
140
160
|
kind: "social_oauth";
|
|
141
161
|
accountId: string;
|
|
142
162
|
workspaceId: string;
|
|
143
163
|
subjectId: string;
|
|
144
164
|
ownership: "workspace" | "personal";
|
|
165
|
+
/** Signed proof that a live managed human authorized personal ownership. */
|
|
166
|
+
personalOwnerVerified: boolean;
|
|
145
167
|
provider: SocialOAuthProviderId;
|
|
146
168
|
scopes: string[];
|
|
147
169
|
encryptedPkceVerifier?: string;
|
|
@@ -177,9 +199,12 @@ export async function startSocialOAuth(
|
|
|
177
199
|
): Promise<OAuthStartResponse> {
|
|
178
200
|
const { settings } = deps;
|
|
179
201
|
const provider = SOCIAL_OAUTH_PROVIDERS[context.payload.provider];
|
|
202
|
+
await withOrganizationIntegrationAcquisition(deps.db, context, [provider.id], async () => {});
|
|
180
203
|
const client = socialOAuthClientFor(settings, provider.id);
|
|
181
204
|
const redirectUri = socialOAuthRedirectUri(settings, context.requestUrl);
|
|
182
|
-
const returnPath = safeReturnPath(
|
|
205
|
+
const returnPath = safeReturnPath(
|
|
206
|
+
context.payload.returnPath ?? workspaceIntegrationsPath(context.workspaceId),
|
|
207
|
+
);
|
|
183
208
|
const scopes = uniqueScopes(context.payload.scopes) ?? provider.defaultScopes;
|
|
184
209
|
const verifier = provider.pkce ? randomBytes(32).toString("base64url") : null;
|
|
185
210
|
// Require the encryption key for every provider (not just PKCE ones) so a
|
|
@@ -188,10 +213,14 @@ export async function startSocialOAuth(
|
|
|
188
213
|
const key = requireEnvironmentEncryption(settings);
|
|
189
214
|
const state = createSignedState(requireIntegrationsStateSecret(settings), {
|
|
190
215
|
kind: "social_oauth",
|
|
216
|
+
...(context.connectAttemptId ? { connectAttemptId: context.connectAttemptId } : {}),
|
|
191
217
|
accountId: context.accountId,
|
|
192
218
|
workspaceId: context.workspaceId,
|
|
193
219
|
subjectId: context.subjectId,
|
|
194
220
|
ownership: context.payload.ownership,
|
|
221
|
+
// Signed record that a live principal was checked; the callback has no
|
|
222
|
+
// principal of its own and enforces exactly this decision.
|
|
223
|
+
[PERSONAL_OWNER_VERIFIED_STATE_CLAIM]: context.personalOwnershipAllowed,
|
|
195
224
|
provider: provider.id,
|
|
196
225
|
scopes,
|
|
197
226
|
...(verifier && key ? { encryptedPkceVerifier: encryptEnvironmentValue(key, verifier) } : {}),
|
|
@@ -228,17 +257,19 @@ export async function completeSocialOAuthCallback(
|
|
|
228
257
|
error?: string | undefined;
|
|
229
258
|
requestUrl: string;
|
|
230
259
|
},
|
|
231
|
-
): Promise<{ redirectTo: string }> {
|
|
260
|
+
): Promise<{ redirectTo: string; exactReturn?: boolean }> {
|
|
232
261
|
const { db, settings, observability } = deps;
|
|
233
262
|
let state: SocialOAuthStatePayload | null = null;
|
|
234
263
|
try {
|
|
235
264
|
state = readSocialOAuthState(input.state, settings);
|
|
236
265
|
} catch (error) {
|
|
237
266
|
logSocialOAuthFailure(observability, "state_verify", state, error);
|
|
267
|
+
const failure = oauthStateFailureReturn(settings, input.state);
|
|
238
268
|
return {
|
|
239
|
-
redirectTo: callbackReturnPath(
|
|
269
|
+
redirectTo: callbackReturnPath(failure.returnPath, "error", { reason: failure.reason }),
|
|
240
270
|
};
|
|
241
271
|
}
|
|
272
|
+
if (state.connectAttemptId) return completeSocialConnect(deps, state, input);
|
|
242
273
|
// Provider denial / missing code: report before burning the single-use
|
|
243
274
|
// nonce so a user who cancelled at the provider can retry the same flow
|
|
244
275
|
// within the state TTL.
|
|
@@ -274,6 +305,13 @@ export async function completeSocialOAuthCallback(
|
|
|
274
305
|
// the MCP OAuth client — a grant revoked inside the state TTL must not be
|
|
275
306
|
// able to land a workspace credential.
|
|
276
307
|
try {
|
|
308
|
+
// Only a managed human may own a personal Connection. This callback has no
|
|
309
|
+
// live principal, so it enforces the signed start-time decision; a state
|
|
310
|
+
// minted before that fence existed carries no claim and is refused, which
|
|
311
|
+
// closes the in-flight window across a rolling deploy.
|
|
312
|
+
if (!personalOwnerStateAccepted(state)) {
|
|
313
|
+
throw new HTTPException(422, { message: PERSONAL_CONNECTION_PRINCIPAL_MESSAGE });
|
|
314
|
+
}
|
|
277
315
|
const grant = await getWorkspaceGrant(db, state.subjectId, state.workspaceId);
|
|
278
316
|
if (
|
|
279
317
|
!grant ||
|
|
@@ -292,6 +330,7 @@ export async function completeSocialOAuthCallback(
|
|
|
292
330
|
}
|
|
293
331
|
try {
|
|
294
332
|
const provider = SOCIAL_OAUTH_PROVIDERS[state.provider];
|
|
333
|
+
await withOrganizationIntegrationAcquisition(db, state, [provider.id], async () => {});
|
|
295
334
|
const client = socialOAuthClientFor(settings, provider.id);
|
|
296
335
|
const key = requireEnvironmentEncryption(settings);
|
|
297
336
|
const verifier = state.encryptedPkceVerifier
|
|
@@ -313,18 +352,31 @@ export async function completeSocialOAuthCallback(
|
|
|
313
352
|
...(token.scope ? { scope: token.scope } : {}),
|
|
314
353
|
};
|
|
315
354
|
const grantedScopes = token.scope ? token.scope.split(/[\s,]+/).filter(Boolean) : state.scopes;
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
provider
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
355
|
+
const acceptedState = state;
|
|
356
|
+
const connection = await withOrganizationIntegrationAcquisition(
|
|
357
|
+
db,
|
|
358
|
+
acceptedState,
|
|
359
|
+
[provider.id],
|
|
360
|
+
async (tx) => {
|
|
361
|
+
await requireConnectOwnerAuthority(
|
|
362
|
+
tx,
|
|
363
|
+
acceptedState,
|
|
364
|
+
acceptedState.ownership === "workspace" ? "workspace:admin" : "workspace:read",
|
|
365
|
+
);
|
|
366
|
+
return upsertSocialOAuthConnection(tx, {
|
|
367
|
+
accountId: acceptedState.accountId,
|
|
368
|
+
workspaceId: acceptedState.workspaceId,
|
|
369
|
+
subjectId: acceptedState.ownership === "personal" ? acceptedState.subjectId : null,
|
|
370
|
+
provider: provider.id,
|
|
371
|
+
accountHandle: identity.handle,
|
|
372
|
+
accountName: identity.name ?? null,
|
|
373
|
+
externalAccountId: identity.externalAccountId,
|
|
374
|
+
scopes: grantedScopes,
|
|
375
|
+
credentialEncrypted: encryptEnvironmentValue(key, JSON.stringify(bundle)),
|
|
376
|
+
tokenMetadata: publicTokenMetadata(bundle),
|
|
377
|
+
});
|
|
378
|
+
},
|
|
379
|
+
);
|
|
328
380
|
return {
|
|
329
381
|
redirectTo: callbackReturnPath(state.returnPath, "success", {
|
|
330
382
|
connectionId: connection.id,
|
|
@@ -342,6 +394,147 @@ export async function completeSocialOAuthCallback(
|
|
|
342
394
|
}
|
|
343
395
|
}
|
|
344
396
|
|
|
397
|
+
/** Durable host setup keeps social credentials in their original domain. The
|
|
398
|
+
* stored origin, not the unauthenticated callback, supplies current authority. */
|
|
399
|
+
async function completeSocialConnect(
|
|
400
|
+
deps: SocialOAuthDeps,
|
|
401
|
+
state: SocialOAuthStatePayload,
|
|
402
|
+
input: {
|
|
403
|
+
state?: string | undefined;
|
|
404
|
+
code?: string | undefined;
|
|
405
|
+
error?: string | undefined;
|
|
406
|
+
requestUrl: string;
|
|
407
|
+
},
|
|
408
|
+
): Promise<{ redirectTo: string; exactReturn: true }> {
|
|
409
|
+
const stored = await getConnectAttempt(deps.db, state, state.connectAttemptId!);
|
|
410
|
+
if (stored.attempt.providerId !== state.provider || stored.attempt.ownership !== state.ownership)
|
|
411
|
+
throw new HTTPException(400, { message: "Social connection attempt mismatch" });
|
|
412
|
+
const authorize: import("@opengeni/db").ConnectOperationAuthorization = async (
|
|
413
|
+
tx,
|
|
414
|
+
_attempt,
|
|
415
|
+
origin,
|
|
416
|
+
) => {
|
|
417
|
+
await requireConnectOwnerAuthority(
|
|
418
|
+
tx,
|
|
419
|
+
{ ...state, ...(origin ? { externalContinuation: origin } : {}) },
|
|
420
|
+
state.ownership === "workspace" ? "workspace:admin" : "workspace:read",
|
|
421
|
+
origin,
|
|
422
|
+
);
|
|
423
|
+
};
|
|
424
|
+
const operation = {
|
|
425
|
+
attemptId: state.connectAttemptId!,
|
|
426
|
+
operationId: `social:${state.nonce}`,
|
|
427
|
+
inputDigest: createHash("sha256").update(input.state!).digest("hex"),
|
|
428
|
+
authorize,
|
|
429
|
+
};
|
|
430
|
+
try {
|
|
431
|
+
const claim = await claimOAuthAcquisition(
|
|
432
|
+
deps.db,
|
|
433
|
+
state,
|
|
434
|
+
{
|
|
435
|
+
...operation,
|
|
436
|
+
expectedRevision: stored.attempt.revision,
|
|
437
|
+
},
|
|
438
|
+
state.provider,
|
|
439
|
+
Boolean(input.code && !input.error),
|
|
440
|
+
);
|
|
441
|
+
if (claim.status === "replayed") return { redirectTo: stored.returnUrl, exactReturn: true };
|
|
442
|
+
if (!personalOwnerStateAccepted(state))
|
|
443
|
+
throw new HTTPException(403, { message: PERSONAL_CONNECTION_PRINCIPAL_MESSAGE });
|
|
444
|
+
if (input.error || !input.code) {
|
|
445
|
+
await finishConnectOperation(deps.db, state, {
|
|
446
|
+
...operation,
|
|
447
|
+
commit: async (_tx, current) => ({
|
|
448
|
+
...current,
|
|
449
|
+
revision: current.revision + 1,
|
|
450
|
+
state: input.error === "access_denied" ? "cancelled" : "failed",
|
|
451
|
+
nextAction: { type: "none" },
|
|
452
|
+
error: {
|
|
453
|
+
code: "authorization_not_completed",
|
|
454
|
+
message: "Authorization was not completed. Start a new attempt.",
|
|
455
|
+
retryable: false,
|
|
456
|
+
},
|
|
457
|
+
}),
|
|
458
|
+
});
|
|
459
|
+
} else {
|
|
460
|
+
const provider = SOCIAL_OAUTH_PROVIDERS[state.provider];
|
|
461
|
+
const key = requireEnvironmentEncryption(deps.settings);
|
|
462
|
+
const verifier = state.encryptedPkceVerifier
|
|
463
|
+
? decryptEnvironmentValue(key, state.encryptedPkceVerifier)
|
|
464
|
+
: null;
|
|
465
|
+
const token = await socialTokenRequest(
|
|
466
|
+
deps,
|
|
467
|
+
provider,
|
|
468
|
+
socialOAuthClientFor(deps.settings, provider.id),
|
|
469
|
+
{
|
|
470
|
+
grant_type: "authorization_code",
|
|
471
|
+
code: input.code,
|
|
472
|
+
redirect_uri: socialOAuthRedirectUri(deps.settings, input.requestUrl),
|
|
473
|
+
...(verifier ? { code_verifier: verifier } : {}),
|
|
474
|
+
},
|
|
475
|
+
);
|
|
476
|
+
const identity = await fetchSocialIdentity(deps, provider.id, token.accessToken);
|
|
477
|
+
const bundle: SocialCredentialBundle = {
|
|
478
|
+
provider: provider.id,
|
|
479
|
+
accessToken: token.accessToken,
|
|
480
|
+
tokenType: token.tokenType,
|
|
481
|
+
...(token.refreshToken ? { refreshToken: token.refreshToken } : {}),
|
|
482
|
+
...(token.expiresAt ? { expiresAt: token.expiresAt } : {}),
|
|
483
|
+
...(token.scope ? { scope: token.scope } : {}),
|
|
484
|
+
};
|
|
485
|
+
await finishOAuthAcquisition(
|
|
486
|
+
deps.db,
|
|
487
|
+
state,
|
|
488
|
+
{
|
|
489
|
+
...operation,
|
|
490
|
+
commit: async (tx, current) => {
|
|
491
|
+
const connection = await upsertSocialOAuthConnection(tx, {
|
|
492
|
+
accountId: state.accountId,
|
|
493
|
+
workspaceId: state.workspaceId,
|
|
494
|
+
...(current.account
|
|
495
|
+
? {
|
|
496
|
+
expectedConnection: {
|
|
497
|
+
id: current.account.id.slice("social:".length),
|
|
498
|
+
version: current.account.version!,
|
|
499
|
+
},
|
|
500
|
+
}
|
|
501
|
+
: {}),
|
|
502
|
+
subjectId: state.ownership === "personal" ? state.subjectId : null,
|
|
503
|
+
provider: provider.id,
|
|
504
|
+
accountHandle: identity.handle,
|
|
505
|
+
accountName: identity.name ?? null,
|
|
506
|
+
externalAccountId: identity.externalAccountId,
|
|
507
|
+
scopes: token.scope ? token.scope.split(/[\s,]+/).filter(Boolean) : state.scopes,
|
|
508
|
+
credentialEncrypted: encryptEnvironmentValue(key, JSON.stringify(bundle)),
|
|
509
|
+
tokenMetadata: publicTokenMetadata(bundle),
|
|
510
|
+
});
|
|
511
|
+
return {
|
|
512
|
+
...current,
|
|
513
|
+
revision: current.revision + 1,
|
|
514
|
+
state: "complete",
|
|
515
|
+
credentialsCommitted: true,
|
|
516
|
+
nextAction: { type: "none" },
|
|
517
|
+
account: {
|
|
518
|
+
id: `social:${connection.id}`,
|
|
519
|
+
providerId: provider.id,
|
|
520
|
+
version: connection.version!,
|
|
521
|
+
label: identity.handle,
|
|
522
|
+
ownership: state.ownership,
|
|
523
|
+
status: "connected",
|
|
524
|
+
},
|
|
525
|
+
};
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
state.provider,
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
} catch (error) {
|
|
532
|
+
// An uncertain exchange stays occupied: do not replay a consumed OAuth code.
|
|
533
|
+
logSocialOAuthFailure(deps.observability, "connect_callback", state, error);
|
|
534
|
+
}
|
|
535
|
+
return { redirectTo: stored.returnUrl, exactReturn: true };
|
|
536
|
+
}
|
|
537
|
+
|
|
345
538
|
/**
|
|
346
539
|
* Resolves a usable access token for a social connection, refreshing (and
|
|
347
540
|
* persisting the rotated bundle) when the stored token is near expiry. Marks
|
|
@@ -683,10 +876,15 @@ function readSocialOAuthState(
|
|
|
683
876
|
}
|
|
684
877
|
return {
|
|
685
878
|
kind: "social_oauth",
|
|
879
|
+
...(typeof payload.connectAttemptId === "string"
|
|
880
|
+
? { connectAttemptId: payload.connectAttemptId }
|
|
881
|
+
: {}),
|
|
686
882
|
accountId: requiredStateString(payload.accountId, "accountId"),
|
|
687
883
|
workspaceId: requiredStateString(payload.workspaceId, "workspaceId"),
|
|
688
884
|
subjectId: requiredStateString(payload.subjectId, "subjectId"),
|
|
689
885
|
ownership: payload.ownership === "personal" ? "personal" : "workspace",
|
|
886
|
+
// Absent on a legacy state, which therefore cannot land a personal owner.
|
|
887
|
+
personalOwnerVerified: personalOwnerVerifiedInState(payload),
|
|
690
888
|
provider,
|
|
691
889
|
scopes: Array.isArray(payload.scopes)
|
|
692
890
|
? payload.scopes.filter((scope): scope is string => typeof scope === "string")
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { AccessGrant } from "@opengeni/contracts";
|
|
2
|
+
import {
|
|
3
|
+
requireSessionAuthorization,
|
|
4
|
+
SessionAuthorizationDeniedError,
|
|
5
|
+
type ApiRouteDeps,
|
|
6
|
+
} from "@opengeni/core";
|
|
7
|
+
|
|
8
|
+
type AssociatedInteractionSession = {
|
|
9
|
+
associations: ReadonlyArray<{ sessionId: string; relationship: string }>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Apply the same source-chat authorization as get/control routes, for every
|
|
14
|
+
* caller. A later using/observing/related association never transfers ownership
|
|
15
|
+
* or makes a private interaction discoverable through another chat.
|
|
16
|
+
*/
|
|
17
|
+
export async function filterInteractionSessionsForGrant<T extends AssociatedInteractionSession>(
|
|
18
|
+
deps: Pick<ApiRouteDeps, "db" | "sessionAuthorization">,
|
|
19
|
+
grant: AccessGrant,
|
|
20
|
+
sessions: readonly T[],
|
|
21
|
+
): Promise<T[]> {
|
|
22
|
+
const decisions = new Map<string, Promise<boolean>>();
|
|
23
|
+
const authorized = (sessionId: string): Promise<boolean> => {
|
|
24
|
+
let decision = decisions.get(sessionId);
|
|
25
|
+
if (!decision) {
|
|
26
|
+
decision = requireSessionAuthorization(deps, grant, {
|
|
27
|
+
sessionId,
|
|
28
|
+
operation: "session.read",
|
|
29
|
+
surface: "http",
|
|
30
|
+
})
|
|
31
|
+
.then(() => true)
|
|
32
|
+
.catch((error: unknown) => {
|
|
33
|
+
if (error instanceof SessionAuthorizationDeniedError) return false;
|
|
34
|
+
throw error;
|
|
35
|
+
});
|
|
36
|
+
decisions.set(sessionId, decision);
|
|
37
|
+
}
|
|
38
|
+
return decision;
|
|
39
|
+
};
|
|
40
|
+
const kept: T[] = [];
|
|
41
|
+
for (const session of sessions) {
|
|
42
|
+
const sources = session.associations.filter((entry) => entry.relationship === "created");
|
|
43
|
+
// Control-record resolution also requires exactly one creation association.
|
|
44
|
+
// Incomplete or ambiguous records cannot establish a discoverable owner.
|
|
45
|
+
if (sources.length === 1 && (await authorized(sources[0]!.sessionId))) kept.push(session);
|
|
46
|
+
}
|
|
47
|
+
return kept;
|
|
48
|
+
}
|