@spacefast/common 0.0.12 → 0.0.17

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 (189) hide show
  1. package/dist/agents/client-registry.d.ts +22 -0
  2. package/dist/agents/client-registry.js +41 -0
  3. package/dist/agents/connect-targets.d.ts +51 -6
  4. package/dist/agents/connect-targets.js +93 -28
  5. package/dist/brand.d.ts +0 -11
  6. package/dist/brand.js +0 -20
  7. package/dist/config/domains.d.ts +15 -6
  8. package/dist/config/domains.js +24 -10
  9. package/dist/config/postgres-budget.d.ts +3 -0
  10. package/dist/config/postgres-budget.js +6 -1
  11. package/dist/config/postgres-budget.json +2 -1
  12. package/dist/contracts/abuse.js +1 -1
  13. package/dist/contracts/access.d.ts +486 -1196
  14. package/dist/contracts/access.js +323 -1054
  15. package/dist/contracts/activity.d.ts +1 -1
  16. package/dist/contracts/activity.js +11 -15
  17. package/dist/contracts/api-keys.d.ts +16 -0
  18. package/dist/contracts/api-keys.js +11 -9
  19. package/dist/contracts/archives.d.ts +1 -2
  20. package/dist/contracts/archives.js +15 -17
  21. package/dist/contracts/beta.js +1 -1
  22. package/dist/contracts/builds.js +14 -14
  23. package/dist/contracts/channels.js +2 -2
  24. package/dist/contracts/comments.d.ts +143 -99
  25. package/dist/contracts/comments.js +194 -79
  26. package/dist/contracts/common.d.ts +12 -12
  27. package/dist/contracts/common.js +33 -30
  28. package/dist/contracts/continuation.js +5 -5
  29. package/dist/contracts/countries.js +2 -7
  30. package/dist/contracts/data-source-routes.d.ts +20 -0
  31. package/dist/contracts/data-source-routes.js +15 -0
  32. package/dist/contracts/device-auth.d.ts +13 -9
  33. package/dist/contracts/device-auth.js +12 -12
  34. package/dist/contracts/docs.d.ts +10 -10
  35. package/dist/contracts/domains.js +39 -33
  36. package/dist/contracts/enums.d.ts +4 -14
  37. package/dist/contracts/enums.js +3 -10
  38. package/dist/contracts/error-code-meta.d.ts +122 -56
  39. package/dist/contracts/error-code-meta.js +43 -19
  40. package/dist/contracts/error-codes.d.ts +7 -4
  41. package/dist/contracts/error-codes.js +48 -24
  42. package/dist/contracts/events.d.ts +22 -15
  43. package/dist/contracts/events.js +33 -5
  44. package/dist/contracts/execution.d.ts +238 -0
  45. package/dist/contracts/execution.js +309 -0
  46. package/dist/contracts/feature-lifecycle.d.ts +39 -188
  47. package/dist/contracts/feature-lifecycle.js +52 -196
  48. package/dist/contracts/features.d.ts +13 -115
  49. package/dist/contracts/features.js +5 -35
  50. package/dist/contracts/functions.d.ts +597 -0
  51. package/dist/contracts/functions.js +475 -0
  52. package/dist/contracts/grants.d.ts +1175 -0
  53. package/dist/contracts/grants.js +783 -0
  54. package/dist/contracts/ids.d.ts +7 -5
  55. package/dist/contracts/ids.js +7 -7
  56. package/dist/contracts/internal.js +2 -2
  57. package/dist/contracts/mcp.d.ts +17 -556
  58. package/dist/contracts/mcp.js +9 -103
  59. package/dist/contracts/me.js +3 -4
  60. package/dist/contracts/notifications.d.ts +108 -0
  61. package/dist/contracts/notifications.js +54 -0
  62. package/dist/contracts/oauth-resources.d.ts +22 -5
  63. package/dist/contracts/oauth-resources.js +23 -2
  64. package/dist/contracts/operations.d.ts +0 -48
  65. package/dist/contracts/operations.js +0 -19
  66. package/dist/contracts/pages.d.ts +10 -14
  67. package/dist/contracts/pages.js +17 -21
  68. package/dist/contracts/plan-policy.d.ts +1 -8
  69. package/dist/contracts/plan-policy.js +1 -4
  70. package/dist/contracts/platform.d.ts +78 -30
  71. package/dist/contracts/platform.js +69 -20
  72. package/dist/contracts/problem-document.d.ts +14 -0
  73. package/dist/contracts/problem-document.js +35 -0
  74. package/dist/contracts/push-new.d.ts +41 -2
  75. package/dist/contracts/push-new.js +4 -0
  76. package/dist/contracts/quotas.d.ts +0 -1
  77. package/dist/contracts/quotas.js +0 -5
  78. package/dist/contracts/repository-connections.d.ts +1 -1
  79. package/dist/contracts/resources.d.ts +16 -71
  80. package/dist/contracts/resources.js +13 -16
  81. package/dist/contracts/runtime-api.d.ts +666 -303
  82. package/dist/contracts/runtime-api.js +272 -113
  83. package/dist/contracts/runtime-app.d.ts +168 -0
  84. package/dist/contracts/runtime-app.js +42 -0
  85. package/dist/contracts/runtime-db.d.ts +424 -0
  86. package/dist/contracts/runtime-db.js +108 -0
  87. package/dist/contracts/runtime-storage.d.ts +120 -0
  88. package/dist/contracts/runtime-storage.js +40 -0
  89. package/dist/contracts/sf-config-v1.d.ts +54 -1
  90. package/dist/contracts/sf-config-v1.js +2 -2
  91. package/dist/contracts/sites.d.ts +6 -0
  92. package/dist/contracts/sites.js +30 -11
  93. package/dist/contracts/space-config.d.ts +91 -121
  94. package/dist/contracts/space-config.js +464 -42
  95. package/dist/contracts/spaces.d.ts +300 -171
  96. package/dist/contracts/spaces.js +128 -98
  97. package/dist/contracts/superadmin-emails.d.ts +2 -2
  98. package/dist/contracts/superadmin-spaces.d.ts +26 -130
  99. package/dist/contracts/superadmin-spaces.js +22 -0
  100. package/dist/contracts/superadmin-tenants.js +4 -4
  101. package/dist/contracts/superadmin.d.ts +4 -0
  102. package/dist/contracts/superadmin.js +14 -1
  103. package/dist/contracts/tags.d.ts +6 -6
  104. package/dist/contracts/tags.js +1 -1
  105. package/dist/contracts/teams.d.ts +9 -9
  106. package/dist/contracts/teams.js +25 -16
  107. package/dist/contracts/theme-json.js +1 -1
  108. package/dist/contracts/transfers.d.ts +0 -1
  109. package/dist/contracts/transfers.js +4 -4
  110. package/dist/contracts/variables.js +3 -3
  111. package/dist/contracts/zero.d.ts +384 -596
  112. package/dist/contracts/zero.js +167 -299
  113. package/dist/dashboard-paths/index.d.ts +18 -3
  114. package/dist/dashboard-paths/index.js +19 -0
  115. package/dist/docs/agent-handoff-document.d.ts +2 -2
  116. package/dist/docs/agent-handoff-document.js +8 -7
  117. package/dist/docs/agent-prose.d.ts +22 -3
  118. package/dist/docs/agent-prose.js +227 -55
  119. package/dist/docs/agent-setup.d.ts +14 -11
  120. package/dist/docs/agent-setup.js +289 -61
  121. package/dist/docs/agent-solutions.d.ts +6 -6
  122. package/dist/docs/agent-solutions.js +24 -22
  123. package/dist/docs/catalog.d.ts +53 -98
  124. package/dist/docs/catalog.js +90 -117
  125. package/dist/docs/error-docs.js +304 -236
  126. package/dist/docs/skill-distribution.d.ts +2 -0
  127. package/dist/docs/skill-distribution.js +7 -4
  128. package/dist/docs/skills.d.ts +546 -0
  129. package/dist/docs/skills.js +340 -0
  130. package/dist/utils/auth-redirect.d.ts +1 -3
  131. package/dist/utils/auth-redirect.js +1 -21
  132. package/dist/utils/browser-credential.d.ts +19 -0
  133. package/dist/utils/browser-credential.js +62 -0
  134. package/dist/utils/build-settings.d.ts +2 -0
  135. package/dist/utils/build-settings.js +61 -9
  136. package/dist/utils/comment-avatars.d.ts +7 -0
  137. package/dist/utils/comment-avatars.js +42 -0
  138. package/dist/utils/content-type.d.ts +3 -3
  139. package/dist/utils/content-type.js +38 -61
  140. package/dist/utils/credential-policy.d.ts +1 -1
  141. package/dist/utils/credential-policy.js +4 -0
  142. package/dist/utils/domain-diagnostics.d.ts +5 -5
  143. package/dist/utils/domain-diagnostics.js +21 -10
  144. package/dist/utils/egress-policy.fixtures.json +1 -1
  145. package/dist/utils/grants.d.ts +53 -0
  146. package/dist/utils/grants.js +160 -0
  147. package/dist/utils/local-space-state.d.ts +78 -4
  148. package/dist/utils/local-space-state.js +384 -82
  149. package/dist/utils/one-shot-replay.d.ts +14 -0
  150. package/dist/utils/one-shot-replay.js +21 -0
  151. package/dist/utils/page-preview.d.ts +7 -0
  152. package/dist/utils/page-preview.js +9 -0
  153. package/dist/utils/pages.d.ts +2 -5
  154. package/dist/utils/pages.js +64 -33
  155. package/dist/utils/publish-form-data.d.ts +22 -0
  156. package/dist/utils/publish-form-data.js +26 -0
  157. package/dist/utils/publish-policy.d.ts +34 -4
  158. package/dist/utils/publish-policy.js +149 -62
  159. package/dist/utils/query-keys.d.ts +8 -10
  160. package/dist/utils/query-keys.js +14 -10
  161. package/dist/utils/runtime-paths.d.ts +3 -0
  162. package/dist/utils/runtime-paths.js +7 -0
  163. package/dist/utils/secure-local-file.d.ts +73 -0
  164. package/dist/utils/secure-local-file.js +1373 -0
  165. package/dist/utils/space-config.d.ts +17 -4
  166. package/dist/utils/space-config.js +151 -8
  167. package/dist/utils/static-runtime-policy.d.ts +5 -0
  168. package/dist/utils/static-runtime-policy.js +54 -10
  169. package/dist/utils/storage-policy.d.ts +20 -0
  170. package/dist/utils/storage-policy.fixtures.json +174 -0
  171. package/dist/utils/storage-policy.js +193 -0
  172. package/dist/utils/upload-session.d.ts +15 -1
  173. package/dist/utils/upload-session.js +68 -2
  174. package/dist/utils/version-file-browser.d.ts +13 -0
  175. package/dist/utils/version-file-browser.js +59 -0
  176. package/package.json +20 -1
  177. package/dist/contracts/mounts.d.ts +0 -142
  178. package/dist/contracts/mounts.js +0 -56
  179. package/dist/utils/access-grant.d.ts +0 -14
  180. package/dist/utils/access-grant.js +0 -88
  181. package/dist/utils/access-match.d.ts +0 -46
  182. package/dist/utils/access-match.fixtures.json +0 -513
  183. package/dist/utils/access-match.js +0 -312
  184. package/dist/utils/access-verdict.fixtures.json +0 -421
  185. package/dist/utils/asset-fingerprint.d.ts +0 -53
  186. package/dist/utils/asset-fingerprint.js +0 -574
  187. package/dist/utils/sf-config-v1.d.ts +0 -2
  188. package/dist/utils/sf-config-v1.fixtures.json +0 -9
  189. package/dist/utils/sf-config-v1.js +0 -551
