@spacefast/common 0.0.5 → 0.0.7

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 (183) hide show
  1. package/brand-assets/spacefast-favicon.svg +16 -0
  2. package/brand-assets/spacefast-sf-full-bleed.svg +13 -0
  3. package/brand-assets/spacefast-wordmark.svg +5 -0
  4. package/dist/agents/connect-targets.d.ts +138 -0
  5. package/dist/agents/connect-targets.js +243 -0
  6. package/dist/brand-assets-build.d.ts +26 -0
  7. package/dist/brand-assets-build.js +81 -0
  8. package/dist/brand-assets.d.ts +42 -0
  9. package/dist/brand-assets.js +30 -0
  10. package/dist/brand.d.ts +1 -0
  11. package/dist/brand.js +5 -0
  12. package/dist/config/domains.d.ts +12 -6
  13. package/dist/config/domains.js +30 -38
  14. package/dist/contracts/access.d.ts +967 -124
  15. package/dist/contracts/access.js +804 -148
  16. package/dist/contracts/activity.d.ts +1 -1
  17. package/dist/contracts/activity.js +28 -2
  18. package/dist/contracts/annotations.d.ts +2 -4
  19. package/dist/contracts/api-keys.d.ts +126 -4
  20. package/dist/contracts/api-keys.js +74 -6
  21. package/dist/contracts/archives.d.ts +8 -2
  22. package/dist/contracts/archives.js +11 -4
  23. package/dist/contracts/billing.d.ts +0 -9
  24. package/dist/contracts/builds.d.ts +65 -21
  25. package/dist/contracts/builds.js +29 -0
  26. package/dist/contracts/common.d.ts +2 -0
  27. package/dist/contracts/common.js +4 -0
  28. package/dist/contracts/continuation.d.ts +0 -3
  29. package/dist/contracts/countries.d.ts +2 -0
  30. package/dist/contracts/countries.js +261 -0
  31. package/dist/contracts/deployments.d.ts +34 -34
  32. package/dist/contracts/device-auth.d.ts +4 -11
  33. package/dist/contracts/device-auth.js +4 -0
  34. package/dist/contracts/docs.d.ts +119 -0
  35. package/dist/contracts/docs.js +51 -0
  36. package/dist/contracts/domains.d.ts +96 -54
  37. package/dist/contracts/domains.js +26 -4
  38. package/dist/contracts/enums.d.ts +15 -16
  39. package/dist/contracts/enums.js +26 -14
  40. package/dist/contracts/error-code-meta.d.ts +184 -0
  41. package/dist/contracts/error-code-meta.js +124 -10
  42. package/dist/contracts/error-codes.d.ts +1 -1
  43. package/dist/contracts/error-codes.js +42 -0
  44. package/dist/contracts/events.d.ts +1 -1
  45. package/dist/contracts/feature-lifecycle-core.d.ts +36 -0
  46. package/dist/contracts/feature-lifecycle-core.js +220 -0
  47. package/dist/contracts/feature-lifecycle.d.ts +7 -0
  48. package/dist/contracts/feature-lifecycle.js +31 -0
  49. package/dist/contracts/features.d.ts +76 -6
  50. package/dist/contracts/features.js +178 -13
  51. package/dist/contracts/generated-feature-launch-entries.d.ts +2 -0
  52. package/dist/contracts/generated-feature-launch-entries.js +518 -0
  53. package/dist/contracts/git.d.ts +2 -8
  54. package/dist/contracts/ids.d.ts +9 -0
  55. package/dist/contracts/ids.js +13 -0
  56. package/dist/contracts/mcp.d.ts +8 -10
  57. package/dist/contracts/me.js +1 -1
  58. package/dist/contracts/oauth-resources.d.ts +19 -8
  59. package/dist/contracts/oauth-resources.js +44 -13
  60. package/dist/contracts/operations.d.ts +161 -1
  61. package/dist/contracts/operations.js +49 -1
  62. package/dist/contracts/platform.d.ts +6 -102
  63. package/dist/contracts/platform.js +6 -50
  64. package/dist/contracts/publishes.d.ts +130 -0
  65. package/dist/contracts/publishes.js +145 -0
  66. package/dist/contracts/push-new.d.ts +4 -4
  67. package/dist/contracts/quotas.d.ts +2 -0
  68. package/dist/contracts/quotas.js +8 -0
  69. package/dist/contracts/repository-connections.d.ts +9 -8
  70. package/dist/contracts/repository-connections.js +13 -0
  71. package/dist/contracts/resources.d.ts +99 -13
  72. package/dist/contracts/resources.js +36 -4
  73. package/dist/contracts/routes.d.ts +0 -2
  74. package/dist/contracts/runtime-api.d.ts +363 -39
  75. package/dist/contracts/runtime-api.js +276 -6
  76. package/dist/contracts/sf-config-v1.d.ts +75 -0
  77. package/dist/contracts/sf-config-v1.js +6 -0
  78. package/dist/contracts/sites.d.ts +19 -2
  79. package/dist/contracts/sites.js +21 -0
  80. package/dist/contracts/space-config.d.ts +201 -2
  81. package/dist/contracts/space-config.js +135 -5
  82. package/dist/contracts/spaces.d.ts +376 -196
  83. package/dist/contracts/spaces.js +62 -10
  84. package/dist/contracts/superadmin-emails.d.ts +4 -2
  85. package/dist/contracts/superadmin-emails.js +8 -0
  86. package/dist/contracts/superadmin-queues.d.ts +26 -26
  87. package/dist/contracts/superadmin-spaces.d.ts +172 -42
  88. package/dist/contracts/superadmin-tenants.d.ts +6 -6
  89. package/dist/contracts/superadmin-tenants.js +6 -11
  90. package/dist/contracts/superadmin.d.ts +6 -93
  91. package/dist/contracts/superadmin.js +6 -14
  92. package/dist/contracts/tags.d.ts +10 -9
  93. package/dist/contracts/tags.js +2 -1
  94. package/dist/contracts/teams.d.ts +26 -30
  95. package/dist/contracts/teams.js +11 -17
  96. package/dist/contracts/theme-json.d.ts +30 -0
  97. package/dist/contracts/theme-json.js +48 -0
  98. package/dist/contracts/variables.d.ts +0 -2
  99. package/dist/contracts/variables.js +0 -5
  100. package/dist/contracts/webhooks.d.ts +2 -0
  101. package/dist/contracts/webhooks.js +1 -1
  102. package/dist/contracts/zero.d.ts +5 -10
  103. package/dist/docs/agent-prose.d.ts +43 -3
  104. package/dist/docs/agent-prose.js +146 -7
  105. package/dist/docs/agent-setup.d.ts +51 -0
  106. package/dist/docs/agent-setup.js +211 -14
  107. package/dist/docs/agent-solutions.d.ts +5 -5
  108. package/dist/docs/agent-solutions.js +2 -2
  109. package/dist/docs/catalog.d.ts +650 -0
  110. package/dist/docs/catalog.js +758 -0
  111. package/dist/docs/error-docs.d.ts +0 -2
  112. package/dist/docs/error-docs.js +189 -35
  113. package/dist/docs/index-build.d.ts +17 -0
  114. package/dist/docs/index-build.js +24 -0
  115. package/dist/docs/search.d.ts +54 -0
  116. package/dist/docs/search.js +96 -0
  117. package/dist/docs/skill-distribution.d.ts +5 -3
  118. package/dist/docs/skill-distribution.js +8 -8
  119. package/dist/slug-policy/blocklist.d.ts +4 -0
  120. package/dist/slug-policy/blocklist.js +122 -0
  121. package/dist/slug-policy/index.d.ts +17 -0
  122. package/dist/slug-policy/index.js +86 -0
  123. package/dist/utils/access-match.d.ts +39 -0
  124. package/dist/utils/access-match.js +296 -0
  125. package/dist/utils/auth-redirect.d.ts +3 -1
  126. package/dist/utils/auth-redirect.js +21 -1
  127. package/dist/utils/build-settings.d.ts +6 -0
  128. package/dist/utils/build-settings.js +429 -46
  129. package/dist/utils/claim-token.d.ts +8 -0
  130. package/dist/utils/claim-token.js +23 -2
  131. package/dist/utils/concurrency.d.ts +1 -0
  132. package/dist/utils/concurrency.js +22 -0
  133. package/dist/utils/content-type.d.ts +1 -0
  134. package/dist/utils/content-type.js +1 -1
  135. package/dist/utils/credential-policy.d.ts +54 -0
  136. package/dist/utils/{access-policy.js → credential-policy.js} +28 -2
  137. package/dist/utils/email.d.ts +1 -0
  138. package/dist/utils/email.js +3 -0
  139. package/dist/utils/gate-theme.d.ts +61 -0
  140. package/dist/utils/gate-theme.js +217 -0
  141. package/dist/utils/git-repository.d.ts +0 -1
  142. package/dist/utils/git-repository.js +0 -3
  143. package/dist/utils/id-hints.d.ts +8 -0
  144. package/dist/utils/id-hints.js +61 -0
  145. package/dist/utils/local-space-state.d.ts +91 -0
  146. package/dist/utils/local-space-state.js +251 -0
  147. package/dist/utils/oauth-signed-query.d.ts +8 -0
  148. package/dist/utils/oauth-signed-query.js +26 -0
  149. package/dist/utils/publish-detection.d.ts +0 -8
  150. package/dist/utils/publish-detection.js +0 -93
  151. package/dist/utils/publish-policy.d.ts +6 -5
  152. package/dist/utils/publish-policy.js +71 -7
  153. package/dist/utils/query-keys.d.ts +16 -4
  154. package/dist/utils/query-keys.js +31 -4
  155. package/dist/utils/runtime-paths.d.ts +0 -1
  156. package/dist/utils/runtime-paths.js +0 -1
  157. package/dist/utils/runtime-upload-batch.d.ts +18 -0
  158. package/dist/utils/runtime-upload-batch.js +90 -0
  159. package/dist/utils/runtime-upload.d.ts +2 -0
  160. package/dist/utils/runtime-upload.js +5 -0
  161. package/dist/utils/sf-config-v1.d.ts +2 -0
  162. package/dist/utils/sf-config-v1.js +542 -0
  163. package/dist/utils/space-config.d.ts +4 -0
  164. package/dist/utils/space-config.js +10 -1
  165. package/dist/utils/space-theme.d.ts +2 -0
  166. package/dist/utils/space-theme.js +9 -0
  167. package/dist/utils/static-runtime-policy.d.ts +0 -21
  168. package/dist/utils/static-runtime-policy.js +19 -103
  169. package/dist/utils/upload-session.d.ts +1 -1
  170. package/dist/utils/wpcom-auth-redirects.d.ts +32 -2
  171. package/dist/utils/wpcom-auth-redirects.js +26 -10
  172. package/dist/vocabulary.d.ts +130 -30
  173. package/dist/vocabulary.js +77 -36
  174. package/package.json +35 -1
  175. package/dist/contracts/account.d.ts +0 -28
  176. package/dist/contracts/account.js +0 -54
  177. package/dist/contracts/intercom.d.ts +0 -6
  178. package/dist/contracts/intercom.js +0 -5
  179. package/dist/contracts/telemetry.d.ts +0 -2
  180. package/dist/contracts/telemetry.js +0 -1
  181. package/dist/utils/access-policy.d.ts +0 -39
  182. package/dist/utils/error-display.d.ts +0 -7
  183. package/dist/utils/error-display.js +0 -42
