@spacefast/common 0.0.10 → 0.0.12

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 (122) 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 +42 -24
  12. package/dist/contracts/access.js +73 -34
  13. package/dist/contracts/activity.d.ts +1 -1
  14. package/dist/contracts/activity.js +5 -5
  15. package/dist/contracts/api-keys.d.ts +53 -45
  16. package/dist/contracts/api-keys.js +1 -0
  17. package/dist/contracts/archives.d.ts +8 -8
  18. package/dist/contracts/builds.d.ts +8 -8
  19. package/dist/contracts/builds.js +28 -48
  20. package/dist/contracts/channels.js +1 -2
  21. package/dist/contracts/comments.d.ts +55 -19
  22. package/dist/contracts/comments.js +56 -17
  23. package/dist/contracts/common.d.ts +4 -3
  24. package/dist/contracts/common.js +2 -0
  25. package/dist/contracts/deployments.d.ts +3 -3
  26. package/dist/contracts/device-auth.d.ts +14 -12
  27. package/dist/contracts/docs.d.ts +5 -5
  28. package/dist/contracts/domains.d.ts +261 -1330
  29. package/dist/contracts/domains.js +39 -301
  30. package/dist/contracts/email-preferences.d.ts +50 -0
  31. package/dist/contracts/email-preferences.js +44 -0
  32. package/dist/contracts/enums.d.ts +1 -1
  33. package/dist/contracts/error-code-meta.d.ts +84 -15
  34. package/dist/contracts/error-code-meta.js +28 -4
  35. package/dist/contracts/error-codes.d.ts +1 -1
  36. package/dist/contracts/error-codes.js +24 -6
  37. package/dist/contracts/events.d.ts +13 -13
  38. package/dist/contracts/feature-lifecycle.d.ts +644 -2
  39. package/dist/contracts/feature-lifecycle.js +685 -2
  40. package/dist/contracts/features.d.ts +236 -24
  41. package/dist/contracts/features.js +3 -272
  42. package/dist/contracts/ids.d.ts +1 -2
  43. package/dist/contracts/ids.js +1 -2
  44. package/dist/contracts/internal.d.ts +3 -3
  45. package/dist/contracts/mcp.d.ts +6 -6
  46. package/dist/contracts/me.js +1 -1
  47. package/dist/contracts/mounts.d.ts +142 -0
  48. package/dist/contracts/mounts.js +56 -0
  49. package/dist/contracts/oauth-resources.d.ts +5 -5
  50. package/dist/contracts/oauth-resources.js +1 -0
  51. package/dist/contracts/operations.d.ts +2 -2
  52. package/dist/contracts/pages.d.ts +2 -2
  53. package/dist/contracts/pages.js +8 -3
  54. package/dist/contracts/plan-policy.d.ts +1 -1
  55. package/dist/contracts/platform.d.ts +3 -3
  56. package/dist/contracts/resources.d.ts +12 -20
  57. package/dist/contracts/resources.js +13 -37
  58. package/dist/contracts/runtime-api.d.ts +330 -16
  59. package/dist/contracts/runtime-api.js +58 -14
  60. package/dist/contracts/sf-config-v1.js +1 -1
  61. package/dist/contracts/sites.d.ts +12 -12
  62. package/dist/contracts/sites.js +18 -11
  63. package/dist/contracts/space-config.d.ts +2 -3
  64. package/dist/contracts/space-config.js +3 -1
  65. package/dist/contracts/spaces.d.ts +143 -102
  66. package/dist/contracts/spaces.js +109 -43
  67. package/dist/contracts/superadmin-emails.d.ts +25 -1
  68. package/dist/contracts/superadmin-emails.js +10 -15
  69. package/dist/contracts/superadmin-runtime.d.ts +2 -2
  70. package/dist/contracts/superadmin-spaces.d.ts +6 -14
  71. package/dist/contracts/tags.d.ts +43 -13
  72. package/dist/contracts/tags.js +195 -11
  73. package/dist/contracts/transfers.d.ts +1 -1
  74. package/dist/contracts/variables.d.ts +4 -4
  75. package/dist/contracts/variables.js +4 -3
  76. package/dist/contracts/webhooks.d.ts +2 -2
  77. package/dist/contracts/zero.d.ts +329 -7
  78. package/dist/contracts/zero.js +121 -2
  79. package/dist/dashboard-paths/index.d.ts +1 -1
  80. package/dist/docs/agent-setup.d.ts +4 -2
  81. package/dist/docs/agent-setup.js +15 -7
  82. package/dist/docs/agent-solutions.js +1 -1
  83. package/dist/docs/catalog.d.ts +8 -10
  84. package/dist/docs/catalog.js +8 -10
  85. package/dist/docs/error-docs.js +86 -18
  86. package/dist/utils/access-grant.d.ts +14 -0
  87. package/dist/utils/access-grant.js +88 -0
  88. package/dist/utils/access-match.d.ts +7 -0
  89. package/dist/utils/access-match.fixtures.json +513 -0
  90. package/dist/utils/access-match.js +32 -16
  91. package/dist/utils/access-verdict.fixtures.json +421 -0
  92. package/dist/utils/credential-policy.d.ts +1 -1
  93. package/dist/utils/dns-instructions.d.ts +29 -0
  94. package/dist/utils/dns-instructions.js +78 -0
  95. package/dist/utils/domain-diagnostics.d.ts +29 -0
  96. package/dist/utils/domain-diagnostics.js +63 -0
  97. package/dist/utils/egress-policy.fixtures.json +51 -0
  98. package/dist/utils/id-hints.d.ts +1 -0
  99. package/dist/utils/id-hints.js +55 -13
  100. package/dist/utils/page-colors.d.ts +50 -0
  101. package/dist/utils/page-colors.js +167 -0
  102. package/dist/utils/page-fonts.d.ts +2 -0
  103. package/dist/utils/page-fonts.js +4 -0
  104. package/dist/utils/pages.d.ts +8 -1
  105. package/dist/utils/pages.js +123 -37
  106. package/dist/utils/production-runtime.d.ts +18 -0
  107. package/dist/utils/production-runtime.js +28 -0
  108. package/dist/utils/query-keys.d.ts +6 -7
  109. package/dist/utils/query-keys.js +11 -12
  110. package/dist/utils/sf-config-v1.fixtures.json +9 -0
  111. package/dist/utils/sf-config-v1.js +28 -19
  112. package/dist/utils/source-archive-policy.d.ts +2 -0
  113. package/dist/utils/source-archive-policy.js +2 -0
  114. package/dist/utils/static-runtime-policy.fixtures.json +57 -0
  115. package/dist/utils/static-runtime-policy.js +1 -1
  116. package/package.json +5 -4
  117. package/dist/contracts/annotations.d.ts +0 -327
  118. package/dist/contracts/annotations.js +0 -235
  119. package/dist/contracts/generated-feature-launch-entries.d.ts +0 -2
  120. package/dist/contracts/generated-feature-launch-entries.js +0 -518
  121. package/dist/contracts/publishes.d.ts +0 -135
  122. package/dist/contracts/publishes.js +0 -162
