@mx-space/cli 0.4.1 → 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.
@@ -1,4 +1,4 @@
1
- import { $ as transduce, $a as constUndefined, $i as matchRight, $n as timeout, $r as of$3, $t as contextWithEffect, A as TaggedError, Aa as left, Ai as appendAll, An as onError, Ar as taggedEnum, At as unsafeMake, B as isConfig, Ba as toStringUnknown, Bi as flatMap$4, Bn as runPromise, Br as ParentSpan, Bt as annotateLogs, C as Literal, Ca as match, Ci as getOption, Cn as mapBoth, Cr as make$25, Ct as provideMerge, Da as boolean$3, Di as isMissingDataOnly, Dn as matchCauseEffect, Dr as Error$1, Dt as currentLoggers, Ea as some, Ei as isConfigError, En as match$2, Et as currentContext, F as decodeUnknown, Fa as Class, Fi as filter$2, Fn as provide$1, Fr as isInterrupted, Ft as _void, G as fromChannel, Ga as hash, Gi as isArray$1, Gn as serviceFunctions, Gr as updateAndGet, Gt as catchAll, H as bufferChunks, Ha as symbol$1, Hi as getSomes, Hn as runtime, Hr as make$22, Ht as asVoid, I as int, Ia as NodeInspectSymbol, Ii as filterMap, In as provideService, Ir as isInterruptedOnly, It as acquireRelease, J as mapError$1, Ji as join$1, Jn as suspend, Jr as updateAs, Jt as catchIf, Ka as string, Ki as isEmptyReadonlyArray, Kn as serviceOption, Kr as allLevels, Kt as catchAllCause, L as optional$7, La as format$3, Li as findFirst, Ln as repeatN, Lr as fail$5, Lt as acquireUseRelease$1, M as Unknown, Ma as right, Mi as drop, Mn as orDie, Mr as log, Mt as decodeSync, N as compose, Na as pipeArguments, Ni as empty$11, Nn as orElse$3, Nr as Scope, Nt as encodeSync, O as String$, Oa as mapInput, Oi as allocate, On as matchEffect, Or as TaggedError$1, Ot as currentTracerEnabled, Pa as BaseProto, Pi as every, Pn as orElseFail, Pr as addFinalizer$1, Pt as is$2, Q as suspend$1, Qa as constFalse, Qi as matchLeft, Qn as tapErrorCause, Qr as isNil, Qt as context, Ra as redact$1, Ri as findFirstIndex, Rn as retry, Rr as isFailure, Rt as addFinalizer, S as Int, Sa as map$8, Si as get$11, Sn as map$6, Sr as isDone, St as provide, T as NumberFromString, Ta as orElse$2, Ti as omit, Tn as mapInputContext, Tr as unsafeDone, Tt as succeed$3, U as ensuring$1, Ua as cached, Ui as head$2, Un as scope, Ur as set$3, Ut as async, V as asyncScoped, Va as equals, Vi as fromIterable$1, Vn as runSync, Vr as get$8, Vt as as, Wa as combine$2, Wi as headNonEmpty, Wn as scoped, Wr as update$6, Wt as cached$1, X as runCollect, Xa as isTagged, Xi as map$7, Xn as tap, Xr as round, Xt as catchTag, Y as run$5, Ya as isObject, Yi as make$21, Yn as sync, Yr as CommitPrototype, Yt as catchSome, Z as splitLines, Za as globalValue, Zi as match$1, Zn as tapError, Zr as cons$1, Zt as catchTags, _ as fromString, _a as getOrThrow, _i as toArray, _n as interruptible, _r as _await, _t as updateContext, a as make$26, aa as sort$2, ai as make$23, an as failCause, ao as __exportAll, ar as unlessEffect, at as fromChannel$1, b as Date$, ba as isOption, bi as Reference, bn as logError, br as failCause$1, bt as effect, c as make$24, ca as tailNonEmpty, ci as add$1, cn as filterOrDieMessage, cr as useSpan, ct as embedInput, d as defaultLogger, di as remove$3, dn as fnUntraced, dr as withParentSpan, dt as fromEffect, ea as of$2, ei as empty$12, en as die, eo as constVoid, er as tryMap, et as unwrap$5, f as prettyLoggerDefault, fa as map$9, fi as seconds, fn as forEach$1, fr as zip, ft as suspend$2, g as when, ga as getOrElse, gi as reduce$2, gn as ignore, gr as DeferredTypeId, gt as runFork, h as value$1, ha as fromNullable, hi as of$1, hn as gen, hr as zipWith, ht as spaced, i as isMailbox, ia as some$1, ii as isEmpty$5, in as fail$2, io as __commonJSMin, ir as uninterruptibleMask, it as forEach, j as Union, ja as merge$1, ji as contains, jn as onInterrupt, jr as error$1, jt as nominal, k as Struct, ka as string$1, ki as append$2, kn as negate, kr as tagged, kt as get$13, l as updateEffect, la as take, li as fromIterable$3, ln as flatMap$1, lr as when$1, lt as ensuring$2, m as orElse$1, ma as flatMap$3, mi as map$10, mn as forkScoped, mr as zipRight, mt as write, n as make$27, na as reduce$1, ni as get$9, nn as either, no as identity, nr as try_, nt as drain, o as toChannel, oa as span, oi as set$2, on as failSync, oo as __require, or as unsafeMakeLatch, ot as unwrapScoped$1, p as withMinimumLogLevel, pa as filter$3, pi as appendAll$1, pn as forkDaemon, pr as zipLeft, pt as void_, q as mapChunks, qa as symbol, qi as isNonEmptyReadonlyArray, qn as succeed$1, qr as getOrDefault, qt as catchAllDefect, r as unsafeAdd, ra as reduceRight, ri as has, rn as ensuring, ro as pipe, rr as uninterruptible, rt as foldLeftChunks, s as get$10, sa as splitAt, si as make$28, sn as filter$1, so as __toESM, sr as unsafeMakeSemaphore, st as acquireUseRelease, t as join$2, ta as prepend$1, ti as fromIterable$2, tn as dieMessage, to as dual, tr as tryPromise, tt as unwrapScoped, u as unify, ua as unsafeGet, ui as has$1, un as flatten$3, ur as withFiberRuntime, ut as flatMap$2, v as Array$, va as getOrUndefined, vi as unsafeFromArray, vn as isEffect, vr as complete, vt as get$12, w as Number$, wa as none$3, wi as merge$2, wn as mapError, wr as succeed$2, wt as scoped$1, x as Defect, xa as isSome, xi as Tag$2, xn as logWarning, xr as interrupt, xt as mergeAll, y as Cause, ya as isNone, yi as GenericTag, yn as locally, yr as fail$4, yt as make$29, z as make$20, za as symbolRedactable, zi as findLast, zn as runFork$1, zr as void_$1, zt as all$3 } from "./esm-DO9hVR8S.mjs";
1
+ import { $ as transduce, $a as constUndefined, $i as matchRight, $n as timeout, $r as of$3, $t as contextWithEffect, A as TaggedError, Aa as left, Ai as appendAll, An as onError, Ar as taggedEnum, At as unsafeMake, B as isConfig, Ba as toStringUnknown, Bi as flatMap$4, Bn as runPromise, Br as ParentSpan, Bt as annotateLogs, C as Literal, Ca as match, Ci as getOption, Cn as mapBoth, Cr as make$25, Ct as provideMerge, Da as boolean$3, Di as isMissingDataOnly, Dn as matchCauseEffect, Dr as Error$1, Dt as currentLoggers, Ea as some, Ei as isConfigError, En as match$2, Et as currentContext, F as decodeUnknown, Fa as Class, Fi as filter$2, Fn as provide$1, Fr as isInterrupted, Ft as _void, G as fromChannel, Ga as hash, Gi as isArray$1, Gn as serviceFunctions, Gr as updateAndGet, Gt as catchAll, H as bufferChunks, Ha as symbol$1, Hi as getSomes, Hn as runtime, Hr as make$22, Ht as asVoid, I as int, Ia as NodeInspectSymbol, Ii as filterMap, In as provideService, Ir as isInterruptedOnly, It as acquireRelease, J as mapError$1, Ji as join$1, Jn as suspend, Jr as updateAs, Jt as catchIf, Ka as string, Ki as isEmptyReadonlyArray, Kn as serviceOption, Kr as allLevels, Kt as catchAllCause, L as optional$7, La as format$3, Li as findFirst, Ln as repeatN, Lr as fail$5, Lt as acquireUseRelease$1, M as Unknown, Ma as right, Mi as drop, Mn as orDie, Mr as log, Mt as decodeSync, N as compose, Na as pipeArguments, Ni as empty$11, Nn as orElse$3, Nr as Scope, Nt as encodeSync, O as String$, Oa as mapInput, Oi as allocate, On as matchEffect, Or as TaggedError$1, Ot as currentTracerEnabled, Pa as BaseProto, Pi as every, Pn as orElseFail, Pr as addFinalizer$1, Pt as is$2, Q as suspend$1, Qa as constFalse, Qi as matchLeft, Qn as tapErrorCause, Qr as isNil, Qt as context, Ra as redact$1, Ri as findFirstIndex, Rn as retry, Rr as isFailure, Rt as addFinalizer, S as Int, Sa as map$8, Si as get$12, Sn as map$6, Sr as isDone, St as provide, T as NumberFromString, Ta as orElse$2, Ti as omit, Tn as mapInputContext, Tr as unsafeDone, Tt as succeed$3, U as ensuring$1, Ua as cached, Ui as head$2, Un as scope, Ur as set$3, Ut as async, V as asyncScoped, Va as equals, Vi as fromIterable$1, Vn as runSync, Vr as get$9, Vt as as, Wa as combine$2, Wi as headNonEmpty, Wn as scoped, Wr as update$6, Wt as cached$1, X as runCollect, Xa as isTagged, Xi as map$7, Xn as tap, Xr as round, Xt as catchTag, Y as run$5, Ya as isObject, Yi as make$21, Yn as sync, Yr as CommitPrototype, Yt as catchSome, Z as splitLines, Za as globalValue, Zi as match$1, Zn as tapError, Zr as cons$1, Zt as catchTags, _ as fromString, _a as getOrThrow, _i as toArray, _n as interruptible, _r as _await, _t as updateContext, a as make$26, aa as sort$2, ai as make$23, an as failCause, ao as __exportAll, ar as unlessEffect, at as fromChannel$1, b as Date$, ba as isOption, bi as Reference, bn as logError, br as failCause$1, bt as effect, c as make$24, ca as tailNonEmpty, ci as add$1, cn as filterOrDieMessage, cr as useSpan, ct as embedInput, d as defaultLogger, di as remove$3, dn as fnUntraced, dr as withParentSpan, dt as fromEffect, ea as of$2, ei as empty$12, en as die, eo as constVoid, er as tryMap, et as unwrap$5, f as prettyLoggerDefault, fa as map$9, fi as seconds, fn as forEach$1, fr as zip, ft as suspend$2, g as when, ga as getOrElse, gi as reduce$2, gn as ignore, gr as DeferredTypeId, gt as runFork, h as value$1, ha as fromNullable, hi as of$1, hn as gen, hr as zipWith, ht as spaced, i as isMailbox, ia as some$1, ii as isEmpty$5, in as fail$2, io as __commonJSMin, ir as uninterruptibleMask, it as forEach, j as Union, ja as merge$1, ji as contains, jn as onInterrupt, jr as error$1, jt as nominal, k as Struct, ka as string$1, ki as append$2, kn as negate, kr as tagged, kt as get$14, l as updateEffect, la as take, li as fromIterable$3, ln as flatMap$1, lr as when$1, lt as ensuring$2, m as orElse$1, ma as flatMap$3, mi as map$10, mn as forkScoped, mr as zipRight, mt as write, n as make$27, na as reduce$1, ni as get$10, nn as either, no as identity, nr as try_, nt as drain, o as toChannel, oa as span, oi as set$2, on as failSync, oo as __require, or as unsafeMakeLatch, ot as unwrapScoped$1, p as withMinimumLogLevel, pa as filter$3, pi as appendAll$1, pn as forkDaemon, pr as zipLeft, pt as void_, q as mapChunks, qa as symbol, qi as isNonEmptyReadonlyArray, qn as succeed$1, qr as getOrDefault, qt as catchAllDefect, r as unsafeAdd, ra as reduceRight, ri as has, rn as ensuring, ro as pipe, rr as uninterruptible, rt as foldLeftChunks, s as get$11, sa as splitAt, si as make$28, sn as filter$1, so as __toESM, sr as unsafeMakeSemaphore, st as acquireUseRelease, t as join$2, ta as prepend$1, ti as fromIterable$2, tn as dieMessage, to as dual, tr as tryPromise, tt as unwrapScoped, u as unify, ua as unsafeGet, ui as has$1, un as flatten$3, ur as withFiberRuntime, ut as flatMap$2, v as Array$, va as getOrUndefined, vi as unsafeFromArray, vn as isEffect, vr as complete, vt as get$13, w as Number$, wa as none$3, wi as merge$2, wn as mapError, wr as succeed$2, wt as scoped$1, x as Defect, xa as isSome, xi as Tag$2, xn as logWarning, xr as interrupt, xt as mergeAll, y as Cause, ya as isNone, yi as GenericTag, yn as locally, yr as fail$4, yt as make$29, z as make$20, za as symbolRedactable, zi as findLast, zn as runFork$1, zr as void_$1, zt as all$4 } from "./esm-DO9hVR8S.mjs";
2
2
  import { _ as LinkNode, a as HeadingNode, b as CodeHighlightNode, d as ListItemNode, f as ListNode, g as AutoLinkNode, o as QuoteNode, x as CodeNode } from "./LexicalRichText.node-DDpwfE-P.mjs";