@@ -2,8 +2,7 @@ import { z } from "zod";
2
2
  export declare const SPACE_CONFIG_CANONICAL_FILE = "sf.jsonc";
3
3
  export declare const SPACE_CONFIG_ALIAS_FILES: readonly ["spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json"];
4
4
  export declare const SPACE_CONFIG_ACCEPTED_FILES: readonly ["sf.jsonc", "spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json"];
5
- export declare const SPACE_CONFIG_RETIRED_FILES: readonly ["stattic.jsonc", "stattic.json"];
6
- export declare const SPACE_CONFIG_PRIVATE_FILES: readonly ["sf.jsonc", "spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json", "stattic.jsonc", "stattic.json"];
5
+ export declare const SPACE_CONFIG_PRIVATE_FILES: readonly ["sf.jsonc", "spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json"];
7
6
  export declare const SPACE_CONFIG_CAPS: {
8
7
  /** Max raw `sf.jsonc` size in bytes. */
9
8
  readonly fileBytes: number;
@@ -18,9 +17,44 @@ export declare const SPACE_CONFIG_CAPS: {
18
17
  readonly injectSnippetBytes: number;
19
18
  /** Max snippets per `inject` array. */
20
19
  readonly injectSnippets: 16;
20
+ /** Max `access.rules` entries in the file lane. */
21
+ readonly accessRules: 100;
22
+ /** Max `pages.theme` color token length. */
23
+ readonly pagesColorChars: 64;
24
+ /** Max `pages.theme.logo` URL/path length. */
25
+ readonly pagesLogoChars: 2000;
26
+ /** Max `pages.theme.name` display-name length. */
27
+ readonly pagesNameChars: 120;
21
28
  };
22
29
  /** Published JSON Schema URL for `sf.jsonc` ($schema autocomplete). */
23
30
  export declare const SPACE_CONFIG_SCHEMA_URL: string;
31
+ export declare const spacePagesThemeSchema: z.ZodObject<{
32
+ accent: z.ZodOptional<z.ZodString>;
33
+ background: z.ZodOptional<z.ZodString>;
34
+ logo: z.ZodOptional<z.ZodString>;
35
+ name: z.ZodOptional<z.ZodString>;
36
+ fontFamily: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strip>;
38
+ export type SpacePagesTheme = z.infer<typeof spacePagesThemeSchema>;
39
+ export declare const SF_THEME_JSONC_FILE = "sf.theme.jsonc";
40
+ export declare const sfThemeJsoncSchema: z.ZodObject<{
41
+ accent: z.ZodOptional<z.ZodString>;
42
+ background: z.ZodOptional<z.ZodString>;
43
+ logo: z.ZodOptional<z.ZodString>;
44
+ name: z.ZodOptional<z.ZodString>;
45
+ fontFamily: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$strip>;
47
+ export declare const THEME_JSON_FILE = "theme.json";
48
+ export declare const LAYOUT_TEMPLATE_FILE = ".spacefast/templates/layout.html";
49
+ export declare const spacePagesConfigSchema: z.ZodObject<{
50
+ theme: z.ZodOptional<z.ZodObject<{
51
+ accent: z.ZodOptional<z.ZodString>;
52
+ background: z.ZodOptional<z.ZodString>;
53
+ logo: z.ZodOptional<z.ZodString>;
54
+ name: z.ZodOptional<z.ZodString>;
55
+ fontFamily: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>>;
57
+ }, z.core.$strip>;
24
58
  export declare const spaceBuildSettingsSchema: z.ZodObject<{
25
59
  rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
60
  installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -34,12 +68,26 @@ export declare const spaceBuildSettingsSchema: z.ZodObject<{
34
68
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
35
69
  }, z.core.$strict>;
36
70
  export type SpaceBuildSettings = z.infer<typeof spaceBuildSettingsSchema>;
71
+ export declare const spacePlacementModeSchema: z.ZodEnum<{
72
+ shared: "shared";
73
+ dedicated: "dedicated";
74
+ }>;
75
+ export declare const spacePlacementConfigSchema: z.ZodObject<{
76
+ region: z.ZodOptional<z.ZodString>;
77
+ mode: z.ZodOptional<z.ZodEnum<{
78
+ shared: "shared";
79
+ dedicated: "dedicated";
80
+ }>>;
81
+ burstable: z.ZodOptional<z.ZodBoolean>;
82
+ }, z.core.$strict>;
83
+ export type SpacePlacementConfig = z.infer<typeof spacePlacementConfigSchema>;
37
84
  export declare const spaceConfigSchema: z.ZodObject<{
38
85
  index: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
39
86
  fallback: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
40
87
  path: z.ZodString;
41
88
  status: z.ZodNumber;
42
89
  }, z.core.$strip>]>>;
90
+ cleanUrls: z.ZodOptional<z.ZodBoolean>;
43
91
  listing: z.ZodOptional<z.ZodBoolean>;
44
92
  meta: z.ZodOptional<z.ZodObject<{
45
93
  title: z.ZodOptional<z.ZodString>;
@@ -72,6 +120,7 @@ export declare const spaceConfigSchema: z.ZodObject<{
72
120
  reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
121
  }, z.core.$strip>>>;
74
122
  }, z.core.$strip>>;
123
+ requireReview: z.ZodOptional<z.ZodBoolean>;
75
124
  }, z.core.$strip>>;
76
125
  }, z.core.$strip>>;
77
126
  templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -98,6 +147,15 @@ export declare const spaceConfigSchema: z.ZodObject<{
98
147
  }, z.core.$strip>>>;
99
148
  }, z.core.$strip>>;
100
149
  }, z.core.$strip>>;
