@spacefast/common 0.0.13 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/agents/client-registry.d.ts +22 -0
  2. package/dist/agents/client-registry.js +41 -0
  3. package/dist/agents/connect-targets.d.ts +51 -6
  4. package/dist/agents/connect-targets.js +93 -28
  5. package/dist/brand.d.ts +0 -11
  6. package/dist/brand.js +0 -20
  7. package/dist/config/domains.d.ts +15 -6
  8. package/dist/config/domains.js +24 -10
  9. package/dist/config/postgres-budget.d.ts +3 -0
  10. package/dist/config/postgres-budget.js +6 -1
  11. package/dist/config/postgres-budget.json +2 -1
  12. package/dist/contracts/abuse.js +1 -1
  13. package/dist/contracts/access.d.ts +149 -44
  14. package/dist/contracts/access.js +94 -8
  15. package/dist/contracts/activity.js +5 -1
  16. package/dist/contracts/api-keys.js +9 -9
  17. package/dist/contracts/archives.js +11 -11
  18. package/dist/contracts/beta.js +1 -1
  19. package/dist/contracts/builds.js +14 -14
  20. package/dist/contracts/channels.js +2 -2
  21. package/dist/contracts/comments.d.ts +86 -15
  22. package/dist/contracts/comments.js +116 -20
  23. package/dist/contracts/common.d.ts +12 -12
  24. package/dist/contracts/common.js +33 -30
  25. package/dist/contracts/continuation.js +5 -5
  26. package/dist/contracts/data-source-routes.js +1 -1
  27. package/dist/contracts/device-auth.d.ts +6 -6
  28. package/dist/contracts/device-auth.js +12 -12
  29. package/dist/contracts/docs.d.ts +10 -10
  30. package/dist/contracts/domains.js +39 -33
  31. package/dist/contracts/enums.d.ts +2 -10
  32. package/dist/contracts/enums.js +0 -2
  33. package/dist/contracts/error-code-meta.d.ts +116 -47
  34. package/dist/contracts/error-code-meta.js +37 -16
  35. package/dist/contracts/error-codes.d.ts +7 -4
  36. package/dist/contracts/error-codes.js +46 -21
  37. package/dist/contracts/events.d.ts +10 -3
  38. package/dist/contracts/events.js +33 -5
  39. package/dist/contracts/execution.d.ts +26 -0
  40. package/dist/contracts/execution.js +21 -0
  41. package/dist/contracts/feature-lifecycle.d.ts +21 -24
  42. package/dist/contracts/feature-lifecycle.js +28 -26
  43. package/dist/contracts/features.js +4 -4
  44. package/dist/contracts/functions.d.ts +8 -140
  45. package/dist/contracts/functions.js +9 -19
  46. package/dist/contracts/git.d.ts +1 -1
  47. package/dist/contracts/grants.d.ts +96 -79
  48. package/dist/contracts/grants.js +130 -43
  49. package/dist/contracts/ids.d.ts +2 -2
  50. package/dist/contracts/ids.js +2 -4
  51. package/dist/contracts/internal.js +2 -2
  52. package/dist/contracts/mcp.d.ts +17 -556
  53. package/dist/contracts/mcp.js +9 -103
  54. package/dist/contracts/me.js +3 -4
  55. package/dist/contracts/notifications.d.ts +108 -0
  56. package/dist/contracts/notifications.js +54 -0
  57. package/dist/contracts/oauth-resources.d.ts +18 -1
  58. package/dist/contracts/oauth-resources.js +22 -2
  59. package/dist/contracts/operations.d.ts +2 -50
  60. package/dist/contracts/operations.js +0 -19
  61. package/dist/contracts/pages.d.ts +8 -4
  62. package/dist/contracts/pages.js +16 -3
  63. package/dist/contracts/platform.js +10 -8
  64. package/dist/contracts/problem-document.d.ts +14 -0
  65. package/dist/contracts/problem-document.js +35 -0
  66. package/dist/contracts/push-new.d.ts +21 -6
  67. package/dist/contracts/push-new.js +3 -7
  68. package/dist/contracts/resources.d.ts +8 -7
  69. package/dist/contracts/resources.js +9 -6
  70. package/dist/contracts/runtime-api.d.ts +162 -92
  71. package/dist/contracts/runtime-api.js +99 -27
  72. package/dist/contracts/runtime-app.d.ts +41 -11
  73. package/dist/contracts/runtime-app.js +22 -1
  74. package/dist/contracts/runtime-db.d.ts +424 -0
  75. package/dist/contracts/runtime-db.js +108 -0
  76. package/dist/contracts/runtime-storage.d.ts +120 -0
  77. package/dist/contracts/runtime-storage.js +40 -0
  78. package/dist/contracts/sf-config-v1.d.ts +49 -1
  79. package/dist/contracts/sf-config-v1.js +2 -2
  80. package/dist/contracts/sites.d.ts +1 -0
  81. package/dist/contracts/sites.js +20 -12
  82. package/dist/contracts/space-config.d.ts +62 -22
  83. package/dist/contracts/space-config.js +173 -47
  84. package/dist/contracts/spaces.d.ts +79 -45
  85. package/dist/contracts/spaces.js +66 -50
  86. package/dist/contracts/superadmin-spaces.d.ts +13 -2
  87. package/dist/contracts/superadmin-spaces.js +15 -0
  88. package/dist/contracts/superadmin-tenants.js +4 -4
  89. package/dist/contracts/superadmin.d.ts +4 -0
  90. package/dist/contracts/superadmin.js +14 -1
  91. package/dist/contracts/tags.d.ts +17 -17
  92. package/dist/contracts/tags.js +1 -1
  93. package/dist/contracts/teams.js +25 -16
  94. package/dist/contracts/theme-json.js +1 -1
  95. package/dist/contracts/transfers.js +4 -4
  96. package/dist/contracts/variables.js +3 -3
  97. package/dist/contracts/zero.d.ts +204 -338
  98. package/dist/contracts/zero.js +94 -98
  99. package/dist/dashboard-paths/index.d.ts +16 -1
  100. package/dist/dashboard-paths/index.js +18 -0
  101. package/dist/docs/agent-handoff-document.d.ts +2 -2
  102. package/dist/docs/agent-handoff-document.js +8 -7
  103. package/dist/docs/agent-prose.d.ts +22 -3
  104. package/dist/docs/agent-prose.js +221 -51
  105. package/dist/docs/agent-setup.d.ts +13 -10
  106. package/dist/docs/agent-setup.js +279 -53
  107. package/dist/docs/agent-solutions.d.ts +6 -6
  108. package/dist/docs/agent-solutions.js +23 -21
  109. package/dist/docs/catalog.d.ts +29 -74
  110. package/dist/docs/catalog.js +65 -92
  111. package/dist/docs/error-docs.js +293 -221
  112. package/dist/docs/skill-distribution.d.ts +2 -0
  113. package/dist/docs/skill-distribution.js +7 -4
  114. package/dist/docs/skills.d.ts +546 -0
  115. package/dist/docs/skills.js +340 -0
  116. package/dist/utils/browser-credential.d.ts +19 -0
  117. package/dist/utils/browser-credential.js +62 -0
  118. package/dist/utils/comment-avatars.d.ts +7 -0
  119. package/dist/utils/comment-avatars.js +42 -0
  120. package/dist/utils/content-type.d.ts +3 -3
  121. package/dist/utils/content-type.js +38 -61
  122. package/dist/utils/domain-diagnostics.d.ts +5 -5
  123. package/dist/utils/domain-diagnostics.js +21 -10
  124. package/dist/utils/local-space-state.d.ts +78 -4
  125. package/dist/utils/local-space-state.js +383 -82
  126. package/dist/utils/one-shot-replay.d.ts +14 -0
  127. package/dist/utils/one-shot-replay.js +21 -0
  128. package/dist/utils/page-preview.d.ts +7 -0
  129. package/dist/utils/page-preview.js +9 -0
  130. package/dist/utils/pages.d.ts +2 -11
  131. package/dist/utils/pages.js +58 -14
  132. package/dist/utils/publish-form-data.d.ts +22 -0
  133. package/dist/utils/publish-form-data.js +26 -0
  134. package/dist/utils/publish-policy.js +20 -4
  135. package/dist/utils/query-keys.d.ts +7 -4
  136. package/dist/utils/query-keys.js +13 -4
  137. package/dist/utils/runtime-paths.d.ts +3 -0
  138. package/dist/utils/runtime-paths.js +7 -0
  139. package/dist/utils/secure-local-file.d.ts +73 -0
  140. package/dist/utils/secure-local-file.js +1373 -0
  141. package/dist/utils/space-config.d.ts +13 -4
  142. package/dist/utils/space-config.js +123 -15
  143. package/dist/utils/storage-policy.d.ts +20 -0
  144. package/dist/utils/storage-policy.fixtures.json +174 -0
  145. package/dist/utils/storage-policy.js +193 -0
  146. package/dist/utils/upload-session.d.ts +12 -1
  147. package/dist/utils/upload-session.js +37 -2
  148. package/dist/utils/version-file-browser.d.ts +13 -0
  149. package/dist/utils/version-file-browser.js +59 -0
  150. package/package.json +19 -1
  151. package/dist/contracts/mounts.d.ts +0 -142
  152. package/dist/contracts/mounts.js +0 -56
  153. package/dist/utils/asset-fingerprint.d.ts +0 -64
  154. package/dist/utils/asset-fingerprint.js +0 -620
