@spacefast/common 0.0.26 → 0.2.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.
Files changed (302) hide show
  1. package/dist/agents/connect-targets.d.ts +6 -146
  2. package/dist/agents/connect-targets.js +63 -295
  3. package/dist/agents/private-key-oauth.d.ts +31 -1
  4. package/dist/agents/private-key-oauth.js +124 -33
  5. package/dist/agents/registry/core.d.ts +292 -0
  6. package/dist/agents/registry/core.js +1388 -0
  7. package/dist/agents/registry/deeplink-probes.d.ts +23 -0
  8. package/dist/agents/registry/deeplink-probes.js +18 -0
  9. package/dist/agents/registry/node.d.ts +56 -0
  10. package/dist/agents/registry/node.js +339 -0
  11. package/dist/brand-assets-build.js +1 -2
  12. package/dist/brand-assets.js +4 -7
  13. package/dist/brand.d.ts +17 -0
  14. package/dist/brand.js +24 -4
  15. package/dist/config/domains.d.ts +55 -28
  16. package/dist/config/domains.js +85 -41
  17. package/dist/config/index.js +1 -2
  18. package/dist/contracts/abuse.js +9 -24
  19. package/dist/contracts/access-profiles.d.ts +86 -0
  20. package/dist/contracts/access-profiles.js +89 -0
  21. package/dist/contracts/access.d.ts +21 -27
  22. package/dist/contracts/access.js +33 -64
  23. package/dist/contracts/activity.d.ts +18 -1
  24. package/dist/contracts/activity.js +70 -26
  25. package/dist/contracts/analytics.js +8 -10
  26. package/dist/contracts/api-keys.d.ts +77 -52
  27. package/dist/contracts/api-keys.js +44 -24
  28. package/dist/contracts/application-journal.d.ts +216 -0
  29. package/dist/contracts/application-journal.js +167 -0
  30. package/dist/contracts/auth.d.ts +90 -17
  31. package/dist/contracts/auth.js +86 -17
  32. package/dist/contracts/beta.d.ts +9 -4
  33. package/dist/contracts/beta.js +20 -16
  34. package/dist/contracts/billing.js +7 -11
  35. package/dist/contracts/bootstrap.d.ts +791 -0
  36. package/dist/contracts/bootstrap.js +51 -0
  37. package/dist/contracts/builds.d.ts +186 -7
  38. package/dist/contracts/builds.js +75 -21
  39. package/dist/contracts/channels.d.ts +43 -0
  40. package/dist/contracts/channels.js +25 -9
  41. package/dist/contracts/cli.d.ts +7 -0
  42. package/dist/contracts/cli.js +6 -0
  43. package/dist/contracts/collab-public.d.ts +1 -1
  44. package/dist/contracts/collab-public.js +5 -8
  45. package/dist/contracts/comments.d.ts +45 -35
  46. package/dist/contracts/comments.js +107 -77
  47. package/dist/contracts/commerce.d.ts +165 -0
  48. package/dist/contracts/commerce.js +146 -0
  49. package/dist/contracts/common.d.ts +3 -3
  50. package/dist/contracts/common.js +18 -29
  51. package/dist/contracts/content-contract-verification.d.ts +521 -0
  52. package/dist/contracts/content-contract-verification.js +320 -0
  53. package/dist/contracts/content-platform-fixture.d.ts +1278 -0
  54. package/dist/contracts/content-platform-fixture.js +44 -0
  55. package/dist/contracts/content-program.d.ts +994 -0
  56. package/dist/contracts/content-program.js +658 -0
  57. package/dist/contracts/content-sync.d.ts +290 -0
  58. package/dist/contracts/content-sync.js +167 -0
  59. package/dist/contracts/content.d.ts +432 -0
  60. package/dist/contracts/content.js +303 -0
  61. package/dist/contracts/continuation.d.ts +17 -1
  62. package/dist/contracts/continuation.js +23 -23
  63. package/dist/contracts/countries.js +3 -4
  64. package/dist/contracts/crons.d.ts +17 -0
  65. package/dist/contracts/crons.js +33 -15
  66. package/dist/contracts/dashboard-prefs.d.ts +56 -0
  67. package/dist/contracts/dashboard-prefs.js +51 -0
  68. package/dist/contracts/device-auth.d.ts +234 -37
  69. package/dist/contracts/device-auth.js +267 -53
  70. package/dist/contracts/docs.d.ts +6 -10
  71. package/dist/contracts/docs.js +5 -13
  72. package/dist/contracts/domains.d.ts +499 -102
  73. package/dist/contracts/domains.js +169 -58
  74. package/dist/contracts/email-preferences.d.ts +3 -3
  75. package/dist/contracts/email-preferences.js +6 -7
  76. package/dist/contracts/enums.d.ts +26 -26
  77. package/dist/contracts/enums.js +61 -54
  78. package/dist/contracts/error-code-meta.d.ts +269 -7
  79. package/dist/contracts/error-code-meta.js +80 -5
  80. package/dist/contracts/error-codes.d.ts +5 -5
  81. package/dist/contracts/error-codes.js +78 -16
  82. package/dist/contracts/events.d.ts +100 -20
  83. package/dist/contracts/events.js +107 -20
  84. package/dist/contracts/execution.d.ts +47 -66
  85. package/dist/contracts/execution.js +51 -64
  86. package/dist/contracts/feature-lifecycle.d.ts +70 -14
  87. package/dist/contracts/feature-lifecycle.js +86 -15
  88. package/dist/contracts/features.d.ts +100 -37
  89. package/dist/contracts/features.js +21 -27
  90. package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
  91. package/dist/contracts/frame-session.d.ts +192 -0
  92. package/dist/contracts/frame-session.js +164 -0
  93. package/dist/contracts/functions.d.ts +218 -211
  94. package/dist/contracts/functions.js +273 -260
  95. package/dist/contracts/grant-copy.d.ts +43 -0
  96. package/dist/contracts/grant-copy.js +44 -0
  97. package/dist/contracts/grants.d.ts +64 -56
  98. package/dist/contracts/grants.js +124 -23
  99. package/dist/contracts/ids.d.ts +4 -1
  100. package/dist/contracts/ids.js +4 -1
  101. package/dist/contracts/internal.d.ts +5 -4
  102. package/dist/contracts/internal.js +12 -3
  103. package/dist/contracts/mcp.d.ts +17 -0
  104. package/dist/contracts/mcp.js +23 -0
  105. package/dist/contracts/me.d.ts +6 -1
  106. package/dist/contracts/me.js +12 -6
  107. package/dist/contracts/notifications.d.ts +27 -29
  108. package/dist/contracts/notifications.js +9 -4
  109. package/dist/contracts/oauth-resources.d.ts +112 -10
  110. package/dist/contracts/oauth-resources.js +116 -11
  111. package/dist/contracts/oauth-scope-actions.d.ts +90 -0
  112. package/dist/contracts/oauth-scope-actions.js +126 -0
  113. package/dist/contracts/operations.d.ts +27 -4
  114. package/dist/contracts/operations.js +11 -5
  115. package/dist/contracts/pages.d.ts +29 -5
  116. package/dist/contracts/pages.js +22 -5
  117. package/dist/contracts/partner-notifications.d.ts +3 -0
  118. package/dist/contracts/partner-notifications.js +65 -0
  119. package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
  120. package/dist/contracts/{platform.js → partner.js} +27 -40
  121. package/dist/contracts/plan-policy.d.ts +1 -1
  122. package/dist/contracts/principal-assertion.d.ts +43 -0
  123. package/dist/contracts/principal-assertion.js +67 -0
  124. package/dist/contracts/principals.d.ts +73 -0
  125. package/dist/contracts/principals.js +59 -0
  126. package/dist/contracts/privacy.d.ts +11 -0
  127. package/dist/contracts/privacy.js +17 -0
  128. package/dist/contracts/problem-document.js +3 -4
  129. package/dist/contracts/publish-archive.d.ts +116 -18
  130. package/dist/contracts/publish-archive.js +6 -3
  131. package/dist/contracts/push-new.d.ts +4 -4
  132. package/dist/contracts/quotas.js +3 -3
  133. package/dist/contracts/realtime.d.ts +52 -0
  134. package/dist/contracts/realtime.js +54 -0
  135. package/dist/contracts/repository-connections.d.ts +1 -1
  136. package/dist/contracts/repository-connections.js +6 -2
  137. package/dist/contracts/resources.d.ts +105 -14
  138. package/dist/contracts/resources.js +145 -21
  139. package/dist/contracts/route-inventory.d.ts +358 -0
  140. package/dist/contracts/route-inventory.js +141 -0
  141. package/dist/contracts/runtime-api.d.ts +112 -35
  142. package/dist/contracts/runtime-api.js +86 -66
  143. package/dist/contracts/runtime-app.d.ts +11 -21
  144. package/dist/contracts/runtime-app.js +39 -24
  145. package/dist/contracts/runtime-components.d.ts +143 -0
  146. package/dist/contracts/runtime-components.js +199 -0
  147. package/dist/contracts/runtime-db.d.ts +45 -19
  148. package/dist/contracts/runtime-db.js +85 -20
  149. package/dist/contracts/runtime-purge.js +3 -5
  150. package/dist/contracts/runtime-services.d.ts +43 -75
  151. package/dist/contracts/runtime-services.js +29 -49
  152. package/dist/contracts/runtime-storage.d.ts +14 -14
  153. package/dist/contracts/runtime-storage.js +28 -13
  154. package/dist/contracts/sf-config-v1.d.ts +14 -18
  155. package/dist/contracts/slugs.js +13 -4
  156. package/dist/contracts/space-config.d.ts +235 -28
  157. package/dist/contracts/space-config.js +246 -91
  158. package/dist/contracts/spaces.d.ts +360 -255
  159. package/dist/contracts/spaces.js +190 -122
  160. package/dist/contracts/superadmin-activity.d.ts +3 -43
  161. package/dist/contracts/superadmin-activity.js +6 -30
  162. package/dist/contracts/superadmin-emails.d.ts +1 -0
  163. package/dist/contracts/superadmin-emails.js +17 -1
  164. package/dist/contracts/superadmin-runtime.d.ts +199 -0
  165. package/dist/contracts/superadmin-runtime.js +141 -0
  166. package/dist/contracts/superadmin-search.d.ts +22 -2
  167. package/dist/contracts/superadmin-search.js +14 -6
  168. package/dist/contracts/superadmin-spaces.d.ts +435 -186
  169. package/dist/contracts/superadmin-spaces.js +131 -25
  170. package/dist/contracts/superadmin-teams.d.ts +3 -0
  171. package/dist/contracts/superadmin-teams.js +1 -2
  172. package/dist/contracts/superadmin-tenants.d.ts +627 -6
  173. package/dist/contracts/superadmin-tenants.js +32 -7
  174. package/dist/contracts/superadmin.d.ts +98 -16
  175. package/dist/contracts/superadmin.js +63 -10
  176. package/dist/contracts/tags.d.ts +85 -58
  177. package/dist/contracts/tags.js +44 -34
  178. package/dist/contracts/teams.d.ts +72 -9
  179. package/dist/contracts/teams.js +84 -25
  180. package/dist/contracts/tenants.d.ts +135 -0
  181. package/dist/contracts/tenants.js +120 -0
  182. package/dist/contracts/test-triggers.d.ts +70 -0
  183. package/dist/contracts/test-triggers.js +116 -0
  184. package/dist/contracts/theme-json.js +3 -8
  185. package/dist/contracts/transfers.d.ts +1 -0
  186. package/dist/contracts/transfers.js +1 -0
  187. package/dist/contracts/usage.d.ts +209 -0
  188. package/dist/contracts/usage.js +124 -12
  189. package/dist/contracts/variables.d.ts +2 -2
  190. package/dist/contracts/variables.js +9 -13
  191. package/dist/contracts/webhooks.d.ts +13 -5
  192. package/dist/contracts/webhooks.js +3 -1
  193. package/dist/contracts/zero.d.ts +57 -64
  194. package/dist/contracts/zero.js +68 -66
  195. package/dist/dashboard-paths/index.d.ts +24 -21
  196. package/dist/dashboard-paths/index.js +35 -47
  197. package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
  198. package/dist/dashboard-paths/route-reservations.generated.js +36 -0
  199. package/dist/docs/agent-arrival.d.ts +92 -0
  200. package/dist/docs/agent-arrival.js +227 -0
  201. package/dist/docs/agent-output-policy.d.ts +6 -0
  202. package/dist/docs/agent-output-policy.js +22 -0
  203. package/dist/docs/agent-prose.d.ts +11 -17
  204. package/dist/docs/agent-prose.js +62 -37
  205. package/dist/docs/agent-setup.d.ts +72 -41
  206. package/dist/docs/agent-setup.js +336 -436
  207. package/dist/docs/catalog.d.ts +147 -89
  208. package/dist/docs/catalog.js +157 -42
  209. package/dist/docs/error-docs.d.ts +2098 -1
  210. package/dist/docs/error-docs.js +281 -16
  211. package/dist/docs/index-build.d.ts +0 -1
  212. package/dist/docs/index-build.js +2 -3
  213. package/dist/docs/page-context-prompt.d.ts +77 -0
  214. package/dist/docs/page-context-prompt.js +131 -0
  215. package/dist/docs/reference-urls.d.ts +46 -0
  216. package/dist/docs/reference-urls.js +79 -0
  217. package/dist/docs/search.d.ts +6 -8
  218. package/dist/docs/search.js +10 -13
  219. package/dist/docs/skill-distribution.d.ts +4 -1
  220. package/dist/docs/skill-distribution.js +10 -5
  221. package/dist/docs/skills.d.ts +117 -117
  222. package/dist/docs/skills.js +120 -72
  223. package/dist/docs/start-prompts.d.ts +45 -0
  224. package/dist/docs/start-prompts.js +62 -0
  225. package/dist/domain-exploration.js +9 -13
  226. package/dist/og-template.d.ts +56 -0
  227. package/dist/og-template.js +56 -0
  228. package/dist/slug-policy/index.js +5 -11
  229. package/dist/utils/browser-credential.d.ts +13 -6
  230. package/dist/utils/browser-credential.js +14 -7
  231. package/dist/utils/build-settings.d.ts +16 -0
  232. package/dist/utils/build-settings.js +63 -17
  233. package/dist/utils/canonical-json.d.ts +3 -5
  234. package/dist/utils/canonical-json.js +3 -5
  235. package/dist/utils/cast-transport.d.ts +5 -17
  236. package/dist/utils/cast-transport.js +6 -19
  237. package/dist/utils/claim-token.js +1 -2
  238. package/dist/utils/comment-avatars.js +4 -6
  239. package/dist/utils/concurrency.js +2 -3
  240. package/dist/utils/content-type.d.ts +7 -6
  241. package/dist/utils/content-type.js +73 -51
  242. package/dist/utils/credential-policy.d.ts +50 -6
  243. package/dist/utils/credential-policy.js +123 -57
  244. package/dist/utils/egress-policy.fixtures.json +1 -1
  245. package/dist/utils/generate-space-name.d.ts +3 -8
  246. package/dist/utils/generate-space-name.js +3 -8
  247. package/dist/utils/grants.d.ts +0 -1
  248. package/dist/utils/grants.js +4 -7
  249. package/dist/utils/gravatar.d.ts +2 -4
  250. package/dist/utils/gravatar.js +6 -12
  251. package/dist/utils/id-hints.js +14 -23
  252. package/dist/utils/idempotency.d.ts +3 -3
  253. package/dist/utils/idempotency.js +6 -7
  254. package/dist/utils/local-space-state.d.ts +15 -15
  255. package/dist/utils/local-space-state.js +34 -23
  256. package/dist/utils/oauth-signed-query.d.ts +3 -5
  257. package/dist/utils/oauth-signed-query.js +6 -9
  258. package/dist/utils/one-shot-replay.d.ts +3 -5
  259. package/dist/utils/one-shot-replay.js +3 -5
  260. package/dist/utils/page-colors.d.ts +4 -10
  261. package/dist/utils/page-colors.js +11 -35
  262. package/dist/utils/page-fonts.js +6 -11
  263. package/dist/utils/page-preview.d.ts +0 -1
  264. package/dist/utils/page-preview.js +0 -1
  265. package/dist/utils/pages.d.ts +22 -11
  266. package/dist/utils/pages.js +70 -30
  267. package/dist/utils/privacy-regions.d.ts +19 -0
  268. package/dist/utils/privacy-regions.js +91 -0
  269. package/dist/utils/publish-form-data.d.ts +4 -5
  270. package/dist/utils/publish-form-data.js +2 -3
  271. package/dist/utils/publish-policy.d.ts +10 -23
  272. package/dist/utils/publish-policy.js +63 -116
  273. package/dist/utils/query-client.d.ts +2 -0
  274. package/dist/utils/query-client.js +10 -1
  275. package/dist/utils/runtime-paths.d.ts +4 -4
  276. package/dist/utils/runtime-paths.js +6 -8
  277. package/dist/utils/runtime-upload.d.ts +4 -0
  278. package/dist/utils/runtime-upload.js +5 -0
  279. package/dist/utils/secure-local-file.d.ts +3 -3
  280. package/dist/utils/secure-local-file.js +18 -24
  281. package/dist/utils/space-config.d.ts +11 -14
  282. package/dist/utils/space-config.js +10 -16
  283. package/dist/utils/static-runtime-policy.d.ts +5 -8
  284. package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
  285. package/dist/utils/static-runtime-policy.generated.js +70 -0
  286. package/dist/utils/static-runtime-policy.js +17 -84
  287. package/dist/utils/storage-policy.js +1 -2
  288. package/dist/utils/upload-session.js +8 -14
  289. package/dist/utils/version-path.js +11 -19
  290. package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
  291. package/dist/utils/wpcom-auth-redirects.js +1 -4
  292. package/dist/vocabulary.d.ts +7 -7
  293. package/dist/vocabulary.js +30 -16
  294. package/package.json +14 -2
  295. package/dist/agents/client-registry.d.ts +0 -22
  296. package/dist/agents/client-registry.js +0 -41
  297. package/dist/docs/agent-handoff-document.d.ts +0 -15
  298. package/dist/docs/agent-handoff-document.js +0 -180
  299. package/dist/docs/agent-solutions.d.ts +0 -110
  300. package/dist/docs/agent-solutions.js +0 -183
  301. package/dist/utils/query-keys.d.ts +0 -84
  302. package/dist/utils/query-keys.js +0 -108