3
3
  import { t as HorizontalRuleNode } from "./LexicalExtension.node-CF3EAPN7.mjs";
4
4
  import { Ht as ElementNode, Vt as DecoratorNode } from "./Lexical.node-BUsI9gWr.mjs";
@@ -2177,16 +2177,16 @@ const spans = (spans) => {
2177
2177
  return empty$7;
2178
2178
  };
2179
2179
  /** @internal */
2180
- const isEmpty$3 = (self) => size$2(self) === 0;
2180
+ const isEmpty$3 = (self) => size$4(self) === 0;
2181
2181
  /** @internal */
2182
- const size$2 = (self) => {
2182
+ const size$4 = (self) => {
2183
2183
  switch (self._tag) {
2184
2184
  case "Text":
2185
2185
  case "URI": return self.value.length;
2186
2186
  case "Highlight":
2187
2187
  case "Strong":
2188
- case "Weak": return size$2(self.value);
2189
- case "Sequence": return size$2(self.left) + size$2(self.right);
2188
+ case "Weak": return size$4(self.value);
2189
+ case "Sequence": return size$4(self.left) + size$4(self.right);
2190
2190
  }
2191
2191
  };
2192
2192
  /** @internal */
@@ -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) => {
@@ -4115,7 +4115,7 @@ const optional$6 = (self) => ({
4115
4115
  usage: self
4116
4116
  });
4117
4117
  /** @internal */
4118
- const repeated = (self) => ({
4118
+ const repeated$2 = (self) => ({
4119
4119
  _tag: "Repeated",
4120
4120
  usage: self
4121
4121
  });
@@ -4156,7 +4156,7 @@ const simplify = (self, config) => {
4156
4156
  }
4157
4157
  case "Repeated": {
4158
4158
  const usage = simplify(self.usage, config);
4159
- return usage._tag === "Empty" ? empty$5 : repeated(usage);
4159
+ return usage._tag === "Empty" ? empty$5 : repeated$2(usage);
4160
4160
  }
4161
4161
  case "Alternation": {
4162
4162
  const leftUsage = simplify(self.left, config);
@@ -4305,7 +4305,7 @@ const isArgs = (u) => typeof u === "object" && u != null && ArgsTypeId in u;
4305
4305
  /** @internal */
4306
4306
  const isEmpty$1 = (self) => self._tag === "Empty";
4307
4307
  /** @internal */
4308
- const all$2 = function() {
4308
+ const all$3 = function() {
4309
4309
  if (arguments.length === 1) if (isArgs(arguments[0])) return map$2(arguments[0], (x) => [x]);
4310
4310
  else if (isArray$1(arguments[0])) return allTupled$1(arguments[0]);
4311
4311
  else {
@@ -4340,7 +4340,9 @@ const mapEffect$1 = /* @__PURE__ */ dual(2, (self, f) => makeMap$1(self, f));
4340
4340
  /** @internal */
4341
4341
  const optional$5 = (self) => makeWithDefault$1(map$2(self, some), none$3());
4342
4342
  /** @internal */
4343
- const validate = /* @__PURE__ */ dual(3, (self, args, config) => validateInternal(self, args, config));
4343
+ const repeated$1 = (self) => makeVariadic$1(self, none$3(), none$3());
4344
+ /** @internal */
4345
+ const validate$1 = /* @__PURE__ */ dual(3, (self, args, config) => validateInternal(self, args, config));
4344
4346
  /** @internal */
4345
4347
  const wizard$2 = /* @__PURE__ */ dual(2, (self, config) => wizardInternal$2(self, config));
4346
4348
  const allTupled$1 = (arg) => {
@@ -4411,7 +4413,7 @@ const getUsageInternal$2 = (self) => {
4411
4413
  case "Single": return named(of$2(self.name), getChoices(self.primitiveType));
4412
4414
  case "Map": return getUsageInternal$2(self.args);
4413
4415
  case "Both": return concat(getUsageInternal$2(self.left), getUsageInternal$2(self.right));
4414
- case "Variadic": return repeated(getUsageInternal$2(self.args));
4416
+ case "Variadic": return repeated$2(getUsageInternal$2(self.args));
4415
4417
  case "WithDefault":
4416
4418
  case "WithFallbackConfig": return optional$6(getUsageInternal$2(self.args));
4417
4419
  }
@@ -4446,6 +4448,14 @@ const makeWithDefault$1 = (self, fallback) => {
4446
4448
  op.fallback = fallback;
4447
4449
  return op;
4448
4450
  };
4451
+ const makeVariadic$1 = (args, min, max) => {
4452
+ const op = Object.create(proto$3);
4453
+ op._tag = "Variadic";
4454
+ op.args = args;
4455
+ op.min = min;
4456
+ op.max = max;
4457
+ return op;
4458
+ };
4449
4459
  const validateInternal = (self, args, config) => {
4450
4460
  switch (self._tag) {
4451
4461
  case "Empty": return succeed$1([args, void 0]);
@@ -4458,7 +4468,7 @@ const validateInternal = (self, args, config) => {
4458
4468
  if (isSome(choices)) return fail$2(missingValue(p$2(`Missing argument ${getTypeName(self.primitiveType)} with choices ${choices.value}`)));
4459
4469
  return fail$2(missingValue(p$2(`Missing argument ${getTypeName(self.primitiveType)}`)));
4460
4470
  },
4461
- 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({
4462
4472
  onFailure: (text) => invalidArgument(p$2(text)),
4463
4473
  onSuccess: (a) => [tail, a]
4464
4474
  }))
@@ -4506,7 +4516,7 @@ const wizardInternal$2 = (self, config) => {
4506
4516
  message: toAnsiText(pipe(getHelpInternal$2(self), sequence(repeatHelp))).trimEnd(),
4507
4517
  min: getMinSizeInternal$1(self),
4508
4518
  max: getMaxSizeInternal$1(self)
4509
- }).pipe(zipLeft(log()), flatMap$1((n) => n <= 0 ? succeed$1(empty$11()) : make$22(empty$11()).pipe(flatMap$1((ref) => wizardInternal$2(self.args, config).pipe(flatMap$1((args) => update$6(ref, appendAll(args))), repeatN(n - 1), zipRight(get$8(ref)), tap((args) => validateInternal(self, args, config)))))));
4519
+ }).pipe(zipLeft(log()), flatMap$1((n) => n <= 0 ? succeed$1(empty$11()) : make$22(empty$11()).pipe(flatMap$1((ref) => wizardInternal$2(self.args, config).pipe(flatMap$1((args) => update$6(ref, appendAll(args))), repeatN(n - 1), zipRight(get$9(ref)), tap((args) => validateInternal(self, args, config)))))));
4510
4520
  }
4511
4521
  case "WithDefault": {
4512
4522
  const defaultHelp = p$2(`This argument is optional - use the default?`);
@@ -4597,6 +4607,11 @@ const getZshCompletions$2 = (self, state = {
4597
4607
  */
4598
4608
  const optional$4 = optional$5;
4599
4609
  /**
4610
+ * @since 1.0.0
4611
+ * @category combinators
4612
+ */
4613
+ const repeated = repeated$1;
4614
+ /**
4600
4615
  * Creates a text argument.
4601
4616
  *
4602
4617
  * Can optionally provide a custom argument name (defaults to `"text"`).
@@ -4631,7 +4646,7 @@ const levensteinDistance = (first, second, config) => {
4631
4646
  //#endregion
4632
4647
  //#region ../../node_modules/.pnpm/@effect+cli@0.75.1_@effect+platform@0.96.1_effect@3.21.2__@effect+printer-ansi@0.49.0_@_d2b48786a958a46d59c00d71830aad4d/node_modules/@effect/cli/dist/esm/internal/prompt/list.js
4633
4648
  /** @internal */
4634
- const list$6 = (options) => text$6(options).pipe(map$3((output) => output.split(options.delimiter || ",")));
4649
+ const list$7 = (options) => text$6(options).pipe(map$3((output) => output.split(options.delimiter || ",")));
4635
4650
  /** @internal */
4636
4651
  const OptionsTypeId = /* @__PURE__ */ Symbol.for("@effect/cli/Options");
4637
4652
  const proto$2 = {
@@ -4647,7 +4662,7 @@ const isEmpty = (self) => self._tag === "Empty";
4647
4662
  /** @internal */
4648
4663
  const isSingle = (self) => self._tag === "Single";
4649
4664
  /** @internal */
4650
- const all$1 = function() {
4665
+ const all$2 = function() {
4651
4666
  if (arguments.length === 1) if (isOptions(arguments[0])) return map$1(arguments[0], (x) => [x]);
4652
4667
  else if (isArray$1(arguments[0])) return allTupled(arguments[0]);
4653
4668
  else {
@@ -4843,7 +4858,7 @@ const getUsageInternal$1 = (self) => {
4843
4858
  case "Map": return getUsageInternal$1(self.options);
4844
4859
  case "Both": return concat(getUsageInternal$1(self.left), getUsageInternal$1(self.right));
4845
4860
  case "OrElse": return alternation(getUsageInternal$1(self.left), getUsageInternal$1(self.right));
4846
- case "Variadic": return repeated(getUsageInternal$1(self.argumentOption));
4861
+ case "Variadic": return repeated$2(getUsageInternal$1(self.argumentOption));
4847
4862
  case "WithDefault":
4848
4863
  case "WithFallback": return optional$6(getUsageInternal$1(self.options));
4849
4864
  }
@@ -4969,14 +4984,14 @@ const parseInternal$1 = (self, args, config) => {
4969
4984
  switch (self._tag) {
4970
4985
  case "Empty": return _void;
4971
4986
  case "Single": {
4972
- const singleNames = filterMap(getNames$1(self), (name) => get$9(args, name));
4987
+ const singleNames = filterMap(getNames$1(self), (name) => get$10(args, name));
4973
4988
  if (isNonEmptyReadonlyArray(singleNames)) {
4974
4989
  const head = headNonEmpty(singleNames);
4975
4990
  if (isEmptyReadonlyArray(tailNonEmpty(singleNames))) {
4976
- 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))));
4977
4992
  if (isNonEmptyReadonlyArray(head) && isEmptyReadonlyArray(tailNonEmpty(head))) {
4978
4993
  const value = headNonEmpty(head);
4979
- 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))));
4980
4995
  }
4981
4996
  return fail$2(multipleValuesDetected(empty$6, head));
4982
4997
  }
@@ -5017,12 +5032,12 @@ const parseInternal$1 = (self, args, config) => {
5017
5032
  case "Variadic": {
5018
5033
  const min = getOrElse(self.min, () => 0);
5019
5034
  const max = getOrElse(self.max, () => Number.MAX_SAFE_INTEGER);
5020
- const matchedArgument = filterMap(getNames$1(self), (name) => get$9(args, name));
5035
+ const matchedArgument = filterMap(getNames$1(self), (name) => get$10(args, name));
5021
5036
  const validateMinMax = (values) => {
5022
5037
  if (values.length < min) return fail$2(invalidValue(p$2(`Expected at least ${min} value(s) for option: '${self.argumentOption.fullName}'`)));
5023
5038
  if (values.length > max) return fail$2(invalidValue(p$2(`Expected at most ${max} value(s) for option: '${self.argumentOption.fullName}'`)));
5024
5039
  const primitive = self.argumentOption.primitiveType;
5025
- 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))));
5026
5041
  return forEach$1(values, (value) => validatePrimitive(value));
5027
5042
  };
5028
5043
  if (every(matchedArgument, isEmptyReadonlyArray)) return validateMinMax(empty$11());
@@ -5049,7 +5064,7 @@ const wizardInternal$1 = (self, config) => {
5049
5064
  return parseCommandLine(self, args, config).pipe(as(args));
5050
5065
  }), zipLeft(log()));
5051
5066
  }
5052
- case "KeyValueMap": return list$6({
5067
+ case "KeyValueMap": return list$7({
5053
5068
  message: toAnsiText(p$2("Enter `key=value` pairs separated by spaces")).trim(),
5054
5069
  delimiter: " "
5055
5070
  }).pipe(flatMap$1((args) => {
@@ -5077,7 +5092,7 @@ const wizardInternal$1 = (self, config) => {
5077
5092
  message: toAnsiText(pipe(getHelpInternal$1(self), sequence(repeatHelp))).trimEnd(),
5078
5093
  min: getMinSizeInternal(self),
5079
5094
  max: getMaxSizeInternal(self)
5080
- }).pipe(flatMap$1((n) => n <= 0 ? succeed$1(empty$11()) : make$22(empty$11()).pipe(flatMap$1((ref) => wizardInternal$1(self.argumentOption, config).pipe(flatMap$1((args) => update$6(ref, appendAll(args))), repeatN(n - 1), zipRight(get$8(ref)))))));
5095
+ }).pipe(flatMap$1((n) => n <= 0 ? succeed$1(empty$11()) : make$22(empty$11()).pipe(flatMap$1((ref) => wizardInternal$1(self.argumentOption, config).pipe(flatMap$1((args) => update$6(ref, appendAll(args))), repeatN(n - 1), zipRight(get$9(ref)))))));
5081
5096
  }
5082
5097
  case "WithDefault": {
5083
5098
  if (isBoolInternal(self.options)) return wizardInternal$1(self.options, config);
@@ -5485,7 +5500,7 @@ const merge = (map1, map2) => {
5485
5500
  if (isNonEmptyReadonlyArray(map2)) {
5486
5501
  const head = headNonEmpty(map2);
5487
5502
  const tail = tailNonEmpty(map2);
5488
- return merge(match(get$9(map1, head[0]), {
5503
+ return merge(match(get$10(map1, head[0]), {
5489
5504
  onNone: () => set$2(map1, head[0], head[1]),
5490
5505
  onSome: (elems) => set$2(map1, head[0], appendAll(elems, head[1]))
5491
5506
  }), tail);
@@ -5625,7 +5640,7 @@ const helpOptions = /* @__PURE__ */ boolean$1("help").pipe(/* @__PURE__ */ withA
5625
5640
  /** @internal */
5626
5641
  const versionOptions = /* @__PURE__ */ boolean$1("version").pipe(/* @__PURE__ */ withDescription$4("Show the version of the application."));
5627
5642
  /** @internal */
5628
- const builtIns = /* @__PURE__ */ all$1({
5643
+ const builtIns = /* @__PURE__ */ all$2({
5629
5644
  completions: completionsOptions,
5630
5645
  logLevel: logLevelOptions,
5631
5646
  help: helpOptions,
@@ -5654,7 +5669,7 @@ const p$1 = p$2;
5654
5669
  * @since 1.0.0
5655
5670
  * @category constructors
5656
5671
  */
5657
- const all = all$1;
5672
+ const all$1 = all$2;
5658
5673
  /**
5659
5674
  * @since 1.0.0
5660
5675
  * @category constructors
@@ -5782,7 +5797,7 @@ const getHelpInternal = (self, config) => {
5782
5797
  const header = isEmpty$2(self.description) ? empty$6 : sequence(h1("DESCRIPTION"), self.description);
5783
5798
  const argsHelp = getHelp$2(self.args);
5784
5799
  const argsSection = isEmpty$2(argsHelp) ? empty$6 : sequence(h1("ARGUMENTS"), argsHelp);
5785
- const optionsHelp = getHelp$1(config.showBuiltIns ? all([self.options, builtIns]) : self.options);
5800
+ const optionsHelp = getHelp$1(config.showBuiltIns ? all$1([self.options, builtIns]) : self.options);
5786
5801
  return sequence(header, sequence(argsSection, isEmpty$2(optionsHelp) ? empty$6 : sequence(h1("OPTIONS"), optionsHelp)));
5787
5802
  }
5788
5803
  case "GetUserInput": return isEmpty$2(self.description) ? empty$6 : sequence(h1("DESCRIPTION"), self.description);
@@ -5809,10 +5824,10 @@ const getHelpInternal = (self, config) => {
5809
5824
  }
5810
5825
  };
5811
5826
  const printSubcommands = (subcommands) => {
5812
- const maxUsageLength = reduceRight(subcommands, 0, (max, [usage]) => Math.max(size$2(usage), max));
5827
+ const maxUsageLength = reduceRight(subcommands, 0, (max, [usage]) => Math.max(size$4(usage), max));
5813
5828
  const documents = map$7(subcommands, ([usage, desc]) => p$2(spans([
5814
5829
  usage,
5815
- text$7(" ".repeat(maxUsageLength - size$2(usage) + 2)),
5830
+ text$7(" ".repeat(maxUsageLength - size$4(usage) + 2)),
5816
5831
  desc
5817
5832
  ])));
5818
5833
  if (isNonEmptyReadonlyArray(documents)) return enumeration(documents);
@@ -5880,7 +5895,7 @@ const parseInternal = (self, args, config) => {
5880
5895
  });
5881
5896
  const parseUserDefinedArgs = (args) => parseCommandLine(self, args).pipe(flatMap$1((commandOptionsAndArgs) => {
5882
5897
  const [optionsAndArgs, forcedCommandArgs] = splitForcedArgs(commandOptionsAndArgs);
5883
- 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, {
5884
5899
  onNone: () => fail$2(e),
5885
5900
  onSome: (err) => fail$2(err)
5886
5901
  })), map$6(([argsLeftover, argsType]) => userDefined(argsLeftover, {
@@ -6027,7 +6042,7 @@ const wizardInternal = (self, prefix, config) => {
6027
6042
  switch (self._tag) {
6028
6043
  case "GetUserInput":
6029
6044
  case "Standard": return gen(function* () {
6030
- const logCurrentCommand = get$8(commandLineRef).pipe(flatMap$1((commandLine) => {
6045
+ const logCurrentCommand = get$9(commandLineRef).pipe(flatMap$1((commandLine) => {
6031
6046
  return log(toAnsiText(p$2(pipe(strong(highlight("COMMAND:", cyan)), concat$1(space), concat$1(highlight(join$1(commandLine, " "), magenta))))));
6032
6047
  }));
6033
6048
  if (isStandard(self)) {
@@ -6044,7 +6059,7 @@ const wizardInternal = (self, prefix, config) => {
6044
6059
  yield* logCurrentCommand;
6045
6060
  }
6046
6061
  }
6047
- return yield* get$8(commandLineRef);
6062
+ return yield* get$9(commandLineRef);
6048
6063
  });
6049
6064
  case "Map": return loop(self.command, commandLineRef);
6050
6065
  case "Subcommands": {
@@ -6061,7 +6076,7 @@ const wizardInternal = (self, prefix, config) => {
6061
6076
  }
6062
6077
  }
6063
6078
  };
6064
- return make$22(prefix).pipe(flatMap$1((commandLineRef) => loop(self, commandLineRef).pipe(zipRight(get$8(commandLineRef)))));
6079
+ return make$22(prefix).pipe(flatMap$1((commandLineRef) => loop(self, commandLineRef).pipe(zipRight(get$9(commandLineRef)))));
6065
6080
  };
6066
6081
  const getShortDescription = (self) => {
6067
6082
  switch (self._tag) {
@@ -6105,14 +6120,14 @@ const traverseCommand = (self, initialState, f) => make$24(initialState).pipe(fl
6105
6120
  }
6106
6121
  }
6107
6122
  };
6108
- return suspend(() => loop(self, empty$11(), empty$11(), 0)).pipe(zipRight(get$10(ref)));
6123
+ return suspend(() => loop(self, empty$11(), empty$11(), 0)).pipe(zipRight(get$11(ref)));
6109
6124
  }));
6110
6125
  const indentAll = /* @__PURE__ */ dual(2, (self, indent) => {
6111
6126
  const indentation = allocate(indent + 1).join(" ");
6112
6127
  return map$7(self, (line) => `${indentation}${line}`);
6113
6128
  });
6114
6129
  const getBashCompletionsInternal = (self, executable) => traverseCommand(self, empty$11(), (state, info) => {
6115
- const optionNames = getNames$1(isStandard(info.command) ? all([info.command.options, builtIns]) : builtIns);
6130
+ const optionNames = getNames$1(isStandard(info.command) ? all$1([info.command.options, builtIns]) : builtIns);
6116
6131
  const optionCases = isStandard(info.command) ? getBashCompletions$1(info.command.options) : empty$11();
6117
6132
  const wordList = appendAll(optionNames, pipe(info.subcommands, map$7(([name]) => name), sort$2(string$1)));
6118
6133
  const preformatted = isEmptyReadonlyArray(info.parentCommands) ? of$2(info.command.name) : pipe(info.parentCommands, append$2(info.command.name), map$7((command) => command.replace("-", "__")));
@@ -6171,7 +6186,7 @@ const getBashCompletionsInternal = (self, executable) => traverseCommand(self, e
6171
6186
  }));
6172
6187
  const getFishCompletionsInternal = (self, executable) => traverseCommand(self, empty$11(), (state, info) => {
6173
6188
  const baseTemplate = make$21("complete", "-c", executable);
6174
- const optionsCompletions = getFishCompletions$1(isStandard(info.command) ? all$1([builtIns, info.command.options]) : builtIns);
6189
+ const optionsCompletions = getFishCompletions$1(isStandard(info.command) ? all$2([builtIns, info.command.options]) : builtIns);
6175
6190
  const argsCompletions = isStandard(info.command) ? getFishCompletions$2(info.command.args) : empty$11();
6176
6191
  const rootCompletions = (conditionals) => pipe(map$7(optionsCompletions, (option) => pipe(baseTemplate, appendAll(conditionals), append$2(option), join$1(" "))), appendAll(map$7(argsCompletions, (option) => pipe(baseTemplate, appendAll(conditionals), append$2(option), join$1(" ")))));
6177
6192
  const subcommandCompletions = (conditionals) => map$7(info.subcommands, ([name, subcommand]) => {
@@ -6237,7 +6252,7 @@ const getZshSubcommandCases = (self, parentCommands, subcommands) => {
6237
6252
  switch (self._tag) {
6238
6253
  case "Standard":
6239
6254
  case "GetUserInput": {
6240
- const options = isStandard(self) ? all$1([builtIns, self.options]) : builtIns;
6255
+ const options = isStandard(self) ? all$2([builtIns, self.options]) : builtIns;
6241
6256
  const args = isStandard(self) ? self.args : none$1;
6242
6257
  const optionCompletions = pipe(getZshCompletions$1(options), map$7((completion) => `'${completion}' \\`));
6243
6258
  const argCompletions = pipe(getZshCompletions$2(args), map$7((completion) => `'${completion}' \\`));
@@ -6545,7 +6560,7 @@ const fromDescriptor = /* @__PURE__ */ dual((args) => isCommand(args[0]), (descr
6545
6560
  });
6546
6561
  const makeDescriptor = (name, config) => {
6547
6562
  const { args, options, tree } = parseConfig(config);
6548
- return map(make$15(name, all$1(options), all$2(args)), ({ args, options }) => reconstructConfigTree(tree, args, options));
6563
+ return map(make$15(name, all$2(options), all$3(args)), ({ args, options }) => reconstructConfigTree(tree, args, options));
6549
6564
  };
6550
6565
  /** @internal */
6551
6566
  const make$13 = (name, config = {}, handler) => fromDescriptor(makeDescriptor(name, config), handler);
@@ -7164,7 +7179,7 @@ const make$10 = (method) => (url, options) => modify(empty, {
7164
7179
  ...options ?? void 0
7165
7180
  });
7166
7181
  /** @internal */
7167
- const get$7 = /* @__PURE__ */ make$10("GET");
7182
+ const get$8 = /* @__PURE__ */ make$10("GET");
7168
7183
  /** @internal */
7169
7184
  const post$1 = /* @__PURE__ */ make$10("POST");
7170
7185
  /** @internal */
@@ -7172,7 +7187,7 @@ const put$1 = /* @__PURE__ */ make$10("PUT");
7172
7187
  /** @internal */
7173
7188
  const patch$1 = /* @__PURE__ */ make$10("PATCH");
7174
7189
  /** @internal */
7175
- const del$6 = /* @__PURE__ */ make$10("DELETE");
7190
+ const del$7 = /* @__PURE__ */ make$10("DELETE");
7176
7191
  /** @internal */
7177
7192
  const head$1 = /* @__PURE__ */ make$10("HEAD");
7178
7193
  /** @internal */
@@ -7266,7 +7281,7 @@ const ClientProto = {
7266
7281
  return { _id: "@effect/platform/HttpClient" };
7267
7282
  },
7268
7283
  get(url, options) {
7269
- return this.execute(get$7(url, options));
7284
+ return this.execute(get$8(url, options));
7270
7285
  },
7271
7286
  head(url, options) {
7272
7287
  return this.execute(head$1(url, options));
@@ -7281,7 +7296,7 @@ const ClientProto = {
7281
7296
  return this.execute(patch$1(url, options));
7282
7297
  },
7283
7298
  del(url, options) {
7284
- return this.execute(del$6(url, options));
7299
+ return this.execute(del$7(url, options));
7285
7300
  },
7286
7301
  options(url, options) {
7287
7302
  return this.execute(options$1(url, options));
@@ -7350,7 +7365,7 @@ const make$9 = (f) => makeWith((effect) => flatMap$1(effect, (request) => withFi
7350
7365
  }
7351
7366
  }));
7352
7367
  }
7353
- return useSpan(get$11(fiber.currentContext, SpanNameGenerator)(request), {
7368
+ return useSpan(get$12(fiber.currentContext, SpanNameGenerator)(request), {
7354
7369
  kind: "client",
7355
7370
  captureStackTrace: false
7356
7371
  }, (span) => {
@@ -7444,7 +7459,7 @@ var InterruptibleResponse = class {
7444
7459
  return this.original[NodeInspectSymbol]();
7445
7460
  }
7446
7461
  };
7447
- const { del: del$5, execute, get: get$6, head, options, patch, post, put } = /* @__PURE__ */ serviceFunctions(tag);
7462
+ const { del: del$6, execute, get: get$7, head, options, patch, post, put } = /* @__PURE__ */ serviceFunctions(tag);
7448
7463
  /** @internal */
7449
7464
  const transformResponse = /* @__PURE__ */ dual(2, (self, f) => {
7450
7465
  const client = self;
@@ -8019,7 +8034,7 @@ const symlink = /* @__PURE__ */ (() => {
8019
8034
  const nodeSymlink = /* @__PURE__ */ effectify(NFS.symlink, /* @__PURE__ */ handleErrnoException("FileSystem", "symlink"), /* @__PURE__ */ handleBadArgument("symlink"));
8020
8035
  return (target, path) => nodeSymlink(target, path);
8021
8036
  })();
8022
- const truncate = /* @__PURE__ */ (() => {
8037
+ const truncate$1 = /* @__PURE__ */ (() => {
8023
8038
  const nodeTruncate = /* @__PURE__ */ effectify(NFS.truncate, /* @__PURE__ */ handleErrnoException("FileSystem", "truncate"), /* @__PURE__ */ handleBadArgument("truncate"));
8024
8039
  return (path, length) => nodeTruncate(path, length !== void 0 ? Number(length) : void 0);
8025
8040
  })();
@@ -8101,7 +8116,7 @@ const layer$9 = /* @__PURE__ */ effect(FileSystem, /* @__PURE__ */ map$6(/* @__P
8101
8116
  rename,
8102
8117
  stat,
8103
8118
  symlink,
8104
- truncate,
8119
+ truncate: truncate$1,
8105
8120
  utimes,
8106
8121
  watch(path, options) {
8107
8122
  return watch(backend, path, options);
@@ -8333,7 +8348,7 @@ const HttpAgentTypeId = /* @__PURE__ */ Symbol.for("@effect/platform-node/Http/N
8333
8348
  /** @internal */
8334
8349
  const HttpAgent = /* @__PURE__ */ GenericTag("@effect/platform-node/Http/NodeClient/HttpAgent");
8335
8350
  /** @internal */
8336
- const makeAgent = (options) => map$6(all$3([acquireRelease(sync(() => new Http.Agent(options)), (agent) => sync(() => agent.destroy())), acquireRelease(sync(() => new Https.Agent(options)), (agent) => sync(() => agent.destroy()))]), ([http, https]) => ({
8351
+ const makeAgent = (options) => map$6(all$4([acquireRelease(sync(() => new Http.Agent(options)), (agent) => sync(() => agent.destroy())), acquireRelease(sync(() => new Https.Agent(options)), (agent) => sync(() => agent.destroy()))]), ([http, https]) => ({
8337
8352
  [HttpAgentTypeId]: HttpAgentTypeId,
8338
8353
  http,
8339
8354
  https
@@ -8819,7 +8834,7 @@ const layer = /* @__PURE__ */ pipe(/* @__PURE__ */ mergeAll(layer$3, layer$5, /*
8819
8834
  const rows = sync(() => stdout.rows ?? 0);
8820
8835
  const isTTY = sync(() => Boolean(stdout.isTTY));
8821
8836
  const readInput = gen(function* () {
8822
- yield* get$12(rlRef);
8837
+ yield* get$13(rlRef);
8823
8838
  const mailbox = yield* make$26();
8824
8839
  const handleKeypress = (s, k) => {
8825
8840
  const userInput = {
@@ -8838,7 +8853,7 @@ const layer = /* @__PURE__ */ pipe(/* @__PURE__ */ mergeAll(layer$3, layer$5, /*
8838
8853
  stdin.on("keypress", handleKeypress);
8839
8854
  return mailbox;
8840
8855
  });
8841
- const readLine = get$12(rlRef).pipe(flatMap$1((readlineInterface) => async((resume) => {
8856
+ const readLine = get$13(rlRef).pipe(flatMap$1((readlineInterface) => async((resume) => {
8842
8857
  const onLine = (line) => resume(succeed$1(line));
8843
8858
  readlineInterface.once("line", onLine);
8844
8859
  return sync(() => readlineInterface.off("line", onLine));
@@ -10259,7 +10274,7 @@ const getCodePointsLength = (() => {
10259
10274
  return input.length - surrogatePairsNr;
10260
10275
  };
10261
10276
  })();
10262
- const isFullWidth = (x) => {
10277
+ const isFullWidth$1 = (x) => {
10263
10278
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
10264
10279
  };
10265
10280
  const isWideNotCJKTNotEmoji = (x) => {
@@ -10314,7 +10329,7 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
10314
10329
  lengthExtra = 0;
10315
10330
  for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
10316
10331
  const codePoint = char.codePointAt(0) || 0;
10317
- if (isFullWidth(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
10332
+ if (isFullWidth$1(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
10318
10333
  else if (isWideNotCJKTNotEmoji(codePoint)) widthExtra = WIDE_WIDTH;
10319
10334
  else widthExtra = REGULAR_WIDTH;
10320
10335
  if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
@@ -11042,7 +11057,7 @@ const readStdinAll = () => new Promise((resolve, reject) => {
11042
11057
  stdin.on("error", reject);
11043
11058
  if (stdin.isPaused?.()) stdin.resume();
11044
11059
  });
11045
- const makeService$2 = (fs) => ({
11060
+ const makeService$3 = (fs) => ({
11046
11061
  openEditor: (opts) => tryPromise({
11047
11062
  try: async () => {
11048
11063
  const editor = opts.editor ?? process.env.EDITOR ?? process.env.VISUAL;
@@ -11093,7 +11108,7 @@ const makeService$2 = (fs) => ({
11093
11108
  });
11094
11109
  var Editor = class Editor extends Tag$2("Editor")() {
11095
11110
  static Default = effect(Editor, gen(function* () {
11096
- return makeService$2(yield* FileSystem);
11111
+ return makeService$3(yield* FileSystem);
11097
11112
  }));
11098
11113
  };
11099
11114
  //#endregion
@@ -11197,6 +11212,682 @@ const currentOutputOptions = unsafeMake({
11197
11212
  quiet: false,
11198
11213
  verbose: false
11199
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
+ }
11200
11891
  //#endregion
11201
11892
  //#region src/cli/render/markdown.ts
11202
11893
  const ANSI = {
@@ -11211,7 +11902,15 @@ const ANSI = {
11211
11902
  cyan: "\x1B[36m"
11212
11903
  };
11213
11904
  const wrap = (code, text, on) => on ? `${code}${text}${ANSI.reset}` : text;
11214
- 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
+ };
11215
11914
  const isColorEnabled = (stream) => {
11216
11915
  if (process.env.NO_COLOR && process.env.NO_COLOR !== "") return false;
11217
11916
  if (process.env.FORCE_COLOR && process.env.FORCE_COLOR !== "0") return true;
@@ -11626,6 +12325,103 @@ const highlightCode = (code, lang, color) => {
11626
12325
  return work;
11627
12326
  };
11628
12327
  //#endregion
12328
+ //#region src/services/Renderer/datetime.ts
12329
+ const pad2 = (n) => String(n).padStart(2, "0");
12330
+ /**
12331
+ * Coerce an arbitrary value (ISO string, epoch ms or s, Date) into a Date.
12332
+ * Returns null when the value cannot be interpreted as a calendar time.
12333
+ */
12334
+ const toDate = (value) => {
12335
+ if (value === null || value === void 0) return null;
12336
+ if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value;
12337
+ if (typeof value === "number") {
12338
+ if (!Number.isFinite(value) || value <= 0) return null;
12339
+ const ms = value < 0xe8d4a51000 ? value * 1e3 : value;
12340
+ const date = new Date(ms);
12341
+ return Number.isNaN(date.getTime()) ? null : date;
12342
+ }
12343
+ if (typeof value === "string") {
12344
+ const trimmed = value.trim();
12345
+ if (!trimmed) return null;
12346
+ const date = new Date(trimmed);
12347
+ return Number.isNaN(date.getTime()) ? null : date;
12348
+ }
12349
+ return null;
12350
+ };
12351
+ /** Local-time `YYYY-MM-DD HH:mm`. Seconds are dropped for readability. */
12352
+ const formatAbsoluteDateTime = (date) => {
12353
+ return `${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())} ${pad2(date.getHours())}:${pad2(date.getMinutes())}`;
12354
+ };
12355
+ const phrase = (count, unit, past) => {
12356
+ const plural = count === 1 ? unit : `${unit}s`;
12357
+ return past ? `${count} ${plural} ago` : `in ${count} ${plural}`;
12358
+ };
12359
+ /**
12360
+ * Relative phrase versus `now` (default = the moment of the call).
12361
+ * Bucketing uses the same thresholds as date-fns `formatDistance` so the
12362
+ * output reads naturally without 1-minute precision noise.
12363
+ */
12364
+ const formatRelativeTime = (date, now = /* @__PURE__ */ new Date()) => {
12365
+ const diffMs = date.getTime() - now.getTime();
12366
+ const past = diffMs < 0;
12367
+ const seconds = Math.abs(diffMs) / 1e3;
12368
+ if (seconds < 45) return past ? "just now" : "in a moment";
12369
+ if (seconds < 90) return phrase(1, "minute", past);
12370
+ const minutes = Math.round(seconds / 60);
12371
+ if (minutes < 45) return phrase(minutes, "minute", past);
12372
+ if (minutes < 90) return phrase(1, "hour", past);
12373
+ const hours = Math.round(minutes / 60);
12374
+ if (hours < 22) return phrase(hours, "hour", past);
12375
+ if (hours < 36) return phrase(1, "day", past);
12376
+ const days = Math.round(hours / 24);
12377
+ if (days < 7) return phrase(days, "day", past);
12378
+ if (days < 11) return phrase(1, "week", past);
12379
+ const weeks = Math.round(days / 7);
12380
+ if (weeks < 5) return phrase(weeks, "week", past);
12381
+ if (days < 60) return phrase(1, "month", past);
12382
+ const months = Math.round(days / 30);
12383
+ if (months < 12) return phrase(months, "month", past);
12384
+ return phrase(Math.round(days / 365.25), "year", past);
12385
+ };
12386
+ /**
12387
+ * Format an arbitrary timestamp-shaped value for a readable view.
12388
+ *
12389
+ * Falls back to `String(value)` when the value cannot be parsed as a date,
12390
+ * and to `''` when the value is nullish — letting the caller filter the
12391
+ * field out instead of rendering `null` / `undefined`.
12392
+ */
12393
+ const formatDateTime = (value, opts = {}) => {
12394
+ const date = toDate(value);
12395
+ if (!date) {
12396
+ if (value === null || value === void 0) return "";
12397
+ return String(value);
12398
+ }
12399
+ const style = opts.style ?? (opts.relative ? "both" : "abs");
12400
+ if (style === "rel") return formatRelativeTime(date, opts.now);
12401
+ const abs = formatAbsoluteDateTime(date);
12402
+ if (style === "both") {
12403
+ const rel = formatRelativeTime(date, opts.now);
12404
+ return rel ? `${abs} (${rel})` : abs;
12405
+ }
12406
+ return abs;
12407
+ };
12408
+ const ISO_LIKE_RE = /^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}/;
12409
+ /** True when `value` is a `Date` or an ISO-8601-ish string. */
12410
+ const looksLikeTimestamp = (value) => {
12411
+ if (value instanceof Date) return !Number.isNaN(value.getTime());
12412
+ if (typeof value === "string") return ISO_LIKE_RE.test(value);
12413
+ return false;
12414
+ };
12415
+ /**
12416
+ * Format `value` as a human-friendly timestamp when it looks like one;
12417
+ * return `null` otherwise so the caller can fall back to its scalar
12418
+ * formatter without committing to the timestamp shape.
12419
+ */
12420
+ const tryFormatTimestamp = (value, opts = {}) => {
12421
+ if (!looksLikeTimestamp(value)) return null;
12422
+ return formatDateTime(value, opts);
12423
+ };
12424
+ //#endregion
11629
12425
  //#region ../../node_modules/.pnpm/nanoid@5.1.11/node_modules/nanoid/index.js
11630
12426
  const POOL_SIZE_MULTIPLIER = 128;
11631
12427
  let pool, poolOffset;
@@ -13243,7 +14039,7 @@ var Parser$1 = class {
13243
14039
  //#region ../../node_modules/.pnpm/domelementtype@2.3.0/node_modules/domelementtype/lib/esm/index.js
13244
14040
  var esm_exports$2 = /* @__PURE__ */ __exportAll({
13245
14041
  CDATA: () => CDATA$1,
13246
- Comment: () => Comment$3,
14042
+ Comment: () => Comment$4,
13247
14043
  Directive: () => Directive,
13248
14044
  Doctype: () => Doctype,
13249
14045
  ElementType: () => ElementType,
@@ -13291,7 +14087,7 @@ const Text$3 = ElementType.Text;
13291
14087
  /** Type for <? ... ?> */
13292
14088
  const Directive = ElementType.Directive;
13293
14089
  /** Type for <!-- ... --> */
13294
- const Comment$3 = ElementType.Comment;
14090
+ const Comment$4 = ElementType.Comment;
13295
14091
  /** Type for <script> tags */
13296
14092
  const Script = ElementType.Script;
13297
14093
  /** Type for <style> tags */
@@ -13398,7 +14194,7 @@ var Text$2 = class extends DataNode {
13398
14194
  /**
13399
14195
  * Comments within the document.
13400
14196
  */
13401
- var Comment$2 = class extends DataNode {
14197
+ var Comment$3 = class extends DataNode {
13402
14198
  constructor() {
13403
14199
  super(...arguments);
13404
14200
  this.type = ElementType.Comment;
@@ -13570,7 +14366,7 @@ function hasChildren(node) {
13570
14366
  function cloneNode(node, recursive = false) {
13571
14367
  let result;
13572
14368
  if (isText(node)) result = new Text$2(node.data);
13573
- else if (isComment(node)) result = new Comment$2(node.data);
14369
+ else if (isComment(node)) result = new Comment$3(node.data);
13574
14370
  else if (isTag$1(node)) {
13575
14371
  const children = recursive ? cloneChildren(node.children) : [];
13576
14372
  const clone = new Element$2(node.name, { ...node.attribs }, children);
@@ -13697,7 +14493,7 @@ var DomHandler = class {
13697
14493
  this.lastNode.data += data;
13698
14494
  return;
13699
14495
  }
13700
- const node = new Comment$2(data);
14496
+ const node = new Comment$3(data);
13701
14497
  this.addNode(node);
13702
14498
  this.lastNode = node;
13703
14499
  }
@@ -13999,7 +14795,7 @@ function renderNode(node, options) {
13999
14795
  case Root: return render(node.children, options);
14000
14796
  case Doctype:
14001
14797
  case Directive: return renderDirective(node);
14002
- case Comment$3: return renderComment(node);
14798
+ case Comment$4: return renderComment(node);
14003
14799
  case CDATA$1: return renderCdata$1(node);
14004
14800
  case Script:
14005
14801
  case Style:
@@ -16120,13 +16916,13 @@ var CDATASection$1 = class CDATASection$1 extends CharacterData$1 {
16120
16916
  /**
16121
16917
  * @implements globalThis.Comment
16122
16918
  */
16123
- var Comment$1 = class Comment$1 extends CharacterData$1 {
16919
+ var Comment$2 = class Comment$2 extends CharacterData$1 {
16124
16920
  constructor(ownerDocument, data = "") {
16125
16921
  super(ownerDocument, "#comment", 8, data);
16126
16922
  }
16127
16923
  cloneNode() {
16128
16924
  const { ownerDocument, [VALUE]: data } = this;
16129
- return new Comment$1(ownerDocument, data);
16925
+ return new Comment$2(ownerDocument, data);
16130
16926
  }
16131
16927
  toString() {
16132
16928
  return `<!--${this[VALUE]}-->`;
@@ -18733,11 +19529,11 @@ function CharacterData() {
18733
19529
  }
18734
19530
  setPrototypeOf(CharacterData, CharacterData$1);
18735
19531
  CharacterData.prototype = CharacterData$1.prototype;
18736
- function Comment() {
19532
+ function Comment$1() {
18737
19533
  illegalConstructor();
18738
19534
  }
18739
- setPrototypeOf(Comment, Comment$1);
18740
- Comment.prototype = Comment$1.prototype;
19535
+ setPrototypeOf(Comment$1, Comment$2);
19536
+ Comment$1.prototype = Comment$2.prototype;
18741
19537
  function DocumentFragment() {
18742
19538
  illegalConstructor();
18743
19539
  }
@@ -18778,7 +19574,7 @@ const Facades = {
18778
19574
  Attr,
18779
19575
  CDATASection,
18780
19576
  CharacterData,
18781
- Comment,
19577
+ Comment: Comment$1,
18782
19578
  DocumentFragment,
18783
19579
  DocumentType,
18784
19580
  Element,
@@ -22429,7 +23225,7 @@ var Document$1 = class extends NonElementParentNode {
22429
23225
  return new CDATASection$1(this, data);
22430
23226
  }
22431
23227
  createComment(textContent) {
22432
- return new Comment$1(this, textContent);
23228
+ return new Comment$2(this, textContent);
22433
23229
  }
22434
23230
  createDocumentFragment() {
22435
23231
  return new DocumentFragment$1(this);
@@ -26116,7 +26912,7 @@ const normalizeAttrs = (raw) => {
26116
26912
  for (const [k, v] of Object.entries(raw)) out[k] = v == null ? "" : String(v);
26117
26913
  return out;
26118
26914
  };
26119
- const normalize$3 = (raw) => {
26915
+ const normalize$4 = (raw) => {
26120
26916
  if (!Array.isArray(raw)) return [];
26121
26917
  const out = [];
26122
26918
  for (const entry of raw) {
@@ -26136,7 +26932,7 @@ const normalize$3 = (raw) => {
26136
26932
  type: "element",
26137
26933
  tag: key,
26138
26934
  attrs,
26139
- children: normalize$3(value)
26935
+ children: normalize$4(value)
26140
26936
  });
26141
26937
  }
26142
26938
  }
@@ -26149,7 +26945,7 @@ const parseLitexml = (xml) => {
26149
26945
  const first = raw[0];
26150
26946
  if (!first) return [];
26151
26947
  const inner = first.root;
26152
- return normalize$3(inner);
26948
+ return normalize$4(inner);
26153
26949
  } catch {
26154
26950
  return [];
26155
26951
  }
@@ -26213,6 +27009,10 @@ const renderLexicalAnsi = (xml, opts) => {
26213
27009
  };
26214
27010
  //#endregion
26215
27011
  //#region src/cli/render/metadata-block.ts
27012
+ const formatFieldValue = (key, value, color) => {
27013
+ if (key === "state") return formatStateBadge(value, color) ?? formatScalar(value);
27014
+ return tryFormatTimestamp(value, { style: "both" }) ?? formatScalar(value);
27015
+ };
26216
27016
  const renderMetadataBlock = (input, ctx) => {
26217
27017
  const { color } = ctx;
26218
27018
  const { title, kind, fields: rawFields, summary, body, bodyFormat } = input;
@@ -26226,7 +27026,7 @@ const renderMetadataBlock = (input, ctx) => {
26226
27026
  const labelWidth = fields.reduce((max, [key]) => Math.max(max, key.length), 0);
26227
27027
  for (const [key, value] of fields) {
26228
27028
  const label = wrap(ANSI.dim, key.padEnd(labelWidth), color);
26229
- const rendered = key === "state" ? formatStateBadge(value, color) ?? formatScalar(value) : formatScalar(value);
27029
+ const rendered = formatFieldValue(key, value, color);
26230
27030
  lines.push(`${label} ${rendered}`);
26231
27031
  }
26232
27032
  if (summary) {
@@ -26301,12 +27101,15 @@ const emitErrorSync = (err, opts) => {
26301
27101
  //#endregion
26302
27102
  //#region src/services/Renderer/lists.ts
26303
27103
  const isPlainObject = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value) && !(value instanceof Date);
27104
+ const formatLeaf = (value) => tryFormatTimestamp(value, { style: "both" }) ?? formatScalar(value);
26304
27105
  const renderReadableLines = (data, indent) => {
26305
27106
  const pad = " ".repeat(indent);
26306
27107
  if (data === null || data === void 0) return [];
26307
- if (data instanceof Date) return [`${pad}${data.toISOString()}`];
27108
+ if (data instanceof Date) return [`${pad}${formatLeaf(data)}`];
26308
27109
  if (typeof data === "string") {
26309
27110
  if (data.length === 0) return [];
27111
+ const ts = tryFormatTimestamp(data, { style: "both" });
27112
+ if (ts !== null) return [`${pad}${ts}`];
26310
27113
  return data.split("\n").map((line) => `${pad}${line}`);
26311
27114
  }
26312
27115
  if (typeof data === "number" || typeof data === "boolean") return [`${pad}${String(data)}`];
@@ -26324,7 +27127,7 @@ const renderReadableLines = (data, indent) => {
26324
27127
  if (inner.length === 0) continue;
26325
27128
  lines.push(`${pad}-`);
26326
27129
  lines.push(...inner);
26327
- } else if (item !== null && item !== void 0) lines.push(`${pad}- ${formatScalar(item)}`);
27130
+ } else if (item !== null && item !== void 0) lines.push(`${pad}- ${formatLeaf(item)}`);
26328
27131
  return lines;
26329
27132
  }
26330
27133
  if (isPlainObject(data)) {
@@ -26334,7 +27137,7 @@ const renderReadableLines = (data, indent) => {
26334
27137
  if (Array.isArray(value)) {
26335
27138
  if (value.length === 0) continue;
26336
27139
  if (value.every((v) => v === null || v === void 0 || v instanceof Date || typeof v !== "object")) {
26337
- const parts = value.filter((v) => v !== null && v !== void 0).map((v) => formatScalar(v));
27140
+ const parts = value.filter((v) => v !== null && v !== void 0).map((v) => formatLeaf(v));
26338
27141
  lines.push(`${pad}${key}: ${parts.join(", ")}`);
26339
27142
  } else {
26340
27143
  lines.push(`${pad}${key}:`);
@@ -26345,8 +27148,7 @@ const renderReadableLines = (data, indent) => {
26345
27148
  if (inner.length === 0) continue;
26346
27149
  lines.push(`${pad}${key}:`);
26347
27150
  lines.push(...inner);
26348
- } else if (value instanceof Date) lines.push(`${pad}${key}: ${value.toISOString()}`);
26349
- else lines.push(`${pad}${key}: ${formatScalar(value)}`);
27151
+ } else lines.push(`${pad}${key}: ${formatLeaf(value)}`);
26350
27152
  }
26351
27153
  return lines;
26352
27154
  }
@@ -26355,8 +27157,8 @@ const renderReadableLines = (data, indent) => {
26355
27157
  const renderReadableGeneric = (data) => renderReadableLines(data, 0).join("\n");
26356
27158
  //#endregion
26357
27159
  //#region src/services/Renderer/service.ts
26358
- const makeService$1 = () => {
26359
- const getOpts = get$13(currentOutputOptions);
27160
+ const makeService$2 = () => {
27161
+ const getOpts = get$14(currentOutputOptions);
26360
27162
  const emitSuccessSync = (data, opts) => {
26361
27163
  if (opts.json || opts.output === "json") {
26362
27164
  writeStdout(`${JSON.stringify({
@@ -26467,7 +27269,7 @@ const makeService$1 = () => {
26467
27269
  //#endregion
26468
27270
  //#region src/services/Renderer/index.ts
26469
27271
  var Renderer = class Renderer extends Tag$2("Renderer")() {
26470
- static Default = succeed$3(Renderer, makeService$1());
27272
+ static Default = succeed$3(Renderer, makeService$2());
26471
27273
  /** Apply the given `OutputOptions` for the duration of `effect`. */
26472
27274
  static withOptions = (options) => (effect) => locally(effect, currentOutputOptions, options);
26473
27275
  };
@@ -26721,7 +27523,7 @@ const whoami = make$12("whoami", {}, () => gen(function* () {
26721
27523
  }));
26722
27524
  //#endregion
26723
27525
  //#region src/cli/auth/index.ts
26724
- const help$7 = registerCommandHelp({
27526
+ const help$8 = registerCommandHelp({
26725
27527
  name: "auth",
26726
27528
  description: "authentication",
26727
27529
  verbs: [
@@ -26744,7 +27546,7 @@ const help$7 = registerCommandHelp({
26744
27546
  }
26745
27547
  ]
26746
27548
  });
26747
- const authCmd = make$12("auth").pipe(withDescription(help$7.description), withSubcommands([
27549
+ const authCmd = make$12("auth").pipe(withDescription(help$8.description), withSubcommands([
26748
27550
  login,
26749
27551
  logout,
26750
27552
  whoami,
@@ -26856,7 +27658,7 @@ function makeApiService(http, config, auth, opts) {
26856
27658
  })));
26857
27659
  const maybeEmitBanner = (resolved) => gen(function* () {
26858
27660
  if (!resolved.isProduction || opts.quiet) return;
26859
- if (yield* get$8(bannerEmitted)) return;
27661
+ if (yield* get$9(bannerEmitted)) return;
26860
27662
  yield* set$3(bannerEmitted, true);
26861
27663
  yield* sync(() => {
26862
27664
  process.stderr.write(`mxs: profile=${resolved.profileName} (production) → ${resolved.apiUrl}\n`);
@@ -27270,7 +28072,7 @@ var Resolver = class Resolver extends Tag$2("Resolver")() {
27270
28072
  return make$2(yield* Api);
27271
28073
  }));
27272
28074
  };
27273
- const del$4 = make$12("delete", {
28075
+ const del$5 = make$12("delete", {
27274
28076
  slugOrId: text$3({ name: "slugOrId" }),
27275
28077
  force: boolean("force")
27276
28078
  }, ({ slugOrId, force }) => gen(function* () {
@@ -27281,7 +28083,7 @@ const del$4 = make$12("delete", {
27281
28083
  yield* api.request(`/categories/${id}`, { method: "DELETE" });
27282
28084
  yield* renderer.emitSuccess({ deleted: id });
27283
28085
  }));
27284
- const get$5 = make$12("get", { slugOrId: text$3({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
28086
+ const get$6 = make$12("get", { slugOrId: text$3({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
27285
28087
  const api = yield* Api;
27286
28088
  const renderer = yield* Renderer;
27287
28089
  const res = yield* api.request(`/categories/${encodeURIComponent(slugOrId)}`);
@@ -27289,7 +28091,7 @@ const get$5 = make$12("get", { slugOrId: text$3({ name: "slugOrId" }) }, ({ slug
27289
28091
  }));
27290
28092
  //#endregion
27291
28093
  //#region src/cli/category/list.ts
27292
- const list$5 = make$12("list", {}, () => gen(function* () {
28094
+ const list$6 = make$12("list", {}, () => gen(function* () {
27293
28095
  const api = yield* Api;
27294
28096
  const renderer = yield* Renderer;
27295
28097
  const res = yield* api.request("/categories");
@@ -27322,7 +28124,7 @@ const update$4 = make$12("update", {
27322
28124
  }));
27323
28125
  //#endregion
27324
28126
  //#region src/cli/category/index.ts
27325
- const help$6 = registerCommandHelp({
28127
+ const help$7 = registerCommandHelp({
27326
28128
  name: "category",
27327
28129
  description: "manage categories / tags",
27328
28130
  verbs: [
@@ -27362,11 +28164,457 @@ const help$6 = registerCommandHelp({
27362
28164
  }
27363
28165
  ]
27364
28166
  });
27365
- const categoryCmd = make$12("category").pipe(withDescription(help$6.description), withSubcommands([
27366
- list$5,
27367
- get$5,
28167
+ const categoryCmd = make$12("category").pipe(withDescription(help$7.description), withSubcommands([
28168
+ list$6,
28169
+ get$6,
27368
28170
  create$4,
27369
28171
  update$4,
28172
+ del$5
28173
+ ]));
28174
+ //#endregion
28175
+ //#region src/services/Comment.ts
28176
+ const COMMENT_STATE_NAMES = [
28177
+ "unread",
28178
+ "read",
28179
+ "junk"
28180
+ ];
28181
+ const stateToCode = {
28182
+ unread: 0,
28183
+ read: 1,
28184
+ junk: 2
28185
+ };
28186
+ const codeToState = {
28187
+ 0: "unread",
28188
+ 1: "read",
28189
+ 2: "junk"
28190
+ };
28191
+ const stateNameToCode = (s) => stateToCode[s];
28192
+ const stateCodeToName = (n) => codeToState[n];
28193
+ const mergeListResponses = (responses) => {
28194
+ const data = [];
28195
+ const readers = {};
28196
+ let total = 0;
28197
+ for (const r of responses) {
28198
+ if (Array.isArray(r.data)) data.push(...r.data);
28199
+ if (r.readers) Object.assign(readers, r.readers);
28200
+ const t = r.pagination && typeof r.pagination.total === "number" ? r.pagination.total : 0;
28201
+ total += t;
28202
+ }
28203
+ return {
28204
+ data,
28205
+ pagination: {
28206
+ total,
28207
+ size: data.length,
28208
+ page: 1,
28209
+ totalPages: 1
28210
+ },
28211
+ readers
28212
+ };
28213
+ };
28214
+ const makeService$1 = (api) => {
28215
+ const requestList = (state, page, size) => api.request("/comments", { query: {
28216
+ page,
28217
+ size,
28218
+ state: stateNameToCode(state)
28219
+ } });
28220
+ const patchBatchState = (body) => asVoid(api.request("/comments/batch/state", {
28221
+ method: "PATCH",
28222
+ body
28223
+ }));
28224
+ const deleteBatch = (body) => asVoid(api.request("/comments/batch", {
28225
+ method: "DELETE",
28226
+ body
28227
+ }));
28228
+ return {
28229
+ list: (opts) => {
28230
+ if (opts.all) return all$4(COMMENT_STATE_NAMES.map((s) => requestList(s, opts.page, opts.size)), { concurrency: 3 }).pipe(map$6(mergeListResponses));
28231
+ return requestList(opts.state ?? "unread", opts.page, opts.size);
28232
+ },
28233
+ get: (id) => api.request(`/comments/${id}`),
28234
+ approve: (ids) => patchBatchState({
28235
+ ids: [...ids],
28236
+ state: stateToCode.read
28237
+ }),
28238
+ reject: (ids) => patchBatchState({
28239
+ ids: [...ids],
28240
+ state: stateToCode.junk
28241
+ }),
28242
+ delete: (ids) => deleteBatch({ ids: [...ids] }),
28243
+ approveAll: (filter) => patchBatchState({
28244
+ all: true,
28245
+ state: stateToCode.read,
28246
+ currentState: filter.currentState !== void 0 ? stateNameToCode(filter.currentState) : void 0
28247
+ }),
28248
+ rejectAll: (filter) => patchBatchState({
28249
+ all: true,
28250
+ state: stateToCode.junk,
28251
+ currentState: filter.currentState !== void 0 ? stateNameToCode(filter.currentState) : void 0
28252
+ }),
28253
+ deleteAll: (filter) => deleteBatch({
28254
+ all: true,
28255
+ state: filter.currentState !== void 0 ? stateNameToCode(filter.currentState) : void 0
28256
+ })
28257
+ };
28258
+ };
28259
+ var Comment = class Comment extends Tag$2("Comment")() {
28260
+ static Default = effect(Comment, gen(function* () {
28261
+ return makeService$1(yield* Api);
28262
+ }));
28263
+ };
28264
+ //#endregion
28265
+ //#region src/cli/comment/_flags.ts
28266
+ const ids = text$3({ name: "id" }).pipe(repeated);
28267
+ const all = boolean("all").pipe(withDescription$3("apply to every comment (optionally filtered by --state)"));
28268
+ const force$6 = boolean("force").pipe(withDescription$3("skip TTY confirmation guard"));
28269
+ const stateFilter = choice("state", [
28270
+ "unread",
28271
+ "read",
28272
+ "junk"
28273
+ ]).pipe(optional$2);
28274
+ const unwrapOption = (value) => getOrUndefined(value);
28275
+ /**
28276
+ * Shared invariants for ids/--all batch verbs (`approve`, `reject`, `delete`).
28277
+ *
28278
+ * - exactly one of `ids` (>= 1) or `--all` MUST be supplied
28279
+ * - `--all` in a non-TTY context requires `--force`
28280
+ * - additional guards (e.g. single-id `delete`) are applied per-verb
28281
+ */
28282
+ const validateBatchSelection = (params) => suspend(() => {
28283
+ if (params.all && params.ids.length > 0) return fail$2(new ValidationFailed({ message: "--all cannot be combined with explicit ids" }));
28284
+ if (!params.all && params.ids.length === 0) return fail$2(new ValidationFailed({ message: `${params.verb} requires at least one id or --all` }));
28285
+ if (params.all && !params.force && !process.stdin.isTTY) return fail$2(new ValidationFailed({ message: `refusing to ${params.verb} --all without --force in non-TTY context` }));
28286
+ return _void;
28287
+ });
28288
+ const requireForceForSingleDelete = (params) => suspend(() => {
28289
+ if (params.all) return _void;
28290
+ if (params.force) return _void;
28291
+ if (process.stdin.isTTY) return _void;
28292
+ return fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
28293
+ });
28294
+ //#endregion
28295
+ //#region src/cli/comment/approve.ts
28296
+ const approve = make$12("approve", {
28297
+ ids,
28298
+ all,
28299
+ force: force$6,
28300
+ state: stateFilter
28301
+ }, ({ ids, all, force, state }) => gen(function* () {
28302
+ yield* validateBatchSelection({
28303
+ verb: "approve",
28304
+ ids,
28305
+ all,
28306
+ force
28307
+ });
28308
+ const comment = yield* Comment;
28309
+ const renderer = yield* Renderer;
28310
+ if (all) {
28311
+ yield* comment.approveAll({ currentState: unwrapOption(state) });
28312
+ yield* renderer.emitSuccess({
28313
+ approved: "all",
28314
+ filter: { currentState: unwrapOption(state) ?? null }
28315
+ });
28316
+ } else {
28317
+ yield* comment.approve(ids);
28318
+ yield* renderer.emitSuccess({ approved: ids });
28319
+ }
28320
+ })).pipe(withDescription("mark comments as read; pass ids or --all [--state <s>]"));
28321
+ //#endregion
28322
+ //#region src/cli/comment/delete.ts
28323
+ const del$4 = make$12("delete", {
28324
+ ids,
28325
+ all,
28326
+ force: force$6,
28327
+ state: stateFilter
28328
+ }, ({ ids, all, force, state }) => gen(function* () {
28329
+ yield* validateBatchSelection({
28330
+ verb: "delete",
28331
+ ids,
28332
+ all,
28333
+ force
28334
+ });
28335
+ yield* requireForceForSingleDelete({
28336
+ ids,
28337
+ all,
28338
+ force
28339
+ });
28340
+ const comment = yield* Comment;
28341
+ const renderer = yield* Renderer;
28342
+ if (all) {
28343
+ yield* comment.deleteAll({ currentState: unwrapOption(state) });
28344
+ yield* renderer.emitSuccess({
28345
+ deleted: "all",
28346
+ filter: { currentState: unwrapOption(state) ?? null }
28347
+ });
28348
+ } else {
28349
+ yield* comment.delete(ids);
28350
+ yield* renderer.emitSuccess({ deleted: ids });
28351
+ }
28352
+ })).pipe(withDescription("soft-delete comments; pass ids or --all [--state <s>]"));
28353
+ //#endregion
28354
+ //#region src/cli/comment/view.ts
28355
+ const normalize$3 = (data) => asRecord(unwrapDocument(data));
28356
+ const stateLabel = (raw) => {
28357
+ if (typeof raw === "number") return stateCodeToName(raw) ?? String(raw);
28358
+ if (typeof raw === "string") return raw;
28359
+ return "";
28360
+ };
28361
+ const colorForCommentState = (raw, color) => {
28362
+ const label = stateLabel(raw);
28363
+ if (!label) return void 0;
28364
+ if (label === "unread") return wrap(ANSI.yellow, label, color);
28365
+ if (label === "read") return wrap(ANSI.green, label, color);
28366
+ if (label === "junk") return wrap(ANSI.red, label, color);
28367
+ return formatStateBadge(label, color) ?? label;
28368
+ };
28369
+ const truncate = (s, max = 80) => s.length > max ? `${s.slice(0, max - 1)}…` : s;
28370
+ const oneLine = (s) => s.replaceAll(/\s+/g, " ").trim();
28371
+ const authorOf = (doc) => {
28372
+ const reader = asRecord(first(doc, "reader"));
28373
+ if (Object.keys(reader).length > 0) {
28374
+ const name = firstString(reader, "nickname", "name");
28375
+ if (name) return name;
28376
+ }
28377
+ return firstString(doc, "author") || "(anonymous)";
28378
+ };
28379
+ const refLabel = (doc) => {
28380
+ const refType = firstString(doc, "ref_type", "refType");
28381
+ const title = firstString(asRecord(first(doc, "ref")), "title", "slug", "id");
28382
+ if (refType && title) return `${refType}:${title}`;
28383
+ if (refType) return refType;
28384
+ return "";
28385
+ };
28386
+ const collectDetailFields = (doc) => {
28387
+ return [
28388
+ ["id", first(doc, "id")],
28389
+ ["author", authorOf(doc)],
28390
+ ["mail", first(doc, "mail")],
28391
+ ["url", first(doc, "url")],
28392
+ ["ip", first(doc, "ip")],
28393
+ ["location", first(doc, "location")],
28394
+ ["ref", refLabel(doc)],
28395
+ ["state", stateLabel(first(doc, "state"))],
28396
+ ["pin", first(doc, "pin")],
28397
+ ["is_whispers", first(doc, "is_whispers", "isWhispers")],
28398
+ ["created_at", first(doc, "created_at", "createdAt")]
28399
+ ].filter(([, value]) => value !== void 0 && value !== null && value !== "");
28400
+ };
28401
+ const renderCommentReadable = (data, color) => {
28402
+ const doc = normalize$3(data);
28403
+ return renderMetadataBlock({
28404
+ title: `comment from ${authorOf(doc)}`,
28405
+ kind: "comment",
28406
+ fields: collectDetailFields(doc),
28407
+ body: firstString(doc, "text") || void 0,
28408
+ bodyFormat: "markdown"
28409
+ }, { color });
28410
+ };
28411
+ const renderCommentLlm = (data) => {
28412
+ const doc = normalize$3(data);
28413
+ const fm = frontmatter({
28414
+ title: `comment ${firstString(doc, "id") || ""}`.trim(),
28415
+ fields: collectDetailFields(doc)
28416
+ });
28417
+ const text = firstString(doc, "text");
28418
+ return text ? `${fm}\n\n${text}` : fm;
28419
+ };
28420
+ const commentView = {
28421
+ kind: "comment",
28422
+ modes: new Set(["readable", "llm"]),
28423
+ readable: (data, ctx) => renderCommentReadable(data, ctx.color),
28424
+ llm: (data) => renderCommentLlm(data)
28425
+ };
28426
+ const renderListHeader = (payload, rowCount, color) => {
28427
+ const pagination = asRecord(first(payload, "pagination"));
28428
+ const page = first(pagination, "page", "currentPage");
28429
+ const size = first(pagination, "size", "pageSize");
28430
+ const total = first(pagination, "total", "totalCount");
28431
+ const meta = [`count: ${rowCount}`];
28432
+ if (page !== void 0) meta.push(`page: ${formatScalar(page)}`);
28433
+ if (size !== void 0) meta.push(`size: ${formatScalar(size)}`);
28434
+ if (total !== void 0) meta.push(`total: ${formatScalar(total)}`);
28435
+ const heading = wrap(ANSI.bold, "Comments", color);
28436
+ const ruleLen = Math.min(Math.max(visibleLen("Comments"), 24), 64);
28437
+ return `${heading}\n${wrap(ANSI.dim, "─".repeat(ruleLen), color)}\n${wrap(ANSI.dim, meta.join(" · "), color)}`;
28438
+ };
28439
+ const renderListItem = (doc, index, color) => {
28440
+ const author = authorOf(doc);
28441
+ const id = firstString(doc, "id");
28442
+ const stateBadge = colorForCommentState(first(doc, "state"), color) ?? stateLabel(first(doc, "state"));
28443
+ const ref = refLabel(doc);
28444
+ const created = first(doc, "created_at", "createdAt");
28445
+ const lines = [];
28446
+ const indexLabel = wrap(ANSI.dim, `${index + 1}.`, color);
28447
+ const authorBold = wrap(ANSI.bold, author, color);
28448
+ const idDim = id ? wrap(ANSI.dim, `#${id}`, color) : "";
28449
+ const header = [
28450
+ indexLabel,
28451
+ authorBold,
28452
+ `[${stateBadge}]`,
28453
+ idDim
28454
+ ].filter(Boolean).join(" ");
28455
+ lines.push(header);
28456
+ const metaParts = [];
28457
+ if (ref) metaParts.push(ref);
28458
+ if (created !== void 0) metaParts.push(tryFormatTimestamp(created, { style: "rel" }) ?? formatScalar(created));
28459
+ if (metaParts.length > 0) lines.push(wrap(ANSI.dim, ` ${metaParts.join(" · ")}`, color));
28460
+ const text = firstString(doc, "text");
28461
+ if (text) lines.push(` ${truncate(oneLine(text))}`);
28462
+ return lines.join("\n");
28463
+ };
28464
+ const renderCommentListReadable = (data, color) => {
28465
+ const payload = asRecord(data);
28466
+ const rows = Array.isArray(payload.data) ? payload.data : Array.isArray(data) ? data : [];
28467
+ const header = renderListHeader(payload, rows.length, color);
28468
+ if (rows.length === 0) return `${header}\n\n${wrap(ANSI.dim, "(no comments)", color)}`;
28469
+ return `${header}\n\n${rows.map((row, index) => renderListItem(asRecord(row), index, color)).join("\n\n")}`;
28470
+ };
28471
+ const renderCommentListLlm = (data) => {
28472
+ const payload = asRecord(data);
28473
+ const rows = Array.isArray(payload.data) ? payload.data : Array.isArray(data) ? data : [];
28474
+ if (rows.length === 0) return renderMarkdownToAnsi("# Comments\n\n_no comments_\n", { color: false });
28475
+ return rows.map((row) => {
28476
+ const doc = asRecord(row);
28477
+ const fm = frontmatter({
28478
+ title: `comment ${firstString(doc, "id") || ""}`.trim(),
28479
+ fields: collectDetailFields(doc)
28480
+ });
28481
+ const text = firstString(doc, "text");
28482
+ return text ? `${fm}\n\n${text}` : fm;
28483
+ }).join("\n\n---\n\n");
28484
+ };
28485
+ const commentListView = {
28486
+ kind: "comment-list",
28487
+ modes: new Set(["readable", "llm"]),
28488
+ readable: (data, ctx) => renderCommentListReadable(data, ctx.color),
28489
+ llm: (data) => renderCommentListLlm(data)
28490
+ };
28491
+ const get$5 = make$12("get", { id: text$3({ name: "id" }) }, ({ id }) => gen(function* () {
28492
+ const comment = yield* Comment;
28493
+ const renderer = yield* Renderer;
28494
+ const res = yield* comment.get(id);
28495
+ yield* renderer.emit(commentView, res);
28496
+ })).pipe(withDescription("show a single comment by id"));
28497
+ const list$5 = make$12("list", {
28498
+ page: integer("page").pipe(optional$2),
28499
+ size: integer("size").pipe(optional$2),
28500
+ state: stateFilter,
28501
+ all: boolean("all").pipe(withDescription$3("list comments across every state (ignores --state)"))
28502
+ }, ({ page, size, state, all }) => gen(function* () {
28503
+ const comment = yield* Comment;
28504
+ const renderer = yield* Renderer;
28505
+ const res = yield* comment.list({
28506
+ page: unwrapOption(page),
28507
+ size: unwrapOption(size),
28508
+ state: unwrapOption(state),
28509
+ all
28510
+ });
28511
+ yield* renderer.emit(commentListView, res);
28512
+ })).pipe(withDescription("list comments (default state: unread; use --all for every state)"));
28513
+ //#endregion
28514
+ //#region src/cli/comment/reject.ts
28515
+ const reject = make$12("reject", {
28516
+ ids,
28517
+ all,
28518
+ force: force$6,
28519
+ state: stateFilter
28520
+ }, ({ ids, all, force, state }) => gen(function* () {
28521
+ yield* validateBatchSelection({
28522
+ verb: "reject",
28523
+ ids,
28524
+ all,
28525
+ force
28526
+ });
28527
+ const comment = yield* Comment;
28528
+ const renderer = yield* Renderer;
28529
+ if (all) {
28530
+ yield* comment.rejectAll({ currentState: unwrapOption(state) });
28531
+ yield* renderer.emitSuccess({
28532
+ rejected: "all",
28533
+ filter: { currentState: unwrapOption(state) ?? null }
28534
+ });
28535
+ } else {
28536
+ yield* comment.reject(ids);
28537
+ yield* renderer.emitSuccess({ rejected: ids });
28538
+ }
28539
+ })).pipe(withDescription("mark comments as junk; pass ids or --all [--state <s>]"));
28540
+ const unread = make$12("unread", {
28541
+ page: integer("page").pipe(optional$2),
28542
+ size: integer("size").pipe(optional$2)
28543
+ }, ({ page, size }) => gen(function* () {
28544
+ const comment = yield* Comment;
28545
+ const renderer = yield* Renderer;
28546
+ const res = yield* comment.list({
28547
+ page: unwrapOption(page),
28548
+ size: unwrapOption(size),
28549
+ state: "unread"
28550
+ });
28551
+ yield* renderer.emit(commentListView, res);
28552
+ })).pipe(withDescription("list unread comments (alias for `comment list --state unread`)"));
28553
+ //#endregion
28554
+ //#region src/cli/comment/index.ts
28555
+ const help$6 = registerCommandHelp({
28556
+ name: "comment",
28557
+ description: "list and moderate comments",
28558
+ verbs: [
28559
+ {
28560
+ name: "list",
28561
+ args: [
28562
+ "[--page <n>]",
28563
+ "[--size <n>]",
28564
+ "[--state <s>]",
28565
+ "[--all]"
28566
+ ],
28567
+ description: "list comments (default state: unread; --all aggregates every state)"
28568
+ },
28569
+ {
28570
+ name: "unread",
28571
+ args: ["[--page <n>]", "[--size <n>]"],
28572
+ description: "alias for `list --state unread`"
28573
+ },
28574
+ {
28575
+ name: "get",
28576
+ args: ["<id>"],
28577
+ description: "show a single comment"
28578
+ },
28579
+ {
28580
+ name: "approve",
28581
+ args: [
28582
+ "<id...>",
28583
+ "|",
28584
+ "--all",
28585
+ "[--state <s>]"
28586
+ ],
28587
+ description: "mark comments as read"
28588
+ },
28589
+ {
28590
+ name: "reject",
28591
+ args: [
28592
+ "<id...>",
28593
+ "|",
28594
+ "--all",
28595
+ "[--state <s>]"
28596
+ ],
28597
+ description: "mark comments as junk"
28598
+ },
28599
+ {
28600
+ name: "delete",
28601
+ args: [
28602
+ "<id...>",
28603
+ "|",
28604
+ "--all",
28605
+ "[--state <s>]",
28606
+ "[--force]"
28607
+ ],
28608
+ description: "soft-delete comments"
28609
+ }
28610
+ ]
28611
+ });
28612
+ const commentCmd = make$12("comment").pipe(withDescription(help$6.description), withSubcommands([
28613
+ list$5,
28614
+ unread,
28615
+ get$5,
28616
+ approve,
28617
+ reject,
27370
28618
  del$4
27371
28619
  ]));
27372
28620
  //#endregion
@@ -30226,7 +31474,8 @@ const renderPostListReadable = (data) => {
30226
31474
  const fields = collectListItemFields(doc);
30227
31475
  for (const [key, value] of fields) {
30228
31476
  if (value === void 0 || value === null || value === "") continue;
30229
- lines.push(`${key}: ${formatScalar(value)}`);
31477
+ const rendered = tryFormatTimestamp(value, { style: "rel" }) ?? formatScalar(value);
31478
+ lines.push(`${key}: ${rendered}`);
30230
31479
  }
30231
31480
  });
30232
31481
  return lines.join("\n");
@@ -30497,7 +31746,7 @@ const show = make$12("show", { name: text$3({ name: "name" }).pipe(optional$4) }
30497
31746
  const cfg = yield* config.readProfileConfig(target);
30498
31747
  const creds = yield* config.readProfileCredentials(target);
30499
31748
  const expiresAt = creds?.expires_at ?? null;
30500
- const expiresHuman = expiresAt !== null ? new Date(expiresAt).toISOString() : null;
31749
+ const expiresHuman = expiresAt !== null ? formatDateTime(expiresAt, { style: "both" }) : null;
30501
31750
  yield* renderer.emitSuccess({
30502
31751
  name: target,
30503
31752
  api_url: cfg.api_url ?? null,
@@ -32687,6 +33936,7 @@ const GROUP_NAMES = [
32687
33936
  "page",
32688
33937
  "category",
32689
33938
  "topic",
33939
+ "comment",
32690
33940
  "config",
32691
33941
  "update"
32692
33942
  ];
@@ -33289,6 +34539,7 @@ const rootCmd = make$12("mxs", {}, () => flatMap$1(Renderer, (r) => r.emitInfo("
33289
34539
  pageCmd,
33290
34540
  categoryCmd,
33291
34541
  topicCmd,
34542
+ commentCmd,
33292
34543
  configCmd,
33293
34544
  updateCmd
33294
34545
  ]));
@@ -33378,7 +34629,8 @@ const run = (argv) => {
33378
34629
  });
33379
34630
  const appWithHttp = AppLayer.pipe(provideMerge(httpLayer));
33380
34631
  const apiWithDeps = apiLayer.pipe(provideMerge(appWithHttp));
33381
- const fullAppLayer = Resolver.Default.pipe(provideMerge(apiWithDeps));
34632
+ const commentWithDeps = Comment.Default.pipe(provideMerge(apiWithDeps));
34633
+ const fullAppLayer = Resolver.Default.pipe(provideMerge(commentWithDeps));
33382
34634
  const cli = run$1(rootCmd, {
33383
34635
  name: "mxs",
33384
34636
  version: CLI_VERSION