@replohq/sandbox-runtime 1.19.5 → 1.21.0

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 (52) hide show
  1. package/PagePreviewHeightResponder.d.ts +1 -0
  2. package/PagePreviewHeightResponder.js +159 -0
  3. package/_vendor/schemas/comments.d.ts +898 -0
  4. package/_vendor/schemas/commentsOverlayRpc.d.ts +348 -0
  5. package/_vendor/schemas/commentsOverlayRpc.mjs +92 -0
  6. package/_vendor/schemas/generated/comments.d.ts +237 -0
  7. package/_vendor/schemas/generated/commentsOverlayRpc.d.ts +18 -0
  8. package/_vendor/schemas/generated/selectMode.d.ts +3 -1
  9. package/_vendor/schemas/pagePreviewHeight.d.ts +14 -0
  10. package/_vendor/schemas/pagePreviewHeight.mjs +18 -0
  11. package/_vendor/schemas/selectMode.d.ts +113 -0
  12. package/_vendor/schemas/selectMode.mjs +1 -1
  13. package/_vendor/schemas/selectModeIframeRpc.d.ts +226 -0
  14. package/_vendor/schemas/selectModeIframeRpc.mjs +1 -1
  15. package/buildMetadata.js +3 -3
  16. package/chunk-NVOBD46N.mjs +541 -0
  17. package/comments-overlay/CommentsOverlayMount.d.ts +1 -0
  18. package/comments-overlay/CommentsOverlayMount.js +44 -0
  19. package/comments-overlay/LICENSE-THIRD-PARTY.md +45 -0
  20. package/comments-overlay/bridge.d.ts +11 -0
  21. package/comments-overlay/bridge.js +136 -0
  22. package/comments-overlay/capture.d.ts +55 -0
  23. package/comments-overlay/capture.js +250 -0
  24. package/comments-overlay/originGate.d.ts +1 -0
  25. package/comments-overlay/originGate.js +11 -0
  26. package/comments-overlay/overlay.d.ts +52 -0
  27. package/comments-overlay/overlay.js +781 -0
  28. package/comments-overlay/resolve.d.ts +27 -0
  29. package/comments-overlay/resolve.js +201 -0
  30. package/comments-overlay/sourceLookup.d.ts +11 -0
  31. package/comments-overlay/sourceLookup.js +63 -0
  32. package/comments-overlay/textQuote.d.ts +17 -0
  33. package/comments-overlay/textQuote.js +87 -0
  34. package/comments-overlay/vendor/bippy.d.ts +53 -0
  35. package/comments-overlay/vendor/bippy.js +402 -0
  36. package/comments-overlay/vendor/elementAnchors.d.ts +9 -0
  37. package/comments-overlay/vendor/elementAnchors.js +144 -0
  38. package/comments-overlay/vendor/fiberElement.d.ts +21 -0
  39. package/comments-overlay/vendor/fiberElement.js +251 -0
  40. package/comments-overlay/vendor/htmlPreview.d.ts +13 -0
  41. package/comments-overlay/vendor/htmlPreview.js +179 -0
  42. package/comments-overlay/vendor/selector.d.ts +38 -0
  43. package/comments-overlay/vendor/selector.js +372 -0
  44. package/package.json +5 -4
  45. package/pinPreviewViewportUnits.d.ts +4 -0
  46. package/pinPreviewViewportUnits.js +76 -0
  47. package/sandbox-runtime.js +4 -0
  48. package/select-mode/descriptor/elementDescriptor.d.ts +4 -3
  49. package/select-mode/descriptor/elementDescriptor.js +20 -30
  50. package/select-mode/iframeRpcChannel.d.ts +84 -0
  51. package/select-mode/symbolicate.js +25 -7
  52. package/chunk-QTGDSYSU.mjs +0 -249
