@zhin.js/adapter-sandbox 3.0.5 → 3.0.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @zhin.js/adapter-process
2
2
 
3
+ ## 3.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - c78d2cd: fix: cli 更新,文档更新
8
+ - Updated dependencies [c78d2cd]
9
+ - @zhin.js/client@2.0.1
10
+ - @zhin.js/host-router@0.0.2
11
+ - @zhin.js/core@1.1.30
12
+ - @zhin.js/host-api@0.0.2
13
+
14
+ ## 3.0.6
15
+
16
+ ### Patch Changes
17
+
18
+ - 90d9efd: fix: 处理包名
19
+ - @zhin.js/core@1.1.29
20
+ - @zhin.js/host-api@0.0.1
21
+ - @zhin.js/host-router@0.0.1
22
+
3
23
  ## 3.0.5
4
24
 
5
25
  ### Patch Changes
@@ -10,10 +30,10 @@
10
30
  - Updated dependencies [996ebb3]
11
31
  - @zhin.js/core@1.1.28
12
32
  - @zhin.js/client@1.1.4
13
- - @zhin.js/http-host@0.1.4
33
+ - @zhin.js/host-router-host@0.1.4
14
34
  - zhin.js@1.0.86
15
35
  - @zhin.js/console@3.0.5
16
- - @zhin.js/http@1.0.79
36
+ - @zhin.js/host-router@1.0.79
17
37
 
18
38
  ## 3.0.4
19
39
 
@@ -21,7 +41,7 @@
21
41
 
22
42
  - zhin.js@1.0.85
23
43
  - @zhin.js/console@3.0.4
24
- - @zhin.js/http@1.0.78
44
+ - @zhin.js/host-router@1.0.78
25
45
  - @zhin.js/core@1.1.27
26
46
 
27
47
  ## 3.0.3
@@ -34,11 +54,11 @@
34
54
  - Updated dependencies [f19d2e0]
35
55
  - Updated dependencies [2d24338]
36
56
  - @zhin.js/console@3.0.3
37
- - @zhin.js/http-host@0.1.3
57
+ - @zhin.js/host-router-host@0.1.3
38
58
  - @zhin.js/core@1.1.26
39
59
  - zhin.js@1.0.84
40
60
  - @zhin.js/client@1.1.3
41
- - @zhin.js/http@1.0.77
61
+ - @zhin.js/host-router@1.0.77
42
62
 
43
63
  ## 3.0.2
44
64
 
@@ -47,7 +67,7 @@
47
67
  - 775427e: fix: edge 支持
48
68
  - Updated dependencies [775427e]
49
69
  - @zhin.js/console@3.0.2
50
- - @zhin.js/http@1.0.76
70
+ - @zhin.js/host-router@1.0.76
51
71
  - @zhin.js/client@1.1.2
52
72
  - @zhin.js/core@1.1.25
53
73
  - zhin.js@1.0.83
@@ -59,7 +79,7 @@
59
79
  - 32049f5: fix: init publish
60
80
  - Updated dependencies [32049f5]
61
81
  - @zhin.js/console@3.0.1
62
- - @zhin.js/http@1.0.75
82
+ - @zhin.js/host-router@1.0.75
63
83
  - @zhin.js/client@1.1.1
64
84
  - @zhin.js/core@1.1.24
65
85
  - zhin.js@1.0.82
@@ -80,7 +100,7 @@
80
100
  - @zhin.js/core@1.1.23
81
101
  - zhin.js@1.0.81
82
102
  - @zhin.js/console@2.0.24
83
- - @zhin.js/http@1.0.74
103
+ - @zhin.js/host-router@1.0.74
84
104
 
85
105
  ## 2.0.23
86
106
 
@@ -88,7 +108,7 @@
88
108
 
89
109
  - zhin.js@1.0.80
90
110
  - @zhin.js/console@2.0.23
91
- - @zhin.js/http@1.0.73
111
+ - @zhin.js/host-router@1.0.73
92
112
  - @zhin.js/core@1.1.22
93
113
 
94
114
  ## 2.0.22
@@ -97,7 +117,7 @@
97
117
 
98
118
  - zhin.js@1.0.79
99
119
  - @zhin.js/console@2.0.22
100
- - @zhin.js/http@1.0.72
120
+ - @zhin.js/host-router@1.0.72
101
121
  - @zhin.js/core@1.1.21
102
122
 
103
123
  ## 2.0.21
@@ -108,7 +128,7 @@
108
128
  - @zhin.js/console@2.0.21
109
129
  - @zhin.js/core@1.1.20
110
130
  - zhin.js@1.0.78
111
- - @zhin.js/http@1.0.71
131
+ - @zhin.js/host-router@1.0.71
112
132
 
113
133
  ## 2.0.20
114
134
 
@@ -117,7 +137,7 @@
117
137
  - zhin.js@1.0.77
118
138
  - @zhin.js/core@1.1.19
119
139
  - @zhin.js/console@2.0.20
120
- - @zhin.js/http@1.0.70
140
+ - @zhin.js/host-router@1.0.70
121
141
 
122
142
  ## 2.0.19
123
143
 
@@ -126,7 +146,7 @@
126
146
  - Updated dependencies [cb9fbf1]
127
147
  - zhin.js@1.0.76
128
148
  - @zhin.js/console@2.0.19
129
- - @zhin.js/http@1.0.69
149
+ - @zhin.js/host-router@1.0.69
130
150
  - @zhin.js/core@1.1.18
131
151
 
132
152
  ## 2.0.18
@@ -136,7 +156,7 @@
136
156
  - @zhin.js/core@1.1.17
137
157
  - zhin.js@1.0.75
138
158
  - @zhin.js/console@2.0.18
139
- - @zhin.js/http@1.0.68
159
+ - @zhin.js/host-router@1.0.68
140
160
 
141
161
  ## 2.0.17
142
162
 
@@ -146,7 +166,7 @@
146
166
  - @zhin.js/core@1.1.16
147
167
  - zhin.js@1.0.74
148
168
  - @zhin.js/console@2.0.17
149
- - @zhin.js/http@1.0.67
169
+ - @zhin.js/host-router@1.0.67
150
170
 
151
171
  ## 2.0.16
152
172
 
@@ -155,7 +175,7 @@
155
175
  - f1e9a76: fix: 提高 skill 质量
156
176
  - zhin.js@1.0.73
157
177
  - @zhin.js/console@2.0.16
158
- - @zhin.js/http@1.0.66
178
+ - @zhin.js/host-router@1.0.66
159
179
  - @zhin.js/core@1.1.15
160
180
 
161
181
  ## 2.0.15
@@ -183,7 +203,7 @@
183
203
  - @zhin.js/core@1.1.14
184
204
  - zhin.js@1.0.72
185
205
  - @zhin.js/console@2.0.13
186
- - @zhin.js/http@1.0.65
206
+ - @zhin.js/host-router@1.0.65
187
207
 
188
208
  ## 2.0.12
189
209
 
@@ -202,7 +222,7 @@
202
222
  - @zhin.js/core@1.1.13
203
223
  - zhin.js@1.0.71
204
224
  - @zhin.js/console@2.0.11
205
- - @zhin.js/http@1.0.64
225
+ - @zhin.js/host-router@1.0.64
206
226
 
207
227
  ## 2.0.10
208
228
 
@@ -212,14 +232,14 @@
212
232
  - @zhin.js/core@1.1.10
213
233
  - zhin.js@1.0.68
214
234
  - @zhin.js/console@2.0.10
215
- - @zhin.js/http@1.0.63
235
+ - @zhin.js/host-router@1.0.63
216
236
 
217
237
  ## 2.0.9
218
238
 
219
239
  ### Patch Changes
220
240
 
221
241
  - Updated dependencies [0eba6d6]
222
- - @zhin.js/http@1.0.62
242
+ - @zhin.js/host-router@1.0.62
223
243
  - @zhin.js/core@1.1.9
224
244
  - zhin.js@1.0.67
225
245
  - @zhin.js/console@2.0.9
@@ -231,7 +251,7 @@
231
251
  - zhin.js@1.0.66
232
252
  - @zhin.js/core@1.1.8
233
253
  - @zhin.js/console@2.0.8
234
- - @zhin.js/http@1.0.61
254
+ - @zhin.js/host-router@1.0.61
235
255
 
236
256
  ## 2.0.7
237
257
 
@@ -240,7 +260,7 @@
240
260
  - @zhin.js/core@1.1.7
241
261
  - zhin.js@1.0.65
242
262
  - @zhin.js/console@2.0.7
243
- - @zhin.js/http@1.0.60
263
+ - @zhin.js/host-router@1.0.60
244
264
 
245
265
  ## 2.0.6
246
266
 
@@ -252,7 +272,7 @@
252
272
  - @zhin.js/core@1.1.6
253
273
  - zhin.js@1.0.64
254
274
  - @zhin.js/console@2.0.6
255
- - @zhin.js/http@1.0.59
275
+ - @zhin.js/host-router@1.0.59
256
276
 
257
277
  ## 2.0.5
258
278
 
@@ -261,7 +281,7 @@
261
281
  - ba30934: fix: web 优化
262
282
  - Updated dependencies [ba30934]
263
283
  - @zhin.js/console@2.0.5
264
- - @zhin.js/http@1.0.58
284
+ - @zhin.js/host-router@1.0.58
265
285
  - zhin.js@1.0.63
266
286
  - @zhin.js/core@1.1.5
267
287
 
@@ -271,7 +291,7 @@
271
291
 
272
292
  - zhin.js@1.0.62
273
293
  - @zhin.js/console@2.0.4
274
- - @zhin.js/http@1.0.57
294
+ - @zhin.js/host-router@1.0.57
275
295
  - @zhin.js/core@1.1.4
276
296
 
277
297
  ## 2.0.3
@@ -280,7 +300,7 @@
280
300
 
281
301
  - zhin.js@1.0.61
282
302
  - @zhin.js/console@2.0.3
283
- - @zhin.js/http@1.0.56
303
+ - @zhin.js/host-router@1.0.56
284
304
  - @zhin.js/core@1.1.3
285
305
 
286
306
  ## 2.0.2
@@ -298,7 +318,7 @@
298
318
  - @zhin.js/console@2.0.2
299
319
  - @zhin.js/core@1.1.2
300
320
  - zhin.js@1.0.60
301
- - @zhin.js/http@1.0.55
321
+ - @zhin.js/host-router@1.0.55
302
322
 
303
323
  ## 2.0.1
304
324
 
@@ -310,7 +330,7 @@
310
330
  - @zhin.js/core@1.1.1
311
331
  - zhin.js@1.0.59
312
332
  - @zhin.js/console@2.0.1
313
- - @zhin.js/http@1.0.54
333
+ - @zhin.js/host-router@1.0.54
314
334
 
315
335
  ## 2.0.0
316
336
 
@@ -320,7 +340,7 @@
320
340
  - @zhin.js/core@1.1.0
321
341
  - zhin.js@1.0.58
322
342
  - @zhin.js/console@2.0.0
323
- - @zhin.js/http@1.0.53
343
+ - @zhin.js/host-router@1.0.53
324
344
 
325
345
  ## 1.0.70
326
346
 
@@ -331,7 +351,7 @@
331
351
  - @zhin.js/core@1.0.57
332
352
  - zhin.js@1.0.57
333
353
  - @zhin.js/console@1.0.59
334
- - @zhin.js/http@1.0.52
354
+ - @zhin.js/host-router@1.0.52
335
355
 
336
356
  ## 1.0.69
337
357
 
@@ -340,7 +360,7 @@
340
360
  - zhin.js@1.0.56
341
361
  - @zhin.js/core@1.0.56
342
362
  - @zhin.js/console@1.0.58
343
- - @zhin.js/http@1.0.51
363
+ - @zhin.js/host-router@1.0.51
344
364
 
345
365
  ## 1.0.68
346
366
 
@@ -357,7 +377,7 @@
357
377
  - @zhin.js/core@1.0.55
358
378
  - zhin.js@1.0.55
359
379
  - @zhin.js/console@1.0.56
360
- - @zhin.js/http@1.0.50
380
+ - @zhin.js/host-router@1.0.50
361
381
 
362
382
  ## 1.0.66
363
383
 
@@ -369,7 +389,7 @@
369
389
  - @zhin.js/core@1.0.54
370
390
  - zhin.js@1.0.54
371
391
  - @zhin.js/console@1.0.55
372
- - @zhin.js/http@1.0.49
392
+ - @zhin.js/host-router@1.0.49
373
393
 
374
394
  ## 1.0.65
375
395
 
@@ -378,7 +398,7 @@
378
398
  - @zhin.js/core@1.0.53
379
399
  - zhin.js@1.0.53
380
400
  - @zhin.js/console@1.0.54
381
- - @zhin.js/http@1.0.48
401
+ - @zhin.js/host-router@1.0.48
382
402
 
383
403
  ## 1.0.64
384
404
 
