@pmate/cli 0.25.9 → 0.25.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1511 -502
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -293,160 +293,157 @@ var init_sessionStore = __esm({
293
293
  }
294
294
  });
295
295
 
296
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/account.types.ts
296
+ // node_modules/@pmate/meta/src/types/account.types.ts
297
297
  var init_account_types = __esm({
298
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/account.types.ts"() {
298
+ "node_modules/@pmate/meta/src/types/account.types.ts"() {
299
299
  "use strict";
300
300
  }
301
301
  });
302
302
 
303
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/achievements.types.ts
303
+ // node_modules/@pmate/meta/src/types/achievements.types.ts
304
304
  var init_achievements_types = __esm({
305
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/achievements.types.ts"() {
305
+ "node_modules/@pmate/meta/src/types/achievements.types.ts"() {
306
306
  "use strict";
307
307
  }
308
308
  });
309
309
 
310
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/aigen.types.ts
310
+ // node_modules/@pmate/meta/src/types/aigen.types.ts
311
311
  var init_aigen_types = __esm({
312
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/aigen.types.ts"() {
312
+ "node_modules/@pmate/meta/src/types/aigen.types.ts"() {
313
313
  "use strict";
314
314
  }
315
315
  });
316
316
 
317
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/agent.types.ts
317
+ // node_modules/@pmate/meta/src/types/agent.types.ts
318
318
  var init_agent_types = __esm({
319
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/agent.types.ts"() {
319
+ "node_modules/@pmate/meta/src/types/agent.types.ts"() {
320
320
  "use strict";
321
321
  }
322
322
  });
323
323
 
324
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/agent-registry.types.ts
324
+ // node_modules/@pmate/meta/src/types/agent-registry.types.ts
325
325
  var init_agent_registry_types = __esm({
326
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/agent-registry.types.ts"() {
326
+ "node_modules/@pmate/meta/src/types/agent-registry.types.ts"() {
327
327
  "use strict";
328
328
  }
329
329
  });
330
330
 
331
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/runner-registry.types.ts
331
+ // node_modules/@pmate/meta/src/types/runner-registry.types.ts
332
332
  var init_runner_registry_types = __esm({
333
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/runner-registry.types.ts"() {
333
+ "node_modules/@pmate/meta/src/types/runner-registry.types.ts"() {
334
334
  "use strict";
335
335
  }
336
336
  });
337
337
 
338
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/blockchain.types.ts
338
+ // node_modules/@pmate/meta/src/types/blockchain.types.ts
339
339
  var init_blockchain_types = __esm({
340
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/blockchain.types.ts"() {
340
+ "node_modules/@pmate/meta/src/types/blockchain.types.ts"() {
341
341
  "use strict";
342
342
  }
343
343
  });
344
344
 
345
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/breakdown.types.ts
345
+ // node_modules/@pmate/meta/src/types/breakdown.types.ts
346
346
  var init_breakdown_types = __esm({
347
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/breakdown.types.ts"() {
347
+ "node_modules/@pmate/meta/src/types/breakdown.types.ts"() {
348
348
  "use strict";
349
349
  }
350
350
  });
351
351
 
352
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/chat.types.ts
352
+ // node_modules/@pmate/meta/src/types/chat.types.ts
353
353
  var init_chat_types = __esm({
354
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/chat.types.ts"() {
354
+ "node_modules/@pmate/meta/src/types/chat.types.ts"() {
355
355
  "use strict";
356
356
  }
357
357
  });
358
358
 
359
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/companion.types.ts
359
+ // node_modules/@pmate/meta/src/types/companion.types.ts
360
360
  var init_companion_types = __esm({
361
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/companion.types.ts"() {
361
+ "node_modules/@pmate/meta/src/types/companion.types.ts"() {
362
362
  "use strict";
363
363
  }
364
364
  });
365
365
 
366
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/enums.ts
366
+ // node_modules/@pmate/meta/src/types/enums.ts
367
367
  var init_enums = __esm({
368
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/enums.ts"() {
368
+ "node_modules/@pmate/meta/src/types/enums.ts"() {
369
369
  "use strict";
370
370
  }
371
371
  });
372
372
 
373
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/lang.types.ts
373
+ // node_modules/@pmate/meta/src/types/lang.types.ts
374
374
  var init_lang_types = __esm({
375
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/lang.types.ts"() {
375
+ "node_modules/@pmate/meta/src/types/lang.types.ts"() {
376
376
  "use strict";
377
377
  }
378
378
  });
379
379
 
380
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/logs.types.ts
380
+ // node_modules/@pmate/meta/src/types/logs.types.ts
381
381
  var init_logs_types = __esm({
382
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/logs.types.ts"() {
382
+ "node_modules/@pmate/meta/src/types/logs.types.ts"() {
383
383
  "use strict";
384
384
  }
385
385
  });
386
386
 
