@mostra/protocol 0.6.2 → 0.8.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 (73) hide show
  1. package/dist/actions.d.ts +12 -0
  2. package/dist/actions.d.ts.map +1 -1
  3. package/dist/actions.js.map +1 -1
  4. package/dist/bridge.d.ts +25 -0
  5. package/dist/bridge.d.ts.map +1 -1
  6. package/dist/bridge.js +32 -2
  7. package/dist/bridge.js.map +1 -1
  8. package/dist/browser.d.ts +76 -0
  9. package/dist/browser.d.ts.map +1 -1
  10. package/dist/browser.js +45 -2
  11. package/dist/browser.js.map +1 -1
  12. package/dist/diagnostics/codes/hygiene.d.ts +1 -1
  13. package/dist/diagnostics/codes/hygiene.d.ts.map +1 -1
  14. package/dist/diagnostics/codes/hygiene.js +12 -1
  15. package/dist/diagnostics/codes/hygiene.js.map +1 -1
  16. package/dist/diagnostics/codes/index.d.ts +3 -2
  17. package/dist/diagnostics/codes/index.d.ts.map +1 -1
  18. package/dist/diagnostics/codes/index.js +3 -1
  19. package/dist/diagnostics/codes/index.js.map +1 -1
  20. package/dist/diagnostics/codes/share.d.ts +8 -0
  21. package/dist/diagnostics/codes/share.d.ts.map +1 -0
  22. package/dist/diagnostics/codes/share.js +88 -0
  23. package/dist/diagnostics/codes/share.js.map +1 -0
  24. package/dist/hygiene.d.ts.map +1 -1
  25. package/dist/hygiene.js +2 -1
  26. package/dist/hygiene.js.map +1 -1
  27. package/dist/ids.d.ts +5 -1
  28. package/dist/ids.d.ts.map +1 -1
  29. package/dist/ids.js +3 -1
  30. package/dist/ids.js.map +1 -1
  31. package/dist/index.d.ts +10 -5
  32. package/dist/index.js +9 -4
  33. package/dist/methods/index.d.ts.map +1 -1
  34. package/dist/methods/index.js +9 -1
  35. package/dist/methods/index.js.map +1 -1
  36. package/dist/methods/instance/status.d.ts +24 -0
  37. package/dist/methods/instance/status.d.ts.map +1 -1
  38. package/dist/methods/instance/status.js +11 -2
  39. package/dist/methods/instance/status.js.map +1 -1
  40. package/dist/methods/port/addressing-external-base.d.ts +52 -0
  41. package/dist/methods/port/addressing-external-base.d.ts.map +1 -0
  42. package/dist/methods/port/addressing-external-base.js +61 -0
  43. package/dist/methods/port/addressing-external-base.js.map +1 -0
  44. package/dist/methods/share/list.d.ts +23 -0
  45. package/dist/methods/share/list.d.ts.map +1 -0
  46. package/dist/methods/share/list.js +29 -0
  47. package/dist/methods/share/list.js.map +1 -0
  48. package/dist/methods/share/start.d.ts +96 -0
  49. package/dist/methods/share/start.d.ts.map +1 -0
  50. package/dist/methods/share/start.js +73 -0
  51. package/dist/methods/share/start.js.map +1 -0
  52. package/dist/methods/share/stop.d.ts +29 -0
  53. package/dist/methods/share/stop.d.ts.map +1 -0
  54. package/dist/methods/share/stop.js +32 -0
  55. package/dist/methods/share/stop.js.map +1 -0
  56. package/package.json +2 -2
  57. package/schemas/protocol.draft-07.json +535 -0
  58. package/schemas/protocol.schema.json +507 -0
  59. package/src/actions.ts +12 -0
  60. package/src/bridge.ts +49 -0
  61. package/src/browser.ts +118 -0
  62. package/src/diagnostics/codes/hygiene.ts +12 -0
  63. package/src/diagnostics/codes/index.ts +6 -2
  64. package/src/diagnostics/codes/share.ts +100 -0
  65. package/src/hygiene.ts +1 -0
  66. package/src/ids.ts +9 -1
  67. package/src/index.ts +39 -0
  68. package/src/methods/index.ts +8 -0
  69. package/src/methods/instance/status.ts +38 -0
  70. package/src/methods/port/addressing-external-base.ts +113 -0
  71. package/src/methods/share/list.ts +42 -0
  72. package/src/methods/share/start.ts +150 -0
  73. package/src/methods/share/stop.ts +50 -0