150
+ pages: z.ZodOptional<z.ZodObject<{
151
+ theme: z.ZodOptional<z.ZodObject<{
152
+ accent: z.ZodOptional<z.ZodString>;
153
+ background: z.ZodOptional<z.ZodString>;
154
+ logo: z.ZodOptional<z.ZodString>;
155
+ name: z.ZodOptional<z.ZodString>;
156
+ fontFamily: z.ZodOptional<z.ZodString>;
157
+ }, z.core.$strip>>;
158
+ }, z.core.$strip>>;
101
159
  build: z.ZodOptional<z.ZodObject<{
102
160
  rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
161
  installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -110,6 +168,15 @@ export declare const spaceConfigSchema: z.ZodObject<{
110
168
  allowUnsupportedPlatformFeatures: z.ZodOptional<z.ZodBoolean>;
111
169
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
112
170
  }, z.core.$strict>>;
171
+ placement: z.ZodOptional<z.ZodObject<{
172
+ region: z.ZodOptional<z.ZodString>;
173
+ mode: z.ZodOptional<z.ZodEnum<{
174
+ shared: "shared";
175
+ dedicated: "dedicated";
176
+ }>>;
177
+ burstable: z.ZodOptional<z.ZodBoolean>;
178
+ }, z.core.$strict>>;
179
+ markdownNegotiation: z.ZodOptional<z.ZodBoolean>;
113
180
  experimental_gutenberg: z.ZodOptional<z.ZodBoolean>;
114
181
  inject: z.ZodOptional<z.ZodObject<{
115
182
  head: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -120,12 +187,69 @@ export declare const spaceConfigSchema: z.ZodObject<{
120
187
  }, z.core.$strip>;
121
188
  export type SpaceConfig = z.infer<typeof spaceConfigSchema>;
122
189
  export declare function spaceSuperpowersEnabled(config: SpaceConfig | null | undefined): boolean;
190
+ export declare const spaceAccessConfigSchema: z.ZodObject<{
191
+ rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
192
+ id: z.ZodOptional<z.ZodString>;
193
+ match: z.ZodDefault<z.ZodObject<{
194
+ host: z.ZodOptional<z.ZodString>;
195
+ hostPattern: z.ZodOptional<z.ZodString>;
196
+ hostTemplate: z.ZodOptional<z.ZodString>;
197
+ pathPattern: z.ZodOptional<z.ZodString>;
198
+ channel: z.ZodOptional<z.ZodString>;
199
+ ipCidrs: z.ZodOptional<z.ZodArray<z.ZodString>>;
200
+ agent: z.ZodOptional<z.ZodString>;
201
+ country: z.ZodOptional<z.ZodString>;
202
+ header: z.ZodOptional<z.ZodObject<{
203
+ name: z.ZodString;
204
+ value: z.ZodString;
205
+ }, z.core.$strip>>;
206
+ }, z.core.$strip>>;
207
+ effect: z.ZodEnum<{
208
+ allow: "allow";
209
+ deny: "deny";
210
+ challenge: "challenge";
211
+ }>;
212
+ auth: z.ZodOptional<z.ZodObject<{
213
+ requiredGrants: z.ZodArray<z.ZodString>;
214
+ issuers: z.ZodOptional<z.ZodArray<z.ZodObject<{
215
+ kid: z.ZodString;
216
+ alg: z.ZodLiteral<"EdDSA">;
217
+ publicKey: z.ZodString;
218
+ grantNamespaces: z.ZodArray<z.ZodString>;
219
+ }, z.core.$strip>>>;
220
+ acquire: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
221
+ type: z.ZodLiteral<"password">;
222
+ ref: z.ZodString;
223
+ transport: z.ZodEnum<{
224
+ basic: "basic";
225
+ form: "form";
226
+ }>;
227
+ username: z.ZodOptional<z.ZodString>;
228
+ }, z.core.$strip>, z.ZodObject<{
229
+ type: z.ZodLiteral<"login">;
230
+ url: z.ZodString;
231
+ label: z.ZodOptional<z.ZodString>;
232
+ }, z.core.$strip>], "type">>>;
233
+ }, z.core.$strip>>;
234
+ managedBy: z.ZodOptional<z.ZodEnum<{
235
+ sharing: "sharing";
236
+ firewall: "firewall";
237
+ file_share: "file_share";
238
+ cast_reviewer: "cast_reviewer";
239
+ team_default: "team_default";
240
+ }>>;
241
+ expiresAt: z.ZodOptional<z.ZodNumber>;
242
+ reasonCode: z.ZodOptional<z.ZodString>;
243
+ message: z.ZodOptional<z.ZodString>;
244
+ }, z.core.$strip>>>;
245
+ }, z.core.$strip>;
123
246
  export declare const spaceConfigFileSchema: z.ZodObject<{
124
247
  index: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
125
248
  fallback: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
126
249
  path: z.ZodString;
127
250
  status: z.ZodNumber;
128
251
  }, z.core.$strip>]>>;
