@spacefast/common 0.0.24 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/brand-assets/LICENSE-Haskoy.txt +93 -0
  2. package/brand-assets/haskoy-latin-variable.woff2 +0 -0
  3. package/brand-assets/spacefast-favicon.svg +4 -4
  4. package/brand-assets/spacefast-sf-full-bleed.svg +3 -3
  5. package/brand-assets/spacefast-wordmark.svg +2 -4
  6. package/dist/agents/connect-targets.d.ts +6 -146
  7. package/dist/agents/connect-targets.js +63 -295
  8. package/dist/agents/private-key-oauth.d.ts +31 -2
  9. package/dist/agents/private-key-oauth.js +166 -92
  10. package/dist/agents/registry/core.d.ts +292 -0
  11. package/dist/agents/registry/core.js +1388 -0
  12. package/dist/agents/registry/deeplink-probes.d.ts +23 -0
  13. package/dist/agents/registry/deeplink-probes.js +18 -0
  14. package/dist/agents/registry/node.d.ts +56 -0
  15. package/dist/agents/registry/node.js +339 -0
  16. package/dist/brand-assets-build.js +3 -6
  17. package/dist/brand-assets.d.ts +5 -15
  18. package/dist/brand-assets.js +12 -14
  19. package/dist/brand.d.ts +17 -0
  20. package/dist/brand.js +24 -4
  21. package/dist/config/domains.d.ts +79 -12
  22. package/dist/config/domains.js +128 -29
  23. package/dist/config/index.js +1 -2
  24. package/dist/contracts/abuse.js +9 -24
  25. package/dist/contracts/access-profiles.d.ts +86 -0
  26. package/dist/contracts/access-profiles.js +89 -0
  27. package/dist/contracts/access.d.ts +24 -30
  28. package/dist/contracts/access.js +33 -64
  29. package/dist/contracts/activity.d.ts +18 -1
  30. package/dist/contracts/activity.js +72 -26
  31. package/dist/contracts/analytics.js +8 -10
  32. package/dist/contracts/api-keys.d.ts +77 -52
  33. package/dist/contracts/api-keys.js +44 -24
  34. package/dist/contracts/application-journal.d.ts +216 -0
  35. package/dist/contracts/application-journal.js +167 -0
  36. package/dist/contracts/auth.d.ts +90 -17
  37. package/dist/contracts/auth.js +86 -17
  38. package/dist/contracts/beta.d.ts +9 -4
  39. package/dist/contracts/beta.js +20 -16
  40. package/dist/contracts/billing.d.ts +2 -1
  41. package/dist/contracts/billing.js +37 -11
  42. package/dist/contracts/bootstrap.d.ts +791 -0
  43. package/dist/contracts/bootstrap.js +51 -0
  44. package/dist/contracts/builds.d.ts +209 -18
  45. package/dist/contracts/builds.js +93 -27
  46. package/dist/contracts/channels.d.ts +43 -0
  47. package/dist/contracts/channels.js +25 -9
  48. package/dist/contracts/cli.d.ts +7 -0
  49. package/dist/contracts/cli.js +6 -0
  50. package/dist/contracts/collab-public.d.ts +1 -1
  51. package/dist/contracts/collab-public.js +5 -8
  52. package/dist/contracts/comments.d.ts +44 -34
  53. package/dist/contracts/comments.js +107 -77
  54. package/dist/contracts/commerce.d.ts +165 -0
  55. package/dist/contracts/commerce.js +146 -0
  56. package/dist/contracts/common.d.ts +3 -3
  57. package/dist/contracts/common.js +20 -31
  58. package/dist/contracts/content-contract-verification.d.ts +521 -0
  59. package/dist/contracts/content-contract-verification.js +320 -0
  60. package/dist/contracts/content-platform-fixture.d.ts +1278 -0
  61. package/dist/contracts/content-platform-fixture.js +44 -0
  62. package/dist/contracts/content-program.d.ts +994 -0
  63. package/dist/contracts/content-program.js +658 -0
  64. package/dist/contracts/content-sync.d.ts +290 -0
  65. package/dist/contracts/content-sync.js +167 -0
  66. package/dist/contracts/content.d.ts +432 -0
  67. package/dist/contracts/content.js +303 -0
  68. package/dist/contracts/continuation.d.ts +17 -1
  69. package/dist/contracts/continuation.js +23 -23
  70. package/dist/contracts/countries.js +3 -4
  71. package/dist/contracts/crons.d.ts +52 -0
  72. package/dist/contracts/crons.js +60 -0
  73. package/dist/contracts/dashboard-prefs.d.ts +56 -0
  74. package/dist/contracts/dashboard-prefs.js +51 -0
  75. package/dist/contracts/device-auth.d.ts +234 -37
  76. package/dist/contracts/device-auth.js +267 -53
  77. package/dist/contracts/docs.d.ts +1 -5
  78. package/dist/contracts/docs.js +7 -15
  79. package/dist/contracts/domains.d.ts +501 -93
  80. package/dist/contracts/domains.js +193 -55
  81. package/dist/contracts/email-preferences.d.ts +3 -3
  82. package/dist/contracts/email-preferences.js +6 -7
  83. package/dist/contracts/enums.d.ts +27 -26
  84. package/dist/contracts/enums.js +68 -61
  85. package/dist/contracts/error-code-meta.d.ts +283 -7
  86. package/dist/contracts/error-code-meta.js +97 -5
  87. package/dist/contracts/error-codes.d.ts +5 -5
  88. package/dist/contracts/error-codes.js +82 -17
  89. package/dist/contracts/events.d.ts +100 -20
  90. package/dist/contracts/events.js +107 -20
  91. package/dist/contracts/execution.d.ts +48 -64
  92. package/dist/contracts/execution.js +52 -62
  93. package/dist/contracts/feature-lifecycle.d.ts +73 -27
  94. package/dist/contracts/feature-lifecycle.js +86 -26
  95. package/dist/contracts/features.d.ts +68 -19
  96. package/dist/contracts/features.js +42 -41
  97. package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
  98. package/dist/contracts/frame-session.d.ts +192 -0
  99. package/dist/contracts/frame-session.js +164 -0
  100. package/dist/contracts/functions.d.ts +338 -164
  101. package/dist/contracts/functions.js +367 -198
  102. package/dist/contracts/git.d.ts +27 -33
  103. package/dist/contracts/git.js +10 -11
  104. package/dist/contracts/grant-copy.d.ts +43 -0
  105. package/dist/contracts/grant-copy.js +44 -0
  106. package/dist/contracts/grants.d.ts +62 -54
  107. package/dist/contracts/grants.js +124 -23
  108. package/dist/contracts/ids.d.ts +4 -1
  109. package/dist/contracts/ids.js +6 -3
  110. package/dist/contracts/internal.d.ts +8 -18
  111. package/dist/contracts/internal.js +13 -14
  112. package/dist/contracts/mcp.d.ts +28 -0
  113. package/dist/contracts/mcp.js +28 -0
  114. package/dist/contracts/me.d.ts +6 -1
  115. package/dist/contracts/me.js +12 -6
  116. package/dist/contracts/notifications.d.ts +27 -29
  117. package/dist/contracts/notifications.js +9 -4
  118. package/dist/contracts/oauth-resources.d.ts +112 -10
  119. package/dist/contracts/oauth-resources.js +116 -11
  120. package/dist/contracts/oauth-scope-actions.d.ts +90 -0
  121. package/dist/contracts/oauth-scope-actions.js +126 -0
  122. package/dist/contracts/operations.d.ts +27 -4
  123. package/dist/contracts/operations.js +12 -6
  124. package/dist/contracts/pages.d.ts +31 -7
  125. package/dist/contracts/pages.js +22 -5
  126. package/dist/contracts/partner-notifications.d.ts +3 -0
  127. package/dist/contracts/partner-notifications.js +65 -0
  128. package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
  129. package/dist/contracts/{platform.js → partner.js} +27 -40
  130. package/dist/contracts/plan-policy.js +1 -1
  131. package/dist/contracts/principal-assertion.d.ts +43 -0
  132. package/dist/contracts/principal-assertion.js +67 -0
  133. package/dist/contracts/principals.d.ts +73 -0
  134. package/dist/contracts/principals.js +59 -0
  135. package/dist/contracts/privacy.d.ts +11 -0
  136. package/dist/contracts/privacy.js +17 -0
  137. package/dist/contracts/problem-document.js +3 -4
  138. package/dist/contracts/publish-archive.d.ts +269 -161
  139. package/dist/contracts/publish-archive.js +11 -1
  140. package/dist/contracts/push-new.d.ts +8 -8
  141. package/dist/contracts/quotas.js +5 -5
  142. package/dist/contracts/realtime.d.ts +52 -0
  143. package/dist/contracts/realtime.js +54 -0
  144. package/dist/contracts/repository-connections.d.ts +44 -31
  145. package/dist/contracts/repository-connections.js +17 -5
  146. package/dist/contracts/resources.d.ts +105 -14
  147. package/dist/contracts/resources.js +150 -26
  148. package/dist/contracts/route-inventory.d.ts +358 -0
  149. package/dist/contracts/route-inventory.js +141 -0
  150. package/dist/contracts/runtime-api.d.ts +206 -82
  151. package/dist/contracts/runtime-api.js +131 -70
  152. package/dist/contracts/runtime-app.d.ts +13 -23
  153. package/dist/contracts/runtime-app.js +39 -24
  154. package/dist/contracts/runtime-components.d.ts +143 -0
  155. package/dist/contracts/runtime-components.js +199 -0
  156. package/dist/contracts/runtime-db.d.ts +49 -23
  157. package/dist/contracts/runtime-db.js +87 -22
  158. package/dist/contracts/runtime-purge.d.ts +8 -0
  159. package/dist/contracts/runtime-purge.js +5 -0
  160. package/dist/contracts/runtime-services.d.ts +43 -75
  161. package/dist/contracts/runtime-services.js +29 -49
  162. package/dist/contracts/runtime-storage.d.ts +15 -14
  163. package/dist/contracts/runtime-storage.js +30 -14
  164. package/dist/contracts/sf-config-v1.d.ts +48 -14
  165. package/dist/contracts/slugs.js +13 -4
  166. package/dist/contracts/space-config.d.ts +283 -19
  167. package/dist/contracts/space-config.js +430 -80
  168. package/dist/contracts/spaces.d.ts +376 -290
  169. package/dist/contracts/spaces.js +200 -135
  170. package/dist/contracts/superadmin-activity.d.ts +3 -43
  171. package/dist/contracts/superadmin-activity.js +6 -30
  172. package/dist/contracts/superadmin-emails.d.ts +1 -0
  173. package/dist/contracts/superadmin-emails.js +17 -1
  174. package/dist/contracts/superadmin-runtime.d.ts +199 -0
  175. package/dist/contracts/superadmin-runtime.js +141 -0
  176. package/dist/contracts/superadmin-search.d.ts +22 -2
  177. package/dist/contracts/superadmin-search.js +14 -6
  178. package/dist/contracts/superadmin-spaces.d.ts +438 -189
  179. package/dist/contracts/superadmin-spaces.js +131 -25
  180. package/dist/contracts/superadmin-teams.d.ts +5 -2
  181. package/dist/contracts/superadmin-teams.js +1 -2
  182. package/dist/contracts/superadmin-tenants.d.ts +627 -12
  183. package/dist/contracts/superadmin-tenants.js +32 -13
  184. package/dist/contracts/superadmin.d.ts +232 -37
  185. package/dist/contracts/superadmin.js +106 -22
  186. package/dist/contracts/tags.d.ts +85 -58
  187. package/dist/contracts/tags.js +47 -37
  188. package/dist/contracts/teams.d.ts +86 -26
  189. package/dist/contracts/teams.js +90 -31
  190. package/dist/contracts/tenants.d.ts +135 -0
  191. package/dist/contracts/tenants.js +120 -0
  192. package/dist/contracts/test-triggers.d.ts +70 -0
  193. package/dist/contracts/test-triggers.js +116 -0
  194. package/dist/contracts/theme-json.js +3 -8
  195. package/dist/contracts/transfers.d.ts +1 -0
  196. package/dist/contracts/transfers.js +3 -2
  197. package/dist/contracts/usage.d.ts +209 -0
  198. package/dist/contracts/usage.js +124 -12
  199. package/dist/contracts/variables.d.ts +2 -2
  200. package/dist/contracts/variables.js +9 -13
  201. package/dist/contracts/webhooks.d.ts +13 -5
  202. package/dist/contracts/webhooks.js +3 -1
  203. package/dist/contracts/zero.d.ts +72 -81
  204. package/dist/contracts/zero.js +80 -78
  205. package/dist/dashboard-paths/index.d.ts +24 -21
  206. package/dist/dashboard-paths/index.js +35 -47
  207. package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
  208. package/dist/dashboard-paths/route-reservations.generated.js +36 -0
  209. package/dist/docs/agent-arrival.d.ts +92 -0
  210. package/dist/docs/agent-arrival.js +227 -0
  211. package/dist/docs/agent-output-policy.d.ts +6 -0
  212. package/dist/docs/agent-output-policy.js +22 -0
  213. package/dist/docs/agent-prose.d.ts +12 -18
  214. package/dist/docs/agent-prose.js +73 -51
  215. package/dist/docs/agent-setup.d.ts +72 -41
  216. package/dist/docs/agent-setup.js +339 -436
  217. package/dist/docs/catalog.d.ts +153 -95
  218. package/dist/docs/catalog.js +163 -48
  219. package/dist/docs/error-docs.d.ts +2098 -1
  220. package/dist/docs/error-docs.js +421 -144
  221. package/dist/docs/index-build.d.ts +0 -1
  222. package/dist/docs/index-build.js +2 -3
  223. package/dist/docs/page-context-prompt.d.ts +77 -0
  224. package/dist/docs/page-context-prompt.js +131 -0
  225. package/dist/docs/reference-urls.d.ts +46 -0
  226. package/dist/docs/reference-urls.js +79 -0
  227. package/dist/docs/search.d.ts +6 -8
  228. package/dist/docs/search.js +10 -13
  229. package/dist/docs/skill-distribution.d.ts +4 -1
  230. package/dist/docs/skill-distribution.js +10 -5
  231. package/dist/docs/skills.d.ts +120 -120
  232. package/dist/docs/skills.js +121 -73
  233. package/dist/docs/start-prompts.d.ts +45 -0
  234. package/dist/docs/start-prompts.js +62 -0
  235. package/dist/domain-exploration.js +9 -13
  236. package/dist/og-template.d.ts +56 -0
  237. package/dist/og-template.js +56 -0
  238. package/dist/slug-policy/index.js +5 -11
  239. package/dist/test-helpers/fetch-stub.js +1 -0
  240. package/dist/utils/browser-credential.d.ts +13 -6
  241. package/dist/utils/browser-credential.js +14 -7
  242. package/dist/utils/build-settings.d.ts +21 -1
  243. package/dist/utils/build-settings.js +133 -15
  244. package/dist/utils/canonical-json.d.ts +3 -5
  245. package/dist/utils/canonical-json.js +4 -5
  246. package/dist/utils/cast-transport.d.ts +5 -17
  247. package/dist/utils/cast-transport.js +6 -19
  248. package/dist/utils/claim-token.js +1 -2
  249. package/dist/utils/comment-avatars.js +4 -6
  250. package/dist/utils/concurrency.js +3 -3
  251. package/dist/utils/content-type.d.ts +7 -6
  252. package/dist/utils/content-type.js +73 -51
  253. package/dist/utils/credential-policy.d.ts +50 -6
  254. package/dist/utils/credential-policy.js +126 -59
  255. package/dist/utils/dns-instructions.js +9 -9
  256. package/dist/utils/egress-policy.fixtures.json +1 -1
  257. package/dist/utils/error-code.js +1 -0
  258. package/dist/utils/generate-space-name.d.ts +3 -8
  259. package/dist/utils/generate-space-name.js +3 -8
  260. package/dist/utils/grant-decision.fixtures.json +2 -2
  261. package/dist/utils/grants.d.ts +0 -1
  262. package/dist/utils/grants.js +7 -8
  263. package/dist/utils/gravatar.d.ts +2 -4
  264. package/dist/utils/gravatar.js +6 -12
  265. package/dist/utils/id-hints.js +14 -23
  266. package/dist/utils/idempotency.d.ts +3 -3
  267. package/dist/utils/idempotency.js +6 -7
  268. package/dist/utils/local-space-state.d.ts +23 -26
  269. package/dist/utils/local-space-state.js +46 -46
  270. package/dist/utils/oauth-signed-query.d.ts +3 -5
  271. package/dist/utils/oauth-signed-query.js +6 -9
  272. package/dist/utils/one-shot-replay.d.ts +7 -6
  273. package/dist/utils/one-shot-replay.js +3 -5
  274. package/dist/utils/page-colors.d.ts +15 -19
  275. package/dist/utils/page-colors.js +23 -45
  276. package/dist/utils/page-fonts.d.ts +1 -1
  277. package/dist/utils/page-fonts.js +8 -20
  278. package/dist/utils/page-preview.d.ts +0 -1
  279. package/dist/utils/page-preview.js +0 -1
  280. package/dist/utils/pages.d.ts +33 -3
  281. package/dist/utils/pages.js +83 -30
  282. package/dist/utils/privacy-regions.d.ts +19 -0
  283. package/dist/utils/privacy-regions.js +91 -0
  284. package/dist/utils/publish-form-data.d.ts +4 -5
  285. package/dist/utils/publish-form-data.js +2 -3
  286. package/dist/utils/publish-policy.d.ts +11 -17
  287. package/dist/utils/publish-policy.fixtures.json +11 -5
  288. package/dist/utils/publish-policy.js +65 -110
  289. package/dist/utils/query-client.d.ts +2 -0
  290. package/dist/utils/query-client.js +10 -1
  291. package/dist/utils/runtime-paths.d.ts +4 -4
  292. package/dist/utils/runtime-paths.js +6 -8
  293. package/dist/utils/runtime-upload.d.ts +9 -0
  294. package/dist/utils/runtime-upload.js +12 -0
  295. package/dist/utils/secure-local-file.d.ts +3 -3
  296. package/dist/utils/secure-local-file.js +23 -40
  297. package/dist/utils/space-config.d.ts +12 -15
  298. package/dist/utils/space-config.js +13 -16
  299. package/dist/utils/static-runtime-policy.d.ts +10 -7
  300. package/dist/utils/static-runtime-policy.fixtures.json +38 -41
  301. package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
  302. package/dist/utils/static-runtime-policy.generated.js +70 -0
  303. package/dist/utils/static-runtime-policy.js +31 -132
  304. package/dist/utils/storage-policy.js +1 -2
  305. package/dist/utils/upload-session.d.ts +4 -1
  306. package/dist/utils/upload-session.js +41 -19
  307. package/dist/utils/version-path.js +11 -19
  308. package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
  309. package/dist/utils/wpcom-auth-redirects.js +1 -4
  310. package/dist/vocabulary.d.ts +13 -13
  311. package/dist/vocabulary.js +52 -27
  312. package/package.json +15 -18
  313. package/dist/agents/client-registry.d.ts +0 -22
  314. package/dist/agents/client-registry.js +0 -41
  315. package/dist/docs/agent-handoff-document.d.ts +0 -15
  316. package/dist/docs/agent-handoff-document.js +0 -180
  317. package/dist/docs/agent-solutions.d.ts +0 -110
  318. package/dist/docs/agent-solutions.js +0 -183
  319. package/dist/utils/query-keys.d.ts +0 -84
  320. package/dist/utils/query-keys.js +0 -108
