@spacefast/common 0.0.26 → 0.2.2

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 +192 -7
  38. package/dist/contracts/builds.js +84 -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 +273 -7
  79. package/dist/contracts/error-code-meta.js +81 -5
  80. package/dist/contracts/error-codes.d.ts +5 -5
  81. package/dist/contracts/error-codes.js +79 -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 +121 -10
  110. package/dist/contracts/oauth-resources.js +130 -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 +2102 -1
  210. package/dist/docs/error-docs.js +285 -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
@@ -0,0 +1,43 @@
1
+ import { OAUTH_SCOPE_COPY, oauthScopeCopy, type OAuthScopeCopy, type OAuthScopeId, type OAuthScopeRiskTint } from "./oauth-resources.js";
2
+ /**
3
+ * The one vocabulary every authorization surface renders.
4
+ *
5
+ * Consent, the elevation diff, device approve, ledger chips, approval and grant
6
+ * emails, and the CLI's approval prose all read from here, so a permission
7
+ * never has one name in the browser and another in the inbox. Raw scope ids and
8
+ * purpose codes belong in developer views only.
9
+ *
10
+ * Scope copy is re-exported from `oauth-resources` rather than duplicated: the
11
+ * scope list and its descriptions are the OAuth wire contract, and a second
12
+ * copy of it is a second thing to drift.
13
+ */
14
+ export { OAUTH_SCOPE_COPY as GRANT_SCOPE_COPY, oauthScopeCopy as grantScopeCopy, type OAuthScopeCopy as GrantScopeCopy, type OAuthScopeId as GrantScopeId, type OAuthScopeRiskTint as GrantRiskTint, };
15
+ export type GrantScopeCopyEntry = OAuthScopeCopy & {
16
+ id: string;
17
+ };
18
+ /** Scope copy for a whole set, in the order given, ready to render as a list. */
19
+ export declare function grantScopeCopyList(scopes: readonly string[]): GrantScopeCopyEntry[];
20
+ /**
21
+ * Why a grant or decision is being asked for, in the user's language.
22
+ *
23
+ * Purpose strings are SERVER-OWNED. Only these codes and templates render as
24
+ * the reason a grant is requested; client identity is displayed separately and
25
+ * escaped. Client-authored purpose text is a consent-spoofing surface and is
26
+ * never accepted (§4.5).
27
+ *
28
+ * Each entry reads as the completion of "… is asking to <copy>".
29
+ */
30
+ export declare const GRANT_PURPOSE_COPY: {
31
+ readonly "publish.confirm": "publish a new version";
32
+ readonly "deploy.confirm": "deploy a site";
33
+ readonly "version.rollback.confirm": "roll a site back to an earlier version";
34
+ readonly "domain.purchase.confirm": "purchase a domain";
35
+ readonly "domain.dns.confirm": "change domain DNS";
36
+ readonly "device.authorize": "connect the Spacefast CLI";
37
+ readonly "agent_handoff.redeem": "continue a Spacefast handoff";
38
+ readonly "claim.continue": "continue a claimed site";
39
+ readonly "oauth.connect": "connect to Spacefast";
40
+ };
41
+ export type GrantPurposeCode = keyof typeof GRANT_PURPOSE_COPY;
42
+ /** Never throws: an unknown code renders the neutral fallback, never the code. */
43
+ export declare function grantPurposeCopy(purposeCode: string): string;
@@ -0,0 +1,44 @@
1
+ import { OAUTH_SCOPE_COPY, oauthScopeCopy, } from "./oauth-resources.js";
2
+ /**
3
+ * The one vocabulary every authorization surface renders.
4
+ *
5
+ * Consent, the elevation diff, device approve, ledger chips, approval and grant
6
+ * emails, and the CLI's approval prose all read from here, so a permission
7
+ * never has one name in the browser and another in the inbox. Raw scope ids and
8
+ * purpose codes belong in developer views only.
9
+ *
10
+ * Scope copy is re-exported from `oauth-resources` rather than duplicated: the
11
+ * scope list and its descriptions are the OAuth wire contract, and a second
12
+ * copy of it is a second thing to drift.
13
+ */
14
+ export { OAUTH_SCOPE_COPY as GRANT_SCOPE_COPY, oauthScopeCopy as grantScopeCopy, };
15
+ /** Scope copy for a whole set, in the order given, ready to render as a list. */
16
+ export function grantScopeCopyList(scopes) {
17
+ return [...new Set(scopes)].map((id) => ({ id, ...oauthScopeCopy(id) }));
18
+ }
19
+ /**
20
+ * Why a grant or decision is being asked for, in the user's language.
21
+ *
22
+ * Purpose strings are SERVER-OWNED. Only these codes and templates render as
23
+ * the reason a grant is requested; client identity is displayed separately and
24
+ * escaped. Client-authored purpose text is a consent-spoofing surface and is
25
+ * never accepted (§4.5).
26
+ *
27
+ * Each entry reads as the completion of "… is asking to <copy>".
28
+ */
29
+ export const GRANT_PURPOSE_COPY = {
30
+ "publish.confirm": "publish a new version",
31
+ "deploy.confirm": "deploy a site",
32
+ "version.rollback.confirm": "roll a site back to an earlier version",
33
+ "domain.purchase.confirm": "purchase a domain",
34
+ "domain.dns.confirm": "change domain DNS",
35
+ "device.authorize": "connect the Spacefast CLI",
36
+ "agent_handoff.redeem": "continue a Spacefast handoff",
37
+ "claim.continue": "continue a claimed site",
38
+ "oauth.connect": "connect to Spacefast",
39
+ };
40
+ /** Never throws: an unknown code renders the neutral fallback, never the code. */
41
+ export function grantPurposeCopy(purposeCode) {
42
+ const match = Object.entries(GRANT_PURPOSE_COPY).find(([code]) => code === purposeCode);
43
+ return match?.[1] ?? "act in Spacefast";
44
+ }
@@ -12,8 +12,8 @@ export declare const GRANT_AUDIENCE_KINDS: readonly ["public", "team", "person",
12
12
  export declare const grantAudienceKindSchema: z.ZodEnum<{
13
13
  link: "link";
14
14
  team: "team";
15
- public: "public";
16
15
  external: "external";
16
+ public: "public";
17
17
  person: "person";
18
18
  password: "password";
19
19
  machine: "machine";
@@ -263,8 +263,47 @@ export declare const managedGrantWriteSchema: z.ZodObject<{
263
263
  }, z.core.$strict>], "kind">;
264
264
  }, z.core.$strict>;
