@spacefast/common 0.0.12 → 0.0.17

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 (189) 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 +486 -1196
  14. package/dist/contracts/access.js +323 -1054
  15. package/dist/contracts/activity.d.ts +1 -1
  16. package/dist/contracts/activity.js +11 -15
  17. package/dist/contracts/api-keys.d.ts +16 -0
  18. package/dist/contracts/api-keys.js +11 -9
  19. package/dist/contracts/archives.d.ts +1 -2
  20. package/dist/contracts/archives.js +15 -17
  21. package/dist/contracts/beta.js +1 -1
  22. package/dist/contracts/builds.js +14 -14
  23. package/dist/contracts/channels.js +2 -2
  24. package/dist/contracts/comments.d.ts +143 -99
  25. package/dist/contracts/comments.js +194 -79
  26. package/dist/contracts/common.d.ts +12 -12
  27. package/dist/contracts/common.js +33 -30
  28. package/dist/contracts/continuation.js +5 -5
  29. package/dist/contracts/countries.js +2 -7
  30. package/dist/contracts/data-source-routes.d.ts +20 -0
  31. package/dist/contracts/data-source-routes.js +15 -0
  32. package/dist/contracts/device-auth.d.ts +13 -9
  33. package/dist/contracts/device-auth.js +12 -12
  34. package/dist/contracts/docs.d.ts +10 -10
  35. package/dist/contracts/domains.js +39 -33
  36. package/dist/contracts/enums.d.ts +4 -14
  37. package/dist/contracts/enums.js +3 -10
  38. package/dist/contracts/error-code-meta.d.ts +122 -56
  39. package/dist/contracts/error-code-meta.js +43 -19
  40. package/dist/contracts/error-codes.d.ts +7 -4
  41. package/dist/contracts/error-codes.js +48 -24
  42. package/dist/contracts/events.d.ts +22 -15
  43. package/dist/contracts/events.js +33 -5
  44. package/dist/contracts/execution.d.ts +238 -0
  45. package/dist/contracts/execution.js +309 -0
  46. package/dist/contracts/feature-lifecycle.d.ts +39 -188
  47. package/dist/contracts/feature-lifecycle.js +52 -196
  48. package/dist/contracts/features.d.ts +13 -115
  49. package/dist/contracts/features.js +5 -35
  50. package/dist/contracts/functions.d.ts +597 -0
  51. package/dist/contracts/functions.js +475 -0
  52. package/dist/contracts/grants.d.ts +1175 -0
  53. package/dist/contracts/grants.js +783 -0
  54. package/dist/contracts/ids.d.ts +7 -5
  55. package/dist/contracts/ids.js +7 -7
  56. package/dist/contracts/internal.js +2 -2
  57. package/dist/contracts/mcp.d.ts +17 -556
  58. package/dist/contracts/mcp.js +9 -103
  59. package/dist/contracts/me.js +3 -4
  60. package/dist/contracts/notifications.d.ts +108 -0
  61. package/dist/contracts/notifications.js +54 -0
  62. package/dist/contracts/oauth-resources.d.ts +22 -5
  63. package/dist/contracts/oauth-resources.js +23 -2
  64. package/dist/contracts/operations.d.ts +0 -48
  65. package/dist/contracts/operations.js +0 -19
  66. package/dist/contracts/pages.d.ts +10 -14
  67. package/dist/contracts/pages.js +17 -21
  68. package/dist/contracts/plan-policy.d.ts +1 -8
  69. package/dist/contracts/plan-policy.js +1 -4
  70. package/dist/contracts/platform.d.ts +78 -30
  71. package/dist/contracts/platform.js +69 -20
  72. package/dist/contracts/problem-document.d.ts +14 -0
  73. package/dist/contracts/problem-document.js +35 -0
  74. package/dist/contracts/push-new.d.ts +41 -2
  75. package/dist/contracts/push-new.js +4 -0
  76. package/dist/contracts/quotas.d.ts +0 -1
  77. package/dist/contracts/quotas.js +0 -5
  78. package/dist/contracts/repository-connections.d.ts +1 -1
  79. package/dist/contracts/resources.d.ts +16 -71
  80. package/dist/contracts/resources.js +13 -16
  81. package/dist/contracts/runtime-api.d.ts +666 -303
  82. package/dist/contracts/runtime-api.js +272 -113
  83. package/dist/contracts/runtime-app.d.ts +168 -0
  84. package/dist/contracts/runtime-app.js +42 -0
  85. package/dist/contracts/runtime-db.d.ts +424 -0
  86. package/dist/contracts/runtime-db.js +108 -0
  87. package/dist/contracts/runtime-storage.d.ts +120 -0
  88. package/dist/contracts/runtime-storage.js +40 -0
  89. package/dist/contracts/sf-config-v1.d.ts +54 -1
  90. package/dist/contracts/sf-config-v1.js +2 -2
  91. package/dist/contracts/sites.d.ts +6 -0
  92. package/dist/contracts/sites.js +30 -11
  93. package/dist/contracts/space-config.d.ts +91 -121
  94. package/dist/contracts/space-config.js +464 -42
  95. package/dist/contracts/spaces.d.ts +300 -171
  96. package/dist/contracts/spaces.js +128 -98
  97. package/dist/contracts/superadmin-emails.d.ts +2 -2
  98. package/dist/contracts/superadmin-spaces.d.ts +26 -130
  99. package/dist/contracts/superadmin-spaces.js +22 -0
  100. package/dist/contracts/superadmin-tenants.js +4 -4
  101. package/dist/contracts/superadmin.d.ts +4 -0
  102. package/dist/contracts/superadmin.js +14 -1
  103. package/dist/contracts/tags.d.ts +6 -6
  104. package/dist/contracts/tags.js +1 -1
  105. package/dist/contracts/teams.d.ts +9 -9
  106. package/dist/contracts/teams.js +25 -16
  107. package/dist/contracts/theme-json.js +1 -1
  108. package/dist/contracts/transfers.d.ts +0 -1
  109. package/dist/contracts/transfers.js +4 -4
  110. package/dist/contracts/variables.js +3 -3
  111. package/dist/contracts/zero.d.ts +384 -596
  112. package/dist/contracts/zero.js +167 -299
  113. package/dist/dashboard-paths/index.d.ts +18 -3
  114. package/dist/dashboard-paths/index.js +19 -0
  115. package/dist/docs/agent-handoff-document.d.ts +2 -2
  116. package/dist/docs/agent-handoff-document.js +8 -7
  117. package/dist/docs/agent-prose.d.ts +22 -3
  118. package/dist/docs/agent-prose.js +227 -55
  119. package/dist/docs/agent-setup.d.ts +14 -11
  120. package/dist/docs/agent-setup.js +289 -61
  121. package/dist/docs/agent-solutions.d.ts +6 -6
  122. package/dist/docs/agent-solutions.js +24 -22
  123. package/dist/docs/catalog.d.ts +53 -98
  124. package/dist/docs/catalog.js +90 -117
  125. package/dist/docs/error-docs.js +304 -236
  126. package/dist/docs/skill-distribution.d.ts +2 -0
  127. package/dist/docs/skill-distribution.js +7 -4
  128. package/dist/docs/skills.d.ts +546 -0
  129. package/dist/docs/skills.js +340 -0
  130. package/dist/utils/auth-redirect.d.ts +1 -3
  131. package/dist/utils/auth-redirect.js +1 -21
  132. package/dist/utils/browser-credential.d.ts +19 -0
  133. package/dist/utils/browser-credential.js +62 -0
  134. package/dist/utils/build-settings.d.ts +2 -0
  135. package/dist/utils/build-settings.js +61 -9
  136. package/dist/utils/comment-avatars.d.ts +7 -0
  137. package/dist/utils/comment-avatars.js +42 -0
  138. package/dist/utils/content-type.d.ts +3 -3
  139. package/dist/utils/content-type.js +38 -61
  140. package/dist/utils/credential-policy.d.ts +1 -1
  141. package/dist/utils/credential-policy.js +4 -0
  142. package/dist/utils/domain-diagnostics.d.ts +5 -5
  143. package/dist/utils/domain-diagnostics.js +21 -10
  144. package/dist/utils/egress-policy.fixtures.json +1 -1
  145. package/dist/utils/grants.d.ts +53 -0
  146. package/dist/utils/grants.js +160 -0
  147. package/dist/utils/local-space-state.d.ts +78 -4
  148. package/dist/utils/local-space-state.js +384 -82
  149. package/dist/utils/one-shot-replay.d.ts +14 -0
  150. package/dist/utils/one-shot-replay.js +21 -0
  151. package/dist/utils/page-preview.d.ts +7 -0
  152. package/dist/utils/page-preview.js +9 -0
  153. package/dist/utils/pages.d.ts +2 -5
  154. package/dist/utils/pages.js +64 -33
  155. package/dist/utils/publish-form-data.d.ts +22 -0
  156. package/dist/utils/publish-form-data.js +26 -0
  157. package/dist/utils/publish-policy.d.ts +34 -4
  158. package/dist/utils/publish-policy.js +149 -62
  159. package/dist/utils/query-keys.d.ts +8 -10
  160. package/dist/utils/query-keys.js +14 -10
  161. package/dist/utils/runtime-paths.d.ts +3 -0
  162. package/dist/utils/runtime-paths.js +7 -0
  163. package/dist/utils/secure-local-file.d.ts +73 -0
  164. package/dist/utils/secure-local-file.js +1373 -0
  165. package/dist/utils/space-config.d.ts +17 -4
  166. package/dist/utils/space-config.js +151 -8
  167. package/dist/utils/static-runtime-policy.d.ts +5 -0
  168. package/dist/utils/static-runtime-policy.js +54 -10
  169. package/dist/utils/storage-policy.d.ts +20 -0
  170. package/dist/utils/storage-policy.fixtures.json +174 -0
  171. package/dist/utils/storage-policy.js +193 -0
  172. package/dist/utils/upload-session.d.ts +15 -1
  173. package/dist/utils/upload-session.js +68 -2
  174. package/dist/utils/version-file-browser.d.ts +13 -0
  175. package/dist/utils/version-file-browser.js +59 -0
  176. package/package.json +20 -1
  177. package/dist/contracts/mounts.d.ts +0 -142
  178. package/dist/contracts/mounts.js +0 -56
  179. package/dist/utils/access-grant.d.ts +0 -14
  180. package/dist/utils/access-grant.js +0 -88
  181. package/dist/utils/access-match.d.ts +0 -46
  182. package/dist/utils/access-match.fixtures.json +0 -513
  183. package/dist/utils/access-match.js +0 -312
  184. package/dist/utils/access-verdict.fixtures.json +0 -421
  185. package/dist/utils/asset-fingerprint.d.ts +0 -53
  186. package/dist/utils/asset-fingerprint.js +0 -574
  187. package/dist/utils/sf-config-v1.d.ts +0 -2
  188. package/dist/utils/sf-config-v1.fixtures.json +0 -9
  189. package/dist/utils/sf-config-v1.js +0 -551
