@spacefast/common 0.0.11 → 0.0.13

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 (160) hide show
  1. package/dist/agents/connect-targets.d.ts +4 -4
  2. package/dist/agents/connect-targets.js +3 -3
  3. package/dist/agents/private-key-oauth.d.ts +37 -0
  4. package/dist/agents/private-key-oauth.js +158 -0
  5. package/dist/config/domains.js +1 -1
  6. package/dist/config/index.d.ts +1 -0
  7. package/dist/config/index.js +1 -0
  8. package/dist/config/postgres-budget.d.ts +126 -0
  9. package/dist/config/postgres-budget.js +135 -0
  10. package/dist/config/postgres-budget.json +50 -0
  11. package/dist/contracts/access.d.ts +386 -1183
  12. package/dist/contracts/access.js +240 -1018
  13. package/dist/contracts/activity.d.ts +1 -1
  14. package/dist/contracts/activity.js +11 -19
  15. package/dist/contracts/api-keys.d.ts +69 -45
  16. package/dist/contracts/api-keys.js +3 -0
  17. package/dist/contracts/archives.d.ts +9 -10
  18. package/dist/contracts/archives.js +4 -6
  19. package/dist/contracts/builds.d.ts +8 -8
  20. package/dist/contracts/builds.js +28 -48
  21. package/dist/contracts/channels.js +1 -2
  22. package/dist/contracts/comments.d.ts +102 -93
  23. package/dist/contracts/comments.js +121 -63
  24. package/dist/contracts/common.d.ts +4 -3
  25. package/dist/contracts/common.js +2 -0
  26. package/dist/contracts/countries.js +2 -7
  27. package/dist/contracts/data-source-routes.d.ts +20 -0
  28. package/dist/contracts/data-source-routes.js +15 -0
  29. package/dist/contracts/deployments.d.ts +3 -3
  30. package/dist/contracts/device-auth.d.ts +21 -15
  31. package/dist/contracts/docs.d.ts +5 -5
  32. package/dist/contracts/domains.d.ts +261 -1330
  33. package/dist/contracts/domains.js +39 -301
  34. package/dist/contracts/email-preferences.d.ts +50 -0
  35. package/dist/contracts/email-preferences.js +44 -0
  36. package/dist/contracts/enums.d.ts +3 -5
  37. package/dist/contracts/enums.js +3 -8
  38. package/dist/contracts/error-code-meta.d.ts +99 -33
  39. package/dist/contracts/error-code-meta.js +36 -9
  40. package/dist/contracts/error-codes.d.ts +1 -1
  41. package/dist/contracts/error-codes.js +28 -11
  42. package/dist/contracts/execution.d.ts +212 -0
  43. package/dist/contracts/execution.js +288 -0
  44. package/dist/contracts/feature-lifecycle.d.ts +498 -2
  45. package/dist/contracts/feature-lifecycle.js +539 -2
  46. package/dist/contracts/features.d.ts +184 -74
  47. package/dist/contracts/features.js +4 -303
  48. package/dist/contracts/functions.d.ts +729 -0
  49. package/dist/contracts/functions.js +485 -0
  50. package/dist/contracts/git.d.ts +1 -1
  51. package/dist/contracts/grants.d.ts +1158 -0
  52. package/dist/contracts/grants.js +696 -0
  53. package/dist/contracts/ids.d.ts +6 -5
  54. package/dist/contracts/ids.js +6 -5
  55. package/dist/contracts/internal.d.ts +3 -3
  56. package/dist/contracts/mcp.d.ts +12 -12
  57. package/dist/contracts/me.js +1 -1
  58. package/dist/contracts/mounts.d.ts +142 -0
  59. package/dist/contracts/mounts.js +56 -0
  60. package/dist/contracts/oauth-resources.d.ts +5 -5
  61. package/dist/contracts/oauth-resources.js +2 -0
  62. package/dist/contracts/operations.d.ts +4 -4
  63. package/dist/contracts/pages.d.ts +6 -14
  64. package/dist/contracts/pages.js +11 -23
  65. package/dist/contracts/plan-policy.d.ts +2 -9
  66. package/dist/contracts/plan-policy.js +1 -4
  67. package/dist/contracts/platform.d.ts +80 -32
  68. package/dist/contracts/platform.js +59 -12
  69. package/dist/contracts/push-new.d.ts +26 -2
  70. package/dist/contracts/push-new.js +8 -0
  71. package/dist/contracts/quotas.d.ts +0 -1
  72. package/dist/contracts/quotas.js +0 -5
  73. package/dist/contracts/repository-connections.d.ts +1 -1
  74. package/dist/contracts/resources.d.ts +21 -85
  75. package/dist/contracts/resources.js +17 -47
  76. package/dist/contracts/runtime-api.d.ts +799 -192
  77. package/dist/contracts/runtime-api.js +231 -100
  78. package/dist/contracts/runtime-app.d.ts +138 -0
  79. package/dist/contracts/runtime-app.js +21 -0
  80. package/dist/contracts/sf-config-v1.d.ts +5 -0
  81. package/dist/contracts/sf-config-v1.js +1 -1
  82. package/dist/contracts/sites.d.ts +17 -12
  83. package/dist/contracts/sites.js +30 -12
  84. package/dist/contracts/space-config.d.ts +46 -117
  85. package/dist/contracts/space-config.js +323 -25
  86. package/dist/contracts/spaces.d.ts +392 -256
  87. package/dist/contracts/spaces.js +163 -83
  88. package/dist/contracts/superadmin-emails.d.ts +27 -3
  89. package/dist/contracts/superadmin-emails.js +10 -15
  90. package/dist/contracts/superadmin-runtime.d.ts +2 -2
  91. package/dist/contracts/superadmin-spaces.d.ts +19 -142
  92. package/dist/contracts/superadmin-spaces.js +7 -0
  93. package/dist/contracts/tags.d.ts +66 -36
  94. package/dist/contracts/tags.js +195 -11
  95. package/dist/contracts/teams.d.ts +9 -9
  96. package/dist/contracts/transfers.d.ts +1 -2
  97. package/dist/contracts/variables.d.ts +4 -4
  98. package/dist/contracts/variables.js +4 -3
  99. package/dist/contracts/webhooks.d.ts +2 -2
  100. package/dist/contracts/zero.d.ts +437 -193
  101. package/dist/contracts/zero.js +149 -158
  102. package/dist/dashboard-paths/index.d.ts +3 -3
  103. package/dist/dashboard-paths/index.js +1 -0
  104. package/dist/docs/agent-prose.js +10 -8
  105. package/dist/docs/agent-setup.d.ts +6 -4
  106. package/dist/docs/agent-setup.js +26 -16
  107. package/dist/docs/agent-solutions.js +1 -1
  108. package/dist/docs/catalog.d.ts +35 -37
  109. package/dist/docs/catalog.js +36 -38
  110. package/dist/docs/error-docs.js +108 -44
  111. package/dist/utils/asset-fingerprint.d.ts +11 -0
  112. package/dist/utils/asset-fingerprint.js +46 -0
  113. package/dist/utils/auth-redirect.d.ts +1 -3
  114. package/dist/utils/auth-redirect.js +1 -21
  115. package/dist/utils/build-settings.d.ts +2 -0
  116. package/dist/utils/build-settings.js +61 -9
  117. package/dist/utils/credential-policy.d.ts +1 -1
  118. package/dist/utils/credential-policy.js +4 -0
  119. package/dist/utils/dns-instructions.d.ts +29 -0
  120. package/dist/utils/dns-instructions.js +78 -0
  121. package/dist/utils/domain-diagnostics.d.ts +29 -0
  122. package/dist/utils/domain-diagnostics.js +63 -0
  123. package/dist/utils/egress-policy.fixtures.json +51 -0
  124. package/dist/utils/grants.d.ts +53 -0
  125. package/dist/utils/grants.js +160 -0
  126. package/dist/utils/id-hints.d.ts +1 -0
  127. package/dist/utils/id-hints.js +55 -13
  128. package/dist/utils/local-space-state.js +1 -0
  129. package/dist/utils/page-colors.d.ts +50 -0
  130. package/dist/utils/page-colors.js +167 -0
  131. package/dist/utils/page-fonts.d.ts +2 -0
  132. package/dist/utils/page-fonts.js +4 -0
  133. package/dist/utils/pages.d.ts +19 -6
  134. package/dist/utils/pages.js +122 -49
  135. package/dist/utils/production-runtime.d.ts +18 -0
  136. package/dist/utils/production-runtime.js +28 -0
  137. package/dist/utils/publish-policy.d.ts +34 -4
  138. package/dist/utils/publish-policy.js +132 -61
  139. package/dist/utils/query-keys.d.ts +7 -13
  140. package/dist/utils/query-keys.js +12 -18
  141. package/dist/utils/source-archive-policy.d.ts +2 -0
  142. package/dist/utils/source-archive-policy.js +2 -0
  143. package/dist/utils/space-config.d.ts +5 -1
  144. package/dist/utils/space-config.js +35 -0
  145. package/dist/utils/static-runtime-policy.d.ts +5 -0
  146. package/dist/utils/static-runtime-policy.fixtures.json +57 -0
  147. package/dist/utils/static-runtime-policy.js +54 -10
  148. package/dist/utils/upload-session.d.ts +3 -0
  149. package/dist/utils/upload-session.js +31 -0
  150. package/package.json +6 -4
  151. package/dist/contracts/annotations.d.ts +0 -327
  152. package/dist/contracts/annotations.js +0 -235
  153. package/dist/contracts/generated-feature-launch-entries.d.ts +0 -2
  154. package/dist/contracts/generated-feature-launch-entries.js +0 -518
  155. package/dist/contracts/publishes.d.ts +0 -135
  156. package/dist/contracts/publishes.js +0 -162
  157. package/dist/utils/access-match.d.ts +0 -39
  158. package/dist/utils/access-match.js +0 -296
  159. package/dist/utils/sf-config-v1.d.ts +0 -2
  160. package/dist/utils/sf-config-v1.js +0 -542
