@opengeni/contracts 3.1.0-canary.2 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-authored-durable-text.d.ts +9 -9
- package/dist/agent-config.d.ts +971 -0
- package/dist/agent-instruction-changes.d.ts +0 -2
- package/dist/allowance-refusal.d.ts +9 -0
- package/dist/allowance-refusal.js +50 -0
- package/dist/allowance-refusal.js.map +1 -0
- package/dist/analytics-consent-report.d.ts +19 -0
- package/dist/analytics-consent-report.js +10 -0
- package/dist/analytics-consent-report.js.map +1 -0
- package/dist/api-key-presets.d.ts +19 -0
- package/dist/artifact-catalog.d.ts +188 -0
- package/dist/artifacts.d.ts +86 -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.d.ts +1 -0
- package/dist/atlassian.js +34 -19
- package/dist/browser-storage.d.ts +5 -0
- package/dist/browser-storage.js +9 -0
- package/dist/browser-storage.js.map +1 -0
- package/dist/bundled-skills.d.ts +24 -1
- package/dist/canonical-human-identities.js +2 -1
- package/dist/chunk-2ZIHHL72.js +153 -0
- package/dist/chunk-2ZIHHL72.js.map +1 -0
- package/dist/{chunk-5LYFSZ7O.js → chunk-352X6ENP.js} +31 -31
- package/dist/chunk-4JGHSSB7.js +11 -0
- package/dist/chunk-4JGHSSB7.js.map +1 -0
- package/dist/chunk-4QO6GJUX.js +85 -0
- package/dist/chunk-4QO6GJUX.js.map +1 -0
- package/dist/chunk-4VDMHLLL.js +49 -0
- package/dist/chunk-4VDMHLLL.js.map +1 -0
- package/dist/chunk-56SNIMDO.js +9 -0
- package/dist/chunk-56SNIMDO.js.map +1 -0
- package/dist/chunk-6C2HKFTU.js +207 -0
- package/dist/chunk-6C2HKFTU.js.map +1 -0
- package/dist/chunk-6IXO76Z6.js +72 -0
- package/dist/chunk-6IXO76Z6.js.map +1 -0
- package/dist/chunk-7272KVWZ.js +60 -0
- package/dist/chunk-7272KVWZ.js.map +1 -0
- package/dist/{chunk-7ABONTXE.js → chunk-E3GGUBHS.js} +49 -5
- package/dist/chunk-E3GGUBHS.js.map +1 -0
- package/dist/chunk-EFZYKUE2.js +767 -0
- package/dist/chunk-EFZYKUE2.js.map +1 -0
- package/dist/chunk-EKWNTOG3.js +154 -0
- package/dist/chunk-EKWNTOG3.js.map +1 -0
- package/dist/chunk-HABQ7ADB.js +234 -0
- package/dist/chunk-HABQ7ADB.js.map +1 -0
- package/dist/chunk-HRRU4QPI.js +91 -0
- package/dist/chunk-HRRU4QPI.js.map +1 -0
- package/dist/{chunk-3SIZGL3O.js → chunk-IK36LXKC.js} +18 -2
- package/dist/chunk-IK36LXKC.js.map +1 -0
- package/dist/{chunk-TXTQIYCV.js → chunk-ILJ72KPO.js} +56 -3
- package/dist/chunk-ILJ72KPO.js.map +1 -0
- package/dist/chunk-J4HQ3UKY.js +93 -0
- package/dist/chunk-J4HQ3UKY.js.map +1 -0
- package/dist/chunk-KHHZTBP7.js +11 -0
- package/dist/chunk-KHHZTBP7.js.map +1 -0
- package/dist/{chunk-WYBDERIY.js → chunk-LZ2LAHIX.js} +47 -41
- package/dist/chunk-LZ2LAHIX.js.map +1 -0
- package/dist/chunk-NDZHPTCL.js +400 -0
- package/dist/chunk-NDZHPTCL.js.map +1 -0
- package/dist/chunk-OF6OKOBF.js +54793 -0
- package/dist/chunk-OF6OKOBF.js.map +1 -0
- package/dist/chunk-OL23ARTF.js +94 -0
- package/dist/chunk-OL23ARTF.js.map +1 -0
- package/dist/chunk-PUIUXIOL.js +189 -0
- package/dist/chunk-PUIUXIOL.js.map +1 -0
- package/dist/{chunk-Y3KNXVTD.js → chunk-RMWXDZEO.js} +128 -21
- package/dist/chunk-RMWXDZEO.js.map +1 -0
- package/dist/{chunk-MRWYRAS5.js → chunk-SHO4YO4B.js} +27 -35
- package/dist/chunk-SHO4YO4B.js.map +1 -0
- package/dist/chunk-SWRN2DJ3.js +153 -0
- package/dist/chunk-SWRN2DJ3.js.map +1 -0
- package/dist/chunk-TCXCRBPF.js +267 -0
- package/dist/chunk-TCXCRBPF.js.map +1 -0
- package/dist/chunk-TLU3UEMD.js +324 -0
- package/dist/chunk-TLU3UEMD.js.map +1 -0
- package/dist/chunk-TSWWZMUS.js +186 -0
- package/dist/chunk-TSWWZMUS.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-XDLAGX66.js +127 -0
- package/dist/chunk-XDLAGX66.js.map +1 -0
- package/dist/chunk-YKZ4WU4P.js +33 -0
- package/dist/chunk-YKZ4WU4P.js.map +1 -0
- package/dist/{chunk-O5LEQHDM.js → chunk-Z7WEVGCL.js} +3 -3
- package/dist/{chunk-YBW5JSA3.js → chunk-ZDCRWCGZ.js} +119 -101
- package/dist/chunk-ZDCRWCGZ.js.map +1 -0
- package/dist/claude-provider-account-authority.d.ts +18 -0
- package/dist/claude-subscription-oauth.d.ts +42 -0
- package/dist/claude-subscription-usage.d.ts +159 -0
- package/dist/client-error-report.d.ts +158 -0
- package/dist/client-error-report.js +164 -0
- package/dist/client-error-report.js.map +1 -0
- package/dist/code-search.d.ts +52 -0
- package/dist/code-search.js +40 -0
- package/dist/code-search.js.map +1 -0
- package/dist/codex-provider-account-authority.js +20 -12
- package/dist/codex-provider-account-authority.js.map +1 -1
- package/dist/company-profile.d.ts +144 -6
- package/dist/connect.d.ts +37 -0
- package/dist/connect.js +216 -159
- package/dist/connect.js.map +1 -1
- package/dist/connection-account-label.d.ts +2 -0
- package/dist/connection-account-label.js +35 -0
- package/dist/connection-account-label.js.map +1 -0
- package/dist/connection-authority.d.ts +9 -317
- package/dist/connection-authority.js +37 -42
- package/dist/connector-attachments.js +2 -1
- package/dist/connector-destinations.js +2 -1
- package/dist/connector-tool-permissions.d.ts +137 -0
- package/dist/cua-desktop-tools.d.ts +17 -0
- package/dist/define-schema.d.ts +8 -0
- package/dist/direct-model-provider.d.ts +36 -0
- package/dist/editable-artifact-codec-registry.js +5 -5
- package/dist/editable-artifact-committed-transaction.js +3 -2
- package/dist/editable-artifact-live.js +5 -5
- package/dist/editable-artifact-serialized-commit.js +6 -6
- package/dist/editable-artifact-versions.d.ts +7 -1
- package/dist/editable-artifact-versions.js +1 -1
- package/dist/editable-artifacts.js +62 -56
- package/dist/event-preview.d.ts +22 -0
- package/dist/external-identities.d.ts +138 -0
- package/dist/external-identities.js +9 -4
- package/dist/first-party-tool-authorization.d.ts +815 -0
- package/dist/github-repository-contracts.js +60 -43
- package/dist/github-repository-contracts.js.map +1 -1
- package/dist/google-drive.d.ts +2 -1
- package/dist/google-drive.js +305 -238
- package/dist/google-drive.js.map +1 -1
- package/dist/host-mcp-bindings.d.ts +5 -0
- package/dist/host-mcp-bindings.js +233 -170
- package/dist/host-mcp-bindings.js.map +1 -1
- package/dist/image-generation.d.ts +1 -0
- package/dist/index.d.ts +16761 -5946
- package/dist/index.js +1973 -260
- package/dist/insights-usage.d.ts +877 -0
- package/dist/insights-usage.js +559 -0
- package/dist/insights-usage.js.map +1 -0
- package/dist/interaction.d.ts +1176 -829
- package/dist/knowledge-entries.d.ts +81 -2
- package/dist/knowledge-preparation.d.ts +239 -0
- package/dist/managed-auth-session-sets.d.ts +7 -0
- package/dist/managed-auth-session-sets.js +198 -132
- package/dist/managed-auth-session-sets.js.map +1 -1
- package/dist/managed-sign-in-methods.d.ts +56 -0
- package/dist/managed-sign-in-methods.js +64 -0
- package/dist/managed-sign-in-methods.js.map +1 -0
- package/dist/mcp-catalog-limits.d.ts +2 -0
- package/dist/mcp-oauth.d.ts +2 -2
- package/dist/mcp-structured-content.d.ts +25 -0
- package/dist/modal-native-proof-v2.d.ts +587 -0
- package/dist/modal-native-proof-v2.js +38 -0
- package/dist/modal-native-proof-v2.js.map +1 -0
- package/dist/model-account-choice.d.ts +235 -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 +98 -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.d.ts +3 -1
- package/dist/model-picker-order.js +3 -0
- package/dist/model-picker-order.js.map +1 -1
- package/dist/organization-access.d.ts +412 -0
- package/dist/organization-access.js +39 -0
- package/dist/organization-access.js.map +1 -0
- package/dist/organization-integration-policy.d.ts +27 -0
- package/dist/organization-membership-lifecycle.d.ts +38 -0
- package/dist/organization-model-usage.d.ts +146 -0
- package/dist/organization-model-usage.js +78 -0
- package/dist/organization-model-usage.js.map +1 -0
- package/dist/organization-recovery.js +2 -1
- package/dist/organization-usage.d.ts +138 -0
- package/dist/permissions.d.ts +18 -0
- package/dist/personal-github.d.ts +1 -0
- package/dist/personal-github.js +199 -144
- package/dist/personal-github.js.map +1 -1
- package/dist/prepared-mcp-setup.d.ts +54 -0
- package/dist/prepared-mcp-setup.js +12 -0
- package/dist/prepared-mcp-setup.js.map +1 -0
- package/dist/product-analytics.d.ts +116 -0
- package/dist/product-lifecycle-facts.d.ts +73 -0
- package/dist/remember.d.ts +98 -6
- package/dist/retained-output.d.ts +8 -0
- package/dist/sandbox-file-artifacts.d.ts +1 -0
- package/dist/sandbox-provider-command.d.ts +91 -1
- package/dist/sandbox-recovery.d.ts +146 -0
- package/dist/secret-generator.d.ts +44 -0
- package/dist/secret-references.d.ts +90 -0
- package/dist/secret-resolution.d.ts +111 -0
- package/dist/secret-totp.d.ts +41 -0
- package/dist/session-final-reply.d.ts +6 -0
- package/dist/session-final-reply.js +9 -0
- package/dist/session-final-reply.js.map +1 -0
- package/dist/session-goal-reports.d.ts +21 -0
- package/dist/session-history-import.d.ts +1272 -0
- package/dist/session-list-entries.d.ts +4 -0
- package/dist/session-list-entries.js +56 -0
- package/dist/session-list-entries.js.map +1 -0
- package/dist/session-mcp-projections.d.ts +6 -0
- package/dist/session-mcp-tool-permissions.d.ts +62 -0
- package/dist/session-message-search.d.ts +68 -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 +41 -0
- package/dist/session-usage-limits.js.map +1 -0
- package/dist/signup-attribution.d.ts +39 -0
- package/dist/site-data.d.ts +286 -0
- package/dist/site-operations.d.ts +39 -0
- package/dist/site-publishing.d.ts +778 -0
- package/dist/site-session-http.d.ts +89 -4
- package/dist/site-session-http.js +25 -1
- package/dist/site-sql.d.ts +421 -0
- package/dist/skill-catalog-context.d.ts +7 -0
- package/dist/skill-files.d.ts +1 -1
- package/dist/skill-use.d.ts +61 -0
- package/dist/skills.d.ts +15 -0
- package/dist/slack-bot-scopes.d.ts +17 -12
- package/dist/slack-bot-scopes.js +10 -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 +8 -2
- package/dist/spreadsheet-artifact-query.d.ts +13 -6
- package/dist/spreadsheet-artifact-query.js +3 -3
- package/dist/subscription-account-actions.d.ts +64 -0
- package/dist/subscription-account-pools.d.ts +292 -0
- package/dist/subscription-personal-authority-v2.d.ts +28 -0
- package/dist/subscription-personal-authority-v2.js +12 -0
- package/dist/subscription-personal-authority-v2.js.map +1 -0
- package/dist/tool-action-review.d.ts +132 -0
- package/dist/tool-catalog.d.ts +408 -0
- package/dist/tool-policy.d.ts +5 -0
- package/dist/tool-review-presentation.d.ts +12 -0
- package/dist/tool-review-presentation.js +17 -0
- package/dist/tool-review-presentation.js.map +1 -0
- package/dist/transcription-recordings.d.ts +21 -0
- package/dist/turn-serving-policy.d.ts +221 -0
- package/dist/usage-allowances.d.ts +314 -0
- package/dist/usage-allowances.js +52 -0
- package/dist/usage-allowances.js.map +1 -0
- package/dist/vaults.d.ts +1286 -0
- package/dist/video-generation.d.ts +3 -0
- package/dist/video-generation.js +2 -1
- package/dist/workspace-integration-wire.d.ts +36 -0
- package/dist/workspace-integration-wire.js +23 -0
- package/dist/workspace-integration-wire.js.map +1 -0
- package/dist/workspace-integrations.d.ts +1028 -0
- package/dist/xai-provider-account-authority.js +2 -1
- package/package.json +93 -5
- package/src/agent-authored-durable-text.ts +14 -11
- package/src/agent-config.ts +1698 -0
- package/src/agent-instruction-changes.ts +91 -74
- package/src/agent-learning.ts +94 -67
- package/src/agent-topology.ts +57 -52
- package/src/allowance-refusal.ts +81 -0
- package/src/analytics-consent-report.ts +20 -0
- package/src/api-key-presets.ts +28 -0
- package/src/artifact-catalog.ts +82 -0
- package/src/artifacts.ts +299 -227
- package/src/atlassian-native-retirement.ts +33 -0
- package/src/atlassian.ts +135 -108
- package/src/browser-storage.ts +10 -0
- package/src/bundled-skills.ts +60 -17
- package/src/canonical-human-identities.ts +60 -58
- package/src/claude-provider-account-authority.ts +12 -0
- package/src/claude-subscription-oauth.ts +73 -0
- package/src/claude-subscription-usage.ts +68 -0
- package/src/client-error-report.ts +343 -0
- package/src/code-search.ts +105 -0
- package/src/codex-provider-account-authority.ts +21 -16
- package/src/company-brain-governed-writes.ts +255 -233
- package/src/company-brain.ts +164 -153
- package/src/company-profile.ts +365 -292
- package/src/connect.ts +212 -173
- package/src/connection-account-label.ts +46 -0
- package/src/connection-authority.ts +183 -364
- package/src/connector-attachments.ts +137 -122
- package/src/connector-destinations.ts +46 -42
- package/src/connector-tool-permissions.ts +117 -0
- package/src/cua-desktop-tools.gen.json +6512 -0
- package/src/cua-desktop-tools.linux.gen.json +6600 -0
- package/src/cua-desktop-tools.ts +36 -0
- package/src/cua-desktop-tools.windows.gen.json +6353 -0
- package/src/define-schema.ts +10 -0
- package/src/direct-model-provider.ts +108 -0
- package/src/editable-artifact-committed-transaction.ts +17 -0
- package/src/editable-artifact-versions.ts +7 -1
- package/src/event-preview.ts +53 -3
- package/src/external-identities.ts +249 -176
- package/src/feedback.ts +43 -30
- package/src/first-party-tool-authorization.ts +356 -0
- package/src/github-repository-contracts.ts +78 -64
- package/src/google-drive.ts +285 -234
- package/src/governed-learning-activation.ts +152 -131
- package/src/governed-learning-evaluator.ts +140 -133
- package/src/host-mcp-bindings.ts +252 -198
- package/src/image-generation.ts +104 -95
- package/src/index.ts +13235 -8687
- package/src/insights-usage.ts +727 -0
- package/src/interaction.ts +3070 -2326
- package/src/knowledge-entries.ts +361 -276
- package/src/knowledge-preparation.ts +57 -0
- package/src/knowledge.ts +246 -213
- package/src/managed-auth-session-sets.ts +220 -144
- package/src/managed-sign-in-methods.ts +52 -0
- package/src/mcp-catalog-limits.ts +2 -0
- package/src/mcp-oauth.ts +43 -34
- package/src/mcp-receipts.ts +192 -192
- package/src/mcp-structured-content.ts +81 -0
- package/src/memory-slack-delivery.ts +171 -142
- package/src/modal-native-proof-v2.ts +429 -0
- package/src/model-account-choice.ts +177 -0
- package/src/model-account-settings.ts +210 -0
- package/src/model-availability.ts +22 -0
- package/src/model-connection-access.ts +61 -14
- package/src/model-context-inspector.ts +133 -99
- package/src/model-display.ts +221 -0
- package/src/model-picker-order.ts +12 -1
- package/src/organization-access.ts +217 -0
- package/src/organization-integration-policy.ts +63 -0
- package/src/organization-membership-lifecycle.ts +528 -382
- package/src/organization-model-usage.ts +81 -0
- package/src/organization-recovery.ts +147 -135
- package/src/organization-usage.ts +94 -0
- package/src/permissions.ts +88 -52
- package/src/personal-github.ts +210 -171
- package/src/preference-registry.ts +314 -258
- package/src/prepared-mcp-setup.ts +189 -0
- package/src/product-analytics.ts +261 -0
- package/src/product-lifecycle-facts.ts +122 -0
- package/src/remember.ts +181 -167
- package/src/retained-output.ts +194 -165
- package/src/sandbox-file-artifacts.ts +60 -47
- package/src/sandbox-provider-command.ts +88 -20
- package/src/sandbox-recovery.ts +129 -0
- package/src/scoped-knowledge.ts +61 -43
- package/src/secret-generator.ts +155 -0
- package/src/secret-references.ts +414 -0
- package/src/secret-resolution.ts +274 -0
- package/src/secret-totp.ts +188 -0
- package/src/session-final-reply.ts +16 -0
- package/src/session-goal-reports.ts +64 -0
- package/src/session-history-import.ts +177 -0
- package/src/session-list-entries.ts +96 -0
- package/src/session-mcp-projections.ts +11 -0
- package/src/session-mcp-tool-permissions.ts +108 -0
- package/src/session-message-search.ts +61 -0
- package/src/session-target.ts +57 -0
- package/src/session-titles.ts +80 -10
- package/src/session-topology-primitives.ts +19 -12
- package/src/session-usage-limit-refusal.ts +101 -0
- package/src/session-usage-limits.ts +171 -0
- package/src/signup-attribution.ts +86 -0
- package/src/site-data.ts +339 -0
- package/src/site-operations.ts +154 -0
- package/src/site-publishing.ts +876 -0
- package/src/site-session-http.ts +294 -16
- package/src/site-sql.ts +1123 -0
- package/src/skill-catalog-context.ts +50 -0
- package/src/skill-files.ts +3 -3
- package/src/skill-use.ts +80 -0
- package/src/skills.ts +82 -54
- package/src/slack-bot-scopes.ts +31 -39
- package/src/slack-rest-mcp.ts +222 -0
- package/src/slack-task-policy.ts +96 -73
- package/src/spreadsheet-artifact-commands.ts +73 -2
- package/src/spreadsheet-artifact-query.ts +187 -39
- package/src/subscription-account-actions.ts +84 -0
- package/src/subscription-account-pools.ts +53 -0
- package/src/subscription-personal-authority-v2.ts +66 -0
- package/src/task-notes.ts +55 -51
- package/src/tool-action-review.ts +258 -0
- package/src/tool-catalog.ts +609 -372
- package/src/tool-policy.ts +82 -0
- package/src/tool-result-spill.ts +12 -9
- package/src/tool-review-presentation.ts +385 -0
- package/src/transcription-recordings.ts +145 -131
- package/src/turn-serving-policy.ts +166 -0
- package/src/usage-allowances.ts +248 -0
- package/src/vaults.ts +850 -0
- package/src/video-generation.ts +385 -360
- package/src/work-claims.ts +173 -149
- package/src/workspace-instruction-policies.ts +349 -276
- package/src/workspace-integration-wire.ts +101 -0
- package/src/workspace-integrations.ts +724 -0
- package/src/workspace-learning-administration.ts +57 -44
- package/src/workspace-learning-policy.ts +127 -96
- package/src/workspace-state.ts +250 -220
- package/src/xai-provider-account-authority.ts +22 -17
- package/dist/chunk-2AC63F4S.js +0 -171
- package/dist/chunk-2AC63F4S.js.map +0 -1
- package/dist/chunk-3SIZGL3O.js.map +0 -1
- package/dist/chunk-7ABONTXE.js.map +0 -1
- package/dist/chunk-BCS7WHCK.js +0 -139
- package/dist/chunk-BCS7WHCK.js.map +0 -1
- package/dist/chunk-GRG7PHWQ.js +0 -25
- package/dist/chunk-GRG7PHWQ.js.map +0 -1
- package/dist/chunk-JUFK3T4Q.js +0 -80
- package/dist/chunk-JUFK3T4Q.js.map +0 -1
- package/dist/chunk-M5ZGRVIQ.js +0 -719
- package/dist/chunk-M5ZGRVIQ.js.map +0 -1
- package/dist/chunk-MRWYRAS5.js.map +0 -1
- package/dist/chunk-OVFORMPW.js +0 -348
- package/dist/chunk-OVFORMPW.js.map +0 -1
- package/dist/chunk-P3HLDT77.js +0 -59
- package/dist/chunk-P3HLDT77.js.map +0 -1
- package/dist/chunk-QQUJ6NPW.js +0 -23093
- package/dist/chunk-QQUJ6NPW.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/host-mcp-resolvers.d.ts +0 -32
- package/dist/host-mcp-resolvers.js +0 -34
- package/dist/host-mcp-resolvers.js.map +0 -1
- package/src/host-mcp-resolvers.ts +0 -50
- /package/dist/{chunk-5LYFSZ7O.js.map → chunk-352X6ENP.js.map} +0 -0
- /package/dist/{chunk-O5LEQHDM.js.map → chunk-Z7WEVGCL.js.map} +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { Permission } from "./permissions";
|
|
3
4
|
|
|
@@ -24,234 +25,306 @@ function opaqueText(maxBytes: number) {
|
|
|
24
25
|
}
|
|
25
26
|
const externalId = opaqueText(1024);
|
|
26
27
|
const source = opaqueText(200);
|
|
27
|
-
const externalSubject =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
const externalSubject = /* @__PURE__ */ defineSchema(() =>
|
|
29
|
+
z
|
|
30
|
+
.string()
|
|
31
|
+
.regex(
|
|
32
|
+
/^external_user:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$(?![\s\S])/,
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
const nativeSubject = /* @__PURE__ */ defineSchema(() =>
|
|
36
|
+
z
|
|
37
|
+
.string()
|
|
38
|
+
.min(1)
|
|
39
|
+
.max(1024)
|
|
40
|
+
.regex(/^user:[^\r\n]+$(?![\s\S])/),
|
|
41
|
+
);
|
|
42
|
+
export const ExternalIdentityReference = /* @__PURE__ */ defineSchema(() =>
|
|
43
|
+
z
|
|
44
|
+
.object({
|
|
45
|
+
externalId,
|
|
46
|
+
source: source.default("default"),
|
|
47
|
+
})
|
|
48
|
+
.strict(),
|
|
49
|
+
);
|
|
41
50
|
export type ExternalIdentityReference = z.infer<typeof ExternalIdentityReference>;
|
|
42
51
|
|
|
43
|
-
export const AddExternalWorkspaceMemberRequest =
|
|
44
|
-
.object({
|
|
45
|
-
identity: ExternalIdentityReference,
|
|
46
|
-
permissions: z.array(Permission).min(1).max(Permission.options.length),
|
|
47
|
-
/** Opt-in durable operation identity; unkeyed legacy requests are not cancellable. */
|
|
48
|
-
operationId: z.string().uuid().optional(),
|
|
49
|
-
})
|
|
50
|
-
.strict();
|
|
51
|
-
export type AddExternalWorkspaceMemberRequest = z.infer<typeof AddExternalWorkspaceMemberRequest>;
|
|
52
|
-
|
|
53
|
-
/** Content-free service lookup, including identities which can no longer act. */
|
|
54
|
-
export const ExternalIdentityLookup = z.discriminatedUnion("found", [
|
|
55
|
-
z.object({ found: z.literal(false) }).strict(),
|
|
52
|
+
export const AddExternalWorkspaceMemberRequest = /* @__PURE__ */ defineSchema(() =>
|
|
56
53
|
z
|
|
57
54
|
.object({
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
identityAuthorizationRevision: z.number().int().positive().safe(),
|
|
63
|
-
membershipStatus: z.enum(["provisioning", "active", "suspended", "revoked"]),
|
|
64
|
-
membershipAuthorizationRevision: z.number().int().positive().safe(),
|
|
55
|
+
identity: ExternalIdentityReference,
|
|
56
|
+
permissions: z.array(Permission).min(1).max(Permission.options.length),
|
|
57
|
+
/** Opt-in durable operation identity; unkeyed legacy requests are not cancellable. */
|
|
58
|
+
operationId: z.string().uuid().optional(),
|
|
65
59
|
})
|
|
66
60
|
.strict(),
|
|
67
|
-
|
|
61
|
+
);
|
|
62
|
+
export type AddExternalWorkspaceMemberRequest = z.infer<typeof AddExternalWorkspaceMemberRequest>;
|
|
63
|
+
|
|
64
|
+
/** Content-free service lookup, including identities which can no longer act. */
|
|
65
|
+
export const ExternalIdentityLookup = /* @__PURE__ */ defineSchema(() =>
|
|
66
|
+
z.discriminatedUnion("found", [
|
|
67
|
+
z.object({ found: z.literal(false) }).strict(),
|
|
68
|
+
z
|
|
69
|
+
.object({
|
|
70
|
+
found: z.literal(true),
|
|
71
|
+
subjectId: externalSubject,
|
|
72
|
+
organizationMembershipId: z.string().uuid(),
|
|
73
|
+
identityStatus: z.enum(["active", "disabled", "revoked"]),
|
|
74
|
+
identityAuthorizationRevision: z.number().int().positive().safe(),
|
|
75
|
+
membershipStatus: z.enum(["provisioning", "active", "suspended", "revoked"]),
|
|
76
|
+
membershipAuthorizationRevision: z.number().int().positive().safe(),
|
|
77
|
+
})
|
|
78
|
+
.strict(),
|
|
79
|
+
]),
|
|
80
|
+
);
|
|
68
81
|
export type ExternalIdentityLookup = z.infer<typeof ExternalIdentityLookup>;
|
|
69
82
|
|
|
70
83
|
/** Terminal withdrawal of this external member's workspace access, also fencing
|
|
71
84
|
* an exact earlier onboarding operation whether or not it has reached the API. */
|
|
72
|
-
export const CancelExternalWorkspaceMemberGrantRequest =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
export const CancelExternalWorkspaceMemberGrantRequest = /* @__PURE__ */ defineSchema(() =>
|
|
86
|
+
z
|
|
87
|
+
.object({
|
|
88
|
+
operationId: z.string().uuid(),
|
|
89
|
+
cancelGrantOperationId: z.string().uuid(),
|
|
90
|
+
})
|
|
91
|
+
.strict()
|
|
92
|
+
.refine((value) => value.operationId !== value.cancelGrantOperationId, {
|
|
93
|
+
message: "Revocation and grant must use different operation identities",
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
81
96
|
export type CancelExternalWorkspaceMemberGrantRequest = z.infer<
|
|
82
97
|
typeof CancelExternalWorkspaceMemberGrantRequest
|
|
83
98
|
>;
|
|
84
|
-
export const CancelExternalWorkspaceMemberGrantResponse =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
99
|
+
export const CancelExternalWorkspaceMemberGrantResponse = /* @__PURE__ */ defineSchema(() =>
|
|
100
|
+
z
|
|
101
|
+
.object({
|
|
102
|
+
removed: z.boolean(),
|
|
103
|
+
replay: z.boolean(),
|
|
104
|
+
fencedGrantOperationId: z.string().uuid(),
|
|
105
|
+
})
|
|
106
|
+
.strict(),
|
|
107
|
+
);
|
|
91
108
|
export type CancelExternalWorkspaceMemberGrantResponse = z.infer<
|
|
92
109
|
typeof CancelExternalWorkspaceMemberGrantResponse
|
|
93
110
|
>;
|
|
94
111
|
|
|
112
|
+
/** Replace an existing external member's permissions in one shared workspace.
|
|
113
|
+
* Keyed and idempotent like a grant; narrowing forces live authority to
|
|
114
|
+
* re-check but never cancels or tears down work. */
|
|
115
|
+
export const UpdateExternalWorkspaceMemberRequest = /* @__PURE__ */ defineSchema(() =>
|
|
116
|
+
z
|
|
117
|
+
.object({
|
|
118
|
+
permissions: z.array(Permission).min(1).max(Permission.options.length),
|
|
119
|
+
operationId: z.string().uuid(),
|
|
120
|
+
})
|
|
121
|
+
.strict(),
|
|
122
|
+
);
|
|
123
|
+
export type UpdateExternalWorkspaceMemberRequest = z.infer<
|
|
124
|
+
typeof UpdateExternalWorkspaceMemberRequest
|
|
125
|
+
>;
|
|
126
|
+
export const UpdateExternalWorkspaceMemberResponse = /* @__PURE__ */ defineSchema(() =>
|
|
127
|
+
z
|
|
128
|
+
.object({
|
|
129
|
+
subjectId: z.string(),
|
|
130
|
+
organizationMembershipId: z.string().uuid(),
|
|
131
|
+
permissions: z.array(Permission),
|
|
132
|
+
/** True when a previously held permission was removed. */
|
|
133
|
+
narrowed: z.boolean(),
|
|
134
|
+
replay: z.boolean(),
|
|
135
|
+
})
|
|
136
|
+
.strict(),
|
|
137
|
+
);
|
|
138
|
+
export type UpdateExternalWorkspaceMemberResponse = z.infer<
|
|
139
|
+
typeof UpdateExternalWorkspaceMemberResponse
|
|
140
|
+
>;
|
|
141
|
+
|
|
95
142
|
/** Uses the organization membership ID returned by lazy identity admission.
|
|
96
143
|
* Reactivation restores admission only, not revoked work or workspace grants. */
|
|
97
|
-
export const UpdateExternalIdentityMembershipRequest =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
144
|
+
export const UpdateExternalIdentityMembershipRequest = /* @__PURE__ */ defineSchema(() =>
|
|
145
|
+
z
|
|
146
|
+
.object({
|
|
147
|
+
kind: z.enum(["suspend", "reactivate", "offboard"]),
|
|
148
|
+
expectedAuthorizationRevision: z.number().int().positive().safe(),
|
|
149
|
+
operationId: z.string().uuid(),
|
|
150
|
+
reason: z.string().max(512).optional(),
|
|
151
|
+
})
|
|
152
|
+
.strict(),
|
|
153
|
+
);
|
|
105
154
|
export type UpdateExternalIdentityMembershipRequest = z.infer<
|
|
106
155
|
typeof UpdateExternalIdentityMembershipRequest
|
|
107
156
|
>;
|
|
108
157
|
|
|
109
|
-
export const ExternalActorSelection =
|
|
110
|
-
z.
|
|
158
|
+
export const ExternalActorSelection = /* @__PURE__ */ defineSchema(() =>
|
|
159
|
+
z.discriminatedUnion("mode", [
|
|
160
|
+
z.object({ mode: z.literal("external"), identity: ExternalIdentityReference }).strict(),
|
|
161
|
+
z
|
|
162
|
+
.object({
|
|
163
|
+
mode: z.literal("linked_native"),
|
|
164
|
+
identity: ExternalIdentityReference,
|
|
165
|
+
linkId: z.string().uuid(),
|
|
166
|
+
expectedLinkRevision: z.number().int().positive().safe(),
|
|
167
|
+
})
|
|
168
|
+
.strict(),
|
|
169
|
+
]),
|
|
170
|
+
);
|
|
171
|
+
export type ExternalActorSelection = z.infer<typeof ExternalActorSelection>;
|
|
172
|
+
|
|
173
|
+
export const ExternalIdentity = /* @__PURE__ */ defineSchema(() =>
|
|
111
174
|
z
|
|
112
175
|
.object({
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
176
|
+
id: z.string().uuid(),
|
|
177
|
+
accountId: z.string().uuid(),
|
|
178
|
+
source,
|
|
179
|
+
externalId,
|
|
180
|
+
subjectId: externalSubject,
|
|
181
|
+
organizationMembershipId: z.string().uuid(),
|
|
182
|
+
personalWorkspaceId: z.string().uuid(),
|
|
183
|
+
status: z.enum(["active", "disabled", "revoked"]),
|
|
184
|
+
authorizationRevision: z.number().int().positive().safe(),
|
|
117
185
|
})
|
|
118
186
|
.strict(),
|
|
119
|
-
|
|
120
|
-
export type ExternalActorSelection = z.infer<typeof ExternalActorSelection>;
|
|
121
|
-
|
|
122
|
-
export const ExternalIdentity = z
|
|
123
|
-
.object({
|
|
124
|
-
id: z.string().uuid(),
|
|
125
|
-
accountId: z.string().uuid(),
|
|
126
|
-
source,
|
|
127
|
-
externalId,
|
|
128
|
-
subjectId: externalSubject,
|
|
129
|
-
organizationMembershipId: z.string().uuid(),
|
|
130
|
-
personalWorkspaceId: z.string().uuid(),
|
|
131
|
-
status: z.enum(["active", "disabled", "revoked"]),
|
|
132
|
-
authorizationRevision: z.number().int().positive().safe(),
|
|
133
|
-
})
|
|
134
|
-
.strict();
|
|
187
|
+
);
|
|
135
188
|
export type ExternalIdentity = z.infer<typeof ExternalIdentity>;
|
|
136
189
|
|
|
137
190
|
// Audit attribution, not authentication. Only the canonical access resolver
|
|
138
191
|
// may establish provenance; accepting this JSON from a browser proves nothing.
|
|
139
|
-
export const ExternalActorAttribution =
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
192
|
+
export const ExternalActorAttribution = /* @__PURE__ */ defineSchema(() =>
|
|
193
|
+
z
|
|
194
|
+
.object({
|
|
195
|
+
accountId: z.string().uuid(),
|
|
196
|
+
authenticatingApiKeyId: z.string().uuid(),
|
|
197
|
+
externalIdentityId: z.string().uuid(),
|
|
198
|
+
externalSubjectId: externalSubject,
|
|
199
|
+
externalAuthorizationRevision: z.number().int().positive().safe(),
|
|
200
|
+
effectiveSubjectId: z.string().min(1).max(1024),
|
|
201
|
+
actingMode: z.enum(["external", "linked_native"]),
|
|
202
|
+
linkId: z.string().uuid().optional(),
|
|
203
|
+
linkRevision: z.number().int().positive().safe().optional(),
|
|
204
|
+
})
|
|
205
|
+
.strict()
|
|
206
|
+
.superRefine((value, context) => {
|
|
207
|
+
if (value.actingMode === "external") {
|
|
208
|
+
if (
|
|
209
|
+
value.effectiveSubjectId !== value.externalSubjectId ||
|
|
210
|
+
value.linkId !== undefined ||
|
|
211
|
+
value.linkRevision !== undefined
|
|
212
|
+
) {
|
|
213
|
+
context.addIssue({
|
|
214
|
+
code: "custom",
|
|
215
|
+
message: "External mode cannot delegate native identity",
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
} else if (
|
|
219
|
+
!value.linkId ||
|
|
220
|
+
!value.linkRevision ||
|
|
221
|
+
!nativeSubject.safeParse(value.effectiveSubjectId).success
|
|
158
222
|
) {
|
|
159
223
|
context.addIssue({
|
|
160
224
|
code: "custom",
|
|
161
|
-
message: "
|
|
225
|
+
message: "Linked mode requires exact native delegation provenance",
|
|
162
226
|
});
|
|
163
227
|
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
!value.linkRevision ||
|
|
167
|
-
!nativeSubject.safeParse(value.effectiveSubjectId).success
|
|
168
|
-
) {
|
|
169
|
-
context.addIssue({
|
|
170
|
-
code: "custom",
|
|
171
|
-
message: "Linked mode requires exact native delegation provenance",
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
});
|
|
228
|
+
}),
|
|
229
|
+
);
|
|
175
230
|
export type ExternalActorAttribution = z.infer<typeof ExternalActorAttribution>;
|
|
176
231
|
|
|
177
232
|
/** Server-signed/encrypted continuation data, never sufficient live authority. */
|
|
178
|
-
export const ExternalActorContinuation =
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
233
|
+
export const ExternalActorContinuation = /* @__PURE__ */ defineSchema(() =>
|
|
234
|
+
z
|
|
235
|
+
.object({
|
|
236
|
+
identity: ExternalIdentityReference,
|
|
237
|
+
actor: ExternalActorAttribution,
|
|
238
|
+
})
|
|
239
|
+
.strict(),
|
|
240
|
+
);
|
|
184
241
|
export type ExternalActorContinuation = z.infer<typeof ExternalActorContinuation>;
|
|
185
242
|
|
|
186
|
-
export const ExternalIdentityLink =
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
(
|
|
201
|
-
|
|
202
|
-
|
|
243
|
+
export const ExternalIdentityLink = /* @__PURE__ */ defineSchema(() =>
|
|
244
|
+
z
|
|
245
|
+
.object({
|
|
246
|
+
id: z.string().uuid(),
|
|
247
|
+
accountId: z.string().uuid(),
|
|
248
|
+
externalIdentityId: z.string().uuid(),
|
|
249
|
+
externalIdentity: ExternalIdentityReference.optional(),
|
|
250
|
+
nativeSubjectId: nativeSubject.nullable(),
|
|
251
|
+
status: z.enum(["pending", "active", "revoked", "expired"]),
|
|
252
|
+
revision: z.number().int().positive().safe(),
|
|
253
|
+
permissions: z.array(Permission).max(Permission.options.length),
|
|
254
|
+
expiresAt: z.string().datetime({ offset: true }).nullable(),
|
|
255
|
+
})
|
|
256
|
+
.strict()
|
|
257
|
+
.refine(
|
|
258
|
+
(value) => value.status !== "active" || value.nativeSubjectId !== null,
|
|
259
|
+
"An active link requires a confirmed native identity",
|
|
260
|
+
),
|
|
261
|
+
);
|
|
203
262
|
export type ExternalIdentityLink = z.infer<typeof ExternalIdentityLink>;
|
|
204
263
|
|
|
205
|
-
export const ExternalIdentityLinkPage =
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
264
|
+
export const ExternalIdentityLinkPage = /* @__PURE__ */ defineSchema(() =>
|
|
265
|
+
z
|
|
266
|
+
.object({
|
|
267
|
+
links: z.array(ExternalIdentityLink).max(50),
|
|
268
|
+
nextCursor: z.string().uuid().nullable(),
|
|
269
|
+
})
|
|
270
|
+
.strict(),
|
|
271
|
+
);
|
|
211
272
|
export type ExternalIdentityLinkPage = z.infer<typeof ExternalIdentityLinkPage>;
|
|
212
273
|
|
|
213
274
|
/** A native confirmation may narrow this request, never broaden it. The
|
|
214
275
|
* challenge is delivered once to the host and is not an authentication token. */
|
|
215
|
-
export const BeginExternalIdentityLinkRequest =
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
276
|
+
export const BeginExternalIdentityLinkRequest = /* @__PURE__ */ defineSchema(() =>
|
|
277
|
+
z
|
|
278
|
+
.object({
|
|
279
|
+
permissions: z.array(Permission).min(1).max(Permission.options.length),
|
|
280
|
+
expiresAt: z.string().datetime({ offset: true }).nullable().default(null),
|
|
281
|
+
})
|
|
282
|
+
.strict(),
|
|
283
|
+
);
|
|
221
284
|
export type BeginExternalIdentityLinkRequest = z.input<typeof BeginExternalIdentityLinkRequest>;
|
|
222
|
-
export const ConfirmExternalIdentityLinkRequest =
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
285
|
+
export const ConfirmExternalIdentityLinkRequest = /* @__PURE__ */ defineSchema(() =>
|
|
286
|
+
z
|
|
287
|
+
.object({
|
|
288
|
+
challenge: z.string().regex(/^[A-Za-z0-9_-]{43}$/),
|
|
289
|
+
expectedRevision: z.number().int().positive().safe(),
|
|
290
|
+
permissions: z.array(Permission).min(1).max(Permission.options.length),
|
|
291
|
+
})
|
|
292
|
+
.strict(),
|
|
293
|
+
);
|
|
229
294
|
export type ConfirmExternalIdentityLinkRequest = z.infer<typeof ConfirmExternalIdentityLinkRequest>;
|
|
230
|
-
export const BeginExternalIdentityLinkResponse =
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
295
|
+
export const BeginExternalIdentityLinkResponse = /* @__PURE__ */ defineSchema(() =>
|
|
296
|
+
z
|
|
297
|
+
.object({
|
|
298
|
+
link: ExternalIdentityLink,
|
|
299
|
+
challenge: z.string().regex(/^[A-Za-z0-9_-]{43}$/),
|
|
300
|
+
confirmBefore: z.string().datetime({ offset: true }),
|
|
301
|
+
})
|
|
302
|
+
.strict(),
|
|
303
|
+
);
|
|
237
304
|
export type BeginExternalIdentityLinkResponse = z.infer<typeof BeginExternalIdentityLinkResponse>;
|
|
238
|
-
export const ExternalIdentityLinkPreview =
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
305
|
+
export const ExternalIdentityLinkPreview = /* @__PURE__ */ defineSchema(() =>
|
|
306
|
+
z
|
|
307
|
+
.object({
|
|
308
|
+
link: ExternalIdentityLink,
|
|
309
|
+
externalIdentity: ExternalIdentityReference,
|
|
310
|
+
nativeSubjectId: nativeSubject,
|
|
311
|
+
organizationId: z.string().uuid(),
|
|
312
|
+
})
|
|
313
|
+
.strict(),
|
|
314
|
+
);
|
|
246
315
|
export type ExternalIdentityLinkPreview = z.infer<typeof ExternalIdentityLinkPreview>;
|
|
247
316
|
|
|
248
317
|
/** Immutable accepted-work restriction, not a browser credential. Original key
|
|
249
318
|
* identity remains audit-only; durable use validates the live link and members. */
|
|
250
|
-
export const ExternalLinkWorkSnapshot =
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
319
|
+
export const ExternalLinkWorkSnapshot = /* @__PURE__ */ defineSchema(() =>
|
|
320
|
+
z
|
|
321
|
+
.object({
|
|
322
|
+
identity: ExternalIdentityReference,
|
|
323
|
+
actor: ExternalActorAttribution.refine((value) => value.actingMode === "linked_native"),
|
|
324
|
+
permissions: z.array(Permission).max(Permission.options.length),
|
|
325
|
+
/** Absent on historical snapshots, whose legacy semantics are preserved. */
|
|
326
|
+
permissionMode: z.enum(["legacy", "explicit"]).optional(),
|
|
327
|
+
})
|
|
328
|
+
.strict(),
|
|
329
|
+
);
|
|
257
330
|
export type ExternalLinkWorkSnapshot = z.infer<typeof ExternalLinkWorkSnapshot>;
|
package/src/feedback.ts
CHANGED
|
@@ -1,39 +1,52 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
|
|
3
|
-
export const FeedbackSentiment =
|
|
4
|
+
export const FeedbackSentiment = /* @__PURE__ */ defineSchema(() =>
|
|
5
|
+
z.enum(["positive", "negative"]),
|
|
6
|
+
);
|
|
4
7
|
export type FeedbackSentiment = z.infer<typeof FeedbackSentiment>;
|
|
5
8
|
|
|
6
9
|
/** A new key means a new submission; retry the same payload with the same key. */
|
|
7
|
-
export const CreateFeedbackRequest =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
export const CreateFeedbackRequest = /* @__PURE__ */ defineSchema(() =>
|
|
11
|
+
z
|
|
12
|
+
.object({
|
|
13
|
+
idempotencyKey: z.string().uuid(),
|
|
14
|
+
sessionId: z.string().uuid().optional(),
|
|
15
|
+
turnId: z.string().uuid().optional(),
|
|
16
|
+
sentiment: FeedbackSentiment.optional(),
|
|
17
|
+
comment: z.string().max(4000).optional(),
|
|
18
|
+
})
|
|
19
|
+
.strict()
|
|
20
|
+
.superRefine((value, ctx) => {
|
|
21
|
+
if (value.turnId && !value.sessionId)
|
|
22
|
+
ctx.addIssue({ code: "custom", path: ["turnId"], message: "turnId requires sessionId" });
|
|
23
|
+
if (value.sentiment && !value.sessionId)
|
|
24
|
+
ctx.addIssue({ code: "custom", path: ["sentiment"], message: "Ratings require a session" });
|
|
25
|
+
if (!value.sentiment && !value.comment?.trim())
|
|
26
|
+
ctx.addIssue({
|
|
27
|
+
code: "custom",
|
|
28
|
+
path: ["comment"],
|
|
29
|
+
message: "Provide a rating or a comment",
|
|
30
|
+
});
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
24
33
|
export type CreateFeedbackRequest = z.infer<typeof CreateFeedbackRequest>;
|
|
25
34
|
|
|
26
|
-
export const Feedback =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
export const Feedback = /* @__PURE__ */ defineSchema(() =>
|
|
36
|
+
z.object({
|
|
37
|
+
id: z.string().uuid(),
|
|
38
|
+
workspaceId: z.string().uuid(),
|
|
39
|
+
subjectId: z.string(),
|
|
40
|
+
principalKind: z.string().nullable(),
|
|
41
|
+
sessionId: z.string().uuid().nullable(),
|
|
42
|
+
turnId: z.string().uuid().nullable(),
|
|
43
|
+
sentiment: FeedbackSentiment.nullable(),
|
|
44
|
+
comment: z.string().nullable(),
|
|
45
|
+
createdAt: z.string().datetime(),
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
37
48
|
export type Feedback = z.infer<typeof Feedback>;
|
|
38
|
-
export const FeedbackSubmissionResponse =
|
|
49
|
+
export const FeedbackSubmissionResponse = /* @__PURE__ */ defineSchema(() =>
|
|
50
|
+
z.object({ feedback: Feedback, replayed: z.boolean() }),
|
|
51
|
+
);
|
|
39
52
|
export type FeedbackSubmissionResponse = z.infer<typeof FeedbackSubmissionResponse>;
|