@@ -185,6 +185,16 @@
185
185
  "$ref": "#/$defs/MostraShutdownResult"
186
186
  }
187
187
  },
188
+ "port/addressing.externalBase": {
189
+ "direction": "instance-to-host",
190
+ "mutating": false,
191
+ "params": {
192
+ "$ref": "#/$defs/PortAddressingExternalBaseParams"
193
+ },
194
+ "result": {
195
+ "$ref": "#/$defs/PortAddressingExternalBaseResult"
196
+ }
197
+ },
188
198
  "port/drafts.mirror": {
189
199
  "direction": "instance-to-host",
190
200
  "mutating": false,
@@ -281,6 +291,36 @@
281
291
  "$ref": "#/$defs/SecretEntry"
282
292
  }
283
293
  },
294
+ "share/list": {
295
+ "direction": "client-to-instance",
296
+ "mutating": false,
297
+ "params": {
298
+ "$ref": "#/$defs/ShareListParams"
299
+ },
300
+ "result": {
301
+ "$ref": "#/$defs/ShareListResult"
302
+ }
303
+ },
304
+ "share/start": {
305
+ "direction": "client-to-instance",
306
+ "mutating": true,
307
+ "params": {
308
+ "$ref": "#/$defs/ShareStartParams"
309
+ },
310
+ "result": {
311
+ "$ref": "#/$defs/ShareStartResult"
312
+ }
313
+ },
314
+ "share/stop": {
315
+ "direction": "client-to-instance",
316
+ "mutating": true,
317
+ "params": {
318
+ "$ref": "#/$defs/ShareStopParams"
319
+ },
320
+ "result": {
321
+ "$ref": "#/$defs/ShareStopResult"
322
+ }
323
+ },
284
324
  "state/get": {
285
325
  "direction": "client-to-instance",
286
326
  "mutating": false,
@@ -2005,6 +2045,38 @@
2005
2045
  "pattern": "^[1-9][0-9]{0,8}[smhd]$",
2006
2046
  "description": "A duration: a positive whole number and s, m, h or d, such as 30m, 24h or 7d."
2007
2047
  },
