@spacefast/common 0.0.26 → 0.2.2

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 +192 -7
  38. package/dist/contracts/builds.js +84 -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 +273 -7
  79. package/dist/contracts/error-code-meta.js +81 -5
  80. package/dist/contracts/error-codes.d.ts +5 -5
  81. package/dist/contracts/error-codes.js +79 -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 +121 -10
  110. package/dist/contracts/oauth-resources.js +130 -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 +2102 -1
  210. package/dist/docs/error-docs.js +285 -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,8 +1,8 @@
1
1
  import { z } from "zod";
2
- // Space operation-lifecycle axis (the platform spec "Space"): exactly
3
- // these five. Serving (disabled) and deletion (deletedAt) are separate axes
4
- // a disabled space can still be updating. There is no `moving`: a space IS a
5
- // site, so ownership changes commit in place and nothing relocates.
2
+ // Space operation-lifecycle axis (the platform spec "Space"). Serving
3
+ // (disabled) and deletion (deletedAt) are separate axes, so a disabled space
4
+ // can still be updating. There is no `moving`: a space IS a site, so ownership
5
+ // changes commit in place.
6
6
  export const spaceStatusValues = [
7
7
  "provisioning",
8
8
  "active",
@@ -19,18 +19,16 @@ export const spaceDisabledReasonCodeValues = [
19
19
  "abuse_takedown",
20
20
  "tenant_suspended",
21
21
  "site_suspended",
22
- // Space-key author delete, phase one: the holder of an unclaimed space's key
23
- // took the site dark. The key survives, so the same key can restore (or
24
- // claim) until the claim window expires; expiry then hard-deletes as usual.
22
+ // The owner, or the holder of an unclaimed space's key, deleted the Space.
23
+ // Serving stops while data remains retained for deliberate cleanup. An
24
+ // unclaimed key survives so it can restore or claim during its claim window.
25
25
  "author_removed",
26
26
  ];
27
27
  export const spaceDisabledReasonCode = z.enum(spaceDisabledReasonCodeValues);
28
- // SpaceTransfer status machine (the platform spec "Transfer
29
- // semantics"), stored directly there is no separate DB vocabulary. A
30
- // transfer is a request that the receiving side accepts; accepting moves
31
- // ownership in one database transaction, so there is no intermediate moving
32
- // state and no `failed` state. Withdraw (from-side) and decline (to-side)
33
- // both land on `canceled`.
28
+ // SpaceTransfer status machine (the platform spec "Transfer semantics"),
29
+ // stored directly with no separate DB vocabulary. Accepting moves ownership in
30
+ // one database transaction, so there is no intermediate moving state and no
31
+ // `failed` state. Withdraw and decline both land on `canceled`.
34
32
  export const spaceTransferStatusValues = [
35
33
  "pending_confirmation",
36
34
  "completed",
@@ -38,14 +36,21 @@ export const spaceTransferStatusValues = [
38
36
  "expired",
39
37
  ];
40
38
  export const spaceTransferStatus = z.enum(spaceTransferStatusValues);
41
- // A tenant is the platform-account boundary that owns every resource (the platform spec
42
- // "Tenant -> Site -> Space"), Stripe-style. `main` is the single well-known
43
- // Stattic account (`ten_main`) all self-serve teams/users live under;
44
- // `platform` and `partner` are host integrations with their own user
45
- // directories and/or external customers; `internal` is for Stattic-operated
46
- // infrastructure tenants.
47
- export const tenantKindValues = ["main", "platform", "partner", "internal"];
39
+ // A tenant is the platform-account boundary that owns every resource,
40
+ // Stripe-style. `main` is the single well-known account (`ten_main`) all
41
+ // self-serve teams/users live under; `partner` is a host integration with
42
+ // its own user directory and/or external customers; `internal` is for
43
+ // Spacefast-operated infrastructure tenants.
44
+ export const tenantKindValues = ["main", "partner", "internal"];
48
45
  export const tenantKind = z.enum(tenantKindValues);
46
+ // A tenant's mode: `live` is a real partner account provisioning real sites;
47
+ // `test` is its linked sandbox twin — same partner API, isolated data,
48
+ // simulated provisioning, no real wp.cloud/DNS/email. Modeled as a SEPARATE
49
+ // tenant row linked back to its live parent via `liveTenantId`, never a column
50
+ // filtered into every resource query (partner-operations spec §1): isolation
51
+ // holds by construction because every resource is already `tenant_id`-scoped.
52
+ export const tenantModeValues = ["live", "test"];
53
+ export const tenantMode = z.enum(tenantModeValues);
49
54
  // `past_due` is the billing-grace state: mutations are rejected immediately
50
55
  // (`tenant_past_due`) but serving continues until `servingGraceUntil`, after
51
56
  // which the tenant transitions to `suspended` and goes dark.
@@ -55,38 +60,20 @@ export const tenantStatus = z.enum(tenantStatusValues);
55
60
  // (operator-only resource, `pvc_` prefix).
56
61
  export const providerClientStatusValues = ["active", "disabled"];
57
62
  export const providerClientStatus = z.enum(providerClientStatusValues);
58
- // The only site shape there is. Kept as a named vocabulary because the sites
59
- // table spells it as an enum column; a dead-code sweep removed it while that
60
- // column still referenced it.
61
- export const siteKindValues = ["static_runtime"];
62
- export const siteKind = z.enum(siteKindValues);
63
- // Whether settings and access default to the site or to each space. Same story
64
- // as the two vocabularies around it: a dead-code sweep took it while the
65
- // `sites` table's own column still named it.
66
- export const siteIsolationValues = ["site", "space"];
67
- export const siteIsolation = z.enum(siteIsolationValues);
68
- // Site lifecycle. A dead-code sweep removed this vocabulary while two live
69
- // consumers still needed it: the `sites` table's own status column and the
70
- // superadmin provider-site search result. `ready_pool` is a pre-provisioned
71
- // warm site waiting to be claimed — load-bearing now that every space draws
72
- // its own site from the pool.
73
- export const siteStatusValues = [
74
- "ready_pool",
75
- "active",
63
+ // Warm-pool inventory (`site_pool`): provider sites provisioned ahead of
64
+ // demand, with no owner yet. These statuses are the whole lifecycle a row has
65
+ // before a space adopts it and the row is deleted. `retired` holds a legacy
66
+ // migration source box that is never automatically promoted for deletion.
67
+ // `cleanup_pending` is the explicit, unclaimable queue for Superadmin review.
68
+ // This is a varchar type union, not a PostgreSQL enum, so adding a value needs
69
+ // no database migration.
70
+ export const poolSiteStatusValues = [
76
71
  "provisioning",
72
+ "ready_pool",
77
73
  "degraded",
78
- "suspended",
79
- "deleted",
74
+ "retired",
75
+ "cleanup_pending",
80
76
  ];
81
- export const siteStatus = z.enum(siteStatusValues);
82
- // Warm-pool inventory (`site_pool`): provider sites provisioned ahead of
83
- // demand, with no owner yet. A space IS a site, so these statuses are the
84
- // whole lifecycle a row can have before a space adopts it and the row is
85
- // deleted — `active`/`suspended`/`deleted` were live-space states and now live
86
- // on the space's own axes. `retired` holds a drained space=site migration
87
- // source box: not adoptable, not reapable, kept permanently — migration
88
- // tooling never deletes a wp.cloud site (owner ruling 2026-08-11).
89
- export const poolSiteStatusValues = ["provisioning", "ready_pool", "degraded", "retired"];
90
77
  export const poolSiteStatus = z.enum(poolSiteStatusValues);
91
78
  // PublishSource.kind (the platform spec "PublishSource"): the single
92
79
  // provenance axis for how a version came to exist. `variable_update` and
@@ -126,7 +113,7 @@ export const versionStatusValues = [
126
113
  export const versionStatus = z.enum(versionStatusValues);
127
114
  export const gitProviderValues = ["github", "gitlab", "bitbucket", "generic"];
128
115
  export const gitProvider = z.enum(gitProviderValues);
129
- // Pre-ready, non-terminal statuses: a version in one of these is in flight.
116
+ // Pre-ready, non-terminal statuses.
130
117
  export const VERSION_IN_FLIGHT_STATUSES = [
131
118
  "created",
132
119
  "uploading",
@@ -145,6 +132,30 @@ export const buildStatusValues = [
145
132
  "skipped",
146
133
  ];
147
134
  export const buildStatus = z.enum(buildStatusValues);
135
+ /**
136
+ * The one authoritative "this build can still change on its own" set. Poll
137
+ * cadences, cancelability, activity checks and webhook re-enqueue gates all
138
+ * derive from it — never restate it.
139
+ */
140
+ export const BUILD_IN_FLIGHT_STATUSES = [
141
+ "waiting_for_source",
142
+ "uploading_source",
143
+ "queued",
144
+ "running",
145
+ ];
146
+ const buildInFlightStatusSet = new Set(BUILD_IN_FLIGHT_STATUSES);
147
+ /**
148
+ * Its complement: a build that has settled and will never move again.
149
+ * `skipped` is terminal — a build the runner decided not to run at all.
150
+ */
151
+ export const BUILD_TERMINAL_STATUSES = buildStatusValues.filter((status) => !buildInFlightStatusSet.has(status));
152
+ const buildTerminalStatusSet = new Set(BUILD_TERMINAL_STATUSES);
153
+ export function buildIsInFlight(status) {
154
+ return buildInFlightStatusSet.has(status);
155
+ }
156
+ export function buildIsTerminal(status) {
157
+ return buildTerminalStatusSet.has(status);
158
+ }
148
159
  export const diagnosticSeverity = z.enum(["info", "warning", "error"]);
149
160
  // Upstream system a Diagnostic originated from. Absent when the diagnostic is
150
161
  // Stattic's own (validation, routing compile, upload policy, ...).
@@ -200,9 +211,6 @@ export const safetyCategoryValues = [
200
211
  export const safetyCategory = z.enum(safetyCategoryValues);
201
212
  // Why a review item was closed (or a space taken down): the operator's verdict
202
213
  // in one word, so enforcement quality is measurable without parsing notes.
203
- // Confirmed-* reasons say the detection was right; the tail says it wasn't
204
- // (false_positive, test_detection) or the item never needed its own verdict
205
- // (duplicate, insufficient_evidence, other).
206
214
  export const safetyResolutionReasonValues = [
207
215
  "malware_confirmed",
208
216
  "phishing_confirmed",
@@ -216,7 +224,6 @@ export const safetyResolutionReasonValues = [
216
224
  "other",
217
225
  ];
218
226
  export const safetyResolutionReason = z.enum(safetyResolutionReasonValues);
219
- // 1 = suspicious, 2 = low, 3 = medium, 4 = high, 5 = critical.
220
227
  export const SAFETY_SEVERITY = {
221
228
  suspicious: 1,
222
229
  low: 2,
@@ -2,7 +2,6 @@ export type ErrorRecovery = "retry" | "re_auth" | "fix_input" | "wait" | "contac
2
2
  export interface ErrorCodeMeta {
3
3
  /** True when an identical request may succeed on a later attempt without caller changes. */
4
4
  retryable: boolean;
5
- /** The single actionable recovery hint for this code. */
6
5
  recovery: ErrorRecovery;
7
6
  /** Copy-pasteable commands or requests an agent can run next. */
8
7
  next?: readonly string[];
@@ -74,6 +73,10 @@ export declare const ERROR_CODE_META: {
74
73
  readonly retryable: false;
75
74
  readonly recovery: "re_auth";
76
75
  };
76
+ readonly authorization_level_not_allowed: {
77
+ readonly retryable: false;
78
+ readonly recovery: "contact_support";
79
+ };
77
80
  readonly authorization_pending: {
78
81
  readonly retryable: true;
79
82
  readonly recovery: "wait";
@@ -195,6 +198,27 @@ export declare const ERROR_CODE_META: {
195
198
  readonly retryable: false;
196
199
  readonly recovery: "fix_input";
197
200
  };
201
+ readonly confirmation_denied: {
202
+ readonly retryable: false;
203
+ readonly recovery: "contact_support";
204
+ };
205
+ readonly confirmation_expired: {
206
+ readonly retryable: false;
207
+ readonly recovery: "fix_input";
208
+ };
209
+ readonly confirmation_mismatch: {
210
+ readonly retryable: false;
211
+ readonly recovery: "fix_input";
212
+ };
213
+ readonly confirmation_required: {
214
+ readonly retryable: false;
215
+ readonly recovery: "wait";
216
+ readonly next: readonly ["Open the `url` in the error details so a person can approve or deny it", "POST the `continuationToken` to /v1/actions/resume every 5 seconds", "Give up after 10 minutes, report to your human, and stop"];
217
+ };
218
+ readonly confirmation_token_required: {
219
+ readonly retryable: false;
220
+ readonly recovery: "fix_input";
221
+ };
198
222
  readonly continuation_unavailable: {
199
223
  readonly retryable: false;
200
224
  readonly recovery: "re_auth";
@@ -221,6 +245,10 @@ export declare const ERROR_CODE_META: {
221
245
  readonly retryable: false;
222
246
  readonly recovery: "re_auth";
223
247
  };
248
+ readonly credential_sponsor_inactive: {
249
+ readonly retryable: false;
250
+ readonly recovery: "contact_support";
251
+ };
224
252
  readonly csam_blocked: {
225
253
  readonly retryable: false;
226
254
  readonly recovery: "contact_support";
@@ -229,6 +257,18 @@ export declare const ERROR_CODE_META: {
229
257
  readonly retryable: false;
230
258
  readonly recovery: "contact_support";
231
259
  };
260
+ readonly dashboard_prefs_key_invalid: {
261
+ readonly retryable: false;
262
+ readonly recovery: "fix_input";
263
+ };
264
+ readonly dashboard_prefs_too_large: {
265
+ readonly retryable: false;
266
+ readonly recovery: "fix_input";
267
+ };
268
+ readonly dashboard_prefs_too_many_keys: {
269
+ readonly retryable: false;
270
+ readonly recovery: "fix_input";
271
+ };
232
272
  readonly data_location_immutable: {
233
273
  readonly retryable: false;
234
274
  readonly recovery: "fix_input";
@@ -237,6 +277,15 @@ export declare const ERROR_CODE_META: {
237
277
  readonly retryable: false;
238
278
  readonly recovery: "fix_input";
239
279
  };
280
+ readonly decision_execution_lost: {
281
+ readonly retryable: false;
282
+ readonly recovery: "fix_input";
283
+ };
284
+ readonly decision_in_progress: {
285
+ readonly retryable: true;
286
+ readonly recovery: "wait";
287
+ readonly next: readonly ["POST the continuationToken to /v1/actions/resume"];
288
+ };
240
289
  readonly device_authorization_failed: {
241
290
  readonly retryable: false;
242
291
  readonly recovery: "re_auth";
@@ -452,6 +501,18 @@ export declare const ERROR_CODE_META: {
452
501
  readonly retryable: false;
453
502
  readonly recovery: "fix_input";
454
503
  };
504
+ readonly elevation_not_required: {
505
+ readonly retryable: false;
506
+ readonly recovery: "fix_input";
507
+ };
508
+ readonly email_already_claimed: {
509
+ readonly retryable: false;
510
+ readonly recovery: "fix_input";
511
+ };
512
+ readonly email_verification_code_invalid: {
513
+ readonly retryable: false;
514
+ readonly recovery: "fix_input";
515
+ };
455
516
  readonly enforcement_policy_overlap: {
456
517
  readonly retryable: false;
457
518
  readonly recovery: "fix_input";
@@ -509,6 +570,10 @@ export declare const ERROR_CODE_META: {
509
570
  readonly retryable: true;
510
571
  readonly recovery: "wait";
511
572
  };
573
+ readonly insufficient_scope: {
574
+ readonly retryable: false;
575
+ readonly recovery: "re_auth";
576
+ };
512
577
  readonly internal_error: {
513
578
  readonly retryable: true;
514
579
  readonly recovery: "retry";
@@ -525,6 +590,10 @@ export declare const ERROR_CODE_META: {
525
590
  readonly retryable: false;
526
591
  readonly recovery: "fix_input";
527
592
  };
593
+ readonly invalid_decision_state: {
594
+ readonly retryable: false;
595
+ readonly recovery: "contact_support";
596
+ };
528
597
  readonly invalid_device_code: {
529
598
  readonly retryable: false;
530
599
  readonly recovery: "re_auth";
@@ -537,6 +606,10 @@ export declare const ERROR_CODE_META: {
537
606
  readonly retryable: false;
538
607
  readonly recovery: "fix_input";
539
608
  };
609
+ readonly invalid_elevation_request: {
610
+ readonly retryable: false;
611
+ readonly recovery: "fix_input";
612
+ };
540
613
  readonly invalid_file_path: {
541
614
  readonly retryable: false;
542
615
  readonly recovery: "fix_input";
@@ -581,6 +654,18 @@ export declare const ERROR_CODE_META: {
581
654
  readonly retryable: false;
582
655
  readonly recovery: "re_auth";
583
656
  };
657
+ readonly invalid_usage_bucket: {
658
+ readonly retryable: false;
659
+ readonly recovery: "fix_input";
660
+ };
661
+ readonly invalid_usage_correction: {
662
+ readonly retryable: false;
663
+ readonly recovery: "fix_input";
664
+ };
665
+ readonly invalid_usage_window: {
666
+ readonly retryable: false;
667
+ readonly recovery: "fix_input";
668
+ };
584
669
  readonly invalid_version_path: {
585
670
  readonly retryable: false;
586
671
  readonly recovery: "fix_input";
@@ -629,6 +714,26 @@ export declare const ERROR_CODE_META: {
629
714
  readonly retryable: false;
630
715
  readonly recovery: "contact_support";
631
716
  };
717
+ readonly issuer_exists: {
718
+ readonly retryable: false;
719
+ readonly recovery: "fix_input";
720
+ };
721
+ readonly issuer_not_active: {
722
+ readonly retryable: false;
723
+ readonly recovery: "re_auth";
724
+ };
725
+ readonly issuer_proof_invalid: {
726
+ readonly retryable: false;
727
+ readonly recovery: "fix_input";
728
+ };
729
+ readonly issuer_tenant_occupied: {
730
+ readonly retryable: false;
731
+ readonly recovery: "fix_input";
732
+ };
733
+ readonly issuer_unknown: {
734
+ readonly retryable: false;
735
+ readonly recovery: "re_auth";
736
+ };
632
737
  readonly job_not_found: {
633
738
  readonly retryable: false;
634
739
  readonly recovery: "fix_input";
@@ -710,6 +815,14 @@ export declare const ERROR_CODE_META: {
710
815
  readonly retryable: false;
711
816
  readonly recovery: "fix_input";
712
817
  };
818
+ readonly next_version_unsupported: {
819
+ readonly retryable: false;
820
+ readonly recovery: "fix_input";
821
+ };
822
+ readonly no_space_selected: {
823
+ readonly retryable: false;
824
+ readonly recovery: "fix_input";
825
+ };
713
826
  readonly noop_publish: {
714
827
  readonly retryable: false;
715
828
  readonly recovery: "fix_input";
@@ -722,6 +835,22 @@ export declare const ERROR_CODE_META: {
722
835
  readonly retryable: false;
723
836
  readonly recovery: "fix_input";
724
837
  };
838
+ readonly partner_preset_not_grantable: {
839
+ readonly retryable: false;
840
+ readonly recovery: "fix_input";
841
+ };
842
+ readonly partner_tenant_immutable_client: {
843
+ readonly retryable: false;
844
+ readonly recovery: "fix_input";
845
+ };
846
+ readonly password_already_set: {
847
+ readonly retryable: false;
848
+ readonly recovery: "fix_input";
849
+ };
850
+ readonly password_compromised: {
851
+ readonly retryable: false;
852
+ readonly recovery: "fix_input";
853
+ };
725
854
  readonly path_case_collision: {
726
855
  readonly retryable: false;
727
856
  readonly recovery: "fix_input";
@@ -738,11 +867,11 @@ export declare const ERROR_CODE_META: {
738
867
  readonly retryable: false;
739
868
  readonly recovery: "fix_input";
740
869
  };
741
- readonly placement_invalid_burstable: {
870
+ readonly plan_unknown: {
742
871
  readonly retryable: false;
743
872
  readonly recovery: "fix_input";
744
873
  };
745
- readonly platform_tenant_immutable_client: {
874
+ readonly placement_invalid_burstable: {
746
875
  readonly retryable: false;
747
876
  readonly recovery: "fix_input";
748
877
  };
@@ -755,10 +884,34 @@ export declare const ERROR_CODE_META: {
755
884
  readonly recovery: "fix_input";
756
885
  readonly next: readonly ["sf build", "Delete the archive's .meta.json sidecar if the archive contains plain files"];
757
886
  };
887
+ readonly primary_email_not_removable: {
888
+ readonly retryable: false;
889
+ readonly recovery: "fix_input";
890
+ };
891
+ readonly principal_closed: {
892
+ readonly retryable: false;
893
+ readonly recovery: "contact_support";
894
+ };
895
+ readonly principal_has_active_spaces: {
896
+ readonly retryable: false;
897
+ readonly recovery: "fix_input";
898
+ };
899
+ readonly principal_not_found: {
900
+ readonly retryable: false;
901
+ readonly recovery: "fix_input";
902
+ };
758
903
  readonly principal_space_mismatch: {
759
904
  readonly retryable: false;
760
905
  readonly recovery: "fix_input";
761
906
  };
907
+ readonly principal_suspended: {
908
+ readonly retryable: false;
909
+ readonly recovery: "contact_support";
910
+ };
911
+ readonly principal_suspension_locked: {
912
+ readonly retryable: false;
913
+ readonly recovery: "contact_support";
914
+ };
762
915
  readonly provider_error: {
763
916
  readonly retryable: true;
764
917
  readonly recovery: "retry";
@@ -787,6 +940,34 @@ export declare const ERROR_CODE_META: {
787
940
  readonly retryable: true;
788
941
  readonly recovery: "wait";
789
942
  };
943
+ readonly promotion_live_content_missing: {
944
+ readonly retryable: false;
945
+ readonly recovery: "fix_input";
946
+ };
947
+ readonly promotion_live_system_space_invalid: {
948
+ readonly retryable: false;
949
+ readonly recovery: "fix_input";
950
+ };
951
+ readonly promotion_live_system_space_not_designated: {
952
+ readonly retryable: false;
953
+ readonly recovery: "fix_input";
954
+ };
955
+ readonly promotion_not_live_tenant: {
956
+ readonly retryable: false;
957
+ readonly recovery: "fix_input";
958
+ };
959
+ readonly promotion_nothing_to_promote: {
960
+ readonly retryable: false;
961
+ readonly recovery: "fix_input";
962
+ };
963
+ readonly promotion_runtime_publish_incomplete: {
964
+ readonly retryable: true;
965
+ readonly recovery: "retry";
966
+ };
967
+ readonly promotion_test_twin_missing: {
968
+ readonly retryable: false;
969
+ readonly recovery: "fix_input";
970
+ };
790
971
  readonly proxy_upstream_denied: {
791
972
  readonly retryable: false;
792
973
  readonly recovery: "fix_input";
@@ -875,6 +1056,10 @@ export declare const ERROR_CODE_META: {
875
1056
  readonly retryable: false;
876
1057
  readonly recovery: "fix_input";
877
1058
  };
1059
+ readonly quota_exceeded: {
1060
+ readonly retryable: false;
1061
+ readonly recovery: "fix_input";
1062
+ };
878
1063
  readonly rate_limited: {
879
1064
  readonly retryable: true;
880
1065
  readonly recovery: "wait";
@@ -1013,6 +1198,10 @@ export declare const ERROR_CODE_META: {
1013
1198
  readonly retryable: false;
1014
1199
  readonly recovery: "re_auth";
1015
1200
  };
1201
+ readonly session_not_fresh: {
1202
+ readonly retryable: false;
1203
+ readonly recovery: "re_auth";
1204
+ };
1016
1205
  readonly site_already_deleted: {
1017
1206
  readonly retryable: false;
1018
1207
  readonly recovery: "fix_input";
@@ -1128,6 +1317,10 @@ export declare const ERROR_CODE_META: {
1128
1317
  readonly retryable: false;
1129
1318
  readonly recovery: "fix_input";
1130
1319
  };
1320
+ readonly space_selection_conflict: {
1321
+ readonly retryable: false;
1322
+ readonly recovery: "fix_input";
1323
+ };
1131
1324
  readonly space_transferring: {
1132
1325
  readonly retryable: false;
1133
1326
  readonly recovery: "fix_input";
@@ -1204,10 +1397,26 @@ export declare const ERROR_CODE_META: {
1204
1397
  readonly retryable: true;
1205
1398
  readonly recovery: "retry";
1206
1399
  };
1400
+ readonly superadmin_two_factor_required: {
1401
+ readonly retryable: false;
1402
+ readonly recovery: "fix_input";
1403
+ };
1404
+ readonly superadmin_wpcom_account_required: {
1405
+ readonly retryable: false;
1406
+ readonly recovery: "fix_input";
1407
+ };
1207
1408
  readonly superseded_by_publish: {
1208
1409
  readonly retryable: false;
1209
1410
  readonly recovery: "fix_input";
1210
1411
  };
1412
+ readonly system_space_conflict: {
1413
+ readonly retryable: false;
1414
+ readonly recovery: "fix_input";
1415
+ };
1416
+ readonly system_space_invalid: {
1417
+ readonly retryable: false;
1418
+ readonly recovery: "fix_input";
1419
+ };
1211
1420
  readonly takeover_notice_window: {
1212
1421
  readonly retryable: true;
1213
1422
  readonly recovery: "wait";
@@ -1224,6 +1433,10 @@ export declare const ERROR_CODE_META: {
1224
1433
  readonly retryable: false;
1225
1434
  readonly recovery: "fix_input";
1226
1435
  };
1436
+ readonly team_scope_mismatch: {
1437
+ readonly retryable: false;
1438
+ readonly recovery: "fix_input";
1439
+ };
1227
1440
  readonly team_slug_conflict: {
1228
1441
  readonly retryable: false;
1229
1442
  readonly recovery: "fix_input";
@@ -1268,6 +1481,42 @@ export declare const ERROR_CODE_META: {
1268
1481
  readonly retryable: false;
1269
1482
  readonly recovery: "fix_input";
1270
1483
  };
1484
+ readonly token_alg_invalid: {
1485
+ readonly retryable: false;
1486
+ readonly recovery: "re_auth";
1487
+ };
1488
+ readonly token_audience_mismatch: {
1489
+ readonly retryable: false;
1490
+ readonly recovery: "re_auth";
1491
+ };
1492
+ readonly token_claims_invalid: {
1493
+ readonly retryable: false;
1494
+ readonly recovery: "re_auth";
1495
+ };
1496
+ readonly token_header_forbidden: {
1497
+ readonly retryable: false;
1498
+ readonly recovery: "re_auth";
1499
+ };
1500
+ readonly token_malformed: {
1501
+ readonly retryable: false;
1502
+ readonly recovery: "re_auth";
1503
+ };
1504
+ readonly token_signature_invalid: {
1505
+ readonly retryable: false;
1506
+ readonly recovery: "re_auth";
1507
+ };
1508
+ readonly token_subject_invalid: {
1509
+ readonly retryable: false;
1510
+ readonly recovery: "re_auth";
1511
+ };
1512
+ readonly token_ttl_invalid: {
1513
+ readonly retryable: false;
1514
+ readonly recovery: "re_auth";
1515
+ };
1516
+ readonly token_type_invalid: {
1517
+ readonly retryable: false;
1518
+ readonly recovery: "re_auth";
1519
+ };
1271
1520
  readonly transfer_cross_tenant_unsupported: {
1272
1521
  readonly retryable: false;
1273
1522
  readonly recovery: "fix_input";
@@ -1316,6 +1565,10 @@ export declare const ERROR_CODE_META: {
1316
1565
  readonly retryable: false;
1317
1566
  readonly recovery: "fix_input";
1318
1567
  };
1568
+ readonly usage_period_not_found: {
1569
+ readonly retryable: false;
1570
+ readonly recovery: "fix_input";
1571
+ };
1319
1572
  readonly user_banned: {
1320
1573
  readonly retryable: false;
1321
1574
  readonly recovery: "contact_support";
@@ -1416,6 +1669,10 @@ export declare const ERROR_CODE_META: {
1416
1669
  readonly retryable: false;
1417
1670
  readonly recovery: "fix_input";
1418
1671
  };
1672
+ readonly webhook_managed_by_manifest: {
1673
+ readonly retryable: false;
1674
+ readonly recovery: "fix_input";
1675
+ };
1419
1676
  readonly whois_unavailable: {
1420
1677
  readonly retryable: true;
1421
1678
  readonly recovery: "retry";
@@ -1688,10 +1945,18 @@ export declare const ERROR_CODE_META: {
1688
1945
  readonly retryable: false;
1689
1946
  readonly recovery: "fix_input";
1690
1947
  };
1948
+ readonly zero_email_unavailable: {
1949
+ readonly retryable: false;
1950
+ readonly recovery: "fix_input";
1951
+ };
1691
1952
  readonly zero_envelope_encode_failed: {
1692
1953
  readonly retryable: true;
1693
1954
  readonly recovery: "retry";
1694
1955
  };
1956
+ readonly zero_gravatar_unavailable: {
1957
+ readonly retryable: false;
1958
+ readonly recovery: "fix_input";
1959
+ };
1695
1960
  readonly zero_js_context_init_failed: {
1696
1961
  readonly retryable: true;
1697
1962
  readonly recovery: "retry";
@@ -1856,13 +2121,14 @@ export declare const ERROR_CODE_META: {
1856
2121
  readonly retryable: false;
1857
2122
  readonly recovery: "fix_input";
1858
2123
  };
2124
+ readonly zero_spam_unavailable: {
2125
+ readonly retryable: false;
2126
+ readonly recovery: "fix_input";
2127
+ };
1859
2128
  readonly zero_runs_too_many: {
1860
2129
  readonly retryable: false;
1861
2130
  readonly recovery: "fix_input";
1862
2131
  };
1863
2132
  };
1864
- /**
1865
- * Resolve the metadata for an error code, degrading to a safe `contact_support` default for
1866
- * codes outside the table (dynamic provider passthrough, codes from a newer control plane).
1867
- */
2133
+ /** Metadata for an error code, or `DEFAULT_ERROR_CODE_META` when it is outside the table. */
1868
2134
  export declare function errorCodeMeta(code: string): ErrorCodeMeta;