@spacefast/common 0.2.1 → 0.4.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 (226) hide show
  1. package/dist/agents/marketplace-prompts.d.ts +1 -0
  2. package/dist/agents/marketplace-prompts.js +6 -0
  3. package/dist/agents/registry/core.d.ts +4 -12
  4. package/dist/agents/registry/core.js +7 -28
  5. package/dist/config/domains.d.ts +10 -8
  6. package/dist/config/domains.js +4 -7
  7. package/dist/contracts/access-core.d.ts +135 -0
  8. package/dist/contracts/access-core.js +242 -0
  9. package/dist/contracts/access-profiles.d.ts +8 -8
  10. package/dist/contracts/access-profiles.js +8 -8
  11. package/dist/contracts/access.d.ts +14 -103
  12. package/dist/contracts/access.js +10 -210
  13. package/dist/contracts/activity.d.ts +54 -55
  14. package/dist/contracts/activity.js +38 -9
  15. package/dist/contracts/api-keys.d.ts +69 -26
  16. package/dist/contracts/api-keys.js +29 -2
  17. package/dist/contracts/application-journal.d.ts +197 -4
  18. package/dist/contracts/application-journal.js +97 -16
  19. package/dist/contracts/auth.d.ts +20 -0
  20. package/dist/contracts/auth.js +18 -0
  21. package/dist/contracts/beta.d.ts +13 -0
  22. package/dist/contracts/beta.js +28 -0
  23. package/dist/contracts/billing.d.ts +2 -2
  24. package/dist/contracts/bootstrap.d.ts +23 -6
  25. package/dist/contracts/builds.d.ts +24 -4
  26. package/dist/contracts/builds.js +16 -4
  27. package/dist/contracts/channels.d.ts +43 -0
  28. package/dist/contracts/channels.js +22 -6
  29. package/dist/contracts/comments.d.ts +49 -0
  30. package/dist/contracts/comments.js +61 -2
  31. package/dist/contracts/commerce.d.ts +19 -13
  32. package/dist/contracts/connector-access.d.ts +28 -0
  33. package/dist/contracts/connector-access.js +31 -0
  34. package/dist/contracts/connectors.d.ts +2382 -0
  35. package/dist/contracts/connectors.js +941 -0
  36. package/dist/contracts/content-contract-verification.d.ts +112 -58
  37. package/dist/contracts/content-contract-verification.js +42 -54
  38. package/dist/contracts/content-model-emit.d.ts +97 -0
  39. package/dist/contracts/content-model-emit.js +306 -0
  40. package/dist/contracts/content-model-sdk.d.ts +101 -0
  41. package/dist/contracts/content-model-sdk.js +232 -0
  42. package/dist/contracts/{content-program.d.ts → content-model.d.ts} +338 -82
  43. package/dist/contracts/{content-program.js → content-model.js} +291 -63
  44. package/dist/contracts/content-platform-fixture.d.ts +380 -110
  45. package/dist/contracts/content-platform-fixture.js +8 -8
  46. package/dist/contracts/content-sync.d.ts +197 -74
  47. package/dist/contracts/content-sync.js +98 -37
  48. package/dist/contracts/content.d.ts +30 -422
  49. package/dist/contracts/content.js +34 -294
  50. package/dist/contracts/dashboard-prefs.d.ts +10 -3
  51. package/dist/contracts/dashboard-prefs.js +6 -3
  52. package/dist/contracts/data-location.d.ts +9 -0
  53. package/dist/contracts/data-location.js +7 -0
  54. package/dist/contracts/deployment-comparison.d.ts +67 -0
  55. package/dist/contracts/deployment-comparison.js +68 -0
  56. package/dist/contracts/device-auth.d.ts +55 -11
  57. package/dist/contracts/domains.d.ts +40 -16
  58. package/dist/contracts/domains.js +23 -0
  59. package/dist/contracts/enums.d.ts +1 -10
  60. package/dist/contracts/enums.js +0 -15
  61. package/dist/contracts/error-code-meta.d.ts +388 -20
  62. package/dist/contracts/error-code-meta.js +201 -5
  63. package/dist/contracts/error-codes.d.ts +17 -4
  64. package/dist/contracts/error-codes.js +109 -10
  65. package/dist/contracts/events.d.ts +5 -0
  66. package/dist/contracts/events.js +12 -3
  67. package/dist/contracts/execution.d.ts +5 -1
  68. package/dist/contracts/execution.js +4 -0
  69. package/dist/contracts/feature-lifecycle.d.ts +53 -20
  70. package/dist/contracts/feature-lifecycle.js +65 -23
  71. package/dist/contracts/features.d.ts +57 -31
  72. package/dist/contracts/features.js +0 -1
  73. package/dist/contracts/feedback.d.ts +124 -0
  74. package/dist/contracts/feedback.js +64 -0
  75. package/dist/contracts/fixtures/content-model-sdk-v1.generated.d.ts +129 -0
  76. package/dist/contracts/fixtures/content-model-sdk-v1.generated.js +48 -0
  77. package/dist/contracts/fixtures/content-platform-v1.json +101 -49
  78. package/dist/contracts/frame-session.d.ts +60 -10
  79. package/dist/contracts/frame-session.js +52 -12
  80. package/dist/contracts/functions.d.ts +28 -2
  81. package/dist/contracts/functions.js +25 -2
  82. package/dist/contracts/grant-copy.d.ts +2 -0
  83. package/dist/contracts/grant-copy.js +2 -0
  84. package/dist/contracts/grants-core.d.ts +95 -0
  85. package/dist/contracts/grants-core.js +435 -0
  86. package/dist/contracts/grants.d.ts +13 -84
  87. package/dist/contracts/grants.js +21 -369
  88. package/dist/contracts/ids-core.d.ts +11 -0
  89. package/dist/contracts/ids-core.js +14 -0
  90. package/dist/contracts/ids.d.ts +7 -4
  91. package/dist/contracts/ids.js +12 -4
  92. package/dist/contracts/internal.d.ts +18 -0
  93. package/dist/contracts/internal.js +19 -0
  94. package/dist/contracts/mcp.d.ts +8 -18
  95. package/dist/contracts/mcp.js +2 -23
  96. package/dist/contracts/notifications.d.ts +4 -1
  97. package/dist/contracts/notifications.js +1 -0
  98. package/dist/contracts/oauth-resources.d.ts +55 -9
  99. package/dist/contracts/oauth-resources.js +64 -1
  100. package/dist/contracts/oauth-scope-actions.d.ts +27 -3
  101. package/dist/contracts/oauth-scope-actions.js +18 -8
  102. package/dist/contracts/operations.d.ts +1 -1
  103. package/dist/contracts/partner-account.d.ts +629 -0
  104. package/dist/contracts/partner-account.js +18 -0
  105. package/dist/contracts/principal-assertion.d.ts +74 -1
  106. package/dist/contracts/principal-assertion.js +67 -3
  107. package/dist/contracts/publish-archive.d.ts +22 -1
  108. package/dist/contracts/push-new.d.ts +3 -3
  109. package/dist/contracts/push-new.js +1 -1
  110. package/dist/contracts/quotas.js +2 -1
  111. package/dist/contracts/repository-connections.d.ts +10 -6
  112. package/dist/contracts/repository-connections.js +15 -0
  113. package/dist/contracts/resources.d.ts +6 -5
  114. package/dist/contracts/resources.js +7 -0
  115. package/dist/contracts/route-inventory.d.ts +74 -19
  116. package/dist/contracts/route-inventory.js +20 -6
  117. package/dist/contracts/runtime-api.d.ts +415 -4
  118. package/dist/contracts/runtime-api.js +60 -15
  119. package/dist/contracts/runtime-app.d.ts +6 -1
  120. package/dist/contracts/runtime-components.d.ts +646 -18
  121. package/dist/contracts/runtime-components.js +304 -188
  122. package/dist/contracts/runtime-services.d.ts +15 -0
  123. package/dist/contracts/runtime-services.js +25 -0
  124. package/dist/contracts/runtime-storage.d.ts +32 -0
  125. package/dist/contracts/runtime-storage.js +37 -0
  126. package/dist/contracts/source-workspaces.d.ts +511 -0
  127. package/dist/contracts/source-workspaces.js +276 -0
  128. package/dist/contracts/space-config-spacefast.d.ts +394 -0
  129. package/dist/contracts/space-config-spacefast.js +70 -0
  130. package/dist/contracts/space-config.d.ts +177 -90
  131. package/dist/contracts/space-config.js +77 -92
  132. package/dist/contracts/spaces.d.ts +132 -24
  133. package/dist/contracts/spaces.js +77 -13
  134. package/dist/contracts/superadmin-connectors.d.ts +371 -0
  135. package/dist/contracts/superadmin-connectors.js +61 -0
  136. package/dist/contracts/superadmin-emails.d.ts +1 -1
  137. package/dist/contracts/superadmin-emails.js +1 -1
  138. package/dist/contracts/superadmin-entities.d.ts +105 -0
  139. package/dist/contracts/superadmin-entities.js +64 -0
  140. package/dist/contracts/superadmin-runtime.d.ts +35 -116
  141. package/dist/contracts/superadmin-runtime.js +13 -69
  142. package/dist/contracts/superadmin-search.d.ts +12 -14
  143. package/dist/contracts/superadmin-search.js +2 -2
  144. package/dist/contracts/superadmin-spaces.d.ts +15 -72
  145. package/dist/contracts/superadmin-spaces.js +2 -7
  146. package/dist/contracts/superadmin-teams.d.ts +12 -0
  147. package/dist/contracts/superadmin-teams.js +7 -1
  148. package/dist/contracts/superadmin-tenants.d.ts +44 -16
  149. package/dist/contracts/superadmin.d.ts +2 -2
  150. package/dist/contracts/tags.d.ts +12 -12
  151. package/dist/contracts/teams.d.ts +29 -1
  152. package/dist/contracts/teams.js +24 -2
  153. package/dist/contracts/tenants.d.ts +98 -0
  154. package/dist/contracts/tenants.js +20 -0
  155. package/dist/contracts/transfers.d.ts +92 -0
  156. package/dist/contracts/transfers.js +37 -0
  157. package/dist/contracts/usage.d.ts +9 -1
  158. package/dist/contracts/usage.js +2 -0
  159. package/dist/contracts/visual-review.d.ts +448 -0
  160. package/dist/contracts/visual-review.js +156 -0
  161. package/dist/contracts/wordpress-php-toolkit.json +9 -0
  162. package/dist/contracts/work-mode.d.ts +24 -0
  163. package/dist/contracts/work-mode.js +17 -0
  164. package/dist/contracts/wp-cli.d.ts +66 -0
  165. package/dist/contracts/wp-cli.js +68 -0
  166. package/dist/contracts/zero-catalog.d.ts +29 -0
  167. package/dist/contracts/zero-catalog.js +55 -0
  168. package/dist/contracts/zero-platform-abilities.generated.d.ts +31 -0
  169. package/dist/contracts/zero-platform-abilities.generated.js +373 -0
  170. package/dist/contracts/zero-spacefast.d.ts +444 -0
  171. package/dist/contracts/zero-spacefast.js +149 -0
  172. package/dist/contracts/zero-types.d.ts +47 -0
  173. package/dist/contracts/zero-types.js +263 -0
  174. package/dist/contracts/zero.d.ts +781 -14
  175. package/dist/contracts/zero.js +204 -10
  176. package/dist/dashboard-paths/index.d.ts +2 -2
  177. package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -2
  178. package/dist/dashboard-paths/route-reservations.generated.js +5 -0
  179. package/dist/docs/agent-prose.d.ts +1 -1
  180. package/dist/docs/agent-prose.js +15 -18
  181. package/dist/docs/agent-setup.d.ts +1 -1
  182. package/dist/docs/agent-setup.js +5 -13
  183. package/dist/docs/catalog.d.ts +64 -28
  184. package/dist/docs/catalog.js +155 -28
  185. package/dist/docs/error-docs.d.ts +365 -17
  186. package/dist/docs/error-docs.js +369 -21
  187. package/dist/docs/reference-urls.js +1 -1
  188. package/dist/docs/skills.d.ts +84 -84
  189. package/dist/docs/skills.js +66 -47
  190. package/dist/docs/start-prompts.d.ts +14 -0
  191. package/dist/docs/start-prompts.js +20 -0
  192. package/dist/utils/account-labels.d.ts +7 -0
  193. package/dist/utils/account-labels.js +15 -0
  194. package/dist/utils/auth.d.ts +1 -0
  195. package/dist/utils/auth.js +1 -0
  196. package/dist/utils/credential-policy.d.ts +22 -1
  197. package/dist/utils/credential-policy.js +55 -6
  198. package/dist/utils/local-space-state.d.ts +7 -0
  199. package/dist/utils/local-space-state.js +7 -0
  200. package/dist/utils/logger.d.ts +34 -0
  201. package/dist/utils/logger.js +144 -0
  202. package/dist/utils/page-routes.d.ts +9 -0
  203. package/dist/utils/page-routes.js +82 -0
  204. package/dist/utils/pages.d.ts +2 -0
  205. package/dist/utils/pages.js +7 -0
  206. package/dist/utils/publish-form-data.d.ts +2 -0
  207. package/dist/utils/publish-form-data.js +2 -0
  208. package/dist/utils/publish-policy-spacefast.d.ts +13 -0
  209. package/dist/utils/publish-policy-spacefast.js +117 -0
  210. package/dist/utils/publish-policy.d.ts +22 -16
  211. package/dist/utils/publish-policy.fixtures.json +15 -0
  212. package/dist/utils/publish-policy.js +62 -139
  213. package/dist/utils/query-client.js +9 -1
  214. package/dist/utils/runtime-upload.d.ts +4 -0
  215. package/dist/utils/runtime-upload.js +5 -0
  216. package/dist/utils/space-config.d.ts +2 -3
  217. package/dist/utils/space-config.js +1 -1
  218. package/dist/utils/uploaded-source.d.ts +4 -0
  219. package/dist/utils/uploaded-source.js +12 -0
  220. package/dist/visual-review.d.ts +4 -0
  221. package/dist/visual-review.js +208 -0
  222. package/dist/vocabulary.d.ts +38 -0
  223. package/dist/vocabulary.js +55 -0
  224. package/package.json +7 -2
  225. package/dist/agents/registry/deeplink-probes.d.ts +0 -23
  226. package/dist/agents/registry/deeplink-probes.js +0 -18
