@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,51 @@
1
+ import { z } from "zod";
2
+ import { CursorPaginationSchema, ProblemDetailsSchema } from "./common.js";
3
+ import { meResponseSchema } from "./me.js";
4
+ import { SpaceSchema } from "./resources.js";
5
+ import { spaceRuntimeStatusSchema } from "./spaces.js";
6
+ import { TeamDetailSchema, TeamSummarySchema } from "./teams.js";
7
+ // `GET /v1/bootstrap`: the one-hop cold start. Every field here is an existing
8
+ // contract referenced by name — `me` is what `GET /v1/me` returns, `teams` is
9
+ // what `GET /v1/teams` returns, and so on — so a client can seed its per-resource
10
+ // caches from this payload without a second definition of anything.
11
+ export const bootstrapQuerySchema = z.object({
12
+ teamRef: z
13
+ .string()
14
+ .optional()
15
+ .describe("Team id or slug to resolve. It also scopes slug resolution for `spaceRef` and selects the team on the support boot payload. Present but blank is a request error, never `not_requested`."),
16
+ spaceRef: z
17
+ .string()
18
+ .optional()
19
+ .describe("Space reference: a `spc_` id, a hostname or URL, or a slug. Slugs resolve only within spaces you can already reach, so an unclaimed space is reachable by id or hostname only. Present but blank is a request error, never `not_requested`."),
20
+ });
21
+ // The per-slot problem: the RFC 9457 document minus `requestId` (the request has
22
+ // exactly one, and repeating it in every slot of a 200 body is noise).
23
+ // Everything else is byte-identical to the 4xx document, so the same error
24
+ // renderer works on a slot problem unchanged — there is no second taxonomy.
25
+ export const bootstrapProblemSchema = ProblemDetailsSchema.omit({ requestId: true }).describe("Why this slot did not resolve: the same problem document the dedicated endpoint would have returned, minus the request id carried by the response itself.");
26
+ /**
27
+ * A resolution slot. A caller reaches a value ONLY through `status: "resolved"`.
28
+ * This is deliberate: the dashboard's space read is route admission, and a bare
29
+ * `null` invites reading "could not resolve" as "nothing was asked for".
30
+ */
31
+ function bootstrapSlot(value, description) {
32
+ return z
33
+ .discriminatedUnion("status", [
34
+ z.object({ status: z.literal("resolved"), value }),
35
+ z.object({ status: z.literal("unresolved"), problem: bootstrapProblemSchema }),
36
+ z.object({ status: z.literal("not_requested") }),
37
+ ])
38
+ .describe(`${description}: the resolved value, the problem that stopped it, or not asked for.`);
39
+ }
40
+ export const bootstrapResponseSchema = z.object({
41
+ me: meResponseSchema
42
+ .nullable()
43
+ .describe("The authenticated identity, exactly as `GET /v1/me` returns it. Null only for a claim-token caller, which has no identity."),
44
+ teams: z
45
+ .array(TeamSummarySchema)
46
+ .describe("The teams this credential can act for, newest-first — the same set `GET /v1/teams` returns. Empty for a claim-token caller."),
47
+ teamsPagination: CursorPaginationSchema.describe("Paging for `teams`. `hasMore: true` means this credential reaches more teams than the boot payload carried; page the rest from `GET /v1/teams`."),
48
+ resolvedTeam: bootstrapSlot(TeamDetailSchema, "The team named by `teamRef`"),
49
+ resolvedSpace: bootstrapSlot(SpaceSchema, "The space named by `spaceRef`"),
50
+ spaceRuntime: bootstrapSlot(spaceRuntimeStatusSchema, "Serving status of the resolved space"),
51
+ });
@@ -170,6 +170,37 @@ export declare const BuildSchema: z.ZodObject<{
170
170
  branch: z.ZodOptional<z.ZodString>;
171
171
  pullRequestNumber: z.ZodOptional<z.ZodNumber>;
172
172
  }, z.core.$strict>], "kind">;
