path-terminal-init 0.2.12 → 0.2.16

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/init.js CHANGED
@@ -6115,7 +6115,7 @@ var SDK_GITHUB_URL = "https://github.com/keyman12/Path-terminal-sdk-IOS-Release"
6115
6115
  var SDK_VERSION = "1.5.0";
6116
6116
  var PATH_MAVEN_URL = "https://mcp.path2ai.tech/maven";
6117
6117
  var ANDROID_SDK_GROUP = "tech.path2ai.sdk";
6118
- var ANDROID_SDK_VERSION = "1.6.0";
6118
+ var ANDROID_SDK_VERSION = "1.9.0";
6119
6119
  var ANDROID_SDK_MODULES = ["path-core-models", "path-terminal-sdk", "path-emulator-adapter", "path-psdk-adapter"];
6120
6120
  var MCP_SERVER_URL = "https://mcp.path2ai.tech/sse";
6121
6121
  var RULES_FETCH_URL = "https://mcp.path2ai.tech/rules";
@@ -6514,6 +6514,31 @@ ${refs}
6514
6514
  fs.writeFileSync(target, content, "utf-8");
6515
6515
  return target;
6516
6516
  }
6517
+ function hasClaudeCli() {
6518
+ try {
6519
+ (0, import_child_process.execSync)(process.platform === "win32" ? "where claude" : "which claude", { stdio: "ignore" });
6520
+ return true;
6521
+ } catch {
6522
+ return false;
6523
+ }
6524
+ }
6525
+ function findClaudeBinary() {
6526
+ const home = process.env.USERPROFILE || process.env.HOME || "";
6527
+ if (!home) return null;
6528
+ const candidate = process.platform === "win32" ? path.join(home, ".local", "bin", "claude.exe") : path.join(home, ".local", "bin", "claude");
6529
+ return fs.existsSync(candidate) ? candidate : null;
6530
+ }
6531
+ function addClaudeDirToUserPath() {
6532
+ try {
6533
+ (0, import_child_process.execSync)(
6534
+ `powershell -NoProfile -Command "$u=[Environment]::GetEnvironmentVariable('Path','User'); if ($u -notlike '*\\.local\\bin*') { [Environment]::SetEnvironmentVariable('Path', ($u.TrimEnd(';') + ';' + $env:USERPROFILE + '\\.local\\bin'), 'User') }"`,
6535
+ { stdio: "ignore" }
6536
+ );
6537
+ return true;
6538
+ } catch {
6539
+ return false;
6540
+ }
6541
+ }
6517
6542
  function platformLabel(platform) {
6518
6543
  switch (platform) {
6519
6544
  case "android":
@@ -6526,7 +6551,7 @@ function platformLabel(platform) {
6526
6551
  return "iOS";
6527
6552
  }
6528
6553
  }
6529
- function printSummary(agent, platform, actions, warnings, manualSteps) {
6554
+ async function printSummary(agent, platform, actions, warnings, manualSteps) {
6530
6555
  const isAndroid = platform === "android";
6531
6556
  const isWindows = platform === "windows11" || platform === "windows10";
6532
6557
  console.log("\n" + source_default.bold("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
@@ -6550,6 +6575,38 @@ function printSummary(agent, platform, actions, warnings, manualSteps) {
6550
6575
  const mcpPrompt = platform === "android" ? "integrate-path-android" : platform === "windows11" ? "integrate-path-windows11" : platform === "windows10" ? "integrate-path-windows10" : "integrate-path-sale";
6551
6576
  const firstPrompt = ' "Integrate the Path Terminal SDK into this EPOS app. Read CLAUDE.md\n for the integration rules, then use the Path MCP ' + mcpPrompt + '\n prompt to add a Path POS Adapter in Settings \u2014 a backend switcher for the\n Path POS Emulator (Wi-Fi/IP or Bluetooth) and a real Verifone terminal."';
6552
6577
  if (agent === "claude") {
6578
+ if (!hasClaudeCli()) {
6579
+ const binary = findClaudeBinary();
6580
+ if (binary) {
6581
+ console.log(source_default.yellow(`\u26A0 Claude Code is installed (${binary}) but its folder is not on your PATH,`));
6582
+ console.log(source_default.yellow(" so the `claude` command won't work."));
6583
+ if (process.platform === "win32") {
6584
+ const fix = (await ask(source_default.bold(" Add it to your user PATH now? (y/n): "))).toLowerCase();
6585
+ if (fix === "y" && addClaudeDirToUserPath()) {
6586
+ console.log(source_default.green(" \u2713 Added to your user PATH."));
6587
+ } else {
6588
+ console.log(source_default.yellow(" To fix it yourself, run this in PowerShell:"));
6589
+ console.log(source_default.cyan(" [Environment]::SetEnvironmentVariable('Path', [Environment]::GetEnvironmentVariable('Path','User') + ';' + $env:USERPROFILE + '\\.local\\bin', 'User')"));
6590
+ }
6591
+ } else {
6592
+ console.log(source_default.yellow(" Add it to your shell profile (~/.zshrc or ~/.bashrc):"));
6593
+ console.log(source_default.cyan(` echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc`));
6594
+ }
6595
+ console.log(source_default.yellow(" \u2026then open a NEW terminal (PATH changes don't reach this one) and come back here."));
6596
+ console.log();
6597
+ } else {
6598
+ console.log(source_default.yellow("\u26A0 Claude Code is not installed (the `claude` command was not found)."));
6599
+ console.log(source_default.yellow(" Install it first:"));
6600
+ if (process.platform === "win32") {
6601
+ console.log(source_default.cyan(" irm https://claude.ai/install.ps1 | iex") + source_default.dim(" (PowerShell)"));
6602
+ console.log(source_default.cyan(" curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd") + source_default.dim(" (CMD)"));
6603
+ } else {
6604
+ console.log(source_default.cyan(" curl -fsSL https://claude.ai/install.sh | bash"));
6605
+ }
6606
+ console.log(source_default.yellow(" \u2026then restart your terminal, run `claude` once to log in, and come back here."));
6607
+ console.log();
6608
+ }
6609
+ }
6553
6610
  console.log(source_default.bold("\u{1F680} Start Claude Code in this directory:"));
6554
6611
  console.log(source_default.cyan(" claude --model sonnet"));
6555
6612
  console.log();
@@ -6566,7 +6623,7 @@ function printSummary(agent, platform, actions, warnings, manualSteps) {
6566
6623
  }
6567
6624
  program.name("path-terminal-init").description(
6568
6625
  "Set up the Path Terminal SDK integration assistant for your EPOS project.\nAuto-detects platform (iOS, Android, or Windows) from the current directory.\nConfigures MCP server access, drops the integration recipe, and optionally\nadds the SDK dependency.\n\nSupported agents: claude (default), cursor\nSupported platforms: ios (default), android, windows11 (WinUI 3 / .NET 10),\nwindows10 (WPF / .NET FW 4.8). Use 'windows' to auto-pick the Windows flavour."
6569
- ).version("0.2.0").option("--tools-only", "Only configure MCP + rules. Skip SDK installation.").option("--agent <name>", "AI agent to configure: 'claude' (default) or 'cursor'.", "claude").option("--platform <name>", "Platform: ios | android | windows | windows11 | windows10. Auto-detected if not specified.").action(async (options) => {
6626
+ ).version("0.2.16").option("--tools-only", "Only configure MCP + rules. Skip SDK installation.").option("--agent <name>", "AI agent to configure: 'claude' (default) or 'cursor'.", "claude").option("--platform <name>", "Platform: ios | android | windows | windows11 | windows10. Auto-detected if not specified.").action(async (options) => {
6570
6627
  const toolsOnly = options.toolsOnly ?? false;
6571
6628
  const agent = options.agent ?? "claude";
6572
6629
  const cwd = process.cwd();
@@ -6883,6 +6940,6 @@ program.name("path-terminal-init").description(
6883
6940
  }
6884
6941
  }
6885
6942
  }
6886
- printSummary(agent, platform, actions, warnings, manualSteps);
6943
+ await printSummary(agent, platform, actions, warnings, manualSteps);
6887
6944
  });
6888
6945
  program.parse(process.argv);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "path-terminal-init",
3
- "version": "0.2.12",
4
- "description": "One-line setup for the Path Terminal SDK integration assistant connects the user's AI agent to the Path MCP server and installs the per-OS integration recipe (iOS, Android, Windows). The single source of truth for the bootstrap CLI and the recipes.",
3
+ "version": "0.2.16",
4
+ "description": "One-line setup for the Path Terminal SDK integration assistant \u2014 connects the user's AI agent to the Path MCP server and installs the per-OS integration recipe (iOS, Android, Windows). The single source of truth for the bootstrap CLI and the recipes.",
5
5
  "bin": {
6
6
  "path-terminal-init": "dist/cli.js"
7
7
  },