@kubohiroya/turbowarp-http-server 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.
Files changed (63) hide show
  1. package/LICENSE +373 -0
  2. package/README.ja.md +346 -0
  3. package/README.md +874 -0
  4. package/dist/auth/digest-file.d.ts +17 -0
  5. package/dist/auth/digest-file.js +90 -0
  6. package/dist/auth/digest-file.js.map +1 -0
  7. package/dist/auth/digest.d.ts +23 -0
  8. package/dist/auth/digest.js +139 -0
  9. package/dist/auth/digest.js.map +1 -0
  10. package/dist/cli.d.ts +1 -0
  11. package/dist/cli.js +156 -0
  12. package/dist/cli.js.map +1 -0
  13. package/dist/community.d.ts +81 -0
  14. package/dist/community.js +689 -0
  15. package/dist/community.js.map +1 -0
  16. package/dist/digest-cli.d.ts +1 -0
  17. package/dist/digest-cli.js +159 -0
  18. package/dist/digest-cli.js.map +1 -0
  19. package/dist/extension-manifest.json +441 -0
  20. package/dist/protocol.d.ts +59 -0
  21. package/dist/protocol.js +71 -0
  22. package/dist/protocol.js.map +1 -0
  23. package/dist/server.d.ts +89 -0
  24. package/dist/server.js +650 -0
  25. package/dist/server.js.map +1 -0
  26. package/dist/turbowarp-http-server.js +1110 -0
  27. package/docs/deployment-targets.ja.md +274 -0
  28. package/docs/turbowarp-http-server.architecture.html +15149 -0
  29. package/docs/turbowarp-http-server.architecture.json +1014 -0
  30. package/docs/turbowarp-http-server.architecture.visual-check.1440x900.dark.png +0 -0
  31. package/docs/turbowarp-http-server.architecture.visual-check.1440x900.light.png +0 -0
  32. package/docs/turbowarp-http-server.architecture.visual-check.2048x1320.dark.png +0 -0
  33. package/docs/turbowarp-http-server.architecture.visual-check.2048x1320.light.png +0 -0
  34. package/docs/turbowarp-http-server.architecture.visual-check.html +32 -0
  35. package/docs/turbowarp-http-server.architecture.visual-check.json +547 -0
  36. package/examples/01-hello-form/README.ja.md +46 -0
  37. package/examples/01-hello-form/server.mjs +59 -0
  38. package/examples/02-visitor-counter/README.ja.md +39 -0
  39. package/examples/02-visitor-counter/server.mjs +44 -0
  40. package/examples/03-message-board/README.ja.md +47 -0
  41. package/examples/03-message-board/server.mjs +72 -0
  42. package/examples/04-image-upload/README.ja.md +46 -0
  43. package/examples/04-image-upload/server.mjs +149 -0
  44. package/examples/05-live-camera/README.ja.md +47 -0
  45. package/examples/05-live-camera/server.mjs +147 -0
  46. package/examples/06-scratch-like-community/README.ja.md +82 -0
  47. package/examples/06-scratch-like-community/server.mjs +17 -0
  48. package/examples/README.ja.md +20 -0
  49. package/package.json +75 -0
  50. package/schemas/extension-manifest.schema.json +49 -0
  51. package/src/auth/digest-file.ts +115 -0
  52. package/src/auth/digest.ts +170 -0
  53. package/src/block-definitions.json +417 -0
  54. package/src/cli.ts +172 -0
  55. package/src/community.ts +815 -0
  56. package/src/config.ts +12 -0
  57. package/src/digest-cli.ts +178 -0
  58. package/src/extension-manifest.ts +149 -0
  59. package/src/extension.ts +713 -0
  60. package/src/globals.d.ts +30 -0
  61. package/src/index.ts +8 -0
  62. package/src/protocol.ts +132 -0
  63. package/src/server.ts +880 -0
