@spacefast/common 0.0.26 → 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 (302) hide show
  1. package/dist/agents/connect-targets.d.ts +6 -146
  2. package/dist/agents/connect-targets.js +63 -295
  3. package/dist/agents/private-key-oauth.d.ts +31 -1
  4. package/dist/agents/private-key-oauth.js +124 -33
  5. package/dist/agents/registry/core.d.ts +292 -0
  6. package/dist/agents/registry/core.js +1388 -0
  7. package/dist/agents/registry/deeplink-probes.d.ts +23 -0
  8. package/dist/agents/registry/deeplink-probes.js +18 -0
  9. package/dist/agents/registry/node.d.ts +56 -0
  10. package/dist/agents/registry/node.js +339 -0
  11. package/dist/brand-assets-build.js +1 -2
  12. package/dist/brand-assets.js +4 -7
  13. package/dist/brand.d.ts +17 -0
  14. package/dist/brand.js +24 -4
  15. package/dist/config/domains.d.ts +55 -28
  16. package/dist/config/domains.js +85 -41
  17. package/dist/config/index.js +1 -2
  18. package/dist/contracts/abuse.js +9 -24
  19. package/dist/contracts/access-profiles.d.ts +86 -0
  20. package/dist/contracts/access-profiles.js +89 -0
  21. package/dist/contracts/access.d.ts +21 -27
  22. package/dist/contracts/access.js +33 -64
  23. package/dist/contracts/activity.d.ts +18 -1
  24. package/dist/contracts/activity.js +70 -26
  25. package/dist/contracts/analytics.js +8 -10
  26. package/dist/contracts/api-keys.d.ts +77 -52
  27. package/dist/contracts/api-keys.js +44 -24
  28. package/dist/contracts/application-journal.d.ts +216 -0
  29. package/dist/contracts/application-journal.js +167 -0
  30. package/dist/contracts/auth.d.ts +90 -17
  31. package/dist/contracts/auth.js +86 -17
  32. package/dist/contracts/beta.d.ts +9 -4
  33. package/dist/contracts/beta.js +20 -16
  34. package/dist/contracts/billing.js +7 -11
  35. package/dist/contracts/bootstrap.d.ts +791 -0
  36. package/dist/contracts/bootstrap.js +51 -0
  37. package/dist/contracts/builds.d.ts +186 -7
  38. package/dist/contracts/builds.js +75 -21
  39. package/dist/contracts/channels.d.ts +43 -0
  40. package/dist/contracts/channels.js +25 -9
  41. package/dist/contracts/cli.d.ts +7 -0
  42. package/dist/contracts/cli.js +6 -0
  43. package/dist/contracts/collab-public.d.ts +1 -1
  44. package/dist/contracts/collab-public.js +5 -8
  45. package/dist/contracts/comments.d.ts +45 -35
  46. package/dist/contracts/comments.js +107 -77
  47. package/dist/contracts/commerce.d.ts +165 -0
  48. package/dist/contracts/commerce.js +146 -0
  49. package/dist/contracts/common.d.ts +3 -3
  50. package/dist/contracts/common.js +18 -29
  51. package/dist/contracts/content-contract-verification.d.ts +521 -0
  52. package/dist/contracts/content-contract-verification.js +320 -0
  53. package/dist/contracts/content-platform-fixture.d.ts +1278 -0
  54. package/dist/contracts/content-platform-fixture.js +44 -0
  55. package/dist/contracts/content-program.d.ts +994 -0
  56. package/dist/contracts/content-program.js +658 -0
  57. package/dist/contracts/content-sync.d.ts +290 -0
  58. package/dist/contracts/content-sync.js +167 -0
  59. package/dist/contracts/content.d.ts +432 -0
  60. package/dist/contracts/content.js +303 -0
  61. package/dist/contracts/continuation.d.ts +17 -1
  62. package/dist/contracts/continuation.js +23 -23
  63. package/dist/contracts/countries.js +3 -4
  64. package/dist/contracts/crons.d.ts +17 -0
  65. package/dist/contracts/crons.js +33 -15
  66. package/dist/contracts/dashboard-prefs.d.ts +56 -0
  67. package/dist/contracts/dashboard-prefs.js +51 -0
  68. package/dist/contracts/device-auth.d.ts +234 -37
  69. package/dist/contracts/device-auth.js +267 -53
  70. package/dist/contracts/docs.d.ts +6 -10
  71. package/dist/contracts/docs.js +5 -13
  72. package/dist/contracts/domains.d.ts +499 -102
  73. package/dist/contracts/domains.js +169 -58
  74. package/dist/contracts/email-preferences.d.ts +3 -3
  75. package/dist/contracts/email-preferences.js +6 -7
  76. package/dist/contracts/enums.d.ts +26 -26
  77. package/dist/contracts/enums.js +61 -54
  78. package/dist/contracts/error-code-meta.d.ts +269 -7
  79. package/dist/contracts/error-code-meta.js +80 -5
  80. package/dist/contracts/error-codes.d.ts +5 -5
  81. package/dist/contracts/error-codes.js +78 -16
  82. package/dist/contracts/events.d.ts +100 -20
  83. package/dist/contracts/events.js +107 -20
  84. package/dist/contracts/execution.d.ts +47 -66
  85. package/dist/contracts/execution.js +51 -64
  86. package/dist/contracts/feature-lifecycle.d.ts +70 -14
  87. package/dist/contracts/feature-lifecycle.js +86 -15
  88. package/dist/contracts/features.d.ts +100 -37
  89. package/dist/contracts/features.js +21 -27
  90. package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
  91. package/dist/contracts/frame-session.d.ts +192 -0
  92. package/dist/contracts/frame-session.js +164 -0
  93. package/dist/contracts/functions.d.ts +218 -211
  94. package/dist/contracts/functions.js +273 -260
  95. package/dist/contracts/grant-copy.d.ts +43 -0
  96. package/dist/contracts/grant-copy.js +44 -0
  97. package/dist/contracts/grants.d.ts +64 -56
  98. package/dist/contracts/grants.js +124 -23
  99. package/dist/contracts/ids.d.ts +4 -1
  100. package/dist/contracts/ids.js +4 -1
  101. package/dist/contracts/internal.d.ts +5 -4
  102. package/dist/contracts/internal.js +12 -3
  103. package/dist/contracts/mcp.d.ts +17 -0
  104. package/dist/contracts/mcp.js +23 -0
  105. package/dist/contracts/me.d.ts +6 -1
  106. package/dist/contracts/me.js +12 -6
  107. package/dist/contracts/notifications.d.ts +27 -29
  108. package/dist/contracts/notifications.js +9 -4
  109. package/dist/contracts/oauth-resources.d.ts +112 -10
  110. package/dist/contracts/oauth-resources.js +116 -11
  111. package/dist/contracts/oauth-scope-actions.d.ts +90 -0
  112. package/dist/contracts/oauth-scope-actions.js +126 -0
  113. package/dist/contracts/operations.d.ts +27 -4
  114. package/dist/contracts/operations.js +11 -5
  115. package/dist/contracts/pages.d.ts +29 -5
  116. package/dist/contracts/pages.js +22 -5
  117. package/dist/contracts/partner-notifications.d.ts +3 -0
  118. package/dist/contracts/partner-notifications.js +65 -0
  119. package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
  120. package/dist/contracts/{platform.js → partner.js} +27 -40
  121. package/dist/contracts/plan-policy.d.ts +1 -1
  122. package/dist/contracts/principal-assertion.d.ts +43 -0
  123. package/dist/contracts/principal-assertion.js +67 -0
  124. package/dist/contracts/principals.d.ts +73 -0
  125. package/dist/contracts/principals.js +59 -0
  126. package/dist/contracts/privacy.d.ts +11 -0
  127. package/dist/contracts/privacy.js +17 -0
  128. package/dist/contracts/problem-document.js +3 -4
  129. package/dist/contracts/publish-archive.d.ts +116 -18
  130. package/dist/contracts/publish-archive.js +6 -3
  131. package/dist/contracts/push-new.d.ts +4 -4
  132. package/dist/contracts/quotas.js +3 -3
  133. package/dist/contracts/realtime.d.ts +52 -0
  134. package/dist/contracts/realtime.js +54 -0
  135. package/dist/contracts/repository-connections.d.ts +1 -1
  136. package/dist/contracts/repository-connections.js +6 -2
  137. package/dist/contracts/resources.d.ts +105 -14
  138. package/dist/contracts/resources.js +145 -21
  139. package/dist/contracts/route-inventory.d.ts +358 -0
  140. package/dist/contracts/route-inventory.js +141 -0
  141. package/dist/contracts/runtime-api.d.ts +112 -35
  142. package/dist/contracts/runtime-api.js +86 -66
  143. package/dist/contracts/runtime-app.d.ts +11 -21
  144. package/dist/contracts/runtime-app.js +39 -24
  145. package/dist/contracts/runtime-components.d.ts +143 -0
  146. package/dist/contracts/runtime-components.js +199 -0
  147. package/dist/contracts/runtime-db.d.ts +45 -19
  148. package/dist/contracts/runtime-db.js +85 -20
  149. package/dist/contracts/runtime-purge.js +3 -5
  150. package/dist/contracts/runtime-services.d.ts +43 -75
  151. package/dist/contracts/runtime-services.js +29 -49
  152. package/dist/contracts/runtime-storage.d.ts +14 -14
  153. package/dist/contracts/runtime-storage.js +28 -13
  154. package/dist/contracts/sf-config-v1.d.ts +14 -18
  155. package/dist/contracts/slugs.js +13 -4
  156. package/dist/contracts/space-config.d.ts +235 -28
  157. package/dist/contracts/space-config.js +246 -91
  158. package/dist/contracts/spaces.d.ts +360 -255
  159. package/dist/contracts/spaces.js +190 -122
  160. package/dist/contracts/superadmin-activity.d.ts +3 -43
  161. package/dist/contracts/superadmin-activity.js +6 -30
  162. package/dist/contracts/superadmin-emails.d.ts +1 -0
  163. package/dist/contracts/superadmin-emails.js +17 -1
  164. package/dist/contracts/superadmin-runtime.d.ts +199 -0
  165. package/dist/contracts/superadmin-runtime.js +141 -0
  166. package/dist/contracts/superadmin-search.d.ts +22 -2
  167. package/dist/contracts/superadmin-search.js +14 -6
  168. package/dist/contracts/superadmin-spaces.d.ts +435 -186
  169. package/dist/contracts/superadmin-spaces.js +131 -25
  170. package/dist/contracts/superadmin-teams.d.ts +3 -0
  171. package/dist/contracts/superadmin-teams.js +1 -2
  172. package/dist/contracts/superadmin-tenants.d.ts +627 -6
  173. package/dist/contracts/superadmin-tenants.js +32 -7
  174. package/dist/contracts/superadmin.d.ts +98 -16
  175. package/dist/contracts/superadmin.js +63 -10
  176. package/dist/contracts/tags.d.ts +85 -58
  177. package/dist/contracts/tags.js +44 -34
  178. package/dist/contracts/teams.d.ts +72 -9
  179. package/dist/contracts/teams.js +84 -25
  180. package/dist/contracts/tenants.d.ts +135 -0
  181. package/dist/contracts/tenants.js +120 -0
  182. package/dist/contracts/test-triggers.d.ts +70 -0
  183. package/dist/contracts/test-triggers.js +116 -0
  184. package/dist/contracts/theme-json.js +3 -8
  185. package/dist/contracts/transfers.d.ts +1 -0
  186. package/dist/contracts/transfers.js +1 -0
  187. package/dist/contracts/usage.d.ts +209 -0
  188. package/dist/contracts/usage.js +124 -12
  189. package/dist/contracts/variables.d.ts +2 -2
  190. package/dist/contracts/variables.js +9 -13
  191. package/dist/contracts/webhooks.d.ts +13 -5
  192. package/dist/contracts/webhooks.js +3 -1
  193. package/dist/contracts/zero.d.ts +57 -64
  194. package/dist/contracts/zero.js +68 -66
  195. package/dist/dashboard-paths/index.d.ts +24 -21
  196. package/dist/dashboard-paths/index.js +35 -47
  197. package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
  198. package/dist/dashboard-paths/route-reservations.generated.js +36 -0
  199. package/dist/docs/agent-arrival.d.ts +92 -0
  200. package/dist/docs/agent-arrival.js +227 -0
  201. package/dist/docs/agent-output-policy.d.ts +6 -0
  202. package/dist/docs/agent-output-policy.js +22 -0
  203. package/dist/docs/agent-prose.d.ts +11 -17
  204. package/dist/docs/agent-prose.js +62 -37
  205. package/dist/docs/agent-setup.d.ts +72 -41
  206. package/dist/docs/agent-setup.js +336 -436
  207. package/dist/docs/catalog.d.ts +147 -89
  208. package/dist/docs/catalog.js +157 -42
  209. package/dist/docs/error-docs.d.ts +2098 -1
  210. package/dist/docs/error-docs.js +281 -16
  211. package/dist/docs/index-build.d.ts +0 -1
  212. package/dist/docs/index-build.js +2 -3
  213. package/dist/docs/page-context-prompt.d.ts +77 -0
  214. package/dist/docs/page-context-prompt.js +131 -0
  215. package/dist/docs/reference-urls.d.ts +46 -0
  216. package/dist/docs/reference-urls.js +79 -0
  217. package/dist/docs/search.d.ts +6 -8
  218. package/dist/docs/search.js +10 -13
  219. package/dist/docs/skill-distribution.d.ts +4 -1
  220. package/dist/docs/skill-distribution.js +10 -5
  221. package/dist/docs/skills.d.ts +117 -117
  222. package/dist/docs/skills.js +120 -72
  223. package/dist/docs/start-prompts.d.ts +45 -0
  224. package/dist/docs/start-prompts.js +62 -0
  225. package/dist/domain-exploration.js +9 -13
  226. package/dist/og-template.d.ts +56 -0
  227. package/dist/og-template.js +56 -0
  228. package/dist/slug-policy/index.js +5 -11
  229. package/dist/utils/browser-credential.d.ts +13 -6
  230. package/dist/utils/browser-credential.js +14 -7
  231. package/dist/utils/build-settings.d.ts +16 -0
  232. package/dist/utils/build-settings.js +63 -17
  233. package/dist/utils/canonical-json.d.ts +3 -5
  234. package/dist/utils/canonical-json.js +3 -5
  235. package/dist/utils/cast-transport.d.ts +5 -17
  236. package/dist/utils/cast-transport.js +6 -19
  237. package/dist/utils/claim-token.js +1 -2
  238. package/dist/utils/comment-avatars.js +4 -6
  239. package/dist/utils/concurrency.js +2 -3
  240. package/dist/utils/content-type.d.ts +7 -6
  241. package/dist/utils/content-type.js +73 -51
  242. package/dist/utils/credential-policy.d.ts +50 -6
  243. package/dist/utils/credential-policy.js +123 -57
  244. package/dist/utils/egress-policy.fixtures.json +1 -1
  245. package/dist/utils/generate-space-name.d.ts +3 -8
  246. package/dist/utils/generate-space-name.js +3 -8
  247. package/dist/utils/grants.d.ts +0 -1
  248. package/dist/utils/grants.js +4 -7
  249. package/dist/utils/gravatar.d.ts +2 -4
  250. package/dist/utils/gravatar.js +6 -12
  251. package/dist/utils/id-hints.js +14 -23
  252. package/dist/utils/idempotency.d.ts +3 -3
  253. package/dist/utils/idempotency.js +6 -7
  254. package/dist/utils/local-space-state.d.ts +15 -15
  255. package/dist/utils/local-space-state.js +34 -23
  256. package/dist/utils/oauth-signed-query.d.ts +3 -5
  257. package/dist/utils/oauth-signed-query.js +6 -9
  258. package/dist/utils/one-shot-replay.d.ts +3 -5
  259. package/dist/utils/one-shot-replay.js +3 -5
  260. package/dist/utils/page-colors.d.ts +4 -10
  261. package/dist/utils/page-colors.js +11 -35
  262. package/dist/utils/page-fonts.js +6 -11
  263. package/dist/utils/page-preview.d.ts +0 -1
  264. package/dist/utils/page-preview.js +0 -1
  265. package/dist/utils/pages.d.ts +22 -11
  266. package/dist/utils/pages.js +70 -30
  267. package/dist/utils/privacy-regions.d.ts +19 -0
  268. package/dist/utils/privacy-regions.js +91 -0
  269. package/dist/utils/publish-form-data.d.ts +4 -5
  270. package/dist/utils/publish-form-data.js +2 -3
  271. package/dist/utils/publish-policy.d.ts +10 -23
  272. package/dist/utils/publish-policy.js +63 -116
  273. package/dist/utils/query-client.d.ts +2 -0
  274. package/dist/utils/query-client.js +10 -1
  275. package/dist/utils/runtime-paths.d.ts +4 -4
  276. package/dist/utils/runtime-paths.js +6 -8
  277. package/dist/utils/runtime-upload.d.ts +4 -0
  278. package/dist/utils/runtime-upload.js +5 -0
  279. package/dist/utils/secure-local-file.d.ts +3 -3
  280. package/dist/utils/secure-local-file.js +18 -24
  281. package/dist/utils/space-config.d.ts +11 -14
  282. package/dist/utils/space-config.js +10 -16
  283. package/dist/utils/static-runtime-policy.d.ts +5 -8
  284. package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
  285. package/dist/utils/static-runtime-policy.generated.js +70 -0
  286. package/dist/utils/static-runtime-policy.js +17 -84
  287. package/dist/utils/storage-policy.js +1 -2
  288. package/dist/utils/upload-session.js +8 -14
  289. package/dist/utils/version-path.js +11 -19
  290. package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
  291. package/dist/utils/wpcom-auth-redirects.js +1 -4
  292. package/dist/vocabulary.d.ts +7 -7
  293. package/dist/vocabulary.js +30 -16
  294. package/package.json +14 -2
  295. package/dist/agents/client-registry.d.ts +0 -22
  296. package/dist/agents/client-registry.js +0 -41
  297. package/dist/docs/agent-handoff-document.d.ts +0 -15
  298. package/dist/docs/agent-handoff-document.js +0 -180
  299. package/dist/docs/agent-solutions.d.ts +0 -110
  300. package/dist/docs/agent-solutions.js +0 -183
  301. package/dist/utils/query-keys.d.ts +0 -84
  302. package/dist/utils/query-keys.js +0 -108