@@ -387,7 +407,7 @@
387
407
  - a3511a0: 各包内 Agent 技能说明已固定为随包发布的 `skills/*/SKILL.md`(替代已移除的运行时 `declareSkill`)。本批为 registry / 分发侧对齐的 **patch** 版本递增。
388
408
  - Updated dependencies [a3511a0]
389
409
  - @zhin.js/console@1.0.53
390
- - @zhin.js/http@1.0.47
410
+ - @zhin.js/host-router@1.0.47
391
411
 
392
412
  ## 1.0.63
393
413
 
@@ -400,7 +420,7 @@
400
420
  - zhin.js@1.0.52
401
421
  - @zhin.js/console@1.0.52
402
422
  - @zhin.js/client@1.0.13
403
- - @zhin.js/http@1.0.46
423
+ - @zhin.js/host-router@1.0.46
404
424
 
405
425
  ## 1.0.62
406
426
 
@@ -415,7 +435,7 @@
415
435
 
416
436
  - zhin.js@1.0.51
417
437
  - @zhin.js/console@1.0.50
418
- - @zhin.js/http@1.0.45
438
+ - @zhin.js/host-router@1.0.45
419
439
  - @zhin.js/core@1.0.51
420
440
 
421
441
  ## 1.0.60
@@ -432,7 +452,7 @@
432
452
 
433
453
  - zhin.js@1.0.50
434
454
  - @zhin.js/console@1.0.48
435
- - @zhin.js/http@1.0.44
455
+ - @zhin.js/host-router@1.0.44
436
456
  - @zhin.js/core@1.0.50
437
457
 
438
458
  ## 1.0.58
@@ -443,7 +463,7 @@
443
463
  - @zhin.js/core@1.0.49
444
464
  - zhin.js@1.0.49
445
465
  - @zhin.js/console@1.0.47
446
- - @zhin.js/http@1.0.43
466
+ - @zhin.js/host-router@1.0.43
447
467
 
448
468
  ## 1.0.57
449
469
 
@@ -453,7 +473,7 @@
453
473
  - @zhin.js/core@1.0.48
454
474
  - zhin.js@1.0.48
455
475
  - @zhin.js/console@1.0.46
456
- - @zhin.js/http@1.0.42
476
+ - @zhin.js/host-router@1.0.42
457
477
 
458
478
  ## 1.0.56
459
479
 
@@ -463,7 +483,7 @@
463
483
  - @zhin.js/core@1.0.47
464
484
  - zhin.js@1.0.47
465
485
  - @zhin.js/console@1.0.45
466
- - @zhin.js/http@1.0.41
486
+ - @zhin.js/host-router@1.0.41
467
487
 
468
488
  ## 1.0.55
469
489
 
@@ -473,7 +493,7 @@
473
493
  - @zhin.js/core@1.0.46
474
494
  - zhin.js@1.0.46
475
495
  - @zhin.js/console@1.0.44
476
- - @zhin.js/http@1.0.40
496
+ - @zhin.js/host-router@1.0.40
477
497
 
478
498
  ## 1.0.54
479
499
 
@@ -483,7 +503,7 @@
483
503
  - @zhin.js/core@1.0.45
484
504
  - zhin.js@1.0.45
485
505
  - @zhin.js/console@1.0.43
486
- - @zhin.js/http@1.0.39
506
+ - @zhin.js/host-router@1.0.39
487
507
 
488
508
  ## 1.0.53
489
509
 
@@ -491,7 +511,7 @@
491
511
 
492
512
  - zhin.js@1.0.44
493
513
  - @zhin.js/console@1.0.42
494
- - @zhin.js/http@1.0.38
514
+ - @zhin.js/host-router@1.0.38
495
515
  - @zhin.js/core@1.0.44
496
516
 
497
517
  ## 1.0.52
@@ -500,7 +520,7 @@
500
520
 
501
521
  - Updated dependencies [72ec4ba]
502
522
  - @zhin.js/console@1.0.41
503
- - @zhin.js/http@1.0.37
523
+ - @zhin.js/host-router@1.0.37
504
524
  - @zhin.js/client@1.0.11
505
525
  - @zhin.js/core@1.0.43
506
526
  - zhin.js@1.0.43
@@ -519,7 +539,7 @@
519
539
  - zhin.js@1.0.42
520
540
  - @zhin.js/core@1.0.42
521
541
  - @zhin.js/console@1.0.39
522
- - @zhin.js/http@1.0.36
542
+ - @zhin.js/host-router@1.0.36
523
543
 
524
544
  ## 1.0.49
525
545
 
@@ -529,7 +549,7 @@
529
549
  - @zhin.js/core@1.0.41
530
550
  - zhin.js@1.0.41
531
551
  - @zhin.js/console@1.0.38
532
- - @zhin.js/http@1.0.35
552
+ - @zhin.js/host-router@1.0.35
533
553
 
534
554
  ## 1.0.48
535
555
 
@@ -539,7 +559,7 @@
539
559
  - @zhin.js/core@1.0.40
540
560
  - zhin.js@1.0.40
541
561
  - @zhin.js/console@1.0.37
542
- - @zhin.js/http@1.0.34
562
+ - @zhin.js/host-router@1.0.34
543
563
 
544
564
  ## 1.0.47
545
565
 
@@ -549,7 +569,7 @@
549
569
  - @zhin.js/core@1.0.39
550
570
  - zhin.js@1.0.39
551
571
  - @zhin.js/console@1.0.36
552
- - @zhin.js/http@1.0.33
572
+ - @zhin.js/host-router@1.0.33
553
573
 
554
574
  ## 1.0.46
555
575
 
@@ -559,7 +579,7 @@
559
579
  - @zhin.js/core@1.0.38
560
580
  - zhin.js@1.0.38
561
581
  - @zhin.js/console@1.0.35
562
- - @zhin.js/http@1.0.32
582
+ - @zhin.js/host-router@1.0.32
563
583
 
564
584
  ## 1.0.45
565
585
 
@@ -567,7 +587,7 @@
567
587
 
568
588
  - Updated dependencies [631da6e]
569
589
  - @zhin.js/console@1.0.34
570
- - @zhin.js/http@1.0.31
590
+ - @zhin.js/host-router@1.0.31
571
591
 
572
592
  ## 1.0.44
573
593
 
@@ -577,7 +597,7 @@
577
597
  - @zhin.js/core@1.0.37
578
598
  - zhin.js@1.0.37
579
599
  - @zhin.js/console@1.0.33
580
- - @zhin.js/http@1.0.30
600
+ - @zhin.js/host-router@1.0.30
581
601
 
582
602
  ## 1.0.43
583
603
 
@@ -586,7 +606,7 @@
586
606
  - Updated dependencies [432d0a5]
587
607
  - Updated dependencies [6d94111]
588
608
  - @zhin.js/console@1.0.32
589
- - @zhin.js/http@1.0.29
609
+ - @zhin.js/host-router@1.0.29
590
610
  - @zhin.js/core@1.0.36
591
611
  - zhin.js@1.0.36
592
612
 
@@ -598,7 +618,7 @@
598
618
  - @zhin.js/core@1.0.35
599
619
  - zhin.js@1.0.35
600
620
  - @zhin.js/console@1.0.31
601
- - @zhin.js/http@1.0.28
621
+ - @zhin.js/host-router@1.0.28
602
622
 
603
623
  ## 1.0.41
604
624
 
@@ -608,7 +628,7 @@
608
628
  - @zhin.js/core@1.0.34
609
629
  - zhin.js@1.0.34
610
630
  - @zhin.js/console@1.0.30
611
- - @zhin.js/http@1.0.27
631
+ - @zhin.js/host-router@1.0.27
612
632
 
613
633
  ## 1.0.40
614
634
 
@@ -618,14 +638,14 @@
618
638
  - @zhin.js/core@1.0.33
619
639
  - zhin.js@1.0.33
620
640
  - @zhin.js/console@1.0.29
621
- - @zhin.js/http@1.0.26
641
+ - @zhin.js/host-router@1.0.26
622
642
 
623
643
  ## 1.0.39
624
644
 
625
645
  ### Patch Changes
626
646
 
627
647
  - Updated dependencies [48481a8]
628
- - @zhin.js/http@1.0.25
648
+ - @zhin.js/host-router@1.0.25
629
649
 
630
650
  ## 1.0.38
631
651
 
@@ -635,7 +655,7 @@
635
655
  - @zhin.js/core@1.0.32
636
656
  - zhin.js@1.0.32
637
657
  - @zhin.js/console@1.0.28
638
- - @zhin.js/http@1.0.24
658
+ - @zhin.js/host-router@1.0.24
639
659
 
640
660
  ## 1.0.37
641
661
 
@@ -645,7 +665,7 @@
645
665
  - @zhin.js/core@1.0.31
646
666
  - zhin.js@1.0.31
647
667
  - @zhin.js/console@1.0.27
648
- - @zhin.js/http@1.0.23
668
+ - @zhin.js/host-router@1.0.23
649
669
 
650
670
  ## 1.0.36
651
671
 
@@ -654,7 +674,7 @@
654
674
  - Updated dependencies [460a6c6]
655
675
  - zhin.js@1.0.30
656
676
  - @zhin.js/console@1.0.26
657
- - @zhin.js/http@1.0.22
677
+ - @zhin.js/host-router@1.0.22
658
678
  - @zhin.js/core@1.0.30
659
679
 
660
680
  ## 1.0.35
@@ -665,7 +685,7 @@
665
685
  - @zhin.js/core@1.0.29
666
686
  - zhin.js@1.0.29
667
687
  - @zhin.js/console@1.0.25
668
- - @zhin.js/http@1.0.21
688
+ - @zhin.js/host-router@1.0.21
669
689
 
670
690
  ## 1.0.34
671
691
 
@@ -673,7 +693,7 @@
673
693
 
674
694
  - Updated dependencies [05a514d]
675
695
  - @zhin.js/console@1.0.24
676
- - @zhin.js/http@1.0.20
696
+ - @zhin.js/host-router@1.0.20
677
697
  - @zhin.js/client@1.0.10
678
698
  - @zhin.js/core@1.0.28
679
699
  - zhin.js@1.0.28
@@ -683,14 +703,14 @@
683
703
  ### Patch Changes
684
704
 
685
705
  - Updated dependencies [2b44e18]
686
- - @zhin.js/http@1.0.19
706
+ - @zhin.js/host-router@1.0.19
687
707
 
688
708
  ## 1.0.32
689
709
 
690
710
  ### Patch Changes
691
711
 
692
712
  - Updated dependencies [b27e633]
693
- - @zhin.js/http@1.0.18
713
+ - @zhin.js/host-router@1.0.18
694
714
  - @zhin.js/core@1.0.27
695
715
  - zhin.js@1.0.27
696
716
  - @zhin.js/console@1.0.23
@@ -702,7 +722,7 @@
702
722
  - 106d357: fix: ai
703
723
  - Updated dependencies [106d357]
704
724
  - @zhin.js/console@1.0.22
705
- - @zhin.js/http@1.0.17
725
+ - @zhin.js/host-router@1.0.17
706
726
  - @zhin.js/client@1.0.9
707
727
  - @zhin.js/core@1.0.26
708
728
  - zhin.js@1.0.26
@@ -719,7 +739,7 @@
719
739
  - @zhin.js/core@1.0.25
720
740
  - zhin.js@1.0.25
721
741
  - @zhin.js/console@1.0.21
722
- - @zhin.js/http@1.0.16
742
+ - @zhin.js/host-router@1.0.16
723
743
 
724
744
  ## 1.0.29
725
745
 
@@ -729,7 +749,7 @@
729
749
  - @zhin.js/core@1.0.24
730
750
  - zhin.js@1.0.24
731
751
  - @zhin.js/console@1.0.20
732
- - @zhin.js/http@1.0.15
752
+ - @zhin.js/host-router@1.0.15
733
753
 
734
754
  ## 1.0.28
735
755
 
@@ -740,7 +760,7 @@
740
760
  - @zhin.js/core@1.0.23
741
761
  - zhin.js@1.0.23
742
762
  - @zhin.js/console@1.0.19
743
- - @zhin.js/http@1.0.14
763
+ - @zhin.js/host-router@1.0.14
744
764
 
745
765
  ## 1.0.27
746
766
 
@@ -749,7 +769,7 @@
749
769
  - Updated dependencies [26aba27]
750
770
  - zhin.js@1.0.22
751
771
  - @zhin.js/console@1.0.18
752
- - @zhin.js/http@1.0.13
772
+ - @zhin.js/host-router@1.0.13
753
773
  - @zhin.js/core@1.0.22
754
774
 
755
775
  ## 1.0.26
@@ -760,7 +780,7 @@
760
780
  - @zhin.js/core@1.0.21
761
781
  - zhin.js@1.0.21
762
782
  - @zhin.js/console@1.0.17
763
- - @zhin.js/http@1.0.12
783
+ - @zhin.js/host-router@1.0.12
764
784
 
765
785
  ## 1.0.25
766
786
 
@@ -771,7 +791,7 @@
771
791
  - Updated dependencies [a3b7673]
