@pmate/cli 0.30.2 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +533 -396
- package/dist/templates/electron/main.cjs +61 -0
- package/dist/templates/electron/resources.cjs +32 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -293,181 +293,181 @@ var init_sessionStore = __esm({
|
|
|
293
293
|
}
|
|
294
294
|
});
|
|
295
295
|
|
|
296
|
-
//
|
|
296
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/account.types.ts
|
|
297
297
|
var init_account_types = __esm({
|
|
298
|
-
"
|
|
298
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/account.types.ts"() {
|
|
299
299
|
"use strict";
|
|
300
300
|
}
|
|
301
301
|
});
|
|
302
302
|
|
|
303
|
-
//
|
|
303
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/achievements.types.ts
|
|
304
304
|
var init_achievements_types = __esm({
|
|
305
|
-
"
|
|
305
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/achievements.types.ts"() {
|
|
306
306
|
"use strict";
|
|
307
307
|
}
|
|
308
308
|
});
|
|
309
309
|
|
|
310
|
-
//
|
|
310
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/aigen.types.ts
|
|
311
311
|
var init_aigen_types = __esm({
|
|
312
|
-
"
|
|
312
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/aigen.types.ts"() {
|
|
313
313
|
"use strict";
|
|
314
314
|
}
|
|
315
315
|
});
|
|
316
316
|
|
|
317
|
-
//
|
|
317
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/agent.types.ts
|
|
318
318
|
var init_agent_types = __esm({
|
|
319
|
-
"
|
|
319
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/agent.types.ts"() {
|
|
320
320
|
"use strict";
|
|
321
321
|
}
|
|
322
322
|
});
|
|
323
323
|
|
|
324
|
-
//
|
|
324
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/agent-registry.types.ts
|
|
325
325
|
var init_agent_registry_types = __esm({
|
|
326
|
-
"
|
|
326
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/agent-registry.types.ts"() {
|
|
327
327
|
"use strict";
|
|
328
328
|
}
|
|
329
329
|
});
|
|
330
330
|
|
|
331
|
-
//
|
|
331
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/runner-registry.types.ts
|
|
332
332
|
var init_runner_registry_types = __esm({
|
|
333
|
-
"
|
|
333
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/runner-registry.types.ts"() {
|
|
334
334
|
"use strict";
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
337
|
|
|
338
|
-
//
|
|
338
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/function-registry.types.ts
|
|
339
339
|
var init_function_registry_types = __esm({
|
|
340
|
-
"
|
|
340
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/function-registry.types.ts"() {
|
|
341
341
|
"use strict";
|
|
342
342
|
}
|
|
343
343
|
});
|
|
344
344
|
|
|
345
|
-
//
|
|
345
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/worker-registry.types.ts
|
|
346
346
|
var init_worker_registry_types = __esm({
|
|
347
|
-
"
|
|
347
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/worker-registry.types.ts"() {
|
|
348
348
|
"use strict";
|
|
349
349
|
}
|
|
350
350
|
});
|
|
351
351
|
|
|
352
|
-
//
|
|
352
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/call.types.ts
|
|
353
353
|
var init_call_types = __esm({
|
|
354
|
-
"
|
|
354
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/call.types.ts"() {
|
|
355
355
|
"use strict";
|
|
356
356
|
}
|
|
357
357
|
});
|
|
358
358
|
|
|
359
|
-
//
|
|
359
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/blockchain.types.ts
|
|
360
360
|
var init_blockchain_types = __esm({
|
|
361
|
-
"
|
|
361
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/blockchain.types.ts"() {
|
|
362
362
|
"use strict";
|
|
363
363
|
}
|
|
364
364
|
});
|
|
365
365
|
|
|
366
|
-
//
|
|
366
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/breakdown.types.ts
|
|
367
367
|
var init_breakdown_types = __esm({
|
|
368
|
-
"
|
|
368
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/breakdown.types.ts"() {
|
|
369
369
|
"use strict";
|
|
370
370
|
}
|
|
371
371
|
});
|
|
372
372
|
|
|
373
|
-
//
|
|
373
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/chat.types.ts
|
|
374
374
|
var init_chat_types = __esm({
|
|
375
|
-
"
|
|
375
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/chat.types.ts"() {
|
|
376
376
|
"use strict";
|
|
377
377
|
}
|
|
378
378
|
});
|
|
379
379
|
|
|
380
|
-
//
|
|
380
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/companion.types.ts
|
|
381
381
|
var init_companion_types = __esm({
|
|
382
|
-
"
|
|
382
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/companion.types.ts"() {
|
|
383
383
|
"use strict";
|
|
384
384
|
}
|
|
385
385
|
});
|
|
386
386
|
|
|
387
|
-
//
|
|
387
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/enums.ts
|
|
388
388
|
var init_enums = __esm({
|
|
389
|
-
"
|
|
389
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/enums.ts"() {
|
|
390
390
|
"use strict";
|
|
391
391
|
}
|
|
392
392
|
});
|
|
393
393
|
|
|
394
|
-
//
|
|
394
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/lang.types.ts
|
|
395
395
|
var init_lang_types = __esm({
|
|
396
|
-
"
|
|
396
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/lang.types.ts"() {
|
|
397
397
|
"use strict";
|
|
398
398
|
}
|
|
399
399
|
});
|
|
400
400
|
|
|
401
|
-
//
|
|
401
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/logs.types.ts
|
|
402
402
|
var init_logs_types = __esm({
|
|
403
|
-
"
|
|
403
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/logs.types.ts"() {
|
|
404
404
|
"use strict";
|
|
405
405
|
}
|
|
406
406
|
});
|
|
407
407
|
|
|
408
|
-
//
|
|
408
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/message.types.ts
|
|
409
409
|
var PING, PONG;
|
|
410
410
|
var init_message_types = __esm({
|
|
411
|
-
"
|
|
411
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/message.types.ts"() {
|
|
412
412
|
"use strict";
|
|
413
413
|
PING = 1;
|
|
414
414
|
PONG = 2;
|
|
415
415
|
}
|
|
416
416
|
});
|
|
417
417
|
|
|
418
|
-
//
|
|
418
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/newLog.types.ts
|
|
419
419
|
var init_newLog_types = __esm({
|
|
420
|
-
"
|
|
420
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/newLog.types.ts"() {
|
|
421
421
|
"use strict";
|
|
422
422
|
}
|
|
423
423
|
});
|
|
424
424
|
|
|
425
|
-
//
|
|
425
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/novel.types.ts
|
|
426
426
|
var init_novel_types = __esm({
|
|
427
|
-
"
|
|
427
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/novel.types.ts"() {
|
|
428
428
|
"use strict";
|
|
429
429
|
}
|
|
430
430
|
});
|
|
431
431
|
|
|
432
|
-
//
|
|
432
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/offline.types.ts
|
|
433
433
|
var init_offline_types = __esm({
|
|
434
|
-
"
|
|
434
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/offline.types.ts"() {
|
|
435
435
|
"use strict";
|
|
436
436
|
}
|
|
437
437
|
});
|
|
438
438
|
|
|
439
|
-
//
|
|
439
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/prompt.types.ts
|
|
440
440
|
var init_prompt_types = __esm({
|
|
441
|
-
"
|
|
441
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/prompt.types.ts"() {
|
|
442
442
|
"use strict";
|
|
443
443
|
}
|
|
444
444
|
});
|
|
445
445
|
|
|
446
|
-
//
|
|
446
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/reading.types.ts
|
|
447
447
|
var init_reading_types = __esm({
|
|
448
|
-
"
|
|
448
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/reading.types.ts"() {
|
|
449
449
|
"use strict";
|
|
450
450
|
}
|
|
451
451
|
});
|
|
452
452
|
|
|
453
|
-
//
|
|
453
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/settings.types.ts
|
|
454
454
|
var init_settings_types = __esm({
|
|
455
|
-
"
|
|
455
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/settings.types.ts"() {
|
|
456
456
|
"use strict";
|
|
457
457
|
}
|
|
458
458
|
});
|
|
459
459
|
|
|
460
|
-
//
|
|
460
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/subscription.types.ts
|
|
461
461
|
var init_subscription_types = __esm({
|
|
462
|
-
"
|
|
462
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/subscription.types.ts"() {
|
|
463
463
|
"use strict";
|
|
464
464
|
}
|
|
465
465
|
});
|
|
466
466
|
|
|
467
|
-
//
|
|
467
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/types.ts
|
|
468
468
|
var buildVoiceKey, createVoice;
|
|
469
469
|
var init_types = __esm({
|
|
470
|
-
"
|
|
470
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/types.ts"() {
|
|
471
471
|
"use strict";
|
|
472
472
|
buildVoiceKey = (provider, name) => {
|
|
473
473
|
return `${provider}:${name}`;
|
|
@@ -489,44 +489,44 @@ var init_types = __esm({
|
|
|
489
489
|
}
|
|
490
490
|
});
|
|
491
491
|
|
|
492
|
-
//
|
|
492
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/wordv5.def.ts
|
|
493
493
|
var init_wordv5_def = __esm({
|
|
494
|
-
"
|
|
494
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/wordv5.def.ts"() {
|
|
495
495
|
"use strict";
|
|
496
496
|
}
|
|
497
497
|
});
|
|
498
498
|
|
|
499
|
-
//
|
|
499
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/auth.types.ts
|
|
500
500
|
var init_auth_types = __esm({
|
|
501
|
-
"
|
|
501
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/auth.types.ts"() {
|
|
502
502
|
"use strict";
|
|
503
503
|
}
|
|
504
504
|
});
|
|
505
505
|
|
|
506
|
-
//
|
|
506
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/apps.types.ts
|
|
507
507
|
var init_apps_types = __esm({
|
|
508
|
-
"
|
|
508
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/apps.types.ts"() {
|
|
509
509
|
"use strict";
|
|
510
510
|
}
|
|
511
511
|
});
|
|
512
512
|
|
|
513
|
-
//
|
|
513
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/response.types.ts
|
|
514
514
|
var init_response_types = __esm({
|
|
515
|
-
"
|
|
515
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/response.types.ts"() {
|
|
516
516
|
"use strict";
|
|
517
517
|
}
|
|
518
518
|
});
|
|
519
519
|
|
|
520
|
-
//
|
|
520
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/role.types.ts
|
|
521
521
|
var init_role_types = __esm({
|
|
522
|
-
"
|
|
522
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/role.types.ts"() {
|
|
523
523
|
"use strict";
|
|
524
524
|
}
|
|
525
525
|
});
|
|
526
526
|
|
|
527
|
-
//
|
|
527
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/index.ts
|
|
528
528
|
var init_types2 = __esm({
|
|
529
|
-
"
|
|
529
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/index.ts"() {
|
|
530
530
|
"use strict";
|
|
531
531
|
init_account_types();
|
|
532
532
|
init_achievements_types();
|
|
@@ -561,24 +561,24 @@ var init_types2 = __esm({
|
|
|
561
561
|
}
|
|
562
562
|
});
|
|
563
563
|
|
|
564
|
-
//
|
|
564
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/BizErrorCode.ts
|
|
565
565
|
var init_BizErrorCode = __esm({
|
|
566
|
-
"
|
|
566
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/BizErrorCode.ts"() {
|
|
567
567
|
"use strict";
|
|
568
568
|
}
|
|
569
569
|
});
|
|
570
570
|
|
|
571
|
-
//
|
|
571
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/consts.ts
|
|
572
572
|
var init_consts = __esm({
|
|
573
|
-
"
|
|
573
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/consts.ts"() {
|
|
574
574
|
"use strict";
|
|
575
575
|
}
|
|
576
576
|
});
|
|
577
577
|
|
|
578
|
-
//
|
|
578
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/TopicNames.ts
|
|
579
579
|
var TopicNames, topicKindMatchers;
|
|
580
580
|
var init_TopicNames = __esm({
|
|
581
|
-
"
|
|
581
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/TopicNames.ts"() {
|
|
582
582
|
"use strict";
|
|
583
583
|
init_types2();
|
|
584
584
|
TopicNames = class _TopicNames {
|
|
@@ -664,18 +664,18 @@ var init_TopicNames = __esm({
|
|
|
664
664
|
}
|
|
665
665
|
});
|
|
666
666
|
|
|
667
|
-
//
|
|
667
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/OSSKeys.ts
|
|
668
668
|
var init_OSSKeys = __esm({
|
|
669
|
-
"
|
|
669
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/OSSKeys.ts"() {
|
|
670
670
|
"use strict";
|
|
671
671
|
init_consts();
|
|
672
672
|
}
|
|
673
673
|
});
|
|
674
674
|
|
|
675
|
-
//
|
|
675
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/CompanionProfiles.ts
|
|
676
676
|
var openAICoral, openAIAsh, openAIBallad, openAINova, openAIVerse;
|
|
677
677
|
var init_CompanionProfiles = __esm({
|
|
678
|
-
"
|
|
678
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/CompanionProfiles.ts"() {
|
|
679
679
|
"use strict";
|
|
680
680
|
init_types2();
|
|
681
681
|
openAICoral = createVoice({
|
|
@@ -710,9 +710,9 @@ var init_CompanionProfiles = __esm({
|
|
|
710
710
|
}
|
|
711
711
|
});
|
|
712
712
|
|
|
713
|
-
//
|
|
713
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/index.ts
|
|
714
714
|
var init_config = __esm({
|
|
715
|
-
"
|
|
715
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/index.ts"() {
|
|
716
716
|
"use strict";
|
|
717
717
|
init_BizErrorCode();
|
|
718
718
|
init_consts();
|
|
@@ -722,83 +722,83 @@ var init_config = __esm({
|
|
|
722
722
|
}
|
|
723
723
|
});
|
|
724
724
|
|
|
725
|
-
//
|
|
725
|
+
// node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/index.ts
|
|
726
726
|
var init_src = __esm({
|
|
727
|
-
"
|
|
727
|
+
"node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/index.ts"() {
|
|
728
728
|
"use strict";
|
|
729
729
|
init_types2();
|
|
730
730
|
init_config();
|
|
731
731
|
}
|
|
732
732
|
});
|
|
733
733
|
|
|
734
|
-
//
|
|
734
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/base64.ts
|
|
735
735
|
var init_base64 = __esm({
|
|
736
|
-
"
|
|
736
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/base64.ts"() {
|
|
737
737
|
"use strict";
|
|
738
738
|
}
|
|
739
739
|
});
|
|
740
740
|
|
|
741
|
-
//
|
|
741
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Cache.ts
|
|
742
742
|
var init_Cache = __esm({
|
|
743
|
-
"
|
|
743
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Cache.ts"() {
|
|
744
744
|
"use strict";
|
|
745
745
|
}
|
|
746
746
|
});
|
|
747
747
|
|
|
748
|
-
//
|
|
748
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/batchResolve.ts
|
|
749
749
|
var init_batchResolve = __esm({
|
|
750
|
-
"
|
|
750
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/batchResolve.ts"() {
|
|
751
751
|
"use strict";
|
|
752
752
|
init_Cache();
|
|
753
753
|
}
|
|
754
754
|
});
|
|
755
755
|
|
|
756
|
-
//
|
|
756
|
+
// node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceSpliter.ts
|
|
757
757
|
var init_sentenceSpliter = __esm({
|
|
758
|
-
"
|
|
758
|
+
"node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceSpliter.ts"() {
|
|
759
759
|
"use strict";
|
|
760
760
|
}
|
|
761
761
|
});
|
|
762
762
|
|
|
763
|
-
//
|
|
763
|
+
// node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceTrim.ts
|
|
764
764
|
var init_sentenceTrim = __esm({
|
|
765
|
-
"
|
|
765
|
+
"node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceTrim.ts"() {
|
|
766
766
|
"use strict";
|
|
767
767
|
}
|
|
768
768
|
});
|
|
769
769
|
|
|
770
|
-
//
|
|
770
|
+
// node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/wordSpliter.ts
|
|
771
771
|
var init_wordSpliter = __esm({
|
|
772
|
-
"
|
|
772
|
+
"node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/wordSpliter.ts"() {
|
|
773
773
|
"use strict";
|
|
774
774
|
}
|
|
775
775
|
});
|
|
776
776
|
|
|
777
|
-
//
|
|
777
|
+
// node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/regex.ts
|
|
778
778
|
var init_regex = __esm({
|
|
779
|
-
"
|
|
779
|
+
"node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/regex.ts"() {
|
|
780
780
|
"use strict";
|
|
781
781
|
}
|
|
782
782
|
});
|
|
783
783
|
|
|
784
|
-
//
|
|
784
|
+
// node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceSpliter.ts
|
|
785
785
|
var init_sentenceSpliter2 = __esm({
|
|
786
|
-
"
|
|
786
|
+
"node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceSpliter.ts"() {
|
|
787
787
|
"use strict";
|
|
788
788
|
}
|
|
789
789
|
});
|
|
790
790
|
|
|
791
|
-
//
|
|
791
|
+
// node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceTrim.ts
|
|
792
792
|
var init_sentenceTrim2 = __esm({
|
|
793
|
-
"
|
|
793
|
+
"node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceTrim.ts"() {
|
|
794
794
|
"use strict";
|
|
795
795
|
}
|
|
796
796
|
});
|
|
797
797
|
|
|
798
|
-
//
|
|
798
|
+
// node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/wordSpliter.ts
|
|
799
799
|
var regex;
|
|
800
800
|
var init_wordSpliter2 = __esm({
|
|
801
|
-
"
|
|
801
|
+
"node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/wordSpliter.ts"() {
|
|
802
802
|
"use strict";
|
|
803
803
|
regex = new RegExp(
|
|
804
804
|
[
|
|
@@ -834,23 +834,23 @@ var init_wordSpliter2 = __esm({
|
|
|
834
834
|
}
|
|
835
835
|
});
|
|
836
836
|
|
|
837
|
-
//
|
|
837
|
+
// node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/sentenceSpliter.ts
|
|
838
838
|
var init_sentenceSpliter3 = __esm({
|
|
839
|
-
"
|
|
839
|
+
"node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/sentenceSpliter.ts"() {
|
|
840
840
|
"use strict";
|
|
841
841
|
}
|
|
842
842
|
});
|
|
843
843
|
|
|
844
|
-
//
|
|
844
|
+
// node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/wordSpliter.ts
|
|
845
845
|
var init_wordSpliter3 = __esm({
|
|
846
|
-
"
|
|
846
|
+
"node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/wordSpliter.ts"() {
|
|
847
847
|
"use strict";
|
|
848
848
|
}
|
|
849
849
|
});
|
|
850
850
|
|
|
851
|
-
//
|
|
851
|
+
// node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/readingSettings.ts
|
|
852
852
|
var init_readingSettings = __esm({
|
|
853
|
-
"
|
|
853
|
+
"node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/readingSettings.ts"() {
|
|
854
854
|
"use strict";
|
|
855
855
|
init_sentenceSpliter();
|
|
856
856
|
init_wordSpliter();
|
|
@@ -861,17 +861,17 @@ var init_readingSettings = __esm({
|
|
|
861
861
|
}
|
|
862
862
|
});
|
|
863
863
|
|
|
864
|
-
//
|
|
864
|
+
// node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/utils.ts
|
|
865
865
|
var init_utils = __esm({
|
|
866
|
-
"
|
|
866
|
+
"node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/utils.ts"() {
|
|
867
867
|
"use strict";
|
|
868
868
|
init_src();
|
|
869
869
|
}
|
|
870
870
|
});
|
|
871
871
|
|
|
872
|
-
//
|
|
872
|
+
// node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/index.ts
|
|
873
873
|
var init_src2 = __esm({
|
|
874
|
-
"
|
|
874
|
+
"node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/index.ts"() {
|
|
875
875
|
"use strict";
|
|
876
876
|
init_sentenceSpliter();
|
|
877
877
|
init_sentenceTrim();
|
|
@@ -887,32 +887,32 @@ var init_src2 = __esm({
|
|
|
887
887
|
}
|
|
888
888
|
});
|
|
889
889
|
|
|
890
|
-
//
|
|
890
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/bookStats.ts
|
|
891
891
|
var init_bookStats = __esm({
|
|
892
|
-
"
|
|
892
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/bookStats.ts"() {
|
|
893
893
|
"use strict";
|
|
894
894
|
init_src2();
|
|
895
895
|
}
|
|
896
896
|
});
|
|
897
897
|
|
|
898
|
-
//
|
|
898
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts
|
|
899
899
|
var init_BoundedConcurrentQueue = __esm({
|
|
900
|
-
"
|
|
900
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts"() {
|
|
901
901
|
"use strict";
|
|
902
902
|
}
|
|
903
903
|
});
|
|
904
904
|
|
|
905
|
-
//
|
|
905
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/lru.ts
|
|
906
906
|
var init_lru = __esm({
|
|
907
|
-
"
|
|
907
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/lru.ts"() {
|
|
908
908
|
"use strict";
|
|
909
909
|
init_Cache();
|
|
910
910
|
}
|
|
911
911
|
});
|
|
912
912
|
|
|
913
|
-
//
|
|
913
|
+
// node_modules/.pnpm/js-sha3@0.9.3/node_modules/js-sha3/src/sha3.js
|
|
914
914
|
var require_sha3 = __commonJS({
|
|
915
|
-
"
|
|
915
|
+
"node_modules/.pnpm/js-sha3@0.9.3/node_modules/js-sha3/src/sha3.js"(exports2, module2) {
|
|
916
916
|
"use strict";
|
|
917
917
|
(function() {
|
|
918
918
|
"use strict";
|
|
@@ -1557,24 +1557,24 @@ var require_sha3 = __commonJS({
|
|
|
1557
1557
|
}
|
|
1558
1558
|
});
|
|
1559
1559
|
|
|
1560
|
-
//
|
|
1560
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Maybe.ts
|
|
1561
1561
|
var init_Maybe = __esm({
|
|
1562
|
-
"
|
|
1562
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Maybe.ts"() {
|
|
1563
1563
|
"use strict";
|
|
1564
1564
|
}
|
|
1565
1565
|
});
|
|
1566
1566
|
|
|
1567
|
-
//
|
|
1567
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/cacheMethodInMem.ts
|
|
1568
1568
|
var import_js_sha3;
|
|
1569
1569
|
var init_cacheMethodInMem = __esm({
|
|
1570
|
-
"
|
|
1570
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/cacheMethodInMem.ts"() {
|
|
1571
1571
|
"use strict";
|
|
1572
1572
|
import_js_sha3 = __toESM(require_sha3(), 1);
|
|
1573
1573
|
init_Maybe();
|
|
1574
1574
|
}
|
|
1575
1575
|
});
|
|
1576
1576
|
|
|
1577
|
-
//
|
|
1577
|
+
// node_modules/.pnpm/pako@2.1.0/node_modules/pako/dist/pako.esm.mjs
|
|
1578
1578
|
function zero$1(buf) {
|
|
1579
1579
|
let len = buf.length;
|
|
1580
1580
|
while (--len >= 0) {
|
|
@@ -1862,7 +1862,7 @@ function inflateRaw$1(input, options) {
|
|
|
1862
1862
|
}
|
|
1863
1863
|
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;
|
|
1864
1864
|
var init_pako_esm = __esm({
|
|
1865
|
-
"
|
|
1865
|
+
"node_modules/.pnpm/pako@2.1.0/node_modules/pako/dist/pako.esm.mjs"() {
|
|
1866
1866
|
"use strict";
|
|
1867
1867
|
Z_FIXED$1 = 4;
|
|
1868
1868
|
Z_BINARY = 0;
|
|
@@ -5743,7 +5743,7 @@ var init_pako_esm = __esm({
|
|
|
5743
5743
|
}
|
|
5744
5744
|
});
|
|
5745
5745
|
|
|
5746
|
-
//
|
|
5746
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/compress.ts
|
|
5747
5747
|
async function gzipEncodeBlob(input) {
|
|
5748
5748
|
const array = await toUint8Array(input);
|
|
5749
5749
|
return gzip_1(array);
|
|
@@ -5769,16 +5769,16 @@ async function toUint8Array(input) {
|
|
|
5769
5769
|
throw new TypeError("Unsupported input type for gzipEncodeBlob");
|
|
5770
5770
|
}
|
|
5771
5771
|
var init_compress = __esm({
|
|
5772
|
-
"
|
|
5772
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/compress.ts"() {
|
|
5773
5773
|
"use strict";
|
|
5774
5774
|
init_pako_esm();
|
|
5775
5775
|
}
|
|
5776
5776
|
});
|
|
5777
5777
|
|
|
5778
|
-
//
|
|
5778
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/AsyncStream.ts
|
|
5779
5779
|
var AsyncStream;
|
|
5780
5780
|
var init_AsyncStream = __esm({
|
|
5781
|
-
"
|
|
5781
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/AsyncStream.ts"() {
|
|
5782
5782
|
"use strict";
|
|
5783
5783
|
AsyncStream = class _AsyncStream {
|
|
5784
5784
|
constructor() {
|
|
@@ -5966,10 +5966,10 @@ var init_AsyncStream = __esm({
|
|
|
5966
5966
|
}
|
|
5967
5967
|
});
|
|
5968
5968
|
|
|
5969
|
-
//
|
|
5969
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/uniqHash.ts
|
|
5970
5970
|
var import_js_sha32, sortKeys, uniqHash;
|
|
5971
5971
|
var init_uniqHash = __esm({
|
|
5972
|
-
"
|
|
5972
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/uniqHash.ts"() {
|
|
5973
5973
|
"use strict";
|
|
5974
5974
|
init_src();
|
|
5975
5975
|
import_js_sha32 = __toESM(require_sha3(), 1);
|
|
@@ -5999,69 +5999,69 @@ var init_uniqHash = __esm({
|
|
|
5999
5999
|
}
|
|
6000
6000
|
});
|
|
6001
6001
|
|
|
6002
|
-
//
|
|
6002
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/createMsg.ts
|
|
6003
6003
|
var init_createMsg = __esm({
|
|
6004
|
-
"
|
|
6004
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/createMsg.ts"() {
|
|
6005
6005
|
"use strict";
|
|
6006
6006
|
init_src();
|
|
6007
6007
|
init_uniqHash();
|
|
6008
6008
|
}
|
|
6009
6009
|
});
|
|
6010
6010
|
|
|
6011
|
-
//
|
|
6011
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/detectText.ts
|
|
6012
6012
|
var init_detectText = __esm({
|
|
6013
|
-
"
|
|
6013
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/detectText.ts"() {
|
|
6014
6014
|
"use strict";
|
|
6015
6015
|
}
|
|
6016
6016
|
});
|
|
6017
6017
|
|
|
6018
|
-
//
|
|
6018
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Emitter.ts
|
|
6019
6019
|
var init_Emitter = __esm({
|
|
6020
|
-
"
|
|
6020
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Emitter.ts"() {
|
|
6021
6021
|
"use strict";
|
|
6022
6022
|
}
|
|
6023
6023
|
});
|
|
6024
6024
|
|
|
6025
|
-
//
|
|
6025
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/EmitterV2.ts
|
|
6026
6026
|
var init_EmitterV2 = __esm({
|
|
6027
|
-
"
|
|
6027
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/EmitterV2.ts"() {
|
|
6028
6028
|
"use strict";
|
|
6029
6029
|
}
|
|
6030
6030
|
});
|
|
6031
6031
|
|
|
6032
|
-
//
|
|
6032
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/formatTime.ts
|
|
6033
6033
|
var init_formatTime = __esm({
|
|
6034
|
-
"
|
|
6034
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/formatTime.ts"() {
|
|
6035
6035
|
"use strict";
|
|
6036
6036
|
}
|
|
6037
6037
|
});
|
|
6038
6038
|
|
|
6039
|
-
//
|
|
6039
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/index.ts
|
|
6040
6040
|
var init_format = __esm({
|
|
6041
|
-
"
|
|
6041
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/index.ts"() {
|
|
6042
6042
|
"use strict";
|
|
6043
6043
|
init_formatTime();
|
|
6044
6044
|
}
|
|
6045
6045
|
});
|
|
6046
6046
|
|
|
6047
|
-
//
|
|
6047
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/isVolcabulary.ts
|
|
6048
6048
|
var init_isVolcabulary = __esm({
|
|
6049
|
-
"
|
|
6049
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/isVolcabulary.ts"() {
|
|
6050
6050
|
"use strict";
|
|
6051
6051
|
}
|
|
6052
6052
|
});
|
|
6053
6053
|
|
|
6054
|
-
//
|
|
6054
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Loadable.ts
|
|
6055
6055
|
var init_Loadable = __esm({
|
|
6056
|
-
"
|
|
6056
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Loadable.ts"() {
|
|
6057
6057
|
"use strict";
|
|
6058
6058
|
}
|
|
6059
6059
|
});
|
|
6060
6060
|
|
|
6061
|
-
//
|
|
6061
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Logger.ts
|
|
6062
6062
|
var Logger;
|
|
6063
6063
|
var init_Logger = __esm({
|
|
6064
|
-
"
|
|
6064
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Logger.ts"() {
|
|
6065
6065
|
"use strict";
|
|
6066
6066
|
Logger = class _Logger {
|
|
6067
6067
|
constructor(name) {
|
|
@@ -6086,21 +6086,21 @@ var init_Logger = __esm({
|
|
|
6086
6086
|
}
|
|
6087
6087
|
});
|
|
6088
6088
|
|
|
6089
|
-
//
|
|
6089
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/mapToReadingBook.ts
|
|
6090
6090
|
var init_mapToReadingBook = __esm({
|
|
6091
|
-
"
|
|
6091
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/mapToReadingBook.ts"() {
|
|
6092
6092
|
"use strict";
|
|
6093
6093
|
}
|
|
6094
6094
|
});
|
|
6095
6095
|
|
|
6096
|
-
//
|
|
6096
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/memoize.ts
|
|
6097
6097
|
var init_memoize = __esm({
|
|
6098
|
-
"
|
|
6098
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/memoize.ts"() {
|
|
6099
6099
|
"use strict";
|
|
6100
6100
|
}
|
|
6101
6101
|
});
|
|
6102
6102
|
|
|
6103
|
-
//
|
|
6103
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs
|
|
6104
6104
|
function utf8Count(str) {
|
|
6105
6105
|
const strLength = str.length;
|
|
6106
6106
|
let byteLength = 0;
|
|
@@ -6227,7 +6227,7 @@ function utf8Decode(bytes, inputOffset, byteLength) {
|
|
|
6227
6227
|
}
|
|
6228
6228
|
var sharedTextEncoder, TEXT_ENCODER_THRESHOLD, CHUNK_SIZE, sharedTextDecoder, TEXT_DECODER_THRESHOLD;
|
|
6229
6229
|
var init_utf8 = __esm({
|
|
6230
|
-
"
|
|
6230
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs"() {
|
|
6231
6231
|
"use strict";
|
|
6232
6232
|
sharedTextEncoder = new TextEncoder();
|
|
6233
6233
|
TEXT_ENCODER_THRESHOLD = 50;
|
|
@@ -6237,10 +6237,10 @@ var init_utf8 = __esm({
|
|
|
6237
6237
|
}
|
|
6238
6238
|
});
|
|
6239
6239
|
|
|
6240
|
-
//
|
|
6240
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs
|
|
6241
6241
|
var ExtData;
|
|
6242
6242
|
var init_ExtData = __esm({
|
|
6243
|
-
"
|
|
6243
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs"() {
|
|
6244
6244
|
"use strict";
|
|
6245
6245
|
ExtData = class {
|
|
6246
6246
|
type;
|
|
@@ -6253,10 +6253,10 @@ var init_ExtData = __esm({
|
|
|
6253
6253
|
}
|
|
6254
6254
|
});
|
|
6255
6255
|
|
|
6256
|
-
//
|
|
6256
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs
|
|
6257
6257
|
var DecodeError;
|
|
6258
6258
|
var init_DecodeError = __esm({
|
|
6259
|
-
"
|
|
6259
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs"() {
|
|
6260
6260
|
"use strict";
|
|
6261
6261
|
DecodeError = class _DecodeError extends Error {
|
|
6262
6262
|
constructor(message) {
|
|
@@ -6273,7 +6273,7 @@ var init_DecodeError = __esm({
|
|
|
6273
6273
|
}
|
|
6274
6274
|
});
|
|
6275
6275
|
|
|
6276
|
-
//
|
|
6276
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs
|
|
6277
6277
|
function setUint64(view, offset, value) {
|
|
6278
6278
|
const high = value / 4294967296;
|
|
6279
6279
|
const low = value;
|
|
@@ -6298,13 +6298,13 @@ function getUint64(view, offset) {
|
|
|
6298
6298
|
}
|
|
6299
6299
|
var UINT32_MAX;
|
|
6300
6300
|
var init_int = __esm({
|
|
6301
|
-
"
|
|
6301
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs"() {
|
|
6302
6302
|
"use strict";
|
|
6303
6303
|
UINT32_MAX = 4294967295;
|
|
6304
6304
|
}
|
|
6305
6305
|
});
|
|
6306
6306
|
|
|
6307
|
-
//
|
|
6307
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs
|
|
6308
6308
|
function encodeTimeSpecToTimestamp({ sec, nsec }) {
|
|
6309
6309
|
if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {
|
|
6310
6310
|
if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {
|
|
@@ -6377,7 +6377,7 @@ function decodeTimestampExtension(data) {
|
|
|
6377
6377
|
}
|
|
6378
6378
|
var EXT_TIMESTAMP, TIMESTAMP32_MAX_SEC, TIMESTAMP64_MAX_SEC, timestampExtension;
|
|
6379
6379
|
var init_timestamp = __esm({
|
|
6380
|
-
"
|
|
6380
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs"() {
|
|
6381
6381
|
"use strict";
|
|
6382
6382
|
init_DecodeError();
|
|
6383
6383
|
init_int();
|
|
@@ -6392,10 +6392,10 @@ var init_timestamp = __esm({
|
|
|
6392
6392
|
}
|
|
6393
6393
|
});
|
|
6394
6394
|
|
|
6395
|
-
//
|
|
6395
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs
|
|
6396
6396
|
var ExtensionCodec;
|
|
6397
6397
|
var init_ExtensionCodec = __esm({
|
|
6398
|
-
"
|
|
6398
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs"() {
|
|
6399
6399
|
"use strict";
|
|
6400
6400
|
init_ExtData();
|
|
6401
6401
|
init_timestamp();
|
|
@@ -6462,7 +6462,7 @@ var init_ExtensionCodec = __esm({
|
|
|
6462
6462
|
}
|
|
6463
6463
|
});
|
|
6464
6464
|
|
|
6465
|
-
//
|
|
6465
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs
|
|
6466
6466
|
function isArrayBufferLike(buffer) {
|
|
6467
6467
|
return buffer instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && buffer instanceof SharedArrayBuffer;
|
|
6468
6468
|
}
|
|
@@ -6478,15 +6478,15 @@ function ensureUint8Array(buffer) {
|
|
|
6478
6478
|
}
|
|
6479
6479
|
}
|
|
6480
6480
|
var init_typedArrays = __esm({
|
|
6481
|
-
"
|
|
6481
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs"() {
|
|
6482
6482
|
"use strict";
|
|
6483
6483
|
}
|
|
6484
6484
|
});
|
|
6485
6485
|
|
|
6486
|
-
//
|
|
6486
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs
|
|
6487
6487
|
var DEFAULT_MAX_DEPTH, DEFAULT_INITIAL_BUFFER_SIZE, Encoder;
|
|
6488
6488
|
var init_Encoder = __esm({
|
|
6489
|
-
"
|
|
6489
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs"() {
|
|
6490
6490
|
"use strict";
|
|
6491
6491
|
init_utf8();
|
|
6492
6492
|
init_ExtensionCodec();
|
|
@@ -6896,32 +6896,32 @@ var init_Encoder = __esm({
|
|
|
6896
6896
|
}
|
|
6897
6897
|
});
|
|
6898
6898
|
|
|
6899
|
-
//
|
|
6899
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/encode.mjs
|
|
6900
6900
|
function encode(value, options) {
|
|
6901
6901
|
const encoder2 = new Encoder(options);
|
|
6902
6902
|
return encoder2.encodeSharedRef(value);
|
|
6903
6903
|
}
|
|
6904
6904
|
var init_encode = __esm({
|
|
6905
|
-
"
|
|
6905
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/encode.mjs"() {
|
|
6906
6906
|
"use strict";
|
|
6907
6907
|
init_Encoder();
|
|
6908
6908
|
}
|
|
6909
6909
|
});
|
|
6910
6910
|
|
|
6911
|
-
//
|
|
6911
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs
|
|
6912
6912
|
function prettyByte(byte) {
|
|
6913
6913
|
return `${byte < 0 ? "-" : ""}0x${Math.abs(byte).toString(16).padStart(2, "0")}`;
|
|
6914
6914
|
}
|
|
6915
6915
|
var init_prettyByte = __esm({
|
|
6916
|
-
"
|
|
6916
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs"() {
|
|
6917
6917
|
"use strict";
|
|
6918
6918
|
}
|
|
6919
6919
|
});
|
|
6920
6920
|
|
|
6921
|
-
//
|
|
6921
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs
|
|
6922
6922
|
var DEFAULT_MAX_KEY_LENGTH, DEFAULT_MAX_LENGTH_PER_KEY, CachedKeyDecoder;
|
|
6923
6923
|
var init_CachedKeyDecoder = __esm({
|
|
6924
|
-
"
|
|
6924
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs"() {
|
|
6925
6925
|
"use strict";
|
|
6926
6926
|
init_utf8();
|
|
6927
6927
|
DEFAULT_MAX_KEY_LENGTH = 16;
|
|
@@ -6981,10 +6981,10 @@ var init_CachedKeyDecoder = __esm({
|
|
|
6981
6981
|
}
|
|
6982
6982
|
});
|
|
6983
6983
|
|
|
6984
|
-
//
|
|
6984
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs
|
|
6985
6985
|
var STATE_ARRAY, STATE_MAP_KEY, STATE_MAP_VALUE, mapKeyConverter, StackPool, HEAD_BYTE_REQUIRED, EMPTY_VIEW, EMPTY_BYTES, MORE_DATA, sharedCachedKeyDecoder, Decoder;
|
|
6986
6986
|
var init_Decoder = __esm({
|
|
6987
|
-
"
|
|
6987
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs"() {
|
|
6988
6988
|
"use strict";
|
|
6989
6989
|
init_prettyByte();
|
|
6990
6990
|
init_ExtensionCodec();
|
|
@@ -7622,31 +7622,31 @@ var init_Decoder = __esm({
|
|
|
7622
7622
|
}
|
|
7623
7623
|
});
|
|
7624
7624
|
|
|
7625
|
-
//
|
|
7625
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/decode.mjs
|
|
7626
7626
|
function decode(buffer, options) {
|
|
7627
7627
|
const decoder = new Decoder(options);
|
|
7628
7628
|
return decoder.decode(buffer);
|
|
7629
7629
|
}
|
|
7630
7630
|
var init_decode = __esm({
|
|
7631
|
-
"
|
|
7631
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/decode.mjs"() {
|
|
7632
7632
|
"use strict";
|
|
7633
7633
|
init_Decoder();
|
|
7634
7634
|
}
|
|
7635
7635
|
});
|
|
7636
7636
|
|
|
7637
|
-
//
|
|
7637
|
+
// node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/index.mjs
|
|
7638
7638
|
var init_dist = __esm({
|
|
7639
|
-
"
|
|
7639
|
+
"node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/index.mjs"() {
|
|
7640
7640
|
"use strict";
|
|
7641
7641
|
init_encode();
|
|
7642
7642
|
init_decode();
|
|
7643
7643
|
}
|
|
7644
7644
|
});
|
|
7645
7645
|
|
|
7646
|
-
//
|
|
7646
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Msg.ts
|
|
7647
7647
|
var encoder, Msg;
|
|
7648
7648
|
var init_Msg = __esm({
|
|
7649
|
-
"
|
|
7649
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Msg.ts"() {
|
|
7650
7650
|
"use strict";
|
|
7651
7651
|
init_dist();
|
|
7652
7652
|
init_src();
|
|
@@ -7774,106 +7774,106 @@ var init_Msg = __esm({
|
|
|
7774
7774
|
}
|
|
7775
7775
|
});
|
|
7776
7776
|
|
|
7777
|
-
//
|
|
7777
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/normalize.ts
|
|
7778
7778
|
var init_normalize = __esm({
|
|
7779
|
-
"
|
|
7779
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/normalize.ts"() {
|
|
7780
7780
|
"use strict";
|
|
7781
7781
|
}
|
|
7782
7782
|
});
|
|
7783
7783
|
|
|
7784
|
-
//
|
|
7784
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/pageURL.ts
|
|
7785
7785
|
var init_pageURL = __esm({
|
|
7786
|
-
"
|
|
7786
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/pageURL.ts"() {
|
|
7787
7787
|
"use strict";
|
|
7788
7788
|
}
|
|
7789
7789
|
});
|
|
7790
7790
|
|
|
7791
|
-
//
|
|
7791
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/PromiseQueue.ts
|
|
7792
7792
|
var init_PromiseQueue = __esm({
|
|
7793
|
-
"
|
|
7793
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/PromiseQueue.ts"() {
|
|
7794
7794
|
"use strict";
|
|
7795
7795
|
}
|
|
7796
7796
|
});
|
|
7797
7797
|
|
|
7798
|
-
//
|
|
7798
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/resourceKey.ts
|
|
7799
7799
|
var import_js_sha33;
|
|
7800
7800
|
var init_resourceKey = __esm({
|
|
7801
|
-
"
|
|
7801
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/resourceKey.ts"() {
|
|
7802
7802
|
"use strict";
|
|
7803
7803
|
import_js_sha33 = __toESM(require_sha3(), 1);
|
|
7804
7804
|
}
|
|
7805
7805
|
});
|
|
7806
7806
|
|
|
7807
|
-
//
|
|
7807
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/SelectionHelper.ts
|
|
7808
7808
|
var init_SelectionHelper = __esm({
|
|
7809
|
-
"
|
|
7809
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/SelectionHelper.ts"() {
|
|
7810
7810
|
"use strict";
|
|
7811
7811
|
}
|
|
7812
7812
|
});
|
|
7813
7813
|
|
|
7814
|
-
//
|
|
7814
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/setMinus.ts
|
|
7815
7815
|
var init_setMinus = __esm({
|
|
7816
|
-
"
|
|
7816
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/setMinus.ts"() {
|
|
7817
7817
|
"use strict";
|
|
7818
7818
|
}
|
|
7819
7819
|
});
|
|
7820
7820
|
|
|
7821
|
-
//
|
|
7821
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/sha1Hash.ts
|
|
7822
7822
|
var init_sha1Hash = __esm({
|
|
7823
|
-
"
|
|
7823
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/sha1Hash.ts"() {
|
|
7824
7824
|
"use strict";
|
|
7825
7825
|
}
|
|
7826
7826
|
});
|
|
7827
7827
|
|
|
7828
|
-
//
|
|
7828
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/TaskWaiter.ts
|
|
7829
7829
|
var init_TaskWaiter = __esm({
|
|
7830
|
-
"
|
|
7830
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/TaskWaiter.ts"() {
|
|
7831
7831
|
"use strict";
|
|
7832
7832
|
init_src3();
|
|
7833
7833
|
}
|
|
7834
7834
|
});
|
|
7835
7835
|
|
|
7836
|
-
//
|
|
7836
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/toSentenceAnalyze.ts
|
|
7837
7837
|
var init_toSentenceAnalyze = __esm({
|
|
7838
|
-
"
|
|
7838
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/toSentenceAnalyze.ts"() {
|
|
7839
7839
|
"use strict";
|
|
7840
7840
|
}
|
|
7841
7841
|
});
|
|
7842
7842
|
|
|
7843
|
-
//
|
|
7843
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/txtBookToJson.ts
|
|
7844
7844
|
var init_txtBookToJson = __esm({
|
|
7845
|
-
"
|
|
7845
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/txtBookToJson.ts"() {
|
|
7846
7846
|
"use strict";
|
|
7847
7847
|
init_src2();
|
|
7848
7848
|
}
|
|
7849
7849
|
});
|
|
7850
7850
|
|
|
7851
|
-
//
|
|
7851
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/VocabularyMap.ts
|
|
7852
7852
|
var init_VocabularyMap = __esm({
|
|
7853
|
-
"
|
|
7853
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/VocabularyMap.ts"() {
|
|
7854
7854
|
"use strict";
|
|
7855
7855
|
init_Emitter();
|
|
7856
7856
|
}
|
|
7857
7857
|
});
|
|
7858
7858
|
|
|
7859
|
-
//
|
|
7859
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wait.ts
|
|
7860
7860
|
var init_wait = __esm({
|
|
7861
|
-
"
|
|
7861
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wait.ts"() {
|
|
7862
7862
|
"use strict";
|
|
7863
7863
|
}
|
|
7864
7864
|
});
|
|
7865
7865
|
|
|
7866
|
-
//
|
|
7866
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wordCount.ts
|
|
7867
7867
|
var init_wordCount = __esm({
|
|
7868
|
-
"
|
|
7868
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wordCount.ts"() {
|
|
7869
7869
|
"use strict";
|
|
7870
7870
|
}
|
|
7871
7871
|
});
|
|
7872
7872
|
|
|
7873
|
-
//
|
|
7873
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts
|
|
7874
7874
|
var logger, WebsocketHeartbeat;
|
|
7875
7875
|
var init_WebsocketHeartbeat = __esm({
|
|
7876
|
-
"
|
|
7876
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts"() {
|
|
7877
7877
|
"use strict";
|
|
7878
7878
|
init_src();
|
|
7879
7879
|
init_Logger();
|
|
@@ -7914,10 +7914,10 @@ var init_WebsocketHeartbeat = __esm({
|
|
|
7914
7914
|
}
|
|
7915
7915
|
});
|
|
7916
7916
|
|
|
7917
|
-
//
|
|
7917
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClient.ts
|
|
7918
7918
|
var logger2;
|
|
7919
7919
|
var init_WebsocketClient = __esm({
|
|
7920
|
-
"
|
|
7920
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClient.ts"() {
|
|
7921
7921
|
"use strict";
|
|
7922
7922
|
init_src();
|
|
7923
7923
|
init_Emitter();
|
|
@@ -7928,7 +7928,7 @@ var init_WebsocketClient = __esm({
|
|
|
7928
7928
|
}
|
|
7929
7929
|
});
|
|
7930
7930
|
|
|
7931
|
-
//
|
|
7931
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts
|
|
7932
7932
|
function isEventLike(value) {
|
|
7933
7933
|
return typeof value === "object" && value !== null && "type" in value && typeof value.type === "string";
|
|
7934
7934
|
}
|
|
@@ -7937,7 +7937,7 @@ function isCloseEvent(value) {
|
|
|
7937
7937
|
}
|
|
7938
7938
|
var logger3, WebsocketClientV2;
|
|
7939
7939
|
var init_WebsocketClientV2 = __esm({
|
|
7940
|
-
"
|
|
7940
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts"() {
|
|
7941
7941
|
"use strict";
|
|
7942
7942
|
init_src();
|
|
7943
7943
|
init_AsyncStream();
|
|
@@ -8184,10 +8184,10 @@ var init_WebsocketClientV2 = __esm({
|
|
|
8184
8184
|
}
|
|
8185
8185
|
});
|
|
8186
8186
|
|
|
8187
|
-
//
|
|
8187
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/H3Client.ts
|
|
8188
8188
|
var logger4;
|
|
8189
8189
|
var init_H3Client = __esm({
|
|
8190
|
-
"
|
|
8190
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/H3Client.ts"() {
|
|
8191
8191
|
"use strict";
|
|
8192
8192
|
init_Emitter();
|
|
8193
8193
|
init_Logger();
|
|
@@ -8197,9 +8197,9 @@ var init_H3Client = __esm({
|
|
|
8197
8197
|
}
|
|
8198
8198
|
});
|
|
8199
8199
|
|
|
8200
|
-
//
|
|
8200
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/index.ts
|
|
8201
8201
|
var init_websocket = __esm({
|
|
8202
|
-
"
|
|
8202
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/index.ts"() {
|
|
8203
8203
|
"use strict";
|
|
8204
8204
|
init_WebsocketClient();
|
|
8205
8205
|
init_WebsocketClientV2();
|
|
@@ -8207,9 +8207,9 @@ var init_websocket = __esm({
|
|
|
8207
8207
|
}
|
|
8208
8208
|
});
|
|
8209
8209
|
|
|
8210
|
-
//
|
|
8210
|
+
// node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/index.ts
|
|
8211
8211
|
var init_src3 = __esm({
|
|
8212
|
-
"
|
|
8212
|
+
"node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/index.ts"() {
|
|
8213
8213
|
"use strict";
|
|
8214
8214
|
init_base64();
|
|
8215
8215
|
init_batchResolve();
|
|
@@ -8249,23 +8249,23 @@ var init_src3 = __esm({
|
|
|
8249
8249
|
}
|
|
8250
8250
|
});
|
|
8251
8251
|
|
|
8252
|
-
//
|
|
8252
|
+
// node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/AgentClient.js
|
|
8253
8253
|
var init_AgentClient = __esm({
|
|
8254
|
-
"
|
|
8254
|
+
"node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/AgentClient.js"() {
|
|
8255
8255
|
"use strict";
|
|
8256
8256
|
init_src();
|
|
8257
8257
|
init_src3();
|
|
8258
8258
|
}
|
|
8259
8259
|
});
|
|
8260
8260
|
|
|
8261
|
-
//
|
|
8261
|
+
// node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/FunctionService.js
|
|
8262
8262
|
var init_FunctionService = __esm({
|
|
8263
|
-
"
|
|
8263
|
+
"node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/FunctionService.js"() {
|
|
8264
8264
|
"use strict";
|
|
8265
8265
|
}
|
|
8266
8266
|
});
|
|
8267
8267
|
|
|
8268
|
-
//
|
|
8268
|
+
// node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/HubClient.js
|
|
8269
8269
|
function createCallId(functionId) {
|
|
8270
8270
|
return uniqHash(`${functionId}-${Date.now()}-${Math.random()}`, "task-v1" /* Task */);
|
|
8271
8271
|
}
|
|
@@ -8326,7 +8326,7 @@ function withTimeout(promise, timeoutMs, message) {
|
|
|
8326
8326
|
}
|
|
8327
8327
|
var DEFAULT_TIMEOUT_MS, DEFAULT_STREAM_TIMEOUT_MS, HubClient, AsyncCallQueue;
|
|
8328
8328
|
var init_HubClient = __esm({
|
|
8329
|
-
"
|
|
8329
|
+
"node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/HubClient.js"() {
|
|
8330
8330
|
"use strict";
|
|
8331
8331
|
init_src();
|
|
8332
8332
|
init_src3();
|
|
@@ -8746,9 +8746,9 @@ var init_HubClient = __esm({
|
|
|
8746
8746
|
}
|
|
8747
8747
|
});
|
|
8748
8748
|
|
|
8749
|
-
//
|
|
8749
|
+
// node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/index.js
|
|
8750
8750
|
var init_dist2 = __esm({
|
|
8751
|
-
"
|
|
8751
|
+
"node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/index.js"() {
|
|
8752
8752
|
"use strict";
|
|
8753
8753
|
init_AgentClient();
|
|
8754
8754
|
init_FunctionService();
|
|
@@ -8818,8 +8818,8 @@ __export(index_exports, {
|
|
|
8818
8818
|
parseCommandArgs: () => parseCommandArgs
|
|
8819
8819
|
});
|
|
8820
8820
|
module.exports = __toCommonJS(index_exports);
|
|
8821
|
-
var
|
|
8822
|
-
var
|
|
8821
|
+
var import_node_fs27 = require("fs");
|
|
8822
|
+
var import_node_path32 = __toESM(require("path"));
|
|
8823
8823
|
|
|
8824
8824
|
// src/managedSession.ts
|
|
8825
8825
|
var import_node_fs = require("fs");
|
|
@@ -14240,9 +14240,9 @@ ${indent}\`\`\``;
|
|
|
14240
14240
|
static richTextToPlain(richText) {
|
|
14241
14241
|
return richText.map((item) => item.plain_text ?? item.text?.content ?? "").join("").trim();
|
|
14242
14242
|
}
|
|
14243
|
-
static async requestJson(
|
|
14243
|
+
static async requestJson(path32, init) {
|
|
14244
14244
|
const token = this.getToken();
|
|
14245
|
-
const response = await fetch(`${this.baseUrl}${
|
|
14245
|
+
const response = await fetch(`${this.baseUrl}${path32}`, {
|
|
14246
14246
|
method: init.method,
|
|
14247
14247
|
headers: {
|
|
14248
14248
|
Authorization: `Bearer ${token}`,
|
|
@@ -16947,8 +16947,8 @@ function descriptorPathSegments(descriptor) {
|
|
|
16947
16947
|
return ["chains", normalized.chain, "namespaces", normalized.ns, normalized.kind, normalized.name];
|
|
16948
16948
|
}
|
|
16949
16949
|
function buildPathUrl(baseUrl, pathSegments, query) {
|
|
16950
|
-
const
|
|
16951
|
-
const url = new URL(
|
|
16950
|
+
const path32 = `/${pathSegments.map((segment) => encodeURIComponent(segment)).join("/")}`;
|
|
16951
|
+
const url = new URL(path32, baseUrl);
|
|
16952
16952
|
if (query) {
|
|
16953
16953
|
for (const [key, value] of Object.entries(query)) {
|
|
16954
16954
|
url.searchParams.set(key, String(value));
|
|
@@ -17508,15 +17508,130 @@ var StoreCommandHandler = class {
|
|
|
17508
17508
|
}
|
|
17509
17509
|
};
|
|
17510
17510
|
|
|
17511
|
+
// src/electronBuild.ts
|
|
17512
|
+
var import_node_child_process9 = require("child_process");
|
|
17513
|
+
var import_node_crypto4 = require("crypto");
|
|
17514
|
+
var import_node_fs18 = require("fs");
|
|
17515
|
+
var import_node_os9 = require("os");
|
|
17516
|
+
var import_node_path23 = __toESM(require("path"));
|
|
17517
|
+
var ELECTRON_VERSION = "44.5.1";
|
|
17518
|
+
var BUILDER_VERSION = "26.15.3";
|
|
17519
|
+
function readDesktopConfig(file, appId) {
|
|
17520
|
+
const c = JSON.parse((0, import_node_fs18.readFileSync)(file, "utf8"));
|
|
17521
|
+
if (c.schemaVersion !== 1 || c.app !== appId) throw new Error("Desktop config schemaVersion/app mismatch");
|
|
17522
|
+
for (const key of ["productName", "bundleId", "version", "icon"]) {
|
|
17523
|
+
if (typeof c[key] !== "string" || !c[key].trim()) throw new Error(`Missing desktop ${key}`);
|
|
17524
|
+
}
|
|
17525
|
+
if (!/^[a-zA-Z][\w-]*(\.[a-zA-Z][\w-]*)+$/.test(c.bundleId)) throw new Error("Invalid desktop bundleId");
|
|
17526
|
+
if (!/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(c.version)) throw new Error("Invalid desktop version");
|
|
17527
|
+
const origin = (value) => {
|
|
17528
|
+
const url = new URL(value);
|
|
17529
|
+
if (url.protocol !== "https:" || url.origin !== value || url.username || url.password) throw new Error("Desktop origins must be exact HTTPS origins, without paths or credentials");
|
|
17530
|
+
};
|
|
17531
|
+
origin(c.origin);
|
|
17532
|
+
if (!Array.isArray(c.authOrigins)) throw new Error("authOrigins must be an array");
|
|
17533
|
+
c.authOrigins.forEach(origin);
|
|
17534
|
+
if (!c.web || typeof c.web.cwd !== "string" || typeof c.web.dist !== "string" || !c.web.dist.trim() || !Array.isArray(c.web.build) || !c.web.build.length || !c.web.build.every((v) => typeof v === "string" && v.length > 0)) throw new Error("Invalid web build configuration");
|
|
17535
|
+
return c;
|
|
17536
|
+
}
|
|
17537
|
+
function collectStaticFiles(root) {
|
|
17538
|
+
const files = [];
|
|
17539
|
+
const walk = (dir) => {
|
|
17540
|
+
for (const entry of (0, import_node_fs18.readdirSync)(dir, { withFileTypes: true })) {
|
|
17541
|
+
const full = import_node_path23.default.join(dir, entry.name);
|
|
17542
|
+
if (entry.isSymbolicLink()) throw new Error(`Symlinks are not allowed in desktop resources: ${entry.name}`);
|
|
17543
|
+
if (entry.name.startsWith(".") || /\.(?:pem|key|p12|pfx)$/i.test(entry.name) || /bot-key|session\.json/i.test(entry.name)) throw new Error(`Private or hidden file in desktop resources: ${entry.name}`);
|
|
17544
|
+
if (entry.isDirectory()) walk(full);
|
|
17545
|
+
else if (entry.isFile() && !entry.name.endsWith(".map")) files.push(import_node_path23.default.relative(root, full));
|
|
17546
|
+
else if (!entry.isFile()) throw new Error(`Unsupported resource: ${entry.name}`);
|
|
17547
|
+
}
|
|
17548
|
+
};
|
|
17549
|
+
if ((0, import_node_fs18.lstatSync)(root).isSymbolicLink()) throw new Error("Static resource root cannot be a symlink");
|
|
17550
|
+
walk(root);
|
|
17551
|
+
if (!files.includes("index.html")) throw new Error("Web build must produce index.html");
|
|
17552
|
+
return files.sort();
|
|
17553
|
+
}
|
|
17554
|
+
async function runBuildCommand(command, cwd, env = process.env) {
|
|
17555
|
+
await new Promise((resolve, reject) => {
|
|
17556
|
+
const child = (0, import_node_child_process9.spawn)(command[0], command.slice(1), { cwd, env, stdio: "inherit", shell: false });
|
|
17557
|
+
child.once("error", reject);
|
|
17558
|
+
child.once("exit", (code, signal) => code === 0 ? resolve() : reject(new Error(`${command[0]} failed (${signal ?? code})`)));
|
|
17559
|
+
});
|
|
17560
|
+
}
|
|
17561
|
+
async function buildDesktop(args) {
|
|
17562
|
+
const file = import_node_path23.default.resolve(args.config);
|
|
17563
|
+
const c = readDesktopConfig(file, args.id);
|
|
17564
|
+
const base = import_node_path23.default.dirname(file);
|
|
17565
|
+
const cwd = import_node_path23.default.resolve(base, c.web.cwd);
|
|
17566
|
+
const dist = import_node_path23.default.resolve(cwd, c.web.dist);
|
|
17567
|
+
const icon = import_node_path23.default.resolve(base, c.icon);
|
|
17568
|
+
const output = import_node_path23.default.resolve(args.outDir);
|
|
17569
|
+
if (!(0, import_node_fs18.existsSync)(icon) || !(0, import_node_fs18.statSync)(icon).isFile()) throw new Error(`Desktop icon not found: ${icon}`);
|
|
17570
|
+
if (args.platform !== "mac" || !["arm64", "x64"].includes(args.arch)) throw new Error("This release supports mac --arch arm64|x64; Windows/Linux are not yet supported");
|
|
17571
|
+
if (process.platform !== "darwin") throw new Error("macOS desktop packaging requires a macOS build host");
|
|
17572
|
+
const within = (parent, child) => {
|
|
17573
|
+
const rel = import_node_path23.default.relative(parent, child);
|
|
17574
|
+
return !rel || !rel.startsWith("..") && !import_node_path23.default.isAbsolute(rel);
|
|
17575
|
+
};
|
|
17576
|
+
if (within(dist, cwd) || within(dist, output) || within(output, cwd)) throw new Error("Build output, web source and static resource paths overlap");
|
|
17577
|
+
const plan = { app: c.app, productName: c.productName, version: c.version, target: args.platform, arch: args.arch, command: c.web.build, cwd, dist, output, electron: ELECTRON_VERSION, builder: BUILDER_VERSION, signed: args.signed };
|
|
17578
|
+
console.log(JSON.stringify({ phase: "plan", ...plan }, null, 2));
|
|
17579
|
+
if (args.dryRun) return;
|
|
17580
|
+
const started = Date.now();
|
|
17581
|
+
await runBuildCommand(c.web.build, cwd);
|
|
17582
|
+
if (!(0, import_node_fs18.existsSync)(import_node_path23.default.join(dist, "index.html")) || (0, import_node_fs18.statSync)(import_node_path23.default.join(dist, "index.html")).mtimeMs < started - 1e3) throw new Error("Build did not produce a fresh index.html; refusing stale resources");
|
|
17583
|
+
const files = collectStaticFiles(dist);
|
|
17584
|
+
(0, import_node_fs18.mkdirSync)(output, { recursive: true });
|
|
17585
|
+
const staging = (0, import_node_fs18.mkdtempSync)(import_node_path23.default.join(output, ".desktop-build-"));
|
|
17586
|
+
const appDir = import_node_path23.default.join(staging, "app");
|
|
17587
|
+
(0, import_node_fs18.mkdirSync)(import_node_path23.default.join(appDir, "renderer"), { recursive: true });
|
|
17588
|
+
const manifest = {};
|
|
17589
|
+
for (const name of files) {
|
|
17590
|
+
const source = import_node_path23.default.join(dist, name), target = import_node_path23.default.join(appDir, "renderer", name);
|
|
17591
|
+
(0, import_node_fs18.mkdirSync)(import_node_path23.default.dirname(target), { recursive: true });
|
|
17592
|
+
(0, import_node_fs18.cpSync)(source, target);
|
|
17593
|
+
manifest[name] = (0, import_node_crypto4.createHash)("sha256").update((0, import_node_fs18.readFileSync)(source)).digest("hex");
|
|
17594
|
+
}
|
|
17595
|
+
const templateDir = import_node_path23.default.join(__dirname, "templates", "electron");
|
|
17596
|
+
(0, import_node_fs18.cpSync)(templateDir, appDir, { recursive: true });
|
|
17597
|
+
(0, import_node_fs18.writeFileSync)(import_node_path23.default.join(appDir, "desktop-config.json"), JSON.stringify({ app: c.app, productName: c.productName, origin: c.origin, authOrigins: c.authOrigins, bundleId: c.bundleId }));
|
|
17598
|
+
(0, import_node_fs18.writeFileSync)(import_node_path23.default.join(appDir, "resource-manifest.json"), JSON.stringify(manifest, null, 2));
|
|
17599
|
+
(0, import_node_fs18.writeFileSync)(import_node_path23.default.join(appDir, "package.json"), JSON.stringify({ name: c.bundleId.replace(/\./g, "-"), version: c.version, description: `${c.productName} desktop application`, author: "PMate", main: "main.cjs" }));
|
|
17600
|
+
const cache = import_node_path23.default.join((0, import_node_os9.homedir)(), ".cache", "pmate", "electron", `${ELECTRON_VERSION}-${BUILDER_VERSION}`);
|
|
17601
|
+
(0, import_node_fs18.mkdirSync)(cache, { recursive: true });
|
|
17602
|
+
const toolPackage = { name: "pmate-desktop-toolchain", private: true, dependencies: { electron: ELECTRON_VERSION, "electron-builder": BUILDER_VERSION } };
|
|
17603
|
+
if (!(0, import_node_fs18.existsSync)(import_node_path23.default.join(cache, "node_modules", "electron", "dist", "Electron.app")) || !(0, import_node_fs18.existsSync)(import_node_path23.default.join(cache, "node_modules", "electron-builder", "cli.js"))) {
|
|
17604
|
+
(0, import_node_fs18.writeFileSync)(import_node_path23.default.join(cache, "package.json"), JSON.stringify(toolPackage));
|
|
17605
|
+
await runBuildCommand(["npm", (0, import_node_fs18.existsSync)(import_node_path23.default.join(cache, "package-lock.json")) ? "ci" : "install", "--no-audit", "--no-fund"], cache);
|
|
17606
|
+
}
|
|
17607
|
+
const builderConfig = {
|
|
17608
|
+
appId: c.bundleId,
|
|
17609
|
+
productName: c.productName,
|
|
17610
|
+
electronVersion: ELECTRON_VERSION,
|
|
17611
|
+
directories: { app: appDir, output: import_node_path23.default.join(staging, "artifacts") },
|
|
17612
|
+
files: ["**/*"],
|
|
17613
|
+
asar: true,
|
|
17614
|
+
artifactName: "${productName}-${version}-${arch}.${ext}",
|
|
17615
|
+
mac: { icon, target: args.dir ? ["dir"] : ["dmg", "zip"], category: "public.app-category.social-networking", hardenedRuntime: args.signed, extendInfo: { NSMicrophoneUsageDescription: `${c.productName} uses your microphone only when you record a voice message.` }, ...args.signed ? {} : { identity: "-", notarize: false } },
|
|
17616
|
+
forceCodeSigning: args.signed
|
|
17617
|
+
};
|
|
17618
|
+
const configPath = import_node_path23.default.join(staging, "builder.json");
|
|
17619
|
+
(0, import_node_fs18.writeFileSync)(configPath, JSON.stringify(builderConfig));
|
|
17620
|
+
await runBuildCommand([process.execPath, import_node_path23.default.join(cache, "node_modules", "electron-builder", "cli.js"), "--config", configPath, "--mac", `--${args.arch}`, "--publish", "never"], appDir, { ...process.env, ...args.signed ? {} : { CSC_IDENTITY_AUTO_DISCOVERY: "false" } });
|
|
17621
|
+
const result = { ...plan, signature: args.signed ? "configured-signing-required; verify notarization before distribution" : "ad-hoc; local development", artifacts: import_node_path23.default.join(staging, "artifacts"), resources: manifest };
|
|
17622
|
+
(0, import_node_fs18.writeFileSync)(import_node_path23.default.join(staging, "build-report.json"), JSON.stringify(result, null, 2));
|
|
17623
|
+
console.log(JSON.stringify({ phase: "complete", report: import_node_path23.default.join(staging, "build-report.json"), artifacts: result.artifacts, signature: result.signature }, null, 2));
|
|
17624
|
+
}
|
|
17625
|
+
|
|
17511
17626
|
// src/commands/AppCommandHandler.ts
|
|
17512
|
-
var
|
|
17513
|
-
var
|
|
17627
|
+
var import_node_fs20 = require("fs");
|
|
17628
|
+
var import_node_path25 = __toESM(require("path"));
|
|
17514
17629
|
init_sessionStore();
|
|
17515
17630
|
|
|
17516
17631
|
// src/appIcon.ts
|
|
17517
|
-
var
|
|
17518
|
-
var
|
|
17519
|
-
var
|
|
17632
|
+
var import_node_fs19 = require("fs");
|
|
17633
|
+
var import_node_os10 = __toESM(require("os"));
|
|
17634
|
+
var import_node_path24 = __toESM(require("path"));
|
|
17520
17635
|
var import_sharp = __toESM(require("sharp"));
|
|
17521
17636
|
init_namespacedRef();
|
|
17522
17637
|
var ANDROID_ICON_SPECS = [
|
|
@@ -17621,13 +17736,13 @@ function createAppIconExportPlans(input) {
|
|
|
17621
17736
|
if (!input.outDir) {
|
|
17622
17737
|
throw new Error("App icon preset export requires --out-dir.");
|
|
17623
17738
|
}
|
|
17624
|
-
const outDir =
|
|
17625
|
-
(0,
|
|
17739
|
+
const outDir = import_node_path24.default.resolve(input.cwd, input.outDir);
|
|
17740
|
+
(0, import_node_fs19.mkdirSync)(outDir, { recursive: true });
|
|
17626
17741
|
return specs.map((spec) => ({
|
|
17627
17742
|
width: spec.width,
|
|
17628
17743
|
height: spec.height,
|
|
17629
17744
|
format: "png",
|
|
17630
|
-
outputPath:
|
|
17745
|
+
outputPath: import_node_path24.default.join(
|
|
17631
17746
|
outDir,
|
|
17632
17747
|
`${namespace}-${objectId}-${spec.name}-${spec.width}x${spec.height}.png`
|
|
17633
17748
|
)
|
|
@@ -17640,8 +17755,8 @@ function createAppIconExportPlans(input) {
|
|
|
17640
17755
|
if (!input.output) {
|
|
17641
17756
|
throw new Error("Single-size app icon export requires --output.");
|
|
17642
17757
|
}
|
|
17643
|
-
const resolvedOutput =
|
|
17644
|
-
(0,
|
|
17758
|
+
const resolvedOutput = import_node_path24.default.resolve(input.cwd, input.output);
|
|
17759
|
+
(0, import_node_fs19.mkdirSync)(import_node_path24.default.dirname(resolvedOutput), { recursive: true });
|
|
17645
17760
|
return [
|
|
17646
17761
|
{
|
|
17647
17762
|
width: input.width,
|
|
@@ -17655,7 +17770,7 @@ async function exportAppIcon(icon, plans) {
|
|
|
17655
17770
|
const svg = await resolveAppIconSvg(icon);
|
|
17656
17771
|
for (const plan of plans) {
|
|
17657
17772
|
const bytes = await renderAppIcon(svg, plan.width, plan.height, plan.format);
|
|
17658
|
-
(0,
|
|
17773
|
+
(0, import_node_fs19.writeFileSync)(plan.outputPath, bytes);
|
|
17659
17774
|
}
|
|
17660
17775
|
}
|
|
17661
17776
|
async function renderAppIconVariant(input) {
|
|
@@ -17663,9 +17778,9 @@ async function renderAppIconVariant(input) {
|
|
|
17663
17778
|
const bytes = await renderAppIcon(svg, input.width, input.height, input.format);
|
|
17664
17779
|
let outputPath;
|
|
17665
17780
|
if (input.output) {
|
|
17666
|
-
outputPath =
|
|
17667
|
-
(0,
|
|
17668
|
-
(0,
|
|
17781
|
+
outputPath = import_node_path24.default.resolve(input.cwd, input.output);
|
|
17782
|
+
(0, import_node_fs19.mkdirSync)(import_node_path24.default.dirname(outputPath), { recursive: true });
|
|
17783
|
+
(0, import_node_fs19.writeFileSync)(outputPath, bytes);
|
|
17669
17784
|
}
|
|
17670
17785
|
if (input.name) {
|
|
17671
17786
|
return {
|
|
@@ -17686,7 +17801,7 @@ async function renderAppIconVariant(input) {
|
|
|
17686
17801
|
};
|
|
17687
17802
|
}
|
|
17688
17803
|
async function loadAppIconVariantFile(input) {
|
|
17689
|
-
const absolutePath =
|
|
17804
|
+
const absolutePath = import_node_path24.default.resolve(input.cwd, input.filePath);
|
|
17690
17805
|
const format = inferVariantFormatFromPath(absolutePath);
|
|
17691
17806
|
return {
|
|
17692
17807
|
value: input.name ? await uploadAppIconVariantAsset({
|
|
@@ -17695,7 +17810,7 @@ async function loadAppIconVariantFile(input) {
|
|
|
17695
17810
|
name: input.name,
|
|
17696
17811
|
format,
|
|
17697
17812
|
sourcePath: absolutePath
|
|
17698
|
-
}) : createImageDataUrl((0,
|
|
17813
|
+
}) : createImageDataUrl((0, import_node_fs19.readFileSync)(absolutePath), format),
|
|
17699
17814
|
format,
|
|
17700
17815
|
absolutePath
|
|
17701
17816
|
};
|
|
@@ -17754,7 +17869,7 @@ function shouldAutoGenerateDefaultVariant(icon) {
|
|
|
17754
17869
|
return looksLikeSvgMarkup(icon) || looksLikeSvgUrl(icon);
|
|
17755
17870
|
}
|
|
17756
17871
|
function inferVariantFormatFromPath(filePath) {
|
|
17757
|
-
const ext =
|
|
17872
|
+
const ext = import_node_path24.default.extname(filePath).toLowerCase();
|
|
17758
17873
|
switch (ext) {
|
|
17759
17874
|
case ".png":
|
|
17760
17875
|
return "png";
|
|
@@ -17825,13 +17940,13 @@ async function uploadAppIconVariantAsset(input) {
|
|
|
17825
17940
|
await AliyunService.uploadFile(sourcePath, DEFAULT_APP_ICON_VARIANT_BUCKET, objectKey);
|
|
17826
17941
|
} finally {
|
|
17827
17942
|
if (shouldCleanup) {
|
|
17828
|
-
(0,
|
|
17943
|
+
(0, import_node_fs19.rmSync)(import_node_path24.default.dirname(sourcePath), { recursive: true, force: true });
|
|
17829
17944
|
}
|
|
17830
17945
|
}
|
|
17831
17946
|
return `${DEFAULT_APP_ICON_VARIANT_PUBLIC_BASE_URL}/${objectKey}`;
|
|
17832
17947
|
}
|
|
17833
17948
|
function buildAppIconVariantObjectKey(input) {
|
|
17834
|
-
return
|
|
17949
|
+
return import_node_path24.default.posix.join(
|
|
17835
17950
|
"apps",
|
|
17836
17951
|
`${resolveAppIconAssetStem(input.icon, input.appRef)}-${input.name}.${extensionForIconFormat(input.format)}`
|
|
17837
17952
|
);
|
|
@@ -17840,8 +17955,8 @@ function resolveAppIconAssetStem(icon, appRef2) {
|
|
|
17840
17955
|
if (icon) {
|
|
17841
17956
|
try {
|
|
17842
17957
|
const url = new URL(icon);
|
|
17843
|
-
const ext =
|
|
17844
|
-
const basename =
|
|
17958
|
+
const ext = import_node_path24.default.posix.extname(url.pathname);
|
|
17959
|
+
const basename = import_node_path24.default.posix.basename(url.pathname, ext);
|
|
17845
17960
|
const normalized = sanitizeAppIconAssetStem(basename);
|
|
17846
17961
|
if (normalized) {
|
|
17847
17962
|
return normalized;
|
|
@@ -17870,9 +17985,9 @@ function writeTempAppIconVariantFile(objectKey, format, bytes) {
|
|
|
17870
17985
|
if (!bytes) {
|
|
17871
17986
|
throw new Error("App icon variant upload requires bytes or a source file.");
|
|
17872
17987
|
}
|
|
17873
|
-
const tempDir = (0,
|
|
17874
|
-
const tempPath =
|
|
17875
|
-
(0,
|
|
17988
|
+
const tempDir = (0, import_node_fs19.mkdtempSync)(import_node_path24.default.join(import_node_os10.default.tmpdir(), "pmate-app-icon-"));
|
|
17989
|
+
const tempPath = import_node_path24.default.join(tempDir, import_node_path24.default.basename(objectKey) || `variant.${extensionForIconFormat(format)}`);
|
|
17990
|
+
(0, import_node_fs19.writeFileSync)(tempPath, bytes);
|
|
17876
17991
|
return tempPath;
|
|
17877
17992
|
}
|
|
17878
17993
|
|
|
@@ -17880,6 +17995,7 @@ function writeTempAppIconVariantFile(objectKey, format, bytes) {
|
|
|
17880
17995
|
init_namespacedRef();
|
|
17881
17996
|
var AppCommandHandler = class {
|
|
17882
17997
|
async handle(args) {
|
|
17998
|
+
if (args.action === "build") return buildDesktop(args);
|
|
17883
17999
|
const token = this.readToken();
|
|
17884
18000
|
const baseUrl = this.resolveBaseUrl(args.baseUrl);
|
|
17885
18001
|
switch (args.action) {
|
|
@@ -18081,10 +18197,10 @@ var AppCommandHandler = class {
|
|
|
18081
18197
|
}
|
|
18082
18198
|
readJsonFile(filePath) {
|
|
18083
18199
|
const absolutePath = this.resolveFilePath(filePath);
|
|
18084
|
-
if (!(0,
|
|
18200
|
+
if (!(0, import_node_fs20.existsSync)(absolutePath)) {
|
|
18085
18201
|
throw new Error(`JSON file not found: ${absolutePath}`);
|
|
18086
18202
|
}
|
|
18087
|
-
const raw = (0,
|
|
18203
|
+
const raw = (0, import_node_fs20.readFileSync)(absolutePath, "utf8");
|
|
18088
18204
|
try {
|
|
18089
18205
|
return JSON.parse(raw);
|
|
18090
18206
|
} catch (error) {
|
|
@@ -18094,10 +18210,10 @@ var AppCommandHandler = class {
|
|
|
18094
18210
|
}
|
|
18095
18211
|
async preparePayload(filePath, appRef2) {
|
|
18096
18212
|
const absolutePath = this.resolveFilePath(filePath);
|
|
18097
|
-
return prepareAppPayload(this.readJsonFile(filePath),
|
|
18213
|
+
return prepareAppPayload(this.readJsonFile(filePath), import_node_path25.default.dirname(absolutePath), { appRef: appRef2 });
|
|
18098
18214
|
}
|
|
18099
18215
|
resolveFilePath(filePath) {
|
|
18100
|
-
return
|
|
18216
|
+
return import_node_path25.default.resolve(process.cwd(), filePath);
|
|
18101
18217
|
}
|
|
18102
18218
|
async request(baseUrl, token, method, pathname, body) {
|
|
18103
18219
|
const response = await fetch(`${baseUrl}${pathname}`, {
|
|
@@ -18217,18 +18333,18 @@ function readNamespaceFromPayload(payload) {
|
|
|
18217
18333
|
}
|
|
18218
18334
|
|
|
18219
18335
|
// src/commands/ServiceCommandHandler.ts
|
|
18220
|
-
var
|
|
18336
|
+
var import_node_fs23 = require("fs");
|
|
18221
18337
|
var import_promises5 = require("fs/promises");
|
|
18222
|
-
var
|
|
18223
|
-
var
|
|
18338
|
+
var import_node_path28 = __toESM(require("path"));
|
|
18339
|
+
var import_node_child_process12 = require("child_process");
|
|
18224
18340
|
var import_promises6 = require("readline/promises");
|
|
18225
18341
|
|
|
18226
18342
|
// src/services/AndroidApkReleaseService.ts
|
|
18227
|
-
var
|
|
18228
|
-
var
|
|
18229
|
-
var
|
|
18230
|
-
var
|
|
18231
|
-
var
|
|
18343
|
+
var import_node_child_process10 = require("child_process");
|
|
18344
|
+
var import_node_crypto5 = require("crypto");
|
|
18345
|
+
var import_node_fs21 = require("fs");
|
|
18346
|
+
var import_node_os11 = __toESM(require("os"));
|
|
18347
|
+
var import_node_path26 = __toESM(require("path"));
|
|
18232
18348
|
var ANDROID_APK_BUCKET = "parrot-static";
|
|
18233
18349
|
var ANDROID_APK_PUBLIC_BASE_URL = "https://parrot-static.pmate.chat";
|
|
18234
18350
|
var AndroidApkReleaseService = class {
|
|
@@ -18262,7 +18378,7 @@ var AndroidApkReleaseService = class {
|
|
|
18262
18378
|
}
|
|
18263
18379
|
await AliyunService.uploadFile(apkPath, ANDROID_APK_BUCKET, objectKey);
|
|
18264
18380
|
const sha256 = await sha256File(apkPath);
|
|
18265
|
-
const size = (0,
|
|
18381
|
+
const size = (0, import_node_fs21.statSync)(apkPath).size;
|
|
18266
18382
|
const artifact = {
|
|
18267
18383
|
serviceId: service.id,
|
|
18268
18384
|
env: options.env,
|
|
@@ -18296,15 +18412,15 @@ var AndroidApkReleaseService = class {
|
|
|
18296
18412
|
minimumVersionCode: options.minimumVersionCode
|
|
18297
18413
|
});
|
|
18298
18414
|
const objectKey = buildAndroidLatestManifestObjectKey(service.namespace, service.name);
|
|
18299
|
-
const tempDir = (0,
|
|
18300
|
-
const manifestPath =
|
|
18415
|
+
const tempDir = (0, import_node_fs21.mkdtempSync)(import_node_path26.default.join(import_node_os11.default.tmpdir(), "pmate-apk-latest-"));
|
|
18416
|
+
const manifestPath = import_node_path26.default.join(tempDir, "latest.json");
|
|
18301
18417
|
try {
|
|
18302
|
-
(0,
|
|
18418
|
+
(0, import_node_fs21.writeFileSync)(manifestPath, `${JSON.stringify(manifest, null, 2)}
|
|
18303
18419
|
`);
|
|
18304
18420
|
await AliyunService.uploadFile(manifestPath, ANDROID_APK_BUCKET, objectKey);
|
|
18305
18421
|
ui.success(`Published Android update manifest ${ANDROID_APK_PUBLIC_BASE_URL}/${objectKey}`);
|
|
18306
18422
|
} finally {
|
|
18307
|
-
(0,
|
|
18423
|
+
(0, import_node_fs21.rmSync)(tempDir, { recursive: true, force: true });
|
|
18308
18424
|
}
|
|
18309
18425
|
}
|
|
18310
18426
|
async list(service, options) {
|
|
@@ -18320,7 +18436,7 @@ var AndroidApkReleaseService = class {
|
|
|
18320
18436
|
const prefix = `apks/${service.namespace}/${service.name}`;
|
|
18321
18437
|
const objects = await AliyunService.listObjects(ANDROID_APK_BUCKET, prefix);
|
|
18322
18438
|
return objects.filter((item) => item.name.endsWith(".apk")).map((item) => {
|
|
18323
|
-
const versionName =
|
|
18439
|
+
const versionName = import_node_path26.default.basename(item.name, ".apk");
|
|
18324
18440
|
return {
|
|
18325
18441
|
serviceId,
|
|
18326
18442
|
env: options.env ?? "unknown",
|
|
@@ -18343,7 +18459,7 @@ var AndroidApkReleaseService = class {
|
|
|
18343
18459
|
}
|
|
18344
18460
|
}
|
|
18345
18461
|
resolveRepoRoot(service, cwd) {
|
|
18346
|
-
if (cwd) return
|
|
18462
|
+
if (cwd) return import_node_path26.default.resolve(process.cwd(), cwd);
|
|
18347
18463
|
const repository = this.getRepository(service);
|
|
18348
18464
|
if (repository) {
|
|
18349
18465
|
return resolveRepositoryLocalRoot(repository);
|
|
@@ -18355,8 +18471,8 @@ var AndroidApkReleaseService = class {
|
|
|
18355
18471
|
if (!dir) {
|
|
18356
18472
|
throw new Error(`Missing dir for android service ${service.id}`);
|
|
18357
18473
|
}
|
|
18358
|
-
const appDir =
|
|
18359
|
-
if (!(0,
|
|
18474
|
+
const appDir = import_node_path26.default.resolve(repoRoot, dir);
|
|
18475
|
+
if (!(0, import_node_fs21.existsSync)(appDir)) {
|
|
18360
18476
|
throw new Error(`Android app dir not found: ${appDir}`);
|
|
18361
18477
|
}
|
|
18362
18478
|
return appDir;
|
|
@@ -18372,11 +18488,11 @@ var AndroidApkReleaseService = class {
|
|
|
18372
18488
|
return void 0;
|
|
18373
18489
|
}
|
|
18374
18490
|
async runGradleAssembleAndFindApk(repoRoot, appDir, variant) {
|
|
18375
|
-
const gradlew = [
|
|
18491
|
+
const gradlew = [import_node_path26.default.join(appDir, "gradlew"), import_node_path26.default.join(repoRoot, "gradlew")].find((candidate) => (0, import_node_fs21.existsSync)(candidate));
|
|
18376
18492
|
if (!gradlew) {
|
|
18377
18493
|
throw new Error(`Gradle wrapper not found in ${appDir} or ${repoRoot}`);
|
|
18378
18494
|
}
|
|
18379
|
-
const gradleCwd =
|
|
18495
|
+
const gradleCwd = import_node_path26.default.dirname(gradlew);
|
|
18380
18496
|
const normalizedVariant = variant.toLowerCase();
|
|
18381
18497
|
const taskSuffix = `assemble${capitalize(normalizedVariant)}`;
|
|
18382
18498
|
const tasks = [`:app:${taskSuffix}`, taskSuffix];
|
|
@@ -18464,7 +18580,7 @@ function resolveRepositoryLocalRoot(repository) {
|
|
|
18464
18580
|
if (!repoName) {
|
|
18465
18581
|
throw new Error(`Invalid repository: ${repository}`);
|
|
18466
18582
|
}
|
|
18467
|
-
return
|
|
18583
|
+
return import_node_path26.default.join(import_node_os11.default.homedir(), "dev", "pmate", repoName);
|
|
18468
18584
|
}
|
|
18469
18585
|
function bumpAndroidGradleVersionText(source, bump) {
|
|
18470
18586
|
const versionNameMatch = source.match(/(^\s*versionName\s+["'])([^"']+)(["']\s*$)/m) ?? source.match(/(^\s*versionName\s*=\s*["'])([^"']+)(["']\s*$)/m);
|
|
@@ -18520,46 +18636,46 @@ function parseGradleOutputMetadata(source, apkFileName) {
|
|
|
18520
18636
|
}
|
|
18521
18637
|
function bumpAndroidProjectVersion(appDir, bump) {
|
|
18522
18638
|
const candidates = [
|
|
18523
|
-
|
|
18524
|
-
|
|
18525
|
-
|
|
18526
|
-
|
|
18639
|
+
import_node_path26.default.join(appDir, "app", "build.gradle.kts"),
|
|
18640
|
+
import_node_path26.default.join(appDir, "app", "build.gradle"),
|
|
18641
|
+
import_node_path26.default.join(appDir, "build.gradle.kts"),
|
|
18642
|
+
import_node_path26.default.join(appDir, "build.gradle")
|
|
18527
18643
|
];
|
|
18528
18644
|
for (const candidate of candidates) {
|
|
18529
|
-
if (!(0,
|
|
18530
|
-
const result = bumpAndroidGradleVersionText((0,
|
|
18531
|
-
(0,
|
|
18645
|
+
if (!(0, import_node_fs21.existsSync)(candidate)) continue;
|
|
18646
|
+
const result = bumpAndroidGradleVersionText((0, import_node_fs21.readFileSync)(candidate, "utf8"), bump);
|
|
18647
|
+
(0, import_node_fs21.writeFileSync)(candidate, result.source);
|
|
18532
18648
|
return { filePath: candidate, ...result };
|
|
18533
18649
|
}
|
|
18534
18650
|
throw new Error(`No Android Gradle version file found under ${appDir}`);
|
|
18535
18651
|
}
|
|
18536
18652
|
function findLatestApk(repoRoot, appDir, variant) {
|
|
18537
18653
|
const dirs = [
|
|
18538
|
-
|
|
18539
|
-
|
|
18540
|
-
|
|
18654
|
+
import_node_path26.default.join(appDir, "app", "build", "outputs", "apk", variant),
|
|
18655
|
+
import_node_path26.default.join(appDir, "build", "outputs", "apk", variant),
|
|
18656
|
+
import_node_path26.default.join(repoRoot, "app", "build", "outputs", "apk", variant)
|
|
18541
18657
|
];
|
|
18542
18658
|
const files = dirs.flatMap((dir) => listApks(dir));
|
|
18543
18659
|
if (files.length === 0) {
|
|
18544
18660
|
throw new Error(`Cannot find APK output for variant ${variant}`);
|
|
18545
18661
|
}
|
|
18546
|
-
files.sort((a, b) => (0,
|
|
18662
|
+
files.sort((a, b) => (0, import_node_fs21.statSync)(b).mtimeMs - (0, import_node_fs21.statSync)(a).mtimeMs);
|
|
18547
18663
|
return files[0];
|
|
18548
18664
|
}
|
|
18549
18665
|
function readGradleOutputMetadata(apkPath) {
|
|
18550
|
-
const metadataPath =
|
|
18551
|
-
if (!(0,
|
|
18666
|
+
const metadataPath = import_node_path26.default.join(import_node_path26.default.dirname(apkPath), "output-metadata.json");
|
|
18667
|
+
if (!(0, import_node_fs21.existsSync)(metadataPath)) {
|
|
18552
18668
|
throw new Error(`Gradle output metadata not found: ${metadataPath}`);
|
|
18553
18669
|
}
|
|
18554
|
-
return parseGradleOutputMetadata((0,
|
|
18670
|
+
return parseGradleOutputMetadata((0, import_node_fs21.readFileSync)(metadataPath, "utf8"), import_node_path26.default.basename(apkPath));
|
|
18555
18671
|
}
|
|
18556
18672
|
function listApks(dir) {
|
|
18557
|
-
if (!(0,
|
|
18558
|
-
return (0,
|
|
18673
|
+
if (!(0, import_node_fs21.existsSync)(dir)) return [];
|
|
18674
|
+
return (0, import_node_fs21.readdirSync)(dir).filter((entry) => entry.endsWith(".apk")).map((entry) => import_node_path26.default.join(dir, entry)).filter((entry) => (0, import_node_fs21.statSync)(entry).isFile());
|
|
18559
18675
|
}
|
|
18560
18676
|
function runCommand(command, args, cwd) {
|
|
18561
18677
|
return new Promise((resolve, reject) => {
|
|
18562
|
-
const child = (0,
|
|
18678
|
+
const child = (0, import_node_child_process10.spawn)(command, args, { cwd, stdio: "inherit" });
|
|
18563
18679
|
child.on("error", reject);
|
|
18564
18680
|
child.on("close", (code) => {
|
|
18565
18681
|
if (code === 0) resolve();
|
|
@@ -18569,7 +18685,7 @@ function runCommand(command, args, cwd) {
|
|
|
18569
18685
|
}
|
|
18570
18686
|
function runCommandCapture(command, args, cwd) {
|
|
18571
18687
|
return new Promise((resolve, reject) => {
|
|
18572
|
-
const child = (0,
|
|
18688
|
+
const child = (0, import_node_child_process10.spawn)(command, args, { cwd, stdio: ["ignore", "pipe", "pipe"] });
|
|
18573
18689
|
const chunks = [];
|
|
18574
18690
|
const errorChunks = [];
|
|
18575
18691
|
child.stdout?.on("data", (chunk) => chunks.push(Buffer.from(chunk)));
|
|
@@ -18589,26 +18705,26 @@ async function runAndroidSdkToolCapture(toolName, args) {
|
|
|
18589
18705
|
return runCommandCapture(toolPath, args);
|
|
18590
18706
|
}
|
|
18591
18707
|
function findAndroidSdkTool(toolName) {
|
|
18592
|
-
const sdkRoots = [process.env.ANDROID_HOME, process.env.ANDROID_SDK_ROOT].filter((item) => Boolean(item)).map((item) =>
|
|
18708
|
+
const sdkRoots = [process.env.ANDROID_HOME, process.env.ANDROID_SDK_ROOT].filter((item) => Boolean(item)).map((item) => import_node_path26.default.resolve(item));
|
|
18593
18709
|
for (const sdkRoot of sdkRoots) {
|
|
18594
|
-
const candidates = toolName === "aapt" ? listVersionedToolCandidates(
|
|
18595
|
-
|
|
18596
|
-
...listVersionedToolCandidates(
|
|
18597
|
-
|
|
18710
|
+
const candidates = toolName === "aapt" ? listVersionedToolCandidates(import_node_path26.default.join(sdkRoot, "build-tools"), toolName) : [
|
|
18711
|
+
import_node_path26.default.join(sdkRoot, "cmdline-tools", "latest", "bin", toolName),
|
|
18712
|
+
...listVersionedToolCandidates(import_node_path26.default.join(sdkRoot, "cmdline-tools"), import_node_path26.default.join("bin", toolName)),
|
|
18713
|
+
import_node_path26.default.join(sdkRoot, "tools", "bin", toolName)
|
|
18598
18714
|
];
|
|
18599
|
-
const match = candidates.find((candidate) => (0,
|
|
18715
|
+
const match = candidates.find((candidate) => (0, import_node_fs21.existsSync)(candidate));
|
|
18600
18716
|
if (match) return match;
|
|
18601
18717
|
}
|
|
18602
18718
|
return void 0;
|
|
18603
18719
|
}
|
|
18604
18720
|
function listVersionedToolCandidates(parentDir, relativeToolPath) {
|
|
18605
|
-
if (!(0,
|
|
18606
|
-
return (0,
|
|
18721
|
+
if (!(0, import_node_fs21.existsSync)(parentDir)) return [];
|
|
18722
|
+
return (0, import_node_fs21.readdirSync)(parentDir).map((entry) => import_node_path26.default.join(parentDir, entry)).filter((entry) => (0, import_node_fs21.statSync)(entry).isDirectory()).sort((a, b) => import_node_path26.default.basename(b).localeCompare(import_node_path26.default.basename(a), void 0, { numeric: true })).map((entry) => import_node_path26.default.join(entry, relativeToolPath));
|
|
18607
18723
|
}
|
|
18608
18724
|
function sha256File(filePath) {
|
|
18609
18725
|
return new Promise((resolve, reject) => {
|
|
18610
|
-
const hash = (0,
|
|
18611
|
-
const stream = (0,
|
|
18726
|
+
const hash = (0, import_node_crypto5.createHash)("sha256");
|
|
18727
|
+
const stream = (0, import_node_fs21.createReadStream)(filePath);
|
|
18612
18728
|
stream.on("data", (chunk) => hash.update(chunk));
|
|
18613
18729
|
stream.on("error", reject);
|
|
18614
18730
|
stream.on("end", () => resolve(hash.digest("hex")));
|
|
@@ -18625,10 +18741,10 @@ function capitalize(value) {
|
|
|
18625
18741
|
}
|
|
18626
18742
|
|
|
18627
18743
|
// src/services/ServiceRuntimeRunner.ts
|
|
18628
|
-
var
|
|
18629
|
-
var
|
|
18630
|
-
var
|
|
18631
|
-
var
|
|
18744
|
+
var import_node_fs22 = require("fs");
|
|
18745
|
+
var import_node_os12 = __toESM(require("os"));
|
|
18746
|
+
var import_node_path27 = __toESM(require("path"));
|
|
18747
|
+
var import_node_child_process11 = require("child_process");
|
|
18632
18748
|
var import_node_readline = require("readline");
|
|
18633
18749
|
var import_chalk3 = __toESM(require("chalk"));
|
|
18634
18750
|
var import_dotenv = require("dotenv");
|
|
@@ -19120,14 +19236,14 @@ var ServiceRuntimeRunner = class {
|
|
|
19120
19236
|
}
|
|
19121
19237
|
resolveRepoRoot(service, cwd) {
|
|
19122
19238
|
if (cwd) {
|
|
19123
|
-
return
|
|
19239
|
+
return import_node_path27.default.resolve(process.cwd(), cwd);
|
|
19124
19240
|
}
|
|
19125
19241
|
const repository = this.getType(service) === "vite" || this.getType(service) === "static" ? this.getRepoStaticSite(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();
|
|
19126
19242
|
if (repository) {
|
|
19127
19243
|
const repoName = repository.replace(/\/+$/, "").split("/").pop()?.replace(/\.git$/i, "");
|
|
19128
19244
|
if (repoName) {
|
|
19129
|
-
const candidate =
|
|
19130
|
-
if ((0,
|
|
19245
|
+
const candidate = import_node_path27.default.join(import_node_os12.default.homedir(), "dev", "pmate", repoName);
|
|
19246
|
+
if ((0, import_node_fs22.existsSync)(candidate)) {
|
|
19131
19247
|
return candidate;
|
|
19132
19248
|
}
|
|
19133
19249
|
}
|
|
@@ -19140,13 +19256,13 @@ var ServiceRuntimeRunner = class {
|
|
|
19140
19256
|
if (!dir) {
|
|
19141
19257
|
throw new Error(`Missing service dir for ${service.id}`);
|
|
19142
19258
|
}
|
|
19143
|
-
return
|
|
19259
|
+
return import_node_path27.default.resolve(repoRoot, dir);
|
|
19144
19260
|
}
|
|
19145
19261
|
async deployVite(service, options) {
|
|
19146
19262
|
this.assertDeployableStaticSite(service);
|
|
19147
19263
|
const appDir = this.resolveLocalDir(service, options.cwd);
|
|
19148
|
-
const packageJsonPath =
|
|
19149
|
-
if (!(0,
|
|
19264
|
+
const packageJsonPath = import_node_path27.default.join(appDir, "package.json");
|
|
19265
|
+
if (!(0, import_node_fs22.existsSync)(packageJsonPath)) {
|
|
19150
19266
|
throw new Error(`No package.json found at ${packageJsonPath}`);
|
|
19151
19267
|
}
|
|
19152
19268
|
const pkg2 = this.loadPackageJson(packageJsonPath);
|
|
@@ -19161,8 +19277,8 @@ var ServiceRuntimeRunner = class {
|
|
|
19161
19277
|
this.resolveRepoRoot(service, options.cwd),
|
|
19162
19278
|
buildEnv
|
|
19163
19279
|
);
|
|
19164
|
-
const distDir =
|
|
19165
|
-
if (!(0,
|
|
19280
|
+
const distDir = import_node_path27.default.join(appDir, "dist");
|
|
19281
|
+
if (!(0, import_node_fs22.existsSync)(distDir)) {
|
|
19166
19282
|
throw new Error(`No dist directory found at ${distDir}`);
|
|
19167
19283
|
}
|
|
19168
19284
|
const site = this.getSite(service);
|
|
@@ -19175,8 +19291,8 @@ var ServiceRuntimeRunner = class {
|
|
|
19175
19291
|
async deployStatic(service, options) {
|
|
19176
19292
|
this.assertDeployableStaticSite(service);
|
|
19177
19293
|
const appDir = this.resolveLocalDir(service, options.cwd);
|
|
19178
|
-
const srcDir =
|
|
19179
|
-
if (!(0,
|
|
19294
|
+
const srcDir = import_node_path27.default.join(appDir, "src");
|
|
19295
|
+
if (!(0, import_node_fs22.existsSync)(srcDir)) {
|
|
19180
19296
|
throw new Error(`No src directory found at ${srcDir}`);
|
|
19181
19297
|
}
|
|
19182
19298
|
const site = this.getSite(service);
|
|
@@ -19210,8 +19326,8 @@ var ServiceRuntimeRunner = class {
|
|
|
19210
19326
|
this.validateFcConfig(service, fc);
|
|
19211
19327
|
const repoRoot = this.resolveRepoRoot(service, options.cwd);
|
|
19212
19328
|
const appDir = this.resolveLocalDir(service, options.cwd);
|
|
19213
|
-
const packageJsonPath =
|
|
19214
|
-
if (!(0,
|
|
19329
|
+
const packageJsonPath = import_node_path27.default.join(appDir, "package.json");
|
|
19330
|
+
if (!(0, import_node_fs22.existsSync)(packageJsonPath)) {
|
|
19215
19331
|
throw new Error(`No package.json found at ${packageJsonPath}`);
|
|
19216
19332
|
}
|
|
19217
19333
|
const pkg2 = this.loadPackageJson(packageJsonPath);
|
|
@@ -19264,15 +19380,15 @@ var ServiceRuntimeRunner = class {
|
|
|
19264
19380
|
const repoRoot = this.resolveRepoRoot(service, options.cwd);
|
|
19265
19381
|
const appDir = this.resolveLocalDir(service, options.cwd);
|
|
19266
19382
|
await this.ensurePnpmWorkspaceRoot(repoRoot);
|
|
19267
|
-
const configPath =
|
|
19268
|
-
if (!(0,
|
|
19383
|
+
const configPath = import_node_path27.default.join(appDir, fc.configFile ?? "s.yaml");
|
|
19384
|
+
if (!(0, import_node_fs22.existsSync)(configPath)) {
|
|
19269
19385
|
throw new Error(`Missing FC config file at ${configPath}`);
|
|
19270
19386
|
}
|
|
19271
|
-
const packageJsonPath =
|
|
19272
|
-
if (!(0,
|
|
19387
|
+
const packageJsonPath = import_node_path27.default.join(appDir, "package.json");
|
|
19388
|
+
if (!(0, import_node_fs22.existsSync)(packageJsonPath)) {
|
|
19273
19389
|
throw new Error(`No package.json found at ${packageJsonPath}`);
|
|
19274
19390
|
}
|
|
19275
|
-
const rawConfig = (0,
|
|
19391
|
+
const rawConfig = (0, import_node_fs22.readFileSync)(configPath, "utf8");
|
|
19276
19392
|
if (!rawConfig.includes(fc.functionName)) {
|
|
19277
19393
|
throw new Error(`FC config ${configPath} does not mention functionName ${fc.functionName}`);
|
|
19278
19394
|
}
|
|
@@ -19553,7 +19669,7 @@ var ServiceRuntimeRunner = class {
|
|
|
19553
19669
|
const serverAddress = await resolveServerAddress(server);
|
|
19554
19670
|
const templateName = exposeType === "websocket" ? "nginx.ws.template" : exposeType === "mixed" ? "nginx.mixed.template" : "nginx.rest.template";
|
|
19555
19671
|
const templatePath = this.resolveTemplatePath(templateName);
|
|
19556
|
-
const template = (0,
|
|
19672
|
+
const template = (0, import_node_fs22.readFileSync)(templatePath, "utf8");
|
|
19557
19673
|
const host = `${subdomain}.${("domain" in network ? network.domain?.trim() : void 0) || "pmate.chat"}`;
|
|
19558
19674
|
const rendered = template.replace(/\$\{\{PORT\}\}/g, String(port)).replace(/\$\{\{HOSTS\}\}/g, host).replace(/\$\{\{HOST\}\}/g, host);
|
|
19559
19675
|
const remotePath = `/etc/nginx/sites-enabled/${subdomain}.conf`;
|
|
@@ -19585,11 +19701,11 @@ var ServiceRuntimeRunner = class {
|
|
|
19585
19701
|
}
|
|
19586
19702
|
if (config.ensurePackageJson) {
|
|
19587
19703
|
const appDir = this.resolveLocalDir(service, options.cwd);
|
|
19588
|
-
const packageJsonPath =
|
|
19589
|
-
if (!(0,
|
|
19704
|
+
const packageJsonPath = import_node_path27.default.join(appDir, "package.json");
|
|
19705
|
+
if (!(0, import_node_fs22.existsSync)(packageJsonPath)) {
|
|
19590
19706
|
throw new Error(`Missing package.json at ${packageJsonPath}`);
|
|
19591
19707
|
}
|
|
19592
|
-
const pkgStat = (0,
|
|
19708
|
+
const pkgStat = (0, import_node_fs22.statSync)(packageJsonPath);
|
|
19593
19709
|
if (!pkgStat.isFile()) {
|
|
19594
19710
|
throw new Error(`package.json is not a file at ${packageJsonPath}`);
|
|
19595
19711
|
}
|
|
@@ -20018,9 +20134,9 @@ var ServiceRuntimeRunner = class {
|
|
|
20018
20134
|
return tokens;
|
|
20019
20135
|
}
|
|
20020
20136
|
readPathValue(source, pathExpr) {
|
|
20021
|
-
const
|
|
20137
|
+
const path32 = pathExpr.split(".").map((segment) => segment.trim()).filter(Boolean);
|
|
20022
20138
|
let cursor = source;
|
|
20023
|
-
for (const segment of
|
|
20139
|
+
for (const segment of path32) {
|
|
20024
20140
|
if (!cursor || typeof cursor !== "object" || Array.isArray(cursor)) {
|
|
20025
20141
|
return void 0;
|
|
20026
20142
|
}
|
|
@@ -20063,12 +20179,12 @@ var ServiceRuntimeRunner = class {
|
|
|
20063
20179
|
}
|
|
20064
20180
|
resolveTemplatePath(templateName) {
|
|
20065
20181
|
const candidates = [
|
|
20066
|
-
|
|
20067
|
-
|
|
20068
|
-
|
|
20182
|
+
import_node_path27.default.join(__dirname, "..", "templates", templateName),
|
|
20183
|
+
import_node_path27.default.join(__dirname, "..", "src", "templates", templateName),
|
|
20184
|
+
import_node_path27.default.join(__dirname, "templates", templateName)
|
|
20069
20185
|
];
|
|
20070
20186
|
for (const candidate of candidates) {
|
|
20071
|
-
if ((0,
|
|
20187
|
+
if ((0, import_node_fs22.existsSync)(candidate)) {
|
|
20072
20188
|
return candidate;
|
|
20073
20189
|
}
|
|
20074
20190
|
}
|
|
@@ -20077,7 +20193,7 @@ var ServiceRuntimeRunner = class {
|
|
|
20077
20193
|
writeRemoteConfig(server, content, remotePath) {
|
|
20078
20194
|
return new Promise((resolve, reject) => {
|
|
20079
20195
|
const target = `pmate@${server}`;
|
|
20080
|
-
const child = (0,
|
|
20196
|
+
const child = (0, import_node_child_process11.spawn)("ssh", [target, "sudo", "tee", remotePath], {
|
|
20081
20197
|
stdio: ["pipe", "inherit", "inherit"]
|
|
20082
20198
|
});
|
|
20083
20199
|
child.on("error", reject);
|
|
@@ -20092,7 +20208,7 @@ var ServiceRuntimeRunner = class {
|
|
|
20092
20208
|
reloadNginx(server) {
|
|
20093
20209
|
return new Promise((resolve, reject) => {
|
|
20094
20210
|
const target = `pmate@${server}`;
|
|
20095
|
-
const child = (0,
|
|
20211
|
+
const child = (0, import_node_child_process11.spawn)("ssh", [target, "sudo", "nginx", "-s", "reload"], {
|
|
20096
20212
|
stdio: ["ignore", "inherit", "inherit"]
|
|
20097
20213
|
});
|
|
20098
20214
|
child.on("error", reject);
|
|
@@ -20100,7 +20216,7 @@ var ServiceRuntimeRunner = class {
|
|
|
20100
20216
|
});
|
|
20101
20217
|
}
|
|
20102
20218
|
loadPackageJson(packageJsonPath) {
|
|
20103
|
-
const raw = (0,
|
|
20219
|
+
const raw = (0, import_node_fs22.readFileSync)(packageJsonPath, "utf8");
|
|
20104
20220
|
const parsed = JSON.parse(raw);
|
|
20105
20221
|
if (!parsed || typeof parsed !== "object") {
|
|
20106
20222
|
throw new Error(`Invalid package.json at ${packageJsonPath}`);
|
|
@@ -20109,7 +20225,7 @@ var ServiceRuntimeRunner = class {
|
|
|
20109
20225
|
}
|
|
20110
20226
|
writePackageJson(packageJsonPath, data) {
|
|
20111
20227
|
const serialized = JSON.stringify(data, null, 2);
|
|
20112
|
-
(0,
|
|
20228
|
+
(0, import_node_fs22.writeFileSync)(packageJsonPath, `${serialized}
|
|
20113
20229
|
`, "utf8");
|
|
20114
20230
|
}
|
|
20115
20231
|
validateFcConfig(service, fc) {
|
|
@@ -20136,8 +20252,8 @@ var ServiceRuntimeRunner = class {
|
|
|
20136
20252
|
}
|
|
20137
20253
|
}
|
|
20138
20254
|
async ensurePnpmWorkspaceRoot(repoRoot) {
|
|
20139
|
-
const workspacePath =
|
|
20140
|
-
if (!(0,
|
|
20255
|
+
const workspacePath = import_node_path27.default.join(repoRoot, "pnpm-workspace.yaml");
|
|
20256
|
+
if (!(0, import_node_fs22.existsSync)(workspacePath)) {
|
|
20141
20257
|
throw new Error(`Missing pnpm-workspace.yaml at ${workspacePath}`);
|
|
20142
20258
|
}
|
|
20143
20259
|
}
|
|
@@ -20211,16 +20327,16 @@ var ServiceRuntimeRunner = class {
|
|
|
20211
20327
|
if (!privateKeyPath) {
|
|
20212
20328
|
throw new Error("Missing ssl.prv in ~/.pmate/config.yaml.");
|
|
20213
20329
|
}
|
|
20214
|
-
if (!(0,
|
|
20330
|
+
if (!(0, import_node_fs22.existsSync)(certificatePath)) {
|
|
20215
20331
|
throw new Error(`SSL certificate file not found: ${certificatePath}`);
|
|
20216
20332
|
}
|
|
20217
|
-
if (!(0,
|
|
20333
|
+
if (!(0, import_node_fs22.existsSync)(privateKeyPath)) {
|
|
20218
20334
|
throw new Error(`SSL private key file not found: ${privateKeyPath}`);
|
|
20219
20335
|
}
|
|
20220
20336
|
return {
|
|
20221
20337
|
certName: host,
|
|
20222
|
-
certificate: (0,
|
|
20223
|
-
privateKey: (0,
|
|
20338
|
+
certificate: (0, import_node_fs22.readFileSync)(certificatePath, "utf8"),
|
|
20339
|
+
privateKey: (0, import_node_fs22.readFileSync)(privateKeyPath, "utf8")
|
|
20224
20340
|
};
|
|
20225
20341
|
}
|
|
20226
20342
|
resolveFcProtocol(fc, certConfig) {
|
|
@@ -20279,7 +20395,7 @@ var ServiceRuntimeRunner = class {
|
|
|
20279
20395
|
}
|
|
20280
20396
|
runCommandWithEnv(command, args, cwd, env) {
|
|
20281
20397
|
return new Promise((resolve, reject) => {
|
|
20282
|
-
const child = (0,
|
|
20398
|
+
const child = (0, import_node_child_process11.spawn)(command, args, {
|
|
20283
20399
|
cwd,
|
|
20284
20400
|
stdio: "inherit",
|
|
20285
20401
|
env: { ...process.env, ...env ?? {} }
|
|
@@ -20290,7 +20406,7 @@ var ServiceRuntimeRunner = class {
|
|
|
20290
20406
|
}
|
|
20291
20407
|
runShellCommand(command, cwd, env) {
|
|
20292
20408
|
return new Promise((resolve, reject) => {
|
|
20293
|
-
const child = (0,
|
|
20409
|
+
const child = (0, import_node_child_process11.spawn)(command, [], {
|
|
20294
20410
|
cwd,
|
|
20295
20411
|
stdio: "inherit",
|
|
20296
20412
|
shell: true,
|
|
@@ -20301,10 +20417,10 @@ var ServiceRuntimeRunner = class {
|
|
|
20301
20417
|
});
|
|
20302
20418
|
}
|
|
20303
20419
|
runRemoteCommand(server, command) {
|
|
20304
|
-
if (server === "local") return this.runCommandWithEnv("bash", ["-c", command],
|
|
20420
|
+
if (server === "local") return this.runCommandWithEnv("bash", ["-c", command], import_node_os12.default.homedir());
|
|
20305
20421
|
return new Promise((resolve, reject) => {
|
|
20306
20422
|
const target = `pmate@${server}`;
|
|
20307
|
-
const child = (0,
|
|
20423
|
+
const child = (0, import_node_child_process11.spawn)("ssh", buildSshBashArgs(target, command), { stdio: "inherit" });
|
|
20308
20424
|
child.on("error", reject);
|
|
20309
20425
|
child.on("close", (code) => code === 0 ? resolve() : reject(new Error(`ssh to ${server} exited with code ${code}`)));
|
|
20310
20426
|
});
|
|
@@ -20733,7 +20849,7 @@ var ServiceCommandHandler = class {
|
|
|
20733
20849
|
format: "dotenv"
|
|
20734
20850
|
}
|
|
20735
20851
|
);
|
|
20736
|
-
const outputPath =
|
|
20852
|
+
const outputPath = import_node_path28.default.resolve(process.cwd(), args.output);
|
|
20737
20853
|
await (0, import_promises5.writeFile)(outputPath, payload.content, "utf8");
|
|
20738
20854
|
ui.success(`Wrote env file for ${args.appId} to ${outputPath}`);
|
|
20739
20855
|
this.renderJson({ ...payload, output: outputPath }, args.json);
|
|
@@ -20959,11 +21075,11 @@ var ServiceCommandHandler = class {
|
|
|
20959
21075
|
return (baseUrl || process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
|
|
20960
21076
|
}
|
|
20961
21077
|
readJsonFile(filePath) {
|
|
20962
|
-
const absolutePath =
|
|
20963
|
-
if (!(0,
|
|
21078
|
+
const absolutePath = import_node_path28.default.resolve(process.cwd(), filePath);
|
|
21079
|
+
if (!(0, import_node_fs23.existsSync)(absolutePath)) {
|
|
20964
21080
|
throw new Error(`JSON file not found: ${absolutePath}`);
|
|
20965
21081
|
}
|
|
20966
|
-
const raw = (0,
|
|
21082
|
+
const raw = (0, import_node_fs23.readFileSync)(absolutePath, "utf8");
|
|
20967
21083
|
try {
|
|
20968
21084
|
return JSON.parse(raw);
|
|
20969
21085
|
} catch (error) {
|
|
@@ -21487,7 +21603,7 @@ var ServiceCommandHandler = class {
|
|
|
21487
21603
|
removeRemoteConfig(server, remotePath) {
|
|
21488
21604
|
return new Promise((resolve, reject) => {
|
|
21489
21605
|
const target = `pmate@${server}`;
|
|
21490
|
-
const child = (0,
|
|
21606
|
+
const child = (0, import_node_child_process12.spawn)("ssh", [target, "sudo", "rm", "-f", remotePath], {
|
|
21491
21607
|
stdio: ["ignore", "inherit", "inherit"]
|
|
21492
21608
|
});
|
|
21493
21609
|
child.on("error", (error) => {
|
|
@@ -21505,7 +21621,7 @@ var ServiceCommandHandler = class {
|
|
|
21505
21621
|
reloadNginx(server) {
|
|
21506
21622
|
return new Promise((resolve, reject) => {
|
|
21507
21623
|
const target = `pmate@${server}`;
|
|
21508
|
-
const child = (0,
|
|
21624
|
+
const child = (0, import_node_child_process12.spawn)("ssh", [target, "sudo", "nginx", "-s", "reload"], {
|
|
21509
21625
|
stdio: ["ignore", "inherit", "inherit"]
|
|
21510
21626
|
});
|
|
21511
21627
|
child.on("error", (error) => {
|
|
@@ -21578,9 +21694,9 @@ function sleep3(ms) {
|
|
|
21578
21694
|
}
|
|
21579
21695
|
|
|
21580
21696
|
// src/commands/VercelCommandHandler.ts
|
|
21581
|
-
var
|
|
21697
|
+
var import_node_child_process13 = require("child_process");
|
|
21582
21698
|
var import_node_util = require("util");
|
|
21583
|
-
var execFileAsync = (0, import_node_util.promisify)(
|
|
21699
|
+
var execFileAsync = (0, import_node_util.promisify)(import_node_child_process13.execFile);
|
|
21584
21700
|
function parseDeploymentTimestamp(deployment) {
|
|
21585
21701
|
const candidates = [deployment.createdAt, deployment.readyAt, deployment.ready];
|
|
21586
21702
|
for (const value of candidates) {
|
|
@@ -21771,9 +21887,9 @@ var RoleCommandHandler = class {
|
|
|
21771
21887
|
};
|
|
21772
21888
|
|
|
21773
21889
|
// src/commands/AccountCommandHandler.ts
|
|
21774
|
-
var
|
|
21775
|
-
var
|
|
21776
|
-
var
|
|
21890
|
+
var import_node_fs24 = require("fs");
|
|
21891
|
+
var import_node_crypto6 = require("crypto");
|
|
21892
|
+
var import_node_path29 = __toESM(require("path"));
|
|
21777
21893
|
init_sessionStore();
|
|
21778
21894
|
var AccountCommandHandler = class {
|
|
21779
21895
|
async handle(args) {
|
|
@@ -21781,9 +21897,9 @@ var AccountCommandHandler = class {
|
|
|
21781
21897
|
case "bot-keygen": {
|
|
21782
21898
|
const keyFile = this.generateBotKeyFile(args.app, args.name);
|
|
21783
21899
|
const outPath = args.out ? this.resolveFilePath(args.out) : this.resolveDefaultBotKeyPath(args.app, args.name);
|
|
21784
|
-
(0,
|
|
21785
|
-
(0,
|
|
21786
|
-
(0,
|
|
21900
|
+
(0, import_node_fs24.mkdirSync)(import_node_path29.default.dirname(outPath), { recursive: true });
|
|
21901
|
+
(0, import_node_fs24.writeFileSync)(outPath, JSON.stringify(keyFile, null, 2), { mode: 384 });
|
|
21902
|
+
(0, import_node_fs24.chmodSync)(outPath, 384);
|
|
21787
21903
|
if (!args.json) {
|
|
21788
21904
|
ui.success(`Bot key saved to ${outPath}`);
|
|
21789
21905
|
}
|
|
@@ -22343,10 +22459,10 @@ var AccountCommandHandler = class {
|
|
|
22343
22459
|
throw new Error("Missing visible apps input");
|
|
22344
22460
|
}
|
|
22345
22461
|
const absolutePath = this.resolveFilePath(args.filePath);
|
|
22346
|
-
if (!(0,
|
|
22462
|
+
if (!(0, import_node_fs24.existsSync)(absolutePath)) {
|
|
22347
22463
|
throw new Error(`JSON file not found: ${absolutePath}`);
|
|
22348
22464
|
}
|
|
22349
|
-
const raw = (0,
|
|
22465
|
+
const raw = (0, import_node_fs24.readFileSync)(absolutePath, "utf8");
|
|
22350
22466
|
let parsed;
|
|
22351
22467
|
try {
|
|
22352
22468
|
parsed = JSON.parse(raw);
|
|
@@ -22360,19 +22476,19 @@ var AccountCommandHandler = class {
|
|
|
22360
22476
|
return parsed;
|
|
22361
22477
|
}
|
|
22362
22478
|
resolveFilePath(filePath) {
|
|
22363
|
-
return
|
|
22479
|
+
return import_node_path29.default.resolve(process.cwd(), filePath);
|
|
22364
22480
|
}
|
|
22365
22481
|
resolveDefaultBotKeyPath(app, name) {
|
|
22366
|
-
return
|
|
22482
|
+
return import_node_path29.default.join(this.homeDir(), ".pmate", "bots", app, `${name}.bot-key.json`);
|
|
22367
22483
|
}
|
|
22368
22484
|
resolveDefaultAccessKeyPath(app, name) {
|
|
22369
|
-
return
|
|
22485
|
+
return import_node_path29.default.join(this.homeDir(), ".pmate", "access-keys", app, `${name}.access-key.json`);
|
|
22370
22486
|
}
|
|
22371
22487
|
homeDir() {
|
|
22372
22488
|
return process.env.HOME || process.env.USERPROFILE || process.cwd();
|
|
22373
22489
|
}
|
|
22374
22490
|
generateBotKeyFile(app, name) {
|
|
22375
|
-
const { publicKey, privateKey } = (0,
|
|
22491
|
+
const { publicKey, privateKey } = (0, import_node_crypto6.generateKeyPairSync)("ed25519");
|
|
22376
22492
|
return {
|
|
22377
22493
|
type: "pmate-bot-key",
|
|
22378
22494
|
version: 1,
|
|
@@ -22386,14 +22502,14 @@ var AccountCommandHandler = class {
|
|
|
22386
22502
|
}
|
|
22387
22503
|
renameDefaultBotKeyFile(app, name, newName) {
|
|
22388
22504
|
const oldPath = this.resolveDefaultBotKeyPath(app, name);
|
|
22389
|
-
if (!(0,
|
|
22505
|
+
if (!(0, import_node_fs24.existsSync)(oldPath)) {
|
|
22390
22506
|
return void 0;
|
|
22391
22507
|
}
|
|
22392
22508
|
const keyFile = this.readBotKeyFile(oldPath, app, name);
|
|
22393
22509
|
const newPath = this.resolveDefaultBotKeyPath(app, newName);
|
|
22394
|
-
(0,
|
|
22395
|
-
(0,
|
|
22396
|
-
(0,
|
|
22510
|
+
(0, import_node_fs24.mkdirSync)(import_node_path29.default.dirname(newPath), { recursive: true, mode: 448 });
|
|
22511
|
+
(0, import_node_fs24.writeFileSync)(newPath, JSON.stringify({ ...keyFile, name: newName }, null, 2));
|
|
22512
|
+
(0, import_node_fs24.chmodSync)(newPath, 384);
|
|
22397
22513
|
return newPath;
|
|
22398
22514
|
}
|
|
22399
22515
|
readBotKeyFile(filePath, expectedApp, expectedName) {
|
|
@@ -22401,10 +22517,10 @@ var AccountCommandHandler = class {
|
|
|
22401
22517
|
throw new Error("Missing bot key file");
|
|
22402
22518
|
}
|
|
22403
22519
|
const absolutePath = this.resolveFilePath(filePath);
|
|
22404
|
-
if (!(0,
|
|
22520
|
+
if (!(0, import_node_fs24.existsSync)(absolutePath)) {
|
|
22405
22521
|
throw new Error(`Bot key file not found: ${absolutePath}`);
|
|
22406
22522
|
}
|
|
22407
|
-
const parsed = JSON.parse((0,
|
|
22523
|
+
const parsed = JSON.parse((0, import_node_fs24.readFileSync)(absolutePath, "utf8"));
|
|
22408
22524
|
if (parsed.type !== "pmate-bot-key" || parsed.version !== 1 || parsed.algorithm !== "ed25519" || !parsed.publicKey || !parsed.privateKey) {
|
|
22409
22525
|
throw new Error(`Invalid PMate bot key file: ${absolutePath}`);
|
|
22410
22526
|
}
|
|
@@ -22421,10 +22537,10 @@ var AccountCommandHandler = class {
|
|
|
22421
22537
|
throw new Error("Missing access key file");
|
|
22422
22538
|
}
|
|
22423
22539
|
const absolutePath = this.resolveFilePath(filePath);
|
|
22424
|
-
if (!(0,
|
|
22540
|
+
if (!(0, import_node_fs24.existsSync)(absolutePath)) {
|
|
22425
22541
|
throw new Error(`Access key file not found: ${absolutePath}`);
|
|
22426
22542
|
}
|
|
22427
|
-
const parsed = JSON.parse((0,
|
|
22543
|
+
const parsed = JSON.parse((0, import_node_fs24.readFileSync)(absolutePath, "utf8"));
|
|
22428
22544
|
if (parsed.type !== "pmate-access-key" || parsed.version !== 1 || !parsed.id || !parsed.app || !parsed.secret || !parsed.expiresAt) {
|
|
22429
22545
|
throw new Error(`Invalid PMate access key file: ${absolutePath}`);
|
|
22430
22546
|
}
|
|
@@ -22446,9 +22562,9 @@ var AccountCommandHandler = class {
|
|
|
22446
22562
|
createdAt: result.key.createdAt
|
|
22447
22563
|
};
|
|
22448
22564
|
const outPath = out ? this.resolveFilePath(out) : this.resolveDefaultAccessKeyPath(result.key.app, result.key.name);
|
|
22449
|
-
(0,
|
|
22450
|
-
(0,
|
|
22451
|
-
(0,
|
|
22565
|
+
(0, import_node_fs24.mkdirSync)(import_node_path29.default.dirname(outPath), { recursive: true });
|
|
22566
|
+
(0, import_node_fs24.writeFileSync)(outPath, JSON.stringify(keyFile, null, 2), { mode: 384 });
|
|
22567
|
+
(0, import_node_fs24.chmodSync)(outPath, 384);
|
|
22452
22568
|
}
|
|
22453
22569
|
renderAccessKeyCreateResult(result, asJson, out) {
|
|
22454
22570
|
if (asJson) {
|
|
@@ -22494,12 +22610,12 @@ var AccountCommandHandler = class {
|
|
|
22494
22610
|
});
|
|
22495
22611
|
}
|
|
22496
22612
|
signBotChallenge(challenge, privateKey) {
|
|
22497
|
-
const key = (0,
|
|
22613
|
+
const key = (0, import_node_crypto6.createPrivateKey)({
|
|
22498
22614
|
key: Buffer.from(privateKey, "base64url"),
|
|
22499
22615
|
format: "der",
|
|
22500
22616
|
type: "pkcs8"
|
|
22501
22617
|
});
|
|
22502
|
-
return (0,
|
|
22618
|
+
return (0, import_node_crypto6.sign)(
|
|
22503
22619
|
null,
|
|
22504
22620
|
Buffer.from(JSON.stringify({
|
|
22505
22621
|
id: challenge.id,
|
|
@@ -22533,8 +22649,8 @@ function encodePathSegment2(value) {
|
|
|
22533
22649
|
}
|
|
22534
22650
|
|
|
22535
22651
|
// src/commands/OrgCommandHandler.ts
|
|
22536
|
-
var
|
|
22537
|
-
var
|
|
22652
|
+
var import_node_fs25 = require("fs");
|
|
22653
|
+
var import_node_path30 = __toESM(require("path"));
|
|
22538
22654
|
init_sessionStore();
|
|
22539
22655
|
var OrgCommandHandler = class {
|
|
22540
22656
|
async handle(args) {
|
|
@@ -22704,11 +22820,11 @@ var OrgCommandHandler = class {
|
|
|
22704
22820
|
if (!filePath) {
|
|
22705
22821
|
throw new Error(`Missing ${itemLabel} input`);
|
|
22706
22822
|
}
|
|
22707
|
-
const absolutePath =
|
|
22708
|
-
if (!(0,
|
|
22823
|
+
const absolutePath = import_node_path30.default.resolve(process.cwd(), filePath);
|
|
22824
|
+
if (!(0, import_node_fs25.existsSync)(absolutePath)) {
|
|
22709
22825
|
throw new Error(`JSON file not found: ${absolutePath}`);
|
|
22710
22826
|
}
|
|
22711
|
-
const raw = (0,
|
|
22827
|
+
const raw = (0, import_node_fs25.readFileSync)(absolutePath, "utf8");
|
|
22712
22828
|
let parsed;
|
|
22713
22829
|
try {
|
|
22714
22830
|
parsed = JSON.parse(raw);
|
|
@@ -22779,10 +22895,10 @@ function encodePathSegment3(value) {
|
|
|
22779
22895
|
}
|
|
22780
22896
|
|
|
22781
22897
|
// src/commands/HostCommandHandler.ts
|
|
22782
|
-
var
|
|
22783
|
-
var
|
|
22784
|
-
var
|
|
22785
|
-
var
|
|
22898
|
+
var import_node_fs26 = require("fs");
|
|
22899
|
+
var import_node_os13 = require("os");
|
|
22900
|
+
var import_node_path31 = __toESM(require("path"));
|
|
22901
|
+
var import_node_child_process14 = require("child_process");
|
|
22786
22902
|
var BLOCK_START = "# >>> pmate host env >>>";
|
|
22787
22903
|
var BLOCK_END = "# <<< pmate host env <<<";
|
|
22788
22904
|
var PROFILE_BLOCK = `${BLOCK_START}
|
|
@@ -22794,7 +22910,7 @@ fi
|
|
|
22794
22910
|
${BLOCK_END}`;
|
|
22795
22911
|
var HostCommandHandler = class {
|
|
22796
22912
|
async handle(args) {
|
|
22797
|
-
const hostId = normalizeHostId(args.host ?? process.env.PMATE_HOST_ID ?? (0,
|
|
22913
|
+
const hostId = normalizeHostId(args.host ?? process.env.PMATE_HOST_ID ?? (0, import_node_os13.hostname)());
|
|
22798
22914
|
const client = new ServiceRegistryClient(args.baseUrl);
|
|
22799
22915
|
if (args.action === "env-list") {
|
|
22800
22916
|
const items = await client.listHostEnv(hostId);
|
|
@@ -22825,7 +22941,7 @@ async function applyHostEnvRemote(host, values) {
|
|
|
22825
22941
|
const content = serializeHostEnv(values);
|
|
22826
22942
|
const script = buildRemoteApplyScript(Buffer.from(content, "utf8").toString("base64"));
|
|
22827
22943
|
await new Promise((resolve, reject) => {
|
|
22828
|
-
const child = (0,
|
|
22944
|
+
const child = (0, import_node_child_process14.spawn)("ssh", [target, "bash -s"], { stdio: ["pipe", "pipe", "pipe"] });
|
|
22829
22945
|
let stdout = "";
|
|
22830
22946
|
let stderr = "";
|
|
22831
22947
|
child.stdout.on("data", (chunk) => {
|
|
@@ -23288,6 +23404,26 @@ function parseAppArgs(tokens) {
|
|
|
23288
23404
|
if (!action) {
|
|
23289
23405
|
throw new Error("Missing app action. Use: app list|get|view|create|update|rename|move|icon|delete");
|
|
23290
23406
|
}
|
|
23407
|
+
if (action === "build") {
|
|
23408
|
+
const id = parseNamespacedRef(rest.shift() ?? "", { entityLabel: "app ref" }).fullId;
|
|
23409
|
+
const options = {};
|
|
23410
|
+
const switches = /* @__PURE__ */ new Set();
|
|
23411
|
+
while (rest.length) {
|
|
23412
|
+
const key = rest.shift();
|
|
23413
|
+
if (["--dry-run", "--signed", "--dir", "--json"].includes(key)) {
|
|
23414
|
+
if (switches.has(key)) throw new Error(`Duplicate option: ${key}`);
|
|
23415
|
+
switches.add(key);
|
|
23416
|
+
} else if (["--target", "--config", "--platform", "--arch", "--out-dir"].includes(key)) {
|
|
23417
|
+
if (options[key]) throw new Error(`Duplicate option: ${key}`);
|
|
23418
|
+
options[key] = requireValue3(rest, key);
|
|
23419
|
+
} else throw new Error(`Unknown app build option: ${key}`);
|
|
23420
|
+
}
|
|
23421
|
+
if (options["--target"] !== "electron" || !options["--config"]) throw new Error("Use app build <ns:app> --target electron --config <file>");
|
|
23422
|
+
const platform = options["--platform"] ?? (process.platform === "darwin" ? "mac" : process.platform);
|
|
23423
|
+
const arch = options["--arch"] ?? process.arch;
|
|
23424
|
+
if (platform !== "mac" || !["arm64", "x64"].includes(arch)) throw new Error("Supported target: --platform mac --arch arm64|x64");
|
|
23425
|
+
return { type: "app" /* App */, action, id, target: "electron", config: options["--config"], platform, arch, outDir: options["--out-dir"] ?? "release/desktop", dryRun: switches.has("--dry-run"), signed: switches.has("--signed"), dir: switches.has("--dir"), json: switches.has("--json") };
|
|
23426
|
+
}
|
|
23291
23427
|
let baseUrl;
|
|
23292
23428
|
let json = false;
|
|
23293
23429
|
const takeSharedOptions4 = () => {
|
|
@@ -25990,7 +26126,7 @@ function requireValue11(tokens, option) {
|
|
|
25990
26126
|
|
|
25991
26127
|
// src/index.ts
|
|
25992
26128
|
var pkg = JSON.parse(
|
|
25993
|
-
(0,
|
|
26129
|
+
(0, import_node_fs27.readFileSync)(import_node_path32.default.resolve(__dirname, "..", "package.json"), "utf8")
|
|
25994
26130
|
);
|
|
25995
26131
|
var HELP_TEXT = [
|
|
25996
26132
|
import_chalk4.default.bold(`pmate v${pkg.version}`),
|
|
@@ -26138,6 +26274,7 @@ var HELP_TEXT = [
|
|
|
26138
26274
|
` ${import_chalk4.default.gray(" kv list|get|exists|set|delete <name> [options]")}`,
|
|
26139
26275
|
` ${import_chalk4.default.gray(" defaults: chain=pmate namespace=pmate env base URLs from BLOCKCHAIN_BASE_URL / INDEXER_BASE_URL")}`,
|
|
26140
26276
|
` ${import_chalk4.default.cyan("app")} Manage app registry entries via apps-api`,
|
|
26277
|
+
` ${import_chalk4.default.gray(" build <ns:app> --target electron --config <file> [--platform mac] [--arch arm64|x64] [--out-dir <dir>] [--dir] [--dry-run] [--signed]")}`,
|
|
26141
26278
|
` ${import_chalk4.default.gray(" list [--ns <namespace>] [--all] [--base-url <url>] [--json]")}`,
|
|
26142
26279
|
` ${import_chalk4.default.gray(" get <ns:objectId> [--base-url <url>] [--json]")}`,
|
|
26143
26280
|
` ${import_chalk4.default.gray(" view <ns:objectId> [--base-url <url>]")}`,
|