@mx-space/cli 0.7.4 → 0.7.6
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 +17 -0
- package/dist/bin/mxs.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{mxs-CS9xZ2tO.mjs → mxs-BjEC9s9q.mjs} +321 -285
- package/package.json +3 -3
|
@@ -24,7 +24,7 @@ import * as ChildProcess from "node:child_process";
|
|
|
24
24
|
import childProcess, { execFile, spawn } from "node:child_process";
|
|
25
25
|
import * as readline from "node:readline";
|
|
26
26
|
import E from "node:readline";
|
|
27
|
-
import
|
|
27
|
+
import V, { stdin, stdout } from "node:process";
|
|
28
28
|
import "node:tty";
|
|
29
29
|
//#region ../../node_modules/.pnpm/@effect+platform@0.96.1_effect@3.21.2/node_modules/@effect/platform/dist/esm/Error.js
|
|
30
30
|
/**
|
|
@@ -735,7 +735,7 @@ const char$2 = (char) => {
|
|
|
735
735
|
return op;
|
|
736
736
|
};
|
|
737
737
|
/** @internal */
|
|
738
|
-
const text$
|
|
738
|
+
const text$11 = (text) => {
|
|
739
739
|
const op = Object.create(proto$9);
|
|
740
740
|
op._tag = "Text";
|
|
741
741
|
op.text = text;
|
|
@@ -920,7 +920,7 @@ const annotate$1 = /* @__PURE__ */ dual(2, (self, annotation) => {
|
|
|
920
920
|
const spaces = (n) => {
|
|
921
921
|
if (n <= 0) return empty$10;
|
|
922
922
|
if (n === 1) return char$2(" ");
|
|
923
|
-
return text$
|
|
923
|
+
return text$11(textSpaces(n));
|
|
924
924
|
};
|
|
925
925
|
/** @internal */
|
|
926
926
|
const textSpaces = (n) => {
|
|
@@ -987,7 +987,7 @@ const char$1 = /* @__PURE__ */ dual(2, (self, char) => {
|
|
|
987
987
|
return op;
|
|
988
988
|
});
|
|
989
989
|
/** @internal */
|
|
990
|
-
const text$
|
|
990
|
+
const text$10 = /* @__PURE__ */ dual(2, (self, text) => {
|
|
991
991
|
const op = Object.create(proto$8);
|
|
992
992
|
op._tag = "TextStream";
|
|
993
993
|
op.text = text;
|
|
@@ -1095,7 +1095,7 @@ const wadlerLeijenSafe = (self, nestingLevel, currentColumn, fits, options) => {
|
|
|
1095
1095
|
case "Char": return char$1(yield* best(self.pipeline, nl, cc + 1), self.document.char);
|
|
1096
1096
|
case "Text": {
|
|
1097
1097
|
const length = self.document.text.length;
|
|
1098
|
-
return text$
|
|
1098
|
+
return text$10(yield* best(self.pipeline, nl, cc + length), self.document.text);
|
|
1099
1099
|
}
|
|
1100
1100
|
case "Line": {
|
|
1101
1101
|
const stream = yield* best(self.pipeline, self.indent, self.indent);
|
|
@@ -1149,7 +1149,7 @@ const compactSafe = (docs, i) => gen(function* () {
|
|
|
1149
1149
|
case "Fail": return failed;
|
|
1150
1150
|
case "Empty": return yield* compactSafe(tail, i);
|
|
1151
1151
|
case "Char": return char$1(yield* compactSafe(tail, i + 1), head.char);
|
|
1152
|
-
case "Text": return text$
|
|
1152
|
+
case "Text": return text$10(yield* compactSafe(tail, i + head.text.length), head.text);
|
|
1153
1153
|
case "Line": return line(yield* compactSafe(tail, 0), 0);
|
|
1154
1154
|
case "FlatAlt": return yield* compactSafe(cons$1(head.left, tail), i);
|
|
1155
1155
|
case "Cat": return yield* compactSafe(cons$1(head.left, cons$1(head.right, tail)), i);
|
|
@@ -1308,7 +1308,7 @@ const char = char$2;
|
|
|
1308
1308
|
* @since 1.0.0
|
|
1309
1309
|
* @category constructors
|
|
1310
1310
|
*/
|
|
1311
|
-
const text$
|
|
1311
|
+
const text$9 = text$11;
|
|
1312
1312
|
/**
|
|
1313
1313
|
* The `empty` document behaves like a document containing the empty string
|
|
1314
1314
|
* (`""`), so it has a height of `1`.
|
|
@@ -2021,10 +2021,10 @@ const optimizeSafe = (self, depth) => {
|
|
|
2021
2021
|
case "Cat":
|
|
2022
2022
|
if (isEmpty$4(self.left)) return yield* optimize(self.right);
|
|
2023
2023
|
if (isEmpty$4(self.right)) return yield* optimize(self.left);
|
|
2024
|
-
if (isChar(self.left) && isChar(self.right)) return text$
|
|
2025
|
-
if (isText$2(self.left) && isChar(self.right)) return text$
|
|
2026
|
-
if (isChar(self.left) && isText$2(self.right)) return text$
|
|
2027
|
-
if (isText$2(self.left) && isText$2(self.right)) return text$
|
|
2024
|
+
if (isChar(self.left) && isChar(self.right)) return text$11(self.left.char + self.right.char);
|
|
2025
|
+
if (isText$2(self.left) && isChar(self.right)) return text$11(self.left.text + self.right.char);
|
|
2026
|
+
if (isChar(self.left) && isText$2(self.right)) return text$11(self.left.char + self.right.text);
|
|
2027
|
+
if (isText$2(self.left) && isText$2(self.right)) return text$11(self.left.text + self.right.text);
|
|
2028
2028
|
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));
|
|
2029
2029
|
if (isCat(self.left) && isChar(self.left.right) || isCat(self.left) && isText$2(self.left.right)) {
|
|
2030
2030
|
const inner = yield* optimize(cat$1(self.left.right, self.right));
|
|
@@ -2124,14 +2124,14 @@ const white = white$3;
|
|
|
2124
2124
|
//#endregion
|
|
2125
2125
|
//#region ../../node_modules/.pnpm/@effect+cli@0.75.1_@effect+platform@0.96.1_effect@3.21.2__@effect+printer-ansi@0.49.0_@_d2b48786a958a46d59c00d71830aad4d/node_modules/@effect/cli/dist/esm/internal/helpDoc/span.js
|
|
2126
2126
|
/** @internal */
|
|
2127
|
-
const text$
|
|
2127
|
+
const text$8 = (value) => ({
|
|
2128
2128
|
_tag: "Text",
|
|
2129
2129
|
value
|
|
2130
2130
|
});
|
|
2131
2131
|
/** @internal */
|
|
2132
|
-
const empty$7 = /* @__PURE__ */ text$
|
|
2132
|
+
const empty$7 = /* @__PURE__ */ text$8("");
|
|
2133
2133
|
/** @internal */
|
|
2134
|
-
const space = /* @__PURE__ */ text$
|
|
2134
|
+
const space = /* @__PURE__ */ text$8(" ");
|
|
2135
2135
|
/** @internal */
|
|
2136
2136
|
const code = (value) => highlight(value, white);
|
|
2137
2137
|
/** @internal */
|
|
@@ -2139,18 +2139,18 @@ const error = (value) => highlight(value, red);
|
|
|
2139
2139
|
/** @internal */
|
|
2140
2140
|
const highlight = (value, color) => ({
|
|
2141
2141
|
_tag: "Highlight",
|
|
2142
|
-
value: typeof value === "string" ? text$
|
|
2142
|
+
value: typeof value === "string" ? text$8(value) : value,
|
|
2143
2143
|
color
|
|
2144
2144
|
});
|
|
2145
2145
|
/** @internal */
|
|
2146
2146
|
const strong = (value) => ({
|
|
2147
2147
|
_tag: "Strong",
|
|
2148
|
-
value: typeof value === "string" ? text$
|
|
2148
|
+
value: typeof value === "string" ? text$8(value) : value
|
|
2149
2149
|
});
|
|
2150
2150
|
/** @internal */
|
|
2151
2151
|
const weak = (value) => ({
|
|
2152
2152
|
_tag: "Weak",
|
|
2153
|
-
value: typeof value === "string" ? text$
|
|
2153
|
+
value: typeof value === "string" ? text$8(value) : value
|
|
2154
2154
|
});
|
|
2155
2155
|
/** @internal */
|
|
2156
2156
|
const isText$1 = (self) => self._tag === "Text";
|
|
@@ -2195,8 +2195,8 @@ const toAnsiDoc$1 = (self) => {
|
|
|
2195
2195
|
case "Highlight": return annotate(toAnsiDoc$1(self.value), color$1(self.color));
|
|
2196
2196
|
case "Sequence": return cat(toAnsiDoc$1(self.left), toAnsiDoc$1(self.right));
|
|
2197
2197
|
case "Strong": return annotate(toAnsiDoc$1(self.value), bold$1);
|
|
2198
|
-
case "Text": return text$
|
|
2199
|
-
case "URI": return annotate(text$
|
|
2198
|
+
case "Text": return text$9(self.value);
|
|
2199
|
+
case "URI": return annotate(text$9(self.value), underlined);
|
|
2200
2200
|
case "Weak": return annotate(toAnsiDoc$1(self.value), black);
|
|
2201
2201
|
}
|
|
2202
2202
|
};
|
|
@@ -2243,13 +2243,13 @@ const enumeration = (elements) => ({
|
|
|
2243
2243
|
/** @internal */
|
|
2244
2244
|
const h1 = (value) => ({
|
|
2245
2245
|
_tag: "Header",
|
|
2246
|
-
value: typeof value === "string" ? text$
|
|
2246
|
+
value: typeof value === "string" ? text$8(value) : value,
|
|
2247
2247
|
level: 1
|
|
2248
2248
|
});
|
|
2249
2249
|
/** @internal */
|
|
2250
2250
|
const p$2 = (value) => ({
|
|
2251
2251
|
_tag: "Paragraph",
|
|
2252
|
-
value: typeof value === "string" ? text$
|
|
2252
|
+
value: typeof value === "string" ? text$8(value) : value
|
|
2253
2253
|
});
|
|
2254
2254
|
/** @internal */
|
|
2255
2255
|
const mapDescriptionList = /* @__PURE__ */ dual(2, (self, f) => isDescriptionList(self) ? descriptionList(map$7(self.definitions, ([span, helpDoc]) => f(span, helpDoc))) : self);
|
|
@@ -2267,7 +2267,7 @@ const toAnsiDocInternal = (self) => {
|
|
|
2267
2267
|
empty$8,
|
|
2268
2268
|
indent$1(toAnsiDocInternal(doc), 2)
|
|
2269
2269
|
])));
|
|
2270
|
-
case "Enumeration": return indent$1(vsep(self.elements.map((doc) => cat(text$
|
|
2270
|
+
case "Enumeration": return indent$1(vsep(self.elements.map((doc) => cat(text$9("- "), toAnsiDocInternal(doc)))), 2);
|
|
2271
2271
|
case "Sequence": return vsep([toAnsiDocInternal(self.left), toAnsiDocInternal(self.right)]);
|
|
2272
2272
|
}
|
|
2273
2273
|
};
|
|
@@ -2395,36 +2395,36 @@ const succeed = (value) => {
|
|
|
2395
2395
|
//#endregion
|
|
2396
2396
|
//#region ../../node_modules/.pnpm/@effect+cli@0.75.1_@effect+platform@0.96.1_effect@3.21.2__@effect+printer-ansi@0.49.0_@_d2b48786a958a46d59c00d71830aad4d/node_modules/@effect/cli/dist/esm/internal/prompt/ansi-utils.js
|
|
2397
2397
|
const defaultFigures = {
|
|
2398
|
-
arrowUp: /* @__PURE__ */ text$
|
|
2399
|
-
arrowDown: /* @__PURE__ */ text$
|
|
2400
|
-
arrowLeft: /* @__PURE__ */ text$
|
|
2401
|
-
arrowRight: /* @__PURE__ */ text$
|
|
2402
|
-
radioOn: /* @__PURE__ */ text$
|
|
2403
|
-
radioOff: /* @__PURE__ */ text$
|
|
2404
|
-
checkboxOn: /* @__PURE__ */ text$
|
|
2405
|
-
checkboxOff: /* @__PURE__ */ text$
|
|
2406
|
-
tick: /* @__PURE__ */ text$
|
|
2407
|
-
cross: /* @__PURE__ */ text$
|
|
2408
|
-
ellipsis: /* @__PURE__ */ text$
|
|
2409
|
-
pointerSmall: /* @__PURE__ */ text$
|
|
2410
|
-
line: /* @__PURE__ */ text$
|
|
2411
|
-
pointer: /* @__PURE__ */ text$
|
|
2398
|
+
arrowUp: /* @__PURE__ */ text$9("↑"),
|
|
2399
|
+
arrowDown: /* @__PURE__ */ text$9("↓"),
|
|
2400
|
+
arrowLeft: /* @__PURE__ */ text$9("←"),
|
|
2401
|
+
arrowRight: /* @__PURE__ */ text$9("→"),
|
|
2402
|
+
radioOn: /* @__PURE__ */ text$9("◉"),
|
|
2403
|
+
radioOff: /* @__PURE__ */ text$9("◯"),
|
|
2404
|
+
checkboxOn: /* @__PURE__ */ text$9("☒"),
|
|
2405
|
+
checkboxOff: /* @__PURE__ */ text$9("☐"),
|
|
2406
|
+
tick: /* @__PURE__ */ text$9("✔"),
|
|
2407
|
+
cross: /* @__PURE__ */ text$9("✖"),
|
|
2408
|
+
ellipsis: /* @__PURE__ */ text$9("…"),
|
|
2409
|
+
pointerSmall: /* @__PURE__ */ text$9("›"),
|
|
2410
|
+
line: /* @__PURE__ */ text$9("─"),
|
|
2411
|
+
pointer: /* @__PURE__ */ text$9("❯")
|
|
2412
2412
|
};
|
|
2413
2413
|
const windowsFigures = {
|
|
2414
2414
|
arrowUp: defaultFigures.arrowUp,
|
|
2415
2415
|
arrowDown: defaultFigures.arrowDown,
|
|
2416
2416
|
arrowLeft: defaultFigures.arrowLeft,
|
|
2417
2417
|
arrowRight: defaultFigures.arrowRight,
|
|
2418
|
-
radioOn: /* @__PURE__ */ text$
|
|
2419
|
-
radioOff: /* @__PURE__ */ text$
|
|
2420
|
-
checkboxOn: /* @__PURE__ */ text$
|
|
2421
|
-
checkboxOff: /* @__PURE__ */ text$
|
|
2422
|
-
tick: /* @__PURE__ */ text$
|
|
2423
|
-
cross: /* @__PURE__ */ text$
|
|
2424
|
-
ellipsis: /* @__PURE__ */ text$
|
|
2425
|
-
pointerSmall: /* @__PURE__ */ text$
|
|
2426
|
-
line: /* @__PURE__ */ text$
|
|
2427
|
-
pointer: /* @__PURE__ */ text$
|
|
2418
|
+
radioOn: /* @__PURE__ */ text$9("(*)"),
|
|
2419
|
+
radioOff: /* @__PURE__ */ text$9("( )"),
|
|
2420
|
+
checkboxOn: /* @__PURE__ */ text$9("[*]"),
|
|
2421
|
+
checkboxOff: /* @__PURE__ */ text$9("[ ]"),
|
|
2422
|
+
tick: /* @__PURE__ */ text$9("√"),
|
|
2423
|
+
cross: /* @__PURE__ */ text$9("×"),
|
|
2424
|
+
ellipsis: /* @__PURE__ */ text$9("..."),
|
|
2425
|
+
pointerSmall: /* @__PURE__ */ text$9("»"),
|
|
2426
|
+
line: /* @__PURE__ */ text$9("─"),
|
|
2427
|
+
pointer: /* @__PURE__ */ text$9(">")
|
|
2428
2428
|
};
|
|
2429
2429
|
/** @internal */
|
|
2430
2430
|
const figures = /* @__PURE__ */ map$6(/* @__PURE__ */ sync(() => process.platform === "win32"), (isWindows) => isWindows ? windowsFigures : defaultFigures);
|
|
@@ -2472,7 +2472,7 @@ function renderError$2(state, pointer) {
|
|
|
2472
2472
|
onSome: (error) => {
|
|
2473
2473
|
const errorLines = error.split(NEWLINE_REGEX$3);
|
|
2474
2474
|
if (isNonEmptyReadonlyArray(errorLines)) {
|
|
2475
|
-
const annotateLine = (line) => annotate(text$
|
|
2475
|
+
const annotateLine = (line) => annotate(text$9(line), combine(italicized, red$1));
|
|
2476
2476
|
const prefix = cat(annotate(pointer, red$1), space$1);
|
|
2477
2477
|
const lines = map$7(errorLines, (str) => annotateLine(str));
|
|
2478
2478
|
return cursorSavePosition.pipe(cat(hardLine), cat(prefix), cat(align(vsep(lines))), cat(cursorRestorePosition));
|
|
@@ -2483,13 +2483,13 @@ function renderError$2(state, pointer) {
|
|
|
2483
2483
|
}
|
|
2484
2484
|
function renderParts(state, submitted = false) {
|
|
2485
2485
|
return reduce$1(state.dateParts, empty$8, (doc, part, currentIndex) => {
|
|
2486
|
-
const partDoc = text$
|
|
2486
|
+
const partDoc = text$9(part.toString());
|
|
2487
2487
|
if (currentIndex === state.cursor && !submitted) return cat(doc, annotate(partDoc, combine(underlined, cyanBright)));
|
|
2488
2488
|
return cat(doc, partDoc);
|
|
2489
2489
|
});
|
|
2490
2490
|
}
|
|
2491
2491
|
function renderOutput$4(leadingSymbol, trailingSymbol, parts, options) {
|
|
2492
|
-
const annotateLine = (line) => annotate(text$
|
|
2492
|
+
const annotateLine = (line) => annotate(text$9(line), bold$1);
|
|
2493
2493
|
const prefix = cat(leadingSymbol, space$1);
|
|
2494
2494
|
return match$1(options.message.split(/\r?\n/), {
|
|
2495
2495
|
onEmpty: () => hsep([
|
|
@@ -2507,7 +2507,7 @@ function renderNextFrame$5(state, options) {
|
|
|
2507
2507
|
return gen(function* () {
|
|
2508
2508
|
const columns = yield* (yield* Terminal).columns;
|
|
2509
2509
|
const figures$12 = yield* figures;
|
|
2510
|
-
const promptMsg = renderOutput$4(annotate(text$
|
|
2510
|
+
const promptMsg = renderOutput$4(annotate(text$9("?"), cyanBright), annotate(figures$12.pointerSmall, blackBright), renderParts(state), options);
|
|
2511
2511
|
const errorMsg = renderError$2(state, figures$12.pointerSmall);
|
|
2512
2512
|
return cursorHide.pipe(cat(promptMsg), cat(errorMsg), optimize(Deep), render$2({
|
|
2513
2513
|
style: "pretty",
|
|
@@ -2974,7 +2974,7 @@ function handleClear$4(options) {
|
|
|
2974
2974
|
}
|
|
2975
2975
|
const NEWLINE_REGEX$2 = /\r?\n/;
|
|
2976
2976
|
function renderPrompt(confirm, message, leadingSymbol, trailingSymbol) {
|
|
2977
|
-
const annotateLine = (line) => annotate(text$
|
|
2977
|
+
const annotateLine = (line) => annotate(text$9(line), bold$1);
|
|
2978
2978
|
const prefix = cat(leadingSymbol, space$1);
|
|
2979
2979
|
return match$1(message.split(NEWLINE_REGEX$2), {
|
|
2980
2980
|
onEmpty: () => hsep([
|
|
@@ -2995,7 +2995,7 @@ function renderPrefix(state, toDisplay, currentIndex, length, figures) {
|
|
|
2995
2995
|
return state.cursor === currentIndex ? figures.pointer.pipe(annotate(cyanBright), cat(prefix)) : prefix.pipe(cat(space$1));
|
|
2996
2996
|
}
|
|
2997
2997
|
function renderFileName(file, isSelected) {
|
|
2998
|
-
return isSelected ? annotate(text$
|
|
2998
|
+
return isSelected ? annotate(text$9(file), combine(underlined, cyanBright)) : text$9(file);
|
|
2999
2999
|
}
|
|
3000
3000
|
function renderFiles(state, files, figures, options) {
|
|
3001
3001
|
const length = files.length;
|
|
@@ -3017,11 +3017,11 @@ function renderNextFrame$4(state, options) {
|
|
|
3017
3017
|
const currentPath = yield* resolveCurrentPath(state.path, options);
|
|
3018
3018
|
const selectedPath = state.files[state.cursor];
|
|
3019
3019
|
const resolvedPath = path.resolve(currentPath, selectedPath);
|
|
3020
|
-
const resolvedPathMsg = figures$9.pointerSmall.pipe(cat(space$1), cat(text$
|
|
3020
|
+
const resolvedPathMsg = figures$9.pointerSmall.pipe(cat(space$1), cat(text$9(resolvedPath)), annotate(blackBright));
|
|
3021
3021
|
if (showConfirmation(state.confirm)) {
|
|
3022
|
-
const leadingSymbol = annotate(text$
|
|
3022
|
+
const leadingSymbol = annotate(text$9("?"), cyanBright);
|
|
3023
3023
|
const trailingSymbol = annotate(figures$9.pointerSmall, blackBright);
|
|
3024
|
-
const promptMsg = renderPrompt(annotate(text$
|
|
3024
|
+
const promptMsg = renderPrompt(annotate(text$9("(Y/n)"), blackBright), CONFIRM_MESSAGE, leadingSymbol, trailingSymbol);
|
|
3025
3025
|
return cursorHide.pipe(cat(promptMsg), cat(hardLine), cat(resolvedPathMsg), optimize(Deep), render$2({
|
|
3026
3026
|
style: "pretty",
|
|
3027
3027
|
options: { lineWidth: columns }
|
|
@@ -3043,7 +3043,7 @@ function renderSubmission$4(value, options) {
|
|
|
3043
3043
|
const figures$10 = yield* figures;
|
|
3044
3044
|
const leadingSymbol = annotate(figures$10.tick, green);
|
|
3045
3045
|
const trailingSymbol = annotate(figures$10.ellipsis, blackBright);
|
|
3046
|
-
return renderPrompt(empty$8, options.message, leadingSymbol, trailingSymbol).pipe(cat(space$1), cat(annotate(text$
|
|
3046
|
+
return renderPrompt(empty$8, options.message, leadingSymbol, trailingSymbol).pipe(cat(space$1), cat(annotate(text$9(value), white$1)), cat(hardLine), render$2({
|
|
3047
3047
|
style: "pretty",
|
|
3048
3048
|
options: { lineWidth: columns }
|
|
3049
3049
|
}));
|
|
@@ -3185,7 +3185,7 @@ function renderInput$1(state, submitted) {
|
|
|
3185
3185
|
onNone: () => combine(underlined, cyanBright),
|
|
3186
3186
|
onSome: () => red$1
|
|
3187
3187
|
});
|
|
3188
|
-
const value = state.value === "" ? empty$8 : text$
|
|
3188
|
+
const value = state.value === "" ? empty$8 : text$9(`${state.value}`);
|
|
3189
3189
|
return submitted ? value : annotate(value, annotation);
|
|
3190
3190
|
}
|
|
3191
3191
|
const NEWLINE_REGEX$1 = /\r?\n/;
|
|
@@ -3195,7 +3195,7 @@ function renderError$1(state, pointer) {
|
|
|
3195
3195
|
onSome: (error) => match$1(error.split(NEWLINE_REGEX$1), {
|
|
3196
3196
|
onEmpty: () => empty$8,
|
|
3197
3197
|
onNonEmpty: (errorLines) => {
|
|
3198
|
-
const annotateLine = (line) => annotate(text$
|
|
3198
|
+
const annotateLine = (line) => annotate(text$9(line), combine(italicized, red$1));
|
|
3199
3199
|
const prefix = cat(annotate(pointer, red$1), space$1);
|
|
3200
3200
|
const lines = map$7(errorLines, (str) => annotateLine(str));
|
|
3201
3201
|
return cursorSavePosition.pipe(cat(hardLine), cat(prefix), cat(align(vsep(lines))), cat(cursorRestorePosition));
|
|
@@ -3204,7 +3204,7 @@ function renderError$1(state, pointer) {
|
|
|
3204
3204
|
});
|
|
3205
3205
|
}
|
|
3206
3206
|
function renderOutput$3(state, leadingSymbol, trailingSymbol, options, submitted = false) {
|
|
3207
|
-
const annotateLine = (line) => annotate(text$
|
|
3207
|
+
const annotateLine = (line) => annotate(text$9(line), bold$1);
|
|
3208
3208
|
const prefix = cat(leadingSymbol, space$1);
|
|
3209
3209
|
return match$1(options.message.split(/\r?\n/), {
|
|
3210
3210
|
onEmpty: () => hsep([
|
|
@@ -3222,7 +3222,7 @@ function renderNextFrame$3(state, options) {
|
|
|
3222
3222
|
return gen(function* () {
|
|
3223
3223
|
const columns = yield* (yield* Terminal).columns;
|
|
3224
3224
|
const figures$7 = yield* figures;
|
|
3225
|
-
const leadingSymbol = annotate(text$
|
|
3225
|
+
const leadingSymbol = annotate(text$9("?"), cyanBright);
|
|
3226
3226
|
const trailingSymbol = annotate(figures$7.pointerSmall, blackBright);
|
|
3227
3227
|
const errorMsg = renderError$1(state, figures$7.pointerSmall);
|
|
3228
3228
|
return renderOutput$3(state, leadingSymbol, trailingSymbol, options).pipe(cat(errorMsg), optimize(Deep), render$2({
|
|
@@ -3418,7 +3418,7 @@ const float = (options) => {
|
|
|
3418
3418
|
const renderBeep$2 = /* @__PURE__ */ render$2(beep, { style: "pretty" });
|
|
3419
3419
|
const NEWLINE_REGEX = /\r?\n/;
|
|
3420
3420
|
function renderOutput$2(leadingSymbol, trailingSymbol, options) {
|
|
3421
|
-
const annotateLine = (line) => annotate(text$
|
|
3421
|
+
const annotateLine = (line) => annotate(text$9(line), bold$1);
|
|
3422
3422
|
const prefix = cat(leadingSymbol, space$1);
|
|
3423
3423
|
return match$1(options.message.split(NEWLINE_REGEX), {
|
|
3424
3424
|
onEmpty: () => hsep([prefix, trailingSymbol]),
|
|
@@ -3439,12 +3439,12 @@ function renderChoicePrefix(state, choices, toDisplay, currentIndex, figures) {
|
|
|
3439
3439
|
return state === currentIndex ? figures.pointer.pipe(annotate(cyanBright), cat(prefix)) : prefix.pipe(cat(space$1));
|
|
3440
3440
|
}
|
|
3441
3441
|
function renderChoiceTitle(choice, isSelected) {
|
|
3442
|
-
const title = text$
|
|
3442
|
+
const title = text$9(choice.title);
|
|
3443
3443
|
if (isSelected) return choice.disabled ? annotate(title, combine(underlined, blackBright)) : annotate(title, combine(underlined, cyanBright));
|
|
3444
3444
|
return choice.disabled ? annotate(title, combine(strikethrough, blackBright)) : title;
|
|
3445
3445
|
}
|
|
3446
3446
|
function renderChoiceDescription(choice, isSelected) {
|
|
3447
|
-
if (!choice.disabled && choice.description && isSelected) return char("-").pipe(cat(space$1), cat(text$
|
|
3447
|
+
if (!choice.disabled && choice.description && isSelected) return char("-").pipe(cat(space$1), cat(text$9(choice.description)), annotate(blackBright));
|
|
3448
3448
|
return empty$8;
|
|
3449
3449
|
}
|
|
3450
3450
|
function renderChoices(state, options, figures) {
|
|
@@ -3466,7 +3466,7 @@ function renderNextFrame$2(state, options) {
|
|
|
3466
3466
|
const columns = yield* (yield* Terminal).columns;
|
|
3467
3467
|
const figures$5 = yield* figures;
|
|
3468
3468
|
const choices = renderChoices(state, options, figures$5);
|
|
3469
|
-
const promptMsg = renderOutput$2(annotate(text$
|
|
3469
|
+
const promptMsg = renderOutput$2(annotate(text$9("?"), cyanBright), annotate(figures$5.pointerSmall, blackBright), options);
|
|
3470
3470
|
return cursorHide.pipe(cat(promptMsg), cat(hardLine), cat(choices), render$2({
|
|
3471
3471
|
style: "pretty",
|
|
3472
3472
|
options: { lineWidth: columns }
|
|
@@ -3477,7 +3477,7 @@ function renderSubmission$2(state, options) {
|
|
|
3477
3477
|
return gen(function* () {
|
|
3478
3478
|
const columns = yield* (yield* Terminal).columns;
|
|
3479
3479
|
const figures$6 = yield* figures;
|
|
3480
|
-
const selected = text$
|
|
3480
|
+
const selected = text$9(options.choices[state].title);
|
|
3481
3481
|
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({
|
|
3482
3482
|
style: "pretty",
|
|
3483
3483
|
options: { lineWidth: columns }
|
|
@@ -3585,8 +3585,8 @@ function renderInput(nextState, options, submitted) {
|
|
|
3585
3585
|
});
|
|
3586
3586
|
switch (options.type) {
|
|
3587
3587
|
case "hidden": return empty$8;
|
|
3588
|
-
case "password": return annotate(text$
|
|
3589
|
-
case "text": return annotate(text$
|
|
3588
|
+
case "password": return annotate(text$9("*".repeat(text.length)), annotation);
|
|
3589
|
+
case "text": return annotate(text$9(text), annotation);
|
|
3590
3590
|
}
|
|
3591
3591
|
}
|
|
3592
3592
|
function renderError(nextState, pointer) {
|
|
@@ -3595,7 +3595,7 @@ function renderError(nextState, pointer) {
|
|
|
3595
3595
|
onSome: (error) => match$1(error.split(/\r?\n/), {
|
|
3596
3596
|
onEmpty: () => empty$8,
|
|
3597
3597
|
onNonEmpty: (errorLines) => {
|
|
3598
|
-
const annotateLine = (line) => text$
|
|
3598
|
+
const annotateLine = (line) => text$9(line).pipe(annotate(combine(italicized, red$1)));
|
|
3599
3599
|
const prefix = cat(annotate(pointer, red$1), space$1);
|
|
3600
3600
|
const lines = map$7(errorLines, (str) => annotateLine(str));
|
|
3601
3601
|
return cursorSavePosition.pipe(cat(hardLine), cat(prefix), cat(align(vsep(lines))), cat(cursorRestorePosition));
|
|
@@ -3604,7 +3604,7 @@ function renderError(nextState, pointer) {
|
|
|
3604
3604
|
});
|
|
3605
3605
|
}
|
|
3606
3606
|
function renderOutput$1(nextState, leadingSymbol, trailingSymbol, options, submitted = false) {
|
|
3607
|
-
const annotateLine = (line) => annotate(text$
|
|
3607
|
+
const annotateLine = (line) => annotate(text$9(line), bold$1);
|
|
3608
3608
|
const promptLines = options.message.split(/\r?\n/);
|
|
3609
3609
|
const prefix = cat(leadingSymbol, space$1);
|
|
3610
3610
|
if (isNonEmptyReadonlyArray(promptLines)) {
|
|
@@ -3621,7 +3621,7 @@ function renderNextFrame$1(state, options) {
|
|
|
3621
3621
|
return gen(function* () {
|
|
3622
3622
|
const columns = yield* (yield* Terminal).columns;
|
|
3623
3623
|
const figures$3 = yield* figures;
|
|
3624
|
-
const promptMsg = renderOutput$1(state, annotate(text$
|
|
3624
|
+
const promptMsg = renderOutput$1(state, annotate(text$9("?"), cyanBright), annotate(figures$3.pointerSmall, blackBright), options);
|
|
3625
3625
|
const errorMsg = renderError(state, figures$3.pointerSmall);
|
|
3626
3626
|
const offset = state.cursor - state.value.length;
|
|
3627
3627
|
return promptMsg.pipe(cat(errorMsg), cat(cursorMove(offset)), optimize(Deep), render$2({
|
|
@@ -3750,7 +3750,7 @@ function basePrompt(options, type) {
|
|
|
3750
3750
|
/** @internal */
|
|
3751
3751
|
const hidden = (options) => basePrompt(options, "hidden").pipe(map$3(make$21));
|
|
3752
3752
|
/** @internal */
|
|
3753
|
-
const text$
|
|
3753
|
+
const text$7 = (options) => basePrompt(options, "text");
|
|
3754
3754
|
//#endregion
|
|
3755
3755
|
//#region ../../node_modules/.pnpm/@effect+cli@0.75.1_@effect+platform@0.96.1_effect@3.21.2__@effect+printer-ansi@0.49.0_@_d2b48786a958a46d59c00d71830aad4d/node_modules/@effect/cli/dist/esm/internal/prompt/toggle.js
|
|
3756
3756
|
const renderBeep = /* @__PURE__ */ render$2(beep, { style: "pretty" });
|
|
@@ -3767,15 +3767,15 @@ function handleClear(options) {
|
|
|
3767
3767
|
function renderToggle(value, options, submitted = false) {
|
|
3768
3768
|
const separator = annotate(char("/"), blackBright);
|
|
3769
3769
|
const selectedAnnotation = combine(underlined, submitted ? white$1 : cyanBright);
|
|
3770
|
-
const inactive = value ? text$
|
|
3770
|
+
const inactive = value ? text$9(options.inactive) : annotate(text$9(options.inactive), selectedAnnotation);
|
|
3771
3771
|
return hsep([
|
|
3772
|
-
value ? annotate(text$
|
|
3772
|
+
value ? annotate(text$9(options.active), selectedAnnotation) : text$9(options.active),
|
|
3773
3773
|
separator,
|
|
3774
3774
|
inactive
|
|
3775
3775
|
]);
|
|
3776
3776
|
}
|
|
3777
3777
|
function renderOutput(toggle, leadingSymbol, trailingSymbol, options) {
|
|
3778
|
-
const annotateLine = (line) => annotate(text$
|
|
3778
|
+
const annotateLine = (line) => annotate(text$9(line), bold$1);
|
|
3779
3779
|
const promptLines = options.message.split(/\r?\n/);
|
|
3780
3780
|
const prefix = cat(leadingSymbol, space$1);
|
|
3781
3781
|
if (isNonEmptyReadonlyArray(promptLines)) {
|
|
@@ -3793,7 +3793,7 @@ function renderNextFrame(state, options) {
|
|
|
3793
3793
|
const terminal = yield* Terminal;
|
|
3794
3794
|
const figures$2 = yield* figures;
|
|
3795
3795
|
const columns = yield* terminal.columns;
|
|
3796
|
-
const leadingSymbol = annotate(text$
|
|
3796
|
+
const leadingSymbol = annotate(text$9("?"), cyanBright);
|
|
3797
3797
|
const trailingSymbol = annotate(figures$2.pointerSmall, blackBright);
|
|
3798
3798
|
const promptMsg = renderOutput(renderToggle(state, options), leadingSymbol, trailingSymbol, options);
|
|
3799
3799
|
return cursorHide.pipe(cat(promptMsg), optimize(Deep), render$2({
|
|
@@ -3897,7 +3897,7 @@ const integer$2 = /* @__PURE__ */ (() => {
|
|
|
3897
3897
|
return op;
|
|
3898
3898
|
})();
|
|
3899
3899
|
/** @internal */
|
|
3900
|
-
const text$
|
|
3900
|
+
const text$6 = /* @__PURE__ */ (() => {
|
|
3901
3901
|
const op = /* @__PURE__ */ Object.create(proto$5);
|
|
3902
3902
|
op._tag = "Text";
|
|
3903
3903
|
return op;
|
|
@@ -3927,25 +3927,25 @@ const getChoicesInternal = (self) => {
|
|
|
3927
3927
|
};
|
|
3928
3928
|
const getHelpInternal$3 = (self) => {
|
|
3929
3929
|
switch (self._tag) {
|
|
3930
|
-
case "Bool": return text$
|
|
3931
|
-
case "Choice": return text$
|
|
3932
|
-
case "DateTime": return text$
|
|
3933
|
-
case "Float": return text$
|
|
3934
|
-
case "Integer": return text$
|
|
3930
|
+
case "Bool": return text$8("A true or false value.");
|
|
3931
|
+
case "Choice": return text$8(`One of the following: ${pipe(map$7(self.alternatives, ([choice]) => choice), join$1(", "))}`);
|
|
3932
|
+
case "DateTime": return text$8("A date without a time-zone in the ISO-8601 format, such as 2007-12-03T10:15:30.");
|
|
3933
|
+
case "Float": return text$8("A floating point number.");
|
|
3934
|
+
case "Integer": return text$8("An integer.");
|
|
3935
3935
|
case "Path":
|
|
3936
|
-
if (self.pathType === "either" && self.pathExists === "yes") return text$
|
|
3937
|
-
if (self.pathType === "file" && self.pathExists === "yes") return text$
|
|
3938
|
-
if (self.pathType === "directory" && self.pathExists === "yes") return text$
|
|
3939
|
-
if (self.pathType === "either" && self.pathExists === "no") return text$
|
|
3940
|
-
if (self.pathType === "file" && self.pathExists === "no") return text$
|
|
3941
|
-
if (self.pathType === "directory" && self.pathExists === "no") return text$
|
|
3942
|
-
if (self.pathType === "either" && self.pathExists === "either") return text$
|
|
3943
|
-
if (self.pathType === "file" && self.pathExists === "either") return text$
|
|
3944
|
-
if (self.pathType === "directory" && self.pathExists === "either") return text$
|
|
3936
|
+
if (self.pathType === "either" && self.pathExists === "yes") return text$8("An existing file or directory.");
|
|
3937
|
+
if (self.pathType === "file" && self.pathExists === "yes") return text$8("An existing file.");
|
|
3938
|
+
if (self.pathType === "directory" && self.pathExists === "yes") return text$8("An existing directory.");
|
|
3939
|
+
if (self.pathType === "either" && self.pathExists === "no") return text$8("A file or directory that must not exist.");
|
|
3940
|
+
if (self.pathType === "file" && self.pathExists === "no") return text$8("A file that must not exist.");
|
|
3941
|
+
if (self.pathType === "directory" && self.pathExists === "no") return text$8("A directory that must not exist.");
|
|
3942
|
+
if (self.pathType === "either" && self.pathExists === "either") return text$8("A file or directory.");
|
|
3943
|
+
if (self.pathType === "file" && self.pathExists === "either") return text$8("A file.");
|
|
3944
|
+
if (self.pathType === "directory" && self.pathExists === "either") return text$8("A directory.");
|
|
3945
3945
|
throw new Error(`[BUG]: Path.help - encountered invalid combination of path type ('${self.pathType}') and path existence ('${self.pathExists}')`);
|
|
3946
3946
|
case "Secret":
|
|
3947
|
-
case "Redacted": return text$
|
|
3948
|
-
case "Text": return text$
|
|
3947
|
+
case "Redacted": return text$8("A user-defined piece of text that is confidential.");
|
|
3948
|
+
case "Text": return text$8("A user-defined piece of text.");
|
|
3949
3949
|
}
|
|
3950
3950
|
};
|
|
3951
3951
|
const getTypeNameInternal = (self) => {
|
|
@@ -4040,7 +4040,7 @@ const wizardInternal$3 = (self, help) => {
|
|
|
4040
4040
|
}
|
|
4041
4041
|
case "Redacted": return hidden({ message: toAnsiText(sequence(help, p$2("Enter some text (value will be redacted)"))).trimEnd() });
|
|
4042
4042
|
case "Secret": return hidden({ message: toAnsiText(sequence(help, p$2("Enter some text (value will be redacted)"))).trimEnd() });
|
|
4043
|
-
case "Text": return text$
|
|
4043
|
+
case "Text": return text$7({ message: toAnsiText(sequence(help, p$2("Enter some text"))).trimEnd() });
|
|
4044
4044
|
}
|
|
4045
4045
|
};
|
|
4046
4046
|
/** @internal */
|
|
@@ -4172,32 +4172,32 @@ const simplify = (self, config) => {
|
|
|
4172
4172
|
};
|
|
4173
4173
|
const render$1 = (self, config) => {
|
|
4174
4174
|
switch (self._tag) {
|
|
4175
|
-
case "Empty": return of$2(text$
|
|
4176
|
-
case "Mixed": return of$2(text$
|
|
4175
|
+
case "Empty": return of$2(text$8(""));
|
|
4176
|
+
case "Mixed": return of$2(text$8("<command>"));
|
|
4177
4177
|
case "Named": {
|
|
4178
4178
|
const typeInfo = config.showTypes ? match(self.acceptedValues, {
|
|
4179
4179
|
onNone: () => empty$7,
|
|
4180
|
-
onSome: (s) => concat$1(space, text$
|
|
4180
|
+
onSome: (s) => concat$1(space, text$8(s))
|
|
4181
4181
|
}) : empty$7;
|
|
4182
|
-
const nameInfo = text$
|
|
4182
|
+
const nameInfo = text$8(join$1(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, ", "));
|
|
4183
4183
|
return config.showAllNames && self.names.length > 1 ? of$2(spans([
|
|
4184
|
-
text$
|
|
4184
|
+
text$8("("),
|
|
4185
4185
|
nameInfo,
|
|
4186
4186
|
typeInfo,
|
|
4187
|
-
text$
|
|
4187
|
+
text$8(")")
|
|
4188
4188
|
])) : of$2(concat$1(nameInfo, typeInfo));
|
|
4189
4189
|
}
|
|
4190
4190
|
case "Optional": return map$7(render$1(self.usage, config), (span) => spans([
|
|
4191
|
-
text$
|
|
4191
|
+
text$8("["),
|
|
4192
4192
|
span,
|
|
4193
|
-
text$
|
|
4193
|
+
text$8("]")
|
|
4194
4194
|
]));
|
|
4195
|
-
case "Repeated": return map$7(render$1(self.usage, config), (span) => concat$1(span, text$
|
|
4195
|
+
case "Repeated": return map$7(render$1(self.usage, config), (span) => concat$1(span, text$8("...")));
|
|
4196
4196
|
case "Alternation":
|
|
4197
4197
|
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));
|
|
4198
4198
|
return flatMap$4(render$1(self.left, config), (left) => map$7(render$1(self.right, config), (right) => spans([
|
|
4199
4199
|
left,
|
|
4200
|
-
text$
|
|
4200
|
+
text$8("|"),
|
|
4201
4201
|
right
|
|
4202
4202
|
])));
|
|
4203
4203
|
case "Concat": {
|
|
@@ -4328,7 +4328,7 @@ const none$1 = /* @__PURE__ */ (() => {
|
|
|
4328
4328
|
return op;
|
|
4329
4329
|
})();
|
|
4330
4330
|
/** @internal */
|
|
4331
|
-
const text$
|
|
4331
|
+
const text$5 = (config) => makeSingle$1(fromNullable(config?.name), text$6);
|
|
4332
4332
|
/** @internal */
|
|
4333
4333
|
const getHelp$2 = (self) => getHelpInternal$2(self);
|
|
4334
4334
|
/** @internal */
|
|
@@ -4364,7 +4364,7 @@ const getHelpInternal$2 = (self) => {
|
|
|
4364
4364
|
case "Variadic": return mapDescriptionList(getHelpInternal$2(self.args), (oldSpan, oldBlock) => {
|
|
4365
4365
|
const min = getMinSizeInternal$1(self);
|
|
4366
4366
|
const max = getMaxSizeInternal$1(self);
|
|
4367
|
-
const newSpan = text$
|
|
4367
|
+
const newSpan = text$8(isSome(self.max) ? ` ${min} - ${max}` : min === 0 ? "..." : ` ${min}+`);
|
|
4368
4368
|
const newBlock = p$2(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.`);
|
|
4369
4369
|
return [concat$1(oldSpan, newSpan), sequence(oldBlock, newBlock)];
|
|
4370
4370
|
});
|
|
@@ -4619,7 +4619,7 @@ const repeated = repeated$1;
|
|
|
4619
4619
|
* @since 1.0.0
|
|
4620
4620
|
* @category constructors
|
|
4621
4621
|
*/
|
|
4622
|
-
const text$
|
|
4622
|
+
const text$4 = text$5;
|
|
4623
4623
|
//#endregion
|
|
4624
4624
|
//#region ../../node_modules/.pnpm/@effect+cli@0.75.1_@effect+platform@0.96.1_effect@3.21.2__@effect+printer-ansi@0.49.0_@_d2b48786a958a46d59c00d71830aad4d/node_modules/@effect/cli/dist/esm/internal/autoCorrect.js
|
|
4625
4625
|
/** @internal */
|
|
@@ -4646,7 +4646,7 @@ const levensteinDistance = (first, second, config) => {
|
|
|
4646
4646
|
//#endregion
|
|
4647
4647
|
//#region ../../node_modules/.pnpm/@effect+cli@0.75.1_@effect+platform@0.96.1_effect@3.21.2__@effect+printer-ansi@0.49.0_@_d2b48786a958a46d59c00d71830aad4d/node_modules/@effect/cli/dist/esm/internal/prompt/list.js
|
|
4648
4648
|
/** @internal */
|
|
4649
|
-
const list$8 = (options) => text$
|
|
4649
|
+
const list$8 = (options) => text$7(options).pipe(map$3((output) => output.split(options.delimiter || ",")));
|
|
4650
4650
|
/** @internal */
|
|
4651
4651
|
const OptionsTypeId = /* @__PURE__ */ Symbol.for("@effect/cli/Options");
|
|
4652
4652
|
const proto$2 = {
|
|
@@ -4709,7 +4709,7 @@ const none = /* @__PURE__ */ (() => {
|
|
|
4709
4709
|
return op;
|
|
4710
4710
|
})();
|
|
4711
4711
|
/** @internal */
|
|
4712
|
-
const text$
|
|
4712
|
+
const text$3 = (name) => makeSingle(name, empty$11(), text$6);
|
|
4713
4713
|
/** @internal */
|
|
4714
4714
|
const getHelp$1 = (self) => getHelpInternal$1(self);
|
|
4715
4715
|
/** @internal */
|
|
@@ -4775,7 +4775,7 @@ const getHelpInternal$1 = (self) => {
|
|
|
4775
4775
|
case "Variadic": return mapDescriptionList(getHelpInternal$1(self.argumentOption), (oldSpan, oldBlock) => {
|
|
4776
4776
|
const min = getMinSizeInternal(self);
|
|
4777
4777
|
const max = getMaxSizeInternal(self);
|
|
4778
|
-
const newSpan = text$
|
|
4778
|
+
const newSpan = text$8(isSome(self.max) ? ` ${min} - ${max}` : min === 0 ? "..." : ` ${min}+`);
|
|
4779
4779
|
const newBlock = p$2(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.`);
|
|
4780
4780
|
return [concat$1(oldSpan, newSpan), sequence(oldBlock, newBlock)];
|
|
4781
4781
|
});
|
|
@@ -5703,7 +5703,7 @@ const integer = integer$1;
|
|
|
5703
5703
|
* @since 1.0.0
|
|
5704
5704
|
* @category constructors
|
|
5705
5705
|
*/
|
|
5706
|
-
const text$
|
|
5706
|
+
const text$2 = text$3;
|
|
5707
5707
|
/**
|
|
5708
5708
|
* @since 1.0.0
|
|
5709
5709
|
* @category combinators
|
|
@@ -5827,7 +5827,7 @@ const getHelpInternal = (self, config) => {
|
|
|
5827
5827
|
const maxUsageLength = reduceRight(subcommands, 0, (max, [usage]) => Math.max(size$4(usage), max));
|
|
5828
5828
|
const documents = map$7(subcommands, ([usage, desc]) => p$2(spans([
|
|
5829
5829
|
usage,
|
|
5830
|
-
text$
|
|
5830
|
+
text$8(" ".repeat(maxUsageLength - size$4(usage) + 2)),
|
|
5831
5831
|
desc
|
|
5832
5832
|
])));
|
|
5833
5833
|
if (isNonEmptyReadonlyArray(documents)) return enumeration(documents);
|
|
@@ -6368,13 +6368,13 @@ const handleBuiltInOption = (self, executable, args, builtIn, execute, config, o
|
|
|
6368
6368
|
}
|
|
6369
6369
|
case "ShowHelp": {
|
|
6370
6370
|
const banner = h1(code(self.name));
|
|
6371
|
-
const header = p$2(spans([text$
|
|
6371
|
+
const header = p$2(spans([text$8(`${self.name} ${self.version}`), isEmpty$3(self.summary) ? empty$7 : spans([
|
|
6372
6372
|
space,
|
|
6373
|
-
text$
|
|
6373
|
+
text$8("--"),
|
|
6374
6374
|
space,
|
|
6375
6375
|
self.summary
|
|
6376
6376
|
])]));
|
|
6377
|
-
const usage = sequence(h1("USAGE"), pipe(enumerate(builtIn.usage, config), map$7((span) => p$2(concat$1(text$
|
|
6377
|
+
const usage = sequence(h1("USAGE"), pipe(enumerate(builtIn.usage, config), map$7((span) => p$2(concat$1(text$8("$ "), span))), reduceRight(empty$6, (left, right) => sequence(left, right))));
|
|
6378
6378
|
return log(toAnsiText(pipe(banner, sequence(header), sequence(usage), sequence(builtIn.helpDoc), sequence(self.footer))));
|
|
6379
6379
|
}
|
|
6380
6380
|
case "ShowCompletions": {
|
|
@@ -6388,17 +6388,17 @@ const handleBuiltInOption = (self, executable, args, builtIn, execute, config, o
|
|
|
6388
6388
|
case "ShowWizard": {
|
|
6389
6389
|
const summary = isEmpty$3(self.summary) ? empty$7 : spans([
|
|
6390
6390
|
space,
|
|
6391
|
-
text$
|
|
6391
|
+
text$8("--"),
|
|
6392
6392
|
space,
|
|
6393
6393
|
self.summary
|
|
6394
6394
|
]);
|
|
6395
6395
|
const instructions = sequence(p$2(spans([
|
|
6396
|
-
text$
|
|
6396
|
+
text$8("The wizard mode will assist you with constructing commands for"),
|
|
6397
6397
|
space,
|
|
6398
6398
|
code(`${self.name} (${self.version})`),
|
|
6399
|
-
text$
|
|
6399
|
+
text$8(".")
|
|
6400
6400
|
])), p$2("Please answer all prompts provided by the wizard."));
|
|
6401
|
-
const description = descriptionList([[text$
|
|
6401
|
+
const description = descriptionList([[text$8("Instructions"), instructions]]);
|
|
6402
6402
|
const text = toAnsiText(sequence(h1(spans([
|
|
6403
6403
|
code("Wizard Mode for CLI Application:"),
|
|
6404
6404
|
space,
|
|
@@ -6457,11 +6457,11 @@ const getWizardPrefix = (builtIn, rootCommand, commandLineArgs) => {
|
|
|
6457
6457
|
};
|
|
6458
6458
|
const renderWizardArgs = (args) => {
|
|
6459
6459
|
const params = pipe(filter$2(args, (param) => param.length > 0), join$1(" "));
|
|
6460
|
-
const executeMsg = text$
|
|
6460
|
+
const executeMsg = text$8("You may now execute your command directly with the following options and arguments:");
|
|
6461
6461
|
return blocks([
|
|
6462
6462
|
p$2(strong(code("Wizard Mode Complete!"))),
|
|
6463
6463
|
p$2(executeMsg),
|
|
6464
|
-
p$2(concat$1(text$
|
|
6464
|
+
p$2(concat$1(text$8(" "), highlight(params, cyan)))
|
|
6465
6465
|
]);
|
|
6466
6466
|
};
|
|
6467
6467
|
const isLogLevelArg = (arg) => {
|
|
@@ -7110,9 +7110,9 @@ var Uint8ArrayImpl = class extends BodyBase {
|
|
|
7110
7110
|
const uint8Array = (body, contentType) => new Uint8ArrayImpl(body, contentType ?? "application/octet-stream");
|
|
7111
7111
|
const encoder = /* @__PURE__ */ new TextEncoder();
|
|
7112
7112
|
/** @internal */
|
|
7113
|
-
const text = (body, contentType) => uint8Array(encoder.encode(body), contentType ?? "text/plain");
|
|
7113
|
+
const text$1 = (body, contentType) => uint8Array(encoder.encode(body), contentType ?? "text/plain");
|
|
7114
7114
|
/** @internal */
|
|
7115
|
-
const unsafeJson = (body, contentType) => text(JSON.stringify(body), contentType ?? "application/json");
|
|
7115
|
+
const unsafeJson = (body, contentType) => text$1(JSON.stringify(body), contentType ?? "application/json");
|
|
7116
7116
|
/** @internal */
|
|
7117
7117
|
const json = (body, contentType) => try_({
|
|
7118
7118
|
try: () => unsafeJson(body, contentType),
|
|
@@ -9042,7 +9042,7 @@ function isInsideContainer() {
|
|
|
9042
9042
|
//#endregion
|
|
9043
9043
|
//#region ../../node_modules/.pnpm/is-wsl@3.1.1/node_modules/is-wsl/index.js
|
|
9044
9044
|
const isWsl = () => {
|
|
9045
|
-
if (
|
|
9045
|
+
if (V.platform !== "linux") return false;
|
|
9046
9046
|
if (os.release().toLowerCase().includes("microsoft")) {
|
|
9047
9047
|
if (isInsideContainer()) return false;
|
|
9048
9048
|
return true;
|
|
@@ -9053,11 +9053,11 @@ const isWsl = () => {
|
|
|
9053
9053
|
if (fs.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || fs.existsSync("/run/WSL")) return !isInsideContainer();
|
|
9054
9054
|
return false;
|
|
9055
9055
|
};
|
|
9056
|
-
var is_wsl_default =
|
|
9056
|
+
var is_wsl_default = V.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
9057
9057
|
//#endregion
|
|
9058
9058
|
//#region ../../node_modules/.pnpm/powershell-utils@0.1.0/node_modules/powershell-utils/index.js
|
|
9059
9059
|
const execFile$2 = promisify(childProcess.execFile);
|
|
9060
|
-
const powerShellPath$1 = () => `${
|
|
9060
|
+
const powerShellPath$1 = () => `${V.env.SYSTEMROOT || V.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
9061
9061
|
const executePowerShell = async (command, options = {}) => {
|
|
9062
9062
|
const { powerShellPath: psPath, ...execFileOptions } = options;
|
|
9063
9063
|
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
@@ -9164,7 +9164,7 @@ function defineLazyProperty(object, propertyName, valueGetter) {
|
|
|
9164
9164
|
//#region ../../node_modules/.pnpm/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
|
|
9165
9165
|
const execFileAsync$3 = promisify(execFile);
|
|
9166
9166
|
async function defaultBrowserId() {
|
|
9167
|
-
if (
|
|
9167
|
+
if (V.platform !== "darwin") throw new Error("macOS only");
|
|
9168
9168
|
const { stdout } = await execFileAsync$3("defaults", [
|
|
9169
9169
|
"read",
|
|
9170
9170
|
"com.apple.LaunchServices/com.apple.launchservices.secure",
|
|
@@ -9178,7 +9178,7 @@ async function defaultBrowserId() {
|
|
|
9178
9178
|
//#region ../../node_modules/.pnpm/run-applescript@7.1.0/node_modules/run-applescript/index.js
|
|
9179
9179
|
const execFileAsync$2 = promisify(execFile);
|
|
9180
9180
|
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
9181
|
-
if (
|
|
9181
|
+
if (V.platform !== "darwin") throw new Error("macOS only");
|
|
9182
9182
|
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
9183
9183
|
const execOptions = {};
|
|
9184
9184
|
if (signal) execOptions.signal = signal;
|
|
@@ -9289,14 +9289,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
|
|
|
9289
9289
|
const execFileAsync = promisify(execFile);
|
|
9290
9290
|
const titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
|
|
9291
9291
|
async function defaultBrowser() {
|
|
9292
|
-
if (
|
|
9292
|
+
if (V.platform === "darwin") {
|
|
9293
9293
|
const id = await defaultBrowserId();
|
|
9294
9294
|
return {
|
|
9295
9295
|
name: await bundleName(id),
|
|
9296
9296
|
id
|
|
9297
9297
|
};
|
|
9298
9298
|
}
|
|
9299
|
-
if (
|
|
9299
|
+
if (V.platform === "linux") {
|
|
9300
9300
|
const { stdout } = await execFileAsync("xdg-mime", [
|
|
9301
9301
|
"query",
|
|
9302
9302
|
"default",
|
|
@@ -9308,18 +9308,18 @@ async function defaultBrowser() {
|
|
|
9308
9308
|
id
|
|
9309
9309
|
};
|
|
9310
9310
|
}
|
|
9311
|
-
if (
|
|
9311
|
+
if (V.platform === "win32") return defaultBrowser$1();
|
|
9312
9312
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
9313
9313
|
}
|
|
9314
9314
|
//#endregion
|
|
9315
9315
|
//#region ../../node_modules/.pnpm/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
|
|
9316
|
-
const isInSsh = Boolean(
|
|
9316
|
+
const isInSsh = Boolean(V.env.SSH_CONNECTION || V.env.SSH_CLIENT || V.env.SSH_TTY);
|
|
9317
9317
|
//#endregion
|
|
9318
9318
|
//#region ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
|
|
9319
9319
|
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
9320
9320
|
const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
9321
9321
|
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
9322
|
-
const { platform: platform$1, arch: arch$1 } =
|
|
9322
|
+
const { platform: platform$1, arch: arch$1 } = V;
|
|
9323
9323
|
const tryEachApp = async (apps, opener) => {
|
|
9324
9324
|
if (apps.length === 0) return;
|
|
9325
9325
|
const errors = [];
|
|
@@ -9432,7 +9432,7 @@ const baseOpen = async (options) => {
|
|
|
9432
9432
|
await fs$1.access(localXdgOpenPath, constants.X_OK);
|
|
9433
9433
|
exeLocalXdgOpen = true;
|
|
9434
9434
|
} catch {}
|
|
9435
|
-
command =
|
|
9435
|
+
command = V.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
|
|
9436
9436
|
}
|
|
9437
9437
|
if (appArguments.length > 0) cliArguments.push(...appArguments);
|
|
9438
9438
|
if (!options.wait) {
|
|
@@ -11024,7 +11024,7 @@ var ht$1 = class extends m {
|
|
|
11024
11024
|
//#endregion
|
|
11025
11025
|
//#region ../../node_modules/.pnpm/@clack+prompts@1.4.0/node_modules/@clack/prompts/dist/index.mjs
|
|
11026
11026
|
function ee() {
|
|
11027
|
-
return
|
|
11027
|
+
return V.platform !== "win32" ? V.env.TERM !== "linux" : !!V.env.CI || !!V.env.WT_SESSION || !!V.env.TERMINUS_SUBLIME || V.env.ConEmuTask === "{cmd::Cmder}" || V.env.TERM_PROGRAM === "Terminus-Sublime" || V.env.TERM_PROGRAM === "vscode" || V.env.TERM === "xterm-256color" || V.env.TERM === "alacritty" || V.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
11028
11028
|
}
|
|
11029
11029
|
const tt = ee(), w = (t, i) => tt ? t : i, Tt = w("◆", "*"), at = w("■", "x"), ut = w("▲", "x"), H = w("◇", "o");
|
|
11030
11030
|
const $ = w("│", "|"), x = w("└", "—");
|
|
@@ -12618,7 +12618,7 @@ function customAlphabet(alphabet, size = 21) {
|
|
|
12618
12618
|
return customRandom(alphabet, size, random);
|
|
12619
12619
|
}
|
|
12620
12620
|
//#endregion
|
|
12621
|
-
//#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.15.
|
|
12621
|
+
//#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.15.9/node_modules/@haklex/rich-litexml/dist/src-z3l9E6En.js
|
|
12622
12622
|
var impl = null;
|
|
12623
12623
|
function registerParseHTML(fn) {
|
|
12624
12624
|
impl = fn;
|
|
@@ -24956,7 +24956,7 @@ function Document() {
|
|
|
24956
24956
|
}
|
|
24957
24957
|
setPrototypeOf(Document, Document$1).prototype = Document$1.prototype;
|
|
24958
24958
|
//#endregion
|
|
24959
|
-
//#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.15.
|
|
24959
|
+
//#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.15.9/node_modules/@haklex/rich-litexml/dist/node.mjs
|
|
24960
24960
|
registerParseHTML((html) => parseHTML(html).document);
|
|
24961
24961
|
//#endregion
|
|
24962
24962
|
//#region src/services/Renderer/content.ts
|
|
@@ -28188,10 +28188,10 @@ function refreshOnce(auth, config, resolved, currentToken) {
|
|
|
28188
28188
|
});
|
|
28189
28189
|
}
|
|
28190
28190
|
const create$4 = make$13("create", {
|
|
28191
|
-
name: text$
|
|
28192
|
-
slug: text$
|
|
28191
|
+
name: text$2("name"),
|
|
28192
|
+
slug: text$2("slug"),
|
|
28193
28193
|
type: choice("type", ["category", "tag"]).pipe(optional$2),
|
|
28194
|
-
icon: text$
|
|
28194
|
+
icon: text$2("icon").pipe(optional$2)
|
|
28195
28195
|
}, ({ name, slug, type, icon }) => gen(function* () {
|
|
28196
28196
|
const body = {
|
|
28197
28197
|
name,
|
|
@@ -28394,7 +28394,7 @@ var Resolver = class Resolver extends Tag$2("Resolver")() {
|
|
|
28394
28394
|
}));
|
|
28395
28395
|
};
|
|
28396
28396
|
const del$5 = make$13("delete", {
|
|
28397
|
-
slugOrId: text$
|
|
28397
|
+
slugOrId: text$4({ name: "slugOrId" }),
|
|
28398
28398
|
force: boolean("force")
|
|
28399
28399
|
}, ({ slugOrId, force }) => gen(function* () {
|
|
28400
28400
|
if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
|
|
@@ -28404,7 +28404,7 @@ const del$5 = make$13("delete", {
|
|
|
28404
28404
|
yield* api.request(`/categories/${id}`, { method: "DELETE" });
|
|
28405
28405
|
yield* renderer.emitSuccess({ deleted: id });
|
|
28406
28406
|
}));
|
|
28407
|
-
const get$7 = make$13("get", { slugOrId: text$
|
|
28407
|
+
const get$7 = make$13("get", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
28408
28408
|
const api = yield* Api;
|
|
28409
28409
|
const renderer = yield* Renderer;
|
|
28410
28410
|
const res = yield* api.request(`/categories/${encodeURIComponent(slugOrId)}`);
|
|
@@ -28419,11 +28419,11 @@ const list$7 = make$13("list", {}, () => gen(function* () {
|
|
|
28419
28419
|
yield* renderer.emitSuccess(res);
|
|
28420
28420
|
}));
|
|
28421
28421
|
const update$4 = make$13("update", {
|
|
28422
|
-
slugOrId: text$
|
|
28423
|
-
name: text$
|
|
28424
|
-
slug: text$
|
|
28422
|
+
slugOrId: text$4({ name: "slugOrId" }),
|
|
28423
|
+
name: text$2("name").pipe(optional$2),
|
|
28424
|
+
slug: text$2("slug").pipe(optional$2),
|
|
28425
28425
|
type: choice("type", ["category", "tag"]).pipe(optional$2),
|
|
28426
|
-
icon: text$
|
|
28426
|
+
icon: text$2("icon").pipe(optional$2)
|
|
28427
28427
|
}, ({ slugOrId, name, slug, type, icon }) => gen(function* () {
|
|
28428
28428
|
const body = {};
|
|
28429
28429
|
const n = getOrUndefined(name);
|
|
@@ -28552,6 +28552,13 @@ const makeService$1 = (api) => {
|
|
|
28552
28552
|
return requestList(opts.state ?? "unread", opts.page, opts.size);
|
|
28553
28553
|
},
|
|
28554
28554
|
get: (id) => api.request(`/comments/${id}`),
|
|
28555
|
+
reply: (parentId, body) => api.request(`/comments/owner-reply/${parentId}`, {
|
|
28556
|
+
method: "POST",
|
|
28557
|
+
body: {
|
|
28558
|
+
text: body.text,
|
|
28559
|
+
...body.isWhispers !== void 0 ? { isWhispers: body.isWhispers } : {}
|
|
28560
|
+
}
|
|
28561
|
+
}),
|
|
28555
28562
|
approve: (ids) => patchBatchState({
|
|
28556
28563
|
ids: [...ids],
|
|
28557
28564
|
state: stateToCode.read
|
|
@@ -28584,7 +28591,7 @@ var Comment = class Comment extends Tag$2("Comment")() {
|
|
|
28584
28591
|
};
|
|
28585
28592
|
//#endregion
|
|
28586
28593
|
//#region src/cli/comment/_flags.ts
|
|
28587
|
-
const ids = text$
|
|
28594
|
+
const ids = text$4({ name: "id" }).pipe(repeated);
|
|
28588
28595
|
const all$1 = boolean("all").pipe(withDescription$3("apply to every comment (optionally filtered by --state)"));
|
|
28589
28596
|
const force$6 = boolean("force").pipe(withDescription$3("skip TTY confirmation guard"));
|
|
28590
28597
|
const stateFilter = choice("state", [
|
|
@@ -28808,7 +28815,7 @@ const commentListView = {
|
|
|
28808
28815
|
readable: (data, ctx) => renderCommentListReadable(data, ctx.color),
|
|
28809
28816
|
llm: (data) => renderCommentListLlm(data)
|
|
28810
28817
|
};
|
|
28811
|
-
const get$6 = make$13("get", { id: text$
|
|
28818
|
+
const get$6 = make$13("get", { id: text$4({ name: "id" }) }, ({ id }) => gen(function* () {
|
|
28812
28819
|
const comment = yield* Comment;
|
|
28813
28820
|
const renderer = yield* Renderer;
|
|
28814
28821
|
const res = yield* comment.get(id);
|
|
@@ -28857,6 +28864,87 @@ const reject = make$13("reject", {
|
|
|
28857
28864
|
yield* renderer.emitSuccess({ rejected: ids });
|
|
28858
28865
|
}
|
|
28859
28866
|
})).pipe(withDescription("mark comments as junk; pass ids or --all [--state <s>]"));
|
|
28867
|
+
//#endregion
|
|
28868
|
+
//#region src/domain/content-spec.ts
|
|
28869
|
+
const messageOf$2 = (err) => {
|
|
28870
|
+
if (err instanceof Error) return err.message;
|
|
28871
|
+
if (typeof err === "string") return err;
|
|
28872
|
+
return String(err);
|
|
28873
|
+
};
|
|
28874
|
+
/**
|
|
28875
|
+
* Resolve a content spec — one of:
|
|
28876
|
+
* - `undefined` → returns `null`
|
|
28877
|
+
* - `"-"` or `"stdin"` → reads stdin
|
|
28878
|
+
* - `"file=<path>"` → reads that file (relative to cwd)
|
|
28879
|
+
* - any other value → inline literal
|
|
28880
|
+
*/
|
|
28881
|
+
const readContentSpec = (spec, opts = {}) => gen(function* () {
|
|
28882
|
+
if (spec === void 0) return null;
|
|
28883
|
+
if (spec === "-" || spec === "stdin") return {
|
|
28884
|
+
text: yield* readStdin,
|
|
28885
|
+
origin: "stdin"
|
|
28886
|
+
};
|
|
28887
|
+
if (spec.startsWith("file=")) {
|
|
28888
|
+
const path = yield* Path$1;
|
|
28889
|
+
const fs = yield* FileSystem;
|
|
28890
|
+
const p = path.resolve(opts.cwd ?? process.cwd(), spec.slice(5));
|
|
28891
|
+
return {
|
|
28892
|
+
text: yield* fs.readFileString(p).pipe(mapError((err) => new ValidationFailed({ message: `failed to read ${p}: ${messageOf$2(err)}` }))),
|
|
28893
|
+
origin: "file",
|
|
28894
|
+
path: p
|
|
28895
|
+
};
|
|
28896
|
+
}
|
|
28897
|
+
return {
|
|
28898
|
+
text: spec,
|
|
28899
|
+
origin: "inline"
|
|
28900
|
+
};
|
|
28901
|
+
});
|
|
28902
|
+
const readJsonSpec = (spec) => gen(function* () {
|
|
28903
|
+
if (spec === void 0) return void 0;
|
|
28904
|
+
if (spec.startsWith("file=")) {
|
|
28905
|
+
const path = yield* Path$1;
|
|
28906
|
+
const fs = yield* FileSystem;
|
|
28907
|
+
const p = path.resolve(process.cwd(), spec.slice(5));
|
|
28908
|
+
const text = yield* fs.readFileString(p).pipe(mapError((err) => new ValidationFailed({ message: `failed to read JSON from ${p}: ${messageOf$2(err)}` })));
|
|
28909
|
+
return yield* try_({
|
|
28910
|
+
try: () => JSON.parse(text),
|
|
28911
|
+
catch: (err) => new ValidationFailed({ message: `failed to parse JSON: ${messageOf$2(err)}` })
|
|
28912
|
+
});
|
|
28913
|
+
}
|
|
28914
|
+
return yield* try_({
|
|
28915
|
+
try: () => JSON.parse(spec),
|
|
28916
|
+
catch: (err) => new ValidationFailed({ message: `failed to parse JSON: ${messageOf$2(err)}` })
|
|
28917
|
+
});
|
|
28918
|
+
});
|
|
28919
|
+
const readStdin = gen(function* () {
|
|
28920
|
+
if (process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "requested stdin content but stdin is a TTY" }));
|
|
28921
|
+
return yield* tryPromise({
|
|
28922
|
+
try: async () => {
|
|
28923
|
+
const chunks = [];
|
|
28924
|
+
for await (const chunk of process.stdin) chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
|
|
28925
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
28926
|
+
},
|
|
28927
|
+
catch: (err) => new ValidationFailed({ message: `failed to read stdin: ${messageOf$2(err)}` })
|
|
28928
|
+
});
|
|
28929
|
+
});
|
|
28930
|
+
const reply = make$13("reply", {
|
|
28931
|
+
id: text$4({ name: "id" }),
|
|
28932
|
+
text: text$2("text").pipe(withDescription$3("reply text — inline literal, `file=<path>`, or `-`/`stdin` to read stdin"), optional$2),
|
|
28933
|
+
whispers: boolean("whispers").pipe(withDescription$3("mark this reply as whispers (owner-only visible)")),
|
|
28934
|
+
silent: boolean("silent").pipe(withDescription$3("on success, emit a minimal `ok` instead of the full server response"))
|
|
28935
|
+
}, ({ id, text, whispers, silent }) => gen(function* () {
|
|
28936
|
+
const spec = unwrapOption(text);
|
|
28937
|
+
if (spec === void 0) return yield* fail$2(new ValidationFailed({ message: "reply requires --text (inline, `file=<path>`, or `-` for stdin)" }));
|
|
28938
|
+
const body = (yield* readContentSpec(spec))?.text.trim() ?? "";
|
|
28939
|
+
if (body.length === 0) return yield* fail$2(new ValidationFailed({ message: "reply text must not be empty" }));
|
|
28940
|
+
const comment = yield* Comment;
|
|
28941
|
+
const renderer = yield* Renderer;
|
|
28942
|
+
const res = yield* comment.reply(id, {
|
|
28943
|
+
text: body,
|
|
28944
|
+
...whispers ? { isWhispers: true } : {}
|
|
28945
|
+
});
|
|
28946
|
+
yield* renderer.emitSuccess(silent ? { ok: true } : res);
|
|
28947
|
+
})).pipe(withDescription("post an owner reply to a comment; pass --text inline, --text file=<path>, or --text -"));
|
|
28860
28948
|
const unread = make$13("unread", {
|
|
28861
28949
|
page: integer("page").pipe(optional$2),
|
|
28862
28950
|
size: integer("size").pipe(optional$2)
|
|
@@ -28896,6 +28984,16 @@ const help$7 = registerCommandHelp({
|
|
|
28896
28984
|
args: ["<id>"],
|
|
28897
28985
|
description: "show a single comment"
|
|
28898
28986
|
},
|
|
28987
|
+
{
|
|
28988
|
+
name: "reply",
|
|
28989
|
+
args: [
|
|
28990
|
+
"<id>",
|
|
28991
|
+
"--text <inline|file=<path>|->",
|
|
28992
|
+
"[--whispers]",
|
|
28993
|
+
"[--silent]"
|
|
28994
|
+
],
|
|
28995
|
+
description: "post an owner reply to a comment"
|
|
28996
|
+
},
|
|
28899
28997
|
{
|
|
28900
28998
|
name: "approve",
|
|
28901
28999
|
args: [
|
|
@@ -28933,6 +29031,7 @@ const commentCmd = make$13("comment").pipe(withDescription(help$7.description),
|
|
|
28933
29031
|
list$6,
|
|
28934
29032
|
unread,
|
|
28935
29033
|
get$6,
|
|
29034
|
+
reply,
|
|
28936
29035
|
approve,
|
|
28937
29036
|
reject,
|
|
28938
29037
|
del$4
|
|
@@ -28964,7 +29063,7 @@ const edit$3 = make$13("edit", {}, () => gen(function* () {
|
|
|
28964
29063
|
});
|
|
28965
29064
|
yield* renderer.emitSuccess(results);
|
|
28966
29065
|
}));
|
|
28967
|
-
const get$5 = make$13("get", { key: text$
|
|
29066
|
+
const get$5 = make$13("get", { key: text$4({ name: "key" }) }, ({ key }) => gen(function* () {
|
|
28968
29067
|
const api = yield* Api;
|
|
28969
29068
|
const renderer = yield* Renderer;
|
|
28970
29069
|
const res = yield* api.request(`/options/${encodeURIComponent(key)}`);
|
|
@@ -28980,8 +29079,8 @@ const list$5 = make$13("list", {}, () => gen(function* () {
|
|
|
28980
29079
|
}));
|
|
28981
29080
|
//#endregion
|
|
28982
29081
|
//#region src/cli/config/set.ts
|
|
28983
|
-
const key = text$
|
|
28984
|
-
const value = text$
|
|
29082
|
+
const key = text$4({ name: "key" });
|
|
29083
|
+
const value = text$4({ name: "value" });
|
|
28985
29084
|
const type_ = choice("type", [
|
|
28986
29085
|
"json",
|
|
28987
29086
|
"string",
|
|
@@ -30166,7 +30265,7 @@ const stripDocWrapper = (xml) => {
|
|
|
30166
30265
|
if (trimmed.startsWith("<doc>") && trimmed.endsWith("</doc>")) return trimmed.slice(5, trimmed.length - 6);
|
|
30167
30266
|
return trimmed;
|
|
30168
30267
|
};
|
|
30169
|
-
const messageOf$
|
|
30268
|
+
const messageOf$1 = (err) => {
|
|
30170
30269
|
if (err instanceof Error) return err.message;
|
|
30171
30270
|
if (typeof err === "string") return err;
|
|
30172
30271
|
return String(err);
|
|
@@ -30177,7 +30276,7 @@ const makeService = () => ({
|
|
|
30177
30276
|
return deserializeFromXml(xml.includes("<doc") ? xml : `<doc>${xml}</doc>`, getRegistry());
|
|
30178
30277
|
},
|
|
30179
30278
|
catch: (err) => new ValidationXml({
|
|
30180
|
-
message: `failed to parse LiteXML: ${messageOf$
|
|
30279
|
+
message: `failed to parse LiteXML: ${messageOf$1(err)}`,
|
|
30181
30280
|
cause: err
|
|
30182
30281
|
})
|
|
30183
30282
|
}),
|
|
@@ -30186,7 +30285,7 @@ const makeService = () => ({
|
|
|
30186
30285
|
return stripDocWrapper(serializeToXml(state, getRegistry(), { compact: false })).trim();
|
|
30187
30286
|
},
|
|
30188
30287
|
catch: (err) => new ValidationXml({
|
|
30189
|
-
message: `failed to serialize Lexical state: ${messageOf$
|
|
30288
|
+
message: `failed to serialize Lexical state: ${messageOf$1(err)}`,
|
|
30190
30289
|
cause: err
|
|
30191
30290
|
})
|
|
30192
30291
|
}),
|
|
@@ -30208,7 +30307,7 @@ const makeService = () => ({
|
|
|
30208
30307
|
return markdown;
|
|
30209
30308
|
},
|
|
30210
30309
|
catch: (err) => new ValidationXml({
|
|
30211
|
-
message: `failed to render Markdown: ${messageOf$
|
|
30310
|
+
message: `failed to render Markdown: ${messageOf$1(err)}`,
|
|
30212
30311
|
cause: err
|
|
30213
30312
|
})
|
|
30214
30313
|
}),
|
|
@@ -30225,69 +30324,6 @@ var Lexical = class Lexical extends Tag$2("Lexical")() {
|
|
|
30225
30324
|
static Default = succeed$3(Lexical, makeService());
|
|
30226
30325
|
};
|
|
30227
30326
|
//#endregion
|
|
30228
|
-
//#region src/domain/content-spec.ts
|
|
30229
|
-
const messageOf$1 = (err) => {
|
|
30230
|
-
if (err instanceof Error) return err.message;
|
|
30231
|
-
if (typeof err === "string") return err;
|
|
30232
|
-
return String(err);
|
|
30233
|
-
};
|
|
30234
|
-
/**
|
|
30235
|
-
* Resolve a content spec — one of:
|
|
30236
|
-
* - `undefined` → returns `null`
|
|
30237
|
-
* - `"-"` or `"stdin"` → reads stdin
|
|
30238
|
-
* - `"file=<path>"` → reads that file (relative to cwd)
|
|
30239
|
-
* - any other value → inline literal
|
|
30240
|
-
*/
|
|
30241
|
-
const readContentSpec = (spec, opts = {}) => gen(function* () {
|
|
30242
|
-
if (spec === void 0) return null;
|
|
30243
|
-
if (spec === "-" || spec === "stdin") return {
|
|
30244
|
-
text: yield* readStdin,
|
|
30245
|
-
origin: "stdin"
|
|
30246
|
-
};
|
|
30247
|
-
if (spec.startsWith("file=")) {
|
|
30248
|
-
const path = yield* Path$1;
|
|
30249
|
-
const fs = yield* FileSystem;
|
|
30250
|
-
const p = path.resolve(opts.cwd ?? process.cwd(), spec.slice(5));
|
|
30251
|
-
return {
|
|
30252
|
-
text: yield* fs.readFileString(p).pipe(mapError((err) => new ValidationFailed({ message: `failed to read ${p}: ${messageOf$1(err)}` }))),
|
|
30253
|
-
origin: "file",
|
|
30254
|
-
path: p
|
|
30255
|
-
};
|
|
30256
|
-
}
|
|
30257
|
-
return {
|
|
30258
|
-
text: spec,
|
|
30259
|
-
origin: "inline"
|
|
30260
|
-
};
|
|
30261
|
-
});
|
|
30262
|
-
const readJsonSpec = (spec) => gen(function* () {
|
|
30263
|
-
if (spec === void 0) return void 0;
|
|
30264
|
-
if (spec.startsWith("file=")) {
|
|
30265
|
-
const path = yield* Path$1;
|
|
30266
|
-
const fs = yield* FileSystem;
|
|
30267
|
-
const p = path.resolve(process.cwd(), spec.slice(5));
|
|
30268
|
-
const text = yield* fs.readFileString(p).pipe(mapError((err) => new ValidationFailed({ message: `failed to read JSON from ${p}: ${messageOf$1(err)}` })));
|
|
30269
|
-
return yield* try_({
|
|
30270
|
-
try: () => JSON.parse(text),
|
|
30271
|
-
catch: (err) => new ValidationFailed({ message: `failed to parse JSON: ${messageOf$1(err)}` })
|
|
30272
|
-
});
|
|
30273
|
-
}
|
|
30274
|
-
return yield* try_({
|
|
30275
|
-
try: () => JSON.parse(spec),
|
|
30276
|
-
catch: (err) => new ValidationFailed({ message: `failed to parse JSON: ${messageOf$1(err)}` })
|
|
30277
|
-
});
|
|
30278
|
-
});
|
|
30279
|
-
const readStdin = gen(function* () {
|
|
30280
|
-
if (process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "requested stdin content but stdin is a TTY" }));
|
|
30281
|
-
return yield* tryPromise({
|
|
30282
|
-
try: async () => {
|
|
30283
|
-
const chunks = [];
|
|
30284
|
-
for await (const chunk of process.stdin) chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
|
|
30285
|
-
return Buffer.concat(chunks).toString("utf8");
|
|
30286
|
-
},
|
|
30287
|
-
catch: (err) => new ValidationFailed({ message: `failed to read stdin: ${messageOf$1(err)}` })
|
|
30288
|
-
});
|
|
30289
|
-
});
|
|
30290
|
-
//#endregion
|
|
30291
30327
|
//#region src/domain/envelope.ts
|
|
30292
30328
|
const ROOT_TAGS = {
|
|
30293
30329
|
post: "mxpost",
|
|
@@ -30754,20 +30790,20 @@ const resolveContent = (flagSpec, envelope, format) => gen(function* () {
|
|
|
30754
30790
|
//#region src/cli/post/_flags.ts
|
|
30755
30791
|
const optional$1 = (self) => optional$2(self);
|
|
30756
30792
|
const unwrap$4 = (value) => getOrUndefined(value);
|
|
30757
|
-
const title$2 = optional$1(text$
|
|
30758
|
-
const slug$4 = optional$1(text$
|
|
30759
|
-
const category = optional$1(text$
|
|
30760
|
-
const content$2 = optional$1(text$
|
|
30761
|
-
const summary = optional$1(text$
|
|
30762
|
-
const file$2 = optional$1(text$
|
|
30763
|
-
const meta$2 = optional$1(text$
|
|
30764
|
-
const pin = optional$1(text$
|
|
30793
|
+
const title$2 = optional$1(text$2("title"));
|
|
30794
|
+
const slug$4 = optional$1(text$2("slug"));
|
|
30795
|
+
const category = optional$1(text$2("category"));
|
|
30796
|
+
const content$2 = optional$1(text$2("content"));
|
|
30797
|
+
const summary = optional$1(text$2("summary"));
|
|
30798
|
+
const file$2 = optional$1(text$2("file"));
|
|
30799
|
+
const meta$2 = optional$1(text$2("meta"));
|
|
30800
|
+
const pin = optional$1(text$2("pin"));
|
|
30765
30801
|
const format$2 = choice("format", ["lexical", "markdown"]).pipe(optional$2);
|
|
30766
30802
|
const state$3 = choice("state", ["publish", "draft"]).pipe(optional$2);
|
|
30767
|
-
const tags = optional$1(text$
|
|
30768
|
-
const related = optional$1(text$
|
|
30803
|
+
const tags = optional$1(text$2("tags"));
|
|
30804
|
+
const related = optional$1(text$2("related"));
|
|
30769
30805
|
const pinOrder = optional$1(integer("pin-order"));
|
|
30770
|
-
const copyright = optional$1(text$
|
|
30806
|
+
const copyright = optional$1(text$2("copyright"));
|
|
30771
30807
|
const openFlag$2 = boolean("open").pipe(withDescription$3("After success, open the admin edit page in the default browser."));
|
|
30772
30808
|
const silentFlag$2 = boolean("silent").pipe(withDescription$3("On success, emit a minimal `ok` instead of the full server response (saves output tokens). Errors still print normally."));
|
|
30773
30809
|
const parseCsv = (v) => {
|
|
@@ -30828,20 +30864,20 @@ const extractId = (res) => {
|
|
|
30828
30864
|
//#region src/cli/note/_flags.ts
|
|
30829
30865
|
const optional = (self) => optional$2(self);
|
|
30830
30866
|
const unwrap$3 = (value) => getOrUndefined(value);
|
|
30831
|
-
const title$1 = optional(text$
|
|
30832
|
-
const slug$3 = optional(text$
|
|
30833
|
-
const topic = optional(text$
|
|
30834
|
-
const content$1 = optional(text$
|
|
30835
|
-
const mood = optional(text$
|
|
30836
|
-
const weather = optional(text$
|
|
30837
|
-
const publicAt = optional(text$
|
|
30838
|
-
const password = optional(text$
|
|
30839
|
-
const coords = optional(text$
|
|
30840
|
-
const location$1 = optional(text$
|
|
30841
|
-
const images = optional(text$
|
|
30842
|
-
const meta$1 = optional(text$
|
|
30843
|
-
const file$1 = optional(text$
|
|
30844
|
-
const bookmark = optional(text$
|
|
30867
|
+
const title$1 = optional(text$2("title"));
|
|
30868
|
+
const slug$3 = optional(text$2("slug"));
|
|
30869
|
+
const topic = optional(text$2("topic"));
|
|
30870
|
+
const content$1 = optional(text$2("content"));
|
|
30871
|
+
const mood = optional(text$2("mood"));
|
|
30872
|
+
const weather = optional(text$2("weather"));
|
|
30873
|
+
const publicAt = optional(text$2("public-at"));
|
|
30874
|
+
const password = optional(text$2("password"));
|
|
30875
|
+
const coords = optional(text$2("coords"));
|
|
30876
|
+
const location$1 = optional(text$2("location"));
|
|
30877
|
+
const images = optional(text$2("images"));
|
|
30878
|
+
const meta$1 = optional(text$2("meta"));
|
|
30879
|
+
const file$1 = optional(text$2("file"));
|
|
30880
|
+
const bookmark = optional(text$2("bookmark"));
|
|
30845
30881
|
const noteWriteOptions = {
|
|
30846
30882
|
title: title$1,
|
|
30847
30883
|
slug: slug$3,
|
|
@@ -30906,7 +30942,7 @@ const create$3 = make$13("create", noteWriteOptions, (opts) => gen(function* ()
|
|
|
30906
30942
|
}
|
|
30907
30943
|
})).pipe(withDescription("create a note"));
|
|
30908
30944
|
const del$3 = make$13("delete", {
|
|
30909
|
-
slugOrId: text$
|
|
30945
|
+
slugOrId: text$4({ name: "slugOrId" }),
|
|
30910
30946
|
force: boolean("force").pipe(withDescription$3("skip confirmation"))
|
|
30911
30947
|
}, ({ slugOrId, force }) => gen(function* () {
|
|
30912
30948
|
if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
|
|
@@ -30919,7 +30955,7 @@ const del$3 = make$13("delete", {
|
|
|
30919
30955
|
})).pipe(withDescription("delete a note"));
|
|
30920
30956
|
//#endregion
|
|
30921
30957
|
//#region src/cli/note/edit.ts
|
|
30922
|
-
const slugOrId$17 = text$
|
|
30958
|
+
const slugOrId$17 = text$4({ name: "slugOrId" });
|
|
30923
30959
|
const esc = (s) => s.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
30924
30960
|
const materializeForEditor$2 = (slugOrId) => gen(function* () {
|
|
30925
30961
|
const api = yield* Api;
|
|
@@ -31087,7 +31123,7 @@ const noteView = {
|
|
|
31087
31123
|
});
|
|
31088
31124
|
}
|
|
31089
31125
|
};
|
|
31090
|
-
const get$4 = make$13("get", { slugOrId: text$
|
|
31126
|
+
const get$4 = make$13("get", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31091
31127
|
const api = yield* Api;
|
|
31092
31128
|
const renderer = yield* Renderer;
|
|
31093
31129
|
if (isSnowflakeId(slugOrId)) {
|
|
@@ -31109,8 +31145,8 @@ const get$4 = make$13("get", { slugOrId: text$3({ name: "slugOrId" }) }, ({ slug
|
|
|
31109
31145
|
//#region src/cli/note/list.ts
|
|
31110
31146
|
const page$1 = integer("page").pipe(optional$2);
|
|
31111
31147
|
const size$1 = integer("size").pipe(optional$2);
|
|
31112
|
-
const state$1 = text$
|
|
31113
|
-
const sort$1 = text$
|
|
31148
|
+
const state$1 = text$2("state").pipe(optional$2);
|
|
31149
|
+
const sort$1 = text$2("sort").pipe(optional$2);
|
|
31114
31150
|
const unwrap$2 = (value) => getOrUndefined(value);
|
|
31115
31151
|
const list$4 = make$13("list", {
|
|
31116
31152
|
page: page$1,
|
|
@@ -31127,7 +31163,7 @@ const list$4 = make$13("list", {
|
|
|
31127
31163
|
} });
|
|
31128
31164
|
yield* renderer.emitSuccess(res);
|
|
31129
31165
|
})).pipe(withDescription("list notes"));
|
|
31130
|
-
const publish$1 = make$13("publish", { slugOrId: text$
|
|
31166
|
+
const publish$1 = make$13("publish", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31131
31167
|
const resolver = yield* Resolver;
|
|
31132
31168
|
const api = yield* Api;
|
|
31133
31169
|
const renderer = yield* Renderer;
|
|
@@ -31138,7 +31174,7 @@ const publish$1 = make$13("publish", { slugOrId: text$3({ name: "slugOrId" }) },
|
|
|
31138
31174
|
});
|
|
31139
31175
|
yield* renderer.emitSuccess(res);
|
|
31140
31176
|
})).pipe(withDescription("publish a note"));
|
|
31141
|
-
const unpublish$1 = make$13("unpublish", { slugOrId: text$
|
|
31177
|
+
const unpublish$1 = make$13("unpublish", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31142
31178
|
const resolver = yield* Resolver;
|
|
31143
31179
|
const api = yield* Api;
|
|
31144
31180
|
const renderer = yield* Renderer;
|
|
@@ -31150,7 +31186,7 @@ const unpublish$1 = make$13("unpublish", { slugOrId: text$3({ name: "slugOrId" }
|
|
|
31150
31186
|
yield* renderer.emitSuccess(res);
|
|
31151
31187
|
})).pipe(withDescription("unpublish a note"));
|
|
31152
31188
|
const update$3 = make$13("update", {
|
|
31153
|
-
slugOrId: text$
|
|
31189
|
+
slugOrId: text$4({ name: "slugOrId" }),
|
|
31154
31190
|
...noteWriteOptions
|
|
31155
31191
|
}, ({ slugOrId, ...rest }) => gen(function* () {
|
|
31156
31192
|
const flags = toNoteFlagInputs(rest);
|
|
@@ -31247,14 +31283,14 @@ const noteCmd = make$13("note").pipe(withDescription(help$5.description), withSu
|
|
|
31247
31283
|
unpublish$1
|
|
31248
31284
|
]));
|
|
31249
31285
|
const pageWriteOptions = {
|
|
31250
|
-
title: optional$2(text$
|
|
31251
|
-
slug: optional$2(text$
|
|
31252
|
-
subtitle: optional$2(text$
|
|
31286
|
+
title: optional$2(text$2("title")),
|
|
31287
|
+
slug: optional$2(text$2("slug")),
|
|
31288
|
+
subtitle: optional$2(text$2("subtitle")),
|
|
31253
31289
|
order: optional$2(integer("order")),
|
|
31254
|
-
content: optional$2(text$
|
|
31290
|
+
content: optional$2(text$2("content")),
|
|
31255
31291
|
format: choice("format", ["lexical", "markdown"]).pipe(optional$2),
|
|
31256
|
-
meta: optional$2(text$
|
|
31257
|
-
file: optional$2(text$
|
|
31292
|
+
meta: optional$2(text$2("meta")),
|
|
31293
|
+
file: optional$2(text$2("file")),
|
|
31258
31294
|
open: boolean("open").pipe(withDescription$3("After success, open the admin edit page in the default browser.")),
|
|
31259
31295
|
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."))
|
|
31260
31296
|
};
|
|
@@ -31285,7 +31321,7 @@ const create$2 = make$13("create", pageWriteOptions, (opts) => gen(function* ()
|
|
|
31285
31321
|
}));
|
|
31286
31322
|
//#endregion
|
|
31287
31323
|
//#region src/cli/page/delete.ts
|
|
31288
|
-
const slugOrId$12 = text$
|
|
31324
|
+
const slugOrId$12 = text$4({ name: "slugOrId" });
|
|
31289
31325
|
const force$4 = boolean("force");
|
|
31290
31326
|
const resolvePageId$2 = (api, ref) => gen(function* () {
|
|
31291
31327
|
if (isSnowflakeId(ref)) return ref;
|
|
@@ -31311,7 +31347,7 @@ const del$2 = make$13("delete", {
|
|
|
31311
31347
|
}));
|
|
31312
31348
|
//#endregion
|
|
31313
31349
|
//#region src/cli/page/edit.ts
|
|
31314
|
-
const slugOrId$11 = text$
|
|
31350
|
+
const slugOrId$11 = text$4({ name: "slugOrId" });
|
|
31315
31351
|
const escapeXml$1 = (s) => s.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
31316
31352
|
const resolvePageId$1 = (api, ref) => gen(function* () {
|
|
31317
31353
|
if (isSnowflakeId(ref)) return ref;
|
|
@@ -31470,7 +31506,7 @@ const pageView = {
|
|
|
31470
31506
|
});
|
|
31471
31507
|
}
|
|
31472
31508
|
};
|
|
31473
|
-
const get$3 = make$13("get", { slugOrId: text$
|
|
31509
|
+
const get$3 = make$13("get", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31474
31510
|
const api = yield* Api;
|
|
31475
31511
|
const renderer = yield* Renderer;
|
|
31476
31512
|
const path = isSnowflakeId(slugOrId) ? `/pages/${slugOrId}` : `/pages/slug/${encodeURIComponent(slugOrId)}`;
|
|
@@ -31487,7 +31523,7 @@ const list$3 = make$13("list", {}, () => gen(function* () {
|
|
|
31487
31523
|
}));
|
|
31488
31524
|
//#endregion
|
|
31489
31525
|
//#region src/cli/page/update.ts
|
|
31490
|
-
const slugOrId$9 = text$
|
|
31526
|
+
const slugOrId$9 = text$4({ name: "slugOrId" });
|
|
31491
31527
|
const resolvePageId = (api, ref) => gen(function* () {
|
|
31492
31528
|
if (isSnowflakeId(ref)) return ref;
|
|
31493
31529
|
const res = yield* api.request(`/pages/slug/${encodeURIComponent(ref)}`).pipe(catchAll(() => succeed$1(null)));
|
|
@@ -31594,7 +31630,7 @@ const create$1 = make$13("create", postWriteOptions, (opts) => gen(function* ()
|
|
|
31594
31630
|
}
|
|
31595
31631
|
})).pipe(withDescription("create a post"));
|
|
31596
31632
|
const del$1 = make$13("delete", {
|
|
31597
|
-
slugOrId: text$
|
|
31633
|
+
slugOrId: text$4({ name: "slugOrId" }),
|
|
31598
31634
|
force: boolean("force").pipe(withDescription$3("skip confirmation"))
|
|
31599
31635
|
}, ({ slugOrId, force }) => gen(function* () {
|
|
31600
31636
|
if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
|
|
@@ -31607,7 +31643,7 @@ const del$1 = make$13("delete", {
|
|
|
31607
31643
|
})).pipe(withDescription("delete a post"));
|
|
31608
31644
|
//#endregion
|
|
31609
31645
|
//#region src/cli/post/edit.ts
|
|
31610
|
-
const slugOrId$7 = text$
|
|
31646
|
+
const slugOrId$7 = text$4({ name: "slugOrId" });
|
|
31611
31647
|
const escapeXml = (s) => s.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
31612
31648
|
const materializeForEditor = (slugOrId) => gen(function* () {
|
|
31613
31649
|
const api = yield* Api;
|
|
@@ -31818,7 +31854,7 @@ const postListView = {
|
|
|
31818
31854
|
modes: new Set(["readable", "llm"]),
|
|
31819
31855
|
readable: (data) => renderPostListReadable(data)
|
|
31820
31856
|
};
|
|
31821
|
-
const get$2 = make$13("get", { slugOrId: text$
|
|
31857
|
+
const get$2 = make$13("get", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31822
31858
|
const api = yield* Api;
|
|
31823
31859
|
const renderer = yield* Renderer;
|
|
31824
31860
|
const path = yield* (yield* Resolver).resolvePostReadPath(slugOrId);
|
|
@@ -31848,7 +31884,7 @@ const list$2 = make$13("list", {
|
|
|
31848
31884
|
} });
|
|
31849
31885
|
yield* renderer.emit(postListView, res);
|
|
31850
31886
|
})).pipe(withDescription("list posts"));
|
|
31851
|
-
const publish = make$13("publish", { slugOrId: text$
|
|
31887
|
+
const publish = make$13("publish", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31852
31888
|
const resolver = yield* Resolver;
|
|
31853
31889
|
const api = yield* Api;
|
|
31854
31890
|
const renderer = yield* Renderer;
|
|
@@ -31859,7 +31895,7 @@ const publish = make$13("publish", { slugOrId: text$3({ name: "slugOrId" }) }, (
|
|
|
31859
31895
|
});
|
|
31860
31896
|
yield* renderer.emitSuccess(res);
|
|
31861
31897
|
})).pipe(withDescription("publish a post"));
|
|
31862
|
-
const unpublish = make$13("unpublish", { slugOrId: text$
|
|
31898
|
+
const unpublish = make$13("unpublish", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31863
31899
|
const resolver = yield* Resolver;
|
|
31864
31900
|
const api = yield* Api;
|
|
31865
31901
|
const renderer = yield* Renderer;
|
|
@@ -31871,7 +31907,7 @@ const unpublish = make$13("unpublish", { slugOrId: text$3({ name: "slugOrId" })
|
|
|
31871
31907
|
yield* renderer.emitSuccess(res);
|
|
31872
31908
|
})).pipe(withDescription("unpublish a post"));
|
|
31873
31909
|
const update$1 = make$13("update", {
|
|
31874
|
-
slugOrId: text$
|
|
31910
|
+
slugOrId: text$4({ name: "slugOrId" }),
|
|
31875
31911
|
...postWriteOptions
|
|
31876
31912
|
}, ({ slugOrId, ...rest }) => gen(function* () {
|
|
31877
31913
|
const flags = toPostFlagInputs(rest);
|
|
@@ -31996,14 +32032,14 @@ registerCommandHelp({
|
|
|
31996
32032
|
}
|
|
31997
32033
|
]
|
|
31998
32034
|
});
|
|
31999
|
-
const fileArg = text$
|
|
32035
|
+
const fileArg = text$4({ name: "file" }).pipe(optional$4);
|
|
32000
32036
|
const themeOpt = choice("theme", ["light", "dark"]).pipe(optional$2);
|
|
32001
32037
|
const variantOpt = choice("variant", [
|
|
32002
32038
|
"article",
|
|
32003
32039
|
"note",
|
|
32004
32040
|
"comment"
|
|
32005
32041
|
]).pipe(optional$2);
|
|
32006
|
-
const saveOpt = text$
|
|
32042
|
+
const saveOpt = text$2("save").pipe(optional$2);
|
|
32007
32043
|
const printOpt = boolean("print").pipe(optional$2);
|
|
32008
32044
|
const openOpt = boolean("open").pipe(optional$2);
|
|
32009
32045
|
const requireFrom$3 = createRequire(import.meta.url);
|
|
@@ -32177,7 +32213,7 @@ const ls = make$13("ls", {}, () => gen(function* () {
|
|
|
32177
32213
|
yield* renderer.emit(profileListView, rows);
|
|
32178
32214
|
}));
|
|
32179
32215
|
const mark = make$13("mark", {
|
|
32180
|
-
name: text$
|
|
32216
|
+
name: text$4({ name: "name" }),
|
|
32181
32217
|
production: boolean("production", { negationNames: ["no-production"] }).pipe(optional$2)
|
|
32182
32218
|
}, ({ name, production }) => gen(function* () {
|
|
32183
32219
|
const profile = yield* Profile;
|
|
@@ -32190,7 +32226,7 @@ const mark = make$13("mark", {
|
|
|
32190
32226
|
yield* renderer.emitInfo(`mxs: profile '${name}' marked with ${flag}`);
|
|
32191
32227
|
}));
|
|
32192
32228
|
const rm = make$13("rm", {
|
|
32193
|
-
name: text$
|
|
32229
|
+
name: text$4({ name: "name" }),
|
|
32194
32230
|
force: boolean("force").pipe(optional$2)
|
|
32195
32231
|
}, ({ name, force }) => gen(function* () {
|
|
32196
32232
|
const profile = yield* Profile;
|
|
@@ -32220,7 +32256,7 @@ const rm = make$13("rm", {
|
|
|
32220
32256
|
yield* renderer.emitInfo("mxs: cleared active profile pointer");
|
|
32221
32257
|
}
|
|
32222
32258
|
}));
|
|
32223
|
-
const show = make$13("show", { name: text$
|
|
32259
|
+
const show = make$13("show", { name: text$4({ name: "name" }).pipe(optional$4) }, ({ name }) => gen(function* () {
|
|
32224
32260
|
const profile = yield* Profile;
|
|
32225
32261
|
const config = yield* Config;
|
|
32226
32262
|
const renderer = yield* Renderer;
|
|
@@ -32249,7 +32285,7 @@ const show = make$13("show", { name: text$3({ name: "name" }).pipe(optional$4) }
|
|
|
32249
32285
|
authenticated: creds !== null
|
|
32250
32286
|
});
|
|
32251
32287
|
}));
|
|
32252
|
-
const use = make$13("use", { name: text$
|
|
32288
|
+
const use = make$13("use", { name: text$4({ name: "name" }) }, ({ name }) => gen(function* () {
|
|
32253
32289
|
const profile = yield* Profile;
|
|
32254
32290
|
const renderer = yield* Renderer;
|
|
32255
32291
|
yield* profile.use(name);
|
|
@@ -34498,7 +34534,7 @@ const all = make$13("all", {}, () => gen(function* () {
|
|
|
34498
34534
|
const chapters = yield* skill.all;
|
|
34499
34535
|
yield* renderer.emit(skillAllView, chapters);
|
|
34500
34536
|
}));
|
|
34501
|
-
const get$1 = make$13("get", { slug: text$
|
|
34537
|
+
const get$1 = make$13("get", { slug: text$4({ name: "slug" }) }, ({ slug }) => gen(function* () {
|
|
34502
34538
|
const skill = yield* Skill;
|
|
34503
34539
|
const renderer = yield* Renderer;
|
|
34504
34540
|
const chapter = yield* skill.get(slug);
|
|
@@ -34512,7 +34548,7 @@ const list$1 = make$13("list", {}, () => gen(function* () {
|
|
|
34512
34548
|
const chapters = yield* skill.list;
|
|
34513
34549
|
yield* renderer.emit(skillListView, chapters);
|
|
34514
34550
|
}));
|
|
34515
|
-
const search = make$13("search", { keyword: text$
|
|
34551
|
+
const search = make$13("search", { keyword: text$4({ name: "keyword" }) }, ({ keyword }) => gen(function* () {
|
|
34516
34552
|
const skill = yield* Skill;
|
|
34517
34553
|
const renderer = yield* Renderer;
|
|
34518
34554
|
const hits = yield* skill.search(keyword);
|
|
@@ -34556,10 +34592,10 @@ const skillCmd = make$13("skill", {}, () => gen(function* () {
|
|
|
34556
34592
|
search
|
|
34557
34593
|
]));
|
|
34558
34594
|
const create = make$13("create", {
|
|
34559
|
-
name: text$
|
|
34560
|
-
slug: text$
|
|
34561
|
-
description: text$
|
|
34562
|
-
icon: text$
|
|
34595
|
+
name: text$2("name"),
|
|
34596
|
+
slug: text$2("slug"),
|
|
34597
|
+
description: text$2("description").pipe(optional$2),
|
|
34598
|
+
icon: text$2("icon").pipe(optional$2)
|
|
34563
34599
|
}, ({ name, slug, description, icon }) => gen(function* () {
|
|
34564
34600
|
const body = {
|
|
34565
34601
|
name,
|
|
@@ -34579,7 +34615,7 @@ const create = make$13("create", {
|
|
|
34579
34615
|
}));
|
|
34580
34616
|
//#endregion
|
|
34581
34617
|
//#region src/cli/topic/delete.ts
|
|
34582
|
-
const slugOrId$2 = text$
|
|
34618
|
+
const slugOrId$2 = text$4({ name: "slugOrId" });
|
|
34583
34619
|
const force$1 = boolean("force");
|
|
34584
34620
|
const resolveTopicId$1 = (api, ref) => gen(function* () {
|
|
34585
34621
|
if (isSnowflakeId(ref)) return ref;
|
|
@@ -34603,7 +34639,7 @@ const del = make$13("delete", {
|
|
|
34603
34639
|
yield* api.request(`/topics/${id}`, { method: "DELETE" });
|
|
34604
34640
|
yield* renderer.emitSuccess({ deleted: id });
|
|
34605
34641
|
}));
|
|
34606
|
-
const get = make$13("get", { slugOrId: text$
|
|
34642
|
+
const get = make$13("get", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
34607
34643
|
const api = yield* Api;
|
|
34608
34644
|
const renderer = yield* Renderer;
|
|
34609
34645
|
const path = isSnowflakeId(slugOrId) ? `/topics/${slugOrId}` : `/topics/slug/${encodeURIComponent(slugOrId)}`;
|
|
@@ -34620,11 +34656,11 @@ const list = make$13("list", {}, () => gen(function* () {
|
|
|
34620
34656
|
}));
|
|
34621
34657
|
//#endregion
|
|
34622
34658
|
//#region src/cli/topic/update.ts
|
|
34623
|
-
const slugOrId = text$
|
|
34624
|
-
const name = text$
|
|
34625
|
-
const slug = text$
|
|
34626
|
-
const description = text$
|
|
34627
|
-
const icon = text$
|
|
34659
|
+
const slugOrId = text$4({ name: "slugOrId" });
|
|
34660
|
+
const name = text$2("name").pipe(optional$2);
|
|
34661
|
+
const slug = text$2("slug").pipe(optional$2);
|
|
34662
|
+
const description = text$2("description").pipe(optional$2);
|
|
34663
|
+
const icon = text$2("icon").pipe(optional$2);
|
|
34628
34664
|
const resolveTopicId = (api, ref) => gen(function* () {
|
|
34629
34665
|
if (isSnowflakeId(ref)) return ref;
|
|
34630
34666
|
const res = yield* api.request(`/topics/slug/${encodeURIComponent(ref)}`).pipe(catchAll(() => succeed$1(null)));
|