@spacefast/common 0.2.1 → 0.4.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 (226) hide show
  1. package/dist/agents/marketplace-prompts.d.ts +1 -0
  2. package/dist/agents/marketplace-prompts.js +6 -0
  3. package/dist/agents/registry/core.d.ts +4 -12
  4. package/dist/agents/registry/core.js +7 -28
  5. package/dist/config/domains.d.ts +10 -8
  6. package/dist/config/domains.js +4 -7
  7. package/dist/contracts/access-core.d.ts +135 -0
  8. package/dist/contracts/access-core.js +242 -0
  9. package/dist/contracts/access-profiles.d.ts +8 -8
  10. package/dist/contracts/access-profiles.js +8 -8
  11. package/dist/contracts/access.d.ts +14 -103
  12. package/dist/contracts/access.js +10 -210
  13. package/dist/contracts/activity.d.ts +54 -55
  14. package/dist/contracts/activity.js +38 -9
  15. package/dist/contracts/api-keys.d.ts +69 -26
  16. package/dist/contracts/api-keys.js +29 -2
  17. package/dist/contracts/application-journal.d.ts +197 -4
  18. package/dist/contracts/application-journal.js +97 -16
  19. package/dist/contracts/auth.d.ts +20 -0
  20. package/dist/contracts/auth.js +18 -0
  21. package/dist/contracts/beta.d.ts +13 -0
  22. package/dist/contracts/beta.js +28 -0
  23. package/dist/contracts/billing.d.ts +2 -2
  24. package/dist/contracts/bootstrap.d.ts +23 -6
  25. package/dist/contracts/builds.d.ts +24 -4
  26. package/dist/contracts/builds.js +16 -4
  27. package/dist/contracts/channels.d.ts +43 -0
  28. package/dist/contracts/channels.js +22 -6
  29. package/dist/contracts/comments.d.ts +49 -0
  30. package/dist/contracts/comments.js +61 -2
  31. package/dist/contracts/commerce.d.ts +19 -13
  32. package/dist/contracts/connector-access.d.ts +28 -0
  33. package/dist/contracts/connector-access.js +31 -0
  34. package/dist/contracts/connectors.d.ts +2382 -0
  35. package/dist/contracts/connectors.js +941 -0
  36. package/dist/contracts/content-contract-verification.d.ts +112 -58
  37. package/dist/contracts/content-contract-verification.js +42 -54
  38. package/dist/contracts/content-model-emit.d.ts +97 -0
  39. package/dist/contracts/content-model-emit.js +306 -0
  40. package/dist/contracts/content-model-sdk.d.ts +101 -0
  41. package/dist/contracts/content-model-sdk.js +232 -0
  42. package/dist/contracts/{content-program.d.ts → content-model.d.ts} +338 -82
  43. package/dist/contracts/{content-program.js → content-model.js} +291 -63
  44. package/dist/contracts/content-platform-fixture.d.ts +380 -110
  45. package/dist/contracts/content-platform-fixture.js +8 -8
  46. package/dist/contracts/content-sync.d.ts +197 -74
  47. package/dist/contracts/content-sync.js +98 -37
  48. package/dist/contracts/content.d.ts +30 -422
  49. package/dist/contracts/content.js +34 -294
  50. package/dist/contracts/dashboard-prefs.d.ts +10 -3
  51. package/dist/contracts/dashboard-prefs.js +6 -3
  52. package/dist/contracts/data-location.d.ts +9 -0
  53. package/dist/contracts/data-location.js +7 -0
  54. package/dist/contracts/deployment-comparison.d.ts +67 -0
  55. package/dist/contracts/deployment-comparison.js +68 -0
  56. package/dist/contracts/device-auth.d.ts +55 -11
  57. package/dist/contracts/domains.d.ts +40 -16
  58. package/dist/contracts/domains.js +23 -0
  59. package/dist/contracts/enums.d.ts +1 -10
  60. package/dist/contracts/enums.js +0 -15
  61. package/dist/contracts/error-code-meta.d.ts +388 -20
  62. package/dist/contracts/error-code-meta.js +201 -5
  63. package/dist/contracts/error-codes.d.ts +17 -4
  64. package/dist/contracts/error-codes.js +109 -10
  65. package/dist/contracts/events.d.ts +5 -0
  66. package/dist/contracts/events.js +12 -3
  67. package/dist/contracts/execution.d.ts +5 -1
  68. package/dist/contracts/execution.js +4 -0
  69. package/dist/contracts/feature-lifecycle.d.ts +53 -20
  70. package/dist/contracts/feature-lifecycle.js +65 -23
  71. package/dist/contracts/features.d.ts +57 -31
  72. package/dist/contracts/features.js +0 -1
  73. package/dist/contracts/feedback.d.ts +124 -0
  74. package/dist/contracts/feedback.js +64 -0
  75. package/dist/contracts/fixtures/content-model-sdk-v1.generated.d.ts +129 -0
  76. package/dist/contracts/fixtures/content-model-sdk-v1.generated.js +48 -0
  77. package/dist/contracts/fixtures/content-platform-v1.json +101 -49
  78. package/dist/contracts/frame-session.d.ts +60 -10
  79. package/dist/contracts/frame-session.js +52 -12
  80. package/dist/contracts/functions.d.ts +28 -2
  81. package/dist/contracts/functions.js +25 -2
  82. package/dist/contracts/grant-copy.d.ts +2 -0
  83. package/dist/contracts/grant-copy.js +2 -0
  84. package/dist/contracts/grants-core.d.ts +95 -0
  85. package/dist/contracts/grants-core.js +435 -0
  86. package/dist/contracts/grants.d.ts +13 -84
  87. package/dist/contracts/grants.js +21 -369
  88. package/dist/contracts/ids-core.d.ts +11 -0
  89. package/dist/contracts/ids-core.js +14 -0
  90. package/dist/contracts/ids.d.ts +7 -4
  91. package/dist/contracts/ids.js +12 -4
  92. package/dist/contracts/internal.d.ts +18 -0
  93. package/dist/contracts/internal.js +19 -0
  94. package/dist/contracts/mcp.d.ts +8 -18
  95. package/dist/contracts/mcp.js +2 -23
  96. package/dist/contracts/notifications.d.ts +4 -1
  97. package/dist/contracts/notifications.js +1 -0
  98. package/dist/contracts/oauth-resources.d.ts +55 -9
  99. package/dist/contracts/oauth-resources.js +64 -1
  100. package/dist/contracts/oauth-scope-actions.d.ts +27 -3
  101. package/dist/contracts/oauth-scope-actions.js +18 -8
  102. package/dist/contracts/operations.d.ts +1 -1
  103. package/dist/contracts/partner-account.d.ts +629 -0
  104. package/dist/contracts/partner-account.js +18 -0
  105. package/dist/contracts/principal-assertion.d.ts +74 -1
  106. package/dist/contracts/principal-assertion.js +67 -3
  107. package/dist/contracts/publish-archive.d.ts +22 -1
  108. package/dist/contracts/push-new.d.ts +3 -3
  109. package/dist/contracts/push-new.js +1 -1
  110. package/dist/contracts/quotas.js +2 -1
  111. package/dist/contracts/repository-connections.d.ts +10 -6
  112. package/dist/contracts/repository-connections.js +15 -0
  113. package/dist/contracts/resources.d.ts +6 -5
  114. package/dist/contracts/resources.js +7 -0
  115. package/dist/contracts/route-inventory.d.ts +74 -19
  116. package/dist/contracts/route-inventory.js +20 -6
  117. package/dist/contracts/runtime-api.d.ts +415 -4
  118. package/dist/contracts/runtime-api.js +60 -15
  119. package/dist/contracts/runtime-app.d.ts +6 -1
  120. package/dist/contracts/runtime-components.d.ts +646 -18
  121. package/dist/contracts/runtime-components.js +304 -188
  122. package/dist/contracts/runtime-services.d.ts +15 -0
  123. package/dist/contracts/runtime-services.js +25 -0
  124. package/dist/contracts/runtime-storage.d.ts +32 -0
  125. package/dist/contracts/runtime-storage.js +37 -0
  126. package/dist/contracts/source-workspaces.d.ts +511 -0
  127. package/dist/contracts/source-workspaces.js +276 -0
  128. package/dist/contracts/space-config-spacefast.d.ts +394 -0
  129. package/dist/contracts/space-config-spacefast.js +70 -0
  130. package/dist/contracts/space-config.d.ts +177 -90
  131. package/dist/contracts/space-config.js +77 -92
  132. package/dist/contracts/spaces.d.ts +132 -24
  133. package/dist/contracts/spaces.js +77 -13
  134. package/dist/contracts/superadmin-connectors.d.ts +371 -0
  135. package/dist/contracts/superadmin-connectors.js +61 -0
  136. package/dist/contracts/superadmin-emails.d.ts +1 -1
  137. package/dist/contracts/superadmin-emails.js +1 -1
  138. package/dist/contracts/superadmin-entities.d.ts +105 -0
  139. package/dist/contracts/superadmin-entities.js +64 -0
  140. package/dist/contracts/superadmin-runtime.d.ts +35 -116
  141. package/dist/contracts/superadmin-runtime.js +13 -69
  142. package/dist/contracts/superadmin-search.d.ts +12 -14
  143. package/dist/contracts/superadmin-search.js +2 -2
  144. package/dist/contracts/superadmin-spaces.d.ts +15 -72
  145. package/dist/contracts/superadmin-spaces.js +2 -7
  146. package/dist/contracts/superadmin-teams.d.ts +12 -0
  147. package/dist/contracts/superadmin-teams.js +7 -1
  148. package/dist/contracts/superadmin-tenants.d.ts +44 -16
  149. package/dist/contracts/superadmin.d.ts +2 -2
  150. package/dist/contracts/tags.d.ts +12 -12
  151. package/dist/contracts/teams.d.ts +29 -1
  152. package/dist/contracts/teams.js +24 -2
  153. package/dist/contracts/tenants.d.ts +98 -0
  154. package/dist/contracts/tenants.js +20 -0
  155. package/dist/contracts/transfers.d.ts +92 -0
  156. package/dist/contracts/transfers.js +37 -0
  157. package/dist/contracts/usage.d.ts +9 -1
  158. package/dist/contracts/usage.js +2 -0
  159. package/dist/contracts/visual-review.d.ts +448 -0
  160. package/dist/contracts/visual-review.js +156 -0
  161. package/dist/contracts/wordpress-php-toolkit.json +9 -0
  162. package/dist/contracts/work-mode.d.ts +24 -0
  163. package/dist/contracts/work-mode.js +17 -0
  164. package/dist/contracts/wp-cli.d.ts +66 -0
  165. package/dist/contracts/wp-cli.js +68 -0
  166. package/dist/contracts/zero-catalog.d.ts +29 -0
  167. package/dist/contracts/zero-catalog.js +55 -0
  168. package/dist/contracts/zero-platform-abilities.generated.d.ts +31 -0
  169. package/dist/contracts/zero-platform-abilities.generated.js +373 -0
  170. package/dist/contracts/zero-spacefast.d.ts +444 -0
  171. package/dist/contracts/zero-spacefast.js +149 -0
  172. package/dist/contracts/zero-types.d.ts +47 -0
  173. package/dist/contracts/zero-types.js +263 -0
  174. package/dist/contracts/zero.d.ts +781 -14
  175. package/dist/contracts/zero.js +204 -10
  176. package/dist/dashboard-paths/index.d.ts +2 -2
  177. package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -2
  178. package/dist/dashboard-paths/route-reservations.generated.js +5 -0
  179. package/dist/docs/agent-prose.d.ts +1 -1
  180. package/dist/docs/agent-prose.js +15 -18
  181. package/dist/docs/agent-setup.d.ts +1 -1
  182. package/dist/docs/agent-setup.js +5 -13
  183. package/dist/docs/catalog.d.ts +64 -28
  184. package/dist/docs/catalog.js +155 -28
  185. package/dist/docs/error-docs.d.ts +365 -17
  186. package/dist/docs/error-docs.js +369 -21
  187. package/dist/docs/reference-urls.js +1 -1
  188. package/dist/docs/skills.d.ts +84 -84
  189. package/dist/docs/skills.js +66 -47
  190. package/dist/docs/start-prompts.d.ts +14 -0
  191. package/dist/docs/start-prompts.js +20 -0
  192. package/dist/utils/account-labels.d.ts +7 -0
  193. package/dist/utils/account-labels.js +15 -0
  194. package/dist/utils/auth.d.ts +1 -0
  195. package/dist/utils/auth.js +1 -0
  196. package/dist/utils/credential-policy.d.ts +22 -1
  197. package/dist/utils/credential-policy.js +55 -6
  198. package/dist/utils/local-space-state.d.ts +7 -0
  199. package/dist/utils/local-space-state.js +7 -0
  200. package/dist/utils/logger.d.ts +34 -0
  201. package/dist/utils/logger.js +144 -0
  202. package/dist/utils/page-routes.d.ts +9 -0
  203. package/dist/utils/page-routes.js +82 -0
  204. package/dist/utils/pages.d.ts +2 -0
  205. package/dist/utils/pages.js +7 -0
  206. package/dist/utils/publish-form-data.d.ts +2 -0
  207. package/dist/utils/publish-form-data.js +2 -0
  208. package/dist/utils/publish-policy-spacefast.d.ts +13 -0
  209. package/dist/utils/publish-policy-spacefast.js +117 -0
  210. package/dist/utils/publish-policy.d.ts +22 -16
  211. package/dist/utils/publish-policy.fixtures.json +15 -0
  212. package/dist/utils/publish-policy.js +62 -139
  213. package/dist/utils/query-client.js +9 -1
  214. package/dist/utils/runtime-upload.d.ts +4 -0
  215. package/dist/utils/runtime-upload.js +5 -0
  216. package/dist/utils/space-config.d.ts +2 -3
  217. package/dist/utils/space-config.js +1 -1
  218. package/dist/utils/uploaded-source.d.ts +4 -0
  219. package/dist/utils/uploaded-source.js +12 -0
  220. package/dist/visual-review.d.ts +4 -0
  221. package/dist/visual-review.js +208 -0
  222. package/dist/vocabulary.d.ts +38 -0
  223. package/dist/vocabulary.js +55 -0
  224. package/package.json +7 -2
  225. package/dist/agents/registry/deeplink-probes.d.ts +0 -23
  226. package/dist/agents/registry/deeplink-probes.js +0 -18