2048
+ "EnterRequest": {
2049
+ "type": "object",
2050
+ "properties": {
2051
+ "ticket": {
2052
+ "type": "string",
2053
+ "minLength": 1,
2054
+ "maxLength": 64
2055
+ }
2056
+ },
2057
+ "required": [
2058
+ "ticket"
2059
+ ],
2060
+ "description": "A frame ticket to exchange."
2061
+ },
2062
+ "EnterResult": {
2063
+ "type": "object",
2064
+ "properties": {
2065
+ "session": {
2066
+ "type": "string",
2067
+ "minLength": 1
2068
+ },
2069
+ "shellOrigin": {
2070
+ "type": "string",
2071
+ "minLength": 1
2072
+ }
2073
+ },
2074
+ "required": [
2075
+ "session",
2076
+ "shellOrigin"
2077
+ ],
2078
+ "description": "A worker-mode frame session's secret and the shell's origin."
2079
+ },
2008
2080
  "EventFilter": {
2009
2081
  "type": "object",
2010
2082
  "properties": {
@@ -2239,6 +2311,25 @@
2239
2311
  "type": "object",
2240
2312
  "properties": {}
2241
2313
  },
2314
+ "ExternalBase": {
2315
+ "type": "object",
2316
+ "properties": {
2317
+ "origin": {
2318
+ "$ref": "#/$defs/OriginString"
2319
+ },
2320
+ "mode": {
2321
+ "type": "string",
2322
+ "enum": [
2323
+ "cookie",
2324
+ "worker"
2325
+ ]
2326
+ }
2327
+ },
2328
+ "required": [
2329
+ "origin"
2330
+ ],
2331
+ "description": "The origin browsers use for a listener, and how its frame authenticates there."
2332
+ },
2242
2333
  "FieldConflict": {
2243
2334
  "type": "object",
2244
2335
  "properties": {
@@ -2379,6 +2470,52 @@
2379
2470
  ],
2380
2471
  "description": "Whether the viewer follows the artifact's new versions."
2381
2472
  },
2473
+ "FrameSessionFacts": {
2474
+ "type": "object",
2475
+ "properties": {
2476
+ "csrf": {
2477
+ "type": "string",
2478
+ "minLength": 1
2479
+ },
2480
+ "artifactId": {
2481
+ "$ref": "#/$defs/ArtifactId"
2482
+ },
2483
+ "shellOrigin": {
2484
+ "type": "string",
2485
+ "minLength": 1
2486
+ },
2487
+ "scopes": {
2488
+ "readOnly": true,
2489
+ "type": "array",
2490
+ "items": {
2491
+ "type": "string"
2492
+ }
2493
+ },
2494
+ "viewer": {
2495
+ "$ref": "#/$defs/Viewer"
2496
+ },
2497
+ "version": {
2498
+ "$ref": "#/$defs/VersionRef"
2499
+ },
2500
+ "mode": {
2501
+ "type": "string",
2502
+ "enum": [
2503
+ "cookie",
2504
+ "worker"
2505
+ ]
2506
+ },
2507
+ "streams": {
2508
+ "type": "boolean"
2509
+ }
2510
+ },
2511
+ "required": [
2512
+ "csrf",
2513
+ "artifactId",
2514
+ "shellOrigin",
2515
+ "scopes"
2516
+ ],
2517
+ "description": "A frame session's CSRF token, shell origin, scopes, viewer, version and mode."
2518
+ },
2382
2519
  "FrameTicket": {
2383
2520
  "type": "object",
2384
2521
  "properties": {
@@ -2444,6 +2581,10 @@
2444
2581
  "devPreview": {
2445
2582
  "type": "boolean",
2446
2583
  "const": true
2584
+ },
2585
+ "mode": {
2586
+ "type": "string",
2587
+ "const": "worker"
2447
2588
  }
2448
2589
  },
2449
2590
  "required": [
@@ -2489,6 +2630,40 @@
2489
2630
  "origin"
2490
2631
  ]
2491
2632
  }
2633
+ },
2634
+ "faces": {
2635
+ "readOnly": true,
2636
+ "type": "array",
2637
+ "items": {
2638
+ "type": "object",
2639
+ "properties": {
2640
+ "origin": {
2641
+ "type": "string"
2642
+ },
2643
+ "local": {
2644
+ "type": "string"
2645
+ },
2646
+ "listener": {
2647
+ "type": "string",
2648
+ "enum": [
2649
+ "shell",
2650
+ "artifact"
2651
+ ]
2652
+ },
2653
+ "artifactId": {
2654
+ "type": "string"
2655
+ },
2656
+ "by": {
2657
+ "type": "string"
2658
+ }
2659
+ },
2660
+ "required": [
2661
+ "origin",
2662
+ "local",
2663
+ "listener",
2664
+ "by"
2665
+ ]
2666
+ }
2492
2667
  }
2493
2668
  },
2494
2669
  "required": [
@@ -2883,6 +3058,13 @@
2883
3058
  },
2884
3059
  "idleExitAt": {
2885
3060
  "type": "string"
3061
+ },
3062
+ "shares": {
3063
+ "readOnly": true,
3064
+ "type": "array",
3065
+ "items": {
3066
+ "$ref": "#/$defs/Share"
3067
+ }
2886
3068
  }
