@spacefast/common 0.0.24 → 0.2.1

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 (320) 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.d.ts +6 -146
  7. package/dist/agents/connect-targets.js +63 -295
  8. package/dist/agents/private-key-oauth.d.ts +31 -2
  9. package/dist/agents/private-key-oauth.js +166 -92
  10. package/dist/agents/registry/core.d.ts +292 -0
  11. package/dist/agents/registry/core.js +1388 -0
  12. package/dist/agents/registry/deeplink-probes.d.ts +23 -0
  13. package/dist/agents/registry/deeplink-probes.js +18 -0
  14. package/dist/agents/registry/node.d.ts +56 -0
  15. package/dist/agents/registry/node.js +339 -0
  16. package/dist/brand-assets-build.js +3 -6
  17. package/dist/brand-assets.d.ts +5 -15
  18. package/dist/brand-assets.js +12 -14
  19. package/dist/brand.d.ts +17 -0
  20. package/dist/brand.js +24 -4
  21. package/dist/config/domains.d.ts +79 -12
  22. package/dist/config/domains.js +128 -29
  23. package/dist/config/index.js +1 -2
  24. package/dist/contracts/abuse.js +9 -24
  25. package/dist/contracts/access-profiles.d.ts +86 -0
  26. package/dist/contracts/access-profiles.js +89 -0
  27. package/dist/contracts/access.d.ts +24 -30
  28. package/dist/contracts/access.js +33 -64
  29. package/dist/contracts/activity.d.ts +18 -1
  30. package/dist/contracts/activity.js +72 -26
  31. package/dist/contracts/analytics.js +8 -10
  32. package/dist/contracts/api-keys.d.ts +77 -52
  33. package/dist/contracts/api-keys.js +44 -24
  34. package/dist/contracts/application-journal.d.ts +216 -0
  35. package/dist/contracts/application-journal.js +167 -0
  36. package/dist/contracts/auth.d.ts +90 -17
  37. package/dist/contracts/auth.js +86 -17
  38. package/dist/contracts/beta.d.ts +9 -4
  39. package/dist/contracts/beta.js +20 -16
  40. package/dist/contracts/billing.d.ts +2 -1
  41. package/dist/contracts/billing.js +37 -11
  42. package/dist/contracts/bootstrap.d.ts +791 -0
  43. package/dist/contracts/bootstrap.js +51 -0
  44. package/dist/contracts/builds.d.ts +209 -18
  45. package/dist/contracts/builds.js +93 -27
  46. package/dist/contracts/channels.d.ts +43 -0
  47. package/dist/contracts/channels.js +25 -9
  48. package/dist/contracts/cli.d.ts +7 -0
  49. package/dist/contracts/cli.js +6 -0
  50. package/dist/contracts/collab-public.d.ts +1 -1
  51. package/dist/contracts/collab-public.js +5 -8
  52. package/dist/contracts/comments.d.ts +44 -34
  53. package/dist/contracts/comments.js +107 -77
  54. package/dist/contracts/commerce.d.ts +165 -0
  55. package/dist/contracts/commerce.js +146 -0
  56. package/dist/contracts/common.d.ts +3 -3
  57. package/dist/contracts/common.js +20 -31
  58. package/dist/contracts/content-contract-verification.d.ts +521 -0
  59. package/dist/contracts/content-contract-verification.js +320 -0
  60. package/dist/contracts/content-platform-fixture.d.ts +1278 -0
  61. package/dist/contracts/content-platform-fixture.js +44 -0
  62. package/dist/contracts/content-program.d.ts +994 -0
  63. package/dist/contracts/content-program.js +658 -0
  64. package/dist/contracts/content-sync.d.ts +290 -0
  65. package/dist/contracts/content-sync.js +167 -0
  66. package/dist/contracts/content.d.ts +432 -0
  67. package/dist/contracts/content.js +303 -0
  68. package/dist/contracts/continuation.d.ts +17 -1
  69. package/dist/contracts/continuation.js +23 -23
  70. package/dist/contracts/countries.js +3 -4
  71. package/dist/contracts/crons.d.ts +52 -0
  72. package/dist/contracts/crons.js +60 -0
  73. package/dist/contracts/dashboard-prefs.d.ts +56 -0
  74. package/dist/contracts/dashboard-prefs.js +51 -0
  75. package/dist/contracts/device-auth.d.ts +234 -37
  76. package/dist/contracts/device-auth.js +267 -53
  77. package/dist/contracts/docs.d.ts +1 -5
  78. package/dist/contracts/docs.js +7 -15
  79. package/dist/contracts/domains.d.ts +501 -93
  80. package/dist/contracts/domains.js +193 -55
  81. package/dist/contracts/email-preferences.d.ts +3 -3
  82. package/dist/contracts/email-preferences.js +6 -7
  83. package/dist/contracts/enums.d.ts +27 -26
  84. package/dist/contracts/enums.js +68 -61
  85. package/dist/contracts/error-code-meta.d.ts +283 -7
  86. package/dist/contracts/error-code-meta.js +97 -5
  87. package/dist/contracts/error-codes.d.ts +5 -5
  88. package/dist/contracts/error-codes.js +82 -17
  89. package/dist/contracts/events.d.ts +100 -20
  90. package/dist/contracts/events.js +107 -20
  91. package/dist/contracts/execution.d.ts +48 -64
  92. package/dist/contracts/execution.js +52 -62
  93. package/dist/contracts/feature-lifecycle.d.ts +73 -27
  94. package/dist/contracts/feature-lifecycle.js +86 -26
  95. package/dist/contracts/features.d.ts +68 -19
  96. package/dist/contracts/features.js +42 -41
  97. package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
  98. package/dist/contracts/frame-session.d.ts +192 -0
  99. package/dist/contracts/frame-session.js +164 -0
  100. package/dist/contracts/functions.d.ts +338 -164
  101. package/dist/contracts/functions.js +367 -198
  102. package/dist/contracts/git.d.ts +27 -33
  103. package/dist/contracts/git.js +10 -11
  104. package/dist/contracts/grant-copy.d.ts +43 -0
  105. package/dist/contracts/grant-copy.js +44 -0
  106. package/dist/contracts/grants.d.ts +62 -54
  107. package/dist/contracts/grants.js +124 -23
  108. package/dist/contracts/ids.d.ts +4 -1
  109. package/dist/contracts/ids.js +6 -3
  110. package/dist/contracts/internal.d.ts +8 -18
  111. package/dist/contracts/internal.js +13 -14
  112. package/dist/contracts/mcp.d.ts +28 -0
  113. package/dist/contracts/mcp.js +28 -0
  114. package/dist/contracts/me.d.ts +6 -1
  115. package/dist/contracts/me.js +12 -6
  116. package/dist/contracts/notifications.d.ts +27 -29
  117. package/dist/contracts/notifications.js +9 -4
  118. package/dist/contracts/oauth-resources.d.ts +112 -10
  119. package/dist/contracts/oauth-resources.js +116 -11
  120. package/dist/contracts/oauth-scope-actions.d.ts +90 -0
  121. package/dist/contracts/oauth-scope-actions.js +126 -0
  122. package/dist/contracts/operations.d.ts +27 -4
  123. package/dist/contracts/operations.js +12 -6
  124. package/dist/contracts/pages.d.ts +31 -7
  125. package/dist/contracts/pages.js +22 -5
  126. package/dist/contracts/partner-notifications.d.ts +3 -0
  127. package/dist/contracts/partner-notifications.js +65 -0
  128. package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
  129. package/dist/contracts/{platform.js → partner.js} +27 -40
  130. package/dist/contracts/plan-policy.js +1 -1
  131. package/dist/contracts/principal-assertion.d.ts +43 -0
  132. package/dist/contracts/principal-assertion.js +67 -0
  133. package/dist/contracts/principals.d.ts +73 -0
  134. package/dist/contracts/principals.js +59 -0
  135. package/dist/contracts/privacy.d.ts +11 -0
  136. package/dist/contracts/privacy.js +17 -0
  137. package/dist/contracts/problem-document.js +3 -4
  138. package/dist/contracts/publish-archive.d.ts +269 -161
  139. package/dist/contracts/publish-archive.js +11 -1
  140. package/dist/contracts/push-new.d.ts +8 -8
  141. package/dist/contracts/quotas.js +5 -5
  142. package/dist/contracts/realtime.d.ts +52 -0
  143. package/dist/contracts/realtime.js +54 -0
  144. package/dist/contracts/repository-connections.d.ts +44 -31
  145. package/dist/contracts/repository-connections.js +17 -5
  146. package/dist/contracts/resources.d.ts +105 -14
  147. package/dist/contracts/resources.js +150 -26
  148. package/dist/contracts/route-inventory.d.ts +358 -0
  149. package/dist/contracts/route-inventory.js +141 -0
  150. package/dist/contracts/runtime-api.d.ts +206 -82
  151. package/dist/contracts/runtime-api.js +131 -70
  152. package/dist/contracts/runtime-app.d.ts +13 -23
  153. package/dist/contracts/runtime-app.js +39 -24
  154. package/dist/contracts/runtime-components.d.ts +143 -0
  155. package/dist/contracts/runtime-components.js +199 -0
  156. package/dist/contracts/runtime-db.d.ts +49 -23
  157. package/dist/contracts/runtime-db.js +87 -22
  158. package/dist/contracts/runtime-purge.d.ts +8 -0
  159. package/dist/contracts/runtime-purge.js +5 -0
  160. package/dist/contracts/runtime-services.d.ts +43 -75
  161. package/dist/contracts/runtime-services.js +29 -49
  162. package/dist/contracts/runtime-storage.d.ts +15 -14
  163. package/dist/contracts/runtime-storage.js +30 -14
  164. package/dist/contracts/sf-config-v1.d.ts +48 -14
  165. package/dist/contracts/slugs.js +13 -4
  166. package/dist/contracts/space-config.d.ts +283 -19
  167. package/dist/contracts/space-config.js +430 -80
  168. package/dist/contracts/spaces.d.ts +376 -290
  169. package/dist/contracts/spaces.js +200 -135
  170. package/dist/contracts/superadmin-activity.d.ts +3 -43
  171. package/dist/contracts/superadmin-activity.js +6 -30
  172. package/dist/contracts/superadmin-emails.d.ts +1 -0
  173. package/dist/contracts/superadmin-emails.js +17 -1
  174. package/dist/contracts/superadmin-runtime.d.ts +199 -0
  175. package/dist/contracts/superadmin-runtime.js +141 -0
  176. package/dist/contracts/superadmin-search.d.ts +22 -2
  177. package/dist/contracts/superadmin-search.js +14 -6
  178. package/dist/contracts/superadmin-spaces.d.ts +438 -189
  179. package/dist/contracts/superadmin-spaces.js +131 -25
  180. package/dist/contracts/superadmin-teams.d.ts +5 -2
  181. package/dist/contracts/superadmin-teams.js +1 -2
  182. package/dist/contracts/superadmin-tenants.d.ts +627 -12
  183. package/dist/contracts/superadmin-tenants.js +32 -13
  184. package/dist/contracts/superadmin.d.ts +232 -37
  185. package/dist/contracts/superadmin.js +106 -22
  186. package/dist/contracts/tags.d.ts +85 -58
  187. package/dist/contracts/tags.js +47 -37
  188. package/dist/contracts/teams.d.ts +86 -26
  189. package/dist/contracts/teams.js +90 -31
  190. package/dist/contracts/tenants.d.ts +135 -0
  191. package/dist/contracts/tenants.js +120 -0
  192. package/dist/contracts/test-triggers.d.ts +70 -0
  193. package/dist/contracts/test-triggers.js +116 -0
  194. package/dist/contracts/theme-json.js +3 -8
  195. package/dist/contracts/transfers.d.ts +1 -0
  196. package/dist/contracts/transfers.js +3 -2
  197. package/dist/contracts/usage.d.ts +209 -0
  198. package/dist/contracts/usage.js +124 -12
  199. package/dist/contracts/variables.d.ts +2 -2
  200. package/dist/contracts/variables.js +9 -13
  201. package/dist/contracts/webhooks.d.ts +13 -5
  202. package/dist/contracts/webhooks.js +3 -1
  203. package/dist/contracts/zero.d.ts +72 -81
  204. package/dist/contracts/zero.js +80 -78
  205. package/dist/dashboard-paths/index.d.ts +24 -21
  206. package/dist/dashboard-paths/index.js +35 -47
  207. package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
  208. package/dist/dashboard-paths/route-reservations.generated.js +36 -0
  209. package/dist/docs/agent-arrival.d.ts +92 -0
  210. package/dist/docs/agent-arrival.js +227 -0
  211. package/dist/docs/agent-output-policy.d.ts +6 -0
  212. package/dist/docs/agent-output-policy.js +22 -0
  213. package/dist/docs/agent-prose.d.ts +12 -18
  214. package/dist/docs/agent-prose.js +73 -51
  215. package/dist/docs/agent-setup.d.ts +72 -41
  216. package/dist/docs/agent-setup.js +339 -436
  217. package/dist/docs/catalog.d.ts +153 -95
  218. package/dist/docs/catalog.js +163 -48
  219. package/dist/docs/error-docs.d.ts +2098 -1
  220. package/dist/docs/error-docs.js +421 -144
  221. package/dist/docs/index-build.d.ts +0 -1
  222. package/dist/docs/index-build.js +2 -3
  223. package/dist/docs/page-context-prompt.d.ts +77 -0
  224. package/dist/docs/page-context-prompt.js +131 -0
  225. package/dist/docs/reference-urls.d.ts +46 -0
  226. package/dist/docs/reference-urls.js +79 -0
  227. package/dist/docs/search.d.ts +6 -8
  228. package/dist/docs/search.js +10 -13
  229. package/dist/docs/skill-distribution.d.ts +4 -1
  230. package/dist/docs/skill-distribution.js +10 -5
  231. package/dist/docs/skills.d.ts +120 -120
  232. package/dist/docs/skills.js +121 -73
  233. package/dist/docs/start-prompts.d.ts +45 -0
  234. package/dist/docs/start-prompts.js +62 -0
  235. package/dist/domain-exploration.js +9 -13
  236. package/dist/og-template.d.ts +56 -0
  237. package/dist/og-template.js +56 -0
  238. package/dist/slug-policy/index.js +5 -11
  239. package/dist/test-helpers/fetch-stub.js +1 -0
  240. package/dist/utils/browser-credential.d.ts +13 -6
  241. package/dist/utils/browser-credential.js +14 -7
  242. package/dist/utils/build-settings.d.ts +21 -1
  243. package/dist/utils/build-settings.js +133 -15
  244. package/dist/utils/canonical-json.d.ts +3 -5
  245. package/dist/utils/canonical-json.js +4 -5
  246. package/dist/utils/cast-transport.d.ts +5 -17
  247. package/dist/utils/cast-transport.js +6 -19
  248. package/dist/utils/claim-token.js +1 -2
  249. package/dist/utils/comment-avatars.js +4 -6
  250. package/dist/utils/concurrency.js +3 -3
  251. package/dist/utils/content-type.d.ts +7 -6
  252. package/dist/utils/content-type.js +73 -51
  253. package/dist/utils/credential-policy.d.ts +50 -6
  254. package/dist/utils/credential-policy.js +126 -59
  255. package/dist/utils/dns-instructions.js +9 -9
  256. package/dist/utils/egress-policy.fixtures.json +1 -1
  257. package/dist/utils/error-code.js +1 -0
  258. package/dist/utils/generate-space-name.d.ts +3 -8
  259. package/dist/utils/generate-space-name.js +3 -8
  260. package/dist/utils/grant-decision.fixtures.json +2 -2
  261. package/dist/utils/grants.d.ts +0 -1
  262. package/dist/utils/grants.js +7 -8
  263. package/dist/utils/gravatar.d.ts +2 -4
  264. package/dist/utils/gravatar.js +6 -12
  265. package/dist/utils/id-hints.js +14 -23
  266. package/dist/utils/idempotency.d.ts +3 -3
  267. package/dist/utils/idempotency.js +6 -7
  268. package/dist/utils/local-space-state.d.ts +23 -26
  269. package/dist/utils/local-space-state.js +46 -46
  270. package/dist/utils/oauth-signed-query.d.ts +3 -5
  271. package/dist/utils/oauth-signed-query.js +6 -9
  272. package/dist/utils/one-shot-replay.d.ts +7 -6
  273. package/dist/utils/one-shot-replay.js +3 -5
  274. package/dist/utils/page-colors.d.ts +15 -19
  275. package/dist/utils/page-colors.js +23 -45
  276. package/dist/utils/page-fonts.d.ts +1 -1
  277. package/dist/utils/page-fonts.js +8 -20
  278. package/dist/utils/page-preview.d.ts +0 -1
  279. package/dist/utils/page-preview.js +0 -1
  280. package/dist/utils/pages.d.ts +33 -3
  281. package/dist/utils/pages.js +83 -30
  282. package/dist/utils/privacy-regions.d.ts +19 -0
  283. package/dist/utils/privacy-regions.js +91 -0
  284. package/dist/utils/publish-form-data.d.ts +4 -5
  285. package/dist/utils/publish-form-data.js +2 -3
  286. package/dist/utils/publish-policy.d.ts +11 -17
  287. package/dist/utils/publish-policy.fixtures.json +11 -5
  288. package/dist/utils/publish-policy.js +65 -110
  289. package/dist/utils/query-client.d.ts +2 -0
  290. package/dist/utils/query-client.js +10 -1
  291. package/dist/utils/runtime-paths.d.ts +4 -4
  292. package/dist/utils/runtime-paths.js +6 -8
  293. package/dist/utils/runtime-upload.d.ts +9 -0
  294. package/dist/utils/runtime-upload.js +12 -0
  295. package/dist/utils/secure-local-file.d.ts +3 -3
  296. package/dist/utils/secure-local-file.js +23 -40
  297. package/dist/utils/space-config.d.ts +12 -15
  298. package/dist/utils/space-config.js +13 -16
  299. package/dist/utils/static-runtime-policy.d.ts +10 -7
  300. package/dist/utils/static-runtime-policy.fixtures.json +38 -41
  301. package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
  302. package/dist/utils/static-runtime-policy.generated.js +70 -0
  303. package/dist/utils/static-runtime-policy.js +31 -132
  304. package/dist/utils/storage-policy.js +1 -2
  305. package/dist/utils/upload-session.d.ts +4 -1
  306. package/dist/utils/upload-session.js +41 -19
  307. package/dist/utils/version-path.js +11 -19
  308. package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
  309. package/dist/utils/wpcom-auth-redirects.js +1 -4
  310. package/dist/vocabulary.d.ts +13 -13
  311. package/dist/vocabulary.js +52 -27
  312. package/package.json +15 -18
  313. package/dist/agents/client-registry.d.ts +0 -22
  314. package/dist/agents/client-registry.js +0 -41
  315. package/dist/docs/agent-handoff-document.d.ts +0 -15
  316. package/dist/docs/agent-handoff-document.js +0 -180
  317. package/dist/docs/agent-solutions.d.ts +0 -110
  318. package/dist/docs/agent-solutions.js +0 -183
  319. package/dist/utils/query-keys.d.ts +0 -84
  320. package/dist/utils/query-keys.js +0 -108