@@ -1,38 +1,28 @@
1
1
  import { z } from "zod";
2
2
  /**
3
3
  * The platform execution layer: everything true of running tenant code on
4
- * Spacefast regardless of which product is running it.
4
+ * Spacefast, regardless of which product runs it.
5
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.
6
+ * - **Zero** (`./zero.js`) runs capsules in the native runner on a dedicated
7
+ * wp.cloud site, next to that site's MySQL. A capsule is a schema, queries,
8
+ * mutations and endpoints sharing one parent-owned transaction.
12
9
  * - **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.
10
+ * Platforms, carrying npm and framework output we could not sandbox as well
11
+ * ourselves.
15
12
  *
16
- * The only surface both can host is an endpoint that touches neither the
17
- * database, the caller's identity, nor realtime see `endpointIsPortable`.
18
- * That is the portable seam, and it is deliberately narrow: a capsule
19
- * handler's semantics depend on the transaction wrapped around it, which does
20
- * not exist on an isolate a continent away from the database.
13
+ * The only surface both can host is an endpoint touching neither the database,
14
+ * the caller's identity, nor realtime. See `endpointIsPortable`.
21
15
  *
22
- * Neither is a "kind" a space declares. Every space owns a site, so what runs
23
- * is a routing decision derived from what the published tree carries: static
24
- * files, a worker, a capsule, or any mix of the three in one publish. There is
25
- * no enum here to disagree with the tree.
16
+ * Neither is a "kind" a space declares. What runs is a routing decision derived
17
+ * from what the published tree carries, so there is no enum here to disagree
18
+ * with the tree.
26
19
  */