@@ -0,0 +1,70 @@
1
+ import { z } from "zod";
2
+ import { defaultPlanNameSchema, planCatalogSchema } from "./commerce.js";
3
+ import { spaceConfigFileSchema, spaceSystemManifestSchema, stripHiddenSpaceConfigKeys, SPACE_CONFIG_ROUTING_SCHEMA_PROPERTIES, SPACE_CONFIG_SCHEMA_URL, } from "./space-config.js";
4
+ // The Spacefast overlay on the space config format: the parts of `sf.jsonc` that
5
+ // only mean something to this host. Today that is the tenant plan catalog a
6
+ // partner's system space declares, and the published JSON Schema artifact that
7
+ // has to describe it.
8
+ /**
9
+ * The system manifest as Spacefast parses it: the format's manifest plus the
10
+ * per-tenant plan catalog. Metering is host material, so `plans` lives here
11
+ * rather than in the format.
12
+ */
13
+ export const spacefastSpaceSystemManifestSchema = spaceSystemManifestSchema
14
+ .extend({
15
+ plans: planCatalogSchema
16
+ .optional()
17
+ .describe("Per-tenant plan catalog: plan name → { features, quotas.spaces, quotaPolicy }. Feature keys validated against the live vocabulary; plan names are arbitrary."),
18
+ defaultPlan: defaultPlanNameSchema
19
+ .optional()
20
+ .describe("Plan unassigned principals fall back to. Must be a key in `plans`."),
21
+ })
22
+ .superRefine((manifest, ctx) => {
23
+ if (manifest.defaultPlan === undefined) {
24
+ return;
25
+ }
26
+ // A defaultPlan is only meaningful against a declared catalog: it must name a
27
+ // plan the same manifest declares, or gate resolution would fall back to a
28
+ // plan that does not exist.
29
+ if (manifest.plans === undefined || !(manifest.defaultPlan in manifest.plans)) {
30
+ ctx.addIssue({
31
+ code: z.ZodIssueCode.custom,
32
+ path: ["defaultPlan"],
33
+ message: "defaultPlan must be one of the plan names declared in `plans`.",
34
+ });
35
+ }
36
+ });
37
+ /**
38
+ * The `sf.jsonc` FILE shape as Spacefast parses it. Every intake seam that may
39
+ * receive a partner's system manifest — finalize, the CLI's project config —
40
+ * parses through this; the format's own schema rejects `system.plans` outright,
41
+ * so a seam that forgets fails loudly instead of dropping the catalog.
42
+ */
43
+ export const spacefastSpaceConfigFileSchema = spaceConfigFileSchema.extend({
44
+ system: spacefastSpaceSystemManifestSchema
45
+ .optional()
46
+ .describe("Control-plane system-space manifest. Honored only for a tenant's designated system space; other spaces' declarations are ignored."),
47
+ });
48
+ const spaceConfigJsonValueSchema = z.json();
49
+ const spaceConfigJsonObjectSchema = z.record(z.string(), spaceConfigJsonValueSchema);
50
+ /**
51
+ * The published JSON Schema artifact for `sf.jsonc`, generated from the zod file
52
+ * schema. Served at SPACE_CONFIG_SCHEMA_URL so editors and agents get
53
+ * autocomplete and validation — including the host keys, since the document an
54
+ * editor resolves describes what this host accepts.
55
+ */
56
+ export function spaceConfigJsonSchema() {
57
+ const schema = spaceConfigJsonObjectSchema.parse(stripHiddenSpaceConfigKeys({
58
+ ...z.toJSONSchema(spacefastSpaceConfigFileSchema, { target: "draft-7", io: "input" }),
59
+ $id: SPACE_CONFIG_SCHEMA_URL,
60
+ title: "Spacefast space configuration (sf.jsonc)",
61
+ }));
62
+ const properties = spaceConfigJsonObjectSchema.parse(schema.properties);
63
+ return {
64
+ ...schema,
65
+ properties: {
66
+ ...properties,
67
+ ...SPACE_CONFIG_ROUTING_SCHEMA_PROPERTIES,
68
+ },
69
+ };
70
+ }
@@ -53,16 +53,16 @@ export declare const SPACE_CONFIG_CAPS: {
53
53
  /** Max `system.api.allowedOrigins` entries. */
54
54
  readonly systemApiAllowedOrigins: 32;
55
55
  /** Max `system.tokenIssuers` entries. */
56
- readonly systemTokenIssuers: 16;
56
+ readonly systemTokenIssuers: 1;
57
57
  /** Max `system.tokenIssuers[].issuer` length. */
58
58
  readonly systemIssuerChars: 512;
59
59
  /** Max `system.tokenIssuers[].keys` entries. */
60
- readonly systemIssuerKeys: 16;
60
+ readonly systemIssuerKeys: 5;
61
61
  /** Max `system.tokenIssuers[].keys[].kid` length. */
62
62
  readonly systemKeyIdChars: 64;
63
63
  /** Exact raw Ed25519 public-key length after base64url encoding. */
64
64
  readonly systemPublicKeyChars: 43;
65
- /** Max `system.tokenIssuers[].proof` length. */
65
+ /** Max `system.tokenIssuers[].proofs[]` length. */
66
66
  readonly systemProofChars: 4096;
67
67
  /** Max `system.subscriptions` entries. */
68
68
  readonly systemSubscriptions: 32;
@@ -71,8 +71,15 @@ export declare const SPACE_CONFIG_CAPS: {
71
71
  /** Max length of a `system.subscriptions[].events` name. */
72
72
  readonly systemEventChars: 128;
73
73
  };
74
- /** Published JSON Schema URL for `sf.jsonc` ($schema autocomplete). */
75
- export declare const SPACE_CONFIG_SCHEMA_URL: string;
74
+ /**
75
+ * Published JSON Schema URL for `sf.jsonc` ($schema autocomplete).
76
+ *
77
+ * A format identifier, not a brand string: the `$schema` an editor resolves is
78
+ * one document at one URL for every space, so it is compiled in rather than
79
+ * resolved through the hostname registry. The literal is checked against that
80
+ * registry in `config/domains.test.ts`.
81
+ */
82
+ export declare const SPACE_CONFIG_SCHEMA_URL = "https://spacefast.com/schemas/sf.json";
76
83
  export declare const spacePageThemeSchema: z.ZodObject<{
77
84
  accent: z.ZodOptional<z.ZodString>;
78
85
  background: z.ZodOptional<z.ZodString>;
@@ -178,7 +185,6 @@ export declare const spaceConfigSchema: z.ZodObject<{
178
185
  burstable: z.ZodOptional<z.ZodBoolean>;
179
186
  }, z.core.$strict>>;
180
187
  markdownNegotiation: z.ZodOptional<z.ZodBoolean>;
181
- experimental_gutenberg: z.ZodOptional<z.ZodBoolean>;
182
188
  inject: z.ZodOptional<z.ZodObject<{
183
189
  head: z.ZodOptional<z.ZodArray<z.ZodString>>;
184
190
  bodyStart: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -306,21 +312,33 @@ export declare const systemHostnamesSchema: z.ZodObject<{
306
312
  apex: z.ZodOptional<z.ZodString>;
307
313
  }, z.core.$strict>;
308
314
  export declare const systemApiSchema: z.ZodObject<{
309
- origin: z.ZodOptional<z.ZodString>;
310
- allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
315
+ origin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
316
+ allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
311
317
  }, z.core.$strict>;
318
+ export declare const systemTokenIssuerKeysSchema: z.ZodArray<z.ZodObject<{
319
+ kid: z.ZodString;
320
+ publicKey: z.ZodString;
321
+ }, z.core.$strict>>;
322
+ export declare const systemTokenIssuerProofsSchema: z.ZodArray<z.ZodString>;
312
323
  export declare const systemTokenIssuerSchema: z.ZodObject<{
313
324
  issuer: z.ZodString;
314
325
  keys: z.ZodArray<z.ZodObject<{
315
326
  kid: z.ZodString;
316
327
  publicKey: z.ZodString;
317
328
  }, z.core.$strict>>;
318
- proof: z.ZodOptional<z.ZodString>;
329
+ proofs: z.ZodOptional<z.ZodArray<z.ZodString>>;
319
330
  }, z.core.$strict>;
320
331
  export declare const systemSubscriptionSchema: z.ZodObject<{
321
332
  url: z.ZodString;
322
333
  events: z.ZodArray<z.ZodString>;
323
334
  }, z.core.$strict>;
335
+ /**
336
+ * Metering is the host's, not the format's: what a plan is, what it costs and
337
+ * which quotas it carries is Spacefast's commerce model. The manifest's plan
338
+ * catalog is therefore declared in `./space-config-spacefast.js`, which extends
339
+ * this object — parse an sf.jsonc that may declare plans through
340
+ * `spacefastSpaceConfigFileSchema` there, never through the schema below.
341
+ */
324
342
  export declare const spaceSystemManifestSchema: z.ZodObject<{
325
343
  presentation: z.ZodOptional<z.ZodObject<{
326
344
  name: z.ZodOptional<z.ZodString>;
@@ -335,8 +353,8 @@ export declare const spaceSystemManifestSchema: z.ZodObject<{
335
353
  apex: z.ZodOptional<z.ZodString>;
336
354
  }, z.core.$strict>>;
337
355
  api: z.ZodOptional<z.ZodObject<{
338
- origin: z.ZodOptional<z.ZodString>;
339
- allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
356
+ origin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
357
+ allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
340
358
  }, z.core.$strict>>;
341
359
  tokenIssuers: z.ZodOptional<z.ZodArray<z.ZodObject<{
342
360
  issuer: z.ZodString;
@@ -344,47 +362,12 @@ export declare const spaceSystemManifestSchema: z.ZodObject<{
344
362
  kid: z.ZodString;
345
363
  publicKey: z.ZodString;
346
364
  }, z.core.$strict>>;
347
- proof: z.ZodOptional<z.ZodString>;
365
+ proofs: z.ZodOptional<z.ZodArray<z.ZodString>>;
348
366
  }, z.core.$strict>>>;
349
367
  subscriptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
350
368
  url: z.ZodString;
351
369
  events: z.ZodArray<z.ZodString>;
352
370
  }, z.core.$strict>>>;
353
- plans: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
354
- features: z.ZodArray<z.ZodEnum<{
355
- zero: "zero";
356
- "plans.paid.available": "plans.paid.available";
357
- "anonymous.publishing": "anonymous.publishing";
358
- "beta.enrollment_gate": "beta.enrollment_gate";
359
- "domains.search": "domains.search";
360
- "domains.registration": "domains.registration";
361
- "domains.dns_management": "domains.dns_management";
362
- "domains.wpcom_dns": "domains.wpcom_dns";
363
- "domains.domain_connect": "domains.domain_connect";
364
- "domains.proxy_bindings": "domains.proxy_bindings";
365
- "collab.notices": "collab.notices";
366
- "collab.comments": "collab.comments";
367
- "content.managed": "content.managed";
368
- "sites.dedicated_runtime": "sites.dedicated_runtime";
369
- "collab.drawing": "collab.drawing";
370
- tags: "tags";
371
- functions: "functions";
372
- "spaces.slug_rename": "spaces.slug_rename";
373
- "pages.templates": "pages.templates";
374
- "branding.hide": "branding.hide";
375
- }>>;
376
- quotas: z.ZodObject<{
377
- spaces: z.ZodOptional<z.ZodNumber>;
378
- storageBytes: z.ZodOptional<z.ZodNumber>;
379
- buildMinutesPerMonth: z.ZodOptional<z.ZodNumber>;
380
- customDomains: z.ZodOptional<z.ZodNumber>;
381
- }, z.core.$strict>;
382
- quotaPolicy: z.ZodOptional<z.ZodEnum<{
383
- warn: "warn";
384
- block: "block";
385
- }>>;
386
- }, z.core.$strict>>>;
387
- defaultPlan: z.ZodOptional<z.ZodString>;
388
371
  }, z.core.$strict>;
389
372
  export type SpaceSystemManifest = z.infer<typeof spaceSystemManifestSchema>;
390
373
  /**
@@ -478,7 +461,6 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
478
461
  burstable: z.ZodOptional<z.ZodBoolean>;
479
462
  }, z.core.$strict>>;
480
463
  markdownNegotiation: z.ZodOptional<z.ZodBoolean>;
481
- experimental_gutenberg: z.ZodOptional<z.ZodBoolean>;
482
464
  inject: z.ZodOptional<z.ZodObject<{
483
465
  head: z.ZodOptional<z.ZodArray<z.ZodString>>;
484
466
  bodyStart: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -522,8 +504,8 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
522
504
  apex: z.ZodOptional<z.ZodString>;
523
505
  }, z.core.$strict>>;
524
506
  api: z.ZodOptional<z.ZodObject<{
525
- origin: z.ZodOptional<z.ZodString>;
526
- allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
507
+ origin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
508
+ allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
527
509
  }, z.core.$strict>>;
528
510
  tokenIssuers: z.ZodOptional<z.ZodArray<z.ZodObject<{
529
511
  issuer: z.ZodString;
@@ -531,54 +513,159 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
531
513
  kid: z.ZodString;
532
514
  publicKey: z.ZodString;
533
515
  }, z.core.$strict>>;
534
- proof: z.ZodOptional<z.ZodString>;
516
+ proofs: z.ZodOptional<z.ZodArray<z.ZodString>>;
535
517
  }, z.core.$strict>>>;
536
518
  subscriptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
537
519
  url: z.ZodString;
538
520
  events: z.ZodArray<z.ZodString>;
539
521
  }, z.core.$strict>>>;
540
- plans: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
541
- features: z.ZodArray<z.ZodEnum<{
542
- zero: "zero";
543
- "plans.paid.available": "plans.paid.available";
544
- "anonymous.publishing": "anonymous.publishing";
545
- "beta.enrollment_gate": "beta.enrollment_gate";
546
- "domains.search": "domains.search";
547
- "domains.registration": "domains.registration";
548
- "domains.dns_management": "domains.dns_management";
549
- "domains.wpcom_dns": "domains.wpcom_dns";
550
- "domains.domain_connect": "domains.domain_connect";
551
- "domains.proxy_bindings": "domains.proxy_bindings";
552
- "collab.notices": "collab.notices";
553
- "collab.comments": "collab.comments";
554
- "content.managed": "content.managed";
555
- "sites.dedicated_runtime": "sites.dedicated_runtime";
556
- "collab.drawing": "collab.drawing";
557
- tags: "tags";
558
- functions: "functions";
559
- "spaces.slug_rename": "spaces.slug_rename";
560
- "pages.templates": "pages.templates";
561
- "branding.hide": "branding.hide";
562
- }>>;
563
- quotas: z.ZodObject<{
564
- spaces: z.ZodOptional<z.ZodNumber>;
565
- storageBytes: z.ZodOptional<z.ZodNumber>;
566
- buildMinutesPerMonth: z.ZodOptional<z.ZodNumber>;
567
- customDomains: z.ZodOptional<z.ZodNumber>;
568
- }, z.core.$strict>;
569
- quotaPolicy: z.ZodOptional<z.ZodEnum<{
570
- warn: "warn";
571
- block: "block";
572
- }>>;
573
- }, z.core.$strict>>>;
574
- defaultPlan: z.ZodOptional<z.ZodString>;
575
522
  }, z.core.$strict>>;
576
523
  }, z.core.$strip>;
577
524
  export type SpaceConfigFile = z.infer<typeof spaceConfigFileSchema>;
578
525
  /**
579
- * The published JSON Schema artifact for `sf.jsonc`, generated from the
580
- * zod file schema. Served at SPACE_CONFIG_SCHEMA_URL so editors and agents get
581
- * autocomplete and validation.
526
+ * Routing keys as JSON Schema. `redirects`, `rewrites` and `headers` are real
527
+ * sf.jsonc keys owned by the routing compiler rather than by the serving shape
528
+ * above, so a generated schema has to describe them separately or an editor
529
+ * reads the documented routing examples as unknown keys.
582
530
  */
583
- export declare function spaceConfigJsonSchema(): Record<string, unknown>;
531
+ export declare const SPACE_CONFIG_ROUTING_SCHEMA_PROPERTIES: {
532
+ readonly redirects: {
533
+ readonly type: "array";
534
+ readonly description: "Browser redirect rules. Same matcher grammar as _redirects, and _redirects rules match first.";
535
+ readonly items: {
536
+ readonly type: "object";
537
+ readonly properties: {
538
+ readonly source: {
539
+ readonly type: "string";
540
+ readonly minLength: 1;
541
+ readonly description: "Request path to match. * is a splat, :name captures a segment.";
542
+ };
543
+ readonly destination: {
544
+ readonly type: "string";
545
+ readonly minLength: 1;
546
+ readonly description: "Path or absolute URL. :splat and :name from the source are substituted.";
547
+ };
548
+ readonly status: {
549
+ readonly enum: readonly [301, 302, 303, 307, 308];
550
+ readonly default: 302;
551
+ readonly description: "Redirect status. To serve other content under this URL, use rewrites.";
552
+ };
553
+ readonly force: {
554
+ readonly type: "boolean";
555
+ readonly default: false;
556
+ readonly description: "Answer even when the request path resolves to a committed file, the ! of a _redirects rule.";
557
+ };
558
+ readonly query: {
559
+ readonly type: "object";
560
+ readonly description: "Query parameters the request must carry, as parameter name to capture name: { \"id\": \"id\" } is the name=:capture token id=:id.";
561
+ readonly propertyNames: {
562
+ readonly pattern: "^[A-Za-z_][A-Za-z0-9_-]*$";
563
+ };
564
+ readonly additionalProperties: {
565
+ readonly type: "string";
566
+ readonly pattern: "^[A-Za-z][A-Za-z0-9_]*$";
567
+ };
568
+ };
569
+ };
570
+ readonly required: readonly ["source", "destination"];
571
+ readonly additionalProperties: false;
572
+ };
573
+ };
574
+ readonly rewrites: {
575
+ readonly type: "array";
576
+ readonly description: "Rewrite and proxy rules: the URL stays, the content comes from the destination. _redirects rules match first, then redirects.";
577
+ readonly items: {
578
+ readonly type: "object";
579
+ readonly properties: {
580
+ readonly source: {
581
+ readonly type: "string";
582
+ readonly minLength: 1;
583
+ readonly description: "Request path to match. * is a splat, :name captures a segment.";
584
+ };
585
+ readonly destination: {
586
+ readonly type: "string";
587
+ readonly minLength: 1;
588
+ readonly description: "Path to serve under this URL, or an absolute URL to proxy. :splat and :name from the source are substituted.";
589
+ };
590
+ readonly cache: {
591
+ readonly const: "shared";
592
+ readonly description: "Let shared caches store the proxy response. Absolute-URL destinations only.";
593
+ };
594
+ readonly force: {
595
+ readonly type: "boolean";
596
+ readonly default: false;
597
+ readonly description: "Answer even when the request path resolves to a committed file, the ! of a _redirects rule.";
598
+ };
599
+ readonly query: {
600
+ readonly type: "object";
601
+ readonly description: "Query parameters the request must carry, as parameter name to capture name: { \"id\": \"id\" } is the name=:capture token id=:id.";
602
+ readonly propertyNames: {
603
+ readonly pattern: "^[A-Za-z_][A-Za-z0-9_-]*$";
604
+ };
605
+ readonly additionalProperties: {
606
+ readonly type: "string";
607
+ readonly pattern: "^[A-Za-z][A-Za-z0-9_]*$";
608
+ };
609
+ };
610
+ readonly notFound: {
611
+ readonly type: "boolean";
612
+ readonly default: false;
613
+ readonly description: "Serve the destination with status 404, the 404 of a _redirects rule. The destination must be a path.";
614
+ };
615
+ };
616
+ readonly required: readonly ["source", "destination"];
617
+ readonly additionalProperties: false;
618
+ };
619
+ };
620
+ readonly headers: {
621
+ readonly type: "array";
622
+ readonly description: "Response headers to set or remove on matching requests. A _headers rule wins on the same header name.";
623
+ readonly items: {
624
+ readonly type: "object";
625
+ readonly properties: {
626
+ readonly source: {
627
+ readonly type: "string";
628
+ readonly minLength: 1;
629
+ readonly description: "Request path to match.";
630
+ };
631
+ readonly headers: {
632
+ readonly type: "array";
633
+ readonly minItems: 1;
634
+ readonly items: {
635
+ readonly oneOf: readonly [{
636
+ readonly type: "object";
637
+ readonly properties: {
638
+ readonly key: {
639
+ readonly type: "string";
640
+ readonly minLength: 1;
641
+ };
642
+ readonly value: {
643
+ readonly type: "string";
644
+ };
645
+ };
646
+ readonly required: readonly ["key", "value"];
647
+ readonly additionalProperties: false;
648
+ }, {
649
+ readonly type: "object";
650
+ readonly properties: {
651
+ readonly key: {
652
+ readonly type: "string";
653
+ readonly minLength: 1;
654
+ };
655
+ readonly remove: {
656
+ readonly const: true;
657
+ readonly description: "Remove this header instead of setting it, the !Name line of a _headers block.";
658
+ };
659
+ };
660
+ readonly required: readonly ["key", "remove"];
661
+ readonly additionalProperties: false;
662
+ }];
663
+ };
664
+ };
665
+ };
666
+ readonly required: readonly ["source", "headers"];
667
+ readonly additionalProperties: false;
668
+ };
669
+ };
670
+ };
584
671
  export declare function stripHiddenSpaceConfigKeys(schema: unknown): unknown;