@spacefast/common 0.0.13 → 0.0.18

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.
Files changed (154) hide show
  1. package/dist/agents/client-registry.d.ts +22 -0
  2. package/dist/agents/client-registry.js +41 -0
  3. package/dist/agents/connect-targets.d.ts +51 -6
  4. package/dist/agents/connect-targets.js +93 -28
  5. package/dist/brand.d.ts +0 -11
  6. package/dist/brand.js +0 -20
  7. package/dist/config/domains.d.ts +15 -6
  8. package/dist/config/domains.js +24 -10
  9. package/dist/config/postgres-budget.d.ts +3 -0
  10. package/dist/config/postgres-budget.js +6 -1
  11. package/dist/config/postgres-budget.json +2 -1
  12. package/dist/contracts/abuse.js +1 -1
  13. package/dist/contracts/access.d.ts +149 -44
  14. package/dist/contracts/access.js +94 -8
  15. package/dist/contracts/activity.js +5 -1
  16. package/dist/contracts/api-keys.js +9 -9
  17. package/dist/contracts/archives.js +11 -11
  18. package/dist/contracts/beta.js +1 -1
  19. package/dist/contracts/builds.js +14 -14
  20. package/dist/contracts/channels.js +2 -2
  21. package/dist/contracts/comments.d.ts +86 -15
  22. package/dist/contracts/comments.js +116 -20
  23. package/dist/contracts/common.d.ts +12 -12
  24. package/dist/contracts/common.js +33 -30
  25. package/dist/contracts/continuation.js +5 -5
  26. package/dist/contracts/data-source-routes.js +1 -1
  27. package/dist/contracts/device-auth.d.ts +6 -6
  28. package/dist/contracts/device-auth.js +12 -12
  29. package/dist/contracts/docs.d.ts +10 -10
  30. package/dist/contracts/domains.js +39 -33
  31. package/dist/contracts/enums.d.ts +2 -10
  32. package/dist/contracts/enums.js +0 -2
  33. package/dist/contracts/error-code-meta.d.ts +116 -47
  34. package/dist/contracts/error-code-meta.js +37 -16
  35. package/dist/contracts/error-codes.d.ts +7 -4
  36. package/dist/contracts/error-codes.js +46 -21
  37. package/dist/contracts/events.d.ts +10 -3
  38. package/dist/contracts/events.js +33 -5
  39. package/dist/contracts/execution.d.ts +26 -0
  40. package/dist/contracts/execution.js +21 -0
  41. package/dist/contracts/feature-lifecycle.d.ts +21 -24
  42. package/dist/contracts/feature-lifecycle.js +28 -26
  43. package/dist/contracts/features.js +4 -4
  44. package/dist/contracts/functions.d.ts +8 -140
  45. package/dist/contracts/functions.js +9 -19
  46. package/dist/contracts/git.d.ts +1 -1
  47. package/dist/contracts/grants.d.ts +96 -79
  48. package/dist/contracts/grants.js +130 -43
  49. package/dist/contracts/ids.d.ts +2 -2
  50. package/dist/contracts/ids.js +2 -4
  51. package/dist/contracts/internal.js +2 -2
  52. package/dist/contracts/mcp.d.ts +17 -556
  53. package/dist/contracts/mcp.js +9 -103
  54. package/dist/contracts/me.js +3 -4
  55. package/dist/contracts/notifications.d.ts +108 -0
  56. package/dist/contracts/notifications.js +54 -0
  57. package/dist/contracts/oauth-resources.d.ts +18 -1
  58. package/dist/contracts/oauth-resources.js +22 -2
  59. package/dist/contracts/operations.d.ts +2 -50
  60. package/dist/contracts/operations.js +0 -19
  61. package/dist/contracts/pages.d.ts +8 -4
  62. package/dist/contracts/pages.js +16 -3
  63. package/dist/contracts/platform.js +10 -8
  64. package/dist/contracts/problem-document.d.ts +14 -0
  65. package/dist/contracts/problem-document.js +35 -0
  66. package/dist/contracts/push-new.d.ts +21 -6
  67. package/dist/contracts/push-new.js +3 -7
  68. package/dist/contracts/resources.d.ts +8 -7
  69. package/dist/contracts/resources.js +9 -6
  70. package/dist/contracts/runtime-api.d.ts +162 -92
  71. package/dist/contracts/runtime-api.js +99 -27
  72. package/dist/contracts/runtime-app.d.ts +41 -11
  73. package/dist/contracts/runtime-app.js +22 -1
  74. package/dist/contracts/runtime-db.d.ts +424 -0
  75. package/dist/contracts/runtime-db.js +108 -0
  76. package/dist/contracts/runtime-storage.d.ts +120 -0
  77. package/dist/contracts/runtime-storage.js +40 -0
  78. package/dist/contracts/sf-config-v1.d.ts +49 -1
  79. package/dist/contracts/sf-config-v1.js +2 -2
  80. package/dist/contracts/sites.d.ts +1 -0
  81. package/dist/contracts/sites.js +20 -12
  82. package/dist/contracts/space-config.d.ts +62 -22
  83. package/dist/contracts/space-config.js +173 -47
  84. package/dist/contracts/spaces.d.ts +79 -45
  85. package/dist/contracts/spaces.js +66 -50
  86. package/dist/contracts/superadmin-spaces.d.ts +13 -2
  87. package/dist/contracts/superadmin-spaces.js +15 -0
  88. package/dist/contracts/superadmin-tenants.js +4 -4
  89. package/dist/contracts/superadmin.d.ts +4 -0
  90. package/dist/contracts/superadmin.js +14 -1
  91. package/dist/contracts/tags.d.ts +17 -17
  92. package/dist/contracts/tags.js +1 -1
  93. package/dist/contracts/teams.js +25 -16
  94. package/dist/contracts/theme-json.js +1 -1
  95. package/dist/contracts/transfers.js +4 -4
  96. package/dist/contracts/variables.js +3 -3
  97. package/dist/contracts/zero.d.ts +204 -338
  98. package/dist/contracts/zero.js +94 -98
  99. package/dist/dashboard-paths/index.d.ts +16 -1
  100. package/dist/dashboard-paths/index.js +18 -0
  101. package/dist/docs/agent-handoff-document.d.ts +2 -2
  102. package/dist/docs/agent-handoff-document.js +8 -7
  103. package/dist/docs/agent-prose.d.ts +22 -3
  104. package/dist/docs/agent-prose.js +221 -51
  105. package/dist/docs/agent-setup.d.ts +13 -10
  106. package/dist/docs/agent-setup.js +279 -53
  107. package/dist/docs/agent-solutions.d.ts +6 -6
  108. package/dist/docs/agent-solutions.js +23 -21
  109. package/dist/docs/catalog.d.ts +29 -74
  110. package/dist/docs/catalog.js +65 -92
  111. package/dist/docs/error-docs.js +293 -221
  112. package/dist/docs/skill-distribution.d.ts +2 -0
  113. package/dist/docs/skill-distribution.js +7 -4
  114. package/dist/docs/skills.d.ts +546 -0
  115. package/dist/docs/skills.js +340 -0
  116. package/dist/utils/browser-credential.d.ts +19 -0
  117. package/dist/utils/browser-credential.js +62 -0
  118. package/dist/utils/comment-avatars.d.ts +7 -0
  119. package/dist/utils/comment-avatars.js +42 -0
  120. package/dist/utils/content-type.d.ts +3 -3
  121. package/dist/utils/content-type.js +38 -61
  122. package/dist/utils/domain-diagnostics.d.ts +5 -5
  123. package/dist/utils/domain-diagnostics.js +21 -10
  124. package/dist/utils/local-space-state.d.ts +78 -4
  125. package/dist/utils/local-space-state.js +383 -82
  126. package/dist/utils/one-shot-replay.d.ts +14 -0
  127. package/dist/utils/one-shot-replay.js +21 -0
  128. package/dist/utils/page-preview.d.ts +7 -0
  129. package/dist/utils/page-preview.js +9 -0
  130. package/dist/utils/pages.d.ts +2 -11
  131. package/dist/utils/pages.js +58 -14
  132. package/dist/utils/publish-form-data.d.ts +22 -0
  133. package/dist/utils/publish-form-data.js +26 -0
  134. package/dist/utils/publish-policy.js +20 -4
  135. package/dist/utils/query-keys.d.ts +7 -4
  136. package/dist/utils/query-keys.js +13 -4
  137. package/dist/utils/runtime-paths.d.ts +3 -0
  138. package/dist/utils/runtime-paths.js +7 -0
  139. package/dist/utils/secure-local-file.d.ts +73 -0
  140. package/dist/utils/secure-local-file.js +1373 -0
  141. package/dist/utils/space-config.d.ts +13 -4
  142. package/dist/utils/space-config.js +123 -15
  143. package/dist/utils/storage-policy.d.ts +20 -0
  144. package/dist/utils/storage-policy.fixtures.json +174 -0
  145. package/dist/utils/storage-policy.js +193 -0
  146. package/dist/utils/upload-session.d.ts +12 -1
  147. package/dist/utils/upload-session.js +37 -2
  148. package/dist/utils/version-file-browser.d.ts +13 -0
  149. package/dist/utils/version-file-browser.js +59 -0
  150. package/package.json +19 -1
  151. package/dist/contracts/mounts.d.ts +0 -142
  152. package/dist/contracts/mounts.js +0 -56
  153. package/dist/utils/asset-fingerprint.d.ts +0 -64
  154. package/dist/utils/asset-fingerprint.js +0 -620
