@adhdev/daemon-core 0.5.31 → 0.5.32
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.d.ts
CHANGED
|
@@ -2615,6 +2615,8 @@ declare class CliProviderInstance implements ProviderInstance {
|
|
|
2615
2615
|
getState(): ProviderState;
|
|
2616
2616
|
onEvent(event: string, data?: any): void;
|
|
2617
2617
|
dispose(): void;
|
|
2618
|
+
private completedDebounceTimer;
|
|
2619
|
+
private completedDebouncePending;
|
|
2618
2620
|
private detectStatusTransition;
|
|
2619
2621
|
private pushEvent;
|
|
2620
2622
|
private flushEvents;
|
package/dist/index.js
CHANGED
|
@@ -6745,7 +6745,7 @@ try {
|
|
|
6745
6745
|
LOG.error("CLI", "[ProviderCliAdapter] node-pty not found. Terminal features disabled.");
|
|
6746
6746
|
}
|
|
6747
6747
|
function stripAnsi(str) {
|
|
6748
|
-
return str.replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, "").replace(/\x1B\][^\x07]*\x07/g, "").replace(/\x1B\][^\x1B]*\x1B\\/g, "");
|
|
6748
|
+
return str.replace(/\x1B\[\d*[A-HJKSTfG]/g, " ").replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, "").replace(/\x1B\][^\x07]*\x07/g, "").replace(/\x1B\][^\x1B]*\x1B\\/g, "").replace(/ +/g, " ");
|
|
6749
6749
|
}
|
|
6750
6750
|
function findBinary(name) {
|
|
6751
6751
|
const isWin = os11.platform() === "win32";
|
|
@@ -7053,6 +7053,9 @@ var ProviderCliAdapter = class {
|
|
|
7053
7053
|
}
|
|
7054
7054
|
return;
|
|
7055
7055
|
}
|
|
7056
|
+
if (cleanData.trim().length > 5) {
|
|
7057
|
+
LOG.debug("CLI", `[${this.cliType}] output chunk (${cleanData.length}): ${cleanData.slice(0, 300).replace(/\n/g, "\\n")}`);
|
|
7058
|
+
}
|
|
7056
7059
|
const hasApproval = patterns.approval.some((p) => p.test(this.recentOutputBuffer));
|
|
7057
7060
|
if (hasApproval && this.currentStatus !== "waiting_approval") {
|
|
7058
7061
|
const inCooldown = this.lastApprovalResolvedAt && Date.now() - this.lastApprovalResolvedAt < this.timeouts.approvalCooldown;
|
|
@@ -7417,7 +7420,8 @@ var CliProviderInstance = class {
|
|
|
7417
7420
|
this.adapter.shutdown();
|
|
7418
7421
|
this.monitor.reset();
|
|
7419
7422
|
}
|
|
7420
|
-
|
|
7423
|
+
completedDebounceTimer = null;
|
|
7424
|
+
completedDebouncePending = null;
|
|
7421
7425
|
detectStatusTransition() {
|
|
7422
7426
|
const now = Date.now();
|
|
7423
7427
|
const adapterStatus = this.adapter.getStatus();
|
|
@@ -7427,7 +7431,15 @@ var CliProviderInstance = class {
|
|
|
7427
7431
|
if (newStatus !== this.lastStatus) {
|
|
7428
7432
|
LOG.info("CLI", `[${this.type}] status: ${this.lastStatus} \u2192 ${newStatus}`);
|
|
7429
7433
|
if (this.lastStatus === "idle" && newStatus === "generating") {
|
|
7430
|
-
this.
|
|
7434
|
+
if (this.completedDebouncePending) {
|
|
7435
|
+
LOG.info("CLI", `[${this.type}] cancelled pending completed (resumed generating)`);
|
|
7436
|
+
if (this.completedDebounceTimer) {
|
|
7437
|
+
clearTimeout(this.completedDebounceTimer);
|
|
7438
|
+
this.completedDebounceTimer = null;
|
|
7439
|
+
}
|
|
7440
|
+
this.completedDebouncePending = null;
|
|
7441
|
+
}
|
|
7442
|
+
if (!this.generatingStartedAt) this.generatingStartedAt = now;
|
|
7431
7443
|
if (this.generatingDebounceTimer) clearTimeout(this.generatingDebounceTimer);
|
|
7432
7444
|
this.generatingDebouncePending = { chatTitle, timestamp: now };
|
|
7433
7445
|
this.generatingDebounceTimer = setTimeout(() => {
|
|
@@ -7446,6 +7458,11 @@ var CliProviderInstance = class {
|
|
|
7446
7458
|
this.pushEvent({ event: "agent:generating_started", ...this.generatingDebouncePending });
|
|
7447
7459
|
this.generatingDebouncePending = null;
|
|
7448
7460
|
}
|
|
7461
|
+
if (this.completedDebounceTimer) {
|
|
7462
|
+
clearTimeout(this.completedDebounceTimer);
|
|
7463
|
+
this.completedDebounceTimer = null;
|
|
7464
|
+
}
|
|
7465
|
+
this.completedDebouncePending = null;
|
|
7449
7466
|
if (!this.generatingStartedAt) this.generatingStartedAt = now;
|
|
7450
7467
|
const modal = adapterStatus.activeModal;
|
|
7451
7468
|
LOG.info("CLI", `[${this.type}] approval modal: "${modal?.message?.slice(0, 80) ?? "none"}"`);
|
|
@@ -7465,17 +7482,31 @@ var CliProviderInstance = class {
|
|
|
7465
7482
|
this.generatingDebounceTimer = null;
|
|
7466
7483
|
}
|
|
7467
7484
|
this.generatingDebouncePending = null;
|
|
7485
|
+
this.generatingStartedAt = 0;
|
|
7468
7486
|
} else {
|
|
7469
|
-
|
|
7470
|
-
this.
|
|
7487
|
+
if (this.completedDebounceTimer) clearTimeout(this.completedDebounceTimer);
|
|
7488
|
+
this.completedDebouncePending = { chatTitle, duration, timestamp: now };
|
|
7489
|
+
this.completedDebounceTimer = setTimeout(() => {
|
|
7490
|
+
if (this.completedDebouncePending) {
|
|
7491
|
+
LOG.info("CLI", `[${this.type}] completed in ${this.completedDebouncePending.duration}s`);
|
|
7492
|
+
this.pushEvent({ event: "agent:generating_completed", ...this.completedDebouncePending });
|
|
7493
|
+
this.completedDebouncePending = null;
|
|
7494
|
+
this.generatingStartedAt = 0;
|
|
7495
|
+
}
|
|
7496
|
+
this.completedDebounceTimer = null;
|
|
7497
|
+
}, 2e3);
|
|
7471
7498
|
}
|
|
7472
|
-
this.generatingStartedAt = 0;
|
|
7473
7499
|
} else if (newStatus === "stopped") {
|
|
7474
7500
|
if (this.generatingDebounceTimer) {
|
|
7475
7501
|
clearTimeout(this.generatingDebounceTimer);
|
|
7476
7502
|
this.generatingDebounceTimer = null;
|
|
7477
7503
|
}
|
|
7478
7504
|
this.generatingDebouncePending = null;
|
|
7505
|
+
if (this.completedDebounceTimer) {
|
|
7506
|
+
clearTimeout(this.completedDebounceTimer);
|
|
7507
|
+
this.completedDebounceTimer = null;
|
|
7508
|
+
}
|
|
7509
|
+
this.completedDebouncePending = null;
|
|
7479
7510
|
this.pushEvent({ event: "agent:stopped", chatTitle, timestamp: now });
|
|
7480
7511
|
}
|
|
7481
7512
|
this.lastStatus = newStatus;
|