@pmate/cli 0.24.34 → 0.24.35
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/dist/index.js +828 -649
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -293,160 +293,150 @@ var init_sessionStore = __esm({
|
|
|
293
293
|
}
|
|
294
294
|
});
|
|
295
295
|
|
|
296
|
-
// node_modules
|
|
296
|
+
// node_modules/@pmate/meta/src/types/account.types.ts
|
|
297
297
|
var init_account_types = __esm({
|
|
298
|
-
"node_modules
|
|
298
|
+
"node_modules/@pmate/meta/src/types/account.types.ts"() {
|
|
299
299
|
"use strict";
|
|
300
300
|
}
|
|
301
301
|
});
|
|
302
302
|
|
|
303
|
-
// node_modules
|
|
303
|
+
// node_modules/@pmate/meta/src/types/achievements.types.ts
|
|
304
304
|
var init_achievements_types = __esm({
|
|
305
|
-
"node_modules
|
|
305
|
+
"node_modules/@pmate/meta/src/types/achievements.types.ts"() {
|
|
306
306
|
"use strict";
|
|
307
307
|
}
|
|
308
308
|
});
|
|
309
309
|
|
|
310
|
-
// node_modules
|
|
310
|
+
// node_modules/@pmate/meta/src/types/aigen.types.ts
|
|
311
311
|
var init_aigen_types = __esm({
|
|
312
|
-
"node_modules
|
|
312
|
+
"node_modules/@pmate/meta/src/types/aigen.types.ts"() {
|
|
313
313
|
"use strict";
|
|
314
314
|
}
|
|
315
315
|
});
|
|
316
316
|
|
|
317
|
-
// node_modules
|
|
317
|
+
// node_modules/@pmate/meta/src/types/agent.types.ts
|
|
318
318
|
var init_agent_types = __esm({
|
|
319
|
-
"node_modules
|
|
319
|
+
"node_modules/@pmate/meta/src/types/agent.types.ts"() {
|
|
320
320
|
"use strict";
|
|
321
321
|
}
|
|
322
322
|
});
|
|
323
323
|
|
|
324
|
-
// node_modules
|
|
324
|
+
// node_modules/@pmate/meta/src/types/agent-registry.types.ts
|
|
325
325
|
var init_agent_registry_types = __esm({
|
|
326
|
-
"node_modules
|
|
326
|
+
"node_modules/@pmate/meta/src/types/agent-registry.types.ts"() {
|
|
327
327
|
"use strict";
|
|
328
328
|
}
|
|
329
329
|
});
|
|
330
330
|
|
|
331
|
-
// node_modules
|
|
332
|
-
var init_runner_registry_types = __esm({
|
|
333
|
-
"node_modules/.pnpm/@pmate+meta@1.1.15/node_modules/@pmate/meta/src/types/runner-registry.types.ts"() {
|
|
334
|
-
"use strict";
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
// node_modules/.pnpm/@pmate+meta@1.1.15/node_modules/@pmate/meta/src/types/blockchain.types.ts
|
|
331
|
+
// node_modules/@pmate/meta/src/types/blockchain.types.ts
|
|
339
332
|
var init_blockchain_types = __esm({
|
|
340
|
-
"node_modules
|
|
333
|
+
"node_modules/@pmate/meta/src/types/blockchain.types.ts"() {
|
|
341
334
|
"use strict";
|
|
342
335
|
}
|
|
343
336
|
});
|
|
344
337
|
|
|
345
|
-
// node_modules
|
|
338
|
+
// node_modules/@pmate/meta/src/types/breakdown.types.ts
|
|
346
339
|
var init_breakdown_types = __esm({
|
|
347
|
-
"node_modules
|
|
340
|
+
"node_modules/@pmate/meta/src/types/breakdown.types.ts"() {
|
|
348
341
|
"use strict";
|
|
349
342
|
}
|
|
350
343
|
});
|
|
351
344
|
|
|
352
|
-
// node_modules
|
|
345
|
+
// node_modules/@pmate/meta/src/types/chat.types.ts
|
|
353
346
|
var init_chat_types = __esm({
|
|
354
|
-
"node_modules
|
|
347
|
+
"node_modules/@pmate/meta/src/types/chat.types.ts"() {
|
|
355
348
|
"use strict";
|
|
356
349
|
}
|
|
357
350
|
});
|
|
358
351
|
|
|
359
|
-
// node_modules
|
|
352
|
+
// node_modules/@pmate/meta/src/types/companion.types.ts
|
|
360
353
|
var init_companion_types = __esm({
|
|
361
|
-
"node_modules
|
|
354
|
+
"node_modules/@pmate/meta/src/types/companion.types.ts"() {
|
|
362
355
|
"use strict";
|
|
363
356
|
}
|
|
364
357
|
});
|
|
365
358
|
|
|
366
|
-
// node_modules
|
|
359
|
+
// node_modules/@pmate/meta/src/types/enums.ts
|
|
367
360
|
var init_enums = __esm({
|
|
368
|
-
"node_modules
|
|
361
|
+
"node_modules/@pmate/meta/src/types/enums.ts"() {
|
|
369
362
|
"use strict";
|
|
370
363
|
}
|
|
371
364
|
});
|
|
372
365
|
|
|
373
|
-
// node_modules
|
|
366
|
+
// node_modules/@pmate/meta/src/types/lang.types.ts
|
|
374
367
|
var init_lang_types = __esm({
|
|
375
|
-
"node_modules
|
|
368
|
+
"node_modules/@pmate/meta/src/types/lang.types.ts"() {
|
|
376
369
|
"use strict";
|
|
377
370
|
}
|
|
378
371
|
});
|
|
379
372
|
|
|
380
|
-
// node_modules
|
|
373
|
+
// node_modules/@pmate/meta/src/types/logs.types.ts
|
|
381
374
|
var init_logs_types = __esm({
|
|
382
|
-
"node_modules
|
|
375
|
+
"node_modules/@pmate/meta/src/types/logs.types.ts"() {
|
|
383
376
|
"use strict";
|
|
384
377
|
}
|
|
385
378
|
});
|
|
386
379
|
|
|
387
|
-
// node_modules
|
|
388
|
-
var PING, PONG;
|
|
380
|
+
// node_modules/@pmate/meta/src/types/message.types.ts
|
|
389
381
|
var init_message_types = __esm({
|
|
390
|
-
"node_modules
|
|
382
|
+
"node_modules/@pmate/meta/src/types/message.types.ts"() {
|
|
391
383
|
"use strict";
|
|
392
|
-
PING = 1;
|
|
393
|
-
PONG = 2;
|
|
394
384
|
}
|
|
395
385
|
});
|
|
396
386
|
|
|
397
|
-
// node_modules
|
|
387
|
+
// node_modules/@pmate/meta/src/types/newLog.types.ts
|
|
398
388
|
var init_newLog_types = __esm({
|
|
399
|
-
"node_modules
|
|
389
|
+
"node_modules/@pmate/meta/src/types/newLog.types.ts"() {
|
|
400
390
|
"use strict";
|
|
401
391
|
}
|
|
402
392
|
});
|
|
403
393
|
|
|
404
|
-
// node_modules
|
|
394
|
+
// node_modules/@pmate/meta/src/types/novel.types.ts
|
|
405
395
|
var init_novel_types = __esm({
|
|
406
|
-
"node_modules
|
|
396
|
+
"node_modules/@pmate/meta/src/types/novel.types.ts"() {
|
|
407
397
|
"use strict";
|
|
408
398
|
}
|
|
409
399
|
});
|
|
410
400
|
|
|
411
|
-
// node_modules
|
|
401
|
+
// node_modules/@pmate/meta/src/types/offline.types.ts
|
|
412
402
|
var init_offline_types = __esm({
|
|
413
|
-
"node_modules
|
|
403
|
+
"node_modules/@pmate/meta/src/types/offline.types.ts"() {
|
|
414
404
|
"use strict";
|
|
415
405
|
}
|
|
416
406
|
});
|
|
417
407
|
|
|
418
|
-
// node_modules
|
|
408
|
+
// node_modules/@pmate/meta/src/types/prompt.types.ts
|
|
419
409
|
var init_prompt_types = __esm({
|
|
420
|
-
"node_modules
|
|
410
|
+
"node_modules/@pmate/meta/src/types/prompt.types.ts"() {
|
|
421
411
|
"use strict";
|
|
422
412
|
}
|
|
423
413
|
});
|
|
424
414
|
|
|
425
|
-
// node_modules
|
|
415
|
+
// node_modules/@pmate/meta/src/types/reading.types.ts
|
|
426
416
|
var init_reading_types = __esm({
|
|
427
|
-
"node_modules
|
|
417
|
+
"node_modules/@pmate/meta/src/types/reading.types.ts"() {
|
|
428
418
|
"use strict";
|
|
429
419
|
}
|
|
430
420
|
});
|
|
431
421
|
|
|
432
|
-
// node_modules
|
|
422
|
+
// node_modules/@pmate/meta/src/types/settings.types.ts
|
|
433
423
|
var init_settings_types = __esm({
|
|
434
|
-
"node_modules
|
|
424
|
+
"node_modules/@pmate/meta/src/types/settings.types.ts"() {
|
|
435
425
|
"use strict";
|
|
436
426
|
}
|
|
437
427
|
});
|
|
438
428
|
|
|
439
|
-
// node_modules
|
|
429
|
+
// node_modules/@pmate/meta/src/types/subscription.types.ts
|
|
440
430
|
var init_subscription_types = __esm({
|
|
441
|
-
"node_modules
|
|
431
|
+
"node_modules/@pmate/meta/src/types/subscription.types.ts"() {
|
|
442
432
|
"use strict";
|
|
443
433
|
}
|
|
444
434
|
});
|
|
445
435
|
|
|
446
|
-
// node_modules
|
|
436
|
+
// node_modules/@pmate/meta/src/types/types.ts
|
|
447
437
|
var buildVoiceKey, createVoice;
|
|
448
438
|
var init_types = __esm({
|
|
449
|
-
"node_modules
|
|
439
|
+
"node_modules/@pmate/meta/src/types/types.ts"() {
|
|
450
440
|
"use strict";
|
|
451
441
|
buildVoiceKey = (provider, name) => {
|
|
452
442
|
return `${provider}:${name}`;
|
|
@@ -468,51 +458,50 @@ var init_types = __esm({
|
|
|
468
458
|
}
|
|
469
459
|
});
|
|
470
460
|
|
|
471
|
-
// node_modules
|
|
461
|
+
// node_modules/@pmate/meta/src/types/wordv5.def.ts
|
|
472
462
|
var init_wordv5_def = __esm({
|
|
473
|
-
"node_modules
|
|
463
|
+
"node_modules/@pmate/meta/src/types/wordv5.def.ts"() {
|
|
474
464
|
"use strict";
|
|
475
465
|
}
|
|
476
466
|
});
|
|
477
467
|
|
|
478
|
-
// node_modules
|
|
468
|
+
// node_modules/@pmate/meta/src/types/auth.types.ts
|
|
479
469
|
var init_auth_types = __esm({
|
|
480
|
-
"node_modules
|
|
470
|
+
"node_modules/@pmate/meta/src/types/auth.types.ts"() {
|
|
481
471
|
"use strict";
|
|
482
472
|
}
|
|
483
473
|
});
|
|
484
474
|
|
|
485
|
-
// node_modules
|
|
475
|
+
// node_modules/@pmate/meta/src/types/apps.types.ts
|
|
486
476
|
var init_apps_types = __esm({
|
|
487
|
-
"node_modules
|
|
477
|
+
"node_modules/@pmate/meta/src/types/apps.types.ts"() {
|
|
488
478
|
"use strict";
|
|
489
479
|
}
|
|
490
480
|
});
|
|
491
481
|
|
|
492
|
-
// node_modules
|
|
482
|
+
// node_modules/@pmate/meta/src/types/response.types.ts
|
|
493
483
|
var init_response_types = __esm({
|
|
494
|
-
"node_modules
|
|
484
|
+
"node_modules/@pmate/meta/src/types/response.types.ts"() {
|
|
495
485
|
"use strict";
|
|
496
486
|
}
|
|
497
487
|
});
|
|
498
488
|
|
|
499
|
-
// node_modules
|
|
489
|
+
// node_modules/@pmate/meta/src/types/role.types.ts
|
|
500
490
|
var init_role_types = __esm({
|
|
501
|
-
"node_modules
|
|
491
|
+
"node_modules/@pmate/meta/src/types/role.types.ts"() {
|
|
502
492
|
"use strict";
|
|
503
493
|
}
|
|
504
494
|
});
|
|
505
495
|
|
|
506
|
-
// node_modules
|
|
496
|
+
// node_modules/@pmate/meta/src/types/index.ts
|
|
507
497
|
var init_types2 = __esm({
|
|
508
|
-
"node_modules
|
|
498
|
+
"node_modules/@pmate/meta/src/types/index.ts"() {
|
|
509
499
|
"use strict";
|
|
510
500
|
init_account_types();
|
|
511
501
|
init_achievements_types();
|
|
512
502
|
init_aigen_types();
|
|
513
503
|
init_agent_types();
|
|
514
504
|
init_agent_registry_types();
|
|
515
|
-
init_runner_registry_types();
|
|
516
505
|
init_blockchain_types();
|
|
517
506
|
init_breakdown_types();
|
|
518
507
|
init_chat_types();
|
|
@@ -537,24 +526,24 @@ var init_types2 = __esm({
|
|
|
537
526
|
}
|
|
538
527
|
});
|
|
539
528
|
|
|
540
|
-
// node_modules
|
|
529
|
+
// node_modules/@pmate/meta/src/config/BizErrorCode.ts
|
|
541
530
|
var init_BizErrorCode = __esm({
|
|
542
|
-
"node_modules
|
|
531
|
+
"node_modules/@pmate/meta/src/config/BizErrorCode.ts"() {
|
|
543
532
|
"use strict";
|
|
544
533
|
}
|
|
545
534
|
});
|
|
546
535
|
|
|
547
|
-
// node_modules
|
|
536
|
+
// node_modules/@pmate/meta/src/config/consts.ts
|
|
548
537
|
var init_consts = __esm({
|
|
549
|
-
"node_modules
|
|
538
|
+
"node_modules/@pmate/meta/src/config/consts.ts"() {
|
|
550
539
|
"use strict";
|
|
551
540
|
}
|
|
552
541
|
});
|
|
553
542
|
|
|
554
|
-
// node_modules
|
|
543
|
+
// node_modules/@pmate/meta/src/config/TopicNames.ts
|
|
555
544
|
var TopicNames, topicKindMatchers;
|
|
556
545
|
var init_TopicNames = __esm({
|
|
557
|
-
"node_modules
|
|
546
|
+
"node_modules/@pmate/meta/src/config/TopicNames.ts"() {
|
|
558
547
|
"use strict";
|
|
559
548
|
init_types2();
|
|
560
549
|
TopicNames = class _TopicNames {
|
|
@@ -640,18 +629,18 @@ var init_TopicNames = __esm({
|
|
|
640
629
|
}
|
|
641
630
|
});
|
|
642
631
|
|
|
643
|
-
// node_modules
|
|
632
|
+
// node_modules/@pmate/meta/src/config/OSSKeys.ts
|
|
644
633
|
var init_OSSKeys = __esm({
|
|
645
|
-
"node_modules
|
|
634
|
+
"node_modules/@pmate/meta/src/config/OSSKeys.ts"() {
|
|
646
635
|
"use strict";
|
|
647
636
|
init_consts();
|
|
648
637
|
}
|
|
649
638
|
});
|
|
650
639
|
|
|
651
|
-
// node_modules
|
|
640
|
+
// node_modules/@pmate/meta/src/config/CompanionProfiles.ts
|
|
652
641
|
var openAICoral, openAIAsh, openAIBallad, openAINova, openAIVerse;
|
|
653
642
|
var init_CompanionProfiles = __esm({
|
|
654
|
-
"node_modules
|
|
643
|
+
"node_modules/@pmate/meta/src/config/CompanionProfiles.ts"() {
|
|
655
644
|
"use strict";
|
|
656
645
|
init_types2();
|
|
657
646
|
openAICoral = createVoice({
|
|
@@ -686,9 +675,9 @@ var init_CompanionProfiles = __esm({
|
|
|
686
675
|
}
|
|
687
676
|
});
|
|
688
677
|
|
|
689
|
-
// node_modules
|
|
678
|
+
// node_modules/@pmate/meta/src/config/index.ts
|
|
690
679
|
var init_config = __esm({
|
|
691
|
-
"node_modules
|
|
680
|
+
"node_modules/@pmate/meta/src/config/index.ts"() {
|
|
692
681
|
"use strict";
|
|
693
682
|
init_BizErrorCode();
|
|
694
683
|
init_consts();
|
|
@@ -698,83 +687,83 @@ var init_config = __esm({
|
|
|
698
687
|
}
|
|
699
688
|
});
|
|
700
689
|
|
|
701
|
-
// node_modules
|
|
690
|
+
// node_modules/@pmate/meta/src/index.ts
|
|
702
691
|
var init_src = __esm({
|
|
703
|
-
"node_modules
|
|
692
|
+
"node_modules/@pmate/meta/src/index.ts"() {
|
|
704
693
|
"use strict";
|
|
705
694
|
init_types2();
|
|
706
695
|
init_config();
|
|
707
696
|
}
|
|
708
697
|
});
|
|
709
698
|
|
|
710
|
-
// node_modules
|
|
699
|
+
// node_modules/@pmate/utils/src/base64.ts
|
|
711
700
|
var init_base64 = __esm({
|
|
712
|
-
"node_modules
|
|
701
|
+
"node_modules/@pmate/utils/src/base64.ts"() {
|
|
713
702
|
"use strict";
|
|
714
703
|
}
|
|
715
704
|
});
|
|
716
705
|
|
|
717
|
-
// node_modules
|
|
706
|
+
// node_modules/@pmate/utils/src/Cache.ts
|
|
718
707
|
var init_Cache = __esm({
|
|
719
|
-
"node_modules
|
|
708
|
+
"node_modules/@pmate/utils/src/Cache.ts"() {
|
|
720
709
|
"use strict";
|
|
721
710
|
}
|
|
722
711
|
});
|
|
723
712
|
|
|
724
|
-
// node_modules
|
|
713
|
+
// node_modules/@pmate/utils/src/batchResolve.ts
|
|
725
714
|
var init_batchResolve = __esm({
|
|
726
|
-
"node_modules
|
|
715
|
+
"node_modules/@pmate/utils/src/batchResolve.ts"() {
|
|
727
716
|
"use strict";
|
|
728
717
|
init_Cache();
|
|
729
718
|
}
|
|
730
719
|
});
|
|
731
720
|
|
|
732
|
-
// node_modules
|
|
721
|
+
// node_modules/@pmate/lang/src/cn/sentenceSpliter.ts
|
|
733
722
|
var init_sentenceSpliter = __esm({
|
|
734
|
-
"node_modules
|
|
723
|
+
"node_modules/@pmate/lang/src/cn/sentenceSpliter.ts"() {
|
|
735
724
|
"use strict";
|
|
736
725
|
}
|
|
737
726
|
});
|
|
738
727
|
|
|
739
|
-
// node_modules
|
|
728
|
+
// node_modules/@pmate/lang/src/cn/sentenceTrim.ts
|
|
740
729
|
var init_sentenceTrim = __esm({
|
|
741
|
-
"node_modules
|
|
730
|
+
"node_modules/@pmate/lang/src/cn/sentenceTrim.ts"() {
|
|
742
731
|
"use strict";
|
|
743
732
|
}
|
|
744
733
|
});
|
|
745
734
|
|
|
746
|
-
// node_modules
|
|
735
|
+
// node_modules/@pmate/lang/src/cn/wordSpliter.ts
|
|
747
736
|
var init_wordSpliter = __esm({
|
|
748
|
-
"node_modules
|
|
737
|
+
"node_modules/@pmate/lang/src/cn/wordSpliter.ts"() {
|
|
749
738
|
"use strict";
|
|
750
739
|
}
|
|
751
740
|
});
|
|
752
741
|
|
|
753
|
-
// node_modules
|
|
742
|
+
// node_modules/@pmate/lang/src/en/regex.ts
|
|
754
743
|
var init_regex = __esm({
|
|
755
|
-
"node_modules
|
|
744
|
+
"node_modules/@pmate/lang/src/en/regex.ts"() {
|
|
756
745
|
"use strict";
|
|
757
746
|
}
|
|
758
747
|
});
|
|
759
748
|
|
|
760
|
-
// node_modules
|
|
749
|
+
// node_modules/@pmate/lang/src/en/sentenceSpliter.ts
|
|
761
750
|
var init_sentenceSpliter2 = __esm({
|
|
762
|
-
"node_modules
|
|
751
|
+
"node_modules/@pmate/lang/src/en/sentenceSpliter.ts"() {
|
|
763
752
|
"use strict";
|
|
764
753
|
}
|
|
765
754
|
});
|
|
766
755
|
|
|
767
|
-
// node_modules
|
|
756
|
+
// node_modules/@pmate/lang/src/en/sentenceTrim.ts
|
|
768
757
|
var init_sentenceTrim2 = __esm({
|
|
769
|
-
"node_modules
|
|
758
|
+
"node_modules/@pmate/lang/src/en/sentenceTrim.ts"() {
|
|
770
759
|
"use strict";
|
|
771
760
|
}
|
|
772
761
|
});
|
|
773
762
|
|
|
774
|
-
// node_modules
|
|
763
|
+
// node_modules/@pmate/lang/src/en/wordSpliter.ts
|
|
775
764
|
var regex;
|
|
776
765
|
var init_wordSpliter2 = __esm({
|
|
777
|
-
"node_modules
|
|
766
|
+
"node_modules/@pmate/lang/src/en/wordSpliter.ts"() {
|
|
778
767
|
"use strict";
|
|
779
768
|
regex = new RegExp(
|
|
780
769
|
[
|
|
@@ -810,23 +799,23 @@ var init_wordSpliter2 = __esm({
|
|
|
810
799
|
}
|
|
811
800
|
});
|
|
812
801
|
|
|
813
|
-
// node_modules
|
|
802
|
+
// node_modules/@pmate/lang/src/kr/sentenceSpliter.ts
|
|
814
803
|
var init_sentenceSpliter3 = __esm({
|
|
815
|
-
"node_modules
|
|
804
|
+
"node_modules/@pmate/lang/src/kr/sentenceSpliter.ts"() {
|
|
816
805
|
"use strict";
|
|
817
806
|
}
|
|
818
807
|
});
|
|
819
808
|
|
|
820
|
-
// node_modules
|
|
809
|
+
// node_modules/@pmate/lang/src/kr/wordSpliter.ts
|
|
821
810
|
var init_wordSpliter3 = __esm({
|
|
822
|
-
"node_modules
|
|
811
|
+
"node_modules/@pmate/lang/src/kr/wordSpliter.ts"() {
|
|
823
812
|
"use strict";
|
|
824
813
|
}
|
|
825
814
|
});
|
|
826
815
|
|
|
827
|
-
// node_modules
|
|
816
|
+
// node_modules/@pmate/lang/src/readingSettings.ts
|
|
828
817
|
var init_readingSettings = __esm({
|
|
829
|
-
"node_modules
|
|
818
|
+
"node_modules/@pmate/lang/src/readingSettings.ts"() {
|
|
830
819
|
"use strict";
|
|
831
820
|
init_sentenceSpliter();
|
|
832
821
|
init_wordSpliter();
|
|
@@ -837,17 +826,17 @@ var init_readingSettings = __esm({
|
|
|
837
826
|
}
|
|
838
827
|
});
|
|
839
828
|
|
|
840
|
-
// node_modules
|
|
829
|
+
// node_modules/@pmate/lang/src/utils.ts
|
|
841
830
|
var init_utils = __esm({
|
|
842
|
-
"node_modules
|
|
831
|
+
"node_modules/@pmate/lang/src/utils.ts"() {
|
|
843
832
|
"use strict";
|
|
844
833
|
init_src();
|
|
845
834
|
}
|
|
846
835
|
});
|
|
847
836
|
|
|
848
|
-
// node_modules
|
|
837
|
+
// node_modules/@pmate/lang/src/index.ts
|
|
849
838
|
var init_src2 = __esm({
|
|
850
|
-
"node_modules
|
|
839
|
+
"node_modules/@pmate/lang/src/index.ts"() {
|
|
851
840
|
"use strict";
|
|
852
841
|
init_sentenceSpliter();
|
|
853
842
|
init_sentenceTrim();
|
|
@@ -863,32 +852,32 @@ var init_src2 = __esm({
|
|
|
863
852
|
}
|
|
864
853
|
});
|
|
865
854
|
|
|
866
|
-
// node_modules
|
|
855
|
+
// node_modules/@pmate/utils/src/bookStats.ts
|
|
867
856
|
var init_bookStats = __esm({
|
|
868
|
-
"node_modules
|
|
857
|
+
"node_modules/@pmate/utils/src/bookStats.ts"() {
|
|
869
858
|
"use strict";
|
|
870
859
|
init_src2();
|
|
871
860
|
}
|
|
872
861
|
});
|
|
873
862
|
|
|
874
|
-
// node_modules
|
|
863
|
+
// node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts
|
|
875
864
|
var init_BoundedConcurrentQueue = __esm({
|
|
876
|
-
"node_modules
|
|
865
|
+
"node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts"() {
|
|
877
866
|
"use strict";
|
|
878
867
|
}
|
|
879
868
|
});
|
|
880
869
|
|
|
881
|
-
// node_modules
|
|
870
|
+
// node_modules/@pmate/utils/src/lru.ts
|
|
882
871
|
var init_lru = __esm({
|
|
883
|
-
"node_modules
|
|
872
|
+
"node_modules/@pmate/utils/src/lru.ts"() {
|
|
884
873
|
"use strict";
|
|
885
874
|
init_Cache();
|
|
886
875
|
}
|
|
887
876
|
});
|
|
888
877
|
|
|
889
|
-
// node_modules
|
|
878
|
+
// node_modules/js-sha3/src/sha3.js
|
|
890
879
|
var require_sha3 = __commonJS({
|
|
891
|
-
"node_modules
|
|
880
|
+
"node_modules/js-sha3/src/sha3.js"(exports2, module2) {
|
|
892
881
|
"use strict";
|
|
893
882
|
(function() {
|
|
894
883
|
"use strict";
|
|
@@ -1533,24 +1522,24 @@ var require_sha3 = __commonJS({
|
|
|
1533
1522
|
}
|
|
1534
1523
|
});
|
|
1535
1524
|
|
|
1536
|
-
// node_modules
|
|
1525
|
+
// node_modules/@pmate/utils/src/Maybe.ts
|
|
1537
1526
|
var init_Maybe = __esm({
|
|
1538
|
-
"node_modules
|
|
1527
|
+
"node_modules/@pmate/utils/src/Maybe.ts"() {
|
|
1539
1528
|
"use strict";
|
|
1540
1529
|
}
|
|
1541
1530
|
});
|
|
1542
1531
|
|
|
1543
|
-
// node_modules
|
|
1532
|
+
// node_modules/@pmate/utils/src/cacheMethodInMem.ts
|
|
1544
1533
|
var import_js_sha3;
|
|
1545
1534
|
var init_cacheMethodInMem = __esm({
|
|
1546
|
-
"node_modules
|
|
1535
|
+
"node_modules/@pmate/utils/src/cacheMethodInMem.ts"() {
|
|
1547
1536
|
"use strict";
|
|
1548
1537
|
import_js_sha3 = __toESM(require_sha3(), 1);
|
|
1549
1538
|
init_Maybe();
|
|
1550
1539
|
}
|
|
1551
1540
|
});
|
|
1552
1541
|
|
|
1553
|
-
// node_modules
|
|
1542
|
+
// node_modules/pako/dist/pako.esm.mjs
|
|
1554
1543
|
function zero$1(buf) {
|
|
1555
1544
|
let len = buf.length;
|
|
1556
1545
|
while (--len >= 0) {
|
|
@@ -1838,7 +1827,7 @@ function inflateRaw$1(input, options) {
|
|
|
1838
1827
|
}
|
|
1839
1828
|
var Z_FIXED$1, Z_BINARY, Z_TEXT, Z_UNKNOWN$1, STORED_BLOCK, STATIC_TREES, DYN_TREES, MIN_MATCH$1, MAX_MATCH$1, LENGTH_CODES$1, LITERALS$1, L_CODES$1, D_CODES$1, BL_CODES$1, HEAP_SIZE$1, MAX_BITS$1, Buf_size, MAX_BL_BITS, END_BLOCK, REP_3_6, REPZ_3_10, REPZ_11_138, extra_lbits, extra_dbits, extra_blbits, bl_order, DIST_CODE_LEN, static_ltree, static_dtree, _dist_code, _length_code, base_length, base_dist, static_l_desc, static_d_desc, static_bl_desc, d_code, put_short, send_bits, send_code, bi_reverse, bi_flush, gen_bitlen, gen_codes, tr_static_init, init_block, bi_windup, smaller, pqdownheap, compress_block, build_tree, scan_tree, send_tree, build_bl_tree, send_all_trees, detect_data_type, static_init_done, _tr_init$1, _tr_stored_block$1, _tr_align$1, _tr_flush_block$1, _tr_tally$1, _tr_init_1, _tr_stored_block_1, _tr_flush_block_1, _tr_tally_1, _tr_align_1, trees, adler32, adler32_1, makeTable, crcTable, crc32, crc32_1, messages, constants$2, _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align, Z_NO_FLUSH$2, Z_PARTIAL_FLUSH, Z_FULL_FLUSH$1, Z_FINISH$3, Z_BLOCK$1, Z_OK$3, Z_STREAM_END$3, Z_STREAM_ERROR$2, Z_DATA_ERROR$2, Z_BUF_ERROR$1, Z_DEFAULT_COMPRESSION$1, Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY$1, Z_UNKNOWN, Z_DEFLATED$2, MAX_MEM_LEVEL, MAX_WBITS$1, DEF_MEM_LEVEL, LENGTH_CODES, LITERALS, L_CODES, D_CODES, BL_CODES, HEAP_SIZE, MAX_BITS, MIN_MATCH, MAX_MATCH, MIN_LOOKAHEAD, PRESET_DICT, INIT_STATE, GZIP_STATE, EXTRA_STATE, NAME_STATE, COMMENT_STATE, HCRC_STATE, BUSY_STATE, FINISH_STATE, BS_NEED_MORE, BS_BLOCK_DONE, BS_FINISH_STARTED, BS_FINISH_DONE, OS_CODE, err, rank, zero, slide_hash, HASH_ZLIB, HASH, flush_pending, flush_block_only, put_byte, putShortMSB, read_buf, longest_match, fill_window, deflate_stored, deflate_fast, deflate_slow, deflate_rle, deflate_huff, configuration_table, lm_init, deflateStateCheck, deflateResetKeep, deflateReset, deflateSetHeader, deflateInit2, deflateInit, deflate$2, deflateEnd, deflateSetDictionary, deflateInit_1, deflateInit2_1, deflateReset_1, deflateResetKeep_1, deflateSetHeader_1, deflate_2$1, deflateEnd_1, deflateSetDictionary_1, deflateInfo, deflate_1$2, _has, assign, flattenChunks, common, STR_APPLY_UIA_OK, _utf8len, string2buf, buf2binstring, buf2string, utf8border, strings, zstream, toString$1, Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH$2, Z_OK$2, Z_STREAM_END$2, Z_DEFAULT_COMPRESSION, Z_DEFAULT_STRATEGY, Z_DEFLATED$1, Deflate_1$1, deflate_2, deflateRaw_1$1, gzip_1$1, constants$1, deflate_1$1, BAD$1, TYPE$1, inffast, MAXBITS, ENOUGH_LENS$1, ENOUGH_DISTS$1, CODES$1, LENS$1, DISTS$1, lbase, lext, dbase, dext, inflate_table, inftrees, CODES, LENS, DISTS, Z_FINISH$1, Z_BLOCK, Z_TREES, Z_OK$1, Z_STREAM_END$1, Z_NEED_DICT$1, Z_STREAM_ERROR$1, Z_DATA_ERROR$1, Z_MEM_ERROR$1, Z_BUF_ERROR, Z_DEFLATED, HEAD, FLAGS, TIME, OS, EXLEN, EXTRA, NAME, COMMENT, HCRC, DICTID, DICT, TYPE, TYPEDO, STORED, COPY_, COPY, TABLE, LENLENS, CODELENS, LEN_, LEN, LENEXT, DIST, DISTEXT, MATCH, LIT, CHECK, LENGTH, DONE, BAD, MEM, SYNC, ENOUGH_LENS, ENOUGH_DISTS, MAX_WBITS, DEF_WBITS, zswap32, inflateStateCheck, inflateResetKeep, inflateReset, inflateReset2, inflateInit2, inflateInit, virgin, lenfix, distfix, fixedtables, updatewindow, inflate$2, inflateEnd, inflateGetHeader, inflateSetDictionary, inflateReset_1, inflateReset2_1, inflateResetKeep_1, inflateInit_1, inflateInit2_1, inflate_2$1, inflateEnd_1, inflateGetHeader_1, inflateSetDictionary_1, inflateInfo, inflate_1$2, gzheader, toString, Z_NO_FLUSH, Z_FINISH, Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Inflate_1$1, inflate_2, inflateRaw_1$1, ungzip$1, constants, inflate_1$1, Deflate, deflate, deflateRaw, gzip, Inflate, inflate, inflateRaw, ungzip, gzip_1;
|
|
1840
1829
|
var init_pako_esm = __esm({
|
|
1841
|
-
"node_modules
|
|
1830
|
+
"node_modules/pako/dist/pako.esm.mjs"() {
|
|
1842
1831
|
"use strict";
|
|
1843
1832
|
Z_FIXED$1 = 4;
|
|
1844
1833
|
Z_BINARY = 0;
|
|
@@ -5719,7 +5708,7 @@ var init_pako_esm = __esm({
|
|
|
5719
5708
|
}
|
|
5720
5709
|
});
|
|
5721
5710
|
|
|
5722
|
-
// node_modules
|
|
5711
|
+
// node_modules/@pmate/utils/src/compress.ts
|
|
5723
5712
|
async function gzipEncodeBlob(input) {
|
|
5724
5713
|
const array = await toUint8Array(input);
|
|
5725
5714
|
return gzip_1(array);
|
|
@@ -5745,16 +5734,16 @@ async function toUint8Array(input) {
|
|
|
5745
5734
|
throw new TypeError("Unsupported input type for gzipEncodeBlob");
|
|
5746
5735
|
}
|
|
5747
5736
|
var init_compress = __esm({
|
|
5748
|
-
"node_modules
|
|
5737
|
+
"node_modules/@pmate/utils/src/compress.ts"() {
|
|
5749
5738
|
"use strict";
|
|
5750
5739
|
init_pako_esm();
|
|
5751
5740
|
}
|
|
5752
5741
|
});
|
|
5753
5742
|
|
|
5754
|
-
// node_modules
|
|
5743
|
+
// node_modules/@pmate/utils/src/AsyncStream.ts
|
|
5755
5744
|
var AsyncStream;
|
|
5756
5745
|
var init_AsyncStream = __esm({
|
|
5757
|
-
"node_modules
|
|
5746
|
+
"node_modules/@pmate/utils/src/AsyncStream.ts"() {
|
|
5758
5747
|
"use strict";
|
|
5759
5748
|
AsyncStream = class _AsyncStream {
|
|
5760
5749
|
constructor() {
|
|
@@ -5942,12 +5931,418 @@ var init_AsyncStream = __esm({
|
|
|
5942
5931
|
}
|
|
5943
5932
|
});
|
|
5944
5933
|
|
|
5945
|
-
// node_modules
|
|
5934
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/account.types.ts
|
|
5935
|
+
var init_account_types2 = __esm({
|
|
5936
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/account.types.ts"() {
|
|
5937
|
+
"use strict";
|
|
5938
|
+
}
|
|
5939
|
+
});
|
|
5940
|
+
|
|
5941
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/achievements.types.ts
|
|
5942
|
+
var init_achievements_types2 = __esm({
|
|
5943
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/achievements.types.ts"() {
|
|
5944
|
+
"use strict";
|
|
5945
|
+
}
|
|
5946
|
+
});
|
|
5947
|
+
|
|
5948
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/aigen.types.ts
|
|
5949
|
+
var init_aigen_types2 = __esm({
|
|
5950
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/aigen.types.ts"() {
|
|
5951
|
+
"use strict";
|
|
5952
|
+
}
|
|
5953
|
+
});
|
|
5954
|
+
|
|
5955
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/agent.types.ts
|
|
5956
|
+
var init_agent_types2 = __esm({
|
|
5957
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/agent.types.ts"() {
|
|
5958
|
+
"use strict";
|
|
5959
|
+
}
|
|
5960
|
+
});
|
|
5961
|
+
|
|
5962
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/agent-registry.types.ts
|
|
5963
|
+
var init_agent_registry_types2 = __esm({
|
|
5964
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/agent-registry.types.ts"() {
|
|
5965
|
+
"use strict";
|
|
5966
|
+
}
|
|
5967
|
+
});
|
|
5968
|
+
|
|
5969
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/blockchain.types.ts
|
|
5970
|
+
var init_blockchain_types2 = __esm({
|
|
5971
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/blockchain.types.ts"() {
|
|
5972
|
+
"use strict";
|
|
5973
|
+
}
|
|
5974
|
+
});
|
|
5975
|
+
|
|
5976
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/breakdown.types.ts
|
|
5977
|
+
var init_breakdown_types2 = __esm({
|
|
5978
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/breakdown.types.ts"() {
|
|
5979
|
+
"use strict";
|
|
5980
|
+
}
|
|
5981
|
+
});
|
|
5982
|
+
|
|
5983
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/chat.types.ts
|
|
5984
|
+
var init_chat_types2 = __esm({
|
|
5985
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/chat.types.ts"() {
|
|
5986
|
+
"use strict";
|
|
5987
|
+
}
|
|
5988
|
+
});
|
|
5989
|
+
|
|
5990
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/companion.types.ts
|
|
5991
|
+
var init_companion_types2 = __esm({
|
|
5992
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/companion.types.ts"() {
|
|
5993
|
+
"use strict";
|
|
5994
|
+
}
|
|
5995
|
+
});
|
|
5996
|
+
|
|
5997
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/enums.ts
|
|
5998
|
+
var init_enums2 = __esm({
|
|
5999
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/enums.ts"() {
|
|
6000
|
+
"use strict";
|
|
6001
|
+
}
|
|
6002
|
+
});
|
|
6003
|
+
|
|
6004
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/lang.types.ts
|
|
6005
|
+
var init_lang_types2 = __esm({
|
|
6006
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/lang.types.ts"() {
|
|
6007
|
+
"use strict";
|
|
6008
|
+
}
|
|
6009
|
+
});
|
|
6010
|
+
|
|
6011
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/logs.types.ts
|
|
6012
|
+
var init_logs_types2 = __esm({
|
|
6013
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/logs.types.ts"() {
|
|
6014
|
+
"use strict";
|
|
6015
|
+
}
|
|
6016
|
+
});
|
|
6017
|
+
|
|
6018
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/message.types.ts
|
|
6019
|
+
var PING, PONG;
|
|
6020
|
+
var init_message_types2 = __esm({
|
|
6021
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/message.types.ts"() {
|
|
6022
|
+
"use strict";
|
|
6023
|
+
PING = 1;
|
|
6024
|
+
PONG = 2;
|
|
6025
|
+
}
|
|
6026
|
+
});
|
|
6027
|
+
|
|
6028
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/newLog.types.ts
|
|
6029
|
+
var init_newLog_types2 = __esm({
|
|
6030
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/newLog.types.ts"() {
|
|
6031
|
+
"use strict";
|
|
6032
|
+
}
|
|
6033
|
+
});
|
|
6034
|
+
|
|
6035
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/novel.types.ts
|
|
6036
|
+
var init_novel_types2 = __esm({
|
|
6037
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/novel.types.ts"() {
|
|
6038
|
+
"use strict";
|
|
6039
|
+
}
|
|
6040
|
+
});
|
|
6041
|
+
|
|
6042
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/offline.types.ts
|
|
6043
|
+
var init_offline_types2 = __esm({
|
|
6044
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/offline.types.ts"() {
|
|
6045
|
+
"use strict";
|
|
6046
|
+
}
|
|
6047
|
+
});
|
|
6048
|
+
|
|
6049
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/prompt.types.ts
|
|
6050
|
+
var init_prompt_types2 = __esm({
|
|
6051
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/prompt.types.ts"() {
|
|
6052
|
+
"use strict";
|
|
6053
|
+
}
|
|
6054
|
+
});
|
|
6055
|
+
|
|
6056
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/reading.types.ts
|
|
6057
|
+
var init_reading_types2 = __esm({
|
|
6058
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/reading.types.ts"() {
|
|
6059
|
+
"use strict";
|
|
6060
|
+
}
|
|
6061
|
+
});
|
|
6062
|
+
|
|
6063
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/settings.types.ts
|
|
6064
|
+
var init_settings_types2 = __esm({
|
|
6065
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/settings.types.ts"() {
|
|
6066
|
+
"use strict";
|
|
6067
|
+
}
|
|
6068
|
+
});
|
|
6069
|
+
|
|
6070
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/subscription.types.ts
|
|
6071
|
+
var init_subscription_types2 = __esm({
|
|
6072
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/subscription.types.ts"() {
|
|
6073
|
+
"use strict";
|
|
6074
|
+
}
|
|
6075
|
+
});
|
|
6076
|
+
|
|
6077
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/types.ts
|
|
6078
|
+
var buildVoiceKey2, createVoice2;
|
|
6079
|
+
var init_types3 = __esm({
|
|
6080
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/types.ts"() {
|
|
6081
|
+
"use strict";
|
|
6082
|
+
buildVoiceKey2 = (provider, name) => {
|
|
6083
|
+
return `${provider}:${name}`;
|
|
6084
|
+
};
|
|
6085
|
+
createVoice2 = ({
|
|
6086
|
+
name,
|
|
6087
|
+
provider,
|
|
6088
|
+
gender,
|
|
6089
|
+
instructions
|
|
6090
|
+
}) => {
|
|
6091
|
+
return {
|
|
6092
|
+
name,
|
|
6093
|
+
provider,
|
|
6094
|
+
gender,
|
|
6095
|
+
instructions,
|
|
6096
|
+
key: buildVoiceKey2(provider, name)
|
|
6097
|
+
};
|
|
6098
|
+
};
|
|
6099
|
+
}
|
|
6100
|
+
});
|
|
6101
|
+
|
|
6102
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/wordv5.def.ts
|
|
6103
|
+
var init_wordv5_def2 = __esm({
|
|
6104
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/wordv5.def.ts"() {
|
|
6105
|
+
"use strict";
|
|
6106
|
+
}
|
|
6107
|
+
});
|
|
6108
|
+
|
|
6109
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/auth.types.ts
|
|
6110
|
+
var init_auth_types2 = __esm({
|
|
6111
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/auth.types.ts"() {
|
|
6112
|
+
"use strict";
|
|
6113
|
+
}
|
|
6114
|
+
});
|
|
6115
|
+
|
|
6116
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/apps.types.ts
|
|
6117
|
+
var init_apps_types2 = __esm({
|
|
6118
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/apps.types.ts"() {
|
|
6119
|
+
"use strict";
|
|
6120
|
+
}
|
|
6121
|
+
});
|
|
6122
|
+
|
|
6123
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/response.types.ts
|
|
6124
|
+
var init_response_types2 = __esm({
|
|
6125
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/response.types.ts"() {
|
|
6126
|
+
"use strict";
|
|
6127
|
+
}
|
|
6128
|
+
});
|
|
6129
|
+
|
|
6130
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/role.types.ts
|
|
6131
|
+
var init_role_types2 = __esm({
|
|
6132
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/role.types.ts"() {
|
|
6133
|
+
"use strict";
|
|
6134
|
+
}
|
|
6135
|
+
});
|
|
6136
|
+
|
|
6137
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/index.ts
|
|
6138
|
+
var init_types4 = __esm({
|
|
6139
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/index.ts"() {
|
|
6140
|
+
"use strict";
|
|
6141
|
+
init_account_types2();
|
|
6142
|
+
init_achievements_types2();
|
|
6143
|
+
init_aigen_types2();
|
|
6144
|
+
init_agent_types2();
|
|
6145
|
+
init_agent_registry_types2();
|
|
6146
|
+
init_blockchain_types2();
|
|
6147
|
+
init_breakdown_types2();
|
|
6148
|
+
init_chat_types2();
|
|
6149
|
+
init_companion_types2();
|
|
6150
|
+
init_enums2();
|
|
6151
|
+
init_lang_types2();
|
|
6152
|
+
init_logs_types2();
|
|
6153
|
+
init_message_types2();
|
|
6154
|
+
init_newLog_types2();
|
|
6155
|
+
init_novel_types2();
|
|
6156
|
+
init_offline_types2();
|
|
6157
|
+
init_prompt_types2();
|
|
6158
|
+
init_reading_types2();
|
|
6159
|
+
init_settings_types2();
|
|
6160
|
+
init_subscription_types2();
|
|
6161
|
+
init_types3();
|
|
6162
|
+
init_wordv5_def2();
|
|
6163
|
+
init_auth_types2();
|
|
6164
|
+
init_apps_types2();
|
|
6165
|
+
init_response_types2();
|
|
6166
|
+
init_role_types2();
|
|
6167
|
+
}
|
|
6168
|
+
});
|
|
6169
|
+
|
|
6170
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/BizErrorCode.ts
|
|
6171
|
+
var init_BizErrorCode2 = __esm({
|
|
6172
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/BizErrorCode.ts"() {
|
|
6173
|
+
"use strict";
|
|
6174
|
+
}
|
|
6175
|
+
});
|
|
6176
|
+
|
|
6177
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/consts.ts
|
|
6178
|
+
var init_consts2 = __esm({
|
|
6179
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/consts.ts"() {
|
|
6180
|
+
"use strict";
|
|
6181
|
+
}
|
|
6182
|
+
});
|
|
6183
|
+
|
|
6184
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/TopicNames.ts
|
|
6185
|
+
var TopicNames2, topicKindMatchers2;
|
|
6186
|
+
var init_TopicNames2 = __esm({
|
|
6187
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/TopicNames.ts"() {
|
|
6188
|
+
"use strict";
|
|
6189
|
+
init_types4();
|
|
6190
|
+
TopicNames2 = class _TopicNames {
|
|
6191
|
+
static rooms() {
|
|
6192
|
+
return "@pmate/rooms";
|
|
6193
|
+
}
|
|
6194
|
+
static userThreads(user) {
|
|
6195
|
+
return `@pmate/user_threads:${user}`;
|
|
6196
|
+
}
|
|
6197
|
+
static userLogs(user) {
|
|
6198
|
+
return `@pmate/user_logs:${user}`;
|
|
6199
|
+
}
|
|
6200
|
+
static legacyUserLogs(user) {
|
|
6201
|
+
return _TopicNames.userLogs(user);
|
|
6202
|
+
}
|
|
6203
|
+
static userContacts(profileId) {
|
|
6204
|
+
return `@pmate/user_contacts:${profileId}`;
|
|
6205
|
+
}
|
|
6206
|
+
static usersMessage(userId) {
|
|
6207
|
+
return `@pmate/user_messages:${userId}`;
|
|
6208
|
+
}
|
|
6209
|
+
static userMapping() {
|
|
6210
|
+
return "@pmate/username_mapping";
|
|
6211
|
+
}
|
|
6212
|
+
static userMobileMapping() {
|
|
6213
|
+
return "@pmate/mobile_account";
|
|
6214
|
+
}
|
|
6215
|
+
static mapping() {
|
|
6216
|
+
return "@pmate/mapping";
|
|
6217
|
+
}
|
|
6218
|
+
static profiles() {
|
|
6219
|
+
return "@pmate/profiles";
|
|
6220
|
+
}
|
|
6221
|
+
static groups() {
|
|
6222
|
+
return "@pmate/groups";
|
|
6223
|
+
}
|
|
6224
|
+
static relationships() {
|
|
6225
|
+
return "@pmate/relationships";
|
|
6226
|
+
}
|
|
6227
|
+
};
|
|
6228
|
+
topicKindMatchers2 = [
|
|
6229
|
+
{
|
|
6230
|
+
kind: 1e3 /* UserLogs */,
|
|
6231
|
+
match: (topic) => topic.startsWith("@pmate/user_logs:")
|
|
6232
|
+
},
|
|
6233
|
+
{
|
|
6234
|
+
kind: 2e3 /* UserMessages */,
|
|
6235
|
+
match: (topic) => topic.startsWith("@pmate/user_messages:")
|
|
6236
|
+
},
|
|
6237
|
+
{
|
|
6238
|
+
kind: 3e3 /* Relationships */,
|
|
6239
|
+
match: (topic) => topic === TopicNames2.relationships()
|
|
6240
|
+
},
|
|
6241
|
+
{
|
|
6242
|
+
kind: 4e3 /* Rooms */,
|
|
6243
|
+
match: (topic) => topic === TopicNames2.rooms()
|
|
6244
|
+
},
|
|
6245
|
+
{
|
|
6246
|
+
kind: 5e3 /* UserContacts */,
|
|
6247
|
+
match: (topic) => topic.startsWith("@pmate/user_contacts:")
|
|
6248
|
+
},
|
|
6249
|
+
{
|
|
6250
|
+
kind: 8002 /* Entity_GROUP */,
|
|
6251
|
+
match: (topic) => topic === TopicNames2.groups()
|
|
6252
|
+
},
|
|
6253
|
+
{
|
|
6254
|
+
kind: 6e3 /* UserMapping */,
|
|
6255
|
+
match: (topic) => topic === TopicNames2.userMapping()
|
|
6256
|
+
},
|
|
6257
|
+
{
|
|
6258
|
+
kind: 7e3 /* UserMobileMapping */,
|
|
6259
|
+
match: (topic) => topic === TopicNames2.userMobileMapping()
|
|
6260
|
+
},
|
|
6261
|
+
{
|
|
6262
|
+
kind: 6003 /* Mapping */,
|
|
6263
|
+
match: (topic) => topic === TopicNames2.mapping()
|
|
6264
|
+
},
|
|
6265
|
+
{
|
|
6266
|
+
kind: 9e3 /* UserThreads */,
|
|
6267
|
+
match: (topic) => topic.startsWith("@pmate/user_threads:")
|
|
6268
|
+
}
|
|
6269
|
+
];
|
|
6270
|
+
}
|
|
6271
|
+
});
|
|
6272
|
+
|
|
6273
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/OSSKeys.ts
|
|
6274
|
+
var init_OSSKeys2 = __esm({
|
|
6275
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/OSSKeys.ts"() {
|
|
6276
|
+
"use strict";
|
|
6277
|
+
init_consts2();
|
|
6278
|
+
}
|
|
6279
|
+
});
|
|
6280
|
+
|
|
6281
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/CompanionProfiles.ts
|
|
6282
|
+
var openAICoral2, openAIAsh2, openAIBallad2, openAINova2, openAIVerse2;
|
|
6283
|
+
var init_CompanionProfiles2 = __esm({
|
|
6284
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/CompanionProfiles.ts"() {
|
|
6285
|
+
"use strict";
|
|
6286
|
+
init_types4();
|
|
6287
|
+
openAICoral2 = createVoice2({
|
|
6288
|
+
name: "coral",
|
|
6289
|
+
provider: "openai",
|
|
6290
|
+
gender: "F",
|
|
6291
|
+
instructions: "sweet, cute,naive voice"
|
|
6292
|
+
});
|
|
6293
|
+
openAIAsh2 = createVoice2({
|
|
6294
|
+
name: "ash",
|
|
6295
|
+
provider: "openai",
|
|
6296
|
+
gender: "M"
|
|
6297
|
+
});
|
|
6298
|
+
openAIBallad2 = createVoice2({
|
|
6299
|
+
name: "ballad",
|
|
6300
|
+
provider: "openai",
|
|
6301
|
+
gender: "M",
|
|
6302
|
+
instructions: "bright, young man voice"
|
|
6303
|
+
});
|
|
6304
|
+
openAINova2 = createVoice2({
|
|
6305
|
+
name: "nova",
|
|
6306
|
+
provider: "openai",
|
|
6307
|
+
gender: "F",
|
|
6308
|
+
instructions: "mature, smooth, elegant, warm voice"
|
|
6309
|
+
});
|
|
6310
|
+
openAIVerse2 = createVoice2({
|
|
6311
|
+
name: "verse",
|
|
6312
|
+
provider: "openai",
|
|
6313
|
+
gender: "M",
|
|
6314
|
+
instructions: "elderly,mysterious wizzard voice"
|
|
6315
|
+
});
|
|
6316
|
+
}
|
|
6317
|
+
});
|
|
6318
|
+
|
|
6319
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/index.ts
|
|
6320
|
+
var init_config2 = __esm({
|
|
6321
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/index.ts"() {
|
|
6322
|
+
"use strict";
|
|
6323
|
+
init_BizErrorCode2();
|
|
6324
|
+
init_consts2();
|
|
6325
|
+
init_TopicNames2();
|
|
6326
|
+
init_OSSKeys2();
|
|
6327
|
+
init_CompanionProfiles2();
|
|
6328
|
+
}
|
|
6329
|
+
});
|
|
6330
|
+
|
|
6331
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/index.ts
|
|
6332
|
+
var init_src3 = __esm({
|
|
6333
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/index.ts"() {
|
|
6334
|
+
"use strict";
|
|
6335
|
+
init_types4();
|
|
6336
|
+
init_config2();
|
|
6337
|
+
}
|
|
6338
|
+
});
|
|
6339
|
+
|
|
6340
|
+
// node_modules/@pmate/utils/src/uniqHash.ts
|
|
5946
6341
|
var import_js_sha32, sortKeys, uniqHash;
|
|
5947
6342
|
var init_uniqHash = __esm({
|
|
5948
|
-
"node_modules
|
|
6343
|
+
"node_modules/@pmate/utils/src/uniqHash.ts"() {
|
|
5949
6344
|
"use strict";
|
|
5950
|
-
|
|
6345
|
+
init_src3();
|
|
5951
6346
|
import_js_sha32 = __toESM(require_sha3(), 1);
|
|
5952
6347
|
sortKeys = (obj) => {
|
|
5953
6348
|
if (Array.isArray(obj)) {
|
|
@@ -5975,33 +6370,33 @@ var init_uniqHash = __esm({
|
|
|
5975
6370
|
}
|
|
5976
6371
|
});
|
|
5977
6372
|
|
|
5978
|
-
// node_modules
|
|
6373
|
+
// node_modules/@pmate/utils/src/createMsg.ts
|
|
5979
6374
|
var init_createMsg = __esm({
|
|
5980
|
-
"node_modules
|
|
6375
|
+
"node_modules/@pmate/utils/src/createMsg.ts"() {
|
|
5981
6376
|
"use strict";
|
|
5982
|
-
|
|
6377
|
+
init_src3();
|
|
5983
6378
|
init_uniqHash();
|
|
5984
6379
|
}
|
|
5985
6380
|
});
|
|
5986
6381
|
|
|
5987
|
-
// node_modules
|
|
6382
|
+
// node_modules/@pmate/utils/src/detectText.ts
|
|
5988
6383
|
var init_detectText = __esm({
|
|
5989
|
-
"node_modules
|
|
6384
|
+
"node_modules/@pmate/utils/src/detectText.ts"() {
|
|
5990
6385
|
"use strict";
|
|
5991
6386
|
}
|
|
5992
6387
|
});
|
|
5993
6388
|
|
|
5994
|
-
// node_modules
|
|
6389
|
+
// node_modules/@pmate/utils/src/Emitter.ts
|
|
5995
6390
|
var init_Emitter = __esm({
|
|
5996
|
-
"node_modules
|
|
6391
|
+
"node_modules/@pmate/utils/src/Emitter.ts"() {
|
|
5997
6392
|
"use strict";
|
|
5998
6393
|
}
|
|
5999
6394
|
});
|
|
6000
6395
|
|
|
6001
|
-
// node_modules
|
|
6396
|
+
// node_modules/@pmate/utils/src/EmitterV2.ts
|
|
6002
6397
|
var EmitterV2;
|
|
6003
6398
|
var init_EmitterV2 = __esm({
|
|
6004
|
-
"node_modules
|
|
6399
|
+
"node_modules/@pmate/utils/src/EmitterV2.ts"() {
|
|
6005
6400
|
"use strict";
|
|
6006
6401
|
EmitterV2 = class {
|
|
6007
6402
|
constructor() {
|
|
@@ -6057,39 +6452,39 @@ var init_EmitterV2 = __esm({
|
|
|
6057
6452
|
}
|
|
6058
6453
|
});
|
|
6059
6454
|
|
|
6060
|
-
// node_modules
|
|
6455
|
+
// node_modules/@pmate/utils/src/format/formatTime.ts
|
|
6061
6456
|
var init_formatTime = __esm({
|
|
6062
|
-
"node_modules
|
|
6457
|
+
"node_modules/@pmate/utils/src/format/formatTime.ts"() {
|
|
6063
6458
|
"use strict";
|
|
6064
6459
|
}
|
|
6065
6460
|
});
|
|
6066
6461
|
|
|
6067
|
-
// node_modules
|
|
6462
|
+
// node_modules/@pmate/utils/src/format/index.ts
|
|
6068
6463
|
var init_format = __esm({
|
|
6069
|
-
"node_modules
|
|
6464
|
+
"node_modules/@pmate/utils/src/format/index.ts"() {
|
|
6070
6465
|
"use strict";
|
|
6071
6466
|
init_formatTime();
|
|
6072
6467
|
}
|
|
6073
6468
|
});
|
|
6074
6469
|
|
|
6075
|
-
// node_modules
|
|
6470
|
+
// node_modules/@pmate/utils/src/isVolcabulary.ts
|
|
6076
6471
|
var init_isVolcabulary = __esm({
|
|
6077
|
-
"node_modules
|
|
6472
|
+
"node_modules/@pmate/utils/src/isVolcabulary.ts"() {
|
|
6078
6473
|
"use strict";
|
|
6079
6474
|
}
|
|
6080
6475
|
});
|
|
6081
6476
|
|
|
6082
|
-
// node_modules
|
|
6477
|
+
// node_modules/@pmate/utils/src/Loadable.ts
|
|
6083
6478
|
var init_Loadable = __esm({
|
|
6084
|
-
"node_modules
|
|
6479
|
+
"node_modules/@pmate/utils/src/Loadable.ts"() {
|
|
6085
6480
|
"use strict";
|
|
6086
6481
|
}
|
|
6087
6482
|
});
|
|
6088
6483
|
|
|
6089
|
-
// node_modules
|
|
6484
|
+
// node_modules/@pmate/utils/src/Logger.ts
|
|
6090
6485
|
var Logger;
|
|
6091
6486
|
var init_Logger = __esm({
|
|
6092
|
-
"node_modules
|
|
6487
|
+
"node_modules/@pmate/utils/src/Logger.ts"() {
|
|
6093
6488
|
"use strict";
|
|
6094
6489
|
Logger = class _Logger {
|
|
6095
6490
|
constructor(name) {
|
|
@@ -6114,21 +6509,21 @@ var init_Logger = __esm({
|
|
|
6114
6509
|
}
|
|
6115
6510
|
});
|
|
6116
6511
|
|
|
6117
|
-
// node_modules
|
|
6512
|
+
// node_modules/@pmate/utils/src/mapToReadingBook.ts
|
|
6118
6513
|
var init_mapToReadingBook = __esm({
|
|
6119
|
-
"node_modules
|
|
6514
|
+
"node_modules/@pmate/utils/src/mapToReadingBook.ts"() {
|
|
6120
6515
|
"use strict";
|
|
6121
6516
|
}
|
|
6122
6517
|
});
|
|
6123
6518
|
|
|
6124
|
-
// node_modules
|
|
6519
|
+
// node_modules/@pmate/utils/src/memoize.ts
|
|
6125
6520
|
var init_memoize = __esm({
|
|
6126
|
-
"node_modules
|
|
6521
|
+
"node_modules/@pmate/utils/src/memoize.ts"() {
|
|
6127
6522
|
"use strict";
|
|
6128
6523
|
}
|
|
6129
6524
|
});
|
|
6130
6525
|
|
|
6131
|
-
// node_modules
|
|
6526
|
+
// node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs
|
|
6132
6527
|
function utf8Count(str) {
|
|
6133
6528
|
const strLength = str.length;
|
|
6134
6529
|
let byteLength = 0;
|
|
@@ -6255,7 +6650,7 @@ function utf8Decode(bytes, inputOffset, byteLength) {
|
|
|
6255
6650
|
}
|
|
6256
6651
|
var sharedTextEncoder, TEXT_ENCODER_THRESHOLD, CHUNK_SIZE, sharedTextDecoder, TEXT_DECODER_THRESHOLD;
|
|
6257
6652
|
var init_utf8 = __esm({
|
|
6258
|
-
"node_modules
|
|
6653
|
+
"node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs"() {
|
|
6259
6654
|
"use strict";
|
|
6260
6655
|
sharedTextEncoder = new TextEncoder();
|
|
6261
6656
|
TEXT_ENCODER_THRESHOLD = 50;
|
|
@@ -6265,10 +6660,10 @@ var init_utf8 = __esm({
|
|
|
6265
6660
|
}
|
|
6266
6661
|
});
|
|
6267
6662
|
|
|
6268
|
-
// node_modules
|
|
6663
|
+
// node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs
|
|
6269
6664
|
var ExtData;
|
|
6270
6665
|
var init_ExtData = __esm({
|
|
6271
|
-
"node_modules
|
|
6666
|
+
"node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs"() {
|
|
6272
6667
|
"use strict";
|
|
6273
6668
|
ExtData = class {
|
|
6274
6669
|
type;
|
|
@@ -6281,10 +6676,10 @@ var init_ExtData = __esm({
|
|
|
6281
6676
|
}
|
|
6282
6677
|
});
|
|
6283
6678
|
|
|
6284
|
-
// node_modules
|
|
6679
|
+
// node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs
|
|
6285
6680
|
var DecodeError;
|
|
6286
6681
|
var init_DecodeError = __esm({
|
|
6287
|
-
"node_modules
|
|
6682
|
+
"node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs"() {
|
|
6288
6683
|
"use strict";
|
|
6289
6684
|
DecodeError = class _DecodeError extends Error {
|
|
6290
6685
|
constructor(message) {
|
|
@@ -6301,7 +6696,7 @@ var init_DecodeError = __esm({
|
|
|
6301
6696
|
}
|
|
6302
6697
|
});
|
|
6303
6698
|
|
|
6304
|
-
// node_modules
|
|
6699
|
+
// node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs
|
|
6305
6700
|
function setUint64(view, offset, value) {
|
|
6306
6701
|
const high = value / 4294967296;
|
|
6307
6702
|
const low = value;
|
|
@@ -6326,13 +6721,13 @@ function getUint64(view, offset) {
|
|
|
6326
6721
|
}
|
|
6327
6722
|
var UINT32_MAX;
|
|
6328
6723
|
var init_int = __esm({
|
|
6329
|
-
"node_modules
|
|
6724
|
+
"node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs"() {
|
|
6330
6725
|
"use strict";
|
|
6331
6726
|
UINT32_MAX = 4294967295;
|
|
6332
6727
|
}
|
|
6333
6728
|
});
|
|
6334
6729
|
|
|
6335
|
-
// node_modules
|
|
6730
|
+
// node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs
|
|
6336
6731
|
function encodeTimeSpecToTimestamp({ sec, nsec }) {
|
|
6337
6732
|
if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {
|
|
6338
6733
|
if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {
|
|
@@ -6405,7 +6800,7 @@ function decodeTimestampExtension(data) {
|
|
|
6405
6800
|
}
|
|
6406
6801
|
var EXT_TIMESTAMP, TIMESTAMP32_MAX_SEC, TIMESTAMP64_MAX_SEC, timestampExtension;
|
|
6407
6802
|
var init_timestamp = __esm({
|
|
6408
|
-
"node_modules
|
|
6803
|
+
"node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs"() {
|
|
6409
6804
|
"use strict";
|
|
6410
6805
|
init_DecodeError();
|
|
6411
6806
|
init_int();
|
|
@@ -6420,10 +6815,10 @@ var init_timestamp = __esm({
|
|
|
6420
6815
|
}
|
|
6421
6816
|
});
|
|
6422
6817
|
|
|
6423
|
-
// node_modules
|
|
6818
|
+
// node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs
|
|
6424
6819
|
var ExtensionCodec;
|
|
6425
6820
|
var init_ExtensionCodec = __esm({
|
|
6426
|
-
"node_modules
|
|
6821
|
+
"node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs"() {
|
|
6427
6822
|
"use strict";
|
|
6428
6823
|
init_ExtData();
|
|
6429
6824
|
init_timestamp();
|
|
@@ -6490,7 +6885,7 @@ var init_ExtensionCodec = __esm({
|
|
|
6490
6885
|
}
|
|
6491
6886
|
});
|
|
6492
6887
|
|
|
6493
|
-
// node_modules
|
|
6888
|
+
// node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs
|
|
6494
6889
|
function isArrayBufferLike(buffer) {
|
|
6495
6890
|
return buffer instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && buffer instanceof SharedArrayBuffer;
|
|
6496
6891
|
}
|
|
@@ -6506,15 +6901,15 @@ function ensureUint8Array(buffer) {
|
|
|
6506
6901
|
}
|
|
6507
6902
|
}
|
|
6508
6903
|
var init_typedArrays = __esm({
|
|
6509
|
-
"node_modules
|
|
6904
|
+
"node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs"() {
|
|
6510
6905
|
"use strict";
|
|
6511
6906
|
}
|
|
6512
6907
|
});
|
|
6513
6908
|
|
|
6514
|
-
// node_modules
|
|
6909
|
+
// node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs
|
|
6515
6910
|
var DEFAULT_MAX_DEPTH, DEFAULT_INITIAL_BUFFER_SIZE, Encoder;
|
|
6516
6911
|
var init_Encoder = __esm({
|
|
6517
|
-
"node_modules
|
|
6912
|
+
"node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs"() {
|
|
6518
6913
|
"use strict";
|
|
6519
6914
|
init_utf8();
|
|
6520
6915
|
init_ExtensionCodec();
|
|
@@ -6924,32 +7319,32 @@ var init_Encoder = __esm({
|
|
|
6924
7319
|
}
|
|
6925
7320
|
});
|
|
6926
7321
|
|
|
6927
|
-
// node_modules
|
|
7322
|
+
// node_modules/@msgpack/msgpack/dist.esm/encode.mjs
|
|
6928
7323
|
function encode(value, options) {
|
|
6929
7324
|
const encoder2 = new Encoder(options);
|
|
6930
7325
|
return encoder2.encodeSharedRef(value);
|
|
6931
7326
|
}
|
|
6932
7327
|
var init_encode = __esm({
|
|
6933
|
-
"node_modules
|
|
7328
|
+
"node_modules/@msgpack/msgpack/dist.esm/encode.mjs"() {
|
|
6934
7329
|
"use strict";
|
|
6935
7330
|
init_Encoder();
|
|
6936
7331
|
}
|
|
6937
7332
|
});
|
|
6938
7333
|
|
|
6939
|
-
// node_modules
|
|
7334
|
+
// node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs
|
|
6940
7335
|
function prettyByte(byte) {
|
|
6941
7336
|
return `${byte < 0 ? "-" : ""}0x${Math.abs(byte).toString(16).padStart(2, "0")}`;
|
|
6942
7337
|
}
|
|
6943
7338
|
var init_prettyByte = __esm({
|
|
6944
|
-
"node_modules
|
|
7339
|
+
"node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs"() {
|
|
6945
7340
|
"use strict";
|
|
6946
7341
|
}
|
|
6947
7342
|
});
|
|
6948
7343
|
|
|
6949
|
-
// node_modules
|
|
7344
|
+
// node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs
|
|
6950
7345
|
var DEFAULT_MAX_KEY_LENGTH, DEFAULT_MAX_LENGTH_PER_KEY, CachedKeyDecoder;
|
|
6951
7346
|
var init_CachedKeyDecoder = __esm({
|
|
6952
|
-
"node_modules
|
|
7347
|
+
"node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs"() {
|
|
6953
7348
|
"use strict";
|
|
6954
7349
|
init_utf8();
|
|
6955
7350
|
DEFAULT_MAX_KEY_LENGTH = 16;
|
|
@@ -7009,10 +7404,10 @@ var init_CachedKeyDecoder = __esm({
|
|
|
7009
7404
|
}
|
|
7010
7405
|
});
|
|
7011
7406
|
|
|
7012
|
-
// node_modules
|
|
7407
|
+
// node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs
|
|
7013
7408
|
var STATE_ARRAY, STATE_MAP_KEY, STATE_MAP_VALUE, mapKeyConverter, StackPool, HEAD_BYTE_REQUIRED, EMPTY_VIEW, EMPTY_BYTES, MORE_DATA, sharedCachedKeyDecoder, Decoder;
|
|
7014
7409
|
var init_Decoder = __esm({
|
|
7015
|
-
"node_modules
|
|
7410
|
+
"node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs"() {
|
|
7016
7411
|
"use strict";
|
|
7017
7412
|
init_prettyByte();
|
|
7018
7413
|
init_ExtensionCodec();
|
|
@@ -7650,34 +8045,34 @@ var init_Decoder = __esm({
|
|
|
7650
8045
|
}
|
|
7651
8046
|
});
|
|
7652
8047
|
|
|
7653
|
-
// node_modules
|
|
8048
|
+
// node_modules/@msgpack/msgpack/dist.esm/decode.mjs
|
|
7654
8049
|
function decode(buffer, options) {
|
|
7655
8050
|
const decoder = new Decoder(options);
|
|
7656
8051
|
return decoder.decode(buffer);
|
|
7657
8052
|
}
|
|
7658
8053
|
var init_decode = __esm({
|
|
7659
|
-
"node_modules
|
|
8054
|
+
"node_modules/@msgpack/msgpack/dist.esm/decode.mjs"() {
|
|
7660
8055
|
"use strict";
|
|
7661
8056
|
init_Decoder();
|
|
7662
8057
|
}
|
|
7663
8058
|
});
|
|
7664
8059
|
|
|
7665
|
-
// node_modules
|
|
8060
|
+
// node_modules/@msgpack/msgpack/dist.esm/index.mjs
|
|
7666
8061
|
var init_dist = __esm({
|
|
7667
|
-
"node_modules
|
|
8062
|
+
"node_modules/@msgpack/msgpack/dist.esm/index.mjs"() {
|
|
7668
8063
|
"use strict";
|
|
7669
8064
|
init_encode();
|
|
7670
8065
|
init_decode();
|
|
7671
8066
|
}
|
|
7672
8067
|
});
|
|
7673
8068
|
|
|
7674
|
-
// node_modules
|
|
8069
|
+
// node_modules/@pmate/utils/src/Msg.ts
|
|
7675
8070
|
var encoder, Msg;
|
|
7676
8071
|
var init_Msg = __esm({
|
|
7677
|
-
"node_modules
|
|
8072
|
+
"node_modules/@pmate/utils/src/Msg.ts"() {
|
|
7678
8073
|
"use strict";
|
|
7679
8074
|
init_dist();
|
|
7680
|
-
|
|
8075
|
+
init_src3();
|
|
7681
8076
|
init_compress();
|
|
7682
8077
|
init_uniqHash();
|
|
7683
8078
|
encoder = new TextEncoder();
|
|
@@ -7751,21 +8146,17 @@ var init_Msg = __esm({
|
|
|
7751
8146
|
if (!body || typeof body !== "object") {
|
|
7752
8147
|
return msg;
|
|
7753
8148
|
}
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
};
|
|
7760
|
-
}
|
|
7761
|
-
if ((body.kind === "request" || body.kind === "response") && body.payload && typeof body.payload === "object") {
|
|
7762
|
-
const normalizedPayload = await _Msg.normalizePayloadBody(body.payload);
|
|
7763
|
-
if (normalizedPayload !== body.payload) {
|
|
8149
|
+
if ("payload" in body && "type" in body) {
|
|
8150
|
+
const payload = body.payload;
|
|
8151
|
+
const isBinaryPayload = typeof Blob !== "undefined" && (payload instanceof Blob || payload instanceof ArrayBuffer || payload instanceof Uint8Array);
|
|
8152
|
+
if (isBinaryPayload) {
|
|
8153
|
+
const gz = await gzipEncodeBlob(payload);
|
|
7764
8154
|
return {
|
|
7765
8155
|
...msg,
|
|
7766
8156
|
body: {
|
|
7767
8157
|
...body,
|
|
7768
|
-
payload:
|
|
8158
|
+
payload: gz,
|
|
8159
|
+
contentEncoding: "gzip"
|
|
7769
8160
|
}
|
|
7770
8161
|
};
|
|
7771
8162
|
}
|
|
@@ -7782,128 +8173,112 @@ var init_Msg = __esm({
|
|
|
7782
8173
|
}
|
|
7783
8174
|
return msg;
|
|
7784
8175
|
}
|
|
7785
|
-
static async normalizePayloadBody(body) {
|
|
7786
|
-
if (!("payload" in body) || !("type" in body)) {
|
|
7787
|
-
return body;
|
|
7788
|
-
}
|
|
7789
|
-
const payload = body.payload;
|
|
7790
|
-
const isBinaryPayload = typeof Blob !== "undefined" && (payload instanceof Blob || payload instanceof ArrayBuffer || payload instanceof Uint8Array);
|
|
7791
|
-
if (!isBinaryPayload) {
|
|
7792
|
-
return body;
|
|
7793
|
-
}
|
|
7794
|
-
const gz = await gzipEncodeBlob(payload);
|
|
7795
|
-
return {
|
|
7796
|
-
...body,
|
|
7797
|
-
payload: gz,
|
|
7798
|
-
contentEncoding: "gzip"
|
|
7799
|
-
};
|
|
7800
|
-
}
|
|
7801
8176
|
};
|
|
7802
8177
|
}
|
|
7803
8178
|
});
|
|
7804
8179
|
|
|
7805
|
-
// node_modules
|
|
8180
|
+
// node_modules/@pmate/utils/src/normalize.ts
|
|
7806
8181
|
var init_normalize = __esm({
|
|
7807
|
-
"node_modules
|
|
8182
|
+
"node_modules/@pmate/utils/src/normalize.ts"() {
|
|
7808
8183
|
"use strict";
|
|
7809
8184
|
}
|
|
7810
8185
|
});
|
|
7811
8186
|
|
|
7812
|
-
// node_modules
|
|
8187
|
+
// node_modules/@pmate/utils/src/pageURL.ts
|
|
7813
8188
|
var init_pageURL = __esm({
|
|
7814
|
-
"node_modules
|
|
8189
|
+
"node_modules/@pmate/utils/src/pageURL.ts"() {
|
|
7815
8190
|
"use strict";
|
|
7816
8191
|
}
|
|
7817
8192
|
});
|
|
7818
8193
|
|
|
7819
|
-
// node_modules
|
|
8194
|
+
// node_modules/@pmate/utils/src/PromiseQueue.ts
|
|
7820
8195
|
var init_PromiseQueue = __esm({
|
|
7821
|
-
"node_modules
|
|
8196
|
+
"node_modules/@pmate/utils/src/PromiseQueue.ts"() {
|
|
7822
8197
|
"use strict";
|
|
7823
8198
|
}
|
|
7824
8199
|
});
|
|
7825
8200
|
|
|
7826
|
-
// node_modules
|
|
8201
|
+
// node_modules/@pmate/utils/src/resourceKey.ts
|
|
7827
8202
|
var import_js_sha33;
|
|
7828
8203
|
var init_resourceKey = __esm({
|
|
7829
|
-
"node_modules
|
|
8204
|
+
"node_modules/@pmate/utils/src/resourceKey.ts"() {
|
|
7830
8205
|
"use strict";
|
|
7831
8206
|
import_js_sha33 = __toESM(require_sha3(), 1);
|
|
7832
8207
|
}
|
|
7833
8208
|
});
|
|
7834
8209
|
|
|
7835
|
-
// node_modules
|
|
8210
|
+
// node_modules/@pmate/utils/src/SelectionHelper.ts
|
|
7836
8211
|
var init_SelectionHelper = __esm({
|
|
7837
|
-
"node_modules
|
|
8212
|
+
"node_modules/@pmate/utils/src/SelectionHelper.ts"() {
|
|
7838
8213
|
"use strict";
|
|
7839
8214
|
}
|
|
7840
8215
|
});
|
|
7841
8216
|
|
|
7842
|
-
// node_modules
|
|
8217
|
+
// node_modules/@pmate/utils/src/setMinus.ts
|
|
7843
8218
|
var init_setMinus = __esm({
|
|
7844
|
-
"node_modules
|
|
8219
|
+
"node_modules/@pmate/utils/src/setMinus.ts"() {
|
|
7845
8220
|
"use strict";
|
|
7846
8221
|
}
|
|
7847
8222
|
});
|
|
7848
8223
|
|
|
7849
|
-
// node_modules
|
|
8224
|
+
// node_modules/@pmate/utils/src/sha1Hash.ts
|
|
7850
8225
|
var init_sha1Hash = __esm({
|
|
7851
|
-
"node_modules
|
|
8226
|
+
"node_modules/@pmate/utils/src/sha1Hash.ts"() {
|
|
7852
8227
|
"use strict";
|
|
7853
8228
|
}
|
|
7854
8229
|
});
|
|
7855
8230
|
|
|
7856
|
-
// node_modules
|
|
8231
|
+
// node_modules/@pmate/utils/src/TaskWaiter.ts
|
|
7857
8232
|
var init_TaskWaiter = __esm({
|
|
7858
|
-
"node_modules
|
|
8233
|
+
"node_modules/@pmate/utils/src/TaskWaiter.ts"() {
|
|
7859
8234
|
"use strict";
|
|
7860
|
-
|
|
8235
|
+
init_src4();
|
|
7861
8236
|
}
|
|
7862
8237
|
});
|
|
7863
8238
|
|
|
7864
|
-
// node_modules
|
|
8239
|
+
// node_modules/@pmate/utils/src/toSentenceAnalyze.ts
|
|
7865
8240
|
var init_toSentenceAnalyze = __esm({
|
|
7866
|
-
"node_modules
|
|
8241
|
+
"node_modules/@pmate/utils/src/toSentenceAnalyze.ts"() {
|
|
7867
8242
|
"use strict";
|
|
7868
8243
|
}
|
|
7869
8244
|
});
|
|
7870
8245
|
|
|
7871
|
-
// node_modules
|
|
8246
|
+
// node_modules/@pmate/utils/src/txtBookToJson.ts
|
|
7872
8247
|
var init_txtBookToJson = __esm({
|
|
7873
|
-
"node_modules
|
|
8248
|
+
"node_modules/@pmate/utils/src/txtBookToJson.ts"() {
|
|
7874
8249
|
"use strict";
|
|
7875
8250
|
init_src2();
|
|
7876
8251
|
}
|
|
7877
8252
|
});
|
|
7878
8253
|
|
|
7879
|
-
// node_modules
|
|
8254
|
+
// node_modules/@pmate/utils/src/VocabularyMap.ts
|
|
7880
8255
|
var init_VocabularyMap = __esm({
|
|
7881
|
-
"node_modules
|
|
8256
|
+
"node_modules/@pmate/utils/src/VocabularyMap.ts"() {
|
|
7882
8257
|
"use strict";
|
|
7883
8258
|
init_Emitter();
|
|
7884
8259
|
}
|
|
7885
8260
|
});
|
|
7886
8261
|
|
|
7887
|
-
// node_modules
|
|
8262
|
+
// node_modules/@pmate/utils/src/wait.ts
|
|
7888
8263
|
var init_wait = __esm({
|
|
7889
|
-
"node_modules
|
|
8264
|
+
"node_modules/@pmate/utils/src/wait.ts"() {
|
|
7890
8265
|
"use strict";
|
|
7891
8266
|
}
|
|
7892
8267
|
});
|
|
7893
8268
|
|
|
7894
|
-
// node_modules
|
|
8269
|
+
// node_modules/@pmate/utils/src/wordCount.ts
|
|
7895
8270
|
var init_wordCount = __esm({
|
|
7896
|
-
"node_modules
|
|
8271
|
+
"node_modules/@pmate/utils/src/wordCount.ts"() {
|
|
7897
8272
|
"use strict";
|
|
7898
8273
|
}
|
|
7899
8274
|
});
|
|
7900
8275
|
|
|
7901
|
-
// node_modules
|
|
8276
|
+
// node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts
|
|
7902
8277
|
var logger, WebsocketHeartbeat;
|
|
7903
8278
|
var init_WebsocketHeartbeat = __esm({
|
|
7904
|
-
"node_modules
|
|
8279
|
+
"node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts"() {
|
|
7905
8280
|
"use strict";
|
|
7906
|
-
|
|
8281
|
+
init_src3();
|
|
7907
8282
|
init_Logger();
|
|
7908
8283
|
logger = Logger.getDebugger("heartbeat");
|
|
7909
8284
|
WebsocketHeartbeat = class {
|
|
@@ -7936,18 +8311,19 @@ var init_WebsocketHeartbeat = __esm({
|
|
|
7936
8311
|
}
|
|
7937
8312
|
handlePong() {
|
|
7938
8313
|
this.lastPong = Date.now();
|
|
8314
|
+
logger.log("Pong received");
|
|
7939
8315
|
return true;
|
|
7940
8316
|
}
|
|
7941
8317
|
};
|
|
7942
8318
|
}
|
|
7943
8319
|
});
|
|
7944
8320
|
|
|
7945
|
-
// node_modules
|
|
8321
|
+
// node_modules/@pmate/utils/src/websocket/WebsocketClient.ts
|
|
7946
8322
|
var logger2;
|
|
7947
8323
|
var init_WebsocketClient = __esm({
|
|
7948
|
-
"node_modules
|
|
8324
|
+
"node_modules/@pmate/utils/src/websocket/WebsocketClient.ts"() {
|
|
7949
8325
|
"use strict";
|
|
7950
|
-
|
|
8326
|
+
init_src3();
|
|
7951
8327
|
init_Emitter();
|
|
7952
8328
|
init_Logger();
|
|
7953
8329
|
init_Msg();
|
|
@@ -7956,7 +8332,7 @@ var init_WebsocketClient = __esm({
|
|
|
7956
8332
|
}
|
|
7957
8333
|
});
|
|
7958
8334
|
|
|
7959
|
-
// node_modules
|
|
8335
|
+
// node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts
|
|
7960
8336
|
function isEventLike(value) {
|
|
7961
8337
|
return typeof value === "object" && value !== null && "type" in value && typeof value.type === "string";
|
|
7962
8338
|
}
|
|
@@ -7965,9 +8341,9 @@ function isCloseEvent(value) {
|
|
|
7965
8341
|
}
|
|
7966
8342
|
var logger3, WebsocketClientV2;
|
|
7967
8343
|
var init_WebsocketClientV2 = __esm({
|
|
7968
|
-
"node_modules
|
|
8344
|
+
"node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts"() {
|
|
7969
8345
|
"use strict";
|
|
7970
|
-
|
|
8346
|
+
init_src3();
|
|
7971
8347
|
init_AsyncStream();
|
|
7972
8348
|
init_Logger();
|
|
7973
8349
|
init_Msg();
|
|
@@ -8212,10 +8588,10 @@ var init_WebsocketClientV2 = __esm({
|
|
|
8212
8588
|
}
|
|
8213
8589
|
});
|
|
8214
8590
|
|
|
8215
|
-
// node_modules
|
|
8591
|
+
// node_modules/@pmate/utils/src/websocket/H3Client.ts
|
|
8216
8592
|
var logger4;
|
|
8217
8593
|
var init_H3Client = __esm({
|
|
8218
|
-
"node_modules
|
|
8594
|
+
"node_modules/@pmate/utils/src/websocket/H3Client.ts"() {
|
|
8219
8595
|
"use strict";
|
|
8220
8596
|
init_Emitter();
|
|
8221
8597
|
init_Logger();
|
|
@@ -8225,9 +8601,9 @@ var init_H3Client = __esm({
|
|
|
8225
8601
|
}
|
|
8226
8602
|
});
|
|
8227
8603
|
|
|
8228
|
-
// node_modules
|
|
8604
|
+
// node_modules/@pmate/utils/src/websocket/index.ts
|
|
8229
8605
|
var init_websocket = __esm({
|
|
8230
|
-
"node_modules
|
|
8606
|
+
"node_modules/@pmate/utils/src/websocket/index.ts"() {
|
|
8231
8607
|
"use strict";
|
|
8232
8608
|
init_WebsocketClient();
|
|
8233
8609
|
init_WebsocketClientV2();
|
|
@@ -8235,9 +8611,9 @@ var init_websocket = __esm({
|
|
|
8235
8611
|
}
|
|
8236
8612
|
});
|
|
8237
8613
|
|
|
8238
|
-
// node_modules
|
|
8239
|
-
var
|
|
8240
|
-
"node_modules
|
|
8614
|
+
// node_modules/@pmate/utils/src/index.ts
|
|
8615
|
+
var init_src4 = __esm({
|
|
8616
|
+
"node_modules/@pmate/utils/src/index.ts"() {
|
|
8241
8617
|
"use strict";
|
|
8242
8618
|
init_base64();
|
|
8243
8619
|
init_batchResolve();
|
|
@@ -8277,7 +8653,7 @@ var init_src3 = __esm({
|
|
|
8277
8653
|
}
|
|
8278
8654
|
});
|
|
8279
8655
|
|
|
8280
|
-
// node_modules
|
|
8656
|
+
// node_modules/@pmate/agent-sdk/dist/debug.js
|
|
8281
8657
|
function isDebugEnabled() {
|
|
8282
8658
|
return process.env.DEBUG === "1";
|
|
8283
8659
|
}
|
|
@@ -8292,296 +8668,17 @@ function debugLog(message, data) {
|
|
|
8292
8668
|
console.log(message, data);
|
|
8293
8669
|
}
|
|
8294
8670
|
var init_debug = __esm({
|
|
8295
|
-
"node_modules
|
|
8296
|
-
"use strict";
|
|
8297
|
-
}
|
|
8298
|
-
});
|
|
8299
|
-
|
|
8300
|
-
// node_modules/.pnpm/@pmate+agent-sdk@1.1.16/node_modules/@pmate/agent-sdk/dist/AgentConnectionPool.js
|
|
8301
|
-
function ensureProtocol(value, protocol) {
|
|
8302
|
-
if (!value) {
|
|
8303
|
-
return "";
|
|
8304
|
-
}
|
|
8305
|
-
if (/^[a-z]+:\/\//i.test(value)) {
|
|
8306
|
-
try {
|
|
8307
|
-
const url = new URL(value);
|
|
8308
|
-
url.protocol = `${protocol}:`;
|
|
8309
|
-
return url.toString();
|
|
8310
|
-
} catch {
|
|
8311
|
-
return value;
|
|
8312
|
-
}
|
|
8313
|
-
}
|
|
8314
|
-
if (value.startsWith("//")) {
|
|
8315
|
-
return `${protocol}:${value}`;
|
|
8316
|
-
}
|
|
8317
|
-
return `${protocol}://${value}`;
|
|
8318
|
-
}
|
|
8319
|
-
function createPoolKey(wsUrl, profileId, token) {
|
|
8320
|
-
return `${wsUrl}|${profileId}|${hashToken(token)}`;
|
|
8321
|
-
}
|
|
8322
|
-
function hashToken(token) {
|
|
8323
|
-
let hash = 2166136261;
|
|
8324
|
-
for (let i = 0; i < token.length; i += 1) {
|
|
8325
|
-
hash ^= token.charCodeAt(i);
|
|
8326
|
-
hash = Math.imul(hash, 16777619);
|
|
8327
|
-
}
|
|
8328
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
8329
|
-
}
|
|
8330
|
-
var IDLE_CLOSE_MS, pool, AgentConnectionPool, AgentPooledConnection;
|
|
8331
|
-
var init_AgentConnectionPool = __esm({
|
|
8332
|
-
"node_modules/.pnpm/@pmate+agent-sdk@1.1.16/node_modules/@pmate/agent-sdk/dist/AgentConnectionPool.js"() {
|
|
8671
|
+
"node_modules/@pmate/agent-sdk/dist/debug.js"() {
|
|
8333
8672
|
"use strict";
|
|
8334
|
-
init_src();
|
|
8335
|
-
init_src3();
|
|
8336
|
-
init_debug();
|
|
8337
|
-
IDLE_CLOSE_MS = 5e3;
|
|
8338
|
-
pool = /* @__PURE__ */ new Map();
|
|
8339
|
-
AgentConnectionPool = class {
|
|
8340
|
-
static acquire(options) {
|
|
8341
|
-
const wsUrl = ensureProtocol(options.baseUrl, "wss");
|
|
8342
|
-
const key = createPoolKey(wsUrl, options.profileId, options.token);
|
|
8343
|
-
let entry = pool.get(key);
|
|
8344
|
-
if (!entry) {
|
|
8345
|
-
entry = {
|
|
8346
|
-
connection: new AgentPooledConnection(wsUrl, options.profileId, options.token),
|
|
8347
|
-
refCount: 0,
|
|
8348
|
-
idleTimer: null
|
|
8349
|
-
};
|
|
8350
|
-
pool.set(key, entry);
|
|
8351
|
-
}
|
|
8352
|
-
if (entry.idleTimer) {
|
|
8353
|
-
clearTimeout(entry.idleTimer);
|
|
8354
|
-
entry.idleTimer = null;
|
|
8355
|
-
}
|
|
8356
|
-
entry.refCount += 1;
|
|
8357
|
-
return {
|
|
8358
|
-
key,
|
|
8359
|
-
connection: entry.connection
|
|
8360
|
-
};
|
|
8361
|
-
}
|
|
8362
|
-
static release(lease) {
|
|
8363
|
-
const entry = pool.get(lease.key);
|
|
8364
|
-
if (!entry) {
|
|
8365
|
-
return;
|
|
8366
|
-
}
|
|
8367
|
-
entry.refCount = Math.max(0, entry.refCount - 1);
|
|
8368
|
-
if (entry.refCount > 0 || entry.idleTimer) {
|
|
8369
|
-
return;
|
|
8370
|
-
}
|
|
8371
|
-
entry.idleTimer = setTimeout(() => {
|
|
8372
|
-
const current = pool.get(lease.key);
|
|
8373
|
-
if (!current || current.refCount > 0) {
|
|
8374
|
-
return;
|
|
8375
|
-
}
|
|
8376
|
-
current.connection.close();
|
|
8377
|
-
pool.delete(lease.key);
|
|
8378
|
-
}, IDLE_CLOSE_MS);
|
|
8379
|
-
}
|
|
8380
|
-
static clearForTests() {
|
|
8381
|
-
for (const [key, entry] of pool.entries()) {
|
|
8382
|
-
if (entry.idleTimer) {
|
|
8383
|
-
clearTimeout(entry.idleTimer);
|
|
8384
|
-
}
|
|
8385
|
-
entry.connection.close();
|
|
8386
|
-
pool.delete(key);
|
|
8387
|
-
}
|
|
8388
|
-
}
|
|
8389
|
-
};
|
|
8390
|
-
AgentPooledConnection = class {
|
|
8391
|
-
constructor(wsUrl, profileId, token) {
|
|
8392
|
-
this.profileId = profileId;
|
|
8393
|
-
this.token = token;
|
|
8394
|
-
this.listeners = /* @__PURE__ */ new Set();
|
|
8395
|
-
this.authPromise = null;
|
|
8396
|
-
this.authResolve = null;
|
|
8397
|
-
this.authReject = null;
|
|
8398
|
-
this.authTimer = null;
|
|
8399
|
-
this.authenticated = false;
|
|
8400
|
-
this.authStarted = false;
|
|
8401
|
-
this.ws = new WebsocketClientV2(wsUrl);
|
|
8402
|
-
this.startWsStream();
|
|
8403
|
-
}
|
|
8404
|
-
addListener(listener) {
|
|
8405
|
-
this.listeners.add(listener);
|
|
8406
|
-
}
|
|
8407
|
-
removeListener(listener) {
|
|
8408
|
-
this.listeners.delete(listener);
|
|
8409
|
-
}
|
|
8410
|
-
isConnected() {
|
|
8411
|
-
return this.ws.isConnected();
|
|
8412
|
-
}
|
|
8413
|
-
async authenticate(timeoutMs) {
|
|
8414
|
-
await this.waitForConnection(timeoutMs);
|
|
8415
|
-
if (this.authenticated) {
|
|
8416
|
-
debugLog("[agent-connection-pool] auth reused", {
|
|
8417
|
-
profileId: this.profileId
|
|
8418
|
-
});
|
|
8419
|
-
return;
|
|
8420
|
-
}
|
|
8421
|
-
const waiter = this.waitForAuthAck(timeoutMs);
|
|
8422
|
-
if (!this.authStarted) {
|
|
8423
|
-
this.authStarted = true;
|
|
8424
|
-
const msg = Msg.create(this.profileId, "@hub", 4 /* AUTH */, {
|
|
8425
|
-
token: this.token,
|
|
8426
|
-
as: "user",
|
|
8427
|
-
profileId: this.profileId
|
|
8428
|
-
});
|
|
8429
|
-
debugLog("[agent-connection-pool] auth sent", {
|
|
8430
|
-
profileId: this.profileId
|
|
8431
|
-
});
|
|
8432
|
-
await this.ws.sendMsg(msg);
|
|
8433
|
-
}
|
|
8434
|
-
await waiter;
|
|
8435
|
-
}
|
|
8436
|
-
sendMsg(msg) {
|
|
8437
|
-
return this.ws.sendMsg(msg);
|
|
8438
|
-
}
|
|
8439
|
-
close() {
|
|
8440
|
-
this.ws.close();
|
|
8441
|
-
this.rejectAuth(new Error("Agent websocket closed before auth ack"));
|
|
8442
|
-
this.listeners.clear();
|
|
8443
|
-
}
|
|
8444
|
-
async startWsStream() {
|
|
8445
|
-
const stream = this.ws.getStream();
|
|
8446
|
-
try {
|
|
8447
|
-
for await (const event of stream) {
|
|
8448
|
-
this.handleWsEvent(event);
|
|
8449
|
-
}
|
|
8450
|
-
} catch {
|
|
8451
|
-
}
|
|
8452
|
-
}
|
|
8453
|
-
handleWsEvent(event) {
|
|
8454
|
-
if (event.type === "message") {
|
|
8455
|
-
this.handleIncomingMessage(event.data);
|
|
8456
|
-
return;
|
|
8457
|
-
}
|
|
8458
|
-
if (event.type === "connected" && !event.data) {
|
|
8459
|
-
this.authenticated = false;
|
|
8460
|
-
this.rejectAuth(new Error("Agent websocket disconnected before auth ack"));
|
|
8461
|
-
}
|
|
8462
|
-
if (event.type === "error") {
|
|
8463
|
-
this.rejectAuth(new Error("Agent websocket error before auth ack"));
|
|
8464
|
-
}
|
|
8465
|
-
this.broadcast(event);
|
|
8466
|
-
}
|
|
8467
|
-
handleIncomingMessage(message) {
|
|
8468
|
-
if (!message || typeof message !== "object") {
|
|
8469
|
-
return;
|
|
8470
|
-
}
|
|
8471
|
-
if (message.opcode === 3 /* ACK */) {
|
|
8472
|
-
const ack = message.body;
|
|
8473
|
-
const success = ack?.status === "ok";
|
|
8474
|
-
debugLog("[agent-connection-pool] ack received", {
|
|
8475
|
-
profileId: this.profileId,
|
|
8476
|
-
success
|
|
8477
|
-
});
|
|
8478
|
-
if (!success) {
|
|
8479
|
-
this.rejectAuth(new Error(ack?.message ?? ack?.code ?? "Auth failed"));
|
|
8480
|
-
return;
|
|
8481
|
-
}
|
|
8482
|
-
this.authenticated = true;
|
|
8483
|
-
this.resolveAuth();
|
|
8484
|
-
return;
|
|
8485
|
-
}
|
|
8486
|
-
debugLog("[agent-connection-pool] message broadcast", {
|
|
8487
|
-
opcode: message.opcode,
|
|
8488
|
-
from: message.from,
|
|
8489
|
-
to: message.to
|
|
8490
|
-
});
|
|
8491
|
-
this.broadcast({ type: "message", data: message });
|
|
8492
|
-
}
|
|
8493
|
-
broadcast(event) {
|
|
8494
|
-
for (const listener of this.listeners) {
|
|
8495
|
-
listener.onConnectionEvent(event);
|
|
8496
|
-
}
|
|
8497
|
-
}
|
|
8498
|
-
waitForConnection(timeoutMs) {
|
|
8499
|
-
if (this.ws.isConnected()) {
|
|
8500
|
-
return Promise.resolve();
|
|
8501
|
-
}
|
|
8502
|
-
return new Promise((resolve, reject) => {
|
|
8503
|
-
const timer = setTimeout(() => {
|
|
8504
|
-
off();
|
|
8505
|
-
reject(new Error("Websocket connect timeout"));
|
|
8506
|
-
}, timeoutMs);
|
|
8507
|
-
const off = this.createOneShotListener("connected" /* Connected */, (connected) => {
|
|
8508
|
-
if (connected) {
|
|
8509
|
-
clearTimeout(timer);
|
|
8510
|
-
off();
|
|
8511
|
-
resolve();
|
|
8512
|
-
}
|
|
8513
|
-
});
|
|
8514
|
-
});
|
|
8515
|
-
}
|
|
8516
|
-
waitForAuthAck(timeoutMs) {
|
|
8517
|
-
if (this.authenticated) {
|
|
8518
|
-
return Promise.resolve();
|
|
8519
|
-
}
|
|
8520
|
-
if (this.authPromise) {
|
|
8521
|
-
return this.authPromise;
|
|
8522
|
-
}
|
|
8523
|
-
this.authPromise = new Promise((resolve, reject) => {
|
|
8524
|
-
this.authResolve = resolve;
|
|
8525
|
-
this.authReject = reject;
|
|
8526
|
-
this.authTimer = setTimeout(() => {
|
|
8527
|
-
this.clearAuthWaiter();
|
|
8528
|
-
this.authStarted = false;
|
|
8529
|
-
reject(new Error("Auth timeout"));
|
|
8530
|
-
}, timeoutMs);
|
|
8531
|
-
});
|
|
8532
|
-
return this.authPromise;
|
|
8533
|
-
}
|
|
8534
|
-
resolveAuth() {
|
|
8535
|
-
if (!this.authResolve) {
|
|
8536
|
-
return;
|
|
8537
|
-
}
|
|
8538
|
-
const resolve = this.authResolve;
|
|
8539
|
-
this.clearAuthWaiter();
|
|
8540
|
-
this.authStarted = false;
|
|
8541
|
-
resolve();
|
|
8542
|
-
}
|
|
8543
|
-
rejectAuth(error) {
|
|
8544
|
-
if (!this.authReject) {
|
|
8545
|
-
return;
|
|
8546
|
-
}
|
|
8547
|
-
const reject = this.authReject;
|
|
8548
|
-
this.clearAuthWaiter();
|
|
8549
|
-
this.authStarted = false;
|
|
8550
|
-
reject(error);
|
|
8551
|
-
}
|
|
8552
|
-
clearAuthWaiter() {
|
|
8553
|
-
if (this.authTimer) {
|
|
8554
|
-
clearTimeout(this.authTimer);
|
|
8555
|
-
this.authTimer = null;
|
|
8556
|
-
}
|
|
8557
|
-
this.authPromise = null;
|
|
8558
|
-
this.authResolve = null;
|
|
8559
|
-
this.authReject = null;
|
|
8560
|
-
}
|
|
8561
|
-
createOneShotListener(eventName, handler) {
|
|
8562
|
-
const listener = {
|
|
8563
|
-
onConnectionEvent: (event) => {
|
|
8564
|
-
if (eventName === "connected" /* Connected */ && event.type === "connected") {
|
|
8565
|
-
;
|
|
8566
|
-
handler(event.data);
|
|
8567
|
-
}
|
|
8568
|
-
}
|
|
8569
|
-
};
|
|
8570
|
-
this.addListener(listener);
|
|
8571
|
-
return () => {
|
|
8572
|
-
this.removeListener(listener);
|
|
8573
|
-
};
|
|
8574
|
-
}
|
|
8575
|
-
};
|
|
8576
8673
|
}
|
|
8577
8674
|
});
|
|
8578
8675
|
|
|
8579
|
-
// node_modules
|
|
8676
|
+
// node_modules/@pmate/agent-sdk/dist/AgentTaskManager.js
|
|
8580
8677
|
var AgentTaskManager;
|
|
8581
8678
|
var init_AgentTaskManager = __esm({
|
|
8582
|
-
"node_modules
|
|
8679
|
+
"node_modules/@pmate/agent-sdk/dist/AgentTaskManager.js"() {
|
|
8583
8680
|
"use strict";
|
|
8584
|
-
|
|
8681
|
+
init_src4();
|
|
8585
8682
|
init_debug();
|
|
8586
8683
|
AgentTaskManager = class {
|
|
8587
8684
|
constructor() {
|
|
@@ -8748,20 +8845,13 @@ var init_AgentTaskManager = __esm({
|
|
|
8748
8845
|
}
|
|
8749
8846
|
});
|
|
8750
8847
|
|
|
8751
|
-
// node_modules
|
|
8752
|
-
function createAgentRequestBody(payload) {
|
|
8753
|
-
return {
|
|
8754
|
-
kind: "request",
|
|
8755
|
-
payload
|
|
8756
|
-
};
|
|
8757
|
-
}
|
|
8848
|
+
// node_modules/@pmate/agent-sdk/dist/AgentClient.js
|
|
8758
8849
|
var logger5, DEFAULT_TIMEOUT_MS, DEFAULT_STREAM_TIMEOUT_MS, DEFAULT_MIN_CHUNK_SIZE_BYTES, AgentClient;
|
|
8759
8850
|
var init_AgentClient = __esm({
|
|
8760
|
-
"node_modules
|
|
8851
|
+
"node_modules/@pmate/agent-sdk/dist/AgentClient.js"() {
|
|
8761
8852
|
"use strict";
|
|
8762
8853
|
init_src();
|
|
8763
|
-
|
|
8764
|
-
init_AgentConnectionPool();
|
|
8854
|
+
init_src4();
|
|
8765
8855
|
init_AgentTaskManager();
|
|
8766
8856
|
init_debug();
|
|
8767
8857
|
logger5 = Logger.getDebugger("AgentClient");
|
|
@@ -8772,6 +8862,11 @@ var init_AgentClient = __esm({
|
|
|
8772
8862
|
constructor(options) {
|
|
8773
8863
|
super();
|
|
8774
8864
|
this.tasks = new AgentTaskManager();
|
|
8865
|
+
this.authPromise = null;
|
|
8866
|
+
this.authResolve = null;
|
|
8867
|
+
this.authReject = null;
|
|
8868
|
+
this.authTimer = null;
|
|
8869
|
+
this.wsGeneration = 0;
|
|
8775
8870
|
this.defaultRequestType = "application/json";
|
|
8776
8871
|
this.defaultBinaryType = "application/octet-stream";
|
|
8777
8872
|
this.baseUrl = options.baseUrl;
|
|
@@ -8779,33 +8874,24 @@ var init_AgentClient = __esm({
|
|
|
8779
8874
|
this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
8780
8875
|
this.streamTimeoutMs = options.streamTimeoutMs ?? DEFAULT_STREAM_TIMEOUT_MS;
|
|
8781
8876
|
this.minChunkSizeBytes = options.minChunkSizeBytes ?? DEFAULT_MIN_CHUNK_SIZE_BYTES;
|
|
8877
|
+
this.resetWebsocket(this.baseUrl);
|
|
8782
8878
|
}
|
|
8783
8879
|
isConnected() {
|
|
8784
|
-
return this.
|
|
8880
|
+
return this.ws?.isConnected() ?? false;
|
|
8785
8881
|
}
|
|
8786
8882
|
close() {
|
|
8787
|
-
this.
|
|
8883
|
+
this.ws?.close();
|
|
8788
8884
|
}
|
|
8789
|
-
async login(options) {
|
|
8790
|
-
|
|
8791
|
-
if (!profileId) {
|
|
8792
|
-
throw new Error("AgentClient user auth requires profileId");
|
|
8793
|
-
}
|
|
8794
|
-
this.from = profileId;
|
|
8885
|
+
async login(from, options) {
|
|
8886
|
+
this.from = from;
|
|
8795
8887
|
const baseUrl = options?.baseUrl ?? this.baseUrl;
|
|
8888
|
+
if (baseUrl !== this.baseUrl) {
|
|
8889
|
+
this.resetWebsocket(baseUrl);
|
|
8890
|
+
}
|
|
8796
8891
|
const timeoutMs = options?.timeoutMs ?? this.timeoutMs;
|
|
8892
|
+
await this.waitForConnection(timeoutMs);
|
|
8797
8893
|
const token = options?.token ?? "";
|
|
8798
|
-
this.
|
|
8799
|
-
const lease = AgentConnectionPool.acquire({ baseUrl, token, profileId });
|
|
8800
|
-
if (this.lease?.key !== lease.key) {
|
|
8801
|
-
this.releaseConnection();
|
|
8802
|
-
this.lease = lease;
|
|
8803
|
-
this.lease.connection.addListener(this);
|
|
8804
|
-
} else {
|
|
8805
|
-
AgentConnectionPool.release(lease);
|
|
8806
|
-
}
|
|
8807
|
-
this.baseUrl = baseUrl;
|
|
8808
|
-
await this.lease.connection.authenticate(timeoutMs);
|
|
8894
|
+
await this.sendAuth(token, timeoutMs);
|
|
8809
8895
|
return true;
|
|
8810
8896
|
}
|
|
8811
8897
|
async prompt(request) {
|
|
@@ -8842,18 +8928,11 @@ var init_AgentClient = __esm({
|
|
|
8842
8928
|
taskId,
|
|
8843
8929
|
agentId: request.agentId,
|
|
8844
8930
|
op: 0 /* Start */,
|
|
8845
|
-
auth: this.auth,
|
|
8846
8931
|
type: this.defaultRequestType,
|
|
8847
8932
|
...request.payload ? { payload: request.payload } : {}
|
|
8848
8933
|
};
|
|
8849
|
-
const msg = Msg.create(this.from, hubTo,
|
|
8850
|
-
|
|
8851
|
-
taskId,
|
|
8852
|
-
agentId: request.agentId,
|
|
8853
|
-
from: this.from,
|
|
8854
|
-
to: hubTo
|
|
8855
|
-
});
|
|
8856
|
-
await this.lease.connection.sendMsg(msg);
|
|
8934
|
+
const msg = Msg.create(this.from, hubTo, 1002 /* AGENT_REQUEST */, startPayload, 0 /* PIPELINE */);
|
|
8935
|
+
await this.ws.sendMsg(msg);
|
|
8857
8936
|
return await waiter;
|
|
8858
8937
|
}
|
|
8859
8938
|
stream(request) {
|
|
@@ -8865,7 +8944,7 @@ var init_AgentClient = __esm({
|
|
|
8865
8944
|
timeoutMode: "reject"
|
|
8866
8945
|
});
|
|
8867
8946
|
const from = this.from;
|
|
8868
|
-
const
|
|
8947
|
+
const ws = this.ws;
|
|
8869
8948
|
const minChunkSizeBytes = request.minChunkSizeBytes ?? this.minChunkSizeBytes;
|
|
8870
8949
|
const inputStream = minChunkSizeBytes > 0 ? AsyncStream.chunkBlob(request.stream, {
|
|
8871
8950
|
minBytes: minChunkSizeBytes
|
|
@@ -8903,36 +8982,33 @@ var init_AgentClient = __esm({
|
|
|
8903
8982
|
const startDataStream = async () => {
|
|
8904
8983
|
const agent = await this.agentService.getAgentById(request.agentId);
|
|
8905
8984
|
const hubTo = `@hub/${agent.type}`;
|
|
8906
|
-
const startMsg = Msg.create(from, hubTo,
|
|
8985
|
+
const startMsg = Msg.create(from, hubTo, 1002 /* AGENT_REQUEST */, {
|
|
8907
8986
|
taskId,
|
|
8908
8987
|
agentId: request.agentId,
|
|
8909
8988
|
op: 0 /* Start */,
|
|
8910
|
-
auth: this.auth,
|
|
8911
8989
|
type: this.defaultRequestType,
|
|
8912
8990
|
...request.params ? { payload: request.params } : {}
|
|
8913
|
-
}
|
|
8914
|
-
await
|
|
8991
|
+
}, 0 /* PIPELINE */);
|
|
8992
|
+
await ws.sendMsg(startMsg);
|
|
8915
8993
|
for await (const payload of inputStream) {
|
|
8916
8994
|
const dataType = payload instanceof Blob ? payload.type || this.defaultBinaryType : payload instanceof Uint8Array || payload instanceof ArrayBuffer ? this.defaultBinaryType : typeof payload === "string" ? "text" : this.defaultRequestType;
|
|
8917
8995
|
const body = {
|
|
8918
8996
|
taskId,
|
|
8919
8997
|
agentId: request.agentId,
|
|
8920
8998
|
op: 1 /* Data */,
|
|
8921
|
-
auth: this.auth,
|
|
8922
8999
|
type: dataType,
|
|
8923
9000
|
payload
|
|
8924
9001
|
};
|
|
8925
|
-
const msg = Msg.create(from, hubTo,
|
|
8926
|
-
await
|
|
9002
|
+
const msg = Msg.create(from, hubTo, 1002 /* AGENT_REQUEST */, body, 0 /* PIPELINE */);
|
|
9003
|
+
await ws.sendMsg(msg);
|
|
8927
9004
|
}
|
|
8928
|
-
const endMsg = Msg.create(from, hubTo,
|
|
9005
|
+
const endMsg = Msg.create(from, hubTo, 1002 /* AGENT_REQUEST */, {
|
|
8929
9006
|
taskId,
|
|
8930
9007
|
agentId: request.agentId,
|
|
8931
9008
|
op: 2 /* End */,
|
|
8932
|
-
auth: this.auth,
|
|
8933
9009
|
type: this.defaultRequestType
|
|
8934
|
-
}
|
|
8935
|
-
await
|
|
9010
|
+
}, 0 /* PIPELINE */);
|
|
9011
|
+
await ws.sendMsg(endMsg);
|
|
8936
9012
|
};
|
|
8937
9013
|
void startDataStream();
|
|
8938
9014
|
const agentStream = outputStream;
|
|
@@ -8983,7 +9059,7 @@ var init_AgentClient = __esm({
|
|
|
8983
9059
|
return agentStream;
|
|
8984
9060
|
}
|
|
8985
9061
|
ensureReady() {
|
|
8986
|
-
if (!this.
|
|
9062
|
+
if (!this.ws || !this.from) {
|
|
8987
9063
|
throw new Error("AgentClient not logged in");
|
|
8988
9064
|
}
|
|
8989
9065
|
}
|
|
@@ -8991,7 +9067,31 @@ var init_AgentClient = __esm({
|
|
|
8991
9067
|
const rnd = Math.floor(Math.random() * 1e12);
|
|
8992
9068
|
return uniqHash(`${agentId}-${Date.now()}-${rnd}`, "task-v1" /* Task */);
|
|
8993
9069
|
}
|
|
8994
|
-
|
|
9070
|
+
createWebsocketClient(baseUrl) {
|
|
9071
|
+
return new WebsocketClientV2(this.ensureProtocol(baseUrl, "wss"));
|
|
9072
|
+
}
|
|
9073
|
+
resetWebsocket(baseUrl) {
|
|
9074
|
+
this.baseUrl = baseUrl;
|
|
9075
|
+
if (this.ws) {
|
|
9076
|
+
this.ws.close();
|
|
9077
|
+
}
|
|
9078
|
+
this.ws = this.createWebsocketClient(this.baseUrl);
|
|
9079
|
+
this.wsGeneration += 1;
|
|
9080
|
+
this.startWsStream(this.ws, this.wsGeneration);
|
|
9081
|
+
}
|
|
9082
|
+
async startWsStream(ws, generation) {
|
|
9083
|
+
const stream = ws.getStream();
|
|
9084
|
+
try {
|
|
9085
|
+
for await (const event of stream) {
|
|
9086
|
+
if (generation !== this.wsGeneration) {
|
|
9087
|
+
break;
|
|
9088
|
+
}
|
|
9089
|
+
this.handleWsEvent(event);
|
|
9090
|
+
}
|
|
9091
|
+
} catch {
|
|
9092
|
+
}
|
|
9093
|
+
}
|
|
9094
|
+
handleWsEvent(event) {
|
|
8995
9095
|
if (event.type === "message") {
|
|
8996
9096
|
this.handleIncomingMessage(event.data);
|
|
8997
9097
|
return;
|
|
@@ -9012,13 +9112,14 @@ var init_AgentClient = __esm({
|
|
|
9012
9112
|
if (!message || typeof message !== "object") {
|
|
9013
9113
|
return;
|
|
9014
9114
|
}
|
|
9015
|
-
if (message.opcode ===
|
|
9016
|
-
const
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
|
|
9115
|
+
if (message.opcode === 1001 /* AUTH_ACK */) {
|
|
9116
|
+
const success = Boolean(message.body?.success);
|
|
9117
|
+
this.resolveAuth(success);
|
|
9118
|
+
return;
|
|
9119
|
+
}
|
|
9120
|
+
if (message.opcode === 1003 /* AGENT_RESPONSE */) {
|
|
9121
|
+
const body = message.body;
|
|
9122
|
+
debugLog("[agent-client] incoming AGENT_RESPONSE", {
|
|
9022
9123
|
taskId: body?.taskId,
|
|
9023
9124
|
isFinal: body?.isFinal,
|
|
9024
9125
|
success: body?.success,
|
|
@@ -9026,78 +9127,151 @@ var init_AgentClient = __esm({
|
|
|
9026
9127
|
contentEncoding: body?.contentEncoding,
|
|
9027
9128
|
payloadKind: body?.payload == null ? "null" : body.payload instanceof Uint8Array ? `uint8array:${body.payload.length}` : Array.isArray(body.payload) ? `array:${body.payload.length}` : typeof body.payload
|
|
9028
9129
|
});
|
|
9029
|
-
this.tasks.handleResponse(body);
|
|
9130
|
+
this.tasks.handleResponse(message.body);
|
|
9131
|
+
}
|
|
9132
|
+
}
|
|
9133
|
+
ensureProtocol(value, protocol) {
|
|
9134
|
+
if (!value) {
|
|
9135
|
+
return "";
|
|
9136
|
+
}
|
|
9137
|
+
if (/^[a-z]+:\/\//i.test(value)) {
|
|
9138
|
+
try {
|
|
9139
|
+
const url = new URL(value);
|
|
9140
|
+
url.protocol = `${protocol}:`;
|
|
9141
|
+
return url.toString();
|
|
9142
|
+
} catch {
|
|
9143
|
+
return value;
|
|
9144
|
+
}
|
|
9145
|
+
}
|
|
9146
|
+
if (value.startsWith("//")) {
|
|
9147
|
+
return `${protocol}:${value}`;
|
|
9148
|
+
}
|
|
9149
|
+
return `${protocol}://${value}`;
|
|
9150
|
+
}
|
|
9151
|
+
waitForConnection(timeoutMs) {
|
|
9152
|
+
if (!this.ws) {
|
|
9153
|
+
return Promise.reject(new Error("Websocket client not initialized"));
|
|
9154
|
+
}
|
|
9155
|
+
if (this.ws.isConnected()) {
|
|
9156
|
+
return Promise.resolve();
|
|
9157
|
+
}
|
|
9158
|
+
return new Promise((resolve, reject) => {
|
|
9159
|
+
const timer = setTimeout(() => {
|
|
9160
|
+
off();
|
|
9161
|
+
reject(new Error("Websocket connect timeout"));
|
|
9162
|
+
}, timeoutMs);
|
|
9163
|
+
const off = this.on("connected" /* Connected */, (connected) => {
|
|
9164
|
+
if (connected) {
|
|
9165
|
+
clearTimeout(timer);
|
|
9166
|
+
off();
|
|
9167
|
+
resolve();
|
|
9168
|
+
}
|
|
9169
|
+
});
|
|
9170
|
+
});
|
|
9171
|
+
}
|
|
9172
|
+
async sendAuth(token, timeoutMs) {
|
|
9173
|
+
if (!this.ws || !this.from) {
|
|
9174
|
+
throw new Error("AgentClient not initialized");
|
|
9175
|
+
}
|
|
9176
|
+
const msg = Msg.create(this.from, "@hub", 1e3 /* AUTH */, { token, as: "user" });
|
|
9177
|
+
const waiter = this.waitForAuthAck(timeoutMs);
|
|
9178
|
+
await this.ws.sendMsg(msg);
|
|
9179
|
+
const success = await waiter;
|
|
9180
|
+
if (!success) {
|
|
9181
|
+
throw new Error("Auth failed");
|
|
9182
|
+
}
|
|
9183
|
+
}
|
|
9184
|
+
waitForAuthAck(timeoutMs) {
|
|
9185
|
+
if (this.authPromise) {
|
|
9186
|
+
return this.authPromise;
|
|
9030
9187
|
}
|
|
9188
|
+
this.authPromise = new Promise((resolve, reject) => {
|
|
9189
|
+
this.authResolve = resolve;
|
|
9190
|
+
this.authReject = reject;
|
|
9191
|
+
this.authTimer = setTimeout(() => {
|
|
9192
|
+
this.clearAuthWaiter();
|
|
9193
|
+
reject(new Error("Auth timeout"));
|
|
9194
|
+
}, timeoutMs);
|
|
9195
|
+
});
|
|
9196
|
+
return this.authPromise;
|
|
9031
9197
|
}
|
|
9032
|
-
|
|
9033
|
-
if (!this.
|
|
9198
|
+
resolveAuth(success) {
|
|
9199
|
+
if (!this.authResolve) {
|
|
9034
9200
|
return;
|
|
9035
9201
|
}
|
|
9036
|
-
this.
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9202
|
+
const resolve = this.authResolve;
|
|
9203
|
+
this.clearAuthWaiter();
|
|
9204
|
+
resolve(success);
|
|
9205
|
+
}
|
|
9206
|
+
clearAuthWaiter() {
|
|
9207
|
+
if (this.authTimer) {
|
|
9208
|
+
clearTimeout(this.authTimer);
|
|
9209
|
+
this.authTimer = null;
|
|
9210
|
+
}
|
|
9211
|
+
this.authPromise = null;
|
|
9212
|
+
this.authResolve = null;
|
|
9213
|
+
this.authReject = null;
|
|
9040
9214
|
}
|
|
9041
9215
|
};
|
|
9042
9216
|
}
|
|
9043
9217
|
});
|
|
9044
9218
|
|
|
9045
|
-
// node_modules
|
|
9219
|
+
// node_modules/@pmate/agent-sdk/dist/AgentRuntime.js
|
|
9046
9220
|
var init_AgentRuntime = __esm({
|
|
9047
|
-
"node_modules
|
|
9221
|
+
"node_modules/@pmate/agent-sdk/dist/AgentRuntime.js"() {
|
|
9048
9222
|
"use strict";
|
|
9049
9223
|
init_src();
|
|
9050
|
-
|
|
9224
|
+
init_src4();
|
|
9051
9225
|
}
|
|
9052
9226
|
});
|
|
9053
9227
|
|
|
9054
|
-
// node_modules
|
|
9228
|
+
// node_modules/@pmate/agent-sdk/dist/PromptTaskContext.js
|
|
9055
9229
|
var init_PromptTaskContext = __esm({
|
|
9056
|
-
"node_modules
|
|
9230
|
+
"node_modules/@pmate/agent-sdk/dist/PromptTaskContext.js"() {
|
|
9057
9231
|
"use strict";
|
|
9058
9232
|
}
|
|
9059
9233
|
});
|
|
9060
9234
|
|
|
9061
|
-
// node_modules
|
|
9235
|
+
// node_modules/@pmate/agent-sdk/dist/PromptAgent.js
|
|
9062
9236
|
var init_PromptAgent = __esm({
|
|
9063
|
-
"node_modules
|
|
9237
|
+
"node_modules/@pmate/agent-sdk/dist/PromptAgent.js"() {
|
|
9064
9238
|
"use strict";
|
|
9065
9239
|
init_src();
|
|
9066
|
-
|
|
9240
|
+
init_src4();
|
|
9067
9241
|
init_debug();
|
|
9068
9242
|
init_AgentRuntime();
|
|
9069
9243
|
init_PromptTaskContext();
|
|
9070
9244
|
}
|
|
9071
9245
|
});
|
|
9072
9246
|
|
|
9073
|
-
// node_modules
|
|
9247
|
+
// node_modules/@pmate/agent-sdk/dist/StreamTaskContext.js
|
|
9074
9248
|
var init_StreamTaskContext = __esm({
|
|
9075
|
-
"node_modules
|
|
9249
|
+
"node_modules/@pmate/agent-sdk/dist/StreamTaskContext.js"() {
|
|
9076
9250
|
"use strict";
|
|
9077
9251
|
}
|
|
9078
9252
|
});
|
|
9079
9253
|
|
|
9080
|
-
// node_modules
|
|
9254
|
+
// node_modules/@pmate/agent-sdk/dist/StreamAgent.js
|
|
9081
9255
|
var init_StreamAgent = __esm({
|
|
9082
|
-
"node_modules
|
|
9256
|
+
"node_modules/@pmate/agent-sdk/dist/StreamAgent.js"() {
|
|
9083
9257
|
"use strict";
|
|
9084
9258
|
init_src();
|
|
9085
|
-
|
|
9259
|
+
init_src4();
|
|
9086
9260
|
init_AgentRuntime();
|
|
9087
9261
|
init_StreamTaskContext();
|
|
9088
9262
|
}
|
|
9089
9263
|
});
|
|
9090
9264
|
|
|
9091
|
-
// node_modules
|
|
9265
|
+
// node_modules/@pmate/agent-sdk/dist/AgentFactory.js
|
|
9092
9266
|
var init_AgentFactory = __esm({
|
|
9093
|
-
"node_modules
|
|
9267
|
+
"node_modules/@pmate/agent-sdk/dist/AgentFactory.js"() {
|
|
9094
9268
|
"use strict";
|
|
9095
9269
|
init_PromptAgent();
|
|
9096
9270
|
init_StreamAgent();
|
|
9097
9271
|
}
|
|
9098
9272
|
});
|
|
9099
9273
|
|
|
9100
|
-
// node_modules
|
|
9274
|
+
// node_modules/@pmate/agent-sdk/dist/AgentService.js
|
|
9101
9275
|
function parseAgentId(agentId) {
|
|
9102
9276
|
const separatorIndex = agentId.indexOf(":");
|
|
9103
9277
|
if (separatorIndex <= 0 || separatorIndex === agentId.length - 1) {
|
|
@@ -9127,7 +9301,7 @@ function trimTrailingSlash(value) {
|
|
|
9127
9301
|
}
|
|
9128
9302
|
var AgentService;
|
|
9129
9303
|
var init_AgentService = __esm({
|
|
9130
|
-
"node_modules
|
|
9304
|
+
"node_modules/@pmate/agent-sdk/dist/AgentService.js"() {
|
|
9131
9305
|
"use strict";
|
|
9132
9306
|
AgentService = class {
|
|
9133
9307
|
constructor(options) {
|
|
@@ -9168,9 +9342,9 @@ var init_AgentService = __esm({
|
|
|
9168
9342
|
}
|
|
9169
9343
|
});
|
|
9170
9344
|
|
|
9171
|
-
// node_modules
|
|
9345
|
+
// node_modules/@pmate/agent-sdk/dist/index.js
|
|
9172
9346
|
var init_dist2 = __esm({
|
|
9173
|
-
"node_modules
|
|
9347
|
+
"node_modules/@pmate/agent-sdk/dist/index.js"() {
|
|
9174
9348
|
"use strict";
|
|
9175
9349
|
init_AgentClient();
|
|
9176
9350
|
init_AgentFactory();
|
|
@@ -9180,7 +9354,7 @@ var init_dist2 = __esm({
|
|
|
9180
9354
|
init_AgentTaskManager();
|
|
9181
9355
|
init_AgentService();
|
|
9182
9356
|
init_debug();
|
|
9183
|
-
|
|
9357
|
+
init_src4();
|
|
9184
9358
|
}
|
|
9185
9359
|
});
|
|
9186
9360
|
|
|
@@ -10417,9 +10591,13 @@ var AliyunService = class {
|
|
|
10417
10591
|
const relativePath = import_node_path4.default.relative(localDir, filePath);
|
|
10418
10592
|
const objectKey = this.toObjectKey(normalizedPrefix, relativePath);
|
|
10419
10593
|
const contentType = this.getContentType(filePath);
|
|
10420
|
-
const
|
|
10594
|
+
const cacheControl = this.getStaticAssetCacheControl(relativePath);
|
|
10595
|
+
const headers = {};
|
|
10596
|
+
if (contentType) headers["Content-Type"] = contentType;
|
|
10597
|
+
if (cacheControl) headers["Cache-Control"] = cacheControl;
|
|
10598
|
+
const options = Object.keys(headers).length > 0 ? { headers } : void 0;
|
|
10421
10599
|
const existing = existingMap.get(objectKey);
|
|
10422
|
-
if (existing && typeof existing.size === "number") {
|
|
10600
|
+
if (existing && typeof existing.size === "number" && !cacheControl) {
|
|
10423
10601
|
const stat = await import_node_fs3.promises.stat(filePath);
|
|
10424
10602
|
if (stat.size === existing.size) {
|
|
10425
10603
|
const etag = this.normalizeEtag(existing.etag);
|
|
@@ -10450,7 +10628,11 @@ var AliyunService = class {
|
|
|
10450
10628
|
}
|
|
10451
10629
|
const client = new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket });
|
|
10452
10630
|
const contentType = this.getContentType(localFile);
|
|
10453
|
-
const
|
|
10631
|
+
const cacheControl = this.getStaticAssetCacheControl(objectKey);
|
|
10632
|
+
const headers = {};
|
|
10633
|
+
if (contentType) headers["Content-Type"] = contentType;
|
|
10634
|
+
if (cacheControl) headers["Cache-Control"] = cacheControl;
|
|
10635
|
+
const options = Object.keys(headers).length > 0 ? { headers } : void 0;
|
|
10454
10636
|
await client.put(objectKey, localFile, options);
|
|
10455
10637
|
ui.success(`Uploaded ${objectKey}`);
|
|
10456
10638
|
}
|
|
@@ -10887,6 +11069,17 @@ var AliyunService = class {
|
|
|
10887
11069
|
return void 0;
|
|
10888
11070
|
}
|
|
10889
11071
|
}
|
|
11072
|
+
static getStaticAssetCacheControl(filePath) {
|
|
11073
|
+
const normalized = filePath.replace(/\\/g, "/");
|
|
11074
|
+
const base = import_node_path4.default.posix.basename(normalized).toLowerCase();
|
|
11075
|
+
if (base === "index.html" || base === "200.html" || base === "404.html") {
|
|
11076
|
+
return "no-cache, no-store, must-revalidate";
|
|
11077
|
+
}
|
|
11078
|
+
if (/[.-][a-z0-9_-]{8,}\./i.test(base)) {
|
|
11079
|
+
return "public, max-age=31536000, immutable";
|
|
11080
|
+
}
|
|
11081
|
+
return void 0;
|
|
11082
|
+
}
|
|
10890
11083
|
static buildFcPathConfig(input) {
|
|
10891
11084
|
return new import_fc20230330.PathConfig({
|
|
10892
11085
|
path: input.routePath ?? "/*",
|
|
@@ -18384,10 +18577,7 @@ var ServiceRegistryClient = class {
|
|
|
18384
18577
|
{
|
|
18385
18578
|
stage: options.stage,
|
|
18386
18579
|
...options.branch ? { branch: options.branch } : {},
|
|
18387
|
-
...options.includeSecretValue ? { includeSecretValue: true } : {}
|
|
18388
|
-
...options.includeHost === false ? { includeHost: false } : {},
|
|
18389
|
-
...options.hostId ? { hostId: options.hostId } : {},
|
|
18390
|
-
...options.hostTarget ? { hostTarget: options.hostTarget } : {}
|
|
18580
|
+
...options.includeSecretValue ? { includeSecretValue: true } : {}
|
|
18391
18581
|
}
|
|
18392
18582
|
);
|
|
18393
18583
|
}
|
|
@@ -18427,9 +18617,6 @@ var ServiceRegistryClient = class {
|
|
|
18427
18617
|
body: JSON.stringify({
|
|
18428
18618
|
stage: options.stage,
|
|
18429
18619
|
...options.branch ? { branch: options.branch } : {},
|
|
18430
|
-
...options.includeHost === false ? { includeHost: false } : {},
|
|
18431
|
-
...options.hostId ? { hostId: options.hostId } : {},
|
|
18432
|
-
...options.hostTarget ? { hostTarget: options.hostTarget } : {},
|
|
18433
18620
|
format: options.format
|
|
18434
18621
|
})
|
|
18435
18622
|
});
|
|
@@ -18950,7 +19137,7 @@ var ServiceRuntimeRunner = class {
|
|
|
18950
19137
|
`pkg="${appDir}/package.json"`,
|
|
18951
19138
|
`if [ -f "$pkg" ] && node -e 'const fs=require("node:fs"); const p=JSON.parse(fs.readFileSync(process.argv[1],"utf8")); process.exit(p?.scripts?.build ? 0 : 1);' "$pkg"; then (cd "${appDir}" && pnpm run build); fi`
|
|
18952
19139
|
].join("; ");
|
|
18953
|
-
const envSyncCommand = await this.buildNodeEnvSyncCommand(service.id, appDir, options.envName
|
|
19140
|
+
const envSyncCommand = await this.buildNodeEnvSyncCommand(service.id, appDir, options.envName);
|
|
18954
19141
|
const command = [
|
|
18955
19142
|
`cd "$HOME"`,
|
|
18956
19143
|
`[ -d "${repoDir}/.git" ] || git clone "${gitUrl}" "${repoDir}"`,
|
|
@@ -18968,17 +19155,13 @@ var ServiceRuntimeRunner = class {
|
|
|
18968
19155
|
].join(" && ");
|
|
18969
19156
|
await this.runRemoteCommand(server, command);
|
|
18970
19157
|
}
|
|
18971
|
-
async buildNodeEnvSyncCommand(serviceId, appDir, envName = "prod"
|
|
19158
|
+
async buildNodeEnvSyncCommand(serviceId, appDir, envName = "prod") {
|
|
18972
19159
|
if (!this.envProvider) {
|
|
18973
19160
|
return void 0;
|
|
18974
19161
|
}
|
|
18975
19162
|
let pulled;
|
|
18976
19163
|
try {
|
|
18977
|
-
pulled = await this.envProvider(serviceId, {
|
|
18978
|
-
stage: this.envNameToStage(envName),
|
|
18979
|
-
format: "dotenv",
|
|
18980
|
-
...hostTarget ? { hostTarget } : {}
|
|
18981
|
-
});
|
|
19164
|
+
pulled = await this.envProvider(serviceId, { stage: this.envNameToStage(envName), format: "dotenv" });
|
|
18982
19165
|
} catch (error) {
|
|
18983
19166
|
if (error instanceof ServiceEnvNotFoundError) {
|
|
18984
19167
|
ui.warn(`No env found for ${serviceId}; skipping .env.local sync.`);
|
|
@@ -19019,7 +19202,7 @@ var ServiceRuntimeRunner = class {
|
|
|
19019
19202
|
const gitUrl = this.withToken(repoUrl);
|
|
19020
19203
|
const scriptPath = script.startsWith("/") || script.startsWith("./") ? script : `./${script}`;
|
|
19021
19204
|
const envName = options.envName ?? "prod";
|
|
19022
|
-
const envSyncCommand = await this.buildScriptEnvSyncCommand(service.id, envName
|
|
19205
|
+
const envSyncCommand = await this.buildScriptEnvSyncCommand(service.id, envName);
|
|
19023
19206
|
const command = [
|
|
19024
19207
|
`cd "$HOME"`,
|
|
19025
19208
|
`[ -d "${repoDir}/.git" ] || git clone "${gitUrl}" "${repoDir}"`,
|
|
@@ -19051,7 +19234,7 @@ var ServiceRuntimeRunner = class {
|
|
|
19051
19234
|
const repoDir = this.getRepoDirName(repository);
|
|
19052
19235
|
const scriptPath = script.startsWith("/") || script.startsWith("./") ? script : `./${script}`;
|
|
19053
19236
|
const envName = options.envName ?? "prod";
|
|
19054
|
-
const envSyncCommand = await this.buildScriptEnvSyncCommand(service.id, envName
|
|
19237
|
+
const envSyncCommand = await this.buildScriptEnvSyncCommand(service.id, envName);
|
|
19055
19238
|
const command = [
|
|
19056
19239
|
`cd "$HOME"`,
|
|
19057
19240
|
`cd "${repoDir}"`,
|
|
@@ -19062,17 +19245,13 @@ var ServiceRuntimeRunner = class {
|
|
|
19062
19245
|
].join(" && ");
|
|
19063
19246
|
await this.runRemoteCommand(server, command);
|
|
19064
19247
|
}
|
|
19065
|
-
async buildScriptEnvSyncCommand(serviceId, envName
|
|
19248
|
+
async buildScriptEnvSyncCommand(serviceId, envName) {
|
|
19066
19249
|
if (!this.envProvider) {
|
|
19067
19250
|
return void 0;
|
|
19068
19251
|
}
|
|
19069
19252
|
let pulled;
|
|
19070
19253
|
try {
|
|
19071
|
-
pulled = await this.envProvider(serviceId, {
|
|
19072
|
-
stage: this.envNameToStage(envName),
|
|
19073
|
-
format: "dotenv",
|
|
19074
|
-
...hostTarget ? { hostTarget } : {}
|
|
19075
|
-
});
|
|
19254
|
+
pulled = await this.envProvider(serviceId, { stage: this.envNameToStage(envName), format: "dotenv" });
|
|
19076
19255
|
} catch (error) {
|
|
19077
19256
|
if (error instanceof ServiceEnvNotFoundError) {
|
|
19078
19257
|
ui.warn(`No env found for ${serviceId}; skipping PMate env file sync.`);
|