@spacefast/common 0.0.5 → 0.0.7

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 (183) hide show
  1. package/brand-assets/spacefast-favicon.svg +16 -0
  2. package/brand-assets/spacefast-sf-full-bleed.svg +13 -0
  3. package/brand-assets/spacefast-wordmark.svg +5 -0
  4. package/dist/agents/connect-targets.d.ts +138 -0
  5. package/dist/agents/connect-targets.js +243 -0
  6. package/dist/brand-assets-build.d.ts +26 -0
  7. package/dist/brand-assets-build.js +81 -0
  8. package/dist/brand-assets.d.ts +42 -0
  9. package/dist/brand-assets.js +30 -0
  10. package/dist/brand.d.ts +1 -0
  11. package/dist/brand.js +5 -0
  12. package/dist/config/domains.d.ts +12 -6
  13. package/dist/config/domains.js +30 -38
  14. package/dist/contracts/access.d.ts +967 -124
  15. package/dist/contracts/access.js +804 -148
  16. package/dist/contracts/activity.d.ts +1 -1
  17. package/dist/contracts/activity.js +28 -2
  18. package/dist/contracts/annotations.d.ts +2 -4
  19. package/dist/contracts/api-keys.d.ts +126 -4
  20. package/dist/contracts/api-keys.js +74 -6
  21. package/dist/contracts/archives.d.ts +8 -2
  22. package/dist/contracts/archives.js +11 -4
  23. package/dist/contracts/billing.d.ts +0 -9
  24. package/dist/contracts/builds.d.ts +65 -21
  25. package/dist/contracts/builds.js +29 -0
  26. package/dist/contracts/common.d.ts +2 -0
  27. package/dist/contracts/common.js +4 -0
  28. package/dist/contracts/continuation.d.ts +0 -3
  29. package/dist/contracts/countries.d.ts +2 -0
  30. package/dist/contracts/countries.js +261 -0
  31. package/dist/contracts/deployments.d.ts +34 -34
  32. package/dist/contracts/device-auth.d.ts +4 -11
  33. package/dist/contracts/device-auth.js +4 -0
  34. package/dist/contracts/docs.d.ts +119 -0
  35. package/dist/contracts/docs.js +51 -0
  36. package/dist/contracts/domains.d.ts +96 -54
  37. package/dist/contracts/domains.js +26 -4
  38. package/dist/contracts/enums.d.ts +15 -16
  39. package/dist/contracts/enums.js +26 -14
  40. package/dist/contracts/error-code-meta.d.ts +184 -0
  41. package/dist/contracts/error-code-meta.js +124 -10
  42. package/dist/contracts/error-codes.d.ts +1 -1
  43. package/dist/contracts/error-codes.js +42 -0
  44. package/dist/contracts/events.d.ts +1 -1
  45. package/dist/contracts/feature-lifecycle-core.d.ts +36 -0
  46. package/dist/contracts/feature-lifecycle-core.js +220 -0
  47. package/dist/contracts/feature-lifecycle.d.ts +7 -0
  48. package/dist/contracts/feature-lifecycle.js +31 -0
  49. package/dist/contracts/features.d.ts +76 -6
  50. package/dist/contracts/features.js +178 -13
  51. package/dist/contracts/generated-feature-launch-entries.d.ts +2 -0
  52. package/dist/contracts/generated-feature-launch-entries.js +518 -0
  53. package/dist/contracts/git.d.ts +2 -8
  54. package/dist/contracts/ids.d.ts +9 -0
  55. package/dist/contracts/ids.js +13 -0
  56. package/dist/contracts/mcp.d.ts +8 -10
  57. package/dist/contracts/me.js +1 -1
  58. package/dist/contracts/oauth-resources.d.ts +19 -8
  59. package/dist/contracts/oauth-resources.js +44 -13
  60. package/dist/contracts/operations.d.ts +161 -1
  61. package/dist/contracts/operations.js +49 -1
  62. package/dist/contracts/platform.d.ts +6 -102
  63. package/dist/contracts/platform.js +6 -50
  64. package/dist/contracts/publishes.d.ts +130 -0
  65. package/dist/contracts/publishes.js +145 -0
  66. package/dist/contracts/push-new.d.ts +4 -4
  67. package/dist/contracts/quotas.d.ts +2 -0
  68. package/dist/contracts/quotas.js +8 -0
  69. package/dist/contracts/repository-connections.d.ts +9 -8
  70. package/dist/contracts/repository-connections.js +13 -0
  71. package/dist/contracts/resources.d.ts +99 -13
  72. package/dist/contracts/resources.js +36 -4
  73. package/dist/contracts/routes.d.ts +0 -2
  74. package/dist/contracts/runtime-api.d.ts +363 -39
  75. package/dist/contracts/runtime-api.js +276 -6
  76. package/dist/contracts/sf-config-v1.d.ts +75 -0
  77. package/dist/contracts/sf-config-v1.js +6 -0
  78. package/dist/contracts/sites.d.ts +19 -2
  79. package/dist/contracts/sites.js +21 -0
  80. package/dist/contracts/space-config.d.ts +201 -2
  81. package/dist/contracts/space-config.js +135 -5
  82. package/dist/contracts/spaces.d.ts +376 -196
  83. package/dist/contracts/spaces.js +62 -10
  84. package/dist/contracts/superadmin-emails.d.ts +4 -2
  85. package/dist/contracts/superadmin-emails.js +8 -0
  86. package/dist/contracts/superadmin-queues.d.ts +26 -26
  87. package/dist/contracts/superadmin-spaces.d.ts +172 -42
  88. package/dist/contracts/superadmin-tenants.d.ts +6 -6
  89. package/dist/contracts/superadmin-tenants.js +6 -11
  90. package/dist/contracts/superadmin.d.ts +6 -93
  91. package/dist/contracts/superadmin.js +6 -14
  92. package/dist/contracts/tags.d.ts +10 -9
  93. package/dist/contracts/tags.js +2 -1
  94. package/dist/contracts/teams.d.ts +26 -30
  95. package/dist/contracts/teams.js +11 -17
  96. package/dist/contracts/theme-json.d.ts +30 -0
  97. package/dist/contracts/theme-json.js +48 -0
  98. package/dist/contracts/variables.d.ts +0 -2
  99. package/dist/contracts/variables.js +0 -5
  100. package/dist/contracts/webhooks.d.ts +2 -0
  101. package/dist/contracts/webhooks.js +1 -1
  102. package/dist/contracts/zero.d.ts +5 -10
  103. package/dist/docs/agent-prose.d.ts +43 -3
  104. package/dist/docs/agent-prose.js +146 -7
  105. package/dist/docs/agent-setup.d.ts +51 -0
  106. package/dist/docs/agent-setup.js +211 -14
  107. package/dist/docs/agent-solutions.d.ts +5 -5
  108. package/dist/docs/agent-solutions.js +2 -2
  109. package/dist/docs/catalog.d.ts +650 -0
  110. package/dist/docs/catalog.js +758 -0
  111. package/dist/docs/error-docs.d.ts +0 -2
  112. package/dist/docs/error-docs.js +189 -35
  113. package/dist/docs/index-build.d.ts +17 -0
  114. package/dist/docs/index-build.js +24 -0
  115. package/dist/docs/search.d.ts +54 -0
  116. package/dist/docs/search.js +96 -0
  117. package/dist/docs/skill-distribution.d.ts +5 -3
  118. package/dist/docs/skill-distribution.js +8 -8
  119. package/dist/slug-policy/blocklist.d.ts +4 -0
  120. package/dist/slug-policy/blocklist.js +122 -0
  121. package/dist/slug-policy/index.d.ts +17 -0
  122. package/dist/slug-policy/index.js +86 -0
  123. package/dist/utils/access-match.d.ts +39 -0
  124. package/dist/utils/access-match.js +296 -0
  125. package/dist/utils/auth-redirect.d.ts +3 -1
  126. package/dist/utils/auth-redirect.js +21 -1
  127. package/dist/utils/build-settings.d.ts +6 -0
  128. package/dist/utils/build-settings.js +429 -46
  129. package/dist/utils/claim-token.d.ts +8 -0
  130. package/dist/utils/claim-token.js +23 -2
  131. package/dist/utils/concurrency.d.ts +1 -0
  132. package/dist/utils/concurrency.js +22 -0
  133. package/dist/utils/content-type.d.ts +1 -0
  134. package/dist/utils/content-type.js +1 -1
  135. package/dist/utils/credential-policy.d.ts +54 -0
  136. package/dist/utils/{access-policy.js → credential-policy.js} +28 -2
  137. package/dist/utils/email.d.ts +1 -0
  138. package/dist/utils/email.js +3 -0
  139. package/dist/utils/gate-theme.d.ts +61 -0
  140. package/dist/utils/gate-theme.js +217 -0
  141. package/dist/utils/git-repository.d.ts +0 -1
  142. package/dist/utils/git-repository.js +0 -3
  143. package/dist/utils/id-hints.d.ts +8 -0
  144. package/dist/utils/id-hints.js +61 -0
  145. package/dist/utils/local-space-state.d.ts +91 -0
  146. package/dist/utils/local-space-state.js +251 -0
  147. package/dist/utils/oauth-signed-query.d.ts +8 -0
  148. package/dist/utils/oauth-signed-query.js +26 -0
  149. package/dist/utils/publish-detection.d.ts +0 -8
  150. package/dist/utils/publish-detection.js +0 -93
  151. package/dist/utils/publish-policy.d.ts +6 -5
  152. package/dist/utils/publish-policy.js +71 -7
  153. package/dist/utils/query-keys.d.ts +16 -4
  154. package/dist/utils/query-keys.js +31 -4
  155. package/dist/utils/runtime-paths.d.ts +0 -1
  156. package/dist/utils/runtime-paths.js +0 -1
  157. package/dist/utils/runtime-upload-batch.d.ts +18 -0
  158. package/dist/utils/runtime-upload-batch.js +90 -0
  159. package/dist/utils/runtime-upload.d.ts +2 -0
  160. package/dist/utils/runtime-upload.js +5 -0
  161. package/dist/utils/sf-config-v1.d.ts +2 -0
  162. package/dist/utils/sf-config-v1.js +542 -0
  163. package/dist/utils/space-config.d.ts +4 -0
  164. package/dist/utils/space-config.js +10 -1
  165. package/dist/utils/space-theme.d.ts +2 -0
  166. package/dist/utils/space-theme.js +9 -0
  167. package/dist/utils/static-runtime-policy.d.ts +0 -21
  168. package/dist/utils/static-runtime-policy.js +19 -103
  169. package/dist/utils/upload-session.d.ts +1 -1
  170. package/dist/utils/wpcom-auth-redirects.d.ts +32 -2
  171. package/dist/utils/wpcom-auth-redirects.js +26 -10
  172. package/dist/vocabulary.d.ts +130 -30
  173. package/dist/vocabulary.js +77 -36
  174. package/package.json +35 -1
  175. package/dist/contracts/account.d.ts +0 -28
  176. package/dist/contracts/account.js +0 -54
  177. package/dist/contracts/intercom.d.ts +0 -6
  178. package/dist/contracts/intercom.js +0 -5
  179. package/dist/contracts/telemetry.d.ts +0 -2
  180. package/dist/contracts/telemetry.js +0 -1
  181. package/dist/utils/access-policy.d.ts +0 -39
  182. package/dist/utils/error-display.d.ts +0 -7
  183. package/dist/utils/error-display.js +0 -42