@@ -17,6 +17,7 @@
17
17
  // and MCP search without a second hand-maintained corpus to drift.
18
18
  import { errorDocsUrl } from "../contracts/error-codes.js";
19
19
  import { ERROR_DOCS } from "./error-docs.js";
20
+ import { renderSpacefastSkill, SPACEFAST_RECIPE_SKILLS } from "./skills.js";
20
21
  /** Which part of the docs a page belongs to (runtime list + derived type). */
21
22
  export const DOC_KINDS = ["guide", "cli", "api", "recipe", "workflow", "error"];
22
23
  /** Base URL all bundled docs links resolve against. */
@@ -43,6 +44,16 @@ const HAND_WRITTEN_DOCS_CATALOG = [
43
44
  url: `${DOCS_BASE_URL}/publishing`,
44
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.",
45
46
  },
47
+ {
48
+ slug: "spaces/rename",
49
+ title: "Rename a space",
50
+ kind: "guide",
51
+ tier: "full",
52
+ summary: "Change a space slug and its managed view.fast address without breaking old links.",
53
+ keywords: ["space", "rename", "slug", "view.fast", "redirect", "managed hostname"],
54
+ url: `${DOCS_BASE_URL}/spaces/rename`,
55
+ body: 'Run `sf spaces update --space <space> --slug <new-slug> --wait`, or PATCH `/v1/spaces/{spaceId}` with `{ "slug": "<new-slug>" }`. The managed view.fast hostname changes with the slug. Former managed addresses and branch aliases redirect directly to their current counterparts with a temporary, path- and query-preserving 307 for the life of the space unless an operator explicitly releases them. Custom domains stay attached, and immutable version URLs do not change.',
56
+ },
46
57
  {
47
58
  slug: "versions-and-rollback",
48
59
  title: "Versions and rollback",
@@ -89,10 +100,10 @@ const HAND_WRITTEN_DOCS_CATALOG = [
89
100
  title: "Publish receipt fields",
90
101
  kind: "workflow",
91
102
  tier: "full",
92
- summary: "Use the receipt as the source of truth: space.liveUrl, version.immutableUrl, shareBlurb, claim.url, claim.expiresAt, links, diagnostics, and errors.",
103
+ summary: "Use the receipt as the source of truth. Present open.url and claim.url as the two user-facing links; liveUrl and immutableUrl identify resources for automation.",
93
104
  keywords: ["receipt", "share", "claim", "diagnostics"],
94
105
  url: `${DOCS_BASE_URL}/api#publish`,
95
- body: "receipt liveUrl immutableUrl shareBlurb claim url expiresAt diagnostics links finalize promote upload errors docsUrl",
106
+ body: "receipt liveUrl open url immutableUrl claim expiresAt diagnostics links finalize promote upload errors docsUrl",
96
107
  },
97
108
  {
98
109
  slug: "workflow/continue-after-claim",
@@ -108,7 +119,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
108
119
  "continuation",
109
120
  ],
110
121
  url: `${DOCS_BASE_URL}/agents#continue-after-claim`,
111
- body: "continue continuation claim token exchange voucher continue_space POST /v1/anonymous-claim/exchange space_claimed_credential_available continuation_used continuation_unavailable durable access token state.json update after claim claim_status",
122
+ body: "continue continuation claim token exchange voucher publish execute POST /v1/anonymous-claim/exchange space_claimed_credential_available continuation_used continuation_unavailable durable access token state.json update after claim",
112
123
  },
