@cydm/pie 1.0.2 → 1.0.3
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/builtin/extensions/subagent/index.js +10 -0
- package/dist/cli.js +32 -12
- package/package.json +1 -1
|
@@ -3716,6 +3716,9 @@ function logHttp(level, message, data) {
|
|
|
3716
3716
|
}
|
|
3717
3717
|
}
|
|
3718
3718
|
}
|
|
3719
|
+
function isAbortErrorMessage(message) {
|
|
3720
|
+
return message === "Request was aborted" || message === "Operation aborted";
|
|
3721
|
+
}
|
|
3719
3722
|
initLogFile();
|
|
3720
3723
|
var nodeHttps = null;
|
|
3721
3724
|
var nodeHttp = null;
|
|
@@ -3976,6 +3979,13 @@ var NodeHttpClient = class {
|
|
|
3976
3979
|
resolve(response);
|
|
3977
3980
|
});
|
|
3978
3981
|
req.on("error", (e) => {
|
|
3982
|
+
if (isAbortErrorMessage(e.message) && options.signal?.aborted) {
|
|
3983
|
+
logHttp("DEBUG", `Request [${requestId}] aborted`, {
|
|
3984
|
+
totalTimeMs: Date.now() - requestStartTime
|
|
3985
|
+
});
|
|
3986
|
+
reject(e);
|
|
3987
|
+
return;
|
|
3988
|
+
}
|
|
3979
3989
|
logHttp("ERROR", `Request [${requestId}] failed`, {
|
|
3980
3990
|
error: e.message,
|
|
3981
3991
|
totalTimeMs: Date.now() - requestStartTime
|
package/dist/cli.js
CHANGED
|
@@ -4914,6 +4914,9 @@ function logHttp(level, message, data) {
|
|
|
4914
4914
|
}
|
|
4915
4915
|
}
|
|
4916
4916
|
}
|
|
4917
|
+
function isAbortErrorMessage(message) {
|
|
4918
|
+
return message === "Request was aborted" || message === "Operation aborted";
|
|
4919
|
+
}
|
|
4917
4920
|
function getNodeHttps() {
|
|
4918
4921
|
if (!nodeHttps) {
|
|
4919
4922
|
nodeHttps = require3("https");
|
|
@@ -5184,6 +5187,13 @@ var init_http = __esm({
|
|
|
5184
5187
|
resolve5(response);
|
|
5185
5188
|
});
|
|
5186
5189
|
req.on("error", (e) => {
|
|
5190
|
+
if (isAbortErrorMessage(e.message) && options.signal?.aborted) {
|
|
5191
|
+
logHttp("DEBUG", `Request [${requestId}] aborted`, {
|
|
5192
|
+
totalTimeMs: Date.now() - requestStartTime
|
|
5193
|
+
});
|
|
5194
|
+
reject(e);
|
|
5195
|
+
return;
|
|
5196
|
+
}
|
|
5187
5197
|
logHttp("ERROR", `Request [${requestId}] failed`, {
|
|
5188
5198
|
error: e.message,
|
|
5189
5199
|
totalTimeMs: Date.now() - requestStartTime
|
|
@@ -65450,6 +65460,7 @@ init_file_logger();
|
|
|
65450
65460
|
import * as fs4 from "node:fs";
|
|
65451
65461
|
import * as os2 from "os";
|
|
65452
65462
|
import * as path3 from "path";
|
|
65463
|
+
import { pathToFileURL } from "node:url";
|
|
65453
65464
|
|
|
65454
65465
|
// src/config.ts
|
|
65455
65466
|
import { existsSync as existsSync3, mkdirSync as mkdirSync4, readFileSync as readFileSync2, renameSync } from "fs";
|
|
@@ -65823,7 +65834,7 @@ function resolvePath(extPath, cwd) {
|
|
|
65823
65834
|
}
|
|
65824
65835
|
async function loadExtensionModule(extensionPath) {
|
|
65825
65836
|
try {
|
|
65826
|
-
const module = await import(extensionPath);
|
|
65837
|
+
const module = await import(normalizeExtensionImportPath(extensionPath));
|
|
65827
65838
|
const factory = module.default ?? module;
|
|
65828
65839
|
if (typeof factory !== "function") {
|
|
65829
65840
|
return null;
|
|
@@ -65835,6 +65846,15 @@ async function loadExtensionModule(extensionPath) {
|
|
|
65835
65846
|
);
|
|
65836
65847
|
}
|
|
65837
65848
|
}
|
|
65849
|
+
function normalizeExtensionImportPath(extensionPath) {
|
|
65850
|
+
if (/^[a-zA-Z]:[\\/]/.test(extensionPath)) {
|
|
65851
|
+
return `file:///${extensionPath.replace(/\\/g, "/")}`;
|
|
65852
|
+
}
|
|
65853
|
+
if (path3.isAbsolute(extensionPath)) {
|
|
65854
|
+
return pathToFileURL(extensionPath).href;
|
|
65855
|
+
}
|
|
65856
|
+
return extensionPath;
|
|
65857
|
+
}
|
|
65838
65858
|
async function loadExtension2(extensionPath, cwd, uiContext, abortFn, isIdleFn, hasUI, actions) {
|
|
65839
65859
|
const resolvedPath = resolvePath(extensionPath, cwd);
|
|
65840
65860
|
if (!fs4.existsSync(resolvedPath)) {
|
|
@@ -76868,6 +76888,7 @@ ${newToolsSection}`
|
|
|
76868
76888
|
this.safeRequestRender();
|
|
76869
76889
|
this.agent.abort();
|
|
76870
76890
|
const cleanup = async () => {
|
|
76891
|
+
let timedOut = false;
|
|
76871
76892
|
try {
|
|
76872
76893
|
await Promise.race([
|
|
76873
76894
|
this.agent.waitForIdle(),
|
|
@@ -76876,12 +76897,19 @@ ${newToolsSection}`
|
|
|
76876
76897
|
)
|
|
76877
76898
|
]);
|
|
76878
76899
|
} catch {
|
|
76900
|
+
timedOut = true;
|
|
76901
|
+
}
|
|
76902
|
+
if (timedOut || this.agent.state.isStreaming) {
|
|
76903
|
+
this.agent.resetProcessingState();
|
|
76879
76904
|
}
|
|
76880
76905
|
this.isProcessing = false;
|
|
76881
76906
|
this.setSubmitLock(false);
|
|
76882
76907
|
this.isInterrupting = false;
|
|
76908
|
+
this.streamingComponent = void 0;
|
|
76909
|
+
this.queuedSubmissionText = void 0;
|
|
76883
76910
|
this.footer.setState({ status: "ready" });
|
|
76884
76911
|
this.pendingTools.clear();
|
|
76912
|
+
this.ui.setFocus(this.editor);
|
|
76885
76913
|
this.chatContainer.addChild(new Text(theme.fg("warning", "\u26A0 Interrupted by user"), 1, 0));
|
|
76886
76914
|
this.chatContainer.addChild(new Spacer(1));
|
|
76887
76915
|
this.safeRequestRender();
|
|
@@ -78053,6 +78081,9 @@ ${args}` : skillBlock;
|
|
|
78053
78081
|
this.chatContainer.addChild(new Spacer(1));
|
|
78054
78082
|
this.chatContainer.addChild(new Text(theme.fg("accent", `$ ${command}`), 1, 0));
|
|
78055
78083
|
this.editor.setText("");
|
|
78084
|
+
const outputContainer = new Container();
|
|
78085
|
+
outputContainer.addChild(new Spacer(1));
|
|
78086
|
+
this.chatContainer.addChild(outputContainer);
|
|
78056
78087
|
this.ui.requestRender();
|
|
78057
78088
|
const { spawn: spawn3 } = await import("child_process");
|
|
78058
78089
|
const child = spawn3("bash", ["-c", command], {
|
|
@@ -78060,16 +78091,9 @@ ${args}` : skillBlock;
|
|
|
78060
78091
|
env: process.env
|
|
78061
78092
|
});
|
|
78062
78093
|
let output = "";
|
|
78063
|
-
let isOutputAdded = false;
|
|
78064
|
-
const outputContainer = new Container();
|
|
78065
|
-
outputContainer.addChild(new Spacer(1));
|
|
78066
78094
|
child.stdout.on("data", (data) => {
|
|
78067
78095
|
const text = data.toString();
|
|
78068
78096
|
output += text;
|
|
78069
|
-
if (!isOutputAdded) {
|
|
78070
|
-
this.chatContainer.addChild(outputContainer);
|
|
78071
|
-
isOutputAdded = true;
|
|
78072
|
-
}
|
|
78073
78097
|
const lines = text.split("\n");
|
|
78074
78098
|
for (const line of lines) {
|
|
78075
78099
|
if (line || lines.indexOf(line) < lines.length - 1) {
|
|
@@ -78081,10 +78105,6 @@ ${args}` : skillBlock;
|
|
|
78081
78105
|
child.stderr.on("data", (data) => {
|
|
78082
78106
|
const text = data.toString();
|
|
78083
78107
|
output += text;
|
|
78084
|
-
if (!isOutputAdded) {
|
|
78085
|
-
this.chatContainer.addChild(outputContainer);
|
|
78086
|
-
isOutputAdded = true;
|
|
78087
|
-
}
|
|
78088
78108
|
const lines = text.split("\n");
|
|
78089
78109
|
for (const line of lines) {
|
|
78090
78110
|
if (line || lines.indexOf(line) < lines.length - 1) {
|