265
265
  export type ManagedGrantWrite = z.infer<typeof managedGrantWriteSchema>;
266
+ declare const externalGrantWriteAudienceSchema: z.ZodObject<{
267
+ kind: z.ZodLiteral<"external">;
268
+ connectionId: z.ZodTemplateLiteral<`acn_${string}`>;
269
+ subject: z.ZodString;
270
+ }, z.core.$strict>;
266
271
  export declare const directManagedGrantWriteSchema: z.ZodObject<{
267
272
  name: z.ZodOptional<z.ZodString>;
273
+ resources: z.ZodObject<{
274
+ include: z.ZodArray<z.ZodString>;
275
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
276
+ }, z.core.$strict>;
277
+ capabilities: z.ZodArray<z.ZodEnum<{
278
+ "page.view": "page.view";
279
+ "comments.read": "comments.read";
280
+ "comments.write": "comments.write";
281
+ "content.publish": "content.publish";
282
+ "access.manage": "access.manage";
283
+ }>>;
284
+ constraints: z.ZodDefault<z.ZodObject<{
285
+ notBefore: z.ZodOptional<z.ZodString>;
286
+ expiresAt: z.ZodOptional<z.ZodString>;
287
+ maxUses: z.ZodOptional<z.ZodNumber>;
288
+ requireVerifiedEmail: z.ZodOptional<z.ZodBoolean>;
289
+ network: z.ZodOptional<z.ZodObject<{
290
+ ipCidrs: z.ZodOptional<z.ZodArray<z.ZodString>>;
291
+ countries: z.ZodOptional<z.ZodArray<z.ZodString>>;
292
+ excludedCountries: z.ZodOptional<z.ZodArray<z.ZodString>>;
293
+ excludedUserAgentSubstrings: z.ZodOptional<z.ZodArray<z.ZodString>>;
294
+ }, z.core.$strict>>;
295
+ }, z.core.$strict>>;
296
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
297
+ kind: z.ZodLiteral<"live">;
298
+ }, z.core.$strict>, z.ZodObject<{
299
+ kind: z.ZodLiteral<"version">;
300
+ versionId: z.ZodString;
301
+ }, z.core.$strict>, z.ZodObject<{
302
+ kind: z.ZodLiteral<"branch">;
303
+ branch: z.ZodString;
304
+ }, z.core.$strict>, z.ZodObject<{
305
+ kind: z.ZodLiteral<"all_versions">;
306
+ }, z.core.$strict>], "kind">;
268
307
  audience: z.ZodDiscriminatedUnion<[z.ZodObject<{
269
308
  kind: z.ZodLiteral<"public">;
270
309
  }, z.core.$strict>, z.ZodObject<{
@@ -273,20 +312,11 @@ export declare const directManagedGrantWriteSchema: z.ZodObject<{
273
312
  }, z.core.$strict>, z.ZodObject<{
274
313
  kind: z.ZodLiteral<"person">;
275
314
  personId: z.ZodString;
276
- }, z.core.$strict>, z.ZodObject<{
277
- kind: z.ZodLiteral<"link">;
278
- linkId: z.ZodString;
279
- }, z.core.$strict>, z.ZodObject<{
280
- kind: z.ZodLiteral<"password">;
281
- credentialId: z.ZodString;
282
- }, z.core.$strict>, z.ZodObject<{
283
- kind: z.ZodLiteral<"machine">;
284
- machineId: z.ZodString;
285
- }, z.core.$strict>, z.ZodObject<{
286
- kind: z.ZodLiteral<"external">;
287
- issuer: z.ZodString;
288
- subject: z.ZodString;
289
315
  }, z.core.$strict>], "kind">;
316
+ }, z.core.$strict>;
317
+ export type DirectManagedGrantWrite = z.infer<typeof directManagedGrantWriteSchema>;
318
+ export declare const spaceGrantCreateSchema: z.ZodObject<{
319
+ name: z.ZodOptional<z.ZodString>;
290
320
  resources: z.ZodObject<{
291
321
  include: z.ZodArray<z.ZodString>;
292
322
  exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -321,8 +351,25 @@ export declare const directManagedGrantWriteSchema: z.ZodObject<{
321
351
  }, z.core.$strict>, z.ZodObject<{
322
352
  kind: z.ZodLiteral<"all_versions">;
323
353
  }, z.core.$strict>], "kind">;
354
+ audience: z.ZodDiscriminatedUnion<[z.ZodObject<{
355
+ kind: z.ZodLiteral<"public">;
356
+ }, z.core.$strict>, z.ZodObject<{
357
+ kind: z.ZodLiteral<"team">;
358
+ teamId: z.ZodString;
359
+ }, z.core.$strict>, z.ZodObject<{
360
+ kind: z.ZodLiteral<"person">;
361
+ personId: z.ZodString;
362
+ }, z.core.$strict>, z.ZodObject<{
363
+ kind: z.ZodLiteral<"external">;
364
+ connectionId: z.ZodTemplateLiteral<`acn_${string}`>;
365
+ subject: z.ZodString;
366
+ }, z.core.$strict>], "kind">;
324
367
  }, z.core.$strict>;