@@ -0,0 +1,348 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Host ↔ frame protocol for the in-page comments overlay (D-28). The frame
4
+ * runs the page's own scripts, so only thread IDs, anchors and statuses cross
5
+ * this channel: never comment bodies or author names. Objects are strict so a
6
+ * stray field fails validation instead of reaching the frame.
7
+ */
8
+ export declare const COMMENTS_OVERLAY_RPC_CHANNEL_ID: "replo:comments-overlay-rpc";
9
+ export declare const COMMENTS_OVERLAY_RPC_CHANNEL_VERSION: 1;
10
+ export declare const commentOverlayPinSchema: z.ZodObject<{
11
+ threadId: z.ZodString;
12
+ anchor: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ type: z.ZodLiteral<"none">;
14
+ context: z.ZodOptional<z.ZodObject<{
15
+ url: z.ZodString;
16
+ locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
+ }, z.core.$strip>>;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ type: z.ZodLiteral<"element">;
20
+ semanticSelector: z.ZodOptional<z.ZodString>;
21
+ selector: z.ZodString;
22
+ nthOfTypePath: z.ZodString;
23
+ source: z.ZodOptional<z.ZodObject<{
24
+ filePath: z.ZodString;
25
+ componentChain: z.ZodArray<z.ZodString>;
26
+ line: z.ZodOptional<z.ZodNumber>;
27
+ col: z.ZodOptional<z.ZodNumber>;
28
+ }, z.core.$strip>>;
29
+ listKey: z.ZodOptional<z.ZodString>;
30
+ tagName: z.ZodString;
31
+ textPreview: z.ZodString;
32
+ quote: z.ZodOptional<z.ZodObject<{
33
+ exact: z.ZodString;
34
+ prefix: z.ZodString;
35
+ suffix: z.ZodString;
36
+ }, z.core.$strip>>;
37
+ offset: z.ZodObject<{
38
+ x: z.ZodNumber;
39
+ y: z.ZodNumber;
40
+ }, z.core.$strip>;
41
+ context: z.ZodOptional<z.ZodObject<{
42
+ url: z.ZodString;
43
+ locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
+ }, z.core.$strip>>;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ type: z.ZodLiteral<"canvas">;
47
+ nodeId: z.ZodString;
48
+ layerId: z.ZodOptional<z.ZodString>;
49
+ point: z.ZodObject<{
50
+ x: z.ZodNumber;
51
+ y: z.ZodNumber;
52
+ }, z.core.$strip>;
53
+ world: z.ZodOptional<z.ZodObject<{
54
+ x: z.ZodNumber;
55
+ y: z.ZodNumber;
56
+ }, z.core.$strip>>;
57
+ }, z.core.$strip>, z.ZodObject<{
58
+ type: z.ZodLiteral<"point">;
59
+ page: z.ZodOptional<z.ZodNumber>;
60
+ x: z.ZodNumber;
61
+ y: z.ZodNumber;
62
+ }, z.core.$strip>], "type">;
63
+ status: z.ZodEnum<{
64
+ open: "open";
65
+ resolved: "resolved";
66
+ }>;
67
+ count: z.ZodNumber;
68
+ }, z.core.$strict>;
69
+ export declare const commentAnchorStatusSchema: z.ZodEnum<{
70
+ hidden: "hidden";
71
+ attached: "attached";
72
+ ambiguous: "ambiguous";
73
+ detached: "detached";
74
+ }>;
75
+ export declare const commentOverlayAnchorStatusSchema: z.ZodObject<{
76
+ threadId: z.ZodString;
77
+ status: z.ZodEnum<{
78
+ hidden: "hidden";
79
+ attached: "attached";
80
+ ambiguous: "ambiguous";
81
+ detached: "detached";
82
+ }>;
83
+ }, z.core.$strict>;
84
+ export declare const commentOverlayRectSchema: z.ZodObject<{
85
+ x: z.ZodNumber;
86
+ y: z.ZodNumber;
87
+ width: z.ZodNumber;
88
+ height: z.ZodNumber;
89
+ }, z.core.$strict>;
90
+ export declare const hostToCommentsOverlayMethodConfig: {
91
+ setCommentMode: {
92
+ inputSchema: z.ZodObject<{
93
+ mode: z.ZodEnum<{
94
+ comment: "comment";
95
+ browse: "browse";
96
+ selection: "selection";
97
+ }>;
98
+ }, z.core.$strict>;
99
+ outputSchema: z.ZodVoid;
100
+ };
101
+ setPins: {
102
+ inputSchema: z.ZodObject<{
103
+ pins: z.ZodArray<z.ZodObject<{
104
+ threadId: z.ZodString;
105
+ anchor: z.ZodDiscriminatedUnion<[z.ZodObject<{
106
+ type: z.ZodLiteral<"none">;
107
+ context: z.ZodOptional<z.ZodObject<{
108
+ url: z.ZodString;
109
+ locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
+ }, z.core.$strip>>;
111
+ }, z.core.$strip>, z.ZodObject<{
112
+ type: z.ZodLiteral<"element">;
113
+ semanticSelector: z.ZodOptional<z.ZodString>;
114
+ selector: z.ZodString;
115
+ nthOfTypePath: z.ZodString;
116
+ source: z.ZodOptional<z.ZodObject<{
117
+ filePath: z.ZodString;
118
+ componentChain: z.ZodArray<z.ZodString>;
119
+ line: z.ZodOptional<z.ZodNumber>;
120
+ col: z.ZodOptional<z.ZodNumber>;
121
+ }, z.core.$strip>>;
122
+ listKey: z.ZodOptional<z.ZodString>;
123
+ tagName: z.ZodString;
124
+ textPreview: z.ZodString;
125
+ quote: z.ZodOptional<z.ZodObject<{
126
+ exact: z.ZodString;
127
+ prefix: z.ZodString;
128
+ suffix: z.ZodString;
129
+ }, z.core.$strip>>;
130
+ offset: z.ZodObject<{
131
+ x: z.ZodNumber;
132
+ y: z.ZodNumber;
133
+ }, z.core.$strip>;
134
+ context: z.ZodOptional<z.ZodObject<{
135
+ url: z.ZodString;
136
+ locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
+ }, z.core.$strip>>;
138
+ }, z.core.$strip>, z.ZodObject<{
139
+ type: z.ZodLiteral<"canvas">;
140
+ nodeId: z.ZodString;
141
+ layerId: z.ZodOptional<z.ZodString>;
142
+ point: z.ZodObject<{
143
+ x: z.ZodNumber;
144
+ y: z.ZodNumber;
145
+ }, z.core.$strip>;
146
+ world: z.ZodOptional<z.ZodObject<{
147
+ x: z.ZodNumber;
148
+ y: z.ZodNumber;
149
+ }, z.core.$strip>>;
150
+ }, z.core.$strip>, z.ZodObject<{
151
+ type: z.ZodLiteral<"point">;
152
+ page: z.ZodOptional<z.ZodNumber>;
153
+ x: z.ZodNumber;
154
+ y: z.ZodNumber;
155
+ }, z.core.$strip>], "type">;
156
+ status: z.ZodEnum<{
157
+ open: "open";
158
+ resolved: "resolved";
159
+ }>;
160
+ count: z.ZodNumber;
161
+ }, z.core.$strict>>;
162
+ }, z.core.$strict>;
163
+ outputSchema: z.ZodVoid;
164
+ };
165
+ focusThread: {
166
+ inputSchema: z.ZodObject<{
167
+ threadId: z.ZodString;
168
+ }, z.core.$strict>;
169
+ outputSchema: z.ZodVoid;
170
+ };
171
+ clearDraft: {
172
+ inputSchema: z.ZodUndefined;
173
+ outputSchema: z.ZodVoid;
174
+ };
175
+ setDraftAnchor: {
176
+ inputSchema: z.ZodObject<{
177
+ anchor: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
178
+ type: z.ZodLiteral<"none">;
179
+ context: z.ZodOptional<z.ZodObject<{
180
+ url: z.ZodString;
181
+ locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
182
+ }, z.core.$strip>>;
183
+ }, z.core.$strip>, z.ZodObject<{
184
+ type: z.ZodLiteral<"element">;
185
+ semanticSelector: z.ZodOptional<z.ZodString>;
186
+ selector: z.ZodString;
187
+ nthOfTypePath: z.ZodString;
188
+ source: z.ZodOptional<z.ZodObject<{
189
+ filePath: z.ZodString;
190
+ componentChain: z.ZodArray<z.ZodString>;
191
+ line: z.ZodOptional<z.ZodNumber>;
192
+ col: z.ZodOptional<z.ZodNumber>;
193
+ }, z.core.$strip>>;
194
+ listKey: z.ZodOptional<z.ZodString>;
195
+ tagName: z.ZodString;
196
+ textPreview: z.ZodString;
197
+ quote: z.ZodOptional<z.ZodObject<{
198
+ exact: z.ZodString;
199
+ prefix: z.ZodString;
200
+ suffix: z.ZodString;
201
+ }, z.core.$strip>>;
202
+ offset: z.ZodObject<{
203
+ x: z.ZodNumber;
204
+ y: z.ZodNumber;
205
+ }, z.core.$strip>;
206
+ context: z.ZodOptional<z.ZodObject<{
207
+ url: z.ZodString;
208
+ locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
209
+ }, z.core.$strip>>;
210
+ }, z.core.$strip>, z.ZodObject<{
211
+ type: z.ZodLiteral<"canvas">;
212
+ nodeId: z.ZodString;
213
+ layerId: z.ZodOptional<z.ZodString>;
214
+ point: z.ZodObject<{
215
+ x: z.ZodNumber;
216
+ y: z.ZodNumber;
217
+ }, z.core.$strip>;
218
+ world: z.ZodOptional<z.ZodObject<{
219
+ x: z.ZodNumber;
220
+ y: z.ZodNumber;
221
+ }, z.core.$strip>>;
222
+ }, z.core.$strip>, z.ZodObject<{
223
+ type: z.ZodLiteral<"point">;
224
+ page: z.ZodOptional<z.ZodNumber>;
225
+ x: z.ZodNumber;
226
+ y: z.ZodNumber;
227
+ }, z.core.$strip>], "type">>;
228
+ }, z.core.$strict>;
229
+ outputSchema: z.ZodVoid;
230
+ };
231
+ };
232
+ export declare const commentsOverlayToHostMethodConfig: {
233
+ overlayReady: {
234
+ inputSchema: z.ZodUndefined;
235
+ outputSchema: z.ZodVoid;
236
+ };
237
+ anchorPicked: {
238
+ inputSchema: z.ZodObject<{
239
+ anchor: z.ZodObject<{
240
+ type: z.ZodLiteral<"element">;
241
+ semanticSelector: z.ZodOptional<z.ZodString>;
242
+ selector: z.ZodString;
243
+ nthOfTypePath: z.ZodString;
244
+ source: z.ZodOptional<z.ZodObject<{
245
+ filePath: z.ZodString;
246
+ componentChain: z.ZodArray<z.ZodString>;
247
+ line: z.ZodOptional<z.ZodNumber>;
248
+ col: z.ZodOptional<z.ZodNumber>;
249
+ }, z.core.$strip>>;
250
+ listKey: z.ZodOptional<z.ZodString>;
251
+ tagName: z.ZodString;
252
+ textPreview: z.ZodString;
253
+ quote: z.ZodOptional<z.ZodObject<{
254
+ exact: z.ZodString;
255
+ prefix: z.ZodString;
256
+ suffix: z.ZodString;
257
+ }, z.core.$strip>>;
258
+ offset: z.ZodObject<{
259
+ x: z.ZodNumber;
260
+ y: z.ZodNumber;
261
+ }, z.core.$strip>;
262
+ context: z.ZodOptional<z.ZodObject<{
263
+ url: z.ZodString;
264
+ locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
265
+ }, z.core.$strip>>;
266
+ }, z.core.$strip>;
267
+ rect: z.ZodObject<{
268
+ x: z.ZodNumber;
269
+ y: z.ZodNumber;
270
+ width: z.ZodNumber;
271
+ height: z.ZodNumber;
272
+ }, z.core.$strict>;
273
+ }, z.core.$strict>;
274
+ outputSchema: z.ZodVoid;
275
+ };
276
+ pinClicked: {
277
+ inputSchema: z.ZodObject<{
278
+ threadId: z.ZodString;
279
+ }, z.core.$strict>;
280
+ outputSchema: z.ZodVoid;
281
+ };
282
+ anchorStatuses: {
283
+ inputSchema: z.ZodObject<{
284
+ statuses: z.ZodArray<z.ZodObject<{
285
+ threadId: z.ZodString;
286
+ status: z.ZodEnum<{
287
+ hidden: "hidden";
288
+ attached: "attached";
289
+ ambiguous: "ambiguous";
290
+ detached: "detached";
291
+ }>;
292
+ }, z.core.$strict>>;
293
+ }, z.core.$strict>;
294
+ outputSchema: z.ZodVoid;
295
+ };
296
+ requestComposeFromSelection: {
297
+ inputSchema: z.ZodObject<{
298
+ anchor: z.ZodObject<{
299
+ type: z.ZodLiteral<"element">;
300
+ semanticSelector: z.ZodOptional<z.ZodString>;
301
+ selector: z.ZodString;
302
+ nthOfTypePath: z.ZodString;
303
+ source: z.ZodOptional<z.ZodObject<{
304
+ filePath: z.ZodString;
305
+ componentChain: z.ZodArray<z.ZodString>;
306
+ line: z.ZodOptional<z.ZodNumber>;
307
+ col: z.ZodOptional<z.ZodNumber>;
308
+ }, z.core.$strip>>;
309
+ listKey: z.ZodOptional<z.ZodString>;
310
+ tagName: z.ZodString;
311
+ textPreview: z.ZodString;
312
+ quote: z.ZodOptional<z.ZodObject<{
313
+ exact: z.ZodString;
314
+ prefix: z.ZodString;
315
+ suffix: z.ZodString;
316
+ }, z.core.$strip>>;
317
+ offset: z.ZodObject<{
318
+ x: z.ZodNumber;
319
+ y: z.ZodNumber;
320
+ }, z.core.$strip>;
321
+ context: z.ZodOptional<z.ZodObject<{
322
+ url: z.ZodString;
323
+ locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
324
+ }, z.core.$strip>>;
325
+ }, z.core.$strip>;
326
+ }, z.core.$strict>;
327
+ outputSchema: z.ZodVoid;
328
+ };
329
+ pickCancelled: {
330
+ inputSchema: z.ZodUndefined;
331
+ outputSchema: z.ZodVoid;
332
+ };
333
+ modeShortcut: {
334
+ inputSchema: z.ZodObject<{
335
+ mode: z.ZodEnum<{
336
+ comment: "comment";
337
+ browse: "browse";
338
+ }>;
339
+ }, z.core.$strict>;
340
+ outputSchema: z.ZodVoid;
341
+ };
342
+ locationChanged: {
343
+ inputSchema: z.ZodObject<{
344
+ url: z.ZodString;
345
+ }, z.core.$strict>;
346
+ outputSchema: z.ZodVoid;
347
+ };
348
+ };
@@ -0,0 +1,92 @@
1
+ import { commentAnchorSchema, displayModeSchema, commentAnchorElementSchema } from '../../chunk-NVOBD46N.mjs';
2
+ import '../../chunk-THOBCJJA.mjs';
3
+ import '../../chunk-4ITJNSXZ.mjs';
4
+ import '../../chunk-SKVPFN7M.mjs';
5
+ import '../../chunk-XYS6G2ZC.mjs';
6
+ import * as z from 'zod';
7
+
8
+ var COMMENTS_OVERLAY_RPC_CHANNEL_ID = "replo:comments-overlay-rpc";
9
+ var COMMENTS_OVERLAY_RPC_CHANNEL_VERSION = 1;
10
+ var MAX_OVERLAY_PINS = 500;
11
+ var commentOverlayPinSchema = z.strictObject({
12
+ threadId: z.string(),
13
+ anchor: commentAnchorSchema,
14
+ status: z.enum(["open", "resolved"]),
15
+ count: z.number().int().nonnegative()
16
+ }).describe("CommentOverlayPin");
17
+ var commentAnchorStatusSchema = z.enum(["attached", "ambiguous", "detached", "hidden"]).describe("CommentAnchorStatus");
18
+ var commentOverlayAnchorStatusSchema = z.strictObject({
19
+ threadId: z.string(),
20
+ status: commentAnchorStatusSchema
21
+ }).describe("CommentOverlayAnchorStatus");
22
+ var commentOverlayRectSchema = z.strictObject({
23
+ x: z.number(),
24
+ y: z.number(),
25
+ width: z.number(),
26
+ height: z.number()
27
+ }).describe("CommentOverlayRect");
28
+ var hostToCommentsOverlayMethodConfig = {
29
+ setCommentMode: {
30
+ inputSchema: z.strictObject({ mode: displayModeSchema }),
31
+ outputSchema: z.void()
32
+ },
33
+ setPins: {
34
+ inputSchema: z.strictObject({
35
+ pins: z.array(commentOverlayPinSchema).max(MAX_OVERLAY_PINS)
36
+ }),
37
+ outputSchema: z.void()
38
+ },
39
+ focusThread: {
40
+ inputSchema: z.strictObject({ threadId: z.string() }),
41
+ outputSchema: z.void()
42
+ },
43
+ clearDraft: {
44
+ inputSchema: z.undefined(),
45
+ outputSchema: z.void()
46
+ },
47
+ setDraftAnchor: {
48
+ inputSchema: z.strictObject({ anchor: commentAnchorSchema.nullable() }),
49
+ outputSchema: z.void()
50
+ }
51
+ };
52
+ var commentsOverlayToHostMethodConfig = {
53
+ overlayReady: {
54
+ inputSchema: z.undefined(),
55
+ outputSchema: z.void()
56
+ },
57
+ anchorPicked: {
58
+ inputSchema: z.strictObject({
59
+ anchor: commentAnchorElementSchema,
60
+ rect: commentOverlayRectSchema
61
+ }),
62
+ outputSchema: z.void()
63
+ },
64
+ pinClicked: {
65
+ inputSchema: z.strictObject({ threadId: z.string() }),
66
+ outputSchema: z.void()
67
+ },
68
+ anchorStatuses: {
69
+ inputSchema: z.strictObject({
70
+ statuses: z.array(commentOverlayAnchorStatusSchema).max(MAX_OVERLAY_PINS)
71
+ }),
72
+ outputSchema: z.void()
73
+ },
74
+ requestComposeFromSelection: {
75
+ inputSchema: z.strictObject({ anchor: commentAnchorElementSchema }),
76
+ outputSchema: z.void()
77
+ },
78
+ pickCancelled: {
79
+ inputSchema: z.undefined(),
80
+ outputSchema: z.void()
81
+ },
82
+ modeShortcut: {
83
+ inputSchema: z.strictObject({ mode: z.enum(["browse", "comment"]) }),
84
+ outputSchema: z.void()
85
+ },
86
+ locationChanged: {
87
+ inputSchema: z.strictObject({ url: z.string().max(2048) }),
88
+ outputSchema: z.void()
89
+ }
90
+ };
91
+
92
+ export { COMMENTS_OVERLAY_RPC_CHANNEL_ID, COMMENTS_OVERLAY_RPC_CHANNEL_VERSION, commentAnchorStatusSchema, commentOverlayAnchorStatusSchema, commentOverlayPinSchema, commentOverlayRectSchema, commentsOverlayToHostMethodConfig, hostToCommentsOverlayMethodConfig };
@@ -0,0 +1,237 @@
1
+ export type CommentSource = "ui" | "agent" | "mcp" | "api";
2
+ export type CommentAnchorContext = {
3
+ url: string;
4
+ locale?: string | null;
5
+ };
6
+ export type CommentAnchorNone = {
7
+ type: "none";
8
+ context?: CommentAnchorContext;
9
+ };
10
+ export type CommentAnchorElement = {
11
+ type: "element";
12
+ semanticSelector?: string;
13
+ selector: string;
14
+ nthOfTypePath: string;
15
+ source?: {
16
+ filePath: string;
17
+ componentChain: string[];
18
+ line?: number;
19
+ col?: number;
20
+ };
21
+ listKey?: string;
22
+ tagName: string;
23
+ textPreview: string;
24
+ quote?: {
25
+ exact: string;
26
+ prefix: string;
27
+ suffix: string;
28
+ };
29
+ offset: {
30
+ x: number;
31
+ y: number;
32
+ };
33
+ context?: CommentAnchorContext;
34
+ };
35
+ export type CommentAnchorCanvas = {
36
+ type: "canvas";
37
+ nodeId: string;
38
+ layerId?: string;
39
+ point: {
40
+ x: number;
41
+ y: number;
42
+ };
43
+ world?: {
44
+ x: number;
45
+ y: number;
46
+ };
47
+ };
48
+ export type CommentAnchorPoint = {
49
+ type: "point";
50
+ page?: number;
51
+ x: number;
52
+ y: number;
53
+ };
54
+ export type CommentAnchor = CommentAnchorNone | CommentAnchorElement | CommentAnchorCanvas | CommentAnchorPoint;
55
+ export type CommentTarget = {
56
+ kind: "file";
57
+ fileId: string;
58
+ folderId?: string;
59
+ } | {
60
+ kind: "sitePage";
61
+ siteId: string;
62
+ url: string;
63
+ locale?: string | null;
64
+ routePatternHint?: string;
65
+ via?: {
66
+ fileId: string;
67
+ shareId: string;
68
+ };
69
+ } | {
70
+ kind: "order";
71
+ orderId: string;
72
+ } | {
73
+ kind: "asset";
74
+ assetId: string;
75
+ };
76
+ export type CommentSurface = "artifact" | "canvas" | "image" | "markdown" | "pdf" | "file" | "websiteBuilder" | "embeddedPreview" | "orders" | "assets";
77
+ export type CommentAuthor = {
78
+ id: string;
79
+ name: string;
80
+ avatarUrl: string | null;
81
+ deleted: boolean;
82
+ };
83
+ export type Comment = {
84
+ id: string;
85
+ threadId: string;
86
+ authorUserId: string;
87
+ source: CommentSource;
88
+ body: string;
89
+ createdAt: string;
90
+ editedAt: string | null;
91
+ deletedAt: string | null;
92
+ };
93
+ export type CommentReaction = {
94
+ commentId: string;
95
+ userId: string;
96
+ emoji: string;
97
+ createdAt: string;
98
+ };
99
+ export type CommentThreadTarget = {
100
+ fileId?: string;
101
+ siteId?: string;
102
+ path?: string;
103
+ orderId?: string;
104
+ assetId?: string;
105
+ };
106
+ export type CommentThread = {
107
+ id: string;
108
+ projectId: string;
109
+ target: Partial<CommentThreadTarget>;
110
+ viaFileId: string | null;
111
+ viaFileName: string | null;
112
+ anchor: CommentAnchor;
113
+ resolvedAt: string | null;
114
+ resolvedByUserId: string | null;
115
+ resolvedSource: CommentSource | null;
116
+ createdAt: string;
117
+ updatedAt: string;
118
+ deletedAt: string | null;
119
+ };
120
+ export type CommentThreadBundle = {
121
+ threads: CommentThread[];
122
+ comments: Comment[];
123
+ reactions: CommentReaction[];
124
+ authors: CommentAuthor[];
125
+ viewer: CommentViewer;
126
+ };
127
+ export type CreateCommentThreadBody = {
128
+ id: string;
129
+ target: CommentTarget;
130
+ anchor: CommentAnchor;
131
+ body: {
132
+ id: string;
133
+ body: string;
134
+ };
135
+ };
136
+ export type UpdateCommentThreadBody = {
137
+ resolved?: boolean;
138
+ path?: string;
139
+ anchor?: CommentAnchor;
140
+ };
141
+ export type CreateCommentBody = {
142
+ id: string;
143
+ body: string;
144
+ };
145
+ export type UpdateCommentBody = {
146
+ body: string;
147
+ };
148
+ export type CommentThreadStatus = "open" | "resolved";
149
+ export type ListCommentThreadsQuery = {
150
+ fileId?: string;
151
+ folderId?: string;
152
+ siteId?: string;
153
+ path?: string;
154
+ locale?: string;
155
+ viaFileId?: string;
156
+ orderId?: string;
157
+ assetId?: string;
158
+ status?: CommentThreadStatus;
159
+ };
160
+ export type CommentThreadLocation = {
161
+ kind: "artifact" | "miniapp" | "commentsScreen" | "gone";
162
+ url?: string;
163
+ projectId?: string;
164
+ miniappId?: string;
165
+ miniappRoute?: string;
166
+ };
167
+ export type PresignCommentAttachmentBody = {
168
+ target: CommentTarget;
169
+ contentType: string;
170
+ contentLength: number;
171
+ };
172
+ export type PresignCommentAttachmentResponse = {
173
+ objectKey: string;
174
+ presignedPutUrl: string;
175
+ publicUrl: string;
176
+ };
177
+ export type CommitCommentAttachmentBody = {
178
+ target: CommentTarget;
179
+ objectKey: string;
180
+ };
181
+ export type CommitCommentAttachmentResponse = {
182
+ publicUrl: string;
183
+ };
184
+ export type CommentViewer = {
185
+ userId: string | null;
186
+ isMember: boolean;
187
+ canComment: boolean;
188
+ canModerate: boolean;
189
+ };
190
+ export type CommentSiteThreadPage = {
191
+ threads: CommentThread[];
192
+ comments: Comment[];
193
+ reactions: CommentReaction[];
194
+ authors: CommentAuthor[];
195
+ orphanedPaths: string[] | null;
196
+ nextCursor: string | null;
197
+ };
198
+ export type CommentSiteThreadSort = {
199
+ column: "page" | "excerpt" | "author" | "created" | "lastActivity" | "replies" | "status" | "from";
200
+ direction: "asc" | "desc";
201
+ };
202
+ export type CommentMentionPerson = {
203
+ id: string;
204
+ name: string;
205
+ avatarUrl: string | null;
206
+ };
207
+ export type MentionableDisplay = {
208
+ label: string;
209
+ imageUrl?: string;
210
+ };
211
+ export type MentionableResolution = {
212
+ state: "ok";
213
+ display: MentionableDisplay;
214
+ } | {
215
+ state: "forbidden";
216
+ category: string;
217
+ };
218
+ export type CommentThreadTargetSummary = {
219
+ kind: "file" | "sitePage" | "order" | "asset";
220
+ fileId?: string;
221
+ fileName?: string;
222
+ filePath?: string;
223
+ artifactFolderId?: string;
224
+ fileDeleted?: boolean;
225
+ siteId?: string;
226
+ path?: string;
227
+ url?: string;
228
+ orderId?: string;
229
+ assetId?: string;
230
+ };
231
+ export type CommentThreadDetail = {
232
+ thread: CommentThread;
233
+ comments: Comment[];
234
+ reactions: CommentReaction[];
235
+ authors: CommentAuthor[];
236
+ target: CommentThreadTargetSummary;
237
+ };
@@ -0,0 +1,18 @@
1
+ import type { CommentAnchor } from "./comments";
2
+ export type CommentOverlayPin = {
3
+ threadId: string;
4
+ anchor: CommentAnchor;
5
+ status: "open" | "resolved";
6
+ count: number;
7
+ };
8
+ export type CommentAnchorStatus = "attached" | "ambiguous" | "detached" | "hidden";
9
+ export type CommentOverlayAnchorStatus = {
10
+ threadId: string;
11
+ status: CommentAnchorStatus;
12
+ };
13
+ export type CommentOverlayRect = {
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ };