@mx-space/cli 0.5.0 → 0.5.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/bin/mxs.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { t as run } from "../mxs-Dsh_ZkeN.mjs";
2
+ import { t as run } from "../mxs-CCu8LdBX.mjs";
3
3
  export { run };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as defaultMessageFor, c as tagToCode, i as codeForTag, l as toErrorEnvelope, n as defaultGlobalFlags, o as exitCodeForError, r as parseGlobalFlags, s as exitCodeForTag, t as run } from "./mxs-Dsh_ZkeN.mjs";
1
+ import { a as defaultMessageFor, c as tagToCode, i as codeForTag, l as toErrorEnvelope, n as defaultGlobalFlags, o as exitCodeForError, r as parseGlobalFlags, s as exitCodeForTag, t as run } from "./mxs-CCu8LdBX.mjs";
2
2
  export { codeForTag, defaultGlobalFlags, defaultMessageFor, exitCodeForError, exitCodeForTag, parseGlobalFlags, run, tagToCode, toErrorEnvelope };
@@ -3909,7 +3909,7 @@ const getHelp$4 = (self) => getHelpInternal$3(self);
3909
3909
  /** @internal */
3910
3910
  const getTypeName = (self) => getTypeNameInternal(self);
3911
3911
  /** @internal */
3912
- const validate$1 = /* @__PURE__ */ dual(3, (self, value, config) => validateInternal$1(self, value, config));
3912
+ const validate$2 = /* @__PURE__ */ dual(3, (self, value, config) => validateInternal$1(self, value, config));
3913
3913
  /** @internal */
3914
3914
  const wizard$3 = /* @__PURE__ */ dual(2, (self, help) => wizardInternal$3(self, help));
