@opengeni/contracts 5.5.0 → 5.5.2-canary.40656248492001
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/agent-authored-durable-text.d.ts +9 -9
- package/dist/agent-config.d.ts +148 -37
- package/dist/api-key-presets.d.ts +19 -0
- package/dist/app-action-catalog-types.d.ts +32 -0
- package/dist/app-action-catalog.gen.d.ts +2 -0
- package/dist/app-actions.d.ts +91 -0
- package/dist/app-actions.js +10130 -0
- package/dist/app-actions.js.map +1 -0
- package/dist/app-shot.d.ts +55 -0
- package/dist/artifact-catalog.d.ts +33 -0
- package/dist/artifacts.d.ts +166 -0
- package/dist/atlassian-native-retirement.d.ts +16 -0
- package/dist/atlassian-native-retirement.js +30 -0
- package/dist/atlassian-native-retirement.js.map +1 -0
- package/dist/atlassian.js +48 -23
- package/dist/automation-templates.d.ts +434 -0
- package/dist/automation-templates.js +31 -0
- package/dist/automation-templates.js.map +1 -0
- package/dist/billing-subscriptions.d.ts +61 -0
- package/dist/bots.d.ts +583 -0
- package/dist/bundled-skills.d.ts +58 -2
- package/dist/canonical-human-identities.js +3 -1
- package/dist/child-lifecycle-notice-protocol.d.ts +45 -0
- package/dist/chunk-2QKIEAGY.js +396 -0
- package/dist/chunk-2QKIEAGY.js.map +1 -0
- package/dist/chunk-2WOWEWXV.js +426 -0
- package/dist/chunk-2WOWEWXV.js.map +1 -0
- package/dist/chunk-2ZIHHL72.js +153 -0
- package/dist/chunk-2ZIHHL72.js.map +1 -0
- package/dist/chunk-32U6NKQQ.js +389 -0
- package/dist/chunk-32U6NKQQ.js.map +1 -0
- package/dist/chunk-4YDDHSO2.js +799 -0
- package/dist/chunk-4YDDHSO2.js.map +1 -0
- package/dist/chunk-56SNIMDO.js +9 -0
- package/dist/chunk-56SNIMDO.js.map +1 -0
- package/dist/chunk-5RWB6QVL.js +101 -0
- package/dist/chunk-5RWB6QVL.js.map +1 -0
- package/dist/chunk-5UGUOT3L.js +243 -0
- package/dist/chunk-5UGUOT3L.js.map +1 -0
- package/dist/chunk-6LAT33BH.js +130 -0
- package/dist/chunk-6LAT33BH.js.map +1 -0
- package/dist/chunk-7272KVWZ.js +60 -0
- package/dist/chunk-7272KVWZ.js.map +1 -0
- package/dist/chunk-72QC2GTL.js +36 -0
- package/dist/chunk-72QC2GTL.js.map +1 -0
- package/dist/chunk-7EQGGZBY.js +105 -0
- package/dist/chunk-7EQGGZBY.js.map +1 -0
- package/dist/chunk-A3LXWVYU.js +382 -0
- package/dist/chunk-A3LXWVYU.js.map +1 -0
- package/dist/chunk-AQYDZUJV.js +34 -0
- package/dist/chunk-AQYDZUJV.js.map +1 -0
- package/dist/chunk-BHCEVVUP.js +93 -0
- package/dist/chunk-BHCEVVUP.js.map +1 -0
- package/dist/chunk-BMUTAZX5.js +486 -0
- package/dist/chunk-BMUTAZX5.js.map +1 -0
- package/dist/chunk-DGG6IBBK.js +150 -0
- package/dist/chunk-DGG6IBBK.js.map +1 -0
- package/dist/{chunk-YBW5JSA3.js → chunk-FBCTUMHI.js} +123 -102
- package/dist/chunk-FBCTUMHI.js.map +1 -0
- package/dist/chunk-G2KJTFIC.js +97 -0
- package/dist/chunk-G2KJTFIC.js.map +1 -0
- package/dist/chunk-G4RKARXZ.js +1167 -0
- package/dist/chunk-G4RKARXZ.js.map +1 -0
- package/dist/chunk-H6UJJIUM.js +350 -0
- package/dist/chunk-H6UJJIUM.js.map +1 -0
- package/dist/chunk-JOTHDW4H.js +18 -0
- package/dist/chunk-JOTHDW4H.js.map +1 -0
- package/dist/chunk-L4GUEP7K.js +56480 -0
- package/dist/chunk-L4GUEP7K.js.map +1 -0
- package/dist/{chunk-SIOU2K4U.js → chunk-LJH2EYGT.js} +23 -23
- package/dist/chunk-MTJKSIGA.js +161 -0
- package/dist/chunk-MTJKSIGA.js.map +1 -0
- package/dist/chunk-MYHMB6GZ.js +202 -0
- package/dist/chunk-MYHMB6GZ.js.map +1 -0
- package/dist/chunk-PI5VIKJY.js +660 -0
- package/dist/chunk-PI5VIKJY.js.map +1 -0
- package/dist/{chunk-RIY7GYQS.js → chunk-PTSROVDG.js} +2 -2
- package/dist/chunk-PUIUXIOL.js +189 -0
- package/dist/chunk-PUIUXIOL.js.map +1 -0
- package/dist/chunk-R6VXJIMB.js +19 -0
- package/dist/chunk-R6VXJIMB.js.map +1 -0
- package/dist/chunk-RLJUNVAM.js +15 -0
- package/dist/chunk-RLJUNVAM.js.map +1 -0
- package/dist/chunk-RR6APCBK.js +213 -0
- package/dist/chunk-RR6APCBK.js.map +1 -0
- package/dist/{chunk-TXTQIYCV.js → chunk-RUQ4I6DO.js} +59 -13
- package/dist/chunk-RUQ4I6DO.js.map +1 -0
- package/dist/{chunk-WYBDERIY.js → chunk-RWEEUDHD.js} +53 -42
- package/dist/chunk-RWEEUDHD.js.map +1 -0
- package/dist/chunk-S7MSQQL6.js +158 -0
- package/dist/chunk-S7MSQQL6.js.map +1 -0
- package/dist/{chunk-5Q54VCCH.js → chunk-SHO4YO4B.js} +20 -36
- package/dist/chunk-SHO4YO4B.js.map +1 -0
- package/dist/{chunk-HHZSZYYF.js → chunk-T3HSWMA5.js} +20 -4
- package/dist/chunk-T3HSWMA5.js.map +1 -0
- package/dist/{chunk-YRKRZ6OF.js → chunk-TOOJIBJC.js} +2 -2
- package/dist/chunk-UCUOTRS6.js +431 -0
- package/dist/chunk-UCUOTRS6.js.map +1 -0
- package/dist/chunk-UH4K7GP7.js +424 -0
- package/dist/chunk-UH4K7GP7.js.map +1 -0
- package/dist/chunk-UIZWGPHV.js +120 -0
- package/dist/chunk-UIZWGPHV.js.map +1 -0
- package/dist/chunk-VLUKBV6Y.js +1170 -0
- package/dist/chunk-VLUKBV6Y.js.map +1 -0
- package/dist/chunk-W2QQ5Y6K.js +55 -0
- package/dist/chunk-W2QQ5Y6K.js.map +1 -0
- package/dist/{chunk-Y3KNXVTD.js → chunk-W3NBPR4E.js} +131 -31
- package/dist/chunk-W3NBPR4E.js.map +1 -0
- package/dist/{chunk-NRMCVHAU.js → chunk-WMGO4HJU.js} +11 -9
- package/dist/chunk-WMGO4HJU.js.map +1 -0
- package/dist/{chunk-MYBZRDTY.js → chunk-WQI7VNN4.js} +19 -9
- package/dist/chunk-WQI7VNN4.js.map +1 -0
- package/dist/{chunk-PX3VCKAU.js → chunk-WVCFSOUZ.js} +1 -1
- package/dist/{chunk-PX3VCKAU.js.map → chunk-WVCFSOUZ.js.map} +1 -1
- package/dist/chunk-XB6GQLBH.js +76 -0
- package/dist/chunk-XB6GQLBH.js.map +1 -0
- package/dist/{chunk-D2HKF2EF.js → chunk-XP5M3IKT.js} +2 -2
- package/dist/{chunk-O77VSFYZ.js → chunk-ZMPU5BWE.js} +12 -2
- package/dist/chunk-ZMPU5BWE.js.map +1 -0
- package/dist/{chunk-3SIZGL3O.js → chunk-ZYVEJFNU.js} +22 -18
- package/dist/chunk-ZYVEJFNU.js.map +1 -0
- package/dist/claude-provider-account-authority.d.ts +18 -0
- package/dist/claude-subscription-oauth.d.ts +25 -0
- package/dist/claude-subscription-usage.d.ts +95 -1
- package/dist/client-error-report.d.ts +154 -8
- package/dist/client-error-report.js +157 -2
- package/dist/client-error-report.js.map +1 -1
- package/dist/code-search.d.ts +1 -1
- package/dist/code-search.js.map +1 -1
- package/dist/codex-provider-account-authority.js +23 -12
- package/dist/codex-provider-account-authority.js.map +1 -1
- package/dist/company-profile.d.ts +144 -0
- package/dist/connect.d.ts +38 -0
- package/dist/connect.js +244 -164
- package/dist/connect.js.map +1 -1
- package/dist/connection-account-label.d.ts +2 -0
- package/dist/connection-account-label.js +34 -0
- package/dist/connection-account-label.js.map +1 -0
- package/dist/connection-authority.js +49 -24
- package/dist/connector-attachments.js +3 -1
- package/dist/connector-destinations.js +3 -1
- package/dist/connector-tool-permissions.d.ts +68 -4
- package/dist/credential-profiles.d.ts +166 -0
- package/dist/cua-desktop-tools.d.ts +19 -0
- package/dist/define-schema.d.ts +8 -0
- package/dist/desktop-app.d.ts +28 -0
- package/dist/direct-model-provider.d.ts +38 -0
- package/dist/document-artifact-commands.js +2 -2
- package/dist/document-artifact-query.js +2 -2
- package/dist/editable-artifact-binary.d.ts +7 -0
- package/dist/editable-artifact-causal-frontier.js +2 -2
- package/dist/editable-artifact-codec-registry.js +7 -7
- package/dist/editable-artifact-committed-transaction.js +4 -2
- package/dist/editable-artifact-live.js +8 -8
- package/dist/editable-artifact-serialized-commit.js +9 -9
- package/dist/editable-artifact-versions.d.ts +7 -1
- package/dist/editable-artifact-versions.js +1 -1
- package/dist/editable-artifacts.js +49 -43
- package/dist/event-preview.d.ts +22 -0
- package/dist/event-triggers.d.ts +1253 -0
- package/dist/event-triggers.js +148 -0
- package/dist/event-triggers.js.map +1 -0
- package/dist/external-identities.d.ts +34 -0
- package/dist/external-identities.js +4 -2
- package/dist/feedback.d.ts +181 -0
- package/dist/file-access.d.ts +23 -0
- package/dist/first-party-tool-authorization.d.ts +852 -0
- package/dist/github-repository-contracts.js +64 -43
- package/dist/github-repository-contracts.js.map +1 -1
- package/dist/google-drive-native-retirement.d.ts +12 -0
- package/dist/google-drive-native-retirement.js +20 -0
- package/dist/google-drive-native-retirement.js.map +1 -0
- package/dist/google-drive.d.ts +1 -1
- package/dist/google-drive.js +323 -239
- package/dist/google-drive.js.map +1 -1
- package/dist/host-mcp-bindings.js +250 -198
- package/dist/host-mcp-bindings.js.map +1 -1
- package/dist/index.d.ts +29072 -20593
- package/dist/index.js +2432 -366
- package/dist/inference-residency.d.ts +22 -0
- package/dist/insights-usage.d.ts +948 -0
- package/dist/insights-usage.js +608 -0
- package/dist/insights-usage.js.map +1 -0
- package/dist/integration-capability-id.d.ts +8 -0
- package/dist/interaction-action-deadline.d.ts +48 -0
- package/dist/interaction-driver-diagnostic.d.ts +28 -0
- package/dist/interaction.d.ts +2126 -881
- package/dist/knowledge-entries.d.ts +38 -0
- package/dist/knowledge-preparation.d.ts +4 -0
- package/dist/learning-refusal.d.ts +43 -0
- package/dist/learning-refusal.js +49 -0
- package/dist/learning-refusal.js.map +1 -0
- package/dist/managed-auth-session-sets.d.ts +1 -0
- package/dist/managed-auth-session-sets.js +207 -146
- package/dist/managed-auth-session-sets.js.map +1 -1
- package/dist/managed-sign-in-methods.d.ts +96 -0
- package/dist/managed-sign-in-methods.js +157 -35
- package/dist/managed-sign-in-methods.js.map +1 -1
- package/dist/mcp-structured-content.d.ts +25 -0
- package/dist/message-time-zone.d.ts +38 -0
- package/dist/message-time-zone.js +19 -0
- package/dist/message-time-zone.js.map +1 -0
- package/dist/modal-native-proof-v2.d.ts +587 -0
- package/dist/modal-native-proof-v2.js +39 -0
- package/dist/modal-native-proof-v2.js.map +1 -0
- package/dist/model-account-choice.d.ts +237 -0
- package/dist/model-account-settings.d.ts +422 -0
- package/dist/model-availability.d.ts +15 -0
- package/dist/model-connection-access.d.ts +13 -0
- package/dist/model-context-inspector.d.ts +8 -0
- package/dist/model-display.d.ts +43 -0
- package/dist/model-display.js +17 -0
- package/dist/model-display.js.map +1 -0
- package/dist/model-picker-order.js.map +1 -1
- package/dist/model-residency.d.ts +304 -0
- package/dist/organization-access.d.ts +416 -0
- package/dist/organization-access.js +40 -0
- package/dist/organization-access.js.map +1 -0
- package/dist/organization-integration-policy.d.ts +18 -0
- package/dist/organization-membership-lifecycle.d.ts +66 -0
- package/dist/organization-model-usage.d.ts +146 -0
- package/dist/organization-model-usage.js +87 -0
- package/dist/organization-model-usage.js.map +1 -0
- package/dist/organization-recovery.js +3 -1
- package/dist/organization-usage.d.ts +12 -0
- package/dist/passkey-only-account.d.ts +14 -0
- package/dist/passkey-only-account.js +13 -0
- package/dist/passkey-only-account.js.map +1 -0
- package/dist/permissions.d.ts +19 -0
- package/dist/personal-github.js +220 -148
- package/dist/personal-github.js.map +1 -1
- package/dist/personal-integration-setup.d.ts +81 -0
- package/dist/personal-integration-setup.js +42 -0
- package/dist/personal-integration-setup.js.map +1 -0
- package/dist/prepared-mcp-setup.d.ts +54 -0
- package/dist/prepared-mcp-setup.js +13 -0
- package/dist/prepared-mcp-setup.js.map +1 -0
- package/dist/presentation-artifact-commands.js +2 -2
- package/dist/presentation-artifact-query.js +2 -2
- package/dist/primitives.d.ts +18 -0
- package/dist/product-analytics.d.ts +27 -10
- package/dist/product-lifecycle-facts.d.ts +26 -3
- package/dist/prompt-cache-diagnostics.d.ts +92 -0
- package/dist/recordings.d.ts +1371 -0
- package/dist/remember.d.ts +98 -2
- package/dist/retained-output.d.ts +4 -2
- package/dist/sandbox-file-artifacts.d.ts +19 -2
- package/dist/sandbox-provider-command.d.ts +5 -44
- package/dist/sandbox-recovery.d.ts +139 -8
- package/dist/secret-generator.d.ts +44 -0
- package/dist/secret-mask-strings.d.ts +32 -0
- package/dist/secret-references.d.ts +90 -0
- package/dist/secret-resolution.d.ts +143 -0
- package/dist/secret-shape-masking.d.ts +52 -0
- package/dist/secret-shape-masking.js +19 -0
- package/dist/secret-shape-masking.js.map +1 -0
- package/dist/secret-totp.d.ts +41 -0
- package/dist/secret-use-approval-question.d.ts +11 -0
- package/dist/secret-use-approval-question.js +11 -0
- package/dist/secret-use-approval-question.js.map +1 -0
- package/dist/secret-use-approvals.d.ts +106 -0
- package/dist/secret-value-masking.d.ts +299 -0
- package/dist/secret-value-masking.js +62 -0
- package/dist/secret-value-masking.js.map +1 -0
- package/dist/secret-value.d.ts +19 -0
- package/dist/session-history-import.d.ts +444 -8
- package/dist/session-history.d.ts +111 -0
- package/dist/session-history.js +35 -0
- package/dist/session-history.js.map +1 -0
- package/dist/session-list-entries.d.ts +8 -0
- package/dist/session-list-entries.js +61 -0
- package/dist/session-list-entries.js.map +1 -0
- package/dist/session-mcp-projections.d.ts +13 -1
- package/dist/session-mcp-tool-permissions.d.ts +62 -0
- package/dist/session-target.d.ts +18 -0
- package/dist/session-titles.d.ts +8 -0
- package/dist/session-titles.js +5 -1
- package/dist/session-usage-limit-refusal.d.ts +34 -0
- package/dist/session-usage-limit-refusal.js +15 -0
- package/dist/session-usage-limit-refusal.js.map +1 -0
- package/dist/session-usage-limits.d.ts +127 -0
- package/dist/session-usage-limits.js +43 -0
- package/dist/session-usage-limits.js.map +1 -0
- package/dist/site-data.d.ts +286 -0
- package/dist/site-operations.d.ts +39 -0
- package/dist/site-publishing.d.ts +813 -0
- package/dist/site-session-http.d.ts +103 -4
- package/dist/site-session-http.js +27 -1
- package/dist/site-sql.d.ts +425 -0
- package/dist/skills.d.ts +38 -0
- package/dist/slack-bot-scopes.d.ts +9 -7
- package/dist/slack-bot-scopes.js +6 -3
- package/dist/slack-rest-mcp.d.ts +36 -0
- package/dist/slack-rest-mcp.js +25 -0
- package/dist/slack-rest-mcp.js.map +1 -0
- package/dist/spreadsheet-artifact-commands.d.ts +14 -1
- package/dist/spreadsheet-artifact-commands.js +9 -2
- package/dist/spreadsheet-artifact-query.d.ts +13 -6
- package/dist/spreadsheet-artifact-query.js +4 -3
- package/dist/subscription-account-actions.d.ts +83 -0
- package/dist/subscription-account-pools.d.ts +326 -0
- package/dist/subscription-personal-authority-v2.d.ts +28 -0
- package/dist/subscription-personal-authority-v2.js +13 -0
- package/dist/subscription-personal-authority-v2.js.map +1 -0
- package/dist/subscription-plans.d.ts +38 -0
- package/dist/subscription-usage-pool.d.ts +89 -0
- package/dist/tool-action-review.d.ts +141 -0
- package/dist/tool-catalog.d.ts +479 -0
- package/dist/tool-policy.d.ts +5 -0
- package/dist/tool-review-presentation.d.ts +29 -0
- package/dist/tool-review-presentation.js +21 -0
- package/dist/tool-review-presentation.js.map +1 -0
- package/dist/turn-serving-policy.d.ts +223 -0
- package/dist/usage-allowances.d.ts +30 -0
- package/dist/usage-allowances.js +5 -1
- package/dist/values.d.ts +11 -0
- package/dist/values.js +19 -0
- package/dist/values.js.map +1 -0
- package/dist/vault-provider-wire.d.ts +907 -0
- package/dist/vault-provider-wire.js +74 -0
- package/dist/vault-provider-wire.js.map +1 -0
- package/dist/vaults.d.ts +2185 -0
- package/dist/video-generation.d.ts +75 -0
- package/dist/video-generation.js +8 -1
- package/dist/workspace-control-event.d.ts +18 -0
- package/dist/workspace-control-event.js +18 -0
- package/dist/workspace-control-event.js.map +1 -0
- package/dist/workspace-governance-context.d.ts +18 -0
- package/dist/workspace-integration-wire.d.ts +1 -1
- package/dist/workspace-integration-wire.js +1 -1
- package/dist/workspace-integrations.d.ts +212 -12
- package/dist/xai-provider-account-authority.js +3 -1
- package/package.json +121 -4
- package/src/agent-authored-durable-text.ts +14 -11
- package/src/agent-config.ts +382 -203
- package/src/agent-instruction-changes.ts +94 -74
- package/src/agent-learning.ts +94 -66
- package/src/agent-topology.ts +58 -52
- package/src/api-key-presets.ts +28 -0
- package/src/app-action-catalog-types.ts +32 -0
- package/src/app-action-catalog.gen.ts +9905 -0
- package/src/app-actions.ts +365 -0
- package/src/app-shot.ts +176 -0
- package/src/artifact-catalog.ts +81 -46
- package/src/artifacts.ts +360 -227
- package/src/atlassian-native-retirement.ts +33 -0
- package/src/atlassian.ts +136 -108
- package/src/automation-templates.ts +201 -0
- package/src/billing-subscriptions.ts +48 -0
- package/src/bots.ts +238 -0
- package/src/bundled-skills.ts +79 -22
- package/src/canonical-human-identities.ts +65 -62
- package/src/child-lifecycle-notice-protocol.gen.json +1310 -0
- package/src/child-lifecycle-notice-protocol.ts +224 -0
- package/src/claude-provider-account-authority.ts +12 -0
- package/src/claude-subscription-oauth.ts +61 -19
- package/src/claude-subscription-usage.ts +64 -35
- package/src/client-error-report.ts +344 -9
- package/src/code-search.ts +1 -1
- package/src/codex-provider-account-authority.ts +22 -16
- package/src/company-brain-governed-writes.ts +265 -244
- package/src/company-brain.ts +165 -154
- package/src/company-profile.ts +362 -297
- package/src/connect.ts +222 -173
- package/src/connection-account-label.ts +45 -0
- package/src/connection-authority.ts +172 -152
- package/src/connector-attachments.ts +139 -123
- package/src/connector-destinations.ts +48 -43
- package/src/connector-tool-permissions.ts +104 -46
- package/src/credential-profiles.ts +161 -0
- package/src/cua-desktop-tools.gen.json +6722 -0
- package/src/cua-desktop-tools.linux.gen.json +6798 -0
- package/src/cua-desktop-tools.ts +42 -0
- package/src/cua-desktop-tools.windows.gen.json +6739 -0
- package/src/define-schema.ts +10 -0
- package/src/desktop-app.ts +50 -0
- package/src/direct-model-provider.ts +112 -0
- package/src/editable-artifact-binary.ts +29 -8
- package/src/editable-artifact-committed-transaction.ts +19 -18
- package/src/editable-artifact-serialized-commit.ts +8 -2
- package/src/editable-artifact-versions.ts +7 -1
- package/src/event-preview.ts +53 -3
- package/src/event-triggers.ts +891 -0
- package/src/external-identities.ts +239 -195
- package/src/feedback.ts +125 -30
- package/src/file-access.ts +26 -0
- package/src/first-party-tool-authorization.ts +383 -0
- package/src/github-repository-contracts.ts +78 -64
- package/src/google-drive-native-retirement.ts +20 -0
- package/src/google-drive.ts +286 -234
- package/src/governed-learning-activation.ts +159 -137
- package/src/governed-learning-evaluator.ts +141 -133
- package/src/host-mcp-bindings.ts +244 -221
- package/src/image-generation.ts +105 -95
- package/src/index.ts +13928 -9899
- package/src/inference-residency.ts +36 -0
- package/src/insights-usage.ts +774 -0
- package/src/integration-capability-id.ts +16 -0
- package/src/interaction-action-deadline.ts +143 -0
- package/src/interaction-driver-diagnostic.ts +89 -0
- package/src/interaction.ts +3527 -2427
- package/src/knowledge-entries.ts +386 -299
- package/src/knowledge-preparation.ts +49 -41
- package/src/knowledge.ts +242 -213
- package/src/learning-refusal.ts +90 -0
- package/src/managed-auth-session-sets.ts +180 -133
- package/src/managed-sign-in-methods.ts +156 -34
- package/src/mcp-oauth.ts +58 -46
- package/src/mcp-receipts.ts +199 -194
- package/src/mcp-structured-content.ts +81 -0
- package/src/memory-slack-delivery.ts +172 -142
- package/src/message-time-zone.ts +109 -0
- package/src/modal-native-proof-v2.ts +430 -0
- package/src/model-account-choice.ts +178 -0
- package/src/model-account-settings.ts +210 -0
- package/src/model-availability.ts +22 -0
- package/src/model-connection-access.ts +62 -14
- package/src/model-context-inspector.ts +130 -109
- package/src/model-display.ts +221 -0
- package/src/model-picker-order.ts +1 -1
- package/src/model-residency.ts +535 -0
- package/src/organization-access.ts +216 -0
- package/src/organization-integration-policy.ts +47 -28
- package/src/organization-membership-lifecycle.ts +558 -384
- package/src/organization-model-usage.ts +82 -0
- package/src/organization-recovery.ts +148 -135
- package/src/organization-usage.ts +84 -52
- package/src/passkey-only-account.ts +29 -0
- package/src/permissions.ts +94 -52
- package/src/personal-github.ts +211 -171
- package/src/personal-integration-setup.ts +150 -0
- package/src/preference-registry.ts +319 -263
- package/src/prepared-mcp-setup.ts +190 -0
- package/src/primitives.ts +22 -0
- package/src/product-analytics.ts +40 -15
- package/src/product-lifecycle-facts.ts +50 -20
- package/src/prompt-cache-diagnostics.ts +212 -0
- package/src/recordings.ts +1153 -0
- package/src/remember.ts +184 -172
- package/src/retained-output.ts +181 -168
- package/src/sandbox-file-artifacts.ts +78 -57
- package/src/sandbox-provider-command.ts +55 -72
- package/src/sandbox-recovery.ts +163 -77
- package/src/scoped-knowledge.ts +62 -43
- package/src/secret-generator.ts +156 -0
- package/src/secret-mask-strings.ts +175 -0
- package/src/secret-references.ts +414 -0
- package/src/secret-resolution.ts +322 -0
- package/src/secret-shape-masking.ts +573 -0
- package/src/secret-totp.ts +188 -0
- package/src/secret-use-approval-question.ts +22 -0
- package/src/secret-use-approvals.ts +219 -0
- package/src/secret-value-masking.ts +1283 -0
- package/src/secret-value.ts +22 -0
- package/src/session-goal-reports.ts +55 -49
- package/src/session-history-import.ts +84 -68
- package/src/session-history.ts +197 -0
- package/src/session-list-entries.ts +106 -0
- package/src/session-mcp-projections.ts +21 -3
- package/src/session-mcp-tool-permissions.ts +109 -0
- package/src/session-message-search.ts +46 -38
- package/src/session-target.ts +58 -0
- package/src/session-titles.ts +40 -4
- package/src/session-topology-primitives.ts +20 -12
- package/src/session-usage-limit-refusal.ts +101 -0
- package/src/session-usage-limits.ts +169 -0
- package/src/signup-attribution.ts +20 -15
- package/src/site-data.ts +337 -0
- package/src/site-operations.ts +154 -0
- package/src/site-publishing.ts +903 -0
- package/src/site-session-http.ts +344 -16
- package/src/site-sql.ts +1120 -0
- package/src/skill-use.ts +18 -17
- package/src/skills.ts +105 -50
- package/src/slack-bot-scopes.ts +18 -35
- package/src/slack-rest-mcp.ts +222 -0
- package/src/slack-task-policy.ts +97 -73
- package/src/spreadsheet-artifact-commands.ts +74 -13
- package/src/spreadsheet-artifact-query.ts +188 -50
- package/src/subscription-account-actions.ts +103 -0
- package/src/subscription-account-pools.ts +74 -0
- package/src/subscription-personal-authority-v2.ts +69 -0
- package/src/subscription-plans.ts +51 -0
- package/src/subscription-usage-pool.ts +44 -0
- package/src/task-notes.ts +70 -68
- package/src/tool-action-review.ts +271 -0
- package/src/tool-catalog.ts +694 -379
- package/src/tool-policy.ts +82 -0
- package/src/tool-result-spill.ts +13 -9
- package/src/tool-review-presentation.ts +643 -0
- package/src/turn-serving-policy.ts +167 -0
- package/src/usage-allowances.ts +212 -136
- package/src/values.ts +25 -0
- package/src/vault-provider-wire.ts +580 -0
- package/src/vaults.ts +1296 -0
- package/src/video-generation.ts +430 -361
- package/src/work-claims.ts +183 -166
- package/src/workspace-control-event.ts +134 -0
- package/src/workspace-governance-context.ts +63 -0
- package/src/workspace-instruction-policies.ts +346 -279
- package/src/workspace-integration-wire.ts +10 -0
- package/src/workspace-integrations.ts +488 -398
- package/src/workspace-learning-administration.ts +58 -44
- package/src/workspace-learning-policy.ts +126 -99
- package/src/workspace-state.ts +239 -220
- package/src/xai-provider-account-authority.ts +23 -17
- package/dist/chunk-3SIZGL3O.js.map +0 -1
- package/dist/chunk-566IFOVP.js +0 -26133
- package/dist/chunk-566IFOVP.js.map +0 -1
- package/dist/chunk-5IXYF6XN.js +0 -728
- package/dist/chunk-5IXYF6XN.js.map +0 -1
- package/dist/chunk-5Q54VCCH.js.map +0 -1
- package/dist/chunk-BCS7WHCK.js +0 -139
- package/dist/chunk-BCS7WHCK.js.map +0 -1
- package/dist/chunk-EK7NDGFR.js +0 -128
- package/dist/chunk-EK7NDGFR.js.map +0 -1
- package/dist/chunk-GRG7PHWQ.js +0 -25
- package/dist/chunk-GRG7PHWQ.js.map +0 -1
- package/dist/chunk-HHZSZYYF.js.map +0 -1
- package/dist/chunk-ICDZGUX2.js +0 -186
- package/dist/chunk-ICDZGUX2.js.map +0 -1
- package/dist/chunk-JUFK3T4Q.js +0 -80
- package/dist/chunk-JUFK3T4Q.js.map +0 -1
- package/dist/chunk-MYBZRDTY.js.map +0 -1
- package/dist/chunk-NRMCVHAU.js.map +0 -1
- package/dist/chunk-O77VSFYZ.js.map +0 -1
- package/dist/chunk-P3HLDT77.js +0 -59
- package/dist/chunk-P3HLDT77.js.map +0 -1
- package/dist/chunk-TXTQIYCV.js.map +0 -1
- package/dist/chunk-WYBDERIY.js.map +0 -1
- package/dist/chunk-Y3KNXVTD.js.map +0 -1
- package/dist/chunk-YBW5JSA3.js.map +0 -1
- package/dist/chunk-YRXAWWCU.js +0 -45
- package/dist/chunk-YRXAWWCU.js.map +0 -1
- package/dist/chunk-YWMOIZ6A.js +0 -185
- package/dist/chunk-YWMOIZ6A.js.map +0 -1
- package/dist/site-request-headers.test.d.ts +0 -1
- package/dist/transcription-recordings.d.ts +0 -300
- package/src/transcription-recordings.ts +0 -169
- /package/dist/{chunk-SIOU2K4U.js.map → chunk-LJH2EYGT.js.map} +0 -0
- /package/dist/{chunk-RIY7GYQS.js.map → chunk-PTSROVDG.js.map} +0 -0
- /package/dist/{chunk-YRKRZ6OF.js.map → chunk-TOOJIBJC.js.map} +0 -0
- /package/dist/{chunk-D2HKF2EF.js.map → chunk-XP5M3IKT.js.map} +0 -0
|
@@ -0,0 +1,903 @@
|
|
|
1
|
+
import * as primitives from "./primitives";
|
|
2
|
+
import { defineSchema } from "./define-schema";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Published Sites: a workspace Site served on its own hostname under a
|
|
7
|
+
* configurable Sites domain (production `opengeni.site`, staging a separate
|
|
8
|
+
* domain). Shared by the API, the Site gateway Worker, the console and the
|
|
9
|
+
* SDK. See docs/design/published-sites-2026-10-14.md.
|
|
10
|
+
*
|
|
11
|
+
* Nothing here names a concrete domain: every domain is configuration.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Hostnames
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
export const SITE_HOSTNAME_LABEL_MIN = 3;
|
|
19
|
+
export const SITE_HOSTNAME_LABEL_MAX = 63;
|
|
20
|
+
/** A released hostname stays reserved to its workspace for at least this long. */
|
|
21
|
+
export const SITE_HOSTNAME_RELEASE_HOLD_DAYS = 30;
|
|
22
|
+
|
|
23
|
+
/** Labels no Site may take: platform, mail, auth and infrastructure names. */
|
|
24
|
+
export const SITE_RESERVED_HOSTNAME_LABELS: readonly string[] = Object.freeze([
|
|
25
|
+
"www",
|
|
26
|
+
"api",
|
|
27
|
+
"app",
|
|
28
|
+
"admin",
|
|
29
|
+
"auth",
|
|
30
|
+
"login",
|
|
31
|
+
"logout",
|
|
32
|
+
"account",
|
|
33
|
+
"accounts",
|
|
34
|
+
"mail",
|
|
35
|
+
"email",
|
|
36
|
+
"smtp",
|
|
37
|
+
"imap",
|
|
38
|
+
"pop",
|
|
39
|
+
"mx",
|
|
40
|
+
"ns",
|
|
41
|
+
"ns1",
|
|
42
|
+
"ns2",
|
|
43
|
+
"dns",
|
|
44
|
+
"status",
|
|
45
|
+
"docs",
|
|
46
|
+
"help",
|
|
47
|
+
"support",
|
|
48
|
+
"abuse",
|
|
49
|
+
"security",
|
|
50
|
+
"postmaster",
|
|
51
|
+
"hostmaster",
|
|
52
|
+
"webmaster",
|
|
53
|
+
"noreply",
|
|
54
|
+
"no-reply",
|
|
55
|
+
"cdn",
|
|
56
|
+
"static",
|
|
57
|
+
"assets",
|
|
58
|
+
"media",
|
|
59
|
+
"og",
|
|
60
|
+
"opengeni",
|
|
61
|
+
"cloudgeni",
|
|
62
|
+
"gateway",
|
|
63
|
+
"edge",
|
|
64
|
+
"internal",
|
|
65
|
+
"staging",
|
|
66
|
+
"preview",
|
|
67
|
+
"dev",
|
|
68
|
+
"test",
|
|
69
|
+
"billing",
|
|
70
|
+
"dashboard",
|
|
71
|
+
"console",
|
|
72
|
+
"root",
|
|
73
|
+
"system",
|
|
74
|
+
"autoconfig",
|
|
75
|
+
"autodiscover",
|
|
76
|
+
"wpad",
|
|
77
|
+
"localhost",
|
|
78
|
+
]);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Words that make a hostname look like a credential, payment or brand page.
|
|
82
|
+
* A label containing any of them is refused (substring match on the label
|
|
83
|
+
* with hyphens removed), whoever asks.
|
|
84
|
+
*/
|
|
85
|
+
export const SITE_BLOCKED_HOSTNAME_WORDS: readonly string[] = Object.freeze([
|
|
86
|
+
"secure",
|
|
87
|
+
"verify",
|
|
88
|
+
"verification",
|
|
89
|
+
"wallet",
|
|
90
|
+
"signin",
|
|
91
|
+
"login",
|
|
92
|
+
"logon",
|
|
93
|
+
"password",
|
|
94
|
+
"passwd",
|
|
95
|
+
"credential",
|
|
96
|
+
"recovery",
|
|
97
|
+
"unlock",
|
|
98
|
+
"refund",
|
|
99
|
+
"banking",
|
|
100
|
+
"paypal",
|
|
101
|
+
"stripe",
|
|
102
|
+
"venmo",
|
|
103
|
+
"coinbase",
|
|
104
|
+
"binance",
|
|
105
|
+
"metamask",
|
|
106
|
+
"trezor",
|
|
107
|
+
"seedphrase",
|
|
108
|
+
"google",
|
|
109
|
+
"gmail",
|
|
110
|
+
"microsoft",
|
|
111
|
+
"office365",
|
|
112
|
+
"outlook",
|
|
113
|
+
"azure",
|
|
114
|
+
"apple",
|
|
115
|
+
"icloud",
|
|
116
|
+
"amazon",
|
|
117
|
+
"facebook",
|
|
118
|
+
"instagram",
|
|
119
|
+
"whatsapp",
|
|
120
|
+
"netflix",
|
|
121
|
+
"linkedin",
|
|
122
|
+
"github",
|
|
123
|
+
"dropbox",
|
|
124
|
+
"docusign",
|
|
125
|
+
"okta",
|
|
126
|
+
"opengeni",
|
|
127
|
+
"cloudgeni",
|
|
128
|
+
]);
|
|
129
|
+
|
|
130
|
+
export type SiteHostnameLabelProblem =
|
|
131
|
+
| "length"
|
|
132
|
+
| "characters"
|
|
133
|
+
| "hyphen"
|
|
134
|
+
| "punycode"
|
|
135
|
+
| "reserved"
|
|
136
|
+
| "blocked";
|
|
137
|
+
|
|
138
|
+
export const SITE_HOSTNAME_PROBLEM_MESSAGES: Readonly<Record<SiteHostnameLabelProblem, string>> =
|
|
139
|
+
Object.freeze({
|
|
140
|
+
length: `Use ${SITE_HOSTNAME_LABEL_MIN} to ${SITE_HOSTNAME_LABEL_MAX} characters.`,
|
|
141
|
+
characters: "Use lowercase letters, digits and hyphens only.",
|
|
142
|
+
hyphen: "Start and end with a letter or digit.",
|
|
143
|
+
punycode: "Names with -- in the third and fourth place are not allowed.",
|
|
144
|
+
reserved: "This name is reserved.",
|
|
145
|
+
blocked: "This name is not allowed.",
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Validate one DNS label for a Site hostname. Pure and environment-neutral:
|
|
150
|
+
* the API, the gateway and the console all call it. Availability (global
|
|
151
|
+
* uniqueness and the release hold) is decided only by the API.
|
|
152
|
+
*/
|
|
153
|
+
export function siteHostnameLabelProblem(label: string): SiteHostnameLabelProblem | null {
|
|
154
|
+
if (label.length < SITE_HOSTNAME_LABEL_MIN || label.length > SITE_HOSTNAME_LABEL_MAX)
|
|
155
|
+
return "length";
|
|
156
|
+
if (!/^[a-z0-9-]+$/u.test(label)) return "characters";
|
|
157
|
+
if (label.startsWith("-") || label.endsWith("-")) return "hyphen";
|
|
158
|
+
// IDNA reserves "--" in positions 3-4 (xn--, and future ACE prefixes).
|
|
159
|
+
if (label.slice(2, 4) === "--") return "punycode";
|
|
160
|
+
if (SITE_RESERVED_HOSTNAME_LABELS.includes(label)) return "reserved";
|
|
161
|
+
const flat = label.replaceAll("-", "");
|
|
162
|
+
if (SITE_BLOCKED_HOSTNAME_WORDS.some((word) => flat.includes(word))) return "blocked";
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export const SiteHostnameLabel = /* @__PURE__ */ defineSchema(() =>
|
|
167
|
+
primitives.string
|
|
168
|
+
.superRefine((label, ctx) => {
|
|
169
|
+
const problem = siteHostnameLabelProblem(label);
|
|
170
|
+
if (problem)
|
|
171
|
+
ctx.addIssue({ code: "custom", message: SITE_HOSTNAME_PROBLEM_MESSAGES[problem] });
|
|
172
|
+
})
|
|
173
|
+
.describe(
|
|
174
|
+
"One DNS label: 3-63 lowercase letters, digits or hyphens, not starting or ending with a hyphen. The Site is served at <label>.<sites domain>.",
|
|
175
|
+
),
|
|
176
|
+
);
|
|
177
|
+
export type SiteHostnameLabel = z.infer<typeof SiteHostnameLabel>;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Suggest a default label from a Site title: a slug plus a random
|
|
181
|
+
* four-character suffix (`team-dashboard-4k9x`), always valid by
|
|
182
|
+
* construction. `suffix` must be 4 chars of [a-z0-9]; callers supply it so
|
|
183
|
+
* this stays pure.
|
|
184
|
+
*/
|
|
185
|
+
export function suggestSiteHostnameLabel(title: string, suffix: string): string {
|
|
186
|
+
if (!/^[a-z0-9]{4}$/u.test(suffix)) throw new Error("suffix must be 4 chars of [a-z0-9]");
|
|
187
|
+
const base = title
|
|
188
|
+
.normalize("NFKD")
|
|
189
|
+
.toLowerCase()
|
|
190
|
+
.replace(/[^a-z0-9]+/gu, "-")
|
|
191
|
+
.replace(/^-+|-+$/gu, "")
|
|
192
|
+
.slice(0, SITE_HOSTNAME_LABEL_MAX - 5)
|
|
193
|
+
.replace(/-+$/u, "");
|
|
194
|
+
const label = `${base || "site"}-${suffix}`;
|
|
195
|
+
return siteHostnameLabelProblem(label) ? `site-${suffix}` : label;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** Normalize a configured Sites domain (`opengeni.site`); throws when it is not a hostname. */
|
|
199
|
+
export function normalizeSitesDomain(domain: string): string {
|
|
200
|
+
const normalized = domain.trim().toLowerCase().replace(/\.$/u, "");
|
|
201
|
+
if (
|
|
202
|
+
!/^(?=.{3,200}$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/u.test(
|
|
203
|
+
normalized,
|
|
204
|
+
)
|
|
205
|
+
)
|
|
206
|
+
throw new Error("Invalid Sites domain");
|
|
207
|
+
return normalized;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** `<label>.<domain>` for a valid label and configured domain. */
|
|
211
|
+
export function siteHostname(label: string, sitesDomain: string): string {
|
|
212
|
+
return `${label}.${normalizeSitesDomain(sitesDomain)}`;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The label of a flat one-level Site hostname under the Sites domain, or null
|
|
217
|
+
* for the apex, deeper names, other domains and invalid labels. A port and a
|
|
218
|
+
* trailing dot are ignored.
|
|
219
|
+
*/
|
|
220
|
+
export function parseSiteHostname(host: string, sitesDomain: string): string | null {
|
|
221
|
+
const domain = normalizeSitesDomain(sitesDomain);
|
|
222
|
+
const name = host.trim().toLowerCase().replace(/:\d+$/u, "").replace(/\.$/u, "");
|
|
223
|
+
if (!name.endsWith(`.${domain}`)) return null;
|
|
224
|
+
const label = name.slice(0, -(domain.length + 1));
|
|
225
|
+
if (!label || label.includes(".")) return null;
|
|
226
|
+
return siteHostnameLabelProblem(label) === null ? label : null;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// ---------------------------------------------------------------------------
|
|
230
|
+
// Publication
|
|
231
|
+
// ---------------------------------------------------------------------------
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Who may open a published Site.
|
|
235
|
+
* - members: signed-in members of the Site's workspace.
|
|
236
|
+
* - invited: members plus people invited by email (they sign in to Opengeni).
|
|
237
|
+
* - public: anyone; anonymous visitors use a guest principal. On deployments
|
|
238
|
+
* configured login-only (staging), public means any signed-in Opengeni user.
|
|
239
|
+
*/
|
|
240
|
+
export const SiteAccessMode = /* @__PURE__ */ defineSchema(() =>
|
|
241
|
+
z.enum(["members", "invited", "public"]),
|
|
242
|
+
);
|
|
243
|
+
export type SiteAccessMode = z.infer<typeof SiteAccessMode>;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* active: served. unpublished: the owner turned publishing off (the hostname
|
|
247
|
+
* stays held). suspended: taken down by the owner, a workspace admin or a
|
|
248
|
+
* platform moderator; the gateway serves a takedown page.
|
|
249
|
+
*/
|
|
250
|
+
export const SitePublicationStatus = /* @__PURE__ */ defineSchema(() =>
|
|
251
|
+
z.enum(["active", "unpublished", "suspended"]),
|
|
252
|
+
);
|
|
253
|
+
export type SitePublicationStatus = z.infer<typeof SitePublicationStatus>;
|
|
254
|
+
|
|
255
|
+
export const SiteLimitProfileKind = /* @__PURE__ */ defineSchema(() =>
|
|
256
|
+
z
|
|
257
|
+
.enum(["standard", "free", "credits", "unlimited", "custom"])
|
|
258
|
+
.describe(
|
|
259
|
+
"Limits for people outside the workspace (workspace members are never limited by Site limits). standard: platform defaults ($10 per Site per month, no per-person limit). free: accepted alias of standard, stored and returned as standard. credits: the standard limits and guest guards multiplied. unlimited: no spend limits (flood brakes still apply). custom: explicit values over the standard defaults. Any kind may carry overrides, which adjust that kind's limits.",
|
|
260
|
+
),
|
|
261
|
+
);
|
|
262
|
+
export type SiteLimitProfileKind = z.infer<typeof SiteLimitProfileKind>;
|
|
263
|
+
|
|
264
|
+
const NullableLimit = (description: string) =>
|
|
265
|
+
z.number().int().nonnegative().nullable().describe(`${description} null means no limit.`);
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Effective limits for a published Site. Money is in micro-USD
|
|
269
|
+
* (1_000_000 = $1). They apply to people outside the workspace only
|
|
270
|
+
* (invited people and public visitors, signed in or anonymous); workspace
|
|
271
|
+
* members are never limited by them and use the workspace's normal session
|
|
272
|
+
* limits, on any Site. Cloudflare cannot cap spend, so the edge applies only
|
|
273
|
+
* flood brakes; Opengeni enforces these values.
|
|
274
|
+
*/
|
|
275
|
+
export const SiteLimits = /* @__PURE__ */ defineSchema(() =>
|
|
276
|
+
z.object({
|
|
277
|
+
requestsPerMinutePerVisitor: NullableLimit(
|
|
278
|
+
"Site runtime requests per viewer per minute (flood brake; members too).",
|
|
279
|
+
),
|
|
280
|
+
guestWritesPerMinute: NullableLimit("Data writes per guest visitor per minute."),
|
|
281
|
+
agentsEnabled: primitives.boolean.describe(
|
|
282
|
+
"People outside the workspace may use the Site's embedded agent. Members always may when the agent is on.",
|
|
283
|
+
),
|
|
284
|
+
guestAgentsEnabled: primitives.boolean.describe(
|
|
285
|
+
"Anonymous guests may use the embedded agent too (public Sites).",
|
|
286
|
+
),
|
|
287
|
+
conversationsPerVisitorPerDay: NullableLimit(
|
|
288
|
+
"Bot guard for anonymous guests: new conversations per visitor per UTC day.",
|
|
289
|
+
),
|
|
290
|
+
conversationsPerSitePerDay: NullableLimit(
|
|
291
|
+
"Bot guard for anonymous guests: new conversations per Site per UTC day.",
|
|
292
|
+
),
|
|
293
|
+
turnsPerConversation: NullableLimit(
|
|
294
|
+
"Bot guard for anonymous guests: messages in one conversation.",
|
|
295
|
+
),
|
|
296
|
+
agentMicrosPerConversation: NullableLimit(
|
|
297
|
+
"Bot guard for anonymous guests: spend per conversation, micro-USD.",
|
|
298
|
+
),
|
|
299
|
+
agentMicrosPerVisitorPerDay: NullableLimit(
|
|
300
|
+
"Optional per-person limit: spend per person or visitor outside the workspace per UTC day, micro-USD.",
|
|
301
|
+
),
|
|
302
|
+
agentMicrosPerVisitorPerMonth: NullableLimit(
|
|
303
|
+
"Optional per-person limit: spend per person or visitor outside the workspace per UTC month, micro-USD.",
|
|
304
|
+
).default(null),
|
|
305
|
+
agentMicrosPerSitePerDay: NullableLimit(
|
|
306
|
+
"The Site limit as a daily amount: spend of everyone outside the workspace together per UTC day, micro-USD.",
|
|
307
|
+
).default(null),
|
|
308
|
+
agentMicrosPerSitePerMonth: NullableLimit(
|
|
309
|
+
"The Site limit: spend of everyone outside the workspace together per UTC month, micro-USD.",
|
|
310
|
+
),
|
|
311
|
+
agentModels: z
|
|
312
|
+
.array(z.string().min(1).max(200))
|
|
313
|
+
.max(20)
|
|
314
|
+
.nullable()
|
|
315
|
+
.describe("Models embedded agents may use; null allows the workspace defaults."),
|
|
316
|
+
}),
|
|
317
|
+
);
|
|
318
|
+
export type SiteLimits = z.infer<typeof SiteLimits>;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* The standard limits: $10 per Site per month for everyone outside the
|
|
322
|
+
* workspace together, no per-person limit, and internal bot guards for
|
|
323
|
+
* anonymous guests (conversation and message counts are not shown to Site
|
|
324
|
+
* owners). Deployments override them through settings.
|
|
325
|
+
*/
|
|
326
|
+
export const DEFAULT_SITE_LIMITS: Readonly<SiteLimits> = Object.freeze({
|
|
327
|
+
requestsPerMinutePerVisitor: 120,
|
|
328
|
+
guestWritesPerMinute: 30,
|
|
329
|
+
agentsEnabled: true,
|
|
330
|
+
guestAgentsEnabled: true,
|
|
331
|
+
conversationsPerVisitorPerDay: 20,
|
|
332
|
+
conversationsPerSitePerDay: 500,
|
|
333
|
+
turnsPerConversation: 50,
|
|
334
|
+
agentMicrosPerConversation: 1_000_000,
|
|
335
|
+
agentMicrosPerVisitorPerDay: null,
|
|
336
|
+
agentMicrosPerVisitorPerMonth: null,
|
|
337
|
+
agentMicrosPerSitePerDay: null,
|
|
338
|
+
agentMicrosPerSitePerMonth: 10_000_000,
|
|
339
|
+
agentModels: null,
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
/** @deprecated The former `free` profile; now the standard limits (DEFAULT_SITE_LIMITS). */
|
|
343
|
+
export const DEFAULT_FREE_SITE_LIMITS: Readonly<SiteLimits> = DEFAULT_SITE_LIMITS;
|
|
344
|
+
|
|
345
|
+
/** Hard caps that still apply under every profile, unlimited included. */
|
|
346
|
+
export const UNLIMITED_SITE_FLOOD_BRAKES = Object.freeze({
|
|
347
|
+
requestsPerMinutePerVisitor: 600,
|
|
348
|
+
conversationsPerSitePerDay: 10_000,
|
|
349
|
+
agentMicrosPerConversation: 5_000_000,
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
export const SiteLimitProfile = /* @__PURE__ */ defineSchema(() =>
|
|
353
|
+
z.object({
|
|
354
|
+
kind: SiteLimitProfileKind,
|
|
355
|
+
/**
|
|
356
|
+
* Explicit values over the kind's limits (custom: over the standard
|
|
357
|
+
* defaults). Missing fields keep the kind's values.
|
|
358
|
+
*/
|
|
359
|
+
overrides: SiteLimits.partial().nullable().default(null),
|
|
360
|
+
}),
|
|
361
|
+
);
|
|
362
|
+
export type SiteLimitProfile = z.infer<typeof SiteLimitProfile>;
|
|
363
|
+
|
|
364
|
+
export const SiteEmbeddedAgent = /* @__PURE__ */ defineSchema(() =>
|
|
365
|
+
z.object({
|
|
366
|
+
enabled: primitives.boolean,
|
|
367
|
+
/** Model for new conversations; must be allowed by the effective limits. */
|
|
368
|
+
model: z.string().min(1).max(200).nullable().default(null),
|
|
369
|
+
/** Author instructions; member chats receive these without a Site restriction profile. */
|
|
370
|
+
instructions: z.string().max(8000).nullable().default(null),
|
|
371
|
+
/**
|
|
372
|
+
* Retired publication selection, retained for stored/wire compatibility.
|
|
373
|
+
* Members use normal chat tools; visitors never get workspace connections.
|
|
374
|
+
* This field does not narrow or widen the agent's authority.
|
|
375
|
+
*/
|
|
376
|
+
tools: z.array(z.string().min(1).max(300)).max(100).nullable().default(null),
|
|
377
|
+
/**
|
|
378
|
+
* Retired; always false. People outside the workspace (invited people and
|
|
379
|
+
* public visitors) never get workspace tools: only the Site's own data
|
|
380
|
+
* (Site Data, Site SQL and its named queries) and the page. Accepted and
|
|
381
|
+
* ignored on input for compatibility.
|
|
382
|
+
*/
|
|
383
|
+
guestTools: primitives.boolean.default(false),
|
|
384
|
+
}),
|
|
385
|
+
);
|
|
386
|
+
export type SiteEmbeddedAgent = z.infer<typeof SiteEmbeddedAgent>;
|
|
387
|
+
|
|
388
|
+
/** Changes to the embedded agent; omitted fields keep their current value. */
|
|
389
|
+
export const SiteEmbeddedAgentChanges = /* @__PURE__ */ defineSchema(() =>
|
|
390
|
+
z.object({
|
|
391
|
+
enabled: primitives.optionalBoolean,
|
|
392
|
+
model: z.string().min(1).max(200).nullable().optional(),
|
|
393
|
+
instructions: z.string().max(8000).nullable().optional(),
|
|
394
|
+
tools: z.array(z.string().min(1).max(300)).max(100).nullable().optional(),
|
|
395
|
+
/** Retired: accepted and ignored (people outside the workspace never get workspace tools). */
|
|
396
|
+
guestTools: primitives.optionalBoolean,
|
|
397
|
+
}),
|
|
398
|
+
);
|
|
399
|
+
export type SiteEmbeddedAgentChanges = z.infer<typeof SiteEmbeddedAgentChanges>;
|
|
400
|
+
|
|
401
|
+
/** A safe one-click fix for a readiness warning (applied through the ordinary APIs). */
|
|
402
|
+
export const SitePublishWarningFix = /* @__PURE__ */ defineSchema(() =>
|
|
403
|
+
z.discriminatedUnion("kind", [
|
|
404
|
+
z.object({
|
|
405
|
+
kind: z.literal("site_data_guest_access"),
|
|
406
|
+
collection: z.string().min(1).max(64),
|
|
407
|
+
guestAccess: z.enum(["read", "append", "own"]),
|
|
408
|
+
}),
|
|
409
|
+
z.object({
|
|
410
|
+
kind: z.literal("site_sql_query_audience"),
|
|
411
|
+
query: z.string().min(1).max(64),
|
|
412
|
+
audience: z.enum(["everyone", "signed_in"]),
|
|
413
|
+
}),
|
|
414
|
+
]),
|
|
415
|
+
);
|
|
416
|
+
export type SitePublishWarningFix = z.infer<typeof SitePublishWarningFix>;
|
|
417
|
+
|
|
418
|
+
export const SITE_PUBLISH_WARNING_CODES = [
|
|
419
|
+
"workspace_tools_members_only",
|
|
420
|
+
"agent_tools_members_only",
|
|
421
|
+
"site_data_guest_read",
|
|
422
|
+
"site_data_guest_write",
|
|
423
|
+
"site_data_members_write",
|
|
424
|
+
"site_sql_query_signed_in",
|
|
425
|
+
"site_sql_query_managers",
|
|
426
|
+
/** No longer reported (the fallback shows as outsideAgentModel); kept for compatibility. */
|
|
427
|
+
"agent_model_outside_fallback",
|
|
428
|
+
"agent_model_outside_unavailable",
|
|
429
|
+
/** The workspace has no credits for the outside model right now. */
|
|
430
|
+
"agent_model_outside_no_credits",
|
|
431
|
+
/** The workspace's usage allowance is used up, so outsiders' turns are refused. */
|
|
432
|
+
"agent_model_outside_allowance_used",
|
|
433
|
+
/** The page was too large to read, so what it uses was not checked. */
|
|
434
|
+
"page_not_checked",
|
|
435
|
+
/**
|
|
436
|
+
* A public Site on a login-only deployment: every visitor signs in to
|
|
437
|
+
* Opengeni first. A notice about the deployment, with nothing to fix.
|
|
438
|
+
*/
|
|
439
|
+
"public_sign_in_required",
|
|
440
|
+
] as const;
|
|
441
|
+
|
|
442
|
+
/** Warnings that only inform: nothing on the Site can or needs to change. */
|
|
443
|
+
export const SITE_PUBLISH_NOTICE_CODES: ReadonlySet<(typeof SITE_PUBLISH_WARNING_CODES)[number]> =
|
|
444
|
+
/* @__PURE__ */ new Set(["public_sign_in_required"]);
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Something the published version uses that its audience may not do. Found
|
|
448
|
+
* by a conservative static reading of the page source and the Site's
|
|
449
|
+
* declared tools, collections and queries (docs/published-sites.md).
|
|
450
|
+
*/
|
|
451
|
+
export const SitePublishWarning = /* @__PURE__ */ defineSchema(() =>
|
|
452
|
+
z.object({
|
|
453
|
+
code: z.enum(SITE_PUBLISH_WARNING_CODES),
|
|
454
|
+
/** Plain language: what won't work and for whom. */
|
|
455
|
+
message: z.string().max(500),
|
|
456
|
+
/** What to change. */
|
|
457
|
+
suggestion: z.string().max(500),
|
|
458
|
+
/** A safe one-click fix, when one exists. */
|
|
459
|
+
fix: SitePublishWarningFix.nullable().default(null),
|
|
460
|
+
}),
|
|
461
|
+
);
|
|
462
|
+
export type SitePublishWarning = z.infer<typeof SitePublishWarning>;
|
|
463
|
+
|
|
464
|
+
export const SitePublication = /* @__PURE__ */ defineSchema(() =>
|
|
465
|
+
z.object({
|
|
466
|
+
siteId: primitives.uuid,
|
|
467
|
+
workspaceId: primitives.uuid,
|
|
468
|
+
label: primitives.string,
|
|
469
|
+
hostname: primitives.string,
|
|
470
|
+
url: z.string().url(),
|
|
471
|
+
access: SiteAccessMode,
|
|
472
|
+
status: SitePublicationStatus,
|
|
473
|
+
/** True when search engines are asked not to index (always on staging). */
|
|
474
|
+
noindex: primitives.boolean,
|
|
475
|
+
agent: SiteEmbeddedAgent,
|
|
476
|
+
limitProfile: SiteLimitProfile,
|
|
477
|
+
/**
|
|
478
|
+
* Limits for people outside the workspace after workspace and platform
|
|
479
|
+
* defaults are applied. Workspace members are never limited by them.
|
|
480
|
+
*/
|
|
481
|
+
effectiveLimits: SiteLimits,
|
|
482
|
+
invitedEmails: z.array(z.string().email()).max(500),
|
|
483
|
+
moderation: z.object({
|
|
484
|
+
openReports: primitives.nonnegativeInteger,
|
|
485
|
+
suspendedAt: primitives.nullableString,
|
|
486
|
+
suspendedBy: z.enum(["owner", "admin", "platform"]).nullable(),
|
|
487
|
+
suspendedReason: z.string().max(2000).nullable(),
|
|
488
|
+
}),
|
|
489
|
+
usage: z.object({
|
|
490
|
+
/** Spend of people outside the workspace this UTC month (members never count). */
|
|
491
|
+
agentMicrosThisMonth: primitives.nonnegativeInteger,
|
|
492
|
+
/** The same, this UTC day. */
|
|
493
|
+
agentMicrosToday: primitives.nonnegativeInteger.default(0),
|
|
494
|
+
conversationsToday: primitives.nonnegativeInteger,
|
|
495
|
+
}),
|
|
496
|
+
/**
|
|
497
|
+
* What won't work for the audience (invited or public Sites): the
|
|
498
|
+
* readiness check of the current version. Never blocks publishing.
|
|
499
|
+
*/
|
|
500
|
+
warnings: z.array(SitePublishWarning).max(50).default([]),
|
|
501
|
+
/**
|
|
502
|
+
* The model people outside the workspace use when the agent's model is a
|
|
503
|
+
* subscription model (they never use subscriptions); null when they use
|
|
504
|
+
* the agent's model or no credit-billed model exists (then they are refused).
|
|
505
|
+
*/
|
|
506
|
+
outsideAgentModel: primitives.nullableString.default(null),
|
|
507
|
+
createdAt: primitives.string,
|
|
508
|
+
updatedAt: primitives.string,
|
|
509
|
+
}),
|
|
510
|
+
);
|
|
511
|
+
export type SitePublication = z.infer<typeof SitePublication>;
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* GET /v1/workspaces/:ws/published-artifacts/:siteId/publication/link
|
|
515
|
+
*
|
|
516
|
+
* Where a published Site lives, for anyone who can open the Site in the app:
|
|
517
|
+
* its primary public URL and whether it is on the web now. Managing the
|
|
518
|
+
* publication (access, limits, moderation) stays with `SitePublication`.
|
|
519
|
+
*/
|
|
520
|
+
export const SitePublicationLink = /* @__PURE__ */ defineSchema(() =>
|
|
521
|
+
z.object({
|
|
522
|
+
siteId: z.string().uuid(),
|
|
523
|
+
hostname: z.string(),
|
|
524
|
+
url: z.string().url(),
|
|
525
|
+
status: SitePublicationStatus,
|
|
526
|
+
}),
|
|
527
|
+
);
|
|
528
|
+
export type SitePublicationLink = z.infer<typeof SitePublicationLink>;
|
|
529
|
+
|
|
530
|
+
/** PUT /v1/workspaces/:ws/published-artifacts/:siteId/publication */
|
|
531
|
+
export const UpsertSitePublicationRequest = /* @__PURE__ */ defineSchema(() =>
|
|
532
|
+
z.object({
|
|
533
|
+
label: SiteHostnameLabel.optional().describe("Omit to keep the current or a suggested label."),
|
|
534
|
+
access: SiteAccessMode.optional(),
|
|
535
|
+
status: z.enum(["active", "unpublished"]).optional(),
|
|
536
|
+
noindex: primitives.optionalBoolean,
|
|
537
|
+
agent: SiteEmbeddedAgentChanges.optional(),
|
|
538
|
+
limitProfile: SiteLimitProfile.optional(),
|
|
539
|
+
invitedEmails: z.array(z.string().email()).max(500).optional(),
|
|
540
|
+
}),
|
|
541
|
+
);
|
|
542
|
+
export type UpsertSitePublicationRequest = z.infer<typeof UpsertSitePublicationRequest>;
|
|
543
|
+
|
|
544
|
+
export const SiteHostnameAvailabilityProblem = /* @__PURE__ */ defineSchema(() =>
|
|
545
|
+
z.enum(["length", "characters", "hyphen", "punycode", "reserved", "blocked", "taken", "held"]),
|
|
546
|
+
);
|
|
547
|
+
export type SiteHostnameAvailabilityProblem = z.infer<typeof SiteHostnameAvailabilityProblem>;
|
|
548
|
+
|
|
549
|
+
/** GET /v1/workspaces/:ws/site-hostnames/:label */
|
|
550
|
+
export const SiteHostnameAvailability = /* @__PURE__ */ defineSchema(() =>
|
|
551
|
+
z.object({
|
|
552
|
+
label: primitives.string,
|
|
553
|
+
hostname: primitives.nullableString,
|
|
554
|
+
available: primitives.boolean,
|
|
555
|
+
problem: SiteHostnameAvailabilityProblem.nullable(),
|
|
556
|
+
message: primitives.nullableString,
|
|
557
|
+
}),
|
|
558
|
+
);
|
|
559
|
+
export type SiteHostnameAvailability = z.infer<typeof SiteHostnameAvailability>;
|
|
560
|
+
|
|
561
|
+
/** POST .../publication/takedown (owner, workspace admin) and the platform admin route. */
|
|
562
|
+
export const SiteTakedownRequest = /* @__PURE__ */ defineSchema(() =>
|
|
563
|
+
z.object({ reason: primitives.string.trim().min(1).max(2000) }),
|
|
564
|
+
);
|
|
565
|
+
export type SiteTakedownRequest = z.infer<typeof SiteTakedownRequest>;
|
|
566
|
+
|
|
567
|
+
export const SiteAbuseCategory = /* @__PURE__ */ defineSchema(() =>
|
|
568
|
+
z.enum(["phishing", "malware", "spam", "illegal", "harassment", "copyright", "other"]),
|
|
569
|
+
);
|
|
570
|
+
export type SiteAbuseCategory = z.infer<typeof SiteAbuseCategory>;
|
|
571
|
+
|
|
572
|
+
/** POST /_og/report on a Site host, forwarded to /v1/site-runtime/site/reports. */
|
|
573
|
+
export const SiteAbuseReportRequest = /* @__PURE__ */ defineSchema(() =>
|
|
574
|
+
z.object({
|
|
575
|
+
category: SiteAbuseCategory,
|
|
576
|
+
message: primitives.string.trim().max(4000).default(""),
|
|
577
|
+
contactEmail: z.string().email().max(320).nullable().default(null),
|
|
578
|
+
}),
|
|
579
|
+
);
|
|
580
|
+
export type SiteAbuseReportRequest = z.infer<typeof SiteAbuseReportRequest>;
|
|
581
|
+
|
|
582
|
+
export const SiteAbuseReport = /* @__PURE__ */ defineSchema(() =>
|
|
583
|
+
z.object({
|
|
584
|
+
id: primitives.uuid,
|
|
585
|
+
siteId: primitives.uuid,
|
|
586
|
+
hostname: primitives.string,
|
|
587
|
+
category: SiteAbuseCategory,
|
|
588
|
+
message: primitives.string,
|
|
589
|
+
contactEmail: primitives.nullableString,
|
|
590
|
+
status: z.enum(["open", "dismissed", "actioned"]),
|
|
591
|
+
createdAt: primitives.string,
|
|
592
|
+
}),
|
|
593
|
+
);
|
|
594
|
+
export type SiteAbuseReport = z.infer<typeof SiteAbuseReport>;
|
|
595
|
+
|
|
596
|
+
// ---------------------------------------------------------------------------
|
|
597
|
+
// Viewers
|
|
598
|
+
// ---------------------------------------------------------------------------
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* The viewer as a Site sees it (`site.viewer`). Guests have no name or
|
|
602
|
+
* email. `id` is stable per Site and is the Site Data owner principal
|
|
603
|
+
* (`user:<subject>` or `guest:<visitor>`); it is not an Opengeni subject id
|
|
604
|
+
* usable anywhere else.
|
|
605
|
+
*/
|
|
606
|
+
export const SiteViewer = /* @__PURE__ */ defineSchema(() =>
|
|
607
|
+
z.object({
|
|
608
|
+
kind: z.enum(["member", "invited", "user", "guest"]),
|
|
609
|
+
id: z.string().min(1).max(300),
|
|
610
|
+
name: primitives.nullableString,
|
|
611
|
+
email: primitives.nullableString,
|
|
612
|
+
signedIn: primitives.boolean,
|
|
613
|
+
}),
|
|
614
|
+
);
|
|
615
|
+
export type SiteViewer = z.infer<typeof SiteViewer>;
|
|
616
|
+
|
|
617
|
+
/** The roles an owner may preview their published Site as ("View as visitor"). */
|
|
618
|
+
export const SiteViewAs = /* @__PURE__ */ defineSchema(() => z.enum(["invited", "public"]));
|
|
619
|
+
export type SiteViewAs = z.infer<typeof SiteViewAs>;
|
|
620
|
+
|
|
621
|
+
/** The query parameter that starts (`invited`, `public`) or ends (`off`) a preview. */
|
|
622
|
+
export const SITE_VIEW_AS_QUERY = "og_view_as";
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* What this viewer may do, cheaply, so a page can hide features instead of
|
|
626
|
+
* failing. Anything refused at call time still answers with the error
|
|
627
|
+
* `not_available_for_viewer`.
|
|
628
|
+
*/
|
|
629
|
+
export const SiteViewerCapabilities = /* @__PURE__ */ defineSchema(() =>
|
|
630
|
+
z.object({
|
|
631
|
+
/** The viewer may talk to the Site's embedded agent. */
|
|
632
|
+
agent: primitives.boolean,
|
|
633
|
+
/** The page may use its declared workspace tools as this member, independently of the agent. */
|
|
634
|
+
workspaceTools: primitives.boolean,
|
|
635
|
+
/** Site Data rules that apply: the collection's access mode, or its guest access. */
|
|
636
|
+
siteData: z.enum(["viewer", "guest"]),
|
|
637
|
+
/** Named Site SQL query audiences this viewer may call. */
|
|
638
|
+
sqlQueryAudiences: z.array(z.enum(["everyone", "signed_in"])),
|
|
639
|
+
/** Set while the owner previews the Site as another role. */
|
|
640
|
+
viewAs: SiteViewAs.nullable(),
|
|
641
|
+
}),
|
|
642
|
+
);
|
|
643
|
+
export type SiteViewerCapabilities = z.infer<typeof SiteViewerCapabilities>;
|
|
644
|
+
|
|
645
|
+
/** The error code (`error.details.code`) when the viewer may not do something on a Site. */
|
|
646
|
+
export const SITE_NOT_AVAILABLE_FOR_VIEWER_ERROR_CODE = "not_available_for_viewer";
|
|
647
|
+
|
|
648
|
+
/** GET /_og/api/site/config (gateway shell and `site.viewer`). */
|
|
649
|
+
export const SiteRuntimeConfig = /* @__PURE__ */ defineSchema(() =>
|
|
650
|
+
z.object({
|
|
651
|
+
siteId: primitives.uuid,
|
|
652
|
+
title: primitives.string,
|
|
653
|
+
hostname: primitives.string,
|
|
654
|
+
versionId: primitives.uuid,
|
|
655
|
+
access: SiteAccessMode,
|
|
656
|
+
viewer: SiteViewer,
|
|
657
|
+
capabilities: SiteViewerCapabilities,
|
|
658
|
+
agent: z.object({ enabled: primitives.boolean, model: primitives.nullableString }),
|
|
659
|
+
siteData: primitives.boolean,
|
|
660
|
+
noindex: primitives.boolean,
|
|
661
|
+
abuseEmail: z.string().email().nullable(),
|
|
662
|
+
}),
|
|
663
|
+
);
|
|
664
|
+
export type SiteRuntimeConfig = z.infer<typeof SiteRuntimeConfig>;
|
|
665
|
+
|
|
666
|
+
// ---------------------------------------------------------------------------
|
|
667
|
+
// Viewer sign-in (app <-> gateway)
|
|
668
|
+
// ---------------------------------------------------------------------------
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* POST /v1/site-auth/authorize, called by the console page
|
|
672
|
+
* `/site-auth/authorize` with the signed-in user's ordinary credentials.
|
|
673
|
+
* Returns a one-time code bound to the host, PKCE challenge and redirect.
|
|
674
|
+
*/
|
|
675
|
+
export const SiteAuthAuthorizeRequest = /* @__PURE__ */ defineSchema(() =>
|
|
676
|
+
z.object({
|
|
677
|
+
host: z.string().min(1).max(253),
|
|
678
|
+
state: z.string().min(16).max(256),
|
|
679
|
+
codeChallenge: primitives.string.regex(/^[A-Za-z0-9_-]{43}$/u),
|
|
680
|
+
codeChallengeMethod: z.literal("S256"),
|
|
681
|
+
redirectUri: z.string().url(),
|
|
682
|
+
}),
|
|
683
|
+
);
|
|
684
|
+
export type SiteAuthAuthorizeRequest = z.infer<typeof SiteAuthAuthorizeRequest>;
|
|
685
|
+
|
|
686
|
+
export const SiteAuthAuthorizeResponse = /* @__PURE__ */ defineSchema(() =>
|
|
687
|
+
z.object({
|
|
688
|
+
redirectTo: z.string().url().describe("redirectUri with code and state appended."),
|
|
689
|
+
site: z.object({ title: primitives.string, hostname: primitives.string }),
|
|
690
|
+
}),
|
|
691
|
+
);
|
|
692
|
+
export type SiteAuthAuthorizeResponse = z.infer<typeof SiteAuthAuthorizeResponse>;
|
|
693
|
+
|
|
694
|
+
/** POST /v1/site-runtime/auth/exchange (gateway only, signed). */
|
|
695
|
+
export const SiteAuthExchangeRequest = /* @__PURE__ */ defineSchema(() =>
|
|
696
|
+
z.object({
|
|
697
|
+
code: z.string().min(16).max(256),
|
|
698
|
+
codeVerifier: z.string().min(43).max(128),
|
|
699
|
+
redirectUri: z.string().url(),
|
|
700
|
+
}),
|
|
701
|
+
);
|
|
702
|
+
export type SiteAuthExchangeRequest = z.infer<typeof SiteAuthExchangeRequest>;
|
|
703
|
+
|
|
704
|
+
export const SiteAuthExchangeResponse = /* @__PURE__ */ defineSchema(() =>
|
|
705
|
+
z.object({
|
|
706
|
+
/** Opaque; valid only for site-runtime on this one Site host. The API keeps only its hash. */
|
|
707
|
+
sessionToken: z.string().min(32),
|
|
708
|
+
expiresAt: primitives.string,
|
|
709
|
+
viewer: SiteViewer,
|
|
710
|
+
}),
|
|
711
|
+
);
|
|
712
|
+
export type SiteAuthExchangeResponse = z.infer<typeof SiteAuthExchangeResponse>;
|
|
713
|
+
|
|
714
|
+
// ---------------------------------------------------------------------------
|
|
715
|
+
// Gateway <-> API
|
|
716
|
+
// ---------------------------------------------------------------------------
|
|
717
|
+
|
|
718
|
+
export const SITE_SESSION_COOKIE = "__Host-og_session";
|
|
719
|
+
export const SITE_VISITOR_COOKIE = "__Host-og_v";
|
|
720
|
+
export const SITE_LOGIN_COOKIE = "__Host-og_login";
|
|
721
|
+
|
|
722
|
+
/** Paths the gateway owns on every Site host. */
|
|
723
|
+
export const SITE_GATEWAY_PREFIX = "/_og";
|
|
724
|
+
export const SITE_GATEWAY_API_PREFIX = "/_og/api";
|
|
725
|
+
export const SITE_GATEWAY_VERSION_PREFIX = "/_og/v";
|
|
726
|
+
export const SITE_GATEWAY_LOGIN_PATH = "/_og/auth/login";
|
|
727
|
+
export const SITE_GATEWAY_CALLBACK_PATH = "/_og/auth/callback";
|
|
728
|
+
export const SITE_GATEWAY_LOGOUT_PATH = "/_og/auth/logout";
|
|
729
|
+
export const SITE_GATEWAY_REPORT_PATH = "/_og/report";
|
|
730
|
+
|
|
731
|
+
/** The API prefix the gateway forwards `/_og/api/*` to. */
|
|
732
|
+
export const SITE_RUNTIME_API_PREFIX = "/v1/site-runtime";
|
|
733
|
+
|
|
734
|
+
export const SITE_GATEWAY_TIMESTAMP_HEADER = "x-opengeni-gateway-timestamp";
|
|
735
|
+
export const SITE_GATEWAY_SIGNATURE_HEADER = "x-opengeni-gateway-signature";
|
|
736
|
+
export const SITE_GATEWAY_HOST_HEADER = "x-opengeni-site-host";
|
|
737
|
+
export const SITE_GATEWAY_SESSION_HEADER = "x-opengeni-site-session";
|
|
738
|
+
export const SITE_GATEWAY_VISITOR_HEADER = "x-opengeni-site-visitor";
|
|
739
|
+
export const SITE_GATEWAY_CLIENT_IP_HEADER = "x-opengeni-site-client-ip";
|
|
740
|
+
export const SITE_GATEWAY_HUMAN_HEADER = "x-opengeni-site-human";
|
|
741
|
+
/**
|
|
742
|
+
* Required on every signed request: lowercase hex SHA-256 of the exact body
|
|
743
|
+
* bytes (of the empty string when there is no body), the same value the
|
|
744
|
+
* gateway signs as `bodySha256`. The API verifies the signature from the
|
|
745
|
+
* headers before it reads the body, then checks the body against this hash.
|
|
746
|
+
*/
|
|
747
|
+
export const SITE_GATEWAY_BODY_SHA256_HEADER = "x-opengeni-site-body-sha256";
|
|
748
|
+
/** Reject signed requests whose timestamp differs from the API clock by more. */
|
|
749
|
+
export const SITE_GATEWAY_MAX_SKEW_SECONDS = 30;
|
|
750
|
+
export const SITE_GATEWAY_SIGNATURE_VERSION = "v1";
|
|
751
|
+
|
|
752
|
+
export type SiteGatewaySignedFields = {
|
|
753
|
+
method: string;
|
|
754
|
+
/** Path and query exactly as sent to the API, starting with /v1/site-runtime. */
|
|
755
|
+
pathWithQuery: string;
|
|
756
|
+
/** Unix seconds. */
|
|
757
|
+
timestamp: number;
|
|
758
|
+
/** Lowercase hex SHA-256 of the exact request body bytes (of "" when empty). */
|
|
759
|
+
bodySha256: string;
|
|
760
|
+
host: string;
|
|
761
|
+
/** Raw site-session token, or "" when the viewer is not signed in. */
|
|
762
|
+
session: string;
|
|
763
|
+
/** Gateway-minted visitor id, or "". */
|
|
764
|
+
visitor: string;
|
|
765
|
+
clientIp: string;
|
|
766
|
+
/** "1" when the gateway verified a bot challenge for this visitor, else "". */
|
|
767
|
+
human: string;
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* The exact string both sides HMAC-SHA256 with the shared gateway secret.
|
|
772
|
+
* The header carries `v1=<base64url signature>`; during secret rotation the
|
|
773
|
+
* API accepts the current or the previous secret.
|
|
774
|
+
*/
|
|
775
|
+
export function siteGatewayCanonicalString(fields: SiteGatewaySignedFields): string {
|
|
776
|
+
return [
|
|
777
|
+
"OGSG1",
|
|
778
|
+
fields.method.toUpperCase(),
|
|
779
|
+
fields.host.toLowerCase(),
|
|
780
|
+
fields.pathWithQuery,
|
|
781
|
+
String(fields.timestamp),
|
|
782
|
+
fields.bodySha256,
|
|
783
|
+
fields.session,
|
|
784
|
+
fields.visitor,
|
|
785
|
+
fields.clientIp,
|
|
786
|
+
fields.human,
|
|
787
|
+
].join("\n");
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* The rebuildable host-map record the gateway reads from KV (`host:<hostname>`)
|
|
792
|
+
* and, on a miss, from GET /v1/site-runtime/host. Postgres is the source of truth.
|
|
793
|
+
*/
|
|
794
|
+
export const SiteHostMapRecord = /* @__PURE__ */ defineSchema(() =>
|
|
795
|
+
z.object({
|
|
796
|
+
v: z.literal(1),
|
|
797
|
+
hostname: primitives.string,
|
|
798
|
+
siteId: primitives.uuid,
|
|
799
|
+
status: SitePublicationStatus,
|
|
800
|
+
access: SiteAccessMode,
|
|
801
|
+
/** The version served at `/`; immutable HTML at /_og/v/<versionId>. */
|
|
802
|
+
versionId: primitives.nullableUuid,
|
|
803
|
+
title: primitives.string,
|
|
804
|
+
noindex: primitives.boolean,
|
|
805
|
+
/** Monotonic per hostname; a writer never replaces a newer generation. */
|
|
806
|
+
generation: primitives.nonnegativeInteger,
|
|
807
|
+
updatedAt: primitives.string,
|
|
808
|
+
}),
|
|
809
|
+
);
|
|
810
|
+
export type SiteHostMapRecord = z.infer<typeof SiteHostMapRecord>;
|
|
811
|
+
|
|
812
|
+
export function siteHostMapKey(hostname: string): string {
|
|
813
|
+
return `host:${hostname.toLowerCase()}`;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
// ---------------------------------------------------------------------------
|
|
817
|
+
// Platform usage (Site infrastructure, metered apart from model spend)
|
|
818
|
+
// ---------------------------------------------------------------------------
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* usage_only: meter, never charge (the default). shadow: compute what
|
|
822
|
+
* credits mode would charge, without charging. credits: charge organization
|
|
823
|
+
* credits for usage above the workspace's monthly allowance.
|
|
824
|
+
*/
|
|
825
|
+
export const SitePlatformBillingMode = /* @__PURE__ */ defineSchema(() =>
|
|
826
|
+
z.enum(["usage_only", "shadow", "credits"]),
|
|
827
|
+
);
|
|
828
|
+
export type SitePlatformBillingMode = z.infer<typeof SitePlatformBillingMode>;
|
|
829
|
+
|
|
830
|
+
/** Gateway requests, Site SQL rows read and written, and Site SQL plus Site Data storage. */
|
|
831
|
+
export const SitePlatformMeter = /* @__PURE__ */ defineSchema(() =>
|
|
832
|
+
z.enum(["requests", "sql_rows_read", "sql_rows_written", "storage_bytes"]),
|
|
833
|
+
);
|
|
834
|
+
export type SitePlatformMeter = z.infer<typeof SitePlatformMeter>;
|
|
835
|
+
|
|
836
|
+
export const SitePlatformMeterUsage = /* @__PURE__ */ defineSchema(() =>
|
|
837
|
+
z.object({
|
|
838
|
+
meter: SitePlatformMeter,
|
|
839
|
+
/** This UTC month (storage: the current level). */
|
|
840
|
+
used: primitives.nonnegativeInteger,
|
|
841
|
+
/** The highest storage level this month (equals `used` for other meters). */
|
|
842
|
+
peak: primitives.nonnegativeInteger,
|
|
843
|
+
/** Included every month before credits are charged (only shadow and credits modes charge). */
|
|
844
|
+
allowance: primitives.nonnegativeInteger,
|
|
845
|
+
/** Price in micro-USD per `priceUnit` units (storage: per GB-month, GB = 10^9 bytes). */
|
|
846
|
+
priceMicros: primitives.nonnegativeInteger,
|
|
847
|
+
priceUnit: primitives.positiveInteger,
|
|
848
|
+
/** Estimated cost of all usage this month, micro-USD, before the allowance. */
|
|
849
|
+
estimatedMicros: primitives.nonnegativeInteger,
|
|
850
|
+
}),
|
|
851
|
+
);
|
|
852
|
+
export type SitePlatformMeterUsage = z.infer<typeof SitePlatformMeterUsage>;
|
|
853
|
+
|
|
854
|
+
/** The Opengeni-wide brake on Site platform usage (see docs/published-sites.md). */
|
|
855
|
+
export const SitePlatformBrakeState = /* @__PURE__ */ defineSchema(() =>
|
|
856
|
+
z.object({
|
|
857
|
+
engaged: primitives.boolean,
|
|
858
|
+
engagedAt: primitives.nullableString,
|
|
859
|
+
}),
|
|
860
|
+
);
|
|
861
|
+
export type SitePlatformBrakeState = z.infer<typeof SitePlatformBrakeState>;
|
|
862
|
+
|
|
863
|
+
/** GET /v1/workspaces/:ws/site-platform-usage */
|
|
864
|
+
export const SitePlatformUsage = /* @__PURE__ */ defineSchema(() =>
|
|
865
|
+
z.object({
|
|
866
|
+
workspaceId: primitives.uuid,
|
|
867
|
+
/** First day of the UTC month, YYYY-MM-DD. */
|
|
868
|
+
periodStart: primitives.string,
|
|
869
|
+
billingMode: SitePlatformBillingMode,
|
|
870
|
+
meters: z.array(SitePlatformMeterUsage),
|
|
871
|
+
/** Estimated cost of this month's usage, micro-USD, before the allowance. */
|
|
872
|
+
estimatedMicros: primitives.nonnegativeInteger,
|
|
873
|
+
/** Credits charged this month (credits mode). */
|
|
874
|
+
chargedMicros: primitives.nonnegativeInteger,
|
|
875
|
+
/** What credits mode would have charged this month (shadow mode). */
|
|
876
|
+
shadowMicros: primitives.nonnegativeInteger,
|
|
877
|
+
brake: SitePlatformBrakeState,
|
|
878
|
+
}),
|
|
879
|
+
);
|
|
880
|
+
export type SitePlatformUsage = z.infer<typeof SitePlatformUsage>;
|
|
881
|
+
|
|
882
|
+
/** details.code of the 503 every brake refusal carries. */
|
|
883
|
+
export const SITE_PLATFORM_BRAKE_ERROR_CODE = "site_platform_brake_engaged" as const;
|
|
884
|
+
/** details.code of the 402 a workspace past its allowance without credits gets (credits mode). */
|
|
885
|
+
export const SITE_PLATFORM_QUOTA_ERROR_CODE = "site_platform_quota_exhausted" as const;
|
|
886
|
+
|
|
887
|
+
export * from "./site-operations";
|
|
888
|
+
|
|
889
|
+
// ---------------------------------------------------------------------------
|
|
890
|
+
// Bridge additions (protocol v2, additive)
|
|
891
|
+
// ---------------------------------------------------------------------------
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Additional MessagePort bridge request methods, served by both hosts:
|
|
895
|
+
* - `viewer`: returns SiteViewer (console: the signed-in member).
|
|
896
|
+
* - `auth.signIn`: asks the host to sign the viewer in. The gateway shell
|
|
897
|
+
* navigates the top window to /_og/auth/login; the console resolves
|
|
898
|
+
* immediately because its viewer is already signed in. Returns
|
|
899
|
+
* `{ started: boolean }`.
|
|
900
|
+
* The ready message advertises them with `viewer: 1`.
|
|
901
|
+
*/
|
|
902
|
+
export const SITE_BRIDGE_VIEWER_METHOD = "viewer" as const;
|
|
903
|
+
export const SITE_BRIDGE_SIGN_IN_METHOD = "auth.signIn" as const;
|