@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Session } from "@opengeni/contracts";
|
|
2
|
+
import type { SlackHomeBlock } from "./slack-bot.js";
|
|
3
|
+
export type SlackAppHomeOpenedEvent = {
|
|
4
|
+
eventId: string;
|
|
5
|
+
slackTeamId: string;
|
|
6
|
+
slackUserId: string;
|
|
7
|
+
viewHash: string | null;
|
|
8
|
+
};
|
|
9
|
+
export declare function slackAppHomeOpenedEvent(payload: unknown): SlackAppHomeOpenedEvent | null;
|
|
10
|
+
/** URL-only App Home buttons are acknowledged but never become Slack commands. */
|
|
11
|
+
export declare function isSlackAppHomeLinkAction(payload: unknown): boolean;
|
|
12
|
+
export declare function buildSlackAppHomeBlocks(input: {
|
|
13
|
+
sessions: readonly Session[];
|
|
14
|
+
workspaceUrl: string | null;
|
|
15
|
+
sessionUrl: (sessionId: string) => string | null;
|
|
16
|
+
nowMs?: number;
|
|
17
|
+
}): SlackHomeBlock[];
|
|
18
|
+
export declare function buildSlackAppHomeAccessBlocks(input: {
|
|
19
|
+
title: string;
|
|
20
|
+
message: string;
|
|
21
|
+
actionLabel?: string;
|
|
22
|
+
actionUrl?: string | null;
|
|
23
|
+
}): SlackHomeBlock[];
|
|
24
|
+
export declare function escapeSlackMrkdwn(value: string): string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type Settings } from "@opengeni/config";
|
|
2
|
-
import { OPENGENI_SLACK_BOT_CREDENTIAL_LABEL, OPENGENI_SLACK_BOT_CREDENTIAL_ROLE, type AccessGrant, type ConnectionMetadata, type OpenGeniSlackBotConnectionMetadata } from "@opengeni/contracts";
|
|
2
|
+
import { OPENGENI_SLACK_BOT_CREDENTIAL_LABEL, OPENGENI_SLACK_BOT_CREDENTIAL_ROLE, type AccessGrant, type ConnectionMetadata, type OpenGeniSlackBotDisplayName, type OpenGeniSlackBotConnectionMetadata } from "@opengeni/contracts";
|
|
3
3
|
import { type Database } from "@opengeni/db";
|
|
4
4
|
import { type FetchLike } from "@opengeni/network";
|
|
5
5
|
import { HTTPException } from "hono/http-exception";
|
|
6
6
|
export declare const SLACK_REACTION_IMAGE_MAX_BYTES: number;
|
|
7
|
+
export declare const SLACK_MCP_IMAGE_MAX_BYTES: number;
|
|
7
8
|
declare const SLACK_REACTION_CONTEXT_CHECKPOINT_VERSION = 1;
|
|
8
9
|
type SlackPayload = Record<string, unknown> & {
|
|
9
10
|
ok?: unknown;
|
|
@@ -34,12 +35,16 @@ export type DownloadedSlackReactionImage = Readonly<{
|
|
|
34
35
|
contentType: "image/png" | "image/jpeg" | "image/webp";
|
|
35
36
|
bytes: Uint8Array;
|
|
36
37
|
}>;
|
|
38
|
+
export type ExchangedOpenGeniSlackAuthorization = Readonly<{
|
|
39
|
+
accessToken: string;
|
|
40
|
+
appId: string;
|
|
41
|
+
}>;
|
|
37
42
|
export declare function exchangeOpenGeniSlackAuthorizationCode(input: {
|
|
38
43
|
code: string;
|
|
39
44
|
clientId: string;
|
|
40
45
|
clientSecret: string;
|
|
41
46
|
redirectUri: string;
|
|
42
|
-
}, fetchImpl?: FetchLike): Promise<
|
|
47
|
+
}, fetchImpl?: FetchLike): Promise<ExchangedOpenGeniSlackAuthorization>;
|
|
43
48
|
export type SlackBotReceipt = {
|
|
44
49
|
credentialRole: typeof OPENGENI_SLACK_BOT_CREDENTIAL_ROLE;
|
|
45
50
|
credentialLabel: typeof OPENGENI_SLACK_BOT_CREDENTIAL_LABEL;
|
|
@@ -71,10 +76,69 @@ export type SlackMessageBlock = {
|
|
|
71
76
|
};
|
|
72
77
|
style?: "primary" | "danger";
|
|
73
78
|
}>;
|
|
79
|
+
} | {
|
|
80
|
+
type: "context";
|
|
81
|
+
block_id?: string;
|
|
82
|
+
elements: Array<{
|
|
83
|
+
type: "mrkdwn" | "plain_text";
|
|
84
|
+
text: string;
|
|
85
|
+
emoji?: boolean;
|
|
86
|
+
}>;
|
|
74
87
|
} | {
|
|
75
88
|
type: "divider";
|
|
76
89
|
};
|
|
77
|
-
type
|
|
90
|
+
export type SlackHomeBlock = {
|
|
91
|
+
type: "header";
|
|
92
|
+
block_id?: string;
|
|
93
|
+
text: {
|
|
94
|
+
type: "plain_text";
|
|
95
|
+
text: string;
|
|
96
|
+
emoji?: boolean;
|
|
97
|
+
};
|
|
98
|
+
} | {
|
|
99
|
+
type: "section";
|
|
100
|
+
block_id?: string;
|
|
101
|
+
text: {
|
|
102
|
+
type: "mrkdwn" | "plain_text";
|
|
103
|
+
text: string;
|
|
104
|
+
emoji?: boolean;
|
|
105
|
+
};
|
|
106
|
+
accessory?: {
|
|
107
|
+
type: "button";
|
|
108
|
+
action_id: string;
|
|
109
|
+
text: {
|
|
110
|
+
type: "plain_text";
|
|
111
|
+
text: string;
|
|
112
|
+
emoji?: boolean;
|
|
113
|
+
};
|
|
114
|
+
url: string;
|
|
115
|
+
};
|
|
116
|
+
} | {
|
|
117
|
+
type: "context";
|
|
118
|
+
block_id?: string;
|
|
119
|
+
elements: Array<{
|
|
120
|
+
type: "mrkdwn" | "plain_text";
|
|
121
|
+
text: string;
|
|
122
|
+
emoji?: boolean;
|
|
123
|
+
}>;
|
|
124
|
+
} | {
|
|
125
|
+
type: "actions";
|
|
126
|
+
block_id: string;
|
|
127
|
+
elements: Array<{
|
|
128
|
+
type: "button";
|
|
129
|
+
action_id: string;
|
|
130
|
+
text: {
|
|
131
|
+
type: "plain_text";
|
|
132
|
+
text: string;
|
|
133
|
+
emoji?: boolean;
|
|
134
|
+
};
|
|
135
|
+
url: string;
|
|
136
|
+
style?: "primary" | "danger";
|
|
137
|
+
}>;
|
|
138
|
+
} | {
|
|
139
|
+
type: "divider";
|
|
140
|
+
};
|
|
141
|
+
type SlackBotOperation = "channels.list" | "search.context" | "channel_history.read" | "thread_replies.read" | "users.list" | "files.list" | "file.info" | "file.content.read" | "file.upload" | "home.publish" | "message.post" | "message.update" | "message.delete";
|
|
78
142
|
type SlackBotContext = {
|
|
79
143
|
accountId: string;
|
|
80
144
|
workspaceId: string;
|
|
@@ -82,6 +146,7 @@ type SlackBotContext = {
|
|
|
82
146
|
sessionId?: string | null;
|
|
83
147
|
scheduledTaskId?: string | null;
|
|
84
148
|
};
|
|
149
|
+
type SlackProviderAuthorization = () => Promise<boolean | void>;
|
|
85
150
|
export type SlackReactionContextCheckpointBinding = {
|
|
86
151
|
inboxId: string;
|
|
87
152
|
accountId: string;
|
|
@@ -125,6 +190,33 @@ export declare class SlackBotProviderError extends Error {
|
|
|
125
190
|
readonly retryAfterMs: number | null;
|
|
126
191
|
constructor(code: string, retryAfterMs?: number | null);
|
|
127
192
|
}
|
|
193
|
+
export declare function slackHistoryRateLimited(error: unknown): error is SlackBotProviderError;
|
|
194
|
+
/**
|
|
195
|
+
* The post or update ledger already binds this operation id to different
|
|
196
|
+
* request bytes. Raised from the durable claim, before any Slack write, so a
|
|
197
|
+
* caller that knows an earlier release wrote other bytes for the same operation
|
|
198
|
+
* may retry once with those bytes.
|
|
199
|
+
*/
|
|
200
|
+
export declare class SlackBotOperationConflictError extends Error {
|
|
201
|
+
constructor(kind: "post" | "update" | "delete");
|
|
202
|
+
}
|
|
203
|
+
/** Only Slack's one-time HTTPS upload endpoint may receive retained bytes. */
|
|
204
|
+
export declare function slackFileUploadUrl(value: string): URL;
|
|
205
|
+
/** A channel listing alone is not proof of delivery to the requested thread. */
|
|
206
|
+
export declare function slackFileSharedToThread(value: unknown, input: {
|
|
207
|
+
fileId: string;
|
|
208
|
+
channelId: string;
|
|
209
|
+
threadTimestamp: string;
|
|
210
|
+
botUserId: string;
|
|
211
|
+
}): boolean;
|
|
212
|
+
export declare function authorizeSlackSharedImageRead(channel: {
|
|
213
|
+
isArchived: boolean;
|
|
214
|
+
isShared: boolean;
|
|
215
|
+
isExternallyShared: boolean;
|
|
216
|
+
isOrgShared: boolean;
|
|
217
|
+
isPendingExternallyShared: boolean;
|
|
218
|
+
isMpim: boolean;
|
|
219
|
+
}, authorizeSharedRead: (() => Promise<void>) | undefined): Promise<void>;
|
|
128
220
|
export type SlackBotCredentialVerificationFailureReason = "scope_mismatch" | "identity_mismatch";
|
|
129
221
|
export declare class SlackBotCredentialVerificationError extends HTTPException {
|
|
130
222
|
readonly failureReason: SlackBotCredentialVerificationFailureReason;
|
|
@@ -132,11 +224,14 @@ export declare class SlackBotCredentialVerificationError extends HTTPException {
|
|
|
132
224
|
}
|
|
133
225
|
/**
|
|
134
226
|
* Validates a write-only xoxb credential before it can enter encrypted storage.
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
227
|
+
* The OAuth exchange's app_id is the immutable app authority. Slack bot profile
|
|
228
|
+
* names are mutable presentation data and may lag manifest/App Home changes, so
|
|
229
|
+
* they must not decide whether a credential belongs to this installation.
|
|
138
230
|
*/
|
|
139
|
-
export declare function verifyOpenGeniSlackBotCredential(token: string,
|
|
231
|
+
export declare function verifyOpenGeniSlackBotCredential(token: string, expected: Readonly<{
|
|
232
|
+
appId: string;
|
|
233
|
+
displayName: OpenGeniSlackBotDisplayName;
|
|
234
|
+
}>, fetchImpl?: FetchLike, now?: Date): Promise<VerifiedOpenGeniSlackBot>;
|
|
140
235
|
export declare function resolveSlackBotConnectionForTool(input: {
|
|
141
236
|
db: Database;
|
|
142
237
|
grant: AccessGrant;
|
|
@@ -147,6 +242,73 @@ export declare function resolveSlackBotConnectionForTool(input: {
|
|
|
147
242
|
metadata: OpenGeniSlackBotConnectionMetadata;
|
|
148
243
|
context: SlackBotContext;
|
|
149
244
|
}>;
|
|
245
|
+
/**
|
|
246
|
+
* The one destination a scheduled run may post to as the OpenGeni bot: the
|
|
247
|
+
* channel a person chose on the task, through the bot connection frozen on the
|
|
248
|
+
* run's session. The agent never supplies a channel. Every call re-reads the
|
|
249
|
+
* task, so a person clearing or changing the channel takes effect at once.
|
|
250
|
+
*/
|
|
251
|
+
export declare function resolveScheduledSlackBotPostTarget(input: {
|
|
252
|
+
db: Database;
|
|
253
|
+
grant: AccessGrant;
|
|
254
|
+
sessionId: string | null;
|
|
255
|
+
}): Promise<Awaited<ReturnType<typeof resolveSlackBotConnectionForTool>> & {
|
|
256
|
+
scheduledTaskId: string;
|
|
257
|
+
channelId: string;
|
|
258
|
+
}>;
|
|
259
|
+
/**
|
|
260
|
+
* Save one message for the task's channel without sending it. The returned id
|
|
261
|
+
* is server-owned and becomes the Slack post operation id, so retrying the
|
|
262
|
+
* send can never post the same message twice.
|
|
263
|
+
*/
|
|
264
|
+
export declare function prepareScheduledSlackBotPost(input: {
|
|
265
|
+
db: Database;
|
|
266
|
+
grant: AccessGrant;
|
|
267
|
+
sessionId: string | null;
|
|
268
|
+
text: string;
|
|
269
|
+
threadTimestamp?: string | undefined;
|
|
270
|
+
}): Promise<{
|
|
271
|
+
messageId: string;
|
|
272
|
+
identity: "workspace_bot";
|
|
273
|
+
channelId: string;
|
|
274
|
+
threadTimestamp: string | null;
|
|
275
|
+
text: string;
|
|
276
|
+
sent: boolean;
|
|
277
|
+
}>;
|
|
278
|
+
/**
|
|
279
|
+
* Send a message this run prepared, exactly as saved. The destination must
|
|
280
|
+
* still be the task's channel and the bot connection unchanged; otherwise the
|
|
281
|
+
* send is refused rather than redirected.
|
|
282
|
+
*/
|
|
283
|
+
export declare function sendScheduledSlackBotPost(input: {
|
|
284
|
+
db: Database;
|
|
285
|
+
settings: Settings;
|
|
286
|
+
grant: AccessGrant;
|
|
287
|
+
sessionId: string | null;
|
|
288
|
+
messageId: string;
|
|
289
|
+
slackFetch?: typeof fetch;
|
|
290
|
+
authorizeProviderRequest?: SlackProviderAuthorization;
|
|
291
|
+
}): Promise<{
|
|
292
|
+
channelId: string;
|
|
293
|
+
timestamp: string;
|
|
294
|
+
threadTimestamp: string | null;
|
|
295
|
+
receipt: SlackBotReceipt;
|
|
296
|
+
}>;
|
|
297
|
+
/**
|
|
298
|
+
* Check, with the bot's token, that a person's chosen task channel is one the
|
|
299
|
+
* bot is a member of, active, and not shared with another organization.
|
|
300
|
+
*/
|
|
301
|
+
export declare function verifyScheduledTaskSlackChannel(deps: {
|
|
302
|
+
db: Database;
|
|
303
|
+
settings: Settings;
|
|
304
|
+
slackFetch?: typeof fetch;
|
|
305
|
+
}, input: {
|
|
306
|
+
accountId: string;
|
|
307
|
+
workspaceId: string;
|
|
308
|
+
subjectId: string;
|
|
309
|
+
connectionId: string;
|
|
310
|
+
channelId: string;
|
|
311
|
+
}): Promise<void>;
|
|
150
312
|
export declare class OpenGeniSlackBotClient {
|
|
151
313
|
private readonly db;
|
|
152
314
|
private readonly settings;
|
|
@@ -154,8 +316,12 @@ export declare class OpenGeniSlackBotClient {
|
|
|
154
316
|
private readonly metadata;
|
|
155
317
|
private readonly context;
|
|
156
318
|
private readonly fetchImpl;
|
|
319
|
+
private readonly authorizeProviderRequest?;
|
|
157
320
|
private readonly resolveCredential;
|
|
158
|
-
|
|
321
|
+
private readonly rateLimit;
|
|
322
|
+
constructor(db: Database, settings: Settings, connection: ConnectionMetadata, metadata: OpenGeniSlackBotConnectionMetadata, context: SlackBotContext, fetchImpl?: FetchLike, authorizeProviderRequest?: SlackProviderAuthorization | undefined);
|
|
323
|
+
private historyPageLimit;
|
|
324
|
+
private postReconciliationPageLimit;
|
|
159
325
|
listChannels(input?: {
|
|
160
326
|
limit?: number;
|
|
161
327
|
cursor?: string;
|
|
@@ -167,6 +333,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
167
333
|
isMember: boolean;
|
|
168
334
|
isDirectMessage: boolean;
|
|
169
335
|
isMpim: boolean;
|
|
336
|
+
userId: string | null;
|
|
170
337
|
isArchived: boolean;
|
|
171
338
|
isShared: boolean;
|
|
172
339
|
isExternallyShared: boolean;
|
|
@@ -190,6 +357,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
190
357
|
isMember: boolean;
|
|
191
358
|
isDirectMessage: boolean;
|
|
192
359
|
isMpim: boolean;
|
|
360
|
+
userId: string | null;
|
|
193
361
|
isArchived: boolean;
|
|
194
362
|
isShared: boolean;
|
|
195
363
|
isExternallyShared: boolean;
|
|
@@ -202,6 +370,64 @@ export declare class OpenGeniSlackBotClient {
|
|
|
202
370
|
purpose: string;
|
|
203
371
|
numMembers: number | null;
|
|
204
372
|
}>;
|
|
373
|
+
/** Server-only upload preparation; the temporary URL never enters a tool result. */
|
|
374
|
+
allocateFileUpload(input: {
|
|
375
|
+
channelId: string;
|
|
376
|
+
privateRecipientSlackUserId?: string;
|
|
377
|
+
filename: string;
|
|
378
|
+
sizeBytes: number;
|
|
379
|
+
}): Promise<{
|
|
380
|
+
fileId: string;
|
|
381
|
+
uploadUrl: URL;
|
|
382
|
+
} & {
|
|
383
|
+
receipt: SlackBotReceipt;
|
|
384
|
+
}>;
|
|
385
|
+
transferFileUpload(input: {
|
|
386
|
+
channelId: string;
|
|
387
|
+
privateRecipientSlackUserId?: string;
|
|
388
|
+
uploadUrl: URL;
|
|
389
|
+
bytes: Uint8Array;
|
|
390
|
+
}): Promise<{
|
|
391
|
+
uploaded: boolean;
|
|
392
|
+
} & {
|
|
393
|
+
receipt: SlackBotReceipt;
|
|
394
|
+
}>;
|
|
395
|
+
completeFileUpload(input: {
|
|
396
|
+
channelId: string;
|
|
397
|
+
privateRecipientSlackUserId?: string;
|
|
398
|
+
threadTimestamp: string;
|
|
399
|
+
fileId: string;
|
|
400
|
+
title: string;
|
|
401
|
+
}): Promise<{
|
|
402
|
+
fileId: string;
|
|
403
|
+
} & {
|
|
404
|
+
receipt: SlackBotReceipt;
|
|
405
|
+
}>;
|
|
406
|
+
reconcileFileUpload(input: {
|
|
407
|
+
channelId: string;
|
|
408
|
+
privateRecipientSlackUserId?: string;
|
|
409
|
+
threadTimestamp: string;
|
|
410
|
+
fileId: string;
|
|
411
|
+
}): Promise<{
|
|
412
|
+
shared: boolean;
|
|
413
|
+
} & {
|
|
414
|
+
receipt: SlackBotReceipt;
|
|
415
|
+
}>;
|
|
416
|
+
private requireFileUploadScope;
|
|
417
|
+
/**
|
|
418
|
+
* Replace one Slack user's private App Home view. `views.publish` is a
|
|
419
|
+
* naturally convergent replace operation: Slack event retries may safely
|
|
420
|
+
* repeat the exact bounded view without creating duplicate provider state.
|
|
421
|
+
*/
|
|
422
|
+
publishHomeView(input: {
|
|
423
|
+
userId: string;
|
|
424
|
+
blocks: SlackHomeBlock[];
|
|
425
|
+
hash?: string | null;
|
|
426
|
+
}): Promise<{
|
|
427
|
+
viewId: string;
|
|
428
|
+
} & {
|
|
429
|
+
receipt: SlackBotReceipt;
|
|
430
|
+
}>;
|
|
205
431
|
slackTaskPolicyFacts(channelId: string, userId: string): Promise<({
|
|
206
432
|
conversation: {
|
|
207
433
|
id: string;
|
|
@@ -210,6 +436,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
210
436
|
isMember: boolean;
|
|
211
437
|
isDirectMessage: boolean;
|
|
212
438
|
isMpim: boolean;
|
|
439
|
+
userId: string | null;
|
|
213
440
|
isArchived: boolean;
|
|
214
441
|
isShared: boolean;
|
|
215
442
|
isExternallyShared: boolean;
|
|
@@ -231,6 +458,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
231
458
|
isMember: boolean;
|
|
232
459
|
isDirectMessage: boolean;
|
|
233
460
|
isMpim: boolean;
|
|
461
|
+
userId: string | null;
|
|
234
462
|
isArchived: boolean;
|
|
235
463
|
isShared: boolean;
|
|
236
464
|
isExternallyShared: boolean;
|
|
@@ -267,6 +495,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
267
495
|
isMember: boolean;
|
|
268
496
|
isDirectMessage: boolean;
|
|
269
497
|
isMpim: boolean;
|
|
498
|
+
userId: string | null;
|
|
270
499
|
isArchived: boolean;
|
|
271
500
|
isShared: boolean;
|
|
272
501
|
isExternallyShared: boolean;
|
|
@@ -318,6 +547,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
318
547
|
isMember: boolean;
|
|
319
548
|
isDirectMessage: boolean;
|
|
320
549
|
isMpim: boolean;
|
|
550
|
+
userId: string | null;
|
|
321
551
|
isArchived: boolean;
|
|
322
552
|
isShared: boolean;
|
|
323
553
|
isExternallyShared: boolean;
|
|
@@ -358,7 +588,6 @@ export declare class OpenGeniSlackBotClient {
|
|
|
358
588
|
messageTimestamp: string;
|
|
359
589
|
checkpoint: unknown | null;
|
|
360
590
|
checkpointBinding: SlackReactionContextCheckpointBinding;
|
|
361
|
-
saveCheckpoint: (checkpoint: SlackReactionContextCheckpoint) => Promise<void>;
|
|
362
591
|
}): Promise<{
|
|
363
592
|
channel: {
|
|
364
593
|
id: string;
|
|
@@ -367,6 +596,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
367
596
|
isMember: boolean;
|
|
368
597
|
isDirectMessage: boolean;
|
|
369
598
|
isMpim: boolean;
|
|
599
|
+
userId: string | null;
|
|
370
600
|
isArchived: boolean;
|
|
371
601
|
isShared: boolean;
|
|
372
602
|
isExternallyShared: boolean;
|
|
@@ -417,6 +647,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
417
647
|
}[];
|
|
418
648
|
}[];
|
|
419
649
|
truncated: boolean;
|
|
650
|
+
contextUnavailable?: boolean;
|
|
420
651
|
} & {
|
|
421
652
|
receipt: SlackBotReceipt;
|
|
422
653
|
}>;
|
|
@@ -433,9 +664,10 @@ export declare class OpenGeniSlackBotClient {
|
|
|
433
664
|
name: string;
|
|
434
665
|
title: string;
|
|
435
666
|
}[];
|
|
667
|
+
authorizeSharedRead?: () => Promise<void>;
|
|
436
668
|
}): Promise<PreparedSlackReactionImage[]>;
|
|
437
669
|
/** Download and fully validate one previously authorized Slack image. */
|
|
438
|
-
downloadReactionImage(input: PreparedSlackReactionImage): Promise<DownloadedSlackReactionImage>;
|
|
670
|
+
downloadReactionImage(input: PreparedSlackReactionImage, authorizeSharedRead?: () => Promise<void>): Promise<DownloadedSlackReactionImage>;
|
|
439
671
|
listUsers(input?: {
|
|
440
672
|
limit?: number;
|
|
441
673
|
cursor?: string;
|
|
@@ -452,6 +684,64 @@ export declare class OpenGeniSlackBotClient {
|
|
|
452
684
|
} & {
|
|
453
685
|
receipt: SlackBotReceipt;
|
|
454
686
|
}>;
|
|
687
|
+
/**
|
|
688
|
+
* Public search in a trusted Slack interaction through Real-time Search
|
|
689
|
+
* (`assistant.search.context`) under the bot identity. Unlisted deployments
|
|
690
|
+
* cannot use this API; approved deployments also need Slack's action token.
|
|
691
|
+
*
|
|
692
|
+
* The bot never carries private-search authority: `channel_types` is pinned
|
|
693
|
+
* to `public_channel` server-side regardless of caller input, so private
|
|
694
|
+
* channels, DMs, and MPIMs remain reachable only through a member's personal
|
|
695
|
+
* hosted-MCP grant. An install predating the search scopes fails closed with
|
|
696
|
+
* a reinstall hint instead of leaking Slack's `missing_scope` error.
|
|
697
|
+
*/
|
|
698
|
+
searchContext(input: {
|
|
699
|
+
query: string;
|
|
700
|
+
/** Server-owned Slack interaction token, never an agent tool argument. */
|
|
701
|
+
actionToken?: string;
|
|
702
|
+
contentTypes?: readonly ("messages" | "files" | "channels")[];
|
|
703
|
+
includeBots?: boolean;
|
|
704
|
+
/** UNIX seconds bounds on message timestamps. */
|
|
705
|
+
before?: number;
|
|
706
|
+
after?: number;
|
|
707
|
+
sort?: "score" | "timestamp";
|
|
708
|
+
sortDir?: "asc" | "desc";
|
|
709
|
+
cursor?: string;
|
|
710
|
+
limit?: number;
|
|
711
|
+
}): Promise<{
|
|
712
|
+
messages: {
|
|
713
|
+
channelId: string;
|
|
714
|
+
channelName: string;
|
|
715
|
+
ts: string;
|
|
716
|
+
authorUserId: string;
|
|
717
|
+
authorName: string;
|
|
718
|
+
isAuthorBot: boolean;
|
|
719
|
+
content: string;
|
|
720
|
+
permalink: string | null;
|
|
721
|
+
}[];
|
|
722
|
+
files: {
|
|
723
|
+
id: string;
|
|
724
|
+
title: string;
|
|
725
|
+
filetype: string;
|
|
726
|
+
authorUserId: string;
|
|
727
|
+
authorName: string;
|
|
728
|
+
dateCreated: number | null;
|
|
729
|
+
dateUpdated: number | null;
|
|
730
|
+
content: string;
|
|
731
|
+
permalink: string | null;
|
|
732
|
+
}[];
|
|
733
|
+
channels: {
|
|
734
|
+
name: string;
|
|
735
|
+
topic: string;
|
|
736
|
+
purpose: string;
|
|
737
|
+
creatorUserId: string;
|
|
738
|
+
dateCreated: number | null;
|
|
739
|
+
permalink: string | null;
|
|
740
|
+
}[];
|
|
741
|
+
nextCursor: string | null;
|
|
742
|
+
} & {
|
|
743
|
+
receipt: SlackBotReceipt;
|
|
744
|
+
}>;
|
|
455
745
|
listFiles(input: {
|
|
456
746
|
channelId: string;
|
|
457
747
|
limit?: number;
|
|
@@ -464,6 +754,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
464
754
|
isMember: boolean;
|
|
465
755
|
isDirectMessage: boolean;
|
|
466
756
|
isMpim: boolean;
|
|
757
|
+
userId: string | null;
|
|
467
758
|
isArchived: boolean;
|
|
468
759
|
isShared: boolean;
|
|
469
760
|
isExternallyShared: boolean;
|
|
@@ -503,6 +794,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
503
794
|
isMember: boolean;
|
|
504
795
|
isDirectMessage: boolean;
|
|
505
796
|
isMpim: boolean;
|
|
797
|
+
userId: string | null;
|
|
506
798
|
isArchived: boolean;
|
|
507
799
|
isShared: boolean;
|
|
508
800
|
isExternallyShared: boolean;
|
|
@@ -534,7 +826,51 @@ export declare class OpenGeniSlackBotClient {
|
|
|
534
826
|
fileId: string;
|
|
535
827
|
parentFileId?: string;
|
|
536
828
|
offset?: number;
|
|
537
|
-
}): Promise<{
|
|
829
|
+
}): Promise<({
|
|
830
|
+
channel: {
|
|
831
|
+
id: string;
|
|
832
|
+
name: string;
|
|
833
|
+
isPrivate: boolean;
|
|
834
|
+
isMember: boolean;
|
|
835
|
+
isDirectMessage: boolean;
|
|
836
|
+
isMpim: boolean;
|
|
837
|
+
userId: string | null;
|
|
838
|
+
isArchived: boolean;
|
|
839
|
+
isShared: boolean;
|
|
840
|
+
isExternallyShared: boolean;
|
|
841
|
+
isOrgShared: boolean;
|
|
842
|
+
isPendingExternallyShared: boolean;
|
|
843
|
+
contextTeamId: string | null;
|
|
844
|
+
connectedTeamIds: string[] | null;
|
|
845
|
+
sharedTeamIds: string[] | null;
|
|
846
|
+
topic: string;
|
|
847
|
+
purpose: string;
|
|
848
|
+
numMembers: number | null;
|
|
849
|
+
};
|
|
850
|
+
file: {
|
|
851
|
+
id: string;
|
|
852
|
+
name: string;
|
|
853
|
+
title: string;
|
|
854
|
+
mimetype: string;
|
|
855
|
+
filetype: string;
|
|
856
|
+
mode: string;
|
|
857
|
+
size: number | null;
|
|
858
|
+
originatingHuddleId: string;
|
|
859
|
+
huddleTranscriptFileId: string;
|
|
860
|
+
};
|
|
861
|
+
image: Readonly<{
|
|
862
|
+
fileId: string;
|
|
863
|
+
filename: string;
|
|
864
|
+
contentType: "image/png" | "image/jpeg" | "image/webp";
|
|
865
|
+
bytes: Uint8Array;
|
|
866
|
+
}>;
|
|
867
|
+
contentType?: never;
|
|
868
|
+
offset?: never;
|
|
869
|
+
content?: never;
|
|
870
|
+
nextOffset?: never;
|
|
871
|
+
truncated?: never;
|
|
872
|
+
} | {
|
|
873
|
+
image?: never;
|
|
538
874
|
channel: {
|
|
539
875
|
id: string;
|
|
540
876
|
name: string;
|
|
@@ -542,6 +878,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
542
878
|
isMember: boolean;
|
|
543
879
|
isDirectMessage: boolean;
|
|
544
880
|
isMpim: boolean;
|
|
881
|
+
userId: string | null;
|
|
545
882
|
isArchived: boolean;
|
|
546
883
|
isShared: boolean;
|
|
547
884
|
isExternallyShared: boolean;
|
|
@@ -570,7 +907,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
570
907
|
content: string;
|
|
571
908
|
nextOffset: number | null;
|
|
572
909
|
truncated: boolean;
|
|
573
|
-
} & {
|
|
910
|
+
}) & {
|
|
574
911
|
receipt: SlackBotReceipt;
|
|
575
912
|
}>;
|
|
576
913
|
/**
|
|
@@ -637,15 +974,19 @@ export declare class OpenGeniSlackBotClient {
|
|
|
637
974
|
private recordAudit;
|
|
638
975
|
private auditMetadata;
|
|
639
976
|
}
|
|
977
|
+
/** Full decode guards the model image block against header-only or corrupt files. */
|
|
978
|
+
export declare function validateSlackMcpImage(bytes: Uint8Array): Promise<void>;
|
|
640
979
|
export declare function createOpenGeniSlackBotClient(deps: {
|
|
641
980
|
db: Database;
|
|
642
981
|
settings: Settings;
|
|
643
982
|
slackFetch?: typeof fetch;
|
|
983
|
+
authorizeProviderRequest?: SlackProviderAuthorization;
|
|
644
984
|
}, resolved: Awaited<ReturnType<typeof resolveSlackBotConnectionForTool>>): OpenGeniSlackBotClient;
|
|
645
985
|
export declare function createOpenGeniSlackBotInteractionClient(deps: {
|
|
646
986
|
db: Database;
|
|
647
987
|
settings: Settings;
|
|
648
988
|
slackFetch?: typeof fetch;
|
|
989
|
+
authorizeProviderRequest?: SlackProviderAuthorization;
|
|
649
990
|
}, input: {
|
|
650
991
|
accountId: string;
|
|
651
992
|
workspaceId: string;
|
|
@@ -653,6 +994,12 @@ export declare function createOpenGeniSlackBotInteractionClient(deps: {
|
|
|
653
994
|
subjectId: string;
|
|
654
995
|
sessionId?: string | null;
|
|
655
996
|
}): Promise<OpenGeniSlackBotClient>;
|
|
997
|
+
/** A private route needs live provider proof of the exact linked requester's bot IM. */
|
|
998
|
+
export declare function assertSlackPrivateTaskRecipient(channel: {
|
|
999
|
+
isDirectMessage: boolean;
|
|
1000
|
+
isMpim: boolean;
|
|
1001
|
+
userId: string | null;
|
|
1002
|
+
}, slackUserId: string): void;
|
|
656
1003
|
export declare function sniffSlackReactionImageMime(bytes: Uint8Array): "image/png" | "image/jpeg" | "image/webp" | null;
|
|
657
1004
|
export declare function resolveSlackFilesListPage(input: {
|
|
658
1005
|
channelId: string;
|
|
@@ -665,4 +1012,12 @@ export declare function createSlackFilesListCursor(input: {
|
|
|
665
1012
|
page: number;
|
|
666
1013
|
}, context: SlackFilesCursorContext): string;
|
|
667
1014
|
export declare function nextSlackFilesListPage(payload: SlackPayload, requested: SlackFilesListPage, returnedFileCount: number): number | null;
|
|
1015
|
+
/**
|
|
1016
|
+
* Slack action IDs are unique within a block. Keep the logical card untouched
|
|
1017
|
+
* for the durable request digest, and partition repeated actions only on the
|
|
1018
|
+
* provider wire. In particular, a legacy invalid_blocks receipt can retry with
|
|
1019
|
+
* its original operation ID and digest; completed/uncertain posts keep their
|
|
1020
|
+
* existing replay/reconciliation path. Values and action IDs remain exact.
|
|
1021
|
+
*/
|
|
1022
|
+
export declare function slackMessageWireBlocks(blocks: SlackMessageBlock[] | undefined): SlackMessageBlock[] | undefined;
|
|
668
1023
|
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** Durability port: checkpoints must be lease-fenced before any provider write. */
|
|
2
|
+
export type SlackFileUploadPhase = "pending" | "uploading" | "uploaded" | "completing" | "outcome_unknown" | "completed";
|
|
3
|
+
export type SlackFileUploadState = {
|
|
4
|
+
phase: SlackFileUploadPhase;
|
|
5
|
+
slackFileId: string | null;
|
|
6
|
+
};
|
|
7
|
+
export type SlackFileUploadProvider = {
|
|
8
|
+
allocateFileUpload(input: {
|
|
9
|
+
channelId: string;
|
|
10
|
+
privateRecipientSlackUserId?: string;
|
|
11
|
+
filename: string;
|
|
12
|
+
sizeBytes: number;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
fileId: string;
|
|
15
|
+
uploadUrl: URL;
|
|
16
|
+
}>;
|
|
17
|
+
transferFileUpload(input: {
|
|
18
|
+
channelId: string;
|
|
19
|
+
privateRecipientSlackUserId?: string;
|
|
20
|
+
uploadUrl: URL;
|
|
21
|
+
bytes: Uint8Array;
|
|
22
|
+
}): Promise<unknown>;
|
|
23
|
+
completeFileUpload(input: {
|
|
24
|
+
channelId: string;
|
|
25
|
+
privateRecipientSlackUserId?: string;
|
|
26
|
+
threadTimestamp: string;
|
|
27
|
+
fileId: string;
|
|
28
|
+
title: string;
|
|
29
|
+
}): Promise<unknown>;
|
|
30
|
+
reconcileFileUpload(input: {
|
|
31
|
+
channelId: string;
|
|
32
|
+
privateRecipientSlackUserId?: string;
|
|
33
|
+
threadTimestamp: string;
|
|
34
|
+
fileId: string;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
shared: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
export declare class SlackFileUploadClaimLostError extends Error {
|
|
40
|
+
constructor();
|
|
41
|
+
}
|
|
42
|
+
export declare class SlackFileUploadOutcomeUnknownError extends Error {
|
|
43
|
+
constructor();
|
|
44
|
+
}
|
|
45
|
+
/** No automatic retries. An uncertain completion is reconciled, never resent. */
|
|
46
|
+
export declare function runSlackFileUpload(input: {
|
|
47
|
+
state: SlackFileUploadState;
|
|
48
|
+
provider: SlackFileUploadProvider;
|
|
49
|
+
checkpoint: (update: {
|
|
50
|
+
expectedPhase: SlackFileUploadPhase;
|
|
51
|
+
phase: SlackFileUploadPhase;
|
|
52
|
+
slackFileId?: string;
|
|
53
|
+
}) => Promise<boolean>;
|
|
54
|
+
channelId: string;
|
|
55
|
+
privateRecipientSlackUserId?: string;
|
|
56
|
+
threadTimestamp: string;
|
|
57
|
+
filename: string;
|
|
58
|
+
bytes: Uint8Array;
|
|
59
|
+
}): Promise<{
|
|
60
|
+
slackFileId: string;
|
|
61
|
+
replayed: boolean;
|
|
62
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExternalActorContinuation } from "@opengeni/contracts/external-identities";
|
|
2
|
+
import { type ApiRouteDeps } from "@opengeni/core";
|
|
3
|
+
export declare function requireOpenGeniSlackOAuthSettings(settings: ApiRouteDeps["settings"]): {
|
|
4
|
+
clientId: string;
|
|
5
|
+
clientSecret: string;
|
|
6
|
+
};
|
|
7
|
+
/** Only authenticated route admission may invoke this workspace-bot starter.
|
|
8
|
+
* Hosted personal Slack MCP deliberately uses its own OAuth profile. */
|
|
9
|
+
export declare function startSlackBotInstall(deps: ApiRouteDeps, input: {
|
|
10
|
+
accountId: string;
|
|
11
|
+
workspaceId: string;
|
|
12
|
+
subjectId: string;
|
|
13
|
+
requestUrl: string;
|
|
14
|
+
connectionId?: string;
|
|
15
|
+
connectAttemptId?: string;
|
|
16
|
+
externalContinuation?: ExternalActorContinuation;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
authorizationUrl: string;
|
|
19
|
+
expiresAt: string;
|
|
20
|
+
}>;
|