@kubohiroya/turbowarp-webrtc-qrcode-pairing 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 (46) hide show
  1. package/LICENSE +373 -0
  2. package/README.ja.md +122 -0
  3. package/README.md +414 -0
  4. package/dist/extension-manifest.json +318 -0
  5. package/dist/webrtc-qrcode-pairing.js +4064 -0
  6. package/docs/architecture.ja.md +57 -0
  7. package/docs/architecture.md +65 -0
  8. package/docs/design/qr-pairing/README.md +16 -0
  9. package/docs/design/qr-pairing/architecture.md +191 -0
  10. package/docs/design/qr-pairing/block-api.md +123 -0
  11. package/docs/design/qr-pairing/dataflow.md +202 -0
  12. package/docs/design/qr-pairing/extraction-plan.md +134 -0
  13. package/docs/design/qr-pairing/interfaces.ts +473 -0
  14. package/docs/design/qr-pairing/requirements.md +152 -0
  15. package/docs/design/qr-pairing/test-plan.md +126 -0
  16. package/docs/index.html +34 -0
  17. package/docs/initialization-issue.ja.md +34 -0
  18. package/docs/integration-guide.ja.md +245 -0
  19. package/docs/integration-guide.md +258 -0
  20. package/docs/migration.ja.md +110 -0
  21. package/docs/migration.md +115 -0
  22. package/package.json +90 -0
  23. package/schemas/extension-manifest.schema.json +49 -0
  24. package/src/block-definitions.json +264 -0
  25. package/src/clock.ts +18 -0
  26. package/src/config/feature-flags.ts +18 -0
  27. package/src/config/qr-config.ts +22 -0
  28. package/src/config.ts +12 -0
  29. package/src/errors.ts +51 -0
  30. package/src/extension-manifest.ts +149 -0
  31. package/src/extension.ts +281 -0
  32. package/src/globals.d.ts +54 -0
  33. package/src/index.ts +8 -0
  34. package/src/pairing/controller.ts +836 -0
  35. package/src/pairing/limits.ts +12 -0
  36. package/src/pairing/types.ts +96 -0
  37. package/src/ports/display.ts +136 -0
  38. package/src/ports/qr-scan.ts +151 -0
  39. package/src/ports/webrtc.ts +61 -0
  40. package/src/qr/courier.ts +267 -0
  41. package/src/qr/envelope.ts +0 -0
  42. package/src/qr/hash.ts +13 -0
  43. package/src/qr/limits.ts +44 -0
  44. package/src/qr/svg.ts +34 -0
  45. package/templates/README.ja.md +183 -0
  46. package/templates/README.md +198 -0