252
+ cleanUrls: z.ZodOptional<z.ZodBoolean>;
129
253
  listing: z.ZodOptional<z.ZodBoolean>;
130
254
  meta: z.ZodOptional<z.ZodObject<{
131
255
  title: z.ZodOptional<z.ZodString>;
@@ -158,6 +282,7 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
158
282
  reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
159
283
  }, z.core.$strip>>>;
160
284
  }, z.core.$strip>>;
285
+ requireReview: z.ZodOptional<z.ZodBoolean>;
161
286
  }, z.core.$strip>>;
162
287
  }, z.core.$strip>>;
163
288
  templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -184,6 +309,15 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
184
309
  }, z.core.$strip>>>;
185
310
  }, z.core.$strip>>;
186
311
  }, z.core.$strip>>;
312
+ pages: z.ZodOptional<z.ZodObject<{
313
+ theme: z.ZodOptional<z.ZodObject<{
314
+ accent: z.ZodOptional<z.ZodString>;
315
+ background: z.ZodOptional<z.ZodString>;
316
+ logo: z.ZodOptional<z.ZodString>;
317
+ name: z.ZodOptional<z.ZodString>;
318
+ fontFamily: z.ZodOptional<z.ZodString>;
319
+ }, z.core.$strip>>;
320
+ }, z.core.$strip>>;
187
321
  build: z.ZodOptional<z.ZodObject<{
188
322
  rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
189
323
  installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -196,6 +330,15 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
196
330
  allowUnsupportedPlatformFeatures: z.ZodOptional<z.ZodBoolean>;
197
331
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
198
332
  }, z.core.$strict>>;
