@opengeni/contracts 0.50.0 → 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 +26 -12
- 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/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-M5ZGRVIQ.js → chunk-5IXYF6XN.js} +14 -5
- 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-CM6BMECR.js → chunk-GRG7PHWQ.js} +2 -1
- package/dist/chunk-GRG7PHWQ.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-LW7OH6CS.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-JBCIY7QD.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/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 +18 -8
- 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 +47 -35
- 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 +90 -16
- 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 +32396 -11386
- package/dist/index.js +2198 -164
- 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 +344 -0
- package/dist/knowledge-entries.d.ts +982 -0
- package/dist/knowledge-preparation.d.ts +237 -0
- package/dist/knowledge.d.ts +197 -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/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 +42 -1
- 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 +3 -0
- package/dist/video-generation.js +1 -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 +3 -0
- package/dist/xai-provider-account-authority.js +1 -1
- package/package.json +134 -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/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/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 +7093 -1466
- package/src/insights-usage.ts +679 -0
- package/src/interaction.ts +220 -5
- package/src/knowledge-entries.ts +375 -0
- package/src/knowledge-preparation.ts +50 -0
- package/src/knowledge.ts +134 -6
- 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/spreadsheet-artifact-commands.ts +12 -13
- package/src/subscription-account-pools.ts +44 -0
- package/src/task-notes.ts +14 -1
- package/src/tool-catalog.ts +155 -0
- package/src/tool-result-spill.ts +35 -0
- package/src/usage-allowances.ts +187 -0
- 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 +1 -0
- 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-CM6BMECR.js.map +0 -1
- package/dist/chunk-JBCIY7QD.js.map +0 -1
- package/dist/chunk-LSB7GRLG.js.map +0 -1
- package/dist/chunk-LW7OH6CS.js.map +0 -1
- package/dist/chunk-M5ZGRVIQ.js.map +0 -1
- package/dist/chunk-Q6A7XT2N.js +0 -16734
- package/dist/chunk-Q6A7XT2N.js.map +0 -1
- package/dist/chunk-TZ6YEYN4.js.map +0 -1
- package/dist/chunk-Y3MLSLB4.js.map +0 -1
- /package/dist/{chunk-CADSX6UN.js.map → chunk-Y3KNXVTD.js.map} +0 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
// src/modal-native-proof-v2.ts
|
|
2
|
+
import { z as z2 } from "zod";
|
|
3
|
+
|
|
4
|
+
// src/sandbox-provider-command.ts
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
var ModalOutputCursor = z.object({
|
|
7
|
+
batchIndex: z.number().int().nonnegative().safe(),
|
|
8
|
+
utf8Remainder: z.string().max(8).regex(/^[A-Za-z0-9+/]*={0,2}$/u),
|
|
9
|
+
exitCode: z.number().int().nullable()
|
|
10
|
+
}).strict();
|
|
11
|
+
var ModalLegacyProviderCommand = z.object({
|
|
12
|
+
kind: z.literal("modal-control-v1"),
|
|
13
|
+
sandboxId: z.string().min(1).max(200),
|
|
14
|
+
taskId: z.string().min(1).max(200),
|
|
15
|
+
execId: z.string().min(1).max(200),
|
|
16
|
+
pty: z.boolean().optional(),
|
|
17
|
+
streams: z.object({ stdout: ModalOutputCursor, stderr: ModalOutputCursor }).strict()
|
|
18
|
+
}).strict();
|
|
19
|
+
var ModalByteCursor = z.object({
|
|
20
|
+
byteOffset: z.number().int().nonnegative().safe(),
|
|
21
|
+
utf8Remainder: z.string().max(8).regex(/^[A-Za-z0-9+/]*={0,2}$/u),
|
|
22
|
+
eof: z.boolean(),
|
|
23
|
+
exitCode: z.number().int().nullable()
|
|
24
|
+
}).strict().refine((cursor) => cursor.exitCode === null || cursor.eof, {
|
|
25
|
+
message: "A terminal output cursor must have reached EOF"
|
|
26
|
+
});
|
|
27
|
+
var CommandSupervisionDescriptor = z.object({
|
|
28
|
+
protocol: z.literal("native-subreaper-v1"),
|
|
29
|
+
invocationId: z.string().uuid(),
|
|
30
|
+
nonce: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
31
|
+
controlPath: z.string().regex(/^\/tmp\/opengeni-supervision\/[a-f0-9-]{36}\.sock$/u)
|
|
32
|
+
}).strict();
|
|
33
|
+
var CommandSupervisionReceipt = z.object({
|
|
34
|
+
protocol: z.literal("native-subreaper-v1"),
|
|
35
|
+
invocationId: z.string().uuid(),
|
|
36
|
+
receiptId: z.string().uuid(),
|
|
37
|
+
leaderExitCode: z.number().int()
|
|
38
|
+
}).strict();
|
|
39
|
+
var ModalRouterProviderCommand = z.object({
|
|
40
|
+
kind: z.literal("modal-router-v1"),
|
|
41
|
+
sandboxId: z.string().min(1).max(200),
|
|
42
|
+
taskId: z.string().min(1).max(200),
|
|
43
|
+
execId: z.string().uuid(),
|
|
44
|
+
pty: z.boolean().optional(),
|
|
45
|
+
supervision: CommandSupervisionDescriptor.optional(),
|
|
46
|
+
streams: z.object({ stdout: ModalByteCursor, stderr: ModalByteCursor }).strict()
|
|
47
|
+
}).strict();
|
|
48
|
+
var SandboxProviderCommand = z.discriminatedUnion("kind", [
|
|
49
|
+
ModalLegacyProviderCommand,
|
|
50
|
+
ModalRouterProviderCommand
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
// src/modal-native-proof-v2.ts
|
|
54
|
+
var MODAL_NATIVE_PROOF_PROTOCOL_VERSION = 2;
|
|
55
|
+
var MODAL_NATIVE_FRESH_COMPILER_FINGERPRINT = "db6d33c8a1142e5ffe3d1a130d8b9f9d819e46832ad0417d41d5606b7fe25ab1";
|
|
56
|
+
var uuid = z2.string().regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/u);
|
|
57
|
+
var commandExecId = uuid.pipe(ModalRouterProviderCommand.shape.execId);
|
|
58
|
+
var positive = z2.number().int().positive().safe();
|
|
59
|
+
var nonnegative = z2.number().int().nonnegative().safe();
|
|
60
|
+
var digest = z2.string().regex(/^[a-f0-9]{64}$/u);
|
|
61
|
+
var empty = z2.object({}).strict();
|
|
62
|
+
var noItems = z2.tuple([]);
|
|
63
|
+
var entrypoint = z2.tuple([z2.literal("sleep"), z2.literal("infinity")]);
|
|
64
|
+
var sourceSha = "bb830ded1925e1d927d1fc221b2329d961f9a57eafdd9a85bf13fb7cfc982599";
|
|
65
|
+
var ModalNativeFreshNormalizationV1 = z2.object({
|
|
66
|
+
recipeId: z2.literal("modal-native-fresh-v1"),
|
|
67
|
+
recipeRevision: z2.literal(1),
|
|
68
|
+
schema: z2.literal("modal.client.ModalClient/SandboxCreate"),
|
|
69
|
+
encoding: z2.literal("modal-create-json-v1"),
|
|
70
|
+
sdkVersion: z2.literal("0.9.0"),
|
|
71
|
+
sdkSourceSha256: z2.literal(sourceSha),
|
|
72
|
+
entrypoint,
|
|
73
|
+
createWorkdir: z2.literal("/tmp"),
|
|
74
|
+
env: empty,
|
|
75
|
+
mounts: noItems,
|
|
76
|
+
restore: z2.null(),
|
|
77
|
+
idleTimeout: z2.literal("unset"),
|
|
78
|
+
gpu: z2.literal("unset"),
|
|
79
|
+
gpuProto: z2.object({ type: z2.literal(0), count: z2.literal(0), gpuType: z2.literal("") }).strict(),
|
|
80
|
+
cpuLimit: z2.literal("unset"),
|
|
81
|
+
memoryLimit: z2.literal("unset"),
|
|
82
|
+
pty: z2.literal("unset"),
|
|
83
|
+
regions: z2.literal("unset"),
|
|
84
|
+
proxy: z2.literal("unset"),
|
|
85
|
+
readinessProbe: z2.literal("unset"),
|
|
86
|
+
environmentVariables: z2.literal("unset"),
|
|
87
|
+
network: z2.object({
|
|
88
|
+
access: z2.literal("OPEN"),
|
|
89
|
+
outboundCidrs: noItems,
|
|
90
|
+
outboundDomains: noItems,
|
|
91
|
+
inboundCidrs: noItems,
|
|
92
|
+
i6pn: z2.literal(false)
|
|
93
|
+
}).strict(),
|
|
94
|
+
volumes: noItems,
|
|
95
|
+
cloudBucketMounts: noItems,
|
|
96
|
+
secrets: noItems,
|
|
97
|
+
ports: noItems,
|
|
98
|
+
cloud: z2.literal(""),
|
|
99
|
+
verbose: z2.literal(false),
|
|
100
|
+
includeOidcIdentityToken: z2.literal(false),
|
|
101
|
+
experimentalOptions: empty,
|
|
102
|
+
experimentalOptionsV2: empty,
|
|
103
|
+
customDomain: z2.literal("")
|
|
104
|
+
}).strict();
|
|
105
|
+
function freezeLiteral(value) {
|
|
106
|
+
if (value !== null && typeof value === "object") {
|
|
107
|
+
for (const child of Object.values(value)) freezeLiteral(child);
|
|
108
|
+
Object.freeze(value);
|
|
109
|
+
}
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
var MODAL_NATIVE_FRESH_NORMALIZATION_V1 = freezeLiteral(
|
|
113
|
+
ModalNativeFreshNormalizationV1.parse({
|
|
114
|
+
recipeId: "modal-native-fresh-v1",
|
|
115
|
+
recipeRevision: 1,
|
|
116
|
+
schema: "modal.client.ModalClient/SandboxCreate",
|
|
117
|
+
encoding: "modal-create-json-v1",
|
|
118
|
+
sdkVersion: "0.9.0",
|
|
119
|
+
sdkSourceSha256: sourceSha,
|
|
120
|
+
entrypoint: ["sleep", "infinity"],
|
|
121
|
+
createWorkdir: "/tmp",
|
|
122
|
+
env: {},
|
|
123
|
+
mounts: [],
|
|
124
|
+
restore: null,
|
|
125
|
+
idleTimeout: "unset",
|
|
126
|
+
gpu: "unset",
|
|
127
|
+
gpuProto: { type: 0, count: 0, gpuType: "" },
|
|
128
|
+
cpuLimit: "unset",
|
|
129
|
+
memoryLimit: "unset",
|
|
130
|
+
pty: "unset",
|
|
131
|
+
regions: "unset",
|
|
132
|
+
proxy: "unset",
|
|
133
|
+
readinessProbe: "unset",
|
|
134
|
+
environmentVariables: "unset",
|
|
135
|
+
network: {
|
|
136
|
+
access: "OPEN",
|
|
137
|
+
outboundCidrs: [],
|
|
138
|
+
outboundDomains: [],
|
|
139
|
+
inboundCidrs: [],
|
|
140
|
+
i6pn: false
|
|
141
|
+
},
|
|
142
|
+
volumes: [],
|
|
143
|
+
cloudBucketMounts: [],
|
|
144
|
+
secrets: [],
|
|
145
|
+
ports: [],
|
|
146
|
+
cloud: "",
|
|
147
|
+
verbose: false,
|
|
148
|
+
includeOidcIdentityToken: false,
|
|
149
|
+
experimentalOptions: {},
|
|
150
|
+
experimentalOptionsV2: {},
|
|
151
|
+
customDomain: ""
|
|
152
|
+
})
|
|
153
|
+
);
|
|
154
|
+
var ModalNativePreparationRecipeV2 = z2.object({
|
|
155
|
+
version: z2.literal(1),
|
|
156
|
+
recipeId: z2.literal("modal-native-fresh-v1"),
|
|
157
|
+
recipeRevision: z2.literal(1),
|
|
158
|
+
createWorkdir: z2.literal("/tmp"),
|
|
159
|
+
entrypoint,
|
|
160
|
+
normalization: ModalNativeFreshNormalizationV1,
|
|
161
|
+
compilerFingerprint: z2.literal(MODAL_NATIVE_FRESH_COMPILER_FINGERPRINT)
|
|
162
|
+
}).strict();
|
|
163
|
+
var MODAL_NATIVE_PREPARATION_RECIPE_V2 = freezeLiteral(
|
|
164
|
+
ModalNativePreparationRecipeV2.parse({
|
|
165
|
+
version: 1,
|
|
166
|
+
recipeId: "modal-native-fresh-v1",
|
|
167
|
+
recipeRevision: 1,
|
|
168
|
+
createWorkdir: "/tmp",
|
|
169
|
+
entrypoint: ["sleep", "infinity"],
|
|
170
|
+
normalization: MODAL_NATIVE_FRESH_NORMALIZATION_V1,
|
|
171
|
+
compilerFingerprint: MODAL_NATIVE_FRESH_COMPILER_FINGERPRINT
|
|
172
|
+
})
|
|
173
|
+
);
|
|
174
|
+
var ModalNativeFreshBlueprintV1 = z2.object({
|
|
175
|
+
version: z2.literal(1),
|
|
176
|
+
adapterId: z2.literal("modal-native-fresh-creator-reservation-v1"),
|
|
177
|
+
create: z2.object({
|
|
178
|
+
operationId: uuid,
|
|
179
|
+
appId: z2.string().regex(/^ap-[A-Za-z0-9_-]{1,200}$/u),
|
|
180
|
+
imageId: z2.string().regex(/^im-[A-Za-z0-9_-]{1,200}$/u),
|
|
181
|
+
cpu: z2.number().positive().max(128).refine(
|
|
182
|
+
(v) => Number.isSafeInteger(Math.trunc(v * 1e3)) && Math.trunc(v * 1e3) >= 1 && Math.trunc(v * 1e3) / 1e3 === v
|
|
183
|
+
),
|
|
184
|
+
memoryMiB: z2.number().int().min(128).max(1048576).safe(),
|
|
185
|
+
timeoutSeconds: z2.number().int().min(1).max(86400).safe(),
|
|
186
|
+
env: empty,
|
|
187
|
+
mounts: noItems
|
|
188
|
+
}).strict(),
|
|
189
|
+
restore: z2.null(),
|
|
190
|
+
readiness: z2.object({
|
|
191
|
+
operationId: uuid,
|
|
192
|
+
execId: commandExecId,
|
|
193
|
+
commandArgs: z2.tuple([z2.literal("/bin/true")]),
|
|
194
|
+
workdir: z2.literal("/tmp"),
|
|
195
|
+
env: empty
|
|
196
|
+
}).strict(),
|
|
197
|
+
publishOperationId: uuid,
|
|
198
|
+
cleanup: z2.object({ operationId: uuid, requires: z2.literal("physical-terminal-proof") }).strict()
|
|
199
|
+
}).strict();
|
|
200
|
+
var ModalNativeOriginalScopeV2 = z2.object({
|
|
201
|
+
version: z2.literal(2),
|
|
202
|
+
declarationId: uuid,
|
|
203
|
+
planId: uuid,
|
|
204
|
+
creatorId: uuid,
|
|
205
|
+
accountId: uuid,
|
|
206
|
+
workspaceId: uuid,
|
|
207
|
+
sessionId: uuid,
|
|
208
|
+
turnId: uuid,
|
|
209
|
+
attemptId: uuid,
|
|
210
|
+
executionGeneration: positive,
|
|
211
|
+
triggerEventId: uuid,
|
|
212
|
+
sandboxGroupId: uuid,
|
|
213
|
+
routeKind: z2.literal("home"),
|
|
214
|
+
routeTargetId: z2.null(),
|
|
215
|
+
routeEpoch: nonnegative
|
|
216
|
+
}).strict().refine((v) => v.creatorId !== v.attemptId && v.creatorId !== v.planId, {
|
|
217
|
+
message: "A declared creator is distinct from the accepted attempt and plan"
|
|
218
|
+
});
|
|
219
|
+
var ModalNativeConfigurationCaptureRefV2 = z2.object({ id: uuid, revision: positive }).strict();
|
|
220
|
+
var ModalNativeProofGrantRefV2 = z2.object({ id: uuid, epoch: positive }).strict();
|
|
221
|
+
var ModalNativeReservedLeaseRefV2 = z2.object({ id: uuid, epoch: nonnegative }).strict();
|
|
222
|
+
var ModalNativePreparationDeclarationV2 = z2.object({
|
|
223
|
+
version: z2.literal(2),
|
|
224
|
+
scope: ModalNativeOriginalScopeV2,
|
|
225
|
+
blueprint: ModalNativeFreshBlueprintV1,
|
|
226
|
+
preparationRecipe: ModalNativePreparationRecipeV2,
|
|
227
|
+
configurationCaptureRef: ModalNativeConfigurationCaptureRefV2,
|
|
228
|
+
proofGrantRef: ModalNativeProofGrantRefV2,
|
|
229
|
+
providerRecoveryCount: z2.union([
|
|
230
|
+
z2.literal(0),
|
|
231
|
+
z2.literal(1),
|
|
232
|
+
z2.literal(2),
|
|
233
|
+
z2.literal(3),
|
|
234
|
+
z2.literal(4),
|
|
235
|
+
z2.literal(5)
|
|
236
|
+
]),
|
|
237
|
+
namespaceState: z2.literal("unbound")
|
|
238
|
+
}).strict().superRefine((v, ctx) => {
|
|
239
|
+
const ids = [
|
|
240
|
+
v.scope.planId,
|
|
241
|
+
v.scope.creatorId,
|
|
242
|
+
v.blueprint.create.operationId,
|
|
243
|
+
v.blueprint.readiness.operationId,
|
|
244
|
+
v.blueprint.readiness.execId,
|
|
245
|
+
v.blueprint.publishOperationId,
|
|
246
|
+
v.blueprint.cleanup.operationId
|
|
247
|
+
];
|
|
248
|
+
if (new Set(ids).size !== 7)
|
|
249
|
+
ctx.addIssue({
|
|
250
|
+
code: "custom",
|
|
251
|
+
message: "All seven supplied operation identities must be distinct"
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
var safeEndpoint = z2.string().url().max(1024).refine(
|
|
255
|
+
(v) => {
|
|
256
|
+
try {
|
|
257
|
+
const url = new URL(v);
|
|
258
|
+
return url.protocol === "https:" && !url.username && !url.password && !url.search && !url.hash;
|
|
259
|
+
} catch {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
{ message: "Only a credential-free captured HTTPS endpoint is supported" }
|
|
264
|
+
);
|
|
265
|
+
var ModalNativeNamespaceEvidenceV2 = z2.object({
|
|
266
|
+
version: z2.literal(2),
|
|
267
|
+
scope: ModalNativeOriginalScopeV2,
|
|
268
|
+
configurationCaptureRef: ModalNativeConfigurationCaptureRefV2,
|
|
269
|
+
proofGrantRef: ModalNativeProofGrantRefV2,
|
|
270
|
+
claimId: uuid,
|
|
271
|
+
nonce: uuid,
|
|
272
|
+
claimRevision: positive,
|
|
273
|
+
recordRevision: positive,
|
|
274
|
+
captureId: uuid,
|
|
275
|
+
purpose: z2.literal("original-namespace-read"),
|
|
276
|
+
reservation: ModalNativeReservedLeaseRefV2,
|
|
277
|
+
source: z2.literal("modal-client-workspace-name-lookup-v1"),
|
|
278
|
+
responseField: z2.enum(["workspaceName", "username"]),
|
|
279
|
+
binding: z2.object({
|
|
280
|
+
version: z2.literal(1),
|
|
281
|
+
serverUrl: safeEndpoint,
|
|
282
|
+
workspaceName: z2.string().min(1).max(200),
|
|
283
|
+
environment: z2.string().max(200)
|
|
284
|
+
}).strict()
|
|
285
|
+
}).strict();
|
|
286
|
+
var claimFields = {
|
|
287
|
+
version: z2.literal(2),
|
|
288
|
+
scope: ModalNativeOriginalScopeV2,
|
|
289
|
+
configurationCaptureRef: ModalNativeConfigurationCaptureRefV2,
|
|
290
|
+
proofGrantRef: ModalNativeProofGrantRefV2,
|
|
291
|
+
claimId: uuid,
|
|
292
|
+
nonce: uuid,
|
|
293
|
+
claimRevision: positive,
|
|
294
|
+
recordRevision: positive,
|
|
295
|
+
captureId: uuid,
|
|
296
|
+
expiresAt: z2.string().datetime()
|
|
297
|
+
};
|
|
298
|
+
var ModalNativeNamespaceReadClaimV2 = z2.object({
|
|
299
|
+
...claimFields,
|
|
300
|
+
purpose: z2.literal("original-namespace-read"),
|
|
301
|
+
reservation: ModalNativeReservedLeaseRefV2
|
|
302
|
+
}).strict();
|
|
303
|
+
var ModalNativeOriginalCommandReadClaimV2 = z2.object({
|
|
304
|
+
...claimFields,
|
|
305
|
+
purpose: z2.literal("original-readiness-read"),
|
|
306
|
+
reservation: ModalNativeReservedLeaseRefV2,
|
|
307
|
+
physicalOwnerGeneration: positive,
|
|
308
|
+
operationId: uuid,
|
|
309
|
+
providerBindingKey: z2.string().min(1).max(1024),
|
|
310
|
+
command: ModalRouterProviderCommand.refine((v) => v.pty !== true)
|
|
311
|
+
}).strict();
|
|
312
|
+
var ModalNativePreparedStartDescriptionV1 = z2.object({
|
|
313
|
+
taskId: z2.string().min(1).max(200),
|
|
314
|
+
execId: commandExecId,
|
|
315
|
+
descriptorProtocol: z2.literal("modal-prepared-start-descriptor"),
|
|
316
|
+
descriptorVersion: z2.literal(1),
|
|
317
|
+
readinessRecipe: z2.literal("modal-exec-readiness-bin-true-v1"),
|
|
318
|
+
readinessRecipeVersion: z2.literal(1),
|
|
319
|
+
startMessage: z2.literal("Start"),
|
|
320
|
+
rpcMethod: z2.literal("/modal.task_command_router.TaskCommandRouter/TaskExecStart"),
|
|
321
|
+
encoderVersion: z2.literal("protobufjs@7.6.5"),
|
|
322
|
+
preflight: z2.object({
|
|
323
|
+
encoding: z2.literal("modal-start-protobuf-preflight-v1"),
|
|
324
|
+
sha256: digest,
|
|
325
|
+
byteLength: positive.max(1024 * 1024),
|
|
326
|
+
encoderFingerprint: z2.string().regex(/^sha256:[a-f0-9]{64}$/u)
|
|
327
|
+
}).strict()
|
|
328
|
+
}).strict();
|
|
329
|
+
|
|
330
|
+
export {
|
|
331
|
+
ModalLegacyProviderCommand,
|
|
332
|
+
CommandSupervisionDescriptor,
|
|
333
|
+
CommandSupervisionReceipt,
|
|
334
|
+
ModalRouterProviderCommand,
|
|
335
|
+
SandboxProviderCommand,
|
|
336
|
+
MODAL_NATIVE_PROOF_PROTOCOL_VERSION,
|
|
337
|
+
MODAL_NATIVE_FRESH_COMPILER_FINGERPRINT,
|
|
338
|
+
ModalNativeFreshNormalizationV1,
|
|
339
|
+
MODAL_NATIVE_FRESH_NORMALIZATION_V1,
|
|
340
|
+
ModalNativePreparationRecipeV2,
|
|
341
|
+
MODAL_NATIVE_PREPARATION_RECIPE_V2,
|
|
342
|
+
ModalNativeFreshBlueprintV1,
|
|
343
|
+
ModalNativeOriginalScopeV2,
|
|
344
|
+
ModalNativeConfigurationCaptureRefV2,
|
|
345
|
+
ModalNativeProofGrantRefV2,
|
|
346
|
+
ModalNativeReservedLeaseRefV2,
|
|
347
|
+
ModalNativePreparationDeclarationV2,
|
|
348
|
+
ModalNativeNamespaceEvidenceV2,
|
|
349
|
+
ModalNativeNamespaceReadClaimV2,
|
|
350
|
+
ModalNativeOriginalCommandReadClaimV2,
|
|
351
|
+
ModalNativePreparedStartDescriptionV1
|
|
352
|
+
};
|
|
353
|
+
//# sourceMappingURL=chunk-2VORLN2R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/modal-native-proof-v2.ts","../src/sandbox-provider-command.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { ModalRouterProviderCommand } from \"./sandbox-provider-command\";\n\n/** Secret-free descriptions for the NEW native proof protocol. Parsing any\n * value below establishes correlation ONLY. It does not authenticate a host,\n * native response, grant, election, capture, Start, or semantic continuation.\n * Frozen reservation/journal v1 values are never adopted into this protocol. */\nexport const MODAL_NATIVE_PROOF_PROTOCOL_VERSION = 2 as const;\nexport const MODAL_NATIVE_FRESH_COMPILER_FINGERPRINT =\n \"db6d33c8a1142e5ffe3d1a130d8b9f9d819e46832ad0417d41d5606b7fe25ab1\" as const;\n\nconst uuid = z.string().regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/u);\n// Fresh readiness must round-trip through the retained original-command schema.\n// Reuse its exact UUID domain; do not widen it or change the frozen compiler.\nconst commandExecId = uuid.pipe(ModalRouterProviderCommand.shape.execId);\nconst positive = z.number().int().positive().safe();\nconst nonnegative = z.number().int().nonnegative().safe();\nconst digest = z.string().regex(/^[a-f0-9]{64}$/u);\nconst empty = z.object({}).strict();\nconst noItems = z.tuple([]);\nconst entrypoint = z.tuple([z.literal(\"sleep\"), z.literal(\"infinity\")]);\nconst sourceSha = \"bb830ded1925e1d927d1fc221b2329d961f9a57eafdd9a85bf13fb7cfc982599\";\n\n/** This entire profile is declared BEFORE even namespace lookup. It is a\n * reviewed literal, not caller-selected defaults or an arbitrary self-hash. */\nexport const ModalNativeFreshNormalizationV1 = z\n .object({\n recipeId: z.literal(\"modal-native-fresh-v1\"),\n recipeRevision: z.literal(1),\n schema: z.literal(\"modal.client.ModalClient/SandboxCreate\"),\n encoding: z.literal(\"modal-create-json-v1\"),\n sdkVersion: z.literal(\"0.9.0\"),\n sdkSourceSha256: z.literal(sourceSha),\n entrypoint,\n createWorkdir: z.literal(\"/tmp\"),\n env: empty,\n mounts: noItems,\n restore: z.null(),\n idleTimeout: z.literal(\"unset\"),\n gpu: z.literal(\"unset\"),\n gpuProto: z\n .object({ type: z.literal(0), count: z.literal(0), gpuType: z.literal(\"\") })\n .strict(),\n cpuLimit: z.literal(\"unset\"),\n memoryLimit: z.literal(\"unset\"),\n pty: z.literal(\"unset\"),\n regions: z.literal(\"unset\"),\n proxy: z.literal(\"unset\"),\n readinessProbe: z.literal(\"unset\"),\n environmentVariables: z.literal(\"unset\"),\n network: z\n .object({\n access: z.literal(\"OPEN\"),\n outboundCidrs: noItems,\n outboundDomains: noItems,\n inboundCidrs: noItems,\n i6pn: z.literal(false),\n })\n .strict(),\n volumes: noItems,\n cloudBucketMounts: noItems,\n secrets: noItems,\n ports: noItems,\n cloud: z.literal(\"\"),\n verbose: z.literal(false),\n includeOidcIdentityToken: z.literal(false),\n experimentalOptions: empty,\n experimentalOptionsV2: empty,\n customDomain: z.literal(\"\"),\n })\n .strict();\nexport type ModalNativeFreshNormalizationV1 = z.infer<typeof ModalNativeFreshNormalizationV1>;\n\nfunction freezeLiteral<T>(value: T): T {\n if (value !== null && typeof value === \"object\") {\n for (const child of Object.values(value)) freezeLiteral(child);\n Object.freeze(value);\n }\n return value;\n}\n\n/** Public, credential-free recipe data. The host must normatively select this\n * literal before I/O; possessing a copy supplies no issuance provenance. */\nexport const MODAL_NATIVE_FRESH_NORMALIZATION_V1 = freezeLiteral(\n ModalNativeFreshNormalizationV1.parse({\n recipeId: \"modal-native-fresh-v1\",\n recipeRevision: 1,\n schema: \"modal.client.ModalClient/SandboxCreate\",\n encoding: \"modal-create-json-v1\",\n sdkVersion: \"0.9.0\",\n sdkSourceSha256: sourceSha,\n entrypoint: [\"sleep\", \"infinity\"],\n createWorkdir: \"/tmp\",\n env: {},\n mounts: [],\n restore: null,\n idleTimeout: \"unset\",\n gpu: \"unset\",\n gpuProto: { type: 0, count: 0, gpuType: \"\" },\n cpuLimit: \"unset\",\n memoryLimit: \"unset\",\n pty: \"unset\",\n regions: \"unset\",\n proxy: \"unset\",\n readinessProbe: \"unset\",\n environmentVariables: \"unset\",\n network: {\n access: \"OPEN\",\n outboundCidrs: [],\n outboundDomains: [],\n inboundCidrs: [],\n i6pn: false,\n },\n volumes: [],\n cloudBucketMounts: [],\n secrets: [],\n ports: [],\n cloud: \"\",\n verbose: false,\n includeOidcIdentityToken: false,\n experimentalOptions: {},\n experimentalOptionsV2: {},\n customDomain: \"\",\n }),\n);\n\nexport const ModalNativePreparationRecipeV2 = z\n .object({\n version: z.literal(1),\n recipeId: z.literal(\"modal-native-fresh-v1\"),\n recipeRevision: z.literal(1),\n createWorkdir: z.literal(\"/tmp\"),\n entrypoint,\n normalization: ModalNativeFreshNormalizationV1,\n compilerFingerprint: z.literal(MODAL_NATIVE_FRESH_COMPILER_FINGERPRINT),\n })\n .strict();\nexport type ModalNativePreparationRecipeV2 = z.infer<typeof ModalNativePreparationRecipeV2>;\n\nexport const MODAL_NATIVE_PREPARATION_RECIPE_V2 = freezeLiteral(\n ModalNativePreparationRecipeV2.parse({\n version: 1,\n recipeId: \"modal-native-fresh-v1\",\n recipeRevision: 1,\n createWorkdir: \"/tmp\",\n entrypoint: [\"sleep\", \"infinity\"],\n normalization: MODAL_NATIVE_FRESH_NORMALIZATION_V1,\n compilerFingerprint: MODAL_NATIVE_FRESH_COMPILER_FINGERPRINT,\n }),\n);\n\n/** Exactly the old reservation vocabulary, NOT an extension to its keys. */\nexport const ModalNativeFreshBlueprintV1 = z\n .object({\n version: z.literal(1),\n adapterId: z.literal(\"modal-native-fresh-creator-reservation-v1\"),\n create: z\n .object({\n operationId: uuid,\n appId: z.string().regex(/^ap-[A-Za-z0-9_-]{1,200}$/u),\n imageId: z.string().regex(/^im-[A-Za-z0-9_-]{1,200}$/u),\n cpu: z\n .number()\n .positive()\n .max(128)\n .refine(\n (v) =>\n Number.isSafeInteger(Math.trunc(v * 1000)) &&\n Math.trunc(v * 1000) >= 1 &&\n Math.trunc(v * 1000) / 1000 === v,\n ),\n memoryMiB: z.number().int().min(128).max(1048576).safe(),\n timeoutSeconds: z.number().int().min(1).max(86400).safe(),\n env: empty,\n mounts: noItems,\n })\n .strict(),\n restore: z.null(),\n readiness: z\n .object({\n operationId: uuid,\n execId: commandExecId,\n commandArgs: z.tuple([z.literal(\"/bin/true\")]),\n workdir: z.literal(\"/tmp\"),\n env: empty,\n })\n .strict(),\n publishOperationId: uuid,\n cleanup: z\n .object({ operationId: uuid, requires: z.literal(\"physical-terminal-proof\") })\n .strict(),\n })\n .strict();\nexport type ModalNativeFreshBlueprintV1 = z.infer<typeof ModalNativeFreshBlueprintV1>;\n\n/** Full pre-election identity. routeEpoch is NOT the physical lease epoch;\n * creatorId is NOT an elected owner or a replacement accepted attempt. */\nexport const ModalNativeOriginalScopeV2 = z\n .object({\n version: z.literal(2),\n declarationId: uuid,\n planId: uuid,\n creatorId: uuid,\n accountId: uuid,\n workspaceId: uuid,\n sessionId: uuid,\n turnId: uuid,\n attemptId: uuid,\n executionGeneration: positive,\n triggerEventId: uuid,\n sandboxGroupId: uuid,\n routeKind: z.literal(\"home\"),\n routeTargetId: z.null(),\n routeEpoch: nonnegative,\n })\n .strict()\n .refine((v) => v.creatorId !== v.attemptId && v.creatorId !== v.planId, {\n message: \"A declared creator is distinct from the accepted attempt and plan\",\n });\nexport type ModalNativeOriginalScopeV2 = z.infer<typeof ModalNativeOriginalScopeV2>;\n\n/** References must resolve through the complete protected scope/config join.\n * They are neither credentials nor canonical/native authentication receipts. */\nexport const ModalNativeConfigurationCaptureRefV2 = z\n .object({ id: uuid, revision: positive })\n .strict();\nexport type ModalNativeConfigurationCaptureRefV2 = z.infer<\n typeof ModalNativeConfigurationCaptureRefV2\n>;\nexport const ModalNativeProofGrantRefV2 = z.object({ id: uuid, epoch: positive }).strict();\nexport type ModalNativeProofGrantRefV2 = z.infer<typeof ModalNativeProofGrantRefV2>;\nexport const ModalNativeReservedLeaseRefV2 = z.object({ id: uuid, epoch: nonnegative }).strict();\nexport type ModalNativeReservedLeaseRefV2 = z.infer<typeof ModalNativeReservedLeaseRefV2>;\n\nexport const ModalNativePreparationDeclarationV2 = z\n .object({\n version: z.literal(2),\n scope: ModalNativeOriginalScopeV2,\n blueprint: ModalNativeFreshBlueprintV1,\n preparationRecipe: ModalNativePreparationRecipeV2,\n configurationCaptureRef: ModalNativeConfigurationCaptureRefV2,\n proofGrantRef: ModalNativeProofGrantRefV2,\n providerRecoveryCount: z.union([\n z.literal(0),\n z.literal(1),\n z.literal(2),\n z.literal(3),\n z.literal(4),\n z.literal(5),\n ]),\n namespaceState: z.literal(\"unbound\"),\n })\n .strict()\n .superRefine((v, ctx) => {\n const ids = [\n v.scope.planId,\n v.scope.creatorId,\n v.blueprint.create.operationId,\n v.blueprint.readiness.operationId,\n v.blueprint.readiness.execId,\n v.blueprint.publishOperationId,\n v.blueprint.cleanup.operationId,\n ];\n if (new Set(ids).size !== 7)\n ctx.addIssue({\n code: \"custom\",\n message: \"All seven supplied operation identities must be distinct\",\n });\n });\nexport type ModalNativePreparationDeclarationV2 = z.infer<\n typeof ModalNativePreparationDeclarationV2\n>;\n\nconst safeEndpoint = z\n .string()\n .url()\n .max(1024)\n .refine(\n (v) => {\n try {\n const url = new URL(v);\n return (\n url.protocol === \"https:\" && !url.username && !url.password && !url.search && !url.hash\n );\n } catch {\n return false;\n }\n },\n { message: \"Only a credential-free captured HTTPS endpoint is supported\" },\n );\n\n/** Separate bind-once append, linked to the SAME captured configuration and\n * claim. This deliberately has no invented immutable provider-principal ID.\n * Only a trusted native issuer + authenticated host ingress can attest it. */\nexport const ModalNativeNamespaceEvidenceV2 = z\n .object({\n version: z.literal(2),\n scope: ModalNativeOriginalScopeV2,\n configurationCaptureRef: ModalNativeConfigurationCaptureRefV2,\n proofGrantRef: ModalNativeProofGrantRefV2,\n claimId: uuid,\n nonce: uuid,\n claimRevision: positive,\n recordRevision: positive,\n captureId: uuid,\n purpose: z.literal(\"original-namespace-read\"),\n reservation: ModalNativeReservedLeaseRefV2,\n source: z.literal(\"modal-client-workspace-name-lookup-v1\"),\n responseField: z.enum([\"workspaceName\", \"username\"]),\n binding: z\n .object({\n version: z.literal(1),\n serverUrl: safeEndpoint,\n workspaceName: z.string().min(1).max(200),\n environment: z.string().max(200),\n })\n .strict(),\n })\n .strict();\nexport type ModalNativeNamespaceEvidenceV2 = z.infer<typeof ModalNativeNamespaceEvidenceV2>;\n\nconst claimFields = {\n version: z.literal(2),\n scope: ModalNativeOriginalScopeV2,\n configurationCaptureRef: ModalNativeConfigurationCaptureRefV2,\n proofGrantRef: ModalNativeProofGrantRefV2,\n claimId: uuid,\n nonce: uuid,\n claimRevision: positive,\n recordRevision: positive,\n captureId: uuid,\n expiresAt: z.string().datetime(),\n};\n\n/** Scheduling custody ONLY. No lease/task grant is fabricated to authorize\n * this prerequisite lookup. A reserved lease supplies exclusion, not effects. */\nexport const ModalNativeNamespaceReadClaimV2 = z\n .object({\n ...claimFields,\n purpose: z.literal(\"original-namespace-read\"),\n reservation: ModalNativeReservedLeaseRefV2,\n })\n .strict();\nexport type ModalNativeNamespaceReadClaimV2 = z.infer<typeof ModalNativeNamespaceReadClaimV2>;\n\n/** Exact original router command and authoritative prior cursors; no retarget,\n * new TaskGet adoption, legacy locator, PTY, Start, stdin or process-cancel API. */\nexport const ModalNativeOriginalCommandReadClaimV2 = z\n .object({\n ...claimFields,\n purpose: z.literal(\"original-readiness-read\"),\n reservation: ModalNativeReservedLeaseRefV2,\n physicalOwnerGeneration: positive,\n operationId: uuid,\n providerBindingKey: z.string().min(1).max(1024),\n command: ModalRouterProviderCommand.refine((v) => v.pty !== true),\n })\n .strict();\nexport type ModalNativeOriginalCommandReadClaimV2 = z.infer<\n typeof ModalNativeOriginalCommandReadClaimV2\n>;\n\n/** Preserve the actual runtime descriptor's encoding/fingerprint domain. This\n * is passive protobuf PREFLIGHT, not the RPC's transmitted bytes or permission. */\nexport const ModalNativePreparedStartDescriptionV1 = z\n .object({\n taskId: z.string().min(1).max(200),\n execId: commandExecId,\n descriptorProtocol: z.literal(\"modal-prepared-start-descriptor\"),\n descriptorVersion: z.literal(1),\n readinessRecipe: z.literal(\"modal-exec-readiness-bin-true-v1\"),\n readinessRecipeVersion: z.literal(1),\n startMessage: z.literal(\"Start\"),\n rpcMethod: z.literal(\"/modal.task_command_router.TaskCommandRouter/TaskExecStart\"),\n encoderVersion: z.literal(\"protobufjs@7.6.5\"),\n preflight: z\n .object({\n encoding: z.literal(\"modal-start-protobuf-preflight-v1\"),\n sha256: digest,\n byteLength: positive.max(1024 * 1024),\n encoderFingerprint: z.string().regex(/^sha256:[a-f0-9]{64}$/u),\n })\n .strict(),\n })\n .strict();\nexport type ModalNativePreparedStartDescriptionV1 = z.infer<\n typeof ModalNativePreparedStartDescriptionV1\n>;\n\n/** Host/native acquisition objects are intentionally NOT constructed here.\n * Raw DTOs, copied refs and any schema-success result cannot mint those objects.\n * Capture needs issuer-authenticated OWN bytes, the exact original claim and a\n * durable capture key; unknown ACK reconciles that same key/acquisition. */\nexport type ModalNativeProofCaptureStatusV2 =\n | { status: \"committed\"; captureId: string; receiptId: string; recordRevision: number }\n | { status: \"absent_fenced\"; captureId: string }\n | { status: \"conflict\"; captureId: string }\n | { status: \"unresolved\"; captureId: string };\n","import { z } from \"zod\";\n\nconst ModalOutputCursor = z\n .object({\n batchIndex: z.number().int().nonnegative().safe(),\n utf8Remainder: z\n .string()\n .max(8)\n .regex(/^[A-Za-z0-9+/]*={0,2}$/u),\n exitCode: z.number().int().nullable(),\n })\n .strict();\n\n/** Provider-owned execution identity and acknowledged output cursors. These\n * values are retained by the control plane, never recovered from sandbox files. */\nexport const ModalLegacyProviderCommand = z\n .object({\n kind: z.literal(\"modal-control-v1\"),\n sandboxId: z.string().min(1).max(200),\n taskId: z.string().min(1).max(200),\n execId: z.string().min(1).max(200),\n pty: z.boolean().optional(),\n streams: z.object({ stdout: ModalOutputCursor, stderr: ModalOutputCursor }).strict(),\n })\n .strict();\nexport type ModalLegacyProviderCommand = z.infer<typeof ModalLegacyProviderCommand>;\n\nconst ModalByteCursor = z\n .object({\n byteOffset: z.number().int().nonnegative().safe(),\n utf8Remainder: z\n .string()\n .max(8)\n .regex(/^[A-Za-z0-9+/]*={0,2}$/u),\n eof: z.boolean(),\n exitCode: z.number().int().nullable(),\n })\n .strict()\n .refine((cursor) => cursor.exitCode === null || cursor.eof, {\n message: \"A terminal output cursor must have reached EOF\",\n });\n\nexport const CommandSupervisionDescriptor = z\n .object({\n protocol: z.literal(\"native-subreaper-v1\"),\n invocationId: z.string().uuid(),\n nonce: z.string().regex(/^[a-f0-9]{64}$/u),\n controlPath: z.string().regex(/^\\/tmp\\/opengeni-supervision\\/[a-f0-9-]{36}\\.sock$/u),\n })\n .strict();\nexport type CommandSupervisionDescriptor = z.infer<typeof CommandSupervisionDescriptor>;\n\nexport const CommandSupervisionReceipt = z\n .object({\n protocol: z.literal(\"native-subreaper-v1\"),\n invocationId: z.string().uuid(),\n receiptId: z.string().uuid(),\n leaderExitCode: z.number().int(),\n })\n .strict();\nexport type CommandSupervisionReceipt = z.infer<typeof CommandSupervisionReceipt>;\n\nexport const ModalRouterProviderCommand = z\n .object({\n kind: z.literal(\"modal-router-v1\"),\n sandboxId: z.string().min(1).max(200),\n taskId: z.string().min(1).max(200),\n execId: z.string().uuid(),\n pty: z.boolean().optional(),\n supervision: CommandSupervisionDescriptor.optional(),\n streams: z.object({ stdout: ModalByteCursor, stderr: ModalByteCursor }).strict(),\n })\n .strict();\nexport type ModalRouterProviderCommand = z.infer<typeof ModalRouterProviderCommand>;\n\n/** Legacy locators are read-only compatibility for already launched commands;\n * new starts use authenticated task-router byte offsets, never batch indices. */\nexport const SandboxProviderCommand = z.discriminatedUnion(\"kind\", [\n ModalLegacyProviderCommand,\n ModalRouterProviderCommand,\n]);\nexport type SandboxProviderCommand = z.infer<typeof SandboxProviderCommand>;\n"],"mappings":";AAAA,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAElB,IAAM,oBAAoB,EACvB,OAAO;AAAA,EACN,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK;AAAA,EAChD,eAAe,EACZ,OAAO,EACP,IAAI,CAAC,EACL,MAAM,yBAAyB;AAAA,EAClC,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AACtC,CAAC,EACA,OAAO;AAIH,IAAM,6BA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AWA,GAAE,QAAQ,4DAA4D;AAAA,EACjF,gBAAgBA,GAAE,QAAQ,kBAAkB;AAAA,EAC5C,WAAWA,GACR,OAAO;AAAA,IACN,UAAUA,GAAE,QAAQ,mCAAmC;AAAA,IACvD,QAAQ;AAAA,IACR,YAAY,SAAS,IAAI,OAAO,IAAI;AAAA,IACpC,oBAAoBA,GAAE,OAAO,EAAE,MAAM,wBAAwB;AAAA,EAC/D,CAAC,EACA,OAAO;AACZ,CAAC,EACA,OAAO;","names":["z","z"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMMITTED_TRANSACTION_PROTOCOL_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PX3VCKAU.js";
|
|
4
4
|
|
|
5
5
|
// src/editable-artifact-committed-transaction.ts
|
|
6
6
|
var MAX_COMMITTED_TRANSACTION_BYTES = 8 * 1024 * 1024;
|
|
7
7
|
var MAX_COMMITTED_TRANSACTION_OPERATIONS = 4096;
|
|
8
8
|
var MAX_COMMITTED_TRANSACTION_CAUSAL_REPLICAS = 1e5;
|
|
9
9
|
var MAX_COMMITTED_TRANSACTION_CELLS = 1e6;
|
|
10
|
-
var MAGIC = new Uint8Array([79, 71, 65, 67, 79, 48, 48,
|
|
10
|
+
var MAGIC = new Uint8Array([79, 71, 65, 67, 79, 48, 48, 50]);
|
|
11
11
|
var HEADER_BYTES = 24;
|
|
12
12
|
var CHECKSUM_BYTES = 8;
|
|
13
13
|
var HASH_BYTES = 32;
|
|
@@ -16,6 +16,7 @@ var MAX_OPERATION_STRING_BYTES = 4 * 1024 * 1024;
|
|
|
16
16
|
var MAX_SAFE_U64_HIGH = 2097151;
|
|
17
17
|
var U32_SIZE = 4294967296;
|
|
18
18
|
var U32_MAX = 4294967295;
|
|
19
|
+
var MAX_DATE_MILLISECONDS = 8640000000000000n;
|
|
19
20
|
var FNV_OFFSET_LOW = 2216829733;
|
|
20
21
|
var FNV_OFFSET_HIGH = 3421674724;
|
|
21
22
|
var FNV_PRIME_LOW = 435;
|
|
@@ -23,37 +24,37 @@ var HEX = Array.from({ length: 256 }, (_, value) => value.toString(16).padStart(
|
|
|
23
24
|
function decodeCommittedTransactionSummary(bytes) {
|
|
24
25
|
assertInput(bytes);
|
|
25
26
|
if (bytes.byteLength > MAX_COMMITTED_TRANSACTION_BYTES) {
|
|
26
|
-
throw new RangeError("
|
|
27
|
+
throw new RangeError("OGACO002 envelope exceeds its byte limit");
|
|
27
28
|
}
|
|
28
29
|
if (bytes.byteLength < HEADER_BYTES + CHECKSUM_BYTES) {
|
|
29
|
-
throw new TypeError("truncated
|
|
30
|
+
throw new TypeError("truncated OGACO002 envelope");
|
|
30
31
|
}
|
|
31
32
|
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
32
33
|
for (let index = 0; index < MAGIC.byteLength; index += 1) {
|
|
33
|
-
if (bytes[index] !== MAGIC[index]) throw new TypeError("invalid
|
|
34
|
+
if (bytes[index] !== MAGIC[index]) throw new TypeError("invalid OGACO002 magic");
|
|
34
35
|
}
|
|
35
36
|
const version = view.getUint16(8, true);
|
|
36
37
|
if (version !== COMMITTED_TRANSACTION_PROTOCOL_VERSION) {
|
|
37
|
-
throw new TypeError(`unsupported
|
|
38
|
+
throw new TypeError(`unsupported OGACO002 version: ${version}`);
|
|
38
39
|
}
|
|
39
40
|
if (view.getUint16(10, true) !== 0) {
|
|
40
|
-
throw new TypeError("reserved
|
|
41
|
+
throw new TypeError("reserved OGACO002 header bits are set");
|
|
41
42
|
}
|
|
42
43
|
const operationCount = view.getUint32(12, true);
|
|
43
44
|
if (operationCount === 0 || operationCount > MAX_COMMITTED_TRANSACTION_OPERATIONS) {
|
|
44
|
-
throw new RangeError("
|
|
45
|
+
throw new RangeError("OGACO002 operation count is outside its canonical bounds");
|
|
45
46
|
}
|
|
46
|
-
const payloadLength = safeU64At(view, 16, "
|
|
47
|
-
const payloadEnd = checkedAdd(HEADER_BYTES, payloadLength, "
|
|
48
|
-
const expectedLength = checkedAdd(payloadEnd, CHECKSUM_BYTES, "
|
|
47
|
+
const payloadLength = safeU64At(view, 16, "OGACO002 payload length", false);
|
|
48
|
+
const payloadEnd = checkedAdd(HEADER_BYTES, payloadLength, "OGACO002 payload length");
|
|
49
|
+
const expectedLength = checkedAdd(payloadEnd, CHECKSUM_BYTES, "OGACO002 envelope length");
|
|
49
50
|
if (bytes.byteLength !== expectedLength) {
|
|
50
51
|
throw new TypeError(
|
|
51
|
-
bytes.byteLength < expectedLength ? "truncated
|
|
52
|
+
bytes.byteLength < expectedLength ? "truncated OGACO002 payload" : "trailing bytes after OGACO002 envelope"
|
|
52
53
|
);
|
|
53
54
|
}
|
|
54
55
|
const [checksumLow, checksumHigh] = fnv1a64(bytes, payloadEnd);
|
|
55
56
|
if (view.getUint32(payloadEnd, true) !== checksumLow || view.getUint32(payloadEnd + 4, true) !== checksumHigh) {
|
|
56
|
-
throw new TypeError("
|
|
57
|
+
throw new TypeError("OGACO002 checksum mismatch");
|
|
57
58
|
}
|
|
58
59
|
const reader = new Reader(bytes, HEADER_BYTES, payloadEnd);
|
|
59
60
|
const transactionId = reader.stableId("transaction id");
|
|
@@ -69,7 +70,7 @@ function decodeCommittedTransactionSummary(bytes) {
|
|
|
69
70
|
for (let index = 0; index < operationCount; index += 1) {
|
|
70
71
|
const operationId = reader.stableId(`operation ${index} id`);
|
|
71
72
|
if (seenOperationIds.has(operationId)) {
|
|
72
|
-
throw new TypeError("
|
|
73
|
+
throw new TypeError("OGACO002 operation ids must be unique");
|
|
73
74
|
}
|
|
74
75
|
seenOperationIds.add(operationId);
|
|
75
76
|
operationIds.push(operationId);
|
|
@@ -209,7 +210,7 @@ var Reader = class {
|
|
|
209
210
|
const endRow = this.u32("clear range end row");
|
|
210
211
|
const endColumn = this.u32("clear range end column");
|
|
211
212
|
if (startRow > endRow || startColumn > endColumn) {
|
|
212
|
-
throw new TypeError("
|
|
213
|
+
throw new TypeError("OGACO002 clear range is not normalized");
|
|
213
214
|
}
|
|
214
215
|
return totalCells;
|
|
215
216
|
}
|
|
@@ -217,7 +218,7 @@ var Reader = class {
|
|
|
217
218
|
this.stableId("selective undo target");
|
|
218
219
|
return totalCells;
|
|
219
220
|
default:
|
|
220
|
-
throw new TypeError(`invalid
|
|
221
|
+
throw new TypeError(`invalid OGACO002 collaboration command tag: ${tag}`);
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
224
|
skipSetCells(totalCells) {
|
|
@@ -227,18 +228,18 @@ var Reader = class {
|
|
|
227
228
|
const rows = this.u32("cell block rows");
|
|
228
229
|
const columns = this.u32("cell block columns");
|
|
229
230
|
if (rows === 0 || columns === 0) {
|
|
230
|
-
throw new TypeError("
|
|
231
|
+
throw new TypeError("OGACO002 cell block dimensions must be nonzero");
|
|
231
232
|
}
|
|
232
233
|
if (anchorRow > U32_MAX - (rows - 1) || anchorColumn > U32_MAX - (columns - 1)) {
|
|
233
|
-
throw new RangeError("
|
|
234
|
+
throw new RangeError("OGACO002 cell block coordinates overflow u32");
|
|
234
235
|
}
|
|
235
236
|
if (rows > Math.floor(MAX_COMMITTED_TRANSACTION_CELLS / columns)) {
|
|
236
|
-
throw new RangeError("
|
|
237
|
+
throw new RangeError("OGACO002 cell block exceeds its cell limit");
|
|
237
238
|
}
|
|
238
239
|
const cellCount = rows * columns;
|
|
239
240
|
const nextTotal = totalCells + cellCount;
|
|
240
241
|
if (nextTotal > MAX_COMMITTED_TRANSACTION_CELLS) {
|
|
241
|
-
throw new RangeError("
|
|
242
|
+
throw new RangeError("OGACO002 transaction exceeds its cell limit");
|
|
242
243
|
}
|
|
243
244
|
for (let index = 0; index < cellCount; index += 1) this.skipCell();
|
|
244
245
|
return nextTotal;
|
|
@@ -247,10 +248,11 @@ var Reader = class {
|
|
|
247
248
|
const formulaTag = this.u8("cell formula tag");
|
|
248
249
|
if (formulaTag === 1) {
|
|
249
250
|
if (this.skipString("cell formula") === 0) {
|
|
250
|
-
throw new TypeError("
|
|
251
|
+
throw new TypeError("OGACO002 formula must not be empty");
|
|
251
252
|
}
|
|
253
|
+
return;
|
|
252
254
|
} else if (formulaTag !== 0) {
|
|
253
|
-
throw new TypeError(`invalid
|
|
255
|
+
throw new TypeError(`invalid OGACO002 cell formula tag: ${formulaTag}`);
|
|
254
256
|
}
|
|
255
257
|
const valueTag = this.u8("cell value tag");
|
|
256
258
|
switch (valueTag) {
|
|
@@ -267,8 +269,11 @@ var Reader = class {
|
|
|
267
269
|
case 5:
|
|
268
270
|
this.skipFormulaError();
|
|
269
271
|
return;
|
|
272
|
+
case 6:
|
|
273
|
+
this.skipDate();
|
|
274
|
+
return;
|
|
270
275
|
default:
|
|
271
|
-
throw new TypeError(`invalid
|
|
276
|
+
throw new TypeError(`invalid OGACO002 cell value tag: ${valueTag}`);
|
|
272
277
|
}
|
|
273
278
|
}
|
|
274
279
|
skipNumber() {
|
|
@@ -276,10 +281,17 @@ var Reader = class {
|
|
|
276
281
|
const low = this.#view.getUint32(offset, true);
|
|
277
282
|
const high = this.#view.getUint32(offset + 4, true);
|
|
278
283
|
if (low === 0 && high === 2147483648) {
|
|
279
|
-
throw new TypeError("
|
|
284
|
+
throw new TypeError("OGACO002 cell number uses negative zero");
|
|
280
285
|
}
|
|
281
286
|
if ((high & 2146435072) === 2146435072) {
|
|
282
|
-
throw new TypeError("
|
|
287
|
+
throw new TypeError("OGACO002 cell numbers must be finite");
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
skipDate() {
|
|
291
|
+
const offset = this.reserve(8, "cell date");
|
|
292
|
+
const milliseconds = this.#view.getBigInt64(offset, true);
|
|
293
|
+
if (milliseconds < -MAX_DATE_MILLISECONDS || milliseconds > MAX_DATE_MILLISECONDS) {
|
|
294
|
+
throw new TypeError("OGACO002 cell date is outside the ECMAScript range");
|
|
283
295
|
}
|
|
284
296
|
}
|
|
285
297
|
skipFormulaError() {
|
|
@@ -289,7 +301,7 @@ var Reader = class {
|
|
|
289
301
|
this.skipString("custom formula error");
|
|
290
302
|
return;
|
|
291
303
|
}
|
|
292
|
-
throw new TypeError(`invalid
|
|
304
|
+
throw new TypeError(`invalid OGACO002 formula error tag: ${tag}`);
|
|
293
305
|
}
|
|
294
306
|
skipGeneration(label) {
|
|
295
307
|
this.sheetObjectId(`${label} sheet id`);
|
|
@@ -305,15 +317,15 @@ var Reader = class {
|
|
|
305
317
|
return length;
|
|
306
318
|
}
|
|
307
319
|
done() {
|
|
308
|
-
if (this.#offset !== this.#end) throw new TypeError("trailing bytes in
|
|
320
|
+
if (this.#offset !== this.#end) throw new TypeError("trailing bytes in OGACO002 payload");
|
|
309
321
|
}
|
|
310
322
|
};
|
|
311
323
|
function assertInput(bytes) {
|
|
312
324
|
if (!(bytes instanceof Uint8Array)) {
|
|
313
|
-
throw new TypeError("
|
|
325
|
+
throw new TypeError("OGACO002 bytes must be a Uint8Array");
|
|
314
326
|
}
|
|
315
327
|
if (typeof SharedArrayBuffer !== "undefined" && bytes.buffer instanceof SharedArrayBuffer) {
|
|
316
|
-
throw new TypeError("
|
|
328
|
+
throw new TypeError("OGACO002 bytes must not use shared mutable memory");
|
|
317
329
|
}
|
|
318
330
|
}
|
|
319
331
|
function safeU64At(view, offset, label, positive) {
|
|
@@ -389,4 +401,4 @@ export {
|
|
|
389
401
|
MAX_COMMITTED_TRANSACTION_CELLS,
|
|
390
402
|
decodeCommittedTransactionSummary
|
|
391
403
|
};
|
|
392
|
-
//# sourceMappingURL=chunk-
|
|
404
|
+
//# sourceMappingURL=chunk-3SIZGL3O.js.map
|