3915
3915
  const getChoicesInternal = (self) => {
@@ -4342,7 +4342,7 @@ const optional$5 = (self) => makeWithDefault$1(map$2(self, some), none$3());
4342
4342
  /** @internal */
4343
4343
  const repeated$1 = (self) => makeVariadic$1(self, none$3(), none$3());
4344
4344
  /** @internal */
4345
- const validate = /* @__PURE__ */ dual(3, (self, args, config) => validateInternal(self, args, config));
4345
+ const validate$1 = /* @__PURE__ */ dual(3, (self, args, config) => validateInternal(self, args, config));
4346
4346
  /** @internal */
4347
4347
  const wizard$2 = /* @__PURE__ */ dual(2, (self, config) => wizardInternal$2(self, config));
4348
4348
  const allTupled$1 = (arg) => {
@@ -4468,7 +4468,7 @@ const validateInternal = (self, args, config) => {
4468
4468
  if (isSome(choices)) return fail$2(missingValue(p$2(`Missing argument ${getTypeName(self.primitiveType)} with choices ${choices.value}`)));
4469
4469
  return fail$2(missingValue(p$2(`Missing argument ${getTypeName(self.primitiveType)}`)));
4470
4470
  },
4471
- onNonEmpty: (head, tail) => validate$1(self.primitiveType, some(head), config).pipe(mapBoth({
4471
+ onNonEmpty: (head, tail) => validate$2(self.primitiveType, some(head), config).pipe(mapBoth({
4472
4472
  onFailure: (text) => invalidArgument(p$2(text)),
4473
4473
  onSuccess: (a) => [tail, a]
4474
4474
  }))
@@ -4988,10 +4988,10 @@ const parseInternal$1 = (self, args, config) => {
4988
4988
  if (isNonEmptyReadonlyArray(singleNames)) {
4989
4989
  const head = headNonEmpty(singleNames);
4990
4990
  if (isEmptyReadonlyArray(tailNonEmpty(singleNames))) {
4991
- if (isEmptyReadonlyArray(head)) return validate$1(self.primitiveType, none$3(), config).pipe(mapError((e) => invalidValue(p$2(e))));
4991
+ if (isEmptyReadonlyArray(head)) return validate$2(self.primitiveType, none$3(), config).pipe(mapError((e) => invalidValue(p$2(e))));
4992
4992
  if (isNonEmptyReadonlyArray(head) && isEmptyReadonlyArray(tailNonEmpty(head))) {
4993
4993
  const value = headNonEmpty(head);
4994
- return validate$1(self.primitiveType, some(value), config).pipe(mapError((e) => invalidValue(p$2(e))));
4994
+ return validate$2(self.primitiveType, some(value), config).pipe(mapError((e) => invalidValue(p$2(e))));
4995
4995
  }
4996
4996
  return fail$2(multipleValuesDetected(empty$6, head));
4997
4997
  }
@@ -5037,7 +5037,7 @@ const parseInternal$1 = (self, args, config) => {
5037
5037
  if (values.length < min) return fail$2(invalidValue(p$2(`Expected at least ${min} value(s) for option: '${self.argumentOption.fullName}'`)));
5038
5038
  if (values.length > max) return fail$2(invalidValue(p$2(`Expected at most ${max} value(s) for option: '${self.argumentOption.fullName}'`)));
5039
5039
  const primitive = self.argumentOption.primitiveType;
5040
- const validatePrimitive = (value) => validate$1(primitive, some(value), config).pipe(mapError((e) => invalidValue(p$2(e))));
5040
+ const validatePrimitive = (value) => validate$2(primitive, some(value), config).pipe(mapError((e) => invalidValue(p$2(e))));
5041
5041
  return forEach$1(values, (value) => validatePrimitive(value));
5042
5042
  };
5043
5043
  if (every(matchedArgument, isEmptyReadonlyArray)) return validateMinMax(empty$11());
@@ -5895,7 +5895,7 @@ const parseInternal = (self, args, config) => {
5895
5895
  });
5896
5896
  const parseUserDefinedArgs = (args) => parseCommandLine(self, args).pipe(flatMap$1((commandOptionsAndArgs) => {
5897
5897
  const [optionsAndArgs, forcedCommandArgs] = splitForcedArgs(commandOptionsAndArgs);
5898
- return processCommandLine(self.options, optionsAndArgs, config).pipe(flatMap$1(([error, commandArgs, optionsType]) => validate(self.args, appendAll(commandArgs, forcedCommandArgs), config).pipe(catchAll((e) => match(error, {
5898
+ return processCommandLine(self.options, optionsAndArgs, config).pipe(flatMap$1(([error, commandArgs, optionsType]) => validate$1(self.args, appendAll(commandArgs, forcedCommandArgs), config).pipe(catchAll((e) => match(error, {
5899
5899
  onNone: () => fail$2(e),
5900
5900
  onSome: (err) => fail$2(err)
5901
5901
  })), map$6(([argsLeftover, argsType]) => userDefined(argsLeftover, {
@@ -10274,7 +10274,7 @@ const getCodePointsLength = (() => {
10274
10274
  return input.length - surrogatePairsNr;
10275
10275
  };
10276
10276
  })();
10277
- const isFullWidth = (x) => {
10277
+ const isFullWidth$1 = (x) => {
10278
10278
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
10279
10279
  };
10280
10280
  const isWideNotCJKTNotEmoji = (x) => {
@@ -10329,7 +10329,7 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
10329
10329
  lengthExtra = 0;
10330
10330
  for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
10331
10331
  const codePoint = char.codePointAt(0) || 0;
10332
- if (isFullWidth(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
10332
+ if (isFullWidth$1(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
10333
10333
  else if (isWideNotCJKTNotEmoji(codePoint)) widthExtra = WIDE_WIDTH;
10334
10334
  else widthExtra = REGULAR_WIDTH;
10335
10335
  if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
@@ -11212,6 +11212,682 @@ const currentOutputOptions = unsafeMake({
11212
11212
  quiet: false,
11213
11213
  verbose: false
11214
11214
  });
11215
+ const ambiguousRanges = [
11216
+ 161,
11217
+ 161,
11218
+ 164,
11219
+ 164,
11220
+ 167,
11221
+ 168,
11222
+ 170,
11223
+ 170,
11224
+ 173,
11225
+ 174,
11226
+ 176,
11227
+ 180,
11228
+ 182,
11229
+ 186,
11230
+ 188,
11231
+ 191,
11232
+ 198,
11233
+ 198,
11234
+ 208,
11235
+ 208,
11236
+ 215,
11237
+ 216,
11238
+ 222,
11239
+ 225,
11240
+ 230,
11241
+ 230,
11242
+ 232,
11243
+ 234,
11244
+ 236,
11245
+ 237,
11246
+ 240,
11247
+ 240,
11248
+ 242,
11249
+ 243,
11250
+ 247,
11251
+ 250,
11252
+ 252,
11253
+ 252,
11254
+ 254,
11255
+ 254,
11256
+ 257,
11257
+ 257,
11258
+ 273,
11259
+ 273,
11260
+ 275,
11261
+ 275,
11262
+ 283,
11263
+ 283,
11264
+ 294,
11265
+ 295,
11266
+ 299,
11267
+ 299,
11268
+ 305,
11269
+ 307,
11270
+ 312,
11271
+ 312,
11272
+ 319,
11273
+ 322,
11274
+ 324,
11275
+ 324,
11276
+ 328,
11277
+ 331,
11278
+ 333,
11279
+ 333,
11280
+ 338,
11281
+ 339,
11282
+ 358,
11283
+ 359,
11284
+ 363,
11285
+ 363,
11286
+ 462,
11287
+ 462,
11288
+ 464,
11289
+ 464,
11290
+ 466,
11291
+ 466,
11292
+ 468,
11293
+ 468,
11294
+ 470,
11295
+ 470,
11296
+ 472,
11297
+ 472,
11298
+ 474,
11299
+ 474,
11300
+ 476,
11301
+ 476,
11302
+ 593,
11303
+ 593,
11304
+ 609,
11305
+ 609,
11306
+ 708,
11307
+ 708,
11308
+ 711,
11309
+ 711,
11310
+ 713,
11311
+ 715,
11312
+ 717,
11313
+ 717,
11314
+ 720,
11315
+ 720,
11316
+ 728,
11317
+ 731,
11318
+ 733,
11319
+ 733,
11320
+ 735,
11321
+ 735,
11322
+ 768,
11323
+ 879,
11324
+ 913,
11325
+ 929,
11326
+ 931,
11327
+ 937,
11328
+ 945,
11329
+ 961,
11330
+ 963,
11331
+ 969,
11332
+ 1025,
11333
+ 1025,
11334
+ 1040,
11335
+ 1103,
11336
+ 1105,
11337
+ 1105,
11338
+ 8208,
11339
+ 8208,
11340
+ 8211,
11341
+ 8214,
11342
+ 8216,
11343
+ 8217,
11344
+ 8220,
11345
+ 8221,
11346
+ 8224,
11347
+ 8226,
11348
+ 8228,
11349
+ 8231,
11350
+ 8240,
11351
+ 8240,
11352
+ 8242,
11353
+ 8243,
11354
+ 8245,
11355
+ 8245,
11356
+ 8251,
11357
+ 8251,
11358
+ 8254,
11359
+ 8254,
11360
+ 8308,
11361
+ 8308,
11362
+ 8319,
11363
+ 8319,
11364
+ 8321,
11365
+ 8324,
11366
+ 8364,
11367
+ 8364,
11368
+ 8451,
11369
+ 8451,
11370
+ 8453,
11371
+ 8453,
11372
+ 8457,
11373
+ 8457,
11374
+ 8467,
11375
+ 8467,
11376
+ 8470,
11377
+ 8470,
11378
+ 8481,
11379
+ 8482,
11380
+ 8486,
11381
+ 8486,
11382
+ 8491,
11383
+ 8491,
11384
+ 8531,
11385
+ 8532,
11386
+ 8539,
11387
+ 8542,
11388
+ 8544,
11389
+ 8555,
11390
+ 8560,
11391
+ 8569,
11392
+ 8585,
11393
+ 8585,
11394
+ 8592,
11395
+ 8601,
11396
+ 8632,
11397
+ 8633,
11398
+ 8658,
11399
+ 8658,
11400
+ 8660,
11401
+ 8660,
11402
+ 8679,
11403
+ 8679,
11404
+ 8704,
11405
+ 8704,
11406
+ 8706,
11407
+ 8707,
11408
+ 8711,
11409
+ 8712,
11410
+ 8715,
11411
+ 8715,
11412
+ 8719,
11413
+ 8719,
11414
+ 8721,
11415
+ 8721,
11416
+ 8725,
11417
+ 8725,
11418
+ 8730,
11419
+ 8730,
11420
+ 8733,
11421
+ 8736,
11422
+ 8739,
11423
+ 8739,
11424
+ 8741,
11425
+ 8741,
11426
+ 8743,
11427
+ 8748,
11428
+ 8750,
11429
+ 8750,
11430
+ 8756,
11431
+ 8759,
11432
+ 8764,
11433
+ 8765,
11434
+ 8776,
11435
+ 8776,
11436
+ 8780,
11437
+ 8780,
11438
+ 8786,
11439
+ 8786,
11440
+ 8800,
11441
+ 8801,
11442
+ 8804,
11443
+ 8807,
11444
+ 8810,
11445
+ 8811,
11446
+ 8814,
11447
+ 8815,
11448
+ 8834,
11449
+ 8835,
11450
+ 8838,
11451
+ 8839,
11452
+ 8853,
11453
+ 8853,
11454
+ 8857,
11455
+ 8857,
11456
+ 8869,
11457
+ 8869,
11458
+ 8895,
11459
+ 8895,
11460
+ 8978,
11461
+ 8978,
11462
+ 9312,
11463
+ 9449,
11464
+ 9451,
11465
+ 9547,
11466
+ 9552,
11467
+ 9587,
11468
+ 9600,
11469
+ 9615,
11470
+ 9618,
11471
+ 9621,
11472
+ 9632,
11473
+ 9633,
11474
+ 9635,
11475
+ 9641,
11476
+ 9650,
11477
+ 9651,
11478
+ 9654,
11479
+ 9655,
11480
+ 9660,
11481
+ 9661,
11482
+ 9664,
11483
+ 9665,
11484
+ 9670,
11485
+ 9672,
11486
+ 9675,
11487
+ 9675,
11488
+ 9678,
11489
+ 9681,
11490
+ 9698,
11491
+ 9701,
11492
+ 9711,
11493
+ 9711,
11494
+ 9733,
11495
+ 9734,
11496
+ 9737,
11497
+ 9737,
11498
+ 9742,
11499
+ 9743,
11500
+ 9756,
11501
+ 9756,
11502
+ 9758,
11503
+ 9758,
11504
+ 9792,
11505
+ 9792,
11506
+ 9794,
11507
+ 9794,
11508
+ 9824,
11509
+ 9825,
11510
+ 9827,
11511
+ 9829,
11512
+ 9831,
11513
+ 9834,
11514
+ 9836,
11515
+ 9837,
11516
+ 9839,
11517
+ 9839,
11518
+ 9886,
11519
+ 9887,
11520
+ 9919,
11521
+ 9919,
11522
+ 9926,
11523
+ 9933,
11524
+ 9935,
11525
+ 9939,
11526
+ 9941,
11527
+ 9953,
11528
+ 9955,
11529
+ 9955,
11530
+ 9960,
11531
+ 9961,
11532
+ 9963,
11533
+ 9969,
11534
+ 9972,
11535
+ 9972,
11536
+ 9974,
11537
+ 9977,
11538
+ 9979,
11539
+ 9980,
11540
+ 9982,
11541
+ 9983,
11542
+ 10045,
11543
+ 10045,
11544
+ 10102,
11545
+ 10111,
11546
+ 11094,
11547
+ 11097,
11548
+ 12872,
11549
+ 12879,
11550
+ 57344,
11551
+ 63743,
11552
+ 65024,
11553
+ 65039,
11554
+ 65533,
11555
+ 65533,
11556
+ 127232,
11557
+ 127242,
11558
+ 127248,
11559
+ 127277,
11560
+ 127280,
11561
+ 127337,
11562
+ 127344,
11563
+ 127373,
11564
+ 127375,
11565
+ 127376,
11566
+ 127387,
11567
+ 127404,
11568
+ 917760,
11569
+ 917999,
11570
+ 983040,
11571
+ 1048573,
11572
+ 1048576,
11573
+ 1114109
11574
+ ];
11575
+ const fullwidthRanges = [
11576
+ 12288,
11577
+ 12288,
11578
+ 65281,
11579
+ 65376,
11580
+ 65504,
11581
+ 65510
11582
+ ];
11583
+ const wideRanges = [
11584
+ 4352,
11585
+ 4447,
11586
+ 8986,
11587
+ 8987,
11588
+ 9001,
11589
+ 9002,
11590
+ 9193,
11591
+ 9196,
11592
+ 9200,
11593
+ 9200,
11594
+ 9203,
11595
+ 9203,
11596
+ 9725,
11597
+ 9726,
11598
+ 9748,
11599
+ 9749,
11600
+ 9776,
11601
+ 9783,
11602
+ 9800,
11603
+ 9811,
11604
+ 9855,
11605
+ 9855,
11606
+ 9866,
11607
+ 9871,
11608
+ 9875,
11609
+ 9875,
11610
+ 9889,
11611
+ 9889,
11612
+ 9898,
11613
+ 9899,
11614
+ 9917,
11615
+ 9918,
11616
+ 9924,
11617
+ 9925,
11618
+ 9934,
11619
+ 9934,
11620
+ 9940,
11621
+ 9940,
11622
+ 9962,
11623
+ 9962,
11624
+ 9970,
11625
+ 9971,
11626
+ 9973,
11627
+ 9973,
11628
+ 9978,
11629
+ 9978,
11630
+ 9981,
11631
+ 9981,
11632
+ 9989,
11633
+ 9989,
11634
+ 9994,
11635
+ 9995,
11636
+ 10024,
11637
+ 10024,
11638
+ 10060,
11639
+ 10060,
11640
+ 10062,
11641
+ 10062,
11642
+ 10067,
11643
+ 10069,
11644
+ 10071,
11645
+ 10071,
11646
+ 10133,
11647
+ 10135,
11648
+ 10160,
11649
+ 10160,
11650
+ 10175,
11651
+ 10175,
11652
+ 11035,
11653
+ 11036,
11654
+ 11088,
11655
+ 11088,
11656
+ 11093,
11657
+ 11093,
11658
+ 11904,
11659
+ 11929,
11660
+ 11931,
11661
+ 12019,
11662
+ 12032,
11663
+ 12245,
11664
+ 12272,
11665
+ 12287,
11666
+ 12289,
11667
+ 12350,
11668
+ 12353,
11669
+ 12438,
11670
+ 12441,
11671
+ 12543,
11672
+ 12549,
11673
+ 12591,
11674
+ 12593,
11675
+ 12686,
11676
+ 12688,
11677
+ 12773,
11678
+ 12783,
11679
+ 12830,
11680
+ 12832,
11681
+ 12871,
11682
+ 12880,
11683
+ 42124,
11684
+ 42128,
11685
+ 42182,
11686
+ 43360,
11687
+ 43388,
11688
+ 44032,
11689
+ 55203,
11690
+ 63744,
11691
+ 64255,
11692
+ 65040,
11693
+ 65049,
11694
+ 65072,
11695
+ 65106,
11696
+ 65108,
11697
+ 65126,
11698
+ 65128,
11699
+ 65131,
11700
+ 94176,
11701
+ 94180,
11702
+ 94192,
11703
+ 94198,
11704
+ 94208,
11705
+ 101589,
11706
+ 101631,
11707
+ 101662,
11708
+ 101760,
11709
+ 101874,
11710
+ 110576,
11711
+ 110579,
11712
+ 110581,
11713
+ 110587,
11714
+ 110589,
11715
+ 110590,
11716
+ 110592,
11717
+ 110882,
11718
+ 110898,
11719
+ 110898,
11720
+ 110928,
11721
+ 110930,
11722
+ 110933,
11723
+ 110933,
11724
+ 110948,
11725
+ 110951,
11726
+ 110960,
11727
+ 111355,
11728
+ 119552,
11729
+ 119638,
11730
+ 119648,
11731
+ 119670,
11732
+ 126980,
11733
+ 126980,
11734
+ 127183,
11735
+ 127183,
11736
+ 127374,
11737
+ 127374,
11738
+ 127377,
11739
+ 127386,
11740
+ 127488,
11741
+ 127490,
11742
+ 127504,
11743
+ 127547,
11744
+ 127552,
11745
+ 127560,
11746
+ 127568,
11747
+ 127569,
11748
+ 127584,
11749
+ 127589,
11750
+ 127744,
11751
+ 127776,
11752
+ 127789,
11753
+ 127797,
11754
+ 127799,
11755
+ 127868,
11756
+ 127870,
11757
+ 127891,
11758
+ 127904,
11759
+ 127946,
11760
+ 127951,
11761
+ 127955,
11762
+ 127968,
11763
+ 127984,
11764
+ 127988,
11765
+ 127988,
11766
+ 127992,
11767
+ 128062,
11768
+ 128064,
11769
+ 128064,
11770
+ 128066,
11771
+ 128252,
11772
+ 128255,
11773
+ 128317,
11774
+ 128331,
11775
+ 128334,
11776
+ 128336,
11777
+ 128359,
11778
+ 128378,
11779
+ 128378,
11780
+ 128405,
11781
+ 128406,
11782
+ 128420,
11783
+ 128420,
11784
+ 128507,
11785
+ 128591,
11786
+ 128640,
11787
+ 128709,
11788
+ 128716,
11789
+ 128716,
11790
+ 128720,
11791
+ 128722,
11792
+ 128725,
11793
+ 128728,
11794
+ 128732,
11795
+ 128735,
11796
+ 128747,
11797
+ 128748,
11798
+ 128756,
11799
+ 128764,
11800
+ 128992,
11801
+ 129003,
11802
+ 129008,
11803
+ 129008,
11804
+ 129292,
11805
+ 129338,
11806
+ 129340,
11807
+ 129349,
11808
+ 129351,
11809
+ 129535,
11810
+ 129648,
11811
+ 129660,
11812
+ 129664,
11813
+ 129674,
11814
+ 129678,
11815
+ 129734,
11816
+ 129736,
11817
+ 129736,
11818
+ 129741,
11819
+ 129756,
11820
+ 129759,
11821
+ 129770,
11822
+ 129775,
11823
+ 129784,
11824
+ 131072,
11825
+ 196605,
11826
+ 196608,
11827
+ 262141
11828
+ ];
11829
+ //#endregion
11830
+ //#region ../../node_modules/.pnpm/get-east-asian-width@1.6.0/node_modules/get-east-asian-width/utilities.js
11831
+ /**
11832
+ Binary search on a sorted flat array of [start, end] pairs.
11833
+
11834
+ @param {number[]} ranges - Flat array of inclusive [start, end] range pairs, e.g. [0, 5, 10, 20].
11835
+ @param {number} codePoint - The value to search for.
11836
+ @returns {boolean} Whether the value falls within any of the ranges.
11837
+ */
11838
+ const isInRange = (ranges, codePoint) => {
11839
+ let low = 0;
11840
+ let high = Math.floor(ranges.length / 2) - 1;
11841
+ while (low <= high) {
11842
+ const mid = Math.floor((low + high) / 2);
11843
+ const i = mid * 2;
11844
+ if (codePoint < ranges[i]) high = mid - 1;
11845
+ else if (codePoint > ranges[i + 1]) low = mid + 1;
11846
+ else return true;
11847
+ }
11848
+ return false;
11849
+ };
11850
+ //#endregion
11851
+ //#region ../../node_modules/.pnpm/get-east-asian-width@1.6.0/node_modules/get-east-asian-width/lookup.js
11852
+ const commonCjkCodePoint = 19968;
11853
+ const [wideFastPathStart, wideFastPathEnd] = /* @__PURE__ */ findWideFastPathRange(wideRanges);
11854
+ function findWideFastPathRange(ranges) {
11855
+ let fastPathStart = ranges[0];
11856
+ let fastPathEnd = ranges[1];
11857
+ for (let index = 0; index < ranges.length; index += 2) {
11858
+ const start = ranges[index];
11859
+ const end = ranges[index + 1];
11860
+ if (commonCjkCodePoint >= start && commonCjkCodePoint <= end) return [start, end];
11861
+ if (end - start > fastPathEnd - fastPathStart) {
11862
+ fastPathStart = start;
11863
+ fastPathEnd = end;
11864
+ }
11865
+ }
11866
+ return [fastPathStart, fastPathEnd];
11867
+ }
11868
+ const isAmbiguous = (codePoint) => {
11869
+ if (codePoint < 161 || codePoint > 1114109) return false;
11870
+ return isInRange(ambiguousRanges, codePoint);
11871
+ };
11872
+ const isFullWidth = (codePoint) => {
11873
+ if (codePoint < 12288 || codePoint > 65510) return false;
11874
+ return isInRange(fullwidthRanges, codePoint);
11875
+ };
11876
+ const isWide = (codePoint) => {
11877
+ if (codePoint >= wideFastPathStart && codePoint <= wideFastPathEnd) return true;
11878
+ if (codePoint < 4352 || codePoint > 262141) return false;
11879
+ return isInRange(wideRanges, codePoint);
11880
+ };
11881
+ //#endregion
11882
+ //#region ../../node_modules/.pnpm/get-east-asian-width@1.6.0/node_modules/get-east-asian-width/index.js
11883
+ function validate(codePoint) {
11884
+ if (!Number.isSafeInteger(codePoint)) throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
11885
+ }
11886
+ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
11887
+ validate(codePoint);
11888
+ if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
11889
+ return 1;
11890
+ }
11215
11891
  //#endregion
11216
11892
  //#region src/cli/render/markdown.ts
11217
11893
  const ANSI = {
@@ -11226,7 +11902,15 @@ const ANSI = {
11226
11902
  cyan: "\x1B[36m"
11227
11903
  };
11228
11904
  const wrap = (code, text, on) => on ? `${code}${text}${ANSI.reset}` : text;
11229
- const visibleLen = (s) => s.replaceAll(/\x1B\[[\d;]*m/g, "").length;
11905
+ const visibleLen = (s) => {
11906
+ const text = s.replaceAll(/\x1B\[[\d;]*m/g, "");
11907
+ let width = 0;
11908
+ for (const ch of text) {
11909
+ const cp = ch.codePointAt(0);
11910
+ if (cp !== void 0) width += eastAsianWidth(cp);
11911
+ }
11912
+ return width;
11913
+ };
11230
11914
  const isColorEnabled = (stream) => {
11231
11915
  if (process.env.NO_COLOR && process.env.NO_COLOR !== "") return false;
11232
11916
  if (process.env.FORCE_COLOR && process.env.FORCE_COLOR !== "0") return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-space/cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Command line interface for mx-space (mx-core) — auth, content, configuration",
5
5
  "keywords": [
6
6
  "mx-space",
@@ -57,6 +57,7 @@
57
57
  "better-auth": "^1.6.9",
58
58
  "effect": "3.21.2",
59
59
  "fast-xml-parser": "4.5.6",
60
+ "get-east-asian-width": "^1.6.0",
60
61
  "lexical": "^0.44.0",
61
62
  "open": "^11.0.0",
62
63
  "semver": "7.8.0",