@@ -31,22 +31,19 @@ export declare const accessLogEntrySchema: z.ZodObject<{
31
31
  /**
32
32
  * One line a space's own code wrote, whichever tier wrote it.
33
33
  *
34
- * There is exactly one place these come from: the hosting provider's PHP error
35
- * log for the space's site. A Zero mutation, a PHP function, and a Functions
36
- * worker on Cloudflare all end up writing to that file on the origin — the
37
- * worker by tailing its output back to the origin that dispatched it — because
38
- * it is the only stream the provider ships off the box and serves back. The
39
- * runtime writes each record as one JSON line behind a marker; this is what the
40
- * reader gets after pulling that line back out of the provider's message.
34
+ * These come from one place: the hosting provider's PHP error log for the
35
+ * space's site, the only stream the provider ships off the box and serves back.
36
+ * A Zero mutation, a PHP function, and a Functions worker on Cloudflare all end
37
+ * up writing there, the worker by tailing its output back to the origin that
38
+ * dispatched it. The runtime writes each record as one JSON line behind a
39
+ * marker, and the reader gets that line back out of the provider's message.
41
40
  *
42
- * `id` is minted by the runtime at write time rather than derived on read: the
43
- * provider's log has no identity of its own, and a caller paging a window needs
44
- * a stable key for a line it may see again at a page boundary.
41
+ * `id` is minted by the runtime at write time: the provider's log has no
42
+ * identity of its own, and a caller paging a window needs a stable key for a
43
+ * line it may see again at a page boundary.
45
44
  *
46
- * Unlike its access-log sibling there is no `ts` alongside `timestamp`. That
47
- * duplication is a compatibility alias the access log carries for callers that
48
- * predate the rename; runtime logs have never been served to anyone, so there
49
- * is no caller to keep and no reason to inherit the wart.
45
+ * No `ts` alias beside `timestamp`. That is an access-log compatibility wart,
46
+ * and runtime logs have never been served to anyone.
50
47
  */
51
48
  export declare const runtimeLogEntrySchema: z.ZodObject<{
52
49
  id: z.ZodString;
@@ -54,8 +51,8 @@ export declare const runtimeLogEntrySchema: z.ZodObject<{
54
51
  level: z.ZodEnum<{
55
52
  info: "info";
56
53
  error: "error";
57
- debug: "debug";
58
54
  warn: "warn";
55
+ debug: "debug";
59
56
  }>;
60
57
  requestId: z.ZodNullable<z.ZodString>;
61
58
  versionId: z.ZodNullable<z.ZodString>;
@@ -65,12 +62,11 @@ export declare const runtimeLogEntrySchema: z.ZodObject<{
65
62
  }, z.core.$strict>;
66
63
  export type RuntimeLogEntry = z.infer<typeof runtimeLogEntrySchema>;
67
64
  /**
68
- * Windowed like its access-log sibling, because it reads the same provider
69
- * index — `atomic_site_id` plus a `@timestamp` range and that index has no
70
- * other way in. The two log kinds sit side by side under one command, so they
71
- * take one query shape; `requestId` and `handlerName` are the extra narrowings
72
- * only handler output can answer, and they are applied over the pages the
73
- * server fetched rather than by the provider, which indexes neither.
65
+ * Windowed like its access-log sibling, because it reads the same provider index
66
+ * (`atomic_site_id` plus a `@timestamp` range) and that index has no other way
67
+ * in. `requestId` and `handlerName` are the extra narrowings only handler output
68
+ * can answer, applied over the pages the server fetched because the provider
69
+ * indexes neither.
74
70
  */
75
71
  export declare const runtimeLogListQuerySchema: z.ZodObject<{
76
72
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -107,7 +103,7 @@ export declare const accessLogListResponseSchema: z.ZodObject<{
107
103
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
108
104
  provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
109
105
  registrar: "registrar";
110
- wpcloud: "wpcloud";
106
+ infra: "infra";
111
107
  dns: "dns";
112
108
  runtime: "runtime";
113
109
  }>>>;
@@ -119,26 +115,17 @@ export declare const accessLogListResponseSchema: z.ZodObject<{
119
115
  /**
120
116
  * Paged handler logs.
121
117
  *
122
- * One thing about that cursor is worth stating rather than discovering: **an
123
- * empty page does not mean the end.** The cursor walks the provider's scroll
118
+ * An empty page does not mean the end. The cursor walks the provider's scroll
124
119
  * over every PHP-error-log line in the window, and only some of those lines are
125
- * handler output a page can come back empty because the stretch it scanned
126
- * held none, or held none matching `requestId`/`handlerName`. The rule is
127
- * **`hasMore: false` means you have seen everything; `hasMore: true` means keep
128
- * paging, whatever `data` held.** A client that stops on the first empty page
129
- * will silently truncate its own search.
130
- *
131
- * `warnings` carries the same `log_retention_clamped` diagnostic the access log
132
- * does, for the same reason: one window, one retention, one way of saying it
133
- * was cut back.
120
+ * handler output, so a page can come back empty. `hasMore: false` means you have
121
+ * seen everything; `hasMore: true` means keep paging, whatever `data` held. A
122
+ * client that stops on the first empty page truncates its own search.
134
123
  *
135
- * **These lines lag.** A record is written to a file on the origin, shipped off
136
- * the box, and indexed before it can be read back, so a line a request just
137
- * wrote will not be in the next page. Nothing here is live, and the delay is
138
- * the provider's ingest lag rather than anything this surface schedules it
139
- * has not been measured against a real client yet, so no surface should quote
140
- * a figure for it until the gate probe in
141
- * `e2e-tests/direct/wpcloud-behavior.test.ts` has actually run.
124
+ * These lines lag. A record is written to a file on the origin, shipped off the
125
+ * box, and indexed before it can be read back, so a line a request just wrote
126
+ * will not be in the next page. The delay is the provider's ingest lag and has
127
+ * not been measured, so no surface should quote a figure for it until the gate
128
+ * probe in `e2e-tests/direct/wpcloud-behavior.test.ts` has run.
142
129
  */
143
130
  export declare const runtimeLogListResponseSchema: z.ZodObject<{
144
131
  data: z.ZodArray<z.ZodObject<{
@@ -147,8 +134,8 @@ export declare const runtimeLogListResponseSchema: z.ZodObject<{
147
134
  level: z.ZodEnum<{
148
135
  info: "info";
149
136
  error: "error";
150
- debug: "debug";
151
137
  warn: "warn";
138
+ debug: "debug";
152
139
  }>;
153
140
  requestId: z.ZodNullable<z.ZodString>;
154
141
  versionId: z.ZodNullable<z.ZodString>;
@@ -171,7 +158,7 @@ export declare const runtimeLogListResponseSchema: z.ZodObject<{
171
158
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
172
159
  provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
173
160
  registrar: "registrar";
174
- wpcloud: "wpcloud";
161
+ infra: "infra";
175
162
  dns: "dns";
176
163
  runtime: "runtime";
177
164
  }>>>;
@@ -30,22 +30,19 @@ export const accessLogEntrySchema = z.object({
30
30
  /**
31
31
  * One line a space's own code wrote, whichever tier wrote it.
32
32
  *
33
- * There is exactly one place these come from: the hosting provider's PHP error
34
- * log for the space's site. A Zero mutation, a PHP function, and a Functions
35
- * worker on Cloudflare all end up writing to that file on the origin — the
36
- * worker by tailing its output back to the origin that dispatched it — because
37
- * it is the only stream the provider ships off the box and serves back. The
38
- * runtime writes each record as one JSON line behind a marker; this is what the
39
- * reader gets after pulling that line back out of the provider's message.
33
+ * These come from one place: the hosting provider's PHP error log for the
34
+ * space's site, the only stream the provider ships off the box and serves back.
35
+ * A Zero mutation, a PHP function, and a Functions worker on Cloudflare all end
36
+ * up writing there, the worker by tailing its output back to the origin that
37
+ * dispatched it. The runtime writes each record as one JSON line behind a
38
+ * marker, and the reader gets that line back out of the provider's message.
40
39
  *
41
- * `id` is minted by the runtime at write time rather than derived on read: the
42
- * provider's log has no identity of its own, and a caller paging a window needs
43
- * a stable key for a line it may see again at a page boundary.
40
+ * `id` is minted by the runtime at write time: the provider's log has no
41
+ * identity of its own, and a caller paging a window needs a stable key for a
42
+ * line it may see again at a page boundary.
44
43
  *
45
- * Unlike its access-log sibling there is no `ts` alongside `timestamp`. That
46
- * duplication is a compatibility alias the access log carries for callers that
47
- * predate the rename; runtime logs have never been served to anyone, so there
48
- * is no caller to keep and no reason to inherit the wart.
44
+ * No `ts` alias beside `timestamp`. That is an access-log compatibility wart,
45
+ * and runtime logs have never been served to anyone.
49
46
  */
50
47
  export const runtimeLogEntrySchema = z
51
48
  .object({
@@ -61,12 +58,11 @@ export const runtimeLogEntrySchema = z
61
58
  })
62
59
  .strict();
63
60
  /**
64
- * Windowed like its access-log sibling, because it reads the same provider
65
- * index — `atomic_site_id` plus a `@timestamp` range and that index has no
66
- * other way in. The two log kinds sit side by side under one command, so they
67
- * take one query shape; `requestId` and `handlerName` are the extra narrowings
68
- * only handler output can answer, and they are applied over the pages the
69
- * server fetched rather than by the provider, which indexes neither.
61
+ * Windowed like its access-log sibling, because it reads the same provider index
62
+ * (`atomic_site_id` plus a `@timestamp` range) and that index has no other way
63
+ * in. `requestId` and `handlerName` are the extra narrowings only handler output
64
+ * can answer, applied over the pages the server fetched because the provider
65
+ * indexes neither.
70
66
  */
71
67
  export const runtimeLogListQuerySchema = logWindowQuerySchema.extend({
72
68
  requestId: z
@@ -78,7 +74,7 @@ export const runtimeLogListQuerySchema = logWindowQuerySchema.extend({
78
74
  .string()
79
75
  .min(1)
80
76
  .optional()
81
- .describe("Return only lines from this handler a Zero mutation or a Functions handler."),
77
+ .describe("Return only lines from this handler, either a Zero mutation or a Functions handler."),
82
78
  });
83
79
  export const accessLogListResponseSchema = z.object({
84
80
  data: z.array(accessLogEntrySchema),
@@ -91,26 +87,17 @@ export const accessLogListResponseSchema = z.object({
91
87
  /**
92
88
  * Paged handler logs.
93
89
  *
94
- * One thing about that cursor is worth stating rather than discovering: **an
95
- * empty page does not mean the end.** The cursor walks the provider's scroll
90
+ * An empty page does not mean the end. The cursor walks the provider's scroll
96
91
  * over every PHP-error-log line in the window, and only some of those lines are
97
- * handler output a page can come back empty because the stretch it scanned
98
- * held none, or held none matching `requestId`/`handlerName`. The rule is
99
- * **`hasMore: false` means you have seen everything; `hasMore: true` means keep
100
- * paging, whatever `data` held.** A client that stops on the first empty page
101
- * will silently truncate its own search.
92
+ * handler output, so a page can come back empty. `hasMore: false` means you have
93
+ * seen everything; `hasMore: true` means keep paging, whatever `data` held. A
94
+ * client that stops on the first empty page truncates its own search.
102
95
  *
103
- * `warnings` carries the same `log_retention_clamped` diagnostic the access log
104
- * does, for the same reason: one window, one retention, one way of saying it
105
- * was cut back.
106
- *
107
- * **These lines lag.** A record is written to a file on the origin, shipped off
108
- * the box, and indexed before it can be read back, so a line a request just
109
- * wrote will not be in the next page. Nothing here is live, and the delay is
110
- * the provider's ingest lag rather than anything this surface schedules — it
111
- * has not been measured against a real client yet, so no surface should quote
112
- * a figure for it until the gate probe in
113
- * `e2e-tests/direct/wpcloud-behavior.test.ts` has actually run.
96
+ * These lines lag. A record is written to a file on the origin, shipped off the
97
+ * box, and indexed before it can be read back, so a line a request just wrote
98
+ * will not be in the next page. The delay is the provider's ingest lag and has
99
+ * not been measured, so no surface should quote a figure for it until the gate
100
+ * probe in `e2e-tests/direct/wpcloud-behavior.test.ts` has run.
114
101
  */
115
102
  export const runtimeLogListResponseSchema = z.object({
116
103
  data: z.array(runtimeLogEntrySchema),
@@ -127,7 +114,7 @@ export const analyticsQuerySchema = z.object({
127
114
  .describe('Analytics summary window. Defaults to "7d".'),
128
115
  });
129
116
  // Served by `GET /v1/spaces/{spaceId}/analytics`: traffic summary over the
130
- // requested window, read live from the hosting provider's edge metrics — no
117
+ // requested window, read live from the hosting provider's edge metrics. No
131
118
  // local store exists. Counts cover every hostname mapped to the space's site;
132
119
  // a provider outage means this endpoint errors rather than answers stale.
133
120
  export const analyticsResponseSchema = z.object({
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import { diagnosticSeverity } from "./enums.js";
3
3
  import { planCodeSchema, planLimitValueSchema } from "./features.js";
4
4
  // Behaviors the platform disables (rather than failing publishes) when the
5
- // plan does not include them (internal-docs/platform.md "Plans And Limits").
5
+ // plan does not include them (the platform spec "Plans And Limits").
6
6
  export const PLAN_DISABLED_BEHAVIOR_CODES = [
7
7
  "free_external_proxy_disabled",
8
8
  "routing_rules_over_plan",
@@ -0,0 +1,43 @@
1
+ import { z } from "zod";
2
+ export declare const exactOriginSchema: z.core.$ZodBranded<z.ZodString, "ExactOrigin", "out">;
3
+ export type ExactOrigin = z.infer<typeof exactOriginSchema>;
4
+ export declare const principalAssertionV1Schema: z.ZodUnion<readonly [z.ZodObject<{
5
+ actor: z.ZodObject<{
6
+ kind: z.ZodLiteral<"user">;
7
+ id: z.ZodString;
8
+ }, z.core.$strict>;
9
+ subject: z.ZodOptional<z.ZodObject<{
10
+ issuer: z.ZodString;
11
+ subject: z.ZodString;
12
+ }, z.core.$strict>>;
13
+ format: z.ZodLiteral<"spacefast.principal">;
14
+ version: z.ZodLiteral<1>;
15
+ audience: z.ZodObject<{
16
+ spaceId: z.ZodTemplateLiteral<`spc_${string}`>;
17
+ runtimeInstanceId: z.ZodString;
18
+ host: z.core.$ZodBranded<z.ZodString, "ExactOrigin", "out">;
19
+ }, z.core.$strict>;
20
+ sessionVersion: z.ZodNumber;
21
+ accessGeneration: z.ZodNumber;
22
+ nonce: z.ZodString;
23
+ issuedAt: z.ZodNumber;
24
+ expiresAt: z.ZodNumber;
25
+ }, z.core.$strict>, z.ZodObject<{
26
+ actor: z.ZodObject<{
27
+ kind: z.ZodLiteral<"service">;
28
+ id: z.ZodString;
29
+ }, z.core.$strict>;
30
+ format: z.ZodLiteral<"spacefast.principal">;
31
+ version: z.ZodLiteral<1>;
32
+ audience: z.ZodObject<{
33
+ spaceId: z.ZodTemplateLiteral<`spc_${string}`>;
34
+ runtimeInstanceId: z.ZodString;
35
+ host: z.core.$ZodBranded<z.ZodString, "ExactOrigin", "out">;
36
+ }, z.core.$strict>;
37
+ sessionVersion: z.ZodNumber;
38
+ accessGeneration: z.ZodNumber;
39
+ nonce: z.ZodString;
40
+ issuedAt: z.ZodNumber;
41
+ expiresAt: z.ZodNumber;
42
+ }, z.core.$strict>]>;
43
+ export type PrincipalAssertionV1 = z.infer<typeof principalAssertionV1Schema>;
@@ -0,0 +1,67 @@
1
+ import { z } from "zod";
2
+ import { registeredIdSchema } from "./ids.js";
3
+ function isExactHttpOrigin(value) {
4
+ let url;
5
+ try {
6
+ url = new URL(value);
7
+ }
8
+ catch {
9
+ return false;
10
+ }
11
+ return ((url.protocol === "https:" || url.protocol === "http:") &&
12
+ url.origin === value &&
13
+ url.pathname === "/" &&
14
+ url.search === "" &&
15
+ url.hash === "" &&
16
+ url.username === "" &&
17
+ url.password === "");
18
+ }
19
+ export const exactOriginSchema = z
20
+ .string()
21
+ .url()
22
+ .max(2_000)
23
+ .refine(isExactHttpOrigin, "must be an exact HTTP origin without path, credentials, query, or fragment")
24
+ .brand();
25
+ const principalAudienceSchema = z
26
+ .object({
27
+ spaceId: registeredIdSchema("spc"),
28
+ runtimeInstanceId: z.string().min(1).max(255),
29
+ host: exactOriginSchema,
30
+ })
31
+ .strict();
32
+ const principalSubjectSchema = z
33
+ .object({
34
+ issuer: z.string().min(1).max(255),
35
+ subject: z.string().min(1).max(512),
36
+ })
37
+ .strict();
38
+ const principalAssertionFields = {
39
+ format: z.literal("spacefast.principal"),
40
+ version: z.literal(1),
41
+ audience: principalAudienceSchema,
42
+ sessionVersion: z.number().int().nonnegative(),
43
+ accessGeneration: z.number().int().nonnegative(),
44
+ nonce: z.string().min(16).max(512),
45
+ issuedAt: z.number().int().nonnegative(),
46
+ expiresAt: z.number().int().positive(),
47
+ };
48
+ export const principalAssertionV1Schema = z
49
+ .union([
50
+ z
51
+ .object({
52
+ ...principalAssertionFields,
53
+ actor: z.object({ kind: z.literal("user"), id: z.string().min(1).max(255) }).strict(),
54
+ subject: principalSubjectSchema.optional(),
55
+ })
56
+ .strict(),
57
+ z
58
+ .object({
59
+ ...principalAssertionFields,
60
+ actor: z.object({ kind: z.literal("service"), id: z.string().min(1).max(255) }).strict(),
61
+ })
62
+ .strict(),
63
+ ])
64
+ .refine((assertion) => assertion.expiresAt > assertion.issuedAt, {
65
+ path: ["expiresAt"],
66
+ message: "expiresAt must be after issuedAt",
67
+ });
@@ -0,0 +1,73 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * An external principal: the partner's own customer, as this platform knows it.
4
+ *
5
+ * A principal is materialized the first time it owns something here, never by
6
+ * registration — there is no "create principal" call, and the id is whatever
7
+ * the partner already calls that customer in its own system. `principalId` is
8
+ * therefore the partner's id verbatim, casing included; matching within a
9
+ * tenant is case-insensitive, so `Cus_ABC` and `cus_abc` are one principal and
10
+ * the first spelling seen is the one kept.
11
+ *
12
+ * `principalType` is a literal rather than the team/external union the resource
13
+ * refs use: teams are principals too, but they are addressed as teams and have
14
+ * their own surface. This resource exists to answer "who are my customers", and
15
+ * only external principals are.
16
+ */
17
+ export declare const PrincipalSchema: z.ZodObject<{
18
+ principalType: z.ZodLiteral<"external">;
19
+ principalId: z.ZodString;
20
+ mode: z.ZodEnum<{
21
+ live: "live";
22
+ test: "test";
23
+ }>;
24
+ spaceCount: z.ZodNumber;
25
+ status: z.ZodEnum<{
26
+ active: "active";
27
+ suspended: "suspended";
28
+ closed: "closed";
29
+ }>;
30
+ statusReason: z.ZodNullable<z.ZodString>;
31
+ statusChangedAt: z.ZodNullable<z.ZodString>;
32
+ statusActor: z.ZodNullable<z.ZodEnum<{
33
+ spacefast: "spacefast";
34
+ partner: "partner";
35
+ }>>;
36
+ assignedPlan: z.ZodNullable<z.ZodString>;
37
+ createdAt: z.ZodString;
38
+ updatedAt: z.ZodString;
39
+ }, z.core.$strip>;
40
+ export type Principal = z.infer<typeof PrincipalSchema>;
41
+ export declare const principalListSchema: z.ZodObject<{
42
+ data: z.ZodArray<z.ZodObject<{
43
+ principalType: z.ZodLiteral<"external">;
44
+ principalId: z.ZodString;
45
+ mode: z.ZodEnum<{
46
+ live: "live";
47
+ test: "test";
48
+ }>;
49
+ spaceCount: z.ZodNumber;
50
+ status: z.ZodEnum<{
51
+ active: "active";
52
+ suspended: "suspended";
53
+ closed: "closed";
54
+ }>;
55
+ statusReason: z.ZodNullable<z.ZodString>;
56
+ statusChangedAt: z.ZodNullable<z.ZodString>;
57
+ statusActor: z.ZodNullable<z.ZodEnum<{
58
+ spacefast: "spacefast";
59
+ partner: "partner";
60
+ }>>;
61
+ assignedPlan: z.ZodNullable<z.ZodString>;
62
+ createdAt: z.ZodString;
63
+ updatedAt: z.ZodString;
64
+ }, z.core.$strip>>;
65
+ pagination: z.ZodObject<{
66
+ nextCursor: z.ZodNullable<z.ZodString>;
67
+ hasMore: z.ZodBoolean;
68
+ }, z.core.$strip>;
69
+ }, z.core.$strip>;
70
+ export type PrincipalList = z.infer<typeof principalListSchema>;
71
+ export declare const PrincipalParamsSchema: z.ZodObject<{
72
+ principalId: z.ZodString;
73
+ }, z.core.$strip>;
@@ -0,0 +1,59 @@
1
+ import { z } from "zod";
2
+ import { principalLifecycleStatusSchema, principalStatusActorSchema } from "./commerce.js";
3
+ import { CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
4
+ import { tenantMode } from "./enums.js";
5
+ /**
6
+ * An external principal: the partner's own customer, as this platform knows it.
7
+ *
8
+ * A principal is materialized the first time it owns something here, never by
9
+ * registration — there is no "create principal" call, and the id is whatever
10
+ * the partner already calls that customer in its own system. `principalId` is
11
+ * therefore the partner's id verbatim, casing included; matching within a
12
+ * tenant is case-insensitive, so `Cus_ABC` and `cus_abc` are one principal and
13
+ * the first spelling seen is the one kept.
14
+ *
15
+ * `principalType` is a literal rather than the team/external union the resource
16
+ * refs use: teams are principals too, but they are addressed as teams and have
17
+ * their own surface. This resource exists to answer "who are my customers", and
18
+ * only external principals are.
19
+ */
20
+ export const PrincipalSchema = z.object({
21
+ principalType: z
22
+ .literal("external")
23
+ .describe("Always `external`: teams are principals too, but they have their own surface."),
24
+ principalId: z
25
+ .string()
26
+ .describe("The partner's own id for this customer, in the casing it was first seen."),
27
+ mode: tenantMode.describe("`test` when this principal belongs to a linked test tenant, `live` otherwise."),
28
+ spaceCount: z
29
+ .number()
30
+ .int()
31
+ .nonnegative()
32
+ .describe("Spaces this principal currently owns in the tenant."),
33
+ status: principalLifecycleStatusSchema.describe("Lifecycle status. `active` by default; `suspended` reversibly halts the principal's spaces and mutations; `closed` is terminal."),
34
+ statusReason: z
35
+ .string()
36
+ .nullable()
37
+ .describe("Free-text reason recorded with the last status change, or null."),
38
+ statusChangedAt: z
39
+ .string()
40
+ .datetime()
41
+ .nullable()
42
+ .describe("When the status last changed, or null while never changed from the default."),
43
+ statusActor: principalStatusActorSchema
44
+ .nullable()
45
+ .describe("Who applied the current status: `partner` (the tenant) or `spacefast` (unliftable by the partner). Null while never changed."),
46
+ assignedPlan: z
47
+ .string()
48
+ .nullable()
49
+ .describe("Plan name assigned from the tenant's catalog, or null to fall back to defaultPlan."),
50
+ createdAt: z.string().datetime().describe("When this principal first owned something here."),
51
+ updatedAt: z.string().datetime().describe("When this principal was last seen owning something."),
52
+ });
53
+ export const principalListSchema = z.object({
54
+ data: z.array(PrincipalSchema),
55
+ pagination: CursorPaginationSchema,
56
+ });
57
+ export const PrincipalParamsSchema = z.object({
58
+ principalId: z.string().min(1).describe("The partner's own id for this customer."),
59
+ });
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ export declare const privacySettingsSchema: z.ZodObject<{
3
+ analyticsOptOut: z.ZodBoolean;
4
+ advertisingOptOut: z.ZodBoolean;
5
+ }, z.core.$strip>;
6
+ export type PrivacySettings = z.infer<typeof privacySettingsSchema>;
7
+ export declare const privacySettingsPatchSchema: z.ZodObject<{
8
+ analyticsOptOut: z.ZodOptional<z.ZodBoolean>;
9
+ advertisingOptOut: z.ZodOptional<z.ZodBoolean>;
10
+ }, z.core.$strip>;
11
+ export type PrivacySettingsPatch = z.infer<typeof privacySettingsPatchSchema>;
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ // Account-level privacy choices, modeled on WordPress.com's `/me/settings`
3
+ // pair (`tracks_opt_out`, `advertising_targeting_opt_out`). These are durable
4
+ // server-side settings, distinct from the browser cookie-consent buckets: the
5
+ // cookie answers "what may run in THIS browser", these answer "what may this
6
+ // ACCOUNT's data be used for" on every device.
7
+ export const privacySettingsSchema = z.object({
8
+ analyticsOptOut: z
9
+ .boolean()
10
+ .describe("Opt out of product analytics. When true, no analytics events are recorded for this account, in the browser or server-side."),
11
+ advertisingOptOut: z
12
+ .boolean()
13
+ .describe("Do-not-sell/share election (CCPA). When true, the account is excluded from any advertising or audience use."),
14
+ });
15
+ export const privacySettingsPatchSchema = privacySettingsSchema
16
+ .partial()
17
+ .describe("Fields to change; omitted fields are left alone.");
@@ -1,7 +1,6 @@
1
- // Reader for the RFC 9457 problem document every 4xx/5xx response carries, so the
2
- // client surfaces (CLI, MCP, SDK) share one definition of which members exist and
3
- // which values are trusted. Callers keep their own entry guards, message fallbacks
4
- // and public field names — this only extracts the wire members.
1
+ // Reader for the RFC 9457 problem document every 4xx/5xx response carries, so
2
+ // the CLI, MCP, and SDK share one definition of the wire members. Callers keep
3
+ // their own entry guards, message fallbacks, and public field names.
5
4
  /** Returns undefined when the payload cannot be a problem document at all. */
6
5
  export function parseProblemDocument(payload) {
7
6
  if (!payload || typeof payload !== "object" || Array.isArray(payload)) {