@@ -1,30 +1,96 @@
1
1
  import { z } from "zod";
2
+ import { accessRoleSchema } from "./access.js";
2
3
  import { CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
3
- export const collaborationModeSchema = z.enum(["review"]);
4
4
  export const commentThreadStatusSchema = z.enum(["open", "archived"]);
5
- // The space access levels capability follows (SPACEFAST-CAST-PLAN D-2). Invited
6
- // reviewers are space invitees with one of these levels; the on-page overlay and
7
- // inbox re-evaluate the effective level server-side at join — this is only the
8
- // stored grant the dashboard manages.
9
- export const collaborationReviewerLevelSchema = z.enum(["viewer", "commenter", "editor"]);
10
- // An invited reviewer: a person (by email) granted a level on the space's review
11
- // surface. Kept in settingsJson so adding/removing reviewers never requires a
12
- // republish (read from the ETag'd overlay-config, SPACEFAST-CAST-PLAN §4.2).
13
- export const collaborationInvitedReviewerSchema = z.object({
14
- email: z.string().email(),
15
- level: collaborationReviewerLevelSchema,
5
+ export const COMMENT_SEARCH_QUERY_MAX_LENGTH = 160;
6
+ export function normalizeCommentSearchQuery(value) {
7
+ const trimmed = value?.trim();
8
+ return trimmed ? trimmed.slice(0, COMMENT_SEARCH_QUERY_MAX_LENGTH) : undefined;
9
+ }
10
+ export const COMMENT_PAGE_PATH_MAX_LENGTH = 2_048;
11
+ const COMMENT_CAPABILITIES = ["page.view", "comments.read", "comments.write"];
12
+ export const commentCapabilitiesSchema = z
13
+ .array(z.enum(COMMENT_CAPABILITIES))
14
+ .min(2)
15
+ .max(3)
16
+ .refine((capabilities) => new Set(capabilities).size === capabilities.length, {
17
+ message: "comment capabilities must be unique",
18
+ })
19
+ .superRefine((capabilities, context) => {
20
+ if (capabilities.includes("comments.write") && !capabilities.includes("comments.read")) {
21
+ context.addIssue({
22
+ code: "custom",
23
+ message: "comments.write requires comments.read",
24
+ });
25
+ }
26
+ if (capabilities.includes("comments.read") && !capabilities.includes("page.view")) {
27
+ context.addIssue({
28
+ code: "custom",
29
+ message: "comments.read requires page.view",
30
+ });
31
+ }
32
+ });
33
+ export const collaborationGuestProjectionSchema = z.object({
34
+ anonymousId: z.string().min(8).max(160),
35
+ name: z.string().trim().min(1).max(160),
36
+ namedByUser: z.boolean(),
37
+ grantId: z.string().min(1).max(128),
38
+ admittedBy: z.union([
39
+ z.literal("anyone"),
40
+ z.templateLiteral(["link:", z.string().regex(/^[A-Za-z0-9_.-]+$/)]),
41
+ z.templateLiteral(["password:", z.string().regex(/^[A-Za-z0-9_.-]+$/)]),
42
+ ]),
43
+ emailVerified: z.boolean().default(false),
44
+ capabilities: commentCapabilitiesSchema,
45
+ });
46
+ export const collaborationTicketClaimsSchema = z
47
+ .object({
48
+ sub: z.string().min(1),
49
+ email: z.string().email().optional(),
50
+ role: accessRoleSchema,
51
+ actorKind: z.enum(["user", "guest"]),
52
+ capabilities: commentCapabilitiesSchema,
53
+ anonymousId: z.string().min(8).max(160).optional(),
54
+ namedByUser: z.boolean().optional(),
55
+ admittedBy: z
56
+ .union([
57
+ z.literal("anyone"),
58
+ z.templateLiteral(["link:", z.string().regex(/^[A-Za-z0-9_.-]+$/)]),
59
+ z.templateLiteral(["password:", z.string().regex(/^[A-Za-z0-9_.-]+$/)]),
60
+ ])
61
+ .optional(),
62
+ emailVerified: z.boolean().optional(),
63
+ room: z.string().min(1).max(4_096),
64
+ scope: z.string().min(1).max(COMMENT_PAGE_PATH_MAX_LENGTH),
65
+ surface: z.enum(["published", "preview"]),
66
+ nonce: z.string().min(1).max(160),
67
+ iat: z.number().int(),
68
+ nbf: z.number().int(),
69
+ exp: z.number().int(),
70
+ iss: z.literal("spacefast-api"),
71
+ aud: z.string().min(1),
72
+ })
73
+ .superRefine((claims, context) => {
74
+ if (claims.actorKind !== "guest")
75
+ return;
76
+ for (const field of ["anonymousId", "namedByUser", "admittedBy", "emailVerified"]) {
77
+ if (claims[field] === undefined) {
78
+ context.addIssue({
79
+ code: "custom",
80
+ path: [field],
81
+ message: `${field} is required for a guest ticket`,
82
+ });
83
+ }
84
+ }
16
85
  });
17
86
  export const collaborationSettingsSchema = z
18
87
  .object({
19
- anonymousReviewers: z.boolean().optional(),
20
- publishedAnonymousCommenters: z.boolean().optional(),
21
- invitedReviewers: z.array(collaborationInvitedReviewerSchema).optional(),
88
+ spamFilterEnabled: z.boolean().optional(),
22
89
  // Whether comments are surfaced on the live/published host (vs preview-only).
23
90
  // The published loader (SPACEFAST-CAST-PLAN §4.2) mounts the orb on a live
24
91
  // host only when this is true; toggling it never requires a republish — the
25
92
  // always-injected inert tag reads behavior from the ETag'd overlay-config.
26
93
  publishedComments: z.boolean().optional(),
27
- allowedOrigins: z.array(z.string().min(1)).optional(),
28
94
  notificationPreferences: z
29
95
  .object({
30
96
  newThreads: z.boolean().default(true),
@@ -34,11 +100,10 @@ export const collaborationSettingsSchema = z
34
100
  .partial()
35
101
  .optional(),
36
102
  })
37
- .catchall(z.unknown());
103
+ .strict();
38
104
  export const collaborationSchema = z.object({
39
105
  spaceId: z.string(),
40
106
  enabled: z.boolean(),
41
- mode: collaborationModeSchema,
42
107
  castResourceId: z.string().nullable(),
43
108
  castResourceKey: z.string().nullable(),
44
109
  settings: collaborationSettingsSchema,
@@ -47,34 +112,22 @@ export const collaborationSchema = z.object({
47
112
  });
48
113
  export const collaborationUpdateSchema = z.object({
49
114
  enabled: z.boolean(),
50
- mode: collaborationModeSchema.optional(),
51
115
  settings: collaborationSettingsSchema.optional(),
52
116
  });
53
- export const collaborationTokenRequestSchema = z.object({
117
+ export const commentsTicketRequestSchema = z.object({
118
+ spaceId: z.string().min(1),
119
+ pagePath: z.string().min(1).max(COMMENT_PAGE_PATH_MAX_LENGTH).default("/"),
120
+ origin: z.string().url(),
54
121
  versionId: z.string().min(1).optional(),
55
- pagePath: z.string().min(1).default("/"),
56
- displayName: z.string().min(1).max(120).optional(),
57
122
  });
58
- export const collaborationTokenResponseSchema = z.object({
123
+ export const commentsTicketResponseSchema = z.object({
59
124
  token: z.string(),
60
125
  expiresAt: z.string().datetime(),
61
126
  cast: z.object({
62
127
  resource: z.string(),
63
- room: z.string().nullable(),
128
+ room: z.string(),
64
129
  }),
65
130
  });
66
- export const collaborationHandoffRequestSchema = z.object({
67
- versionId: z.string().min(1),
68
- pagePath: z.string().min(1).default("/"),
69
- });
70
- export const collaborationHandoffResponseSchema = z.object({
71
- handoffToken: z.string(),
72
- expiresAt: z.string().datetime(),
73
- url: z.string().url().nullable(),
74
- });
75
- export const collaborationHandoffExchangeSchema = z.object({
76
- handoffToken: z.string().min(16),
77
- });
78
131
  export const realtimeTokenRequestSchema = z.object({
79
132
  versionId: z.string().optional(),
80
133
  scope: z.enum(["space", "version"]).default("space"),
@@ -85,7 +138,6 @@ export const realtimeTokenResponseSchema = z.object({
85
138
  cast: z.object({
86
139
  resource: z.string(),
87
140
  room: z.string(),
88
- loaderUrl: z.string().url(),
89
141
  }),
90
142
  });
91
143
  export const noticePublishSchema = z.object({
@@ -104,38 +156,33 @@ export const noticePublishResponseSchema = z.object({
104
156
  broadcast: z.record(z.string(), z.unknown()).nullable(),
105
157
  });
106
158
  export const collabOverlayConfigQuerySchema = z.object({
107
- path: z.string().min(1).optional(),
159
+ path: z.string().min(1).max(COMMENT_PAGE_PATH_MAX_LENGTH).optional(),
108
160
  versionId: z.string().min(1).optional(),
109
161
  host: z.string().min(1).optional(),
110
162
  });
111
- // Snake case is intentional: the injected Collab SDK consumes this alongside
112
- // Cast's snake-case join payload without a remapping layer.
163
+ // Customer pages receive launcher state only. Room ids, Cast endpoints, resource
164
+ // keys, tickets, and platform session state never cross the customer-origin
165
+ // boundary.
113
166
  export const collabOverlayConfigSchema = z.object({
114
167
  enabled: z.boolean(),
115
- anonymous_commenters: z.boolean(),
116
- resource_key: z.string().nullable(),
117
- room_key: z.string().nullable(),
118
- version: z.object({
119
- id: z.string().nullable(),
120
- current: z.string().nullable(),
121
- }),
122
- ws_url: z.string().nullable(),
123
- endpoints: z.object({
124
- token: z.string().url(),
125
- handoff_exchange: z.string().url(),
126
- auth_bridge: z.string().url(),
127
- screenshots: z.string().url(),
128
- }),
129
- features: z.object({
130
- drawing: z.boolean(),
131
- capture: z.boolean(),
132
- notices: z.boolean(),
133
- }),
168
+ surface_url: z.string().url().nullable(),
169
+ });
170
+ // Cross-version navigation directory: the platform Comments page asks for the
171
+ // immutable URLs of version ids present in a room's threads.
172
+ export const COLLAB_VERSION_URLS_MAX_IDS = 50;
173
+ export const collabVersionUrlSchema = z.object({
174
+ id: z.string(),
175
+ url: z.string(),
176
+ // number/createdAt let clients order versions by real recency instead of
177
+ // comparing opaque ids.
178
+ number: z.number().int().nullable(),
179
+ createdAt: z.string().nullable(),
134
180
  });
135
181
  export const commentAuthorSchema = z.object({
136
182
  kind: z.string().nullable(),
137
183
  id: z.string().nullable(),
138
184
  name: z.string().nullable(),
185
+ color: z.string().max(64).nullable(),
139
186
  });
140
187
  export const commentTargetSchema = z.record(z.string(), z.unknown()).nullable();
141
188
  export const commentThreadSchema = z.object({
@@ -144,9 +191,11 @@ export const commentThreadSchema = z.object({
144
191
  spaceId: z.string(),
145
192
  versionId: z.string().nullable(),
146
193
  channel: z.string().nullable(),
147
- pagePath: z.string(),
194
+ pagePath: z.string().max(COMMENT_PAGE_PATH_MAX_LENGTH),
148
195
  url: z.string().nullable(),
149
196
  status: commentThreadStatusSchema,
197
+ moderationState: z.enum(["clear", "spam"]),
198
+ heldCommentIds: z.array(z.string()),
150
199
  unread: z.boolean(),
151
200
  unreadCount: z.number().int().min(0),
152
201
  body: z.string().nullable(),
@@ -159,17 +208,26 @@ export const commentThreadSchema = z.object({
159
208
  export const commentListQuerySchema = cursorListQuerySchema.extend({
160
209
  versionId: z.string().optional(),
161
210
  status: commentThreadStatusSchema.optional(),
162
- pagePath: z.string().optional(),
211
+ filter: z.enum(["open", "archived", "spam"]).optional(),
212
+ pagePath: z.string().max(COMMENT_PAGE_PATH_MAX_LENGTH).optional(),
213
+ q: z.string().trim().max(COMMENT_SEARCH_QUERY_MAX_LENGTH).optional(),
214
+ author: z.string().trim().max(160).optional(),
215
+ unread: z.stringbool().optional(),
163
216
  });
217
+ export const commentSpamFeedbackSchema = z
218
+ .object({
219
+ commentId: z.string().min(1).optional(),
220
+ })
221
+ .default({});
164
222
  export const commentCreateSchema = z.object({
165
- pagePath: z.string().min(1).default("/"),
223
+ pagePath: z.string().min(1).max(COMMENT_PAGE_PATH_MAX_LENGTH).default("/"),
166
224
  body: z.string().min(1).max(16_000),
167
225
  target: commentTargetSchema.optional(),
168
226
  idempotencyKey: z.string().min(1).max(320).optional(),
169
227
  });
170
228
  export const commentScreenshotCreateSchema = z.object({
171
229
  versionId: z.string().min(1),
172
- pagePath: z.string().min(1).default("/"),
230
+ pagePath: z.string().min(1).max(COMMENT_PAGE_PATH_MAX_LENGTH).default("/"),
173
231
  contentType: z.enum(["image/png", "image/jpeg", "image/webp"]),
174
232
  contentBase64: z.string().min(1),
175
233
  });
@@ -9,8 +9,8 @@ export declare const baseDiagnosticSchema: z.ZodObject<{
9
9
  code: z.ZodString;
10
10
  severity: z.ZodEnum<{
11
11
  info: "info";
12
- warning: "warning";
13
12
  error: "error";
13
+ warning: "warning";
14
14
  }>;
15
15
  message: z.ZodString;
16
16
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -131,6 +131,7 @@ export declare const CursorPaginationSchema: z.ZodObject<{
131
131
  nextCursor: z.ZodNullable<z.ZodString>;
132
132
  hasMore: z.ZodBoolean;
133
133
  }, z.core.$strip>;
134
+ export declare const CURSOR_MAX_LENGTH = 4096;
134
135
  export declare const cursorListQuerySchema: z.ZodObject<{
135
136
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
136
137
  cursor: z.ZodOptional<z.ZodString>;
@@ -175,8 +176,8 @@ export declare const AsyncOperationSchema: z.ZodObject<{
175
176
  code: z.ZodString;
176
177
  severity: z.ZodEnum<{
177
178
  info: "info";
178
- warning: "warning";
179
179
  error: "error";
180
+ warning: "warning";
180
181
  }>;
181
182
  message: z.ZodString;
182
183
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -219,8 +220,8 @@ export declare function mutationEnvelope<T extends z.ZodType>(data: T): z.ZodObj
219
220
  code: z.ZodString;
220
221
  severity: z.ZodEnum<{
221
222
  info: "info";
222
- warning: "warning";
223
223
  error: "error";
224
+ warning: "warning";
224
225
  }>;
225
226
  message: z.ZodString;
226
227
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -117,6 +117,7 @@ export const CursorPaginationSchema = z.object({
117
117
  .describe("Opaque cursor for the next page; pass as `?cursor=`. Null on the last page."),
118
118
  hasMore: z.boolean().describe("Whether another page exists after this one."),
119
119
  });
120
+ export const CURSOR_MAX_LENGTH = 4_096;
120
121
  // The ONE list query shape (default 20, max 100, opaque cursor, newest-first). Extend with
121
122
  // module-specific filters; never redeclare `limit`/`cursor`.
122
123
  export const cursorListQuerySchema = z.object({
@@ -130,6 +131,7 @@ export const cursorListQuerySchema = z.object({
130
131
  cursor: z
131
132
  .string()
132
133
  .min(1)
134
+ .max(CURSOR_MAX_LENGTH)
133
135
  .optional()
134
136
  .describe("Opaque cursor from a previous page's `pagination.nextCursor`."),
135
137
  });
@@ -1,10 +1,5 @@
1
- // ISO 3166-1 alpha-2 country codes the vocabulary of the firewall card's
2
- // country section (contracts/access.ts `firewallCountriesSchema`, access-plan
3
- // §5.6). The rule `match.country` is an exact-equality matcher against the
4
- // edge-supplied country header, so "allow only these countries" compiles to
5
- // one deny/challenge rule per code in the COMPLEMENT of this list — which is
6
- // why the list itself is a contract: the compiler and the projection must
7
- // agree on the universe.
1
+ // ISO 3166-1 alpha-2 country codes used by Grant network constraints. The
2
+ // runtime compares them with the edge-supplied country header.
8
3
  //
9
4
  // Officially assigned codes only (no exceptionally-reserved / user-assigned
10
5
  // ranges). Display names are a UI concern (`Intl.DisplayNames`), never stored.
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ export declare const dataSourceListItemSchema: z.ZodObject<{
3
+ kind: z.ZodLiteral<"wordpress">;
4
+ url: z.ZodString;
5
+ name: z.ZodString;
6
+ default: z.ZodBoolean;
7
+ }, z.core.$strict>;
8
+ export type DataSourceListItem = z.infer<typeof dataSourceListItemSchema>;
9
+ export declare const dataSourceListResponseSchema: z.ZodObject<{
10
+ data: z.ZodObject<{
11
+ dataSources: z.ZodArray<z.ZodObject<{
12
+ kind: z.ZodLiteral<"wordpress">;
13
+ url: z.ZodString;
14
+ name: z.ZodString;
15
+ default: z.ZodBoolean;
16
+ }, z.core.$strict>>;
17
+ defaultDataSource: z.ZodNullable<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ }, z.core.$strip>;
20
+ export type DataSourceListResponse = z.infer<typeof dataSourceListResponseSchema>;
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ import { dataEnvelope } from "./common.js";
3
+ import { dataSourceNameSchema, wordpressDataSourceSchema } from "./space-config.js";
4
+ export const dataSourceListItemSchema = wordpressDataSourceSchema
5
+ .extend({
6
+ name: dataSourceNameSchema,
7
+ default: z.boolean().describe("True for the effective default source."),
8
+ })
9
+ .strict();
10
+ export const dataSourceListResponseSchema = dataEnvelope(z.object({
11
+ dataSources: z.array(dataSourceListItemSchema),
12
+ defaultDataSource: dataSourceNameSchema
13
+ .nullable()
14
+ .describe("Configured default source, or the first source in bytewise name order; null when no sources are configured."),
15
+ }));
@@ -217,8 +217,8 @@ export declare const DeploymentSchema: z.ZodObject<{
217
217
  code: z.ZodString;
218
218
  severity: z.ZodEnum<{
219
219
  info: "info";
220
- warning: "warning";
221
220
  error: "error";
221
+ warning: "warning";
222
222
  }>;
223
223
  message: z.ZodString;
224
224
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -381,8 +381,8 @@ export declare const deploymentListResponseSchema: z.ZodObject<{
381
381
  code: z.ZodString;
382
382
  severity: z.ZodEnum<{
383
383
  info: "info";
384
- warning: "warning";
385
384
  error: "error";
385
+ warning: "warning";
386
386
  }>;
387
387
  message: z.ZodString;
388
388
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -546,8 +546,8 @@ export declare const deploymentGetResponseSchema: z.ZodObject<{
546
546
  code: z.ZodString;
547
547
  severity: z.ZodEnum<{
548
548
  info: "info";
549
- warning: "warning";
550
549
  error: "error";
550
+ warning: "warning";
551
551
  }>;
552
552
  message: z.ZodString;
553
553
  path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -75,15 +75,20 @@ export declare const DeviceAuthorizationPollResponseSchema: z.ZodObject<{
75
75
  deny: "deny";
76
76
  }>;
77
77
  actions: z.ZodArray<z.ZodEnum<{
78
+ "teams:read": "teams:read";
79
+ "teams:create": "teams:create";
80
+ "spaces:read": "spaces:read";
81
+ "spaces:write": "spaces:write";
82
+ "spaces:rename": "spaces:rename";
83
+ "domains:read": "domains:read";
84
+ "mcp:tools": "mcp:tools";
78
85
  "*": "*";
79
86
  "sites:read": "sites:read";
80
87
  "sites:create": "sites:create";
81
88
  "sites:write": "sites:write";
82
89
  "sites:delete": "sites:delete";
83
90
  "sites:policy.write": "sites:policy.write";
84
- "spaces:read": "spaces:read";
85
91
  "spaces:create": "spaces:create";
86
- "spaces:write": "spaces:write";
87
92
  "spaces:delete": "spaces:delete";
88
93
  "spaces:publish": "spaces:publish";
89
94
  "spaces:transfer": "spaces:transfer";
@@ -93,7 +98,6 @@ export declare const DeviceAuthorizationPollResponseSchema: z.ZodObject<{
93
98
  "versions:promote": "versions:promote";
94
99
  "versions:delete": "versions:delete";
95
100
  "versions:download": "versions:download";
96
- "domains:read": "domains:read";
97
101
  "domains:create": "domains:create";
98
102
  "domains:verify": "domains:verify";
99
103
  "domains:assign": "domains:assign";
@@ -105,8 +109,8 @@ export declare const DeviceAuthorizationPollResponseSchema: z.ZodObject<{
105
109
  "webhooks:read": "webhooks:read";
106
110
  "webhooks:write": "webhooks:write";
107
111
  "builds:read": "builds:read";
112
+ "builds:trigger": "builds:trigger";
108
113
  "builds:create": "builds:create";
109
- "teams:read": "teams:read";
110
114
  "teams:write": "teams:write";
111
115
  "teams:members.write": "teams:members.write";
112
116
  "billing:read": "billing:read";
@@ -114,7 +118,6 @@ export declare const DeviceAuthorizationPollResponseSchema: z.ZodObject<{
114
118
  "tokens:read": "tokens:read";
115
119
  "tokens:create": "tokens:create";
116
120
  "tokens:revoke": "tokens:revoke";
117
- "mcp:tools": "mcp:tools";
118
121
  "runtime:manage": "runtime:manage";
119
122
  }>>;
120
123
  resources: z.ZodArray<z.ZodString>;
@@ -122,8 +125,8 @@ export declare const DeviceAuthorizationPollResponseSchema: z.ZodObject<{
122
125
  "request.client": z.ZodOptional<z.ZodEnum<{
123
126
  api: "api";
124
127
  dashboard: "dashboard";
125
- cli: "cli";
126
128
  worker: "worker";
129
+ cli: "cli";
127
130
  }>>;
128
131
  }, z.core.$strict>>;
129
132
  }, z.core.$strict>>;
@@ -267,15 +270,20 @@ export declare const AgentHandoffRedeemResponseSchema: z.ZodObject<{
267
270
  deny: "deny";
268
271
  }>;
269
272
  actions: z.ZodArray<z.ZodEnum<{
273
+ "teams:read": "teams:read";
274
+ "teams:create": "teams:create";
275
+ "spaces:read": "spaces:read";
276
+ "spaces:write": "spaces:write";
277
+ "spaces:rename": "spaces:rename";
278
+ "domains:read": "domains:read";
279
+ "mcp:tools": "mcp:tools";
270
280
  "*": "*";
271
281
  "sites:read": "sites:read";
272
282
  "sites:create": "sites:create";
273
283
  "sites:write": "sites:write";
274
284
  "sites:delete": "sites:delete";
275
285
  "sites:policy.write": "sites:policy.write";
276
- "spaces:read": "spaces:read";
277
286
  "spaces:create": "spaces:create";
278
- "spaces:write": "spaces:write";
279
287
  "spaces:delete": "spaces:delete";
280
288
  "spaces:publish": "spaces:publish";
281
289
  "spaces:transfer": "spaces:transfer";
@@ -285,7 +293,6 @@ export declare const AgentHandoffRedeemResponseSchema: z.ZodObject<{
285
293
  "versions:promote": "versions:promote";
286
294
  "versions:delete": "versions:delete";
287
295
  "versions:download": "versions:download";
288
- "domains:read": "domains:read";
289
296
  "domains:create": "domains:create";
290
297
  "domains:verify": "domains:verify";
291
298
  "domains:assign": "domains:assign";
@@ -297,8 +304,8 @@ export declare const AgentHandoffRedeemResponseSchema: z.ZodObject<{
297
304
  "webhooks:read": "webhooks:read";
298
305
  "webhooks:write": "webhooks:write";
299
306
  "builds:read": "builds:read";
307
+ "builds:trigger": "builds:trigger";
300
308
  "builds:create": "builds:create";
301
- "teams:read": "teams:read";
302
309
  "teams:write": "teams:write";
303
310
  "teams:members.write": "teams:members.write";
304
311
  "billing:read": "billing:read";
@@ -306,7 +313,6 @@ export declare const AgentHandoffRedeemResponseSchema: z.ZodObject<{
306
313
  "tokens:read": "tokens:read";
307
314
  "tokens:create": "tokens:create";
308
315
  "tokens:revoke": "tokens:revoke";
309
- "mcp:tools": "mcp:tools";
310
316
  "runtime:manage": "runtime:manage";
311
317
  }>>;
312
318
  resources: z.ZodArray<z.ZodString>;
@@ -314,8 +320,8 @@ export declare const AgentHandoffRedeemResponseSchema: z.ZodObject<{
314
320
  "request.client": z.ZodOptional<z.ZodEnum<{
315
321
  api: "api";
316
322
  dashboard: "dashboard";
317
- cli: "cli";
318
323
  worker: "worker";
324
+ cli: "cli";
319
325
  }>>;
320
326
  }, z.core.$strict>>;
321
327
  }, z.core.$strict>>;
@@ -351,8 +357,8 @@ export declare const AgentHandoffListQuerySchema: z.ZodObject<{
351
357
  }, z.core.$strip>;
352
358
  export type AgentHandoffListQuery = z.infer<typeof AgentHandoffListQuerySchema>;
353
359
  export declare const AgentHandoffStatusSchema: z.ZodEnum<{
354
- pending: "pending";
355
360
  revoked: "revoked";
361
+ pending: "pending";
356
362
  redeemed: "redeemed";
357
363
  }>;
358
364
  export declare const AgentHandoffSummarySchema: z.ZodObject<{
@@ -366,8 +372,8 @@ export declare const AgentHandoffSummarySchema: z.ZodObject<{
366
372
  codex: "codex";
367
373
  }>;
368
374
  status: z.ZodEnum<{
369
- pending: "pending";
370
375
  revoked: "revoked";
376
+ pending: "pending";
371
377
  redeemed: "redeemed";
372
378
  }>;
373
379
  createdAt: z.ZodString;
@@ -387,8 +393,8 @@ export declare const AgentHandoffListResponseSchema: z.ZodArray<z.ZodObject<{
387
393
  codex: "codex";
388
394
  }>;
389
395
  status: z.ZodEnum<{
390
- pending: "pending";
391
396
  revoked: "revoked";
397
+ pending: "pending";
392
398
  redeemed: "redeemed";
393
399
  }>;
394
400
  createdAt: z.ZodString;
@@ -11,8 +11,8 @@ export declare const docsIndexQuerySchema: z.ZodObject<{
11
11
  category: z.ZodOptional<z.ZodEnum<{
12
12
  api: "api";
13
13
  guide: "guide";
14
- cli: "cli";
15
14
  error: "error";
15
+ cli: "cli";
16
16
  recipe: "recipe";
17
17
  workflow: "workflow";
18
18
  }>>;
@@ -30,8 +30,8 @@ export declare const DocsEntrySchema: z.ZodObject<{
30
30
  category: z.ZodEnum<{
31
31
  api: "api";
32
32
  guide: "guide";
33
- cli: "cli";
34
33
  error: "error";
34
+ cli: "cli";
35
35
  recipe: "recipe";
36
36
  workflow: "workflow";
37
37
  }>;
@@ -56,8 +56,8 @@ export declare const DocsDocSchema: z.ZodObject<{
56
56
  category: z.ZodEnum<{
57
57
  api: "api";
58
58
  guide: "guide";
59
- cli: "cli";
60
59
  error: "error";
60
+ cli: "cli";
61
61
  recipe: "recipe";
62
62
  workflow: "workflow";
63
63
  }>;
@@ -86,8 +86,8 @@ export declare const DocsIndexResponseSchema: z.ZodObject<{
86
86
  category: z.ZodNullable<z.ZodEnum<{
87
87
  api: "api";
88
88
  guide: "guide";
89
- cli: "cli";
90
89
  error: "error";
90
+ cli: "cli";
91
91
  recipe: "recipe";
92
92
  workflow: "workflow";
93
93
  }>>;
@@ -99,8 +99,8 @@ export declare const DocsIndexResponseSchema: z.ZodObject<{
99
99
  category: z.ZodEnum<{
100
100
  api: "api";
101
101
  guide: "guide";
102
- cli: "cli";
103
102
  error: "error";
103
+ cli: "cli";
104
104
  recipe: "recipe";
105
105
  workflow: "workflow";
106
106
  }>;