@spacefast/common 0.0.13 → 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 (154) 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 +149 -44
  14. package/dist/contracts/access.js +94 -8
  15. package/dist/contracts/activity.js +5 -1
  16. package/dist/contracts/api-keys.js +9 -9
  17. package/dist/contracts/archives.js +11 -11
  18. package/dist/contracts/beta.js +1 -1
  19. package/dist/contracts/builds.js +14 -14
  20. package/dist/contracts/channels.js +2 -2
  21. package/dist/contracts/comments.d.ts +86 -15
  22. package/dist/contracts/comments.js +116 -20
  23. package/dist/contracts/common.d.ts +12 -12
  24. package/dist/contracts/common.js +33 -30
  25. package/dist/contracts/continuation.js +5 -5
  26. package/dist/contracts/data-source-routes.js +1 -1
  27. package/dist/contracts/device-auth.d.ts +6 -6
  28. package/dist/contracts/device-auth.js +12 -12
  29. package/dist/contracts/docs.d.ts +10 -10
  30. package/dist/contracts/domains.js +39 -33
  31. package/dist/contracts/enums.d.ts +2 -10
  32. package/dist/contracts/enums.js +0 -2
  33. package/dist/contracts/error-code-meta.d.ts +116 -47
  34. package/dist/contracts/error-code-meta.js +37 -16
  35. package/dist/contracts/error-codes.d.ts +7 -4
  36. package/dist/contracts/error-codes.js +46 -21
  37. package/dist/contracts/events.d.ts +10 -3
  38. package/dist/contracts/events.js +33 -5
  39. package/dist/contracts/execution.d.ts +26 -0
  40. package/dist/contracts/execution.js +21 -0
  41. package/dist/contracts/feature-lifecycle.d.ts +21 -24
  42. package/dist/contracts/feature-lifecycle.js +28 -26
  43. package/dist/contracts/features.js +4 -4
  44. package/dist/contracts/functions.d.ts +8 -140
  45. package/dist/contracts/functions.js +9 -19
  46. package/dist/contracts/git.d.ts +1 -1
  47. package/dist/contracts/grants.d.ts +96 -79
  48. package/dist/contracts/grants.js +130 -43
  49. package/dist/contracts/ids.d.ts +2 -2
  50. package/dist/contracts/ids.js +2 -4
  51. package/dist/contracts/internal.js +2 -2
  52. package/dist/contracts/mcp.d.ts +17 -556
  53. package/dist/contracts/mcp.js +9 -103
  54. package/dist/contracts/me.js +3 -4
  55. package/dist/contracts/notifications.d.ts +108 -0
  56. package/dist/contracts/notifications.js +54 -0
  57. package/dist/contracts/oauth-resources.d.ts +18 -1
  58. package/dist/contracts/oauth-resources.js +22 -2
  59. package/dist/contracts/operations.d.ts +2 -50
  60. package/dist/contracts/operations.js +0 -19
  61. package/dist/contracts/pages.d.ts +8 -4
  62. package/dist/contracts/pages.js +16 -3
  63. package/dist/contracts/platform.js +10 -8
  64. package/dist/contracts/problem-document.d.ts +14 -0
  65. package/dist/contracts/problem-document.js +35 -0
  66. package/dist/contracts/push-new.d.ts +21 -6
  67. package/dist/contracts/push-new.js +3 -7
  68. package/dist/contracts/resources.d.ts +8 -7
  69. package/dist/contracts/resources.js +9 -6
  70. package/dist/contracts/runtime-api.d.ts +162 -92
  71. package/dist/contracts/runtime-api.js +99 -27
  72. package/dist/contracts/runtime-app.d.ts +41 -11
  73. package/dist/contracts/runtime-app.js +22 -1
  74. package/dist/contracts/runtime-db.d.ts +424 -0
  75. package/dist/contracts/runtime-db.js +108 -0
  76. package/dist/contracts/runtime-storage.d.ts +120 -0
  77. package/dist/contracts/runtime-storage.js +40 -0
  78. package/dist/contracts/sf-config-v1.d.ts +49 -1
  79. package/dist/contracts/sf-config-v1.js +2 -2
  80. package/dist/contracts/sites.d.ts +1 -0
  81. package/dist/contracts/sites.js +20 -12
  82. package/dist/contracts/space-config.d.ts +62 -22
  83. package/dist/contracts/space-config.js +173 -47
  84. package/dist/contracts/spaces.d.ts +79 -45
  85. package/dist/contracts/spaces.js +66 -50
  86. package/dist/contracts/superadmin-spaces.d.ts +13 -2
  87. package/dist/contracts/superadmin-spaces.js +15 -0
  88. package/dist/contracts/superadmin-tenants.js +4 -4
  89. package/dist/contracts/superadmin.d.ts +4 -0
  90. package/dist/contracts/superadmin.js +14 -1
  91. package/dist/contracts/tags.d.ts +17 -17
  92. package/dist/contracts/tags.js +1 -1
  93. package/dist/contracts/teams.js +25 -16
  94. package/dist/contracts/theme-json.js +1 -1
  95. package/dist/contracts/transfers.js +4 -4
  96. package/dist/contracts/variables.js +3 -3
  97. package/dist/contracts/zero.d.ts +204 -338
  98. package/dist/contracts/zero.js +94 -98
  99. package/dist/dashboard-paths/index.d.ts +16 -1
  100. package/dist/dashboard-paths/index.js +18 -0
  101. package/dist/docs/agent-handoff-document.d.ts +2 -2
  102. package/dist/docs/agent-handoff-document.js +8 -7
  103. package/dist/docs/agent-prose.d.ts +22 -3
  104. package/dist/docs/agent-prose.js +221 -51
  105. package/dist/docs/agent-setup.d.ts +13 -10
  106. package/dist/docs/agent-setup.js +279 -53
  107. package/dist/docs/agent-solutions.d.ts +6 -6
  108. package/dist/docs/agent-solutions.js +23 -21
  109. package/dist/docs/catalog.d.ts +29 -74
  110. package/dist/docs/catalog.js +65 -92
  111. package/dist/docs/error-docs.js +293 -221
  112. package/dist/docs/skill-distribution.d.ts +2 -0
  113. package/dist/docs/skill-distribution.js +7 -4
  114. package/dist/docs/skills.d.ts +546 -0
  115. package/dist/docs/skills.js +340 -0
  116. package/dist/utils/browser-credential.d.ts +19 -0
  117. package/dist/utils/browser-credential.js +62 -0
  118. package/dist/utils/comment-avatars.d.ts +7 -0
  119. package/dist/utils/comment-avatars.js +42 -0
  120. package/dist/utils/content-type.d.ts +3 -3
  121. package/dist/utils/content-type.js +38 -61
  122. package/dist/utils/domain-diagnostics.d.ts +5 -5
  123. package/dist/utils/domain-diagnostics.js +21 -10
  124. package/dist/utils/local-space-state.d.ts +78 -4
  125. package/dist/utils/local-space-state.js +383 -82
  126. package/dist/utils/one-shot-replay.d.ts +14 -0
  127. package/dist/utils/one-shot-replay.js +21 -0
  128. package/dist/utils/page-preview.d.ts +7 -0
  129. package/dist/utils/page-preview.js +9 -0
  130. package/dist/utils/pages.d.ts +2 -11
  131. package/dist/utils/pages.js +58 -14
  132. package/dist/utils/publish-form-data.d.ts +22 -0
  133. package/dist/utils/publish-form-data.js +26 -0
  134. package/dist/utils/publish-policy.js +20 -4
  135. package/dist/utils/query-keys.d.ts +7 -4
  136. package/dist/utils/query-keys.js +13 -4
  137. package/dist/utils/runtime-paths.d.ts +3 -0
  138. package/dist/utils/runtime-paths.js +7 -0
  139. package/dist/utils/secure-local-file.d.ts +73 -0
  140. package/dist/utils/secure-local-file.js +1373 -0
  141. package/dist/utils/space-config.d.ts +13 -4
  142. package/dist/utils/space-config.js +123 -15
  143. package/dist/utils/storage-policy.d.ts +20 -0
  144. package/dist/utils/storage-policy.fixtures.json +174 -0
  145. package/dist/utils/storage-policy.js +193 -0
  146. package/dist/utils/upload-session.d.ts +12 -1
  147. package/dist/utils/upload-session.js +37 -2
  148. package/dist/utils/version-file-browser.d.ts +13 -0
  149. package/dist/utils/version-file-browser.js +59 -0
  150. package/package.json +19 -1
  151. package/dist/contracts/mounts.d.ts +0 -142
  152. package/dist/contracts/mounts.js +0 -56
  153. package/dist/utils/asset-fingerprint.d.ts +0 -64
  154. package/dist/utils/asset-fingerprint.js +0 -620