325
- export type DirectManagedGrantWrite = z.infer<typeof directManagedGrantWriteSchema>;
368
+ export type SpaceGrantCreate = z.infer<typeof spaceGrantCreateSchema>;
369
+ /** The external branch of the create body, once its subject has been read. */
370
+ export type ExternalManagedGrantWrite = Omit<SpaceGrantCreate, "audience"> & {
371
+ audience: z.infer<typeof externalGrantWriteAudienceSchema>;
372
+ };
326
373
  export declare const grantSourceExplanationSchema: z.ZodObject<{
327
374
  editable: z.ZodBoolean;
328
375
  label: z.ZodString;
@@ -424,8 +471,8 @@ export declare const grantCheckQuerySchema: z.ZodObject<{
424
471
  audience: z.ZodDefault<z.ZodEnum<{
425
472
  link: "link";
426
473
  team: "team";
427
- public: "public";
428
474
  external: "external";
475
+ public: "public";
429
476
  person: "person";
430
477
  password: "password";
431
478
  machine: "machine";
@@ -1137,43 +1184,4 @@ export declare const identityConnectionSchema: z.ZodObject<{
1137
1184
  revokedAt: z.ZodNullable<z.ZodString>;
1138
1185
  }, z.core.$strict>;
1139
1186
  export type IdentityConnection = z.infer<typeof identityConnectionSchema>;
1140
- export declare const externalGrantCreateSchema: z.ZodObject<{
1141
- name: z.ZodString;
1142
- resources: z.ZodObject<{
1143
- include: z.ZodArray<z.ZodString>;
1144
- exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
1145
- }, z.core.$strict>;
1146
- capabilities: z.ZodArray<z.ZodEnum<{
1147
- "page.view": "page.view";
1148
- "comments.read": "comments.read";
1149
- "comments.write": "comments.write";
1150
- "content.publish": "content.publish";
1151
- "access.manage": "access.manage";
1152
- }>>;
1153
- constraints: z.ZodDefault<z.ZodObject<{
1154
- notBefore: z.ZodOptional<z.ZodString>;
1155
- expiresAt: z.ZodOptional<z.ZodString>;
1156
- maxUses: z.ZodOptional<z.ZodNumber>;
1157
- requireVerifiedEmail: z.ZodOptional<z.ZodBoolean>;
1158
- network: z.ZodOptional<z.ZodObject<{
1159
- ipCidrs: z.ZodOptional<z.ZodArray<z.ZodString>>;
1160
- countries: z.ZodOptional<z.ZodArray<z.ZodString>>;
1161
- excludedCountries: z.ZodOptional<z.ZodArray<z.ZodString>>;
1162
- excludedUserAgentSubstrings: z.ZodOptional<z.ZodArray<z.ZodString>>;
1163
- }, z.core.$strict>>;
1164
- }, z.core.$strict>>;
1165
- target: z.ZodDiscriminatedUnion<[z.ZodObject<{
1166
- kind: z.ZodLiteral<"live">;
1167
- }, z.core.$strict>, z.ZodObject<{
1168
- kind: z.ZodLiteral<"version">;
1169
- versionId: z.ZodString;
1170
- }, z.core.$strict>, z.ZodObject<{
1171
- kind: z.ZodLiteral<"branch">;
1172
- branch: z.ZodString;
1173
- }, z.core.$strict>, z.ZodObject<{
1174
- kind: z.ZodLiteral<"all_versions">;
1175
- }, z.core.$strict>], "kind">;
1176
- connectionId: z.ZodTemplateLiteral<`acn_${string}`>;
1177
- subject: z.ZodString;
1178
- }, z.core.$strict>;
1179
- export type ExternalGrantCreate = z.infer<typeof externalGrantCreateSchema>;
1187
+ export {};
@@ -482,12 +482,55 @@ export const managedGrantWriteSchema = grantDimensionsSchema.superRefine((value,
482
482
  });
483
483
  }
484
484
  });
