@mx-space/cli 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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$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";
1
+ import { $ as drain, $a as identity, $i as reduce$1, $n as try_, $r as get$10, $t as either, A as compose, Aa as pipeArguments, Ai as empty$11, An as orElse$3, Ar as Scope, At as encodeSync, B as ensuring$1, Ba as cached, Bi as head$2, Bn as scope, Br as set$3, Bt as async, C as Number$, Ca as some, Ci as isConfigError, Cn as match$2, Ct as currentContext, D as String$, Da as left, Di as appendAll, Dn as onError, Dr as taggedEnum, Dt as unsafeMake, Ea as string$1, Ei as append$2, En as negate, Er as tagged, Et as get$14, Fa as redact$1, Fi as findFirstIndex, Fn as retry, Fr as isFailure, Ft as addFinalizer, G as mapError$1, Gi as join$1, Gn as suspend, Gr as updateAs, Gt as catchIf, H as fromChannel, Ha as hash, Hi as isArray$1, Hn as serviceFunctions, Hr as updateAndGet, Ht as catchAll, I as make$20, Ia as symbolRedactable, Ii as findLast, In as runFork$1, Ir as void_$1, It as all$4, J as splitLines, Ja as globalValue, Ji as match$1, Jn as tapError, Jr as cons$1, Jt as catchTags, K as run$5, Ka as isObject, Ki as make$21, Kn as sync, Kr as CommitPrototype, Kt as catchSome, L as isConfig, La as toStringUnknown, Li as flatMap$4, Ln as runPromise, Lr as ParentSpan, Lt as annotateLogs, M as decodeUnknown, Ma as Class, Mi as filter$2, Mn as provide$1, Mr as isInterrupted, Mt as _void, N as int, Na as NodeInspectSymbol, Ni as filterMap, Nn as provideService, Nr as isInterruptedOnly, Nt as acquireRelease, O as TaggedError, Oa as merge$1, Oi as contains, On as onInterrupt, Or as error$1, Ot as nominal, P as optional$7, Pa as format$3, Pi as findFirst, Pn as repeatN, Pr as fail$5, Pt as acquireUseRelease$1, Q as unwrapScoped, Qa as dual, Qi as prepend$1, Qn as tryPromise, Qr as fromIterable$2, Qt as dieMessage, R as asyncScoped, Ra as equals, Ri as fromIterable$1, Rn as runSync, Rr as get$9, Rt as as, S as Literal, Sa as orElse$2, Si as omit, Sn as mapInputContext, Sr as unsafeDone, St as succeed$3, Ta as mapInput, Ti as allocate, Tn as matchEffect, Tr as TaggedError$1, Tt as currentTracerEnabled, Ua as string, Ui as isEmptyReadonlyArray, Un as serviceOption, Ur as allLevels, Ut as catchAllCause, Va as combine$2, Vi as headNonEmpty, Vn as scoped, Vr as update$6, Vt as cached$1, W as mapChunks, Wa as symbol, Wi as isNonEmptyReadonlyArray, Wn as succeed$1, Wr as getOrDefault, Wt as catchAllDefect, X as transduce, Xa as constUndefined, Xi as matchRight, Xn as timeout, Xr as of$3, Xt as contextWithEffect, Y as suspend$1, Ya as constFalse, Yi as matchLeft, Yn as tapErrorCause, Yr as isNil, Yt as context, Z as unwrap$5, Za as constVoid, Zi as of$2, Zn as tryMap, Zr as empty$12, Zt as die, _ as fromString, _a as isOption, _i as Reference, _n as logError, _r as failCause$1, _t as effect, a as make$26, aa as tailNonEmpty, ai as add$1, an as filterOrDieMessage, ar as useSpan, at as embedInput, b as Defect, ba as match, bi as getOption, bn as mapBoth, br as make$25, bt as provideMerge, c as make$24, ci as remove$3, cn as fnUntraced, cr as withParentSpan, ct as fromEffect, d as defaultLogger, da as flatMap$3, di as map$10, dn as forkScoped, dr as zipRight, dt as write, ea as reduceRight, ei as has, en as ensuring, eo as pipe, er as uninterruptible, et as foldLeftChunks, f as prettyLoggerDefault, fa as fromNullable, fi as of$1, fn as gen, fr as zipWith, ft as spaced, g as when, ga as isNone, gi as GenericTag, gn as locally, gr as fail$4, gt as make$29, h as value$1, ha as getOrUndefined, hi as unsafeFromArray, hn as isEffect, hr as complete, ht as get$13, i as isMailbox, ia as splitAt, ii as make$28, in as filter$1, io as __toESM, ir as unsafeMakeSemaphore, it as acquireUseRelease, ja as BaseProto, ji as every, jn as orElseFail, jr as addFinalizer$1, jt as is$2, k as Union, ka as right, ki as drop, kn as orDie, kr as log, kt as decodeSync, l as updateEffect, la as map$9, li as seconds, ln as forEach$1, lr as zip, lt as suspend$2, m as orElse$1, ma as getOrThrow, mi as toArray, mn as interruptible, mr as _await, mt as updateContext, n as make$27, na as sort$2, ni as make$23, nn as failCause, no as __exportAll, nr as unlessEffect, nt as fromChannel$1, o as toChannel, oa as take, oi as fromIterable$3, on as flatMap$1, or as when$1, ot as ensuring$2, p as withMinimumLogLevel, pa as getOrElse, pi as reduce$2, pn as ignore, pr as DeferredTypeId, pt as runFork, q as runCollect, qa as isTagged, qi as map$7, qn as tap, qr as round, qt as catchTag, r as unsafeAdd, ra as span, ri as set$2, rn as failSync, ro as __require, rr as unsafeMakeLatch, rt as unwrapScoped$1, s as get$11, sa as unsafeGet, si as has$1, sn as flatten$3, sr as withFiberRuntime, st as flatMap$2, t as join$2, ta as some$1, ti as isEmpty$5, tn as fail$2, to as __commonJSMin, tr as uninterruptibleMask, tt as forEach, u as unify, ua as filter$3, ui as appendAll$1, un as forkDaemon, ur as zipLeft, ut as void_, v as Cause, va as isSome, vi as Tag$2, vn as logWarning, vr as interrupt, vt as mergeAll, w as NumberFromString, wa as boolean$3, wi as isMissingDataOnly, wn as matchCauseEffect, wr as Error$1, wt as currentLoggers, x as Int, xa as none$3, xi as merge$2, xn as mapError, xr as succeed$2, xt as scoped$1, y as Date$, ya as map$8, yi as get$12, yn as map$6, yr as isDone, yt as provide, z as bufferChunks, za as symbol$1, zi as getSomes, zn as runtime, zr as make$22, zt as asVoid } from "./esm-CK9m5JKX.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";
@@ -24,7 +24,7 @@ import * as ChildProcess from "node:child_process";
24
24
  import childProcess, { execFile, spawn } from "node:child_process";
