@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
package/src/site-session-http.ts
CHANGED
|
@@ -1,4 +1,56 @@
|
|
|
1
|
+
import { matchSiteOperation, type SiteOperation } from "./site-operations";
|
|
2
|
+
|
|
1
3
|
const SITE_WORKSPACE_PREFIX = "/v1/workspaces/site-host";
|
|
4
|
+
/** Site Data and Site SQL routes under any published Site: `<prefix>/published-artifacts/<id>/data|files|sql`. */
|
|
5
|
+
const SITE_DATA_PATH =
|
|
6
|
+
/^\/v1\/workspaces\/site-host\/published-artifacts\/([^/]+)\/(?:data|files|sql)(?:\/|$)/u;
|
|
7
|
+
/** The list filter a frame without a published Site gets: it names no Site, so lists nothing. */
|
|
8
|
+
export const SITE_NO_ORIGIN_ID = "00000000-0000-0000-0000-000000000000";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The header a host sets on every request it forwards from a Site frame. The
|
|
12
|
+
* value names the host: `1` for the console bridge, `preview` for a Codemode
|
|
13
|
+
* local preview. The API treats a request carrying it (or the pinned Site id)
|
|
14
|
+
* as Site code: only `SITE_OPERATIONS`, only the frame's own sessions.
|
|
15
|
+
*/
|
|
16
|
+
export const SITE_FRAME_HEADER = "x-opengeni-site-frame";
|
|
17
|
+
/** SITE_FRAME_HEADER value a Codemode local preview sets. */
|
|
18
|
+
export const SITE_PREVIEW_FRAME = "preview";
|
|
19
|
+
/**
|
|
20
|
+
* A random id the host mints per mounted frame. A frame without a published
|
|
21
|
+
* Site (inline HTML, previews) records it on the sessions it starts and may
|
|
22
|
+
* reach only those sessions afterwards.
|
|
23
|
+
*/
|
|
24
|
+
export const SITE_FRAME_ID_HEADER = "x-opengeni-site-frame-id";
|
|
25
|
+
/** The published Site (artifact id) a host pinned the frame to. */
|
|
26
|
+
export const SITE_ID_HEADER = "x-opengeni-site-id";
|
|
27
|
+
/** The exact Site version the pinned frame runs. */
|
|
28
|
+
export const SITE_VERSION_HEADER = "x-opengeni-site-version";
|
|
29
|
+
|
|
30
|
+
/** The Site a console Site view conversation is about, as its messages name it. */
|
|
31
|
+
export type SiteConversationSite = {
|
|
32
|
+
siteId: string;
|
|
33
|
+
title: string;
|
|
34
|
+
versionId: string;
|
|
35
|
+
revision: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Message context for a conversation in the console's Site view, where the
|
|
40
|
+
* person edits the Site beside it: which Site and version "the Site" means,
|
|
41
|
+
* and that a change is published straight away. The API attaches it to the
|
|
42
|
+
* first message of a conversation started there; the console attaches it to
|
|
43
|
+
* each later message, with the version then current. It is ordinary,
|
|
44
|
+
* model-visible context (`modelContext`), never authority.
|
|
45
|
+
*/
|
|
46
|
+
export function siteConversationContext(site: SiteConversationSite): string {
|
|
47
|
+
const title = site.title.replace(/\s+/gu, " ").trim().slice(0, 200) || "Untitled Site";
|
|
48
|
+
return [
|
|
49
|
+
`The person is working on the Opengeni Site “${title}” (Site id ${site.siteId}), shown beside this chat at version ${site.revision} (version id ${site.versionId}).`,
|
|
50
|
+
"When they ask for a change to “the Site”, “this page” or a part of it, they mean this Site: read its current source, then publish the change as a new version of this Site.",
|
|
51
|
+
"A published version goes live immediately and the preview beside this chat reloads; earlier versions can be restored.",
|
|
52
|
+
].join(" ");
|
|
53
|
+
}
|
|
2
54
|
|
|
3
55
|
/** A Site/Codemode SDK request named a route outside the proxied surface. */
|
|
4
56
|
export class SiteSessionPathError extends Error {
|
|
@@ -10,39 +62,181 @@ export class SiteSessionPathError extends Error {
|
|
|
10
62
|
}
|
|
11
63
|
}
|
|
12
64
|
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
65
|
+
/** The host serves no Site Data: it is not bound to a published Site (inline HTML, previews). */
|
|
66
|
+
export class SiteDataUnsupportedError extends Error {
|
|
67
|
+
readonly code = "site_data_unsupported";
|
|
68
|
+
|
|
69
|
+
constructor() {
|
|
70
|
+
super("This Site host does not provide Site Data");
|
|
71
|
+
this.name = "SiteDataUnsupportedError";
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function unsafePathname(pathname: string): boolean {
|
|
76
|
+
return (
|
|
77
|
+
/[%\\#\u0000-\u0020\u007f]/u.test(pathname) ||
|
|
78
|
+
pathname.split("/").some((part) => part === "." || part === "..")
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function hostWorkspacePath(path: string, workspaceId: string): string {
|
|
83
|
+
const url = new URL(path, "http://site.invalid");
|
|
84
|
+
if (url.pathname === "/v1/config/client") {
|
|
85
|
+
const requested = url.searchParams.getAll("workspaceId");
|
|
86
|
+
if (
|
|
87
|
+
requested.length > 1 ||
|
|
88
|
+
(requested.length === 1 && requested[0] !== "site-host" && requested[0] !== workspaceId)
|
|
89
|
+
)
|
|
90
|
+
throw new SiteSessionPathError();
|
|
91
|
+
// The SDK's scoped config read uses a query, not a workspace path segment.
|
|
92
|
+
// Both the console bridge and Codemode proxy bind it to their own workspace.
|
|
93
|
+
if (workspaceId !== "site-host") url.searchParams.set("workspaceId", workspaceId);
|
|
94
|
+
return url.pathname + url.search;
|
|
95
|
+
}
|
|
96
|
+
return path.replace("/workspaces/site-host", `/workspaces/${encodeURIComponent(workspaceId)}`);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Site Data: a Site reaches only its own data, as `current`, through a host bound to a published Site. */
|
|
100
|
+
function siteDataPath(path: string, rewritten: string, workspaceId: string, siteId?: string) {
|
|
101
|
+
// Inside the Site the alias stays unresolved; the host resolves it.
|
|
102
|
+
if (workspaceId === "site-host") return path;
|
|
103
|
+
// Only a host bound to a published Site serves its data.
|
|
104
|
+
if (!siteId) throw new SiteDataUnsupportedError();
|
|
105
|
+
return rewritten.replace(
|
|
106
|
+
"/published-artifacts/current/",
|
|
107
|
+
`/published-artifacts/${encodeURIComponent(siteId)}/`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Route a request from Site code (the in-Site SDK, the console bridge, a
|
|
113
|
+
* Codemode preview) to the host workspace. This is the `SITE_OPERATIONS`
|
|
114
|
+
* allowlist: anything else is refused with SiteSessionPathError before any
|
|
115
|
+
* request is made. Ordinary API handlers still authorize every allowed
|
|
116
|
+
* operation with the viewer's own authority, and the API independently
|
|
117
|
+
* refuses frame requests outside the allowlist or to another Site's sessions.
|
|
118
|
+
*
|
|
119
|
+
* `workspaceId` `site-host` checks a path inside the Site without rewriting
|
|
120
|
+
* it. A session list must name `originSiteId=current` or `siteAccessId=current`; the host binds it to
|
|
121
|
+
* its pinned Site, or to no Site at all when the frame has none.
|
|
122
|
+
*/
|
|
16
123
|
export function siteSessionPath(
|
|
17
124
|
path: string,
|
|
18
125
|
workspaceId: string,
|
|
19
|
-
|
|
126
|
+
method = "GET",
|
|
20
127
|
siteId?: string,
|
|
21
128
|
): string {
|
|
129
|
+
const pathname = path.split("?")[0]!;
|
|
130
|
+
const match = matchSiteOperation(method, pathname);
|
|
131
|
+
if (!match) throw new SiteSessionPathError();
|
|
132
|
+
const rewritten = hostWorkspacePath(path, workspaceId);
|
|
133
|
+
if (SITE_DATA_PATH.test(pathname)) return siteDataPath(path, rewritten, workspaceId, siteId);
|
|
134
|
+
if (match.operation.id !== "sessions.list") return rewritten;
|
|
135
|
+
// A Site lists only conversations available to it. Never widen to the workspace.
|
|
136
|
+
const url = new URL(rewritten, "http://site.invalid");
|
|
137
|
+
const origins = url.searchParams.getAll("originSiteId");
|
|
138
|
+
const access = url.searchParams.getAll("siteAccessId");
|
|
139
|
+
const views = url.searchParams.getAll("view");
|
|
140
|
+
if (
|
|
141
|
+
views.length > 1 ||
|
|
142
|
+
(views.length === 1 && views[0] !== "page") ||
|
|
143
|
+
origins.length + access.length !== 1 ||
|
|
144
|
+
(origins[0] ?? access[0]) !== "current"
|
|
145
|
+
)
|
|
146
|
+
throw new SiteSessionPathError();
|
|
147
|
+
if (workspaceId === "site-host") return path;
|
|
148
|
+
url.searchParams.set(
|
|
149
|
+
access.length ? "siteAccessId" : "originSiteId",
|
|
150
|
+
siteId ?? SITE_NO_ORIGIN_ID,
|
|
151
|
+
);
|
|
152
|
+
return url.pathname + url.search;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Route an agent's own SDK request through the Codemode SDK proxy to its
|
|
157
|
+
* workspace. Unlike `siteSessionPath` this is a URL prefix boundary, not an
|
|
158
|
+
* operation allowlist: the proxy signs a short-lived credential bounded by
|
|
159
|
+
* the agent's own permission ceiling and ordinary handlers authorize every
|
|
160
|
+
* operation. Site Data is not served here (an agent uses its tools).
|
|
161
|
+
* Requests a Codemode preview forwards from Site code carry the frame marker
|
|
162
|
+
* and use `siteSessionPath` instead.
|
|
163
|
+
*/
|
|
164
|
+
export function siteHostWorkspacePath(path: string, workspaceId: string): string {
|
|
22
165
|
const pathname = path.split("?")[0]!;
|
|
23
166
|
const workspace =
|
|
24
167
|
pathname === SITE_WORKSPACE_PREFIX || pathname.startsWith(`${SITE_WORKSPACE_PREFIX}/`);
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
(!workspace && !context) ||
|
|
28
|
-
/[%\\#\u0000-\u0020\u007f]/u.test(pathname) ||
|
|
29
|
-
pathname.split("/").some((p) => p === "." || p === "..")
|
|
30
|
-
) {
|
|
168
|
+
if ((!workspace && pathname !== "/v1/config/client") || unsafePathname(pathname))
|
|
31
169
|
throw new SiteSessionPathError();
|
|
170
|
+
const rewritten = hostWorkspacePath(path, workspaceId);
|
|
171
|
+
const data = SITE_DATA_PATH.exec(pathname);
|
|
172
|
+
if (data) {
|
|
173
|
+
if (data[1] !== "current") throw new SiteSessionPathError();
|
|
174
|
+
return siteDataPath(path, rewritten, workspaceId);
|
|
32
175
|
}
|
|
33
|
-
const rewritten = path.replace(
|
|
34
|
-
"/workspaces/site-host",
|
|
35
|
-
`/workspaces/${encodeURIComponent(workspaceId)}`,
|
|
36
|
-
);
|
|
37
|
-
// Preview has no published Site identity. Never widen a Site-only list to the workspace.
|
|
38
176
|
const url = new URL(rewritten, "http://site.invalid");
|
|
39
177
|
if (url.searchParams.get("originSiteId") === "current" && workspaceId !== "site-host") {
|
|
40
|
-
url.searchParams.set("originSiteId",
|
|
178
|
+
url.searchParams.set("originSiteId", SITE_NO_ORIGIN_ID);
|
|
41
179
|
return url.pathname + url.search;
|
|
42
180
|
}
|
|
43
181
|
return rewritten;
|
|
44
182
|
}
|
|
45
183
|
|
|
184
|
+
/** The Site identity a host attached to a request, from its host-set headers. */
|
|
185
|
+
export type SiteFrameHeaders = {
|
|
186
|
+
/** The pinned published Site id, or null for a frame without one. */
|
|
187
|
+
siteId: string | null;
|
|
188
|
+
versionId: string | null;
|
|
189
|
+
/** The host's frame marker value (`1`, `preview`), or null when only the Site id was set. */
|
|
190
|
+
marker: string | null;
|
|
191
|
+
frameId: string | null;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/** Read the host-set frame headers. Null when the request did not come from a Site frame. */
|
|
195
|
+
export function siteFrameFromHeaders(
|
|
196
|
+
header: (name: string) => string | null | undefined,
|
|
197
|
+
): SiteFrameHeaders | null {
|
|
198
|
+
const value = (name: string) => header(name) ?? null;
|
|
199
|
+
const marker = value(SITE_FRAME_HEADER);
|
|
200
|
+
const siteId = value(SITE_ID_HEADER);
|
|
201
|
+
const versionId = value(SITE_VERSION_HEADER);
|
|
202
|
+
const frameId = value(SITE_FRAME_ID_HEADER);
|
|
203
|
+
if (marker === null && siteId === null && versionId === null && frameId === null) return null;
|
|
204
|
+
return { siteId: siteId || null, versionId: versionId || null, marker, frameId: frameId || null };
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Match a request that reached a workspace route from a Site frame against
|
|
209
|
+
* `SITE_OPERATIONS`. `pathname` is the raw request path
|
|
210
|
+
* (`/v1/workspaces/<id>/...` or `/v1/config/client`). The frame's own pinned
|
|
211
|
+
* Site id maps back to `current`; any other Site id does not match.
|
|
212
|
+
*/
|
|
213
|
+
export function siteFrameOperation(
|
|
214
|
+
method: string,
|
|
215
|
+
pathname: string,
|
|
216
|
+
workspaceId: string,
|
|
217
|
+
frameSiteId: string | null,
|
|
218
|
+
): { operation: SiteOperation; suffix: string; sessionId: string | null } | null {
|
|
219
|
+
if (unsafePathname(pathname)) return null;
|
|
220
|
+
let sitePath = pathname;
|
|
221
|
+
if (pathname !== "/v1/config/client") {
|
|
222
|
+
const prefix = `/v1/workspaces/${workspaceId}`;
|
|
223
|
+
if (pathname !== prefix && !pathname.startsWith(`${prefix}/`)) return null;
|
|
224
|
+
sitePath = `${SITE_WORKSPACE_PREFIX}${pathname.slice(prefix.length)}`;
|
|
225
|
+
const data = /^\/v1\/workspaces\/site-host\/published-artifacts\/([^/]+)\//u.exec(sitePath);
|
|
226
|
+
if (data) {
|
|
227
|
+
if (!frameSiteId || data[1] !== frameSiteId) return null;
|
|
228
|
+
sitePath = sitePath.replace(
|
|
229
|
+
`/published-artifacts/${frameSiteId}/`,
|
|
230
|
+
"/published-artifacts/current/",
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const match = matchSiteOperation(method, sitePath);
|
|
235
|
+
if (!match) return null;
|
|
236
|
+
const session = /^\/sessions\/([^/]+)(?:\/|$)/u.exec(match.suffix);
|
|
237
|
+
return { ...match, sessionId: session ? session[1]! : null };
|
|
238
|
+
}
|
|
239
|
+
|
|
46
240
|
/** Preserve SDK request semantics while the host supplies identity and transport headers. */
|
|
47
241
|
export function siteRequestHeaders(input: HeadersInit): Headers {
|
|
48
242
|
const headers = new Headers(input);
|
|
@@ -61,3 +255,137 @@ export function siteRequestHeaders(input: HeadersInit): Headers {
|
|
|
61
255
|
}
|
|
62
256
|
return headers;
|
|
63
257
|
}
|
|
258
|
+
|
|
259
|
+
// ---------------------------------------------------------------------------
|
|
260
|
+
// What a Site frame may put in a request body
|
|
261
|
+
// ---------------------------------------------------------------------------
|
|
262
|
+
|
|
263
|
+
/** Message fields a Site page may set: the text and how the model answers it. */
|
|
264
|
+
const SITE_FRAME_MESSAGE_FIELDS = [
|
|
265
|
+
"text",
|
|
266
|
+
"annotations",
|
|
267
|
+
"model",
|
|
268
|
+
"reasoningEffort",
|
|
269
|
+
"latencyMode",
|
|
270
|
+
"controlEtag",
|
|
271
|
+
"expectedDraftRevision",
|
|
272
|
+
// The viewer's own IANA time zone, so the agent sees the message's local time.
|
|
273
|
+
"timeZone",
|
|
274
|
+
] as const;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Body fields a Site frame may send per operation. Anything else with a
|
|
278
|
+
* value (resources, personal resource attachments, MCP credential updates,
|
|
279
|
+
* connection accounts, model context, approval decisions, human-input
|
|
280
|
+
* answers) is the person's to give in the console, never a Site page's.
|
|
281
|
+
*/
|
|
282
|
+
const SITE_FRAME_BODY_FIELDS: Readonly<Record<string, readonly string[]>> = Object.freeze({
|
|
283
|
+
"sessions.send": ["type", "payload", "clientEventId"],
|
|
284
|
+
"sessions.steer": [...SITE_FRAME_MESSAGE_FIELDS, "clientEventId"],
|
|
285
|
+
"sessions.control": ["action", "reason", "clientEventId", "expectedControlEtag"],
|
|
286
|
+
"sessions.composerDraft.put": [
|
|
287
|
+
"text",
|
|
288
|
+
"annotations",
|
|
289
|
+
"resources",
|
|
290
|
+
"model",
|
|
291
|
+
"reasoningEffort",
|
|
292
|
+
"latencyMode",
|
|
293
|
+
"expectedRevision",
|
|
294
|
+
],
|
|
295
|
+
"sessions.composerDraft.submit": [
|
|
296
|
+
...SITE_FRAME_MESSAGE_FIELDS,
|
|
297
|
+
"resources",
|
|
298
|
+
"connectionAccounts",
|
|
299
|
+
"clientEventId",
|
|
300
|
+
"delivery",
|
|
301
|
+
],
|
|
302
|
+
"sessions.queue.move": ["clientEventId", "expectedQueueVersion", "beforeTurnId"],
|
|
303
|
+
"sessions.queue.edit": [
|
|
304
|
+
"clientEventId",
|
|
305
|
+
"expectedTurnVersion",
|
|
306
|
+
"expectedDraftRevision",
|
|
307
|
+
"replaceDraft",
|
|
308
|
+
],
|
|
309
|
+
"sessions.queue.steer": ["clientEventId", "expectedTurnVersion", "controlEtag"],
|
|
310
|
+
"sessions.queue.delete": ["clientEventId", "expectedTurnVersion", "reason"],
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
/** Fields allowed above only while empty: a draft carries no resources or accounts. */
|
|
314
|
+
const SITE_FRAME_EMPTY_ONLY_FIELDS = new Set(["resources", "connectionAccounts"]);
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Session create fields a Site frame may send. Agent/tool choices use the
|
|
318
|
+
* ordinary viewer's defaults, never a platform-imposed Site profile.
|
|
319
|
+
* Ownership, settings, approvals and credentials remain host-owned.
|
|
320
|
+
*/
|
|
321
|
+
export const SITE_FRAME_SESSION_CREATE_FIELDS: readonly string[] = Object.freeze([
|
|
322
|
+
"initialMessage",
|
|
323
|
+
"requestedSessionId",
|
|
324
|
+
"idempotencyKey",
|
|
325
|
+
"clientEventId",
|
|
326
|
+
"model",
|
|
327
|
+
"reasoningEffort",
|
|
328
|
+
"latencyMode",
|
|
329
|
+
"startMode",
|
|
330
|
+
"metadata",
|
|
331
|
+
"timeZone",
|
|
332
|
+
]);
|
|
333
|
+
|
|
334
|
+
function bodyRecord(value: unknown): Record<string, unknown> | null {
|
|
335
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
336
|
+
? (value as Record<string, unknown>)
|
|
337
|
+
: null;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/** Absent, null, an empty list or an empty object asks for nothing. */
|
|
341
|
+
function emptyBodyValue(value: unknown): boolean {
|
|
342
|
+
if (value === undefined || value === null) return true;
|
|
343
|
+
if (Array.isArray(value)) return value.length === 0;
|
|
344
|
+
if (typeof value === "object") return Object.keys(value).length === 0;
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
function refusedField(
|
|
349
|
+
body: Record<string, unknown>,
|
|
350
|
+
allowed: readonly string[],
|
|
351
|
+
prefix = "",
|
|
352
|
+
): string | null {
|
|
353
|
+
for (const [name, value] of Object.entries(body)) {
|
|
354
|
+
if (emptyBodyValue(value)) continue;
|
|
355
|
+
if (!allowed.includes(name) || SITE_FRAME_EMPTY_ONLY_FIELDS.has(name))
|
|
356
|
+
return `${prefix}${name}`;
|
|
357
|
+
}
|
|
358
|
+
return null;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* The first body field a Site frame may not send for this operation (for
|
|
363
|
+
* example `payload.resources` or `type`), or null when the body is allowed.
|
|
364
|
+
* `suffix` is the operation's site-host suffix (from `siteFrameOperation` or
|
|
365
|
+
* `matchSiteOperation`). A body that is not a JSON object is left to the
|
|
366
|
+
* route, which refuses it. Only `user.message` events are allowed:
|
|
367
|
+
* approvals and answers to questions happen in the console.
|
|
368
|
+
*/
|
|
369
|
+
export function siteFrameBodyRefusal(
|
|
370
|
+
operationId: string,
|
|
371
|
+
suffix: string,
|
|
372
|
+
body: unknown,
|
|
373
|
+
): string | null {
|
|
374
|
+
const record = bodyRecord(body);
|
|
375
|
+
if (!record) return null;
|
|
376
|
+
if (operationId === "sessions.create")
|
|
377
|
+
return refusedField(record, SITE_FRAME_SESSION_CREATE_FIELDS);
|
|
378
|
+
const action =
|
|
379
|
+
operationId === "sessions.queue.item"
|
|
380
|
+
? /\/queue\/[^/]+\/(move|edit|steer|delete)$/u.exec(suffix)?.[1]
|
|
381
|
+
: undefined;
|
|
382
|
+
const key = action ? `sessions.queue.${action}` : operationId;
|
|
383
|
+
const allowed = SITE_FRAME_BODY_FIELDS[key];
|
|
384
|
+
if (!allowed) return null;
|
|
385
|
+
const refused = refusedField(record, allowed);
|
|
386
|
+
if (refused) return refused;
|
|
387
|
+
if (operationId !== "sessions.send") return null;
|
|
388
|
+
if (record.type !== "user.message") return "type";
|
|
389
|
+
const payload = bodyRecord(record.payload);
|
|
390
|
+
return payload ? refusedField(payload, SITE_FRAME_MESSAGE_FIELDS, "payload.") : null;
|
|
391
|
+
}
|