@@ -0,0 +1,276 @@
1
+ import { z } from "zod";
2
+ import { CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
3
+ export const sourceCommitShaSchema = z.string().regex(/^[a-f0-9]{40}$/i);
4
+ export const sourceWorkspacePathSchema = z
5
+ .string()
6
+ .min(1)
7
+ .max(4096)
8
+ .refine((path) => !/[\\\p{Cc}]/u.test(path) &&
9
+ !path
10
+ .split("/")
11
+ .some((part) => !part || part === "." || part === ".." || part.toLowerCase() === ".git"), { message: "Use a repository-relative file path. Do not use dot segments or a leading slash." });
12
+ export const sourceWorkspaceAuthorSchema = z.object({
13
+ name: z.string().trim().min(1),
14
+ email: z.string().email(),
15
+ });
16
+ function validateSourceContents(input, context) {
17
+ if (input.contents === undefined)
18
+ return;
19
+ const encoding = input.encoding ?? "utf8";
20
+ const contents = input.contents;
21
+ if (encoding === "base64" &&
22
+ !/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(contents)) {
23
+ context.addIssue({
24
+ code: "custom",
25
+ path: ["contents"],
26
+ message: "Use complete valid base64 contents. Include required padding.",
27
+ });
28
+ }
29
+ if (encoding === "hex" && (contents.length % 2 !== 0 || !/^[a-f0-9]*$/i.test(contents))) {
30
+ context.addIssue({
31
+ code: "custom",
32
+ path: ["contents"],
33
+ message: "Use hexadecimal byte pairs. Do not omit a digit.",
34
+ });
35
+ }
36
+ if (encoding === "utf8" && new TextEncoder().encode(contents).byteLength > 1024 * 1024) {
37
+ context.addIssue({
38
+ code: "custom",
39
+ path: ["contents"],
40
+ message: "Complete file contents must be at most 1 MiB.",
41
+ });
42
+ }
43
+ }
44
+ export const sourceWorkspaceFileOperationSchema = z.discriminatedUnion("action", [
45
+ z
46
+ .object({
47
+ action: z.literal("upsert"),
48
+ path: sourceWorkspacePathSchema,
49
+ contents: z
50
+ .string()
51
+ .max(1024 * 1024)
52
+ .describe("Complete file contents. Omitted files do not change."),
53
+ encoding: z.enum(["utf8", "base64", "hex"]).optional(),
54
+ mode: z.enum(["100644", "100755", "120000", "160000"]).optional(),
55
+ })
56
+ .superRefine(validateSourceContents),
57
+ z.object({ action: z.literal("delete"), path: sourceWorkspacePathSchema }),
58
+ ]);
59
+ const operationId = z
60
+ .string()
61
+ .trim()
62
+ .min(1)
63
+ .max(128)
64
+ .describe("Unique ID for this operation. Reuse this ID and the same input after an uncertain response.");
65
+ export const sourceWorkspaceMutationSchema = z.object({
66
+ expectedRevision: z
67
+ .number()
68
+ .int()
69
+ .nonnegative()
70
+ .describe("Revision from the last workspace response. Read the workspace again after a revision conflict."),
71
+ operationId,
72
+ });
73
+ export const sourceWorkspaceCreateSchema = z.object({
74
+ operationId,
75
+ name: z.string().trim().min(1).max(160).optional(),
76
+ targetBranch: z
77
+ .string()
78
+ .trim()
79
+ .min(1)
80
+ .max(255)
81
+ .optional()
82
+ .describe("Existing project branch. Defaults to the production branch."),
83
+ originalUploadVersionId: z
84
+ .string()
85
+ .min(1)
86
+ .max(64)
87
+ .optional()
88
+ .describe("Pinned eligible direct upload to import if this Space has no saved source. Omit to import the current eligible direct upload automatically. Never send a build output version."),
89
+ author: sourceWorkspaceAuthorSchema
90
+ .optional()
91
+ .describe("Omit to use the registered name and email. If they are incomplete, send the author once when you create the workspace. This affects attribution only."),
92
+ });
93
+ export const sourceWorkspaceEditSchema = sourceWorkspaceMutationSchema.extend({
94
+ operations: z
95
+ .array(sourceWorkspaceFileOperationSchema)
96
+ .min(1)
97
+ .max(100)
98
+ .refine((operations) => new Set(operations.map((operation) => operation.path)).size === operations.length, { message: "Use each file path once per operation." }),
99
+ });
100
+ export const sourceWorkspaceSelectionSchema = sourceWorkspaceMutationSchema
101
+ .extend({
102
+ paths: z.array(sourceWorkspacePathSchema).min(1).max(1000).optional(),
103
+ hunkIds: z
104
+ .array(z.string().min(1))
105
+ .min(1)
106
+ .max(1000)
107
+ .optional()
108
+ .describe("Exact hunk IDs from the current diff. Do not construct or reuse stale IDs."),
109
+ all: z.literal(true).optional(),
110
+ })
111
+ .refine((input) => [input.paths, input.hunkIds, input.all].filter((value) => value !== undefined).length === 1, { message: "Send paths, hunkIds, or all. Send only one selection." });
112
+ export const sourceWorkspaceCommitSchema = sourceWorkspaceMutationSchema.extend({
113
+ message: z.string().trim().min(1).max(4096),
114
+ author: sourceWorkspaceAuthorSchema
115
+ .optional()
116
+ .describe("Omit to reuse the author stored when the workspace was created."),
117
+ });
118
+ export const sourceWorkspaceRestoreSchema = sourceWorkspaceMutationSchema.extend({
119
+ paths: z.array(sourceWorkspacePathSchema).min(1).max(1000),
120
+ sourceCommitSha: sourceCommitShaSchema
121
+ .optional()
122
+ .describe("Saved source commit to copy from. Omit to copy from the staged snapshot. Staging does not change."),
123
+ });
124
+ export const sourceWorkspaceUndoSchema = sourceWorkspaceMutationSchema.extend({
125
+ sourceCommitSha: sourceCommitShaSchema.describe("Non-merge source commit to undo in working files. This does not commit or deploy."),
126
+ });
127
+ export const sourceWorkspaceCloseSchema = sourceWorkspaceMutationSchema.extend({
128
+ discardPending: z
129
+ .boolean()
130
+ .default(false)
131
+ .describe("Set true only when the user requests discarding pending changes."),
132
+ });
133
+ export const sourceWorkspaceResolutionSchema = z.union([
134
+ z
135
+ .object({
136
+ path: sourceWorkspacePathSchema,
137
+ contents: z
138
+ .string()
139
+ .max(1024 * 1024)
140
+ .describe("Complete file contents for this resolution."),
141
+ encoding: z
142
+ .enum(["utf8", "base64", "hex"])
143
+ .optional()
144
+ .describe("Encoding of contents. Omit it for UTF-8."),
145
+ mode: z
146
+ .enum(["100644", "100755", "120000", "160000"])
147
+ .optional()
148
+ .describe("File mode for contents. Omit it to keep the current mode."),
149
+ })
150
+ .strict()
151
+ .superRefine(validateSourceContents),
152
+ z
153
+ .object({
154
+ path: sourceWorkspacePathSchema,
155
+ delete: z
156
+ .literal(true)
157
+ .describe("Delete this path. Do not send contents, encoding, or mode."),
158
+ })
159
+ .strict(),
160
+ z
161
+ .object({
162
+ path: sourceWorkspacePathSchema,
163
+ side: z
164
+ .enum(["base", "ours", "theirs"])
165
+ .describe("Copy this exact pinned side. Do not send contents, encoding, or mode."),
166
+ })
167
+ .strict(),
168
+ ]);
169
+ export const sourceWorkspaceResolveSchema = sourceWorkspaceMutationSchema.extend({
170
+ resolutions: z.array(sourceWorkspaceResolutionSchema).min(1).max(1000),
171
+ });
172
+ export const sourceWorkspaceDiffQuerySchema = z.object({
173
+ view: z.enum(["working", "staged", "unstaged"]).default("working"),
174
+ path: sourceWorkspacePathSchema.optional(),
175
+ });
176
+ export const sourceWorkspaceListQuerySchema = cursorListQuerySchema.extend({
177
+ status: z
178
+ .enum(["open", "closed"])
179
+ .default("open")
180
+ .describe("Open includes initializing, active, and conflicted workspaces. Use closed for history."),
181
+ });
182
+ export const SourceWorkspaceSchema = z.object({
183
+ id: z.string(),
184
+ spaceId: z.string(),
185
+ repositoryId: z.string(),
186
+ targetBranch: z.string(),
187
+ name: z.string(),
188
+ revision: z.number().int().nonnegative(),
189
+ state: z.enum(["initializing", "active", "conflicted", "closed"]),
190
+ baseCommitSha: sourceCommitShaSchema.nullable(),
191
+ indexCommitSha: sourceCommitShaSchema.nullable(),
192
+ workingCommitSha: sourceCommitShaSchema.nullable(),
193
+ headCommitSha: sourceCommitShaSchema.nullable(),
194
+ originalUploadVersionId: z.string().nullable(),
195
+ hasStagedChanges: z.boolean(),
196
+ hasUnstagedChanges: z.boolean(),
197
+ hasPendingChanges: z.boolean(),
198
+ needsSync: z.boolean(),
199
+ pendingOperationId: z.string().nullable(),
200
+ autoDeploy: z.boolean(),
201
+ createdAt: z.string(),
202
+ updatedAt: z.string(),
203
+ });
204
+ export const sourceWorkspaceHunkSchema = z.object({
205
+ id: z.string(),
206
+ oldStart: z.number().int(),
207
+ oldLines: z.number().int().nonnegative(),
208
+ newStart: z.number().int(),
209
+ newLines: z.number().int().nonnegative(),
210
+ patch: z.string(),
211
+ });
212
+ export const sourceWorkspaceDiffFileSchema = z.object({
213
+ path: z.string(),
214
+ oldPath: z.string().nullable(),
215
+ state: z.string(),
216
+ additions: z.number().int(),
217
+ deletions: z.number().int(),
218
+ changes: z.number().int(),
219
+ patch: z.string(),
220
+ patchTruncated: z.boolean(),
221
+ wholeFileOnly: z.boolean(),
222
+ hunks: z.array(sourceWorkspaceHunkSchema),
223
+ });
224
+ export const sourceWorkspaceDiffSchema = z.object({
225
+ workspace: SourceWorkspaceSchema,
226
+ view: z.enum(["working", "staged", "unstaged"]),
227
+ baseCommitSha: sourceCommitShaSchema,
228
+ targetCommitSha: sourceCommitShaSchema,
229
+ stats: z.object({
230
+ files: z.number().int(),
231
+ additions: z.number().int(),
232
+ deletions: z.number().int(),
233
+ changes: z.number().int(),
234
+ }),
235
+ files: z.array(sourceWorkspaceDiffFileSchema),
236
+ filteredFiles: z.array(z.object({ path: z.string(), oldPath: z.string().nullable(), state: z.string() })),
237
+ });
238
+ export const sourceWorkspaceConflictSideSchema = z.object({
239
+ sourceCommitSha: sourceCommitShaSchema,
240
+ content: z.string().nullable(),
241
+ exists: z.boolean(),
242
+ binary: z.boolean(),
243
+ truncated: z.boolean(),
244
+ mode: z.string().nullable(),
245
+ });
246
+ export const sourceWorkspaceConflictsSchema = z.object({
247
+ phase: z.enum(["staged", "working", "undo"]),
248
+ labels: z.object({ ours: z.string(), theirs: z.string() }),
249
+ files: z.array(z.object({
250
+ path: z.string(),
251
+ result: z.string(),
252
+ base: sourceWorkspaceConflictSideSchema,
253
+ ours: sourceWorkspaceConflictSideSchema,
254
+ theirs: sourceWorkspaceConflictSideSchema,
255
+ })),
256
+ });
257
+ export const sourceWorkspaceReceiptSchema = z.object({
258
+ workspace: SourceWorkspaceSchema,
259
+ commit: z
260
+ .object({
261
+ sourceCommitSha: sourceCommitShaSchema,
262
+ parentSourceCommitSha: sourceCommitShaSchema,
263
+ message: z.string(),
264
+ autoDeploy: z.boolean(),
265
+ })
266
+ .optional(),
267
+ conflicts: sourceWorkspaceConflictsSchema.optional(),
268
+ });
269
+ export const sourceWorkspaceListSchema = z.object({
270
+ workspaces: z.array(SourceWorkspaceSchema),
271
+ pagination: CursorPaginationSchema,
272
+ });
273
+ export const sourceWorkspaceConflictResponseSchema = z.object({
274
+ workspace: SourceWorkspaceSchema,
275
+ conflicts: sourceWorkspaceConflictsSchema.nullable(),
276
+ });
@@ -0,0 +1,394 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The system manifest as Spacefast parses it: the format's manifest plus the
4
+ * per-tenant plan catalog. Metering is host material, so `plans` lives here
5
+ * rather than in the format.
6
+ */
7
+ export declare const spacefastSpaceSystemManifestSchema: z.ZodObject<{
8
+ presentation: z.ZodOptional<z.ZodObject<{
9
+ name: z.ZodOptional<z.ZodString>;
10
+ logo: z.ZodOptional<z.ZodString>;
11
+ supportUrl: z.ZodOptional<z.ZodString>;
12
+ claimOrigin: z.ZodOptional<z.ZodString>;
13
+ accessHandoffOrigin: z.ZodOptional<z.ZodString>;
14
+ problemDocsBaseUrl: z.ZodOptional<z.ZodString>;
15
+ contacts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
16
+ }, z.core.$strict>>;
17
+ hostnames: z.ZodOptional<z.ZodObject<{
18
+ apex: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strict>>;
20
+ api: z.ZodOptional<z.ZodObject<{
21
+ origin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
22
+ allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
23
+ }, z.core.$strict>>;
24
+ tokenIssuers: z.ZodOptional<z.ZodArray<z.ZodObject<{
25
+ issuer: z.ZodString;
26
+ keys: z.ZodArray<z.ZodObject<{
27
+ kid: z.ZodString;
28
+ publicKey: z.ZodString;
29
+ }, z.core.$strict>>;
30
+ proofs: z.ZodOptional<z.ZodArray<z.ZodString>>;
31
+ }, z.core.$strict>>>;
32
+ subscriptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
33
+ url: z.ZodString;
34
+ events: z.ZodArray<z.ZodString>;
35
+ }, z.core.$strict>>>;
36
+ plans: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
37
+ features: z.ZodArray<z.ZodEnum<{
38
+ connectors: "connectors";
39
+ zero: "zero";
40
+ tags: "tags";
41
+ functions: "functions";
42
+ "plans.paid.available": "plans.paid.available";
43
+ "anonymous.publishing": "anonymous.publishing";
44
+ "beta.enrollment_gate": "beta.enrollment_gate";
45
+ "domains.search": "domains.search";
46
+ "domains.registration": "domains.registration";
47
+ "domains.dns_management": "domains.dns_management";
48
+ "domains.wpcom_dns": "domains.wpcom_dns";
49
+ "domains.domain_connect": "domains.domain_connect";
50
+ "domains.proxy_bindings": "domains.proxy_bindings";
51
+ "collab.notices": "collab.notices";
52
+ "collab.comments": "collab.comments";
53
+ "content.managed": "content.managed";
54
+ "collab.drawing": "collab.drawing";
55
+ "sites.jetpack": "sites.jetpack";
56
+ "spaces.slug_rename": "spaces.slug_rename";
57
+ "content.users": "content.users";
58
+ "pages.templates": "pages.templates";
59
+ "branding.hide": "branding.hide";
60
+ }>>;
61
+ quotas: z.ZodObject<{
62
+ spaces: z.ZodOptional<z.ZodNumber>;
63
+ storageBytes: z.ZodOptional<z.ZodNumber>;
64
+ buildMinutesPerMonth: z.ZodOptional<z.ZodNumber>;
65
+ customDomains: z.ZodOptional<z.ZodNumber>;
66
+ }, z.core.$strict>;
67
+ quotaPolicy: z.ZodOptional<z.ZodEnum<{
68
+ block: "block";
69
+ warn: "warn";
70
+ }>>;
71
+ }, z.core.$strict>>>;
72
+ defaultPlan: z.ZodOptional<z.ZodString>;
73
+ }, z.core.$strict>;
74
+ export type SpacefastSpaceSystemManifest = z.infer<typeof spacefastSpaceSystemManifestSchema>;
75
+ /**
76
+ * The `sf.jsonc` FILE shape as Spacefast parses it. Every intake seam that may
77
+ * receive a partner's system manifest — finalize, the CLI's project config —
78
+ * parses through this; the format's own schema rejects `system.plans` outright,
79
+ * so a seam that forgets fails loudly instead of dropping the catalog.
80
+ */
81
+ export declare const spacefastSpaceConfigFileSchema: z.ZodObject<{
82
+ index: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
83
+ fallback: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
84
+ path: z.ZodString;
85
+ status: z.ZodNumber;
86
+ }, z.core.$strip>]>>;
87
+ cleanUrls: z.ZodOptional<z.ZodBoolean>;
88
+ listing: z.ZodOptional<z.ZodBoolean>;
89
+ meta: z.ZodOptional<z.ZodObject<{
90
+ title: z.ZodOptional<z.ZodString>;
91
+ description: z.ZodOptional<z.ZodString>;
92
+ image: z.ZodOptional<z.ZodString>;
93
+ favicon: z.ZodOptional<z.ZodString>;
94
+ }, z.core.$strip>>;
95
+ superpowers: z.ZodOptional<z.ZodObject<{
96
+ enabled: z.ZodOptional<z.ZodBoolean>;
97
+ disable_all_injection: z.ZodOptional<z.ZodBoolean>;
98
+ googleAnalytics: z.ZodOptional<z.ZodObject<{
99
+ enabled: z.ZodOptional<z.ZodBoolean>;
100
+ measurementId: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$strip>>;
102
+ googleTagManager: z.ZodOptional<z.ZodObject<{
103
+ enabled: z.ZodOptional<z.ZodBoolean>;
104
+ containerId: z.ZodOptional<z.ZodString>;
105
+ }, z.core.$strip>>;
106
+ javascriptTags: z.ZodOptional<z.ZodArray<z.ZodObject<{
107
+ id: z.ZodOptional<z.ZodString>;
108
+ name: z.ZodOptional<z.ZodString>;
109
+ enabled: z.ZodOptional<z.ZodBoolean>;
110
+ code: z.ZodString;
111
+ }, z.core.$strip>>>;
112
+ tags: z.ZodOptional<z.ZodObject<{
113
+ inheritance: z.ZodOptional<z.ZodObject<{
114
+ inherited: z.ZodOptional<z.ZodBoolean>;
115
+ overrides: z.ZodOptional<z.ZodArray<z.ZodObject<{
116
+ tagId: z.ZodString;
117
+ disabled: z.ZodDefault<z.ZodBoolean>;
118
+ reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
119
+ }, z.core.$strip>>>;
120
+ }, z.core.$strip>>;
121
+ requireReview: z.ZodOptional<z.ZodBoolean>;
122
+ }, z.core.$strip>>;
123
+ }, z.core.$strip>>;
124
+ templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
125
+ theme: z.ZodOptional<z.ZodObject<{
126
+ accent: z.ZodOptional<z.ZodString>;
127
+ background: z.ZodOptional<z.ZodString>;
128
+ logo: z.ZodOptional<z.ZodString>;
129
+ name: z.ZodOptional<z.ZodString>;
130
+ font: z.ZodOptional<z.ZodString>;
131
+ hideSpacefastBranding: z.ZodOptional<z.ZodBoolean>;
132
+ }, z.core.$strict>>;
133
+ build: z.ZodOptional<z.ZodObject<{
134
+ rootDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
+ installDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
136
+ installCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
+ buildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
138
+ outputDirectory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
139
+ ignoredBuildCommand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
140
+ frameworkPreset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
141
+ platformPreset: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
+ allowUnsupportedPlatformFeatures: z.ZodOptional<z.ZodBoolean>;
143
+ timeoutSeconds: z.ZodOptional<z.ZodNumber>;
144
+ }, z.core.$strict>>;
145
+ placement: z.ZodOptional<z.ZodObject<{
146
+ burstable: z.ZodOptional<z.ZodBoolean>;
147
+ }, z.core.$strict>>;
148
+ markdownNegotiation: z.ZodOptional<z.ZodBoolean>;
149
+ inject: z.ZodOptional<z.ZodObject<{
150
+ head: z.ZodOptional<z.ZodArray<z.ZodString>>;
151
+ bodyStart: z.ZodOptional<z.ZodArray<z.ZodString>>;
152
+ bodyEnd: z.ZodOptional<z.ZodArray<z.ZodString>>;
153
+ noscript: z.ZodOptional<z.ZodArray<z.ZodString>>;
154
+ }, z.core.$strip>>;
155
+ $schema: z.ZodOptional<z.ZodString>;
156
+ space: z.ZodOptional<z.ZodString>;
157
+ name: z.ZodOptional<z.ZodString>;
158
+ access: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodLiteral<"public">, z.ZodTransform<{
159
+ public: string[];
160
+ }, "public">>, z.ZodObject<{
161
+ public: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
162
+ }, z.core.$strict>]>>;
163
+ runtime: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
164
+ kind: z.ZodLiteral<"zero">;
165
+ server: z.ZodString;
166
+ client: z.ZodString;
167
+ }, z.core.$strip>, z.ZodObject<{
168
+ kind: z.ZodLiteral<"functions">;
169
+ entry: z.ZodOptional<z.ZodString>;
170
+ database: z.ZodDefault<z.ZodBoolean>;
171
+ fetch: z.ZodOptional<z.ZodBoolean>;
172
+ compatibilityDate: z.ZodOptional<z.ZodString>;
173
+ }, z.core.$strip>], "kind">>;
174
+ crons: z.ZodOptional<z.ZodArray<z.ZodObject<{
175
+ path: z.ZodString;
176
+ schedule: z.ZodString;
177
+ }, z.core.$strip>>>;
178
+ system: z.ZodOptional<z.ZodObject<{
179
+ presentation: z.ZodOptional<z.ZodObject<{
180
+ name: z.ZodOptional<z.ZodString>;
181
+ logo: z.ZodOptional<z.ZodString>;
182
+ supportUrl: z.ZodOptional<z.ZodString>;
183
+ claimOrigin: z.ZodOptional<z.ZodString>;
184
+ accessHandoffOrigin: z.ZodOptional<z.ZodString>;
185
+ problemDocsBaseUrl: z.ZodOptional<z.ZodString>;
186
+ contacts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
187
+ }, z.core.$strict>>;
188
+ hostnames: z.ZodOptional<z.ZodObject<{
189
+ apex: z.ZodOptional<z.ZodString>;
190
+ }, z.core.$strict>>;
191
+ api: z.ZodOptional<z.ZodObject<{
192
+ origin: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
193
+ allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
194
+ }, z.core.$strict>>;
195
+ tokenIssuers: z.ZodOptional<z.ZodArray<z.ZodObject<{
196
+ issuer: z.ZodString;
197
+ keys: z.ZodArray<z.ZodObject<{
198
+ kid: z.ZodString;
199
+ publicKey: z.ZodString;
200
+ }, z.core.$strict>>;
201
+ proofs: z.ZodOptional<z.ZodArray<z.ZodString>>;
202
+ }, z.core.$strict>>>;
203
+ subscriptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
204
+ url: z.ZodString;
205
+ events: z.ZodArray<z.ZodString>;
206
+ }, z.core.$strict>>>;
207
+ plans: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
208
+ features: z.ZodArray<z.ZodEnum<{
209
+ connectors: "connectors";
210
+ zero: "zero";
211
+ tags: "tags";
212
+ functions: "functions";
213
+ "plans.paid.available": "plans.paid.available";
214
+ "anonymous.publishing": "anonymous.publishing";
215
+ "beta.enrollment_gate": "beta.enrollment_gate";
216
+ "domains.search": "domains.search";
217
+ "domains.registration": "domains.registration";
218
+ "domains.dns_management": "domains.dns_management";
219
+ "domains.wpcom_dns": "domains.wpcom_dns";
220
+ "domains.domain_connect": "domains.domain_connect";
221
+ "domains.proxy_bindings": "domains.proxy_bindings";
222
+ "collab.notices": "collab.notices";
223
+ "collab.comments": "collab.comments";
224
+ "content.managed": "content.managed";
225
+ "collab.drawing": "collab.drawing";
226
+ "sites.jetpack": "sites.jetpack";
227
+ "spaces.slug_rename": "spaces.slug_rename";
228
+ "content.users": "content.users";
229
+ "pages.templates": "pages.templates";
230
+ "branding.hide": "branding.hide";
231
+ }>>;
232
+ quotas: z.ZodObject<{
233
+ spaces: z.ZodOptional<z.ZodNumber>;
234
+ storageBytes: z.ZodOptional<z.ZodNumber>;
235
+ buildMinutesPerMonth: z.ZodOptional<z.ZodNumber>;
236
+ customDomains: z.ZodOptional<z.ZodNumber>;
237
+ }, z.core.$strict>;
238
+ quotaPolicy: z.ZodOptional<z.ZodEnum<{
239
+ block: "block";
240
+ warn: "warn";
241
+ }>>;
242
+ }, z.core.$strict>>>;
243
+ defaultPlan: z.ZodOptional<z.ZodString>;
244
+ }, z.core.$strict>>;
245
+ }, z.core.$strip>;
246
+ export type SpacefastSpaceConfigFile = z.infer<typeof spacefastSpaceConfigFileSchema>;
247
+ /**
248
+ * The published JSON Schema artifact for `sf.jsonc`, generated from the zod file
249
+ * schema. Served at SPACE_CONFIG_SCHEMA_URL so editors and agents get
250
+ * autocomplete and validation — including the host keys, since the document an
251
+ * editor resolves describes what this host accepts.
252
+ */
253
+ export declare function spaceConfigJsonSchema(): {
254
+ properties: {
255
+ redirects: {
256
+ readonly type: "array";
257
+ readonly description: "Browser redirect rules. Same matcher grammar as _redirects, and _redirects rules match first.";
258
+ readonly items: {
259
+ readonly type: "object";
260
+ readonly properties: {
261
+ readonly source: {
262
+ readonly type: "string";
263
+ readonly minLength: 1;
264
+ readonly description: "Request path to match. * is a splat, :name captures a segment.";
265
+ };
266
+ readonly destination: {
267
+ readonly type: "string";
268
+ readonly minLength: 1;
269
+ readonly description: "Path or absolute URL. :splat and :name from the source are substituted.";
270
+ };
271
+ readonly status: {
272
+ readonly enum: readonly [301, 302, 303, 307, 308];
273
+ readonly default: 302;
274
+ readonly description: "Redirect status. To serve other content under this URL, use rewrites.";
275
+ };
276
+ readonly force: {
277
+ readonly type: "boolean";
278
+ readonly default: false;
279
+ readonly description: "Answer even when the request path resolves to a committed file, the ! of a _redirects rule.";
280
+ };
281
+ readonly query: {
282
+ readonly type: "object";
283
+ readonly description: "Query parameters the request must carry, as parameter name to capture name: { \"id\": \"id\" } is the name=:capture token id=:id.";
284
+ readonly propertyNames: {
285
+ readonly pattern: "^[A-Za-z_][A-Za-z0-9_-]*$";
286
+ };
287
+ readonly additionalProperties: {
288
+ readonly type: "string";
289
+ readonly pattern: "^[A-Za-z][A-Za-z0-9_]*$";
290
+ };
291
+ };
292
+ };
293
+ readonly required: readonly ["source", "destination"];
294
+ readonly additionalProperties: false;
295
+ };
296
+ };
297
+ rewrites: {
298
+ readonly type: "array";
299
+ readonly description: "Rewrite and proxy rules: the URL stays, the content comes from the destination. _redirects rules match first, then redirects.";
300
+ readonly items: {
301
+ readonly type: "object";
302
+ readonly properties: {
303
+ readonly source: {
304
+ readonly type: "string";
305
+ readonly minLength: 1;
306
+ readonly description: "Request path to match. * is a splat, :name captures a segment.";
307
+ };
308
+ readonly destination: {
309
+ readonly type: "string";
310
+ readonly minLength: 1;
311
+ readonly description: "Path to serve under this URL, or an absolute URL to proxy. :splat and :name from the source are substituted.";
312
+ };
313
+ readonly cache: {
314
+ readonly const: "shared";
315
+ readonly description: "Let shared caches store the proxy response. Absolute-URL destinations only.";
316
+ };
317
+ readonly force: {
318
+ readonly type: "boolean";
319
+ readonly default: false;
320
+ readonly description: "Answer even when the request path resolves to a committed file, the ! of a _redirects rule.";
321
+ };
322
+ readonly query: {
323
+ readonly type: "object";
324
+ readonly description: "Query parameters the request must carry, as parameter name to capture name: { \"id\": \"id\" } is the name=:capture token id=:id.";
325
+ readonly propertyNames: {
326
+ readonly pattern: "^[A-Za-z_][A-Za-z0-9_-]*$";
327
+ };
328
+ readonly additionalProperties: {
329
+ readonly type: "string";
330
+ readonly pattern: "^[A-Za-z][A-Za-z0-9_]*$";
331
+ };
332
+ };
333
+ readonly notFound: {
334
+ readonly type: "boolean";
335
+ readonly default: false;
336
+ readonly description: "Serve the destination with status 404, the 404 of a _redirects rule. The destination must be a path.";
337
+ };
338
+ };
339
+ readonly required: readonly ["source", "destination"];
340
+ readonly additionalProperties: false;
341
+ };
342
+ };
343
+ headers: {
344
+ readonly type: "array";
345
+ readonly description: "Response headers to set or remove on matching requests. A _headers rule wins on the same header name.";
346
+ readonly items: {
347
+ readonly type: "object";
348
+ readonly properties: {
349
+ readonly source: {
350
+ readonly type: "string";
351
+ readonly minLength: 1;
352
+ readonly description: "Request path to match.";
353
+ };
354
+ readonly headers: {
355
+ readonly type: "array";
356
+ readonly minItems: 1;
357
+ readonly items: {
358
+ readonly oneOf: readonly [{
359
+ readonly type: "object";
360
+ readonly properties: {
361
+ readonly key: {
362
+ readonly type: "string";
363
+ readonly minLength: 1;
364
+ };
365
+ readonly value: {
366
+ readonly type: "string";
367
+ };
368
+ };
369
+ readonly required: readonly ["key", "value"];
370
+ readonly additionalProperties: false;
371
+ }, {
372
+ readonly type: "object";
373
+ readonly properties: {
374
+ readonly key: {
375
+ readonly type: "string";
376
+ readonly minLength: 1;
377
+ };
378
+ readonly remove: {
379
+ readonly const: true;
380
+ readonly description: "Remove this header instead of setting it, the !Name line of a _headers block.";
381
+ };
382
+ };
383
+ readonly required: readonly ["key", "remove"];
384
+ readonly additionalProperties: false;
385
+ }];
386
+ };
387
+ };
388
+ };
389
+ readonly required: readonly ["source", "headers"];
390
+ readonly additionalProperties: false;
391
+ };
392
+ };
393
+ };
394
+ };