@spacefast/common 0.0.24 → 0.0.26

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 (145) hide show
  1. package/brand-assets/LICENSE-Haskoy.txt +93 -0
  2. package/brand-assets/haskoy-latin-variable.woff2 +0 -0
  3. package/brand-assets/spacefast-favicon.svg +4 -4
  4. package/brand-assets/spacefast-sf-full-bleed.svg +3 -3
  5. package/brand-assets/spacefast-wordmark.svg +2 -4
  6. package/dist/agents/connect-targets.js +1 -1
  7. package/dist/agents/private-key-oauth.d.ts +0 -1
  8. package/dist/agents/private-key-oauth.js +46 -63
  9. package/dist/brand-assets-build.js +4 -6
  10. package/dist/brand-assets.d.ts +5 -15
  11. package/dist/brand-assets.js +15 -14
  12. package/dist/config/domains.d.ts +47 -7
  13. package/dist/config/domains.js +65 -10
  14. package/dist/contracts/access.d.ts +3 -3
  15. package/dist/contracts/activity.d.ts +1 -1
  16. package/dist/contracts/activity.js +5 -3
  17. package/dist/contracts/api-keys.js +2 -2
  18. package/dist/contracts/billing.d.ts +2 -1
  19. package/dist/contracts/billing.js +30 -0
  20. package/dist/contracts/builds.d.ts +34 -22
  21. package/dist/contracts/builds.js +18 -6
  22. package/dist/contracts/channels.js +1 -1
  23. package/dist/contracts/comments.d.ts +1 -1
  24. package/dist/contracts/common.d.ts +6 -6
  25. package/dist/contracts/common.js +5 -5
  26. package/dist/contracts/crons.d.ts +35 -0
  27. package/dist/contracts/crons.js +42 -0
  28. package/dist/contracts/device-auth.js +1 -1
  29. package/dist/contracts/docs.d.ts +5 -5
  30. package/dist/contracts/docs.js +2 -2
  31. package/dist/contracts/domains.d.ts +74 -63
  32. package/dist/contracts/domains.js +29 -2
  33. package/dist/contracts/enums.d.ts +3 -2
  34. package/dist/contracts/enums.js +10 -10
  35. package/dist/contracts/error-code-meta.d.ts +14 -0
  36. package/dist/contracts/error-code-meta.js +17 -0
  37. package/dist/contracts/error-codes.d.ts +1 -1
  38. package/dist/contracts/error-codes.js +4 -1
  39. package/dist/contracts/execution.d.ts +15 -12
  40. package/dist/contracts/execution.js +15 -12
  41. package/dist/contracts/feature-lifecycle.d.ts +4 -14
  42. package/dist/contracts/feature-lifecycle.js +0 -11
  43. package/dist/contracts/features.d.ts +33 -47
  44. package/dist/contracts/features.js +27 -20
  45. package/dist/contracts/functions.d.ts +169 -2
  46. package/dist/contracts/functions.js +160 -4
  47. package/dist/contracts/git.d.ts +27 -33
  48. package/dist/contracts/git.js +10 -11
  49. package/dist/contracts/grants.d.ts +2 -2
  50. package/dist/contracts/ids.js +2 -2
  51. package/dist/contracts/internal.d.ts +5 -16
  52. package/dist/contracts/internal.js +2 -12
  53. package/dist/contracts/mcp.d.ts +11 -0
  54. package/dist/contracts/mcp.js +5 -0
  55. package/dist/contracts/me.js +1 -1
  56. package/dist/contracts/operations.d.ts +4 -4
  57. package/dist/contracts/operations.js +2 -2
  58. package/dist/contracts/pages.d.ts +6 -6
  59. package/dist/contracts/plan-policy.d.ts +1 -1
  60. package/dist/contracts/plan-policy.js +1 -1
  61. package/dist/contracts/platform.d.ts +4 -4
  62. package/dist/contracts/publish-archive.d.ts +170 -160
  63. package/dist/contracts/publish-archive.js +8 -1
  64. package/dist/contracts/push-new.d.ts +4 -4
  65. package/dist/contracts/quotas.js +2 -2
  66. package/dist/contracts/repository-connections.d.ts +43 -30
  67. package/dist/contracts/repository-connections.js +11 -3
  68. package/dist/contracts/resources.d.ts +8 -8
  69. package/dist/contracts/resources.js +6 -6
  70. package/dist/contracts/runtime-api.d.ts +103 -56
  71. package/dist/contracts/runtime-api.js +67 -26
  72. package/dist/contracts/runtime-app.d.ts +2 -2
  73. package/dist/contracts/runtime-db.d.ts +6 -6
  74. package/dist/contracts/runtime-db.js +2 -2
  75. package/dist/contracts/runtime-purge.d.ts +8 -0
  76. package/dist/contracts/runtime-purge.js +7 -0
  77. package/dist/contracts/runtime-storage.d.ts +3 -2
  78. package/dist/contracts/runtime-storage.js +2 -1
  79. package/dist/contracts/sf-config-v1.d.ts +48 -10
  80. package/dist/contracts/space-config.d.ts +60 -3
  81. package/dist/contracts/space-config.js +213 -18
  82. package/dist/contracts/spaces.d.ts +55 -74
  83. package/dist/contracts/spaces.js +11 -14
  84. package/dist/contracts/superadmin-spaces.d.ts +9 -9
  85. package/dist/contracts/superadmin-teams.d.ts +2 -2
  86. package/dist/contracts/superadmin-tenants.d.ts +0 -6
  87. package/dist/contracts/superadmin-tenants.js +1 -7
  88. package/dist/contracts/superadmin.d.ts +135 -22
  89. package/dist/contracts/superadmin.js +43 -12
  90. package/dist/contracts/tags.d.ts +21 -21
  91. package/dist/contracts/tags.js +3 -3
  92. package/dist/contracts/teams.d.ts +14 -17
  93. package/dist/contracts/teams.js +6 -6
  94. package/dist/contracts/transfers.js +2 -2
  95. package/dist/contracts/variables.d.ts +4 -4
  96. package/dist/contracts/variables.js +3 -3
  97. package/dist/contracts/webhooks.d.ts +4 -4
  98. package/dist/contracts/zero.d.ts +15 -17
  99. package/dist/contracts/zero.js +12 -12
  100. package/dist/docs/agent-prose.d.ts +1 -1
  101. package/dist/docs/agent-prose.js +11 -14
  102. package/dist/docs/agent-setup.js +5 -2
  103. package/dist/docs/catalog.d.ts +7 -7
  104. package/dist/docs/catalog.js +7 -7
  105. package/dist/docs/error-docs.js +145 -133
  106. package/dist/docs/skills.d.ts +12 -12
  107. package/dist/docs/skills.js +4 -4
  108. package/dist/test-helpers/fetch-stub.js +1 -0
  109. package/dist/utils/build-settings.d.ts +5 -1
  110. package/dist/utils/build-settings.js +82 -10
  111. package/dist/utils/canonical-json.js +1 -0
  112. package/dist/utils/concurrency.js +1 -0
  113. package/dist/utils/credential-policy.js +4 -3
  114. package/dist/utils/dns-instructions.js +9 -9
  115. package/dist/utils/error-code.js +1 -0
  116. package/dist/utils/grant-decision.fixtures.json +2 -2
  117. package/dist/utils/grants.js +3 -1
  118. package/dist/utils/local-space-state.d.ts +8 -11
  119. package/dist/utils/local-space-state.js +13 -24
  120. package/dist/utils/one-shot-replay.d.ts +4 -1
  121. package/dist/utils/page-colors.d.ts +14 -12
  122. package/dist/utils/page-colors.js +15 -13
  123. package/dist/utils/page-fonts.d.ts +1 -1
  124. package/dist/utils/page-fonts.js +11 -18
  125. package/dist/utils/pages.d.ts +20 -1
  126. package/dist/utils/pages.js +22 -9
  127. package/dist/utils/publish-policy.d.ts +7 -0
  128. package/dist/utils/publish-policy.fixtures.json +11 -5
  129. package/dist/utils/publish-policy.js +9 -1
  130. package/dist/utils/query-keys.d.ts +4 -4
  131. package/dist/utils/query-keys.js +2 -2
  132. package/dist/utils/runtime-upload.d.ts +5 -0
  133. package/dist/utils/runtime-upload.js +7 -0
  134. package/dist/utils/secure-local-file.js +5 -16
  135. package/dist/utils/space-config.d.ts +1 -1
  136. package/dist/utils/space-config.js +3 -0
  137. package/dist/utils/static-runtime-policy.d.ts +9 -3
  138. package/dist/utils/static-runtime-policy.fixtures.json +38 -41
  139. package/dist/utils/static-runtime-policy.js +22 -56
  140. package/dist/utils/upload-session.d.ts +4 -1
  141. package/dist/utils/upload-session.js +33 -5
  142. package/dist/utils/version-path.js +1 -1
  143. package/dist/vocabulary.d.ts +8 -8
  144. package/dist/vocabulary.js +31 -20
  145. package/package.json +2 -17
