@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
@@ -0,0 +1,135 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * One manifest key's materialization status, as it surfaces on the tenant
4
+ * self-view. This is a projection, not the stored blob: the reconcile records a
5
+ * `declared` snapshot per item, but that (and any ownership proof inside it) is
6
+ * NEVER serialized to a partner surface — the self-view carries only where each
7
+ * key landed, not what was declared.
8
+ */
9
+ export declare const ManifestStatusItemSchema: z.ZodObject<{
10
+ key: z.ZodString;
11
+ state: z.ZodEnum<{
12
+ active: "active";
13
+ failed: "failed";
14
+ pending: "pending";
15
+ }>;
16
+ detail: z.ZodOptional<z.ZodString>;
17
+ since: z.ZodString;
18
+ audience: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strip>;
20
+ export type ManifestStatusItem = z.infer<typeof ManifestStatusItemSchema>;
21
+ /**
22
+ * The materialization status of the tenant's system-space manifest: one item per
23
+ * declared key, plus the live version they were all converged from. Empty items
24
+ * with a null `sourceVersionId` means nothing is materialized (no designated
25
+ * system space, no live version, or an empty manifest).
26
+ */
27
+ export declare const ManifestStatusSchema: z.ZodObject<{
28
+ items: z.ZodArray<z.ZodObject<{
29
+ key: z.ZodString;
30
+ state: z.ZodEnum<{
31
+ active: "active";
32
+ failed: "failed";
33
+ pending: "pending";
34
+ }>;
35
+ detail: z.ZodOptional<z.ZodString>;
36
+ since: z.ZodString;
37
+ audience: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strip>>;
39
+ sourceVersionId: z.ZodNullable<z.ZodString>;
40
+ }, z.core.$strip>;
41
+ export type ManifestStatus = z.infer<typeof ManifestStatusSchema>;
42
+ /**
43
+ * A tenant's view of itself.
44
+ *
45
+ * Deliberately a self-view and not a tenant directory: a credential is rooted
46
+ * at exactly one tenant, so the only tenant it can read is its own. There is no
47
+ * list, and asking for another tenant's id is a refusal rather than an empty
48
+ * result.
49
+ *
50
+ * `provisioning.mode` is derived, not stored: a tenant whose sites run under
51
+ * its own provider client is `byo`, everything else is `managed`. That means
52
+ * the answer follows the actual account wiring instead of a flag someone has to
53
+ * remember to flip.
54
+ */
55
+ export declare const TenantSelfSchema: z.ZodObject<{
56
+ id: z.ZodString;
57
+ kind: z.ZodEnum<{
58
+ internal: "internal";
59
+ main: "main";
60
+ partner: "partner";
61
+ }>;
62
+ mode: z.ZodEnum<{
63
+ live: "live";
64
+ test: "test";
65
+ }>;
66
+ status: z.ZodEnum<{
67
+ active: "active";
68
+ past_due: "past_due";
69
+ suspended: "suspended";
70
+ deleted: "deleted";
71
+ }>;
72
+ name: z.ZodString;
73
+ defaultRegion: z.ZodNullable<z.ZodString>;
74
+ provisioning: z.ZodObject<{
75
+ mode: z.ZodEnum<{
76
+ managed: "managed";
77
+ byo: "byo";
78
+ }>;
79
+ providerClientId: z.ZodNullable<z.ZodString>;
80
+ }, z.core.$strip>;
81
+ systemSpaceId: z.ZodNullable<z.ZodString>;
82
+ manifestStatus: z.ZodObject<{
83
+ items: z.ZodArray<z.ZodObject<{
84
+ key: z.ZodString;
85
+ state: z.ZodEnum<{
86
+ active: "active";
87
+ failed: "failed";
88
+ pending: "pending";
89
+ }>;
90
+ detail: z.ZodOptional<z.ZodString>;
91
+ since: z.ZodString;
92
+ audience: z.ZodOptional<z.ZodString>;
93
+ }, z.core.$strip>>;
94
+ sourceVersionId: z.ZodNullable<z.ZodString>;
95
+ }, z.core.$strip>;
96
+ presentation: z.ZodNullable<z.ZodObject<{
97
+ name: z.ZodOptional<z.ZodString>;
98
+ logo: z.ZodOptional<z.ZodString>;
99
+ supportUrl: z.ZodOptional<z.ZodString>;
100
+ claimOrigin: z.ZodOptional<z.ZodString>;
101
+ accessHandoffOrigin: z.ZodOptional<z.ZodString>;
102
+ problemDocsBaseUrl: z.ZodOptional<z.ZodString>;
103
+ contacts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
104
+ }, z.core.$strict>>;
105
+ createdAt: z.ZodString;
106
+ updatedAt: z.ZodString;
107
+ }, z.core.$strip>;
108
+ export type TenantSelf = z.infer<typeof TenantSelfSchema>;
109
+ /**
110
+ * Compare-and-swap on the system space, house style: send the value you believe
111
+ * is current as `baseSystemSpaceId` and the write is rejected with a conflict
112
+ * if it has moved under you. Omit it to write unconditionally. This mirrors
113
+ * `baseSettingsDigest` on spaces — the CAS token rides in the body, not in an
114
+ * `If-Match` header.
115
+ */
116
+ export declare const tenantPatchSchema: z.ZodObject<{
117
+ systemSpaceId: z.ZodNullable<z.ZodString>;
118
+ baseSystemSpaceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
119
+ }, z.core.$strip>;
120
+ export type TenantPatch = z.infer<typeof tenantPatchSchema>;
121
+ export declare const TenantParamsSchema: z.ZodObject<{
122
+ tenantId: z.ZodString;
123
+ }, z.core.$strip>;
124
+ /**
125
+ * Promote the linked test tenant's system-space configuration onto this (live)
126
+ * tenant. An explicit export/copy, never a mode flip: the test tenant's
127
+ * system-space manifest (minus its token issuers, which each mode declares
128
+ * distinctly) is carried onto the live tenant's designated system space and
129
+ * reconciled with fresh ids and fresh verification. Test data stays test.
130
+ *
131
+ * No parameters today; the body is reserved for future promotion options
132
+ * (a subset of keys to promote, a dry-run, a CAS token).
133
+ */
134
+ export declare const tenantPromoteSchema: z.ZodObject<{}, z.core.$strip>;
135
+ export type TenantPromote = z.infer<typeof tenantPromoteSchema>;
@@ -0,0 +1,120 @@
1
+ import { z } from "zod";
2
+ import { tenantKind, tenantMode, tenantStatus } from "./enums.js";
3
+ import { systemPresentationSchema } from "./space-config.js";
4
+ /**
5
+ * One manifest key's materialization status, as it surfaces on the tenant
6
+ * self-view. This is a projection, not the stored blob: the reconcile records a
7
+ * `declared` snapshot per item, but that (and any ownership proof inside it) is
8
+ * NEVER serialized to a partner surface — the self-view carries only where each
9
+ * key landed, not what was declared.
10
+ */
11
+ export const ManifestStatusItemSchema = z.object({
12
+ key: z.string().describe("The manifest key this item materializes."),
13
+ state: z
14
+ .enum(["pending", "active", "failed"])
15
+ .describe("Where the last reconcile landed this key."),
16
+ detail: z
17
+ .string()
18
+ .optional()
19
+ .describe("Human-readable reason, present when the state warrants one (typically `failed`)."),
20
+ since: z
21
+ .string()
22
+ .datetime()
23
+ .describe("When this key last CHANGED state — stable across no-op re-runs, so it reads as `<state> since …`."),
24
+ audience: z
25
+ .string()
26
+ .optional()
27
+ .describe("`tokenIssuers` only: the server-minted opaque audience for the issuer this key materialized. Not a secret — it rides in every partner token's `aud` claim and is verified server-side — and the partner needs it to sign the activation proof and to mint tokens, so it is served here rather than handed over out of band."),
28
+ });
29
+ /**
30
+ * The materialization status of the tenant's system-space manifest: one item per
31
+ * declared key, plus the live version they were all converged from. Empty items
32
+ * with a null `sourceVersionId` means nothing is materialized (no designated
33
+ * system space, no live version, or an empty manifest).
34
+ */
35
+ export const ManifestStatusSchema = z.object({
36
+ items: z.array(ManifestStatusItemSchema).describe("Per-key materialization status."),
37
+ sourceVersionId: z
38
+ .string()
39
+ .nullable()
40
+ .describe("The system space's live version every item was converged from, or null when nothing is materialized."),
41
+ });
42
+ /**
43
+ * A tenant's view of itself.
44
+ *
45
+ * Deliberately a self-view and not a tenant directory: a credential is rooted
46
+ * at exactly one tenant, so the only tenant it can read is its own. There is no
47
+ * list, and asking for another tenant's id is a refusal rather than an empty
48
+ * result.
49
+ *
50
+ * `provisioning.mode` is derived, not stored: a tenant whose sites run under
51
+ * its own provider client is `byo`, everything else is `managed`. That means
52
+ * the answer follows the actual account wiring instead of a flag someone has to
53
+ * remember to flip.
54
+ */
55
+ export const TenantSelfSchema = z.object({
56
+ id: z.string().describe("Tenant id."),
57
+ kind: tenantKind.describe("Tenant class."),
58
+ mode: tenantMode.describe("`test` for a linked test tenant (a sandbox twin), `live` otherwise. Distinct from `provisioning.mode`."),
59
+ status: tenantStatus.describe("Whether the tenant is active, past due, suspended, or deleted."),
60
+ name: z.string().describe("Human-readable tenant name."),
61
+ defaultRegion: z
62
+ .string()
63
+ .nullable()
64
+ .describe("Region new spaces are placed in unless one is requested; null means auto."),
65
+ provisioning: z
66
+ .object({
67
+ mode: z
68
+ .enum(["managed", "byo"])
69
+ .describe("`byo` when the tenant's sites run under its own provider client, `managed` when they run under ours."),
70
+ providerClientId: z
71
+ .string()
72
+ .nullable()
73
+ .describe("The tenant's own provider client (`pvc_`), when it has one."),
74
+ })
75
+ .describe("How this tenant's infrastructure is accounted for."),
76
+ systemSpaceId: z
77
+ .string()
78
+ .nullable()
79
+ .describe("Space designated as this tenant's own system surface (its dashboard, portal, or control page). Must be a space this tenant owns."),
80
+ manifestStatus: ManifestStatusSchema.describe("Materialization status of the system-space manifest, reconciled from that space's live version."),
81
+ presentation: systemPresentationSchema
82
+ .nullable()
83
+ .describe("The partner-facing branding and links currently materialized from the system-space manifest, or null when none is materialized."),
84
+ createdAt: z.string().datetime(),
85
+ updatedAt: z.string().datetime(),
86
+ });
87
+ /**
88
+ * Compare-and-swap on the system space, house style: send the value you believe
89
+ * is current as `baseSystemSpaceId` and the write is rejected with a conflict
90
+ * if it has moved under you. Omit it to write unconditionally. This mirrors
91
+ * `baseSettingsDigest` on spaces — the CAS token rides in the body, not in an
92
+ * `If-Match` header.
93
+ */
94
+ export const tenantPatchSchema = z.object({
95
+ systemSpaceId: z
96
+ .string()
97
+ .nullable()
98
+ .describe("Space to designate as the tenant's system surface, or null to clear it."),
99
+ baseSystemSpaceId: z
100
+ .string()
101
+ .nullable()
102
+ .optional()
103
+ .describe("The systemSpaceId the caller believes is current. When supplied and stale, the write is rejected instead of applied."),
104
+ });
105
+ export const TenantParamsSchema = z.object({
106
+ tenantId: z.string().min(1).describe("Tenant id. Must be the credential's own tenant."),
107
+ });
108
+ /**
109
+ * Promote the linked test tenant's system-space configuration onto this (live)
110
+ * tenant. An explicit export/copy, never a mode flip: the test tenant's
111
+ * system-space manifest (minus its token issuers, which each mode declares
112
+ * distinctly) is carried onto the live tenant's designated system space and
113
+ * reconciled with fresh ids and fresh verification. Test data stays test.
114
+ *
115
+ * No parameters today; the body is reserved for future promotion options
116
+ * (a subset of keys to promote, a dry-run, a CAS token).
117
+ */
118
+ export const tenantPromoteSchema = z
119
+ .object({})
120
+ .describe("Promotion request. No parameters yet; reserved for future options.");
@@ -0,0 +1,70 @@
1
+ import { z } from "zod";
2
+ import type { TenantMode } from "./enums.js";
3
+ export declare const testTriggerValues: readonly ["build_failure", "domain_verification_pending", "domain_verification_failed", "tls_failure", "rate_limit", "webhook_retry", "principal_suspension", "usage_correction"];
4
+ export declare const testTrigger: z.ZodEnum<{
5
+ rate_limit: "rate_limit";
6
+ build_failure: "build_failure";
7
+ domain_verification_pending: "domain_verification_pending";
8
+ domain_verification_failed: "domain_verification_failed";
9
+ tls_failure: "tls_failure";
10
+ webhook_retry: "webhook_retry";
11
+ principal_suspension: "principal_suspension";
12
+ usage_correction: "usage_correction";
13
+ }>;
14
+ export type TestTrigger = z.infer<typeof testTrigger>;
15
+ /**
16
+ * Every trigger, in one record: the reserved token, the input that carries it,
17
+ * and what a test tenant gets instead of success.
18
+ *
19
+ * `carrier` and `effect` are contract text, not commentary — the partner API
20
+ * document renders its trigger table straight from them, so a renamed token or
21
+ * a new trigger cannot leave the published contract describing something else.
22
+ *
23
+ * No token is a substring of another, so a plain `includes` scan is unambiguous.
24
+ * Keep them lowercase — the detector lowercases the input, and every carrier (a
25
+ * DNS label, a slug, a principal id) is compared case-insensitively.
26
+ */
27
+ export declare const TEST_TRIGGER_META: {
28
+ readonly build_failure: {
29
+ readonly sentinel: "sf-sim-build-fail";
30
+ readonly carrier: "space slug";
31
+ readonly effect: "the space's next build fails";
32
+ };
33
+ readonly domain_verification_pending: {
34
+ readonly sentinel: "sf-sim-domain-pending";
35
+ readonly carrier: "custom domain name";
36
+ readonly effect: "domain verification stays pending";
37
+ };
38
+ readonly domain_verification_failed: {
39
+ readonly sentinel: "sf-sim-domain-fail";
40
+ readonly carrier: "custom domain name";
41
+ readonly effect: "domain verification fails";
42
+ };
43
+ readonly tls_failure: {
44
+ readonly sentinel: "sf-sim-tls-fail";
45
+ readonly carrier: "custom domain name";
46
+ readonly effect: "certificate issuance fails";
47
+ };
48
+ readonly rate_limit: {
49
+ readonly sentinel: "sf-sim-rate-limit";
50
+ readonly carrier: "space slug (on create)";
51
+ readonly effect: "the create returns 429 `rate_limited`";
52
+ };
53
+ readonly webhook_retry: {
54
+ readonly sentinel: "sf-sim-webhook-retry";
55
+ readonly carrier: "webhook URL";
56
+ readonly effect: "delivery fails and enters the retry schedule";
57
+ };
58
+ readonly principal_suspension: {
59
+ readonly sentinel: "sf-sim-suspend";
60
+ readonly carrier: "external principal id";
61
+ readonly effect: "the principal is suspended";
62
+ };
63
+ readonly usage_correction: {
64
+ readonly sentinel: "sf-sim-usage-correction";
65
+ readonly carrier: "space slug";
66
+ readonly effect: "the next settled usage sample appends a linked correction";
67
+ };
68
+ };
69
+ export declare function detectTestTrigger(input: string | null | undefined): TestTrigger | null;
70
+ export declare function resolveTestTrigger(mode: TenantMode | string | null | undefined, input: string | null | undefined): TestTrigger | null;
@@ -0,0 +1,116 @@
1
+ // Reserved trigger values ("magic inputs") for LINKED TEST TENANTS
2
+ // (partner-operations spec §1 "Test mode", L31-34). Stripe models test-mode
3
+ // failures with magic inputs — a card number like `4000000000000341` that a
4
+ // LIVE charge treats as an ordinary (invalid) number but a TEST charge turns
5
+ // into a specific decline. We do the same for the partner API: a partner puts a
6
+ // reserved token into the NATURAL input of an existing operation and, on a TEST
7
+ // tenant only, that operation produces a specific failure state instead of
8
+ // succeeding. There is NO new route and NO new field — a trigger is an ordinary
9
+ // input value the caller already controls.
10
+ //
11
+ // The catalog itself is `TEST_TRIGGER_META` below — token, carrier and effect
12
+ // per trigger, in one record, so the published API documentation renders from
13
+ // the same data the detector matches on rather than a prose copy of it.
14
+ //
15
+ // The tokens carry a `sf-sim-` prefix so they are implausible as an organic name
16
+ // and are valid across every carrier (a DNS label, a URL hostname, a slug, and a
17
+ // principal id are all lowercase-hyphen-safe). A LIVE tenant treats the very same
18
+ // value as ordinary input — the gate is `mode === "test"`, applied by every
19
+ // interpreting call site (see `resolveTestTrigger`).
20
+ //
21
+ // FIDELITY (spec caveat): the `rate_limit` trigger FABRICATES a 429 problem
22
+ // document — the partner-API rate limiter of ops §8 does not exist yet, so this
23
+ // simulates the response a real limiter would return, not a real limiter. The
24
+ // domain/TLS triggers synthesize provider (wp.cloud) SSL-info responses through
25
+ // the simulated driver; there is no real DNS/cert in test mode.
26
+ import { z } from "zod";
27
+ export const testTriggerValues = [
28
+ "build_failure",
29
+ "domain_verification_pending",
30
+ "domain_verification_failed",
31
+ "tls_failure",
32
+ "rate_limit",
33
+ "webhook_retry",
34
+ "principal_suspension",
35
+ "usage_correction",
36
+ ];
37
+ export const testTrigger = z.enum(testTriggerValues);
38
+ /**
39
+ * Every trigger, in one record: the reserved token, the input that carries it,
40
+ * and what a test tenant gets instead of success.
41
+ *
42
+ * `carrier` and `effect` are contract text, not commentary — the partner API
43
+ * document renders its trigger table straight from them, so a renamed token or
44
+ * a new trigger cannot leave the published contract describing something else.
45
+ *
46
+ * No token is a substring of another, so a plain `includes` scan is unambiguous.
47
+ * Keep them lowercase — the detector lowercases the input, and every carrier (a
48
+ * DNS label, a slug, a principal id) is compared case-insensitively.
49
+ */
50
+ export const TEST_TRIGGER_META = {
51
+ build_failure: {
52
+ sentinel: "sf-sim-build-fail",
53
+ carrier: "space slug",
54
+ effect: "the space's next build fails",
55
+ },
56
+ domain_verification_pending: {
57
+ sentinel: "sf-sim-domain-pending",
58
+ carrier: "custom domain name",
59
+ effect: "domain verification stays pending",
60
+ },
61
+ domain_verification_failed: {
62
+ sentinel: "sf-sim-domain-fail",
63
+ carrier: "custom domain name",
64
+ effect: "domain verification fails",
65
+ },
66
+ tls_failure: {
67
+ sentinel: "sf-sim-tls-fail",
68
+ carrier: "custom domain name",
69
+ effect: "certificate issuance fails",
70
+ },
71
+ rate_limit: {
72
+ sentinel: "sf-sim-rate-limit",
73
+ carrier: "space slug (on create)",
74
+ effect: "the create returns 429 `rate_limited`",
75
+ },
76
+ webhook_retry: {
77
+ sentinel: "sf-sim-webhook-retry",
78
+ carrier: "webhook URL",
79
+ effect: "delivery fails and enters the retry schedule",
80
+ },
81
+ principal_suspension: {
82
+ sentinel: "sf-sim-suspend",
83
+ carrier: "external principal id",
84
+ effect: "the principal is suspended",
85
+ },
86
+ usage_correction: {
87
+ sentinel: "sf-sim-usage-correction",
88
+ carrier: "space slug",
89
+ effect: "the next settled usage sample appends a linked correction",
90
+ },
91
+ };
92
+ // Return the trigger whose reserved token appears in `input`, or null. Carrier-
93
+ // agnostic: `input` may be a slug, a hostname, a URL, or a principal id. The
94
+ // token may be the whole value or a label within it (`sf-sim-tls-fail.acme.dev`).
95
+ // This does NOT gate on mode — it is pure detection; `resolveTestTrigger` adds
96
+ // the test-tenant gate.
97
+ export function detectTestTrigger(input) {
98
+ if (!input)
99
+ return null;
100
+ const haystack = input.toLowerCase();
101
+ for (const trigger of testTriggerValues) {
102
+ if (haystack.includes(TEST_TRIGGER_META[trigger].sentinel))
103
+ return trigger;
104
+ }
105
+ return null;
106
+ }
107
+ // The one gate every interpreting call site shares: a trigger fires ONLY for a
108
+ // `mode === "test"` tenant. A live tenant (or any non-test mode) always resolves
109
+ // null, so the same input flows through the ordinary path — the no-leak-to-live
110
+ // guarantee, in one place. `mode` is the owning tenant's mode (a `TenantMode`, or
111
+ // the raw `tenants.mode` string).
112
+ export function resolveTestTrigger(mode, input) {
113
+ if (mode !== "test")
114
+ return null;
115
+ return detectTestTrigger(input);
116
+ }
@@ -1,13 +1,8 @@
1
1
  import { z } from "zod";
2
2
  // WordPress `theme.json`-compatible subset used only to infer Pages tokens.
3
- // Real WP theme.json carries dozens of unrelated keys (layout, blocks,
4
- // customTemplates, styles, ...); this schema accepts the file as a loose
5
- // object (`.passthrough()`) and only validates the two branches Pages
6
- // actually consume: `settings.color.palette` and
7
- // `settings.typography.fontFamilies`. Everything else rides through
8
- // unvalidated and is simply never read — this is not a reimplementation of
9
- // WP_Theme_JSON, just the safe slice that reaches presentation-only gate
10
- // pages.
3
+ // The file is accepted as a loose object; only `settings.color.palette` and
4
+ // `settings.typography.fontFamilies` are validated. Every other WP key rides
5
+ // through unvalidated and is never read.
11
6
  const presetSlug = z
12
7
  .string()
13
8
  .min(1)
@@ -16,6 +16,7 @@ export declare const transferPrincipalSchema: z.ZodObject<{
16
16
  tenantId: z.ZodString;
17
17
  }, z.core.$strip>;
18
18
  export declare const spaceTransferCreateSchema: z.ZodObject<{
19
+ spaceId: z.ZodString;
19
20
  to: z.ZodObject<{
20
21
  principalType: z.ZodEnum<{
21
22
  team: "team";
@@ -27,6 +27,7 @@ export const transferPrincipalSchema = transferPrincipalInputSchema.extend({
27
27
  tenantId: z.string().min(1).describe("Tenant both transfer parties live in."),
28
28
  });
29
29
  export const spaceTransferCreateSchema = z.object({
30
+ spaceId: z.string().min(1).describe("Space to transfer (`spc_`)."),
30
31
  to: transferPrincipalInputSchema.describe("Receiving principal. Must live in the space's tenant; cross-tenant transfers are unsupported."),
31
32
  });
32
33
  export const spaceTransferSchema = z.object({