333
+ placement: z.ZodOptional<z.ZodObject<{
334
+ region: z.ZodOptional<z.ZodString>;
335
+ mode: z.ZodOptional<z.ZodEnum<{
336
+ shared: "shared";
337
+ dedicated: "dedicated";
338
+ }>>;
339
+ burstable: z.ZodOptional<z.ZodBoolean>;
340
+ }, z.core.$strict>>;
341
+ markdownNegotiation: z.ZodOptional<z.ZodBoolean>;
199
342
  experimental_gutenberg: z.ZodOptional<z.ZodBoolean>;
200
343
  inject: z.ZodOptional<z.ZodObject<{
201
344
  head: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -205,6 +348,62 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
205
348
  }, z.core.$strip>>;
206
349
  $schema: z.ZodOptional<z.ZodString>;
207
350
  space: z.ZodOptional<z.ZodString>;
351
+ access: z.ZodOptional<z.ZodObject<{
352
+ rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
353
+ id: z.ZodOptional<z.ZodString>;
354
+ match: z.ZodDefault<z.ZodObject<{
355
+ host: z.ZodOptional<z.ZodString>;
356
+ hostPattern: z.ZodOptional<z.ZodString>;
357
+ hostTemplate: z.ZodOptional<z.ZodString>;
358
+ pathPattern: z.ZodOptional<z.ZodString>;
359
+ channel: z.ZodOptional<z.ZodString>;
360
+ ipCidrs: z.ZodOptional<z.ZodArray<z.ZodString>>;
361
+ agent: z.ZodOptional<z.ZodString>;
362
+ country: z.ZodOptional<z.ZodString>;
363
+ header: z.ZodOptional<z.ZodObject<{
364
+ name: z.ZodString;
365
+ value: z.ZodString;
366
+ }, z.core.$strip>>;
367
+ }, z.core.$strip>>;
368
+ effect: z.ZodEnum<{
369
+ allow: "allow";
370
+ deny: "deny";
371
+ challenge: "challenge";
372
+ }>;
373
+ auth: z.ZodOptional<z.ZodObject<{
374
+ requiredGrants: z.ZodArray<z.ZodString>;
375
+ issuers: z.ZodOptional<z.ZodArray<z.ZodObject<{
376
+ kid: z.ZodString;
377
+ alg: z.ZodLiteral<"EdDSA">;
378
+ publicKey: z.ZodString;
379
+ grantNamespaces: z.ZodArray<z.ZodString>;
380
+ }, z.core.$strip>>>;
381
+ acquire: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
382
+ type: z.ZodLiteral<"password">;
383
+ ref: z.ZodString;
384
+ transport: z.ZodEnum<{
385
+ basic: "basic";
386
+ form: "form";
387
+ }>;
388
+ username: z.ZodOptional<z.ZodString>;
389
+ }, z.core.$strip>, z.ZodObject<{
390
+ type: z.ZodLiteral<"login">;
391
+ url: z.ZodString;
392
+ label: z.ZodOptional<z.ZodString>;
393
+ }, z.core.$strip>], "type">>>;
394
+ }, z.core.$strip>>;
395
+ managedBy: z.ZodOptional<z.ZodEnum<{
396
+ sharing: "sharing";
397
+ firewall: "firewall";
398
+ file_share: "file_share";
399
+ cast_reviewer: "cast_reviewer";
400
+ team_default: "team_default";
401
+ }>>;
402
+ expiresAt: z.ZodOptional<z.ZodNumber>;
403
+ reasonCode: z.ZodOptional<z.ZodString>;
404
+ message: z.ZodOptional<z.ZodString>;
405
+ }, z.core.$strip>>>;
406
+ }, z.core.$strip>>;
208
407
  }, z.core.$strip>;
