@immediately-run/sandbox-protocol 0.1.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.
@@ -0,0 +1,791 @@
1
+ {
2
+ "formatVersion": 1,
3
+ "repo": "sandpack-bundler",
4
+ "channels": {
5
+ "action": {
6
+ "kind": "message",
7
+ "direction": "app->host",
8
+ "payload": {
9
+ "fields": [
10
+ {
11
+ "name": "action",
12
+ "optional": false,
13
+ "type": "string"
14
+ },
15
+ {
16
+ "name": "column",
17
+ "optional": false,
18
+ "union": [
19
+ {
20
+ "type": "null"
21
+ },
22
+ {
23
+ "type": "number"
24
+ }
25
+ ]
26
+ },
27
+ {
28
+ "name": "line",
29
+ "optional": false,
30
+ "union": [
31
+ {
32
+ "type": "null"
33
+ },
34
+ {
35
+ "type": "number"
36
+ }
37
+ ]
38
+ },
39
+ {
40
+ "name": "message",
41
+ "optional": false,
42
+ "type": "string"
43
+ },
44
+ {
45
+ "name": "path",
46
+ "optional": false,
47
+ "type": "any"
48
+ },
49
+ {
50
+ "name": "payload",
51
+ "optional": false,
52
+ "fields": [
53
+ {
54
+ "name": "frames",
55
+ "optional": false,
56
+ "array": {
57
+ "type": "StackFrame"
58
+ }
59
+ }
60
+ ]
61
+ },
62
+ {
63
+ "name": "title",
64
+ "optional": false,
65
+ "type": "string"
66
+ }
67
+ ]
68
+ },
69
+ "sites": [
70
+ "src/index.ts"
71
+ ]
72
+ },
73
+ "api-catalog": {
74
+ "kind": "push",
75
+ "direction": "host->app",
76
+ "poll": "request-api-catalog",
77
+ "payload": {
78
+ "fields": [
79
+ {
80
+ "name": "methods",
81
+ "optional": false,
82
+ "array": {
83
+ "fields": [
84
+ {
85
+ "name": "capability",
86
+ "optional": false,
87
+ "type": "string"
88
+ },
89
+ {
90
+ "name": "name",
91
+ "optional": false,
92
+ "type": "string"
93
+ },
94
+ {
95
+ "name": "stream",
96
+ "optional": true,
97
+ "type": "boolean | undefined"
98
+ }
99
+ ]
100
+ }
101
+ }
102
+ ],
103
+ "reads": [
104
+ "methods"
105
+ ]
106
+ },
107
+ "sites": [
108
+ "src/catalog/CatalogService.ts",
109
+ "src/catalog/catalogState.ts"
110
+ ]
111
+ },
112
+ "artifact-distrust": {
113
+ "kind": "message",
114
+ "direction": "app->host",
115
+ "payload": {
116
+ "fields": [
117
+ {
118
+ "name": "commitSha",
119
+ "optional": false,
120
+ "union": [
121
+ {
122
+ "type": "null"
123
+ },
124
+ {
125
+ "type": "string"
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ "name": "reason",
131
+ "optional": false,
132
+ "type": "string"
133
+ }
134
+ ]
135
+ },
136
+ "sites": [
137
+ "src/bundler/bundler.ts"
138
+ ]
139
+ },
140
+ "auth-state": {
141
+ "kind": "push",
142
+ "direction": "host->app",
143
+ "poll": "request-auth-state",
144
+ "payload": {
145
+ "reads": [
146
+ "state"
147
+ ]
148
+ },
149
+ "sites": [
150
+ "src/auth/AuthService.ts"
151
+ ]
152
+ },
153
+ "console": {
154
+ "kind": "message",
155
+ "direction": "app->host",
156
+ "payload": {
157
+ "fields": [
158
+ {
159
+ "name": "log",
160
+ "optional": false,
161
+ "type": "any"
162
+ }
163
+ ]
164
+ },
165
+ "sites": [
166
+ "src/index.ts"
167
+ ]
168
+ },
169
+ "done": {
170
+ "kind": "message",
171
+ "direction": "app->host",
172
+ "payload": {
173
+ "fields": [
174
+ {
175
+ "name": "compilatonError",
176
+ "optional": false,
177
+ "type": "boolean"
178
+ }
179
+ ]
180
+ },
181
+ "sites": [
182
+ "src/index.ts"
183
+ ]
184
+ },
185
+ "editor-context": {
186
+ "kind": "push",
187
+ "direction": "host->app",
188
+ "poll": "request-editor-context",
189
+ "payload": {
190
+ "fields": [
191
+ {
192
+ "name": "activeFile",
193
+ "optional": true,
194
+ "union": [
195
+ {
196
+ "type": "null"
197
+ },
198
+ {
199
+ "type": "string"
200
+ },
201
+ {
202
+ "type": "undefined"
203
+ }
204
+ ]
205
+ },
206
+ {
207
+ "name": "dirtyPaths",
208
+ "optional": false,
209
+ "array": {
210
+ "type": "string"
211
+ }
212
+ }
213
+ ],
214
+ "reads": [
215
+ "activeFile",
216
+ "dirtyPaths"
217
+ ]
218
+ },
219
+ "sites": [
220
+ "src/editor/EditorContextService.ts",
221
+ "src/editor/editorContextState.ts"
222
+ ],
223
+ "divergent": true,
224
+ "divergentNote": "declared-incomplete — the host (site-main channelBridge.ts) sends {dirtyPaths, openFiles, activeFile, viewedFile}; this side declares only {dirtyPaths, activeFile?} while the SDK reads all four. `viewedFile` (R3-268) and `openFiles` never entered this declaration. R3-274e picks one shape for both sides."
225
+ },
226
+ "evaluate": {
227
+ "kind": "message",
228
+ "direction": "host->app",
229
+ "payload": {
230
+ "reads": [
231
+ "command"
232
+ ]
233
+ },
234
+ "sites": [
235
+ "src/index.ts"
236
+ ]
237
+ },
238
+ "form-factor": {
239
+ "kind": "push",
240
+ "direction": "host->app",
241
+ "poll": "request-form-factor",
242
+ "payload": {
243
+ "reads": [
244
+ "formFactor"
245
+ ]
246
+ },
247
+ "sites": [
248
+ "src/formFactor/FormFactorService.ts"
249
+ ]
250
+ },
251
+ "fs-change": {
252
+ "kind": "message",
253
+ "direction": "host->app",
254
+ "payload": {
255
+ "reads": [
256
+ "paths"
257
+ ]
258
+ },
259
+ "sites": [
260
+ "src/index.ts"
261
+ ],
262
+ "divergent": true,
263
+ "divergentNote": "subset-reads with no declared owner on either side — the host sends {paths, epoch}; this side reads only `paths`, the SDK reads both. Nothing forces the two to agree, which is the divergence PLATFORM_LAYERING_SPEC §2 names as the exemplar. The `kind` also differs (message here, push channel in the SDK). R3-274e decides: keep `epoch` or drop it."
264
+ },
265
+ "initialized": {
266
+ "kind": "message",
267
+ "direction": "app->host",
268
+ "payload": {
269
+ "fields": []
270
+ },
271
+ "sites": [
272
+ "src/index.ts"
273
+ ]
274
+ },
275
+ "ir-marker": {
276
+ "kind": "message",
277
+ "direction": "app->host",
278
+ "payload": {
279
+ "fields": [
280
+ {
281
+ "name": "at",
282
+ "optional": false,
283
+ "type": "number"
284
+ },
285
+ {
286
+ "name": "attrs",
287
+ "optional": true,
288
+ "union": [
289
+ {
290
+ "type": "Record<string, unknown>"
291
+ },
292
+ {
293
+ "type": "undefined"
294
+ }
295
+ ]
296
+ },
297
+ {
298
+ "name": "name",
299
+ "optional": false,
300
+ "type": "string"
301
+ }
302
+ ]
303
+ },
304
+ "sites": [
305
+ "src/bundler/perfMarkers.ts"
306
+ ]
307
+ },
308
+ "mount-add": {
309
+ "kind": "message",
310
+ "direction": "host->app",
311
+ "payload": {
312
+ "reads": [
313
+ "mount",
314
+ "ports"
315
+ ]
316
+ },
317
+ "sites": [
318
+ "src/index.ts",
319
+ "src/protocol/iframe.ts"
320
+ ]
321
+ },
322
+ "mount-remove": {
323
+ "kind": "message",
324
+ "direction": "host->app",
325
+ "payload": {
326
+ "reads": [
327
+ "id",
328
+ "path",
329
+ "reason"
330
+ ]
331
+ },
332
+ "sites": [
333
+ "src/index.ts"
334
+ ]
335
+ },
336
+ "refresh": {
337
+ "kind": "message",
338
+ "direction": "both",
339
+ "payload": {
340
+ "fields": []
341
+ },
342
+ "sites": [
343
+ "src/index.ts"
344
+ ]
345
+ },
346
+ "register-frame": {
347
+ "kind": "message",
348
+ "direction": "host->app",
349
+ "payload": {
350
+ "reads": [
351
+ "dirtyPaths",
352
+ "distrustArtifacts",
353
+ "fsSnapshot",
354
+ "id",
355
+ "logLevel",
356
+ "region",
357
+ "sdkIntegrity",
358
+ "template"
359
+ ]
360
+ },
361
+ "sites": [
362
+ "src/protocol/iframe.ts"
363
+ ]
364
+ },
365
+ "repo-mount": {
366
+ "kind": "push",
367
+ "direction": "host->app",
368
+ "poll": "request-repo-mount",
369
+ "payload": {
370
+ "reads": [
371
+ "path",
372
+ "uri"
373
+ ]
374
+ },
375
+ "sites": [
376
+ "src/index.ts"
377
+ ]
378
+ },
379
+ "request-api-catalog": {
380
+ "kind": "poll",
381
+ "direction": "app->host",
382
+ "payload": {
383
+ "fields": []
384
+ },
385
+ "sites": [
386
+ "src/index.ts"
387
+ ]
388
+ },
389
+ "request-auth-state": {
390
+ "kind": "poll",
391
+ "direction": "app->host",
392
+ "payload": {
393
+ "fields": []
394
+ },
395
+ "sites": [
396
+ "src/index.ts"
397
+ ]
398
+ },
399
+ "request-editor-context": {
400
+ "kind": "poll",
401
+ "direction": "app->host",
402
+ "payload": {
403
+ "fields": []
404
+ },
405
+ "sites": [
406
+ "src/index.ts"
407
+ ]
408
+ },
409
+ "request-form-factor": {
410
+ "kind": "poll",
411
+ "direction": "app->host",
412
+ "payload": {
413
+ "fields": []
414
+ },
415
+ "sites": [
416
+ "src/index.ts"
417
+ ]
418
+ },
419
+ "request-handshake": {
420
+ "kind": "message",
421
+ "direction": "host->app",
422
+ "payload": {},
423
+ "sites": [
424
+ "src/index.ts"
425
+ ]
426
+ },
427
+ "request-mounts": {
428
+ "kind": "message",
429
+ "direction": "app->host",
430
+ "payload": {
431
+ "fields": []
432
+ },
433
+ "sites": [
434
+ "src/index.ts"
435
+ ]
436
+ },
437
+ "request-repo-mount": {
438
+ "kind": "poll",
439
+ "direction": "app->host",
440
+ "payload": {
441
+ "fields": []
442
+ },
443
+ "sites": [
444
+ "src/index.ts"
445
+ ]
446
+ },
447
+ "request-theme": {
448
+ "kind": "poll",
449
+ "direction": "app->host",
450
+ "payload": {
451
+ "fields": []
452
+ },
453
+ "sites": [
454
+ "src/index.ts"
455
+ ]
456
+ },
457
+ "request-vcs-state": {
458
+ "kind": "poll",
459
+ "direction": "app->host",
460
+ "payload": {
461
+ "fields": []
462
+ },
463
+ "sites": [
464
+ "src/index.ts"
465
+ ]
466
+ },
467
+ "resize": {
468
+ "kind": "message",
469
+ "direction": "app->host",
470
+ "payload": {
471
+ "fields": [
472
+ {
473
+ "name": "height",
474
+ "optional": false,
475
+ "type": "number"
476
+ }
477
+ ]
478
+ },
479
+ "sites": [
480
+ "src/index.ts"
481
+ ]
482
+ },
483
+ "sdk-handshake": {
484
+ "kind": "message",
485
+ "direction": "app->host",
486
+ "payload": {
487
+ "fields": [
488
+ {
489
+ "name": "protocolVersion",
490
+ "optional": false,
491
+ "type": "string"
492
+ },
493
+ {
494
+ "name": "sandboxProtocolVersion",
495
+ "optional": false,
496
+ "type": "string"
497
+ }
498
+ ]
499
+ },
500
+ "sites": [
501
+ "src/index.ts"
502
+ ],
503
+ "divergent": true,
504
+ "divergentNote": "divergent-declared — TWO producers of one name with different payloads: this frame announces {protocolVersion, sandboxProtocolVersion}, the SDK announces {protocolVersion, sdkVersion}. R3-274d gave the frame its own SANDBOX_PROTOCOL_VERSION (announced additively; the host logs it, fail-open) and retired the sibling-checkout read that used to source `protocolVersion`. R3-274e picks one shape."
505
+ },
506
+ "start": {
507
+ "kind": "message",
508
+ "direction": "app->host",
509
+ "payload": {
510
+ "fields": [
511
+ {
512
+ "name": "firstLoad",
513
+ "optional": false,
514
+ "type": "boolean"
515
+ }
516
+ ]
517
+ },
518
+ "sites": [
519
+ "src/index.ts"
520
+ ]
521
+ },
522
+ "state": {
523
+ "kind": "message",
524
+ "direction": "app->host",
525
+ "payload": {
526
+ "fields": [
527
+ {
528
+ "name": "state",
529
+ "optional": false,
530
+ "fields": [
531
+ {
532
+ "name": "transpiledModules",
533
+ "optional": false,
534
+ "type": "{ [x: string]: { source: { isEntry: boolean; fileName: string; compiledCode: string | null; }; }; }"
535
+ }
536
+ ]
537
+ }
538
+ ]
539
+ },
540
+ "sites": [
541
+ "src/bundler/bundler.ts"
542
+ ]
543
+ },
544
+ "status": {
545
+ "kind": "message",
546
+ "direction": "app->host",
547
+ "payload": {
548
+ "fields": [
549
+ {
550
+ "name": "status",
551
+ "optional": false,
552
+ "union": [
553
+ {
554
+ "type": "\"evaluating\""
555
+ },
556
+ {
557
+ "type": "\"idle\""
558
+ },
559
+ {
560
+ "type": "\"initializing\""
561
+ },
562
+ {
563
+ "type": "\"installing-dependencies\""
564
+ },
565
+ {
566
+ "type": "\"running-tests\""
567
+ },
568
+ {
569
+ "type": "\"transpiling\""
570
+ }
571
+ ]
572
+ }
573
+ ]
574
+ },
575
+ "sites": [
576
+ "src/index.ts"
577
+ ]
578
+ },
579
+ "success": {
580
+ "kind": "message",
581
+ "direction": "app->host",
582
+ "payload": {
583
+ "fields": []
584
+ },
585
+ "sites": [
586
+ "src/index.ts"
587
+ ]
588
+ },
589
+ "theme": {
590
+ "kind": "push",
591
+ "direction": "host->app",
592
+ "poll": "request-theme",
593
+ "payload": {
594
+ "fields": [
595
+ {
596
+ "name": "theme",
597
+ "optional": false,
598
+ "union": [
599
+ {
600
+ "type": "\"dark\""
601
+ },
602
+ {
603
+ "type": "\"light\""
604
+ }
605
+ ]
606
+ }
607
+ ],
608
+ "reads": [
609
+ "theme"
610
+ ]
611
+ },
612
+ "sites": [
613
+ "src/theme/ThemeService.ts",
614
+ "src/theme/themeState.ts"
615
+ ]
616
+ },
617
+ "vcs-state": {
618
+ "kind": "push",
619
+ "direction": "host->app",
620
+ "poll": "request-vcs-state",
621
+ "payload": {
622
+ "fields": [
623
+ {
624
+ "name": "branch",
625
+ "optional": true,
626
+ "union": [
627
+ {
628
+ "fields": [
629
+ {
630
+ "name": "name",
631
+ "optional": false,
632
+ "type": "string"
633
+ },
634
+ {
635
+ "name": "parentCommitSha",
636
+ "optional": false,
637
+ "type": "string"
638
+ },
639
+ {
640
+ "name": "parentRef",
641
+ "optional": false,
642
+ "type": "string"
643
+ },
644
+ {
645
+ "name": "parentRepo",
646
+ "optional": false,
647
+ "type": "string"
648
+ },
649
+ {
650
+ "name": "upstreamPushable",
651
+ "optional": false,
652
+ "type": "boolean | null"
653
+ }
654
+ ]
655
+ },
656
+ {
657
+ "type": "null"
658
+ },
659
+ {
660
+ "type": "undefined"
661
+ }
662
+ ]
663
+ },
664
+ {
665
+ "name": "changes",
666
+ "optional": false,
667
+ "array": {
668
+ "fields": [
669
+ {
670
+ "name": "path",
671
+ "optional": false,
672
+ "type": "string"
673
+ },
674
+ {
675
+ "name": "status",
676
+ "optional": false,
677
+ "type": "\"created\" | \"modified\" | \"deleted\""
678
+ }
679
+ ]
680
+ }
681
+ },
682
+ {
683
+ "name": "diffLoading",
684
+ "optional": true,
685
+ "union": [
686
+ {
687
+ "type": "false"
688
+ },
689
+ {
690
+ "type": "true"
691
+ },
692
+ {
693
+ "type": "undefined"
694
+ }
695
+ ]
696
+ },
697
+ {
698
+ "name": "prs",
699
+ "optional": true,
700
+ "union": [
701
+ {
702
+ "array": {
703
+ "type": "VcsPR"
704
+ }
705
+ },
706
+ {
707
+ "type": "undefined"
708
+ }
709
+ ]
710
+ }
711
+ ],
712
+ "reads": [
713
+ "branch",
714
+ "changes",
715
+ "diffLoading",
716
+ "prs"
717
+ ]
718
+ },
719
+ "sites": [
720
+ "src/vcs/VcsService.ts",
721
+ "src/vcs/vcsState.ts"
722
+ ]
723
+ }
724
+ },
725
+ "dynamicFamilies": {
726
+ "protocol-<scheme>": {
727
+ "schemes": [],
728
+ "sites": [
729
+ "src/protocol/iframe.ts"
730
+ ]
731
+ }
732
+ },
733
+ "envelopes": {
734
+ "outbound": {
735
+ "fields": [
736
+ {
737
+ "name": "$id",
738
+ "optional": false,
739
+ "union": [
740
+ {
741
+ "type": "null"
742
+ },
743
+ {
744
+ "type": "number"
745
+ }
746
+ ]
747
+ },
748
+ {
749
+ "name": "codesandbox",
750
+ "optional": false,
751
+ "type": "boolean"
752
+ },
753
+ {
754
+ "name": "type",
755
+ "optional": false,
756
+ "type": "string"
757
+ }
758
+ ]
759
+ },
760
+ "protocolRequest": {
761
+ "fields": [
762
+ {
763
+ "name": "method",
764
+ "optional": false,
765
+ "type": "string"
766
+ },
767
+ {
768
+ "name": "msgId",
769
+ "optional": false,
770
+ "type": "number"
771
+ },
772
+ {
773
+ "name": "params",
774
+ "optional": false,
775
+ "array": {
776
+ "type": "any"
777
+ }
778
+ }
779
+ ]
780
+ },
781
+ "protocolReply": {
782
+ "reads": [
783
+ "error",
784
+ "method",
785
+ "msgId",
786
+ "result",
787
+ "type"
788
+ ]
789
+ }
790
+ }
791
+ }