@@ -1,17 +1,15 @@
1
- // THE single source of truth for Spacefast hostnames and per-service origins,
2
- // across every environment. Brand strings, app URL builders, CORS allowlists,
3
- // cookie scope, and redirect rules all derive from here so a domain change is a
4
- // one-file edit instead of the ~100-site sweep this migration had to untangle.
1
+ // THE single source of truth for Spacefast hostnames and per-service origins.
2
+ // Brand strings, app URL builders, CORS allowlists, cookie scope, and redirect
3
+ // rules all derive from here, so a domain change is a one-file edit.
5
4
  //
6
- // Env-var NAMES intentionally stay `SPACEFAST_*` (see migration plan); only the
7
- // VALUES they carry are produced from this registry.
5
+ // Env-var NAMES stay `SPACEFAST_*`; only the VALUES come from this registry.
8
6
  /** The production apex. Everything else about prod derives from this string. */
9
7
  export const PROD_ENV_DOMAIN = "spacefast.com";
10
8
  /** The local-dev apex (portless serves every subdomain over HTTPS). */
11
9
  export const DEV_ENV_DOMAIN = "sf.localhost";
12
10
  /** The deployed staging apex. Not local: staging is a hosted environment. */
13
11
  export const STAGING_ENV_DOMAIN = "stattic.net";
14
- /** The deployed dev apex distinct from local dev, which stays on sf.localhost. */
12
+ /** The deployed dev apex. Local dev is separate and stays on sf.localhost. */
15
13
  export const DEV_DEPLOY_ENV_DOMAIN = "stattic.xyz";
16
14
  export const HOSTED_ENV_DOMAINS = {
17
15
  dev: DEV_DEPLOY_ENV_DOMAIN,
@@ -37,12 +35,11 @@ export function hostedEnvDomain(environment) {
37
35
  return hosted ? HOSTED_ENV_DOMAINS[hosted] : null;
38
36
  }
39
37
  /**
40
- * Construct the full per-service host map from a single env domain
41
- * (`spacefast.com`, `stattic.net`, `sf.localhost`, …). One knob services are
42
- * always `<service>.<domain>` over https, with three deliberate exceptions: the
43
- * marketing site sits on the bare apex of a hosted environment (so staging
44
- * rehearses production's shape rather than a `www.` variant of it), and both
45
- * Git push and the internal handbook live on their own apexes in prod.
38
+ * The per-service host map for one env domain (`spacefast.com`, `sf.localhost`,
39
+ * …). Services are `<service>.<domain>` over https, with three exceptions: the
40
+ * marketing site takes the bare apex of a hosted environment (so staging
41
+ * rehearses production's shape), and Git push and the internal handbook get
42
+ * their own apexes in prod.
46
43
  */
47
44
  export function envDomainsFor(domain) {
48
45
  const prod = domain === PROD_ENV_DOMAIN;
@@ -65,13 +62,11 @@ export function envDomainsFor(domain) {
65
62
  };
66
63
  }
67
64
  const PROD = envDomainsFor(PROD_ENV_DOMAIN);
68
- // Local dev runs every service under *.sf.localhost via portless (HTTPS, no
69
- // ports in the URL portless proxies the raw dev ports). `remove all other
70
- // portless records` per the migration spec: sf.localhost is the only TLD.
65
+ // Local dev runs every service under *.sf.localhost via portless, which proxies
66
+ // the raw dev ports so URLs carry no port. sf.localhost is the only local TLD.
71
67
  const DEV = envDomainsFor(DEV_ENV_DOMAIN);
72
- // The test stack shares the sf.localhost hostname scheme but runs as its own
73
- // isolated compose project on its own ports/resources (see ports config), so it
74
- // can run side-by-side with dev. URL host scheme is identical to dev.
68
+ // The test stack uses dev's hostname scheme but its own isolated compose project
69
+ // and ports (see ports config), so the two run side by side.
75
70
  const TEST = DEV;
76
71
  const BY_ENV = {
77
72
  dev: DEV,
@@ -83,8 +78,16 @@ export function serviceOrigin(service, env) {
83
78
  const d = BY_ENV[env];
84
79
  return `${d.protocol}://${d.hosts[service]}`;
85
80
  }
86
- /** Base URL every documentation link catalog entries, skills, error pages — resolves against. */
81
+ /** Base URL every documentation link resolves against: catalog entries, skills, error pages. */
87
82
  export const DOCS_BASE_URL = `${serviceOrigin("www", "prod")}/docs`;
83
+ /**
84
+ * The API origin every first-party client falls back to when nothing else names
85
+ * a provider: no `--api-url`, no `SPACEFAST_API_URL`, no saved profile or
86
+ * checkout link. The CLI and the MCP server share this one literal so a caller
87
+ * cannot be pointed at two different "defaults" depending on which surface it
88
+ * came through.
89
+ */
90
+ export const DEFAULT_API_URL = serviceOrigin("api", "prod");
88
91
  // --- Apexes that are NOT spacefast.com subdomains -------------------------------
89
92
  /**
90
93
  * The production infrastructure apex. Committed artifacts and anything
@@ -98,29 +101,24 @@ export const DEV_VIEW_FAST_APEX = "preview.space";
98
101
  /**
99
102
  * Resolve the infrastructure apex, allowing an explicit deployment override.
100
103
  *
101
- * Only production has an apex here. Every other hosted environment names its
102
- * own through `SPACEFAST_VIEW_FAST_APEX`, because a space apex is a zone that
103
- * has to exist, be delegated, and be attached at the provider not a name this
104
- * registry can pick on a deployment's behalf. Two environments allocating from
105
- * one apex race for the same hostname, and the one that loses is a customer's
106
- * site.
104
+ * Only production has an apex here. Every other hosted environment names its own
105
+ * through `SPACEFAST_VIEW_FAST_APEX`, because a space apex is a zone that must
106
+ * exist, be delegated, and be attached at the provider. Two environments
107
+ * allocating from one apex race for the same hostname, and the loser is a
108
+ * customer's site.
107
109
  *
108
- * When nothing names the apex, this falls back to the local one rather than
109
- * production's: a caller that cannot say which environment it is has no claim
110
- * on production's namespace. Holding deployments to naming it belongs to the
111
- * process that mints hostnames, not to this module the control plane's env
112
- * schema refuses to boot without it, while builds and browser bundles import
113
- * this registry for its host scheme and must not explode over an environment
114
- * they do not have.
110
+ * When nothing names the apex this falls back to the local one: a caller that
111
+ * cannot say which environment it is has no claim on production's namespace. The
112
+ * control plane's env schema is what holds deployments to naming it; builds and
113
+ * browser bundles import this registry only for its host scheme.
115
114
  */
116
115
  export function resolveViewFastApex(environment) {
117
116
  const explicit = environment.SPACEFAST_VIEW_FAST_APEX?.trim().toLowerCase();
118
117
  if (explicit)
119
118
  return explicit;
120
119
  // SPACEFAST_ENV names a hosted environment only on a deployed service, where
121
- // NODE_ENV is production the same split the control plane's env-domain
122
- // derivation makes. `dev` is also the local stack's name, and a local stack
123
- // must keep the local apex rather than allocate under hosted dev's.
120
+ // NODE_ENV is production. `dev` is also the local stack's name, and a local
121
+ // stack must keep the local apex rather than allocate under hosted dev's.
124
122
  const nodeEnvironment = environment.NODE_ENV?.trim().toLowerCase();
125
123
  if (!["prod", "production"].includes(nodeEnvironment ?? ""))
126
124
  return DEV_VIEW_FAST_APEX;
@@ -130,8 +128,54 @@ export function resolveViewFastApex(environment) {
130
128
  }
131
129
  /** Infrastructure apex used for public managed/custom domains. */
132
130
  export const VIEW_FAST_APEX = resolveViewFastApex(typeof process === "undefined" ? {} : process.env);
133
- // Default space hostnames are `{hostLabel}.{VIEW_FAST_APEX}`; internal
134
- // management hostnames share the same apex under the reserved `wpc-manage-`
135
- // label prefix and are never public space URLs.
136
- /** Reserved first-label prefix for the management namespace; users may not register it. */
137
- export const MANAGEMENT_LABEL_PREFIX = "wpc-manage-";
131
+ // Default space hostnames are `{hostLabel}.{VIEW_FAST_APEX}`.
132
+ // --- Test-mode (simulated) apex -------------------------------------------------
133
+ /**
134
+ * The Spacefast-owned apex under which a LINKED TEST TENANT's simulated sites and
135
+ * hostname namespaces materialize (partner-operations spec §1). It is never
136
+ * served by real infrastructure — nothing points DNS at it and no cert is
137
+ * provisioned — so it exists purely as a collision-free namespace: a test
138
+ * tenant's hostnames are `{label}.{tenant}.{TEST_APEX}` (per-tenant, see
139
+ * `testApexForTenant`), which is also the marker the runtime-API transport uses
140
+ * to recognize a simulated box and short-circuit rather than reach a real one.
141
+ *
142
+ * Defaults to `test.{VIEW_FAST_APEX}` so every environment gets a distinct test
143
+ * apex for free; a deployment can override it with `SPACEFAST_TEST_APEX`.
144
+ */
145
+ export function resolveTestApex(environment) {
146
+ const explicit = environment.SPACEFAST_TEST_APEX?.trim().toLowerCase();
147
+ if (explicit)
148
+ return explicit;
149
+ return `test.${resolveViewFastApex(environment)}`;
150
+ }
151
+ /** The resolved test-mode apex for this process. */
152
+ // oxlint-disable-next-line anti-slop/no-runtime-typeof -- isomorphic process guard: this registry is imported by browser bundles where `process` is undefined (same guard as VIEW_FAST_APEX above).
153
+ export const TEST_APEX = resolveTestApex(typeof process === "undefined" ? {} : process.env);
154
+ // A tenant id (`ten_<rand>`) as a DNS label: lowercase, `_`→`-`, non-label chars
155
+ // dropped. Every test tenant gets its OWN apex under `TEST_APEX` so the GLOBAL
156
+ // `hostname_namespace_apex_uq` never collides at the second test tenant, and so
157
+ // a test label can never steer a live space.
158
+ export function testApexForTenant(tenantId, testApex = TEST_APEX) {
159
+ const label = tenantId
160
+ .trim()
161
+ .toLowerCase()
162
+ .replaceAll("_", "-")
163
+ .replace(/[^a-z0-9-]/g, "")
164
+ .replace(/^-+|-+$/g, "");
165
+ return `${label || "tenant"}.${testApex}`;
166
+ }
167
+ /**
168
+ * Whether a hostname belongs to the test-mode apex (a simulated box).
169
+ *
170
+ * STRICTLY a suffix check — the apex ITSELF is never a simulated hostname. Every
171
+ * simulated hostname is `{label}.{tenant}.{TEST_APEX}` (two labels deep), while
172
+ * the bare apex is reachable as a LIVE space's hostname: `TEST_APEX` defaults to
173
+ * `test.{VIEW_FAST_APEX}`, so a live space slugged `test` is served at exactly
174
+ * `test.view.fast`. Matching the apex would make every Runtime-API call for that
175
+ * space short-circuit to a synthetic response — engine installs reporting
176
+ * `installed` and publishes reporting success while nothing ever reaches the box.
177
+ */
178
+ export function isTestApexHostname(hostname, testApex = TEST_APEX) {
179
+ const normalized = hostname.trim().toLowerCase().replace(/\.$/, "");
180
+ return normalized.endsWith(`.${testApex}`);
181
+ }
@@ -1,3 +1,2 @@
1
- // Public entry for the centralized domain/URL registry.
2
- // Consumers import from "@spacefast/common/config".
1
+ // Consumers import the domain/URL registry from "@spacefast/common/config".
3
2
  export * from "./domains.js";
@@ -4,20 +4,13 @@ export const abuseReportCategorySchema = z
4
4
  .enum(["malware", "phishing", "spam", "copyright", "illegal_content", "other"])
5
5
  .describe("Reported abuse category.");
6
6
  export const abuseReportCreateSchema = z.object({
7
- url: z.string().url().describe("Full URL of the content being reported."),
7
+ url: z.string().url().describe("URL of the reported content."),
8
8
  category: abuseReportCategorySchema,
9
- description: z
10
- .string()
11
- .trim()
12
- .min(10)
13
- .max(5000)
14
- .describe("What the reporter saw; 10-5000 characters."),
9
+ description: z.string().trim().min(10).max(5000).describe("What the reporter saw."),
15
10
  });
16
11
  export const abuseReportStatusSchema = z
17
12
  .enum(["new", "reviewing", "actioned", "closed"])
18
13
  .describe("Triage status of the report.");
19
- // Triage state machine: reports move forward through review; `closed` reports
20
- // can be reopened into `reviewing` (and only there) when new evidence lands.
21
14
  export const ABUSE_REPORT_STATUS_TRANSITIONS = {
22
15
  new: ["reviewing", "actioned", "closed"],
23
16
  reviewing: ["actioned", "closed"],
@@ -29,33 +22,25 @@ export const abuseReportSchema = z.object({
29
22
  status: abuseReportStatusSchema,
30
23
  category: abuseReportCategorySchema,
31
24
  url: z.string().describe("Reported URL."),
32
- spaceId: z
33
- .string()
34
- .nullable()
35
- .describe("Space the reported hostname resolved to, when resolution succeeds."),
25
+ spaceId: z.string().nullable().describe("Space the reported hostname resolved to."),
36
26
  createdAt: z.string().datetime().describe("When the report was filed."),
37
27
  });
38
- // Operator triage view: includes intake details the public receipt omits.
28
+ // Intake details the public receipt omits.
39
29
  export const superadminAbuseReportSchema = abuseReportSchema.extend({
40
- hostname: z.string().describe("Normalized hostname extracted from the reported URL."),
41
- tenantId: z.string().nullable().describe("Tenant owning the resolved space, when resolved."),
30
+ hostname: z.string().describe("Normalized hostname from the reported URL."),
31
+ tenantId: z.string().nullable().describe("Tenant owning the resolved space."),
42
32
  description: z.string().describe("Reporter-supplied description."),
43
33
  updatedAt: z.string().datetime().describe("Last triage update."),
44
34
  });
45
35
  export const superadminAbuseReportListQuerySchema = cursorListQuerySchema.extend({
46
- status: abuseReportStatusSchema.optional().describe("Filter the triage list by status."),
47
- spaceId: z
48
- .string()
49
- .trim()
50
- .min(1)
51
- .optional()
52
- .describe("Filter to reports that resolved to one Space."),
36
+ status: abuseReportStatusSchema.optional().describe("Filter by status."),
37
+ spaceId: z.string().trim().min(1).optional().describe("Filter to reports for this Space."),
53
38
  hostname: z
54
39
  .string()
55
40
  .trim()
56
41
  .min(1)
57
42
  .optional()
58
- .describe("Filter by the normalized reported hostname; matching is case-insensitive."),
43
+ .describe("Filter by normalized hostname, case-insensitively."),
59
44
  });
60
45
  export const superadminAbuseReportPatchSchema = z.object({
61
46
  status: abuseReportStatusSchema.describe("New triage status; must be a valid transition from the current status."),
@@ -0,0 +1,86 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The scopes any interactive authorization may grant — THE list every surface
4
+ * derives from. The device approval page, OAuth consent, the CLI receipt, and
5
+ * the server's approval validator all import this instead of keeping copies.
6
+ *
7
+ * This is the shared API set — NOT the granular `spaces:publish` /
8
+ * `builds:trigger` scopes, whose actions `publish:write` already covers. A
9
+ * person approving a device never sees two checkboxes that mean the same grant,
10
+ * and this set equals the hosted-MCP resource's scopes so the two converge.
11
+ */
12
+ export declare const APPROVABLE_SCOPES: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write"];
13
+ export type ApprovableScope = (typeof APPROVABLE_SCOPES)[number];
14
+ /**
15
+ * Whether a scope, when approved, is bounded by the holder's team role. This is
16
+ * DERIVED from `isTenantAdmissionAction` — the same declaration the credential
17
+ * compiler mints from — so it can never disagree with what actually gets minted:
18
+ *
19
+ * - "team": grants at least one team-role action — authority OVER a team's
20
+ * resources, bounded by the approver's LIVE role there on every request.
21
+ * - "account": every action is tenant-admission (never role-bounded), so no
22
+ * team role gates it and any member can approve it (creating a
23
+ * not-yet-existing team).
24
+ *
25
+ * Drives grantability (`scopeGrantableByRole`); the compiler owns the resource.
26
+ */
27
+ export type ScopePlane = "team" | "account";
28
+ export declare const SCOPE_PLANES: Record<ApprovableScope, ScopePlane>;
29
+ export declare const ACCESS_PROFILE_IDS: readonly ["read", "agent"];
30
+ export type AccessProfileId = (typeof ACCESS_PROFILE_IDS)[number];
31
+ export declare const AccessProfileIdSchema: z.ZodEnum<{
32
+ read: "read";
33
+ agent: "agent";
34
+ }>;
35
+ export type AccessProfile = Readonly<{
36
+ id: AccessProfileId;
37
+ /** The ONE name every surface prints: CLI request line and receipt, approval
38
+ * page heading, consent screen, ledger row, email. */
39
+ label: string;
40
+ /** One sentence a person reads INSTEAD of the scope list. Reviewed copy —
41
+ * the derived scope list under it stays authoritative, so this can only ever
42
+ * be stale, never wrong about what is granted. */
43
+ blurb: string;
44
+ /** The negative space: notable things this profile deliberately can't do,
45
+ * shown under the blurb. Optional — omit when there's nothing worth calling
46
+ * out (a read-only profile speaks for itself). */
47
+ limits?: string;
48
+ scopes: readonly ApprovableScope[];
49
+ }>;
50
+ /**
51
+ * Named grant profiles. A profile is REQUEST INTENT — one word on device start
52
+ * with a server-owned meaning — never authority. Scopes are the grant
53
+ * vocabulary; actions are authority. The default is deliberately the full
54
+ * approvable set, matching what a `vercel login`/`gh auth login` grants:
55
+ * everything the credential's holder can do, capped per team by their live
56
+ * role at request time.
57
+ */
58
+ export declare const ACCESS_PROFILES: {
59
+ readonly read: {
60
+ readonly id: "read";
61
+ readonly label: "Read-only access";
62
+ readonly blurb: "Read your teams, sites, and domains. Changes nothing.";
63
+ readonly scopes: readonly ["teams:read", "spaces:read", "domains:read"];
64
+ };
65
+ readonly agent: {
66
+ readonly id: "agent";
67
+ readonly label: "Agent access";
68
+ readonly blurb: "Create and publish sites, manage domains and DNS, create teams, and use Spacefast tools.";
69
+ readonly limits: "It can't delete sites, manage team members, change billing, or mint credentials.";
70
+ readonly scopes: readonly ["teams:read", "teams:create", "spaces:read", "spaces:write", "spaces:rename", "publish:write", "domains:read", "domains:write"];
71
+ };
72
+ };
73
+ export declare const DEFAULT_ACCESS_PROFILE_ID: AccessProfileId;
74
+ /** Parse an untyped scope list (wire, storage) into approvable scopes, in
75
+ * checklist order, deduplicated. Unknown entries grant nothing and are dropped. */
76
+ export declare function approvableScopesFrom(scopes: readonly string[] | null | undefined): ApprovableScope[];
77
+ /** The profile a scope set IS — exact set equality — or null once edited.
78
+ * Profiles are pinned distinct by test, so this inverse is total. */
79
+ export declare function accessProfileForScopes(scopes: readonly string[] | null | undefined): AccessProfile | null;
80
+ /**
81
+ * What every surface prints for a granted scope set: a profile's label, or
82
+ * `Custom (Agent access, minus …)` when the set is a strict subset of a
83
+ * profile, or plain `Custom`. Derived, never stored — a profile redefinition
84
+ * can never make an old receipt lie about its scopes.
85
+ */
86
+ export declare function accessGrantLabel(scopes: readonly string[] | null | undefined, scopeLabel?: (scope: ApprovableScope) => string): string;
@@ -0,0 +1,89 @@
1
+ import { z } from "zod";
2
+ import { OAUTH_SHARED_API_RESOURCE_SCOPES } from "./oauth-resources.js";
3
+ import { isTenantAdmissionAction, oauthScopeActions } from "./oauth-scope-actions.js";
4
+ /**
5
+ * The scopes any interactive authorization may grant — THE list every surface
6
+ * derives from. The device approval page, OAuth consent, the CLI receipt, and
7
+ * the server's approval validator all import this instead of keeping copies.
8
+ *
9
+ * This is the shared API set — NOT the granular `spaces:publish` /
10
+ * `builds:trigger` scopes, whose actions `publish:write` already covers. A
11
+ * person approving a device never sees two checkboxes that mean the same grant,
12
+ * and this set equals the hosted-MCP resource's scopes so the two converge.
13
+ */
14
+ export const APPROVABLE_SCOPES = [...OAUTH_SHARED_API_RESOURCE_SCOPES];
15
+ export const SCOPE_PLANES =
16
+ // SAFETY: mapped over every APPROVABLE_SCOPES entry, so the record is total.
17
+ Object.fromEntries(APPROVABLE_SCOPES.map((scope) => [
18
+ scope,
19
+ oauthScopeActions([scope]).every(isTenantAdmissionAction) ? "account" : "team",
20
+ ]));
21
+ export const ACCESS_PROFILE_IDS = ["read", "agent"];
22
+ export const AccessProfileIdSchema = z.enum(ACCESS_PROFILE_IDS);
23
+ /**
24
+ * Named grant profiles. A profile is REQUEST INTENT — one word on device start
25
+ * with a server-owned meaning — never authority. Scopes are the grant
26
+ * vocabulary; actions are authority. The default is deliberately the full
27
+ * approvable set, matching what a `vercel login`/`gh auth login` grants:
28
+ * everything the credential's holder can do, capped per team by their live
29
+ * role at request time.
30
+ */
31
+ export const ACCESS_PROFILES = {
32
+ // Read-only. It can open a hosted MCP session and invoke tools (each tool call
33
+ // is re-gated by its own API scope, so only reads succeed), and it can observe
34
+ // the MCP console. It cannot MANAGE the console — closing sessions and
35
+ // approving paused executions are gated on `spaces:write` (see mcp/service.ts)
36
+ // — so it still changes nothing.
37
+ read: {
38
+ id: "read",
39
+ label: "Read-only access",
40
+ blurb: "Read your teams, sites, and domains. Changes nothing.",
41
+ scopes: ["teams:read", "spaces:read", "domains:read"],
42
+ },
43
+ agent: {
44
+ id: "agent",
45
+ label: "Agent access",
46
+ blurb: "Create and publish sites, manage domains and DNS, create teams, and use Spacefast tools.",
47
+ limits: "It can't delete sites, manage team members, change billing, or mint credentials.",
48
+ scopes: [...APPROVABLE_SCOPES],
49
+ },
50
+ };
51
+ export const DEFAULT_ACCESS_PROFILE_ID = "agent";
52
+ function isApprovableScope(scope) {
53
+ return APPROVABLE_SCOPES.some((known) => known === scope);
54
+ }
55
+ /** Parse an untyped scope list (wire, storage) into approvable scopes, in
56
+ * checklist order, deduplicated. Unknown entries grant nothing and are dropped. */
57
+ export function approvableScopesFrom(scopes) {
58
+ const requested = new Set(scopes ?? []);
59
+ return APPROVABLE_SCOPES.filter((scope) => requested.has(scope));
60
+ }
61
+ /** The profile a scope set IS — exact set equality — or null once edited.
62
+ * Profiles are pinned distinct by test, so this inverse is total. */
63
+ export function accessProfileForScopes(scopes) {
64
+ const granted = new Set(approvableScopesFrom(scopes));
65
+ return (Object.values(ACCESS_PROFILES).find((profile) => profile.scopes.length === granted.size &&
66
+ profile.scopes.every((scope) => granted.has(scope))) ?? null);
67
+ }
68
+ /**
69
+ * What every surface prints for a granted scope set: a profile's label, or
70
+ * `Custom (Agent access, minus …)` when the set is a strict subset of a
71
+ * profile, or plain `Custom`. Derived, never stored — a profile redefinition
72
+ * can never make an old receipt lie about its scopes.
73
+ */
74
+ export function accessGrantLabel(scopes, scopeLabel = (scope) => scope) {
75
+ const granted = approvableScopesFrom(scopes);
76
+ const exact = accessProfileForScopes(granted);
77
+ if (exact) {
78
+ return exact.label;
79
+ }
80
+ const grantedSet = new Set(granted);
81
+ // Narrowest containing profile names the diff; `read` precedes `agent`.
82
+ const profiles = Object.values(ACCESS_PROFILES);
83
+ const superset = profiles.find((profile) => granted.length > 0 && granted.every((scope) => profile.scopes.includes(scope)));
84
+ if (!superset) {
85
+ return "Custom";
86
+ }
87
+ const missing = superset.scopes.filter((scope) => !grantedSet.has(scope));
88
+ return `Custom (${superset.label}, minus ${missing.map((scope) => scopeLabel(scope)).join(", ")})`;
89
+ }
@@ -10,16 +10,14 @@ export declare const spaceAccessPresetSchema: z.ZodEnum<{
10
10
  export type SpaceAccessPreset = z.infer<typeof spaceAccessPresetSchema>;
11
11
  /**
12
12
  * The sharing vocabulary. Capabilities are the ground truth; a role is a named
13
- * set of them, ordered from least to most. This is the only role enum and the
14
- * only role⇄capability mapping in the product every surface (dashboard, CLI,
15
- * API, comments) names access with these four words and derives capabilities
16
- * here rather than keeping its own preset list.
13
+ * set of them, ordered from least to most. This is the product's only role enum
14
+ * and role⇄capability mapping: every surface derives its capabilities here.
17
15
  */
18
16
  export declare const ACCESS_ROLES: readonly ["viewer", "commenter", "editor", "manager"];
19
17
  export declare const accessRoleSchema: z.ZodEnum<{
18
+ editor: "editor";
20
19
  viewer: "viewer";
21
20
  commenter: "commenter";
22
- editor: "editor";
23
21
  manager: "manager";
24
22
  }>;
25
23
  export type AccessRole = z.infer<typeof accessRoleSchema>;
@@ -31,15 +29,13 @@ export declare const ACCESS_ROLE_CAPABILITIES: {
31
29
  };
32
30
  export declare function accessRoleCapabilities(role: AccessRole): GrantCapability[];
33
31
  /**
34
- * The role a capability set amounts to, named by the strongest capability it
35
- * carries. A Grant assembled capability-by-capability need not match a role
36
- * exactly; this reports the role it reaches, never more.
32
+ * The role a capability set amounts to: the strongest role it reaches, never
33
+ * more. A Grant assembled capability-by-capability need not match one exactly.
37
34
  */
38
35
  export declare function accessRoleForCapabilities(capabilities: readonly GrantCapability[]): AccessRole;
39
36
  /**
40
- * Roles a credential-backed audience can carry. A Link or a password is a
41
- * secret anyone can forward, so it never publishes and never manages access —
42
- * the same boundary `grantSchema` enforces on the capabilities themselves.
37
+ * Roles a forwardable secret (a Link, a password) can carry. It never publishes
38
+ * and never manages access; `grantSchema` enforces that on capabilities too.
43
39
  */
44
40
  export declare const VISITOR_ACCESS_ROLES: readonly ["viewer", "commenter"];
45
41
  export type VisitorAccessRole = (typeof VISITOR_ACCESS_ROLES)[number];
@@ -70,18 +66,17 @@ export declare function accountPrincipal(userId: string): AccountPrincipal;
70
66
  /** The user id behind an account principal; null for anonymous or malformed. */
71
67
  export declare function accountPrincipalUserId(principal: string | undefined | null): string | null;
72
68
  /**
73
- * The identity an authority reference names on its own, if any. Credential
74
- * classes name nobody. This is the ONE place a class maps to an identity: at
75
- * the exchange that just authenticated it, never downstream.
69
+ * The identity an authority reference names on its own, if any. The ONE place a
70
+ * class maps to an identity: at the exchange that authenticated it, never after.
76
71
  */
77
72
  export declare function principalForAuthority(reference: AuthorityReference): IdentifiedPrincipal | undefined;
78
73
  export declare const personGrantSchema: z.ZodObject<{
79
74
  id: z.ZodString;
80
75
  scope: z.ZodString;
81
76
  role: z.ZodEnum<{
77
+ editor: "editor";
82
78
  viewer: "viewer";
83
79
  commenter: "commenter";
84
- editor: "editor";
85
80
  manager: "manager";
86
81
  }>;
87
82
  target: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -120,9 +115,9 @@ export declare const spacePersonSchema: z.ZodObject<{
120
115
  id: z.ZodString;
121
116
  scope: z.ZodString;
122
117
  role: z.ZodEnum<{
118
+ editor: "editor";
123
119
  viewer: "viewer";
124
120
  commenter: "commenter";
125
- editor: "editor";
126
121
  manager: "manager";
127
122
  }>;
128
123
  target: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -175,9 +170,9 @@ export declare const spacePeopleListSchema: z.ZodObject<{
175
170
  id: z.ZodString;
176
171
  scope: z.ZodString;
177
172
  role: z.ZodEnum<{
173
+ editor: "editor";
178
174
  viewer: "viewer";
179
175
  commenter: "commenter";
180
- editor: "editor";
181
176
  manager: "manager";
182
177
  }>;
183
178
  target: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -373,9 +368,9 @@ export declare const canonicalAccessRequestStatusSchema: z.ZodEnum<{
373
368
  denied: "denied";
374
369
  }>;
375
370
  export declare const accessRequestRoleSchema: z.ZodEnum<{
371
+ editor: "editor";
376
372
  viewer: "viewer";
377
373
  commenter: "commenter";
378
- editor: "editor";
379
374
  manager: "manager";
380
375
  }>;
381
376
  export type AccessRequestRole = z.infer<typeof accessRequestRoleSchema>;
@@ -386,9 +381,9 @@ export declare const canonicalAccessRequestSchema: z.ZodObject<{
386
381
  email: z.ZodString;
387
382
  scope: z.ZodString;
388
383
  requestedRole: z.ZodEnum<{
384
+ editor: "editor";
389
385
  viewer: "viewer";
390
386
  commenter: "commenter";
391
- editor: "editor";
392
387
  manager: "manager";
393
388
  }>;
394
389
  message: z.ZodNullable<z.ZodString>;
@@ -424,9 +419,9 @@ export type LinkCapabilities = z.infer<typeof linkCapabilitiesSchema>;
424
419
  export declare const personGrantWriteSchema: z.ZodObject<{
425
420
  scope: z.ZodString;
426
421
  role: z.ZodEnum<{
422
+ editor: "editor";
427
423
  viewer: "viewer";
428
424
  commenter: "commenter";
429
- editor: "editor";
430
425
  manager: "manager";
431
426
  }>;
432
427
  target: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -446,9 +441,9 @@ export declare const spacePersonInviteWriteSchema: z.ZodObject<{
446
441
  grants: z.ZodArray<z.ZodObject<{
447
442
  scope: z.ZodString;
448
443
  role: z.ZodEnum<{
444
+ editor: "editor";
449
445
  viewer: "viewer";
450
446
  commenter: "commenter";
451
- editor: "editor";
452
447
  manager: "manager";
453
448
  }>;
454
449
  target: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -469,9 +464,9 @@ export declare const spacePersonGrantSetWriteSchema: z.ZodObject<{
469
464
  grants: z.ZodArray<z.ZodObject<{
470
465
  scope: z.ZodString;
471
466
  role: z.ZodEnum<{
467
+ editor: "editor";
472
468
  viewer: "viewer";
473
469
  commenter: "commenter";
474
- editor: "editor";
475
470
  manager: "manager";
476
471
  }>;
477
472
  target: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -564,9 +559,9 @@ export declare const canonicalAccessRequestCreateSchema: z.ZodObject<{
564
559
  email: z.ZodString;
565
560
  scope: z.ZodString;
566
561
  requestedRole: z.ZodDefault<z.ZodEnum<{
562
+ editor: "editor";
567
563
  viewer: "viewer";
568
564
  commenter: "commenter";
569
- editor: "editor";
570
565
  manager: "manager";
571
566
  }>>;
572
567
  message: z.ZodOptional<z.ZodString>;
@@ -574,9 +569,9 @@ export declare const canonicalAccessRequestCreateSchema: z.ZodObject<{
574
569
  export declare const canonicalAccessRequestApproveSchema: z.ZodObject<{
575
570
  scope: z.ZodOptional<z.ZodString>;
576
571
  role: z.ZodOptional<z.ZodEnum<{
572
+ editor: "editor";
577
573
  viewer: "viewer";
578
574
  commenter: "commenter";
579
- editor: "editor";
580
575
  manager: "manager";
581
576
  }>>;
582
577
  }, z.core.$strip>;
@@ -631,9 +626,8 @@ export declare const teamSpaceAccessDefaultWriteSchema: z.ZodObject<{
631
626
  export declare const ACCESS_TOKEN_KID = "spacefast-runtime-v1";
632
627
  export declare const ACCESS_TOKEN_ALG = "EdDSA";
633
628
  /**
634
- * The claim-schema version every platform token carries in `v`. One signer,
635
- * one claim contract: a verifier that understands v1 refuses a token minted
636
- * under a later shape instead of reading unknown claims optimistically.
629
+ * The claim-schema version every platform token carries in `v`. A verifier that
630
+ * understands v1 refuses a token minted under a later shape.
637
631
  */
638
632
  export declare const PLATFORM_TOKEN_CLAIM_VERSION: 1;
639
633
  export declare const BLOB_GATE_DOWNLOAD_TTL_SECONDS: number;