@opengeni/contracts 0.44.1 → 1.0.0
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 +70 -0
- package/dist/agent-config.d.ts +869 -0
- package/dist/agent-instruction-changes.d.ts +110 -0
- package/dist/agent-learning.d.ts +243 -0
- package/dist/agent-topology.d.ts +292 -0
- 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 +161 -0
- package/dist/artifacts.d.ts +135 -11
- 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 +2 -0
- package/dist/atlassian.js +27 -11
- 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 +40 -0
- package/dist/canonical-human-identities.d.ts +157 -0
- package/dist/canonical-human-identities.js +23 -0
- package/dist/canonical-human-identities.js.map +1 -0
- package/dist/chunk-2ACYHZFB.js +292 -0
- package/dist/chunk-2ACYHZFB.js.map +1 -0
- package/dist/chunk-2VORLN2R.js +353 -0
- package/dist/chunk-2VORLN2R.js.map +1 -0
- package/dist/{chunk-Y3MLSLB4.js → chunk-3SIZGL3O.js} +42 -30
- package/dist/chunk-3SIZGL3O.js.map +1 -0
- package/dist/chunk-46KLD2UH.js +186 -0
- package/dist/chunk-46KLD2UH.js.map +1 -0
- package/dist/chunk-4JGHSSB7.js +11 -0
- package/dist/chunk-4JGHSSB7.js.map +1 -0
- package/dist/{chunk-52SGB2QO.js → chunk-5IXYF6XN.js} +50 -10
- package/dist/chunk-5IXYF6XN.js.map +1 -0
- package/dist/chunk-BCS7WHCK.js +139 -0
- package/dist/chunk-BCS7WHCK.js.map +1 -0
- package/dist/chunk-EK7NDGFR.js +128 -0
- package/dist/chunk-EK7NDGFR.js.map +1 -0
- package/dist/{chunk-5UDNP7AO.js → chunk-FZ6BXQHL.js} +78 -38
- package/dist/chunk-FZ6BXQHL.js.map +1 -0
- package/dist/chunk-GRG7PHWQ.js +25 -0
- package/dist/chunk-GRG7PHWQ.js.map +1 -0
- package/dist/chunk-JUFK3T4Q.js +80 -0
- package/dist/chunk-JUFK3T4Q.js.map +1 -0
- package/dist/chunk-KHHZTBP7.js +11 -0
- package/dist/chunk-KHHZTBP7.js.map +1 -0
- package/dist/chunk-KR2V42UZ.js +187 -0
- package/dist/chunk-KR2V42UZ.js.map +1 -0
- package/dist/chunk-MZLBPKFE.js +168 -0
- package/dist/chunk-MZLBPKFE.js.map +1 -0
- package/dist/{chunk-H5BVCZKF.js → chunk-NRMCVHAU.js} +6 -5
- package/dist/chunk-NRMCVHAU.js.map +1 -0
- package/dist/{chunk-TZ6YEYN4.js → chunk-NVJMJWLL.js} +3 -1
- package/dist/chunk-NVJMJWLL.js.map +1 -0
- package/dist/chunk-O77VSFYZ.js +70 -0
- package/dist/chunk-O77VSFYZ.js.map +1 -0
- package/dist/chunk-PX3VCKAU.js +29 -0
- package/dist/chunk-PX3VCKAU.js.map +1 -0
- package/dist/chunk-QR5D2IQC.js +61 -0
- package/dist/chunk-QR5D2IQC.js.map +1 -0
- package/dist/chunk-RJ76DRPO.js +117 -0
- package/dist/chunk-RJ76DRPO.js.map +1 -0
- package/dist/chunk-RKX3NQYS.js +28 -0
- package/dist/chunk-RKX3NQYS.js.map +1 -0
- package/dist/{chunk-FJBG5E4O.js → chunk-SIOU2K4U.js} +45 -22
- package/dist/chunk-SIOU2K4U.js.map +1 -0
- package/dist/chunk-TSCDAGET.js +75 -0
- package/dist/chunk-TSCDAGET.js.map +1 -0
- package/dist/{chunk-LSB7GRLG.js → chunk-TXTQIYCV.js} +15 -11
- package/dist/chunk-TXTQIYCV.js.map +1 -0
- package/dist/chunk-X7ETVO4P.js +26544 -0
- package/dist/chunk-X7ETVO4P.js.map +1 -0
- package/dist/{chunk-CADSX6UN.js → chunk-Y3KNXVTD.js} +2 -2
- package/dist/chunk-YBW5JSA3.js +251 -0
- package/dist/chunk-YBW5JSA3.js.map +1 -0
- package/dist/chunk-YRXAWWCU.js +45 -0
- package/dist/chunk-YRXAWWCU.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 +109 -0
- package/dist/client-error-report.js +87 -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.d.ts +23 -0
- package/dist/codex-provider-account-authority.js +23 -0
- package/dist/codex-provider-account-authority.js.map +1 -0
- package/dist/company-brain-governed-writes.d.ts +475 -0
- package/dist/company-brain.d.ts +336 -0
- package/dist/company-profile.d.ts +566 -0
- package/dist/connect.d.ts +325 -0
- package/dist/connect.js +191 -0
- package/dist/connect.js.map +1 -0
- 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 +193 -0
- package/dist/connection-authority.js +50 -0
- package/dist/connection-authority.js.map +1 -0
- package/dist/connector-attachments.d.ts +95 -0
- package/dist/connector-attachments.js +51 -0
- package/dist/connector-attachments.js.map +1 -0
- package/dist/connector-tool-permissions.d.ts +73 -0
- package/dist/direct-model-provider.d.ts +36 -0
- package/dist/editable-artifact-codec-registry.d.ts +16 -7
- package/dist/editable-artifact-codec-registry.js +19 -9
- package/dist/editable-artifact-committed-transaction.d.ts +2 -2
- package/dist/editable-artifact-committed-transaction.js +2 -2
- package/dist/editable-artifact-live.d.ts +11 -12
- package/dist/editable-artifact-live.js +110 -45
- package/dist/editable-artifact-live.js.map +1 -1
- package/dist/editable-artifact-serialized-commit.d.ts +2 -1
- package/dist/editable-artifact-serialized-commit.js +8 -7
- package/dist/editable-artifact-versions.d.ts +20 -5
- package/dist/editable-artifact-versions.js +23 -5
- package/dist/editable-artifacts.d.ts +2 -0
- package/dist/editable-artifacts.js +48 -36
- package/dist/external-identities.d.ts +784 -0
- package/dist/external-identities.js +44 -0
- package/dist/external-identities.js.map +1 -0
- package/dist/feedback.d.ts +51 -0
- package/dist/github-repository-contracts.d.ts +36 -0
- package/dist/github-repository-contracts.js +59 -0
- package/dist/github-repository-contracts.js.map +1 -0
- package/dist/github-repository.d.ts +14 -0
- package/dist/github-repository.js +36 -0
- package/dist/github-repository.js.map +1 -0
- package/dist/google-drive.d.ts +90 -1
- package/dist/google-drive.js +91 -15
- package/dist/google-drive.js.map +1 -1
- package/dist/governed-learning-activation.d.ts +154 -0
- package/dist/governed-learning-evaluator.d.ts +152 -0
- package/dist/host-mcp-bindings.d.ts +326 -0
- package/dist/host-mcp-bindings.js +252 -0
- package/dist/host-mcp-bindings.js.map +1 -0
- package/dist/image-generation.d.ts +1 -0
- package/dist/index.d.ts +27574 -5374
- package/dist/index.js +2531 -177
- package/dist/insights-usage.d.ts +877 -0
- package/dist/insights-usage.js +509 -0
- package/dist/insights-usage.js.map +1 -0
- package/dist/interaction.d.ts +1752 -13
- package/dist/knowledge-entries.d.ts +982 -0
- package/dist/knowledge-preparation.d.ts +237 -0
- package/dist/knowledge.d.ts +740 -0
- package/dist/managed-auth-session-sets.d.ts +241 -0
- package/dist/managed-auth-session-sets.js +191 -0
- package/dist/managed-auth-session-sets.js.map +1 -0
- package/dist/managed-sign-in-methods.d.ts +56 -0
- package/dist/managed-sign-in-methods.js +46 -0
- package/dist/managed-sign-in-methods.js.map +1 -0
- package/dist/mcp-catalog-limits.d.ts +2 -0
- package/dist/mcp-endpoint.d.ts +7 -0
- package/dist/mcp-endpoint.js +9 -0
- package/dist/mcp-endpoint.js.map +1 -0
- package/dist/mcp-oauth.d.ts +71 -0
- package/dist/modal-native-proof-v2.d.ts +587 -0
- package/dist/modal-native-proof-v2.js +37 -0
- package/dist/modal-native-proof-v2.js.map +1 -0
- package/dist/model-availability.d.ts +15 -0
- package/dist/model-connection-access.d.ts +24 -0
- package/dist/model-context-inspector.d.ts +329 -0
- package/dist/model-display.d.ts +38 -0
- package/dist/model-display.js +134 -0
- package/dist/model-display.js.map +1 -0
- package/dist/model-picker-order.d.ts +25 -0
- package/dist/model-picker-order.js +42 -0
- package/dist/model-picker-order.js.map +1 -0
- package/dist/organization-access.d.ts +231 -0
- package/dist/organization-access.js +34 -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 +1022 -0
- package/dist/organization-model-usage.d.ts +146 -0
- package/dist/organization-model-usage.js +67 -0
- package/dist/organization-model-usage.js.map +1 -0
- package/dist/organization-recovery.d.ts +337 -0
- package/dist/organization-recovery.js +37 -0
- package/dist/organization-recovery.js.map +1 -0
- package/dist/organization-usage.d.ts +138 -0
- package/dist/permissions.d.ts +54 -0
- package/dist/personal-github.d.ts +320 -0
- package/dist/personal-github.js +222 -0
- package/dist/personal-github.js.map +1 -0
- package/dist/plugin-discovery.d.ts +35 -0
- package/dist/plugin-discovery.js +7 -0
- package/dist/plugin-discovery.js.map +1 -0
- package/dist/preference-registry.d.ts +44 -1
- package/dist/product-analytics.d.ts +113 -0
- package/dist/product-lifecycle-facts.d.ts +73 -0
- package/dist/remember.d.ts +350 -0
- package/dist/retained-output.d.ts +8 -0
- package/dist/sandbox-file-artifacts.d.ts +57 -0
- package/dist/sandbox-provider-command.d.ts +113 -0
- package/dist/sandbox-recovery.d.ts +146 -0
- package/dist/sandbox-snapshots.d.ts +39 -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 +947 -0
- package/dist/session-list-entries.d.ts +4 -0
- package/dist/session-list-entries.js +51 -0
- package/dist/session-list-entries.js.map +1 -0
- package/dist/session-mcp-projections.d.ts +215 -0
- package/dist/session-message-search.d.ts +68 -0
- package/dist/session-titles.d.ts +68 -0
- package/dist/session-titles.js +25 -0
- package/dist/session-titles.js.map +1 -0
- package/dist/session-topology-primitives.d.ts +22 -0
- package/dist/signup-attribution.d.ts +39 -0
- package/dist/site-request-headers.test.d.ts +1 -0
- package/dist/site-session-http.d.ts +11 -0
- package/dist/site-session-http.js +11 -0
- package/dist/site-session-http.js.map +1 -0
- package/dist/skill-catalog-context.d.ts +7 -0
- package/dist/skill-files.d.ts +12 -0
- package/dist/skill-metadata.d.ts +9 -0
- package/dist/skill-use.d.ts +61 -0
- package/dist/skills.d.ts +185 -0
- package/dist/slack-bot-scopes.d.ts +46 -21
- package/dist/slack-bot-scopes.js +14 -3
- package/dist/slack-rest-mcp.d.ts +31 -0
- package/dist/slack-rest-mcp.js +19 -0
- package/dist/slack-rest-mcp.js.map +1 -0
- package/dist/slack-task-policy.d.ts +294 -0
- package/dist/spreadsheet-artifact-commands.d.ts +2 -3
- package/dist/spreadsheet-artifact-commands.js +4 -2
- package/dist/spreadsheet-artifact-query.js +3 -2
- package/dist/subscription-account-pools.d.ts +292 -0
- package/dist/task-notes.d.ts +169 -0
- package/dist/tool-catalog.d.ts +286 -0
- package/dist/tool-result-spill.d.ts +16 -0
- package/dist/usage-allowances.d.ts +285 -0
- package/dist/usage-allowances.js +49 -0
- package/dist/usage-allowances.js.map +1 -0
- package/dist/video-generation.d.ts +51 -0
- package/dist/video-generation.js +9 -1
- package/dist/work-claims.d.ts +411 -0
- package/dist/workspace-instruction-policies.d.ts +94 -0
- 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 +948 -0
- package/dist/workspace-learning-administration.d.ts +289 -0
- package/dist/workspace-learning-policy.d.ts +1 -1
- package/dist/workspace-state.d.ts +85 -416
- package/dist/xai-provider-account-authority.d.ts +26 -0
- package/dist/xai-provider-account-authority.js +9 -0
- package/dist/xai-provider-account-authority.js.map +1 -0
- package/package.json +146 -1
- package/src/agent-authored-durable-text.ts +116 -0
- package/src/agent-config.ts +1527 -0
- package/src/agent-instruction-changes.ts +98 -0
- package/src/agent-learning.ts +161 -0
- package/src/agent-topology.ts +69 -0
- package/src/allowance-refusal.ts +81 -0
- package/src/analytics-consent-report.ts +20 -0
- package/src/api-key-presets.ts +25 -0
- package/src/artifact-catalog.ts +60 -0
- package/src/artifacts.ts +146 -18
- package/src/atlassian-native-retirement.ts +33 -0
- package/src/browser-storage.ts +10 -0
- package/src/bundled-skills.ts +73 -0
- package/src/canonical-human-identities.ts +93 -0
- package/src/claude-provider-account-authority.ts +12 -0
- package/src/claude-subscription-oauth.ts +62 -0
- package/src/claude-subscription-usage.ts +59 -0
- package/src/client-error-report.ts +184 -0
- package/src/code-search.ts +105 -0
- package/src/codex-provider-account-authority.ts +37 -0
- package/src/company-brain-governed-writes.ts +356 -0
- package/src/company-brain.ts +201 -0
- package/src/company-profile.ts +167 -1
- package/src/connect.ts +202 -0
- package/src/connection-account-label.ts +46 -0
- package/src/connection-authority.ts +213 -0
- package/src/connector-attachments.ts +327 -0
- package/src/connector-tool-permissions.ts +60 -0
- package/src/direct-model-provider.ts +98 -0
- package/src/editable-artifact-codec-registry.ts +55 -17
- package/src/editable-artifact-committed-transaction.ts +44 -31
- package/src/editable-artifact-live.ts +123 -57
- package/src/editable-artifact-serialized-commit.ts +2 -1
- package/src/editable-artifact-versions.ts +26 -5
- package/src/editable-artifacts.ts +2 -0
- package/src/external-identities.ts +285 -0
- package/src/feedback.ts +39 -0
- package/src/github-repository-contracts.ts +85 -0
- package/src/github-repository.ts +59 -0
- package/src/google-drive.ts +76 -4
- package/src/governed-learning-activation.ts +191 -0
- package/src/governed-learning-evaluator.ts +176 -0
- package/src/host-mcp-bindings.ts +298 -0
- package/src/image-generation.ts +8 -2
- package/src/index.ts +8019 -1799
- package/src/insights-usage.ts +679 -0
- package/src/interaction.ts +1102 -6
- package/src/knowledge-entries.ts +375 -0
- package/src/knowledge-preparation.ts +50 -0
- package/src/knowledge.ts +335 -0
- package/src/managed-auth-session-sets.ts +253 -0
- package/src/managed-sign-in-methods.ts +37 -0
- package/src/mcp-catalog-limits.ts +2 -0
- package/src/mcp-endpoint.ts +30 -0
- package/src/mcp-oauth.ts +66 -0
- package/src/modal-native-proof-v2.ts +398 -0
- package/src/model-availability.ts +22 -0
- package/src/model-connection-access.ts +17 -0
- package/src/model-context-inspector.ts +139 -0
- package/src/model-display.ts +195 -0
- package/src/model-picker-order.ts +97 -0
- package/src/organization-access.ts +176 -0
- package/src/organization-integration-policy.ts +54 -0
- package/src/organization-membership-lifecycle.ts +559 -0
- package/src/organization-model-usage.ts +72 -0
- package/src/organization-recovery.ts +186 -0
- package/src/organization-usage.ts +79 -0
- package/src/permissions.ts +58 -0
- package/src/personal-github.ts +267 -0
- package/src/plugin-discovery.ts +33 -0
- package/src/preference-registry.ts +20 -1
- package/src/product-analytics.ts +253 -0
- package/src/product-lifecycle-facts.ts +121 -0
- package/src/remember.ts +243 -0
- package/src/retained-output.ts +20 -3
- package/src/sandbox-file-artifacts.ts +73 -0
- package/src/sandbox-provider-command.ts +82 -0
- package/src/sandbox-recovery.ts +116 -0
- package/src/sandbox-snapshots.ts +142 -0
- package/src/session-final-reply.ts +16 -0
- package/src/session-goal-reports.ts +55 -0
- package/src/session-history-import.ts +159 -0
- package/src/session-list-entries.ts +91 -0
- package/src/session-mcp-projections.ts +273 -0
- package/src/session-message-search.ts +54 -0
- package/src/session-titles.ts +467 -0
- package/src/session-topology-primitives.ts +21 -0
- package/src/signup-attribution.ts +81 -0
- package/src/site-request-headers.test.ts +28 -0
- package/src/site-session-http.ts +63 -0
- package/src/skill-catalog-context.ts +50 -0
- package/src/skill-files.ts +52 -0
- package/src/skill-metadata.ts +40 -0
- package/src/skill-use.ts +77 -0
- package/src/skills.ts +136 -0
- package/src/slack-bot-scopes.ts +106 -42
- package/src/slack-rest-mcp.ts +194 -0
- package/src/slack-task-policy.ts +215 -0
- package/src/spreadsheet-artifact-commands.ts +12 -13
- package/src/subscription-account-pools.ts +44 -0
- package/src/task-notes.ts +105 -0
- package/src/tool-catalog.ts +155 -0
- package/src/tool-result-spill.ts +35 -0
- package/src/usage-allowances.ts +187 -0
- package/src/video-generation.ts +43 -6
- package/src/work-claims.ts +266 -0
- package/src/workspace-instruction-policies.ts +31 -0
- package/src/workspace-integration-wire.ts +99 -0
- package/src/workspace-integrations.ts +640 -0
- package/src/workspace-learning-administration.ts +88 -0
- package/src/workspace-learning-policy.ts +4 -3
- package/src/workspace-state.ts +16 -126
- package/src/xai-provider-account-authority.ts +38 -0
- package/dist/chunk-52SGB2QO.js.map +0 -1
- package/dist/chunk-5UDNP7AO.js.map +0 -1
- package/dist/chunk-BVGIYW7D.js +0 -11
- package/dist/chunk-BVGIYW7D.js.map +0 -1
- package/dist/chunk-FJBG5E4O.js.map +0 -1
- package/dist/chunk-H5BVCZKF.js.map +0 -1
- package/dist/chunk-LSB7GRLG.js.map +0 -1
- package/dist/chunk-TZ6YEYN4.js.map +0 -1
- package/dist/chunk-VA22KRHS.js +0 -15177
- package/dist/chunk-VA22KRHS.js.map +0 -1
- package/dist/chunk-Y3MLSLB4.js.map +0 -1
- /package/dist/{chunk-CADSX6UN.js.map → chunk-Y3KNXVTD.js.map} +0 -0
package/src/tool-catalog.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
export const ATTEMPT_TOOL_CATALOG_VERSION = 1 as const;
|
|
4
|
+
export const TOOL_GATEWAY_CATALOG_VERSION = 1 as const;
|
|
4
5
|
export const ATTEMPT_TOOL_CATALOG_MAX_ENTRIES = 4_096;
|
|
5
6
|
export const ATTEMPT_TOOL_CATALOG_MAX_BYTES = 16 * 1024 * 1024;
|
|
6
7
|
export const ATTEMPT_TOOL_CATALOG_MAX_PATH_SEGMENTS = 8;
|
|
@@ -43,6 +44,10 @@ export const AttemptToolIdentity = z
|
|
|
43
44
|
.strict();
|
|
44
45
|
export type AttemptToolIdentity = z.infer<typeof AttemptToolIdentity>;
|
|
45
46
|
|
|
47
|
+
/** Protocol-neutral tool identity shared by MCP, HTTP/SDK, agents, and Codemode. */
|
|
48
|
+
export const ToolGatewayIdentity = AttemptToolIdentity;
|
|
49
|
+
export type ToolGatewayIdentity = AttemptToolIdentity;
|
|
50
|
+
|
|
46
51
|
export const AttemptToolCatalogIcon = z
|
|
47
52
|
.object({
|
|
48
53
|
src: z.string().min(1).max(8_192),
|
|
@@ -69,6 +74,16 @@ export type AttemptToolAnnotations = z.infer<typeof AttemptToolAnnotations>;
|
|
|
69
74
|
export const AttemptToolJsonSchema = jsonObject;
|
|
70
75
|
export type AttemptToolJsonSchema = z.infer<typeof AttemptToolJsonSchema>;
|
|
71
76
|
|
|
77
|
+
/** Presentation only; never parsed as execution or account authority. */
|
|
78
|
+
export const ToolDisplayMetadata = z
|
|
79
|
+
.object({
|
|
80
|
+
toolName: toolIdentifier,
|
|
81
|
+
title: z.string().min(1).max(512).optional(),
|
|
82
|
+
accountLabel: z.string().min(1).max(1024).optional(),
|
|
83
|
+
})
|
|
84
|
+
.strict();
|
|
85
|
+
export type ToolDisplayMetadata = z.infer<typeof ToolDisplayMetadata>;
|
|
86
|
+
|
|
72
87
|
export const AttemptToolCatalogEntry = z
|
|
73
88
|
.object({
|
|
74
89
|
identity: AttemptToolIdentity,
|
|
@@ -88,6 +103,73 @@ export const AttemptToolCatalogEntry = z
|
|
|
88
103
|
.strict();
|
|
89
104
|
export type AttemptToolCatalogEntry = z.infer<typeof AttemptToolCatalogEntry>;
|
|
90
105
|
|
|
106
|
+
/** One canonical gateway entry. Adapter-specific names are projections, never authority. */
|
|
107
|
+
export const ToolGatewayCatalogEntry = AttemptToolCatalogEntry;
|
|
108
|
+
export type ToolGatewayCatalogEntry = AttemptToolCatalogEntry;
|
|
109
|
+
|
|
110
|
+
export const ToolGatewayCatalog = z
|
|
111
|
+
.object({
|
|
112
|
+
version: z.literal(TOOL_GATEWAY_CATALOG_VERSION),
|
|
113
|
+
accountId: z.string().uuid(),
|
|
114
|
+
workspaceId: z.string().uuid(),
|
|
115
|
+
generation: z.number().int().positive(),
|
|
116
|
+
digest: sha256,
|
|
117
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
118
|
+
entries: z.array(ToolGatewayCatalogEntry).max(ATTEMPT_TOOL_CATALOG_MAX_ENTRIES),
|
|
119
|
+
})
|
|
120
|
+
.strict()
|
|
121
|
+
.superRefine((catalog, context) => {
|
|
122
|
+
const identities = new Set<string>();
|
|
123
|
+
const modelNames = new Set<string>();
|
|
124
|
+
const toolPaths = new Set<string>();
|
|
125
|
+
for (const [index, entry] of catalog.entries.entries()) {
|
|
126
|
+
const identity = `${entry.identity.serverId}\u0000${entry.identity.toolName}`;
|
|
127
|
+
const toolPath = entry.codemodePath.join(".");
|
|
128
|
+
if (identities.has(identity)) {
|
|
129
|
+
context.addIssue({
|
|
130
|
+
code: "custom",
|
|
131
|
+
path: ["entries", index, "identity"],
|
|
132
|
+
message: "duplicate tool identity",
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
if (modelNames.has(entry.modelName)) {
|
|
136
|
+
context.addIssue({
|
|
137
|
+
code: "custom",
|
|
138
|
+
path: ["entries", index, "modelName"],
|
|
139
|
+
message: "duplicate model tool name",
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
if (toolPaths.has(toolPath)) {
|
|
143
|
+
context.addIssue({
|
|
144
|
+
code: "custom",
|
|
145
|
+
path: ["entries", index, "codemodePath"],
|
|
146
|
+
message: "duplicate tool path",
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
identities.add(identity);
|
|
150
|
+
modelNames.add(entry.modelName);
|
|
151
|
+
toolPaths.add(toolPath);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
export type ToolGatewayCatalog = z.infer<typeof ToolGatewayCatalog>;
|
|
155
|
+
|
|
156
|
+
export const ToolGatewayCaller = z
|
|
157
|
+
.object({
|
|
158
|
+
kind: z.enum(["model", "codemode", "http", "mcp", "browser"]),
|
|
159
|
+
subjectId: z.string().min(1).max(1_024),
|
|
160
|
+
})
|
|
161
|
+
.strict();
|
|
162
|
+
export type ToolGatewayCaller = z.infer<typeof ToolGatewayCaller>;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* MCP request `_meta` key naming the attempt surface that issued a call to the
|
|
166
|
+
* first-party server: `model` for a direct model tool call, `codemode` for a
|
|
167
|
+
* Codemode script. Only the worker's own tool gateway sets it, and only for the
|
|
168
|
+
* first-party server. A read reached the model's context only when it says
|
|
169
|
+
* `model`; a Codemode script may keep the output to itself.
|
|
170
|
+
*/
|
|
171
|
+
export const FIRST_PARTY_MCP_CALLER_META_KEY = "opengeniCaller";
|
|
172
|
+
|
|
91
173
|
export const AttemptToolCatalog = z
|
|
92
174
|
.object({
|
|
93
175
|
version: z.literal(ATTEMPT_TOOL_CATALOG_VERSION),
|
|
@@ -251,6 +333,79 @@ export const AttemptToolResult = z
|
|
|
251
333
|
.loose();
|
|
252
334
|
export type AttemptToolResult = z.infer<typeof AttemptToolResult>;
|
|
253
335
|
|
|
336
|
+
export const ToolGatewayResult = AttemptToolResult;
|
|
337
|
+
export type ToolGatewayResult = AttemptToolResult;
|
|
338
|
+
|
|
339
|
+
export const ToolGatewayCallRequest = z
|
|
340
|
+
.object({
|
|
341
|
+
operationId: z.string().uuid().optional(),
|
|
342
|
+
catalogDigest: sha256,
|
|
343
|
+
identity: ToolGatewayIdentity,
|
|
344
|
+
arguments: jsonObject,
|
|
345
|
+
/** Host-owned Site context. Publisher-controlled iframe code cannot set it. */
|
|
346
|
+
siteArtifactId: z.string().uuid().optional(),
|
|
347
|
+
siteVersionId: z.string().uuid().optional(),
|
|
348
|
+
/** Opaque, server-issued, single-use capability for an approval-required call. */
|
|
349
|
+
approvalToken: z
|
|
350
|
+
.string()
|
|
351
|
+
.regex(/^ogta_[A-Za-z0-9_-]{43}$/u)
|
|
352
|
+
.optional(),
|
|
353
|
+
})
|
|
354
|
+
.strict()
|
|
355
|
+
.superRefine(requireCompleteSiteToolContext);
|
|
356
|
+
export type ToolGatewayCallRequest = z.infer<typeof ToolGatewayCallRequest>;
|
|
357
|
+
|
|
358
|
+
export const ToolGatewayApprovalRequest = z
|
|
359
|
+
.object({
|
|
360
|
+
operationId: z.string().uuid(),
|
|
361
|
+
catalogDigest: sha256,
|
|
362
|
+
identity: ToolGatewayIdentity,
|
|
363
|
+
arguments: jsonObject,
|
|
364
|
+
})
|
|
365
|
+
.strict();
|
|
366
|
+
export type ToolGatewayApprovalRequest = z.infer<typeof ToolGatewayApprovalRequest>;
|
|
367
|
+
|
|
368
|
+
export const ToolGatewayApprovalResponse = z
|
|
369
|
+
.object({
|
|
370
|
+
operationId: z.string().uuid(),
|
|
371
|
+
catalogDigest: sha256,
|
|
372
|
+
identity: ToolGatewayIdentity,
|
|
373
|
+
approvalToken: z.string().regex(/^ogta_[A-Za-z0-9_-]{43}$/u),
|
|
374
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
375
|
+
})
|
|
376
|
+
.strict();
|
|
377
|
+
export type ToolGatewayApprovalResponse = z.infer<typeof ToolGatewayApprovalResponse>;
|
|
378
|
+
|
|
379
|
+
export const ToolGatewayCallResponse = z
|
|
380
|
+
.object({
|
|
381
|
+
operationId: z.string().uuid(),
|
|
382
|
+
catalogDigest: sha256,
|
|
383
|
+
result: ToolGatewayResult,
|
|
384
|
+
})
|
|
385
|
+
.strict();
|
|
386
|
+
export type ToolGatewayCallResponse = z.infer<typeof ToolGatewayCallResponse>;
|
|
387
|
+
|
|
388
|
+
export const ToolGatewayDeclarationsResponse = z
|
|
389
|
+
.object({
|
|
390
|
+
catalogDigest: sha256,
|
|
391
|
+
moduleSpecifier: z.string().min(1).max(512),
|
|
392
|
+
source: z.string().max(16 * 1024 * 1024),
|
|
393
|
+
})
|
|
394
|
+
.strict();
|
|
395
|
+
export type ToolGatewayDeclarationsResponse = z.infer<typeof ToolGatewayDeclarationsResponse>;
|
|
396
|
+
|
|
397
|
+
function requireCompleteSiteToolContext(
|
|
398
|
+
value: { siteArtifactId?: string | undefined; siteVersionId?: string | undefined },
|
|
399
|
+
context: z.RefinementCtx,
|
|
400
|
+
): void {
|
|
401
|
+
if ((value.siteArtifactId === undefined) === (value.siteVersionId === undefined)) return;
|
|
402
|
+
context.addIssue({
|
|
403
|
+
code: "custom",
|
|
404
|
+
message: "siteArtifactId and siteVersionId must be provided together",
|
|
405
|
+
path: [value.siteArtifactId === undefined ? "siteArtifactId" : "siteVersionId"],
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
|
|
254
409
|
export const CodemodeOperationState = z.enum([
|
|
255
410
|
"queued",
|
|
256
411
|
"running",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/** Model-visible overflow of one tool result. Exact bytes live on a workspace File. */
|
|
4
|
+
export const TOOL_RESULT_SPILLED_TYPE = "tool_result_spilled" as const;
|
|
5
|
+
export const TOOL_RESULT_SPILL_MEDIA_TYPE = "application/json" as const;
|
|
6
|
+
export const TOOL_RESULT_SPILL_MOUNT_PATH = "tool-results" as const;
|
|
7
|
+
|
|
8
|
+
const LOWERCASE_UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
9
|
+
|
|
10
|
+
export const ToolResultSpilledReceipt = z
|
|
11
|
+
.object({
|
|
12
|
+
type: z.literal(TOOL_RESULT_SPILLED_TYPE),
|
|
13
|
+
sandboxPath: z.string().min(1).max(4_096).nullable(),
|
|
14
|
+
fileId: z.string().regex(LOWERCASE_UUID),
|
|
15
|
+
byteSize: z.number().int().positive().safe(),
|
|
16
|
+
mediaType: z.literal(TOOL_RESULT_SPILL_MEDIA_TYPE),
|
|
17
|
+
})
|
|
18
|
+
.strict();
|
|
19
|
+
export type ToolResultSpilledReceipt = z.infer<typeof ToolResultSpilledReceipt>;
|
|
20
|
+
|
|
21
|
+
export function isToolResultSpilledReceipt(value: unknown): value is ToolResultSpilledReceipt {
|
|
22
|
+
return ToolResultSpilledReceipt.safeParse(value).success;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function toolResultSpillSandboxPath(filename: string): string {
|
|
26
|
+
return `/workspace/${TOOL_RESULT_SPILL_MOUNT_PATH}/${filename}`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function toolResultSpillFilename(operationId: string): string {
|
|
30
|
+
const normalized = operationId.toLowerCase();
|
|
31
|
+
if (!LOWERCASE_UUID.test(normalized)) {
|
|
32
|
+
throw new Error("tool result spill filename requires a lowercase UUID operation id");
|
|
33
|
+
}
|
|
34
|
+
return `${normalized}.json`;
|
|
35
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/** Credit amounts are integer USD micros (1 USD = 1,000,000), never floating-point dollars. */
|
|
4
|
+
export const AllowanceCredits = z.number().int().nonnegative().safe();
|
|
5
|
+
const Version = z.number().int().nonnegative().safe();
|
|
6
|
+
const Timestamp = z.string().datetime({ offset: true });
|
|
7
|
+
const OperationId = z
|
|
8
|
+
.string()
|
|
9
|
+
.min(1)
|
|
10
|
+
.max(256)
|
|
11
|
+
.refine(
|
|
12
|
+
(value) =>
|
|
13
|
+
value.trim().length > 0 &&
|
|
14
|
+
!value.includes("\0") &&
|
|
15
|
+
!/[\uD800-\uDFFF]/u.test(value) &&
|
|
16
|
+
new TextEncoder().encode(value).byteLength <= 256,
|
|
17
|
+
);
|
|
18
|
+
const SubjectId = z
|
|
19
|
+
.string()
|
|
20
|
+
.min(1)
|
|
21
|
+
.max(1024)
|
|
22
|
+
.refine((value) => !value.includes("\0"));
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A share scales with the current workspace pool, including unexpired grants.
|
|
26
|
+
* Shares may exceed 1 and their sum may exceed 1: they are ceilings, not reserved
|
|
27
|
+
* allocations. Concurrent/in-flight calls can overshoot a ceiling; enforcement
|
|
28
|
+
* happens before the next call, after actual usage is settled.
|
|
29
|
+
* null removes the override and uses the workspace's memberDefault.
|
|
30
|
+
*/
|
|
31
|
+
export const MemberAllowanceRule = z.union([
|
|
32
|
+
z.object({ share: z.number().finite().nonnegative() }).strict(),
|
|
33
|
+
z.object({ credits: AllowanceCredits }).strict(),
|
|
34
|
+
z.null(),
|
|
35
|
+
]);
|
|
36
|
+
export type MemberAllowanceRule = z.infer<typeof MemberAllowanceRule>;
|
|
37
|
+
|
|
38
|
+
export const MemberAllowanceDefault = z.union([
|
|
39
|
+
z.enum(["none", "equal_share"]),
|
|
40
|
+
z.object({ share: z.number().finite().nonnegative() }).strict(),
|
|
41
|
+
z.object({ credits: AllowanceCredits }).strict(),
|
|
42
|
+
]);
|
|
43
|
+
export type MemberAllowanceDefault = z.infer<typeof MemberAllowanceDefault>;
|
|
44
|
+
|
|
45
|
+
const Thresholds = z.array(z.number().finite().positive().max(1)).max(16);
|
|
46
|
+
/** Omitted threshold lists default to [0.8, 1]. Monthly boundaries are UTC. */
|
|
47
|
+
export const WorkspaceAllowanceConfig = z
|
|
48
|
+
.object({
|
|
49
|
+
includedCredits: AllowanceCredits,
|
|
50
|
+
period: z.enum(["monthly", "none"]),
|
|
51
|
+
anchorDay: z.number().int().min(1).max(31).optional(),
|
|
52
|
+
memberDefault: MemberAllowanceDefault.optional(),
|
|
53
|
+
thresholds: z
|
|
54
|
+
.object({ workspace: Thresholds.optional(), member: Thresholds.optional() })
|
|
55
|
+
.strict()
|
|
56
|
+
.optional(),
|
|
57
|
+
})
|
|
58
|
+
.strict();
|
|
59
|
+
export type WorkspaceAllowanceConfig = z.infer<typeof WorkspaceAllowanceConfig>;
|
|
60
|
+
|
|
61
|
+
export const WorkspaceAllowance = WorkspaceAllowanceConfig.extend({ version: Version.min(1) });
|
|
62
|
+
export type WorkspaceAllowance = z.infer<typeof WorkspaceAllowance>;
|
|
63
|
+
/**
|
|
64
|
+
* Lifecycle version survives clear. version=0 means never configured; a null
|
|
65
|
+
* config with a positive version is cleared. Use this version for recreation.
|
|
66
|
+
* The existing nullable configuration read remains unchanged.
|
|
67
|
+
*/
|
|
68
|
+
export const WorkspaceAllowanceState = z
|
|
69
|
+
.object({ version: Version, config: WorkspaceAllowance.nullable() })
|
|
70
|
+
.strict()
|
|
71
|
+
.refine((state) => state.config === null || state.config.version === state.version, {
|
|
72
|
+
message: "Allowance configuration and lifecycle versions must match",
|
|
73
|
+
path: ["config", "version"],
|
|
74
|
+
});
|
|
75
|
+
export type WorkspaceAllowanceState = z.infer<typeof WorkspaceAllowanceState>;
|
|
76
|
+
export const SetWorkspaceAllowanceRequest = WorkspaceAllowanceConfig.extend({
|
|
77
|
+
expectedVersion: Version,
|
|
78
|
+
});
|
|
79
|
+
export type SetWorkspaceAllowanceRequest = z.infer<typeof SetWorkspaceAllowanceRequest>;
|
|
80
|
+
/** Reuse operationId and the exact expectedVersion to recover a lost clear
|
|
81
|
+
* receipt. A later lifecycle change conflicts; read the state before deciding
|
|
82
|
+
* on a new mutation, never guess a version or change it for a retry. */
|
|
83
|
+
export const ClearWorkspaceAllowanceRequest = z
|
|
84
|
+
.object({ expectedVersion: Version.min(1), operationId: OperationId.optional() })
|
|
85
|
+
.strict();
|
|
86
|
+
export type ClearWorkspaceAllowanceRequest = z.infer<typeof ClearWorkspaceAllowanceRequest>;
|
|
87
|
+
export const ClearWorkspaceAllowanceResponse = z.object({ version: Version.min(1) }).strict();
|
|
88
|
+
export type ClearWorkspaceAllowanceResponse = z.infer<typeof ClearWorkspaceAllowanceResponse>;
|
|
89
|
+
|
|
90
|
+
/** Reuse the operationId and exact request to recover an uncertain grant response. */
|
|
91
|
+
export const GrantWorkspaceCreditsRequest = z
|
|
92
|
+
.object({
|
|
93
|
+
operationId: OperationId,
|
|
94
|
+
credits: AllowanceCredits.positive(),
|
|
95
|
+
expiresAt: Timestamp.nullable().optional(),
|
|
96
|
+
})
|
|
97
|
+
.strict();
|
|
98
|
+
export type GrantWorkspaceCreditsRequest = z.infer<typeof GrantWorkspaceCreditsRequest>;
|
|
99
|
+
export const WorkspaceCreditGrant = GrantWorkspaceCreditsRequest.extend({
|
|
100
|
+
remaining: AllowanceCredits,
|
|
101
|
+
expiresAt: Timestamp.nullable(),
|
|
102
|
+
});
|
|
103
|
+
export type WorkspaceCreditGrant = z.infer<typeof WorkspaceCreditGrant>;
|
|
104
|
+
|
|
105
|
+
export const SetMemberAllowanceRequest = z
|
|
106
|
+
.object({
|
|
107
|
+
rule: MemberAllowanceRule,
|
|
108
|
+
expectedVersion: Version,
|
|
109
|
+
})
|
|
110
|
+
.strict();
|
|
111
|
+
export type SetMemberAllowanceRequest = z.infer<typeof SetMemberAllowanceRequest>;
|
|
112
|
+
export const MemberAllowance = z
|
|
113
|
+
.object({
|
|
114
|
+
subjectId: SubjectId,
|
|
115
|
+
rule: MemberAllowanceRule,
|
|
116
|
+
version: Version,
|
|
117
|
+
})
|
|
118
|
+
.strict();
|
|
119
|
+
export type MemberAllowance = z.infer<typeof MemberAllowance>;
|
|
120
|
+
|
|
121
|
+
export const UsageAllowancePeriod = z.union([
|
|
122
|
+
z.literal("current"),
|
|
123
|
+
z.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/),
|
|
124
|
+
]);
|
|
125
|
+
export type UsageAllowancePeriod = z.infer<typeof UsageAllowancePeriod>;
|
|
126
|
+
export const GetUsageRequest = z
|
|
127
|
+
.object({
|
|
128
|
+
period: UsageAllowancePeriod.optional(),
|
|
129
|
+
limit: z.number().int().min(1).max(200).optional(),
|
|
130
|
+
cursor: z.string().min(1).max(2048).optional(),
|
|
131
|
+
})
|
|
132
|
+
.strict();
|
|
133
|
+
export type GetUsageRequest = z.infer<typeof GetUsageRequest>;
|
|
134
|
+
export const GetMyUsageRequest = GetUsageRequest.pick({ period: true });
|
|
135
|
+
export type GetMyUsageRequest = z.infer<typeof GetMyUsageRequest>;
|
|
136
|
+
|
|
137
|
+
export const UsageAllowanceStatus = z.enum(["ok", "warning", "exhausted"]);
|
|
138
|
+
export type UsageAllowanceStatus = z.infer<typeof UsageAllowanceStatus>;
|
|
139
|
+
export const UsageAllowanceWindow = z
|
|
140
|
+
.object({
|
|
141
|
+
start: Timestamp.nullable(),
|
|
142
|
+
end: Timestamp.nullable(),
|
|
143
|
+
})
|
|
144
|
+
.strict();
|
|
145
|
+
export type UsageAllowanceWindow = z.infer<typeof UsageAllowanceWindow>;
|
|
146
|
+
const Usage = z.object({
|
|
147
|
+
limit: AllowanceCredits.nullable(),
|
|
148
|
+
used: AllowanceCredits,
|
|
149
|
+
remaining: z.number().int().safe().nullable(),
|
|
150
|
+
/** Display this ratio rather than raw USD micros in human-facing products. */
|
|
151
|
+
fraction: z.number().finite().nonnegative().nullable(),
|
|
152
|
+
status: UsageAllowanceStatus,
|
|
153
|
+
resetsAt: Timestamp.nullable(),
|
|
154
|
+
});
|
|
155
|
+
export const WorkspaceAllowanceUsage = Usage.extend({
|
|
156
|
+
includedCredits: AllowanceCredits,
|
|
157
|
+
grantsRemaining: AllowanceCredits,
|
|
158
|
+
}).strict();
|
|
159
|
+
export type WorkspaceAllowanceUsage = z.infer<typeof WorkspaceAllowanceUsage>;
|
|
160
|
+
export const MemberAllowanceUsage = Usage.extend({
|
|
161
|
+
subjectId: SubjectId,
|
|
162
|
+
externalIdentity: z.object({ source: z.string(), externalId: z.string() }).strict().nullable(),
|
|
163
|
+
rule: MemberAllowanceRule,
|
|
164
|
+
version: Version,
|
|
165
|
+
}).strict();
|
|
166
|
+
export type MemberAllowanceUsage = z.infer<typeof MemberAllowanceUsage>;
|
|
167
|
+
/** /usage/me returns only the authenticated subject's member row, never the roster. */
|
|
168
|
+
export const WorkspaceUsageResponse = z
|
|
169
|
+
.object({
|
|
170
|
+
period: UsageAllowanceWindow,
|
|
171
|
+
workspace: WorkspaceAllowanceUsage,
|
|
172
|
+
members: z.array(MemberAllowanceUsage),
|
|
173
|
+
nextCursor: z.string().nullable(),
|
|
174
|
+
})
|
|
175
|
+
.strict();
|
|
176
|
+
export type WorkspaceUsageResponse = z.infer<typeof WorkspaceUsageResponse>;
|
|
177
|
+
|
|
178
|
+
export const AllowanceExhaustedRefusal = z
|
|
179
|
+
.object({
|
|
180
|
+
code: z.literal("allowance_exhausted"),
|
|
181
|
+
scope: z.enum(["workspace", "member"]),
|
|
182
|
+
resetsAt: Timestamp.nullable(),
|
|
183
|
+
subjectId: SubjectId.optional(),
|
|
184
|
+
message: z.string(),
|
|
185
|
+
})
|
|
186
|
+
.strict();
|
|
187
|
+
export type AllowanceExhaustedRefusal = z.infer<typeof AllowanceExhaustedRefusal>;
|
package/src/video-generation.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
|
|
8
8
|
export const VIDEO_GENERATION_SCHEMA_VERSION = 1 as const;
|
|
9
9
|
export const SEEDANCE_2_5_MODEL_ID = "bytedance/seedance-2.5" as const;
|
|
10
|
+
export const GROK_IMAGINE_VIDEO_1_5_MODEL_ID = "xai/grok-imagine-video-1.5" as const;
|
|
10
11
|
|
|
11
12
|
export const VideoGenerationSourceMode = z.enum([
|
|
12
13
|
"text",
|
|
@@ -20,7 +21,11 @@ export type VideoGenerationSourceMode = z.infer<typeof VideoGenerationSourceMode
|
|
|
20
21
|
export const VideoGenerationResolution = z.enum(["480p", "720p"]);
|
|
21
22
|
export type VideoGenerationResolution = z.infer<typeof VideoGenerationResolution>;
|
|
22
23
|
|
|
23
|
-
export const VideoGenerationFundingSource = z.enum([
|
|
24
|
+
export const VideoGenerationFundingSource = z.enum([
|
|
25
|
+
"opengeni_credits",
|
|
26
|
+
"workspace_gateway",
|
|
27
|
+
"supergrok_subscription",
|
|
28
|
+
]);
|
|
24
29
|
export type VideoGenerationFundingSource = z.infer<typeof VideoGenerationFundingSource>;
|
|
25
30
|
|
|
26
31
|
export const VideoGenerationAspectRatio = z.enum([
|
|
@@ -131,7 +136,11 @@ export const VideoGenerationCapabilities = z
|
|
|
131
136
|
.superRefine((value, ctx) => {
|
|
132
137
|
const ids = new Set(value.models.map((model) => model.modelId));
|
|
133
138
|
if (ids.size !== value.models.length) {
|
|
134
|
-
ctx.addIssue({
|
|
139
|
+
ctx.addIssue({
|
|
140
|
+
code: "custom",
|
|
141
|
+
path: ["models"],
|
|
142
|
+
message: "model ids must be unique",
|
|
143
|
+
});
|
|
135
144
|
}
|
|
136
145
|
if (!ids.has(value.defaultModelId)) {
|
|
137
146
|
ctx.addIssue({
|
|
@@ -205,21 +214,22 @@ export const WorkspaceVideoGenerationSettings = z
|
|
|
205
214
|
.object({
|
|
206
215
|
schemaVersion: z.literal(VIDEO_GENERATION_SCHEMA_VERSION),
|
|
207
216
|
policy: VideoGenerationPolicy,
|
|
208
|
-
fundingOptions: z.array(VideoGenerationFundingOption).length(
|
|
217
|
+
fundingOptions: z.array(VideoGenerationFundingOption).length(3),
|
|
209
218
|
availableModels: z.array(VideoGenerationModelCapability).max(16),
|
|
210
219
|
capabilities: VideoGenerationCapabilities.nullable(),
|
|
211
220
|
})
|
|
212
221
|
.strict()
|
|
213
222
|
.superRefine((value, ctx) => {
|
|
214
223
|
if (
|
|
215
|
-
new Set(value.fundingOptions.map((option) => option.source)).size !==
|
|
224
|
+
new Set(value.fundingOptions.map((option) => option.source)).size !== 3 ||
|
|
216
225
|
!value.fundingOptions.some((option) => option.source === "opengeni_credits") ||
|
|
217
|
-
!value.fundingOptions.some((option) => option.source === "workspace_gateway")
|
|
226
|
+
!value.fundingOptions.some((option) => option.source === "workspace_gateway") ||
|
|
227
|
+
!value.fundingOptions.some((option) => option.source === "supergrok_subscription")
|
|
218
228
|
) {
|
|
219
229
|
ctx.addIssue({
|
|
220
230
|
code: "custom",
|
|
221
231
|
path: ["fundingOptions"],
|
|
222
|
-
message: "
|
|
232
|
+
message: "all funding sources must be described exactly once",
|
|
223
233
|
});
|
|
224
234
|
}
|
|
225
235
|
const selected = value.fundingOptions.find(
|
|
@@ -250,6 +260,33 @@ export const VideoGenerationAcceptedReceipt = z
|
|
|
250
260
|
.strict();
|
|
251
261
|
export type VideoGenerationAcceptedReceipt = z.infer<typeof VideoGenerationAcceptedReceipt>;
|
|
252
262
|
|
|
263
|
+
export const VideoGenerationRejectedCode = z.enum([
|
|
264
|
+
"invalid_reference_path",
|
|
265
|
+
"reference_not_stable",
|
|
266
|
+
"reference_too_large",
|
|
267
|
+
"reference_media_type_mismatch",
|
|
268
|
+
"unsupported_reference_media",
|
|
269
|
+
]);
|
|
270
|
+
export type VideoGenerationRejectedCode = z.infer<typeof VideoGenerationRejectedCode>;
|
|
271
|
+
|
|
272
|
+
/** Deterministic pre-admission rejection: no provider request or durable operation was created. */
|
|
273
|
+
export const VideoGenerationRejectedResult = z
|
|
274
|
+
.object({
|
|
275
|
+
schemaVersion: z.literal(VIDEO_GENERATION_SCHEMA_VERSION),
|
|
276
|
+
status: z.literal("rejected"),
|
|
277
|
+
code: VideoGenerationRejectedCode,
|
|
278
|
+
message: z.string().min(1).max(512),
|
|
279
|
+
operationCreated: z.literal(false),
|
|
280
|
+
})
|
|
281
|
+
.strict();
|
|
282
|
+
export type VideoGenerationRejectedResult = z.infer<typeof VideoGenerationRejectedResult>;
|
|
283
|
+
|
|
284
|
+
export const VideoGenerationToolResult = z.discriminatedUnion("status", [
|
|
285
|
+
VideoGenerationAcceptedReceipt,
|
|
286
|
+
VideoGenerationRejectedResult,
|
|
287
|
+
]);
|
|
288
|
+
export type VideoGenerationToolResult = z.infer<typeof VideoGenerationToolResult>;
|
|
289
|
+
|
|
253
290
|
export const GeneratedVideoFacts = z
|
|
254
291
|
.object({
|
|
255
292
|
durationSeconds: z.number().positive().max(120),
|