27
20
  /**
28
- * How a live runtime delivers realtime invalidations.
29
- *
30
- * One vocabulary end to end: the finalize payload, the client config a serving
31
- * runtime hands the browser, and every API response all name the transport
32
- * with these three values. `central` is the hosted relay, `cast` is the
33
- * collaboration service, and `local` is a dev machine serving its own socket —
34
- * a distinction a customer can act on, unlike the component names the transports
35
- * used to be called after.
21
+ * How a live runtime delivers realtime invalidations. One vocabulary end to
22
+ * end: the finalize payload, the client config handed to the browser, and every
23
+ * API response name the transport with these three values. `central` is the
24
+ * hosted relay, `cast` is the collaboration service, `local` is a dev machine
25
+ * serving its own socket.
36
26
  */
37
27
  export const RUNTIME_REALTIME_MODES = ["central", "cast", "local"];
38
28
  export const runtimeRealtimeModeSchema = z.enum(RUNTIME_REALTIME_MODES);
@@ -57,13 +47,19 @@ export const SERVER_ENV_FILES = [SERVER_ENV_FILE, LAKEBED_SERVER_ENV_FILE];
57
47
  export const EXECUTION_ENV_RESERVED_PREFIXES = ["SPACEFAST_", "ZERO_"];
58
48
  /** Paths the platform owns on every space, whatever the product. */
