adhdev 0.9.17 → 0.9.18
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 +27 -20
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +27 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -13055,7 +13055,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
13055
13055
|
armApprovalExitTimeout() {
|
|
13056
13056
|
if (this.approvalExitTimeout) clearTimeout(this.approvalExitTimeout);
|
|
13057
13057
|
this.approvalExitTimeout = setTimeout(() => {
|
|
13058
|
-
if (this.
|
|
13058
|
+
if (!this.hasActionableApproval()) return;
|
|
13059
13059
|
const tail = this.recentOutputBuffer;
|
|
13060
13060
|
const screenText = this.terminalScreen.getText() || "";
|
|
13061
13061
|
const modal = this.runParseApproval(tail);
|
|
@@ -13082,7 +13082,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
13082
13082
|
}
|
|
13083
13083
|
shouldRetryFinishResponse(commitResult) {
|
|
13084
13084
|
if (!this.currentTurnScope) return false;
|
|
13085
|
-
if (this.
|
|
13085
|
+
if (this.hasActionableApproval()) return false;
|
|
13086
13086
|
if (this.finishRetryCount >= _ProviderCliAdapter.MAX_FINISH_RETRIES) return false;
|
|
13087
13087
|
if (commitResult.hasAssistant && commitResult.assistantContent.trim()) return false;
|
|
13088
13088
|
if (this.runDetectStatus(this.recentOutputBuffer) !== "idle") return false;
|
|
@@ -13098,7 +13098,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
13098
13098
|
return quietForMs < holdMs || screenStableMs < holdMs;
|
|
13099
13099
|
}
|
|
13100
13100
|
shouldDeferIdleTimeoutFinish() {
|
|
13101
|
-
if (!this.isWaitingForResponse || this.
|
|
13101
|
+
if (!this.isWaitingForResponse || this.hasActionableApproval()) {
|
|
13102
13102
|
return false;
|
|
13103
13103
|
}
|
|
13104
13104
|
const latestStatus = this.runDetectStatus(this.recentOutputBuffer) || this.currentStatus;
|
|
@@ -13274,7 +13274,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
13274
13274
|
scope: this.currentTurnScope
|
|
13275
13275
|
})
|
|
13276
13276
|
});
|
|
13277
|
-
if (this.currentTurnScope && !lastParsedAssistant && !this.submitRetryUsed && this.ptyProcess && this.
|
|
13277
|
+
if (this.currentTurnScope && !lastParsedAssistant && !this.submitRetryUsed && this.ptyProcess && !this.hasActionableApproval() && promptLikelyVisible(screenText, normalizedPromptSnippet) && !this.hasMeaningfulResponseBuffer(normalizedPromptSnippet)) {
|
|
13278
13278
|
this.submitRetryUsed = true;
|
|
13279
13279
|
this.responseSettleIgnoreUntil = Date.now() + this.timeouts.outputSettle + 400;
|
|
13280
13280
|
LOG.info("CLI", `[${this.cliType}] Retrying submit key from settled parser (no assistant yet)`);
|
|
@@ -13364,7 +13364,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
13364
13364
|
this.setStatus("generating", "recent_activity_hold");
|
|
13365
13365
|
if (this.idleTimeout) clearTimeout(this.idleTimeout);
|
|
13366
13366
|
this.idleTimeout = setTimeout(() => {
|
|
13367
|
-
if (this.isWaitingForResponse && this.
|
|
13367
|
+
if (this.isWaitingForResponse && !this.hasActionableApproval()) {
|
|
13368
13368
|
if (this.shouldDeferIdleTimeoutFinish()) return;
|
|
13369
13369
|
this.finishResponse();
|
|
13370
13370
|
}
|
|
@@ -13396,16 +13396,16 @@ var init_provider_cli_adapter = __esm({
|
|
|
13396
13396
|
}
|
|
13397
13397
|
this.activeModal = null;
|
|
13398
13398
|
if (this.isWaitingForResponse) {
|
|
13399
|
-
this.setStatus("
|
|
13399
|
+
this.setStatus("idle", inCooldown ? "approval_cooldown_non_actionable" : "approval_prompt_gone_non_actionable");
|
|
13400
13400
|
if (this.idleTimeout) clearTimeout(this.idleTimeout);
|
|
13401
13401
|
this.idleTimeout = setTimeout(() => {
|
|
13402
|
-
if (this.isWaitingForResponse && this.
|
|
13402
|
+
if (this.isWaitingForResponse && !this.hasActionableApproval()) {
|
|
13403
13403
|
if (this.shouldDeferIdleTimeoutFinish()) return;
|
|
13404
13404
|
this.finishResponse();
|
|
13405
13405
|
}
|
|
13406
13406
|
}, this.timeouts.generatingIdle);
|
|
13407
13407
|
} else {
|
|
13408
|
-
this.setStatus("idle", inCooldown ? "
|
|
13408
|
+
this.setStatus("idle", inCooldown ? "approval_cooldown_non_actionable" : "approval_prompt_gone_non_actionable");
|
|
13409
13409
|
}
|
|
13410
13410
|
this.onStatusChange?.();
|
|
13411
13411
|
return;
|
|
@@ -13463,9 +13463,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
13463
13463
|
}
|
|
13464
13464
|
this.activeModal = null;
|
|
13465
13465
|
this.lastApprovalResolvedAt = Date.now();
|
|
13466
|
-
|
|
13467
|
-
this.setStatus("generating", "approval_prompt_gone_idle_confirm");
|
|
13468
|
-
}
|
|
13466
|
+
this.setStatus("idle", "approval_prompt_gone_script_idle");
|
|
13469
13467
|
}
|
|
13470
13468
|
if (!this.isWaitingForResponse) {
|
|
13471
13469
|
if (prevStatus !== "idle") {
|
|
@@ -13523,7 +13521,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
13523
13521
|
}
|
|
13524
13522
|
if (this.idleTimeout) clearTimeout(this.idleTimeout);
|
|
13525
13523
|
this.idleTimeout = setTimeout(() => {
|
|
13526
|
-
if (this.isWaitingForResponse && this.
|
|
13524
|
+
if (this.isWaitingForResponse && !this.hasActionableApproval()) {
|
|
13527
13525
|
if (this.shouldDeferIdleTimeoutFinish()) return;
|
|
13528
13526
|
this.clearIdleFinishCandidate("idle_timeout_finish");
|
|
13529
13527
|
this.finishResponse();
|
|
@@ -13561,7 +13559,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
13561
13559
|
if (this.finishRetryTimer) clearTimeout(this.finishRetryTimer);
|
|
13562
13560
|
this.finishRetryTimer = setTimeout(() => {
|
|
13563
13561
|
this.finishRetryTimer = null;
|
|
13564
|
-
if (this.isWaitingForResponse && this.
|
|
13562
|
+
if (this.isWaitingForResponse && !this.hasActionableApproval()) {
|
|
13565
13563
|
this.finishResponse();
|
|
13566
13564
|
}
|
|
13567
13565
|
}, _ProviderCliAdapter.FINISH_RETRY_DELAY_MS);
|
|
@@ -13707,10 +13705,13 @@ var init_provider_cli_adapter = __esm({
|
|
|
13707
13705
|
return null;
|
|
13708
13706
|
}
|
|
13709
13707
|
}
|
|
13708
|
+
hasActionableApproval(startupModal = null) {
|
|
13709
|
+
return !!(startupModal || this.activeModal);
|
|
13710
|
+
}
|
|
13710
13711
|
projectEffectiveStatus(startupModal = null) {
|
|
13711
13712
|
if (this.parseErrorMessage) return "error";
|
|
13712
|
-
if (
|
|
13713
|
-
if (this.isWaitingForResponse && this.currentTurnScope && this.currentStatus
|
|
13713
|
+
if (this.hasActionableApproval(startupModal)) return "waiting_approval";
|
|
13714
|
+
if (this.isWaitingForResponse && this.currentTurnScope && this.currentStatus !== "stopped") return "generating";
|
|
13714
13715
|
return this.currentStatus;
|
|
13715
13716
|
}
|
|
13716
13717
|
suppressStaleParsedApproval(parsed, recentBuffer, screenText) {
|
|
@@ -14008,7 +14009,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
14008
14009
|
async sendMessage(text) {
|
|
14009
14010
|
if (!this.ptyProcess) throw new Error(`${this.cliName} is not running`);
|
|
14010
14011
|
const allowInputDuringGeneration = this.provider.allowInputDuringGeneration === true;
|
|
14011
|
-
const allowInterventionPrompt = allowInputDuringGeneration && this.isWaitingForResponse && this.
|
|
14012
|
+
const allowInterventionPrompt = allowInputDuringGeneration && this.isWaitingForResponse && !this.hasActionableApproval();
|
|
14012
14013
|
if (this.startupParseGate) {
|
|
14013
14014
|
const deadline = Date.now() + 1e4;
|
|
14014
14015
|
while (this.startupParseGate && Date.now() < deadline) {
|
|
@@ -14132,7 +14133,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
14132
14133
|
const retrySubmitIfStuck = (attempt) => {
|
|
14133
14134
|
this.submitRetryTimer = null;
|
|
14134
14135
|
if (!this.ptyProcess || !this.isWaitingForResponse || this.submitRetryUsed) return;
|
|
14135
|
-
if (this.
|
|
14136
|
+
if (this.hasActionableApproval()) return;
|
|
14136
14137
|
if (this.hasMeaningfulResponseBuffer(normalizedPromptSnippet)) return;
|
|
14137
14138
|
const screenText2 = this.terminalScreen.getText();
|
|
14138
14139
|
if (!promptLikelyVisible(screenText2, normalizedPromptSnippet)) return;
|
|
@@ -14175,7 +14176,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
14175
14176
|
this.submitRetryTimer = setTimeout(() => {
|
|
14176
14177
|
this.submitRetryTimer = null;
|
|
14177
14178
|
if (!this.ptyProcess || !this.isWaitingForResponse || this.submitRetryUsed) return;
|
|
14178
|
-
if (this.
|
|
14179
|
+
if (this.hasActionableApproval()) return;
|
|
14179
14180
|
if (this.hasMeaningfulResponseBuffer(normalizedPromptSnippet)) return;
|
|
14180
14181
|
const screenText = this.terminalScreen.getText();
|
|
14181
14182
|
if (!promptLikelyVisible(screenText, normalizedPromptSnippet)) return;
|
|
@@ -14460,6 +14461,9 @@ var init_provider_cli_adapter = __esm({
|
|
|
14460
14461
|
name: this.cliName,
|
|
14461
14462
|
providerResolution: this.providerResolutionMeta,
|
|
14462
14463
|
status: effectiveStatus,
|
|
14464
|
+
projectedStatus: effectiveStatus,
|
|
14465
|
+
rawStatus: this.currentStatus,
|
|
14466
|
+
lifecycleStatus: this.isWaitingForResponse ? "awaiting_response" : "idle",
|
|
14463
14467
|
ready: effectiveReady,
|
|
14464
14468
|
startupParseGate: this.startupParseGate,
|
|
14465
14469
|
spawnAt: this.spawnAt,
|
|
@@ -14512,7 +14516,10 @@ var init_provider_cli_adapter = __esm({
|
|
|
14512
14516
|
screenText: summarizeCliTraceText(this.terminalScreen.getText(), 4e3),
|
|
14513
14517
|
recentOutputBuffer: summarizeCliTraceText(this.recentOutputBuffer, 1e3),
|
|
14514
14518
|
responseBuffer: summarizeCliTraceText(this.responseBuffer, 1200),
|
|
14515
|
-
status: this.
|
|
14519
|
+
status: this.projectEffectiveStatus(),
|
|
14520
|
+
projectedStatus: this.projectEffectiveStatus(),
|
|
14521
|
+
rawStatus: this.currentStatus,
|
|
14522
|
+
lifecycleStatus: this.isWaitingForResponse ? "awaiting_response" : "idle",
|
|
14516
14523
|
activeModal: this.activeModal,
|
|
14517
14524
|
currentTurnScope: this.currentTurnScope,
|
|
14518
14525
|
messages: summarizeCliTraceMessages(this.committedMessages, 5)
|
|
@@ -87239,7 +87246,7 @@ var init_adhdev_daemon = __esm({
|
|
|
87239
87246
|
init_version();
|
|
87240
87247
|
init_src();
|
|
87241
87248
|
init_runtime_defaults();
|
|
87242
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.
|
|
87249
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.18" });
|
|
87243
87250
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
87244
87251
|
localHttpServer = null;
|
|
87245
87252
|
localWss = null;
|