@@ -4,8 +4,7 @@ import { z } from "zod";
4
4
  // activity log. No writes, no new storage — promotion stays owned by the
5
5
  // publish/version lifecycle. Additive only.
6
6
  // One row of the channel list: where each named channel points right now.
7
- // `currentVersionId` is the live pointer (`channels.versionId`); weighted
8
- // pointers are not surfaced here yet (live-only at launch).
7
+ // `currentVersionId` is the channel's version pointer (`channels.versionId`).
9
8
  export const channelListItemSchema = z.object({
10
9
  name: z.string().describe("Channel name; `live` is the default channel."),
11
10
  currentVersionId: z
@@ -1,16 +1,16 @@
1
1
  import { z } from "zod";
2
- export declare const collaborationModeSchema: z.ZodEnum<{
3
- review: "review";
4
- }>;
5
2
  export declare const commentThreadStatusSchema: z.ZodEnum<{
6
3
  open: "open";
7
4
  archived: "archived";
8
5
  }>;
6
+ export declare const COMMENT_SEARCH_QUERY_MAX_LENGTH = 160;
7
+ export declare function normalizeCommentSearchQuery(value: string | undefined): string | undefined;
9
8
  export declare const collaborationReviewerLevelSchema: z.ZodEnum<{
10
9
  viewer: "viewer";
11
10
  commenter: "commenter";
12
11
  editor: "editor";
13
12
  }>;
13
+ export declare const COMMENT_PAGE_PATH_MAX_LENGTH = 2048;
14
14
  export declare const collaborationInvitedReviewerSchema: z.ZodObject<{
15
15
  email: z.ZodString;
16
16
  level: z.ZodEnum<{
@@ -22,6 +22,7 @@ export declare const collaborationInvitedReviewerSchema: z.ZodObject<{
22
22
  export declare const collaborationSettingsSchema: z.ZodObject<{
23
23
  anonymousReviewers: z.ZodOptional<z.ZodBoolean>;
24
24
  publishedAnonymousCommenters: z.ZodOptional<z.ZodBoolean>;
25
+ spamFilterEnabled: z.ZodOptional<z.ZodBoolean>;
25
26
  invitedReviewers: z.ZodOptional<z.ZodArray<z.ZodObject<{
26
27
  email: z.ZodString;
27
28
  level: z.ZodEnum<{
@@ -31,24 +32,21 @@ export declare const collaborationSettingsSchema: z.ZodObject<{
31
32
  }>;
32
33
  }, z.core.$strip>>>;
33
34
  publishedComments: z.ZodOptional<z.ZodBoolean>;
34
- allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
35
35
  notificationPreferences: z.ZodOptional<z.ZodObject<{
36
36
  newThreads: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
37
37
  newReplies: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
38
38
  statusChanges: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
39
39
  }, z.core.$strip>>;
40
- }, z.core.$catchall<z.ZodUnknown>>;
40
+ }, z.core.$strict>;
41
41
  export declare const collaborationSchema: z.ZodObject<{
42
42
  spaceId: z.ZodString;
43
43
  enabled: z.ZodBoolean;
44
- mode: z.ZodEnum<{
45
- review: "review";
46
- }>;
47
44
  castResourceId: z.ZodNullable<z.ZodString>;
48
45
  castResourceKey: z.ZodNullable<z.ZodString>;
49
46
  settings: z.ZodObject<{
50
47
  anonymousReviewers: z.ZodOptional<z.ZodBoolean>;
51
48
  publishedAnonymousCommenters: z.ZodOptional<z.ZodBoolean>;
49
+ spamFilterEnabled: z.ZodOptional<z.ZodBoolean>;
52
50
  invitedReviewers: z.ZodOptional<z.ZodArray<z.ZodObject<{
53
51
  email: z.ZodString;
54
52
  level: z.ZodEnum<{
@@ -58,24 +56,21 @@ export declare const collaborationSchema: z.ZodObject<{
58
56
  }>;
59
57
  }, z.core.$strip>>>;
60
58
  publishedComments: z.ZodOptional<z.ZodBoolean>;
61
- allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
59
  notificationPreferences: z.ZodOptional<z.ZodObject<{
63
60
  newThreads: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
64
61
  newReplies: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
65
62
  statusChanges: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
66
63
  }, z.core.$strip>>;
67
- }, z.core.$catchall<z.ZodUnknown>>;
64
+ }, z.core.$strict>;
68
65
  createdAt: z.ZodNullable<z.ZodString>;
69
66
  updatedAt: z.ZodNullable<z.ZodString>;
70
67
  }, z.core.$strip>;
71
68
  export declare const collaborationUpdateSchema: z.ZodObject<{
72
69
  enabled: z.ZodBoolean;
73
- mode: z.ZodOptional<z.ZodEnum<{
74
- review: "review";
75
- }>>;
76
70
  settings: z.ZodOptional<z.ZodObject<{
77
71
  anonymousReviewers: z.ZodOptional<z.ZodBoolean>;
78
72
  publishedAnonymousCommenters: z.ZodOptional<z.ZodBoolean>;
73
+ spamFilterEnabled: z.ZodOptional<z.ZodBoolean>;
79
74
  invitedReviewers: z.ZodOptional<z.ZodArray<z.ZodObject<{
80
75
  email: z.ZodString;
81
76
  level: z.ZodEnum<{
@@ -85,17 +80,17 @@ export declare const collaborationUpdateSchema: z.ZodObject<{
85
80
  }>;
86
81
  }, z.core.$strip>>>;
87
82
  publishedComments: z.ZodOptional<z.ZodBoolean>;
88
- allowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString>>;
89
83
  notificationPreferences: z.ZodOptional<z.ZodObject<{
90
84
  newThreads: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
91
85
  newReplies: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
92
86
  statusChanges: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
93
87
  }, z.core.$strip>>;
94
- }, z.core.$catchall<z.ZodUnknown>>>;
88
+ }, z.core.$strict>>;
95
89
  }, z.core.$strip>;
96
90
  export declare const collaborationTokenRequestSchema: z.ZodObject<{
97
91
  versionId: z.ZodOptional<z.ZodString>;
98
92
  pagePath: z.ZodDefault<z.ZodString>;
93
+ anonymousId: z.ZodOptional<z.ZodString>;
99
94
  displayName: z.ZodOptional<z.ZodString>;
100
95
  }, z.core.$strip>;
101
96
  export declare const collaborationTokenResponseSchema: z.ZodObject<{
@@ -103,7 +98,7 @@ export declare const collaborationTokenResponseSchema: z.ZodObject<{
103
98
  expiresAt: z.ZodString;
104
99
  cast: z.ZodObject<{
105
100
  resource: z.ZodString;
106
- room: z.ZodNullable<z.ZodString>;
101
+ room: z.ZodString;
107
102
  }, z.core.$strip>;
108
103
  }, z.core.$strip>;
109
104
  export declare const collaborationHandoffRequestSchema: z.ZodObject<{
@@ -131,7 +126,6 @@ export declare const realtimeTokenResponseSchema: z.ZodObject<{
131
126
  cast: z.ZodObject<{
132
127
  resource: z.ZodString;
133
128
  room: z.ZodString;
134
- loaderUrl: z.ZodString;
135
129
  }, z.core.$strip>;
136
130
  }, z.core.$strip>;
137
131
  export declare const noticePublishSchema: z.ZodObject<{
@@ -142,8 +136,8 @@ export declare const noticePublishSchema: z.ZodObject<{
142
136
  level: z.ZodDefault<z.ZodEnum<{
143
137
  info: "info";
144
138
  success: "success";
145
- warning: "warning";
146
139
  error: "error";
140
+ warning: "warning";
147
141
  }>>;
148
142
  payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
149
143
  durable: z.ZodDefault<z.ZodBoolean>;
@@ -167,6 +161,10 @@ export declare const collabOverlayConfigSchema: z.ZodObject<{
167
161
  version: z.ZodObject<{
168
162
  id: z.ZodNullable<z.ZodString>;
169
163
  current: z.ZodNullable<z.ZodString>;
164
+ url: z.ZodNullable<z.ZodString>;
165
+ }, z.core.$strip>;
166
+ space: z.ZodObject<{
167
+ live_url: z.ZodNullable<z.ZodString>;
170
168
  }, z.core.$strip>;
171
169
  ws_url: z.ZodNullable<z.ZodString>;
172
170
  endpoints: z.ZodObject<{
@@ -181,10 +179,24 @@ export declare const collabOverlayConfigSchema: z.ZodObject<{
181
179
  notices: z.ZodBoolean;
182
180
  }, z.core.$strip>;
183
181
  }, z.core.$strip>;
182
+ export declare const COLLAB_VERSION_URLS_MAX_IDS = 50;
183
+ export declare const collabVersionUrlsQuerySchema: z.ZodObject<{
184
+ path: z.ZodOptional<z.ZodString>;
185
+ versionId: z.ZodOptional<z.ZodString>;
186
+ host: z.ZodOptional<z.ZodString>;
187
+ ids: z.ZodString;
188
+ }, z.core.$strip>;
189
+ export declare const collabVersionUrlSchema: z.ZodObject<{
190
+ id: z.ZodString;
191
+ url: z.ZodString;
192
+ number: z.ZodNullable<z.ZodNumber>;
193
+ createdAt: z.ZodNullable<z.ZodString>;
194
+ }, z.core.$strip>;
184
195
  export declare const commentAuthorSchema: z.ZodObject<{
185
196
  kind: z.ZodNullable<z.ZodString>;
186
197
  id: z.ZodNullable<z.ZodString>;
187
198
  name: z.ZodNullable<z.ZodString>;
199
+ color: z.ZodNullable<z.ZodString>;
188
200
  }, z.core.$strip>;
189
201
  export declare const commentTargetSchema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
190
202
  export declare const commentThreadSchema: z.ZodObject<{
@@ -199,6 +211,11 @@ export declare const commentThreadSchema: z.ZodObject<{
199
211
  open: "open";
200
212
  archived: "archived";
201
213
  }>;
214
+ moderationState: z.ZodEnum<{
215
+ spam: "spam";
216
+ clear: "clear";
217
+ }>;
218
+ heldCommentIds: z.ZodArray<z.ZodString>;
202
219
  unread: z.ZodBoolean;
203
220
  unreadCount: z.ZodNumber;
204
221
  body: z.ZodNullable<z.ZodString>;
@@ -206,6 +223,7 @@ export declare const commentThreadSchema: z.ZodObject<{
206
223
  kind: z.ZodNullable<z.ZodString>;
207
224
  id: z.ZodNullable<z.ZodString>;
208
225
  name: z.ZodNullable<z.ZodString>;
226
+ color: z.ZodNullable<z.ZodString>;
209
227
  }, z.core.$strip>>;
210
228
  target: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
211
229
  comments: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -220,8 +238,19 @@ export declare const commentListQuerySchema: z.ZodObject<{
220
238
  open: "open";
221
239
  archived: "archived";
222
240
  }>>;
241
+ filter: z.ZodOptional<z.ZodEnum<{
242
+ open: "open";
243
+ spam: "spam";
244
+ archived: "archived";
245
+ }>>;
223
246
  pagePath: z.ZodOptional<z.ZodString>;
247
+ q: z.ZodOptional<z.ZodString>;
248
+ author: z.ZodOptional<z.ZodString>;
249
+ unread: z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
224
250
  }, z.core.$strip>;
251
+ export declare const commentSpamFeedbackSchema: z.ZodDefault<z.ZodObject<{
252
+ commentId: z.ZodOptional<z.ZodString>;
253
+ }, z.core.$strip>>;
225
254
  export declare const commentCreateSchema: z.ZodObject<{
226
255
  pagePath: z.ZodDefault<z.ZodString>;
227
256
  body: z.ZodString;
@@ -232,8 +261,8 @@ export declare const commentScreenshotCreateSchema: z.ZodObject<{
232
261
  versionId: z.ZodString;
233
262
  pagePath: z.ZodDefault<z.ZodString>;
234
263
  contentType: z.ZodEnum<{
235
- "image/png": "image/png";
236
264
  "image/jpeg": "image/jpeg";
265
+ "image/png": "image/png";
237
266
  "image/webp": "image/webp";
238
267
  }>;
239
268
  contentBase64: z.ZodString;
@@ -277,6 +306,11 @@ export declare const commentListResponseSchema: z.ZodObject<{
277
306
  open: "open";
278
307
  archived: "archived";
279
308
  }>;
309
+ moderationState: z.ZodEnum<{
310
+ spam: "spam";
311
+ clear: "clear";
312
+ }>;
313
+ heldCommentIds: z.ZodArray<z.ZodString>;
280
314
  unread: z.ZodBoolean;
281
315
  unreadCount: z.ZodNumber;
282
316
  body: z.ZodNullable<z.ZodString>;
@@ -284,6 +318,7 @@ export declare const commentListResponseSchema: z.ZodObject<{
284
318
  kind: z.ZodNullable<z.ZodString>;
285
319
  id: z.ZodNullable<z.ZodString>;
286
320
  name: z.ZodNullable<z.ZodString>;
321
+ color: z.ZodNullable<z.ZodString>;
287
322
  }, z.core.$strip>>;
288
323
  target: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
289
324
  comments: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -306,4 +341,5 @@ export type CollaborationInvitedReviewer = z.infer<typeof collaborationInvitedRe
306
341
  export type Collaboration = z.infer<typeof collaborationSchema>;
307
342
  export type CollaborationUpdate = z.infer<typeof collaborationUpdateSchema>;
308
343
  export type CollabOverlayConfig = z.infer<typeof collabOverlayConfigSchema>;
344
+ export type CollabVersionUrl = z.infer<typeof collabVersionUrlSchema>;
309
345
  export type CommentThread = z.infer<typeof commentThreadSchema>;
@@ -1,15 +1,19 @@
1
1
  import { z } from "zod";
2
2
  import { CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
3
- export const collaborationModeSchema = z.enum(["review"]);
4
3
  export const commentThreadStatusSchema = z.enum(["open", "archived"]);
4
+ export const COMMENT_SEARCH_QUERY_MAX_LENGTH = 160;
5
+ export function normalizeCommentSearchQuery(value) {
6
+ const trimmed = value?.trim();
7
+ return trimmed ? trimmed.slice(0, COMMENT_SEARCH_QUERY_MAX_LENGTH) : undefined;
8
+ }
5
9
  // The space access levels capability follows (SPACEFAST-CAST-PLAN D-2). Invited
6
10
  // reviewers are space invitees with one of these levels; the on-page overlay and
7
11
  // inbox re-evaluate the effective level server-side at join — this is only the
8
12
  // stored grant the dashboard manages.
9
13
  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).
14
+ export const COMMENT_PAGE_PATH_MAX_LENGTH = 2_048;
15
+ // An invited reviewer: request input projected into the access lane's canonical
16
+ // `cast_reviewer` managed block. It is never mirrored into collaboration settings.
13
17
  export const collaborationInvitedReviewerSchema = z.object({
14
18
  email: z.string().email(),
15
19
  level: collaborationReviewerLevelSchema,
@@ -18,13 +22,13 @@ export const collaborationSettingsSchema = z
18
22
  .object({
19
23
  anonymousReviewers: z.boolean().optional(),
20
24
  publishedAnonymousCommenters: z.boolean().optional(),
25
+ spamFilterEnabled: z.boolean().optional(),
21
26
  invitedReviewers: z.array(collaborationInvitedReviewerSchema).optional(),
22
27
  // Whether comments are surfaced on the live/published host (vs preview-only).
23
28
  // The published loader (SPACEFAST-CAST-PLAN §4.2) mounts the orb on a live
24
29
  // host only when this is true; toggling it never requires a republish — the
25
30
  // always-injected inert tag reads behavior from the ETag'd overlay-config.
26
31
  publishedComments: z.boolean().optional(),
27
- allowedOrigins: z.array(z.string().min(1)).optional(),
28
32
  notificationPreferences: z
29
33
  .object({
30
34
  newThreads: z.boolean().default(true),
@@ -34,11 +38,10 @@ export const collaborationSettingsSchema = z
34
38
  .partial()
35
39
  .optional(),
36
40
  })
37
- .catchall(z.unknown());
41
+ .strict();
38
42
  export const collaborationSchema = z.object({
39
43
  spaceId: z.string(),
40
44
  enabled: z.boolean(),
41
- mode: collaborationModeSchema,
42
45
  castResourceId: z.string().nullable(),
43
46
  castResourceKey: z.string().nullable(),
44
47
  settings: collaborationSettingsSchema,
@@ -47,12 +50,12 @@ export const collaborationSchema = z.object({
47
50
  });
48
51
  export const collaborationUpdateSchema = z.object({
49
52
  enabled: z.boolean(),
50
- mode: collaborationModeSchema.optional(),
51
53
  settings: collaborationSettingsSchema.optional(),
52
54
  });
53
55
  export const collaborationTokenRequestSchema = z.object({
54
56
  versionId: z.string().min(1).optional(),
55
- pagePath: z.string().min(1).default("/"),
57
+ pagePath: z.string().min(1).max(COMMENT_PAGE_PATH_MAX_LENGTH).default("/"),
58
+ anonymousId: z.string().min(1).max(160).optional(),
56
59
  displayName: z.string().min(1).max(120).optional(),
57
60
  });
58
61
  export const collaborationTokenResponseSchema = z.object({
@@ -60,12 +63,12 @@ export const collaborationTokenResponseSchema = z.object({
60
63
  expiresAt: z.string().datetime(),
61
64
  cast: z.object({
62
65
  resource: z.string(),
63
- room: z.string().nullable(),
66
+ room: z.string(),
64
67
  }),
65
68
  });
66
69
  export const collaborationHandoffRequestSchema = z.object({
67
70
  versionId: z.string().min(1),
68
- pagePath: z.string().min(1).default("/"),
71
+ pagePath: z.string().min(1).max(COMMENT_PAGE_PATH_MAX_LENGTH).default("/"),
69
72
  });
70
73
  export const collaborationHandoffResponseSchema = z.object({
71
74
  handoffToken: z.string(),
@@ -85,7 +88,6 @@ export const realtimeTokenResponseSchema = z.object({
85
88
  cast: z.object({
86
89
  resource: z.string(),
87
90
  room: z.string(),
88
- loaderUrl: z.string().url(),
89
91
  }),
90
92
  });
91
93
  export const noticePublishSchema = z.object({
@@ -104,7 +106,7 @@ export const noticePublishResponseSchema = z.object({
104
106
  broadcast: z.record(z.string(), z.unknown()).nullable(),
105
107
  });
106
108
  export const collabOverlayConfigQuerySchema = z.object({
107
- path: z.string().min(1).optional(),
109
+ path: z.string().min(1).max(COMMENT_PAGE_PATH_MAX_LENGTH).optional(),
108
110
  versionId: z.string().min(1).optional(),
109
111
  host: z.string().min(1).optional(),
110
112
  });
@@ -118,6 +120,13 @@ export const collabOverlayConfigSchema = z.object({
118
120
  version: z.object({
119
121
  id: z.string().nullable(),
120
122
  current: z.string().nullable(),
123
+ // The viewed version's immutable URL; null when unknown (live context).
124
+ url: z.string().nullable(),
125
+ }),
126
+ // The space's canonical live/published URL; null when comments-on-live is the
127
+ // current context (you're already there) or no live URL exists.
128
+ space: z.object({
129
+ live_url: z.string().nullable(),
121
130
  }),
122
131
  ws_url: z.string().nullable(),
123
132
  endpoints: z.object({
@@ -132,10 +141,29 @@ export const collabOverlayConfigSchema = z.object({
132
141
  notices: z.boolean(),
133
142
  }),
134
143
  });
144
+ // Cross-version navigation directory (§5 "versions are native"): the SDK asks
145
+ // for the immutable URLs of the version ids present in a room's threads so
146
+ // "Open this comment on v12" is a real link. Gated exactly like the overlay
147
+ // config — disabled comments never leak version URLs.
148
+ export const COLLAB_VERSION_URLS_MAX_IDS = 50;
149
+ export const collabVersionUrlsQuerySchema = collabOverlayConfigQuerySchema.extend({
150
+ // Comma-separated version ids; the route caps the lookup at
151
+ // COLLAB_VERSION_URLS_MAX_IDS ids.
152
+ ids: z.string().min(1).max(4_096),
153
+ });
154
+ export const collabVersionUrlSchema = z.object({
155
+ id: z.string(),
156
+ url: z.string(),
157
+ // number/createdAt let clients order versions by real recency instead of
158
+ // comparing opaque ids.
159
+ number: z.number().int().nullable(),
160
+ createdAt: z.string().nullable(),
161
+ });
135
162
  export const commentAuthorSchema = z.object({
136
163
  kind: z.string().nullable(),
137
164
  id: z.string().nullable(),
138
165
  name: z.string().nullable(),
166
+ color: z.string().max(64).nullable(),
139
167
  });
140
168
  export const commentTargetSchema = z.record(z.string(), z.unknown()).nullable();
141
169
  export const commentThreadSchema = z.object({
@@ -144,9 +172,11 @@ export const commentThreadSchema = z.object({
144
172
  spaceId: z.string(),
145
173
  versionId: z.string().nullable(),
146
174
  channel: z.string().nullable(),
147
- pagePath: z.string(),
175
+ pagePath: z.string().max(COMMENT_PAGE_PATH_MAX_LENGTH),
148
176
  url: z.string().nullable(),
149
177
  status: commentThreadStatusSchema,
178
+ moderationState: z.enum(["clear", "spam"]),
179
+ heldCommentIds: z.array(z.string()),
150
180
  unread: z.boolean(),
151
181
  unreadCount: z.number().int().min(0),
152
182
  body: z.string().nullable(),
@@ -159,17 +189,26 @@ export const commentThreadSchema = z.object({
159
189
  export const commentListQuerySchema = cursorListQuerySchema.extend({
160
190
  versionId: z.string().optional(),
161
191
  status: commentThreadStatusSchema.optional(),
162
- pagePath: z.string().optional(),
192
+ filter: z.enum(["open", "archived", "spam"]).optional(),
193
+ pagePath: z.string().max(COMMENT_PAGE_PATH_MAX_LENGTH).optional(),
194
+ q: z.string().trim().max(COMMENT_SEARCH_QUERY_MAX_LENGTH).optional(),
195
+ author: z.string().trim().max(160).optional(),
196
+ unread: z.stringbool().optional(),
163
197
  });
198
+ export const commentSpamFeedbackSchema = z
199
+ .object({
200
+ commentId: z.string().min(1).optional(),
201
+ })
202
+ .default({});
164
203
  export const commentCreateSchema = z.object({
165
- pagePath: z.string().min(1).default("/"),
204
+ pagePath: z.string().min(1).max(COMMENT_PAGE_PATH_MAX_LENGTH).default("/"),
166
205
  body: z.string().min(1).max(16_000),
167
206
  target: commentTargetSchema.optional(),
168
207
  idempotencyKey: z.string().min(1).max(320).optional(),
169
208
  });
170
209
  export const commentScreenshotCreateSchema = z.object({
171
210
  versionId: z.string().min(1),
172
- pagePath: z.string().min(1).default("/"),
211
+ pagePath: z.string().min(1).max(COMMENT_PAGE_PATH_MAX_LENGTH).default("/"),
173
212
  contentType: z.enum(["image/png", "image/jpeg", "image/webp"]),
174
213
  contentBase64: z.string().min(1),
175
214
  });
@@ -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
  });
@@ -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,19 @@ 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
+ "domains:read": "domains:read";
83
+ "mcp:tools": "mcp:tools";
78
84
  "*": "*";
79
85
  "sites:read": "sites:read";
80
86
  "sites:create": "sites:create";
81
87
  "sites:write": "sites:write";
82
88
  "sites:delete": "sites:delete";
83
89
  "sites:policy.write": "sites:policy.write";
84
- "spaces:read": "spaces:read";
85
90
  "spaces:create": "spaces:create";
86
- "spaces:write": "spaces:write";
87
91
  "spaces:delete": "spaces:delete";
88
92
  "spaces:publish": "spaces:publish";
89
93
  "spaces:transfer": "spaces:transfer";
@@ -93,7 +97,6 @@ export declare const DeviceAuthorizationPollResponseSchema: z.ZodObject<{
93
97
  "versions:promote": "versions:promote";
94
98
  "versions:delete": "versions:delete";
95
99
  "versions:download": "versions:download";
96
- "domains:read": "domains:read";
97
100
  "domains:create": "domains:create";
98
101
  "domains:verify": "domains:verify";
99
102
  "domains:assign": "domains:assign";
@@ -106,7 +109,6 @@ export declare const DeviceAuthorizationPollResponseSchema: z.ZodObject<{
106
109
  "webhooks:write": "webhooks:write";
107
110
  "builds:read": "builds:read";
108
111
  "builds:create": "builds:create";
109
- "teams:read": "teams:read";
110
112
  "teams:write": "teams:write";
111
113
  "teams:members.write": "teams:members.write";
112
114
  "billing:read": "billing:read";
@@ -114,7 +116,6 @@ export declare const DeviceAuthorizationPollResponseSchema: z.ZodObject<{
114
116
  "tokens:read": "tokens:read";
115
117
  "tokens:create": "tokens:create";
116
118
  "tokens:revoke": "tokens:revoke";
117
- "mcp:tools": "mcp:tools";
118
119
  "runtime:manage": "runtime:manage";
119
120
  }>>;
120
121
  resources: z.ZodArray<z.ZodString>;
@@ -122,8 +123,8 @@ export declare const DeviceAuthorizationPollResponseSchema: z.ZodObject<{
122
123
  "request.client": z.ZodOptional<z.ZodEnum<{
123
124
  api: "api";
124
125
  dashboard: "dashboard";
125
- cli: "cli";
126
126
  worker: "worker";
127
+ cli: "cli";
127
128
  }>>;
128
129
  }, z.core.$strict>>;
129
130
  }, z.core.$strict>>;
@@ -267,15 +268,19 @@ export declare const AgentHandoffRedeemResponseSchema: z.ZodObject<{
267
268
  deny: "deny";
268
269
  }>;
269
270
  actions: z.ZodArray<z.ZodEnum<{
271
+ "teams:read": "teams:read";
272
+ "teams:create": "teams:create";
273
+ "spaces:read": "spaces:read";
274
+ "spaces:write": "spaces:write";
275
+ "domains:read": "domains:read";
276
+ "mcp:tools": "mcp:tools";
270
277
  "*": "*";
271
278
  "sites:read": "sites:read";
272
279
  "sites:create": "sites:create";
273
280
  "sites:write": "sites:write";
274
281
  "sites:delete": "sites:delete";
275
282
  "sites:policy.write": "sites:policy.write";
276
- "spaces:read": "spaces:read";
277
283
  "spaces:create": "spaces:create";
278
- "spaces:write": "spaces:write";
279
284
  "spaces:delete": "spaces:delete";
280
285
  "spaces:publish": "spaces:publish";
281
286
  "spaces:transfer": "spaces:transfer";
@@ -285,7 +290,6 @@ export declare const AgentHandoffRedeemResponseSchema: z.ZodObject<{
285
290
  "versions:promote": "versions:promote";
286
291
  "versions:delete": "versions:delete";
287
292
  "versions:download": "versions:download";
288
- "domains:read": "domains:read";
289
293
  "domains:create": "domains:create";
290
294
  "domains:verify": "domains:verify";
291
295
  "domains:assign": "domains:assign";
@@ -298,7 +302,6 @@ export declare const AgentHandoffRedeemResponseSchema: z.ZodObject<{
298
302
  "webhooks:write": "webhooks:write";
299
303
  "builds:read": "builds:read";
300
304
  "builds:create": "builds:create";
301
- "teams:read": "teams:read";
302
305
  "teams:write": "teams:write";
303
306
  "teams:members.write": "teams:members.write";
304
307
  "billing:read": "billing:read";
@@ -306,7 +309,6 @@ export declare const AgentHandoffRedeemResponseSchema: z.ZodObject<{
306
309
  "tokens:read": "tokens:read";
307
310
  "tokens:create": "tokens:create";
308
311
  "tokens:revoke": "tokens:revoke";
309
- "mcp:tools": "mcp:tools";
310
312
  "runtime:manage": "runtime:manage";
311
313
  }>>;
312
314
  resources: z.ZodArray<z.ZodString>;
@@ -314,8 +316,8 @@ export declare const AgentHandoffRedeemResponseSchema: z.ZodObject<{
314
316
  "request.client": z.ZodOptional<z.ZodEnum<{
315
317
  api: "api";
316
318
  dashboard: "dashboard";
317
- cli: "cli";
318
319
  worker: "worker";
320
+ cli: "cli";
319
321
  }>>;
320
322
  }, z.core.$strict>>;
321
323
  }, z.core.$strict>>;
@@ -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
  }>;