@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
package/src/routes/plugins.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import pluginSnapshot from "../../../../data/catalog/plugins-snapshot.json";
|
|
2
|
+
import { marketplacePlugin } from "../integrations/marketplace-plugin";
|
|
3
|
+
import { mcpEndpointIdentity } from "@opengeni/contracts";
|
|
4
|
+
import {
|
|
5
|
+
buildCapabilityCatalog,
|
|
6
|
+
createCatalogItem,
|
|
7
|
+
integrationSourceForOrganizationPolicy,
|
|
8
|
+
} from "@opengeni/core";
|
|
9
|
+
import { withOrganizationIntegrationPolicyFence } from "@opengeni/db/organization-integration-policy";
|
|
1
10
|
import { createHash } from "node:crypto";
|
|
2
11
|
|
|
3
12
|
import {
|
|
@@ -18,15 +27,18 @@ import {
|
|
|
18
27
|
UninstallPluginResult,
|
|
19
28
|
stableJson,
|
|
20
29
|
type PluginComponentPreview,
|
|
30
|
+
type SkillActor,
|
|
21
31
|
} from "@opengeni/contracts";
|
|
22
32
|
import {
|
|
23
33
|
portableSkillCapabilityId,
|
|
24
34
|
portableSkillPluginKey,
|
|
25
35
|
requireAccessGrant,
|
|
36
|
+
requireAccessGrantAuthorization,
|
|
26
37
|
resolveSkillImport,
|
|
27
38
|
type ApiRouteDeps,
|
|
28
39
|
type GitHubSkillSourceClient,
|
|
29
40
|
} from "@opengeni/core";
|
|
41
|
+
import { skillInstallerActor, skillRemovalActor } from "./skill-install-authority";
|
|
30
42
|
import {
|
|
31
43
|
buildConnectionTokenResolver,
|
|
32
44
|
CapabilityComponentVersionConflictError,
|
|
@@ -36,10 +48,12 @@ import {
|
|
|
36
48
|
getConnectionMetadata,
|
|
37
49
|
getInstalledPluginPackage,
|
|
38
50
|
getPluginPackageUninstallPreview,
|
|
51
|
+
PluginUninstallPreviewChangedError,
|
|
39
52
|
integrationBindingKey,
|
|
40
53
|
installApiIntegration,
|
|
41
54
|
installPluginMcpReference,
|
|
42
55
|
installPortableSkill,
|
|
56
|
+
SkillSourceRemovalAuthorityError,
|
|
43
57
|
listInstalledPluginPackages,
|
|
44
58
|
PluginInstallationVersionConflictError,
|
|
45
59
|
PluginInstallationVersionRequiredError,
|
|
@@ -58,6 +72,7 @@ import {
|
|
|
58
72
|
type ResolvedApiIntegrationPreview,
|
|
59
73
|
} from "../integrations/api-integrations";
|
|
60
74
|
import { createGitHubSkillSourceClient } from "../integrations/github-skill-source";
|
|
75
|
+
import { parseRequestJson } from "../http/request-body";
|
|
61
76
|
|
|
62
77
|
const MAX_PLUGIN_MANIFEST_BYTES = 1024 * 1024;
|
|
63
78
|
|
|
@@ -71,6 +86,7 @@ type ResolvedPluginComponent = {
|
|
|
71
86
|
install(ownerPluginInstallationId: string): Promise<{
|
|
72
87
|
facetInstallationIds: string[];
|
|
73
88
|
bindingIds?: string[];
|
|
89
|
+
skillReceipt?: import("@opengeni/contracts").SkillWriteReceipt;
|
|
74
90
|
}>;
|
|
75
91
|
};
|
|
76
92
|
|
|
@@ -96,15 +112,84 @@ export function registerPluginRoutes(
|
|
|
96
112
|
await requireAccessGrant(c, deps, workspaceId, "workspace:read");
|
|
97
113
|
return c.json(
|
|
98
114
|
ListInstalledPluginsResponse.parse({
|
|
99
|
-
plugins: await listInstalledPluginPackages(deps.db, workspaceId)
|
|
115
|
+
plugins: (await listInstalledPluginPackages(deps.db, workspaceId)).map((plugin) => {
|
|
116
|
+
const source = pluginSnapshot.sources.find((candidate) =>
|
|
117
|
+
plugin.pluginKey.startsWith("marketplace/" + candidate.provider + "/"),
|
|
118
|
+
);
|
|
119
|
+
const entry = source?.entries.find(
|
|
120
|
+
(candidate) =>
|
|
121
|
+
plugin.pluginKey === "marketplace/" + source!.provider + "/" + candidate.name,
|
|
122
|
+
);
|
|
123
|
+
return { ...plugin, logoUrl: plugin.logoUrl ?? entry?.logoUrl ?? null };
|
|
124
|
+
}),
|
|
100
125
|
}),
|
|
101
126
|
);
|
|
102
127
|
});
|
|
103
128
|
|
|
129
|
+
app.get("/v1/workspaces/:workspaceId/plugins/details", async (c) => {
|
|
130
|
+
const workspaceId = c.req.param("workspaceId");
|
|
131
|
+
const grant = await requireAccessGrant(c, deps, workspaceId, "workspace:read");
|
|
132
|
+
const plugin = await getInstalledPluginPackage(
|
|
133
|
+
deps.db,
|
|
134
|
+
workspaceId,
|
|
135
|
+
c.req.query("pluginKey") ?? "",
|
|
136
|
+
);
|
|
137
|
+
if (!plugin || plugin.status === "disabled")
|
|
138
|
+
throw new HTTPException(404, { message: "Plugin is not installed" });
|
|
139
|
+
const stored = plugin.manifest as Record<string, any>;
|
|
140
|
+
if (stored.discovery) return c.json(stored.discovery);
|
|
141
|
+
const catalog = await buildCapabilityCatalog({
|
|
142
|
+
db: deps.db,
|
|
143
|
+
workspaceId,
|
|
144
|
+
settings: deps.settings,
|
|
145
|
+
subjectId: grant.subjectId,
|
|
146
|
+
});
|
|
147
|
+
const members = Array.isArray(stored.components) ? stored.components : [];
|
|
148
|
+
return c.json({
|
|
149
|
+
id: String(stored.pluginKey ?? "installed")
|
|
150
|
+
.replace("marketplace/", "")
|
|
151
|
+
.replace("/", ":"),
|
|
152
|
+
name: stored.name,
|
|
153
|
+
displayName: stored.name,
|
|
154
|
+
description: stored.description ?? "",
|
|
155
|
+
longDescription: stored.description ?? "",
|
|
156
|
+
provider: "custom",
|
|
157
|
+
category: stored.category ?? null,
|
|
158
|
+
logoUrl: null,
|
|
159
|
+
darkLogoUrl: null,
|
|
160
|
+
sourceUrl: stored.sourceUrl ?? null,
|
|
161
|
+
author: null,
|
|
162
|
+
version: stored.version,
|
|
163
|
+
skills: members
|
|
164
|
+
.filter((member) => member.kind === "skill")
|
|
165
|
+
.map((member) => ({
|
|
166
|
+
name: decodeURIComponent(member.url.split("/").filter(Boolean).at(-2) ?? member.key),
|
|
167
|
+
sourceUrl: member.url,
|
|
168
|
+
})),
|
|
169
|
+
mcpServers: members
|
|
170
|
+
.filter((member) => member.kind === "mcp")
|
|
171
|
+
.map((member) => {
|
|
172
|
+
const bom = Array.isArray(stored.bom)
|
|
173
|
+
? stored.bom.find((entry: any) => entry.key === member.key)
|
|
174
|
+
: null;
|
|
175
|
+
const item = catalog.items.find((candidate) => candidate.id === bom?.capabilityId);
|
|
176
|
+
return {
|
|
177
|
+
name: item?.name ?? member.serverId,
|
|
178
|
+
transport: item?.transport ?? "http",
|
|
179
|
+
endpoint: item?.endpointUrl ?? null,
|
|
180
|
+
};
|
|
181
|
+
}),
|
|
182
|
+
components: [
|
|
183
|
+
...new Set(members.map((member) => (member.kind === "skill" ? "skills" : member.kind))),
|
|
184
|
+
],
|
|
185
|
+
installation: "installed",
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
|
|
104
189
|
app.post("/v1/workspaces/:workspaceId/plugins/preview", async (c) => {
|
|
105
190
|
const workspaceId = c.req.param("workspaceId");
|
|
106
191
|
const grant = await requireAccessGrant(c, deps, workspaceId, "workspace:read");
|
|
107
|
-
const payload =
|
|
192
|
+
const payload = await parseRequestJson(c, PreviewPluginRequest);
|
|
108
193
|
const resolved = await resolvePluginPackage({
|
|
109
194
|
deps,
|
|
110
195
|
github,
|
|
@@ -120,9 +205,16 @@ export function registerPluginRoutes(
|
|
|
120
205
|
|
|
121
206
|
app.post("/v1/workspaces/:workspaceId/plugins/install", async (c) => {
|
|
122
207
|
const workspaceId = c.req.param("workspaceId");
|
|
123
|
-
const
|
|
124
|
-
|
|
208
|
+
const access = await requireAccessGrantAuthorization(
|
|
209
|
+
c,
|
|
210
|
+
deps,
|
|
211
|
+
workspaceId,
|
|
212
|
+
"capabilities:manage",
|
|
213
|
+
);
|
|
214
|
+
const { grant } = access;
|
|
215
|
+
const payload = await parseRequestJson(c, InstallPluginRequest);
|
|
125
216
|
const resolved = await resolvePluginPackage({
|
|
217
|
+
skillActor: () => skillInstallerActor(access),
|
|
126
218
|
deps,
|
|
127
219
|
github,
|
|
128
220
|
transport,
|
|
@@ -188,11 +280,13 @@ export function registerPluginRoutes(
|
|
|
188
280
|
const retainedFacetInstallationIds: string[] = [];
|
|
189
281
|
const retainedBindingIds: string[] = [];
|
|
190
282
|
const completedKeys: string[] = [];
|
|
283
|
+
const skillWrites: import("@opengeni/contracts").SkillWriteReceipt[] = [];
|
|
191
284
|
let activeComponentKey = "none";
|
|
192
285
|
try {
|
|
193
286
|
for (const component of resolved.components) {
|
|
194
287
|
activeComponentKey = component.preview.key;
|
|
195
288
|
const installed = await component.install(prepared.pluginInstallationId);
|
|
289
|
+
if (installed.skillReceipt) skillWrites.push(installed.skillReceipt);
|
|
196
290
|
retainedFacetInstallationIds.push(...installed.facetInstallationIds);
|
|
197
291
|
retainedBindingIds.push(...(installed.bindingIds ?? []));
|
|
198
292
|
completedKeys.push(component.preview.key);
|
|
@@ -204,6 +298,7 @@ export function registerPluginRoutes(
|
|
|
204
298
|
});
|
|
205
299
|
}
|
|
206
300
|
const result = InstalledPlugin.parse({
|
|
301
|
+
...(skillWrites.length ? { skillWrites } : {}),
|
|
207
302
|
pluginKey: prepared.pluginKey,
|
|
208
303
|
version: prepared.version,
|
|
209
304
|
pluginId: prepared.pluginId,
|
|
@@ -213,7 +308,9 @@ export function registerPluginRoutes(
|
|
|
213
308
|
componentCount: resolved.components.length,
|
|
214
309
|
status: "installed",
|
|
215
310
|
});
|
|
216
|
-
|
|
311
|
+
const removalActor = skillRemovalActor(access);
|
|
312
|
+
const { skillReleases, skillPublications } = await finalizePluginPackageInstall(deps.db, {
|
|
313
|
+
...(removalActor ? { skillActor: removalActor } : {}),
|
|
217
314
|
accountId: grant.accountId,
|
|
218
315
|
workspaceId,
|
|
219
316
|
subjectId: grant.subjectId,
|
|
@@ -223,7 +320,14 @@ export function registerPluginRoutes(
|
|
|
223
320
|
retainedBindingIds,
|
|
224
321
|
result,
|
|
225
322
|
});
|
|
226
|
-
return c.json(
|
|
323
|
+
return c.json(
|
|
324
|
+
{
|
|
325
|
+
...result,
|
|
326
|
+
...(skillReleases.length ? { skillReleases } : {}),
|
|
327
|
+
...(skillPublications.length ? { skillPublications } : {}),
|
|
328
|
+
},
|
|
329
|
+
resolved.preview.installed ? 200 : 201,
|
|
330
|
+
);
|
|
227
331
|
} catch (error) {
|
|
228
332
|
await deferPluginPackageOperation(deps.db, {
|
|
229
333
|
workspaceId,
|
|
@@ -231,6 +335,8 @@ export function registerPluginRoutes(
|
|
|
231
335
|
phase: `component_failed:${activeComponentKey}`,
|
|
232
336
|
errorCode: pluginFailureCode(error),
|
|
233
337
|
}).catch(() => undefined);
|
|
338
|
+
if (error instanceof SkillSourceRemovalAuthorityError)
|
|
339
|
+
throw new HTTPException(403, { message: error.message });
|
|
234
340
|
if (error instanceof HTTPException) throw error;
|
|
235
341
|
if (error instanceof CapabilityComponentVersionConflictError) {
|
|
236
342
|
throw new HTTPException(409, {
|
|
@@ -245,32 +351,67 @@ export function registerPluginRoutes(
|
|
|
245
351
|
|
|
246
352
|
app.get("/v1/workspaces/:workspaceId/plugins/:pluginKey/uninstall-preview", async (c) => {
|
|
247
353
|
const workspaceId = c.req.param("workspaceId");
|
|
248
|
-
await requireAccessGrant(c, deps, workspaceId, "workspace:read");
|
|
354
|
+
const grant = await requireAccessGrant(c, deps, workspaceId, "workspace:read");
|
|
249
355
|
const pluginKey = decodeURIComponent(c.req.param("pluginKey"));
|
|
250
|
-
const preview = await getPluginPackageUninstallPreview(
|
|
356
|
+
const preview = await getPluginPackageUninstallPreview(
|
|
357
|
+
deps.db,
|
|
358
|
+
workspaceId,
|
|
359
|
+
pluginKey,
|
|
360
|
+
grant.subjectId,
|
|
361
|
+
);
|
|
251
362
|
return c.json(PluginUninstallPreview.parse({ pluginKey, ...preview }));
|
|
252
363
|
});
|
|
253
364
|
|
|
254
365
|
app.delete("/v1/workspaces/:workspaceId/plugins/:pluginKey", async (c) => {
|
|
255
366
|
const workspaceId = c.req.param("workspaceId");
|
|
256
|
-
const
|
|
367
|
+
const access = await requireAccessGrantAuthorization(
|
|
368
|
+
c,
|
|
369
|
+
deps,
|
|
370
|
+
workspaceId,
|
|
371
|
+
"capabilities:manage",
|
|
372
|
+
);
|
|
373
|
+
const { grant } = access;
|
|
374
|
+
const skillActor = skillRemovalActor(access);
|
|
257
375
|
const pluginKey = decodeURIComponent(c.req.param("pluginKey"));
|
|
258
|
-
const payload =
|
|
376
|
+
const payload = await parseRequestJson(c, UninstallPluginRequest);
|
|
259
377
|
try {
|
|
260
378
|
return c.json(
|
|
261
379
|
UninstallPluginResult.parse({
|
|
262
380
|
pluginKey,
|
|
263
381
|
...(await uninstallPluginPackage(deps.db, {
|
|
382
|
+
...(skillActor ? { skillActor } : {}),
|
|
264
383
|
accountId: grant.accountId,
|
|
265
384
|
workspaceId,
|
|
266
385
|
subjectId: grant.subjectId,
|
|
267
386
|
pluginKey,
|
|
268
387
|
expectedInstallationVersion: payload.expectedInstallationVersion,
|
|
388
|
+
...(payload.expectedPreviewToken
|
|
389
|
+
? { expectedPreviewToken: payload.expectedPreviewToken }
|
|
390
|
+
: {}),
|
|
269
391
|
idempotencyKey: payload.idempotencyKey,
|
|
270
392
|
})),
|
|
271
393
|
}),
|
|
272
394
|
);
|
|
273
395
|
} catch (error) {
|
|
396
|
+
if (error instanceof PluginUninstallPreviewChangedError) {
|
|
397
|
+
const preview = error.preview ?? {
|
|
398
|
+
pluginKey,
|
|
399
|
+
...(await getPluginPackageUninstallPreview(
|
|
400
|
+
deps.db,
|
|
401
|
+
workspaceId,
|
|
402
|
+
pluginKey,
|
|
403
|
+
grant.subjectId,
|
|
404
|
+
)),
|
|
405
|
+
};
|
|
406
|
+
return c.json(
|
|
407
|
+
{
|
|
408
|
+
code: error.code,
|
|
409
|
+
message: error.message,
|
|
410
|
+
preview: PluginUninstallPreview.parse(preview),
|
|
411
|
+
},
|
|
412
|
+
409,
|
|
413
|
+
);
|
|
414
|
+
}
|
|
274
415
|
throw pluginMutationHttpError(error);
|
|
275
416
|
}
|
|
276
417
|
});
|
|
@@ -283,6 +424,7 @@ async function resolvePluginPackage(input: {
|
|
|
283
424
|
accountId: string;
|
|
284
425
|
workspaceId: string;
|
|
285
426
|
subjectId: string;
|
|
427
|
+
skillActor?: () => SkillActor;
|
|
286
428
|
url: string;
|
|
287
429
|
bindings: Record<
|
|
288
430
|
string,
|
|
@@ -294,15 +436,20 @@ async function resolvePluginPackage(input: {
|
|
|
294
436
|
>;
|
|
295
437
|
}): Promise<ResolvedPluginPackage> {
|
|
296
438
|
let manifest;
|
|
439
|
+
const marketplace = marketplacePlugin(input.url);
|
|
297
440
|
try {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
441
|
+
if (marketplace) {
|
|
442
|
+
manifest = marketplace.manifest;
|
|
443
|
+
} else {
|
|
444
|
+
const bytes = await fetchIntegrationSourceDocument(
|
|
445
|
+
input.transport,
|
|
446
|
+
input.url,
|
|
447
|
+
MAX_PLUGIN_MANIFEST_BYTES,
|
|
448
|
+
);
|
|
449
|
+
manifest = PluginManifest.parse(
|
|
450
|
+
JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)),
|
|
451
|
+
);
|
|
452
|
+
}
|
|
306
453
|
} catch (error) {
|
|
307
454
|
if (error instanceof HTTPException) throw error;
|
|
308
455
|
throw new HTTPException(422, {
|
|
@@ -311,6 +458,14 @@ async function resolvePluginPackage(input: {
|
|
|
311
458
|
}
|
|
312
459
|
const manifestDigest = sha256(stableJson(manifest));
|
|
313
460
|
const components: ResolvedPluginComponent[] = [];
|
|
461
|
+
const catalog = marketplace
|
|
462
|
+
? await buildCapabilityCatalog({
|
|
463
|
+
db: input.deps.db,
|
|
464
|
+
workspaceId: input.workspaceId,
|
|
465
|
+
settings: input.deps.settings,
|
|
466
|
+
subjectId: input.subjectId,
|
|
467
|
+
})
|
|
468
|
+
: null;
|
|
314
469
|
for (const component of manifest.components) {
|
|
315
470
|
if (component.kind === "skill") {
|
|
316
471
|
const resolved = await resolveSkillImport(component.url, input.github);
|
|
@@ -342,10 +497,13 @@ async function resolvePluginPackage(input: {
|
|
|
342
497
|
},
|
|
343
498
|
},
|
|
344
499
|
install: async (ownerPluginInstallationId) => {
|
|
500
|
+
if (!input.skillActor)
|
|
501
|
+
throw new HTTPException(403, { message: "Skill installer authority is missing" });
|
|
345
502
|
const summaries = new Map(
|
|
346
503
|
resolved.preview.files.map((file) => [file.path, file] as const),
|
|
347
504
|
);
|
|
348
505
|
const installed = await installPortableSkill(input.deps.db, {
|
|
506
|
+
skillActor: input.skillActor(),
|
|
349
507
|
accountId: input.accountId,
|
|
350
508
|
workspaceId: input.workspaceId,
|
|
351
509
|
subjectId: input.subjectId,
|
|
@@ -366,12 +524,20 @@ async function resolvePluginPackage(input: {
|
|
|
366
524
|
}),
|
|
367
525
|
owner: { kind: "plugin", id: ownerPluginInstallationId, removable: true },
|
|
368
526
|
});
|
|
369
|
-
return {
|
|
527
|
+
return {
|
|
528
|
+
facetInstallationIds: [installed.facetInstallationId],
|
|
529
|
+
skillReceipt: installed.skillReceipt,
|
|
530
|
+
};
|
|
370
531
|
},
|
|
371
532
|
});
|
|
372
533
|
continue;
|
|
373
534
|
}
|
|
374
535
|
if (component.kind === "integration") {
|
|
536
|
+
const source = await withOrganizationIntegrationPolicyFence(
|
|
537
|
+
input.deps.db,
|
|
538
|
+
input,
|
|
539
|
+
async (_tx, policy) => integrationSourceForOrganizationPolicy(policy, component.source),
|
|
540
|
+
);
|
|
375
541
|
const requestedBinding = input.bindings[component.key];
|
|
376
542
|
const connection = await optionalConnection(
|
|
377
543
|
input.deps,
|
|
@@ -380,7 +546,7 @@ async function resolvePluginPackage(input: {
|
|
|
380
546
|
requestedBinding?.connectionId,
|
|
381
547
|
);
|
|
382
548
|
const resolved = await resolveApiIntegrationPreview({
|
|
383
|
-
source
|
|
549
|
+
source,
|
|
384
550
|
connection: connectionDescriptor(connection),
|
|
385
551
|
transport: input.transport,
|
|
386
552
|
authority: {
|
|
@@ -470,7 +636,62 @@ async function resolvePluginPackage(input: {
|
|
|
470
636
|
});
|
|
471
637
|
continue;
|
|
472
638
|
}
|
|
473
|
-
const server = configuredMcpServer(
|
|
639
|
+
const server = configuredMcpServer(
|
|
640
|
+
[...(marketplace?.servers ?? []), ...input.deps.settings.mcpServers],
|
|
641
|
+
component.serverId,
|
|
642
|
+
);
|
|
643
|
+
if (marketplace) {
|
|
644
|
+
const endpoint = mcpEndpointIdentity(server.url)!;
|
|
645
|
+
const matches = (catalog?.items ?? []).filter(
|
|
646
|
+
(item) => item.kind === "mcp" && mcpEndpointIdentity(item.endpointUrl) === endpoint,
|
|
647
|
+
);
|
|
648
|
+
// Prefer the original catalogue connection over legacy plugin-created duplicates.
|
|
649
|
+
matches.sort(
|
|
650
|
+
(a, b) =>
|
|
651
|
+
Number(a.id.startsWith("mcp:configured:marketplace-")) -
|
|
652
|
+
Number(b.id.startsWith("mcp:configured:marketplace-")) ||
|
|
653
|
+
Number(b.enabled) - Number(a.enabled) ||
|
|
654
|
+
a.id.localeCompare(b.id),
|
|
655
|
+
);
|
|
656
|
+
const existing = matches[0];
|
|
657
|
+
const capabilityId = existing?.id ?? "mcp:endpoint:" + sha256(endpoint).slice(0, 24);
|
|
658
|
+
const digest = sha256(stableJson({ endpoint, capabilityId }));
|
|
659
|
+
components.push({
|
|
660
|
+
preview: {
|
|
661
|
+
key: component.key,
|
|
662
|
+
kind: "mcp",
|
|
663
|
+
name: existing?.name ?? server.name ?? server.id,
|
|
664
|
+
capabilityId,
|
|
665
|
+
digest,
|
|
666
|
+
connectionRequired: !existing?.enabled,
|
|
667
|
+
connectionId: null,
|
|
668
|
+
instanceKey: null,
|
|
669
|
+
displayName: null,
|
|
670
|
+
facts: { endpointUrl: endpoint, connectionManagedSeparately: true },
|
|
671
|
+
},
|
|
672
|
+
install: async () => {
|
|
673
|
+
if (!existing)
|
|
674
|
+
await createCatalogItem({
|
|
675
|
+
db: input.deps.db,
|
|
676
|
+
accountId: input.accountId,
|
|
677
|
+
workspaceId: input.workspaceId,
|
|
678
|
+
payload: {
|
|
679
|
+
id: capabilityId,
|
|
680
|
+
kind: "mcp",
|
|
681
|
+
source: "manual",
|
|
682
|
+
name: server.name ?? server.id,
|
|
683
|
+
endpointUrl: endpoint,
|
|
684
|
+
category: "integrations",
|
|
685
|
+
tags: ["mcp"],
|
|
686
|
+
metadata: { authDiscovery: "unknown" },
|
|
687
|
+
},
|
|
688
|
+
});
|
|
689
|
+
// Connections are independently owned: installing/removing a plugin never signs in or disconnects an account.
|
|
690
|
+
return { facetInstallationIds: [] };
|
|
691
|
+
},
|
|
692
|
+
});
|
|
693
|
+
continue;
|
|
694
|
+
}
|
|
474
695
|
const digest = sha256(stableJson(safeMcpFacts(server)));
|
|
475
696
|
components.push({
|
|
476
697
|
preview: {
|
|
@@ -543,7 +764,13 @@ async function resolvePluginPackage(input: {
|
|
|
543
764
|
components: components.map((component) => component.preview),
|
|
544
765
|
diff,
|
|
545
766
|
}),
|
|
546
|
-
storedManifest: {
|
|
767
|
+
storedManifest: {
|
|
768
|
+
...manifest,
|
|
769
|
+
...(marketplace ? { discovery: marketplace.discovery } : {}),
|
|
770
|
+
sourceUrl: input.url,
|
|
771
|
+
manifestDigest,
|
|
772
|
+
bom,
|
|
773
|
+
},
|
|
547
774
|
components,
|
|
548
775
|
};
|
|
549
776
|
}
|
|
@@ -725,6 +952,8 @@ function pluginDiff(
|
|
|
725
952
|
}
|
|
726
953
|
|
|
727
954
|
function pluginMutationHttpError(error: unknown): HTTPException {
|
|
955
|
+
if (error instanceof SkillSourceRemovalAuthorityError)
|
|
956
|
+
return new HTTPException(403, { message: error.message });
|
|
728
957
|
if (error instanceof PluginOperationIdempotencyError) {
|
|
729
958
|
return new HTTPException(409, { message: "Plugin idempotency key was already used" });
|
|
730
959
|
}
|