ai-battery 0.1.12 → 0.1.13
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/ai-battery.js +23 -7
- package/package.json +1 -1
package/bin/ai-battery.js
CHANGED
|
@@ -1532,6 +1532,25 @@ function codexRunnerExists(runnerPath = codexRunnerPath()) {
|
|
|
1532
1532
|
return isExecutable(runnerPath);
|
|
1533
1533
|
}
|
|
1534
1534
|
|
|
1535
|
+
function requestedRowptyConptyMode() {
|
|
1536
|
+
return String(process.env.AI_BATTERY_ROWPTY_CONPTY || process.env.CLAUDEX_BATTERY_ROWPTY_CONPTY || "os").toLowerCase();
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
function bundledRowptyConptyRequested() {
|
|
1540
|
+
return ["bundled", "node-pty", "nodepty", "auto", "default"].includes(requestedRowptyConptyMode());
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
function rowptyDiagnostic(rowpty, platform = process.platform) {
|
|
1544
|
+
if (platform !== "win32") return null;
|
|
1545
|
+
const bundledConpty = rowpty ? fs.existsSync(path.join(path.dirname(rowpty), "conpty.dll")) : false;
|
|
1546
|
+
return {
|
|
1547
|
+
path: rowpty,
|
|
1548
|
+
installed: Boolean(rowpty),
|
|
1549
|
+
bundledConpty,
|
|
1550
|
+
bundledConptyRequested: bundledRowptyConptyRequested()
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1535
1554
|
function diagnoseCodex() {
|
|
1536
1555
|
const config = readConfig();
|
|
1537
1556
|
const configuredWrapper = config.codexWrapper?.wrapperPath || codexWrapperPathInDir(defaultCodexShimDir());
|
|
@@ -1574,13 +1593,11 @@ function diagnoseCodex() {
|
|
|
1574
1593
|
notes.push(`AI Battery runner is missing or not executable: ${runnerPath}`);
|
|
1575
1594
|
}
|
|
1576
1595
|
const rowpty = process.platform === "win32" ? rowptyExePath() : null;
|
|
1577
|
-
const
|
|
1578
|
-
const requestedRowptyConpty = String(process.env.AI_BATTERY_ROWPTY_CONPTY || process.env.CLAUDEX_BATTERY_ROWPTY_CONPTY || "os").toLowerCase();
|
|
1579
|
-
const bundledRowptyConptyRequested = ["bundled", "node-pty", "nodepty", "auto", "default"].includes(requestedRowptyConpty);
|
|
1596
|
+
const rowptyInfo = rowptyDiagnostic(rowpty);
|
|
1580
1597
|
if (wrapperInstalled && process.platform === "win32" && !rowpty) {
|
|
1581
1598
|
notes.push("rowpty.exe not found, so the Codex bottom row uses the overlay fallback. Run: ai-battery setup codex (compiles it locally with the in-box csc.exe).");
|
|
1582
1599
|
}
|
|
1583
|
-
if (rowpty &&
|
|
1600
|
+
if (rowpty && rowptyInfo?.bundledConptyRequested && !rowptyInfo.bundledConpty) {
|
|
1584
1601
|
notes.push("Bundled ConPTY was requested, but conpty.dll is not next to rowpty.exe. Run: ai-battery setup codex with the node-pty package installed, or unset AI_BATTERY_ROWPTY_CONPTY to use the faster OS ConPTY default.");
|
|
1585
1602
|
}
|
|
1586
1603
|
if (wrapperInstalled && process.platform !== "win32" && !python3) {
|
|
@@ -1601,9 +1618,7 @@ function diagnoseCodex() {
|
|
|
1601
1618
|
wrapperInstalled,
|
|
1602
1619
|
runnerPath,
|
|
1603
1620
|
runnerExists,
|
|
1604
|
-
rowpty:
|
|
1605
|
-
? { path: rowpty, installed: Boolean(rowpty), bundledConpty: rowptyConpty, bundledConptyRequested }
|
|
1606
|
-
: null,
|
|
1621
|
+
rowpty: rowptyInfo,
|
|
1607
1622
|
statusLine,
|
|
1608
1623
|
python3,
|
|
1609
1624
|
originalCommand: configuredOriginal,
|
|
@@ -4471,6 +4486,7 @@ export {
|
|
|
4471
4486
|
removeAiBatteryShellPathBlock,
|
|
4472
4487
|
percentValue,
|
|
4473
4488
|
providerRunningInProcesses,
|
|
4489
|
+
rowptyDiagnostic,
|
|
4474
4490
|
sameFilePath,
|
|
4475
4491
|
visibleWidth,
|
|
4476
4492
|
uninstallClaudeStatusline,
|