@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/tool-catalog.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import * as primitives from "./primitives";
|
|
2
|
+
import { defineSchema } from "./define-schema";
|
|
1
3
|
import { z } from "zod";
|
|
4
|
+
import { Permission } from "./permissions";
|
|
2
5
|
|
|
3
6
|
export const ATTEMPT_TOOL_CATALOG_VERSION = 1 as const;
|
|
4
7
|
export const TOOL_GATEWAY_CATALOG_VERSION = 1 as const;
|
|
@@ -14,60 +17,72 @@ export const CODEMODE_CLAIM_LEASE_MS = 30_000;
|
|
|
14
17
|
export const CODEMODE_CLAIM_HEARTBEAT_MS = 10_000;
|
|
15
18
|
export const CODEMODE_MAX_CONCURRENT_CALLS_PER_ATTEMPT = 16;
|
|
16
19
|
|
|
17
|
-
const sha256 =
|
|
18
|
-
const serverIdentifier =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
const sha256 = /* @__PURE__ */ defineSchema(() => primitives.string.regex(/^[0-9a-f]{64}$/u));
|
|
21
|
+
const serverIdentifier = /* @__PURE__ */ defineSchema(() =>
|
|
22
|
+
z
|
|
23
|
+
.string()
|
|
24
|
+
.min(1)
|
|
25
|
+
.max(256)
|
|
26
|
+
.regex(/^[A-Za-z0-9_-]+$/u),
|
|
27
|
+
);
|
|
28
|
+
const toolIdentifier = /* @__PURE__ */ defineSchema(() =>
|
|
29
|
+
z
|
|
30
|
+
.string()
|
|
31
|
+
.min(1)
|
|
32
|
+
.max(512)
|
|
33
|
+
.regex(/^[^\u0000-\u001f\u007f]+$/u),
|
|
34
|
+
);
|
|
35
|
+
const namespaceSegment = /* @__PURE__ */ defineSchema(() =>
|
|
36
|
+
z
|
|
37
|
+
.string()
|
|
38
|
+
.min(1)
|
|
39
|
+
.max(128)
|
|
40
|
+
.regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/u)
|
|
41
|
+
.refine((value) => !["__proto__", "prototype", "constructor"].includes(value), {
|
|
42
|
+
message: "unsafe Codemode namespace segment",
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
45
|
+
const jsonObject = /* @__PURE__ */ defineSchema(() => z.record(z.string().max(512), z.json()));
|
|
37
46
|
|
|
38
47
|
/** Opaque authority identity. Display/wire names must never be parsed as authority. */
|
|
39
|
-
export const AttemptToolIdentity =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
export const AttemptToolIdentity = /* @__PURE__ */ defineSchema(() =>
|
|
49
|
+
z
|
|
50
|
+
.object({
|
|
51
|
+
serverId: serverIdentifier,
|
|
52
|
+
toolName: toolIdentifier,
|
|
53
|
+
})
|
|
54
|
+
.strict(),
|
|
55
|
+
);
|
|
45
56
|
export type AttemptToolIdentity = z.infer<typeof AttemptToolIdentity>;
|
|
46
57
|
|
|
47
58
|
/** Protocol-neutral tool identity shared by MCP, HTTP/SDK, agents, and Codemode. */
|
|
48
59
|
export const ToolGatewayIdentity = AttemptToolIdentity;
|
|
49
60
|
export type ToolGatewayIdentity = AttemptToolIdentity;
|
|
50
61
|
|
|
51
|
-
export const AttemptToolCatalogIcon =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
export const AttemptToolCatalogIcon = /* @__PURE__ */ defineSchema(() =>
|
|
63
|
+
z
|
|
64
|
+
.object({
|
|
65
|
+
src: z.string().min(1).max(8_192),
|
|
66
|
+
mimeType: z.string().min(1).max(128).optional(),
|
|
67
|
+
sizes: z.array(z.string().min(1).max(64)).max(16).optional(),
|
|
68
|
+
theme: z.enum(["light", "dark"]).optional(),
|
|
69
|
+
})
|
|
70
|
+
.strict(),
|
|
71
|
+
);
|
|
59
72
|
export type AttemptToolCatalogIcon = z.infer<typeof AttemptToolCatalogIcon>;
|
|
60
73
|
|
|
61
74
|
/** MCP annotations retained without inventing stronger effect guarantees. */
|
|
62
|
-
export const AttemptToolAnnotations =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
export const AttemptToolAnnotations = /* @__PURE__ */ defineSchema(() =>
|
|
76
|
+
z
|
|
77
|
+
.object({
|
|
78
|
+
title: z.string().max(512).optional(),
|
|
79
|
+
readOnlyHint: primitives.optionalBoolean,
|
|
80
|
+
destructiveHint: primitives.optionalBoolean,
|
|
81
|
+
idempotentHint: primitives.optionalBoolean,
|
|
82
|
+
openWorldHint: primitives.optionalBoolean,
|
|
83
|
+
})
|
|
84
|
+
.loose(),
|
|
85
|
+
);
|
|
71
86
|
export type AttemptToolAnnotations = z.infer<typeof AttemptToolAnnotations>;
|
|
72
87
|
|
|
73
88
|
/** JSON Schema is preserved as received. Runtime byte/node guards remain authoritative. */
|
|
@@ -75,90 +90,127 @@ export const AttemptToolJsonSchema = jsonObject;
|
|
|
75
90
|
export type AttemptToolJsonSchema = z.infer<typeof AttemptToolJsonSchema>;
|
|
76
91
|
|
|
77
92
|
/** Presentation only; never parsed as execution or account authority. */
|
|
78
|
-
export const ToolDisplayMetadata =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
93
|
+
export const ToolDisplayMetadata = /* @__PURE__ */ defineSchema(() =>
|
|
94
|
+
z
|
|
95
|
+
.object({
|
|
96
|
+
toolName: toolIdentifier,
|
|
97
|
+
title: z.string().min(1).max(512).optional(),
|
|
98
|
+
/** Account to name beside the tool. Set only when the connector has more than one. */
|
|
99
|
+
accountLabel: z.string().min(1).max(1024).optional(),
|
|
100
|
+
/** The connector the tool belongs to, e.g. "Linear". */
|
|
101
|
+
connector: z.string().min(1).max(512).optional(),
|
|
102
|
+
/** The connector's provider, so a host can draw its logo. */
|
|
103
|
+
providerDomain: z.string().min(1).max(253).optional(),
|
|
104
|
+
})
|
|
105
|
+
.strict(),
|
|
106
|
+
);
|
|
85
107
|
export type ToolDisplayMetadata = z.infer<typeof ToolDisplayMetadata>;
|
|
86
108
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
/**
|
|
110
|
+
* How one connector account route is named. The model always gets the full
|
|
111
|
+
* account in tool descriptions; people see the connector, and the account only
|
|
112
|
+
* when there is more than one to tell apart.
|
|
113
|
+
*/
|
|
114
|
+
export type McpAccountRouteLabel = {
|
|
115
|
+
/** Model-facing account description. */
|
|
116
|
+
model: string;
|
|
117
|
+
connector: string;
|
|
118
|
+
providerDomain: string;
|
|
119
|
+
/** Present only when the connector has several accounts in the turn. */
|
|
120
|
+
account?: string | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* The kind of need the connector serves, its catalog category
|
|
123
|
+
* ("communication", "files"), when one is known. Never model-facing.
|
|
124
|
+
*/
|
|
125
|
+
kind?: string | undefined;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/** The short account line for approvals: "Linear", or "Linear · alice@example.com". */
|
|
129
|
+
export function mcpAccountRouteReviewLabel(label: McpAccountRouteLabel): string {
|
|
130
|
+
return label.account ? `${label.connector} · ${label.account}` : label.connector;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export const AttemptToolCatalogEntry = /* @__PURE__ */ defineSchema(() =>
|
|
134
|
+
z
|
|
135
|
+
.object({
|
|
136
|
+
identity: AttemptToolIdentity,
|
|
137
|
+
/** Exact model-wire projection for this generation, e.g. `slack__search`. */
|
|
138
|
+
modelName: toolIdentifier,
|
|
139
|
+
/** Safe generated Codemode namespace; convenience only, never authority. */
|
|
140
|
+
codemodePath: z.array(namespaceSegment).min(2).max(ATTEMPT_TOOL_CATALOG_MAX_PATH_SEGMENTS),
|
|
141
|
+
title: z.string().min(1).max(512).optional(),
|
|
142
|
+
description: z.string().max(32_768).optional(),
|
|
143
|
+
inputSchema: AttemptToolJsonSchema,
|
|
144
|
+
outputSchema: AttemptToolJsonSchema.optional(),
|
|
145
|
+
annotations: AttemptToolAnnotations.optional(),
|
|
146
|
+
icons: z.array(AttemptToolCatalogIcon).max(16).optional(),
|
|
147
|
+
source: z.enum(["opengeni", "files", "docs", "mcp", "codex_apps", "interaction"]),
|
|
148
|
+
approval: z.enum(["none", "human", "policy"]),
|
|
149
|
+
})
|
|
150
|
+
.strict(),
|
|
151
|
+
);
|
|
104
152
|
export type AttemptToolCatalogEntry = z.infer<typeof AttemptToolCatalogEntry>;
|
|
105
153
|
|
|
106
154
|
/** One canonical gateway entry. Adapter-specific names are projections, never authority. */
|
|
107
155
|
export const ToolGatewayCatalogEntry = AttemptToolCatalogEntry;
|
|
108
156
|
export type ToolGatewayCatalogEntry = AttemptToolCatalogEntry;
|
|
109
157
|
|
|
110
|
-
export const ToolGatewayCatalog =
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
158
|
+
export const ToolGatewayCatalog = /* @__PURE__ */ defineSchema(() =>
|
|
159
|
+
z
|
|
160
|
+
.object({
|
|
161
|
+
version: z.literal(TOOL_GATEWAY_CATALOG_VERSION),
|
|
162
|
+
accountId: primitives.uuid,
|
|
163
|
+
workspaceId: primitives.uuid,
|
|
164
|
+
generation: primitives.positiveInteger,
|
|
165
|
+
digest: sha256,
|
|
166
|
+
createdAt: primitives.string.datetime({ offset: true }),
|
|
167
|
+
entries: z.array(ToolGatewayCatalogEntry).max(ATTEMPT_TOOL_CATALOG_MAX_ENTRIES),
|
|
168
|
+
})
|
|
169
|
+
.strict()
|
|
170
|
+
.superRefine((catalog, context) => {
|
|
171
|
+
const identities = new Set<string>();
|
|
172
|
+
const modelNames = new Set<string>();
|
|
173
|
+
const toolPaths = new Set<string>();
|
|
174
|
+
for (const [index, entry] of catalog.entries.entries()) {
|
|
175
|
+
const identity = `${entry.identity.serverId}\u0000${entry.identity.toolName}`;
|
|
176
|
+
const toolPath = entry.codemodePath.join(".");
|
|
177
|
+
if (identities.has(identity)) {
|
|
178
|
+
context.addIssue({
|
|
179
|
+
code: "custom",
|
|
180
|
+
path: ["entries", index, "identity"],
|
|
181
|
+
message: "duplicate tool identity",
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (modelNames.has(entry.modelName)) {
|
|
185
|
+
context.addIssue({
|
|
186
|
+
code: "custom",
|
|
187
|
+
path: ["entries", index, "modelName"],
|
|
188
|
+
message: "duplicate model tool name",
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
if (toolPaths.has(toolPath)) {
|
|
192
|
+
context.addIssue({
|
|
193
|
+
code: "custom",
|
|
194
|
+
path: ["entries", index, "codemodePath"],
|
|
195
|
+
message: "duplicate tool path",
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
identities.add(identity);
|
|
199
|
+
modelNames.add(entry.modelName);
|
|
200
|
+
toolPaths.add(toolPath);
|
|
148
201
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
toolPaths.add(toolPath);
|
|
152
|
-
}
|
|
153
|
-
});
|
|
202
|
+
}),
|
|
203
|
+
);
|
|
154
204
|
export type ToolGatewayCatalog = z.infer<typeof ToolGatewayCatalog>;
|
|
155
205
|
|
|
156
|
-
export const ToolGatewayCaller =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
206
|
+
export const ToolGatewayCaller = /* @__PURE__ */ defineSchema(() =>
|
|
207
|
+
z
|
|
208
|
+
.object({
|
|
209
|
+
kind: z.enum(["model", "codemode", "http", "mcp", "browser"]),
|
|
210
|
+
subjectId: z.string().min(1).max(1_024),
|
|
211
|
+
})
|
|
212
|
+
.strict(),
|
|
213
|
+
);
|
|
162
214
|
export type ToolGatewayCaller = z.infer<typeof ToolGatewayCaller>;
|
|
163
215
|
|
|
164
216
|
/**
|
|
@@ -170,228 +222,473 @@ export type ToolGatewayCaller = z.infer<typeof ToolGatewayCaller>;
|
|
|
170
222
|
*/
|
|
171
223
|
export const FIRST_PARTY_MCP_CALLER_META_KEY = "opengeniCaller";
|
|
172
224
|
|
|
173
|
-
export const AttemptToolCatalog =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
225
|
+
export const AttemptToolCatalog = /* @__PURE__ */ defineSchema(() =>
|
|
226
|
+
z
|
|
227
|
+
.object({
|
|
228
|
+
version: z.literal(ATTEMPT_TOOL_CATALOG_VERSION),
|
|
229
|
+
accountId: primitives.uuid,
|
|
230
|
+
workspaceId: primitives.uuid,
|
|
231
|
+
sessionId: primitives.uuid,
|
|
232
|
+
turnId: primitives.uuid,
|
|
233
|
+
attemptId: primitives.uuid,
|
|
234
|
+
executionGeneration: primitives.positiveInteger,
|
|
235
|
+
generation: primitives.positiveInteger,
|
|
236
|
+
digest: sha256,
|
|
237
|
+
createdAt: primitives.string.datetime({ offset: true }),
|
|
238
|
+
/** Native permission ceiling frozen by the worker with this catalog.
|
|
239
|
+
* Absence is legacy/unknown, not permission to derive a larger live set. */
|
|
240
|
+
firstPartyMcpPermissions: z.array(Permission).max(128).optional(),
|
|
241
|
+
entries: z.array(AttemptToolCatalogEntry).max(ATTEMPT_TOOL_CATALOG_MAX_ENTRIES),
|
|
242
|
+
})
|
|
243
|
+
.strict()
|
|
244
|
+
.superRefine((catalog, context) => {
|
|
245
|
+
const identities = new Set<string>();
|
|
246
|
+
const modelNames = new Set<string>();
|
|
247
|
+
const codemodePaths = new Set<string>();
|
|
248
|
+
for (const [index, entry] of catalog.entries.entries()) {
|
|
249
|
+
const identity = `${entry.identity.serverId}\u0000${entry.identity.toolName}`;
|
|
250
|
+
const codemodePath = entry.codemodePath.join(".");
|
|
251
|
+
if (identities.has(identity)) {
|
|
252
|
+
context.addIssue({
|
|
253
|
+
code: "custom",
|
|
254
|
+
path: ["entries", index, "identity"],
|
|
255
|
+
message: "duplicate tool identity",
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
if (modelNames.has(entry.modelName)) {
|
|
259
|
+
context.addIssue({
|
|
260
|
+
code: "custom",
|
|
261
|
+
path: ["entries", index, "modelName"],
|
|
262
|
+
message: "duplicate model tool name",
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
if (codemodePaths.has(codemodePath)) {
|
|
266
|
+
context.addIssue({
|
|
267
|
+
code: "custom",
|
|
268
|
+
path: ["entries", index, "codemodePath"],
|
|
269
|
+
message: "duplicate Codemode tool path",
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
identities.add(identity);
|
|
273
|
+
modelNames.add(entry.modelName);
|
|
274
|
+
codemodePaths.add(codemodePath);
|
|
201
275
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
code: "custom",
|
|
205
|
-
path: ["entries", index, "modelName"],
|
|
206
|
-
message: "duplicate model tool name",
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
if (codemodePaths.has(codemodePath)) {
|
|
210
|
-
context.addIssue({
|
|
211
|
-
code: "custom",
|
|
212
|
-
path: ["entries", index, "codemodePath"],
|
|
213
|
-
message: "duplicate Codemode tool path",
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
identities.add(identity);
|
|
217
|
-
modelNames.add(entry.modelName);
|
|
218
|
-
codemodePaths.add(codemodePath);
|
|
219
|
-
}
|
|
220
|
-
});
|
|
276
|
+
}),
|
|
277
|
+
);
|
|
221
278
|
export type AttemptToolCatalog = z.infer<typeof AttemptToolCatalog>;
|
|
222
279
|
|
|
223
|
-
export const AttemptToolCaller =
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
280
|
+
export const AttemptToolCaller = /* @__PURE__ */ defineSchema(() =>
|
|
281
|
+
z
|
|
282
|
+
.object({
|
|
283
|
+
kind: z.enum(["model", "codemode"]),
|
|
284
|
+
subjectId: z.string().min(1).max(1_024),
|
|
285
|
+
})
|
|
286
|
+
.strict(),
|
|
287
|
+
);
|
|
229
288
|
export type AttemptToolCaller = z.infer<typeof AttemptToolCaller>;
|
|
230
289
|
|
|
231
|
-
export const AttemptToolCall =
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
290
|
+
export const AttemptToolCall = /* @__PURE__ */ defineSchema(() =>
|
|
291
|
+
z
|
|
292
|
+
.object({
|
|
293
|
+
operationId: primitives.uuid,
|
|
294
|
+
catalogDigest: sha256,
|
|
295
|
+
identity: AttemptToolIdentity,
|
|
296
|
+
arguments: jsonObject,
|
|
297
|
+
caller: AttemptToolCaller,
|
|
298
|
+
})
|
|
299
|
+
.strict(),
|
|
300
|
+
);
|
|
240
301
|
export type AttemptToolCall = z.infer<typeof AttemptToolCall>;
|
|
241
302
|
|
|
242
|
-
const McpAnnotations =
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
.
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
303
|
+
const McpAnnotations = /* @__PURE__ */ defineSchema(() =>
|
|
304
|
+
z.record(z.string().max(256), z.json()).optional(),
|
|
305
|
+
);
|
|
306
|
+
const McpMeta = /* @__PURE__ */ defineSchema(() =>
|
|
307
|
+
z.record(z.string().max(512), z.json()).optional(),
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
export const AttemptToolTextContent = /* @__PURE__ */ defineSchema(() =>
|
|
311
|
+
z
|
|
312
|
+
.object({
|
|
313
|
+
type: z.literal("text"),
|
|
314
|
+
text: primitives.string,
|
|
315
|
+
annotations: McpAnnotations,
|
|
316
|
+
_meta: McpMeta,
|
|
317
|
+
})
|
|
318
|
+
.loose(),
|
|
319
|
+
);
|
|
320
|
+
|
|
321
|
+
export const AttemptToolImageContent = /* @__PURE__ */ defineSchema(() =>
|
|
322
|
+
z
|
|
323
|
+
.object({
|
|
324
|
+
type: z.literal("image"),
|
|
325
|
+
data: primitives.string,
|
|
326
|
+
mimeType: z.string().min(1).max(128),
|
|
327
|
+
annotations: McpAnnotations,
|
|
328
|
+
_meta: McpMeta,
|
|
329
|
+
})
|
|
330
|
+
.loose(),
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
export const AttemptToolAudioContent = /* @__PURE__ */ defineSchema(() =>
|
|
334
|
+
z
|
|
335
|
+
.object({
|
|
336
|
+
type: z.literal("audio"),
|
|
337
|
+
data: primitives.string,
|
|
338
|
+
mimeType: z.string().min(1).max(128),
|
|
339
|
+
annotations: McpAnnotations,
|
|
340
|
+
_meta: McpMeta,
|
|
341
|
+
})
|
|
342
|
+
.loose(),
|
|
343
|
+
);
|
|
344
|
+
|
|
345
|
+
export const AttemptToolResourceLinkContent = /* @__PURE__ */ defineSchema(() =>
|
|
346
|
+
z
|
|
347
|
+
.object({
|
|
348
|
+
type: z.literal("resource_link"),
|
|
349
|
+
name: z.string().min(1).max(1_024),
|
|
350
|
+
title: z.string().max(1_024).optional(),
|
|
351
|
+
uri: z.string().min(1).max(16_384),
|
|
352
|
+
description: z.string().max(32_768).optional(),
|
|
353
|
+
mimeType: z.string().max(128).optional(),
|
|
354
|
+
size: z.number().int().nonnegative().optional(),
|
|
355
|
+
icons: z.array(AttemptToolCatalogIcon).max(16).optional(),
|
|
356
|
+
annotations: McpAnnotations,
|
|
357
|
+
_meta: McpMeta,
|
|
358
|
+
})
|
|
359
|
+
.loose(),
|
|
360
|
+
);
|
|
361
|
+
|
|
362
|
+
const AttemptToolTextResource = /* @__PURE__ */ defineSchema(() =>
|
|
363
|
+
z
|
|
364
|
+
.object({
|
|
365
|
+
uri: z.string().min(1).max(16_384),
|
|
366
|
+
mimeType: z.string().max(128).optional(),
|
|
367
|
+
text: primitives.string,
|
|
368
|
+
_meta: McpMeta,
|
|
369
|
+
})
|
|
370
|
+
.loose(),
|
|
371
|
+
);
|
|
372
|
+
|
|
373
|
+
const AttemptToolBlobResource = /* @__PURE__ */ defineSchema(() =>
|
|
374
|
+
z
|
|
375
|
+
.object({
|
|
376
|
+
uri: z.string().min(1).max(16_384),
|
|
377
|
+
mimeType: z.string().max(128).optional(),
|
|
378
|
+
blob: primitives.string,
|
|
379
|
+
_meta: McpMeta,
|
|
380
|
+
})
|
|
381
|
+
.loose(),
|
|
382
|
+
);
|
|
383
|
+
|
|
384
|
+
export const AttemptToolEmbeddedResourceContent = /* @__PURE__ */ defineSchema(() =>
|
|
385
|
+
z
|
|
386
|
+
.object({
|
|
387
|
+
type: z.literal("resource"),
|
|
388
|
+
resource: z.union([AttemptToolTextResource, AttemptToolBlobResource]),
|
|
389
|
+
annotations: McpAnnotations,
|
|
390
|
+
_meta: McpMeta,
|
|
391
|
+
})
|
|
392
|
+
.loose(),
|
|
393
|
+
);
|
|
394
|
+
|
|
395
|
+
export const AttemptToolContent = /* @__PURE__ */ defineSchema(() =>
|
|
396
|
+
z.discriminatedUnion("type", [
|
|
397
|
+
AttemptToolTextContent,
|
|
398
|
+
AttemptToolImageContent,
|
|
399
|
+
AttemptToolAudioContent,
|
|
400
|
+
AttemptToolResourceLinkContent,
|
|
401
|
+
AttemptToolEmbeddedResourceContent,
|
|
402
|
+
]),
|
|
403
|
+
);
|
|
323
404
|
export type AttemptToolContent = z.infer<typeof AttemptToolContent>;
|
|
324
405
|
|
|
325
406
|
/** Exact MCP-shaped result. No output type is fabricated when `outputSchema` is absent. */
|
|
326
|
-
export const AttemptToolResult =
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
407
|
+
export const AttemptToolResult = /* @__PURE__ */ defineSchema(() =>
|
|
408
|
+
z
|
|
409
|
+
.object({
|
|
410
|
+
content: z.array(AttemptToolContent).max(ATTEMPT_TOOL_CATALOG_MAX_CONTENT_BLOCKS),
|
|
411
|
+
structuredContent: jsonObject.optional(),
|
|
412
|
+
isError: primitives.optionalBoolean,
|
|
413
|
+
_meta: McpMeta,
|
|
414
|
+
})
|
|
415
|
+
.loose(),
|
|
416
|
+
);
|
|
334
417
|
export type AttemptToolResult = z.infer<typeof AttemptToolResult>;
|
|
335
418
|
|
|
336
419
|
export const ToolGatewayResult = AttemptToolResult;
|
|
337
420
|
export type ToolGatewayResult = AttemptToolResult;
|
|
338
421
|
|
|
339
|
-
export const ToolGatewayCallRequest =
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
.string()
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
.superRefine(requireCompleteSiteToolContext);
|
|
422
|
+
export const ToolGatewayCallRequest = /* @__PURE__ */ defineSchema(() =>
|
|
423
|
+
z
|
|
424
|
+
.object({
|
|
425
|
+
operationId: primitives.optionalUuid,
|
|
426
|
+
catalogDigest: sha256,
|
|
427
|
+
identity: ToolGatewayIdentity,
|
|
428
|
+
arguments: jsonObject,
|
|
429
|
+
/** Host-owned Site context. Publisher-controlled iframe code cannot set it. */
|
|
430
|
+
siteArtifactId: primitives.optionalUuid,
|
|
431
|
+
siteVersionId: primitives.optionalUuid,
|
|
432
|
+
/** Opaque, server-issued, single-use capability for an approval-required call. */
|
|
433
|
+
approvalToken: primitives.string.regex(/^ogta_[A-Za-z0-9_-]{43}$/u).optional(),
|
|
434
|
+
})
|
|
435
|
+
.strict()
|
|
436
|
+
.superRefine(requireCompleteSiteToolContext),
|
|
437
|
+
);
|
|
356
438
|
export type ToolGatewayCallRequest = z.infer<typeof ToolGatewayCallRequest>;
|
|
357
439
|
|
|
358
|
-
export const ToolGatewayApprovalRequest =
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
440
|
+
export const ToolGatewayApprovalRequest = /* @__PURE__ */ defineSchema(() =>
|
|
441
|
+
z
|
|
442
|
+
.object({
|
|
443
|
+
operationId: primitives.uuid,
|
|
444
|
+
catalogDigest: sha256,
|
|
445
|
+
identity: ToolGatewayIdentity,
|
|
446
|
+
arguments: jsonObject,
|
|
447
|
+
})
|
|
448
|
+
.strict(),
|
|
449
|
+
);
|
|
366
450
|
export type ToolGatewayApprovalRequest = z.infer<typeof ToolGatewayApprovalRequest>;
|
|
367
451
|
|
|
368
|
-
export const ToolGatewayApprovalResponse =
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
452
|
+
export const ToolGatewayApprovalResponse = /* @__PURE__ */ defineSchema(() =>
|
|
453
|
+
z
|
|
454
|
+
.object({
|
|
455
|
+
operationId: primitives.uuid,
|
|
456
|
+
catalogDigest: sha256,
|
|
457
|
+
identity: ToolGatewayIdentity,
|
|
458
|
+
approvalToken: primitives.string.regex(/^ogta_[A-Za-z0-9_-]{43}$/u),
|
|
459
|
+
expiresAt: primitives.string.datetime({ offset: true }),
|
|
460
|
+
})
|
|
461
|
+
.strict(),
|
|
462
|
+
);
|
|
377
463
|
export type ToolGatewayApprovalResponse = z.infer<typeof ToolGatewayApprovalResponse>;
|
|
378
464
|
|
|
379
|
-
export const ToolGatewayCallResponse =
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
465
|
+
export const ToolGatewayCallResponse = /* @__PURE__ */ defineSchema(() =>
|
|
466
|
+
z
|
|
467
|
+
.object({
|
|
468
|
+
operationId: primitives.uuid,
|
|
469
|
+
catalogDigest: sha256,
|
|
470
|
+
result: ToolGatewayResult,
|
|
471
|
+
})
|
|
472
|
+
.strict(),
|
|
473
|
+
);
|
|
386
474
|
export type ToolGatewayCallResponse = z.infer<typeof ToolGatewayCallResponse>;
|
|
387
475
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
476
|
+
/** A selector, never an authority claim. Symbolic paths use the canonical projection. */
|
|
477
|
+
export const ToolGatewayTarget = /* @__PURE__ */ defineSchema(() =>
|
|
478
|
+
z.union([
|
|
479
|
+
z.object({ identity: ToolGatewayIdentity }).strict(),
|
|
480
|
+
z.object({ path: z.array(namespaceSegment).min(2).max(8) }).strict(),
|
|
481
|
+
]),
|
|
482
|
+
);
|
|
483
|
+
export type ToolGatewayTarget = z.infer<typeof ToolGatewayTarget>;
|
|
484
|
+
|
|
485
|
+
const targetContext = {
|
|
486
|
+
siteArtifactId: primitives.optionalUuid,
|
|
487
|
+
siteVersionId: primitives.optionalUuid,
|
|
488
|
+
};
|
|
489
|
+
export const ToolGatewayResolveRequest = /* @__PURE__ */ defineSchema(() =>
|
|
490
|
+
z
|
|
491
|
+
.object({
|
|
492
|
+
target: ToolGatewayTarget,
|
|
493
|
+
...targetContext,
|
|
494
|
+
})
|
|
495
|
+
.strict()
|
|
496
|
+
.superRefine(requireCompleteSiteToolContext),
|
|
497
|
+
);
|
|
498
|
+
export type ToolGatewayResolveRequest = z.infer<typeof ToolGatewayResolveRequest>;
|
|
499
|
+
|
|
500
|
+
export const ToolGatewayResolvedTool = /* @__PURE__ */ defineSchema(() =>
|
|
501
|
+
z
|
|
502
|
+
.object({
|
|
503
|
+
version: z.literal(1),
|
|
504
|
+
definitionDigest: sha256,
|
|
505
|
+
entry: ToolGatewayCatalogEntry,
|
|
506
|
+
})
|
|
507
|
+
.strict(),
|
|
508
|
+
);
|
|
509
|
+
export type ToolGatewayResolvedTool = z.infer<typeof ToolGatewayResolvedTool>;
|
|
510
|
+
|
|
511
|
+
export const ToolGatewayInvokeRequest = /* @__PURE__ */ defineSchema(() =>
|
|
512
|
+
z
|
|
513
|
+
.object({
|
|
514
|
+
target: ToolGatewayTarget,
|
|
515
|
+
operationId: primitives.uuid,
|
|
516
|
+
arguments: jsonObject,
|
|
517
|
+
/** Omission explicitly selects the current authorized definition. */
|
|
518
|
+
expectedDefinitionDigest: sha256.optional(),
|
|
519
|
+
approvalToken: primitives.string.regex(/^ogta_[A-Za-z0-9_-]{43}$/u).optional(),
|
|
520
|
+
...targetContext,
|
|
521
|
+
})
|
|
522
|
+
.strict()
|
|
523
|
+
.superRefine(requireCompleteSiteToolContext),
|
|
524
|
+
);
|
|
525
|
+
export type ToolGatewayInvokeRequest = z.infer<typeof ToolGatewayInvokeRequest>;
|
|
526
|
+
|
|
527
|
+
export const ToolGatewayInvokeResponse = /* @__PURE__ */ defineSchema(() =>
|
|
528
|
+
z
|
|
529
|
+
.object({
|
|
530
|
+
operationId: primitives.uuid,
|
|
531
|
+
tool: ToolGatewayResolvedTool,
|
|
532
|
+
result: ToolGatewayResult,
|
|
533
|
+
})
|
|
534
|
+
.strict(),
|
|
535
|
+
);
|
|
536
|
+
export type ToolGatewayInvokeResponse = z.infer<typeof ToolGatewayInvokeResponse>;
|
|
537
|
+
|
|
538
|
+
export const ToolGatewayTargetApprovalRequest = /* @__PURE__ */ defineSchema(() =>
|
|
539
|
+
z
|
|
540
|
+
.object({
|
|
541
|
+
identity: ToolGatewayIdentity,
|
|
542
|
+
operationId: primitives.uuid,
|
|
543
|
+
arguments: jsonObject,
|
|
544
|
+
expectedDefinitionDigest: sha256,
|
|
545
|
+
/**
|
|
546
|
+
* "Always allow for this Site": this person's standing consent for this
|
|
547
|
+
* Site to run this tool on this connection. Site context only; it never
|
|
548
|
+
* changes the connection-wide permission.
|
|
549
|
+
*/
|
|
550
|
+
rememberForSite: z.boolean().optional(),
|
|
551
|
+
...targetContext,
|
|
552
|
+
})
|
|
553
|
+
.strict()
|
|
554
|
+
.superRefine(requireCompleteSiteToolContext)
|
|
555
|
+
.superRefine((value, ctx) => {
|
|
556
|
+
if (value.rememberForSite && !value.siteArtifactId)
|
|
557
|
+
ctx.addIssue({
|
|
558
|
+
code: "custom",
|
|
559
|
+
path: ["rememberForSite"],
|
|
560
|
+
message: "rememberForSite requires a Site context",
|
|
561
|
+
});
|
|
562
|
+
}),
|
|
563
|
+
);
|
|
564
|
+
export type ToolGatewayTargetApprovalRequest = z.infer<typeof ToolGatewayTargetApprovalRequest>;
|
|
565
|
+
export const ToolGatewayTargetApprovalResponse = /* @__PURE__ */ defineSchema(() =>
|
|
566
|
+
z
|
|
567
|
+
.object({
|
|
568
|
+
bindingVersion: z.literal(2),
|
|
569
|
+
operationId: primitives.uuid,
|
|
570
|
+
tool: ToolGatewayResolvedTool,
|
|
571
|
+
approvalToken: primitives.string.regex(/^ogta_[A-Za-z0-9_-]{43}$/u),
|
|
572
|
+
expiresAt: primitives.string.datetime({ offset: true }),
|
|
573
|
+
})
|
|
574
|
+
.strict(),
|
|
575
|
+
);
|
|
576
|
+
export type ToolGatewayTargetApprovalResponse = z.infer<typeof ToolGatewayTargetApprovalResponse>;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* What the Opengeni frame needs to ask a Site's viewer before a call: the
|
|
580
|
+
* viewer's own accounts that may run the declared tool, or how to connect one.
|
|
581
|
+
* Host code only; Site code never reaches this operation.
|
|
582
|
+
*/
|
|
583
|
+
export const ToolGatewaySiteConsentRequest = /* @__PURE__ */ defineSchema(() =>
|
|
584
|
+
z
|
|
585
|
+
.object({
|
|
586
|
+
identity: ToolGatewayIdentity,
|
|
587
|
+
siteArtifactId: primitives.uuid,
|
|
588
|
+
siteVersionId: primitives.uuid,
|
|
589
|
+
/**
|
|
590
|
+
* The call's exact arguments. With them, the response reviews what the
|
|
591
|
+
* call would do on the selected account, as the provider reads it.
|
|
592
|
+
*/
|
|
593
|
+
arguments: jsonObject.optional(),
|
|
594
|
+
})
|
|
595
|
+
.strict(),
|
|
596
|
+
);
|
|
597
|
+
export type ToolGatewaySiteConsentRequest = z.infer<typeof ToolGatewaySiteConsentRequest>;
|
|
598
|
+
export const ToolGatewaySiteConsentAccount = /* @__PURE__ */ defineSchema(() =>
|
|
599
|
+
z
|
|
600
|
+
.object({
|
|
601
|
+
/** The viewer's own account route for the tool. */
|
|
602
|
+
identity: ToolGatewayIdentity,
|
|
603
|
+
connector: primitives.string.max(200),
|
|
604
|
+
account: primitives.string.max(320),
|
|
605
|
+
})
|
|
606
|
+
.strict(),
|
|
607
|
+
);
|
|
608
|
+
export type ToolGatewaySiteConsentAccount = z.infer<typeof ToolGatewaySiteConsentAccount>;
|
|
609
|
+
/**
|
|
610
|
+
* The provider's own reading of the exact arguments (for Gmail, the message
|
|
611
|
+
* as it would be sent: a raw message, a draft or a reply), never the Site's
|
|
612
|
+
* description of them.
|
|
613
|
+
*/
|
|
614
|
+
export const ToolGatewaySiteConsentReview = /* @__PURE__ */ defineSchema(() =>
|
|
615
|
+
z
|
|
616
|
+
.object({
|
|
617
|
+
kind: z.enum(["generic", "gmail"]),
|
|
618
|
+
email: z
|
|
619
|
+
.object({
|
|
620
|
+
from: z.string().max(4096),
|
|
621
|
+
to: z.string().max(32768),
|
|
622
|
+
cc: z.string().max(32768),
|
|
623
|
+
bcc: z.string().max(32768),
|
|
624
|
+
subject: z.string().max(32768),
|
|
625
|
+
attachments: primitives.nonnegativeInteger,
|
|
626
|
+
})
|
|
627
|
+
.strict()
|
|
628
|
+
.optional(),
|
|
629
|
+
})
|
|
630
|
+
.strict(),
|
|
631
|
+
);
|
|
632
|
+
export type ToolGatewaySiteConsentReview = z.infer<typeof ToolGatewaySiteConsentReview>;
|
|
633
|
+
export const ToolGatewaySiteConsentResponse = /* @__PURE__ */ defineSchema(() =>
|
|
634
|
+
z
|
|
635
|
+
.object({
|
|
636
|
+
version: z.literal(1),
|
|
637
|
+
/** Empty when the tool runs without an account, or when none is connected. */
|
|
638
|
+
accounts: z.array(ToolGatewaySiteConsentAccount).max(64),
|
|
639
|
+
/** The account route the Site asked for, when it is one of `accounts`. */
|
|
640
|
+
selected: ToolGatewayIdentity.nullable(),
|
|
641
|
+
/**
|
|
642
|
+
* With `arguments`: the review on `selected` (else the first account, or
|
|
643
|
+
* the tool itself when it needs no account). Null when the provider has
|
|
644
|
+
* no review of its own for this tool.
|
|
645
|
+
*/
|
|
646
|
+
review: ToolGatewaySiteConsentReview.nullable(),
|
|
647
|
+
/** Set when the viewer must connect an account first. */
|
|
648
|
+
connect: z
|
|
649
|
+
.object({
|
|
650
|
+
capabilityId: primitives.string.max(200).nullable(),
|
|
651
|
+
name: primitives.string.max(200),
|
|
652
|
+
providerDomain: primitives.string.max(200),
|
|
653
|
+
})
|
|
654
|
+
.strict()
|
|
655
|
+
.nullable(),
|
|
656
|
+
})
|
|
657
|
+
.strict(),
|
|
658
|
+
);
|
|
659
|
+
export type ToolGatewaySiteConsentResponse = z.infer<typeof ToolGatewaySiteConsentResponse>;
|
|
660
|
+
|
|
661
|
+
/** Bounded compatibility manifest, not workspace discovery. */
|
|
662
|
+
export const ToolGatewayManifestRequest = /* @__PURE__ */ defineSchema(() =>
|
|
663
|
+
z
|
|
664
|
+
.object({
|
|
665
|
+
identities: z.array(ToolGatewayIdentity).max(256),
|
|
666
|
+
...targetContext,
|
|
667
|
+
})
|
|
668
|
+
.strict()
|
|
669
|
+
.superRefine(requireCompleteSiteToolContext),
|
|
670
|
+
);
|
|
671
|
+
export type ToolGatewayManifestRequest = z.infer<typeof ToolGatewayManifestRequest>;
|
|
672
|
+
export const ToolGatewayManifestResponse = /* @__PURE__ */ defineSchema(() =>
|
|
673
|
+
z
|
|
674
|
+
.object({
|
|
675
|
+
version: z.literal(1),
|
|
676
|
+
digest: sha256,
|
|
677
|
+
tools: z.array(ToolGatewayResolvedTool).max(256),
|
|
678
|
+
})
|
|
679
|
+
.strict(),
|
|
680
|
+
);
|
|
681
|
+
export type ToolGatewayManifestResponse = z.infer<typeof ToolGatewayManifestResponse>;
|
|
682
|
+
|
|
683
|
+
export const ToolGatewayDeclarationsResponse = /* @__PURE__ */ defineSchema(() =>
|
|
684
|
+
z
|
|
685
|
+
.object({
|
|
686
|
+
catalogDigest: sha256,
|
|
687
|
+
moduleSpecifier: z.string().min(1).max(512),
|
|
688
|
+
source: primitives.string.max(16 * 1024 * 1024),
|
|
689
|
+
})
|
|
690
|
+
.strict(),
|
|
691
|
+
);
|
|
395
692
|
export type ToolGatewayDeclarationsResponse = z.infer<typeof ToolGatewayDeclarationsResponse>;
|
|
396
693
|
|
|
397
694
|
function requireCompleteSiteToolContext(
|
|
@@ -406,14 +703,17 @@ function requireCompleteSiteToolContext(
|
|
|
406
703
|
});
|
|
407
704
|
}
|
|
408
705
|
|
|
409
|
-
export const CodemodeOperationState =
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
706
|
+
export const CodemodeOperationState = /* @__PURE__ */ defineSchema(() =>
|
|
707
|
+
z.enum([
|
|
708
|
+
"queued",
|
|
709
|
+
"waiting_for_approval",
|
|
710
|
+
"running",
|
|
711
|
+
"completed",
|
|
712
|
+
"failed",
|
|
713
|
+
"outcome_unknown",
|
|
714
|
+
"cancelled",
|
|
715
|
+
]),
|
|
716
|
+
);
|
|
417
717
|
export type CodemodeOperationState = z.infer<typeof CodemodeOperationState>;
|
|
418
718
|
|
|
419
719
|
/**
|
|
@@ -421,69 +721,84 @@ export type CodemodeOperationState = z.infer<typeof CodemodeOperationState>;
|
|
|
421
721
|
* idempotency key to one exact call; callers may safely poll/retry the same
|
|
422
722
|
* operation id but may never repurpose it.
|
|
423
723
|
*/
|
|
424
|
-
export const CodemodeOperation =
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
724
|
+
export const CodemodeOperation = /* @__PURE__ */ defineSchema(() =>
|
|
725
|
+
z
|
|
726
|
+
.object({
|
|
727
|
+
version: z.literal(CODEMODE_OPERATION_VERSION),
|
|
728
|
+
operationId: primitives.uuid,
|
|
729
|
+
accountId: primitives.uuid,
|
|
730
|
+
workspaceId: primitives.uuid,
|
|
731
|
+
sessionId: primitives.uuid,
|
|
732
|
+
turnId: primitives.uuid,
|
|
733
|
+
attemptId: primitives.uuid,
|
|
734
|
+
executionGeneration: primitives.positiveInteger,
|
|
735
|
+
catalogDigest: sha256,
|
|
736
|
+
requestDigest: sha256,
|
|
737
|
+
identity: AttemptToolIdentity,
|
|
738
|
+
arguments: jsonObject,
|
|
739
|
+
caller: AttemptToolCaller.refine((caller) => caller.kind === "codemode", {
|
|
740
|
+
message: "Codemode operation caller must be codemode",
|
|
741
|
+
}),
|
|
742
|
+
state: CodemodeOperationState,
|
|
743
|
+
/** Present only for clients that acknowledged durable approval continuation. */
|
|
744
|
+
durableApproval: z.literal(true).optional(),
|
|
745
|
+
approvalRequestId: primitives.optionalUuid,
|
|
746
|
+
result: AttemptToolResult.nullable(),
|
|
747
|
+
errorCode: z.string().min(1).max(128).nullable(),
|
|
748
|
+
errorMessage: z.string().min(1).max(4_096).nullable(),
|
|
749
|
+
createdAt: primitives.string.datetime({ offset: true }),
|
|
750
|
+
claimedAt: primitives.string.datetime({ offset: true }).nullable(),
|
|
751
|
+
executionStartedAt: primitives.string.datetime({ offset: true }).nullable(),
|
|
752
|
+
completedAt: primitives.string.datetime({ offset: true }).nullable(),
|
|
753
|
+
updatedAt: primitives.string.datetime({ offset: true }),
|
|
754
|
+
})
|
|
755
|
+
.strict(),
|
|
756
|
+
);
|
|
452
757
|
export type CodemodeOperation = z.infer<typeof CodemodeOperation>;
|
|
453
758
|
|
|
454
|
-
export const CodemodeCallRequest =
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
759
|
+
export const CodemodeCallRequest = /* @__PURE__ */ defineSchema(() =>
|
|
760
|
+
z
|
|
761
|
+
.object({
|
|
762
|
+
/** Opt-in transport capability, never permission to execute. */
|
|
763
|
+
durableApproval: z.literal(true).optional(),
|
|
764
|
+
operationId: primitives.uuid,
|
|
765
|
+
catalogDigest: sha256,
|
|
766
|
+
identity: AttemptToolIdentity,
|
|
767
|
+
arguments: jsonObject,
|
|
768
|
+
})
|
|
769
|
+
.strict(),
|
|
770
|
+
);
|
|
462
771
|
export type CodemodeCallRequest = z.infer<typeof CodemodeCallRequest>;
|
|
463
772
|
|
|
464
|
-
export const CodemodeCallSubmission =
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
773
|
+
export const CodemodeCallSubmission = /* @__PURE__ */ defineSchema(() =>
|
|
774
|
+
z
|
|
775
|
+
.object({
|
|
776
|
+
operation: CodemodeOperation,
|
|
777
|
+
dispatch: z.enum(["accepted", "already_running", "terminal", "unavailable", "rejected"]),
|
|
778
|
+
})
|
|
779
|
+
.strict(),
|
|
780
|
+
);
|
|
470
781
|
export type CodemodeCallSubmission = z.infer<typeof CodemodeCallSubmission>;
|
|
471
782
|
|
|
472
783
|
/** Tiny NATS wake-up. Postgres, never the broker payload, is durable truth. */
|
|
473
|
-
export const CodemodeDispatchRequest =
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
784
|
+
export const CodemodeDispatchRequest = /* @__PURE__ */ defineSchema(() =>
|
|
785
|
+
z
|
|
786
|
+
.object({
|
|
787
|
+
version: z.literal(CODEMODE_OPERATION_VERSION),
|
|
788
|
+
operationId: primitives.uuid,
|
|
789
|
+
catalogDigest: sha256,
|
|
790
|
+
})
|
|
791
|
+
.strict(),
|
|
792
|
+
);
|
|
480
793
|
export type CodemodeDispatchRequest = z.infer<typeof CodemodeDispatchRequest>;
|
|
481
794
|
|
|
482
|
-
export const CodemodeDispatchAck =
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
795
|
+
export const CodemodeDispatchAck = /* @__PURE__ */ defineSchema(() =>
|
|
796
|
+
z
|
|
797
|
+
.object({
|
|
798
|
+
version: z.literal(CODEMODE_OPERATION_VERSION),
|
|
799
|
+
operationId: primitives.uuid,
|
|
800
|
+
status: z.enum(["accepted", "already_running", "terminal", "unavailable", "rejected"]),
|
|
801
|
+
})
|
|
802
|
+
.strict(),
|
|
803
|
+
);
|
|
489
804
|
export type CodemodeDispatchAck = z.infer<typeof CodemodeDispatchAck>;
|