@spacefast/common 0.2.2 → 0.4.1
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/agents/marketplace-prompts.d.ts +1 -0
- package/dist/agents/marketplace-prompts.js +6 -0
- package/dist/agents/registry/core.d.ts +4 -12
- package/dist/agents/registry/core.js +7 -28
- package/dist/config/domains.d.ts +10 -8
- package/dist/config/domains.js +4 -7
- package/dist/contracts/access-core.d.ts +135 -0
- package/dist/contracts/access-core.js +242 -0
- package/dist/contracts/access-profiles.d.ts +8 -8
- package/dist/contracts/access-profiles.js +8 -8
- package/dist/contracts/access.d.ts +14 -103
- package/dist/contracts/access.js +10 -210
- package/dist/contracts/activity.d.ts +54 -55
- package/dist/contracts/activity.js +38 -9
- package/dist/contracts/api-keys.d.ts +69 -26
- package/dist/contracts/api-keys.js +29 -2
- package/dist/contracts/application-journal.d.ts +197 -4
- package/dist/contracts/application-journal.js +97 -16
- package/dist/contracts/auth.d.ts +20 -0
- package/dist/contracts/auth.js +18 -0
- package/dist/contracts/beta.d.ts +13 -0
- package/dist/contracts/beta.js +28 -0
- package/dist/contracts/billing.d.ts +2 -2
- package/dist/contracts/bootstrap.d.ts +23 -6
- package/dist/contracts/builds.d.ts +18 -4
- package/dist/contracts/builds.js +7 -4
- package/dist/contracts/channels.d.ts +43 -0
- package/dist/contracts/channels.js +22 -6
- package/dist/contracts/comments.d.ts +49 -0
- package/dist/contracts/comments.js +61 -2
- package/dist/contracts/commerce.d.ts +19 -13
- package/dist/contracts/connector-access.d.ts +28 -0
- package/dist/contracts/connector-access.js +31 -0
- package/dist/contracts/connectors.d.ts +2382 -0
- package/dist/contracts/connectors.js +941 -0
- package/dist/contracts/content-contract-verification.d.ts +112 -58
- package/dist/contracts/content-contract-verification.js +42 -54
- package/dist/contracts/content-model-emit.d.ts +97 -0
- package/dist/contracts/content-model-emit.js +306 -0
- package/dist/contracts/content-model-sdk.d.ts +101 -0
- package/dist/contracts/content-model-sdk.js +232 -0
- package/dist/contracts/{content-program.d.ts → content-model.d.ts} +338 -82
- package/dist/contracts/{content-program.js → content-model.js} +291 -63
- package/dist/contracts/content-platform-fixture.d.ts +380 -110
- package/dist/contracts/content-platform-fixture.js +8 -8
- package/dist/contracts/content-sync.d.ts +197 -74
- package/dist/contracts/content-sync.js +98 -37
- package/dist/contracts/content.d.ts +30 -422
- package/dist/contracts/content.js +34 -294
- package/dist/contracts/dashboard-prefs.d.ts +10 -3
- package/dist/contracts/dashboard-prefs.js +6 -3
- package/dist/contracts/data-location.d.ts +9 -0
- package/dist/contracts/data-location.js +7 -0
- package/dist/contracts/deployment-comparison.d.ts +67 -0
- package/dist/contracts/deployment-comparison.js +68 -0
- package/dist/contracts/device-auth.d.ts +55 -11
- package/dist/contracts/domains.d.ts +40 -16
- package/dist/contracts/domains.js +23 -0
- package/dist/contracts/enums.d.ts +1 -10
- package/dist/contracts/enums.js +0 -15
- package/dist/contracts/error-code-meta.d.ts +384 -20
- package/dist/contracts/error-code-meta.js +200 -5
- package/dist/contracts/error-codes.d.ts +17 -4
- package/dist/contracts/error-codes.js +108 -10
- package/dist/contracts/events.d.ts +5 -0
- package/dist/contracts/events.js +12 -3
- package/dist/contracts/execution.d.ts +5 -1
- package/dist/contracts/execution.js +4 -0
- package/dist/contracts/feature-lifecycle.d.ts +53 -20
- package/dist/contracts/feature-lifecycle.js +65 -23
- package/dist/contracts/features.d.ts +57 -31
- package/dist/contracts/features.js +0 -1
- package/dist/contracts/feedback.d.ts +124 -0
- package/dist/contracts/feedback.js +64 -0
- package/dist/contracts/fixtures/content-model-sdk-v1.generated.d.ts +129 -0
- package/dist/contracts/fixtures/content-model-sdk-v1.generated.js +48 -0
- package/dist/contracts/fixtures/content-platform-v1.json +101 -49
- package/dist/contracts/frame-session.d.ts +60 -10
- package/dist/contracts/frame-session.js +52 -12
- package/dist/contracts/functions.d.ts +28 -2
- package/dist/contracts/functions.js +25 -2
- package/dist/contracts/grant-copy.d.ts +2 -0
- package/dist/contracts/grant-copy.js +2 -0
- package/dist/contracts/grants-core.d.ts +95 -0
- package/dist/contracts/grants-core.js +435 -0
- package/dist/contracts/grants.d.ts +13 -84
- package/dist/contracts/grants.js +21 -369
- package/dist/contracts/ids-core.d.ts +11 -0
- package/dist/contracts/ids-core.js +14 -0
- package/dist/contracts/ids.d.ts +7 -4
- package/dist/contracts/ids.js +12 -4
- package/dist/contracts/internal.d.ts +18 -0
- package/dist/contracts/internal.js +19 -0
- package/dist/contracts/mcp.d.ts +8 -18
- package/dist/contracts/mcp.js +2 -23
- package/dist/contracts/notifications.d.ts +4 -1
- package/dist/contracts/notifications.js +1 -0
- package/dist/contracts/oauth-resources.d.ts +46 -9
- package/dist/contracts/oauth-resources.js +50 -1
- package/dist/contracts/oauth-scope-actions.d.ts +27 -3
- package/dist/contracts/oauth-scope-actions.js +18 -8
- package/dist/contracts/operations.d.ts +1 -1
- package/dist/contracts/partner-account.d.ts +629 -0
- package/dist/contracts/partner-account.js +18 -0
- package/dist/contracts/principal-assertion.d.ts +74 -1
- package/dist/contracts/principal-assertion.js +67 -3
- package/dist/contracts/publish-archive.d.ts +22 -1
- package/dist/contracts/push-new.d.ts +3 -3
- package/dist/contracts/push-new.js +1 -1
- package/dist/contracts/quotas.js +2 -1
- package/dist/contracts/repository-connections.d.ts +10 -6
- package/dist/contracts/repository-connections.js +15 -0
- package/dist/contracts/resources.d.ts +6 -5
- package/dist/contracts/resources.js +7 -0
- package/dist/contracts/route-inventory.d.ts +74 -19
- package/dist/contracts/route-inventory.js +20 -6
- package/dist/contracts/runtime-api.d.ts +415 -4
- package/dist/contracts/runtime-api.js +60 -15
- package/dist/contracts/runtime-app.d.ts +6 -1
- package/dist/contracts/runtime-components.d.ts +646 -18
- package/dist/contracts/runtime-components.js +304 -188
- package/dist/contracts/runtime-services.d.ts +15 -0
- package/dist/contracts/runtime-services.js +25 -0
- package/dist/contracts/runtime-storage.d.ts +32 -0
- package/dist/contracts/runtime-storage.js +37 -0
- package/dist/contracts/source-workspaces.d.ts +511 -0
- package/dist/contracts/source-workspaces.js +276 -0
- package/dist/contracts/space-config-spacefast.d.ts +394 -0
- package/dist/contracts/space-config-spacefast.js +70 -0
- package/dist/contracts/space-config.d.ts +177 -90
- package/dist/contracts/space-config.js +77 -92
- package/dist/contracts/spaces.d.ts +132 -24
- package/dist/contracts/spaces.js +77 -13
- package/dist/contracts/superadmin-connectors.d.ts +371 -0
- package/dist/contracts/superadmin-connectors.js +61 -0
- package/dist/contracts/superadmin-emails.d.ts +1 -1
- package/dist/contracts/superadmin-emails.js +1 -1
- package/dist/contracts/superadmin-entities.d.ts +105 -0
- package/dist/contracts/superadmin-entities.js +64 -0
- package/dist/contracts/superadmin-runtime.d.ts +35 -116
- package/dist/contracts/superadmin-runtime.js +13 -69
- package/dist/contracts/superadmin-search.d.ts +12 -14
- package/dist/contracts/superadmin-search.js +2 -2
- package/dist/contracts/superadmin-spaces.d.ts +15 -72
- package/dist/contracts/superadmin-spaces.js +2 -7
- package/dist/contracts/superadmin-teams.d.ts +12 -0
- package/dist/contracts/superadmin-teams.js +7 -1
- package/dist/contracts/superadmin-tenants.d.ts +44 -16
- package/dist/contracts/superadmin.d.ts +2 -2
- package/dist/contracts/tags.d.ts +12 -12
- package/dist/contracts/teams.d.ts +29 -1
- package/dist/contracts/teams.js +24 -2
- package/dist/contracts/tenants.d.ts +98 -0
- package/dist/contracts/tenants.js +20 -0
- package/dist/contracts/transfers.d.ts +92 -0
- package/dist/contracts/transfers.js +37 -0
- package/dist/contracts/usage.d.ts +9 -1
- package/dist/contracts/usage.js +2 -0
- package/dist/contracts/visual-review.d.ts +448 -0
- package/dist/contracts/visual-review.js +156 -0
- package/dist/contracts/wordpress-php-toolkit.json +9 -0
- package/dist/contracts/work-mode.d.ts +24 -0
- package/dist/contracts/work-mode.js +17 -0
- package/dist/contracts/wp-cli.d.ts +66 -0
- package/dist/contracts/wp-cli.js +68 -0
- package/dist/contracts/zero-catalog.d.ts +29 -0
- package/dist/contracts/zero-catalog.js +55 -0
- package/dist/contracts/zero-platform-abilities.generated.d.ts +31 -0
- package/dist/contracts/zero-platform-abilities.generated.js +373 -0
- package/dist/contracts/zero-spacefast.d.ts +444 -0
- package/dist/contracts/zero-spacefast.js +149 -0
- package/dist/contracts/zero-types.d.ts +47 -0
- package/dist/contracts/zero-types.js +263 -0
- package/dist/contracts/zero.d.ts +781 -14
- package/dist/contracts/zero.js +204 -10
- package/dist/dashboard-paths/index.d.ts +2 -2
- package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -2
- package/dist/dashboard-paths/route-reservations.generated.js +5 -0
- package/dist/docs/agent-prose.d.ts +1 -1
- package/dist/docs/agent-prose.js +15 -18
- package/dist/docs/agent-setup.d.ts +1 -1
- package/dist/docs/agent-setup.js +5 -13
- package/dist/docs/catalog.d.ts +64 -28
- package/dist/docs/catalog.js +155 -28
- package/dist/docs/error-docs.d.ts +361 -17
- package/dist/docs/error-docs.js +365 -21
- package/dist/docs/reference-urls.js +1 -1
- package/dist/docs/skills.d.ts +84 -84
- package/dist/docs/skills.js +66 -47
- package/dist/docs/start-prompts.d.ts +14 -0
- package/dist/docs/start-prompts.js +20 -0
- package/dist/utils/account-labels.d.ts +7 -0
- package/dist/utils/account-labels.js +15 -0
- package/dist/utils/auth.d.ts +1 -0
- package/dist/utils/auth.js +1 -0
- package/dist/utils/credential-policy.d.ts +22 -1
- package/dist/utils/credential-policy.js +55 -6
- package/dist/utils/local-space-state.d.ts +7 -0
- package/dist/utils/local-space-state.js +7 -0
- package/dist/utils/logger.d.ts +34 -0
- package/dist/utils/logger.js +144 -0
- package/dist/utils/page-routes.d.ts +9 -0
- package/dist/utils/page-routes.js +82 -0
- package/dist/utils/pages.d.ts +2 -0
- package/dist/utils/pages.js +7 -0
- package/dist/utils/publish-form-data.d.ts +2 -0
- package/dist/utils/publish-form-data.js +2 -0
- package/dist/utils/publish-policy-spacefast.d.ts +13 -0
- package/dist/utils/publish-policy-spacefast.js +117 -0
- package/dist/utils/publish-policy.d.ts +22 -16
- package/dist/utils/publish-policy.fixtures.json +15 -0
- package/dist/utils/publish-policy.js +62 -139
- package/dist/utils/query-client.js +9 -1
- package/dist/utils/runtime-upload.d.ts +4 -0
- package/dist/utils/runtime-upload.js +5 -0
- package/dist/utils/space-config.d.ts +2 -3
- package/dist/utils/space-config.js +1 -1
- package/dist/utils/uploaded-source.d.ts +4 -0
- package/dist/utils/uploaded-source.js +12 -0
- package/dist/visual-review.d.ts +4 -0
- package/dist/visual-review.js +208 -0
- package/dist/vocabulary.d.ts +38 -0
- package/dist/vocabulary.js +55 -0
- package/package.json +7 -2
- package/dist/agents/registry/deeplink-probes.d.ts +0 -23
- package/dist/agents/registry/deeplink-probes.js +0 -18
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { applicationJournalDeliveryClaimV1Schema, applicationJournalDeliveryReceiptV1Schema, applicationJournalEntryV1Schema, type ApplicationJournalDeliveryClaimV1, type ApplicationJournalDeliveryReceiptV1, type ApplicationJournalEntryV1 } from "./application-journal.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { contentModelReleaseV1Schema, type ContentModelReleaseV1, type ContentModelSha256 } from "./content-model.js";
|
|
4
|
+
import { contentSyncConflictProblemSchema, syncReconciliationExchangeV1Schema, syncSourceAcknowledgementV1Schema, syncLedgerV1Schema, type ContentSyncConflictProblem, type SyncReconciliationExchangeV1, type SyncSourceAcknowledgementV1, type SyncLedgerV1 } from "./content-sync.js";
|
|
5
5
|
import { frameLaunchTicketClaimsV1Schema, frameSessionClaimsV1Schema, type FrameLaunchTicketClaimsV1, type FrameSessionClaimsV1 } from "./frame-session.js";
|
|
6
6
|
import { principalAssertionV1Schema, type PrincipalAssertionV1 } from "./principal-assertion.js";
|
|
7
7
|
import { routeInventoryV1Schema, spaceRouteSnapshotV1Schema, type RouteInventoryV1, type SpaceRouteSnapshotV1 } from "./route-inventory.js";
|
|
8
|
-
import {
|
|
8
|
+
import { contentModelRequirementsV1Schema, runtimeComponentInventoryV1Schema, runtimeComponentPlacementReceiptV1Schema, runtimeComponentPlacementTargetV1Schema, type RuntimeComponentPlacementReceiptV1, type RuntimeComponentInventoryV1, type RuntimeComponentPlacementTargetV1 } from "./runtime-components.js";
|
|
9
9
|
export type ContentContractDigestInput = string | number | boolean | null | undefined | ContentContractDigestInput[] | {
|
|
10
10
|
[key: string]: ContentContractDigestInput;
|
|
11
11
|
};
|
|
12
12
|
export type ContentContractArtifactPayload = {
|
|
13
13
|
[key: string]: ContentContractDigestInput;
|
|
14
|
-
inputDigest?:
|
|
14
|
+
inputDigest?: ContentModelSha256;
|
|
15
15
|
};
|
|
16
|
-
export declare function contentContractSha256(value: ContentContractDigestInput): Promise<
|
|
17
|
-
export declare function contentContractTextSha256(value: string): Promise<
|
|
18
|
-
export declare function
|
|
19
|
-
export declare const
|
|
20
|
-
capsule: z.ZodType<import("./content-
|
|
16
|
+
export declare function contentContractSha256(value: ContentContractDigestInput): Promise<ContentModelSha256>;
|
|
17
|
+
export declare function contentContractTextSha256(value: string): Promise<ContentModelSha256>;
|
|
18
|
+
export declare function verifyContentModelReleaseV1(value: z.input<typeof contentModelReleaseV1Schema>): Promise<ContentModelReleaseV1>;
|
|
19
|
+
export declare const compiledContentModelBundleV1Schema: z.ZodObject<{
|
|
20
|
+
capsule: z.ZodType<import("./content-model.js").ContentModelJsonValue, unknown, z.core.$ZodTypeInternals<import("./content-model.js").ContentModelJsonValue, unknown>>;
|
|
21
21
|
artifacts: z.ZodObject<{
|
|
22
|
-
|
|
22
|
+
model: z.ZodObject<{
|
|
23
23
|
format: z.ZodLiteral<"spacefast.zero-wordpress">;
|
|
24
24
|
version: z.ZodLiteral<1>;
|
|
25
|
-
revision: z.core.$ZodBranded<z.ZodString, "
|
|
25
|
+
revision: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
26
26
|
schemas: z.ZodArray<z.ZodObject<{
|
|
27
27
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
28
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
29
|
-
schema: z.ZodType<import("./content-
|
|
28
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
29
|
+
schema: z.ZodType<import("./content-model.js").ContentModelJsonValue, unknown, z.core.$ZodTypeInternals<import("./content-model.js").ContentModelJsonValue, unknown>>;
|
|
30
30
|
}, z.core.$strict>>;
|
|
31
31
|
wordpress: z.ZodObject<{
|
|
32
|
-
format: z.ZodLiteral<"spacefast.wordpress-
|
|
32
|
+
format: z.ZodLiteral<"spacefast.wordpress-content-model">;
|
|
33
33
|
version: z.ZodLiteral<1>;
|
|
34
34
|
resources: z.ZodArray<z.ZodObject<{
|
|
35
35
|
id: z.core.$ZodBranded<z.ZodString, "ContentResourceId", "out">;
|
|
@@ -37,9 +37,9 @@ export declare const compiledContentProgramBundleV1Schema: z.ZodObject<{
|
|
|
37
37
|
label: z.ZodString;
|
|
38
38
|
kind: z.ZodEnum<{
|
|
39
39
|
media: "media";
|
|
40
|
+
collection: "collection";
|
|
40
41
|
posts: "posts";
|
|
41
42
|
pages: "pages";
|
|
42
|
-
collection: "collection";
|
|
43
43
|
}>;
|
|
44
44
|
fields: z.ZodArray<z.ZodObject<{
|
|
45
45
|
id: z.core.$ZodBranded<z.ZodString, "ContentFieldId", "out">;
|
|
@@ -107,11 +107,11 @@ export declare const compiledContentProgramBundleV1Schema: z.ZodObject<{
|
|
|
107
107
|
id: z.core.$ZodBranded<z.ZodString, "ContentAbilityId", "out">;
|
|
108
108
|
input: z.ZodObject<{
|
|
109
109
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
110
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
110
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
111
111
|
}, z.core.$strict>;
|
|
112
112
|
output: z.ZodObject<{
|
|
113
113
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
114
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
114
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
115
115
|
}, z.core.$strict>;
|
|
116
116
|
permits: z.ZodArray<z.ZodEnum<{
|
|
117
117
|
"page.view": "page.view";
|
|
@@ -162,11 +162,11 @@ export declare const compiledContentProgramBundleV1Schema: z.ZodObject<{
|
|
|
162
162
|
id: z.core.$ZodBranded<z.ZodString, "ContentAbilityId", "out">;
|
|
163
163
|
input: z.ZodObject<{
|
|
164
164
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
165
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
165
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
166
166
|
}, z.core.$strict>;
|
|
167
167
|
output: z.ZodObject<{
|
|
168
168
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
169
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
169
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
170
170
|
}, z.core.$strict>;
|
|
171
171
|
permits: z.ZodArray<z.ZodEnum<{
|
|
172
172
|
"page.view": "page.view";
|
|
@@ -220,11 +220,11 @@ export declare const compiledContentProgramBundleV1Schema: z.ZodObject<{
|
|
|
220
220
|
id: z.core.$ZodBranded<z.ZodString, "ContentAbilityId", "out">;
|
|
221
221
|
input: z.ZodObject<{
|
|
222
222
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
223
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
223
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
224
224
|
}, z.core.$strict>;
|
|
225
225
|
output: z.ZodObject<{
|
|
226
226
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
227
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
227
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
228
228
|
}, z.core.$strict>;
|
|
229
229
|
permits: z.ZodArray<z.ZodEnum<{
|
|
230
230
|
"page.view": "page.view";
|
|
@@ -279,7 +279,7 @@ export declare const compiledContentProgramBundleV1Schema: z.ZodObject<{
|
|
|
279
279
|
componentId: z.core.$ZodBranded<z.ZodString, "ContentComponentId", "out">;
|
|
280
280
|
props: z.ZodObject<{
|
|
281
281
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
282
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
282
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
283
283
|
}, z.core.$strict>;
|
|
284
284
|
}, z.core.$strict>>;
|
|
285
285
|
hooks: z.ZodArray<z.ZodObject<{
|
|
@@ -288,46 +288,100 @@ export declare const compiledContentProgramBundleV1Schema: z.ZodObject<{
|
|
|
288
288
|
php: "php";
|
|
289
289
|
quickjs: "quickjs";
|
|
290
290
|
}>;
|
|
291
|
-
artifact: z.core.$ZodBranded<z.ZodString, "
|
|
291
|
+
artifact: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
292
292
|
export: z.ZodString;
|
|
293
293
|
}, z.core.$strict>>;
|
|
294
|
-
syncBindings: z.ZodArray<z.ZodObject<{
|
|
294
|
+
syncBindings: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
295
295
|
id: z.core.$ZodBranded<z.ZodString, "ContentSyncBindingId", "out">;
|
|
296
296
|
resourceId: z.core.$ZodBranded<z.ZodString, "ContentResourceId", "out">;
|
|
297
297
|
fieldId: z.core.$ZodBranded<z.ZodString, "ContentFieldId", "out">;
|
|
298
298
|
source: z.ZodString;
|
|
299
|
+
publicPath: z.ZodOptional<z.ZodString>;
|
|
300
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
301
|
+
md: "md";
|
|
302
|
+
html: "html";
|
|
303
|
+
tsx: "tsx";
|
|
304
|
+
}>>;
|
|
305
|
+
compiled: z.ZodOptional<z.ZodObject<{
|
|
306
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
307
|
+
}, z.core.$strict>>;
|
|
308
|
+
documentSeed: z.ZodOptional<z.ZodObject<{
|
|
309
|
+
text: z.ZodString;
|
|
310
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
311
|
+
}, z.core.$strict>>;
|
|
299
312
|
slug: z.ZodString;
|
|
300
|
-
}, z.core.$strict
|
|
313
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
314
|
+
format: "md" | "html" | "tsx";
|
|
315
|
+
id: string & z.core.$brand<"ContentSyncBindingId">;
|
|
316
|
+
resourceId: string & z.core.$brand<"ContentResourceId">;
|
|
317
|
+
fieldId: string & z.core.$brand<"ContentFieldId">;
|
|
318
|
+
source: string;
|
|
319
|
+
slug: string;
|
|
320
|
+
publicPath?: string | undefined;
|
|
321
|
+
compiled?: {
|
|
322
|
+
sha256: string & z.core.$brand<"ContentModelSha256">;
|
|
323
|
+
} | undefined;
|
|
324
|
+
documentSeed?: {
|
|
325
|
+
text: string;
|
|
326
|
+
sha256: string & z.core.$brand<"ContentModelSha256">;
|
|
327
|
+
} | undefined;
|
|
328
|
+
}, {
|
|
329
|
+
id: string & z.core.$brand<"ContentSyncBindingId">;
|
|
330
|
+
resourceId: string & z.core.$brand<"ContentResourceId">;
|
|
331
|
+
fieldId: string & z.core.$brand<"ContentFieldId">;
|
|
332
|
+
source: string;
|
|
333
|
+
slug: string;
|
|
334
|
+
publicPath?: string | undefined;
|
|
335
|
+
format?: "md" | "html" | "tsx" | undefined;
|
|
336
|
+
compiled?: {
|
|
337
|
+
sha256: string & z.core.$brand<"ContentModelSha256">;
|
|
338
|
+
} | undefined;
|
|
339
|
+
documentSeed?: {
|
|
340
|
+
text: string;
|
|
341
|
+
sha256: string & z.core.$brand<"ContentModelSha256">;
|
|
342
|
+
} | undefined;
|
|
343
|
+
}>>>;
|
|
344
|
+
materializations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
345
|
+
resourceId: z.core.$ZodBranded<z.ZodString, "ContentResourceId", "out">;
|
|
346
|
+
fieldId: z.core.$ZodBranded<z.ZodString, "ContentFieldId", "out">;
|
|
347
|
+
directory: z.ZodString;
|
|
348
|
+
suffix: z.ZodString;
|
|
349
|
+
format: z.ZodEnum<{
|
|
350
|
+
md: "md";
|
|
351
|
+
html: "html";
|
|
352
|
+
tsx: "tsx";
|
|
353
|
+
}>;
|
|
354
|
+
}, z.core.$strict>>>;
|
|
301
355
|
}, z.core.$strict>;
|
|
302
356
|
executables: z.ZodObject<{
|
|
303
357
|
format: z.ZodLiteral<"spacefast.zero-executables">;
|
|
304
358
|
version: z.ZodLiteral<1>;
|
|
305
|
-
inputDigest: z.core.$ZodBranded<z.ZodString, "
|
|
359
|
+
inputDigest: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
306
360
|
executables: z.ZodArray<z.ZodObject<{
|
|
307
361
|
id: z.ZodString;
|
|
308
362
|
runtime: z.ZodEnum<{
|
|
309
363
|
php: "php";
|
|
310
364
|
quickjs: "quickjs";
|
|
311
365
|
}>;
|
|
312
|
-
artifact: z.core.$ZodBranded<z.ZodString, "
|
|
366
|
+
artifact: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
313
367
|
export: z.ZodString;
|
|
314
368
|
}, z.core.$strict>>;
|
|
315
369
|
}, z.core.$strict>;
|
|
316
370
|
sdk: z.ZodObject<{
|
|
317
371
|
format: z.ZodLiteral<"spacefast.sdk-descriptors">;
|
|
318
372
|
version: z.ZodLiteral<1>;
|
|
319
|
-
inputDigest: z.core.$ZodBranded<z.ZodString, "
|
|
373
|
+
inputDigest: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
320
374
|
operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
321
375
|
id: z.core.$ZodBranded<z.ZodString, "ContentAbilityId", "out">;
|
|
322
376
|
kind: z.ZodLiteral<"query">;
|
|
323
377
|
mode: z.ZodLiteral<"read">;
|
|
324
378
|
input: z.ZodObject<{
|
|
325
379
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
326
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
380
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
327
381
|
}, z.core.$strict>;
|
|
328
382
|
output: z.ZodObject<{
|
|
329
383
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
330
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
384
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
331
385
|
}, z.core.$strict>;
|
|
332
386
|
cache: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
333
387
|
kind: z.ZodLiteral<"none">;
|
|
@@ -346,11 +400,11 @@ export declare const compiledContentProgramBundleV1Schema: z.ZodObject<{
|
|
|
346
400
|
mode: z.ZodLiteral<"write">;
|
|
347
401
|
input: z.ZodObject<{
|
|
348
402
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
349
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
403
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
350
404
|
}, z.core.$strict>;
|
|
351
405
|
output: z.ZodObject<{
|
|
352
406
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
353
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
407
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
354
408
|
}, z.core.$strict>;
|
|
355
409
|
cache: z.ZodObject<{
|
|
356
410
|
kind: z.ZodLiteral<"none">;
|
|
@@ -365,11 +419,11 @@ export declare const compiledContentProgramBundleV1Schema: z.ZodObject<{
|
|
|
365
419
|
}>;
|
|
366
420
|
input: z.ZodObject<{
|
|
367
421
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
368
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
422
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
369
423
|
}, z.core.$strict>;
|
|
370
424
|
output: z.ZodObject<{
|
|
371
425
|
id: z.core.$ZodBranded<z.ZodString, "ContentSchemaId", "out">;
|
|
372
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
426
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
373
427
|
}, z.core.$strict>;
|
|
374
428
|
cache: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
375
429
|
kind: z.ZodLiteral<"none">;
|
|
@@ -392,7 +446,7 @@ export declare const compiledContentProgramBundleV1Schema: z.ZodObject<{
|
|
|
392
446
|
routes: z.ZodObject<{
|
|
393
447
|
format: z.ZodLiteral<"spacefast.route-contributions">;
|
|
394
448
|
version: z.ZodLiteral<1>;
|
|
395
|
-
inputDigest: z.core.$ZodBranded<z.ZodString, "
|
|
449
|
+
inputDigest: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
396
450
|
routes: z.ZodArray<z.ZodObject<{
|
|
397
451
|
abilityId: z.core.$ZodBranded<z.ZodString, "ContentAbilityId", "out">;
|
|
398
452
|
route: z.ZodObject<{
|
|
@@ -415,66 +469,66 @@ export declare const compiledContentProgramBundleV1Schema: z.ZodObject<{
|
|
|
415
469
|
}, z.core.$strict>>;
|
|
416
470
|
}, z.core.$strict>;
|
|
417
471
|
requirements: z.ZodObject<{
|
|
418
|
-
format: z.ZodLiteral<"spacefast.
|
|
472
|
+
format: z.ZodLiteral<"spacefast.content-model-requirements">;
|
|
419
473
|
version: z.ZodLiteral<1>;
|
|
420
|
-
inputDigest: z.core.$ZodBranded<z.ZodString, "
|
|
474
|
+
inputDigest: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
421
475
|
wordpressAbi: z.ZodLiteral<1>;
|
|
422
476
|
capabilities: z.ZodArray<z.core.$ZodBranded<z.ZodString, "RuntimeCapabilityId", "out">>;
|
|
423
477
|
}, z.core.$strict>;
|
|
424
478
|
}, z.core.$strict>;
|
|
425
479
|
compiled: z.ZodObject<{
|
|
426
|
-
format: z.ZodLiteral<"spacefast.compiled-
|
|
480
|
+
format: z.ZodLiteral<"spacefast.compiled-content-model">;
|
|
427
481
|
version: z.ZodLiteral<1>;
|
|
428
|
-
|
|
482
|
+
model: z.ZodObject<{
|
|
429
483
|
format: z.ZodLiteral<"spacefast.zero-wordpress">;
|
|
430
484
|
version: z.ZodLiteral<1>;
|
|
431
|
-
inputDigest: z.core.$ZodBranded<z.ZodString, "
|
|
432
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
485
|
+
inputDigest: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
486
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
433
487
|
bytes: z.ZodNumber;
|
|
434
488
|
mediaType: z.ZodLiteral<"application/json">;
|
|
435
489
|
}, z.core.$strict>;
|
|
436
490
|
executables: z.ZodObject<{
|
|
437
491
|
format: z.ZodLiteral<"spacefast.zero-executables">;
|
|
438
492
|
version: z.ZodLiteral<1>;
|
|
439
|
-
inputDigest: z.core.$ZodBranded<z.ZodString, "
|
|
440
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
493
|
+
inputDigest: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
494
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
441
495
|
bytes: z.ZodNumber;
|
|
442
496
|
mediaType: z.ZodLiteral<"application/json">;
|
|
443
497
|
}, z.core.$strict>;
|
|
444
498
|
sdk: z.ZodObject<{
|
|
445
499
|
format: z.ZodLiteral<"spacefast.sdk-descriptors">;
|
|
446
500
|
version: z.ZodLiteral<1>;
|
|
447
|
-
inputDigest: z.core.$ZodBranded<z.ZodString, "
|
|
448
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
501
|
+
inputDigest: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
502
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
449
503
|
bytes: z.ZodNumber;
|
|
450
504
|
mediaType: z.ZodLiteral<"application/json">;
|
|
451
505
|
}, z.core.$strict>;
|
|
452
506
|
routes: z.ZodObject<{
|
|
453
507
|
format: z.ZodLiteral<"spacefast.route-contributions">;
|
|
454
508
|
version: z.ZodLiteral<1>;
|
|
455
|
-
inputDigest: z.core.$ZodBranded<z.ZodString, "
|
|
456
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
509
|
+
inputDigest: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
510
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
457
511
|
bytes: z.ZodNumber;
|
|
458
512
|
mediaType: z.ZodLiteral<"application/json">;
|
|
459
513
|
}, z.core.$strict>;
|
|
460
514
|
requirements: z.ZodObject<{
|
|
461
|
-
format: z.ZodLiteral<"spacefast.
|
|
515
|
+
format: z.ZodLiteral<"spacefast.content-model-requirements">;
|
|
462
516
|
version: z.ZodLiteral<1>;
|
|
463
|
-
inputDigest: z.core.$ZodBranded<z.ZodString, "
|
|
464
|
-
sha256: z.core.$ZodBranded<z.ZodString, "
|
|
517
|
+
inputDigest: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
518
|
+
sha256: z.core.$ZodBranded<z.ZodString, "ContentModelSha256", "out">;
|
|
465
519
|
bytes: z.ZodNumber;
|
|
466
520
|
mediaType: z.ZodLiteral<"application/json">;
|
|
467
521
|
}, z.core.$strict>;
|
|
468
522
|
}, z.core.$strict>;
|
|
469
523
|
}, z.core.$strict>;
|
|
470
|
-
export type
|
|
471
|
-
export declare function
|
|
524
|
+
export type CompiledContentModelBundleV1 = z.infer<typeof compiledContentModelBundleV1Schema>;
|
|
525
|
+
export declare function verifyCompiledContentModelBundleV1(value: z.input<typeof compiledContentModelBundleV1Schema>): Promise<CompiledContentModelBundleV1>;
|
|
472
526
|
export declare function verifySyncLedgerV1(value: z.input<typeof syncLedgerV1Schema>): Promise<SyncLedgerV1>;
|
|
473
527
|
export declare function verifySyncReconciliationExchangeV1(value: z.input<typeof syncReconciliationExchangeV1Schema>, acknowledgement?: z.input<typeof syncSourceAcknowledgementV1Schema>): Promise<{
|
|
474
528
|
exchange: SyncReconciliationExchangeV1;
|
|
475
529
|
acknowledgement?: SyncSourceAcknowledgementV1;
|
|
476
530
|
}>;
|
|
477
|
-
export declare function
|
|
531
|
+
export declare function verifyContentSyncConflictProblem(value: z.input<typeof contentSyncConflictProblemSchema>): Promise<ContentSyncConflictProblem>;
|
|
478
532
|
export declare function verifyFrameLaunchTicketClaimsV1(value: z.input<typeof frameLaunchTicketClaimsV1Schema>): Promise<FrameLaunchTicketClaimsV1>;
|
|
479
533
|
export declare function verifyFrameSessionClaimsV1(value: z.input<typeof frameSessionClaimsV1Schema>): Promise<FrameSessionClaimsV1>;
|
|
480
534
|
export declare function verifyFrameProtocolV1(input: {
|
|
@@ -493,8 +547,8 @@ export declare function verifyApplicationJournalDeliveryV1(entryValue: z.input<t
|
|
|
493
547
|
receipt: ApplicationJournalDeliveryReceiptV1;
|
|
494
548
|
}>;
|
|
495
549
|
export declare function verifyRuntimeComponentInventoryV1(value: z.input<typeof runtimeComponentInventoryV1Schema>): Promise<RuntimeComponentInventoryV1>;
|
|
496
|
-
export declare function
|
|
497
|
-
requirements: z.infer<typeof
|
|
550
|
+
export declare function verifyContentModelRuntimeCompatibilityV1(requirementsValue: z.input<typeof contentModelRequirementsV1Schema>, inventoryValue: z.input<typeof runtimeComponentInventoryV1Schema>): Promise<{
|
|
551
|
+
requirements: z.infer<typeof contentModelRequirementsV1Schema>;
|
|
498
552
|
inventory: RuntimeComponentInventoryV1;
|
|
499
553
|
}>;
|
|
500
554
|
export declare function verifyRuntimePlacementReadinessV1(input: {
|
|
@@ -515,7 +569,7 @@ export declare function verifyRuntimePlacementReadinessV1(input: {
|
|
|
515
569
|
export declare function verifySpaceRouteSnapshotV1(value: z.input<typeof spaceRouteSnapshotV1Schema>): Promise<SpaceRouteSnapshotV1>;
|
|
516
570
|
export declare function verifyRouteInventoryV1(value: z.input<typeof routeInventoryV1Schema>): Promise<RouteInventoryV1>;
|
|
517
571
|
export declare function verifyContentArtifactV1(ref: Readonly<{
|
|
518
|
-
inputDigest:
|
|
519
|
-
sha256:
|
|
572
|
+
inputDigest: ContentModelSha256;
|
|
573
|
+
sha256: ContentModelSha256;
|
|
520
574
|
bytes: number;
|
|
521
|
-
}>, artifact: ContentContractArtifactPayload, expectedInputDigest:
|
|
575
|
+
}>, artifact: ContentContractArtifactPayload, expectedInputDigest: ContentModelSha256, payloadCarriesInputDigest?: boolean): Promise<void>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { canonicalJson } from "../utils/canonical-json.js";
|
|
3
3
|
import { applicationJournalDeliveryClaimV1Schema, applicationJournalDeliveryReceiptV1Schema, applicationJournalEntryV1Schema, } from "./application-journal.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { contentModelSdkDescriptors } from "./content-model-sdk.js";
|
|
5
|
+
import { compiledContentModelV1Schema, contentExecutableSetV1Schema, contentModelJsonValueSchema, contentModelReleaseV1Schema, contentModelSha256Schema, contentRouteContributionSetV1Schema, contentSdkDescriptorSetV1Schema, } from "./content-model.js";
|
|
6
|
+
import { contentSyncConflictProblemSchema, syncReconciliationExchangeV1Schema, syncSourceAcknowledgementV1Schema, syncLedgerV1Schema, } from "./content-sync.js";
|
|
6
7
|
import { frameGrantDecisionV1Schema, frameLaunchTicketClaimsV1Schema, frameSessionClaimsV1Schema, } from "./frame-session.js";
|
|
7
8
|
import { principalAssertionV1Schema } from "./principal-assertion.js";
|
|
8
9
|
import { routeInventoryV1Schema, spaceRouteSnapshotV1Schema, } from "./route-inventory.js";
|
|
9
|
-
import {
|
|
10
|
+
import { contentModelRequirementsV1Schema, runtimeComponentInventoryV1Schema, runtimeComponentPlacementReceiptV1Schema, runtimeComponentPlacementTargetV1Schema, } from "./runtime-components.js";
|
|
10
11
|
const encoder = new TextEncoder();
|
|
11
12
|
async function sha256Text(value) {
|
|
12
13
|
const encoded = encoder.encode(value);
|
|
@@ -14,7 +15,7 @@ async function sha256Text(value) {
|
|
|
14
15
|
new Uint8Array(bytes).set(encoded);
|
|
15
16
|
const digest = await globalThis.crypto.subtle.digest("SHA-256", bytes);
|
|
16
17
|
const hex = Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
17
|
-
return
|
|
18
|
+
return contentModelSha256Schema.parse(`sha256:${hex}`);
|
|
18
19
|
}
|
|
19
20
|
export function contentContractSha256(value) {
|
|
20
21
|
return sha256Text(canonicalJson(value));
|
|
@@ -54,62 +55,49 @@ function frameGrantDecisionMeaning(claims) {
|
|
|
54
55
|
sessionVersion: claims.sessionVersion,
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
|
-
export async function
|
|
58
|
-
const
|
|
59
|
-
await Promise.all(
|
|
60
|
-
const { revision, ...meaning } =
|
|
61
|
-
await requireDigest(revision, meaning, "content
|
|
62
|
-
return
|
|
58
|
+
export async function verifyContentModelReleaseV1(value) {
|
|
59
|
+
const contentModel = contentModelReleaseV1Schema.parse(value);
|
|
60
|
+
await Promise.all(contentModel.schemas.map((definition) => requireDigest(definition.sha256, definition.schema, `schema ${definition.id}`)));
|
|
61
|
+
const { revision, ...meaning } = contentModel;
|
|
62
|
+
await requireDigest(revision, meaning, "content model revision");
|
|
63
|
+
return contentModel;
|
|
63
64
|
}
|
|
64
|
-
export const
|
|
65
|
+
export const compiledContentModelBundleV1Schema = z
|
|
65
66
|
.object({
|
|
66
|
-
capsule:
|
|
67
|
+
capsule: contentModelJsonValueSchema,
|
|
67
68
|
artifacts: z
|
|
68
69
|
.object({
|
|
69
|
-
|
|
70
|
+
model: contentModelReleaseV1Schema,
|
|
70
71
|
executables: contentExecutableSetV1Schema,
|
|
71
72
|
sdk: contentSdkDescriptorSetV1Schema,
|
|
72
73
|
routes: contentRouteContributionSetV1Schema,
|
|
73
|
-
requirements:
|
|
74
|
+
requirements: contentModelRequirementsV1Schema,
|
|
74
75
|
})
|
|
75
76
|
.strict(),
|
|
76
|
-
compiled:
|
|
77
|
+
compiled: compiledContentModelV1Schema,
|
|
77
78
|
})
|
|
78
79
|
.strict();
|
|
79
|
-
export async function
|
|
80
|
-
const bundle =
|
|
80
|
+
export async function verifyCompiledContentModelBundleV1(value) {
|
|
81
|
+
const bundle = compiledContentModelBundleV1Schema.parse(value);
|
|
81
82
|
const capsuleDigest = await contentContractSha256(bundle.capsule);
|
|
82
|
-
const
|
|
83
|
+
const contentModel = await verifyContentModelReleaseV1(bundle.artifacts.model);
|
|
83
84
|
await Promise.all([
|
|
84
|
-
verifyContentArtifactV1(bundle.compiled.
|
|
85
|
-
verifyContentArtifactV1(bundle.compiled.executables, bundle.artifacts.executables,
|
|
86
|
-
verifyContentArtifactV1(bundle.compiled.sdk, bundle.artifacts.sdk,
|
|
87
|
-
verifyContentArtifactV1(bundle.compiled.routes, bundle.artifacts.routes,
|
|
88
|
-
verifyContentArtifactV1(bundle.compiled.requirements, bundle.artifacts.requirements,
|
|
85
|
+
verifyContentArtifactV1(bundle.compiled.model, bundle.artifacts.model, capsuleDigest, false),
|
|
86
|
+
verifyContentArtifactV1(bundle.compiled.executables, bundle.artifacts.executables, contentModel.revision),
|
|
87
|
+
verifyContentArtifactV1(bundle.compiled.sdk, bundle.artifacts.sdk, contentModel.revision),
|
|
88
|
+
verifyContentArtifactV1(bundle.compiled.routes, bundle.artifacts.routes, contentModel.revision),
|
|
89
|
+
verifyContentArtifactV1(bundle.compiled.requirements, bundle.artifacts.requirements, contentModel.revision),
|
|
89
90
|
]);
|
|
90
|
-
requireSameValue(bundle.artifacts.executables.executables.map((executable) => executable.id), [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
for (const operation of bundle.artifacts.sdk.operations) {
|
|
101
|
-
for (const invalidatedAbility of operation.invalidates) {
|
|
102
|
-
if (!abilityIds.has(invalidatedAbility)) {
|
|
103
|
-
throw new TypeError(`content SDK operation ${operation.id} invalidates unknown ability ${invalidatedAbility}`);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
requireSameValue(bundle.artifacts.sdk.sync, program.syncBindings.map((binding) => ({
|
|
108
|
-
id: binding.id,
|
|
109
|
-
resourceId: binding.resourceId,
|
|
110
|
-
source: binding.source,
|
|
111
|
-
})), "content SDK sync descriptors");
|
|
112
|
-
requireSameValue(bundle.artifacts.routes.routes, program.abilities.flatMap((ability) => ability.exposure.kind === "routed"
|
|
91
|
+
requireSameValue(bundle.artifacts.executables.executables.map((executable) => executable.id), [
|
|
92
|
+
...contentModel.abilities.map((ability) => ability.id),
|
|
93
|
+
...contentModel.hooks.map((hook) => hook.id),
|
|
94
|
+
], "content executable identities");
|
|
95
|
+
// The whole descriptor set, `invalidates` included. A compiled bundle carries
|
|
96
|
+
// its SDK descriptors, but it does not get to choose them: they are a pure
|
|
97
|
+
// function of the release, and a bundle whose descriptors disagree with that
|
|
98
|
+
// derivation is refused rather than trusted.
|
|
99
|
+
requireSameValue(bundle.artifacts.sdk, contentModelSdkDescriptors(contentModel), "content SDK descriptors");
|
|
100
|
+
requireSameValue(bundle.artifacts.routes.routes, contentModel.abilities.flatMap((ability) => ability.exposure.kind === "routed"
|
|
113
101
|
? [{ abilityId: ability.id, route: ability.exposure.route }]
|
|
114
102
|
: []), "content route contributions");
|
|
115
103
|
return bundle;
|
|
@@ -118,15 +106,15 @@ export async function verifySyncLedgerV1(value) {
|
|
|
118
106
|
const ledger = syncLedgerV1Schema.parse(value);
|
|
119
107
|
const { revision, ...meaning } = ledger;
|
|
120
108
|
await requireDigest(revision, meaning, "sync ledger revision");
|
|
121
|
-
await requireTextDigest(ledger.
|
|
109
|
+
await requireTextDigest(ledger.textDigest, ledger.baseText, "sync ledger text");
|
|
122
110
|
return ledger;
|
|
123
111
|
}
|
|
124
112
|
export async function verifySyncReconciliationExchangeV1(value, acknowledgement) {
|
|
125
113
|
const exchange = syncReconciliationExchangeV1Schema.parse(value);
|
|
126
114
|
await verifySyncLedgerV1(exchange.receipt.ledger);
|
|
127
115
|
if (exchange.receipt.status !== "pulled" &&
|
|
128
|
-
exchange.receipt.ledger.
|
|
129
|
-
throw new TypeError(`sync ${exchange.receipt.status} receipt must commit the requested
|
|
116
|
+
exchange.receipt.ledger.baseText !== exchange.request.text) {
|
|
117
|
+
throw new TypeError(`sync ${exchange.receipt.status} receipt must commit the requested text`);
|
|
130
118
|
}
|
|
131
119
|
if (acknowledgement === undefined)
|
|
132
120
|
return { exchange };
|
|
@@ -145,9 +133,9 @@ export async function verifySyncReconciliationExchangeV1(value, acknowledgement)
|
|
|
145
133
|
}
|
|
146
134
|
return { exchange, acknowledgement: parsedAcknowledgement };
|
|
147
135
|
}
|
|
148
|
-
export async function
|
|
149
|
-
const problem =
|
|
150
|
-
await Promise.all(["base", "source", "wordpress"].map((side) => requireTextDigest(problem.details[side].digest, problem.details[side].
|
|
136
|
+
export async function verifyContentSyncConflictProblem(value) {
|
|
137
|
+
const problem = contentSyncConflictProblemSchema.parse(value);
|
|
138
|
+
await Promise.all(["base", "source", "wordpress"].map((side) => requireTextDigest(problem.details[side].digest, problem.details[side].text, `sync conflict ${side}`)));
|
|
151
139
|
return problem;
|
|
152
140
|
}
|
|
153
141
|
export async function verifyFrameLaunchTicketClaimsV1(value) {
|
|
@@ -225,8 +213,8 @@ export async function verifyRuntimeComponentInventoryV1(value) {
|
|
|
225
213
|
await requireDigest(digest, meaning, "runtime component inventory");
|
|
226
214
|
return inventory;
|
|
227
215
|
}
|
|
228
|
-
export async function
|
|
229
|
-
const requirements =
|
|
216
|
+
export async function verifyContentModelRuntimeCompatibilityV1(requirementsValue, inventoryValue) {
|
|
217
|
+
const requirements = contentModelRequirementsV1Schema.parse(requirementsValue);
|
|
230
218
|
const inventory = await verifyRuntimeComponentInventoryV1(inventoryValue);
|
|
231
219
|
const provided = new Set(inventory.components.flatMap((component) => component.provides));
|
|
232
220
|
const missing = requirements.capabilities.filter((capability) => !provided.has(capability));
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import { contentModelFieldSchema, type ContentModelSha256, type ContentSyncFormat } from "./content-model.js";
|
|
3
|
+
import { type CompiledContentModelArtifactsV1 } from "./runtime-components.js";
|
|
4
|
+
/**
|
|
5
|
+
* The last mile of every "author → ContentModel" compiler: given resources,
|
|
6
|
+
* sync bindings, and pages that already speak the IR's vocabulary, produce the
|
|
7
|
+
* release and the five artifacts a published version declares.
|
|
8
|
+
*
|
|
9
|
+
* What lives here is the part that is the same no matter where the model came
|
|
10
|
+
* from — native adoption, the JSON Schema each resource publishes, the required
|
|
11
|
+
* runtime capabilities, revision and artifact digests, and the SDK derivation.
|
|
12
|
+
* What does not live here is translation: mapping someone else's config onto
|
|
13
|
+
* these resources is that adapter's whole job, and every adapter does it
|
|
14
|
+
* differently.
|
|
15
|
+
*/
|
|
16
|
+
/** The IR's own field shape, before branding — what a compiler builds. */
|
|
17
|
+
export type ContentModelEmitField = z.input<typeof contentModelFieldSchema>;
|
|
18
|
+
export type ContentModelEmitResource = {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly label: string;
|
|
22
|
+
readonly kind: "posts" | "pages" | "media" | "collection";
|
|
23
|
+
readonly publicRead: boolean;
|
|
24
|
+
readonly fields: readonly ContentModelEmitField[];
|
|
25
|
+
};
|
|
26
|
+
export type ContentModelEmitSyncBinding = {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly resourceId: string;
|
|
29
|
+
readonly fieldId: string;
|
|
30
|
+
readonly source: string;
|
|
31
|
+
readonly publicPath?: string;
|
|
32
|
+
readonly format: ContentSyncFormat;
|
|
33
|
+
/**
|
|
34
|
+
* The digest of the markup a one-way source compiled to. Required for a
|
|
35
|
+
* compile-class format and refused for the two-way ones — the release schema
|
|
36
|
+
* enforces both, so a caller that omits it here fails at emit, not later.
|
|
37
|
+
*/
|
|
38
|
+
readonly compiled?: {
|
|
39
|
+
readonly sha256: ContentModelSha256;
|
|
40
|
+
};
|
|
41
|
+
/** Exact source bytes for MD/HTML, rendered markup for TSX; sealed by the model revision. */
|
|
42
|
+
readonly documentSeed?: {
|
|
43
|
+
readonly text: string;
|
|
44
|
+
readonly sha256: ContentModelSha256;
|
|
45
|
+
};
|
|
46
|
+
readonly slug: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Where one collection field puts a document WordPress created before any file
|
|
50
|
+
* backed it. Restates what the capsule declared, so it travels with the release
|
|
51
|
+
* rather than being recomputed at request time.
|
|
52
|
+
*/
|
|
53
|
+
export type ContentModelEmitMaterialization = {
|
|
54
|
+
readonly resourceId: string;
|
|
55
|
+
readonly fieldId: string;
|
|
56
|
+
readonly directory: string;
|
|
57
|
+
readonly suffix: string;
|
|
58
|
+
readonly format: ContentSyncFormat;
|
|
59
|
+
};
|
|
60
|
+
export type ContentModelEmitPage = {
|
|
61
|
+
readonly id: string;
|
|
62
|
+
readonly sourceKey: string;
|
|
63
|
+
readonly path: string;
|
|
64
|
+
readonly title: string;
|
|
65
|
+
readonly componentId: string;
|
|
66
|
+
};
|
|
67
|
+
export type ContentModelEmitInput = {
|
|
68
|
+
/**
|
|
69
|
+
* Every resource the model declares. Natives the author never mentioned are
|
|
70
|
+
* filled in here, so a caller passes only what it actually translated.
|
|
71
|
+
*/
|
|
72
|
+
readonly resources: readonly ContentModelEmitResource[];
|
|
73
|
+
readonly syncBindings?: readonly ContentModelEmitSyncBinding[];
|
|
74
|
+
readonly materializations?: readonly ContentModelEmitMaterialization[];
|
|
75
|
+
readonly pages?: readonly ContentModelEmitPage[];
|
|
76
|
+
/**
|
|
77
|
+
* The bytes the model was compiled from. It becomes `compiled.model.inputDigest`
|
|
78
|
+
* and is what lets a reviewer tell one compile apart from a rerun of the same
|
|
79
|
+
* one.
|
|
80
|
+
*/
|
|
81
|
+
readonly sourceDigest: ContentModelSha256;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Lowers declared content into the compiled model.
|
|
85
|
+
*
|
|
86
|
+
* The revision is digested from the *parsed* release with its own revision
|
|
87
|
+
* removed, never from the draft that went in. The schema trims labels and
|
|
88
|
+
* applies defaults, so digesting the draft would produce a revision that
|
|
89
|
+
* `verifyContentModelReleaseV1` recomputes differently and rejects.
|
|
90
|
+
*
|
|
91
|
+
* No Abilities are emitted. This model declares content and nothing that runs,
|
|
92
|
+
* so there are no executables, no routes, and an SDK whose operations are
|
|
93
|
+
* empty — inventing a query here would mean inventing the QuickJS body behind
|
|
94
|
+
* it. The content is still reachable: the kernel registers the post types,
|
|
95
|
+
* meta, and taxonomy terms, and WordPress's own REST surface serves them.
|
|
96
|
+
*/
|
|
97
|
+
export declare function emitContentModelArtifacts(input: ContentModelEmitInput): Promise<CompiledContentModelArtifactsV1>;
|