@@ -1,26 +1,33 @@
1
1
  // The single error-code table (internal-docs/platform.md "Global API Conventions").
2
- // Every error envelope `code` the control plane emits is a member of this table, and
3
- // `docsUrl` is derived mechanically from the code (`https://spacefast.com/docs/errors/{code}`).
2
+ // Every problem document `code` the control plane emits is a member of this table, and
3
+ // the problem `type` is derived mechanically from the code
4
+ // (`https://spacefast.com/docs/errors/{code}`).
4
5
  // The conformance suite asserts the derivation rule so links never rot, and error docs
5
6
  // pages are generated from this enum. Control-plane error constructors are typed against
6
7
  // `ErrorCode`, so emitting a code that is not in the table is a typecheck (CI) failure;
7
8
  // the remaining untyped string paths (low-level serializer, superadmin Better Auth
8
- // passthrough) fold into the typed envelope in the F2 envelope chunk.
9
+ // passthrough) fold into the typed problem document in the F2 envelope chunk.
9
10
  // A code's meaning stays stable while it can be emitted. Retiring an API surface removes
10
11
  // its dead codes and generated references together. Diagnostic codes share this table so
11
12
  // every current diagnostic also carries a resolvable docs link.
12
- import { ERROR_DOCS_BASE_URL } from "../brand.js";
13
- export { ERROR_DOCS_BASE_URL };
14
- /** `docsUrl` derivation rule: docs origin + `/{code}`. Asserted by the conformance suite. */
13
+ import { DOCS_BASE_URL } from "../config/domains.js";
14
+ export const ERROR_DOCS_BASE_URL = `${DOCS_BASE_URL}/errors`;
15
+ /** Media type of every 4xx/5xx response body (RFC 9457 problem details). */
16
+ export const PROBLEM_CONTENT_TYPE = "application/problem+json";
17
+ /** Problem `type` URI derivation rule: docs origin + `/{code}`. Asserted by the conformance suite. */
15
18
  export function errorDocsUrl(code) {
16
19
  return `${ERROR_DOCS_BASE_URL}/${code}`;
17
20
  }
