@opengeni/api-router 0.30.3 → 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-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 +1091 -162
- 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 +24 -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 +107 -9
- 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 +59 -2
- 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/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 +1967 -252
- 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 +28 -3
- 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 +717 -225
- 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 +3167 -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 -43
- 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 +780 -112
- 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 +1039 -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 +267 -33
- 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-WCXHI3FF.js +0 -49920
- package/dist/chunk-WCXHI3FF.js.map +0 -1
- package/dist/routes/packs.d.ts +0 -3
- package/src/routes/packs.ts +0 -729
package/src/mcp/files.ts
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import type { AccessGrant } from "@opengeni/contracts";
|
|
2
|
-
import { requireFileForSubject } from "@opengeni/db";
|
|
3
|
-
import {
|
|
2
|
+
import { recordAuditEvent, requireFileForSubject, withSessionRlsActorContext } from "@opengeni/db";
|
|
3
|
+
import {
|
|
4
|
+
hasPermission,
|
|
5
|
+
fileOwnerContextForAccess,
|
|
6
|
+
fileOwnerContextForAgent,
|
|
7
|
+
type AccessGrantAuthorization,
|
|
8
|
+
type ApiRouteDeps,
|
|
9
|
+
} from "@opengeni/core";
|
|
4
10
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
11
|
import * as z from "zod/v4";
|
|
12
|
+
import { userContentSignedGetUrlOptions } from "../http/user-content";
|
|
6
13
|
|
|
7
14
|
/** Dedicated file MCP surface. The broad `opengeni` server never registers it. */
|
|
8
|
-
export function buildFilesMcpServer(
|
|
15
|
+
export function buildFilesMcpServer(
|
|
16
|
+
deps: ApiRouteDeps,
|
|
17
|
+
authority: AccessGrant | AccessGrantAuthorization,
|
|
18
|
+
): McpServer {
|
|
19
|
+
const access = "grant" in authority ? authority : undefined;
|
|
20
|
+
const grant = access ? access.grant : (authority as AccessGrant);
|
|
9
21
|
const server = new McpServer({
|
|
10
22
|
name: "opengeni-files",
|
|
11
23
|
version: "1.0.0",
|
|
@@ -34,47 +46,72 @@ export function buildFilesMcpServer(deps: ApiRouteDeps, grant: AccessGrant): Mcp
|
|
|
34
46
|
inputSchema: { fileId: z.string().uuid() },
|
|
35
47
|
},
|
|
36
48
|
async ({ fileId }) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
null,
|
|
73
|
-
2,
|
|
74
|
-
),
|
|
49
|
+
const actor = access
|
|
50
|
+
? await fileOwnerContextForAccess(deps, access, "files:read")
|
|
51
|
+
: grant.principalKind === "agent_attempt"
|
|
52
|
+
? await fileOwnerContextForAgent(deps, grant, "files:read")
|
|
53
|
+
: { subjectId: grant.subjectId, privateFileOwnerSubjectId: null };
|
|
54
|
+
return withSessionRlsActorContext(actor, async () => {
|
|
55
|
+
if (!deps.objectStorage) {
|
|
56
|
+
throw new Error("object storage is not configured");
|
|
57
|
+
}
|
|
58
|
+
const file = await requireFileForSubject(deps.db, {
|
|
59
|
+
accountId: grant.accountId,
|
|
60
|
+
workspaceId: grant.workspaceId,
|
|
61
|
+
subjectId: grant.subjectId,
|
|
62
|
+
fileId,
|
|
63
|
+
});
|
|
64
|
+
if (file.status !== "ready") {
|
|
65
|
+
throw new Error(`file is ${file.status}`);
|
|
66
|
+
}
|
|
67
|
+
const signed = await deps.objectStorage.createGetUrl({
|
|
68
|
+
key: file.objectKey,
|
|
69
|
+
...userContentSignedGetUrlOptions(file.contentType, file.filename),
|
|
70
|
+
});
|
|
71
|
+
// Principal-facing signed URL issuance is a metadata-only audit
|
|
72
|
+
// fact, awaited before the URL leaves the platform. Never the URL/key.
|
|
73
|
+
await recordAuditEvent(deps.db, {
|
|
74
|
+
accountId: grant.accountId,
|
|
75
|
+
workspaceId: grant.workspaceId,
|
|
76
|
+
subjectId: grant.subjectId,
|
|
77
|
+
action: "file.signed_url.issued",
|
|
78
|
+
targetType: "workspace_file",
|
|
79
|
+
targetId: file.id,
|
|
80
|
+
metadata: {
|
|
81
|
+
fileId: file.id,
|
|
82
|
+
kind: "mcp_download",
|
|
83
|
+
expiresAt: signed.expiresAt.toISOString(),
|
|
75
84
|
},
|
|
76
|
-
|
|
77
|
-
|
|
85
|
+
});
|
|
86
|
+
return {
|
|
87
|
+
content: [
|
|
88
|
+
{
|
|
89
|
+
type: "text" as const,
|
|
90
|
+
text: JSON.stringify(
|
|
91
|
+
{
|
|
92
|
+
file: {
|
|
93
|
+
id: file.id,
|
|
94
|
+
filename: file.filename,
|
|
95
|
+
safeFilename: file.safeFilename,
|
|
96
|
+
contentType: file.contentType,
|
|
97
|
+
sizeBytes: file.sizeBytes,
|
|
98
|
+
sha256: file.sha256,
|
|
99
|
+
status: file.status,
|
|
100
|
+
createdAt: file.createdAt,
|
|
101
|
+
updatedAt: file.updatedAt,
|
|
102
|
+
},
|
|
103
|
+
downloadUrl: {
|
|
104
|
+
url: signed.url,
|
|
105
|
+
expiresAt: signed.expiresAt.toISOString(),
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
null,
|
|
109
|
+
2,
|
|
110
|
+
),
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
});
|
|
78
115
|
},
|
|
79
116
|
);
|
|
80
117
|
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { type FirstPartyMcpToolName, type Permission } from "@opengeni/contracts";
|
|
2
|
+
|
|
3
|
+
export type FirstPartyToolAuthorization = {
|
|
4
|
+
sessionRequired?: true;
|
|
5
|
+
allOf?: readonly Permission[];
|
|
6
|
+
anyOf?: readonly Permission[];
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Authorization is deliberately complete and separate from visibility. The
|
|
11
|
+
* `satisfies Record` check makes every catalog addition choose an explicit
|
|
12
|
+
* registration predicate before it can compile.
|
|
13
|
+
*/
|
|
14
|
+
export const FIRST_PARTY_TOOL_AUTHORIZATION = {
|
|
15
|
+
set_session_title: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
16
|
+
goal_set: { sessionRequired: true, allOf: ["goals:manage"] },
|
|
17
|
+
goal_update: { sessionRequired: true, allOf: ["goals:manage"] },
|
|
18
|
+
goal_progress: { sessionRequired: true, allOf: ["goals:manage"] },
|
|
19
|
+
wait_for_input: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
20
|
+
goal_complete: { sessionRequired: true, allOf: ["goals:manage"] },
|
|
21
|
+
goal_pause: { sessionRequired: true, allOf: ["goals:manage"] },
|
|
22
|
+
goal_resume: { sessionRequired: true, allOf: ["goals:manage"] },
|
|
23
|
+
knowledge_search: { sessionRequired: true, allOf: ["documents:search"] },
|
|
24
|
+
knowledge_prepare_save: { sessionRequired: true, allOf: ["documents:search"] },
|
|
25
|
+
knowledge_get: { sessionRequired: true, allOf: ["documents:search"] },
|
|
26
|
+
knowledge_browse: { sessionRequired: true, allOf: ["documents:search"] },
|
|
27
|
+
knowledge_retain_file: { sessionRequired: true, allOf: ["documents:search", "files:read"] },
|
|
28
|
+
knowledge_retain_message: { sessionRequired: true, allOf: ["documents:search", "sessions:read"] },
|
|
29
|
+
knowledge_save: { sessionRequired: true, allOf: ["documents:search"] },
|
|
30
|
+
knowledge_archive: { sessionRequired: true, allOf: ["documents:search"] },
|
|
31
|
+
instruction_policy_save: { sessionRequired: true, allOf: ["documents:search"] },
|
|
32
|
+
instruction_policy_get: { sessionRequired: true, allOf: ["documents:search"] },
|
|
33
|
+
memory_search: { sessionRequired: true, allOf: ["documents:search"] },
|
|
34
|
+
memory_save: { sessionRequired: true, allOf: ["documents:search"] },
|
|
35
|
+
memory_correct: { sessionRequired: true, allOf: ["documents:search"] },
|
|
36
|
+
preference_registry_summary: {
|
|
37
|
+
sessionRequired: true,
|
|
38
|
+
allOf: ["workspace:read"],
|
|
39
|
+
},
|
|
40
|
+
preference_registry_get: { sessionRequired: true, allOf: ["workspace:read"] },
|
|
41
|
+
task_notes_list: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
42
|
+
task_note_save: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
43
|
+
task_note_archive: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
44
|
+
task_note_replace: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
45
|
+
work_claim_upsert: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
46
|
+
work_claim_release: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
47
|
+
knowledge_propose: { sessionRequired: true, allOf: ["documents:search"] },
|
|
48
|
+
knowledge_correct: { sessionRequired: true, allOf: ["documents:search"] },
|
|
49
|
+
task_note_promote_knowledge: {
|
|
50
|
+
sessionRequired: true,
|
|
51
|
+
allOf: ["documents:search", "sessions:control"],
|
|
52
|
+
},
|
|
53
|
+
task_note_promote_instruction_policy: {
|
|
54
|
+
sessionRequired: true,
|
|
55
|
+
allOf: ["documents:search", "sessions:control", "workspace:read"],
|
|
56
|
+
},
|
|
57
|
+
task_note_promote_preference: {
|
|
58
|
+
sessionRequired: true,
|
|
59
|
+
allOf: ["documents:search", "sessions:control", "workspace:read"],
|
|
60
|
+
},
|
|
61
|
+
instruction_policy_propose: {
|
|
62
|
+
sessionRequired: true,
|
|
63
|
+
allOf: ["documents:search", "workspace:read"],
|
|
64
|
+
},
|
|
65
|
+
preference_propose: {
|
|
66
|
+
sessionRequired: true,
|
|
67
|
+
allOf: ["documents:search", "workspace:read"],
|
|
68
|
+
},
|
|
69
|
+
// Explicit user-directed remember composes task-note evidence with the
|
|
70
|
+
// governed promotion path, so it needs the union of both permission sets.
|
|
71
|
+
remember: {
|
|
72
|
+
sessionRequired: true,
|
|
73
|
+
allOf: ["documents:search", "sessions:control", "workspace:read"],
|
|
74
|
+
},
|
|
75
|
+
remember_confirm: {
|
|
76
|
+
sessionRequired: true,
|
|
77
|
+
allOf: ["documents:search", "sessions:control", "workspace:read"],
|
|
78
|
+
},
|
|
79
|
+
company_profile_propose: {
|
|
80
|
+
sessionRequired: true,
|
|
81
|
+
allOf: ["sessions:control", "workspace:read"],
|
|
82
|
+
},
|
|
83
|
+
company_profile_confirm: {
|
|
84
|
+
sessionRequired: true,
|
|
85
|
+
allOf: ["sessions:control", "workspace:read"],
|
|
86
|
+
},
|
|
87
|
+
sandboxes_list: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
88
|
+
sandbox_attach: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
89
|
+
sandbox_swap: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
90
|
+
run_on: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
91
|
+
sandbox_provision: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
92
|
+
connected_machine_remove: { allOf: ["enrollments:manage"] },
|
|
93
|
+
connected_machine_enroll_token: { allOf: ["enrollments:manage"] },
|
|
94
|
+
rig_list: { allOf: ["rigs:use"] },
|
|
95
|
+
rig_get: { allOf: ["rigs:use"] },
|
|
96
|
+
rig_propose_change: { allOf: ["rigs:use"] },
|
|
97
|
+
rig_verify: { allOf: ["rigs:use"] },
|
|
98
|
+
rig_promote: { allOf: ["rigs:manage"] },
|
|
99
|
+
sessions_list: { allOf: ["sessions:read"] },
|
|
100
|
+
session_get: { allOf: ["sessions:read"] },
|
|
101
|
+
session_set_model: { allOf: ["sessions:control"] },
|
|
102
|
+
session_events: { allOf: ["sessions:read"] },
|
|
103
|
+
// Blocking wait inside a running turn: the live attempt's own session is the
|
|
104
|
+
// self target, so the tool exists only for session-scoped grants.
|
|
105
|
+
session_wait: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
106
|
+
command_wait: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
107
|
+
command_read: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
108
|
+
session_create: { allOf: ["sessions:create"] },
|
|
109
|
+
session_send_message: { allOf: ["sessions:control"] },
|
|
110
|
+
session_pause: { allOf: ["sessions:control"] },
|
|
111
|
+
session_resume: { allOf: ["sessions:control"] },
|
|
112
|
+
session_steer: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
113
|
+
// A live attempt may answer another session's structured human-input
|
|
114
|
+
// request (never a tool approval, which stays human-only).
|
|
115
|
+
session_human_input_respond: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
116
|
+
set_other_session_title: { allOf: ["sessions:control"] },
|
|
117
|
+
interaction_discover: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
118
|
+
browser_open: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
119
|
+
browser_tabs: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
120
|
+
browser_observe: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
121
|
+
browser_read: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
122
|
+
browser_screenshot: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
123
|
+
browser_act: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
124
|
+
browser_clipboard: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
125
|
+
browser_debug: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
126
|
+
browser_downloads: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
127
|
+
browser_download_save: {
|
|
128
|
+
sessionRequired: true,
|
|
129
|
+
allOf: ["sessions:control", "files:upload"],
|
|
130
|
+
},
|
|
131
|
+
browser_auth: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
132
|
+
interaction_request_human: {
|
|
133
|
+
sessionRequired: true,
|
|
134
|
+
allOf: ["sessions:control"],
|
|
135
|
+
},
|
|
136
|
+
browser_identity: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
137
|
+
browser_publish: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
138
|
+
browser_lifecycle: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
139
|
+
computer_open: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
140
|
+
computer_targets: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
141
|
+
computer_observe: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
142
|
+
computer_clipboard: { sessionRequired: true, allOf: ["sessions:read"] },
|
|
143
|
+
computer_act: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
144
|
+
computer_lifecycle: { sessionRequired: true, allOf: ["sessions:control"] },
|
|
145
|
+
variable_set_list: { allOf: ["variable-sets:list", "secrets:list"] },
|
|
146
|
+
environment_list: { allOf: ["variable-sets:list", "secrets:list"] },
|
|
147
|
+
variable_set_get_variable: {
|
|
148
|
+
sessionRequired: true,
|
|
149
|
+
allOf: ["variable-sets:read", "secrets:read"],
|
|
150
|
+
},
|
|
151
|
+
variable_set_set_variable: {
|
|
152
|
+
allOf: ["variable-sets:write", "secrets:write"],
|
|
153
|
+
},
|
|
154
|
+
environment_set_variable: { allOf: ["variable-sets:write", "secrets:write"] },
|
|
155
|
+
capability_catalog_search: {
|
|
156
|
+
sessionRequired: true,
|
|
157
|
+
allOf: ["workspace:read"],
|
|
158
|
+
},
|
|
159
|
+
capability_authorization_request: {
|
|
160
|
+
sessionRequired: true,
|
|
161
|
+
allOf: ["workspace:read"],
|
|
162
|
+
},
|
|
163
|
+
custom_mcp_setup_request: {
|
|
164
|
+
sessionRequired: true,
|
|
165
|
+
allOf: ["workspace:read"],
|
|
166
|
+
},
|
|
167
|
+
github_connect_link: { allOf: ["github:use"] },
|
|
168
|
+
github_repositories_list: { allOf: ["github:use"] },
|
|
169
|
+
social_connections_list: { allOf: ["connections:read"] },
|
|
170
|
+
social_posts_recent: { allOf: ["connections:read"] },
|
|
171
|
+
social_daily_analysis_context: { allOf: ["connections:read"] },
|
|
172
|
+
social_search_live: { allOf: ["connections:read"] },
|
|
173
|
+
social_mentions_live: { allOf: ["connections:read"] },
|
|
174
|
+
social_thread_fetch: { allOf: ["connections:read"] },
|
|
175
|
+
// Writes the social_posts store, so it takes the write scope like the REST
|
|
176
|
+
// equivalent (POST /social/posts is workspace:admin).
|
|
177
|
+
social_posts_sync: { allOf: ["connections:write"] },
|
|
178
|
+
// Publishes under the user's identity: connections:write keeps it out of the
|
|
179
|
+
// default agent permission set, unlike the read-only social tools above.
|
|
180
|
+
social_post_reply: { allOf: ["connections:write"] },
|
|
181
|
+
x_accounts_list: { allOf: ["connections:read"] },
|
|
182
|
+
x_search_live: { allOf: ["connections:read"] },
|
|
183
|
+
x_mentions_live: { allOf: ["connections:read"] },
|
|
184
|
+
x_thread_fetch: { allOf: ["connections:read"] },
|
|
185
|
+
x_posts_sync: { allOf: ["connections:write"] },
|
|
186
|
+
x_post_reply: { allOf: ["connections:write"] },
|
|
187
|
+
reddit_accounts_list: { allOf: ["connections:read"] },
|
|
188
|
+
reddit_search_live: { allOf: ["connections:read"] },
|
|
189
|
+
reddit_mentions_live: { allOf: ["connections:read"] },
|
|
190
|
+
reddit_thread_fetch: { allOf: ["connections:read"] },
|
|
191
|
+
reddit_posts_sync: { allOf: ["connections:write"] },
|
|
192
|
+
reddit_post_reply: { allOf: ["connections:write"] },
|
|
193
|
+
scheduled_tasks_list: {
|
|
194
|
+
anyOf: ["scheduled_tasks:manage", "scheduled_tasks:run"],
|
|
195
|
+
},
|
|
196
|
+
scheduled_tasks_get: {
|
|
197
|
+
anyOf: ["scheduled_tasks:manage", "scheduled_tasks:run"],
|
|
198
|
+
},
|
|
199
|
+
scheduled_tasks_create: { allOf: ["scheduled_tasks:manage"] },
|
|
200
|
+
scheduled_tasks_update: { allOf: ["scheduled_tasks:manage"] },
|
|
201
|
+
scheduled_tasks_pause: { allOf: ["scheduled_tasks:manage"] },
|
|
202
|
+
scheduled_tasks_resume: { allOf: ["scheduled_tasks:manage"] },
|
|
203
|
+
scheduled_tasks_trigger: { allOf: ["scheduled_tasks:run"] },
|
|
204
|
+
scheduled_tasks_delete: { allOf: ["scheduled_tasks:manage"] },
|
|
205
|
+
scheduled_task_runs_list: {
|
|
206
|
+
anyOf: ["scheduled_tasks:manage", "scheduled_tasks:run"],
|
|
207
|
+
},
|
|
208
|
+
slack_bot_list_channels: { allOf: ["connections:read"] },
|
|
209
|
+
slack_bot_search: { allOf: ["connections:read"] },
|
|
210
|
+
slack_bot_channel_history: { allOf: ["connections:read"] },
|
|
211
|
+
slack_bot_thread_replies: { allOf: ["connections:read"] },
|
|
212
|
+
slack_bot_list_users: { allOf: ["connections:read"] },
|
|
213
|
+
slack_bot_list_files: { allOf: ["connections:read"] },
|
|
214
|
+
slack_bot_file_info: { allOf: ["connections:read"] },
|
|
215
|
+
slack_bot_file_content: { allOf: ["connections:read"] },
|
|
216
|
+
slack_bot_upload_file: { sessionRequired: true, allOf: ["connections:read", "files:read"] },
|
|
217
|
+
slack_bot_post_message: { allOf: ["connections:read"] },
|
|
218
|
+
// Scheduled runs only; the destination is the task's human-chosen channel.
|
|
219
|
+
slack_bot_prepare_message: { sessionRequired: true, allOf: ["connections:read"] },
|
|
220
|
+
slack_bot_send_prepared_message: { sessionRequired: true, allOf: ["connections:read"] },
|
|
221
|
+
slack_bot_delete_message: { allOf: ["connections:read"] },
|
|
222
|
+
fiken_companies_list: { allOf: ["connections:read"] },
|
|
223
|
+
fiken_contacts_list: { allOf: ["connections:read"] },
|
|
224
|
+
fiken_products_list: { allOf: ["connections:read"] },
|
|
225
|
+
fiken_invoices_list: { allOf: ["connections:read"] },
|
|
226
|
+
fiken_invoice_get: { allOf: ["connections:read"] },
|
|
227
|
+
fiken_bank_accounts_list: { allOf: ["connections:read"] },
|
|
228
|
+
fiken_purchases_list: { allOf: ["connections:read"] },
|
|
229
|
+
fiken_sales_list: { allOf: ["connections:read"] },
|
|
230
|
+
// Writes into the workspace's real accounting ledger surface take the write
|
|
231
|
+
// scope, keeping them out of the default agent permission set.
|
|
232
|
+
fiken_contact_create: { allOf: ["connections:write"] },
|
|
233
|
+
fiken_invoice_draft_create: { allOf: ["connections:write"] },
|
|
234
|
+
atlassian_sources_list: { allOf: ["connections:read"] },
|
|
235
|
+
atlassian_search: { allOf: ["connections:read"] },
|
|
236
|
+
atlassian_get: { allOf: ["connections:read"] },
|
|
237
|
+
artifacts_list: { allOf: ["artifacts:read"] },
|
|
238
|
+
artifacts_get_source: { sessionRequired: true, allOf: ["artifacts:read"] },
|
|
239
|
+
artifacts_prepare_upload: { sessionRequired: true, allOf: ["artifacts:publish"] },
|
|
240
|
+
artifacts_create: { sessionRequired: true, allOf: ["artifacts:publish"] },
|
|
241
|
+
artifacts_publish: { sessionRequired: true, allOf: ["artifacts:publish"] },
|
|
242
|
+
artifacts_rollback: { sessionRequired: true, allOf: ["artifacts:publish"] },
|
|
243
|
+
artifacts_archive: { sessionRequired: true, allOf: ["artifacts:publish"] },
|
|
244
|
+
artifacts_restore: { sessionRequired: true, allOf: ["artifacts:publish"] },
|
|
245
|
+
sandbox_file_publish: {
|
|
246
|
+
sessionRequired: true,
|
|
247
|
+
allOf: ["files:read", "files:upload"],
|
|
248
|
+
},
|
|
249
|
+
editable_artifact_list: { sessionRequired: true, allOf: ["artifacts:read"] },
|
|
250
|
+
editable_artifact_create: {
|
|
251
|
+
sessionRequired: true,
|
|
252
|
+
allOf: ["artifacts:publish"],
|
|
253
|
+
},
|
|
254
|
+
editable_artifact_import: {
|
|
255
|
+
sessionRequired: true,
|
|
256
|
+
allOf: ["artifacts:publish", "files:read"],
|
|
257
|
+
},
|
|
258
|
+
editable_artifact_get: { sessionRequired: true, allOf: ["artifacts:read"] },
|
|
259
|
+
editable_artifact_inspect: {
|
|
260
|
+
sessionRequired: true,
|
|
261
|
+
allOf: ["artifacts:read"],
|
|
262
|
+
},
|
|
263
|
+
editable_artifact_apply: {
|
|
264
|
+
sessionRequired: true,
|
|
265
|
+
allOf: ["artifacts:publish"],
|
|
266
|
+
},
|
|
267
|
+
editable_artifact_export: {
|
|
268
|
+
sessionRequired: true,
|
|
269
|
+
allOf: ["artifacts:read"],
|
|
270
|
+
},
|
|
271
|
+
editable_artifact_export_status: {
|
|
272
|
+
sessionRequired: true,
|
|
273
|
+
allOf: ["artifacts:read", "files:upload"],
|
|
274
|
+
},
|
|
275
|
+
project_list: { allOf: ["sessions:read"] },
|
|
276
|
+
project_get: { allOf: ["sessions:read"] },
|
|
277
|
+
project_create: { allOf: ["sessions:create"] },
|
|
278
|
+
project_update: { allOf: ["sessions:create"] },
|
|
279
|
+
project_reorder: { allOf: ["sessions:create"] },
|
|
280
|
+
project_delete: { allOf: ["sessions:create"] },
|
|
281
|
+
session_set_project: { allOf: ["sessions:control"] },
|
|
282
|
+
} satisfies Record<FirstPartyMcpToolName, FirstPartyToolAuthorization>;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* The permissions a session's first-party tool selection can possibly
|
|
286
|
+
* exercise, derived from the same per-tool registration data that gates the
|
|
287
|
+
* MCP surface. A caller that only proxies REST handlers on behalf of a
|
|
288
|
+
* selection (the Codemode SDK proxy) must never hold more than this: a
|
|
289
|
+
* selection without any session_* orchestration tool cannot need
|
|
290
|
+
* sessions:create or sessions:control, so a delegated token for it must not
|
|
291
|
+
* carry them either. `anyOf` alternatives are all counted because any one of
|
|
292
|
+
* them could be the permission the selection actually holds.
|
|
293
|
+
*/
|
|
294
|
+
export function permissionsRequiredByFirstPartyTools(
|
|
295
|
+
tools: readonly FirstPartyMcpToolName[],
|
|
296
|
+
): Permission[] {
|
|
297
|
+
const required = new Set<Permission>();
|
|
298
|
+
for (const tool of tools) {
|
|
299
|
+
const policy: FirstPartyToolAuthorization | undefined = FIRST_PARTY_TOOL_AUTHORIZATION[tool];
|
|
300
|
+
if (!policy) continue;
|
|
301
|
+
for (const permission of policy.allOf ?? []) required.add(permission);
|
|
302
|
+
for (const permission of policy.anyOf ?? []) required.add(permission);
|
|
303
|
+
}
|
|
304
|
+
return [...required];
|
|
305
|
+
}
|