dlw-machine-setup 0.9.2 → 0.9.4

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.
Files changed (2) hide show
  1. package/bin/installer.js +124 -48
  2. package/package.json +1 -1
package/bin/installer.js CHANGED
@@ -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 ansiEscapes4 = module2.exports;
1616
- module2.exports.default = ansiEscapes4;
1615
+ var ansiEscapes5 = module2.exports;
1616
+ module2.exports.default = ansiEscapes5;
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
- ansiEscapes4.cursorTo = (x, y) => {
1622
+ ansiEscapes5.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
- ansiEscapes4.cursorMove = (x, y) => {
1631
+ ansiEscapes5.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
- 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) => {
1648
+ ansiEscapes5.cursorUp = (count = 1) => ESC + count + "A";
1649
+ ansiEscapes5.cursorDown = (count = 1) => ESC + count + "B";
1650
+ ansiEscapes5.cursorForward = (count = 1) => ESC + count + "C";
1651
+ ansiEscapes5.cursorBackward = (count = 1) => ESC + count + "D";
1652
+ ansiEscapes5.cursorLeft = ESC + "G";
1653
+ ansiEscapes5.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s";
1654
+ ansiEscapes5.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u";
1655
+ ansiEscapes5.cursorGetPosition = ESC + "6n";
1656
+ ansiEscapes5.cursorNextLine = ESC + "E";
1657
+ ansiEscapes5.cursorPrevLine = ESC + "F";
1658
+ ansiEscapes5.cursorHide = ESC + "?25l";
1659
+ ansiEscapes5.cursorShow = ESC + "?25h";
1660
+ ansiEscapes5.eraseLines = (count) => {
1661
1661
  let clear = "";
1662
1662
  for (let i = 0; i < count; i++) {
1663
- clear += ansiEscapes4.eraseLine + (i < count - 1 ? ansiEscapes4.cursorUp() : "");
1663
+ clear += ansiEscapes5.eraseLine + (i < count - 1 ? ansiEscapes5.cursorUp() : "");
1664
1664
  }
1665
1665
  if (count) {
1666
- clear += ansiEscapes4.cursorLeft;
1666
+ clear += ansiEscapes5.cursorLeft;
1667
1667
  }
1668
1668
  return clear;
1669
1669
  };
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` : (
1670
+ ansiEscapes5.eraseEndLine = ESC + "K";
1671
+ ansiEscapes5.eraseStartLine = ESC + "1K";
1672
+ ansiEscapes5.eraseLine = ESC + "2K";
1673
+ ansiEscapes5.eraseDown = ESC + "J";
1674
+ ansiEscapes5.eraseUp = ESC + "1J";
1675
+ ansiEscapes5.eraseScreen = ESC + "2J";
1676
+ ansiEscapes5.scrollUp = ESC + "S";
1677
+ ansiEscapes5.scrollDown = ESC + "T";
1678
+ ansiEscapes5.clearScreen = "\x1Bc";
1679
+ ansiEscapes5.clearTerminal = process.platform === "win32" ? `${ansiEscapes5.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
- `${ansiEscapes4.eraseScreen}${ESC}3J${ESC}H`
1684
+ `${ansiEscapes5.eraseScreen}${ESC}3J${ESC}H`
1685
1685
  );
1686
- ansiEscapes4.beep = BEL;
1687
- ansiEscapes4.link = (text, url) => {
1686
+ ansiEscapes5.beep = BEL;
1687
+ ansiEscapes5.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
- ansiEscapes4.image = (buffer, options = {}) => {
1703
+ ansiEscapes5.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
- ansiEscapes4.iTerm = {
1716
+ ansiEscapes5.iTerm = {
1717
1717
  setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
1718
1718
  annotation: (message, options = {}) => {
1719
1719
  let ret = `${OSC}1337;`;
@@ -3103,9 +3103,60 @@ var esm_default4 = createPrompt((config, done) => {
3103
3103
  ];
3104
3104
  });
3105
3105
 
3106
+ // node_modules/@inquirer/password/dist/esm/index.mjs
3107
+ var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
3108
+ var esm_default5 = createPrompt((config, done) => {
3109
+ const { validate = () => true } = config;
3110
+ const theme = makeTheme(config.theme);
3111
+ const [status, setStatus] = useState("pending");
3112
+ const [errorMsg, setError] = useState();
3113
+ const [value, setValue] = useState("");
3114
+ const isLoading = status === "loading";
3115
+ const prefix = usePrefix({ isLoading, theme });
3116
+ useKeypress(async (key, rl) => {
3117
+ if (status !== "pending") {
3118
+ return;
3119
+ }
3120
+ if (isEnterKey(key)) {
3121
+ const answer = value;
3122
+ setStatus("loading");
3123
+ const isValid = await validate(answer);
3124
+ if (isValid === true) {
3125
+ setValue(answer);
3126
+ setStatus("done");
3127
+ done(answer);
3128
+ } else {
3129
+ rl.write(value);
3130
+ setError(isValid || "You must provide a valid value");
3131
+ setStatus("pending");
3132
+ }
3133
+ } else {
3134
+ setValue(rl.line);
3135
+ setError(void 0);
3136
+ }
3137
+ });
3138
+ const message = theme.style.message(config.message);
3139
+ let formattedValue = "";
3140
+ let helpTip;
3141
+ if (config.mask) {
3142
+ const maskChar = typeof config.mask === "string" ? config.mask : "*";
3143
+ formattedValue = maskChar.repeat(value.length);
3144
+ } else if (status !== "done") {
3145
+ helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes3.default.cursorHide}`;
3146
+ }
3147
+ if (status === "done") {
3148
+ formattedValue = theme.style.answer(formattedValue);
3149
+ }
3150
+ let error = "";
3151
+ if (errorMsg) {
3152
+ error = theme.style.error(errorMsg);
3153
+ }
3154
+ return [[prefix, message, config.mask ? formattedValue : helpTip].join(" "), error];
3155
+ });
3156
+
3106
3157
  // node_modules/@inquirer/select/dist/esm/index.mjs
3107
3158
  var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
3108
- var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
3159
+ var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1);
3109
3160
  var selectTheme = {
3110
3161
  icon: { cursor: esm_default.pointer },
3111
3162
  style: {
@@ -3139,7 +3190,7 @@ function normalizeChoices2(choices) {
3139
3190
  };
3140
3191
  });
3141
3192
  }
3142
- var esm_default5 = createPrompt((config, done) => {
3193
+ var esm_default6 = createPrompt((config, done) => {
3143
3194
  const { loop = true, pageSize = 7 } = config;
3144
3195
  const firstRender = useRef(true);
3145
3196
  const theme = makeTheme(selectTheme, config.theme);
@@ -3240,7 +3291,7 @@ ${theme.style.help("(Use arrow keys to reveal more choices)")}`;
3240
3291
  const choiceDescription = selectedChoice.description ? `
3241
3292
  ${theme.style.description(selectedChoice.description)}` : ``;
3242
3293
  return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")}
3243
- ${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes3.default.cursorHide}`;
3294
+ ${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes4.default.cursorHide}`;
3244
3295
  });
3245
3296
 
3246
3297
  // src/index.ts
@@ -5517,7 +5568,13 @@ var write_state_default = defineStep({
5517
5568
  instructions: target.instructions,
5518
5569
  mcpConfig: target.mcpConfig,
5519
5570
  contexts: "_ai-context/",
5520
- factory: ctx.installed.factoryInstalled ? "factory/" : null,
5571
+ /* Factory v2 bundle lands assets under .claude/ via the
5572
+ * Claude Code profile (agents/, skills/, factory/, hooks/, plus
5573
+ * a merge into .claude/settings.json). The legacy 'factory/'
5574
+ * top-level path was retired in installer v0.8.0 when the
5575
+ * per-agent profile dispatch took over — keeping it here would
5576
+ * mislead the uninstall preview which reads this field. */
5577
+ factory: ctx.installed.factoryInstalled ? ".claude/" : null,
5521
5578
  abapHooks: ctx.installed.abapHooksInstalled ? ".claude/hooks/" : null,
5522
5579
  globalConfig: (0, import_path14.join)((0, import_os2.homedir)(), ".one-shot-installer")
5523
5580
  }
@@ -5821,7 +5878,7 @@ async function collectInputs(options, releaseVersion, factoryAvailable = false,
5821
5878
  loop: false
5822
5879
  });
5823
5880
  const selectedTechnologies = options.technologies.filter((p) => selectedIds.includes(p.id));
5824
- const agent = await esm_default5({
5881
+ const agent = await esm_default6({
5825
5882
  message: "AI coding tool:",
5826
5883
  choices: options.agents,
5827
5884
  loop: false
@@ -5844,6 +5901,27 @@ async function collectInputs(options, releaseVersion, factoryAvailable = false,
5844
5901
  }
5845
5902
  }
5846
5903
  }
5904
+ if (mcpConfig["sap_mcp_server"]) {
5905
+ const sapUser = (await esm_default4({
5906
+ message: "SAP MCP (ABAP F4P) username (leave empty to skip):"
5907
+ })).trim();
5908
+ if (sapUser === "") {
5909
+ delete mcpConfig["sap_mcp_server"];
5910
+ } else {
5911
+ const sapPassword = await esm_default5({
5912
+ message: "SAP MCP (ABAP F4P) password:",
5913
+ mask: "*"
5914
+ });
5915
+ if (sapPassword === "") {
5916
+ delete mcpConfig["sap_mcp_server"];
5917
+ } else {
5918
+ const encoded = Buffer.from(`${sapUser}:${sapPassword}`).toString("base64");
5919
+ if (mcpConfig["sap_mcp_server"].installCommand) {
5920
+ mcpConfig["sap_mcp_server"].installCommand = mcpConfig["sap_mcp_server"].installCommand.replace(/__SAP_MCP_AUTH__/g, encoded);
5921
+ }
5922
+ }
5923
+ }
5924
+ }
5847
5925
  const projectInput = await esm_default4({
5848
5926
  message: "Project directory:",
5849
5927
  default: (0, import_path16.resolve)(process.cwd())
@@ -5897,15 +5975,13 @@ async function previewAndConfirm(config, options) {
5897
5975
  console.log(` ${instructionFile.padEnd(domainColWidth + 14)}${instructionMode}`);
5898
5976
  console.log(` ${mcpConfigFile.padEnd(domainColWidth + 14)}${mcpMode}`);
5899
5977
  console.log(` ${".gitignore".padEnd(domainColWidth + 14)}${gitignoreMode}`);
5900
- if (config.installFactory) {
5901
- const factoryExists = (0, import_fs16.existsSync)((0, import_path16.join)(config.projectPath, "factory"));
5902
- const factoryMode = factoryExists ? yellow2("overwrite") : green2("create");
5903
- console.log(` ${"factory/".padEnd(domainColWidth + 14)}${factoryMode}`);
5904
- }
5905
- if (config.installAbapHooks) {
5906
- const hooksDir = (0, import_path16.join)(config.projectPath, ".claude", "hooks");
5907
- const hooksMode = (0, import_fs16.existsSync)(hooksDir) ? yellow2("merge") : green2("create");
5908
- console.log(` ${".claude/hooks/".padEnd(domainColWidth + 14)}${hooksMode}`);
5978
+ if (config.installFactory || config.installAbapHooks) {
5979
+ const claudeDir = (0, import_path16.join)(config.projectPath, ".claude");
5980
+ const claudeMode = (0, import_fs16.existsSync)(claudeDir) ? yellow2("merge") : green2("create");
5981
+ console.log(` ${".claude/".padEnd(domainColWidth + 14)}${claudeMode}`);
5982
+ const settingsPath = (0, import_path16.join)(config.projectPath, ".claude", "settings.json");
5983
+ const settingsMode = (0, import_fs16.existsSync)(settingsPath) ? yellow2("merge") : green2("create");
5984
+ console.log(` ${".claude/settings.json".padEnd(domainColWidth + 14)}${settingsMode}`);
5909
5985
  }
5910
5986
  if (serverEntries.length > 0) {
5911
5987
  console.log("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlw-machine-setup",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "description": "One-shot installer for The Machine toolchain",
5
5
  "bin": {
6
6
  "dlw-machine-setup": "bin/installer.js"