25
25
  import * as readline from "node:readline";
26
26
  import E from "node:readline";
27
- import process$1, { stdin, stdout } from "node:process";
27
+ import V, { stdin, stdout } from "node:process";
28
28
  import "node:tty";
29
29
  //#region ../../node_modules/.pnpm/@effect+platform@0.96.1_effect@3.21.2/node_modules/@effect/platform/dist/esm/Error.js
30
30
  /**
@@ -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, {
@@ -9042,7 +9042,7 @@ function isInsideContainer() {
9042
9042
  //#endregion
9043
9043
  //#region ../../node_modules/.pnpm/is-wsl@3.1.1/node_modules/is-wsl/index.js
9044
9044
  const isWsl = () => {
9045
- if (process$1.platform !== "linux") return false;
9045
+ if (V.platform !== "linux") return false;
9046
9046
  if (os.release().toLowerCase().includes("microsoft")) {
9047
9047
  if (isInsideContainer()) return false;
9048
9048
  return true;
@@ -9053,11 +9053,11 @@ const isWsl = () => {
9053
9053
  if (fs.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || fs.existsSync("/run/WSL")) return !isInsideContainer();
9054
9054
  return false;
9055
9055
  };
9056
- var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
9056
+ var is_wsl_default = V.env.__IS_WSL_TEST__ ? isWsl : isWsl();
9057
9057
  //#endregion
9058
9058
  //#region ../../node_modules/.pnpm/powershell-utils@0.1.0/node_modules/powershell-utils/index.js
9059
9059
  const execFile$2 = promisify(childProcess.execFile);
9060
- const powerShellPath$1 = () => `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
9060
+ const powerShellPath$1 = () => `${V.env.SYSTEMROOT || V.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
9061
9061
  const executePowerShell = async (command, options = {}) => {
9062
9062
  const { powerShellPath: psPath, ...execFileOptions } = options;
9063
9063
  const encodedCommand = executePowerShell.encodeCommand(command);
@@ -9164,7 +9164,7 @@ function defineLazyProperty(object, propertyName, valueGetter) {
9164
9164
  //#region ../../node_modules/.pnpm/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
9165
9165
  const execFileAsync$3 = promisify(execFile);
9166
9166
  async function defaultBrowserId() {
9167
- if (process$1.platform !== "darwin") throw new Error("macOS only");
9167
+ if (V.platform !== "darwin") throw new Error("macOS only");
9168
9168
  const { stdout } = await execFileAsync$3("defaults", [
9169
9169
  "read",
9170
9170
  "com.apple.LaunchServices/com.apple.launchservices.secure",
@@ -9178,7 +9178,7 @@ async function defaultBrowserId() {
9178
9178
  //#region ../../node_modules/.pnpm/run-applescript@7.1.0/node_modules/run-applescript/index.js
9179
9179
  const execFileAsync$2 = promisify(execFile);
9180
9180
  async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
9181
- if (process$1.platform !== "darwin") throw new Error("macOS only");
9181
+ if (V.platform !== "darwin") throw new Error("macOS only");
9182
9182
  const outputArguments = humanReadableOutput ? [] : ["-ss"];
9183
9183
  const execOptions = {};
9184
9184
  if (signal) execOptions.signal = signal;
@@ -9289,14 +9289,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
9289
9289
  const execFileAsync = promisify(execFile);
9290
9290
  const titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
9291
9291
  async function defaultBrowser() {
9292
- if (process$1.platform === "darwin") {
9292
+ if (V.platform === "darwin") {
9293
9293
  const id = await defaultBrowserId();
9294
9294
  return {
9295
9295
  name: await bundleName(id),
9296
9296
  id
9297
9297
  };
9298
9298
  }
9299
- if (process$1.platform === "linux") {
9299
+ if (V.platform === "linux") {
9300
9300
  const { stdout } = await execFileAsync("xdg-mime", [
9301
9301
  "query",
9302
9302
  "default",
@@ -9308,18 +9308,18 @@ async function defaultBrowser() {
9308
9308
  id
9309
9309
  };
9310
9310
  }
9311
- if (process$1.platform === "win32") return defaultBrowser$1();
9311
+ if (V.platform === "win32") return defaultBrowser$1();
9312
9312
  throw new Error("Only macOS, Linux, and Windows are supported");
9313
9313
  }
9314
9314
  //#endregion
9315
9315
  //#region ../../node_modules/.pnpm/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
9316
- const isInSsh = Boolean(process$1.env.SSH_CONNECTION || process$1.env.SSH_CLIENT || process$1.env.SSH_TTY);
9316
+ const isInSsh = Boolean(V.env.SSH_CONNECTION || V.env.SSH_CLIENT || V.env.SSH_TTY);
9317
9317
  //#endregion
9318
9318
  //#region ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
9319
9319
  const fallbackAttemptSymbol = Symbol("fallbackAttempt");
9320
9320
  const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
9321
9321
  const localXdgOpenPath = path.join(__dirname, "xdg-open");
9322
- const { platform: platform$1, arch: arch$1 } = process$1;
9322
+ const { platform: platform$1, arch: arch$1 } = V;
9323
9323
  const tryEachApp = async (apps, opener) => {
9324
9324
  if (apps.length === 0) return;
9325
9325
  const errors = [];
@@ -9432,7 +9432,7 @@ const baseOpen = async (options) => {
9432
9432
  await fs$1.access(localXdgOpenPath, constants.X_OK);
9433
9433
  exeLocalXdgOpen = true;
9434
9434
  } catch {}
9435
- command = process$1.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
9435
+ command = V.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
9436
9436
  }
9437
9437
  if (appArguments.length > 0) cliArguments.push(...appArguments);
9438
9438
  if (!options.wait) {
@@ -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);
@@ -10882,7 +10882,7 @@ var ht$1 = class extends m {
10882
10882
  //#endregion
10883
10883
  //#region ../../node_modules/.pnpm/@clack+prompts@1.4.0/node_modules/@clack/prompts/dist/index.mjs
10884
10884
  function ee() {
10885
- return process$1.platform !== "win32" ? process$1.env.TERM !== "linux" : !!process$1.env.CI || !!process$1.env.WT_SESSION || !!process$1.env.TERMINUS_SUBLIME || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
10885
+ return V.platform !== "win32" ? V.env.TERM !== "linux" : !!V.env.CI || !!V.env.WT_SESSION || !!V.env.TERMINUS_SUBLIME || V.env.ConEmuTask === "{cmd::Cmder}" || V.env.TERM_PROGRAM === "Terminus-Sublime" || V.env.TERM_PROGRAM === "vscode" || V.env.TERM === "xterm-256color" || V.env.TERM === "alacritty" || V.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
10886
10886
  }
10887
10887
  const tt = ee(), w = (t, i) => tt ? t : i, Tt = w("◆", "*"), at = w("■", "x"), ut = w("▲", "x"), H = w("◇", "o");
10888
10888
  const $ = w("│", "|"), x = w("└", "—");
@@ -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;
@@ -24093,6 +24777,15 @@ const unwrapDocument = (data) => {
24093
24777
  if (nested && typeof nested === "object" && !Array.isArray(nested)) return nested;
24094
24778
  return data;
24095
24779
  };
24780
+ const pickArticleTranslationMeta = (payload, docId) => {
24781
+ const translation = asRecord(asRecord(asRecord(payload).meta).translation);
24782
+ if (Object.keys(translation).length === 0) return void 0;
24783
+ const direct = asRecord(translation.article);
24784
+ if (Object.keys(direct).length > 0) return direct;
24785
+ if (docId === void 0 || docId === null) return void 0;
24786
+ const article = asRecord(asRecord(translation[String(docId)]).article);
24787
+ return Object.keys(article).length > 0 ? article : void 0;
24788
+ };
24096
24789
  let cachedRegistry$1 = null;
24097
24790
  const getRegistry$1 = () => {
24098
24791
  if (!cachedRegistry$1) cachedRegistry$1 = createDefaultRegistry();
@@ -26869,6 +27562,90 @@ const authCmd = make$12("auth").pipe(withDescription(help$8.description), withSu
26869
27562
  status
26870
27563
  ]));
26871
27564
  //#endregion
27565
+ //#region src/domain/envelope-compat.ts
27566
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
27567
+ /**
27568
+ * Sniff the wire version from a parsed response body. Returns `null` if the
27569
+ * body is too small (raw scalar, FormData echo, dry-run synthetic) to decide.
27570
+ * Callers must tolerate `null`.
27571
+ *
27572
+ * V3 markers (any one suffices):
27573
+ * - object has a `meta` key, OR
27574
+ * - object has `error.code` (string) or `error.message` (string).
27575
+ *
27576
+ * V2 markers (any one):
27577
+ * - object has a root-level `pagination` key, OR
27578
+ * - object has a root-level `message: string | string[]` and no `error` key.
27579
+ *
27580
+ * When both V2 and V3 markers are present, V3 wins.
27581
+ */
27582
+ const detectWireVersion = (body) => {
27583
+ if (!isRecord(body)) return null;
27584
+ if ("meta" in body) return "v3";
27585
+ if (isRecord(body.error)) {
27586
+ const err = body.error;
27587
+ if (typeof err.code === "string" || typeof err.message === "string") return "v3";
27588
+ }
27589
+ if ("pagination" in body) return "v2";
27590
+ if (!("error" in body) && (typeof body.message === "string" || Array.isArray(body.message) && body.message.every((m) => typeof m === "string"))) return "v2";
27591
+ return null;
27592
+ };
27593
+ /**
27594
+ * Normalize a 2xx response body to the V3 shape `{ data, meta? }`.
27595
+ *
27596
+ * - V3 (`{ data, meta? }`) → returned as-is
27597
+ * - V2 paginated (`{ data, pagination }`) → `{ data, meta: { pagination } }`
27598
+ * - V2 bare (`{ data }`) → returned as-is
27599
+ * - Anything else (arrays, scalars, non-object, already-unwrapped doc) → unchanged
27600
+ *
27601
+ * Shape-tolerant: unrecognized inputs pass through unchanged. Never mutates
27602
+ * the input.
27603
+ */
27604
+ const normalizeSuccessBody = (body) => {
27605
+ if (!isRecord(body)) return body;
27606
+ if ("meta" in body) return body;
27607
+ if ("data" in body && "pagination" in body) {
27608
+ const { pagination, ...rest } = body;
27609
+ return {
27610
+ ...rest,
27611
+ meta: { pagination }
27612
+ };
27613
+ }
27614
+ return body;
27615
+ };
27616
+ /**
27617
+ * Normalize a non-2xx response body to a flat `{ code?, message?, details? }`
27618
+ * tuple.
27619
+ *
27620
+ * - V3 (`{ error: { code, message, details? } }`) → unwrapped
27621
+ * - V2 (`{ message: string | string[], code?, details? }`) → flattened.
27622
+ * Array messages join with `'; '` to match the legacy `extractMessage`
27623
+ * helper in `api-envelope.ts`.
27624
+ * - Non-object body → `{}`
27625
+ *
27626
+ * Never throws, never mutates.
27627
+ */
27628
+ const normalizeErrorBody = (body) => {
27629
+ if (!isRecord(body)) return {};
27630
+ if (isRecord(body.error)) {
27631
+ const err = body.error;
27632
+ return {
27633
+ code: typeof err.code === "string" ? err.code : void 0,
27634
+ message: typeof err.message === "string" ? err.message : void 0,
27635
+ details: err.details
27636
+ };
27637
+ }
27638
+ const rawMsg = body.message;
27639
+ let message;
27640
+ if (typeof rawMsg === "string") message = rawMsg;
27641
+ else if (Array.isArray(rawMsg) && rawMsg.every((m) => typeof m === "string")) message = rawMsg.join("; ");
27642
+ return {
27643
+ code: typeof body.code === "string" ? body.code : void 0,
27644
+ message,
27645
+ details: body.details
27646
+ };
27647
+ };
27648
+ //#endregion
26872
27649
  //#region src/domain/gate.ts