@@ -1,28 +1,28 @@
1
1
  import { z } from "zod";
2
2
  import { SPACE_SLUG_MAX_LENGTH } from "../slug-policy/index.js";
3
- import { openHandoffSchema } from "./access.js";
3
+ import { publishedAccessSchema } from "./access.js";
4
4
  import { AsyncOperationSchema, baseDiagnosticSchema, CursorPaginationSchema, cursorListQuerySchema, } from "./common.js";
5
5
  import { versionStatus, spaceStatus } from "./enums.js";
6
6
  import { runtimeKindSchema } from "./execution.js";
7
7
  import { conventionFilesSchema, uploadInstructionsSchema, manifestFileSchema } from "./internal.js";
8
8
  import { VersionSchema, PublishSourceSchema, SpaceSchema, spaceSettingsDigestSchema, } from "./resources.js";
9
9
  import { runtimeAppSchema } from "./runtime-app.js";
10
- import { spaceConfigSchema, spacePlacementConfigSchema } from "./space-config.js";
10
+ import { SPACE_CONFIG_ACCEPTED_FILES, spaceConfigSchema, spacePlacementConfigSchema, } from "./space-config.js";
11
11
  import { principalIdSchema } from "./transfers.js";
12
12
  export const spaceClaimReceiptSchema = z.object({
13
13
  token: z
14
14
  .string()
15
15
  .min(1)
16
- .describe("One-time, space-scoped credential returned only at anonymous space creation. Save it immediately it is never shown again and is required to publish and manage the space until it is claimed."),
16
+ .describe("One-time, space-scoped credential returned only at anonymous space creation. Save it immediately. The server never shows it again. You need it to publish and manage the space until the space is claimed."),
17
17
  url: z
18
18
  .string()
19
19
  .url()
20
- .describe("Browser-only claim link in `/claim#nonce` form. The fragment is a human handoff capability; API clients use the claim token as bearer auth for publish/update/status/exchange."),
20
+ .describe("Browser-only claim link with a short-lived, one-use path token. The access origin consumes it into an HttpOnly handoff, then redirects to a clean claim page. API clients use the separate claim token as bearer auth for publish, update, status, and exchange."),
21
21
  expiresAt: z.string().datetime(),
22
22
  });
