@nmakarov/cli-toolkit 0.66.0 → 0.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-runner.cjs +269 -48
- package/dist/cli-runner.cjs.map +1 -1
- package/dist/cli-runner.js +263 -42
- package/dist/cli-runner.js.map +1 -1
- package/dist/index.cjs +275 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +263 -42
- package/dist/index.js.map +1 -1
- package/dist/init.cjs +255 -45
- package/dist/init.cjs.map +1 -1
- package/dist/init.js +249 -39
- package/dist/init.js.map +1 -1
- package/dist/screen.cjs +252 -47
- package/dist/screen.cjs.map +1 -1
- package/dist/screen.js +236 -39
- package/dist/screen.js.map +1 -1
- package/dist/tasks.cjs +14 -3
- package/dist/tasks.cjs.map +1 -1
- package/dist/tasks.js +14 -3
- package/dist/tasks.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -493,6 +493,59 @@ var init_list_components = __esm({
|
|
|
493
493
|
}
|
|
494
494
|
});
|
|
495
495
|
|
|
496
|
+
// src/screen/key-bindings.js
|
|
497
|
+
function bindingIdentity(b) {
|
|
498
|
+
return [
|
|
499
|
+
String(b?.key ?? ""),
|
|
500
|
+
b?.meta ? "m" : "",
|
|
501
|
+
b?.ctrl ? "c" : "",
|
|
502
|
+
b?.shift ? "s" : ""
|
|
503
|
+
].join("|");
|
|
504
|
+
}
|
|
505
|
+
function bindingMatchesInput(binding, input, key) {
|
|
506
|
+
if (!binding?.key) return false;
|
|
507
|
+
let keyMatches = false;
|
|
508
|
+
if (key?.[binding.key]) {
|
|
509
|
+
keyMatches = true;
|
|
510
|
+
} else if (input === binding.key) {
|
|
511
|
+
keyMatches = true;
|
|
512
|
+
} else if (key?.name === binding.key) {
|
|
513
|
+
keyMatches = true;
|
|
514
|
+
}
|
|
515
|
+
if (!keyMatches) return false;
|
|
516
|
+
const modOk = (flag, pressed) => {
|
|
517
|
+
if (flag === true) return !!pressed;
|
|
518
|
+
if (flag === false) return !pressed;
|
|
519
|
+
return !pressed;
|
|
520
|
+
};
|
|
521
|
+
if (!modOk(binding.meta, key?.meta)) return false;
|
|
522
|
+
if (!modOk(binding.ctrl, key?.ctrl)) return false;
|
|
523
|
+
if (binding.shift !== void 0 && !!key?.shift !== !!binding.shift) return false;
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
function formatBindingKey(binding) {
|
|
527
|
+
let label = KEY_LABELS[binding.key] || binding.key;
|
|
528
|
+
if (binding.shift) label = `\u21E7${label}`;
|
|
529
|
+
if (binding.ctrl) label = `^${label}`;
|
|
530
|
+
if (binding.meta) label = `\u2325${label}`;
|
|
531
|
+
return label;
|
|
532
|
+
}
|
|
533
|
+
var KEY_LABELS;
|
|
534
|
+
var init_key_bindings = __esm({
|
|
535
|
+
"src/screen/key-bindings.js"() {
|
|
536
|
+
KEY_LABELS = {
|
|
537
|
+
escape: "esc",
|
|
538
|
+
leftArrow: "\u2190",
|
|
539
|
+
rightArrow: "\u2192",
|
|
540
|
+
upArrow: "\u2191",
|
|
541
|
+
downArrow: "\u2193",
|
|
542
|
+
return: "enter",
|
|
543
|
+
pageUp: "PgUp",
|
|
544
|
+
pageDown: "PgDn"
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
|
|
496
549
|
// src/screen/screens.js
|
|
497
550
|
function groupKeyBindings(bindings) {
|
|
498
551
|
const groups = {};
|
|
@@ -506,7 +559,7 @@ function groupKeyBindings(bindings) {
|
|
|
506
559
|
order: binding.order || 999
|
|
507
560
|
};
|
|
508
561
|
}
|
|
509
|
-
groups[caption].keys.push(binding
|
|
562
|
+
groups[caption].keys.push(formatBindingKey(binding));
|
|
510
563
|
});
|
|
511
564
|
return Object.values(groups);
|
|
512
565
|
}
|
|
@@ -546,12 +599,14 @@ function formatKeyBindings(bindings, mode = "long") {
|
|
|
546
599
|
}
|
|
547
600
|
function formatKeys(keys) {
|
|
548
601
|
const keyMap = {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
602
|
+
escape: "esc",
|
|
603
|
+
leftArrow: "\u2190",
|
|
604
|
+
rightArrow: "\u2192",
|
|
605
|
+
upArrow: "\u2191",
|
|
606
|
+
downArrow: "\u2193",
|
|
607
|
+
return: "enter",
|
|
608
|
+
pageUp: "PgUp",
|
|
609
|
+
pageDown: "PgDn"
|
|
555
610
|
};
|
|
556
611
|
return keys.map((k) => keyMap[k] || k).join("/");
|
|
557
612
|
}
|
|
@@ -591,7 +646,10 @@ async function showScreen(config2) {
|
|
|
591
646
|
setKeyBinding: (bindingOrBindings) => {
|
|
592
647
|
const bindingsToSet = Array.isArray(bindingOrBindings) ? bindingOrBindings : [bindingOrBindings];
|
|
593
648
|
bindingsToSet.forEach((binding) => {
|
|
594
|
-
const
|
|
649
|
+
const id = bindingIdentity(binding);
|
|
650
|
+
const existingIndex = keyBindings.findIndex(
|
|
651
|
+
(b) => bindingIdentity(b) === id
|
|
652
|
+
);
|
|
595
653
|
if (existingIndex >= 0) {
|
|
596
654
|
const existing = keyBindings[existingIndex];
|
|
597
655
|
if (existing.protected) {
|
|
@@ -615,7 +673,10 @@ async function showScreen(config2) {
|
|
|
615
673
|
});
|
|
616
674
|
},
|
|
617
675
|
updateKeyBinding: (keyName, updates) => {
|
|
618
|
-
const
|
|
676
|
+
const id = updates && (updates.meta != null || updates.ctrl != null || updates.shift != null) ? bindingIdentity({ key: keyName, ...updates }) : null;
|
|
677
|
+
const index = keyBindings.findIndex(
|
|
678
|
+
(b) => id ? bindingIdentity(b) === id : b.key === keyName
|
|
679
|
+
);
|
|
619
680
|
if (index >= 0) {
|
|
620
681
|
keyBindings[index] = {
|
|
621
682
|
...keyBindings[index],
|
|
@@ -623,11 +684,13 @@ async function showScreen(config2) {
|
|
|
623
684
|
};
|
|
624
685
|
}
|
|
625
686
|
},
|
|
626
|
-
removeKeyBinding: (
|
|
627
|
-
const index = keyBindings.findIndex(
|
|
687
|
+
removeKeyBinding: (keyNameOrBinding) => {
|
|
688
|
+
const index = typeof keyNameOrBinding === "object" && keyNameOrBinding ? keyBindings.findIndex(
|
|
689
|
+
(b) => bindingIdentity(b) === bindingIdentity(keyNameOrBinding)
|
|
690
|
+
) : keyBindings.findIndex((b) => b.key === keyNameOrBinding);
|
|
628
691
|
if (index >= 0) {
|
|
629
692
|
if (keyBindings[index].protected) {
|
|
630
|
-
console.warn(`Cannot remove protected key: ${
|
|
693
|
+
console.warn(`Cannot remove protected key: ${keyNameOrBinding}`);
|
|
631
694
|
return;
|
|
632
695
|
}
|
|
633
696
|
keyBindings.splice(index, 1);
|
|
@@ -668,24 +731,11 @@ async function showScreen(config2) {
|
|
|
668
731
|
}
|
|
669
732
|
let matchedBinding = null;
|
|
670
733
|
for (const binding of keyBindings) {
|
|
671
|
-
|
|
672
|
-
if (
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
} else if (key?.name === binding.key) {
|
|
677
|
-
keyMatches = true;
|
|
678
|
-
}
|
|
679
|
-
if (keyMatches) {
|
|
680
|
-
if (binding.enabled === false) {
|
|
681
|
-
continue;
|
|
682
|
-
}
|
|
683
|
-
if (binding.condition && !binding.condition(context)) {
|
|
684
|
-
continue;
|
|
685
|
-
}
|
|
686
|
-
matchedBinding = binding;
|
|
687
|
-
break;
|
|
688
|
-
}
|
|
734
|
+
if (binding.enabled === false) continue;
|
|
735
|
+
if (!bindingMatchesInput(binding, input, key)) continue;
|
|
736
|
+
if (binding.condition && !binding.condition(context)) continue;
|
|
737
|
+
matchedBinding = binding;
|
|
738
|
+
break;
|
|
689
739
|
}
|
|
690
740
|
if (matchedBinding && actions[matchedBinding.action]) {
|
|
691
741
|
actions[matchedBinding.action]({
|
|
@@ -823,6 +873,7 @@ var init_screens = __esm({
|
|
|
823
873
|
import_ink3 = require("ink");
|
|
824
874
|
init_components();
|
|
825
875
|
init_list_components();
|
|
876
|
+
init_key_bindings();
|
|
826
877
|
showMenuScreen = showListScreen;
|
|
827
878
|
showWordGridScreen = showMultiColumnListScreen;
|
|
828
879
|
}
|
|
@@ -913,6 +964,157 @@ var init_ui_elements = __esm({
|
|
|
913
964
|
}
|
|
914
965
|
});
|
|
915
966
|
|
|
967
|
+
// src/screen/scrollable-text.js
|
|
968
|
+
function wrapTextLines(text, cols) {
|
|
969
|
+
const w = Math.max(1, Math.floor(Number(cols) || 1));
|
|
970
|
+
const out = [];
|
|
971
|
+
for (const raw of String(text ?? "").split("\n")) {
|
|
972
|
+
if (raw.length === 0) {
|
|
973
|
+
out.push("");
|
|
974
|
+
continue;
|
|
975
|
+
}
|
|
976
|
+
let rest = raw;
|
|
977
|
+
while (rest.length > w) {
|
|
978
|
+
out.push(rest.slice(0, w));
|
|
979
|
+
rest = rest.slice(w);
|
|
980
|
+
}
|
|
981
|
+
if (rest.length > 0) out.push(rest);
|
|
982
|
+
}
|
|
983
|
+
return out;
|
|
984
|
+
}
|
|
985
|
+
function scrollbarGlyphs(viewportRows, totalLines, scrollTop) {
|
|
986
|
+
const view = Math.max(1, Math.floor(viewportRows));
|
|
987
|
+
const total = Math.max(0, Math.floor(totalLines));
|
|
988
|
+
if (total <= view) return null;
|
|
989
|
+
const maxScroll = total - view;
|
|
990
|
+
const thumbSize = Math.max(1, Math.round(view / total * view));
|
|
991
|
+
const travel = Math.max(0, view - thumbSize);
|
|
992
|
+
const s = Math.min(Math.max(0, Math.floor(scrollTop)), maxScroll);
|
|
993
|
+
const thumbStart = maxScroll === 0 ? 0 : Math.round(s / maxScroll * travel);
|
|
994
|
+
const glyphs = [];
|
|
995
|
+
for (let i = 0; i < view; i++) {
|
|
996
|
+
glyphs.push(i >= thumbStart && i < thumbStart + thumbSize ? "\u2588" : "\u2502");
|
|
997
|
+
}
|
|
998
|
+
return glyphs;
|
|
999
|
+
}
|
|
1000
|
+
function padEndVisible(s, w) {
|
|
1001
|
+
const t = String(s ?? "");
|
|
1002
|
+
if (t.length >= w) return t.slice(0, w);
|
|
1003
|
+
return t + " ".repeat(w - t.length);
|
|
1004
|
+
}
|
|
1005
|
+
function ScrollableText({
|
|
1006
|
+
ctx,
|
|
1007
|
+
text = "",
|
|
1008
|
+
lines: linesProp,
|
|
1009
|
+
maxHeight,
|
|
1010
|
+
wrap = true,
|
|
1011
|
+
showScrollbar = true,
|
|
1012
|
+
showStatus = true,
|
|
1013
|
+
bindKeys = true,
|
|
1014
|
+
header = null
|
|
1015
|
+
}) {
|
|
1016
|
+
const [scrollTop, setScrollTop] = (0, import_react5.useState)(0);
|
|
1017
|
+
const [, bump] = (0, import_react5.useState)(0);
|
|
1018
|
+
const termCols = process.stdout.columns || 80;
|
|
1019
|
+
const termRows = process.stdout.rows || 24;
|
|
1020
|
+
const viewportRows = Math.max(
|
|
1021
|
+
4,
|
|
1022
|
+
maxHeight != null ? Math.floor(maxHeight) : Math.max(8, termRows - 8)
|
|
1023
|
+
);
|
|
1024
|
+
const provisionalBar = showScrollbar ? 1 : 0;
|
|
1025
|
+
const wrapCols = Math.max(8, termCols - provisionalBar);
|
|
1026
|
+
const allLines = (0, import_react5.useMemo)(() => {
|
|
1027
|
+
if (Array.isArray(linesProp)) return linesProp.map((l) => String(l ?? ""));
|
|
1028
|
+
return wrap ? wrapTextLines(text, wrapCols) : String(text ?? "").split("\n");
|
|
1029
|
+
}, [linesProp, text, wrap, wrapCols]);
|
|
1030
|
+
const needsBar = showScrollbar && allLines.length > viewportRows;
|
|
1031
|
+
const textWidth = Math.max(8, termCols - (needsBar ? 1 : 0));
|
|
1032
|
+
const maxScroll = Math.max(0, allLines.length - viewportRows);
|
|
1033
|
+
const clamped = Math.min(Math.max(0, scrollTop), maxScroll);
|
|
1034
|
+
const visible = allLines.slice(clamped, clamped + viewportRows);
|
|
1035
|
+
const bar = needsBar ? scrollbarGlyphs(viewportRows, allLines.length, clamped) : null;
|
|
1036
|
+
(0, import_react5.useEffect)(() => {
|
|
1037
|
+
setScrollTop((s) => Math.min(s, maxScroll));
|
|
1038
|
+
}, [maxScroll]);
|
|
1039
|
+
const maxScrollRef = (0, import_react5.useRef)(maxScroll);
|
|
1040
|
+
const pageSizeRef = (0, import_react5.useRef)(viewportRows);
|
|
1041
|
+
maxScrollRef.current = maxScroll;
|
|
1042
|
+
pageSizeRef.current = viewportRows;
|
|
1043
|
+
(0, import_react5.useEffect)(() => {
|
|
1044
|
+
if (!ctx || !bindKeys) return void 0;
|
|
1045
|
+
ctx.setKeyBinding(SCROLL_KEYS);
|
|
1046
|
+
ctx.setAction("scrollUp", () => {
|
|
1047
|
+
setScrollTop((s) => Math.max(0, s - 1));
|
|
1048
|
+
bump((n) => n + 1);
|
|
1049
|
+
ctx.update?.();
|
|
1050
|
+
});
|
|
1051
|
+
ctx.setAction("scrollDown", () => {
|
|
1052
|
+
setScrollTop((s) => Math.min(maxScrollRef.current, s + 1));
|
|
1053
|
+
bump((n) => n + 1);
|
|
1054
|
+
ctx.update?.();
|
|
1055
|
+
});
|
|
1056
|
+
ctx.setAction("pageUp", () => {
|
|
1057
|
+
setScrollTop((s) => Math.max(0, s - pageSizeRef.current));
|
|
1058
|
+
bump((n) => n + 1);
|
|
1059
|
+
ctx.update?.();
|
|
1060
|
+
});
|
|
1061
|
+
ctx.setAction("pageDown", () => {
|
|
1062
|
+
setScrollTop((s) => Math.min(maxScrollRef.current, s + pageSizeRef.current));
|
|
1063
|
+
bump((n) => n + 1);
|
|
1064
|
+
ctx.update?.();
|
|
1065
|
+
});
|
|
1066
|
+
return void 0;
|
|
1067
|
+
}, [ctx, bindKeys]);
|
|
1068
|
+
const status = allLines.length === 0 ? "empty" : `lines ${clamped + 1}-${Math.min(clamped + visible.length, allLines.length)} of ${allLines.length}` + (needsBar ? " \xB7 \u2325\u2191/\u2193 or PgUp/Dn page" : "");
|
|
1069
|
+
const rowNodes = visible.map((line, i) => {
|
|
1070
|
+
const body = padEndVisible(line, textWidth);
|
|
1071
|
+
const glyph = bar ? bar[i] ?? "\u2502" : "";
|
|
1072
|
+
return h5(
|
|
1073
|
+
import_ink5.Box,
|
|
1074
|
+
{ key: `L${clamped + i}`, flexDirection: "row" },
|
|
1075
|
+
h5(import_ink5.Text, {}, body),
|
|
1076
|
+
glyph ? h5(import_ink5.Text, { color: bar[i] === "\u2588" ? "cyan" : "gray" }, glyph) : null
|
|
1077
|
+
);
|
|
1078
|
+
});
|
|
1079
|
+
if (bar && visible.length < viewportRows) {
|
|
1080
|
+
for (let i = visible.length; i < viewportRows; i++) {
|
|
1081
|
+
rowNodes.push(
|
|
1082
|
+
h5(
|
|
1083
|
+
import_ink5.Box,
|
|
1084
|
+
{ key: `pad${i}`, flexDirection: "row" },
|
|
1085
|
+
h5(import_ink5.Text, {}, padEndVisible("", textWidth)),
|
|
1086
|
+
h5(import_ink5.Text, { color: bar[i] === "\u2588" ? "cyan" : "gray" }, bar[i] ?? "\u2502")
|
|
1087
|
+
)
|
|
1088
|
+
);
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
return h5(
|
|
1092
|
+
import_ink5.Box,
|
|
1093
|
+
{ flexDirection: "column" },
|
|
1094
|
+
header == null ? null : typeof header === "string" ? h5(import_ink5.Text, { color: "gray" }, header) : header,
|
|
1095
|
+
showStatus ? h5(import_ink5.Text, { color: "gray" }, status) : null,
|
|
1096
|
+
...rowNodes
|
|
1097
|
+
);
|
|
1098
|
+
}
|
|
1099
|
+
var import_react5, import_ink5, h5, SCROLL_KEYS;
|
|
1100
|
+
var init_scrollable_text = __esm({
|
|
1101
|
+
"src/screen/scrollable-text.js"() {
|
|
1102
|
+
import_react5 = require("react");
|
|
1103
|
+
import_ink5 = require("ink");
|
|
1104
|
+
h5 = import_react5.createElement;
|
|
1105
|
+
SCROLL_KEYS = [
|
|
1106
|
+
{ key: "upArrow", caption: "scroll", action: "scrollUp", order: 0 },
|
|
1107
|
+
{ key: "downArrow", caption: "scroll", action: "scrollDown", order: 0 },
|
|
1108
|
+
{ key: "upArrow", meta: true, caption: "page", action: "pageUp", order: 0 },
|
|
1109
|
+
{ key: "downArrow", meta: true, caption: "page", action: "pageDown", order: 0 },
|
|
1110
|
+
{ key: "upArrow", ctrl: true, caption: "page", action: "pageUp", order: 0 },
|
|
1111
|
+
{ key: "downArrow", ctrl: true, caption: "page", action: "pageDown", order: 0 },
|
|
1112
|
+
{ key: "pageUp", caption: "page", action: "pageUp", order: 0 },
|
|
1113
|
+
{ key: "pageDown", caption: "page", action: "pageDown", order: 0 }
|
|
1114
|
+
];
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
|
|
916
1118
|
// src/screen/utils.js
|
|
917
1119
|
function buildBreadcrumb(parts) {
|
|
918
1120
|
if (parts.length === 0) return "";
|
|
@@ -1048,15 +1250,17 @@ async function load() {
|
|
|
1048
1250
|
loadPromise = Promise.resolve();
|
|
1049
1251
|
return loadPromise;
|
|
1050
1252
|
}
|
|
1051
|
-
var
|
|
1253
|
+
var import_react6, import_ink6, loadPromise;
|
|
1052
1254
|
var init_screen = __esm({
|
|
1053
1255
|
"src/screen/index.js"() {
|
|
1054
|
-
|
|
1055
|
-
|
|
1256
|
+
import_react6 = __toESM(require("react"), 1);
|
|
1257
|
+
import_ink6 = require("ink");
|
|
1056
1258
|
init_screens();
|
|
1057
1259
|
init_list_components();
|
|
1058
1260
|
init_components();
|
|
1059
1261
|
init_ui_elements();
|
|
1262
|
+
init_scrollable_text();
|
|
1263
|
+
init_key_bindings();
|
|
1060
1264
|
init_utils();
|
|
1061
1265
|
init_footer_builder();
|
|
1062
1266
|
loadPromise = null;
|
|
@@ -1073,7 +1277,7 @@ __export(src_exports, {
|
|
|
1073
1277
|
AbstractTask: () => AbstractTask,
|
|
1074
1278
|
Args: () => Args,
|
|
1075
1279
|
Aws: () => Aws,
|
|
1076
|
-
Box: () =>
|
|
1280
|
+
Box: () => import_ink6.Box,
|
|
1077
1281
|
Db: () => Db,
|
|
1078
1282
|
Divider: () => Divider,
|
|
1079
1283
|
FileDatabase: () => FileDatabase,
|
|
@@ -1089,7 +1293,7 @@ __export(src_exports, {
|
|
|
1089
1293
|
MultiColumnListWithPreviewComponent: () => MultiColumnListWithPreviewComponent,
|
|
1090
1294
|
Params: () => Params,
|
|
1091
1295
|
REMOTE_CLI_REL: () => REMOTE_CLI_REL,
|
|
1092
|
-
React: () =>
|
|
1296
|
+
React: () => import_react6.default,
|
|
1093
1297
|
S3: () => S3,
|
|
1094
1298
|
SERVICE_TASK_NAMES: () => SERVICE_TASK_NAMES,
|
|
1095
1299
|
ScreenBody: () => ScreenBody,
|
|
@@ -1098,6 +1302,7 @@ __export(src_exports, {
|
|
|
1098
1302
|
ScreenFooter: () => ScreenFooter,
|
|
1099
1303
|
ScreenRow: () => ScreenRow,
|
|
1100
1304
|
ScreenTitle: () => ScreenTitle,
|
|
1305
|
+
ScrollableText: () => ScrollableText,
|
|
1101
1306
|
TaskGetLogs: () => TaskGetLogs,
|
|
1102
1307
|
TaskPing: () => TaskPing,
|
|
1103
1308
|
TaskSampleProcess: () => TaskSampleProcess,
|
|
@@ -1108,13 +1313,15 @@ __export(src_exports, {
|
|
|
1108
1313
|
TaskSystemInfo: () => TaskSystemInfo,
|
|
1109
1314
|
TasksManager: () => TasksManager,
|
|
1110
1315
|
TasksRegistry: () => TasksRegistry,
|
|
1111
|
-
Text: () =>
|
|
1316
|
+
Text: () => import_ink6.Text,
|
|
1112
1317
|
TextBlock: () => TextBlock,
|
|
1113
1318
|
activateRelease: () => activateRelease,
|
|
1114
1319
|
appendDeployLog: () => appendDeployLog,
|
|
1115
1320
|
appendTaskIpcLog: () => appendTaskIpcLog,
|
|
1116
1321
|
applyRuntimeParam: () => applyRuntimeParam,
|
|
1117
1322
|
applyRuntimePatch: () => applyRuntimePatch,
|
|
1323
|
+
bindingIdentity: () => bindingIdentity,
|
|
1324
|
+
bindingMatchesInput: () => bindingMatchesInput,
|
|
1118
1325
|
bootstrapHost: () => bootstrapHost,
|
|
1119
1326
|
buildBreadcrumb: () => buildBreadcrumb,
|
|
1120
1327
|
buildDetailBreadcrumb: () => buildDetailBreadcrumb,
|
|
@@ -1147,9 +1354,10 @@ __export(src_exports, {
|
|
|
1147
1354
|
ensureTaskTables: () => ensureTaskTables,
|
|
1148
1355
|
ensureTasksRuntime: () => ensureTasksRuntime,
|
|
1149
1356
|
flushTaskIpcLogs: () => flushTaskIpcLogs,
|
|
1357
|
+
formatBindingKey: () => formatBindingKey,
|
|
1150
1358
|
getArgsInstance: () => getArgsInstance,
|
|
1151
1359
|
getPm2Process: () => getPm2Process,
|
|
1152
|
-
h: () =>
|
|
1360
|
+
h: () => import_react6.createElement,
|
|
1153
1361
|
initServiceStructure: () => initServiceStructure,
|
|
1154
1362
|
installDeps: () => installDeps,
|
|
1155
1363
|
installOperatorShell: () => installOperatorShell,
|
|
@@ -1166,7 +1374,7 @@ __export(src_exports, {
|
|
|
1166
1374
|
load: () => load,
|
|
1167
1375
|
loadServices: () => loadServices,
|
|
1168
1376
|
matchesParsedPattern: () => matchesParsedPattern,
|
|
1169
|
-
memo: () =>
|
|
1377
|
+
memo: () => import_react6.memo,
|
|
1170
1378
|
mergeAllowedTasksWithServiceTasks: () => mergeAllowedTasksWithServiceTasks,
|
|
1171
1379
|
nextTimeMatch: () => nextTimeMatch,
|
|
1172
1380
|
normalizeAllowedTasks: () => normalizeAllowedTasks,
|
|
@@ -1204,6 +1412,7 @@ __export(src_exports, {
|
|
|
1204
1412
|
runRemoteStatus: () => runRemoteStatus,
|
|
1205
1413
|
runShell: () => runShell,
|
|
1206
1414
|
runTasksLoop: () => runTasksLoop,
|
|
1415
|
+
scrollbarGlyphs: () => scrollbarGlyphs,
|
|
1207
1416
|
scrubEnvContent: () => scrubEnvContent,
|
|
1208
1417
|
servicePaths: () => servicePaths,
|
|
1209
1418
|
setupContext: () => setupContext,
|
|
@@ -1226,15 +1435,16 @@ __export(src_exports, {
|
|
|
1226
1435
|
unregisterServicesRegistry: () => unregisterServicesRegistry,
|
|
1227
1436
|
updateServicesRegistryMetadata: () => updateServicesRegistryMetadata,
|
|
1228
1437
|
updateTaskProgress: () => updateTaskProgress,
|
|
1229
|
-
useCallback: () =>
|
|
1230
|
-
useEffect: () =>
|
|
1231
|
-
useInput: () =>
|
|
1232
|
-
useLayoutEffect: () =>
|
|
1233
|
-
useMemo: () =>
|
|
1234
|
-
useRef: () =>
|
|
1235
|
-
useState: () =>
|
|
1438
|
+
useCallback: () => import_react6.useCallback,
|
|
1439
|
+
useEffect: () => import_react6.useEffect,
|
|
1440
|
+
useInput: () => import_ink6.useInput,
|
|
1441
|
+
useLayoutEffect: () => import_react6.useLayoutEffect,
|
|
1442
|
+
useMemo: () => import_react6.useMemo,
|
|
1443
|
+
useRef: () => import_react6.useRef,
|
|
1444
|
+
useState: () => import_react6.useState,
|
|
1236
1445
|
waitForTaskResult: () => waitForTaskResult,
|
|
1237
1446
|
waitPm2: () => waitPm2,
|
|
1447
|
+
wrapTextLines: () => wrapTextLines,
|
|
1238
1448
|
writeReleaseBuildInfo: () => writeReleaseBuildInfo
|
|
1239
1449
|
});
|
|
1240
1450
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -8320,8 +8530,18 @@ var LOGGER_RUNTIME_KEYS = [
|
|
|
8320
8530
|
"progressThrottleMs"
|
|
8321
8531
|
];
|
|
8322
8532
|
var CONTROL_LANE_TASK_NAMES = ["stopRunner", "stop", "setRuntimeParam", "setRunnerParam"];
|
|
8323
|
-
function controlLaneTaskNames() {
|
|
8324
|
-
|
|
8533
|
+
function controlLaneTaskNames(extra) {
|
|
8534
|
+
const names = [...CONTROL_LANE_TASK_NAMES];
|
|
8535
|
+
if (extra == null || extra === "") return names;
|
|
8536
|
+
const more = Array.isArray(extra) ? extra : String(extra).split(",");
|
|
8537
|
+
const seen = new Set(names);
|
|
8538
|
+
for (const raw of more) {
|
|
8539
|
+
const n = String(raw ?? "").trim();
|
|
8540
|
+
if (!n || seen.has(n)) continue;
|
|
8541
|
+
seen.add(n);
|
|
8542
|
+
names.push(n);
|
|
8543
|
+
}
|
|
8544
|
+
return names;
|
|
8325
8545
|
}
|
|
8326
8546
|
function asPositiveInt(value, key, { min = 1 } = {}) {
|
|
8327
8547
|
const n = Number(value);
|
|
@@ -9128,6 +9348,7 @@ async function runTasksLoop(context, options) {
|
|
|
9128
9348
|
const queueName = options.queueName ?? "tasks";
|
|
9129
9349
|
const target = options.target;
|
|
9130
9350
|
const allowedTasks = normalizeAllowedTasks(options.allowedTasks);
|
|
9351
|
+
const controlLaneNames = controlLaneTaskNames(options.controlLaneTasks);
|
|
9131
9352
|
const registry = normalizeRegistry(options.registry);
|
|
9132
9353
|
const { tasksTable, historyTable } = queueToTableNames(queueName);
|
|
9133
9354
|
if (!target) throw new Error("runTasksLoop: target is required");
|
|
@@ -9198,7 +9419,7 @@ async function runTasksLoop(context, options) {
|
|
|
9198
9419
|
target,
|
|
9199
9420
|
registry,
|
|
9200
9421
|
10,
|
|
9201
|
-
|
|
9422
|
+
controlLaneNames,
|
|
9202
9423
|
runnerIdentity
|
|
9203
9424
|
);
|
|
9204
9425
|
if (claimedControlTask) {
|
|
@@ -9497,6 +9718,7 @@ var TasksManager = class _TasksManager {
|
|
|
9497
9718
|
ScreenFooter,
|
|
9498
9719
|
ScreenRow,
|
|
9499
9720
|
ScreenTitle,
|
|
9721
|
+
ScrollableText,
|
|
9500
9722
|
TaskGetLogs,
|
|
9501
9723
|
TaskPing,
|
|
9502
9724
|
TaskSampleProcess,
|
|
@@ -9514,6 +9736,8 @@ var TasksManager = class _TasksManager {
|
|
|
9514
9736
|
appendTaskIpcLog,
|
|
9515
9737
|
applyRuntimeParam,
|
|
9516
9738
|
applyRuntimePatch,
|
|
9739
|
+
bindingIdentity,
|
|
9740
|
+
bindingMatchesInput,
|
|
9517
9741
|
bootstrapHost,
|
|
9518
9742
|
buildBreadcrumb,
|
|
9519
9743
|
buildDetailBreadcrumb,
|
|
@@ -9546,6 +9770,7 @@ var TasksManager = class _TasksManager {
|
|
|
9546
9770
|
ensureTaskTables,
|
|
9547
9771
|
ensureTasksRuntime,
|
|
9548
9772
|
flushTaskIpcLogs,
|
|
9773
|
+
formatBindingKey,
|
|
9549
9774
|
getArgsInstance,
|
|
9550
9775
|
getPm2Process,
|
|
9551
9776
|
h,
|
|
@@ -9603,6 +9828,7 @@ var TasksManager = class _TasksManager {
|
|
|
9603
9828
|
runRemoteStatus,
|
|
9604
9829
|
runShell,
|
|
9605
9830
|
runTasksLoop,
|
|
9831
|
+
scrollbarGlyphs,
|
|
9606
9832
|
scrubEnvContent,
|
|
9607
9833
|
servicePaths,
|
|
9608
9834
|
setupContext,
|
|
@@ -9634,6 +9860,7 @@ var TasksManager = class _TasksManager {
|
|
|
9634
9860
|
useState,
|
|
9635
9861
|
waitForTaskResult,
|
|
9636
9862
|
waitPm2,
|
|
9863
|
+
wrapTextLines,
|
|
9637
9864
|
writeReleaseBuildInfo
|
|
9638
9865
|
});
|
|
9639
9866
|
//# sourceMappingURL=index.cjs.map
|