adhdev 0.8.5 → 0.8.6
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/cli/index.js +95 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +38 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33795,6 +33795,8 @@ async function handleAutoImplement(ctx, type, req, res) {
|
|
|
33795
33795
|
let approvalBuffer = "";
|
|
33796
33796
|
let lastApprovalTime = 0;
|
|
33797
33797
|
let completionSignalSeen = false;
|
|
33798
|
+
let autoStopTimer = null;
|
|
33799
|
+
let autoStopIssued = false;
|
|
33798
33800
|
try {
|
|
33799
33801
|
const { normalizeCliProviderForRuntime: normalizeCliProviderForRuntime2 } = await Promise.resolve().then(() => (init_provider_cli_adapter(), provider_cli_adapter_exports));
|
|
33800
33802
|
const normalized = normalizeCliProviderForRuntime2(agentProvider);
|
|
@@ -33832,8 +33834,37 @@ async function handleAutoImplement(ctx, type, req, res) {
|
|
|
33832
33834
|
lastApprovalTime = Date.now();
|
|
33833
33835
|
}
|
|
33834
33836
|
};
|
|
33837
|
+
const clearAutoStopTimer = () => {
|
|
33838
|
+
if (autoStopTimer) {
|
|
33839
|
+
clearTimeout(autoStopTimer);
|
|
33840
|
+
autoStopTimer = null;
|
|
33841
|
+
}
|
|
33842
|
+
};
|
|
33843
|
+
const scheduleAutoStopForVerification = () => {
|
|
33844
|
+
if (!verification || command !== "codex" || completionSignalSeen || autoStopIssued) return;
|
|
33845
|
+
const elapsed = Date.now() - spawnedAt;
|
|
33846
|
+
if (elapsed < 3e4) return;
|
|
33847
|
+
clearAutoStopTimer();
|
|
33848
|
+
autoStopTimer = setTimeout(() => {
|
|
33849
|
+
if (!ctx.autoImplProcess || completionSignalSeen || autoStopIssued) return;
|
|
33850
|
+
autoStopIssued = true;
|
|
33851
|
+
ctx.log(`Auto-implement output quiet for 30s after ${Math.round((Date.now() - spawnedAt) / 1e3)}s. Interrupting agent and switching to daemon verification.`);
|
|
33852
|
+
sendAutoImplSSE(ctx, {
|
|
33853
|
+
event: "output",
|
|
33854
|
+
data: {
|
|
33855
|
+
chunk: "\n[\u{1F916} ADHDev Pipeline] Agent output quiet. Interrupting and running daemon verification...\n",
|
|
33856
|
+
stream: "stdout"
|
|
33857
|
+
}
|
|
33858
|
+
});
|
|
33859
|
+
try {
|
|
33860
|
+
ctx.autoImplProcess.kill("SIGINT");
|
|
33861
|
+
} catch {
|
|
33862
|
+
}
|
|
33863
|
+
}, 3e4);
|
|
33864
|
+
};
|
|
33835
33865
|
const finalizeCliAutoImpl = async (code) => {
|
|
33836
33866
|
ctx.autoImplProcess = null;
|
|
33867
|
+
clearAutoStopTimer();
|
|
33837
33868
|
let success2 = completionSignalSeen || code === 0;
|
|
33838
33869
|
let message = success2 ? completionSignalSeen && code !== 0 ? "\u2705 Auto-implement complete (completion signal)" : "\u2705 Auto-implement complete" : `\u274C Agent exited (code: ${code})`;
|
|
33839
33870
|
let verificationSummary = null;
|
|
@@ -33884,12 +33915,14 @@ async function handleAutoImplement(ctx, type, req, res) {
|
|
|
33884
33915
|
if (isPty) {
|
|
33885
33916
|
child.onData((data) => {
|
|
33886
33917
|
stdout += data;
|
|
33918
|
+
clearAutoStopTimer();
|
|
33887
33919
|
if (data.includes("\x1B[6n")) {
|
|
33888
33920
|
child.write("\x1B[12;1R");
|
|
33889
33921
|
ctx.log("Terminal CPR request (\\x1b[6n) intercepted in PTY, responding with dummy coordinates [12;1R]");
|
|
33890
33922
|
}
|
|
33891
33923
|
checkAutoApproval(data, (s) => child.write(s));
|
|
33892
33924
|
sendAutoImplSSE(ctx, { event: "output", data: { chunk: data, stream: "stdout" } });
|
|
33925
|
+
scheduleAutoStopForVerification();
|
|
33893
33926
|
});
|
|
33894
33927
|
child.onExit(({ exitCode: code }) => {
|
|
33895
33928
|
void finalizeCliAutoImpl(code);
|
|
@@ -33898,15 +33931,19 @@ async function handleAutoImplement(ctx, type, req, res) {
|
|
|
33898
33931
|
child.stdout?.on("data", (d) => {
|
|
33899
33932
|
const chunk = d.toString();
|
|
33900
33933
|
stdout += chunk;
|
|
33934
|
+
clearAutoStopTimer();
|
|
33901
33935
|
if (chunk.includes("\x1B[6n")) child.stdin?.write("\x1B[1;1R");
|
|
33902
33936
|
checkAutoApproval(chunk, (s) => child.stdin?.write(s));
|
|
33903
33937
|
sendAutoImplSSE(ctx, { event: "output", data: { chunk, stream: "stdout" } });
|
|
33938
|
+
scheduleAutoStopForVerification();
|
|
33904
33939
|
});
|
|
33905
33940
|
child.stderr?.on("data", (d) => {
|
|
33906
33941
|
const chunk = d.toString();
|
|
33907
33942
|
stderr += chunk;
|
|
33943
|
+
clearAutoStopTimer();
|
|
33908
33944
|
checkAutoApproval(chunk, (s) => child.stdin?.write(s));
|
|
33909
33945
|
sendAutoImplSSE(ctx, { event: "output", data: { chunk, stream: "stderr" } });
|
|
33946
|
+
scheduleAutoStopForVerification();
|
|
33910
33947
|
});
|
|
33911
33948
|
child.on("exit", (code) => {
|
|
33912
33949
|
void finalizeCliAutoImpl(code);
|
|
@@ -38510,7 +38547,7 @@ var init_adhdev_daemon = __esm({
|
|
|
38510
38547
|
fs16 = __toESM(require("fs"));
|
|
38511
38548
|
path20 = __toESM(require("path"));
|
|
38512
38549
|
import_chalk2 = __toESM(require("chalk"));
|
|
38513
|
-
pkgVersion = "0.8.
|
|
38550
|
+
pkgVersion = "0.8.6";
|
|
38514
38551
|
if (pkgVersion === "unknown") {
|
|
38515
38552
|
try {
|
|
38516
38553
|
const possiblePaths = [
|