@spacefast/common 0.0.24 → 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 (320) hide show
  1. package/brand-assets/LICENSE-Haskoy.txt +93 -0
  2. package/brand-assets/haskoy-latin-variable.woff2 +0 -0
  3. package/brand-assets/spacefast-favicon.svg +4 -4
  4. package/brand-assets/spacefast-sf-full-bleed.svg +3 -3
  5. package/brand-assets/spacefast-wordmark.svg +2 -4
  6. package/dist/agents/connect-targets.d.ts +6 -146
  7. package/dist/agents/connect-targets.js +63 -295
  8. package/dist/agents/private-key-oauth.d.ts +31 -2
  9. package/dist/agents/private-key-oauth.js +166 -92
  10. package/dist/agents/registry/core.d.ts +292 -0
  11. package/dist/agents/registry/core.js +1388 -0
  12. package/dist/agents/registry/deeplink-probes.d.ts +23 -0
  13. package/dist/agents/registry/deeplink-probes.js +18 -0
  14. package/dist/agents/registry/node.d.ts +56 -0
  15. package/dist/agents/registry/node.js +339 -0
  16. package/dist/brand-assets-build.js +3 -6
  17. package/dist/brand-assets.d.ts +5 -15
  18. package/dist/brand-assets.js +12 -14
  19. package/dist/brand.d.ts +17 -0
  20. package/dist/brand.js +24 -4
  21. package/dist/config/domains.d.ts +79 -12
  22. package/dist/config/domains.js +128 -29
  23. package/dist/config/index.js +1 -2
  24. package/dist/contracts/abuse.js +9 -24
  25. package/dist/contracts/access-profiles.d.ts +86 -0
  26. package/dist/contracts/access-profiles.js +89 -0
  27. package/dist/contracts/access.d.ts +24 -30
  28. package/dist/contracts/access.js +33 -64
  29. package/dist/contracts/activity.d.ts +18 -1
  30. package/dist/contracts/activity.js +72 -26
  31. package/dist/contracts/analytics.js +8 -10
  32. package/dist/contracts/api-keys.d.ts +77 -52
  33. package/dist/contracts/api-keys.js +44 -24
  34. package/dist/contracts/application-journal.d.ts +216 -0
  35. package/dist/contracts/application-journal.js +167 -0
  36. package/dist/contracts/auth.d.ts +90 -17
  37. package/dist/contracts/auth.js +86 -17
  38. package/dist/contracts/beta.d.ts +9 -4
  39. package/dist/contracts/beta.js +20 -16
  40. package/dist/contracts/billing.d.ts +2 -1
  41. package/dist/contracts/billing.js +37 -11
  42. package/dist/contracts/bootstrap.d.ts +791 -0
  43. package/dist/contracts/bootstrap.js +51 -0
  44. package/dist/contracts/builds.d.ts +209 -18
  45. package/dist/contracts/builds.js +93 -27
  46. package/dist/contracts/channels.d.ts +43 -0
  47. package/dist/contracts/channels.js +25 -9
  48. package/dist/contracts/cli.d.ts +7 -0
  49. package/dist/contracts/cli.js +6 -0
  50. package/dist/contracts/collab-public.d.ts +1 -1
  51. package/dist/contracts/collab-public.js +5 -8
  52. package/dist/contracts/comments.d.ts +44 -34
  53. package/dist/contracts/comments.js +107 -77
  54. package/dist/contracts/commerce.d.ts +165 -0
  55. package/dist/contracts/commerce.js +146 -0
  56. package/dist/contracts/common.d.ts +3 -3
  57. package/dist/contracts/common.js +20 -31
  58. package/dist/contracts/content-contract-verification.d.ts +521 -0
  59. package/dist/contracts/content-contract-verification.js +320 -0
  60. package/dist/contracts/content-platform-fixture.d.ts +1278 -0
  61. package/dist/contracts/content-platform-fixture.js +44 -0
  62. package/dist/contracts/content-program.d.ts +994 -0
  63. package/dist/contracts/content-program.js +658 -0
  64. package/dist/contracts/content-sync.d.ts +290 -0
  65. package/dist/contracts/content-sync.js +167 -0
  66. package/dist/contracts/content.d.ts +432 -0
  67. package/dist/contracts/content.js +303 -0
  68. package/dist/contracts/continuation.d.ts +17 -1
  69. package/dist/contracts/continuation.js +23 -23
  70. package/dist/contracts/countries.js +3 -4
  71. package/dist/contracts/crons.d.ts +52 -0
  72. package/dist/contracts/crons.js +60 -0
  73. package/dist/contracts/dashboard-prefs.d.ts +56 -0
  74. package/dist/contracts/dashboard-prefs.js +51 -0
  75. package/dist/contracts/device-auth.d.ts +234 -37
  76. package/dist/contracts/device-auth.js +267 -53
  77. package/dist/contracts/docs.d.ts +1 -5
  78. package/dist/contracts/docs.js +7 -15
  79. package/dist/contracts/domains.d.ts +501 -93
  80. package/dist/contracts/domains.js +193 -55
  81. package/dist/contracts/email-preferences.d.ts +3 -3
  82. package/dist/contracts/email-preferences.js +6 -7
  83. package/dist/contracts/enums.d.ts +27 -26
  84. package/dist/contracts/enums.js +68 -61
  85. package/dist/contracts/error-code-meta.d.ts +283 -7
  86. package/dist/contracts/error-code-meta.js +97 -5
  87. package/dist/contracts/error-codes.d.ts +5 -5
  88. package/dist/contracts/error-codes.js +82 -17
  89. package/dist/contracts/events.d.ts +100 -20
  90. package/dist/contracts/events.js +107 -20
  91. package/dist/contracts/execution.d.ts +48 -64
  92. package/dist/contracts/execution.js +52 -62
  93. package/dist/contracts/feature-lifecycle.d.ts +73 -27
  94. package/dist/contracts/feature-lifecycle.js +86 -26
  95. package/dist/contracts/features.d.ts +68 -19
  96. package/dist/contracts/features.js +42 -41
  97. package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
  98. package/dist/contracts/frame-session.d.ts +192 -0
  99. package/dist/contracts/frame-session.js +164 -0
  100. package/dist/contracts/functions.d.ts +338 -164
  101. package/dist/contracts/functions.js +367 -198
  102. package/dist/contracts/git.d.ts +27 -33
  103. package/dist/contracts/git.js +10 -11
  104. package/dist/contracts/grant-copy.d.ts +43 -0
  105. package/dist/contracts/grant-copy.js +44 -0
  106. package/dist/contracts/grants.d.ts +62 -54
  107. package/dist/contracts/grants.js +124 -23
  108. package/dist/contracts/ids.d.ts +4 -1
  109. package/dist/contracts/ids.js +6 -3
  110. package/dist/contracts/internal.d.ts +8 -18
  111. package/dist/contracts/internal.js +13 -14
  112. package/dist/contracts/mcp.d.ts +28 -0
  113. package/dist/contracts/mcp.js +28 -0
  114. package/dist/contracts/me.d.ts +6 -1
  115. package/dist/contracts/me.js +12 -6
  116. package/dist/contracts/notifications.d.ts +27 -29
  117. package/dist/contracts/notifications.js +9 -4
  118. package/dist/contracts/oauth-resources.d.ts +112 -10
  119. package/dist/contracts/oauth-resources.js +116 -11
  120. package/dist/contracts/oauth-scope-actions.d.ts +90 -0
  121. package/dist/contracts/oauth-scope-actions.js +126 -0
  122. package/dist/contracts/operations.d.ts +27 -4
  123. package/dist/contracts/operations.js +12 -6
  124. package/dist/contracts/pages.d.ts +31 -7
  125. package/dist/contracts/pages.js +22 -5
  126. package/dist/contracts/partner-notifications.d.ts +3 -0
  127. package/dist/contracts/partner-notifications.js +65 -0
  128. package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
  129. package/dist/contracts/{platform.js → partner.js} +27 -40
  130. package/dist/contracts/plan-policy.js +1 -1
  131. package/dist/contracts/principal-assertion.d.ts +43 -0
  132. package/dist/contracts/principal-assertion.js +67 -0
  133. package/dist/contracts/principals.d.ts +73 -0
  134. package/dist/contracts/principals.js +59 -0
  135. package/dist/contracts/privacy.d.ts +11 -0
  136. package/dist/contracts/privacy.js +17 -0
  137. package/dist/contracts/problem-document.js +3 -4
  138. package/dist/contracts/publish-archive.d.ts +269 -161
  139. package/dist/contracts/publish-archive.js +11 -1
  140. package/dist/contracts/push-new.d.ts +8 -8
  141. package/dist/contracts/quotas.js +5 -5
  142. package/dist/contracts/realtime.d.ts +52 -0
  143. package/dist/contracts/realtime.js +54 -0
  144. package/dist/contracts/repository-connections.d.ts +44 -31
  145. package/dist/contracts/repository-connections.js +17 -5
  146. package/dist/contracts/resources.d.ts +105 -14
  147. package/dist/contracts/resources.js +150 -26
  148. package/dist/contracts/route-inventory.d.ts +358 -0
  149. package/dist/contracts/route-inventory.js +141 -0
  150. package/dist/contracts/runtime-api.d.ts +206 -82
  151. package/dist/contracts/runtime-api.js +131 -70
  152. package/dist/contracts/runtime-app.d.ts +13 -23
  153. package/dist/contracts/runtime-app.js +39 -24
  154. package/dist/contracts/runtime-components.d.ts +143 -0
  155. package/dist/contracts/runtime-components.js +199 -0
  156. package/dist/contracts/runtime-db.d.ts +49 -23
  157. package/dist/contracts/runtime-db.js +87 -22
  158. package/dist/contracts/runtime-purge.d.ts +8 -0
  159. package/dist/contracts/runtime-purge.js +5 -0
  160. package/dist/contracts/runtime-services.d.ts +43 -75
  161. package/dist/contracts/runtime-services.js +29 -49
  162. package/dist/contracts/runtime-storage.d.ts +15 -14
  163. package/dist/contracts/runtime-storage.js +30 -14
  164. package/dist/contracts/sf-config-v1.d.ts +48 -14
  165. package/dist/contracts/slugs.js +13 -4
  166. package/dist/contracts/space-config.d.ts +283 -19
  167. package/dist/contracts/space-config.js +430 -80
  168. package/dist/contracts/spaces.d.ts +376 -290
  169. package/dist/contracts/spaces.js +200 -135
  170. package/dist/contracts/superadmin-activity.d.ts +3 -43
  171. package/dist/contracts/superadmin-activity.js +6 -30
  172. package/dist/contracts/superadmin-emails.d.ts +1 -0
  173. package/dist/contracts/superadmin-emails.js +17 -1
  174. package/dist/contracts/superadmin-runtime.d.ts +199 -0
  175. package/dist/contracts/superadmin-runtime.js +141 -0
  176. package/dist/contracts/superadmin-search.d.ts +22 -2
  177. package/dist/contracts/superadmin-search.js +14 -6
  178. package/dist/contracts/superadmin-spaces.d.ts +438 -189
  179. package/dist/contracts/superadmin-spaces.js +131 -25
  180. package/dist/contracts/superadmin-teams.d.ts +5 -2
  181. package/dist/contracts/superadmin-teams.js +1 -2
  182. package/dist/contracts/superadmin-tenants.d.ts +627 -12
  183. package/dist/contracts/superadmin-tenants.js +32 -13
  184. package/dist/contracts/superadmin.d.ts +232 -37
  185. package/dist/contracts/superadmin.js +106 -22
  186. package/dist/contracts/tags.d.ts +85 -58
  187. package/dist/contracts/tags.js +47 -37
  188. package/dist/contracts/teams.d.ts +86 -26
  189. package/dist/contracts/teams.js +90 -31
  190. package/dist/contracts/tenants.d.ts +135 -0
  191. package/dist/contracts/tenants.js +120 -0
  192. package/dist/contracts/test-triggers.d.ts +70 -0
  193. package/dist/contracts/test-triggers.js +116 -0
  194. package/dist/contracts/theme-json.js +3 -8
  195. package/dist/contracts/transfers.d.ts +1 -0
  196. package/dist/contracts/transfers.js +3 -2
  197. package/dist/contracts/usage.d.ts +209 -0
  198. package/dist/contracts/usage.js +124 -12
  199. package/dist/contracts/variables.d.ts +2 -2
  200. package/dist/contracts/variables.js +9 -13
  201. package/dist/contracts/webhooks.d.ts +13 -5
  202. package/dist/contracts/webhooks.js +3 -1
  203. package/dist/contracts/zero.d.ts +72 -81
  204. package/dist/contracts/zero.js +80 -78
  205. package/dist/dashboard-paths/index.d.ts +24 -21
  206. package/dist/dashboard-paths/index.js +35 -47
  207. package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
  208. package/dist/dashboard-paths/route-reservations.generated.js +36 -0
  209. package/dist/docs/agent-arrival.d.ts +92 -0
  210. package/dist/docs/agent-arrival.js +227 -0
  211. package/dist/docs/agent-output-policy.d.ts +6 -0
  212. package/dist/docs/agent-output-policy.js +22 -0
  213. package/dist/docs/agent-prose.d.ts +12 -18
  214. package/dist/docs/agent-prose.js +73 -51
  215. package/dist/docs/agent-setup.d.ts +72 -41
  216. package/dist/docs/agent-setup.js +339 -436
  217. package/dist/docs/catalog.d.ts +153 -95
  218. package/dist/docs/catalog.js +163 -48
  219. package/dist/docs/error-docs.d.ts +2098 -1
  220. package/dist/docs/error-docs.js +421 -144
  221. package/dist/docs/index-build.d.ts +0 -1
  222. package/dist/docs/index-build.js +2 -3
  223. package/dist/docs/page-context-prompt.d.ts +77 -0
  224. package/dist/docs/page-context-prompt.js +131 -0
  225. package/dist/docs/reference-urls.d.ts +46 -0
  226. package/dist/docs/reference-urls.js +79 -0
  227. package/dist/docs/search.d.ts +6 -8
  228. package/dist/docs/search.js +10 -13
  229. package/dist/docs/skill-distribution.d.ts +4 -1
  230. package/dist/docs/skill-distribution.js +10 -5
  231. package/dist/docs/skills.d.ts +120 -120
  232. package/dist/docs/skills.js +121 -73
  233. package/dist/docs/start-prompts.d.ts +45 -0
  234. package/dist/docs/start-prompts.js +62 -0
  235. package/dist/domain-exploration.js +9 -13
  236. package/dist/og-template.d.ts +56 -0
  237. package/dist/og-template.js +56 -0
  238. package/dist/slug-policy/index.js +5 -11
  239. package/dist/test-helpers/fetch-stub.js +1 -0
  240. package/dist/utils/browser-credential.d.ts +13 -6
  241. package/dist/utils/browser-credential.js +14 -7
  242. package/dist/utils/build-settings.d.ts +21 -1
  243. package/dist/utils/build-settings.js +133 -15
  244. package/dist/utils/canonical-json.d.ts +3 -5
  245. package/dist/utils/canonical-json.js +4 -5
  246. package/dist/utils/cast-transport.d.ts +5 -17
  247. package/dist/utils/cast-transport.js +6 -19
  248. package/dist/utils/claim-token.js +1 -2
  249. package/dist/utils/comment-avatars.js +4 -6
  250. package/dist/utils/concurrency.js +3 -3
  251. package/dist/utils/content-type.d.ts +7 -6
  252. package/dist/utils/content-type.js +73 -51
  253. package/dist/utils/credential-policy.d.ts +50 -6
  254. package/dist/utils/credential-policy.js +126 -59
  255. package/dist/utils/dns-instructions.js +9 -9
  256. package/dist/utils/egress-policy.fixtures.json +1 -1
  257. package/dist/utils/error-code.js +1 -0
  258. package/dist/utils/generate-space-name.d.ts +3 -8
  259. package/dist/utils/generate-space-name.js +3 -8
  260. package/dist/utils/grant-decision.fixtures.json +2 -2
  261. package/dist/utils/grants.d.ts +0 -1
  262. package/dist/utils/grants.js +7 -8
  263. package/dist/utils/gravatar.d.ts +2 -4
  264. package/dist/utils/gravatar.js +6 -12
  265. package/dist/utils/id-hints.js +14 -23
  266. package/dist/utils/idempotency.d.ts +3 -3
  267. package/dist/utils/idempotency.js +6 -7
  268. package/dist/utils/local-space-state.d.ts +23 -26
  269. package/dist/utils/local-space-state.js +46 -46
  270. package/dist/utils/oauth-signed-query.d.ts +3 -5
  271. package/dist/utils/oauth-signed-query.js +6 -9
  272. package/dist/utils/one-shot-replay.d.ts +7 -6
  273. package/dist/utils/one-shot-replay.js +3 -5
  274. package/dist/utils/page-colors.d.ts +15 -19
  275. package/dist/utils/page-colors.js +23 -45
  276. package/dist/utils/page-fonts.d.ts +1 -1
  277. package/dist/utils/page-fonts.js +8 -20
  278. package/dist/utils/page-preview.d.ts +0 -1
  279. package/dist/utils/page-preview.js +0 -1
  280. package/dist/utils/pages.d.ts +33 -3
  281. package/dist/utils/pages.js +83 -30
  282. package/dist/utils/privacy-regions.d.ts +19 -0
  283. package/dist/utils/privacy-regions.js +91 -0
  284. package/dist/utils/publish-form-data.d.ts +4 -5
  285. package/dist/utils/publish-form-data.js +2 -3
  286. package/dist/utils/publish-policy.d.ts +11 -17
  287. package/dist/utils/publish-policy.fixtures.json +11 -5
  288. package/dist/utils/publish-policy.js +65 -110
  289. package/dist/utils/query-client.d.ts +2 -0
  290. package/dist/utils/query-client.js +10 -1
  291. package/dist/utils/runtime-paths.d.ts +4 -4
  292. package/dist/utils/runtime-paths.js +6 -8
  293. package/dist/utils/runtime-upload.d.ts +9 -0
  294. package/dist/utils/runtime-upload.js +12 -0
  295. package/dist/utils/secure-local-file.d.ts +3 -3
  296. package/dist/utils/secure-local-file.js +23 -40
  297. package/dist/utils/space-config.d.ts +12 -15
  298. package/dist/utils/space-config.js +13 -16
  299. package/dist/utils/static-runtime-policy.d.ts +10 -7
  300. package/dist/utils/static-runtime-policy.fixtures.json +38 -41
  301. package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
  302. package/dist/utils/static-runtime-policy.generated.js +70 -0
  303. package/dist/utils/static-runtime-policy.js +31 -132
  304. package/dist/utils/storage-policy.js +1 -2
  305. package/dist/utils/upload-session.d.ts +4 -1
  306. package/dist/utils/upload-session.js +41 -19
  307. package/dist/utils/version-path.js +11 -19
  308. package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
  309. package/dist/utils/wpcom-auth-redirects.js +1 -4
  310. package/dist/vocabulary.d.ts +13 -13
  311. package/dist/vocabulary.js +52 -27
  312. package/package.json +15 -18
  313. package/dist/agents/client-registry.d.ts +0 -22
  314. package/dist/agents/client-registry.js +0 -41
  315. package/dist/docs/agent-handoff-document.d.ts +0 -15
  316. package/dist/docs/agent-handoff-document.js +0 -180
  317. package/dist/docs/agent-solutions.d.ts +0 -110
  318. package/dist/docs/agent-solutions.js +0 -183
  319. package/dist/utils/query-keys.d.ts +0 -84
  320. package/dist/utils/query-keys.js +0 -108