@@ -1,27 +1,30 @@
1
- // Canonical, single-sourced documentation catalog. This hand-curated product
2
- // content (guides + API reference + CLI + recipes) is the ONE source of truth
3
- // shared by two surfaces so they can never drift:
1
+ // Canonical, single-sourced documentation catalog (guides, API reference, CLI,
2
+ // recipes), consumed by two surfaces so they cannot drift:
4
3
  // - the CLI's offline `sf docs` index (packages/cli re-exports this module and
5
4
  // derives the bundled `docs-index.generated.json` from it), and
6
- // - the control-plane's machine-readable `GET /v1/docs` API, which builds the
7
- // same index in memory at startup.
5
+ // - the control-plane's `GET /v1/docs`, which builds the same index in memory.
8
6
  //
9
- // Entries are tier-tagged from the SAME disclosure tiers the CLI help uses
10
- // (vocabulary.ts), so listings are ESSENTIAL by default and widen to FULL /
11
- // REFERENCE. Vocabulary rules apply: say "space", "publish", "version",
12
- // "channel", "API key", "infra" — never "deployment"/"project"/"site"/"E2B".
7
+ // Entries are tier-tagged from the disclosure tiers in vocabulary.ts, so
8
+ // listings are ESSENTIAL by default. Vocabulary rules apply: say "space",
9
+ // "publish", "version", "channel", "API key", "infra", never
10
+ // "deployment"/"project"/"site"/"E2B".
13
11
  //
