adhdev 0.8.59 → 0.8.60
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 +20 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +20 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -10686,6 +10686,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
10686
10686
|
static MAX_TRACE_ENTRIES = 250;
|
|
10687
10687
|
providerResolutionMeta;
|
|
10688
10688
|
static IDLE_FINISH_CONFIRM_MS = 2e3;
|
|
10689
|
+
static HERMES_IDLE_FINISH_CONFIRM_MS = 5e3;
|
|
10689
10690
|
static STATUS_ACTIVITY_HOLD_MS = 2e3;
|
|
10690
10691
|
static FINISH_RETRY_DELAY_MS = 300;
|
|
10691
10692
|
static MAX_FINISH_RETRIES = 2;
|
|
@@ -10693,6 +10694,12 @@ var init_provider_cli_adapter = __esm({
|
|
|
10693
10694
|
this.messages = [...this.committedMessages];
|
|
10694
10695
|
this.structuredMessages = [...this.committedMessages];
|
|
10695
10696
|
}
|
|
10697
|
+
getIdleFinishConfirmMs() {
|
|
10698
|
+
return this.cliType === "hermes-cli" ? _ProviderCliAdapter.HERMES_IDLE_FINISH_CONFIRM_MS : _ProviderCliAdapter.IDLE_FINISH_CONFIRM_MS;
|
|
10699
|
+
}
|
|
10700
|
+
getStatusActivityHoldMs() {
|
|
10701
|
+
return this.cliType === "hermes-cli" ? _ProviderCliAdapter.HERMES_IDLE_FINISH_CONFIRM_MS : _ProviderCliAdapter.STATUS_ACTIVITY_HOLD_MS;
|
|
10702
|
+
}
|
|
10696
10703
|
setStatus(status, trigger) {
|
|
10697
10704
|
const prev = this.currentStatus;
|
|
10698
10705
|
if (prev === status) return;
|
|
@@ -10715,6 +10722,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
10715
10722
|
}
|
|
10716
10723
|
armIdleFinishCandidate(assistantLength) {
|
|
10717
10724
|
const now = Date.now();
|
|
10725
|
+
const idleFinishConfirmMs = this.getIdleFinishConfirmMs();
|
|
10718
10726
|
this.idleFinishCandidate = {
|
|
10719
10727
|
armedAt: now,
|
|
10720
10728
|
lastOutputAt: this.lastOutputAt,
|
|
@@ -10723,7 +10731,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
10723
10731
|
assistantLength
|
|
10724
10732
|
};
|
|
10725
10733
|
this.recordTrace("idle_candidate_armed", {
|
|
10726
|
-
confirmMs:
|
|
10734
|
+
confirmMs: idleFinishConfirmMs,
|
|
10727
10735
|
candidate: this.idleFinishCandidate,
|
|
10728
10736
|
...buildCliTraceParseSnapshot({
|
|
10729
10737
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
@@ -10738,7 +10746,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
10738
10746
|
this.settleTimer = null;
|
|
10739
10747
|
this.settledBuffer = this.recentOutputBuffer;
|
|
10740
10748
|
this.evaluateSettled();
|
|
10741
|
-
},
|
|
10749
|
+
}, idleFinishConfirmMs);
|
|
10742
10750
|
}
|
|
10743
10751
|
recordTrace(type, payload = {}) {
|
|
10744
10752
|
const entry = {
|
|
@@ -11117,7 +11125,8 @@ var init_provider_cli_adapter = __esm({
|
|
|
11117
11125
|
hasRecentInteractiveActivity(now) {
|
|
11118
11126
|
const quietForMs = this.lastNonEmptyOutputAt ? now - this.lastNonEmptyOutputAt : Number.MAX_SAFE_INTEGER;
|
|
11119
11127
|
const screenStableMs = this.lastScreenChangeAt ? now - this.lastScreenChangeAt : Number.MAX_SAFE_INTEGER;
|
|
11120
|
-
|
|
11128
|
+
const holdMs = this.getStatusActivityHoldMs();
|
|
11129
|
+
return quietForMs < holdMs || screenStableMs < holdMs;
|
|
11121
11130
|
}
|
|
11122
11131
|
getStartupConfirmationModal(screenText) {
|
|
11123
11132
|
const text = sanitizeTerminalText(String(screenText || ""));
|
|
@@ -11269,6 +11278,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
11269
11278
|
clearPendingScriptStatus();
|
|
11270
11279
|
}
|
|
11271
11280
|
const recentInteractiveActivity = this.hasRecentInteractiveActivity(now);
|
|
11281
|
+
const statusActivityHoldMs = this.getStatusActivityHoldMs();
|
|
11272
11282
|
const shouldHoldGenerating = scriptStatus === "idle" && this.isWaitingForResponse && !modal && recentInteractiveActivity;
|
|
11273
11283
|
if (shouldHoldGenerating) {
|
|
11274
11284
|
this.clearIdleFinishCandidate("hold_generating_recent_activity");
|
|
@@ -11284,7 +11294,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
11284
11294
|
recentInteractiveActivity,
|
|
11285
11295
|
lastNonEmptyOutputAt: this.lastNonEmptyOutputAt,
|
|
11286
11296
|
lastScreenChangeAt: this.lastScreenChangeAt,
|
|
11287
|
-
holdMs:
|
|
11297
|
+
holdMs: statusActivityHoldMs,
|
|
11288
11298
|
...buildCliTraceParseSnapshot({
|
|
11289
11299
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
11290
11300
|
accumulatedRawBuffer: this.accumulatedRawBuffer,
|
|
@@ -11373,11 +11383,12 @@ var init_provider_cli_adapter = __esm({
|
|
|
11373
11383
|
const screenStableMs = this.lastScreenChangeAt ? now - this.lastScreenChangeAt : 0;
|
|
11374
11384
|
const hasAssistantTurn = !!lastParsedAssistant;
|
|
11375
11385
|
const assistantLength = lastParsedAssistant?.content?.length || 0;
|
|
11376
|
-
const
|
|
11377
|
-
const
|
|
11386
|
+
const idleFinishConfirmMs = this.getIdleFinishConfirmMs();
|
|
11387
|
+
const idleQuietThresholdMs = Math.max(idleFinishConfirmMs, this.timeouts.outputSettle);
|
|
11388
|
+
const idleStableThresholdMs = idleFinishConfirmMs;
|
|
11378
11389
|
const idleReady = visibleIdlePrompt && !modal && hasAssistantTurn && quietForMs >= idleQuietThresholdMs && screenStableMs >= idleStableThresholdMs;
|
|
11379
11390
|
const candidate = this.idleFinishCandidate;
|
|
11380
|
-
const candidateQuiet = !!candidate && candidate.responseEpoch === this.responseEpoch && candidate.lastOutputAt === this.lastOutputAt && candidate.lastScreenChangeAt === this.lastScreenChangeAt && assistantLength >= candidate.assistantLength && now - candidate.armedAt >=
|
|
11391
|
+
const candidateQuiet = !!candidate && candidate.responseEpoch === this.responseEpoch && candidate.lastOutputAt === this.lastOutputAt && candidate.lastScreenChangeAt === this.lastScreenChangeAt && assistantLength >= candidate.assistantLength && now - candidate.armedAt >= idleFinishConfirmMs;
|
|
11381
11392
|
const canFinishImmediately = idleReady && candidateQuiet;
|
|
11382
11393
|
this.recordTrace("idle_decision", {
|
|
11383
11394
|
visibleIdlePrompt,
|
|
@@ -11389,7 +11400,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
11389
11400
|
idleQuietThresholdMs,
|
|
11390
11401
|
idleStableThresholdMs,
|
|
11391
11402
|
idleReady,
|
|
11392
|
-
idleFinishConfirmMs
|
|
11403
|
+
idleFinishConfirmMs,
|
|
11393
11404
|
idleFinishCandidate: candidate,
|
|
11394
11405
|
candidateQuiet,
|
|
11395
11406
|
canFinishImmediately,
|
|
@@ -83946,7 +83957,7 @@ var init_adhdev_daemon = __esm({
|
|
|
83946
83957
|
import_ws3 = require("ws");
|
|
83947
83958
|
init_source();
|
|
83948
83959
|
init_version();
|
|
83949
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.
|
|
83960
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.60" });
|
|
83950
83961
|
ACTIVE_CHAT_POLL_STATUSES = /* @__PURE__ */ new Set([
|
|
83951
83962
|
"generating",
|
|
83952
83963
|
"waiting_approval",
|