@@ -8,5 +8,3 @@ export type ErrorDoc = {
8
8
  export declare const ERROR_DOCS: Record<ErrorCode, ErrorDoc>;
9
9
  /** One generated reference page per error code; the `.md` twin is this exact text. */
10
10
  export declare function errorDocMarkdown(code: ErrorCode): string;
11
- /** The generated `/docs/errors` index page; the `.md` twin is this exact text. */
12
- export declare function errorDocsIndexMarkdown(): string;
@@ -5,7 +5,8 @@
5
5
  // and pages never go missing. apps/www renders the HTML pages and writes the
6
6
  // `.md` twins from the same entries.
7
7
  import { BRAND } from "../brand.js";
8
- import { ERROR_CODES, errorDocsUrl } from "../contracts/error-codes.js";
8
+ import { errorDocsUrl } from "../contracts/error-codes.js";
9
+ // Restore upgrade-oriented recovery copy here when paid plan checkout is live.
9
10
  export const ERROR_DOCS = {
10
11
  abuse_report_invalid_transition: {
11
12
  summary: "The abuse report cannot move to the requested status from its current status.",
@@ -33,7 +34,7 @@ export const ERROR_DOCS = {
33
34
  },
34
35
  anonymous_expired: {
35
36
  summary: "This anonymous space expired before it was claimed.",
36
- fix: "Publish again to get a fresh space, or claim spaces before their expiry next time.",
37
+ fix: "Publish a fresh space and share its claim link right away this time. If you meant to update a space that is still live, check .spacefast/ (or your saved receipt) for its spaceId and publish to that with its credential instead of creating a new space.",
37
38
  },
38
39
  anonymous_pool_unavailable: {
39
40
  summary: "No pooled capacity is available for anonymous publishes right now.",
@@ -43,6 +44,14 @@ export const ERROR_DOCS = {
43
44
  summary: "Too many anonymous publishes came from this network in a short window.",
44
45
  fix: "Wait for the window to pass, or sign in with an API key for higher limits.",
45
46
  },
47
+ anonymous_space_limit_reached: {
48
+ summary: "Too many unclaimed anonymous spaces are already active for this client.",
49
+ fix: "Log in to publish into an authenticated space, or claim/delete an existing anonymous space before creating another.",
50
+ },
51
+ api_key_scope_underivable: {
52
+ summary: "A concrete access policy could not be derived from the requested scope and permissions.",
53
+ fix: "Point scope at a resource you can already reach (an existing space owned by a team) and request permissions your credential already has.",
54
+ },
46
55
  archive_body_required: {
47
56
  summary: "This request must carry an archive body but none was provided.",
48
57
  fix: "Send the zip bytes as the request body with the matching content-type header.",
@@ -145,7 +154,7 @@ export const ERROR_DOCS = {
145
154
  },
146
155
  claimed_space_quota_exceeded: {
147
156
  summary: "Claiming this space would exceed the target team's space quota.",
148
- fix: "Delete unused spaces or upgrade the plan, then claim again.",
157
+ fix: "Delete unused spaces, then claim again. Still stuck? POST /v1/feedback with the error code and request id.",
149
158
  },
150
159
  cli_upgrade_required: {
151
160
  summary: "This CLI version is too old to talk to the API safely.",
@@ -165,7 +174,15 @@ export const ERROR_DOCS = {
165
174
  },
166
175
  config_templates_over_limit: {
167
176
  summary: "The configuration declares more template files than the plan allows.",
168
- fix: "Reduce the number of template entries in sf.jsonc.",
177
+ fix: "Reduce the number of template entries in sf.jsonc. Still stuck? POST /v1/feedback with the error code and request id.",
178
+ },
179
+ continuation_unavailable: {
180
+ summary: "This claim token can no longer be exchanged for an access token.",
181
+ fix: "If the space is claimed, ask its owner for an access token (dashboard: Account → Access tokens). If it is still unclaimed, keep using the claim token as bearer auth instead of exchanging it. Still stuck? POST /v1/feedback with the error code and request id.",
182
+ },
183
+ continuation_used: {
184
+ summary: "This claim token was already exchanged for a durable access token.",
185
+ fix: "Authenticate with the exchanged access token (check .spacefast/state.json or wherever it was saved). If it was lost, ask the space owner to mint a new access token.",
169
186
  },
170
187
  credential_expired: {
171
188
  summary: "The credential used for this request has expired.",
@@ -191,9 +208,13 @@ export const ERROR_DOCS = {
191
208
  summary: "CSAM enforcement policy cannot be set below the mandatory account-suspend floor.",
192
209
  fix: "Set the CSAM category enforcement tier to account suspension.",
193
210
  },
211
+ datacenters_unavailable: {
212
+ summary: "Placement regions are temporarily unavailable.",
213
+ fix: "Retry after the datacenter list has synced.",
214
+ },
194
215
  data_location_immutable: {
195
- summary: "A space's data location cannot be changed after placement.",
196
- fix: "Create a new space in the desired region and transfer content into it.",
216
+ summary: "This request tried to change data location through an immutable path.",
217
+ fix: "Use PATCH /v1/spaces/{id} to queue a region move when region changes are supported for this space.",
197
218
  },
198
219
  device_authorization_failed: {
199
220
  summary: "The device login request failed and cannot be completed.",
@@ -373,7 +394,7 @@ export const ERROR_DOCS = {
373
394
  },
374
395
  domain_quota_exceeded: {
375
396
  summary: "Adding this domain would exceed the plan's external domain allowance.",
376
- fix: "Remove unused domains or upgrade the plan.",
397
+ fix: "Remove unused domains. Still stuck? POST /v1/feedback with the error code and request id.",
377
398
  },
378
399
  domain_registration_active: {
379
400
  summary: "The domain has an active registration, which blocks this operation.",
@@ -407,6 +428,10 @@ export const ERROR_DOCS = {
407
428
  summary: "The version upload declares the same file path twice.",
408
429
  fix: "Deduplicate the file list so every path appears once.",
409
430
  },
431
+ enforcement_policy_overlap: {
432
+ summary: "Enforcement policy severity ranges overlap within a category.",
433
+ fix: "Adjust the category ranges so each severity is covered by at most one policy.",
434
+ },
410
435
  expired_token: {
411
436
  summary: "The token has expired.",
412
437
  fix: "Request a new token and retry.",
@@ -421,7 +446,7 @@ export const ERROR_DOCS = {
421
446
  },
422
447
  feature_unavailable: {
423
448
  summary: "This feature is not available on this deployment or plan.",
424
- fix: "Check the feature's availability, or upgrade if it is plan-gated.",
449
+ fix: "Check the feature's availability and try again when it is enabled for your team.",
425
450
  },
426
451
  files_mode_does_not_support_spa: {
427
452
  summary: "SPA fallback cannot be combined with files-listing mode.",
@@ -433,11 +458,11 @@ export const ERROR_DOCS = {
433
458
  },
434
459
  free_external_proxy_disabled: {
435
460
  summary: "Proxy routes to external upstreams are not available on the Free plan.",
436
- fix: "Remove the proxy rules or upgrade the plan to enable external proxying.",
461
+ fix: "Remove the proxy rules before publishing. Still stuck? POST /v1/feedback with the error code and request id.",
437
462
  },
438
463
  free_headers_basic_auth_disabled: {
439
464
  summary: "Basic-Auth via _headers is not available on the Free plan.",
440
- fix: "Use space password protection, or upgrade the plan for _headers Basic Auth.",
465
+ fix: "Use space password protection instead. Still stuck? POST /v1/feedback with the error code and request id.",
441
466
  },
442
467
  idempotency_conflict_in_progress: {
443
468
  summary: "Another request with the same Idempotency-Key is still in flight.",
@@ -613,7 +638,7 @@ export const ERROR_DOCS = {
613
638
  },
614
639
  log_retention_clamped: {
615
640
  summary: "The requested log range exceeds the plan's retention and was clamped.",
616
- fix: "Narrow the range, or upgrade the plan for longer retention.",
641
+ fix: "Narrow the range.",
617
642
  },
618
643
  lost_domain_control: {
619
644
  summary: `${BRAND.productName} no longer observes DNS control for this domain.`,
@@ -647,6 +672,10 @@ export const ERROR_DOCS = {
647
672
  summary: "A required route parameter is missing from the request path.",
648
673
  fix: "Check the endpoint path in the API reference and include every parameter.",
649
674
  },
675
+ move_target_capacity_lost: {
676
+ summary: "The selected move target no longer has capacity for the space.",
677
+ fix: "Retry the move with a different target or after capacity is freed.",
678
+ },
650
679
  nameserver_delegation_required: {
651
680
  summary: `This operation requires the domain to be delegated to ${BRAND.productName} nameservers.`,
652
681
  fix: "Update the domain's nameservers at the registrar, then retry once delegation propagates.",
@@ -683,6 +712,14 @@ export const ERROR_DOCS = {
683
712
  summary: "This plan grant was already revoked.",
684
713
  fix: "Nothing to do; create a new grant if the team should regain the plan.",
685
714
  },
715
+ placement_invalid_burstable: {
716
+ summary: "The placement burstable option was used with an unsupported placement mode.",
717
+ fix: 'Set placement.mode to "dedicated" before setting placement.burstable, or remove the burstable option.',
718
+ },
719
+ placement_mode_requires_plan: {
720
+ summary: "The requested placement mode requires a plan entitlement.",
721
+ fix: "Upgrade the team plan or choose shared placement.",
722
+ },
686
723
  platform_tenant_immutable_client: {
687
724
  summary: "The tenant's provider client cannot be changed.",
688
725
  fix: "Create a new tenant with the desired provider client instead.",
@@ -729,7 +766,7 @@ export const ERROR_DOCS = {
729
766
  },
730
767
  publish_archive_expanded_size_exceeded: {
731
768
  summary: "The archive expands beyond the maximum allowed total size.",
732
- fix: "Reduce the content size or upgrade the plan for higher limits.",
769
+ fix: "Reduce the content size.",
733
770
  },
734
771
  publish_archive_file_count_exceeded: {
735
772
  summary: "The archive contains more files than the allowed ceiling.",
@@ -739,6 +776,10 @@ export const ERROR_DOCS = {
739
776
  summary: "The uploaded archive exceeds the maximum allowed size.",
740
777
  fix: "Reduce the archive size or use a version upload session for big publishes.",
741
778
  },
779
+ publish_base_changed: {
780
+ summary: "Someone published new space settings after the base you loaded, so saving would overwrite their change.",
781
+ fix: "Reload the latest settings, review the difference, and save again; pass force only to overwrite deliberately.",
782
+ },
742
783
  publish_config_unsupported: {
743
784
  summary: "The publish carries configuration this endpoint does not support.",
744
785
  fix: "Move the configuration into sf.jsonc or the space settings.",
@@ -781,7 +822,7 @@ export const ERROR_DOCS = {
781
822
  },
782
823
  routing_rules_over_plan: {
783
824
  summary: "The published _redirects and _headers exceed the plan's routing-rule allowance.",
784
- fix: "Reduce the rule count or upgrade the plan.",
825
+ fix: "Reduce the rule count. Still stuck? POST /v1/feedback with the error code and request id.",
785
826
  },
786
827
  runtime_action_forbidden: {
787
828
  summary: "The runtime credential does not allow this action.",
@@ -789,7 +830,7 @@ export const ERROR_DOCS = {
789
830
  },
790
831
  runtime_api_not_found: {
791
832
  summary: "The runtime management endpoint was not found.",
792
- fix: "Check the runtime API path against the runtime contract.",
833
+ fix: "Send the request with the management hostname as the Host header; management routes are not served on public hostnames.",
793
834
  },
794
835
  runtime_callback_forbidden: {
795
836
  summary: "The runtime callback could not be authenticated.",
@@ -899,14 +940,30 @@ export const ERROR_DOCS = {
899
940
  summary: "The device login is being polled faster than the advised interval.",
900
941
  fix: "Increase the polling interval; aggressive polling invalidates the flow.",
901
942
  },
943
+ slug_invalid: {
944
+ summary: "The slug does not meet the structural rules for managed names.",
945
+ fix: "Use lowercase letters, numbers, and single dashes within the allowed length; the error message identifies the failed rule.",
946
+ },
947
+ slug_reserved: {
948
+ summary: "The slug is reserved for infrastructure, product, or impersonation protection.",
949
+ fix: "Choose a different name that is not reserved by the shared slug policy.",
950
+ },
951
+ slug_unavailable: {
952
+ summary: "The slug is already in use within the relevant ownership scope.",
953
+ fix: "Choose another slug or use the available suggestion returned by the API.",
954
+ },
902
955
  space_already_claimed: {
903
- summary: "The space was already claimed by someone else.",
904
- fix: "Publish a new space; a claim can only succeed once.",
956
+ summary: "The space was already claimed; a claim can only succeed once.",
957
+ fix: "If you are the agent that published this space, exchange your claim token once at POST /v1/anonymous-claim/exchange for a durable access token and keep publishing to the same spaceId. Otherwise ask the owner for access — do not publish a duplicate space.",
905
958
  },
906
959
  space_claim_unavailable: {
907
960
  summary: "This space cannot be claimed.",
908
961
  fix: "Only anonymous, unexpired spaces with a valid claim token can be claimed.",
909
962
  },
963
+ space_claimed_credential_available: {
964
+ summary: "The space was claimed and its owner kept agent publishing enabled; this claim token now works exactly once as an exchange voucher.",
965
+ fix: "POST /v1/anonymous-claim/exchange with this claim token as bearer auth. Save the returned access token (e.g. .spacefast/state.json), then retry the request with it as Authorization: Bearer. Do not publish a new space.",
966
+ },
910
967
  space_disabled: {
911
968
  summary: "The space is disabled and cannot be served or modified.",
912
969
  fix: "Check the disabled reason on the space; it explains the path to restore it.",
@@ -919,6 +976,10 @@ export const ERROR_DOCS = {
919
976
  summary: "The space still has an active version, which blocks this operation.",
920
977
  fix: "Delete or supersede the active version first.",
921
978
  },
979
+ space_hostname_identity_missing: {
980
+ summary: "The space is missing its persisted default hostname identity.",
981
+ fix: "Contact support. Retrying cannot safely recreate a permanent hostname identity.",
982
+ },
922
983
  space_import_archive_invalid: {
923
984
  summary: `The import archive is not a valid ${BRAND.productName} export.`,
924
985
  fix: "Export the source space again and upload the unmodified archive.",
@@ -983,9 +1044,13 @@ export const ERROR_DOCS = {
983
1044
  summary: "This operation only applies to static-runtime spaces.",
984
1045
  fix: "Target a static-runtime space.",
985
1046
  },
1047
+ storage_bucket_unavailable: {
1048
+ summary: "No usable internal storage bucket is configured for this operation.",
1049
+ fix: "Check the storage bucket registry and credential environment references, then retry.",
1050
+ },
986
1051
  storage_quota_exceeded: {
987
1052
  summary: "The publish would exceed the plan's storage allowance.",
988
- fix: "Delete old versions or upgrade the plan.",
1053
+ fix: "Delete old versions. Still stuck? POST /v1/feedback with the error code and request id.",
989
1054
  },
990
1055
  storage_usage_unavailable: {
991
1056
  summary: "Storage usage could not be computed right now.",
@@ -1003,6 +1068,10 @@ export const ERROR_DOCS = {
1003
1068
  summary: "The hostname was recently bound elsewhere; a takeover notice window applies.",
1004
1069
  fix: "Retry after the notice window, or have the current holder release the binding.",
1005
1070
  },
1071
+ team_member_quota_exceeded: {
1072
+ summary: "Inviting this person would exceed the team's seat limit.",
1073
+ fix: "Remove a team member or cancel a pending invitation to free a seat; pending invitations count toward the limit.",
1074
+ },
1006
1075
  team_ref_required: {
1007
1076
  summary: "A team reference is required for this operation.",
1008
1077
  fix: "Pass the team id or slug.",
@@ -1075,6 +1144,10 @@ export const ERROR_DOCS = {
1075
1144
  summary: "The transfer has progressed past the point where it can be canceled.",
1076
1145
  fix: "Wait for the transfer to finish.",
1077
1146
  },
1147
+ transfer_push_failed: {
1148
+ summary: "The source runtime could not push the space blobs into the transfer bucket.",
1149
+ fix: "Retry the move; if it persists, check the source runtime and bucket configuration.",
1150
+ },
1078
1151
  transfer_source_changed: {
1079
1152
  summary: "The space changed since the transfer was created, so it must be re-confirmed.",
1080
1153
  fix: "Review the space's current state and confirm the transfer again.",
@@ -1083,6 +1156,10 @@ export const ERROR_DOCS = {
1083
1156
  summary: "The transfer target is the same principal that already owns the space.",
1084
1157
  fix: "Pick a different target team or account.",
1085
1158
  },
1159
+ transfer_verify_failed: {
1160
+ summary: "The target runtime could not verify transferred blob content.",
1161
+ fix: "Retry the move; if it persists, check the target runtime and bucket integrity.",
1162
+ },
1086
1163
  unauthorized: {
1087
1164
  summary: "The request carried no valid credential.",
1088
1165
  fix: "Send a bearer access token, use an agent OAuth client, or sign in.",
@@ -1165,7 +1242,7 @@ export const ERROR_DOCS = {
1165
1242
  },
1166
1243
  version_file_too_large: {
1167
1244
  summary: "A file exceeds the plan's maximum file size.",
1168
- fix: "Reduce the file size or upgrade the plan.",
1245
+ fix: "Reduce the file size.",
1169
1246
  },
1170
1247
  version_files_missing: {
1171
1248
  summary: "Declared files were never uploaded, so the version cannot finalize.",
@@ -1205,11 +1282,11 @@ export const ERROR_DOCS = {
1205
1282
  },
1206
1283
  version_quota_exceeded: {
1207
1284
  summary: "The space has reached its version quota.",
1208
- fix: "Delete old versions or upgrade the plan.",
1285
+ fix: "Delete old versions. Still stuck? POST /v1/feedback with the error code and request id.",
1209
1286
  },
1210
1287
  version_total_bytes_exceeded: {
1211
1288
  summary: "The version exceeds the maximum total size.",
1212
- fix: "Reduce the content size or upgrade the plan.",
1289
+ fix: "Reduce the content size.",
1213
1290
  },
1214
1291
  webhook_delivery_budget_exceeded: {
1215
1292
  summary: "The webhook exhausted its delivery budget and was paused.",
@@ -1219,6 +1296,14 @@ export const ERROR_DOCS = {
1219
1296
  summary: "WHOIS data is unavailable for this domain right now.",
1220
1297
  fix: "Retry later.",
1221
1298
  },
1299
+ zero_activating: {
1300
+ summary: "Zero endpoints are activating.",
1301
+ fix: "Wait for the dedicated runtime move to complete, then retry the request.",
1302
+ },
1303
+ zero_ai_unavailable: {
1304
+ summary: "The local Zero AI service is not configured.",
1305
+ fix: "Configure an AI handler for zero dev before calling the AI service.",
1306
+ },
1222
1307
  zero_artifact_abi_mismatch: {
1223
1308
  summary: "The Zero endpoint artifact was built for a different runner ABI.",
1224
1309
  fix: `Rebuild and republish the Zero project with the current ${BRAND.productName} CLI and runtime.`,
@@ -1231,6 +1316,10 @@ export const ERROR_DOCS = {
1231
1316
  summary: "The Zero endpoint artifact could not be parsed.",
1232
1317
  fix: "Rebuild the Zero project; do not edit generated artifact JSON by hand.",
1233
1318
  },
1319
+ zero_artifact_missing: {
1320
+ summary: "A Zero route points to an endpoint artifact that is missing.",
1321
+ fix: "Declare the endpoint in zero_endpoints, then rebuild and publish again.",
1322
+ },
1234
1323
  zero_artifact_path_invalid: {
1235
1324
  summary: "The Zero endpoint artifact path is invalid.",
1236
1325
  fix: "Rebuild the Zero routes so all artifact paths stay inside the version bundle.",
@@ -1239,6 +1328,10 @@ export const ERROR_DOCS = {
1239
1328
  summary: "The Zero endpoint artifact could not be read by the runtime.",
1240
1329
  fix: "Verify the version finalized with all generated Zero files present.",
1241
1330
  },
1331
+ zero_artifact_untrusted: {
1332
+ summary: "A Zero route points to an uploaded artifact that the runtime did not compile.",
1333
+ fix: "Declare the endpoint in zero_endpoints so finalize generates trusted bytecode.",
1334
+ },
1242
1335
  zero_auth_unavailable: {
1243
1336
  summary: "Hosted Zero auth is not configured for this deployment.",
1244
1337
  fix: "Finalize the Zero version with hosted auth URLs or use guest/local auth.",
@@ -1279,6 +1372,10 @@ export const ERROR_DOCS = {
1279
1372
  summary: "The Zero endpoint bytecode file could not be read.",
1280
1373
  fix: "Verify the version finalized with the generated bytecode files present.",
1281
1374
  },
1375
+ zero_capabilities_encode_failed: {
1376
+ summary: "The runtime could not encode the Zero endpoint capabilities.",
1377
+ fix: "Rebuild with valid capability metadata; report the failure if it persists.",
1378
+ },
1282
1379
  zero_client_bundle_not_loaded: {
1283
1380
  summary: "The local Zero dev client bundle has not been generated or loaded.",
1284
1381
  fix: "Restart zero dev or run a fresh local build before loading the client route.",
@@ -1351,6 +1448,22 @@ export const ERROR_DOCS = {
1351
1448
  summary: "The Zero database dump query parameters are invalid.",
1352
1449
  fix: "Use valid table, limit, and cursor parameters.",
1353
1450
  },
1451
+ zero_endpoint_compile_failed: {
1452
+ summary: "The runtime could not compile the Zero endpoint bytecode.",
1453
+ fix: "Inspect the compile diagnostics, fix the endpoint source, and publish again.",
1454
+ },
1455
+ zero_endpoint_conflict: {
1456
+ summary: "Two Zero routes resolve to the same runtime path.",
1457
+ fix: "Remove the duplicate generated or explicit lookup route and publish again.",
1458
+ },
1459
+ zero_endpoint_duplicate: {
1460
+ summary: "Two Zero endpoints declare the same method and route.",
1461
+ fix: "Give each endpoint a unique method and route before publishing again.",
1462
+ },
1463
+ zero_endpoint_id_duplicate: {
1464
+ summary: "Two Zero endpoints declare the same endpoint id.",
1465
+ fix: "Give every endpoint a unique endpoint id before publishing again.",
1466
+ },
1354
1467
  zero_endpoint_index_invalid: {
1355
1468
  summary: "The Zero endpoint index does not contain valid endpoint mappings.",
1356
1469
  fix: "Rebuild and republish the Zero project.",
@@ -1367,6 +1480,10 @@ export const ERROR_DOCS = {
1367
1480
  summary: "The Zero endpoint index could not be read.",
1368
1481
  fix: "Verify the version finalized with zero/endpoints-index.json present.",
1369
1482
  },
1483
+ zero_endpoint_invalid: {
1484
+ summary: "A Zero endpoint definition or its database metadata is invalid.",
1485
+ fix: "Fix the endpoint method, route, source, capabilities, or database metadata and publish again.",
1486
+ },
1370
1487
  zero_endpoint_mismatch: {
1371
1488
  summary: "The requested Zero endpoint does not match the endpoint artifact.",
1372
1489
  fix: "Rebuild routes and artifacts together and redeploy the version.",
@@ -1375,6 +1492,18 @@ export const ERROR_DOCS = {
1375
1492
  summary: "No Zero endpoint artifact exists for this endpoint id.",
1376
1493
  fix: "Check the route path and rebuild the Zero endpoint index.",
1377
1494
  },
1495
+ zero_endpoints_invalid: {
1496
+ summary: "The Zero endpoints payload is invalid.",
1497
+ fix: "Send an endpoint array within the supported count and size limits.",
1498
+ },
1499
+ zero_endpoints_too_many: {
1500
+ summary: "The Zero endpoints payload exceeds the supported endpoint count.",
1501
+ fix: "Reduce the project to at most 128 Zero endpoints, then publish again.",
1502
+ },
1503
+ zero_requires_dedicated_plan: {
1504
+ summary: "Zero endpoints require a plan with dedicated runtime isolation.",
1505
+ fix: "Upgrade the team to a plan that includes Zero and dedicated runtime, then publish again.",
1506
+ },
1378
1507
  zero_envelope_encode_failed: {
1379
1508
  summary: "The PHP bridge could not encode the Zero runner request envelope.",
1380
1509
  fix: "Retry with valid request data; report the issue if it persists.",
@@ -1407,10 +1536,18 @@ export const ERROR_DOCS = {
1407
1536
  summary: "The Zero log query parameters are invalid.",
1408
1537
  fix: "Use valid cursor, limit, mutationName, and requestId parameters.",
1409
1538
  },
1539
+ zero_lookup_invalid: {
1540
+ summary: "The Zero lookup map contains an invalid path or action.",
1541
+ fix: "Use normalized relative paths and valid finalized Zero actions.",
1542
+ },
1410
1543
  zero_method_not_allowed: {
1411
1544
  summary: "The request method is not allowed for this Zero endpoint.",
1412
1545
  fix: "Call the endpoint with one of the methods declared by the Zero route.",
1413
1546
  },
1547
+ zero_migration_failed: {
1548
+ summary: "The Zero database migration command failed during finalize.",
1549
+ fix: "Inspect the migration and database logs, fix the schema issue, and publish again.",
1550
+ },
1414
1551
  zero_query_name_missing: {
1415
1552
  summary: "A Zero realtime query subscription did not include a query name.",
1416
1553
  fix: "Send a query.subscribe frame with a valid query name.",
@@ -1463,6 +1600,22 @@ export const ERROR_DOCS = {
1463
1600
  summary: "The Zero endpoint response exceeds the runtime size limit.",
1464
1601
  fix: "Return a smaller response body or paginate the data.",
1465
1602
  },
1603
+ zero_routes_invalid: {
1604
+ summary: "The Zero routes artifact is invalid.",
1605
+ fix: "Rebuild the generated routes and publish the version again.",
1606
+ },
1607
+ zero_run_compile_failed: {
1608
+ summary: "The runtime could not compile a Zero run handler.",
1609
+ fix: "Inspect the compile diagnostics, fix the run-handler source, and publish again.",
1610
+ },
1611
+ zero_run_duplicate: {
1612
+ summary: "Two Zero run handlers declare the same run id.",
1613
+ fix: "Give every run handler a unique run id before publishing again.",
1614
+ },
1615
+ zero_run_invalid: {
1616
+ summary: "A Zero run-handler definition is invalid.",
1617
+ fix: "Fix the run id, source, capabilities, or database metadata and publish again.",
1618
+ },
1466
1619
  zero_run_operation_unsupported: {
1467
1620
  summary: "The hosted Zero runtime does not support this run operation yet.",
1468
1621
  fix: "Use a generated endpoint or deploy a generated run handler for this operation.",
@@ -1507,6 +1660,22 @@ export const ERROR_DOCS = {
1507
1660
  summary: "The Zero runner process could not be started.",
1508
1661
  fix: "Verify the runner binary is installed and executable in the runtime.",
1509
1662
  },
1663
+ zero_runs_invalid: {
1664
+ summary: "The Zero run-handler payload is invalid.",
1665
+ fix: "Send a valid array of generated run handlers and publish again.",
1666
+ },
1667
+ zero_runs_require_runtime_compiler: {
1668
+ summary: "Zero run handlers require the Rust runtime compiler.",
1669
+ fix: "Install the current runtime compiler and finalize the version again.",
1670
+ },
1671
+ zero_runs_too_many: {
1672
+ summary: "The Zero run-handler payload exceeds the supported handler count.",
1673
+ fix: "Reduce the project to at most 128 Zero run handlers, then publish again.",
1674
+ },
1675
+ zero_shopify_unavailable: {
1676
+ summary: "The local Zero Shopify service is not configured.",
1677
+ fix: "Configure a Shopify handler for zero dev before calling the Shopify service.",
1678
+ },
1510
1679
  zero_source_compile_failed: {
1511
1680
  summary: "The Zero endpoint source fallback failed to compile.",
1512
1681
  fix: "Fix the endpoint source and rebuild bytecode.",
@@ -1596,18 +1765,3 @@ export function errorDocMarkdown(code) {
1596
1765
  "",
1597
1766
  ].join("\n");
1598
1767
  }
1599
- /** The generated `/docs/errors` index page; the `.md` twin is this exact text. */
1600
- export function errorDocsIndexMarkdown() {
1601
- return [
1602
- "# Error reference",
1603
- "",
1604
- `Every ${PRODUCT} API error response carries a stable \`code\` and a \`docsUrl\` that`,
1605
- "links to one of the pages below. Codes are never renamed or removed. Match on",
1606
- "`code` in clients; `message` text may improve over time.",
1607
- "",
1608
- "| Code | Meaning |",
1609
- "| --- | --- |",
1610
- ...ERROR_CODES.map((code) => `| [\`${code}\`](/docs/errors/${code}) | ${ERROR_DOCS[code].summary} |`),
1611
- "",
1612
- ].join("\n");
1613
- }
@@ -0,0 +1,17 @@
1
+ import { type DocEntry } from "./catalog.js";
2
+ /** Current on-disk index schema version; bump when the shape changes. */
3
+ export declare const DOCS_INDEX_VERSION: 1;
4
+ /** A catalog entry plus its precomputed search blob. */
5
+ export interface DocIndexEntry extends DocEntry {
6
+ /** Lowercased haystack (slug + title + summary + kind + keywords) for offline search. */
7
+ readonly haystack: string;
8
+ }
9
+ /** The bundled, generated docs index. */
10
+ export interface DocsIndex {
11
+ readonly version: typeof DOCS_INDEX_VERSION;
12
+ /** Provenance marker so a reader knows the artifact is generated. */
13
+ readonly generatedFrom: string;
14
+ readonly entries: readonly DocIndexEntry[];
15
+ }
16
+ /** Build the derived search index from a catalog (defaults to the bundled one). */
17
+ export declare function buildDocsIndex(catalog?: readonly DocEntry[]): DocsIndex;
@@ -0,0 +1,24 @@
1
+ // Pure transform from the curated docs catalog (catalog.ts) to a search index.
2
+ // Both the CLI's generator script and its drift-guard test call buildDocsIndex,
3
+ // and the control-plane builds the same index in memory for GET /v1/docs, so the
4
+ // served index, the bundled artifact, and the source can never silently diverge.
5
+ import { DOCS_CATALOG } from "./catalog.js";
6
+ /** Current on-disk index schema version; bump when the shape changes. */
7
+ export const DOCS_INDEX_VERSION = 1;
8
+ /** Build the derived search index from a catalog (defaults to the bundled one). */
9
+ export function buildDocsIndex(catalog = DOCS_CATALOG) {
10
+ const entries = catalog.map((entry) => ({
11
+ ...entry,
12
+ keywords: [...entry.keywords],
13
+ haystack: [entry.slug, entry.title, entry.summary, entry.kind, ...entry.keywords]
14
+ .join(" ")
15
+ .toLowerCase(),
16
+ }));
17
+ return {
18
+ version: DOCS_INDEX_VERSION,
19
+ // Provenance points at the CLI's re-export path, which the committed
20
+ // docs-index.generated.json artifact (and its drift-guard test) pin.
21
+ generatedFrom: "src/docs-catalog.ts",
22
+ entries,
23
+ };
24
+ }
@@ -0,0 +1,54 @@
1
+ import { type CliDisclosureTier } from "../vocabulary.js";
2
+ import type { DocIndexEntry, DocsIndex } from "./index-build.js";
3
+ /** The public, machine-readable shape of a single matched doc. */
4
+ export interface DocResult {
5
+ readonly slug: string;
6
+ readonly title: string;
7
+ readonly kind: DocIndexEntry["kind"];
8
+ readonly tier: CliDisclosureTier;
9
+ readonly summary: string;
10
+ readonly url: string;
11
+ }
12
+ /** A topic result additionally carries the printable body. */
13
+ export interface DocTopic extends DocResult {
14
+ readonly body: string;
15
+ }
16
+ /** The exact `data` payload `sf docs` emits (drives both human + `--json` output). */
17
+ export interface DocsCommandResult {
18
+ /** The trimmed query, or null when listing. */
19
+ readonly query: string | null;
20
+ /** The tier the listing/search ran at. */
21
+ readonly tier: CliDisclosureTier;
22
+ /** Present when the query resolved to an exact topic. */
23
+ readonly topic: DocTopic | null;
24
+ /** Matched docs (or the full tier listing when no query). */
25
+ readonly results: readonly DocResult[];
26
+ }
27
+ /** Entries visible at `viewTier`, in catalog order. */
28
+ export declare function visibleEntries(index: DocsIndex, viewTier: CliDisclosureTier): DocIndexEntry[];
29
+ /** Exact topic lookup by slug (case-insensitive). Ignores tier — explicit intent wins. */
30
+ export declare function findTopic(index: DocsIndex, slug: string): DocIndexEntry | undefined;
31
+ /**
32
+ * Ranked query results are capped so a broad term (e.g. one that hits a chunk
33
+ * of the ~390 generated error-reference entries) can never return the whole
34
+ * catalog in one response. Listing a tier with no query is unaffected — that's
35
+ * an intentional "show me everything at this tier" request, not a search.
36
+ */
37
+ export declare const SEARCH_DOCS_RESULT_LIMIT = 25;
38
+ /**
39
+ * Rank docs matching `query` within the tier. Empty query returns the full tier
40
+ * listing (catalog order), uncapped. A non-empty query ranks matches and caps
41
+ * the result count at {@link SEARCH_DOCS_RESULT_LIMIT}.
42
+ */
43
+ export declare function searchDocs(index: DocsIndex, options: {
44
+ query?: string;
45
+ tier: CliDisclosureTier;
46
+ }): DocIndexEntry[];
47
+ /**
48
+ * Resolve the `sf docs [query]` request: an exact-slug query prints that topic;
49
+ * any other query searches; an empty query lists the tier. Pure + offline.
50
+ */
51
+ export declare function resolveDocsCommand(index: DocsIndex, options: {
52
+ query?: string;
53
+ tier: CliDisclosureTier;
54
+ }): DocsCommandResult;