14
- // The "error" kind entries below are GENERATED from ERROR_DOCS (error-docs.ts),
15
- // not hand-written one catalog entry per ERROR_CODES member, reference tier
16
- // so every error code is searchable from `sf docs <code>`, `GET /v1/docs?q=`,
17
- // and MCP search without a second hand-maintained corpus to drift.
12
+ // The "error" entries are GENERATED from ERROR_DOCS (error-docs.ts), one per
13
+ // ERROR_CODES member at the reference tier, so every code is searchable without
14
+ // a second hand-maintained corpus.
15
+ import { DEFAULT_API_URL, DOCS_BASE_URL } from "../config/domains.js";
18
16
  import { errorDocsUrl } from "../contracts/error-codes.js";
19
17
  import { ERROR_DOCS } from "./error-docs.js";
18
+ import { PARTNER_API_REFERENCE_URL } from "./reference-urls.js";
20
19
  import { renderSpacefastSkill, SPACEFAST_RECIPE_SKILLS } from "./skills.js";
21
20
  /** Which part of the docs a page belongs to (runtime list + derived type). */
22
21
  export const DOC_KINDS = ["guide", "cli", "api", "recipe", "workflow", "error"];
23
- /** Base URL all bundled docs links resolve against. */
24
- export const DOCS_BASE_URL = "https://spacefast.com/docs";
22
+ /**
23
+ * Base URL all bundled docs links resolve against. Owned by the domain registry
24
+ * (`../config/domains.ts`) and re-exported here, where every docs caller
25
+ * already looks for it.
26
+ */
27
+ export { DOCS_BASE_URL };
25
28
  const HAND_WRITTEN_DOCS_CATALOG = [
26
29
  // ----- Guides -----------------------------------------------------------
27
30
  {
@@ -40,8 +43,8 @@ const HAND_WRITTEN_DOCS_CATALOG = [
40
43
  kind: "guide",
41
44
  tier: "essential",
42
45
  summary: "How `sf publish` builds, uploads, and goes live.",
43
- keywords: ["publish", "go live", "upload", "release", "static"],
44
- url: `${DOCS_BASE_URL}/publishing`,
46
+ keywords: ["publish", "go live", "upload", "release", "artifact"],
47
+ url: `${DOCS_BASE_URL}/publish`,
45
48
  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
49
  },
47
50
  {
@@ -51,7 +54,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
51
54
  tier: "full",
52
55
  summary: "Change a space slug and its managed view.fast address without breaking old links.",
53
56
  keywords: ["space", "rename", "slug", "view.fast", "redirect", "managed hostname"],
54
- url: `${DOCS_BASE_URL}/spaces/rename`,
57
+ url: `${DOCS_BASE_URL}/operate/spaces`,
55
58
  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
59
  },
57
60
  {
@@ -93,17 +96,17 @@ const HAND_WRITTEN_DOCS_CATALOG = [
93
96
  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
97
  keywords: ["publish", "curl", "anonymous", "no install", "claim"],
95
98
  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",
99
+ body: "curl publish file folder archive zip anonymous no account no install live URL immutable version claim link /v1/publish",
97
100
  },
98
101
  {
99
102
  slug: "workflow/publish-receipt",
100
103
  title: "Publish receipt fields",
101
104
  kind: "workflow",
102
105
  tier: "full",
103
- summary: "Use the receipt as the source of truth. For anonymous publishes, claim.url is the private-site door and claim.claimUrl is the browser claim link; liveUrl and immutableUrl identify resources for automation.",
106
+ summary: "Use the receipt as the source of truth. For anonymous publishes, claim.url is the private-site door and claim.claimUrl is the browser claim link; space.liveUrl and version.immutableUrl identify resources for automation.",
104
107
  keywords: ["receipt", "share", "claim", "diagnostics"],
105
108
  url: `${DOCS_BASE_URL}/api#publish`,
106
- body: "receipt liveUrl open url immutableUrl claim expiresAt diagnostics links finalize promote upload errors docsUrl",
109
+ body: "receipt space.liveUrl open url version.immutableUrl claim expiresAt diagnostics links finalize promote upload errors docsUrl",
107
110
  },
108
111
  {
109
112
  slug: "workflow/continue-after-claim",
@@ -146,20 +149,20 @@ const HAND_WRITTEN_DOCS_CATALOG = [
146
149
  title: "On-Device MCP through the CLI",
147
150
  kind: "workflow",
148
151
  tier: "full",
149
- summary: "Run sf mcp for stdio or sf mcp http --host 127.0.0.1 --port 3945 --path /mcp for On-Device Streamable HTTP.",
150
- keywords: ["mcp", "stdio", "streamable http", "on-device", "local"],
152
+ summary: "Run sf mcp for the stdio On-Device MCP server in the local checkout.",
153
+ keywords: ["mcp", "stdio", "on-device", "local"],
151
154
  url: `${DOCS_BASE_URL}/agents#mcp`,
152
- body: "MCP on-device local CLI stdio streamable HTTP sf mcp roots files workspace tool calls structuredContent apps",
155
+ body: "MCP on-device local CLI stdio sf mcp roots files workspace tool calls structuredContent apps",
153
156
  },
154
157
  {
155
158
  slug: "workflow/space-files",
156
159
  title: "Space file conventions",
157
160
  kind: "workflow",
158
161
  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.",
162
+ summary: "Spacefast recognizes _redirects, _headers, nearest 404.html, and sf.jsonc. Published artifacts are served as files; server code is not executed.",
160
163
  keywords: ["_redirects", "_headers", "sf.jsonc", "spacefast.jsonc", "404"],
161
164
  url: `${DOCS_BASE_URL}/configuration`,
162
- body: "_redirects _headers 404.html sf.jsonc static artifact server code not executed proxy rewrite headers",
165
+ body: "_redirects _headers 404.html sf.jsonc artifact server code not executed proxy rewrite headers",
163
166
  },
164
167
  {
165
168
  slug: "workflow/domains-diagnostics",
@@ -183,13 +186,13 @@ const HAND_WRITTEN_DOCS_CATALOG = [
183
186
  },
184
187
  {
185
188
  slug: "workflow/agent-auth",
186
- title: "Agent accounts and OAuth",
189
+ title: "Machine OAuth clients",
187
190
  kind: "workflow",
188
191
  tier: "full",
189
- summary: "Prefer OAuth agent accounts with private_key_jwt and SPACEFAST_AGENT_CONFIG for On-Device MCP and automation instead of broad shared API keys.",
190
- keywords: ["oauth", "agent account", "private_key_jwt", "SPACEFAST_AGENT_CONFIG"],
192
+ summary: "Use team-owned OAuth clients with private_key_jwt and SPACEFAST_AGENT_CONFIG for On-Device MCP and automation. Do not use broad shared API keys.",
193
+ keywords: ["oauth", "client credentials", "private_key_jwt", "SPACEFAST_AGENT_CONFIG"],
191
194
  url: `${DOCS_BASE_URL}/agents#agent-accounts`,
192
- body: "OAuth agent account private_key_jwt SPACEFAST_AGENT_CONFIG client credentials scoped token mcp automation teams",
195
+ body: "OAuth client private_key_jwt SPACEFAST_AGENT_CONFIG client credentials scoped token mcp automation teams",
193
196
  },
194
197
  {
195
198
  slug: "custom-domains",
@@ -269,7 +272,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
269
272
  summary: "Run code on a space with Zero or Functions.",
270
273
  keywords: ["runtime", "zero", "functions", "server", "dynamic", "code", "backend", "sf.jsonc"],
271
274
  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`.",
275
+ 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
276
  },
274
277
  {
275
278
  slug: "runtimes/zero",
@@ -289,7 +292,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
289
292
  "sql",
290
293
  "sf dev",
291
294
  ],
292
- url: `${DOCS_BASE_URL}/runtimes/zero`,
295
+ url: `${DOCS_BASE_URL}/zero-runtime`,
293
296
  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 and dedicated runtime site on every plan.",
294
297
  },
295
298
  {
@@ -340,7 +343,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
340
343
  summary: "Proxy selected paths to an upstream origin.",
341
344
  keywords: ["proxy", "upstream", "route", "api", "backend", "rewrite"],
342
345
  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.",
346
+ body: "Forward specific path prefixes to an external upstream so a space can front an external API without exposing its origin.",
344
347
  },
345
348
  {
346
349
  slug: "image-acceleration",
@@ -371,7 +374,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
371
374
  "revalidatePath",
372
375
  ],
373
376
  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.",
377
+ body: 'Run `sf publish` in a Next.js project. Spacefast reads the resolved build mode from Next itself: `output: "export"` ships the generated browser files directly, while server-rendered apps are bundled with pinned OpenNext and publish their browser assets plus a 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
378
  },
376
379
  {
377
380
  slug: "integrations/vite",
@@ -390,7 +393,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
390
393
  tier: "reference",
391
394
  summary: "File counts, sizes, and rate limits per plan.",
392
395
  keywords: ["limits", "quota", "size", "rate limit", "plan", "storage"],
393
- url: `${DOCS_BASE_URL}/limits`,
396
+ url: `${DOCS_BASE_URL}/account/plans`,
394
397
  body: "Reference for per-space file counts, archive and file size ceilings, and rate limits, which vary by plan.",
395
398
  },
396
399
  {
@@ -559,7 +562,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
559
562
  title: "sf api-keys",
560
563
  kind: "cli",
561
564
  tier: "full",
562
- summary: "Create and revoke API keys for the platform API.",
565
+ summary: "Create and revoke API keys for the Spacefast API.",
563
566
  keywords: ["api-keys", "api key", "token", "create", "revoke", "list", "credential"],
564
567
  url: `${DOCS_BASE_URL}/cli`,
565
568
  body: "`sf api-keys create` mints a bearer key (shown once, masked in `--json`); `sf api-keys list` and `sf api-keys revoke` manage existing keys.",
@@ -617,13 +620,13 @@ const HAND_WRITTEN_DOCS_CATALOG = [
617
620
  // ----- API reference ----------------------------------------------------
618
621
  {
619
622
  slug: "api",
620
- title: "Platform API overview",
623
+ title: "API overview",
621
624
  kind: "api",
622
625
  tier: "full",
623
- summary: "Authenticate and call the Spacefast platform API.",
624
- keywords: ["api", "rest", "http", "platform", "endpoint", "openapi", "bearer"],
626
+ summary: "Authenticate and call the Spacefast API.",
627
+ keywords: ["api", "rest", "http", "spacefast", "endpoint", "openapi", "bearer"],
625
628
  url: `${DOCS_BASE_URL}/api`,
626
- body: "The platform API uses bearer API keys and returns the same `{ data }` / `{ error }` envelope as the CLI. Create a key with `sf api-keys create`.",
629
+ body: "The Spacefast API uses bearer API keys and returns the same `{ data }` / `{ error }` envelope as the CLI. Create a key with `sf api-keys create`.",
627
630
  },
628
631
  {
629
632
  slug: "api/publish",
@@ -663,7 +666,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
663
666
  summary: "Attach and inspect custom domains over HTTP.",
664
667
  keywords: ["api", "domains", "domain", "dns", "certificate", "endpoint"],
665
668
  url: `${DOCS_BASE_URL}/api`,
666
- body: "Add a custom domain, read its verification and certificate status, and manage DNS records through the platform API.",
669
+ body: "Add a custom domain, read its verification and certificate status, and manage DNS records through the Spacefast API.",
667
670
  },
668
671
  {
669
672
  slug: "api/teams",
@@ -683,7 +686,7 @@ const HAND_WRITTEN_DOCS_CATALOG = [
683
686
  summary: "Fetch the machine-readable documentation index.",
684
687
  keywords: ["api", "docs", "index", "discovery", "machine-readable", "v1/docs"],
685
688
  url: `${DOCS_BASE_URL}/api`,
686
- body: "`GET /v1/docs` returns the tier-aware docs index (filter with `q` and `category`); `GET /v1/docs/{slug}` returns one page. It mirrors the CLI's offline `sf docs`.",
689
+ body: "`GET /v1/docs` returns the tier-aware docs index (filter with `q` and `category`); `GET /v1/docs/pages/{slug}` returns one page. It mirrors the CLI's offline `sf docs`.",
687
690
  },
688
691
  {
689
692
  slug: "api/webhooks",
@@ -696,14 +699,126 @@ const HAND_WRITTEN_DOCS_CATALOG = [
696
699
  body: "Register a team-scoped, signed webhook to receive version, build, domain, and transfer events. Verify the signature header before trusting a payload.",
697
700
  },
698
701
  {
699
- slug: "api/platform",
700
- title: "Platform (tenant) API",
702
+ slug: "sdk",
703
+ title: "TypeScript SDK (@spacefast/sdk)",
704
+ kind: "api",
705
+ tier: "essential",
706
+ summary: "The typed client for the API, generated from the OpenAPI spec.",
707
+ keywords: [
708
+ "sdk",
709
+ "typescript",
710
+ "javascript",
711
+ "client",
712
+ "npm",
713
+ "library",
714
+ "types",
715
+ "tanstack",
716
+ "react-query",
717
+ "node",
718
+ ],
719
+ url: `${DOCS_BASE_URL}/sdk`,
720
+ body: "`npm install @spacefast/sdk`, then `createSpacefastClient({ baseUrl: 'https://api.spacefast.com', apiKey })`. Paths, parameters, and responses are all typed from the same OpenAPI spec the API serves: `client.get('/v1/spaces/{spaceId}', { path: { spaceId } })` returns the space. Failures throw `SpacefastApiError` carrying the problem document (`status`, `code`, `pointer`, `next`, `requestId`). Subpaths: `/schema` for raw types, `/query` for TanStack Query factories (browser, cookie-authenticated), `/transport` for the HTTP core, `/publish` for the publish pipeline, `/openapi.json` for your own codegen.",
721
+ },
722
+ // ----- Partner surface --------------------------------------------------
723
+ {
724
+ slug: "api/partner",
725
+ title: "Partner (tenant) API",
726
+ kind: "api",
727
+ tier: "reference",
728
+ summary: "The tenant-facing partner API for running Spacefast as infra.",
729
+ keywords: ["api", "partner", "tenant", "infra", "openapi", "multi-tenant", "white label"],
730
+ url: `${DOCS_BASE_URL}/partners`,
731
+ body: `There is no partner route tree. Partners call the same \`/v1\` routes as everyone else: successes carry a \`{ data }\` envelope and failures are RFC 9457 problem documents (\`application/problem+json\` with a stable \`code\`), exactly as elsewhere in the API. A tenant-rooted credential's policy scope and response projection decide what it sees. "Partner" is a spec visibility tier: those operations, plus tenants and principals, are published as a second OpenAPI document at ${DEFAULT_API_URL}/openapi.partner.json, rendered at ${PARTNER_API_REFERENCE_URL}. Point \`openapi-typescript\` at that document for types. Configuration is not a set of endpoints: a tenant declares its integration in one designated space's published manifest (see \`partner/system-space\`).`,
732
+ },
733
+ {
734
+ slug: "partner/onboarding",
735
+ title: "Partner onboarding",
701
736
  kind: "api",
702
737
  tier: "reference",
703
- summary: "The tenant-facing platform API for running Spacefast as infra.",
704
- keywords: ["api", "platform", "tenant", "infra", "openapi", "multi-tenant"],
705
- url: `${DOCS_BASE_URL}/platforms`,
706
- 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.",
738
+ summary: "Bootstrap a tenant: one key, one space, one designation, one publish.",
739
+ keywords: ["partner", "onboarding", "tenant", "bootstrap", "partner_admin", "api key", "setup"],
740
+ url: `${DOCS_BASE_URL}/partners#onboarding`,
741
+ body: "Tenant creation is superadmin-side and mints one bootstrap tenant-rooted API key with the `partner_admin` preset (`tenants:*`, `principals:read`, and space/domain/publish actions over the tenant). From there it is four steps you drive yourself: create a space with that key, `PATCH /v1/tenants/{tenantId}` with `systemSpaceId` to designate it, publish the manifest, then read `manifestStatus` on `GET /v1/tenants/{tenantId}` to watch each declared item converge. Mint further keys through the normal API-key routes — every one is bounded to a subset of its grantor's policy.",
742
+ },
743
+ {
744
+ slug: "partner/system-space",
745
+ title: "The system space",
746
+ kind: "api",
747
+ tier: "reference",
748
+ summary: "Your integration is a published space, so config versions and rolls back.",
749
+ keywords: [
750
+ "partner",
751
+ "system space",
752
+ "manifest",
753
+ "sf.jsonc",
754
+ "systemSpaceId",
755
+ "manifestStatus",
756
+ "gitops",
757
+ "reconciliation",
758
+ "white label",
759
+ ],
760
+ url: `${DOCS_BASE_URL}/partners#system-space`,
761
+ body: "A tenant designates one ordinary space as its system space, and that space's live version *is* the integration definition: a top-level `system` section in `sf.jsonc` (presentation, hostname apex, API origin, token issuers, event subscriptions) plus `_pages/` and `theme.json` as the defaults layer. One config language, one validation pipeline, one publish flow — and `sf rollback` rolls back your configuration with it. Finalize, promote, and rollback all reconcile declared state against current state. Presentation, pages, theme, and subscriptions apply immediately; hostnames, API origins, and token issuers enter `pending` until their DNS, TLS, or key-possession check passes. Dropping an item from the manifest deactivates it. Per-item state lands in `manifestStatus` (`{ key, state, detail, since }` plus the source version id) on `GET /v1/tenants/{tenantId}`. There are no imperative config routes: the fix for a failed item is a new publish. Secrets are never declared — webhook secrets and API keys are minted by their own routes.",
762
+ },
763
+ {
764
+ slug: "partner/tokens",
765
+ title: "Partner tokens",
766
+ kind: "api",
767
+ tier: "reference",
768
+ summary: "Let your own auth system mint tokens Spacefast verifies directly.",
769
+ keywords: [
770
+ "partner",
771
+ "token",
772
+ "jwt",
773
+ "issuer",
774
+ "eddsa",
775
+ "ed25519",
776
+ "auth",
777
+ "partner_token",
778
+ "audience",
779
+ "revocation",
780
+ ],
781
+ url: `${DOCS_BASE_URL}/partners#tokens`,
782
+ body: "Your customers never need a Spacefast credential: your auth system mints standard JWT access tokens and Spacefast verifies them. Declare the issuer in the system-space manifest with its pinned Ed25519 public keys — there is no issuer CRUD. The first publish returns `state: pending` with a challenge nonce in `manifestStatus`; sign it with the declared key and republish with the `proof` field, and the issuer activates. Proof of key possession lives in your repo next to the declaration. The token profile is strict: `typ` of `at+jwt`, `alg` of `EdDSA` only, the per-issuer minted `aud` (never a shared value), all of `iss`/`sub`/`client_id`/`jti`/`iat`/`exp` required, `exp - iat` at most 30 minutes, 300s clock skew; embedded or fetched keys are rejected. A verified token becomes a `partner_token` credential bound to one external principal, carrying a fixed least-privilege policy: publish, read, versions, and variables over that principal's subtree — never tenant or principal management. Revoke by removing the issuer or rotating its keys; worst-case acceptance of a revoked token is the shorter of a 30s cache TTL and the token's own expiry.",
783
+ },
784
+ {
785
+ slug: "partner/principals",
786
+ title: "Principals and ownership",
787
+ kind: "api",
788
+ tier: "reference",
789
+ summary: "External principals are your customer directory; spaces have exactly one owner.",
790
+ keywords: [
791
+ "partner",
792
+ "principals",
793
+ "external",
794
+ "tenant",
795
+ "ownership",
796
+ "iam",
797
+ "policy",
798
+ "scope",
799
+ "variables",
800
+ ],
801
+ url: `${DOCS_BASE_URL}/partners#principals`,
802
+ body: "Your customers are external principals inside your tenant. `GET /v1/principals` lists them within the caller's granted scope (a tenant-rooted key sees the whole tenant) and `GET /v1/principals/external/{principalId}` reads one. There is no create route: a principal is upserted implicitly in the same transaction as its first owned resource, and its identity is the normalized id — the display casing you first sent is preserved but never authoritative. Every space has exactly one owner: a team, an external principal, or an open claim token. IAM actions stay generic nouns (`tenants:read`, `tenants:write`, `principals:read`) rather than a `partner:*` namespace, evaluated per route like every other action, so a partner credential's reach is a policy fact and not a router branch. Per-principal environment variables live under `/v1/principals/{principalType}/{principalId}/variables`.",
803
+ },
804
+ {
805
+ slug: "partner/events",
806
+ title: "Partner events and notifications",
807
+ kind: "api",
808
+ tier: "reference",
809
+ summary: "Tenant-owned webhooks, declared in the manifest — including customer email.",
810
+ keywords: [
811
+ "partner",
812
+ "events",
813
+ "webhook",
814
+ "subscriptions",
815
+ "notifications",
816
+ "email",
817
+ "signature",
818
+ "hmac",
819
+ ],
820
+ url: `${DOCS_BASE_URL}/partners#events`,
821
+ body: "Webhooks are the one event primitive, and their ownership generalizes from teams to tenants. Declare subscriptions in the system-space manifest (`url` plus an `events` selection) and reconciliation creates, updates, or disables the rows; delivery uses the same `Spacefast-Signature` HMAC and dual-secret rotation as team webhooks, so verify the signature before trusting a payload. Email white-labeling is not a separate endpoint: subscribe to `principal.notification.*` events (claim link issued, security notice, publish receipt) and send them yourself in your own voice. For a partner tenant these events replace Spacefast-sent email to your customers — no active subscription means no send, and Spacefast never falls back to sending as itself to someone else's customer.",
707
822
  },
708
823
  ];
709
824
  const SKILL_RECIPE_DOCS = SPACEFAST_RECIPE_SKILLS.map((skill) => ({