772
792
  - Updated dependencies [5141137]
773
793
  - @zhin.js/console@1.0.16
774
- - @zhin.js/http@1.0.11
794
+ - @zhin.js/host-router@1.0.11
775
795
  - @zhin.js/core@1.0.20
776
796
  - zhin.js@1.0.20
777
797
 
@@ -785,7 +805,7 @@
785
805
  - @zhin.js/core@1.0.19
786
806
  - zhin.js@1.0.19
787
807
  - @zhin.js/console@1.0.15
788
- - @zhin.js/http@1.0.10
808
+ - @zhin.js/host-router@1.0.10
789
809
 
790
810
  ## 1.0.23
791
811
 
@@ -797,7 +817,7 @@
797
817
  - @zhin.js/core@1.0.18
798
818
  - zhin.js@1.0.18
799
819
  - @zhin.js/console@1.0.14
800
- - @zhin.js/http@1.0.9
820
+ - @zhin.js/host-router@1.0.9
801
821
 
802
822
  ## 1.0.22
803
823
 
@@ -849,7 +869,7 @@
849
869
  - Updated dependencies [547028f]
850
870
  - @zhin.js/console@1.0.10
851
871
  - @zhin.js/types@1.0.5
852
- - @zhin.js/http@1.0.7
872
+ - @zhin.js/host-router@1.0.7
853
873
  - zhin.js@1.0.14
854
874
 
855
875
  ## 1.0.15
@@ -889,7 +909,7 @@
889
909
  - Updated dependencies [c490260]
890
910
  - @zhin.js/console@1.0.7
891
911
  - @zhin.js/client@1.0.5
892
- - @zhin.js/http@1.0.6
912
+ - @zhin.js/host-router@1.0.6
893
913
  - zhin.js@1.0.9
894
914
 
895
915
  ## 1.0.10
@@ -902,7 +922,7 @@
902
922
  - @zhin.js/types@1.0.3
903
923
  - @zhin.js/client@1.0.4
904
924
  - zhin.js@1.0.8
905
- - @zhin.js/http@1.0.5
925
+ - @zhin.js/host-router@1.0.5
906
926
 
907
927
  ## 1.0.9
908
928
 
@@ -921,7 +941,7 @@
921
941
  - Updated dependencies [b213bbc]
922
942
  - @zhin.js/console@1.0.4
923
943
  - @zhin.js/client@1.0.3
924
- - @zhin.js/http@1.0.4
944
+ - @zhin.js/host-router@1.0.4
925
945
  - zhin.js@1.0.6
926
946
 
927
947
  ## 1.0.7
@@ -937,7 +957,7 @@
937
957
 
938
958
  - f347667: fix: runtime error
939
959
  - Updated dependencies [f347667]
940
- - @zhin.js/http@1.0.3
960
+ - @zhin.js/host-router@1.0.3
941
961
  - zhin.js@1.0.5
942
962
 
943
963
  ## 1.0.5
@@ -947,7 +967,7 @@
947
967
  - Updated dependencies [d291005]
948
968
  - @zhin.js/console@1.0.2
949
969
  - @zhin.js/client@1.0.2
950
- - @zhin.js/http@1.0.2
970
+ - @zhin.js/host-router@1.0.2
951
971
 
952
972
  ## 1.0.4
953
973
 
package/README.md CHANGED
@@ -20,49 +20,37 @@ pnpm add @zhin.js/adapter-sandbox
20
20
 
21
21
  Sandbox 适配器需要以下服务插件:
22
22
 
23
- - `@zhin.js/http` — HTTP 服务(提供 Router 和 WebSocket)
24
- - `@zhin.js/console` — Host 侧 Console API(`addEntry` 注册 Sandbox 扩展)
23
+ - `@zhin.js/host-router` — HTTP 服务(提供 Router 和 WebSocket)
24
+ - `@zhin.js/host-api` — Host 侧 Console API(`addEntry` 注册 Sandbox 扩展)
25
25
  - `@zhin.js/client` — Remote Console 客户端 SDK(UI 在 zhin-console 仓库)
26
26
 
27
27
  ## 配置
28
28
 
29
+ **推荐(与 [minimal-bot](../../../examples/minimal-bot/) 一致)**:`bots: []`,在 Remote Console 打开「沙盒」页时经 `/sandbox` WebSocket **自动创建** bot(如 `sandbox-xxxx`),无需在 yaml 里写 `context: sandbox`。
30
+
29
31
  ```yaml
30
32
  # zhin.config.yml
31
- bots:
32
- - context: sandbox
33
- name: sandbox-bot
33
+ bots: []
34
34
 
35
35
  plugins:
36
- - adapter-sandbox
37
- - http
38
- - console
36
+ - "@zhin.js/adapter-sandbox"
37
+ - "@zhin.js/host-router"
38
+ - "@zhin.js/host-api"
39
39
  ```
40
40
 
