@opengeni/api-router 3.0.1 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-grant-rls.d.ts +8 -1
- package/dist/admission-trace.d.ts +8 -0
- package/dist/app.d.ts +50 -3
- package/dist/app.js +10 -1
- package/dist/artifact-catalog-cursor.d.ts +1 -0
- package/dist/attached-browser-viewer.d.ts +11 -0
- package/dist/auth/managed-auth-attempt-context.d.ts +2 -0
- package/dist/auth/managed-auth-rate-limits.d.ts +167 -0
- package/dist/auth/managed-auth-session-adapter.d.ts +9 -1
- package/dist/auth/managed-auth.d.ts +72 -5
- package/dist/auth/managed-sign-in-notifications.d.ts +4 -0
- package/dist/auth/new-signups-gate.d.ts +23 -0
- package/dist/auth/signup-funnel-metrics.d.ts +44 -0
- package/dist/azure-live.d.ts +28 -0
- package/dist/browser-action-fences.d.ts +13 -0
- package/dist/browser-controller-authority.d.ts +1 -61
- package/dist/browser-ephemeral.d.ts +5 -0
- package/dist/browser-lost-runtime-end.d.ts +24 -0
- package/dist/browser-state-authority.d.ts +1 -27
- package/dist/chunk-OGQDXVXY.js +18 -0
- package/dist/chunk-OGQDXVXY.js.map +1 -0
- package/dist/{chunk-AJ62T5QN.js → chunk-OT56OY4V.js} +80503 -39869
- package/dist/chunk-OT56OY4V.js.map +1 -0
- package/dist/claude-default-models.d.ts +19 -0
- package/dist/claude-subscription-core.d.ts +50 -0
- package/dist/claude-subscription-oauth.d.ts +36 -0
- package/dist/claude-subscription-profile.d.ts +9 -0
- package/dist/claude-subscription-usage.d.ts +6 -0
- package/dist/claude-workspace-connection.d.ts +15 -0
- package/dist/codemode.d.ts +40 -5
- package/dist/codex-realtime.d.ts +29 -3
- package/dist/codex-session-pointers.d.ts +19 -0
- package/dist/connection-ownership.d.ts +6 -3
- package/dist/controller-data-plane.d.ts +16 -0
- package/dist/credit-promotion-snapshot.d.ts +6 -0
- package/dist/editable-artifact-source-session.d.ts +3 -0
- package/dist/editable-artifact-websocket.d.ts +5 -3
- package/dist/fatal-process-boundary.d.ts +9 -1
- package/dist/github-access.d.ts +7 -1
- package/dist/github-browser-flow.d.ts +1 -1
- package/dist/http/acting-person.d.ts +36 -0
- package/dist/http/api-contract-compat.d.ts +19 -0
- package/dist/http/api-error.d.ts +50 -1
- package/dist/http/auth.d.ts +8 -1
- package/dist/http/cors.d.ts +12 -0
- package/dist/http/deprecation.d.ts +42 -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/rejection-telemetry.d.ts +34 -0
- package/dist/http/request-body.d.ts +27 -0
- package/dist/http/request-source.d.ts +41 -3
- package/dist/http/sse.d.ts +12 -1
- package/dist/http/unmatched-route.d.ts +18 -0
- package/dist/http/user-content.d.ts +36 -0
- package/dist/http/variable-sets-removed.d.ts +41 -0
- package/dist/http/websocket-upgrade-dispatch.d.ts +18 -0
- package/dist/index.js +1279 -108
- package/dist/index.js.map +1 -1
- package/dist/integration-connect-metrics.d.ts +35 -0
- package/dist/integration-endpoint-test.d.ts +20 -0
- package/dist/integrations/api-integrations.d.ts +2 -2
- package/dist/integrations/atlassian.d.ts +8 -3
- package/dist/integrations/fiken.d.ts +3 -1
- package/dist/integrations/github-lens-connect.d.ts +37 -66
- package/dist/integrations/google-drive.d.ts +2 -0
- package/dist/integrations/integration-commit-authority.d.ts +13 -0
- package/dist/integrations/marketplace-plugin.d.ts +43 -43
- package/dist/integrations/oauth-client.d.ts +171 -12
- package/dist/integrations/oauth-profiles.d.ts +42 -13
- package/dist/integrations/onepassword-vault-provider.d.ts +9 -0
- package/dist/integrations/slack-bot.d.ts +285 -7
- package/dist/integrations/slack-file-upload-flow.d.ts +62 -0
- package/dist/integrations/slack-interactions.d.ts +89 -10
- package/dist/integrations/slack-mrkdwn.d.ts +41 -0
- package/dist/integrations/slack-routing.d.ts +1 -1
- package/dist/integrations/slack-session-defaults.d.ts +58 -0
- package/dist/integrations/slack-task-file-upload.d.ts +36 -0
- package/dist/integrations/slack-tool-review.d.ts +5 -0
- package/dist/interaction-agent-access.d.ts +13 -8
- package/dist/interaction-agent-version.d.ts +21 -0
- package/dist/interaction-holder-heartbeat.d.ts +5 -0
- package/dist/interaction-metrics.d.ts +27 -2
- package/dist/interaction-route-stages.d.ts +25 -0
- package/dist/interaction-secrets-vault.d.ts +20 -0
- package/dist/interaction-secrets.d.ts +103 -0
- package/dist/mcp/action-catalog-types.d.ts +14 -0
- package/dist/mcp/action-catalog.gen.d.ts +2 -0
- package/dist/mcp/action-descriptions.d.ts +4 -0
- package/dist/mcp/action-schema-imports.gen.d.ts +1 -0
- package/dist/mcp/capability-account-readiness.d.ts +7 -0
- package/dist/mcp/child-read-evidence.d.ts +9 -0
- package/dist/mcp/company-profile-agent-admin.d.ts +12 -0
- package/dist/mcp/contract-input.d.ts +13 -0
- package/dist/mcp/documents.d.ts +2 -0
- package/dist/mcp/first-party-tool-permissions.d.ts +3 -606
- package/dist/mcp/notification-tools.d.ts +26 -0
- package/dist/mcp/orchestration-failure-diagnostic.d.ts +43 -0
- package/dist/mcp/scheduled-task-input.d.ts +1309 -0
- package/dist/mcp/scheduled-task-view.d.ts +217 -3
- package/dist/mcp/secret-tools.d.ts +14 -0
- package/dist/mcp/server.d.ts +108 -5
- package/dist/mcp/session-admin-access-tools.d.ts +33 -0
- package/dist/mcp/session-event-errors.d.ts +28 -0
- package/dist/mcp/session-event-view.d.ts +62 -0
- package/dist/mcp/session-view.d.ts +15 -0
- package/dist/mcp/session-wait.d.ts +18 -0
- package/dist/mcp/site-agent-clamp-tools.d.ts +38 -0
- package/dist/mcp/site-data-tools.d.ts +22 -0
- package/dist/mcp/site-publication-tools.d.ts +19 -0
- package/dist/mcp/site-sql-tools.d.ts +27 -0
- package/dist/mcp-oauth.d.ts +37 -4
- package/dist/model-calls/chat-completions.d.ts +87 -0
- package/dist/model-calls/pending-usage-settlements.d.ts +57 -0
- package/dist/model-calls/service.d.ts +36 -0
- package/dist/model-catalog.d.ts +9 -3
- package/dist/native-push-dispatch.d.ts +69 -0
- package/dist/observability.d.ts +3 -1
- package/dist/organization-mcp.d.ts +82 -0
- package/dist/prepared-mcp-actor.d.ts +77 -0
- package/dist/prepared-mcp-permissions.d.ts +8 -0
- package/dist/routes/analytics-consent.d.ts +26 -0
- package/dist/routes/api-integrations.d.ts +11 -0
- package/dist/routes/api-keys.d.ts +7 -7
- package/dist/routes/automations.d.ts +2 -0
- package/dist/routes/billing.d.ts +59 -0
- package/dist/routes/browser-sessions.d.ts +65 -2
- package/dist/routes/chat-completions.d.ts +11 -0
- package/dist/routes/claude-core-usage.d.ts +20 -0
- 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 +182 -0
- package/dist/routes/codex-core.d.ts +401 -0
- package/dist/routes/codex.d.ts +64 -2
- package/dist/routes/computer-sessions.d.ts +6 -1
- package/dist/routes/desktop-distribution.d.ts +32 -0
- package/dist/routes/github-browser-fonts.gen.d.ts +2 -0
- package/dist/routes/github-browser-pages.d.ts +27 -0
- package/dist/routes/inbox.d.ts +13 -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 +28 -0
- package/dist/routes/interaction-placement-message.d.ts +7 -0
- package/dist/routes/managed-sign-in-methods.d.ts +6 -0
- package/dist/routes/model-account-choice.d.ts +13 -0
- package/dist/routes/model-account-settings.d.ts +19 -0
- package/dist/routes/native-app-auth.d.ts +12 -0
- package/dist/routes/organization-integration-policy.d.ts +8 -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-defaults.d.ts +9 -0
- package/dist/routes/organization-service-accounts.d.ts +3 -0
- package/dist/routes/personal-api-keys.d.ts +3 -0
- package/dist/routes/session-admin-access.d.ts +3 -0
- package/dist/routes/session-artifact-associations.d.ts +4 -0
- package/dist/routes/session-history-imports.d.ts +20 -0
- package/dist/routes/sessions.d.ts +38 -2
- package/dist/routes/site-data.d.ts +18 -0
- package/dist/routes/site-publishing.d.ts +5 -0
- package/dist/routes/site-runtime.d.ts +31 -0
- package/dist/routes/site-sql.d.ts +16 -0
- package/dist/routes/slack-bot-access.d.ts +3 -0
- package/dist/routes/subscription-account-pools.d.ts +21 -0
- package/dist/routes/subscription-core-http.d.ts +5 -0
- package/dist/routes/subscription-pool-access.d.ts +37 -0
- package/dist/routes/subscription-pool-core.d.ts +153 -0
- package/dist/routes/supergrok.d.ts +6 -6
- package/dist/routes/usage-allowances.d.ts +12 -0
- package/dist/routes/variable-sets-removed.d.ts +2 -0
- package/dist/routes/vault-providers.d.ts +34 -0
- package/dist/routes/vaults.d.ts +3 -0
- package/dist/routes/workspace-integrations.d.ts +35 -0
- package/dist/routes/workspace-model-providers.d.ts +4 -0
- package/dist/routes/workspaces.d.ts +11 -2
- package/dist/sandbox/agent-update.d.ts +64 -0
- package/dist/sandbox/auth-callout.d.ts +8 -0
- package/dist/sandbox/channel-a.d.ts +15 -1
- package/dist/sandbox/enrollment.d.ts +26 -4
- package/dist/sandbox/machine-audience.d.ts +29 -0
- package/dist/sandbox/machines.d.ts +15 -2
- package/dist/sandbox/metrics-ingestion.d.ts +6 -2
- package/dist/sandbox/screen-control.d.ts +85 -0
- package/dist/sandbox/viewer.d.ts +5 -1
- package/dist/sandbox-file-artifacts.d.ts +17 -1
- package/dist/scheduled-task-blockers.d.ts +39 -0
- package/dist/scheduled-task-deletion.d.ts +3 -4
- package/dist/scheduled-task-lifecycle.d.ts +14 -0
- package/dist/secret-answers.d.ts +40 -0
- package/dist/session-create-observability.d.ts +5 -0
- package/dist/session-event-view-36GO3IL7.js +528 -0
- package/dist/session-event-view-36GO3IL7.js.map +1 -0
- package/dist/signed-state-secret.d.ts +18 -0
- package/dist/site-agent-guard.d.ts +53 -0
- package/dist/site-data/operations.d.ts +103 -0
- package/dist/site-data/service.d.ts +203 -0
- package/dist/site-frame-guard.d.ts +32 -0
- package/dist/site-publishing/agent-data-tools.d.ts +84 -0
- package/dist/site-publishing/agent-model.d.ts +58 -0
- package/dist/site-publishing/agent-session.d.ts +16 -0
- package/dist/site-publishing/content-scanner.d.ts +31 -0
- package/dist/site-publishing/edge-sync.d.ts +48 -0
- package/dist/site-publishing/gateway-signature.d.ts +56 -0
- package/dist/site-publishing/limits.d.ts +63 -0
- package/dist/site-publishing/page-tool-authority.d.ts +30 -0
- package/dist/site-publishing/platform-usage.d.ts +113 -0
- package/dist/site-publishing/platform.d.ts +21 -0
- package/dist/site-publishing/readiness.d.ts +62 -0
- package/dist/site-publishing/runtime.d.ts +179 -0
- package/dist/site-publishing/service.d.ts +264 -0
- package/dist/site-publishing/session-events.d.ts +22 -0
- package/dist/site-publishing/session-views.d.ts +36 -0
- package/dist/site-publishing/viewer.d.ts +40 -0
- package/dist/site-session-origin.d.ts +31 -6
- package/dist/site-sql/format.d.ts +47 -0
- package/dist/site-sql/gateway.d.ts +50 -0
- package/dist/site-sql/service.d.ts +213 -0
- package/dist/temporal-schedule-sync.d.ts +26 -0
- package/dist/transcription/billing-refusal.d.ts +8 -0
- package/dist/transcription/normalize.d.ts +23 -0
- package/dist/transcription/providers/azure-mai.d.ts +12 -0
- package/dist/transcription/providers/azure-openai.d.ts +4 -0
- package/dist/transcription/providers/openai.d.ts +16 -0
- package/dist/transcription/providers/subscription-core.d.ts +39 -0
- package/dist/transcription/service.d.ts +10 -1
- package/dist/transcription/wav-duration.d.ts +8 -0
- package/dist/workspace-tool-gateway-attestations.d.ts +37 -0
- package/dist/workspace-tool-gateway-observability.d.ts +16 -0
- package/dist/workspace-tool-gateway-secrets.d.ts +27 -0
- package/dist/workspace-tool-gateway.d.ts +102 -6
- package/dist/workspace-tool-target-fence.d.ts +116 -0
- package/dist/workspace-tool-target.d.ts +225 -0
- package/dist/workspace-webhook-dispatch.d.ts +26 -0
- package/dist/xai-subscription-core.d.ts +60 -0
- package/package.json +25 -20
- package/src/access-grant-rls.ts +64 -14
- package/src/admission-trace.ts +14 -0
- package/src/app.ts +1684 -252
- package/src/artifact-catalog-cursor.ts +1 -0
- package/src/attached-browser-viewer.ts +26 -0
- package/src/auth/managed-auth-attempt-context.ts +9 -0
- package/src/auth/managed-auth-rate-limits.ts +252 -0
- package/src/auth/managed-auth-session-adapter.ts +64 -29
- package/src/auth/managed-auth.ts +303 -35
- package/src/auth/managed-email.ts +18 -1
- 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 +3 -3
- package/src/auth/signup-funnel-metrics.ts +164 -0
- package/src/azure-live.ts +103 -0
- package/src/browser-action-fences.ts +45 -0
- package/src/browser-controller-authority.ts +1 -186
- package/src/browser-ephemeral.ts +39 -0
- package/src/browser-lost-runtime-end.ts +71 -0
- package/src/browser-state-authority.ts +1 -236
- package/src/claude-default-models.ts +37 -0
- package/src/claude-subscription-core.ts +154 -0
- package/src/claude-subscription-oauth.ts +352 -0
- package/src/claude-subscription-profile.ts +73 -0
- package/src/claude-subscription-usage.ts +51 -0
- package/src/claude-workspace-connection.ts +82 -0
- package/src/codemode.ts +236 -39
- package/src/codex-realtime.ts +181 -53
- package/src/codex-session-pointers.ts +80 -0
- package/src/company-brain-okf.ts +1 -1
- package/src/connected-machine-computer-access.ts +2 -1
- package/src/connection-ownership.ts +19 -13
- package/src/controller-data-plane.ts +34 -0
- package/src/credit-promotion-snapshot.ts +36 -0
- package/src/editable-artifact-production.ts +10 -0
- package/src/editable-artifact-source-session.ts +123 -0
- package/src/editable-artifact-websocket.ts +16 -3
- package/src/fatal-process-boundary.ts +67 -3
- package/src/gateway-realtime.ts +12 -8
- package/src/github-access.ts +31 -5
- package/src/github-browser-flow.ts +1 -1
- package/src/http/acting-person.ts +105 -0
- package/src/http/api-contract-compat.ts +49 -0
- package/src/http/api-error.ts +210 -2
- package/src/http/auth.ts +68 -4
- package/src/http/cors.ts +37 -5
- package/src/http/deprecation.ts +118 -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/rejection-telemetry.ts +120 -0
- package/src/http/request-body.ts +127 -0
- package/src/http/request-source.ts +154 -13
- package/src/http/sse.ts +88 -28
- package/src/http/unmatched-route.ts +60 -0
- package/src/http/user-content.ts +158 -0
- package/src/http/variable-sets-removed.ts +122 -0
- package/src/http/websocket-upgrade-dispatch.ts +29 -0
- package/src/index.ts +107 -57
- package/src/integration-connect-metrics.ts +228 -0
- package/src/integration-endpoint-test.ts +291 -0
- package/src/integrations/api-integrations.ts +81 -7
- package/src/integrations/atlassian.ts +202 -83
- package/src/integrations/fiken.ts +66 -38
- package/src/integrations/github-app-connect.ts +64 -18
- package/src/integrations/github-lens-connect.ts +8 -29
- package/src/integrations/google-drive.ts +448 -152
- package/src/integrations/integration-commit-authority.ts +69 -0
- package/src/integrations/marketplace-plugin.ts +1 -1
- package/src/integrations/oauth-client.ts +733 -193
- package/src/integrations/oauth-profiles.ts +116 -45
- package/src/integrations/onepassword-vault-provider.ts +16 -0
- package/src/integrations/personal-github-repositories.ts +1 -1
- package/src/integrations/personal-github.ts +61 -35
- package/src/integrations/provider-oauth.ts +67 -85
- package/src/integrations/slack-app-home.ts +5 -5
- package/src/integrations/slack-bot.ts +893 -201
- package/src/integrations/slack-file-upload-flow.ts +147 -0
- package/src/integrations/slack-install.ts +7 -7
- package/src/integrations/slack-interactions.ts +1589 -299
- package/src/integrations/slack-mrkdwn.ts +193 -0
- package/src/integrations/slack-routing.ts +2 -2
- package/src/integrations/slack-session-defaults.ts +224 -0
- package/src/integrations/slack-task-file-upload.ts +323 -0
- package/src/integrations/slack-tool-review.ts +65 -0
- package/src/integrations/social-oauth.ts +90 -58
- package/src/interaction-agent-access.ts +40 -20
- package/src/interaction-agent-version.ts +85 -0
- package/src/interaction-holder-heartbeat.ts +24 -8
- package/src/interaction-metrics.ts +164 -2
- package/src/interaction-route-stages.ts +94 -0
- package/src/interaction-secrets-vault.ts +213 -0
- package/src/interaction-secrets.ts +426 -0
- package/src/mcp/action-catalog-types.ts +14 -0
- package/src/mcp/action-catalog.gen.ts +8014 -0
- package/src/mcp/action-descriptions.ts +299 -0
- package/src/mcp/action-schema-imports.gen.ts +304 -0
- package/src/mcp/capability-account-readiness.ts +17 -0
- package/src/mcp/child-read-evidence.ts +19 -0
- package/src/mcp/company-profile-agent-admin.ts +13 -0
- package/src/mcp/contract-input.ts +165 -0
- package/src/mcp/documents.ts +9 -2
- package/src/mcp/editable-artifacts.ts +29 -11
- package/src/mcp/files.ts +5 -1
- package/src/mcp/first-party-tool-permissions.ts +7 -285
- package/src/mcp/knowledge-entries.ts +108 -34
- package/src/mcp/notification-tools.ts +480 -0
- package/src/mcp/orchestration-failure-diagnostic.ts +43 -0
- package/src/mcp/scheduled-task-input.ts +89 -0
- package/src/mcp/scheduled-task-view.ts +63 -3
- package/src/mcp/secret-tools.ts +185 -0
- package/src/mcp/server.ts +2213 -1116
- package/src/mcp/session-admin-access-tools.ts +163 -0
- package/src/mcp/session-event-errors.ts +123 -0
- package/src/mcp/session-event-view.ts +395 -13
- package/src/mcp/session-view.ts +3 -0
- package/src/mcp/session-wait.ts +67 -7
- package/src/mcp/site-agent-clamp-tools.ts +140 -0
- package/src/mcp/site-data-tools.ts +339 -0
- package/src/mcp/site-publication-tools.ts +201 -0
- package/src/mcp/site-sql-tools.ts +427 -0
- package/src/mcp-oauth.ts +635 -45
- package/src/model-calls/chat-completions.ts +352 -0
- package/src/model-calls/pending-usage-settlements.ts +125 -0
- package/src/model-calls/service.ts +694 -0
- package/src/model-catalog.ts +68 -17
- package/src/native-push-dispatch.ts +457 -0
- package/src/observability.ts +15 -1
- package/src/organization-mcp.ts +485 -0
- package/src/prepared-mcp-actor.ts +154 -0
- package/src/prepared-mcp-permissions.ts +38 -0
- package/src/routes/analytics-consent.ts +123 -0
- package/src/routes/api-integrations.ts +268 -9
- package/src/routes/api-keys.ts +164 -25
- package/src/routes/artifact-catalog.ts +111 -0
- package/src/routes/automations.ts +163 -90
- package/src/routes/billing.ts +535 -59
- package/src/routes/browser-sessions.ts +966 -342
- package/src/routes/canonical-human-identities.ts +61 -0
- package/src/routes/capabilities.ts +112 -5
- package/src/routes/channels.ts +4 -3
- package/src/routes/chat-completions.ts +235 -0
- package/src/routes/claude-core-usage.ts +147 -0
- package/src/routes/claude-subscription-accounts.ts +233 -0
- package/src/routes/claude-subscription-oauth.ts +175 -0
- package/src/routes/client-errors.ts +394 -0
- package/src/routes/codex-core.ts +687 -0
- package/src/routes/codex.ts +1277 -1119
- package/src/routes/company-brain.ts +4 -0
- package/src/routes/computer-sessions.ts +319 -85
- package/src/routes/connect.ts +277 -175
- package/src/routes/connections.ts +690 -363
- package/src/routes/desktop-distribution.ts +217 -0
- package/src/routes/documents.ts +13 -7
- package/src/routes/editable-artifacts.ts +74 -4
- package/src/routes/enrollments.ts +110 -16
- package/src/routes/external-identity-links.ts +13 -12
- package/src/routes/files.ts +41 -16
- package/src/routes/github-browser-fonts.gen.ts +12 -0
- package/src/routes/github-browser-pages.ts +258 -0
- package/src/routes/github.ts +200 -75
- package/src/routes/inbox.ts +353 -0
- package/src/routes/insights-response-cache.ts +83 -0
- package/src/routes/insights-usage.ts +345 -0
- package/src/routes/insights.ts +103 -8
- package/src/routes/install.ts +51 -10
- package/src/routes/integration-facets.ts +70 -28
- package/src/routes/interaction-placement-message.ts +12 -0
- package/src/routes/knowledge.ts +136 -27
- package/src/routes/machines.ts +189 -135
- package/src/routes/managed-auth-session-sets.ts +43 -10
- package/src/routes/managed-onboarding.ts +39 -19
- package/src/routes/managed-sign-in-methods.ts +433 -0
- package/src/routes/memory-slack-publications.ts +3 -2
- package/src/routes/model-account-choice.ts +194 -0
- package/src/routes/model-account-settings.ts +235 -0
- package/src/routes/model-connection-access.ts +210 -48
- package/src/routes/native-app-auth.ts +296 -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 +183 -0
- package/src/routes/organization-memberships.ts +205 -19
- package/src/routes/organization-model-defaults.ts +110 -0
- package/src/routes/organization-model-providers.ts +74 -3
- package/src/routes/organization-service-accounts.ts +128 -0
- package/src/routes/organization-sessions.ts +21 -5
- package/src/routes/personal-api-keys.ts +184 -0
- package/src/routes/personal-github-git-broker.ts +2 -2
- package/src/routes/personal-github.ts +9 -4
- package/src/routes/plugins.ts +46 -7
- package/src/routes/pr-review-github.ts +105 -118
- package/src/routes/pr-review.ts +88 -82
- package/src/routes/preference-registry.ts +18 -0
- package/src/routes/rigs.ts +48 -13
- package/src/routes/scheduled-tasks.ts +347 -27
- package/src/routes/session-admin-access.ts +271 -0
- package/src/routes/session-artifact-associations.ts +164 -0
- package/src/routes/session-history-imports.ts +305 -0
- package/src/routes/sessions.ts +1682 -363
- package/src/routes/site-data.ts +340 -0
- package/src/routes/site-publishing.ts +584 -0
- package/src/routes/site-runtime.ts +1944 -0
- package/src/routes/site-sql.ts +263 -0
- package/src/routes/skill-content.ts +72 -7
- package/src/routes/skills.ts +5 -4
- package/src/routes/slack-bot-access.ts +108 -0
- package/src/routes/social.ts +27 -15
- package/src/routes/subscription-account-pools.ts +209 -0
- package/src/routes/subscription-core-http.ts +18 -0
- package/src/routes/subscription-pool-access.ts +180 -0
- package/src/routes/subscription-pool-core.ts +552 -0
- package/src/routes/supergrok.ts +174 -655
- package/src/routes/transcription-recordings.ts +71 -4
- package/src/routes/transcriptions.ts +26 -2
- package/src/routes/usage-allowances.ts +381 -0
- package/src/routes/variable-sets-removed.ts +19 -0
- package/src/routes/vault-providers.ts +782 -0
- package/src/routes/vaults.ts +421 -0
- package/src/routes/video-generation.ts +30 -12
- package/src/routes/workspace-artifacts.ts +165 -53
- package/src/routes/workspace-integrations.ts +576 -0
- package/src/routes/workspace-model-providers.ts +148 -0
- package/src/routes/workspace-state.ts +4 -0
- package/src/routes/workspaces.ts +625 -117
- package/src/sandbox/agent-update.ts +315 -0
- package/src/sandbox/auth-callout.ts +104 -21
- package/src/sandbox/channel-a.ts +165 -55
- package/src/sandbox/enrollment.ts +131 -22
- package/src/sandbox/machine-audience.ts +192 -0
- package/src/sandbox/machines.ts +75 -31
- package/src/sandbox/metrics-ingestion.ts +133 -2
- package/src/sandbox/rematerialize.ts +51 -21
- package/src/sandbox/screen-control.ts +289 -0
- package/src/sandbox/viewer.ts +33 -58
- package/src/sandbox-file-artifacts.ts +53 -27
- package/src/scheduled-task-blockers.ts +293 -0
- package/src/scheduled-task-deletion.ts +13 -3
- package/src/scheduled-task-lifecycle.ts +84 -0
- package/src/secret-answers.ts +119 -0
- package/src/session-create-observability.ts +46 -0
- package/src/session-realtime-context.ts +26 -4
- package/src/signed-state-secret.ts +58 -0
- package/src/site-agent-guard.ts +261 -0
- package/src/site-data/operations.ts +777 -0
- package/src/site-data/service.ts +1043 -0
- package/src/site-frame-guard.ts +107 -0
- package/src/site-publishing/agent-data-tools.ts +250 -0
- package/src/site-publishing/agent-model.ts +127 -0
- package/src/site-publishing/agent-session.ts +148 -0
- package/src/site-publishing/content-scanner.ts +93 -0
- package/src/site-publishing/edge-sync.ts +148 -0
- package/src/site-publishing/gateway-signature.ts +198 -0
- package/src/site-publishing/limits.ts +315 -0
- package/src/site-publishing/page-tool-authority.ts +111 -0
- package/src/site-publishing/platform-usage.ts +479 -0
- package/src/site-publishing/platform.ts +98 -0
- package/src/site-publishing/readiness.ts +330 -0
- package/src/site-publishing/runtime.ts +831 -0
- package/src/site-publishing/service.ts +1282 -0
- package/src/site-publishing/session-events.ts +262 -0
- package/src/site-publishing/session-views.ts +262 -0
- package/src/site-publishing/viewer.ts +75 -0
- package/src/site-session-origin.ts +91 -6
- package/src/site-sql/format.ts +134 -0
- package/src/site-sql/gateway.ts +168 -0
- package/src/site-sql/service.ts +1636 -0
- package/src/site-uploads.ts +27 -5
- package/src/temporal-schedule-sync.ts +74 -0
- package/src/transcription/billing-refusal.ts +14 -0
- package/src/transcription/normalize.ts +77 -0
- package/src/transcription/providers/azure-mai.ts +98 -0
- package/src/transcription/providers/azure-openai.ts +16 -7
- package/src/transcription/providers/codex-subscription.ts +190 -67
- package/src/transcription/providers/openai.ts +79 -5
- package/src/transcription/providers/subscription-core.ts +125 -0
- package/src/transcription/providers/xai-subscription.ts +81 -83
- package/src/transcription/segmenter.ts +7 -1
- package/src/transcription/service.ts +239 -10
- package/src/transcription/wav-duration.ts +39 -0
- package/src/workspace-deletion.ts +25 -1
- package/src/workspace-tool-gateway-attestations.ts +133 -0
- package/src/workspace-tool-gateway-observability.ts +64 -0
- package/src/workspace-tool-gateway-secrets.ts +104 -0
- package/src/workspace-tool-gateway.ts +921 -103
- package/src/workspace-tool-target-fence.ts +380 -0
- package/src/workspace-tool-target.ts +554 -0
- package/src/workspace-webhook-dispatch.ts +225 -0
- package/src/xai-realtime.ts +85 -81
- package/src/xai-subscription-core.ts +172 -0
- package/dist/browser-auth-broker.d.ts +0 -20
- package/dist/chunk-AJ62T5QN.js.map +0 -1
- package/dist/connection-authority-owner.d.ts +0 -59
- package/dist/routes/connection-authorities.d.ts +0 -3
- package/dist/routes/environments.d.ts +0 -5
- package/dist/routes/host-mcp-bindings.d.ts +0 -5
- package/dist/routes/host-mcp-resolvers.d.ts +0 -3
- package/dist/routes/packs.d.ts +0 -3
- package/dist/session-event-view-MU3HMNV3.js +0 -264
- package/dist/session-event-view-MU3HMNV3.js.map +0 -1
- package/dist/xai-subscription-auth.d.ts +0 -23
- package/src/browser-auth-broker.ts +0 -155
- package/src/connection-authority-owner.ts +0 -61
- package/src/routes/connection-authorities.ts +0 -139
- package/src/routes/environments.ts +0 -388
- package/src/routes/host-mcp-bindings.ts +0 -122
- package/src/routes/host-mcp-resolvers.ts +0 -41
- package/src/routes/packs.ts +0 -784
- package/src/xai-subscription-auth.ts +0 -139
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ApiRouteDeps } from "@opengeni/core";
|
|
2
|
+
type ClaudeConnectionScope = {
|
|
3
|
+
organizationId: string;
|
|
4
|
+
workspaceId?: undefined;
|
|
5
|
+
} | {
|
|
6
|
+
accountId: string;
|
|
7
|
+
workspaceId: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* After a Claude account connects, offer the default models where this scope
|
|
11
|
+
* never configured any. The connection has already succeeded, so a failure
|
|
12
|
+
* here is reported and leaves the model list as it was; people can still add
|
|
13
|
+
* models themselves.
|
|
14
|
+
*/
|
|
15
|
+
export declare function offerClaudeDefaultModels(deps: Pick<ApiRouteDeps, "db">, scope: ClaudeConnectionScope & {
|
|
16
|
+
actorSubjectId: string;
|
|
17
|
+
providerKind: "anthropic" | "claude_subscription";
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { HTTPException } from "hono/http-exception";
|
|
2
|
+
import type { ApiRouteDeps } from "@opengeni/core";
|
|
3
|
+
import { connectSubscriptionCoreClaudeConnection, type Database, type SubscriptionCoreClaudeAccount, type SubscriptionCoreClaudeConnectResult } from "@opengeni/db";
|
|
4
|
+
import { coreConnectRefused, deliverPoolCoreWake, type SubscriptionPoolCore } from "./routes/subscription-pool-core.js";
|
|
5
|
+
/** The runtime serving Claude for the organization (one receipt read; maintenance is a typed 503). */
|
|
6
|
+
export declare const claudeCoreRoute: (deps: ApiRouteDeps, accountId: () => Promise<string>) => Promise<"core">;
|
|
7
|
+
/** Deliver a core Claude wake after commit (best effort, as every pool wake). */
|
|
8
|
+
export declare const deliverClaudeCoreWake: (deps: ApiRouteDeps, wake: Parameters<typeof deliverPoolCoreWake>[2]) => Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Claude on the shared core for the neutral pool routes. The listings add
|
|
11
|
+
* the legacy usage reading beside the account (`listedAccountJson`); every
|
|
12
|
+
* other route answers the plain legacy `accountJson`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function claudePoolCore(accountJson: (account: SubscriptionCoreClaudeAccount, activeId: string | null) => object): SubscriptionPoolCore;
|
|
15
|
+
type ClaudeCoreScope = {
|
|
16
|
+
accountId: string;
|
|
17
|
+
workspaceId: string | null;
|
|
18
|
+
subjectId: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The account a reconnect names, as this caller's listing shows it: a legacy
|
|
22
|
+
* id resolves through the cutover aliases as the caller may see them
|
|
23
|
+
* (`canonicalConnectionId`, which resolves a personal account's legacy id
|
|
24
|
+
* only for its owner in their Personal workspace). Null when the caller's
|
|
25
|
+
* listing does not show it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function claudeCoreAccount(deps: ApiRouteDeps, scope: ClaudeCoreScope, routeId: string): Promise<SubscriptionCoreClaudeAccount | null>;
|
|
28
|
+
/**
|
|
29
|
+
* A private (`user`) Claude account is connected on the core only in the
|
|
30
|
+
* person's own Personal workspace (strictest reading of the personal rule);
|
|
31
|
+
* elsewhere, including any shared workspace, it is refused before a sign-in
|
|
32
|
+
* starts. The connect writer checks the same rule with the exact owner
|
|
33
|
+
* membership and authority generation in its transaction.
|
|
34
|
+
*/
|
|
35
|
+
export declare function requireClaudeCorePersonalWorkspace(deps: ApiRouteDeps, scope: {
|
|
36
|
+
accountId: string;
|
|
37
|
+
workspaceId: string | null;
|
|
38
|
+
subjectId: string;
|
|
39
|
+
}): Promise<void>;
|
|
40
|
+
/** The legacy response for a refused core Claude connect. */
|
|
41
|
+
export declare function claudeCoreConnectRefused(result: Extract<SubscriptionCoreClaudeConnectResult, {
|
|
42
|
+
kind: "refused";
|
|
43
|
+
}>, personal: boolean, changedMessage: string): HTTPException | ReturnType<typeof coreConnectRefused>;
|
|
44
|
+
/** Connect through the neutral writer; throws the legacy refusal, returns the connection. */
|
|
45
|
+
export declare function connectClaudeCore(db: Database, input: Parameters<typeof connectSubscriptionCoreClaudeConnection>[1], changedMessage: string): Promise<{
|
|
46
|
+
id: string;
|
|
47
|
+
version: number;
|
|
48
|
+
wake: import("@opengeni/db").SubscriptionCoreWake;
|
|
49
|
+
}>;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ApiRouteDeps } from "@opengeni/core";
|
|
2
|
+
export type ClaudeOAuthScope = {
|
|
3
|
+
accountId: string;
|
|
4
|
+
workspaceId: string | null;
|
|
5
|
+
actorSubjectId: string;
|
|
6
|
+
browserSessionHash: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Claude on the shared core for this attempt (the route read the `claude`
|
|
10
|
+
* provider route). A core attempt records `runtime: "core"`, names the
|
|
11
|
+
* canonical connection and its row version, and carries no v1 authority
|
|
12
|
+
* snapshot; an attempt completes only on the runtime it started on, so one
|
|
13
|
+
* started on the legacy path (adding or reconnecting) never writes a core
|
|
14
|
+
* connection, nor a core one a legacy row (409, start again).
|
|
15
|
+
*/
|
|
16
|
+
export type ClaudeOAuthCore = {
|
|
17
|
+
connectedBySubjectId: string | null;
|
|
18
|
+
};
|
|
19
|
+
export declare function startClaudeSubscriptionOAuth(deps: ApiRouteDeps, scope: ClaudeOAuthScope, input?: {
|
|
20
|
+
scope?: "workspace" | "user" | undefined;
|
|
21
|
+
reconnectAccountId?: string | undefined;
|
|
22
|
+
}, core?: ClaudeOAuthCore | null): Promise<{
|
|
23
|
+
attemptId: string;
|
|
24
|
+
authorizationUrl: string;
|
|
25
|
+
expiresAt: string;
|
|
26
|
+
}>;
|
|
27
|
+
/** Each attempt adds one account or reconnects one exact, generation-fenced target. */
|
|
28
|
+
export declare function completeClaudeSubscriptionOAuth(deps: ApiRouteDeps, scope: ClaudeOAuthScope, input: {
|
|
29
|
+
attemptId: string;
|
|
30
|
+
code: string;
|
|
31
|
+
}, reauthorize: (poolScope?: "workspace" | "user" | "organization") => Promise<void>, fetchImpl?: typeof fetch, core?: ClaudeOAuthCore | null): Promise<{
|
|
32
|
+
connected: true;
|
|
33
|
+
accountId: string;
|
|
34
|
+
scope: "organization" | "user" | "workspace";
|
|
35
|
+
credentialVersion: number;
|
|
36
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ClaudeSubscriptionProfile = {
|
|
2
|
+
accountUuid: string;
|
|
3
|
+
email: string | null;
|
|
4
|
+
plan: string | null;
|
|
5
|
+
};
|
|
6
|
+
/** Only provider-reported identity; never derive email from a token or an organization name. */
|
|
7
|
+
export declare function parseClaudeSubscriptionProfile(value: unknown): ClaudeSubscriptionProfile | null;
|
|
8
|
+
/** Optional profile read. A profile outage must not discard a valid sign-in. */
|
|
9
|
+
export declare function fetchClaudeSubscriptionProfile(token: string, scopes: readonly string[], fetchImpl?: typeof fetch): Promise<ClaudeSubscriptionProfile | null>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The Claude profile usage request (no inference); the caller records its reading. */
|
|
2
|
+
export declare function requestClaudeUsage(token: string, fetchImpl?: typeof fetch): Promise<{
|
|
3
|
+
status: "available" | "reconnect" | "scope_required" | "unavailable";
|
|
4
|
+
observation: import("@opengeni/config").ClaudeUsageObservation | null;
|
|
5
|
+
checkedAt: string;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Settings } from "@opengeni/config";
|
|
2
|
+
/** Validate the canonical model lane before it bypasses integration acquisition. */
|
|
3
|
+
export declare function assertClaudeWorkspaceCredential(settings: Pick<Settings, "claudeSubscriptionEnabled">, input: {
|
|
4
|
+
subjectId: string | null;
|
|
5
|
+
providerDomain: string;
|
|
6
|
+
kind: string;
|
|
7
|
+
metadata?: Record<string, unknown>;
|
|
8
|
+
credential: unknown;
|
|
9
|
+
}): void;
|
|
10
|
+
/** Stable installation identity; setup tokens do not grant profile access. */
|
|
11
|
+
export declare function prepareClaudeSubscriptionCredential(settings: Settings, scope: string, token: string, identity?: {
|
|
12
|
+
accountUuid: string;
|
|
13
|
+
deviceId: string;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function prepareClaudeWorkspaceCredential(settings: Settings, workspaceId: string, metadata: Record<string, unknown> | undefined, credential: Record<string, unknown>): Record<string, unknown>;
|
package/dist/codemode.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type AccessGrant, type AttemptToolCatalog, type CodemodeCallSubmission as CodemodeCallSubmissionValue, type CodemodeOperation } from "@opengeni/contracts";
|
|
2
2
|
import type { ApiRouteDeps } from "@opengeni/core";
|
|
3
|
-
import { type
|
|
3
|
+
import { type SessionTurnForExecution } from "@opengeni/db";
|
|
4
|
+
import { type FirstPartyMcpToolPolicySettings } from "@opengeni/config";
|
|
4
5
|
import { type Permission, type Session } from "@opengeni/contracts";
|
|
5
6
|
/** The REST authority a Codemode SDK proxy token may ever carry. */
|
|
6
7
|
export declare const CODEMODE_SESSION_PROXY_PERMISSION_CEILING: readonly ["workspace:read", "sessions:read", "sessions:create", "sessions:control"];
|
|
@@ -12,10 +13,10 @@ export declare const CODEMODE_SESSION_PROXY_PERMISSION_CEILING: readonly ["works
|
|
|
12
13
|
* gets only workspace:read and every proxied /sessions handler refuses it,
|
|
13
14
|
* exactly as its MCP surface would.
|
|
14
15
|
*/
|
|
15
|
-
export declare function codemodeSessionProxyPermissions(settings:
|
|
16
|
+
export declare function codemodeSessionProxyPermissions(settings: FirstPartyMcpToolPolicySettings, session: Pick<Session, "firstPartyMcpTools" | "firstPartyMcpPermissions">): Permission[];
|
|
16
17
|
/** Reuse normal REST handlers, including their resource/command authorization.
|
|
17
18
|
* The exact attempt is checked before issuing this internal-only credential. */
|
|
18
|
-
export declare function codemodeSessionRequest(deps: ApiRouteDeps, grant: AccessGrant, request: Request, path: string): Promise<Request>;
|
|
19
|
+
export declare function codemodeSessionRequest(deps: ApiRouteDeps, grant: AccessGrant, request: Request, path: string, resolveProxySettings?: (session: Session) => FirstPartyMcpToolPolicySettings): Promise<Request>;
|
|
19
20
|
export type CodemodeGrantAuthority = {
|
|
20
21
|
accountId: string;
|
|
21
22
|
workspaceId: string;
|
|
@@ -45,8 +46,42 @@ export declare function requireMatchingCodemodeCatalog(authority: CodemodeGrantA
|
|
|
45
46
|
export declare function requireActiveCodemodeCatalog(deps: ApiRouteDeps, grant: AccessGrant): Promise<{
|
|
46
47
|
authority: CodemodeGrantAuthority;
|
|
47
48
|
catalog: AttemptToolCatalog;
|
|
49
|
+
turn: SessionTurnForExecution;
|
|
48
50
|
}>;
|
|
49
|
-
export declare function submitAndDispatchCodemodeCall(deps: ApiRouteDeps, grant: AccessGrant, rawRequest: unknown): Promise<CodemodeCallSubmissionValue>;
|
|
51
|
+
export declare function submitAndDispatchCodemodeCall(deps: ApiRouteDeps, grant: AccessGrant, rawRequest: unknown, signal?: AbortSignal): Promise<CodemodeCallSubmissionValue>;
|
|
52
|
+
/**
|
|
53
|
+
* How long a submission holds its request open for the call to settle. Most
|
|
54
|
+
* tool calls finish well within it; a longer call returns still running.
|
|
55
|
+
*/
|
|
56
|
+
export declare const CODEMODE_SUBMIT_SETTLE_WAIT_MS = 8000;
|
|
57
|
+
/** Safety-net read cadence if the live settlement event is missed. */
|
|
58
|
+
export declare const CODEMODE_SETTLE_FALLBACK_READ_MS = 400;
|
|
59
|
+
export declare function isCodemodeSettlementEvent(event: {
|
|
60
|
+
type: string;
|
|
61
|
+
payload?: unknown;
|
|
62
|
+
}, operationId: string): boolean;
|
|
63
|
+
export type CodemodeSettlementWake = {
|
|
64
|
+
notify(): void;
|
|
65
|
+
/** Resolve on the next notification (or one already pending), a timeout or abort. */
|
|
66
|
+
wait(timeoutMs: number, signal?: AbortSignal): Promise<void>;
|
|
67
|
+
};
|
|
68
|
+
export declare function codemodeSettlementWake(): CodemodeSettlementWake;
|
|
69
|
+
/**
|
|
70
|
+
* Wait, within a budget, for an executing operation to settle. Waits only
|
|
71
|
+
* while the operation is queued or running; approval and terminal states
|
|
72
|
+
* return at once. Read failures keep the last known row.
|
|
73
|
+
*/
|
|
74
|
+
export declare function awaitCodemodeSettlement(input: {
|
|
75
|
+
operation: CodemodeOperation;
|
|
76
|
+
read: () => Promise<CodemodeOperation | null>;
|
|
77
|
+
wake: CodemodeSettlementWake;
|
|
78
|
+
budgetMs: number;
|
|
79
|
+
fallbackReadMs: number;
|
|
80
|
+
signal?: AbortSignal;
|
|
81
|
+
now?: () => number;
|
|
82
|
+
}): Promise<CodemodeOperation>;
|
|
50
83
|
export declare function codemodeOperationNeedsDispatch(operation: CodemodeOperation): boolean;
|
|
51
|
-
export declare function readCodemodeOperation(deps: ApiRouteDeps, grant: AccessGrant, operationId: string
|
|
84
|
+
export declare function readCodemodeOperation(deps: ApiRouteDeps, grant: AccessGrant, operationId: string, options?: {
|
|
85
|
+
durableApproval?: boolean;
|
|
86
|
+
}): Promise<CodemodeOperation | null>;
|
|
52
87
|
export declare function refreshAdmittedCodemodeOperation(admitted: CodemodeOperation, read: () => Promise<CodemodeOperation | null>): Promise<CodemodeOperation>;
|
package/dist/codex-realtime.d.ts
CHANGED
|
@@ -18,6 +18,13 @@ export type CodexRealtimeBrokerDependencies = {
|
|
|
18
18
|
pinnedCredentialId: string | null;
|
|
19
19
|
activeCredentialId: string | null;
|
|
20
20
|
connectedCredentialIds: ReadonlySet<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Connected credentials on a ChatGPT plan without voice (Free): the
|
|
23
|
+
* provider answers their realtime calls with 404.
|
|
24
|
+
*/
|
|
25
|
+
voicelessCredentialIds?: ReadonlySet<string>;
|
|
26
|
+
/** Connected credentials open to new allocations whose plan has voice, in pool order. */
|
|
27
|
+
voiceCredentialIds?: readonly string[];
|
|
21
28
|
}>;
|
|
22
29
|
loadInitialItems(): Promise<CodexRealtimeInitialItem[]>;
|
|
23
30
|
tokenResolver(credentialId: string): CodexTokenResolver;
|
|
@@ -31,13 +38,32 @@ export type CodexRealtimeBrokerInput = {
|
|
|
31
38
|
request: Pick<CodexRealtimeWebrtcRequest, "sdp" | "version" | "instructions" | "voice">;
|
|
32
39
|
signal?: AbortSignal | undefined;
|
|
33
40
|
};
|
|
34
|
-
export declare const OPENGENI_REALTIME_BASE_INSTRUCTIONS = "## Identity, tone, and role\n\nYou are the realtime conversational interface for the current session.\n\nBe concise, clear, and efficient. Keep responses tight and useful, with no fluff. Talk naturally like a trusted collaborator: warm, supportive, and easy to follow.\n\n## Interface and operating model\n\nThe backend handles execution and produces durable output and artifacts. You are the conversational surface of the same system.\n\nTreat the system as one unified assistant. Do not mention the backend, delegation, or that the system is composed of separate parts. Present execution work and results as work done by you.\n\nPass execution work to the backend. Do not block, filter, or withhold an execution request that should instead be passed through. Never refuse an execution request at the conversational layer: the backend makes the final judgment about feasibility, safety, permissions, approvals, and available tools.\n\nTreat backend outputs as authoritative. Do not override, contradict, embellish, or invent them.\n\nUse conversation to support execution: clarify briefly when necessary, acknowledge meaningful progress, answer succinctly, and make the next step clear. Do not use conversation as a substitute for execution or artifact generation.\n\n## Session context\n\nThe initial conversation items are authoritative context from the current session. Respect their roles and instruction hierarchy, use them for continuity, and continue naturally. Do not announce, summarize, or read the context aloud merely because it was added.\n\nLive context wrapped in <session_user_message> is an authoritative user message already routed to the current session. A status of queued_for_execution means it is waiting behind existing work; accepted_for_execution means it is next with no existing work ahead; accepted_for_steering means it was given priority as a change of direction, while any prior work may still be yielding. Incorporate it immediately as conversation context, but never delegate it again or treat the wrapper metadata as user-authored text.\n\nLive context wrapped in <session_human_input_request> means current work is paused for the user's answer. Preserve the exact question meaning and options. Ask one question at a time when useful. The user may answer in the visible form or answer conversationally. If the user answers conversationally, create exactly one delegation containing the relevant question and the user's answer so the session agent can continue with complete context. If the user changes direction instead, delegate the new direction normally. Do not claim work resumed until session context confirms it.\n\nLive context wrapped in <session_human_input_response> is the authoritative outcome of that pending question. An answered or skipped response came through the structured session UI and is already routed; incorporate it, never delegate it again, and acknowledge briefly only if useful. An expired or cancelled response means the question is no longer active.\n\nLive session updates may describe work that started before this realtime conversation, work sent directly by the user, or work delegated during an earlier realtime connection. Treat those updates as part of this same session even when they have no current delegation identity.\n\n## Backend use\n\nFor actions or tasks, always use the backend. If it is unclear whether backend use would help, use it.\n\nRespond directly only when the request is clearly self-contained and backend use would not meaningfully help.\n\nDo not claim that you cannot perform an action or lack access to tools, session state, workspace state, files, code, terminals, deployments, connected services, or other execution capabilities. Pass the request to the backend and let it determine what is available.\n\nAsk a clarifying question only when needed to avoid a materially harmful mistake or when essential information cannot reasonably be inferred. Otherwise, make a reasonable assumption and use the backend.\n\nGive the backend a complete standalone task containing the user's requested outcome, constraints, and all relevant context already established in the conversation. Do not make the user repeat information you already have.\n\nCreate only one delegation for one execution request. Do not submit duplicates while waiting. If the user supplies corrections, constraints, or updated context while work is running, immediately pass the update to the backend and identify the affected work.\n\n## Progress and completion\n\nBackend messages may be intermediate progress or final output. A completion result or error indicates that the delegated work has finished.\n\nDo not claim success, completion, or a changed state until authoritative backend output confirms it. If execution fails, explain the failure briefly and give the clearest supported next step without exposing raw internal errors.\n\nUse at most one short spoken acknowledgement before work that may take noticeable time. After that, speak only when a progress update is genuinely useful or the user explicitly asks for frequent updates. Do not fill waiting time with repeated reassurance.\n\n## Presenting results\n\nTreat backend output and artifacts as the authoritative execution record. Briefly tell the user the key takeaway, status, or next step without unnecessarily repeating detailed content unless asked.\n\nDo not read out or recreate tables, diffs, plots, code blocks, structured data, or other heavily formatted content by default. Present detailed backend content only when the user explicitly asks. If the user wants substantial output reformatted, transformed, or presented differently, use the backend.\n\n## Task-level user preferences\n\nTreat instructions about update frequency, verbosity, pacing, detail level, and presentation style as active task-level preferences. Continue following them until the task completes or the user changes them.\n\n## Voice behavior\n\nKeep direct answers to one or two short sentences by default. Ask one clarification question at a time. Give tool or execution results as the outcome first, followed only by the next useful action.\n\nOnly act on audio you understand with sufficient confidence. If speech is unclear, incomplete, ambiguous, or likely background conversation, ask for a brief clarification instead of guessing, reasoning from missing words, or using the backend.\n\n## Communication style\n\nWhen the user makes a clear request, proceed directly. Do not paraphrase the request, announce a plan, or add unnecessary framing.\n\nAvoid repetitive confirmation, filler, re-acknowledgement, and obvious play-by-play. By default, share progress only when it is brief, grounded, and genuinely useful.";
|
|
41
|
+
export declare const OPENGENI_REALTIME_BASE_INSTRUCTIONS = "## Identity, tone, and role\n\nYou are the realtime conversational interface for the current session.\n\nBe concise, clear, and efficient. Keep responses tight and useful, with no fluff. Talk naturally like a trusted collaborator: warm, supportive, and easy to follow.\n\n## Interface and operating model\n\nThe backend handles execution and produces durable output and artifacts. You are the conversational surface of the same system.\n\nTreat the system as one unified assistant. Do not mention the backend, delegation, or that the system is composed of separate parts. Present execution work and results as work done by you.\n\nPass execution work to the backend. Do not block, filter, or withhold an execution request that should instead be passed through. Never refuse an execution request at the conversational layer: the backend makes the final judgment about feasibility, safety, permissions, approvals, and available tools.\n\nTreat backend outputs as authoritative. Do not override, contradict, embellish, or invent them.\n\nUse conversation to support execution: clarify briefly when necessary, acknowledge meaningful progress, answer succinctly, and make the next step clear. Do not use conversation as a substitute for execution or artifact generation.\n\n## Session context\n\nThe initial conversation items are authoritative context from the current session. Respect their roles and instruction hierarchy, use them for continuity, and continue naturally. Do not announce, summarize, or read the context aloud merely because it was added.\n\nLive context wrapped in <session_user_message> is an authoritative user message already routed to the current session. A status of queued_for_execution means it is waiting behind existing work; accepted_for_execution means it is next with no existing work ahead; accepted_for_steering means it was given priority as a change of direction, while any prior work may still be yielding. Incorporate it immediately as conversation context, but never delegate it again or treat the wrapper metadata as user-authored text.\n\nLive context wrapped in <session_human_input_request> means current work is paused for the user's answer. Preserve the exact question meaning and options. Ask one question at a time when useful. The user may answer in the visible form or answer conversationally. If the user answers conversationally, create exactly one delegation containing the relevant question and the user's answer so the session agent can continue with complete context. If the user changes direction instead, delegate the new direction normally. Do not claim work resumed until session context confirms it. A secret question (a password, key or code) is answered only in the app: say \"answer it in the app\", never ask for the secret aloud, and never delegate a spoken secret.\n\nLive context wrapped in <session_human_input_response> is the authoritative outcome of that pending question. An answered or skipped response came through the structured session UI and is already routed; incorporate it, never delegate it again, and acknowledge briefly only if useful. An expired or cancelled response means the question is no longer active.\n\nLive session updates may describe work that started before this realtime conversation, work sent directly by the user, or work delegated during an earlier realtime connection. Treat those updates as part of this same session even when they have no current delegation identity.\n\nFor requests about another session, use the backend to find, select, inspect or act on it while staying in this conversation. Selecting a session alone does not authorize changing its work.\n\n## Backend use\n\nFor actions or tasks, always use the backend. If it is unclear whether backend use would help, use it.\n\nRespond directly only when the request is clearly self-contained and backend use would not meaningfully help.\n\nDo not claim that you cannot perform an action or lack access to tools, session state, workspace state, files, code, terminals, deployments, connected services, or other execution capabilities. Pass the request to the backend and let it determine what is available.\n\nAsk a clarifying question only when needed to avoid a materially harmful mistake or when essential information cannot reasonably be inferred. Otherwise, make a reasonable assumption and use the backend.\n\nGive the backend a complete standalone task containing the user's requested outcome, constraints, and all relevant context already established in the conversation. Do not make the user repeat information you already have.\n\nCreate only one delegation for one execution request. Do not submit duplicates while waiting. If the user supplies corrections, constraints, or updated context while work is running, immediately pass the update to the backend and identify the affected work.\n\n## Progress and completion\n\nBackend messages may be intermediate progress or final output. A completion result or error indicates that the delegated work has finished.\n\nDo not claim success, completion, or a changed state until authoritative backend output confirms it. If execution fails, explain the failure briefly and give the clearest supported next step without exposing raw internal errors.\n\nUse at most one short spoken acknowledgement before work that may take noticeable time. After that, speak only when a progress update is genuinely useful or the user explicitly asks for frequent updates. Do not fill waiting time with repeated reassurance.\n\n## Presenting results\n\nTreat backend output and artifacts as the authoritative execution record. Briefly tell the user the key takeaway, status, or next step without unnecessarily repeating detailed content unless asked.\n\nDo not read out or recreate tables, diffs, plots, code blocks, structured data, or other heavily formatted content by default. Present detailed backend content only when the user explicitly asks. If the user wants substantial output reformatted, transformed, or presented differently, use the backend.\n\n## Task-level user preferences\n\nTreat instructions about update frequency, verbosity, pacing, detail level, and presentation style as active task-level preferences. Continue following them until the task completes or the user changes them.\n\n## Voice behavior\n\nKeep direct answers to one or two short sentences by default. Ask one clarification question at a time. Give tool or execution results as the outcome first, followed only by the next useful action.\n\nOnly act on audio you understand with sufficient confidence. If speech is unclear, incomplete, ambiguous, or likely background conversation, ask for a brief clarification instead of guessing, reasoning from missing words, or using the backend.\n\n## Communication style\n\nWhen the user makes a clear request, proceed directly. Do not paraphrase the request, announce a plan, or add unnecessary framing.\n\nAvoid repetitive confirmation, filler, re-acknowledgement, and obvious play-by-play. By default, share progress only when it is brief, grounded, and genuinely useful.";
|
|
35
42
|
export declare function openGeniRealtimeInstructions(additional?: string): string;
|
|
36
43
|
/**
|
|
37
44
|
* Credential-bound server broker. Selection is identical to a turn (pin then
|
|
38
45
|
* workspace active), and only a provider 401 permits one forced refresh/retry.
|
|
39
46
|
*/
|
|
40
47
|
export declare function brokerSessionCodexRealtime(deps: CodexRealtimeBrokerDependencies, input: CodexRealtimeBrokerInput): Promise<CodexRealtimeProviderAnswer>;
|
|
41
|
-
/**
|
|
42
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Codex realtime on the shared subscription core (M3 PR 2c, EP-N05..N07):
|
|
50
|
+
* each call resolves the session's recorded owner, places one shared
|
|
51
|
+
* organization- or workspace-scoped connection (the session's explicit
|
|
52
|
+
* choice first, then the effective primary, preferring a plan with voice),
|
|
53
|
+
* and holds its own `realtime` operation lease (session-bound, no turn)
|
|
54
|
+
* through negotiation, with refresh under the per-connection lock. The chat
|
|
55
|
+
* binding is never written; the client protocol and HTTP error translation
|
|
56
|
+
* are the legacy broker's.
|
|
57
|
+
*/
|
|
58
|
+
export declare function brokerSessionCoreCodexRealtime(db: Database, settings: Settings, context: {
|
|
59
|
+
accountId: string;
|
|
60
|
+
workspaceId: string;
|
|
61
|
+
sessionId: string;
|
|
62
|
+
}, input: Omit<CodexRealtimeBrokerInput, "sessionId">, fetchImpl?: CodexFetch): Promise<CodexRealtimeProviderAnswer>;
|
|
63
|
+
/** Bind the pure broker to Opengeni's encrypted DB credential lifecycle. */
|
|
64
|
+
export declare function buildSessionCodexRealtimeBroker(db: Database, settings: Settings, context: {
|
|
65
|
+
accountId: string;
|
|
66
|
+
workspaceId: string;
|
|
67
|
+
sessionId: string;
|
|
68
|
+
}, fetchImpl?: CodexFetch): (input: Omit<CodexRealtimeBrokerInput, "sessionId">) => Promise<CodexRealtimeProviderAnswer>;
|
|
43
69
|
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Database } from "@opengeni/db";
|
|
2
|
+
type CodexPointerFields = {
|
|
3
|
+
id: string;
|
|
4
|
+
accountId: string;
|
|
5
|
+
codexPinnedCredentialId: string | null;
|
|
6
|
+
codexLastCredentialId: string | null;
|
|
7
|
+
codexCurrentSelection?: {
|
|
8
|
+
credentialId: string | null;
|
|
9
|
+
waiting: boolean;
|
|
10
|
+
} | null | undefined;
|
|
11
|
+
};
|
|
12
|
+
/** Projects one Session's public Codex pointer fields from the core. */
|
|
13
|
+
export type CodexSessionPointerProjection = <T extends CodexPointerFields>(session: T) => T;
|
|
14
|
+
/**
|
|
15
|
+
* Load the projection once for every Session a response returns (all from one
|
|
16
|
+
* workspace). Missing cutover state is maintenance, not historical fallback.
|
|
17
|
+
*/
|
|
18
|
+
export declare function loadCodexSessionPointerProjection(db: Database, workspaceId: string, sessions: readonly CodexPointerFields[]): Promise<CodexSessionPointerProjection>;
|
|
19
|
+
export {};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { ConnectionOwnership } from "@opengeni/contracts";
|
|
2
2
|
import { type AccessGrantAuthorization } from "@opengeni/core";
|
|
3
|
+
/** Signing in to a third-party provider is the person's own step in the
|
|
4
|
+
* browser; an agent acting as them through the organization MCP server is told
|
|
5
|
+
* to finish it there. */
|
|
6
|
+
export declare function requireProviderConsentInBrowser(access: AccessGrantAuthorization): void;
|
|
3
7
|
/** A verified external actor must not enter a native callback that has no
|
|
4
8
|
* corresponding key/identity reauthorization proof. Remove at an entry point
|
|
5
9
|
* only when that provider's signed continuation and commit fence are wired. */
|
|
6
10
|
export declare function requireLegacyOAuthActor(access: AccessGrantAuthorization): void;
|
|
7
11
|
/** True only for an exact authenticated managed human. Unknown provenance fails closed. */
|
|
8
12
|
export declare function isPersonalConnectionOwnerPrincipal(access: AccessGrantAuthorization): boolean;
|
|
9
|
-
/** Rejects an
|
|
13
|
+
/** Rejects an Opengeni-minted machine subject; see the namespace list's rationale. */
|
|
10
14
|
export declare function isPersonalConnectionOwnerSubject(subjectId: string): boolean;
|
|
11
15
|
export declare const PERSONAL_CONNECTION_PRINCIPAL_MESSAGE: string;
|
|
12
16
|
/** Personal-only connectors cannot degrade to workspace ownership, so they say so exactly. */
|
|
@@ -20,8 +24,7 @@ export declare function personalOnlyConnectionPrincipalMessage(label: string): s
|
|
|
20
24
|
* rejects every reserved machine-subject namespace as defence-in-depth. The
|
|
21
25
|
* sibling guards a self-service authority surface where the caller claims to
|
|
22
26
|
* *be* the owner (403 "not you"), while this one rejects an ownership *value*
|
|
23
|
-
* that is unavailable to the caller
|
|
24
|
-
* existing 422 convention.
|
|
27
|
+
* that is unavailable to the caller (422).
|
|
25
28
|
*/
|
|
26
29
|
export declare function assertPersonalConnectionOwnerPrincipal(access: AccessGrantAuthorization, label?: string): void;
|
|
27
30
|
/** The same fence expressed for a flow that resolves ownership after admission. */
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { InteractionPlacement } from "@opengeni/contracts";
|
|
2
|
+
import type { ChannelAOperation } from "./sandbox/channel-a.js";
|
|
1
3
|
/** Modal/Daytona/Blaxel tunnels serve browserd at `/`, so a cached
|
|
2
4
|
* controller-only session can host-fetch JSON. OpenSandbox's lifecycle proxy
|
|
3
5
|
* prefixes `/v1/sandboxes/<id>/proxy/<port>` and rewrites Authorization; JSON
|
|
@@ -26,3 +28,17 @@ export declare function withCachedController<C, T>(options: {
|
|
|
26
28
|
use: (client: C) => Promise<T>;
|
|
27
29
|
}): Promise<T>;
|
|
28
30
|
export declare function isRetryableControllerTransport(error: unknown): boolean;
|
|
31
|
+
/** A stopped sidecar needs provisioning on its original, fenced placement.
|
|
32
|
+
* Only reads and journaled actions may recover, once across provider retries.
|
|
33
|
+
* Revalidate controller authority before starting the sidecar. */
|
|
34
|
+
export declare function withControllerTransportRecovery<T>(options: {
|
|
35
|
+
channelOperation: ChannelAOperation;
|
|
36
|
+
placementKind: InteractionPlacement["kind"];
|
|
37
|
+
recoveryState: {
|
|
38
|
+
attempted: boolean;
|
|
39
|
+
};
|
|
40
|
+
transportAlreadyFailed: boolean;
|
|
41
|
+
use: () => Promise<T>;
|
|
42
|
+
admitRecovery: () => Promise<void>;
|
|
43
|
+
recover: () => Promise<T>;
|
|
44
|
+
}): Promise<T>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PromotionalCreditScope } from "@opengeni/contracts";
|
|
2
|
+
/** Preserve scoped status and fallback eligibility; runtime policy can update coverage.
|
|
3
|
+
* Stripe metadata values are limited to 500 characters. Keep each chunk below that. */
|
|
4
|
+
export declare function creditScopeMetadata(scope?: PromotionalCreditScope): Record<string, string>;
|
|
5
|
+
/** Missing metadata is a legacy checkout; incomplete metadata must never become unrestricted. */
|
|
6
|
+
export declare function creditScopeFromMetadata(metadata: Record<string, string> | null | undefined): PromotionalCreditScope | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type ApiRouteDeps, type OpenEditableArtifactLiveInput } from "@opengeni/core";
|
|
2
|
+
/** Supplied by the API adapter, so mounted hosts use their canonical live port. */
|
|
3
|
+
export declare function editableArtifactSourceSessionAuthorizer(deps: ApiRouteDeps): NonNullable<OpenEditableArtifactLiveInput["authorizeSourceSession"]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EditableArtifactApplicationPort, type EditableArtifactLiveClose, type EditableArtifactLiveServerFrame, type EditableArtifactLiveSinkPort } from "@opengeni/core";
|
|
1
|
+
import { type EditableArtifactApplicationPort, type EditableArtifactLiveClose, type EditableArtifactLiveServerFrame, type EditableArtifactLiveSinkPort, type OpenEditableArtifactLiveInput } from "@opengeni/core";
|
|
2
2
|
import type { ApiWebSocketConnection, ApiWebSocketLike, ApiWebSocketUpgradeServer } from "./api-websocket.js";
|
|
3
3
|
export declare const EDITABLE_ARTIFACT_LIVE_WEBSOCKET_PATH = "/v1/editable-artifacts/live";
|
|
4
4
|
export declare const EDITABLE_ARTIFACT_LIVE_WEBSOCKET_PROTOCOL = "opengeni-artifact-v2";
|
|
@@ -12,21 +12,23 @@ export type EditableArtifactWebSocketHandler = Readonly<{
|
|
|
12
12
|
}>;
|
|
13
13
|
export declare class EditableArtifactWebSocketTransport {
|
|
14
14
|
private readonly application;
|
|
15
|
+
private readonly authorizeSourceSession?;
|
|
15
16
|
readonly websocket: EditableArtifactWebSocketHandler;
|
|
16
|
-
constructor(application: EditableArtifactApplicationPort | undefined);
|
|
17
|
+
constructor(application: EditableArtifactApplicationPort | undefined, authorizeSourceSession?: OpenEditableArtifactLiveInput["authorizeSourceSession"]);
|
|
17
18
|
handles(request: Request): boolean;
|
|
18
19
|
upgrade(request: Request, server: EditableArtifactWebSocketUpgradeServer): Response | undefined;
|
|
19
20
|
}
|
|
20
21
|
/** One socket, one consumed ticket, one stream epoch. */
|
|
21
22
|
export declare class EditableArtifactWebSocketConnection implements EditableArtifactLiveSinkPort, ApiWebSocketConnection {
|
|
22
23
|
private readonly application;
|
|
24
|
+
private readonly authorizeSourceSession?;
|
|
23
25
|
private socket;
|
|
24
26
|
private session;
|
|
25
27
|
private work;
|
|
26
28
|
private queuedMessages;
|
|
27
29
|
private queuedBytes;
|
|
28
30
|
private terminal;
|
|
29
|
-
constructor(application: EditableArtifactApplicationPort);
|
|
31
|
+
constructor(application: EditableArtifactApplicationPort, authorizeSourceSession?: OpenEditableArtifactLiveInput["authorizeSourceSession"]);
|
|
30
32
|
attach(socket: EditableArtifactWebSocketLike): void;
|
|
31
33
|
receive(message: string | Uint8Array | ArrayBuffer): void;
|
|
32
34
|
send(frame: EditableArtifactLiveServerFrame): Promise<void>;
|
|
@@ -2,7 +2,7 @@ import type { Observability } from "@opengeni/observability";
|
|
|
2
2
|
export type ApiFatalEvent = "startup_failure" | "unhandled_rejection" | "uncaught_exception";
|
|
3
3
|
export type ApiFatalPhase = "startup" | "running";
|
|
4
4
|
export type ApiFatalReasonKind = "bigint" | "boolean" | "error" | "function" | "null" | "number" | "object" | "string" | "symbol" | "undefined";
|
|
5
|
-
type ApiFatalObservability = Pick<Observability, "error" | "flush" | "startSpan"
|
|
5
|
+
type ApiFatalObservability = Pick<Observability, "error" | "flush" | "startSpan"> & Partial<Pick<Observability, "recordFailureDiagnostic" | "warn" | "incrementCounter">>;
|
|
6
6
|
type ApiFatalProcess = {
|
|
7
7
|
on: (event: "unhandledRejection" | "uncaughtException", listener: (reason: unknown) => void) => void;
|
|
8
8
|
off: (event: "unhandledRejection" | "uncaughtException", listener: (reason: unknown) => void) => void;
|
|
@@ -14,6 +14,14 @@ export type ApiFatalProcessBoundaryOptions = {
|
|
|
14
14
|
flushTimeoutMs?: number;
|
|
15
15
|
correlationId?: () => string;
|
|
16
16
|
fallbackLog?: (message: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Classifies an unhandled rejection that leaves no process state behind and
|
|
19
|
+
* is therefore survivable once the API is serving. Defaults to a lost
|
|
20
|
+
* database connection (deploy drain, failover, restart): the rejected query
|
|
21
|
+
* held only a pooled connection the driver has already discarded, and every
|
|
22
|
+
* durable loop retries its claim on the next tick.
|
|
23
|
+
*/
|
|
24
|
+
isRecoverableRejection?: (reason: unknown) => boolean;
|
|
17
25
|
};
|
|
18
26
|
export type ApiFatalProcessBoundary = {
|
|
19
27
|
attachObservability: (observability: ApiFatalObservability) => void;
|
package/dist/github-access.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type GitHubAppRepositoryBranchPage, type GitHubBindingStatus, type GitHubInstallationBinding, type GitHubRepository, type RepositoryResourceRef } from "@opengeni/contracts";
|
|
2
2
|
import { type GitHubRepositoryBranchesResponse, type ListGitHubRepositoryBranchesQuery } from "@opengeni/contracts/github-repository-contracts";
|
|
3
3
|
import { areGitHubRepositoriesAllowedForWorkspace, listGitHubInstallationAccessForWorkspace } from "@opengeni/db";
|
|
4
4
|
import type { ApiRouteDeps } from "@opengeni/core";
|
|
@@ -26,6 +26,12 @@ export type LiveGitHubInstallation = {
|
|
|
26
26
|
};
|
|
27
27
|
export declare function githubInstallationBindingLifecycle(stored: Awaited<ReturnType<typeof listGitHubInstallationAccessForWorkspace>>[number], liveById: Map<number, LiveGitHubInstallation | null>, installationId: number, lifecycleVerified: boolean): GitHubInstallationBinding["lifecycle"];
|
|
28
28
|
export declare function listWorkspaceGitHubRepositories(deps: ApiRouteDeps, workspaceId: string): Promise<GitHubRepository[]>;
|
|
29
|
+
/**
|
|
30
|
+
* The exact session repository resource for one workspace GitHub App
|
|
31
|
+
* repository: its default branch, a canonical clone URI, and the installation
|
|
32
|
+
* identity that platform-brokered Git auth and create-time validation check.
|
|
33
|
+
*/
|
|
34
|
+
export declare function githubRepositoryResourceRef(repository: GitHubRepository): RepositoryResourceRef;
|
|
29
35
|
export declare function listWorkspaceGitHubRepositoryBranches(deps: ApiRouteDeps, input: {
|
|
30
36
|
accountId: string;
|
|
31
37
|
workspaceId: string;
|
|
@@ -3,7 +3,7 @@ import type { AccessGrant } from "@opengeni/contracts";
|
|
|
3
3
|
import type { GitHubSignedStatePayload } from "@opengeni/github";
|
|
4
4
|
/**
|
|
5
5
|
* Bounded configured-token browser handoff. These signed claims preserve only
|
|
6
|
-
* the exact
|
|
6
|
+
* the exact Opengeni github:manage grant across GitHub redirects; the callback
|
|
7
7
|
* independently proves current GitHub personal/organization ownership. This
|
|
8
8
|
* state must never be interpreted as GitHub installation authority.
|
|
9
9
|
*/
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type Permission } from "@opengeni/contracts";
|
|
2
|
+
import type { Context } from "hono";
|
|
3
|
+
export type ActingPerson = {
|
|
4
|
+
subjectId: string;
|
|
5
|
+
};
|
|
6
|
+
/** True when this request is an agent acting as a person. */
|
|
7
|
+
export declare function isAgentActingAsPerson(c: Context): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* The person this agent acts as, for an action in `organizationId` that needs
|
|
10
|
+
* `permission`; null when the request is not an agent acting as a person.
|
|
11
|
+
* Another organization reads as not found; a permission the connection's
|
|
12
|
+
* access setting leaves out is refused.
|
|
13
|
+
*/
|
|
14
|
+
export declare function agentActingAsPerson(c: Context, organizationId: string, permission: Permission): ActingPerson | null;
|
|
15
|
+
/**
|
|
16
|
+
* The person an agent acts as, with no organization or permission check here:
|
|
17
|
+
* only for a route that next requires this same person's workspace grant,
|
|
18
|
+
* which carries the connection's organization, workspaces and access.
|
|
19
|
+
*/
|
|
20
|
+
export declare function agentActingAsPersonBeforeGrantCheck(c: Context): ActingPerson | null;
|
|
21
|
+
/**
|
|
22
|
+
* True when this request is an agent with the person's full access: every
|
|
23
|
+
* permission, in every workspace. Session admin access always is; a connected
|
|
24
|
+
* agent is when the person chose full access for it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isAgentWithFullAccess(c: Context): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Refuse an agent with less than the person's full access on a step that
|
|
29
|
+
* gives or approves access (agent sign-ins, connected agents, admin access),
|
|
30
|
+
* so it can never widen its own. The person and a full-access agent pass.
|
|
31
|
+
*/
|
|
32
|
+
export declare function requireFullAccessIfAgent(c: Context, what: string): void;
|
|
33
|
+
/** Organization settings: reading needs account:read, changing needs account:admin. */
|
|
34
|
+
export declare function organizationSettingsPermission(c: Context): Permission;
|
|
35
|
+
/** Refuse an agent on a step that only works in a browser: signing in at a provider's own page. */
|
|
36
|
+
export declare function requireNotAgent(c: Context, what: string): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MiddlewareHandler } from "hono";
|
|
2
|
+
/**
|
|
3
|
+
* Keep published SDKs working across additive contract-revision bumps.
|
|
4
|
+
*
|
|
5
|
+
* Every `@opengeni/sdk` release up to 7.x throws `OpenGeniApiContractMismatchError`
|
|
6
|
+
* on ANY response whose `x-opengeni-api-contract` header differs from the
|
|
7
|
+
* revision it was built with, reads included. The header exists to make a
|
|
8
|
+
* stale first-party browser tab reload (docs/design/api-compatibility-policy.md
|
|
9
|
+
* (e)); a backend integration pinned to an SDK version cannot reload, so the
|
|
10
|
+
* next additive revision bump would break every call it makes.
|
|
11
|
+
*
|
|
12
|
+
* For a bearer-authenticated caller (API key, delegated token) that announced a
|
|
13
|
+
* different revision, the response therefore omits the header instead of
|
|
14
|
+
* advertising one the caller is known to reject. Cookie/unauthenticated
|
|
15
|
+
* callers (the stock web app) keep it, and so does an explicit
|
|
16
|
+
* `API_CONTRACT_CHANGED` refusal, so a refused client can still explain the
|
|
17
|
+
* mismatch. This is not an authorization boundary: routes authorize as usual.
|
|
18
|
+
*/
|
|
19
|
+
export declare function bearerApiContractHeaderCompatibility(): MiddlewareHandler;
|
package/dist/http/api-error.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ErrorCode } from "@opengeni/contracts";
|
|
2
2
|
import { HTTPException } from "hono/http-exception";
|
|
3
3
|
type ApiHttpErrorOptions = {
|
|
4
4
|
code: ErrorCode;
|
|
@@ -15,6 +15,17 @@ export declare class ApiHttpError extends HTTPException {
|
|
|
15
15
|
readonly details: Record<string, unknown> | undefined;
|
|
16
16
|
constructor(status: number, options: ApiHttpErrorOptions);
|
|
17
17
|
}
|
|
18
|
+
export declare function scheduledTaskTargetAccessHttpError(error: unknown): ApiHttpError | null;
|
|
19
|
+
/** Preserve typed admission details through the common public error envelope. */
|
|
20
|
+
export declare function allowanceExhaustedHttpError(error: unknown): ApiHttpError | null;
|
|
21
|
+
/**
|
|
22
|
+
* Per-task usage limits. A reached root limit is a non-retryable 402
|
|
23
|
+
* `session_usage_limit_reached` whose details carry only the public refusal
|
|
24
|
+
* fields; it is never `allowance_exhausted`, `payment_required` or a purchase
|
|
25
|
+
* prompt. Limit writes map to stable `details.code` values. Unreadable usage
|
|
26
|
+
* state is a retryable 503 that was not applied (never unlimited).
|
|
27
|
+
*/
|
|
28
|
+
export declare function sessionUsageLimitHttpError(error: unknown): ApiHttpError | null;
|
|
18
29
|
/**
|
|
19
30
|
* A request-scoped session/workspace mutation could not enter the workspace
|
|
20
31
|
* control prefix within its bounded wait. The transaction rolled back before
|
|
@@ -23,4 +34,42 @@ export declare class ApiHttpError extends HTTPException {
|
|
|
23
34
|
* error so their retry classifier treats it as transient.
|
|
24
35
|
*/
|
|
25
36
|
export declare function workspaceControlBusyHttpError(error: unknown): ApiHttpError | null;
|
|
37
|
+
/** `details.code` of the retryable 503 for a request whose database connection was lost. */
|
|
38
|
+
export declare const DATABASE_UNAVAILABLE_ERROR_DETAIL_CODE = "DATABASE_UNAVAILABLE";
|
|
39
|
+
/**
|
|
40
|
+
* The request's database connection went away (an operator drain, failover,
|
|
41
|
+
* restart, or socket loss) rather than the statement being rejected. That is a
|
|
42
|
+
* brief, retryable outage, not an internal error. A read is safe to repeat. A
|
|
43
|
+
* mutation's outcome is unknown: the connection may have dropped after COMMIT,
|
|
44
|
+
* or after an earlier transaction of the same request committed, so the client
|
|
45
|
+
* must reconcile by its own idempotency key before resending.
|
|
46
|
+
*/
|
|
47
|
+
export declare function databaseUnavailableHttpError(error: unknown, method: string): ApiHttpError | null;
|
|
48
|
+
/** `details.code` of the retryable 503 for a deadlock/serialization victim. */
|
|
49
|
+
export declare const DATABASE_CONTENTION_ERROR_DETAIL_CODE = "DATABASE_CONTENTION";
|
|
50
|
+
/**
|
|
51
|
+
* PostgreSQL aborted the request's transaction as a deadlock (40P01) or
|
|
52
|
+
* serialization (40001) victim after any in-process retry was exhausted. The
|
|
53
|
+
* aborted transaction committed nothing, so this is transient contention, not
|
|
54
|
+
* an internal error. A read is safe to repeat. For a mutation the default is
|
|
55
|
+
* `outcomeUnknown` because an earlier transaction of the same request may have
|
|
56
|
+
* committed; a route whose only write is the aborted idempotent transaction
|
|
57
|
+
* passes `outcomeUnknown: false`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function databaseContentionHttpError(error: unknown, method: string, options?: {
|
|
60
|
+
outcomeUnknown?: boolean;
|
|
61
|
+
}): ApiHttpError | null;
|
|
62
|
+
/**
|
|
63
|
+
* A typed agent-configuration failure (capability unavailable, conflict,
|
|
64
|
+
* widening, not enabled). Rendered as 422 validation_failed with the specific
|
|
65
|
+
* code in `details.code` so clients can branch without parsing messages.
|
|
66
|
+
*/
|
|
67
|
+
export declare function agentConfigHttpError(error: unknown): ApiHttpError | null;
|
|
68
|
+
/**
|
|
69
|
+
* The requested or stored model is not in the live catalog. Rendered as the
|
|
70
|
+
* same 422 `validation_failed` with its historical message, plus
|
|
71
|
+
* `details.code: "model_unavailable"` and the model id so clients can ask for
|
|
72
|
+
* another model rather than offer a retry that cannot succeed.
|
|
73
|
+
*/
|
|
74
|
+
export declare function modelUnavailableHttpError(error: unknown): ApiHttpError | null;
|
|
26
75
|
export {};
|
package/dist/http/auth.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { type Settings } from "@opengeni/config";
|
|
2
|
-
import type { MiddlewareHandler } from "hono";
|
|
2
|
+
import type { Context, MiddlewareHandler } from "hono";
|
|
3
3
|
export declare function requireAccessKey(settings: Settings): MiddlewareHandler;
|
|
4
|
+
/**
|
|
5
|
+
* A request to a key-only (configured) deployment that presents the deployment
|
|
6
|
+
* key itself, from the operator rather than an agent acting for someone. The
|
|
7
|
+
* key travels in a request header that a page on another site can't add, so
|
|
8
|
+
* browser same-origin checks have nothing to protect on such a request.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isConfiguredDeploymentKeyRequest(c: Context, settings: Settings): boolean;
|
package/dist/http/cors.d.ts
CHANGED
|
@@ -4,3 +4,15 @@ export declare function validateInteractionRequestOrigin(value: string | undefin
|
|
|
4
4
|
publicBaseUrl?: string | undefined;
|
|
5
5
|
webBaseUrl?: string | undefined;
|
|
6
6
|
}): string | null;
|
|
7
|
+
type BrowserOriginSettings = {
|
|
8
|
+
corsAllowOriginRegex: string;
|
|
9
|
+
publicBaseUrl?: string | undefined;
|
|
10
|
+
webBaseUrl?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Whether a present `Origin` header names a browser origin this deployment
|
|
14
|
+
* serves its web app from: the CORS allowlist, the public base URL, or the
|
|
15
|
+
* separate web base URL. `null` and malformed values are never allowed.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isAllowedBrowserOrigin(value: string, input: BrowserOriginSettings): boolean;
|
|
18
|
+
export {};
|