@spacefast/common 0.0.21 → 0.0.24

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 (182) hide show
  1. package/dist/agents/connect-targets.d.ts +9 -6
  2. package/dist/agents/connect-targets.js +9 -6
  3. package/dist/config/domains.d.ts +1 -1
  4. package/dist/config/domains.js +1 -0
  5. package/dist/config/index.d.ts +0 -1
  6. package/dist/config/index.js +0 -1
  7. package/dist/contracts/abuse.d.ts +2 -0
  8. package/dist/contracts/abuse.js +12 -0
  9. package/dist/contracts/access.d.ts +121 -9
  10. package/dist/contracts/access.js +73 -9
  11. package/dist/contracts/activity.d.ts +1 -1
  12. package/dist/contracts/activity.js +0 -9
  13. package/dist/contracts/api-keys.d.ts +21 -21
  14. package/dist/contracts/beta.js +1 -1
  15. package/dist/contracts/billing.d.ts +1 -34
  16. package/dist/contracts/billing.js +4 -53
  17. package/dist/contracts/builds.d.ts +8 -8
  18. package/dist/contracts/builds.js +10 -3
  19. package/dist/contracts/cli.d.ts +10 -0
  20. package/dist/contracts/cli.js +10 -0
  21. package/dist/contracts/collab-public.d.ts +63 -0
  22. package/dist/contracts/collab-public.js +46 -0
  23. package/dist/contracts/comments.d.ts +283 -54
  24. package/dist/contracts/comments.js +173 -52
  25. package/dist/contracts/common.d.ts +3 -3
  26. package/dist/contracts/device-auth.d.ts +6 -6
  27. package/dist/contracts/device-auth.js +1 -1
  28. package/dist/contracts/docs.d.ts +5 -5
  29. package/dist/contracts/domains.d.ts +36 -36
  30. package/dist/contracts/enums.d.ts +33 -30
  31. package/dist/contracts/enums.js +52 -38
  32. package/dist/contracts/error-code-meta.d.ts +37 -126
  33. package/dist/contracts/error-code-meta.js +12 -41
  34. package/dist/contracts/error-codes.d.ts +1 -1
  35. package/dist/contracts/error-codes.js +10 -32
  36. package/dist/contracts/execution.d.ts +35 -57
  37. package/dist/contracts/execution.js +41 -40
  38. package/dist/contracts/feature-lifecycle-core.d.ts +0 -6
  39. package/dist/contracts/feature-lifecycle-core.js +2 -31
  40. package/dist/contracts/feature-lifecycle.d.ts +8 -38
  41. package/dist/contracts/feature-lifecycle.js +16 -48
  42. package/dist/contracts/features.d.ts +15 -13
  43. package/dist/contracts/features.js +39 -38
  44. package/dist/contracts/functions.d.ts +97 -70
  45. package/dist/contracts/functions.js +101 -34
  46. package/dist/contracts/git.d.ts +1 -1
  47. package/dist/contracts/grants.d.ts +7 -3
  48. package/dist/contracts/grants.js +18 -9
  49. package/dist/contracts/internal.d.ts +14 -1
  50. package/dist/contracts/internal.js +17 -7
  51. package/dist/contracts/oauth-resources.d.ts +4 -3
  52. package/dist/contracts/oauth-resources.js +12 -3
  53. package/dist/contracts/operations.d.ts +90 -5
  54. package/dist/contracts/operations.js +75 -1
  55. package/dist/contracts/pages.d.ts +6 -1
  56. package/dist/contracts/pages.js +24 -1
  57. package/dist/contracts/plan-policy.d.ts +1 -3
  58. package/dist/contracts/plan-policy.js +1 -2
  59. package/dist/contracts/platform.d.ts +61 -148
  60. package/dist/contracts/platform.js +70 -126
  61. package/dist/contracts/publish-archive.d.ts +498 -0
  62. package/dist/contracts/publish-archive.js +25 -0
  63. package/dist/contracts/resources.d.ts +12 -24
  64. package/dist/contracts/resources.js +32 -12
  65. package/dist/contracts/runtime-api.d.ts +369 -175
  66. package/dist/contracts/runtime-api.js +372 -348
  67. package/dist/contracts/runtime-app.d.ts +127 -120
  68. package/dist/contracts/runtime-app.js +19 -10
  69. package/dist/contracts/runtime-db.d.ts +1 -1
  70. package/dist/contracts/runtime-services.d.ts +219 -0
  71. package/dist/contracts/runtime-services.js +437 -0
  72. package/dist/contracts/runtime-storage.d.ts +45 -32
  73. package/dist/contracts/runtime-storage.js +30 -8
  74. package/dist/contracts/space-config.d.ts +10 -16
  75. package/dist/contracts/space-config.js +14 -10
  76. package/dist/contracts/spaces.d.ts +241 -436
  77. package/dist/contracts/spaces.js +128 -145
  78. package/dist/contracts/superadmin-activity.d.ts +57 -4
  79. package/dist/contracts/superadmin-activity.js +48 -2
  80. package/dist/contracts/superadmin-search.d.ts +126 -0
  81. package/dist/contracts/superadmin-search.js +61 -0
  82. package/dist/contracts/superadmin-spaces.d.ts +358 -89
  83. package/dist/contracts/superadmin-spaces.js +97 -24
  84. package/dist/contracts/superadmin-teams.d.ts +28 -10
  85. package/dist/contracts/superadmin-teams.js +5 -8
  86. package/dist/contracts/superadmin.d.ts +0 -32
  87. package/dist/contracts/superadmin.js +3 -11
  88. package/dist/contracts/tags.d.ts +9 -9
  89. package/dist/contracts/teams.d.ts +44 -2
  90. package/dist/contracts/teams.js +43 -23
  91. package/dist/contracts/transfers.d.ts +0 -49
  92. package/dist/contracts/transfers.js +2 -6
  93. package/dist/contracts/usage.d.ts +61 -0
  94. package/dist/contracts/usage.js +64 -0
  95. package/dist/contracts/variables.d.ts +2 -7
  96. package/dist/contracts/variables.js +6 -5
  97. package/dist/contracts/webhooks.d.ts +2 -2
  98. package/dist/contracts/zero.d.ts +87 -56
  99. package/dist/contracts/zero.js +82 -20
  100. package/dist/dashboard-paths/index.d.ts +1 -1
  101. package/dist/dashboard-paths/index.js +1 -0
  102. package/dist/docs/agent-prose.d.ts +1 -1
  103. package/dist/docs/agent-prose.js +62 -66
  104. package/dist/docs/agent-setup.js +49 -23
  105. package/dist/docs/agent-solutions.d.ts +4 -4
  106. package/dist/docs/agent-solutions.js +8 -8
  107. package/dist/docs/catalog.d.ts +19 -19
  108. package/dist/docs/catalog.js +30 -19
  109. package/dist/docs/error-docs.js +63 -151
  110. package/dist/docs/skills.d.ts +3 -3
  111. package/dist/docs/skills.js +1 -1
  112. package/dist/test-helpers/fetch-stub.d.ts +16 -0
  113. package/dist/test-helpers/fetch-stub.js +24 -0
  114. package/dist/utils/build-settings.js +9 -3
  115. package/dist/utils/canonical-json.d.ts +10 -0
  116. package/dist/utils/canonical-json.js +21 -0
  117. package/dist/utils/cast-transport.d.ts +28 -0
  118. package/dist/utils/cast-transport.js +52 -0
  119. package/dist/utils/claim-token.d.ts +0 -8
  120. package/dist/utils/claim-token.js +3 -15
  121. package/dist/utils/credential-policy.d.ts +1 -1
  122. package/dist/utils/env-file.d.ts +17 -0
  123. package/dist/utils/env-file.js +96 -0
  124. package/dist/utils/error-code.d.ts +2 -0
  125. package/dist/utils/error-code.js +7 -0
  126. package/dist/utils/generate-space-name.d.ts +8 -10
  127. package/dist/utils/generate-space-name.js +206 -21
  128. package/dist/utils/grant-decision.fixtures.json +2938 -0
  129. package/dist/utils/grants.d.ts +2 -0
  130. package/dist/utils/grants.js +25 -2
  131. package/dist/utils/gravatar.d.ts +9 -0
  132. package/dist/utils/gravatar.js +31 -0
  133. package/dist/utils/idempotency.d.ts +6 -0
  134. package/dist/utils/idempotency.js +28 -0
  135. package/dist/utils/local-space-state.d.ts +1 -5
  136. package/dist/utils/local-space-state.js +7 -26
  137. package/dist/utils/page-fonts.d.ts +2 -2
  138. package/dist/utils/page-fonts.js +22 -4
  139. package/dist/utils/pages.d.ts +1 -2
  140. package/dist/utils/pages.js +21 -5
  141. package/dist/utils/publish-form-data.d.ts +12 -0
  142. package/dist/utils/publish-form-data.js +10 -0
  143. package/dist/utils/publish-policy.d.ts +20 -0
  144. package/dist/utils/publish-policy.fixtures.json +397 -0
  145. package/dist/utils/publish-policy.js +36 -19
  146. package/dist/utils/push-new.d.ts +7 -0
  147. package/dist/utils/push-new.js +7 -0
  148. package/dist/utils/query-keys.d.ts +0 -1
  149. package/dist/utils/query-keys.js +0 -1
  150. package/dist/utils/runtime-paths.d.ts +5 -0
  151. package/dist/utils/runtime-paths.js +5 -0
  152. package/dist/utils/runtime-upload-batch.d.ts +0 -5
  153. package/dist/utils/runtime-upload-batch.js +1 -27
  154. package/dist/utils/runtime-upload.d.ts +3 -13
  155. package/dist/utils/runtime-upload.js +4 -14
  156. package/dist/utils/space-config.d.ts +0 -33
  157. package/dist/utils/space-config.js +5 -326
  158. package/dist/utils/storage-policy.d.ts +1 -1
  159. package/dist/utils/storage-policy.js +3 -1
  160. package/dist/utils/structured-error.d.ts +14 -0
  161. package/dist/utils/structured-error.js +22 -0
  162. package/dist/utils/version-path.js +12 -3
  163. package/dist/vocabulary.d.ts +5 -3
  164. package/dist/vocabulary.js +13 -10
  165. package/package.json +10 -5
  166. package/dist/config/postgres-budget.d.ts +0 -129
  167. package/dist/config/postgres-budget.js +0 -140
  168. package/dist/config/postgres-budget.json +0 -51
  169. package/dist/contracts/archives.d.ts +0 -331
  170. package/dist/contracts/archives.js +0 -120
  171. package/dist/contracts/deployments.d.ts +0 -574
  172. package/dist/contracts/deployments.js +0 -97
  173. package/dist/contracts/sites.d.ts +0 -416
  174. package/dist/contracts/sites.js +0 -168
  175. package/dist/contracts/superadmin-queues.d.ts +0 -414
  176. package/dist/contracts/superadmin-queues.js +0 -202
  177. package/dist/contracts/superadmin-runtime.d.ts +0 -27
  178. package/dist/contracts/superadmin-runtime.js +0 -38
  179. package/dist/index.d.ts +0 -1
  180. package/dist/index.js +0 -1
  181. package/dist/utils/api.d.ts +0 -4
  182. package/dist/utils/api.js +0 -13
