@mx-space/cli 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/mxs.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { t as run } from "../mxs-BR5Y5ash.mjs";
2
+ import { t as run } from "../mxs-BNvfyLLp.mjs";
3
3
  export { run };
@@ -0,0 +1,2 @@
1
+ import { E as Schema_exports } from "./esm-eihI6wbY.mjs";
2
+ export { Schema_exports as Schema };
@@ -37649,4 +37649,4 @@ const unsafeAdd = /*#__PURE__*/ dual((args) => isFiberSet(args[0]), (self, fiber
37649
37649
  */
37650
37650
  const join = (self) => _await(self.deferred);
37651
37651
  //#endregion
37652
- export { drain as $, identity as $a, reduce$7 as $i, try_ as $n, get$9 as $r, either$1 as $t, compose as A, pipeArguments as Aa, empty$26 as Ai, orElse$3 as An, Scope as Ar, encodeSync as At, ensuring as B, cached$1 as Ba, head$2 as Bi, scope as Bn, set$2 as Br, async as Bt, Number$ as C, some$1 as Ca, isConfigError as Ci, match$2 as Cn, Equivalence$2 as Cr, currentContext as Ct, String$ as D, left as Da, appendAll$2 as Di, onError as Dn, taggedEnum as Dr, unsafeMake$3 as Dt, Schema_exports as E, string$2 as Ea, append$2 as Ei, negate as En, tagged as Er, get$3 as Et, transform as F, redact as Fa, findFirstIndex as Fi, retry as Fn, isFailure as Fr, addFinalizer as Ft, mapError as G, hasProperty as Ga, join$3 as Gi, suspend$6 as Gn, updateAs as Gr, catchIf as Gt, fromChannel as H, hash as Ha, isArray as Hi, serviceFunctions as Hn, updateAndGet as Hr, catchAll as Ht, make$5 as I, symbolRedactable as Ia, findLast as Ii, runFork$1 as In, void_$2 as Ir, all as It, splitLines as J, globalValue as Ja, match$8 as Ji, tapError as Jn, cons as Jr, catchTags as Jt, run as K, isObject as Ka, make$48 as Ki, sync$1 as Kn, CommitPrototype as Kr, catchSome as Kt, isConfig as L, toStringUnknown as La, flatMap$8 as Li, runPromise as Ln, ParentSpan as Lr, annotateLogs as Lt, decodeUnknown as M, Class$5 as Ma, filter$4 as Mi, provide$1 as Mn, isInterrupted as Mr, _void as Mt, int as N, NodeInspectSymbol as Na, filterMap as Ni, provideService as Nn, isInterruptedOnly as Nr, acquireRelease as Nt, TaggedError as O, merge$3 as Oa, contains as Oi, onInterrupt as On, error as Or, nominal as Ot, optional as P, format$4 as Pa, findFirst$1 as Pi, repeatN as Pn, fail$7 as Pr, acquireUseRelease$2 as Pt, unwrapScoped as Q, dual as Qa, prepend$2 as Qi, tryPromise as Qn, fromIterable$5 as Qr, dieMessage as Qt, asyncScoped as R, equals$3 as Ra, fromIterable$10 as Ri, runSync as Rn, get$5 as Rr, as as Rt, Literal as S, orElse$5 as Sa, omit$3 as Si, mapInputContext as Sn, unsafeDone as Sr, succeed$1 as St, Record as T, mapInput as Ta, allocate as Ti, matchEffect as Tn, TaggedError$1 as Tr, currentTracerEnabled as Tt, fromReadableStream as U, string$3 as Ua, isEmptyReadonlyArray as Ui, serviceOption as Un, allLevels as Ur, catchAllCause$1 as Ut, fail as V, combine$7 as Va, headNonEmpty$2 as Vi, scoped$3 as Vn, update$1 as Vr, cached as Vt, mapChunks as W, symbol$1 as Wa, isNonEmptyReadonlyArray as Wi, succeed$3 as Wn, getOrDefault as Wr, catchAllDefect as Wt, transduce as X, constUndefined as Xa, matchRight as Xi, timeout as Xn, of as Xr, contextWithEffect as Xt, suspend$1 as Y, constFalse as Ya, matchLeft as Yi, tapErrorCause as Yn, isNil as Yr, context as Yt, unwrap as Z, constVoid as Za, of$2 as Zi, tryMap as Zn, empty$19 as Zr, die as Zt, fromString as _, isOption as _a, Reference as _i, logError as _n, failCause$3 as _r, effect$1 as _t, make$1 as a, tailNonEmpty$1 as aa, add as ai, filterOrDieMessage as an, useSpan as ar, embedInput as at, Defect as b, match$9 as ba, getOption$1 as bi, mapBoth$1 as bn, make$15 as br, provideMerge as bt, defaultLogger as c, getEquivalence$5 as ca, remove$1 as ci, fnUntraced as cn, withParentSpan as cr, fromEffect as ct, get as d, flatMap$9 as da, map$11 as di, forkScoped as dn, zipRight$1 as dr, write as dt, reduceRight as ea, has$4 as ei, ensuring$4 as en, pipe as eo, uninterruptible as er, foldLeftChunks as et, make$3 as f, fromNullable as fa, of$1 as fi, gen as fn, zipWith as fr, spaced as ft, when as g, isNone as ga, GenericTag as gi, locally as gn, fail$5 as gr, make$10 as gt, value as h, getOrUndefined as ha, unsafeFromArray as hi, isEffect as hn, complete as hr, get$1 as ht, isMailbox as i, splitAt as ia, make$39 as ii, filter$1 as in, __toESM as io, unsafeMakeSemaphore as ir, acquireUseRelease as it, declare as j, BaseProto as ja, every$1 as ji, orElseFail as jn, addFinalizer$1 as jr, is as jt, Union as k, right as ka, drop$1 as ki, orDie as kn, log as kr, decodeSync as kt, prettyLoggerDefault as l, map$13 as la, seconds as li, forEach$2 as ln, zip$1 as lr, suspend$2 as lt, orElse as m, getOrThrow as ma, toArray$1 as mi, interruptible as mn, _await as mr, updateContext as mt, make as n, sort as na, make$36 as ni, failCause$2 as nn, __exportAll as no, unlessEffect as nr, fromChannel$1 as nt, toChannel as o, take$3 as oa, fromIterable$6 as oi, flatMap$4 as on, when$2 as or, ensuring$1 as ot, updateEffect as p, getOrElse as pa, reduce$6 as pi, ignore as pn, DeferredTypeId as pr, runFork as pt, runCollect as q, isTagged as qa, map$12 as qi, tap as qn, round as qr, catchTag as qt, unsafeAdd as r, span as ra, set$4 as ri, failSync as rn, __require as ro, unsafeMakeLatch as rr, unwrapScoped$1 as rt, unify as s, unsafeGet$3 as sa, has$5 as si, flatten$3 as sn, withFiberRuntime as sr, flatMap as st, join as t, some as ta, isEmpty$5 as ti, fail$4 as tn, __commonJSMin as to, uninterruptibleMask as tr, forEach as tt, withMinimumLogLevel as u, filter$5 as ua, appendAll$1 as ui, forkDaemon as un, zipLeft as ur, void_ as ut, Cause as v, isSome as va, Tag as vi, logWarning as vn, interrupt$1 as vr, mergeAll$1 as vt, NumberFromString as w, boolean as wa, isMissingDataOnly as wi, matchCauseEffect as wn, Error$1 as wr, currentLoggers as wt, Int as x, none$4 as xa, merge$1 as xi, mapError$4 as xn, succeed$4 as xr, scoped$2 as xt, Date$ as y, map$14 as ya, get$13 as yi, map$3 as yn, isDone as yr, provide as yt, bufferChunks as z, symbol as za, getSomes as zi, runtime as zn, make$27 as zr, asVoid as zt };
37652
+ export { drain as $, pipe as $a, reduceRight as $i, uninterruptible as $n, has$4 as $r, either$1 as $t, compose as A, BaseProto as Aa, every$1 as Ai, orElse$3 as An, addFinalizer$1 as Ar, encodeSync as At, ensuring as B, combine$7 as Ba, headNonEmpty$2 as Bi, scoped$3 as Bn, update$1 as Br, async as Bt, Number$ as C, boolean as Ca, isMissingDataOnly as Ci, match$2 as Cn, Error$1 as Cr, currentContext as Ct, String$ as D, merge$3 as Da, contains as Di, onError as Dn, error as Dr, unsafeMake$3 as Dt, Schema_exports as E, left as Ea, appendAll$2 as Ei, negate as En, taggedEnum as Er, get$3 as Et, transform as F, symbolRedactable as Fa, findLast as Fi, retry as Fn, void_$2 as Fr, addFinalizer as Ft, mapError as G, isObject as Ga, make$48 as Gi, sync$1 as Gn, CommitPrototype as Gr, catchIf as Gt, fromChannel as H, string$3 as Ha, isEmptyReadonlyArray as Hi, serviceOption as Hn, allLevels as Hr, catchAll as Ht, make$5 as I, toStringUnknown as Ia, flatMap$8 as Ii, runFork$1 as In, ParentSpan as Ir, all as It, splitLines as J, constFalse as Ja, matchLeft as Ji, tapErrorCause as Jn, isNil as Jr, catchTags as Jt, run as K, isTagged as Ka, map$12 as Ki, tap as Kn, round as Kr, catchSome as Kt, isConfig as L, equals$3 as La, fromIterable$10 as Li, runSync as Ln, get$5 as Lr, annotateLogs as Lt, decodeUnknown as M, NodeInspectSymbol as Ma, filterMap as Mi, provide$1 as Mn, isInterruptedOnly as Mr, _void as Mt, int as N, format$4 as Na, findFirst$1 as Ni, provideService as Nn, fail$7 as Nr, acquireRelease as Nt, TaggedError as O, right as Oa, drop$1 as Oi, onInterrupt as On, log as Or, nominal as Ot, optional as P, redact as Pa, findFirstIndex as Pi, repeatN as Pn, isFailure as Pr, acquireUseRelease$2 as Pt, unwrapScoped as Q, identity as Qa, reduce$7 as Qi, try_ as Qn, get$9 as Qr, dieMessage as Qt, asyncScoped as R, symbol as Ra, getSomes as Ri, runtime as Rn, make$27 as Rr, as as Rt, Literal as S, some$1 as Sa, isConfigError as Si, mapInputContext as Sn, Equivalence$2 as Sr, succeed$1 as St, Record as T, string$2 as Ta, append$2 as Ti, matchEffect as Tn, tagged as Tr, currentTracerEnabled as Tt, fromReadableStream as U, symbol$1 as Ua, isNonEmptyReadonlyArray as Ui, succeed$3 as Un, getOrDefault as Ur, catchAllCause$1 as Ut, fail as V, hash as Va, isArray as Vi, serviceFunctions as Vn, updateAndGet as Vr, cached as Vt, mapChunks as W, hasProperty as Wa, join$3 as Wi, suspend$6 as Wn, updateAs as Wr, catchAllDefect as Wt, transduce as X, constVoid as Xa, of$2 as Xi, tryMap as Xn, empty$19 as Xr, contextWithEffect as Xt, suspend$1 as Y, constUndefined as Ya, matchRight as Yi, timeout as Yn, of as Yr, context as Yt, unwrap as Z, dual as Za, prepend$2 as Zi, tryPromise as Zn, fromIterable$5 as Zr, die as Zt, fromString as _, isSome as _a, Tag as _i, logError as _n, interrupt$1 as _r, effect$1 as _t, make$1 as a, take$3 as aa, fromIterable$6 as ai, filterOrDieMessage as an, when$2 as ar, embedInput as at, Defect as b, none$4 as ba, merge$1 as bi, mapBoth$1 as bn, succeed$4 as br, provideMerge as bt, defaultLogger as c, map$13 as ca, seconds as ci, fnUntraced as cn, zip$1 as cr, fromEffect as ct, get as d, fromNullable as da, of$1 as di, forkScoped as dn, zipWith as dr, write as dt, some as ea, isEmpty$5 as ei, ensuring$4 as en, __commonJSMin as eo, uninterruptibleMask as er, foldLeftChunks as et, make$3 as f, getOrElse as fa, reduce$6 as fi, gen as fn, DeferredTypeId as fr, spaced as ft, when as g, isOption as ga, Reference as gi, locally as gn, failCause$3 as gr, make$10 as gt, value as h, isNone as ha, GenericTag as hi, isEffect as hn, fail$5 as hr, get$1 as ht, isMailbox as i, tailNonEmpty$1 as ia, add as ii, filter$1 as in, useSpan as ir, acquireUseRelease as it, declare as j, Class$5 as ja, filter$4 as ji, orElseFail as jn, isInterrupted as jr, is as jt, Union as k, pipeArguments as ka, empty$26 as ki, orDie as kn, Scope as kr, decodeSync as kt, prettyLoggerDefault as l, filter$5 as la, appendAll$1 as li, forEach$2 as ln, zipLeft as lr, suspend$2 as lt, orElse as m, getOrUndefined as ma, unsafeFromArray as mi, interruptible as mn, complete as mr, updateContext as mt, make as n, span as na, set$4 as ni, failCause$2 as nn, __require as no, unsafeMakeLatch as nr, fromChannel$1 as nt, toChannel as o, unsafeGet$3 as oa, has$5 as oi, flatMap$4 as on, withFiberRuntime as or, ensuring$1 as ot, updateEffect as p, getOrThrow as pa, toArray$1 as pi, ignore as pn, _await as pr, runFork as pt, runCollect as q, globalValue as qa, match$8 as qi, tapError as qn, cons as qr, catchTag as qt, unsafeAdd as r, splitAt as ra, make$39 as ri, failSync as rn, __toESM as ro, unsafeMakeSemaphore as rr, unwrapScoped$1 as rt, unify as s, getEquivalence$5 as sa, remove$1 as si, flatten$3 as sn, withParentSpan as sr, flatMap as st, join as t, sort as ta, make$36 as ti, fail$4 as tn, __exportAll as to, unlessEffect as tr, forEach as tt, withMinimumLogLevel as u, flatMap$9 as ua, map$11 as ui, forkDaemon as un, zipRight$1 as ur, void_ as ut, Cause as v, map$14 as va, get$13 as vi, logWarning as vn, isDone as vr, mergeAll$1 as vt, NumberFromString as w, mapInput as wa, allocate as wi, matchCauseEffect as wn, TaggedError$1 as wr, currentLoggers as wt, Int as x, orElse$5 as xa, omit$3 as xi, mapError$4 as xn, unsafeDone as xr, scoped$2 as xt, Date$ as y, match$9 as ya, getOption$1 as yi, map$3 as yn, make$15 as yr, provide as yt, bufferChunks as z, cached$1 as za, head$2 as zi, scope as zn, set$2 as zr, asVoid as zt };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as defaultMessageFor, c as tagToCode, i as codeForTag, l as toErrorEnvelope, n as defaultGlobalFlags, o as exitCodeForError, r as parseGlobalFlags, s as exitCodeForTag, t as run } from "./mxs-BR5Y5ash.mjs";
1
+ import { a as defaultMessageFor, c as tagToCode, i as codeForTag, l as toErrorEnvelope, n as defaultGlobalFlags, o as exitCodeForError, r as parseGlobalFlags, s as exitCodeForTag, t as run } from "./mxs-BNvfyLLp.mjs";
2
2
  export { codeForTag, defaultGlobalFlags, defaultMessageFor, exitCodeForError, exitCodeForTag, parseGlobalFlags, run, tagToCode, toErrorEnvelope };
@@ -1,4 +1,4 @@
1
- import { $ as drain, $a as identity, $i as reduce$1, $n as try_, $r as get$12, $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$2, 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$16, Fa as redact$1, Fi as findFirstIndex, Fn as retry, Fr as isFailure, Ft as addFinalizer, G as mapError$1, Gi as join, 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$21, Ia as symbolRedactable, Ii as findLast, In as runFork$1, Ir as void_$1, It as all$5, 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$22, 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$2, Oi as contains, On as onInterrupt, Or as error$1, Ot as nominal, P as optional$8, Pa as format$3, Pi as findFirst, Pn as repeatN, Pr as fail$3, Pt as acquireUseRelease, 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$11, Rt as as, S as Literal, Sa as orElse$2, Si as omit, Sn as mapInputContext, Sr as unsafeDone, St as succeed$2, 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$7, Vt as cached$1, W as mapChunks, Wa as symbol$1, 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$2, Ya as constFalse, Yi as matchLeft, Yn as tapErrorCause, Yr as isNil, Yt as context, Z as unwrap$7, 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, _t as effect, a as make$29, 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$27, bt as provideMerge, c as defaultLogger, ci as remove$4, cn as fnUntraced, cr as withParentSpan, ct as fromEffect, d as get$13, da as flatMap$3, di as map$9, 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 make$25, 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$28, h as value$1, ha as getOrUndefined, hi as unsafeFromArray, hn as isEffect, hr as complete, ht as get$14, i as isMailbox, ia as splitAt, ii as make$26, in as filter$1, io as __toESM, ir as unsafeMakeSemaphore, it as acquireUseRelease$1, 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 prettyLoggerDefault, la as map$10, li as seconds, ln as forEach$1, lr as zip, lt as suspend$1, m as orElse$1, ma as getOrThrow, mi as toArray, mn as interruptible, mr as _await, mt as updateContext, n as make$30, na as sort$2, ni as make$24, nn as failCause$1, 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$1, p as updateEffect, 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 unify, sa as unsafeGet, si as has$1, sn as flatten$3, sr as withFiberRuntime, st as flatMap$2, t as join$1, ta as some$1, ti as isEmpty$5, tn as fail$2, to as __commonJSMin, tr as uninterruptibleMask, tt as forEach, u as withMinimumLogLevel, 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$3, xn as mapError, xr as succeed$3, xt as scoped$1, y as Date$, ya as map$8, yi as get$15, yn as map$6, yr as isDone, yt as provide, z as bufferChunks, za as symbol$2, zi as getSomes, zn as runtime, zr as make$23, zt as asVoid } from "./esm-Dg-WhPCe.mjs";
1
+ import { $ as drain, $a as pipe, $i as reduceRight, $n as uninterruptible, $r as has, $t as either, A as compose, Aa as BaseProto, Ai as every, An as orElse$3, Ar as addFinalizer$1, At as encodeSync, B as ensuring$2, Ba as combine$2, Bi as headNonEmpty, Bn as scoped, Br as update$7, Bt as async, C as Number$, Ca as boolean$3, Ci as isMissingDataOnly, Cn as match$2, Cr as Error$1, Ct as currentContext, D as String$, Da as merge$2, Di as contains, Dn as onError, Dr as error$1, Dt as unsafeMake, Ea as left, Ei as appendAll, En as negate, Er as taggedEnum, Et as get$16, Fa as symbolRedactable, Fi as findLast, Fn as retry, Fr as void_$1, Ft as addFinalizer, G as mapError$1, Ga as isObject, Gi as make$22, Gn as sync, Gr as CommitPrototype, Gt as catchIf, H as fromChannel, Ha as string, Hi as isEmptyReadonlyArray, Hn as serviceOption, Hr as allLevels, Ht as catchAll, I as make$21, Ia as toStringUnknown, Ii as flatMap$4, In as runFork$1, Ir as ParentSpan, It as all$5, J as splitLines, Ja as constFalse, Ji as matchLeft, Jn as tapErrorCause, Jr as isNil, Jt as catchTags, K as run$5, Ka as isTagged, Ki as map$7, Kn as tap, Kr as round, Kt as catchSome, L as isConfig, La as equals, Li as fromIterable$1, Ln as runSync, Lr as get$11, Lt as annotateLogs, M as decodeUnknown, Ma as NodeInspectSymbol, Mi as filterMap, Mn as provide$1, Mr as isInterruptedOnly, Mt as _void, N as int, Na as format$3, Ni as findFirst, Nn as provideService, Nr as fail$3, Nt as acquireRelease, O as TaggedError, Oa as right, Oi as drop, On as onInterrupt, Or as log, Ot as nominal, P as optional$8, Pa as redact$1, Pi as findFirstIndex, Pn as repeatN, Pr as isFailure, Pt as acquireUseRelease, Q as unwrapScoped, Qa as identity, Qi as reduce$1, Qn as try_, Qr as get$12, Qt as dieMessage, R as asyncScoped, Ra as symbol$2, Ri as getSomes, Rn as runtime, Rr as make$23, Rt as as, S as Literal, Sa as some, Si as isConfigError, Sn as mapInputContext, St as succeed$2, Ta as string$1, Ti as append$2, Tn as matchEffect, Tr as tagged, Tt as currentTracerEnabled, Ua as symbol$1, Ui as isNonEmptyReadonlyArray, Un as succeed$1, Ur as getOrDefault, Ut as catchAllCause, Va as hash, Vi as isArray$1, Vn as serviceFunctions, Vr as updateAndGet, Vt as cached$1, W as mapChunks, Wi as join, Wn as suspend, Wr as updateAs, Wt as catchAllDefect, X as transduce, Xa as constVoid, Xi as of$2, Xn as tryMap, Xr as empty$12, Xt as contextWithEffect, Y as suspend$2, Ya as constUndefined, Yi as matchRight, Yn as timeout, Yr as of$3, Yt as context, Z as unwrap$7, Za as dual, Zi as prepend$1, Zn as tryPromise, Zr as fromIterable$2, Zt as die, _ as fromString, _a as isSome, _i as Tag$2, _n as logError, _r as interrupt, _t as effect, a as make$29, aa as take, ai as fromIterable$3, an as filterOrDieMessage, ar as when$1, at as embedInput, b as Defect, ba as none$3, bi as merge$3, bn as mapBoth, br as succeed$3, bt as provideMerge, c as defaultLogger, ca as map$10, ci as seconds, cn as fnUntraced, cr as zip, ct as fromEffect, d as get$13, da as fromNullable, di as of$1, dn as forkScoped, dr as zipWith, dt as write, ea as some$1, ei as isEmpty$5, en as ensuring, eo as __commonJSMin, er as uninterruptibleMask, et as foldLeftChunks, f as make$25, fa as getOrElse, fi as reduce$2, fn as gen, fr as DeferredTypeId, ft as spaced, g as when, ga as isOption, gi as Reference, gn as locally, gr as failCause, gt as make$28, h as value$1, ha as isNone, hi as GenericTag, hn as isEffect, hr as fail$4, ht as get$14, i as isMailbox, ia as tailNonEmpty, ii as add$1, in as filter$1, ir as useSpan, it as acquireUseRelease$1, ja as Class, ji as filter$2, jn as orElseFail, jr as isInterrupted, jt as is$2, k as Union, ka as pipeArguments, ki as empty$11, kn as orDie, kr as Scope, kt as decodeSync, l as prettyLoggerDefault, la as filter$3, li as appendAll$1, ln as forEach$1, lr as zipLeft, lt as suspend$1, m as orElse$1, ma as getOrUndefined, mi as unsafeFromArray, mn as interruptible, mr as complete, mt as updateContext, n as make$30, na as span, ni as set$2, nn as failCause$1, no as __require, nr as unsafeMakeLatch, nt as fromChannel$1, o as toChannel, oa as unsafeGet, oi as has$1, on as flatMap$1, or as withFiberRuntime, ot as ensuring$1, p as updateEffect, pa as getOrThrow, pi as toArray, pn as ignore, pr as _await, pt as runFork, q as runCollect, qa as globalValue, qi as match$1, qn as tapError, qr as cons$1, qt as catchTag, r as unsafeAdd, ra as splitAt, ri as make$26, rn as failSync, ro as __toESM, rr as unsafeMakeSemaphore, rt as unwrapScoped$1, s as unify, si as remove$4, sn as flatten$3, sr as withParentSpan, st as flatMap$2, t as join$1, ta as sort$2, ti as make$24, tn as fail$2, to as __exportAll, tr as unlessEffect, tt as forEach, u as withMinimumLogLevel, ua as flatMap$3, ui as map$9, un as forkDaemon, ur as zipRight, ut as void_, v as Cause, va as map$8, vi as get$15, vn as logWarning, vr as isDone, vt as mergeAll, w as NumberFromString, wa as mapInput, wi as allocate, wn as matchCauseEffect, wr as TaggedError$1, wt as currentLoggers, x as Int, xa as orElse$2, xi as omit, xn as mapError, xr as unsafeDone, xt as scoped$1, y as Date$, ya as match, yi as getOption, yn as map$6, yr as make$27, yt as provide, z as bufferChunks, za as cached, zi as head$2, zn as scope, zr as set$3, zt as asVoid } from "./esm-eihI6wbY.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-Bg9jND3Q.mjs";
3
3
  import { a as HorizontalRuleNode } from "./LexicalExtension.node-BVlcrgOx.mjs";
4
4
  import { $t as ElementNode, Qt as DecoratorNode } from "./Lexical.node-fXM8Jp7p.mjs";
@@ -9,11 +9,11 @@ import { Readable } from "node:stream";
9
9
  import * as Crypto from "node:crypto";
10
10
  import { webcrypto } from "node:crypto";
11
11
  import * as NFS from "node:fs";
12
- import fs, { existsSync, mkdirSync, readFileSync, realpathSync, renameSync, writeFileSync } from "node:fs";
12
+ import fs, { existsSync, mkdirSync, openSync, readFileSync, realpathSync, renameSync, writeFileSync } from "node:fs";
13
13
  import * as OS from "node:os";
14
14
  import os, { arch, platform } from "node:os";
15
15
  import * as Path from "node:path";
16
- import path from "node:path";
16
+ import path, { basename } from "node:path";
17
17
  import * as NodeUrl from "node:url";
18
18
  import { fileURLToPath } from "node:url";
19
19
  import * as readline from "node:readline";
@@ -23,7 +23,7 @@ import * as Https from "node:https";
23
23
  import { pipeline } from "node:stream/promises";
24
24
  import { promisify, styleText } from "node:util";
25
25
  import { Buffer as Buffer$1 } from "node:buffer";
26
- import fs$1, { constants } from "node:fs/promises";
26
+ import fs$1, { constants, readFile } from "node:fs/promises";
27
27
  import process$1, { stdin, stdout } from "node:process";
28
28
  //#region ../../node_modules/.pnpm/@effect+platform@0.96.1_effect@3.21.2/node_modules/@effect/platform/dist/esm/Error.js
29
29
  /**
@@ -4640,7 +4640,7 @@ const levensteinDistance = (first, second, config) => {
4640
4640
  //#endregion
4641
4641
  //#region ../../node_modules/.pnpm/@effect+cli@0.75.2_@effect+platform@0.96.1_effect@3.21.2__@effect+printer-ansi@0.49.0_@_4d5fe3e52e753e91ea7f4be1c61c2cec/node_modules/@effect/cli/dist/esm/internal/prompt/list.js
4642
4642
  /** @internal */
4643
- const list$9 = (options) => text$9(options).pipe(map$3((output) => output.split(options.delimiter || ",")));
4643
+ const list$10 = (options) => text$9(options).pipe(map$3((output) => output.split(options.delimiter || ",")));
4644
4644
  /** @internal */
4645
4645
  const OptionsTypeId = /*#__PURE__*/ Symbol.for("@effect/cli/Options");
4646
4646
  const proto$2 = {
@@ -4684,8 +4684,8 @@ const boolean$1 = (name, options) => {
4684
4684
  ...options
4685
4685
  };
4686
4686
  const option = makeSingle(name, aliases, boolean$2(some(ifPresent)));
4687
- if (isNonEmptyReadonlyArray(negationNames)) return withDefault(orElse(option, makeSingle(headNonEmpty(negationNames), tailNonEmpty(negationNames), boolean$2(some(!ifPresent)))), !ifPresent);
4688
- return withDefault(option, !ifPresent);
4687
+ if (isNonEmptyReadonlyArray(negationNames)) return withDefault$1(orElse(option, makeSingle(headNonEmpty(negationNames), tailNonEmpty(negationNames), boolean$2(some(!ifPresent)))), !ifPresent);
4688
+ return withDefault$1(option, !ifPresent);
4689
4689
  };
4690
4690
  /** @internal */
4691
4691
  const choice$1 = (name, choices) => {
@@ -4711,7 +4711,7 @@ const getUsage$1 = (self) => getUsageInternal$1(self);
4711
4711
  /** @internal */
4712
4712
  const map$1 = /*#__PURE__*/ dual(2, (self, f) => makeMap(self, (a) => right(f(a))));
4713
4713
  /** @internal */
4714
- const optional$4 = (self) => withDefault(map$1(self, some), none$3());
4714
+ const optional$4 = (self) => withDefault$1(map$1(self, some), none$3());
4715
4715
  /** @internal */
4716
4716
  const orElse = /*#__PURE__*/ dual(2, (self, that) => orElseEither(self, that).pipe(map$1(merge$2)));
4717
4717
  /** @internal */
@@ -4731,7 +4731,7 @@ const withAlias = /*#__PURE__*/ dual(2, (self, alias) => modifySingle(self, (sin
4731
4731
  return makeSingle(single.name, aliases, single.primitiveType, single.description, single.pseudoName);
4732
4732
  }));
4733
4733
  /** @internal */
4734
- const withDefault = /*#__PURE__*/ dual(2, (self, fallback) => makeWithDefault(self, fallback));
4734
+ const withDefault$1 = /*#__PURE__*/ dual(2, (self, fallback) => makeWithDefault(self, fallback));
4735
4735
  /** @internal */
4736
4736
  const withDescription$4 = /*#__PURE__*/ dual(2, (self, desc) => modifySingle(self, (single) => {
4737
4737
  const description = sequence(single.description, p$1(desc));
@@ -5058,7 +5058,7 @@ const wizardInternal$1 = (self, config) => {
5058
5058
  return parseCommandLine(self, args, config).pipe(as(args));
5059
5059
  }), zipLeft(log()));
5060
5060
  }
5061
- case "KeyValueMap": return list$9({
5061
+ case "KeyValueMap": return list$10({
5062
5062
  message: toAnsiText(p$1("Enter `key=value` pairs separated by spaces")).trim(),
5063
5063
  delimiter: " "
5064
5064
  }).pipe(flatMap$1((args) => {
@@ -5641,6 +5641,11 @@ const optional$3 = optional$4;
5641
5641
  * @since 1.0.0
5642
5642
  * @category combinators
5643
5643
  */
5644
+ const withDefault = withDefault$1;
5645
+ /**
5646
+ * @since 1.0.0
5647
+ * @category combinators
5648
+ */
5644
5649
  const withDescription$3 = withDescription$4;
5645
5650
  //#endregion
5646
5651
  //#region ../../node_modules/.pnpm/@effect+cli@0.75.2_@effect+platform@0.96.1_effect@3.21.2__@effect+printer-ansi@0.49.0_@_4d5fe3e52e753e91ea7f4be1c61c2cec/node_modules/@effect/cli/dist/esm/internal/builtInOptions.js
@@ -7249,7 +7254,7 @@ const readDirectory = (path, options) => tryPromise({
7249
7254
  try: () => NFS.promises.readdir(path, options),
7250
7255
  catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path])
7251
7256
  });
7252
- const readFile = (path) => async((resume, signal) => {
7257
+ const readFile$1 = (path) => async((resume, signal) => {
7253
7258
  try {
7254
7259
  NFS.readFile(path, { signal }, (err, data) => {
7255
7260
  if (err) resume(fail$2(handleErrnoException("FileSystem", "readFile")(err, [path])));
@@ -7267,7 +7272,7 @@ const realPath = /*#__PURE__*/ (() => {
7267
7272
  const nodeRealPath = /*#__PURE__*/ effectify(NFS.realpath, /*#__PURE__*/ handleErrnoException("FileSystem", "realPath"), /*#__PURE__*/ handleBadArgument("realPath"));
7268
7273
  return (path) => nodeRealPath(path);
7269
7274
  })();
7270
- const rename = /*#__PURE__*/ (() => {
7275
+ const rename$1 = /*#__PURE__*/ (() => {
7271
7276
  const nodeRename = /*#__PURE__*/ effectify(NFS.rename, /*#__PURE__*/ handleErrnoException("FileSystem", "rename"), /*#__PURE__*/ handleBadArgument("rename"));
7272
7277
  return (oldPath, newPath) => nodeRename(oldPath, newPath);
7273
7278
  })();
@@ -7370,11 +7375,11 @@ const layer$7 = /* @__PURE__ */ effect(FileSystem, /* @__PURE__ */ map$6(/*#__PU
7370
7375
  makeTempFileScoped,
7371
7376
  open: open$1,
7372
7377
  readDirectory,
7373
- readFile,
7378
+ readFile: readFile$1,
7374
7379
  readLink,
7375
7380
  realPath,
7376
7381
  remove: remove$3,
7377
- rename,
7382
+ rename: rename$1,
7378
7383
  stat,
7379
7384
  symlink,
7380
7385
  truncate,
@@ -8340,7 +8345,7 @@ const put$1 = /*#__PURE__*/ make$10("PUT");
8340
8345
  /** @internal */
8341
8346
  const patch$1 = /*#__PURE__*/ make$10("PATCH");
8342
8347
  /** @internal */
8343
- const del$8 = /*#__PURE__*/ make$10("DELETE");
8348
+ const del$9 = /*#__PURE__*/ make$10("DELETE");
8344
8349
  /** @internal */
8345
8350
  const head$1 = /*#__PURE__*/ make$10("HEAD");
8346
8351
  /** @internal */
@@ -8449,7 +8454,7 @@ const ClientProto = {
8449
8454
  return this.execute(patch$1(url, options));
8450
8455
  },
8451
8456
  del(url, options) {
8452
- return this.execute(del$8(url, options));
8457
+ return this.execute(del$9(url, options));
8453
8458
  },
8454
8459
  options(url, options) {
8455
8460
  return this.execute(options$1(url, options));
@@ -8612,7 +8617,7 @@ var InterruptibleResponse = class {
8612
8617
  return this.original[NodeInspectSymbol]();
8613
8618
  }
8614
8619
  };
8615
- const { del: del$7, execute, get: get$9, head, options, patch, post, put } = /*#__PURE__*/ serviceFunctions(tag);
8620
+ const { del: del$8, execute, get: get$9, head, options, patch, post, put } = /*#__PURE__*/ serviceFunctions(tag);
8616
8621
  /** @internal */
8617
8622
  const transformResponse = /*#__PURE__*/ dual(2, (self, f) => {
8618
8623
  const client = self;
@@ -12570,7 +12575,7 @@ function customAlphabet(alphabet, size = 21) {
12570
12575
  return customRandom(alphabet, size, random);
12571
12576
  }
12572
12577
  //#endregion
12573
- //#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.21.0/node_modules/@haklex/rich-litexml/dist/src-CWxDj4Bd.js
12578
+ //#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.22.0/node_modules/@haklex/rich-litexml/dist/src-CWxDj4Bd.js
12574
12579
  var impl = null;
12575
12580
  function registerParseHTML(fn) {
12576
12581
  impl = fn;
@@ -24908,7 +24913,7 @@ function Document() {
24908
24913
  }
24909
24914
  setPrototypeOf(Document, Document$1).prototype = Document$1.prototype;
24910
24915
  //#endregion
24911
- //#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.21.0/node_modules/@haklex/rich-litexml/dist/node.mjs
24916
+ //#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.22.0/node_modules/@haklex/rich-litexml/dist/node.mjs
24912
24917
  registerParseHTML((html) => parseHTML(html).document);
24913
24918
  //#endregion
24914
24919
  //#region ../editor/src/core/litexml.ts
@@ -25048,7 +25053,7 @@ const TRANSFORMERS = mod$1.TRANSFORMERS;
25048
25053
  mod$1.UNORDERED_LIST;
25049
25054
  mod$1.registerMarkdownShortcuts;
25050
25055
  //#endregion
25051
- //#region ../../node_modules/.pnpm/@haklex+rich-headless@0.20.0_lexical@0.45.0/node_modules/@haklex/rich-headless/dist/transformers.mjs
25056
+ //#region ../../node_modules/.pnpm/@haklex+rich-headless@0.22.0_lexical@0.45.0/node_modules/@haklex/rich-headless/dist/transformers.mjs
25052
25057
  /**
25053
25058
  * Headless Markdown transformers — export-only (Lexical → Markdown).
25054
25059
  * Import stubs are no-ops; used only for $convertToMarkdownString.
@@ -25475,7 +25480,7 @@ function $toMarkdown() {
25475
25480
  return $convertToMarkdownString(allHeadlessTransformers);
25476
25481
  }
25477
25482
  //#endregion
25478
- //#region ../../node_modules/.pnpm/@haklex+rich-headless@0.20.0_lexical@0.45.0/node_modules/@haklex/rich-headless/dist/index.mjs
25483
+ //#region ../../node_modules/.pnpm/@haklex+rich-headless@0.22.0_lexical@0.45.0/node_modules/@haklex/rich-headless/dist/index.mjs
25479
25484
  var INTRINSIC_TYPES = [
25480
25485
  "root",
25481
25486
  "paragraph",
@@ -26468,7 +26473,7 @@ const codeblockRenderer = (node, ctx) => {
26468
26473
  };
26469
26474
  //#endregion
26470
26475
  //#region src/cli/render/lexical/embeds.ts
26471
- const basename = (path) => {
26476
+ const basename$1 = (path) => {
26472
26477
  const idx = path.lastIndexOf("/");
26473
26478
  return idx >= 0 ? path.slice(idx + 1) : path;
26474
26479
  };
@@ -26476,7 +26481,7 @@ const imgRenderer = (node, ctx) => {
26476
26481
  const { alt, src, caption } = node.attrs;
26477
26482
  let label;
26478
26483
  if (alt) label = `[image: ${alt}]`;
26479
- else if (src) label = `[image: ${basename(src)}]`;
26484
+ else if (src) label = `[image: ${basename$1(src)}]`;
26480
26485
  else label = "[image]";
26481
26486
  const main = wrap(ANSI.dim, label, ctx.color);
26482
26487
  if (caption) return `${main}\n${wrap(ANSI.dim, caption, ctx.color)}`;
@@ -30971,7 +30976,7 @@ const whoami = make$13("whoami", {}, () => gen(function* () {
30971
30976
  }));
30972
30977
  //#endregion
30973
30978
  //#region src/cli/auth/index.ts
30974
- const help$10 = registerCommandHelp({
30979
+ const help$11 = registerCommandHelp({
30975
30980
  name: "auth",
30976
30981
  description: "authentication",
30977
30982
  verbs: [
@@ -30994,7 +30999,7 @@ const help$10 = registerCommandHelp({
30994
30999
  }
30995
31000
  ]
30996
31001
  });
30997
- const authCmd = make$13("auth").pipe(withDescription(help$10.description), withSubcommands([
31002
+ const authCmd = make$13("auth").pipe(withDescription(help$11.description), withSubcommands([
30998
31003
  login,
30999
31004
  logout,
31000
31005
  whoami,
@@ -31288,7 +31293,7 @@ function parseBody(res) {
31288
31293
  function decodeWithSchema(schema, body) {
31289
31294
  return tryPromise({
31290
31295
  try: async () => {
31291
- const { Schema: SchemaMod } = await import("./esm-By7trG9K.mjs");
31296
+ const { Schema: SchemaMod } = await import("./esm-Bw9S3CPp.mjs");
31292
31297
  return SchemaMod.decodeUnknownPromise(schema)(body);
31293
31298
  },
31294
31299
  catch: (err) => new ServerError({
@@ -31614,7 +31619,7 @@ var Resolver = class Resolver extends Tag$2("Resolver")() {
31614
31619
  return make$3(yield* Api);
31615
31620
  }));
31616
31621
  };
31617
- const del$6 = make$13("delete", {
31622
+ const del$7 = make$13("delete", {
31618
31623
  slugOrId: text$6({ name: "slugOrId" }),
31619
31624
  force: boolean("force")
31620
31625
  }, ({ slugOrId, force }) => gen(function* () {
@@ -31633,7 +31638,7 @@ const get$8 = make$13("get", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slug
31633
31638
  }));
31634
31639
  //#endregion
31635
31640
  //#region src/cli/category/list.ts
31636
- const list$8 = make$13("list", {}, () => gen(function* () {
31641
+ const list$9 = make$13("list", {}, () => gen(function* () {
31637
31642
  const api = yield* Api;
31638
31643
  const renderer = yield* Renderer;
31639
31644
  const res = yield* api.request("/categories");
@@ -31666,7 +31671,7 @@ const update$5 = make$13("update", {
31666
31671
  }));
31667
31672
  //#endregion
31668
31673
  //#region src/cli/category/index.ts
31669
- const help$9 = registerCommandHelp({
31674
+ const help$10 = registerCommandHelp({
31670
31675
  name: "category",
31671
31676
  description: "manage categories / tags",
31672
31677
  verbs: [
@@ -31706,12 +31711,12 @@ const help$9 = registerCommandHelp({
31706
31711
  }
31707
31712
  ]
31708
31713
  });
31709
- const categoryCmd = make$13("category").pipe(withDescription(help$9.description), withSubcommands([
31710
- list$8,
31714
+ const categoryCmd = make$13("category").pipe(withDescription(help$10.description), withSubcommands([
31715
+ list$9,
31711
31716
  get$8,
31712
31717
  create$5,
31713
31718
  update$5,
31714
- del$6
31719
+ del$7
31715
31720
  ]));
31716
31721
  //#endregion
31717
31722
  //#region src/services/Comment.ts
@@ -31814,7 +31819,7 @@ var Comment = class Comment extends Tag$2("Comment")() {
31814
31819
  //#region src/cli/comment/_flags.ts
31815
31820
  const ids = text$6({ name: "id" }).pipe(repeated);
31816
31821
  const all$1 = boolean("all").pipe(withDescription$3("apply to every comment (optionally filtered by --state)"));
31817
- const force$7 = boolean("force").pipe(withDescription$3("skip TTY confirmation guard"));
31822
+ const force$8 = boolean("force").pipe(withDescription$3("skip TTY confirmation guard"));
31818
31823
  const stateFilter = choice("state", [
31819
31824
  "unread",
31820
31825
  "read",
@@ -31845,7 +31850,7 @@ const requireForceForSingleDelete = (params) => suspend(() => {
31845
31850
  const approve = make$13("approve", {
31846
31851
  ids,
31847
31852
  all: all$1,
31848
- force: force$7,
31853
+ force: force$8,
31849
31854
  state: stateFilter
31850
31855
  }, ({ ids, all, force, state }) => gen(function* () {
31851
31856
  yield* validateBatchSelection({
@@ -31869,10 +31874,10 @@ const approve = make$13("approve", {
31869
31874
  })).pipe(withDescription("mark comments as read; pass ids or --all [--state <s>]"));
31870
31875
  //#endregion
31871
31876
  //#region src/cli/comment/delete.ts
31872
- const del$5 = make$13("delete", {
31877
+ const del$6 = make$13("delete", {
31873
31878
  ids,
31874
31879
  all: all$1,
31875
- force: force$7,
31880
+ force: force$8,
31876
31881
  state: stateFilter
31877
31882
  }, ({ ids, all, force, state }) => gen(function* () {
31878
31883
  yield* validateBatchSelection({
@@ -32042,7 +32047,7 @@ const get$7 = make$13("get", { id: text$6({ name: "id" }) }, ({ id }) => gen(fun
32042
32047
  const res = yield* comment.get(id);
32043
32048
  yield* renderer.emit(commentView, res);
32044
32049
  })).pipe(withDescription("show a single comment by id"));
32045
- const list$7 = make$13("list", {
32050
+ const list$8 = make$13("list", {
32046
32051
  page: integer("page").pipe(optional$3),
32047
32052
  size: integer("size").pipe(optional$3),
32048
32053
  state: stateFilter,
@@ -32063,7 +32068,7 @@ const list$7 = make$13("list", {
32063
32068
  const reject = make$13("reject", {
32064
32069
  ids,
32065
32070
  all: all$1,
32066
- force: force$7,
32071
+ force: force$8,
32067
32072
  state: stateFilter
32068
32073
  }, ({ ids, all, force, state }) => gen(function* () {
32069
32074
  yield* validateBatchSelection({
@@ -32181,7 +32186,7 @@ const unread = make$13("unread", {
32181
32186
  })).pipe(withDescription("list unread comments (alias for `comment list --state unread`)"));
32182
32187
  //#endregion
32183
32188
  //#region src/cli/comment/index.ts
32184
- const help$8 = registerCommandHelp({
32189
+ const help$9 = registerCommandHelp({
32185
32190
  name: "comment",
32186
32191
  description: "list and moderate comments",
32187
32192
  verbs: [
@@ -32248,14 +32253,14 @@ const help$8 = registerCommandHelp({
32248
32253
  }
32249
32254
  ]
32250
32255
  });
32251
- const commentCmd = make$13("comment").pipe(withDescription(help$8.description), withSubcommands([
32252
- list$7,
32256
+ const commentCmd = make$13("comment").pipe(withDescription(help$9.description), withSubcommands([
32257
+ list$8,
32253
32258
  unread,
32254
32259
  get$7,
32255
32260
  reply,
32256
32261
  approve,
32257
32262
  reject,
32258
- del$5
32263
+ del$6
32259
32264
  ]));
32260
32265
  //#endregion
32261
32266
  //#region src/cli/config/edit.ts
@@ -32292,7 +32297,7 @@ const get$6 = make$13("get", { key: text$6({ name: "key" }) }, ({ key }) => gen(
32292
32297
  }));
32293
32298
  //#endregion
32294
32299
  //#region src/cli/config/list.ts
32295
- const list$6 = make$13("list", {}, () => gen(function* () {
32300
+ const list$7 = make$13("list", {}, () => gen(function* () {
32296
32301
  const api = yield* Api;
32297
32302
  const renderer = yield* Renderer;
32298
32303
  const res = yield* api.request("/options");
@@ -32339,7 +32344,7 @@ const set = make$13("set", {
32339
32344
  }));
32340
32345
  //#endregion
32341
32346
  //#region src/cli/config/index.ts
32342
- const help$7 = registerCommandHelp({
32347
+ const help$8 = registerCommandHelp({
32343
32348
  name: "config",
32344
32349
  description: "manage server options",
32345
32350
  verbs: [
@@ -32367,13 +32372,130 @@ const help$7 = registerCommandHelp({
32367
32372
  }
32368
32373
  ]
32369
32374
  });
32370
- const configCmd = make$13("config").pipe(withDescription(help$7.description), withSubcommands([
32371
- list$6,
32375
+ const configCmd = make$13("config").pipe(withDescription(help$8.description), withSubcommands([
32376
+ list$7,
32372
32377
  get$6,
32373
32378
  set,
32374
32379
  edit$4
32375
32380
  ]));
32376
32381
  //#endregion
32382
+ //#region src/cli/file/_shared.ts
32383
+ /** Mirrors the server's `FileTypeEnum` (apps/core modules/file/file.type.ts). */
32384
+ const FILE_TYPES = [
32385
+ "file",
32386
+ "image",
32387
+ "icon",
32388
+ "avatar"
32389
+ ];
32390
+ const typeOption = choice("type", FILE_TYPES).pipe(withDescription$3("server-side storage bucket for the file"), withDefault("file"));
32391
+ const silentFlag$5 = boolean("silent").pipe(withDescription$3("On success, emit a minimal `ok` instead of the full server response."));
32392
+ const del$5 = make$13("delete", {
32393
+ name: text$6({ name: "name" }),
32394
+ type: typeOption,
32395
+ force: boolean("force").pipe(withDescription$3("skip confirmation"))
32396
+ }, ({ name, type, force }) => gen(function* () {
32397
+ if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
32398
+ const api = yield* Api;
32399
+ const renderer = yield* Renderer;
32400
+ yield* api.request(`/objects/${type}/${encodeURIComponent(name)}`, { method: "DELETE" });
32401
+ yield* renderer.emitSuccess({ deleted: `${type}/${name}` });
32402
+ })).pipe(withDescription("delete an uploaded file"));
32403
+ //#endregion
32404
+ //#region src/cli/file/list.ts
32405
+ const list$6 = make$13("list", { type: typeOption }, ({ type }) => gen(function* () {
32406
+ const api = yield* Api;
32407
+ const renderer = yield* Renderer;
32408
+ const res = yield* api.request(`/objects/${type}`);
32409
+ yield* renderer.emitSuccess(res);
32410
+ })).pipe(withDescription("list uploaded files of a type (name, url, created)"));
32411
+ const rename = make$13("rename", {
32412
+ name: text$6({ name: "name" }),
32413
+ newName: text$6({ name: "newName" }),
32414
+ type: typeOption
32415
+ }, ({ name, newName, type }) => gen(function* () {
32416
+ const api = yield* Api;
32417
+ const renderer = yield* Renderer;
32418
+ yield* api.request(`/objects/${type}/${encodeURIComponent(name)}/rename`, {
32419
+ method: "PATCH",
32420
+ query: { newName }
32421
+ });
32422
+ yield* renderer.emitSuccess({
32423
+ renamed: `${type}/${name}`,
32424
+ to: newName
32425
+ });
32426
+ })).pipe(withDescription("rename an uploaded file"));
32427
+ const upload = make$13("upload", {
32428
+ path: text$6({ name: "path" }),
32429
+ type: typeOption,
32430
+ name: text$4("name").pipe(withDescription$3("override the uploaded filename (defaults to the local basename)"), optional$3),
32431
+ silent: silentFlag$5
32432
+ }, ({ path, type, name, silent }) => gen(function* () {
32433
+ const buffer = yield* tryPromise({
32434
+ try: () => readFile(path),
32435
+ catch: (err) => new Generic({
32436
+ message: `cannot read file: ${path}`,
32437
+ cause: err
32438
+ })
32439
+ });
32440
+ const filename = name._tag === "Some" ? name.value : basename(path);
32441
+ const form = new FormData();
32442
+ form.append("file", new File([new Uint8Array(buffer)], filename));
32443
+ const api = yield* Api;
32444
+ const renderer = yield* Renderer;
32445
+ const res = yield* api.request(`/objects/upload`, {
32446
+ method: "POST",
32447
+ query: { type },
32448
+ body: form
32449
+ });
32450
+ yield* renderer.emitSuccess(silent ? { ok: true } : res);
32451
+ })).pipe(withDescription(`upload a local file (--type ${FILE_TYPES.join("|")}); returns { url, name }`));
32452
+ //#endregion
32453
+ //#region src/cli/file/index.ts
32454
+ const help$7 = registerCommandHelp({
32455
+ name: "file",
32456
+ description: "upload and manage static files (images, icons, avatars)",
32457
+ verbs: [
32458
+ {
32459
+ name: "upload",
32460
+ args: [
32461
+ "<path>",
32462
+ "[--type file|image|icon|avatar]",
32463
+ "[--name <n>]"
32464
+ ],
32465
+ description: "upload a local file; returns { url, name }"
32466
+ },
32467
+ {
32468
+ name: "list",
32469
+ args: ["[--type <t>]"],
32470
+ description: "list uploaded files of a type"
32471
+ },
32472
+ {
32473
+ name: "delete",
32474
+ args: [
32475
+ "<name>",
32476
+ "[--type <t>]",
32477
+ "[--force]"
32478
+ ],
32479
+ description: "delete an uploaded file"
32480
+ },
32481
+ {
32482
+ name: "rename",
32483
+ args: [
32484
+ "<name>",
32485
+ "<newName>",
32486
+ "[--type <t>]"
32487
+ ],
32488
+ description: "rename an uploaded file"
32489
+ }
32490
+ ]
32491
+ });
32492
+ const fileCmd = make$13("file").pipe(withDescription(help$7.description), withSubcommands([
32493
+ upload,
32494
+ list$6,
32495
+ del$5,
32496
+ rename
32497
+ ]));
32498
+ //#endregion
32377
32499
  //#region src/domain/admin-link.ts
32378
32500
  const buildEditUrl = (adminUrl, kind, id) => {
32379
32501
  const base = adminUrl.replace(/\/+$/, "");
@@ -33080,7 +33202,7 @@ const del$4 = make$13("delete", {
33080
33202
  })).pipe(withDescription("delete a note"));
33081
33203
  //#endregion
33082
33204
  //#region src/cli/note/edit.ts
33083
- const slugOrId$17 = text$6({ name: "slugOrId" });
33205
+ const slugOrId$19 = text$6({ name: "slugOrId" });
33084
33206
  const esc = (s) => s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
33085
33207
  const materializeForEditor$2 = (slugOrId) => gen(function* () {
33086
33208
  const api = yield* Api;
@@ -33123,7 +33245,7 @@ const applyNoteEnvelopeMeta = (payload, rawMeta) => {
33123
33245
  return next;
33124
33246
  };
33125
33247
  const edit$3 = make$13("edit", {
33126
- slugOrId: slugOrId$17,
33248
+ slugOrId: slugOrId$19,
33127
33249
  ...noteWriteOptions
33128
33250
  }, ({ slugOrId, ...rest }) => gen(function* () {
33129
33251
  const flags = toNoteFlagInputs(rest);
@@ -33373,6 +33495,7 @@ const update$4 = make$13("update", {
33373
33495
  delete payload.text;
33374
33496
  delete payload.contentFormat;
33375
33497
  }
33498
+ if (flags.state === void 0) delete payload.isPublished;
33376
33499
  const resolved = yield* resolveTopicRefs(payload);
33377
33500
  const id = yield* (yield* Resolver).resolveNoteId(slugOrId);
33378
33501
  const api = yield* Api;
@@ -33498,7 +33621,7 @@ const create$3 = make$13("create", pageWriteOptions, (opts) => gen(function* ()
33498
33621
  }));
33499
33622
  //#endregion
33500
33623
  //#region src/cli/page/delete.ts
33501
- const slugOrId$12 = text$6({ name: "slugOrId" });
33624
+ const slugOrId$14 = text$6({ name: "slugOrId" });
33502
33625
  const force$5 = boolean("force");
33503
33626
  const resolvePageId$2 = (api, ref) => gen(function* () {
33504
33627
  if (isSnowflakeId(ref)) return ref;
@@ -33512,7 +33635,7 @@ const resolvePageId$2 = (api, ref) => gen(function* () {
33512
33635
  return id;
33513
33636
  });
33514
33637
  const del$3 = make$13("delete", {
33515
- slugOrId: slugOrId$12,
33638
+ slugOrId: slugOrId$14,
33516
33639
  force: force$5
33517
33640
  }, ({ slugOrId, force }) => gen(function* () {
33518
33641
  if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
@@ -33524,7 +33647,7 @@ const del$3 = make$13("delete", {
33524
33647
  }));
33525
33648
  //#endregion
33526
33649
  //#region src/cli/page/edit.ts
33527
- const slugOrId$11 = text$6({ name: "slugOrId" });
33650
+ const slugOrId$13 = text$6({ name: "slugOrId" });
33528
33651
  const escapeXml$1 = (s) => s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
33529
33652
  const resolvePageId$1 = (api, ref) => gen(function* () {
33530
33653
  if (isSnowflakeId(ref)) return ref;
@@ -33569,7 +33692,7 @@ const overlayPageMeta = (payload, rawMeta) => {
33569
33692
  return next;
33570
33693
  };
33571
33694
  const edit$2 = make$13("edit", {
33572
- slugOrId: slugOrId$11,
33695
+ slugOrId: slugOrId$13,
33573
33696
  ...pageWriteOptions
33574
33697
  }, ({ slugOrId, ...rest }) => gen(function* () {
33575
33698
  const flags = toPageFlagInputs(rest);
@@ -33700,7 +33823,7 @@ const list$4 = make$13("list", {}, () => gen(function* () {
33700
33823
  }));
33701
33824
  //#endregion
33702
33825
  //#region src/cli/page/update.ts
33703
- const slugOrId$9 = text$6({ name: "slugOrId" });
33826
+ const slugOrId$11 = text$6({ name: "slugOrId" });
33704
33827
  const resolvePageId = (api, ref) => gen(function* () {
33705
33828
  if (isSnowflakeId(ref)) return ref;
33706
33829
  const res = yield* api.request(`/pages/slug/${encodeURIComponent(ref)}`).pipe(catchAll(() => succeed$1(null)));
@@ -33713,7 +33836,7 @@ const resolvePageId = (api, ref) => gen(function* () {
33713
33836
  return id;
33714
33837
  });
33715
33838
  const update$3 = make$13("update", {
33716
- slugOrId: slugOrId$9,
33839
+ slugOrId: slugOrId$11,
33717
33840
  ...pageWriteOptions
33718
33841
  }, ({ slugOrId, ...rest }) => gen(function* () {
33719
33842
  const flags = toPageFlagInputs(rest);
@@ -33791,6 +33914,41 @@ const pageCmd = make$13("page").pipe(withDescription(help$5.description), withSu
33791
33914
  del$3
33792
33915
  ]));
33793
33916
  //#endregion
33917
+ //#region src/cli/post/apply.ts
33918
+ const slugOrId$10 = text$6({ name: "slugOrId" });
33919
+ const parseTypeSpecificData = (raw) => {
33920
+ if (!raw) return {};
33921
+ if (typeof raw === "object") return raw;
33922
+ try {
33923
+ const parsed = JSON.parse(raw);
33924
+ return typeof parsed === "object" && parsed !== null ? parsed : {};
33925
+ } catch {
33926
+ return {};
33927
+ }
33928
+ };
33929
+ const apply = make$13("apply", { slugOrId: slugOrId$10 }, ({ slugOrId }) => gen(function* () {
33930
+ const resolver = yield* Resolver;
33931
+ const api = yield* Api;
33932
+ const renderer = yield* Renderer;
33933
+ const id = yield* resolver.resolvePostId(slugOrId);
33934
+ const draft = yield* api.request(`/drafts/by-ref/post/${id}`);
33935
+ if (!draft || !draft.id) return yield* fail$2(new Generic({
33936
+ message: `no staged changes for post ${slugOrId}`,
33937
+ hint: "stage changes first with `mxs post stage <slugOrId> --file <article.xml>`"
33938
+ }));
33939
+ const body = { ...parseTypeSpecificData(draft.typeSpecificData) };
33940
+ if (draft.title !== void 0) body.title = draft.title;
33941
+ if (draft.text !== void 0) body.text = draft.text;
33942
+ if (draft.content !== void 0 && draft.content !== null) body.content = draft.content;
33943
+ if (draft.contentFormat !== void 0) body.contentFormat = draft.contentFormat;
33944
+ body.draftId = draft.id;
33945
+ const res = yield* api.request(`/posts/${id}`, {
33946
+ method: "PATCH",
33947
+ body
33948
+ });
33949
+ yield* renderer.emitSuccess(res);
33950
+ })).pipe(withDescription("apply the staged draft of a post to the live post (the confirm step after `post stage`)"));
33951
+ //#endregion
33794
33952
  //#region src/cli/post/create.ts
33795
33953
  const create$2 = make$13("create", postWriteOptions, (opts) => gen(function* () {
33796
33954
  const payload = yield* resolveCategoryRefs((yield* buildPostPayload(toPostFlagInputs(opts))).payload);
@@ -33820,7 +33978,7 @@ const del$2 = make$13("delete", {
33820
33978
  })).pipe(withDescription("delete a post"));
33821
33979
  //#endregion
33822
33980
  //#region src/cli/post/edit.ts
33823
- const slugOrId$7 = text$6({ name: "slugOrId" });
33981
+ const slugOrId$8 = text$6({ name: "slugOrId" });
33824
33982
  const escapeXml = (s) => s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
33825
33983
  const materializeForEditor = (slugOrId) => gen(function* () {
33826
33984
  const api = yield* Api;
@@ -33860,7 +34018,7 @@ const metaFromEnvelope = (meta) => {
33860
34018
  return overlay;
33861
34019
  };
33862
34020
  const edit$1 = make$13("edit", {
33863
- slugOrId: slugOrId$7,
34021
+ slugOrId: slugOrId$8,
33864
34022
  ...postWriteOptions
33865
34023
  }, ({ slugOrId, ...rest }) => gen(function* () {
33866
34024
  const flags = toPostFlagInputs(rest);
@@ -34072,6 +34230,42 @@ const publish = make$13("publish", { slugOrId: text$6({ name: "slugOrId" }) }, (
34072
34230
  });
34073
34231
  yield* renderer.emitSuccess(res);
34074
34232
  })).pipe(withDescription("publish a post"));
34233
+ //#endregion
34234
+ //#region src/cli/post/stage.ts
34235
+ const slugOrId$5 = text$6({ name: "slugOrId" });
34236
+ /** Draft-native fields; everything else rides along in `typeSpecificData`. */
34237
+ const DRAFT_CORE_KEYS = new Set([
34238
+ "title",
34239
+ "text",
34240
+ "content",
34241
+ "contentFormat",
34242
+ "meta"
34243
+ ]);
34244
+ const stage = make$13("stage", {
34245
+ slugOrId: slugOrId$5,
34246
+ ...postWriteOptions
34247
+ }, ({ slugOrId, ...rest }) => gen(function* () {
34248
+ const payload = yield* resolveCategoryRefs({ ...(yield* buildPostPayload(toPostFlagInputs(rest))).payload });
34249
+ delete payload.isPublished;
34250
+ if (Object.keys(payload).filter((k) => k !== "contentFormat").length === 0) return yield* fail$2(new ValidationFailed({ message: "nothing to stage: provide --file or content/meta flags" }));
34251
+ const draftBody = {};
34252
+ const typeSpecificData = {};
34253
+ for (const [key, value] of Object.entries(payload)) if (DRAFT_CORE_KEYS.has(key)) draftBody[key] = value;
34254
+ else typeSpecificData[key] = value;
34255
+ if (Object.keys(typeSpecificData).length > 0) draftBody.typeSpecificData = typeSpecificData;
34256
+ const id = yield* (yield* Resolver).resolvePostId(slugOrId);
34257
+ const api = yield* Api;
34258
+ const renderer = yield* Renderer;
34259
+ const res = yield* api.request(`/drafts`, {
34260
+ method: "POST",
34261
+ body: {
34262
+ refType: "post",
34263
+ refId: id,
34264
+ ...draftBody
34265
+ }
34266
+ });
34267
+ yield* renderer.emitSuccess(rest.silent ? { ok: true } : res);
34268
+ })).pipe(withDescription("stage changes as a draft attached to a published post (the live post is untouched until `post apply`)"));
34075
34269
  const unpublish = make$13("unpublish", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
34076
34270
  const resolver = yield* Resolver;
34077
34271
  const api = yield* Api;
@@ -34094,6 +34288,7 @@ const update$2 = make$13("update", {
34094
34288
  delete payload.text;
34095
34289
  delete payload.contentFormat;
34096
34290
  }
34291
+ if (flags.state === void 0) delete payload.isPublished;
34097
34292
  const resolved = yield* resolveCategoryRefs(payload);
34098
34293
  const id = yield* (yield* Resolver).resolvePostId(slugOrId);
34099
34294
  const api = yield* Api;
@@ -34167,6 +34362,20 @@ const help$4 = registerCommandHelp({
34167
34362
  name: "unpublish",
34168
34363
  args: ["<slugOrId>"],
34169
34364
  description: "unpublish a post"
34365
+ },
34366
+ {
34367
+ name: "stage",
34368
+ args: [
34369
+ "<slugOrId>",
34370
+ "[--file <path>]",
34371
+ "..."
34372
+ ],
34373
+ description: "stage changes as a draft; the live post stays untouched"
34374
+ },
34375
+ {
34376
+ name: "apply",
34377
+ args: ["<slugOrId>"],
34378
+ description: "apply the staged draft to the live post"
34170
34379
  }
34171
34380
  ]
34172
34381
  });
@@ -34178,7 +34387,9 @@ const postCmd = make$13("post").pipe(withDescription(help$4.description), withSu
34178
34387
  update$2,
34179
34388
  del$2,
34180
34389
  publish,
34181
- unpublish
34390
+ unpublish,
34391
+ stage,
34392
+ apply
34182
34393
  ]));
34183
34394
  //#endregion
34184
34395
  //#region src/cli/preview/index.ts
@@ -38900,6 +39111,35 @@ async function defaultSpawnUpgrade(cmd, args) {
38900
39111
  });
38901
39112
  });
38902
39113
  }
39114
+ function defaultSpawnDetached(cmd, args, logPath) {
39115
+ try {
39116
+ mkdirSync(path.dirname(logPath), { recursive: true });
39117
+ } catch {}
39118
+ let out;
39119
+ try {
39120
+ out = openSync(logPath, "a");
39121
+ } catch {
39122
+ out = openSync(os.platform() === "win32" ? "NUL" : "/dev/null", "a");
39123
+ }
39124
+ try {
39125
+ const child = spawn(cmd, args, {
39126
+ stdio: [
39127
+ "ignore",
39128
+ out,
39129
+ out
39130
+ ],
39131
+ cwd: process.cwd(),
39132
+ shell: os.platform() === "win32",
39133
+ detached: true,
39134
+ env: {
39135
+ ...process.env,
39136
+ MXS_NO_UPDATE_CHECK: "1"
39137
+ }
39138
+ });
39139
+ child.on("error", () => {});
39140
+ child.unref();
39141
+ } catch {}
39142
+ }
38903
39143
  function defaultConfigDir() {
38904
39144
  const xdg = process.env.XDG_CONFIG_HOME;
38905
39145
  const base = xdg && xdg.length > 0 ? xdg : path.join(os.homedir(), ".config");
@@ -38942,6 +39182,18 @@ function shouldSkipNotify(opts) {
38942
39182
  function readChannelFromEnv(env) {
38943
39183
  return env.MXS_UPDATE_CHANNEL === "next" ? "next" : "stable";
38944
39184
  }
39185
+ const AUTO_UPDATE_LOG = "auto-update.log";
39186
+ const isAutoUpdateDisabled = (env) => env.MXS_NO_AUTO_UPDATE === "1" || env.MXS_NO_AUTO_UPDATE === "true" || env.MXS_NO_AUTO_UPDATE === "yes";
39187
+ const planAutoUpdate = (entry, channel) => {
39188
+ const detection = detectPackageManager(entry);
39189
+ if (detection.kind !== "global") return null;
39190
+ const { cmd, args } = buildUpgradeCommand(detection.pm, channel);
39191
+ return {
39192
+ pm: detection.pm,
39193
+ cmd,
39194
+ args
39195
+ };
39196
+ };
38945
39197
  const KNOWN_PMS = new Set([
38946
39198
  "npm",
38947
39199
  "pnpm",
@@ -38952,9 +39204,30 @@ const make$1 = (deps = {}) => {
38952
39204
  const now = () => deps.now ? deps.now() : Date.now();
38953
39205
  const fetchImpl = deps.fetchImpl;
38954
39206
  const spawnImpl = deps.spawnImpl ?? defaultSpawnUpgrade;
39207
+ const spawnDetached = deps.spawnDetached ?? defaultSpawnDetached;
38955
39208
  const emitInfo = deps.emitInfo ?? ((msg) => process.stderr.write(`${msg}\n`));
38956
39209
  const baseConfigDir = deps.configDir;
38957
39210
  const resolvedConfigDir = (opts) => opts.configDir ?? baseConfigDir ?? defaultConfigDir();
39211
+ const triggerAutoUpdate = (opts, latest, cache, dir, ts) => {
39212
+ const env = opts.env ?? process.env;
39213
+ if (isAutoUpdateDisabled(env)) return false;
39214
+ if (cache?.last_auto_update_ts !== void 0 && ts - cache.last_auto_update_ts < THROTTLE_MS) return false;
39215
+ const channel = opts.channel ?? readChannelFromEnv(env);
39216
+ const plan = planAutoUpdate(deps.entrypoint ?? process.argv[1] ?? "", channel);
39217
+ if (!plan) return false;
39218
+ try {
39219
+ spawnDetached(plan.cmd, plan.args, path.join(dir, AUTO_UPDATE_LOG));
39220
+ } catch {
39221
+ return false;
39222
+ }
39223
+ writeCacheAtomic({
39224
+ last_check_ts: ts,
39225
+ latest_version: latest,
39226
+ etag: cache?.etag,
39227
+ last_auto_update_ts: ts
39228
+ }, dir);
39229
+ return true;
39230
+ };
38958
39231
  const maybeNotify = (opts) => tryPromise({
38959
39232
  try: async () => {
38960
39233
  if (shouldSkipNotify(opts)) return;
@@ -38964,7 +39237,7 @@ const make$1 = (deps = {}) => {
38964
39237
  const channel = opts.channel ?? readChannelFromEnv(opts.env ?? process.env);
38965
39238
  const emit = opts.emit ?? ((msg) => process.stderr.write(`${msg}\n`));
38966
39239
  if (cache && !opts.force && ts - cache.last_check_ts < THROTTLE_MS) {
38967
- if (cache.latest_version && compareSemver(opts.currentVersion, cache.latest_version) < 0) emit(`mxs update available: ${opts.currentVersion} → ${cache.latest_version} run 'mxs update' to upgrade`);
39240
+ if (cache.latest_version && compareSemver(opts.currentVersion, cache.latest_version) < 0) emit(triggerAutoUpdate(opts, cache.latest_version, cache, dir, ts) ? `mxs: auto-updating ${opts.currentVersion} → ${cache.latest_version} in background (set MXS_NO_AUTO_UPDATE=1 to disable)` : `mxs update available: ${opts.currentVersion} → ${cache.latest_version} run 'mxs update' to upgrade`);
38968
39241
  return;
38969
39242
  }
38970
39243
  const controller = new AbortController();
@@ -38988,8 +39261,17 @@ const make$1 = (deps = {}) => {
38988
39261
  writeCacheAtomic({
38989
39262
  last_check_ts: ts,
38990
39263
  latest_version: hit.version,
38991
- etag: hit.etag
39264
+ etag: hit.etag,
39265
+ last_auto_update_ts: cache?.last_auto_update_ts
38992
39266
  }, dir);
39267
+ if (compareSemver(opts.currentVersion, hit.version) < 0) {
39268
+ if (triggerAutoUpdate(opts, hit.version, {
39269
+ last_check_ts: ts,
39270
+ latest_version: hit.version,
39271
+ etag: hit.etag,
39272
+ last_auto_update_ts: cache?.last_auto_update_ts
39273
+ }, dir, ts)) emit(`mxs: auto-updating ${opts.currentVersion} → ${hit.version} in background (set MXS_NO_AUTO_UPDATE=1 to disable)`);
39274
+ }
38993
39275
  } catch {
38994
39276
  clearTimeout(timer);
38995
39277
  writeCacheAtomic({
@@ -39083,31 +39365,7 @@ const make$1 = (deps = {}) => {
39083
39365
  command: shown
39084
39366
  };
39085
39367
  }
39086
- const interactive = Boolean(process.stdin.isTTY) && Boolean(process.stderr.isTTY) && !opts.json;
39087
- if (!opts.yes && interactive && deps.confirmImpl) {
39088
- const confirm = deps.confirmImpl;
39089
- if (!(yield* tryPromise({
39090
- try: () => confirm(`Run \`${shown}\` to upgrade?`),
39091
- catch: (cause) => new UpdateSpawnFailed({
39092
- message: "failed to prompt for confirmation",
39093
- details: { cause: cause instanceof Error ? cause.message : cause }
39094
- })
39095
- }))) {
39096
- emitInfo("mxs: update cancelled");
39097
- return {
39098
- fromVersion: opts.currentVersion,
39099
- toVersion: hit.version,
39100
- pm,
39101
- channel,
39102
- status: 0,
39103
- upgraded: false,
39104
- dryRun: true,
39105
- upToDate: false,
39106
- command: shown,
39107
- cancelled: true
39108
- };
39109
- }
39110
- }
39368
+ if (!opts.json) emitInfo(`mxs: running ${shown}`);
39111
39369
  const result = yield* tryPromise({
39112
39370
  try: () => spawnImpl(cmd, args),
39113
39371
  catch: (cause) => new UpdateSpawnFailed({
@@ -39150,7 +39408,7 @@ var UpdateNotifier = class UpdateNotifier extends Tag$2("UpdateNotifier")() {
39150
39408
  //#region src/cli/update/index.ts
39151
39409
  registerCommandHelp({
39152
39410
  name: "update",
39153
- description: "check for and install a newer mxs release",
39411
+ description: "install the newest mxs release (auto, no prompt)",
39154
39412
  isLeaf: true,
39155
39413
  leafOptions: [
39156
39414
  {
@@ -39171,7 +39429,7 @@ registerCommandHelp({
39171
39429
  },
39172
39430
  {
39173
39431
  flag: "--yes",
39174
- description: "skip the confirmation prompt"
39432
+ description: "deprecated no-op (kept for back-compat; updates run without a prompt by default)"
39175
39433
  }
39176
39434
  ]
39177
39435
  });
@@ -39206,10 +39464,9 @@ const updateCmd = make$13("update", {
39206
39464
  force,
39207
39465
  yes
39208
39466
  }, ({ check, prerelease, pm, force, yes }) => gen(function* () {
39209
- const editor = yield* Editor;
39210
39467
  const renderer = yield* Renderer;
39211
39468
  const outOpts = yield* renderer.options;
39212
- const updater = make$1({ confirmImpl: (message) => runPromise(editor.confirm(message).pipe(catchAll(() => succeed$1(false)))) });
39469
+ const updater = make$1();
39213
39470
  const opts = {
39214
39471
  currentVersion: CLI_VERSION$1,
39215
39472
  check: optBool(check),
@@ -39773,6 +40030,7 @@ const rootCmd = make$13("mxs", {}, () => flatMap$1(Renderer, (r) => r.emitInfo("
39773
40030
  topicCmd,
39774
40031
  commentCmd,
39775
40032
  configCmd,
40033
+ fileCmd,
39776
40034
  skillCmd,
39777
40035
  previewCmd,
39778
40036
  updateCmd
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-space/cli",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Command line interface for mx-space (mx-core) — auth, content, configuration",
5
5
  "keywords": [
6
6
  "mx-space",
@@ -52,9 +52,9 @@
52
52
  "@effect/cli": "0.75.2",
53
53
  "@effect/platform": "0.96.1",
54
54
  "@effect/platform-node": "0.107.0",
55
- "@haklex/rich-headless": "0.20.0",
56
- "@haklex/rich-litexml": "0.21.0",
57
- "@haklex/rich-litexml-cli": "0.20.0",
55
+ "@haklex/rich-headless": "0.22.0",
56
+ "@haklex/rich-litexml": "0.22.0",
57
+ "@haklex/rich-litexml-cli": "0.22.0",
58
58
  "@lexical/headless": "^0.45.0",
59
59
  "better-auth": "^1.6.14",
60
60
  "effect": "3.21.2",
@@ -1,2 +0,0 @@
1
- import { E as Schema_exports } from "./esm-Dg-WhPCe.mjs";
2
- export { Schema_exports as Schema };