@@ -0,0 +1,318 @@
1
+ {
2
+ "formatVersion": 1,
3
+ "id": "kubohiroyawebrtcqrcodepairing",
4
+ "blocks": [
5
+ {
6
+ "opcode": "cancelPairing",
7
+ "blockType": "COMMAND",
8
+ "arguments": [
9
+ {
10
+ "id": "SESSION",
11
+ "type": "STRING"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "opcode": "endPairingQrDisplay",
17
+ "blockType": "COMMAND",
18
+ "arguments": [
19
+ {
20
+ "id": "SESSION",
21
+ "type": "STRING"
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ "opcode": "ingestPairingQrText",
27
+ "blockType": "COMMAND",
28
+ "arguments": [
29
+ {
30
+ "id": "SESSION",
31
+ "type": "STRING"
32
+ },
33
+ {
34
+ "id": "TEXT",
35
+ "type": "STRING"
36
+ }
37
+ ]
38
+ },
39
+ {
40
+ "opcode": "isPairingConnected",
41
+ "blockType": "BOOLEAN",
42
+ "arguments": [
43
+ {
44
+ "id": "SESSION",
45
+ "type": "STRING"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "opcode": "pairingConnectionState",
51
+ "blockType": "REPORTER",
52
+ "arguments": [
53
+ {
54
+ "id": "SESSION",
55
+ "type": "STRING"
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "opcode": "pairingError",
61
+ "blockType": "REPORTER",
62
+ "arguments": [
63
+ {
64
+ "id": "SESSION",
65
+ "type": "STRING"
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ "opcode": "pairingErrorMessage",
71
+ "blockType": "REPORTER",
72
+ "arguments": [
73
+ {
74
+ "id": "SESSION",
75
+ "type": "STRING"
76
+ }
77
+ ]
78
+ },
79
+ {
80
+ "opcode": "pairingExchangeId",
81
+ "blockType": "REPORTER",
82
+ "arguments": [
83
+ {
84
+ "id": "SESSION",
85
+ "type": "STRING"
86
+ }
87
+ ]
88
+ },
89
+ {
90
+ "opcode": "pairingLocalPeer",
91
+ "blockType": "REPORTER",
92
+ "arguments": [
93
+ {
94
+ "id": "SESSION",
95
+ "type": "STRING"
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "opcode": "pairingMissingParts",
101
+ "blockType": "REPORTER",
102
+ "arguments": [
103
+ {
104
+ "id": "SESSION",
105
+ "type": "STRING"
106
+ }
107
+ ]
108
+ },
109
+ {
110
+ "opcode": "pairingPhase",
111
+ "blockType": "REPORTER",
112
+ "arguments": [
113
+ {
114
+ "id": "SESSION",
115
+ "type": "STRING"
116
+ }
117
+ ]
118
+ },
119
+ {
120
+ "opcode": "pairingQrCurrentPart",
121
+ "blockType": "REPORTER",
122
+ "arguments": [
123
+ {
124
+ "id": "SESSION",
125
+ "type": "STRING"
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ "opcode": "pairingQrPartCount",
131
+ "blockType": "REPORTER",
132
+ "arguments": [
133
+ {
134
+ "id": "SESSION",
135
+ "type": "STRING"
136
+ }
137
+ ]
138
+ },
139
+ {
140
+ "opcode": "pairingQrPartDataUri",
141
+ "blockType": "REPORTER",
142
+ "arguments": [
143
+ {
144
+ "id": "INDEX",
145
+ "type": "NUMBER"
146
+ },
147
+ {
148
+ "id": "SESSION",
149
+ "type": "STRING"
150
+ }
151
+ ]
152
+ },
153
+ {
154
+ "opcode": "pairingQrPartSvg",
155
+ "blockType": "REPORTER",
156
+ "arguments": [
157
+ {
158
+ "id": "INDEX",
159
+ "type": "NUMBER"
160
+ },
161
+ {
162
+ "id": "SESSION",
163
+ "type": "STRING"
164
+ }
165
+ ]
166
+ },
167
+ {
168
+ "opcode": "pairingReceivedParts",
169
+ "blockType": "REPORTER",
170
+ "arguments": [
171
+ {
172
+ "id": "SESSION",
173
+ "type": "STRING"
174
+ }
175
+ ]
176
+ },
177
+ {
178
+ "opcode": "pairingRemainingSeconds",
179
+ "blockType": "REPORTER",
180
+ "arguments": [
181
+ {
182
+ "id": "SESSION",
183
+ "type": "STRING"
184
+ }
185
+ ]
186
+ },
187
+ {
188
+ "opcode": "pairingRemotePeer",
189
+ "blockType": "REPORTER",
190
+ "arguments": [
191
+ {
192
+ "id": "SESSION",
193
+ "type": "STRING"
194
+ }
195
+ ]
196
+ },
197
+ {
198
+ "opcode": "pairingRequiredParts",
199
+ "blockType": "REPORTER",
200
+ "arguments": [
201
+ {
202
+ "id": "SESSION",
203
+ "type": "STRING"
204
+ }
205
+ ]
206
+ },
207
+ {
208
+ "opcode": "pairingSessions",
209
+ "blockType": "REPORTER",
210
+ "arguments": []
211
+ },
212
+ {
213
+ "opcode": "retryPairing",
214
+ "blockType": "COMMAND",
215
+ "arguments": [
216
+ {
217
+ "id": "SESSION",
218
+ "type": "STRING"
219
+ }
220
+ ]
221
+ },
222
+ {
223
+ "opcode": "scanPairingQrFromCamera",
224
+ "blockType": "COMMAND",
225
+ "arguments": [
226
+ {
227
+ "id": "CAMERA_ID",
228
+ "type": "STRING"
229
+ },
230
+ {
231
+ "id": "SESSION",
232
+ "type": "STRING"
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ "opcode": "setPairingTimeout",
238
+ "blockType": "COMMAND",
239
+ "arguments": [
240
+ {
241
+ "id": "SECONDS",
242
+ "type": "NUMBER"
243
+ },
244
+ {
245
+ "id": "SESSION",
246
+ "type": "STRING"
247
+ }
248
+ ]
249
+ },
250
+ {
251
+ "opcode": "showNextPairingQrPart",
252
+ "blockType": "COMMAND",
253
+ "arguments": [
254
+ {
255
+ "id": "SESSION",
256
+ "type": "STRING"
257
+ }
258
+ ]
259
+ },
260
+ {
261
+ "opcode": "showPairingQrPart",
262
+ "blockType": "COMMAND",
263
+ "arguments": [
264
+ {
265
+ "id": "INDEX",
266
+ "type": "NUMBER"
267
+ },
268
+ {
269
+ "id": "SESSION",
270
+ "type": "STRING"
271
+ }
272
+ ]
273
+ },
274
+ {
275
+ "opcode": "startAnswerPairing",
276
+ "blockType": "COMMAND",
277
+ "arguments": [
278
+ {
279
+ "id": "LOCAL_PEER",
280
+ "type": "STRING"
281
+ },
282
+ {
283
+ "id": "SESSION",
284
+ "type": "STRING"
285
+ }
286
+ ]
287
+ },
288
+ {
289
+ "opcode": "startOfferPairing",
290
+ "blockType": "COMMAND",
291
+ "arguments": [
292
+ {
293
+ "id": "LOCAL_PEER",
294
+ "type": "STRING"
295
+ },
296
+ {
297
+ "id": "REMOTE_PEER",
298
+ "type": "STRING"
299
+ },
300
+ {
301
+ "id": "SESSION",
302
+ "type": "STRING"
303
+ }
304
+ ]
305
+ },
306
+ {
307
+ "opcode": "waitUntilPairingConnected",
308
+ "blockType": "COMMAND",
309
+ "arguments": [
310
+ {
311
+ "id": "SESSION",
312
+ "type": "STRING"
313
+ }
314
+ ]
315
+ }
316
+ ],
317
+ "menus": []
318
+ }