@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
package/src/retained-output.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
|
|
3
4
|
/** Hard server-side ceiling for one retained-output response body. */
|
|
@@ -29,181 +30,191 @@ const WORKSPACE_RETRIEVAL_PATH =
|
|
|
29
30
|
const SESSION_RETRIEVAL_PATH =
|
|
30
31
|
/^\/v1\/workspaces\/([0-9a-f-]+)\/sessions\/([0-9a-f-]+)\/artifacts\/([0-9a-f-]+)\/content$/;
|
|
31
32
|
|
|
32
|
-
export const RetainedOutputKind =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
export const RetainedOutputKind = /* @__PURE__ */ defineSchema(() =>
|
|
34
|
+
z.enum([
|
|
35
|
+
"tool_result",
|
|
36
|
+
"assistant_completion",
|
|
37
|
+
"internal_update",
|
|
38
|
+
"event_media",
|
|
39
|
+
"computer_screenshot",
|
|
40
|
+
"browser_screenshot",
|
|
41
|
+
"generated_image",
|
|
42
|
+
"generated_video",
|
|
43
|
+
"file",
|
|
44
|
+
]),
|
|
45
|
+
);
|
|
42
46
|
export type RetainedOutputKind = z.infer<typeof RetainedOutputKind>;
|
|
43
47
|
|
|
44
|
-
export const RetainedOutputUnavailableReason =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
export const RetainedOutputUnavailableReason = /* @__PURE__ */ defineSchema(() =>
|
|
49
|
+
z.enum([
|
|
50
|
+
"not_retained",
|
|
51
|
+
"pending",
|
|
52
|
+
"failed",
|
|
53
|
+
"expired",
|
|
54
|
+
"deleted",
|
|
55
|
+
"missing_storage",
|
|
56
|
+
"storage_write_failed",
|
|
57
|
+
"quota_exceeded",
|
|
58
|
+
"invalid_content",
|
|
59
|
+
"oversized",
|
|
60
|
+
"unsupported",
|
|
61
|
+
]),
|
|
62
|
+
);
|
|
57
63
|
export type RetainedOutputUnavailableReason = z.infer<typeof RetainedOutputUnavailableReason>;
|
|
58
64
|
|
|
59
|
-
const RetainedOutputUnavailableEvidenceSchema =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
})
|
|
80
|
-
.strict()
|
|
81
|
-
.optional(),
|
|
82
|
-
retention: z.union([
|
|
83
|
-
z
|
|
65
|
+
const RetainedOutputUnavailableEvidenceSchema = /* @__PURE__ */ defineSchema(() =>
|
|
66
|
+
z
|
|
67
|
+
.object({
|
|
68
|
+
available: z.literal(false),
|
|
69
|
+
reason: RetainedOutputUnavailableReason,
|
|
70
|
+
})
|
|
71
|
+
.strict(),
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
export const RetainedArtifactReferenceSchema = /* @__PURE__ */ defineSchema(() =>
|
|
75
|
+
z
|
|
76
|
+
.object({
|
|
77
|
+
available: z.literal(true),
|
|
78
|
+
artifactId: z.string().regex(LOWERCASE_UUID),
|
|
79
|
+
kind: RetainedOutputKind,
|
|
80
|
+
contentType: z.string().max(127).regex(CANONICAL_MEDIA_TYPE),
|
|
81
|
+
originalBytes: z.number().int().nonnegative().safe(),
|
|
82
|
+
sha256: z.string().regex(LOWERCASE_SHA256),
|
|
83
|
+
retainedAt: z.string().datetime({ offset: true }),
|
|
84
|
+
dimensions: z
|
|
84
85
|
.object({
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
width: z.number().int().positive().max(COMPUTER_SCREENSHOT_MAX_DIMENSION),
|
|
87
|
+
height: z.number().int().positive().max(COMPUTER_SCREENSHOT_MAX_DIMENSION),
|
|
87
88
|
})
|
|
88
|
-
.strict()
|
|
89
|
-
|
|
89
|
+
.strict()
|
|
90
|
+
.optional(),
|
|
91
|
+
retention: z.union([
|
|
92
|
+
z
|
|
93
|
+
.object({
|
|
94
|
+
policy: z.literal("workspace_file"),
|
|
95
|
+
expiresAt: z.null(),
|
|
96
|
+
})
|
|
97
|
+
.strict(),
|
|
98
|
+
z
|
|
99
|
+
.object({
|
|
100
|
+
policy: z.literal("session_screenshot"),
|
|
101
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
102
|
+
})
|
|
103
|
+
.strict(),
|
|
104
|
+
]),
|
|
105
|
+
retrieval: z
|
|
90
106
|
.object({
|
|
91
|
-
|
|
92
|
-
|
|
107
|
+
method: z.literal("GET"),
|
|
108
|
+
path: z.string().max(256),
|
|
109
|
+
acceptRanges: z.literal("bytes"),
|
|
110
|
+
maxRangeBytes: z.number().int().positive().max(RETAINED_OUTPUT_MAX_PAGE_BYTES),
|
|
93
111
|
})
|
|
94
112
|
.strict(),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const sessionMatch = SESSION_RETRIEVAL_PATH.exec(value.retrieval.path);
|
|
109
|
-
const workspaceId = workspaceMatch?.[1] ?? sessionMatch?.[1];
|
|
110
|
-
const sessionId = sessionMatch?.[2];
|
|
111
|
-
const artifactId = workspaceMatch?.[2] ?? sessionMatch?.[3];
|
|
112
|
-
if (
|
|
113
|
-
!workspaceId ||
|
|
114
|
-
!LOWERCASE_UUID.test(workspaceId) ||
|
|
115
|
-
(sessionId !== undefined && !LOWERCASE_UUID.test(sessionId)) ||
|
|
116
|
-
artifactId !== value.artifactId
|
|
117
|
-
) {
|
|
118
|
-
ctx.addIssue({
|
|
119
|
-
code: "custom",
|
|
120
|
-
path: ["retrieval", "path"],
|
|
121
|
-
message: "retrieval path must be a workspace/session API content path for this artifact",
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (
|
|
126
|
-
value.kind === "computer_screenshot" ||
|
|
127
|
-
value.kind === "generated_image" ||
|
|
128
|
-
value.kind === "generated_video"
|
|
129
|
-
) {
|
|
130
|
-
if (!value.dimensions) {
|
|
131
|
-
ctx.addIssue({
|
|
132
|
-
code: "custom",
|
|
133
|
-
path: ["dimensions"],
|
|
134
|
-
message: `${value.kind} receipts require exact dimensions`,
|
|
135
|
-
});
|
|
136
|
-
} else if (
|
|
137
|
-
value.dimensions.width * value.dimensions.height >
|
|
138
|
-
COMPUTER_SCREENSHOT_MAX_PIXELS
|
|
113
|
+
})
|
|
114
|
+
.strict()
|
|
115
|
+
.superRefine((value, ctx) => {
|
|
116
|
+
const workspaceMatch = WORKSPACE_RETRIEVAL_PATH.exec(value.retrieval.path);
|
|
117
|
+
const sessionMatch = SESSION_RETRIEVAL_PATH.exec(value.retrieval.path);
|
|
118
|
+
const workspaceId = workspaceMatch?.[1] ?? sessionMatch?.[1];
|
|
119
|
+
const sessionId = sessionMatch?.[2];
|
|
120
|
+
const artifactId = workspaceMatch?.[2] ?? sessionMatch?.[3];
|
|
121
|
+
if (
|
|
122
|
+
!workspaceId ||
|
|
123
|
+
!LOWERCASE_UUID.test(workspaceId) ||
|
|
124
|
+
(sessionId !== undefined && !LOWERCASE_UUID.test(sessionId)) ||
|
|
125
|
+
artifactId !== value.artifactId
|
|
139
126
|
) {
|
|
140
127
|
ctx.addIssue({
|
|
141
128
|
code: "custom",
|
|
142
|
-
path: ["
|
|
143
|
-
message:
|
|
129
|
+
path: ["retrieval", "path"],
|
|
130
|
+
message: "retrieval path must be a workspace/session API content path for this artifact",
|
|
144
131
|
});
|
|
145
132
|
}
|
|
146
|
-
}
|
|
147
133
|
|
|
148
|
-
if (value.kind === "generated_image") {
|
|
149
|
-
if (value.retention.policy !== "workspace_file" || !workspaceMatch || sessionMatch) {
|
|
150
|
-
ctx.addIssue({
|
|
151
|
-
code: "custom",
|
|
152
|
-
path: ["retention"],
|
|
153
|
-
message: "generated images require permanent workspace-file retrieval",
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
134
|
if (
|
|
157
|
-
|
|
158
|
-
value.
|
|
159
|
-
value.
|
|
135
|
+
value.kind === "computer_screenshot" ||
|
|
136
|
+
value.kind === "browser_screenshot" ||
|
|
137
|
+
value.kind === "generated_image" ||
|
|
138
|
+
value.kind === "generated_video"
|
|
160
139
|
) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
140
|
+
if (!value.dimensions) {
|
|
141
|
+
ctx.addIssue({
|
|
142
|
+
code: "custom",
|
|
143
|
+
path: ["dimensions"],
|
|
144
|
+
message: `${value.kind} receipts require exact dimensions`,
|
|
145
|
+
});
|
|
146
|
+
} else if (
|
|
147
|
+
value.dimensions.width * value.dimensions.height >
|
|
148
|
+
COMPUTER_SCREENSHOT_MAX_PIXELS
|
|
149
|
+
) {
|
|
150
|
+
ctx.addIssue({
|
|
151
|
+
code: "custom",
|
|
152
|
+
path: ["dimensions"],
|
|
153
|
+
message: `${value.kind} dimensions exceed the pixel limit`,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
166
156
|
}
|
|
167
|
-
}
|
|
168
157
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
158
|
+
if (value.kind === "generated_image") {
|
|
159
|
+
if (value.retention.policy !== "workspace_file" || !workspaceMatch || sessionMatch) {
|
|
160
|
+
ctx.addIssue({
|
|
161
|
+
code: "custom",
|
|
162
|
+
path: ["retention"],
|
|
163
|
+
message: "generated images require permanent workspace-file retrieval",
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (
|
|
167
|
+
!["image/png", "image/jpeg", "image/webp"].includes(value.contentType) ||
|
|
168
|
+
value.originalBytes <= 0 ||
|
|
169
|
+
value.originalBytes > GENERATED_IMAGE_MAX_BYTES
|
|
170
|
+
) {
|
|
171
|
+
ctx.addIssue({
|
|
172
|
+
code: "custom",
|
|
173
|
+
path: ["contentType"],
|
|
174
|
+
message: "generated image media metadata is invalid",
|
|
175
|
+
});
|
|
176
|
+
}
|
|
176
177
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
value.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
178
|
+
|
|
179
|
+
if (value.kind === "generated_video") {
|
|
180
|
+
if (value.retention.policy !== "workspace_file" || !workspaceMatch || sessionMatch) {
|
|
181
|
+
ctx.addIssue({
|
|
182
|
+
code: "custom",
|
|
183
|
+
path: ["retention"],
|
|
184
|
+
message: "generated videos require permanent workspace-file retrieval",
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
if (
|
|
188
|
+
value.contentType !== "video/mp4" ||
|
|
189
|
+
value.originalBytes <= 0 ||
|
|
190
|
+
value.originalBytes > GENERATED_VIDEO_MAX_BYTES
|
|
191
|
+
) {
|
|
192
|
+
ctx.addIssue({
|
|
193
|
+
code: "custom",
|
|
194
|
+
path: ["contentType"],
|
|
195
|
+
message: "generated video media metadata is invalid",
|
|
196
|
+
});
|
|
197
|
+
}
|
|
187
198
|
}
|
|
188
|
-
}
|
|
189
199
|
|
|
190
|
-
|
|
191
|
-
|
|
200
|
+
if (value.kind === "computer_screenshot" || value.kind === "browser_screenshot") {
|
|
201
|
+
if (value.retention.policy !== "session_screenshot" || !sessionMatch) {
|
|
202
|
+
ctx.addIssue({
|
|
203
|
+
code: "custom",
|
|
204
|
+
path: ["retention"],
|
|
205
|
+
message: "session screenshots require session-scoped expiring retrieval",
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (encoder.encode(JSON.stringify(value)).byteLength > RETAINED_OUTPUT_RECEIPT_MAX_BYTES) {
|
|
192
211
|
ctx.addIssue({
|
|
193
212
|
code: "custom",
|
|
194
|
-
|
|
195
|
-
message: "computer screenshots require session-scoped expiring retrieval",
|
|
213
|
+
message: "retained-output receipt exceeds its byte envelope",
|
|
196
214
|
});
|
|
197
215
|
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if (encoder.encode(JSON.stringify(value)).byteLength > RETAINED_OUTPUT_RECEIPT_MAX_BYTES) {
|
|
201
|
-
ctx.addIssue({
|
|
202
|
-
code: "custom",
|
|
203
|
-
message: "retained-output receipt exceeds its byte envelope",
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
});
|
|
216
|
+
}),
|
|
217
|
+
);
|
|
207
218
|
|
|
208
219
|
/**
|
|
209
220
|
* Canonical evidence fact carried by bounded audit/NATS/SSE/UI previews.
|
|
@@ -212,29 +223,32 @@ export const RetainedArtifactReferenceSchema = z
|
|
|
212
223
|
* object key, signed URL, arbitrary metadata, or producer-controlled labels can
|
|
213
224
|
* cross this boundary.
|
|
214
225
|
*/
|
|
215
|
-
export const RetainedOutputEvidenceSchema =
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
226
|
+
export const RetainedOutputEvidenceSchema = /* @__PURE__ */ defineSchema(() =>
|
|
227
|
+
z.discriminatedUnion("available", [
|
|
228
|
+
RetainedOutputUnavailableEvidenceSchema,
|
|
229
|
+
RetainedArtifactReferenceSchema,
|
|
230
|
+
]),
|
|
231
|
+
);
|
|
219
232
|
export type RetainedOutputEvidence = z.infer<typeof RetainedOutputEvidenceSchema>;
|
|
220
233
|
export type RetainedArtifactReference = z.infer<typeof RetainedArtifactReferenceSchema>;
|
|
221
234
|
/** @deprecated use RetainedArtifactReference. */
|
|
222
235
|
export type RetainedOutputAvailableEvidence = RetainedArtifactReference;
|
|
223
236
|
|
|
224
|
-
export const RetainedArtifactUnavailableSchema =
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
237
|
+
export const RetainedArtifactUnavailableSchema = /* @__PURE__ */ defineSchema(() =>
|
|
238
|
+
z
|
|
239
|
+
.object({
|
|
240
|
+
available: z.literal(false),
|
|
241
|
+
artifactId: z.string().regex(LOWERCASE_UUID),
|
|
242
|
+
reason: RetainedOutputUnavailableReason,
|
|
243
|
+
})
|
|
244
|
+
.strict(),
|
|
245
|
+
);
|
|
231
246
|
export type RetainedArtifactUnavailable = z.infer<typeof RetainedArtifactUnavailableSchema>;
|
|
232
247
|
|
|
233
248
|
/** Authenticated metadata result for one opaque workspace file identity. */
|
|
234
|
-
export const RetainedArtifactMetadataSchema =
|
|
235
|
-
RetainedArtifactReferenceSchema,
|
|
236
|
-
|
|
237
|
-
]);
|
|
249
|
+
export const RetainedArtifactMetadataSchema = /* @__PURE__ */ defineSchema(() =>
|
|
250
|
+
z.union([RetainedArtifactReferenceSchema, RetainedArtifactUnavailableSchema]),
|
|
251
|
+
);
|
|
238
252
|
export type RetainedArtifactMetadata = z.infer<typeof RetainedArtifactMetadataSchema>;
|
|
239
253
|
|
|
240
254
|
export type RetainedArtifactFileInput = {
|
|
@@ -252,8 +266,23 @@ export type RetainedScreenshotArtifactInput = RetainedArtifactFileInput & {
|
|
|
252
266
|
width: number;
|
|
253
267
|
height: number;
|
|
254
268
|
expiresAt: string;
|
|
269
|
+
kind?: "computer_screenshot" | "browser_screenshot";
|
|
255
270
|
};
|
|
256
271
|
|
|
272
|
+
export type RetainedSessionScreenshotKind = "computer_screenshot" | "browser_screenshot";
|
|
273
|
+
|
|
274
|
+
/** The persisted, server-authored storage key distinguishes browser captures from legacy computer captures. */
|
|
275
|
+
export function retainedSessionScreenshotKindFromObjectKey(
|
|
276
|
+
objectKey: string,
|
|
277
|
+
): RetainedSessionScreenshotKind | null {
|
|
278
|
+
const match =
|
|
279
|
+
/^workspaces\/[0-9a-f-]+\/files\/[0-9a-f-]+\/retained\/(session-image|computer-screenshot|screenshot|browser-screenshot)\.(png|jpg|webp)$/.exec(
|
|
280
|
+
objectKey,
|
|
281
|
+
);
|
|
282
|
+
if (!match) return null;
|
|
283
|
+
return match[1] === "browser-screenshot" ? "browser_screenshot" : "computer_screenshot";
|
|
284
|
+
}
|
|
285
|
+
|
|
257
286
|
export type RetainedGeneratedImageArtifactInput = RetainedArtifactFileInput & {
|
|
258
287
|
width: number;
|
|
259
288
|
height: number;
|
|
@@ -305,7 +334,7 @@ export function retainedScreenshotReferenceFromFile(
|
|
|
305
334
|
const value = {
|
|
306
335
|
available: true as const,
|
|
307
336
|
artifactId: file.id,
|
|
308
|
-
kind: "computer_screenshot"
|
|
337
|
+
kind: file.kind ?? "computer_screenshot",
|
|
309
338
|
contentType: canonicalRetainedContentType(file.contentType),
|
|
310
339
|
originalBytes: file.sizeBytes,
|
|
311
340
|
sha256: file.sha256,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
|
|
3
4
|
import { RetainedArtifactReferenceSchema } from "./retained-output";
|
|
@@ -9,57 +10,69 @@ import { RetainedArtifactReferenceSchema } from "./retained-output";
|
|
|
9
10
|
*/
|
|
10
11
|
export const SANDBOX_FILE_ARTIFACT_MAX_BYTES = 25 * 1024 * 1024 - 1;
|
|
11
12
|
|
|
12
|
-
export const PublishSandboxFileArtifactRequest =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
export const PublishSandboxFileArtifactRequest = /* @__PURE__ */ defineSchema(() =>
|
|
14
|
+
z
|
|
15
|
+
.object({
|
|
16
|
+
path: z.string().min(1).max(4_096),
|
|
17
|
+
})
|
|
18
|
+
.strict(),
|
|
19
|
+
);
|
|
17
20
|
export type PublishSandboxFileArtifactRequest = z.infer<typeof PublishSandboxFileArtifactRequest>;
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
23
|
* Closed model/UI receipt for one exact sandbox-file publication. Storage
|
|
21
24
|
* locators and signed URLs never cross this boundary.
|
|
22
25
|
*/
|
|
23
|
-
export const SandboxFileArtifactReceipt =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
value.artifact.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
26
|
+
export const SandboxFileArtifactReceipt = /* @__PURE__ */ defineSchema(() =>
|
|
27
|
+
z
|
|
28
|
+
.object({
|
|
29
|
+
type: z.literal("sandbox_file"),
|
|
30
|
+
sandboxPath: z.string().min(1).max(4_096),
|
|
31
|
+
filename: z.string().min(1).max(1_024),
|
|
32
|
+
artifact: RetainedArtifactReferenceSchema,
|
|
33
|
+
})
|
|
34
|
+
.strict()
|
|
35
|
+
.superRefine((value, context) => {
|
|
36
|
+
const pathSegments = value.sandboxPath.split("/");
|
|
37
|
+
// This is a receipt, not read authority. The publisher confines the path
|
|
38
|
+
// against its resolved provider root; receipts preserve that native path.
|
|
39
|
+
const unc = value.sandboxPath.startsWith("//");
|
|
40
|
+
const absolute = unc
|
|
41
|
+
? /^\/\/[^/]+\/[^/]+\/.+/u.test(value.sandboxPath) && !value.sandboxPath.startsWith("//?/")
|
|
42
|
+
: value.sandboxPath.startsWith("/") || /^[A-Z]:\//u.test(value.sandboxPath);
|
|
43
|
+
if (
|
|
44
|
+
!absolute ||
|
|
45
|
+
/[\\\u0000-\u001f\u007f]/u.test(value.sandboxPath) ||
|
|
46
|
+
pathSegments.some(
|
|
47
|
+
(segment, index) =>
|
|
48
|
+
index >= (unc ? 2 : 1) && (!segment || segment === "." || segment === ".."),
|
|
49
|
+
) ||
|
|
50
|
+
pathSegments.at(-1) !== value.filename
|
|
51
|
+
) {
|
|
52
|
+
context.addIssue({
|
|
53
|
+
code: "custom",
|
|
54
|
+
path: ["sandboxPath"],
|
|
55
|
+
message:
|
|
56
|
+
"sandbox path must canonically identify the published filename at an absolute host path",
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (value.artifact.kind !== "file" || value.artifact.retention.policy !== "workspace_file") {
|
|
60
|
+
context.addIssue({
|
|
61
|
+
code: "custom",
|
|
62
|
+
path: ["artifact"],
|
|
63
|
+
message: "sandbox files require a permanent workspace-file artifact",
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (
|
|
67
|
+
value.artifact.originalBytes < 1 ||
|
|
68
|
+
value.artifact.originalBytes > SANDBOX_FILE_ARTIFACT_MAX_BYTES
|
|
69
|
+
) {
|
|
70
|
+
context.addIssue({
|
|
71
|
+
code: "custom",
|
|
72
|
+
path: ["artifact", "originalBytes"],
|
|
73
|
+
message: "sandbox file size is outside the publication byte limit",
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
);
|
|
65
78
|
export type SandboxFileArtifactReceipt = z.infer<typeof SandboxFileArtifactReceipt>;
|
|
@@ -1,26 +1,94 @@
|
|
|
1
|
+
import { defineSchema } from "./define-schema";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
|
|
3
|
-
const ModalOutputCursor =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
const ModalOutputCursor = /* @__PURE__ */ defineSchema(() =>
|
|
5
|
+
z
|
|
6
|
+
.object({
|
|
7
|
+
batchIndex: z.number().int().nonnegative().safe(),
|
|
8
|
+
utf8Remainder: z
|
|
9
|
+
.string()
|
|
10
|
+
.max(8)
|
|
11
|
+
.regex(/^[A-Za-z0-9+/]*={0,2}$/u),
|
|
12
|
+
exitCode: z.number().int().nullable(),
|
|
13
|
+
})
|
|
14
|
+
.strict(),
|
|
15
|
+
);
|
|
13
16
|
|
|
14
17
|
/** Provider-owned execution identity and acknowledged output cursors. These
|
|
15
18
|
* values are retained by the control plane, never recovered from sandbox files. */
|
|
16
|
-
export const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
export const ModalLegacyProviderCommand = /* @__PURE__ */ defineSchema(() =>
|
|
20
|
+
z
|
|
21
|
+
.object({
|
|
22
|
+
kind: z.literal("modal-control-v1"),
|
|
23
|
+
sandboxId: z.string().min(1).max(200),
|
|
24
|
+
taskId: z.string().min(1).max(200),
|
|
25
|
+
execId: z.string().min(1).max(200),
|
|
26
|
+
pty: z.boolean().optional(),
|
|
27
|
+
streams: z.object({ stdout: ModalOutputCursor, stderr: ModalOutputCursor }).strict(),
|
|
28
|
+
})
|
|
29
|
+
.strict(),
|
|
30
|
+
);
|
|
31
|
+
export type ModalLegacyProviderCommand = z.infer<typeof ModalLegacyProviderCommand>;
|
|
32
|
+
|
|
33
|
+
const ModalByteCursor = /* @__PURE__ */ defineSchema(() =>
|
|
34
|
+
z
|
|
35
|
+
.object({
|
|
36
|
+
byteOffset: z.number().int().nonnegative().safe(),
|
|
37
|
+
utf8Remainder: z
|
|
38
|
+
.string()
|
|
39
|
+
.max(8)
|
|
40
|
+
.regex(/^[A-Za-z0-9+/]*={0,2}$/u),
|
|
41
|
+
eof: z.boolean(),
|
|
42
|
+
exitCode: z.number().int().nullable(),
|
|
43
|
+
})
|
|
44
|
+
.strict()
|
|
45
|
+
.refine((cursor) => cursor.exitCode === null || cursor.eof, {
|
|
46
|
+
message: "A terminal output cursor must have reached EOF",
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export const CommandSupervisionDescriptor = /* @__PURE__ */ defineSchema(() =>
|
|
51
|
+
z
|
|
52
|
+
.object({
|
|
53
|
+
protocol: z.literal("native-subreaper-v1"),
|
|
54
|
+
invocationId: z.string().uuid(),
|
|
55
|
+
nonce: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
56
|
+
controlPath: z.string().regex(/^\/tmp\/opengeni-supervision\/[a-f0-9-]{36}\.sock$/u),
|
|
57
|
+
})
|
|
58
|
+
.strict(),
|
|
59
|
+
);
|
|
60
|
+
export type CommandSupervisionDescriptor = z.infer<typeof CommandSupervisionDescriptor>;
|
|
61
|
+
|
|
62
|
+
export const CommandSupervisionReceipt = /* @__PURE__ */ defineSchema(() =>
|
|
63
|
+
z
|
|
64
|
+
.object({
|
|
65
|
+
protocol: z.literal("native-subreaper-v1"),
|
|
66
|
+
invocationId: z.string().uuid(),
|
|
67
|
+
receiptId: z.string().uuid(),
|
|
68
|
+
leaderExitCode: z.number().int(),
|
|
69
|
+
})
|
|
70
|
+
.strict(),
|
|
71
|
+
);
|
|
72
|
+
export type CommandSupervisionReceipt = z.infer<typeof CommandSupervisionReceipt>;
|
|
73
|
+
|
|
74
|
+
export const ModalRouterProviderCommand = /* @__PURE__ */ defineSchema(() =>
|
|
75
|
+
z
|
|
76
|
+
.object({
|
|
77
|
+
kind: z.literal("modal-router-v1"),
|
|
78
|
+
sandboxId: z.string().min(1).max(200),
|
|
79
|
+
taskId: z.string().min(1).max(200),
|
|
80
|
+
execId: z.string().uuid(),
|
|
81
|
+
pty: z.boolean().optional(),
|
|
82
|
+
supervision: CommandSupervisionDescriptor.optional(),
|
|
83
|
+
streams: z.object({ stdout: ModalByteCursor, stderr: ModalByteCursor }).strict(),
|
|
84
|
+
})
|
|
85
|
+
.strict(),
|
|
86
|
+
);
|
|
87
|
+
export type ModalRouterProviderCommand = z.infer<typeof ModalRouterProviderCommand>;
|
|
88
|
+
|
|
89
|
+
/** Legacy locators are read-only compatibility for already launched commands;
|
|
90
|
+
* new starts use authenticated task-router byte offsets, never batch indices. */
|
|
91
|
+
export const SandboxProviderCommand = /* @__PURE__ */ defineSchema(() =>
|
|
92
|
+
z.discriminatedUnion("kind", [ModalLegacyProviderCommand, ModalRouterProviderCommand]),
|
|
93
|
+
);
|
|
26
94
|
export type SandboxProviderCommand = z.infer<typeof SandboxProviderCommand>;
|