173
+ source: z.ZodDefault<z.ZodNullable<z.ZodObject<{
174
+ kind: z.ZodEnum<{
175
+ build: "build";
176
+ agent: "agent";
177
+ api: "api";
178
+ dashboard: "dashboard";
179
+ cli: "cli";
180
+ git: "git";
181
+ direct_upload: "direct_upload";
182
+ import: "import";
183
+ variable_update: "variable_update";
184
+ config_update: "config_update";
185
+ }>;
186
+ client: z.ZodOptional<z.ZodString>;
187
+ branch: z.ZodOptional<z.ZodString>;
188
+ commit: z.ZodOptional<z.ZodString>;
189
+ message: z.ZodOptional<z.ZodString>;
190
+ dirty: z.ZodOptional<z.ZodBoolean>;
191
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
192
+ git: z.ZodOptional<z.ZodObject<{
193
+ repository: z.ZodOptional<z.ZodNullable<z.ZodString>>;
194
+ repositoryFullName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
195
+ repositoryUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
196
+ ref: z.ZodOptional<z.ZodNullable<z.ZodString>>;
197
+ branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
198
+ branchAliasUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
199
+ commit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
200
+ commitSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
201
+ pullRequestNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
202
+ }, z.core.$catchall<z.ZodUnknown>>>;
203
+ }, z.core.$strip>>>;
173
204
  settingsSnapshot: z.ZodObject<{
174
205
  rootDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
175
206
  installDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -193,8 +224,8 @@ export declare const BuildSchema: z.ZodObject<{
193
224
  code: z.ZodString;
194
225
  severity: z.ZodEnum<{
195
226
  info: "info";
196
- error: "error";
197
227
  warning: "warning";
228
+ error: "error";
198
229
  }>;
199
230
  message: z.ZodString;
200
231
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -244,8 +275,77 @@ export declare const buildCreateRequestSchema: z.ZodObject<{
244
275
  code: z.ZodString;
245
276
  severity: z.ZodEnum<{
246
277
  info: "info";
278
+ warning: "warning";
247
279
  error: "error";
280
+ }>;
281
+ message: z.ZodString;
282
+ path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
283
+ provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
284
+ registrar: "registrar";
285
+ infra: "infra";
286
+ dns: "dns";
287
+ runtime: "runtime";
288
+ }>>>;
289
+ details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
290
+ fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
291
+ retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
292
+ }, z.core.$strip>>>;
293
+ wait: z.ZodDefault<z.ZodBoolean>;
294
+ }, z.core.$strict>;
295
+ export declare const buildSourceSchema: z.ZodEnum<{
296
+ wordpress: "wordpress";
297
+ }>;
298
+ export declare const wordpressBuildTriggerRequestSchema: z.ZodObject<{
299
+ source: z.ZodLiteral<"wordpress">;
300
+ sourceUrl: z.ZodString;
301
+ }, z.core.$strict>;
302
+ /**
303
+ * `POST /v1/spaces/{spaceId}/builds` takes either a caller-described build or a
304
+ * named managed source. `source` is a real discriminator, not a plain union
305
+ * arm: zod routes the body to exactly one variant and reports the failure
306
+ * inside it, so a validation problem keeps its RFC 6901 pointer
307
+ * (`/input/kind`, `/sourceUrl`) instead of collapsing to a top-level
308
+ * `invalid_union` with nowhere to point. Both variants are strict, so a body
309
+ * carrying `source` alongside `input` is rejected rather than quietly read as
310
+ * a caller-described build.
311
+ */
312
+ export declare const spaceBuildCreateRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
313
+ source: z.ZodLiteral<"wordpress">;
314
+ sourceUrl: z.ZodString;
315
+ }, z.core.$strict>, z.ZodObject<{
316
+ input: z.ZodDiscriminatedUnion<[z.ZodObject<{
317
+ kind: z.ZodLiteral<"archive">;
318
+ sourceMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
319
+ }, z.core.$strict>, z.ZodObject<{
320
+ kind: z.ZodLiteral<"repository">;
321
+ repositoryConnectionId: z.ZodString;
322
+ ref: z.ZodOptional<z.ZodString>;
323
+ commit: z.ZodOptional<z.ZodString>;
324
+ branch: z.ZodOptional<z.ZodString>;
325
+ pullRequestNumber: z.ZodOptional<z.ZodNumber>;
326
+ }, z.core.$strip>], "kind">;
327
+ settings: z.ZodOptional<z.ZodObject<{
328
+ rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
329
+ installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
330
+ installCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
331
+ buildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
332
+ outputDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
333
+ ignoredBuildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
334
+ frameworkPreset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
335
+ platformPreset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
336
+ allowUnsupportedPlatformFeatures: z.ZodOptional<z.ZodBoolean>;
337
+ timeoutSeconds: z.ZodOptional<z.ZodNumber>;
338
+ }, z.core.$strip>>;
339
+ target: z.ZodOptional<z.ZodObject<{
340
+ channel: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
341
+ preview: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
342
+ }, z.core.$strip>>;
343
+ diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
344
+ code: z.ZodString;
345
+ severity: z.ZodEnum<{
346
+ info: "info";
248
347
  warning: "warning";
348
+ error: "error";
249
349
  }>;
250
350
  message: z.ZodString;
251
351
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -260,6 +360,18 @@ export declare const buildCreateRequestSchema: z.ZodObject<{
260
360
  retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
261
361
  }, z.core.$strip>>>;
262
362
  wait: z.ZodDefault<z.ZodBoolean>;
363
+ source: z.ZodOptional<z.ZodUndefined>;
364
+ }, z.core.$strict>], "source">;
365
+ export declare const buildPreflightQuerySchema: z.ZodObject<{
366
+ source: z.ZodEnum<{
367
+ wordpress: "wordpress";
368
+ }>;
369
+ sourceUrl: z.ZodString;
370
+ }, z.core.$strict>;
371
+ export declare const buildPreflightResponseSchema: z.ZodObject<{
372
+ data: z.ZodObject<{
373
+ ready: z.ZodLiteral<true>;
374
+ }, z.core.$strict>;
263
375
  }, z.core.$strip>;
