@pmate/cli 0.41.1 → 0.42.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -293,181 +293,181 @@ var init_sessionStore = __esm({
293
293
  }
294
294
  });
295
295
 
296
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/account.types.ts
296
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/account.types.ts"() {
298
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/achievements.types.ts
303
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/achievements.types.ts"() {
305
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/aigen.types.ts
310
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/aigen.types.ts"() {
312
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/agent.types.ts
317
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/agent.types.ts"() {
319
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/agent-registry.types.ts
324
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/agent-registry.types.ts"() {
326
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/runner-registry.types.ts
331
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/runner-registry.types.ts"() {
333
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/function-registry.types.ts
338
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/function-registry.types.ts"() {
340
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/worker-registry.types.ts
345
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/worker-registry.types.ts"() {
347
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/call.types.ts
352
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/call.types.ts"() {
354
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/blockchain.types.ts
359
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/blockchain.types.ts"() {
361
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/breakdown.types.ts
366
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/breakdown.types.ts"() {
368
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/chat.types.ts
373
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/chat.types.ts"() {
375
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/companion.types.ts
380
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/companion.types.ts"() {
382
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/enums.ts
387
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/enums.ts
388
388
  var init_enums = __esm({
389
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/enums.ts"() {
389
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/lang.types.ts
394
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/lang.types.ts"() {
396
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/logs.types.ts
401
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/logs.types.ts"() {
403
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/message.types.ts
408
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/message.types.ts"() {
411
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/newLog.types.ts
418
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/newLog.types.ts"() {
420
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/novel.types.ts
425
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/novel.types.ts"() {
427
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/offline.types.ts
432
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/offline.types.ts"() {
434
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/prompt.types.ts
439
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/prompt.types.ts"() {
441
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/reading.types.ts
446
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/reading.types.ts"() {
448
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/settings.types.ts
453
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/settings.types.ts"() {
455
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/subscription.types.ts
460
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/subscription.types.ts"() {
462
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/types.ts
467
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/types.ts"() {
470
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/wordv5.def.ts
492
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/wordv5.def.ts"() {
494
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/auth.types.ts
499
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/auth.types.ts"() {
501
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/apps.types.ts
506
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/apps.types.ts"() {
508
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/response.types.ts
513
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/response.types.ts"() {
515
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/role.types.ts
520
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/role.types.ts"() {
522
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/index.ts
527
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/index.ts
528
528
  var init_types2 = __esm({
529
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/types/index.ts"() {
529
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/BizErrorCode.ts
564
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/BizErrorCode.ts
565
565
  var init_BizErrorCode = __esm({
566
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/BizErrorCode.ts"() {
566
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/consts.ts
571
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/consts.ts
572
572
  var init_consts = __esm({
573
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/consts.ts"() {
573
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/TopicNames.ts
578
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/TopicNames.ts"() {
581
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/OSSKeys.ts
667
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/OSSKeys.ts
668
668
  var init_OSSKeys = __esm({
669
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/OSSKeys.ts"() {
669
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/CompanionProfiles.ts
675
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/CompanionProfiles.ts"() {
678
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/index.ts
713
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/index.ts
714
714
  var init_config = __esm({
715
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/config/index.ts"() {
715
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/index.ts
725
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/index.ts
726
726
  var init_src = __esm({
727
- "node_modules/.pnpm/@pmate+meta@1.3.1/node_modules/@pmate/meta/src/index.ts"() {
727
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/base64.ts
734
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/base64.ts
735
735
  var init_base64 = __esm({
736
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/base64.ts"() {
736
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Cache.ts
741
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Cache.ts
742
742
  var init_Cache = __esm({
743
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Cache.ts"() {
743
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/batchResolve.ts
748
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/batchResolve.ts
749
749
  var init_batchResolve = __esm({
750
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/batchResolve.ts"() {
750
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceSpliter.ts
756
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceSpliter.ts
757
757
  var init_sentenceSpliter = __esm({
758
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceSpliter.ts"() {
758
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceTrim.ts
763
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceTrim.ts
764
764
  var init_sentenceTrim = __esm({
765
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/sentenceTrim.ts"() {
765
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/wordSpliter.ts
770
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/wordSpliter.ts
771
771
  var init_wordSpliter = __esm({
772
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/cn/wordSpliter.ts"() {
772
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/regex.ts
777
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/regex.ts
778
778
  var init_regex = __esm({
779
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/regex.ts"() {
779
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceSpliter.ts
784
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceSpliter.ts
785
785
  var init_sentenceSpliter2 = __esm({
786
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceSpliter.ts"() {
786
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceTrim.ts
791
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceTrim.ts
792
792
  var init_sentenceTrim2 = __esm({
793
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/sentenceTrim.ts"() {
793
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/wordSpliter.ts
798
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/en/wordSpliter.ts"() {
801
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/sentenceSpliter.ts
837
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/sentenceSpliter.ts
838
838
  var init_sentenceSpliter3 = __esm({
839
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/sentenceSpliter.ts"() {
839
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/wordSpliter.ts
844
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/wordSpliter.ts
845
845
  var init_wordSpliter3 = __esm({
846
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/kr/wordSpliter.ts"() {
846
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/readingSettings.ts
851
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/readingSettings.ts
852
852
  var init_readingSettings = __esm({
853
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/readingSettings.ts"() {
853
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/utils.ts
864
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/utils.ts
865
865
  var init_utils = __esm({
866
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/utils.ts"() {
866
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/index.ts
872
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/index.ts
873
873
  var init_src2 = __esm({
874
- "node_modules/.pnpm/@pmate+lang@1.0.4/node_modules/@pmate/lang/src/index.ts"() {
874
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/bookStats.ts
890
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/bookStats.ts
891
891
  var init_bookStats = __esm({
892
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/bookStats.ts"() {
892
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts
898
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts
899
899
  var init_BoundedConcurrentQueue = __esm({
900
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/BoundedConcurrentQueue.ts"() {
900
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/lru.ts
905
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/lru.ts
906
906
  var init_lru = __esm({
907
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/lru.ts"() {
907
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/js-sha3@0.9.3/node_modules/js-sha3/src/sha3.js
913
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/js-sha3@0.9.3/node_modules/js-sha3/src/sha3.js
914
914
  var require_sha3 = __commonJS({
915
- "node_modules/.pnpm/js-sha3@0.9.3/node_modules/js-sha3/src/sha3.js"(exports2, module2) {
915
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Maybe.ts
1560
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Maybe.ts
1561
1561
  var init_Maybe = __esm({
1562
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Maybe.ts"() {
1562
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/cacheMethodInMem.ts
1567
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/cacheMethodInMem.ts"() {
1570
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/pako@2.1.0/node_modules/pako/dist/pako.esm.mjs
1577
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/pako@2.1.0/node_modules/pako/dist/pako.esm.mjs"() {
1865
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/compress.ts
5746
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/compress.ts"() {
5772
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/AsyncStream.ts
5778
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/AsyncStream.ts"() {
5781
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/uniqHash.ts
5969
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/uniqHash.ts"() {
5972
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/createMsg.ts
6002
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/createMsg.ts
6003
6003
  var init_createMsg = __esm({
6004
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/createMsg.ts"() {
6004
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/detectText.ts
6011
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/detectText.ts
6012
6012
  var init_detectText = __esm({
6013
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/detectText.ts"() {
6013
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Emitter.ts
6018
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Emitter.ts
6019
6019
  var init_Emitter = __esm({
6020
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Emitter.ts"() {
6020
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/EmitterV2.ts
6025
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/EmitterV2.ts
6026
6026
  var init_EmitterV2 = __esm({
6027
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/EmitterV2.ts"() {
6027
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/formatTime.ts
6032
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/formatTime.ts
6033
6033
  var init_formatTime = __esm({
6034
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/formatTime.ts"() {
6034
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/index.ts
6039
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/index.ts
6040
6040
  var init_format = __esm({
6041
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/format/index.ts"() {
6041
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/isVolcabulary.ts
6047
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/isVolcabulary.ts
6048
6048
  var init_isVolcabulary = __esm({
6049
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/isVolcabulary.ts"() {
6049
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Loadable.ts
6054
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Loadable.ts
6055
6055
  var init_Loadable = __esm({
6056
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Loadable.ts"() {
6056
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Logger.ts
6061
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Logger.ts"() {
6064
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/mapToReadingBook.ts
6089
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/mapToReadingBook.ts
6090
6090
  var init_mapToReadingBook = __esm({
6091
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/mapToReadingBook.ts"() {
6091
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/memoize.ts
6096
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/memoize.ts
6097
6097
  var init_memoize = __esm({
6098
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/memoize.ts"() {
6098
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs
6103
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs"() {
6230
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs
6240
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs"() {
6243
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs
6256
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs"() {
6259
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs
6276
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs"() {
6301
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs
6307
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs"() {
6380
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs
6395
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs"() {
6398
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs
6465
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs"() {
6481
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs
6486
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Encoder.mjs"() {
6489
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/encode.mjs
6899
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/encode.mjs"() {
6905
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs
6911
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs"() {
6916
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs
6921
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs"() {
6924
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs
6984
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs"() {
6987
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/decode.mjs
7625
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/decode.mjs"() {
7631
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/index.mjs
7637
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/index.mjs
7638
7638
  var init_dist = __esm({
7639
- "node_modules/.pnpm/@msgpack+msgpack@3.1.3/node_modules/@msgpack/msgpack/dist.esm/index.mjs"() {
7639
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Msg.ts
7646
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/Msg.ts"() {
7649
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/normalize.ts
7777
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/normalize.ts
7778
7778
  var init_normalize = __esm({
7779
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/normalize.ts"() {
7779
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/pageURL.ts
7784
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/pageURL.ts
7785
7785
  var init_pageURL = __esm({
7786
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/pageURL.ts"() {
7786
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/PromiseQueue.ts
7791
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/PromiseQueue.ts
7792
7792
  var init_PromiseQueue = __esm({
7793
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/PromiseQueue.ts"() {
7793
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/resourceKey.ts
7798
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/resourceKey.ts"() {
7801
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/SelectionHelper.ts
7807
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/SelectionHelper.ts
7808
7808
  var init_SelectionHelper = __esm({
7809
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/SelectionHelper.ts"() {
7809
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/setMinus.ts
7814
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/setMinus.ts
7815
7815
  var init_setMinus = __esm({
7816
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/setMinus.ts"() {
7816
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/sha1Hash.ts
7821
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/sha1Hash.ts
7822
7822
  var init_sha1Hash = __esm({
7823
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/sha1Hash.ts"() {
7823
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/TaskWaiter.ts
7828
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/TaskWaiter.ts
7829
7829
  var init_TaskWaiter = __esm({
7830
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/TaskWaiter.ts"() {
7830
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/toSentenceAnalyze.ts
7836
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/toSentenceAnalyze.ts
7837
7837
  var init_toSentenceAnalyze = __esm({
7838
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/toSentenceAnalyze.ts"() {
7838
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/txtBookToJson.ts
7843
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/txtBookToJson.ts
7844
7844
  var init_txtBookToJson = __esm({
7845
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/txtBookToJson.ts"() {
7845
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/VocabularyMap.ts
7851
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/VocabularyMap.ts
7852
7852
  var init_VocabularyMap = __esm({
7853
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/VocabularyMap.ts"() {
7853
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wait.ts
7859
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wait.ts
7860
7860
  var init_wait = __esm({
7861
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wait.ts"() {
7861
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wordCount.ts
7866
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wordCount.ts
7867
7867
  var init_wordCount = __esm({
7868
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/wordCount.ts"() {
7868
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts
7873
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketHeartbeat.ts"() {
7876
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClient.ts
7917
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClient.ts"() {
7920
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts
7931
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/WebsocketClientV2.ts"() {
7940
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/H3Client.ts
8187
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/H3Client.ts"() {
8190
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/index.ts
8200
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/index.ts
8201
8201
  var init_websocket = __esm({
8202
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/websocket/index.ts"() {
8202
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/index.ts
8210
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/index.ts
8211
8211
  var init_src3 = __esm({
8212
- "node_modules/.pnpm/@pmate+utils@1.1.4/node_modules/@pmate/utils/src/index.ts"() {
8212
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/AgentClient.js
8252
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/AgentClient.js
8253
8253
  var init_AgentClient = __esm({
8254
- "node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/AgentClient.js"() {
8254
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/FunctionService.js
8261
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/FunctionService.js
8262
8262
  var init_FunctionService = __esm({
8263
- "node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/FunctionService.js"() {
8263
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/HubClient.js
8268
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/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
  }
@@ -8294,14 +8294,14 @@ function abortError(reason) {
8294
8294
  return reason;
8295
8295
  return new Error(typeof reason === "string" ? reason : "Function stream aborted");
8296
8296
  }
8297
- function ensureWsProtocol(baseUrl) {
8298
- if (/^wss?:\/\//i.test(baseUrl))
8299
- return baseUrl;
8300
- if (/^https:\/\//i.test(baseUrl))
8301
- return baseUrl.replace(/^https:/i, "wss:");
8302
- if (/^http:\/\//i.test(baseUrl))
8303
- return baseUrl.replace(/^http:/i, "ws:");
8304
- return `wss://${baseUrl}`;
8297
+ function ensureWsProtocol(baseUrl2) {
8298
+ if (/^wss?:\/\//i.test(baseUrl2))
8299
+ return baseUrl2;
8300
+ if (/^https:\/\//i.test(baseUrl2))
8301
+ return baseUrl2.replace(/^https:/i, "wss:");
8302
+ if (/^http:\/\//i.test(baseUrl2))
8303
+ return baseUrl2.replace(/^http:/i, "ws:");
8304
+ return `wss://${baseUrl2}`;
8305
8305
  }
8306
8306
  function deferred() {
8307
8307
  let resolve;
@@ -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
- "node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/HubClient.js"() {
8329
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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
- // node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/index.js
8749
+ // ../../../Users/ramroll/dev/pmate/pmate-cli/node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/index.js
8750
8750
  var init_dist2 = __esm({
8751
- "node_modules/.pnpm/@pmate+hub-sdk@0.4.1/node_modules/@pmate/hub-sdk/dist/index.js"() {
8751
+ "../../../Users/ramroll/dev/pmate/pmate-cli/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 import_node_fs30 = require("fs");
8822
- var import_node_path35 = __toESM(require("path"));
8821
+ var import_node_fs31 = require("fs");
8822
+ var import_node_path36 = __toESM(require("path"));
8823
8823
 
8824
8824
  // src/managedSession.ts
8825
8825
  var import_node_fs = require("fs");
@@ -10116,7 +10116,7 @@ var AliyunService = class {
10116
10116
  ui.success(`Bucket created: ${bucketName}`);
10117
10117
  }
10118
10118
  /** Upload all files in a directory to OSS, skipping unchanged files. */
10119
- static async uploadDirectory(localDir, bucket, prefix) {
10119
+ static async uploadDirectory(localDir, bucket2, prefix) {
10120
10120
  const cfg = loadPmateConfig();
10121
10121
  const region = cfg.oss?.public?.region?.trim();
10122
10122
  const accessKeyId = cfg.aliyun?.ak?.trim();
@@ -10124,7 +10124,7 @@ var AliyunService = class {
10124
10124
  if (!region) throw new Error("Missing oss.public.region in ~/.pmate/config.yaml.");
10125
10125
  if (!accessKeyId) throw new Error("Missing aliyun.ak in ~/.pmate/config.yaml.");
10126
10126
  if (!accessKeySecret) throw new Error("Missing aliyun.sk in ~/.pmate/config.yaml.");
10127
- const client = new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket });
10127
+ const client = new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket: bucket2 });
10128
10128
  const files = await this.collectFiles(localDir);
10129
10129
  if (files.length === 0) {
10130
10130
  ui.warn(`No files to upload from ${localDir}`);
@@ -10169,7 +10169,7 @@ var AliyunService = class {
10169
10169
  }
10170
10170
  }
10171
10171
  /** Upload a single file to OSS. */
10172
- static async uploadFile(localFile, bucket, objectKey) {
10172
+ static async uploadFile(localFile, bucket2, objectKey, extraHeaders = {}) {
10173
10173
  const cfg = loadPmateConfig();
10174
10174
  const region = cfg.oss?.public?.region?.trim();
10175
10175
  const accessKeyId = cfg.aliyun?.ak?.trim();
@@ -10180,24 +10180,25 @@ var AliyunService = class {
10180
10180
  if (!(0, import_node_fs5.existsSync)(localFile)) {
10181
10181
  throw new Error(`File not found: ${localFile}`);
10182
10182
  }
10183
- const client = new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket });
10183
+ const client = new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket: bucket2 });
10184
10184
  const contentType = this.getContentType(localFile);
10185
10185
  const cacheControl = this.getStaticAssetCacheControl(objectKey);
10186
10186
  const headers = {};
10187
10187
  if (contentType) headers["Content-Type"] = contentType;
10188
10188
  if (cacheControl) headers["Cache-Control"] = cacheControl;
10189
+ Object.assign(headers, extraHeaders);
10189
10190
  const options = Object.keys(headers).length > 0 ? { headers } : void 0;
10190
10191
  await client.put(objectKey, localFile, options);
10191
10192
  ui.success(`Uploaded ${objectKey}`);
10192
10193
  }
10193
10194
  /** List objects in a bucket (optionally under a prefix). */
10194
- static async readJsonObject(bucket, objectKey) {
10195
+ static async readJsonObject(bucket2, objectKey) {
10195
10196
  const cfg = loadPmateConfig();
10196
10197
  const region = cfg.oss?.public?.region?.trim();
10197
10198
  const accessKeyId = cfg.aliyun?.ak?.trim();
10198
10199
  const accessKeySecret = cfg.aliyun?.sk?.trim();
10199
10200
  if (!region || !accessKeyId || !accessKeySecret) throw new Error("Missing OSS credentials.");
10200
- const client = new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket });
10201
+ const client = new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket: bucket2 });
10201
10202
  try {
10202
10203
  const result = await client.get(objectKey);
10203
10204
  return JSON.parse(result.content.toString());
@@ -10206,19 +10207,34 @@ var AliyunService = class {
10206
10207
  throw error;
10207
10208
  }
10208
10209
  }
10209
- static async uploadJsonObject(bucket, objectKey, value) {
10210
+ static async assertUnversionedBucket(bucket2) {
10211
+ const cfg = loadPmateConfig();
10212
+ const region = cfg.oss?.public?.region?.trim(), accessKeyId = cfg.aliyun?.ak?.trim(), accessKeySecret = cfg.aliyun?.sk?.trim();
10213
+ if (!region || !accessKeyId || !accessKeySecret) throw new Error("Missing OSS credentials.");
10214
+ const client = new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket: bucket2 });
10215
+ const { versionStatus } = await client.getBucketVersioning(bucket2);
10216
+ if (versionStatus) throw new Error("HarmonyOS immutable publication requires an unversioned OSS bucket");
10217
+ }
10218
+ static async removePublicationLock(bucket2, objectKey) {
10219
+ if (!/^harmony\/[\w-]+\/[\w-]+\/\.publish-lock\.json$/.test(objectKey)) throw new Error("Invalid HarmonyOS publication lock key");
10220
+ const cfg = loadPmateConfig();
10221
+ const region = cfg.oss?.public?.region?.trim(), accessKeyId = cfg.aliyun?.ak?.trim(), accessKeySecret = cfg.aliyun?.sk?.trim();
10222
+ if (!region || !accessKeyId || !accessKeySecret) throw new Error("Missing OSS credentials.");
10223
+ await new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket: bucket2 }).delete(objectKey);
10224
+ }
10225
+ static async uploadJsonObject(bucket2, objectKey, value, extraHeaders = {}) {
10210
10226
  const cfg = loadPmateConfig();
10211
10227
  const region = cfg.oss?.public?.region?.trim();
10212
10228
  const accessKeyId = cfg.aliyun?.ak?.trim();
10213
10229
  const accessKeySecret = cfg.aliyun?.sk?.trim();
10214
10230
  if (!region || !accessKeyId || !accessKeySecret) throw new Error("Missing OSS credentials.");
10215
- const client = new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket });
10231
+ const client = new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket: bucket2 });
10216
10232
  await client.put(objectKey, Buffer.from(JSON.stringify(value)), {
10217
- headers: { "Content-Type": "application/json", "Cache-Control": "no-cache, no-store, must-revalidate" }
10233
+ headers: { "Content-Type": "application/json", "Cache-Control": "no-cache, no-store, must-revalidate", ...extraHeaders }
10218
10234
  });
10219
10235
  }
10220
10236
  /** List objects in a bucket (optionally under a prefix). */
10221
- static async listObjects(bucket, prefix) {
10237
+ static async listObjects(bucket2, prefix) {
10222
10238
  const cfg = loadPmateConfig();
10223
10239
  const region = cfg.oss?.public?.region?.trim();
10224
10240
  const accessKeyId = cfg.aliyun?.ak?.trim();
@@ -10226,7 +10242,7 @@ var AliyunService = class {
10226
10242
  if (!region) throw new Error("Missing oss.public.region in ~/.pmate/config.yaml.");
10227
10243
  if (!accessKeyId) throw new Error("Missing aliyun.ak in ~/.pmate/config.yaml.");
10228
10244
  if (!accessKeySecret) throw new Error("Missing aliyun.sk in ~/.pmate/config.yaml.");
10229
- const client = new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket });
10245
+ const client = new import_ali_oss.default({ region, accessKeyId, accessKeySecret, bucket: bucket2 });
10230
10246
  const normalizedPrefix = prefix ? prefix.replace(/^\/+|\/+$/g, "") : "";
10231
10247
  const objects = await this.listObjectsForClient(client, normalizedPrefix);
10232
10248
  return objects.filter((item) => typeof item.name === "string" && item.name.length > 0).map((item) => ({
@@ -10248,7 +10264,7 @@ var AliyunService = class {
10248
10264
  const result = await client.listBuckets({});
10249
10265
  const buckets = Array.isArray(result) ? result : result?.buckets ?? [];
10250
10266
  return buckets.map(
10251
- (bucket) => typeof bucket === "string" ? bucket : bucket.name
10267
+ (bucket2) => typeof bucket2 === "string" ? bucket2 : bucket2.name
10252
10268
  ).filter(
10253
10269
  (name) => typeof name === "string" && name.trim().length > 0
10254
10270
  );
@@ -10756,8 +10772,8 @@ var StsCommandHandler = class {
10756
10772
  if (!token) {
10757
10773
  throw new Error("Missing session token. Run `pmate login` first.");
10758
10774
  }
10759
- const baseUrl = "https://ci.pmate.chat";
10760
- const response = await fetch(`${baseUrl}/oss/sts`, {
10775
+ const baseUrl2 = "https://ci.pmate.chat";
10776
+ const response = await fetch(`${baseUrl2}/oss/sts`, {
10761
10777
  method: "POST",
10762
10778
  headers: {
10763
10779
  "content-type": "application/json",
@@ -11163,17 +11179,17 @@ var OssCommandHandler = class _OssCommandHandler {
11163
11179
  ui.warn("No buckets found for current access key.");
11164
11180
  return;
11165
11181
  }
11166
- for (const bucket2 of buckets) {
11167
- ui.info(bucket2);
11182
+ for (const bucket3 of buckets) {
11183
+ ui.info(bucket3);
11168
11184
  }
11169
11185
  return;
11170
11186
  }
11171
11187
  const resolvedFile = import_node_path11.default.resolve(process.cwd(), args.filePath);
11172
11188
  this.assertFile(resolvedFile);
11173
11189
  const objectKey = this.normalizeObjectKey(args.objectKey);
11174
- const bucket = this.resolveBucket(args.bucket);
11175
- await AliyunService.uploadFile(resolvedFile, bucket, objectKey);
11176
- const publicUrl = buildOssPublicUrl(bucket, objectKey);
11190
+ const bucket2 = this.resolveBucket(args.bucket);
11191
+ await AliyunService.uploadFile(resolvedFile, bucket2, objectKey);
11192
+ const publicUrl = buildOssPublicUrl(bucket2, objectKey);
11177
11193
  if (publicUrl) {
11178
11194
  ui.plain(publicUrl);
11179
11195
  }
@@ -11202,8 +11218,8 @@ var OssCommandHandler = class _OssCommandHandler {
11202
11218
  return _OssCommandHandler.DEFAULT_BUCKET;
11203
11219
  }
11204
11220
  };
11205
- function buildOssPublicUrl(bucket, objectKey) {
11206
- if (bucket !== "parrot-static") return null;
11221
+ function buildOssPublicUrl(bucket2, objectKey) {
11222
+ if (bucket2 !== "parrot-static") return null;
11207
11223
  const encodedKey = objectKey.split("/").map((segment) => encodeURIComponent(segment)).join("/");
11208
11224
  return `${PARROT_STATIC_PUBLIC_BASE_URL}/${encodedKey}`;
11209
11225
  }
@@ -11819,11 +11835,11 @@ var PrCommandHandler = class {
11819
11835
  await this.run("git", ["rebase", `origin/${baseBranch}`]);
11820
11836
  }
11821
11837
  async ensureGitRepo() {
11822
- const inside = await this.runCapture("git", [
11838
+ const inside2 = await this.runCapture("git", [
11823
11839
  "rev-parse",
11824
11840
  "--is-inside-work-tree"
11825
11841
  ]);
11826
- if (inside.trim() !== "true") {
11842
+ if (inside2.trim() !== "true") {
11827
11843
  throw new Error("This command must be run inside a git repository.");
11828
11844
  }
11829
11845
  }
@@ -12291,14 +12307,14 @@ var SummaryCommandHandler = class {
12291
12307
  };
12292
12308
  }
12293
12309
  async ensureGitRepo(cwd) {
12294
- const inside = await this.runCapture(
12310
+ const inside2 = await this.runCapture(
12295
12311
  "git",
12296
12312
  ["rev-parse", "--is-inside-work-tree"],
12297
12313
  false,
12298
12314
  void 0,
12299
12315
  cwd
12300
12316
  );
12301
- if (inside.trim() !== "true") {
12317
+ if (inside2.trim() !== "true") {
12302
12318
  throw new Error("This command must be run inside a git repository.");
12303
12319
  }
12304
12320
  }
@@ -13876,14 +13892,14 @@ var LinearCommandHandler = class {
13876
13892
  }
13877
13893
  }
13878
13894
  async ensureGitRepo(cwd) {
13879
- const inside = await this.runCapture(
13895
+ const inside2 = await this.runCapture(
13880
13896
  "git",
13881
13897
  ["rev-parse", "--is-inside-work-tree"],
13882
13898
  false,
13883
13899
  void 0,
13884
13900
  cwd
13885
13901
  );
13886
- if (inside.trim() !== "true") {
13902
+ if (inside2.trim() !== "true") {
13887
13903
  throw new Error("This command must be run inside a git repository.");
13888
13904
  }
13889
13905
  }
@@ -13983,10 +13999,10 @@ var LinearCommandHandler = class {
13983
13999
  if (!apiKey) {
13984
14000
  throw new Error("Missing openAI.apiKey in ~/.pmate/config.yaml.");
13985
14001
  }
13986
- const baseUrl = config.openAI?.baseUrl?.trim();
14002
+ const baseUrl2 = config.openAI?.baseUrl?.trim();
13987
14003
  return new import_openai.default({
13988
14004
  apiKey,
13989
- baseURL: baseUrl ? `${baseUrl}/v1` : void 0
14005
+ baseURL: baseUrl2 ? `${baseUrl2}/v1` : void 0
13990
14006
  });
13991
14007
  }
13992
14008
  getResponseText(response) {
@@ -14267,9 +14283,9 @@ ${indent}\`\`\``;
14267
14283
  static richTextToPlain(richText) {
14268
14284
  return richText.map((item) => item.plain_text ?? item.text?.content ?? "").join("").trim();
14269
14285
  }
14270
- static async requestJson(path35, init) {
14286
+ static async requestJson(path36, init) {
14271
14287
  const token = this.getToken();
14272
- const response = await fetch(`${this.baseUrl}${path35}`, {
14288
+ const response = await fetch(`${this.baseUrl}${path36}`, {
14273
14289
  method: init.method,
14274
14290
  headers: {
14275
14291
  Authorization: `Bearer ${token}`,
@@ -15394,8 +15410,8 @@ var import_playwright = require("playwright");
15394
15410
  // src/im1BotClient.ts
15395
15411
  var DEFAULT_IM1_BASE_URL = "http://localhost:39223";
15396
15412
  var Im1BotClient = class {
15397
- constructor(baseUrl = process.env.PMATE_IM1_BASE_URL ?? DEFAULT_IM1_BASE_URL) {
15398
- this.baseUrl = baseUrl;
15413
+ constructor(baseUrl2 = process.env.PMATE_IM1_BASE_URL ?? DEFAULT_IM1_BASE_URL) {
15414
+ this.baseUrl = baseUrl2;
15399
15415
  }
15400
15416
  async health() {
15401
15417
  return this.request("/health");
@@ -16838,11 +16854,11 @@ var RegistryResourceCommandHandler = class {
16838
16854
  async handle(args) {
16839
16855
  const resource = args.type === "function" ? "functions" : "workers";
16840
16856
  const singular = args.type === "function" ? "Function" : "Worker";
16841
- const baseUrl = (args.baseUrl || process.env.PMATE_AGENT_API_BASE_URL || "https://agent-api.pmate.chat").replace(/\/+$/, "");
16857
+ const baseUrl2 = (args.baseUrl || process.env.PMATE_AGENT_API_BASE_URL || "https://agent-api.pmate.chat").replace(/\/+$/, "");
16842
16858
  const token = readRequiredSession({ preferredApp: DEFAULT_APP_ID }).token;
16843
16859
  if (args.action === "list") {
16844
16860
  const query = args.namespace ? `?namespace=${encodeURIComponent(args.namespace)}` : "";
16845
- const { items } = await request(baseUrl, token, "GET", `/v1/${resource}${query}`);
16861
+ const { items } = await request(baseUrl2, token, "GET", `/v1/${resource}${query}`);
16846
16862
  if (args.json) ui.plain(JSON.stringify(items, null, 2));
16847
16863
  else if (!items.length) ui.warn(`No ${resource} found.`);
16848
16864
  else for (const item of items) ui.info(item.id, { status: item.status, ...item.payload });
@@ -16850,18 +16866,18 @@ var RegistryResourceCommandHandler = class {
16850
16866
  }
16851
16867
  const resourcePath = `/v1/${resource}/${encodeURIComponent(args.namespace)}${args.action === "create" ? "" : `/${encodeURIComponent(args.name)}`}`;
16852
16868
  if (args.action === "get" || args.action === "view") {
16853
- const record2 = await request(baseUrl, token, "GET", resourcePath);
16869
+ const record2 = await request(baseUrl2, token, "GET", resourcePath);
16854
16870
  ui.plain(JSON.stringify(record2, null, 2));
16855
16871
  return;
16856
16872
  }
16857
16873
  if (args.action === "create" || args.action === "update") {
16858
16874
  const payload = readJson(args.filePath);
16859
- const record2 = await request(baseUrl, token, args.action === "create" ? "POST" : "PUT", resourcePath, payload);
16875
+ const record2 = await request(baseUrl2, token, args.action === "create" ? "POST" : "PUT", resourcePath, payload);
16860
16876
  ui.success(`${args.action === "create" ? "Created" : "Updated"} ${singular.toLowerCase()} ${record2.id}`);
16861
16877
  if (args.json) ui.plain(JSON.stringify(record2, null, 2));
16862
16878
  return;
16863
16879
  }
16864
- const record = await request(baseUrl, token, "DELETE", resourcePath);
16880
+ const record = await request(baseUrl2, token, "DELETE", resourcePath);
16865
16881
  ui.success(`Disabled ${singular.toLowerCase()} ${record.id}`);
16866
16882
  if (args.json) ui.plain(JSON.stringify(record, null, 2));
16867
16883
  }
@@ -16871,8 +16887,8 @@ function readJson(filePath) {
16871
16887
  if (!(0, import_node_fs15.existsSync)(absolutePath)) throw new Error(`JSON file not found: ${absolutePath}`);
16872
16888
  return JSON.parse((0, import_node_fs15.readFileSync)(absolutePath, "utf8"));
16873
16889
  }
16874
- async function request(baseUrl, token, method, pathname, body) {
16875
- const response = await fetch(`${baseUrl}${pathname}`, {
16890
+ async function request(baseUrl2, token, method, pathname, body) {
16891
+ const response = await fetch(`${baseUrl2}${pathname}`, {
16876
16892
  method,
16877
16893
  headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
16878
16894
  ...body === void 0 ? {} : { body: JSON.stringify(body) }
@@ -16973,9 +16989,9 @@ function descriptorPathSegments(descriptor) {
16973
16989
  const normalized = createDescriptor(descriptor);
16974
16990
  return ["chains", normalized.chain, "namespaces", normalized.ns, normalized.kind, normalized.name];
16975
16991
  }
16976
- function buildPathUrl(baseUrl, pathSegments, query) {
16977
- const path35 = `/${pathSegments.map((segment) => encodeURIComponent(segment)).join("/")}`;
16978
- const url = new URL(path35, baseUrl);
16992
+ function buildPathUrl(baseUrl2, pathSegments, query) {
16993
+ const path36 = `/${pathSegments.map((segment) => encodeURIComponent(segment)).join("/")}`;
16994
+ const url = new URL(path36, baseUrl2);
16979
16995
  if (query) {
16980
16996
  for (const [key, value] of Object.entries(query)) {
16981
16997
  url.searchParams.set(key, String(value));
@@ -16999,8 +17015,8 @@ function normalizeNamespace(value) {
16999
17015
  return normalized;
17000
17016
  }
17001
17017
  var IndexerClient = class {
17002
- constructor(baseUrl, headers = {}) {
17003
- this.baseUrl = baseUrl;
17018
+ constructor(baseUrl2, headers = {}) {
17019
+ this.baseUrl = baseUrl2;
17004
17020
  this.headers = headers;
17005
17021
  }
17006
17022
  async requestByPath(pathSegments, options = {}) {
@@ -17023,9 +17039,9 @@ var IndexerClient = class {
17023
17039
  }
17024
17040
  };
17025
17041
  var BlockLogAppender = class {
17026
- constructor(chainId, baseUrl, headers = {}) {
17042
+ constructor(chainId, baseUrl2, headers = {}) {
17027
17043
  this.chainId = chainId;
17028
- this.baseUrl = baseUrl;
17044
+ this.baseUrl = baseUrl2;
17029
17045
  this.headers = headers;
17030
17046
  }
17031
17047
  async append(logs) {
@@ -17288,8 +17304,8 @@ var NsCommandHandler = class {
17288
17304
  }
17289
17305
  }
17290
17306
  }
17291
- resolveBaseUrl(baseUrl) {
17292
- return (baseUrl || process.env.PMATE_NAMESPACE_API_BASE_URL || process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
17307
+ resolveBaseUrl(baseUrl2) {
17308
+ return (baseUrl2 || process.env.PMATE_NAMESPACE_API_BASE_URL || process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
17293
17309
  }
17294
17310
  resolveAuthHeaders() {
17295
17311
  return {
@@ -17433,8 +17449,8 @@ var StoreCommandHandler = class {
17433
17449
  const token = readRequiredSession({ preferredApp: DEFAULT_APP_ID }).token;
17434
17450
  return { Authorization: `Bearer ${token}` };
17435
17451
  }
17436
- resolveBaseUrl(baseUrl) {
17437
- const resolved = baseUrl || process.env.PMATE_STORE_BASE_URL || process.env.BLOCKCHAIN_BASE_URL;
17452
+ resolveBaseUrl(baseUrl2) {
17453
+ const resolved = baseUrl2 || process.env.PMATE_STORE_BASE_URL || process.env.BLOCKCHAIN_BASE_URL;
17438
17454
  if (!resolved) {
17439
17455
  throw new Error(
17440
17456
  "Missing store base URL. Provide --base-url or set PMATE_STORE_BASE_URL / BLOCKCHAIN_BASE_URL."
@@ -17465,8 +17481,8 @@ var StoreCommandHandler = class {
17465
17481
  return args.action === "set" || args.action === "delete";
17466
17482
  }
17467
17483
  async listNamespaces(args) {
17468
- const baseUrl = this.resolveIndexerBaseUrl(args.indexerBaseUrl);
17469
- const url = new URL(`/chains/${encodeURIComponent(args.chain)}/namespaces`, `${baseUrl}/`);
17484
+ const baseUrl2 = this.resolveIndexerBaseUrl(args.indexerBaseUrl);
17485
+ const url = new URL(`/chains/${encodeURIComponent(args.chain)}/namespaces`, `${baseUrl2}/`);
17470
17486
  const response = await fetch(url.toString(), {
17471
17487
  headers: {
17472
17488
  Accept: "application/json",
@@ -17908,11 +17924,11 @@ init_namespacedRef();
17908
17924
  var AppCommandHandler = class {
17909
17925
  async handle(args) {
17910
17926
  const token = this.readToken();
17911
- const baseUrl = this.resolveBaseUrl(args.baseUrl);
17927
+ const baseUrl2 = this.resolveBaseUrl(args.baseUrl);
17912
17928
  switch (args.action) {
17913
17929
  case "list": {
17914
17930
  const response = await this.request(
17915
- baseUrl,
17931
+ baseUrl2,
17916
17932
  token,
17917
17933
  "GET",
17918
17934
  "/apps"
@@ -17930,7 +17946,7 @@ var AppCommandHandler = class {
17930
17946
  case "view": {
17931
17947
  const pathname = this.buildAppPath(args.id);
17932
17948
  const record = await this.request(
17933
- baseUrl,
17949
+ baseUrl2,
17934
17950
  token,
17935
17951
  "GET",
17936
17952
  pathname
@@ -17944,9 +17960,9 @@ var AppCommandHandler = class {
17944
17960
  }
17945
17961
  case "create": {
17946
17962
  const payload = await this.preparePayload(args.filePath);
17947
- await this.requireNamespace(payload, baseUrl);
17963
+ await this.requireNamespace(payload, baseUrl2);
17948
17964
  const record = await this.request(
17949
- baseUrl,
17965
+ baseUrl2,
17950
17966
  token,
17951
17967
  "POST",
17952
17968
  "/apps",
@@ -17960,7 +17976,7 @@ var AppCommandHandler = class {
17960
17976
  const payload = await this.preparePayload(args.filePath, args.id);
17961
17977
  const pathname = this.buildAppPath(args.id);
17962
17978
  const record = await this.request(
17963
- baseUrl,
17979
+ baseUrl2,
17964
17980
  token,
17965
17981
  "PUT",
17966
17982
  pathname,
@@ -17972,7 +17988,7 @@ var AppCommandHandler = class {
17972
17988
  }
17973
17989
  case "icon": {
17974
17990
  const record = await this.request(
17975
- baseUrl,
17991
+ baseUrl2,
17976
17992
  token,
17977
17993
  "GET",
17978
17994
  this.buildAppPath(args.id)
@@ -18006,7 +18022,7 @@ var AppCommandHandler = class {
18006
18022
  case "icon-add": {
18007
18023
  const pathname = this.buildAppPath(args.id);
18008
18024
  const record = await this.request(
18009
- baseUrl,
18025
+ baseUrl2,
18010
18026
  token,
18011
18027
  "GET",
18012
18028
  pathname
@@ -18028,7 +18044,7 @@ var AppCommandHandler = class {
18028
18044
  [name]: source.value
18029
18045
  };
18030
18046
  const updatedRecord = await this.request(
18031
- baseUrl,
18047
+ baseUrl2,
18032
18048
  token,
18033
18049
  "PUT",
18034
18050
  pathname,
@@ -18052,7 +18068,7 @@ var AppCommandHandler = class {
18052
18068
  case "delete": {
18053
18069
  const pathname = this.buildAppPath(args.id);
18054
18070
  const record = await this.request(
18055
- baseUrl,
18071
+ baseUrl2,
18056
18072
  token,
18057
18073
  "DELETE",
18058
18074
  pathname
@@ -18063,7 +18079,7 @@ var AppCommandHandler = class {
18063
18079
  }
18064
18080
  case "rename": {
18065
18081
  const record = await this.request(
18066
- baseUrl,
18082
+ baseUrl2,
18067
18083
  token,
18068
18084
  "POST",
18069
18085
  `/apps/${encodeURIComponent(args.namespace)}/rename`,
@@ -18080,7 +18096,7 @@ var AppCommandHandler = class {
18080
18096
  }
18081
18097
  case "move": {
18082
18098
  const record = await this.request(
18083
- baseUrl,
18099
+ baseUrl2,
18084
18100
  token,
18085
18101
  "POST",
18086
18102
  `/apps/${encodeURIComponent(args.namespace)}/move`,
@@ -18098,8 +18114,8 @@ var AppCommandHandler = class {
18098
18114
  }
18099
18115
  }
18100
18116
  }
18101
- resolveBaseUrl(baseUrl) {
18102
- return (baseUrl || process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
18117
+ resolveBaseUrl(baseUrl2) {
18118
+ return (baseUrl2 || process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
18103
18119
  }
18104
18120
  readToken() {
18105
18121
  return readRequiredSession({
@@ -18126,8 +18142,8 @@ var AppCommandHandler = class {
18126
18142
  resolveFilePath(filePath) {
18127
18143
  return import_node_path24.default.resolve(process.cwd(), filePath);
18128
18144
  }
18129
- async request(baseUrl, token, method, pathname, body) {
18130
- const response = await fetch(`${baseUrl}${pathname}`, {
18145
+ async request(baseUrl2, token, method, pathname, body) {
18146
+ const response = await fetch(`${baseUrl2}${pathname}`, {
18131
18147
  method,
18132
18148
  headers: {
18133
18149
  Authorization: `Bearer ${token}`,
@@ -18146,11 +18162,11 @@ var AppCommandHandler = class {
18146
18162
  }
18147
18163
  return payload.data;
18148
18164
  }
18149
- async requireNamespace(payload, baseUrl) {
18165
+ async requireNamespace(payload, baseUrl2) {
18150
18166
  const namespace = readNamespaceFromPayload(payload);
18151
18167
  const registry = new NamespaceRegistry({
18152
18168
  chain: "pmate",
18153
- registryBaseUrl: baseUrl
18169
+ registryBaseUrl: baseUrl2
18154
18170
  });
18155
18171
  const exists = await registry.exists(namespace);
18156
18172
  if (!exists) {
@@ -18244,15 +18260,15 @@ function readNamespaceFromPayload(payload) {
18244
18260
  }
18245
18261
 
18246
18262
  // src/commands/ServiceCommandHandler.ts
18247
- var import_node_fs26 = require("fs");
18263
+ var import_node_fs27 = require("fs");
18248
18264
  var import_promises5 = require("fs/promises");
18249
- var import_node_path31 = __toESM(require("path"));
18250
- var import_node_child_process13 = require("child_process");
18265
+ var import_node_path32 = __toESM(require("path"));
18266
+ var import_node_child_process14 = require("child_process");
18251
18267
  var import_promises6 = require("readline/promises");
18252
18268
 
18253
18269
  // src/services/NativeServiceDeploy.ts
18254
- var import_node_path29 = __toESM(require("path"));
18255
- var import_node_fs24 = require("fs");
18270
+ var import_node_path30 = __toESM(require("path"));
18271
+ var import_node_fs25 = require("fs");
18256
18272
 
18257
18273
  // src/electronBuild.ts
18258
18274
  var import_node_child_process9 = require("child_process");
@@ -18270,7 +18286,7 @@ async function uploadDesktopArtifacts(directory, app, version, platform, arch) {
18270
18286
  if (app.split(":").length !== 2 || segments.some((s) => !/^[\w.-]+$/.test(s) || s === "." || s === "..")) throw new Error("Invalid desktop release identity");
18271
18287
  if (!["mac", "win"].includes(platform) || !["arm64", "x64"].includes(arch) || !/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(version)) throw new Error("Desktop publication requires a stable version and supported target");
18272
18288
  const { token } = readRequiredSession({ preferredApp: DEFAULT_APP_ID });
18273
- const bucket = "parrot-static";
18289
+ const bucket2 = "parrot-static";
18274
18290
  const prefix = `desktop/${segments.join("/")}/`;
18275
18291
  const url = (key) => `https://parrot-static.pmate.chat/${key.split("/").map(encodeURIComponent).join("/")}`;
18276
18292
  const artifacts = (0, import_node_fs20.readdirSync)(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && (platform === "mac" ? /\.(dmg|zip)$/i : /\.(exe|zip)$/i).test(entry.name)).sort((a, b) => a.name.localeCompare(b.name)).map((entry) => {
@@ -18280,11 +18296,11 @@ async function uploadDesktopArtifacts(directory, app, version, platform, arch) {
18280
18296
  });
18281
18297
  if (!artifacts.length) throw new Error("No desktop installers found to publish");
18282
18298
  const manifestKey = prefix + "release.json";
18283
- const existing = await AliyunService.readJsonObject(bucket, manifestKey);
18299
+ const existing = await AliyunService.readJsonObject(bucket2, manifestKey);
18284
18300
  const release = { schemaVersion: 1, app, version, platform, arch, artifacts };
18285
18301
  if (existing !== null && JSON.stringify(existing) !== JSON.stringify(release)) throw new Error("Desktop release already exists with different artifacts; bump the app version");
18286
- for (const artifact of artifacts) await AliyunService.uploadFile(import_node_path25.default.join(directory, artifact.name), bucket, artifact.objectKey);
18287
- await AliyunService.uploadJsonObject(bucket, manifestKey, release);
18302
+ for (const artifact of artifacts) await AliyunService.uploadFile(import_node_path25.default.join(directory, artifact.name), bucket2, artifact.objectKey);
18303
+ await AliyunService.uploadJsonObject(bucket2, manifestKey, release);
18288
18304
  const base = (process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
18289
18305
  const response = await fetch(`${base}/versions/${encodeURIComponent(app)}`, {
18290
18306
  method: "POST",
@@ -18295,7 +18311,7 @@ async function uploadDesktopArtifacts(directory, app, version, platform, arch) {
18295
18311
  });
18296
18312
  const result = await response.json();
18297
18313
  if (!response.ok || result.success !== true) throw new Error(`Installers uploaded but version registration failed: ${result.message || response.status}. Retry this release before announcing it.`);
18298
- return { bucket, manifestUrl: url(manifestKey), downloads: artifacts };
18314
+ return { bucket: bucket2, manifestUrl: url(manifestKey), downloads: artifacts };
18299
18315
  }
18300
18316
 
18301
18317
  // src/electronBuild.ts
@@ -18964,12 +18980,293 @@ function capitalize(value) {
18964
18980
  return value.slice(0, 1).toUpperCase() + value.slice(1);
18965
18981
  }
18966
18982
 
18967
- // src/services/IosBuildService.ts
18983
+ // src/services/HarmonyReleaseService.ts
18968
18984
  var import_node_child_process11 = require("child_process");
18969
18985
  var import_node_crypto6 = require("crypto");
18970
18986
  var import_node_fs23 = require("fs");
18971
18987
  var import_node_os12 = __toESM(require("os"));
18972
18988
  var import_node_path28 = __toESM(require("path"));
18989
+ var import_json5 = __toESM(require("json5"));
18990
+ var HARMONY_SIGNING_KEYS = ["HARMONY_KEYSTORE_BASE64", "HARMONY_CERTIFICATE_BASE64", "HARMONY_PROFILE_BASE64", "HARMONY_STORE_PASSWORD", "HARMONY_KEY_ALIAS", "HARMONY_KEY_PASSWORD"];
18991
+ var bucket = "parrot-static";
18992
+ var baseUrl = "https://parrot-static.pmate.chat";
18993
+ var inside = (parent, child) => {
18994
+ const rel = import_node_path28.default.relative(parent, child);
18995
+ return !rel || !rel.startsWith(`..${import_node_path28.default.sep}`) && rel !== ".." && !import_node_path28.default.isAbsolute(rel);
18996
+ };
18997
+ var readJson5 = (file) => import_json5.default.parse((0, import_node_fs23.readFileSync)(file, "utf8"));
18998
+ function readHarmonyVersion(appDir, expected) {
18999
+ const app = readJson5(import_node_path28.default.join(appDir, "AppScope/app.json5")).app;
19000
+ if (!app || app.bundleName !== expected) throw new Error("HarmonyOS bundleName does not match service.mobile.bundleName");
19001
+ if (!/^\d+\.\d+\.\d+$/.test(app.versionName ?? "") || !Number.isSafeInteger(app.versionCode) || app.versionCode <= 0) throw new Error("HarmonyOS source requires a stable versionName and positive integer versionCode");
19002
+ return { bundleName: app.bundleName, versionName: app.versionName, versionCode: app.versionCode };
19003
+ }
19004
+ function stageHarmonySources(repoRoot, appDir, target) {
19005
+ const copied = [];
19006
+ const excluded = /* @__PURE__ */ new Set([".git", "node_modules", "oh_modules", ".hvigor", ".idea", "build", "dist", ".gradle", "local.properties"]);
19007
+ const copy = (source) => {
19008
+ if (!inside(repoRoot, source)) throw new Error("HarmonyOS local dependencies must stay inside the repository");
19009
+ if (copied.some((dir) => inside(dir, source))) return;
19010
+ if (!(0, import_node_fs23.existsSync)(source) || !(0, import_node_fs23.lstatSync)(source).isDirectory() || (0, import_node_fs23.lstatSync)(source).isSymbolicLink()) throw new Error("Invalid HarmonyOS source dependency");
19011
+ if (!inside((0, import_node_fs23.realpathSync)(repoRoot), (0, import_node_fs23.realpathSync)(source))) throw new Error("HarmonyOS local dependencies must stay inside the repository");
19012
+ const dest = import_node_path28.default.join(target, import_node_path28.default.relative(repoRoot, source));
19013
+ (0, import_node_fs23.cpSync)(source, dest, { recursive: true, filter: (file) => {
19014
+ if ((0, import_node_fs23.lstatSync)(file).isSymbolicLink()) throw new Error("HarmonyOS source symlinks are not supported");
19015
+ const name = import_node_path28.default.basename(file);
19016
+ return !excluded.has(name) && !name.startsWith(".env") && !/\.(p12|pfx|p7b|keystore|jks|key|pem|cer)$/i.test(name);
19017
+ } });
19018
+ copied.push(source);
19019
+ const inspect = (dir) => {
19020
+ for (const entry of (0, import_node_fs23.readdirSync)(dir, { withFileTypes: true })) {
19021
+ const file = import_node_path28.default.join(dir, entry.name);
19022
+ if (entry.isDirectory()) inspect(file);
19023
+ else if (entry.name === "oh-package.json5") {
19024
+ const manifest = readJson5(file);
19025
+ for (const value of Object.values({ ...manifest.dependencies, ...manifest.devDependencies })) {
19026
+ if (typeof value !== "string" || !value.startsWith("file:")) continue;
19027
+ const original = import_node_path28.default.join(repoRoot, import_node_path28.default.relative(target, import_node_path28.default.dirname(file)));
19028
+ copy(import_node_path28.default.resolve(original, value.slice(5)));
19029
+ }
19030
+ }
19031
+ }
19032
+ };
19033
+ inspect(dest);
19034
+ };
19035
+ copy(appDir);
19036
+ const profile = readJson5(import_node_path28.default.join(appDir, "build-profile.json5"));
19037
+ for (const module2 of profile.modules ?? []) {
19038
+ if (typeof module2.srcPath !== "string") throw new Error("Invalid HarmonyOS module srcPath");
19039
+ copy(import_node_path28.default.resolve(appDir, module2.srcPath));
19040
+ }
19041
+ return import_node_path28.default.join(target, import_node_path28.default.relative(repoRoot, appDir));
19042
+ }
19043
+ function executable(value) {
19044
+ const candidates = value.includes(import_node_path28.default.sep) ? [import_node_path28.default.resolve(value)] : (process.env.PATH ?? "").split(import_node_path28.default.delimiter).map((dir) => import_node_path28.default.join(dir, value));
19045
+ for (const file of candidates) {
19046
+ try {
19047
+ (0, import_node_fs23.accessSync)(file, import_node_fs23.constants.X_OK);
19048
+ if ((0, import_node_fs23.lstatSync)(file).isFile() || (0, import_node_fs23.lstatSync)(file).isSymbolicLink()) return file;
19049
+ } catch {
19050
+ }
19051
+ }
19052
+ throw new Error(`HarmonyOS tool is missing: ${value}; configure the DevEco build toolchain`);
19053
+ }
19054
+ function findHarmonyTools() {
19055
+ if (!["darwin", "linux"].includes(process.platform)) throw new Error("HarmonyOS release scripts require macOS or Linux");
19056
+ const home = "/Applications/DevEco-Studio.app/Contents";
19057
+ const sdk = import_node_path28.default.resolve(process.env.DEVECO_SDK_HOME ?? `${home}/sdk`);
19058
+ if (!(0, import_node_fs23.existsSync)(sdk)) throw new Error("HarmonyOS SDK not found; install DevEco Studio or set DEVECO_SDK_HOME");
19059
+ const tools = { sdk, ohpm: executable(process.env.OHPM_BIN ?? `${home}/tools/ohpm/bin/ohpm`), hvigor: executable(process.env.HVIGORW_BIN ?? `${home}/tools/hvigor/bin/hvigorw`), node: executable(process.env.NODE_BIN ?? process.execPath), java: executable(process.env.JAVA_BIN ?? "java"), signer: process.env.HAP_SIGN_TOOL ?? "" };
19060
+ if (!tools.signer) {
19061
+ const jars = [];
19062
+ const scan = (dir) => {
19063
+ for (const entry of (0, import_node_fs23.readdirSync)(dir, { withFileTypes: true })) {
19064
+ const file = import_node_path28.default.join(dir, entry.name);
19065
+ if (entry.isDirectory()) scan(file);
19066
+ else if (entry.isFile() && entry.name === "hap-sign-tool.jar") jars.push(file);
19067
+ }
19068
+ };
19069
+ scan(sdk);
19070
+ if (jars.length !== 1) throw new Error("Set HAP_SIGN_TOOL to the intended hap-sign-tool.jar");
19071
+ tools.signer = jars[0];
19072
+ }
19073
+ tools.signer = import_node_path28.default.resolve(tools.signer);
19074
+ if (!(0, import_node_fs23.existsSync)(tools.signer)) throw new Error("HAP_SIGN_TOOL does not exist");
19075
+ executable("bash");
19076
+ executable("unzip");
19077
+ return tools;
19078
+ }
19079
+ var runHarmonyCommand = async (command, args, options) => {
19080
+ const log = (0, import_node_fs23.openSync)(options.log, "a", 384);
19081
+ const output = options.output ? (0, import_node_fs23.openSync)(options.output, "w", 384) : void 0;
19082
+ try {
19083
+ return await new Promise((resolve, reject) => {
19084
+ const child = (0, import_node_child_process11.spawn)(command, args, { cwd: options.cwd, env: options.env, detached: process.platform !== "win32", stdio: ["ignore", output ?? (options.capture ? "pipe" : log), log] });
19085
+ let text = "", oversized = false;
19086
+ child.stdout?.on("data", (chunk) => {
19087
+ if (Buffer.byteLength(text) + chunk.length > 1024 * 1024) {
19088
+ oversized = true;
19089
+ child.kill();
19090
+ } else text += chunk.toString();
19091
+ });
19092
+ const interrupt = () => {
19093
+ try {
19094
+ if (process.platform !== "win32" && child.pid) process.kill(-child.pid, "SIGTERM");
19095
+ else child.kill("SIGTERM");
19096
+ } catch {
19097
+ }
19098
+ };
19099
+ process.once("SIGINT", interrupt);
19100
+ process.once("SIGTERM", interrupt);
19101
+ const clean = () => {
19102
+ process.removeListener("SIGINT", interrupt);
19103
+ process.removeListener("SIGTERM", interrupt);
19104
+ };
19105
+ child.once("error", () => {
19106
+ clean();
19107
+ reject(new Error(`Cannot run ${import_node_path28.default.basename(command)}; see ${options.log}`));
19108
+ });
19109
+ child.once("close", (code) => {
19110
+ clean();
19111
+ code === 0 && !oversized ? resolve(text) : reject(new Error(`HarmonyOS ${import_node_path28.default.basename(command)} failed (${code}); see ${options.log}`));
19112
+ });
19113
+ });
19114
+ } finally {
19115
+ (0, import_node_fs23.closeSync)(log);
19116
+ if (output !== void 0) (0, import_node_fs23.closeSync)(output);
19117
+ }
19118
+ };
19119
+ function signingMaterial(values) {
19120
+ for (const key of HARMONY_SIGNING_KEYS) if (!values[key]?.trim()) throw new Error(`Missing HarmonyOS service signing variable: ${key}`);
19121
+ const decode2 = (key) => {
19122
+ const text = values[key].replace(/\s/g, ""), bytes = Buffer.from(text, "base64");
19123
+ if (!bytes.length || bytes.length > 5 * 1024 * 1024 || bytes.toString("base64") !== text) throw new Error(`Invalid HarmonyOS signing material: ${key}`);
19124
+ return bytes;
19125
+ };
19126
+ const certificate = decode2("HARMONY_CERTIFICATE_BASE64");
19127
+ const fingerprint = new import_node_crypto6.X509Certificate(certificate).fingerprint256.replace(/:/g, "");
19128
+ return { keystore: decode2("HARMONY_KEYSTORE_BASE64"), certificate, profile: decode2("HARMONY_PROFILE_BASE64"), fingerprint };
19129
+ }
19130
+ function assertHarmonyMetadata(raw, version) {
19131
+ const data = raw;
19132
+ if (!data?.app || data.app.bundleName !== version.bundleName || data.app.versionName !== version.versionName || data.app.versionCode !== version.versionCode || data.app.debug !== void 0 && data.app.debug !== false || data.module?.debug !== void 0 && data.module.debug !== false) throw new Error("HarmonyOS package identity/version/debug metadata mismatch");
19133
+ }
19134
+ var withHarmonyPublicationLock = async (bucket2, key, publish) => {
19135
+ if (!/^harmony\/[\w-]+\/[\w-]+\/\.publish-lock\.json$/.test(key)) throw new Error("Invalid HarmonyOS publication lock key");
19136
+ await AliyunService.assertUnversionedBucket(bucket2);
19137
+ const owner = (0, import_node_crypto6.randomUUID)();
19138
+ try {
19139
+ await AliyunService.uploadJsonObject(bucket2, key, { owner, createdAt: (/* @__PURE__ */ new Date()).toISOString() }, { "x-oss-forbid-overwrite": "true" });
19140
+ } catch {
19141
+ throw new Error("HarmonyOS publication is locked or the lock cannot be created; verify the active publisher before clearing a stale lock");
19142
+ }
19143
+ try {
19144
+ return await publish();
19145
+ } finally {
19146
+ const lock = await AliyunService.readJsonObject(bucket2, key);
19147
+ if (lock?.owner !== owner) throw new Error("HarmonyOS publication lock ownership changed; refusing to delete another publisher's lock");
19148
+ await AliyunService.removePublicationLock(bucket2, key);
19149
+ }
19150
+ };
19151
+ var HarmonyReleaseService = class {
19152
+ constructor(registry, deps = {}) {
19153
+ this.registry = registry;
19154
+ this.deps = deps;
19155
+ }
19156
+ async release(service, options) {
19157
+ if (!("type" in service) || service.type !== "harmonyos" || !service.mobile || !("bundleName" in service.mobile)) throw new Error("HarmonyOS requires service.mobile.bundleName");
19158
+ if (service.appIds?.length !== 1) throw new Error("HarmonyOS service requires exactly one appIds application identity");
19159
+ const application = service.appIds[0];
19160
+ const root = options.cwd ? import_node_path28.default.resolve(options.cwd) : resolveRepositoryLocalRoot(service.repository ?? service.mobile.repository ?? "");
19161
+ const dir = service.dir ?? service.mobile.dir;
19162
+ if (!dir) throw new Error("HarmonyOS service requires a source directory");
19163
+ const appDir = import_node_path28.default.resolve(root, dir);
19164
+ if (!inside(root, appDir)) throw new Error("HarmonyOS source must stay inside the repository");
19165
+ const version = readHarmonyVersion(appDir, service.mobile.bundleName);
19166
+ const script = service.build?.script ?? "scripts/build-release.sh";
19167
+ if (import_node_path28.default.isAbsolute(script) || !inside(appDir, import_node_path28.default.resolve(appDir, script)) || (!(0, import_node_fs23.existsSync)(import_node_path28.default.resolve(appDir, script)) || !(0, import_node_fs23.lstatSync)(import_node_path28.default.resolve(appDir, script)).isFile())) throw new Error("HarmonyOS build.script must name an existing script inside the application");
19168
+ const prefix = `harmony/${service.namespace}/${service.name}`;
19169
+ if (![service.namespace, service.name].every((v) => /^[\w-]+$/.test(v))) throw new Error("Invalid HarmonyOS service identity");
19170
+ const releasePrefix = `${prefix}/${version.versionName}/${version.versionCode}/`;
19171
+ const manifestUrl = `${baseUrl}/${releasePrefix}release.json`, latestUrl = `${baseUrl}/${prefix}/latest.json`;
19172
+ const plan = { serviceId: service.id, app: application, type: "harmonyos", ...version, appDir, script, manifestUrl, latestUrl, distribution: "oss", appGallerySubmitted: false };
19173
+ if (options.dryRun) return { ...plan, status: "dry-run" };
19174
+ const tools = (this.deps.tools ?? findHarmonyTools)();
19175
+ const read = this.deps.readJson ?? AliyunService.readJsonObject;
19176
+ if (!options.local) {
19177
+ const latest = await read(bucket, `${prefix}/latest.json`);
19178
+ if (latest && (latest.serviceId !== service.id || latest.app !== application || latest.bundleName !== version.bundleName || latest.schemaVersion !== 1 || latest.platform !== "harmonyos" || latest.signature !== "verified" || !Number.isSafeInteger(latest.versionCode) || latest.versionCode <= 0)) throw new Error("Invalid existing HarmonyOS update manifest");
19179
+ if (latest && latest.versionCode >= version.versionCode) throw new Error("HarmonyOS versionCode is already published or behind the latest release; update AppScope/app.json5");
19180
+ if (await read(bucket, `${releasePrefix}release.json`) !== null || (await (this.deps.list ?? AliyunService.listObjects)(bucket, releasePrefix)).length) throw new Error("HarmonyOS release already exists; published objects are immutable");
19181
+ }
19182
+ if (!this.registry) throw new Error("HarmonyOS signing requires the service environment registry");
19183
+ const { values } = await this.registry.resolveEnv(service.id, { stage: "prod", includeSecretValue: true, includeHost: false });
19184
+ const material = signingMaterial(values);
19185
+ const outputBase = options.outDir ? import_node_path28.default.resolve(options.outDir) : import_node_path28.default.join(import_node_os12.default.homedir(), ".pmate/harmony-builds", service.namespace, service.name);
19186
+ if (inside(appDir, outputBase)) throw new Error("HarmonyOS output must be outside the application source directory");
19187
+ (0, import_node_fs23.mkdirSync)(outputBase, { recursive: true, mode: 448 });
19188
+ const output = (0, import_node_fs23.mkdtempSync)(import_node_path28.default.join(outputBase, `release-${version.versionCode}-`)), log = import_node_path28.default.join(output, "build.log");
19189
+ (0, import_node_fs23.writeFileSync)(log, "", { mode: 384 });
19190
+ const temp = (0, import_node_fs23.mkdtempSync)(import_node_path28.default.join(import_node_os12.default.tmpdir(), "pmate-harmony-")), run = this.deps.run ?? runHarmonyCommand;
19191
+ let artifacts = [];
19192
+ try {
19193
+ const staged = stageHarmonySources(root, appDir, import_node_path28.default.join(temp, "checkout"));
19194
+ for (const relative of ["build-profile.json5", "AppScope/app.json5"]) {
19195
+ const file = import_node_path28.default.join(staged, relative);
19196
+ (0, import_node_fs23.writeFileSync)(file, JSON.stringify(readJson5(file), null, 2));
19197
+ }
19198
+ const keys = import_node_path28.default.join(temp, "signing");
19199
+ (0, import_node_fs23.mkdirSync)(keys, { mode: 448 });
19200
+ for (const [name, bytes] of [["release.p12", material.keystore], ["release.cer", material.certificate], ["release.p7b", material.profile]]) (0, import_node_fs23.writeFileSync)(import_node_path28.default.join(keys, name), bytes, { mode: 384 });
19201
+ const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => !key.startsWith("HARMONY_")));
19202
+ Object.assign(env, { DEVECO_SDK_HOME: tools.sdk, OHPM_BIN: tools.ohpm, HVIGORW_BIN: tools.hvigor, NODE_BIN: tools.node, JAVA_BIN: tools.java, HAP_SIGN_TOOL: tools.signer, HARMONY_KEYSTORE_FILE: import_node_path28.default.join(keys, "release.p12"), HARMONY_CERTIFICATE_FILE: import_node_path28.default.join(keys, "release.cer"), HARMONY_PROFILE_FILE: import_node_path28.default.join(keys, "release.p7b"), HARMONY_STORE_PASSWORD: values.HARMONY_STORE_PASSWORD, HARMONY_KEY_ALIAS: values.HARMONY_KEY_ALIAS, HARMONY_KEY_PASSWORD: values.HARMONY_KEY_PASSWORD, HARMONY_VERSION_NAME: version.versionName, HARMONY_VERSION_CODE: String(version.versionCode), HARMONY_RELEASE_DRY_RUN: "0" });
19203
+ const opts = { cwd: staged, env, log };
19204
+ await run("bash", [import_node_path28.default.resolve(staged, script)], opts);
19205
+ const dist = import_node_path28.default.join(staged, "dist");
19206
+ const files = (0, import_node_fs23.readdirSync)(dist, { withFileTypes: true }).filter((e) => e.isFile() && /\.(app|hap)$/.test(e.name)).map((e) => import_node_path28.default.join(dist, e.name));
19207
+ if (files.length !== 2 || files.filter((f) => f.endsWith(".app")).length !== 1 || files.filter((f) => f.endsWith(".hap")).length !== 1) throw new Error("HarmonyOS build must produce exactly one signed APP and one signed HAP");
19208
+ const check = async (file, inspectMetadata) => {
19209
+ const id = (0, import_node_crypto6.createHash)("sha256").update(file).digest("hex").slice(0, 16), cert = import_node_path28.default.join(temp, `${id}.cer`);
19210
+ await run(tools.java, ["-jar", tools.signer, "verify-app", "-inFile", file, "-outCertChain", cert, "-outProfile", import_node_path28.default.join(temp, `${id}.p7b`)], opts);
19211
+ if (new import_node_crypto6.X509Certificate((0, import_node_fs23.readFileSync)(cert)).fingerprint256.replace(/:/g, "") !== material.fingerprint) throw new Error("HarmonyOS signer certificate does not match service certificate");
19212
+ if (inspectMetadata) assertHarmonyMetadata(JSON.parse(await run("unzip", ["-p", file, "module.json"], { ...opts, capture: true })), version);
19213
+ };
19214
+ for (const file of files) {
19215
+ await check(file, file.endsWith(".hap"));
19216
+ if (file.endsWith(".app")) {
19217
+ const names = (await run("unzip", ["-Z1", file], { ...opts, capture: true })).split(/\r?\n/).filter((name) => /\.(hap|hsp)$/.test(name));
19218
+ if (!names.length) throw new Error("HarmonyOS APP contains no package modules");
19219
+ for (const [index, name] of names.entries()) {
19220
+ if (name.startsWith("/") || name.includes("\\") || name.split("/").includes("..")) throw new Error("Unsafe HarmonyOS archive member");
19221
+ const embedded = import_node_path28.default.join(temp, `module-${index}${import_node_path28.default.extname(name)}`);
19222
+ await run("unzip", ["-p", file, name], { ...opts, output: embedded });
19223
+ await check(embedded, true);
19224
+ }
19225
+ }
19226
+ }
19227
+ artifacts = [];
19228
+ for (const file of files) {
19229
+ const name = import_node_path28.default.basename(file);
19230
+ if (!/^[A-Za-z0-9._-]+\.(app|hap)$/.test(name)) throw new Error("Invalid HarmonyOS artifact filename");
19231
+ const size = (0, import_node_fs23.statSync)(file).size;
19232
+ if (!size) throw new Error("Empty HarmonyOS artifact");
19233
+ const target = import_node_path28.default.join(output, name);
19234
+ (0, import_node_fs23.cpSync)(file, target);
19235
+ const hash = (0, import_node_crypto6.createHash)("sha256");
19236
+ for await (const chunk of (0, import_node_fs23.createReadStream)(target)) hash.update(chunk);
19237
+ artifacts.push({ name, type: import_node_path28.default.extname(name).slice(1), objectKey: releasePrefix + name, downloadUrl: `${baseUrl}/${releasePrefix}${name}`, sha256: hash.digest("hex"), size });
19238
+ }
19239
+ } finally {
19240
+ (0, import_node_fs23.rmSync)(temp, { recursive: true, force: true });
19241
+ }
19242
+ if (options.local) return { ...plan, status: "local", output, log, artifacts };
19243
+ let revision;
19244
+ try {
19245
+ revision = (0, import_node_child_process11.execFileSync)("git", ["rev-parse", "HEAD"], { cwd: root, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
19246
+ } catch {
19247
+ }
19248
+ const manifest = { schemaVersion: 1, serviceId: service.id, app: application, platform: "harmonyos", distribution: "oss", appGallerySubmitted: false, ...version, signature: "verified", certificateSha256: material.fingerprint, sourceRevision: revision, artifacts, publishedAt: (/* @__PURE__ */ new Date()).toISOString() };
19249
+ const upload = this.deps.upload ?? AliyunService.uploadFile, uploadJson = this.deps.uploadJson ?? AliyunService.uploadJsonObject;
19250
+ await (this.deps.lock ?? withHarmonyPublicationLock)(bucket, `${prefix}/.publish-lock.json`, async () => {
19251
+ const latest = await read(bucket, `${prefix}/latest.json`);
19252
+ if (latest && (latest.serviceId !== service.id || latest.app !== application || latest.bundleName !== version.bundleName || latest.schemaVersion !== 1 || latest.platform !== "harmonyos" || latest.signature !== "verified" || !Number.isSafeInteger(latest.versionCode) || latest.versionCode <= 0)) throw new Error("Invalid existing HarmonyOS update manifest");
19253
+ if (latest && latest.versionCode >= version.versionCode) throw new Error("A same or newer HarmonyOS release was published during the build; latest is unchanged");
19254
+ if (await read(bucket, `${releasePrefix}release.json`) !== null || (await (this.deps.list ?? AliyunService.listObjects)(bucket, releasePrefix)).length) throw new Error("HarmonyOS release already exists; published objects are immutable");
19255
+ for (const artifact of artifacts) await upload(import_node_path28.default.join(output, artifact.name), bucket, artifact.objectKey, { "x-oss-forbid-overwrite": "true" });
19256
+ await uploadJson(bucket, `${releasePrefix}release.json`, manifest, { "x-oss-forbid-overwrite": "true" });
19257
+ await uploadJson(bucket, `${prefix}/latest.json`, manifest);
19258
+ });
19259
+ (0, import_node_fs23.writeFileSync)(import_node_path28.default.join(output, "release.json"), JSON.stringify(manifest, null, 2));
19260
+ return { ...plan, status: "published", output, log, signature: "verified", artifacts };
19261
+ }
19262
+ };
19263
+
19264
+ // src/services/IosBuildService.ts
19265
+ var import_node_child_process12 = require("child_process");
19266
+ var import_node_crypto7 = require("crypto");
19267
+ var import_node_fs24 = require("fs");
19268
+ var import_node_os13 = __toESM(require("os"));
19269
+ var import_node_path29 = __toESM(require("path"));
18973
19270
  function iosBuildInteger(value) {
18974
19271
  if (!/^(0|[1-9]\d*)$/.test(String(value)) || !Number.isSafeInteger(Number(value))) {
18975
19272
  throw new Error(`iOS Build must be a non-negative safe integer: ${String(value)}`);
@@ -18978,13 +19275,13 @@ function iosBuildInteger(value) {
18978
19275
  }
18979
19276
  async function runXcode(args, cwd, logPath) {
18980
19277
  return new Promise((resolve, reject) => {
18981
- const child = (0, import_node_child_process11.spawn)("xcodebuild", args, { cwd, stdio: ["ignore", "pipe", "pipe"] });
19278
+ const child = (0, import_node_child_process12.spawn)("xcodebuild", args, { cwd, stdio: ["ignore", "pipe", "pipe"] });
18982
19279
  let output = "";
18983
19280
  child.stdout.on("data", (chunk) => {
18984
19281
  if (args.includes("-json") || args.includes("-version")) output += chunk.toString();
18985
- (0, import_node_fs23.appendFileSync)(logPath, chunk);
19282
+ (0, import_node_fs24.appendFileSync)(logPath, chunk);
18986
19283
  });
18987
- child.stderr.on("data", (chunk) => (0, import_node_fs23.appendFileSync)(logPath, chunk));
19284
+ child.stderr.on("data", (chunk) => (0, import_node_fs24.appendFileSync)(logPath, chunk));
18988
19285
  child.on("error", reject);
18989
19286
  child.on("close", (code) => code === 0 ? resolve(output) : reject(new Error(`xcodebuild failed (${code}); see ${logPath}`)));
18990
19287
  });
@@ -19003,18 +19300,18 @@ var IosBuildService = class {
19003
19300
  const repository = service.repository ?? service.mobile?.repository;
19004
19301
  const dir = service.dir ?? service.mobile?.dir;
19005
19302
  if (!dir || !repository && !options.cwd) throw new Error("iOS service requires repository and dir, or --cwd and dir");
19006
- const repoRoot = options.cwd ? import_node_path28.default.resolve(options.cwd) : resolveRepositoryLocalRoot(repository);
19007
- const appDir = import_node_path28.default.resolve(repoRoot, dir);
19008
- if (!(0, import_node_fs23.existsSync)(appDir)) throw new Error(`iOS app dir not found: ${appDir}`);
19303
+ const repoRoot = options.cwd ? import_node_path29.default.resolve(options.cwd) : resolveRepositoryLocalRoot(repository);
19304
+ const appDir = import_node_path29.default.resolve(repoRoot, dir);
19305
+ if (!(0, import_node_fs24.existsSync)(appDir)) throw new Error(`iOS app dir not found: ${appDir}`);
19009
19306
  const explicit = options.project ?? options.workspace;
19010
- const candidates = explicit ? [import_node_path28.default.resolve(appDir, explicit)] : (0, import_node_fs23.readdirSync)(appDir).filter((name) => /\.(xcodeproj|xcworkspace)$/.test(name)).map((name) => import_node_path28.default.join(appDir, name));
19011
- if (candidates.length !== 1 || !(0, import_node_fs23.existsSync)(candidates[0])) throw new Error("Specify exactly one existing --project or --workspace; project discovery is ambiguous or empty");
19307
+ const candidates = explicit ? [import_node_path29.default.resolve(appDir, explicit)] : (0, import_node_fs24.readdirSync)(appDir).filter((name) => /\.(xcodeproj|xcworkspace)$/.test(name)).map((name) => import_node_path29.default.join(appDir, name));
19308
+ if (candidates.length !== 1 || !(0, import_node_fs24.existsSync)(candidates[0])) throw new Error("Specify exactly one existing --project or --workspace; project discovery is ambiguous or empty");
19012
19309
  const project = candidates[0];
19013
- const expectedExtension = options.workspace ? ".xcworkspace" : options.project ? ".xcodeproj" : import_node_path28.default.extname(project);
19014
- if (![".xcodeproj", ".xcworkspace"].includes(expectedExtension) || import_node_path28.default.extname(project) !== expectedExtension) throw new Error("Invalid Xcode project/workspace extension");
19015
- const root = this.deps.stateRoot ?? import_node_path28.default.join(import_node_os12.default.homedir(), ".pmate", "ios-builds");
19016
- (0, import_node_fs23.mkdirSync)(root, { recursive: true, mode: 448 });
19017
- const preflightLog = import_node_path28.default.join(root, `preflight-${process.pid}-${Date.now()}.log`);
19310
+ const expectedExtension = options.workspace ? ".xcworkspace" : options.project ? ".xcodeproj" : import_node_path29.default.extname(project);
19311
+ if (![".xcodeproj", ".xcworkspace"].includes(expectedExtension) || import_node_path29.default.extname(project) !== expectedExtension) throw new Error("Invalid Xcode project/workspace extension");
19312
+ const root = this.deps.stateRoot ?? import_node_path29.default.join(import_node_os13.default.homedir(), ".pmate", "ios-builds");
19313
+ (0, import_node_fs24.mkdirSync)(root, { recursive: true, mode: 448 });
19314
+ const preflightLog = import_node_path29.default.join(root, `preflight-${process.pid}-${Date.now()}.log`);
19018
19315
  const run = this.deps.run ?? runXcode;
19019
19316
  await run(["-version"], appDir, preflightLog);
19020
19317
  const common2 = [expectedExtension === ".xcworkspace" ? "-workspace" : "-project", project, "-scheme", options.scheme, "-configuration", "Release", "-destination", "generic/platform=iOS"];
@@ -19029,19 +19326,19 @@ var IosBuildService = class {
19029
19326
  if (!bundleId || !/^\d+\.\d+(?:\.\d+)?$/.test(version ?? "") || !/^[A-Z0-9]{10}$/.test(team ?? "")) throw new Error("Missing or invalid bundle ID, MARKETING_VERSION or signing team; use --team if needed");
19030
19327
  if (service.mobile && "bundleId" in service.mobile && service.mobile.bundleId !== bundleId) throw new Error("Service bundle ID does not match application target");
19031
19328
  const currentBuild = iosBuildInteger(cfg.CURRENT_PROJECT_VERSION);
19032
- const key = (0, import_node_crypto6.createHash)("sha256").update(bundleId).digest("hex");
19033
- const statePath = import_node_path28.default.join(root, `${key}.json`);
19034
- const lockPath = import_node_path28.default.join(root, `${key}.lock`);
19329
+ const key = (0, import_node_crypto7.createHash)("sha256").update(bundleId).digest("hex");
19330
+ const statePath = import_node_path29.default.join(root, `${key}.json`);
19331
+ const lockPath = import_node_path29.default.join(root, `${key}.lock`);
19035
19332
  let lock;
19036
19333
  try {
19037
- lock = (0, import_node_fs23.openSync)(lockPath, "wx", 384);
19334
+ lock = (0, import_node_fs24.openSync)(lockPath, "wx", 384);
19038
19335
  } catch (error) {
19039
19336
  if (error.code === "EEXIST") throw new Error(`iOS build already locked: ${lockPath}. Remove only after confirming no build is running.`);
19040
19337
  throw error;
19041
19338
  }
19042
19339
  try {
19043
- (0, import_node_fs23.writeFileSync)(lock, JSON.stringify({ pid: process.pid, bundleId }));
19044
- const previous = (0, import_node_fs23.existsSync)(statePath) ? JSON.parse((0, import_node_fs23.readFileSync)(statePath, "utf8")) : void 0;
19340
+ (0, import_node_fs24.writeFileSync)(lock, JSON.stringify({ pid: process.pid, bundleId }));
19341
+ const previous = (0, import_node_fs24.existsSync)(statePath) ? JSON.parse((0, import_node_fs24.readFileSync)(statePath, "utf8")) : void 0;
19045
19342
  if (previous && previous.bundleId !== bundleId) throw new Error("iOS build state bundle ID mismatch");
19046
19343
  const buildsByVersion = { ...previous?.buildsByVersion };
19047
19344
  if (previous) buildsByVersion[previous.version] = Math.max(buildsByVersion[previous.version] ?? 0, iosBuildInteger(previous.build));
@@ -19049,52 +19346,52 @@ var IosBuildService = class {
19049
19346
  if (priorBuild === void 0 && options.lastBuild === void 0) throw new Error("First build for this marketing version requires --last-build <highest Apple build for this version>; use 0 only for a new version. Import again after external uploads or changing machines.");
19050
19347
  const build = Math.max(currentBuild, priorBuild ?? 0, options.lastBuild ?? 0) + 1;
19051
19348
  iosBuildInteger(build);
19052
- const buildDir = import_node_path28.default.join(root, key, `${version}-${build}`);
19053
- (0, import_node_fs23.mkdirSync)(buildDir, { recursive: true, mode: 448 });
19054
- const archivePath = import_node_path28.default.join(buildDir, "App.xcarchive");
19055
- const logPath = import_node_path28.default.join(buildDir, "build.log");
19349
+ const buildDir = import_node_path29.default.join(root, key, `${version}-${build}`);
19350
+ (0, import_node_fs24.mkdirSync)(buildDir, { recursive: true, mode: 448 });
19351
+ const archivePath = import_node_path29.default.join(buildDir, "App.xcarchive");
19352
+ const logPath = import_node_path29.default.join(buildDir, "build.log");
19056
19353
  buildsByVersion[version] = build;
19057
19354
  const state = { bundleId, version, build, buildsByVersion, status: "reserved", archivePath, logPath };
19058
19355
  const persist = () => {
19059
19356
  const temp = `${statePath}.${process.pid}.tmp`;
19060
- (0, import_node_fs23.writeFileSync)(temp, JSON.stringify(state, null, 2) + "\n", { mode: 384 });
19061
- (0, import_node_fs23.renameSync)(temp, statePath);
19357
+ (0, import_node_fs24.writeFileSync)(temp, JSON.stringify(state, null, 2) + "\n", { mode: 384 });
19358
+ (0, import_node_fs24.renameSync)(temp, statePath);
19062
19359
  };
19063
19360
  persist();
19064
- (0, import_node_fs23.writeFileSync)(logPath, `Service ${service.id}: ${bundleId} ${version} (${build})
19361
+ (0, import_node_fs24.writeFileSync)(logPath, `Service ${service.id}: ${bundleId} ${version} (${build})
19065
19362
  Preflight log: ${preflightLog}
19066
19363
  `, { mode: 384 });
19067
19364
  try {
19068
- await run([...common2, `CURRENT_PROJECT_VERSION=${build}`, `MARKETING_VERSION=${version}`, "-archivePath", archivePath, "-derivedDataPath", import_node_path28.default.join(buildDir, "DerivedData"), "-allowProvisioningUpdates", "archive"], appDir, logPath);
19069
- const applications = import_node_path28.default.join(archivePath, "Products", "Applications");
19070
- const builtApps = (0, import_node_fs23.readdirSync)(applications).filter((name) => name.endsWith(".app"));
19365
+ await run([...common2, `CURRENT_PROJECT_VERSION=${build}`, `MARKETING_VERSION=${version}`, "-archivePath", archivePath, "-derivedDataPath", import_node_path29.default.join(buildDir, "DerivedData"), "-allowProvisioningUpdates", "archive"], appDir, logPath);
19366
+ const applications = import_node_path29.default.join(archivePath, "Products", "Applications");
19367
+ const builtApps = (0, import_node_fs24.readdirSync)(applications).filter((name) => name.endsWith(".app"));
19071
19368
  if (builtApps.length !== 1) throw new Error("Archive must contain exactly one application");
19072
- const plist = (0, import_node_fs23.readFileSync)(import_node_path28.default.join(applications, builtApps[0], "Info.plist"));
19369
+ const plist = (0, import_node_fs24.readFileSync)(import_node_path29.default.join(applications, builtApps[0], "Info.plist"));
19073
19370
  const info = await (this.deps.readPlist ?? readPlist)(plist);
19074
19371
  if (info.CFBundleIdentifier !== bundleId || info.CFBundleShortVersionString !== version || String(info.CFBundleVersion) !== String(build)) throw new Error("Archive metadata does not match requested bundle, version and Build; upload stopped");
19075
- const exportPlist = import_node_path28.default.join(buildDir, "ExportOptions.plist");
19076
- (0, import_node_fs23.writeFileSync)(exportPlist, `<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>method</key><string>app-store-connect</string><key>destination</key><string>upload</string><key>teamID</key><string>${team}</string><key>signingStyle</key><string>automatic</string><key>manageAppVersionAndBuildNumber</key><false/><key>uploadSymbols</key><true/></dict></plist>`);
19077
- await run(["-exportArchive", "-archivePath", archivePath, "-exportOptionsPlist", exportPlist, "-exportPath", import_node_path28.default.join(buildDir, "export"), "-allowProvisioningUpdates"], appDir, logPath);
19372
+ const exportPlist = import_node_path29.default.join(buildDir, "ExportOptions.plist");
19373
+ (0, import_node_fs24.writeFileSync)(exportPlist, `<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>method</key><string>app-store-connect</string><key>destination</key><string>upload</string><key>teamID</key><string>${team}</string><key>signingStyle</key><string>automatic</string><key>manageAppVersionAndBuildNumber</key><false/><key>uploadSymbols</key><true/></dict></plist>`);
19374
+ await run(["-exportArchive", "-archivePath", archivePath, "-exportOptionsPlist", exportPlist, "-exportPath", import_node_path29.default.join(buildDir, "export"), "-allowProvisioningUpdates"], appDir, logPath);
19078
19375
  state.status = "uploaded-processing";
19079
19376
  persist();
19080
19377
  return { serviceId: service.id, bundleId, version, build, status: "uploaded-processing", archivePath, logPath };
19081
19378
  } catch (error) {
19082
19379
  state.status = "failed";
19083
19380
  persist();
19084
- (0, import_node_fs23.appendFileSync)(logPath, `
19381
+ (0, import_node_fs24.appendFileSync)(logPath, `
19085
19382
  ${String(error)}
19086
19383
  `);
19087
19384
  throw new Error(`iOS Build ${build} failed; sequence reserved. See ${logPath}. ${String(error)}`);
19088
19385
  }
19089
19386
  } finally {
19090
- (0, import_node_fs23.closeSync)(lock);
19091
- (0, import_node_fs23.unlinkSync)(lockPath);
19387
+ (0, import_node_fs24.closeSync)(lock);
19388
+ (0, import_node_fs24.unlinkSync)(lockPath);
19092
19389
  }
19093
19390
  }
19094
19391
  };
19095
19392
  async function readPlist(input) {
19096
19393
  return new Promise((resolve, reject) => {
19097
- const child = (0, import_node_child_process11.spawn)("plutil", ["-convert", "json", "-o", "-", "--", "-"], { stdio: ["pipe", "pipe", "pipe"] });
19394
+ const child = (0, import_node_child_process12.spawn)("plutil", ["-convert", "json", "-o", "-", "--", "-"], { stdio: ["pipe", "pipe", "pipe"] });
19098
19395
  let output = "";
19099
19396
  let error = "";
19100
19397
  child.stdout.on("data", (chunk) => {
@@ -19135,15 +19432,19 @@ var NativeServiceDeploy = class {
19135
19432
  this.registry = registry;
19136
19433
  }
19137
19434
  async deploy(service, args) {
19138
- if (!("type" in service) || !["electron", "ios", "android"].includes(service.type)) throw new Error("Native deployment requires an electron, ios or android service");
19435
+ if (!("type" in service) || !["electron", "ios", "android", "harmonyos"].includes(service.type)) throw new Error("Native deployment requires a supported native service");
19139
19436
  if (service.type !== "android" && (args.env ?? "prod") !== "prod") throw new Error("Native deployment currently supports only --env prod");
19140
19437
  const repository = service.repository ?? service.mobile?.repository;
19141
19438
  const dir = service.dir ?? service.mobile?.dir;
19142
19439
  if (!dir || !repository && !args.cwd) throw new Error("Native service requires repository and dir");
19143
- const root = args.cwd ? import_node_path29.default.resolve(args.cwd) : resolveRepositoryLocalRoot(repository);
19144
- const appDir = import_node_path29.default.resolve(root, dir);
19145
- if (!(0, import_node_fs24.existsSync)(appDir)) throw new Error(`Service source directory not found: ${appDir}`);
19440
+ const root = args.cwd ? import_node_path30.default.resolve(args.cwd) : resolveRepositoryLocalRoot(repository);
19441
+ const appDir = import_node_path30.default.resolve(root, dir);
19442
+ if (!(0, import_node_fs25.existsSync)(appDir)) throw new Error(`Service source directory not found: ${appDir}`);
19146
19443
  const settings = service.build ?? {};
19444
+ if (service.type === "harmonyos") {
19445
+ rejectNativeOverrides(args, ["dryRun", "local", "outDir"]);
19446
+ return (this.deps.harmony ?? new HarmonyReleaseService(this.registry)).release(service, { cwd: root, dryRun: args.dryRun, local: args.local, outDir: args.outDir });
19447
+ }
19147
19448
  if (service.type === "android") {
19148
19449
  rejectNativeOverrides(args, [...androidKeys, "dryRun"]);
19149
19450
  const artifactIdentity = androidArtifactIdentity(service);
@@ -19172,10 +19473,10 @@ var NativeServiceDeploy = class {
19172
19473
  const options2 = {
19173
19474
  id: app,
19174
19475
  target: "electron",
19175
- config: args.config ? import_node_path29.default.resolve(args.config) : import_node_path29.default.resolve(appDir, settings.config ?? "desktop.config.json"),
19476
+ config: args.config ? import_node_path30.default.resolve(args.config) : import_node_path30.default.resolve(appDir, settings.config ?? "desktop.config.json"),
19176
19477
  platform: args.platform ?? settings.platform ?? (process.platform === "darwin" ? "mac" : process.platform === "win32" ? "win" : process.platform),
19177
19478
  arch: args.arch ?? settings.arch ?? process.arch,
19178
- outDir: args.outDir ? import_node_path29.default.resolve(args.outDir) : import_node_path29.default.join(root, "release", service.name),
19479
+ outDir: args.outDir ? import_node_path30.default.resolve(args.outDir) : import_node_path30.default.join(root, "release", service.name),
19179
19480
  signed: !args.unsigned,
19180
19481
  dir: !!args.dir,
19181
19482
  dryRun: !!args.dryRun,
@@ -19288,10 +19589,10 @@ async function requestDeveloperLogTool(tool, params, fetcher = fetch, delegate)
19288
19589
  }
19289
19590
 
19290
19591
  // src/services/ServiceRuntimeRunner.ts
19291
- var import_node_fs25 = require("fs");
19292
- var import_node_os13 = __toESM(require("os"));
19293
- var import_node_path30 = __toESM(require("path"));
19294
- var import_node_child_process12 = require("child_process");
19592
+ var import_node_fs26 = require("fs");
19593
+ var import_node_os14 = __toESM(require("os"));
19594
+ var import_node_path31 = __toESM(require("path"));
19595
+ var import_node_child_process13 = require("child_process");
19295
19596
  var import_node_readline = require("readline");
19296
19597
  var import_chalk3 = __toESM(require("chalk"));
19297
19598
  var import_dotenv = require("dotenv");
@@ -19311,8 +19612,8 @@ var ServiceEnvNotFoundError = class extends Error {
19311
19612
  }
19312
19613
  };
19313
19614
  var ServiceRegistryClient = class {
19314
- constructor(baseUrl) {
19315
- this.baseUrl = baseUrl;
19615
+ constructor(baseUrl2) {
19616
+ this.baseUrl = baseUrl2;
19316
19617
  }
19317
19618
  async listHostEnv(hostId) {
19318
19619
  const payload = await this.request(
@@ -19790,14 +20091,14 @@ var ServiceRuntimeRunner = class {
19790
20091
  }
19791
20092
  resolveRepoRoot(service, cwd) {
19792
20093
  if (cwd) {
19793
- return import_node_path30.default.resolve(process.cwd(), cwd);
20094
+ return import_node_path31.default.resolve(process.cwd(), cwd);
19794
20095
  }
19795
20096
  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();
19796
20097
  if (repository) {
19797
20098
  const repoName = repository.replace(/\/+$/, "").split("/").pop()?.replace(/\.git$/i, "");
19798
20099
  if (repoName) {
19799
- const candidate = import_node_path30.default.join(import_node_os13.default.homedir(), "dev", "pmate", repoName);
19800
- if ((0, import_node_fs25.existsSync)(candidate)) {
20100
+ const candidate = import_node_path31.default.join(import_node_os14.default.homedir(), "dev", "pmate", repoName);
20101
+ if ((0, import_node_fs26.existsSync)(candidate)) {
19801
20102
  return candidate;
19802
20103
  }
19803
20104
  }
@@ -19810,13 +20111,13 @@ var ServiceRuntimeRunner = class {
19810
20111
  if (!dir) {
19811
20112
  throw new Error(`Missing service dir for ${service.id}`);
19812
20113
  }
19813
- return import_node_path30.default.resolve(repoRoot, dir);
20114
+ return import_node_path31.default.resolve(repoRoot, dir);
19814
20115
  }
19815
20116
  async deployVite(service, options) {
19816
20117
  this.assertDeployableStaticSite(service);
19817
20118
  const appDir = this.resolveLocalDir(service, options.cwd);
19818
- const packageJsonPath = import_node_path30.default.join(appDir, "package.json");
19819
- if (!(0, import_node_fs25.existsSync)(packageJsonPath)) {
20119
+ const packageJsonPath = import_node_path31.default.join(appDir, "package.json");
20120
+ if (!(0, import_node_fs26.existsSync)(packageJsonPath)) {
19820
20121
  throw new Error(`No package.json found at ${packageJsonPath}`);
19821
20122
  }
19822
20123
  const pkg2 = this.loadPackageJson(packageJsonPath);
@@ -19831,8 +20132,8 @@ var ServiceRuntimeRunner = class {
19831
20132
  this.resolveRepoRoot(service, options.cwd),
19832
20133
  buildEnv
19833
20134
  );
19834
- const distDir = import_node_path30.default.join(appDir, "dist");
19835
- if (!(0, import_node_fs25.existsSync)(distDir)) {
20135
+ const distDir = import_node_path31.default.join(appDir, "dist");
20136
+ if (!(0, import_node_fs26.existsSync)(distDir)) {
19836
20137
  throw new Error(`No dist directory found at ${distDir}`);
19837
20138
  }
19838
20139
  const site = this.getSite(service);
@@ -19845,8 +20146,8 @@ var ServiceRuntimeRunner = class {
19845
20146
  async deployStatic(service, options) {
19846
20147
  this.assertDeployableStaticSite(service);
19847
20148
  const appDir = this.resolveLocalDir(service, options.cwd);
19848
- const srcDir = import_node_path30.default.join(appDir, "src");
19849
- if (!(0, import_node_fs25.existsSync)(srcDir)) {
20149
+ const srcDir = import_node_path31.default.join(appDir, "src");
20150
+ if (!(0, import_node_fs26.existsSync)(srcDir)) {
19850
20151
  throw new Error(`No src directory found at ${srcDir}`);
19851
20152
  }
19852
20153
  const site = this.getSite(service);
@@ -19880,8 +20181,8 @@ var ServiceRuntimeRunner = class {
19880
20181
  this.validateFcConfig(service, fc);
19881
20182
  const repoRoot = this.resolveRepoRoot(service, options.cwd);
19882
20183
  const appDir = this.resolveLocalDir(service, options.cwd);
19883
- const packageJsonPath = import_node_path30.default.join(appDir, "package.json");
19884
- if (!(0, import_node_fs25.existsSync)(packageJsonPath)) {
20184
+ const packageJsonPath = import_node_path31.default.join(appDir, "package.json");
20185
+ if (!(0, import_node_fs26.existsSync)(packageJsonPath)) {
19885
20186
  throw new Error(`No package.json found at ${packageJsonPath}`);
19886
20187
  }
19887
20188
  const pkg2 = this.loadPackageJson(packageJsonPath);
@@ -19934,15 +20235,15 @@ var ServiceRuntimeRunner = class {
19934
20235
  const repoRoot = this.resolveRepoRoot(service, options.cwd);
19935
20236
  const appDir = this.resolveLocalDir(service, options.cwd);
19936
20237
  await this.ensurePnpmWorkspaceRoot(repoRoot);
19937
- const configPath = import_node_path30.default.join(appDir, fc.configFile ?? "s.yaml");
19938
- if (!(0, import_node_fs25.existsSync)(configPath)) {
20238
+ const configPath = import_node_path31.default.join(appDir, fc.configFile ?? "s.yaml");
20239
+ if (!(0, import_node_fs26.existsSync)(configPath)) {
19939
20240
  throw new Error(`Missing FC config file at ${configPath}`);
19940
20241
  }
19941
- const packageJsonPath = import_node_path30.default.join(appDir, "package.json");
19942
- if (!(0, import_node_fs25.existsSync)(packageJsonPath)) {
20242
+ const packageJsonPath = import_node_path31.default.join(appDir, "package.json");
20243
+ if (!(0, import_node_fs26.existsSync)(packageJsonPath)) {
19943
20244
  throw new Error(`No package.json found at ${packageJsonPath}`);
19944
20245
  }
19945
- const rawConfig = (0, import_node_fs25.readFileSync)(configPath, "utf8");
20246
+ const rawConfig = (0, import_node_fs26.readFileSync)(configPath, "utf8");
19946
20247
  if (!rawConfig.includes(fc.functionName)) {
19947
20248
  throw new Error(`FC config ${configPath} does not mention functionName ${fc.functionName}`);
19948
20249
  }
@@ -20232,7 +20533,7 @@ var ServiceRuntimeRunner = class {
20232
20533
  const serverAddress = await resolveServerAddress(server);
20233
20534
  const templateName = exposeType === "websocket" ? "nginx.ws.template" : exposeType === "mixed" ? "nginx.mixed.template" : "nginx.rest.template";
20234
20535
  const templatePath = this.resolveTemplatePath(templateName);
20235
- const template = (0, import_node_fs25.readFileSync)(templatePath, "utf8");
20536
+ const template = (0, import_node_fs26.readFileSync)(templatePath, "utf8");
20236
20537
  const host = `${subdomain}.${("domain" in network ? network.domain?.trim() : void 0) || "pmate.chat"}`;
20237
20538
  const rendered = template.replace(/\$\{\{PORT\}\}/g, String(port)).replace(/\$\{\{HOSTS\}\}/g, host).replace(/\$\{\{HOST\}\}/g, host);
20238
20539
  const remotePath = `/etc/nginx/sites-enabled/${subdomain}.conf`;
@@ -20264,11 +20565,11 @@ var ServiceRuntimeRunner = class {
20264
20565
  }
20265
20566
  if (config.ensurePackageJson) {
20266
20567
  const appDir = this.resolveLocalDir(service, options.cwd);
20267
- const packageJsonPath = import_node_path30.default.join(appDir, "package.json");
20268
- if (!(0, import_node_fs25.existsSync)(packageJsonPath)) {
20568
+ const packageJsonPath = import_node_path31.default.join(appDir, "package.json");
20569
+ if (!(0, import_node_fs26.existsSync)(packageJsonPath)) {
20269
20570
  throw new Error(`Missing package.json at ${packageJsonPath}`);
20270
20571
  }
20271
- const pkgStat = (0, import_node_fs25.statSync)(packageJsonPath);
20572
+ const pkgStat = (0, import_node_fs26.statSync)(packageJsonPath);
20272
20573
  if (!pkgStat.isFile()) {
20273
20574
  throw new Error(`package.json is not a file at ${packageJsonPath}`);
20274
20575
  }
@@ -20679,9 +20980,9 @@ var ServiceRuntimeRunner = class {
20679
20980
  return tokens;
20680
20981
  }
20681
20982
  readPathValue(source, pathExpr) {
20682
- const path35 = pathExpr.split(".").map((segment) => segment.trim()).filter(Boolean);
20983
+ const path36 = pathExpr.split(".").map((segment) => segment.trim()).filter(Boolean);
20683
20984
  let cursor = source;
20684
- for (const segment of path35) {
20985
+ for (const segment of path36) {
20685
20986
  if (!cursor || typeof cursor !== "object" || Array.isArray(cursor)) {
20686
20987
  return void 0;
20687
20988
  }
@@ -20724,12 +21025,12 @@ var ServiceRuntimeRunner = class {
20724
21025
  }
20725
21026
  resolveTemplatePath(templateName) {
20726
21027
  const candidates = [
20727
- import_node_path30.default.join(__dirname, "..", "templates", templateName),
20728
- import_node_path30.default.join(__dirname, "..", "src", "templates", templateName),
20729
- import_node_path30.default.join(__dirname, "templates", templateName)
21028
+ import_node_path31.default.join(__dirname, "..", "templates", templateName),
21029
+ import_node_path31.default.join(__dirname, "..", "src", "templates", templateName),
21030
+ import_node_path31.default.join(__dirname, "templates", templateName)
20730
21031
  ];
20731
21032
  for (const candidate of candidates) {
20732
- if ((0, import_node_fs25.existsSync)(candidate)) {
21033
+ if ((0, import_node_fs26.existsSync)(candidate)) {
20733
21034
  return candidate;
20734
21035
  }
20735
21036
  }
@@ -20738,7 +21039,7 @@ var ServiceRuntimeRunner = class {
20738
21039
  writeRemoteConfig(server, content, remotePath) {
20739
21040
  return new Promise((resolve, reject) => {
20740
21041
  const target = `pmate@${server}`;
20741
- const child = (0, import_node_child_process12.spawn)("ssh", [target, "sudo", "tee", remotePath], {
21042
+ const child = (0, import_node_child_process13.spawn)("ssh", [target, "sudo", "tee", remotePath], {
20742
21043
  stdio: ["pipe", "inherit", "inherit"]
20743
21044
  });
20744
21045
  child.on("error", reject);
@@ -20753,7 +21054,7 @@ var ServiceRuntimeRunner = class {
20753
21054
  reloadNginx(server) {
20754
21055
  return new Promise((resolve, reject) => {
20755
21056
  const target = `pmate@${server}`;
20756
- const child = (0, import_node_child_process12.spawn)("ssh", [target, "sudo", "nginx", "-s", "reload"], {
21057
+ const child = (0, import_node_child_process13.spawn)("ssh", [target, "sudo", "nginx", "-s", "reload"], {
20757
21058
  stdio: ["ignore", "inherit", "inherit"]
20758
21059
  });
20759
21060
  child.on("error", reject);
@@ -20761,7 +21062,7 @@ var ServiceRuntimeRunner = class {
20761
21062
  });
20762
21063
  }
20763
21064
  loadPackageJson(packageJsonPath) {
20764
- const raw = (0, import_node_fs25.readFileSync)(packageJsonPath, "utf8");
21065
+ const raw = (0, import_node_fs26.readFileSync)(packageJsonPath, "utf8");
20765
21066
  const parsed = JSON.parse(raw);
20766
21067
  if (!parsed || typeof parsed !== "object") {
20767
21068
  throw new Error(`Invalid package.json at ${packageJsonPath}`);
@@ -20770,7 +21071,7 @@ var ServiceRuntimeRunner = class {
20770
21071
  }
20771
21072
  writePackageJson(packageJsonPath, data) {
20772
21073
  const serialized = JSON.stringify(data, null, 2);
20773
- (0, import_node_fs25.writeFileSync)(packageJsonPath, `${serialized}
21074
+ (0, import_node_fs26.writeFileSync)(packageJsonPath, `${serialized}
20774
21075
  `, "utf8");
20775
21076
  }
20776
21077
  validateFcConfig(service, fc) {
@@ -20797,8 +21098,8 @@ var ServiceRuntimeRunner = class {
20797
21098
  }
20798
21099
  }
20799
21100
  async ensurePnpmWorkspaceRoot(repoRoot) {
20800
- const workspacePath = import_node_path30.default.join(repoRoot, "pnpm-workspace.yaml");
20801
- if (!(0, import_node_fs25.existsSync)(workspacePath)) {
21101
+ const workspacePath = import_node_path31.default.join(repoRoot, "pnpm-workspace.yaml");
21102
+ if (!(0, import_node_fs26.existsSync)(workspacePath)) {
20802
21103
  throw new Error(`Missing pnpm-workspace.yaml at ${workspacePath}`);
20803
21104
  }
20804
21105
  }
@@ -20872,16 +21173,16 @@ var ServiceRuntimeRunner = class {
20872
21173
  if (!privateKeyPath) {
20873
21174
  throw new Error("Missing ssl.prv in ~/.pmate/config.yaml.");
20874
21175
  }
20875
- if (!(0, import_node_fs25.existsSync)(certificatePath)) {
21176
+ if (!(0, import_node_fs26.existsSync)(certificatePath)) {
20876
21177
  throw new Error(`SSL certificate file not found: ${certificatePath}`);
20877
21178
  }
20878
- if (!(0, import_node_fs25.existsSync)(privateKeyPath)) {
21179
+ if (!(0, import_node_fs26.existsSync)(privateKeyPath)) {
20879
21180
  throw new Error(`SSL private key file not found: ${privateKeyPath}`);
20880
21181
  }
20881
21182
  return {
20882
21183
  certName: host,
20883
- certificate: (0, import_node_fs25.readFileSync)(certificatePath, "utf8"),
20884
- privateKey: (0, import_node_fs25.readFileSync)(privateKeyPath, "utf8")
21184
+ certificate: (0, import_node_fs26.readFileSync)(certificatePath, "utf8"),
21185
+ privateKey: (0, import_node_fs26.readFileSync)(privateKeyPath, "utf8")
20885
21186
  };
20886
21187
  }
20887
21188
  resolveFcProtocol(fc, certConfig) {
@@ -20940,7 +21241,7 @@ var ServiceRuntimeRunner = class {
20940
21241
  }
20941
21242
  runCommandWithEnv(command, args, cwd, env) {
20942
21243
  return new Promise((resolve, reject) => {
20943
- const child = (0, import_node_child_process12.spawn)(command, args, {
21244
+ const child = (0, import_node_child_process13.spawn)(command, args, {
20944
21245
  cwd,
20945
21246
  stdio: "inherit",
20946
21247
  env: { ...process.env, ...env ?? {} }
@@ -20951,7 +21252,7 @@ var ServiceRuntimeRunner = class {
20951
21252
  }
20952
21253
  runShellCommand(command, cwd, env) {
20953
21254
  return new Promise((resolve, reject) => {
20954
- const child = (0, import_node_child_process12.spawn)(command, [], {
21255
+ const child = (0, import_node_child_process13.spawn)(command, [], {
20955
21256
  cwd,
20956
21257
  stdio: "inherit",
20957
21258
  shell: true,
@@ -20962,10 +21263,10 @@ var ServiceRuntimeRunner = class {
20962
21263
  });
20963
21264
  }
20964
21265
  runRemoteCommand(server, command) {
20965
- if (server === "local") return this.runCommandWithEnv("bash", ["-c", command], import_node_os13.default.homedir());
21266
+ if (server === "local") return this.runCommandWithEnv("bash", ["-c", command], import_node_os14.default.homedir());
20966
21267
  return new Promise((resolve, reject) => {
20967
21268
  const target = `pmate@${server}`;
20968
- const child = (0, import_node_child_process12.spawn)("ssh", [target, "bash -ls"], { stdio: ["pipe", "inherit", "inherit"] });
21269
+ const child = (0, import_node_child_process13.spawn)("ssh", [target, "bash -ls"], { stdio: ["pipe", "inherit", "inherit"] });
20969
21270
  child.stdin.on("error", reject);
20970
21271
  child.stdin.end(`${command}
20971
21272
  `);
@@ -21025,8 +21326,8 @@ function parseServiceRef(serviceId) {
21025
21326
  init_namespacedRef();
21026
21327
  var ServiceCommandHandler = class {
21027
21328
  async handle(args) {
21028
- const baseUrl = this.resolveBaseUrl(args.baseUrl);
21029
- const registry = new ServiceRegistryClient(baseUrl);
21329
+ const baseUrl2 = this.resolveBaseUrl(args.baseUrl);
21330
+ const registry = new ServiceRegistryClient(baseUrl2);
21030
21331
  const runtime = new ServiceRuntimeRunner(
21031
21332
  (appId, options) => registry.pullEnv(appId, options)
21032
21333
  );
@@ -21072,10 +21373,10 @@ var ServiceCommandHandler = class {
21072
21373
  }
21073
21374
  case "create": {
21074
21375
  const payload = this.readJsonFile(args.filePath);
21075
- await this.requireNamespace(payload, baseUrl);
21376
+ await this.requireNamespace(payload, baseUrl2);
21076
21377
  await this.requireUniqueServerPort(payload, registry);
21077
21378
  const record = await this.request(
21078
- baseUrl,
21379
+ baseUrl2,
21079
21380
  "POST",
21080
21381
  "/services",
21081
21382
  payload
@@ -21091,7 +21392,7 @@ var ServiceCommandHandler = class {
21091
21392
  name: args.name
21092
21393
  });
21093
21394
  const record = await this.request(
21094
- baseUrl,
21395
+ baseUrl2,
21095
21396
  "PUT",
21096
21397
  `/services/${encodeURIComponent(args.namespace)}/${encodeURIComponent(args.name)}`,
21097
21398
  payload
@@ -21104,7 +21405,7 @@ var ServiceCommandHandler = class {
21104
21405
  const service = await registry.getService(args.namespace, args.name);
21105
21406
  await this.deleteServiceResources(service);
21106
21407
  const record = await this.request(
21107
- baseUrl,
21408
+ baseUrl2,
21108
21409
  "DELETE",
21109
21410
  `/services/${encodeURIComponent(args.namespace)}/${encodeURIComponent(args.name)}`
21110
21411
  );
@@ -21114,7 +21415,7 @@ var ServiceCommandHandler = class {
21114
21415
  }
21115
21416
  case "rename": {
21116
21417
  const record = await this.request(
21117
- baseUrl,
21418
+ baseUrl2,
21118
21419
  "POST",
21119
21420
  `/services/${encodeURIComponent(args.namespace)}/rename`,
21120
21421
  {
@@ -21130,7 +21431,7 @@ var ServiceCommandHandler = class {
21130
21431
  }
21131
21432
  case "move": {
21132
21433
  const record = await this.request(
21133
- baseUrl,
21434
+ baseUrl2,
21134
21435
  "POST",
21135
21436
  `/services/${encodeURIComponent(args.namespace)}/move`,
21136
21437
  {
@@ -21149,7 +21450,7 @@ var ServiceCommandHandler = class {
21149
21450
  const certKey = args.sslCert ?? DEFAULT_SSL_CERT_KEY;
21150
21451
  resolveSslCert(certKey);
21151
21452
  const record = await this.request(
21152
- baseUrl,
21453
+ baseUrl2,
21153
21454
  "PUT",
21154
21455
  `/services/${encodeURIComponent(args.namespace)}/${encodeURIComponent(args.name)}`,
21155
21456
  { sslCert: certKey }
@@ -21186,10 +21487,10 @@ var ServiceCommandHandler = class {
21186
21487
  }
21187
21488
  case "deploy": {
21188
21489
  const record = await registry.getService(args.namespace, args.name);
21189
- if ("type" in record && (record.type === "electron" || record.type === "ios" || record.type === "android")) {
21490
+ if ("type" in record && (record.type === "electron" || record.type === "ios" || record.type === "android" || record.type === "harmonyos")) {
21190
21491
  try {
21191
21492
  const result = await new NativeServiceDeploy({}, registry).deploy(record, args);
21192
- if (!args.dryRun && !args.local) await this.appendDeployHistory(registry, record.id, args.env ?? "prod", "success", String(result.status));
21493
+ if (!args.dryRun && !args.local) await this.appendDeployHistory(registry, record.id, args.env ?? "prod", "success", String(result.status), typeof result.manifestUrl === "string" ? { manifestUrl: result.manifestUrl, platform: result.type, distribution: result.distribution } : void 0);
21193
21494
  this.renderJson(result, true);
21194
21495
  } catch (error) {
21195
21496
  if (!args.dryRun && !args.local) await this.appendDeployHistory(registry, record.id, args.env ?? "prod", "failed", error instanceof Error ? error.message : String(error));
@@ -21223,7 +21524,7 @@ var ServiceCommandHandler = class {
21223
21524
  case "init": {
21224
21525
  const record = await registry.getService(args.namespace, args.name);
21225
21526
  const withDefaultCert = await this.ensureDefaultSslCertForStaticService(
21226
- baseUrl,
21527
+ baseUrl2,
21227
21528
  record
21228
21529
  );
21229
21530
  const service = await this.materializeServiceEnv(registry, withDefaultCert, args.env);
@@ -21277,7 +21578,7 @@ var ServiceCommandHandler = class {
21277
21578
  }
21278
21579
  case "env-list": {
21279
21580
  const payload = await this.request(
21280
- baseUrl,
21581
+ baseUrl2,
21281
21582
  "GET",
21282
21583
  this.buildEnvPath(args.appId, {
21283
21584
  scope: args.scope,
@@ -21290,7 +21591,7 @@ var ServiceCommandHandler = class {
21290
21591
  }
21291
21592
  case "env-get": {
21292
21593
  const payload = await this.request(
21293
- baseUrl,
21594
+ baseUrl2,
21294
21595
  "GET",
21295
21596
  `${this.buildEnvBasePath(args.appId)}/${encodeURIComponent(args.key)}?${new URLSearchParams({
21296
21597
  scope: args.scope,
@@ -21303,7 +21604,7 @@ var ServiceCommandHandler = class {
21303
21604
  case "env-set": {
21304
21605
  const value = await this.resolveEnvValue(args);
21305
21606
  const payload = await this.request(
21306
- baseUrl,
21607
+ baseUrl2,
21307
21608
  "PUT",
21308
21609
  `${this.buildEnvBasePath(args.appId)}/${encodeURIComponent(args.key)}`,
21309
21610
  {
@@ -21319,7 +21620,7 @@ var ServiceCommandHandler = class {
21319
21620
  }
21320
21621
  case "env-unset": {
21321
21622
  const payload = await this.request(
21322
- baseUrl,
21623
+ baseUrl2,
21323
21624
  "DELETE",
21324
21625
  `${this.buildEnvBasePath(args.appId)}/${encodeURIComponent(args.key)}?${new URLSearchParams({
21325
21626
  scope: args.scope
@@ -21332,7 +21633,7 @@ var ServiceCommandHandler = class {
21332
21633
  }
21333
21634
  case "env-resolve": {
21334
21635
  const payload = await this.request(
21335
- baseUrl,
21636
+ baseUrl2,
21336
21637
  "POST",
21337
21638
  `${this.buildEnvBasePath(args.appId)}/resolve`,
21338
21639
  {
@@ -21346,7 +21647,7 @@ var ServiceCommandHandler = class {
21346
21647
  }
21347
21648
  case "env-pull": {
21348
21649
  const payload = await this.request(
21349
- baseUrl,
21650
+ baseUrl2,
21350
21651
  "POST",
21351
21652
  `${this.buildEnvBasePath(args.appId)}/pull`,
21352
21653
  {
@@ -21355,7 +21656,7 @@ var ServiceCommandHandler = class {
21355
21656
  format: "dotenv"
21356
21657
  }
21357
21658
  );
21358
- const outputPath = import_node_path31.default.resolve(process.cwd(), args.output);
21659
+ const outputPath = import_node_path32.default.resolve(process.cwd(), args.output);
21359
21660
  await (0, import_promises5.writeFile)(outputPath, payload.content, "utf8");
21360
21661
  ui.success(`Wrote env file for ${args.appId} to ${outputPath}`);
21361
21662
  this.renderJson({ ...payload, output: outputPath }, args.json);
@@ -21363,7 +21664,7 @@ var ServiceCommandHandler = class {
21363
21664
  }
21364
21665
  case "env-copy-from": {
21365
21666
  const payload = await this.request(
21366
- baseUrl,
21667
+ baseUrl2,
21367
21668
  "POST",
21368
21669
  `${this.buildEnvBasePath(args.targetAppId)}/copy-from`,
21369
21670
  {
@@ -21380,7 +21681,7 @@ var ServiceCommandHandler = class {
21380
21681
  }
21381
21682
  case "env-update-scope": {
21382
21683
  const payload = await this.request(
21383
- baseUrl,
21684
+ baseUrl2,
21384
21685
  "POST",
21385
21686
  `${this.buildEnvBasePath(args.appId)}/update-scope`,
21386
21687
  {
@@ -21397,7 +21698,7 @@ var ServiceCommandHandler = class {
21397
21698
  }
21398
21699
  case "service-env-list": {
21399
21700
  const payload = await this.request(
21400
- baseUrl,
21701
+ baseUrl2,
21401
21702
  "GET",
21402
21703
  this.buildServiceEnvBasePath(args.appId)
21403
21704
  );
@@ -21406,7 +21707,7 @@ var ServiceCommandHandler = class {
21406
21707
  }
21407
21708
  case "service-env-get": {
21408
21709
  const payload = await this.request(
21409
- baseUrl,
21710
+ baseUrl2,
21410
21711
  "GET",
21411
21712
  `${this.buildServiceEnvBasePath(args.appId)}/${encodeURIComponent(args.envName)}`
21412
21713
  );
@@ -21415,7 +21716,7 @@ var ServiceCommandHandler = class {
21415
21716
  }
21416
21717
  case "service-env-add": {
21417
21718
  const payload = await this.request(
21418
- baseUrl,
21719
+ baseUrl2,
21419
21720
  "PUT",
21420
21721
  `${this.buildServiceEnvBasePath(args.appId)}/${encodeURIComponent(args.envName)}`,
21421
21722
  {
@@ -21428,7 +21729,7 @@ var ServiceCommandHandler = class {
21428
21729
  }
21429
21730
  case "service-env-expose": {
21430
21731
  const payload = await this.request(
21431
- baseUrl,
21732
+ baseUrl2,
21432
21733
  "POST",
21433
21734
  `${this.buildServiceEnvBasePath(args.appId)}/${encodeURIComponent(args.envName)}/expose`,
21434
21735
  {
@@ -21550,14 +21851,15 @@ var ServiceCommandHandler = class {
21550
21851
  }
21551
21852
  throw new Error(`Unsupported runtime ${runtime.type} for ${service.id} env ${env.name}`);
21552
21853
  }
21553
- async appendDeployHistory(registry, serviceId, environment, status, message) {
21854
+ async appendDeployHistory(registry, serviceId, environment, status, message, metadata) {
21554
21855
  let lastError;
21555
21856
  for (let attempt = 1; attempt <= 5; attempt += 1) {
21556
21857
  try {
21557
21858
  await registry.appendDeployHistory(serviceId, {
21558
21859
  environment,
21559
21860
  status,
21560
- ...message ? { message } : {}
21861
+ ...message ? { message } : {},
21862
+ ...metadata ? { metadata } : {}
21561
21863
  });
21562
21864
  return;
21563
21865
  } catch (error2) {
@@ -21577,15 +21879,15 @@ var ServiceCommandHandler = class {
21577
21879
  message: error instanceof Error ? error.message : String(error)
21578
21880
  });
21579
21881
  }
21580
- resolveBaseUrl(baseUrl) {
21581
- return (baseUrl || process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
21882
+ resolveBaseUrl(baseUrl2) {
21883
+ return (baseUrl2 || process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
21582
21884
  }
21583
21885
  readJsonFile(filePath) {
21584
- const absolutePath = import_node_path31.default.resolve(process.cwd(), filePath);
21585
- if (!(0, import_node_fs26.existsSync)(absolutePath)) {
21886
+ const absolutePath = import_node_path32.default.resolve(process.cwd(), filePath);
21887
+ if (!(0, import_node_fs27.existsSync)(absolutePath)) {
21586
21888
  throw new Error(`JSON file not found: ${absolutePath}`);
21587
21889
  }
21588
- const raw = (0, import_node_fs26.readFileSync)(absolutePath, "utf8");
21890
+ const raw = (0, import_node_fs27.readFileSync)(absolutePath, "utf8");
21589
21891
  try {
21590
21892
  return JSON.parse(raw);
21591
21893
  } catch (error) {
@@ -21593,9 +21895,9 @@ var ServiceCommandHandler = class {
21593
21895
  throw new Error(`Invalid JSON in ${absolutePath}: ${message}`);
21594
21896
  }
21595
21897
  }
21596
- async request(baseUrl, method, pathname, body) {
21597
- const token = new ServiceRegistryClient(baseUrl).readToken();
21598
- const response = await fetch(`${baseUrl}${pathname}`, {
21898
+ async request(baseUrl2, method, pathname, body) {
21899
+ const token = new ServiceRegistryClient(baseUrl2).readToken();
21900
+ const response = await fetch(`${baseUrl2}${pathname}`, {
21599
21901
  method,
21600
21902
  headers: {
21601
21903
  Authorization: `Bearer ${token}`,
@@ -21655,7 +21957,7 @@ var ServiceCommandHandler = class {
21655
21957
  rl.close();
21656
21958
  }
21657
21959
  }
21658
- async requireNamespace(payload, baseUrl) {
21960
+ async requireNamespace(payload, baseUrl2) {
21659
21961
  if (!payload || typeof payload !== "object") {
21660
21962
  throw new Error("Service payload must be a JSON object.");
21661
21963
  }
@@ -21665,7 +21967,7 @@ var ServiceCommandHandler = class {
21665
21967
  }
21666
21968
  const registry = new NamespaceRegistry({
21667
21969
  chain: "pmate",
21668
- registryBaseUrl: baseUrl
21970
+ registryBaseUrl: baseUrl2
21669
21971
  });
21670
21972
  const exists = await registry.exists(namespace);
21671
21973
  if (!exists) {
@@ -22065,13 +22367,13 @@ var ServiceCommandHandler = class {
22065
22367
  }
22066
22368
  return [...domains].sort();
22067
22369
  }
22068
- async ensureDefaultSslCertForStaticService(baseUrl, service) {
22370
+ async ensureDefaultSslCertForStaticService(baseUrl2, service) {
22069
22371
  const type = this.getServiceType(service);
22070
22372
  if (type !== "vite" && type !== "static" || service.sslCert) {
22071
22373
  return service;
22072
22374
  }
22073
22375
  const record = await this.request(
22074
- baseUrl,
22376
+ baseUrl2,
22075
22377
  "PUT",
22076
22378
  `/services/${encodeURIComponent(service.namespace)}/${encodeURIComponent(service.name)}`,
22077
22379
  { sslCert: DEFAULT_SSL_CERT_KEY }
@@ -22109,7 +22411,7 @@ var ServiceCommandHandler = class {
22109
22411
  removeRemoteConfig(server, remotePath) {
22110
22412
  return new Promise((resolve, reject) => {
22111
22413
  const target = `pmate@${server}`;
22112
- const child = (0, import_node_child_process13.spawn)("ssh", [target, "sudo", "rm", "-f", remotePath], {
22414
+ const child = (0, import_node_child_process14.spawn)("ssh", [target, "sudo", "rm", "-f", remotePath], {
22113
22415
  stdio: ["ignore", "inherit", "inherit"]
22114
22416
  });
22115
22417
  child.on("error", (error) => {
@@ -22127,7 +22429,7 @@ var ServiceCommandHandler = class {
22127
22429
  reloadNginx(server) {
22128
22430
  return new Promise((resolve, reject) => {
22129
22431
  const target = `pmate@${server}`;
22130
- const child = (0, import_node_child_process13.spawn)("ssh", [target, "sudo", "nginx", "-s", "reload"], {
22432
+ const child = (0, import_node_child_process14.spawn)("ssh", [target, "sudo", "nginx", "-s", "reload"], {
22131
22433
  stdio: ["ignore", "inherit", "inherit"]
22132
22434
  });
22133
22435
  child.on("error", (error) => {
@@ -22200,9 +22502,9 @@ function sleep3(ms) {
22200
22502
  }
22201
22503
 
22202
22504
  // src/commands/VercelCommandHandler.ts
22203
- var import_node_child_process14 = require("child_process");
22505
+ var import_node_child_process15 = require("child_process");
22204
22506
  var import_node_util = require("util");
22205
- var execFileAsync = (0, import_node_util.promisify)(import_node_child_process14.execFile);
22507
+ var execFileAsync = (0, import_node_util.promisify)(import_node_child_process15.execFile);
22206
22508
  function parseDeploymentTimestamp(deployment) {
22207
22509
  const candidates = [deployment.createdAt, deployment.readyAt, deployment.ready];
22208
22510
  for (const value of candidates) {
@@ -22310,11 +22612,11 @@ init_sessionStore();
22310
22612
  var RoleCommandHandler = class {
22311
22613
  async handle(args) {
22312
22614
  const token = this.readToken();
22313
- const baseUrl = this.resolveBaseUrl(args.baseUrl);
22615
+ const baseUrl2 = this.resolveBaseUrl(args.baseUrl);
22314
22616
  switch (args.action) {
22315
22617
  case "list": {
22316
22618
  const items = await this.request(
22317
- baseUrl,
22619
+ baseUrl2,
22318
22620
  token,
22319
22621
  "GET",
22320
22622
  "/role/definitions"
@@ -22324,7 +22626,7 @@ var RoleCommandHandler = class {
22324
22626
  }
22325
22627
  case "create": {
22326
22628
  const item = await this.request(
22327
- baseUrl,
22629
+ baseUrl2,
22328
22630
  token,
22329
22631
  "POST",
22330
22632
  "/role/definitions",
@@ -22340,16 +22642,16 @@ var RoleCommandHandler = class {
22340
22642
  }
22341
22643
  }
22342
22644
  }
22343
- resolveBaseUrl(baseUrl) {
22344
- return (baseUrl || process.env.PMATE_AUTH_API_BASE_URL || process.env.AUTH_API_BASE_URL || "https://auth-api-v2.pmate.chat").replace(/\/+$/, "");
22645
+ resolveBaseUrl(baseUrl2) {
22646
+ return (baseUrl2 || process.env.PMATE_AUTH_API_BASE_URL || process.env.AUTH_API_BASE_URL || "https://auth-api-v2.pmate.chat").replace(/\/+$/, "");
22345
22647
  }
22346
22648
  readToken() {
22347
22649
  return readRequiredSession({
22348
22650
  preferredApp: DEFAULT_APP_ID
22349
22651
  }).token;
22350
22652
  }
22351
- async request(baseUrl, token, method, pathname, body) {
22352
- const response = await fetch(`${baseUrl}${pathname}`, {
22653
+ async request(baseUrl2, token, method, pathname, body) {
22654
+ const response = await fetch(`${baseUrl2}${pathname}`, {
22353
22655
  method,
22354
22656
  headers: {
22355
22657
  Authorization: `Bearer ${token}`,
@@ -22393,9 +22695,9 @@ var RoleCommandHandler = class {
22393
22695
  };
22394
22696
 
22395
22697
  // src/commands/AccountCommandHandler.ts
22396
- var import_node_fs27 = require("fs");
22397
- var import_node_crypto7 = require("crypto");
22398
- var import_node_path32 = __toESM(require("path"));
22698
+ var import_node_fs28 = require("fs");
22699
+ var import_node_crypto8 = require("crypto");
22700
+ var import_node_path33 = __toESM(require("path"));
22399
22701
  init_sessionStore();
22400
22702
  var AccountCommandHandler = class {
22401
22703
  async handle(args) {
@@ -22403,9 +22705,9 @@ var AccountCommandHandler = class {
22403
22705
  case "bot-keygen": {
22404
22706
  const keyFile = this.generateBotKeyFile(args.app, args.name);
22405
22707
  const outPath = args.out ? this.resolveFilePath(args.out) : this.resolveDefaultBotKeyPath(args.app, args.name);
22406
- (0, import_node_fs27.mkdirSync)(import_node_path32.default.dirname(outPath), { recursive: true });
22407
- (0, import_node_fs27.writeFileSync)(outPath, JSON.stringify(keyFile, null, 2), { mode: 384 });
22408
- (0, import_node_fs27.chmodSync)(outPath, 384);
22708
+ (0, import_node_fs28.mkdirSync)(import_node_path33.default.dirname(outPath), { recursive: true });
22709
+ (0, import_node_fs28.writeFileSync)(outPath, JSON.stringify(keyFile, null, 2), { mode: 384 });
22710
+ (0, import_node_fs28.chmodSync)(outPath, 384);
22409
22711
  if (!args.json) {
22410
22712
  ui.success(`Bot key saved to ${outPath}`);
22411
22713
  }
@@ -22416,9 +22718,9 @@ var AccountCommandHandler = class {
22416
22718
  }
22417
22719
  case "list": {
22418
22720
  const token = this.readToken();
22419
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
22721
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22420
22722
  const result = await this.request(
22421
- baseUrl,
22723
+ baseUrl2,
22422
22724
  token,
22423
22725
  "GET",
22424
22726
  `/accounts?${this.buildAccountListQuery(args)}`
@@ -22428,9 +22730,9 @@ var AccountCommandHandler = class {
22428
22730
  }
22429
22731
  case "app-users": {
22430
22732
  const token = this.readToken();
22431
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
22733
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22432
22734
  const result = await this.request(
22433
- baseUrl,
22735
+ baseUrl2,
22434
22736
  token,
22435
22737
  "GET",
22436
22738
  `/accounts/app-users/${encodeURIComponent(args.app)}?${this.buildPagedQuery(args)}`
@@ -22440,9 +22742,9 @@ var AccountCommandHandler = class {
22440
22742
  }
22441
22743
  case "view": {
22442
22744
  const token = this.readToken();
22443
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
22745
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22444
22746
  const result = await this.request(
22445
- baseUrl,
22747
+ baseUrl2,
22446
22748
  token,
22447
22749
  "GET",
22448
22750
  `/accounts/view?${this.buildAccountViewQuery(args)}`
@@ -22452,9 +22754,9 @@ var AccountCommandHandler = class {
22452
22754
  }
22453
22755
  case "role-list": {
22454
22756
  const token = this.readToken();
22455
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
22757
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22456
22758
  const items = await this.request(
22457
- baseUrl,
22759
+ baseUrl2,
22458
22760
  token,
22459
22761
  "GET",
22460
22762
  `/role/bindings?${this.buildRoleBindingsQuery(args)}`
@@ -22464,9 +22766,9 @@ var AccountCommandHandler = class {
22464
22766
  }
22465
22767
  case "role-add": {
22466
22768
  const token = this.readToken();
22467
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
22769
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22468
22770
  const item = await this.request(
22469
- baseUrl,
22771
+ baseUrl2,
22470
22772
  token,
22471
22773
  "POST",
22472
22774
  "/role/bindings",
@@ -22482,9 +22784,9 @@ var AccountCommandHandler = class {
22482
22784
  }
22483
22785
  case "role-remove": {
22484
22786
  const token = this.readToken();
22485
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
22787
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22486
22788
  await this.request(
22487
- baseUrl,
22789
+ baseUrl2,
22488
22790
  token,
22489
22791
  "DELETE",
22490
22792
  "/role/bindings",
@@ -22499,9 +22801,9 @@ var AccountCommandHandler = class {
22499
22801
  }
22500
22802
  case "visible-app-list": {
22501
22803
  const token = this.readToken();
22502
- const baseUrl = this.resolveAppsBaseUrl(args.baseUrl);
22804
+ const baseUrl2 = this.resolveAppsBaseUrl(args.baseUrl);
22503
22805
  const result = await this.request(
22504
- baseUrl,
22806
+ baseUrl2,
22505
22807
  token,
22506
22808
  "GET",
22507
22809
  `/accounts/${encodeURIComponent(args.account)}/visible-apps`
@@ -22511,9 +22813,9 @@ var AccountCommandHandler = class {
22511
22813
  }
22512
22814
  case "visible-app-add": {
22513
22815
  const token = this.readToken();
22514
- const baseUrl = this.resolveAppsBaseUrl(args.baseUrl);
22816
+ const baseUrl2 = this.resolveAppsBaseUrl(args.baseUrl);
22515
22817
  const item = await this.request(
22516
- baseUrl,
22818
+ baseUrl2,
22517
22819
  token,
22518
22820
  "PUT",
22519
22821
  `/accounts/${encodeURIComponent(args.account)}/visible-apps/${encodePathSegment2(args.app)}`
@@ -22524,9 +22826,9 @@ var AccountCommandHandler = class {
22524
22826
  }
22525
22827
  case "visible-app-remove": {
22526
22828
  const token = this.readToken();
22527
- const baseUrl = this.resolveAppsBaseUrl(args.baseUrl);
22829
+ const baseUrl2 = this.resolveAppsBaseUrl(args.baseUrl);
22528
22830
  const result = await this.request(
22529
- baseUrl,
22831
+ baseUrl2,
22530
22832
  token,
22531
22833
  "DELETE",
22532
22834
  `/accounts/${encodeURIComponent(args.account)}/visible-apps/${encodePathSegment2(args.app)}`
@@ -22539,10 +22841,10 @@ var AccountCommandHandler = class {
22539
22841
  }
22540
22842
  case "visible-app-set": {
22541
22843
  const token = this.readToken();
22542
- const baseUrl = this.resolveAppsBaseUrl(args.baseUrl);
22844
+ const baseUrl2 = this.resolveAppsBaseUrl(args.baseUrl);
22543
22845
  const items = this.resolveVisibleAppsInput(args);
22544
22846
  const result = await this.request(
22545
- baseUrl,
22847
+ baseUrl2,
22546
22848
  token,
22547
22849
  "PUT",
22548
22850
  `/accounts/${encodeURIComponent(args.account)}/visible-apps`,
@@ -22554,9 +22856,9 @@ var AccountCommandHandler = class {
22554
22856
  }
22555
22857
  case "visible-app-resolve": {
22556
22858
  const token = this.readToken();
22557
- const baseUrl = this.resolveAppsBaseUrl(args.baseUrl);
22859
+ const baseUrl2 = this.resolveAppsBaseUrl(args.baseUrl);
22558
22860
  const result = await this.request(
22559
- baseUrl,
22861
+ baseUrl2,
22560
22862
  token,
22561
22863
  "GET",
22562
22864
  "/me/visible-apps"
@@ -22569,10 +22871,10 @@ var AccountCommandHandler = class {
22569
22871
  }
22570
22872
  case "bot-create": {
22571
22873
  const token = this.readToken();
22572
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
22874
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22573
22875
  const publicKey = args.publicKey ?? this.readBotKeyFile(args.keyFile, args.app, args.name).publicKey;
22574
22876
  const bot = await this.request(
22575
- baseUrl,
22877
+ baseUrl2,
22576
22878
  token,
22577
22879
  "POST",
22578
22880
  "/accounts/bots",
@@ -22590,9 +22892,9 @@ var AccountCommandHandler = class {
22590
22892
  return;
22591
22893
  }
22592
22894
  case "bot-view": {
22593
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
22895
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22594
22896
  const bot = await this.request(
22595
- baseUrl,
22897
+ baseUrl2,
22596
22898
  void 0,
22597
22899
  "GET",
22598
22900
  `/accounts/bots/${encodeURIComponent(args.app)}/${encodeURIComponent(args.name)}`
@@ -22601,9 +22903,9 @@ var AccountCommandHandler = class {
22601
22903
  return;
22602
22904
  }
22603
22905
  case "bot-list": {
22604
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
22906
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22605
22907
  const result = await this.request(
22606
- baseUrl,
22908
+ baseUrl2,
22607
22909
  void 0,
22608
22910
  "GET",
22609
22911
  `/accounts/bots?app=${encodeURIComponent(args.app)}`
@@ -22623,9 +22925,9 @@ var AccountCommandHandler = class {
22623
22925
  }
22624
22926
  case "bot-rename": {
22625
22927
  const token = this.readToken();
22626
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
22928
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22627
22929
  const bot = await this.request(
22628
- baseUrl,
22930
+ baseUrl2,
22629
22931
  token,
22630
22932
  "POST",
22631
22933
  "/accounts/bots/rename",
@@ -22646,17 +22948,17 @@ var AccountCommandHandler = class {
22646
22948
  return;
22647
22949
  }
22648
22950
  case "bot-login": {
22649
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
22951
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22650
22952
  const privateKey = args.privateKey ?? this.readBotKeyFile(args.keyFile, args.app, args.name).privateKey;
22651
22953
  const challenge = await this.request(
22652
- baseUrl,
22954
+ baseUrl2,
22653
22955
  void 0,
22654
22956
  "POST",
22655
22957
  "/accounts/bots/session/challenge",
22656
22958
  { app: args.app, name: args.name }
22657
22959
  );
22658
22960
  const login = await this.request(
22659
- baseUrl,
22961
+ baseUrl2,
22660
22962
  void 0,
22661
22963
  "POST",
22662
22964
  "/accounts/bots/session",
@@ -22673,7 +22975,7 @@ var AccountCommandHandler = class {
22673
22975
  token: login.token,
22674
22976
  app: args.app,
22675
22977
  accountId: login.session.identity.accountId,
22676
- authApiBaseUrl: baseUrl
22978
+ authApiBaseUrl: baseUrl2
22677
22979
  });
22678
22980
  const saved = saveLoginSession({ ...login, profileId }, args.app);
22679
22981
  if (!args.json) {
@@ -22682,11 +22984,55 @@ var AccountCommandHandler = class {
22682
22984
  this.renderJson(login, args.json);
22683
22985
  return;
22684
22986
  }
22987
+ case "bot-profile-update": {
22988
+ const token = readRequiredSession().token;
22989
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22990
+ const bot = await this.request(
22991
+ baseUrl2,
22992
+ token,
22993
+ "GET",
22994
+ `/accounts/bots/${encodeURIComponent(args.app)}/${encodeURIComponent(args.name)}`
22995
+ );
22996
+ const query = new URLSearchParams({ app: args.app, account: bot.account.id });
22997
+ const loadProfiles = async () => {
22998
+ const profiles2 = await this.request(baseUrl2, token, "GET", `/profiles?${query}`);
22999
+ return profiles2.filter((profile2) => profile2.app === args.app && profile2.account === bot.account.id);
23000
+ };
23001
+ const profiles = await loadProfiles();
23002
+ if (profiles.length !== 1) {
23003
+ throw new Error(`Expected exactly one profile for bot ${args.app}/${args.name}; found ${profiles.length}. No nickname was changed.`);
23004
+ }
23005
+ const profile = profiles[0];
23006
+ if (!profile.id?.trim()) throw new Error("Bot profile has no valid ID. No nickname was changed.");
23007
+ if (profile.nickName === args.nickName) {
23008
+ this.renderJson(profile, args.json);
23009
+ return;
23010
+ }
23011
+ await this.request(baseUrl2, token, "PUT", "/profile", {
23012
+ profileId: profile.id,
23013
+ nickName: args.nickName
23014
+ });
23015
+ for (let attempt = 0; attempt < 20; attempt++) {
23016
+ if (attempt > 0) await new Promise((resolve) => setTimeout(resolve, 500));
23017
+ let current;
23018
+ try {
23019
+ current = (await loadProfiles()).find((item) => item.id === profile.id);
23020
+ } catch (error) {
23021
+ throw new Error(`Nickname update was submitted for profile ${profile.id}, but read-back failed: ${error instanceof Error ? error.message : String(error)}. Check the profile before retrying.`);
23022
+ }
23023
+ if (current?.nickName === args.nickName) {
23024
+ if (!args.json) ui.success(`Updated bot ${args.app}/${args.name} nickname to ${args.nickName}`);
23025
+ this.renderJson(current, args.json);
23026
+ return;
23027
+ }
23028
+ }
23029
+ throw new Error(`Nickname update was submitted for profile ${profile.id}, but read-back verification timed out. Check the profile before retrying.`);
23030
+ }
22685
23031
  case "bot-profile-create": {
22686
23032
  const token = this.readToken();
22687
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
23033
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22688
23034
  const profile = await this.request(
22689
- baseUrl,
23035
+ baseUrl2,
22690
23036
  token,
22691
23037
  "POST",
22692
23038
  "/accounts/bots/profile",
@@ -22705,9 +23051,9 @@ var AccountCommandHandler = class {
22705
23051
  }
22706
23052
  case "access-key-create": {
22707
23053
  const token = this.readToken();
22708
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
23054
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22709
23055
  const result = await this.request(
22710
- baseUrl,
23056
+ baseUrl2,
22711
23057
  token,
22712
23058
  "POST",
22713
23059
  "/access-keys",
@@ -22724,9 +23070,9 @@ var AccountCommandHandler = class {
22724
23070
  }
22725
23071
  case "access-key-list": {
22726
23072
  const token = this.readToken();
22727
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
23073
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22728
23074
  const result = await this.request(
22729
- baseUrl,
23075
+ baseUrl2,
22730
23076
  token,
22731
23077
  "GET",
22732
23078
  `/access-keys?${this.buildAccessKeyListQuery(args)}`
@@ -22736,9 +23082,9 @@ var AccountCommandHandler = class {
22736
23082
  }
22737
23083
  case "access-key-disable": {
22738
23084
  const token = this.readToken();
22739
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
23085
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22740
23086
  const item = await this.request(
22741
- baseUrl,
23087
+ baseUrl2,
22742
23088
  token,
22743
23089
  "DELETE",
22744
23090
  `/access-keys/${encodeURIComponent(args.id)}`
@@ -22751,9 +23097,9 @@ var AccountCommandHandler = class {
22751
23097
  }
22752
23098
  case "access-key-rotate": {
22753
23099
  const token = this.readToken();
22754
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
23100
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22755
23101
  const result = await this.request(
22756
- baseUrl,
23102
+ baseUrl2,
22757
23103
  token,
22758
23104
  "POST",
22759
23105
  `/access-keys/${encodeURIComponent(args.id)}/rotate`,
@@ -22767,16 +23113,16 @@ var AccountCommandHandler = class {
22767
23113
  return;
22768
23114
  }
22769
23115
  case "access-key-login": {
22770
- const baseUrl = this.resolveAuthBaseUrl(args.baseUrl);
23116
+ const baseUrl2 = this.resolveAuthBaseUrl(args.baseUrl);
22771
23117
  const secret = args.key ?? this.readAccessKeyFile(args.keyFile, args.app).secret;
22772
23118
  const login = await this.request(
22773
- baseUrl,
23119
+ baseUrl2,
22774
23120
  secret,
22775
23121
  "POST",
22776
23122
  "/access-keys/session",
22777
23123
  { app: args.app }
22778
23124
  );
22779
- const profileId = await this.resolveLoginProfileId(login, args.app, baseUrl);
23125
+ const profileId = await this.resolveLoginProfileId(login, args.app, baseUrl2);
22780
23126
  const saved = saveLoginSession({ ...login, profileId }, args.app);
22781
23127
  if (!args.json) {
22782
23128
  ui.success(`Logged in access key ${login.session.identity.accessKeyId ?? "unknown"} to ${saved.app}`);
@@ -22786,11 +23132,11 @@ var AccountCommandHandler = class {
22786
23132
  }
22787
23133
  }
22788
23134
  }
22789
- resolveAuthBaseUrl(baseUrl) {
22790
- return (baseUrl || process.env.PMATE_AUTH_API_BASE_URL || process.env.AUTH_API_BASE_URL || "https://auth-api-v2.pmate.chat").replace(/\/+$/, "");
23135
+ resolveAuthBaseUrl(baseUrl2) {
23136
+ return (baseUrl2 || process.env.PMATE_AUTH_API_BASE_URL || process.env.AUTH_API_BASE_URL || "https://auth-api-v2.pmate.chat").replace(/\/+$/, "");
22791
23137
  }
22792
- resolveAppsBaseUrl(baseUrl) {
22793
- return (baseUrl || process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
23138
+ resolveAppsBaseUrl(baseUrl2) {
23139
+ return (baseUrl2 || process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
22794
23140
  }
22795
23141
  readToken() {
22796
23142
  return readRequiredSession({
@@ -22830,8 +23176,8 @@ var AccountCommandHandler = class {
22830
23176
  if (args.namespace) params.set("namespace", args.namespace);
22831
23177
  return params.toString();
22832
23178
  }
22833
- async request(baseUrl, token, method, pathname, body) {
22834
- const response = await fetch(`${baseUrl}${pathname}`, {
23179
+ async request(baseUrl2, token, method, pathname, body) {
23180
+ const response = await fetch(`${baseUrl2}${pathname}`, {
22835
23181
  method,
22836
23182
  headers: {
22837
23183
  ...token ? { Authorization: `Bearer ${token}` } : {},
@@ -22965,10 +23311,10 @@ var AccountCommandHandler = class {
22965
23311
  throw new Error("Missing visible apps input");
22966
23312
  }
22967
23313
  const absolutePath = this.resolveFilePath(args.filePath);
22968
- if (!(0, import_node_fs27.existsSync)(absolutePath)) {
23314
+ if (!(0, import_node_fs28.existsSync)(absolutePath)) {
22969
23315
  throw new Error(`JSON file not found: ${absolutePath}`);
22970
23316
  }
22971
- const raw = (0, import_node_fs27.readFileSync)(absolutePath, "utf8");
23317
+ const raw = (0, import_node_fs28.readFileSync)(absolutePath, "utf8");
22972
23318
  let parsed;
22973
23319
  try {
22974
23320
  parsed = JSON.parse(raw);
@@ -22982,19 +23328,19 @@ var AccountCommandHandler = class {
22982
23328
  return parsed;
22983
23329
  }
22984
23330
  resolveFilePath(filePath) {
22985
- return import_node_path32.default.resolve(process.cwd(), filePath);
23331
+ return import_node_path33.default.resolve(process.cwd(), filePath);
22986
23332
  }
22987
23333
  resolveDefaultBotKeyPath(app, name) {
22988
- return import_node_path32.default.join(this.homeDir(), ".pmate", "bots", app, `${name}.bot-key.json`);
23334
+ return import_node_path33.default.join(this.homeDir(), ".pmate", "bots", app, `${name}.bot-key.json`);
22989
23335
  }
22990
23336
  resolveDefaultAccessKeyPath(app, name) {
22991
- return import_node_path32.default.join(this.homeDir(), ".pmate", "access-keys", app, `${name}.access-key.json`);
23337
+ return import_node_path33.default.join(this.homeDir(), ".pmate", "access-keys", app, `${name}.access-key.json`);
22992
23338
  }
22993
23339
  homeDir() {
22994
23340
  return process.env.HOME || process.env.USERPROFILE || process.cwd();
22995
23341
  }
22996
23342
  generateBotKeyFile(app, name) {
22997
- const { publicKey, privateKey } = (0, import_node_crypto7.generateKeyPairSync)("ed25519");
23343
+ const { publicKey, privateKey } = (0, import_node_crypto8.generateKeyPairSync)("ed25519");
22998
23344
  return {
22999
23345
  type: "pmate-bot-key",
23000
23346
  version: 1,
@@ -23008,14 +23354,14 @@ var AccountCommandHandler = class {
23008
23354
  }
23009
23355
  renameDefaultBotKeyFile(app, name, newName) {
23010
23356
  const oldPath = this.resolveDefaultBotKeyPath(app, name);
23011
- if (!(0, import_node_fs27.existsSync)(oldPath)) {
23357
+ if (!(0, import_node_fs28.existsSync)(oldPath)) {
23012
23358
  return void 0;
23013
23359
  }
23014
23360
  const keyFile = this.readBotKeyFile(oldPath, app, name);
23015
23361
  const newPath = this.resolveDefaultBotKeyPath(app, newName);
23016
- (0, import_node_fs27.mkdirSync)(import_node_path32.default.dirname(newPath), { recursive: true, mode: 448 });
23017
- (0, import_node_fs27.writeFileSync)(newPath, JSON.stringify({ ...keyFile, name: newName }, null, 2));
23018
- (0, import_node_fs27.chmodSync)(newPath, 384);
23362
+ (0, import_node_fs28.mkdirSync)(import_node_path33.default.dirname(newPath), { recursive: true, mode: 448 });
23363
+ (0, import_node_fs28.writeFileSync)(newPath, JSON.stringify({ ...keyFile, name: newName }, null, 2));
23364
+ (0, import_node_fs28.chmodSync)(newPath, 384);
23019
23365
  return newPath;
23020
23366
  }
23021
23367
  readBotKeyFile(filePath, expectedApp, expectedName) {
@@ -23023,10 +23369,10 @@ var AccountCommandHandler = class {
23023
23369
  throw new Error("Missing bot key file");
23024
23370
  }
23025
23371
  const absolutePath = this.resolveFilePath(filePath);
23026
- if (!(0, import_node_fs27.existsSync)(absolutePath)) {
23372
+ if (!(0, import_node_fs28.existsSync)(absolutePath)) {
23027
23373
  throw new Error(`Bot key file not found: ${absolutePath}`);
23028
23374
  }
23029
- const parsed = JSON.parse((0, import_node_fs27.readFileSync)(absolutePath, "utf8"));
23375
+ const parsed = JSON.parse((0, import_node_fs28.readFileSync)(absolutePath, "utf8"));
23030
23376
  if (parsed.type !== "pmate-bot-key" || parsed.version !== 1 || parsed.algorithm !== "ed25519" || !parsed.publicKey || !parsed.privateKey) {
23031
23377
  throw new Error(`Invalid PMate bot key file: ${absolutePath}`);
23032
23378
  }
@@ -23043,10 +23389,10 @@ var AccountCommandHandler = class {
23043
23389
  throw new Error("Missing access key file");
23044
23390
  }
23045
23391
  const absolutePath = this.resolveFilePath(filePath);
23046
- if (!(0, import_node_fs27.existsSync)(absolutePath)) {
23392
+ if (!(0, import_node_fs28.existsSync)(absolutePath)) {
23047
23393
  throw new Error(`Access key file not found: ${absolutePath}`);
23048
23394
  }
23049
- const parsed = JSON.parse((0, import_node_fs27.readFileSync)(absolutePath, "utf8"));
23395
+ const parsed = JSON.parse((0, import_node_fs28.readFileSync)(absolutePath, "utf8"));
23050
23396
  if (parsed.type !== "pmate-access-key" || parsed.version !== 1 || !parsed.id || !parsed.app || !parsed.secret || !parsed.expiresAt) {
23051
23397
  throw new Error(`Invalid PMate access key file: ${absolutePath}`);
23052
23398
  }
@@ -23068,9 +23414,9 @@ var AccountCommandHandler = class {
23068
23414
  createdAt: result.key.createdAt
23069
23415
  };
23070
23416
  const outPath = out ? this.resolveFilePath(out) : this.resolveDefaultAccessKeyPath(result.key.app, result.key.name);
23071
- (0, import_node_fs27.mkdirSync)(import_node_path32.default.dirname(outPath), { recursive: true });
23072
- (0, import_node_fs27.writeFileSync)(outPath, JSON.stringify(keyFile, null, 2), { mode: 384 });
23073
- (0, import_node_fs27.chmodSync)(outPath, 384);
23417
+ (0, import_node_fs28.mkdirSync)(import_node_path33.default.dirname(outPath), { recursive: true });
23418
+ (0, import_node_fs28.writeFileSync)(outPath, JSON.stringify(keyFile, null, 2), { mode: 384 });
23419
+ (0, import_node_fs28.chmodSync)(outPath, 384);
23074
23420
  }
23075
23421
  renderAccessKeyCreateResult(result, asJson, out) {
23076
23422
  if (asJson) {
@@ -23116,12 +23462,12 @@ var AccountCommandHandler = class {
23116
23462
  });
23117
23463
  }
23118
23464
  signBotChallenge(challenge, privateKey) {
23119
- const key = (0, import_node_crypto7.createPrivateKey)({
23465
+ const key = (0, import_node_crypto8.createPrivateKey)({
23120
23466
  key: Buffer.from(privateKey, "base64url"),
23121
23467
  format: "der",
23122
23468
  type: "pkcs8"
23123
23469
  });
23124
- return (0, import_node_crypto7.sign)(
23470
+ return (0, import_node_crypto8.sign)(
23125
23471
  null,
23126
23472
  Buffer.from(JSON.stringify({
23127
23473
  id: challenge.id,
@@ -23155,16 +23501,16 @@ function encodePathSegment2(value) {
23155
23501
  }
23156
23502
 
23157
23503
  // src/commands/OrgCommandHandler.ts
23158
- var import_node_fs28 = require("fs");
23159
- var import_node_path33 = __toESM(require("path"));
23504
+ var import_node_fs29 = require("fs");
23505
+ var import_node_path34 = __toESM(require("path"));
23160
23506
  init_sessionStore();
23161
23507
  var OrgCommandHandler = class {
23162
23508
  async handle(args) {
23163
23509
  const token = this.readToken();
23164
- const baseUrl = this.resolveBaseUrl(args.baseUrl);
23510
+ const baseUrl2 = this.resolveBaseUrl(args.baseUrl);
23165
23511
  switch (args.action) {
23166
23512
  case "list": {
23167
- const result = await this.request(baseUrl, token, "GET", "/orgs");
23513
+ const result = await this.request(baseUrl2, token, "GET", "/orgs");
23168
23514
  this.renderJson(result.items, args.json);
23169
23515
  if (!args.json) {
23170
23516
  this.renderOrgList(result.items);
@@ -23174,7 +23520,7 @@ var OrgCommandHandler = class {
23174
23520
  case "get":
23175
23521
  case "view": {
23176
23522
  const record = await this.request(
23177
- baseUrl,
23523
+ baseUrl2,
23178
23524
  token,
23179
23525
  "GET",
23180
23526
  `/orgs/${encodeURIComponent(args.orgId)}`
@@ -23183,7 +23529,7 @@ var OrgCommandHandler = class {
23183
23529
  return;
23184
23530
  }
23185
23531
  case "create": {
23186
- const record = await this.request(baseUrl, token, "POST", "/orgs", {
23532
+ const record = await this.request(baseUrl2, token, "POST", "/orgs", {
23187
23533
  id: args.orgId,
23188
23534
  displayName: args.displayName,
23189
23535
  members: args.members
@@ -23194,7 +23540,7 @@ var OrgCommandHandler = class {
23194
23540
  }
23195
23541
  case "update": {
23196
23542
  const record = await this.request(
23197
- baseUrl,
23543
+ baseUrl2,
23198
23544
  token,
23199
23545
  "PATCH",
23200
23546
  `/orgs/${encodeURIComponent(args.orgId)}`,
@@ -23208,7 +23554,7 @@ var OrgCommandHandler = class {
23208
23554
  }
23209
23555
  case "disable": {
23210
23556
  const record = await this.request(
23211
- baseUrl,
23557
+ baseUrl2,
23212
23558
  token,
23213
23559
  "DELETE",
23214
23560
  `/orgs/${encodeURIComponent(args.orgId)}`
@@ -23219,7 +23565,7 @@ var OrgCommandHandler = class {
23219
23565
  }
23220
23566
  case "member-list": {
23221
23567
  const result = await this.request(
23222
- baseUrl,
23568
+ baseUrl2,
23223
23569
  token,
23224
23570
  "GET",
23225
23571
  `/orgs/${encodeURIComponent(args.orgId)}/members`
@@ -23229,7 +23575,7 @@ var OrgCommandHandler = class {
23229
23575
  }
23230
23576
  case "member-add": {
23231
23577
  const record = await this.request(
23232
- baseUrl,
23578
+ baseUrl2,
23233
23579
  token,
23234
23580
  "PUT",
23235
23581
  `/orgs/${encodeURIComponent(args.orgId)}/members/${encodeURIComponent(args.account)}`
@@ -23240,7 +23586,7 @@ var OrgCommandHandler = class {
23240
23586
  }
23241
23587
  case "member-remove": {
23242
23588
  const record = await this.request(
23243
- baseUrl,
23589
+ baseUrl2,
23244
23590
  token,
23245
23591
  "DELETE",
23246
23592
  `/orgs/${encodeURIComponent(args.orgId)}/members/${encodeURIComponent(args.account)}`
@@ -23252,7 +23598,7 @@ var OrgCommandHandler = class {
23252
23598
  case "member-set": {
23253
23599
  const accounts = this.resolveStringArrayInput(args.accounts, args.filePath, "account");
23254
23600
  const record = await this.request(
23255
- baseUrl,
23601
+ baseUrl2,
23256
23602
  token,
23257
23603
  "PUT",
23258
23604
  `/orgs/${encodeURIComponent(args.orgId)}/members`,
@@ -23264,7 +23610,7 @@ var OrgCommandHandler = class {
23264
23610
  }
23265
23611
  case "visible-app-list": {
23266
23612
  const result = await this.request(
23267
- baseUrl,
23613
+ baseUrl2,
23268
23614
  token,
23269
23615
  "GET",
23270
23616
  `/orgs/${encodeURIComponent(args.orgId)}/visible-apps`
@@ -23274,7 +23620,7 @@ var OrgCommandHandler = class {
23274
23620
  }
23275
23621
  case "visible-app-add": {
23276
23622
  const record = await this.request(
23277
- baseUrl,
23623
+ baseUrl2,
23278
23624
  token,
23279
23625
  "PUT",
23280
23626
  `/orgs/${encodeURIComponent(args.orgId)}/visible-apps/${encodePathSegment3(args.app)}`
@@ -23285,7 +23631,7 @@ var OrgCommandHandler = class {
23285
23631
  }
23286
23632
  case "visible-app-remove": {
23287
23633
  const result = await this.request(
23288
- baseUrl,
23634
+ baseUrl2,
23289
23635
  token,
23290
23636
  "DELETE",
23291
23637
  `/orgs/${encodeURIComponent(args.orgId)}/visible-apps/${encodePathSegment3(args.app)}`
@@ -23299,7 +23645,7 @@ var OrgCommandHandler = class {
23299
23645
  case "visible-app-set": {
23300
23646
  const apps = this.resolveStringArrayInput(args.apps, args.filePath, "app ref");
23301
23647
  const result = await this.request(
23302
- baseUrl,
23648
+ baseUrl2,
23303
23649
  token,
23304
23650
  "PUT",
23305
23651
  `/orgs/${encodeURIComponent(args.orgId)}/visible-apps`,
@@ -23311,8 +23657,8 @@ var OrgCommandHandler = class {
23311
23657
  }
23312
23658
  }
23313
23659
  }
23314
- resolveBaseUrl(baseUrl) {
23315
- return (baseUrl || process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
23660
+ resolveBaseUrl(baseUrl2) {
23661
+ return (baseUrl2 || process.env.PMATE_APPS_API_BASE_URL || "https://apps-api.pmate.chat").replace(/\/+$/, "");
23316
23662
  }
23317
23663
  readToken() {
23318
23664
  return readRequiredSession({
@@ -23326,11 +23672,11 @@ var OrgCommandHandler = class {
23326
23672
  if (!filePath) {
23327
23673
  throw new Error(`Missing ${itemLabel} input`);
23328
23674
  }
23329
- const absolutePath = import_node_path33.default.resolve(process.cwd(), filePath);
23330
- if (!(0, import_node_fs28.existsSync)(absolutePath)) {
23675
+ const absolutePath = import_node_path34.default.resolve(process.cwd(), filePath);
23676
+ if (!(0, import_node_fs29.existsSync)(absolutePath)) {
23331
23677
  throw new Error(`JSON file not found: ${absolutePath}`);
23332
23678
  }
23333
- const raw = (0, import_node_fs28.readFileSync)(absolutePath, "utf8");
23679
+ const raw = (0, import_node_fs29.readFileSync)(absolutePath, "utf8");
23334
23680
  let parsed;
23335
23681
  try {
23336
23682
  parsed = JSON.parse(raw);
@@ -23343,8 +23689,8 @@ var OrgCommandHandler = class {
23343
23689
  }
23344
23690
  return parsed;
23345
23691
  }
23346
- async request(baseUrl, token, method, pathname, body) {
23347
- const response = await fetch(`${baseUrl}${pathname}`, {
23692
+ async request(baseUrl2, token, method, pathname, body) {
23693
+ const response = await fetch(`${baseUrl2}${pathname}`, {
23348
23694
  method,
23349
23695
  headers: {
23350
23696
  Authorization: `Bearer ${token}`,
@@ -23401,10 +23747,10 @@ function encodePathSegment3(value) {
23401
23747
  }
23402
23748
 
23403
23749
  // src/commands/HostCommandHandler.ts
23404
- var import_node_fs29 = require("fs");
23405
- var import_node_os14 = require("os");
23406
- var import_node_path34 = __toESM(require("path"));
23407
- var import_node_child_process15 = require("child_process");
23750
+ var import_node_fs30 = require("fs");
23751
+ var import_node_os15 = require("os");
23752
+ var import_node_path35 = __toESM(require("path"));
23753
+ var import_node_child_process16 = require("child_process");
23408
23754
  var BLOCK_START = "# >>> pmate host env >>>";
23409
23755
  var BLOCK_END = "# <<< pmate host env <<<";
23410
23756
  var PROFILE_BLOCK = `${BLOCK_START}
@@ -23416,7 +23762,7 @@ fi
23416
23762
  ${BLOCK_END}`;
23417
23763
  var HostCommandHandler = class {
23418
23764
  async handle(args) {
23419
- const hostId = normalizeHostId(args.host ?? process.env.PMATE_HOST_ID ?? (0, import_node_os14.hostname)());
23765
+ const hostId = normalizeHostId(args.host ?? process.env.PMATE_HOST_ID ?? (0, import_node_os15.hostname)());
23420
23766
  const client = new ServiceRegistryClient(args.baseUrl);
23421
23767
  if (args.action === "env-list") {
23422
23768
  const items = await client.listHostEnv(hostId);
@@ -23447,7 +23793,7 @@ async function applyHostEnvRemote(host, values) {
23447
23793
  const content = serializeHostEnv(values);
23448
23794
  const script = buildRemoteApplyScript(Buffer.from(content, "utf8").toString("base64"));
23449
23795
  await new Promise((resolve, reject) => {
23450
- const child = (0, import_node_child_process15.spawn)("ssh", [target, "bash -s"], { stdio: ["pipe", "pipe", "pipe"] });
23796
+ const child = (0, import_node_child_process16.spawn)("ssh", [target, "bash -s"], { stdio: ["pipe", "pipe", "pipe"] });
23451
23797
  let stdout = "";
23452
23798
  let stderr = "";
23453
23799
  child.stdout.on("data", (chunk) => {
@@ -23533,7 +23879,7 @@ function parseRegistryArgs(tokens, type, label) {
23533
23879
  if (!action || !["list", "get", "view", "create", "update", "delete"].includes(action)) {
23534
23880
  throw new Error(`Use: ${label} list|get|view|create|update|delete`);
23535
23881
  }
23536
- let baseUrl;
23882
+ let baseUrl2;
23537
23883
  let json = false;
23538
23884
  let namespace;
23539
23885
  let name;
@@ -23556,7 +23902,7 @@ function parseRegistryArgs(tokens, type, label) {
23556
23902
  return next;
23557
23903
  };
23558
23904
  if (option === "--namespace" || option === "--ns") namespace = value();
23559
- else if (option === "--base-url") baseUrl = value();
23905
+ else if (option === "--base-url") baseUrl2 = value();
23560
23906
  else if (option === "--file") filePath = value();
23561
23907
  else if (option === "--json") json = true;
23562
23908
  else throw new Error(`Unknown ${label} option: ${option}`);
@@ -23564,7 +23910,7 @@ function parseRegistryArgs(tokens, type, label) {
23564
23910
  if ((action === "create" || action === "update") && !filePath) {
23565
23911
  throw new Error(`Missing required option --file for ${label} ${action}`);
23566
23912
  }
23567
- return { type, action, namespace, name, filePath, baseUrl, json };
23913
+ return { type, action, namespace, name, filePath, baseUrl: baseUrl2, json };
23568
23914
  }
23569
23915
 
23570
23916
  // src/callCommandParser.ts
@@ -23632,7 +23978,7 @@ function parseNsArgs(tokens) {
23632
23978
  throw new Error("Missing ns action. Use: ns list|get|create");
23633
23979
  }
23634
23980
  let chain = DEFAULT_CHAIN;
23635
- let baseUrl;
23981
+ let baseUrl2;
23636
23982
  let json = false;
23637
23983
  if (action === "list") {
23638
23984
  takeSharedOptions(rest, {
@@ -23640,13 +23986,13 @@ function parseNsArgs(tokens) {
23640
23986
  chain = value;
23641
23987
  },
23642
23988
  onBaseUrl: (value) => {
23643
- baseUrl = value;
23989
+ baseUrl2 = value;
23644
23990
  },
23645
23991
  onJson: () => {
23646
23992
  json = true;
23647
23993
  }
23648
23994
  });
23649
- return { type: "ns" /* Ns */, action, chain, baseUrl, json };
23995
+ return { type: "ns" /* Ns */, action, chain, baseUrl: baseUrl2, json };
23650
23996
  }
23651
23997
  if (action === "get" || action === "create") {
23652
23998
  const namespace = rest.shift();
@@ -23658,13 +24004,13 @@ function parseNsArgs(tokens) {
23658
24004
  chain = value;
23659
24005
  },
23660
24006
  onBaseUrl: (value) => {
23661
- baseUrl = value;
24007
+ baseUrl2 = value;
23662
24008
  },
23663
24009
  onJson: () => {
23664
24010
  json = true;
23665
24011
  }
23666
24012
  });
23667
- return { type: "ns" /* Ns */, action, namespace, chain, baseUrl, json };
24013
+ return { type: "ns" /* Ns */, action, namespace, chain, baseUrl: baseUrl2, json };
23668
24014
  }
23669
24015
  throw new Error(`Unknown ns action: ${action}`);
23670
24016
  }
@@ -23911,14 +24257,14 @@ function parseAppArgs(tokens) {
23911
24257
  throw new Error("Missing app action. Use: app list|get|view|create|update|rename|move|icon|delete");
23912
24258
  }
23913
24259
  if (action === "build") throw new Error("app build was removed; register an electron service and use pmate service deploy <ns:service>");
23914
- let baseUrl;
24260
+ let baseUrl2;
23915
24261
  let json = false;
23916
24262
  const takeSharedOptions4 = () => {
23917
24263
  while (rest.length > 0) {
23918
24264
  const token = rest[0];
23919
24265
  if (token === "--base-url") {
23920
24266
  rest.shift();
23921
- baseUrl = requireValue3(rest, token);
24267
+ baseUrl2 = requireValue3(rest, token);
23922
24268
  continue;
23923
24269
  }
23924
24270
  if (token === "--json") {
@@ -23943,7 +24289,7 @@ function parseAppArgs(tokens) {
23943
24289
  all = true;
23944
24290
  break;
23945
24291
  case "--base-url":
23946
- baseUrl = requireValue3(rest, token);
24292
+ baseUrl2 = requireValue3(rest, token);
23947
24293
  break;
23948
24294
  case "--json":
23949
24295
  json = true;
@@ -23952,7 +24298,7 @@ function parseAppArgs(tokens) {
23952
24298
  throw new Error(`Unknown app list option: ${token}`);
23953
24299
  }
23954
24300
  }
23955
- return { type: "app" /* App */, action, namespace, all, baseUrl, json };
24301
+ return { type: "app" /* App */, action, namespace, all, baseUrl: baseUrl2, json };
23956
24302
  }
23957
24303
  if (action === "view") {
23958
24304
  const rawRef = rest.shift();
@@ -23968,13 +24314,13 @@ function parseAppArgs(tokens) {
23968
24314
  const token = rest.shift();
23969
24315
  switch (token) {
23970
24316
  case "--base-url":
23971
- baseUrl = requireValue3(rest, token);
24317
+ baseUrl2 = requireValue3(rest, token);
23972
24318
  break;
23973
24319
  default:
23974
24320
  throw new Error(`Unknown app view option: ${token}`);
23975
24321
  }
23976
24322
  }
23977
- return { type: "app" /* App */, action, id, baseUrl, json };
24323
+ return { type: "app" /* App */, action, id, baseUrl: baseUrl2, json };
23978
24324
  }
23979
24325
  if (action === "get" || action === "delete") {
23980
24326
  const rawRef = rest.shift();
@@ -23990,7 +24336,7 @@ function parseAppArgs(tokens) {
23990
24336
  if (rest.length > 0) {
23991
24337
  throw new Error(`Unknown app ${action} option: ${rest[0]}`);
23992
24338
  }
23993
- return { type: "app" /* App */, action, id, baseUrl, json };
24339
+ return { type: "app" /* App */, action, id, baseUrl: baseUrl2, json };
23994
24340
  }
23995
24341
  if (action === "icon") {
23996
24342
  const nextToken = rest[0];
@@ -24054,7 +24400,7 @@ function parseAppArgs(tokens) {
24054
24400
  force = true;
24055
24401
  break;
24056
24402
  case "--base-url":
24057
- baseUrl = requireValue3(rest, token);
24403
+ baseUrl2 = requireValue3(rest, token);
24058
24404
  break;
24059
24405
  case "--json":
24060
24406
  json = true;
@@ -24080,7 +24426,7 @@ function parseAppArgs(tokens) {
24080
24426
  format: format2,
24081
24427
  output: output2,
24082
24428
  force,
24083
- baseUrl,
24429
+ baseUrl: baseUrl2,
24084
24430
  json
24085
24431
  };
24086
24432
  }
@@ -24147,7 +24493,7 @@ function parseAppArgs(tokens) {
24147
24493
  outDir = requireValue3(rest, token);
24148
24494
  break;
24149
24495
  case "--base-url":
24150
- baseUrl = requireValue3(rest, token);
24496
+ baseUrl2 = requireValue3(rest, token);
24151
24497
  break;
24152
24498
  case "--json":
24153
24499
  json = true;
@@ -24182,7 +24528,7 @@ function parseAppArgs(tokens) {
24182
24528
  format,
24183
24529
  output,
24184
24530
  outDir,
24185
- baseUrl,
24531
+ baseUrl: baseUrl2,
24186
24532
  json
24187
24533
  };
24188
24534
  }
@@ -24195,7 +24541,7 @@ function parseAppArgs(tokens) {
24195
24541
  filePath = requireValue3(rest, token);
24196
24542
  break;
24197
24543
  case "--base-url":
24198
- baseUrl = requireValue3(rest, token);
24544
+ baseUrl2 = requireValue3(rest, token);
24199
24545
  break;
24200
24546
  case "--json":
24201
24547
  json = true;
@@ -24207,7 +24553,7 @@ function parseAppArgs(tokens) {
24207
24553
  if (!filePath) {
24208
24554
  throw new Error("Missing required option --file for app create");
24209
24555
  }
24210
- return { type: "app" /* App */, action, filePath, baseUrl, json };
24556
+ return { type: "app" /* App */, action, filePath, baseUrl: baseUrl2, json };
24211
24557
  }
24212
24558
  if (action === "update") {
24213
24559
  const rawRef = rest.shift();
@@ -24225,7 +24571,7 @@ function parseAppArgs(tokens) {
24225
24571
  filePath = requireValue3(rest, token);
24226
24572
  break;
24227
24573
  case "--base-url":
24228
- baseUrl = requireValue3(rest, token);
24574
+ baseUrl2 = requireValue3(rest, token);
24229
24575
  break;
24230
24576
  case "--json":
24231
24577
  json = true;
@@ -24237,7 +24583,7 @@ function parseAppArgs(tokens) {
24237
24583
  if (!filePath) {
24238
24584
  throw new Error("Missing required option --file for app update");
24239
24585
  }
24240
- return { type: "app" /* App */, action, id, filePath, baseUrl, json };
24586
+ return { type: "app" /* App */, action, id, filePath, baseUrl: baseUrl2, json };
24241
24587
  }
24242
24588
  if (action === "rename") {
24243
24589
  let namespace;
@@ -24257,7 +24603,7 @@ function parseAppArgs(tokens) {
24257
24603
  toId = parseBareRenameId(requireValue3(rest, token), "app");
24258
24604
  break;
24259
24605
  case "--base-url":
24260
- baseUrl = requireValue3(rest, token);
24606
+ baseUrl2 = requireValue3(rest, token);
24261
24607
  break;
24262
24608
  case "--json":
24263
24609
  json = true;
@@ -24271,7 +24617,7 @@ function parseAppArgs(tokens) {
24271
24617
  "Usage: app rename --from <id> --to <id> --ns <namespace> [--base-url <url>] [--json]"
24272
24618
  );
24273
24619
  }
24274
- return { type: "app" /* App */, action, namespace, fromId, toId, baseUrl, json };
24620
+ return { type: "app" /* App */, action, namespace, fromId, toId, baseUrl: baseUrl2, json };
24275
24621
  }
24276
24622
  if (action === "move") {
24277
24623
  let namespace;
@@ -24296,7 +24642,7 @@ function parseAppArgs(tokens) {
24296
24642
  toId = parseBareRenameId(requireValue3(rest, token), "app");
24297
24643
  break;
24298
24644
  case "--base-url":
24299
- baseUrl = requireValue3(rest, token);
24645
+ baseUrl2 = requireValue3(rest, token);
24300
24646
  break;
24301
24647
  case "--json":
24302
24648
  json = true;
@@ -24310,7 +24656,7 @@ function parseAppArgs(tokens) {
24310
24656
  "Usage: app move --from <id> --ns <namespace> --to-ns <namespace> [--to <id>] [--base-url <url>] [--json]"
24311
24657
  );
24312
24658
  }
24313
- return { type: "app" /* App */, action, namespace, fromId, targetNamespace, toId, baseUrl, json };
24659
+ return { type: "app" /* App */, action, namespace, fromId, targetNamespace, toId, baseUrl: baseUrl2, json };
24314
24660
  }
24315
24661
  throw new Error(`Unknown app action: ${action}`);
24316
24662
  }
@@ -24366,7 +24712,7 @@ function parseServiceArgs(tokens) {
24366
24712
  if (!action) {
24367
24713
  throw new Error("Missing service action. Use: service list|get|view|create|update|rename|delete|deploy|stop|init|log");
24368
24714
  }
24369
- let baseUrl;
24715
+ let baseUrl2;
24370
24716
  let json = false;
24371
24717
  if (action === "list") {
24372
24718
  let namespace;
@@ -24385,7 +24731,7 @@ function parseServiceArgs(tokens) {
24385
24731
  server = requireValue4(rest, token);
24386
24732
  break;
24387
24733
  case "--base-url":
24388
- baseUrl = requireValue4(rest, token);
24734
+ baseUrl2 = requireValue4(rest, token);
24389
24735
  break;
24390
24736
  case "--json":
24391
24737
  json = true;
@@ -24394,7 +24740,7 @@ function parseServiceArgs(tokens) {
24394
24740
  throw new Error(`Unknown service list option: ${token}`);
24395
24741
  }
24396
24742
  }
24397
- return { type: "service" /* Service */, action, namespace, repository, server, baseUrl, json };
24743
+ return { type: "service" /* Service */, action, namespace, repository, server, baseUrl: baseUrl2, json };
24398
24744
  }
24399
24745
  if (action === "view") {
24400
24746
  const ref = rest.shift();
@@ -24405,7 +24751,7 @@ function parseServiceArgs(tokens) {
24405
24751
  const token = rest.shift();
24406
24752
  switch (token) {
24407
24753
  case "--base-url":
24408
- baseUrl = requireValue4(rest, token);
24754
+ baseUrl2 = requireValue4(rest, token);
24409
24755
  break;
24410
24756
  case "--json":
24411
24757
  json = true;
@@ -24420,7 +24766,7 @@ function parseServiceArgs(tokens) {
24420
24766
  action,
24421
24767
  namespace: parsedRef.namespace,
24422
24768
  name: parsedRef.objectId,
24423
- baseUrl,
24769
+ baseUrl: baseUrl2,
24424
24770
  json
24425
24771
  };
24426
24772
  }
@@ -24450,7 +24796,7 @@ function parseServiceArgs(tokens) {
24450
24796
  dryRun = true;
24451
24797
  break;
24452
24798
  case "--base-url":
24453
- baseUrl = requireValue4(rest, token);
24799
+ baseUrl2 = requireValue4(rest, token);
24454
24800
  break;
24455
24801
  case "--json":
24456
24802
  json = true;
@@ -24469,13 +24815,13 @@ function parseServiceArgs(tokens) {
24469
24815
  name: parsedRef.objectId,
24470
24816
  sslCert,
24471
24817
  dryRun,
24472
- baseUrl,
24818
+ baseUrl: baseUrl2,
24473
24819
  json
24474
24820
  };
24475
24821
  }
24476
24822
  if (action === "ios") throw new Error("service ios build was removed; use pmate service deploy <ns:ios-service>");
24477
24823
  if (action === "apk") {
24478
- return parseServiceApkArgs(rest, { baseUrl, json });
24824
+ return parseServiceApkArgs(rest, { baseUrl: baseUrl2, json });
24479
24825
  }
24480
24826
  if (action === "get" || action === "delete" || action === "deploy" || action === "stop" || action === "init" || action === "log" || action === "deploy-logs" || action === "deploy-history") {
24481
24827
  const ref = rest.shift();
@@ -24543,7 +24889,7 @@ function parseServiceArgs(tokens) {
24543
24889
  if (!Number.isSafeInteger(sinceMs) || sinceMs < 0) throw new Error("Invalid --since-ms");
24544
24890
  break;
24545
24891
  case "--base-url":
24546
- baseUrl = requireValue4(rest, token);
24892
+ baseUrl2 = requireValue4(rest, token);
24547
24893
  break;
24548
24894
  case "--cwd":
24549
24895
  if (action !== "init" && action !== "deploy") {
@@ -24582,11 +24928,11 @@ function parseServiceArgs(tokens) {
24582
24928
  const namespace = parsedRef.namespace;
24583
24929
  const name = parsedRef.objectId;
24584
24930
  if (action === "log") {
24585
- if (app && (history || follow || env || baseUrl)) throw new Error("App logs do not support --history, --follow, --env or --base-url; use --page, --search and --since-ms");
24586
- return { type: "service" /* Service */, action, namespace, name, baseUrl, json, page, history, search, follow, env, ...logFilters, ...app ? { app } : {}, ...sinceMs !== void 0 ? { sinceMs } : {} };
24931
+ if (app && (history || follow || env || baseUrl2)) throw new Error("App logs do not support --history, --follow, --env or --base-url; use --page, --search and --since-ms");
24932
+ return { type: "service" /* Service */, action, namespace, name, baseUrl: baseUrl2, json, page, history, search, follow, env, ...logFilters, ...app ? { app } : {}, ...sinceMs !== void 0 ? { sinceMs } : {} };
24587
24933
  }
24588
24934
  if (action === "deploy-logs" || action === "deploy-history") {
24589
- return { type: "service" /* Service */, action, namespace, name, env, page, baseUrl, json };
24935
+ return { type: "service" /* Service */, action, namespace, name, env, page, baseUrl: baseUrl2, json };
24590
24936
  }
24591
24937
  if (action === "deploy" || action === "stop") {
24592
24938
  if (native.signed && native.unsigned) throw new Error("--signed and --unsigned cannot be combined");
@@ -24604,15 +24950,15 @@ function parseServiceArgs(tokens) {
24604
24950
  native.lastBuild = Number(native.lastBuild);
24605
24951
  }
24606
24952
  if (action === "deploy") env ??= "prod";
24607
- return { type: "service" /* Service */, action, namespace, name, env, ...cwd ? { cwd } : {}, ...native, baseUrl, json };
24953
+ return { type: "service" /* Service */, action, namespace, name, env, ...cwd ? { cwd } : {}, ...native, baseUrl: baseUrl2, json };
24608
24954
  }
24609
24955
  if (action === "init") {
24610
24956
  if (!env) {
24611
24957
  throw new Error("Missing required option --env for service init");
24612
24958
  }
24613
- return { type: "service" /* Service */, action, namespace, name, env, cwd, baseUrl, json };
24959
+ return { type: "service" /* Service */, action, namespace, name, env, cwd, baseUrl: baseUrl2, json };
24614
24960
  }
24615
- return { type: "service" /* Service */, action, namespace, name, baseUrl, json };
24961
+ return { type: "service" /* Service */, action, namespace, name, baseUrl: baseUrl2, json };
24616
24962
  }
24617
24963
  if (action === "create") {
24618
24964
  let filePath;
@@ -24623,7 +24969,7 @@ function parseServiceArgs(tokens) {
24623
24969
  filePath = requireValue4(rest, token);
24624
24970
  break;
24625
24971
  case "--base-url":
24626
- baseUrl = requireValue4(rest, token);
24972
+ baseUrl2 = requireValue4(rest, token);
24627
24973
  break;
24628
24974
  case "--json":
24629
24975
  json = true;
@@ -24635,7 +24981,7 @@ function parseServiceArgs(tokens) {
24635
24981
  if (!filePath) {
24636
24982
  throw new Error("Missing required option --file for service create");
24637
24983
  }
24638
- return { type: "service" /* Service */, action, filePath, baseUrl, json };
24984
+ return { type: "service" /* Service */, action, filePath, baseUrl: baseUrl2, json };
24639
24985
  }
24640
24986
  if (action === "update") {
24641
24987
  const ref = rest.shift();
@@ -24655,7 +25001,7 @@ function parseServiceArgs(tokens) {
24655
25001
  filePath = requireValue4(rest, token);
24656
25002
  break;
24657
25003
  case "--base-url":
24658
- baseUrl = requireValue4(rest, token);
25004
+ baseUrl2 = requireValue4(rest, token);
24659
25005
  break;
24660
25006
  case "--json":
24661
25007
  json = true;
@@ -24667,7 +25013,7 @@ function parseServiceArgs(tokens) {
24667
25013
  if (!filePath) {
24668
25014
  throw new Error("Missing required option --file for service update");
24669
25015
  }
24670
- return { type: "service" /* Service */, action, namespace, name, filePath, baseUrl, json };
25016
+ return { type: "service" /* Service */, action, namespace, name, filePath, baseUrl: baseUrl2, json };
24671
25017
  }
24672
25018
  if (action === "rename") {
24673
25019
  let namespace;
@@ -24687,7 +25033,7 @@ function parseServiceArgs(tokens) {
24687
25033
  to = parseBareRenameId2(requireValue4(rest, token), "service");
24688
25034
  break;
24689
25035
  case "--base-url":
24690
- baseUrl = requireValue4(rest, token);
25036
+ baseUrl2 = requireValue4(rest, token);
24691
25037
  break;
24692
25038
  case "--json":
24693
25039
  json = true;
@@ -24707,7 +25053,7 @@ function parseServiceArgs(tokens) {
24707
25053
  namespace,
24708
25054
  fromName: from,
24709
25055
  toName: to,
24710
- baseUrl,
25056
+ baseUrl: baseUrl2,
24711
25057
  json
24712
25058
  };
24713
25059
  }
@@ -24734,7 +25080,7 @@ function parseServiceArgs(tokens) {
24734
25080
  to = parseBareRenameId2(requireValue4(rest, token), "service");
24735
25081
  break;
24736
25082
  case "--base-url":
24737
- baseUrl = requireValue4(rest, token);
25083
+ baseUrl2 = requireValue4(rest, token);
24738
25084
  break;
24739
25085
  case "--json":
24740
25086
  json = true;
@@ -24755,7 +25101,7 @@ function parseServiceArgs(tokens) {
24755
25101
  fromName: from,
24756
25102
  targetNamespace,
24757
25103
  toName: to,
24758
- baseUrl,
25104
+ baseUrl: baseUrl2,
24759
25105
  json
24760
25106
  };
24761
25107
  }
@@ -24785,16 +25131,16 @@ function parseServiceApkArgs(tokens, defaults) {
24785
25131
  if (action !== "list") throw new Error("Usage: service apk list <ns:service> [--env <env>] [--json]");
24786
25132
  const parsed = parseNamespacedRef(rest.shift() ?? "", { entityLabel: "service ref" });
24787
25133
  let env;
24788
- let baseUrl = defaults.baseUrl;
25134
+ let baseUrl2 = defaults.baseUrl;
24789
25135
  let json = defaults.json;
24790
25136
  while (rest.length) {
24791
25137
  const flag = rest.shift();
24792
25138
  if (flag === "--env") env = requireValue4(rest, flag);
24793
- else if (flag === "--base-url") baseUrl = requireValue4(rest, flag);
25139
+ else if (flag === "--base-url") baseUrl2 = requireValue4(rest, flag);
24794
25140
  else if (flag === "--json") json = true;
24795
25141
  else throw new Error(`Unknown service apk list option: ${flag}`);
24796
25142
  }
24797
- return { type: "service" /* Service */, action: "apk-list", namespace: parsed.namespace, name: parsed.objectId, env, baseUrl, json };
25143
+ return { type: "service" /* Service */, action: "apk-list", namespace: parsed.namespace, name: parsed.objectId, env, baseUrl: baseUrl2, json };
24798
25144
  }
24799
25145
  function parseServiceEnvDefinitionArgs(appId, tokens) {
24800
25146
  const rest = [...tokens];
@@ -24802,14 +25148,14 @@ function parseServiceEnvDefinitionArgs(appId, tokens) {
24802
25148
  if (!action) {
24803
25149
  throw new Error("Usage: service <ns:service> env list|get|add|expose");
24804
25150
  }
24805
- let baseUrl;
25151
+ let baseUrl2;
24806
25152
  let json = false;
24807
25153
  if (action === "list") {
24808
25154
  while (rest.length > 0) {
24809
25155
  const token = rest.shift();
24810
25156
  switch (token) {
24811
25157
  case "--base-url":
24812
- baseUrl = requireValue4(rest, token);
25158
+ baseUrl2 = requireValue4(rest, token);
24813
25159
  break;
24814
25160
  case "--json":
24815
25161
  json = true;
@@ -24818,7 +25164,7 @@ function parseServiceEnvDefinitionArgs(appId, tokens) {
24818
25164
  throw new Error(`Unknown service env list option: ${token}`);
24819
25165
  }
24820
25166
  }
24821
- return { type: "service" /* Service */, action: "service-env-list", appId, baseUrl, json };
25167
+ return { type: "service" /* Service */, action: "service-env-list", appId, baseUrl: baseUrl2, json };
24822
25168
  }
24823
25169
  if (action === "get" || action === "add") {
24824
25170
  const envName = rest.shift();
@@ -24829,7 +25175,7 @@ function parseServiceEnvDefinitionArgs(appId, tokens) {
24829
25175
  const token = rest.shift();
24830
25176
  switch (token) {
24831
25177
  case "--base-url":
24832
- baseUrl = requireValue4(rest, token);
25178
+ baseUrl2 = requireValue4(rest, token);
24833
25179
  break;
24834
25180
  case "--json":
24835
25181
  json = true;
@@ -24843,7 +25189,7 @@ function parseServiceEnvDefinitionArgs(appId, tokens) {
24843
25189
  action: action === "get" ? "service-env-get" : "service-env-add",
24844
25190
  appId,
24845
25191
  envName,
24846
- baseUrl,
25192
+ baseUrl: baseUrl2,
24847
25193
  json
24848
25194
  };
24849
25195
  }
@@ -24873,7 +25219,7 @@ function parseServiceEnvDefinitionArgs(appId, tokens) {
24873
25219
  off = true;
24874
25220
  break;
24875
25221
  case "--base-url":
24876
- baseUrl = requireValue4(rest, token);
25222
+ baseUrl2 = requireValue4(rest, token);
24877
25223
  break;
24878
25224
  case "--json":
24879
25225
  json = true;
@@ -24890,7 +25236,7 @@ function parseServiceEnvDefinitionArgs(appId, tokens) {
24890
25236
  exposeType,
24891
25237
  domain,
24892
25238
  off,
24893
- baseUrl,
25239
+ baseUrl: baseUrl2,
24894
25240
  json
24895
25241
  };
24896
25242
  }
@@ -24902,7 +25248,7 @@ function parseServiceEnvArgs(appId, tokens) {
24902
25248
  if (!action) {
24903
25249
  throw new Error("Usage: service <ns:app> env list|get|set|unset|resolve|pull|copy-from|update-scope");
24904
25250
  }
24905
- let baseUrl;
25251
+ let baseUrl2;
24906
25252
  let json = false;
24907
25253
  if (action === "list") {
24908
25254
  let scope;
@@ -24922,7 +25268,7 @@ function parseServiceEnvArgs(appId, tokens) {
24922
25268
  includeSecretValue = true;
24923
25269
  break;
24924
25270
  case "--base-url":
24925
- baseUrl = requireValue4(rest, token);
25271
+ baseUrl2 = requireValue4(rest, token);
24926
25272
  break;
24927
25273
  case "--json":
24928
25274
  json = true;
@@ -24931,7 +25277,7 @@ function parseServiceEnvArgs(appId, tokens) {
24931
25277
  throw new Error(`Unknown service env list option: ${token}`);
24932
25278
  }
24933
25279
  }
24934
- return { type: "service" /* Service */, action: "env-list", appId, scope, includeSecretMeta, includeSecretValue, baseUrl, json };
25280
+ return { type: "service" /* Service */, action: "env-list", appId, scope, includeSecretMeta, includeSecretValue, baseUrl: baseUrl2, json };
24935
25281
  }
24936
25282
  if (action === "get") {
24937
25283
  const key = rest.shift();
@@ -24951,7 +25297,7 @@ function parseServiceEnvArgs(appId, tokens) {
24951
25297
  includeSecretValue = true;
24952
25298
  break;
24953
25299
  case "--base-url":
24954
- baseUrl = requireValue4(rest, token);
25300
+ baseUrl2 = requireValue4(rest, token);
24955
25301
  break;
24956
25302
  case "--json":
24957
25303
  json = true;
@@ -24961,7 +25307,7 @@ function parseServiceEnvArgs(appId, tokens) {
24961
25307
  }
24962
25308
  }
24963
25309
  scope = scope ?? "all";
24964
- return { type: "service" /* Service */, action: "env-get", appId, key, scope, includeSecretValue, baseUrl, json };
25310
+ return { type: "service" /* Service */, action: "env-get", appId, key, scope, includeSecretValue, baseUrl: baseUrl2, json };
24965
25311
  }
24966
25312
  if (action === "set") {
24967
25313
  const key = rest.shift();
@@ -24989,7 +25335,7 @@ function parseServiceEnvArgs(appId, tokens) {
24989
25335
  prompt = true;
24990
25336
  break;
24991
25337
  case "--base-url":
24992
- baseUrl = requireValue4(rest, token);
25338
+ baseUrl2 = requireValue4(rest, token);
24993
25339
  break;
24994
25340
  case "--json":
24995
25341
  json = true;
@@ -25002,7 +25348,7 @@ function parseServiceEnvArgs(appId, tokens) {
25002
25348
  if (!value && !secret && !prompt) {
25003
25349
  throw new Error("Missing env value. Pass a value or use --prompt.");
25004
25350
  }
25005
- return { type: "service" /* Service */, action: "env-set", appId, key, value, scope, secret, prompt, baseUrl, json };
25351
+ return { type: "service" /* Service */, action: "env-set", appId, key, value, scope, secret, prompt, baseUrl: baseUrl2, json };
25006
25352
  }
25007
25353
  if (action === "unset") {
25008
25354
  const key = rest.shift();
@@ -25018,7 +25364,7 @@ function parseServiceEnvArgs(appId, tokens) {
25018
25364
  scope = requireValue4(rest, token);
25019
25365
  break;
25020
25366
  case "--base-url":
25021
- baseUrl = requireValue4(rest, token);
25367
+ baseUrl2 = requireValue4(rest, token);
25022
25368
  break;
25023
25369
  case "--json":
25024
25370
  json = true;
@@ -25028,7 +25374,7 @@ function parseServiceEnvArgs(appId, tokens) {
25028
25374
  }
25029
25375
  }
25030
25376
  scope = scope ?? "all";
25031
- return { type: "service" /* Service */, action: "env-unset", appId, key, scope, baseUrl, json };
25377
+ return { type: "service" /* Service */, action: "env-unset", appId, key, scope, baseUrl: baseUrl2, json };
25032
25378
  }
25033
25379
  if (action === "resolve") {
25034
25380
  let stage;
@@ -25047,7 +25393,7 @@ function parseServiceEnvArgs(appId, tokens) {
25047
25393
  includeSecretValue = true;
25048
25394
  break;
25049
25395
  case "--base-url":
25050
- baseUrl = requireValue4(rest, token);
25396
+ baseUrl2 = requireValue4(rest, token);
25051
25397
  break;
25052
25398
  case "--json":
25053
25399
  json = true;
@@ -25059,7 +25405,7 @@ function parseServiceEnvArgs(appId, tokens) {
25059
25405
  if (!stage) {
25060
25406
  throw new Error("Usage: service <ns:app> env resolve --stage <dev|preview|prod> [--branch <name>]");
25061
25407
  }
25062
- return { type: "service" /* Service */, action: "env-resolve", appId, stage, branch, includeSecretValue, baseUrl, json };
25408
+ return { type: "service" /* Service */, action: "env-resolve", appId, stage, branch, includeSecretValue, baseUrl: baseUrl2, json };
25063
25409
  }
25064
25410
  if (action === "pull") {
25065
25411
  let stage;
@@ -25078,7 +25424,7 @@ function parseServiceEnvArgs(appId, tokens) {
25078
25424
  output = requireValue4(rest, token);
25079
25425
  break;
25080
25426
  case "--base-url":
25081
- baseUrl = requireValue4(rest, token);
25427
+ baseUrl2 = requireValue4(rest, token);
25082
25428
  break;
25083
25429
  case "--json":
25084
25430
  json = true;
@@ -25090,7 +25436,7 @@ function parseServiceEnvArgs(appId, tokens) {
25090
25436
  if (!stage) {
25091
25437
  throw new Error("Usage: service <ns:app> env pull --stage <dev|preview|prod> [--branch <name>] [--output <path>]");
25092
25438
  }
25093
- return { type: "service" /* Service */, action: "env-pull", appId, stage, branch, output, baseUrl, json };
25439
+ return { type: "service" /* Service */, action: "env-pull", appId, stage, branch, output, baseUrl: baseUrl2, json };
25094
25440
  }
25095
25441
  if (action === "copy-from") {
25096
25442
  const sourceAppId = rest.shift();
@@ -25117,7 +25463,7 @@ function parseServiceEnvArgs(appId, tokens) {
25117
25463
  onlyKeys = requireValue4(rest, token).split(",").map((item) => item.trim()).filter(Boolean);
25118
25464
  break;
25119
25465
  case "--base-url":
25120
- baseUrl = requireValue4(rest, token);
25466
+ baseUrl2 = requireValue4(rest, token);
25121
25467
  break;
25122
25468
  case "--json":
25123
25469
  json = true;
@@ -25126,7 +25472,7 @@ function parseServiceEnvArgs(appId, tokens) {
25126
25472
  throw new Error(`Unknown service env copy-from option: ${token}`);
25127
25473
  }
25128
25474
  }
25129
- return { type: "service" /* Service */, action: "env-copy-from", targetAppId: appId, sourceAppId, scope, includeSecret, overwrite, onlyKeys, baseUrl, json };
25475
+ return { type: "service" /* Service */, action: "env-copy-from", targetAppId: appId, sourceAppId, scope, includeSecret, overwrite, onlyKeys, baseUrl: baseUrl2, json };
25130
25476
  }
25131
25477
  if (action === "update-scope") {
25132
25478
  let fromScope;
@@ -25151,7 +25497,7 @@ function parseServiceEnvArgs(appId, tokens) {
25151
25497
  onlyKeys = requireValue4(rest, token).split(",").map((item) => item.trim()).filter(Boolean);
25152
25498
  break;
25153
25499
  case "--base-url":
25154
- baseUrl = requireValue4(rest, token);
25500
+ baseUrl2 = requireValue4(rest, token);
25155
25501
  break;
25156
25502
  case "--json":
25157
25503
  json = true;
@@ -25171,7 +25517,7 @@ function parseServiceEnvArgs(appId, tokens) {
25171
25517
  toScope,
25172
25518
  overwrite,
25173
25519
  onlyKeys,
25174
- baseUrl,
25520
+ baseUrl: baseUrl2,
25175
25521
  json
25176
25522
  };
25177
25523
  }
@@ -25259,12 +25605,12 @@ function parseRoleArgs(tokens) {
25259
25605
  if (!action) {
25260
25606
  throw new Error("Missing role action. Use: role definition list|create");
25261
25607
  }
25262
- let baseUrl;
25608
+ let baseUrl2;
25263
25609
  let json = false;
25264
25610
  if (action === "list") {
25265
25611
  takeSharedOptions3(rest, {
25266
25612
  onBaseUrl: (value) => {
25267
- baseUrl = value;
25613
+ baseUrl2 = value;
25268
25614
  },
25269
25615
  onJson: () => {
25270
25616
  json = true;
@@ -25274,7 +25620,7 @@ function parseRoleArgs(tokens) {
25274
25620
  type: "role" /* Role */,
25275
25621
  resource,
25276
25622
  action,
25277
- baseUrl,
25623
+ baseUrl: baseUrl2,
25278
25624
  json
25279
25625
  };
25280
25626
  }
@@ -25297,7 +25643,7 @@ function parseRoleArgs(tokens) {
25297
25643
  description = requireValue5(rest, token);
25298
25644
  break;
25299
25645
  case "--base-url":
25300
- baseUrl = requireValue5(rest, token);
25646
+ baseUrl2 = requireValue5(rest, token);
25301
25647
  break;
25302
25648
  case "--json":
25303
25649
  json = true;
@@ -25313,7 +25659,7 @@ function parseRoleArgs(tokens) {
25313
25659
  role,
25314
25660
  displayName,
25315
25661
  description,
25316
- baseUrl,
25662
+ baseUrl: baseUrl2,
25317
25663
  json
25318
25664
  };
25319
25665
  }
@@ -25355,7 +25701,7 @@ function parseAccountArgs(tokens) {
25355
25701
  let nickName;
25356
25702
  let page;
25357
25703
  let pageSize;
25358
- let baseUrl2;
25704
+ let baseUrl3;
25359
25705
  let json2 = false;
25360
25706
  while (rest.length > 0) {
25361
25707
  const token = rest.shift();
@@ -25374,7 +25720,7 @@ function parseAccountArgs(tokens) {
25374
25720
  pageSize = parsePositiveInt(requireValue6(rest, token), token);
25375
25721
  break;
25376
25722
  case "--base-url":
25377
- baseUrl2 = requireValue6(rest, token);
25723
+ baseUrl3 = requireValue6(rest, token);
25378
25724
  break;
25379
25725
  case "--json":
25380
25726
  json2 = true;
@@ -25395,7 +25741,7 @@ function parseAccountArgs(tokens) {
25395
25741
  pageSize,
25396
25742
  mobile,
25397
25743
  nickName,
25398
- baseUrl: baseUrl2,
25744
+ baseUrl: baseUrl3,
25399
25745
  json: json2
25400
25746
  };
25401
25747
  }
@@ -25405,7 +25751,7 @@ function parseAccountArgs(tokens) {
25405
25751
  }).fullId;
25406
25752
  let page;
25407
25753
  let pageSize;
25408
- let baseUrl2;
25754
+ let baseUrl3;
25409
25755
  let json2 = false;
25410
25756
  while (rest.length > 0) {
25411
25757
  const token = rest.shift();
@@ -25417,7 +25763,7 @@ function parseAccountArgs(tokens) {
25417
25763
  pageSize = parsePositiveInt(requireValue6(rest, token), token);
25418
25764
  break;
25419
25765
  case "--base-url":
25420
- baseUrl2 = requireValue6(rest, token);
25766
+ baseUrl3 = requireValue6(rest, token);
25421
25767
  break;
25422
25768
  case "--json":
25423
25769
  json2 = true;
@@ -25432,7 +25778,7 @@ function parseAccountArgs(tokens) {
25432
25778
  app,
25433
25779
  page,
25434
25780
  pageSize,
25435
- baseUrl: baseUrl2,
25781
+ baseUrl: baseUrl3,
25436
25782
  json: json2
25437
25783
  };
25438
25784
  }
@@ -25440,7 +25786,7 @@ function parseAccountArgs(tokens) {
25440
25786
  let account2;
25441
25787
  let mobile;
25442
25788
  let nickName;
25443
- let baseUrl2;
25789
+ let baseUrl3;
25444
25790
  let json2 = false;
25445
25791
  while (rest.length > 0) {
25446
25792
  const token = rest.shift();
@@ -25458,7 +25804,7 @@ function parseAccountArgs(tokens) {
25458
25804
  nickName = requireValue6(rest, token);
25459
25805
  break;
25460
25806
  case "--base-url":
25461
- baseUrl2 = requireValue6(rest, token);
25807
+ baseUrl3 = requireValue6(rest, token);
25462
25808
  break;
25463
25809
  case "--json":
25464
25810
  json2 = true;
@@ -25483,7 +25829,7 @@ function parseAccountArgs(tokens) {
25483
25829
  account: account2,
25484
25830
  mobile,
25485
25831
  nickName,
25486
- baseUrl: baseUrl2,
25832
+ baseUrl: baseUrl3,
25487
25833
  json: json2
25488
25834
  };
25489
25835
  }
@@ -25496,7 +25842,7 @@ function parseAccountArgs(tokens) {
25496
25842
  let app;
25497
25843
  const apps = [];
25498
25844
  let filePath;
25499
- let baseUrl2;
25845
+ let baseUrl3;
25500
25846
  let json2 = false;
25501
25847
  while (rest.length > 0) {
25502
25848
  const token = rest.shift();
@@ -25514,7 +25860,7 @@ function parseAccountArgs(tokens) {
25514
25860
  filePath = requireValue6(rest, token);
25515
25861
  break;
25516
25862
  case "--base-url":
25517
- baseUrl2 = requireValue6(rest, token);
25863
+ baseUrl3 = requireValue6(rest, token);
25518
25864
  break;
25519
25865
  case "--json":
25520
25866
  json2 = true;
@@ -25532,7 +25878,7 @@ function parseAccountArgs(tokens) {
25532
25878
  return {
25533
25879
  type: "account" /* Account */,
25534
25880
  action: "visible-app-resolve",
25535
- baseUrl: baseUrl2,
25881
+ baseUrl: baseUrl3,
25536
25882
  json: json2
25537
25883
  };
25538
25884
  }
@@ -25546,7 +25892,7 @@ function parseAccountArgs(tokens) {
25546
25892
  type: "account" /* Account */,
25547
25893
  action: "visible-app-list",
25548
25894
  account: account2,
25549
- baseUrl: baseUrl2,
25895
+ baseUrl: baseUrl3,
25550
25896
  json: json2
25551
25897
  };
25552
25898
  }
@@ -25561,7 +25907,7 @@ function parseAccountArgs(tokens) {
25561
25907
  action: visibleAction === "add" ? "visible-app-add" : "visible-app-remove",
25562
25908
  account: account2,
25563
25909
  app,
25564
- baseUrl: baseUrl2,
25910
+ baseUrl: baseUrl3,
25565
25911
  json: json2
25566
25912
  };
25567
25913
  }
@@ -25577,7 +25923,7 @@ function parseAccountArgs(tokens) {
25577
25923
  account: account2,
25578
25924
  apps: apps.length > 0 ? apps : void 0,
25579
25925
  filePath,
25580
- baseUrl: baseUrl2,
25926
+ baseUrl: baseUrl3,
25581
25927
  json: json2
25582
25928
  };
25583
25929
  }
@@ -25586,7 +25932,7 @@ function parseAccountArgs(tokens) {
25586
25932
  if (action === "bot") {
25587
25933
  const botAction = rest.shift();
25588
25934
  if (!botAction) {
25589
- throw new Error("Missing account bot action. Use: account bot keygen|create|view|list|rename|login|profile");
25935
+ throw new Error("Missing account bot action. Use: account bot keygen|create|view|list|rename|nickname|login|profile");
25590
25936
  }
25591
25937
  const botProfileAction = botAction === "profile" ? rest.shift() : void 0;
25592
25938
  let app;
@@ -25598,7 +25944,7 @@ function parseAccountArgs(tokens) {
25598
25944
  let newName;
25599
25945
  let nickName;
25600
25946
  let role2;
25601
- let baseUrl2;
25947
+ let baseUrl3;
25602
25948
  let json2 = false;
25603
25949
  while (rest.length > 0) {
25604
25950
  const token = rest.shift();
@@ -25640,7 +25986,7 @@ function parseAccountArgs(tokens) {
25640
25986
  break;
25641
25987
  }
25642
25988
  case "--base-url":
25643
- baseUrl2 = requireValue6(rest, token);
25989
+ baseUrl3 = requireValue6(rest, token);
25644
25990
  break;
25645
25991
  case "--json":
25646
25992
  json2 = true;
@@ -25659,40 +26005,49 @@ function parseAccountArgs(tokens) {
25659
26005
  if (!app || !name || !keyFile && !publicKey) {
25660
26006
  throw new Error("Usage: account bot create --app <ns:app> --name <name> (--key-file <path> | --public-key <key>) [--base-url <url>] [--json]");
25661
26007
  }
25662
- return { type: "account" /* Account */, action: "bot-create", app, name, keyFile, publicKey, baseUrl: baseUrl2, json: json2 };
26008
+ return { type: "account" /* Account */, action: "bot-create", app, name, keyFile, publicKey, baseUrl: baseUrl3, json: json2 };
25663
26009
  }
25664
26010
  if (botAction === "view") {
25665
26011
  if (!app || !name) {
25666
26012
  throw new Error("Usage: account bot view --app <ns:app> --name <name> [--base-url <url>] [--json]");
25667
26013
  }
25668
- return { type: "account" /* Account */, action: "bot-view", app, name, baseUrl: baseUrl2, json: json2 };
26014
+ return { type: "account" /* Account */, action: "bot-view", app, name, baseUrl: baseUrl3, json: json2 };
25669
26015
  }
25670
26016
  if (botAction === "list") {
25671
26017
  if (!app) {
25672
26018
  throw new Error("Usage: account bot list --app <ns:app> [--base-url <url>] [--json]");
25673
26019
  }
25674
- return { type: "account" /* Account */, action: "bot-list", app, baseUrl: baseUrl2, json: json2 };
26020
+ return { type: "account" /* Account */, action: "bot-list", app, baseUrl: baseUrl3, json: json2 };
25675
26021
  }
25676
26022
  if (botAction === "rename") {
25677
26023
  if (!app || !name || !newName) {
25678
26024
  throw new Error("Usage: account bot rename --app <ns:app> --name <name> --new-name <new-name> [--base-url <url>] [--json]");
25679
26025
  }
25680
- return { type: "account" /* Account */, action: "bot-rename", app, name, newName, baseUrl: baseUrl2, json: json2 };
26026
+ return { type: "account" /* Account */, action: "bot-rename", app, name, newName, baseUrl: baseUrl3, json: json2 };
25681
26027
  }
25682
26028
  if (botAction === "login") {
25683
26029
  if (!app || !name || !keyFile && !privateKey) {
25684
26030
  throw new Error("Usage: account bot login --app <ns:app> --name <name> (--key-file <path> | --private-key <key>) [--base-url <url>] [--json]");
25685
26031
  }
25686
- return { type: "account" /* Account */, action: "bot-login", app, name, keyFile, privateKey, baseUrl: baseUrl2, json: json2 };
26032
+ return { type: "account" /* Account */, action: "bot-login", app, name, keyFile, privateKey, baseUrl: baseUrl3, json: json2 };
26033
+ }
26034
+ if (botAction === "nickname" || botAction === "profile" && botProfileAction === "update") {
26035
+ if (!app || !name?.trim() || !nickName?.trim()) {
26036
+ throw new Error("Usage: account bot profile update --app <ns:app> --name <name> --nickname <nickname> [--base-url <url>] [--json]");
26037
+ }
26038
+ if (role2 || newName || keyFile || publicKey || privateKey || out) {
26039
+ throw new Error("Bot profile update only accepts --app, --name, --nickname, --base-url, and --json");
26040
+ }
26041
+ return { type: "account" /* Account */, action: "bot-profile-update", app, name, nickName: nickName.trim(), baseUrl: baseUrl3, json: json2 };
25687
26042
  }
25688
26043
  if (botAction === "profile") {
25689
26044
  if (botProfileAction !== "create") {
25690
- throw new Error("Usage: account bot profile create --app <ns:app> --name <name> --nickname <nickname> [--role <role>] [--base-url <url>] [--json]");
26045
+ throw new Error("Usage: account bot profile create|update --app <ns:app> --name <name> --nickname <nickname> [--role <role>] [--base-url <url>] [--json]");
25691
26046
  }
25692
26047
  if (!app || !name || !nickName) {
25693
26048
  throw new Error("Usage: account bot profile create --app <ns:app> --name <name> --nickname <nickname> [--role <role>] [--base-url <url>] [--json]");
25694
26049
  }
25695
- return { type: "account" /* Account */, action: "bot-profile-create", app, name, nickName, role: role2, baseUrl: baseUrl2, json: json2 };
26050
+ return { type: "account" /* Account */, action: "bot-profile-create", app, name, nickName, role: role2, baseUrl: baseUrl3, json: json2 };
25696
26051
  }
25697
26052
  throw new Error(`Unknown account bot action: ${botAction}`);
25698
26053
  }
@@ -25710,7 +26065,7 @@ function parseAccountArgs(tokens) {
25710
26065
  let key;
25711
26066
  let keyFile;
25712
26067
  let gracePeriodSeconds;
25713
- let baseUrl2;
26068
+ let baseUrl3;
25714
26069
  let json2 = false;
25715
26070
  while (rest.length > 0) {
25716
26071
  const token = rest.shift();
@@ -25745,7 +26100,7 @@ function parseAccountArgs(tokens) {
25745
26100
  keyFile = requireValue6(rest, token);
25746
26101
  break;
25747
26102
  case "--base-url":
25748
- baseUrl2 = requireValue6(rest, token);
26103
+ baseUrl3 = requireValue6(rest, token);
25749
26104
  break;
25750
26105
  case "--json":
25751
26106
  json2 = true;
@@ -25765,28 +26120,28 @@ function parseAccountArgs(tokens) {
25765
26120
  if (!app || !name) {
25766
26121
  throw new Error("Usage: account access-key create --app <ns:app> --name <name> [--expires-at <iso> | --expires-in <duration>] [--namespace <ns>] [--out <path>] [--base-url <url>] [--json]");
25767
26122
  }
25768
- return { type: "account" /* Account */, action: "access-key-create", app, name, namespace: namespace2, expiresAt, out, baseUrl: baseUrl2, json: json2 };
26123
+ return { type: "account" /* Account */, action: "access-key-create", app, name, namespace: namespace2, expiresAt, out, baseUrl: baseUrl3, json: json2 };
25769
26124
  }
25770
26125
  if (keyAction === "list") {
25771
- return { type: "account" /* Account */, action: "access-key-list", app, namespace: namespace2, baseUrl: baseUrl2, json: json2 };
26126
+ return { type: "account" /* Account */, action: "access-key-list", app, namespace: namespace2, baseUrl: baseUrl3, json: json2 };
25772
26127
  }
25773
26128
  if (keyAction === "disable") {
25774
26129
  if (!id) {
25775
26130
  throw new Error("Usage: account access-key disable <id> [--base-url <url>] [--json]");
25776
26131
  }
25777
- return { type: "account" /* Account */, action: "access-key-disable", id, baseUrl: baseUrl2, json: json2 };
26132
+ return { type: "account" /* Account */, action: "access-key-disable", id, baseUrl: baseUrl3, json: json2 };
25778
26133
  }
25779
26134
  if (keyAction === "rotate") {
25780
26135
  if (!id) {
25781
26136
  throw new Error("Usage: account access-key rotate <id> [--expires-at <iso> | --expires-in <duration>] [--grace-period <duration>] [--out <path>] [--base-url <url>] [--json]");
25782
26137
  }
25783
- return { type: "account" /* Account */, action: "access-key-rotate", id, expiresAt, gracePeriodSeconds, out, baseUrl: baseUrl2, json: json2 };
26138
+ return { type: "account" /* Account */, action: "access-key-rotate", id, expiresAt, gracePeriodSeconds, out, baseUrl: baseUrl3, json: json2 };
25784
26139
  }
25785
26140
  if (keyAction === "login") {
25786
26141
  if (!app || !key && !keyFile || key && keyFile) {
25787
26142
  throw new Error("Usage: account access-key login --app <ns:app> (--key <secret> | --key-file <path>) [--base-url <url>] [--json]");
25788
26143
  }
25789
- return { type: "account" /* Account */, action: "access-key-login", app, key, keyFile, baseUrl: baseUrl2, json: json2 };
26144
+ return { type: "account" /* Account */, action: "access-key-login", app, key, keyFile, baseUrl: baseUrl3, json: json2 };
25790
26145
  }
25791
26146
  throw new Error(`Unknown account access-key action: ${keyAction}`);
25792
26147
  }
@@ -25800,7 +26155,7 @@ function parseAccountArgs(tokens) {
25800
26155
  let account;
25801
26156
  let namespace;
25802
26157
  let role;
25803
- let baseUrl;
26158
+ let baseUrl2;
25804
26159
  let json = false;
25805
26160
  while (rest.length > 0) {
25806
26161
  const token = rest.shift();
@@ -25815,7 +26170,7 @@ function parseAccountArgs(tokens) {
25815
26170
  role = requireValue6(rest, token);
25816
26171
  break;
25817
26172
  case "--base-url":
25818
- baseUrl = requireValue6(rest, token);
26173
+ baseUrl2 = requireValue6(rest, token);
25819
26174
  break;
25820
26175
  case "--json":
25821
26176
  json = true;
@@ -25835,7 +26190,7 @@ function parseAccountArgs(tokens) {
25835
26190
  action: "role-list",
25836
26191
  account,
25837
26192
  namespace,
25838
- baseUrl,
26193
+ baseUrl: baseUrl2,
25839
26194
  json
25840
26195
  };
25841
26196
  }
@@ -25851,7 +26206,7 @@ function parseAccountArgs(tokens) {
25851
26206
  account,
25852
26207
  namespace,
25853
26208
  role,
25854
- baseUrl,
26209
+ baseUrl: baseUrl2,
25855
26210
  json
25856
26211
  };
25857
26212
  }
@@ -25896,14 +26251,14 @@ function parseOrgArgs(tokens) {
25896
26251
  "Missing org action. Use: org list|get|view|create|update|disable|member|visible-app"
25897
26252
  );
25898
26253
  }
25899
- let baseUrl;
26254
+ let baseUrl2;
25900
26255
  let json = false;
25901
26256
  const takeSharedOptions4 = () => {
25902
26257
  while (rest.length > 0) {
25903
26258
  const token = rest[0];
25904
26259
  if (token === "--base-url") {
25905
26260
  rest.shift();
25906
- baseUrl = requireValue7(rest, token);
26261
+ baseUrl2 = requireValue7(rest, token);
25907
26262
  continue;
25908
26263
  }
25909
26264
  if (token === "--json") {
@@ -25919,7 +26274,7 @@ function parseOrgArgs(tokens) {
25919
26274
  if (rest.length > 0) {
25920
26275
  throw new Error(`Unknown org list option: ${rest[0]}`);
25921
26276
  }
25922
- return { type: "org" /* Org */, action, baseUrl, json };
26277
+ return { type: "org" /* Org */, action, baseUrl: baseUrl2, json };
25923
26278
  }
25924
26279
  if (action === "get" || action === "view" || action === "disable") {
25925
26280
  const orgId = parseRequiredOrgRef(rest.shift(), action);
@@ -25927,7 +26282,7 @@ function parseOrgArgs(tokens) {
25927
26282
  if (rest.length > 0) {
25928
26283
  throw new Error(`Unknown org ${action} option: ${rest[0]}`);
25929
26284
  }
25930
- return { type: "org" /* Org */, action, orgId, baseUrl, json };
26285
+ return { type: "org" /* Org */, action, orgId, baseUrl: baseUrl2, json };
25931
26286
  }
25932
26287
  if (action === "create") {
25933
26288
  const orgId = parseRequiredOrgRef(rest.shift(), action);
@@ -25943,7 +26298,7 @@ function parseOrgArgs(tokens) {
25943
26298
  members.push(requireValue7(rest, token));
25944
26299
  break;
25945
26300
  case "--base-url":
25946
- baseUrl = requireValue7(rest, token);
26301
+ baseUrl2 = requireValue7(rest, token);
25947
26302
  break;
25948
26303
  case "--json":
25949
26304
  json = true;
@@ -25963,7 +26318,7 @@ function parseOrgArgs(tokens) {
25963
26318
  orgId,
25964
26319
  displayName,
25965
26320
  members,
25966
- baseUrl,
26321
+ baseUrl: baseUrl2,
25967
26322
  json
25968
26323
  };
25969
26324
  }
@@ -25977,7 +26332,7 @@ function parseOrgArgs(tokens) {
25977
26332
  displayName = requireValue7(rest, token);
25978
26333
  break;
25979
26334
  case "--base-url":
25980
- baseUrl = requireValue7(rest, token);
26335
+ baseUrl2 = requireValue7(rest, token);
25981
26336
  break;
25982
26337
  case "--json":
25983
26338
  json = true;
@@ -25996,7 +26351,7 @@ function parseOrgArgs(tokens) {
25996
26351
  action,
25997
26352
  orgId,
25998
26353
  displayName,
25999
- baseUrl,
26354
+ baseUrl: baseUrl2,
26000
26355
  json
26001
26356
  };
26002
26357
  }
@@ -26029,7 +26384,7 @@ function parseOrgArgs(tokens) {
26029
26384
  filePath = requireValue7(memberTokens, token);
26030
26385
  break;
26031
26386
  case "--base-url":
26032
- baseUrl = requireValue7(memberTokens, token);
26387
+ baseUrl2 = requireValue7(memberTokens, token);
26033
26388
  break;
26034
26389
  case "--json":
26035
26390
  json = true;
@@ -26039,7 +26394,7 @@ function parseOrgArgs(tokens) {
26039
26394
  }
26040
26395
  }
26041
26396
  if (subAction === "list") {
26042
- return { type: "org" /* Org */, action: "member-list", orgId, baseUrl, json };
26397
+ return { type: "org" /* Org */, action: "member-list", orgId, baseUrl: baseUrl2, json };
26043
26398
  }
26044
26399
  if (subAction === "add" || subAction === "remove") {
26045
26400
  if (!account) {
@@ -26052,7 +26407,7 @@ function parseOrgArgs(tokens) {
26052
26407
  action: subAction === "add" ? "member-add" : "member-remove",
26053
26408
  orgId,
26054
26409
  account,
26055
- baseUrl,
26410
+ baseUrl: baseUrl2,
26056
26411
  json
26057
26412
  };
26058
26413
  }
@@ -26068,7 +26423,7 @@ function parseOrgArgs(tokens) {
26068
26423
  orgId,
26069
26424
  accounts: accounts.length > 0 ? accounts : void 0,
26070
26425
  filePath,
26071
- baseUrl,
26426
+ baseUrl: baseUrl2,
26072
26427
  json
26073
26428
  };
26074
26429
  }
@@ -26100,7 +26455,7 @@ function parseOrgArgs(tokens) {
26100
26455
  filePath = requireValue7(visibleTokens, token);
26101
26456
  break;
26102
26457
  case "--base-url":
26103
- baseUrl = requireValue7(visibleTokens, token);
26458
+ baseUrl2 = requireValue7(visibleTokens, token);
26104
26459
  break;
26105
26460
  case "--json":
26106
26461
  json = true;
@@ -26110,7 +26465,7 @@ function parseOrgArgs(tokens) {
26110
26465
  }
26111
26466
  }
26112
26467
  if (subAction === "list") {
26113
- return { type: "org" /* Org */, action: "visible-app-list", orgId, baseUrl, json };
26468
+ return { type: "org" /* Org */, action: "visible-app-list", orgId, baseUrl: baseUrl2, json };
26114
26469
  }
26115
26470
  if (subAction === "add" || subAction === "remove") {
26116
26471
  if (!app) {
@@ -26123,7 +26478,7 @@ function parseOrgArgs(tokens) {
26123
26478
  action: subAction === "add" ? "visible-app-add" : "visible-app-remove",
26124
26479
  orgId,
26125
26480
  app,
26126
- baseUrl,
26481
+ baseUrl: baseUrl2,
26127
26482
  json
26128
26483
  };
26129
26484
  }
@@ -26139,7 +26494,7 @@ function parseOrgArgs(tokens) {
26139
26494
  orgId,
26140
26495
  apps: apps.length > 0 ? apps : void 0,
26141
26496
  filePath,
26142
- baseUrl,
26497
+ baseUrl: baseUrl2,
26143
26498
  json
26144
26499
  };
26145
26500
  }
@@ -26184,18 +26539,18 @@ function parseHostArgs(tokens) {
26184
26539
  } else throw new Error("Usage: host env list|set|unset ... | host apply");
26185
26540
  let host;
26186
26541
  let secret = false;
26187
- let baseUrl;
26542
+ let baseUrl2;
26188
26543
  let json = false;
26189
26544
  while (rest.length > 0) {
26190
26545
  const token = rest.shift();
26191
26546
  if (token === "--host") host = requireValue8(rest, token);
26192
26547
  else if (token === "--secret") secret = true;
26193
- else if (token === "--base-url") baseUrl = requireValue8(rest, token);
26548
+ else if (token === "--base-url") baseUrl2 = requireValue8(rest, token);
26194
26549
  else if (token === "--json") json = true;
26195
26550
  else throw new Error(`Unknown host option: ${token}`);
26196
26551
  }
26197
26552
  if (secret && action !== "env-set") throw new Error("--secret is only valid for host env set");
26198
- return { type: "host" /* Host */, action, host, key, value, secret, baseUrl, json };
26553
+ return { type: "host" /* Host */, action, host, key, value, secret, baseUrl: baseUrl2, json };
26199
26554
  }
26200
26555
  function requireValue8(tokens, label) {
26201
26556
  const value = tokens.shift();
@@ -26645,7 +27000,7 @@ function requireValue11(tokens, option) {
26645
27000
 
26646
27001
  // src/index.ts
26647
27002
  var pkg = JSON.parse(
26648
- (0, import_node_fs30.readFileSync)(import_node_path35.default.resolve(__dirname, "..", "package.json"), "utf8")
27003
+ (0, import_node_fs31.readFileSync)(import_node_path36.default.resolve(__dirname, "..", "package.json"), "utf8")
26649
27004
  );
26650
27005
  var HELP_TEXT = [
26651
27006
  import_chalk4.default.bold(`pmate v${pkg.version}`),
@@ -26767,6 +27122,8 @@ var HELP_TEXT = [
26767
27122
  ` ${import_chalk4.default.gray(" bot list --app <ns:app> [--base-url <url>] [--json]")}`,
26768
27123
  ` ${import_chalk4.default.gray(" bot login --app <ns:app> --name <name> (--key-file <path> | --private-key <key>) [--base-url <url>] [--json]")}`,
26769
27124
  ` ${import_chalk4.default.gray(" bot profile create --app <ns:app> --name <name> --nickname <nickname> [--role <role>] [--base-url <url>] [--json]")}`,
27125
+ ` ${import_chalk4.default.gray(" bot profile update --app <ns:app> --name <name> --nickname <nickname> [--base-url <url>] [--json]")}`,
27126
+ ` ${import_chalk4.default.gray(" bot nickname --app <ns:app> --name <name> --nickname <nickname> [--base-url <url>] [--json] (alias for profile update)")}`,
26770
27127
  ` ${import_chalk4.default.gray(" access-key create --app <ns:app> --name <name> [--expires-at <iso> | --expires-in <duration>] [--namespace <ns>] [--out <path>] [--base-url <url>] [--json]")}`,
26771
27128
  ` ${import_chalk4.default.gray(" access-key list [--app <ns:app>] [--namespace <ns>] [--base-url <url>] [--json]")}`,
26772
27129
  ` ${import_chalk4.default.gray(" access-key rotate <id> [--expires-at <iso> | --expires-in <duration>] [--grace-period <duration>] [--out <path>] [--base-url <url>] [--json]")}`,
@@ -27220,14 +27577,14 @@ function parseOssArgs(tokens) {
27220
27577
  if (action !== "upload") {
27221
27578
  throw new Error(`Unknown oss action: ${action}`);
27222
27579
  }
27223
- let bucket;
27580
+ let bucket2;
27224
27581
  let filePath;
27225
27582
  let objectKey;
27226
27583
  while (rest.length > 0) {
27227
27584
  const token = rest.shift();
27228
27585
  switch (token) {
27229
27586
  case "--bucket":
27230
- bucket = requireValue12(rest, token);
27587
+ bucket2 = requireValue12(rest, token);
27231
27588
  break;
27232
27589
  case "--file":
27233
27590
  filePath = requireValue12(rest, token);
@@ -27245,7 +27602,7 @@ function parseOssArgs(tokens) {
27245
27602
  if (!objectKey) {
27246
27603
  throw new Error("Missing required option --key for oss upload");
27247
27604
  }
27248
- return { type: "oss" /* Oss */, action, bucket, filePath, objectKey };
27605
+ return { type: "oss" /* Oss */, action, bucket: bucket2, filePath, objectKey };
27249
27606
  }
27250
27607
  function parseEnvArgs(tokens) {
27251
27608
  const rest = [...tokens];