@@ -1,17 +1,19 @@
1
1
  import { z } from "zod";
2
2
  import { SPACE_SLUG_MAX_LENGTH } from "../slug-policy/index.js";
3
3
  import { normalizeVersionPath } from "../utils/version-path.js";
4
- import { publishedAccessSchema } from "./access.js";
4
+ import { accessRoleSchema, publishedAccessSchema } from "./access.js";
5
5
  import { AsyncOperationSchema, baseDiagnosticSchema, CursorPaginationSchema, cursorListQuerySchema, } from "./common.js";
6
6
  import { versionStatus, spaceStatus } from "./enums.js";
7
- import { conventionFilesSchema, uploadInstructionsSchema, manifestFileSchema, uploadManifestFileSchema, } from "./internal.js";
8
- import { VersionSchema, PublishSourceSchema, SpaceSchema, spaceSettingsDigestSchema, } from "./resources.js";
7
+ import { runtimeInternalArtifactPath } from "./execution.js";
8
+ import { uploadInstructionsSchema, manifestFileSchema } from "./internal.js";
9
+ import { VersionSchema, PublishSourceSchema, SpaceSchema, spaceGitSchema, spaceSettingsDigestSchema, } from "./resources.js";
9
10
  import { runtimeAppSchema } from "./runtime-app.js";