113
124
  {
114
125
  slug: "workflow/secret-handling",
@@ -125,10 +136,10 @@ const HAND_WRITTEN_DOCS_CATALOG = [
125
136
  title: "CLI command surface",
126
137
  kind: "workflow",
127
138
  tier: "full",
128
- summary: "Use sf for repeat work: publish, versions, rollback, logs, domains, passwords, teams, API calls, and On-Device MCP serving.",
139
+ summary: "Use sf for repeat work: publish, versions, rollback, logs, domains, sharing, teams, API calls, and On-Device MCP serving.",
129
140
  keywords: ["sf", "cli", "spacefast", "mcp", "json"],
130
141
  url: `${DOCS_BASE_URL}/cli`,
131
- body: "sf spacefast CLI publish versions rollback logs domains passwords teams api mcp setup profile login --json",
142
+ body: "sf spacefast CLI publish versions rollback logs domains share teams api mcp setup profile login --json",
132
143
  },
133
144
  {
134
145
  slug: "workflow/mcp-local",
@@ -140,35 +151,6 @@ const HAND_WRITTEN_DOCS_CATALOG = [
140
151
  url: `${DOCS_BASE_URL}/agents#mcp`,
141
152
  body: "MCP on-device local CLI stdio streamable HTTP sf mcp roots files workspace tool calls structuredContent apps",
142
153
  },
143
- {
144
- slug: "workflow/workspace-files",
145
- title: "Agent workspace files",
146
- kind: "workflow",
147
- tier: "full",
148
- summary: "Hosted MCP workspace tools edit, import, export, and publish a durable virtual workspace; On-Device MCP workspace tools edit the bounded local root.",
149
- keywords: [
150
- "workspace",
151
- "files",
152
- "patch",
153
- "diff",
154
- "virtual workspace",
155
- "workspace import",
156
- "workspace export",
157
- "just-bash",
158
- ],
159
- url: `${DOCS_BASE_URL}/agents#workspace-files`,
160
- body: "workspace file editing read write patch diff list manifest import export import_url hosted virtual workspace just-bash shell handoff on-device root SPACEFAST_MCP_WORKSPACE_ROOT secret scanning bounded files",
161
- },
162
- {
163
- slug: "workflow/mcp-resources",
164
- title: "MCP resources for account, teams, spaces, and policy",
165
- kind: "workflow",
166
- tier: "full",
167
- summary: "Use read-only resources for bounded context before tools: account/current, teams/current, spaces/recent, space detail, recent versions, policy/current, and workspace/manifest.",
168
- keywords: ["resources", "account", "teams", "spaces", "policy", "context"],
169
- url: `${DOCS_BASE_URL}/agents#mcp-resources`,
170
- body: "MCP resources account current teams current list spaces recent space detail versions recent domains logs summary policy current workspace manifest tools catalog read-only context redacted",
171
- },
172
154
  {
173
155
  slug: "workflow/space-files",
174
156
  title: "Space file conventions",
@@ -177,7 +159,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
177
159
  summary: "Spacefast recognizes _redirects, _headers, nearest 404.html, and sf.jsonc. Static artifacts are served as files; server code is not executed.",
178
160
  keywords: ["_redirects", "_headers", "sf.jsonc", "spacefast.jsonc", "404"],
179
161
  url: `${DOCS_BASE_URL}/configuration`,
180
- body: "_redirects _headers 404.html sf.jsonc static artifact server code not executed proxy rewrite headers basic auth",
162
+ body: "_redirects _headers 404.html sf.jsonc static artifact server code not executed proxy rewrite headers",
181
163
  },
182
164
  {
183
165
  slug: "workflow/domains-diagnostics",
@@ -244,10 +226,10 @@ const HAND_WRITTEN_DOCS_CATALOG = [
244
226
  title: "Access control",
245
227
  kind: "guide",
246
228
  tier: "full",
247
- summary: "Password-protect a space or grant access to specific people.",
248
- keywords: ["access", "password", "grant", "ban", "private", "audience", "auth"],
229
+ summary: "Create scoped Grants, invite People, and manage Links or credentials.",
230
+ keywords: ["access", "share", "people", "links", "private", "team", "public"],
249
231
  url: `${DOCS_BASE_URL}/access`,
250
- body: "Gate a space with `sf password set`, grant individuals with `sf access grant`, and review effective rules with `sf access effective`.",
232
+ body: "Use `sf share grant`, `sf share people`, `sf share link`, `sf share password`, or `sf share token`. Inspect one route with `sf share check`; every audience uses the same path, capability, target, and constraint evaluator.",
251
233
  },
252
234
  {
253
235
  slug: "redirects",
@@ -264,10 +246,10 @@ const HAND_WRITTEN_DOCS_CATALOG = [
264
246
  title: "Custom headers",
265
247
  kind: "guide",
266
248
  tier: "full",
267
- summary: "Attach response headers and path-scoped Basic Auth.",
268
- keywords: ["headers", "cache", "security", "basic auth", "_headers", "cors"],
249
+ summary: "Attach supported response headers by path.",
250
+ keywords: ["headers", "cache", "security", "_headers", "cors"],
269
251
  url: `${DOCS_BASE_URL}/headers`,
270
- body: "Add a `_headers` file at your publish root to set or remove response headers per path. Path-scoped Basic Auth credentials travel with the publish.",
252
+ body: "Add a `_headers` file at your publish root to set or remove supported response headers per path.",
271
253
  },
272
254
  {
273
255
  slug: "builds",
@@ -277,7 +259,58 @@ const HAND_WRITTEN_DOCS_CATALOG = [
277
259
  summary: "Connect a repository so pushes build and publish automatically.",
278
260
  keywords: ["build", "git", "github", "ci", "push", "connect", "preview"],
279
261
  url: `${DOCS_BASE_URL}/builds`,
280
- body: "Connect a repository with `sf git connect`; each push runs your build on Spacefast and publishes a version, with branches and pull requests getting preview URLs.",
262
+ body: "Connect a repository with `sf git connect`; each push runs your build on Spacefast and publishes a version. Branch and pull-request previews are private by default; use Open for yourself or create a scoped Link for reviewers.",
263
+ },
264
+ {
265
+ slug: "runtimes",
266
+ title: "Runtimes",
267
+ kind: "guide",
268
+ tier: "full",
269
+ summary: "Run code on a space with Zero or Functions.",
270
+ keywords: ["runtime", "zero", "functions", "server", "dynamic", "code", "backend", "sf.jsonc"],
271
+ url: `${DOCS_BASE_URL}/runtimes`,
272
+ body: "A space serves static files until you declare a `runtime` block in sf.jsonc. Zero is a capsule with its own database and transactions; Functions is a worker with one `fetch` handler and any npm package. Both compile during `sf publish`. Zero runs on plans with dedicated runtime isolation; Functions remains in private beta.",
273
+ },
274
+ {
275
+ slug: "runtimes/zero",
276
+ title: "Spacefast Zero",
277
+ kind: "guide",
278
+ tier: "full",
279
+ summary: "A capsule with a database: schema, queries, mutations, endpoints.",
280
+ keywords: [
281
+ "zero",
282
+ "capsule",
283
+ "database",
284
+ "schema",
285
+ "query",
286
+ "mutation",
287
+ "endpoint",
288
+ "transaction",
289
+ "sql",
290
+ "sf dev",
291
+ ],
292
+ url: `${DOCS_BASE_URL}/runtimes/zero`,
293
+ body: "Zero is for apps where the data is the point. Write one capsule — schema, queries, mutations, endpoints — start it locally with `sf dev`, and `sf publish` puts it live with its own database on a plan with dedicated runtime isolation.",
294
+ },
295
+ {
296
+ slug: "runtimes/functions",
297
+ title: "Spacefast Functions",
298
+ kind: "guide",
299
+ tier: "full",
300
+ summary: "A worker for your space: one `fetch` handler, any npm package.",
301
+ keywords: [
302
+ "functions",
303
+ "worker",
304
+ "fetch",
305
+ "ssr",
306
+ "cloudflare",
307
+ "npm",
308
+ "handler",
309
+ "server",
310
+ "api",
311
+ ],
312
+ url: `${DOCS_BASE_URL}/runtimes/functions`,
313
+ body: 'Functions runs a worker for your space: a default export with a `fetch` method, served from your space\'s own origin, so requests no file answers reach your code. Opt into a database with `"database": true`. Private beta — the team needs the flag.',
281
314
  },
282
315
  {
283
316
  slug: "collab",
@@ -495,10 +528,10 @@ const HAND_WRITTEN_DOCS_CATALOG = [
495
528
  title: "sf access",
496
529
  kind: "cli",
497
530
  tier: "full",
498
- summary: "Grant, ban, and inspect who can view a space.",
499
- keywords: ["access", "grant", "ban", "password", "effective", "rules", "policy"],
531
+ summary: "Emergency visitor-session revocation.",
532
+ keywords: ["access", "sessions", "revoke", "logout"],
500
533
  url: `${DOCS_BASE_URL}/cli`,
501
- body: "`sf access grant` / `sf access ban` edit access rules; `sf access effective` shows the resolved policy. Use `sf password set` for a shared password.",
534
+ body: "Use `sf access logout-all` to revoke every opened visitor session. Define audience-specific network restrictions on the corresponding Grant.",
502
535
  },
503
536
  {
504
537
  slug: "cli/teams",
@@ -599,7 +632,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
599
632
  summary: "Create, list, and update spaces over HTTP.",
600
633
  keywords: ["api", "spaces", "space", "create", "list", "endpoint"],
601
634
  url: `${DOCS_BASE_URL}/api`,
602
- body: "`GET /v1/spaces` lists spaces; `POST /v1/spaces` creates one. Responses carry the space id, slug, and live URL.",
635
+ body: "`GET /v1/spaces` lists spaces; `POST /v1/spaces` creates one. `PATCH /v1/spaces/{spaceId}` with a slug-only body renames the space and managed hostname. Former managed addresses temporarily 307 to the current hostname while immutable version URLs stay unchanged. Responses carry the space id, slug, and live URL.",
603
636
  },
604
637
  {
605
638
  slug: "api/versions",
@@ -661,78 +694,17 @@ const HAND_WRITTEN_DOCS_CATALOG = [
661
694
  url: `${DOCS_BASE_URL}/platforms`,
662
695
  body: "The platform API is the tenant-facing surface for operating Spacefast as hosting infra. It shares the `{ data }` / `{ error }` envelope and is documented via OpenAPI.",
663
696
  },
664
- // ----- Recipes ----------------------------------------------------------
665
- {
666
- slug: "recipes/github-deploys",
667
- title: "Publish from GitHub",
668
- kind: "recipe",
669
- tier: "full",
670
- summary: "Connect a repository so pushes publish automatically.",
671
- keywords: ["github", "git", "ci", "push", "connect", "automatic", "recipe"],
672
- url: `${DOCS_BASE_URL}/builds`,
673
- body: "Connect a repository with `sf git connect`; each push builds on Spacefast and publishes a version, with pull requests getting preview URLs.",
674
- },
675
- {
676
- slug: "recipes/preview-channels",
677
- title: "Preview channels for pull requests",
678
- kind: "recipe",
679
- tier: "full",
680
- summary: "Give every branch a shareable preview URL.",
681
- keywords: ["preview", "channel", "branch", "pull request", "staging", "recipe"],
682
- url: `${DOCS_BASE_URL}/builds`,
683
- body: "Push a branch or open a pull request on a connected repository, or publish to a named channel, to get an isolated preview URL without touching production.",
684
- },
685
- {
686
- slug: "recipes/agent-publish",
687
- title: "Let an agent publish for you",
688
- kind: "recipe",
689
- tier: "full",
690
- summary: "Drive a first publish from an AI agent, then claim it.",
691
- keywords: ["agent", "ai", "mcp", "anonymous", "claim", "automation", "recipe"],
692
- url: `${DOCS_BASE_URL}/anonymous-publish`,
693
- body: "Let an agent publish anonymously for an instant URL and a claim token, then hand the token to a human who runs `sf spaces claim`.",
694
- },
695
- {
696
- slug: "recipes/custom-domain",
697
- title: "Add a custom domain",
698
- kind: "recipe",
699
- tier: "full",
700
- summary: "Point your own domain at a space with automatic TLS.",
701
- keywords: ["domain", "custom domain", "dns", "tls", "https", "recipe"],
702
- url: "https://spacefast.com/help/domains",
703
- body: "Add the domain with `sf domains add`, set the DNS records Spacefast prints, and wait for `sf domains check` to report a ready certificate.",
704
- },
705
- {
706
- slug: "recipes/password-protect",
707
- title: "Password-protect a space",
708
- kind: "recipe",
709
- tier: "full",
710
- summary: "Put one shared password in front of a whole space.",
711
- keywords: ["password", "protect", "private", "access", "gate", "recipe"],
712
- url: "https://spacefast.com/help/access",
713
- body: "Run `sf password set` to gate a space behind a single shared secret; clear it later with `sf password clear`.",
714
- },
715
- {
716
- slug: "recipes/redirects",
717
- title: "Set up redirects",
718
- kind: "recipe",
719
- tier: "reference",
720
- summary: "Add redirect rules that ship and roll back with a version.",
721
- keywords: ["redirect", "rewrite", "routing", "301", "recipe"],
722
- url: "https://spacefast.com/help/redirects",
723
- body: "Add redirect rules to a `_redirects` file at your publish root so they publish as part of the version and roll back with it.",
724
- },
725
- {
726
- slug: "recipes/migrate-dns",
727
- title: "Migrate DNS to a custom domain",
728
- kind: "recipe",
729
- tier: "reference",
730
- summary: "Cut traffic over to a Spacefast-served domain safely.",
731
- keywords: ["dns", "migrate", "cutover", "domain", "nameserver", "recipe"],
732
- url: "https://spacefast.com/help/domains",
733
- body: "Pre-stage the domain with `sf domains add`, verify the certificate is ready with `sf domains check`, then update DNS to flip traffic with zero downtime.",
734
- },
735
697
  ];
698
+ const SKILL_RECIPE_DOCS = SPACEFAST_RECIPE_SKILLS.map((skill) => ({
699
+ slug: skill.recipe.slug,
700
+ title: skill.title,
701
+ kind: "recipe",
702
+ tier: skill.recipe.tier,
703
+ summary: skill.description,
704
+ keywords: [...skill.keywords, "recipe", "skill"],
705
+ url: skill.recipe.url,
706
+ body: renderSpacefastSkill(skill, "local"),
707
+ }));
736
708
  // ----- Error reference (generated) -----------------------------------------
737
709
  // One reference-tier catalog entry per ERROR_DOCS member, so `sf docs <code>`,
738
710
  // `GET /v1/docs?q=<code>`, and MCP search all resolve error codes in a single
@@ -752,5 +724,6 @@ function errorDocsCatalogEntries() {
752
724
  }
753
725
  export const DOCS_CATALOG = [
754
726
  ...HAND_WRITTEN_DOCS_CATALOG,
727
+ ...SKILL_RECIPE_DOCS,
755
728
  ...errorDocsCatalogEntries(),
756
729
  ];