26873
27650
  const SAFE_METHODS = new Set([
26874
27651
  "GET",
@@ -26887,38 +27664,6 @@ const decideWriteGate = (resolved, method) => {
26887
27664
  hint: `active profile '${name}' is production; retry with --profile ${name} or MXS_PROFILE=${name}`
26888
27665
  };
26889
27666
  };
26890
- Struct({
26891
- ok: Literal(false),
26892
- code: String$,
26893
- message: String$,
26894
- details: optional$7(Unknown),
26895
- hint: optional$7(String$)
26896
- });
26897
- Struct({
26898
- page: optional$7(Number$),
26899
- size: optional$7(Number$),
26900
- total: optional$7(Number$),
26901
- totalPage: optional$7(Number$),
26902
- currentPage: optional$7(Number$),
26903
- pageSize: optional$7(Number$),
26904
- totalCount: optional$7(Number$)
26905
- });
26906
- Struct({
26907
- message: optional$7(Union(String$, Array$(String$))),
26908
- code: optional$7(String$),
26909
- details: optional$7(Unknown)
26910
- });
26911
- /**
26912
- * Extract a flattened `message` string from an arbitrary error body,
26913
- * matching the legacy `extractMessage` helper in `api-client.ts`.
26914
- */
26915
- const extractServerMessage = (body) => {
26916
- if (!body || typeof body !== "object") return null;
26917
- const msg = body.message;
26918
- if (typeof msg === "string") return msg;
26919
- if (Array.isArray(msg) && typeof msg[0] === "string") return msg.join("; ");
26920
- return null;
26921
- };
26922
27667
  //#endregion
26923
27668
  //#region src/domain/version.ts
26924
27669
  const requireFrom$2 = createRequire(import.meta.url);
@@ -26964,6 +27709,7 @@ var Api = class Api extends Tag$2("Api")() {
26964
27709
  function makeApiService(http, config, auth, opts) {
26965
27710
  return gen(function* () {
26966
27711
  const bannerEmitted = yield* make$22(false);
27712
+ const detectedWire = yield* make$22(null);
26967
27713
  /**
26968
27714
  * Resolved config is cached per `ApiService` instance. This matches
26969
27715
  * today's `ApiClient` which is constructed once per command run.
@@ -27065,9 +27811,19 @@ function makeApiService(http, config, auth, opts) {
27065
27811
  }
27066
27812
  }
27067
27813
  const body = yield* parseBody(res);
27814
+ if (opts.verbose) {
27815
+ if (!(yield* get$9(detectedWire))) {
27816
+ const sniffed = detectWireVersion(body);
27817
+ if (sniffed) {
27818
+ yield* set$3(detectedWire, sniffed);
27819
+ process.stderr.write(`mxs: detected wire version: ${sniffed}\n`);
27820
+ }
27821
+ }
27822
+ }
27068
27823
  if (res.status >= 200 && res.status < 300) {
27069
- if (!options.schema) return body;
27070
- return yield* decodeWithSchema(options.schema, body);
27824
+ const normalized = normalizeSuccessBody(body);
27825
+ if (!options.schema) return normalized;
27826
+ return yield* decodeWithSchema(options.schema, normalized);
27071
27827
  }
27072
27828
  return yield* fail$2(mapHttpStatusToError(res.status, body));
27073
27829
  });
@@ -27093,7 +27849,7 @@ function parseBody(res) {
27093
27849
  function decodeWithSchema(schema, body) {
27094
27850
  return tryPromise({
27095
27851
  try: async () => {
27096
- const { Schema: SchemaMod } = await import("./esm-BKxzBG1f.mjs");
27852
+ const { Schema: SchemaMod } = await import("./esm-DRbkkY3r.mjs");
27097
27853
  return SchemaMod.decodeUnknownPromise(schema)(body);
27098
27854
  },
27099
27855
  catch: (err) => new ServerError({
@@ -27111,31 +27867,41 @@ function serializeParseError(err) {
27111
27867
  return err;
27112
27868
  }
27113
27869
  function mapHttpStatusToError(status, body) {
27870
+ const { code, message: serverMsg, details: serverDetails } = normalizeErrorBody(body);
27871
+ const details = serverDetails ?? body;
27872
+ if (code === "NOT_FOUND" || code?.endsWith("_NOT_FOUND")) return new ResourceNotFound({
27873
+ message: serverMsg ?? "resource not found",
27874
+ details
27875
+ });
27876
+ if (code === "VALIDATION_FAILED") return new ValidationFailed({
27877
+ message: serverMsg ?? "validation failed",
27878
+ details
27879
+ });
27114
27880
  if (status === 401) return new AuthExpired({
27115
- message: "authentication required",
27881
+ message: serverMsg ?? "authentication required",
27116
27882
  hint: "run `mxs auth login`",
27117
- details: body
27883
+ details
27118
27884
  });
27119
27885
  if (status === 403) return new AuthDenied({
27120
- message: "permission denied",
27121
- details: body
27886
+ message: serverMsg ?? "permission denied",
27887
+ details
27122
27888
  });
27123
27889
  if (status === 404) return new ResourceNotFound({
27124
- message: "resource not found",
27125
- details: body
27890
+ message: serverMsg ?? "resource not found",
27891
+ details
27126
27892
  });
27127
27893
  if (status === 400 || status === 422) return new ValidationFailed({
27128
- message: extractServerMessage(body) ?? "validation failed",
27129
- details: body
27894
+ message: serverMsg ?? "validation failed",
27895
+ details
27130
27896
  });
27131
27897
  if (status >= 500) return new ServerError({
27132
27898
  status,
27133
- message: extractServerMessage(body) ?? `server error (${status})`,
27134
- details: body
27899
+ message: serverMsg ?? `server error (${status})`,
27900
+ details
27135
27901
  });
27136
27902
  return new Generic({
27137
- message: extractServerMessage(body) ?? `request failed (${status})`,
27138
- details: body
27903
+ message: serverMsg ?? `request failed (${status})`,
27904
+ details
27139
27905
  });
27140
27906
  }
27141
27907
  function mapTransportError(err, url) {
@@ -27740,17 +28506,17 @@ const commentView = {
27740
28506
  llm: (data) => renderCommentLlm(data)
27741
28507
  };
27742
28508
  const renderListHeader = (payload, rowCount, color) => {
27743
- const pagination = asRecord(first(payload, "pagination"));
28509
+ const pagination = asRecord(first(asRecord(first(payload, "meta")), "pagination"));
27744
28510
  const page = first(pagination, "page", "currentPage");
27745
28511
  const size = first(pagination, "size", "pageSize");
27746
- const total = first(pagination, "total", "totalCount");
27747
- const meta = [`count: ${rowCount}`];
27748
- if (page !== void 0) meta.push(`page: ${formatScalar(page)}`);
27749
- if (size !== void 0) meta.push(`size: ${formatScalar(size)}`);
27750
- if (total !== void 0) meta.push(`total: ${formatScalar(total)}`);
28512
+ const total = first(pagination, "total", "totalCount", "total_count");
28513
+ const headerParts = [`count: ${rowCount}`];
28514
+ if (page !== void 0) headerParts.push(`page: ${formatScalar(page)}`);
28515
+ if (size !== void 0) headerParts.push(`size: ${formatScalar(size)}`);
28516
+ if (total !== void 0) headerParts.push(`total: ${formatScalar(total)}`);
27751
28517
  const heading = wrap(ANSI.bold, "Comments", color);
27752
28518
  const ruleLen = Math.min(Math.max(visibleLen("Comments"), 24), 64);
27753
- return `${heading}\n${wrap(ANSI.dim, "─".repeat(ruleLen), color)}\n${wrap(ANSI.dim, meta.join(" · "), color)}`;
28519
+ return `${heading}\n${wrap(ANSI.dim, "─".repeat(ruleLen), color)}\n${wrap(ANSI.dim, headerParts.join(" · "), color)}`;
27754
28520
  };
27755
28521
  const renderListItem = (doc, index, color) => {
27756
28522
  const author = authorOf(doc);
@@ -30007,7 +30773,8 @@ const edit$2 = make$12("edit", {
30007
30773
  //#endregion
30008
30774
  //#region src/cli/note/view.ts
30009
30775
  const normalize$2 = (data) => asRecord(unwrapDocument(data));
30010
- const collectFields$2 = (doc) => {
30776
+ const collectFields$2 = (doc, articleMeta) => {
30777
+ const meta = articleMeta ?? {};
30011
30778
  return [
30012
30779
  ["id", first(doc, "id")],
30013
30780
  ["slug", first(doc, "slug")],
@@ -30020,8 +30787,8 @@ const collectFields$2 = (doc) => {
30020
30787
  ["bookmark", first(doc, "bookmark")],
30021
30788
  ["created_at", first(doc, "created_at", "createdAt")],
30022
30789
  ["modified_at", first(doc, "modified_at", "modifiedAt")],
30023
- ["source_lang", first(doc, "source_lang", "sourceLang")],
30024
- ["translated", first(doc, "is_translated", "isTranslated")]
30790
+ ["source_lang", first(doc, "source_lang", "sourceLang") ?? first(meta, "source_lang", "sourceLang")],
30791
+ ["translated", first(doc, "is_translated", "isTranslated") ?? first(meta, "is_translated", "isTranslated")]
30025
30792
  ].filter(([key, value]) => value !== void 0 && value !== null && value !== "" && !(key === "translated" && value === false));
30026
30793
  };
30027
30794
  const collectEnvelopeMeta$2 = (doc) => [
@@ -30050,11 +30817,12 @@ const noteView = {
30050
30817
  ]),
30051
30818
  readable: (data, ctx) => {
30052
30819
  const doc = normalize$2(data);
30820
+ const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
30053
30821
  const content = renderContent(doc);
30054
30822
  return renderMetadataBlock({
30055
30823
  title: firstString(doc, "title") || void 0,
30056
30824
  kind: "note",
30057
- fields: collectFields$2(doc),
30825
+ fields: collectFields$2(doc, articleMeta),
30058
30826
  summary: pickSummary$2(doc),
30059
30827
  body: content.body || void 0,
30060
30828
  bodyFormat: content.format
@@ -30062,10 +30830,11 @@ const noteView = {
30062
30830
  },
30063
30831
  llm: (data) => {
30064
30832
  const doc = normalize$2(data);
30833
+ const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
30065
30834
  const content = renderContent(doc, true);
30066
30835
  const fm = frontmatter({
30067
30836
  title: firstString(doc, "title") || void 0,
30068
- fields: collectFields$2(doc),
30837
+ fields: collectFields$2(doc, articleMeta),
30069
30838
  summary: pickSummary$2(doc)
30070
30839
  });
30071
30840
  return content.body ? `${fm}\n\n${content.body}` : fm;
@@ -30397,7 +31166,8 @@ const edit$1 = make$12("edit", {
30397
31166
  //#endregion
30398
31167
  //#region src/cli/page/view.ts
30399
31168
  const normalize$1 = (data) => asRecord(unwrapDocument(data));
30400
- const collectFields$1 = (doc) => {
31169
+ const collectFields$1 = (doc, articleMeta) => {
31170
+ const meta = articleMeta ?? {};
30401
31171
  return [
30402
31172
  ["id", first(doc, "id")],
30403
31173
  ["slug", first(doc, "slug")],
@@ -30405,8 +31175,8 @@ const collectFields$1 = (doc) => {
30405
31175
  ["order", first(doc, "order")],
30406
31176
  ["created_at", first(doc, "created_at", "createdAt")],
30407
31177
  ["modified_at", first(doc, "modified_at", "modifiedAt")],
30408
- ["source_lang", first(doc, "source_lang", "sourceLang")],
30409
- ["translated", first(doc, "is_translated", "isTranslated")]
31178
+ ["source_lang", first(doc, "source_lang", "sourceLang") ?? first(meta, "source_lang", "sourceLang")],
31179
+ ["translated", first(doc, "is_translated", "isTranslated") ?? first(meta, "is_translated", "isTranslated")]
30410
31180
  ].filter(([key, value]) => value !== void 0 && value !== null && value !== "" && !(key === "translated" && value === false));
30411
31181
  };
30412
31182
  const collectEnvelopeMeta$1 = (doc) => [
@@ -30430,11 +31200,12 @@ const pageView = {
30430
31200
  ]),
30431
31201
  readable: (data, ctx) => {
30432
31202
  const doc = normalize$1(data);
31203
+ const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
30433
31204
  const content = renderContent(doc);
30434
31205
  return renderMetadataBlock({
30435
31206
  title: firstString(doc, "title") || void 0,
30436
31207
  kind: "page",
30437
- fields: collectFields$1(doc),
31208
+ fields: collectFields$1(doc, articleMeta),
30438
31209
  summary: pickSummary$1(doc),
30439
31210
  body: content.body || void 0,
30440
31211
  bodyFormat: content.format
@@ -30442,10 +31213,11 @@ const pageView = {
30442
31213
  },
30443
31214
  llm: (data) => {
30444
31215
  const doc = normalize$1(data);
31216
+ const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
30445
31217
  const content = renderContent(doc, true);
30446
31218
  const fm = frontmatter({
30447
31219
  title: firstString(doc, "title") || void 0,
30448
- fields: collectFields$1(doc),
31220
+ fields: collectFields$1(doc, articleMeta),
30449
31221
  summary: pickSummary$1(doc)
30450
31222
  });
30451
31223
  return content.body ? `${fm}\n\n${content.body}` : fm;
@@ -30691,7 +31463,8 @@ const edit = make$12("edit", {
30691
31463
  //#endregion
30692
31464
  //#region src/cli/post/view.ts
30693
31465
  const normalize = (data) => asRecord(unwrapDocument(data));
30694
- const collectFields = (doc) => {
31466
+ const collectFields = (doc, articleMeta) => {
31467
+ const meta = articleMeta ?? {};
30695
31468
  return [
30696
31469
  ["id", first(doc, "id")],
30697
31470
  ["slug", first(doc, "slug")],
@@ -30701,8 +31474,8 @@ const collectFields = (doc) => {
30701
31474
  ["pin", first(doc, "pin")],
30702
31475
  ["created_at", first(doc, "created_at", "createdAt")],
30703
31476
  ["modified_at", first(doc, "modified_at", "modifiedAt")],
30704
- ["source_lang", first(doc, "source_lang", "sourceLang")],
30705
- ["translated", first(doc, "is_translated", "isTranslated")]
31477
+ ["source_lang", first(doc, "source_lang", "sourceLang") ?? first(meta, "source_lang", "sourceLang")],
31478
+ ["translated", first(doc, "is_translated", "isTranslated") ?? first(meta, "is_translated", "isTranslated")]
30706
31479
  ].filter(([key, value]) => value !== void 0 && value !== null && value !== "" && !(key === "translated" && value === false));
30707
31480
  };
30708
31481
  const collectEnvelopeMeta = (doc) => [
@@ -30728,11 +31501,12 @@ const postView = {
30728
31501
  ]),
30729
31502
  readable: (data, ctx) => {
30730
31503
  const doc = normalize(data);
31504
+ const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
30731
31505
  const content = renderContent(doc);
30732
31506
  return renderMetadataBlock({
30733
31507
  title: firstString(doc, "title") || void 0,
30734
31508
  kind: "post",
30735
- fields: collectFields(doc),
31509
+ fields: collectFields(doc, articleMeta),
30736
31510
  summary: pickSummary(doc),
30737
31511
  body: content.body || void 0,
30738
31512
  bodyFormat: content.format
@@ -30740,10 +31514,11 @@ const postView = {
30740
31514
  },
30741
31515
  llm: (data) => {
30742
31516
  const doc = normalize(data);
31517
+ const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
30743
31518
  const content = renderContent(doc, true);
30744
31519
  const fm = frontmatter({
30745
31520
  title: firstString(doc, "title") || void 0,
30746
- fields: collectFields(doc),
31521
+ fields: collectFields(doc, articleMeta),
30747
31522
  summary: pickSummary(doc)
30748
31523
  });
30749
31524
  return content.body ? `${fm}\n\n${content.body}` : fm;
@@ -30758,36 +31533,40 @@ const postView = {
30758
31533
  });
30759
31534
  }
30760
31535
  };
30761
- const collectListItemFields = (doc) => [
30762
- ["id", first(doc, "id")],
30763
- ["title", first(doc, "title")],
30764
- ["slug", first(doc, "slug")],
30765
- ["state", publishState(doc)],
30766
- ["category", relationLabel(first(doc, "category"))],
30767
- ["tags", first(doc, "tags")],
30768
- ["summary", first(doc, "summary")],
30769
- ["created_at", first(doc, "created_at", "createdAt")],
30770
- ["modified_at", first(doc, "modified_at", "modifiedAt")],
30771
- ["source_lang", first(doc, "source_lang", "sourceLang")],
30772
- ["translated", first(doc, "is_translated", "isTranslated")]
30773
- ];
31536
+ const collectListItemFields = (doc, articleMeta) => {
31537
+ const meta = articleMeta ?? {};
31538
+ return [
31539
+ ["id", first(doc, "id")],
31540
+ ["title", first(doc, "title")],
31541
+ ["slug", first(doc, "slug")],
31542
+ ["state", publishState(doc)],
31543
+ ["category", relationLabel(first(doc, "category"))],
31544
+ ["tags", first(doc, "tags")],
31545
+ ["summary", first(doc, "summary")],
31546
+ ["created_at", first(doc, "created_at", "createdAt")],
31547
+ ["modified_at", first(doc, "modified_at", "modifiedAt")],
31548
+ ["source_lang", first(doc, "source_lang", "sourceLang") ?? first(meta, "source_lang", "sourceLang")],
31549
+ ["translated", first(doc, "is_translated", "isTranslated") ?? first(meta, "is_translated", "isTranslated")]
31550
+ ];
31551
+ };
30774
31552
  const renderPostListReadable = (data) => {
30775
31553
  const payload = asRecord(data);
30776
31554
  const rows = Array.isArray(payload.data) ? payload.data : Array.isArray(data) ? data : [];
30777
- const pagination = asRecord(first(payload, "pagination"));
31555
+ const pagination = asRecord(first(asRecord(first(payload, "meta")), "pagination"));
30778
31556
  const lines = ["posts"];
30779
31557
  if (rows.length > 0) lines.push(`count: ${rows.length}`);
30780
31558
  else lines.push("count: 0");
30781
31559
  const page = first(pagination, "page", "currentPage");
30782
31560
  const size = first(pagination, "size", "pageSize");
30783
- const total = first(pagination, "total", "totalCount");
31561
+ const total = first(pagination, "total", "totalCount", "total_count");
30784
31562
  if (page !== void 0) lines.push(`page: ${formatScalar(page)}`);
30785
31563
  if (size !== void 0) lines.push(`size: ${formatScalar(size)}`);
30786
31564
  if (total !== void 0) lines.push(`total: ${formatScalar(total)}`);
30787
31565
  rows.forEach((row, index) => {
30788
31566
  const doc = asRecord(row);
31567
+ const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
30789
31568
  lines.push("", `post ${index + 1}:`);
30790
- const fields = collectListItemFields(doc);
31569
+ const fields = collectListItemFields(doc, articleMeta);
30791
31570
  for (const [key, value] of fields) {
30792
31571
  if (value === void 0 || value === null || value === "") continue;
30793
31572
  const rendered = tryFormatTimestamp(value, { style: "rel" }) ?? formatScalar(value);