@@ -0,0 +1,309 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The platform execution layer: everything true of running tenant code on
4
+ * Spacefast regardless of which product is running it.
5
+ *
6
+ * Two products sit on top of this file, and they are genuinely different
7
+ * things rather than two configurations of one thing:
8
+ *
9
+ * - **Zero** (`./zero.js`) runs capsules — schema, queries, mutations and
10
+ * endpoints that share one parent-owned transaction — in the native runner
11
+ * on a dedicated wp.cloud site, next to that site's MySQL.
12
+ * - **Functions** (`./functions.js`) runs workers on Cloudflare Workers for
13
+ * Platforms, carrying npm and framework output that we could never sandbox
14
+ * as well ourselves.
15
+ *
16
+ * The only surface both can host is an endpoint that touches neither the
17
+ * database nor the caller's identity — see `endpointIsPortable`. That is the
18
+ * portable seam, and it is deliberately narrow: a capsule handler's semantics
19
+ * depend on the transaction wrapped around it, which does not exist on an
20
+ * isolate a continent away from the database.
21
+ */
22
+ /**
23
+ * What a live version runs. `static` is bytes on disk with no execution at
24
+ * all, and remains the overwhelming majority of traffic; the other two each
25
+ * name a product.
26
+ */
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);
40
+ export const EXECUTION_ENV_MAX_KEYS = 64;
41
+ export const EXECUTION_ENV_NAME_MAX_BYTES = 128;
42
+ export const EXECUTION_ENV_VALUE_MAX_BYTES = 16 * 1024;
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";
53
+ /**
54
+ * Names the platform reserves for itself in the tenant environment. Tenant
55
+ * code cannot set these, so it cannot spoof the values the broker trusts.
56
+ */
57
+ export const EXECUTION_ENV_RESERVED_PREFIXES = ["SPACEFAST_", "ZERO_"];
58
+ /** Paths the platform owns on every space, whatever the product. */
59
+ export const PLATFORM_ROUTE_PREFIX = "/__spacefast";
60
+ /**
61
+ * First path segments the platform claims. Matched as segment prefixes rather
62
+ * than whole segments because the runtime already reserves the whole family —
63
+ * `/__stattic_probe` is a live serving path, and `upload-policy.php` refuses
64
+ * any first segment starting with either of these. Encoding it the same way
65
+ * here keeps a capsule or worker from declaring a route the origin would
66
+ * intercept before it ever reached them.
67
+ */
68
+ export const PLATFORM_RESERVED_ROUTE_SEGMENT_PREFIXES = [
69
+ "__spacefast",
70
+ "__stattic",
71
+ "__span",
72
+ ];
73
+ export const executionSha256Schema = z.string().regex(/^sha256:[a-f0-9]{64}$/);
74
+ export const executionBase64Schema = z
75
+ .string()
76
+ .regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
77
+ export const executionIdentifierSchema = z
78
+ .string()
79
+ .min(1)
80
+ .max(128)
81
+ .regex(/^[A-Za-z_][A-Za-z0-9_]*$/);
82
+ export const executionEnvNameSchema = z
83
+ .string()
84
+ .min(1)
85
+ .max(EXECUTION_ENV_NAME_MAX_BYTES)
86
+ .regex(/^[A-Za-z_][A-Za-z0-9_]*$/)
87
+ .refine((name) => !EXECUTION_ENV_RESERVED_PREFIXES.some((prefix) => name.toUpperCase().startsWith(prefix)), { message: "Environment variable name uses a reserved prefix." });
88
+ /**
89
+ * Rejects lone surrogates. A path that survives JSON but not UTF-8 encoding
90
+ * round-trips differently through PHP, Rust and Cloudflare's router, so it is
91
+ * refused at the contract rather than resolved differently on each tier.
92
+ */
93
+ function hasWellFormedUnicode(value) {
94
+ for (let index = 0; index < value.length; index++) {
95
+ const codeUnit = value.charCodeAt(index);
96
+ if (codeUnit >= 0xd800 && codeUnit <= 0xdbff) {
97
+ if (index + 1 >= value.length)
98
+ return false;
99
+ const next = value.charCodeAt(index + 1);
100
+ if (next < 0xdc00 || next > 0xdfff)
101
+ return false;
102
+ index++;
103
+ }
104
+ else if (codeUnit >= 0xdc00 && codeUnit <= 0xdfff) {
105
+ return false;
106
+ }
107
+ }
108
+ return true;
109
+ }
110
+ function hasNoAsciiControlCharacters(value) {
111
+ for (let index = 0; index < value.length; index++) {
112
+ const codeUnit = value.charCodeAt(index);
113
+ if (codeUnit <= 0x1f || codeUnit === 0x7f)
114
+ return false;
115
+ }
116
+ return true;
117
+ }
118
+ /**
119
+ * Builds the route-path schema for a product. Structural rules — normalization,
120
+ * traversal, wildcards, the platform's own prefixes — are identical everywhere
121
+ * and live here. Each product passes the extra paths and prefixes its own app
122
+ * shell claims, because those differ: Zero's client router owns `/auth/*`,
123
+ * a Functions worker owns nothing beyond what the platform reserves.
124
+ */
125
+ export function appRoutePathSchema(options) {
126
+ const reservedPaths = options.reservedPaths ?? [];
127
+ const reservedPrefixes = options.reservedPrefixes ?? [];
128
+ return z
129
+ .string()
130
+ .min(1)
131
+ .max(2048)
132
+ .startsWith("/")
133
+ .refine(hasWellFormedUnicode, {
134
+ message: `${options.subject} must contain well-formed Unicode.`,
135
+ })
136
+ .refine((path) => path.normalize("NFC") === path, {
137
+ message: `${options.subject} must use NFC-normalized Unicode.`,
138
+ })
139
+ .refine(hasNoAsciiControlCharacters, {
140
+ message: `${options.subject} must not contain ASCII control characters.`,
141
+ })
142
+ .refine((path) => !path.includes("//") &&
143
+ !path.includes("\\") &&
144
+ !path.includes("*") &&
145
+ !path.includes("?") &&
146
+ !path.includes("#") &&
147
+ !path.includes("%") &&
148
+ // The root is the one path allowed to end in a slash. Zero reserves it
149
+ // for its app shell anyway, but a Functions worker serving a framework
150
+ // app needs to claim "/" as its index route.
151
+ (path === "/" || !path.endsWith("/")) &&
152
+ path
153
+ .split("/")
154
+ .every((segment, index, segments) => segment !== "." &&
155
+ segment !== ".." &&
156
+ segment !== ":" &&
157
+ (segment !== ":splat" || index === segments.length - 1)), {
158
+ message: `${options.subject} must be absolute app paths without encoded, empty, traversal, unnamed parameter, * wildcard, non-terminal splat, \\, ?, or # segments.`,
159
+ })
160
+ .refine((path) => !PLATFORM_RESERVED_ROUTE_SEGMENT_PREFIXES.some((segmentPrefix) => (path.split("/")[1] ?? "").startsWith(segmentPrefix)), { message: `${options.subject} cannot use a path the platform reserves.` })
161
+ .refine((path) => !reservedPaths.some((reservedPath) => path === reservedPath), {
162
+ message: `${options.subject} cannot use a reserved path.`,
163
+ })
164
+ .refine((path) => !reservedPrefixes.some((prefix) => path.startsWith(prefix)), {
165
+ message: `${options.subject} cannot use a reserved path prefix.`,
166
+ });
167
+ }
168
+ export const httpMethodSchema = z.enum([
169
+ "GET",
170
+ "HEAD",
171
+ "POST",
172
+ "PUT",
173
+ "PATCH",
174
+ "DELETE",
175
+ "OPTIONS",
176
+ ]);
177
+ /**
178
+ * What a handler is allowed to reach. Declared at build time from what the
179
+ * source actually imports, not from what the author claims, and printed in the
180
+ * publish receipt so placement is never a surprise.
181
+ */
182
+ export const executionCapabilitiesSchema = z
183
+ .object({
184
+ db: z.boolean().default(false),
185
+ fetch: z.boolean().default(false),
186
+ auth: z.boolean().default(false),
187
+ env: z.boolean().default(false),
188
+ realtime: z.boolean().default(false),
189
+ logging: z.boolean().default(false),
190
+ })
191
+ .partial()
192
+ .default({});
193
+ /**
194
+ * The portable seam, stated as one predicate.
195
+ *
196
+ * `db` and `auth` are the two capabilities that bind a handler to the local
197
+ * tier. `db` because Zero's store guarantees every handler runs inside one
198
+ * parent-owned transaction, which an isolate reaching the database over a
199
+ * relay cannot offer. `auth` because capsule identity is resolved against that
200
+ * same transaction's view. Everything else — fetch, env, realtime, logging —
201
+ * is brokered identically on both tiers and does not constrain placement.
202
+ *
203
+ * Nothing here decides placement automatically: the product a version deploys
204
+ * to is a property of what its author wrote, and this predicate only reports
205
+ * whether the code could also have run on the other tier.
206
+ */
207
+ export function endpointIsPortable(capabilities) {
208
+ return capabilities.db !== true && capabilities.auth !== true;
209
+ }
210
+ /**
211
+ * A source-carrying handler, before it is compiled to whichever tier will run
212
+ * it. Both products publish these; only the capability set decides which of
213
+ * them could accept a given one.
214
+ */
215
+ export function executionEndpointSourceSchema(routePathSchema) {
216
+ return z
217
+ .object({
218
+ method: httpMethodSchema,
219
+ path: routePathSchema,
220
+ endpointId: z.string().min(1).max(256),
221
+ source: z
222
+ .string()
223
+ .min(1)
224
+ .max(2 * 1024 * 1024),
225
+ capabilities: executionCapabilitiesSchema,
226
+ })
227
+ .strict();
228
+ }
229
+ /**
230
+ * Byte-carrying artifacts travel inline in the finalize payload rather than as
231
+ * a separate upload, so a version's code lands in the same atomic write as the
232
+ * rest of it. The storage root and ceiling differ per product, hence a factory.
233
+ */
234
+ export function executionBundleSchema(options) {
235
+ return z
236
+ .object({
237
+ path: z
238
+ .string()
239
+ .min(1)
240
+ .startsWith(`${options.bundleRoot}/`)
241
+ .refine((bundlePath) => !bundlePath.split("/").includes(".."), {
242
+ message: "Bundle paths cannot traverse outside the runtime bundle root.",
243
+ }),
244
+ sha256: executionSha256Schema,
245
+ size: z.number().int().nonnegative().max(options.maxBytes),
246
+ contentBase64: executionBase64Schema,
247
+ })
248
+ .strict();
249
+ }
250
+ export function executionStaticFileSchema(options) {
251
+ return z
252
+ .object({
253
+ path: z
254
+ .string()
255
+ .min(1)
256
+ .max(2048)
257
+ .refine((path) => !path.startsWith("/") && !path.split("/").includes(".."), {
258
+ message: "Static file paths must be relative and cannot traverse.",
259
+ })
260
+ .refine((path) => !path.startsWith(`${options.storageRoot}/`), {
261
+ message: `Static files cannot use ${options.storageRoot}.`,
262
+ })
263
+ .refine((path) => !path.startsWith("_") && !path.startsWith("."), {
264
+ message: "Static file paths cannot use private root prefixes.",
265
+ }),
266
+ contentType: z.string().min(1).max(255),
267
+ sha256: executionSha256Schema,
268
+ size: z.number().int().nonnegative().max(options.maxBytes),
269
+ contentBase64: executionBase64Schema,
270
+ })
271
+ .strict();
272
+ }
273
+ /**
274
+ * Whether a version's execution surface may be read by anyone or only by the
275
+ * space's own members. Both products expose an inspect route; the policy is
276
+ * the same question on each.
277
+ */
278
+ export const executionInspectPolicySchema = z.enum(["private", "public"]);
279
+ export const executionLogEntrySchema = z
280
+ .object({
281
+ id: z.string().min(1),
282
+ timestamp: z.string().datetime(),
283
+ level: z.enum(["debug", "info", "warn", "error"]),
284
+ requestId: z.string().min(1).nullable(),
285
+ versionId: z.string().min(1).nullable(),
286
+ /** Zero names the mutation; Functions names the handler. */
287
+ handlerName: z.string().min(1).nullable(),
288
+ message: z.string(),
289
+ metadata: z.record(z.string(), z.unknown()).default({}),
290
+ })
291
+ .strict();
292
+ export const executionLogListQuerySchema = z
293
+ .object({
294
+ limit: z.coerce.number().int().min(1).max(100).default(50),
295
+ cursor: z.string().min(1).optional(),
296
+ requestId: z.string().min(1).optional(),
297
+ handlerName: z.string().min(1).optional(),
298
+ })
299
+ .strict();
300
+ export const executionLogListResponseSchema = z
301
+ .object({
302
+ data: z.array(executionLogEntrySchema),
303
+ pagination: z
304
+ .object({
305
+ nextCursor: z.string().nullable(),
306
+ })
307
+ .strict(),
308
+ })
309
+ .strict();
@@ -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";
@@ -261,45 +261,6 @@ declare const featureEntries: readonly [{
261
261
  readonly code: "proxy_binding_stop";
262
262
  readonly summary: "Deny new binds; discoverable authenticated read/detach plus service reconciliation continue.";
263
263
  };
264
- }, {
265
- readonly cohort: "launch";
266
- readonly key: "collab.comments";
267
- readonly name: "Comments";
268
- readonly description: "Enables Cast-backed comments on eligible immutable version URLs.";
269
- readonly stage: "ga";
270
- readonly surface: true;
271
- readonly defaultEnabled: true;
272
- readonly runtime: {
273
- readonly enabledInDevelopment: true;
274
- readonly enabledForA8c: true;
275
- readonly planDefaults: {};
276
- };
277
- readonly assignmentScopes: readonly ["user", "team", "global"];
278
- readonly docs: {
279
- readonly channel: "public";
280
- readonly slug: "/docs/collab";
281
- readonly feedbackUrl: null;
282
- };
283
- readonly owner: "team:collaboration";
284
- readonly requires: readonly [];
285
- readonly lifecycleAdoptedAt: "2026-07-12";
286
- readonly reviewAfter: "2026-08-11";
287
- readonly removeAfter: "2026-10-10";
288
- readonly gaAt: "2026-07-23";
289
- readonly allowedActorPolicies: readonly ["request_actor", "persisted_request_actor", "resource_team"];
290
- readonly downRamp: {
291
- readonly code: "comments_stop";
292
- readonly summary: "Deny every customer comment read/write route and deferred task; internal operator export/cleanup continue.";
293
- };
294
- }, {
295
- readonly key: "collab.anonymous_commenters";
296
- readonly name: "Anonymous commenters";
297
- readonly description: "Allows anyone with the link to comment when space policy allows it.";
298
- readonly defaultEnabled: true;
299
- readonly runtime: {
300
- readonly enabledForA8c: true;
301
- readonly planDefaults: {};
302
- };
303
264
  }, {
304
265
  readonly cohort: "launch";
305
266
  readonly key: "collab.notices";
@@ -325,36 +286,6 @@ declare const featureEntries: readonly [{
325
286
  readonly code: "notices_stop";
326
287
  readonly summary: "Stop mint/publish; service/operator revoke and cleanup continue.";
327
288
  };
328
- }, {
329
- readonly cohort: "launch";
330
- readonly key: "collab.published_comments";
331
- readonly name: "Published host comments";
332
- readonly description: "Allows the Collab overlay to mount comments on a space's live/published host, not just immutable preview URLs.";
333
- readonly stage: "ga";
334
- readonly surface: true;
335
- readonly defaultEnabled: true;
336
- readonly runtime: {
337
- readonly enabledInDevelopment: true;
338
- readonly enabledForA8c: true;
339
- readonly planDefaults: {};
340
- };
341
- readonly assignmentScopes: readonly ["team", "global"];
342
- readonly docs: {
343
- readonly channel: "public";
344
- readonly slug: "/docs/collab/published-comments";
345
- readonly feedbackUrl: null;
346
- };
347
- readonly owner: "team:collaboration";
348
- readonly requires: readonly ["collab.comments"];
349
- readonly lifecycleAdoptedAt: "2026-07-12";
350
- readonly reviewAfter: "2026-08-11";
351
- readonly removeAfter: "2026-10-10";
352
- readonly gaAt: "2026-07-23";
353
- readonly allowedActorPolicies: readonly ["resource_team"];
354
- readonly downRamp: {
355
- readonly code: "published_comments_stop";
356
- readonly summary: "Stop published-host injection; stored data remains only for operator export/cleanup.";
357
- };
358
289
  }, {
359
290
  readonly key: "collab.drawing";
360
291
  readonly name: "Collab drawing";
@@ -370,9 +301,9 @@ declare const featureEntries: readonly [{
370
301
  readonly key: "sites.dedicated_runtime";
371
302
  readonly name: "Dedicated runtime sites";
372
303
  readonly description: "Allows teams to create dedicated WP.Cloud sites and place team spaces on them.";
373
- readonly stage: "internal";
304
+ readonly stage: "ga";
374
305
  readonly surface: true;
375
- readonly defaultEnabled: false;
306
+ readonly defaultEnabled: true;
376
307
  readonly runtime: {
377
308
  readonly enabledInDevelopment: true;
378
309
  readonly enabledForA8c: true;
@@ -380,16 +311,16 @@ declare const featureEntries: readonly [{
380
311
  };
381
312
  readonly assignmentScopes: readonly ["team", "global"];
382
313
  readonly docs: {
383
- readonly channel: "handbook";
384
- readonly slug: "/features/sites/dedicated-runtime";
314
+ readonly channel: "public";
315
+ readonly slug: "/docs/apps";
385
316
  readonly feedbackUrl: null;
386
317
  };
387
318
  readonly owner: "team:runtime";
388
319
  readonly requires: readonly [];
389
320
  readonly lifecycleAdoptedAt: "2026-07-12";
390
- readonly reviewAfter: "2026-08-11";
391
- readonly removeAfter: "2026-10-10";
392
- readonly gaAt: null;
321
+ readonly reviewAfter: null;
322
+ readonly removeAfter: "2026-11-01";
323
+ readonly gaAt: "2026-08-05";
393
324
  readonly allowedActorPolicies: readonly ["request_actor", "resource_team"];
394
325
  readonly downRamp: {
395
326
  readonly code: "dedicated_runtime_stop";
@@ -466,28 +397,25 @@ declare const featureEntries: readonly [{
466
397
  readonly key: "zero";
467
398
  readonly name: "Spacefast Zero";
468
399
  readonly description: "Enables Spacefast Zero command surfaces and hosted Zero app workflows.";
469
- readonly stage: "internal";
400
+ readonly stage: "ga";
470
401
  readonly surface: true;
471
- readonly defaultEnabled: false;
402
+ readonly defaultEnabled: true;
472
403
  readonly runtime: {
473
404
  readonly enabledForA8c: true;
474
- readonly planDefaults: {
475
- readonly enterprise: true;
476
- readonly internal: true;
477
- };
405
+ readonly planDefaults: {};
478
406
  };
479
407
  readonly assignmentScopes: readonly ["team", "global"];
480
408
  readonly docs: {
481
- readonly channel: "handbook";
482
- readonly slug: "/features/zero";
409
+ readonly channel: "public";
410
+ readonly slug: "/docs/apps/zero";
483
411
  readonly feedbackUrl: null;
484
412
  };
485
413
  readonly owner: "team:zero";
486
414
  readonly requires: readonly ["sites.dedicated_runtime"];
487
415
  readonly lifecycleAdoptedAt: "2026-07-12";
488
- readonly reviewAfter: "2026-08-11";
489
- readonly removeAfter: "2026-10-10";
490
- readonly gaAt: null;
416
+ readonly reviewAfter: null;
417
+ readonly removeAfter: "2026-11-01";
418
+ readonly gaAt: "2026-08-05";
491
419
  readonly allowedActorPolicies: readonly ["resource_team"];
492
420
  readonly downRamp: {
493
421
  readonly code: "zero_stop";
@@ -495,127 +423,50 @@ declare const featureEntries: readonly [{
495
423
  };
496
424
  }, {
497
425
  readonly cohort: "launch";
498
- readonly key: "access.invites";
499
- readonly name: "Space invites";
500
- readonly description: "Enables account-less viewer invites with magic-link accept and the request-access loop (access-plan §5.3/§5.4).";
501
- readonly stage: "internal";
502
- readonly surface: true;
503
- readonly defaultEnabled: false;
504
- readonly runtime: {
505
- readonly enabledInDevelopment: true;
506
- readonly enabledForA8c: true;
507
- readonly planDefaults: {};
508
- };
509
- readonly assignmentScopes: readonly ["user", "team", "global"];
510
- readonly docs: {
511
- readonly channel: "handbook";
512
- readonly slug: "/features/access/invites";
513
- readonly feedbackUrl: null;
514
- };
515
- readonly owner: "team:access";
516
- readonly requires: readonly [];
517
- readonly lifecycleAdoptedAt: "2026-07-12";
518
- readonly reviewAfter: "2026-08-11";
519
- readonly removeAfter: "2026-10-10";
520
- readonly gaAt: null;
521
- readonly allowedActorPolicies: readonly ["request_actor", "persisted_request_actor"];
522
- readonly downRamp: {
523
- readonly code: "invites_stop";
524
- readonly summary: "Deny every customer invite route and deferred delivery; internal operator cancel/revoke and service cleanup continue.";
525
- };
526
- }, {
527
- readonly key: "access.firewall_card";
528
- readonly name: "Firewall card";
529
- readonly description: "Enables the managed firewall block card (country/IP/bot rules) in space access settings (access-plan §5.6).";
530
- readonly defaultEnabled: true;
531
- readonly runtime: {
532
- readonly enabledInDevelopment: true;
533
- readonly enabledForA8c: true;
534
- readonly planDefaults: {};
535
- };
536
- }, {
537
- readonly cohort: "launch";
538
- readonly key: "access.sso_connections";
539
- readonly name: "Company SSO connections";
540
- readonly description: "Enables team-level OIDC connections minted at the authorize endpoint (access-plan §6.2, X-18).";
541
- readonly stage: "internal";
426
+ readonly key: "functions";
427
+ readonly name: "Spacefast Functions";
428
+ readonly description: string;
429
+ readonly stage: "private_beta";
542
430
  readonly surface: true;
543
431
  readonly defaultEnabled: false;
544
432
  readonly runtime: {
545
- readonly enabledInDevelopment: true;
546
433
  readonly enabledForA8c: true;
547
434
  readonly planDefaults: {};
548
435
  };
549
- readonly assignmentScopes: readonly ["user", "team", "global"];
436
+ readonly assignmentScopes: readonly ["team", "global"];
550
437
  readonly docs: {
551
- readonly channel: "handbook";
552
- readonly slug: "/features/access/sso-connections";
438
+ readonly channel: "public";
439
+ readonly slug: "/docs/apps/functions";
553
440
  readonly feedbackUrl: null;
554
441
  };
555
- readonly owner: "team:access";
442
+ readonly owner: "team:zero";
556
443
  readonly requires: readonly [];
557
- readonly lifecycleAdoptedAt: "2026-07-12";
558
- readonly reviewAfter: "2026-08-11";
559
- readonly removeAfter: "2026-10-10";
444
+ readonly lifecycleAdoptedAt: "2026-07-27";
445
+ readonly reviewAfter: "2026-09-02";
446
+ readonly removeAfter: "2026-11-01";
560
447
  readonly gaAt: null;
561
- readonly allowedActorPolicies: readonly ["request_actor", "persisted_request_actor"];
448
+ readonly allowedActorPolicies: readonly ["resource_team"];
562
449
  readonly downRamp: {
563
- readonly code: "sso_connections_stop";
564
- readonly summary: "Deny every customer SSO connection route and callback; internal operator revoke/cleanup continue.";
450
+ readonly code: "functions_stop";
451
+ readonly summary: string;
565
452
  };
566
453
  }, {
567
454
  readonly cohort: "launch";
568
- readonly key: "access.byo_issuers";
569
- readonly name: "Bring-your-own issuers";
570
- readonly description: "Enables owner-held external token issuers with ext:-namespace binding (access-plan §6.3, X-19).";
571
- readonly stage: "internal";
455
+ readonly key: "spaces.slug_rename";
456
+ readonly name: "Space slug rename";
457
+ readonly description: "Renames a space and its managed hostname while retained former hostnames temporarily redirect to the current address.";
458
+ readonly stage: "ga";
572
459
  readonly surface: true;
573
- readonly defaultEnabled: false;
574
- readonly runtime: {
575
- readonly enabledInDevelopment: true;
576
- readonly enabledForA8c: true;
577
- readonly planDefaults: {};
578
- };
579
- readonly assignmentScopes: readonly ["user", "team", "global"];
580
- readonly docs: {
581
- readonly channel: "handbook";
582
- readonly slug: "/features/access/byo-issuers";
583
- readonly feedbackUrl: null;
584
- };
585
- readonly owner: "team:access";
586
- readonly requires: readonly [];
587
- readonly lifecycleAdoptedAt: "2026-07-12";
588
- readonly reviewAfter: "2026-08-11";
589
- readonly removeAfter: "2026-10-10";
590
- readonly gaAt: null;
591
- readonly allowedActorPolicies: readonly ["request_actor", "persisted_request_actor"];
592
- readonly downRamp: {
593
- readonly code: "byo_issuers_stop";
594
- readonly summary: "Deny every customer issuer route and callback; internal operator revoke/cleanup continue.";
595
- };
596
- }, {
597
- readonly key: "access.views_panel";
598
- readonly name: "Views panel";
599
- readonly description: "Enables the identified who-viewed-what panel riding the analytics tiers (access-plan §5.6b, X-28).";
600
460
  readonly defaultEnabled: true;
601
461
  readonly runtime: {
602
462
  readonly enabledInDevelopment: true;
603
463
  readonly enabledForA8c: true;
604
464
  readonly planDefaults: {};
605
465
  };
606
- }, {
607
- readonly cohort: "launch";
608
- readonly key: "spaces.slug_rename";
609
- readonly name: "Space slug rename";
610
- readonly description: "Changes mutable space identity metadata while the stable managed hostname and hostname rows remain unchanged.";
611
- readonly stage: "internal";
612
- readonly surface: true;
613
- readonly defaultEnabled: false;
614
- readonly runtime: null;
615
466
  readonly assignmentScopes: readonly ["user", "team", "global"];
616
467
  readonly docs: {
617
- readonly channel: "handbook";
618
- readonly slug: "/features/spaces/slug-rename";
468
+ readonly channel: "public";
469
+ readonly slug: "/docs/spaces/rename";
619
470
  readonly feedbackUrl: null;
620
471
  };
621
472
  readonly owner: "team:spaces";
@@ -623,11 +474,11 @@ declare const featureEntries: readonly [{
623
474
  readonly lifecycleAdoptedAt: "2026-07-12";
624
475
  readonly reviewAfter: "2026-08-11";
625
476
  readonly removeAfter: "2026-10-10";
626
- readonly gaAt: null;
477
+ readonly gaAt: "2026-07-27";
627
478
  readonly allowedActorPolicies: readonly ["request_actor"];
628
479
  readonly downRamp: {
629
480
  readonly code: "slug_rename_stop";
630
- readonly summary: "Deny every new stable-host slug rename; the atomic metadata write has no deferred feature continuation.";
481
+ readonly summary: "Deny new slug renames while already-committed hostname redirects and runtime convergence continue.";
631
482
  };
632
483
  }];
633
484
  type FeatureEntry = (typeof featureEntries)[number];
@@ -645,5 +496,5 @@ type RuntimeDefinitionRecord<K extends string> = {
645
496
  readonly [Key in K]: RuntimeFeatureDefinitionShape<Key>;
646
497
  };
647
498
  export declare const FEATURE_RUNTIME_KEYS: readonly RuntimeFeatureKey[];
648
- export declare const FEATURE_RUNTIME_DEFINITIONS: Readonly<RuntimeDefinitionRecord<"zero" | "plans.paid.available" | "anonymous.publishing" | "beta.enrollment_gate" | "domains.search" | "domains.registration" | "domains.dns_management" | "domains.wpcom_dns" | "domains.domain_connect" | "domains.proxy_bindings" | "collab.comments" | "collab.anonymous_commenters" | "collab.notices" | "collab.published_comments" | "collab.drawing" | "sites.dedicated_runtime" | "shelf" | "tags" | "access.invites" | "access.firewall_card" | "access.sso_connections" | "access.byo_issuers" | "access.views_panel">>;
499
+ export declare const FEATURE_RUNTIME_DEFINITIONS: Readonly<RuntimeDefinitionRecord<"zero" | "plans.paid.available" | "anonymous.publishing" | "beta.enrollment_gate" | "domains.search" | "domains.registration" | "domains.dns_management" | "domains.wpcom_dns" | "domains.domain_connect" | "domains.proxy_bindings" | "collab.notices" | "collab.drawing" | "sites.dedicated_runtime" | "shelf" | "tags" | "functions" | "spaces.slug_rename">>;
649
500
  export declare const FEATURE_LIFECYCLE_BY_KEY: ReadonlyMap<LifecycleFeatureKey, FeatureRegistryEntry<LifecycleFeatureKey>>;