@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/dist/personal-github.js
CHANGED
|
@@ -1,32 +1,66 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConnectionMetadata
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L4GUEP7K.js";
|
|
4
|
+
import "./chunk-XB6GQLBH.js";
|
|
5
|
+
import "./chunk-WMGO4HJU.js";
|
|
4
6
|
import "./chunk-4JGHSSB7.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-A3LXWVYU.js";
|
|
8
|
+
import "./chunk-2QKIEAGY.js";
|
|
9
|
+
import "./chunk-RLJUNVAM.js";
|
|
10
|
+
import "./chunk-RWEEUDHD.js";
|
|
11
|
+
import "./chunk-MYHMB6GZ.js";
|
|
12
|
+
import "./chunk-6LAT33BH.js";
|
|
13
|
+
import "./chunk-2ZIHHL72.js";
|
|
14
|
+
import "./chunk-32U6NKQQ.js";
|
|
15
|
+
import "./chunk-JOTHDW4H.js";
|
|
16
|
+
import "./chunk-SHO4YO4B.js";
|
|
17
|
+
import "./chunk-W2QQ5Y6K.js";
|
|
18
|
+
import "./chunk-T3HSWMA5.js";
|
|
12
19
|
import "./chunk-KHHZTBP7.js";
|
|
13
|
-
import "./chunk-O77VSFYZ.js";
|
|
14
20
|
import "./chunk-NVJMJWLL.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-TOOJIBJC.js";
|
|
22
|
+
import "./chunk-LJH2EYGT.js";
|
|
23
|
+
import "./chunk-ZMPU5BWE.js";
|
|
24
|
+
import "./chunk-H6UJJIUM.js";
|
|
25
|
+
import "./chunk-5RWB6QVL.js";
|
|
26
|
+
import "./chunk-4YDDHSO2.js";
|
|
27
|
+
import "./chunk-UH4K7GP7.js";
|
|
28
|
+
import "./chunk-2WOWEWXV.js";
|
|
29
|
+
import "./chunk-UCUOTRS6.js";
|
|
30
|
+
import "./chunk-PTSROVDG.js";
|
|
31
|
+
import "./chunk-UIZWGPHV.js";
|
|
32
|
+
import "./chunk-VLUKBV6Y.js";
|
|
33
|
+
import "./chunk-BMUTAZX5.js";
|
|
34
|
+
import "./chunk-G4RKARXZ.js";
|
|
35
|
+
import "./chunk-BHCEVVUP.js";
|
|
36
|
+
import "./chunk-DGG6IBBK.js";
|
|
37
|
+
import "./chunk-7EQGGZBY.js";
|
|
38
|
+
import "./chunk-72QC2GTL.js";
|
|
39
|
+
import "./chunk-W3NBPR4E.js";
|
|
40
|
+
import "./chunk-FBCTUMHI.js";
|
|
41
|
+
import "./chunk-S7MSQQL6.js";
|
|
42
|
+
import "./chunk-G2KJTFIC.js";
|
|
43
|
+
import "./chunk-ZYVEJFNU.js";
|
|
44
|
+
import "./chunk-RUQ4I6DO.js";
|
|
45
|
+
import "./chunk-WVCFSOUZ.js";
|
|
46
|
+
import "./chunk-MTJKSIGA.js";
|
|
47
|
+
import {
|
|
48
|
+
boolean,
|
|
49
|
+
nonnegativeInteger,
|
|
50
|
+
optionalUuid,
|
|
51
|
+
positiveInteger,
|
|
52
|
+
string,
|
|
53
|
+
uuid
|
|
54
|
+
} from "./chunk-AQYDZUJV.js";
|
|
55
|
+
import "./chunk-XP5M3IKT.js";
|
|
56
|
+
import "./chunk-WQI7VNN4.js";
|
|
57
|
+
import "./chunk-PUIUXIOL.js";
|
|
26
58
|
import "./chunk-RKX3NQYS.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import
|
|
59
|
+
import "./chunk-7272KVWZ.js";
|
|
60
|
+
import "./chunk-PI5VIKJY.js";
|
|
61
|
+
import {
|
|
62
|
+
defineSchema
|
|
63
|
+
} from "./chunk-56SNIMDO.js";
|
|
30
64
|
|
|
31
65
|
// src/personal-github.ts
|
|
32
66
|
import { z } from "zod";
|
|
@@ -40,142 +74,180 @@ var PERSONAL_GITHUB_TOKEN_URL = "https://github.com/login/oauth/access_token";
|
|
|
40
74
|
var PERSONAL_GITHUB_USER_URL = "https://api.github.com/user";
|
|
41
75
|
var PERSONAL_GITHUB_API_ORIGIN = "https://api.github.com";
|
|
42
76
|
var PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX = 100;
|
|
43
|
-
var PersonalGitHubRepositoryId =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
77
|
+
var PersonalGitHubRepositoryId = /* @__PURE__ */ defineSchema(
|
|
78
|
+
() => string.regex(/^[1-9]\d*$/u)
|
|
79
|
+
);
|
|
80
|
+
var PersonalGitHubRepositoryAccess = /* @__PURE__ */ defineSchema(
|
|
81
|
+
() => z.enum(["read", "write"])
|
|
82
|
+
);
|
|
83
|
+
var PersonalGitHubRepositoryPermissions = /* @__PURE__ */ defineSchema(
|
|
84
|
+
() => z.object({
|
|
85
|
+
pull: boolean,
|
|
86
|
+
push: boolean,
|
|
87
|
+
admin: boolean,
|
|
88
|
+
maintain: boolean,
|
|
89
|
+
triage: boolean
|
|
90
|
+
}).strict()
|
|
91
|
+
);
|
|
92
|
+
var PersonalGitHubRepositoryVisibility = /* @__PURE__ */ defineSchema(
|
|
93
|
+
() => z.enum(["public", "private", "internal"])
|
|
94
|
+
);
|
|
95
|
+
var PersonalGitHubRepositoryFullName = /* @__PURE__ */ defineSchema(
|
|
96
|
+
() => z.string().min(3).max(140).regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\/[A-Za-z0-9_.-]{1,100}$/u)
|
|
97
|
+
);
|
|
54
98
|
function canonicalPersonalGitHubRepositoryUrl(fullName) {
|
|
55
99
|
return `https://github.com/${fullName}`;
|
|
56
100
|
}
|
|
57
|
-
var PersonalGitHubRepository =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
code: "custom",
|
|
71
|
-
path: ["canonicalUrl"],
|
|
72
|
-
message: "canonicalUrl must be derived from fullName"
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
if (repository.private !== (repository.visibility === "private")) {
|
|
76
|
-
context.addIssue({
|
|
77
|
-
code: "custom",
|
|
78
|
-
path: ["private"],
|
|
79
|
-
message: "private must agree with visibility"
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
var PersonalGitHubSelectedRepository = PersonalGitHubRepository.safeExtend({
|
|
84
|
-
selectedAccess: PersonalGitHubRepositoryAccess,
|
|
85
|
-
selectionGeneration: z.number().int().positive(),
|
|
86
|
-
selectedAt: z.string().datetime({ offset: true }),
|
|
87
|
-
lastVerifiedAt: z.string().datetime({ offset: true })
|
|
88
|
-
}).strict();
|
|
89
|
-
var PersonalGitHubRepositorySelectionState = z.object({
|
|
90
|
-
connectionAuthorityGeneration: z.number().int().positive(),
|
|
91
|
-
credentialBindingId: z.string().uuid(),
|
|
92
|
-
providerPrincipalId: PersonalGitHubRepositoryId,
|
|
93
|
-
selectionGeneration: z.number().int().nonnegative(),
|
|
94
|
-
repositories: z.array(PersonalGitHubSelectedRepository).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX)
|
|
95
|
-
}).strict();
|
|
96
|
-
var ListPersonalGitHubRepositoriesQuery = z.object({
|
|
97
|
-
cursor: z.coerce.number().int().positive().max(1e4).default(1),
|
|
98
|
-
limit: z.coerce.number().int().min(1).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX).default(50)
|
|
99
|
-
}).strict();
|
|
100
|
-
var PersonalGitHubRepositoryCatalogItem = PersonalGitHubRepository.safeExtend({
|
|
101
|
-
selectedAccess: PersonalGitHubRepositoryAccess.nullable()
|
|
102
|
-
}).strict();
|
|
103
|
-
var ListPersonalGitHubRepositoriesResponse = z.object({
|
|
104
|
-
repositories: z.array(PersonalGitHubRepositoryCatalogItem).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),
|
|
105
|
-
nextCursor: z.number().int().positive().nullable(),
|
|
106
|
-
selection: PersonalGitHubRepositorySelectionState
|
|
107
|
-
}).strict();
|
|
108
|
-
var PersonalGitHubRepositorySelectionInput = z.object({
|
|
109
|
-
repositoryId: PersonalGitHubRepositoryId,
|
|
110
|
-
fullName: PersonalGitHubRepositoryFullName,
|
|
111
|
-
access: PersonalGitHubRepositoryAccess
|
|
112
|
-
}).strict();
|
|
113
|
-
var ReplacePersonalGitHubRepositorySelectionsRequest = z.object({
|
|
114
|
-
expectedConnectionAuthorityGeneration: z.number().int().positive(),
|
|
115
|
-
expectedSelectionGeneration: z.number().int().nonnegative(),
|
|
116
|
-
idempotencyKey: z.string().trim().min(1).max(200),
|
|
117
|
-
repositories: z.array(PersonalGitHubRepositorySelectionInput).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX)
|
|
118
|
-
}).strict().superRefine((request, context) => {
|
|
119
|
-
const repositoryIds = /* @__PURE__ */ new Set();
|
|
120
|
-
const fullNames = /* @__PURE__ */ new Set();
|
|
121
|
-
request.repositories.forEach((repository, index) => {
|
|
122
|
-
const normalizedFullName = repository.fullName.toLowerCase();
|
|
123
|
-
if (repositoryIds.has(repository.repositoryId)) {
|
|
101
|
+
var PersonalGitHubRepository = /* @__PURE__ */ defineSchema(
|
|
102
|
+
() => z.object({
|
|
103
|
+
repositoryId: PersonalGitHubRepositoryId,
|
|
104
|
+
fullName: PersonalGitHubRepositoryFullName,
|
|
105
|
+
canonicalUrl: z.string().url().max(512),
|
|
106
|
+
defaultBranch: z.string().min(1).max(255),
|
|
107
|
+
visibility: PersonalGitHubRepositoryVisibility,
|
|
108
|
+
private: boolean,
|
|
109
|
+
archived: boolean,
|
|
110
|
+
disabled: boolean,
|
|
111
|
+
permissions: PersonalGitHubRepositoryPermissions
|
|
112
|
+
}).strict().superRefine((repository, context) => {
|
|
113
|
+
if (repository.canonicalUrl !== canonicalPersonalGitHubRepositoryUrl(repository.fullName)) {
|
|
124
114
|
context.addIssue({
|
|
125
115
|
code: "custom",
|
|
126
|
-
path: ["
|
|
127
|
-
message: "
|
|
116
|
+
path: ["canonicalUrl"],
|
|
117
|
+
message: "canonicalUrl must be derived from fullName"
|
|
128
118
|
});
|
|
129
119
|
}
|
|
130
|
-
if (
|
|
120
|
+
if (repository.private !== (repository.visibility === "private")) {
|
|
131
121
|
context.addIssue({
|
|
132
122
|
code: "custom",
|
|
133
|
-
path: ["
|
|
134
|
-
message: "
|
|
123
|
+
path: ["private"],
|
|
124
|
+
message: "private must agree with visibility"
|
|
135
125
|
});
|
|
136
126
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}).strict()
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}).strict()
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
127
|
+
})
|
|
128
|
+
);
|
|
129
|
+
var PersonalGitHubSelectedRepository = /* @__PURE__ */ defineSchema(
|
|
130
|
+
() => PersonalGitHubRepository.safeExtend({
|
|
131
|
+
selectedAccess: PersonalGitHubRepositoryAccess,
|
|
132
|
+
selectionGeneration: positiveInteger,
|
|
133
|
+
selectedAt: string.datetime({ offset: true }),
|
|
134
|
+
lastVerifiedAt: string.datetime({ offset: true })
|
|
135
|
+
}).strict()
|
|
136
|
+
);
|
|
137
|
+
var PersonalGitHubRepositorySelectionState = /* @__PURE__ */ defineSchema(
|
|
138
|
+
() => z.object({
|
|
139
|
+
connectionAuthorityGeneration: positiveInteger,
|
|
140
|
+
credentialBindingId: uuid,
|
|
141
|
+
providerPrincipalId: PersonalGitHubRepositoryId,
|
|
142
|
+
selectionGeneration: nonnegativeInteger,
|
|
143
|
+
repositories: z.array(PersonalGitHubSelectedRepository).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX)
|
|
144
|
+
}).strict()
|
|
145
|
+
);
|
|
146
|
+
var ListPersonalGitHubRepositoriesQuery = /* @__PURE__ */ defineSchema(
|
|
147
|
+
() => z.object({
|
|
148
|
+
cursor: z.coerce.number().int().positive().max(1e4).default(1),
|
|
149
|
+
limit: z.coerce.number().int().min(1).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX).default(50)
|
|
150
|
+
}).strict()
|
|
151
|
+
);
|
|
152
|
+
var PersonalGitHubRepositoryCatalogItem = /* @__PURE__ */ defineSchema(
|
|
153
|
+
() => PersonalGitHubRepository.safeExtend({
|
|
154
|
+
selectedAccess: PersonalGitHubRepositoryAccess.nullable()
|
|
155
|
+
}).strict()
|
|
156
|
+
);
|
|
157
|
+
var ListPersonalGitHubRepositoriesResponse = /* @__PURE__ */ defineSchema(
|
|
158
|
+
() => z.object({
|
|
159
|
+
repositories: z.array(PersonalGitHubRepositoryCatalogItem).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),
|
|
160
|
+
nextCursor: z.number().int().positive().nullable(),
|
|
161
|
+
selection: PersonalGitHubRepositorySelectionState
|
|
162
|
+
}).strict()
|
|
163
|
+
);
|
|
164
|
+
var PersonalGitHubRepositorySelectionInput = /* @__PURE__ */ defineSchema(
|
|
165
|
+
() => z.object({
|
|
166
|
+
repositoryId: PersonalGitHubRepositoryId,
|
|
167
|
+
fullName: PersonalGitHubRepositoryFullName,
|
|
168
|
+
access: PersonalGitHubRepositoryAccess
|
|
169
|
+
}).strict()
|
|
170
|
+
);
|
|
171
|
+
var ReplacePersonalGitHubRepositorySelectionsRequest = /* @__PURE__ */ defineSchema(
|
|
172
|
+
() => z.object({
|
|
173
|
+
expectedConnectionAuthorityGeneration: positiveInteger,
|
|
174
|
+
expectedSelectionGeneration: nonnegativeInteger,
|
|
175
|
+
idempotencyKey: string.trim().min(1).max(200),
|
|
176
|
+
repositories: z.array(PersonalGitHubRepositorySelectionInput).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX)
|
|
177
|
+
}).strict().superRefine((request, context) => {
|
|
178
|
+
const repositoryIds = /* @__PURE__ */ new Set();
|
|
179
|
+
const fullNames = /* @__PURE__ */ new Set();
|
|
180
|
+
request.repositories.forEach((repository, index) => {
|
|
181
|
+
const normalizedFullName = repository.fullName.toLowerCase();
|
|
182
|
+
if (repositoryIds.has(repository.repositoryId)) {
|
|
183
|
+
context.addIssue({
|
|
184
|
+
code: "custom",
|
|
185
|
+
path: ["repositories", index, "repositoryId"],
|
|
186
|
+
message: "repositoryId must be unique"
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
if (fullNames.has(normalizedFullName)) {
|
|
190
|
+
context.addIssue({
|
|
191
|
+
code: "custom",
|
|
192
|
+
path: ["repositories", index, "fullName"],
|
|
193
|
+
message: "fullName must be unique"
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
repositoryIds.add(repository.repositoryId);
|
|
197
|
+
fullNames.add(normalizedFullName);
|
|
198
|
+
});
|
|
199
|
+
})
|
|
200
|
+
);
|
|
201
|
+
var VerifyPersonalGitHubRepositorySelectionsRequest = /* @__PURE__ */ defineSchema(
|
|
202
|
+
() => z.object({
|
|
203
|
+
expectedConnectionAuthorityGeneration: positiveInteger,
|
|
204
|
+
expectedSelectionGeneration: nonnegativeInteger,
|
|
205
|
+
idempotencyKey: string.trim().min(1).max(200)
|
|
206
|
+
}).strict()
|
|
207
|
+
);
|
|
208
|
+
var PersonalGitHubConnectionMetadata = /* @__PURE__ */ defineSchema(
|
|
209
|
+
() => z.object({
|
|
210
|
+
credentialRole: z.literal(PERSONAL_GITHUB_CREDENTIAL_ROLE),
|
|
211
|
+
providerFamily: z.literal(PERSONAL_GITHUB_PROVIDER_FAMILY),
|
|
212
|
+
providerPrincipalId: string.regex(/^\d+$/u),
|
|
213
|
+
githubUserId: string.regex(/^\d+$/u),
|
|
214
|
+
githubLogin: z.string().min(1).max(100),
|
|
215
|
+
oauthEnvironment: z.string().min(1).max(128),
|
|
216
|
+
oauthClientMarker: string.regex(/^[a-f0-9]{32}$/u),
|
|
217
|
+
credentialBindingId: uuid,
|
|
218
|
+
connectedAt: string.datetime({ offset: true }),
|
|
219
|
+
lastVerifiedAt: string.datetime({ offset: true }),
|
|
220
|
+
disconnectedAt: string.datetime({ offset: true }).nullable().optional(),
|
|
221
|
+
refreshTokenExpiresAt: string.datetime({ offset: true }).nullable().optional()
|
|
222
|
+
}).passthrough()
|
|
223
|
+
);
|
|
224
|
+
var PersonalGitHubOAuthStartRequest = /* @__PURE__ */ defineSchema(
|
|
225
|
+
() => z.object({
|
|
226
|
+
/** Existing exact connection generation to re-authorize in place. */
|
|
227
|
+
connectionId: optionalUuid,
|
|
228
|
+
/** Same-workspace UI path restored after the callback. */
|
|
229
|
+
returnPath: z.string().min(1).max(2048).optional()
|
|
230
|
+
}).strict()
|
|
231
|
+
);
|
|
232
|
+
var PersonalGitHubOAuthStartResponse = /* @__PURE__ */ defineSchema(
|
|
233
|
+
() => z.object({
|
|
234
|
+
authorizationUrl: z.string().url(),
|
|
235
|
+
expiresAt: string.datetime({ offset: true })
|
|
236
|
+
}).strict()
|
|
237
|
+
);
|
|
238
|
+
var PersonalGitHubConnectionStatusResponse = /* @__PURE__ */ defineSchema(
|
|
239
|
+
() => z.object({
|
|
240
|
+
enabled: boolean,
|
|
241
|
+
connection: ConnectionMetadata.nullable(),
|
|
242
|
+
reviewUrl: z.string().url().nullable()
|
|
243
|
+
}).strict()
|
|
244
|
+
);
|
|
245
|
+
var PersonalGitHubDisconnectRequest = /* @__PURE__ */ defineSchema(
|
|
246
|
+
() => z.object({
|
|
247
|
+
expectedVersion: positiveInteger,
|
|
248
|
+
idempotencyKey: string.trim().min(1).max(200)
|
|
249
|
+
}).strict()
|
|
250
|
+
);
|
|
179
251
|
function isPersonalGitHubConnection(connection) {
|
|
180
252
|
return connection.providerDomain.toLowerCase() === PERSONAL_GITHUB_PROVIDER_DOMAIN && connection.kind === "oauth2" && PersonalGitHubConnectionMetadata.safeParse(connection.metadata).success;
|
|
181
253
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/personal-github.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ConnectionMetadata } from \"./index\";\n\nexport const PERSONAL_GITHUB_PROVIDER_DOMAIN = \"github.com\" as const;\nexport const PERSONAL_GITHUB_PROVIDER_FAMILY = \"github\" as const;\nexport const PERSONAL_GITHUB_CREDENTIAL_ROLE = \"opengeni_github_personal\" as const;\nexport const PERSONAL_GITHUB_CONNECTION_SURFACE_ID = \"github:personal\" as const;\nexport const PERSONAL_GITHUB_REQUESTED_SCOPES = [\"repo\"] as const;\nexport const PERSONAL_GITHUB_AUTHORIZATION_URL =\n \"https://github.com/login/oauth/authorize\" as const;\nexport const PERSONAL_GITHUB_TOKEN_URL = \"https://github.com/login/oauth/access_token\" as const;\nexport const PERSONAL_GITHUB_USER_URL = \"https://api.github.com/user\" as const;\nexport const PERSONAL_GITHUB_API_ORIGIN = \"https://api.github.com\" as const;\nexport const PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX = 100 as const;\n\nexport const PersonalGitHubRepositoryId = z.string().regex(/^[1-9]\\d*$/u);\nexport type PersonalGitHubRepositoryId = z.infer<typeof PersonalGitHubRepositoryId>;\n\nexport const PersonalGitHubRepositoryAccess = z.enum([\"read\", \"write\"]);\nexport type PersonalGitHubRepositoryAccess = z.infer<typeof PersonalGitHubRepositoryAccess>;\n\nexport const PersonalGitHubRepositoryPermissions = z\n .object({\n pull: z.boolean(),\n push: z.boolean(),\n admin: z.boolean(),\n maintain: z.boolean(),\n triage: z.boolean(),\n })\n .strict();\nexport type PersonalGitHubRepositoryPermissions = z.infer<\n typeof PersonalGitHubRepositoryPermissions\n>;\n\nexport const PersonalGitHubRepositoryVisibility = z.enum([\"public\", \"private\", \"internal\"]);\nexport type PersonalGitHubRepositoryVisibility = z.infer<typeof PersonalGitHubRepositoryVisibility>;\n\nconst PersonalGitHubRepositoryFullName = z\n .string()\n .min(3)\n .max(140)\n .regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\\/[A-Za-z0-9_.-]{1,100}$/u);\n\nexport function canonicalPersonalGitHubRepositoryUrl(fullName: string): string {\n return `https://github.com/${fullName}`;\n}\n\n/** A bounded, credential-free projection verified directly against GitHub. */\nexport const PersonalGitHubRepository = z\n .object({\n repositoryId: PersonalGitHubRepositoryId,\n fullName: PersonalGitHubRepositoryFullName,\n canonicalUrl: z.string().url().max(512),\n defaultBranch: z.string().min(1).max(255),\n visibility: PersonalGitHubRepositoryVisibility,\n private: z.boolean(),\n archived: z.boolean(),\n disabled: z.boolean(),\n permissions: PersonalGitHubRepositoryPermissions,\n })\n .strict()\n .superRefine((repository, context) => {\n if (repository.canonicalUrl !== canonicalPersonalGitHubRepositoryUrl(repository.fullName)) {\n context.addIssue({\n code: \"custom\",\n path: [\"canonicalUrl\"],\n message: \"canonicalUrl must be derived from fullName\",\n });\n }\n if (repository.private !== (repository.visibility === \"private\")) {\n context.addIssue({\n code: \"custom\",\n path: [\"private\"],\n message: \"private must agree with visibility\",\n });\n }\n });\nexport type PersonalGitHubRepository = z.infer<typeof PersonalGitHubRepository>;\n\nexport const PersonalGitHubSelectedRepository = PersonalGitHubRepository.safeExtend({\n selectedAccess: PersonalGitHubRepositoryAccess,\n selectionGeneration: z.number().int().positive(),\n selectedAt: z.string().datetime({ offset: true }),\n lastVerifiedAt: z.string().datetime({ offset: true }),\n}).strict();\nexport type PersonalGitHubSelectedRepository = z.infer<typeof PersonalGitHubSelectedRepository>;\n\nexport const PersonalGitHubRepositorySelectionState = z\n .object({\n connectionAuthorityGeneration: z.number().int().positive(),\n credentialBindingId: z.string().uuid(),\n providerPrincipalId: PersonalGitHubRepositoryId,\n selectionGeneration: z.number().int().nonnegative(),\n repositories: z\n .array(PersonalGitHubSelectedRepository)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n })\n .strict();\nexport type PersonalGitHubRepositorySelectionState = z.infer<\n typeof PersonalGitHubRepositorySelectionState\n>;\n\nexport const ListPersonalGitHubRepositoriesQuery = z\n .object({\n cursor: z.coerce.number().int().positive().max(10_000).default(1),\n limit: z.coerce.number().int().min(1).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX).default(50),\n })\n .strict();\nexport type ListPersonalGitHubRepositoriesQuery = z.infer<\n typeof ListPersonalGitHubRepositoriesQuery\n>;\n\nexport const PersonalGitHubRepositoryCatalogItem = PersonalGitHubRepository.safeExtend({\n selectedAccess: PersonalGitHubRepositoryAccess.nullable(),\n}).strict();\nexport type PersonalGitHubRepositoryCatalogItem = z.infer<\n typeof PersonalGitHubRepositoryCatalogItem\n>;\n\nexport const ListPersonalGitHubRepositoriesResponse = z\n .object({\n repositories: z\n .array(PersonalGitHubRepositoryCatalogItem)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n nextCursor: z.number().int().positive().nullable(),\n selection: PersonalGitHubRepositorySelectionState,\n })\n .strict();\nexport type ListPersonalGitHubRepositoriesResponse = z.infer<\n typeof ListPersonalGitHubRepositoriesResponse\n>;\n\nexport const PersonalGitHubRepositorySelectionInput = z\n .object({\n repositoryId: PersonalGitHubRepositoryId,\n fullName: PersonalGitHubRepositoryFullName,\n access: PersonalGitHubRepositoryAccess,\n })\n .strict();\nexport type PersonalGitHubRepositorySelectionInput = z.infer<\n typeof PersonalGitHubRepositorySelectionInput\n>;\n\nexport const ReplacePersonalGitHubRepositorySelectionsRequest = z\n .object({\n expectedConnectionAuthorityGeneration: z.number().int().positive(),\n expectedSelectionGeneration: z.number().int().nonnegative(),\n idempotencyKey: z.string().trim().min(1).max(200),\n repositories: z\n .array(PersonalGitHubRepositorySelectionInput)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n })\n .strict()\n .superRefine((request, context) => {\n const repositoryIds = new Set<string>();\n const fullNames = new Set<string>();\n request.repositories.forEach((repository, index) => {\n const normalizedFullName = repository.fullName.toLowerCase();\n if (repositoryIds.has(repository.repositoryId)) {\n context.addIssue({\n code: \"custom\",\n path: [\"repositories\", index, \"repositoryId\"],\n message: \"repositoryId must be unique\",\n });\n }\n if (fullNames.has(normalizedFullName)) {\n context.addIssue({\n code: \"custom\",\n path: [\"repositories\", index, \"fullName\"],\n message: \"fullName must be unique\",\n });\n }\n repositoryIds.add(repository.repositoryId);\n fullNames.add(normalizedFullName);\n });\n });\nexport type ReplacePersonalGitHubRepositorySelectionsRequest = z.infer<\n typeof ReplacePersonalGitHubRepositorySelectionsRequest\n>;\n\nexport const VerifyPersonalGitHubRepositorySelectionsRequest = z\n .object({\n expectedConnectionAuthorityGeneration: z.number().int().positive(),\n expectedSelectionGeneration: z.number().int().nonnegative(),\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type VerifyPersonalGitHubRepositorySelectionsRequest = z.infer<\n typeof VerifyPersonalGitHubRepositorySelectionsRequest\n>;\n\n/**\n * Owner-visible, credential-free metadata for one dedicated personal GitHub\n * OAuth connection. Repository selections are a separate authority and never\n * live in this credential record.\n */\nexport const PersonalGitHubConnectionMetadata = z\n .object({\n credentialRole: z.literal(PERSONAL_GITHUB_CREDENTIAL_ROLE),\n providerFamily: z.literal(PERSONAL_GITHUB_PROVIDER_FAMILY),\n providerPrincipalId: z.string().regex(/^\\d+$/u),\n githubUserId: z.string().regex(/^\\d+$/u),\n githubLogin: z.string().min(1).max(100),\n oauthEnvironment: z.string().min(1).max(128),\n oauthClientMarker: z.string().regex(/^[a-f0-9]{32}$/u),\n credentialBindingId: z.string().uuid(),\n connectedAt: z.string().datetime({ offset: true }),\n lastVerifiedAt: z.string().datetime({ offset: true }),\n disconnectedAt: z.string().datetime({ offset: true }).nullable().optional(),\n refreshTokenExpiresAt: z.string().datetime({ offset: true }).nullable().optional(),\n })\n .passthrough();\nexport type PersonalGitHubConnectionMetadata = z.infer<typeof PersonalGitHubConnectionMetadata>;\n\nexport const PersonalGitHubOAuthStartRequest = z\n .object({\n /** Existing exact connection generation to re-authorize in place. */\n connectionId: z.string().uuid().optional(),\n /** Same-workspace UI path restored after the callback. */\n returnPath: z.string().min(1).max(2048).optional(),\n })\n .strict();\nexport type PersonalGitHubOAuthStartRequest = z.infer<typeof PersonalGitHubOAuthStartRequest>;\n\nexport const PersonalGitHubOAuthStartResponse = z\n .object({\n authorizationUrl: z.string().url(),\n expiresAt: z.string().datetime({ offset: true }),\n })\n .strict();\nexport type PersonalGitHubOAuthStartResponse = z.infer<typeof PersonalGitHubOAuthStartResponse>;\n\nexport const PersonalGitHubConnectionStatusResponse = z\n .object({\n enabled: z.boolean(),\n connection: ConnectionMetadata.nullable(),\n reviewUrl: z.string().url().nullable(),\n })\n .strict();\nexport type PersonalGitHubConnectionStatusResponse = z.infer<\n typeof PersonalGitHubConnectionStatusResponse\n>;\n\nexport const PersonalGitHubDisconnectRequest = z\n .object({\n expectedVersion: z.number().int().positive(),\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type PersonalGitHubDisconnectRequest = z.infer<typeof PersonalGitHubDisconnectRequest>;\n\nexport function isPersonalGitHubConnection(\n connection: Pick<z.infer<typeof ConnectionMetadata>, \"providerDomain\" | \"kind\" | \"metadata\">,\n): boolean {\n return (\n connection.providerDomain.toLowerCase() === PERSONAL_GITHUB_PROVIDER_DOMAIN &&\n connection.kind === \"oauth2\" &&\n PersonalGitHubConnectionMetadata.safeParse(connection.metadata).success\n );\n}\n\nexport function hasReservedPersonalGitHubMetadata(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C,EAAE,IAAI,IAAI,EAAE,SAAS;AACnD,CAAC,EACA,OAAO;AAGH,IAAM,mCAAmC,EAC7C,OAAO;AAAA,EACN,kBAAkB,EAAE,OAAO,EAAE,IAAI;AAAA,EACjC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,KAAK,CAAC;AACjD,CAAC,EACA,OAAO;AAGH,IAAM,yCAAyC,EACnD,OAAO;AAAA,EACN,SAAS,EAAE,QAAQ;AAAA,EACnB,YAAY,mBAAmB,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AACvC,CAAC,EACA,OAAO;AAKH,IAAM,kCAAkC,EAC5C,OAAO;AAAA,EACN,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAC3C,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAClD,CAAC,EACA,OAAO;AAGH,SAAS,2BACd,YACS;AACT,SACE,WAAW,eAAe,YAAY,MAAM,mCAC5C,WAAW,SAAS,YACpB,iCAAiC,UAAU,WAAW,QAAQ,EAAE;AAEpE;AAEO,SAAS,kCACd,UACS;AACT,SAAO,UAAU,mBAAmB;AACtC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/personal-github.ts"],"sourcesContent":["import * as primitives from \"./primitives\";\nimport { defineSchema } from \"./define-schema\";\nimport { z } from \"zod\";\n\nimport { ConnectionMetadata } from \"./index\";\n\nexport const PERSONAL_GITHUB_PROVIDER_DOMAIN = \"github.com\" as const;\nexport const PERSONAL_GITHUB_PROVIDER_FAMILY = \"github\" as const;\nexport const PERSONAL_GITHUB_CREDENTIAL_ROLE = \"opengeni_github_personal\" as const;\nexport const PERSONAL_GITHUB_CONNECTION_SURFACE_ID = \"github:personal\" as const;\nexport const PERSONAL_GITHUB_REQUESTED_SCOPES = [\"repo\"] as const;\nexport const PERSONAL_GITHUB_AUTHORIZATION_URL =\n \"https://github.com/login/oauth/authorize\" as const;\nexport const PERSONAL_GITHUB_TOKEN_URL = \"https://github.com/login/oauth/access_token\" as const;\nexport const PERSONAL_GITHUB_USER_URL = \"https://api.github.com/user\" as const;\nexport const PERSONAL_GITHUB_API_ORIGIN = \"https://api.github.com\" as const;\nexport const PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX = 100 as const;\n\nexport const PersonalGitHubRepositoryId = /* @__PURE__ */ defineSchema(() =>\n primitives.string.regex(/^[1-9]\\d*$/u),\n);\nexport type PersonalGitHubRepositoryId = z.infer<typeof PersonalGitHubRepositoryId>;\n\nexport const PersonalGitHubRepositoryAccess = /* @__PURE__ */ defineSchema(() =>\n z.enum([\"read\", \"write\"]),\n);\nexport type PersonalGitHubRepositoryAccess = z.infer<typeof PersonalGitHubRepositoryAccess>;\n\nexport const PersonalGitHubRepositoryPermissions = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n pull: primitives.boolean,\n push: primitives.boolean,\n admin: primitives.boolean,\n maintain: primitives.boolean,\n triage: primitives.boolean,\n })\n .strict(),\n);\nexport type PersonalGitHubRepositoryPermissions = z.infer<\n typeof PersonalGitHubRepositoryPermissions\n>;\n\nexport const PersonalGitHubRepositoryVisibility = /* @__PURE__ */ defineSchema(() =>\n z.enum([\"public\", \"private\", \"internal\"]),\n);\nexport type PersonalGitHubRepositoryVisibility = z.infer<typeof PersonalGitHubRepositoryVisibility>;\n\nconst PersonalGitHubRepositoryFullName = /* @__PURE__ */ defineSchema(() =>\n z\n .string()\n .min(3)\n .max(140)\n .regex(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\\/[A-Za-z0-9_.-]{1,100}$/u),\n);\n\nexport function canonicalPersonalGitHubRepositoryUrl(fullName: string): string {\n return `https://github.com/${fullName}`;\n}\n\n/** A bounded, credential-free projection verified directly against GitHub. */\nexport const PersonalGitHubRepository = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n repositoryId: PersonalGitHubRepositoryId,\n fullName: PersonalGitHubRepositoryFullName,\n canonicalUrl: z.string().url().max(512),\n defaultBranch: z.string().min(1).max(255),\n visibility: PersonalGitHubRepositoryVisibility,\n private: primitives.boolean,\n archived: primitives.boolean,\n disabled: primitives.boolean,\n permissions: PersonalGitHubRepositoryPermissions,\n })\n .strict()\n .superRefine((repository, context) => {\n if (repository.canonicalUrl !== canonicalPersonalGitHubRepositoryUrl(repository.fullName)) {\n context.addIssue({\n code: \"custom\",\n path: [\"canonicalUrl\"],\n message: \"canonicalUrl must be derived from fullName\",\n });\n }\n if (repository.private !== (repository.visibility === \"private\")) {\n context.addIssue({\n code: \"custom\",\n path: [\"private\"],\n message: \"private must agree with visibility\",\n });\n }\n }),\n);\nexport type PersonalGitHubRepository = z.infer<typeof PersonalGitHubRepository>;\n\nexport const PersonalGitHubSelectedRepository = /* @__PURE__ */ defineSchema(() =>\n PersonalGitHubRepository.safeExtend({\n selectedAccess: PersonalGitHubRepositoryAccess,\n selectionGeneration: primitives.positiveInteger,\n selectedAt: primitives.string.datetime({ offset: true }),\n lastVerifiedAt: primitives.string.datetime({ offset: true }),\n }).strict(),\n);\nexport type PersonalGitHubSelectedRepository = z.infer<typeof PersonalGitHubSelectedRepository>;\n\nexport const PersonalGitHubRepositorySelectionState = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n connectionAuthorityGeneration: primitives.positiveInteger,\n credentialBindingId: primitives.uuid,\n providerPrincipalId: PersonalGitHubRepositoryId,\n selectionGeneration: primitives.nonnegativeInteger,\n repositories: z\n .array(PersonalGitHubSelectedRepository)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n })\n .strict(),\n);\nexport type PersonalGitHubRepositorySelectionState = z.infer<\n typeof PersonalGitHubRepositorySelectionState\n>;\n\nexport const ListPersonalGitHubRepositoriesQuery = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n cursor: z.coerce.number().int().positive().max(10_000).default(1),\n limit: z.coerce.number().int().min(1).max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX).default(50),\n })\n .strict(),\n);\nexport type ListPersonalGitHubRepositoriesQuery = z.infer<\n typeof ListPersonalGitHubRepositoriesQuery\n>;\n\nexport const PersonalGitHubRepositoryCatalogItem = /* @__PURE__ */ defineSchema(() =>\n PersonalGitHubRepository.safeExtend({\n selectedAccess: PersonalGitHubRepositoryAccess.nullable(),\n }).strict(),\n);\nexport type PersonalGitHubRepositoryCatalogItem = z.infer<\n typeof PersonalGitHubRepositoryCatalogItem\n>;\n\nexport const ListPersonalGitHubRepositoriesResponse = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n repositories: z\n .array(PersonalGitHubRepositoryCatalogItem)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n nextCursor: z.number().int().positive().nullable(),\n selection: PersonalGitHubRepositorySelectionState,\n })\n .strict(),\n);\nexport type ListPersonalGitHubRepositoriesResponse = z.infer<\n typeof ListPersonalGitHubRepositoriesResponse\n>;\n\nexport const PersonalGitHubRepositorySelectionInput = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n repositoryId: PersonalGitHubRepositoryId,\n fullName: PersonalGitHubRepositoryFullName,\n access: PersonalGitHubRepositoryAccess,\n })\n .strict(),\n);\nexport type PersonalGitHubRepositorySelectionInput = z.infer<\n typeof PersonalGitHubRepositorySelectionInput\n>;\n\nexport const ReplacePersonalGitHubRepositorySelectionsRequest = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n expectedConnectionAuthorityGeneration: primitives.positiveInteger,\n expectedSelectionGeneration: primitives.nonnegativeInteger,\n idempotencyKey: primitives.string.trim().min(1).max(200),\n repositories: z\n .array(PersonalGitHubRepositorySelectionInput)\n .max(PERSONAL_GITHUB_REPOSITORY_CATALOG_MAX),\n })\n .strict()\n .superRefine((request, context) => {\n const repositoryIds = new Set<string>();\n const fullNames = new Set<string>();\n request.repositories.forEach((repository, index) => {\n const normalizedFullName = repository.fullName.toLowerCase();\n if (repositoryIds.has(repository.repositoryId)) {\n context.addIssue({\n code: \"custom\",\n path: [\"repositories\", index, \"repositoryId\"],\n message: \"repositoryId must be unique\",\n });\n }\n if (fullNames.has(normalizedFullName)) {\n context.addIssue({\n code: \"custom\",\n path: [\"repositories\", index, \"fullName\"],\n message: \"fullName must be unique\",\n });\n }\n repositoryIds.add(repository.repositoryId);\n fullNames.add(normalizedFullName);\n });\n }),\n);\nexport type ReplacePersonalGitHubRepositorySelectionsRequest = z.infer<\n typeof ReplacePersonalGitHubRepositorySelectionsRequest\n>;\n\nexport const VerifyPersonalGitHubRepositorySelectionsRequest = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n expectedConnectionAuthorityGeneration: primitives.positiveInteger,\n expectedSelectionGeneration: primitives.nonnegativeInteger,\n idempotencyKey: primitives.string.trim().min(1).max(200),\n })\n .strict(),\n);\nexport type VerifyPersonalGitHubRepositorySelectionsRequest = z.infer<\n typeof VerifyPersonalGitHubRepositorySelectionsRequest\n>;\n\n/**\n * Owner-visible, credential-free metadata for one dedicated personal GitHub\n * OAuth connection. Repository selections are a separate authority and never\n * live in this credential record.\n */\nexport const PersonalGitHubConnectionMetadata = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n credentialRole: z.literal(PERSONAL_GITHUB_CREDENTIAL_ROLE),\n providerFamily: z.literal(PERSONAL_GITHUB_PROVIDER_FAMILY),\n providerPrincipalId: primitives.string.regex(/^\\d+$/u),\n githubUserId: primitives.string.regex(/^\\d+$/u),\n githubLogin: z.string().min(1).max(100),\n oauthEnvironment: z.string().min(1).max(128),\n oauthClientMarker: primitives.string.regex(/^[a-f0-9]{32}$/u),\n credentialBindingId: primitives.uuid,\n connectedAt: primitives.string.datetime({ offset: true }),\n lastVerifiedAt: primitives.string.datetime({ offset: true }),\n disconnectedAt: primitives.string.datetime({ offset: true }).nullable().optional(),\n refreshTokenExpiresAt: primitives.string.datetime({ offset: true }).nullable().optional(),\n })\n .passthrough(),\n);\nexport type PersonalGitHubConnectionMetadata = z.infer<typeof PersonalGitHubConnectionMetadata>;\n\nexport const PersonalGitHubOAuthStartRequest = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n /** Existing exact connection generation to re-authorize in place. */\n connectionId: primitives.optionalUuid,\n /** Same-workspace UI path restored after the callback. */\n returnPath: z.string().min(1).max(2048).optional(),\n })\n .strict(),\n);\nexport type PersonalGitHubOAuthStartRequest = z.infer<typeof PersonalGitHubOAuthStartRequest>;\n\nexport const PersonalGitHubOAuthStartResponse = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n authorizationUrl: z.string().url(),\n expiresAt: primitives.string.datetime({ offset: true }),\n })\n .strict(),\n);\nexport type PersonalGitHubOAuthStartResponse = z.infer<typeof PersonalGitHubOAuthStartResponse>;\n\nexport const PersonalGitHubConnectionStatusResponse = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n enabled: primitives.boolean,\n connection: ConnectionMetadata.nullable(),\n reviewUrl: z.string().url().nullable(),\n })\n .strict(),\n);\nexport type PersonalGitHubConnectionStatusResponse = z.infer<\n typeof PersonalGitHubConnectionStatusResponse\n>;\n\nexport const PersonalGitHubDisconnectRequest = /* @__PURE__ */ defineSchema(() =>\n z\n .object({\n expectedVersion: primitives.positiveInteger,\n idempotencyKey: primitives.string.trim().min(1).max(200),\n })\n .strict(),\n);\nexport type PersonalGitHubDisconnectRequest = z.infer<typeof PersonalGitHubDisconnectRequest>;\n\nexport function isPersonalGitHubConnection(\n connection: Pick<z.infer<typeof ConnectionMetadata>, \"providerDomain\" | \"kind\" | \"metadata\">,\n): boolean {\n return (\n connection.providerDomain.toLowerCase() === PERSONAL_GITHUB_PROVIDER_DOMAIN &&\n connection.kind === \"oauth2\" &&\n PersonalGitHubConnectionMetadata.safeParse(connection.metadata).success\n );\n}\n\nexport function hasReservedPersonalGitHubMetadata(\n metadata: Record<string, unknown> | undefined,\n): boolean {\n return metadata?.credentialRole === PERSONAL_GITHUB_CREDENTIAL_ROLE;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAC,EACA,OAAO;AACZ;AAGO,IAAM,yCAAyD;AAAA,EAAa,MACjF,EACG,OAAO;AAAA,IACN,SAAoB;AAAA,IACpB,YAAY,mBAAmB,SAAS;AAAA,IACxC,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACvC,CAAC,EACA,OAAO;AACZ;AAKO,IAAM,kCAAkD;AAAA,EAAa,MAC1E,EACG,OAAO;AAAA,IACN,iBAA4B;AAAA,IAC5B,gBAA2B,OAAO,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACzD,CAAC,EACA,OAAO;AACZ;AAGO,SAAS,2BACd,YACS;AACT,SACE,WAAW,eAAe,YAAY,MAAM,mCAC5C,WAAW,SAAS,YACpB,iCAAiC,UAAU,WAAW,QAAQ,EAAE;AAEpE;AAEO,SAAS,kCACd,UACS;AACT,SAAO,UAAU,mBAAmB;AACtC;","names":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/** The narrow permission. `connections:write` includes it. */
|
|
2
|
+
export declare const PERSONAL_INTEGRATION_SETUP_PERMISSION: "connections:personal";
|
|
3
|
+
/**
|
|
4
|
+
* Literal permission-set coverage for ceilings (organization key policies,
|
|
5
|
+
* delegation limits): the exact permission, or the personal setup permission
|
|
6
|
+
* through `connections:write`. Grants and policies saved before the narrow
|
|
7
|
+
* permission existed keep their meaning.
|
|
8
|
+
*/
|
|
9
|
+
export declare function permissionSetCovers(permissions: readonly string[], permission: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Whether a catalog integration may be turned on for personal accounts by
|
|
12
|
+
* someone holding only the personal setup permission: a reviewed catalog MCP
|
|
13
|
+
* integration that signs each person in with OAuth. Custom MCP servers,
|
|
14
|
+
* API-key integrations and unreviewed registry entries never qualify.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isPersonalIntegrationSetupCandidate(item: {
|
|
17
|
+
kind: string;
|
|
18
|
+
source: string;
|
|
19
|
+
authKind?: string | null | undefined;
|
|
20
|
+
stale?: boolean | undefined;
|
|
21
|
+
workspaceId?: string | null | undefined;
|
|
22
|
+
runtime?: {
|
|
23
|
+
available?: boolean | undefined;
|
|
24
|
+
catalogTrust?: {
|
|
25
|
+
state: string;
|
|
26
|
+
} | undefined;
|
|
27
|
+
} | undefined;
|
|
28
|
+
}): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* How this person may set up an integration from a card in their chat, read
|
|
31
|
+
* from their workspace grant and the integration's catalog entry:
|
|
32
|
+
*
|
|
33
|
+
* - `"any"`: they may connect a shared or a personal account (and enable it).
|
|
34
|
+
* - `"personal"`: only their own account; the card offers no ownership choice
|
|
35
|
+
* and enables the integration for personal accounts if it is not on yet.
|
|
36
|
+
* - `null`: they cannot finish setup here.
|
|
37
|
+
*
|
|
38
|
+
* The API enforces the same rules at call time (and an organization can
|
|
39
|
+
* reserve turning integrations on for admins), so this only decides what to
|
|
40
|
+
* offer. Clients, embeds and integration cards should all use this one rule.
|
|
41
|
+
*/
|
|
42
|
+
export declare function personalIntegrationSetupAccess(grant: {
|
|
43
|
+
permissions: readonly string[];
|
|
44
|
+
permissionMode?: "legacy" | "explicit" | undefined;
|
|
45
|
+
}, item: Parameters<typeof isPersonalIntegrationSetupCandidate>[0] & {
|
|
46
|
+
enabled?: boolean | undefined;
|
|
47
|
+
connectionRef?: {
|
|
48
|
+
subjectScope?: string | undefined;
|
|
49
|
+
} | null | undefined;
|
|
50
|
+
}): "any" | "personal" | null;
|
|
51
|
+
/**
|
|
52
|
+
* What an agent's setup card for one capability can offer this person in
|
|
53
|
+
* their chat, read from their workspace grant and the capability's catalog
|
|
54
|
+
* entry (`undefined` when the catalog has none):
|
|
55
|
+
*
|
|
56
|
+
* - `"card"`: an OAuth MCP integration they can connect from the card;
|
|
57
|
+
* `personalOnly` when only their own account is allowed.
|
|
58
|
+
* - `"integration"`: a deployment's reviewed integration definition they
|
|
59
|
+
* connect with their own account.
|
|
60
|
+
* - `"unavailable"`: they cannot finish this setup from the chat.
|
|
61
|
+
* - `"default"`: not decided here (other kinds of setup keep their own row).
|
|
62
|
+
*
|
|
63
|
+
* The chat card and the agent's setup tool both use this rule, so what the
|
|
64
|
+
* agent says matches what the card offers.
|
|
65
|
+
*/
|
|
66
|
+
export type InChatCapabilitySetup = {
|
|
67
|
+
kind: "card";
|
|
68
|
+
personalOnly: boolean;
|
|
69
|
+
} | {
|
|
70
|
+
kind: "integration";
|
|
71
|
+
} | {
|
|
72
|
+
kind: "unavailable";
|
|
73
|
+
} | {
|
|
74
|
+
kind: "default";
|
|
75
|
+
};
|
|
76
|
+
export declare function inChatCapabilitySetup(grant: {
|
|
77
|
+
permissions: readonly string[];
|
|
78
|
+
permissionMode?: "legacy" | "explicit" | undefined;
|
|
79
|
+
}, capabilityId: string, item: (Parameters<typeof personalIntegrationSetupAccess>[1] & {
|
|
80
|
+
authKind?: string | null | undefined;
|
|
81
|
+
}) | undefined): InChatCapabilitySetup;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
integrationDefinitionIdFromCapabilityId
|
|
3
|
+
} from "./chunk-RLJUNVAM.js";
|
|
4
|
+
|
|
5
|
+
// src/personal-integration-setup.ts
|
|
6
|
+
var PERSONAL_INTEGRATION_SETUP_PERMISSION = "connections:personal";
|
|
7
|
+
function permissionSetCovers(permissions, permission) {
|
|
8
|
+
return permissions.includes(permission) || permission === PERSONAL_INTEGRATION_SETUP_PERMISSION && permissions.includes("connections:write");
|
|
9
|
+
}
|
|
10
|
+
var REVIEWED_SOURCES = /* @__PURE__ */ new Set(["built_in", "configured", "registry"]);
|
|
11
|
+
function isPersonalIntegrationSetupCandidate(item) {
|
|
12
|
+
return item.kind === "mcp" && item.authKind === "oauth2" && REVIEWED_SOURCES.has(item.source) && !item.stale && !item.workspaceId && item.runtime?.available === true && (item.source !== "registry" || item.runtime.catalogTrust?.state === "trusted");
|
|
13
|
+
}
|
|
14
|
+
function personalIntegrationSetupAccess(grant, item) {
|
|
15
|
+
const can = (permission) => permissionSetCovers(grant.permissions, permission) || grant.permissionMode !== "explicit" && permission !== "secrets:read" && grant.permissions.includes("workspace:admin");
|
|
16
|
+
if (!can(PERSONAL_INTEGRATION_SETUP_PERMISSION)) return null;
|
|
17
|
+
if (can("connections:write") && can("connections:read") && (item.enabled || can("capabilities:manage")))
|
|
18
|
+
return "any";
|
|
19
|
+
if (item.enabled) return item.connectionRef?.subjectScope === "subject" ? "personal" : null;
|
|
20
|
+
return can("capabilities:manage") || isPersonalIntegrationSetupCandidate(item) ? "personal" : null;
|
|
21
|
+
}
|
|
22
|
+
function inChatCapabilitySetup(grant, capabilityId, item) {
|
|
23
|
+
const can = (permission) => grant.permissions.includes(permission) || grant.permissionMode !== "explicit" && grant.permissions.includes("workspace:admin");
|
|
24
|
+
if (integrationDefinitionIdFromCapabilityId(capabilityId)) {
|
|
25
|
+
return can("sessions:control") && (can(PERSONAL_INTEGRATION_SETUP_PERMISSION) || can("connections:write")) ? { kind: "integration" } : { kind: "unavailable" };
|
|
26
|
+
}
|
|
27
|
+
if (!item || item.kind !== "mcp" || item.authKind !== "oauth2") return { kind: "default" };
|
|
28
|
+
if (!can("sessions:control")) return { kind: "unavailable" };
|
|
29
|
+
const usesSharedAccount = item.enabled === true && item.connectionRef !== null && item.connectionRef !== void 0 && item.connectionRef.subjectScope !== "subject";
|
|
30
|
+
if (usesSharedAccount)
|
|
31
|
+
return can("connections:read") ? { kind: "card", personalOnly: false } : { kind: "unavailable" };
|
|
32
|
+
const access = personalIntegrationSetupAccess(grant, item);
|
|
33
|
+
return access ? { kind: "card", personalOnly: access === "personal" } : { kind: "unavailable" };
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
PERSONAL_INTEGRATION_SETUP_PERMISSION,
|
|
37
|
+
inChatCapabilitySetup,
|
|
38
|
+
isPersonalIntegrationSetupCandidate,
|
|
39
|
+
permissionSetCovers,
|
|
40
|
+
personalIntegrationSetupAccess
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=personal-integration-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/personal-integration-setup.ts"],"sourcesContent":["/**\n * Personal integration setup: a person connecting their own account to an\n * integration and using it in their own chats, without administering the\n * workspace. One shared definition for the API, the SDK and every client.\n */\nimport { integrationDefinitionIdFromCapabilityId } from \"./integration-capability-id\";\n\n/** The narrow permission. `connections:write` includes it. */\nexport const PERSONAL_INTEGRATION_SETUP_PERMISSION = \"connections:personal\" as const;\n\n/**\n * Literal permission-set coverage for ceilings (organization key policies,\n * delegation limits): the exact permission, or the personal setup permission\n * through `connections:write`. Grants and policies saved before the narrow\n * permission existed keep their meaning.\n */\nexport function permissionSetCovers(permissions: readonly string[], permission: string): boolean {\n return (\n permissions.includes(permission) ||\n (permission === PERSONAL_INTEGRATION_SETUP_PERMISSION &&\n permissions.includes(\"connections:write\"))\n );\n}\n\n/** Catalog sources reviewed by Opengeni or the deployment operator, never a workspace's own entries. */\nconst REVIEWED_SOURCES = new Set([\"built_in\", \"configured\", \"registry\"]);\n\n/**\n * Whether a catalog integration may be turned on for personal accounts by\n * someone holding only the personal setup permission: a reviewed catalog MCP\n * integration that signs each person in with OAuth. Custom MCP servers,\n * API-key integrations and unreviewed registry entries never qualify.\n */\nexport function isPersonalIntegrationSetupCandidate(item: {\n kind: string;\n source: string;\n authKind?: string | null | undefined;\n stale?: boolean | undefined;\n workspaceId?: string | null | undefined;\n runtime?:\n | { available?: boolean | undefined; catalogTrust?: { state: string } | undefined }\n | undefined;\n}): boolean {\n return (\n item.kind === \"mcp\" &&\n item.authKind === \"oauth2\" &&\n REVIEWED_SOURCES.has(item.source) &&\n !item.stale &&\n !item.workspaceId &&\n item.runtime?.available === true &&\n (item.source !== \"registry\" || item.runtime.catalogTrust?.state === \"trusted\")\n );\n}\n\n/**\n * How this person may set up an integration from a card in their chat, read\n * from their workspace grant and the integration's catalog entry:\n *\n * - `\"any\"`: they may connect a shared or a personal account (and enable it).\n * - `\"personal\"`: only their own account; the card offers no ownership choice\n * and enables the integration for personal accounts if it is not on yet.\n * - `null`: they cannot finish setup here.\n *\n * The API enforces the same rules at call time (and an organization can\n * reserve turning integrations on for admins), so this only decides what to\n * offer. Clients, embeds and integration cards should all use this one rule.\n */\nexport function personalIntegrationSetupAccess(\n grant: { permissions: readonly string[]; permissionMode?: \"legacy\" | \"explicit\" | undefined },\n item: Parameters<typeof isPersonalIntegrationSetupCandidate>[0] & {\n enabled?: boolean | undefined;\n connectionRef?: { subjectScope?: string | undefined } | null | undefined;\n },\n): \"any\" | \"personal\" | null {\n const can = (permission: string) =>\n permissionSetCovers(grant.permissions, permission) ||\n (grant.permissionMode !== \"explicit\" &&\n permission !== \"secrets:read\" &&\n grant.permissions.includes(\"workspace:admin\"));\n if (!can(PERSONAL_INTEGRATION_SETUP_PERMISSION)) return null;\n if (\n can(\"connections:write\") &&\n can(\"connections:read\") &&\n (item.enabled || can(\"capabilities:manage\"))\n )\n return \"any\";\n // Already on: connecting one's own account changes no installation, but\n // only an installation that signs each person in can take it.\n if (item.enabled) return item.connectionRef?.subjectScope === \"subject\" ? \"personal\" : null;\n return can(\"capabilities:manage\") || isPersonalIntegrationSetupCandidate(item)\n ? \"personal\"\n : null;\n}\n\n/**\n * What an agent's setup card for one capability can offer this person in\n * their chat, read from their workspace grant and the capability's catalog\n * entry (`undefined` when the catalog has none):\n *\n * - `\"card\"`: an OAuth MCP integration they can connect from the card;\n * `personalOnly` when only their own account is allowed.\n * - `\"integration\"`: a deployment's reviewed integration definition they\n * connect with their own account.\n * - `\"unavailable\"`: they cannot finish this setup from the chat.\n * - `\"default\"`: not decided here (other kinds of setup keep their own row).\n *\n * The chat card and the agent's setup tool both use this rule, so what the\n * agent says matches what the card offers.\n */\nexport type InChatCapabilitySetup =\n | { kind: \"card\"; personalOnly: boolean }\n | { kind: \"integration\" }\n | { kind: \"unavailable\" }\n | { kind: \"default\" };\n\nexport function inChatCapabilitySetup(\n grant: { permissions: readonly string[]; permissionMode?: \"legacy\" | \"explicit\" | undefined },\n capabilityId: string,\n item:\n | (Parameters<typeof personalIntegrationSetupAccess>[1] & {\n authKind?: string | null | undefined;\n })\n | undefined,\n): InChatCapabilitySetup {\n const can = (permission: string) =>\n grant.permissions.includes(permission) ||\n (grant.permissionMode !== \"explicit\" && grant.permissions.includes(\"workspace:admin\"));\n if (integrationDefinitionIdFromCapabilityId(capabilityId)) {\n // Connecting your own account is the whole step: the integration's tools\n // are installed for that account only, never for the workspace, so the\n // personal setup permission (included in connections:write) is enough.\n return can(\"sessions:control\") &&\n (can(PERSONAL_INTEGRATION_SETUP_PERMISSION) || can(\"connections:write\"))\n ? { kind: \"integration\" }\n : { kind: \"unavailable\" };\n }\n if (!item || item.kind !== \"mcp\" || item.authKind !== \"oauth2\") return { kind: \"default\" };\n if (!can(\"sessions:control\")) return { kind: \"unavailable\" };\n const usesSharedAccount =\n item.enabled === true &&\n item.connectionRef !== null &&\n item.connectionRef !== undefined &&\n item.connectionRef.subjectScope !== \"subject\";\n if (usesSharedAccount)\n return can(\"connections:read\")\n ? { kind: \"card\", personalOnly: false }\n : { kind: \"unavailable\" };\n const access = personalIntegrationSetupAccess(grant, item);\n return access ? { kind: \"card\", personalOnly: access === \"personal\" } : { kind: \"unavailable\" };\n}\n"],"mappings":";;;;;AAQO,IAAM,wCAAwC;AAQ9C,SAAS,oBAAoB,aAAgC,YAA6B;AAC/F,SACE,YAAY,SAAS,UAAU,KAC9B,eAAe,yCACd,YAAY,SAAS,mBAAmB;AAE9C;AAGA,IAAM,mBAAmB,oBAAI,IAAI,CAAC,YAAY,cAAc,UAAU,CAAC;AAQhE,SAAS,oCAAoC,MASxC;AACV,SACE,KAAK,SAAS,SACd,KAAK,aAAa,YAClB,iBAAiB,IAAI,KAAK,MAAM,KAChC,CAAC,KAAK,SACN,CAAC,KAAK,eACN,KAAK,SAAS,cAAc,SAC3B,KAAK,WAAW,cAAc,KAAK,QAAQ,cAAc,UAAU;AAExE;AAeO,SAAS,+B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