209
408
  export type SpaceConfigFile = z.infer<typeof spaceConfigFileSchema>;
210
409
  /**
@@ -1,5 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { BRAND } from "../brand.js";
3
+ import { runtimeRuleSchema } from "./access.js";
4
+ import { normalizedSiteClass } from "./enums.js";
3
5
  import { spaceThemeSchema } from "./space-theme.js";
4
6
  export const SPACE_CONFIG_CANONICAL_FILE = "sf.jsonc";
5
7
  export const SPACE_CONFIG_ALIAS_FILES = [
@@ -14,11 +16,7 @@ export const SPACE_CONFIG_ACCEPTED_FILES = [
14
16
  SPACE_CONFIG_CANONICAL_FILE,
15
17
  ...SPACE_CONFIG_ALIAS_FILES,
16
18
  ];
17
- export const SPACE_CONFIG_RETIRED_FILES = ["stattic.jsonc", "stattic.json"];
18
- export const SPACE_CONFIG_PRIVATE_FILES = [
19
- ...SPACE_CONFIG_ACCEPTED_FILES,
20
- ...SPACE_CONFIG_RETIRED_FILES,
21
- ];
19
+ export const SPACE_CONFIG_PRIVATE_FILES = [...SPACE_CONFIG_ACCEPTED_FILES];
22
20
  // Config compiler parser-safety caps (internal-docs/platform.md "Config
23
21
  // compiler scale targets"): hard from launch, enforced by ONE shared validator
24
22
  // at every intake seam — finalize for the `sf.jsonc` file, request
@@ -38,9 +36,96 @@ export const SPACE_CONFIG_CAPS = {
38
36
  injectSnippetBytes: 8 * 1024,
39
37
  /** Max snippets per `inject` array. */
40
38
  injectSnippets: 16,
39
+ /** Max `access.rules` entries in the file lane. */
40
+ accessRules: 100,
41
+ /** Max `pages.theme` color token length. */
42
+ pagesColorChars: 64,
43
+ /** Max `pages.theme.logo` URL/path length. */
44
+ pagesLogoChars: 2000,
45
+ /** Max `pages.theme.name` display-name length. */
46
+ pagesNameChars: 120,
41
47
  };
42
48
  /** Published JSON Schema URL for `sf.jsonc` ($schema autocomplete). */
43
49
  export const SPACE_CONFIG_SCHEMA_URL = `${BRAND.websiteOrigin}/schemas/sf.json`;