23
23
  export const SpaceCreateResponseSchema = z.object({
24
24
  space: SpaceSchema,
25
- open: openHandoffSchema,
25
+ access: publishedAccessSchema,
26
26
  claim: spaceClaimReceiptSchema.optional(),
27
27
  });
28
28
  // Stored per-version diagnostic surfaced on the space diagnostics feed: the shared
@@ -72,24 +72,24 @@ export const spacePatchSchema = z
72
72
  .min(2)
73
73
  .max(SPACE_SLUG_MAX_LENGTH)
74
74
  .optional()
75
- .describe("Renames the space and its managed view.fast hostname. Send slug by itself. Previously managed hostnames keep a temporary, path- and query-preserving 307 redirect to the current hostname; immutable version URLs do not change."),
75
+ .describe("Renames the space and its managed view.fast hostname. Send slug by itself. Previously managed hostnames keep a temporary 307 redirect that preserves path and query to the current hostname. Immutable version URLs do not change."),
76
76
  config: spaceConfigSchema
77
77
  .nullable()
78
78
  .optional()
79
79
  .describe("Replaces the stored SpaceConfig overlay; null clears it."),
80
80
  baseSettingsDigest: spaceSettingsDigestSchema
81
81
  .optional()
82
- .describe("Optimistic-concurrency base for versioned settings (title/config): the `settingsDigest` read from the Space resource when the form was loaded. When provided and the space's current settings digest no longer matches, the PATCH fails with 409 publish_base_changed and changes nothing."),
82
+ .describe("Optimistic-concurrency base for versioned settings (title and config): the `settingsDigest` read from the Space resource when the form loaded. If provided and the space's current settings digest no longer matches, the PATCH fails with 409 `publish_base_changed` and changes nothing."),
83
83
  force: z
84
84
  .boolean()
85
85
  .optional()
86
- .describe("With baseSettingsDigest: acknowledge a changed base and overwrite anyway. The forced overwrite is recorded in the space activity feed. Never the default."),
86
+ .describe("With `baseSettingsDigest`, acknowledge a changed base and overwrite anyway. The server records the forced overwrite in the space activity feed. This is never the default."),
87
87
  dataLocation: z.string().min(1).optional(),
88
88
  placement: spacePlacementConfigSchema.optional(),
89
89
  noindex: z
90
90
  .boolean()
91
91
  .optional()
92
- .describe("Hide the live production site from search engines. Applies only to claimed spaces' live hostnames; preview and version hostnames are always noindex."),
92
+ .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."),
93
93
  })
94
94
  .strict()
95
95
  .superRefine((value, ctx) => {
@@ -113,7 +113,7 @@ export const spaceClaimSchema = z
113
113
  claimToken: z
114
114
  .string()
115
115
  .min(1)
116
- .describe("One-time claim token returned at anonymous creation. API clients send it as bearer auth; browser claim links carry a separate nonce fragment."),
116
+ .describe("One-time claim token returned at anonymous creation. API clients send it as bearer auth; browser claim links carry a separate browser handoff credential."),
117
117
  teamId: z
118
118
  .string()
119
119
  .min(1)
@@ -127,7 +127,7 @@ export const spaceClaimSchema = z
127
127
  agentContinuation: z
128
128
  .boolean()
129
129
  .optional()
130
- .describe("User consent to keep the publishing agent authorized after the claim. The server independently proves continuation eligibility; consent cannot grant continuation for an ineligible space."),
130
+ .describe("User consent to keep the publishing agent authorized after the claim. The server independently proves continuation eligibility. Consent cannot grant continuation for an ineligible space."),
131
131
  })
