@johnhenry/wsh 0.48.0 → 0.49.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.
package/spec/wsh-v1.md ADDED
@@ -0,0 +1,1607 @@
1
+ # wsh Protocol Specification — wsh-v1
2
+
3
+ > Auto-generated from `wsh-v1.yaml`. Do not edit.
4
+ > Run: `node spec/codegen.mjs` (from the @johnhenry/wsh repo root)
5
+
6
+ ## Table of Contents
7
+
8
+ 1. [Overview](#overview)
9
+ 2. [Enums](#enums)
10
+ 3. [Message Types](#message-types)
11
+ 4. [Message Details](#message-details)
12
+ 5. [Nested Types](#nested-types)
13
+ 6. [Crypto Primitives](#crypto-primitives)
14
+ 7. [Transport Bindings](#transport-bindings)
15
+
16
+ ## Overview
17
+
18
+ - **Protocol**: wsh
19
+ - **Version**: `wsh-v1`
20
+ - **Wire format**: CBOR
21
+ - **Framing**: length prefixed be32
22
+ - **Total message types**: 110
23
+
24
+ ## Enums
25
+
26
+ ### ChannelKind
27
+
28
+ Type: `string`
29
+
30
+ | Value |
31
+ |-------|
32
+ | `pty` |
33
+ | `exec` |
34
+ | `meta` |
35
+ | `file` |
36
+ | `tcp` |
37
+ | `udp` |
38
+ | `job` |
39
+ | `rpc` |
40
+
41
+ ### AuthMethod
42
+
43
+ Type: `string`
44
+
45
+ | Value |
46
+ |-------|
47
+ | `pubkey` |
48
+ | `password` |
49
+
50
+ ### SessionDataMode
51
+
52
+ Type: `string`
53
+
54
+ | Value |
55
+ |-------|
56
+ | `stream` |
57
+ | `virtual` |
58
+
59
+ ### FileEntryType
60
+
61
+ Type: `string`
62
+
63
+ | Value |
64
+ |-------|
65
+ | `file` |
66
+ | `directory` |
67
+ | `symlink` |
68
+ | `device` |
69
+ | `pipe` |
70
+ | `socket` |
71
+
72
+ ## Message Types
73
+
74
+ | Code | Name | Category |
75
+ |------|------|----------|
76
+ | `0x01` | Hello | handshake |
77
+ | `0x02` | ServerHello | handshake |
78
+ | `0x03` | Challenge | handshake |
79
+ | `0x04` | AuthMethods | handshake |
80
+ | `0x05` | Auth | handshake |
81
+ | `0x06` | AuthOk | handshake |
82
+ | `0x07` | AuthFail | handshake |
83
+ | `0x10` | Open | channel |
84
+ | `0x11` | OpenOk | channel |
85
+ | `0x12` | OpenFail | channel |
86
+ | `0x13` | Resize | channel |
87
+ | `0x14` | Signal | channel |
88
+ | `0x15` | Exit | channel |
89
+ | `0x16` | Close | channel |
90
+ | `0x17` | SessionData | channel |
91
+ | `0x20` | Error | transport |
92
+ | `0x21` | Ping | transport |
93
+ | `0x22` | Pong | transport |
94
+ | `0x30` | Attach | session |
95
+ | `0x31` | Resume | session |
96
+ | `0x32` | Rename | session |
97
+ | `0x33` | IdleWarning | session |
98
+ | `0x34` | Shutdown | session |
99
+ | `0x35` | Snapshot | session |
100
+ | `0x36` | Presence | session |
101
+ | `0x37` | ControlChanged | session |
102
+ | `0x38` | Metrics | session |
103
+ | `0x39` | Clipboard | session |
104
+ | `0x3a` | RecordingExport | session |
105
+ | `0x3b` | CommandJournal | session |
106
+ | `0x3c` | MetricsRequest | session |
107
+ | `0x3d` | SuspendSession | session |
108
+ | `0x3e` | RestartPty | session |
109
+ | `0x3f` | SessionListRequest | session |
110
+ | `0x40` | McpDiscover | mcp |
111
+ | `0x41` | McpTools | mcp |
112
+ | `0x42` | McpCall | mcp |
113
+ | `0x43` | McpResult | mcp |
114
+ | `0x44` | McpCancel | mcp |
115
+ | `0x50` | ReverseRegister | reverse |
116
+ | `0x51` | ReverseList | reverse |
117
+ | `0x52` | ReversePeers | reverse |
118
+ | `0x53` | ReverseConnect | reverse |
119
+ | `0x54` | ReverseAccept | reverse |
120
+ | `0x55` | ReverseReject | reverse |
121
+ | `0x56` | RelayForward | reverse |
122
+ | `0x57` | ReverseClose | reverse |
123
+ | `0x58` | ReverseChallenge | reverse |
124
+ | `0x59` | ReverseProof | reverse |
125
+ | `0x5f` | SessionList | session |
126
+ | `0x60` | Detach | session |
127
+ | `0x61` | DetachOk | session |
128
+ | `0x62` | DetachFail | session |
129
+ | `0x63` | OpenUnix | gateway |
130
+ | `0x64` | OpenEndpoint | gateway |
131
+ | `0x65` | ListenUnix | gateway |
132
+ | `0x70` | OpenTcp | gateway |
133
+ | `0x71` | OpenUdp | gateway |
134
+ | `0x72` | ResolveDns | gateway |
135
+ | `0x73` | GatewayOk | gateway |
136
+ | `0x74` | GatewayFail | gateway |
137
+ | `0x75` | GatewayClose | gateway |
138
+ | `0x76` | InboundOpen | gateway |
139
+ | `0x77` | InboundAccept | gateway |
140
+ | `0x78` | InboundReject | gateway |
141
+ | `0x79` | DnsResult | gateway |
142
+ | `0x7a` | ListenRequest | gateway |
143
+ | `0x7b` | ListenOk | gateway |
144
+ | `0x7c` | ListenFail | gateway |
145
+ | `0x7d` | ListenClose | gateway |
146
+ | `0x7e` | GatewayData | gateway |
147
+ | `0x7f` | GatewayCredit | gateway |
148
+ | `0x80` | GuestInvite | guest |
149
+ | `0x81` | GuestJoin | guest |
150
+ | `0x82` | GuestRevoke | guest |
151
+ | `0x83` | ShareSession | sharing |
152
+ | `0x84` | ShareRevoke | sharing |
153
+ | `0x85` | CompressBegin | compression |
154
+ | `0x86` | CompressAck | compression |
155
+ | `0x87` | RateControl | ratecontrol |
156
+ | `0x88` | RateWarning | ratecontrol |
157
+ | `0x89` | SessionLink | linking |
158
+ | `0x8a` | SessionUnlink | linking |
159
+ | `0x8b` | CopilotAttach | copilot |
160
+ | `0x8c` | CopilotSuggest | copilot |
161
+ | `0x8d` | CopilotDetach | copilot |
162
+ | `0x8e` | KeyExchange | e2e |
163
+ | `0x8f` | EncryptedFrame | e2e |
164
+ | `0x90` | EchoAck | echo |
165
+ | `0x91` | EchoState | echo |
166
+ | `0x92` | TermSync | termsync |
167
+ | `0x93` | TermDiff | termsync |
168
+ | `0x94` | NodeAnnounce | scaling |
169
+ | `0x95` | NodeRedirect | scaling |
170
+ | `0x96` | SessionGrant | principals |
171
+ | `0x97` | SessionRevoke | principals |
172
+ | `0x98` | FileOp | filechannel |
173
+ | `0x99` | FileResult | filechannel |
174
+ | `0x9a` | FileChunk | filechannel |
175
+ | `0x9b` | PolicyEval | policy |
176
+ | `0x9c` | PolicyResult | policy |
177
+ | `0x9d` | PolicyUpdate | policy |
178
+ | `0x9e` | TerminalConfig | terminal |
179
+ | `0x9f` | AuthorizedKeyAdd | keys |
180
+ | `0xa0` | AuthorizedKeyResult | keys |
181
+ | `0xa8` | ShareOffer | shares |
182
+ | `0xa9` | ShareRequest | shares |
183
+ | `0xaa` | ShareReply | shares |
184
+ | `0xab` | ListTargets | targets |
185
+ | `0xac` | TargetList | targets |
186
+
187
+ ## Message Details
188
+
189
+ ### Hello (`0x01`)
190
+
191
+ Category: **handshake**
192
+
193
+ > >
194
+
195
+ | Field | Type | Required | Default |
196
+ |-------|------|----------|---------|
197
+ | `version` | `string` | yes | — |
198
+ | `username` | `string` | yes | — |
199
+ | `features` | `string[]` | no | `[]` |
200
+ | `auth_method` | `AuthMethod` | no | — |
201
+
202
+ ### ServerHello (`0x02`)
203
+
204
+ Category: **handshake**
205
+
206
+ > >
207
+
208
+ | Field | Type | Required | Default |
209
+ |-------|------|----------|---------|
210
+ | `session_id` | `string` | yes | — |
211
+ | `features` | `string[]` | no | `[]` |
212
+ | `fingerprints` | `string[]` | no | `[]` |
213
+ | `host_fingerprint` | `string` | no | — |
214
+
215
+ ### Challenge (`0x03`)
216
+
217
+ Category: **handshake**
218
+
219
+ > >
220
+
221
+ | Field | Type | Required | Default |
222
+ |-------|------|----------|---------|
223
+ | `nonce` | `bytes` | yes | — |
224
+ | `session_id` | `string` | yes | — |
225
+
226
+ ### AuthMethods (`0x04`)
227
+
228
+ Category: **handshake**
229
+
230
+ > >
231
+
232
+ | Field | Type | Required | Default |
233
+ |-------|------|----------|---------|
234
+ | `methods` | `AuthMethod[]` | yes | — |
235
+
236
+ ### Auth (`0x05`)
237
+
238
+ Category: **handshake**
239
+
240
+ > >
241
+
242
+ | Field | Type | Required | Default |
243
+ |-------|------|----------|---------|
244
+ | `method` | `AuthMethod` | yes | — |
245
+ | `signature` | `bytes` | no | — |
246
+ | `public_key` | `bytes` | no | — |
247
+ | `password` | `string` | no | — |
248
+
249
+ ### AuthOk (`0x06`)
250
+
251
+ Category: **handshake**
252
+
253
+ > >
254
+
255
+ | Field | Type | Required | Default |
256
+ |-------|------|----------|---------|
257
+ | `session_id` | `string` | yes | — |
258
+ | `token` | `bytes` | yes | — |
259
+ | `ttl` | `u64` | yes | — |
260
+
261
+ ### AuthFail (`0x07`)
262
+
263
+ Category: **handshake**
264
+
265
+ > >
266
+
267
+ | Field | Type | Required | Default |
268
+ |-------|------|----------|---------|
269
+ | `reason` | `string` | yes | — |
270
+
271
+ ### Open (`0x10`)
272
+
273
+ Category: **channel**
274
+
275
+ > >
276
+
277
+ | Field | Type | Required | Default |
278
+ |-------|------|----------|---------|
279
+ | `kind` | `ChannelKind` | yes | — |
280
+ | `command` | `string` | no | — |
281
+ | `cols` | `u16` | no | — |
282
+ | `rows` | `u16` | no | — |
283
+ | `env` | `map<string,string>` | no | — |
284
+ | `stdio` | `string` | no | — |
285
+ | `target` | `string` | no | — |
286
+
287
+ ### OpenOk (`0x11`)
288
+
289
+ Category: **channel**
290
+
291
+ > >
292
+
293
+ | Field | Type | Required | Default |
294
+ |-------|------|----------|---------|
295
+ | `channel_id` | `u32` | yes | — |
296
+ | `stream_ids` | `u32[]` | no | `[]` |
297
+ | `data_mode` | `SessionDataMode` | no | `"stream"` |
298
+ | `capabilities` | `string[]` | no | `[]` |
299
+ | `session_id` | `string` | no | — |
300
+ | `token` | `bytes` | no | — |
301
+ | `stderr_channel_id` | `u32` | no | — |
302
+
303
+ ### OpenFail (`0x12`)
304
+
305
+ Category: **channel**
306
+
307
+ > >
308
+
309
+ | Field | Type | Required | Default |
310
+ |-------|------|----------|---------|
311
+ | `reason` | `string` | yes | — |
312
+
313
+ ### Resize (`0x13`)
314
+
315
+ Category: **channel**
316
+
317
+ > >
318
+
319
+ | Field | Type | Required | Default |
320
+ |-------|------|----------|---------|
321
+ | `channel_id` | `u32` | yes | — |
322
+ | `cols` | `u16` | yes | — |
323
+ | `rows` | `u16` | yes | — |
324
+
325
+ ### Signal (`0x14`)
326
+
327
+ Category: **channel**
328
+
329
+ > >
330
+
331
+ | Field | Type | Required | Default |
332
+ |-------|------|----------|---------|
333
+ | `channel_id` | `u32` | yes | — |
334
+ | `signal` | `string` | yes | — |
335
+
336
+ ### Exit (`0x15`)
337
+
338
+ Category: **channel**
339
+
340
+ > >
341
+
342
+ | Field | Type | Required | Default |
343
+ |-------|------|----------|---------|
344
+ | `channel_id` | `u32` | yes | — |
345
+ | `code` | `i32` | yes | — |
346
+
347
+ ### Close (`0x16`)
348
+
349
+ Category: **channel**
350
+
351
+ > >
352
+
353
+ | Field | Type | Required | Default |
354
+ |-------|------|----------|---------|
355
+ | `channel_id` | `u32` | yes | — |
356
+
357
+ ### SessionData (`0x17`)
358
+
359
+ Category: **channel**
360
+
361
+ > >
362
+
363
+ | Field | Type | Required | Default |
364
+ |-------|------|----------|---------|
365
+ | `channel_id` | `u32` | yes | — |
366
+ | `data` | `bytes` | yes | — |
367
+
368
+ ### Error (`0x20`)
369
+
370
+ Category: **transport**
371
+
372
+ > >
373
+
374
+ | Field | Type | Required | Default |
375
+ |-------|------|----------|---------|
376
+ | `code` | `u32` | yes | — |
377
+ | `message` | `string` | yes | — |
378
+
379
+ ### Ping (`0x21`)
380
+
381
+ Category: **transport**
382
+
383
+ > >
384
+
385
+ | Field | Type | Required | Default |
386
+ |-------|------|----------|---------|
387
+ | `id` | `u64` | yes | — |
388
+
389
+ ### Pong (`0x22`)
390
+
391
+ Category: **transport**
392
+
393
+ > >
394
+
395
+ | Field | Type | Required | Default |
396
+ |-------|------|----------|---------|
397
+ | `id` | `u64` | yes | — |
398
+
399
+ ### Attach (`0x30`)
400
+
401
+ Category: **session**
402
+
403
+ > >
404
+
405
+ | Field | Type | Required | Default |
406
+ |-------|------|----------|---------|
407
+ | `session_id` | `string` | yes | — |
408
+ | `token` | `bytes` | no | — |
409
+ | `mode` | `string` | no | `"control"` |
410
+ | `device_label` | `string` | no | — |
411
+
412
+ ### Resume (`0x31`)
413
+
414
+ Category: **session**
415
+
416
+ > >
417
+
418
+ | Field | Type | Required | Default |
419
+ |-------|------|----------|---------|
420
+ | `session_id` | `string` | yes | — |
421
+ | `token` | `bytes` | yes | — |
422
+ | `last_seq` | `u64` | yes | — |
423
+
424
+ ### Rename (`0x32`)
425
+
426
+ Category: **session**
427
+
428
+ > >
429
+
430
+ | Field | Type | Required | Default |
431
+ |-------|------|----------|---------|
432
+ | `session_id` | `string` | yes | — |
433
+ | `name` | `string` | yes | — |
434
+
435
+ ### IdleWarning (`0x33`)
436
+
437
+ Category: **session**
438
+
439
+ > >
440
+
441
+ | Field | Type | Required | Default |
442
+ |-------|------|----------|---------|
443
+ | `expires_in` | `u64` | yes | — |
444
+
445
+ ### Shutdown (`0x34`)
446
+
447
+ Category: **session**
448
+
449
+ > >
450
+
451
+ | Field | Type | Required | Default |
452
+ |-------|------|----------|---------|
453
+ | `reason` | `string` | yes | — |
454
+ | `retry_after` | `u64` | no | — |
455
+
456
+ ### Snapshot (`0x35`)
457
+
458
+ Category: **session**
459
+
460
+ > >
461
+
462
+ | Field | Type | Required | Default |
463
+ |-------|------|----------|---------|
464
+ | `label` | `string` | yes | — |
465
+
466
+ ### Presence (`0x36`)
467
+
468
+ Category: **session**
469
+
470
+ > >
471
+
472
+ | Field | Type | Required | Default |
473
+ |-------|------|----------|---------|
474
+ | `attachments` | `AttachmentInfo[]` | yes | — |
475
+
476
+ ### ControlChanged (`0x37`)
477
+
478
+ Category: **session**
479
+
480
+ > >
481
+
482
+ | Field | Type | Required | Default |
483
+ |-------|------|----------|---------|
484
+ | `new_controller` | `string` | yes | — |
485
+
486
+ ### Metrics (`0x38`)
487
+
488
+ Category: **session**
489
+
490
+ > >
491
+
492
+ | Field | Type | Required | Default |
493
+ |-------|------|----------|---------|
494
+ | `cpu` | `f64` | no | — |
495
+ | `memory` | `u64` | no | — |
496
+ | `sessions` | `u32` | no | — |
497
+ | `rtt` | `u64` | no | — |
498
+
499
+ ### Clipboard (`0x39`)
500
+
501
+ Category: **session**
502
+
503
+ > >
504
+
505
+ | Field | Type | Required | Default |
506
+ |-------|------|----------|---------|
507
+ | `direction` | `string` | yes | — |
508
+ | `data` | `string` | yes | — |
509
+
510
+ ### RecordingExport (`0x3a`)
511
+
512
+ Category: **session**
513
+
514
+ > >
515
+
516
+ | Field | Type | Required | Default |
517
+ |-------|------|----------|---------|
518
+ | `session_id` | `string` | yes | — |
519
+ | `format` | `string` | no | `"jsonl"` |
520
+ | `data` | `string` | no | — |
521
+
522
+ ### CommandJournal (`0x3b`)
523
+
524
+ Category: **session**
525
+
526
+ > >
527
+
528
+ | Field | Type | Required | Default |
529
+ |-------|------|----------|---------|
530
+ | `session_id` | `string` | yes | — |
531
+ | `command` | `string` | yes | — |
532
+ | `exit_code` | `i32` | no | — |
533
+ | `duration_ms` | `u64` | no | — |
534
+ | `cwd` | `string` | no | — |
535
+ | `timestamp` | `u64` | yes | — |
536
+
537
+ ### MetricsRequest (`0x3c`)
538
+
539
+ Category: **session**
540
+
541
+ > >
542
+
543
+ *No fields.*
544
+
545
+ ### SuspendSession (`0x3d`)
546
+
547
+ Category: **session**
548
+
549
+ > >
550
+
551
+ | Field | Type | Required | Default |
552
+ |-------|------|----------|---------|
553
+ | `session_id` | `string` | yes | — |
554
+ | `action` | `string` | yes | — |
555
+
556
+ ### RestartPty (`0x3e`)
557
+
558
+ Category: **session**
559
+
560
+ > >
561
+
562
+ | Field | Type | Required | Default |
563
+ |-------|------|----------|---------|
564
+ | `session_id` | `string` | yes | — |
565
+ | `command` | `string` | no | — |
566
+
567
+ ### SessionListRequest (`0x3f`)
568
+
569
+ Category: **session**
570
+
571
+ > >
572
+
573
+ *No fields.*
574
+
575
+ ### McpDiscover (`0x40`)
576
+
577
+ Category: **mcp**
578
+
579
+ > >
580
+
581
+ *No fields.*
582
+
583
+ ### McpTools (`0x41`)
584
+
585
+ Category: **mcp**
586
+
587
+ > >
588
+
589
+ | Field | Type | Required | Default |
590
+ |-------|------|----------|---------|
591
+ | `tools` | `McpToolSpec[]` | yes | — |
592
+
593
+ ### McpCall (`0x42`)
594
+
595
+ Category: **mcp**
596
+
597
+ > >
598
+
599
+ | Field | Type | Required | Default |
600
+ |-------|------|----------|---------|
601
+ | `tool` | `string` | yes | — |
602
+ | `arguments` | `json` | yes | — |
603
+ | `call_id` | `string` | no | — |
604
+
605
+ ### McpResult (`0x43`)
606
+
607
+ Category: **mcp**
608
+
609
+ > >
610
+
611
+ | Field | Type | Required | Default |
612
+ |-------|------|----------|---------|
613
+ | `result` | `json` | yes | — |
614
+ | `call_id` | `string` | no | — |
615
+
616
+ ### McpCancel (`0x44`)
617
+
618
+ Category: **mcp**
619
+
620
+ > >
621
+
622
+ | Field | Type | Required | Default |
623
+ |-------|------|----------|---------|
624
+ | `call_id` | `string` | yes | — |
625
+
626
+ ### ReverseRegister (`0x50`)
627
+
628
+ Category: **reverse**
629
+
630
+ > >
631
+
632
+ | Field | Type | Required | Default |
633
+ |-------|------|----------|---------|
634
+ | `username` | `string` | yes | — |
635
+ | `capabilities` | `string[]` | no | `[]` |
636
+ | `peer_type` | `string` | no | `"host"` |
637
+ | `shell_backend` | `string` | no | `"pty"` |
638
+ | `supports_attach` | `bool` | no | `false` |
639
+ | `supports_replay` | `bool` | no | `false` |
640
+ | `supports_echo` | `bool` | no | `false` |
641
+ | `supports_term_sync` | `bool` | no | `false` |
642
+ | `public_key` | `bytes` | yes | — |
643
+ | `seq` | `u64` | yes | — |
644
+ | `record_signature` | `bytes` | yes | — |
645
+
646
+ ### ReverseList (`0x51`)
647
+
648
+ Category: **reverse**
649
+
650
+ > >
651
+
652
+ *No fields.*
653
+
654
+ ### ReversePeers (`0x52`)
655
+
656
+ Category: **reverse**
657
+
658
+ > >
659
+
660
+ | Field | Type | Required | Default |
661
+ |-------|------|----------|---------|
662
+ | `peers` | `PeerInfo[]` | yes | — |
663
+
664
+ ### ReverseConnect (`0x53`)
665
+
666
+ Category: **reverse**
667
+
668
+ > >
669
+
670
+ | Field | Type | Required | Default |
671
+ |-------|------|----------|---------|
672
+ | `target_fingerprint` | `string` | yes | — |
673
+ | `username` | `string` | yes | — |
674
+ | `from_fingerprint` | `string` | yes | — |
675
+ | `features` | `string[]` | no | — |
676
+
677
+ ### ReverseAccept (`0x54`)
678
+
679
+ Category: **reverse**
680
+
681
+ > >
682
+
683
+ | Field | Type | Required | Default |
684
+ |-------|------|----------|---------|
685
+ | `target_fingerprint` | `string` | yes | — |
686
+ | `username` | `string` | yes | — |
687
+ | `capabilities` | `string[]` | no | `[]` |
688
+ | `peer_type` | `string` | no | `"host"` |
689
+ | `shell_backend` | `string` | no | `"pty"` |
690
+ | `supports_attach` | `bool` | no | `false` |
691
+ | `supports_replay` | `bool` | no | `false` |
692
+ | `supports_echo` | `bool` | no | `false` |
693
+ | `supports_term_sync` | `bool` | no | `false` |
694
+ | `features` | `string[]` | no | — |
695
+
696
+ ### ReverseReject (`0x55`)
697
+
698
+ Category: **reverse**
699
+
700
+ > >
701
+
702
+ | Field | Type | Required | Default |
703
+ |-------|------|----------|---------|
704
+ | `target_fingerprint` | `string` | yes | — |
705
+ | `username` | `string` | yes | — |
706
+ | `reason` | `string` | yes | — |
707
+
708
+ ### RelayForward (`0x56`)
709
+
710
+ Category: **reverse**
711
+
712
+ > >
713
+
714
+ | Field | Type | Required | Default |
715
+ |-------|------|----------|---------|
716
+ | `from_fingerprint` | `string` | yes | — |
717
+ | `inner` | `bytes` | yes | — |
718
+ | `to_fingerprint` | `string` | no | — |
719
+
720
+ ### ReverseClose (`0x57`)
721
+
722
+ Category: **reverse**
723
+
724
+ > >
725
+
726
+ | Field | Type | Required | Default |
727
+ |-------|------|----------|---------|
728
+ | `target_fingerprint` | `string` | yes | — |
729
+ | `reason` | `string` | no | — |
730
+
731
+ ### ReverseChallenge (`0x58`)
732
+
733
+ Category: **reverse**
734
+
735
+ > >
736
+
737
+ | Field | Type | Required | Default |
738
+ |-------|------|----------|---------|
739
+ | `target_fingerprint` | `string` | yes | — |
740
+ | `public_key` | `bytes` | yes | — |
741
+ | `operator_fingerprint` | `string` | yes | — |
742
+ | `nonce` | `bytes` | yes | — |
743
+ | `session_id` | `string` | yes | — |
744
+ | `signature` | `bytes` | yes | — |
745
+
746
+ ### ReverseProof (`0x59`)
747
+
748
+ Category: **reverse**
749
+
750
+ > >
751
+
752
+ | Field | Type | Required | Default |
753
+ |-------|------|----------|---------|
754
+ | `target_fingerprint` | `string` | yes | — |
755
+ | `public_key` | `bytes` | yes | — |
756
+ | `username` | `string` | yes | — |
757
+ | `nonce` | `bytes` | yes | — |
758
+ | `session_id` | `string` | yes | — |
759
+ | `signature` | `bytes` | yes | — |
760
+ | `from_fingerprint` | `string` | no | — |
761
+
762
+ ### SessionList (`0x5f`)
763
+
764
+ Category: **session**
765
+
766
+ > >
767
+
768
+ | Field | Type | Required | Default |
769
+ |-------|------|----------|---------|
770
+ | `sessions` | `SessionSummary[]` | yes | — |
771
+
772
+ ### Detach (`0x60`)
773
+
774
+ Category: **session**
775
+
776
+ > >
777
+
778
+ | Field | Type | Required | Default |
779
+ |-------|------|----------|---------|
780
+ | `session_id` | `string` | yes | — |
781
+
782
+ ### DetachOk (`0x61`)
783
+
784
+ Category: **session**
785
+
786
+ > >
787
+
788
+ | Field | Type | Required | Default |
789
+ |-------|------|----------|---------|
790
+ | `session_id` | `string` | yes | — |
791
+
792
+ ### DetachFail (`0x62`)
793
+
794
+ Category: **session**
795
+
796
+ > >
797
+
798
+ | Field | Type | Required | Default |
799
+ |-------|------|----------|---------|
800
+ | `reason` | `string` | yes | — |
801
+
802
+ ### OpenUnix (`0x63`)
803
+
804
+ Category: **gateway**
805
+
806
+ > >
807
+
808
+ | Field | Type | Required | Default |
809
+ |-------|------|----------|---------|
810
+ | `gateway_id` | `u32` | yes | — |
811
+ | `path` | `string` | yes | — |
812
+
813
+ ### OpenEndpoint (`0x64`)
814
+
815
+ Category: **gateway**
816
+
817
+ > >
818
+
819
+ | Field | Type | Required | Default |
820
+ |-------|------|----------|---------|
821
+ | `gateway_id` | `u32` | yes | — |
822
+ | `name` | `string` | yes | — |
823
+ | `target` | `string` | no | — |
824
+
825
+ ### ListenUnix (`0x65`)
826
+
827
+ Category: **gateway**
828
+
829
+ > >
830
+
831
+ | Field | Type | Required | Default |
832
+ |-------|------|----------|---------|
833
+ | `listener_id` | `u32` | yes | — |
834
+ | `path` | `string` | yes | — |
835
+ | `replace` | `bool` | no | — |
836
+
837
+ ### OpenTcp (`0x70`)
838
+
839
+ Category: **gateway**
840
+
841
+ > >
842
+
843
+ | Field | Type | Required | Default |
844
+ |-------|------|----------|---------|
845
+ | `gateway_id` | `u32` | yes | — |
846
+ | `host` | `string` | yes | — |
847
+ | `port` | `u16` | yes | — |
848
+
849
+ ### OpenUdp (`0x71`)
850
+
851
+ Category: **gateway**
852
+
853
+ > >
854
+
855
+ | Field | Type | Required | Default |
856
+ |-------|------|----------|---------|
857
+ | `gateway_id` | `u32` | yes | — |
858
+ | `host` | `string` | yes | — |
859
+ | `port` | `u16` | yes | — |
860
+
861
+ ### ResolveDns (`0x72`)
862
+
863
+ Category: **gateway**
864
+
865
+ > >
866
+
867
+ | Field | Type | Required | Default |
868
+ |-------|------|----------|---------|
869
+ | `gateway_id` | `u32` | yes | — |
870
+ | `name` | `string` | yes | — |
871
+ | `record_type` | `string` | no | `"A"` |
872
+
873
+ ### GatewayOk (`0x73`)
874
+
875
+ Category: **gateway**
876
+
877
+ > >
878
+
879
+ | Field | Type | Required | Default |
880
+ |-------|------|----------|---------|
881
+ | `gateway_id` | `u32` | yes | — |
882
+ | `resolved_addr` | `string` | no | — |
883
+
884
+ ### GatewayFail (`0x74`)
885
+
886
+ Category: **gateway**
887
+
888
+ > >
889
+
890
+ | Field | Type | Required | Default |
891
+ |-------|------|----------|---------|
892
+ | `gateway_id` | `u32` | yes | — |
893
+ | `code` | `u32` | yes | — |
894
+ | `message` | `string` | yes | — |
895
+
896
+ ### GatewayClose (`0x75`)
897
+
898
+ Category: **gateway**
899
+
900
+ > >
901
+
902
+ | Field | Type | Required | Default |
903
+ |-------|------|----------|---------|
904
+ | `gateway_id` | `u32` | yes | — |
905
+ | `reason` | `string` | no | — |
906
+
907
+ ### InboundOpen (`0x76`)
908
+
909
+ Category: **gateway**
910
+
911
+ > >
912
+
913
+ | Field | Type | Required | Default |
914
+ |-------|------|----------|---------|
915
+ | `listener_id` | `u32` | yes | — |
916
+ | `channel_id` | `u32` | yes | — |
917
+ | `peer_addr` | `string` | yes | — |
918
+ | `peer_port` | `u16` | yes | — |
919
+
920
+ ### InboundAccept (`0x77`)
921
+
922
+ Category: **gateway**
923
+
924
+ > >
925
+
926
+ | Field | Type | Required | Default |
927
+ |-------|------|----------|---------|
928
+ | `channel_id` | `u32` | yes | — |
929
+ | `gateway_id` | `u32` | no | — |
930
+
931
+ ### InboundReject (`0x78`)
932
+
933
+ Category: **gateway**
934
+
935
+ > >
936
+
937
+ | Field | Type | Required | Default |
938
+ |-------|------|----------|---------|
939
+ | `channel_id` | `u32` | yes | — |
940
+ | `reason` | `string` | no | — |
941
+
942
+ ### DnsResult (`0x79`)
943
+
944
+ Category: **gateway**
945
+
946
+ > >
947
+
948
+ | Field | Type | Required | Default |
949
+ |-------|------|----------|---------|
950
+ | `gateway_id` | `u32` | yes | — |
951
+ | `addresses` | `string[]` | yes | — |
952
+ | `ttl` | `u32` | no | — |
953
+
954
+ ### ListenRequest (`0x7a`)
955
+
956
+ Category: **gateway**
957
+
958
+ > >
959
+
960
+ | Field | Type | Required | Default |
961
+ |-------|------|----------|---------|
962
+ | `listener_id` | `u32` | yes | — |
963
+ | `port` | `u16` | yes | — |
964
+ | `bind_addr` | `string` | no | `"0.0.0.0"` |
965
+
966
+ ### ListenOk (`0x7b`)
967
+
968
+ Category: **gateway**
969
+
970
+ > >
971
+
972
+ | Field | Type | Required | Default |
973
+ |-------|------|----------|---------|
974
+ | `listener_id` | `u32` | yes | — |
975
+ | `actual_port` | `u16` | yes | — |
976
+
977
+ ### ListenFail (`0x7c`)
978
+
979
+ Category: **gateway**
980
+
981
+ > >
982
+
983
+ | Field | Type | Required | Default |
984
+ |-------|------|----------|---------|
985
+ | `listener_id` | `u32` | yes | — |
986
+ | `reason` | `string` | yes | — |
987
+
988
+ ### ListenClose (`0x7d`)
989
+
990
+ Category: **gateway**
991
+
992
+ > >
993
+
994
+ | Field | Type | Required | Default |
995
+ |-------|------|----------|---------|
996
+ | `listener_id` | `u32` | yes | — |
997
+
998
+ ### GatewayData (`0x7e`)
999
+
1000
+ Category: **gateway**
1001
+
1002
+ > >
1003
+
1004
+ | Field | Type | Required | Default |
1005
+ |-------|------|----------|---------|
1006
+ | `gateway_id` | `u32` | yes | — |
1007
+ | `data` | `bytes` | yes | — |
1008
+
1009
+ ### GatewayCredit (`0x7f`)
1010
+
1011
+ Category: **gateway**
1012
+
1013
+ > >
1014
+
1015
+ | Field | Type | Required | Default |
1016
+ |-------|------|----------|---------|
1017
+ | `gateway_id` | `u32` | yes | — |
1018
+ | `bytes` | `u32` | yes | — |
1019
+
1020
+ ### GuestInvite (`0x80`)
1021
+
1022
+ Category: **guest**
1023
+
1024
+ > >
1025
+
1026
+ | Field | Type | Required | Default |
1027
+ |-------|------|----------|---------|
1028
+ | `session_id` | `string` | yes | — |
1029
+ | `ttl` | `u64` | yes | — |
1030
+ | `permissions` | `string[]` | no | `["read"]` |
1031
+
1032
+ ### GuestJoin (`0x81`)
1033
+
1034
+ Category: **guest**
1035
+
1036
+ > >
1037
+
1038
+ | Field | Type | Required | Default |
1039
+ |-------|------|----------|---------|
1040
+ | `token` | `string` | yes | — |
1041
+ | `device_label` | `string` | no | — |
1042
+
1043
+ ### GuestRevoke (`0x82`)
1044
+
1045
+ Category: **guest**
1046
+
1047
+ > >
1048
+
1049
+ | Field | Type | Required | Default |
1050
+ |-------|------|----------|---------|
1051
+ | `token` | `string` | yes | — |
1052
+ | `reason` | `string` | no | — |
1053
+
1054
+ ### ShareSession (`0x83`)
1055
+
1056
+ Category: **sharing**
1057
+
1058
+ > >
1059
+
1060
+ | Field | Type | Required | Default |
1061
+ |-------|------|----------|---------|
1062
+ | `session_id` | `string` | yes | — |
1063
+ | `mode` | `string` | no | `"read"` |
1064
+ | `ttl` | `u64` | yes | — |
1065
+
1066
+ ### ShareRevoke (`0x84`)
1067
+
1068
+ Category: **sharing**
1069
+
1070
+ > >
1071
+
1072
+ | Field | Type | Required | Default |
1073
+ |-------|------|----------|---------|
1074
+ | `share_id` | `string` | yes | — |
1075
+ | `reason` | `string` | no | — |
1076
+
1077
+ ### CompressBegin (`0x85`)
1078
+
1079
+ Category: **compression**
1080
+
1081
+ > >
1082
+
1083
+ | Field | Type | Required | Default |
1084
+ |-------|------|----------|---------|
1085
+ | `algorithm` | `string` | yes | — |
1086
+ | `level` | `u32` | no | `3` |
1087
+
1088
+ ### CompressAck (`0x86`)
1089
+
1090
+ Category: **compression**
1091
+
1092
+ > >
1093
+
1094
+ | Field | Type | Required | Default |
1095
+ |-------|------|----------|---------|
1096
+ | `algorithm` | `string` | yes | — |
1097
+ | `accepted` | `bool` | yes | — |
1098
+
1099
+ ### RateControl (`0x87`)
1100
+
1101
+ Category: **ratecontrol**
1102
+
1103
+ > >
1104
+
1105
+ | Field | Type | Required | Default |
1106
+ |-------|------|----------|---------|
1107
+ | `session_id` | `string` | yes | — |
1108
+ | `max_bytes_per_sec` | `u64` | yes | — |
1109
+ | `policy` | `string` | no | `"pause"` |
1110
+
1111
+ ### RateWarning (`0x88`)
1112
+
1113
+ Category: **ratecontrol**
1114
+
1115
+ > >
1116
+
1117
+ | Field | Type | Required | Default |
1118
+ |-------|------|----------|---------|
1119
+ | `session_id` | `string` | yes | — |
1120
+ | `queued_bytes` | `u64` | yes | — |
1121
+ | `action` | `string` | yes | — |
1122
+
1123
+ ### SessionLink (`0x89`)
1124
+
1125
+ Category: **linking**
1126
+
1127
+ > >
1128
+
1129
+ | Field | Type | Required | Default |
1130
+ |-------|------|----------|---------|
1131
+ | `source_session` | `string` | yes | — |
1132
+ | `target_host` | `string` | yes | — |
1133
+ | `target_port` | `u16` | yes | — |
1134
+ | `target_user` | `string` | no | — |
1135
+
1136
+ ### SessionUnlink (`0x8a`)
1137
+
1138
+ Category: **linking**
1139
+
1140
+ > >
1141
+
1142
+ | Field | Type | Required | Default |
1143
+ |-------|------|----------|---------|
1144
+ | `link_id` | `string` | yes | — |
1145
+ | `reason` | `string` | no | — |
1146
+
1147
+ ### CopilotAttach (`0x8b`)
1148
+
1149
+ Category: **copilot**
1150
+
1151
+ > >
1152
+
1153
+ | Field | Type | Required | Default |
1154
+ |-------|------|----------|---------|
1155
+ | `session_id` | `string` | yes | — |
1156
+ | `model` | `string` | yes | — |
1157
+ | `context_window` | `u64` | no | — |
1158
+
1159
+ ### CopilotSuggest (`0x8c`)
1160
+
1161
+ Category: **copilot**
1162
+
1163
+ > >
1164
+
1165
+ | Field | Type | Required | Default |
1166
+ |-------|------|----------|---------|
1167
+ | `session_id` | `string` | yes | — |
1168
+ | `suggestion` | `string` | yes | — |
1169
+ | `confidence` | `f64` | no | — |
1170
+
1171
+ ### CopilotDetach (`0x8d`)
1172
+
1173
+ Category: **copilot**
1174
+
1175
+ > >
1176
+
1177
+ | Field | Type | Required | Default |
1178
+ |-------|------|----------|---------|
1179
+ | `session_id` | `string` | yes | — |
1180
+ | `reason` | `string` | no | — |
1181
+
1182
+ ### KeyExchange (`0x8e`)
1183
+
1184
+ Category: **e2e**
1185
+
1186
+ > >
1187
+
1188
+ | Field | Type | Required | Default |
1189
+ |-------|------|----------|---------|
1190
+ | `algorithm` | `string` | yes | — |
1191
+ | `public_key` | `bytes` | no | — |
1192
+ | `session_id` | `string` | yes | — |
1193
+ | `kem_public_key` | `bytes` | no | — |
1194
+ | `kem_ciphertext` | `bytes` | no | — |
1195
+ | `signature` | `bytes` | no | — |
1196
+
1197
+ ### EncryptedFrame (`0x8f`)
1198
+
1199
+ Category: **e2e**
1200
+
1201
+ > >
1202
+
1203
+ | Field | Type | Required | Default |
1204
+ |-------|------|----------|---------|
1205
+ | `channel_id` | `u32` | yes | — |
1206
+ | `nonce` | `bytes` | yes | — |
1207
+ | `ciphertext` | `bytes` | yes | — |
1208
+ | `session_id` | `string` | yes | — |
1209
+
1210
+ ### EchoAck (`0x90`)
1211
+
1212
+ Category: **echo**
1213
+
1214
+ > >
1215
+
1216
+ | Field | Type | Required | Default |
1217
+ |-------|------|----------|---------|
1218
+ | `channel_id` | `u32` | yes | — |
1219
+ | `echo_seq` | `u64` | yes | — |
1220
+
1221
+ ### EchoState (`0x91`)
1222
+
1223
+ Category: **echo**
1224
+
1225
+ > >
1226
+
1227
+ | Field | Type | Required | Default |
1228
+ |-------|------|----------|---------|
1229
+ | `channel_id` | `u32` | yes | — |
1230
+ | `echo_seq` | `u64` | yes | — |
1231
+ | `cursor_x` | `u16` | yes | — |
1232
+ | `cursor_y` | `u16` | yes | — |
1233
+ | `pending` | `u32` | yes | — |
1234
+
1235
+ ### TermSync (`0x92`)
1236
+
1237
+ Category: **termsync**
1238
+
1239
+ > >
1240
+
1241
+ | Field | Type | Required | Default |
1242
+ |-------|------|----------|---------|
1243
+ | `channel_id` | `u32` | yes | — |
1244
+ | `frame_seq` | `u64` | yes | — |
1245
+ | `state_hash` | `bytes` | yes | — |
1246
+
1247
+ ### TermDiff (`0x93`)
1248
+
1249
+ Category: **termsync**
1250
+
1251
+ > >
1252
+
1253
+ | Field | Type | Required | Default |
1254
+ |-------|------|----------|---------|
1255
+ | `channel_id` | `u32` | yes | — |
1256
+ | `frame_seq` | `u64` | yes | — |
1257
+ | `base_seq` | `u64` | yes | — |
1258
+ | `patch` | `bytes` | yes | — |
1259
+
1260
+ ### NodeAnnounce (`0x94`)
1261
+
1262
+ Category: **scaling**
1263
+
1264
+ > >
1265
+
1266
+ | Field | Type | Required | Default |
1267
+ |-------|------|----------|---------|
1268
+ | `node_id` | `string` | yes | — |
1269
+ | `endpoint` | `string` | yes | — |
1270
+ | `load` | `f64` | yes | — |
1271
+ | `capacity` | `u32` | yes | — |
1272
+
1273
+ ### NodeRedirect (`0x95`)
1274
+
1275
+ Category: **scaling**
1276
+
1277
+ > >
1278
+
1279
+ | Field | Type | Required | Default |
1280
+ |-------|------|----------|---------|
1281
+ | `target_node` | `string` | yes | — |
1282
+ | `target_endpoint` | `string` | yes | — |
1283
+ | `session_id` | `string` | yes | — |
1284
+ | `reason` | `string` | no | — |
1285
+
1286
+ ### SessionGrant (`0x96`)
1287
+
1288
+ Category: **principals**
1289
+
1290
+ > >
1291
+
1292
+ | Field | Type | Required | Default |
1293
+ |-------|------|----------|---------|
1294
+ | `session_id` | `string` | yes | — |
1295
+ | `principal` | `string` | yes | — |
1296
+ | `permissions` | `string[]` | no | `["read"]` |
1297
+
1298
+ ### SessionRevoke (`0x97`)
1299
+
1300
+ Category: **principals**
1301
+
1302
+ > >
1303
+
1304
+ | Field | Type | Required | Default |
1305
+ |-------|------|----------|---------|
1306
+ | `session_id` | `string` | yes | — |
1307
+ | `principal` | `string` | yes | — |
1308
+ | `reason` | `string` | no | — |
1309
+
1310
+ ### FileOp (`0x98`)
1311
+
1312
+ Category: **filechannel**
1313
+
1314
+ > >
1315
+
1316
+ | Field | Type | Required | Default |
1317
+ |-------|------|----------|---------|
1318
+ | `channel_id` | `u32` | yes | — |
1319
+ | `op` | `string` | yes | — |
1320
+ | `path` | `string` | yes | — |
1321
+ | `offset` | `u64` | no | — |
1322
+ | `length` | `u64` | no | — |
1323
+ | `target` | `string` | no | — |
1324
+
1325
+ ### FileResult (`0x99`)
1326
+
1327
+ Category: **filechannel**
1328
+
1329
+ > >
1330
+
1331
+ | Field | Type | Required | Default |
1332
+ |-------|------|----------|---------|
1333
+ | `channel_id` | `u32` | yes | — |
1334
+ | `success` | `bool` | yes | — |
1335
+ | `metadata` | `json` | no | `{}` |
1336
+ | `entries` | `FileEntry[]` | no | `[]` |
1337
+ | `error_message` | `string` | no | — |
1338
+
1339
+ ### FileChunk (`0x9a`)
1340
+
1341
+ Category: **filechannel**
1342
+
1343
+ > >
1344
+
1345
+ | Field | Type | Required | Default |
1346
+ |-------|------|----------|---------|
1347
+ | `channel_id` | `u32` | yes | — |
1348
+ | `offset` | `u64` | yes | — |
1349
+ | `data` | `bytes` | yes | — |
1350
+ | `is_final` | `bool` | yes | — |
1351
+ | `total_size` | `u64` | yes | — |
1352
+
1353
+ ### PolicyEval (`0x9b`)
1354
+
1355
+ Category: **policy**
1356
+
1357
+ > >
1358
+
1359
+ | Field | Type | Required | Default |
1360
+ |-------|------|----------|---------|
1361
+ | `request_id` | `string` | yes | — |
1362
+ | `action` | `string` | yes | — |
1363
+ | `principal` | `string` | yes | — |
1364
+ | `context` | `json` | no | `{}` |
1365
+
1366
+ ### PolicyResult (`0x9c`)
1367
+
1368
+ Category: **policy**
1369
+
1370
+ > >
1371
+
1372
+ | Field | Type | Required | Default |
1373
+ |-------|------|----------|---------|
1374
+ | `request_id` | `string` | yes | — |
1375
+ | `allowed` | `bool` | yes | — |
1376
+ | `reason` | `string` | no | — |
1377
+
1378
+ ### PolicyUpdate (`0x9d`)
1379
+
1380
+ Category: **policy**
1381
+
1382
+ > >
1383
+
1384
+ | Field | Type | Required | Default |
1385
+ |-------|------|----------|---------|
1386
+ | `policy_id` | `string` | yes | — |
1387
+ | `rules` | `json` | yes | — |
1388
+ | `version` | `u64` | yes | — |
1389
+
1390
+ ### TerminalConfig (`0x9e`)
1391
+
1392
+ Category: **terminal**
1393
+
1394
+ > >
1395
+
1396
+ | Field | Type | Required | Default |
1397
+ |-------|------|----------|---------|
1398
+ | `channel_id` | `u32` | yes | — |
1399
+ | `frontend` | `string` | yes | — |
1400
+ | `options` | `json` | no | `{}` |
1401
+
1402
+ ### AuthorizedKeyAdd (`0x9f`)
1403
+
1404
+ Category: **keys**
1405
+
1406
+ > >
1407
+
1408
+ | Field | Type | Required | Default |
1409
+ |-------|------|----------|---------|
1410
+ | `public_key` | `bytes` | yes | — |
1411
+ | `comment` | `string` | no | — |
1412
+
1413
+ ### AuthorizedKeyResult (`0xa0`)
1414
+
1415
+ Category: **keys**
1416
+
1417
+ > >
1418
+
1419
+ | Field | Type | Required | Default |
1420
+ |-------|------|----------|---------|
1421
+ | `success` | `bool` | yes | — |
1422
+ | `added` | `bool` | no | `false` |
1423
+ | `error_message` | `string` | no | — |
1424
+
1425
+ ### ShareOffer (`0xa8`)
1426
+
1427
+ Category: **shares**
1428
+
1429
+ > >
1430
+
1431
+ | Field | Type | Required | Default |
1432
+ |-------|------|----------|---------|
1433
+ | `shares` | `string[]` | yes | — |
1434
+ | `writable` | `string[]` | no | `[]` |
1435
+ | `max_inflight` | `u32` | yes | — |
1436
+ | `max_bytes` | `u32` | yes | — |
1437
+ | `paths` | `string[]` | no | — |
1438
+
1439
+ ### ShareRequest (`0xa9`)
1440
+
1441
+ Category: **shares**
1442
+
1443
+ > >
1444
+
1445
+ | Field | Type | Required | Default |
1446
+ |-------|------|----------|---------|
1447
+ | `request_id` | `u32` | yes | — |
1448
+ | `share` | `string` | yes | — |
1449
+ | `op` | `string` | yes | — |
1450
+ | `path` | `string` | no | — |
1451
+ | `to` | `string` | no | — |
1452
+ | `handle` | `u32` | no | — |
1453
+ | `offset` | `u64` | no | — |
1454
+ | `length` | `u32` | no | — |
1455
+ | `mode` | `u32` | no | — |
1456
+ | `flags` | `string[]` | no | `[]` |
1457
+ | `cursor` | `string` | no | — |
1458
+ | `attr` | `json` | no | `{}` |
1459
+ | `data` | `bytes` | no | — |
1460
+
1461
+ ### ShareReply (`0xaa`)
1462
+
1463
+ Category: **shares**
1464
+
1465
+ > >
1466
+
1467
+ | Field | Type | Required | Default |
1468
+ |-------|------|----------|---------|
1469
+ | `request_id` | `u32` | yes | — |
1470
+ | `ok` | `bool` | yes | — |
1471
+ | `errno` | `string` | no | — |
1472
+ | `message` | `string` | no | — |
1473
+ | `attr` | `json` | no | `{}` |
1474
+ | `entries` | `json` | no | `[]` |
1475
+ | `cursor` | `string` | no | — |
1476
+ | `handle` | `u32` | no | — |
1477
+ | `data` | `bytes` | no | — |
1478
+ | `eof` | `bool` | no | — |
1479
+ | `written` | `u32` | no | — |
1480
+ | `target` | `string` | no | — |
1481
+
1482
+ ### ListTargets (`0xab`)
1483
+
1484
+ Category: **targets**
1485
+
1486
+ > >
1487
+
1488
+ *No fields.*
1489
+
1490
+ ### TargetList (`0xac`)
1491
+
1492
+ Category: **targets**
1493
+
1494
+ > >
1495
+
1496
+ | Field | Type | Required | Default |
1497
+ |-------|------|----------|---------|
1498
+ | `targets` | `TargetInfo[]` | yes | — |
1499
+
1500
+ ## Nested Types
1501
+
1502
+ ### TargetInfo
1503
+
1504
+ | Field | Type | Required | Default |
1505
+ |-------|------|----------|---------|
1506
+ | `name` | `string` | yes | — |
1507
+ | `description` | `string` | no | — |
1508
+ | `capabilities` | `string[]` | no | `[]` |
1509
+
1510
+ ### FileEntry
1511
+
1512
+ | Field | Type | Required | Default |
1513
+ |-------|------|----------|---------|
1514
+ | `name` | `string` | yes | — |
1515
+ | `size` | `u64` | yes | — |
1516
+ | `modified` | `u64` | yes | — |
1517
+ | `type` | `FileEntryType` | yes | — |
1518
+ | `symlink_target` | `string` | no | — |
1519
+
1520
+ ### AttachmentInfo
1521
+
1522
+ | Field | Type | Required | Default |
1523
+ |-------|------|----------|---------|
1524
+ | `session_id` | `string` | yes | — |
1525
+ | `mode` | `string` | yes | — |
1526
+ | `username` | `string` | no | — |
1527
+ | `channel_id` | `u32` | no | — |
1528
+ | `seq` | `u64` | no | — |
1529
+
1530
+ ### PeerInfo
1531
+
1532
+ | Field | Type | Required | Default |
1533
+ |-------|------|----------|---------|
1534
+ | `fingerprint` | `string` | yes | — |
1535
+ | `fingerprint_short` | `string` | yes | — |
1536
+ | `username` | `string` | yes | — |
1537
+ | `capabilities` | `string[]` | no | `[]` |
1538
+ | `peer_type` | `string` | no | `"host"` |
1539
+ | `shell_backend` | `string` | no | `"pty"` |
1540
+ | `source` | `string` | no | `"wsh-relay"` |
1541
+ | `supports_attach` | `bool` | no | `false` |
1542
+ | `supports_replay` | `bool` | no | `false` |
1543
+ | `supports_echo` | `bool` | no | `false` |
1544
+ | `supports_term_sync` | `bool` | no | `false` |
1545
+ | `last_seen` | `u64` | no | — |
1546
+ | `public_key` | `bytes` | no | — |
1547
+ | `seq` | `u64` | no | — |
1548
+ | `record_signature` | `bytes` | no | — |
1549
+
1550
+ ### McpToolSpec
1551
+
1552
+ | Field | Type | Required | Default |
1553
+ |-------|------|----------|---------|
1554
+ | `name` | `string` | yes | — |
1555
+ | `description` | `string` | yes | — |
1556
+ | `parameters` | `json` | no | `{}` |
1557
+
1558
+ ### SessionSummary
1559
+
1560
+ | Field | Type | Required | Default |
1561
+ |-------|------|----------|---------|
1562
+ | `session_id` | `string` | yes | — |
1563
+ | `name` | `string` | no | — |
1564
+ | `username` | `string` | yes | — |
1565
+ | `fingerprint_short` | `string` | yes | — |
1566
+ | `created_at_secs` | `u64` | yes | — |
1567
+ | `idle_secs` | `u64` | yes | — |
1568
+ | `attached_count` | `u32` | yes | — |
1569
+
1570
+ ## Crypto Primitives
1571
+
1572
+ ### Auth Transcript
1573
+
1574
+ - **Algorithm**: SHA-256
1575
+ - **Formula**: `SHA-256(PROTOCOL_VERSION || "" || lp(username) || lp(session_id) || nonce)`
1576
+ - **Note**: lp() is a 4-byte big-endian length prefix, applied to username and session_id since both are variable-length strings that would otherwise be ambiguous when concatenated. username binds the transcript to a specific identity so a signature can't be replayed under a different username. channelBinding can be appended but defaults to empty (no server host-identity binding exists in the protocol yet).
1577
+
1578
+ ### Fingerprint
1579
+
1580
+ - **Algorithm**: SHA-256
1581
+ - **Input**: raw_ed25519_public_key_32_bytes
1582
+ - **Output**: hex_encoded_64_chars
1583
+
1584
+ ### Session Token
1585
+
1586
+ - **Format**: `[8B expiry_be][32B HMAC-SHA256(secret, session_id || expiry)]`
1587
+ - **Total bytes**: 40
1588
+
1589
+ ### Key Type: Ed25519
1590
+
1591
+ - **SSH wire format**: `[4B len]["ssh-ed25519"][4B len][32B raw_key]`
1592
+
1593
+ ## Transport Bindings
1594
+
1595
+ ### WebTransport
1596
+
1597
+ QUIC streams as channels. 1 bidi = control. Per channel: 1 bidi + optional uni.
1598
+
1599
+ ### WebSocket
1600
+
1601
+ - **Framing**: `[1B frame_type][4B stream_id][payload]`
1602
+ - **control frame type**: `0x01`
1603
+ - **data frame type**: `0x02`
1604
+ - **open_stream frame type**: `0x03`
1605
+ - **close_stream frame type**: `0x04`
1606
+
1607
+ Stream 0 carries length-prefixed CBOR control messages (frameEncode/FrameDecoder); other stream IDs carry raw data bytes with no extra framing. See src/transport-ws.mjs for the reference implementation.