@pmate/cli 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +17 -0
- package/dist/index.js +1664 -450
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -293,160 +293,157 @@ 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
|
|
331
|
+
// node_modules/@pmate/meta/src/types/runner-registry.types.ts
|
|
332
332
|
var init_runner_registry_types = __esm({
|
|
333
|
-
"node_modules
|
|
333
|
+
"node_modules/@pmate/meta/src/types/runner-registry.types.ts"() {
|
|
334
334
|
"use strict";
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
337
|
|
|
338
|
-
// node_modules
|
|
338
|
+
// node_modules/@pmate/meta/src/types/blockchain.types.ts
|
|
339
339
|
var init_blockchain_types = __esm({
|
|
340
|
-
"node_modules
|
|
340
|
+
"node_modules/@pmate/meta/src/types/blockchain.types.ts"() {
|
|
341
341
|
"use strict";
|
|
342
342
|
}
|
|
343
343
|
});
|
|
344
344
|
|
|
345
|
-
// node_modules
|
|
345
|
+
// node_modules/@pmate/meta/src/types/breakdown.types.ts
|
|
346
346
|
var init_breakdown_types = __esm({
|
|
347
|
-
"node_modules
|
|
347
|
+
"node_modules/@pmate/meta/src/types/breakdown.types.ts"() {
|
|
348
348
|
"use strict";
|
|
349
349
|
}
|
|
350
350
|
});
|
|
351
351
|
|
|
352
|
-
// node_modules
|
|
352
|
+
// node_modules/@pmate/meta/src/types/chat.types.ts
|
|
353
353
|
var init_chat_types = __esm({
|
|
354
|
-
"node_modules
|
|
354
|
+
"node_modules/@pmate/meta/src/types/chat.types.ts"() {
|
|
355
355
|
"use strict";
|
|
356
356
|
}
|
|
357
357
|
});
|
|
358
358
|
|
|
359
|
-
// node_modules
|
|
359
|
+
// node_modules/@pmate/meta/src/types/companion.types.ts
|
|
360
360
|
var init_companion_types = __esm({
|
|
361
|
-
"node_modules
|
|
361
|
+
"node_modules/@pmate/meta/src/types/companion.types.ts"() {
|
|
362
362
|
"use strict";
|
|
363
363
|
}
|
|
364
364
|
});
|
|
365
365
|
|
|
366
|
-
// node_modules
|
|
366
|
+
// node_modules/@pmate/meta/src/types/enums.ts
|
|
367
367
|
var init_enums = __esm({
|
|
368
|
-
"node_modules
|
|
368
|
+
"node_modules/@pmate/meta/src/types/enums.ts"() {
|
|
369
369
|
"use strict";
|
|
370
370
|
}
|
|
371
371
|
});
|
|
372
372
|
|
|
373
|
-
// node_modules
|
|
373
|
+
// node_modules/@pmate/meta/src/types/lang.types.ts
|
|
374
374
|
var init_lang_types = __esm({
|
|
375
|
-
"node_modules
|
|
375
|
+
"node_modules/@pmate/meta/src/types/lang.types.ts"() {
|
|
376
376
|
"use strict";
|
|
377
377
|
}
|
|
378
378
|
});
|
|
379
379
|
|
|
380
|
-
// node_modules
|
|
380
|
+
// node_modules/@pmate/meta/src/types/logs.types.ts
|
|
381
381
|
var init_logs_types = __esm({
|
|
382
|
-
"node_modules
|
|
382
|
+
"node_modules/@pmate/meta/src/types/logs.types.ts"() {
|
|
383
383
|
"use strict";
|
|
384
384
|
}
|
|
385
385
|
});
|
|
386
386
|
|
|
387
|
-
// node_modules
|
|
388
|
-
var PING, PONG;
|
|
387
|
+
// node_modules/@pmate/meta/src/types/message.types.ts
|
|
389
388
|
var init_message_types = __esm({
|
|
390
|
-
"node_modules
|
|
389
|
+
"node_modules/@pmate/meta/src/types/message.types.ts"() {
|
|
391
390
|
"use strict";
|
|
392
|
-
PING = 1;
|
|
393
|
-
PONG = 2;
|
|
394
391
|
}
|
|
395
392
|
});
|
|
396
393
|
|
|
397
|
-
// node_modules
|
|
394
|
+
// node_modules/@pmate/meta/src/types/newLog.types.ts
|
|
398
395
|
var init_newLog_types = __esm({
|
|
399
|
-
"node_modules
|
|
396
|
+
"node_modules/@pmate/meta/src/types/newLog.types.ts"() {
|
|
400
397
|
"use strict";
|
|
401
398
|
}
|
|
402
399
|
});
|
|
403
400
|
|
|
404
|
-
// node_modules
|
|
401
|
+
// node_modules/@pmate/meta/src/types/novel.types.ts
|
|
405
402
|
var init_novel_types = __esm({
|
|
406
|
-
"node_modules
|
|
403
|
+
"node_modules/@pmate/meta/src/types/novel.types.ts"() {
|
|
407
404
|
"use strict";
|
|
408
405
|
}
|
|
409
406
|
});
|
|
410
407
|
|
|
411
|
-
// node_modules
|
|
408
|
+
// node_modules/@pmate/meta/src/types/offline.types.ts
|
|
412
409
|
var init_offline_types = __esm({
|
|
413
|
-
"node_modules
|
|
410
|
+
"node_modules/@pmate/meta/src/types/offline.types.ts"() {
|
|
414
411
|
"use strict";
|
|
415
412
|
}
|
|
416
413
|
});
|
|
417
414
|
|
|
418
|
-
// node_modules
|
|
415
|
+
// node_modules/@pmate/meta/src/types/prompt.types.ts
|
|
419
416
|
var init_prompt_types = __esm({
|
|
420
|
-
"node_modules
|
|
417
|
+
"node_modules/@pmate/meta/src/types/prompt.types.ts"() {
|
|
421
418
|
"use strict";
|
|
422
419
|
}
|
|
423
420
|
});
|
|
424
421
|
|
|
425
|
-
// node_modules
|
|
422
|
+
// node_modules/@pmate/meta/src/types/reading.types.ts
|
|
426
423
|
var init_reading_types = __esm({
|
|
427
|
-
"node_modules
|
|
424
|
+
"node_modules/@pmate/meta/src/types/reading.types.ts"() {
|
|
428
425
|
"use strict";
|
|
429
426
|
}
|
|
430
427
|
});
|
|
431
428
|
|
|
432
|
-
// node_modules
|
|
429
|
+
// node_modules/@pmate/meta/src/types/settings.types.ts
|
|
433
430
|
var init_settings_types = __esm({
|
|
434
|
-
"node_modules
|
|
431
|
+
"node_modules/@pmate/meta/src/types/settings.types.ts"() {
|
|
435
432
|
"use strict";
|
|
436
433
|
}
|
|
437
434
|
});
|
|
438
435
|
|
|
439
|
-
// node_modules
|
|
436
|
+
// node_modules/@pmate/meta/src/types/subscription.types.ts
|
|
440
437
|
var init_subscription_types = __esm({
|
|
441
|
-
"node_modules
|
|
438
|
+
"node_modules/@pmate/meta/src/types/subscription.types.ts"() {
|
|
442
439
|
"use strict";
|
|
443
440
|
}
|
|
444
441
|
});
|
|
445
442
|
|
|
446
|
-
// node_modules
|
|
443
|
+
// node_modules/@pmate/meta/src/types/types.ts
|
|
447
444
|
var buildVoiceKey, createVoice;
|
|
448
445
|
var init_types = __esm({
|
|
449
|
-
"node_modules
|
|
446
|
+
"node_modules/@pmate/meta/src/types/types.ts"() {
|
|
450
447
|
"use strict";
|
|
451
448
|
buildVoiceKey = (provider, name) => {
|
|
452
449
|
return `${provider}:${name}`;
|
|
@@ -468,44 +465,44 @@ var init_types = __esm({
|
|
|
468
465
|
}
|
|
469
466
|
});
|
|
470
467
|
|
|
471
|
-
// node_modules
|
|
468
|
+
// node_modules/@pmate/meta/src/types/wordv5.def.ts
|
|
472
469
|
var init_wordv5_def = __esm({
|
|
473
|
-
"node_modules
|
|
470
|
+
"node_modules/@pmate/meta/src/types/wordv5.def.ts"() {
|
|
474
471
|
"use strict";
|
|
475
472
|
}
|
|
476
473
|
});
|
|
477
474
|
|
|
478
|
-
// node_modules
|
|
475
|
+
// node_modules/@pmate/meta/src/types/auth.types.ts
|
|
479
476
|
var init_auth_types = __esm({
|
|
480
|
-
"node_modules
|
|
477
|
+
"node_modules/@pmate/meta/src/types/auth.types.ts"() {
|
|
481
478
|
"use strict";
|
|
482
479
|
}
|
|
483
480
|
});
|
|
484
481
|
|
|
485
|
-
// node_modules
|
|
482
|
+
// node_modules/@pmate/meta/src/types/apps.types.ts
|
|
486
483
|
var init_apps_types = __esm({
|
|
487
|
-
"node_modules
|
|
484
|
+
"node_modules/@pmate/meta/src/types/apps.types.ts"() {
|
|
488
485
|
"use strict";
|
|
489
486
|
}
|
|
490
487
|
});
|
|
491
488
|
|
|
492
|
-
// node_modules
|
|
489
|
+
// node_modules/@pmate/meta/src/types/response.types.ts
|
|
493
490
|
var init_response_types = __esm({
|
|
494
|
-
"node_modules
|
|
491
|
+
"node_modules/@pmate/meta/src/types/response.types.ts"() {
|
|
495
492
|
"use strict";
|
|
496
493
|
}
|
|
497
494
|
});
|
|
498
495
|
|
|
499
|
-
// node_modules
|
|
496
|
+
// node_modules/@pmate/meta/src/types/role.types.ts
|
|
500
497
|
var init_role_types = __esm({
|
|
501
|
-
"node_modules
|
|
498
|
+
"node_modules/@pmate/meta/src/types/role.types.ts"() {
|
|
502
499
|
"use strict";
|
|
503
500
|
}
|
|
504
501
|
});
|
|
505
502
|
|
|
506
|
-
// node_modules
|
|
503
|
+
// node_modules/@pmate/meta/src/types/index.ts
|
|
507
504
|
var init_types2 = __esm({
|
|
508
|
-
"node_modules
|
|
505
|
+
"node_modules/@pmate/meta/src/types/index.ts"() {
|
|
509
506
|
"use strict";
|
|
510
507
|
init_account_types();
|
|
511
508
|
init_achievements_types();
|
|
@@ -537,24 +534,24 @@ var init_types2 = __esm({
|
|
|
537
534
|
}
|
|
538
535
|
});
|
|
539
536
|
|
|
540
|
-
// node_modules
|
|
537
|
+
// node_modules/@pmate/meta/src/config/BizErrorCode.ts
|
|
541
538
|
var init_BizErrorCode = __esm({
|
|
542
|
-
"node_modules
|
|
539
|
+
"node_modules/@pmate/meta/src/config/BizErrorCode.ts"() {
|
|
543
540
|
"use strict";
|
|
544
541
|
}
|
|
545
542
|
});
|
|
546
543
|
|
|
547
|
-
// node_modules
|
|
544
|
+
// node_modules/@pmate/meta/src/config/consts.ts
|
|
548
545
|
var init_consts = __esm({
|
|
549
|
-
"node_modules
|
|
546
|
+
"node_modules/@pmate/meta/src/config/consts.ts"() {
|
|
550
547
|
"use strict";
|
|
551
548
|
}
|
|
552
549
|
});
|
|
553
550
|
|
|
554
|
-
// node_modules
|
|
551
|
+
// node_modules/@pmate/meta/src/config/TopicNames.ts
|
|
555
552
|
var TopicNames, topicKindMatchers;
|
|
556
553
|
var init_TopicNames = __esm({
|
|
557
|
-
"node_modules
|
|
554
|
+
"node_modules/@pmate/meta/src/config/TopicNames.ts"() {
|
|
558
555
|
"use strict";
|
|
559
556
|
init_types2();
|
|
560
557
|
TopicNames = class _TopicNames {
|
|
@@ -640,18 +637,18 @@ var init_TopicNames = __esm({
|
|
|
640
637
|
}
|
|
641
638
|
});
|
|
642
639
|
|
|
643
|
-
// node_modules
|
|
640
|
+
// node_modules/@pmate/meta/src/config/OSSKeys.ts
|
|
644
641
|
var init_OSSKeys = __esm({
|
|
645
|
-
"node_modules
|
|
642
|
+
"node_modules/@pmate/meta/src/config/OSSKeys.ts"() {
|
|
646
643
|
"use strict";
|
|
647
644
|
init_consts();
|
|
648
645
|
}
|
|
649
646
|
});
|
|
650
647
|
|
|
651
|
-
// node_modules
|
|
648
|
+
// node_modules/@pmate/meta/src/config/CompanionProfiles.ts
|
|
652
649
|
var openAICoral, openAIAsh, openAIBallad, openAINova, openAIVerse;
|
|
653
650
|
var init_CompanionProfiles = __esm({
|
|
654
|
-
"node_modules
|
|
651
|
+
"node_modules/@pmate/meta/src/config/CompanionProfiles.ts"() {
|
|
655
652
|
"use strict";
|
|
656
653
|
init_types2();
|
|
657
654
|
openAICoral = createVoice({
|
|
@@ -686,9 +683,9 @@ var init_CompanionProfiles = __esm({
|
|
|
686
683
|
}
|
|
687
684
|
});
|
|
688
685
|
|
|
689
|
-
// node_modules
|
|
686
|
+
// node_modules/@pmate/meta/src/config/index.ts
|
|
690
687
|
var init_config = __esm({
|
|
691
|
-
"node_modules
|
|
688
|
+
"node_modules/@pmate/meta/src/config/index.ts"() {
|
|
692
689
|
"use strict";
|
|
693
690
|
init_BizErrorCode();
|
|
694
691
|
init_consts();
|
|
@@ -698,83 +695,83 @@ var init_config = __esm({
|
|
|
698
695
|
}
|
|
699
696
|
});
|
|
700
697
|
|
|
701
|
-
// node_modules
|
|
698
|
+
// node_modules/@pmate/meta/src/index.ts
|
|
702
699
|
var init_src = __esm({
|
|
703
|
-
"node_modules
|
|
700
|
+
"node_modules/@pmate/meta/src/index.ts"() {
|
|
704
701
|
"use strict";
|
|
705
702
|
init_types2();
|
|
706
703
|
init_config();
|
|
707
704
|
}
|
|
708
705
|
});
|
|
709
706
|
|
|
710
|
-
// node_modules
|
|
707
|
+
// node_modules/@pmate/utils/src/base64.ts
|
|
711
708
|
var init_base64 = __esm({
|
|
712
|
-
"node_modules
|
|
709
|
+
"node_modules/@pmate/utils/src/base64.ts"() {
|
|
713
710
|
"use strict";
|
|
714
711
|
}
|
|
715
712
|
});
|
|
716
713
|
|
|
717
|
-
// node_modules
|
|
714
|
+
// node_modules/@pmate/utils/src/Cache.ts
|
|
718
715
|
var init_Cache = __esm({
|
|
719
|
-
"node_modules
|
|
716
|
+
"node_modules/@pmate/utils/src/Cache.ts"() {
|
|
720
717
|
"use strict";
|
|
721
718
|
}
|
|
722
719
|
});
|
|
723
720
|
|
|
724
|
-
// node_modules
|
|
721
|
+
// node_modules/@pmate/utils/src/batchResolve.ts
|
|
725
722
|
var init_batchResolve = __esm({
|
|
726
|
-
"node_modules
|
|
723
|
+
"node_modules/@pmate/utils/src/batchResolve.ts"() {
|
|
727
724
|
"use strict";
|
|
728
725
|
init_Cache();
|
|
729
726
|
}
|
|
730
727
|
});
|
|
731
728
|
|
|
732
|
-
// node_modules
|
|
729
|
+
// node_modules/@pmate/lang/src/cn/sentenceSpliter.ts
|
|
733
730
|
var init_sentenceSpliter = __esm({
|
|
734
|
-
"node_modules
|
|
731
|
+
"node_modules/@pmate/lang/src/cn/sentenceSpliter.ts"() {
|
|
735
732
|
"use strict";
|
|
736
733
|
}
|
|
737
734
|
});
|
|
738
735
|
|
|
739
|
-
// node_modules
|
|
736
|
+
// node_modules/@pmate/lang/src/cn/sentenceTrim.ts
|
|
740
737
|
var init_sentenceTrim = __esm({
|
|
741
|
-
"node_modules
|
|
738
|
+
"node_modules/@pmate/lang/src/cn/sentenceTrim.ts"() {
|
|
742
739
|
"use strict";
|
|
743
740
|
}
|
|
744
741
|
});
|
|
745
742
|
|
|
746
|
-
// node_modules
|
|
743
|
+
// node_modules/@pmate/lang/src/cn/wordSpliter.ts
|
|
747
744
|
var init_wordSpliter = __esm({
|
|
748
|
-
"node_modules
|
|
745
|
+
"node_modules/@pmate/lang/src/cn/wordSpliter.ts"() {
|
|
749
746
|
"use strict";
|
|
750
747
|
}
|
|
751
748
|
});
|
|
752
749
|
|
|
753
|
-
// node_modules
|
|
750
|
+
// node_modules/@pmate/lang/src/en/regex.ts
|
|
754
751
|
var init_regex = __esm({
|
|
755
|
-
"node_modules
|
|
752
|
+
"node_modules/@pmate/lang/src/en/regex.ts"() {
|
|
756
753
|
"use strict";
|
|
757
754
|
}
|
|
758
755
|
});
|
|
759
756
|
|
|
760
|
-
// node_modules
|
|
757
|
+
// node_modules/@pmate/lang/src/en/sentenceSpliter.ts
|
|
761
758
|
var init_sentenceSpliter2 = __esm({
|
|
762
|
-
"node_modules
|
|
759
|
+
"node_modules/@pmate/lang/src/en/sentenceSpliter.ts"() {
|
|
763
760
|
"use strict";
|
|
764
761
|
}
|
|
765
762
|
});
|
|
766
763
|
|
|
767
|
-
// node_modules
|
|
764
|
+
// node_modules/@pmate/lang/src/en/sentenceTrim.ts
|
|
768
765
|
var init_sentenceTrim2 = __esm({
|
|
769
|
-
"node_modules
|
|
766
|
+
"node_modules/@pmate/lang/src/en/sentenceTrim.ts"() {
|
|
770
767
|
"use strict";
|
|
771
768
|
}
|
|
772
769
|
});
|
|
773
770
|
|
|
774
|
-
// node_modules
|
|
771
|
+
// node_modules/@pmate/lang/src/en/wordSpliter.ts
|
|
775
772
|
var regex;
|
|
776
773
|
var init_wordSpliter2 = __esm({
|
|
777
|
-
"node_modules
|
|
774
|
+
"node_modules/@pmate/lang/src/en/wordSpliter.ts"() {
|
|
778
775
|
"use strict";
|
|
779
776
|
regex = new RegExp(
|
|
780
777
|
[
|
|
@@ -810,23 +807,23 @@ var init_wordSpliter2 = __esm({
|
|
|
810
807
|
}
|
|
811
808
|
});
|
|
812
809
|
|
|
813
|
-
// node_modules
|
|
810
|
+
// node_modules/@pmate/lang/src/kr/sentenceSpliter.ts
|
|
814
811
|
var init_sentenceSpliter3 = __esm({
|
|
815
|
-
"node_modules
|
|
812
|
+
"node_modules/@pmate/lang/src/kr/sentenceSpliter.ts"() {
|
|
816
813
|
"use strict";
|
|
817
814
|
}
|
|
818
815
|
});
|
|
819
816
|
|
|
820
|
-
// node_modules
|
|
817
|
+
// node_modules/@pmate/lang/src/kr/wordSpliter.ts
|
|
821
818
|
var init_wordSpliter3 = __esm({
|
|
822
|
-
"node_modules
|
|
819
|
+
"node_modules/@pmate/lang/src/kr/wordSpliter.ts"() {
|
|
823
820
|
"use strict";
|
|
824
821
|
}
|
|
825
822
|
});
|
|
826
823
|
|
|
827
|
-
// node_modules
|
|
824
|
+
// node_modules/@pmate/lang/src/readingSettings.ts
|
|
828
825
|
var init_readingSettings = __esm({
|
|
829
|
-
"node_modules
|
|
826
|
+
"node_modules/@pmate/lang/src/readingSettings.ts"() {
|
|
830
827
|
"use strict";
|
|
831
828
|
init_sentenceSpliter();
|
|
832
829
|
init_wordSpliter();
|
|
@@ -837,17 +834,428 @@ var init_readingSettings = __esm({
|
|
|
837
834
|
}
|
|
838
835
|
});
|
|
839
836
|
|
|
840
|
-
// node_modules
|
|
841
|
-
var
|
|
842
|
-
"node_modules
|
|
837
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/account.types.ts
|
|
838
|
+
var init_account_types2 = __esm({
|
|
839
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/account.types.ts"() {
|
|
840
|
+
"use strict";
|
|
841
|
+
}
|
|
842
|
+
});
|
|
843
|
+
|
|
844
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/achievements.types.ts
|
|
845
|
+
var init_achievements_types2 = __esm({
|
|
846
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/achievements.types.ts"() {
|
|
847
|
+
"use strict";
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
|
|
851
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/aigen.types.ts
|
|
852
|
+
var init_aigen_types2 = __esm({
|
|
853
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/aigen.types.ts"() {
|
|
854
|
+
"use strict";
|
|
855
|
+
}
|
|
856
|
+
});
|
|
857
|
+
|
|
858
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/agent.types.ts
|
|
859
|
+
var init_agent_types2 = __esm({
|
|
860
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/agent.types.ts"() {
|
|
861
|
+
"use strict";
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
|
|
865
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/agent-registry.types.ts
|
|
866
|
+
var init_agent_registry_types2 = __esm({
|
|
867
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/agent-registry.types.ts"() {
|
|
868
|
+
"use strict";
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
|
|
872
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/runner-registry.types.ts
|
|
873
|
+
var init_runner_registry_types2 = __esm({
|
|
874
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/runner-registry.types.ts"() {
|
|
875
|
+
"use strict";
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/blockchain.types.ts
|
|
880
|
+
var init_blockchain_types2 = __esm({
|
|
881
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/blockchain.types.ts"() {
|
|
882
|
+
"use strict";
|
|
883
|
+
}
|
|
884
|
+
});
|
|
885
|
+
|
|
886
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/breakdown.types.ts
|
|
887
|
+
var init_breakdown_types2 = __esm({
|
|
888
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/breakdown.types.ts"() {
|
|
889
|
+
"use strict";
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
|
|
893
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/chat.types.ts
|
|
894
|
+
var init_chat_types2 = __esm({
|
|
895
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/chat.types.ts"() {
|
|
896
|
+
"use strict";
|
|
897
|
+
}
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/companion.types.ts
|
|
901
|
+
var init_companion_types2 = __esm({
|
|
902
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/companion.types.ts"() {
|
|
903
|
+
"use strict";
|
|
904
|
+
}
|
|
905
|
+
});
|
|
906
|
+
|
|
907
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/enums.ts
|
|
908
|
+
var init_enums2 = __esm({
|
|
909
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/enums.ts"() {
|
|
910
|
+
"use strict";
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
|
|
914
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/lang.types.ts
|
|
915
|
+
var init_lang_types2 = __esm({
|
|
916
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/lang.types.ts"() {
|
|
917
|
+
"use strict";
|
|
918
|
+
}
|
|
919
|
+
});
|
|
920
|
+
|
|
921
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/logs.types.ts
|
|
922
|
+
var init_logs_types2 = __esm({
|
|
923
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/logs.types.ts"() {
|
|
924
|
+
"use strict";
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
|
|
928
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/message.types.ts
|
|
929
|
+
var init_message_types2 = __esm({
|
|
930
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/message.types.ts"() {
|
|
931
|
+
"use strict";
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
|
|
935
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/newLog.types.ts
|
|
936
|
+
var init_newLog_types2 = __esm({
|
|
937
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/newLog.types.ts"() {
|
|
938
|
+
"use strict";
|
|
939
|
+
}
|
|
940
|
+
});
|
|
941
|
+
|
|
942
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/novel.types.ts
|
|
943
|
+
var init_novel_types2 = __esm({
|
|
944
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/novel.types.ts"() {
|
|
945
|
+
"use strict";
|
|
946
|
+
}
|
|
947
|
+
});
|
|
948
|
+
|
|
949
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/offline.types.ts
|
|
950
|
+
var init_offline_types2 = __esm({
|
|
951
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/offline.types.ts"() {
|
|
952
|
+
"use strict";
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
|
|
956
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/prompt.types.ts
|
|
957
|
+
var init_prompt_types2 = __esm({
|
|
958
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/prompt.types.ts"() {
|
|
959
|
+
"use strict";
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/reading.types.ts
|
|
964
|
+
var init_reading_types2 = __esm({
|
|
965
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/reading.types.ts"() {
|
|
966
|
+
"use strict";
|
|
967
|
+
}
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/settings.types.ts
|
|
971
|
+
var init_settings_types2 = __esm({
|
|
972
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/settings.types.ts"() {
|
|
973
|
+
"use strict";
|
|
974
|
+
}
|
|
975
|
+
});
|
|
976
|
+
|
|
977
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/subscription.types.ts
|
|
978
|
+
var init_subscription_types2 = __esm({
|
|
979
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/subscription.types.ts"() {
|
|
980
|
+
"use strict";
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
|
|
984
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/types.ts
|
|
985
|
+
var buildVoiceKey2, createVoice2;
|
|
986
|
+
var init_types3 = __esm({
|
|
987
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/types.ts"() {
|
|
988
|
+
"use strict";
|
|
989
|
+
buildVoiceKey2 = (provider, name) => {
|
|
990
|
+
return `${provider}:${name}`;
|
|
991
|
+
};
|
|
992
|
+
createVoice2 = ({
|
|
993
|
+
name,
|
|
994
|
+
provider,
|
|
995
|
+
gender,
|
|
996
|
+
instructions
|
|
997
|
+
}) => {
|
|
998
|
+
return {
|
|
999
|
+
name,
|
|
1000
|
+
provider,
|
|
1001
|
+
gender,
|
|
1002
|
+
instructions,
|
|
1003
|
+
key: buildVoiceKey2(provider, name)
|
|
1004
|
+
};
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
});
|
|
1008
|
+
|
|
1009
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/wordv5.def.ts
|
|
1010
|
+
var init_wordv5_def2 = __esm({
|
|
1011
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/wordv5.def.ts"() {
|
|
1012
|
+
"use strict";
|
|
1013
|
+
}
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1016
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/auth.types.ts
|
|
1017
|
+
var init_auth_types2 = __esm({
|
|
1018
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/auth.types.ts"() {
|
|
1019
|
+
"use strict";
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
|
|
1023
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/apps.types.ts
|
|
1024
|
+
var init_apps_types2 = __esm({
|
|
1025
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/apps.types.ts"() {
|
|
1026
|
+
"use strict";
|
|
1027
|
+
}
|
|
1028
|
+
});
|
|
1029
|
+
|
|
1030
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/response.types.ts
|
|
1031
|
+
var init_response_types2 = __esm({
|
|
1032
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/response.types.ts"() {
|
|
843
1033
|
"use strict";
|
|
844
|
-
init_src();
|
|
845
1034
|
}
|
|
846
1035
|
});
|
|
847
1036
|
|
|
848
|
-
// node_modules
|
|
1037
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/role.types.ts
|
|
1038
|
+
var init_role_types2 = __esm({
|
|
1039
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/role.types.ts"() {
|
|
1040
|
+
"use strict";
|
|
1041
|
+
}
|
|
1042
|
+
});
|
|
1043
|
+
|
|
1044
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/index.ts
|
|
1045
|
+
var init_types4 = __esm({
|
|
1046
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/types/index.ts"() {
|
|
1047
|
+
"use strict";
|
|
1048
|
+
init_account_types2();
|
|
1049
|
+
init_achievements_types2();
|
|
1050
|
+
init_aigen_types2();
|
|
1051
|
+
init_agent_types2();
|
|
1052
|
+
init_agent_registry_types2();
|
|
1053
|
+
init_runner_registry_types2();
|
|
1054
|
+
init_blockchain_types2();
|
|
1055
|
+
init_breakdown_types2();
|
|
1056
|
+
init_chat_types2();
|
|
1057
|
+
init_companion_types2();
|
|
1058
|
+
init_enums2();
|
|
1059
|
+
init_lang_types2();
|
|
1060
|
+
init_logs_types2();
|
|
1061
|
+
init_message_types2();
|
|
1062
|
+
init_newLog_types2();
|
|
1063
|
+
init_novel_types2();
|
|
1064
|
+
init_offline_types2();
|
|
1065
|
+
init_prompt_types2();
|
|
1066
|
+
init_reading_types2();
|
|
1067
|
+
init_settings_types2();
|
|
1068
|
+
init_subscription_types2();
|
|
1069
|
+
init_types3();
|
|
1070
|
+
init_wordv5_def2();
|
|
1071
|
+
init_auth_types2();
|
|
1072
|
+
init_apps_types2();
|
|
1073
|
+
init_response_types2();
|
|
1074
|
+
init_role_types2();
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
1077
|
+
|
|
1078
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/config/BizErrorCode.ts
|
|
1079
|
+
var init_BizErrorCode2 = __esm({
|
|
1080
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/config/BizErrorCode.ts"() {
|
|
1081
|
+
"use strict";
|
|
1082
|
+
}
|
|
1083
|
+
});
|
|
1084
|
+
|
|
1085
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/config/consts.ts
|
|
1086
|
+
var init_consts2 = __esm({
|
|
1087
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/config/consts.ts"() {
|
|
1088
|
+
"use strict";
|
|
1089
|
+
}
|
|
1090
|
+
});
|
|
1091
|
+
|
|
1092
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/config/TopicNames.ts
|
|
1093
|
+
var TopicNames2, topicKindMatchers2;
|
|
1094
|
+
var init_TopicNames2 = __esm({
|
|
1095
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/config/TopicNames.ts"() {
|
|
1096
|
+
"use strict";
|
|
1097
|
+
init_types4();
|
|
1098
|
+
TopicNames2 = class _TopicNames {
|
|
1099
|
+
static rooms() {
|
|
1100
|
+
return "@pmate/rooms";
|
|
1101
|
+
}
|
|
1102
|
+
static userThreads(user) {
|
|
1103
|
+
return `@pmate/user_threads:${user}`;
|
|
1104
|
+
}
|
|
1105
|
+
static userLogs(user) {
|
|
1106
|
+
return `@pmate/user_logs:${user}`;
|
|
1107
|
+
}
|
|
1108
|
+
static legacyUserLogs(user) {
|
|
1109
|
+
return _TopicNames.userLogs(user);
|
|
1110
|
+
}
|
|
1111
|
+
static userContacts(profileId) {
|
|
1112
|
+
return `@pmate/user_contacts:${profileId}`;
|
|
1113
|
+
}
|
|
1114
|
+
static usersMessage(userId) {
|
|
1115
|
+
return `@pmate/user_messages:${userId}`;
|
|
1116
|
+
}
|
|
1117
|
+
static userMapping() {
|
|
1118
|
+
return "@pmate/username_mapping";
|
|
1119
|
+
}
|
|
1120
|
+
static userMobileMapping() {
|
|
1121
|
+
return "@pmate/mobile_account";
|
|
1122
|
+
}
|
|
1123
|
+
static mapping() {
|
|
1124
|
+
return "@pmate/mapping";
|
|
1125
|
+
}
|
|
1126
|
+
static profiles() {
|
|
1127
|
+
return "@pmate/profiles";
|
|
1128
|
+
}
|
|
1129
|
+
static groups() {
|
|
1130
|
+
return "@pmate/groups";
|
|
1131
|
+
}
|
|
1132
|
+
static relationships() {
|
|
1133
|
+
return "@pmate/relationships";
|
|
1134
|
+
}
|
|
1135
|
+
};
|
|
1136
|
+
topicKindMatchers2 = [
|
|
1137
|
+
{
|
|
1138
|
+
kind: 1e3 /* UserLogs */,
|
|
1139
|
+
match: (topic) => topic.startsWith("@pmate/user_logs:")
|
|
1140
|
+
},
|
|
1141
|
+
{
|
|
1142
|
+
kind: 2e3 /* UserMessages */,
|
|
1143
|
+
match: (topic) => topic.startsWith("@pmate/user_messages:")
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
kind: 3e3 /* Relationships */,
|
|
1147
|
+
match: (topic) => topic === TopicNames2.relationships()
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
kind: 4e3 /* Rooms */,
|
|
1151
|
+
match: (topic) => topic === TopicNames2.rooms()
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
kind: 5e3 /* UserContacts */,
|
|
1155
|
+
match: (topic) => topic.startsWith("@pmate/user_contacts:")
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
kind: 8002 /* Entity_GROUP */,
|
|
1159
|
+
match: (topic) => topic === TopicNames2.groups()
|
|
1160
|
+
},
|
|
1161
|
+
{
|
|
1162
|
+
kind: 6e3 /* UserMapping */,
|
|
1163
|
+
match: (topic) => topic === TopicNames2.userMapping()
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
kind: 7e3 /* UserMobileMapping */,
|
|
1167
|
+
match: (topic) => topic === TopicNames2.userMobileMapping()
|
|
1168
|
+
},
|
|
1169
|
+
{
|
|
1170
|
+
kind: 6003 /* Mapping */,
|
|
1171
|
+
match: (topic) => topic === TopicNames2.mapping()
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
kind: 9e3 /* UserThreads */,
|
|
1175
|
+
match: (topic) => topic.startsWith("@pmate/user_threads:")
|
|
1176
|
+
}
|
|
1177
|
+
];
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
|
|
1181
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/config/OSSKeys.ts
|
|
1182
|
+
var init_OSSKeys2 = __esm({
|
|
1183
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/config/OSSKeys.ts"() {
|
|
1184
|
+
"use strict";
|
|
1185
|
+
init_consts2();
|
|
1186
|
+
}
|
|
1187
|
+
});
|
|
1188
|
+
|
|
1189
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/config/CompanionProfiles.ts
|
|
1190
|
+
var openAICoral2, openAIAsh2, openAIBallad2, openAINova2, openAIVerse2;
|
|
1191
|
+
var init_CompanionProfiles2 = __esm({
|
|
1192
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/config/CompanionProfiles.ts"() {
|
|
1193
|
+
"use strict";
|
|
1194
|
+
init_types4();
|
|
1195
|
+
openAICoral2 = createVoice2({
|
|
1196
|
+
name: "coral",
|
|
1197
|
+
provider: "openai",
|
|
1198
|
+
gender: "F",
|
|
1199
|
+
instructions: "sweet, cute,naive voice"
|
|
1200
|
+
});
|
|
1201
|
+
openAIAsh2 = createVoice2({
|
|
1202
|
+
name: "ash",
|
|
1203
|
+
provider: "openai",
|
|
1204
|
+
gender: "M"
|
|
1205
|
+
});
|
|
1206
|
+
openAIBallad2 = createVoice2({
|
|
1207
|
+
name: "ballad",
|
|
1208
|
+
provider: "openai",
|
|
1209
|
+
gender: "M",
|
|
1210
|
+
instructions: "bright, young man voice"
|
|
1211
|
+
});
|
|
1212
|
+
openAINova2 = createVoice2({
|
|
1213
|
+
name: "nova",
|
|
1214
|
+
provider: "openai",
|
|
1215
|
+
gender: "F",
|
|
1216
|
+
instructions: "mature, smooth, elegant, warm voice"
|
|
1217
|
+
});
|
|
1218
|
+
openAIVerse2 = createVoice2({
|
|
1219
|
+
name: "verse",
|
|
1220
|
+
provider: "openai",
|
|
1221
|
+
gender: "M",
|
|
1222
|
+
instructions: "elderly,mysterious wizzard voice"
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
});
|
|
1226
|
+
|
|
1227
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/config/index.ts
|
|
1228
|
+
var init_config2 = __esm({
|
|
1229
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/config/index.ts"() {
|
|
1230
|
+
"use strict";
|
|
1231
|
+
init_BizErrorCode2();
|
|
1232
|
+
init_consts2();
|
|
1233
|
+
init_TopicNames2();
|
|
1234
|
+
init_OSSKeys2();
|
|
1235
|
+
init_CompanionProfiles2();
|
|
1236
|
+
}
|
|
1237
|
+
});
|
|
1238
|
+
|
|
1239
|
+
// node_modules/@pmate/lang/node_modules/@pmate/meta/src/index.ts
|
|
849
1240
|
var init_src2 = __esm({
|
|
850
|
-
"node_modules
|
|
1241
|
+
"node_modules/@pmate/lang/node_modules/@pmate/meta/src/index.ts"() {
|
|
1242
|
+
"use strict";
|
|
1243
|
+
init_types4();
|
|
1244
|
+
init_config2();
|
|
1245
|
+
}
|
|
1246
|
+
});
|
|
1247
|
+
|
|
1248
|
+
// node_modules/@pmate/lang/src/utils.ts
|
|
1249
|
+
var init_utils = __esm({
|
|
1250
|
+
"node_modules/@pmate/lang/src/utils.ts"() {
|
|
1251
|
+
"use strict";
|
|
1252
|
+
init_src2();
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
1255
|
+
|
|
1256
|
+
// node_modules/@pmate/lang/src/index.ts
|
|
1257
|
+
var init_src3 = __esm({
|
|
1258
|
+
"node_modules/@pmate/lang/src/index.ts"() {
|
|
851
1259
|
"use strict";
|
|
852
1260
|
init_sentenceSpliter();
|
|
853
1261
|
init_sentenceTrim();
|
|
@@ -863,32 +1271,32 @@ var init_src2 = __esm({
|
|
|
863
1271
|
}
|
|
864
1272
|
});
|
|
865
1273
|
|
|
866
|
-
// node_modules
|
|
1274
|
+
// node_modules/@pmate/utils/src/bookStats.ts
|
|
867
1275
|
var init_bookStats = __esm({
|
|
868
|
-
"node_modules
|
|
1276
|
+
"node_modules/@pmate/utils/src/bookStats.ts"() {
|
|
869
1277
|
"use strict";
|
|
870
|
-
|
|
1278
|
+
init_src3();
|
|
871
1279
|
}
|
|
872
1280
|
});
|
|
873
1281
|
|
|
874
|
-
// node_modules
|
|
1282
|
+
// node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts
|
|
875
1283
|
var init_BoundedConcurrentQueue = __esm({
|
|
876
|
-
"node_modules
|
|
1284
|
+
"node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts"() {
|
|
877
1285
|
"use strict";
|
|
878
1286
|
}
|
|
879
1287
|
});
|
|
880
1288
|
|
|
881
|
-
// node_modules
|
|
1289
|
+
// node_modules/@pmate/utils/src/lru.ts
|
|
882
1290
|
var init_lru = __esm({
|
|
883
|
-
"node_modules
|
|
1291
|
+
"node_modules/@pmate/utils/src/lru.ts"() {
|
|
884
1292
|
"use strict";
|
|
885
1293
|
init_Cache();
|
|
886
1294
|
}
|
|
887
1295
|
});
|
|
888
1296
|
|
|
889
|
-
// node_modules
|
|
1297
|
+
// node_modules/js-sha3/src/sha3.js
|
|
890
1298
|
var require_sha3 = __commonJS({
|
|
891
|
-
"node_modules
|
|
1299
|
+
"node_modules/js-sha3/src/sha3.js"(exports2, module2) {
|
|
892
1300
|
"use strict";
|
|
893
1301
|
(function() {
|
|
894
1302
|
"use strict";
|
|
@@ -1533,24 +1941,24 @@ var require_sha3 = __commonJS({
|
|
|
1533
1941
|
}
|
|
1534
1942
|
});
|
|
1535
1943
|
|
|
1536
|
-
// node_modules
|
|
1944
|
+
// node_modules/@pmate/utils/src/Maybe.ts
|
|
1537
1945
|
var init_Maybe = __esm({
|
|
1538
|
-
"node_modules
|
|
1946
|
+
"node_modules/@pmate/utils/src/Maybe.ts"() {
|
|
1539
1947
|
"use strict";
|
|
1540
1948
|
}
|
|
1541
1949
|
});
|
|
1542
1950
|
|
|
1543
|
-
// node_modules
|
|
1951
|
+
// node_modules/@pmate/utils/src/cacheMethodInMem.ts
|
|
1544
1952
|
var import_js_sha3;
|
|
1545
1953
|
var init_cacheMethodInMem = __esm({
|
|
1546
|
-
"node_modules
|
|
1954
|
+
"node_modules/@pmate/utils/src/cacheMethodInMem.ts"() {
|
|
1547
1955
|
"use strict";
|
|
1548
1956
|
import_js_sha3 = __toESM(require_sha3(), 1);
|
|
1549
1957
|
init_Maybe();
|
|
1550
1958
|
}
|
|
1551
1959
|
});
|
|
1552
1960
|
|
|
1553
|
-
// node_modules
|
|
1961
|
+
// node_modules/pako/dist/pako.esm.mjs
|
|
1554
1962
|
function zero$1(buf) {
|
|
1555
1963
|
let len = buf.length;
|
|
1556
1964
|
while (--len >= 0) {
|
|
@@ -1838,7 +2246,7 @@ function inflateRaw$1(input, options) {
|
|
|
1838
2246
|
}
|
|
1839
2247
|
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
2248
|
var init_pako_esm = __esm({
|
|
1841
|
-
"node_modules
|
|
2249
|
+
"node_modules/pako/dist/pako.esm.mjs"() {
|
|
1842
2250
|
"use strict";
|
|
1843
2251
|
Z_FIXED$1 = 4;
|
|
1844
2252
|
Z_BINARY = 0;
|
|
@@ -5719,7 +6127,7 @@ var init_pako_esm = __esm({
|
|
|
5719
6127
|
}
|
|
5720
6128
|
});
|
|
5721
6129
|
|
|
5722
|
-
// node_modules
|
|
6130
|
+
// node_modules/@pmate/utils/src/compress.ts
|
|
5723
6131
|
async function gzipEncodeBlob(input) {
|
|
5724
6132
|
const array = await toUint8Array(input);
|
|
5725
6133
|
return gzip_1(array);
|
|
@@ -5745,16 +6153,16 @@ async function toUint8Array(input) {
|
|
|
5745
6153
|
throw new TypeError("Unsupported input type for gzipEncodeBlob");
|
|
5746
6154
|
}
|
|
5747
6155
|
var init_compress = __esm({
|
|
5748
|
-
"node_modules
|
|
6156
|
+
"node_modules/@pmate/utils/src/compress.ts"() {
|
|
5749
6157
|
"use strict";
|
|
5750
6158
|
init_pako_esm();
|
|
5751
6159
|
}
|
|
5752
6160
|
});
|
|
5753
6161
|
|
|
5754
|
-
// node_modules
|
|
6162
|
+
// node_modules/@pmate/utils/src/AsyncStream.ts
|
|
5755
6163
|
var AsyncStream;
|
|
5756
6164
|
var init_AsyncStream = __esm({
|
|
5757
|
-
"node_modules
|
|
6165
|
+
"node_modules/@pmate/utils/src/AsyncStream.ts"() {
|
|
5758
6166
|
"use strict";
|
|
5759
6167
|
AsyncStream = class _AsyncStream {
|
|
5760
6168
|
constructor() {
|
|
@@ -5891,63 +6299,477 @@ var init_AsyncStream = __esm({
|
|
|
5891
6299
|
this.waiting.push({ resolve, reject });
|
|
5892
6300
|
});
|
|
5893
6301
|
}
|
|
5894
|
-
returnInternal() {
|
|
5895
|
-
if (this.stateInternal === "closed") {
|
|
5896
|
-
return Promise.resolve({ value: void 0, done: true });
|
|
5897
|
-
}
|
|
5898
|
-
this.queue.length = 0;
|
|
5899
|
-
const waiting = this.waiting;
|
|
5900
|
-
this.waiting = [];
|
|
5901
|
-
waiting.forEach((w) => w.resolve({ value: void 0, done: true }));
|
|
5902
|
-
this.finishClose("consumer");
|
|
5903
|
-
return Promise.resolve({ value: void 0, done: true });
|
|
6302
|
+
returnInternal() {
|
|
6303
|
+
if (this.stateInternal === "closed") {
|
|
6304
|
+
return Promise.resolve({ value: void 0, done: true });
|
|
6305
|
+
}
|
|
6306
|
+
this.queue.length = 0;
|
|
6307
|
+
const waiting = this.waiting;
|
|
6308
|
+
this.waiting = [];
|
|
6309
|
+
waiting.forEach((w) => w.resolve({ value: void 0, done: true }));
|
|
6310
|
+
this.finishClose("consumer");
|
|
6311
|
+
return Promise.resolve({ value: void 0, done: true });
|
|
6312
|
+
}
|
|
6313
|
+
throwInternal(err2) {
|
|
6314
|
+
this.returnInternal();
|
|
6315
|
+
return Promise.reject(err2);
|
|
6316
|
+
}
|
|
6317
|
+
finishEndIfDrained() {
|
|
6318
|
+
if (this.stateInternal !== "ending") {
|
|
6319
|
+
return;
|
|
6320
|
+
}
|
|
6321
|
+
if (this.queue.length !== 0) {
|
|
6322
|
+
return;
|
|
6323
|
+
}
|
|
6324
|
+
const waiting = this.waiting;
|
|
6325
|
+
this.waiting = [];
|
|
6326
|
+
waiting.forEach((w) => w.resolve({ value: void 0, done: true }));
|
|
6327
|
+
this.emit("end", void 0);
|
|
6328
|
+
this.finishClose("end");
|
|
6329
|
+
}
|
|
6330
|
+
finishClose(reason) {
|
|
6331
|
+
if (this.stateInternal === "closed") {
|
|
6332
|
+
return;
|
|
6333
|
+
}
|
|
6334
|
+
this.stateInternal = "closed";
|
|
6335
|
+
this.emit("close", { reason });
|
|
6336
|
+
const waiting = this.waiting;
|
|
6337
|
+
this.waiting = [];
|
|
6338
|
+
waiting.forEach((w) => w.resolve({ value: void 0, done: true }));
|
|
6339
|
+
}
|
|
6340
|
+
emit(event, payload) {
|
|
6341
|
+
const set = this.listeners[event];
|
|
6342
|
+
if (!set || set.size === 0) {
|
|
6343
|
+
return;
|
|
6344
|
+
}
|
|
6345
|
+
for (const handler of set) {
|
|
6346
|
+
handler(payload);
|
|
6347
|
+
}
|
|
6348
|
+
}
|
|
6349
|
+
};
|
|
6350
|
+
}
|
|
6351
|
+
});
|
|
6352
|
+
|
|
6353
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/account.types.ts
|
|
6354
|
+
var init_account_types3 = __esm({
|
|
6355
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/account.types.ts"() {
|
|
6356
|
+
"use strict";
|
|
6357
|
+
}
|
|
6358
|
+
});
|
|
6359
|
+
|
|
6360
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/achievements.types.ts
|
|
6361
|
+
var init_achievements_types3 = __esm({
|
|
6362
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/achievements.types.ts"() {
|
|
6363
|
+
"use strict";
|
|
6364
|
+
}
|
|
6365
|
+
});
|
|
6366
|
+
|
|
6367
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/aigen.types.ts
|
|
6368
|
+
var init_aigen_types3 = __esm({
|
|
6369
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/aigen.types.ts"() {
|
|
6370
|
+
"use strict";
|
|
6371
|
+
}
|
|
6372
|
+
});
|
|
6373
|
+
|
|
6374
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/agent.types.ts
|
|
6375
|
+
var init_agent_types3 = __esm({
|
|
6376
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/agent.types.ts"() {
|
|
6377
|
+
"use strict";
|
|
6378
|
+
}
|
|
6379
|
+
});
|
|
6380
|
+
|
|
6381
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/agent-registry.types.ts
|
|
6382
|
+
var init_agent_registry_types3 = __esm({
|
|
6383
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/agent-registry.types.ts"() {
|
|
6384
|
+
"use strict";
|
|
6385
|
+
}
|
|
6386
|
+
});
|
|
6387
|
+
|
|
6388
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/runner-registry.types.ts
|
|
6389
|
+
var init_runner_registry_types3 = __esm({
|
|
6390
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/runner-registry.types.ts"() {
|
|
6391
|
+
"use strict";
|
|
6392
|
+
}
|
|
6393
|
+
});
|
|
6394
|
+
|
|
6395
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/blockchain.types.ts
|
|
6396
|
+
var init_blockchain_types3 = __esm({
|
|
6397
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/blockchain.types.ts"() {
|
|
6398
|
+
"use strict";
|
|
6399
|
+
}
|
|
6400
|
+
});
|
|
6401
|
+
|
|
6402
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/breakdown.types.ts
|
|
6403
|
+
var init_breakdown_types3 = __esm({
|
|
6404
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/breakdown.types.ts"() {
|
|
6405
|
+
"use strict";
|
|
6406
|
+
}
|
|
6407
|
+
});
|
|
6408
|
+
|
|
6409
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/chat.types.ts
|
|
6410
|
+
var init_chat_types3 = __esm({
|
|
6411
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/chat.types.ts"() {
|
|
6412
|
+
"use strict";
|
|
6413
|
+
}
|
|
6414
|
+
});
|
|
6415
|
+
|
|
6416
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/companion.types.ts
|
|
6417
|
+
var init_companion_types3 = __esm({
|
|
6418
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/companion.types.ts"() {
|
|
6419
|
+
"use strict";
|
|
6420
|
+
}
|
|
6421
|
+
});
|
|
6422
|
+
|
|
6423
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/enums.ts
|
|
6424
|
+
var init_enums3 = __esm({
|
|
6425
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/enums.ts"() {
|
|
6426
|
+
"use strict";
|
|
6427
|
+
}
|
|
6428
|
+
});
|
|
6429
|
+
|
|
6430
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/lang.types.ts
|
|
6431
|
+
var init_lang_types3 = __esm({
|
|
6432
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/lang.types.ts"() {
|
|
6433
|
+
"use strict";
|
|
6434
|
+
}
|
|
6435
|
+
});
|
|
6436
|
+
|
|
6437
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/logs.types.ts
|
|
6438
|
+
var init_logs_types3 = __esm({
|
|
6439
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/logs.types.ts"() {
|
|
6440
|
+
"use strict";
|
|
6441
|
+
}
|
|
6442
|
+
});
|
|
6443
|
+
|
|
6444
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/message.types.ts
|
|
6445
|
+
var PING, PONG;
|
|
6446
|
+
var init_message_types3 = __esm({
|
|
6447
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/message.types.ts"() {
|
|
6448
|
+
"use strict";
|
|
6449
|
+
PING = 1;
|
|
6450
|
+
PONG = 2;
|
|
6451
|
+
}
|
|
6452
|
+
});
|
|
6453
|
+
|
|
6454
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/newLog.types.ts
|
|
6455
|
+
var init_newLog_types3 = __esm({
|
|
6456
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/newLog.types.ts"() {
|
|
6457
|
+
"use strict";
|
|
6458
|
+
}
|
|
6459
|
+
});
|
|
6460
|
+
|
|
6461
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/novel.types.ts
|
|
6462
|
+
var init_novel_types3 = __esm({
|
|
6463
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/novel.types.ts"() {
|
|
6464
|
+
"use strict";
|
|
6465
|
+
}
|
|
6466
|
+
});
|
|
6467
|
+
|
|
6468
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/offline.types.ts
|
|
6469
|
+
var init_offline_types3 = __esm({
|
|
6470
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/offline.types.ts"() {
|
|
6471
|
+
"use strict";
|
|
6472
|
+
}
|
|
6473
|
+
});
|
|
6474
|
+
|
|
6475
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/prompt.types.ts
|
|
6476
|
+
var init_prompt_types3 = __esm({
|
|
6477
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/prompt.types.ts"() {
|
|
6478
|
+
"use strict";
|
|
6479
|
+
}
|
|
6480
|
+
});
|
|
6481
|
+
|
|
6482
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/reading.types.ts
|
|
6483
|
+
var init_reading_types3 = __esm({
|
|
6484
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/reading.types.ts"() {
|
|
6485
|
+
"use strict";
|
|
6486
|
+
}
|
|
6487
|
+
});
|
|
6488
|
+
|
|
6489
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/settings.types.ts
|
|
6490
|
+
var init_settings_types3 = __esm({
|
|
6491
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/settings.types.ts"() {
|
|
6492
|
+
"use strict";
|
|
6493
|
+
}
|
|
6494
|
+
});
|
|
6495
|
+
|
|
6496
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/subscription.types.ts
|
|
6497
|
+
var init_subscription_types3 = __esm({
|
|
6498
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/subscription.types.ts"() {
|
|
6499
|
+
"use strict";
|
|
6500
|
+
}
|
|
6501
|
+
});
|
|
6502
|
+
|
|
6503
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/types.ts
|
|
6504
|
+
var buildVoiceKey3, createVoice3;
|
|
6505
|
+
var init_types5 = __esm({
|
|
6506
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/types.ts"() {
|
|
6507
|
+
"use strict";
|
|
6508
|
+
buildVoiceKey3 = (provider, name) => {
|
|
6509
|
+
return `${provider}:${name}`;
|
|
6510
|
+
};
|
|
6511
|
+
createVoice3 = ({
|
|
6512
|
+
name,
|
|
6513
|
+
provider,
|
|
6514
|
+
gender,
|
|
6515
|
+
instructions
|
|
6516
|
+
}) => {
|
|
6517
|
+
return {
|
|
6518
|
+
name,
|
|
6519
|
+
provider,
|
|
6520
|
+
gender,
|
|
6521
|
+
instructions,
|
|
6522
|
+
key: buildVoiceKey3(provider, name)
|
|
6523
|
+
};
|
|
6524
|
+
};
|
|
6525
|
+
}
|
|
6526
|
+
});
|
|
6527
|
+
|
|
6528
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/wordv5.def.ts
|
|
6529
|
+
var init_wordv5_def3 = __esm({
|
|
6530
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/wordv5.def.ts"() {
|
|
6531
|
+
"use strict";
|
|
6532
|
+
}
|
|
6533
|
+
});
|
|
6534
|
+
|
|
6535
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/auth.types.ts
|
|
6536
|
+
var init_auth_types3 = __esm({
|
|
6537
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/auth.types.ts"() {
|
|
6538
|
+
"use strict";
|
|
6539
|
+
}
|
|
6540
|
+
});
|
|
6541
|
+
|
|
6542
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/apps.types.ts
|
|
6543
|
+
var init_apps_types3 = __esm({
|
|
6544
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/apps.types.ts"() {
|
|
6545
|
+
"use strict";
|
|
6546
|
+
}
|
|
6547
|
+
});
|
|
6548
|
+
|
|
6549
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/response.types.ts
|
|
6550
|
+
var init_response_types3 = __esm({
|
|
6551
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/response.types.ts"() {
|
|
6552
|
+
"use strict";
|
|
6553
|
+
}
|
|
6554
|
+
});
|
|
6555
|
+
|
|
6556
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/role.types.ts
|
|
6557
|
+
var init_role_types3 = __esm({
|
|
6558
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/role.types.ts"() {
|
|
6559
|
+
"use strict";
|
|
6560
|
+
}
|
|
6561
|
+
});
|
|
6562
|
+
|
|
6563
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/index.ts
|
|
6564
|
+
var init_types6 = __esm({
|
|
6565
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/index.ts"() {
|
|
6566
|
+
"use strict";
|
|
6567
|
+
init_account_types3();
|
|
6568
|
+
init_achievements_types3();
|
|
6569
|
+
init_aigen_types3();
|
|
6570
|
+
init_agent_types3();
|
|
6571
|
+
init_agent_registry_types3();
|
|
6572
|
+
init_runner_registry_types3();
|
|
6573
|
+
init_blockchain_types3();
|
|
6574
|
+
init_breakdown_types3();
|
|
6575
|
+
init_chat_types3();
|
|
6576
|
+
init_companion_types3();
|
|
6577
|
+
init_enums3();
|
|
6578
|
+
init_lang_types3();
|
|
6579
|
+
init_logs_types3();
|
|
6580
|
+
init_message_types3();
|
|
6581
|
+
init_newLog_types3();
|
|
6582
|
+
init_novel_types3();
|
|
6583
|
+
init_offline_types3();
|
|
6584
|
+
init_prompt_types3();
|
|
6585
|
+
init_reading_types3();
|
|
6586
|
+
init_settings_types3();
|
|
6587
|
+
init_subscription_types3();
|
|
6588
|
+
init_types5();
|
|
6589
|
+
init_wordv5_def3();
|
|
6590
|
+
init_auth_types3();
|
|
6591
|
+
init_apps_types3();
|
|
6592
|
+
init_response_types3();
|
|
6593
|
+
init_role_types3();
|
|
6594
|
+
}
|
|
6595
|
+
});
|
|
6596
|
+
|
|
6597
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/BizErrorCode.ts
|
|
6598
|
+
var init_BizErrorCode3 = __esm({
|
|
6599
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/BizErrorCode.ts"() {
|
|
6600
|
+
"use strict";
|
|
6601
|
+
}
|
|
6602
|
+
});
|
|
6603
|
+
|
|
6604
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/consts.ts
|
|
6605
|
+
var init_consts3 = __esm({
|
|
6606
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/consts.ts"() {
|
|
6607
|
+
"use strict";
|
|
6608
|
+
}
|
|
6609
|
+
});
|
|
6610
|
+
|
|
6611
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/TopicNames.ts
|
|
6612
|
+
var TopicNames3, topicKindMatchers3;
|
|
6613
|
+
var init_TopicNames3 = __esm({
|
|
6614
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/TopicNames.ts"() {
|
|
6615
|
+
"use strict";
|
|
6616
|
+
init_types6();
|
|
6617
|
+
TopicNames3 = class _TopicNames {
|
|
6618
|
+
static rooms() {
|
|
6619
|
+
return "@pmate/rooms";
|
|
6620
|
+
}
|
|
6621
|
+
static userThreads(user) {
|
|
6622
|
+
return `@pmate/user_threads:${user}`;
|
|
5904
6623
|
}
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
return Promise.reject(err2);
|
|
6624
|
+
static userLogs(user) {
|
|
6625
|
+
return `@pmate/user_logs:${user}`;
|
|
5908
6626
|
}
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
return;
|
|
5912
|
-
}
|
|
5913
|
-
if (this.queue.length !== 0) {
|
|
5914
|
-
return;
|
|
5915
|
-
}
|
|
5916
|
-
const waiting = this.waiting;
|
|
5917
|
-
this.waiting = [];
|
|
5918
|
-
waiting.forEach((w) => w.resolve({ value: void 0, done: true }));
|
|
5919
|
-
this.emit("end", void 0);
|
|
5920
|
-
this.finishClose("end");
|
|
6627
|
+
static legacyUserLogs(user) {
|
|
6628
|
+
return _TopicNames.userLogs(user);
|
|
5921
6629
|
}
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
return;
|
|
5925
|
-
}
|
|
5926
|
-
this.stateInternal = "closed";
|
|
5927
|
-
this.emit("close", { reason });
|
|
5928
|
-
const waiting = this.waiting;
|
|
5929
|
-
this.waiting = [];
|
|
5930
|
-
waiting.forEach((w) => w.resolve({ value: void 0, done: true }));
|
|
6630
|
+
static userContacts(profileId) {
|
|
6631
|
+
return `@pmate/user_contacts:${profileId}`;
|
|
5931
6632
|
}
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
6633
|
+
static usersMessage(userId) {
|
|
6634
|
+
return `@pmate/user_messages:${userId}`;
|
|
6635
|
+
}
|
|
6636
|
+
static userMapping() {
|
|
6637
|
+
return "@pmate/username_mapping";
|
|
6638
|
+
}
|
|
6639
|
+
static userMobileMapping() {
|
|
6640
|
+
return "@pmate/mobile_account";
|
|
6641
|
+
}
|
|
6642
|
+
static mapping() {
|
|
6643
|
+
return "@pmate/mapping";
|
|
6644
|
+
}
|
|
6645
|
+
static profiles() {
|
|
6646
|
+
return "@pmate/profiles";
|
|
6647
|
+
}
|
|
6648
|
+
static groups() {
|
|
6649
|
+
return "@pmate/groups";
|
|
6650
|
+
}
|
|
6651
|
+
static relationships() {
|
|
6652
|
+
return "@pmate/relationships";
|
|
5940
6653
|
}
|
|
5941
6654
|
};
|
|
6655
|
+
topicKindMatchers3 = [
|
|
6656
|
+
{
|
|
6657
|
+
kind: 1e3 /* UserLogs */,
|
|
6658
|
+
match: (topic) => topic.startsWith("@pmate/user_logs:")
|
|
6659
|
+
},
|
|
6660
|
+
{
|
|
6661
|
+
kind: 2e3 /* UserMessages */,
|
|
6662
|
+
match: (topic) => topic.startsWith("@pmate/user_messages:")
|
|
6663
|
+
},
|
|
6664
|
+
{
|
|
6665
|
+
kind: 3e3 /* Relationships */,
|
|
6666
|
+
match: (topic) => topic === TopicNames3.relationships()
|
|
6667
|
+
},
|
|
6668
|
+
{
|
|
6669
|
+
kind: 4e3 /* Rooms */,
|
|
6670
|
+
match: (topic) => topic === TopicNames3.rooms()
|
|
6671
|
+
},
|
|
6672
|
+
{
|
|
6673
|
+
kind: 5e3 /* UserContacts */,
|
|
6674
|
+
match: (topic) => topic.startsWith("@pmate/user_contacts:")
|
|
6675
|
+
},
|
|
6676
|
+
{
|
|
6677
|
+
kind: 8002 /* Entity_GROUP */,
|
|
6678
|
+
match: (topic) => topic === TopicNames3.groups()
|
|
6679
|
+
},
|
|
6680
|
+
{
|
|
6681
|
+
kind: 6e3 /* UserMapping */,
|
|
6682
|
+
match: (topic) => topic === TopicNames3.userMapping()
|
|
6683
|
+
},
|
|
6684
|
+
{
|
|
6685
|
+
kind: 7e3 /* UserMobileMapping */,
|
|
6686
|
+
match: (topic) => topic === TopicNames3.userMobileMapping()
|
|
6687
|
+
},
|
|
6688
|
+
{
|
|
6689
|
+
kind: 6003 /* Mapping */,
|
|
6690
|
+
match: (topic) => topic === TopicNames3.mapping()
|
|
6691
|
+
},
|
|
6692
|
+
{
|
|
6693
|
+
kind: 9e3 /* UserThreads */,
|
|
6694
|
+
match: (topic) => topic.startsWith("@pmate/user_threads:")
|
|
6695
|
+
}
|
|
6696
|
+
];
|
|
6697
|
+
}
|
|
6698
|
+
});
|
|
6699
|
+
|
|
6700
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/OSSKeys.ts
|
|
6701
|
+
var init_OSSKeys3 = __esm({
|
|
6702
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/OSSKeys.ts"() {
|
|
6703
|
+
"use strict";
|
|
6704
|
+
init_consts3();
|
|
6705
|
+
}
|
|
6706
|
+
});
|
|
6707
|
+
|
|
6708
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/CompanionProfiles.ts
|
|
6709
|
+
var openAICoral3, openAIAsh3, openAIBallad3, openAINova3, openAIVerse3;
|
|
6710
|
+
var init_CompanionProfiles3 = __esm({
|
|
6711
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/CompanionProfiles.ts"() {
|
|
6712
|
+
"use strict";
|
|
6713
|
+
init_types6();
|
|
6714
|
+
openAICoral3 = createVoice3({
|
|
6715
|
+
name: "coral",
|
|
6716
|
+
provider: "openai",
|
|
6717
|
+
gender: "F",
|
|
6718
|
+
instructions: "sweet, cute,naive voice"
|
|
6719
|
+
});
|
|
6720
|
+
openAIAsh3 = createVoice3({
|
|
6721
|
+
name: "ash",
|
|
6722
|
+
provider: "openai",
|
|
6723
|
+
gender: "M"
|
|
6724
|
+
});
|
|
6725
|
+
openAIBallad3 = createVoice3({
|
|
6726
|
+
name: "ballad",
|
|
6727
|
+
provider: "openai",
|
|
6728
|
+
gender: "M",
|
|
6729
|
+
instructions: "bright, young man voice"
|
|
6730
|
+
});
|
|
6731
|
+
openAINova3 = createVoice3({
|
|
6732
|
+
name: "nova",
|
|
6733
|
+
provider: "openai",
|
|
6734
|
+
gender: "F",
|
|
6735
|
+
instructions: "mature, smooth, elegant, warm voice"
|
|
6736
|
+
});
|
|
6737
|
+
openAIVerse3 = createVoice3({
|
|
6738
|
+
name: "verse",
|
|
6739
|
+
provider: "openai",
|
|
6740
|
+
gender: "M",
|
|
6741
|
+
instructions: "elderly,mysterious wizzard voice"
|
|
6742
|
+
});
|
|
6743
|
+
}
|
|
6744
|
+
});
|
|
6745
|
+
|
|
6746
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/index.ts
|
|
6747
|
+
var init_config3 = __esm({
|
|
6748
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/index.ts"() {
|
|
6749
|
+
"use strict";
|
|
6750
|
+
init_BizErrorCode3();
|
|
6751
|
+
init_consts3();
|
|
6752
|
+
init_TopicNames3();
|
|
6753
|
+
init_OSSKeys3();
|
|
6754
|
+
init_CompanionProfiles3();
|
|
6755
|
+
}
|
|
6756
|
+
});
|
|
6757
|
+
|
|
6758
|
+
// node_modules/@pmate/utils/node_modules/@pmate/meta/src/index.ts
|
|
6759
|
+
var init_src4 = __esm({
|
|
6760
|
+
"node_modules/@pmate/utils/node_modules/@pmate/meta/src/index.ts"() {
|
|
6761
|
+
"use strict";
|
|
6762
|
+
init_types6();
|
|
6763
|
+
init_config3();
|
|
5942
6764
|
}
|
|
5943
6765
|
});
|
|
5944
6766
|
|
|
5945
|
-
// node_modules
|
|
6767
|
+
// node_modules/@pmate/utils/src/uniqHash.ts
|
|
5946
6768
|
var import_js_sha32, sortKeys, uniqHash;
|
|
5947
6769
|
var init_uniqHash = __esm({
|
|
5948
|
-
"node_modules
|
|
6770
|
+
"node_modules/@pmate/utils/src/uniqHash.ts"() {
|
|
5949
6771
|
"use strict";
|
|
5950
|
-
|
|
6772
|
+
init_src4();
|
|
5951
6773
|
import_js_sha32 = __toESM(require_sha3(), 1);
|
|
5952
6774
|
sortKeys = (obj) => {
|
|
5953
6775
|
if (Array.isArray(obj)) {
|
|
@@ -5975,33 +6797,33 @@ var init_uniqHash = __esm({
|
|
|
5975
6797
|
}
|
|
5976
6798
|
});
|
|
5977
6799
|
|
|
5978
|
-
// node_modules
|
|
6800
|
+
// node_modules/@pmate/utils/src/createMsg.ts
|
|
5979
6801
|
var init_createMsg = __esm({
|
|
5980
|
-
"node_modules
|
|
6802
|
+
"node_modules/@pmate/utils/src/createMsg.ts"() {
|
|
5981
6803
|
"use strict";
|
|
5982
|
-
|
|
6804
|
+
init_src4();
|
|
5983
6805
|
init_uniqHash();
|
|
5984
6806
|
}
|
|
5985
6807
|
});
|
|
5986
6808
|
|
|
5987
|
-
// node_modules
|
|
6809
|
+
// node_modules/@pmate/utils/src/detectText.ts
|
|
5988
6810
|
var init_detectText = __esm({
|
|
5989
|
-
"node_modules
|
|
6811
|
+
"node_modules/@pmate/utils/src/detectText.ts"() {
|
|
5990
6812
|
"use strict";
|
|
5991
6813
|
}
|
|
5992
6814
|
});
|
|
5993
6815
|
|
|
5994
|
-
// node_modules
|
|
6816
|
+
// node_modules/@pmate/utils/src/Emitter.ts
|
|
5995
6817
|
var init_Emitter = __esm({
|
|
5996
|
-
"node_modules
|
|
6818
|
+
"node_modules/@pmate/utils/src/Emitter.ts"() {
|
|
5997
6819
|
"use strict";
|
|
5998
6820
|
}
|
|
5999
6821
|
});
|
|
6000
6822
|
|
|
6001
|
-
// node_modules
|
|
6823
|
+
// node_modules/@pmate/utils/src/EmitterV2.ts
|
|
6002
6824
|
var EmitterV2;
|
|
6003
6825
|
var init_EmitterV2 = __esm({
|
|
6004
|
-
"node_modules
|
|
6826
|
+
"node_modules/@pmate/utils/src/EmitterV2.ts"() {
|
|
6005
6827
|
"use strict";
|
|
6006
6828
|
EmitterV2 = class {
|
|
6007
6829
|
constructor() {
|
|
@@ -6057,39 +6879,39 @@ var init_EmitterV2 = __esm({
|
|
|
6057
6879
|
}
|
|
6058
6880
|
});
|
|
6059
6881
|
|
|
6060
|
-
// node_modules
|
|
6882
|
+
// node_modules/@pmate/utils/src/format/formatTime.ts
|
|
6061
6883
|
var init_formatTime = __esm({
|
|
6062
|
-
"node_modules
|
|
6884
|
+
"node_modules/@pmate/utils/src/format/formatTime.ts"() {
|
|
6063
6885
|
"use strict";
|
|
6064
6886
|
}
|
|
6065
6887
|
});
|
|
6066
6888
|
|
|
6067
|
-
// node_modules
|
|
6889
|
+
// node_modules/@pmate/utils/src/format/index.ts
|
|
6068
6890
|
var init_format = __esm({
|
|
6069
|
-
"node_modules
|
|
6891
|
+
"node_modules/@pmate/utils/src/format/index.ts"() {
|
|
6070
6892
|
"use strict";
|
|
6071
6893
|
init_formatTime();
|
|
6072
6894
|
}
|
|
6073
6895
|
});
|
|
6074
6896
|
|
|
6075
|
-
// node_modules
|
|
6897
|
+
// node_modules/@pmate/utils/src/isVolcabulary.ts
|
|
6076
6898
|
var init_isVolcabulary = __esm({
|
|
6077
|
-
"node_modules
|
|
6899
|
+
"node_modules/@pmate/utils/src/isVolcabulary.ts"() {
|
|
6078
6900
|
"use strict";
|
|
6079
6901
|
}
|
|
6080
6902
|
});
|
|
6081
6903
|
|
|
6082
|
-
// node_modules
|
|
6904
|
+
// node_modules/@pmate/utils/src/Loadable.ts
|
|
6083
6905
|
var init_Loadable = __esm({
|
|
6084
|
-
"node_modules
|
|
6906
|
+
"node_modules/@pmate/utils/src/Loadable.ts"() {
|
|
6085
6907
|
"use strict";
|
|
6086
6908
|
}
|
|
6087
6909
|
});
|
|
6088
6910
|
|
|
6089
|
-
// node_modules
|
|
6911
|
+
// node_modules/@pmate/utils/src/Logger.ts
|
|
6090
6912
|
var Logger;
|
|
6091
6913
|
var init_Logger = __esm({
|
|
6092
|
-
"node_modules
|
|
6914
|
+
"node_modules/@pmate/utils/src/Logger.ts"() {
|
|
6093
6915
|
"use strict";
|
|
6094
6916
|
Logger = class _Logger {
|
|
6095
6917
|
constructor(name) {
|
|
@@ -6114,21 +6936,21 @@ var init_Logger = __esm({
|
|
|
6114
6936
|
}
|
|
6115
6937
|
});
|
|
6116
6938
|
|
|
6117
|
-
// node_modules
|
|
6939
|
+
// node_modules/@pmate/utils/src/mapToReadingBook.ts
|
|
6118
6940
|
var init_mapToReadingBook = __esm({
|
|
6119
|
-
"node_modules
|
|
6941
|
+
"node_modules/@pmate/utils/src/mapToReadingBook.ts"() {
|
|
6120
6942
|
"use strict";
|
|
6121
6943
|
}
|
|
6122
6944
|
});
|
|
6123
6945
|
|
|
6124
|
-
// node_modules
|
|
6946
|
+
// node_modules/@pmate/utils/src/memoize.ts
|
|
6125
6947
|
var init_memoize = __esm({
|
|
6126
|
-
"node_modules
|
|
6948
|
+
"node_modules/@pmate/utils/src/memoize.ts"() {
|
|
6127
6949
|
"use strict";
|
|
6128
6950
|
}
|
|
6129
6951
|
});
|
|
6130
6952
|
|
|
6131
|
-
// node_modules
|
|
6953
|
+
// node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs
|
|
6132
6954
|
function utf8Count(str) {
|
|
6133
6955
|
const strLength = str.length;
|
|
6134
6956
|
let byteLength = 0;
|
|
@@ -6255,7 +7077,7 @@ function utf8Decode(bytes, inputOffset, byteLength) {
|
|
|
6255
7077
|
}
|
|
6256
7078
|
var sharedTextEncoder, TEXT_ENCODER_THRESHOLD, CHUNK_SIZE, sharedTextDecoder, TEXT_DECODER_THRESHOLD;
|
|
6257
7079
|
var init_utf8 = __esm({
|
|
6258
|
-
"node_modules
|
|
7080
|
+
"node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs"() {
|
|
6259
7081
|
"use strict";
|
|
6260
7082
|
sharedTextEncoder = new TextEncoder();
|
|
6261
7083
|
TEXT_ENCODER_THRESHOLD = 50;
|
|
@@ -6265,10 +7087,10 @@ var init_utf8 = __esm({
|
|
|
6265
7087
|
}
|
|
6266
7088
|
});
|
|
6267
7089
|
|
|
6268
|
-
// node_modules
|
|
7090
|
+
// node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs
|
|
6269
7091
|
var ExtData;
|
|
6270
7092
|
var init_ExtData = __esm({
|
|
6271
|
-
"node_modules
|
|
7093
|
+
"node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs"() {
|
|
6272
7094
|
"use strict";
|
|
6273
7095
|
ExtData = class {
|
|
6274
7096
|
type;
|
|
@@ -6281,10 +7103,10 @@ var init_ExtData = __esm({
|
|
|
6281
7103
|
}
|
|
6282
7104
|
});
|
|
6283
7105
|
|
|
6284
|
-
// node_modules
|
|
7106
|
+
// node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs
|
|
6285
7107
|
var DecodeError;
|
|
6286
7108
|
var init_DecodeError = __esm({
|
|
6287
|
-
"node_modules
|
|
7109
|
+
"node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs"() {
|
|
6288
7110
|
"use strict";
|
|
6289
7111
|
DecodeError = class _DecodeError extends Error {
|
|
6290
7112
|
constructor(message) {
|
|
@@ -6301,7 +7123,7 @@ var init_DecodeError = __esm({
|
|
|
6301
7123
|
}
|
|
6302
7124
|
});
|
|
6303
7125
|
|
|
6304
|
-
// node_modules
|
|
7126
|
+
// node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs
|
|
6305
7127
|
function setUint64(view, offset, value) {
|
|
6306
7128
|
const high = value / 4294967296;
|
|
6307
7129
|
const low = value;
|
|
@@ -6326,13 +7148,13 @@ function getUint64(view, offset) {
|
|
|
6326
7148
|
}
|
|
6327
7149
|
var UINT32_MAX;
|
|
6328
7150
|
var init_int = __esm({
|
|
6329
|
-
"node_modules
|
|
7151
|
+
"node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs"() {
|
|
6330
7152
|
"use strict";
|
|
6331
7153
|
UINT32_MAX = 4294967295;
|
|
6332
7154
|
}
|
|
6333
7155
|
});
|
|
6334
7156
|
|
|
6335
|
-
// node_modules
|
|
7157
|
+
// node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs
|
|
6336
7158
|
function encodeTimeSpecToTimestamp({ sec, nsec }) {
|
|
6337
7159
|
if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {
|
|
6338
7160
|
if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {
|
|
@@ -6405,7 +7227,7 @@ function decodeTimestampExtension(data) {
|
|
|
6405
7227
|
}
|
|
6406
7228
|
var EXT_TIMESTAMP, TIMESTAMP32_MAX_SEC, TIMESTAMP64_MAX_SEC, timestampExtension;
|
|
6407
7229
|
var init_timestamp = __esm({
|
|
6408
|
-
"node_modules
|
|
7230
|
+
"node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs"() {
|
|
6409
7231
|
"use strict";
|
|
6410
7232
|
init_DecodeError();
|
|
6411
7233
|
init_int();
|
|
@@ -6420,10 +7242,10 @@ var init_timestamp = __esm({
|
|
|
6420
7242
|
}
|
|
6421
7243
|
});
|
|
6422
7244
|
|
|
6423
|
-
// node_modules
|
|
7245
|
+
// node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs
|
|
6424
7246
|
var ExtensionCodec;
|
|
6425
7247
|
var init_ExtensionCodec = __esm({
|
|
6426
|
-
"node_modules
|
|
7248
|
+
"node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs"() {
|
|
6427
7249
|
"use strict";
|
|
6428
7250
|
init_ExtData();
|
|
6429
7251
|
init_timestamp();
|
|
@@ -6490,7 +7312,7 @@ var init_ExtensionCodec = __esm({
|
|
|
6490
7312
|
}
|
|
6491
7313
|
});
|
|
6492
7314
|
|
|
6493
|
-
// node_modules
|
|
7315
|
+
// node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs
|
|
6494
7316
|
function isArrayBufferLike(buffer) {
|
|
6495
7317
|
return buffer instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && buffer instanceof SharedArrayBuffer;
|
|
6496
7318
|
}
|
|
@@ -6506,15 +7328,15 @@ function ensureUint8Array(buffer) {
|
|
|
6506
7328
|
}
|
|
6507
7329
|
}
|
|
6508
7330
|
var init_typedArrays = __esm({
|
|
6509
|
-
"node_modules
|
|
7331
|
+
"node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs"() {
|
|
6510
7332
|
"use strict";
|
|
6511
7333
|
}
|
|
6512
7334
|
});
|
|
6513
7335
|
|
|
6514
|
-
// node_modules
|
|
7336
|
+
// node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs
|
|
6515
7337
|
var DEFAULT_MAX_DEPTH, DEFAULT_INITIAL_BUFFER_SIZE, Encoder;
|
|
6516
7338
|
var init_Encoder = __esm({
|
|
6517
|
-
"node_modules
|
|
7339
|
+
"node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs"() {
|
|
6518
7340
|
"use strict";
|
|
6519
7341
|
init_utf8();
|
|
6520
7342
|
init_ExtensionCodec();
|
|
@@ -6924,32 +7746,32 @@ var init_Encoder = __esm({
|
|
|
6924
7746
|
}
|
|
6925
7747
|
});
|
|
6926
7748
|
|
|
6927
|
-
// node_modules
|
|
7749
|
+
// node_modules/@msgpack/msgpack/dist.esm/encode.mjs
|
|
6928
7750
|
function encode(value, options) {
|
|
6929
7751
|
const encoder2 = new Encoder(options);
|
|
6930
7752
|
return encoder2.encodeSharedRef(value);
|
|
6931
7753
|
}
|
|
6932
7754
|
var init_encode = __esm({
|
|
6933
|
-
"node_modules
|
|
7755
|
+
"node_modules/@msgpack/msgpack/dist.esm/encode.mjs"() {
|
|
6934
7756
|
"use strict";
|
|
6935
7757
|
init_Encoder();
|
|
6936
7758
|
}
|
|
6937
7759
|
});
|
|
6938
7760
|
|
|
6939
|
-
// node_modules
|
|
7761
|
+
// node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs
|
|
6940
7762
|
function prettyByte(byte) {
|
|
6941
7763
|
return `${byte < 0 ? "-" : ""}0x${Math.abs(byte).toString(16).padStart(2, "0")}`;
|
|
6942
7764
|
}
|
|
6943
7765
|
var init_prettyByte = __esm({
|
|
6944
|
-
"node_modules
|
|
7766
|
+
"node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs"() {
|
|
6945
7767
|
"use strict";
|
|
6946
7768
|
}
|
|
6947
7769
|
});
|
|
6948
7770
|
|
|
6949
|
-
// node_modules
|
|
7771
|
+
// node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs
|
|
6950
7772
|
var DEFAULT_MAX_KEY_LENGTH, DEFAULT_MAX_LENGTH_PER_KEY, CachedKeyDecoder;
|
|
6951
7773
|
var init_CachedKeyDecoder = __esm({
|
|
6952
|
-
"node_modules
|
|
7774
|
+
"node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs"() {
|
|
6953
7775
|
"use strict";
|
|
6954
7776
|
init_utf8();
|
|
6955
7777
|
DEFAULT_MAX_KEY_LENGTH = 16;
|
|
@@ -7009,10 +7831,10 @@ var init_CachedKeyDecoder = __esm({
|
|
|
7009
7831
|
}
|
|
7010
7832
|
});
|
|
7011
7833
|
|
|
7012
|
-
// node_modules
|
|
7834
|
+
// node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs
|
|
7013
7835
|
var STATE_ARRAY, STATE_MAP_KEY, STATE_MAP_VALUE, mapKeyConverter, StackPool, HEAD_BYTE_REQUIRED, EMPTY_VIEW, EMPTY_BYTES, MORE_DATA, sharedCachedKeyDecoder, Decoder;
|
|
7014
7836
|
var init_Decoder = __esm({
|
|
7015
|
-
"node_modules
|
|
7837
|
+
"node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs"() {
|
|
7016
7838
|
"use strict";
|
|
7017
7839
|
init_prettyByte();
|
|
7018
7840
|
init_ExtensionCodec();
|
|
@@ -7650,34 +8472,34 @@ var init_Decoder = __esm({
|
|
|
7650
8472
|
}
|
|
7651
8473
|
});
|
|
7652
8474
|
|
|
7653
|
-
// node_modules
|
|
8475
|
+
// node_modules/@msgpack/msgpack/dist.esm/decode.mjs
|
|
7654
8476
|
function decode(buffer, options) {
|
|
7655
8477
|
const decoder = new Decoder(options);
|
|
7656
8478
|
return decoder.decode(buffer);
|
|
7657
8479
|
}
|
|
7658
8480
|
var init_decode = __esm({
|
|
7659
|
-
"node_modules
|
|
8481
|
+
"node_modules/@msgpack/msgpack/dist.esm/decode.mjs"() {
|
|
7660
8482
|
"use strict";
|
|
7661
8483
|
init_Decoder();
|
|
7662
8484
|
}
|
|
7663
8485
|
});
|
|
7664
8486
|
|
|
7665
|
-
// node_modules
|
|
8487
|
+
// node_modules/@msgpack/msgpack/dist.esm/index.mjs
|
|
7666
8488
|
var init_dist = __esm({
|
|
7667
|
-
"node_modules
|
|
8489
|
+
"node_modules/@msgpack/msgpack/dist.esm/index.mjs"() {
|
|
7668
8490
|
"use strict";
|
|
7669
8491
|
init_encode();
|
|
7670
8492
|
init_decode();
|
|
7671
8493
|
}
|
|
7672
8494
|
});
|
|
7673
8495
|
|
|
7674
|
-
// node_modules
|
|
8496
|
+
// node_modules/@pmate/utils/src/Msg.ts
|
|
7675
8497
|
var encoder, Msg;
|
|
7676
8498
|
var init_Msg = __esm({
|
|
7677
|
-
"node_modules
|
|
8499
|
+
"node_modules/@pmate/utils/src/Msg.ts"() {
|
|
7678
8500
|
"use strict";
|
|
7679
8501
|
init_dist();
|
|
7680
|
-
|
|
8502
|
+
init_src4();
|
|
7681
8503
|
init_compress();
|
|
7682
8504
|
init_uniqHash();
|
|
7683
8505
|
encoder = new TextEncoder();
|
|
@@ -7802,108 +8624,108 @@ var init_Msg = __esm({
|
|
|
7802
8624
|
}
|
|
7803
8625
|
});
|
|
7804
8626
|
|
|
7805
|
-
// node_modules
|
|
8627
|
+
// node_modules/@pmate/utils/src/normalize.ts
|
|
7806
8628
|
var init_normalize = __esm({
|
|
7807
|
-
"node_modules
|
|
8629
|
+
"node_modules/@pmate/utils/src/normalize.ts"() {
|
|
7808
8630
|
"use strict";
|
|
7809
8631
|
}
|
|
7810
8632
|
});
|
|
7811
8633
|
|
|
7812
|
-
// node_modules
|
|
8634
|
+
// node_modules/@pmate/utils/src/pageURL.ts
|
|
7813
8635
|
var init_pageURL = __esm({
|
|
7814
|
-
"node_modules
|
|
8636
|
+
"node_modules/@pmate/utils/src/pageURL.ts"() {
|
|
7815
8637
|
"use strict";
|
|
7816
8638
|
}
|
|
7817
8639
|
});
|
|
7818
8640
|
|
|
7819
|
-
// node_modules
|
|
8641
|
+
// node_modules/@pmate/utils/src/PromiseQueue.ts
|
|
7820
8642
|
var init_PromiseQueue = __esm({
|
|
7821
|
-
"node_modules
|
|
8643
|
+
"node_modules/@pmate/utils/src/PromiseQueue.ts"() {
|
|
7822
8644
|
"use strict";
|
|
7823
8645
|
}
|
|
7824
8646
|
});
|
|
7825
8647
|
|
|
7826
|
-
// node_modules
|
|
8648
|
+
// node_modules/@pmate/utils/src/resourceKey.ts
|
|
7827
8649
|
var import_js_sha33;
|
|
7828
8650
|
var init_resourceKey = __esm({
|
|
7829
|
-
"node_modules
|
|
8651
|
+
"node_modules/@pmate/utils/src/resourceKey.ts"() {
|
|
7830
8652
|
"use strict";
|
|
7831
8653
|
import_js_sha33 = __toESM(require_sha3(), 1);
|
|
7832
8654
|
}
|
|
7833
8655
|
});
|
|
7834
8656
|
|
|
7835
|
-
// node_modules
|
|
8657
|
+
// node_modules/@pmate/utils/src/SelectionHelper.ts
|
|
7836
8658
|
var init_SelectionHelper = __esm({
|
|
7837
|
-
"node_modules
|
|
8659
|
+
"node_modules/@pmate/utils/src/SelectionHelper.ts"() {
|
|
7838
8660
|
"use strict";
|
|
7839
8661
|
}
|
|
7840
8662
|
});
|
|
7841
8663
|
|
|
7842
|
-
// node_modules
|
|
8664
|
+
// node_modules/@pmate/utils/src/setMinus.ts
|
|
7843
8665
|
var init_setMinus = __esm({
|
|
7844
|
-
"node_modules
|
|
8666
|
+
"node_modules/@pmate/utils/src/setMinus.ts"() {
|
|
7845
8667
|
"use strict";
|
|
7846
8668
|
}
|
|
7847
8669
|
});
|
|
7848
8670
|
|
|
7849
|
-
// node_modules
|
|
8671
|
+
// node_modules/@pmate/utils/src/sha1Hash.ts
|
|
7850
8672
|
var init_sha1Hash = __esm({
|
|
7851
|
-
"node_modules
|
|
8673
|
+
"node_modules/@pmate/utils/src/sha1Hash.ts"() {
|
|
7852
8674
|
"use strict";
|
|
7853
8675
|
}
|
|
7854
8676
|
});
|
|
7855
8677
|
|
|
7856
|
-
// node_modules
|
|
8678
|
+
// node_modules/@pmate/utils/src/TaskWaiter.ts
|
|
7857
8679
|
var init_TaskWaiter = __esm({
|
|
7858
|
-
"node_modules
|
|
8680
|
+
"node_modules/@pmate/utils/src/TaskWaiter.ts"() {
|
|
7859
8681
|
"use strict";
|
|
7860
|
-
|
|
8682
|
+
init_src5();
|
|
7861
8683
|
}
|
|
7862
8684
|
});
|
|
7863
8685
|
|
|
7864
|
-
// node_modules
|
|
8686
|
+
// node_modules/@pmate/utils/src/toSentenceAnalyze.ts
|
|
7865
8687
|
var init_toSentenceAnalyze = __esm({
|
|
7866
|
-
"node_modules
|
|
8688
|
+
"node_modules/@pmate/utils/src/toSentenceAnalyze.ts"() {
|
|
7867
8689
|
"use strict";
|
|
7868
8690
|
}
|
|
7869
8691
|
});
|
|
7870
8692
|
|
|
7871
|
-
// node_modules
|
|
8693
|
+
// node_modules/@pmate/utils/src/txtBookToJson.ts
|
|
7872
8694
|
var init_txtBookToJson = __esm({
|
|
7873
|
-
"node_modules
|
|
8695
|
+
"node_modules/@pmate/utils/src/txtBookToJson.ts"() {
|
|
7874
8696
|
"use strict";
|
|
7875
|
-
|
|
8697
|
+
init_src3();
|
|
7876
8698
|
}
|
|
7877
8699
|
});
|
|
7878
8700
|
|
|
7879
|
-
// node_modules
|
|
8701
|
+
// node_modules/@pmate/utils/src/VocabularyMap.ts
|
|
7880
8702
|
var init_VocabularyMap = __esm({
|
|
7881
|
-
"node_modules
|
|
8703
|
+
"node_modules/@pmate/utils/src/VocabularyMap.ts"() {
|
|
7882
8704
|
"use strict";
|
|
7883
8705
|
init_Emitter();
|
|
7884
8706
|
}
|
|
7885
8707
|
});
|
|
7886
8708
|
|
|
7887
|
-
// node_modules
|
|
8709
|
+
// node_modules/@pmate/utils/src/wait.ts
|
|
7888
8710
|
var init_wait = __esm({
|
|
7889
|
-
"node_modules
|
|
8711
|
+
"node_modules/@pmate/utils/src/wait.ts"() {
|
|
7890
8712
|
"use strict";
|
|
7891
8713
|
}
|
|
7892
8714
|
});
|
|
7893
8715
|
|
|
7894
|
-
// node_modules
|
|
8716
|
+
// node_modules/@pmate/utils/src/wordCount.ts
|
|
7895
8717
|
var init_wordCount = __esm({
|
|
7896
|
-
"node_modules
|
|
8718
|
+
"node_modules/@pmate/utils/src/wordCount.ts"() {
|
|
7897
8719
|
"use strict";
|
|
7898
8720
|
}
|
|
7899
8721
|
});
|
|
7900
8722
|
|
|
7901
|
-
// node_modules
|
|
8723
|
+
// node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts
|
|
7902
8724
|
var logger, WebsocketHeartbeat;
|
|
7903
8725
|
var init_WebsocketHeartbeat = __esm({
|
|
7904
|
-
"node_modules
|
|
8726
|
+
"node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts"() {
|
|
7905
8727
|
"use strict";
|
|
7906
|
-
|
|
8728
|
+
init_src4();
|
|
7907
8729
|
init_Logger();
|
|
7908
8730
|
logger = Logger.getDebugger("heartbeat");
|
|
7909
8731
|
WebsocketHeartbeat = class {
|
|
@@ -7942,12 +8764,12 @@ var init_WebsocketHeartbeat = __esm({
|
|
|
7942
8764
|
}
|
|
7943
8765
|
});
|
|
7944
8766
|
|
|
7945
|
-
// node_modules
|
|
8767
|
+
// node_modules/@pmate/utils/src/websocket/WebsocketClient.ts
|
|
7946
8768
|
var logger2;
|
|
7947
8769
|
var init_WebsocketClient = __esm({
|
|
7948
|
-
"node_modules
|
|
8770
|
+
"node_modules/@pmate/utils/src/websocket/WebsocketClient.ts"() {
|
|
7949
8771
|
"use strict";
|
|
7950
|
-
|
|
8772
|
+
init_src4();
|
|
7951
8773
|
init_Emitter();
|
|
7952
8774
|
init_Logger();
|
|
7953
8775
|
init_Msg();
|
|
@@ -7956,7 +8778,7 @@ var init_WebsocketClient = __esm({
|
|
|
7956
8778
|
}
|
|
7957
8779
|
});
|
|
7958
8780
|
|
|
7959
|
-
// node_modules
|
|
8781
|
+
// node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts
|
|
7960
8782
|
function isEventLike(value) {
|
|
7961
8783
|
return typeof value === "object" && value !== null && "type" in value && typeof value.type === "string";
|
|
7962
8784
|
}
|
|
@@ -7965,9 +8787,9 @@ function isCloseEvent(value) {
|
|
|
7965
8787
|
}
|
|
7966
8788
|
var logger3, WebsocketClientV2;
|
|
7967
8789
|
var init_WebsocketClientV2 = __esm({
|
|
7968
|
-
"node_modules
|
|
8790
|
+
"node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts"() {
|
|
7969
8791
|
"use strict";
|
|
7970
|
-
|
|
8792
|
+
init_src4();
|
|
7971
8793
|
init_AsyncStream();
|
|
7972
8794
|
init_Logger();
|
|
7973
8795
|
init_Msg();
|
|
@@ -8128,14 +8950,14 @@ var init_WebsocketClientV2 = __esm({
|
|
|
8128
8950
|
if (this.reconnectTimer) return;
|
|
8129
8951
|
const base = Math.min(1e3 * 2 ** this.reconnectAttempts, this.maxBackoffMs);
|
|
8130
8952
|
const jitter = Math.floor(Math.random() * 250);
|
|
8131
|
-
const
|
|
8953
|
+
const delay2 = base + jitter;
|
|
8132
8954
|
this.reconnectTimer = globalThis.setTimeout(() => {
|
|
8133
8955
|
if (this.ws && this.ws.readyState === WebSocket.CONNECTING) return;
|
|
8134
8956
|
this.reconnectTimer = void 0;
|
|
8135
8957
|
this.reconnectAttempts++;
|
|
8136
8958
|
logger3.log("Reconnecting... attempt", this.reconnectAttempts);
|
|
8137
8959
|
this.init();
|
|
8138
|
-
},
|
|
8960
|
+
}, delay2);
|
|
8139
8961
|
}
|
|
8140
8962
|
handleHeartbeatTimeout() {
|
|
8141
8963
|
this.close(false);
|
|
@@ -8212,10 +9034,10 @@ var init_WebsocketClientV2 = __esm({
|
|
|
8212
9034
|
}
|
|
8213
9035
|
});
|
|
8214
9036
|
|
|
8215
|
-
// node_modules
|
|
9037
|
+
// node_modules/@pmate/utils/src/websocket/H3Client.ts
|
|
8216
9038
|
var logger4;
|
|
8217
9039
|
var init_H3Client = __esm({
|
|
8218
|
-
"node_modules
|
|
9040
|
+
"node_modules/@pmate/utils/src/websocket/H3Client.ts"() {
|
|
8219
9041
|
"use strict";
|
|
8220
9042
|
init_Emitter();
|
|
8221
9043
|
init_Logger();
|
|
@@ -8225,9 +9047,9 @@ var init_H3Client = __esm({
|
|
|
8225
9047
|
}
|
|
8226
9048
|
});
|
|
8227
9049
|
|
|
8228
|
-
// node_modules
|
|
9050
|
+
// node_modules/@pmate/utils/src/websocket/index.ts
|
|
8229
9051
|
var init_websocket = __esm({
|
|
8230
|
-
"node_modules
|
|
9052
|
+
"node_modules/@pmate/utils/src/websocket/index.ts"() {
|
|
8231
9053
|
"use strict";
|
|
8232
9054
|
init_WebsocketClient();
|
|
8233
9055
|
init_WebsocketClientV2();
|
|
@@ -8235,9 +9057,9 @@ var init_websocket = __esm({
|
|
|
8235
9057
|
}
|
|
8236
9058
|
});
|
|
8237
9059
|
|
|
8238
|
-
// node_modules
|
|
8239
|
-
var
|
|
8240
|
-
"node_modules
|
|
9060
|
+
// node_modules/@pmate/utils/src/index.ts
|
|
9061
|
+
var init_src5 = __esm({
|
|
9062
|
+
"node_modules/@pmate/utils/src/index.ts"() {
|
|
8241
9063
|
"use strict";
|
|
8242
9064
|
init_base64();
|
|
8243
9065
|
init_batchResolve();
|
|
@@ -8277,7 +9099,7 @@ var init_src3 = __esm({
|
|
|
8277
9099
|
}
|
|
8278
9100
|
});
|
|
8279
9101
|
|
|
8280
|
-
// node_modules
|
|
9102
|
+
// node_modules/@pmate/agent-sdk/dist/debug.js
|
|
8281
9103
|
function isDebugEnabled() {
|
|
8282
9104
|
return process.env.DEBUG === "1";
|
|
8283
9105
|
}
|
|
@@ -8292,17 +9114,296 @@ function debugLog(message, data) {
|
|
|
8292
9114
|
console.log(message, data);
|
|
8293
9115
|
}
|
|
8294
9116
|
var init_debug = __esm({
|
|
8295
|
-
"node_modules
|
|
9117
|
+
"node_modules/@pmate/agent-sdk/dist/debug.js"() {
|
|
9118
|
+
"use strict";
|
|
9119
|
+
}
|
|
9120
|
+
});
|
|
9121
|
+
|
|
9122
|
+
// node_modules/@pmate/agent-sdk/dist/AgentConnectionPool.js
|
|
9123
|
+
function ensureProtocol(value, protocol) {
|
|
9124
|
+
if (!value) {
|
|
9125
|
+
return "";
|
|
9126
|
+
}
|
|
9127
|
+
if (/^[a-z]+:\/\//i.test(value)) {
|
|
9128
|
+
try {
|
|
9129
|
+
const url = new URL(value);
|
|
9130
|
+
url.protocol = `${protocol}:`;
|
|
9131
|
+
return url.toString();
|
|
9132
|
+
} catch {
|
|
9133
|
+
return value;
|
|
9134
|
+
}
|
|
9135
|
+
}
|
|
9136
|
+
if (value.startsWith("//")) {
|
|
9137
|
+
return `${protocol}:${value}`;
|
|
9138
|
+
}
|
|
9139
|
+
return `${protocol}://${value}`;
|
|
9140
|
+
}
|
|
9141
|
+
function createPoolKey(wsUrl, profileId, token) {
|
|
9142
|
+
return `${wsUrl}|${profileId}|${hashToken(token)}`;
|
|
9143
|
+
}
|
|
9144
|
+
function hashToken(token) {
|
|
9145
|
+
let hash = 2166136261;
|
|
9146
|
+
for (let i = 0; i < token.length; i += 1) {
|
|
9147
|
+
hash ^= token.charCodeAt(i);
|
|
9148
|
+
hash = Math.imul(hash, 16777619);
|
|
9149
|
+
}
|
|
9150
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
9151
|
+
}
|
|
9152
|
+
var IDLE_CLOSE_MS, pool, AgentConnectionPool, AgentPooledConnection;
|
|
9153
|
+
var init_AgentConnectionPool = __esm({
|
|
9154
|
+
"node_modules/@pmate/agent-sdk/dist/AgentConnectionPool.js"() {
|
|
8296
9155
|
"use strict";
|
|
9156
|
+
init_src();
|
|
9157
|
+
init_src5();
|
|
9158
|
+
init_debug();
|
|
9159
|
+
IDLE_CLOSE_MS = 5e3;
|
|
9160
|
+
pool = /* @__PURE__ */ new Map();
|
|
9161
|
+
AgentConnectionPool = class {
|
|
9162
|
+
static acquire(options) {
|
|
9163
|
+
const wsUrl = ensureProtocol(options.baseUrl, "wss");
|
|
9164
|
+
const key = createPoolKey(wsUrl, options.profileId, options.token);
|
|
9165
|
+
let entry = pool.get(key);
|
|
9166
|
+
if (!entry) {
|
|
9167
|
+
entry = {
|
|
9168
|
+
connection: new AgentPooledConnection(wsUrl, options.profileId, options.token),
|
|
9169
|
+
refCount: 0,
|
|
9170
|
+
idleTimer: null
|
|
9171
|
+
};
|
|
9172
|
+
pool.set(key, entry);
|
|
9173
|
+
}
|
|
9174
|
+
if (entry.idleTimer) {
|
|
9175
|
+
clearTimeout(entry.idleTimer);
|
|
9176
|
+
entry.idleTimer = null;
|
|
9177
|
+
}
|
|
9178
|
+
entry.refCount += 1;
|
|
9179
|
+
return {
|
|
9180
|
+
key,
|
|
9181
|
+
connection: entry.connection
|
|
9182
|
+
};
|
|
9183
|
+
}
|
|
9184
|
+
static release(lease) {
|
|
9185
|
+
const entry = pool.get(lease.key);
|
|
9186
|
+
if (!entry) {
|
|
9187
|
+
return;
|
|
9188
|
+
}
|
|
9189
|
+
entry.refCount = Math.max(0, entry.refCount - 1);
|
|
9190
|
+
if (entry.refCount > 0 || entry.idleTimer) {
|
|
9191
|
+
return;
|
|
9192
|
+
}
|
|
9193
|
+
entry.idleTimer = setTimeout(() => {
|
|
9194
|
+
const current = pool.get(lease.key);
|
|
9195
|
+
if (!current || current.refCount > 0) {
|
|
9196
|
+
return;
|
|
9197
|
+
}
|
|
9198
|
+
current.connection.close();
|
|
9199
|
+
pool.delete(lease.key);
|
|
9200
|
+
}, IDLE_CLOSE_MS);
|
|
9201
|
+
}
|
|
9202
|
+
static clearForTests() {
|
|
9203
|
+
for (const [key, entry] of pool.entries()) {
|
|
9204
|
+
if (entry.idleTimer) {
|
|
9205
|
+
clearTimeout(entry.idleTimer);
|
|
9206
|
+
}
|
|
9207
|
+
entry.connection.close();
|
|
9208
|
+
pool.delete(key);
|
|
9209
|
+
}
|
|
9210
|
+
}
|
|
9211
|
+
};
|
|
9212
|
+
AgentPooledConnection = class {
|
|
9213
|
+
constructor(wsUrl, profileId, token) {
|
|
9214
|
+
this.profileId = profileId;
|
|
9215
|
+
this.token = token;
|
|
9216
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
9217
|
+
this.authPromise = null;
|
|
9218
|
+
this.authResolve = null;
|
|
9219
|
+
this.authReject = null;
|
|
9220
|
+
this.authTimer = null;
|
|
9221
|
+
this.authenticated = false;
|
|
9222
|
+
this.authStarted = false;
|
|
9223
|
+
this.ws = new WebsocketClientV2(wsUrl);
|
|
9224
|
+
this.startWsStream();
|
|
9225
|
+
}
|
|
9226
|
+
addListener(listener) {
|
|
9227
|
+
this.listeners.add(listener);
|
|
9228
|
+
}
|
|
9229
|
+
removeListener(listener) {
|
|
9230
|
+
this.listeners.delete(listener);
|
|
9231
|
+
}
|
|
9232
|
+
isConnected() {
|
|
9233
|
+
return this.ws.isConnected();
|
|
9234
|
+
}
|
|
9235
|
+
async authenticate(timeoutMs) {
|
|
9236
|
+
await this.waitForConnection(timeoutMs);
|
|
9237
|
+
if (this.authenticated) {
|
|
9238
|
+
debugLog("[agent-connection-pool] auth reused", {
|
|
9239
|
+
profileId: this.profileId
|
|
9240
|
+
});
|
|
9241
|
+
return;
|
|
9242
|
+
}
|
|
9243
|
+
const waiter = this.waitForAuthAck(timeoutMs);
|
|
9244
|
+
if (!this.authStarted) {
|
|
9245
|
+
this.authStarted = true;
|
|
9246
|
+
const msg = Msg.create(this.profileId, "@hub", 4 /* AUTH */, {
|
|
9247
|
+
token: this.token,
|
|
9248
|
+
as: "user",
|
|
9249
|
+
profileId: this.profileId
|
|
9250
|
+
});
|
|
9251
|
+
debugLog("[agent-connection-pool] auth sent", {
|
|
9252
|
+
profileId: this.profileId
|
|
9253
|
+
});
|
|
9254
|
+
await this.ws.sendMsg(msg);
|
|
9255
|
+
}
|
|
9256
|
+
await waiter;
|
|
9257
|
+
}
|
|
9258
|
+
sendMsg(msg) {
|
|
9259
|
+
return this.ws.sendMsg(msg);
|
|
9260
|
+
}
|
|
9261
|
+
close() {
|
|
9262
|
+
this.ws.close();
|
|
9263
|
+
this.rejectAuth(new Error("Agent websocket closed before auth ack"));
|
|
9264
|
+
this.listeners.clear();
|
|
9265
|
+
}
|
|
9266
|
+
async startWsStream() {
|
|
9267
|
+
const stream = this.ws.getStream();
|
|
9268
|
+
try {
|
|
9269
|
+
for await (const event of stream) {
|
|
9270
|
+
this.handleWsEvent(event);
|
|
9271
|
+
}
|
|
9272
|
+
} catch {
|
|
9273
|
+
}
|
|
9274
|
+
}
|
|
9275
|
+
handleWsEvent(event) {
|
|
9276
|
+
if (event.type === "message") {
|
|
9277
|
+
this.handleIncomingMessage(event.data);
|
|
9278
|
+
return;
|
|
9279
|
+
}
|
|
9280
|
+
if (event.type === "connected" && !event.data) {
|
|
9281
|
+
this.authenticated = false;
|
|
9282
|
+
this.rejectAuth(new Error("Agent websocket disconnected before auth ack"));
|
|
9283
|
+
}
|
|
9284
|
+
if (event.type === "error") {
|
|
9285
|
+
this.rejectAuth(new Error("Agent websocket error before auth ack"));
|
|
9286
|
+
}
|
|
9287
|
+
this.broadcast(event);
|
|
9288
|
+
}
|
|
9289
|
+
handleIncomingMessage(message) {
|
|
9290
|
+
if (!message || typeof message !== "object") {
|
|
9291
|
+
return;
|
|
9292
|
+
}
|
|
9293
|
+
if (message.opcode === 3 /* ACK */) {
|
|
9294
|
+
const ack = message.body;
|
|
9295
|
+
const success = ack?.status === "ok";
|
|
9296
|
+
debugLog("[agent-connection-pool] ack received", {
|
|
9297
|
+
profileId: this.profileId,
|
|
9298
|
+
success
|
|
9299
|
+
});
|
|
9300
|
+
if (!success) {
|
|
9301
|
+
this.rejectAuth(new Error(ack?.message ?? ack?.code ?? "Auth failed"));
|
|
9302
|
+
return;
|
|
9303
|
+
}
|
|
9304
|
+
this.authenticated = true;
|
|
9305
|
+
this.resolveAuth();
|
|
9306
|
+
return;
|
|
9307
|
+
}
|
|
9308
|
+
debugLog("[agent-connection-pool] message broadcast", {
|
|
9309
|
+
opcode: message.opcode,
|
|
9310
|
+
from: message.from,
|
|
9311
|
+
to: message.to
|
|
9312
|
+
});
|
|
9313
|
+
this.broadcast({ type: "message", data: message });
|
|
9314
|
+
}
|
|
9315
|
+
broadcast(event) {
|
|
9316
|
+
for (const listener of this.listeners) {
|
|
9317
|
+
listener.onConnectionEvent(event);
|
|
9318
|
+
}
|
|
9319
|
+
}
|
|
9320
|
+
waitForConnection(timeoutMs) {
|
|
9321
|
+
if (this.ws.isConnected()) {
|
|
9322
|
+
return Promise.resolve();
|
|
9323
|
+
}
|
|
9324
|
+
return new Promise((resolve, reject) => {
|
|
9325
|
+
const timer = setTimeout(() => {
|
|
9326
|
+
off();
|
|
9327
|
+
reject(new Error("Websocket connect timeout"));
|
|
9328
|
+
}, timeoutMs);
|
|
9329
|
+
const off = this.createOneShotListener("connected" /* Connected */, (connected) => {
|
|
9330
|
+
if (connected) {
|
|
9331
|
+
clearTimeout(timer);
|
|
9332
|
+
off();
|
|
9333
|
+
resolve();
|
|
9334
|
+
}
|
|
9335
|
+
});
|
|
9336
|
+
});
|
|
9337
|
+
}
|
|
9338
|
+
waitForAuthAck(timeoutMs) {
|
|
9339
|
+
if (this.authenticated) {
|
|
9340
|
+
return Promise.resolve();
|
|
9341
|
+
}
|
|
9342
|
+
if (this.authPromise) {
|
|
9343
|
+
return this.authPromise;
|
|
9344
|
+
}
|
|
9345
|
+
this.authPromise = new Promise((resolve, reject) => {
|
|
9346
|
+
this.authResolve = resolve;
|
|
9347
|
+
this.authReject = reject;
|
|
9348
|
+
this.authTimer = setTimeout(() => {
|
|
9349
|
+
this.clearAuthWaiter();
|
|
9350
|
+
this.authStarted = false;
|
|
9351
|
+
reject(new Error("Auth timeout"));
|
|
9352
|
+
}, timeoutMs);
|
|
9353
|
+
});
|
|
9354
|
+
return this.authPromise;
|
|
9355
|
+
}
|
|
9356
|
+
resolveAuth() {
|
|
9357
|
+
if (!this.authResolve) {
|
|
9358
|
+
return;
|
|
9359
|
+
}
|
|
9360
|
+
const resolve = this.authResolve;
|
|
9361
|
+
this.clearAuthWaiter();
|
|
9362
|
+
this.authStarted = false;
|
|
9363
|
+
resolve();
|
|
9364
|
+
}
|
|
9365
|
+
rejectAuth(error) {
|
|
9366
|
+
if (!this.authReject) {
|
|
9367
|
+
return;
|
|
9368
|
+
}
|
|
9369
|
+
const reject = this.authReject;
|
|
9370
|
+
this.clearAuthWaiter();
|
|
9371
|
+
this.authStarted = false;
|
|
9372
|
+
reject(error);
|
|
9373
|
+
}
|
|
9374
|
+
clearAuthWaiter() {
|
|
9375
|
+
if (this.authTimer) {
|
|
9376
|
+
clearTimeout(this.authTimer);
|
|
9377
|
+
this.authTimer = null;
|
|
9378
|
+
}
|
|
9379
|
+
this.authPromise = null;
|
|
9380
|
+
this.authResolve = null;
|
|
9381
|
+
this.authReject = null;
|
|
9382
|
+
}
|
|
9383
|
+
createOneShotListener(eventName, handler) {
|
|
9384
|
+
const listener = {
|
|
9385
|
+
onConnectionEvent: (event) => {
|
|
9386
|
+
if (eventName === "connected" /* Connected */ && event.type === "connected") {
|
|
9387
|
+
;
|
|
9388
|
+
handler(event.data);
|
|
9389
|
+
}
|
|
9390
|
+
}
|
|
9391
|
+
};
|
|
9392
|
+
this.addListener(listener);
|
|
9393
|
+
return () => {
|
|
9394
|
+
this.removeListener(listener);
|
|
9395
|
+
};
|
|
9396
|
+
}
|
|
9397
|
+
};
|
|
8297
9398
|
}
|
|
8298
9399
|
});
|
|
8299
9400
|
|
|
8300
|
-
// node_modules
|
|
9401
|
+
// node_modules/@pmate/agent-sdk/dist/AgentTaskManager.js
|
|
8301
9402
|
var AgentTaskManager;
|
|
8302
9403
|
var init_AgentTaskManager = __esm({
|
|
8303
|
-
"node_modules
|
|
9404
|
+
"node_modules/@pmate/agent-sdk/dist/AgentTaskManager.js"() {
|
|
8304
9405
|
"use strict";
|
|
8305
|
-
|
|
9406
|
+
init_src5();
|
|
8306
9407
|
init_debug();
|
|
8307
9408
|
AgentTaskManager = class {
|
|
8308
9409
|
constructor() {
|
|
@@ -8469,7 +9570,56 @@ var init_AgentTaskManager = __esm({
|
|
|
8469
9570
|
}
|
|
8470
9571
|
});
|
|
8471
9572
|
|
|
8472
|
-
// node_modules
|
|
9573
|
+
// node_modules/@pmate/agent-sdk/dist/promptMany.js
|
|
9574
|
+
async function mapWithConcurrency(inputs, concurrency, run) {
|
|
9575
|
+
if (!Number.isInteger(concurrency) || concurrency < 1) {
|
|
9576
|
+
throw new Error("concurrency must be a positive integer");
|
|
9577
|
+
}
|
|
9578
|
+
const results = new Array(inputs.length);
|
|
9579
|
+
let nextIndex = 0;
|
|
9580
|
+
const workers = Array.from({ length: Math.min(concurrency, inputs.length) }, async () => {
|
|
9581
|
+
while (nextIndex < inputs.length) {
|
|
9582
|
+
const index = nextIndex;
|
|
9583
|
+
nextIndex += 1;
|
|
9584
|
+
try {
|
|
9585
|
+
results[index] = {
|
|
9586
|
+
ok: true,
|
|
9587
|
+
value: await run(inputs[index], index)
|
|
9588
|
+
};
|
|
9589
|
+
} catch (error) {
|
|
9590
|
+
const candidate = error;
|
|
9591
|
+
results[index] = {
|
|
9592
|
+
ok: false,
|
|
9593
|
+
error: {
|
|
9594
|
+
...typeof candidate?.code === "string" ? { code: candidate.code } : {},
|
|
9595
|
+
message: typeof candidate?.message === "string" ? candidate.message : String(error)
|
|
9596
|
+
}
|
|
9597
|
+
};
|
|
9598
|
+
}
|
|
9599
|
+
}
|
|
9600
|
+
});
|
|
9601
|
+
await Promise.all(workers);
|
|
9602
|
+
return results;
|
|
9603
|
+
}
|
|
9604
|
+
var init_promptMany = __esm({
|
|
9605
|
+
"node_modules/@pmate/agent-sdk/dist/promptMany.js"() {
|
|
9606
|
+
"use strict";
|
|
9607
|
+
}
|
|
9608
|
+
});
|
|
9609
|
+
|
|
9610
|
+
// node_modules/@pmate/agent-sdk/dist/AgentClient.js
|
|
9611
|
+
function isPromptBatchTerminal(status) {
|
|
9612
|
+
return status === "completed" || status === "failed" || status === "expired" || status === "cancelled";
|
|
9613
|
+
}
|
|
9614
|
+
function delay(ms) {
|
|
9615
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
9616
|
+
}
|
|
9617
|
+
function requireBatchResponse(value) {
|
|
9618
|
+
if (value === null) {
|
|
9619
|
+
throw new Error("LLM batch control returned an empty response");
|
|
9620
|
+
}
|
|
9621
|
+
return value;
|
|
9622
|
+
}
|
|
8473
9623
|
function createAgentRequestBody(payload) {
|
|
8474
9624
|
return {
|
|
8475
9625
|
kind: "request",
|
|
@@ -8478,12 +9628,14 @@ function createAgentRequestBody(payload) {
|
|
|
8478
9628
|
}
|
|
8479
9629
|
var logger5, DEFAULT_TIMEOUT_MS, DEFAULT_STREAM_TIMEOUT_MS, DEFAULT_MIN_CHUNK_SIZE_BYTES, AgentClient;
|
|
8480
9630
|
var init_AgentClient = __esm({
|
|
8481
|
-
"node_modules
|
|
9631
|
+
"node_modules/@pmate/agent-sdk/dist/AgentClient.js"() {
|
|
8482
9632
|
"use strict";
|
|
8483
9633
|
init_src();
|
|
8484
|
-
|
|
9634
|
+
init_src5();
|
|
9635
|
+
init_AgentConnectionPool();
|
|
8485
9636
|
init_AgentTaskManager();
|
|
8486
9637
|
init_debug();
|
|
9638
|
+
init_promptMany();
|
|
8487
9639
|
logger5 = Logger.getDebugger("AgentClient");
|
|
8488
9640
|
DEFAULT_TIMEOUT_MS = 4e4;
|
|
8489
9641
|
DEFAULT_STREAM_TIMEOUT_MS = 12e4;
|
|
@@ -8492,11 +9644,6 @@ var init_AgentClient = __esm({
|
|
|
8492
9644
|
constructor(options) {
|
|
8493
9645
|
super();
|
|
8494
9646
|
this.tasks = new AgentTaskManager();
|
|
8495
|
-
this.authPromise = null;
|
|
8496
|
-
this.authResolve = null;
|
|
8497
|
-
this.authReject = null;
|
|
8498
|
-
this.authTimer = null;
|
|
8499
|
-
this.wsGeneration = 0;
|
|
8500
9647
|
this.defaultRequestType = "application/json";
|
|
8501
9648
|
this.defaultBinaryType = "application/octet-stream";
|
|
8502
9649
|
this.baseUrl = options.baseUrl;
|
|
@@ -8504,13 +9651,12 @@ var init_AgentClient = __esm({
|
|
|
8504
9651
|
this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
8505
9652
|
this.streamTimeoutMs = options.streamTimeoutMs ?? DEFAULT_STREAM_TIMEOUT_MS;
|
|
8506
9653
|
this.minChunkSizeBytes = options.minChunkSizeBytes ?? DEFAULT_MIN_CHUNK_SIZE_BYTES;
|
|
8507
|
-
this.resetWebsocket(this.baseUrl);
|
|
8508
9654
|
}
|
|
8509
9655
|
isConnected() {
|
|
8510
|
-
return this.
|
|
9656
|
+
return this.lease?.connection.isConnected() ?? false;
|
|
8511
9657
|
}
|
|
8512
9658
|
close() {
|
|
8513
|
-
this.
|
|
9659
|
+
this.releaseConnection();
|
|
8514
9660
|
}
|
|
8515
9661
|
async login(options) {
|
|
8516
9662
|
const profileId = options?.profileId;
|
|
@@ -8519,13 +9665,19 @@ var init_AgentClient = __esm({
|
|
|
8519
9665
|
}
|
|
8520
9666
|
this.from = profileId;
|
|
8521
9667
|
const baseUrl = options?.baseUrl ?? this.baseUrl;
|
|
8522
|
-
if (baseUrl !== this.baseUrl) {
|
|
8523
|
-
this.resetWebsocket(baseUrl);
|
|
8524
|
-
}
|
|
8525
9668
|
const timeoutMs = options?.timeoutMs ?? this.timeoutMs;
|
|
8526
|
-
await this.waitForConnection(timeoutMs);
|
|
8527
9669
|
const token = options?.token ?? "";
|
|
8528
|
-
|
|
9670
|
+
this.auth = { token, profileId };
|
|
9671
|
+
const lease = AgentConnectionPool.acquire({ baseUrl, token, profileId });
|
|
9672
|
+
if (this.lease?.key !== lease.key) {
|
|
9673
|
+
this.releaseConnection();
|
|
9674
|
+
this.lease = lease;
|
|
9675
|
+
this.lease.connection.addListener(this);
|
|
9676
|
+
} else {
|
|
9677
|
+
AgentConnectionPool.release(lease);
|
|
9678
|
+
}
|
|
9679
|
+
this.baseUrl = baseUrl;
|
|
9680
|
+
await this.lease.connection.authenticate(timeoutMs);
|
|
8529
9681
|
return true;
|
|
8530
9682
|
}
|
|
8531
9683
|
async prompt(request) {
|
|
@@ -8534,6 +9686,92 @@ var init_AgentClient = __esm({
|
|
|
8534
9686
|
payload: request.payload
|
|
8535
9687
|
});
|
|
8536
9688
|
}
|
|
9689
|
+
async promptMany(request) {
|
|
9690
|
+
return mapWithConcurrency(request.requests, request.concurrency ?? 10, (item) => this.prompt(item));
|
|
9691
|
+
}
|
|
9692
|
+
async submitPromptBatch(request) {
|
|
9693
|
+
return requireBatchResponse(await this.runInternal({
|
|
9694
|
+
agentId: request.agentId,
|
|
9695
|
+
payload: {
|
|
9696
|
+
__pmateLlmBatch: {
|
|
9697
|
+
operation: "submit",
|
|
9698
|
+
items: request.items,
|
|
9699
|
+
metadata: request.metadata
|
|
9700
|
+
}
|
|
9701
|
+
}
|
|
9702
|
+
}));
|
|
9703
|
+
}
|
|
9704
|
+
async getPromptBatch(request) {
|
|
9705
|
+
return requireBatchResponse(await this.runInternal({
|
|
9706
|
+
agentId: request.agentId,
|
|
9707
|
+
payload: {
|
|
9708
|
+
__pmateLlmBatch: {
|
|
9709
|
+
operation: "get",
|
|
9710
|
+
batchId: request.batchId
|
|
9711
|
+
}
|
|
9712
|
+
}
|
|
9713
|
+
}));
|
|
9714
|
+
}
|
|
9715
|
+
async getPromptBatchResults(request) {
|
|
9716
|
+
return requireBatchResponse(await this.runInternal({
|
|
9717
|
+
agentId: request.agentId,
|
|
9718
|
+
payload: {
|
|
9719
|
+
__pmateLlmBatch: {
|
|
9720
|
+
operation: "results",
|
|
9721
|
+
batchId: request.batchId
|
|
9722
|
+
}
|
|
9723
|
+
}
|
|
9724
|
+
}));
|
|
9725
|
+
}
|
|
9726
|
+
async waitPromptBatch(request) {
|
|
9727
|
+
const pollIntervalMs = request.pollIntervalMs ?? 1e4;
|
|
9728
|
+
const timeoutMs = request.timeoutMs ?? 24 * 60 * 60 * 1e3;
|
|
9729
|
+
if (!Number.isFinite(pollIntervalMs) || pollIntervalMs < 1) {
|
|
9730
|
+
throw new Error("pollIntervalMs must be a positive number");
|
|
9731
|
+
}
|
|
9732
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs < 1) {
|
|
9733
|
+
throw new Error("timeoutMs must be a positive number");
|
|
9734
|
+
}
|
|
9735
|
+
const deadline = Date.now() + timeoutMs;
|
|
9736
|
+
while (true) {
|
|
9737
|
+
const batch = await this.getPromptBatch(request);
|
|
9738
|
+
if (isPromptBatchTerminal(batch.status)) {
|
|
9739
|
+
return batch;
|
|
9740
|
+
}
|
|
9741
|
+
const remainingMs = deadline - Date.now();
|
|
9742
|
+
if (remainingMs <= 0) {
|
|
9743
|
+
throw new Error(`Timed out waiting for prompt batch "${request.batchId}"; the server-side batch was not cancelled`);
|
|
9744
|
+
}
|
|
9745
|
+
await delay(Math.min(pollIntervalMs, remainingMs));
|
|
9746
|
+
}
|
|
9747
|
+
}
|
|
9748
|
+
async promptBatch(request) {
|
|
9749
|
+
const submitted = await this.submitPromptBatch(request);
|
|
9750
|
+
const completed = await this.waitPromptBatch({
|
|
9751
|
+
agentId: request.agentId,
|
|
9752
|
+
batchId: submitted.id,
|
|
9753
|
+
pollIntervalMs: request.pollIntervalMs,
|
|
9754
|
+
timeoutMs: request.timeoutMs
|
|
9755
|
+
});
|
|
9756
|
+
if (completed.status === "failed" || completed.status === "cancelled") {
|
|
9757
|
+
throw new Error(`Prompt batch "${completed.id}" ended with status "${completed.status}"`);
|
|
9758
|
+
}
|
|
9759
|
+
return this.getPromptBatchResults({
|
|
9760
|
+
agentId: request.agentId,
|
|
9761
|
+
batchId: completed.id
|
|
9762
|
+
});
|
|
9763
|
+
}
|
|
9764
|
+
async cancelPromptBatch(request) {
|
|
9765
|
+
return requireBatchResponse(await this.runInternal({
|
|
9766
|
+
agentId: request.agentId,
|
|
9767
|
+
payload: {
|
|
9768
|
+
__pmateLlmBatch: {
|
|
9769
|
+
operation: "cancel",
|
|
9770
|
+
batchId: request.batchId
|
|
9771
|
+
}
|
|
9772
|
+
}
|
|
9773
|
+
}));
|
|
9774
|
+
}
|
|
8537
9775
|
async generateImage(request) {
|
|
8538
9776
|
return this.runInternal({
|
|
8539
9777
|
agentId: request.agentId,
|
|
@@ -8562,11 +9800,18 @@ var init_AgentClient = __esm({
|
|
|
8562
9800
|
taskId,
|
|
8563
9801
|
agentId: request.agentId,
|
|
8564
9802
|
op: 0 /* Start */,
|
|
9803
|
+
auth: this.auth,
|
|
8565
9804
|
type: this.defaultRequestType,
|
|
8566
9805
|
...request.payload ? { payload: request.payload } : {}
|
|
8567
9806
|
};
|
|
8568
9807
|
const msg = Msg.create(this.from, hubTo, 2 /* AGENT */, createAgentRequestBody(startPayload), 0 /* PIPELINE */);
|
|
8569
|
-
|
|
9808
|
+
debugLog("[agent-client] sending agent request", {
|
|
9809
|
+
taskId,
|
|
9810
|
+
agentId: request.agentId,
|
|
9811
|
+
from: this.from,
|
|
9812
|
+
to: hubTo
|
|
9813
|
+
});
|
|
9814
|
+
await this.lease.connection.sendMsg(msg);
|
|
8570
9815
|
return await waiter;
|
|
8571
9816
|
}
|
|
8572
9817
|
stream(request) {
|
|
@@ -8578,7 +9823,7 @@ var init_AgentClient = __esm({
|
|
|
8578
9823
|
timeoutMode: "reject"
|
|
8579
9824
|
});
|
|
8580
9825
|
const from = this.from;
|
|
8581
|
-
const
|
|
9826
|
+
const connection = this.lease.connection;
|
|
8582
9827
|
const minChunkSizeBytes = request.minChunkSizeBytes ?? this.minChunkSizeBytes;
|
|
8583
9828
|
const inputStream = minChunkSizeBytes > 0 ? AsyncStream.chunkBlob(request.stream, {
|
|
8584
9829
|
minBytes: minChunkSizeBytes
|
|
@@ -8620,29 +9865,32 @@ var init_AgentClient = __esm({
|
|
|
8620
9865
|
taskId,
|
|
8621
9866
|
agentId: request.agentId,
|
|
8622
9867
|
op: 0 /* Start */,
|
|
9868
|
+
auth: this.auth,
|
|
8623
9869
|
type: this.defaultRequestType,
|
|
8624
9870
|
...request.params ? { payload: request.params } : {}
|
|
8625
9871
|
}), 0 /* PIPELINE */);
|
|
8626
|
-
await
|
|
9872
|
+
await connection.sendMsg(startMsg);
|
|
8627
9873
|
for await (const payload of inputStream) {
|
|
8628
9874
|
const dataType = payload instanceof Blob ? payload.type || this.defaultBinaryType : payload instanceof Uint8Array || payload instanceof ArrayBuffer ? this.defaultBinaryType : typeof payload === "string" ? "text" : this.defaultRequestType;
|
|
8629
9875
|
const body = {
|
|
8630
9876
|
taskId,
|
|
8631
9877
|
agentId: request.agentId,
|
|
8632
9878
|
op: 1 /* Data */,
|
|
9879
|
+
auth: this.auth,
|
|
8633
9880
|
type: dataType,
|
|
8634
9881
|
payload
|
|
8635
9882
|
};
|
|
8636
9883
|
const msg = Msg.create(from, hubTo, 2 /* AGENT */, createAgentRequestBody(body), 0 /* PIPELINE */);
|
|
8637
|
-
await
|
|
9884
|
+
await connection.sendMsg(msg);
|
|
8638
9885
|
}
|
|
8639
9886
|
const endMsg = Msg.create(from, hubTo, 2 /* AGENT */, createAgentRequestBody({
|
|
8640
9887
|
taskId,
|
|
8641
9888
|
agentId: request.agentId,
|
|
8642
9889
|
op: 2 /* End */,
|
|
9890
|
+
auth: this.auth,
|
|
8643
9891
|
type: this.defaultRequestType
|
|
8644
9892
|
}), 0 /* PIPELINE */);
|
|
8645
|
-
await
|
|
9893
|
+
await connection.sendMsg(endMsg);
|
|
8646
9894
|
};
|
|
8647
9895
|
void startDataStream();
|
|
8648
9896
|
const agentStream = outputStream;
|
|
@@ -8693,7 +9941,7 @@ var init_AgentClient = __esm({
|
|
|
8693
9941
|
return agentStream;
|
|
8694
9942
|
}
|
|
8695
9943
|
ensureReady() {
|
|
8696
|
-
if (!this.
|
|
9944
|
+
if (!this.lease || !this.from || !this.auth) {
|
|
8697
9945
|
throw new Error("AgentClient not logged in");
|
|
8698
9946
|
}
|
|
8699
9947
|
}
|
|
@@ -8701,31 +9949,7 @@ var init_AgentClient = __esm({
|
|
|
8701
9949
|
const rnd = Math.floor(Math.random() * 1e12);
|
|
8702
9950
|
return uniqHash(`${agentId}-${Date.now()}-${rnd}`, "task-v1" /* Task */);
|
|
8703
9951
|
}
|
|
8704
|
-
|
|
8705
|
-
return new WebsocketClientV2(this.ensureProtocol(baseUrl, "wss"));
|
|
8706
|
-
}
|
|
8707
|
-
resetWebsocket(baseUrl) {
|
|
8708
|
-
this.baseUrl = baseUrl;
|
|
8709
|
-
if (this.ws) {
|
|
8710
|
-
this.ws.close();
|
|
8711
|
-
}
|
|
8712
|
-
this.ws = this.createWebsocketClient(this.baseUrl);
|
|
8713
|
-
this.wsGeneration += 1;
|
|
8714
|
-
this.startWsStream(this.ws, this.wsGeneration);
|
|
8715
|
-
}
|
|
8716
|
-
async startWsStream(ws, generation) {
|
|
8717
|
-
const stream = ws.getStream();
|
|
8718
|
-
try {
|
|
8719
|
-
for await (const event of stream) {
|
|
8720
|
-
if (generation !== this.wsGeneration) {
|
|
8721
|
-
break;
|
|
8722
|
-
}
|
|
8723
|
-
this.handleWsEvent(event);
|
|
8724
|
-
}
|
|
8725
|
-
} catch {
|
|
8726
|
-
}
|
|
8727
|
-
}
|
|
8728
|
-
handleWsEvent(event) {
|
|
9952
|
+
onConnectionEvent(event) {
|
|
8729
9953
|
if (event.type === "message") {
|
|
8730
9954
|
this.handleIncomingMessage(event.data);
|
|
8731
9955
|
return;
|
|
@@ -8736,30 +9960,16 @@ var init_AgentClient = __esm({
|
|
|
8736
9960
|
}
|
|
8737
9961
|
if (event.type === "connected") {
|
|
8738
9962
|
this.emit("connected" /* Connected */, event.data);
|
|
8739
|
-
if (!event.data) {
|
|
8740
|
-
this.rejectAuth(new Error("Agent websocket disconnected before auth ack"));
|
|
8741
|
-
}
|
|
8742
9963
|
return;
|
|
8743
9964
|
}
|
|
8744
9965
|
if (event.type === "error") {
|
|
8745
9966
|
this.emit("error" /* Error */, event.data);
|
|
8746
|
-
this.rejectAuth(new Error("Agent websocket error before auth ack"));
|
|
8747
9967
|
}
|
|
8748
9968
|
}
|
|
8749
9969
|
handleIncomingMessage(message) {
|
|
8750
9970
|
if (!message || typeof message !== "object") {
|
|
8751
9971
|
return;
|
|
8752
9972
|
}
|
|
8753
|
-
if (message.opcode === 3 /* ACK */) {
|
|
8754
|
-
const ack = message.body;
|
|
8755
|
-
const success = ack?.status === "ok";
|
|
8756
|
-
if (!success) {
|
|
8757
|
-
this.rejectAuth(new Error(ack?.message ?? ack?.code ?? "Auth failed"));
|
|
8758
|
-
return;
|
|
8759
|
-
}
|
|
8760
|
-
this.resolveAuth();
|
|
8761
|
-
return;
|
|
8762
|
-
}
|
|
8763
9973
|
if (message.opcode === 2 /* AGENT */) {
|
|
8764
9974
|
const agentBody = message.body;
|
|
8765
9975
|
if (agentBody?.kind !== "response") {
|
|
@@ -8777,158 +9987,75 @@ var init_AgentClient = __esm({
|
|
|
8777
9987
|
this.tasks.handleResponse(body);
|
|
8778
9988
|
}
|
|
8779
9989
|
}
|
|
8780
|
-
|
|
8781
|
-
if (!
|
|
8782
|
-
return "";
|
|
8783
|
-
}
|
|
8784
|
-
if (/^[a-z]+:\/\//i.test(value)) {
|
|
8785
|
-
try {
|
|
8786
|
-
const url = new URL(value);
|
|
8787
|
-
url.protocol = `${protocol}:`;
|
|
8788
|
-
return url.toString();
|
|
8789
|
-
} catch {
|
|
8790
|
-
return value;
|
|
8791
|
-
}
|
|
8792
|
-
}
|
|
8793
|
-
if (value.startsWith("//")) {
|
|
8794
|
-
return `${protocol}:${value}`;
|
|
8795
|
-
}
|
|
8796
|
-
return `${protocol}://${value}`;
|
|
8797
|
-
}
|
|
8798
|
-
waitForConnection(timeoutMs) {
|
|
8799
|
-
if (!this.ws) {
|
|
8800
|
-
return Promise.reject(new Error("Websocket client not initialized"));
|
|
8801
|
-
}
|
|
8802
|
-
if (this.ws.isConnected()) {
|
|
8803
|
-
return Promise.resolve();
|
|
8804
|
-
}
|
|
8805
|
-
return new Promise((resolve, reject) => {
|
|
8806
|
-
const timer = setTimeout(() => {
|
|
8807
|
-
off();
|
|
8808
|
-
reject(new Error("Websocket connect timeout"));
|
|
8809
|
-
}, timeoutMs);
|
|
8810
|
-
const off = this.on("connected" /* Connected */, (connected) => {
|
|
8811
|
-
if (connected) {
|
|
8812
|
-
clearTimeout(timer);
|
|
8813
|
-
off();
|
|
8814
|
-
resolve();
|
|
8815
|
-
}
|
|
8816
|
-
});
|
|
8817
|
-
});
|
|
8818
|
-
}
|
|
8819
|
-
async sendAuth(token, timeoutMs, profileId) {
|
|
8820
|
-
if (!this.ws || !this.from) {
|
|
8821
|
-
throw new Error("AgentClient not initialized");
|
|
8822
|
-
}
|
|
8823
|
-
const body = {
|
|
8824
|
-
token,
|
|
8825
|
-
as: "user",
|
|
8826
|
-
profileId
|
|
8827
|
-
};
|
|
8828
|
-
const msg = Msg.create(this.from, "@hub", 4 /* AUTH */, body);
|
|
8829
|
-
const waiter = this.waitForAuthAck(timeoutMs);
|
|
8830
|
-
await this.ws.sendMsg(msg);
|
|
8831
|
-
await waiter;
|
|
8832
|
-
}
|
|
8833
|
-
waitForAuthAck(timeoutMs) {
|
|
8834
|
-
if (this.authPromise) {
|
|
8835
|
-
return this.authPromise;
|
|
8836
|
-
}
|
|
8837
|
-
this.authPromise = new Promise((resolve, reject) => {
|
|
8838
|
-
this.authResolve = resolve;
|
|
8839
|
-
this.authReject = reject;
|
|
8840
|
-
this.authTimer = setTimeout(() => {
|
|
8841
|
-
this.clearAuthWaiter();
|
|
8842
|
-
reject(new Error("Auth timeout"));
|
|
8843
|
-
}, timeoutMs);
|
|
8844
|
-
});
|
|
8845
|
-
return this.authPromise;
|
|
8846
|
-
}
|
|
8847
|
-
resolveAuth() {
|
|
8848
|
-
if (!this.authResolve) {
|
|
8849
|
-
return;
|
|
8850
|
-
}
|
|
8851
|
-
const resolve = this.authResolve;
|
|
8852
|
-
this.clearAuthWaiter();
|
|
8853
|
-
resolve();
|
|
8854
|
-
}
|
|
8855
|
-
rejectAuth(error) {
|
|
8856
|
-
if (!this.authReject) {
|
|
9990
|
+
releaseConnection() {
|
|
9991
|
+
if (!this.lease) {
|
|
8857
9992
|
return;
|
|
8858
9993
|
}
|
|
8859
|
-
|
|
8860
|
-
this.
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
clearAuthWaiter() {
|
|
8864
|
-
if (this.authTimer) {
|
|
8865
|
-
clearTimeout(this.authTimer);
|
|
8866
|
-
this.authTimer = null;
|
|
8867
|
-
}
|
|
8868
|
-
this.authPromise = null;
|
|
8869
|
-
this.authResolve = null;
|
|
8870
|
-
this.authReject = null;
|
|
9994
|
+
this.lease.connection.removeListener(this);
|
|
9995
|
+
AgentConnectionPool.release(this.lease);
|
|
9996
|
+
this.lease = void 0;
|
|
9997
|
+
this.auth = void 0;
|
|
8871
9998
|
}
|
|
8872
9999
|
};
|
|
8873
10000
|
}
|
|
8874
10001
|
});
|
|
8875
10002
|
|
|
8876
|
-
// node_modules
|
|
10003
|
+
// node_modules/@pmate/agent-sdk/dist/AgentRuntime.js
|
|
8877
10004
|
var init_AgentRuntime = __esm({
|
|
8878
|
-
"node_modules
|
|
10005
|
+
"node_modules/@pmate/agent-sdk/dist/AgentRuntime.js"() {
|
|
8879
10006
|
"use strict";
|
|
8880
10007
|
init_src();
|
|
8881
|
-
|
|
10008
|
+
init_src5();
|
|
8882
10009
|
}
|
|
8883
10010
|
});
|
|
8884
10011
|
|
|
8885
|
-
// node_modules
|
|
10012
|
+
// node_modules/@pmate/agent-sdk/dist/PromptTaskContext.js
|
|
8886
10013
|
var init_PromptTaskContext = __esm({
|
|
8887
|
-
"node_modules
|
|
10014
|
+
"node_modules/@pmate/agent-sdk/dist/PromptTaskContext.js"() {
|
|
8888
10015
|
"use strict";
|
|
8889
10016
|
}
|
|
8890
10017
|
});
|
|
8891
10018
|
|
|
8892
|
-
// node_modules
|
|
10019
|
+
// node_modules/@pmate/agent-sdk/dist/PromptAgent.js
|
|
8893
10020
|
var init_PromptAgent = __esm({
|
|
8894
|
-
"node_modules
|
|
10021
|
+
"node_modules/@pmate/agent-sdk/dist/PromptAgent.js"() {
|
|
8895
10022
|
"use strict";
|
|
8896
10023
|
init_src();
|
|
8897
|
-
|
|
10024
|
+
init_src5();
|
|
8898
10025
|
init_debug();
|
|
8899
10026
|
init_AgentRuntime();
|
|
8900
10027
|
init_PromptTaskContext();
|
|
8901
10028
|
}
|
|
8902
10029
|
});
|
|
8903
10030
|
|
|
8904
|
-
// node_modules
|
|
10031
|
+
// node_modules/@pmate/agent-sdk/dist/StreamTaskContext.js
|
|
8905
10032
|
var init_StreamTaskContext = __esm({
|
|
8906
|
-
"node_modules
|
|
10033
|
+
"node_modules/@pmate/agent-sdk/dist/StreamTaskContext.js"() {
|
|
8907
10034
|
"use strict";
|
|
8908
10035
|
}
|
|
8909
10036
|
});
|
|
8910
10037
|
|
|
8911
|
-
// node_modules
|
|
10038
|
+
// node_modules/@pmate/agent-sdk/dist/StreamAgent.js
|
|
8912
10039
|
var init_StreamAgent = __esm({
|
|
8913
|
-
"node_modules
|
|
10040
|
+
"node_modules/@pmate/agent-sdk/dist/StreamAgent.js"() {
|
|
8914
10041
|
"use strict";
|
|
8915
10042
|
init_src();
|
|
8916
|
-
|
|
10043
|
+
init_src5();
|
|
8917
10044
|
init_AgentRuntime();
|
|
8918
10045
|
init_StreamTaskContext();
|
|
8919
10046
|
}
|
|
8920
10047
|
});
|
|
8921
10048
|
|
|
8922
|
-
// node_modules
|
|
10049
|
+
// node_modules/@pmate/agent-sdk/dist/AgentFactory.js
|
|
8923
10050
|
var init_AgentFactory = __esm({
|
|
8924
|
-
"node_modules
|
|
10051
|
+
"node_modules/@pmate/agent-sdk/dist/AgentFactory.js"() {
|
|
8925
10052
|
"use strict";
|
|
8926
10053
|
init_PromptAgent();
|
|
8927
10054
|
init_StreamAgent();
|
|
8928
10055
|
}
|
|
8929
10056
|
});
|
|
8930
10057
|
|
|
8931
|
-
// node_modules
|
|
10058
|
+
// node_modules/@pmate/agent-sdk/dist/AgentService.js
|
|
8932
10059
|
function parseAgentId(agentId) {
|
|
8933
10060
|
const separatorIndex = agentId.indexOf(":");
|
|
8934
10061
|
if (separatorIndex <= 0 || separatorIndex === agentId.length - 1) {
|
|
@@ -8958,7 +10085,7 @@ function trimTrailingSlash(value) {
|
|
|
8958
10085
|
}
|
|
8959
10086
|
var AgentService;
|
|
8960
10087
|
var init_AgentService = __esm({
|
|
8961
|
-
"node_modules
|
|
10088
|
+
"node_modules/@pmate/agent-sdk/dist/AgentService.js"() {
|
|
8962
10089
|
"use strict";
|
|
8963
10090
|
AgentService = class {
|
|
8964
10091
|
constructor(options) {
|
|
@@ -8999,9 +10126,9 @@ var init_AgentService = __esm({
|
|
|
8999
10126
|
}
|
|
9000
10127
|
});
|
|
9001
10128
|
|
|
9002
|
-
// node_modules
|
|
10129
|
+
// node_modules/@pmate/agent-sdk/dist/index.js
|
|
9003
10130
|
var init_dist2 = __esm({
|
|
9004
|
-
"node_modules
|
|
10131
|
+
"node_modules/@pmate/agent-sdk/dist/index.js"() {
|
|
9005
10132
|
"use strict";
|
|
9006
10133
|
init_AgentClient();
|
|
9007
10134
|
init_AgentFactory();
|
|
@@ -9011,7 +10138,8 @@ var init_dist2 = __esm({
|
|
|
9011
10138
|
init_AgentTaskManager();
|
|
9012
10139
|
init_AgentService();
|
|
9013
10140
|
init_debug();
|
|
9014
|
-
|
|
10141
|
+
init_promptMany();
|
|
10142
|
+
init_src5();
|
|
9015
10143
|
}
|
|
9016
10144
|
});
|
|
9017
10145
|
|
|
@@ -15738,10 +16866,18 @@ var Im1BotClient = class {
|
|
|
15738
16866
|
body: JSON.stringify({
|
|
15739
16867
|
thread: input.thread,
|
|
15740
16868
|
text: input.text,
|
|
15741
|
-
dryRun: input.dryRun ?? false
|
|
16869
|
+
dryRun: input.dryRun ?? false,
|
|
16870
|
+
attachment: input.attachment
|
|
15742
16871
|
})
|
|
15743
16872
|
});
|
|
15744
16873
|
}
|
|
16874
|
+
async reactToMessage(input) {
|
|
16875
|
+
return this.request("/messages/react", {
|
|
16876
|
+
method: "POST",
|
|
16877
|
+
headers: { "content-type": "application/json" },
|
|
16878
|
+
body: JSON.stringify(input)
|
|
16879
|
+
});
|
|
16880
|
+
}
|
|
15745
16881
|
async resolveThread(thread) {
|
|
15746
16882
|
const exact = await this.request(
|
|
15747
16883
|
`/threads/${encodeURIComponent(thread)}`
|
|
@@ -15922,6 +17058,29 @@ function normalizeStoredMessage(message) {
|
|
|
15922
17058
|
}
|
|
15923
17059
|
|
|
15924
17060
|
// src/commands/CollectCommandHandler.ts
|
|
17061
|
+
async function readOutgoingAttachment(filePath) {
|
|
17062
|
+
const resolved = import_node_path19.default.resolve(filePath);
|
|
17063
|
+
const data = await import_node_fs13.promises.readFile(resolved);
|
|
17064
|
+
const extension = import_node_path19.default.extname(resolved).toLowerCase();
|
|
17065
|
+
const contentTypes = {
|
|
17066
|
+
".png": "image/png",
|
|
17067
|
+
".jpg": "image/jpeg",
|
|
17068
|
+
".jpeg": "image/jpeg",
|
|
17069
|
+
".gif": "image/gif",
|
|
17070
|
+
".webp": "image/webp",
|
|
17071
|
+
".pdf": "application/pdf",
|
|
17072
|
+
".txt": "text/plain",
|
|
17073
|
+
".mp4": "video/mp4",
|
|
17074
|
+
".mp3": "audio/mpeg",
|
|
17075
|
+
".wav": "audio/wav"
|
|
17076
|
+
};
|
|
17077
|
+
return {
|
|
17078
|
+
base64: data.toString("base64"),
|
|
17079
|
+
fileName: import_node_path19.default.basename(resolved),
|
|
17080
|
+
contentType: contentTypes[extension] ?? "application/octet-stream",
|
|
17081
|
+
size: data.byteLength
|
|
17082
|
+
};
|
|
17083
|
+
}
|
|
15925
17084
|
var CollectCommandHandler = class {
|
|
15926
17085
|
async handle(args) {
|
|
15927
17086
|
if (args.action === "health") {
|
|
@@ -15940,6 +17099,10 @@ var CollectCommandHandler = class {
|
|
|
15940
17099
|
await this.handleBotReply(args);
|
|
15941
17100
|
return;
|
|
15942
17101
|
}
|
|
17102
|
+
if (args.action === "react") {
|
|
17103
|
+
await this.handleBotReact(args);
|
|
17104
|
+
return;
|
|
17105
|
+
}
|
|
15943
17106
|
if (args.source === "cc" && !args.endpoint) {
|
|
15944
17107
|
throw new Error(
|
|
15945
17108
|
'CC sync has moved to cc-bot. Start ~/dev/pcs/cc-bot and use "pmate im1 threads", "pmate im1 messages", or "pmate im1 reply".'
|
|
@@ -15977,13 +17140,20 @@ var CollectCommandHandler = class {
|
|
|
15977
17140
|
}
|
|
15978
17141
|
async handleBotReply(args) {
|
|
15979
17142
|
const client = new Im1BotClient();
|
|
17143
|
+
const attachment = args.file ? await readOutgoingAttachment(args.file) : void 0;
|
|
15980
17144
|
const result = await client.sendMessage({
|
|
15981
17145
|
thread: args.thread,
|
|
15982
17146
|
text: args.text,
|
|
15983
|
-
dryRun: args.dryRun
|
|
17147
|
+
dryRun: args.dryRun,
|
|
17148
|
+
attachment
|
|
15984
17149
|
});
|
|
15985
17150
|
ui.plain(JSON.stringify(result, null, 2));
|
|
15986
17151
|
}
|
|
17152
|
+
async handleBotReact(args) {
|
|
17153
|
+
const client = new Im1BotClient();
|
|
17154
|
+
const result = await client.reactToMessage(args);
|
|
17155
|
+
ui.plain(JSON.stringify(result, null, 2));
|
|
17156
|
+
}
|
|
15987
17157
|
async handleSync(args) {
|
|
15988
17158
|
let browser = null;
|
|
15989
17159
|
try {
|
|
@@ -26246,6 +27416,9 @@ function parseIm1Args(tokens) {
|
|
|
26246
27416
|
if (action === "reply") {
|
|
26247
27417
|
return parseIm1ReplyArgs(rest);
|
|
26248
27418
|
}
|
|
27419
|
+
if (action === "react") {
|
|
27420
|
+
return parseIm1ReactArgs(rest);
|
|
27421
|
+
}
|
|
26249
27422
|
throw new Error(`Unknown im1 action: ${action}`);
|
|
26250
27423
|
}
|
|
26251
27424
|
function parseIm1HealthArgs(tokens) {
|
|
@@ -26328,6 +27501,7 @@ function parseIm1ReplyArgs(tokens) {
|
|
|
26328
27501
|
const rest = [...tokens];
|
|
26329
27502
|
let thread;
|
|
26330
27503
|
let text;
|
|
27504
|
+
let file;
|
|
26331
27505
|
let dryRun = false;
|
|
26332
27506
|
while (rest.length > 0) {
|
|
26333
27507
|
const token = rest.shift();
|
|
@@ -26338,6 +27512,10 @@ function parseIm1ReplyArgs(tokens) {
|
|
|
26338
27512
|
case "--text":
|
|
26339
27513
|
text = requireValue11(rest, token);
|
|
26340
27514
|
break;
|
|
27515
|
+
case "--file":
|
|
27516
|
+
case "--image":
|
|
27517
|
+
file = requireValue11(rest, token);
|
|
27518
|
+
break;
|
|
26341
27519
|
case "--dryrun":
|
|
26342
27520
|
case "--dry-run":
|
|
26343
27521
|
dryRun = true;
|
|
@@ -26346,17 +27524,53 @@ function parseIm1ReplyArgs(tokens) {
|
|
|
26346
27524
|
throw new Error(`Unknown im1 reply option: ${token}`);
|
|
26347
27525
|
}
|
|
26348
27526
|
}
|
|
26349
|
-
if (!thread || !text) {
|
|
26350
|
-
throw new Error("Usage: im1 reply --thread <name|conversation-id> --text <text>");
|
|
27527
|
+
if (!thread || !text && !file) {
|
|
27528
|
+
throw new Error("Usage: im1 reply --thread <name|conversation-id> [--text <text>] [--file <path>]");
|
|
26351
27529
|
}
|
|
26352
27530
|
return {
|
|
26353
27531
|
type: "collect" /* Collect */,
|
|
26354
27532
|
action: "reply",
|
|
26355
27533
|
thread,
|
|
26356
|
-
text,
|
|
27534
|
+
text: text ?? "",
|
|
27535
|
+
file,
|
|
26357
27536
|
dryRun
|
|
26358
27537
|
};
|
|
26359
27538
|
}
|
|
27539
|
+
function parseIm1ReactArgs(tokens) {
|
|
27540
|
+
const rest = [...tokens];
|
|
27541
|
+
let thread;
|
|
27542
|
+
let emoji;
|
|
27543
|
+
let message;
|
|
27544
|
+
let remove = false;
|
|
27545
|
+
let dryRun = false;
|
|
27546
|
+
while (rest.length > 0) {
|
|
27547
|
+
const token = rest.shift();
|
|
27548
|
+
switch (token) {
|
|
27549
|
+
case "--thread":
|
|
27550
|
+
thread = requireValue11(rest, token);
|
|
27551
|
+
break;
|
|
27552
|
+
case "--emoji":
|
|
27553
|
+
emoji = requireValue11(rest, token);
|
|
27554
|
+
break;
|
|
27555
|
+
case "--message":
|
|
27556
|
+
message = requireValue11(rest, token);
|
|
27557
|
+
break;
|
|
27558
|
+
case "--remove":
|
|
27559
|
+
remove = true;
|
|
27560
|
+
break;
|
|
27561
|
+
case "--dryrun":
|
|
27562
|
+
case "--dry-run":
|
|
27563
|
+
dryRun = true;
|
|
27564
|
+
break;
|
|
27565
|
+
default:
|
|
27566
|
+
throw new Error(`Unknown im1 react option: ${token}`);
|
|
27567
|
+
}
|
|
27568
|
+
}
|
|
27569
|
+
if (!thread || !emoji) {
|
|
27570
|
+
throw new Error("Usage: im1 react --thread <name|conversation-id> --emoji <emoji> [--message <id-or-timestamp>] [--remove]");
|
|
27571
|
+
}
|
|
27572
|
+
return { type: "collect" /* Collect */, action: "react", thread, emoji, message, remove, dryRun };
|
|
27573
|
+
}
|
|
26360
27574
|
function requireValue11(tokens, optionName) {
|
|
26361
27575
|
const value = tokens.shift();
|
|
26362
27576
|
if (!value || value.startsWith("--")) {
|
|
@@ -26592,7 +27806,7 @@ var HELP_TEXT = [
|
|
|
26592
27806
|
` ${import_chalk4.default.gray(" [--length <n>] [--charset base64url|hex|alnum|ascii]")}`,
|
|
26593
27807
|
` ${import_chalk4.default.gray(" [--count <n>]")}`,
|
|
26594
27808
|
` ${import_chalk4.default.gray(" --easy [--words <n>] [--digits <n>] [--separator <s>] [--count <n>]")}`,
|
|
26595
|
-
` ${import_chalk4.default.cyan("im1")} Read
|
|
27809
|
+
` ${import_chalk4.default.cyan("im1")} Read, reply, attach files, and react through local cc-bot`,
|
|
26596
27810
|
` ${import_chalk4.default.gray(" health [--json]")}`,
|
|
26597
27811
|
` ${import_chalk4.default.gray(" threads [--q <keyword>] [--search <title>] [--limit <n>] [--json|--text]")}`,
|
|
26598
27812
|
` ${import_chalk4.default.gray(" messages --thread <name|conversation-id> [--limit <n>] [--json|--text]")}`,
|