@@ -92,7 +92,7 @@ export declare const DOCS_CATALOG: readonly [{
92
92
  readonly title: "Publish receipt fields";
93
93
  readonly kind: "workflow";
94
94
  readonly tier: "full";
95
- readonly summary: "Use the receipt as the source of truth: space.liveUrl, open.url, version.immutableUrl, claim.url, claim.expiresAt, links, diagnostics, and errors.";
95
+ readonly 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.";
96
96
  readonly keywords: readonly ["receipt", "share", "claim", "diagnostics"];
97
97
  readonly url: "https://spacefast.com/docs/api#publish";
98
98
  readonly body: "receipt liveUrl open url immutableUrl claim expiresAt diagnostics links finalize promote upload errors docsUrl";
@@ -104,7 +104,7 @@ export declare const DOCS_CATALOG: readonly [{
104
104
  readonly summary: "After the owner claims an anonymous space with continuation enabled, exchange the saved claim token once for a durable space-scoped access token, save it over the claim token, and keep publishing.";
105
105
  readonly keywords: readonly ["continue", "exchange", "claim token", "space_claimed_credential_available", "continuation"];
106
106
  readonly url: "https://spacefast.com/docs/agents#continue-after-claim";
107
- readonly 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";
107
+ readonly 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";
108
108
  }, {
109
109
  readonly slug: "workflow/secret-handling";
110
110
  readonly title: "Secret handling rules";
@@ -132,24 +132,6 @@ export declare const DOCS_CATALOG: readonly [{
132
132
  readonly keywords: readonly ["mcp", "stdio", "streamable http", "on-device", "local"];
133
133
  readonly url: "https://spacefast.com/docs/agents#mcp";
134
134
  readonly body: "MCP on-device local CLI stdio streamable HTTP sf mcp roots files workspace tool calls structuredContent apps";
135
- }, {
136
- readonly slug: "workflow/workspace-files";
137
- readonly title: "Agent workspace files";
138
- readonly kind: "workflow";
139
- readonly tier: "full";
140
- readonly summary: "Hosted MCP workspace tools edit, import, export, and publish a durable virtual workspace; On-Device MCP workspace tools edit the bounded local root.";
141
- readonly keywords: readonly ["workspace", "files", "patch", "diff", "virtual workspace", "workspace import", "workspace export", "just-bash"];
142
- readonly url: "https://spacefast.com/docs/agents#workspace-files";
143
- readonly 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";
144
- }, {
145
- readonly slug: "workflow/mcp-resources";
146
- readonly title: "MCP resources for account, teams, spaces, and policy";
147
- readonly kind: "workflow";
148
- readonly tier: "full";
149
- readonly 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.";
150
- readonly keywords: readonly ["resources", "account", "teams", "spaces", "policy", "context"];
151
- readonly url: "https://spacefast.com/docs/agents#mcp-resources";
152
- readonly 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";
153
135
  }, {
154
136
  readonly slug: "workflow/space-files";
155
137
  readonly title: "Space file conventions";
@@ -249,6 +231,33 @@ export declare const DOCS_CATALOG: readonly [{
249
231
  readonly keywords: readonly ["build", "git", "github", "ci", "push", "connect", "preview"];
250
232
  readonly url: "https://spacefast.com/docs/builds";
251
233
  readonly 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.";
234
+ }, {
235
+ readonly slug: "runtimes";
236
+ readonly title: "Runtimes";
237
+ readonly kind: "guide";
238
+ readonly tier: "full";
239
+ readonly summary: "Run code on a space with Zero or Functions.";
240
+ readonly keywords: readonly ["runtime", "zero", "functions", "server", "dynamic", "code", "backend", "sf.jsonc"];
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. 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.";
243
+ }, {
244
+ readonly slug: "runtimes/zero";
245
+ readonly title: "Spacefast Zero";
246
+ readonly kind: "guide";
247
+ readonly tier: "full";
248
+ readonly summary: "A capsule with a database: schema, queries, mutations, endpoints.";
249
+ readonly keywords: readonly ["zero", "capsule", "database", "schema", "query", "mutation", "endpoint", "transaction", "sql", "sf dev"];
250
+ readonly url: "https://spacefast.com/docs/runtimes/zero";
251
+ readonly 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.";
252
+ }, {
253
+ readonly slug: "runtimes/functions";
254
+ readonly title: "Spacefast Functions";
255
+ readonly kind: "guide";
256
+ readonly tier: "full";
257
+ readonly summary: "A worker for your space: one `fetch` handler, any npm package.";
258
+ readonly keywords: readonly ["functions", "worker", "fetch", "ssr", "cloudflare", "npm", "handler", "server", "api"];
259
+ readonly url: "https://spacefast.com/docs/runtimes/functions";
260
+ readonly 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.";
252
261
  }, {
253
262
  readonly slug: "collab";
254
263
  readonly title: "Comments";
@@ -591,58 +600,4 @@ export declare const DOCS_CATALOG: readonly [{
591
600
  readonly keywords: readonly ["api", "platform", "tenant", "infra", "openapi", "multi-tenant"];
592
601
  readonly url: "https://spacefast.com/docs/platforms";
593
602
  readonly 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.";
594
- }, {
595
- readonly slug: "recipes/github-deploys";
596
- readonly title: "Publish from GitHub";
597
- readonly kind: "recipe";
598
- readonly tier: "full";
599
- readonly summary: "Connect a repository so pushes publish automatically.";
600
- readonly keywords: readonly ["github", "git", "ci", "push", "connect", "automatic", "recipe"];
601
- readonly url: "https://spacefast.com/docs/builds";
602
- readonly body: "Connect a repository with `sf git connect`; each push builds on Spacefast and publishes a version. Pull-request previews stay private until you create a scoped Link for reviewers.";
603
- }, {
604
- readonly slug: "recipes/preview-channels";
605
- readonly title: "Preview channels for pull requests";
606
- readonly kind: "recipe";
607
- readonly tier: "full";
608
- readonly summary: "Give every branch a private preview with explicit sharing.";
609
- readonly keywords: readonly ["preview", "channel", "branch", "pull request", "staging", "recipe"];
610
- readonly url: "https://spacefast.com/docs/builds";
611
- readonly body: "Push a branch or open a pull request on a connected repository, or publish to a named channel, to get an isolated private preview without touching production. Use Open for your own browser or create a scoped Link when someone else needs access.";
612
- }, {
613
- readonly slug: "recipes/agent-publish";
614
- readonly title: "Let an agent publish for you";
615
- readonly kind: "recipe";
616
- readonly tier: "full";
617
- readonly summary: "Drive a first publish from an AI agent, then claim it.";
618
- readonly keywords: readonly ["agent", "ai", "mcp", "anonymous", "claim", "automation", "recipe"];
619
- readonly url: "https://spacefast.com/docs/anonymous-publish";
620
- readonly 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`.";
621
- }, {
622
- readonly slug: "recipes/custom-domain";
623
- readonly title: "Add a custom domain";
624
- readonly kind: "recipe";
625
- readonly tier: "full";
626
- readonly summary: "Point your own domain at a space with automatic TLS.";
627
- readonly keywords: readonly ["domain", "custom domain", "dns", "tls", "https", "recipe"];
628
- readonly url: "https://spacefast.com/help/domains";
629
- readonly 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.";
630
- }, {
631
- readonly slug: "recipes/redirects";
632
- readonly title: "Set up redirects";
633
- readonly kind: "recipe";
634
- readonly tier: "reference";
635
- readonly summary: "Add redirect rules that ship and roll back with a version.";
636
- readonly keywords: readonly ["redirect", "rewrite", "routing", "301", "recipe"];
637
- readonly url: "https://spacefast.com/help/redirects";
638
- readonly 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.";
639
- }, {
640
- readonly slug: "recipes/migrate-dns";
641
- readonly title: "Migrate DNS to a custom domain";
642
- readonly kind: "recipe";
643
- readonly tier: "reference";
644
- readonly summary: "Cut traffic over to a Spacefast-served domain safely.";
645
- readonly keywords: readonly ["dns", "migrate", "cutover", "domain", "nameserver", "recipe"];
646
- readonly url: "https://spacefast.com/help/domains";
647
- readonly 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.";
648
603
  }, ...DocEntry[]];
@@ -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. */
@@ -99,7 +100,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
99
100
  title: "Publish receipt fields",
100
101
  kind: "workflow",
101
102
  tier: "full",
102
- summary: "Use the receipt as the source of truth: space.liveUrl, open.url, version.immutableUrl, 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.",
103
104
  keywords: ["receipt", "share", "claim", "diagnostics"],
104
105
  url: `${DOCS_BASE_URL}/api#publish`,
105
106
  body: "receipt liveUrl open url immutableUrl claim expiresAt diagnostics links finalize promote upload errors docsUrl",
@@ -118,7 +119,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
118
119
  "continuation",
119
120
  ],
120
121
  url: `${DOCS_BASE_URL}/agents#continue-after-claim`,
121
- 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",
122
123
  },
123
124
  {
124
125
  slug: "workflow/secret-handling",
@@ -150,35 +151,6 @@ const HAND_WRITTEN_DOCS_CATALOG = [
150
151
  url: `${DOCS_BASE_URL}/agents#mcp`,
151
152
  body: "MCP on-device local CLI stdio streamable HTTP sf mcp roots files workspace tool calls structuredContent apps",
152
153
  },
153
- {
154
- slug: "workflow/workspace-files",
155
- title: "Agent workspace files",
156
- kind: "workflow",
157
- tier: "full",
158
- summary: "Hosted MCP workspace tools edit, import, export, and publish a durable virtual workspace; On-Device MCP workspace tools edit the bounded local root.",
159
- keywords: [
160
- "workspace",
161
- "files",
162
- "patch",
163
- "diff",
164
- "virtual workspace",
165
- "workspace import",
166
- "workspace export",
167
- "just-bash",
168
- ],
169
- url: `${DOCS_BASE_URL}/agents#workspace-files`,
170
- 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",
171
- },
172
- {
173
- slug: "workflow/mcp-resources",
174
- title: "MCP resources for account, teams, spaces, and policy",
175
- kind: "workflow",
176
- tier: "full",
177
- 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.",
178
- keywords: ["resources", "account", "teams", "spaces", "policy", "context"],
179
- url: `${DOCS_BASE_URL}/agents#mcp-resources`,
180
- 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",
181
- },
182
154
  {
183
155
  slug: "workflow/space-files",
184
156
  title: "Space file conventions",
@@ -289,6 +261,57 @@ const HAND_WRITTEN_DOCS_CATALOG = [
289
261
  url: `${DOCS_BASE_URL}/builds`,
290
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.",
291
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.',
314
+ },
292
315
  {
293
316
  slug: "collab",
294
317
  title: "Comments",
@@ -671,68 +694,17 @@ const HAND_WRITTEN_DOCS_CATALOG = [
671
694
  url: `${DOCS_BASE_URL}/platforms`,
672
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.",
673
696
  },
674
- // ----- Recipes ----------------------------------------------------------
675
- {
676
- slug: "recipes/github-deploys",
677
- title: "Publish from GitHub",
678
- kind: "recipe",
679
- tier: "full",
680
- summary: "Connect a repository so pushes publish automatically.",
681
- keywords: ["github", "git", "ci", "push", "connect", "automatic", "recipe"],
682
- url: `${DOCS_BASE_URL}/builds`,
683
- body: "Connect a repository with `sf git connect`; each push builds on Spacefast and publishes a version. Pull-request previews stay private until you create a scoped Link for reviewers.",
684
- },
685
- {
686
- slug: "recipes/preview-channels",
687
- title: "Preview channels for pull requests",
688
- kind: "recipe",
689
- tier: "full",
690
- summary: "Give every branch a private preview with explicit sharing.",
691
- keywords: ["preview", "channel", "branch", "pull request", "staging", "recipe"],
692
- url: `${DOCS_BASE_URL}/builds`,
693
- body: "Push a branch or open a pull request on a connected repository, or publish to a named channel, to get an isolated private preview without touching production. Use Open for your own browser or create a scoped Link when someone else needs access.",
694
- },
695
- {
696
- slug: "recipes/agent-publish",
697
- title: "Let an agent publish for you",
698
- kind: "recipe",
699
- tier: "full",
700
- summary: "Drive a first publish from an AI agent, then claim it.",
701
- keywords: ["agent", "ai", "mcp", "anonymous", "claim", "automation", "recipe"],
702
- url: `${DOCS_BASE_URL}/anonymous-publish`,
703
- 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`.",
704
- },
705
- {
706
- slug: "recipes/custom-domain",
707
- title: "Add a custom domain",
708
- kind: "recipe",
709
- tier: "full",
710
- summary: "Point your own domain at a space with automatic TLS.",
711
- keywords: ["domain", "custom domain", "dns", "tls", "https", "recipe"],
712
- url: "https://spacefast.com/help/domains",
713
- 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.",
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
  ];