387
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/message.types.ts
388
- var PING, PONG;
387
+ // node_modules/@pmate/meta/src/types/message.types.ts
389
388
  var init_message_types = __esm({
390
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/message.types.ts"() {
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/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/newLog.types.ts
394
+ // node_modules/@pmate/meta/src/types/newLog.types.ts
398
395
  var init_newLog_types = __esm({
399
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/newLog.types.ts"() {
396
+ "node_modules/@pmate/meta/src/types/newLog.types.ts"() {
400
397
  "use strict";
401
398
  }
402
399
  });
403
400
 
404
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/novel.types.ts
401
+ // node_modules/@pmate/meta/src/types/novel.types.ts
405
402
  var init_novel_types = __esm({
406
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/novel.types.ts"() {
403
+ "node_modules/@pmate/meta/src/types/novel.types.ts"() {
407
404
  "use strict";
408
405
  }
409
406
  });
410
407
 
411
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/offline.types.ts
408
+ // node_modules/@pmate/meta/src/types/offline.types.ts
412
409
  var init_offline_types = __esm({
413
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/offline.types.ts"() {
410
+ "node_modules/@pmate/meta/src/types/offline.types.ts"() {
414
411
  "use strict";
415
412
  }
416
413
  });
417
414
 
418
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/prompt.types.ts
415
+ // node_modules/@pmate/meta/src/types/prompt.types.ts
419
416
  var init_prompt_types = __esm({
420
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/prompt.types.ts"() {
417
+ "node_modules/@pmate/meta/src/types/prompt.types.ts"() {
421
418
  "use strict";
422
419
  }
423
420
  });
424
421
 
425
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/reading.types.ts
422
+ // node_modules/@pmate/meta/src/types/reading.types.ts
426
423
  var init_reading_types = __esm({
427
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/reading.types.ts"() {
424
+ "node_modules/@pmate/meta/src/types/reading.types.ts"() {
428
425
  "use strict";
429
426
  }
430
427
  });
431
428
 
432
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/settings.types.ts
429
+ // node_modules/@pmate/meta/src/types/settings.types.ts
433
430
  var init_settings_types = __esm({
434
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/settings.types.ts"() {
431
+ "node_modules/@pmate/meta/src/types/settings.types.ts"() {
435
432
  "use strict";
436
433
  }
437
434
  });
438
435
 
439
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/subscription.types.ts
436
+ // node_modules/@pmate/meta/src/types/subscription.types.ts
440
437
  var init_subscription_types = __esm({
441
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/subscription.types.ts"() {
438
+ "node_modules/@pmate/meta/src/types/subscription.types.ts"() {
442
439
  "use strict";
443
440
  }
444
441
  });
445
442
 
446
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/types.ts
443
+ // node_modules/@pmate/meta/src/types/types.ts
447
444
  var buildVoiceKey, createVoice;
448
445
  var init_types = __esm({
449
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/types.ts"() {
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/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/wordv5.def.ts
468
+ // node_modules/@pmate/meta/src/types/wordv5.def.ts
472
469
  var init_wordv5_def = __esm({
473
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/wordv5.def.ts"() {
470
+ "node_modules/@pmate/meta/src/types/wordv5.def.ts"() {
474
471
  "use strict";
475
472
  }
476
473
  });
477
474
 
478
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/auth.types.ts
475
+ // node_modules/@pmate/meta/src/types/auth.types.ts
479
476
  var init_auth_types = __esm({
480
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/auth.types.ts"() {
477
+ "node_modules/@pmate/meta/src/types/auth.types.ts"() {
481
478
  "use strict";
482
479
  }
483
480
  });
484
481
 
485
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/apps.types.ts
482
+ // node_modules/@pmate/meta/src/types/apps.types.ts
486
483
  var init_apps_types = __esm({
487
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/apps.types.ts"() {
484
+ "node_modules/@pmate/meta/src/types/apps.types.ts"() {
488
485
  "use strict";
489
486
  }
490
487
  });
491
488
 
492
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/response.types.ts
489
+ // node_modules/@pmate/meta/src/types/response.types.ts
493
490
  var init_response_types = __esm({
494
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/response.types.ts"() {
491
+ "node_modules/@pmate/meta/src/types/response.types.ts"() {
495
492
  "use strict";
496
493
  }
497
494
  });
498
495
 
499
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/role.types.ts
496
+ // node_modules/@pmate/meta/src/types/role.types.ts
500
497
  var init_role_types = __esm({
501
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/role.types.ts"() {
498
+ "node_modules/@pmate/meta/src/types/role.types.ts"() {
502
499
  "use strict";
503
500
  }
504
501
  });
505
502
 
506
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/index.ts
503
+ // node_modules/@pmate/meta/src/types/index.ts
507
504
  var init_types2 = __esm({
508
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/index.ts"() {
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/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/BizErrorCode.ts
537
+ // node_modules/@pmate/meta/src/config/BizErrorCode.ts
541
538
  var init_BizErrorCode = __esm({
542
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/BizErrorCode.ts"() {
539
+ "node_modules/@pmate/meta/src/config/BizErrorCode.ts"() {
543
540
  "use strict";
544
541
  }
545
542
  });
546
543
 
547
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/consts.ts
544
+ // node_modules/@pmate/meta/src/config/consts.ts
548
545
  var init_consts = __esm({
549
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/consts.ts"() {
546
+ "node_modules/@pmate/meta/src/config/consts.ts"() {
550
547
  "use strict";
551
548
  }
552
549
  });
553
550
 
554
- // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/TopicNames.ts
551
+ // node_modules/@pmate/meta/src/config/TopicNames.ts
555
552
  var TopicNames, topicKindMatchers;
556
553
  var init_TopicNames = __esm({
557
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/TopicNames.ts"() {
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/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/OSSKeys.ts
640
+ // node_modules/@pmate/meta/src/config/OSSKeys.ts
644
641
  var init_OSSKeys = __esm({
645
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/OSSKeys.ts"() {
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/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/CompanionProfiles.ts
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/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/CompanionProfiles.ts"() {
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/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/index.ts
686
+ // node_modules/@pmate/meta/src/config/index.ts
690
687
  var init_config = __esm({
691
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/index.ts"() {
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/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/index.ts
698
+ // node_modules/@pmate/meta/src/index.ts
702
699
  var init_src = __esm({
703
- "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/index.ts"() {
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/base64.ts
707
+ // node_modules/@pmate/utils/src/base64.ts
711
708
  var init_base64 = __esm({
712
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/base64.ts"() {
709
+ "node_modules/@pmate/utils/src/base64.ts"() {
713
710
  "use strict";
714
711
  }
715
712
  });
716
713
 
717
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Cache.ts
714
+ // node_modules/@pmate/utils/src/Cache.ts
718
715
  var init_Cache = __esm({
719
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Cache.ts"() {
716
+ "node_modules/@pmate/utils/src/Cache.ts"() {
720
717
  "use strict";
721
718
  }
722
719
  });
723
720
 
724
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/batchResolve.ts
721
+ // node_modules/@pmate/utils/src/batchResolve.ts
725
722
  var init_batchResolve = __esm({
726
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/batchResolve.ts"() {
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/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceSpliter.ts
729
+ // node_modules/@pmate/lang/src/cn/sentenceSpliter.ts
733
730
  var init_sentenceSpliter = __esm({
734
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceSpliter.ts"() {
731
+ "node_modules/@pmate/lang/src/cn/sentenceSpliter.ts"() {
735
732
  "use strict";
736
733
  }
737
734
  });
738
735
 
739
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceTrim.ts
736
+ // node_modules/@pmate/lang/src/cn/sentenceTrim.ts
740
737
  var init_sentenceTrim = __esm({
741
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceTrim.ts"() {
738
+ "node_modules/@pmate/lang/src/cn/sentenceTrim.ts"() {
742
739
  "use strict";
743
740
  }
744
741
  });
745
742
 
746
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/wordSpliter.ts
743
+ // node_modules/@pmate/lang/src/cn/wordSpliter.ts
747
744
  var init_wordSpliter = __esm({
748
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/wordSpliter.ts"() {
745
+ "node_modules/@pmate/lang/src/cn/wordSpliter.ts"() {
749
746
  "use strict";
750
747
  }
751
748
  });
752
749
 
753
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/regex.ts
750
+ // node_modules/@pmate/lang/src/en/regex.ts
754
751
  var init_regex = __esm({
755
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/regex.ts"() {
752
+ "node_modules/@pmate/lang/src/en/regex.ts"() {
756
753
  "use strict";
757
754
  }
758
755
  });
759
756
 
760
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceSpliter.ts
757
+ // node_modules/@pmate/lang/src/en/sentenceSpliter.ts
761
758
  var init_sentenceSpliter2 = __esm({
762
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceSpliter.ts"() {
759
+ "node_modules/@pmate/lang/src/en/sentenceSpliter.ts"() {
763
760
  "use strict";
764
761
  }
765
762
  });
766
763
 
767
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceTrim.ts
764
+ // node_modules/@pmate/lang/src/en/sentenceTrim.ts
768
765
  var init_sentenceTrim2 = __esm({
769
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceTrim.ts"() {
766
+ "node_modules/@pmate/lang/src/en/sentenceTrim.ts"() {
770
767
  "use strict";
771
768
  }
772
769
  });
773
770
 
774
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/wordSpliter.ts
771
+ // node_modules/@pmate/lang/src/en/wordSpliter.ts
775
772
  var regex;
776
773
  var init_wordSpliter2 = __esm({
777
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/wordSpliter.ts"() {
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/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/sentenceSpliter.ts
810
+ // node_modules/@pmate/lang/src/kr/sentenceSpliter.ts
814
811
  var init_sentenceSpliter3 = __esm({
815
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/sentenceSpliter.ts"() {
812
+ "node_modules/@pmate/lang/src/kr/sentenceSpliter.ts"() {
816
813
  "use strict";
817
814
  }
818
815
  });
819
816
 
820
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/wordSpliter.ts
817
+ // node_modules/@pmate/lang/src/kr/wordSpliter.ts
821
818
  var init_wordSpliter3 = __esm({
822
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/wordSpliter.ts"() {
819
+ "node_modules/@pmate/lang/src/kr/wordSpliter.ts"() {
823
820
  "use strict";
824
821
  }
825
822
  });
826
823
 
827
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/readingSettings.ts
824
+ // node_modules/@pmate/lang/src/readingSettings.ts
828
825
  var init_readingSettings = __esm({
829
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/readingSettings.ts"() {
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/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/utils.ts
841
- var init_utils = __esm({
842
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/utils.ts"() {
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"() {
843
840
  "use strict";
844
- init_src();
845
841
  }
846
842
  });
847
843
 
848
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/index.ts
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"() {
1033
+ "use strict";
1034
+ }
1035
+ });
1036
+
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/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/index.ts"() {
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/bookStats.ts
1274
+ // node_modules/@pmate/utils/src/bookStats.ts
867
1275
  var init_bookStats = __esm({
868
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/bookStats.ts"() {
1276
+ "node_modules/@pmate/utils/src/bookStats.ts"() {
869
1277
  "use strict";
870
- init_src2();
1278
+ init_src3();
871
1279
  }
872
1280
  });
873
1281
 
874
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts
1282
+ // node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts
875
1283
  var init_BoundedConcurrentQueue = __esm({
876
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts"() {
1284
+ "node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts"() {
877
1285
  "use strict";
878
1286
  }
879
1287
  });
880
1288
 
881
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/lru.ts
1289
+ // node_modules/@pmate/utils/src/lru.ts
882
1290
  var init_lru = __esm({
883
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/lru.ts"() {
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/.pnpm/js-sha3@0.9.3/node_modules/js-sha3/src/sha3.js
1297
+ // node_modules/js-sha3/src/sha3.js
890
1298
  var require_sha3 = __commonJS({
891
- "node_modules/.pnpm/js-sha3@0.9.3/node_modules/js-sha3/src/sha3.js"(exports2, module2) {
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Maybe.ts
1944
+ // node_modules/@pmate/utils/src/Maybe.ts
1537
1945
  var init_Maybe = __esm({
1538
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Maybe.ts"() {
1946
+ "node_modules/@pmate/utils/src/Maybe.ts"() {
1539
1947
  "use strict";
1540
1948
  }
1541
1949
  });
1542
1950
 
1543
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/cacheMethodInMem.ts
1951
+ // node_modules/@pmate/utils/src/cacheMethodInMem.ts
1544
1952
  var import_js_sha3;
1545
1953
  var init_cacheMethodInMem = __esm({
1546
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/cacheMethodInMem.ts"() {
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/.pnpm/pako@2.1.0/node_modules/pako/dist/pako.esm.mjs
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/.pnpm/pako@2.1.0/node_modules/pako/dist/pako.esm.mjs"() {
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/compress.ts
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/compress.ts"() {
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/AsyncStream.ts
6162
+ // node_modules/@pmate/utils/src/AsyncStream.ts
5755
6163
  var AsyncStream;
5756
6164
  var init_AsyncStream = __esm({
5757
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/AsyncStream.ts"() {
6165
+ "node_modules/@pmate/utils/src/AsyncStream.ts"() {
5758
6166
  "use strict";
5759
6167
  AsyncStream = class _AsyncStream {
5760
6168
  constructor() {
@@ -5942,12 +6350,426 @@ var init_AsyncStream = __esm({
5942
6350
  }
5943
6351
  });
5944
6352
 
5945
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/uniqHash.ts
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}`;
6623
+ }
6624
+ static userLogs(user) {
6625
+ return `@pmate/user_logs:${user}`;
6626
+ }
6627
+ static legacyUserLogs(user) {
6628
+ return _TopicNames.userLogs(user);
6629
+ }
6630
+ static userContacts(profileId) {
6631
+ return `@pmate/user_contacts:${profileId}`;
6632
+ }
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";
6653
+ }
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();
6764
+ }
6765
+ });
6766
+
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/uniqHash.ts"() {
6770
+ "node_modules/@pmate/utils/src/uniqHash.ts"() {
5949
6771
  "use strict";
5950
- init_src();
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/createMsg.ts
6800
+ // node_modules/@pmate/utils/src/createMsg.ts
5979
6801
  var init_createMsg = __esm({
5980
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/createMsg.ts"() {
6802
+ "node_modules/@pmate/utils/src/createMsg.ts"() {
5981
6803
  "use strict";
5982
- init_src();
6804
+ init_src4();
5983
6805
  init_uniqHash();
5984
6806
  }
5985
6807
  });
5986
6808
 
5987
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/detectText.ts
6809
+ // node_modules/@pmate/utils/src/detectText.ts
5988
6810
  var init_detectText = __esm({
5989
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/detectText.ts"() {
6811
+ "node_modules/@pmate/utils/src/detectText.ts"() {
5990
6812
  "use strict";
5991
6813
  }
5992
6814
  });
5993
6815
 
5994
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Emitter.ts
6816
+ // node_modules/@pmate/utils/src/Emitter.ts
5995
6817
  var init_Emitter = __esm({
5996
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Emitter.ts"() {
6818
+ "node_modules/@pmate/utils/src/Emitter.ts"() {
5997
6819
  "use strict";
5998
6820
  }
5999
6821
  });
6000
6822
 
6001
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/EmitterV2.ts
6823
+ // node_modules/@pmate/utils/src/EmitterV2.ts
6002
6824
  var EmitterV2;
6003
6825
  var init_EmitterV2 = __esm({
6004
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/EmitterV2.ts"() {
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/formatTime.ts
6882
+ // node_modules/@pmate/utils/src/format/formatTime.ts
6061
6883
  var init_formatTime = __esm({
6062
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/formatTime.ts"() {
6884
+ "node_modules/@pmate/utils/src/format/formatTime.ts"() {
6063
6885
  "use strict";
6064
6886
  }
6065
6887
  });
6066
6888
 
6067
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/index.ts
6889
+ // node_modules/@pmate/utils/src/format/index.ts
6068
6890
  var init_format = __esm({
6069
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/index.ts"() {
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/isVolcabulary.ts
6897
+ // node_modules/@pmate/utils/src/isVolcabulary.ts
6076
6898
  var init_isVolcabulary = __esm({
6077
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/isVolcabulary.ts"() {
6899
+ "node_modules/@pmate/utils/src/isVolcabulary.ts"() {
6078
6900
  "use strict";
6079
6901
  }
6080
6902
  });
6081
6903
 
6082
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Loadable.ts
6904
+ // node_modules/@pmate/utils/src/Loadable.ts
6083
6905
  var init_Loadable = __esm({
6084
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Loadable.ts"() {
6906
+ "node_modules/@pmate/utils/src/Loadable.ts"() {
6085
6907
  "use strict";
6086
6908
  }
6087
6909
  });
6088
6910
 
6089
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Logger.ts
6911
+ // node_modules/@pmate/utils/src/Logger.ts
6090
6912
  var Logger;
6091
6913
  var init_Logger = __esm({
6092
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Logger.ts"() {
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/mapToReadingBook.ts
6939
+ // node_modules/@pmate/utils/src/mapToReadingBook.ts
6118
6940
  var init_mapToReadingBook = __esm({
6119
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/mapToReadingBook.ts"() {
6941
+ "node_modules/@pmate/utils/src/mapToReadingBook.ts"() {
6120
6942
  "use strict";
6121
6943
  }
6122
6944
  });
6123
6945
 
6124
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/memoize.ts
6946
+ // node_modules/@pmate/utils/src/memoize.ts
6125
6947
  var init_memoize = __esm({
6126
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/memoize.ts"() {
6948
+ "node_modules/@pmate/utils/src/memoize.ts"() {
6127
6949
  "use strict";
6128
6950
  }
6129
6951
  });
6130
6952
 
6131
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs"() {
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs
7090
+ // node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs
6269
7091
  var ExtData;
6270
7092
  var init_ExtData = __esm({
6271
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs"() {
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs
7106
+ // node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs
6285
7107
  var DecodeError;
6286
7108
  var init_DecodeError = __esm({
6287
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs"() {
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs"() {
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs"() {
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs
7245
+ // node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs
6424
7246
  var ExtensionCodec;
6425
7247
  var init_ExtensionCodec = __esm({
6426
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs"() {
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs"() {
7331
+ "node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs"() {
6510
7332
  "use strict";
6511
7333
  }
6512
7334
  });
6513
7335
 
6514
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs"() {
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/encode.mjs
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/encode.mjs"() {
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs"() {
7766
+ "node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs"() {
6945
7767
  "use strict";
6946
7768
  }
6947
7769
  });
6948
7770
 
6949
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs"() {
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs"() {
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/decode.mjs
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/decode.mjs"() {
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/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/index.mjs
8487
+ // node_modules/@msgpack/msgpack/dist.esm/index.mjs
7666
8488
  var init_dist = __esm({
7667
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/index.mjs"() {
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Msg.ts
8496
+ // node_modules/@pmate/utils/src/Msg.ts
7675
8497
  var encoder, Msg;
7676
8498
  var init_Msg = __esm({
7677
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Msg.ts"() {
8499
+ "node_modules/@pmate/utils/src/Msg.ts"() {
7678
8500
  "use strict";
7679
8501
  init_dist();
7680
- init_src();
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/normalize.ts
8627
+ // node_modules/@pmate/utils/src/normalize.ts
7806
8628
  var init_normalize = __esm({
7807
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/normalize.ts"() {
8629
+ "node_modules/@pmate/utils/src/normalize.ts"() {
7808
8630
  "use strict";
7809
8631
  }
7810
8632
  });
7811
8633
 
7812
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/pageURL.ts
8634
+ // node_modules/@pmate/utils/src/pageURL.ts
7813
8635
  var init_pageURL = __esm({
7814
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/pageURL.ts"() {
8636
+ "node_modules/@pmate/utils/src/pageURL.ts"() {
7815
8637
  "use strict";
7816
8638
  }
7817
8639
  });
7818
8640
 
7819
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/PromiseQueue.ts
8641
+ // node_modules/@pmate/utils/src/PromiseQueue.ts
7820
8642
  var init_PromiseQueue = __esm({
7821
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/PromiseQueue.ts"() {
8643
+ "node_modules/@pmate/utils/src/PromiseQueue.ts"() {
7822
8644
  "use strict";
7823
8645
  }
7824
8646
  });
7825
8647
 
7826
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/resourceKey.ts
8648
+ // node_modules/@pmate/utils/src/resourceKey.ts
7827
8649
  var import_js_sha33;
7828
8650
  var init_resourceKey = __esm({
7829
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/resourceKey.ts"() {
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/SelectionHelper.ts
8657
+ // node_modules/@pmate/utils/src/SelectionHelper.ts
7836
8658
  var init_SelectionHelper = __esm({
7837
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/SelectionHelper.ts"() {
8659
+ "node_modules/@pmate/utils/src/SelectionHelper.ts"() {
7838
8660
  "use strict";
7839
8661
  }
7840
8662
  });
7841
8663
 
7842
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/setMinus.ts
8664
+ // node_modules/@pmate/utils/src/setMinus.ts
7843
8665
  var init_setMinus = __esm({
7844
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/setMinus.ts"() {
8666
+ "node_modules/@pmate/utils/src/setMinus.ts"() {
7845
8667
  "use strict";
7846
8668
  }
7847
8669
  });
7848
8670
 
7849
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/sha1Hash.ts
8671
+ // node_modules/@pmate/utils/src/sha1Hash.ts
7850
8672
  var init_sha1Hash = __esm({
7851
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/sha1Hash.ts"() {
8673
+ "node_modules/@pmate/utils/src/sha1Hash.ts"() {
7852
8674
  "use strict";
7853
8675
  }
7854
8676
  });
7855
8677
 
7856
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/TaskWaiter.ts
8678
+ // node_modules/@pmate/utils/src/TaskWaiter.ts
7857
8679
  var init_TaskWaiter = __esm({
7858
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/TaskWaiter.ts"() {
8680
+ "node_modules/@pmate/utils/src/TaskWaiter.ts"() {
7859
8681
  "use strict";
7860
- init_src3();
8682
+ init_src5();
7861
8683
  }
7862
8684
  });
7863
8685
 
7864
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/toSentenceAnalyze.ts
8686
+ // node_modules/@pmate/utils/src/toSentenceAnalyze.ts
7865
8687
  var init_toSentenceAnalyze = __esm({
7866
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/toSentenceAnalyze.ts"() {
8688
+ "node_modules/@pmate/utils/src/toSentenceAnalyze.ts"() {
7867
8689
  "use strict";
7868
8690
  }
7869
8691
  });
7870
8692
 
7871
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/txtBookToJson.ts
8693
+ // node_modules/@pmate/utils/src/txtBookToJson.ts
7872
8694
  var init_txtBookToJson = __esm({
7873
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/txtBookToJson.ts"() {
8695
+ "node_modules/@pmate/utils/src/txtBookToJson.ts"() {
7874
8696
  "use strict";
7875
- init_src2();
8697
+ init_src3();
7876
8698
  }
7877
8699
  });
7878
8700
 
7879
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/VocabularyMap.ts
8701
+ // node_modules/@pmate/utils/src/VocabularyMap.ts
7880
8702
  var init_VocabularyMap = __esm({
7881
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/VocabularyMap.ts"() {
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wait.ts
8709
+ // node_modules/@pmate/utils/src/wait.ts
7888
8710
  var init_wait = __esm({
7889
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wait.ts"() {
8711
+ "node_modules/@pmate/utils/src/wait.ts"() {
7890
8712
  "use strict";
7891
8713
  }
7892
8714
  });
7893
8715
 
7894
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wordCount.ts
8716
+ // node_modules/@pmate/utils/src/wordCount.ts
7895
8717
  var init_wordCount = __esm({
7896
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wordCount.ts"() {
8718
+ "node_modules/@pmate/utils/src/wordCount.ts"() {
7897
8719
  "use strict";
7898
8720
  }
7899
8721
  });
7900
8722
 
7901
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts
8723
+ // node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts
7902
8724
  var logger, WebsocketHeartbeat;
7903
8725
  var init_WebsocketHeartbeat = __esm({
7904
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts"() {
8726
+ "node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts"() {
7905
8727
  "use strict";
7906
- init_src();
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClient.ts
8767
+ // node_modules/@pmate/utils/src/websocket/WebsocketClient.ts
7946
8768
  var logger2;
7947
8769
  var init_WebsocketClient = __esm({
7948
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClient.ts"() {
8770
+ "node_modules/@pmate/utils/src/websocket/WebsocketClient.ts"() {
7949
8771
  "use strict";
7950
- init_src();
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts
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/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts"() {
8790
+ "node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts"() {
7969
8791
  "use strict";
7970
- init_src();
8792
+ init_src4();
7971
8793
  init_AsyncStream();
7972
8794
  init_Logger();
7973
8795
  init_Msg();
@@ -8180,129 +9002,408 @@ var init_WebsocketClientV2 = __esm({
8180
9002
  );
8181
9003
  throw error;
8182
9004
  }
8183
- try {
8184
- const payload = await Msg.toWire(msg, "websocket");
8185
- ws.send(payload);
8186
- } catch (error) {
8187
- logger3.error("Failed to send message", this.getDebugContext(), error);
8188
- throw error;
9005
+ try {
9006
+ const payload = await Msg.toWire(msg, "websocket");
9007
+ ws.send(payload);
9008
+ } catch (error) {
9009
+ logger3.error("Failed to send message", this.getDebugContext(), error);
9010
+ throw error;
9011
+ }
9012
+ }
9013
+ getConnectionType() {
9014
+ return "websocket";
9015
+ }
9016
+ getWs() {
9017
+ return this.ws;
9018
+ }
9019
+ getDebugContext(additional) {
9020
+ return {
9021
+ url: this.wsUrl,
9022
+ from: this.from,
9023
+ connected: this.connected,
9024
+ manualClose: this.manualClose,
9025
+ reconnectAttempts: this.reconnectAttempts,
9026
+ readyState: this.ws?.readyState,
9027
+ ...additional
9028
+ };
9029
+ }
9030
+ getBinaryPreview(bytes) {
9031
+ return Array.from(bytes.slice(0, 16)).map((byte) => byte.toString(16).padStart(2, "0")).join(" ");
9032
+ }
9033
+ };
9034
+ }
9035
+ });
9036
+
9037
+ // node_modules/@pmate/utils/src/websocket/H3Client.ts
9038
+ var logger4;
9039
+ var init_H3Client = __esm({
9040
+ "node_modules/@pmate/utils/src/websocket/H3Client.ts"() {
9041
+ "use strict";
9042
+ init_Emitter();
9043
+ init_Logger();
9044
+ init_Msg();
9045
+ init_WebsocketClient();
9046
+ logger4 = Logger.getDebugger("h3");
9047
+ }
9048
+ });
9049
+
9050
+ // node_modules/@pmate/utils/src/websocket/index.ts
9051
+ var init_websocket = __esm({
9052
+ "node_modules/@pmate/utils/src/websocket/index.ts"() {
9053
+ "use strict";
9054
+ init_WebsocketClient();
9055
+ init_WebsocketClientV2();
9056
+ init_H3Client();
9057
+ }
9058
+ });
9059
+
9060
+ // node_modules/@pmate/utils/src/index.ts
9061
+ var init_src5 = __esm({
9062
+ "node_modules/@pmate/utils/src/index.ts"() {
9063
+ "use strict";
9064
+ init_base64();
9065
+ init_batchResolve();
9066
+ init_bookStats();
9067
+ init_BoundedConcurrentQueue();
9068
+ init_lru();
9069
+ init_cacheMethodInMem();
9070
+ init_compress();
9071
+ init_AsyncStream();
9072
+ init_createMsg();
9073
+ init_detectText();
9074
+ init_Emitter();
9075
+ init_EmitterV2();
9076
+ init_format();
9077
+ init_isVolcabulary();
9078
+ init_Loadable();
9079
+ init_Logger();
9080
+ init_mapToReadingBook();
9081
+ init_Maybe();
9082
+ init_memoize();
9083
+ init_Msg();
9084
+ init_normalize();
9085
+ init_pageURL();
9086
+ init_PromiseQueue();
9087
+ init_resourceKey();
9088
+ init_SelectionHelper();
9089
+ init_setMinus();
9090
+ init_sha1Hash();
9091
+ init_TaskWaiter();
9092
+ init_toSentenceAnalyze();
9093
+ init_txtBookToJson();
9094
+ init_uniqHash();
9095
+ init_VocabularyMap();
9096
+ init_wait();
9097
+ init_wordCount();
9098
+ init_websocket();
9099
+ }
9100
+ });
9101
+
9102
+ // node_modules/@pmate/agent-sdk/dist/debug.js
9103
+ function isDebugEnabled() {
9104
+ return process.env.DEBUG === "1";
9105
+ }
9106
+ function debugLog(message, data) {
9107
+ if (!isDebugEnabled()) {
9108
+ return;
9109
+ }
9110
+ if (data === void 0) {
9111
+ console.log(message);
9112
+ return;
9113
+ }
9114
+ console.log(message, data);
9115
+ }
9116
+ var init_debug = __esm({
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"() {
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;
8189
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;
8190
9355
  }
8191
- getConnectionType() {
8192
- return "websocket";
9356
+ resolveAuth() {
9357
+ if (!this.authResolve) {
9358
+ return;
9359
+ }
9360
+ const resolve = this.authResolve;
9361
+ this.clearAuthWaiter();
9362
+ this.authStarted = false;
9363
+ resolve();
8193
9364
  }
8194
- getWs() {
8195
- return this.ws;
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);
8196
9373
  }
8197
- getDebugContext(additional) {
8198
- return {
8199
- url: this.wsUrl,
8200
- from: this.from,
8201
- connected: this.connected,
8202
- manualClose: this.manualClose,
8203
- reconnectAttempts: this.reconnectAttempts,
8204
- readyState: this.ws?.readyState,
8205
- ...additional
8206
- };
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;
8207
9382
  }
8208
- getBinaryPreview(bytes) {
8209
- return Array.from(bytes.slice(0, 16)).map((byte) => byte.toString(16).padStart(2, "0")).join(" ");
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
+ };
8210
9396
  }
8211
9397
  };
8212
9398
  }
8213
9399
  });
8214
9400
 
8215
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/H3Client.ts
8216
- var logger4;
8217
- var init_H3Client = __esm({
8218
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/H3Client.ts"() {
8219
- "use strict";
8220
- init_Emitter();
8221
- init_Logger();
8222
- init_Msg();
8223
- init_WebsocketClient();
8224
- logger4 = Logger.getDebugger("h3");
8225
- }
8226
- });
8227
-
8228
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/index.ts
8229
- var init_websocket = __esm({
8230
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/index.ts"() {
8231
- "use strict";
8232
- init_WebsocketClient();
8233
- init_WebsocketClientV2();
8234
- init_H3Client();
8235
- }
8236
- });
8237
-
8238
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/index.ts
8239
- var init_src3 = __esm({
8240
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/index.ts"() {
8241
- "use strict";
8242
- init_base64();
8243
- init_batchResolve();
8244
- init_bookStats();
8245
- init_BoundedConcurrentQueue();
8246
- init_lru();
8247
- init_cacheMethodInMem();
8248
- init_compress();
8249
- init_AsyncStream();
8250
- init_createMsg();
8251
- init_detectText();
8252
- init_Emitter();
8253
- init_EmitterV2();
8254
- init_format();
8255
- init_isVolcabulary();
8256
- init_Loadable();
8257
- init_Logger();
8258
- init_mapToReadingBook();
8259
- init_Maybe();
8260
- init_memoize();
8261
- init_Msg();
8262
- init_normalize();
8263
- init_pageURL();
8264
- init_PromiseQueue();
8265
- init_resourceKey();
8266
- init_SelectionHelper();
8267
- init_setMinus();
8268
- init_sha1Hash();
8269
- init_TaskWaiter();
8270
- init_toSentenceAnalyze();
8271
- init_txtBookToJson();
8272
- init_uniqHash();
8273
- init_VocabularyMap();
8274
- init_wait();
8275
- init_wordCount();
8276
- init_websocket();
8277
- }
8278
- });
8279
-
8280
- // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/debug.js
8281
- function isDebugEnabled() {
8282
- return process.env.DEBUG === "1";
8283
- }
8284
- function debugLog(message, data) {
8285
- if (!isDebugEnabled()) {
8286
- return;
8287
- }
8288
- if (data === void 0) {
8289
- console.log(message);
8290
- return;
8291
- }
8292
- console.log(message, data);
8293
- }
8294
- var init_debug = __esm({
8295
- "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/debug.js"() {
8296
- "use strict";
8297
- }
8298
- });
8299
-
8300
- // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentTaskManager.js
9401
+ // node_modules/@pmate/agent-sdk/dist/AgentTaskManager.js
8301
9402
  var AgentTaskManager;
8302
9403
  var init_AgentTaskManager = __esm({
8303
- "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentTaskManager.js"() {
9404
+ "node_modules/@pmate/agent-sdk/dist/AgentTaskManager.js"() {
8304
9405
  "use strict";
8305
- init_src3();
9406
+ init_src5();
8306
9407
  init_debug();
8307
9408
  AgentTaskManager = class {
8308
9409
  constructor() {
@@ -8469,7 +9570,7 @@ var init_AgentTaskManager = __esm({
8469
9570
  }
8470
9571
  });
8471
9572
 
8472
- // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentClient.js
9573
+ // node_modules/@pmate/agent-sdk/dist/AgentClient.js
8473
9574
  function createAgentRequestBody(payload) {
8474
9575
  return {
8475
9576
  kind: "request",
@@ -8478,10 +9579,11 @@ function createAgentRequestBody(payload) {
8478
9579
  }
8479
9580
  var logger5, DEFAULT_TIMEOUT_MS, DEFAULT_STREAM_TIMEOUT_MS, DEFAULT_MIN_CHUNK_SIZE_BYTES, AgentClient;
8480
9581
  var init_AgentClient = __esm({
8481
- "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentClient.js"() {
9582
+ "node_modules/@pmate/agent-sdk/dist/AgentClient.js"() {
8482
9583
  "use strict";
8483
9584
  init_src();
8484
- init_src3();
9585
+ init_src5();
9586
+ init_AgentConnectionPool();
8485
9587
  init_AgentTaskManager();
8486
9588
  init_debug();
8487
9589
  logger5 = Logger.getDebugger("AgentClient");
@@ -8492,11 +9594,6 @@ var init_AgentClient = __esm({
8492
9594
  constructor(options) {
8493
9595
  super();
8494
9596
  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
9597
  this.defaultRequestType = "application/json";
8501
9598
  this.defaultBinaryType = "application/octet-stream";
8502
9599
  this.baseUrl = options.baseUrl;
@@ -8504,13 +9601,12 @@ var init_AgentClient = __esm({
8504
9601
  this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
8505
9602
  this.streamTimeoutMs = options.streamTimeoutMs ?? DEFAULT_STREAM_TIMEOUT_MS;
8506
9603
  this.minChunkSizeBytes = options.minChunkSizeBytes ?? DEFAULT_MIN_CHUNK_SIZE_BYTES;
8507
- this.resetWebsocket(this.baseUrl);
8508
9604
  }
8509
9605
  isConnected() {
8510
- return this.ws?.isConnected() ?? false;
9606
+ return this.lease?.connection.isConnected() ?? false;
8511
9607
  }
8512
9608
  close() {
8513
- this.ws?.close();
9609
+ this.releaseConnection();
8514
9610
  }
8515
9611
  async login(options) {
8516
9612
  const profileId = options?.profileId;
@@ -8519,13 +9615,19 @@ var init_AgentClient = __esm({
8519
9615
  }
8520
9616
  this.from = profileId;
8521
9617
  const baseUrl = options?.baseUrl ?? this.baseUrl;
8522
- if (baseUrl !== this.baseUrl) {
8523
- this.resetWebsocket(baseUrl);
8524
- }
8525
9618
  const timeoutMs = options?.timeoutMs ?? this.timeoutMs;
8526
- await this.waitForConnection(timeoutMs);
8527
9619
  const token = options?.token ?? "";
8528
- await this.sendAuth(token, timeoutMs, profileId);
9620
+ this.auth = { token, profileId };
9621
+ const lease = AgentConnectionPool.acquire({ baseUrl, token, profileId });
9622
+ if (this.lease?.key !== lease.key) {
9623
+ this.releaseConnection();
9624
+ this.lease = lease;
9625
+ this.lease.connection.addListener(this);
9626
+ } else {
9627
+ AgentConnectionPool.release(lease);
9628
+ }
9629
+ this.baseUrl = baseUrl;
9630
+ await this.lease.connection.authenticate(timeoutMs);
8529
9631
  return true;
8530
9632
  }
8531
9633
  async prompt(request) {
@@ -8562,11 +9664,18 @@ var init_AgentClient = __esm({
8562
9664
  taskId,
8563
9665
  agentId: request.agentId,
8564
9666
  op: 0 /* Start */,
9667
+ auth: this.auth,
8565
9668
  type: this.defaultRequestType,
8566
9669
  ...request.payload ? { payload: request.payload } : {}
8567
9670
  };
8568
9671
  const msg = Msg.create(this.from, hubTo, 2 /* AGENT */, createAgentRequestBody(startPayload), 0 /* PIPELINE */);
8569
- await this.ws.sendMsg(msg);
9672
+ debugLog("[agent-client] sending agent request", {
9673
+ taskId,
9674
+ agentId: request.agentId,
9675
+ from: this.from,
9676
+ to: hubTo
9677
+ });
9678
+ await this.lease.connection.sendMsg(msg);
8570
9679
  return await waiter;
8571
9680
  }
8572
9681
  stream(request) {
@@ -8578,7 +9687,7 @@ var init_AgentClient = __esm({
8578
9687
  timeoutMode: "reject"
8579
9688
  });
8580
9689
  const from = this.from;
8581
- const ws = this.ws;
9690
+ const connection = this.lease.connection;
8582
9691
  const minChunkSizeBytes = request.minChunkSizeBytes ?? this.minChunkSizeBytes;
8583
9692
  const inputStream = minChunkSizeBytes > 0 ? AsyncStream.chunkBlob(request.stream, {
8584
9693
  minBytes: minChunkSizeBytes
@@ -8620,29 +9729,32 @@ var init_AgentClient = __esm({
8620
9729
  taskId,
8621
9730
  agentId: request.agentId,
8622
9731
  op: 0 /* Start */,
9732
+ auth: this.auth,
8623
9733
  type: this.defaultRequestType,
8624
9734
  ...request.params ? { payload: request.params } : {}
8625
9735
  }), 0 /* PIPELINE */);
8626
- await ws.sendMsg(startMsg);
9736
+ await connection.sendMsg(startMsg);
8627
9737
  for await (const payload of inputStream) {
8628
9738
  const dataType = payload instanceof Blob ? payload.type || this.defaultBinaryType : payload instanceof Uint8Array || payload instanceof ArrayBuffer ? this.defaultBinaryType : typeof payload === "string" ? "text" : this.defaultRequestType;
8629
9739
  const body = {
8630
9740
  taskId,
8631
9741
  agentId: request.agentId,
8632
9742
  op: 1 /* Data */,
9743
+ auth: this.auth,
8633
9744
  type: dataType,
8634
9745
  payload
8635
9746
  };
8636
9747
  const msg = Msg.create(from, hubTo, 2 /* AGENT */, createAgentRequestBody(body), 0 /* PIPELINE */);
8637
- await ws.sendMsg(msg);
9748
+ await connection.sendMsg(msg);
8638
9749
  }
8639
9750
  const endMsg = Msg.create(from, hubTo, 2 /* AGENT */, createAgentRequestBody({
8640
9751
  taskId,
8641
9752
  agentId: request.agentId,
8642
9753
  op: 2 /* End */,
9754
+ auth: this.auth,
8643
9755
  type: this.defaultRequestType
8644
9756
  }), 0 /* PIPELINE */);
8645
- await ws.sendMsg(endMsg);
9757
+ await connection.sendMsg(endMsg);
8646
9758
  };
8647
9759
  void startDataStream();
8648
9760
  const agentStream = outputStream;
@@ -8693,7 +9805,7 @@ var init_AgentClient = __esm({
8693
9805
  return agentStream;
8694
9806
  }
8695
9807
  ensureReady() {
8696
- if (!this.ws || !this.from) {
9808
+ if (!this.lease || !this.from || !this.auth) {
8697
9809
  throw new Error("AgentClient not logged in");
8698
9810
  }
8699
9811
  }
@@ -8701,31 +9813,7 @@ var init_AgentClient = __esm({
8701
9813
  const rnd = Math.floor(Math.random() * 1e12);
8702
9814
  return uniqHash(`${agentId}-${Date.now()}-${rnd}`, "task-v1" /* Task */);
8703
9815
  }
8704
- createWebsocketClient(baseUrl) {
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) {
9816
+ onConnectionEvent(event) {
8729
9817
  if (event.type === "message") {
8730
9818
  this.handleIncomingMessage(event.data);
8731
9819
  return;
@@ -8736,30 +9824,16 @@ var init_AgentClient = __esm({
8736
9824
  }
8737
9825
  if (event.type === "connected") {
8738
9826
  this.emit("connected" /* Connected */, event.data);
8739
- if (!event.data) {
8740
- this.rejectAuth(new Error("Agent websocket disconnected before auth ack"));
8741
- }
8742
9827
  return;
8743
9828
  }
8744
9829
  if (event.type === "error") {
8745
9830
  this.emit("error" /* Error */, event.data);
8746
- this.rejectAuth(new Error("Agent websocket error before auth ack"));
8747
9831
  }
8748
9832
  }
8749
9833
  handleIncomingMessage(message) {
8750
9834
  if (!message || typeof message !== "object") {
8751
9835
  return;
8752
9836
  }
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
9837
  if (message.opcode === 2 /* AGENT */) {
8764
9838
  const agentBody = message.body;
8765
9839
  if (agentBody?.kind !== "response") {
@@ -8777,158 +9851,75 @@ var init_AgentClient = __esm({
8777
9851
  this.tasks.handleResponse(body);
8778
9852
  }
8779
9853
  }
8780
- ensureProtocol(value, protocol) {
8781
- if (!value) {
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) {
9854
+ releaseConnection() {
9855
+ if (!this.lease) {
8857
9856
  return;
8858
9857
  }
8859
- const reject = this.authReject;
8860
- this.clearAuthWaiter();
8861
- reject(error);
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;
9858
+ this.lease.connection.removeListener(this);
9859
+ AgentConnectionPool.release(this.lease);
9860
+ this.lease = void 0;
9861
+ this.auth = void 0;
8871
9862
  }
8872
9863
  };
8873
9864
  }
8874
9865
  });
8875
9866
 
8876
- // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentRuntime.js
9867
+ // node_modules/@pmate/agent-sdk/dist/AgentRuntime.js
8877
9868
  var init_AgentRuntime = __esm({
8878
- "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentRuntime.js"() {
9869
+ "node_modules/@pmate/agent-sdk/dist/AgentRuntime.js"() {
8879
9870
  "use strict";
8880
9871
  init_src();
8881
- init_src3();
9872
+ init_src5();
8882
9873
  }
8883
9874
  });
8884
9875
 
8885
- // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/PromptTaskContext.js
9876
+ // node_modules/@pmate/agent-sdk/dist/PromptTaskContext.js
8886
9877
  var init_PromptTaskContext = __esm({
8887
- "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/PromptTaskContext.js"() {
9878
+ "node_modules/@pmate/agent-sdk/dist/PromptTaskContext.js"() {
8888
9879
  "use strict";
8889
9880
  }
8890
9881
  });
8891
9882
 
8892
- // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/PromptAgent.js
9883
+ // node_modules/@pmate/agent-sdk/dist/PromptAgent.js
8893
9884
  var init_PromptAgent = __esm({
8894
- "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/PromptAgent.js"() {
9885
+ "node_modules/@pmate/agent-sdk/dist/PromptAgent.js"() {
8895
9886
  "use strict";
8896
9887
  init_src();
8897
- init_src3();
9888
+ init_src5();
8898
9889
  init_debug();
8899
9890
  init_AgentRuntime();
8900
9891
  init_PromptTaskContext();
8901
9892
  }
8902
9893
  });
8903
9894
 
8904
- // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/StreamTaskContext.js
9895
+ // node_modules/@pmate/agent-sdk/dist/StreamTaskContext.js
8905
9896
  var init_StreamTaskContext = __esm({
8906
- "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/StreamTaskContext.js"() {
9897
+ "node_modules/@pmate/agent-sdk/dist/StreamTaskContext.js"() {
8907
9898
  "use strict";
8908
9899
  }
8909
9900
  });
8910
9901
 
8911
- // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/StreamAgent.js
9902
+ // node_modules/@pmate/agent-sdk/dist/StreamAgent.js
8912
9903
  var init_StreamAgent = __esm({
8913
- "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/StreamAgent.js"() {
9904
+ "node_modules/@pmate/agent-sdk/dist/StreamAgent.js"() {
8914
9905
  "use strict";
8915
9906
  init_src();
8916
- init_src3();
9907
+ init_src5();
8917
9908
  init_AgentRuntime();
8918
9909
  init_StreamTaskContext();
8919
9910
  }
8920
9911
  });
8921
9912
 
8922
- // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentFactory.js
9913
+ // node_modules/@pmate/agent-sdk/dist/AgentFactory.js
8923
9914
  var init_AgentFactory = __esm({
8924
- "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentFactory.js"() {
9915
+ "node_modules/@pmate/agent-sdk/dist/AgentFactory.js"() {
8925
9916
  "use strict";
8926
9917
  init_PromptAgent();
8927
9918
  init_StreamAgent();
8928
9919
  }
8929
9920
  });
8930
9921
 
8931
- // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentService.js
9922
+ // node_modules/@pmate/agent-sdk/dist/AgentService.js
8932
9923
  function parseAgentId(agentId) {
8933
9924
  const separatorIndex = agentId.indexOf(":");
8934
9925
  if (separatorIndex <= 0 || separatorIndex === agentId.length - 1) {
@@ -8958,7 +9949,7 @@ function trimTrailingSlash(value) {
8958
9949
  }
8959
9950
  var AgentService;
8960
9951
  var init_AgentService = __esm({
8961
- "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentService.js"() {
9952
+ "node_modules/@pmate/agent-sdk/dist/AgentService.js"() {
8962
9953
  "use strict";
8963
9954
  AgentService = class {
8964
9955
  constructor(options) {
@@ -8999,9 +9990,9 @@ var init_AgentService = __esm({
8999
9990
  }
9000
9991
  });
9001
9992
 
9002
- // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/index.js
9993
+ // node_modules/@pmate/agent-sdk/dist/index.js
9003
9994
  var init_dist2 = __esm({
9004
- "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/index.js"() {
9995
+ "node_modules/@pmate/agent-sdk/dist/index.js"() {
9005
9996
  "use strict";
9006
9997
  init_AgentClient();
9007
9998
  init_AgentFactory();
@@ -9011,7 +10002,7 @@ var init_dist2 = __esm({
9011
10002
  init_AgentTaskManager();
9012
10003
  init_AgentService();
9013
10004
  init_debug();
9014
- init_src3();
10005
+ init_src5();
9015
10006
  }
9016
10007
  });
9017
10008
 
@@ -10489,7 +11480,10 @@ var AliyunService = class {
10489
11480
  {
10490
11481
  functionName: "host_redirect",
10491
11482
  functionArgs: [
10492
- { argName: "regex", argValue: "^/(?!.*\\.[^/]+$).*" },
11483
+ {
11484
+ argName: "regex",
11485
+ argValue: "^/(?!\\.well-known(?:/|$))(?!.*\\.[^/]+$).*"
11486
+ },
10493
11487
  { argName: "replacement", argValue: "/index.html" },
10494
11488
  { argName: "flag", argValue: "break" }
10495
11489
  ]
@@ -10508,7 +11502,10 @@ var AliyunService = class {
10508
11502
  {
10509
11503
  functionName: "host_redirect",
10510
11504
  functionArgs: [
10511
- { argName: "regex", argValue: "^/(?!.*\\.[^/]+$)(.*?)(?:/)?$" },
11505
+ {
11506
+ argName: "regex",
11507
+ argValue: "^/(?!\\.well-known(?:/|$))(?!.*\\.[^/]+$)(.*?)(?:/)?$"
11508
+ },
10512
11509
  { argName: "replacement", argValue: "/$1/index.html" },
10513
11510
  { argName: "flag", argValue: "break" }
10514
11511
  ]
@@ -10713,6 +11710,9 @@ var AliyunService = class {
10713
11710
  return `${prefix}/${normalizedPath}`;
10714
11711
  }
10715
11712
  static getContentType(filePath) {
11713
+ if (import_node_path4.default.basename(filePath).toLowerCase() === "apple-app-site-association") {
11714
+ return "application/json";
11715
+ }
10716
11716
  const ext = import_node_path4.default.extname(filePath).toLowerCase();
10717
11717
  switch (ext) {
10718
11718
  case ".html":
@@ -10757,7 +11757,7 @@ var AliyunService = class {
10757
11757
  static getStaticAssetCacheControl(filePath) {
10758
11758
  const normalized = filePath.replace(/\\/g, "/");
10759
11759
  const base = import_node_path4.default.posix.basename(normalized).toLowerCase();
10760
- if (base === "index.html" || base === "200.html" || base === "404.html") {
11760
+ if (base === "index.html" || base === "200.html" || base === "404.html" || base === "apple-app-site-association") {
10761
11761
  return "no-cache, no-store, must-revalidate";
10762
11762
  }
10763
11763
  if (/[.-][a-z0-9_-]{8,}\./i.test(base)) {
@@ -16260,7 +17260,16 @@ function compareNullableIsoDesc(left, right) {
16260
17260
  }
16261
17261
  function formatBotMessage(message) {
16262
17262
  const sender = message.sender ? `${message.sender}: ` : "";
16263
- return `[${message.sentAt}] ${sender}${message.body}`;
17263
+ const files = formatBotMessageFiles(message.files);
17264
+ return `[${message.sentAt}] ${sender}${message.body}${files ? ` ${files}` : ""}`;
17265
+ }
17266
+ function formatBotMessageFiles(files) {
17267
+ if (!Array.isArray(files) || files.length === 0) return "";
17268
+ return files.map((file) => {
17269
+ const label = file.kind === "image" ? "Image" : "File";
17270
+ const name = file.fileName || file.path || "attachment";
17271
+ return `[${label}: ${name}]`;
17272
+ }).join(" ");
16264
17273
  }
16265
17274
  function truncateCliPreview(value, maxLength) {
16266
17275
  const normalized = value.replace(/\s+/g, " ").replace(/\u200B/g, "").trim();