@@ -2,6 +2,13 @@ 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
+ /**
6
+ * Accepted config filenames in read precedence order, highest first. Kept in
7
+ * step with the finalizer's `CONFIG_PRECEDENCE` (crates/stattic-runtime-core
8
+ * protocol.rs) — the runtime compile is the selection authority, and a local
9
+ * read choosing a different file than the publish serves is a split brain.
10
+ */
11
+ export declare const SPACE_CONFIG_PRECEDENCE: readonly ["sf.jsonc", "spacefast.jsonc", "spacefast.json", "sf.json", ".sf/sf.json", ".sf/config.jsonc", ".sf/config.json"];
5
12
  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"];
6
13
  export declare const SPACE_CONFIG_CAPS: {
7
14
  /** Max raw `sf.jsonc` size in bytes. */
@@ -12,6 +19,7 @@ export declare const SPACE_CONFIG_CAPS: {
12
19
  readonly templates: 100;
13
20
  readonly metaTitleChars: 300;
14
21
  readonly metaDescriptionChars: 1000;
22
+ /** Max OG image or favicon path/URL length; enough for signed URLs while staying request-safe. */
15
23
  readonly metaImageChars: 2000;
16
24
  /** Max bytes per `inject` snippet. */
17
25
  readonly injectSnippetBytes: number;
@@ -53,15 +61,7 @@ export declare const spaceBuildSettingsSchema: z.ZodObject<{
53
61
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
54
62
  }, z.core.$strict>;
55
63
  export type SpaceBuildSettings = z.infer<typeof spaceBuildSettingsSchema>;
56
- export declare const spacePlacementModeSchema: z.ZodEnum<{
57
- shared: "shared";
58
- dedicated: "dedicated";
59
- }>;
60
64
  export declare const spacePlacementConfigSchema: z.ZodObject<{
61
- mode: z.ZodOptional<z.ZodEnum<{
62
- shared: "shared";
63
- dedicated: "dedicated";
64
- }>>;
65
65
  burstable: z.ZodOptional<z.ZodBoolean>;
66
66
  }, z.core.$strict>;
67
67
  export type SpacePlacementConfig = z.infer<typeof spacePlacementConfigSchema>;
@@ -88,6 +88,7 @@ export declare const spaceConfigSchema: z.ZodObject<{
88
88
  title: z.ZodOptional<z.ZodString>;
89
89
  description: z.ZodOptional<z.ZodString>;
90
90
  image: z.ZodOptional<z.ZodString>;
91
+ favicon: z.ZodOptional<z.ZodString>;
91
92
  }, z.core.$strip>>;
92
93
  superpowers: z.ZodOptional<z.ZodObject<{
93
94
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -140,10 +141,6 @@ export declare const spaceConfigSchema: z.ZodObject<{
140
141
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
141
142
  }, z.core.$strict>>;
142
143
  placement: z.ZodOptional<z.ZodObject<{
143
- mode: z.ZodOptional<z.ZodEnum<{
144
- shared: "shared";
145
- dedicated: "dedicated";
146
- }>>;
147
144
  burstable: z.ZodOptional<z.ZodBoolean>;
148
145
  }, z.core.$strict>>;
149
146
  markdownNegotiation: z.ZodOptional<z.ZodBoolean>;
@@ -231,6 +228,7 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
231
228
  title: z.ZodOptional<z.ZodString>;
232
229
  description: z.ZodOptional<z.ZodString>;
233
230
  image: z.ZodOptional<z.ZodString>;
231
+ favicon: z.ZodOptional<z.ZodString>;
234
232
  }, z.core.$strip>>;
235
233
  superpowers: z.ZodOptional<z.ZodObject<{
236
234
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -283,10 +281,6 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
283
281
  timeoutSeconds: z.ZodOptional<z.ZodNumber>;
284
282
  }, z.core.$strict>>;
285
283
  placement: z.ZodOptional<z.ZodObject<{
286
- mode: z.ZodOptional<z.ZodEnum<{
287
- shared: "shared";
288
- dedicated: "dedicated";
289
- }>>;
290
284
  burstable: z.ZodOptional<z.ZodBoolean>;
291
285
  }, z.core.$strict>>;
292
286
  markdownNegotiation: z.ZodOptional<z.ZodBoolean>;
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
2
  import { serviceOrigin } from "../config/domains.js";
3
- import { normalizedSiteClass } from "./enums.js";
4
3
  import { GRANT_RESOURCE_PATTERN_LIMIT, normalizeGrantResourcePattern } from "./grants.js";
5
4
  export const SPACE_CONFIG_CANONICAL_FILE = "sf.jsonc";
6
5
  export const SPACE_CONFIG_ALIAS_FILES = [
@@ -15,6 +14,13 @@ export const SPACE_CONFIG_ACCEPTED_FILES = [
15
14
  SPACE_CONFIG_CANONICAL_FILE,
16
15
  ...SPACE_CONFIG_ALIAS_FILES,
17
16
  ];
17
+ /**
18
+ * Accepted config filenames in read precedence order, highest first. Kept in
19
+ * step with the finalizer's `CONFIG_PRECEDENCE` (crates/stattic-runtime-core
20
+ * protocol.rs) — the runtime compile is the selection authority, and a local
21
+ * read choosing a different file than the publish serves is a split brain.
22
+ */
23
+ export const SPACE_CONFIG_PRECEDENCE = SPACE_CONFIG_ACCEPTED_FILES;
18
24
  export const SPACE_CONFIG_PRIVATE_FILES = [...SPACE_CONFIG_ACCEPTED_FILES];
19
25
  // Config compiler parser-safety caps (internal-docs/platform.md "Config
20
26
  // compiler scale targets"): hard from launch, enforced by ONE shared validator
@@ -30,6 +36,7 @@ export const SPACE_CONFIG_CAPS = {
30
36
  templates: 100,
31
37
  metaTitleChars: 300,
32
38
  metaDescriptionChars: 1000,
39
+ /** Max OG image or favicon path/URL length; enough for signed URLs while staying request-safe. */
33
40
  metaImageChars: 2000,
34
41
  /** Max bytes per `inject` snippet. */
35
42
  injectSnippetBytes: 8 * 1024,
@@ -126,16 +133,12 @@ export const spaceBuildSettingsSchema = z
126
133
  })
127
134
  .strict()
128
135
  .describe("Remote build settings used by repository builds.");
129
- // Reuses the same shared/dedicated vocabulary as `normalizedSiteClass`
130
- // (enums.ts) rather than declaring a second "shared"/"dedicated" enum
131
- // space placement mode and normalized site class are the same axis.
132
- export const spacePlacementModeSchema = normalizedSiteClass;
133
- // No region knob: a space binds to the site it was placed on at creation and
134
- // the only placement change that relocates it is shared -> dedicated. Data
135
- // location is chosen once, at creation, and never changes.
136
+ // Every space gets its own site, so there is nothing to place between: no mode,
137
+ // no region knob. `burstable` is the one real provider knob left whether the
138
+ // space's site may burst provider PHP workers. Data location is chosen once, at
139
+ // creation, and never changes.
136
140
  export const spacePlacementConfigSchema = z
137
141
  .object({
138
- mode: spacePlacementModeSchema.optional(),
139
142
  burstable: z.boolean().optional(),
140
143
  })
141
144
  .strict()
@@ -377,9 +380,10 @@ const spaceConfigBaseSchema = z.object({
377
380
  title: z.string().min(1).max(SPACE_CONFIG_CAPS.metaTitleChars).optional(),
378
381
  description: z.string().max(SPACE_CONFIG_CAPS.metaDescriptionChars).optional(),
379
382
  image: z.string().max(SPACE_CONFIG_CAPS.metaImageChars).optional(),
383
+ favicon: z.string().max(SPACE_CONFIG_CAPS.metaImageChars).optional(),
380
384
  })
381
385
  .optional()
382
- .describe("Listing/viewer/OG metadata."),
386
+ .describe("Listing, viewer, sharing, and browser icon metadata."),
383
387
  superpowers: z
384
388
  .object({
385
389
  enabled: z.boolean().optional().describe("Master switch for platform-managed injections."),