@@ -0,0 +1,1014 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "architecture",
4
+ "meta": {
5
+ "title": "TurboWarp-HTTP-Server Detailed Architecture",
6
+ "output": "turbowarp-http-server.architecture.html",
7
+ "quality_profile": "standard",
8
+ "repository": {
9
+ "url": "https://github.com/kubohiroya/turbowarp-http-server",
10
+ "revision": "078a72ee1975cb678c9ed7175520f25b262a4f7a"
11
+ },
12
+ "viewBox": [
13
+ 1390,
14
+ 560
15
+ ],
16
+ "views": [
17
+ {
18
+ "id": "server-path",
19
+ "label": "Server request path",
20
+ "focus": [
21
+ "http-clients",
22
+ "cli-entry",
23
+ "node-server",
24
+ "hono-router",
25
+ "route-dispatch",
26
+ "bridge-message",
27
+ "ws-bridge",
28
+ "tw-runtime"
29
+ ],
30
+ "note": "HTTP requests are accepted by Hono, normalized, and forwarded to one localhost TurboWarp WebSocket peer."
31
+ },
32
+ {
33
+ "id": "resource-path",
34
+ "label": "Resource path",
35
+ "focus": [
36
+ "http-clients",
37
+ "route-dispatch",
38
+ "asset-router",
39
+ "resource-auth",
40
+ "body-limits",
41
+ "cache-metadata",
42
+ "resource-capability"
43
+ ],
44
+ "note": "/@assets requests remain server-side and are mediated by limits, authorization, metadata, and a pluggable capability."
45
+ },
46
+ {
47
+ "id": "extension-path",
48
+ "label": "Extension runtime",
49
+ "focus": [
50
+ "extension-entry",
51
+ "block-defs",
52
+ "ws-client",
53
+ "request-contexts",
54
+ "response-builder",
55
+ "content-builders",
56
+ "scratch-vm"
57
+ ],
58
+ "note": "The unsandboxed extension converts protocol messages into Scratch block state and sends validated responses back."
59
+ },
60
+ {
61
+ "id": "community-path",
62
+ "label": "Community app",
63
+ "focus": [
64
+ "community-router",
65
+ "session-csrf",
66
+ "password-auth",
67
+ "upload-validation",
68
+ "community-storage",
69
+ "oauth-provider"
70
+ ],
71
+ "note": "The learning-only app is optional and keeps demo auth, upload validation, and in-memory state separate from bridge forwarding."
72
+ },
73
+ {
74
+ "id": "build-path",
75
+ "label": "Build and verification",
76
+ "focus": [
77
+ "block-defs",
78
+ "extension-entry",
79
+ "tw-runtime"
80
+ ],
81
+ "note": "Vite, TypeScript, Vitest, ESLint, docs scripts, and manifest generation sit around the runtime graph rather than on the request path."
82
+ }
83
+ ]
84
+ },
85
+ "components": [
86
+ {
87
+ "id": "http-clients",
88
+ "type": "external",
89
+ "label": "HTTP Clients",
90
+ "sublabel": "Browser/fetch/LAN",
91
+ "tag": "untrusted input",
92
+ "pos": [
93
+ 25,
94
+ 180
95
+ ],
96
+ "size": [
97
+ 130,
98
+ 38
99
+ ],
100
+ "sources": [
101
+ {
102
+ "path": "README.md",
103
+ "line": 45,
104
+ "label": "Routes"
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ "id": "tw-runtime",
110
+ "type": "external",
111
+ "label": "TW Runtime",
112
+ "sublabel": "Desktop/Web",
113
+ "tag": "unsandboxed",
114
+ "pos": [
115
+ 1213,
116
+ 180
117
+ ],
118
+ "size": [
119
+ 130,
120
+ 38
121
+ ],
122
+ "sources": [
123
+ {
124
+ "path": "README.md",
125
+ "line": 12,
126
+ "end_line": 15,
127
+ "label": "Requirement"
128
+ }
129
+ ]
130
+ },
131
+ {
132
+ "id": "resource-capability",
133
+ "type": "external",
134
+ "label": "Resource Cap.",
135
+ "sublabel": "Asset adapter",
136
+ "tag": "snapshot API",
137
+ "pos": [
138
+ 188,
139
+ 310
140
+ ],
141
+ "size": [
142
+ 130,
143
+ 38
144
+ ],
145
+ "sources": [
146
+ {
147
+ "path": "src/server.ts",
148
+ "line": 82,
149
+ "end_line": 89,
150
+ "label": "Interface"
151
+ }
152
+ ]
153
+ },
154
+ {
155
+ "id": "oauth-provider",
156
+ "type": "external",
157
+ "label": "OAuth Provider",
158
+ "sublabel": "Demo auth URL",
159
+ "tag": "optional",
160
+ "pos": [
161
+ 188,
162
+ 439
163
+ ],
164
+ "size": [
165
+ 130,
166
+ 38
167
+ ],
168
+ "sources": [
169
+ {
170
+ "path": "src/community.ts",
171
+ "line": 158,
172
+ "end_line": 201,
173
+ "label": "OAuth routes"
174
+ }
175
+ ]
176
+ },
177
+ {
178
+ "id": "cli-entry",
179
+ "type": "backend",
180
+ "label": "CLI Entrypoint",
181
+ "sublabel": "--host, --port",
182
+ "tag": "src/cli.ts",
183
+ "pos": [
184
+ 188,
185
+ 50
186
+ ],
187
+ "size": [
188
+ 130,
189
+ 38
190
+ ],
191
+ "sources": [
192
+ {
193
+ "path": "src/cli.ts",
194
+ "line": 17,
195
+ "end_line": 21,
196
+ "label": "Start"
197
+ }
198
+ ]
199
+ },
200
+ {
201
+ "id": "digest-files",
202
+ "type": "database",
203
+ "label": "htdigest File",
204
+ "sublabel": "HA1 store",
205
+ "tag": "0600 rename",
206
+ "pos": [
207
+ 350,
208
+ 50
209
+ ],
210
+ "size": [
211
+ 130,
212
+ 38
213
+ ],
214
+ "sources": [
215
+ {
216
+ "path": "src/auth/digest-file.ts",
217
+ "line": 11,
218
+ "end_line": 52,
219
+ "label": "Store"
220
+ }
221
+ ]
222
+ },
223
+ {
224
+ "id": "node-server",
225
+ "type": "backend",
226
+ "label": "Node Server",
227
+ "sublabel": "@hono/node-server",
228
+ "tag": "HTTP/HTTPS",
229
+ "pos": [
230
+ 188,
231
+ 180
232
+ ],
233
+ "size": [
234
+ 130,
235
+ 38
236
+ ],
237
+ "sources": [
238
+ {
239
+ "path": "src/server.ts",
240
+ "line": 212,
241
+ "end_line": 222,
242
+ "label": "serve"
243
+ }
244
+ ]
245
+ },
246
+ {
247
+ "id": "digest-auth",
248
+ "type": "security",
249
+ "label": "Digest Auth",
250
+ "sublabel": "MD5 nonce",
251
+ "tag": "optional",
252
+ "pos": [
253
+ 350,
254
+ 252
255
+ ],
256
+ "size": [
257
+ 130,
258
+ 38
259
+ ],
260
+ "sources": [
261
+ {
262
+ "path": "src/auth/digest.ts",
263
+ "line": 36,
264
+ "end_line": 75,
265
+ "label": "Verify"
266
+ }
267
+ ]
268
+ },
269
+ {
270
+ "id": "hono-router",
271
+ "type": "backend",
272
+ "label": "Hono Router",
273
+ "sublabel": "/health /ws app.all",
274
+ "tag": "src/server.ts",
275
+ "pos": [
276
+ 350,
277
+ 180
278
+ ],
279
+ "size": [
280
+ 130,
281
+ 38
282
+ ],
283
+ "sources": [
284
+ {
285
+ "path": "src/server.ts",
286
+ "line": 138,
287
+ "end_line": 209,
288
+ "label": "App"
289
+ }
290
+ ]
291
+ },
292
+ {
293
+ "id": "route-dispatch",
294
+ "type": "backend",
295
+ "label": "Route Dispatch",
296
+ "sublabel": "assets then bridge",
297
+ "tag": "app.all('*')",
298
+ "pos": [
299
+ 513,
300
+ 180
301
+ ],
302
+ "size": [
303
+ 130,
304
+ 38
305
+ ],
306
+ "sources": [
307
+ {
308
+ "path": "src/server.ts",
309
+ "line": 182,
310
+ "end_line": 207,
311
+ "label": "Fallback"
312
+ }
313
+ ]
314
+ },
315
+ {
316
+ "id": "bridge-message",
317
+ "type": "backend",
318
+ "label": "Bridge Message",
319
+ "sublabel": "route/query/header/body",
320
+ "tag": "protocol v1",
321
+ "pos": [
322
+ 675,
323
+ 180
324
+ ],
325
+ "size": [
326
+ 145,
327
+ 38
328
+ ],
329
+ "sources": [
330
+ {
331
+ "path": "src/server.ts",
332
+ "line": 382,
333
+ "end_line": 410,
334
+ "label": "Request"
335
+ },
336
+ {
337
+ "path": "src/protocol.ts",
338
+ "line": 27,
339
+ "end_line": 42,
340
+ "label": "Schema"
341
+ }
342
+ ]
343
+ },
344
+ {
345
+ "id": "ws-bridge",
346
+ "type": "messagebus",
347
+ "label": "WS Bridge",
348
+ "sublabel": "pending + timeout",
349
+ "tag": "single socket",
350
+ "pos": [
351
+ 850,
352
+ 180
353
+ ],
354
+ "size": [
355
+ 130,
356
+ 38
357
+ ],
358
+ "sources": [
359
+ {
360
+ "path": "src/server.ts",
361
+ "line": 279,
362
+ "end_line": 361,
363
+ "label": "Bridge"
364
+ }
365
+ ]
366
+ },
367
+ {
368
+ "id": "ws-upgrade",
369
+ "type": "security",
370
+ "label": "WS Upgrade Gate",
371
+ "sublabel": "/ws loopback",
372
+ "tag": "noServer",
373
+ "pos": [
374
+ 850,
375
+ 115
376
+ ],
377
+ "size": [
378
+ 130,
379
+ 38
380
+ ],
381
+ "sources": [
382
+ {
383
+ "path": "src/server.ts",
384
+ "line": 224,
385
+ "end_line": 251,
386
+ "label": "Upgrade"
387
+ }
388
+ ]
389
+ },
390
+ {
391
+ "id": "asset-router",
392
+ "type": "backend",
393
+ "label": "Asset Router",
394
+ "sublabel": "/@assets dispatch",
395
+ "tag": "global ns",
396
+ "pos": [
397
+ 675,
398
+ 310
399
+ ],
400
+ "size": [
401
+ 130,
402
+ 38
403
+ ],
404
+ "sources": [
405
+ {
406
+ "path": "src/server.ts",
407
+ "line": 557,
408
+ "end_line": 592,
409
+ "label": "Asset dispatch"
410
+ }
411
+ ]
412
+ },
413
+ {
414
+ "id": "resource-auth",
415
+ "type": "security",
416
+ "label": "Resource Auth",
417
+ "sublabel": "operation hook",
418
+ "tag": "get/put/list",
419
+ "pos": [
420
+ 513,
421
+ 310
422
+ ],
423
+ "size": [
424
+ 130,
425
+ 38
426
+ ],
427
+ "sources": [
428
+ {
429
+ "path": "src/server.ts",
430
+ "line": 836,
431
+ "end_line": 844,
432
+ "label": "Authorize"
433
+ }
434
+ ]
435
+ },
436
+ {
437
+ "id": "body-limits",
438
+ "type": "security",
439
+ "label": "Body Limits",
440
+ "sublabel": "text/binary caps",
441
+ "tag": "413",
442
+ "pos": [
443
+ 513,
444
+ 374
445
+ ],
446
+ "size": [
447
+ 130,
448
+ 38
449
+ ],
450
+ "sources": [
451
+ {
452
+ "path": "src/server.ts",
453
+ "line": 463,
454
+ "end_line": 478,
455
+ "label": "Text body"
456
+ },
457
+ {
458
+ "path": "src/server.ts",
459
+ "line": 809,
460
+ "end_line": 833,
461
+ "label": "Binary body"
462
+ }
463
+ ]
464
+ },
465
+ {
466
+ "id": "cache-metadata",
467
+ "type": "backend",
468
+ "label": "Cache Metadata",
469
+ "sublabel": "ETag/Modified",
470
+ "tag": "304/no-store",
471
+ "pos": [
472
+ 350,
473
+ 310
474
+ ],
475
+ "size": [
476
+ 130,
477
+ 38
478
+ ],
479
+ "sources": [
480
+ {
481
+ "path": "src/server.ts",
482
+ "line": 766,
483
+ "end_line": 807,
484
+ "label": "Headers"
485
+ }
486
+ ]
487
+ },
488
+ {
489
+ "id": "extension-entry",
490
+ "type": "frontend",
491
+ "label": "Extension Entry",
492
+ "sublabel": "register check",
493
+ "tag": "src/index.ts",
494
+ "pos": [
495
+ 1000,
496
+ 50
497
+ ],
498
+ "size": [
499
+ 130,
500
+ 38
501
+ ],
502
+ "sources": [
503
+ {
504
+ "path": "src/index.ts",
505
+ "line": 1,
506
+ "end_line": 8,
507
+ "label": "Register"
508
+ }
509
+ ]
510
+ },
511
+ {
512
+ "id": "block-defs",
513
+ "type": "frontend",
514
+ "label": "Block Defs",
515
+ "sublabel": "JSON -> blocks",
516
+ "tag": "opcodes",
517
+ "pos": [
518
+ 1163,
519
+ 50
520
+ ],
521
+ "size": [
522
+ 130,
523
+ 38
524
+ ],
525
+ "sources": [
526
+ {
527
+ "path": "src/block-definitions.json",
528
+ "line": 1,
529
+ "label": "Definitions"
530
+ },
531
+ {
532
+ "path": "src/extension.ts",
533
+ "line": 116,
534
+ "end_line": 123,
535
+ "label": "getInfo"
536
+ }
537
+ ]
538
+ },
539
+ {
540
+ "id": "ws-client",
541
+ "type": "frontend",
542
+ "label": "WS Client",
543
+ "sublabel": "connect/send",
544
+ "tag": "WebSocket",
545
+ "pos": [
546
+ 1013,
547
+ 180
548
+ ],
549
+ "size": [
550
+ 130,
551
+ 38
552
+ ],
553
+ "sources": [
554
+ {
555
+ "path": "src/extension.ts",
556
+ "line": 126,
557
+ "end_line": 162,
558
+ "label": "Socket"
559
+ }
560
+ ]
561
+ },
562
+ {
563
+ "id": "request-contexts",
564
+ "type": "frontend",
565
+ "label": "Request Contexts",
566
+ "sublabel": "per-request state",
567
+ "tag": "Map",
568
+ "pos": [
569
+ 1013,
570
+ 245
571
+ ],
572
+ "size": [
573
+ 130,
574
+ 38
575
+ ],
576
+ "sources": [
577
+ {
578
+ "path": "src/extension.ts",
579
+ "line": 442,
580
+ "end_line": 486,
581
+ "label": "Context"
582
+ }
583
+ ]
584
+ },
585
+ {
586
+ "id": "response-builder",
587
+ "type": "frontend",
588
+ "label": "Response Builder",
589
+ "sublabel": "status/headers/body",
590
+ "tag": "blocks",
591
+ "pos": [
592
+ 1013,
593
+ 310
594
+ ],
595
+ "size": [
596
+ 130,
597
+ 38
598
+ ],
599
+ "sources": [
600
+ {
601
+ "path": "src/extension.ts",
602
+ "line": 246,
603
+ "end_line": 308,
604
+ "label": "Response blocks"
605
+ }
606
+ ]
607
+ },
608
+ {
609
+ "id": "content-builders",
610
+ "type": "frontend",
611
+ "label": "Content Builders",
612
+ "sublabel": "Markdown + HTML",
613
+ "tag": "handles",
614
+ "pos": [
615
+ 850,
616
+ 310
617
+ ],
618
+ "size": [
619
+ 130,
620
+ 38
621
+ ],
622
+ "sources": [
623
+ {
624
+ "path": "src/extension.ts",
625
+ "line": 330,
626
+ "end_line": 423,
627
+ "label": "Builders"
628
+ }
629
+ ]
630
+ },
631
+ {
632
+ "id": "scratch-vm",
633
+ "type": "frontend",
634
+ "label": "Scratch VM Hats",
635
+ "sublabel": "startHats",
636
+ "tag": "callback",
637
+ "pos": [
638
+ 1163,
639
+ 374
640
+ ],
641
+ "size": [
642
+ 130,
643
+ 38
644
+ ],
645
+ "sources": [
646
+ {
647
+ "path": "src/extension.ts",
648
+ "line": 493,
649
+ "end_line": 495,
650
+ "label": "Hat trigger"
651
+ }
652
+ ]
653
+ },
654
+ {
655
+ "id": "community-router",
656
+ "type": "backend",
657
+ "label": "Community Router",
658
+ "sublabel": "login/projects/auth",
659
+ "tag": "default off",
660
+ "pos": [
661
+ 675,
662
+ 439
663
+ ],
664
+ "size": [
665
+ 130,
666
+ 38
667
+ ],
668
+ "sources": [
669
+ {
670
+ "path": "src/community.ts",
671
+ "line": 87,
672
+ "end_line": 350,
673
+ "label": "Routes"
674
+ }
675
+ ]
676
+ },
677
+ {
678
+ "id": "session-csrf",
679
+ "type": "security",
680
+ "label": "Session + CSRF",
681
+ "sublabel": "HTTP-only cookie",
682
+ "tag": "forms",
683
+ "pos": [
684
+ 513,
685
+ 439
686
+ ],
687
+ "size": [
688
+ 130,
689
+ 38
690
+ ],
691
+ "sources": [
692
+ {
693
+ "path": "src/community.ts",
694
+ "line": 467,
695
+ "end_line": 512,
696
+ "label": "Session"
697
+ }
698
+ ]
699
+ },
700
+ {
701
+ "id": "password-auth",
702
+ "type": "security",
703
+ "label": "Password Auth",
704
+ "sublabel": "scrypt compare",
705
+ "tag": "demo",
706
+ "pos": [
707
+ 350,
708
+ 439
709
+ ],
710
+ "size": [
711
+ 130,
712
+ 38
713
+ ],
714
+ "sources": [
715
+ {
716
+ "path": "src/community.ts",
717
+ "line": 497,
718
+ "end_line": 508,
719
+ "label": "Password"
720
+ }
721
+ ]
722
+ },
723
+ {
724
+ "id": "upload-validation",
725
+ "type": "security",
726
+ "label": "Upload Checks",
727
+ "sublabel": "SB3/image check",
728
+ "tag": "multipart",
729
+ "pos": [
730
+ 850,
731
+ 439
732
+ ],
733
+ "size": [
734
+ 130,
735
+ 38
736
+ ],
737
+ "sources": [
738
+ {
739
+ "path": "src/community.ts",
740
+ "line": 529,
741
+ "end_line": 641,
742
+ "label": "Upload checks"
743
+ }
744
+ ]
745
+ },
746
+ {
747
+ "id": "community-storage",
748
+ "type": "database",
749
+ "label": "Community DB",
750
+ "sublabel": "users/sessions/SB3",
751
+ "tag": "in-memory",
752
+ "pos": [
753
+ 1013,
754
+ 439
755
+ ],
756
+ "size": [
757
+ 130,
758
+ 38
759
+ ],
760
+ "sources": [
761
+ {
762
+ "path": "src/community.ts",
763
+ "line": 353,
764
+ "end_line": 442,
765
+ "label": "Store"
766
+ }
767
+ ]
768
+ }
769
+ ],
770
+ "boundaries": [
771
+ {
772
+ "kind": "region",
773
+ "label": "Local Node.js server process",
774
+ "wraps": [
775
+ "cli-entry",
776
+ "digest-files",
777
+ "node-server",
778
+ "digest-auth",
779
+ "hono-router",
780
+ "route-dispatch",
781
+ "bridge-message",
782
+ "ws-bridge",
783
+ "ws-upgrade",
784
+ "asset-router",
785
+ "resource-auth",
786
+ "body-limits",
787
+ "cache-metadata",
788
+ "community-router",
789
+ "session-csrf",
790
+ "password-auth",
791
+ "upload-validation",
792
+ "community-storage"
793
+ ],
794
+ "pad": 22
795
+ },
796
+ {
797
+ "kind": "security-group",
798
+ "label": "Public HTTP trust boundary",
799
+ "wraps": [
800
+ "http-clients",
801
+ "node-server",
802
+ "digest-auth",
803
+ "hono-router",
804
+ "route-dispatch"
805
+ ],
806
+ "pad": 18
807
+ },
808
+ {
809
+ "kind": "security-group",
810
+ "label": "Localhost-only WebSocket boundary",
811
+ "wraps": [
812
+ "ws-upgrade",
813
+ "ws-bridge",
814
+ "ws-client",
815
+ "tw-runtime"
816
+ ],
817
+ "pad": 18
818
+ },
819
+ {
820
+ "kind": "security-group",
821
+ "label": "Asset capability boundary",
822
+ "wraps": [
823
+ "resource-capability",
824
+ "cache-metadata",
825
+ "resource-auth",
826
+ "body-limits",
827
+ "asset-router"
828
+ ],
829
+ "pad": 18
830
+ },
831
+ {
832
+ "kind": "security-group",
833
+ "label": "Unsandboxed TurboWarp extension boundary",
834
+ "wraps": [
835
+ "tw-runtime",
836
+ "extension-entry",
837
+ "block-defs",
838
+ "ws-client",
839
+ "request-contexts",
840
+ "response-builder",
841
+ "content-builders",
842
+ "scratch-vm"
843
+ ],
844
+ "pad": 18
845
+ }
846
+ ],
847
+ "connections": [
848
+ {
849
+ "id": "cli-to-digest-file",
850
+ "from": "cli-entry",
851
+ "to": "digest-files",
852
+ "variant": "dashed"
853
+ },
854
+ {
855
+ "id": "cli-to-node",
856
+ "from": "cli-entry",
857
+ "to": "node-server"
858
+ },
859
+ {
860
+ "id": "clients-to-node",
861
+ "from": "http-clients",
862
+ "to": "node-server",
863
+ "variant": "emphasis"
864
+ },
865
+ {
866
+ "id": "node-to-router",
867
+ "from": "node-server",
868
+ "to": "hono-router"
869
+ },
870
+ {
871
+ "id": "digest-to-router",
872
+ "from": "digest-auth",
873
+ "to": "hono-router",
874
+ "variant": "security"
875
+ },
876
+ {
877
+ "id": "router-to-dispatch",
878
+ "from": "hono-router",
879
+ "to": "route-dispatch"
880
+ },
881
+ {
882
+ "id": "dispatch-to-bridge-message",
883
+ "from": "route-dispatch",
884
+ "to": "bridge-message"
885
+ },
886
+ {
887
+ "id": "bridge-message-to-ws",
888
+ "from": "bridge-message",
889
+ "to": "ws-bridge"
890
+ },
891
+ {
892
+ "id": "ws-upgrade-to-bridge",
893
+ "from": "ws-upgrade",
894
+ "to": "ws-bridge",
895
+ "variant": "security"
896
+ },
897
+ {
898
+ "id": "ws-bridge-to-client",
899
+ "from": "ws-bridge",
900
+ "to": "ws-client",
901
+ "variant": "emphasis"
902
+ },
903
+ {
904
+ "id": "ws-client-to-runtime",
905
+ "from": "ws-client",
906
+ "to": "tw-runtime"
907
+ },
908
+ {
909
+ "id": "runtime-to-entry",
910
+ "from": "tw-runtime",
911
+ "to": "extension-entry",
912
+ "variant": "dashed"
913
+ },
914
+ {
915
+ "id": "entry-to-blocks",
916
+ "from": "extension-entry",
917
+ "to": "block-defs"
918
+ },
919
+ {
920
+ "id": "ws-client-to-contexts",
921
+ "from": "ws-client",
922
+ "to": "request-contexts"
923
+ },
924
+ {
925
+ "id": "contexts-to-hats",
926
+ "from": "request-contexts",
927
+ "to": "scratch-vm"
928
+ },
929
+ {
930
+ "id": "contexts-to-response",
931
+ "from": "request-contexts",
932
+ "to": "response-builder"
933
+ },
934
+ {
935
+ "id": "content-to-response",
936
+ "from": "content-builders",
937
+ "to": "response-builder"
938
+ },
939
+ {
940
+ "id": "dispatch-to-asset-router",
941
+ "from": "route-dispatch",
942
+ "to": "asset-router"
943
+ },
944
+ {
945
+ "id": "asset-to-auth",
946
+ "from": "asset-router",
947
+ "to": "resource-auth",
948
+ "variant": "security"
949
+ },
950
+ {
951
+ "id": "asset-to-limits",
952
+ "from": "asset-router",
953
+ "to": "body-limits",
954
+ "variant": "security"
955
+ },
956
+ {
957
+ "id": "cache-to-resource",
958
+ "from": "cache-metadata",
959
+ "to": "resource-capability"
960
+ },
961
+ {
962
+ "id": "dispatch-to-community",
963
+ "from": "route-dispatch",
964
+ "to": "community-router",
965
+ "variant": "dashed",
966
+ "fromSide": "bottom",
967
+ "toSide": "right",
968
+ "via": [
969
+ [
970
+ 578,
971
+ 280
972
+ ],
973
+ [
974
+ 830,
975
+ 280
976
+ ],
977
+ [
978
+ 830,
979
+ 458
980
+ ]
981
+ ]
982
+ },
983
+ {
984
+ "id": "community-to-session",
985
+ "from": "community-router",
986
+ "to": "session-csrf",
987
+ "variant": "security"
988
+ },
989
+ {
990
+ "id": "community-to-upload",
991
+ "from": "community-router",
992
+ "to": "upload-validation",
993
+ "variant": "security"
994
+ }
995
+ ],
996
+ "cards": [
997
+ {
998
+ "dot": "cyan",
999
+ "title": "主要パス",
1000
+ "items": [
1001
+ "HTTP: client -> Node/Hono -> dispatch -> Bridge Message -> WS Bridge -> TurboWarp extension.",
1002
+ "Assets and community routes stay server-side: /@assets uses auth/limits/cache/ResourceCapability; community uses session, password, upload, OAuth demo, and in-memory state."
1003
+ ]
1004
+ },
1005
+ {
1006
+ "dot": "amber",
1007
+ "title": "信頼境界と依存",
1008
+ "items": [
1009
+ "Untrusted public HTTP crosses optional Digest/TLS; /ws is loopback-only and keeps one active extension socket with request timeouts.",
1010
+ "Runtime: Node.js 22+, hono, @hono/node-server, ws, node:https/crypto/fs. Tooling: Vite, TurboWarp Vite plugin, TypeScript, Vitest, ESLint."
1011
+ ]
1012
+ }
1013
+ ]
1014
+ }