spets 0.1.23 → 0.1.25
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/index.js +17 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1538,11 +1538,11 @@ var CLIAIAdapter = class {
|
|
|
1538
1538
|
mkdirSync4(outputDir, { recursive: true });
|
|
1539
1539
|
}
|
|
1540
1540
|
}
|
|
1541
|
-
await this.callClaude(params.prompt);
|
|
1541
|
+
const stdout = await this.callClaude(params.prompt);
|
|
1542
1542
|
if (params.outputPath && existsSync7(params.outputPath)) {
|
|
1543
1543
|
return readFileSync7(params.outputPath, "utf-8");
|
|
1544
1544
|
}
|
|
1545
|
-
return
|
|
1545
|
+
return stdout;
|
|
1546
1546
|
}
|
|
1547
1547
|
async callClaude(prompt) {
|
|
1548
1548
|
return new Promise((resolve, reject) => {
|
|
@@ -1554,6 +1554,7 @@ var CLIAIAdapter = class {
|
|
|
1554
1554
|
});
|
|
1555
1555
|
proc.stdin.write(prompt);
|
|
1556
1556
|
proc.stdin.end();
|
|
1557
|
+
let stdout = "";
|
|
1557
1558
|
let stderr = "";
|
|
1558
1559
|
const frames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
1559
1560
|
let frameIndex = 0;
|
|
@@ -1565,6 +1566,9 @@ var CLIAIAdapter = class {
|
|
|
1565
1566
|
process.stdout.write(`\r${success ? "\u2713" : "\u2717"} Claude ${success ? "done" : "failed"}
|
|
1566
1567
|
`);
|
|
1567
1568
|
};
|
|
1569
|
+
proc.stdout.on("data", (data) => {
|
|
1570
|
+
stdout += data.toString();
|
|
1571
|
+
});
|
|
1568
1572
|
proc.stderr.on("data", (data) => {
|
|
1569
1573
|
stderr += data.toString();
|
|
1570
1574
|
});
|
|
@@ -1573,7 +1577,7 @@ var CLIAIAdapter = class {
|
|
|
1573
1577
|
if (code !== 0) {
|
|
1574
1578
|
reject(new Error(`Claude CLI exited with code ${code}: ${stderr}`));
|
|
1575
1579
|
} else {
|
|
1576
|
-
resolve();
|
|
1580
|
+
resolve(stdout);
|
|
1577
1581
|
}
|
|
1578
1582
|
});
|
|
1579
1583
|
proc.on("error", (err) => {
|
|
@@ -1718,11 +1722,11 @@ var GitHubAIAdapter = class {
|
|
|
1718
1722
|
mkdirSync5(outputDir, { recursive: true });
|
|
1719
1723
|
}
|
|
1720
1724
|
}
|
|
1721
|
-
await this.callClaude(params.prompt);
|
|
1725
|
+
const stdout = await this.callClaude(params.prompt);
|
|
1722
1726
|
if (params.outputPath && existsSync8(params.outputPath)) {
|
|
1723
1727
|
return readFileSync8(params.outputPath, "utf-8");
|
|
1724
1728
|
}
|
|
1725
|
-
return
|
|
1729
|
+
return stdout;
|
|
1726
1730
|
}
|
|
1727
1731
|
async callClaude(prompt) {
|
|
1728
1732
|
return new Promise((resolve, reject) => {
|
|
@@ -1730,11 +1734,17 @@ var GitHubAIAdapter = class {
|
|
|
1730
1734
|
"--permission-mode",
|
|
1731
1735
|
"bypassPermissions"
|
|
1732
1736
|
], {
|
|
1733
|
-
stdio: ["pipe", "
|
|
1737
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
1734
1738
|
});
|
|
1735
1739
|
proc.stdin.write(prompt);
|
|
1736
1740
|
proc.stdin.end();
|
|
1741
|
+
let stdout = "";
|
|
1737
1742
|
let stderr = "";
|
|
1743
|
+
proc.stdout.on("data", (data) => {
|
|
1744
|
+
const chunk = data.toString();
|
|
1745
|
+
stdout += chunk;
|
|
1746
|
+
process.stdout.write(chunk);
|
|
1747
|
+
});
|
|
1738
1748
|
proc.stderr.on("data", (data) => {
|
|
1739
1749
|
stderr += data.toString();
|
|
1740
1750
|
});
|
|
@@ -1742,7 +1752,7 @@ var GitHubAIAdapter = class {
|
|
|
1742
1752
|
if (code !== 0) {
|
|
1743
1753
|
reject(new Error(`Claude CLI exited with code ${code}: ${stderr}`));
|
|
1744
1754
|
} else {
|
|
1745
|
-
resolve();
|
|
1755
|
+
resolve(stdout);
|
|
1746
1756
|
}
|
|
1747
1757
|
});
|
|
1748
1758
|
proc.on("error", (err) => {
|