10
11
  import { SPACE_CONFIG_ACCEPTED_FILES, spaceConfigSchema, spacePlacementConfigSchema, } from "./space-config.js";
11
12
  import { principalIdSchema } from "./transfers.js";
12
- // Capacity accounting for the provider site a space runs on. A space IS a
13
- // site, so occupancy is not a question storage is. Warm-pool inventory rows
14
- // carry the same shape before a space adopts them.
13
+ export const VERSION_BUILD_LOG_MAX_LENGTH = 512 * 1024;
14
+ // Capacity accounting for the provider site a space runs on. A space IS a site,
15
+ // so the only question is storage, not occupancy. Warm-pool inventory rows carry
16
+ // the same shape before a space adopts them.
15
17
  export const SpaceCapacitySchema = z
16
18
  .object({
17
19
  storageBytes: z
@@ -22,31 +24,6 @@ export const SpaceCapacitySchema = z
22
24
  .describe("Storage budget for the space in bytes."),
23
25
  })
24
26
  .describe("Capacity accounting for a space's provider site.");
25
- export const SpacePressureSchema = z
26
- .object({
27
- ewmaLimitedPct: z.number().nonnegative().optional(),
28
- ewma429: z.number().nonnegative().optional(),
29
- ewma429PerMin: z.number().nonnegative().optional(),
30
- ewmaWorkersMax: z.number().nonnegative().optional(),
31
- ewmaCpuPct: z.number().nonnegative().optional(),
32
- lastSampleAt: z.string().datetime().optional(),
33
- consecutivePressured: z.number().int().nonnegative().optional(),
34
- consecutiveClean: z.number().int().nonnegative().optional(),
35
- // Monotonic CAS token shared by explicit operator hold actions and the
36
- // pressure sampler. Every durable hold transition advances it, including
37
- // transitions that restore a prior timestamp.
38
- placementHoldRevision: z.number().int().nonnegative().optional(),
39
- // Provenance stamp for the sampler's automatic hold: set on trip to the
40
- // exact hold instant it wrote, so release only clears holds the pressure
41
- // pipeline itself set — never an operator-set placement hold.
42
- pressureHoldUntil: z.string().datetime().optional(),
43
- // Last time a bulk-lane engine job on this space reported activity via the
44
- // job callbacks (runtime/callback-events.ts); the sampler discounts the
45
- // CPU signal while this is within the sampling window.
46
- lastBulkLaneActivityAt: z.string().datetime().optional(),
47
- })
48
- .passthrough()
49
- .describe("Placement pressure signals computed outside the request path.");
50
27
  export const spaceClaimReceiptSchema = z.object({
51
28
  key: z
52
29
  .string()
@@ -55,7 +32,7 @@ export const spaceClaimReceiptSchema = z.object({
55
32
  url: z
56
33
  .string()
57
34
  .url()
58
- .describe("The site door: the live URL with the space key in /__/<key> form. Opening it exchanges the key for a private view session and lands on the site. Same key, URL form share it as carefully as the key."),
35
+ .describe("The site door: the live URL with the space key in /__/<key> form. Opening it exchanges the key for a private view session and lands on the site. It is the same key in URL form, so share it as carefully as the key."),
59
36
  claimUrl: z
60
37
  .string()
61
38
  .url()
@@ -67,16 +44,16 @@ export const SpaceCreateResponseSchema = z.object({
67
44
  access: publishedAccessSchema,
68
45
  claim: spaceClaimReceiptSchema.optional(),
69
46
  });
70
- // Stored per-version diagnostic surfaced on the space diagnostics feed: the shared
71
- // Diagnostic shape (contracts/common.ts) plus persistence identity.
47
+ // The shared Diagnostic shape (contracts/common.ts) plus persistence identity.
72
48
  export const spaceDiagnosticSchema = baseDiagnosticSchema.extend({
73
49
  id: z.string().describe("Stable diagnostic record id."),
74
50
  versionId: z.string().describe("Version the diagnostic was recorded against."),
75
51
  createdAt: z.string().datetime(),
76
52
  });
53
+ // The current diagnostic set for a space, returned whole: the route takes no
54
+ // query at all, so there is no cursor to advertise.
77
55
  export const spaceDiagnosticListResponseSchema = z.object({
78
56
  data: z.array(spaceDiagnosticSchema),
79
- pagination: CursorPaginationSchema,
80
57
  });
81
58
  export const principalRefInputSchema = z.object({
82
59
  type: z.enum(["team", "external"]).describe("Owning principal kind."),
@@ -128,6 +105,10 @@ export const spacePatchSchema = z
128
105
  .boolean()
129
106
  .optional()
130
107
  .describe("Hide the live production site from search engines. This applies only to live hostnames of claimed spaces. Preview and version hostnames are always noindex."),
108
+ pinned: z
109
+ .boolean()
110
+ .optional()
111
+ .describe("Pin the space to the top of its team's space list, for everyone on the team. This is presentation only: it never changes what the space serves."),
131
112
  })
132
113
  .strict()
133
114
  .superRefine((value, ctx) => {
@@ -146,10 +127,8 @@ export const spacePatchSchema = z
146
127
  });
147
128
  }
148
129
  });
149
- // The one claim endpoint (POST /v1/claim). A converging loop: the caller sends
150
- // what it has decided so far; the server either commits the claim or answers
151
- // with the single decision still missing (`login_required`, `team_required`,
152
- // `consent_required`).
130
+ // POST /v1/claim returns the one missing decision or commits the claim. The
131
+ // caller repeats the request with each completed decision.
153
132
  export const anonymousClaimSchema = z.object({
154
133
  key: z
155
134
  .string()
@@ -184,7 +163,9 @@ export const anonymousClaimSharingSummarySchema = z.object({
184
163
  status: z.enum(["pending", "accepted"]),
185
164
  grants: z.array(z.object({
186
165
  scope: z.string().startsWith("/"),
187
- role: z.enum(["viewer", "commenter", "editor"]),
166
+ // The person's Grant carries a full access role; narrowing it here
167
+ // used to make a `manager` share unrepresentable in a claim preview.
168
+ role: accessRoleSchema,
188
169
  })),
189
170
  })),
190
171
  links: z.array(z.object({
@@ -282,9 +263,8 @@ export const spaceClaimReminderSchema = z.object({
282
263
  export const spaceClaimReminderResponseSchema = z.object({
283
264
  accepted: z.literal(true),
284
265
  });
285
- // Shared by spaceVersionCreateSchema and publishRequestSchema: both accept the
286
- // same manifest-mutation fields and enforce the same "requires a declared
287
- // files manifest / snapshot mode" rules on them.
266
+ // Shared by spaceVersionCreateSchema and publishRequestSchema, which enforce
267
+ // the same snapshot-mode rules on these fields.
288
268
  const manifestMutationFieldsSchema = {
289
269
  deletePaths: z
290
270
  .array(z.string().min(1))
@@ -319,19 +299,16 @@ export const spaceVersionCreateSchema = z
319
299
  .describe("Additional control-plane-only provenance for build and deploy read models."),
320
300
  buildLog: z
321
301
  .string()
322
- .max(64_000)
302
+ .max(VERSION_BUILD_LOG_MAX_LENGTH)
323
303
  .optional()
324
304
  .describe("Build transcript truncated to a bounded size for deploys that ran a local build before publishing."),
325
- conventionFiles: conventionFilesSchema
326
- .optional()
327
- .describe("Routing convention contents used when deciding whether this publish is unchanged. The same values are supplied again when the version is finalized."),
328
305
  finalize: z
329
306
  .object({ channel: z.literal("live").nullable().optional() })
330
307
  .optional()
331
308
  .describe("Finalize intent for a declared upload. When every declared file lands, the version finalizes itself; the explicit finalize call remains available for recovery and replay."),
332
309
  files: z
333
- .array(uploadManifestFileSchema)
334
- .describe("The complete desired file manifest. Local-byte entries require `sha256` and are uploaded to a content-addressed target. A `sourceUrl` entry may omit `sha256` because the runtime computes it while fetching. Hashes also let updates skip unchanged files."),
310
+ .array(manifestFileSchema)
311
+ .describe("The complete desired file manifest. `sha256` is optional: omit it to upload by path and let the runtime hash the bytes, or include it to upload by content address, with the digest verified as the bytes land. A `sourceUrl` entry is fetched and hashed by the runtime."),
335
312
  ...manifestMutationFieldsSchema,
336
313
  })
337
314
  .superRefine(refineManifestMutationRules);
@@ -358,10 +335,10 @@ export const versionLogEntrySchema = z.object({
358
335
  code: z.string().describe("Stable version.{status} code for the line."),
359
336
  message: z.string().describe("Human-readable log line."),
360
337
  });
361
- export const VERSION_BUILD_LOG_MAX_LENGTH = 512 * 1024;
338
+ // A version's log is a bounded record `limit` truncates; it never pages, so it
339
+ // declares no cursor.
362
340
  export const versionLogListResponseSchema = z.object({
363
341
  data: z.array(versionLogEntrySchema),
364
- pagination: CursorPaginationSchema,
365
342
  });
366
343
  export const spaceVersionGeneratedPreviewSchema = z.object({
367
344
  kind: z.literal("image"),
@@ -415,8 +392,21 @@ export const spaceFilesResponseSchema = z.object({
415
392
  index: spaceVersionFileIndexSchema,
416
393
  search: spaceVersionFilesSearchSchema,
417
394
  });
395
+ const externalVersionFilePathSchema = z
396
+ .string()
397
+ .min(1)
398
+ .refine((value) => {
399
+ try {
400
+ return !runtimeInternalArtifactPath(normalizeVersionPath(value));
401
+ }
402
+ catch {
403
+ return false;
404
+ }
405
+ }, {
406
+ message: "Path must be version-relative and cannot address runtime-internal artifacts.",
407
+ });
418
408
  export const spaceVersionFilePathQuerySchema = z.object({
419
- path: z.string().min(1),
409
+ path: externalVersionFilePathSchema,
420
410
  });
421
411
  /**
422
412
  * Which representation of a path the runtime should hand back: `source` is the
@@ -425,28 +415,17 @@ export const spaceVersionFilePathQuerySchema = z.object({
425
415
  * absent from `served`.
426
416
  */
427
417
  export const spaceVersionFileViewSchema = z.enum(["source", "served"]);
428
- // Minting is a read, so it rides the URL and a URL has a practical ceiling
429
- // that a JSON body does not. Clients chunk; each chunk is one authorization.
418
+ // Minting is a read, so it rides the URL, which has a practical ceiling a JSON
419
+ // body does not. Clients chunk; each chunk is one authorization.
430
420
  export const VERSION_FILE_LINKS_MAX_PATHS = 200;
431
421
  // Structural admission only. Whether the version HOLDS a path is the runtime's
432
- // answer, given when the link is followed the control plane keeps no catalog
433
- // to check against and does not round-trip per path to fake one.
434
- const spaceVersionFileLinkPathSchema = z
435
- .string()
436
- .min(1)
437
- .refine((value) => {
438
- try {
439
- normalizeVersionPath(value);
440
- return true;
441
- }
442
- catch {
443
- return false;
444
- }
445
- }, { message: "Path must be version-relative, without traversal or control characters." });
422
+ // answer, given when the link is followed; the control plane keeps no catalog
423
+ // to check against.
424
+ const spaceVersionFileLinkPathSchema = externalVersionFilePathSchema;
446
425
  /**
447
- * Repeated `path` query parameters `?path=index.html&path=about.html`. One
448
- * path arrives as a bare string, so it is lifted into the batch shape before
449
- * the per-path rules run.
426
+ * Repeated `path` query parameters, for example
427
+ * `?path=index.html&path=about.html`. One path arrives as a bare string, so it
428
+ * is lifted into the batch shape before the per-path rules run.
450
429
  */
451
430
  export const spaceVersionFileLinksQuerySchema = z.object({
452
431
  path: z
@@ -461,7 +440,7 @@ export const spaceVersionFileLinkSchema = z.object({
461
440
  expiresAt: z.string().describe("When the link stops working."),
462
441
  });
463
442
  /**
464
- * Minting is blind to path validity the control plane authorizes the version,
443
+ * Minting is blind to path validity. The control plane authorizes the version,
465
444
  * not the path. A path that is not in the selected catalog view answers
466
445
  * `version_file_not_found` when the link is followed.
467
446
  */
@@ -496,8 +475,12 @@ export const spaceVersionConventionArtifactsResponseSchema = z.object({
496
475
  artifacts: z.array(spaceVersionConventionArtifactMetadataSchema),
497
476
  });
498
477
  export const spaceVersionConventionArtifactQuerySchema = z.object({
499
- kind: spaceVersionConventionArtifactKindSchema.optional(),
500
- path: spaceVersionConventionArtifactPathSchema.optional(),
478
+ kind: spaceVersionConventionArtifactKindSchema
479
+ .optional()
480
+ .describe("Which artifact to read, named by kind. Pass this or `path`."),
481
+ path: spaceVersionConventionArtifactPathSchema
482
+ .optional()
483
+ .describe("Which artifact to read, named by its source path. Pass this or `kind`."),
501
484
  });
502
485
  export const spaceVersionConventionArtifactContentResponseSchema = spaceVersionConventionArtifactMetadataSchema.extend({
503
486
  encoding: z.enum(["utf8", "base64"]),
@@ -505,11 +488,10 @@ export const spaceVersionConventionArtifactContentResponseSchema = spaceVersionC
505
488
  truncated: z.boolean(),
506
489
  });
507
490
  /**
508
- * Where a routing diagnostic came from a committed path in the version the
509
- * publisher can open. Wider than the convention artifacts: the Spacefast config
510
- * file states routing rules too, and they compile through the same compiler and
511
- * report the same codes. Every accepted config filename is listed because
512
- * finalize reads whichever one the version ships, and naming the canonical
491
+ * Where a routing diagnostic came from: a committed path in the version the
492
+ * publisher can open. Wider than the convention artifacts, because the config
493
+ * file states routing rules too. Every accepted config filename is listed
494
+ * because finalize reads whichever one the version ships, and naming
513
495
  * `sf.jsonc` at a version that committed `spacefast.jsonc` sends the publisher
514
496
  * to a file that is not there.
515
497
  */
@@ -525,14 +507,23 @@ export const spaceVersionRoutingDiagnosticSchema = z.object({
525
507
  code: z.string(),
526
508
  message: z.string(),
527
509
  source: z.string(),
510
+ deferredUntilSubstitution: z.literal(true).optional(),
511
+ });
512
+ export const spaceRoutingComputeSchema = z.object({
513
+ latestVersionId: z.string().nullable(),
514
+ redirects: z.string().nullable(),
515
+ headers: z.string().nullable(),
516
+ diagnostics: z.array(spaceVersionRoutingDiagnosticSchema),
517
+ variableDependencies: z.array(z.string()),
518
+ systemVariableDependencies: z.array(z.string()),
528
519
  });
529
520
  export const spaceVersionComputedRoutingSummarySchema = z.object({
530
521
  versionId: z.string(),
531
522
  source: z.object({
532
523
  artifacts: z.array(spaceVersionConventionArtifactMetadataSchema),
533
524
  }),
534
- // Finalize-written scalars, not a replay of a stored compiled-routing blob:
535
- // the runtime owns the compile and reports these counts on its receipt.
525
+ // Finalize-written scalars: the runtime owns the compile and reports these
526
+ // counts on its receipt.
536
527
  compiled: z.object({
537
528
  redirectRuleCount: z.number().int().nonnegative(),
538
529
  headerRuleCount: z.number().int().nonnegative(),
@@ -540,9 +531,8 @@ export const spaceVersionComputedRoutingSummarySchema = z.object({
540
531
  }),
541
532
  diagnostics: z.array(spaceVersionRoutingDiagnosticSchema),
542
533
  });
543
- // Upload state is inferable (internal-docs/platform.md L2216): `upload` present means bytes are
544
- // still needed (then finalize); `versionId` null means the manifest matched and nothing changed.
545
- // No redundant booleans ride along.
534
+ // `upload` present means bytes are still needed, then finalize. `versionId`
535
+ // null means the manifest matched and nothing changed.
546
536
  export const spaceVersionIntentResponseSchema = z.object({
547
537
  versionId: z
548
538
  .string()
@@ -562,20 +552,19 @@ export const publishRequestSchema = z
562
552
  teamId: z.string().nullable().optional(),
563
553
  principal: principalRefInputSchema.optional(),
564
554
  files: z
565
- .array(uploadManifestFileSchema)
566
- .describe("Desired file manifest for a declared publish session. Local-byte entries require `sha256`; sourceUrl entries may omit it. Clients upload returned targets, then finalize."),
555
+ .array(manifestFileSchema)
556
+ .describe("Desired file manifest for a declared publish session. `sha256` is optional: omitted local bytes receive path-addressed upload targets and are hashed by the runtime; declared hashes receive content-addressed targets and can reuse existing bytes. Clients upload returned targets, then finalize."),
567
557
  ...manifestMutationFieldsSchema,
568
558
  source: PublishSourceSchema.optional().describe('Publish provenance recorded on the version; defaults to {kind: "direct_upload"}.'),
569
- // Same fields, same bounds as spaceVersionCreateSchema: a publish that ran
570
- // a build carries its transcript and provenance whichever door it enters
571
- // by, so the first version of a space is not poorer than its second.
559
+ // Same fields and bounds as spaceVersionCreateSchema, so a publish that ran
560
+ // a build carries its transcript whichever door it enters by.
572
561
  sourceMetadata: z
573
562
  .record(z.string(), z.unknown())
574
563
  .optional()
575
564
  .describe("Additional control-plane-only provenance for build/deploy read models."),
576
565
  buildLog: z
577
566
  .string()
578
- .max(64_000)
567
+ .max(VERSION_BUILD_LOG_MAX_LENGTH)
579
568
  .optional()
580
569
  .describe("Bounded build transcript for deploys that ran a local build before publishing."),
581
570
  publishMode: z
@@ -618,21 +607,46 @@ export const publishUploadReceiptSchema = z.object({
618
607
  export const publishReceiptSpaceSchema = z.object({
619
608
  id: z.string(),
620
609
  slug: z.string(),
610
+ title: z.string(),
621
611
  publicName: z.string(),
622
- defaultHostname: z.string(),
612
+ // The server always names the managed hostname it allocated. A receipt
613
+ // rendered by a client (`sf publish --json`) can only report what the API told
614
+ // it, so this is absent rather than guessed: the apex is environment-resolved
615
+ // (see config/domains.ts `resolveViewFastApex`) and a client that invents
616
+ // `<slug>.view.fast` would hand a caller a production address that, off
617
+ // production, belongs to nothing.
618
+ defaultHostname: z.string().optional(),
623
619
  liveUrl: z.string().nullable(),
624
620
  });
621
+ /**
622
+ * The claim block as it rides on a publish receipt. Same members as the
623
+ * server's {@link spaceClaimReceiptSchema}, with the URL formats relaxed to
624
+ * plain strings so a client-rendered receipt can mask the three key-bearing
625
+ * members (`key`, `url`, `claimUrl`) with {@link REDACTED_RECEIPT_SECRET} while
626
+ * keeping the block's shape stable. `expiresAt` is never masked: it is what
627
+ * tells an agent the space is temporary and by when it has to be claimed.
628
+ */
629
+ export const publishReceiptClaimSchema = spaceClaimReceiptSchema.extend({
630
+ key: z.string().min(1),
631
+ url: z.string().min(1),
632
+ claimUrl: z.string().min(1),
633
+ });
634
+ /** The stand-in a surface writes where a secret would otherwise be printed. */
635
+ export const REDACTED_RECEIPT_SECRET = "[REDACTED]";
625
636
  export const publishReceiptVersionSchema = z.object({
626
637
  id: z.string(),
627
638
  status: VersionSchema.shape.status,
628
- immutableUrl: z.string(),
639
+ immutableUrl: z
640
+ .string()
641
+ .nullable()
642
+ .describe("Permanent version URL, or null while the version is still being finalized."),
629
643
  ref: z.string().nullable().optional(),
630
644
  number: z.number().int().positive().nullable().optional(),
631
645
  manifestHash: z.string().nullable(),
632
646
  });
633
- // Liveness is never a version status it is the channel pointer, reported
634
- // here. "Ready and live" (activated), "ready but outraced" (superseded), and
635
- // "ready by design" (unpromoted) are three different receipts.
647
+ // Liveness is the channel pointer, never a version status: "ready and live"
648
+ // (activated), "ready but outraced" (superseded), and "ready by design"
649
+ // (unpromoted) are three different receipts.
636
650
  export const publishActivationSchema = z.object({
637
651
  channel: z
638
652
  .enum(["live"])
@@ -646,9 +660,9 @@ export const publishActivationSchema = z.object({
646
660
  .nullable()
647
661
  .describe("The version currently serving live traffic, or null when the space has none."),
648
662
  });
649
- // The receipt's normative next step: the deterministic projection of
650
- // (version status, activation outcome, pending bytes, operation state). An
651
- // agent drives the whole lifecycle by branching on `action` alone.
663
+ // A deterministic projection of (version status, activation outcome, pending
664
+ // bytes, operation state). An agent drives the whole lifecycle by branching on
665
+ // `action` alone.
652
666
  export const publishNextSchema = z.object({
653
667
  action: z
654
668
  .enum(["done", "upload", "finalize", "poll"])
@@ -670,19 +684,49 @@ export const publishReceiptSchema = z.object({
670
684
  version: publishReceiptVersionSchema,
671
685
  activation: publishActivationSchema,
672
686
  next: publishNextSchema,
687
+ // The other way to publish this same space. Present on every receipt that
688
+ // could resolve it, so an agent that just published once already knows how to
689
+ // deploy the next change from a checkout — and so an anonymous publisher
690
+ // learns that the key it is already holding is also its git password. Absent
691
+ // rather than guessed when the space has no repository yet.
692
+ git: spaceGitSchema
693
+ .optional()
694
+ .describe('Git remote for this space. `managedBy: "spacefast"` carries a `remoteUrl` you can push to; `managedBy: "github"` means the space deploys from GitHub and direct pushes are refused.'),
695
+ // How the publish was authorized, and what that means for the space's
696
+ // lifetime. An anonymous space is temporary: it expires at `claim.expiresAt`
697
+ // unless somebody claims it. An agent branches on these two rather than
698
+ // inferring temporariness from the presence of a claim block it may not be
699
+ // allowed to see. Optional because the API derives ownership from the
700
+ // credential and does not restate it; the CLI and MCP always set them.
701
+ authMode: z
702
+ .enum(["anonymous", "authenticated"])
703
+ .optional()
704
+ .describe("anonymous: authorized by a space key. authenticated: authorized by an account."),
705
+ persistence: z
706
+ .enum(["temporary", "managed"])
707
+ .optional()
708
+ .describe("temporary: the space expires unless claimed. managed: the space belongs to a team and persists."),
673
709
  operation: AsyncOperationSchema.optional().describe("Background finalize operation when publish work continues asynchronously."),
674
710
  upload: publishUploadReceiptSchema.optional(),
675
- claim: spaceClaimReceiptSchema.optional(),
711
+ claim: publishReceiptClaimSchema.optional(),
676
712
  diagnostics: z
677
713
  .array(baseDiagnosticSchema)
678
714
  .optional()
679
715
  .describe("Publish diagnostics. Includes the `noop_publish` info diagnostic when nothing changed (the only noop signal), manifest warnings such as `path_case_collision`, and serving-shape notes such as `single_html_index` or `files_mode_inferred`."),
680
716
  links: z
681
717
  .object({
718
+ refresh: z
719
+ .string()
720
+ .optional()
721
+ .describe("Upload-instruction refresh endpoint; present while bytes still need uploading."),
722
+ // Transition alias for clients baked before the rename (#2449): same value
723
+ // as `refresh`, emitted so a deployed client that reads `links.resume`
724
+ // still finds a working URL. Remove with the rest of the alias once every
725
+ // baked client is rebuilt.
682
726
  resume: z
683
727
  .string()
684
728
  .optional()
685
- .describe("Resume endpoint; present while bytes still need uploading."),
729
+ .describe("Deprecated alias for `refresh`; carries the identical URL."),
686
730
  finalize: z
687
731
  .string()
688
732
  .optional()
@@ -702,9 +746,9 @@ export const publishReceiptSchema = z.object({
702
746
  .optional()
703
747
  .describe("Follow-up links so agents can act on the receipt without knowing the full API."),
704
748
  });
705
- // Same inferable contract as the intent response: `upload` present means bytes are still
706
- // needed (then finalize); absent means everything declared has already landed.
707
- export const spaceVersionResumeResponseSchema = z.object({
749
+ // Same contract as the intent response: `upload` present means bytes are still
750
+ // needed, then finalize; absent means everything declared has landed.
751
+ export const spaceVersionRefreshResponseSchema = z.object({
708
752
  versionId: z.string(),
709
753
  upload: uploadInstructionsSchema
710
754
  .nullable()
@@ -714,10 +758,9 @@ export const spaceVersionResumeResponseSchema = z.object({
714
758
  .default([])
715
759
  .describe("Manifest paths ignored by the server because the current plan does not allow them."),
716
760
  });
717
- // Promote body (spec "Explicit version routes"): `{ channel? }` defaulting to
718
- // "live". Channels beyond live arrive additively; non-live names reject with
719
- // `channel_unsupported` until then. Rollback is promoting an older ready
720
- // version to the same channel.
761
+ // `{ channel? }` defaulting to "live"; non-live names reject with
762
+ // `channel_unsupported` until more channels ship. Rollback is promoting an
763
+ // older ready version to the same channel.
721
764
  export const versionPromoteSchema = z
722
765
  .object({
723
766
  channel: z
@@ -728,9 +771,29 @@ export const versionPromoteSchema = z
728
771
  })
729
772
  .optional()
730
773
  .default({});
774
+ /**
775
+ * `?async=1` on a route that otherwise waits for the work to settle: the route
776
+ * answers with the operation handle to poll instead. Every such route builds its
777
+ * query schema here so the accepted spellings stay one definition; the caller
778
+ * passes the description because that is the only per-route part.
779
+ *
780
+ * Plain enum (no zod transform): transforms cannot be represented in the
781
+ * generated OpenAPI spec, and this parameter must reach SDK consumers.
782
+ */
783
+ export function asyncQuerySchema(description) {
784
+ return z.object({
785
+ async: z.enum(["true", "false", "1", "0"]).optional().describe(description),
786
+ });
787
+ }
788
+ /**
789
+ * Reads an {@link asyncQuerySchema} value. The factory owns which spellings the
790
+ * parameter accepts; this owns what they mean, so neither can drift alone.
791
+ */
792
+ export function isAsyncRequested(value) {
793
+ return value === "true" || value === "1";
794
+ }
731
795
  export const spaceFinalizeSchema = z
732
796
  .object({
733
- conventionFiles: conventionFilesSchema.optional(),
734
797
  channel: z
735
798
  .enum(["live"])
736
799
  .nullable()
@@ -758,33 +821,35 @@ export const spaceRuntimeStatusSchema = z.object({
758
821
  operation: AsyncOperationSchema.nullable(),
759
822
  app: runtimeAppSchema
760
823
  .nullable()
761
- .describe("What the live version runs: its Zero capsule and its Functions worker, each null when the published tree carries none of that product (both null for a static space). The whole object is null for callers whose credential does not carry `versions:read`, because app details read version contents, not serving state."),
762
- });
763
- export const spaceApplyChangeBaseSchema = z.object({
764
- kind: z.enum(["variable", "routing", "access", "settings"]),
765
- name: z.string(),
766
- label: z.string(),
767
- });
768
- export const spaceApplyModeSchema = z.enum(["stage", "apply"]);
769
- export const spaceApplyChangeSchema = spaceApplyChangeBaseSchema.extend({
770
- id: z.string(),
771
- sourceSurface: z.string(),
772
- applyMode: spaceApplyModeSchema,
773
- before: z.record(z.string(), z.unknown()).nullable().optional(),
774
- after: z.record(z.string(), z.unknown()).nullable().optional(),
775
- metadata: z.record(z.string(), z.unknown()).optional(),
824
+ .describe("What the live version runs: its Zero capsule and its Functions worker, each null when the published tree carries none of that product (both null for a space without a runtime). The whole object is null for callers whose credential does not carry `versions:read`, because app details read version contents, not serving state."),
825
+ pendingApp: runtimeAppSchema
826
+ .nullable()
827
+ .describe("What the pending version would run — the same projection as `app`, read from `pendingVersionId`'s version so a dashboard can show what an in-flight publish is about to serve. Null when no publish is in flight, and null for callers without `versions:read`, exactly like `app`."),
776
828
  });
829
+ /**
830
+ * Where a space's runtime stands against its desired state. `POST
831
+ * /v1/spaces/{spaceId}/apply` returns this in the platform mutation envelope,
832
+ * whose `operation` handle polls at `GET /v1/operations/{operationId}`; `GET
833
+ * /v1/spaces/{spaceId}/apply-state` returns the same shape as a plain read.
834
+ *
835
+ * None of these fields live on an operation record: the operation says whether
836
+ * the last apply ran, this says what the space is serving, what it wants to
837
+ * serve, and whether you may ask for it now.
838
+ */
777
839
  export const spaceApplyStateSchema = z.object({
778
- status: z.enum(["live", "pending", "applying", "failed"]),
779
- desiredRevision: z.string().nullable(),
780
- appliedRevision: z.string().nullable(),
781
- pendingChangeCount: z.number().int(),
782
- changes: z.array(spaceApplyChangeSchema),
783
- operation: AsyncOperationSchema.nullable(),
784
- lastError: z.string().nullable(),
785
- canApplyNow: z.boolean(),
786
- });
787
- export const spaceApplyResponseSchema = z.object({
788
- applied: z.boolean(),
789
- applyState: spaceApplyStateSchema,
840
+ status: z
841
+ .enum(["live", "pending", "applying", "failed"])
842
+ .describe("`live` when the runtime matches the desired state, `pending` when a change is waiting to be applied, `applying` while an apply is running, `failed` when the last apply failed."),
843
+ desiredRevision: z
844
+ .string()
845
+ .nullable()
846
+ .describe("Version the space wants to serve; null when nothing is pending."),
847
+ appliedRevision: z.string().nullable().describe("Version the runtime is serving now."),
848
+ lastError: z
849
+ .string()
850
+ .nullable()
851
+ .describe("Why the last apply failed; null unless `status` is `failed`."),
852
+ canApplyNow: z
853
+ .boolean()
854
+ .describe("Whether an apply would do something right now, for gating an Apply control."),
790
855
  });
@@ -14,6 +14,7 @@ export declare const superadminActivityEventQuerySchema: z.ZodObject<{
14
14
  system: "system";
15
15
  user: "user";
16
16
  api_key: "api_key";
17
+ partner_token: "partner_token";
17
18
  oauth_client: "oauth_client";
18
19
  anonymous_claim: "anonymous_claim";
19
20
  }>>;
@@ -64,7 +65,7 @@ export declare const SuperadminLatestUserSchema: z.ZodObject<{
64
65
  role: z.ZodNullable<z.ZodString>;
65
66
  banned: z.ZodBoolean;
66
67
  isAutomattician: z.ZodBoolean;
67
- wpcom: z.ZodBoolean;
68
+ automatticBetaGrant: z.ZodBoolean;
68
69
  betaEnrolledAt: z.ZodNullable<z.ZodString>;
69
70
  createdAt: z.ZodString;
70
71
  updatedAt: z.ZodString;
@@ -79,7 +80,7 @@ export declare const SuperadminLatestUserListSchema: z.ZodObject<{
79
80
  role: z.ZodNullable<z.ZodString>;
80
81
  banned: z.ZodBoolean;
81
82
  isAutomattician: z.ZodBoolean;
82
- wpcom: z.ZodBoolean;
83
+ automatticBetaGrant: z.ZodBoolean;
83
84
  betaEnrolledAt: z.ZodNullable<z.ZodString>;
84
85
  createdAt: z.ZodString;
85
86
  updatedAt: z.ZodString;
@@ -87,46 +88,6 @@ export declare const SuperadminLatestUserListSchema: z.ZodObject<{
87
88
  latestSessionAt: z.ZodNullable<z.ZodString>;
88
89
  }, z.core.$strip>>;
89
90
  }, z.core.$strip>;
90
- export declare const SuperadminLatestSpaceSchema: z.ZodObject<{
91
- id: z.ZodString;
92
- title: z.ZodString;
93
- slug: z.ZodString;
94
- status: z.ZodString;
95
- tenantId: z.ZodString;
96
- tenantName: z.ZodNullable<z.ZodString>;
97
- teamId: z.ZodNullable<z.ZodString>;
98
- teamSlug: z.ZodNullable<z.ZodString>;
99
- teamName: z.ZodNullable<z.ZodString>;
100
- externalCustomerId: z.ZodNullable<z.ZodString>;
101
- siteId: z.ZodNullable<z.ZodString>;
102
- siteStatus: z.ZodNullable<z.ZodString>;
103
- liveHostname: z.ZodNullable<z.ZodString>;
104
- disabledAt: z.ZodNullable<z.ZodString>;
105
- deletedAt: z.ZodNullable<z.ZodString>;
106
- createdAt: z.ZodString;
107
- updatedAt: z.ZodString;
108
- }, z.core.$strip>;
109
- export declare const SuperadminLatestSpaceListSchema: z.ZodObject<{
110
- spaces: z.ZodArray<z.ZodObject<{
111
- id: z.ZodString;
112
- title: z.ZodString;
113
- slug: z.ZodString;
114
- status: z.ZodString;
115
- tenantId: z.ZodString;
116
- tenantName: z.ZodNullable<z.ZodString>;
117
- teamId: z.ZodNullable<z.ZodString>;
118
- teamSlug: z.ZodNullable<z.ZodString>;
119
- teamName: z.ZodNullable<z.ZodString>;
120
- externalCustomerId: z.ZodNullable<z.ZodString>;
121
- siteId: z.ZodNullable<z.ZodString>;
122
- siteStatus: z.ZodNullable<z.ZodString>;
123
- liveHostname: z.ZodNullable<z.ZodString>;
124
- disabledAt: z.ZodNullable<z.ZodString>;
125
- deletedAt: z.ZodNullable<z.ZodString>;
126
- createdAt: z.ZodString;
127
- updatedAt: z.ZodString;
128
- }, z.core.$strip>>;
129
- }, z.core.$strip>;
130
91
  export declare const SuperadminLatestVersionSchema: z.ZodObject<{
131
92
  id: z.ZodString;
132
93
  number: z.ZodNullable<z.ZodNumber>;
@@ -252,7 +213,6 @@ export declare const SuperadminBadExperienceListSchema: z.ZodObject<{
252
213
  export type SuperadminActivityEvent = z.infer<typeof SuperadminActivityEventSchema>;
253
214
  export type SuperadminActivityEventQuery = z.infer<typeof superadminActivityEventQuerySchema>;
254
215
  export type SuperadminLatestUser = z.infer<typeof SuperadminLatestUserSchema>;
255
- export type SuperadminLatestSpace = z.infer<typeof SuperadminLatestSpaceSchema>;
256
216
  export type SuperadminLatestVersion = z.infer<typeof SuperadminLatestVersionSchema>;
257
217
  export type SuperadminBadExperienceItem = z.infer<typeof SuperadminBadExperienceItemSchema>;
258
218
  export type SuperadminBadExperienceList = z.infer<typeof SuperadminBadExperienceListSchema>;