@@ -39,7 +39,7 @@ export declare const DOCS_CATALOG: readonly [{
39
39
  readonly kind: "guide";
40
40
  readonly tier: "essential";
41
41
  readonly summary: "How `sf publish` builds, uploads, and goes live.";
42
- readonly keywords: readonly ["publish", "go live", "upload", "release", "static"];
42
+ readonly keywords: readonly ["publish", "go live", "upload", "release", "artifact"];
43
43
  readonly url: "https://spacefast.com/docs/publishing";
44
44
  readonly body: "`sf publish` snapshots your output directory into an immutable version and promotes it to the production channel. Use `--no-wait` to return before serving finishes.";
45
45
  }, {
@@ -86,7 +86,7 @@ export declare const DOCS_CATALOG: readonly [{
86
86
  readonly summary: "Publish a file or zipped output folder directly to /v1/publish. No account, CLI install, or MCP setup is required for anonymous publishes.";
87
87
  readonly keywords: readonly ["publish", "curl", "anonymous", "no install", "claim"];
88
88
  readonly url: "https://spacefast.com/docs/agents#publish-with-curl";
89
- readonly body: "curl publish static file folder archive zip anonymous no account no install live URL immutable version claim link /v1/publish";
89
+ readonly body: "curl publish file folder archive zip anonymous no account no install live URL immutable version claim link /v1/publish";
90
90
  }, {
91
91
  readonly slug: "workflow/publish-receipt";
92
92
  readonly title: "Publish receipt fields";
@@ -137,10 +137,10 @@ export declare const DOCS_CATALOG: readonly [{
137
137
  readonly title: "Space file conventions";
138
138
  readonly kind: "workflow";
139
139
  readonly tier: "full";
140
- readonly summary: "Spacefast recognizes _redirects, _headers, nearest 404.html, and sf.jsonc. Static artifacts are served as files; server code is not executed.";
140
+ readonly summary: "Spacefast recognizes _redirects, _headers, nearest 404.html, and sf.jsonc. Published artifacts are served as files; server code is not executed.";
141
141
  readonly keywords: readonly ["_redirects", "_headers", "sf.jsonc", "spacefast.jsonc", "404"];
142
142
  readonly url: "https://spacefast.com/docs/configuration";
143
- readonly body: "_redirects _headers 404.html sf.jsonc static artifact server code not executed proxy rewrite headers";
143
+ readonly body: "_redirects _headers 404.html sf.jsonc artifact server code not executed proxy rewrite headers";
144
144
  }, {
145
145
  readonly slug: "workflow/domains-diagnostics";
146
146
  readonly title: "Domains and DNS diagnostics";
@@ -239,7 +239,7 @@ export declare const DOCS_CATALOG: readonly [{
239
239
  readonly summary: "Run code on a space with Zero or Functions.";
240
240
  readonly keywords: readonly ["runtime", "zero", "functions", "server", "dynamic", "code", "backend", "sf.jsonc"];
241
241
  readonly url: "https://spacefast.com/docs/runtimes";
242
- readonly body: "A space serves static files until you declare a `runtime` block in sf.jsonc. Every space has its own runtime site. Zero is a capsule with its own database and transactions; Functions is a Cloudflare worker with one `fetch` handler and any npm package. Both are available on every plan and compile during `sf publish`.";
242
+ readonly body: "A space serves published files until you declare a `runtime` block in sf.jsonc. Every space has its own runtime site. Zero is a capsule with its own database and transactions; Functions is a Cloudflare worker with one `fetch` handler and any npm package. Both are available on every plan and compile during `sf publish`.";
243
243
  }, {
244
244
  readonly slug: "runtimes/zero";
245
245
  readonly title: "Spacefast Zero";
@@ -284,7 +284,7 @@ export declare const DOCS_CATALOG: readonly [{
284
284
  readonly summary: "Proxy selected paths to an upstream origin.";
285
285
  readonly keywords: readonly ["proxy", "upstream", "route", "api", "backend", "rewrite"];
286
286
  readonly url: "https://spacefast.com/docs/proxy-routes";
287
- readonly body: "Forward specific path prefixes to an external upstream so a static space can front a dynamic API without exposing the origin.";
287
+ readonly body: "Forward specific path prefixes to an external upstream so a space can front an external API without exposing its origin.";
288
288
  }, {
289
289
  readonly slug: "image-acceleration";
290
290
  readonly title: "Image acceleration";
@@ -302,7 +302,7 @@ export declare const DOCS_CATALOG: readonly [{
302
302
  readonly summary: "Build and publish a full Next.js app with OpenNext.";
303
303
  readonly keywords: readonly ["nextjs", "next", "react", "framework", "integration", "opennext", "isr", "data cache", "revalidateTag", "revalidatePath"];
304
304
  readonly url: "https://spacefast.com/docs/integrations/nextjs";
305
- readonly body: "Run `sf publish` in a Next.js project. Spacefast builds it with pinned OpenNext and publishes the static assets plus its Functions worker. The automatic adapter keeps the Next Data Cache and tag invalidations in private origin storage scoped to the exact space and version, so cached data survives cold Worker isolates; `revalidateTag()` and `revalidatePath()` invalidate that same store. Concurrent stale ISR requests share a 30-second regeneration lease, with at most 4,096 leases active for one version. Each cached value is limited to 4 MiB; one version may retain 128 MiB, 4,096 entries, and 8,192 tags. A project with its own `open-next.config.ts` owns its adapters instead of receiving Spacefast's automatic cache config.";
305
+ readonly body: "Run `sf publish` in a Next.js project. Spacefast builds it with pinned OpenNext and publishes the browser assets plus its Functions worker. The automatic adapter keeps the Next Data Cache and tag invalidations in private origin storage scoped to the exact space and version, so cached data survives cold Worker isolates; `revalidateTag()` and `revalidatePath()` invalidate that same store. Concurrent stale ISR requests share a 30-second regeneration lease, with at most 4,096 leases active for one version. Each cached value is limited to 4 MiB; one version may retain 128 MiB, 4,096 entries, and 8,192 tags. A project with its own `open-next.config.ts` owns its adapters instead of receiving Spacefast's automatic cache config.";
306
306
  }, {
307
307
  readonly slug: "integrations/vite";
308
308
  readonly title: "Vite integration";
@@ -40,7 +40,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
40
40
  kind: "guide",
41
41
  tier: "essential",
42
42
  summary: "How `sf publish` builds, uploads, and goes live.",
43
- keywords: ["publish", "go live", "upload", "release", "static"],
43
+ keywords: ["publish", "go live", "upload", "release", "artifact"],
44
44
  url: `${DOCS_BASE_URL}/publishing`,
45
45
  body: "`sf publish` snapshots your output directory into an immutable version and promotes it to the production channel. Use `--no-wait` to return before serving finishes.",
46
46
  },
@@ -93,7 +93,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
93
93
  summary: "Publish a file or zipped output folder directly to /v1/publish. No account, CLI install, or MCP setup is required for anonymous publishes.",
94
94
  keywords: ["publish", "curl", "anonymous", "no install", "claim"],
95
95
  url: `${DOCS_BASE_URL}/agents#publish-with-curl`,
96
- body: "curl publish static file folder archive zip anonymous no account no install live URL immutable version claim link /v1/publish",
96
+ body: "curl publish file folder archive zip anonymous no account no install live URL immutable version claim link /v1/publish",
97
97
  },
98
98
  {
99
99
  slug: "workflow/publish-receipt",
@@ -156,10 +156,10 @@ const HAND_WRITTEN_DOCS_CATALOG = [
156
156
  title: "Space file conventions",
157
157
  kind: "workflow",
158
158
  tier: "full",
159
- summary: "Spacefast recognizes _redirects, _headers, nearest 404.html, and sf.jsonc. Static artifacts are served as files; server code is not executed.",
159
+ summary: "Spacefast recognizes _redirects, _headers, nearest 404.html, and sf.jsonc. Published artifacts are served as files; server code is not executed.",
160
160
  keywords: ["_redirects", "_headers", "sf.jsonc", "spacefast.jsonc", "404"],
161
161
  url: `${DOCS_BASE_URL}/configuration`,
162
- body: "_redirects _headers 404.html sf.jsonc static artifact server code not executed proxy rewrite headers",
162
+ body: "_redirects _headers 404.html sf.jsonc artifact server code not executed proxy rewrite headers",
163
163
  },
164
164
  {
165
165
  slug: "workflow/domains-diagnostics",
@@ -269,7 +269,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
269
269
  summary: "Run code on a space with Zero or Functions.",
270
270
  keywords: ["runtime", "zero", "functions", "server", "dynamic", "code", "backend", "sf.jsonc"],
271
271
  url: `${DOCS_BASE_URL}/runtimes`,
272
- body: "A space serves static files until you declare a `runtime` block in sf.jsonc. Every space has its own runtime site. Zero is a capsule with its own database and transactions; Functions is a Cloudflare worker with one `fetch` handler and any npm package. Both are available on every plan and compile during `sf publish`.",
272
+ body: "A space serves published files until you declare a `runtime` block in sf.jsonc. Every space has its own runtime site. Zero is a capsule with its own database and transactions; Functions is a Cloudflare worker with one `fetch` handler and any npm package. Both are available on every plan and compile during `sf publish`.",
273
273
  },
274
274
  {
275
275
  slug: "runtimes/zero",
@@ -340,7 +340,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
340
340
  summary: "Proxy selected paths to an upstream origin.",
341
341
  keywords: ["proxy", "upstream", "route", "api", "backend", "rewrite"],
342
342
  url: `${DOCS_BASE_URL}/proxy-routes`,
343
- body: "Forward specific path prefixes to an external upstream so a static space can front a dynamic API without exposing the origin.",
343
+ body: "Forward specific path prefixes to an external upstream so a space can front an external API without exposing its origin.",
344
344
  },
345
345
  {
346
346
  slug: "image-acceleration",
@@ -371,7 +371,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
371
371
  "revalidatePath",
372
372
  ],
373
373
  url: `${DOCS_BASE_URL}/integrations/nextjs`,
374
- body: "Run `sf publish` in a Next.js project. Spacefast builds it with pinned OpenNext and publishes the static assets plus its Functions worker. The automatic adapter keeps the Next Data Cache and tag invalidations in private origin storage scoped to the exact space and version, so cached data survives cold Worker isolates; `revalidateTag()` and `revalidatePath()` invalidate that same store. Concurrent stale ISR requests share a 30-second regeneration lease, with at most 4,096 leases active for one version. Each cached value is limited to 4 MiB; one version may retain 128 MiB, 4,096 entries, and 8,192 tags. A project with its own `open-next.config.ts` owns its adapters instead of receiving Spacefast's automatic cache config.",
374
+ body: "Run `sf publish` in a Next.js project. Spacefast builds it with pinned OpenNext and publishes the browser assets plus its Functions worker. The automatic adapter keeps the Next Data Cache and tag invalidations in private origin storage scoped to the exact space and version, so cached data survives cold Worker isolates; `revalidateTag()` and `revalidatePath()` invalidate that same store. Concurrent stale ISR requests share a 30-second regeneration lease, with at most 4,096 leases active for one version. Each cached value is limited to 4 MiB; one version may retain 128 MiB, 4,096 entries, and 8,192 tags. A project with its own `open-next.config.ts` owns its adapters instead of receiving Spacefast's automatic cache config.",
375
375
  },
376
376
  {
377
377
  slug: "integrations/vite",