21
+ /** Problem `title` derivation rule: the snake_case code as a sentence ("version_not_found" → "Version not found"). */
22
+ export function errorTitle(code) {
23
+ const words = code.replaceAll("_", " ");
24
+ return words.charAt(0).toUpperCase() + words.slice(1);
25
+ }
18
26
  export const ERROR_CODES = [
19
27
  "abuse_report_invalid_transition",
20
28
  "abuse_report_rate_limited",
21
29
  "abuse_takedown",
22
30
  "access_denied",
23
- "access_scope_suggestion",
24
31
  "account_suspended",
25
32
  "agent_handoff_declined",
26
33
  "agent_handoff_limit_reached",
@@ -60,8 +67,12 @@ export const ERROR_CODES = [
60
67
  "cli_upgrade_required",
61
68
  "comment_screenshot_rate_limited",
62
69
  "config_file_too_large",
70
+ "config_functions_key_removed",
63
71
  "config_invalid",
64
72
  "config_meta_too_long",
73
+ "config_name_too_long",
74
+ "config_runtime_entry_missing",
75
+ "config_runtime_invalid_kind",
65
76
  "config_templates_over_limit",
66
77
  "continuation_unavailable",
67
78
  "continuation_used",
@@ -73,6 +84,7 @@ export const ERROR_CODES = [
73
84
  "csam_policy_floor",
74
85
  "custom_certificates_require_dedicated_site",
75
86
  "data_location_immutable",
87
+ "db_not_available",
76
88
  "device_authorization_failed",
77
89
  "device_verification_rate_limited",
78
90
  "dns_export_required",
@@ -189,10 +201,11 @@ export const ERROR_CODES = [
189
201
  "manifest_body_too_large",
190
202
  "manifest_duplicate_path",
191
203
  "manifest_too_many_files",
192
- "mcp_acted_for_team_deleted",
193
204
  "member_already_exists",
205
+ "method_not_allowed",
194
206
  "missing_route_param",
195
207
  "move_target_capacity_lost",
208
+ "name_managed_by_config",
196
209
  "nameserver_delegation_required",
197
210
  "nameserver_divergence",
198
211
  "noop_publish",
@@ -228,7 +241,6 @@ export const ERROR_CODES = [
228
241
  "publish_not_cancelable",
229
242
  "publish_path_collision",
230
243
  "publish_path_invalid",
231
- "publish_reference_missing",
232
244
  "publish_setup_failed",
233
245
  "publish_snapshot_empty",
234
246
  "publish_upload_failed",
@@ -237,16 +249,19 @@ export const ERROR_CODES = [
237
249
  "rate_limited",
238
250
  "registration_expired",
239
251
  "registration_expiring",
252
+ "resource_revision_changed",
240
253
  "routing_rules_over_plan",
241
254
  "runtime_action_forbidden",
242
255
  "runtime_api_not_found",
243
256
  "runtime_callback_forbidden",
257
+ "runtime_dev_unsupported",
244
258
  "runtime_engine_zip_missing",
245
259
  "runtime_hostname_unassigned",
246
260
  "runtime_instance_mismatch",
247
261
  "runtime_jti_missing",
248
262
  "runtime_jti_replayed",
249
263
  "runtime_jwks_key_missing",
264
+ "runtime_kind_mismatch",
250
265
  "runtime_management_unavailable",
251
266
  "runtime_not_provisioned",
252
267
  "runtime_operation_missing",
@@ -259,6 +274,7 @@ export const ERROR_CODES = [
259
274
  "runtime_upload_required",
260
275
  "scan_pending",
261
276
  "secret_variable_in_template",
277
+ "service_booting",
262
278
  "service_signature_invalid",
263
279
  "site_already_deleted",
264
280
  "site_has_live_spaces",
@@ -290,23 +306,29 @@ export const ERROR_CODES = [
290
306
  "space_no_live_version",
291
307
  "space_not_disabled",
292
308
  "space_not_restorable",
309
+ "space_person_already_member",
310
+ "space_person_invitation_pending",
311
+ "space_person_self_invite",
293
312
  "space_ref_ambiguous",
294
313
  "space_ref_required",
295
314
  "space_transferring",
296
315
  "space_unclaimed",
297
316
  "ssl_renewal_blocked",
298
317
  "static_control_file_not_supported",
299
- "static_mount_path_conflict",
300
- "static_mount_source_not_ready",
301
- "static_mount_target_forbidden",
302
- "static_mount_target_in_use",
303
- "static_mount_target_not_live",
304
- "static_mount_target_not_ready",
305
- "static_mount_target_not_static",
306
318
  "static_runtime_control_path_not_supported",
307
319
  "static_runtime_required",
320
+ "storage_auth_required",
308
321
  "storage_bucket_unavailable",
322
+ "storage_content_blocked",
323
+ "storage_delete_forbidden",
324
+ "storage_empty_file",
325
+ "storage_file_too_large",
326
+ "storage_key_invalid",
327
+ "storage_object_not_found",
328
+ "storage_quota_already_unlimited",
329
+ "storage_quota_decrease_not_supported",
309
330
  "storage_quota_exceeded",
331
+ "storage_unavailable",
310
332
  "storage_usage_unavailable",
311
333
  "stripe_error",
312
334
  "superseded_by_publish",
@@ -395,6 +417,12 @@ export const ERROR_CODES = [
395
417
  "zero_client_bundle_not_loaded",
396
418
  "zero_db_connect_failed",
397
419
  "zero_db_execute_failed",
420
+ "zero_db_export_cursor_invalid",
421
+ "zero_db_export_failed",
422
+ "zero_db_export_page_too_large",
423
+ "zero_db_export_query_invalid",
424
+ "zero_db_export_schema_changed",
425
+ "zero_db_export_schema_unavailable",
398
426
  "zero_db_host_install_failed",
399
427
  "zero_db_operation_invalid",
400
428
  "zero_db_operation_too_large",
@@ -402,6 +430,8 @@ export const ERROR_CODES = [
402
430
  "zero_db_query_failed",
403
431
  "zero_db_row_invalid",
404
432
  "zero_db_sql_invalid",
433
+ "zero_db_target_denied",
434
+ "zero_db_tls_required",
405
435
  "zero_db_too_many_params",
406
436
  "zero_db_transaction_active",
407
437
  "zero_db_transaction_commit_failed",
@@ -471,11 +501,6 @@ export const ERROR_CODES = [
471
501
  "zero_runs_require_runtime_compiler",
472
502
  "zero_runs_too_many",
473
503
  "zero_shopify_unavailable",
474
- "zero_source_compile_failed",
475
- "zero_source_hash_mismatch",
476
- "zero_source_invalid",
477
- "zero_source_path_invalid",
478
- "zero_source_unreadable",
479
504
  ];
480
505
  const ERROR_CODE_SET = new Set(ERROR_CODES);
481
506
  export function isErrorCode(value) {
@@ -51,11 +51,18 @@ export declare const EVENT_CATALOG: {
51
51
  }, z.core.$strict>;
52
52
  };
53
53
  "client.error.observed": {
54
- sources: ("www" | "dashboard" | "cli" | "other")[];
55
- actors: ("analytics_id" | "anonymous_id" | "anonymous_machine")[];
54
+ sources: ("www" | "dashboard")[];
55
+ actors: ("analytics_id" | "anonymous_id")[];
56
56
  properties: z.ZodObject<{
57
+ kind: z.ZodEnum<{
58
+ uncaught_exception: "uncaught_exception";
59
+ unhandled_rejection: "unhandled_rejection";
60
+ }>;
57
61
  error_class: z.ZodString;
58
- path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
+ message: z.ZodNullable<z.ZodString>;
63
+ frames: z.ZodNullable<z.ZodString>;
64
+ fingerprint: z.ZodString;
65
+ path: z.ZodString;
59
66
  }, z.core.$strict>;
60
67
  };
61
68
  "cli.command.completed": {
@@ -9,7 +9,7 @@ const occurredAtSchema = z
9
9
  .string()
10
10
  .datetime()
11
11
  .optional()
12
- .describe("Client-side event time; the server receive time is authoritative when omitted.");
12
+ .describe("Client-side event time; server receipt time is authoritative when omitted.");
13
13
  const pathSchema = z
14
14
  .string()
15
15
  .min(1)
@@ -68,10 +68,38 @@ const webVitalPropertiesSchema = z
68
68
  path: pathSchema,
69
69
  })
70
70
  .strict();
71
+ // An uncaught browser error is not a single label — `error.name` is "Error" for
72
+ // almost every application throw, so a one-field shape both fails to attribute
73
+ // and (because it feeds the sender's dedupe key) suppresses genuinely distinct
74
+ // errors. Model the fingerprint instead: signal kind, thrown-value class,
75
+ // redacted message, top frames, and a deterministic grouping key. Every string
76
+ // stays within `propertyValueSchema`'s 512-char cap — the generic property bag
77
+ // validates alongside this schema, so a longer field would 400 at ingest.
71
78
  const clientErrorPropertiesSchema = z
72
79
  .object({
73
- error_class: z.string().min(1).max(128),
74
- path: pathSchema.nullable().optional(),
80
+ kind: z
81
+ .enum(["uncaught_exception", "unhandled_rejection"])
82
+ .describe("Which browser signal produced this — orthogonal to what was thrown."),
83
+ error_class: z
84
+ .string()
85
+ .min(1)
86
+ .max(128)
87
+ .describe("Constructor name, or `NonError:<typeof>` when a non-Error was thrown."),
88
+ message: z
89
+ .string()
90
+ .max(512)
91
+ .nullable()
92
+ .describe("Redacted, truncated message; null when the thrown value carries none."),
93
+ frames: z
94
+ .string()
95
+ .max(512)
96
+ .nullable()
97
+ .describe("Top stack frames, newest first, origin-relative, ' | '-joined."),
98
+ fingerprint: z
99
+ .string()
100
+ .regex(/^[0-9a-z]{1,16}$/)
101
+ .describe("Deterministic dedupe/group key over kind, class, normalized message, top frame."),
102
+ path: pathSchema,
75
103
  })
76
104
  .strict();
77
105
  const cliCommandPropertiesSchema = z
@@ -184,8 +212,8 @@ export const EVENT_CATALOG = {
184
212
  properties: webVitalPropertiesSchema,
185
213
  },
186
214
  "client.error.observed": {
187
- sources: ["dashboard", "www", "cli", "other"],
188
- actors: ["analytics_id", "anonymous_id", "anonymous_machine"],
215
+ sources: ["dashboard", "www"],
216
+ actors: ["analytics_id", "anonymous_id"],
189
217
  properties: clientErrorPropertiesSchema,
190
218
  },
191
219
  "cli.command.completed": {
@@ -30,10 +30,36 @@ export declare const runtimeKindSchema: z.ZodEnum<{
30
30
  static: "static";
31
31
  }>;
32
32
  export type RuntimeKind = z.infer<typeof runtimeKindSchema>;
33
+ /**
34
+ * How a live runtime delivers realtime invalidations.
35
+ *
36
+ * One vocabulary end to end: the finalize payload, the client config a serving
37
+ * runtime hands the browser, and every API response all name the transport
38
+ * with these three values. `central` is the hosted relay, `cast` is the
39
+ * collaboration service, and `local` is a dev machine serving its own socket —
40
+ * a distinction a customer can act on, unlike the component names the transports
41
+ * used to be called after.
42
+ */
43
+ export declare const RUNTIME_REALTIME_MODES: readonly ["central", "cast", "local"];
44
+ export declare const runtimeRealtimeModeSchema: z.ZodEnum<{
45
+ local: "local";
46
+ cast: "cast";
47
+ central: "central";
48
+ }>;
49
+ export type RuntimeRealtimeMode = z.infer<typeof runtimeRealtimeModeSchema>;
33
50
  export declare const EXECUTION_ENV_MAX_KEYS = 64;
34
51
  export declare const EXECUTION_ENV_NAME_MAX_BYTES = 128;
35
52
  export declare const EXECUTION_ENV_VALUE_MAX_BYTES: number;
36
53
  export declare const EXECUTION_ENV_TOTAL_VALUE_MAX_BYTES: number;
54
+ /**
55
+ * Server-only variables for whichever runtime this version declares. Publish
56
+ * syncs the file into the space's variables as secrets; the shared publish
57
+ * denylist (`.env.*`) keeps the file itself out of every artifact, so the
58
+ * values reach the runtime through variables and never through content.
59
+ */
60
+ export declare const SERVER_ENV_FILE = ".env.server";
61
+ /** Lakebed's documented server-only env filename, accepted for capsule portability. */
62
+ export declare const LAKEBED_SERVER_ENV_FILE = ".env.lakebed.server";
37
63
  /**
38
64
  * Names the platform reserves for itself in the tenant environment. Tenant
39
65
  * code cannot set these, so it cannot spoof the values the broker trusts.
@@ -25,10 +25,31 @@ import { z } from "zod";
25
25
  * name a product.
26
26
  */
27
27
  export const runtimeKindSchema = z.enum(["static", "zero", "functions"]);
28
+ /**
29
+ * How a live runtime delivers realtime invalidations.
30
+ *
31
+ * One vocabulary end to end: the finalize payload, the client config a serving
32
+ * runtime hands the browser, and every API response all name the transport
33
+ * with these three values. `central` is the hosted relay, `cast` is the
34
+ * collaboration service, and `local` is a dev machine serving its own socket —
35
+ * a distinction a customer can act on, unlike the component names the transports
36
+ * used to be called after.
37
+ */
38
+ export const RUNTIME_REALTIME_MODES = ["central", "cast", "local"];
39
+ export const runtimeRealtimeModeSchema = z.enum(RUNTIME_REALTIME_MODES);
28
40
  export const EXECUTION_ENV_MAX_KEYS = 64;
29
41
  export const EXECUTION_ENV_NAME_MAX_BYTES = 128;
30
42
  export const EXECUTION_ENV_VALUE_MAX_BYTES = 16 * 1024;
31
43
  export const EXECUTION_ENV_TOTAL_VALUE_MAX_BYTES = 64 * 1024;
44
+ /**
45
+ * Server-only variables for whichever runtime this version declares. Publish
46
+ * syncs the file into the space's variables as secrets; the shared publish
47
+ * denylist (`.env.*`) keeps the file itself out of every artifact, so the
48
+ * values reach the runtime through variables and never through content.
49
+ */
50
+ export const SERVER_ENV_FILE = ".env.server";
51
+ /** Lakebed's documented server-only env filename, accepted for capsule portability. */
52
+ export const LAKEBED_SERVER_ENV_FILE = ".env.lakebed.server";
32
53
  /**
33
54
  * Names the platform reserves for itself in the tenant environment. Tenant
34
55
  * code cannot set these, so it cannot spoof the values the broker trusts.
@@ -247,7 +247,7 @@ declare const featureEntries: readonly [{
247
247
  readonly assignmentScopes: readonly ["team", "global"];
248
248
  readonly docs: {
249
249
  readonly channel: "public";
250
- readonly slug: "/docs/domains/proxy-bindings";
250
+ readonly slug: "/docs/spaces/proxy-routes";
251
251
  readonly feedbackUrl: null;
252
252
  };
253
253
  readonly owner: "team:domains";
@@ -301,9 +301,9 @@ declare const featureEntries: readonly [{
301
301
  readonly key: "sites.dedicated_runtime";
302
302
  readonly name: "Dedicated runtime sites";
303
303
  readonly description: "Allows teams to create dedicated WP.Cloud sites and place team spaces on them.";
304
- readonly stage: "internal";
304
+ readonly stage: "ga";
305
305
  readonly surface: true;
306
- readonly defaultEnabled: false;
306
+ readonly defaultEnabled: true;
307
307
  readonly runtime: {
308
308
  readonly enabledInDevelopment: true;
309
309
  readonly enabledForA8c: true;
@@ -311,16 +311,16 @@ declare const featureEntries: readonly [{
311
311
  };
312
312
  readonly assignmentScopes: readonly ["team", "global"];
313
313
  readonly docs: {
314
- readonly channel: "handbook";
315
- readonly slug: "/features/sites/dedicated-runtime";
314
+ readonly channel: "public";
315
+ readonly slug: "/docs/apps";
316
316
  readonly feedbackUrl: null;
317
317
  };
318
318
  readonly owner: "team:runtime";
319
319
  readonly requires: readonly [];
320
320
  readonly lifecycleAdoptedAt: "2026-07-12";
321
- readonly reviewAfter: "2026-08-11";
322
- readonly removeAfter: "2026-10-10";
323
- readonly gaAt: null;
321
+ readonly reviewAfter: null;
322
+ readonly removeAfter: "2026-11-01";
323
+ readonly gaAt: "2026-08-05";
324
324
  readonly allowedActorPolicies: readonly ["request_actor", "resource_team"];
325
325
  readonly downRamp: {
326
326
  readonly code: "dedicated_runtime_stop";
@@ -397,28 +397,25 @@ declare const featureEntries: readonly [{
397
397
  readonly key: "zero";
398
398
  readonly name: "Spacefast Zero";
399
399
  readonly description: "Enables Spacefast Zero command surfaces and hosted Zero app workflows.";
400
- readonly stage: "internal";
400
+ readonly stage: "ga";
401
401
  readonly surface: true;
402
- readonly defaultEnabled: false;
402
+ readonly defaultEnabled: true;
403
403
  readonly runtime: {
404
404
  readonly enabledForA8c: true;
405
- readonly planDefaults: {
406
- readonly enterprise: true;
407
- readonly internal: true;
408
- };
405
+ readonly planDefaults: {};
409
406
  };
410
407
  readonly assignmentScopes: readonly ["team", "global"];
411
408
  readonly docs: {
412
- readonly channel: "handbook";
413
- readonly slug: "/features/zero";
409
+ readonly channel: "public";
410
+ readonly slug: "/docs/apps/zero";
414
411
  readonly feedbackUrl: null;
415
412
  };
416
413
  readonly owner: "team:zero";
417
414
  readonly requires: readonly ["sites.dedicated_runtime"];
418
415
  readonly lifecycleAdoptedAt: "2026-07-12";
419
- readonly reviewAfter: "2026-08-11";
420
- readonly removeAfter: "2026-10-10";
421
- readonly gaAt: null;
416
+ readonly reviewAfter: null;
417
+ readonly removeAfter: "2026-11-01";
418
+ readonly gaAt: "2026-08-05";
422
419
  readonly allowedActorPolicies: readonly ["resource_team"];
423
420
  readonly downRamp: {
424
421
  readonly code: "zero_stop";
@@ -429,7 +426,7 @@ declare const featureEntries: readonly [{
429
426
  readonly key: "functions";
430
427
  readonly name: "Spacefast Functions";
431
428
  readonly description: string;
432
- readonly stage: "internal";
429
+ readonly stage: "private_beta";
433
430
  readonly surface: true;
434
431
  readonly defaultEnabled: false;
435
432
  readonly runtime: {
@@ -438,15 +435,15 @@ declare const featureEntries: readonly [{
438
435
  };
439
436
  readonly assignmentScopes: readonly ["team", "global"];
440
437
  readonly docs: {
441
- readonly channel: "handbook";
442
- readonly slug: "/features/functions";
438
+ readonly channel: "public";
439
+ readonly slug: "/docs/apps/functions";
443
440
  readonly feedbackUrl: null;
444
441
  };
445
442
  readonly owner: "team:zero";
446
443
  readonly requires: readonly [];
447
444
  readonly lifecycleAdoptedAt: "2026-07-27";
448
- readonly reviewAfter: "2026-08-26";
449
- readonly removeAfter: "2026-10-25";
445
+ readonly reviewAfter: "2026-09-02";
446
+ readonly removeAfter: "2026-11-01";
450
447
  readonly gaAt: null;
451
448
  readonly allowedActorPolicies: readonly ["resource_team"];
452
449
  readonly downRamp: {
@@ -244,7 +244,7 @@ const featureEntries = Object.freeze([
244
244
  assignmentScopes: ["team", "global"],
245
245
  docs: {
246
246
  channel: "public",
247
- slug: "/docs/domains/proxy-bindings",
247
+ slug: "/docs/spaces/proxy-routes",
248
248
  feedbackUrl: null,
249
249
  },
250
250
  owner: "team:domains",
@@ -301,9 +301,12 @@ const featureEntries = Object.freeze([
301
301
  key: "sites.dedicated_runtime",
302
302
  name: "Dedicated runtime sites",
303
303
  description: "Allows teams to create dedicated WP.Cloud sites and place team spaces on them.",
304
- stage: "internal",
304
+ // Availability and billing are separate decisions: the public surface is
305
+ // on, while the dedicatedRuntime entitlement still decides which teams may
306
+ // allocate the isolated infrastructure it exposes.
307
+ stage: "ga",
305
308
  surface: true,
306
- defaultEnabled: false,
309
+ defaultEnabled: true,
307
310
  runtime: {
308
311
  enabledInDevelopment: true,
309
312
  enabledForA8c: true,
@@ -311,16 +314,16 @@ const featureEntries = Object.freeze([
311
314
  },
312
315
  assignmentScopes: ["team", "global"],
313
316
  docs: {
314
- channel: "handbook",
315
- slug: "/features/sites/dedicated-runtime",
317
+ channel: "public",
318
+ slug: "/docs/apps",
316
319
  feedbackUrl: null,
317
320
  },
318
321
  owner: "team:runtime",
319
322
  requires: [],
320
323
  lifecycleAdoptedAt: "2026-07-12",
321
- reviewAfter: "2026-08-11",
322
- removeAfter: "2026-10-10",
323
- gaAt: null,
324
+ reviewAfter: null,
325
+ removeAfter: "2026-11-01",
326
+ gaAt: "2026-08-05",
324
327
  allowedActorPolicies: ["request_actor", "resource_team"],
325
328
  downRamp: {
326
329
  code: "dedicated_runtime_stop",
@@ -401,30 +404,27 @@ const featureEntries = Object.freeze([
401
404
  key: "zero",
402
405
  name: "Spacefast Zero",
403
406
  description: "Enables Spacefast Zero command surfaces and hosted Zero app workflows.",
404
- stage: "internal",
407
+ // Zero is public. The flag remains only as the canonical operational
408
+ // down-ramp; dedicatedRuntime is the one customer eligibility decision.
409
+ stage: "ga",
405
410
  surface: true,
406
- defaultEnabled: false,
411
+ defaultEnabled: true,
407
412
  runtime: {
408
413
  enabledForA8c: true,
409
- // Zero capsules can only run on a dedicated site, so the plans that grant
410
- // `dedicatedRuntime` ARE the ones allowed to use it. Leaving these false
411
- // made the entitlement and the flag two independent switches for one
412
- // decision, and a team that paid for dedicated runtime still got
413
- // `zero_requires_dedicated_plan` at finalize.
414
- planDefaults: { enterprise: true, internal: true },
414
+ planDefaults: {},
415
415
  },
416
416
  assignmentScopes: ["team", "global"],
417
417
  docs: {
418
- channel: "handbook",
419
- slug: "/features/zero",
418
+ channel: "public",
419
+ slug: "/docs/apps/zero",
420
420
  feedbackUrl: null,
421
421
  },
422
422
  owner: "team:zero",
423
423
  requires: ["sites.dedicated_runtime"],
424
424
  lifecycleAdoptedAt: "2026-07-12",
425
- reviewAfter: "2026-08-11",
426
- removeAfter: "2026-10-10",
427
- gaAt: null,
425
+ reviewAfter: null,
426
+ removeAfter: "2026-11-01",
427
+ gaAt: "2026-08-05",
428
428
  allowedActorPolicies: ["resource_team"],
429
429
  downRamp: {
430
430
  code: "zero_stop",
@@ -437,7 +437,9 @@ const featureEntries = Object.freeze([
437
437
  name: "Spacefast Functions",
438
438
  description: "Dispatches a version's dynamic requests to the execution host. Compiling the worker at publish is not gated: " +
439
439
  "the CLI always ships the bundle, and this flag decides whether anything runs it.",
440
- stage: "internal",
440
+ // Functions remains a private beta: public docs carry the badge and this
441
+ // flag still decides who dispatches.
442
+ stage: "private_beta",
441
443
  surface: true,
442
444
  defaultEnabled: false,
443
445
  runtime: {
@@ -446,8 +448,8 @@ const featureEntries = Object.freeze([
446
448
  },
447
449
  assignmentScopes: ["team", "global"],
448
450
  docs: {
449
- channel: "handbook",
450
- slug: "/features/functions",
451
+ channel: "public",
452
+ slug: "/docs/apps/functions",
451
453
  feedbackUrl: null,
452
454
  },
453
455
  owner: "team:zero",
@@ -457,8 +459,8 @@ const featureEntries = Object.freeze([
457
459
  // way it is not for a capsule.
458
460
  requires: [],
459
461
  lifecycleAdoptedAt: "2026-07-27",
460
- reviewAfter: "2026-08-26",
461
- removeAfter: "2026-10-25",
462
+ reviewAfter: "2026-09-02",
463
+ removeAfter: "2026-11-01",
462
464
  gaAt: null,
463
465
  allowedActorPolicies: ["resource_team"],
464
466
  downRamp: {
@@ -13,7 +13,7 @@ export const FEATURE_OVERRIDE_STATES = ["enabled", "disabled", "kill_switch"];
13
13
  export const featureOverrideStateSchema = z.enum(FEATURE_OVERRIDE_STATES);
14
14
  export const planLimitValueSchema = z
15
15
  .union([z.number().int().nonnegative(), z.literal("unlimited")])
16
- .describe('Plan limit value; "unlimited" when the plan does not bound this axis.');
16
+ .describe('Plan limit value; "unlimited" when the plan does not limit this axis.');
17
17
  // Named plan limit table (internal-docs/platform.md "Plans And Limits",
18
18
  // Free/Personal/Work columns verbatim). Keys mirror `PlanPolicyResponse.limits`
19
19
  // so plan policy is a projection of this data, never a re-derivation.
@@ -234,7 +234,7 @@ export const PLAN_DEFINITIONS = {
234
234
  export const FEATURE_DEFINITIONS = FEATURE_RUNTIME_DEFINITIONS;
235
235
  export const featureStateSourceSchema = z
236
236
  .enum(["kill_switch", "env", "override", "default"])
237
- .describe("Layer that decided the flag: kill_switch (emergency off), env (SPACEFAST_FLAG_* variable), " +
237
+ .describe("Layer that decides the flag: kill_switch (emergency off), env (SPACEFAST_FLAG_* variable), " +
238
238
  "override (feature_overrides row), default (plan/code default).");
239
239
  export const FeatureStateSchema = z.object({
240
240
  key: featureKeySchema,
@@ -242,10 +242,10 @@ export const FeatureStateSchema = z.object({
242
242
  source: featureStateSourceSchema,
243
243
  });
244
244
  export const FeatureStateResponseSchema = z.object({
245
- planCode: planCodeSchema.describe("Plan the flags were evaluated against."),
245
+ planCode: planCodeSchema.describe("Plan used to evaluate the flags."),
246
246
  features: z
247
247
  .record(featureKeySchema, FeatureStateSchema)
248
- .describe("Evaluated state for every known feature flag."),
248
+ .describe("Evaluated state of every known feature flag."),
249
249
  });
250
250
  export function normalizePlanCode(planCode) {
251
251
  if (!planCode) {