50
+ // Platform-page theme tokens (access-plan §5.7 tier 1, X-16): colors, logo,
51
+ // display name applied to the runtime's platform-rendered gate pages
52
+ // (challenge/deny). Presentation only — never layout, behavior, or protocol.
53
+ // Color grammar mirrors the SpaceTheme compiler allowlist (hex/rgb(a)/hsl(a)/
54
+ // named), categorically rejecting anything that could escape a style context.
55
+ const PAGES_COLOR_PATTERN = new RegExp([
56
+ "^(?:",
57
+ "#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})",
58
+ "|rgba?\\([0-9.,\\s%/]{1,64}\\)",
59
+ "|hsla?\\([0-9.,\\s%deg/]{1,64}\\)",
60
+ "|[a-zA-Z]{3,30}", // CSS named colors (transparent, rebeccapurple, ...)
61
+ ")$",
62
+ ].join(""));
63
+ // Logo: an https URL or a root-relative path into the space's own files.
64
+ const PAGES_LOGO_PATTERN = /^(?:https:\/\/[^\s"'<>\\]+|\/[^\s"'<>\\]*)$/;
65
+ const pagesColorSchema = z
66
+ .string()
67
+ .trim()
68
+ .max(SPACE_CONFIG_CAPS.pagesColorChars)
69
+ .regex(PAGES_COLOR_PATTERN, "must be a hex, rgb(a), hsl(a), or named CSS color");
70
+ // Font family stack for gate pages (access-plan §8 tier 3): mirrors the
71
+ // SpaceTheme compiler's FONT_FAMILY_PATTERN allowlist (letters/digits/space/
72
+ // comma/hyphen/straight quotes only, no url()/src).
73
+ const PAGES_FONT_FAMILY_PATTERN = /^[A-Za-z0-9 ,'"-]{1,256}$/;
74
+ export const spacePagesThemeSchema = z
75
+ .object({
76
+ accent: pagesColorSchema.optional().describe("Accent color for buttons/links on gate pages."),
77
+ background: pagesColorSchema.optional().describe("Page background color for gate pages."),
78
+ logo: z
79
+ .string()
80
+ .trim()
81
+ .max(SPACE_CONFIG_CAPS.pagesLogoChars)
82
+ .regex(PAGES_LOGO_PATTERN, "must be an https:// URL or a root-relative path")
83
+ .optional()
84
+ .describe("Logo image (https URL or root-relative path) shown in the brand row."),
85
+ name: z
86
+ .string()
87
+ .trim()
88
+ .min(1)
89
+ .max(SPACE_CONFIG_CAPS.pagesNameChars)
90
+ .optional()
91
+ .describe("Display name shown in the brand row of gate pages."),
92
+ // Free tier ("basic color scheme + fonts", access-plan §9): a validated
93
+ // font-family stack applied to gate pages, same grammar as the SpaceTheme
94
+ // compiler's typography.fontFamily.
95
+ fontFamily: z
96
+ .string()
97
+ .trim()
98
+ .max(256)
99
+ .regex(PAGES_FONT_FAMILY_PATTERN, "must be a plain font-family stack (no url()/src)")
100
+ .optional()
101
+ .describe("Font-family stack applied to gate pages."),
102
+ })
103
+ .describe("Theme tokens for platform-rendered gate pages (challenge/deny).");
104
+ // The `sf.theme.jsonc` escape-hatch file (access-plan §8 tier 3, wins over
105
+ // `theme.json` and `spacefast.jsonc "pages.theme"`): same gate-page token
106
+ // vocabulary as `pages.theme`, just from a dedicated file so authors/agents
107
+ // can hand-tune presentation without touching the main project config. Paid
108
+ // tier ("advanced theming", access-plan §9) — gated at compile by the
109
+ // resolved plan entitlement, never at parse time.
110
+ export const SF_THEME_JSONC_FILE = "sf.theme.jsonc";
111
+ export const sfThemeJsoncSchema = spacePagesThemeSchema.describe("sf.theme.jsonc: the highest-precedence gate-page theme override file.");
112
+ // The WordPress-compatible `theme.json` file (access-plan §8 tier 3, middle
113
+ // precedence): free tier ("theme.json basics"). Only `settings.color.palette`
114
+ // and `settings.typography.fontFamilies` feed gate-page tokens; every other
115
+ // WP theme.json key is accepted-and-ignored (this is not a full WP_Theme_JSON
116
+ // reimplementation, just the safe subset that reaches presentation-only gate
117
+ // pages).
118
+ export const THEME_JSON_FILE = "theme.json";
119
+ // Custom chrome/shell for gate pages (access-plan §8 tier 2): the functional
120
+ // challenge/deny fragment slots into `<div data-sf="content">` here so gate
121
+ // pages inherit site look. Paid tier, same entitlement as full custom
122
+ // 401.html/403.html.
123
+ export const LAYOUT_TEMPLATE_FILE = ".spacefast/templates/layout.html";
124
+ export const spacePagesConfigSchema = z
125
+ .object({
126
+ theme: spacePagesThemeSchema.optional(),
127
+ })
128
+ .describe("Platform-page presentation: theme tokens applied to gate pages.");
44
129
  export const spaceBuildSettingsSchema = z
45
130
  .object({
46
131
  rootDirectory: z.string().trim().min(1).nullable().optional(),
@@ -56,6 +141,18 @@ export const spaceBuildSettingsSchema = z
56
141
  })
57
142
  .strict()
58
143
  .describe("Remote build settings used by repository builds.");
144
+ // Reuses the same shared/dedicated vocabulary as `normalizedSiteClass`
145
+ // (enums.ts) rather than declaring a second "shared"/"dedicated" enum —
146
+ // space placement mode and normalized site class are the same axis.
147
+ export const spacePlacementModeSchema = normalizedSiteClass;
148
+ export const spacePlacementConfigSchema = z
149
+ .object({
150
+ region: z.string().trim().min(1).optional(),
151
+ mode: spacePlacementModeSchema.optional(),
152
+ burstable: z.boolean().optional(),
153
+ })
154
+ .strict()
155
+ .describe("Placement controls for this space.");
59
156
  // SpaceConfig (internal-docs/platform.md "SpaceConfig"): the declarative
60
157
  // serving config — also the shape of `sf.jsonc` minus `$schema`/`space`.
61
158
  // Meta caps are the spec parser-safety numbers (title 300, description 1000,
@@ -75,6 +172,10 @@ export const spaceConfigSchema = z.object({
75
172
  ])
76
173
  .optional()
77
174
  .describe('Fallback document; "/index.html" means SPA. Default: nearest 404.html.'),
175
+ cleanUrls: z
176
+ .boolean()
177
+ .optional()
178
+ .describe("Serve flat `<name>.html` files at their extensionless URL (/about serves about.html). Default: on, unless a 200-status SPA fallback is configured."),
78
179
  listing: z.boolean().optional().describe("Enable automatic directory listings."),
79
180
  meta: z
80
181
  .object({
@@ -127,6 +228,10 @@ export const spaceConfigSchema = z.object({
127
228
  .optional(),
128
229
  })
129
230
  .optional(),
231
+ requireReview: z
232
+ .boolean()
233
+ .optional()
234
+ .describe("When true, integration changes must go through review before release."),
130
235
  })
131
236
  .optional(),
132
237
  })
@@ -140,9 +245,17 @@ export const spaceConfigSchema = z.object({
140
245
  theme: spaceThemeSchema
141
246
  .optional()
142
247
  .describe("Platform-page theming: a validated preset subset of WordPress theme.json."),
248
+ pages: spacePagesConfigSchema
249
+ .optional()
250
+ .describe("Platform gate-page presentation: theme tokens (access-plan §5.7 tier 1)."),
143
251
  build: spaceBuildSettingsSchema
144
252
  .optional()
145
253
  .describe("Default settings for remote repository builds."),
254
+ placement: spacePlacementConfigSchema.optional(),
255
+ markdownNegotiation: z
256
+ .boolean()
257
+ .optional()
258
+ .describe("Accepted serving flag; runtime enforcement ships separately."),
146
259
  // Intentionally undescribed (hidden, experimental): enables the finalize-time
147
260
  // build pipeline (internal-docs/build-pipeline-plan.md). Accepted without
148
261
  // diagnostics; absent/false keeps today's behavior byte-for-byte.
@@ -163,6 +276,22 @@ export function spaceSuperpowersEnabled(config) {
163
276
  const superpowers = config?.superpowers;
164
277
  return superpowers?.enabled !== false && superpowers?.disable_all_injection !== true;
165
278
  }
279
+ // The declarative file-lane access/firewall block (internal-docs/
280
+ // internal-docs/access-plan.html, "file" provenance): the SAME unified Rule shape
281
+ // the policy document and the cloud lane use — no parallel contract. Rules
282
+ // committed here compile at publish finalize and version + roll back WITH the
283
+ // content version; live edits without a republish belong to the cloud lane
284
+ // (`sf access`). The file lane lives ONLY in the config FILE — the API `config`
285
+ // overlay never carries it (single-home, no drift).
286
+ export const spaceAccessConfigSchema = z
287
+ .object({
288
+ rules: z
289
+ .array(runtimeRuleSchema)
290
+ .max(SPACE_CONFIG_CAPS.accessRules)
291
+ .default([])
292
+ .describe("Ordered unified access/firewall rules; first match wins."),
293
+ })
294
+ .describe("Declarative access lane: rules compiled at publish that version and roll back with the site.");
166
295
  // The `sf.jsonc` FILE shape (internal-docs/platform.md "Space
167
296
  // Configuration Files"): SpaceConfig plus the editor `$schema` pointer and the
168
297
  // optional `space` link (slug or `spc_` id) resolved by CLI/publish flows.
@@ -178,6 +307,7 @@ export const spaceConfigFileSchema = spaceConfigSchema.extend({
178
307
  .min(1)
179
308
  .optional()
180
309
  .describe("Optional space link: a space slug or spc_ id this project publishes to."),
310
+ access: spaceAccessConfigSchema.optional(),
181
311
  });
182
312
  /**
183
313
  * The published JSON Schema artifact for `sf.jsonc`, generated from the