@pmate/cli 0.24.35 → 0.24.36

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 +535 -811
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -293,150 +293,160 @@ var init_sessionStore = __esm({
293
293
  }
294
294
  });
295
295
 
296
- // node_modules/@pmate/meta/src/types/account.types.ts
296
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/account.types.ts
297
297
  var init_account_types = __esm({
298
- "node_modules/@pmate/meta/src/types/account.types.ts"() {
298
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/account.types.ts"() {
299
299
  "use strict";
300
300
  }
301
301
  });
302
302
 
303
- // node_modules/@pmate/meta/src/types/achievements.types.ts
303
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/achievements.types.ts
304
304
  var init_achievements_types = __esm({
305
- "node_modules/@pmate/meta/src/types/achievements.types.ts"() {
305
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/achievements.types.ts"() {
306
306
  "use strict";
307
307
  }
308
308
  });
309
309
 
310
- // node_modules/@pmate/meta/src/types/aigen.types.ts
310
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/aigen.types.ts
311
311
  var init_aigen_types = __esm({
312
- "node_modules/@pmate/meta/src/types/aigen.types.ts"() {
312
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/aigen.types.ts"() {
313
313
  "use strict";
314
314
  }
315
315
  });
316
316
 
317
- // node_modules/@pmate/meta/src/types/agent.types.ts
317
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/agent.types.ts
318
318
  var init_agent_types = __esm({
319
- "node_modules/@pmate/meta/src/types/agent.types.ts"() {
319
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/agent.types.ts"() {
320
320
  "use strict";
321
321
  }
322
322
  });
323
323
 
324
- // node_modules/@pmate/meta/src/types/agent-registry.types.ts
324
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/agent-registry.types.ts
325
325
  var init_agent_registry_types = __esm({
326
- "node_modules/@pmate/meta/src/types/agent-registry.types.ts"() {
326
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/agent-registry.types.ts"() {
327
327
  "use strict";
328
328
  }
329
329
  });
330
330
 
331
- // node_modules/@pmate/meta/src/types/blockchain.types.ts
331
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/runner-registry.types.ts
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"() {
334
+ "use strict";
335
+ }
336
+ });
337
+
338
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/blockchain.types.ts
332
339
  var init_blockchain_types = __esm({
333
- "node_modules/@pmate/meta/src/types/blockchain.types.ts"() {
340
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/blockchain.types.ts"() {
334
341
  "use strict";
335
342
  }
336
343
  });
337
344
 
338
- // node_modules/@pmate/meta/src/types/breakdown.types.ts
345
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/breakdown.types.ts
339
346
  var init_breakdown_types = __esm({
340
- "node_modules/@pmate/meta/src/types/breakdown.types.ts"() {
347
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/breakdown.types.ts"() {
341
348
  "use strict";
342
349
  }
343
350
  });
344
351
 
345
- // node_modules/@pmate/meta/src/types/chat.types.ts
352
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/chat.types.ts
346
353
  var init_chat_types = __esm({
347
- "node_modules/@pmate/meta/src/types/chat.types.ts"() {
354
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/chat.types.ts"() {
348
355
  "use strict";
349
356
  }
350
357
  });
351
358
 
352
- // node_modules/@pmate/meta/src/types/companion.types.ts
359
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/companion.types.ts
353
360
  var init_companion_types = __esm({
354
- "node_modules/@pmate/meta/src/types/companion.types.ts"() {
361
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/companion.types.ts"() {
355
362
  "use strict";
356
363
  }
357
364
  });
358
365
 
359
- // node_modules/@pmate/meta/src/types/enums.ts
366
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/enums.ts
360
367
  var init_enums = __esm({
361
- "node_modules/@pmate/meta/src/types/enums.ts"() {
368
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/enums.ts"() {
362
369
  "use strict";
363
370
  }
364
371
  });
365
372
 
366
- // node_modules/@pmate/meta/src/types/lang.types.ts
373
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/lang.types.ts
367
374
  var init_lang_types = __esm({
368
- "node_modules/@pmate/meta/src/types/lang.types.ts"() {
375
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/lang.types.ts"() {
369
376
  "use strict";
370
377
  }
371
378
  });
372
379
 
373
- // node_modules/@pmate/meta/src/types/logs.types.ts
380
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/logs.types.ts
374
381
  var init_logs_types = __esm({
375
- "node_modules/@pmate/meta/src/types/logs.types.ts"() {
382
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/logs.types.ts"() {
376
383
  "use strict";
377
384
  }
378
385
  });
379
386
 
380
- // node_modules/@pmate/meta/src/types/message.types.ts
387
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/message.types.ts
388
+ var PING, PONG;
381
389
  var init_message_types = __esm({
382
- "node_modules/@pmate/meta/src/types/message.types.ts"() {
390
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/message.types.ts"() {
383
391
  "use strict";
392
+ PING = 1;
393
+ PONG = 2;
384
394
  }
385
395
  });
386
396
 
387
- // node_modules/@pmate/meta/src/types/newLog.types.ts
397
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/newLog.types.ts
388
398
  var init_newLog_types = __esm({
389
- "node_modules/@pmate/meta/src/types/newLog.types.ts"() {
399
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/newLog.types.ts"() {
390
400
  "use strict";
391
401
  }
392
402
  });
393
403
 
394
- // node_modules/@pmate/meta/src/types/novel.types.ts
404
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/novel.types.ts
395
405
  var init_novel_types = __esm({
396
- "node_modules/@pmate/meta/src/types/novel.types.ts"() {
406
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/novel.types.ts"() {
397
407
  "use strict";
398
408
  }
399
409
  });
400
410
 
401
- // node_modules/@pmate/meta/src/types/offline.types.ts
411
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/offline.types.ts
402
412
  var init_offline_types = __esm({
403
- "node_modules/@pmate/meta/src/types/offline.types.ts"() {
413
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/offline.types.ts"() {
404
414
  "use strict";
405
415
  }
406
416
  });
407
417
 
408
- // node_modules/@pmate/meta/src/types/prompt.types.ts
418
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/prompt.types.ts
409
419
  var init_prompt_types = __esm({
410
- "node_modules/@pmate/meta/src/types/prompt.types.ts"() {
420
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/prompt.types.ts"() {
411
421
  "use strict";
412
422
  }
413
423
  });
414
424
 
415
- // node_modules/@pmate/meta/src/types/reading.types.ts
425
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/reading.types.ts
416
426
  var init_reading_types = __esm({
417
- "node_modules/@pmate/meta/src/types/reading.types.ts"() {
427
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/reading.types.ts"() {
418
428
  "use strict";
419
429
  }
420
430
  });
421
431
 
422
- // node_modules/@pmate/meta/src/types/settings.types.ts
432
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/settings.types.ts
423
433
  var init_settings_types = __esm({
424
- "node_modules/@pmate/meta/src/types/settings.types.ts"() {
434
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/settings.types.ts"() {
425
435
  "use strict";
426
436
  }
427
437
  });
428
438
 
429
- // node_modules/@pmate/meta/src/types/subscription.types.ts
439
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/subscription.types.ts
430
440
  var init_subscription_types = __esm({
431
- "node_modules/@pmate/meta/src/types/subscription.types.ts"() {
441
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/subscription.types.ts"() {
432
442
  "use strict";
433
443
  }
434
444
  });
435
445
 
436
- // node_modules/@pmate/meta/src/types/types.ts
446
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/types.ts
437
447
  var buildVoiceKey, createVoice;