132
132
  .superRefine((value, ctx) => {
133
133
  if (value.teamId && value.targetTeamId && value.teamId !== value.targetTeamId) {
@@ -140,18 +140,18 @@ export const spaceClaimSchema = z
140
140
  });
141
141
  export const anonymousClaimAssignSchema = z.object({
142
142
  teamId: z.string().min(1).optional(),
143
- nonce: z.string().min(1).optional().describe("Browser claim nonce from the claim URL fragment."),
143
+ nonce: z.string().min(1).optional().describe("Browser claim nonce from the claim handoff."),
144
144
  agentContinuation: z
145
145
  .boolean()
146
146
  .optional()
147
- .describe("User consent to keep the publishing agent authorized after the claim. The server independently proves continuation eligibility; consent cannot grant continuation for an ineligible space."),
147
+ .describe("User consent to keep the publishing agent authorized after the claim. The server independently proves continuation eligibility. Consent cannot grant continuation for an ineligible space."),
148
148
  });
149
149
  export const anonymousClaimResolveSchema = z.object({
150
- nonce: z.string().min(1).optional().describe("Browser claim nonce from the claim URL fragment."),
150
+ nonce: z.string().min(1).optional().describe("Browser claim nonce from the claim handoff."),
151
151
  agentContinuation: z
152
152
  .boolean()
153
153
  .optional()
154
- .describe("User consent applied when resolve auto-claims. The server independently proves continuation eligibility; consent cannot grant continuation for an ineligible space."),
154
+ .describe("User consent applied when resolve auto-claims. The server independently proves continuation eligibility. Consent cannot grant continuation for an ineligible space."),
155
155
  });
156
156
  export const anonymousClaimTeamSchema = z.object({
157
157
  id: z.string(),
@@ -176,6 +176,7 @@ export const anonymousClaimSharingSummarySchema = z.object({
176
176
  })),
177
177
  links: z.array(z.object({
178
178
  id: z.string(),
179
+ revision: z.number().int().positive(),
179
180
  name: z.string(),
180
181
  landingPath: z.string().startsWith("/"),
181
182
  scopes: z.array(z.string().startsWith("/")),
@@ -190,14 +191,15 @@ export const anonymousClaimResponseSchema = z.object({
190
191
  expiresAt: z.string().datetime().nullable(),
191
192
  claimedAt: z.string().datetime().nullable(),
192
193
  }),
194
+ access: publishedAccessSchema,
193
195
  continuation: z
194
196
  .object({
195
197
  eligible: z
196
198
  .boolean()
197
- .describe("Server-proven: the publish intent records an originating agent holding the claim token, the one-time exchange is unredeemed, and a safe secretless return exists. Only then may the UI offer continuation."),
199
+ .describe("Server-proven continuation eligibility. Eligible means the publish intent records an originating agent that holds the claim token, the one-time exchange is unredeemed, and a safe secretless return exists. Only then can the UI offer continuation."),
198
200
  granted: z
199
201
  .boolean()
200
- .describe("True once the claim left the one-time continuation exchange open for the originating agent."),
202
+ .describe("Whether the claim left the one-time continuation exchange open for the originating agent."),
201
203
  })
202
204
  .describe("Server-authoritative continuation eligibility and claim result."),
203
205
  teams: z.array(anonymousClaimTeamSchema).optional(),
@@ -227,8 +229,9 @@ export const anonymousClaimStatusResponseSchema = z.object({
227
229
  continuation: z
228
230
  .enum(["available", "used", "unavailable"])
229
231
  .optional()
230
- .describe("Present once the space is claimed: whether this claim token can still be exchanged once for a durable access token (POST /v1/anonymous-claim/exchange)."),
232
+ .describe("Present once the space is claimed. Whether this claim token can still be exchanged once for a durable API key (POST /v1/anonymous-claim/exchange)."),
231
233
  }),
234
+ access: publishedAccessSchema,
232
235
  });
233
236
  export const anonymousClaimExchangeResponseSchema = z.object({
234
237
  space: z.object({
@@ -239,7 +242,7 @@ export const anonymousClaimExchangeResponseSchema = z.object({
239
242
  credential: z.object({
240
243
  accessToken: z
241
244
  .string()
242
- .describe("Durable publish access token minted by the one-time exchange. Shown exactly once store it (e.g. .spacefast/state.json) and never print it."),
245
+ .describe("Durable publish API key minted by the one-time exchange. Shown exactly once. Store it (for example, in .spacefast/state.json) and never print it."),
243
246
  accessTokenId: z.string(),
244
247
  label: z.string().nullable(),
245
248
  teamId: z.string(),
@@ -276,11 +279,11 @@ const manifestMutationFieldsSchema = {
276
279
  deletePaths: z
277
280
  .array(z.string().min(1))
278
281
  .default([])
279
- .describe("Explicit paths to remove when publishMode is additive. Omitted paths are retained; only paths listed here are deleted."),
282
+ .describe("Explicit paths to remove when `publishMode` is additive. Omitted paths are retained. Only listed paths are deleted."),
280
283
  immutableAssetPrefixes: z
281
284
  .array(z.string().min(2))
282
285
  .optional()
283
- .describe("Publisher-owned directory prefixes whose declared files are immutable generation assets. Snapshot publishes retain the current generation's matching files for exactly one subsequent generation."),
286
+ .describe("Publisher-owned directory prefixes whose declared files are immutable generation assets. Snapshot publishes retain the matching files from the current generation for exactly one subsequent generation."),
284
287
  };
285
288
  function refineManifestMutationRules(value, ctx) {
286
289
  if (value.immutableAssetPrefixes !== undefined) {
@@ -299,16 +302,16 @@ export const spaceVersionCreateSchema = z
299
302
  publishMode: z
300
303
  .enum(["additive", "snapshot"])
301
304
  .default("additive")
302
- .describe("How to interpret omitted paths in files: additive retains existing paths unless explicitly replaced; snapshot treats files as the complete desired manifest."),
305
+ .describe("How to interpret omitted paths in `files`: `additive` retains existing paths unless explicitly replaced; `snapshot` treats `files` as the complete desired manifest."),
303
306
  sourceMetadata: z
304
307
  .record(z.string(), z.unknown())
305
308
  .optional()
306
- .describe("Additional control-plane-only provenance for build/deploy read models."),
309
+ .describe("Additional control-plane-only provenance for build and deploy read models."),
307
310
  buildLog: z
308
311
  .string()
309
312
  .max(64_000)
310
313
  .optional()
311
- .describe("Bounded build transcript for deploys that ran a local build before publishing."),
314
+ .describe("Build transcript truncated to a bounded size for deploys that ran a local build before publishing."),
312
315
  conventionFiles: conventionFilesSchema
313
316
  .optional()
314
317
  .describe("Routing convention contents used when deciding whether this publish is unchanged. The same values are supplied again when the version is finalized."),
@@ -318,7 +321,7 @@ export const spaceVersionCreateSchema = z
318
321
  .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."),
319
322
  files: z
320
323
  .array(manifestFileSchema)
321
- .describe("Full desired file manifest. For first deploys, send path/size/contentType without hashes so upload can begin immediately. For updates, include sha256 to let the server skip unchanged files."),
324
+ .describe("The complete desired file manifest. For first deploys, send `path`, `size`, and `contentType` without hashes so upload can begin immediately. For updates, include `sha256` so the server can skip unchanged files."),
322
325
  ...manifestMutationFieldsSchema,
323
326
  })
324
327
  .superRefine(refineManifestMutationRules);
@@ -331,12 +334,16 @@ export const spaceListSchema = z.object({
331
334
  pagination: CursorPaginationSchema,
332
335
  });
333
336
  export const spaceListQuerySchema = cursorListQuerySchema.extend({
334
- team: z.string().min(1).optional().describe("Filter to spaces owned by this team id or slug."),
337
+ team: z
338
+ .string()
339
+ .min(1)
340
+ .optional()
341
+ .describe("Filter that limits results to spaces owned by this team id or slug."),
335
342
  });
336
343
  export const spaceVersionListQuerySchema = cursorListQuerySchema;
337
344
  // Version processing log lines (upload/finalize/promote output), newest-first.
338
345
  export const versionLogEntrySchema = z.object({
339
- timestamp: z.string().datetime().describe("When the version last changed state."),
346
+ timestamp: z.string().datetime().describe("Instant when the version last changed state."),
340
347
  level: z.string().describe("Log severity: info or error."),
341
348
  code: z.string().describe("Stable version.{status} code for the line."),
342
349
  message: z.string().describe("Human-readable log line."),
@@ -398,8 +405,10 @@ export const spaceFilesResponseSchema = z.object({
398
405
  index: spaceVersionFileIndexSchema,
399
406
  search: spaceVersionFilesSearchSchema,
400
407
  });
401
- export const spaceVersionFileQuerySchema = z.object({
408
+ export const spaceVersionFilePathQuerySchema = z.object({
402
409
  path: z.string().min(1),
410
+ });
411
+ export const spaceVersionFileQuerySchema = spaceVersionFilePathQuerySchema.extend({
403
412
  download: z.string().optional(),
404
413
  });
405
414
  export const spaceVersionFileResponseSchema = z.object({
@@ -413,13 +422,6 @@ export const spaceVersionFileResponseSchema = z.object({
413
422
  truncated: z.boolean(),
414
423
  cached: z.boolean(),
415
424
  });
416
- export const spaceVersionFileDirectUrlResponseSchema = z.object({
417
- versionId: z.string(),
418
- path: z.string(),
419
- url: z.string().url(),
420
- managementHostname: z.string(),
421
- expiresInSeconds: z.number().int().positive(),
422
- });
423
425
  export const spaceVersionFileUrlPreviewSchema = z.object({
424
426
  versionId: z.string(),
425
427
  path: z.string(),
@@ -471,8 +473,22 @@ export const spaceVersionConventionArtifactContentResponseSchema = spaceVersionC
471
473
  content: z.string(),
472
474
  truncated: z.boolean(),
473
475
  });
476
+ /**
477
+ * Where a routing diagnostic came from — a committed path in the version the
478
+ * publisher can open. Wider than the convention artifacts: the Spacefast config
479
+ * file states routing rules too, and they compile through the same compiler and
480
+ * report the same codes. Every accepted config filename is listed because
481
+ * finalize reads whichever one the version ships, and naming the canonical
482
+ * `sf.jsonc` at a version that committed `spacefast.jsonc` sends the publisher
483
+ * to a file that is not there.
484
+ */
485
+ export const spaceVersionRoutingDiagnosticFileSchema = z.enum([
486
+ "_redirects",
487
+ "_headers",
488
+ ...SPACE_CONFIG_ACCEPTED_FILES,
489
+ ]);
474
490
  export const spaceVersionRoutingDiagnosticSchema = z.object({
475
- file: spaceVersionConventionArtifactPathSchema,
491
+ file: spaceVersionRoutingDiagnosticFileSchema,
476
492
  line: z.number().int().nonnegative(),
477
493
  severity: z.enum(["warning", "error"]),
478
494
  code: z.string(),
@@ -549,7 +565,7 @@ export const spaceVersionIntentResponseSchema = z.object({
549
565
  .describe("Created version id, or null when the manifest matched and nothing changed."),
550
566
  upload: uploadInstructionsSchema
551
567
  .nullable()
552
- .describe("Runtime upload session, present only while bytes still need uploading. Upload, then finalize."),
568
+ .describe("Runtime upload session; present only while bytes still need uploading. Upload first, then finalize."),
553
569
  ignoredPaths: z
554
570
  .array(z.string())
555
571
  .default([])
@@ -581,13 +597,13 @@ export const publishRequestSchema = z
581
597
  publishMode: z
582
598
  .enum(["additive", "snapshot"])
583
599
  .default("additive")
584
- .describe("How to interpret omitted paths in files: additive retains existing paths unless explicitly replaced; snapshot treats files as the complete desired manifest."),
600
+ .describe("How to interpret omitted paths in `files`: `additive` retains existing paths unless explicitly replaced; `snapshot` treats `files` as the complete desired manifest."),
585
601
  email: z
586
602
  .string()
587
603
  .email()
588
604
  .max(320)
589
605
  .optional()
590
- .describe("Optional expiry-reminder address for anonymous publishes. Stored only until the space is claimed or expires, then deleted; never logged."),
606
+ .describe("Optional expiry-reminder address for anonymous publishes. The server stores it only until the space is claimed or expires, then deletes it. It is never logged."),
591
607
  channel: z
592
608
  .enum(["live"])
593
609
  .nullable()
@@ -637,7 +653,7 @@ export const publishActivationSchema = z.object({
637
653
  channel: z
638
654
  .enum(["live"])
639
655
  .nullable()
640
- .describe("Channel this publish targeted. null = ready version without promotion."),
656
+ .describe("Channel this publish targeted; null means a ready version without promotion."),
641
657
  outcome: z
642
658
  .enum(["activated", "unpromoted", "superseded", "pending"])
643
659
  .describe("activated: the live pointer moved to this version. unpromoted: ready with channel null, by request. superseded: ready, but a newer publish holds the live pointer. pending: not settled yet."),
@@ -652,7 +668,7 @@ export const publishActivationSchema = z.object({
652
668
  export const publishNextSchema = z.object({
653
669
  action: z
654
670
  .enum(["done", "upload", "finalize", "poll"])
655
- .describe("done: stop, this request's intent is settled. upload: PUT the upload targets, then follow the finalize link. finalize: all bytes are present, POST url to commit. poll: server-side work in flight, GET url after retryAfter seconds."),
671
+ .describe("What the caller does next: `done` (stop; this request intent is settled), `upload` (PUT upload targets, then follow the finalize link), `finalize` (all bytes are present, POST `url` to commit), or `poll` (server-side work is in flight, GET `url` after `retryAfter` seconds)."),
656
672
  url: z.string().optional().describe("The endpoint the action applies to."),
657
673
  retryAfter: z
658
674
  .number()
@@ -660,11 +676,11 @@ export const publishNextSchema = z.object({
660
676
  .positive()
661
677
  .optional()
662
678
  .describe("Polling cadence in seconds; present only when action is poll."),
663
- hint: z.string().max(140).describe("One plain sentence for an agent mid-loop."),
679
+ hint: z.string().max(140).describe("One plain sentence for an agent in the middle of a loop."),
664
680
  });
665
681
  export const publishReceiptSchema = z.object({
666
682
  space: publishReceiptSpaceSchema,
667
- open: openHandoffSchema.optional(),
683
+ access: publishedAccessSchema.optional(),
668
684
  version: publishReceiptVersionSchema,
669
685
  activation: publishActivationSchema,
670
686
  next: publishNextSchema,
@@ -674,7 +690,7 @@ export const publishReceiptSchema = z.object({
674
690
  diagnostics: z
675
691
  .array(baseDiagnosticSchema)
676
692
  .optional()
677
- .describe("Publish diagnostics: 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`."),
693
+ .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`."),
678
694
  links: z
679
695
  .object({
680
696
  resume: z
@@ -706,7 +722,7 @@ export const spaceVersionResumeResponseSchema = z.object({
706
722
  versionId: z.string(),
707
723
  upload: uploadInstructionsSchema
708
724
  .nullable()
709
- .describe("Fresh runtime upload session, present only while files still need uploading. Upload, then finalize."),
725
+ .describe("Fresh runtime upload session; present only while files still need uploading. Upload first, then finalize."),
710
726
  ignoredPaths: z
711
727
  .array(z.string())
712
728
  .default([])
@@ -722,7 +738,7 @@ export const versionPromoteSchema = z
722
738
  .string()
723
739
  .min(1)
724
740
  .optional()
725
- .describe('Channel to point at this version; defaults to "live". Non-live channel names are rejected with channel_unsupported until additional channels ship.'),
741
+ .describe('Channel to point at this version. Defaults to "live". Non-live channel names are rejected with `channel_unsupported` until additional channels ship.'),
726
742
  })
727
743
  .optional()
728
744
  .default({});
@@ -741,15 +757,15 @@ export const spaceRuntimeStatusSchema = z.object({
741
757
  liveVersionId: z
742
758
  .string()
743
759
  .nullable()
744
- .describe("Version that the live space URL currently points to, if any."),
760
+ .describe("Version that the live space URL now points to, if any."),
745
761
  pendingVersionId: z
746
762
  .string()
747
763
  .nullable()
748
- .describe("Version that live traffic is trying to publish, if any."),
764
+ .describe("Version that live traffic is trying to publish now, if any."),
749
765
  liveUrl: z
750
766
  .string()
751
767
  .nullable()
752
- .describe("Live space URL. Flips to the latest version after a successful publish to `live`."),
768
+ .describe("Live space URL. It moves to the latest version after a successful publish to `live`."),
753
769
  runtimeState: spaceStatus.describe("Space operation-lifecycle status."),
754
770
  liveVersionStatus: versionStatus.nullable(),
755
771
  liveRuntimeKind: runtimeKindSchema
@@ -759,7 +775,7 @@ export const spaceRuntimeStatusSchema = z.object({
759
775
  operation: AsyncOperationSchema.nullable(),
760
776
  app: runtimeAppSchema
761
777
  .nullable()
762
- .describe("What the live version runs: its Zero capsule or Functions worker, discriminated by `runtimeKind`. Null for a static space, and null for callers whose credential does not carry `versions:read` describing an app is a read of the version's contents, not of the space's serving state."),
778
+ .describe("What the live version runs: its Zero capsule or Functions worker, discriminated by `runtimeKind`. Null for a static space. Also null for callers whose credential does not carry `versions:read`, because app details read version contents, not serving state."),
763
779
  });
764
780
  export const spaceApplyChangeBaseSchema = z.object({
765
781
  kind: z.enum(["variable", "routing", "access", "settings"]),
@@ -185,6 +185,7 @@ export declare const SuperadminSpaceDetailSchema: z.ZodObject<{
185
185
  always_hot: "always_hot";
186
186
  }>;
187
187
  moving: z.ZodBoolean;
188
+ hasRuntime: z.ZodBoolean;
188
189
  channels: z.ZodRecord<z.ZodString, z.ZodObject<{
189
190
  versionId: z.ZodString;
190
191
  updatedAt: z.ZodString;
@@ -267,7 +268,7 @@ export declare const SuperadminSpaceDetailSchema: z.ZodObject<{
267
268
  bodyEnd: z.ZodOptional<z.ZodArray<z.ZodString>>;
268
269
  noscript: z.ZodOptional<z.ZodArray<z.ZodString>>;
269
270
  }, z.core.$strip>>;
270
- dataSources: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodObject<{
271
+ dataSources: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodRecord<z.ZodString, z.ZodObject<{
271
272
  kind: z.ZodLiteral<"wordpress">;
272
273
  url: z.ZodString;
273
274
  }, z.core.$strict>>>>;
@@ -405,6 +406,14 @@ export declare const SuperadminSpaceDetailSchema: z.ZodObject<{
405
406
  updatedAt: z.ZodString;
406
407
  }, z.core.$strip>>;
407
408
  }, z.core.$strip>;
409
+ export declare const superadminSpaceViewLinkWriteSchema: z.ZodObject<{
410
+ path: z.ZodOptional<z.ZodString>;
411
+ }, z.core.$strict>;
412
+ export declare const SuperadminSpaceViewLinkSchema: z.ZodObject<{
413
+ landingPath: z.ZodString;
414
+ expiresAt: z.ZodString;
415
+ url: z.ZodString;
416
+ }, z.core.$strict>;
408
417
  export declare const SuperadminAnonymousSpaceSchema: z.ZodObject<{
409
418
  id: z.ZodString;
410
419
  tenantId: z.ZodString;
@@ -511,6 +520,7 @@ export declare const SuperadminAnonymousSpaceAssignResponseSchema: z.ZodObject<{
511
520
  always_hot: "always_hot";
512
521
  }>;
513
522
  moving: z.ZodBoolean;
523
+ hasRuntime: z.ZodBoolean;
514
524
  channels: z.ZodRecord<z.ZodString, z.ZodObject<{
515
525
  versionId: z.ZodString;
516
526
  updatedAt: z.ZodString;
@@ -593,7 +603,7 @@ export declare const SuperadminAnonymousSpaceAssignResponseSchema: z.ZodObject<{
593
603
  bodyEnd: z.ZodOptional<z.ZodArray<z.ZodString>>;
594
604
  noscript: z.ZodOptional<z.ZodArray<z.ZodString>>;
595
605
  }, z.core.$strip>>;
596
- dataSources: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodObject<{
606
+ dataSources: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodRecord<z.ZodString, z.ZodObject<{
597
607
  kind: z.ZodLiteral<"wordpress">;
598
608
  url: z.ZodString;
599
609
  }, z.core.$strict>>>>;
@@ -652,3 +662,4 @@ export type SuperadminSpaceVersion = z.infer<typeof SuperadminSpaceVersionSchema
652
662
  export type SuperadminSpaceDetail = z.infer<typeof SuperadminSpaceDetailSchema>;
653
663
  export type SuperadminAnonymousSpace = z.infer<typeof SuperadminAnonymousSpaceSchema>;
654
664
  export type SuperadminAnonymousSpaceList = z.infer<typeof SuperadminAnonymousSpaceListSchema>;
665
+ export type SuperadminSpaceViewLink = z.infer<typeof SuperadminSpaceViewLinkSchema>;
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { accessScopePathSchema } from "./access.js";
2
3
  import { SpaceSchema } from "./resources.js";
3
4
  import { ZERO_RUNTIME_KIND } from "./zero.js";
4
5
  const zeroLogLevelSchema = z.enum(["debug", "info", "warn", "error"]);
@@ -87,6 +88,20 @@ export const SuperadminSpaceDetailSchema = z.object({
87
88
  hostnames: z.array(SuperadminSpaceHostnameSchema),
88
89
  versions: z.array(SuperadminSpaceVersionSchema),
89
90
  });
91
+ // Operator view links. Ops Slack links superadmin instead of a customer's own
92
+ // private URL, so this is the hop that opens the actual page from an alert.
93
+ export const superadminSpaceViewLinkWriteSchema = z
94
+ .object({ path: accessScopePathSchema.optional() })
95
+ .strict();
96
+ // Stateless: the URL is a signed token, so there is no row to name, list, or
97
+ // revoke individually — it simply expires.
98
+ export const SuperadminSpaceViewLinkSchema = z
99
+ .object({
100
+ landingPath: z.string(),
101
+ expiresAt: z.string().datetime(),
102
+ url: z.string().url(),
103
+ })
104
+ .strict();
90
105
  export const SuperadminAnonymousSpaceSchema = z.object({
91
106
  id: z.string(),
92
107
  tenantId: z.string(),
@@ -22,11 +22,11 @@ export const SuperadminProviderClientSchema = z.object({
22
22
  .string()
23
23
  .nullable()
24
24
  .describe("Default PHP version for sites provisioned under this client."),
25
- status: providerClientStatus.describe("Whether this client identity may provision sites."),
25
+ status: providerClientStatus.describe("Whether this client identity can provision sites."),
26
26
  tokenHint: z
27
27
  .string()
28
28
  .nullable()
29
- .describe("Masked tail of the stored API token (never the full value)."),
29
+ .describe("Masked tail of the stored API key (never the full value)."),
30
30
  createdAt: z.string().datetime(),
31
31
  updatedAt: z.string().datetime(),
32
32
  });
@@ -78,11 +78,11 @@ export const SuperadminTenantSchema = z.object({
78
78
  .string()
79
79
  .datetime()
80
80
  .nullable()
81
- .describe("Billing grace deadline; present only while status is past_due."),
81
+ .describe("Billing grace deadline; present only when status is past_due."),
82
82
  defaultRegion: z
83
83
  .string()
84
84
  .nullable()
85
- .describe('Default placement region for new sites; null/"auto" lets placement decide.'),
85
+ .describe('Default placement region for new sites; null or "auto" lets placement decide.'),
86
86
  metadata: z.record(z.string(), z.string()).nullable().describe("Operator-attached metadata."),
87
87
  providerClient: SuperadminProviderClientSchema.nullable().describe("ProviderClient owned by this tenant; null when the tenant provisions under the first-party client."),
88
88
  teamCount: z.number().int().nonnegative(),
@@ -277,6 +277,10 @@ export declare const superadminAddonCreateSchema: z.ZodObject<{
277
277
  note: z.ZodOptional<z.ZodString>;
278
278
  expiresAt: z.ZodOptional<z.ZodString>;
279
279
  }, z.core.$strip>;
280
+ export declare const superadminStorageQuotaSetSchema: z.ZodObject<{
281
+ storageBytes: z.ZodNumber;
282
+ note: z.ZodOptional<z.ZodString>;
283
+ }, z.core.$strip>;
280
284
  export declare const SuperadminAddonSchema: z.ZodObject<{
281
285
  id: z.ZodString;
282
286
  teamId: z.ZodString;
@@ -136,10 +136,23 @@ export const SuperadminPlanGrantListSchema = makeOffsetListSchema("grants", Supe
136
136
  export const superadminAddonCreateSchema = z.object({
137
137
  team: z.string().trim().min(1).describe("Team id or slug."),
138
138
  limit: z.enum(["teamMembers", "subTeams", "storageBytes", "externalDomainGroups"]),
139
- amount: z.number().int().positive().describe("Additive amount (seats count, bytes, ...)."),
139
+ amount: z
140
+ .number()
141
+ .int()
142
+ .positive()
143
+ .describe("Additive amount (seat count, bytes, and similar units)."),
140
144
  note: z.string().trim().max(500).optional(),
141
145
  expiresAt: z.string().datetime().optional(),
142
146
  });
147
+ export const superadminStorageQuotaSetSchema = z.object({
148
+ storageBytes: z
149
+ .number()
150
+ .int()
151
+ .positive()
152
+ .max(Number.MAX_SAFE_INTEGER)
153
+ .describe("Desired total storage quota in bytes."),
154
+ note: z.string().trim().max(500).optional(),
155
+ });
143
156
  export const SuperadminAddonSchema = z.object({
144
157
  id: z.string(),
145
158
  teamId: z.string(),