41
- 或使用 TypeScript 配置:
42
-
43
- ```typescript
44
- import { defineConfig } from 'zhin.js'
45
-
46
- export default defineConfig({
47
- bots: [
48
- {
49
- context: 'sandbox',
50
- name: 'sandbox-bot',
51
- }
52
- ],
53
- plugins: [
54
- 'adapter-sandbox',
55
- 'http',
56
- 'console',
57
- ]
58
- })
41
+ 可选:若需在启动时即在 bot 列表显示**固定名称**的离线占位 bot,可显式配置:
42
+
43
+ ```yaml
44
+ bots:
45
+ - context: sandbox
46
+ name: sandbox-bot
59
47
  ```
60
48
 
61
49
  ## 使用方式
62
50
 
63
- 1. 启动机器人:`pnpm dev`(Host 默认 `http://127.0.0.1:8086` 仅 **Console API**)
64
- 2. 打开 **[Remote Console](https://console.zhin.dev)**,API Base 指向上述 HostToken 与 `http.token` / `HTTP_TOKEN` 一致
65
- 3. 在 Sandbox 聊天窗口中发送消息进行测试(勿将 `http://localhost:8086` 根路径当作 UI 入口)
51
+ 1. 启动机器人:`pnpm dev`(终端会打印 Host 地址,一般为 `http://127.0.0.1:8086`)
52
+ 2. 打开 **[Remote Console](https://console.zhin.dev)**,API Base Host 地址一致,Token 与 `http.token` / `HTTP_TOKEN` 一致
53
+ 3. 在 Console **沙盒** 页连接后发送消息进行测试
66
54
 
67
55
  每个浏览器客户端连接后创建 Sandbox Bot(无 yaml 固定名时为 `sandbox-xxxx`)。
68
56
 
package/client/index.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import type { PluginRegisterHostApi } from '@zhin.js/console-types'
1
+ import type { PluginRegisterHostApi } from '@zhin.js/contract'
2
2
  import Sandbox from './Sandbox'
3
3
 
4
4
  export function register(api: PluginRegisterHostApi) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../node_modules/@zhin.js/console/browser.tsconfig.json",
2
+ "extends": "../node_modules/@zhin.js/host-api/browser.tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "../dist"
5
5
  },
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import ze,{useState as C,useEffect as Ie,useRef as we}from"react";import{cn as A,resolveMediaSrc as Pe,pickMediaRawUrl as ye}from"@zhin.js/client";function Te(){let i=localStorage.getItem("zhin_api_base")?.trim();return(i?i.replace(/\/$/,""):null)??window.location.origin}import{forwardRef as la,createElement as sa}from"react";var Le=(...i)=>i.filter((m,w,I)=>!!m&&m.trim()!==""&&I.indexOf(m)===w).join(" ").trim();var qe=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Ue=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(m,w,I)=>I?I.toUpperCase():w.toLowerCase());var ke=i=>{let m=Ue(i);return m.charAt(0).toUpperCase()+m.slice(1)};import{forwardRef as ua,createElement as Ne}from"react";var xe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var He=i=>{for(let m in i)if(m.startsWith("aria-")||m==="role"||m==="title")return!0;return!1};import{createContext as ta,useContext as oa,useMemo as Ga,createElement as Wa}from"react";var da=ta({});var Oe=()=>oa(da);var Ee=ua(({color:i,size:m,strokeWidth:w,absoluteStrokeWidth:I,className:N="",children:D,iconNode:g,...p},S)=>{let{size:B=24,strokeWidth:U=2,absoluteStrokeWidth:_=!1,color:E="currentColor",className:G=""}=Oe()??{},H=I??_?Number(w??U)*24/Number(m??B):w??U;return Ne("svg",{ref:S,...xe,width:m??B??xe.width,height:m??B??xe.height,stroke:i??E,strokeWidth:H,className:Le("lucide",G,N),...!D&&!He(p)&&{"aria-hidden":"true"},...p},[...g.map(([M,k])=>Ne(M,k)),...Array.isArray(D)?D:[D]])});var r=(i,m)=>{let w=la(({className:I,...N},D)=>sa(Ee,{ref:D,iconNode:m,className:Le(`lucide-${qe(ke(i))}`,`lucide-${i}`,I),...N}));return w.displayName=ke(i),w};var ra=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],X=r("bell",ra);var fa=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],ee=r("bot",fa);var ia=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ae=r("check",ia);var ca=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],te=r("hash",ca);var na=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],oe=r("image",na);var pa=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],de=r("info",pa);var ma=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],O=r("message-square",ma);var La=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],ue=r("music",La);var xa=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],j=r("search",xa);var Ia=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],le=r("send",Ia);var Ca=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],se=r("smile",Ca);var ga=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],re=r("trash-2",ga);var ha=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],K=r("user-plus",ha);var Sa=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Z=r("user",Sa);var ka=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],fe=r("users",ka);var wa=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],ie=r("video",wa);var Pa=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ce=r("wifi-off",Pa);var ya=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],ne=r("wifi",ya);var Aa=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pe=r("x",Aa);import{useRef as Ge,forwardRef as Ma,useImperativeHandle as Ba}from"react";import{jsx as Fa}from"react/jsx-runtime";var We=Ma(({placeholder:i="\u8F93\u5165\u6D88\u606F...",onSend:m,onChange:w,onAtTrigger:I,minHeight:N="44px",maxHeight:D="200px"},g)=>{let p=Ge(null),S=Ge(null),B=()=>{if(!p.current)return{text:"",segments:[]};let d="",t=[],u=Array.from(p.current.childNodes);for(let c of u)if(c.nodeType===Node.TEXT_NODE){let l=c.textContent||"";l&&(d+=l,t.push({type:"text",data:{text:l}}))}else if(c.nodeType===Node.ELEMENT_NODE){let l=c;if(l.classList.contains("editor-face")){let n=l.dataset.id;d+=`[face:${n}]`,t.push({type:"face",data:{id:Number(n)}})}else if(l.classList.contains("editor-image")){let n=l.dataset.url;d+=`[image:${n}]`,t.push({type:"image",data:{url:n}})}else if(l.classList.contains("editor-video")){let n=l.dataset.url||"";d+=`[video:${n}]`,t.push({type:"video",data:{url:n}})}else if(l.classList.contains("editor-audio")){let n=l.dataset.url||"";d+=`[audio:${n}]`,t.push({type:"audio",data:{url:n}})}else if(l.classList.contains("editor-at")){let n=l.dataset.name,y=l.dataset.id;d+=`[@${n}]`,t.push({type:"at",data:{name:n,qq:y}})}else l.tagName==="BR"&&(d+=`
1
+ import ze,{useState as C,useEffect as Ie,useRef as we}from"react";import{cn as A,resolveMediaSrc as Pe,pickMediaRawUrl as ye}from"@zhin.js/client";function Te(){let i=localStorage.getItem("zhin_api_base")?.trim();return(i?i.replace(/\/$/,""):null)??window.location.origin}import{forwardRef as la,createElement as ra}from"react";var Le=(...i)=>i.filter((m,w,I)=>!!m&&m.trim()!==""&&I.indexOf(m)===w).join(" ").trim();var qe=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Ue=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(m,w,I)=>I?I.toUpperCase():w.toLowerCase());var ke=i=>{let m=Ue(i);return m.charAt(0).toUpperCase()+m.slice(1)};import{forwardRef as ua,createElement as Ne}from"react";var xe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var He=i=>{for(let m in i)if(m.startsWith("aria-")||m==="role"||m==="title")return!0;return!1};import{createContext as ta,useContext as oa,useMemo as Ga,createElement as Wa}from"react";var da=ta({});var Oe=()=>oa(da);var Ee=ua(({color:i,size:m,strokeWidth:w,absoluteStrokeWidth:I,className:N="",children:D,iconNode:g,...p},S)=>{let{size:B=24,strokeWidth:U=2,absoluteStrokeWidth:_=!1,color:E="currentColor",className:G=""}=Oe()??{},H=I??_?Number(w??U)*24/Number(m??B):w??U;return Ne("svg",{ref:S,...xe,width:m??B??xe.width,height:m??B??xe.height,stroke:i??E,strokeWidth:H,className:Le("lucide",G,N),...!D&&!He(p)&&{"aria-hidden":"true"},...p},[...g.map(([M,k])=>Ne(M,k)),...Array.isArray(D)?D:[D]])});var s=(i,m)=>{let w=la(({className:I,...N},D)=>ra(Ee,{ref:D,iconNode:m,className:Le(`lucide-${qe(ke(i))}`,`lucide-${i}`,I),...N}));return w.displayName=ke(i),w};var sa=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],X=s("bell",sa);var fa=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],ee=s("bot",fa);var ia=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ae=s("check",ia);var ca=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],te=s("hash",ca);var na=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],oe=s("image",na);var pa=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],de=s("info",pa);var ma=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],O=s("message-square",ma);var La=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],ue=s("music",La);var xa=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],j=s("search",xa);var Ia=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],le=s("send",Ia);var Ca=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],re=s("smile",Ca);var ga=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],se=s("trash-2",ga);var ha=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],K=s("user-plus",ha);var Sa=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Z=s("user",Sa);var ka=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],fe=s("users",ka);var wa=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],ie=s("video",wa);var Pa=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ce=s("wifi-off",Pa);var ya=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],ne=s("wifi",ya);var Aa=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pe=s("x",Aa);import{useRef as Ge,forwardRef as Ma,useImperativeHandle as Ba}from"react";import{jsx as Fa}from"react/jsx-runtime";var We=Ma(({placeholder:i="\u8F93\u5165\u6D88\u606F...",onSend:m,onChange:w,onAtTrigger:I,minHeight:N="44px",maxHeight:D="200px"},g)=>{let p=Ge(null),S=Ge(null),B=()=>{if(!p.current)return{text:"",segments:[]};let d="",t=[],u=Array.from(p.current.childNodes);for(let c of u)if(c.nodeType===Node.TEXT_NODE){let l=c.textContent||"";l&&(d+=l,t.push({type:"text",data:{text:l}}))}else if(c.nodeType===Node.ELEMENT_NODE){let l=c;if(l.classList.contains("editor-face")){let n=l.dataset.id;d+=`[face:${n}]`,t.push({type:"face",data:{id:Number(n)}})}else if(l.classList.contains("editor-image")){let n=l.dataset.url;d+=`[image:${n}]`,t.push({type:"image",data:{url:n}})}else if(l.classList.contains("editor-video")){let n=l.dataset.url||"";d+=`[video:${n}]`,t.push({type:"video",data:{url:n}})}else if(l.classList.contains("editor-audio")){let n=l.dataset.url||"";d+=`[audio:${n}]`,t.push({type:"audio",data:{url:n}})}else if(l.classList.contains("editor-at")){let n=l.dataset.name,y=l.dataset.id;d+=`[@${n}]`,t.push({type:"at",data:{name:n,qq:y}})}else l.tagName==="BR"&&(d+=`
2
2
  `)}return{text:d,segments:t}},U=d=>{if(!p.current)return;let t=document.createElement("img");t.src=`https://face.viki.moe/apng/${d}.png`,t.alt=`[face:${d}]`,t.dataset.type="face",t.dataset.id=String(d),t.className="editor-face",M(t),R()},_=d=>{if(!p.current||!d.trim())return;let t=document.createElement("img");t.src=d.trim(),t.alt=`[image:${d.trim()}]`,t.dataset.type="image",t.dataset.url=d.trim(),t.className="editor-image",M(t),R()},E=d=>{if(!p.current||!d.trim())return;let t=d.trim(),u=document.createElement("span");u.className="editor-video",u.dataset.url=t,u.contentEditable="false",u.textContent="\u{1F4F9} \u89C6\u9891",M(u),R()},G=d=>{if(!p.current||!d.trim())return;let t=d.trim(),u=document.createElement("span");u.className="editor-audio",u.dataset.url=t,u.contentEditable="false",u.textContent="\u{1F3B5} \u97F3\u9891",M(u),R()},H=(d,t)=>{if(!p.current||!d.trim())return;let u=document.createElement("span");u.dataset.type="at",u.dataset.name=d,t&&(u.dataset.id=t),u.className="editor-at",u.contentEditable="false";let c=document.createElement("span");c.textContent="@",c.className="editor-at-symbol";let l=document.createElement("span");l.textContent=d,l.className="editor-at-name",u.appendChild(c),u.appendChild(l),M(u),R()},M=d=>{if(!p.current)return;p.current.focus();let t=window.getSelection();if(t&&t.rangeCount>0){let u=t.getRangeAt(0);if(p.current.contains(u.commonAncestorContainer))u.deleteContents(),u.insertNode(d),u.collapse(!1),t.removeAllRanges(),t.addRange(u);else{p.current.appendChild(d);let l=document.createRange();l.setStartAfter(d),l.collapse(!0),t.removeAllRanges(),t.addRange(l)}}else{p.current.appendChild(d);let u=window.getSelection();if(u){let c=document.createRange();c.setStartAfter(d),c.collapse(!0),u.removeAllRanges(),u.addRange(c)}}},k=()=>{p.current&&(p.current.innerHTML="",R())},W=()=>{p.current?.focus()},$=()=>B(),me=()=>{if(!p.current||!I)return;let d=window.getSelection();if(!d||d.rangeCount===0){I(!1,""),S.current=null;return}let t=d.getRangeAt(0);if(!p.current.contains(t.commonAncestorContainer)){I(!1,""),S.current=null;return}let u=t.startContainer;if(u.nodeType!==Node.TEXT_NODE){I(!1,""),S.current=null;return}let c=u,l=c.textContent?.substring(0,t.startOffset)||"",n=l.lastIndexOf("@");if(n!==-1){let y=l.substring(n+1);if(y.includes(" ")||y.includes(`
3
- `)){I(!1,""),S.current=null;return}S.current=c;let V=document.createRange();V.setStart(c,n),V.setEnd(c,n+1);let v=V.getBoundingClientRect(),b=p.current.getBoundingClientRect();I(!0,y,{top:v.bottom-b.top,left:v.left-b.left})}else I(!1,""),S.current=null},R=()=>{if(me(),w){let{text:d,segments:t}=B();w(d,t)}},Ce=(d,t)=>{if(!S.current)return;let u=S.current,c=u.textContent||"",l=c.lastIndexOf("@");if(l!==-1){let n=c.substring(l+1),y=l+1+n.split(/[\s\n]/)[0].length,V=c.substring(0,l),v=c.substring(y);u.textContent=V+v;let b=window.getSelection();if(b){let T=document.createRange();T.setStart(u,l),T.collapse(!0),b.removeAllRanges(),b.addRange(T)}}S.current=null,H(d,t)},Y=d=>{d.preventDefault();let t=d.clipboardData,c=Array.from(t.items).find(n=>n.type.startsWith("image/"));if(c){let n=c.getAsFile();if(n){let y=new FileReader;y.onload=()=>{typeof y.result=="string"&&_(y.result)},y.readAsDataURL(n)}return}let l=t.getData("text/plain");l&&(document.execCommand("insertText",!1,l),R())},Q=d=>{if(d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),m)){let{text:t,segments:u}=B();m(t,u)}};return Ba(g,()=>({focus:W,clear:k,insertFace:U,insertImage:_,insertVideo:E,insertAudio:G,insertAt:H,replaceAtTrigger:Ce,getContent:$})),Fa("div",{ref:p,contentEditable:!0,suppressContentEditableWarning:!0,onInput:R,onKeyDown:Q,onPaste:Y,"data-placeholder":i,className:"rich-text-editor",style:{width:"100%",minHeight:N,maxHeight:D,padding:"0.5rem 0.75rem",border:"1px solid var(--gray-6)",borderRadius:"6px",backgroundColor:"var(--gray-1)",fontSize:"var(--font-size-2)",outline:"none",overflowY:"auto",lineHeight:"1.5",wordWrap:"break-word",color:"var(--gray-12)"}})});We.displayName="RichTextEditor";var Ve=We;import{Fragment as Da,jsx as a,jsxs as o}from"react/jsx-runtime";function Ae(){let[i,m]=C([]),[w,I]=C([{id:"user_1001",name:"\u6D4B\u8BD5\u7528\u6237",type:"private",unread:0},{id:"group_2001",name:"\u6D4B\u8BD5\u7FA4\u7EC4",type:"group",unread:0},{id:"channel_3001",name:"\u6D4B\u8BD5\u9891\u9053",type:"channel",unread:0}]),[N,D]=C([]),[g,p]=C(w[0]),[S,B]=C(""),[U,_]=C("ProcessBot"),[E,G]=C(!1),[H,M]=C(!1),[k,W]=C(null),[$,me]=C(""),[R,Ce]=C(!1),[Y,Q]=C(null),[d,t]=C(""),[u,c]=C(""),[l,n]=C(""),[y]=C([{id:"10001",name:"\u5F20\u4E09"},{id:"10002",name:"\u674E\u56DB"},{id:"10003",name:"\u738B\u4E94"},{id:"10004",name:"\u8D75\u516D"},{id:"10005",name:"\u6D4B\u8BD5\u7528\u6237"},{id:"10086",name:"Admin"},{id:"10010",name:"Test User"}]),[V,v]=C([]),[b,T]=C(!1),[J,ge]=C("chat"),Me=we(null),z=we(null),q=we(null),Xe=async()=>{try{let e=await fetch("https://face.viki.moe/metadata.json");D(await e.json())}catch(e){console.error("[Sandbox] Failed to fetch face list:",e)}};Ie(()=>{Xe()},[]);let Ke=e=>{let s=typeof e.content=="string"?he(e.content):Array.isArray(e.content)?e.content:he(String(e.content??"")),L=e.type==="private"?`\u79C1\u804A-${e.bot||U}`:e.type==="group"?`\u7FA4\u7EC4-${e.id}`:`\u9891\u9053-${e.id}`,x=e.type;I(f=>{if(f.some(F=>F.id===e.id))return f;let h={id:e.id,name:L,type:x,unread:0};return p(h),[...f,h]}),m(f=>[...f,{id:`bot_${e.timestamp}`,type:"received",channelType:x,channelId:e.id,channelName:L,senderId:"bot",senderName:e.bot||U,content:s,timestamp:e.timestamp}])};Ie(()=>{let e=Te(),s=new URL("/sandbox",`${e}/`);return s.protocol=s.protocol==="https:"?"wss:":"ws:",z.current=new WebSocket(s.href),z.current.onopen=()=>G(!0),z.current.onmessage=L=>{try{Ke(JSON.parse(L.data))}catch(x){console.error("[Sandbox] Failed to parse message:",x)}},z.current.onclose=()=>G(!1),()=>{z.current?.close(),z.current=null,G(!1)}},[]),Ie(()=>{Me.current?.scrollIntoView({behavior:"smooth"})},[i]),Ie(()=>{v(S.trim()?he(S):[])},[S]);let he=e=>{let s=[],L=/\[@([^\]]+)\]|\[face:(\d+)\]|\[image:([^\]]+)\]|\[video:([^\]]+)\]|\[audio:([^\]]+)\]/g,x=0,f;for(;(f=L.exec(e))!==null;){if(f.index>x){let h=e.substring(x,f.index);h&&s.push({type:"text",data:{text:h}})}f[1]?s.push({type:"at",data:{qq:f[1],name:f[1]}}):f[2]?s.push({type:"face",data:{id:parseInt(f[2],10)}}):f[3]?s.push({type:"image",data:{url:f[3]}}):f[4]?s.push({type:"video",data:{url:f[4]}}):f[5]&&s.push({type:"audio",data:{url:f[5]}}),x=L.lastIndex}if(x<e.length){let h=e.substring(x);h&&s.push({type:"text",data:{text:h}})}return s.length>0?s:[{type:"text",data:{text:e}}]},Be=e=>e.length===0?!1:e.some(s=>s.type==="text"?!!String(s.data?.text??"").trim():!0),Ze=(e,s)=>{let L=s?"ring-1 ring-primary-foreground/25":"ring-1 ring-border/60";return e.map((x,f)=>{if(typeof x=="string")return a("span",{children:x.split(`
3
+ `)){I(!1,""),S.current=null;return}S.current=c;let V=document.createRange();V.setStart(c,n),V.setEnd(c,n+1);let v=V.getBoundingClientRect(),b=p.current.getBoundingClientRect();I(!0,y,{top:v.bottom-b.top,left:v.left-b.left})}else I(!1,""),S.current=null},R=()=>{if(me(),w){let{text:d,segments:t}=B();w(d,t)}},Ce=(d,t)=>{if(!S.current)return;let u=S.current,c=u.textContent||"",l=c.lastIndexOf("@");if(l!==-1){let n=c.substring(l+1),y=l+1+n.split(/[\s\n]/)[0].length,V=c.substring(0,l),v=c.substring(y);u.textContent=V+v;let b=window.getSelection();if(b){let T=document.createRange();T.setStart(u,l),T.collapse(!0),b.removeAllRanges(),b.addRange(T)}}S.current=null,H(d,t)},Y=d=>{d.preventDefault();let t=d.clipboardData,c=Array.from(t.items).find(n=>n.type.startsWith("image/"));if(c){let n=c.getAsFile();if(n){let y=new FileReader;y.onload=()=>{typeof y.result=="string"&&_(y.result)},y.readAsDataURL(n)}return}let l=t.getData("text/plain");l&&(document.execCommand("insertText",!1,l),R())},Q=d=>{if(d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),m)){let{text:t,segments:u}=B();m(t,u)}};return Ba(g,()=>({focus:W,clear:k,insertFace:U,insertImage:_,insertVideo:E,insertAudio:G,insertAt:H,replaceAtTrigger:Ce,getContent:$})),Fa("div",{ref:p,contentEditable:!0,suppressContentEditableWarning:!0,onInput:R,onKeyDown:Q,onPaste:Y,"data-placeholder":i,className:"rich-text-editor",style:{width:"100%",minHeight:N,maxHeight:D,padding:"0.5rem 0.75rem",border:"1px solid var(--gray-6)",borderRadius:"6px",backgroundColor:"var(--gray-1)",fontSize:"var(--font-size-2)",outline:"none",overflowY:"auto",lineHeight:"1.5",wordWrap:"break-word",color:"var(--gray-12)"}})});We.displayName="RichTextEditor";var Ve=We;import{Fragment as Da,jsx as a,jsxs as o}from"react/jsx-runtime";function Ae(){let[i,m]=C([]),[w,I]=C([{id:"user_1001",name:"\u6D4B\u8BD5\u7528\u6237",type:"private",unread:0},{id:"group_2001",name:"\u6D4B\u8BD5\u7FA4\u7EC4",type:"group",unread:0},{id:"channel_3001",name:"\u6D4B\u8BD5\u9891\u9053",type:"channel",unread:0}]),[N,D]=C([]),[g,p]=C(w[0]),[S,B]=C(""),[U,_]=C("ProcessBot"),[E,G]=C(!1),[H,M]=C(!1),[k,W]=C(null),[$,me]=C(""),[R,Ce]=C(!1),[Y,Q]=C(null),[d,t]=C(""),[u,c]=C(""),[l,n]=C(""),[y]=C([{id:"10001",name:"\u5F20\u4E09"},{id:"10002",name:"\u674E\u56DB"},{id:"10003",name:"\u738B\u4E94"},{id:"10004",name:"\u8D75\u516D"},{id:"10005",name:"\u6D4B\u8BD5\u7528\u6237"},{id:"10086",name:"Admin"},{id:"10010",name:"Test User"}]),[V,v]=C([]),[b,T]=C(!1),[J,ge]=C("chat"),Me=we(null),z=we(null),q=we(null),Xe=async()=>{try{let e=await fetch("https://face.viki.moe/metadata.json");D(await e.json())}catch(e){console.error("[Sandbox] Failed to fetch face list:",e)}};Ie(()=>{Xe()},[]);let Ke=e=>{let r=typeof e.content=="string"?he(e.content):Array.isArray(e.content)?e.content:he(String(e.content??"")),L=e.type==="private"?`\u79C1\u804A-${e.bot||U}`:e.type==="group"?`\u7FA4\u7EC4-${e.id}`:`\u9891\u9053-${e.id}`,x=e.type;I(f=>{if(f.some(F=>F.id===e.id))return f;let h={id:e.id,name:L,type:x,unread:0};return p(h),[...f,h]}),m(f=>[...f,{id:`bot_${e.timestamp}`,type:"received",channelType:x,channelId:e.id,channelName:L,senderId:"bot",senderName:e.bot||U,content:r,timestamp:e.timestamp}])};Ie(()=>{let e=Te(),r=new URL("/sandbox",`${e}/`);return r.protocol=r.protocol==="https:"?"wss:":"ws:",z.current=new WebSocket(r.href),z.current.onopen=()=>G(!0),z.current.onmessage=L=>{try{Ke(JSON.parse(L.data))}catch(x){console.error("[Sandbox] Failed to parse message:",x)}},z.current.onclose=()=>G(!1),()=>{z.current?.close(),z.current=null,G(!1)}},[]),Ie(()=>{Me.current?.scrollIntoView({behavior:"smooth"})},[i]),Ie(()=>{v(S.trim()?he(S):[])},[S]);let he=e=>{let r=[],L=/\[@([^\]]+)\]|\[face:(\d+)\]|\[image:([^\]]+)\]|\[video:([^\]]+)\]|\[audio:([^\]]+)\]/g,x=0,f;for(;(f=L.exec(e))!==null;){if(f.index>x){let h=e.substring(x,f.index);h&&r.push({type:"text",data:{text:h}})}f[1]?r.push({type:"at",data:{qq:f[1],name:f[1]}}):f[2]?r.push({type:"face",data:{id:parseInt(f[2],10)}}):f[3]?r.push({type:"image",data:{url:f[3]}}):f[4]?r.push({type:"video",data:{url:f[4]}}):f[5]&&r.push({type:"audio",data:{url:f[5]}}),x=L.lastIndex}if(x<e.length){let h=e.substring(x);h&&r.push({type:"text",data:{text:h}})}return r.length>0?r:[{type:"text",data:{text:e}}]},Be=e=>e.length===0?!1:e.some(r=>r.type==="text"?!!String(r.data?.text??"").trim():!0),Ze=(e,r)=>{let L=r?"ring-1 ring-primary-foreground/25":"ring-1 ring-border/60";return e.map((x,f)=>{if(typeof x=="string")return a("span",{children:x.split(`
4
4
  `).map((F,P)=>o(ze.Fragment,{children:[F,P<x.split(`
5
5
  `).length-1&&a("br",{})]},P))},f);let h=x.data;switch(x.type){case"text":return a("span",{children:String(h.text??"").split(`
6
6
  `).map((F,P)=>o(ze.Fragment,{children:[F,P<String(h.text??"").split(`
7
- `).length-1&&a("br",{})]},P))},f);case"at":return o("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded bg-accent text-accent-foreground text-xs mx-0.5",children:["@",String(h.name??h.qq??"")]},f);case"face":return a("img",{src:`https://face.viki.moe/apng/${h.id}.png`,alt:"",className:"w-6 h-6 inline-block align-middle mx-0.5"},f);case"image":{let F=ye(h),P=Pe(F,"image");return P?a("a",{href:P,target:"_blank",rel:"noreferrer",className:"block my-1",children:a("img",{src:P,alt:"",className:A("max-w-[min(320px,88vw)] rounded-lg block",L,"ring-offset-0"),onError:aa=>{aa.target.style.display="none"}})},f):a("span",{className:"text-xs opacity-70",children:"[\u56FE\u7247]"},f)}case"video":{let F=ye(h),P=Pe(F,"video");return P?a("video",{src:P,controls:!0,playsInline:!0,preload:"metadata",className:A("max-w-[min(360px,92vw)] max-h-72 rounded-lg my-1 bg-black/10",L)},f):a("span",{className:"text-xs opacity-70",children:"[\u89C6\u9891\u65E0\u5730\u5740]"},f)}case"audio":case"record":{let F=ye(h),P=Pe(F,"audio");return P?a("audio",{src:P,controls:!0,preload:"metadata",className:A("w-full max-w-sm my-2 h-10",s&&"opacity-95")},f):a("span",{className:"text-xs opacity-70",children:"[\u97F3\u9891\u65E0\u5730\u5740]"},f)}case"file":return o("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded border text-xs mx-0.5",children:["\u{1F4CE} ",String(h.name||"\u6587\u4EF6")]},f);default:return o("span",{className:"text-xs opacity-70",children:["[",x.type,"]"]},f)}})},Fe=(e,s)=>{if(!Be(s))return;let L={id:`msg_${Date.now()}`,type:"sent",channelType:g.type,channelId:g.id,channelName:g.name,senderId:"test_user",senderName:"\u6D4B\u8BD5\u7528\u6237",content:s,timestamp:Date.now()};m(f=>[...f,L]),B(""),v([]),q.current?.clear();let x=JSON.stringify({type:g.type,id:g.id,content:s,timestamp:Date.now()});z.current?.send(x)},_e=()=>{confirm("\u786E\u5B9A\u6E05\u7A7A\u6240\u6709\u6D88\u606F\u8BB0\u5F55\uFF1F")&&m([])},Qe=e=>{ge("chat"),p(e),I(s=>s.map(L=>L.id===e.id?{...L,unread:0}:L)),window.innerWidth<768&&T(!1)},Je=()=>{let e=["private","group","channel"],s=e[Math.floor(Math.random()*e.length)],L=prompt("\u8BF7\u8F93\u5165\u9891\u9053\u540D\u79F0\uFF1A");if(L){let x={id:`${s}_${Date.now()}`,name:L,type:s,unread:0};I(f=>[...f,x]),p(x)}},De=e=>{switch(e){case"private":return a(Z,{size:16});case"group":return a(fe,{size:16});case"channel":return a(te,{size:16});default:return a(O,{size:16})}},je=e=>{q.current?.insertFace(e),M(!1)},be=()=>{let e=$.trim();!e||!k||(k==="image"?q.current?.insertImage(e):k==="video"?q.current?.insertVideo(e):q.current?.insertAudio(e),me(""),W(null))},ba=()=>{l.trim()&&(q.current?.insertAt(l.trim()),n(""),Ce(!1))},$e=e=>{q.current?.replaceAtTrigger(e.name,e.id),Q(null),t("")},Ye=(e,s,L)=>{if(g.type==="private"){Q(null),t("");return}e&&L?(Q(L),t(s)):(Q(null),t(""))},Re=y.filter(e=>{if(!d.trim())return!0;let s=d.toLowerCase();return e.name.toLowerCase().includes(s)||e.id.toLowerCase().includes(s)}),ea=(e,s)=>{B(e),v(s)},ve=N.filter(e=>e.name.toLowerCase().includes(u.toLowerCase())||e.describe.toLowerCase().includes(u.toLowerCase())),Se=i.filter(e=>e.channelId===g.id);return o("div",{className:"sandbox-container rounded-xl border border-border/70 bg-card/30 shadow-sm",children:[o("button",{className:"mobile-channel-toggle md:hidden",onClick:()=>T(!b),children:[a(O,{size:20})," \u9891\u9053\u5217\u8868"]}),o("div",{className:A("channel-sidebar rounded-lg border bg-card",b&&"show"),children:[a("div",{className:"p-3 border-b",children:o("div",{className:"flex justify-between items-center",children:[o("div",{className:"flex items-center gap-2",children:[a("div",{className:"p-1 rounded-md bg-secondary",children:a(O,{size:16,className:"text-muted-foreground"})}),a("h3",{className:"font-semibold",children:"\u9891\u9053\u5217\u8868"})]}),o("span",{className:A("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",E?"bg-emerald-100 text-emerald-800 border-emerald-200 dark:bg-emerald-900/30 dark:text-emerald-400 dark:border-emerald-800":"bg-muted text-muted-foreground"),children:[E?a(ne,{size:12}):a(ce,{size:12}),E?"\u5DF2\u8FDE\u63A5":"\u672A\u8FDE\u63A5"]})]})}),o("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:[w.map(e=>{let s=J==="chat"&&g.id===e.id;return o("div",{className:A("menu-item",s&&"active"),onClick:()=>Qe(e),children:[a("span",{className:"shrink-0",children:De(e.type)}),o("div",{className:"flex-1 min-w-0",children:[a("div",{className:"text-sm font-medium truncate",children:e.name}),a("div",{className:"text-xs text-muted-foreground",children:e.type==="private"?"\u79C1\u804A":e.type==="group"?"\u7FA4\u804A":"\u9891\u9053"})]}),e.unread>0&&a("span",{className:"inline-flex items-center justify-center h-5 min-w-5 rounded-full bg-destructive text-destructive-foreground text-[10px] font-medium px-1",children:e.unread})]},e.id)}),o("div",{className:"pt-2 mt-2 border-t space-y-1",children:[o("div",{className:A("menu-item",J==="requests"&&"active"),onClick:()=>{ge("requests"),window.innerWidth<768&&T(!1)},children:[a(K,{size:16,className:"shrink-0"}),o("div",{className:"flex-1 min-w-0",children:[a("div",{className:"text-sm font-medium",children:"\u8BF7\u6C42"}),a("div",{className:"text-xs text-muted-foreground",children:"\u597D\u53CB/\u7FA4\u9080\u8BF7\u7B49"})]})]}),o("div",{className:A("menu-item",J==="notices"&&"active"),onClick:()=>{ge("notices"),window.innerWidth<768&&T(!1)},children:[a(X,{size:16,className:"shrink-0"}),o("div",{className:"flex-1 min-w-0",children:[a("div",{className:"text-sm font-medium",children:"\u901A\u77E5"}),a("div",{className:"text-xs text-muted-foreground",children:"\u7FA4\u7BA1/\u64A4\u56DE\u7B49"})]})]})]})]}),a("div",{className:"p-2 border-t",children:a("button",{className:"w-full py-2 px-3 rounded-md border border-dashed text-sm text-muted-foreground hover:bg-accent transition-colors",onClick:Je,children:"+ \u6DFB\u52A0\u9891\u9053"})})]}),b&&a("div",{className:"channel-overlay md:hidden",onClick:()=>T(!1)}),o("div",{className:"chat-area",children:[J==="requests"&&o("div",{className:"rounded-lg border bg-card flex-1 flex flex-col min-h-0 overflow-hidden",children:[a("div",{className:"p-3 border-b flex-shrink-0",children:o("h2",{className:"text-lg font-bold flex items-center gap-2",children:[a(K,{size:20})," \u8BF7\u6C42"]})}),o("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col items-center justify-center gap-3 text-muted-foreground text-center",children:[a(K,{size:48,className:"opacity-30"}),a("span",{children:"\u6C99\u76D2\u4E3A\u6A21\u62DF\u73AF\u5883\uFF0C\u6682\u65E0\u8BF7\u6C42\u6570\u636E"}),o("span",{className:"text-sm",children:["\u5B9E\u9645\u597D\u53CB/\u7FA4\u9080\u8BF7\u7B49\u8BF7\u6C42\u8BF7\u5230\u4FA7\u8FB9\u680F ",a("strong",{children:"\u673A\u5668\u4EBA"})," \u9875\u9762\u8FDB\u5165\u5BF9\u5E94\u673A\u5668\u4EBA\u7BA1\u7406\u67E5\u770B"]})]})]}),J==="notices"&&o("div",{className:"rounded-lg border bg-card flex-1 flex flex-col min-h-0 overflow-hidden",children:[a("div",{className:"p-3 border-b flex-shrink-0",children:o("h2",{className:"text-lg font-bold flex items-center gap-2",children:[a(X,{size:20})," \u901A\u77E5"]})}),o("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col items-center justify-center gap-3 text-muted-foreground text-center",children:[a(X,{size:48,className:"opacity-30"}),a("span",{children:"\u6C99\u76D2\u4E3A\u6A21\u62DF\u73AF\u5883\uFF0C\u6682\u65E0\u901A\u77E5\u6570\u636E"}),o("span",{className:"text-sm",children:["\u5B9E\u9645\u7FA4\u7BA1\u3001\u64A4\u56DE\u7B49\u901A\u77E5\u8BF7\u5230\u4FA7\u8FB9\u680F ",a("strong",{children:"\u673A\u5668\u4EBA"})," \u9875\u9762\u8FDB\u5165\u5BF9\u5E94\u673A\u5668\u4EBA\u7BA1\u7406\u67E5\u770B"]})]})]}),J==="chat"&&o(Da,{children:[a("div",{className:"rounded-lg border bg-card p-3 flex-shrink-0",children:o("div",{className:"flex justify-between items-center flex-wrap gap-2",children:[o("div",{className:"flex items-center gap-3",children:[a("div",{className:"p-2 rounded-lg bg-secondary",children:De(g.type)}),o("div",{children:[a("h2",{className:"text-lg font-bold",children:g.name}),o("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a("span",{children:g.id}),a("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded border text-[10px]",children:Se.length}),a("span",{children:"\u6761\u6D88\u606F"})]})]}),a("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-secondary text-secondary-foreground",children:g.type==="private"?"\u79C1\u804A":g.type==="group"?"\u7FA4\u804A":"\u9891\u9053"})]}),o("div",{className:"flex items-center gap-2",children:[a("input",{value:U,onChange:e=>_(e.target.value),placeholder:"\u673A\u5668\u4EBA\u540D\u79F0",className:"h-8 w-28 rounded-md border bg-transparent px-2 text-sm"}),o("button",{className:"inline-flex items-center gap-1 h-8 px-3 rounded-md bg-secondary text-secondary-foreground text-sm hover:bg-secondary/80",onClick:_e,children:[a(re,{size:14})," \u6E05\u7A7A"]})]})]})}),a("div",{className:"rounded-lg border bg-card flex-1 flex flex-col min-h-0",children:a("div",{className:"flex-1 overflow-y-auto p-4",children:Se.length===0?o("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[a(O,{size:64,className:"text-muted-foreground/20"}),a("span",{className:"text-muted-foreground",children:"\u6682\u65E0\u6D88\u606F\uFF0C\u5F00\u59CB\u5BF9\u8BDD\u5427\uFF01"})]}):o("div",{className:"space-y-2",children:[Se.map(e=>a("div",{className:A("flex",e.type==="sent"?"justify-end":"justify-start"),children:o("div",{className:A("max-w-[70%] p-3 rounded-2xl",e.type==="sent"?"bg-primary text-primary-foreground":"bg-muted"),children:[o("div",{className:"flex items-center gap-2 mb-1",children:[e.type==="received"&&a(ee,{size:14}),e.type==="sent"&&a(Z,{size:14}),a("span",{className:"text-xs font-medium opacity-90",children:e.senderName}),a("span",{className:"text-xs opacity-70",children:new Date(e.timestamp).toLocaleTimeString()})]}),a("div",{className:"text-sm space-y-1",children:Ze(e.content,e.type==="sent")})]})},e.id)),a("div",{ref:Me})]})})}),o("div",{className:"rounded-lg border bg-card p-3 flex-shrink-0 space-y-3",children:[o("div",{className:"flex gap-2 items-center flex-wrap",children:[a("button",{type:"button",className:A("h-8 w-8 rounded-md flex items-center justify-center border transition-colors",H?"bg-primary text-primary-foreground":"hover:bg-accent"),onClick:()=>{M(!H),W(null)},title:"\u63D2\u5165\u8868\u60C5",children:a(se,{size:16})}),a("button",{type:"button",className:A("h-8 w-8 rounded-md flex items-center justify-center border transition-colors",k==="image"?"bg-primary text-primary-foreground":"hover:bg-accent"),onClick:()=>{W(e=>e==="image"?null:"image"),M(!1)},title:"\u63D2\u5165\u56FE\u7247 URL",children:a(oe,{size:16})}),a("button",{type:"button",className:A("h-8 w-8 rounded-md flex items-center justify-center border transition-colors",k==="video"?"bg-primary text-primary-foreground":"hover:bg-accent"),onClick:()=>{W(e=>e==="video"?null:"video"),M(!1)},title:"\u63D2\u5165\u89C6\u9891 URL",children:a(ie,{size:16})}),a("button",{type:"button",className:A("h-8 w-8 rounded-md flex items-center justify-center border transition-colors",k==="audio"?"bg-primary text-primary-foreground":"hover:bg-accent"),onClick:()=>{W(e=>e==="audio"?null:"audio"),M(!1)},title:"\u63D2\u5165\u97F3\u9891 URL",children:a(ue,{size:16})}),a("div",{className:"flex-1 min-w-[1rem]"}),S&&a("button",{className:"h-8 w-8 rounded-md flex items-center justify-center hover:bg-accent transition-colors",onClick:()=>{B(""),v([])},children:a(pe,{size:16})})]}),H&&o("div",{className:"p-3 rounded-md border bg-muted/30 max-h-64 overflow-y-auto space-y-2",children:[a("input",{value:u,onChange:e=>c(e.target.value),placeholder:"\u641C\u7D22\u8868\u60C5...",className:"w-full h-8 rounded-md border bg-transparent px-2 text-sm"}),a("div",{className:"grid grid-cols-8 gap-1",children:ve.slice(0,80).map(e=>a("button",{onClick:()=>je(e.id),title:e.name,className:"w-10 h-10 rounded-md border flex items-center justify-center hover:bg-accent transition-colors",children:a("img",{src:`https://face.viki.moe/apng/${e.id}.png`,alt:e.name,className:"w-8 h-8"})},e.id))}),ve.length===0&&o("div",{className:"flex flex-col items-center gap-2 py-4",children:[a(j,{size:32,className:"text-muted-foreground/30"}),a("span",{className:"text-sm text-muted-foreground",children:"\u672A\u627E\u5230\u5339\u914D\u7684\u8868\u60C5"})]})]}),k&&o("div",{className:"p-3 rounded-md border bg-muted/30 space-y-2",children:[o("p",{className:"text-xs text-muted-foreground",children:[k==="image"&&"\u652F\u6301 http(s) \u56FE\u7247\u94FE\u63A5\u6216 data URL",k==="video"&&"\u652F\u6301\u6D4F\u89C8\u5668\u53EF\u89E3\u7801\u7684\u89C6\u9891\u76F4\u94FE\uFF08\u5982 .mp4\u3001.webm\uFF09",k==="audio"&&"\u652F\u6301 .mp3\u3001.ogg\u3001.wav \u7B49\u97F3\u9891\u76F4\u94FE"]}),a("input",{value:$,onChange:e=>me(e.target.value),placeholder:k==="image"?"\u56FE\u7247 URL\u2026":k==="video"?"\u89C6\u9891 URL\u2026":"\u97F3\u9891 URL\u2026",className:"w-full h-8 rounded-md border border-input bg-background px-2 text-sm",onKeyDown:e=>{e.key==="Enter"&&(e.preventDefault(),be())}}),o("button",{type:"button",className:"inline-flex items-center gap-1 h-8 px-3 rounded-md bg-primary text-primary-foreground text-sm disabled:opacity-50",onClick:be,disabled:!$.trim(),children:[a(ae,{size:14})," \u63D2\u5165\u5230\u8F93\u5165\u6846"]})]}),o("div",{className:"flex gap-2 items-start",children:[o("div",{className:"flex-1 relative",children:[a(Ve,{ref:q,placeholder:`\u5411 ${g.name} \u53D1\u9001\u6D88\u606F...`,onSend:Fe,onChange:ea,onAtTrigger:Ye,minHeight:"44px",maxHeight:"200px"}),Y&&a("div",{className:"absolute z-50 rounded-lg border bg-popover shadow-md min-w-60 max-h-72 overflow-y-auto p-1",style:{top:`${Y.top}px`,left:`${Y.left}px`},children:Re.length>0?Re.map(e=>o("div",{className:"flex items-center gap-2 p-2 rounded-md cursor-pointer hover:bg-accent transition-colors",onClick:()=>$e(e),children:[a(Z,{size:16,className:"text-muted-foreground"}),o("div",{className:"flex-1",children:[a("div",{className:"text-sm font-medium",children:e.name}),o("div",{className:"text-xs text-muted-foreground",children:["ID: ",e.id]})]})]},e.id)):o("div",{className:"flex flex-col items-center gap-2 p-4",children:[a(j,{size:20,className:"text-muted-foreground/50"}),a("span",{className:"text-xs text-muted-foreground",children:"\u672A\u627E\u5230\u5339\u914D\u7684\u7528\u6237"})]})})]}),o("button",{className:"inline-flex items-center gap-1.5 h-10 px-4 rounded-md bg-primary text-primary-foreground text-sm font-medium disabled:opacity-50 transition-colors hover:bg-primary/90",onClick:()=>{let e=q.current?.getContent();e&&Fe(e.text,e.segments)},disabled:!Be(V),children:[a(le,{size:16})," \u53D1\u9001"]})]}),o("div",{className:"flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[a(de,{size:12})," \u5FEB\u6377\u64CD\u4F5C:",a("span",{className:"px-1 py-0.5 rounded border text-[10px]",children:"Enter"})," \u53D1\u9001",a("span",{className:"px-1 py-0.5 rounded border text-[10px]",children:"Shift+Enter"})," \u6362\u884C",a("span",{className:"px-1 py-0.5 rounded border text-[10px]",children:"[@\u540D\u79F0]"})," @\u67D0\u4EBA",a("span",{className:"px-1 py-0.5 rounded border text-[10px]",children:"[video:URL]"}),a("span",{className:"px-1 py-0.5 rounded border text-[10px]",children:"[audio:URL]"})]})]})]})]})]})}function So(i){i.addRoute({path:"/console/sandbox",name:"\u6C99\u76D2",element:i.React.createElement(Ae,{hostReact:i.React})}),i.addTool({id:"sandbox",name:"\u6C99\u76D2",path:"/console/sandbox"})}export{So as register};
7
+ `).length-1&&a("br",{})]},P))},f);case"at":return o("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded bg-accent text-accent-foreground text-xs mx-0.5",children:["@",String(h.name??h.qq??"")]},f);case"face":return a("img",{src:`https://face.viki.moe/apng/${h.id}.png`,alt:"",className:"w-6 h-6 inline-block align-middle mx-0.5"},f);case"image":{let F=ye(h),P=Pe(F,"image");return P?a("a",{href:P,target:"_blank",rel:"noreferrer",className:"block my-1",children:a("img",{src:P,alt:"",className:A("max-w-[min(320px,88vw)] rounded-lg block",L,"ring-offset-0"),onError:aa=>{aa.target.style.display="none"}})},f):a("span",{className:"text-xs opacity-70",children:"[\u56FE\u7247]"},f)}case"video":{let F=ye(h),P=Pe(F,"video");return P?a("video",{src:P,controls:!0,playsInline:!0,preload:"metadata",className:A("max-w-[min(360px,92vw)] max-h-72 rounded-lg my-1 bg-black/10",L)},f):a("span",{className:"text-xs opacity-70",children:"[\u89C6\u9891\u65E0\u5730\u5740]"},f)}case"audio":case"record":{let F=ye(h),P=Pe(F,"audio");return P?a("audio",{src:P,controls:!0,preload:"metadata",className:A("w-full max-w-sm my-2 h-10",r&&"opacity-95")},f):a("span",{className:"text-xs opacity-70",children:"[\u97F3\u9891\u65E0\u5730\u5740]"},f)}case"file":return o("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded border text-xs mx-0.5",children:["\u{1F4CE} ",String(h.name||"\u6587\u4EF6")]},f);default:return o("span",{className:"text-xs opacity-70",children:["[",x.type,"]"]},f)}})},Fe=(e,r)=>{if(!Be(r))return;let L={id:`msg_${Date.now()}`,type:"sent",channelType:g.type,channelId:g.id,channelName:g.name,senderId:"test_user",senderName:"\u6D4B\u8BD5\u7528\u6237",content:r,timestamp:Date.now()};m(f=>[...f,L]),B(""),v([]),q.current?.clear();let x=JSON.stringify({type:g.type,id:g.id,content:r,timestamp:Date.now()});z.current?.send(x)},_e=()=>{confirm("\u786E\u5B9A\u6E05\u7A7A\u6240\u6709\u6D88\u606F\u8BB0\u5F55\uFF1F")&&m([])},Qe=e=>{ge("chat"),p(e),I(r=>r.map(L=>L.id===e.id?{...L,unread:0}:L)),window.innerWidth<768&&T(!1)},Je=()=>{let e=["private","group","channel"],r=e[Math.floor(Math.random()*e.length)],L=prompt("\u8BF7\u8F93\u5165\u9891\u9053\u540D\u79F0\uFF1A");if(L){let x={id:`${r}_${Date.now()}`,name:L,type:r,unread:0};I(f=>[...f,x]),p(x)}},De=e=>{switch(e){case"private":return a(Z,{size:16});case"group":return a(fe,{size:16});case"channel":return a(te,{size:16});default:return a(O,{size:16})}},je=e=>{q.current?.insertFace(e),M(!1)},be=()=>{let e=$.trim();!e||!k||(k==="image"?q.current?.insertImage(e):k==="video"?q.current?.insertVideo(e):q.current?.insertAudio(e),me(""),W(null))},ba=()=>{l.trim()&&(q.current?.insertAt(l.trim()),n(""),Ce(!1))},$e=e=>{q.current?.replaceAtTrigger(e.name,e.id),Q(null),t("")},Ye=(e,r,L)=>{if(g.type==="private"){Q(null),t("");return}e&&L?(Q(L),t(r)):(Q(null),t(""))},Re=y.filter(e=>{if(!d.trim())return!0;let r=d.toLowerCase();return e.name.toLowerCase().includes(r)||e.id.toLowerCase().includes(r)}),ea=(e,r)=>{B(e),v(r)},ve=N.filter(e=>e.name.toLowerCase().includes(u.toLowerCase())||e.describe.toLowerCase().includes(u.toLowerCase())),Se=i.filter(e=>e.channelId===g.id);return o("div",{className:"sandbox-container rounded-xl border border-border/70 bg-card/30 shadow-sm",children:[o("button",{className:"mobile-channel-toggle md:hidden",onClick:()=>T(!b),children:[a(O,{size:20})," \u9891\u9053\u5217\u8868"]}),o("div",{className:A("channel-sidebar rounded-lg border bg-card",b&&"show"),children:[a("div",{className:"p-3 border-b",children:o("div",{className:"flex justify-between items-center",children:[o("div",{className:"flex items-center gap-2",children:[a("div",{className:"p-1 rounded-md bg-secondary",children:a(O,{size:16,className:"text-muted-foreground"})}),a("h3",{className:"font-semibold",children:"\u9891\u9053\u5217\u8868"})]}),o("span",{className:A("inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",E?"bg-emerald-100 text-emerald-800 border-emerald-200 dark:bg-emerald-900/30 dark:text-emerald-400 dark:border-emerald-800":"bg-muted text-muted-foreground"),children:[E?a(ne,{size:12}):a(ce,{size:12}),E?"\u5DF2\u8FDE\u63A5":"\u672A\u8FDE\u63A5"]})]})}),o("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:[w.map(e=>{let r=J==="chat"&&g.id===e.id;return o("div",{className:A("menu-item",r&&"active"),onClick:()=>Qe(e),children:[a("span",{className:"shrink-0",children:De(e.type)}),o("div",{className:"flex-1 min-w-0",children:[a("div",{className:"text-sm font-medium truncate",children:e.name}),a("div",{className:"text-xs text-muted-foreground",children:e.type==="private"?"\u79C1\u804A":e.type==="group"?"\u7FA4\u804A":"\u9891\u9053"})]}),e.unread>0&&a("span",{className:"inline-flex items-center justify-center h-5 min-w-5 rounded-full bg-destructive text-destructive-foreground text-[10px] font-medium px-1",children:e.unread})]},e.id)}),o("div",{className:"pt-2 mt-2 border-t space-y-1",children:[o("div",{className:A("menu-item",J==="requests"&&"active"),onClick:()=>{ge("requests"),window.innerWidth<768&&T(!1)},children:[a(K,{size:16,className:"shrink-0"}),o("div",{className:"flex-1 min-w-0",children:[a("div",{className:"text-sm font-medium",children:"\u8BF7\u6C42"}),a("div",{className:"text-xs text-muted-foreground",children:"\u597D\u53CB/\u7FA4\u9080\u8BF7\u7B49"})]})]}),o("div",{className:A("menu-item",J==="notices"&&"active"),onClick:()=>{ge("notices"),window.innerWidth<768&&T(!1)},children:[a(X,{size:16,className:"shrink-0"}),o("div",{className:"flex-1 min-w-0",children:[a("div",{className:"text-sm font-medium",children:"\u901A\u77E5"}),a("div",{className:"text-xs text-muted-foreground",children:"\u7FA4\u7BA1/\u64A4\u56DE\u7B49"})]})]})]})]}),a("div",{className:"p-2 border-t",children:a("button",{className:"w-full py-2 px-3 rounded-md border border-dashed text-sm text-muted-foreground hover:bg-accent transition-colors",onClick:Je,children:"+ \u6DFB\u52A0\u9891\u9053"})})]}),b&&a("div",{className:"channel-overlay md:hidden",onClick:()=>T(!1)}),o("div",{className:"chat-area",children:[J==="requests"&&o("div",{className:"rounded-lg border bg-card flex-1 flex flex-col min-h-0 overflow-hidden",children:[a("div",{className:"p-3 border-b flex-shrink-0",children:o("h2",{className:"text-lg font-bold flex items-center gap-2",children:[a(K,{size:20})," \u8BF7\u6C42"]})}),o("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col items-center justify-center gap-3 text-muted-foreground text-center",children:[a(K,{size:48,className:"opacity-30"}),a("span",{children:"\u6C99\u76D2\u4E3A\u6A21\u62DF\u73AF\u5883\uFF0C\u6682\u65E0\u8BF7\u6C42\u6570\u636E"}),o("span",{className:"text-sm",children:["\u5B9E\u9645\u597D\u53CB/\u7FA4\u9080\u8BF7\u7B49\u8BF7\u6C42\u8BF7\u5230\u4FA7\u8FB9\u680F ",a("strong",{children:"\u673A\u5668\u4EBA"})," \u9875\u9762\u8FDB\u5165\u5BF9\u5E94\u673A\u5668\u4EBA\u7BA1\u7406\u67E5\u770B"]})]})]}),J==="notices"&&o("div",{className:"rounded-lg border bg-card flex-1 flex flex-col min-h-0 overflow-hidden",children:[a("div",{className:"p-3 border-b flex-shrink-0",children:o("h2",{className:"text-lg font-bold flex items-center gap-2",children:[a(X,{size:20})," \u901A\u77E5"]})}),o("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col items-center justify-center gap-3 text-muted-foreground text-center",children:[a(X,{size:48,className:"opacity-30"}),a("span",{children:"\u6C99\u76D2\u4E3A\u6A21\u62DF\u73AF\u5883\uFF0C\u6682\u65E0\u901A\u77E5\u6570\u636E"}),o("span",{className:"text-sm",children:["\u5B9E\u9645\u7FA4\u7BA1\u3001\u64A4\u56DE\u7B49\u901A\u77E5\u8BF7\u5230\u4FA7\u8FB9\u680F ",a("strong",{children:"\u673A\u5668\u4EBA"})," \u9875\u9762\u8FDB\u5165\u5BF9\u5E94\u673A\u5668\u4EBA\u7BA1\u7406\u67E5\u770B"]})]})]}),J==="chat"&&o(Da,{children:[a("div",{className:"rounded-lg border bg-card p-3 flex-shrink-0",children:o("div",{className:"flex justify-between items-center flex-wrap gap-2",children:[o("div",{className:"flex items-center gap-3",children:[a("div",{className:"p-2 rounded-lg bg-secondary",children:De(g.type)}),o("div",{children:[a("h2",{className:"text-lg font-bold",children:g.name}),o("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a("span",{children:g.id}),a("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded border text-[10px]",children:Se.length}),a("span",{children:"\u6761\u6D88\u606F"})]})]}),a("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-secondary text-secondary-foreground",children:g.type==="private"?"\u79C1\u804A":g.type==="group"?"\u7FA4\u804A":"\u9891\u9053"})]}),o("div",{className:"flex items-center gap-2",children:[a("input",{value:U,onChange:e=>_(e.target.value),placeholder:"\u673A\u5668\u4EBA\u540D\u79F0",className:"h-8 w-28 rounded-md border bg-transparent px-2 text-sm"}),o("button",{className:"inline-flex items-center gap-1 h-8 px-3 rounded-md bg-secondary text-secondary-foreground text-sm hover:bg-secondary/80",onClick:_e,children:[a(se,{size:14})," \u6E05\u7A7A"]})]})]})}),a("div",{className:"rounded-lg border bg-card flex-1 flex flex-col min-h-0",children:a("div",{className:"flex-1 overflow-y-auto p-4",children:Se.length===0?o("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[a(O,{size:64,className:"text-muted-foreground/20"}),a("span",{className:"text-muted-foreground",children:"\u6682\u65E0\u6D88\u606F\uFF0C\u5F00\u59CB\u5BF9\u8BDD\u5427\uFF01"})]}):o("div",{className:"space-y-2",children:[Se.map(e=>a("div",{className:A("flex",e.type==="sent"?"justify-end":"justify-start"),children:o("div",{className:A("max-w-[70%] p-3 rounded-2xl",e.type==="sent"?"bg-primary text-primary-foreground":"bg-muted"),children:[o("div",{className:"flex items-center gap-2 mb-1",children:[e.type==="received"&&a(ee,{size:14}),e.type==="sent"&&a(Z,{size:14}),a("span",{className:"text-xs font-medium opacity-90",children:e.senderName}),a("span",{className:"text-xs opacity-70",children:new Date(e.timestamp).toLocaleTimeString()})]}),a("div",{className:"text-sm space-y-1",children:Ze(e.content,e.type==="sent")})]})},e.id)),a("div",{ref:Me})]})})}),o("div",{className:"rounded-lg border bg-card p-3 flex-shrink-0 space-y-3",children:[o("div",{className:"flex gap-2 items-center flex-wrap",children:[a("button",{type:"button",className:A("h-8 w-8 rounded-md flex items-center justify-center border transition-colors",H?"bg-primary text-primary-foreground":"hover:bg-accent"),onClick:()=>{M(!H),W(null)},title:"\u63D2\u5165\u8868\u60C5",children:a(re,{size:16})}),a("button",{type:"button",className:A("h-8 w-8 rounded-md flex items-center justify-center border transition-colors",k==="image"?"bg-primary text-primary-foreground":"hover:bg-accent"),onClick:()=>{W(e=>e==="image"?null:"image"),M(!1)},title:"\u63D2\u5165\u56FE\u7247 URL",children:a(oe,{size:16})}),a("button",{type:"button",className:A("h-8 w-8 rounded-md flex items-center justify-center border transition-colors",k==="video"?"bg-primary text-primary-foreground":"hover:bg-accent"),onClick:()=>{W(e=>e==="video"?null:"video"),M(!1)},title:"\u63D2\u5165\u89C6\u9891 URL",children:a(ie,{size:16})}),a("button",{type:"button",className:A("h-8 w-8 rounded-md flex items-center justify-center border transition-colors",k==="audio"?"bg-primary text-primary-foreground":"hover:bg-accent"),onClick:()=>{W(e=>e==="audio"?null:"audio"),M(!1)},title:"\u63D2\u5165\u97F3\u9891 URL",children:a(ue,{size:16})}),a("div",{className:"flex-1 min-w-[1rem]"}),S&&a("button",{className:"h-8 w-8 rounded-md flex items-center justify-center hover:bg-accent transition-colors",onClick:()=>{B(""),v([])},children:a(pe,{size:16})})]}),H&&o("div",{className:"p-3 rounded-md border bg-muted/30 max-h-64 overflow-y-auto space-y-2",children:[a("input",{value:u,onChange:e=>c(e.target.value),placeholder:"\u641C\u7D22\u8868\u60C5...",className:"w-full h-8 rounded-md border bg-transparent px-2 text-sm"}),a("div",{className:"grid grid-cols-8 gap-1",children:ve.slice(0,80).map(e=>a("button",{onClick:()=>je(e.id),title:e.name,className:"w-10 h-10 rounded-md border flex items-center justify-center hover:bg-accent transition-colors",children:a("img",{src:`https://face.viki.moe/apng/${e.id}.png`,alt:e.name,className:"w-8 h-8"})},e.id))}),ve.length===0&&o("div",{className:"flex flex-col items-center gap-2 py-4",children:[a(j,{size:32,className:"text-muted-foreground/30"}),a("span",{className:"text-sm text-muted-foreground",children:"\u672A\u627E\u5230\u5339\u914D\u7684\u8868\u60C5"})]})]}),k&&o("div",{className:"p-3 rounded-md border bg-muted/30 space-y-2",children:[o("p",{className:"text-xs text-muted-foreground",children:[k==="image"&&"\u652F\u6301 http(s) \u56FE\u7247\u94FE\u63A5\u6216 data URL",k==="video"&&"\u652F\u6301\u6D4F\u89C8\u5668\u53EF\u89E3\u7801\u7684\u89C6\u9891\u76F4\u94FE\uFF08\u5982 .mp4\u3001.webm\uFF09",k==="audio"&&"\u652F\u6301 .mp3\u3001.ogg\u3001.wav \u7B49\u97F3\u9891\u76F4\u94FE"]}),a("input",{value:$,onChange:e=>me(e.target.value),placeholder:k==="image"?"\u56FE\u7247 URL\u2026":k==="video"?"\u89C6\u9891 URL\u2026":"\u97F3\u9891 URL\u2026",className:"w-full h-8 rounded-md border border-input bg-background px-2 text-sm",onKeyDown:e=>{e.key==="Enter"&&(e.preventDefault(),be())}}),o("button",{type:"button",className:"inline-flex items-center gap-1 h-8 px-3 rounded-md bg-primary text-primary-foreground text-sm disabled:opacity-50",onClick:be,disabled:!$.trim(),children:[a(ae,{size:14})," \u63D2\u5165\u5230\u8F93\u5165\u6846"]})]}),o("div",{className:"flex gap-2 items-start",children:[o("div",{className:"flex-1 relative",children:[a(Ve,{ref:q,placeholder:`\u5411 ${g.name} \u53D1\u9001\u6D88\u606F...`,onSend:Fe,onChange:ea,onAtTrigger:Ye,minHeight:"44px",maxHeight:"200px"}),Y&&a("div",{className:"absolute z-50 rounded-lg border bg-popover shadow-md min-w-60 max-h-72 overflow-y-auto p-1",style:{top:`${Y.top}px`,left:`${Y.left}px`},children:Re.length>0?Re.map(e=>o("div",{className:"flex items-center gap-2 p-2 rounded-md cursor-pointer hover:bg-accent transition-colors",onClick:()=>$e(e),children:[a(Z,{size:16,className:"text-muted-foreground"}),o("div",{className:"flex-1",children:[a("div",{className:"text-sm font-medium",children:e.name}),o("div",{className:"text-xs text-muted-foreground",children:["ID: ",e.id]})]})]},e.id)):o("div",{className:"flex flex-col items-center gap-2 p-4",children:[a(j,{size:20,className:"text-muted-foreground/50"}),a("span",{className:"text-xs text-muted-foreground",children:"\u672A\u627E\u5230\u5339\u914D\u7684\u7528\u6237"})]})})]}),o("button",{className:"inline-flex items-center gap-1.5 h-10 px-4 rounded-md bg-primary text-primary-foreground text-sm font-medium disabled:opacity-50 transition-colors hover:bg-primary/90",onClick:()=>{let e=q.current?.getContent();e&&Fe(e.text,e.segments)},disabled:!Be(V),children:[a(le,{size:16})," \u53D1\u9001"]})]}),o("div",{className:"flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[a(de,{size:12})," \u5FEB\u6377\u64CD\u4F5C:",a("span",{className:"px-1 py-0.5 rounded border text-[10px]",children:"Enter"})," \u53D1\u9001",a("span",{className:"px-1 py-0.5 rounded border text-[10px]",children:"Shift+Enter"})," \u6362\u884C",a("span",{className:"px-1 py-0.5 rounded border text-[10px]",children:"[@\u540D\u79F0]"})," @\u67D0\u4EBA",a("span",{className:"px-1 py-0.5 rounded border text-[10px]",children:"[video:URL]"}),a("span",{className:"px-1 py-0.5 rounded border text-[10px]",children:"[audio:URL]"})]})]})]})]})]})}function So(i){i.addRoute({path:"/console/sandbox",name:"\u6C99\u76D2",element:i.React.createElement(Ae,{hostReact:i.React})}),i.addTool({id:"sandbox",name:"\u6C99\u76D2",path:"/console/sandbox"})}export{So as register};
8
8
  /*! Bundled license information:
9
9
 
10
10
  lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs:
package/lib/index.d.ts CHANGED
@@ -18,6 +18,5 @@ export declare class SandboxAdapter extends SandboxWsHostAdapter {
18
18
  start(): Promise<void>;
19
19
  setupWebSocket(router: SandboxRouter): Promise<void>;
20
20
  }
21
- export { registerSandboxWebSocketRoutes, } from "./fetch-ws.js";
22
21
  export { SandboxWsBot, SandboxWsHostAdapter, resolveSandboxBot, bindSandboxWsSocket, parseSandboxWsPayload, type ResolvedSandboxBot, type SandboxWsConfig, type SandboxWsSocket, } from "./sandbox-ws.js";
23
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAe,MAAM,SAAS,CAAC;AAEjD,OAAO,EACL,oBAAoB,EAGrB,MAAM,iBAAiB,CAAC;AAGzB,KAAK,aAAa,GAAG;IACnB,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;CAC1D,CAAC;AAEF,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAU,QAAQ;QAChB,OAAO,EAAE,cAAc,CAAC;KACzB;CACF;AAKD,uBAAuB;AACvB,qBAAa,cAAe,SAAQ,oBAAoB;IACtD,GAAG,CAAC,EAAE;QAAE,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,KAAK,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;gBAE5E,MAAM,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC;IAKjC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ/B,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAsB3D;AAkCD,OAAO,EACL,8BAA8B,GAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAe,MAAM,SAAS,CAAC;AAEjD,OAAO,EACL,oBAAoB,EAGrB,MAAM,iBAAiB,CAAC;AAGzB,KAAK,aAAa,GAAG;IACnB,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;CAC1D,CAAC;AAEF,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAU,QAAQ;QAChB,OAAO,EAAE,cAAc,CAAC;KACzB;CACF;AAKD,uBAAuB;AACvB,qBAAa,cAAe,SAAQ,oBAAoB;IACtD,GAAG,CAAC,EAAE;QAAE,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,KAAK,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;gBAE5E,MAAM,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC;IAKjC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ/B,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAsB3D;AAkCD,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,iBAAiB,CAAC"}
package/lib/index.js CHANGED
@@ -63,6 +63,5 @@ plugin.useContext("web", (pageManager) => {
63
63
  meta: { name: "Sandbox" },
64
64
  });
65
65
  });
66
- export { registerSandboxWebSocketRoutes, } from "./fetch-ws.js";
67
66
  export { SandboxWsBot, SandboxWsHostAdapter, resolveSandboxBot, bindSandboxWsSocket, parseSandboxWsPayload, } from "./sandbox-ws.js";
68
67
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-sandbox",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "description": "Zhin.js adapter for local testing and development",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -42,32 +42,27 @@
42
42
  "type": "git",
43
43
  "directory": "plugins/adapters/sandbox"
44
44
  },
45
+ "dependencies": {
46
+ "lucide-react": "^1.17.0"
47
+ },
45
48
  "devDependencies": {
46
49
  "@types/react": "^19.2.15",
47
50
  "@types/react-dom": "^19.2.3",
48
- "radix-ui": "^1.4.3",
49
- "lucide-react": "^1.17.0",
50
51
  "typescript": "^6.0.3",
51
- "@zhin.js/http-host": "0.1.4",
52
- "@zhin.js/cli": "1.0.82",
53
- "zhin.js": "1.0.86"
52
+ "@zhin.js/cli": "1.0.85"
54
53
  },
55
54
  "peerDependencies": {
56
- "@zhin.js/core": "1.1.28",
57
- "@zhin.js/client": "1.1.4",
58
- "@zhin.js/http-host": "0.1.4",
59
- "@zhin.js/http": "1.0.79",
60
- "zhin.js": "1.0.86",
61
- "@zhin.js/console": "3.0.5"
55
+ "@zhin.js/core": "1.1.30",
56
+ "@zhin.js/client": "2.0.1",
57
+ "@zhin.js/host-router": "0.0.2",
58
+ "@zhin.js/host-api": "0.0.2",
59
+ "@zhin.js/contract": "1.0.0"
62
60
  },
63
61
  "peerDependenciesMeta": {
64
- "@zhin.js/http": {
65
- "optional": true
66
- },
67
- "@zhin.js/http-host": {
62
+ "@zhin.js/host-router": {
68
63
  "optional": true
69
64
  },
70
- "@zhin.js/console": {
65
+ "@zhin.js/host-api": {
71
66
  "optional": true
72
67
  },
73
68
  "@zhin.js/client": {
package/src/index.ts CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  resolveSandboxBot,
7
7
  type SandboxWsSocket,
8
8
  } from "./sandbox-ws.js";
9
- import { PageManager } from "@zhin.js/console";
9
+ import { PageManager } from "@zhin.js/host-api";
10
10
 
11
11
  type SandboxRouter = {
12
12
  ws: (path: string) => NonNullable<SandboxAdapter["wss"]>;
@@ -94,9 +94,6 @@ plugin.useContext("web", (pageManager) => {
94
94
  });
95
95
  });
96
96
 
97
- export {
98
- registerSandboxWebSocketRoutes,
99
- } from "./fetch-ws.js";
100
97
  export {
101
98
  SandboxWsBot,
102
99
  SandboxWsHostAdapter,
package/lib/fetch-ws.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { type RouteTable } from "@zhin.js/http-host";
2
- import type { SandboxWsHostAdapter } from "./sandbox-ws.js";
3
- /**
4
- * 在 {@link RouteTable} 上注册 `/sandbox` WebSocket。
5
- */
6
- export declare function registerSandboxWebSocketRoutes(table: RouteTable, getAdapter: () => SandboxWsHostAdapter): void;
7
- //# sourceMappingURL=fetch-ws.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch-ws.d.ts","sourceRoot":"","sources":["../src/fetch-ws.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAmB,MAAM,iBAAiB,CAAC;AAE7E;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,MAAM,oBAAoB,GACrC,IAAI,CAIN"}
package/lib/fetch-ws.js DELETED
@@ -1,10 +0,0 @@
1
- import { registerWebSocketRoute } from "@zhin.js/http-host";
2
- /**
3
- * 在 {@link RouteTable} 上注册 `/sandbox` WebSocket。
4
- */
5
- export function registerSandboxWebSocketRoutes(table, getAdapter) {
6
- registerWebSocketRoute(table, "/sandbox", (ws) => {
7
- getAdapter().acceptWebSocket(ws);
8
- });
9
- }
10
- //# sourceMappingURL=fetch-ws.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch-ws.js","sourceRoot":"","sources":["../src/fetch-ws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAmB,MAAM,oBAAoB,CAAC;AAG7E;;GAEG;AACH,MAAM,UAAU,8BAA8B,CAC5C,KAAiB,EACjB,UAAsC;IAEtC,sBAAsB,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,EAAW,EAAE,EAAE;QACxD,UAAU,EAAE,CAAC,eAAe,CAAC,EAAqB,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC"}
package/src/fetch-ws.ts DELETED
@@ -1,14 +0,0 @@
1
- import { registerWebSocketRoute, type RouteTable } from "@zhin.js/http-host";
2
- import type { SandboxWsHostAdapter, SandboxWsSocket } from "./sandbox-ws.js";
3
-
4
- /**
5
- * 在 {@link RouteTable} 上注册 `/sandbox` WebSocket。
6
- */
7
- export function registerSandboxWebSocketRoutes(
8
- table: RouteTable,
9
- getAdapter: () => SandboxWsHostAdapter,
10
- ): void {
11
- registerWebSocketRoute(table, "/sandbox", (ws: unknown) => {
12
- getAdapter().acceptWebSocket(ws as SandboxWsSocket);
13
- });
14
- }