path-terminal-init 0.2.12 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -93
- package/dist/cli.js +61 -4
- package/dist/init.js +60 -3
- package/package.json +2 -2
- package/rules/android/path-integration-android.mdc +421 -410
- package/rules/ios/path-integration.mdc +456 -456
- package/rules/windows-10/path-integration-windows10.mdc +304 -300
- package/rules/windows-11/path-integration-windows11.mdc +298 -294
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.
|
|
6118
|
+
var ANDROID_SDK_VERSION = "1.8.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();
|
|
@@ -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.
|
|
4
|
-
"description": "One-line setup for the Path Terminal SDK integration assistant
|
|
3
|
+
"version": "0.2.15",
|
|
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
|
},
|