2887
3069
  },
2888
3070
  "required": [
@@ -3214,6 +3396,12 @@
3214
3396
  ],
3215
3397
  "description": "A mutation's outcome: the revision after it, the applied field IDs, the conflicts."
3216
3398
  },
3399
+ "OriginString": {
3400
+ "type": "string",
3401
+ "maxLength": 2048,
3402
+ "pattern": "^(?!http:\\/\\/[^/]*:80$)(?!https:\\/\\/[^/]*:443$)https?:\\/\\/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\\[[0-9a-f:.]+\\])(?::(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$",
3403
+ "description": "A web origin: scheme, host and a port only when it isn't the default."
3404
+ },
3217
3405
  "OrphanedField": {
3218
3406
  "type": "object",
3219
3407
  "properties": {
@@ -3271,6 +3459,42 @@
3271
3459
  ],
3272
3460
  "description": "A long-poll answer: the cursor, the events after the asked one, and a snapshot."
3273
3461
  },
3462
+ "PortAddressingExternalBaseParams": {
3463
+ "type": "object",
3464
+ "properties": {
3465
+ "artifactId": {
3466
+ "$ref": "#/$defs/ArtifactId"
3467
+ },
3468
+ "listener": {
3469
+ "type": "string",
3470
+ "enum": [
3471
+ "shell",
3472
+ "artifact"
3473
+ ]
3474
+ },
3475
+ "local": {
3476
+ "type": "string",
3477
+ "minLength": 1
3478
+ }
3479
+ },
3480
+ "required": [
3481
+ "artifactId",
3482
+ "listener",
3483
+ "local"
3484
+ ],
3485
+ "description": "Which listener of which artifact needs an external address, and where it listens."
3486
+ },
3487
+ "PortAddressingExternalBaseResult": {
3488
+ "anyOf": [
3489
+ {
3490
+ "$ref": "#/$defs/ExternalBase"
3491
+ },
3492
+ {
3493
+ "type": "null"
3494
+ }
3495
+ ],
3496
+ "description": "The external origin a host gives a listener, or null for loopback."
3497
+ },
3274
3498
  "PortIdentityResolveParams": {
3275
3499
  "type": "object",
3276
3500
  "properties": {
@@ -4359,6 +4583,258 @@
4359
4583
  "pattern": "^[0-9a-f]{64}$",
4360
4584
  "description": "A SHA-256 digest in lowercase hex."
4361
4585
  },
4586
+ "Share": {
4587
+ "type": "object",
4588
+ "properties": {
4589
+ "shareId": {
4590
+ "$ref": "#/$defs/ShareId"
4591
+ },
4592
+ "artifactId": {
4593
+ "$ref": "#/$defs/ArtifactId"
4594
+ },
4595
+ "via": {
4596
+ "$ref": "#/$defs/ShareVia"
4597
+ },
4598
+ "url": {
4599
+ "type": "string",
4600
+ "minLength": 1
4601
+ },
4602
+ "hostname": {
4603
+ "type": "string",
4604
+ "minLength": 1
4605
+ },
4606
+ "artifactOrigin": {
4607
+ "type": "string",
4608
+ "minLength": 1
4609
+ },
4610
+ "mode": {
4611
+ "type": "string",
4612
+ "enum": [
4613
+ "cookie",
4614
+ "worker"
4615
+ ]
4616
+ },
4617
+ "tokenId": {
4618
+ "$ref": "#/$defs/TokenId"
4619
+ },
4620
+ "startedAt": {
4621
+ "type": "string",
4622
+ "format": "date-time",
4623
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
4624
+ },
4625
+ "expiresAt": {
4626
+ "type": "string",
4627
+ "format": "date-time",
4628
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
4629
+ },
4630
+ "state": {
4631
+ "type": "string",
4632
+ "enum": [
4633
+ "active",
4634
+ "stopped"
4635
+ ]
4636
+ },
4637
+ "stoppedAt": {
4638
+ "type": "string",
4639
+ "format": "date-time",
4640
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
4641
+ },
4642
+ "stopReason": {
4643
+ "type": "string",
4644
+ "minLength": 1
4645
+ }
4646
+ },
4647
+ "required": [
4648
+ "shareId",
4649
+ "artifactId",
4650
+ "via",
4651
+ "hostname",
4652
+ "mode",
4653
+ "tokenId",
4654
+ "startedAt",
4655
+ "state"
4656
+ ],
4657
+ "description": "A share: its tunnel, link, address, frame mode and lifetime."
4658
+ },
4659
+ "ShareId": {
4660
+ "type": "string",
4661
+ "pattern": "^shr_[0-7][0-9A-HJKMNP-TV-Z]{25}$",
4662
+ "description": "Share ID: \"shr_\" followed by a 26-character ULID."
4663
+ },
4664
+ "ShareListParams": {
4665
+ "type": "object",
4666
+ "properties": {
4667
+ "artifact": {
4668
+ "$ref": "#/$defs/ArtifactRef"
4669
+ },
4670
+ "all": {
4671
+ "type": "boolean"
4672
+ }
4673
+ }
4674
+ },
4675
+ "ShareListResult": {
4676
+ "type": "object",
4677
+ "properties": {
4678
+ "shares": {
4679
+ "readOnly": true,
4680
+ "type": "array",
4681
+ "items": {
4682
+ "$ref": "#/$defs/Share"
4683
+ }
4684
+ }
4685
+ },
4686
+ "required": [
4687
+ "shares"
4688
+ ],
4689
+ "description": "Shares with their links and state."
4690
+ },
4691
+ "ShareStartParams": {
4692
+ "type": "object",
4693
+ "properties": {
4694
+ "artifact": {
4695
+ "$ref": "#/$defs/ArtifactRef"
4696
+ },
4697
+ "via": {
4698
+ "$ref": "#/$defs/ShareVia"
4699
+ },
4700
+ "ttl": {
4701
+ "$ref": "#/$defs/Duration"
4702
+ },
4703
+ "scopes": {
4704
+ "readOnly": true,
4705
+ "minItems": 1,
4706
+ "type": "array",
4707
+ "items": {
4708
+ "$ref": "#/$defs/CapabilityScope"
4709
+ }
4710
+ },
4711
+ "viewer": {
4712
+ "$ref": "#/$defs/ViewerSpec"
4713
+ },
4714
+ "requestId": {
4715
+ "type": "string",
4716
+ "minLength": 1
4717
+ }
4718
+ },
4719
+ "required": [
4720
+ "artifact",
4721
+ "via"
4722
+ ]
4723
+ },
4724
+ "ShareStartResult": {
4725
+ "type": "object",
4726
+ "properties": {
4727
+ "shareId": {
4728
+ "$ref": "#/$defs/ShareId"
4729
+ },
4730
+ "artifactId": {
4731
+ "$ref": "#/$defs/ArtifactId"
4732
+ },
4733
+ "via": {
4734
+ "$ref": "#/$defs/ShareVia"
4735
+ },
4736
+ "url": {
4737
+ "type": "string",
4738
+ "minLength": 1
4739
+ },
4740
+ "hostname": {
4741
+ "type": "string",
4742
+ "minLength": 1
4743
+ },
4744
+ "artifactOrigin": {
4745
+ "type": "string",
4746
+ "minLength": 1
4747
+ },
4748
+ "mode": {
4749
+ "type": "string",
4750
+ "enum": [
4751
+ "cookie",
4752
+ "worker"
4753
+ ]
4754
+ },
4755
+ "tokenId": {
4756
+ "$ref": "#/$defs/TokenId"
4757
+ },
4758
+ "startedAt": {
4759
+ "type": "string",
4760
+ "format": "date-time",
4761
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
4762
+ },
4763
+ "expiresAt": {
4764
+ "type": "string",
4765
+ "format": "date-time",
4766
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
4767
+ },
4768
+ "state": {
4769
+ "type": "string",
4770
+ "enum": [
4771
+ "active",
4772
+ "stopped"
4773
+ ]
4774
+ },
4775
+ "stoppedAt": {
4776
+ "type": "string",
4777
+ "format": "date-time",
4778
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
4779
+ },
4780
+ "stopReason": {
4781
+ "type": "string",
4782
+ "minLength": 1
4783
+ }
4784
+ },
4785
+ "required": [
4786
+ "shareId",
4787
+ "artifactId",
4788
+ "via",
4789
+ "url",
4790
+ "hostname",
4791
+ "mode",
4792
+ "tokenId",
4793
+ "startedAt",
4794
+ "state"
4795
+ ],
4796
+ "description": "The share that started, with its capability URL."
4797
+ },
4798
+ "ShareStopParams": {
4799
+ "type": "object",
4800
+ "properties": {
4801
+ "shareId": {
4802
+ "$ref": "#/$defs/ShareId"
4803
+ },
4804
+ "artifact": {
4805
+ "$ref": "#/$defs/ArtifactRef"
4806
+ },
4807
+ "requestId": {
4808
+ "type": "string",
4809
+ "minLength": 1
4810
+ }
4811
+ }
4812
+ },
4813
+ "ShareStopResult": {
4814
+ "type": "object",
4815
+ "properties": {
4816
+ "stopped": {
4817
+ "readOnly": true,
4818
+ "type": "array",
4819
+ "items": {
4820
+ "$ref": "#/$defs/Share"
4821
+ }
4822
+ }
4823
+ },
4824
+ "required": [
4825
+ "stopped"
4826
+ ],
4827
+ "description": "The shares that ended."
4828
+ },
4829
+ "ShareVia": {
4830
+ "type": "string",
4831
+ "enum": [
4832
+ "tailnet",
4833
+ "funnel",
4834
+ "cloudflare"
4835
+ ],
4836
+ "description": "How a share reaches its viewers: tailnet, funnel or cloudflare."
4837
+ },
4362
4838
  "ShellSubmitRequest": {
4363
4839
  "type": "object",
4364
4840
  "properties": {
@@ -4529,6 +5005,37 @@
4529
5005
  ],
4530
5006
  "description": "Where a page stands: cursor, viewer, draft, artifact state and its submission."
4531
5007
  },
5008
+ "StreamTicket": {
5009
+ "type": "object",
5010
+ "properties": {
5011
+ "ticket": {
5012
+ "type": "string",
5013
+ "minLength": 1
5014
+ },
5015
+ "expiresAt": {
5016
+ "type": "string",
5017
+ "format": "date-time",
5018
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
5019
+ }
5020
+ },
5021
+ "required": [
5022
+ "ticket",
5023
+ "expiresAt"
5024
+ ],
5025
+ "description": "A single-use ticket for one stream, poll or WebSocket."
5026
+ },
5027
+ "StreamTicketRequest": {
5028
+ "type": "object",
5029
+ "properties": {
5030
+ "purpose": {
5031
+ "type": "string",
5032
+ "enum": [
5033
+ "stream",
5034
+ "socket"
5035
+ ]
5036
+ }
5037
+ }
5038
+ },
4532
5039
  "SubmissionEnvelope": {
4533
5040
  "type": "object",
4534
5041
  "properties": {
package/src/actions.ts CHANGED
@@ -221,6 +221,13 @@ export interface LiveState {
221
221
  }[];
222
222
  /** The producer's last failure, while the last good value stays (FAILURE_MODEL §6). */
223
223
  readonly error?: WireError;
224
+ /**
225
+ * `true` while the source has no value and no failure and the artifact's latest version has a
226
+ * producer whose first `load` is on its way: the page shows it loading, and verify waits for it.
227
+ * Absent for a key nothing produces (one only `mostra push` writes) and for a source that only
228
+ * streams, whose first value may never come (WP-14's Opus review).
229
+ */
230
+ readonly awaiting?: boolean;
224
231
  }
225
232
 
226
233
  /** One live update on the event stream: never stored as an event (D63, LL-04). */
@@ -235,6 +242,11 @@ export interface LiveUpdate {
235
242
  readonly value?: Batches;
236
243
  /** What went wrong. */
237
244
  readonly error?: WireError;
245
+ /**
246
+ * `false` when a source read as {@link LiveState.awaiting} turned out to have no first `load`
247
+ * (its producer only streams): the page stops waiting for a first value.
248
+ */
249
+ readonly awaiting?: boolean;
238
250
  }
239
251
 
240
252
  /**
package/src/bridge.ts CHANGED
@@ -428,6 +428,53 @@ export const mostraFieldFocus: BridgeMessage<{ readonly id: string }, undefined>
428
428
  result: z.undefined(),
429
429
  };
430
430
 
431
+ /** The params of `mostra/frameSession.failed`. */
432
+ export interface FrameSessionFailedParams {
433
+ /** `MOSTRA_HYGIENE_FRAME_SESSION`. */
434
+ readonly code: string;
435
+ /** What went wrong, for the shell to show. */
436
+ readonly message: string;
437
+ /**
438
+ * Why: `unsupported` (this browser offers the frame no service worker, as in a private window),
439
+ * `blocked` (the browser refused to install it), `conflict` (another service worker holds `/`
440
+ * on the artifact's origin), or `refused` (the gateway refused the frame's entry).
441
+ */
442
+ readonly reason: "unsupported" | "blocked" | "conflict" | "refused" | (string & {});
443
+ }
444
+
445
+ /**
446
+ * `mostra/frameSession.failed`: the worker-mode bootstrap page (D70, D158 item 5) couldn't start
447
+ * the frame's session. It is sent before any client runtime runs, so the shell shows why instead
448
+ * of a frame that never greets.
449
+ */
450
+ export const mostraFrameSessionFailed: BridgeMessage<FrameSessionFailedParams, undefined> = {
451
+ method: "mostra/frameSession.failed",
452
+ from: "artifact",
453
+ kind: "notification",
454
+ params: z.looseObject({
455
+ code: z.string().min(1).max(128),
456
+ message: z.string().max(BRIDGE_TEXT_MAX),
457
+ reason: z.string().min(1).max(64),
458
+ }),
459
+ result: z.undefined(),
460
+ };
461
+
462
+ /**
463
+ * `mostra/frameSession.entered`: the worker-mode bootstrap page (D70, D158 item 5) has its
464
+ * session and its service worker, and is loading the version. The shell's wait for the frame's
465
+ * page starts here: the bootstrap's own load is not the page's (WP-13).
466
+ */
467
+ export const mostraFrameSessionEntered: BridgeMessage<
468
+ Readonly<Record<string, unknown>>,
469
+ undefined
470
+ > = {
471
+ method: "mostra/frameSession.entered",
472
+ from: "artifact",
473
+ kind: "notification",
474
+ params: z.looseObject({}),
475
+ result: z.undefined(),
476
+ };
477
+
431
478
  /**
432
479
  * Every message of the bridge in this release. WP-20 adds review messages; a message never
433
480
  * changes meaning once released (D32).
@@ -444,6 +491,8 @@ export const BRIDGE_MESSAGES: readonly AnyBridgeMessage[] = [
444
491
  mostraFlush,
445
492
  mostraVersionAvailable,
446
493
  mostraFieldFocus,
494
+ mostraFrameSessionFailed,
495
+ mostraFrameSessionEntered,
447
496
  ] as readonly AnyBridgeMessage[];
448
497
 
449
498
  /** The window events arrive on (`window` itself). */