438
448
  var init_types = __esm({
439
- "node_modules/@pmate/meta/src/types/types.ts"() {
449
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/types.ts"() {
440
450
  "use strict";
441
451
  buildVoiceKey = (provider, name) => {
442
452
  return `${provider}:${name}`;
@@ -458,50 +468,51 @@ var init_types = __esm({
458
468
  }
459
469
  });
460
470
 
461
- // node_modules/@pmate/meta/src/types/wordv5.def.ts
471
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/wordv5.def.ts
462
472
  var init_wordv5_def = __esm({
463
- "node_modules/@pmate/meta/src/types/wordv5.def.ts"() {
473
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/wordv5.def.ts"() {
464
474
  "use strict";
465
475
  }
466
476
  });
467
477
 
468
- // node_modules/@pmate/meta/src/types/auth.types.ts
478
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/auth.types.ts
469
479
  var init_auth_types = __esm({
470
- "node_modules/@pmate/meta/src/types/auth.types.ts"() {
480
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/auth.types.ts"() {
471
481
  "use strict";
472
482
  }
473
483
  });
474
484
 
475
- // node_modules/@pmate/meta/src/types/apps.types.ts
485
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/apps.types.ts
476
486
  var init_apps_types = __esm({
477
- "node_modules/@pmate/meta/src/types/apps.types.ts"() {
487
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/apps.types.ts"() {
478
488
  "use strict";
479
489
  }
480
490
  });
481
491
 
482
- // node_modules/@pmate/meta/src/types/response.types.ts
492
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/response.types.ts
483
493
  var init_response_types = __esm({
484
- "node_modules/@pmate/meta/src/types/response.types.ts"() {
494
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/response.types.ts"() {
485
495
  "use strict";
486
496
  }
487
497
  });
488
498
 
489
- // node_modules/@pmate/meta/src/types/role.types.ts
499
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/role.types.ts
490
500
  var init_role_types = __esm({
491
- "node_modules/@pmate/meta/src/types/role.types.ts"() {
501
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/role.types.ts"() {
492
502
  "use strict";
493
503
  }
494
504
  });
495
505
 
496
- // node_modules/@pmate/meta/src/types/index.ts
506
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/index.ts
497
507
  var init_types2 = __esm({
498
- "node_modules/@pmate/meta/src/types/index.ts"() {
508
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/types/index.ts"() {
499
509
  "use strict";
500
510
  init_account_types();
501
511
  init_achievements_types();
502
512
  init_aigen_types();
503
513
  init_agent_types();
504
514
  init_agent_registry_types();
515
+ init_runner_registry_types();
505
516
  init_blockchain_types();
506
517
  init_breakdown_types();
507
518
  init_chat_types();
@@ -526,24 +537,24 @@ var init_types2 = __esm({
526
537
  }
527
538
  });
528
539
 
529
- // node_modules/@pmate/meta/src/config/BizErrorCode.ts
540
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/BizErrorCode.ts
530
541
  var init_BizErrorCode = __esm({
531
- "node_modules/@pmate/meta/src/config/BizErrorCode.ts"() {
542
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/BizErrorCode.ts"() {
532
543
  "use strict";
533
544
  }
534
545
  });
535
546
 
536
- // node_modules/@pmate/meta/src/config/consts.ts
547
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/consts.ts
537
548
  var init_consts = __esm({
538
- "node_modules/@pmate/meta/src/config/consts.ts"() {
549
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/consts.ts"() {
539
550
  "use strict";
540
551
  }
541
552
  });
542
553
 
543
- // node_modules/@pmate/meta/src/config/TopicNames.ts
554
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/TopicNames.ts
544
555
  var TopicNames, topicKindMatchers;
545
556
  var init_TopicNames = __esm({
546
- "node_modules/@pmate/meta/src/config/TopicNames.ts"() {
557
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/TopicNames.ts"() {
547
558
  "use strict";
548
559
  init_types2();
549
560
  TopicNames = class _TopicNames {
@@ -629,18 +640,18 @@ var init_TopicNames = __esm({
629
640
  }
630
641
  });
631
642
 
632
- // node_modules/@pmate/meta/src/config/OSSKeys.ts
643
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/OSSKeys.ts
633
644
  var init_OSSKeys = __esm({
634
- "node_modules/@pmate/meta/src/config/OSSKeys.ts"() {
645
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/OSSKeys.ts"() {
635
646
  "use strict";
636
647
  init_consts();
637
648
  }
638
649
  });
639
650
 
640
- // node_modules/@pmate/meta/src/config/CompanionProfiles.ts
651
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/CompanionProfiles.ts
641
652
  var openAICoral, openAIAsh, openAIBallad, openAINova, openAIVerse;
642
653
  var init_CompanionProfiles = __esm({
643
- "node_modules/@pmate/meta/src/config/CompanionProfiles.ts"() {
654
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/CompanionProfiles.ts"() {
644
655
  "use strict";
645
656
  init_types2();
646
657
  openAICoral = createVoice({
@@ -675,9 +686,9 @@ var init_CompanionProfiles = __esm({
675
686
  }
676
687
  });
677
688
 
678
- // node_modules/@pmate/meta/src/config/index.ts
689
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/index.ts
679
690
  var init_config = __esm({
680
- "node_modules/@pmate/meta/src/config/index.ts"() {
691
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/config/index.ts"() {
681
692
  "use strict";
682
693
  init_BizErrorCode();
683
694
  init_consts();
@@ -687,83 +698,83 @@ var init_config = __esm({
687
698
  }
688
699
  });
689
700
 
690
- // node_modules/@pmate/meta/src/index.ts
701
+ // node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/index.ts
691
702
  var init_src = __esm({
692
- "node_modules/@pmate/meta/src/index.ts"() {
703
+ "node_modules/.pnpm/@pmate+meta@1.1.13/node_modules/@pmate/meta/src/index.ts"() {
693
704
  "use strict";
694
705
  init_types2();
695
706
  init_config();
696
707
  }
697
708
  });
698
709
 
699
- // node_modules/@pmate/utils/src/base64.ts
710
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/base64.ts
700
711
  var init_base64 = __esm({
701
- "node_modules/@pmate/utils/src/base64.ts"() {
712
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/base64.ts"() {
702
713
  "use strict";
703
714
  }
704
715
  });
705
716
 
706
- // node_modules/@pmate/utils/src/Cache.ts
717
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Cache.ts
707
718
  var init_Cache = __esm({
708
- "node_modules/@pmate/utils/src/Cache.ts"() {
719
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Cache.ts"() {
709
720
  "use strict";
710
721
  }
711
722
  });
712
723
 
713
- // node_modules/@pmate/utils/src/batchResolve.ts
724
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/batchResolve.ts
714
725
  var init_batchResolve = __esm({
715
- "node_modules/@pmate/utils/src/batchResolve.ts"() {
726
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/batchResolve.ts"() {
716
727
  "use strict";
717
728
  init_Cache();
718
729
  }
719
730
  });
720
731
 
721
- // node_modules/@pmate/lang/src/cn/sentenceSpliter.ts
732
+ // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceSpliter.ts
722
733
  var init_sentenceSpliter = __esm({
723
- "node_modules/@pmate/lang/src/cn/sentenceSpliter.ts"() {
734
+ "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceSpliter.ts"() {
724
735
  "use strict";
725
736
  }
726
737
  });
727
738
 
728
- // node_modules/@pmate/lang/src/cn/sentenceTrim.ts
739
+ // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceTrim.ts
729
740
  var init_sentenceTrim = __esm({
730
- "node_modules/@pmate/lang/src/cn/sentenceTrim.ts"() {
741
+ "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceTrim.ts"() {
731
742
  "use strict";
732
743
  }
733
744
  });
734
745
 
735
- // node_modules/@pmate/lang/src/cn/wordSpliter.ts
746
+ // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/wordSpliter.ts
736
747
  var init_wordSpliter = __esm({
737
- "node_modules/@pmate/lang/src/cn/wordSpliter.ts"() {
748
+ "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/wordSpliter.ts"() {
738
749
  "use strict";
739
750
  }
740
751
  });
741
752
 
742
- // node_modules/@pmate/lang/src/en/regex.ts
753
+ // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/regex.ts
743
754
  var init_regex = __esm({
744
- "node_modules/@pmate/lang/src/en/regex.ts"() {
755
+ "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/regex.ts"() {
745
756
  "use strict";
746
757
  }
747
758
  });
748
759
 
749
- // node_modules/@pmate/lang/src/en/sentenceSpliter.ts
760
+ // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceSpliter.ts
750
761
  var init_sentenceSpliter2 = __esm({
751
- "node_modules/@pmate/lang/src/en/sentenceSpliter.ts"() {
762
+ "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceSpliter.ts"() {
752
763
  "use strict";
753
764
  }
754
765
  });
755
766
 
756
- // node_modules/@pmate/lang/src/en/sentenceTrim.ts
767
+ // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceTrim.ts
757
768
  var init_sentenceTrim2 = __esm({
758
- "node_modules/@pmate/lang/src/en/sentenceTrim.ts"() {
769
+ "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceTrim.ts"() {
759
770
  "use strict";
760
771
  }
761
772
  });
762
773
 
763
- // node_modules/@pmate/lang/src/en/wordSpliter.ts
774
+ // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/wordSpliter.ts
764
775
  var regex;
765
776
  var init_wordSpliter2 = __esm({
766
- "node_modules/@pmate/lang/src/en/wordSpliter.ts"() {
777
+ "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/wordSpliter.ts"() {
767
778
  "use strict";
768
779
  regex = new RegExp(
769
780
  [
@@ -799,23 +810,23 @@ var init_wordSpliter2 = __esm({
799
810
  }
800
811
  });
801
812
 
802
- // node_modules/@pmate/lang/src/kr/sentenceSpliter.ts
813
+ // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/sentenceSpliter.ts
803
814
  var init_sentenceSpliter3 = __esm({
804
- "node_modules/@pmate/lang/src/kr/sentenceSpliter.ts"() {
815
+ "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/sentenceSpliter.ts"() {
805
816
  "use strict";
806
817
  }
807
818
  });
808
819
 
809
- // node_modules/@pmate/lang/src/kr/wordSpliter.ts
820
+ // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/wordSpliter.ts
810
821
  var init_wordSpliter3 = __esm({
811
- "node_modules/@pmate/lang/src/kr/wordSpliter.ts"() {
822
+ "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/wordSpliter.ts"() {
812
823
  "use strict";
813
824
  }
814
825
  });
815
826
 
816
- // node_modules/@pmate/lang/src/readingSettings.ts
827
+ // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/readingSettings.ts
817
828
  var init_readingSettings = __esm({
818
- "node_modules/@pmate/lang/src/readingSettings.ts"() {
829
+ "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/readingSettings.ts"() {
819
830
  "use strict";
820
831
  init_sentenceSpliter();
821
832
  init_wordSpliter();
@@ -826,17 +837,17 @@ var init_readingSettings = __esm({
826
837
  }
827
838
  });
828
839
 
829
- // node_modules/@pmate/lang/src/utils.ts
840
+ // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/utils.ts
830
841
  var init_utils = __esm({
831
- "node_modules/@pmate/lang/src/utils.ts"() {
842
+ "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/utils.ts"() {
832
843
  "use strict";
833
844
  init_src();
834
845
  }
835
846
  });
836
847
 
837
- // node_modules/@pmate/lang/src/index.ts
848
+ // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/index.ts
838
849
  var init_src2 = __esm({
839
- "node_modules/@pmate/lang/src/index.ts"() {
850
+ "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/index.ts"() {
840
851
  "use strict";
841
852
  init_sentenceSpliter();
842
853
  init_sentenceTrim();
@@ -852,32 +863,32 @@ var init_src2 = __esm({
852
863
  }
853
864
  });
854
865
 
855
- // node_modules/@pmate/utils/src/bookStats.ts
866
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/bookStats.ts
856
867
  var init_bookStats = __esm({
857
- "node_modules/@pmate/utils/src/bookStats.ts"() {
868
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/bookStats.ts"() {
858
869
  "use strict";
859
870
  init_src2();
860
871
  }
861
872
  });
862
873
 
863
- // node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts
874
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts
864
875
  var init_BoundedConcurrentQueue = __esm({
865
- "node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts"() {
876
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts"() {
866
877
  "use strict";
867
878
  }
868
879
  });
869
880
 
870
- // node_modules/@pmate/utils/src/lru.ts
881
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/lru.ts
871
882
  var init_lru = __esm({
872
- "node_modules/@pmate/utils/src/lru.ts"() {
883
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/lru.ts"() {
873
884
  "use strict";
874
885
  init_Cache();
875
886
  }
876
887
  });
877
888
 
878
- // node_modules/js-sha3/src/sha3.js
889
+ // node_modules/.pnpm/js-sha3@0.9.3/node_modules/js-sha3/src/sha3.js
879
890
  var require_sha3 = __commonJS({
880
- "node_modules/js-sha3/src/sha3.js"(exports2, module2) {
891
+ "node_modules/.pnpm/js-sha3@0.9.3/node_modules/js-sha3/src/sha3.js"(exports2, module2) {
881
892
  "use strict";
882
893
  (function() {
883
894
  "use strict";
@@ -1522,24 +1533,24 @@ var require_sha3 = __commonJS({
1522
1533
  }
1523
1534
  });
1524
1535
 
1525
- // node_modules/@pmate/utils/src/Maybe.ts
1536
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Maybe.ts
1526
1537
  var init_Maybe = __esm({
1527
- "node_modules/@pmate/utils/src/Maybe.ts"() {
1538
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Maybe.ts"() {
1528
1539
  "use strict";
1529
1540
  }
1530
1541
  });
1531
1542
 
1532
- // node_modules/@pmate/utils/src/cacheMethodInMem.ts
1543
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/cacheMethodInMem.ts
1533
1544
  var import_js_sha3;
1534
1545
  var init_cacheMethodInMem = __esm({
1535
- "node_modules/@pmate/utils/src/cacheMethodInMem.ts"() {
1546
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/cacheMethodInMem.ts"() {
1536
1547
  "use strict";
1537
1548
  import_js_sha3 = __toESM(require_sha3(), 1);
1538
1549
  init_Maybe();
1539
1550
  }
1540
1551
  });
1541
1552
 
1542
- // node_modules/pako/dist/pako.esm.mjs
1553
+ // node_modules/.pnpm/pako@2.1.0/node_modules/pako/dist/pako.esm.mjs
1543
1554
  function zero$1(buf) {
1544
1555
  let len = buf.length;
1545
1556
  while (--len >= 0) {
@@ -1827,7 +1838,7 @@ function inflateRaw$1(input, options) {
1827
1838
  }
1828
1839
  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;
1829
1840
  var init_pako_esm = __esm({
1830
- "node_modules/pako/dist/pako.esm.mjs"() {
1841
+ "node_modules/.pnpm/pako@2.1.0/node_modules/pako/dist/pako.esm.mjs"() {
1831
1842
  "use strict";
1832
1843
  Z_FIXED$1 = 4;
1833
1844
  Z_BINARY = 0;
@@ -5708,7 +5719,7 @@ var init_pako_esm = __esm({
5708
5719
  }
5709
5720
  });
5710
5721
 
5711
- // node_modules/@pmate/utils/src/compress.ts
5722
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/compress.ts
5712
5723
  async function gzipEncodeBlob(input) {
5713
5724
  const array = await toUint8Array(input);
5714
5725
  return gzip_1(array);
@@ -5734,16 +5745,16 @@ async function toUint8Array(input) {
5734
5745
  throw new TypeError("Unsupported input type for gzipEncodeBlob");
5735
5746
  }
5736
5747
  var init_compress = __esm({
5737
- "node_modules/@pmate/utils/src/compress.ts"() {
5748
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/compress.ts"() {
5738
5749
  "use strict";
5739
5750
  init_pako_esm();
5740
5751
  }
5741
5752
  });
5742
5753
 
5743
- // node_modules/@pmate/utils/src/AsyncStream.ts
5754
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/AsyncStream.ts
5744
5755
  var AsyncStream;
5745
5756
  var init_AsyncStream = __esm({
5746
- "node_modules/@pmate/utils/src/AsyncStream.ts"() {
5757
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/AsyncStream.ts"() {
5747
5758
  "use strict";
5748
5759
  AsyncStream = class _AsyncStream {
5749
5760
  constructor() {
@@ -5931,418 +5942,12 @@ var init_AsyncStream = __esm({
5931
5942
  }
5932
5943
  });
5933
5944
 
5934
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/account.types.ts
5935
- var init_account_types2 = __esm({
5936
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/account.types.ts"() {
5937
- "use strict";
5938
- }
5939
- });
5940
-
5941
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/achievements.types.ts
5942
- var init_achievements_types2 = __esm({
5943
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/achievements.types.ts"() {
5944
- "use strict";
5945
- }
5946
- });
5947
-
5948
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/aigen.types.ts
5949
- var init_aigen_types2 = __esm({
5950
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/aigen.types.ts"() {
5951
- "use strict";
5952
- }
5953
- });
5954
-
5955
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/agent.types.ts
5956
- var init_agent_types2 = __esm({
5957
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/agent.types.ts"() {
5958
- "use strict";
5959
- }
5960
- });
5961
-
5962
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/agent-registry.types.ts
5963
- var init_agent_registry_types2 = __esm({
5964
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/agent-registry.types.ts"() {
5965
- "use strict";
5966
- }
5967
- });
5968
-
5969
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/blockchain.types.ts
5970
- var init_blockchain_types2 = __esm({
5971
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/blockchain.types.ts"() {
5972
- "use strict";
5973
- }
5974
- });
5975
-
5976
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/breakdown.types.ts
5977
- var init_breakdown_types2 = __esm({
5978
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/breakdown.types.ts"() {
5979
- "use strict";
5980
- }
5981
- });
5982
-
5983
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/chat.types.ts
5984
- var init_chat_types2 = __esm({
5985
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/chat.types.ts"() {
5986
- "use strict";
5987
- }
5988
- });
5989
-
5990
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/companion.types.ts
5991
- var init_companion_types2 = __esm({
5992
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/companion.types.ts"() {
5993
- "use strict";
5994
- }
5995
- });
5996
-
5997
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/enums.ts
5998
- var init_enums2 = __esm({
5999
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/enums.ts"() {
6000
- "use strict";
6001
- }
6002
- });
6003
-
6004
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/lang.types.ts
6005
- var init_lang_types2 = __esm({
6006
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/lang.types.ts"() {
6007
- "use strict";
6008
- }
6009
- });
6010
-
6011
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/logs.types.ts
6012
- var init_logs_types2 = __esm({
6013
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/logs.types.ts"() {
6014
- "use strict";
6015
- }
6016
- });
6017
-
6018
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/message.types.ts
6019
- var PING, PONG;
6020
- var init_message_types2 = __esm({
6021
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/message.types.ts"() {
6022
- "use strict";
6023
- PING = 1;
6024
- PONG = 2;
6025
- }
6026
- });
6027
-
6028
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/newLog.types.ts
6029
- var init_newLog_types2 = __esm({
6030
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/newLog.types.ts"() {
6031
- "use strict";
6032
- }
6033
- });
6034
-
6035
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/novel.types.ts
6036
- var init_novel_types2 = __esm({
6037
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/novel.types.ts"() {
6038
- "use strict";
6039
- }
6040
- });
6041
-
6042
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/offline.types.ts
6043
- var init_offline_types2 = __esm({
6044
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/offline.types.ts"() {
6045
- "use strict";
6046
- }
6047
- });
6048
-
6049
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/prompt.types.ts
6050
- var init_prompt_types2 = __esm({
6051
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/prompt.types.ts"() {
6052
- "use strict";
6053
- }
6054
- });
6055
-
6056
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/reading.types.ts
6057
- var init_reading_types2 = __esm({
6058
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/reading.types.ts"() {
6059
- "use strict";
6060
- }
6061
- });
6062
-
6063
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/settings.types.ts
6064
- var init_settings_types2 = __esm({
6065
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/settings.types.ts"() {
6066
- "use strict";
6067
- }
6068
- });
6069
-
6070
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/subscription.types.ts
6071
- var init_subscription_types2 = __esm({
6072
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/subscription.types.ts"() {
6073
- "use strict";
6074
- }
6075
- });
6076
-
6077
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/types.ts
6078
- var buildVoiceKey2, createVoice2;
6079
- var init_types3 = __esm({
6080
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/types.ts"() {
6081
- "use strict";
6082
- buildVoiceKey2 = (provider, name) => {
6083
- return `${provider}:${name}`;
6084
- };
6085
- createVoice2 = ({
6086
- name,
6087
- provider,
6088
- gender,
6089
- instructions
6090
- }) => {
6091
- return {
6092
- name,
6093
- provider,
6094
- gender,
6095
- instructions,
6096
- key: buildVoiceKey2(provider, name)
6097
- };
6098
- };
6099
- }
6100
- });
6101
-
6102
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/wordv5.def.ts
6103
- var init_wordv5_def2 = __esm({
6104
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/wordv5.def.ts"() {
6105
- "use strict";
6106
- }
6107
- });
6108
-
6109
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/auth.types.ts
6110
- var init_auth_types2 = __esm({
6111
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/auth.types.ts"() {
6112
- "use strict";
6113
- }
6114
- });
6115
-
6116
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/apps.types.ts
6117
- var init_apps_types2 = __esm({
6118
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/apps.types.ts"() {
6119
- "use strict";
6120
- }
6121
- });
6122
-
6123
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/response.types.ts
6124
- var init_response_types2 = __esm({
6125
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/response.types.ts"() {
6126
- "use strict";
6127
- }
6128
- });
6129
-
6130
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/role.types.ts
6131
- var init_role_types2 = __esm({
6132
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/role.types.ts"() {
6133
- "use strict";
6134
- }
6135
- });
6136
-
6137
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/index.ts
6138
- var init_types4 = __esm({
6139
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/types/index.ts"() {
6140
- "use strict";
6141
- init_account_types2();
6142
- init_achievements_types2();
6143
- init_aigen_types2();
6144
- init_agent_types2();
6145
- init_agent_registry_types2();
6146
- init_blockchain_types2();
6147
- init_breakdown_types2();
6148
- init_chat_types2();
6149
- init_companion_types2();
6150
- init_enums2();
6151
- init_lang_types2();
6152
- init_logs_types2();
6153
- init_message_types2();
6154
- init_newLog_types2();
6155
- init_novel_types2();
6156
- init_offline_types2();
6157
- init_prompt_types2();
6158
- init_reading_types2();
6159
- init_settings_types2();
6160
- init_subscription_types2();
6161
- init_types3();
6162
- init_wordv5_def2();
6163
- init_auth_types2();
6164
- init_apps_types2();
6165
- init_response_types2();
6166
- init_role_types2();
6167
- }
6168
- });
6169
-
6170
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/BizErrorCode.ts
6171
- var init_BizErrorCode2 = __esm({
6172
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/BizErrorCode.ts"() {
6173
- "use strict";
6174
- }
6175
- });
6176
-
6177
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/consts.ts
6178
- var init_consts2 = __esm({
6179
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/consts.ts"() {
6180
- "use strict";
6181
- }
6182
- });
6183
-
6184
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/TopicNames.ts
6185
- var TopicNames2, topicKindMatchers2;
6186
- var init_TopicNames2 = __esm({
6187
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/TopicNames.ts"() {
6188
- "use strict";
6189
- init_types4();
6190
- TopicNames2 = class _TopicNames {
6191
- static rooms() {
6192
- return "@pmate/rooms";
6193
- }
6194
- static userThreads(user) {
6195
- return `@pmate/user_threads:${user}`;
6196
- }
6197
- static userLogs(user) {
6198
- return `@pmate/user_logs:${user}`;
6199
- }
6200
- static legacyUserLogs(user) {
6201
- return _TopicNames.userLogs(user);
6202
- }
6203
- static userContacts(profileId) {
6204
- return `@pmate/user_contacts:${profileId}`;
6205
- }
6206
- static usersMessage(userId) {
6207
- return `@pmate/user_messages:${userId}`;
6208
- }
6209
- static userMapping() {
6210
- return "@pmate/username_mapping";
6211
- }
6212
- static userMobileMapping() {
6213
- return "@pmate/mobile_account";
6214
- }
6215
- static mapping() {
6216
- return "@pmate/mapping";
6217
- }
6218
- static profiles() {
6219
- return "@pmate/profiles";
6220
- }
6221
- static groups() {
6222
- return "@pmate/groups";
6223
- }
6224
- static relationships() {
6225
- return "@pmate/relationships";
6226
- }
6227
- };
6228
- topicKindMatchers2 = [
6229
- {
6230
- kind: 1e3 /* UserLogs */,
6231
- match: (topic) => topic.startsWith("@pmate/user_logs:")
6232
- },
6233
- {
6234
- kind: 2e3 /* UserMessages */,
6235
- match: (topic) => topic.startsWith("@pmate/user_messages:")
6236
- },
6237
- {
6238
- kind: 3e3 /* Relationships */,
6239
- match: (topic) => topic === TopicNames2.relationships()
6240
- },
6241
- {
6242
- kind: 4e3 /* Rooms */,
6243
- match: (topic) => topic === TopicNames2.rooms()
6244
- },
6245
- {
6246
- kind: 5e3 /* UserContacts */,
6247
- match: (topic) => topic.startsWith("@pmate/user_contacts:")
6248
- },
6249
- {
6250
- kind: 8002 /* Entity_GROUP */,
6251
- match: (topic) => topic === TopicNames2.groups()
6252
- },
6253
- {
6254
- kind: 6e3 /* UserMapping */,
6255
- match: (topic) => topic === TopicNames2.userMapping()
6256
- },
6257
- {
6258
- kind: 7e3 /* UserMobileMapping */,
6259
- match: (topic) => topic === TopicNames2.userMobileMapping()
6260
- },
6261
- {
6262
- kind: 6003 /* Mapping */,
6263
- match: (topic) => topic === TopicNames2.mapping()
6264
- },
6265
- {
6266
- kind: 9e3 /* UserThreads */,
6267
- match: (topic) => topic.startsWith("@pmate/user_threads:")
6268
- }
6269
- ];
6270
- }
6271
- });
6272
-
6273
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/OSSKeys.ts
6274
- var init_OSSKeys2 = __esm({
6275
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/OSSKeys.ts"() {
6276
- "use strict";
6277
- init_consts2();
6278
- }
6279
- });
6280
-
6281
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/CompanionProfiles.ts
6282
- var openAICoral2, openAIAsh2, openAIBallad2, openAINova2, openAIVerse2;
6283
- var init_CompanionProfiles2 = __esm({
6284
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/CompanionProfiles.ts"() {
6285
- "use strict";
6286
- init_types4();
6287
- openAICoral2 = createVoice2({
6288
- name: "coral",
6289
- provider: "openai",
6290
- gender: "F",
6291
- instructions: "sweet, cute,naive voice"
6292
- });
6293
- openAIAsh2 = createVoice2({
6294
- name: "ash",
6295
- provider: "openai",
6296
- gender: "M"
6297
- });
6298
- openAIBallad2 = createVoice2({
6299
- name: "ballad",
6300
- provider: "openai",
6301
- gender: "M",
6302
- instructions: "bright, young man voice"
6303
- });
6304
- openAINova2 = createVoice2({
6305
- name: "nova",
6306
- provider: "openai",
6307
- gender: "F",
6308
- instructions: "mature, smooth, elegant, warm voice"
6309
- });
6310
- openAIVerse2 = createVoice2({
6311
- name: "verse",
6312
- provider: "openai",
6313
- gender: "M",
6314
- instructions: "elderly,mysterious wizzard voice"
6315
- });
6316
- }
6317
- });
6318
-
6319
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/index.ts
6320
- var init_config2 = __esm({
6321
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/config/index.ts"() {
6322
- "use strict";
6323
- init_BizErrorCode2();
6324
- init_consts2();
6325
- init_TopicNames2();
6326
- init_OSSKeys2();
6327
- init_CompanionProfiles2();
6328
- }
6329
- });
6330
-
6331
- // node_modules/@pmate/utils/node_modules/@pmate/meta/src/index.ts
6332
- var init_src3 = __esm({
6333
- "node_modules/@pmate/utils/node_modules/@pmate/meta/src/index.ts"() {
6334
- "use strict";
6335
- init_types4();
6336
- init_config2();
6337
- }
6338
- });
6339
-
6340
- // node_modules/@pmate/utils/src/uniqHash.ts
5945
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/uniqHash.ts
6341
5946
  var import_js_sha32, sortKeys, uniqHash;
6342
5947
  var init_uniqHash = __esm({
6343
- "node_modules/@pmate/utils/src/uniqHash.ts"() {
5948
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/uniqHash.ts"() {
6344
5949
  "use strict";
6345
- init_src3();
5950
+ init_src();
6346
5951
  import_js_sha32 = __toESM(require_sha3(), 1);
6347
5952
  sortKeys = (obj) => {
6348
5953
  if (Array.isArray(obj)) {
@@ -6370,33 +5975,33 @@ var init_uniqHash = __esm({
6370
5975
  }
6371
5976
  });
6372
5977
 
6373
- // node_modules/@pmate/utils/src/createMsg.ts
5978
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/createMsg.ts
6374
5979
  var init_createMsg = __esm({
6375
- "node_modules/@pmate/utils/src/createMsg.ts"() {
5980
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/createMsg.ts"() {
6376
5981
  "use strict";
6377
- init_src3();
5982
+ init_src();
6378
5983
  init_uniqHash();
6379
5984
  }
6380
5985
  });
6381
5986
 
6382
- // node_modules/@pmate/utils/src/detectText.ts
5987
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/detectText.ts
6383
5988
  var init_detectText = __esm({
6384
- "node_modules/@pmate/utils/src/detectText.ts"() {
5989
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/detectText.ts"() {
6385
5990
  "use strict";
6386
5991
  }
6387
5992
  });
6388
5993
 
6389
- // node_modules/@pmate/utils/src/Emitter.ts
5994
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Emitter.ts
6390
5995
  var init_Emitter = __esm({
6391
- "node_modules/@pmate/utils/src/Emitter.ts"() {
5996
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Emitter.ts"() {
6392
5997
  "use strict";
6393
5998
  }
6394
5999
  });
6395
6000
 
6396
- // node_modules/@pmate/utils/src/EmitterV2.ts
6001
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/EmitterV2.ts
6397
6002
  var EmitterV2;
6398
6003
  var init_EmitterV2 = __esm({
6399
- "node_modules/@pmate/utils/src/EmitterV2.ts"() {
6004
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/EmitterV2.ts"() {
6400
6005
  "use strict";
6401
6006
  EmitterV2 = class {
6402
6007
  constructor() {
@@ -6452,39 +6057,39 @@ var init_EmitterV2 = __esm({
6452
6057
  }
6453
6058
  });
6454
6059
 
6455
- // node_modules/@pmate/utils/src/format/formatTime.ts
6060
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/formatTime.ts
6456
6061
  var init_formatTime = __esm({
6457
- "node_modules/@pmate/utils/src/format/formatTime.ts"() {
6062
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/formatTime.ts"() {
6458
6063
  "use strict";
6459
6064
  }
6460
6065
  });
6461
6066
 
6462
- // node_modules/@pmate/utils/src/format/index.ts
6067
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/index.ts
6463
6068
  var init_format = __esm({
6464
- "node_modules/@pmate/utils/src/format/index.ts"() {
6069
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/index.ts"() {
6465
6070
  "use strict";
6466
6071
  init_formatTime();
6467
6072
  }
6468
6073
  });
6469
6074
 
6470
- // node_modules/@pmate/utils/src/isVolcabulary.ts
6075
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/isVolcabulary.ts
6471
6076
  var init_isVolcabulary = __esm({
6472
- "node_modules/@pmate/utils/src/isVolcabulary.ts"() {
6077
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/isVolcabulary.ts"() {
6473
6078
  "use strict";
6474
6079
  }
6475
6080
  });
6476
6081
 
6477
- // node_modules/@pmate/utils/src/Loadable.ts
6082
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Loadable.ts
6478
6083
  var init_Loadable = __esm({
6479
- "node_modules/@pmate/utils/src/Loadable.ts"() {
6084
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Loadable.ts"() {
6480
6085
  "use strict";
6481
6086
  }
6482
6087
  });
6483
6088
 
6484
- // node_modules/@pmate/utils/src/Logger.ts
6089
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Logger.ts
6485
6090
  var Logger;
6486
6091
  var init_Logger = __esm({
6487
- "node_modules/@pmate/utils/src/Logger.ts"() {
6092
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Logger.ts"() {
6488
6093
  "use strict";
6489
6094
  Logger = class _Logger {
6490
6095
  constructor(name) {
@@ -6509,21 +6114,21 @@ var init_Logger = __esm({
6509
6114
  }
6510
6115
  });
6511
6116
 
6512
- // node_modules/@pmate/utils/src/mapToReadingBook.ts
6117
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/mapToReadingBook.ts
6513
6118
  var init_mapToReadingBook = __esm({
6514
- "node_modules/@pmate/utils/src/mapToReadingBook.ts"() {
6119
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/mapToReadingBook.ts"() {
6515
6120
  "use strict";
6516
6121
  }
6517
6122
  });
6518
6123
 
6519
- // node_modules/@pmate/utils/src/memoize.ts
6124
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/memoize.ts
6520
6125
  var init_memoize = __esm({
6521
- "node_modules/@pmate/utils/src/memoize.ts"() {
6126
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/memoize.ts"() {
6522
6127
  "use strict";
6523
6128
  }
6524
6129
  });
6525
6130
 
6526
- // node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs
6131
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs
6527
6132
  function utf8Count(str) {
6528
6133
  const strLength = str.length;
6529
6134
  let byteLength = 0;
@@ -6650,7 +6255,7 @@ function utf8Decode(bytes, inputOffset, byteLength) {
6650
6255
  }
6651
6256
  var sharedTextEncoder, TEXT_ENCODER_THRESHOLD, CHUNK_SIZE, sharedTextDecoder, TEXT_DECODER_THRESHOLD;
6652
6257
  var init_utf8 = __esm({
6653
- "node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs"() {
6258
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs"() {
6654
6259
  "use strict";
6655
6260
  sharedTextEncoder = new TextEncoder();
6656
6261
  TEXT_ENCODER_THRESHOLD = 50;
@@ -6660,10 +6265,10 @@ var init_utf8 = __esm({
6660
6265
  }
6661
6266
  });
6662
6267
 
6663
- // node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs
6268
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs
6664
6269
  var ExtData;
6665
6270
  var init_ExtData = __esm({
6666
- "node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs"() {
6271
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs"() {
6667
6272
  "use strict";
6668
6273
  ExtData = class {
6669
6274
  type;
@@ -6676,10 +6281,10 @@ var init_ExtData = __esm({
6676
6281
  }
6677
6282
  });
6678
6283
 
6679
- // node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs
6284
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs
6680
6285
  var DecodeError;
6681
6286
  var init_DecodeError = __esm({
6682
- "node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs"() {
6287
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs"() {
6683
6288
  "use strict";
6684
6289
  DecodeError = class _DecodeError extends Error {
6685
6290
  constructor(message) {
@@ -6696,7 +6301,7 @@ var init_DecodeError = __esm({
6696
6301
  }
6697
6302
  });
6698
6303
 
6699
- // node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs
6304
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs
6700
6305
  function setUint64(view, offset, value) {
6701
6306
  const high = value / 4294967296;
6702
6307
  const low = value;
@@ -6721,13 +6326,13 @@ function getUint64(view, offset) {
6721
6326
  }
6722
6327
  var UINT32_MAX;
6723
6328
  var init_int = __esm({
6724
- "node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs"() {
6329
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs"() {
6725
6330
  "use strict";
6726
6331
  UINT32_MAX = 4294967295;
6727
6332
  }
6728
6333
  });
6729
6334
 
6730
- // node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs
6335
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs
6731
6336
  function encodeTimeSpecToTimestamp({ sec, nsec }) {
6732
6337
  if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {
6733
6338
  if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {
@@ -6800,7 +6405,7 @@ function decodeTimestampExtension(data) {
6800
6405
  }
6801
6406
  var EXT_TIMESTAMP, TIMESTAMP32_MAX_SEC, TIMESTAMP64_MAX_SEC, timestampExtension;
6802
6407
  var init_timestamp = __esm({
6803
- "node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs"() {
6408
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs"() {
6804
6409
  "use strict";
6805
6410
  init_DecodeError();
6806
6411
  init_int();
@@ -6815,10 +6420,10 @@ var init_timestamp = __esm({
6815
6420
  }
6816
6421
  });
6817
6422
 
6818
- // node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs
6423
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs
6819
6424
  var ExtensionCodec;
6820
6425
  var init_ExtensionCodec = __esm({
6821
- "node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs"() {
6426
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs"() {
6822
6427
  "use strict";
6823
6428
  init_ExtData();
6824
6429
  init_timestamp();
@@ -6885,7 +6490,7 @@ var init_ExtensionCodec = __esm({
6885
6490
  }
6886
6491
  });
6887
6492
 
6888
- // node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs
6493
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs
6889
6494
  function isArrayBufferLike(buffer) {
6890
6495
  return buffer instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && buffer instanceof SharedArrayBuffer;
6891
6496
  }
@@ -6901,15 +6506,15 @@ function ensureUint8Array(buffer) {
6901
6506
  }
6902
6507
  }
6903
6508
  var init_typedArrays = __esm({
6904
- "node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs"() {
6509
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs"() {
6905
6510
  "use strict";
6906
6511
  }
6907
6512
  });
6908
6513
 
6909
- // node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs
6514
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs
6910
6515
  var DEFAULT_MAX_DEPTH, DEFAULT_INITIAL_BUFFER_SIZE, Encoder;
6911
6516
  var init_Encoder = __esm({
6912
- "node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs"() {
6517
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs"() {
6913
6518
  "use strict";
6914
6519
  init_utf8();
6915
6520
  init_ExtensionCodec();
@@ -7319,32 +6924,32 @@ var init_Encoder = __esm({
7319
6924
  }
7320
6925
  });
7321
6926
 
7322
- // node_modules/@msgpack/msgpack/dist.esm/encode.mjs
6927
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/encode.mjs
7323
6928
  function encode(value, options) {
7324
6929
  const encoder2 = new Encoder(options);
7325
6930
  return encoder2.encodeSharedRef(value);
7326
6931
  }
7327
6932
  var init_encode = __esm({
7328
- "node_modules/@msgpack/msgpack/dist.esm/encode.mjs"() {
6933
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/encode.mjs"() {
7329
6934
  "use strict";
7330
6935
  init_Encoder();
7331
6936
  }
7332
6937
  });
7333
6938
 
7334
- // node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs
6939
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs
7335
6940
  function prettyByte(byte) {
7336
6941
  return `${byte < 0 ? "-" : ""}0x${Math.abs(byte).toString(16).padStart(2, "0")}`;
7337
6942
  }
7338
6943
  var init_prettyByte = __esm({
7339
- "node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs"() {
6944
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs"() {
7340
6945
  "use strict";
7341
6946
  }
7342
6947
  });
7343
6948
 
7344
- // node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs
6949
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs
7345
6950
  var DEFAULT_MAX_KEY_LENGTH, DEFAULT_MAX_LENGTH_PER_KEY, CachedKeyDecoder;
7346
6951
  var init_CachedKeyDecoder = __esm({
7347
- "node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs"() {
6952
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs"() {
7348
6953
  "use strict";
7349
6954
  init_utf8();
7350
6955
  DEFAULT_MAX_KEY_LENGTH = 16;
@@ -7404,10 +7009,10 @@ var init_CachedKeyDecoder = __esm({
7404
7009
  }
7405
7010
  });
7406
7011
 
7407
- // node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs
7012
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs
7408
7013
  var STATE_ARRAY, STATE_MAP_KEY, STATE_MAP_VALUE, mapKeyConverter, StackPool, HEAD_BYTE_REQUIRED, EMPTY_VIEW, EMPTY_BYTES, MORE_DATA, sharedCachedKeyDecoder, Decoder;
7409
7014
  var init_Decoder = __esm({
7410
- "node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs"() {
7015
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs"() {
7411
7016
  "use strict";
7412
7017
  init_prettyByte();
7413
7018
  init_ExtensionCodec();
@@ -8045,34 +7650,34 @@ var init_Decoder = __esm({
8045
7650
  }
8046
7651
  });
8047
7652
 
8048
- // node_modules/@msgpack/msgpack/dist.esm/decode.mjs
7653
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/decode.mjs
8049
7654
  function decode(buffer, options) {
8050
7655
  const decoder = new Decoder(options);
8051
7656
  return decoder.decode(buffer);
8052
7657
  }
8053
7658
  var init_decode = __esm({
8054
- "node_modules/@msgpack/msgpack/dist.esm/decode.mjs"() {
7659
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/decode.mjs"() {
8055
7660
  "use strict";
8056
7661
  init_Decoder();
8057
7662
  }
8058
7663
  });
8059
7664
 
8060
- // node_modules/@msgpack/msgpack/dist.esm/index.mjs
7665
+ // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/index.mjs
8061
7666
  var init_dist = __esm({
8062
- "node_modules/@msgpack/msgpack/dist.esm/index.mjs"() {
7667
+ "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/index.mjs"() {
8063
7668
  "use strict";
8064
7669
  init_encode();
8065
7670
  init_decode();
8066
7671
  }
8067
7672
  });
8068
7673
 
8069
- // node_modules/@pmate/utils/src/Msg.ts
7674
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Msg.ts
8070
7675
  var encoder, Msg;
8071
7676
  var init_Msg = __esm({
8072
- "node_modules/@pmate/utils/src/Msg.ts"() {
7677
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Msg.ts"() {
8073
7678
  "use strict";
8074
7679
  init_dist();
8075
- init_src3();
7680
+ init_src();
8076
7681
  init_compress();
8077
7682
  init_uniqHash();
8078
7683
  encoder = new TextEncoder();
@@ -8146,17 +7751,21 @@ var init_Msg = __esm({
8146
7751
  if (!body || typeof body !== "object") {
8147
7752
  return msg;
8148
7753
  }
8149
- if ("payload" in body && "type" in body) {
8150
- const payload = body.payload;
8151
- const isBinaryPayload = typeof Blob !== "undefined" && (payload instanceof Blob || payload instanceof ArrayBuffer || payload instanceof Uint8Array);
8152
- if (isBinaryPayload) {
8153
- const gz = await gzipEncodeBlob(payload);
7754
+ const normalizedBody = await _Msg.normalizePayloadBody(body);
7755
+ if (normalizedBody !== body) {
7756
+ return {
7757
+ ...msg,
7758
+ body: normalizedBody
7759
+ };
7760
+ }
7761
+ if ((body.kind === "request" || body.kind === "response") && body.payload && typeof body.payload === "object") {
7762
+ const normalizedPayload = await _Msg.normalizePayloadBody(body.payload);
7763
+ if (normalizedPayload !== body.payload) {
8154
7764
  return {
8155
7765
  ...msg,
8156
7766
  body: {
8157
7767
  ...body,
8158
- payload: gz,
8159
- contentEncoding: "gzip"
7768
+ payload: normalizedPayload
8160
7769
  }
8161
7770
  };
8162
7771
  }
@@ -8173,112 +7782,128 @@ var init_Msg = __esm({
8173
7782
  }
8174
7783
  return msg;
8175
7784
  }
7785
+ static async normalizePayloadBody(body) {
7786
+ if (!("payload" in body) || !("type" in body)) {
7787
+ return body;
7788
+ }
7789
+ const payload = body.payload;
7790
+ const isBinaryPayload = typeof Blob !== "undefined" && (payload instanceof Blob || payload instanceof ArrayBuffer || payload instanceof Uint8Array);
7791
+ if (!isBinaryPayload) {
7792
+ return body;
7793
+ }
7794
+ const gz = await gzipEncodeBlob(payload);
7795
+ return {
7796
+ ...body,
7797
+ payload: gz,
7798
+ contentEncoding: "gzip"
7799
+ };
7800
+ }
8176
7801
  };
8177
7802
  }
8178
7803
  });
8179
7804
 
8180
- // node_modules/@pmate/utils/src/normalize.ts
7805
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/normalize.ts
8181
7806
  var init_normalize = __esm({
8182
- "node_modules/@pmate/utils/src/normalize.ts"() {
7807
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/normalize.ts"() {
8183
7808
  "use strict";
8184
7809
  }
8185
7810
  });
8186
7811
 
8187
- // node_modules/@pmate/utils/src/pageURL.ts
7812
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/pageURL.ts
8188
7813
  var init_pageURL = __esm({
8189
- "node_modules/@pmate/utils/src/pageURL.ts"() {
7814
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/pageURL.ts"() {
8190
7815
  "use strict";
8191
7816
  }
8192
7817
  });
8193
7818
 
8194
- // node_modules/@pmate/utils/src/PromiseQueue.ts
7819
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/PromiseQueue.ts
8195
7820
  var init_PromiseQueue = __esm({
8196
- "node_modules/@pmate/utils/src/PromiseQueue.ts"() {
7821
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/PromiseQueue.ts"() {
8197
7822
  "use strict";
8198
7823
  }
8199
7824
  });
8200
7825
 
8201
- // node_modules/@pmate/utils/src/resourceKey.ts
7826
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/resourceKey.ts
8202
7827
  var import_js_sha33;
8203
7828
  var init_resourceKey = __esm({
8204
- "node_modules/@pmate/utils/src/resourceKey.ts"() {
7829
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/resourceKey.ts"() {
8205
7830
  "use strict";
8206
7831
  import_js_sha33 = __toESM(require_sha3(), 1);
8207
7832
  }
8208
7833
  });
8209
7834
 
8210
- // node_modules/@pmate/utils/src/SelectionHelper.ts
7835
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/SelectionHelper.ts
8211
7836
  var init_SelectionHelper = __esm({
8212
- "node_modules/@pmate/utils/src/SelectionHelper.ts"() {
7837
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/SelectionHelper.ts"() {
8213
7838
  "use strict";
8214
7839
  }
8215
7840
  });
8216
7841
 
8217
- // node_modules/@pmate/utils/src/setMinus.ts
7842
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/setMinus.ts
8218
7843
  var init_setMinus = __esm({
8219
- "node_modules/@pmate/utils/src/setMinus.ts"() {
7844
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/setMinus.ts"() {
8220
7845
  "use strict";
8221
7846
  }
8222
7847
  });
8223
7848
 
8224
- // node_modules/@pmate/utils/src/sha1Hash.ts
7849
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/sha1Hash.ts
8225
7850
  var init_sha1Hash = __esm({
8226
- "node_modules/@pmate/utils/src/sha1Hash.ts"() {
7851
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/sha1Hash.ts"() {
8227
7852
  "use strict";
8228
7853
  }
8229
7854
  });
8230
7855
 
8231
- // node_modules/@pmate/utils/src/TaskWaiter.ts
7856
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/TaskWaiter.ts
8232
7857
  var init_TaskWaiter = __esm({
8233
- "node_modules/@pmate/utils/src/TaskWaiter.ts"() {
7858
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/TaskWaiter.ts"() {
8234
7859
  "use strict";
8235
- init_src4();
7860
+ init_src3();
8236
7861
  }
8237
7862
  });
8238
7863
 
8239
- // node_modules/@pmate/utils/src/toSentenceAnalyze.ts
7864
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/toSentenceAnalyze.ts
8240
7865
  var init_toSentenceAnalyze = __esm({
8241
- "node_modules/@pmate/utils/src/toSentenceAnalyze.ts"() {
7866
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/toSentenceAnalyze.ts"() {
8242
7867
  "use strict";
8243
7868
  }
8244
7869
  });
8245
7870
 
8246
- // node_modules/@pmate/utils/src/txtBookToJson.ts
7871
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/txtBookToJson.ts
8247
7872
  var init_txtBookToJson = __esm({
8248
- "node_modules/@pmate/utils/src/txtBookToJson.ts"() {
7873
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/txtBookToJson.ts"() {
8249
7874
  "use strict";
8250
7875
  init_src2();
8251
7876
  }
8252
7877
  });
8253
7878
 
8254
- // node_modules/@pmate/utils/src/VocabularyMap.ts
7879
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/VocabularyMap.ts
8255
7880
  var init_VocabularyMap = __esm({
8256
- "node_modules/@pmate/utils/src/VocabularyMap.ts"() {
7881
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/VocabularyMap.ts"() {
8257
7882
  "use strict";
8258
7883
  init_Emitter();
8259
7884
  }
8260
7885
  });
8261
7886
 
8262
- // node_modules/@pmate/utils/src/wait.ts
7887
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wait.ts
8263
7888
  var init_wait = __esm({
8264
- "node_modules/@pmate/utils/src/wait.ts"() {
7889
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wait.ts"() {
8265
7890
  "use strict";
8266
7891
  }
8267
7892
  });
8268
7893
 
8269
- // node_modules/@pmate/utils/src/wordCount.ts
7894
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wordCount.ts
8270
7895
  var init_wordCount = __esm({
8271
- "node_modules/@pmate/utils/src/wordCount.ts"() {
7896
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wordCount.ts"() {
8272
7897
  "use strict";
8273
7898
  }
8274
7899
  });
8275
7900
 
8276
- // node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts
7901
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts
8277
7902
  var logger, WebsocketHeartbeat;
8278
7903
  var init_WebsocketHeartbeat = __esm({
8279
- "node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts"() {
7904
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts"() {
8280
7905
  "use strict";
8281
- init_src3();
7906
+ init_src();
8282
7907
  init_Logger();
8283
7908
  logger = Logger.getDebugger("heartbeat");
8284
7909
  WebsocketHeartbeat = class {
@@ -8311,19 +7936,18 @@ var init_WebsocketHeartbeat = __esm({
8311
7936
  }
8312
7937
  handlePong() {
8313
7938
  this.lastPong = Date.now();
8314
- logger.log("Pong received");
8315
7939
  return true;
8316
7940
  }
8317
7941
  };
8318
7942
  }
8319
7943
  });
8320
7944
 
8321
- // node_modules/@pmate/utils/src/websocket/WebsocketClient.ts
7945
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClient.ts
8322
7946
  var logger2;
8323
7947
  var init_WebsocketClient = __esm({
8324
- "node_modules/@pmate/utils/src/websocket/WebsocketClient.ts"() {
7948
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClient.ts"() {
8325
7949
  "use strict";
8326
- init_src3();
7950
+ init_src();
8327
7951
  init_Emitter();
8328
7952
  init_Logger();
8329
7953
  init_Msg();
@@ -8332,7 +7956,7 @@ var init_WebsocketClient = __esm({
8332
7956
  }
8333
7957
  });
8334
7958
 
8335
- // node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts
7959
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts
8336
7960
  function isEventLike(value) {
8337
7961
  return typeof value === "object" && value !== null && "type" in value && typeof value.type === "string";
8338
7962
  }
@@ -8341,9 +7965,9 @@ function isCloseEvent(value) {
8341
7965
  }
8342
7966
  var logger3, WebsocketClientV2;
8343
7967
  var init_WebsocketClientV2 = __esm({
8344
- "node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts"() {
7968
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts"() {
8345
7969
  "use strict";
8346
- init_src3();
7970
+ init_src();
8347
7971
  init_AsyncStream();
8348
7972
  init_Logger();
8349
7973
  init_Msg();
@@ -8588,10 +8212,10 @@ var init_WebsocketClientV2 = __esm({
8588
8212
  }
8589
8213
  });
8590
8214
 
8591
- // node_modules/@pmate/utils/src/websocket/H3Client.ts
8215
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/H3Client.ts
8592
8216
  var logger4;
8593
8217
  var init_H3Client = __esm({
8594
- "node_modules/@pmate/utils/src/websocket/H3Client.ts"() {
8218
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/H3Client.ts"() {
8595
8219
  "use strict";
8596
8220
  init_Emitter();
8597
8221
  init_Logger();
@@ -8601,9 +8225,9 @@ var init_H3Client = __esm({
8601
8225
  }
8602
8226
  });
8603
8227
 
8604
- // node_modules/@pmate/utils/src/websocket/index.ts
8228
+ // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/index.ts
8605
8229
  var init_websocket = __esm({
8606
- "node_modules/@pmate/utils/src/websocket/index.ts"() {
8230
+ "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/index.ts"() {
8607
8231
  "use strict";
8608
8232
  init_WebsocketClient();
8609
8233
  init_WebsocketClientV2();
@@ -8611,9 +8235,9 @@ var init_websocket = __esm({
8611
8235
  }
8612
8236
  });
8613
8237
 
8614
- // node_modules/@pmate/utils/src/index.ts
8615
- var init_src4 = __esm({
8616
- "node_modules/@pmate/utils/src/index.ts"() {
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"() {
8617
8241
  "use strict";
8618
8242
  init_base64();
8619
8243
  init_batchResolve();
@@ -8653,7 +8277,7 @@ var init_src4 = __esm({
8653
8277
  }
8654
8278
  });
8655
8279
 
8656
- // node_modules/@pmate/agent-sdk/dist/debug.js
8280
+ // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/debug.js
8657
8281
  function isDebugEnabled() {
8658
8282
  return process.env.DEBUG === "1";
8659
8283
  }
@@ -8668,17 +8292,17 @@ function debugLog(message, data) {
8668
8292
  console.log(message, data);
8669
8293
  }
8670
8294
  var init_debug = __esm({
8671
- "node_modules/@pmate/agent-sdk/dist/debug.js"() {
8295
+ "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/debug.js"() {
8672
8296
  "use strict";
8673
8297
  }
8674
8298
  });
8675
8299
 
8676
- // node_modules/@pmate/agent-sdk/dist/AgentTaskManager.js
8300
+ // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentTaskManager.js
8677
8301
  var AgentTaskManager;
8678
8302
  var init_AgentTaskManager = __esm({
8679
- "node_modules/@pmate/agent-sdk/dist/AgentTaskManager.js"() {
8303
+ "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentTaskManager.js"() {
8680
8304
  "use strict";
8681
- init_src4();
8305
+ init_src3();
8682
8306
  init_debug();
8683
8307
  AgentTaskManager = class {
8684
8308
  constructor() {
@@ -8845,13 +8469,19 @@ var init_AgentTaskManager = __esm({
8845
8469
  }
8846
8470
  });
8847
8471
 
8848
- // node_modules/@pmate/agent-sdk/dist/AgentClient.js
8472
+ // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentClient.js
8473
+ function createAgentRequestBody(payload) {
8474
+ return {
8475
+ kind: "request",
8476
+ payload
8477
+ };
8478
+ }
8849
8479
  var logger5, DEFAULT_TIMEOUT_MS, DEFAULT_STREAM_TIMEOUT_MS, DEFAULT_MIN_CHUNK_SIZE_BYTES, AgentClient;
8850
8480
  var init_AgentClient = __esm({
8851
- "node_modules/@pmate/agent-sdk/dist/AgentClient.js"() {
8481
+ "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentClient.js"() {
8852
8482
  "use strict";
8853
8483
  init_src();
8854
- init_src4();
8484
+ init_src3();
8855
8485
  init_AgentTaskManager();
8856
8486
  init_debug();
8857
8487
  logger5 = Logger.getDebugger("AgentClient");
@@ -8882,8 +8512,12 @@ var init_AgentClient = __esm({
8882
8512
  close() {
8883
8513
  this.ws?.close();
8884
8514
  }
8885
- async login(from, options) {
8886
- this.from = from;
8515
+ async login(options) {
8516
+ const profileId = options?.profileId;
8517
+ if (!profileId) {
8518
+ throw new Error("AgentClient user auth requires profileId");
8519
+ }
8520
+ this.from = profileId;
8887
8521
  const baseUrl = options?.baseUrl ?? this.baseUrl;
8888
8522
  if (baseUrl !== this.baseUrl) {
8889
8523
  this.resetWebsocket(baseUrl);
@@ -8891,7 +8525,7 @@ var init_AgentClient = __esm({
8891
8525
  const timeoutMs = options?.timeoutMs ?? this.timeoutMs;
8892
8526
  await this.waitForConnection(timeoutMs);
8893
8527
  const token = options?.token ?? "";
8894
- await this.sendAuth(token, timeoutMs);
8528
+ await this.sendAuth(token, timeoutMs, profileId);
8895
8529
  return true;
8896
8530
  }
8897
8531
  async prompt(request) {
@@ -8931,7 +8565,7 @@ var init_AgentClient = __esm({
8931
8565
  type: this.defaultRequestType,
8932
8566
  ...request.payload ? { payload: request.payload } : {}
8933
8567
  };
8934
- const msg = Msg.create(this.from, hubTo, 1002 /* AGENT_REQUEST */, startPayload, 0 /* PIPELINE */);
8568
+ const msg = Msg.create(this.from, hubTo, 2 /* AGENT */, createAgentRequestBody(startPayload), 0 /* PIPELINE */);
8935
8569
  await this.ws.sendMsg(msg);
8936
8570
  return await waiter;
8937
8571
  }
@@ -8982,13 +8616,13 @@ var init_AgentClient = __esm({
8982
8616
  const startDataStream = async () => {
8983
8617
  const agent = await this.agentService.getAgentById(request.agentId);
8984
8618
  const hubTo = `@hub/${agent.type}`;
8985
- const startMsg = Msg.create(from, hubTo, 1002 /* AGENT_REQUEST */, {
8619
+ const startMsg = Msg.create(from, hubTo, 2 /* AGENT */, createAgentRequestBody({
8986
8620
  taskId,
8987
8621
  agentId: request.agentId,
8988
8622
  op: 0 /* Start */,
8989
8623
  type: this.defaultRequestType,
8990
8624
  ...request.params ? { payload: request.params } : {}
8991
- }, 0 /* PIPELINE */);
8625
+ }), 0 /* PIPELINE */);
8992
8626
  await ws.sendMsg(startMsg);
8993
8627
  for await (const payload of inputStream) {
8994
8628
  const dataType = payload instanceof Blob ? payload.type || this.defaultBinaryType : payload instanceof Uint8Array || payload instanceof ArrayBuffer ? this.defaultBinaryType : typeof payload === "string" ? "text" : this.defaultRequestType;
@@ -8999,15 +8633,15 @@ var init_AgentClient = __esm({
8999
8633
  type: dataType,
9000
8634
  payload
9001
8635
  };
9002
- const msg = Msg.create(from, hubTo, 1002 /* AGENT_REQUEST */, body, 0 /* PIPELINE */);
8636
+ const msg = Msg.create(from, hubTo, 2 /* AGENT */, createAgentRequestBody(body), 0 /* PIPELINE */);
9003
8637
  await ws.sendMsg(msg);
9004
8638
  }
9005
- const endMsg = Msg.create(from, hubTo, 1002 /* AGENT_REQUEST */, {
8639
+ const endMsg = Msg.create(from, hubTo, 2 /* AGENT */, createAgentRequestBody({
9006
8640
  taskId,
9007
8641
  agentId: request.agentId,
9008
8642
  op: 2 /* End */,
9009
8643
  type: this.defaultRequestType
9010
- }, 0 /* PIPELINE */);
8644
+ }), 0 /* PIPELINE */);
9011
8645
  await ws.sendMsg(endMsg);
9012
8646
  };
9013
8647
  void startDataStream();
@@ -9102,24 +8736,37 @@ var init_AgentClient = __esm({
9102
8736
  }
9103
8737
  if (event.type === "connected") {
9104
8738
  this.emit("connected" /* Connected */, event.data);
8739
+ if (!event.data) {
8740
+ this.rejectAuth(new Error("Agent websocket disconnected before auth ack"));
8741
+ }
9105
8742
  return;
9106
8743
  }
9107
8744
  if (event.type === "error") {
9108
8745
  this.emit("error" /* Error */, event.data);
8746
+ this.rejectAuth(new Error("Agent websocket error before auth ack"));
9109
8747
  }
9110
8748
  }
9111
8749
  handleIncomingMessage(message) {
9112
8750
  if (!message || typeof message !== "object") {
9113
8751
  return;
9114
8752
  }
9115
- if (message.opcode === 1001 /* AUTH_ACK */) {
9116
- const success = Boolean(message.body?.success);
9117
- this.resolveAuth(success);
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();
9118
8761
  return;
9119
8762
  }
9120
- if (message.opcode === 1003 /* AGENT_RESPONSE */) {
9121
- const body = message.body;
9122
- debugLog("[agent-client] incoming AGENT_RESPONSE", {
8763
+ if (message.opcode === 2 /* AGENT */) {
8764
+ const agentBody = message.body;
8765
+ if (agentBody?.kind !== "response") {
8766
+ return;
8767
+ }
8768
+ const body = agentBody.payload;
8769
+ debugLog("[agent-client] incoming AgentBody.response", {
9123
8770
  taskId: body?.taskId,
9124
8771
  isFinal: body?.isFinal,
9125
8772
  success: body?.success,
@@ -9127,7 +8774,7 @@ var init_AgentClient = __esm({
9127
8774
  contentEncoding: body?.contentEncoding,
9128
8775
  payloadKind: body?.payload == null ? "null" : body.payload instanceof Uint8Array ? `uint8array:${body.payload.length}` : Array.isArray(body.payload) ? `array:${body.payload.length}` : typeof body.payload
9129
8776
  });
9130
- this.tasks.handleResponse(message.body);
8777
+ this.tasks.handleResponse(body);
9131
8778
  }
9132
8779
  }
9133
8780
  ensureProtocol(value, protocol) {
@@ -9169,17 +8816,19 @@ var init_AgentClient = __esm({
9169
8816
  });
9170
8817
  });
9171
8818
  }
9172
- async sendAuth(token, timeoutMs) {
8819
+ async sendAuth(token, timeoutMs, profileId) {
9173
8820
  if (!this.ws || !this.from) {
9174
8821
  throw new Error("AgentClient not initialized");
9175
8822
  }
9176
- const msg = Msg.create(this.from, "@hub", 1e3 /* AUTH */, { token, as: "user" });
8823
+ const body = {
8824
+ token,
8825
+ as: "user",
8826
+ profileId
8827
+ };
8828
+ const msg = Msg.create(this.from, "@hub", 4 /* AUTH */, body);
9177
8829
  const waiter = this.waitForAuthAck(timeoutMs);
9178
8830
  await this.ws.sendMsg(msg);
9179
- const success = await waiter;
9180
- if (!success) {
9181
- throw new Error("Auth failed");
9182
- }
8831
+ await waiter;
9183
8832
  }
9184
8833
  waitForAuthAck(timeoutMs) {
9185
8834
  if (this.authPromise) {
@@ -9195,13 +8844,21 @@ var init_AgentClient = __esm({
9195
8844
  });
9196
8845
  return this.authPromise;
9197
8846
  }
9198
- resolveAuth(success) {
8847
+ resolveAuth() {
9199
8848
  if (!this.authResolve) {
9200
8849
  return;
9201
8850
  }
9202
8851
  const resolve = this.authResolve;
9203
8852
  this.clearAuthWaiter();
9204
- resolve(success);
8853
+ resolve();
8854
+ }
8855
+ rejectAuth(error) {
8856
+ if (!this.authReject) {
8857
+ return;
8858
+ }
8859
+ const reject = this.authReject;
8860
+ this.clearAuthWaiter();
8861
+ reject(error);
9205
8862
  }
9206
8863
  clearAuthWaiter() {
9207
8864
  if (this.authTimer) {
@@ -9216,62 +8873,62 @@ var init_AgentClient = __esm({
9216
8873
  }
9217
8874
  });
9218
8875
 
9219
- // node_modules/@pmate/agent-sdk/dist/AgentRuntime.js
8876
+ // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentRuntime.js
9220
8877
  var init_AgentRuntime = __esm({
9221
- "node_modules/@pmate/agent-sdk/dist/AgentRuntime.js"() {
8878
+ "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentRuntime.js"() {
9222
8879
  "use strict";
9223
8880
  init_src();
9224
- init_src4();
8881
+ init_src3();
9225
8882
  }
9226
8883
  });
9227
8884
 
9228
- // node_modules/@pmate/agent-sdk/dist/PromptTaskContext.js
8885
+ // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/PromptTaskContext.js
9229
8886
  var init_PromptTaskContext = __esm({
9230
- "node_modules/@pmate/agent-sdk/dist/PromptTaskContext.js"() {
8887
+ "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/PromptTaskContext.js"() {
9231
8888
  "use strict";
9232
8889
  }
9233
8890
  });
9234
8891
 
9235
- // node_modules/@pmate/agent-sdk/dist/PromptAgent.js
8892
+ // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/PromptAgent.js
9236
8893
  var init_PromptAgent = __esm({
9237
- "node_modules/@pmate/agent-sdk/dist/PromptAgent.js"() {
8894
+ "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/PromptAgent.js"() {
9238
8895
  "use strict";
9239
8896
  init_src();
9240
- init_src4();
8897
+ init_src3();
9241
8898
  init_debug();
9242
8899
  init_AgentRuntime();
9243
8900
  init_PromptTaskContext();
9244
8901
  }
9245
8902
  });
9246
8903
 
9247
- // node_modules/@pmate/agent-sdk/dist/StreamTaskContext.js
8904
+ // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/StreamTaskContext.js
9248
8905
  var init_StreamTaskContext = __esm({
9249
- "node_modules/@pmate/agent-sdk/dist/StreamTaskContext.js"() {
8906
+ "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/StreamTaskContext.js"() {
9250
8907
  "use strict";
9251
8908
  }
9252
8909
  });
9253
8910
 
9254
- // node_modules/@pmate/agent-sdk/dist/StreamAgent.js
8911
+ // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/StreamAgent.js
9255
8912
  var init_StreamAgent = __esm({
9256
- "node_modules/@pmate/agent-sdk/dist/StreamAgent.js"() {
8913
+ "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/StreamAgent.js"() {
9257
8914
  "use strict";
9258
8915
  init_src();
9259
- init_src4();
8916
+ init_src3();
9260
8917
  init_AgentRuntime();
9261
8918
  init_StreamTaskContext();
9262
8919
  }
9263
8920
  });
9264
8921
 
9265
- // node_modules/@pmate/agent-sdk/dist/AgentFactory.js
8922
+ // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentFactory.js
9266
8923
  var init_AgentFactory = __esm({
9267
- "node_modules/@pmate/agent-sdk/dist/AgentFactory.js"() {
8924
+ "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentFactory.js"() {
9268
8925
  "use strict";
9269
8926
  init_PromptAgent();
9270
8927
  init_StreamAgent();
9271
8928
  }
9272
8929
  });
9273
8930
 
9274
- // node_modules/@pmate/agent-sdk/dist/AgentService.js
8931
+ // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentService.js
9275
8932
  function parseAgentId(agentId) {
9276
8933
  const separatorIndex = agentId.indexOf(":");
9277
8934
  if (separatorIndex <= 0 || separatorIndex === agentId.length - 1) {
@@ -9301,7 +8958,7 @@ function trimTrailingSlash(value) {
9301
8958
  }
9302
8959
  var AgentService;
9303
8960
  var init_AgentService = __esm({
9304
- "node_modules/@pmate/agent-sdk/dist/AgentService.js"() {
8961
+ "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/AgentService.js"() {
9305
8962
  "use strict";
9306
8963
  AgentService = class {
9307
8964
  constructor(options) {
@@ -9342,9 +8999,9 @@ var init_AgentService = __esm({
9342
8999
  }
9343
9000
  });
9344
9001
 
9345
- // node_modules/@pmate/agent-sdk/dist/index.js
9002
+ // node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/index.js
9346
9003
  var init_dist2 = __esm({
9347
- "node_modules/@pmate/agent-sdk/dist/index.js"() {
9004
+ "node_modules/.pnpm/@pmate+agent-sdk@1.1.14/node_modules/@pmate/agent-sdk/dist/index.js"() {
9348
9005
  "use strict";
9349
9006
  init_AgentClient();
9350
9007
  init_AgentFactory();
@@ -9354,7 +9011,7 @@ var init_dist2 = __esm({
9354
9011
  init_AgentTaskManager();
9355
9012
  init_AgentService();
9356
9013
  init_debug();
9357
- init_src4();
9014
+ init_src3();
9358
9015
  }
9359
9016
  });
9360
9017
 
@@ -9503,8 +9160,8 @@ __export(index_exports, {
9503
9160
  parseCommandArgs: () => parseCommandArgs
9504
9161
  });
9505
9162
  module.exports = __toCommonJS(index_exports);
9506
- var import_node_fs23 = require("fs");
9507
- var import_node_path27 = __toESM(require("path"));
9163
+ var import_node_fs24 = require("fs");
9164
+ var import_node_path28 = __toESM(require("path"));
9508
9165
  var import_chalk4 = __toESM(require("chalk"));
9509
9166
 
9510
9167
  // src/cli.ts
@@ -14957,9 +14614,9 @@ ${indent}\`\`\``;
14957
14614
  static richTextToPlain(richText) {
14958
14615
  return richText.map((item) => item.plain_text ?? item.text?.content ?? "").join("").trim();
14959
14616
  }
14960
- static async requestJson(path28, init) {
14617
+ static async requestJson(path29, init) {
14961
14618
  const token = this.getToken();
14962
- const response = await fetch(`${this.baseUrl}${path28}`, {
14619
+ const response = await fetch(`${this.baseUrl}${path29}`, {
14963
14620
  method: init.method,
14964
14621
  headers: {
14965
14622
  Authorization: `Bearer ${token}`,
@@ -16076,6 +15733,9 @@ var QuizCommandHandler = class {
16076
15733
  };
16077
15734
 
16078
15735
  // src/commands/CollectCommandHandler.ts
15736
+ var import_node_fs13 = require("fs");
15737
+ var import_node_os7 = __toESM(require("os"));
15738
+ var import_node_path18 = __toESM(require("path"));
16079
15739
  var import_playwright = require("playwright");
16080
15740
 
16081
15741
  // src/collectStore.ts
@@ -16278,6 +15938,12 @@ var CollectCommandHandler = class {
16278
15938
  collectedAt: syncedAt
16279
15939
  }));
16280
15940
  const merged = mergeMessages(existing?.messages ?? [], incoming);
15941
+ const messagesWithArchivedImages = await archiveMessageImages(
15942
+ rootDir,
15943
+ target.sourceKey,
15944
+ threadKey,
15945
+ merged.messages
15946
+ );
16281
15947
  const stored = {
16282
15948
  source: target.sourceKey,
16283
15949
  endpoint: target.endpoint,
@@ -16287,8 +15953,8 @@ var CollectCommandHandler = class {
16287
15953
  unread: thread.unread,
16288
15954
  lastMessageAt: thread.time,
16289
15955
  lastSyncedAt: syncedAt,
16290
- messageCount: merged.messages.length,
16291
- messages: merged.messages
15956
+ messageCount: messagesWithArchivedImages.length,
15957
+ messages: messagesWithArchivedImages
16292
15958
  };
16293
15959
  await writeStoredThread(rootDir, stored);
16294
15960
  return {
@@ -16439,6 +16105,50 @@ var CollectCommandHandler = class {
16439
16105
  }
16440
16106
  }
16441
16107
  };
16108
+ async function archiveMessageImages(rootDir, sourceKey, threadKey, messages2) {
16109
+ const attachmentRoot = resolveLocalAttachmentRoot(sourceKey);
16110
+ if (!attachmentRoot) {
16111
+ return messages2;
16112
+ }
16113
+ return Promise.all(
16114
+ messages2.map(async (message) => ({
16115
+ ...message,
16116
+ images: await Promise.all(
16117
+ message.images.map(
16118
+ (imagePath) => archiveMessageImage(rootDir, attachmentRoot, threadKey, imagePath)
16119
+ )
16120
+ )
16121
+ }))
16122
+ );
16123
+ }
16124
+ async function archiveMessageImage(rootDir, attachmentRoot, threadKey, imagePath) {
16125
+ if (!imagePath || isExternalImageRef(imagePath) || imagePath.startsWith("attachments/")) {
16126
+ return imagePath;
16127
+ }
16128
+ const normalized = import_node_path18.default.posix.normalize(imagePath.replace(/\\/g, "/"));
16129
+ if (normalized.startsWith("../") || import_node_path18.default.posix.isAbsolute(normalized)) {
16130
+ return imagePath;
16131
+ }
16132
+ const sourcePath = import_node_path18.default.join(attachmentRoot, ...normalized.split("/"));
16133
+ const destinationRelativePath = import_node_path18.default.posix.join("attachments", threadKey, normalized);
16134
+ const destinationPath = import_node_path18.default.join(rootDir, ...destinationRelativePath.split("/"));
16135
+ try {
16136
+ await import_node_fs13.promises.mkdir(import_node_path18.default.dirname(destinationPath), { recursive: true });
16137
+ await import_node_fs13.promises.copyFile(sourcePath, destinationPath);
16138
+ return destinationRelativePath;
16139
+ } catch {
16140
+ return imagePath;
16141
+ }
16142
+ }
16143
+ function resolveLocalAttachmentRoot(sourceKey) {
16144
+ if (sourceKey !== "cc" && sourceKey !== "yelling") {
16145
+ return null;
16146
+ }
16147
+ return import_node_path18.default.join(import_node_os7.default.homedir(), "Library", "Application Support", sourceKey, "attachments.noindex");
16148
+ }
16149
+ function isExternalImageRef(imagePath) {
16150
+ return /^[a-z][a-z0-9+.-]*:/i.test(imagePath);
16151
+ }
16442
16152
  function normalizeText(value) {
16443
16153
  return value.replace(/\s+/g, " ").replace(/\u200B/g, "").trim();
16444
16154
  }
@@ -16663,7 +16373,7 @@ function pad2(value) {
16663
16373
  }
16664
16374
 
16665
16375
  // src/commands/ChatRoomCommandHandler.ts
16666
- var import_node_fs13 = require("fs");
16376
+ var import_node_fs14 = require("fs");
16667
16377
  var ChatRoomCommandHandler = class {
16668
16378
  async handle(args) {
16669
16379
  const sdk = await loadChatSdk();
@@ -16713,8 +16423,8 @@ var ChatRoomCommandHandler = class {
16713
16423
  const a = await this.connect(sdk, args.botA, args.app, args.hubUrl, args.authBaseUrl);
16714
16424
  const b = await this.connect(sdk, args.botB, args.app, args.hubUrl, args.authBaseUrl);
16715
16425
  try {
16716
- const botA = sdk.parsePmateBotKeyJson((0, import_node_fs13.readFileSync)(args.botA, "utf8"));
16717
- const botB = sdk.parsePmateBotKeyJson((0, import_node_fs13.readFileSync)(args.botB, "utf8"));
16426
+ const botA = sdk.parsePmateBotKeyJson((0, import_node_fs14.readFileSync)(args.botA, "utf8"));
16427
+ const botB = sdk.parsePmateBotKeyJson((0, import_node_fs14.readFileSync)(args.botB, "utf8"));
16718
16428
  await a.requestFriend({ to: botB.name, message: "smoke friend request" });
16719
16429
  await b.acceptFriend({ to: botA.name, message: "smoke friend accept" });
16720
16430
  await a.sendDm({ to: botB.name, text: "smoke dm from a" });
@@ -16733,7 +16443,7 @@ var ChatRoomCommandHandler = class {
16733
16443
  if (!botPath) {
16734
16444
  throw new Error("Missing required option: --bot");
16735
16445
  }
16736
- const botKey = sdk.parsePmateBotKeyJson((0, import_node_fs13.readFileSync)(botPath, "utf8"));
16446
+ const botKey = sdk.parsePmateBotKeyJson((0, import_node_fs14.readFileSync)(botPath, "utf8"));
16737
16447
  const client = sdk.createChatClient({ appId, botKey, hubUrl, authBaseUrl });
16738
16448
  await client.connect();
16739
16449
  return client;
@@ -16745,8 +16455,8 @@ async function loadChatSdk() {
16745
16455
  }
16746
16456
 
16747
16457
  // src/commands/AgentCommandHandler.ts
16748
- var import_node_fs14 = require("fs");
16749
- var import_node_path18 = __toESM(require("path"));
16458
+ var import_node_fs15 = require("fs");
16459
+ var import_node_path19 = __toESM(require("path"));
16750
16460
  init_AgentLlmClient();
16751
16461
  init_sessionStore();
16752
16462
 
@@ -16779,8 +16489,8 @@ function descriptorPathSegments(descriptor) {
16779
16489
  return ["chains", normalized.chain, "namespaces", normalized.ns, normalized.kind, normalized.name];
16780
16490
  }
16781
16491
  function buildPathUrl(baseUrl, pathSegments, query) {
16782
- const path28 = `/${pathSegments.map((segment) => encodeURIComponent(segment)).join("/")}`;
16783
- const url = new URL(path28, baseUrl);
16492
+ const path29 = `/${pathSegments.map((segment) => encodeURIComponent(segment)).join("/")}`;
16493
+ const url = new URL(path29, baseUrl);
16784
16494
  if (query) {
16785
16495
  for (const [key, value] of Object.entries(query)) {
16786
16496
  url.searchParams.set(key, String(value));
@@ -17237,11 +16947,11 @@ var AgentCommandHandler = class {
17237
16947
  }).token;
17238
16948
  }
17239
16949
  readJsonFile(filePath) {
17240
- const absolutePath = import_node_path18.default.resolve(process.cwd(), filePath);
17241
- if (!(0, import_node_fs14.existsSync)(absolutePath)) {
16950
+ const absolutePath = import_node_path19.default.resolve(process.cwd(), filePath);
16951
+ if (!(0, import_node_fs15.existsSync)(absolutePath)) {
17242
16952
  throw new Error(`JSON file not found: ${absolutePath}`);
17243
16953
  }
17244
- const raw = (0, import_node_fs14.readFileSync)(absolutePath, "utf8");
16954
+ const raw = (0, import_node_fs15.readFileSync)(absolutePath, "utf8");
17245
16955
  try {
17246
16956
  return JSON.parse(raw);
17247
16957
  } catch (error) {
@@ -17252,14 +16962,14 @@ var AgentCommandHandler = class {
17252
16962
  readJsonObjectFile(filePath) {
17253
16963
  const parsed = this.readJsonFile(filePath);
17254
16964
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
17255
- const absolutePath = import_node_path18.default.resolve(process.cwd(), filePath);
16965
+ const absolutePath = import_node_path19.default.resolve(process.cwd(), filePath);
17256
16966
  throw new Error(`Invalid JSON in ${absolutePath}: expected an object`);
17257
16967
  }
17258
16968
  return parsed;
17259
16969
  }
17260
16970
  tryReadJsonObjectFile(filePath) {
17261
16971
  const absolutePath = this.resolveExistingFile(filePath);
17262
- const raw = (0, import_node_fs14.readFileSync)(absolutePath, "utf8");
16972
+ const raw = (0, import_node_fs15.readFileSync)(absolutePath, "utf8");
17263
16973
  try {
17264
16974
  const parsed = JSON.parse(raw);
17265
16975
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
@@ -17271,8 +16981,8 @@ var AgentCommandHandler = class {
17271
16981
  }
17272
16982
  }
17273
16983
  resolveExistingFile(filePath) {
17274
- const absolutePath = import_node_path18.default.resolve(process.cwd(), filePath);
17275
- if (!(0, import_node_fs14.existsSync)(absolutePath)) {
16984
+ const absolutePath = import_node_path19.default.resolve(process.cwd(), filePath);
16985
+ if (!(0, import_node_fs15.existsSync)(absolutePath)) {
17276
16986
  throw new Error(`File not found: ${absolutePath}`);
17277
16987
  }
17278
16988
  return absolutePath;
@@ -17356,8 +17066,8 @@ var AgentCommandHandler = class {
17356
17066
  };
17357
17067
 
17358
17068
  // src/commands/RunnerCommandHandler.ts
17359
- var import_node_fs15 = require("fs");
17360
- var import_node_path19 = __toESM(require("path"));
17069
+ var import_node_fs16 = require("fs");
17070
+ var import_node_path20 = __toESM(require("path"));
17361
17071
  init_sessionStore();
17362
17072
  init_namespacedRef();
17363
17073
  var RunnerCommandHandler = class {
@@ -17452,11 +17162,11 @@ var RunnerCommandHandler = class {
17452
17162
  }).token;
17453
17163
  }
17454
17164
  readJsonFile(filePath) {
17455
- const absolutePath = import_node_path19.default.resolve(process.cwd(), filePath);
17456
- if (!(0, import_node_fs15.existsSync)(absolutePath)) {
17165
+ const absolutePath = import_node_path20.default.resolve(process.cwd(), filePath);
17166
+ if (!(0, import_node_fs16.existsSync)(absolutePath)) {
17457
17167
  throw new Error(`JSON file not found: ${absolutePath}`);
17458
17168
  }
17459
- const raw = (0, import_node_fs15.readFileSync)(absolutePath, "utf8");
17169
+ const raw = (0, import_node_fs16.readFileSync)(absolutePath, "utf8");
17460
17170
  try {
17461
17171
  return JSON.parse(raw);
17462
17172
  } catch (error) {
@@ -17575,8 +17285,8 @@ var NsCommandHandler = class {
17575
17285
  };
17576
17286
 
17577
17287
  // src/commands/StoreCommandHandler.ts
17578
- var import_node_fs16 = require("fs");
17579
- var import_node_path20 = __toESM(require("path"));
17288
+ var import_node_fs17 = require("fs");
17289
+ var import_node_path21 = __toESM(require("path"));
17580
17290
  var StoreCommandHandler = class {
17581
17291
  async handle(args) {
17582
17292
  if (args.scope === "namespace") {
@@ -17718,11 +17428,11 @@ var StoreCommandHandler = class {
17718
17428
  return payload.data ?? [];
17719
17429
  }
17720
17430
  readJsonFile(filePath) {
17721
- const absolutePath = import_node_path20.default.resolve(process.cwd(), filePath);
17722
- if (!(0, import_node_fs16.existsSync)(absolutePath)) {
17431
+ const absolutePath = import_node_path21.default.resolve(process.cwd(), filePath);
17432
+ if (!(0, import_node_fs17.existsSync)(absolutePath)) {
17723
17433
  throw new Error(`JSON file not found: ${absolutePath}`);
17724
17434
  }
17725
- const raw = (0, import_node_fs16.readFileSync)(absolutePath, "utf8");
17435
+ const raw = (0, import_node_fs17.readFileSync)(absolutePath, "utf8");
17726
17436
  try {
17727
17437
  return JSON.parse(raw);
17728
17438
  } catch (error) {
@@ -17774,14 +17484,14 @@ var StoreCommandHandler = class {
17774
17484
  };
17775
17485
 
17776
17486
  // src/commands/AppCommandHandler.ts
17777
- var import_node_fs18 = require("fs");
17778
- var import_node_path22 = __toESM(require("path"));
17487
+ var import_node_fs19 = require("fs");
17488
+ var import_node_path23 = __toESM(require("path"));
17779
17489
  init_sessionStore();
17780
17490
 
17781
17491
  // src/appIcon.ts
17782
- var import_node_fs17 = require("fs");
17783
- var import_node_os7 = __toESM(require("os"));
17784
- var import_node_path21 = __toESM(require("path"));
17492
+ var import_node_fs18 = require("fs");
17493
+ var import_node_os8 = __toESM(require("os"));
17494
+ var import_node_path22 = __toESM(require("path"));
17785
17495
  var import_sharp = __toESM(require("sharp"));
17786
17496
  init_namespacedRef();
17787
17497
  var ANDROID_ICON_SPECS = [
@@ -17886,13 +17596,13 @@ function createAppIconExportPlans(input) {
17886
17596
  if (!input.outDir) {
17887
17597
  throw new Error("App icon preset export requires --out-dir.");
17888
17598
  }
17889
- const outDir = import_node_path21.default.resolve(input.cwd, input.outDir);
17890
- (0, import_node_fs17.mkdirSync)(outDir, { recursive: true });
17599
+ const outDir = import_node_path22.default.resolve(input.cwd, input.outDir);
17600
+ (0, import_node_fs18.mkdirSync)(outDir, { recursive: true });
17891
17601
  return specs.map((spec) => ({
17892
17602
  width: spec.width,
17893
17603
  height: spec.height,
17894
17604
  format: "png",
17895
- outputPath: import_node_path21.default.join(
17605
+ outputPath: import_node_path22.default.join(
17896
17606
  outDir,
17897
17607
  `${namespace}-${objectId}-${spec.name}-${spec.width}x${spec.height}.png`
17898
17608
  )
@@ -17905,8 +17615,8 @@ function createAppIconExportPlans(input) {
17905
17615
  if (!input.output) {
17906
17616
  throw new Error("Single-size app icon export requires --output.");
17907
17617
  }
17908
- const resolvedOutput = import_node_path21.default.resolve(input.cwd, input.output);
17909
- (0, import_node_fs17.mkdirSync)(import_node_path21.default.dirname(resolvedOutput), { recursive: true });
17618
+ const resolvedOutput = import_node_path22.default.resolve(input.cwd, input.output);
17619
+ (0, import_node_fs18.mkdirSync)(import_node_path22.default.dirname(resolvedOutput), { recursive: true });
17910
17620
  return [
17911
17621
  {
17912
17622
  width: input.width,
@@ -17920,7 +17630,7 @@ async function exportAppIcon(icon, plans) {
17920
17630
  const svg = await resolveAppIconSvg(icon);
17921
17631
  for (const plan of plans) {
17922
17632
  const bytes = await renderAppIcon(svg, plan.width, plan.height, plan.format);
17923
- (0, import_node_fs17.writeFileSync)(plan.outputPath, bytes);
17633
+ (0, import_node_fs18.writeFileSync)(plan.outputPath, bytes);
17924
17634
  }
17925
17635
  }
17926
17636
  async function renderAppIconVariant(input) {
@@ -17928,9 +17638,9 @@ async function renderAppIconVariant(input) {
17928
17638
  const bytes = await renderAppIcon(svg, input.width, input.height, input.format);
17929
17639
  let outputPath;
17930
17640
  if (input.output) {
17931
- outputPath = import_node_path21.default.resolve(input.cwd, input.output);
17932
- (0, import_node_fs17.mkdirSync)(import_node_path21.default.dirname(outputPath), { recursive: true });
17933
- (0, import_node_fs17.writeFileSync)(outputPath, bytes);
17641
+ outputPath = import_node_path22.default.resolve(input.cwd, input.output);
17642
+ (0, import_node_fs18.mkdirSync)(import_node_path22.default.dirname(outputPath), { recursive: true });
17643
+ (0, import_node_fs18.writeFileSync)(outputPath, bytes);
17934
17644
  }
17935
17645
  if (input.name) {
17936
17646
  return {
@@ -17951,7 +17661,7 @@ async function renderAppIconVariant(input) {
17951
17661
  };
17952
17662
  }
17953
17663
  async function loadAppIconVariantFile(input) {
17954
- const absolutePath = import_node_path21.default.resolve(input.cwd, input.filePath);
17664
+ const absolutePath = import_node_path22.default.resolve(input.cwd, input.filePath);
17955
17665
  const format = inferVariantFormatFromPath(absolutePath);
17956
17666
  return {
17957
17667
  value: input.name ? await uploadAppIconVariantAsset({
@@ -17960,7 +17670,7 @@ async function loadAppIconVariantFile(input) {
17960
17670
  name: input.name,
17961
17671
  format,
17962
17672
  sourcePath: absolutePath
17963
- }) : createImageDataUrl((0, import_node_fs17.readFileSync)(absolutePath), format),
17673
+ }) : createImageDataUrl((0, import_node_fs18.readFileSync)(absolutePath), format),
17964
17674
  format,
17965
17675
  absolutePath
17966
17676
  };
@@ -18019,7 +17729,7 @@ function shouldAutoGenerateDefaultVariant(icon) {
18019
17729
  return looksLikeSvgMarkup(icon) || looksLikeSvgUrl(icon);
18020
17730
  }
18021
17731
  function inferVariantFormatFromPath(filePath) {
18022
- const ext = import_node_path21.default.extname(filePath).toLowerCase();
17732
+ const ext = import_node_path22.default.extname(filePath).toLowerCase();
18023
17733
  switch (ext) {
18024
17734
  case ".png":
18025
17735
  return "png";
@@ -18090,13 +17800,13 @@ async function uploadAppIconVariantAsset(input) {
18090
17800
  await AliyunService.uploadFile(sourcePath, DEFAULT_APP_ICON_VARIANT_BUCKET, objectKey);
18091
17801
  } finally {
18092
17802
  if (shouldCleanup) {
18093
- (0, import_node_fs17.rmSync)(import_node_path21.default.dirname(sourcePath), { recursive: true, force: true });
17803
+ (0, import_node_fs18.rmSync)(import_node_path22.default.dirname(sourcePath), { recursive: true, force: true });
18094
17804
  }
18095
17805
  }
18096
17806
  return `${DEFAULT_APP_ICON_VARIANT_PUBLIC_BASE_URL}/${objectKey}`;
18097
17807
  }
18098
17808
  function buildAppIconVariantObjectKey(input) {
18099
- return import_node_path21.default.posix.join(
17809
+ return import_node_path22.default.posix.join(
18100
17810
  "apps",
18101
17811
  `${resolveAppIconAssetStem(input.icon, input.appRef)}-${input.name}.${extensionForIconFormat(input.format)}`
18102
17812
  );
@@ -18105,8 +17815,8 @@ function resolveAppIconAssetStem(icon, appRef) {
18105
17815
  if (icon) {
18106
17816
  try {
18107
17817
  const url = new URL(icon);
18108
- const ext = import_node_path21.default.posix.extname(url.pathname);
18109
- const basename = import_node_path21.default.posix.basename(url.pathname, ext);
17818
+ const ext = import_node_path22.default.posix.extname(url.pathname);
17819
+ const basename = import_node_path22.default.posix.basename(url.pathname, ext);
18110
17820
  const normalized = sanitizeAppIconAssetStem(basename);
18111
17821
  if (normalized) {
18112
17822
  return normalized;
@@ -18135,9 +17845,9 @@ function writeTempAppIconVariantFile(objectKey, format, bytes) {
18135
17845
  if (!bytes) {
18136
17846
  throw new Error("App icon variant upload requires bytes or a source file.");
18137
17847
  }
18138
- const tempDir = (0, import_node_fs17.mkdtempSync)(import_node_path21.default.join(import_node_os7.default.tmpdir(), "pmate-app-icon-"));
18139
- const tempPath = import_node_path21.default.join(tempDir, import_node_path21.default.basename(objectKey) || `variant.${extensionForIconFormat(format)}`);
18140
- (0, import_node_fs17.writeFileSync)(tempPath, bytes);
17848
+ const tempDir = (0, import_node_fs18.mkdtempSync)(import_node_path22.default.join(import_node_os8.default.tmpdir(), "pmate-app-icon-"));
17849
+ const tempPath = import_node_path22.default.join(tempDir, import_node_path22.default.basename(objectKey) || `variant.${extensionForIconFormat(format)}`);
17850
+ (0, import_node_fs18.writeFileSync)(tempPath, bytes);
18141
17851
  return tempPath;
18142
17852
  }
18143
17853
 
@@ -18346,10 +18056,10 @@ var AppCommandHandler = class {
18346
18056
  }
18347
18057
  readJsonFile(filePath) {
18348
18058
  const absolutePath = this.resolveFilePath(filePath);
18349
- if (!(0, import_node_fs18.existsSync)(absolutePath)) {
18059
+ if (!(0, import_node_fs19.existsSync)(absolutePath)) {
18350
18060
  throw new Error(`JSON file not found: ${absolutePath}`);
18351
18061
  }
18352
- const raw = (0, import_node_fs18.readFileSync)(absolutePath, "utf8");
18062
+ const raw = (0, import_node_fs19.readFileSync)(absolutePath, "utf8");
18353
18063
  try {
18354
18064
  return JSON.parse(raw);
18355
18065
  } catch (error) {
@@ -18359,10 +18069,10 @@ var AppCommandHandler = class {
18359
18069
  }
18360
18070
  async preparePayload(filePath, appRef) {
18361
18071
  const absolutePath = this.resolveFilePath(filePath);
18362
- return prepareAppPayload(this.readJsonFile(filePath), import_node_path22.default.dirname(absolutePath), { appRef });
18072
+ return prepareAppPayload(this.readJsonFile(filePath), import_node_path23.default.dirname(absolutePath), { appRef });
18363
18073
  }
18364
18074
  resolveFilePath(filePath) {
18365
- return import_node_path22.default.resolve(process.cwd(), filePath);
18075
+ return import_node_path23.default.resolve(process.cwd(), filePath);
18366
18076
  }
18367
18077
  async request(baseUrl, token, method, pathname, body) {
18368
18078
  const response = await fetch(`${baseUrl}${pathname}`, {
@@ -18482,16 +18192,16 @@ function readNamespaceFromPayload(payload) {
18482
18192
  }
18483
18193
 
18484
18194
  // src/commands/ServiceCommandHandler.ts
18485
- var import_node_fs20 = require("fs");
18195
+ var import_node_fs21 = require("fs");
18486
18196
  var import_promises6 = require("fs/promises");
18487
- var import_node_path24 = __toESM(require("path"));
18197
+ var import_node_path25 = __toESM(require("path"));
18488
18198
  var import_node_child_process11 = require("child_process");
18489
18199
  var import_promises7 = require("readline/promises");
18490
18200
 
18491
18201
  // src/services/ServiceRuntimeRunner.ts
18492
- var import_node_fs19 = require("fs");
18493
- var import_node_os8 = __toESM(require("os"));
18494
- var import_node_path23 = __toESM(require("path"));
18202
+ var import_node_fs20 = require("fs");
18203
+ var import_node_os9 = __toESM(require("os"));
18204
+ var import_node_path24 = __toESM(require("path"));
18495
18205
  var import_node_child_process10 = require("child_process");
18496
18206
  var import_node_readline = require("readline");
18497
18207
  var import_chalk3 = __toESM(require("chalk"));
@@ -18577,7 +18287,10 @@ var ServiceRegistryClient = class {
18577
18287
  {
18578
18288
  stage: options.stage,
18579
18289
  ...options.branch ? { branch: options.branch } : {},
18580
- ...options.includeSecretValue ? { includeSecretValue: true } : {}
18290
+ ...options.includeSecretValue ? { includeSecretValue: true } : {},
18291
+ ...options.includeHost === false ? { includeHost: false } : {},
18292
+ ...options.hostId ? { hostId: options.hostId } : {},
18293
+ ...options.hostTarget ? { hostTarget: options.hostTarget } : {}
18581
18294
  }
18582
18295
  );
18583
18296
  }
@@ -18617,6 +18330,9 @@ var ServiceRegistryClient = class {
18617
18330
  body: JSON.stringify({
18618
18331
  stage: options.stage,
18619
18332
  ...options.branch ? { branch: options.branch } : {},
18333
+ ...options.includeHost === false ? { includeHost: false } : {},
18334
+ ...options.hostId ? { hostId: options.hostId } : {},
18335
+ ...options.hostTarget ? { hostTarget: options.hostTarget } : {},
18620
18336
  format: options.format
18621
18337
  })
18622
18338
  });
@@ -18931,18 +18647,18 @@ var ServiceRuntimeRunner = class {
18931
18647
  }
18932
18648
  resolveRepoRoot(service, cwd) {
18933
18649
  if (cwd) {
18934
- return import_node_path23.default.resolve(process.cwd(), cwd);
18650
+ return import_node_path24.default.resolve(process.cwd(), cwd);
18935
18651
  }
18936
18652
  const repository = this.getType(service) === "vite" || this.getType(service) === "static" ? this.getSite(service).repository?.trim() : this.getType(service) === "fc" ? this.getFc(service).repository?.trim() : this.getType(service) === "ios" || this.getType(service) === "android" ? void 0 : this.getNetwork(service).repository?.trim();
18937
18653
  if (repository) {
18938
18654
  const repoName = repository.replace(/\/+$/, "").split("/").pop()?.replace(/\.git$/i, "");
18939
18655
  if (repoName) {
18940
18656
  const candidates = [
18941
- import_node_path23.default.join(import_node_os8.default.homedir(), "dev", "pmate", repoName),
18942
- import_node_path23.default.join(import_node_os8.default.homedir(), "dev", "pmate-envs", repoName)
18657
+ import_node_path24.default.join(import_node_os9.default.homedir(), "dev", "pmate", repoName),
18658
+ import_node_path24.default.join(import_node_os9.default.homedir(), "dev", "pmate-envs", repoName)
18943
18659
  ];
18944
18660
  for (const candidate of candidates) {
18945
- if ((0, import_node_fs19.existsSync)(candidate)) {
18661
+ if ((0, import_node_fs20.existsSync)(candidate)) {
18946
18662
  return candidate;
18947
18663
  }
18948
18664
  }
@@ -18956,12 +18672,12 @@ var ServiceRuntimeRunner = class {
18956
18672
  if (!dir) {
18957
18673
  throw new Error(`Missing service dir for ${service.id}`);
18958
18674
  }
18959
- return import_node_path23.default.resolve(repoRoot, dir);
18675
+ return import_node_path24.default.resolve(repoRoot, dir);
18960
18676
  }
18961
18677
  async deployVite(service, options) {
18962
18678
  const appDir = this.resolveLocalDir(service, options.cwd);
18963
- const packageJsonPath = import_node_path23.default.join(appDir, "package.json");
18964
- if (!(0, import_node_fs19.existsSync)(packageJsonPath)) {
18679
+ const packageJsonPath = import_node_path24.default.join(appDir, "package.json");
18680
+ if (!(0, import_node_fs20.existsSync)(packageJsonPath)) {
18965
18681
  throw new Error(`No package.json found at ${packageJsonPath}`);
18966
18682
  }
18967
18683
  const pkg2 = this.loadPackageJson(packageJsonPath);
@@ -18970,8 +18686,8 @@ var ServiceRuntimeRunner = class {
18970
18686
  throw new Error(`Missing package name in ${packageJsonPath}`);
18971
18687
  }
18972
18688
  await this.runCommand("pnpm", ["--filter", pkgName, "build"], this.resolveRepoRoot(service, options.cwd));
18973
- const distDir = import_node_path23.default.join(appDir, "dist");
18974
- if (!(0, import_node_fs19.existsSync)(distDir)) {
18689
+ const distDir = import_node_path24.default.join(appDir, "dist");
18690
+ if (!(0, import_node_fs20.existsSync)(distDir)) {
18975
18691
  throw new Error(`No dist directory found at ${distDir}`);
18976
18692
  }
18977
18693
  const site = this.getSite(service);
@@ -18983,8 +18699,8 @@ var ServiceRuntimeRunner = class {
18983
18699
  }
18984
18700
  async deployStatic(service, options) {
18985
18701
  const appDir = this.resolveLocalDir(service, options.cwd);
18986
- const srcDir = import_node_path23.default.join(appDir, "src");
18987
- if (!(0, import_node_fs19.existsSync)(srcDir)) {
18702
+ const srcDir = import_node_path24.default.join(appDir, "src");
18703
+ if (!(0, import_node_fs20.existsSync)(srcDir)) {
18988
18704
  throw new Error(`No src directory found at ${srcDir}`);
18989
18705
  }
18990
18706
  const site = this.getSite(service);
@@ -18999,8 +18715,8 @@ var ServiceRuntimeRunner = class {
18999
18715
  this.validateFcConfig(service, fc);
19000
18716
  const repoRoot = this.resolveRepoRoot(service);
19001
18717
  const appDir = this.resolveLocalDir(service);
19002
- const packageJsonPath = import_node_path23.default.join(appDir, "package.json");
19003
- if (!(0, import_node_fs19.existsSync)(packageJsonPath)) {
18718
+ const packageJsonPath = import_node_path24.default.join(appDir, "package.json");
18719
+ if (!(0, import_node_fs20.existsSync)(packageJsonPath)) {
19004
18720
  throw new Error(`No package.json found at ${packageJsonPath}`);
19005
18721
  }
19006
18722
  const pkg2 = this.loadPackageJson(packageJsonPath);
@@ -19053,15 +18769,15 @@ var ServiceRuntimeRunner = class {
19053
18769
  const repoRoot = this.resolveRepoRoot(service, options.cwd);
19054
18770
  const appDir = this.resolveLocalDir(service, options.cwd);
19055
18771
  await this.ensurePnpmWorkspaceRoot(repoRoot);
19056
- const configPath = import_node_path23.default.join(appDir, fc.configFile ?? "s.yaml");
19057
- if (!(0, import_node_fs19.existsSync)(configPath)) {
18772
+ const configPath = import_node_path24.default.join(appDir, fc.configFile ?? "s.yaml");
18773
+ if (!(0, import_node_fs20.existsSync)(configPath)) {
19058
18774
  throw new Error(`Missing FC config file at ${configPath}`);
19059
18775
  }
19060
- const packageJsonPath = import_node_path23.default.join(appDir, "package.json");
19061
- if (!(0, import_node_fs19.existsSync)(packageJsonPath)) {
18776
+ const packageJsonPath = import_node_path24.default.join(appDir, "package.json");
18777
+ if (!(0, import_node_fs20.existsSync)(packageJsonPath)) {
19062
18778
  throw new Error(`No package.json found at ${packageJsonPath}`);
19063
18779
  }
19064
- const rawConfig = (0, import_node_fs19.readFileSync)(configPath, "utf8");
18780
+ const rawConfig = (0, import_node_fs20.readFileSync)(configPath, "utf8");
19065
18781
  if (!rawConfig.includes(fc.functionName)) {
19066
18782
  throw new Error(`FC config ${configPath} does not mention functionName ${fc.functionName}`);
19067
18783
  }
@@ -19137,7 +18853,7 @@ var ServiceRuntimeRunner = class {
19137
18853
  `pkg="${appDir}/package.json"`,
19138
18854
  `if [ -f "$pkg" ] && node -e 'const fs=require("node:fs"); const p=JSON.parse(fs.readFileSync(process.argv[1],"utf8")); process.exit(p?.scripts?.build ? 0 : 1);' "$pkg"; then (cd "${appDir}" && pnpm run build); fi`
19139
18855
  ].join("; ");
19140
- const envSyncCommand = await this.buildNodeEnvSyncCommand(service.id, appDir, options.envName);
18856
+ const envSyncCommand = await this.buildNodeEnvSyncCommand(service.id, appDir, options.envName, server);
19141
18857
  const command = [
19142
18858
  `cd "$HOME"`,
19143
18859
  `[ -d "${repoDir}/.git" ] || git clone "${gitUrl}" "${repoDir}"`,
@@ -19155,13 +18871,17 @@ var ServiceRuntimeRunner = class {
19155
18871
  ].join(" && ");
19156
18872
  await this.runRemoteCommand(server, command);
19157
18873
  }
19158
- async buildNodeEnvSyncCommand(serviceId, appDir, envName = "prod") {
18874
+ async buildNodeEnvSyncCommand(serviceId, appDir, envName = "prod", hostTarget) {
19159
18875
  if (!this.envProvider) {
19160
18876
  return void 0;
19161
18877
  }
19162
18878
  let pulled;
19163
18879
  try {
19164
- pulled = await this.envProvider(serviceId, { stage: this.envNameToStage(envName), format: "dotenv" });
18880
+ pulled = await this.envProvider(serviceId, {
18881
+ stage: this.envNameToStage(envName),
18882
+ format: "dotenv",
18883
+ ...hostTarget ? { hostTarget } : {}
18884
+ });
19165
18885
  } catch (error) {
19166
18886
  if (error instanceof ServiceEnvNotFoundError) {
19167
18887
  ui.warn(`No env found for ${serviceId}; skipping .env.local sync.`);
@@ -19202,7 +18922,7 @@ var ServiceRuntimeRunner = class {
19202
18922
  const gitUrl = this.withToken(repoUrl);
19203
18923
  const scriptPath = script.startsWith("/") || script.startsWith("./") ? script : `./${script}`;
19204
18924
  const envName = options.envName ?? "prod";
19205
- const envSyncCommand = await this.buildScriptEnvSyncCommand(service.id, envName);
18925
+ const envSyncCommand = await this.buildScriptEnvSyncCommand(service.id, envName, server);
19206
18926
  const command = [
19207
18927
  `cd "$HOME"`,
19208
18928
  `[ -d "${repoDir}/.git" ] || git clone "${gitUrl}" "${repoDir}"`,
@@ -19234,7 +18954,7 @@ var ServiceRuntimeRunner = class {
19234
18954
  const repoDir = this.getRepoDirName(repository);
19235
18955
  const scriptPath = script.startsWith("/") || script.startsWith("./") ? script : `./${script}`;
19236
18956
  const envName = options.envName ?? "prod";
19237
- const envSyncCommand = await this.buildScriptEnvSyncCommand(service.id, envName);
18957
+ const envSyncCommand = await this.buildScriptEnvSyncCommand(service.id, envName, server);
19238
18958
  const command = [
19239
18959
  `cd "$HOME"`,
19240
18960
  `cd "${repoDir}"`,
@@ -19245,13 +18965,17 @@ var ServiceRuntimeRunner = class {
19245
18965
  ].join(" && ");
19246
18966
  await this.runRemoteCommand(server, command);
19247
18967
  }
19248
- async buildScriptEnvSyncCommand(serviceId, envName) {
18968
+ async buildScriptEnvSyncCommand(serviceId, envName, hostTarget) {
19249
18969
  if (!this.envProvider) {
19250
18970
  return void 0;
19251
18971
  }
19252
18972
  let pulled;
19253
18973
  try {
19254
- pulled = await this.envProvider(serviceId, { stage: this.envNameToStage(envName), format: "dotenv" });
18974
+ pulled = await this.envProvider(serviceId, {
18975
+ stage: this.envNameToStage(envName),
18976
+ format: "dotenv",
18977
+ ...hostTarget ? { hostTarget } : {}
18978
+ });
19255
18979
  } catch (error) {
19256
18980
  if (error instanceof ServiceEnvNotFoundError) {
19257
18981
  ui.warn(`No env found for ${serviceId}; skipping PMate env file sync.`);
@@ -19314,7 +19038,7 @@ var ServiceRuntimeRunner = class {
19314
19038
  const serverAddress = await resolveServerAddress(server);
19315
19039
  const templateName = exposeType === "websocket" ? "nginx.ws.template" : "nginx.rest.template";
19316
19040
  const templatePath = this.resolveTemplatePath(templateName);
19317
- const template = (0, import_node_fs19.readFileSync)(templatePath, "utf8");
19041
+ const template = (0, import_node_fs20.readFileSync)(templatePath, "utf8");
19318
19042
  const host = `${subdomain}.${("domain" in network ? network.domain?.trim() : void 0) || "pmate.chat"}`;
19319
19043
  const rendered = template.replace(/\$\{\{PORT\}\}/g, String(port)).replace(/\$\{\{HOSTS\}\}/g, host).replace(/\$\{\{HOST\}\}/g, host);
19320
19044
  const remotePath = `/etc/nginx/sites-enabled/${subdomain}.conf`;
@@ -19346,11 +19070,11 @@ var ServiceRuntimeRunner = class {
19346
19070
  }
19347
19071
  if (config.ensurePackageJson) {
19348
19072
  const appDir = this.resolveLocalDir(service, options.cwd);
19349
- const packageJsonPath = import_node_path23.default.join(appDir, "package.json");
19350
- if (!(0, import_node_fs19.existsSync)(packageJsonPath)) {
19073
+ const packageJsonPath = import_node_path24.default.join(appDir, "package.json");
19074
+ if (!(0, import_node_fs20.existsSync)(packageJsonPath)) {
19351
19075
  throw new Error(`Missing package.json at ${packageJsonPath}`);
19352
19076
  }
19353
- const pkgStat = (0, import_node_fs19.statSync)(packageJsonPath);
19077
+ const pkgStat = (0, import_node_fs20.statSync)(packageJsonPath);
19354
19078
  if (!pkgStat.isFile()) {
19355
19079
  throw new Error(`package.json is not a file at ${packageJsonPath}`);
19356
19080
  }
@@ -19780,9 +19504,9 @@ var ServiceRuntimeRunner = class {
19780
19504
  return tokens;
19781
19505
  }
19782
19506
  readPathValue(source, pathExpr) {
19783
- const path28 = pathExpr.split(".").map((segment) => segment.trim()).filter(Boolean);
19507
+ const path29 = pathExpr.split(".").map((segment) => segment.trim()).filter(Boolean);
19784
19508
  let cursor = source;
19785
- for (const segment of path28) {
19509
+ for (const segment of path29) {
19786
19510
  if (!cursor || typeof cursor !== "object" || Array.isArray(cursor)) {
19787
19511
  return void 0;
19788
19512
  }
@@ -19825,12 +19549,12 @@ var ServiceRuntimeRunner = class {
19825
19549
  }
19826
19550
  resolveTemplatePath(templateName) {
19827
19551
  const candidates = [
19828
- import_node_path23.default.join(__dirname, "..", "templates", templateName),
19829
- import_node_path23.default.join(__dirname, "..", "src", "templates", templateName),
19830
- import_node_path23.default.join(__dirname, "templates", templateName)
19552
+ import_node_path24.default.join(__dirname, "..", "templates", templateName),
19553
+ import_node_path24.default.join(__dirname, "..", "src", "templates", templateName),
19554
+ import_node_path24.default.join(__dirname, "templates", templateName)
19831
19555
  ];
19832
19556
  for (const candidate of candidates) {
19833
- if ((0, import_node_fs19.existsSync)(candidate)) {
19557
+ if ((0, import_node_fs20.existsSync)(candidate)) {
19834
19558
  return candidate;
19835
19559
  }
19836
19560
  }
@@ -19862,7 +19586,7 @@ var ServiceRuntimeRunner = class {
19862
19586
  });
19863
19587
  }
19864
19588
  loadPackageJson(packageJsonPath) {
19865
- const raw = (0, import_node_fs19.readFileSync)(packageJsonPath, "utf8");
19589
+ const raw = (0, import_node_fs20.readFileSync)(packageJsonPath, "utf8");
19866
19590
  const parsed = JSON.parse(raw);
19867
19591
  if (!parsed || typeof parsed !== "object") {
19868
19592
  throw new Error(`Invalid package.json at ${packageJsonPath}`);
@@ -19871,7 +19595,7 @@ var ServiceRuntimeRunner = class {
19871
19595
  }
19872
19596
  writePackageJson(packageJsonPath, data) {
19873
19597
  const serialized = JSON.stringify(data, null, 2);
19874
- (0, import_node_fs19.writeFileSync)(packageJsonPath, `${serialized}
19598
+ (0, import_node_fs20.writeFileSync)(packageJsonPath, `${serialized}
19875
19599
  `, "utf8");
19876
19600
  }
19877
19601
  validateFcConfig(service, fc) {
@@ -19898,8 +19622,8 @@ var ServiceRuntimeRunner = class {
19898
19622
  }
19899
19623
  }
19900
19624
  async ensurePnpmWorkspaceRoot(repoRoot) {
19901
- const workspacePath = import_node_path23.default.join(repoRoot, "pnpm-workspace.yaml");
19902
- if (!(0, import_node_fs19.existsSync)(workspacePath)) {
19625
+ const workspacePath = import_node_path24.default.join(repoRoot, "pnpm-workspace.yaml");
19626
+ if (!(0, import_node_fs20.existsSync)(workspacePath)) {
19903
19627
  throw new Error(`Missing pnpm-workspace.yaml at ${workspacePath}`);
19904
19628
  }
19905
19629
  }
@@ -19973,16 +19697,16 @@ var ServiceRuntimeRunner = class {
19973
19697
  if (!privateKeyPath) {
19974
19698
  throw new Error("Missing ssl.prv in ~/.pmate/config.yaml.");
19975
19699
  }
19976
- if (!(0, import_node_fs19.existsSync)(certificatePath)) {
19700
+ if (!(0, import_node_fs20.existsSync)(certificatePath)) {
19977
19701
  throw new Error(`SSL certificate file not found: ${certificatePath}`);
19978
19702
  }
19979
- if (!(0, import_node_fs19.existsSync)(privateKeyPath)) {
19703
+ if (!(0, import_node_fs20.existsSync)(privateKeyPath)) {
19980
19704
  throw new Error(`SSL private key file not found: ${privateKeyPath}`);
19981
19705
  }
19982
19706
  return {
19983
19707
  certName: host,
19984
- certificate: (0, import_node_fs19.readFileSync)(certificatePath, "utf8"),
19985
- privateKey: (0, import_node_fs19.readFileSync)(privateKeyPath, "utf8")
19708
+ certificate: (0, import_node_fs20.readFileSync)(certificatePath, "utf8"),
19709
+ privateKey: (0, import_node_fs20.readFileSync)(privateKeyPath, "utf8")
19986
19710
  };
19987
19711
  }
19988
19712
  resolveFcProtocol(fc, certConfig) {
@@ -20376,7 +20100,7 @@ var ServiceCommandHandler = class {
20376
20100
  format: "dotenv"
20377
20101
  }
20378
20102
  );
20379
- const outputPath = import_node_path24.default.resolve(process.cwd(), args.output);
20103
+ const outputPath = import_node_path25.default.resolve(process.cwd(), args.output);
20380
20104
  await (0, import_promises6.writeFile)(outputPath, payload.content, "utf8");
20381
20105
  ui.success(`Wrote env file for ${args.appId} to ${outputPath}`);
20382
20106
  this.renderJson({ ...payload, output: outputPath }, args.json);
@@ -20598,11 +20322,11 @@ var ServiceCommandHandler = class {
20598
20322
  return (baseUrl || process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
20599
20323
  }
20600
20324
  readJsonFile(filePath) {
20601
- const absolutePath = import_node_path24.default.resolve(process.cwd(), filePath);
20602
- if (!(0, import_node_fs20.existsSync)(absolutePath)) {
20325
+ const absolutePath = import_node_path25.default.resolve(process.cwd(), filePath);
20326
+ if (!(0, import_node_fs21.existsSync)(absolutePath)) {
20603
20327
  throw new Error(`JSON file not found: ${absolutePath}`);
20604
20328
  }
20605
- const raw = (0, import_node_fs20.readFileSync)(absolutePath, "utf8");
20329
+ const raw = (0, import_node_fs21.readFileSync)(absolutePath, "utf8");
20606
20330
  try {
20607
20331
  return JSON.parse(raw);
20608
20332
  } catch (error) {
@@ -21327,9 +21051,9 @@ var RoleCommandHandler = class {
21327
21051
  };
21328
21052
 
21329
21053
  // src/commands/AccountCommandHandler.ts
21330
- var import_node_fs21 = require("fs");
21054
+ var import_node_fs22 = require("fs");
21331
21055
  var import_node_crypto4 = require("crypto");
21332
- var import_node_path25 = __toESM(require("path"));
21056
+ var import_node_path26 = __toESM(require("path"));
21333
21057
  init_sessionStore();
21334
21058
  var AccountCommandHandler = class {
21335
21059
  async handle(args) {
@@ -21337,9 +21061,9 @@ var AccountCommandHandler = class {
21337
21061
  case "bot-keygen": {
21338
21062
  const keyFile = this.generateBotKeyFile(args.app, args.name);
21339
21063
  const outPath = args.out ? this.resolveFilePath(args.out) : this.resolveDefaultBotKeyPath(args.app, args.name);
21340
- (0, import_node_fs21.mkdirSync)(import_node_path25.default.dirname(outPath), { recursive: true });
21341
- (0, import_node_fs21.writeFileSync)(outPath, JSON.stringify(keyFile, null, 2), { mode: 384 });
21342
- (0, import_node_fs21.chmodSync)(outPath, 384);
21064
+ (0, import_node_fs22.mkdirSync)(import_node_path26.default.dirname(outPath), { recursive: true });
21065
+ (0, import_node_fs22.writeFileSync)(outPath, JSON.stringify(keyFile, null, 2), { mode: 384 });
21066
+ (0, import_node_fs22.chmodSync)(outPath, 384);
21343
21067
  if (!args.json) {
21344
21068
  ui.success(`Bot key saved to ${outPath}`);
21345
21069
  }
@@ -21789,10 +21513,10 @@ var AccountCommandHandler = class {
21789
21513
  throw new Error("Missing visible apps input");
21790
21514
  }
21791
21515
  const absolutePath = this.resolveFilePath(args.filePath);
21792
- if (!(0, import_node_fs21.existsSync)(absolutePath)) {
21516
+ if (!(0, import_node_fs22.existsSync)(absolutePath)) {
21793
21517
  throw new Error(`JSON file not found: ${absolutePath}`);
21794
21518
  }
21795
- const raw = (0, import_node_fs21.readFileSync)(absolutePath, "utf8");
21519
+ const raw = (0, import_node_fs22.readFileSync)(absolutePath, "utf8");
21796
21520
  let parsed;
21797
21521
  try {
21798
21522
  parsed = JSON.parse(raw);
@@ -21806,10 +21530,10 @@ var AccountCommandHandler = class {
21806
21530
  return parsed;
21807
21531
  }
21808
21532
  resolveFilePath(filePath) {
21809
- return import_node_path25.default.resolve(process.cwd(), filePath);
21533
+ return import_node_path26.default.resolve(process.cwd(), filePath);
21810
21534
  }
21811
21535
  resolveDefaultBotKeyPath(app, name) {
21812
- return import_node_path25.default.join(this.homeDir(), ".pmate", "bots", app, `${name}.bot-key.json`);
21536
+ return import_node_path26.default.join(this.homeDir(), ".pmate", "bots", app, `${name}.bot-key.json`);
21813
21537
  }
21814
21538
  homeDir() {
21815
21539
  return process.env.HOME || process.env.USERPROFILE || process.cwd();
@@ -21832,10 +21556,10 @@ var AccountCommandHandler = class {
21832
21556
  throw new Error("Missing bot key file");
21833
21557
  }
21834
21558
  const absolutePath = this.resolveFilePath(filePath);
21835
- if (!(0, import_node_fs21.existsSync)(absolutePath)) {
21559
+ if (!(0, import_node_fs22.existsSync)(absolutePath)) {
21836
21560
  throw new Error(`Bot key file not found: ${absolutePath}`);
21837
21561
  }
21838
- const parsed = JSON.parse((0, import_node_fs21.readFileSync)(absolutePath, "utf8"));
21562
+ const parsed = JSON.parse((0, import_node_fs22.readFileSync)(absolutePath, "utf8"));
21839
21563
  if (parsed.type !== "pmate-bot-key" || parsed.version !== 1 || parsed.algorithm !== "ed25519" || !parsed.publicKey || !parsed.privateKey) {
21840
21564
  throw new Error(`Invalid PMate bot key file: ${absolutePath}`);
21841
21565
  }
@@ -21887,8 +21611,8 @@ function encodePathSegment(value) {
21887
21611
  }
21888
21612
 
21889
21613
  // src/commands/OrgCommandHandler.ts
21890
- var import_node_fs22 = require("fs");
21891
- var import_node_path26 = __toESM(require("path"));
21614
+ var import_node_fs23 = require("fs");
21615
+ var import_node_path27 = __toESM(require("path"));
21892
21616
  init_sessionStore();
21893
21617
  var OrgCommandHandler = class {
21894
21618
  async handle(args) {
@@ -22059,11 +21783,11 @@ var OrgCommandHandler = class {
22059
21783
  if (!filePath) {
22060
21784
  throw new Error(`Missing ${itemLabel} input`);
22061
21785
  }
22062
- const absolutePath = import_node_path26.default.resolve(process.cwd(), filePath);
22063
- if (!(0, import_node_fs22.existsSync)(absolutePath)) {
21786
+ const absolutePath = import_node_path27.default.resolve(process.cwd(), filePath);
21787
+ if (!(0, import_node_fs23.existsSync)(absolutePath)) {
22064
21788
  throw new Error(`JSON file not found: ${absolutePath}`);
22065
21789
  }
22066
- const raw = (0, import_node_fs22.readFileSync)(absolutePath, "utf8");
21790
+ const raw = (0, import_node_fs23.readFileSync)(absolutePath, "utf8");
22067
21791
  let parsed;
22068
21792
  try {
22069
21793
  parsed = JSON.parse(raw);
@@ -25139,7 +24863,7 @@ function requireValue12(tokens, option) {
25139
24863
 
25140
24864
  // src/index.ts
25141
24865
  var pkg = JSON.parse(
25142
- (0, import_node_fs23.readFileSync)(import_node_path27.default.resolve(__dirname, "..", "package.json"), "utf8")
24866
+ (0, import_node_fs24.readFileSync)(import_node_path28.default.resolve(__dirname, "..", "package.json"), "utf8")
25143
24867
  );
25144
24868
  var HELP_TEXT = [
25145
24869
  import_chalk4.default.bold(`pmate v${pkg.version}`),