@mx-space/cli 0.7.5 → 0.7.7
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 +19 -0
- package/dist/bin/mxs.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{mxs-BI2QVW9I.mjs → mxs-vbxEu09D.mjs} +359 -271
- package/package.json +2 -2
|
@@ -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),
|
|
@@ -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,59 @@ const noteView = {
|
|
|
31087
31123
|
});
|
|
31088
31124
|
}
|
|
31089
31125
|
};
|
|
31090
|
-
const
|
|
31126
|
+
const collectListItemFields$1 = (doc, articleMeta) => {
|
|
31127
|
+
const meta = articleMeta ?? {};
|
|
31128
|
+
return [
|
|
31129
|
+
["id", first(doc, "id")],
|
|
31130
|
+
["nid", first(doc, "nid")],
|
|
31131
|
+
["title", first(doc, "title")],
|
|
31132
|
+
["slug", first(doc, "slug")],
|
|
31133
|
+
["state", publishState(doc)],
|
|
31134
|
+
["topic", relationLabel(first(doc, "topic"))],
|
|
31135
|
+
["mood", first(doc, "mood")],
|
|
31136
|
+
["weather", first(doc, "weather")],
|
|
31137
|
+
["bookmark", first(doc, "bookmark")],
|
|
31138
|
+
["summary", first(doc, "summary")],
|
|
31139
|
+
["public_at", first(doc, "public_at", "publicAt")],
|
|
31140
|
+
["created_at", first(doc, "created_at", "createdAt")],
|
|
31141
|
+
["modified_at", first(doc, "modified_at", "modifiedAt")],
|
|
31142
|
+
["source_lang", first(doc, "source_lang", "sourceLang") ?? first(meta, "source_lang", "sourceLang")],
|
|
31143
|
+
["translated", first(doc, "is_translated", "isTranslated") ?? first(meta, "is_translated", "isTranslated")]
|
|
31144
|
+
];
|
|
31145
|
+
};
|
|
31146
|
+
const renderNoteListReadable = (data) => {
|
|
31147
|
+
const payload = asRecord(data);
|
|
31148
|
+
const rows = Array.isArray(payload.data) ? payload.data : Array.isArray(data) ? data : [];
|
|
31149
|
+
const pagination = asRecord(first(asRecord(first(payload, "meta")), "pagination"));
|
|
31150
|
+
const lines = ["notes"];
|
|
31151
|
+
if (rows.length > 0) lines.push(`count: ${rows.length}`);
|
|
31152
|
+
else lines.push("count: 0");
|
|
31153
|
+
const page = first(pagination, "page", "currentPage");
|
|
31154
|
+
const size = first(pagination, "size", "pageSize");
|
|
31155
|
+
const total = first(pagination, "total", "totalCount", "total_count");
|
|
31156
|
+
if (page !== void 0) lines.push(`page: ${formatScalar(page)}`);
|
|
31157
|
+
if (size !== void 0) lines.push(`size: ${formatScalar(size)}`);
|
|
31158
|
+
if (total !== void 0) lines.push(`total: ${formatScalar(total)}`);
|
|
31159
|
+
rows.forEach((row, index) => {
|
|
31160
|
+
const doc = asRecord(row);
|
|
31161
|
+
const articleMeta = pickArticleTranslationMeta(data, first(doc, "id"));
|
|
31162
|
+
lines.push("", `note ${index + 1}:`);
|
|
31163
|
+
const fields = collectListItemFields$1(doc, articleMeta);
|
|
31164
|
+
for (const [key, value] of fields) {
|
|
31165
|
+
if (value === void 0 || value === null || value === "") continue;
|
|
31166
|
+
if (key === "translated" && value === false) continue;
|
|
31167
|
+
const rendered = tryFormatTimestamp(value, { style: "rel" }) ?? formatScalar(value);
|
|
31168
|
+
lines.push(`${key}: ${rendered}`);
|
|
31169
|
+
}
|
|
31170
|
+
});
|
|
31171
|
+
return lines.join("\n");
|
|
31172
|
+
};
|
|
31173
|
+
const noteListView = {
|
|
31174
|
+
kind: "note-list",
|
|
31175
|
+
modes: new Set(["readable", "llm"]),
|
|
31176
|
+
readable: (data) => renderNoteListReadable(data)
|
|
31177
|
+
};
|
|
31178
|
+
const get$4 = make$13("get", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31091
31179
|
const api = yield* Api;
|
|
31092
31180
|
const renderer = yield* Renderer;
|
|
31093
31181
|
if (isSnowflakeId(slugOrId)) {
|
|
@@ -31109,8 +31197,8 @@ const get$4 = make$13("get", { slugOrId: text$3({ name: "slugOrId" }) }, ({ slug
|
|
|
31109
31197
|
//#region src/cli/note/list.ts
|
|
31110
31198
|
const page$1 = integer("page").pipe(optional$2);
|
|
31111
31199
|
const size$1 = integer("size").pipe(optional$2);
|
|
31112
|
-
const state$1 = text$
|
|
31113
|
-
const sort$1 = text$
|
|
31200
|
+
const state$1 = text$2("state").pipe(optional$2);
|
|
31201
|
+
const sort$1 = text$2("sort").pipe(optional$2);
|
|
31114
31202
|
const unwrap$2 = (value) => getOrUndefined(value);
|
|
31115
31203
|
const list$4 = make$13("list", {
|
|
31116
31204
|
page: page$1,
|
|
@@ -31125,9 +31213,9 @@ const list$4 = make$13("list", {
|
|
|
31125
31213
|
size: unwrap$2(size),
|
|
31126
31214
|
sortBy: unwrap$2(sort)
|
|
31127
31215
|
} });
|
|
31128
|
-
yield* renderer.
|
|
31216
|
+
yield* renderer.emit(noteListView, res);
|
|
31129
31217
|
})).pipe(withDescription("list notes"));
|
|
31130
|
-
const publish$1 = make$13("publish", { slugOrId: text$
|
|
31218
|
+
const publish$1 = make$13("publish", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31131
31219
|
const resolver = yield* Resolver;
|
|
31132
31220
|
const api = yield* Api;
|
|
31133
31221
|
const renderer = yield* Renderer;
|
|
@@ -31138,7 +31226,7 @@ const publish$1 = make$13("publish", { slugOrId: text$3({ name: "slugOrId" }) },
|
|
|
31138
31226
|
});
|
|
31139
31227
|
yield* renderer.emitSuccess(res);
|
|
31140
31228
|
})).pipe(withDescription("publish a note"));
|
|
31141
|
-
const unpublish$1 = make$13("unpublish", { slugOrId: text$
|
|
31229
|
+
const unpublish$1 = make$13("unpublish", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31142
31230
|
const resolver = yield* Resolver;
|
|
31143
31231
|
const api = yield* Api;
|
|
31144
31232
|
const renderer = yield* Renderer;
|
|
@@ -31150,7 +31238,7 @@ const unpublish$1 = make$13("unpublish", { slugOrId: text$3({ name: "slugOrId" }
|
|
|
31150
31238
|
yield* renderer.emitSuccess(res);
|
|
31151
31239
|
})).pipe(withDescription("unpublish a note"));
|
|
31152
31240
|
const update$3 = make$13("update", {
|
|
31153
|
-
slugOrId: text$
|
|
31241
|
+
slugOrId: text$4({ name: "slugOrId" }),
|
|
31154
31242
|
...noteWriteOptions
|
|
31155
31243
|
}, ({ slugOrId, ...rest }) => gen(function* () {
|
|
31156
31244
|
const flags = toNoteFlagInputs(rest);
|
|
@@ -31247,14 +31335,14 @@ const noteCmd = make$13("note").pipe(withDescription(help$5.description), withSu
|
|
|
31247
31335
|
unpublish$1
|
|
31248
31336
|
]));
|
|
31249
31337
|
const pageWriteOptions = {
|
|
31250
|
-
title: optional$2(text$
|
|
31251
|
-
slug: optional$2(text$
|
|
31252
|
-
subtitle: optional$2(text$
|
|
31338
|
+
title: optional$2(text$2("title")),
|
|
31339
|
+
slug: optional$2(text$2("slug")),
|
|
31340
|
+
subtitle: optional$2(text$2("subtitle")),
|
|
31253
31341
|
order: optional$2(integer("order")),
|
|
31254
|
-
content: optional$2(text$
|
|
31342
|
+
content: optional$2(text$2("content")),
|
|
31255
31343
|
format: choice("format", ["lexical", "markdown"]).pipe(optional$2),
|
|
31256
|
-
meta: optional$2(text$
|
|
31257
|
-
file: optional$2(text$
|
|
31344
|
+
meta: optional$2(text$2("meta")),
|
|
31345
|
+
file: optional$2(text$2("file")),
|
|
31258
31346
|
open: boolean("open").pipe(withDescription$3("After success, open the admin edit page in the default browser.")),
|
|
31259
31347
|
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
31348
|
};
|
|
@@ -31285,7 +31373,7 @@ const create$2 = make$13("create", pageWriteOptions, (opts) => gen(function* ()
|
|
|
31285
31373
|
}));
|
|
31286
31374
|
//#endregion
|
|
31287
31375
|
//#region src/cli/page/delete.ts
|
|
31288
|
-
const slugOrId$12 = text$
|
|
31376
|
+
const slugOrId$12 = text$4({ name: "slugOrId" });
|
|
31289
31377
|
const force$4 = boolean("force");
|
|
31290
31378
|
const resolvePageId$2 = (api, ref) => gen(function* () {
|
|
31291
31379
|
if (isSnowflakeId(ref)) return ref;
|
|
@@ -31311,7 +31399,7 @@ const del$2 = make$13("delete", {
|
|
|
31311
31399
|
}));
|
|
31312
31400
|
//#endregion
|
|
31313
31401
|
//#region src/cli/page/edit.ts
|
|
31314
|
-
const slugOrId$11 = text$
|
|
31402
|
+
const slugOrId$11 = text$4({ name: "slugOrId" });
|
|
31315
31403
|
const escapeXml$1 = (s) => s.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
31316
31404
|
const resolvePageId$1 = (api, ref) => gen(function* () {
|
|
31317
31405
|
if (isSnowflakeId(ref)) return ref;
|
|
@@ -31470,7 +31558,7 @@ const pageView = {
|
|
|
31470
31558
|
});
|
|
31471
31559
|
}
|
|
31472
31560
|
};
|
|
31473
|
-
const get$3 = make$13("get", { slugOrId: text$
|
|
31561
|
+
const get$3 = make$13("get", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31474
31562
|
const api = yield* Api;
|
|
31475
31563
|
const renderer = yield* Renderer;
|
|
31476
31564
|
const path = isSnowflakeId(slugOrId) ? `/pages/${slugOrId}` : `/pages/slug/${encodeURIComponent(slugOrId)}`;
|
|
@@ -31487,7 +31575,7 @@ const list$3 = make$13("list", {}, () => gen(function* () {
|
|
|
31487
31575
|
}));
|
|
31488
31576
|
//#endregion
|
|
31489
31577
|
//#region src/cli/page/update.ts
|
|
31490
|
-
const slugOrId$9 = text$
|
|
31578
|
+
const slugOrId$9 = text$4({ name: "slugOrId" });
|
|
31491
31579
|
const resolvePageId = (api, ref) => gen(function* () {
|
|
31492
31580
|
if (isSnowflakeId(ref)) return ref;
|
|
31493
31581
|
const res = yield* api.request(`/pages/slug/${encodeURIComponent(ref)}`).pipe(catchAll(() => succeed$1(null)));
|
|
@@ -31594,7 +31682,7 @@ const create$1 = make$13("create", postWriteOptions, (opts) => gen(function* ()
|
|
|
31594
31682
|
}
|
|
31595
31683
|
})).pipe(withDescription("create a post"));
|
|
31596
31684
|
const del$1 = make$13("delete", {
|
|
31597
|
-
slugOrId: text$
|
|
31685
|
+
slugOrId: text$4({ name: "slugOrId" }),
|
|
31598
31686
|
force: boolean("force").pipe(withDescription$3("skip confirmation"))
|
|
31599
31687
|
}, ({ slugOrId, force }) => gen(function* () {
|
|
31600
31688
|
if (!force && !process.stdin.isTTY) return yield* fail$2(new ValidationFailed({ message: "refusing to delete without --force in non-TTY context" }));
|
|
@@ -31607,7 +31695,7 @@ const del$1 = make$13("delete", {
|
|
|
31607
31695
|
})).pipe(withDescription("delete a post"));
|
|
31608
31696
|
//#endregion
|
|
31609
31697
|
//#region src/cli/post/edit.ts
|
|
31610
|
-
const slugOrId$7 = text$
|
|
31698
|
+
const slugOrId$7 = text$4({ name: "slugOrId" });
|
|
31611
31699
|
const escapeXml = (s) => s.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
31612
31700
|
const materializeForEditor = (slugOrId) => gen(function* () {
|
|
31613
31701
|
const api = yield* Api;
|
|
@@ -31818,7 +31906,7 @@ const postListView = {
|
|
|
31818
31906
|
modes: new Set(["readable", "llm"]),
|
|
31819
31907
|
readable: (data) => renderPostListReadable(data)
|
|
31820
31908
|
};
|
|
31821
|
-
const get$2 = make$13("get", { slugOrId: text$
|
|
31909
|
+
const get$2 = make$13("get", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31822
31910
|
const api = yield* Api;
|
|
31823
31911
|
const renderer = yield* Renderer;
|
|
31824
31912
|
const path = yield* (yield* Resolver).resolvePostReadPath(slugOrId);
|
|
@@ -31848,7 +31936,7 @@ const list$2 = make$13("list", {
|
|
|
31848
31936
|
} });
|
|
31849
31937
|
yield* renderer.emit(postListView, res);
|
|
31850
31938
|
})).pipe(withDescription("list posts"));
|
|
31851
|
-
const publish = make$13("publish", { slugOrId: text$
|
|
31939
|
+
const publish = make$13("publish", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31852
31940
|
const resolver = yield* Resolver;
|
|
31853
31941
|
const api = yield* Api;
|
|
31854
31942
|
const renderer = yield* Renderer;
|
|
@@ -31859,7 +31947,7 @@ const publish = make$13("publish", { slugOrId: text$3({ name: "slugOrId" }) }, (
|
|
|
31859
31947
|
});
|
|
31860
31948
|
yield* renderer.emitSuccess(res);
|
|
31861
31949
|
})).pipe(withDescription("publish a post"));
|
|
31862
|
-
const unpublish = make$13("unpublish", { slugOrId: text$
|
|
31950
|
+
const unpublish = make$13("unpublish", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
31863
31951
|
const resolver = yield* Resolver;
|
|
31864
31952
|
const api = yield* Api;
|
|
31865
31953
|
const renderer = yield* Renderer;
|
|
@@ -31871,7 +31959,7 @@ const unpublish = make$13("unpublish", { slugOrId: text$3({ name: "slugOrId" })
|
|
|
31871
31959
|
yield* renderer.emitSuccess(res);
|
|
31872
31960
|
})).pipe(withDescription("unpublish a post"));
|
|
31873
31961
|
const update$1 = make$13("update", {
|
|
31874
|
-
slugOrId: text$
|
|
31962
|
+
slugOrId: text$4({ name: "slugOrId" }),
|
|
31875
31963
|
...postWriteOptions
|
|
31876
31964
|
}, ({ slugOrId, ...rest }) => gen(function* () {
|
|
31877
31965
|
const flags = toPostFlagInputs(rest);
|
|
@@ -31996,14 +32084,14 @@ registerCommandHelp({
|
|
|
31996
32084
|
}
|
|
31997
32085
|
]
|
|
31998
32086
|
});
|
|
31999
|
-
const fileArg = text$
|
|
32087
|
+
const fileArg = text$4({ name: "file" }).pipe(optional$4);
|
|
32000
32088
|
const themeOpt = choice("theme", ["light", "dark"]).pipe(optional$2);
|
|
32001
32089
|
const variantOpt = choice("variant", [
|
|
32002
32090
|
"article",
|
|
32003
32091
|
"note",
|
|
32004
32092
|
"comment"
|
|
32005
32093
|
]).pipe(optional$2);
|
|
32006
|
-
const saveOpt = text$
|
|
32094
|
+
const saveOpt = text$2("save").pipe(optional$2);
|
|
32007
32095
|
const printOpt = boolean("print").pipe(optional$2);
|
|
32008
32096
|
const openOpt = boolean("open").pipe(optional$2);
|
|
32009
32097
|
const requireFrom$3 = createRequire(import.meta.url);
|
|
@@ -32177,7 +32265,7 @@ const ls = make$13("ls", {}, () => gen(function* () {
|
|
|
32177
32265
|
yield* renderer.emit(profileListView, rows);
|
|
32178
32266
|
}));
|
|
32179
32267
|
const mark = make$13("mark", {
|
|
32180
|
-
name: text$
|
|
32268
|
+
name: text$4({ name: "name" }),
|
|
32181
32269
|
production: boolean("production", { negationNames: ["no-production"] }).pipe(optional$2)
|
|
32182
32270
|
}, ({ name, production }) => gen(function* () {
|
|
32183
32271
|
const profile = yield* Profile;
|
|
@@ -32190,7 +32278,7 @@ const mark = make$13("mark", {
|
|
|
32190
32278
|
yield* renderer.emitInfo(`mxs: profile '${name}' marked with ${flag}`);
|
|
32191
32279
|
}));
|
|
32192
32280
|
const rm = make$13("rm", {
|
|
32193
|
-
name: text$
|
|
32281
|
+
name: text$4({ name: "name" }),
|
|
32194
32282
|
force: boolean("force").pipe(optional$2)
|
|
32195
32283
|
}, ({ name, force }) => gen(function* () {
|
|
32196
32284
|
const profile = yield* Profile;
|
|
@@ -32220,7 +32308,7 @@ const rm = make$13("rm", {
|
|
|
32220
32308
|
yield* renderer.emitInfo("mxs: cleared active profile pointer");
|
|
32221
32309
|
}
|
|
32222
32310
|
}));
|
|
32223
|
-
const show = make$13("show", { name: text$
|
|
32311
|
+
const show = make$13("show", { name: text$4({ name: "name" }).pipe(optional$4) }, ({ name }) => gen(function* () {
|
|
32224
32312
|
const profile = yield* Profile;
|
|
32225
32313
|
const config = yield* Config;
|
|
32226
32314
|
const renderer = yield* Renderer;
|
|
@@ -32249,7 +32337,7 @@ const show = make$13("show", { name: text$3({ name: "name" }).pipe(optional$4) }
|
|
|
32249
32337
|
authenticated: creds !== null
|
|
32250
32338
|
});
|
|
32251
32339
|
}));
|
|
32252
|
-
const use = make$13("use", { name: text$
|
|
32340
|
+
const use = make$13("use", { name: text$4({ name: "name" }) }, ({ name }) => gen(function* () {
|
|
32253
32341
|
const profile = yield* Profile;
|
|
32254
32342
|
const renderer = yield* Renderer;
|
|
32255
32343
|
yield* profile.use(name);
|
|
@@ -34498,7 +34586,7 @@ const all = make$13("all", {}, () => gen(function* () {
|
|
|
34498
34586
|
const chapters = yield* skill.all;
|
|
34499
34587
|
yield* renderer.emit(skillAllView, chapters);
|
|
34500
34588
|
}));
|
|
34501
|
-
const get$1 = make$13("get", { slug: text$
|
|
34589
|
+
const get$1 = make$13("get", { slug: text$4({ name: "slug" }) }, ({ slug }) => gen(function* () {
|
|
34502
34590
|
const skill = yield* Skill;
|
|
34503
34591
|
const renderer = yield* Renderer;
|
|
34504
34592
|
const chapter = yield* skill.get(slug);
|
|
@@ -34512,7 +34600,7 @@ const list$1 = make$13("list", {}, () => gen(function* () {
|
|
|
34512
34600
|
const chapters = yield* skill.list;
|
|
34513
34601
|
yield* renderer.emit(skillListView, chapters);
|
|
34514
34602
|
}));
|
|
34515
|
-
const search = make$13("search", { keyword: text$
|
|
34603
|
+
const search = make$13("search", { keyword: text$4({ name: "keyword" }) }, ({ keyword }) => gen(function* () {
|
|
34516
34604
|
const skill = yield* Skill;
|
|
34517
34605
|
const renderer = yield* Renderer;
|
|
34518
34606
|
const hits = yield* skill.search(keyword);
|
|
@@ -34556,10 +34644,10 @@ const skillCmd = make$13("skill", {}, () => gen(function* () {
|
|
|
34556
34644
|
search
|
|
34557
34645
|
]));
|
|
34558
34646
|
const create = make$13("create", {
|
|
34559
|
-
name: text$
|
|
34560
|
-
slug: text$
|
|
34561
|
-
description: text$
|
|
34562
|
-
icon: text$
|
|
34647
|
+
name: text$2("name"),
|
|
34648
|
+
slug: text$2("slug"),
|
|
34649
|
+
description: text$2("description").pipe(optional$2),
|
|
34650
|
+
icon: text$2("icon").pipe(optional$2)
|
|
34563
34651
|
}, ({ name, slug, description, icon }) => gen(function* () {
|
|
34564
34652
|
const body = {
|
|
34565
34653
|
name,
|
|
@@ -34579,7 +34667,7 @@ const create = make$13("create", {
|
|
|
34579
34667
|
}));
|
|
34580
34668
|
//#endregion
|
|
34581
34669
|
//#region src/cli/topic/delete.ts
|
|
34582
|
-
const slugOrId$2 = text$
|
|
34670
|
+
const slugOrId$2 = text$4({ name: "slugOrId" });
|
|
34583
34671
|
const force$1 = boolean("force");
|
|
34584
34672
|
const resolveTopicId$1 = (api, ref) => gen(function* () {
|
|
34585
34673
|
if (isSnowflakeId(ref)) return ref;
|
|
@@ -34603,7 +34691,7 @@ const del = make$13("delete", {
|
|
|
34603
34691
|
yield* api.request(`/topics/${id}`, { method: "DELETE" });
|
|
34604
34692
|
yield* renderer.emitSuccess({ deleted: id });
|
|
34605
34693
|
}));
|
|
34606
|
-
const get = make$13("get", { slugOrId: text$
|
|
34694
|
+
const get = make$13("get", { slugOrId: text$4({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
|
|
34607
34695
|
const api = yield* Api;
|
|
34608
34696
|
const renderer = yield* Renderer;
|
|
34609
34697
|
const path = isSnowflakeId(slugOrId) ? `/topics/${slugOrId}` : `/topics/slug/${encodeURIComponent(slugOrId)}`;
|
|
@@ -34620,11 +34708,11 @@ const list = make$13("list", {}, () => gen(function* () {
|
|
|
34620
34708
|
}));
|
|
34621
34709
|
//#endregion
|
|
34622
34710
|
//#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$
|
|
34711
|
+
const slugOrId = text$4({ name: "slugOrId" });
|
|
34712
|
+
const name = text$2("name").pipe(optional$2);
|
|
34713
|
+
const slug = text$2("slug").pipe(optional$2);
|
|
34714
|
+
const description = text$2("description").pipe(optional$2);
|
|
34715
|
+
const icon = text$2("icon").pipe(optional$2);
|
|
34628
34716
|
const resolveTopicId = (api, ref) => gen(function* () {
|
|
34629
34717
|
if (isSnowflakeId(ref)) return ref;
|
|
34630
34718
|
const res = yield* api.request(`/topics/slug/${encodeURIComponent(ref)}`).pipe(catchAll(() => succeed$1(null)));
|