59
49
  export const PLATFORM_ROUTE_PREFIX = "/__spacefast";
50
+ /** Runtime-owned files that travel inside a version but are never tenant files. */
51
+ export function runtimeInternalArtifactPath(path) {
52
+ const foldedPlatformPath = path.toLowerCase();
53
+ return (path === "zero" ||
54
+ path.startsWith("zero/") ||
55
+ foldedPlatformPath === "__spacefast" ||
56
+ foldedPlatformPath.startsWith("__spacefast/"));
57
+ }
60
58
  /**
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.
59
+ * First path segments the platform claims. Matched as segment prefixes, not
60
+ * whole segments: `/__stattic_probe` is a live serving path, and
61
+ * `upload-policy.php` refuses any first segment starting with one of these. A
62
+ * capsule or worker must not declare a route the origin would intercept first.
67
63
  */
68
64
  export const PLATFORM_RESERVED_ROUTE_SEGMENT_PREFIXES = [
69
65
  "__spacefast",
@@ -116,11 +112,11 @@ function hasNoAsciiControlCharacters(value) {
116
112
  return true;
117
113
  }
118
114
  /**
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.
115
+ * Builds the route-path schema for a product. The structural rules are
116
+ * identical everywhere and live here: normalization, traversal, wildcards, and
117
+ * the platform's own prefixes. Each product passes the extra paths and prefixes
118
+ * its own app shell claims, because those differ: Zero's client router owns
119
+ * `/auth/*`, a Functions worker owns nothing beyond what the platform reserves.
124
120
  */
125
121
  export function appRoutePathSchema(options) {
126
122
  const reservedPaths = options.reservedPaths ?? [];
@@ -145,9 +141,8 @@ export function appRoutePathSchema(options) {
145
141
  !path.includes("?") &&
146
142
  !path.includes("#") &&
147
143
  !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.
144
+ // The root is the one path allowed to end in a slash: a Functions
145
+ // worker serving a framework app claims "/" as its index route.
151
146
  (path === "/" || !path.endsWith("/")) &&
152
147
  path
153
148
  .split("/")
@@ -190,14 +185,14 @@ export const executionCapabilitiesSchema = z
190
185
  gravatar: z.boolean().default(false),
191
186
  spam: z.boolean().default(false),
192
187
  email: z.boolean().default(false),
188
+ content: z.boolean().default(false),
193
189
  })
194
190
  .partial()
195
191
  .default({});
196
192
  /**
197
193
  * The order every surface renders a capability list in. Fixed rather than
198
194
  * derived from a response body, so two spaces never list their capabilities
199
- * differently because JSON came back reshuffled — and declared here, beside the
200
- * schema, so adding a capability cannot leave a renderer silently omitting it.
195
+ * differently because JSON came back reshuffled.
201
196
  */
202
197
  export const EXECUTION_CAPABILITY_ORDER = [
203
198
  "db",
@@ -209,32 +204,25 @@ export const EXECUTION_CAPABILITY_ORDER = [
209
204
  "gravatar",
210
205
  "spam",
211
206
  "email",
207
+ "content",
212
208
  ];
213
209
  // A capability added to executionCapabilitiesSchema must also be added to the order above.
214
210
  true;
215
211
  /**
216
- * The portable seam, stated as one predicate.
217
- *
218
- * `db`, `auth` and `realtime` are the three capabilities that bind a handler
219
- * to the local tier. `db` because Zero's store guarantees every handler runs
220
- * inside one parent-owned transaction, which an isolate reaching the database
221
- * over a relay cannot offer. `auth` because capsule identity is resolved
222
- * against that same transaction's view. `realtime` because invalidations are
223
- * emitted by the native runner beside the store, and the Functions grant
224
- * vocabulary has no counterpart for them — a worker declaring the capability
225
- * would fail closed at the relay with nothing to reach. Everything else —
226
- * fetch, env, logging, and the three platform services — is brokered
227
- * identically on both tiers and does not constrain placement.
212
+ * The portable seam. `db`, `auth` and `realtime` bind a handler to the local
213
+ * tier: `db` because Zero guarantees one parent-owned transaction that an
214
+ * isolate over a relay cannot offer, `auth` because capsule identity resolves
215
+ * against that transaction's view, `realtime` because the Functions grant
216
+ * vocabulary has no counterpart for invalidations. Everything else is brokered
217
+ * identically on both tiers.
228
218
  *
229
- * `email` is the one worth stating explicitly, because it looks like it should
230
- * bind: a Zero mutation's send is atomic with its database writes, and a
231
- * Function's is not. That is a difference in the *guarantee* either tier can
232
- * offer, not in what the handler is allowed to reach, and placement follows
233
- * what code reaches. An author who needs that atomicity writes a capsule.
219
+ * `email` looks like it should bind but does not: a Zero mutation's send is
220
+ * atomic with its writes and a Function's is not, which is a difference in
221
+ * guarantee, not in what the handler reaches. An author who needs that
222
+ * atomicity writes a capsule.
234
223
  *
235
- * Nothing here decides placement automatically: the product a version deploys
236
- * to is a property of what its author wrote, and this predicate only reports
237
- * whether the code could also have run on the other tier.
224
+ * This predicate reports only whether code could also have run on the other
225
+ * tier. It does not decide placement.
238
226
  */
239
227
  export function endpointIsPortable(capabilities) {
240
228
  return capabilities.db !== true && capabilities.auth !== true && capabilities.realtime !== true;
@@ -307,7 +295,6 @@ export function executionStaticFileSchema(options) {
307
295
  }
308
296
  /**
309
297
  * Whether a version's execution surface may be read by anyone or only by the
310
- * space's own members. Both products expose an inspect route; the policy is
311
- * the same question on each.
298
+ * space's own members. Both products expose an inspect route.
312
299
  */
313
300
  export const executionInspectPolicySchema = z.enum(["private", "public"]);
@@ -17,7 +17,7 @@ declare const featureEntries: readonly [{
17
17
  readonly cohort: "launch";
18
18
  readonly key: "plans.paid.available";
19
19
  readonly name: "Paid plans available";
20
- readonly description: "Controls whether paid plan upgrade and management surfaces are available.";
20
+ readonly description: "Enables paid plan upgrade and management surfaces.";
21
21
  readonly stage: "internal";
22
22
  readonly surface: false;
23
23
  readonly defaultEnabled: false;
@@ -50,7 +50,7 @@ declare const featureEntries: readonly [{
50
50
  };
51
51
  readonly docs: {
52
52
  readonly channel: "public";
53
- readonly slug: "/docs/publishing/anonymous";
53
+ readonly slug: "/docs/publish/anonymous";
54
54
  readonly feedbackUrl: null;
55
55
  };
56
56
  readonly owner: "team:publishing";
@@ -86,7 +86,7 @@ declare const featureEntries: readonly [{
86
86
  readonly cohort: "launch";
87
87
  readonly key: "domains.catalog";
88
88
  readonly name: "Domain catalog";
89
- readonly description: "Controls authenticated domain product/catalog operations; public suggestions, availability and WHOIS remain unflagged.";
89
+ readonly description: "Enables authenticated domain catalog operations. Public suggestions, availability and WHOIS stay unflagged.";
90
90
  readonly stage: "internal";
91
91
  readonly surface: true;
92
92
  readonly defaultEnabled: false;
@@ -232,7 +232,7 @@ declare const featureEntries: readonly [{
232
232
  };
233
233
  readonly docs: {
234
234
  readonly channel: "public";
235
- readonly slug: "/docs/spaces/proxy-routes";
235
+ readonly slug: "/docs/serve/redirects";
236
236
  readonly feedbackUrl: null;
237
237
  };
238
238
  readonly owner: "team:domains";
@@ -249,7 +249,7 @@ declare const featureEntries: readonly [{
249
249
  readonly cohort: "launch";
250
250
  readonly key: "collab.notices";
251
251
  readonly name: "Realtime notices";
252
- readonly description: "Live: the Space notice room. Turns on the dashboard's realtime comment feed and the overlay's notice chips. Not an authorization who may watch a Space's feed is decided by its Grants.";
252
+ readonly description: "Turns on the Space notice room: the dashboard's realtime comment feed and the overlay's notice chips. Not an authorization; Grants decide who may watch a feed.";
253
253
  readonly stage: "internal";
254
254
  readonly surface: false;
255
255
  readonly defaultEnabled: false;
@@ -268,6 +268,44 @@ declare const featureEntries: readonly [{
268
268
  readonly code: "notices_stop";
269
269
  readonly summary: "Stop mint/publish; service/operator revoke and cleanup continue.";
270
270
  };
271
+ }, {
272
+ readonly key: "collab.comments";
273
+ readonly name: "Comments";
274
+ readonly description: "Enables the Comments feature for a team: comment threads on spaces/versions, collaboration settings, and the third-party embed surface.";
275
+ readonly defaultEnabled: false;
276
+ readonly runtime: {
277
+ readonly enabledInDevelopment: true;
278
+ readonly enabledForA8c: true;
279
+ readonly planDefaults: {};
280
+ };
281
+ }, {
282
+ readonly cohort: "launch";
283
+ readonly key: "content.managed";
284
+ readonly name: "Managed content";
285
+ readonly description: "Enables the managed WordPress content API and dashboard editor after the compatible runtime fleet is promoted.";
286
+ readonly stage: "internal";
287
+ readonly surface: true;
288
+ readonly defaultEnabled: false;
289
+ readonly runtime: {
290
+ readonly enabledInDevelopment: true;
291
+ readonly enabledForA8c: true;
292
+ readonly planDefaults: {};
293
+ };
294
+ readonly docs: {
295
+ readonly channel: "handbook";
296
+ readonly slug: "/features/content";
297
+ readonly feedbackUrl: null;
298
+ };
299
+ readonly owner: "team:runtime";
300
+ readonly requires: readonly ["sites.dedicated_runtime"];
301
+ readonly lifecycleAdoptedAt: "2026-08-28";
302
+ readonly reviewAfter: "2026-09-11";
303
+ readonly removeAfter: "2026-10-31";
304
+ readonly gaAt: null;
305
+ readonly downRamp: {
306
+ readonly code: "managed_content_stop";
307
+ readonly summary: "Deny customer Content API calls and new editor-session launches, let already-minted editor sessions expire within one hour, stop compiling and activating content releases, and leave existing WordPress data and static serving intact for recovery or export.";
308
+ };
271
309
  }, {
272
310
  readonly key: "collab.drawing";
273
311
  readonly name: "Collab drawing";
@@ -293,7 +331,7 @@ declare const featureEntries: readonly [{
293
331
  };
294
332
  readonly docs: {
295
333
  readonly channel: "public";
296
- readonly slug: "/docs/apps";
334
+ readonly slug: "/docs/account/plans";
297
335
  readonly feedbackUrl: null;
298
336
  };
299
337
  readonly owner: "team:runtime";
@@ -310,7 +348,7 @@ declare const featureEntries: readonly [{
310
348
  readonly cohort: "launch";
311
349
  readonly key: "build.content_pipeline";
312
350
  readonly name: "Content pipeline";
313
- readonly description: "Controls publish/finalize use of the content transformation pipeline.";
351
+ readonly description: "Enables the content transformation pipeline at publish and finalize.";
314
352
  readonly stage: "internal";
315
353
  readonly surface: true;
316
354
  readonly defaultEnabled: false;
@@ -345,7 +383,7 @@ declare const featureEntries: readonly [{
345
383
  };
346
384
  readonly docs: {
347
385
  readonly channel: "public";
348
- readonly slug: "/docs/tags";
386
+ readonly slug: "/docs/guides/tag-manager";
349
387
  readonly feedbackUrl: null;
350
388
  };
351
389
  readonly owner: "team:tag-manager";
@@ -372,7 +410,7 @@ declare const featureEntries: readonly [{
372
410
  };
373
411
  readonly docs: {
374
412
  readonly channel: "public";
375
- readonly slug: "/docs/apps/zero";
413
+ readonly slug: "/docs/zero-runtime";
376
414
  readonly feedbackUrl: null;
377
415
  };
378
416
  readonly owner: "team:zero";
@@ -399,7 +437,7 @@ declare const featureEntries: readonly [{
399
437
  };
400
438
  readonly docs: {
401
439
  readonly channel: "public";
402
- readonly slug: "/docs/apps/functions";
440
+ readonly slug: "/docs/functions";
403
441
  readonly feedbackUrl: null;
404
442
  };
405
443
  readonly owner: "team:zero";
@@ -416,7 +454,7 @@ declare const featureEntries: readonly [{
416
454
  readonly cohort: "launch";
417
455
  readonly key: "spaces.slug_rename";
418
456
  readonly name: "Space slug rename";
419
- readonly description: "Renames a space and its managed hostname while retained former hostnames temporarily redirect to the current address.";
457
+ readonly description: "Renames a space and its managed hostname. Retained former hostnames temporarily redirect to the current address.";
420
458
  readonly stage: "ga";
421
459
  readonly surface: true;
422
460
  readonly defaultEnabled: true;
@@ -427,7 +465,7 @@ declare const featureEntries: readonly [{
427
465
  };
428
466
  readonly docs: {
429
467
  readonly channel: "public";
430
- readonly slug: "/docs/spaces/rename";
468
+ readonly slug: "/docs/operate/spaces";
431
469
  readonly feedbackUrl: null;
432
470
  };
433
471
  readonly owner: "team:spaces";
@@ -438,7 +476,25 @@ declare const featureEntries: readonly [{
438
476
  readonly gaAt: "2026-07-27";
439
477
  readonly downRamp: {
440
478
  readonly code: "slug_rename_stop";
441
- readonly summary: "Deny new slug renames while already-committed hostname redirects and runtime convergence continue.";
479
+ readonly summary: "Block new slug renames while earlier hostname and runtime updates continue.";
480
+ };
481
+ }, {
482
+ readonly key: "pages.templates";
483
+ readonly name: "Custom page templates";
484
+ readonly description: "Allows _pages/*.html full-page takeovers to compile for spaces owned by a principal on a plan that grants it.";
485
+ readonly defaultEnabled: false;
486
+ readonly runtime: {
487
+ readonly enabledForA8c: false;
488
+ readonly planDefaults: {};
489
+ };
490
+ }, {
491
+ readonly key: "branding.hide";
492
+ readonly name: "Hide Spacefast branding";
493
+ readonly description: "Allows theme.hideSpacefastBranding to remove the Spacefast badge for spaces owned by a principal on a plan that grants it.";
494
+ readonly defaultEnabled: false;
495
+ readonly runtime: {
496
+ readonly enabledForA8c: false;
497
+ readonly planDefaults: {};
442
498
  };
443
499
  }];
444
500
  type FeatureEntry = (typeof featureEntries)[number];
@@ -456,5 +512,5 @@ type RuntimeDefinitionRecord<K extends string> = {
456
512
  readonly [Key in K]: RuntimeFeatureDefinitionFields<Key>;
457
513
  };
458
514
  export declare const FEATURE_RUNTIME_KEYS: readonly RuntimeFeatureKey[];
459
- export declare const FEATURE_RUNTIME_DEFINITIONS: Readonly<RuntimeDefinitionRecord<"zero" | "tags" | "functions" | "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" | "spaces.slug_rename">>;
515
+ 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.comments" | "content.managed" | "sites.dedicated_runtime" | "collab.drawing" | "tags" | "functions" | "spaces.slug_rename" | "pages.templates" | "branding.hide">>;
460
516
  export declare const FEATURE_LIFECYCLE_BY_KEY: ReadonlyMap<LifecycleFeatureKey, FeatureRegistryEntry<LifecycleFeatureKey>>;
@@ -1,11 +1,16 @@
1
1
  import { freezeFeatureRegistryEntry } from "./feature-lifecycle-core.js";
2
2
  export { FEATURE_OWNER_IDS, FEATURE_STAGES, freezeFeatureRegistryEntry, validateFeatureLifecycleRegistry, } from "./feature-lifecycle-core.js";
3
+ // A `public` docs slug is a live path on the published documentation site, and
4
+ // the sidebar in that site's `blume.config.ts` is its route manifest. Nothing
5
+ // here can check that a slug resolves, because the docs live in another
6
+ // repository; `hasCanonicalDocsSlug` only checks the path's shape. Confirm a
7
+ // slug against that sidebar when you add or move one.
3
8
  const featureEntries = Object.freeze([
4
9
  {
5
10
  cohort: "launch",
6
11
  key: "plans.paid.available",
7
12
  name: "Paid plans available",
8
- description: "Controls whether paid plan upgrade and management surfaces are available.",
13
+ description: "Enables paid plan upgrade and management surfaces.",
9
14
  stage: "internal",
10
15
  surface: false,
11
16
  defaultEnabled: false,
@@ -39,7 +44,7 @@ const featureEntries = Object.freeze([
39
44
  },
40
45
  docs: {
41
46
  channel: "public",
42
- slug: "/docs/publishing/anonymous",
47
+ slug: "/docs/publish/anonymous",
43
48
  feedbackUrl: null,
44
49
  },
45
50
  owner: "team:publishing",
@@ -78,7 +83,7 @@ const featureEntries = Object.freeze([
78
83
  cohort: "launch",
79
84
  key: "domains.catalog",
80
85
  name: "Domain catalog",
81
- description: "Controls authenticated domain product/catalog operations; public suggestions, availability and WHOIS remain unflagged.",
86
+ description: "Enables authenticated domain catalog operations. Public suggestions, availability and WHOIS stay unflagged.",
82
87
  stage: "internal",
83
88
  surface: true,
84
89
  defaultEnabled: false,
@@ -229,7 +234,7 @@ const featureEntries = Object.freeze([
229
234
  },
230
235
  docs: {
231
236
  channel: "public",
232
- slug: "/docs/spaces/proxy-routes",
237
+ slug: "/docs/serve/redirects",
233
238
  feedbackUrl: null,
234
239
  },
235
240
  owner: "team:domains",
@@ -247,7 +252,7 @@ const featureEntries = Object.freeze([
247
252
  cohort: "launch",
248
253
  key: "collab.notices",
249
254
  name: "Realtime notices",
250
- description: "Live: the Space notice room. Turns on the dashboard's realtime comment feed and the overlay's notice chips. Not an authorization who may watch a Space's feed is decided by its Grants.",
255
+ description: "Turns on the Space notice room: the dashboard's realtime comment feed and the overlay's notice chips. Not an authorization; Grants decide who may watch a feed.",
251
256
  stage: "internal",
252
257
  surface: false,
253
258
  defaultEnabled: false,
@@ -267,6 +272,46 @@ const featureEntries = Object.freeze([
267
272
  summary: "Stop mint/publish; service/operator revoke and cleanup continue.",
268
273
  },
269
274
  },
275
+ {
276
+ key: "collab.comments",
277
+ name: "Comments",
278
+ description: "Enables the Comments feature for a team: comment threads on spaces/versions, collaboration settings, and the third-party embed surface.",
279
+ defaultEnabled: false,
280
+ runtime: {
281
+ enabledInDevelopment: true,
282
+ enabledForA8c: true,
283
+ planDefaults: {},
284
+ },
285
+ },
286
+ {
287
+ cohort: "launch",
288
+ key: "content.managed",
289
+ name: "Managed content",
290
+ description: "Enables the managed WordPress content API and dashboard editor after the compatible runtime fleet is promoted.",
291
+ stage: "internal",
292
+ surface: true,
293
+ defaultEnabled: false,
294
+ runtime: {
295
+ enabledInDevelopment: true,
296
+ enabledForA8c: true,
297
+ planDefaults: {},
298
+ },
299
+ docs: {
300
+ channel: "handbook",
301
+ slug: "/features/content",
302
+ feedbackUrl: null,
303
+ },
304
+ owner: "team:runtime",
305
+ requires: ["sites.dedicated_runtime"],
306
+ lifecycleAdoptedAt: "2026-08-28",
307
+ reviewAfter: "2026-09-11",
308
+ removeAfter: "2026-10-31",
309
+ gaAt: null,
310
+ downRamp: {
311
+ code: "managed_content_stop",
312
+ summary: "Deny customer Content API calls and new editor-session launches, let already-minted editor sessions expire within one hour, stop compiling and activating content releases, and leave existing WordPress data and static serving intact for recovery or export.",
313
+ },
314
+ },
270
315
  {
271
316
  key: "collab.drawing",
272
317
  name: "Collab drawing",
@@ -295,7 +340,7 @@ const featureEntries = Object.freeze([
295
340
  },
296
341
  docs: {
297
342
  channel: "public",
298
- slug: "/docs/apps",
343
+ slug: "/docs/account/plans",
299
344
  feedbackUrl: null,
300
345
  },
301
346
  owner: "team:runtime",
@@ -313,7 +358,7 @@ const featureEntries = Object.freeze([
313
358
  cohort: "launch",
314
359
  key: "build.content_pipeline",
315
360
  name: "Content pipeline",
316
- description: "Controls publish/finalize use of the content transformation pipeline.",
361
+ description: "Enables the content transformation pipeline at publish and finalize.",
317
362
  stage: "internal",
318
363
  surface: true,
319
364
  defaultEnabled: false,
@@ -349,7 +394,7 @@ const featureEntries = Object.freeze([
349
394
  },
350
395
  docs: {
351
396
  channel: "public",
352
- slug: "/docs/tags",
397
+ slug: "/docs/guides/tag-manager",
353
398
  feedbackUrl: null,
354
399
  },
355
400
  owner: "team:tag-manager",
@@ -379,7 +424,7 @@ const featureEntries = Object.freeze([
379
424
  },
380
425
  docs: {
381
426
  channel: "public",
382
- slug: "/docs/apps/zero",
427
+ slug: "/docs/zero-runtime",
383
428
  feedbackUrl: null,
384
429
  },
385
430
  owner: "team:zero",
@@ -410,7 +455,7 @@ const featureEntries = Object.freeze([
410
455
  },
411
456
  docs: {
412
457
  channel: "public",
413
- slug: "/docs/apps/functions",
458
+ slug: "/docs/functions",
414
459
  feedbackUrl: null,
415
460
  },
416
461
  owner: "team:zero",
@@ -425,15 +470,15 @@ const featureEntries = Object.freeze([
425
470
  downRamp: {
426
471
  code: "functions_stop",
427
472
  summary: "Stop emitting dispatch configuration at finalize; published bundles stay on disk as inert content and the " +
428
- "version serves statically. Versions already carrying a config keep dispatching until they are replaced " +
429
- "unsetting the runtime's dispatch token is the immediate kill.",
473
+ "version serves statically. Versions already carrying a config keep dispatching until they are replaced. " +
474
+ "Unsetting the runtime's dispatch token is the immediate kill.",
430
475
  },
431
476
  },
432
477
  {
433
478
  cohort: "launch",
434
479
  key: "spaces.slug_rename",
435
480
  name: "Space slug rename",
436
- description: "Renames a space and its managed hostname while retained former hostnames temporarily redirect to the current address.",
481
+ description: "Renames a space and its managed hostname. Retained former hostnames temporarily redirect to the current address.",
437
482
  stage: "ga",
438
483
  surface: true,
439
484
  defaultEnabled: true,
@@ -444,7 +489,7 @@ const featureEntries = Object.freeze([
444
489
  },
445
490
  docs: {
446
491
  channel: "public",
447
- slug: "/docs/spaces/rename",
492
+ slug: "/docs/operate/spaces",
448
493
  feedbackUrl: null,
449
494
  },
450
495
  owner: "team:spaces",
@@ -455,7 +500,33 @@ const featureEntries = Object.freeze([
455
500
  gaAt: "2026-07-27",
456
501
  downRamp: {
457
502
  code: "slug_rename_stop",
458
- summary: "Deny new slug renames while already-committed hostname redirects and runtime convergence continue.",
503
+ summary: "Block new slug renames while earlier hostname and runtime updates continue.",
504
+ },
505
+ },
506
+ {
507
+ // Partner plan-catalog entitlement dial: a partner plan that grants this key
508
+ // lets its principals' spaces compile `_pages/*.html` full-page takeovers.
509
+ // First-party plans express the same capability through PlanDefinition, not
510
+ // this flag; entitlement resolution maps this key onto the entitlement shape.
511
+ key: "pages.templates",
512
+ name: "Custom page templates",
513
+ description: "Allows _pages/*.html full-page takeovers to compile for spaces owned by a principal on a plan that grants it.",
514
+ defaultEnabled: false,
515
+ runtime: {
516
+ enabledForA8c: false,
517
+ planDefaults: {},
518
+ },
519
+ },
520
+ {
521
+ // Partner plan-catalog entitlement dial: a partner plan that grants this key
522
+ // lets its principals hide the Spacefast badge via theme.hideSpacefastBranding.
523
+ key: "branding.hide",
524
+ name: "Hide Spacefast branding",
525
+ description: "Allows theme.hideSpacefastBranding to remove the Spacefast badge for spaces owned by a principal on a plan that grants it.",
526
+ defaultEnabled: false,
527
+ runtime: {
528
+ enabledForA8c: false,
529
+ planDefaults: {},
459
530
  },
460
531
  },
461
532
  ]);