dlw-machine-setup 0.10.0 → 0.11.1
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/bin/installer.js +177 -379
- package/package.json +1 -1
package/bin/installer.js
CHANGED
|
@@ -60,49 +60,49 @@ var require_yoctocolors_cjs = __commonJS({
|
|
|
60
60
|
return result;
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
module2.exports =
|
|
63
|
+
var colors4 = {};
|
|
64
|
+
colors4.reset = format(0, 0);
|
|
65
|
+
colors4.bold = format(1, 22);
|
|
66
|
+
colors4.dim = format(2, 22);
|
|
67
|
+
colors4.italic = format(3, 23);
|
|
68
|
+
colors4.underline = format(4, 24);
|
|
69
|
+
colors4.overline = format(53, 55);
|
|
70
|
+
colors4.inverse = format(7, 27);
|
|
71
|
+
colors4.hidden = format(8, 28);
|
|
72
|
+
colors4.strikethrough = format(9, 29);
|
|
73
|
+
colors4.black = format(30, 39);
|
|
74
|
+
colors4.red = format(31, 39);
|
|
75
|
+
colors4.green = format(32, 39);
|
|
76
|
+
colors4.yellow = format(33, 39);
|
|
77
|
+
colors4.blue = format(34, 39);
|
|
78
|
+
colors4.magenta = format(35, 39);
|
|
79
|
+
colors4.cyan = format(36, 39);
|
|
80
|
+
colors4.white = format(37, 39);
|
|
81
|
+
colors4.gray = format(90, 39);
|
|
82
|
+
colors4.bgBlack = format(40, 49);
|
|
83
|
+
colors4.bgRed = format(41, 49);
|
|
84
|
+
colors4.bgGreen = format(42, 49);
|
|
85
|
+
colors4.bgYellow = format(43, 49);
|
|
86
|
+
colors4.bgBlue = format(44, 49);
|
|
87
|
+
colors4.bgMagenta = format(45, 49);
|
|
88
|
+
colors4.bgCyan = format(46, 49);
|
|
89
|
+
colors4.bgWhite = format(47, 49);
|
|
90
|
+
colors4.bgGray = format(100, 49);
|
|
91
|
+
colors4.redBright = format(91, 39);
|
|
92
|
+
colors4.greenBright = format(92, 39);
|
|
93
|
+
colors4.yellowBright = format(93, 39);
|
|
94
|
+
colors4.blueBright = format(94, 39);
|
|
95
|
+
colors4.magentaBright = format(95, 39);
|
|
96
|
+
colors4.cyanBright = format(96, 39);
|
|
97
|
+
colors4.whiteBright = format(97, 39);
|
|
98
|
+
colors4.bgRedBright = format(101, 49);
|
|
99
|
+
colors4.bgGreenBright = format(102, 49);
|
|
100
|
+
colors4.bgYellowBright = format(103, 49);
|
|
101
|
+
colors4.bgBlueBright = format(104, 49);
|
|
102
|
+
colors4.bgMagentaBright = format(105, 49);
|
|
103
|
+
colors4.bgCyanBright = format(106, 49);
|
|
104
|
+
colors4.bgWhiteBright = format(107, 49);
|
|
105
|
+
module2.exports = colors4;
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
|
|
@@ -1612,14 +1612,14 @@ var require_lib = __commonJS({
|
|
|
1612
1612
|
var require_ansi_escapes = __commonJS({
|
|
1613
1613
|
"node_modules/ansi-escapes/index.js"(exports2, module2) {
|
|
1614
1614
|
"use strict";
|
|
1615
|
-
var
|
|
1616
|
-
module2.exports.default =
|
|
1615
|
+
var ansiEscapes4 = module2.exports;
|
|
1616
|
+
module2.exports.default = ansiEscapes4;
|
|
1617
1617
|
var ESC = "\x1B[";
|
|
1618
1618
|
var OSC = "\x1B]";
|
|
1619
1619
|
var BEL = "\x07";
|
|
1620
1620
|
var SEP = ";";
|
|
1621
1621
|
var isTerminalApp = process.env.TERM_PROGRAM === "Apple_Terminal";
|
|
1622
|
-
|
|
1622
|
+
ansiEscapes4.cursorTo = (x, y) => {
|
|
1623
1623
|
if (typeof x !== "number") {
|
|
1624
1624
|
throw new TypeError("The `x` argument is required");
|
|
1625
1625
|
}
|
|
@@ -1628,7 +1628,7 @@ var require_ansi_escapes = __commonJS({
|
|
|
1628
1628
|
}
|
|
1629
1629
|
return ESC + (y + 1) + ";" + (x + 1) + "H";
|
|
1630
1630
|
};
|
|
1631
|
-
|
|
1631
|
+
ansiEscapes4.cursorMove = (x, y) => {
|
|
1632
1632
|
if (typeof x !== "number") {
|
|
1633
1633
|
throw new TypeError("The `x` argument is required");
|
|
1634
1634
|
}
|
|
@@ -1645,46 +1645,46 @@ var require_ansi_escapes = __commonJS({
|
|
|
1645
1645
|
}
|
|
1646
1646
|
return ret;
|
|
1647
1647
|
};
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1648
|
+
ansiEscapes4.cursorUp = (count = 1) => ESC + count + "A";
|
|
1649
|
+
ansiEscapes4.cursorDown = (count = 1) => ESC + count + "B";
|
|
1650
|
+
ansiEscapes4.cursorForward = (count = 1) => ESC + count + "C";
|
|
1651
|
+
ansiEscapes4.cursorBackward = (count = 1) => ESC + count + "D";
|
|
1652
|
+
ansiEscapes4.cursorLeft = ESC + "G";
|
|
1653
|
+
ansiEscapes4.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s";
|
|
1654
|
+
ansiEscapes4.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u";
|
|
1655
|
+
ansiEscapes4.cursorGetPosition = ESC + "6n";
|
|
1656
|
+
ansiEscapes4.cursorNextLine = ESC + "E";
|
|
1657
|
+
ansiEscapes4.cursorPrevLine = ESC + "F";
|
|
1658
|
+
ansiEscapes4.cursorHide = ESC + "?25l";
|
|
1659
|
+
ansiEscapes4.cursorShow = ESC + "?25h";
|
|
1660
|
+
ansiEscapes4.eraseLines = (count) => {
|
|
1661
1661
|
let clear = "";
|
|
1662
1662
|
for (let i = 0; i < count; i++) {
|
|
1663
|
-
clear +=
|
|
1663
|
+
clear += ansiEscapes4.eraseLine + (i < count - 1 ? ansiEscapes4.cursorUp() : "");
|
|
1664
1664
|
}
|
|
1665
1665
|
if (count) {
|
|
1666
|
-
clear +=
|
|
1666
|
+
clear += ansiEscapes4.cursorLeft;
|
|
1667
1667
|
}
|
|
1668
1668
|
return clear;
|
|
1669
1669
|
};
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1670
|
+
ansiEscapes4.eraseEndLine = ESC + "K";
|
|
1671
|
+
ansiEscapes4.eraseStartLine = ESC + "1K";
|
|
1672
|
+
ansiEscapes4.eraseLine = ESC + "2K";
|
|
1673
|
+
ansiEscapes4.eraseDown = ESC + "J";
|
|
1674
|
+
ansiEscapes4.eraseUp = ESC + "1J";
|
|
1675
|
+
ansiEscapes4.eraseScreen = ESC + "2J";
|
|
1676
|
+
ansiEscapes4.scrollUp = ESC + "S";
|
|
1677
|
+
ansiEscapes4.scrollDown = ESC + "T";
|
|
1678
|
+
ansiEscapes4.clearScreen = "\x1Bc";
|
|
1679
|
+
ansiEscapes4.clearTerminal = process.platform === "win32" ? `${ansiEscapes4.eraseScreen}${ESC}0f` : (
|
|
1680
1680
|
// 1. Erases the screen (Only done in case `2` is not supported)
|
|
1681
1681
|
// 2. Erases the whole screen including scrollback buffer
|
|
1682
1682
|
// 3. Moves cursor to the top-left position
|
|
1683
1683
|
// More info: https://www.real-world-systems.com/docs/ANSIcode.html
|
|
1684
|
-
`${
|
|
1684
|
+
`${ansiEscapes4.eraseScreen}${ESC}3J${ESC}H`
|
|
1685
1685
|
);
|
|
1686
|
-
|
|
1687
|
-
|
|
1686
|
+
ansiEscapes4.beep = BEL;
|
|
1687
|
+
ansiEscapes4.link = (text, url) => {
|
|
1688
1688
|
return [
|
|
1689
1689
|
OSC,
|
|
1690
1690
|
"8",
|
|
@@ -1700,7 +1700,7 @@ var require_ansi_escapes = __commonJS({
|
|
|
1700
1700
|
BEL
|
|
1701
1701
|
].join("");
|
|
1702
1702
|
};
|
|
1703
|
-
|
|
1703
|
+
ansiEscapes4.image = (buffer, options = {}) => {
|
|
1704
1704
|
let ret = `${OSC}1337;File=inline=1`;
|
|
1705
1705
|
if (options.width) {
|
|
1706
1706
|
ret += `;width=${options.width}`;
|
|
@@ -1713,7 +1713,7 @@ var require_ansi_escapes = __commonJS({
|
|
|
1713
1713
|
}
|
|
1714
1714
|
return ret + ":" + buffer.toString("base64") + BEL;
|
|
1715
1715
|
};
|
|
1716
|
-
|
|
1716
|
+
ansiEscapes4.iTerm = {
|
|
1717
1717
|
setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
|
|
1718
1718
|
annotation: (message, options = {}) => {
|
|
1719
1719
|
let ret = `${OSC}1337;`;
|
|
@@ -1748,7 +1748,6 @@ var isDownKey = (key) => (
|
|
|
1748
1748
|
key.name === "j" || // Emacs keybinding
|
|
1749
1749
|
key.ctrl && key.name === "n"
|
|
1750
1750
|
);
|
|
1751
|
-
var isSpaceKey = (key) => key.name === "space";
|
|
1752
1751
|
var isBackspaceKey = (key) => key.name === "backspace";
|
|
1753
1752
|
var isNumberKey = (key) => "123456789".includes(key.name);
|
|
1754
1753
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
@@ -2840,179 +2839,8 @@ var Separator = class {
|
|
|
2840
2839
|
}
|
|
2841
2840
|
};
|
|
2842
2841
|
|
|
2843
|
-
// node_modules/@inquirer/checkbox/dist/esm/index.mjs
|
|
2844
|
-
var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
|
|
2845
|
-
var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
|
|
2846
|
-
var checkboxTheme = {
|
|
2847
|
-
icon: {
|
|
2848
|
-
checked: import_yoctocolors_cjs3.default.green(esm_default.circleFilled),
|
|
2849
|
-
unchecked: esm_default.circle,
|
|
2850
|
-
cursor: esm_default.pointer
|
|
2851
|
-
},
|
|
2852
|
-
style: {
|
|
2853
|
-
disabledChoice: (text) => import_yoctocolors_cjs3.default.dim(`- ${text}`),
|
|
2854
|
-
renderSelectedChoices: (selectedChoices) => selectedChoices.map((choice) => choice.short).join(", "),
|
|
2855
|
-
description: (text) => import_yoctocolors_cjs3.default.cyan(text)
|
|
2856
|
-
},
|
|
2857
|
-
helpMode: "auto"
|
|
2858
|
-
};
|
|
2859
|
-
function isSelectable(item) {
|
|
2860
|
-
return !Separator.isSeparator(item) && !item.disabled;
|
|
2861
|
-
}
|
|
2862
|
-
function isChecked(item) {
|
|
2863
|
-
return isSelectable(item) && Boolean(item.checked);
|
|
2864
|
-
}
|
|
2865
|
-
function toggle(item) {
|
|
2866
|
-
return isSelectable(item) ? { ...item, checked: !item.checked } : item;
|
|
2867
|
-
}
|
|
2868
|
-
function check(checked) {
|
|
2869
|
-
return function(item) {
|
|
2870
|
-
return isSelectable(item) ? { ...item, checked } : item;
|
|
2871
|
-
};
|
|
2872
|
-
}
|
|
2873
|
-
function normalizeChoices(choices) {
|
|
2874
|
-
return choices.map((choice) => {
|
|
2875
|
-
if (Separator.isSeparator(choice))
|
|
2876
|
-
return choice;
|
|
2877
|
-
if (typeof choice === "string") {
|
|
2878
|
-
return {
|
|
2879
|
-
value: choice,
|
|
2880
|
-
name: choice,
|
|
2881
|
-
short: choice,
|
|
2882
|
-
disabled: false,
|
|
2883
|
-
checked: false
|
|
2884
|
-
};
|
|
2885
|
-
}
|
|
2886
|
-
const name = choice.name ?? String(choice.value);
|
|
2887
|
-
return {
|
|
2888
|
-
value: choice.value,
|
|
2889
|
-
name,
|
|
2890
|
-
short: choice.short ?? name,
|
|
2891
|
-
description: choice.description,
|
|
2892
|
-
disabled: choice.disabled ?? false,
|
|
2893
|
-
checked: choice.checked ?? false
|
|
2894
|
-
};
|
|
2895
|
-
});
|
|
2896
|
-
}
|
|
2897
|
-
var esm_default2 = createPrompt((config, done) => {
|
|
2898
|
-
const { instructions, pageSize = 7, loop = true, required, validate = () => true } = config;
|
|
2899
|
-
const theme = makeTheme(checkboxTheme, config.theme);
|
|
2900
|
-
const prefix = usePrefix({ theme });
|
|
2901
|
-
const firstRender = useRef(true);
|
|
2902
|
-
const [status, setStatus] = useState("pending");
|
|
2903
|
-
const [items, setItems] = useState(normalizeChoices(config.choices));
|
|
2904
|
-
const bounds = useMemo(() => {
|
|
2905
|
-
const first = items.findIndex(isSelectable);
|
|
2906
|
-
const last = items.findLastIndex(isSelectable);
|
|
2907
|
-
if (first < 0) {
|
|
2908
|
-
throw new ValidationError("[checkbox prompt] No selectable choices. All choices are disabled.");
|
|
2909
|
-
}
|
|
2910
|
-
return { first, last };
|
|
2911
|
-
}, [items]);
|
|
2912
|
-
const [active, setActive] = useState(bounds.first);
|
|
2913
|
-
const [showHelpTip, setShowHelpTip] = useState(true);
|
|
2914
|
-
const [errorMsg, setError] = useState();
|
|
2915
|
-
useKeypress(async (key) => {
|
|
2916
|
-
if (isEnterKey(key)) {
|
|
2917
|
-
const selection = items.filter(isChecked);
|
|
2918
|
-
const isValid = await validate([...selection]);
|
|
2919
|
-
if (required && !items.some(isChecked)) {
|
|
2920
|
-
setError("At least one choice must be selected");
|
|
2921
|
-
} else if (isValid === true) {
|
|
2922
|
-
setStatus("done");
|
|
2923
|
-
done(selection.map((choice) => choice.value));
|
|
2924
|
-
} else {
|
|
2925
|
-
setError(isValid || "You must select a valid value");
|
|
2926
|
-
}
|
|
2927
|
-
} else if (isUpKey(key) || isDownKey(key)) {
|
|
2928
|
-
if (loop || isUpKey(key) && active !== bounds.first || isDownKey(key) && active !== bounds.last) {
|
|
2929
|
-
const offset = isUpKey(key) ? -1 : 1;
|
|
2930
|
-
let next = active;
|
|
2931
|
-
do {
|
|
2932
|
-
next = (next + offset + items.length) % items.length;
|
|
2933
|
-
} while (!isSelectable(items[next]));
|
|
2934
|
-
setActive(next);
|
|
2935
|
-
}
|
|
2936
|
-
} else if (isSpaceKey(key)) {
|
|
2937
|
-
setError(void 0);
|
|
2938
|
-
setShowHelpTip(false);
|
|
2939
|
-
setItems(items.map((choice, i) => i === active ? toggle(choice) : choice));
|
|
2940
|
-
} else if (key.name === "a") {
|
|
2941
|
-
const selectAll = items.some((choice) => isSelectable(choice) && !choice.checked);
|
|
2942
|
-
setItems(items.map(check(selectAll)));
|
|
2943
|
-
} else if (key.name === "i") {
|
|
2944
|
-
setItems(items.map(toggle));
|
|
2945
|
-
} else if (isNumberKey(key)) {
|
|
2946
|
-
const position = Number(key.name) - 1;
|
|
2947
|
-
const item = items[position];
|
|
2948
|
-
if (item != null && isSelectable(item)) {
|
|
2949
|
-
setActive(position);
|
|
2950
|
-
setItems(items.map((choice, i) => i === position ? toggle(choice) : choice));
|
|
2951
|
-
}
|
|
2952
|
-
}
|
|
2953
|
-
});
|
|
2954
|
-
const message = theme.style.message(config.message);
|
|
2955
|
-
let description;
|
|
2956
|
-
const page = usePagination({
|
|
2957
|
-
items,
|
|
2958
|
-
active,
|
|
2959
|
-
renderItem({ item, isActive }) {
|
|
2960
|
-
if (Separator.isSeparator(item)) {
|
|
2961
|
-
return ` ${item.separator}`;
|
|
2962
|
-
}
|
|
2963
|
-
if (item.disabled) {
|
|
2964
|
-
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
|
|
2965
|
-
return theme.style.disabledChoice(`${item.name} ${disabledLabel}`);
|
|
2966
|
-
}
|
|
2967
|
-
if (isActive) {
|
|
2968
|
-
description = item.description;
|
|
2969
|
-
}
|
|
2970
|
-
const checkbox = item.checked ? theme.icon.checked : theme.icon.unchecked;
|
|
2971
|
-
const color = isActive ? theme.style.highlight : (x) => x;
|
|
2972
|
-
const cursor = isActive ? theme.icon.cursor : " ";
|
|
2973
|
-
return color(`${cursor}${checkbox} ${item.name}`);
|
|
2974
|
-
},
|
|
2975
|
-
pageSize,
|
|
2976
|
-
loop
|
|
2977
|
-
});
|
|
2978
|
-
if (status === "done") {
|
|
2979
|
-
const selection = items.filter(isChecked);
|
|
2980
|
-
const answer = theme.style.answer(theme.style.renderSelectedChoices(selection, items));
|
|
2981
|
-
return `${prefix} ${message} ${answer}`;
|
|
2982
|
-
}
|
|
2983
|
-
let helpTipTop = "";
|
|
2984
|
-
let helpTipBottom = "";
|
|
2985
|
-
if (theme.helpMode === "always" || theme.helpMode === "auto" && showHelpTip && (instructions === void 0 || instructions)) {
|
|
2986
|
-
if (typeof instructions === "string") {
|
|
2987
|
-
helpTipTop = instructions;
|
|
2988
|
-
} else {
|
|
2989
|
-
const keys = [
|
|
2990
|
-
`${theme.style.key("space")} to select`,
|
|
2991
|
-
`${theme.style.key("a")} to toggle all`,
|
|
2992
|
-
`${theme.style.key("i")} to invert selection`,
|
|
2993
|
-
`and ${theme.style.key("enter")} to proceed`
|
|
2994
|
-
];
|
|
2995
|
-
helpTipTop = ` (Press ${keys.join(", ")})`;
|
|
2996
|
-
}
|
|
2997
|
-
if (items.length > pageSize && (theme.helpMode === "always" || theme.helpMode === "auto" && firstRender.current)) {
|
|
2998
|
-
helpTipBottom = `
|
|
2999
|
-
${theme.style.help("(Use arrow keys to reveal more choices)")}`;
|
|
3000
|
-
firstRender.current = false;
|
|
3001
|
-
}
|
|
3002
|
-
}
|
|
3003
|
-
const choiceDescription = description ? `
|
|
3004
|
-
${theme.style.description(description)}` : ``;
|
|
3005
|
-
let error = "";
|
|
3006
|
-
if (errorMsg) {
|
|
3007
|
-
error = `
|
|
3008
|
-
${theme.style.error(errorMsg)}`;
|
|
3009
|
-
}
|
|
3010
|
-
return `${prefix} ${message}${helpTipTop}
|
|
3011
|
-
${page}${helpTipBottom}${choiceDescription}${error}${import_ansi_escapes2.default.cursorHide}`;
|
|
3012
|
-
});
|
|
3013
|
-
|
|
3014
2842
|
// node_modules/@inquirer/confirm/dist/esm/index.mjs
|
|
3015
|
-
var
|
|
2843
|
+
var esm_default2 = createPrompt((config, done) => {
|
|
3016
2844
|
const { transformer = (answer) => answer ? "yes" : "no" } = config;
|
|
3017
2845
|
const [status, setStatus] = useState("pending");
|
|
3018
2846
|
const [value, setValue] = useState("");
|
|
@@ -3044,7 +2872,7 @@ var esm_default3 = createPrompt((config, done) => {
|
|
|
3044
2872
|
});
|
|
3045
2873
|
|
|
3046
2874
|
// node_modules/@inquirer/input/dist/esm/index.mjs
|
|
3047
|
-
var
|
|
2875
|
+
var esm_default3 = createPrompt((config, done) => {
|
|
3048
2876
|
const { required, validate = () => true } = config;
|
|
3049
2877
|
const theme = makeTheme(config.theme);
|
|
3050
2878
|
const [status, setStatus] = useState("pending");
|
|
@@ -3104,8 +2932,8 @@ var esm_default4 = createPrompt((config, done) => {
|
|
|
3104
2932
|
});
|
|
3105
2933
|
|
|
3106
2934
|
// node_modules/@inquirer/password/dist/esm/index.mjs
|
|
3107
|
-
var
|
|
3108
|
-
var
|
|
2935
|
+
var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
|
|
2936
|
+
var esm_default4 = createPrompt((config, done) => {
|
|
3109
2937
|
const { validate = () => true } = config;
|
|
3110
2938
|
const theme = makeTheme(config.theme);
|
|
3111
2939
|
const [status, setStatus] = useState("pending");
|
|
@@ -3142,7 +2970,7 @@ var esm_default5 = createPrompt((config, done) => {
|
|
|
3142
2970
|
const maskChar = typeof config.mask === "string" ? config.mask : "*";
|
|
3143
2971
|
formattedValue = maskChar.repeat(value.length);
|
|
3144
2972
|
} else if (status !== "done") {
|
|
3145
|
-
helpTip = `${theme.style.help("[input is masked]")}${
|
|
2973
|
+
helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes2.default.cursorHide}`;
|
|
3146
2974
|
}
|
|
3147
2975
|
if (status === "done") {
|
|
3148
2976
|
formattedValue = theme.style.answer(formattedValue);
|
|
@@ -3155,20 +2983,20 @@ var esm_default5 = createPrompt((config, done) => {
|
|
|
3155
2983
|
});
|
|
3156
2984
|
|
|
3157
2985
|
// node_modules/@inquirer/select/dist/esm/index.mjs
|
|
3158
|
-
var
|
|
3159
|
-
var
|
|
2986
|
+
var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
|
|
2987
|
+
var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
|
|
3160
2988
|
var selectTheme = {
|
|
3161
2989
|
icon: { cursor: esm_default.pointer },
|
|
3162
2990
|
style: {
|
|
3163
|
-
disabled: (text) =>
|
|
3164
|
-
description: (text) =>
|
|
2991
|
+
disabled: (text) => import_yoctocolors_cjs3.default.dim(`- ${text}`),
|
|
2992
|
+
description: (text) => import_yoctocolors_cjs3.default.cyan(text)
|
|
3165
2993
|
},
|
|
3166
2994
|
helpMode: "auto"
|
|
3167
2995
|
};
|
|
3168
|
-
function
|
|
2996
|
+
function isSelectable(item) {
|
|
3169
2997
|
return !Separator.isSeparator(item) && !item.disabled;
|
|
3170
2998
|
}
|
|
3171
|
-
function
|
|
2999
|
+
function normalizeChoices(choices) {
|
|
3172
3000
|
return choices.map((choice) => {
|
|
3173
3001
|
if (Separator.isSeparator(choice))
|
|
3174
3002
|
return choice;
|
|
@@ -3190,17 +3018,17 @@ function normalizeChoices2(choices) {
|
|
|
3190
3018
|
};
|
|
3191
3019
|
});
|
|
3192
3020
|
}
|
|
3193
|
-
var
|
|
3021
|
+
var esm_default5 = createPrompt((config, done) => {
|
|
3194
3022
|
const { loop = true, pageSize = 7 } = config;
|
|
3195
3023
|
const firstRender = useRef(true);
|
|
3196
3024
|
const theme = makeTheme(selectTheme, config.theme);
|
|
3197
3025
|
const prefix = usePrefix({ theme });
|
|
3198
3026
|
const [status, setStatus] = useState("pending");
|
|
3199
3027
|
const searchTimeoutRef = useRef();
|
|
3200
|
-
const items = useMemo(() =>
|
|
3028
|
+
const items = useMemo(() => normalizeChoices(config.choices), [config.choices]);
|
|
3201
3029
|
const bounds = useMemo(() => {
|
|
3202
|
-
const first = items.findIndex(
|
|
3203
|
-
const last = items.findLastIndex(
|
|
3030
|
+
const first = items.findIndex(isSelectable);
|
|
3031
|
+
const last = items.findLastIndex(isSelectable);
|
|
3204
3032
|
if (first < 0) {
|
|
3205
3033
|
throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
|
|
3206
3034
|
}
|
|
@@ -3209,7 +3037,7 @@ var esm_default6 = createPrompt((config, done) => {
|
|
|
3209
3037
|
const defaultItemIndex = useMemo(() => {
|
|
3210
3038
|
if (!("default" in config))
|
|
3211
3039
|
return -1;
|
|
3212
|
-
return items.findIndex((item) =>
|
|
3040
|
+
return items.findIndex((item) => isSelectable(item) && item.value === config.default);
|
|
3213
3041
|
}, [config.default, items]);
|
|
3214
3042
|
const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
|
|
3215
3043
|
const selectedChoice = items[active];
|
|
@@ -3225,14 +3053,14 @@ var esm_default6 = createPrompt((config, done) => {
|
|
|
3225
3053
|
let next = active;
|
|
3226
3054
|
do {
|
|
3227
3055
|
next = (next + offset + items.length) % items.length;
|
|
3228
|
-
} while (!
|
|
3056
|
+
} while (!isSelectable(items[next]));
|
|
3229
3057
|
setActive(next);
|
|
3230
3058
|
}
|
|
3231
3059
|
} else if (isNumberKey(key)) {
|
|
3232
3060
|
rl.clearLine(0);
|
|
3233
3061
|
const position = Number(key.name) - 1;
|
|
3234
3062
|
const item = items[position];
|
|
3235
|
-
if (item != null &&
|
|
3063
|
+
if (item != null && isSelectable(item)) {
|
|
3236
3064
|
setActive(position);
|
|
3237
3065
|
}
|
|
3238
3066
|
} else if (isBackspaceKey(key)) {
|
|
@@ -3240,7 +3068,7 @@ var esm_default6 = createPrompt((config, done) => {
|
|
|
3240
3068
|
} else {
|
|
3241
3069
|
const searchTerm = rl.line.toLowerCase();
|
|
3242
3070
|
const matchIndex = items.findIndex((item) => {
|
|
3243
|
-
if (Separator.isSeparator(item) || !
|
|
3071
|
+
if (Separator.isSeparator(item) || !isSelectable(item))
|
|
3244
3072
|
return false;
|
|
3245
3073
|
return item.name.toLowerCase().startsWith(searchTerm);
|
|
3246
3074
|
});
|
|
@@ -3291,13 +3119,13 @@ ${theme.style.help("(Use arrow keys to reveal more choices)")}`;
|
|
|
3291
3119
|
const choiceDescription = selectedChoice.description ? `
|
|
3292
3120
|
${theme.style.description(selectedChoice.description)}` : ``;
|
|
3293
3121
|
return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")}
|
|
3294
|
-
${page}${helpTipBottom}${choiceDescription}${
|
|
3122
|
+
${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes3.default.cursorHide}`;
|
|
3295
3123
|
});
|
|
3296
3124
|
|
|
3297
3125
|
// src/index.ts
|
|
3298
|
-
var
|
|
3126
|
+
var import_fs17 = require("fs");
|
|
3299
3127
|
var import_readline2 = require("readline");
|
|
3300
|
-
var
|
|
3128
|
+
var import_path17 = require("path");
|
|
3301
3129
|
|
|
3302
3130
|
// src/utils/fetch.ts
|
|
3303
3131
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
@@ -3956,7 +3784,6 @@ __export(steps_exports, {
|
|
|
3956
3784
|
fetchFactory: () => fetch_factory_default,
|
|
3957
3785
|
runMcpInstallCommands: () => run_mcp_install_commands_default,
|
|
3958
3786
|
setupCodeIndex: () => build_code_index_default,
|
|
3959
|
-
setupProjectInput: () => create_project_input_default,
|
|
3960
3787
|
updateGitignore: () => update_gitignore_default,
|
|
3961
3788
|
writeInstructions: () => write_instructions_default,
|
|
3962
3789
|
writeMcpConfig: () => write_mcp_config_default,
|
|
@@ -4293,6 +4120,10 @@ var claudeCodeProfile = {
|
|
|
4293
4120
|
// Claude exposes a top-level `statusLine` setting in settings.json.
|
|
4294
4121
|
// Bundles gate statusline-related ops with `when: 'statusline-supported'`.
|
|
4295
4122
|
statusLineSupported: true,
|
|
4123
|
+
// Claude Code is the only runtime with agent teams. Bundles gate
|
|
4124
|
+
// team-only ops with `when: 'agent-teams-opted-in'`, which also requires
|
|
4125
|
+
// the user's install-time opt-in (ctx.optIns.agentTeams).
|
|
4126
|
+
agentTeamsSupported: true,
|
|
4296
4127
|
handlers: {
|
|
4297
4128
|
agent: {
|
|
4298
4129
|
supported: true,
|
|
@@ -4475,6 +4306,7 @@ function runBundleV2(manifest, ctx) {
|
|
|
4475
4306
|
for (const op of manifest.ops ?? []) {
|
|
4476
4307
|
if (op.when === "hooks-supported" && !profile.handlers.hook.supported) continue;
|
|
4477
4308
|
if (op.when === "statusline-supported" && !profile.statusLineSupported) continue;
|
|
4309
|
+
if (op.when === "agent-teams-opted-in" && !(profile.agentTeamsSupported && ctx.optIns?.agentTeams)) continue;
|
|
4478
4310
|
const substituted = substituteHookDir(op, profile);
|
|
4479
4311
|
if (substituted.op === "merge-json") {
|
|
4480
4312
|
const existing = mergePatches.get(substituted.file);
|
|
@@ -4733,7 +4565,7 @@ var fetch_factory_default = defineStep({
|
|
|
4733
4565
|
label: "Installing Factory framework",
|
|
4734
4566
|
when: (ctx) => ctx.config.installFactory && !!ctx.factoryRepo,
|
|
4735
4567
|
execute: async (ctx) => {
|
|
4736
|
-
const result = await fetchFactory(ctx.token, ctx.factoryRepo, ctx.config.projectPath, ctx.config.agent);
|
|
4568
|
+
const result = await fetchFactory(ctx.token, ctx.factoryRepo, ctx.config.projectPath, ctx.config.agent, ctx.config.agentTeams);
|
|
4737
4569
|
ctx.installed.factoryInstalled = result.success;
|
|
4738
4570
|
if (result.instructionsSnippet) {
|
|
4739
4571
|
ctx.installed.factoryInstructionsSnippet = result.instructionsSnippet;
|
|
@@ -4791,7 +4623,7 @@ var fetch_factory_default = defineStep({
|
|
|
4791
4623
|
}
|
|
4792
4624
|
}
|
|
4793
4625
|
});
|
|
4794
|
-
async function fetchFactory(token, repo, targetDir, agent) {
|
|
4626
|
+
async function fetchFactory(token, repo, targetDir, agent, agentTeams) {
|
|
4795
4627
|
const result = {
|
|
4796
4628
|
success: false,
|
|
4797
4629
|
filesInstalled: [],
|
|
@@ -4826,7 +4658,7 @@ async function fetchFactory(token, repo, targetDir, agent) {
|
|
|
4826
4658
|
result.failureReason = "Factory archive has no install.json \u2014 upgrade Factory or downgrade installer";
|
|
4827
4659
|
return result;
|
|
4828
4660
|
}
|
|
4829
|
-
await installViaBundle(manifestPath, extractedPath, targetDir, agent, result);
|
|
4661
|
+
await installViaBundle(manifestPath, extractedPath, targetDir, agent, agentTeams, result);
|
|
4830
4662
|
result.success = true;
|
|
4831
4663
|
} catch (error) {
|
|
4832
4664
|
result.failureReason = error instanceof Error ? error.message : String(error);
|
|
@@ -4835,7 +4667,7 @@ async function fetchFactory(token, repo, targetDir, agent) {
|
|
|
4835
4667
|
}
|
|
4836
4668
|
return result;
|
|
4837
4669
|
}
|
|
4838
|
-
async function installViaBundle(manifestPath, extractedPath, targetDir, agent, result) {
|
|
4670
|
+
async function installViaBundle(manifestPath, extractedPath, targetDir, agent, agentTeams, result) {
|
|
4839
4671
|
let manifest;
|
|
4840
4672
|
try {
|
|
4841
4673
|
manifest = JSON.parse((0, import_fs9.readFileSync)(manifestPath, "utf-8"));
|
|
@@ -4848,8 +4680,10 @@ async function installViaBundle(manifestPath, extractedPath, targetDir, agent, r
|
|
|
4848
4680
|
projectPath: targetDir,
|
|
4849
4681
|
agent,
|
|
4850
4682
|
instructionsFile: target.instructions,
|
|
4851
|
-
skipInstructions: true
|
|
4683
|
+
skipInstructions: true,
|
|
4852
4684
|
// write-instructions.ts commits the snippet for correct ordering
|
|
4685
|
+
optIns: { agentTeams }
|
|
4686
|
+
// gates the experimental agent-teams env-var op
|
|
4853
4687
|
});
|
|
4854
4688
|
result.instructionsSnippet = runResult.instructionsSnippet;
|
|
4855
4689
|
result.filesInstalled = runResult.filesTouched;
|
|
@@ -5465,8 +5299,8 @@ var run_mcp_install_commands_default = defineStep({
|
|
|
5465
5299
|
}
|
|
5466
5300
|
});
|
|
5467
5301
|
function isClaudeCliAvailable() {
|
|
5468
|
-
const
|
|
5469
|
-
return
|
|
5302
|
+
const check = (0, import_child_process3.spawnSync)("claude --version", { shell: true, stdio: "ignore" });
|
|
5303
|
+
return check.status === 0;
|
|
5470
5304
|
}
|
|
5471
5305
|
|
|
5472
5306
|
// src/steps/setup/build-code-index.ts
|
|
@@ -5572,47 +5406,9 @@ function isNodeAvailable() {
|
|
|
5572
5406
|
return probeResult.status === 0;
|
|
5573
5407
|
}
|
|
5574
5408
|
|
|
5575
|
-
// src/steps/setup/
|
|
5409
|
+
// src/steps/setup/update-gitignore.ts
|
|
5576
5410
|
var import_fs14 = require("fs");
|
|
5577
5411
|
var import_path14 = require("path");
|
|
5578
|
-
var INPUT_DIR = ".project/input";
|
|
5579
|
-
var KEEP_FILE = `${INPUT_DIR}/.gitkeep`;
|
|
5580
|
-
var create_project_input_default = defineStep({
|
|
5581
|
-
name: "create-project-input",
|
|
5582
|
-
label: "Creating .project/input folder",
|
|
5583
|
-
execute: async (ctx) => {
|
|
5584
|
-
const dirAbs = (0, import_path14.join)(ctx.config.projectPath, INPUT_DIR);
|
|
5585
|
-
const keepAbs = (0, import_path14.join)(ctx.config.projectPath, KEEP_FILE);
|
|
5586
|
-
const dirExistedBefore = (0, import_fs14.existsSync)(dirAbs);
|
|
5587
|
-
if (!dirExistedBefore) (0, import_fs14.mkdirSync)(dirAbs, { recursive: true });
|
|
5588
|
-
const keepFileCreated = !(0, import_fs14.existsSync)(keepAbs);
|
|
5589
|
-
if (keepFileCreated) (0, import_fs14.writeFileSync)(keepAbs, "", "utf-8");
|
|
5590
|
-
const record = {
|
|
5591
|
-
keepFile: KEEP_FILE,
|
|
5592
|
-
dirExistedBefore,
|
|
5593
|
-
keepFileCreated
|
|
5594
|
-
};
|
|
5595
|
-
return { status: "success", message: INPUT_DIR, record };
|
|
5596
|
-
},
|
|
5597
|
-
inverse: {
|
|
5598
|
-
label: "Removing .project/input folder",
|
|
5599
|
-
execute: async (raw, ctx) => {
|
|
5600
|
-
const rec = raw ?? {};
|
|
5601
|
-
if (rec.keepFileCreated && rec.keepFile) {
|
|
5602
|
-
const keepAbs = resolveProjectPath(rec.keepFile, ctx.config.projectPath);
|
|
5603
|
-
deleteFileIfExists(keepAbs);
|
|
5604
|
-
}
|
|
5605
|
-
if (!rec.dirExistedBefore && rec.keepFile) {
|
|
5606
|
-
pruneEmptyAncestors([rec.keepFile], ctx.config.projectPath);
|
|
5607
|
-
}
|
|
5608
|
-
return { status: "success", message: INPUT_DIR };
|
|
5609
|
-
}
|
|
5610
|
-
}
|
|
5611
|
-
});
|
|
5612
|
-
|
|
5613
|
-
// src/steps/setup/update-gitignore.ts
|
|
5614
|
-
var import_fs15 = require("fs");
|
|
5615
|
-
var import_path15 = require("path");
|
|
5616
5412
|
var MARKER_START2 = "# one-shot-installer:start";
|
|
5617
5413
|
var MARKER_END2 = "# one-shot-installer:end";
|
|
5618
5414
|
var CORE_GITIGNORE_ENTRIES = [
|
|
@@ -5633,8 +5429,8 @@ var update_gitignore_default = defineStep({
|
|
|
5633
5429
|
name: "update-gitignore",
|
|
5634
5430
|
label: "Updating .gitignore",
|
|
5635
5431
|
execute: async (ctx) => {
|
|
5636
|
-
const gitignorePath = (0,
|
|
5637
|
-
const fileExistedBefore = (0,
|
|
5432
|
+
const gitignorePath = (0, import_path14.join)(ctx.config.projectPath, ".gitignore");
|
|
5433
|
+
const fileExistedBefore = (0, import_fs14.existsSync)(gitignorePath);
|
|
5638
5434
|
upsertMarkerBlock(gitignorePath, MARKER_START2, MARKER_END2, CORE_GITIGNORE_ENTRIES.join("\n"));
|
|
5639
5435
|
const record = {
|
|
5640
5436
|
filePath: ".gitignore",
|
|
@@ -5662,8 +5458,8 @@ var update_gitignore_default = defineStep({
|
|
|
5662
5458
|
});
|
|
5663
5459
|
|
|
5664
5460
|
// src/steps/setup/write-state.ts
|
|
5665
|
-
var
|
|
5666
|
-
var
|
|
5461
|
+
var import_fs15 = require("fs");
|
|
5462
|
+
var import_path15 = require("path");
|
|
5667
5463
|
var import_os2 = require("os");
|
|
5668
5464
|
|
|
5669
5465
|
// package.json
|
|
@@ -5697,7 +5493,7 @@ var write_state_default = defineStep({
|
|
|
5697
5493
|
name: "write-state",
|
|
5698
5494
|
label: "Saving installation state",
|
|
5699
5495
|
execute: async (ctx) => {
|
|
5700
|
-
const statePath = (0,
|
|
5496
|
+
const statePath = (0, import_path15.join)(ctx.config.projectPath, ".one-shot-state.json");
|
|
5701
5497
|
const mcpServersAdded = ctx.installed.mcpServersAdded ?? [];
|
|
5702
5498
|
const filteredMcpConfig = Object.fromEntries(
|
|
5703
5499
|
Object.entries(ctx.config.mcpConfig).filter(([name]) => mcpServersAdded.includes(name))
|
|
@@ -5728,13 +5524,13 @@ var write_state_default = defineStep({
|
|
|
5728
5524
|
* mislead the uninstall preview which reads this field. */
|
|
5729
5525
|
factory: ctx.installed.factoryInstalled ? ".claude/" : null,
|
|
5730
5526
|
abapHooks: ctx.installed.abapHooksInstalled ? ".claude/hooks/" : null,
|
|
5731
|
-
globalConfig: (0,
|
|
5527
|
+
globalConfig: (0, import_path15.join)((0, import_os2.homedir)(), ".one-shot-installer")
|
|
5732
5528
|
}
|
|
5733
5529
|
};
|
|
5734
5530
|
if (ctx.journal) {
|
|
5735
5531
|
ctx.journal.setSummary(state);
|
|
5736
5532
|
} else {
|
|
5737
|
-
(0,
|
|
5533
|
+
(0, import_fs15.writeFileSync)(statePath, JSON.stringify(state, null, 2), "utf-8");
|
|
5738
5534
|
}
|
|
5739
5535
|
return { status: "success" };
|
|
5740
5536
|
},
|
|
@@ -5749,9 +5545,9 @@ var write_state_default = defineStep({
|
|
|
5749
5545
|
});
|
|
5750
5546
|
|
|
5751
5547
|
// src/uninstall.ts
|
|
5752
|
-
var
|
|
5548
|
+
var import_fs16 = require("fs");
|
|
5753
5549
|
var import_readline = require("readline");
|
|
5754
|
-
var
|
|
5550
|
+
var import_path16 = require("path");
|
|
5755
5551
|
var dim = (text) => `\x1B[2m${text}\x1B[0m`;
|
|
5756
5552
|
var yellow = (text) => `\x1B[33m${text}\x1B[0m`;
|
|
5757
5553
|
var red3 = (text) => `\x1B[31m${text}\x1B[0m`;
|
|
@@ -5769,13 +5565,13 @@ async function uninstall() {
|
|
|
5769
5565
|
console.clear();
|
|
5770
5566
|
console.log("One-Shot Setup Uninstaller\n");
|
|
5771
5567
|
try {
|
|
5772
|
-
const projectInput = await
|
|
5568
|
+
const projectInput = await esm_default3({
|
|
5773
5569
|
message: "Project directory to uninstall from:",
|
|
5774
|
-
default: (0,
|
|
5570
|
+
default: (0, import_path16.resolve)(process.cwd())
|
|
5775
5571
|
});
|
|
5776
|
-
const projectPath = (0,
|
|
5777
|
-
const statePath = (0,
|
|
5778
|
-
if (!(0,
|
|
5572
|
+
const projectPath = (0, import_path16.resolve)(projectInput);
|
|
5573
|
+
const statePath = (0, import_path16.join)(projectPath, ".one-shot-state.json");
|
|
5574
|
+
if (!(0, import_fs16.existsSync)(statePath)) {
|
|
5779
5575
|
console.log("");
|
|
5780
5576
|
console.log(red3(" No .one-shot-state.json found at:"));
|
|
5781
5577
|
console.log(` ${statePath}`);
|
|
@@ -5795,12 +5591,12 @@ async function uninstall() {
|
|
|
5795
5591
|
console.log(dim(" This file was likely written by an older installer version that"));
|
|
5796
5592
|
console.log(dim(" did not yet emit a journal. Manual cleanup is required."));
|
|
5797
5593
|
console.log("");
|
|
5798
|
-
const proceed2 = await
|
|
5594
|
+
const proceed2 = await esm_default2({
|
|
5799
5595
|
message: "Delete the state file anyway?",
|
|
5800
5596
|
default: false
|
|
5801
5597
|
});
|
|
5802
5598
|
if (proceed2) {
|
|
5803
|
-
(0,
|
|
5599
|
+
(0, import_fs16.unlinkSync)(statePath);
|
|
5804
5600
|
console.log(" Removed .one-shot-state.json");
|
|
5805
5601
|
}
|
|
5806
5602
|
await waitForEnter();
|
|
@@ -5808,7 +5604,7 @@ async function uninstall() {
|
|
|
5808
5604
|
}
|
|
5809
5605
|
const summary = readSummary(statePath);
|
|
5810
5606
|
printPreview(projectPath, summary, entries.length);
|
|
5811
|
-
const proceed = await
|
|
5607
|
+
const proceed = await esm_default2({
|
|
5812
5608
|
message: "Proceed with uninstall?",
|
|
5813
5609
|
default: false
|
|
5814
5610
|
});
|
|
@@ -5827,7 +5623,8 @@ async function uninstall() {
|
|
|
5827
5623
|
mcpConfig: {},
|
|
5828
5624
|
releaseVersion: "",
|
|
5829
5625
|
installFactory: false,
|
|
5830
|
-
installAbapHooks: false
|
|
5626
|
+
installAbapHooks: false,
|
|
5627
|
+
agentTeams: false
|
|
5831
5628
|
},
|
|
5832
5629
|
token: "",
|
|
5833
5630
|
repo: "",
|
|
@@ -5841,7 +5638,7 @@ async function uninstall() {
|
|
|
5841
5638
|
console.log("");
|
|
5842
5639
|
const result = await runRollback(stepList, ctx);
|
|
5843
5640
|
try {
|
|
5844
|
-
if ((0,
|
|
5641
|
+
if ((0, import_fs16.existsSync)(statePath)) (0, import_fs16.unlinkSync)(statePath);
|
|
5845
5642
|
} catch {
|
|
5846
5643
|
}
|
|
5847
5644
|
printSummary(result);
|
|
@@ -5853,7 +5650,7 @@ async function uninstall() {
|
|
|
5853
5650
|
}
|
|
5854
5651
|
function readSummary(statePath) {
|
|
5855
5652
|
try {
|
|
5856
|
-
const raw = JSON.parse((0,
|
|
5653
|
+
const raw = JSON.parse((0, import_fs16.readFileSync)(statePath, "utf-8"));
|
|
5857
5654
|
return raw;
|
|
5858
5655
|
} catch {
|
|
5859
5656
|
return {};
|
|
@@ -5934,19 +5731,19 @@ var dim2 = (text) => `\x1B[2m${text}\x1B[0m`;
|
|
|
5934
5731
|
var yellow2 = (text) => `\x1B[33m${text}\x1B[0m`;
|
|
5935
5732
|
var green2 = (text) => `\x1B[32m${text}\x1B[0m`;
|
|
5936
5733
|
function detectMarkerFileMode(filePath, markerStart) {
|
|
5937
|
-
if (!(0,
|
|
5938
|
-
const content = (0,
|
|
5734
|
+
if (!(0, import_fs17.existsSync)(filePath)) return green2("create");
|
|
5735
|
+
const content = (0, import_fs17.readFileSync)(filePath, "utf-8");
|
|
5939
5736
|
if (content.includes(markerStart)) return yellow2("update");
|
|
5940
5737
|
return yellow2("append");
|
|
5941
5738
|
}
|
|
5942
5739
|
function detectMCPFileMode(filePath) {
|
|
5943
|
-
if (!(0,
|
|
5740
|
+
if (!(0, import_fs17.existsSync)(filePath)) return green2("create");
|
|
5944
5741
|
return yellow2("merge");
|
|
5945
5742
|
}
|
|
5946
5743
|
function detectContextMode(projectPath, domain) {
|
|
5947
|
-
const contextDir = (0,
|
|
5948
|
-
const contextDirLower = (0,
|
|
5949
|
-
if ((0,
|
|
5744
|
+
const contextDir = (0, import_path17.join)(projectPath, "_ai-context", domain.toUpperCase());
|
|
5745
|
+
const contextDirLower = (0, import_path17.join)(projectPath, "_ai-context", domain);
|
|
5746
|
+
if ((0, import_fs17.existsSync)(contextDir) || (0, import_fs17.existsSync)(contextDirLower)) return yellow2("overwrite");
|
|
5950
5747
|
return green2("create");
|
|
5951
5748
|
}
|
|
5952
5749
|
function waitForEnter2() {
|
|
@@ -5992,7 +5789,7 @@ async function main() {
|
|
|
5992
5789
|
await waitForEnter2();
|
|
5993
5790
|
return;
|
|
5994
5791
|
}
|
|
5995
|
-
const statePath = (0,
|
|
5792
|
+
const statePath = (0, import_path17.join)(config.projectPath, ".one-shot-state.json");
|
|
5996
5793
|
const journal = new Journal(statePath);
|
|
5997
5794
|
journal.startFresh();
|
|
5998
5795
|
const ctx = {
|
|
@@ -6016,29 +5813,29 @@ async function main() {
|
|
|
6016
5813
|
}
|
|
6017
5814
|
}
|
|
6018
5815
|
async function collectInputs(options, releaseVersion, factoryAvailable = false, abapHooksAvailable = false) {
|
|
6019
|
-
const
|
|
6020
|
-
|
|
6021
|
-
instructions: " Space to select \xB7 Enter to confirm",
|
|
6022
|
-
choices: [
|
|
6023
|
-
...options.technologies.map((p) => ({
|
|
6024
|
-
name: p.name.replace(/ Developer$/, ""),
|
|
6025
|
-
value: p.id
|
|
6026
|
-
})),
|
|
6027
|
-
{ name: "None", value: "none" }
|
|
6028
|
-
],
|
|
6029
|
-
required: true,
|
|
6030
|
-
loop: false
|
|
6031
|
-
});
|
|
6032
|
-
const selectedTechnologies = options.technologies.filter((p) => selectedIds.includes(p.id));
|
|
6033
|
-
const agent = await esm_default6({
|
|
5816
|
+
const selectedTechnologies = options.technologies;
|
|
5817
|
+
const agent = await esm_default5({
|
|
6034
5818
|
message: "AI coding tool:",
|
|
6035
5819
|
choices: options.agents,
|
|
6036
5820
|
loop: false
|
|
6037
5821
|
});
|
|
5822
|
+
let agentTeams = false;
|
|
5823
|
+
if (factoryAvailable && agent === "claude-code") {
|
|
5824
|
+
const brainstormer = await esm_default5({
|
|
5825
|
+
message: "Brainstorming mode:",
|
|
5826
|
+
default: "solo",
|
|
5827
|
+
choices: [
|
|
5828
|
+
{ name: "Default \u2014 solo facilitator (works everywhere, normal cost)", value: "solo" },
|
|
5829
|
+
{ name: "Experimental \u2014 agent-team brainstormer (Claude Code only, higher token use)", value: "team" }
|
|
5830
|
+
],
|
|
5831
|
+
loop: false
|
|
5832
|
+
});
|
|
5833
|
+
agentTeams = brainstormer === "team";
|
|
5834
|
+
}
|
|
6038
5835
|
const mcpConfig = buildMCPConfiguration(selectedTechnologies, options.baseMcpServers, options.mcpServers);
|
|
6039
5836
|
let azureDevOpsOrg = "";
|
|
6040
5837
|
if (mcpConfig["azure-devops"]) {
|
|
6041
|
-
const org = await
|
|
5838
|
+
const org = await esm_default3({
|
|
6042
5839
|
message: "Azure DevOps org (leave empty to skip):"
|
|
6043
5840
|
});
|
|
6044
5841
|
azureDevOpsOrg = org.trim();
|
|
@@ -6054,13 +5851,13 @@ async function collectInputs(options, releaseVersion, factoryAvailable = false,
|
|
|
6054
5851
|
}
|
|
6055
5852
|
}
|
|
6056
5853
|
if (mcpConfig["sap_mcp_server"]) {
|
|
6057
|
-
const sapUser = (await
|
|
5854
|
+
const sapUser = (await esm_default3({
|
|
6058
5855
|
message: "SAP MCP (ABAP F4P) username (leave empty to skip):"
|
|
6059
5856
|
})).trim();
|
|
6060
5857
|
if (sapUser === "") {
|
|
6061
5858
|
delete mcpConfig["sap_mcp_server"];
|
|
6062
5859
|
} else {
|
|
6063
|
-
const sapPassword = await
|
|
5860
|
+
const sapPassword = await esm_default4({
|
|
6064
5861
|
message: "SAP MCP (ABAP F4P) password:",
|
|
6065
5862
|
mask: "*"
|
|
6066
5863
|
});
|
|
@@ -6074,9 +5871,9 @@ async function collectInputs(options, releaseVersion, factoryAvailable = false,
|
|
|
6074
5871
|
}
|
|
6075
5872
|
}
|
|
6076
5873
|
}
|
|
6077
|
-
const projectInput = await
|
|
5874
|
+
const projectInput = await esm_default3({
|
|
6078
5875
|
message: "Project directory:",
|
|
6079
|
-
default: (0,
|
|
5876
|
+
default: (0, import_path17.resolve)(process.cwd())
|
|
6080
5877
|
});
|
|
6081
5878
|
const isAbapSelected = selectedTechnologies.some((t) => t.domains.includes("ABAP"));
|
|
6082
5879
|
const installAbapHooks = abapHooksAvailable && agent === "claude-code" && isAbapSelected;
|
|
@@ -6084,24 +5881,25 @@ async function collectInputs(options, releaseVersion, factoryAvailable = false,
|
|
|
6084
5881
|
technologies: selectedTechnologies,
|
|
6085
5882
|
agent,
|
|
6086
5883
|
azureDevOpsOrg,
|
|
6087
|
-
projectPath: (0,
|
|
5884
|
+
projectPath: (0, import_path17.resolve)(projectInput),
|
|
6088
5885
|
baseMcpServers: options.baseMcpServers,
|
|
6089
5886
|
mcpConfig,
|
|
6090
5887
|
releaseVersion,
|
|
6091
5888
|
installFactory: factoryAvailable,
|
|
6092
|
-
installAbapHooks
|
|
5889
|
+
installAbapHooks,
|
|
5890
|
+
agentTeams
|
|
6093
5891
|
};
|
|
6094
5892
|
}
|
|
6095
5893
|
async function previewAndConfirm(config, options) {
|
|
6096
|
-
const technologyNames = config.technologies.
|
|
5894
|
+
const technologyNames = config.technologies.map((p) => p.name.replace(/ Developer$/, "")).join(", ");
|
|
6097
5895
|
const agentDisplay = options.agents.find((a) => a.value === config.agent)?.name ?? config.agent;
|
|
6098
5896
|
const target = getAgentTarget(config.agent);
|
|
6099
5897
|
const instructionFile = target.instructions;
|
|
6100
5898
|
const mcpConfigFile = target.mcpConfig;
|
|
6101
5899
|
const serverEntries = Object.entries(config.mcpConfig);
|
|
6102
|
-
const instructionFilePath = (0,
|
|
6103
|
-
const mcpConfigFilePath = (0,
|
|
6104
|
-
const gitignorePath = (0,
|
|
5900
|
+
const instructionFilePath = (0, import_path17.join)(config.projectPath, instructionFile);
|
|
5901
|
+
const mcpConfigFilePath = (0, import_path17.join)(config.projectPath, mcpConfigFile);
|
|
5902
|
+
const gitignorePath = (0, import_path17.join)(config.projectPath, ".gitignore");
|
|
6105
5903
|
const instructionMode = detectMarkerFileMode(instructionFilePath, "<!-- one-shot-installer:start -->");
|
|
6106
5904
|
const mcpMode = detectMCPFileMode(mcpConfigFilePath);
|
|
6107
5905
|
const gitignoreMode = detectMarkerFileMode(gitignorePath, "# one-shot-installer:start");
|
|
@@ -6117,6 +5915,9 @@ async function previewAndConfirm(config, options) {
|
|
|
6117
5915
|
console.log(` Tool ${agentDisplay}`);
|
|
6118
5916
|
console.log(` Factory ${config.installFactory ? "yes" : "no"}`);
|
|
6119
5917
|
console.log(` ABAP hooks ${config.installAbapHooks ? "yes" : "no"}`);
|
|
5918
|
+
if (config.installFactory && config.agent === "claude-code") {
|
|
5919
|
+
console.log(` Brainstormer ${config.agentTeams ? "experimental (agent teams)" : "default (solo)"}`);
|
|
5920
|
+
}
|
|
6120
5921
|
console.log(` Directory ${config.projectPath}`);
|
|
6121
5922
|
console.log("");
|
|
6122
5923
|
console.log(` ${dim2("File actions:")}`);
|
|
@@ -6127,15 +5928,12 @@ async function previewAndConfirm(config, options) {
|
|
|
6127
5928
|
console.log(` ${instructionFile.padEnd(domainColWidth + 14)}${instructionMode}`);
|
|
6128
5929
|
console.log(` ${mcpConfigFile.padEnd(domainColWidth + 14)}${mcpMode}`);
|
|
6129
5930
|
console.log(` ${".gitignore".padEnd(domainColWidth + 14)}${gitignoreMode}`);
|
|
6130
|
-
const projectInputDir = (0, import_path18.join)(config.projectPath, ".project", "input");
|
|
6131
|
-
const projectInputMode = (0, import_fs18.existsSync)(projectInputDir) ? yellow2("exists") : green2("create");
|
|
6132
|
-
console.log(` ${".project/input/".padEnd(domainColWidth + 14)}${projectInputMode}`);
|
|
6133
5931
|
if (config.installFactory || config.installAbapHooks) {
|
|
6134
|
-
const claudeDir = (0,
|
|
6135
|
-
const claudeMode = (0,
|
|
5932
|
+
const claudeDir = (0, import_path17.join)(config.projectPath, ".claude");
|
|
5933
|
+
const claudeMode = (0, import_fs17.existsSync)(claudeDir) ? yellow2("merge") : green2("create");
|
|
6136
5934
|
console.log(` ${".claude/".padEnd(domainColWidth + 14)}${claudeMode}`);
|
|
6137
|
-
const settingsPath = (0,
|
|
6138
|
-
const settingsMode = (0,
|
|
5935
|
+
const settingsPath = (0, import_path17.join)(config.projectPath, ".claude", "settings.json");
|
|
5936
|
+
const settingsMode = (0, import_fs17.existsSync)(settingsPath) ? yellow2("merge") : green2("create");
|
|
6139
5937
|
console.log(` ${".claude/settings.json".padEnd(domainColWidth + 14)}${settingsMode}`);
|
|
6140
5938
|
}
|
|
6141
5939
|
if (serverEntries.length > 0) {
|
|
@@ -6148,7 +5946,7 @@ async function previewAndConfirm(config, options) {
|
|
|
6148
5946
|
}
|
|
6149
5947
|
}
|
|
6150
5948
|
console.log("\n" + "\u2500".repeat(48));
|
|
6151
|
-
return
|
|
5949
|
+
return esm_default2({ message: "Proceed?", default: true });
|
|
6152
5950
|
}
|
|
6153
5951
|
function printSummary2(result, config) {
|
|
6154
5952
|
const failed = result.entries.filter((e) => e.result.status === "failed");
|