@mx-space/cli 0.8.0 → 0.9.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/README.md +30 -0
- package/ROADMAP.md +1 -0
- package/dist/bin/mxs.mjs +1 -1
- package/dist/index.d.mts +10 -1
- package/dist/index.mjs +1 -1
- package/dist/{mxs-DT0oYk6U.mjs → mxs-BR5Y5ash.mjs} +884 -484
- package/package.json +1 -1
- package/skills/commands-auth.md +1 -1
- package/skills/commands-category.md +1 -1
- package/skills/commands-comment.md +1 -1
- package/skills/commands-config.md +1 -1
- package/skills/commands-preview.md +1 -1
- package/skills/commands-profile.md +1 -1
- package/skills/commands-project.md +57 -0
- package/skills/commands-topic.md +1 -1
- package/skills/output-modes.md +1 -1
- package/skills/overview.md +2 -1
- package/skills/safety.md +10 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as drain, $a as identity, $i as reduce$1, $n as try_, $r as get$
|
|
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";
|
|
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";
|
|
@@ -55,8 +55,8 @@ const Module = /*#__PURE__*/ Literal("Clipboard", "Command", "FileSystem", "KeyV
|
|
|
55
55
|
var BadArgument = class extends TaggedError("@effect/platform/Error/BadArgument")("BadArgument", {
|
|
56
56
|
module: Module,
|
|
57
57
|
method: String$,
|
|
58
|
-
description: /*#__PURE__*/ optional$
|
|
59
|
-
cause: /*#__PURE__*/ optional$
|
|
58
|
+
description: /*#__PURE__*/ optional$8(String$),
|
|
59
|
+
cause: /*#__PURE__*/ optional$8(Defect)
|
|
60
60
|
}) {
|
|
61
61
|
/**
|
|
62
62
|
* @since 1.0.0
|
|
@@ -82,10 +82,10 @@ var SystemError = class extends TaggedError("@effect/platform/Error/SystemError"
|
|
|
82
82
|
reason: SystemErrorReason,
|
|
83
83
|
module: Module,
|
|
84
84
|
method: String$,
|
|
85
|
-
description: /*#__PURE__*/ optional$
|
|
86
|
-
syscall: /*#__PURE__*/ optional$
|
|
87
|
-
pathOrDescriptor: /*#__PURE__*/ optional$
|
|
88
|
-
cause: /*#__PURE__*/ optional$
|
|
85
|
+
description: /*#__PURE__*/ optional$8(String$),
|
|
86
|
+
syscall: /*#__PURE__*/ optional$8(String$),
|
|
87
|
+
pathOrDescriptor: /*#__PURE__*/ optional$8(/*#__PURE__*/ Union(String$, Number$)),
|
|
88
|
+
cause: /*#__PURE__*/ optional$8(Defect)
|
|
89
89
|
}) {
|
|
90
90
|
/**
|
|
91
91
|
* @since 1.0.0
|
|
@@ -722,7 +722,7 @@ const char$2 = (char) => {
|
|
|
722
722
|
return op;
|
|
723
723
|
};
|
|
724
724
|
/** @internal */
|
|
725
|
-
const text$
|
|
725
|
+
const text$13 = (text) => {
|
|
726
726
|
const op = Object.create(proto$9);
|
|
727
727
|
op._tag = "Text";
|
|
728
728
|
op.text = text;
|
|
@@ -907,7 +907,7 @@ const annotate$1 = /*#__PURE__*/ dual(2, (self, annotation) => {
|
|
|
907
907
|
const spaces = (n) => {
|
|
908
908
|
if (n <= 0) return empty$10;
|
|
909
909
|
if (n === 1) return char$2(" ");
|
|
910
|
-
return text$
|
|
910
|
+
return text$13(textSpaces(n));
|
|
911
911
|
};
|
|
912
912
|
/** @internal */
|
|
913
913
|
const textSpaces = (n) => {
|
|
@@ -974,7 +974,7 @@ const char$1 = /*#__PURE__*/ dual(2, (self, char) => {
|
|
|
974
974
|
return op;
|
|
975
975
|
});
|
|
976
976
|
/** @internal */
|
|
977
|
-
const text$
|
|
977
|
+
const text$12 = /*#__PURE__*/ dual(2, (self, text) => {
|
|
978
978
|
const op = Object.create(proto$8);
|
|
979
979
|
op._tag = "TextStream";
|
|
980
980
|
op.text = text;
|
|
@@ -1082,7 +1082,7 @@ const wadlerLeijenSafe = (self, nestingLevel, currentColumn, fits, options) => {
|
|
|
1082
1082
|
case "Char": return char$1(yield* best(self.pipeline, nl, cc + 1), self.document.char);
|
|
1083
1083
|
case "Text": {
|
|
1084
1084
|
const length = self.document.text.length;
|
|
1085
|
-
return text$
|
|
1085
|
+
return text$12(yield* best(self.pipeline, nl, cc + length), self.document.text);
|
|
1086
1086
|
}
|
|
1087
1087
|
case "Line": {
|
|
1088
1088
|
const stream = yield* best(self.pipeline, self.indent, self.indent);
|
|
@@ -1136,7 +1136,7 @@ const compactSafe = (docs, i) => gen(function* () {
|
|
|
1136
1136
|
case "Fail": return failed;
|
|
1137
1137
|
case "Empty": return yield* compactSafe(tail, i);
|
|
1138
1138
|
case "Char": return char$1(yield* compactSafe(tail, i + 1), head.char);
|
|
1139
|
-
case "Text": return text$
|
|
1139
|
+
case "Text": return text$12(yield* compactSafe(tail, i + head.text.length), head.text);
|
|
1140
1140
|
case "Line": return line(yield* compactSafe(tail, 0), 0);
|
|
1141
1141
|
case "FlatAlt": return yield* compactSafe(cons$1(head.left, tail), i);
|
|
1142
1142
|
case "Cat": return yield* compactSafe(cons$1(head.left, cons$1(head.right, tail)), i);
|
|
@@ -1295,7 +1295,7 @@ const char = char$2;
|
|
|
1295
1295
|
* @since 1.0.0
|
|
1296
1296
|
* @category constructors
|
|
1297
1297
|
*/
|
|
1298
|
-
const text$
|
|
1298
|
+
const text$11 = text$13;
|
|
1299
1299
|
/**
|
|
1300
1300
|
* The `empty` document behaves like a document containing the empty string
|
|
1301
1301
|
* (`""`), so it has a height of `1`.
|
|
@@ -2008,10 +2008,10 @@ const optimizeSafe = (self, depth) => {
|
|
|
2008
2008
|
case "Cat":
|
|
2009
2009
|
if (isEmpty$4(self.left)) return yield* optimize(self.right);
|
|
2010
2010
|
if (isEmpty$4(self.right)) return yield* optimize(self.left);
|
|
2011
|
-
if (isChar(self.left) && isChar(self.right)) return text$
|
|
2012
|
-
if (isText$2(self.left) && isChar(self.right)) return text$
|
|
2013
|
-
if (isChar(self.left) && isText$2(self.right)) return text$
|
|
2014
|
-
if (isText$2(self.left) && isText$2(self.right)) return text$
|
|
2011
|
+
if (isChar(self.left) && isChar(self.right)) return text$13(self.left.char + self.right.char);
|
|
2012
|
+
if (isText$2(self.left) && isChar(self.right)) return text$13(self.left.text + self.right.char);
|
|
2013
|
+
if (isChar(self.left) && isText$2(self.right)) return text$13(self.left.char + self.right.text);
|
|
2014
|
+
if (isText$2(self.left) && isText$2(self.right)) return text$13(self.left.text + self.right.text);
|
|
2015
2015
|
if (isChar(self.left) && isCat(self.right) && isChar(self.right.left) || isChar(self.left) && isCat(self.right) && isText$2(self.right.left) || isText$2(self.left) && isCat(self.right) && isChar(self.right.left) || isText$2(self.left) && isCat(self.right) && isText$2(self.right.left)) return yield* optimize(cat$1(yield* optimize(cat$1(self.left, self.right.left)), self.right.right));
|
|
2016
2016
|
if (isCat(self.left) && isChar(self.left.right) || isCat(self.left) && isText$2(self.left.right)) {
|
|
2017
2017
|
const inner = yield* optimize(cat$1(self.left.right, self.right));
|
|
@@ -2111,14 +2111,14 @@ const white = white$3;
|
|
|
2111
2111
|
//#endregion
|
|
2112
2112
|
//#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/helpDoc/span.js
|
|
2113
2113
|
/** @internal */
|
|
2114
|
-
const text$
|
|
2114
|
+
const text$10 = (value) => ({
|
|
2115
2115
|
_tag: "Text",
|
|
2116
2116
|
value
|
|
2117
2117
|
});
|
|
2118
2118
|
/** @internal */
|
|
2119
|
-
const empty$7 = /*#__PURE__*/ text$
|
|
2119
|
+
const empty$7 = /*#__PURE__*/ text$10("");
|
|
2120
2120
|
/** @internal */
|
|
2121
|
-
const space = /*#__PURE__*/ text$
|
|
2121
|
+
const space = /*#__PURE__*/ text$10(" ");
|
|
2122
2122
|
/** @internal */
|
|
2123
2123
|
const code = (value) => highlight(value, white);
|
|
2124
2124
|
/** @internal */
|
|
@@ -2126,18 +2126,18 @@ const error = (value) => highlight(value, red);
|
|
|
2126
2126
|
/** @internal */
|
|
2127
2127
|
const highlight = (value, color) => ({
|
|
2128
2128
|
_tag: "Highlight",
|
|
2129
|
-
value: typeof value === "string" ? text$
|
|
2129
|
+
value: typeof value === "string" ? text$10(value) : value,
|
|
2130
2130
|
color
|
|
2131
2131
|
});
|
|
2132
2132
|
/** @internal */
|
|
2133
2133
|
const strong = (value) => ({
|
|
2134
2134
|
_tag: "Strong",
|
|
2135
|
-
value: typeof value === "string" ? text$
|
|
2135
|
+
value: typeof value === "string" ? text$10(value) : value
|
|
2136
2136
|
});
|
|
2137
2137
|
/** @internal */
|
|
2138
2138
|
const weak = (value) => ({
|
|
2139
2139
|
_tag: "Weak",
|
|
2140
|
-
value: typeof value === "string" ? text$
|
|
2140
|
+
value: typeof value === "string" ? text$10(value) : value
|
|
2141
2141
|
});
|
|
2142
2142
|
/** @internal */
|
|
2143
2143
|
const isText$1 = (self) => self._tag === "Text";
|
|
@@ -2164,16 +2164,16 @@ const spans = (spans) => {
|
|
|
2164
2164
|
return empty$7;
|
|
2165
2165
|
};
|
|
2166
2166
|
/** @internal */
|
|
2167
|
-
const isEmpty$3 = (self) => size$
|
|
2167
|
+
const isEmpty$3 = (self) => size$5(self) === 0;
|
|
2168
2168
|
/** @internal */
|
|
2169
|
-
const size$
|
|
2169
|
+
const size$5 = (self) => {
|
|
2170
2170
|
switch (self._tag) {
|
|
2171
2171
|
case "Text":
|
|
2172
2172
|
case "URI": return self.value.length;
|
|
2173
2173
|
case "Highlight":
|
|
2174
2174
|
case "Strong":
|
|
2175
|
-
case "Weak": return size$
|
|
2176
|
-
case "Sequence": return size$
|
|
2175
|
+
case "Weak": return size$5(self.value);
|
|
2176
|
+
case "Sequence": return size$5(self.left) + size$5(self.right);
|
|
2177
2177
|
}
|
|
2178
2178
|
};
|
|
2179
2179
|
/** @internal */
|
|
@@ -2182,8 +2182,8 @@ const toAnsiDoc$1 = (self) => {
|
|
|
2182
2182
|
case "Highlight": return annotate(toAnsiDoc$1(self.value), color$1(self.color));
|
|
2183
2183
|
case "Sequence": return cat(toAnsiDoc$1(self.left), toAnsiDoc$1(self.right));
|
|
2184
2184
|
case "Strong": return annotate(toAnsiDoc$1(self.value), bold$1);
|
|
2185
|
-
case "Text": return text$
|
|
2186
|
-
case "URI": return annotate(text$
|
|
2185
|
+
case "Text": return text$11(self.value);
|
|
2186
|
+
case "URI": return annotate(text$11(self.value), underlined);
|
|
2187
2187
|
case "Weak": return annotate(toAnsiDoc$1(self.value), blackBright);
|
|
2188
2188
|
}
|
|
2189
2189
|
};
|
|
@@ -2230,13 +2230,13 @@ const enumeration = (elements) => ({
|
|
|
2230
2230
|
/** @internal */
|
|
2231
2231
|
const h1 = (value) => ({
|
|
2232
2232
|
_tag: "Header",
|
|
2233
|
-
value: typeof value === "string" ? text$
|
|
2233
|
+
value: typeof value === "string" ? text$10(value) : value,
|
|
2234
2234
|
level: 1
|
|
2235
2235
|
});
|
|
2236
2236
|
/** @internal */
|
|
2237
2237
|
const p$1 = (value) => ({
|
|
2238
2238
|
_tag: "Paragraph",
|
|
2239
|
-
value: typeof value === "string" ? text$
|
|
2239
|
+
value: typeof value === "string" ? text$10(value) : value
|
|
2240
2240
|
});
|
|
2241
2241
|
/** @internal */
|
|
2242
2242
|
const mapDescriptionList = /*#__PURE__*/ dual(2, (self, f) => isDescriptionList(self) ? descriptionList(map$7(self.definitions, ([span, helpDoc]) => f(span, helpDoc))) : self);
|
|
@@ -2254,7 +2254,7 @@ const toAnsiDocInternal = (self) => {
|
|
|
2254
2254
|
empty$8,
|
|
2255
2255
|
indent$1(toAnsiDocInternal(doc), 2)
|
|
2256
2256
|
])));
|
|
2257
|
-
case "Enumeration": return indent$1(vsep(self.elements.map((doc) => cat(text$
|
|
2257
|
+
case "Enumeration": return indent$1(vsep(self.elements.map((doc) => cat(text$11("- "), toAnsiDocInternal(doc)))), 2);
|
|
2258
2258
|
case "Sequence": return vsep([toAnsiDocInternal(self.left), toAnsiDocInternal(self.right)]);
|
|
2259
2259
|
}
|
|
2260
2260
|
};
|
|
@@ -2382,36 +2382,36 @@ const succeed = (value) => {
|
|
|
2382
2382
|
//#endregion
|
|
2383
2383
|
//#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/ansi-utils.js
|
|
2384
2384
|
const defaultFigures = {
|
|
2385
|
-
arrowUp: /*#__PURE__*/ text$
|
|
2386
|
-
arrowDown: /*#__PURE__*/ text$
|
|
2387
|
-
arrowLeft: /*#__PURE__*/ text$
|
|
2388
|
-
arrowRight: /*#__PURE__*/ text$
|
|
2389
|
-
radioOn: /*#__PURE__*/ text$
|
|
2390
|
-
radioOff: /*#__PURE__*/ text$
|
|
2391
|
-
checkboxOn: /*#__PURE__*/ text$
|
|
2392
|
-
checkboxOff: /*#__PURE__*/ text$
|
|
2393
|
-
tick: /*#__PURE__*/ text$
|
|
2394
|
-
cross: /*#__PURE__*/ text$
|
|
2395
|
-
ellipsis: /*#__PURE__*/ text$
|
|
2396
|
-
pointerSmall: /*#__PURE__*/ text$
|
|
2397
|
-
line: /*#__PURE__*/ text$
|
|
2398
|
-
pointer: /*#__PURE__*/ text$
|
|
2385
|
+
arrowUp: /*#__PURE__*/ text$11("↑"),
|
|
2386
|
+
arrowDown: /*#__PURE__*/ text$11("↓"),
|
|
2387
|
+
arrowLeft: /*#__PURE__*/ text$11("←"),
|
|
2388
|
+
arrowRight: /*#__PURE__*/ text$11("→"),
|
|
2389
|
+
radioOn: /*#__PURE__*/ text$11("◉"),
|
|
2390
|
+
radioOff: /*#__PURE__*/ text$11("◯"),
|
|
2391
|
+
checkboxOn: /*#__PURE__*/ text$11("☒"),
|
|
2392
|
+
checkboxOff: /*#__PURE__*/ text$11("☐"),
|
|
2393
|
+
tick: /*#__PURE__*/ text$11("✔"),
|
|
2394
|
+
cross: /*#__PURE__*/ text$11("✖"),
|
|
2395
|
+
ellipsis: /*#__PURE__*/ text$11("…"),
|
|
2396
|
+
pointerSmall: /*#__PURE__*/ text$11("›"),
|
|
2397
|
+
line: /*#__PURE__*/ text$11("─"),
|
|
2398
|
+
pointer: /*#__PURE__*/ text$11("❯")
|
|
2399
2399
|
};
|
|
2400
2400
|
const windowsFigures = {
|
|
2401
2401
|
arrowUp: defaultFigures.arrowUp,
|
|
2402
2402
|
arrowDown: defaultFigures.arrowDown,
|
|
2403
2403
|
arrowLeft: defaultFigures.arrowLeft,
|
|
2404
2404
|
arrowRight: defaultFigures.arrowRight,
|
|
2405
|
-
radioOn: /*#__PURE__*/ text$
|
|
2406
|
-
radioOff: /*#__PURE__*/ text$
|
|
2407
|
-
checkboxOn: /*#__PURE__*/ text$
|
|
2408
|
-
checkboxOff: /*#__PURE__*/ text$
|
|
2409
|
-
tick: /*#__PURE__*/ text$
|
|
2410
|
-
cross: /*#__PURE__*/ text$
|
|
2411
|
-
ellipsis: /*#__PURE__*/ text$
|
|
2412
|
-
pointerSmall: /*#__PURE__*/ text$
|
|
2413
|
-
line: /*#__PURE__*/ text$
|
|
2414
|
-
pointer: /*#__PURE__*/ text$
|
|
2405
|
+
radioOn: /*#__PURE__*/ text$11("(*)"),
|
|
2406
|
+
radioOff: /*#__PURE__*/ text$11("( )"),
|
|
2407
|
+
checkboxOn: /*#__PURE__*/ text$11("[*]"),
|
|
2408
|
+
checkboxOff: /*#__PURE__*/ text$11("[ ]"),
|
|
2409
|
+
tick: /*#__PURE__*/ text$11("√"),
|
|
2410
|
+
cross: /*#__PURE__*/ text$11("×"),
|
|
2411
|
+
ellipsis: /*#__PURE__*/ text$11("..."),
|
|
2412
|
+
pointerSmall: /*#__PURE__*/ text$11("»"),
|
|
2413
|
+
line: /*#__PURE__*/ text$11("─"),
|
|
2414
|
+
pointer: /*#__PURE__*/ text$11(">")
|
|
2415
2415
|
};
|
|
2416
2416
|
/** @internal */
|
|
2417
2417
|
const figures = /*#__PURE__*/ map$6(/*#__PURE__*/ sync(() => process.platform === "win32"), (isWindows) => isWindows ? windowsFigures : defaultFigures);
|
|
@@ -2459,7 +2459,7 @@ function renderError$2(state, pointer) {
|
|
|
2459
2459
|
onSome: (error) => {
|
|
2460
2460
|
const errorLines = error.split(NEWLINE_REGEX$3);
|
|
2461
2461
|
if (isNonEmptyReadonlyArray(errorLines)) {
|
|
2462
|
-
const annotateLine = (line) => annotate(text$
|
|
2462
|
+
const annotateLine = (line) => annotate(text$11(line), combine(italicized, red$1));
|
|
2463
2463
|
const prefix = cat(annotate(pointer, red$1), space$1);
|
|
2464
2464
|
const lines = map$7(errorLines, (str) => annotateLine(str));
|
|
2465
2465
|
return cursorSavePosition.pipe(cat(hardLine), cat(prefix), cat(align(vsep(lines))), cat(cursorRestorePosition));
|
|
@@ -2470,13 +2470,13 @@ function renderError$2(state, pointer) {
|
|
|
2470
2470
|
}
|
|
2471
2471
|
function renderParts(state, submitted = false) {
|
|
2472
2472
|
return reduce$1(state.dateParts, empty$8, (doc, part, currentIndex) => {
|
|
2473
|
-
const partDoc = text$
|
|
2473
|
+
const partDoc = text$11(part.toString());
|
|
2474
2474
|
if (currentIndex === state.cursor && !submitted) return cat(doc, annotate(partDoc, combine(underlined, cyanBright)));
|
|
2475
2475
|
return cat(doc, partDoc);
|
|
2476
2476
|
});
|
|
2477
2477
|
}
|
|
2478
2478
|
function renderOutput$4(leadingSymbol, trailingSymbol, parts, options) {
|
|
2479
|
-
const annotateLine = (line) => annotate(text$
|
|
2479
|
+
const annotateLine = (line) => annotate(text$11(line), bold$1);
|
|
2480
2480
|
const prefix = cat(leadingSymbol, space$1);
|
|
2481
2481
|
return match$1(options.message.split(/\r?\n/), {
|
|
2482
2482
|
onEmpty: () => hsep([
|
|
@@ -2494,7 +2494,7 @@ function renderNextFrame$5(state, options) {
|
|
|
2494
2494
|
return gen(function* () {
|
|
2495
2495
|
const columns = yield* (yield* Terminal).columns;
|
|
2496
2496
|
const figures$12 = yield* figures;
|
|
2497
|
-
const promptMsg = renderOutput$4(annotate(text$
|
|
2497
|
+
const promptMsg = renderOutput$4(annotate(text$11("?"), cyanBright), annotate(figures$12.pointerSmall, blackBright), renderParts(state), options);
|
|
2498
2498
|
const errorMsg = renderError$2(state, figures$12.pointerSmall);
|
|
2499
2499
|
return cursorHide.pipe(cat(promptMsg), cat(errorMsg), optimize(Deep), render$2({
|
|
2500
2500
|
style: "pretty",
|
|
@@ -2961,7 +2961,7 @@ function handleClear$4(options) {
|
|
|
2961
2961
|
}
|
|
2962
2962
|
const NEWLINE_REGEX$2 = /\r?\n/;
|
|
2963
2963
|
function renderPrompt(confirm, message, leadingSymbol, trailingSymbol) {
|
|
2964
|
-
const annotateLine = (line) => annotate(text$
|
|
2964
|
+
const annotateLine = (line) => annotate(text$11(line), bold$1);
|
|
2965
2965
|
const prefix = cat(leadingSymbol, space$1);
|
|
2966
2966
|
return match$1(message.split(NEWLINE_REGEX$2), {
|
|
2967
2967
|
onEmpty: () => hsep([
|
|
@@ -2982,7 +2982,7 @@ function renderPrefix(state, toDisplay, currentIndex, length, figures) {
|
|
|
2982
2982
|
return state.cursor === currentIndex ? figures.pointer.pipe(annotate(cyanBright), cat(prefix)) : prefix.pipe(cat(space$1));
|
|
2983
2983
|
}
|
|
2984
2984
|
function renderFileName(file, isSelected) {
|
|
2985
|
-
return isSelected ? annotate(text$
|
|
2985
|
+
return isSelected ? annotate(text$11(file), combine(underlined, cyanBright)) : text$11(file);
|
|
2986
2986
|
}
|
|
2987
2987
|
function renderFiles(state, files, figures, options) {
|
|
2988
2988
|
const length = files.length;
|
|
@@ -3004,11 +3004,11 @@ function renderNextFrame$4(state, options) {
|
|
|
3004
3004
|
const currentPath = yield* resolveCurrentPath(state.path, options);
|
|
3005
3005
|
const selectedPath = state.files[state.cursor];
|
|
3006
3006
|
const resolvedPath = path.resolve(currentPath, selectedPath);
|
|
3007
|
-
const resolvedPathMsg = figures$9.pointerSmall.pipe(cat(space$1), cat(text$
|
|
3007
|
+
const resolvedPathMsg = figures$9.pointerSmall.pipe(cat(space$1), cat(text$11(resolvedPath)), annotate(blackBright));
|
|
3008
3008
|
if (showConfirmation(state.confirm)) {
|
|
3009
|
-
const leadingSymbol = annotate(text$
|
|
3009
|
+
const leadingSymbol = annotate(text$11("?"), cyanBright);
|
|
3010
3010
|
const trailingSymbol = annotate(figures$9.pointerSmall, blackBright);
|
|
3011
|
-
const promptMsg = renderPrompt(annotate(text$
|
|
3011
|
+
const promptMsg = renderPrompt(annotate(text$11("(Y/n)"), blackBright), CONFIRM_MESSAGE, leadingSymbol, trailingSymbol);
|
|
3012
3012
|
return cursorHide.pipe(cat(promptMsg), cat(hardLine), cat(resolvedPathMsg), optimize(Deep), render$2({
|
|
3013
3013
|
style: "pretty",
|
|
3014
3014
|
options: { lineWidth: columns }
|
|
@@ -3030,7 +3030,7 @@ function renderSubmission$4(value, options) {
|
|
|
3030
3030
|
const figures$10 = yield* figures;
|
|
3031
3031
|
const leadingSymbol = annotate(figures$10.tick, green);
|
|
3032
3032
|
const trailingSymbol = annotate(figures$10.ellipsis, blackBright);
|
|
3033
|
-
return renderPrompt(empty$8, options.message, leadingSymbol, trailingSymbol).pipe(cat(space$1), cat(annotate(text$
|
|
3033
|
+
return renderPrompt(empty$8, options.message, leadingSymbol, trailingSymbol).pipe(cat(space$1), cat(annotate(text$11(value), white$1)), cat(hardLine), render$2({
|
|
3034
3034
|
style: "pretty",
|
|
3035
3035
|
options: { lineWidth: columns }
|
|
3036
3036
|
}));
|
|
@@ -3123,7 +3123,7 @@ function handleProcess$3(options) {
|
|
|
3123
3123
|
});
|
|
3124
3124
|
}
|
|
3125
3125
|
/** @internal */
|
|
3126
|
-
const file$
|
|
3126
|
+
const file$4 = (options = {}) => {
|
|
3127
3127
|
const opts = {
|
|
3128
3128
|
type: options.type ?? "file",
|
|
3129
3129
|
message: options.message ?? `Choose a file`,
|
|
@@ -3172,7 +3172,7 @@ function renderInput$1(state, submitted) {
|
|
|
3172
3172
|
onNone: () => combine(underlined, cyanBright),
|
|
3173
3173
|
onSome: () => red$1
|
|
3174
3174
|
});
|
|
3175
|
-
const value = state.value === "" ? empty$8 : text$
|
|
3175
|
+
const value = state.value === "" ? empty$8 : text$11(`${state.value}`);
|
|
3176
3176
|
return submitted ? value : annotate(value, annotation);
|
|
3177
3177
|
}
|
|
3178
3178
|
const NEWLINE_REGEX$1 = /\r?\n/;
|
|
@@ -3182,7 +3182,7 @@ function renderError$1(state, pointer) {
|
|
|
3182
3182
|
onSome: (error) => match$1(error.split(NEWLINE_REGEX$1), {
|
|
3183
3183
|
onEmpty: () => empty$8,
|
|
3184
3184
|
onNonEmpty: (errorLines) => {
|
|
3185
|
-
const annotateLine = (line) => annotate(text$
|
|
3185
|
+
const annotateLine = (line) => annotate(text$11(line), combine(italicized, red$1));
|
|
3186
3186
|
const prefix = cat(annotate(pointer, red$1), space$1);
|
|
3187
3187
|
const lines = map$7(errorLines, (str) => annotateLine(str));
|
|
3188
3188
|
return cursorSavePosition.pipe(cat(hardLine), cat(prefix), cat(align(vsep(lines))), cat(cursorRestorePosition));
|
|
@@ -3191,7 +3191,7 @@ function renderError$1(state, pointer) {
|
|
|
3191
3191
|
});
|
|
3192
3192
|
}
|
|
3193
3193
|
function renderOutput$3(state, leadingSymbol, trailingSymbol, options, submitted = false) {
|
|
3194
|
-
const annotateLine = (line) => annotate(text$
|
|
3194
|
+
const annotateLine = (line) => annotate(text$11(line), bold$1);
|
|
3195
3195
|
const prefix = cat(leadingSymbol, space$1);
|
|
3196
3196
|
return match$1(options.message.split(/\r?\n/), {
|
|
3197
3197
|
onEmpty: () => hsep([
|
|
@@ -3209,7 +3209,7 @@ function renderNextFrame$3(state, options) {
|
|
|
3209
3209
|
return gen(function* () {
|
|
3210
3210
|
const columns = yield* (yield* Terminal).columns;
|
|
3211
3211
|
const figures$7 = yield* figures;
|
|
3212
|
-
const leadingSymbol = annotate(text$
|
|
3212
|
+
const leadingSymbol = annotate(text$11("?"), cyanBright);
|
|
3213
3213
|
const trailingSymbol = annotate(figures$7.pointerSmall, blackBright);
|
|
3214
3214
|
const errorMsg = renderError$1(state, figures$7.pointerSmall);
|
|
3215
3215
|
return renderOutput$3(state, leadingSymbol, trailingSymbol, options).pipe(cat(errorMsg), optimize(Deep), render$2({
|
|
@@ -3405,7 +3405,7 @@ const float = (options) => {
|
|
|
3405
3405
|
const renderBeep$2 = /*#__PURE__*/ render$2(beep, { style: "pretty" });
|
|
3406
3406
|
const NEWLINE_REGEX = /\r?\n/;
|
|
3407
3407
|
function renderOutput$2(leadingSymbol, trailingSymbol, options) {
|
|
3408
|
-
const annotateLine = (line) => annotate(text$
|
|
3408
|
+
const annotateLine = (line) => annotate(text$11(line), bold$1);
|
|
3409
3409
|
const prefix = cat(leadingSymbol, space$1);
|
|
3410
3410
|
return match$1(options.message.split(NEWLINE_REGEX), {
|
|
3411
3411
|
onEmpty: () => hsep([prefix, trailingSymbol]),
|
|
@@ -3426,12 +3426,12 @@ function renderChoicePrefix(state, choices, toDisplay, currentIndex, figures) {
|
|
|
3426
3426
|
return state === currentIndex ? figures.pointer.pipe(annotate(cyanBright), cat(prefix)) : prefix.pipe(cat(space$1));
|
|
3427
3427
|
}
|
|
3428
3428
|
function renderChoiceTitle(choice, isSelected) {
|
|
3429
|
-
const title = text$
|
|
3429
|
+
const title = text$11(choice.title);
|
|
3430
3430
|
if (isSelected) return choice.disabled ? annotate(title, combine(underlined, blackBright)) : annotate(title, combine(underlined, cyanBright));
|
|
3431
3431
|
return choice.disabled ? annotate(title, combine(strikethrough, blackBright)) : title;
|
|
3432
3432
|
}
|
|
3433
3433
|
function renderChoiceDescription(choice, isSelected) {
|
|
3434
|
-
if (!choice.disabled && choice.description && isSelected) return char("-").pipe(cat(space$1), cat(text$
|
|
3434
|
+
if (!choice.disabled && choice.description && isSelected) return char("-").pipe(cat(space$1), cat(text$11(choice.description)), annotate(blackBright));
|
|
3435
3435
|
return empty$8;
|
|
3436
3436
|
}
|
|
3437
3437
|
function renderChoices(state, options, figures) {
|
|
@@ -3453,7 +3453,7 @@ function renderNextFrame$2(state, options) {
|
|
|
3453
3453
|
const columns = yield* (yield* Terminal).columns;
|
|
3454
3454
|
const figures$5 = yield* figures;
|
|
3455
3455
|
const choices = renderChoices(state, options, figures$5);
|
|
3456
|
-
const promptMsg = renderOutput$2(annotate(text$
|
|
3456
|
+
const promptMsg = renderOutput$2(annotate(text$11("?"), cyanBright), annotate(figures$5.pointerSmall, blackBright), options);
|
|
3457
3457
|
return cursorHide.pipe(cat(promptMsg), cat(hardLine), cat(choices), render$2({
|
|
3458
3458
|
style: "pretty",
|
|
3459
3459
|
options: { lineWidth: columns }
|
|
@@ -3464,7 +3464,7 @@ function renderSubmission$2(state, options) {
|
|
|
3464
3464
|
return gen(function* () {
|
|
3465
3465
|
const columns = yield* (yield* Terminal).columns;
|
|
3466
3466
|
const figures$6 = yield* figures;
|
|
3467
|
-
const selected = text$
|
|
3467
|
+
const selected = text$11(options.choices[state].title);
|
|
3468
3468
|
return renderOutput$2(annotate(figures$6.tick, green), annotate(figures$6.ellipsis, blackBright), options).pipe(cat(space$1), cat(annotate(selected, white$1)), cat(hardLine), render$2({
|
|
3469
3469
|
style: "pretty",
|
|
3470
3470
|
options: { lineWidth: columns }
|
|
@@ -3572,8 +3572,8 @@ function renderInput(nextState, options, submitted) {
|
|
|
3572
3572
|
});
|
|
3573
3573
|
switch (options.type) {
|
|
3574
3574
|
case "hidden": return empty$8;
|
|
3575
|
-
case "password": return annotate(text$
|
|
3576
|
-
case "text": return annotate(text$
|
|
3575
|
+
case "password": return annotate(text$11("*".repeat(text.length)), annotation);
|
|
3576
|
+
case "text": return annotate(text$11(text), annotation);
|
|
3577
3577
|
}
|
|
3578
3578
|
}
|
|
3579
3579
|
function renderError(nextState, pointer) {
|
|
@@ -3582,7 +3582,7 @@ function renderError(nextState, pointer) {
|
|
|
3582
3582
|
onSome: (error) => match$1(error.split(/\r?\n/), {
|
|
3583
3583
|
onEmpty: () => empty$8,
|
|
3584
3584
|
onNonEmpty: (errorLines) => {
|
|
3585
|
-
const annotateLine = (line) => text$
|
|
3585
|
+
const annotateLine = (line) => text$11(line).pipe(annotate(combine(italicized, red$1)));
|
|
3586
3586
|
const prefix = cat(annotate(pointer, red$1), space$1);
|
|
3587
3587
|
const lines = map$7(errorLines, (str) => annotateLine(str));
|
|
3588
3588
|
return cursorSavePosition.pipe(cat(hardLine), cat(prefix), cat(align(vsep(lines))), cat(cursorRestorePosition));
|
|
@@ -3591,7 +3591,7 @@ function renderError(nextState, pointer) {
|
|
|
3591
3591
|
});
|
|
3592
3592
|
}
|
|
3593
3593
|
function renderOutput$1(nextState, leadingSymbol, trailingSymbol, options, submitted = false) {
|
|
3594
|
-
const annotateLine = (line) => annotate(text$
|
|
3594
|
+
const annotateLine = (line) => annotate(text$11(line), bold$1);
|
|
3595
3595
|
const promptLines = options.message.split(/\r?\n/);
|
|
3596
3596
|
const prefix = cat(leadingSymbol, space$1);
|
|
3597
3597
|
if (isNonEmptyReadonlyArray(promptLines)) {
|
|
@@ -3608,7 +3608,7 @@ function renderNextFrame$1(state, options) {
|
|
|
3608
3608
|
return gen(function* () {
|
|
3609
3609
|
const columns = yield* (yield* Terminal).columns;
|
|
3610
3610
|
const figures$3 = yield* figures;
|
|
3611
|
-
const promptMsg = renderOutput$1(state, annotate(text$
|
|
3611
|
+
const promptMsg = renderOutput$1(state, annotate(text$11("?"), cyanBright), annotate(figures$3.pointerSmall, blackBright), options);
|
|
3612
3612
|
const errorMsg = renderError(state, figures$3.pointerSmall);
|
|
3613
3613
|
const offset = state.cursor - state.value.length;
|
|
3614
3614
|
return promptMsg.pipe(cat(errorMsg), cat(cursorMove(offset)), optimize(Deep), render$2({
|
|
@@ -3737,7 +3737,7 @@ function basePrompt(options, type) {
|
|
|
3737
3737
|
/** @internal */
|
|
3738
3738
|
const hidden = (options) => basePrompt(options, "hidden").pipe(map$3(make$21));
|
|
3739
3739
|
/** @internal */
|
|
3740
|
-
const text$
|
|
3740
|
+
const text$9 = (options) => basePrompt(options, "text");
|
|
3741
3741
|
//#endregion
|
|
3742
3742
|
//#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/toggle.js
|
|
3743
3743
|
const renderBeep = /*#__PURE__*/ render$2(beep, { style: "pretty" });
|
|
@@ -3754,15 +3754,15 @@ function handleClear(options) {
|
|
|
3754
3754
|
function renderToggle(value, options, submitted = false) {
|
|
3755
3755
|
const separator = annotate(char("/"), blackBright);
|
|
3756
3756
|
const selectedAnnotation = combine(underlined, submitted ? white$1 : cyanBright);
|
|
3757
|
-
const inactive = value ? text$
|
|
3757
|
+
const inactive = value ? text$11(options.inactive) : annotate(text$11(options.inactive), selectedAnnotation);
|
|
3758
3758
|
return hsep([
|
|
3759
|
-
value ? annotate(text$
|
|
3759
|
+
value ? annotate(text$11(options.active), selectedAnnotation) : text$11(options.active),
|
|
3760
3760
|
separator,
|
|
3761
3761
|
inactive
|
|
3762
3762
|
]);
|
|
3763
3763
|
}
|
|
3764
3764
|
function renderOutput(toggle, leadingSymbol, trailingSymbol, options) {
|
|
3765
|
-
const annotateLine = (line) => annotate(text$
|
|
3765
|
+
const annotateLine = (line) => annotate(text$11(line), bold$1);
|
|
3766
3766
|
const promptLines = options.message.split(/\r?\n/);
|
|
3767
3767
|
const prefix = cat(leadingSymbol, space$1);
|
|
3768
3768
|
if (isNonEmptyReadonlyArray(promptLines)) {
|
|
@@ -3780,7 +3780,7 @@ function renderNextFrame(state, options) {
|
|
|
3780
3780
|
const terminal = yield* Terminal;
|
|
3781
3781
|
const figures$2 = yield* figures;
|
|
3782
3782
|
const columns = yield* terminal.columns;
|
|
3783
|
-
const leadingSymbol = annotate(text$
|
|
3783
|
+
const leadingSymbol = annotate(text$11("?"), cyanBright);
|
|
3784
3784
|
const trailingSymbol = annotate(figures$2.pointerSmall, blackBright);
|
|
3785
3785
|
const promptMsg = renderOutput(renderToggle(state, options), leadingSymbol, trailingSymbol, options);
|
|
3786
3786
|
return cursorHide.pipe(cat(promptMsg), optimize(Deep), render$2({
|
|
@@ -3884,7 +3884,7 @@ const integer$2 = /*#__PURE__*/ (() => {
|
|
|
3884
3884
|
return op;
|
|
3885
3885
|
})();
|
|
3886
3886
|
/** @internal */
|
|
3887
|
-
const text$
|
|
3887
|
+
const text$8 = /*#__PURE__*/ (() => {
|
|
3888
3888
|
const op = /*#__PURE__*/ Object.create(proto$5);
|
|
3889
3889
|
op._tag = "Text";
|
|
3890
3890
|
return op;
|
|
@@ -3914,25 +3914,25 @@ const getChoicesInternal = (self) => {
|
|
|
3914
3914
|
};
|
|
3915
3915
|
const getHelpInternal$3 = (self) => {
|
|
3916
3916
|
switch (self._tag) {
|
|
3917
|
-
case "Bool": return text$
|
|
3918
|
-
case "Choice": return text$
|
|
3919
|
-
case "DateTime": return text$
|
|
3920
|
-
case "Float": return text$
|
|
3921
|
-
case "Integer": return text$
|
|
3917
|
+
case "Bool": return text$10("A true or false value.");
|
|
3918
|
+
case "Choice": return text$10(`One of the following: ${pipe(map$7(self.alternatives, ([choice]) => choice), join(", "))}`);
|
|
3919
|
+
case "DateTime": return text$10("A date without a time-zone in the ISO-8601 format, such as 2007-12-03T10:15:30.");
|
|
3920
|
+
case "Float": return text$10("A floating point number.");
|
|
3921
|
+
case "Integer": return text$10("An integer.");
|
|
3922
3922
|
case "Path":
|
|
3923
|
-
if (self.pathType === "either" && self.pathExists === "yes") return text$
|
|
3924
|
-
if (self.pathType === "file" && self.pathExists === "yes") return text$
|
|
3925
|
-
if (self.pathType === "directory" && self.pathExists === "yes") return text$
|
|
3926
|
-
if (self.pathType === "either" && self.pathExists === "no") return text$
|
|
3927
|
-
if (self.pathType === "file" && self.pathExists === "no") return text$
|
|
3928
|
-
if (self.pathType === "directory" && self.pathExists === "no") return text$
|
|
3929
|
-
if (self.pathType === "either" && self.pathExists === "either") return text$
|
|
3930
|
-
if (self.pathType === "file" && self.pathExists === "either") return text$
|
|
3931
|
-
if (self.pathType === "directory" && self.pathExists === "either") return text$
|
|
3923
|
+
if (self.pathType === "either" && self.pathExists === "yes") return text$10("An existing file or directory.");
|
|
3924
|
+
if (self.pathType === "file" && self.pathExists === "yes") return text$10("An existing file.");
|
|
3925
|
+
if (self.pathType === "directory" && self.pathExists === "yes") return text$10("An existing directory.");
|
|
3926
|
+
if (self.pathType === "either" && self.pathExists === "no") return text$10("A file or directory that must not exist.");
|
|
3927
|
+
if (self.pathType === "file" && self.pathExists === "no") return text$10("A file that must not exist.");
|
|
3928
|
+
if (self.pathType === "directory" && self.pathExists === "no") return text$10("A directory that must not exist.");
|
|
3929
|
+
if (self.pathType === "either" && self.pathExists === "either") return text$10("A file or directory.");
|
|
3930
|
+
if (self.pathType === "file" && self.pathExists === "either") return text$10("A file.");
|
|
3931
|
+
if (self.pathType === "directory" && self.pathExists === "either") return text$10("A directory.");
|
|
3932
3932
|
throw new Error(`[BUG]: Path.help - encountered invalid combination of path type ('${self.pathType}') and path existence ('${self.pathExists}')`);
|
|
3933
3933
|
case "Secret":
|
|
3934
|
-
case "Redacted": return text$
|
|
3935
|
-
case "Text": return text$
|
|
3934
|
+
case "Redacted": return text$10("A user-defined piece of text that is confidential.");
|
|
3935
|
+
case "Text": return text$10("A user-defined piece of text.");
|
|
3936
3936
|
}
|
|
3937
3937
|
};
|
|
3938
3938
|
const getTypeNameInternal = (self) => {
|
|
@@ -4020,14 +4020,14 @@ const wizardInternal$3 = (self, help) => {
|
|
|
4020
4020
|
case "Integer": return integer$3({ message: toAnsiText(sequence(help, p$1("Enter an integer"))).trimEnd() }).pipe(map$3((value) => `${value}`));
|
|
4021
4021
|
case "Path": {
|
|
4022
4022
|
const message = sequence(help, p$1("Select a file system path"));
|
|
4023
|
-
return file$
|
|
4023
|
+
return file$4({
|
|
4024
4024
|
type: self.pathType,
|
|
4025
4025
|
message: toAnsiText(message).trimEnd()
|
|
4026
4026
|
});
|
|
4027
4027
|
}
|
|
4028
4028
|
case "Redacted": return hidden({ message: toAnsiText(sequence(help, p$1("Enter some text (value will be redacted)"))).trimEnd() });
|
|
4029
4029
|
case "Secret": return hidden({ message: toAnsiText(sequence(help, p$1("Enter some text (value will be redacted)"))).trimEnd() });
|
|
4030
|
-
case "Text": return text$
|
|
4030
|
+
case "Text": return text$9({ message: toAnsiText(sequence(help, p$1("Enter some text"))).trimEnd() });
|
|
4031
4031
|
}
|
|
4032
4032
|
};
|
|
4033
4033
|
/** @internal */
|
|
@@ -4097,7 +4097,7 @@ const named = (names, acceptedValues) => ({
|
|
|
4097
4097
|
acceptedValues
|
|
4098
4098
|
});
|
|
4099
4099
|
/** @internal */
|
|
4100
|
-
const optional$
|
|
4100
|
+
const optional$7 = (self) => ({
|
|
4101
4101
|
_tag: "Optional",
|
|
4102
4102
|
usage: self
|
|
4103
4103
|
});
|
|
@@ -4139,7 +4139,7 @@ const simplify = (self, config) => {
|
|
|
4139
4139
|
case "Optional": {
|
|
4140
4140
|
if (self.usage._tag === "Empty") return empty$5;
|
|
4141
4141
|
const usage = simplify(self.usage, config);
|
|
4142
|
-
return usage._tag === "Empty" ? empty$5 : usage._tag === "Optional" ? usage : optional$
|
|
4142
|
+
return usage._tag === "Empty" ? empty$5 : usage._tag === "Optional" ? usage : optional$7(usage);
|
|
4143
4143
|
}
|
|
4144
4144
|
case "Repeated": {
|
|
4145
4145
|
const usage = simplify(self.usage, config);
|
|
@@ -4159,32 +4159,32 @@ const simplify = (self, config) => {
|
|
|
4159
4159
|
};
|
|
4160
4160
|
const render$1 = (self, config) => {
|
|
4161
4161
|
switch (self._tag) {
|
|
4162
|
-
case "Empty": return of$2(text$
|
|
4163
|
-
case "Mixed": return of$2(text$
|
|
4162
|
+
case "Empty": return of$2(text$10(""));
|
|
4163
|
+
case "Mixed": return of$2(text$10("<command>"));
|
|
4164
4164
|
case "Named": {
|
|
4165
4165
|
const typeInfo = config.showTypes ? match(self.acceptedValues, {
|
|
4166
4166
|
onNone: () => empty$7,
|
|
4167
|
-
onSome: (s) => concat$1(space, text$
|
|
4167
|
+
onSome: (s) => concat$1(space, text$10(s))
|
|
4168
4168
|
}) : empty$7;
|
|
4169
|
-
const nameInfo = text$
|
|
4169
|
+
const nameInfo = text$10(join(config.showAllNames ? self.names : self.names.length > 1 ? pipe(filter$2(self.names, (name) => name.startsWith("--")), head$2, map$8(of$2), getOrElse(() => self.names)) : self.names, ", "));
|
|
4170
4170
|
return config.showAllNames && self.names.length > 1 ? of$2(spans([
|
|
4171
|
-
text$
|
|
4171
|
+
text$10("("),
|
|
4172
4172
|
nameInfo,
|
|
4173
4173
|
typeInfo,
|
|
4174
|
-
text$
|
|
4174
|
+
text$10(")")
|
|
4175
4175
|
])) : of$2(concat$1(nameInfo, typeInfo));
|
|
4176
4176
|
}
|
|
4177
4177
|
case "Optional": return map$7(render$1(self.usage, config), (span) => spans([
|
|
4178
|
-
text$
|
|
4178
|
+
text$10("["),
|
|
4179
4179
|
span,
|
|
4180
|
-
text$
|
|
4180
|
+
text$10("]")
|
|
4181
4181
|
]));
|
|
4182
|
-
case "Repeated": return map$7(render$1(self.usage, config), (span) => concat$1(span, text$
|
|
4182
|
+
case "Repeated": return map$7(render$1(self.usage, config), (span) => concat$1(span, text$10("...")));
|
|
4183
4183
|
case "Alternation":
|
|
4184
4184
|
if (self.left._tag === "Repeated" || self.right._tag === "Repeated" || self.left._tag === "Concat" || self.right._tag === "Concat") return appendAll(render$1(self.left, config), render$1(self.right, config));
|
|
4185
4185
|
return flatMap$4(render$1(self.left, config), (left) => map$7(render$1(self.right, config), (right) => spans([
|
|
4186
4186
|
left,
|
|
4187
|
-
text$
|
|
4187
|
+
text$10("|"),
|
|
4188
4188
|
right
|
|
4189
4189
|
])));
|
|
4190
4190
|
case "Concat": {
|
|
@@ -4315,7 +4315,7 @@ const none$1 = /*#__PURE__*/ (() => {
|
|
|
4315
4315
|
return op;
|
|
4316
4316
|
})();
|
|
4317
4317
|
/** @internal */
|
|
4318
|
-
const text$
|
|
4318
|
+
const text$7 = (config) => makeSingle$1(fromNullable(config?.name), text$8);
|
|
4319
4319
|
/** @internal */
|
|
4320
4320
|
const getHelp$2 = (self) => getHelpInternal$2(self);
|
|
4321
4321
|
/** @internal */
|
|
@@ -4325,7 +4325,7 @@ const map$2 = /*#__PURE__*/ dual(2, (self, f) => mapEffect$1(self, (a) => succee
|
|
|
4325
4325
|
/** @internal */
|
|
4326
4326
|
const mapEffect$1 = /*#__PURE__*/ dual(2, (self, f) => makeMap$1(self, f));
|
|
4327
4327
|
/** @internal */
|
|
4328
|
-
const optional$
|
|
4328
|
+
const optional$6 = (self) => makeWithDefault$1(map$2(self, some), none$3());
|
|
4329
4329
|
/** @internal */
|
|
4330
4330
|
const repeated$1 = (self) => makeVariadic$1(self, none$3(), none$3());
|
|
4331
4331
|
/** @internal */
|
|
@@ -4351,7 +4351,7 @@ const getHelpInternal$2 = (self) => {
|
|
|
4351
4351
|
case "Variadic": return mapDescriptionList(getHelpInternal$2(self.args), (oldSpan, oldBlock) => {
|
|
4352
4352
|
const min = getMinSizeInternal$1(self);
|
|
4353
4353
|
const max = getMaxSizeInternal$1(self);
|
|
4354
|
-
const newSpan = text$
|
|
4354
|
+
const newSpan = text$10(isSome(self.max) ? ` ${min} - ${max}` : min === 0 ? "..." : ` ${min}+`);
|
|
4355
4355
|
const newBlock = p$1(isSome(self.max) ? `This argument must be repeated at least ${min} times and may be repeated up to ${max} times.` : min === 0 ? "This argument may be repeated zero or more times." : `This argument must be repeated at least ${min} times.`);
|
|
4356
4356
|
return [concat$1(oldSpan, newSpan), sequence(oldBlock, newBlock)];
|
|
4357
4357
|
});
|
|
@@ -4402,7 +4402,7 @@ const getUsageInternal$2 = (self) => {
|
|
|
4402
4402
|
case "Both": return concat(getUsageInternal$2(self.left), getUsageInternal$2(self.right));
|
|
4403
4403
|
case "Variadic": return repeated$2(getUsageInternal$2(self.args));
|
|
4404
4404
|
case "WithDefault":
|
|
4405
|
-
case "WithFallbackConfig": return optional$
|
|
4405
|
+
case "WithFallbackConfig": return optional$7(getUsageInternal$2(self.args));
|
|
4406
4406
|
}
|
|
4407
4407
|
};
|
|
4408
4408
|
const makeSingle$1 = (pseudoName, primitiveType, description = empty$6) => {
|
|
@@ -4503,7 +4503,7 @@ const wizardInternal$2 = (self, config) => {
|
|
|
4503
4503
|
message: toAnsiText(pipe(getHelpInternal$2(self), sequence(repeatHelp))).trimEnd(),
|
|
4504
4504
|
min: getMinSizeInternal$1(self),
|
|
4505
4505
|
max: getMaxSizeInternal$1(self)
|
|
4506
|
-
}).pipe(zipLeft(log()), flatMap$1((n) => n <= 0 ? succeed$1(empty$11()) : make$23(empty$11()).pipe(flatMap$1((ref) => wizardInternal$2(self.args, config).pipe(flatMap$1((args) => update$
|
|
4506
|
+
}).pipe(zipLeft(log()), flatMap$1((n) => n <= 0 ? succeed$1(empty$11()) : make$23(empty$11()).pipe(flatMap$1((ref) => wizardInternal$2(self.args, config).pipe(flatMap$1((args) => update$7(ref, appendAll(args))), repeatN(n - 1), zipRight(get$11(ref)), tap((args) => validateInternal(self, args, config)))))));
|
|
4507
4507
|
}
|
|
4508
4508
|
case "WithDefault": {
|
|
4509
4509
|
const defaultHelp = p$1(`This argument is optional - use the default?`);
|
|
@@ -4592,7 +4592,7 @@ const getZshCompletions$2 = (self, state = {
|
|
|
4592
4592
|
* @since 1.0.0
|
|
4593
4593
|
* @category combinators
|
|
4594
4594
|
*/
|
|
4595
|
-
const optional$
|
|
4595
|
+
const optional$5 = optional$6;
|
|
4596
4596
|
/**
|
|
4597
4597
|
* @since 1.0.0
|
|
4598
4598
|
* @category combinators
|
|
@@ -4606,7 +4606,7 @@ const repeated = repeated$1;
|
|
|
4606
4606
|
* @since 1.0.0
|
|
4607
4607
|
* @category constructors
|
|
4608
4608
|
*/
|
|
4609
|
-
const text$
|
|
4609
|
+
const text$6 = text$7;
|
|
4610
4610
|
//#endregion
|
|
4611
4611
|
//#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/HelpDoc.js
|
|
4612
4612
|
/**
|
|
@@ -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$
|
|
4643
|
+
const list$9 = (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 = {
|
|
@@ -4703,7 +4703,7 @@ const none = /*#__PURE__*/ (() => {
|
|
|
4703
4703
|
return op;
|
|
4704
4704
|
})();
|
|
4705
4705
|
/** @internal */
|
|
4706
|
-
const text$
|
|
4706
|
+
const text$5 = (name) => makeSingle(name, empty$11(), text$8);
|
|
4707
4707
|
/** @internal */
|
|
4708
4708
|
const getHelp$1 = (self) => getHelpInternal$1(self);
|
|
4709
4709
|
/** @internal */
|
|
@@ -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$
|
|
4714
|
+
const optional$4 = (self) => withDefault(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 */
|
|
@@ -4769,7 +4769,7 @@ const getHelpInternal$1 = (self) => {
|
|
|
4769
4769
|
case "Variadic": return mapDescriptionList(getHelpInternal$1(self.argumentOption), (oldSpan, oldBlock) => {
|
|
4770
4770
|
const min = getMinSizeInternal(self);
|
|
4771
4771
|
const max = getMaxSizeInternal(self);
|
|
4772
|
-
const newSpan = text$
|
|
4772
|
+
const newSpan = text$10(isSome(self.max) ? ` ${min} - ${max}` : min === 0 ? "..." : ` ${min}+`);
|
|
4773
4773
|
const newBlock = p$1(isSome(self.max) ? `This option must be repeated at least ${min} times and may be repeated up to ${max} times.` : min === 0 ? "This option may be repeated zero or more times." : `This option must be repeated at least ${min} times.`);
|
|
4774
4774
|
return [concat$1(oldSpan, newSpan), sequence(oldBlock, newBlock)];
|
|
4775
4775
|
});
|
|
@@ -4854,7 +4854,7 @@ const getUsageInternal$1 = (self) => {
|
|
|
4854
4854
|
case "OrElse": return alternation(getUsageInternal$1(self.left), getUsageInternal$1(self.right));
|
|
4855
4855
|
case "Variadic": return repeated$2(getUsageInternal$1(self.argumentOption));
|
|
4856
4856
|
case "WithDefault":
|
|
4857
|
-
case "WithFallback": return optional$
|
|
4857
|
+
case "WithFallback": return optional$7(getUsageInternal$1(self.options));
|
|
4858
4858
|
}
|
|
4859
4859
|
};
|
|
4860
4860
|
const isBoolInternal = (self) => {
|
|
@@ -4978,7 +4978,7 @@ const parseInternal$1 = (self, args, config) => {
|
|
|
4978
4978
|
switch (self._tag) {
|
|
4979
4979
|
case "Empty": return _void;
|
|
4980
4980
|
case "Single": {
|
|
4981
|
-
const singleNames = filterMap(getNames$1(self), (name) => get$
|
|
4981
|
+
const singleNames = filterMap(getNames$1(self), (name) => get$12(args, name));
|
|
4982
4982
|
if (isNonEmptyReadonlyArray(singleNames)) {
|
|
4983
4983
|
const head = headNonEmpty(singleNames);
|
|
4984
4984
|
if (isEmptyReadonlyArray(tailNonEmpty(singleNames))) {
|
|
@@ -5026,7 +5026,7 @@ const parseInternal$1 = (self, args, config) => {
|
|
|
5026
5026
|
case "Variadic": {
|
|
5027
5027
|
const min = getOrElse(self.min, () => 0);
|
|
5028
5028
|
const max = getOrElse(self.max, () => Number.MAX_SAFE_INTEGER);
|
|
5029
|
-
const matchedArgument = filterMap(getNames$1(self), (name) => get$
|
|
5029
|
+
const matchedArgument = filterMap(getNames$1(self), (name) => get$12(args, name));
|
|
5030
5030
|
const validateMinMax = (values) => {
|
|
5031
5031
|
if (values.length < min) return fail$2(invalidValue(p$1(`Expected at least ${min} value(s) for option: '${self.argumentOption.fullName}'`)));
|
|
5032
5032
|
if (values.length > max) return fail$2(invalidValue(p$1(`Expected at most ${max} value(s) for option: '${self.argumentOption.fullName}'`)));
|
|
@@ -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$
|
|
5061
|
+
case "KeyValueMap": return list$9({
|
|
5062
5062
|
message: toAnsiText(p$1("Enter `key=value` pairs separated by spaces")).trim(),
|
|
5063
5063
|
delimiter: " "
|
|
5064
5064
|
}).pipe(flatMap$1((args) => {
|
|
@@ -5086,7 +5086,7 @@ const wizardInternal$1 = (self, config) => {
|
|
|
5086
5086
|
message: toAnsiText(pipe(getHelpInternal$1(self), sequence(repeatHelp))).trimEnd(),
|
|
5087
5087
|
min: getMinSizeInternal(self),
|
|
5088
5088
|
max: getMaxSizeInternal(self)
|
|
5089
|
-
}).pipe(flatMap$1((n) => n <= 0 ? succeed$1(empty$11()) : make$23(empty$11()).pipe(flatMap$1((ref) => wizardInternal$1(self.argumentOption, config).pipe(flatMap$1((args) => update$
|
|
5089
|
+
}).pipe(flatMap$1((n) => n <= 0 ? succeed$1(empty$11()) : make$23(empty$11()).pipe(flatMap$1((ref) => wizardInternal$1(self.argumentOption, config).pipe(flatMap$1((args) => update$7(ref, appendAll(args))), repeatN(n - 1), zipRight(get$11(ref)))))));
|
|
5090
5090
|
}
|
|
5091
5091
|
case "WithDefault": {
|
|
5092
5092
|
if (isBoolInternal(self.options)) return wizardInternal$1(self.options, config);
|
|
@@ -5494,7 +5494,7 @@ const merge$1 = (map1, map2) => {
|
|
|
5494
5494
|
if (isNonEmptyReadonlyArray(map2)) {
|
|
5495
5495
|
const head = headNonEmpty(map2);
|
|
5496
5496
|
const tail = tailNonEmpty(map2);
|
|
5497
|
-
return merge$1(match(get$
|
|
5497
|
+
return merge$1(match(get$12(map1, head[0]), {
|
|
5498
5498
|
onNone: () => set$2(map1, head[0], head[1]),
|
|
5499
5499
|
onSome: (elems) => set$2(map1, head[0], appendAll(elems, head[1]))
|
|
5500
5500
|
}), tail);
|
|
@@ -5631,12 +5631,12 @@ const integer = integer$1;
|
|
|
5631
5631
|
* @since 1.0.0
|
|
5632
5632
|
* @category constructors
|
|
5633
5633
|
*/
|
|
5634
|
-
const text$
|
|
5634
|
+
const text$4 = text$5;
|
|
5635
5635
|
/**
|
|
5636
5636
|
* @since 1.0.0
|
|
5637
5637
|
* @category combinators
|
|
5638
5638
|
*/
|
|
5639
|
-
const optional$
|
|
5639
|
+
const optional$3 = optional$4;
|
|
5640
5640
|
/**
|
|
5641
5641
|
* @since 1.0.0
|
|
5642
5642
|
* @category combinators
|
|
@@ -5677,9 +5677,9 @@ const completionsOptions = /*#__PURE__*/ choiceWithValue("completions", [
|
|
|
5677
5677
|
["bash", "bash"],
|
|
5678
5678
|
["fish", "fish"],
|
|
5679
5679
|
["zsh", "zsh"]
|
|
5680
|
-
]).pipe(optional$
|
|
5680
|
+
]).pipe(optional$4, /*#__PURE__*/ withDescription$4("Generate a completion script for a specific shell."));
|
|
5681
5681
|
/** @internal */
|
|
5682
|
-
const logLevelOptions = /*#__PURE__*/ choiceWithValue("log-level", allLevels.map((level) => [level._tag.toLowerCase(), level])).pipe(optional$
|
|
5682
|
+
const logLevelOptions = /*#__PURE__*/ choiceWithValue("log-level", allLevels.map((level) => [level._tag.toLowerCase(), level])).pipe(optional$4, /*#__PURE__*/ withDescription$4("Sets the minimum log level for a command."));
|
|
5683
5683
|
/** @internal */
|
|
5684
5684
|
const helpOptions = /*#__PURE__*/ boolean$1("help").pipe(/*#__PURE__*/ withAlias("h"), /*#__PURE__*/ withDescription$4("Show the help documentation for a command."));
|
|
5685
5685
|
/** @internal */
|
|
@@ -5811,10 +5811,10 @@ const getHelpInternal = (self, config) => {
|
|
|
5811
5811
|
}
|
|
5812
5812
|
};
|
|
5813
5813
|
const printSubcommands = (subcommands) => {
|
|
5814
|
-
const maxUsageLength = reduceRight(subcommands, 0, (max, [usage]) => Math.max(size$
|
|
5814
|
+
const maxUsageLength = reduceRight(subcommands, 0, (max, [usage]) => Math.max(size$5(usage), max));
|
|
5815
5815
|
const documents = map$7(subcommands, ([usage, desc]) => p$1(spans([
|
|
5816
5816
|
usage,
|
|
5817
|
-
text$
|
|
5817
|
+
text$10(" ".repeat(maxUsageLength - size$5(usage) + 2)),
|
|
5818
5818
|
desc
|
|
5819
5819
|
])));
|
|
5820
5820
|
if (isNonEmptyReadonlyArray(documents)) return enumeration(documents);
|
|
@@ -6029,7 +6029,7 @@ const wizardInternal = (self, prefix, config) => {
|
|
|
6029
6029
|
switch (self._tag) {
|
|
6030
6030
|
case "GetUserInput":
|
|
6031
6031
|
case "Standard": return gen(function* () {
|
|
6032
|
-
const logCurrentCommand = get$
|
|
6032
|
+
const logCurrentCommand = get$11(commandLineRef).pipe(flatMap$1((commandLine) => {
|
|
6033
6033
|
return log(toAnsiText(p$1(pipe(strong(highlight("COMMAND:", cyan)), concat$1(space), concat$1(highlight(join(commandLine, " "), magenta))))));
|
|
6034
6034
|
}));
|
|
6035
6035
|
if (isStandard(self)) {
|
|
@@ -6046,7 +6046,7 @@ const wizardInternal = (self, prefix, config) => {
|
|
|
6046
6046
|
yield* logCurrentCommand;
|
|
6047
6047
|
}
|
|
6048
6048
|
}
|
|
6049
|
-
return yield* get$
|
|
6049
|
+
return yield* get$11(commandLineRef);
|
|
6050
6050
|
});
|
|
6051
6051
|
case "Map": return loop(self.command, commandLineRef);
|
|
6052
6052
|
case "Subcommands": {
|
|
@@ -6059,11 +6059,11 @@ const wizardInternal = (self, prefix, config) => {
|
|
|
6059
6059
|
return loop(self.parent, commandLineRef).pipe(zipRight(select({
|
|
6060
6060
|
message,
|
|
6061
6061
|
choices
|
|
6062
|
-
}).pipe(tap(([name]) => update$
|
|
6062
|
+
}).pipe(tap(([name]) => update$7(commandLineRef, append$2(name))), zipLeft(log()), flatMap$1(([, nextIndex]) => loop(self.children[nextIndex], commandLineRef)))));
|
|
6063
6063
|
}
|
|
6064
6064
|
}
|
|
6065
6065
|
};
|
|
6066
|
-
return make$23(prefix).pipe(flatMap$1((commandLineRef) => loop(self, commandLineRef).pipe(zipRight(get$
|
|
6066
|
+
return make$23(prefix).pipe(flatMap$1((commandLineRef) => loop(self, commandLineRef).pipe(zipRight(get$11(commandLineRef)))));
|
|
6067
6067
|
};
|
|
6068
6068
|
const getShortDescription = (self) => {
|
|
6069
6069
|
switch (self._tag) {
|
|
@@ -6107,7 +6107,7 @@ const traverseCommand = (self, initialState, f) => make$25(initialState).pipe(fl
|
|
|
6107
6107
|
}
|
|
6108
6108
|
}
|
|
6109
6109
|
};
|
|
6110
|
-
return suspend(() => loop(self, empty$11(), empty$11(), 0)).pipe(zipRight(get$
|
|
6110
|
+
return suspend(() => loop(self, empty$11(), empty$11(), 0)).pipe(zipRight(get$13(ref)));
|
|
6111
6111
|
}));
|
|
6112
6112
|
const indentAll = /*#__PURE__*/ dual(2, (self, indent) => {
|
|
6113
6113
|
const indentation = allocate(indent + 1).join(" ");
|
|
@@ -6362,13 +6362,13 @@ const handleBuiltInOption = (self, executable, args, builtIn, execute, config, o
|
|
|
6362
6362
|
}
|
|
6363
6363
|
case "ShowHelp": {
|
|
6364
6364
|
const banner = h1(code(self.name));
|
|
6365
|
-
const header = p$1(spans([text$
|
|
6365
|
+
const header = p$1(spans([text$10(`${self.name} ${self.version}`), isEmpty$3(self.summary) ? empty$7 : spans([
|
|
6366
6366
|
space,
|
|
6367
|
-
text$
|
|
6367
|
+
text$10("--"),
|
|
6368
6368
|
space,
|
|
6369
6369
|
self.summary
|
|
6370
6370
|
])]));
|
|
6371
|
-
const usage = sequence(h1("USAGE"), pipe(enumerate(builtIn.usage, config), map$7((span) => p$1(concat$1(text$
|
|
6371
|
+
const usage = sequence(h1("USAGE"), pipe(enumerate(builtIn.usage, config), map$7((span) => p$1(concat$1(text$10("$ "), span))), reduceRight(empty$6, (left, right) => sequence(left, right))));
|
|
6372
6372
|
return log(toAnsiText(pipe(banner, sequence(header), sequence(usage), sequence(builtIn.helpDoc), sequence(self.footer))));
|
|
6373
6373
|
}
|
|
6374
6374
|
case "ShowCompletions": {
|
|
@@ -6382,17 +6382,17 @@ const handleBuiltInOption = (self, executable, args, builtIn, execute, config, o
|
|
|
6382
6382
|
case "ShowWizard": {
|
|
6383
6383
|
const summary = isEmpty$3(self.summary) ? empty$7 : spans([
|
|
6384
6384
|
space,
|
|
6385
|
-
text$
|
|
6385
|
+
text$10("--"),
|
|
6386
6386
|
space,
|
|
6387
6387
|
self.summary
|
|
6388
6388
|
]);
|
|
6389
6389
|
const instructions = sequence(p$1(spans([
|
|
6390
|
-
text$
|
|
6390
|
+
text$10("The wizard mode will assist you with constructing commands for"),
|
|
6391
6391
|
space,
|
|
6392
6392
|
code(`${self.name} (${self.version})`),
|
|
6393
|
-
text$
|
|
6393
|
+
text$10(".")
|
|
6394
6394
|
])), p$1("Please answer all prompts provided by the wizard."));
|
|
6395
|
-
const description = descriptionList([[text$
|
|
6395
|
+
const description = descriptionList([[text$10("Instructions"), instructions]]);
|
|
6396
6396
|
const text = toAnsiText(sequence(h1(spans([
|
|
6397
6397
|
code("Wizard Mode for CLI Application:"),
|
|
6398
6398
|
space,
|
|
@@ -6451,11 +6451,11 @@ const getWizardPrefix = (builtIn, rootCommand, commandLineArgs) => {
|
|
|
6451
6451
|
};
|
|
6452
6452
|
const renderWizardArgs = (args) => {
|
|
6453
6453
|
const params = pipe(filter$2(args, (param) => param.length > 0), join(" "));
|
|
6454
|
-
const executeMsg = text$
|
|
6454
|
+
const executeMsg = text$10("You may now execute your command directly with the following options and arguments:");
|
|
6455
6455
|
return blocks([
|
|
6456
6456
|
p$1(strong(code("Wizard Mode Complete!"))),
|
|
6457
6457
|
p$1(executeMsg),
|
|
6458
|
-
p$1(concat$1(text$
|
|
6458
|
+
p$1(concat$1(text$10(" "), highlight(params, cyan)))
|
|
6459
6459
|
]);
|
|
6460
6460
|
};
|
|
6461
6461
|
const isLogLevelArg = (arg) => {
|
|
@@ -7332,7 +7332,7 @@ const watchNode = (path, options) => asyncScoped((emit) => acquireRelease(sync((
|
|
|
7332
7332
|
});
|
|
7333
7333
|
return watcher;
|
|
7334
7334
|
}), (watcher) => sync(() => watcher.close())));
|
|
7335
|
-
const watch = (backend, path, options) => stat(path).pipe(map$6((stat) => backend.pipe(flatMap$3((_) => _.register(path, stat, options)), getOrElse(() => watchNode(path, options)))), unwrap$
|
|
7335
|
+
const watch = (backend, path, options) => stat(path).pipe(map$6((stat) => backend.pipe(flatMap$3((_) => _.register(path, stat, options)), getOrElse(() => watchNode(path, options)))), unwrap$7);
|
|
7336
7336
|
const writeFile = (path, data, options) => async((resume, signal) => {
|
|
7337
7337
|
try {
|
|
7338
7338
|
NFS.writeFile(path, data, {
|
|
@@ -7449,7 +7449,7 @@ const layer$3 = /* @__PURE__ */ scoped$1(Terminal, /*#__PURE__*/ (/* @__PURE__ *
|
|
|
7449
7449
|
const rows = sync(() => stdout.rows ?? 0);
|
|
7450
7450
|
const isTTY = sync(() => Boolean(stdout.isTTY));
|
|
7451
7451
|
const readInput = gen(function* () {
|
|
7452
|
-
yield* get$
|
|
7452
|
+
yield* get$14(rlRef);
|
|
7453
7453
|
const mailbox = yield* make$29();
|
|
7454
7454
|
const handleKeypress = (s, k) => {
|
|
7455
7455
|
const userInput = {
|
|
@@ -7468,7 +7468,7 @@ const layer$3 = /* @__PURE__ */ scoped$1(Terminal, /*#__PURE__*/ (/* @__PURE__ *
|
|
|
7468
7468
|
stdin.on("keypress", handleKeypress);
|
|
7469
7469
|
return mailbox;
|
|
7470
7470
|
});
|
|
7471
|
-
const readLine = get$
|
|
7471
|
+
const readLine = get$14(rlRef).pipe(flatMap$1((readlineInterface) => async((resume) => {
|
|
7472
7472
|
const onLine = (line) => resume(succeed$1(line));
|
|
7473
7473
|
readlineInterface.once("line", onLine);
|
|
7474
7474
|
return sync(() => readlineInterface.off("line", onLine));
|
|
@@ -8263,9 +8263,9 @@ var Uint8ArrayImpl = class extends BodyBase {
|
|
|
8263
8263
|
const uint8Array = (body, contentType) => new Uint8ArrayImpl(body, contentType ?? "application/octet-stream");
|
|
8264
8264
|
const encoder = /*#__PURE__*/ new TextEncoder();
|
|
8265
8265
|
/** @internal */
|
|
8266
|
-
const text$
|
|
8266
|
+
const text$3 = (body, contentType) => uint8Array(encoder.encode(body), contentType ?? "text/plain");
|
|
8267
8267
|
/** @internal */
|
|
8268
|
-
const unsafeJson = (body, contentType) => text$
|
|
8268
|
+
const unsafeJson = (body, contentType) => text$3(JSON.stringify(body), contentType ?? "application/json");
|
|
8269
8269
|
/** @internal */
|
|
8270
8270
|
const json = (body, contentType) => try_({
|
|
8271
8271
|
try: () => unsafeJson(body, contentType),
|
|
@@ -8332,7 +8332,7 @@ const make$10 = (method) => (url, options) => modify(empty, {
|
|
|
8332
8332
|
...options ?? void 0
|
|
8333
8333
|
});
|
|
8334
8334
|
/** @internal */
|
|
8335
|
-
const get$
|
|
8335
|
+
const get$10 = /*#__PURE__*/ make$10("GET");
|
|
8336
8336
|
/** @internal */
|
|
8337
8337
|
const post$1 = /*#__PURE__*/ make$10("POST");
|
|
8338
8338
|
/** @internal */
|
|
@@ -8340,7 +8340,7 @@ const put$1 = /*#__PURE__*/ make$10("PUT");
|
|
|
8340
8340
|
/** @internal */
|
|
8341
8341
|
const patch$1 = /*#__PURE__*/ make$10("PATCH");
|
|
8342
8342
|
/** @internal */
|
|
8343
|
-
const del$
|
|
8343
|
+
const del$8 = /*#__PURE__*/ make$10("DELETE");
|
|
8344
8344
|
/** @internal */
|
|
8345
8345
|
const head$1 = /*#__PURE__*/ make$10("HEAD");
|
|
8346
8346
|
/** @internal */
|
|
@@ -8434,7 +8434,7 @@ const ClientProto = {
|
|
|
8434
8434
|
return { _id: "@effect/platform/HttpClient" };
|
|
8435
8435
|
},
|
|
8436
8436
|
get(url, options) {
|
|
8437
|
-
return this.execute(get$
|
|
8437
|
+
return this.execute(get$10(url, options));
|
|
8438
8438
|
},
|
|
8439
8439
|
head(url, options) {
|
|
8440
8440
|
return this.execute(head$1(url, options));
|
|
@@ -8449,7 +8449,7 @@ const ClientProto = {
|
|
|
8449
8449
|
return this.execute(patch$1(url, options));
|
|
8450
8450
|
},
|
|
8451
8451
|
del(url, options) {
|
|
8452
|
-
return this.execute(del$
|
|
8452
|
+
return this.execute(del$8(url, options));
|
|
8453
8453
|
},
|
|
8454
8454
|
options(url, options) {
|
|
8455
8455
|
return this.execute(options$1(url, options));
|
|
@@ -8518,7 +8518,7 @@ const make$9 = (f) => makeWith((effect) => flatMap$1(effect, (request) => withFi
|
|
|
8518
8518
|
}
|
|
8519
8519
|
}));
|
|
8520
8520
|
}
|
|
8521
|
-
return useSpan(get$
|
|
8521
|
+
return useSpan(get$15(fiber.currentContext, SpanNameGenerator)(request), {
|
|
8522
8522
|
kind: "client",
|
|
8523
8523
|
captureStackTrace: false
|
|
8524
8524
|
}, (span) => {
|
|
@@ -8612,7 +8612,7 @@ var InterruptibleResponse = class {
|
|
|
8612
8612
|
return this.original[NodeInspectSymbol]();
|
|
8613
8613
|
}
|
|
8614
8614
|
};
|
|
8615
|
-
const { del: del$
|
|
8615
|
+
const { del: del$7, execute, get: get$9, head, options, patch, post, put } = /*#__PURE__*/ serviceFunctions(tag);
|
|
8616
8616
|
/** @internal */
|
|
8617
8617
|
const transformResponse = /*#__PURE__*/ dual(2, (self, f) => {
|
|
8618
8618
|
const client = self;
|
|
@@ -9502,6 +9502,7 @@ var NetworkDns = class extends TaggedError$1("NetworkDns") {};
|
|
|
9502
9502
|
var NetworkRefused = class extends TaggedError$1("NetworkRefused") {};
|
|
9503
9503
|
var ValidationFailed = class extends TaggedError$1("ValidationFailed") {};
|
|
9504
9504
|
var ValidationXml = class extends TaggedError$1("ValidationXml") {};
|
|
9505
|
+
var ValidationJson = class extends TaggedError$1("ValidationJson") {};
|
|
9505
9506
|
var ServerError = class extends TaggedError$1("ServerError") {};
|
|
9506
9507
|
var ResourceNotFound = class extends TaggedError$1("ResourceNotFound") {};
|
|
9507
9508
|
var ConfigMissingApiUrl = class extends TaggedError$1("ConfigMissingApiUrl") {};
|
|
@@ -9532,6 +9533,7 @@ const tagToCode = {
|
|
|
9532
9533
|
NetworkRefused: "network.refused",
|
|
9533
9534
|
ValidationFailed: "validation.failed",
|
|
9534
9535
|
ValidationXml: "validation.xml",
|
|
9536
|
+
ValidationJson: "validation.json",
|
|
9535
9537
|
ServerError: "server.error",
|
|
9536
9538
|
ResourceNotFound: "resource.not_found",
|
|
9537
9539
|
ConfigMissingApiUrl: "config.missing.api_url",
|
|
@@ -9568,6 +9570,7 @@ const exitCodeForTag = (tag) => {
|
|
|
9568
9570
|
case "ProfileNoneActive": return 4;
|
|
9569
9571
|
case "ValidationFailed":
|
|
9570
9572
|
case "ValidationXml":
|
|
9573
|
+
case "ValidationJson":
|
|
9571
9574
|
case "ProfileInvalidName":
|
|
9572
9575
|
case "ConfigMissingApiUrl":
|
|
9573
9576
|
case "ConfigMissingToken": return 5;
|
|
@@ -9594,6 +9597,7 @@ const defaultMessages = {
|
|
|
9594
9597
|
NetworkRefused: "connection refused",
|
|
9595
9598
|
ValidationFailed: "validation failed",
|
|
9596
9599
|
ValidationXml: "failed to parse LiteXML",
|
|
9600
|
+
ValidationJson: "failed to parse JSON",
|
|
9597
9601
|
ServerError: "server error",
|
|
9598
9602
|
ResourceNotFound: "resource not found",
|
|
9599
9603
|
ConfigMissingApiUrl: "API URL is not configured",
|
|
@@ -11069,7 +11073,7 @@ ${g}
|
|
|
11069
11073
|
}).prompt();
|
|
11070
11074
|
};
|
|
11071
11075
|
`${styleText("gray", S_BAR)}`;
|
|
11072
|
-
const text$
|
|
11076
|
+
const text$2 = (t) => new n({
|
|
11073
11077
|
validate: t.validate,
|
|
11074
11078
|
placeholder: t.placeholder,
|
|
11075
11079
|
defaultValue: t.defaultValue,
|
|
@@ -11153,7 +11157,7 @@ const makeService$3 = (fs) => ({
|
|
|
11153
11157
|
})
|
|
11154
11158
|
}),
|
|
11155
11159
|
prompt: (message, opts) => tryPromise({
|
|
11156
|
-
try: () => text$
|
|
11160
|
+
try: () => text$2({
|
|
11157
11161
|
message,
|
|
11158
11162
|
initialValue: opts?.initialValue,
|
|
11159
11163
|
placeholder: opts?.placeholder
|
|
@@ -17268,7 +17272,7 @@ const BLOCK_ELEMENTS = new Set([
|
|
|
17268
17272
|
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
17269
17273
|
//#endregion
|
|
17270
17274
|
//#region ../../node_modules/.pnpm/linkedom@0.18.12/node_modules/linkedom/esm/shared/object.js
|
|
17271
|
-
const { assign, create: create$
|
|
17275
|
+
const { assign, create: create$7, defineProperties, entries, getOwnPropertyDescriptors, keys, setPrototypeOf } = Object;
|
|
17272
17276
|
//#endregion
|
|
17273
17277
|
//#region ../../node_modules/.pnpm/linkedom@0.18.12/node_modules/linkedom/esm/shared/utils.js
|
|
17274
17278
|
const $String = String;
|
|
@@ -20172,7 +20176,7 @@ const { add } = Set.prototype;
|
|
|
20172
20176
|
const addTokens = (self, tokens) => {
|
|
20173
20177
|
for (const token of tokens) if (token) add.call(self, token);
|
|
20174
20178
|
};
|
|
20175
|
-
const update$
|
|
20179
|
+
const update$6 = ({ [OWNER_ELEMENT]: ownerElement, value }) => {
|
|
20176
20180
|
const attribute = ownerElement.getAttributeNode("class");
|
|
20177
20181
|
if (attribute) attribute.value = value;
|
|
20178
20182
|
else setAttribute(ownerElement, new Attr$1(ownerElement.ownerDocument, "class", value));
|
|
@@ -20198,7 +20202,7 @@ var DOMTokenList = class extends Set {
|
|
|
20198
20202
|
*/
|
|
20199
20203
|
add(...tokens) {
|
|
20200
20204
|
addTokens(this, tokens);
|
|
20201
|
-
update$
|
|
20205
|
+
update$6(this);
|
|
20202
20206
|
}
|
|
20203
20207
|
/**
|
|
20204
20208
|
* @param {string} token
|
|
@@ -20211,7 +20215,7 @@ var DOMTokenList = class extends Set {
|
|
|
20211
20215
|
*/
|
|
20212
20216
|
remove(...tokens) {
|
|
20213
20217
|
for (const token of tokens) this.delete(token);
|
|
20214
|
-
update$
|
|
20218
|
+
update$6(this);
|
|
20215
20219
|
}
|
|
20216
20220
|
/**
|
|
20217
20221
|
* @param {string} token
|
|
@@ -20221,10 +20225,10 @@ var DOMTokenList = class extends Set {
|
|
|
20221
20225
|
if (this.has(token)) {
|
|
20222
20226
|
if (force) return true;
|
|
20223
20227
|
this.delete(token);
|
|
20224
|
-
update$
|
|
20228
|
+
update$6(this);
|
|
20225
20229
|
} else if (force || arguments.length === 1) {
|
|
20226
20230
|
super.add(token);
|
|
20227
|
-
update$
|
|
20231
|
+
update$6(this);
|
|
20228
20232
|
return true;
|
|
20229
20233
|
}
|
|
20230
20234
|
return false;
|
|
@@ -20237,7 +20241,7 @@ var DOMTokenList = class extends Set {
|
|
|
20237
20241
|
if (this.has(token)) {
|
|
20238
20242
|
this.delete(token);
|
|
20239
20243
|
super.add(newToken);
|
|
20240
|
-
update$
|
|
20244
|
+
update$6(this);
|
|
20241
20245
|
return true;
|
|
20242
20246
|
}
|
|
20243
20247
|
return false;
|
|
@@ -20481,7 +20485,7 @@ var ShadowRoot$1 = class extends NonElementParentNode {
|
|
|
20481
20485
|
const attributesHandler = { get(target, key) {
|
|
20482
20486
|
return key in target ? target[key] : target.find(({ name }) => name === key);
|
|
20483
20487
|
} };
|
|
20484
|
-
const create$
|
|
20488
|
+
const create$6 = (ownerDocument, element, localName) => {
|
|
20485
20489
|
if ("ownerSVGElement" in element) {
|
|
20486
20490
|
const svg = ownerDocument.createElementNS(SVG_NAMESPACE, localName);
|
|
20487
20491
|
svg.ownerSVGElement = element.ownerSVGElement;
|
|
@@ -20791,7 +20795,7 @@ var Element$1 = class extends ParentNode {
|
|
|
20791
20795
|
knownAdjacent($next, next);
|
|
20792
20796
|
$next = next;
|
|
20793
20797
|
};
|
|
20794
|
-
const clone = create$
|
|
20798
|
+
const clone = create$6(ownerDocument, this, localName);
|
|
20795
20799
|
let parentNode = clone, $next = clone;
|
|
20796
20800
|
let { [NEXT]: next, [END]: prev } = this;
|
|
20797
20801
|
while (next !== prev && (deep || next.nodeType === 2)) {
|
|
@@ -20802,7 +20806,7 @@ var Element$1 = class extends ParentNode {
|
|
|
20802
20806
|
parentNode = parentNode.parentNode;
|
|
20803
20807
|
break;
|
|
20804
20808
|
case 1: {
|
|
20805
|
-
const node = create$
|
|
20809
|
+
const node = create$6(ownerDocument, next, next.localName);
|
|
20806
20810
|
addNext(node);
|
|
20807
20811
|
parentNode = node;
|
|
20808
20812
|
break;
|
|
@@ -24690,7 +24694,7 @@ var Document$1 = class extends NonElementParentNode {
|
|
|
24690
24694
|
return this.createTreeWalker(root, whatToShow);
|
|
24691
24695
|
}
|
|
24692
24696
|
createEvent(name) {
|
|
24693
|
-
const event = create$
|
|
24697
|
+
const event = create$7(name === "Event" ? new GlobalEvent("") : new CustomEvent(""));
|
|
24694
24698
|
event.initEvent = event.initCustomEvent = (type, canBubble = false, cancelable = false, detail) => {
|
|
24695
24699
|
event.bubbles = !!canBubble;
|
|
24696
24700
|
defineProperties(event, {
|
|
@@ -30342,7 +30346,7 @@ const normalizeAttrs = (raw) => {
|
|
|
30342
30346
|
for (const [k, v] of Object.entries(raw)) out[k] = v == null ? "" : String(v);
|
|
30343
30347
|
return out;
|
|
30344
30348
|
};
|
|
30345
|
-
const normalize$
|
|
30349
|
+
const normalize$5 = (raw) => {
|
|
30346
30350
|
if (!Array.isArray(raw)) return [];
|
|
30347
30351
|
const out = [];
|
|
30348
30352
|
for (const entry of raw) {
|
|
@@ -30362,7 +30366,7 @@ const normalize$4 = (raw) => {
|
|
|
30362
30366
|
type: "element",
|
|
30363
30367
|
tag: key,
|
|
30364
30368
|
attrs,
|
|
30365
|
-
children: normalize$
|
|
30369
|
+
children: normalize$5(value)
|
|
30366
30370
|
});
|
|
30367
30371
|
}
|
|
30368
30372
|
}
|
|
@@ -30375,7 +30379,7 @@ const parseLitexml = (xml) => {
|
|
|
30375
30379
|
const first = raw[0];
|
|
30376
30380
|
if (!first) return [];
|
|
30377
30381
|
const inner = first.root;
|
|
30378
|
-
return normalize$
|
|
30382
|
+
return normalize$5(inner);
|
|
30379
30383
|
} catch {
|
|
30380
30384
|
return [];
|
|
30381
30385
|
}
|
|
@@ -30588,7 +30592,7 @@ const renderReadableGeneric = (data) => renderReadableLines(data, 0).join("\n");
|
|
|
30588
30592
|
//#endregion
|
|
30589
30593
|
//#region src/services/Renderer/service.ts
|
|
30590
30594
|
const makeService$2 = () => {
|
|
30591
|
-
const getOpts = get$
|
|
30595
|
+
const getOpts = get$16(currentOutputOptions);
|
|
30592
30596
|
const emitSuccessSync = (data, opts) => {
|
|
30593
30597
|
if (opts.json || opts.output === "json") {
|
|
30594
30598
|
writeStdout(`${JSON.stringify({
|
|
@@ -30762,7 +30766,7 @@ const humanUntil = (epochMs) => {
|
|
|
30762
30766
|
};
|
|
30763
30767
|
//#endregion
|
|
30764
30768
|
//#region src/cli/auth/login.ts
|
|
30765
|
-
const production$1 = boolean("production", { negationNames: ["no-production"] }).pipe(optional$
|
|
30769
|
+
const production$1 = boolean("production", { negationNames: ["no-production"] }).pipe(optional$3);
|
|
30766
30770
|
const DEFAULT_PROFILE = "default";
|
|
30767
30771
|
const login = make$13("login", { production: production$1 }, ({ production }) => gen(function* () {
|
|
30768
30772
|
const auth = yield* Auth;
|
|
@@ -30771,7 +30775,7 @@ const login = make$13("login", { production: production$1 }, ({ production }) =>
|
|
|
30771
30775
|
const editor = yield* Editor;
|
|
30772
30776
|
const renderer = yield* Renderer;
|
|
30773
30777
|
const opts = yield* renderer.options;
|
|
30774
|
-
const flagProfile = yield* get$
|
|
30778
|
+
const flagProfile = yield* get$16(currentProfileFlag);
|
|
30775
30779
|
const resolved = yield* profile.resolve(flagProfile ? { profile: flagProfile } : {}).pipe(catchTags({
|
|
30776
30780
|
Generic: (e) => {
|
|
30777
30781
|
return e.cause?._tag === "ConfigMissingApiUrl" ? succeed$1(null) : fail$2(e);
|
|
@@ -30967,7 +30971,7 @@ const whoami = make$13("whoami", {}, () => gen(function* () {
|
|
|
30967
30971
|
}));
|
|
30968
30972
|
//#endregion
|
|
30969
30973
|
//#region src/cli/auth/index.ts
|
|
30970
|
-
const help$
|
|
30974
|
+
const help$10 = registerCommandHelp({
|
|
30971
30975
|
name: "auth",
|
|
30972
30976
|
description: "authentication",
|
|
30973
30977
|
verbs: [
|
|
@@ -30990,7 +30994,7 @@ const help$9 = registerCommandHelp({
|
|
|
30990
30994
|
}
|
|
30991
30995
|
]
|
|
30992
30996
|
});
|
|
30993
|
-
const authCmd = make$13("auth").pipe(withDescription(help$
|
|
30997
|
+
const authCmd = make$13("auth").pipe(withDescription(help$10.description), withSubcommands([
|
|
30994
30998
|
login,
|
|
30995
30999
|
logout,
|
|
30996
31000
|
whoami,
|
|
@@ -31155,7 +31159,7 @@ function makeApiService(http, config, auth, opts) {
|
|
|
31155
31159
|
})));
|
|
31156
31160
|
const maybeEmitBanner = (resolved) => gen(function* () {
|
|
31157
31161
|
if (!resolved.isProduction || opts.quiet) return;
|
|
31158
|
-
if (yield* get$
|
|
31162
|
+
if (yield* get$11(bannerEmitted)) return;
|
|
31159
31163
|
yield* set$3(bannerEmitted, true);
|
|
31160
31164
|
yield* sync(() => {
|
|
31161
31165
|
process.stderr.write(`mxs: profile=${resolved.profileName} (production) → ${resolved.apiUrl}\n`);
|
|
@@ -31247,7 +31251,7 @@ function makeApiService(http, config, auth, opts) {
|
|
|
31247
31251
|
}
|
|
31248
31252
|
const body = yield* parseBody(res);
|
|
31249
31253
|
if (opts.verbose) {
|
|
31250
|
-
if (!(yield* get$
|
|
31254
|
+
if (!(yield* get$11(detectedWire))) {
|
|
31251
31255
|
const sniffed = detectWireVersion(body);
|
|
31252
31256
|
if (sniffed) {
|
|
31253
31257
|
yield* set$3(detectedWire, sniffed);
|
|
@@ -31385,11 +31389,11 @@ function refreshOnce(auth, config, resolved, currentToken) {
|
|
|
31385
31389
|
return refreshed;
|
|
31386
31390
|
});
|
|
31387
31391
|
}
|
|
31388
|
-
const create$
|
|
31389
|
-
name: text$
|
|
31390
|
-
slug: text$
|
|
31391
|
-
type: choice("type", ["category", "tag"]).pipe(optional$
|
|
31392
|
-
icon: text$
|
|
31392
|
+
const create$5 = make$13("create", {
|
|
31393
|
+
name: text$4("name"),
|
|
31394
|
+
slug: text$4("slug"),
|
|
31395
|
+
type: choice("type", ["category", "tag"]).pipe(optional$3),
|
|
31396
|
+
icon: text$4("icon").pipe(optional$3)
|
|
31393
31397
|
}, ({ name, slug, type, icon }) => gen(function* () {
|
|
31394
31398
|
const body = {
|
|
31395
31399
|
name,
|
|
@@ -31486,12 +31490,16 @@ const mapApiError = (err) => {
|
|
|
31486
31490
|
const make$3 = (api, deps = {}) => {
|
|
31487
31491
|
const cache = /* @__PURE__ */ new Map();
|
|
31488
31492
|
const ttlMs = deps.ttlMs ?? DEFAULT_TTL_MS;
|
|
31493
|
+
const URLS_BY_KIND = {
|
|
31494
|
+
category: "/categories",
|
|
31495
|
+
topic: "/topics/all",
|
|
31496
|
+
project: "/projects/all"
|
|
31497
|
+
};
|
|
31489
31498
|
const load = (kind) => gen(function* () {
|
|
31490
31499
|
const cached = cache.get(kind);
|
|
31491
31500
|
const t = Date.now();
|
|
31492
31501
|
if (cached && cached.expiresAt > t) return cached.items;
|
|
31493
|
-
const
|
|
31494
|
-
const items = unwrapArrayEnvelope(yield* api.raw(url).pipe(mapError(mapApiError)));
|
|
31502
|
+
const items = unwrapArrayEnvelope(yield* api.raw(URLS_BY_KIND[kind]).pipe(mapError(mapApiError)));
|
|
31495
31503
|
cache.set(kind, {
|
|
31496
31504
|
items,
|
|
31497
31505
|
expiresAt: t + ttlMs
|
|
@@ -31564,6 +31572,20 @@ const make$3 = (api, deps = {}) => {
|
|
|
31564
31572
|
}));
|
|
31565
31573
|
return id;
|
|
31566
31574
|
});
|
|
31575
|
+
const resolveProjectId = (nameOrId) => gen(function* () {
|
|
31576
|
+
if (isSnowflakeId(nameOrId)) return nameOrId;
|
|
31577
|
+
const items = yield* load("project");
|
|
31578
|
+
const hit = matchItem(items, nameOrId);
|
|
31579
|
+
if (hit) return hit.id;
|
|
31580
|
+
const suggestions = fuzzySuggest(items, nameOrId);
|
|
31581
|
+
return yield* fail$2(new ResourceNotFound({
|
|
31582
|
+
message: `project not found: ${nameOrId}`,
|
|
31583
|
+
kind: "project",
|
|
31584
|
+
ref: nameOrId,
|
|
31585
|
+
...suggestions.length ? { details: { suggestions } } : {},
|
|
31586
|
+
hint: "run `mxs project list` to see available projects"
|
|
31587
|
+
}));
|
|
31588
|
+
});
|
|
31567
31589
|
const invalidate = (kind) => sync(() => {
|
|
31568
31590
|
if (!kind) {
|
|
31569
31591
|
cache.clear();
|
|
@@ -31579,6 +31601,7 @@ const make$3 = (api, deps = {}) => {
|
|
|
31579
31601
|
resolvePostReadPath,
|
|
31580
31602
|
resolveNoteId,
|
|
31581
31603
|
resolveCategoryId,
|
|
31604
|
+
resolveProjectId,
|
|
31582
31605
|
invalidate
|
|
31583
31606
|
};
|
|
31584
31607
|
};
|
|
@@ -31591,8 +31614,8 @@ var Resolver = class Resolver extends Tag$2("Resolver")() {
|
|
|
31591
31614
|
return make$3(yield* Api);
|
|
31592
31615
|
}));
|
|
31593
31616
|
};
|
|
31594
|
-
const del$
|
|
31595
|
-
slugOrId: text$
|
|
31617
|
+
const del$6 = make$13("delete", {
|
|
31618
|
+
slugOrId: text$6({ name: "slugOrId" }),
|
|
31596
31619
|
force: boolean("force")
|
|
31597
31620
|
}, ({ slugOrId, force }) => gen(function* () {
|
|
31598
31621
|
if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
|
|
@@ -31602,7 +31625,7 @@ const del$5 = make$13("delete", {
|
|
|
31602
31625
|
yield* api.request(`/categories/${id}`, { method: "DELETE" });
|
|
31603
31626
|
yield* renderer.emitSuccess({ deleted: id });
|
|
31604
31627
|
}));
|
|
31605
|
-
const get$
|
|
31628
|
+
const get$8 = make$13("get", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31606
31629
|
const api = yield* Api;
|
|
31607
31630
|
const renderer = yield* Renderer;
|
|
31608
31631
|
const res = yield* api.request(`/categories/${encodeURIComponent(slugOrId)}`);
|
|
@@ -31610,18 +31633,18 @@ const get$7 = make$13("get", { slugOrId: text$5({ name: "slugOrId" }) }, ({ slug
|
|
|
31610
31633
|
}));
|
|
31611
31634
|
//#endregion
|
|
31612
31635
|
//#region src/cli/category/list.ts
|
|
31613
|
-
const list$
|
|
31636
|
+
const list$8 = make$13("list", {}, () => gen(function* () {
|
|
31614
31637
|
const api = yield* Api;
|
|
31615
31638
|
const renderer = yield* Renderer;
|
|
31616
31639
|
const res = yield* api.request("/categories");
|
|
31617
31640
|
yield* renderer.emitSuccess(res);
|
|
31618
31641
|
}));
|
|
31619
|
-
const update$
|
|
31620
|
-
slugOrId: text$
|
|
31621
|
-
name: text$
|
|
31622
|
-
slug: text$
|
|
31623
|
-
type: choice("type", ["category", "tag"]).pipe(optional$
|
|
31624
|
-
icon: text$
|
|
31642
|
+
const update$5 = make$13("update", {
|
|
31643
|
+
slugOrId: text$6({ name: "slugOrId" }),
|
|
31644
|
+
name: text$4("name").pipe(optional$3),
|
|
31645
|
+
slug: text$4("slug").pipe(optional$3),
|
|
31646
|
+
type: choice("type", ["category", "tag"]).pipe(optional$3),
|
|
31647
|
+
icon: text$4("icon").pipe(optional$3)
|
|
31625
31648
|
}, ({ slugOrId, name, slug, type, icon }) => gen(function* () {
|
|
31626
31649
|
const body = {};
|
|
31627
31650
|
const n = getOrUndefined(name);
|
|
@@ -31643,7 +31666,7 @@ const update$4 = make$13("update", {
|
|
|
31643
31666
|
}));
|
|
31644
31667
|
//#endregion
|
|
31645
31668
|
//#region src/cli/category/index.ts
|
|
31646
|
-
const help$
|
|
31669
|
+
const help$9 = registerCommandHelp({
|
|
31647
31670
|
name: "category",
|
|
31648
31671
|
description: "manage categories / tags",
|
|
31649
31672
|
verbs: [
|
|
@@ -31683,12 +31706,12 @@ const help$8 = registerCommandHelp({
|
|
|
31683
31706
|
}
|
|
31684
31707
|
]
|
|
31685
31708
|
});
|
|
31686
|
-
const categoryCmd = make$13("category").pipe(withDescription(help$
|
|
31687
|
-
list$
|
|
31688
|
-
get$
|
|
31689
|
-
create$
|
|
31690
|
-
update$
|
|
31691
|
-
del$
|
|
31709
|
+
const categoryCmd = make$13("category").pipe(withDescription(help$9.description), withSubcommands([
|
|
31710
|
+
list$8,
|
|
31711
|
+
get$8,
|
|
31712
|
+
create$5,
|
|
31713
|
+
update$5,
|
|
31714
|
+
del$6
|
|
31692
31715
|
]));
|
|
31693
31716
|
//#endregion
|
|
31694
31717
|
//#region src/services/Comment.ts
|
|
@@ -31789,14 +31812,14 @@ var Comment = class Comment extends Tag$2("Comment")() {
|
|
|
31789
31812
|
};
|
|
31790
31813
|
//#endregion
|
|
31791
31814
|
//#region src/cli/comment/_flags.ts
|
|
31792
|
-
const ids = text$
|
|
31815
|
+
const ids = text$6({ name: "id" }).pipe(repeated);
|
|
31793
31816
|
const all$1 = boolean("all").pipe(withDescription$3("apply to every comment (optionally filtered by --state)"));
|
|
31794
|
-
const force$
|
|
31817
|
+
const force$7 = boolean("force").pipe(withDescription$3("skip TTY confirmation guard"));
|
|
31795
31818
|
const stateFilter = choice("state", [
|
|
31796
31819
|
"unread",
|
|
31797
31820
|
"read",
|
|
31798
31821
|
"junk"
|
|
31799
|
-
]).pipe(optional$
|
|
31822
|
+
]).pipe(optional$3);
|
|
31800
31823
|
const unwrapOption = (value) => getOrUndefined(value);
|
|
31801
31824
|
/**
|
|
31802
31825
|
* Shared invariants for ids/--all batch verbs (`approve`, `reject`, `delete`).
|
|
@@ -31822,7 +31845,7 @@ const requireForceForSingleDelete = (params) => suspend(() => {
|
|
|
31822
31845
|
const approve = make$13("approve", {
|
|
31823
31846
|
ids,
|
|
31824
31847
|
all: all$1,
|
|
31825
|
-
force: force$
|
|
31848
|
+
force: force$7,
|
|
31826
31849
|
state: stateFilter
|
|
31827
31850
|
}, ({ ids, all, force, state }) => gen(function* () {
|
|
31828
31851
|
yield* validateBatchSelection({
|
|
@@ -31846,10 +31869,10 @@ const approve = make$13("approve", {
|
|
|
31846
31869
|
})).pipe(withDescription("mark comments as read; pass ids or --all [--state <s>]"));
|
|
31847
31870
|
//#endregion
|
|
31848
31871
|
//#region src/cli/comment/delete.ts
|
|
31849
|
-
const del$
|
|
31872
|
+
const del$5 = make$13("delete", {
|
|
31850
31873
|
ids,
|
|
31851
31874
|
all: all$1,
|
|
31852
|
-
force: force$
|
|
31875
|
+
force: force$7,
|
|
31853
31876
|
state: stateFilter
|
|
31854
31877
|
}, ({ ids, all, force, state }) => gen(function* () {
|
|
31855
31878
|
yield* validateBatchSelection({
|
|
@@ -31878,7 +31901,7 @@ const del$4 = make$13("delete", {
|
|
|
31878
31901
|
})).pipe(withDescription("soft-delete comments; pass ids or --all [--state <s>]"));
|
|
31879
31902
|
//#endregion
|
|
31880
31903
|
//#region src/cli/comment/view.ts
|
|
31881
|
-
const normalize$
|
|
31904
|
+
const normalize$4 = (data) => asRecord(unwrapDocument(data));
|
|
31882
31905
|
const stateLabel = (raw) => {
|
|
31883
31906
|
if (typeof raw === "number") return stateCodeToName(raw) ?? String(raw);
|
|
31884
31907
|
if (typeof raw === "string") return raw;
|
|
@@ -31924,7 +31947,7 @@ const collectDetailFields = (doc) => {
|
|
|
31924
31947
|
].filter(([, value]) => value !== void 0 && value !== null && value !== "");
|
|
31925
31948
|
};
|
|
31926
31949
|
const renderCommentReadable = (data, color) => {
|
|
31927
|
-
const doc = normalize$
|
|
31950
|
+
const doc = normalize$4(data);
|
|
31928
31951
|
return renderMetadataBlock({
|
|
31929
31952
|
title: `comment from ${authorOf(doc)}`,
|
|
31930
31953
|
kind: "comment",
|
|
@@ -31934,7 +31957,7 @@ const renderCommentReadable = (data, color) => {
|
|
|
31934
31957
|
}, { color });
|
|
31935
31958
|
};
|
|
31936
31959
|
const renderCommentLlm = (data) => {
|
|
31937
|
-
const doc = normalize$
|
|
31960
|
+
const doc = normalize$4(data);
|
|
31938
31961
|
const fm = frontmatter({
|
|
31939
31962
|
title: `comment ${firstString(doc, "id") || ""}`.trim(),
|
|
31940
31963
|
fields: collectDetailFields(doc)
|
|
@@ -32013,15 +32036,15 @@ const commentListView = {
|
|
|
32013
32036
|
readable: (data, ctx) => renderCommentListReadable(data, ctx.color),
|
|
32014
32037
|
llm: (data) => renderCommentListLlm(data)
|
|
32015
32038
|
};
|
|
32016
|
-
const get$
|
|
32039
|
+
const get$7 = make$13("get", { id: text$6({ name: "id" }) }, ({ id }) => gen(function* () {
|
|
32017
32040
|
const comment = yield* Comment;
|
|
32018
32041
|
const renderer = yield* Renderer;
|
|
32019
32042
|
const res = yield* comment.get(id);
|
|
32020
32043
|
yield* renderer.emit(commentView, res);
|
|
32021
32044
|
})).pipe(withDescription("show a single comment by id"));
|
|
32022
|
-
const list$
|
|
32023
|
-
page: integer("page").pipe(optional$
|
|
32024
|
-
size: integer("size").pipe(optional$
|
|
32045
|
+
const list$7 = make$13("list", {
|
|
32046
|
+
page: integer("page").pipe(optional$3),
|
|
32047
|
+
size: integer("size").pipe(optional$3),
|
|
32025
32048
|
state: stateFilter,
|
|
32026
32049
|
all: boolean("all").pipe(withDescription$3("list comments across every state (ignores --state)"))
|
|
32027
32050
|
}, ({ page, size, state, all }) => gen(function* () {
|
|
@@ -32040,7 +32063,7 @@ const list$6 = make$13("list", {
|
|
|
32040
32063
|
const reject = make$13("reject", {
|
|
32041
32064
|
ids,
|
|
32042
32065
|
all: all$1,
|
|
32043
|
-
force: force$
|
|
32066
|
+
force: force$7,
|
|
32044
32067
|
state: stateFilter
|
|
32045
32068
|
}, ({ ids, all, force, state }) => gen(function* () {
|
|
32046
32069
|
yield* validateBatchSelection({
|
|
@@ -32126,8 +32149,8 @@ const readStdin = gen(function* () {
|
|
|
32126
32149
|
});
|
|
32127
32150
|
});
|
|
32128
32151
|
const reply = make$13("reply", {
|
|
32129
|
-
id: text$
|
|
32130
|
-
text: text$
|
|
32152
|
+
id: text$6({ name: "id" }),
|
|
32153
|
+
text: text$4("text").pipe(withDescription$3("reply text — inline literal, `file=<path>`, or `-`/`stdin` to read stdin"), optional$3),
|
|
32131
32154
|
whispers: boolean("whispers").pipe(withDescription$3("mark this reply as whispers (owner-only visible)")),
|
|
32132
32155
|
silent: boolean("silent").pipe(withDescription$3("on success, emit a minimal `ok` instead of the full server response"))
|
|
32133
32156
|
}, ({ id, text, whispers, silent }) => gen(function* () {
|
|
@@ -32144,8 +32167,8 @@ const reply = make$13("reply", {
|
|
|
32144
32167
|
yield* renderer.emitSuccess(silent ? { ok: true } : res);
|
|
32145
32168
|
})).pipe(withDescription("post an owner reply to a comment; pass --text inline, --text file=<path>, or --text -"));
|
|
32146
32169
|
const unread = make$13("unread", {
|
|
32147
|
-
page: integer("page").pipe(optional$
|
|
32148
|
-
size: integer("size").pipe(optional$
|
|
32170
|
+
page: integer("page").pipe(optional$3),
|
|
32171
|
+
size: integer("size").pipe(optional$3)
|
|
32149
32172
|
}, ({ page, size }) => gen(function* () {
|
|
32150
32173
|
const comment = yield* Comment;
|
|
32151
32174
|
const renderer = yield* Renderer;
|
|
@@ -32158,7 +32181,7 @@ const unread = make$13("unread", {
|
|
|
32158
32181
|
})).pipe(withDescription("list unread comments (alias for `comment list --state unread`)"));
|
|
32159
32182
|
//#endregion
|
|
32160
32183
|
//#region src/cli/comment/index.ts
|
|
32161
|
-
const help$
|
|
32184
|
+
const help$8 = registerCommandHelp({
|
|
32162
32185
|
name: "comment",
|
|
32163
32186
|
description: "list and moderate comments",
|
|
32164
32187
|
verbs: [
|
|
@@ -32225,18 +32248,18 @@ const help$7 = registerCommandHelp({
|
|
|
32225
32248
|
}
|
|
32226
32249
|
]
|
|
32227
32250
|
});
|
|
32228
|
-
const commentCmd = make$13("comment").pipe(withDescription(help$
|
|
32229
|
-
list$
|
|
32251
|
+
const commentCmd = make$13("comment").pipe(withDescription(help$8.description), withSubcommands([
|
|
32252
|
+
list$7,
|
|
32230
32253
|
unread,
|
|
32231
|
-
get$
|
|
32254
|
+
get$7,
|
|
32232
32255
|
reply,
|
|
32233
32256
|
approve,
|
|
32234
32257
|
reject,
|
|
32235
|
-
del$
|
|
32258
|
+
del$5
|
|
32236
32259
|
]));
|
|
32237
32260
|
//#endregion
|
|
32238
32261
|
//#region src/cli/config/edit.ts
|
|
32239
|
-
const edit$
|
|
32262
|
+
const edit$4 = make$13("edit", {}, () => gen(function* () {
|
|
32240
32263
|
const api = yield* Api;
|
|
32241
32264
|
const editor = yield* Editor;
|
|
32242
32265
|
const renderer = yield* Renderer;
|
|
@@ -32261,7 +32284,7 @@ const edit$3 = make$13("edit", {}, () => gen(function* () {
|
|
|
32261
32284
|
});
|
|
32262
32285
|
yield* renderer.emitSuccess(results);
|
|
32263
32286
|
}));
|
|
32264
|
-
const get$
|
|
32287
|
+
const get$6 = make$13("get", { key: text$6({ name: "key" }) }, ({ key }) => gen(function* () {
|
|
32265
32288
|
const api = yield* Api;
|
|
32266
32289
|
const renderer = yield* Renderer;
|
|
32267
32290
|
const res = yield* api.request(`/options/${encodeURIComponent(key)}`);
|
|
@@ -32269,7 +32292,7 @@ const get$5 = make$13("get", { key: text$5({ name: "key" }) }, ({ key }) => gen(
|
|
|
32269
32292
|
}));
|
|
32270
32293
|
//#endregion
|
|
32271
32294
|
//#region src/cli/config/list.ts
|
|
32272
|
-
const list$
|
|
32295
|
+
const list$6 = make$13("list", {}, () => gen(function* () {
|
|
32273
32296
|
const api = yield* Api;
|
|
32274
32297
|
const renderer = yield* Renderer;
|
|
32275
32298
|
const res = yield* api.request("/options");
|
|
@@ -32277,14 +32300,14 @@ const list$5 = make$13("list", {}, () => gen(function* () {
|
|
|
32277
32300
|
}));
|
|
32278
32301
|
//#endregion
|
|
32279
32302
|
//#region src/cli/config/set.ts
|
|
32280
|
-
const key = text$
|
|
32281
|
-
const value = text$
|
|
32303
|
+
const key = text$6({ name: "key" });
|
|
32304
|
+
const value = text$6({ name: "value" });
|
|
32282
32305
|
const type_ = choice("type", [
|
|
32283
32306
|
"json",
|
|
32284
32307
|
"string",
|
|
32285
32308
|
"number",
|
|
32286
32309
|
"bool"
|
|
32287
|
-
]).pipe(optional$
|
|
32310
|
+
]).pipe(optional$3);
|
|
32288
32311
|
const coerce = (raw, type) => {
|
|
32289
32312
|
if (type === "string") return succeed$1(raw);
|
|
32290
32313
|
if (type === "number") {
|
|
@@ -32316,7 +32339,7 @@ const set = make$13("set", {
|
|
|
32316
32339
|
}));
|
|
32317
32340
|
//#endregion
|
|
32318
32341
|
//#region src/cli/config/index.ts
|
|
32319
|
-
const help$
|
|
32342
|
+
const help$7 = registerCommandHelp({
|
|
32320
32343
|
name: "config",
|
|
32321
32344
|
description: "manage server options",
|
|
32322
32345
|
verbs: [
|
|
@@ -32344,16 +32367,18 @@ const help$6 = registerCommandHelp({
|
|
|
32344
32367
|
}
|
|
32345
32368
|
]
|
|
32346
32369
|
});
|
|
32347
|
-
const configCmd = make$13("config").pipe(withDescription(help$
|
|
32348
|
-
list$
|
|
32349
|
-
get$
|
|
32370
|
+
const configCmd = make$13("config").pipe(withDescription(help$7.description), withSubcommands([
|
|
32371
|
+
list$6,
|
|
32372
|
+
get$6,
|
|
32350
32373
|
set,
|
|
32351
|
-
edit$
|
|
32374
|
+
edit$4
|
|
32352
32375
|
]));
|
|
32353
32376
|
//#endregion
|
|
32354
32377
|
//#region src/domain/admin-link.ts
|
|
32355
32378
|
const buildEditUrl = (adminUrl, kind, id) => {
|
|
32356
|
-
|
|
32379
|
+
const base = adminUrl.replace(/\/+$/, "");
|
|
32380
|
+
if (kind === "projects") return `${base}#/projects/${encodeURIComponent(id)}`;
|
|
32381
|
+
return `${base}#/${kind}/edit?id=${encodeURIComponent(id)}`;
|
|
32357
32382
|
};
|
|
32358
32383
|
/**
|
|
32359
32384
|
* Resolve the server's admin URL from `/options/url`, build the admin
|
|
@@ -32519,7 +32544,7 @@ function countLines(s) {
|
|
|
32519
32544
|
function decodeXmlEntities(s) {
|
|
32520
32545
|
return s.replaceAll("<", "<").replaceAll(">", ">").replaceAll(""", "\"").replaceAll("'", "'").replaceAll("&", "&");
|
|
32521
32546
|
}
|
|
32522
|
-
function parseEnvelope(xml, kind) {
|
|
32547
|
+
function parseEnvelope$1(xml, kind) {
|
|
32523
32548
|
const tokens = tokenize(xml);
|
|
32524
32549
|
const rootName = ROOT_TAGS[kind];
|
|
32525
32550
|
const rootStart = tokens.findIndex((t) => t.kind === "open" && t.name === rootName);
|
|
@@ -32735,7 +32760,7 @@ const loadEnvelopeIfAny = (filePath, kind) => gen(function* () {
|
|
|
32735
32760
|
return yield* parseEnvelopeEffect(xml, kind);
|
|
32736
32761
|
});
|
|
32737
32762
|
const parseEnvelopeEffect = (xml, kind) => try_({
|
|
32738
|
-
try: () => parseEnvelope(xml, kind),
|
|
32763
|
+
try: () => parseEnvelope$1(xml, kind),
|
|
32739
32764
|
catch: (err) => err instanceof ValidationXml ? err : new ValidationXml({
|
|
32740
32765
|
message: messageOf(err),
|
|
32741
32766
|
cause: err
|
|
@@ -32888,25 +32913,25 @@ const resolveContent = (flagSpec, envelope, format) => gen(function* () {
|
|
|
32888
32913
|
});
|
|
32889
32914
|
//#endregion
|
|
32890
32915
|
//#region src/cli/post/_flags.ts
|
|
32891
|
-
const optional$
|
|
32892
|
-
const unwrap$
|
|
32893
|
-
const title$2 = optional$
|
|
32894
|
-
const slug$4 = optional$
|
|
32895
|
-
const category = optional$
|
|
32896
|
-
const content$2 = optional$
|
|
32897
|
-
const summary = optional$
|
|
32898
|
-
const file$
|
|
32899
|
-
const meta$2 = optional$
|
|
32900
|
-
const pin = optional$
|
|
32901
|
-
const format$2 = choice("format", ["lexical", "markdown"]).pipe(optional$
|
|
32902
|
-
const state$3 = choice("state", ["publish", "draft"]).pipe(optional$
|
|
32903
|
-
const tags = optional$
|
|
32904
|
-
const related = optional$
|
|
32905
|
-
const pinOrder = optional$
|
|
32906
|
-
const copyright = optional$
|
|
32907
|
-
const openFlag$
|
|
32908
|
-
const silentFlag$
|
|
32909
|
-
const parseCsv = (v) => {
|
|
32916
|
+
const optional$2 = (self) => optional$3(self);
|
|
32917
|
+
const unwrap$6 = (value) => getOrUndefined(value);
|
|
32918
|
+
const title$2 = optional$2(text$4("title"));
|
|
32919
|
+
const slug$4 = optional$2(text$4("slug"));
|
|
32920
|
+
const category = optional$2(text$4("category"));
|
|
32921
|
+
const content$2 = optional$2(text$4("content"));
|
|
32922
|
+
const summary = optional$2(text$4("summary"));
|
|
32923
|
+
const file$3 = optional$2(text$4("file"));
|
|
32924
|
+
const meta$2 = optional$2(text$4("meta"));
|
|
32925
|
+
const pin = optional$2(text$4("pin"));
|
|
32926
|
+
const format$2 = choice("format", ["lexical", "markdown"]).pipe(optional$3);
|
|
32927
|
+
const state$3 = choice("state", ["publish", "draft"]).pipe(optional$3);
|
|
32928
|
+
const tags = optional$2(text$4("tags"));
|
|
32929
|
+
const related = optional$2(text$4("related"));
|
|
32930
|
+
const pinOrder = optional$2(integer("pin-order"));
|
|
32931
|
+
const copyright = optional$2(text$4("copyright"));
|
|
32932
|
+
const openFlag$4 = boolean("open").pipe(withDescription$3("After success, open the admin edit page in the default browser."));
|
|
32933
|
+
const silentFlag$4 = boolean("silent").pipe(withDescription$3("On success, emit a minimal `ok` instead of the full server response (saves output tokens). Errors still print normally."));
|
|
32934
|
+
const parseCsv$1 = (v) => {
|
|
32910
32935
|
if (v === void 0) return void 0;
|
|
32911
32936
|
return v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
32912
32937
|
};
|
|
@@ -32925,9 +32950,9 @@ const postWriteOptions = {
|
|
|
32925
32950
|
pinOrder,
|
|
32926
32951
|
related,
|
|
32927
32952
|
meta: meta$2,
|
|
32928
|
-
file: file$
|
|
32929
|
-
open: openFlag$
|
|
32930
|
-
silent: silentFlag$
|
|
32953
|
+
file: file$3,
|
|
32954
|
+
open: openFlag$4,
|
|
32955
|
+
silent: silentFlag$4
|
|
32931
32956
|
};
|
|
32932
32957
|
/** Resolve `__categoryName` placeholder (set by `buildPostPayload`) → `categoryId`. */
|
|
32933
32958
|
const resolveCategoryRefs = (payload) => gen(function* () {
|
|
@@ -32938,23 +32963,23 @@ const resolveCategoryRefs = (payload) => gen(function* () {
|
|
|
32938
32963
|
return next;
|
|
32939
32964
|
});
|
|
32940
32965
|
const toPostFlagInputs = (opts) => ({
|
|
32941
|
-
title: unwrap$
|
|
32942
|
-
slug: unwrap$
|
|
32943
|
-
category: unwrap$
|
|
32944
|
-
content: unwrap$
|
|
32945
|
-
format: unwrap$
|
|
32946
|
-
summary: unwrap$
|
|
32947
|
-
state: unwrap$
|
|
32948
|
-
tags: parseCsv(unwrap$
|
|
32949
|
-
copyright: parseCopyright(unwrap$
|
|
32950
|
-
pin: unwrap$
|
|
32951
|
-
pinOrder: unwrap$
|
|
32952
|
-
related: parseCsv(unwrap$
|
|
32953
|
-
meta: unwrap$
|
|
32954
|
-
file: unwrap$
|
|
32966
|
+
title: unwrap$6(opts.title),
|
|
32967
|
+
slug: unwrap$6(opts.slug),
|
|
32968
|
+
category: unwrap$6(opts.category),
|
|
32969
|
+
content: unwrap$6(opts.content),
|
|
32970
|
+
format: unwrap$6(opts.format),
|
|
32971
|
+
summary: unwrap$6(opts.summary),
|
|
32972
|
+
state: unwrap$6(opts.state),
|
|
32973
|
+
tags: parseCsv$1(unwrap$6(opts.tags)),
|
|
32974
|
+
copyright: parseCopyright(unwrap$6(opts.copyright)),
|
|
32975
|
+
pin: unwrap$6(opts.pin),
|
|
32976
|
+
pinOrder: unwrap$6(opts.pinOrder),
|
|
32977
|
+
related: parseCsv$1(unwrap$6(opts.related)),
|
|
32978
|
+
meta: unwrap$6(opts.meta),
|
|
32979
|
+
file: unwrap$6(opts.file)
|
|
32955
32980
|
});
|
|
32956
32981
|
/** Extract the id from a server response — handles both `id` and `_id`. */
|
|
32957
|
-
const extractId = (res) => {
|
|
32982
|
+
const extractId$1 = (res) => {
|
|
32958
32983
|
if (!res || typeof res !== "object") return void 0;
|
|
32959
32984
|
const r = res;
|
|
32960
32985
|
if (typeof r.id === "string") return r.id;
|
|
@@ -32962,29 +32987,29 @@ const extractId = (res) => {
|
|
|
32962
32987
|
};
|
|
32963
32988
|
//#endregion
|
|
32964
32989
|
//#region src/cli/note/_flags.ts
|
|
32965
|
-
const optional = (self) => optional$
|
|
32966
|
-
const unwrap$
|
|
32967
|
-
const title$1 = optional(text$
|
|
32968
|
-
const slug$3 = optional(text$
|
|
32969
|
-
const topic = optional(text$
|
|
32970
|
-
const content$1 = optional(text$
|
|
32971
|
-
const mood = optional(text$
|
|
32972
|
-
const weather = optional(text$
|
|
32973
|
-
const publicAt = optional(text$
|
|
32974
|
-
const password = optional(text$
|
|
32975
|
-
const coords = optional(text$
|
|
32976
|
-
const location$1 = optional(text$
|
|
32977
|
-
const images = optional(text$
|
|
32978
|
-
const meta$1 = optional(text$
|
|
32979
|
-
const file$
|
|
32980
|
-
const bookmark = optional(text$
|
|
32990
|
+
const optional$1 = (self) => optional$3(self);
|
|
32991
|
+
const unwrap$5 = (value) => getOrUndefined(value);
|
|
32992
|
+
const title$1 = optional$1(text$4("title"));
|
|
32993
|
+
const slug$3 = optional$1(text$4("slug"));
|
|
32994
|
+
const topic = optional$1(text$4("topic"));
|
|
32995
|
+
const content$1 = optional$1(text$4("content"));
|
|
32996
|
+
const mood = optional$1(text$4("mood"));
|
|
32997
|
+
const weather = optional$1(text$4("weather"));
|
|
32998
|
+
const publicAt = optional$1(text$4("public-at"));
|
|
32999
|
+
const password = optional$1(text$4("password"));
|
|
33000
|
+
const coords = optional$1(text$4("coords"));
|
|
33001
|
+
const location$1 = optional$1(text$4("location"));
|
|
33002
|
+
const images$1 = optional$1(text$4("images"));
|
|
33003
|
+
const meta$1 = optional$1(text$4("meta"));
|
|
33004
|
+
const file$2 = optional$1(text$4("file"));
|
|
33005
|
+
const bookmark = optional$1(text$4("bookmark"));
|
|
32981
33006
|
const noteWriteOptions = {
|
|
32982
33007
|
title: title$1,
|
|
32983
33008
|
slug: slug$3,
|
|
32984
33009
|
topic,
|
|
32985
33010
|
content: content$1,
|
|
32986
|
-
format: choice("format", ["lexical", "markdown"]).pipe(optional$
|
|
32987
|
-
state: choice("state", ["publish", "draft"]).pipe(optional$
|
|
33011
|
+
format: choice("format", ["lexical", "markdown"]).pipe(optional$3),
|
|
33012
|
+
state: choice("state", ["publish", "draft"]).pipe(optional$3),
|
|
32988
33013
|
mood,
|
|
32989
33014
|
weather,
|
|
32990
33015
|
publicAt,
|
|
@@ -32992,30 +33017,30 @@ const noteWriteOptions = {
|
|
|
32992
33017
|
bookmark,
|
|
32993
33018
|
coords,
|
|
32994
33019
|
location: location$1,
|
|
32995
|
-
images,
|
|
33020
|
+
images: images$1,
|
|
32996
33021
|
meta: meta$1,
|
|
32997
|
-
file: file$
|
|
33022
|
+
file: file$2,
|
|
32998
33023
|
open: boolean("open").pipe(withDescription$3("After success, open the admin edit page in the default browser.")),
|
|
32999
33024
|
silent: boolean("silent").pipe(withDescription$3("On success, emit a minimal `ok` instead of the full server response (saves output tokens). Errors still print normally."))
|
|
33000
33025
|
};
|
|
33001
33026
|
const parseBoolean = (v) => v === void 0 ? void 0 : v === "true";
|
|
33002
33027
|
const toNoteFlagInputs = (opts) => ({
|
|
33003
|
-
title: unwrap$
|
|
33004
|
-
slug: unwrap$
|
|
33005
|
-
topic: unwrap$
|
|
33006
|
-
content: unwrap$
|
|
33007
|
-
format: unwrap$
|
|
33008
|
-
state: unwrap$
|
|
33009
|
-
mood: unwrap$
|
|
33010
|
-
weather: unwrap$
|
|
33011
|
-
publicAt: unwrap$
|
|
33012
|
-
password: unwrap$
|
|
33013
|
-
bookmark: parseBoolean(unwrap$
|
|
33014
|
-
coords: unwrap$
|
|
33015
|
-
location: unwrap$
|
|
33016
|
-
images: unwrap$
|
|
33017
|
-
meta: unwrap$
|
|
33018
|
-
file: unwrap$
|
|
33028
|
+
title: unwrap$5(opts.title),
|
|
33029
|
+
slug: unwrap$5(opts.slug),
|
|
33030
|
+
topic: unwrap$5(opts.topic),
|
|
33031
|
+
content: unwrap$5(opts.content),
|
|
33032
|
+
format: unwrap$5(opts.format),
|
|
33033
|
+
state: unwrap$5(opts.state),
|
|
33034
|
+
mood: unwrap$5(opts.mood),
|
|
33035
|
+
weather: unwrap$5(opts.weather),
|
|
33036
|
+
publicAt: unwrap$5(opts.publicAt),
|
|
33037
|
+
password: unwrap$5(opts.password),
|
|
33038
|
+
bookmark: parseBoolean(unwrap$5(opts.bookmark)),
|
|
33039
|
+
coords: unwrap$5(opts.coords),
|
|
33040
|
+
location: unwrap$5(opts.location),
|
|
33041
|
+
images: unwrap$5(opts.images),
|
|
33042
|
+
meta: unwrap$5(opts.meta),
|
|
33043
|
+
file: unwrap$5(opts.file)
|
|
33019
33044
|
});
|
|
33020
33045
|
/** Resolve `__topicName` placeholder → `topicId`. */
|
|
33021
33046
|
const resolveTopicRefs = (payload) => gen(function* () {
|
|
@@ -33027,7 +33052,7 @@ const resolveTopicRefs = (payload) => gen(function* () {
|
|
|
33027
33052
|
});
|
|
33028
33053
|
//#endregion
|
|
33029
33054
|
//#region src/cli/note/create.ts
|
|
33030
|
-
const create$
|
|
33055
|
+
const create$4 = make$13("create", noteWriteOptions, (opts) => gen(function* () {
|
|
33031
33056
|
const payload = yield* resolveTopicRefs((yield* buildNotePayload(toNoteFlagInputs(opts))).payload);
|
|
33032
33057
|
const api = yield* Api;
|
|
33033
33058
|
const renderer = yield* Renderer;
|
|
@@ -33037,12 +33062,12 @@ const create$3 = make$13("create", noteWriteOptions, (opts) => gen(function* ()
|
|
|
33037
33062
|
});
|
|
33038
33063
|
yield* renderer.emitSuccess(opts.silent ? { ok: true } : res);
|
|
33039
33064
|
if (opts.open) {
|
|
33040
|
-
const id = extractId(res);
|
|
33065
|
+
const id = extractId$1(res);
|
|
33041
33066
|
if (id) yield* openAdminEdit("notes", id);
|
|
33042
33067
|
}
|
|
33043
33068
|
})).pipe(withDescription("create a note"));
|
|
33044
|
-
const del$
|
|
33045
|
-
slugOrId: text$
|
|
33069
|
+
const del$4 = make$13("delete", {
|
|
33070
|
+
slugOrId: text$6({ name: "slugOrId" }),
|
|
33046
33071
|
force: boolean("force").pipe(withDescription$3("skip confirmation"))
|
|
33047
33072
|
}, ({ slugOrId, force }) => gen(function* () {
|
|
33048
33073
|
if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
|
|
@@ -33055,7 +33080,7 @@ const del$3 = make$13("delete", {
|
|
|
33055
33080
|
})).pipe(withDescription("delete a note"));
|
|
33056
33081
|
//#endregion
|
|
33057
33082
|
//#region src/cli/note/edit.ts
|
|
33058
|
-
const slugOrId$17 = text$
|
|
33083
|
+
const slugOrId$17 = text$6({ name: "slugOrId" });
|
|
33059
33084
|
const esc = (s) => s.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
33060
33085
|
const materializeForEditor$2 = (slugOrId) => gen(function* () {
|
|
33061
33086
|
const api = yield* Api;
|
|
@@ -33097,7 +33122,7 @@ const applyNoteEnvelopeMeta = (payload, rawMeta) => {
|
|
|
33097
33122
|
if (meta.location !== void 0) next.location = meta.location;
|
|
33098
33123
|
return next;
|
|
33099
33124
|
};
|
|
33100
|
-
const edit$
|
|
33125
|
+
const edit$3 = make$13("edit", {
|
|
33101
33126
|
slugOrId: slugOrId$17,
|
|
33102
33127
|
...noteWriteOptions
|
|
33103
33128
|
}, ({ slugOrId, ...rest }) => gen(function* () {
|
|
@@ -33117,7 +33142,7 @@ const edit$2 = make$13("edit", {
|
|
|
33117
33142
|
return;
|
|
33118
33143
|
}
|
|
33119
33144
|
const parsed = yield* try_({
|
|
33120
|
-
try: () => parseEnvelope(next, "note"),
|
|
33145
|
+
try: () => parseEnvelope$1(next, "note"),
|
|
33121
33146
|
catch: (err) => err instanceof ValidationXml ? err : new ValidationXml({
|
|
33122
33147
|
message: String(err),
|
|
33123
33148
|
cause: err
|
|
@@ -33146,8 +33171,8 @@ const edit$2 = make$13("edit", {
|
|
|
33146
33171
|
})).pipe(withDescription("edit a note via $EDITOR or flags"));
|
|
33147
33172
|
//#endregion
|
|
33148
33173
|
//#region src/cli/note/view.ts
|
|
33149
|
-
const normalize$
|
|
33150
|
-
const collectFields$
|
|
33174
|
+
const normalize$3 = (data) => asRecord(unwrapDocument(data));
|
|
33175
|
+
const collectFields$3 = (doc, articleMeta) => {
|
|
33151
33176
|
const meta = articleMeta ?? {};
|
|
33152
33177
|
return [
|
|
33153
33178
|
["id", first(doc, "id")],
|
|
@@ -33190,31 +33215,31 @@ const noteView = {
|
|
|
33190
33215
|
"xml"
|
|
33191
33216
|
]),
|
|
33192
33217
|
readable: (data, ctx) => {
|
|
33193
|
-
const doc = normalize$
|
|
33218
|
+
const doc = normalize$3(data);
|
|
33194
33219
|
const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
|
|
33195
33220
|
const content = renderContent(doc);
|
|
33196
33221
|
return renderMetadataBlock({
|
|
33197
33222
|
title: firstString(doc, "title") || void 0,
|
|
33198
33223
|
kind: "note",
|
|
33199
|
-
fields: collectFields$
|
|
33224
|
+
fields: collectFields$3(doc, articleMeta),
|
|
33200
33225
|
summary: pickSummary$2(doc),
|
|
33201
33226
|
body: content.body || void 0,
|
|
33202
33227
|
bodyFormat: content.format
|
|
33203
33228
|
}, ctx);
|
|
33204
33229
|
},
|
|
33205
33230
|
llm: (data) => {
|
|
33206
|
-
const doc = normalize$
|
|
33231
|
+
const doc = normalize$3(data);
|
|
33207
33232
|
const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
|
|
33208
33233
|
const content = renderContent(doc, true);
|
|
33209
33234
|
const fm = frontmatter({
|
|
33210
33235
|
title: firstString(doc, "title") || void 0,
|
|
33211
|
-
fields: collectFields$
|
|
33236
|
+
fields: collectFields$3(doc, articleMeta),
|
|
33212
33237
|
summary: pickSummary$2(doc)
|
|
33213
33238
|
});
|
|
33214
33239
|
return content.body ? `${fm}\n\n${content.body}` : fm;
|
|
33215
33240
|
},
|
|
33216
33241
|
xml: (data) => {
|
|
33217
|
-
const doc = normalize$
|
|
33242
|
+
const doc = normalize$3(data);
|
|
33218
33243
|
const content = renderContent(doc);
|
|
33219
33244
|
return renderEnvelope({
|
|
33220
33245
|
root: "mxnote",
|
|
@@ -33223,7 +33248,7 @@ const noteView = {
|
|
|
33223
33248
|
});
|
|
33224
33249
|
}
|
|
33225
33250
|
};
|
|
33226
|
-
const collectListItemFields$
|
|
33251
|
+
const collectListItemFields$2 = (doc, articleMeta) => {
|
|
33227
33252
|
const meta = articleMeta ?? {};
|
|
33228
33253
|
return [
|
|
33229
33254
|
["id", first(doc, "id")],
|
|
@@ -33260,7 +33285,7 @@ const renderNoteListReadable = (data) => {
|
|
|
33260
33285
|
const doc = asRecord(row);
|
|
33261
33286
|
const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
|
|
33262
33287
|
lines.push("", `note ${index + 1}:`);
|
|
33263
|
-
const fields = collectListItemFields$
|
|
33288
|
+
const fields = collectListItemFields$2(doc, articleMeta);
|
|
33264
33289
|
for (const [key, value] of fields) {
|
|
33265
33290
|
if (value === void 0 || value === null || value === "") continue;
|
|
33266
33291
|
if (key === "translated" && value === false) continue;
|
|
@@ -33275,7 +33300,7 @@ const noteListView = {
|
|
|
33275
33300
|
modes: new Set(["readable", "llm"]),
|
|
33276
33301
|
readable: (data) => renderNoteListReadable(data)
|
|
33277
33302
|
};
|
|
33278
|
-
const get$
|
|
33303
|
+
const get$5 = make$13("get", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
33279
33304
|
const api = yield* Api;
|
|
33280
33305
|
const renderer = yield* Renderer;
|
|
33281
33306
|
if (isSnowflakeId(slugOrId)) {
|
|
@@ -33295,27 +33320,27 @@ const get$4 = make$13("get", { slugOrId: text$5({ name: "slugOrId" }) }, ({ slug
|
|
|
33295
33320
|
})).pipe(withDescription("get a note by snowflake id or numeric nid"));
|
|
33296
33321
|
//#endregion
|
|
33297
33322
|
//#region src/cli/note/list.ts
|
|
33298
|
-
const page$
|
|
33299
|
-
const size$
|
|
33300
|
-
const state$1 = text$
|
|
33301
|
-
const sort$1 = text$
|
|
33302
|
-
const unwrap$
|
|
33303
|
-
const list$
|
|
33304
|
-
page: page$
|
|
33305
|
-
size: size$
|
|
33323
|
+
const page$2 = integer("page").pipe(optional$3);
|
|
33324
|
+
const size$2 = integer("size").pipe(optional$3);
|
|
33325
|
+
const state$1 = text$4("state").pipe(optional$3);
|
|
33326
|
+
const sort$1 = text$4("sort").pipe(optional$3);
|
|
33327
|
+
const unwrap$4 = (value) => getOrUndefined(value);
|
|
33328
|
+
const list$5 = make$13("list", {
|
|
33329
|
+
page: page$2,
|
|
33330
|
+
size: size$2,
|
|
33306
33331
|
state: state$1,
|
|
33307
33332
|
sort: sort$1
|
|
33308
33333
|
}, ({ page, size, sort }) => gen(function* () {
|
|
33309
33334
|
const api = yield* Api;
|
|
33310
33335
|
const renderer = yield* Renderer;
|
|
33311
33336
|
const res = yield* api.request("/notes", { query: {
|
|
33312
|
-
page: unwrap$
|
|
33313
|
-
size: unwrap$
|
|
33314
|
-
sortBy: unwrap$
|
|
33337
|
+
page: unwrap$4(page),
|
|
33338
|
+
size: unwrap$4(size),
|
|
33339
|
+
sortBy: unwrap$4(sort)
|
|
33315
33340
|
} });
|
|
33316
33341
|
yield* renderer.emit(noteListView, res);
|
|
33317
33342
|
})).pipe(withDescription("list notes"));
|
|
33318
|
-
const publish$1 = make$13("publish", { slugOrId: text$
|
|
33343
|
+
const publish$1 = make$13("publish", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
33319
33344
|
const resolver = yield* Resolver;
|
|
33320
33345
|
const api = yield* Api;
|
|
33321
33346
|
const renderer = yield* Renderer;
|
|
@@ -33326,7 +33351,7 @@ const publish$1 = make$13("publish", { slugOrId: text$5({ name: "slugOrId" }) },
|
|
|
33326
33351
|
});
|
|
33327
33352
|
yield* renderer.emitSuccess(res);
|
|
33328
33353
|
})).pipe(withDescription("publish a note"));
|
|
33329
|
-
const unpublish$1 = make$13("unpublish", { slugOrId: text$
|
|
33354
|
+
const unpublish$1 = make$13("unpublish", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
33330
33355
|
const resolver = yield* Resolver;
|
|
33331
33356
|
const api = yield* Api;
|
|
33332
33357
|
const renderer = yield* Renderer;
|
|
@@ -33337,8 +33362,8 @@ const unpublish$1 = make$13("unpublish", { slugOrId: text$5({ name: "slugOrId" }
|
|
|
33337
33362
|
});
|
|
33338
33363
|
yield* renderer.emitSuccess(res);
|
|
33339
33364
|
})).pipe(withDescription("unpublish a note"));
|
|
33340
|
-
const update$
|
|
33341
|
-
slugOrId: text$
|
|
33365
|
+
const update$4 = make$13("update", {
|
|
33366
|
+
slugOrId: text$6({ name: "slugOrId" }),
|
|
33342
33367
|
...noteWriteOptions
|
|
33343
33368
|
}, ({ slugOrId, ...rest }) => gen(function* () {
|
|
33344
33369
|
const flags = toNoteFlagInputs(rest);
|
|
@@ -33361,7 +33386,7 @@ const update$3 = make$13("update", {
|
|
|
33361
33386
|
})).pipe(withDescription("partially update a note"));
|
|
33362
33387
|
//#endregion
|
|
33363
33388
|
//#region src/cli/note/index.ts
|
|
33364
|
-
const help$
|
|
33389
|
+
const help$6 = registerCommandHelp({
|
|
33365
33390
|
name: "note",
|
|
33366
33391
|
description: "manage notes",
|
|
33367
33392
|
verbs: [
|
|
@@ -33424,40 +33449,40 @@ const help$5 = registerCommandHelp({
|
|
|
33424
33449
|
}
|
|
33425
33450
|
]
|
|
33426
33451
|
});
|
|
33427
|
-
const noteCmd = make$13("note").pipe(withDescription(help$
|
|
33428
|
-
list$
|
|
33429
|
-
get$
|
|
33430
|
-
create$
|
|
33431
|
-
edit$
|
|
33432
|
-
update$
|
|
33433
|
-
del$
|
|
33452
|
+
const noteCmd = make$13("note").pipe(withDescription(help$6.description), withSubcommands([
|
|
33453
|
+
list$5,
|
|
33454
|
+
get$5,
|
|
33455
|
+
create$4,
|
|
33456
|
+
edit$3,
|
|
33457
|
+
update$4,
|
|
33458
|
+
del$4,
|
|
33434
33459
|
publish$1,
|
|
33435
33460
|
unpublish$1
|
|
33436
33461
|
]));
|
|
33437
33462
|
const pageWriteOptions = {
|
|
33438
|
-
title: optional$
|
|
33439
|
-
slug: optional$
|
|
33440
|
-
subtitle: optional$
|
|
33441
|
-
order: optional$
|
|
33442
|
-
content: optional$
|
|
33443
|
-
format: choice("format", ["lexical", "markdown"]).pipe(optional$
|
|
33444
|
-
meta: optional$
|
|
33445
|
-
file: optional$
|
|
33463
|
+
title: optional$3(text$4("title")),
|
|
33464
|
+
slug: optional$3(text$4("slug")),
|
|
33465
|
+
subtitle: optional$3(text$4("subtitle")),
|
|
33466
|
+
order: optional$3(integer("order")),
|
|
33467
|
+
content: optional$3(text$4("content")),
|
|
33468
|
+
format: choice("format", ["lexical", "markdown"]).pipe(optional$3),
|
|
33469
|
+
meta: optional$3(text$4("meta")),
|
|
33470
|
+
file: optional$3(text$4("file")),
|
|
33446
33471
|
open: boolean("open").pipe(withDescription$3("After success, open the admin edit page in the default browser.")),
|
|
33447
33472
|
silent: boolean("silent").pipe(withDescription$3("On success, emit a minimal `ok` instead of the full server response (saves output tokens). Errors still print normally."))
|
|
33448
33473
|
};
|
|
33449
|
-
const unwrap$
|
|
33474
|
+
const unwrap$3 = (value) => getOrUndefined(value);
|
|
33450
33475
|
const toPageFlagInputs = (opts) => ({
|
|
33451
|
-
title: unwrap$
|
|
33452
|
-
slug: unwrap$
|
|
33453
|
-
subtitle: unwrap$
|
|
33454
|
-
order: unwrap$
|
|
33455
|
-
content: unwrap$
|
|
33456
|
-
format: unwrap$
|
|
33457
|
-
meta: unwrap$
|
|
33458
|
-
file: unwrap$
|
|
33476
|
+
title: unwrap$3(opts.title),
|
|
33477
|
+
slug: unwrap$3(opts.slug),
|
|
33478
|
+
subtitle: unwrap$3(opts.subtitle),
|
|
33479
|
+
order: unwrap$3(opts.order),
|
|
33480
|
+
content: unwrap$3(opts.content),
|
|
33481
|
+
format: unwrap$3(opts.format),
|
|
33482
|
+
meta: unwrap$3(opts.meta),
|
|
33483
|
+
file: unwrap$3(opts.file)
|
|
33459
33484
|
});
|
|
33460
|
-
const create$
|
|
33485
|
+
const create$3 = make$13("create", pageWriteOptions, (opts) => gen(function* () {
|
|
33461
33486
|
const built = yield* buildPagePayload(toPageFlagInputs(opts));
|
|
33462
33487
|
const api = yield* Api;
|
|
33463
33488
|
const renderer = yield* Renderer;
|
|
@@ -33467,14 +33492,14 @@ const create$2 = make$13("create", pageWriteOptions, (opts) => gen(function* ()
|
|
|
33467
33492
|
});
|
|
33468
33493
|
yield* renderer.emitSuccess(opts.silent ? { ok: true } : res);
|
|
33469
33494
|
if (opts.open) {
|
|
33470
|
-
const id = extractId(res);
|
|
33495
|
+
const id = extractId$1(res);
|
|
33471
33496
|
if (id) yield* openAdminEdit("pages", id);
|
|
33472
33497
|
}
|
|
33473
33498
|
}));
|
|
33474
33499
|
//#endregion
|
|
33475
33500
|
//#region src/cli/page/delete.ts
|
|
33476
|
-
const slugOrId$12 = text$
|
|
33477
|
-
const force$
|
|
33501
|
+
const slugOrId$12 = text$6({ name: "slugOrId" });
|
|
33502
|
+
const force$5 = boolean("force");
|
|
33478
33503
|
const resolvePageId$2 = (api, ref) => gen(function* () {
|
|
33479
33504
|
if (isSnowflakeId(ref)) return ref;
|
|
33480
33505
|
const res = yield* api.request(`/pages/slug/${encodeURIComponent(ref)}`).pipe(catchAll(() => succeed$1(null)));
|
|
@@ -33486,9 +33511,9 @@ const resolvePageId$2 = (api, ref) => gen(function* () {
|
|
|
33486
33511
|
}));
|
|
33487
33512
|
return id;
|
|
33488
33513
|
});
|
|
33489
|
-
const del$
|
|
33514
|
+
const del$3 = make$13("delete", {
|
|
33490
33515
|
slugOrId: slugOrId$12,
|
|
33491
|
-
force: force$
|
|
33516
|
+
force: force$5
|
|
33492
33517
|
}, ({ slugOrId, force }) => gen(function* () {
|
|
33493
33518
|
if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
|
|
33494
33519
|
const api = yield* Api;
|
|
@@ -33499,7 +33524,7 @@ const del$2 = make$13("delete", {
|
|
|
33499
33524
|
}));
|
|
33500
33525
|
//#endregion
|
|
33501
33526
|
//#region src/cli/page/edit.ts
|
|
33502
|
-
const slugOrId$11 = text$
|
|
33527
|
+
const slugOrId$11 = text$6({ name: "slugOrId" });
|
|
33503
33528
|
const escapeXml$1 = (s) => s.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
33504
33529
|
const resolvePageId$1 = (api, ref) => gen(function* () {
|
|
33505
33530
|
if (isSnowflakeId(ref)) return ref;
|
|
@@ -33543,7 +33568,7 @@ const overlayPageMeta = (payload, rawMeta) => {
|
|
|
33543
33568
|
if (meta.order !== void 0) next.order = meta.order;
|
|
33544
33569
|
return next;
|
|
33545
33570
|
};
|
|
33546
|
-
const edit$
|
|
33571
|
+
const edit$2 = make$13("edit", {
|
|
33547
33572
|
slugOrId: slugOrId$11,
|
|
33548
33573
|
...pageWriteOptions
|
|
33549
33574
|
}, ({ slugOrId, ...rest }) => gen(function* () {
|
|
@@ -33562,7 +33587,7 @@ const edit$1 = make$13("edit", {
|
|
|
33562
33587
|
return;
|
|
33563
33588
|
}
|
|
33564
33589
|
const parsed = yield* try_({
|
|
33565
|
-
try: () => parseEnvelope(next, "post"),
|
|
33590
|
+
try: () => parseEnvelope$1(next, "post"),
|
|
33566
33591
|
catch: (err) => err instanceof ValidationXml ? err : new ValidationXml({
|
|
33567
33592
|
message: String(err),
|
|
33568
33593
|
cause: err
|
|
@@ -33591,8 +33616,8 @@ const edit$1 = make$13("edit", {
|
|
|
33591
33616
|
}));
|
|
33592
33617
|
//#endregion
|
|
33593
33618
|
//#region src/cli/page/view.ts
|
|
33594
|
-
const normalize$
|
|
33595
|
-
const collectFields$
|
|
33619
|
+
const normalize$2 = (data) => asRecord(unwrapDocument(data));
|
|
33620
|
+
const collectFields$2 = (doc, articleMeta) => {
|
|
33596
33621
|
const meta = articleMeta ?? {};
|
|
33597
33622
|
return [
|
|
33598
33623
|
["id", first(doc, "id")],
|
|
@@ -33625,31 +33650,31 @@ const pageView = {
|
|
|
33625
33650
|
"xml"
|
|
33626
33651
|
]),
|
|
33627
33652
|
readable: (data, ctx) => {
|
|
33628
|
-
const doc = normalize$
|
|
33653
|
+
const doc = normalize$2(data);
|
|
33629
33654
|
const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
|
|
33630
33655
|
const content = renderContent(doc);
|
|
33631
33656
|
return renderMetadataBlock({
|
|
33632
33657
|
title: firstString(doc, "title") || void 0,
|
|
33633
33658
|
kind: "page",
|
|
33634
|
-
fields: collectFields$
|
|
33659
|
+
fields: collectFields$2(doc, articleMeta),
|
|
33635
33660
|
summary: pickSummary$1(doc),
|
|
33636
33661
|
body: content.body || void 0,
|
|
33637
33662
|
bodyFormat: content.format
|
|
33638
33663
|
}, ctx);
|
|
33639
33664
|
},
|
|
33640
33665
|
llm: (data) => {
|
|
33641
|
-
const doc = normalize$
|
|
33666
|
+
const doc = normalize$2(data);
|
|
33642
33667
|
const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
|
|
33643
33668
|
const content = renderContent(doc, true);
|
|
33644
33669
|
const fm = frontmatter({
|
|
33645
33670
|
title: firstString(doc, "title") || void 0,
|
|
33646
|
-
fields: collectFields$
|
|
33671
|
+
fields: collectFields$2(doc, articleMeta),
|
|
33647
33672
|
summary: pickSummary$1(doc)
|
|
33648
33673
|
});
|
|
33649
33674
|
return content.body ? `${fm}\n\n${content.body}` : fm;
|
|
33650
33675
|
},
|
|
33651
33676
|
xml: (data) => {
|
|
33652
|
-
const doc = normalize$
|
|
33677
|
+
const doc = normalize$2(data);
|
|
33653
33678
|
const content = renderContent(doc);
|
|
33654
33679
|
return renderEnvelope({
|
|
33655
33680
|
root: "mxpage",
|
|
@@ -33658,7 +33683,7 @@ const pageView = {
|
|
|
33658
33683
|
});
|
|
33659
33684
|
}
|
|
33660
33685
|
};
|
|
33661
|
-
const get$
|
|
33686
|
+
const get$4 = make$13("get", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
33662
33687
|
const api = yield* Api;
|
|
33663
33688
|
const renderer = yield* Renderer;
|
|
33664
33689
|
const path = isSnowflakeId(slugOrId) ? `/pages/${slugOrId}` : `/pages/slug/${encodeURIComponent(slugOrId)}`;
|
|
@@ -33667,7 +33692,7 @@ const get$3 = make$13("get", { slugOrId: text$5({ name: "slugOrId" }) }, ({ slug
|
|
|
33667
33692
|
}));
|
|
33668
33693
|
//#endregion
|
|
33669
33694
|
//#region src/cli/page/list.ts
|
|
33670
|
-
const list$
|
|
33695
|
+
const list$4 = make$13("list", {}, () => gen(function* () {
|
|
33671
33696
|
const api = yield* Api;
|
|
33672
33697
|
const renderer = yield* Renderer;
|
|
33673
33698
|
const res = yield* api.request("/pages");
|
|
@@ -33675,7 +33700,7 @@ const list$3 = make$13("list", {}, () => gen(function* () {
|
|
|
33675
33700
|
}));
|
|
33676
33701
|
//#endregion
|
|
33677
33702
|
//#region src/cli/page/update.ts
|
|
33678
|
-
const slugOrId$9 = text$
|
|
33703
|
+
const slugOrId$9 = text$6({ name: "slugOrId" });
|
|
33679
33704
|
const resolvePageId = (api, ref) => gen(function* () {
|
|
33680
33705
|
if (isSnowflakeId(ref)) return ref;
|
|
33681
33706
|
const res = yield* api.request(`/pages/slug/${encodeURIComponent(ref)}`).pipe(catchAll(() => succeed$1(null)));
|
|
@@ -33687,7 +33712,7 @@ const resolvePageId = (api, ref) => gen(function* () {
|
|
|
33687
33712
|
}));
|
|
33688
33713
|
return id;
|
|
33689
33714
|
});
|
|
33690
|
-
const update$
|
|
33715
|
+
const update$3 = make$13("update", {
|
|
33691
33716
|
slugOrId: slugOrId$9,
|
|
33692
33717
|
...pageWriteOptions
|
|
33693
33718
|
}, ({ slugOrId, ...rest }) => gen(function* () {
|
|
@@ -33710,7 +33735,7 @@ const update$2 = make$13("update", {
|
|
|
33710
33735
|
}));
|
|
33711
33736
|
//#endregion
|
|
33712
33737
|
//#region src/cli/page/index.ts
|
|
33713
|
-
const help$
|
|
33738
|
+
const help$5 = registerCommandHelp({
|
|
33714
33739
|
name: "page",
|
|
33715
33740
|
description: "manage pages",
|
|
33716
33741
|
verbs: [
|
|
@@ -33757,17 +33782,17 @@ const help$4 = registerCommandHelp({
|
|
|
33757
33782
|
}
|
|
33758
33783
|
]
|
|
33759
33784
|
});
|
|
33760
|
-
const pageCmd = make$13("page").pipe(withDescription(help$
|
|
33761
|
-
list$
|
|
33762
|
-
get$
|
|
33763
|
-
create$
|
|
33764
|
-
edit$
|
|
33765
|
-
update$
|
|
33766
|
-
del$
|
|
33785
|
+
const pageCmd = make$13("page").pipe(withDescription(help$5.description), withSubcommands([
|
|
33786
|
+
list$4,
|
|
33787
|
+
get$4,
|
|
33788
|
+
create$3,
|
|
33789
|
+
edit$2,
|
|
33790
|
+
update$3,
|
|
33791
|
+
del$3
|
|
33767
33792
|
]));
|
|
33768
33793
|
//#endregion
|
|
33769
33794
|
//#region src/cli/post/create.ts
|
|
33770
|
-
const create$
|
|
33795
|
+
const create$2 = make$13("create", postWriteOptions, (opts) => gen(function* () {
|
|
33771
33796
|
const payload = yield* resolveCategoryRefs((yield* buildPostPayload(toPostFlagInputs(opts))).payload);
|
|
33772
33797
|
const api = yield* Api;
|
|
33773
33798
|
const renderer = yield* Renderer;
|
|
@@ -33777,12 +33802,12 @@ const create$1 = make$13("create", postWriteOptions, (opts) => gen(function* ()
|
|
|
33777
33802
|
});
|
|
33778
33803
|
yield* renderer.emitSuccess(opts.silent ? { ok: true } : res);
|
|
33779
33804
|
if (opts.open) {
|
|
33780
|
-
const id = extractId(res);
|
|
33805
|
+
const id = extractId$1(res);
|
|
33781
33806
|
if (id) yield* openAdminEdit("posts", id);
|
|
33782
33807
|
}
|
|
33783
33808
|
})).pipe(withDescription("create a post"));
|
|
33784
|
-
const del$
|
|
33785
|
-
slugOrId: text$
|
|
33809
|
+
const del$2 = make$13("delete", {
|
|
33810
|
+
slugOrId: text$6({ name: "slugOrId" }),
|
|
33786
33811
|
force: boolean("force").pipe(withDescription$3("skip confirmation"))
|
|
33787
33812
|
}, ({ slugOrId, force }) => gen(function* () {
|
|
33788
33813
|
if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
|
|
@@ -33795,7 +33820,7 @@ const del$1 = make$13("delete", {
|
|
|
33795
33820
|
})).pipe(withDescription("delete a post"));
|
|
33796
33821
|
//#endregion
|
|
33797
33822
|
//#region src/cli/post/edit.ts
|
|
33798
|
-
const slugOrId$7 = text$
|
|
33823
|
+
const slugOrId$7 = text$6({ name: "slugOrId" });
|
|
33799
33824
|
const escapeXml = (s) => s.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
33800
33825
|
const materializeForEditor = (slugOrId) => gen(function* () {
|
|
33801
33826
|
const api = yield* Api;
|
|
@@ -33834,7 +33859,7 @@ const metaFromEnvelope = (meta) => {
|
|
|
33834
33859
|
if (m.tags !== void 0) overlay.tags = m.tags;
|
|
33835
33860
|
return overlay;
|
|
33836
33861
|
};
|
|
33837
|
-
const edit = make$13("edit", {
|
|
33862
|
+
const edit$1 = make$13("edit", {
|
|
33838
33863
|
slugOrId: slugOrId$7,
|
|
33839
33864
|
...postWriteOptions
|
|
33840
33865
|
}, ({ slugOrId, ...rest }) => gen(function* () {
|
|
@@ -33854,7 +33879,7 @@ const edit = make$13("edit", {
|
|
|
33854
33879
|
return;
|
|
33855
33880
|
}
|
|
33856
33881
|
const parsed = yield* try_({
|
|
33857
|
-
try: () => parseEnvelope(next, "post"),
|
|
33882
|
+
try: () => parseEnvelope$1(next, "post"),
|
|
33858
33883
|
catch: (err) => err instanceof ValidationXml ? err : new ValidationXml({
|
|
33859
33884
|
message: String(err),
|
|
33860
33885
|
cause: err
|
|
@@ -33888,8 +33913,8 @@ const edit = make$13("edit", {
|
|
|
33888
33913
|
})).pipe(withDescription("edit a post via $EDITOR or flags"));
|
|
33889
33914
|
//#endregion
|
|
33890
33915
|
//#region src/cli/post/view.ts
|
|
33891
|
-
const normalize = (data) => asRecord(unwrapDocument(data));
|
|
33892
|
-
const collectFields = (doc, articleMeta) => {
|
|
33916
|
+
const normalize$1 = (data) => asRecord(unwrapDocument(data));
|
|
33917
|
+
const collectFields$1 = (doc, articleMeta) => {
|
|
33893
33918
|
const meta = articleMeta ?? {};
|
|
33894
33919
|
return [
|
|
33895
33920
|
["id", first(doc, "id")],
|
|
@@ -33926,31 +33951,31 @@ const postView = {
|
|
|
33926
33951
|
"xml"
|
|
33927
33952
|
]),
|
|
33928
33953
|
readable: (data, ctx) => {
|
|
33929
|
-
const doc = normalize(data);
|
|
33954
|
+
const doc = normalize$1(data);
|
|
33930
33955
|
const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
|
|
33931
33956
|
const content = renderContent(doc);
|
|
33932
33957
|
return renderMetadataBlock({
|
|
33933
33958
|
title: firstString(doc, "title") || void 0,
|
|
33934
33959
|
kind: "post",
|
|
33935
|
-
fields: collectFields(doc, articleMeta),
|
|
33960
|
+
fields: collectFields$1(doc, articleMeta),
|
|
33936
33961
|
summary: pickSummary(doc),
|
|
33937
33962
|
body: content.body || void 0,
|
|
33938
33963
|
bodyFormat: content.format
|
|
33939
33964
|
}, ctx);
|
|
33940
33965
|
},
|
|
33941
33966
|
llm: (data) => {
|
|
33942
|
-
const doc = normalize(data);
|
|
33967
|
+
const doc = normalize$1(data);
|
|
33943
33968
|
const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
|
|
33944
33969
|
const content = renderContent(doc, true);
|
|
33945
33970
|
const fm = frontmatter({
|
|
33946
33971
|
title: firstString(doc, "title") || void 0,
|
|
33947
|
-
fields: collectFields(doc, articleMeta),
|
|
33972
|
+
fields: collectFields$1(doc, articleMeta),
|
|
33948
33973
|
summary: pickSummary(doc)
|
|
33949
33974
|
});
|
|
33950
33975
|
return content.body ? `${fm}\n\n${content.body}` : fm;
|
|
33951
33976
|
},
|
|
33952
33977
|
xml: (data) => {
|
|
33953
|
-
const doc = normalize(data);
|
|
33978
|
+
const doc = normalize$1(data);
|
|
33954
33979
|
const content = renderContent(doc);
|
|
33955
33980
|
return renderEnvelope({
|
|
33956
33981
|
root: "mxpost",
|
|
@@ -33959,7 +33984,7 @@ const postView = {
|
|
|
33959
33984
|
});
|
|
33960
33985
|
}
|
|
33961
33986
|
};
|
|
33962
|
-
const collectListItemFields = (doc, articleMeta) => {
|
|
33987
|
+
const collectListItemFields$1 = (doc, articleMeta) => {
|
|
33963
33988
|
const meta = articleMeta ?? {};
|
|
33964
33989
|
return [
|
|
33965
33990
|
["id", first(doc, "id")],
|
|
@@ -33992,7 +34017,7 @@ const renderPostListReadable = (data) => {
|
|
|
33992
34017
|
const doc = asRecord(row);
|
|
33993
34018
|
const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
|
|
33994
34019
|
lines.push("", `post ${index + 1}:`);
|
|
33995
|
-
const fields = collectListItemFields(doc, articleMeta);
|
|
34020
|
+
const fields = collectListItemFields$1(doc, articleMeta);
|
|
33996
34021
|
for (const [key, value] of fields) {
|
|
33997
34022
|
if (value === void 0 || value === null || value === "") continue;
|
|
33998
34023
|
const rendered = tryFormatTimestamp(value, { style: "rel" }) ?? formatScalar(value);
|
|
@@ -34006,7 +34031,7 @@ const postListView = {
|
|
|
34006
34031
|
modes: new Set(["readable", "llm"]),
|
|
34007
34032
|
readable: (data) => renderPostListReadable(data)
|
|
34008
34033
|
};
|
|
34009
|
-
const get$
|
|
34034
|
+
const get$3 = make$13("get", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
34010
34035
|
const api = yield* Api;
|
|
34011
34036
|
const renderer = yield* Renderer;
|
|
34012
34037
|
const path = yield* (yield* Resolver).resolvePostReadPath(slugOrId);
|
|
@@ -34015,28 +34040,28 @@ const get$2 = make$13("get", { slugOrId: text$5({ name: "slugOrId" }) }, ({ slug
|
|
|
34015
34040
|
})).pipe(withDescription("get a post by slug or id"));
|
|
34016
34041
|
//#endregion
|
|
34017
34042
|
//#region src/cli/post/list.ts
|
|
34018
|
-
const page = integer("page").pipe(optional$
|
|
34019
|
-
const size = integer("size").pipe(optional$
|
|
34020
|
-
const state = choice("state", ["publish", "draft"]).pipe(optional$
|
|
34021
|
-
const sort = choice("sort", ["created", "modified"]).pipe(optional$
|
|
34022
|
-
const unwrap = (value) => getOrUndefined(value);
|
|
34023
|
-
const list$
|
|
34024
|
-
page,
|
|
34025
|
-
size,
|
|
34043
|
+
const page$1 = integer("page").pipe(optional$3);
|
|
34044
|
+
const size$1 = integer("size").pipe(optional$3);
|
|
34045
|
+
const state = choice("state", ["publish", "draft"]).pipe(optional$3);
|
|
34046
|
+
const sort = choice("sort", ["created", "modified"]).pipe(optional$3);
|
|
34047
|
+
const unwrap$2 = (value) => getOrUndefined(value);
|
|
34048
|
+
const list$3 = make$13("list", {
|
|
34049
|
+
page: page$1,
|
|
34050
|
+
size: size$1,
|
|
34026
34051
|
state,
|
|
34027
34052
|
sort
|
|
34028
34053
|
}, ({ page, size, state, sort }) => gen(function* () {
|
|
34029
34054
|
const api = yield* Api;
|
|
34030
34055
|
const renderer = yield* Renderer;
|
|
34031
34056
|
const res = yield* api.request("/posts", { query: {
|
|
34032
|
-
page: unwrap(page),
|
|
34033
|
-
size: unwrap(size),
|
|
34034
|
-
state: unwrap(state),
|
|
34035
|
-
sortBy: unwrap(sort)
|
|
34057
|
+
page: unwrap$2(page),
|
|
34058
|
+
size: unwrap$2(size),
|
|
34059
|
+
state: unwrap$2(state),
|
|
34060
|
+
sortBy: unwrap$2(sort)
|
|
34036
34061
|
} });
|
|
34037
34062
|
yield* renderer.emit(postListView, res);
|
|
34038
34063
|
})).pipe(withDescription("list posts"));
|
|
34039
|
-
const publish = make$13("publish", { slugOrId: text$
|
|
34064
|
+
const publish = make$13("publish", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
34040
34065
|
const resolver = yield* Resolver;
|
|
34041
34066
|
const api = yield* Api;
|
|
34042
34067
|
const renderer = yield* Renderer;
|
|
@@ -34047,7 +34072,7 @@ const publish = make$13("publish", { slugOrId: text$5({ name: "slugOrId" }) }, (
|
|
|
34047
34072
|
});
|
|
34048
34073
|
yield* renderer.emitSuccess(res);
|
|
34049
34074
|
})).pipe(withDescription("publish a post"));
|
|
34050
|
-
const unpublish = make$13("unpublish", { slugOrId: text$
|
|
34075
|
+
const unpublish = make$13("unpublish", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
34051
34076
|
const resolver = yield* Resolver;
|
|
34052
34077
|
const api = yield* Api;
|
|
34053
34078
|
const renderer = yield* Renderer;
|
|
@@ -34058,8 +34083,8 @@ const unpublish = make$13("unpublish", { slugOrId: text$5({ name: "slugOrId" })
|
|
|
34058
34083
|
});
|
|
34059
34084
|
yield* renderer.emitSuccess(res);
|
|
34060
34085
|
})).pipe(withDescription("unpublish a post"));
|
|
34061
|
-
const update$
|
|
34062
|
-
slugOrId: text$
|
|
34086
|
+
const update$2 = make$13("update", {
|
|
34087
|
+
slugOrId: text$6({ name: "slugOrId" }),
|
|
34063
34088
|
...postWriteOptions
|
|
34064
34089
|
}, ({ slugOrId, ...rest }) => gen(function* () {
|
|
34065
34090
|
const flags = toPostFlagInputs(rest);
|
|
@@ -34082,7 +34107,7 @@ const update$1 = make$13("update", {
|
|
|
34082
34107
|
})).pipe(withDescription("partially update a post"));
|
|
34083
34108
|
//#endregion
|
|
34084
34109
|
//#region src/cli/post/index.ts
|
|
34085
|
-
const help$
|
|
34110
|
+
const help$4 = registerCommandHelp({
|
|
34086
34111
|
name: "post",
|
|
34087
34112
|
description: "manage posts",
|
|
34088
34113
|
verbs: [
|
|
@@ -34145,13 +34170,13 @@ const help$3 = registerCommandHelp({
|
|
|
34145
34170
|
}
|
|
34146
34171
|
]
|
|
34147
34172
|
});
|
|
34148
|
-
const postCmd = make$13("post").pipe(withDescription(help$
|
|
34149
|
-
list$
|
|
34150
|
-
get$
|
|
34151
|
-
create$
|
|
34152
|
-
edit,
|
|
34153
|
-
update$
|
|
34154
|
-
del$
|
|
34173
|
+
const postCmd = make$13("post").pipe(withDescription(help$4.description), withSubcommands([
|
|
34174
|
+
list$3,
|
|
34175
|
+
get$3,
|
|
34176
|
+
create$2,
|
|
34177
|
+
edit$1,
|
|
34178
|
+
update$2,
|
|
34179
|
+
del$2,
|
|
34155
34180
|
publish,
|
|
34156
34181
|
unpublish
|
|
34157
34182
|
]));
|
|
@@ -34184,16 +34209,16 @@ registerCommandHelp({
|
|
|
34184
34209
|
}
|
|
34185
34210
|
]
|
|
34186
34211
|
});
|
|
34187
|
-
const fileArg = text$
|
|
34188
|
-
const themeOpt = choice("theme", ["light", "dark"]).pipe(optional$
|
|
34212
|
+
const fileArg = text$6({ name: "file" }).pipe(optional$5);
|
|
34213
|
+
const themeOpt = choice("theme", ["light", "dark"]).pipe(optional$3);
|
|
34189
34214
|
const variantOpt = choice("variant", [
|
|
34190
34215
|
"article",
|
|
34191
34216
|
"note",
|
|
34192
34217
|
"comment"
|
|
34193
|
-
]).pipe(optional$
|
|
34194
|
-
const saveOpt = text$
|
|
34195
|
-
const printOpt = boolean("print").pipe(optional$
|
|
34196
|
-
const openOpt = boolean("open").pipe(optional$
|
|
34218
|
+
]).pipe(optional$3);
|
|
34219
|
+
const saveOpt = text$4("save").pipe(optional$3);
|
|
34220
|
+
const printOpt = boolean("print").pipe(optional$3);
|
|
34221
|
+
const openOpt = boolean("open").pipe(optional$3);
|
|
34197
34222
|
const requireFrom$3 = createRequire(import.meta.url);
|
|
34198
34223
|
const resolveLitexmlBin = () => {
|
|
34199
34224
|
try {
|
|
@@ -34220,11 +34245,11 @@ const resolveLitexmlBin = () => {
|
|
|
34220
34245
|
const detectVariant = (body) => {
|
|
34221
34246
|
const trimmed = body.trimStart();
|
|
34222
34247
|
if (trimmed.startsWith("<mxpost")) return {
|
|
34223
|
-
contentXml: parseEnvelope(trimmed, "post").contentXml,
|
|
34248
|
+
contentXml: parseEnvelope$1(trimmed, "post").contentXml,
|
|
34224
34249
|
variant: "article"
|
|
34225
34250
|
};
|
|
34226
34251
|
if (trimmed.startsWith("<mxnote")) return {
|
|
34227
|
-
contentXml: parseEnvelope(trimmed, "note").contentXml,
|
|
34252
|
+
contentXml: parseEnvelope$1(trimmed, "note").contentXml,
|
|
34228
34253
|
variant: "note"
|
|
34229
34254
|
};
|
|
34230
34255
|
return {
|
|
@@ -34365,8 +34390,8 @@ const ls = make$13("ls", {}, () => gen(function* () {
|
|
|
34365
34390
|
yield* renderer.emit(profileListView, rows);
|
|
34366
34391
|
}));
|
|
34367
34392
|
const mark = make$13("mark", {
|
|
34368
|
-
name: text$
|
|
34369
|
-
production: boolean("production", { negationNames: ["no-production"] }).pipe(optional$
|
|
34393
|
+
name: text$6({ name: "name" }),
|
|
34394
|
+
production: boolean("production", { negationNames: ["no-production"] }).pipe(optional$3)
|
|
34370
34395
|
}, ({ name, production }) => gen(function* () {
|
|
34371
34396
|
const profile = yield* Profile;
|
|
34372
34397
|
const renderer = yield* Renderer;
|
|
@@ -34378,8 +34403,8 @@ const mark = make$13("mark", {
|
|
|
34378
34403
|
yield* renderer.emitInfo(`mxs: profile '${name}' marked with ${flag}`);
|
|
34379
34404
|
}));
|
|
34380
34405
|
const rm = make$13("rm", {
|
|
34381
|
-
name: text$
|
|
34382
|
-
force: boolean("force").pipe(optional$
|
|
34406
|
+
name: text$6({ name: "name" }),
|
|
34407
|
+
force: boolean("force").pipe(optional$3)
|
|
34383
34408
|
}, ({ name, force }) => gen(function* () {
|
|
34384
34409
|
const profile = yield* Profile;
|
|
34385
34410
|
const config = yield* Config;
|
|
@@ -34408,7 +34433,7 @@ const rm = make$13("rm", {
|
|
|
34408
34433
|
yield* renderer.emitInfo("mxs: cleared active profile pointer");
|
|
34409
34434
|
}
|
|
34410
34435
|
}));
|
|
34411
|
-
const show = make$13("show", { name: text$
|
|
34436
|
+
const show = make$13("show", { name: text$6({ name: "name" }).pipe(optional$5) }, ({ name }) => gen(function* () {
|
|
34412
34437
|
const profile = yield* Profile;
|
|
34413
34438
|
const config = yield* Config;
|
|
34414
34439
|
const renderer = yield* Renderer;
|
|
@@ -34437,7 +34462,7 @@ const show = make$13("show", { name: text$5({ name: "name" }).pipe(optional$4) }
|
|
|
34437
34462
|
authenticated: creds !== null
|
|
34438
34463
|
});
|
|
34439
34464
|
}));
|
|
34440
|
-
const use = make$13("use", { name: text$
|
|
34465
|
+
const use = make$13("use", { name: text$6({ name: "name" }) }, ({ name }) => gen(function* () {
|
|
34441
34466
|
const profile = yield* Profile;
|
|
34442
34467
|
const renderer = yield* Renderer;
|
|
34443
34468
|
yield* profile.use(name);
|
|
@@ -34445,7 +34470,7 @@ const use = make$13("use", { name: text$5({ name: "name" }) }, ({ name }) => gen
|
|
|
34445
34470
|
}));
|
|
34446
34471
|
//#endregion
|
|
34447
34472
|
//#region src/cli/profile/index.ts
|
|
34448
|
-
const help$
|
|
34473
|
+
const help$3 = registerCommandHelp({
|
|
34449
34474
|
name: "profile",
|
|
34450
34475
|
description: "manage mxs profiles",
|
|
34451
34476
|
verbs: [
|
|
@@ -34475,7 +34500,7 @@ const help$2 = registerCommandHelp({
|
|
|
34475
34500
|
}
|
|
34476
34501
|
]
|
|
34477
34502
|
});
|
|
34478
|
-
const profileCmd = make$13("profile").pipe(withDescription(help$
|
|
34503
|
+
const profileCmd = make$13("profile").pipe(withDescription(help$3.description), withSubcommands([
|
|
34479
34504
|
ls,
|
|
34480
34505
|
show,
|
|
34481
34506
|
use,
|
|
@@ -34483,6 +34508,379 @@ const profileCmd = make$13("profile").pipe(withDescription(help$2.description),
|
|
|
34483
34508
|
rm
|
|
34484
34509
|
]));
|
|
34485
34510
|
//#endregion
|
|
34511
|
+
//#region src/cli/project/_flags.ts
|
|
34512
|
+
const optional = (self) => optional$3(self);
|
|
34513
|
+
const unwrap$1 = (value) => getOrUndefined(value);
|
|
34514
|
+
const name$2 = optional(text$4("name"));
|
|
34515
|
+
const description$2 = optional(text$4("description"));
|
|
34516
|
+
const previewUrl = optional(text$4("preview-url"));
|
|
34517
|
+
const docUrl = optional(text$4("doc-url"));
|
|
34518
|
+
const projectUrl = optional(text$4("project-url"));
|
|
34519
|
+
const avatar = optional(text$4("avatar"));
|
|
34520
|
+
const images = optional(text$4("images"));
|
|
34521
|
+
const text = optional(text$4("text"));
|
|
34522
|
+
const file = optional(text$4("file"));
|
|
34523
|
+
const openFlag$1 = boolean("open").pipe(withDescription$3("After success, open the admin edit page in the default browser."));
|
|
34524
|
+
const silentFlag$1 = boolean("silent").pipe(withDescription$3("On success, emit a minimal `ok` instead of the full server response."));
|
|
34525
|
+
const parseCsv = (v) => {
|
|
34526
|
+
if (v === void 0) return void 0;
|
|
34527
|
+
return v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
34528
|
+
};
|
|
34529
|
+
const projectWriteOptions = {
|
|
34530
|
+
name: name$2,
|
|
34531
|
+
description: description$2,
|
|
34532
|
+
previewUrl,
|
|
34533
|
+
docUrl,
|
|
34534
|
+
projectUrl,
|
|
34535
|
+
avatar,
|
|
34536
|
+
images,
|
|
34537
|
+
text,
|
|
34538
|
+
file,
|
|
34539
|
+
open: openFlag$1,
|
|
34540
|
+
silent: silentFlag$1
|
|
34541
|
+
};
|
|
34542
|
+
const toProjectFlagInputs = (opts) => ({
|
|
34543
|
+
name: unwrap$1(opts.name),
|
|
34544
|
+
description: unwrap$1(opts.description),
|
|
34545
|
+
previewUrl: unwrap$1(opts.previewUrl),
|
|
34546
|
+
docUrl: unwrap$1(opts.docUrl),
|
|
34547
|
+
projectUrl: unwrap$1(opts.projectUrl),
|
|
34548
|
+
avatar: unwrap$1(opts.avatar),
|
|
34549
|
+
images: parseCsv(unwrap$1(opts.images)),
|
|
34550
|
+
text: unwrap$1(opts.text),
|
|
34551
|
+
file: unwrap$1(opts.file)
|
|
34552
|
+
});
|
|
34553
|
+
const PROJECT_KEYS = [
|
|
34554
|
+
"name",
|
|
34555
|
+
"description",
|
|
34556
|
+
"previewUrl",
|
|
34557
|
+
"docUrl",
|
|
34558
|
+
"projectUrl",
|
|
34559
|
+
"avatar",
|
|
34560
|
+
"images",
|
|
34561
|
+
"text"
|
|
34562
|
+
];
|
|
34563
|
+
const readJsonFile = (path) => gen(function* () {
|
|
34564
|
+
const raw = yield* (yield* FileSystem).readFileString(path).pipe(mapError((cause) => new ValidationFailed({
|
|
34565
|
+
message: `cannot read --file ${path}`,
|
|
34566
|
+
details: { cause: String(cause) }
|
|
34567
|
+
})));
|
|
34568
|
+
const parsed = yield* try_({
|
|
34569
|
+
try: () => JSON.parse(raw),
|
|
34570
|
+
catch: (err) => new ValidationFailed({
|
|
34571
|
+
message: `--file ${path} is not valid JSON`,
|
|
34572
|
+
details: { cause: String(err) }
|
|
34573
|
+
})
|
|
34574
|
+
});
|
|
34575
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return yield* fail$2(new ValidationFailed({ message: `--file ${path} must contain a JSON object` }));
|
|
34576
|
+
return parsed;
|
|
34577
|
+
});
|
|
34578
|
+
const pickProjectFields = (raw) => {
|
|
34579
|
+
const out = {};
|
|
34580
|
+
for (const key of PROJECT_KEYS) if (key in raw) out[key] = raw[key];
|
|
34581
|
+
return out;
|
|
34582
|
+
};
|
|
34583
|
+
const buildProjectPayload = (flags) => gen(function* () {
|
|
34584
|
+
const payload = { ...flags.file ? pickProjectFields(yield* readJsonFile(flags.file)) : {} };
|
|
34585
|
+
if (flags.name !== void 0) payload.name = flags.name;
|
|
34586
|
+
if (flags.description !== void 0) payload.description = flags.description;
|
|
34587
|
+
if (flags.previewUrl !== void 0) payload.previewUrl = flags.previewUrl;
|
|
34588
|
+
if (flags.docUrl !== void 0) payload.docUrl = flags.docUrl;
|
|
34589
|
+
if (flags.projectUrl !== void 0) payload.projectUrl = flags.projectUrl;
|
|
34590
|
+
if (flags.avatar !== void 0) payload.avatar = flags.avatar;
|
|
34591
|
+
if (flags.images !== void 0) payload.images = flags.images;
|
|
34592
|
+
if (flags.text !== void 0) payload.text = flags.text;
|
|
34593
|
+
return payload;
|
|
34594
|
+
});
|
|
34595
|
+
const extractId = (res) => {
|
|
34596
|
+
if (!res || typeof res !== "object") return void 0;
|
|
34597
|
+
const r = res;
|
|
34598
|
+
if (typeof r.id === "string") return r.id;
|
|
34599
|
+
if (typeof r._id === "string") return r._id;
|
|
34600
|
+
};
|
|
34601
|
+
const editableFieldsOf = (raw) => {
|
|
34602
|
+
const out = {};
|
|
34603
|
+
for (const key of PROJECT_KEYS) out[key] = key in raw ? raw[key] ?? null : null;
|
|
34604
|
+
return out;
|
|
34605
|
+
};
|
|
34606
|
+
//#endregion
|
|
34607
|
+
//#region src/cli/project/create.ts
|
|
34608
|
+
const create$1 = make$13("create", projectWriteOptions, (opts) => gen(function* () {
|
|
34609
|
+
const payload = yield* buildProjectPayload(toProjectFlagInputs(opts));
|
|
34610
|
+
const api = yield* Api;
|
|
34611
|
+
const renderer = yield* Renderer;
|
|
34612
|
+
const resolver = yield* Resolver;
|
|
34613
|
+
const res = yield* api.request("/projects", {
|
|
34614
|
+
method: "POST",
|
|
34615
|
+
body: payload
|
|
34616
|
+
});
|
|
34617
|
+
yield* resolver.invalidate("project");
|
|
34618
|
+
yield* renderer.emitSuccess(opts.silent ? { ok: true } : res);
|
|
34619
|
+
if (opts.open) {
|
|
34620
|
+
const id = extractId(res);
|
|
34621
|
+
if (id) yield* openAdminEdit("projects", id);
|
|
34622
|
+
}
|
|
34623
|
+
})).pipe(withDescription("create a project"));
|
|
34624
|
+
const del$1 = make$13("delete", {
|
|
34625
|
+
nameOrId: text$6({ name: "nameOrId" }),
|
|
34626
|
+
force: boolean("force").pipe(withDescription$3("skip the non-TTY guard"))
|
|
34627
|
+
}, ({ nameOrId, force }) => gen(function* () {
|
|
34628
|
+
if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
|
|
34629
|
+
const resolver = yield* Resolver;
|
|
34630
|
+
const api = yield* Api;
|
|
34631
|
+
const renderer = yield* Renderer;
|
|
34632
|
+
const id = yield* resolver.resolveProjectId(nameOrId);
|
|
34633
|
+
yield* api.request(`/projects/${id}`, { method: "DELETE" });
|
|
34634
|
+
yield* resolver.invalidate("project");
|
|
34635
|
+
yield* renderer.emitSuccess({ deleted: id });
|
|
34636
|
+
})).pipe(withDescription("delete a project"));
|
|
34637
|
+
//#endregion
|
|
34638
|
+
//#region src/cli/project/edit.ts
|
|
34639
|
+
const nameOrId$3 = text$6({ name: "nameOrId" });
|
|
34640
|
+
const openFlag = boolean("open").pipe(withDescription$3("After success, open the admin edit page in the default browser."));
|
|
34641
|
+
const silentFlag = boolean("silent").pipe(withDescription$3("On success, emit a minimal `ok` instead of the full server response."));
|
|
34642
|
+
const unwrapDoc = (raw) => {
|
|
34643
|
+
if (!raw || typeof raw !== "object") return {};
|
|
34644
|
+
const r = raw;
|
|
34645
|
+
if (r.data && typeof r.data === "object" && !Array.isArray(r.data)) return r.data;
|
|
34646
|
+
return r;
|
|
34647
|
+
};
|
|
34648
|
+
const formatJson = (value) => `${JSON.stringify(value, null, 2)}\n`;
|
|
34649
|
+
const parseEnvelope = (raw) => {
|
|
34650
|
+
const parsed = JSON.parse(raw);
|
|
34651
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("expected a JSON object");
|
|
34652
|
+
return parsed;
|
|
34653
|
+
};
|
|
34654
|
+
const edit = make$13("edit", {
|
|
34655
|
+
nameOrId: nameOrId$3,
|
|
34656
|
+
open: openFlag,
|
|
34657
|
+
silent: silentFlag
|
|
34658
|
+
}, ({ nameOrId, open, silent }) => gen(function* () {
|
|
34659
|
+
const api = yield* Api;
|
|
34660
|
+
const editor = yield* Editor;
|
|
34661
|
+
const renderer = yield* Renderer;
|
|
34662
|
+
const resolver = yield* Resolver;
|
|
34663
|
+
const id = yield* resolver.resolveProjectId(nameOrId);
|
|
34664
|
+
const initial = formatJson(editableFieldsOf(unwrapDoc(yield* api.request(`/projects/${id}`))));
|
|
34665
|
+
const next = yield* editor.openEditor({
|
|
34666
|
+
filename: `project-${id}.json`,
|
|
34667
|
+
initialContent: initial
|
|
34668
|
+
});
|
|
34669
|
+
if (next.trim() === initial.trim()) {
|
|
34670
|
+
yield* renderer.emitInfo("no changes");
|
|
34671
|
+
return;
|
|
34672
|
+
}
|
|
34673
|
+
const parsed = yield* try_({
|
|
34674
|
+
try: () => parseEnvelope(next),
|
|
34675
|
+
catch: (err) => new ValidationJson({
|
|
34676
|
+
message: err instanceof Error ? err.message : String(err),
|
|
34677
|
+
cause: err
|
|
34678
|
+
})
|
|
34679
|
+
});
|
|
34680
|
+
const res = yield* api.request(`/projects/${id}`, {
|
|
34681
|
+
method: "PATCH",
|
|
34682
|
+
body: parsed
|
|
34683
|
+
});
|
|
34684
|
+
yield* resolver.invalidate("project");
|
|
34685
|
+
yield* renderer.emitSuccess(silent ? { ok: true } : res);
|
|
34686
|
+
if (open) yield* openAdminEdit("projects", id);
|
|
34687
|
+
})).pipe(withDescription("edit a project via $EDITOR (JSON envelope)"));
|
|
34688
|
+
const get$2 = make$13("get", { nameOrId: text$6({ name: "nameOrId" }) }, ({ nameOrId }) => gen(function* () {
|
|
34689
|
+
const api = yield* Api;
|
|
34690
|
+
const renderer = yield* Renderer;
|
|
34691
|
+
const id = yield* (yield* Resolver).resolveProjectId(nameOrId);
|
|
34692
|
+
const res = yield* api.request(`/projects/${id}`);
|
|
34693
|
+
yield* renderer.emitSuccess(res);
|
|
34694
|
+
})).pipe(withDescription("get a project by name or id"));
|
|
34695
|
+
//#endregion
|
|
34696
|
+
//#region src/cli/project/view.ts
|
|
34697
|
+
const normalize = (data) => asRecord(unwrapDocument(data));
|
|
34698
|
+
const collectFields = (doc) => {
|
|
34699
|
+
const images = first(doc, "images");
|
|
34700
|
+
const imagesField = Array.isArray(images) ? images.length === 0 ? void 0 : images.length <= 3 ? images.join(", ") : `${images.slice(0, 3).join(", ")} (+${images.length - 3} more)` : void 0;
|
|
34701
|
+
return [
|
|
34702
|
+
["id", first(doc, "id")],
|
|
34703
|
+
["name", first(doc, "name")],
|
|
34704
|
+
["preview_url", first(doc, "preview_url", "previewUrl")],
|
|
34705
|
+
["project_url", first(doc, "project_url", "projectUrl")],
|
|
34706
|
+
["doc_url", first(doc, "doc_url", "docUrl")],
|
|
34707
|
+
["avatar", first(doc, "avatar")],
|
|
34708
|
+
["images", imagesField],
|
|
34709
|
+
["created_at", first(doc, "created_at", "createdAt")]
|
|
34710
|
+
].filter(([, value]) => value !== void 0 && value !== null && value !== "");
|
|
34711
|
+
};
|
|
34712
|
+
const pickDescription = (doc) => {
|
|
34713
|
+
return firstString(doc, "description") || void 0;
|
|
34714
|
+
};
|
|
34715
|
+
const pickText = (doc) => {
|
|
34716
|
+
const text = firstString(doc, "text");
|
|
34717
|
+
return text ? {
|
|
34718
|
+
body: text,
|
|
34719
|
+
format: "text"
|
|
34720
|
+
} : void 0;
|
|
34721
|
+
};
|
|
34722
|
+
const projectView = {
|
|
34723
|
+
kind: "project",
|
|
34724
|
+
modes: new Set(["readable", "llm"]),
|
|
34725
|
+
readable: (data, ctx) => {
|
|
34726
|
+
const doc = normalize(data);
|
|
34727
|
+
const body = pickText(doc);
|
|
34728
|
+
return renderMetadataBlock({
|
|
34729
|
+
title: firstString(doc, "name") || void 0,
|
|
34730
|
+
kind: "project",
|
|
34731
|
+
fields: collectFields(doc),
|
|
34732
|
+
summary: pickDescription(doc),
|
|
34733
|
+
body: body?.body,
|
|
34734
|
+
bodyFormat: body?.format
|
|
34735
|
+
}, ctx);
|
|
34736
|
+
},
|
|
34737
|
+
llm: (data) => {
|
|
34738
|
+
const doc = normalize(data);
|
|
34739
|
+
const body = pickText(doc);
|
|
34740
|
+
const fm = frontmatter({
|
|
34741
|
+
title: firstString(doc, "name") || void 0,
|
|
34742
|
+
fields: collectFields(doc),
|
|
34743
|
+
summary: pickDescription(doc)
|
|
34744
|
+
});
|
|
34745
|
+
return body?.body ? `${fm}\n\n${body.body}` : fm;
|
|
34746
|
+
}
|
|
34747
|
+
};
|
|
34748
|
+
const collectListItemFields = (doc) => [
|
|
34749
|
+
["id", first(doc, "id")],
|
|
34750
|
+
["name", first(doc, "name")],
|
|
34751
|
+
["description", first(doc, "description")],
|
|
34752
|
+
["created_at", first(doc, "created_at", "createdAt")]
|
|
34753
|
+
];
|
|
34754
|
+
const renderProjectListReadable = (data) => {
|
|
34755
|
+
const payload = asRecord(data);
|
|
34756
|
+
const rows = Array.isArray(payload.data) ? payload.data : Array.isArray(data) ? data : [];
|
|
34757
|
+
const pagination = asRecord(first(asRecord(first(payload, "meta")), "pagination"));
|
|
34758
|
+
const lines = ["projects", `count: ${rows.length}`];
|
|
34759
|
+
const page = first(pagination, "page", "currentPage");
|
|
34760
|
+
const size = first(pagination, "size", "pageSize");
|
|
34761
|
+
const total = first(pagination, "total", "totalCount", "total_count");
|
|
34762
|
+
if (page !== void 0) lines.push(`page: ${formatScalar(page)}`);
|
|
34763
|
+
if (size !== void 0) lines.push(`size: ${formatScalar(size)}`);
|
|
34764
|
+
if (total !== void 0) lines.push(`total: ${formatScalar(total)}`);
|
|
34765
|
+
rows.forEach((row, index) => {
|
|
34766
|
+
const doc = asRecord(row);
|
|
34767
|
+
lines.push("", `project ${index + 1}:`);
|
|
34768
|
+
for (const [key, value] of collectListItemFields(doc)) {
|
|
34769
|
+
if (value === void 0 || value === null || value === "") continue;
|
|
34770
|
+
const rendered = tryFormatTimestamp(value, { style: "rel" }) ?? formatScalar(value);
|
|
34771
|
+
lines.push(`${key}: ${rendered}`);
|
|
34772
|
+
}
|
|
34773
|
+
});
|
|
34774
|
+
return lines.join("\n");
|
|
34775
|
+
};
|
|
34776
|
+
const projectListView = {
|
|
34777
|
+
kind: "project-list",
|
|
34778
|
+
modes: new Set(["readable", "llm"]),
|
|
34779
|
+
readable: (data) => renderProjectListReadable(data)
|
|
34780
|
+
};
|
|
34781
|
+
//#endregion
|
|
34782
|
+
//#region src/cli/project/list.ts
|
|
34783
|
+
const page = integer("page").pipe(optional$3);
|
|
34784
|
+
const size = integer("size").pipe(optional$3);
|
|
34785
|
+
const unwrap = (value) => getOrUndefined(value);
|
|
34786
|
+
const list$2 = make$13("list", {
|
|
34787
|
+
page,
|
|
34788
|
+
size
|
|
34789
|
+
}, ({ page, size }) => gen(function* () {
|
|
34790
|
+
const api = yield* Api;
|
|
34791
|
+
const renderer = yield* Renderer;
|
|
34792
|
+
const res = yield* api.request("/projects", { query: {
|
|
34793
|
+
page: unwrap(page),
|
|
34794
|
+
size: unwrap(size)
|
|
34795
|
+
} });
|
|
34796
|
+
yield* renderer.emit(projectListView, res);
|
|
34797
|
+
})).pipe(withDescription("list projects"));
|
|
34798
|
+
const update$1 = make$13("update", {
|
|
34799
|
+
nameOrId: text$6({ name: "nameOrId" }),
|
|
34800
|
+
...projectWriteOptions
|
|
34801
|
+
}, ({ nameOrId, ...rest }) => gen(function* () {
|
|
34802
|
+
const payload = yield* buildProjectPayload(toProjectFlagInputs(rest));
|
|
34803
|
+
const resolver = yield* Resolver;
|
|
34804
|
+
const id = yield* resolver.resolveProjectId(nameOrId);
|
|
34805
|
+
const api = yield* Api;
|
|
34806
|
+
const renderer = yield* Renderer;
|
|
34807
|
+
const res = yield* api.request(`/projects/${id}`, {
|
|
34808
|
+
method: "PATCH",
|
|
34809
|
+
body: payload
|
|
34810
|
+
});
|
|
34811
|
+
yield* resolver.invalidate("project");
|
|
34812
|
+
yield* renderer.emitSuccess(rest.silent ? { ok: true } : res);
|
|
34813
|
+
if (rest.open) yield* openAdminEdit("projects", id);
|
|
34814
|
+
})).pipe(withDescription("partially update a project"));
|
|
34815
|
+
const viewCmd = make$13("view", { nameOrId: text$6({ name: "nameOrId" }) }, ({ nameOrId }) => gen(function* () {
|
|
34816
|
+
const api = yield* Api;
|
|
34817
|
+
const renderer = yield* Renderer;
|
|
34818
|
+
const id = yield* (yield* Resolver).resolveProjectId(nameOrId);
|
|
34819
|
+
const res = yield* api.request(`/projects/${id}`);
|
|
34820
|
+
yield* renderer.emit(projectView, res);
|
|
34821
|
+
})).pipe(withDescription("show a project (rendered)"));
|
|
34822
|
+
//#endregion
|
|
34823
|
+
//#region src/cli/project/index.ts
|
|
34824
|
+
const help$2 = registerCommandHelp({
|
|
34825
|
+
name: "project",
|
|
34826
|
+
description: "manage portfolio projects",
|
|
34827
|
+
verbs: [
|
|
34828
|
+
{
|
|
34829
|
+
name: "list",
|
|
34830
|
+
args: ["[--page <n>]", "[--size <n>]"],
|
|
34831
|
+
description: "list projects"
|
|
34832
|
+
},
|
|
34833
|
+
{
|
|
34834
|
+
name: "get",
|
|
34835
|
+
args: ["<nameOrId>"],
|
|
34836
|
+
description: "show a single project (raw)"
|
|
34837
|
+
},
|
|
34838
|
+
{
|
|
34839
|
+
name: "view",
|
|
34840
|
+
args: ["<nameOrId>"],
|
|
34841
|
+
description: "show a single project (rendered)"
|
|
34842
|
+
},
|
|
34843
|
+
{
|
|
34844
|
+
name: "create",
|
|
34845
|
+
args: [
|
|
34846
|
+
"--name <s>",
|
|
34847
|
+
"--description <s>",
|
|
34848
|
+
"[--file <path>]",
|
|
34849
|
+
"..."
|
|
34850
|
+
],
|
|
34851
|
+
description: "create a project"
|
|
34852
|
+
},
|
|
34853
|
+
{
|
|
34854
|
+
name: "edit",
|
|
34855
|
+
args: ["<nameOrId>"],
|
|
34856
|
+
description: "edit a project via $EDITOR (JSON envelope)"
|
|
34857
|
+
},
|
|
34858
|
+
{
|
|
34859
|
+
name: "update",
|
|
34860
|
+
args: [
|
|
34861
|
+
"<nameOrId>",
|
|
34862
|
+
"[--name ...]",
|
|
34863
|
+
"..."
|
|
34864
|
+
],
|
|
34865
|
+
description: "partially update a project"
|
|
34866
|
+
},
|
|
34867
|
+
{
|
|
34868
|
+
name: "delete",
|
|
34869
|
+
args: ["<nameOrId>", "[--force]"],
|
|
34870
|
+
description: "delete a project"
|
|
34871
|
+
}
|
|
34872
|
+
]
|
|
34873
|
+
});
|
|
34874
|
+
const projectCmd = make$13("project").pipe(withDescription(help$2.description), withSubcommands([
|
|
34875
|
+
list$2,
|
|
34876
|
+
get$2,
|
|
34877
|
+
viewCmd,
|
|
34878
|
+
create$1,
|
|
34879
|
+
edit,
|
|
34880
|
+
update$1,
|
|
34881
|
+
del$1
|
|
34882
|
+
]));
|
|
34883
|
+
//#endregion
|
|
34486
34884
|
//#region ../../node_modules/.pnpm/minisearch@7.2.0/node_modules/minisearch/dist/es/index.js
|
|
34487
34885
|
/** @ignore */
|
|
34488
34886
|
const ENTRIES = "ENTRIES";
|
|
@@ -36527,14 +36925,14 @@ const make$2 = gen(function* () {
|
|
|
36527
36925
|
const cache = yield* make$23(null);
|
|
36528
36926
|
const indexCache = yield* make$23(null);
|
|
36529
36927
|
const load = gen(function* () {
|
|
36530
|
-
const cached = yield* get$
|
|
36928
|
+
const cached = yield* get$11(cache);
|
|
36531
36929
|
if (cached) return cached;
|
|
36532
36930
|
const chapters = yield* buildRegistry(fs, path, cliDir, haklexDir);
|
|
36533
36931
|
yield* set$3(cache, chapters);
|
|
36534
36932
|
return chapters;
|
|
36535
36933
|
});
|
|
36536
36934
|
const loadIndex = gen(function* () {
|
|
36537
|
-
const cached = yield* get$
|
|
36935
|
+
const cached = yield* get$11(indexCache);
|
|
36538
36936
|
if (cached) return cached;
|
|
36539
36937
|
const mini = buildIndex(yield* load);
|
|
36540
36938
|
yield* set$3(indexCache, mini);
|
|
@@ -36686,7 +37084,7 @@ const all = make$13("all", {}, () => gen(function* () {
|
|
|
36686
37084
|
const chapters = yield* skill.all;
|
|
36687
37085
|
yield* renderer.emit(skillAllView, chapters);
|
|
36688
37086
|
}));
|
|
36689
|
-
const get$1 = make$13("get", { slug: text$
|
|
37087
|
+
const get$1 = make$13("get", { slug: text$6({ name: "slug" }) }, ({ slug }) => gen(function* () {
|
|
36690
37088
|
const skill = yield* Skill;
|
|
36691
37089
|
const renderer = yield* Renderer;
|
|
36692
37090
|
const chapter = yield* skill.get(slug);
|
|
@@ -36700,7 +37098,7 @@ const list$1 = make$13("list", {}, () => gen(function* () {
|
|
|
36700
37098
|
const chapters = yield* skill.list;
|
|
36701
37099
|
yield* renderer.emit(skillListView, chapters);
|
|
36702
37100
|
}));
|
|
36703
|
-
const search = make$13("search", { keyword: text$
|
|
37101
|
+
const search = make$13("search", { keyword: text$6({ name: "keyword" }) }, ({ keyword }) => gen(function* () {
|
|
36704
37102
|
const skill = yield* Skill;
|
|
36705
37103
|
const renderer = yield* Renderer;
|
|
36706
37104
|
const hits = yield* skill.search(keyword);
|
|
@@ -36744,10 +37142,10 @@ const skillCmd = make$13("skill", {}, () => gen(function* () {
|
|
|
36744
37142
|
search
|
|
36745
37143
|
]));
|
|
36746
37144
|
const create = make$13("create", {
|
|
36747
|
-
name: text$
|
|
36748
|
-
slug: text$
|
|
36749
|
-
description: text$
|
|
36750
|
-
icon: text$
|
|
37145
|
+
name: text$4("name"),
|
|
37146
|
+
slug: text$4("slug"),
|
|
37147
|
+
description: text$4("description").pipe(optional$3),
|
|
37148
|
+
icon: text$4("icon").pipe(optional$3)
|
|
36751
37149
|
}, ({ name, slug, description, icon }) => gen(function* () {
|
|
36752
37150
|
const body = {
|
|
36753
37151
|
name,
|
|
@@ -36767,7 +37165,7 @@ const create = make$13("create", {
|
|
|
36767
37165
|
}));
|
|
36768
37166
|
//#endregion
|
|
36769
37167
|
//#region src/cli/topic/delete.ts
|
|
36770
|
-
const slugOrId$2 = text$
|
|
37168
|
+
const slugOrId$2 = text$6({ name: "slugOrId" });
|
|
36771
37169
|
const force$1 = boolean("force");
|
|
36772
37170
|
const resolveTopicId$1 = (api, ref) => gen(function* () {
|
|
36773
37171
|
if (isSnowflakeId(ref)) return ref;
|
|
@@ -36791,7 +37189,7 @@ const del = make$13("delete", {
|
|
|
36791
37189
|
yield* api.request(`/topics/${id}`, { method: "DELETE" });
|
|
36792
37190
|
yield* renderer.emitSuccess({ deleted: id });
|
|
36793
37191
|
}));
|
|
36794
|
-
const get = make$13("get", { slugOrId: text$
|
|
37192
|
+
const get = make$13("get", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
36795
37193
|
const api = yield* Api;
|
|
36796
37194
|
const renderer = yield* Renderer;
|
|
36797
37195
|
const path = isSnowflakeId(slugOrId) ? `/topics/${slugOrId}` : `/topics/slug/${encodeURIComponent(slugOrId)}`;
|
|
@@ -36808,11 +37206,11 @@ const list = make$13("list", {}, () => gen(function* () {
|
|
|
36808
37206
|
}));
|
|
36809
37207
|
//#endregion
|
|
36810
37208
|
//#region src/cli/topic/update.ts
|
|
36811
|
-
const slugOrId = text$
|
|
36812
|
-
const name = text$
|
|
36813
|
-
const slug = text$
|
|
36814
|
-
const description = text$
|
|
36815
|
-
const icon = text$
|
|
37209
|
+
const slugOrId = text$6({ name: "slugOrId" });
|
|
37210
|
+
const name = text$4("name").pipe(optional$3);
|
|
37211
|
+
const slug = text$4("slug").pipe(optional$3);
|
|
37212
|
+
const description = text$4("description").pipe(optional$3);
|
|
37213
|
+
const icon = text$4("icon").pipe(optional$3);
|
|
36816
37214
|
const resolveTopicId = (api, ref) => gen(function* () {
|
|
36817
37215
|
if (isSnowflakeId(ref)) return ref;
|
|
36818
37216
|
const res = yield* api.request(`/topics/slug/${encodeURIComponent(ref)}`).pipe(catchAll(() => succeed$1(null)));
|
|
@@ -38790,16 +39188,16 @@ const resolveCliVersion$1 = () => {
|
|
|
38790
39188
|
return "0.0.0-unknown";
|
|
38791
39189
|
};
|
|
38792
39190
|
const CLI_VERSION$1 = resolveCliVersion$1();
|
|
38793
|
-
const check = boolean("check").pipe(optional$
|
|
38794
|
-
const prerelease = boolean("prerelease").pipe(optional$
|
|
39191
|
+
const check = boolean("check").pipe(optional$3);
|
|
39192
|
+
const prerelease = boolean("prerelease").pipe(optional$3);
|
|
38795
39193
|
const pm = choice("pm", [
|
|
38796
39194
|
"npm",
|
|
38797
39195
|
"pnpm",
|
|
38798
39196
|
"yarn",
|
|
38799
39197
|
"bun"
|
|
38800
|
-
]).pipe(optional$
|
|
38801
|
-
const force = boolean("force").pipe(optional$
|
|
38802
|
-
const yes = boolean("yes").pipe(optional$
|
|
39198
|
+
]).pipe(optional$3);
|
|
39199
|
+
const force = boolean("force").pipe(optional$3);
|
|
39200
|
+
const yes = boolean("yes").pipe(optional$3);
|
|
38803
39201
|
const optBool = (opt) => getOrUndefined(opt);
|
|
38804
39202
|
const updateCmd = make$13("update", {
|
|
38805
39203
|
check,
|
|
@@ -38884,6 +39282,7 @@ const GROUP_NAMES = [
|
|
|
38884
39282
|
"post",
|
|
38885
39283
|
"note",
|
|
38886
39284
|
"page",
|
|
39285
|
+
"project",
|
|
38887
39286
|
"category",
|
|
38888
39287
|
"topic",
|
|
38889
39288
|
"comment",
|
|
@@ -39369,6 +39768,7 @@ const rootCmd = make$13("mxs", {}, () => flatMap$1(Renderer, (r) => r.emitInfo("
|
|
|
39369
39768
|
postCmd,
|
|
39370
39769
|
noteCmd,
|
|
39371
39770
|
pageCmd,
|
|
39771
|
+
projectCmd,
|
|
39372
39772
|
categoryCmd,
|
|
39373
39773
|
topicCmd,
|
|
39374
39774
|
commentCmd,
|