@void/platform 0.20.2 → 0.21.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/index.d.mts CHANGED
@@ -297,7 +297,7 @@ type PlatformInstallationManifest = Readonly<{
297
297
  resources: ReadonlyArray<InstallationResource>;
298
298
  runtime: PlatformRuntimeProvenance | null;
299
299
  safetyProtocols: Readonly<{
300
- sandboxDrain: 0 | 1 | 2;
300
+ sandboxDrain: 0 | 1 | 2 | 3;
301
301
  }>;
302
302
  schemaVersion: typeof PLATFORM_INSTALLATION_SCHEMA_VERSION;
303
303
  status: InstallationStatus;
@@ -337,7 +337,7 @@ export declare function createPlatformInstallationManifest(input: {
337
337
  ownershipNonce: string;
338
338
  platformVersion: string;
339
339
  safetyProtocols?: Readonly<{
340
- sandboxDrain: 0 | 1 | 2;
340
+ sandboxDrain: 0 | 1 | 2 | 3;
341
341
  }>;
342
342
  usageProtocolVersion?: 0 | 1 | 2;
343
343
  }): PlatformInstallationManifest;
@@ -397,6 +397,7 @@ export declare function createPlatformWorkerConfigs(input: {
397
397
  emailGatewayUrl: string;
398
398
  resources: PlatformProvisionedResourceIds;
399
399
  runtimeEntrypoints: Readonly<Record<"api" | "dispatch" | "proxy" | "tail" | "emailGateway", string>>;
400
+ runtimeApiAssetsDirectory?: string;
400
401
  trafficState?: "enabled" | "sandbox-drain" | "staging";
401
402
  }): PlatformWorkerConfigSet;
402
403
  //#endregion
package/dist/index.mjs CHANGED
@@ -758,7 +758,7 @@ function parseUsageProtocolVersion$1(value) {
758
758
  function parseSafetyProtocols(value) {
759
759
  if (value === void 0) return { sandboxDrain: 0 };
760
760
  assertRecord(value, "safetyProtocols");
761
- if (value.sandboxDrain !== 0 && value.sandboxDrain !== 1 && value.sandboxDrain !== 2) throw new Error("safetyProtocols.sandboxDrain must be 0, 1, or 2.");
761
+ if (value.sandboxDrain !== 0 && value.sandboxDrain !== 1 && value.sandboxDrain !== 2 && value.sandboxDrain !== 3) throw new Error("safetyProtocols.sandboxDrain must be 0, 1, 2, or 3.");
762
762
  return { sandboxDrain: value.sandboxDrain };
763
763
  }
764
764
  function parsePlatformRuntimeProvenance(value) {
@@ -1007,6 +1007,7 @@ function createPlatformWorkerConfigs(input) {
1007
1007
  name: names.apiWorker,
1008
1008
  main: runtimeEntrypoints.api,
1009
1009
  no_bundle: true,
1010
+ ...input.runtimeApiAssetsDirectory ? { assets: { directory: input.runtimeApiAssetsDirectory } } : {},
1010
1011
  compatibility_flags: ["nodejs_compat", ...fetchWorkersDev ? ["global_fetch_strictly_public"] : []],
1011
1012
  placement: { mode: "smart" },
1012
1013
  hyperdrive: [{
@@ -1098,7 +1099,8 @@ function createPlatformWorkerConfigs(input) {
1098
1099
  SITE_DOMAIN: deployment.application.baseDomain,
1099
1100
  ...deployment.application.workersDev ? { PLATFORM_APPLICATION: JSON.stringify(deployment.application) } : {},
1100
1101
  TAIL_SERVICE_NAME: names.tailWorker,
1101
- VOID_PROXY_SERVICE: names.proxyWorker
1102
+ VOID_PROXY_SERVICE: names.proxyWorker,
1103
+ SANDBOX_CONTROL_SERVICE: names.apiWorker
1102
1104
  }
1103
1105
  };
1104
1106
  if (publicEndpoints && deployment.controlPlane.apiHostname) api.routes = [{
@@ -4,6 +4,9 @@ export type PlatformRuntimeArtifact = Readonly<{
4
4
  sha256: string;
5
5
  size: number;
6
6
  }>;
7
+ export declare const PLATFORM_ADMIN_ASSETS_DIRECTORY = "api/assets";
8
+ export declare const PLATFORM_ADMIN_CLIENT_ASSET_PATH: string;
9
+ export declare const PLATFORM_ADMIN_STYLE_ASSET_PATH: string;
7
10
  export type PlatformRuntimeMigration = Readonly<{
8
11
  index: number;
9
12
  sha256: string;
@@ -26,11 +29,15 @@ export type PlatformRuntimeManifest = Readonly<{
26
29
  authenticationProtocolVersion?: 1;
27
30
  applicationRoutingVersion?: 1;
28
31
  artifacts: Readonly<Record<"api" | "dispatch" | "proxy" | "tail", PlatformRuntimeArtifact> & Partial<Record<"emailGateway", PlatformRuntimeArtifact>>>;
32
+ assets?: Readonly<{
33
+ adminClient: PlatformRuntimeArtifact;
34
+ adminStyle?: PlatformRuntimeArtifact;
35
+ }>;
29
36
  emailProtocolVersion?: 1;
30
37
  database: PlatformRuntimeDatabaseManifest;
31
38
  platformVersion: string;
32
39
  safetyProtocols: Readonly<{
33
- sandboxDrain: 0 | 1 | 2;
40
+ sandboxDrain: 0 | 1 | 2 | 3;
34
41
  }>;
35
42
  schemaVersion: 2;
36
43
  sourceRevision: string | null;
@@ -3,6 +3,9 @@ import { readFileSync, realpathSync, statSync } from "node:fs";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { dirname, isAbsolute, join, resolve } from "pathslash";
5
5
  //#region src/installer.ts
6
+ const PLATFORM_ADMIN_ASSETS_DIRECTORY = "api/assets";
7
+ const PLATFORM_ADMIN_CLIENT_ASSET_PATH = `${PLATFORM_ADMIN_ASSETS_DIRECTORY}/admin/client.js`;
8
+ const PLATFORM_ADMIN_STYLE_ASSET_PATH = `${PLATFORM_ADMIN_ASSETS_DIRECTORY}/admin/style.css`;
6
9
  const SHA256_PATTERN = /^[0-9a-f]{64}$/;
7
10
  const TAG_PATTERN = /^[0-9]{4}_[a-z0-9_]+$/;
8
11
  function platformDatabaseSchemaDigest(lineage, migrations) {
@@ -32,6 +35,18 @@ function parsePlatformRuntimeManifest(value) {
32
35
  ...artifactsValue.emailGateway === void 0 ? [] : ["emailGateway"]
33
36
  ];
34
37
  const artifacts = Object.fromEntries(artifactNames.map((name) => [name, parseArtifact(artifactsValue[name], name)]));
38
+ let assets;
39
+ if (root.assets !== void 0) {
40
+ const assetsValue = record(root.assets, "runtime manifest assets");
41
+ const adminClient = parseArtifact(assetsValue.adminClient, "admin client asset");
42
+ if (adminClient.path !== PLATFORM_ADMIN_CLIENT_ASSET_PATH) throw new Error(`runtime manifest admin client asset path must be ${PLATFORM_ADMIN_CLIENT_ASSET_PATH}`);
43
+ const adminStyle = assetsValue.adminStyle === void 0 ? void 0 : parseArtifact(assetsValue.adminStyle, "admin style asset");
44
+ if (adminStyle && adminStyle.path !== PLATFORM_ADMIN_STYLE_ASSET_PATH) throw new Error(`runtime manifest admin style asset path must be ${PLATFORM_ADMIN_STYLE_ASSET_PATH}`);
45
+ assets = {
46
+ adminClient,
47
+ ...adminStyle ? { adminStyle } : {}
48
+ };
49
+ }
35
50
  const databaseValue = record(root.database, "runtime manifest database");
36
51
  if (databaseValue.protocolVersion !== 1) throw new Error("runtime manifest database protocolVersion must be 1");
37
52
  const lineage = nonemptyString(databaseValue.lineage, "database lineage");
@@ -65,6 +80,7 @@ function parsePlatformRuntimeManifest(value) {
65
80
  if (rollbackSafeFrom.some((entry) => !prefixDigests.has(entry.schemaDigest))) throw new Error("runtime manifest database rollback compatibility must reference this migration lineage");
66
81
  return {
67
82
  artifacts,
83
+ ...assets ? { assets } : {},
68
84
  ...root.authenticationProtocolVersion === 1 ? { authenticationProtocolVersion: 1 } : {},
69
85
  ...root.emailProtocolVersion === 1 ? { emailProtocolVersion: 1 } : {},
70
86
  ...root.applicationRoutingVersion === 1 ? { applicationRoutingVersion: 1 } : {},
@@ -86,7 +102,7 @@ function parsePlatformRuntimeManifest(value) {
86
102
  function parseSafetyProtocols(value) {
87
103
  if (value === void 0) return { sandboxDrain: 0 };
88
104
  const protocols = record(value, "runtime manifest safetyProtocols");
89
- if (protocols.sandboxDrain !== 0 && protocols.sandboxDrain !== 1 && protocols.sandboxDrain !== 2) throw new Error("runtime manifest safetyProtocols.sandboxDrain must be 0, 1, or 2");
105
+ if (protocols.sandboxDrain !== 0 && protocols.sandboxDrain !== 1 && protocols.sandboxDrain !== 2 && protocols.sandboxDrain !== 3) throw new Error("runtime manifest safetyProtocols.sandboxDrain must be 0, 1, 2, or 3");
90
106
  return { sandboxDrain: protocols.sandboxDrain };
91
107
  }
92
108
  function usageProtocolVersion(value) {
@@ -182,4 +198,4 @@ function sha256(value, name) {
182
198
  return value;
183
199
  }
184
200
  //#endregion
185
- export { getPlatformRuntimeDirectory, parsePlatformRuntimeManifest, platformDatabaseSchemaDigest, readPlatformRuntimeManifest, resolvePlatformRuntime };
201
+ export { PLATFORM_ADMIN_ASSETS_DIRECTORY, PLATFORM_ADMIN_CLIENT_ASSET_PATH, PLATFORM_ADMIN_STYLE_ASSET_PATH, getPlatformRuntimeDirectory, parsePlatformRuntimeManifest, platformDatabaseSchemaDigest, readPlatformRuntimeManifest, resolvePlatformRuntime };
@@ -1 +1 @@
1
- This folder contains the built output assets for the worker "void-runtime-build-api" generated at 2026-09-22T17:31:12.516Z.
1
+ This folder contains the built output assets for the worker "void-runtime-build-api" generated at 2026-09-29T09:50:57.828Z.