485
- export const directManagedGrantWriteSchema = managedGrantWriteSchema.superRefine((value, context) => {
486
- if (!["public", "team", "person"].includes(value.audience.kind)) {
485
+ // The subjects a manager can name directly. Link, password, and machine
486
+ // subjects are minted by their credential workflow, so they are absent from the
487
+ // write audiences rather than refused by a refinement after the fact.
488
+ const publicGrantAudienceSchema = z.object({ kind: z.literal("public") }).strict();
489
+ const teamGrantAudienceSchema = z
490
+ .object({ kind: z.literal("team"), teamId: grantReferenceSchema })
491
+ .strict();
492
+ const personGrantAudienceSchema = z
493
+ .object({ kind: z.literal("person"), personId: grantReferenceSchema })
494
+ .strict();
495
+ // The external-identity subject names the Team connection that authenticates
496
+ // it; the issuer is resolved from that connection server-side, so a caller
497
+ // never asserts one.
498
+ const externalGrantWriteAudienceSchema = z
499
+ .object({
500
+ kind: z.literal("external"),
501
+ connectionId: registeredIdSchema("acn"),
502
+ subject: z.string().trim().min(1).max(255),
503
+ })
504
+ .strict();
505
+ const directManagedGrantAudienceSchema = z.discriminatedUnion("kind", [
506
+ publicGrantAudienceSchema,
507
+ teamGrantAudienceSchema,
508
+ personGrantAudienceSchema,
509
+ ]);
510
+ export const directManagedGrantWriteSchema = grantDimensionsSchema
511
+ .extend({ audience: directManagedGrantAudienceSchema })
512
+ .superRefine(validateGrantAudienceCapabilityBoundary);
513
+ // One create body for `POST /v1/spaces/{spaceId}/grants`: one object whose
514
+ // `audience` is the discriminated union of every subject a manager can name.
515
+ // Deliberately NOT a union of two whole bodies — a top-level union collapses
516
+ // every structural failure into one issue with an empty path, and the problem
517
+ // document loses its RFC 6901 `pointer`.
518
+ const managedGrantWriteAudienceSchema = z.discriminatedUnion("kind", [
519
+ publicGrantAudienceSchema,
520
+ teamGrantAudienceSchema,
521
+ personGrantAudienceSchema,
522
+ externalGrantWriteAudienceSchema,
523
+ ]);
524
+ export const spaceGrantCreateSchema = grantDimensionsSchema
525
+ .extend({ audience: managedGrantWriteAudienceSchema })
526
+ .superRefine((value, context) => {
527
+ validateGrantAudienceCapabilityBoundary(value, context);
528
+ // An opaque external subject is unreadable in the Grant list without one.
529
+ if (value.audience.kind === "external" && value.name === undefined) {
487
530
  context.addIssue({
488
531
  code: "custom",
489
- path: ["audience", "kind"],
490
- message: "direct managed Grants support only public, team, and person audiences; credential-backed audiences use their dedicated workflow",
532
+ path: ["name"],
533
+ message: "an external identity Grant needs a name; its subject is opaque",
491
534
  });
492
535
  }
493
536
  });
@@ -510,20 +553,85 @@ export const spaceGrantSchema = z
510
553
  updatedAt: z.string().datetime(),
511
554
  })
512
555
  .strict();
556
+ // The whole query describes one hypothetical visit: who is knocking, at which
557
+ // URL, on which deployment. Each field is documented because this operation is
558
+ // the explainer an agent reaches for when access is refused and it needs to
559
+ // know why.
513
560
  export const grantCheckQuerySchema = z
514
561
  .object({
515
- path: z.string().min(1).max(2048).default("/"),
516
- target: z.enum(["live", "version", "branch"]).default("live"),
517
- targetId: z.string().trim().min(1).max(255).optional(),
518
- audience: grantAudienceKindSchema.default("public"),
519
- personId: z.string().trim().min(1).max(255).optional(),
520
- linkId: z.string().trim().min(1).max(255).optional(),
521
- passwordCredentialId: z.string().trim().min(1).max(255).optional(),
522
- machineId: z.string().trim().min(1).max(255).optional(),
523
- issuer: z.string().trim().min(1).max(255).optional(),
524
- subject: z.string().trim().min(1).max(255).optional(),
525
- verifiedEmail: z.enum(["true", "false"]).optional(),
526
- ipAddress: z.string().trim().min(1).max(64).optional(),
562
+ path: z
563
+ .string()
564
+ .min(1)
565
+ .max(2048)
566
+ .default("/")
567
+ .describe("Request path to simulate, for example `/admin`."),
568
+ target: z
569
+ .enum(["live", "version", "branch"])
570
+ .default("live")
571
+ .describe("Which deployment the visit lands on: the live channel, one version, or a branch."),
572
+ targetId: z
573
+ .string()
574
+ .trim()
575
+ .min(1)
576
+ .max(255)
577
+ .optional()
578
+ .describe("The version id or branch name named by `target`. Required for `version` and `branch`, and rejected for `live`."),
579
+ audience: grantAudienceKindSchema
580
+ .default("public")
581
+ .describe("Who is knocking. Each audience needs its own identifying parameter below, and rejects the others."),
582
+ personId: z
583
+ .string()
584
+ .trim()
585
+ .min(1)
586
+ .max(255)
587
+ .optional()
588
+ .describe("The person to simulate. Required with `audience=person`."),
589
+ linkId: z
590
+ .string()
591
+ .trim()
592
+ .min(1)
593
+ .max(255)
594
+ .optional()
595
+ .describe("The share link to simulate. Required with `audience=link`."),
596
+ passwordCredentialId: z
597
+ .string()
598
+ .trim()
599
+ .min(1)
600
+ .max(255)
601
+ .optional()
602
+ .describe("The password credential to simulate. Required with `audience=password`."),
603
+ machineId: z
604
+ .string()
605
+ .trim()
606
+ .min(1)
607
+ .max(255)
608
+ .optional()
609
+ .describe("The machine credential to simulate. Required with `audience=machine`."),
610
+ issuer: z
611
+ .string()
612
+ .trim()
613
+ .min(1)
614
+ .max(255)
615
+ .optional()
616
+ .describe("Identity connection issuer for the external identity to simulate. Required with `audience=external`."),
617
+ subject: z
618
+ .string()
619
+ .trim()
620
+ .min(1)
621
+ .max(255)
622
+ .optional()
623
+ .describe("Subject claim of the external identity to simulate. Required with `audience=external`."),
624
+ verifiedEmail: z
625
+ .enum(["true", "false"])
626
+ .optional()
627
+ .describe("Whether the simulated visitor's email counts as verified."),
628
+ ipAddress: z
629
+ .string()
630
+ .trim()
631
+ .min(1)
632
+ .max(64)
633
+ .optional()
634
+ .describe("Client IP to evaluate network constraints against."),
527
635
  })
528
636
  .strict()
529
637
  .superRefine((value, context) => {
@@ -783,10 +891,3 @@ export const identityConnectionSchema = z
783
891
  revokedAt: z.string().datetime().nullable(),
784
892
  })
785
893
  .strict();
786
- export const externalGrantCreateSchema = z
787
- .object({
788
- connectionId: registeredIdSchema("acn"),
789
- subject: z.string().min(1).max(255),
790
- ...credentialGrantFields,
791
- })
792
- .strict();
@@ -22,7 +22,7 @@ export declare const ID_PREFIXES: {
22
22
  readonly ntf: "Notification";
23
23
  readonly pvc: "ProviderClient";
24
24
  readonly tgs: "TagSet";
25
- readonly tgv: "TagVersion";
25
+ readonly tgv: "TagRevision";
26
26
  readonly tgr: "TagRelease";
27
27
  readonly tga: "TagRuntimeArtifact";
28
28
  readonly tgp: "TagPreviewSession";
@@ -34,6 +34,9 @@ export declare const ID_PREFIXES: {
34
34
  readonly acn: "IdentityConnection";
35
35
  readonly pwd: "SpacePasswordCredential";
36
36
  readonly mch: "SpaceMachineCredential";
37
+ readonly pti: "PartnerTokenIssuer";
38
+ readonly usg: "UsageRecord";
39
+ readonly upr: "UsagePeriod";
37
40
  };
38
41
  export type IdPrefix = keyof typeof ID_PREFIXES;
39
42
  /** Any registered public resource id, e.g. `spc_…` or `ver_…`. */
@@ -29,7 +29,7 @@ export const ID_PREFIXES = {
29
29
  ntf: "Notification",
30
30
  pvc: "ProviderClient",
31
31
  tgs: "TagSet",
32
- tgv: "TagVersion",
32
+ tgv: "TagRevision",
33
33
  tgr: "TagRelease",
34
34
  tga: "TagRuntimeArtifact",
35
35
  tgp: "TagPreviewSession",
@@ -42,6 +42,9 @@ export const ID_PREFIXES = {
42
42
  acn: "IdentityConnection",
43
43
  pwd: "SpacePasswordCredential",
44
44
  mch: "SpaceMachineCredential",
45
+ pti: "PartnerTokenIssuer",
46
+ usg: "UsageRecord",
47
+ upr: "UsagePeriod",
45
48
  };
46
49
  /** Validate an id belonging to one registered public resource family. */
47
50
  export function registeredIdSchema(prefix) {
@@ -15,9 +15,9 @@ export declare const uploadManifestFileSchema: z.ZodObject<{
15
15
  }, z.core.$strip>;
16
16
  export declare const pendingUploadSchema: z.ZodObject<{
17
17
  path: z.ZodString;
18
- size: z.ZodNumber;
19
- sha256: z.ZodOptional<z.ZodString>;
20
18
  sourceUrl: z.ZodOptional<z.ZodString>;
19
+ sha256: z.ZodOptional<z.ZodString>;
20
+ size: z.ZodNumber;
21
21
  }, z.core.$strip>;
22
22
  export declare const uploadSessionModeSchema: z.ZodEnum<{
23
23
  source: "source";
@@ -70,7 +70,8 @@ export declare const uploadInstructionsSchema: z.ZodObject<{
70
70
  contentType: z.ZodOptional<z.ZodString>;
71
71
  }, z.core.$strip>>>;
72
72
  links: z.ZodObject<{
73
- resume: z.ZodString;
73
+ refresh: z.ZodString;
74
+ resume: z.ZodOptional<z.ZodString>;
74
75
  finalize: z.ZodString;
75
76
  }, z.core.$strip>;
76
77
  details: z.ZodOptional<z.ZodObject<{
@@ -86,8 +87,8 @@ export declare const uploadInstructionsSchema: z.ZodObject<{
86
87
  code: z.ZodString;
87
88
  severity: z.ZodEnum<{
88
89
  info: "info";
89
- error: "error";
90
90
  warning: "warning";
91
+ error: "error";
91
92
  }>;
92
93
  message: z.ZodString;
93
94
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -15,7 +15,7 @@ export const manifestFileSchema = z.object({
15
15
  size: z.number().int().nonnegative().describe("File size in bytes."),
16
16
  sha256: manifestSha256Schema
17
17
  .optional()
18
- .describe("Optional SHA-256 content digest: exactly 64 lowercase hex characters, no `sha256:` prefix (Version.manifestHash is the only prefixed form). Omit it to let the runtime hash uploaded bytes; include it to upload by content address, with the digest verified as the bytes land."),
18
+ .describe("Optional SHA-256 content digest, 64 lowercase hex characters without the `sha256:` prefix. Omit it to let the runtime hash uploaded bytes; include it to upload by content address, with the digest verified as the bytes land."),
19
19
  contentType: z.string().optional().describe("Optional content type for serving metadata."),
20
20
  sourceUrl: manifestSourceUrlSchema
21
21
  .optional()
@@ -77,9 +77,18 @@ export const uploadInstructionsSchema = z.object({
77
77
  targets: z
78
78
  .array(uploadTargetSchema)
79
79
  .default([])
80
- .describe("Opaque upload targets, bounded by the instruction payload budget. Upload these, then call `links.resume` for the remainder."),
80
+ .describe("Opaque upload targets, bounded by the instruction payload budget. Upload these, then call `links.refresh` for the remainder."),
81
81
  links: z.object({
82
- resume: z.string(),
82
+ // The key names the action — mint a fresh instruction page for whatever the
83
+ // session still needs — not the route that happens to serve it.
84
+ refresh: z.string(),
85
+ // Transition alias for clients baked before the rename (#2449). Deployed
86
+ // CLIs and dashboard bundles still *require* `links.resume`, so the server
87
+ // emits both keys with the same value and they keep parsing. Optional here
88
+ // so nothing new is forced to produce it. Remove — with the `/uploads/resume`
89
+ // route alias and the receipt's `links.resume` — once every baked client is
90
+ // rebuilt.
91
+ resume: z.string().optional(),
83
92
  finalize: z.string(),
84
93
  }),
85
94
  details: z
@@ -1,4 +1,21 @@
1
1
  import { z } from "zod";
2
+ export declare const HOSTED_MCP_SERVER_VERSION: "2026-08-22";
3
+ export declare const HOSTED_MCP_TOOL_CATALOG: readonly [{
4
+ readonly name: "execute";
5
+ readonly description: "Run JavaScript against the OpenAPI-generated Spacefast catalog in a secure sandbox.";
6
+ }, {
7
+ readonly name: "skills";
8
+ readonly description: "Fetch Spacefast how-to guidance for an MCP workflow.";
9
+ }, {
10
+ readonly name: "resume";
11
+ readonly description: "Resume an execution that paused for approval or input.";
12
+ }, {
13
+ readonly name: "publish";
14
+ readonly description: "Publish inline files as a new immutable Spacefast version.";
15
+ }, {
16
+ readonly name: "search_docs";
17
+ readonly description: "Search the published Spacefast documentation. An exact slug or path returns that page in full.";
18
+ }];
2
19
  export declare const hostedMcpSessionStatusSchema: z.ZodEnum<{
3
20
  active: "active";
4
21
  expired: "expired";
@@ -1,5 +1,28 @@
1
1
  import { z } from "zod";
2
2
  import { AnyObjectSchema, dataEnvelope } from "./common.js";
3
+ export const HOSTED_MCP_SERVER_VERSION = "2026-08-22";
4
+ export const HOSTED_MCP_TOOL_CATALOG = [
5
+ {
6
+ name: "execute",
7
+ description: "Run JavaScript against the OpenAPI-generated Spacefast catalog in a secure sandbox.",
8
+ },
9
+ {
10
+ name: "skills",
11
+ description: "Fetch Spacefast how-to guidance for an MCP workflow.",
12
+ },
13
+ {
14
+ name: "resume",
15
+ description: "Resume an execution that paused for approval or input.",
16
+ },
17
+ {
18
+ name: "publish",
19
+ description: "Publish inline files as a new immutable Spacefast version.",
20
+ },
21
+ {
22
+ name: "search_docs",
23
+ description: "Search the published Spacefast documentation. An exact slug or path returns that page in full.",
24
+ },
25
+ ];
3
26
  export const hostedMcpSessionStatusSchema = z.enum(["active", "closed", "expired", "interrupted"]);
4
27
  export const hostedMcpSessionSchema = z.object({
5
28
  sessionId: z.string(),
@@ -16,6 +16,12 @@ export declare const meResponseSchema: z.ZodObject<{
16
16
  isAutomattician: z.ZodBoolean;
17
17
  wpcom: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
18
18
  isSuperadmin: z.ZodBoolean;
19
+ pendingDeletionAt: z.ZodNullable<z.ZodString>;
20
+ dashboardPrefs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
21
+ privacy: z.ZodObject<{
22
+ analyticsOptOut: z.ZodBoolean;
23
+ advertisingOptOut: z.ZodBoolean;
24
+ }, z.core.$strip>;
19
25
  }, z.core.$strip>>;
20
26
  tenants: z.ZodArray<z.ZodObject<{
21
27
  id: z.ZodString;
@@ -65,7 +71,6 @@ export declare const meResponseSchema: z.ZodObject<{
65
71
  beta: z.ZodObject<{
66
72
  gateEnabled: z.ZodBoolean;
67
73
  enrolled: z.ZodBoolean;
68
- wpcom: z.ZodBoolean;
69
74
  eligibleTeams: z.ZodArray<z.ZodObject<{
70
75
  teamId: z.ZodString;
71
76
  name: z.ZodString;
@@ -1,11 +1,12 @@
1
1
  import { z } from "zod";
2
2
  import { betaEligibleTeamSourceSchema } from "./beta.js";
3
+ import { dashboardPrefsSchema } from "./dashboard-prefs.js";
3
4
  import { planCodeSchema } from "./features.js";
4
- // `GET /v1/me` (the platform spec route catalog): the authenticated
5
- // subject, its tenant grants, principal/team memberships, and a plan summary.
6
- // Works for every credential kind sessions resolve their user and team
7
- // memberships; machine credentials resolve the teams and tenants their policy
8
- // grants.
5
+ import { privacySettingsSchema } from "./privacy.js";
6
+ // `GET /v1/me` (the platform spec route catalog): the authenticated subject, its
7
+ // tenant grants, principal/team memberships, and a plan summary. Sessions
8
+ // resolve their user and team memberships; machine credentials resolve the teams
9
+ // and tenants their policy grants.
9
10
  export const meResponseSchema = z.object({
10
11
  subject: z
11
12
  .object({
@@ -28,6 +29,12 @@ export const meResponseSchema = z.object({
28
29
  .nullable()
29
30
  .describe("Raw WordPress.com `/me` payload from the user's last WP.com login."),
30
31
  isSuperadmin: z.boolean().describe("Whether the user is a platform operator."),
32
+ pendingDeletionAt: z
33
+ .string()
34
+ .nullable()
35
+ .describe("When this account's deletion was requested, while the close is still running. Null for every account that is not being deleted."),
36
+ dashboardPrefs: dashboardPrefsSchema.describe("The user's dashboard preferences. Carried on the boot payload the dashboard already fetches, so applying a cross-device preference costs no extra request. Write with `PATCH /v1/me/dashboard-preferences`."),
37
+ privacy: privacySettingsSchema.describe("The user's account-level privacy choices. Write with `PATCH /v1/me/privacy`."),
31
38
  })
32
39
  .nullable()
33
40
  .describe("Authenticated user identity for user-subject credentials. Null for team-subject or service-subject machine credentials. Creator metadata is retained only for audit attribution, not request identity."),
@@ -89,7 +96,6 @@ export const meResponseSchema = z.object({
89
96
  enrolled: z
90
97
  .boolean()
91
98
  .describe("Whether the subject user is enrolled (beta_enrolled_at is set)."),
92
- wpcom: z.boolean().describe("Whether the user passed the Automattician check at enrollment."),
93
99
  eligibleTeams: z
94
100
  .array(z.object({
95
101
  teamId: z.string().describe("Team id."),