264
376
  export declare const buildSourceArchiveUploadSchema: z.ZodObject<{
265
377
  id: z.ZodString;
@@ -291,7 +403,8 @@ export declare const buildSourceArchiveUploadSchema: z.ZodObject<{
291
403
  contentType: z.ZodOptional<z.ZodString>;
292
404
  }, z.core.$strip>>>;
293
405
  links: z.ZodObject<{
294
- resume: z.ZodString;
406
+ refresh: z.ZodString;
407
+ resume: z.ZodOptional<z.ZodString>;
295
408
  finalize: z.ZodString;
296
409
  }, z.core.$strip>;
297
410
  details: z.ZodOptional<z.ZodObject<{
@@ -307,8 +420,8 @@ export declare const buildSourceArchiveUploadSchema: z.ZodObject<{
307
420
  code: z.ZodString;
308
421
  severity: z.ZodEnum<{
309
422
  info: "info";
310
- error: "error";
311
423
  warning: "warning";
424
+ error: "error";
312
425
  }>;
313
426
  message: z.ZodString;
314
427
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -348,6 +461,37 @@ export declare const buildCreateResponseSchema: z.ZodObject<{
348
461
  branch: z.ZodOptional<z.ZodString>;
349
462
  pullRequestNumber: z.ZodOptional<z.ZodNumber>;
350
463
  }, z.core.$strict>], "kind">;
464
+ source: z.ZodDefault<z.ZodNullable<z.ZodObject<{
465
+ kind: z.ZodEnum<{
466
+ build: "build";
467
+ agent: "agent";
468
+ api: "api";
469
+ dashboard: "dashboard";
470
+ cli: "cli";
471
+ git: "git";
472
+ direct_upload: "direct_upload";
473
+ import: "import";
474
+ variable_update: "variable_update";
475
+ config_update: "config_update";
476
+ }>;
477
+ client: z.ZodOptional<z.ZodString>;
478
+ branch: z.ZodOptional<z.ZodString>;
479
+ commit: z.ZodOptional<z.ZodString>;
480
+ message: z.ZodOptional<z.ZodString>;
481
+ dirty: z.ZodOptional<z.ZodBoolean>;
482
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
483
+ git: z.ZodOptional<z.ZodObject<{
484
+ repository: z.ZodOptional<z.ZodNullable<z.ZodString>>;
485
+ repositoryFullName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
486
+ repositoryUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
487
+ ref: z.ZodOptional<z.ZodNullable<z.ZodString>>;
488
+ branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
489
+ branchAliasUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
490
+ commit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
491
+ commitSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
492
+ pullRequestNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
493
+ }, z.core.$catchall<z.ZodUnknown>>>;
494
+ }, z.core.$strip>>>;
351
495
  settingsSnapshot: z.ZodObject<{
352
496
  rootDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
353
497
  installDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -371,8 +515,8 @@ export declare const buildCreateResponseSchema: z.ZodObject<{
371
515
  code: z.ZodString;
372
516
  severity: z.ZodEnum<{
373
517
  info: "info";
374
- error: "error";
375
518
  warning: "warning";
519
+ error: "error";
376
520
  }>;
377
521
  message: z.ZodString;
378
522
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -420,7 +564,8 @@ export declare const buildCreateResponseSchema: z.ZodObject<{
420
564
  contentType: z.ZodOptional<z.ZodString>;
421
565
  }, z.core.$strip>>>;
422
566
  links: z.ZodObject<{
423
- resume: z.ZodString;
567
+ refresh: z.ZodString;
568
+ resume: z.ZodOptional<z.ZodString>;
424
569
  finalize: z.ZodString;
425
570
  }, z.core.$strip>;
426
571
  details: z.ZodOptional<z.ZodObject<{
@@ -436,8 +581,8 @@ export declare const buildCreateResponseSchema: z.ZodObject<{
436
581
  code: z.ZodString;
437
582
  severity: z.ZodEnum<{
438
583
  info: "info";
439
- error: "error";
440
584
  warning: "warning";
585
+ error: "error";
441
586
  }>;
442
587
  message: z.ZodString;
443
588
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -482,6 +627,37 @@ export declare const buildListResponseSchema: z.ZodObject<{
482
627
  branch: z.ZodOptional<z.ZodString>;
483
628
  pullRequestNumber: z.ZodOptional<z.ZodNumber>;
484
629
  }, z.core.$strict>], "kind">;
630
+ source: z.ZodDefault<z.ZodNullable<z.ZodObject<{
631
+ kind: z.ZodEnum<{
632
+ build: "build";
633
+ agent: "agent";
634
+ api: "api";
635
+ dashboard: "dashboard";
636
+ cli: "cli";
637
+ git: "git";
638
+ direct_upload: "direct_upload";
639
+ import: "import";
640
+ variable_update: "variable_update";
641
+ config_update: "config_update";
642
+ }>;
643
+ client: z.ZodOptional<z.ZodString>;
644
+ branch: z.ZodOptional<z.ZodString>;
645
+ commit: z.ZodOptional<z.ZodString>;
646
+ message: z.ZodOptional<z.ZodString>;
647
+ dirty: z.ZodOptional<z.ZodBoolean>;
648
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
649
+ git: z.ZodOptional<z.ZodObject<{
650
+ repository: z.ZodOptional<z.ZodNullable<z.ZodString>>;
651
+ repositoryFullName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
652
+ repositoryUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
653
+ ref: z.ZodOptional<z.ZodNullable<z.ZodString>>;
654
+ branch: z.ZodOptional<z.ZodNullable<z.ZodString>>;
655
+ branchAliasUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
656
+ commit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
657
+ commitSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
658
+ pullRequestNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
659
+ }, z.core.$catchall<z.ZodUnknown>>>;
660
+ }, z.core.$strip>>>;
485
661
  settingsSnapshot: z.ZodObject<{
486
662
  rootDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
487
663
  installDirectory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -505,8 +681,8 @@ export declare const buildListResponseSchema: z.ZodObject<{
505
681
  code: z.ZodString;
506
682
  severity: z.ZodEnum<{
507
683
  info: "info";
508
- error: "error";
509
684
  warning: "warning";
685
+ error: "error";
510
686
  }>;
511
687
  message: z.ZodString;
512
688
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -558,4 +734,7 @@ export type InternalBuildExecutionLaunch = z.infer<typeof buildExecutionLaunchSc
558
734
  export type InternalBuildExecutionSupervision = z.infer<typeof buildExecutionSupervisionSchema>;
559
735
  export type BuildCreateRequest = z.infer<typeof buildCreateRequestSchema>;
560
736
  export type BuildCreateResponse = z.infer<typeof buildCreateResponseSchema>;
737
+ export type WordPressBuildTriggerRequest = z.infer<typeof wordpressBuildTriggerRequestSchema>;
738
+ export type SpaceBuildCreateRequest = z.infer<typeof spaceBuildCreateRequestSchema>;
739
+ export type BuildPreflightQuery = z.infer<typeof buildPreflightQuerySchema>;
561
740
  export {};
@@ -2,6 +2,8 @@ import { z } from "zod";
2
2
  import { CursorPaginationSchema, baseDiagnosticSchema, cursorListQuerySchema, dataEnvelope, } from "./common.js";
3
3
  import { buildStatus } from "./enums.js";
4
4
  import { uploadInstructionsSchema } from "./internal.js";
5
+ import { PublishSourceSchema } from "./resources.js";
6
+ import { wordpressDataSourceUrlSchema } from "./space-config.js";
5
7
  import { versionLogEntrySchema } from "./spaces.js";
6
8
  const nullableCommandSchema = z.string().trim().min(1).nullable();
7
9
  const buildTimeoutSecondsSchema = z.number().int().min(60).max(7200);
@@ -54,8 +56,6 @@ export const BuildTargetSchema = z
54
56
  preview: z.boolean().default(false).describe("Whether the build targets preview behavior."),
55
57
  })
56
58
  .describe("Where a successful build should publish or run in preview mode.");
57
- // Shared by InternalBuildSourceSchema and InternalBuildInputSchema: both carry
58
- // this exact archive-source member in their `kind` discriminated union.
59
59
  const internalArchiveBuildSourceSchema = z.object({
60
60
  kind: z.literal("archive").describe("Build from an uploaded source archive."),
61
61
  uploadId: z.string().optional().describe("Upload session (`upl_`) carrying the archive."),
@@ -81,11 +81,7 @@ const internalArchiveBuildSourceSchema = z.object({
81
81
  compressedBytes: z.number().int().nonnegative().optional(),
82
82
  expandedBytes: z.number().int().nonnegative().optional(),
83
83
  fileCount: z.number().int().nonnegative().optional(),
84
- expiresAt: z
85
- .string()
86
- .datetime()
87
- .optional()
88
- .describe("Server-enforced upload expiry while the archive is waiting for upload."),
84
+ expiresAt: z.string().datetime().optional().describe("Server-enforced upload expiry."),
89
85
  });
90
86
  const InternalBuildSourceSchema = z
91
87
  .discriminatedUnion("kind", [
@@ -156,7 +152,7 @@ export const BuildCreateInputSchema = z
156
152
  sourceMetadata: z
157
153
  .record(z.string(), z.unknown())
158
154
  .optional()
159
- .describe("Optional source provenance for the produced version."),
155
+ .describe("Source provenance for the produced version."),
160
156
  })
161
157
  .strict(),
162
158
  z.object({
@@ -169,10 +165,9 @@ export const BuildCreateInputSchema = z
169
165
  }),
170
166
  ])
171
167
  .describe("What a new build should run against.");
172
- // One phase-timeline entry the build runner appends via recordBuildPhase
173
- // (apps/control-plane/src/builds/runner.ts BUILD_PHASES); `phase` stays a
174
- // plain string here since the runner's specific phase vocabulary is an
175
- // app-level concern, not a shared contract.
168
+ // One phase-timeline entry the runner appends via recordBuildPhase
169
+ // (apps/control-plane/src/builds/runner.ts BUILD_PHASES). `phase` stays a plain
170
+ // string: the runner's phase vocabulary is app-level, not a shared contract.
176
171
  const buildExecutionPhaseSchema = z.object({
177
172
  phase: z.string().min(1).describe("Build phase name. See `BUILD_PHASES` in `builds/runner.ts`."),
178
173
  at: z.string().datetime(),
@@ -211,12 +206,15 @@ const InternalBuildExecutionSchema = z
211
206
  .optional()
212
207
  .describe("Phase timeline that the runner appends to with `recordBuildPhase`."),
213
208
  })
214
- .describe("Internal runner execution metadata surfaced only where appropriate.");
209
+ .describe("Internal runner execution metadata. Not part of the public Build resource.");
215
210
  export const BuildSchema = z.object({
216
211
  id: z.string().describe("Build id (`bld_`); opaque and never derived from a version id."),
217
212
  spaceId: z.string().describe("Space (`spc_`) the build produces a version for."),
218
213
  status: buildStatus.describe("Build lifecycle status."),
219
214
  input: PublicBuildInputSchema,
215
+ source: PublishSourceSchema.nullable()
216
+ .default(null)
217
+ .describe("Publish provenance as declared at build start (client, git ref data, publish message). Present on failed and running builds too; the produced version's `source` is the authoritative copy once one exists. Null when nothing was declared."),
220
218
  settingsSnapshot: BuildSettingsSchema,
221
219
  target: BuildTargetSchema,
222
220
  retryOfBuildId: z
@@ -238,16 +236,73 @@ export const BuildSchema = z.object({
238
236
  startedAt: z.string().datetime().nullable().describe("When the runner picked the build up."),
239
237
  finishedAt: z.string().datetime().nullable().describe("When the build reached a terminal state."),
240
238
  });
241
- export const buildCreateRequestSchema = z.object({
239
+ export const buildCreateRequestSchema = z
240
+ .object({
242
241
  input: BuildCreateInputSchema,
243
242
  settings: BuildSettingsOverrideSchema.optional().describe("Per-run settings overrides, persisted as `settingsSnapshot` after resolution."),
244
243
  target: BuildTargetSchema.partial().optional(),
245
244
  diagnostics: z
246
245
  .array(baseDiagnosticSchema)
247
246
  .optional()
248
- .describe("Optional diagnostics already known before the build is queued."),
247
+ .describe("Diagnostics already known before the build is queued."),
249
248
  wait: z.boolean().default(false),
250
- });
249
+ })
250
+ // Strict so a typo is a validation failure instead of a silently dropped
251
+ // field, and so a body that names a managed `source` can never be read as a
252
+ // caller-described build.
253
+ .strict();
254
+ // A build source is a named way of deciding what to build. `wordpress` reads
255
+ // the Space's configured WordPress source and its connected production
256
+ // repository, so the caller names the source and nothing else — no input,
257
+ // commands, settings, refs, or targets.
258
+ //
259
+ // It is an enum of one, and adding a second value is not a one-line edit: each
260
+ // source owns a request variant in the create union, a resolver that finds its
261
+ // repository, and its own preflight branch. The enum is how a caller names a
262
+ // source, not an extension point.
263
+ export const buildSourceSchema = z
264
+ .enum(["wordpress"])
265
+ .describe("Managed build source that decides what to build on the caller's behalf. `wordpress` is the only one.");
266
+ export const wordpressBuildTriggerRequestSchema = z
267
+ .object({
268
+ source: z.literal("wordpress").describe("Build the Space's configured WordPress source."),
269
+ sourceUrl: wordpressDataSourceUrlSchema.describe("Configured WordPress URL that changed, as stored in the Space's data sources."),
270
+ })
271
+ .strict()
272
+ .describe("Trigger a production build for a Space's configured WordPress source.");
273
+ /**
274
+ * `POST /v1/spaces/{spaceId}/builds` takes either a caller-described build or a
275
+ * named managed source. `source` is a real discriminator, not a plain union
276
+ * arm: zod routes the body to exactly one variant and reports the failure
277
+ * inside it, so a validation problem keeps its RFC 6901 pointer
278
+ * (`/input/kind`, `/sourceUrl`) instead of collapsing to a top-level
279
+ * `invalid_union` with nowhere to point. Both variants are strict, so a body
280
+ * carrying `source` alongside `input` is rejected rather than quietly read as
281
+ * a caller-described build.
282
+ */
283
+ export const spaceBuildCreateRequestSchema = z
284
+ .discriminatedUnion("source", [
285
+ wordpressBuildTriggerRequestSchema,
286
+ buildCreateRequestSchema.extend({
287
+ source: z
288
+ .undefined()
289
+ .optional()
290
+ .meta({ description: "Omit `source` to describe the build yourself." }),
291
+ }),
292
+ ])
293
+ .describe("A caller-described build, or a build triggered from a managed source.");
294
+ export const buildPreflightQuerySchema = z
295
+ .object({
296
+ source: buildSourceSchema,
297
+ sourceUrl: wordpressDataSourceUrlSchema.describe("Configured WordPress URL to check, as stored in the Space's data sources."),
298
+ })
299
+ .strict()
300
+ .describe("Which managed source to check before triggering builds from it.");
301
+ export const buildPreflightResponseSchema = dataEnvelope(z
302
+ .object({
303
+ ready: z.literal(true).describe("The source can trigger production builds right now."),
304
+ })
305
+ .strict());
251
306
  export const buildSourceArchiveUploadSchema = uploadInstructionsSchema;
252
307
  export const buildCreateResponseSchema = dataEnvelope(z.object({
253
308
  build: BuildSchema,
@@ -264,17 +319,16 @@ export const buildLogListResponseSchema = z.object({
264
319
  data: z.array(versionLogEntrySchema),
265
320
  pagination: CursorPaginationSchema,
266
321
  });
267
- // Branch-to-channel integration config (spec "Lifecycle model": "branch-to-
268
- // channel mapping rules live on the Space as integration config"). Launch only
269
- // supports `live`; keep the stored config aligned with publish/finalize until
270
- // named channels ship.
322
+ // Branch-to-channel integration config (spec "Lifecycle model": mapping rules
323
+ // live on the Space as integration config). Launch only supports `live`; keep
324
+ // the stored config aligned with publish/finalize until named channels ship.
271
325
  export const spaceBuildIntegrationSchema = z
272
326
  .object({
273
327
  branchChannels: z
274
328
  .record(z.string().min(1).describe("Git branch or ref name."), z.literal("live").describe("Channel the branch's builds promote to."))
275
329
  .describe("Exact branch or ref name to channel name, for example `{ main: 'live' }`."),
276
330
  })
277
- .describe("Per-space build integration config that defines where repository builds promote.");
331
+ .describe("Per-space build integration config: where repository builds promote.");
278
332
  /** Channel a repository build promotes to, or null when the ref is unmapped (default channel applies). */
279
333
  export function resolveBuildChannel(integration, ref) {
280
334
  return integration?.branchChannels[ref] ?? null;
@@ -1,10 +1,33 @@
1
1
  import { z } from "zod";
2
+ export declare const channelChangeKindSchema: z.ZodEnum<{
3
+ publish: "publish";
4
+ rollback: "rollback";
5
+ promote: "promote";
6
+ }>;
7
+ export type ChannelChangeKind = z.infer<typeof channelChangeKindSchema>;
8
+ export declare const channelLastChangeSchema: z.ZodObject<{
9
+ kind: z.ZodNullable<z.ZodEnum<{
10
+ publish: "publish";
11
+ rollback: "rollback";
12
+ promote: "promote";
13
+ }>>;
14
+ at: z.ZodString;
15
+ }, z.core.$strip>;
16
+ export type ChannelLastChange = z.infer<typeof channelLastChangeSchema>;
2
17
  export declare const channelListItemSchema: z.ZodObject<{
3
18
  name: z.ZodString;
4
19
  currentVersionId: z.ZodNullable<z.ZodString>;
5
20
  currentDeploymentUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
21
  previousVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
22
  updatedAt: z.ZodString;
23
+ lastChange: z.ZodOptional<z.ZodNullable<z.ZodObject<{
24
+ kind: z.ZodNullable<z.ZodEnum<{
25
+ publish: "publish";
26
+ rollback: "rollback";
27
+ promote: "promote";
28
+ }>>;
29
+ at: z.ZodString;
30
+ }, z.core.$strip>>>;
8
31
  }, z.core.$strip>;
9
32
  export type ChannelListItem = z.infer<typeof channelListItemSchema>;
10
33
  export declare const channelHistoryEntrySchema: z.ZodObject<{
@@ -15,10 +38,16 @@ export declare const channelHistoryEntrySchema: z.ZodObject<{
15
38
  system: "system";
16
39
  user: "user";
17
40
  api_key: "api_key";
41
+ partner_token: "partner_token";
18
42
  oauth_client: "oauth_client";
19
43
  anonymous_claim: "anonymous_claim";
20
44
  }>>>;
21
45
  actorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
46
+ kind: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
47
+ publish: "publish";
48
+ rollback: "rollback";
49
+ promote: "promote";
50
+ }>>>;
22
51
  at: z.ZodString;
23
52
  }, z.core.$strip>;
24
53
  export type ChannelHistoryEntry = z.infer<typeof channelHistoryEntrySchema>;
@@ -29,6 +58,14 @@ export declare const channelListResponseSchema: z.ZodObject<{
29
58
  currentDeploymentUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
59
  previousVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
31
60
  updatedAt: z.ZodString;
61
+ lastChange: z.ZodOptional<z.ZodNullable<z.ZodObject<{
62
+ kind: z.ZodNullable<z.ZodEnum<{
63
+ publish: "publish";
64
+ rollback: "rollback";
65
+ promote: "promote";
66
+ }>>;
67
+ at: z.ZodString;
68
+ }, z.core.$strip>>>;
32
69
  }, z.core.$strip>>;
33
70
  }, z.core.$strip>;
34
71
  export declare const channelHistoryResponseSchema: z.ZodObject<{
@@ -40,10 +77,16 @@ export declare const channelHistoryResponseSchema: z.ZodObject<{
40
77
  system: "system";
41
78
  user: "user";
42
79
  api_key: "api_key";
80
+ partner_token: "partner_token";
43
81
  oauth_client: "oauth_client";
44
82
  anonymous_claim: "anonymous_claim";
45
83
  }>>>;
46
84
  actorId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
+ kind: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
86
+ publish: "publish";
87
+ rollback: "rollback";
88
+ promote: "promote";
89
+ }>>>;
47
90
  at: z.ZodString;
48
91
  }, z.core.$strip>>;
49
92
  }, z.core.$strip>;
@@ -1,12 +1,21 @@
1
1
  import { z } from "zod";
2
- // Channels READ surface (the platform spec "Channels"): a read-only
3
- // projection over the existing `channels` table and the `channel.promoted`
4
- // activity log. No writes, no new storage — promotion stays owned by the
5
- // publish/version lifecycle. Additive only.
6
- // One row of the channel list: where each named channel points right now.
2
+ // Channels READ surface (the platform spec "Channels"): a projection over the
3
+ // `channels` table and the `channel.promoted` activity log. No writes:
4
+ // promotion stays owned by the publish/version lifecycle.
5
+ // How a channel pointer moved: a fresh publish going live, a forward promote,
6
+ // or a rollback to an older version. Recorded on the `channel.promoted` event
7
+ // at write time; null on events that predate kind recording.
8
+ export const channelChangeKindSchema = z.enum(["publish", "promote", "rollback"]);
9
+ // The channel's most recent pointer move, straight from the promotion log.
10
+ export const channelLastChangeSchema = z.object({
11
+ kind: channelChangeKindSchema
12
+ .nullable()
13
+ .describe("How the pointer moved, or null when the log entry predates kind recording."),
14
+ at: z.string().datetime().describe("Instant the pointer moved, from the promotion log."),
15
+ });
7
16
  // `currentVersionId` is the channel's version pointer (`channels.versionId`).
8
17
  export const channelListItemSchema = z.object({
9
- name: z.string().describe("Channel name; `live` is the default channel."),
18
+ name: z.string().describe("Channel name; `live` is the default."),
10
19
  currentVersionId: z
11
20
  .string()
12
21
  .nullable()
@@ -22,10 +31,13 @@ export const channelListItemSchema = z.object({
22
31
  .optional()
23
32
  .describe("Last version this channel served before the current pointer (rollback target)."),
24
33
  updatedAt: z.string().datetime().describe("Instant when this channel pointer last moved."),
34
+ lastChange: channelLastChangeSchema
35
+ .nullable()
36
+ .optional()
37
+ .describe("The most recent pointer move from the promotion log, or null when none exists."),
25
38
  });
26
39
  // One entry of a channel's promotion history (the deploy log): a single
27
- // `channel.promoted` event, newest first. This is the audit trail of every
28
- // pointer move on the channel.
40
+ // `channel.promoted` event, newest first.
29
41
  export const channelHistoryEntrySchema = z.object({
30
42
  versionId: z.string().describe("Version the channel was promoted to."),
31
43
  channel: z.string().describe("Channel that moved."),
@@ -35,11 +47,15 @@ export const channelHistoryEntrySchema = z.object({
35
47
  .optional()
36
48
  .describe("Version the channel served immediately before this promotion."),
37
49
  actorType: z
38
- .enum(["user", "api_key", "oauth_client", "anonymous_claim", "system"])
50
+ .enum(["user", "api_key", "partner_token", "oauth_client", "anonymous_claim", "system"])
39
51
  .nullable()
40
52
  .optional()
41
53
  .describe("Kind of actor that performed the promotion."),
42
54
  actorId: z.string().nullable().optional().describe("Identifier of the promoting actor."),
55
+ kind: channelChangeKindSchema
56
+ .nullable()
57
+ .optional()
58
+ .describe("How the pointer moved, or null when the entry predates kind recording."),
43
59
  at: z.string().datetime().describe("Instant when the promotion happened."),
44
60
  });
45
61
  export const channelListResponseSchema = z.object({
@@ -1,3 +1,4 @@
1
+ import { z } from "zod";
1
2
  export declare const CLI_EXIT_CODES: {
2
3
  readonly ok: 0;
3
4
  readonly validation: 2;
@@ -8,3 +9,9 @@ export declare const CLI_EXIT_CODES: {
8
9
  readonly timeout: 50;
9
10
  readonly unknown: 1;
10
11
  };
12
+ export declare const cliWarningSchema: z.ZodObject<{
13
+ code: z.ZodString;
14
+ message: z.ZodString;
15
+ hint: z.ZodString;
16
+ }, z.core.$strip>;
17
+ export type CliWarning = z.infer<typeof cliWarningSchema>;