adhdev 0.9.17 → 0.9.19

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.js CHANGED
@@ -12099,7 +12099,7 @@ var init_provider_cli_adapter = __esm({
12099
12099
  armApprovalExitTimeout() {
12100
12100
  if (this.approvalExitTimeout) clearTimeout(this.approvalExitTimeout);
12101
12101
  this.approvalExitTimeout = setTimeout(() => {
12102
- if (this.currentStatus !== "waiting_approval") return;
12102
+ if (!this.hasActionableApproval()) return;
12103
12103
  const tail = this.recentOutputBuffer;
12104
12104
  const screenText = this.terminalScreen.getText() || "";
12105
12105
  const modal = this.runParseApproval(tail);
@@ -12126,7 +12126,7 @@ var init_provider_cli_adapter = __esm({
12126
12126
  }
12127
12127
  shouldRetryFinishResponse(commitResult) {
12128
12128
  if (!this.currentTurnScope) return false;
12129
- if (this.currentStatus === "waiting_approval" || this.activeModal) return false;
12129
+ if (this.hasActionableApproval()) return false;
12130
12130
  if (this.finishRetryCount >= _ProviderCliAdapter.MAX_FINISH_RETRIES) return false;
12131
12131
  if (commitResult.hasAssistant && commitResult.assistantContent.trim()) return false;
12132
12132
  if (this.runDetectStatus(this.recentOutputBuffer) !== "idle") return false;
@@ -12142,7 +12142,7 @@ var init_provider_cli_adapter = __esm({
12142
12142
  return quietForMs < holdMs || screenStableMs < holdMs;
12143
12143
  }
12144
12144
  shouldDeferIdleTimeoutFinish() {
12145
- if (!this.isWaitingForResponse || this.currentStatus === "waiting_approval") {
12145
+ if (!this.isWaitingForResponse || this.hasActionableApproval()) {
12146
12146
  return false;
12147
12147
  }
12148
12148
  const latestStatus = this.runDetectStatus(this.recentOutputBuffer) || this.currentStatus;
@@ -12318,7 +12318,7 @@ var init_provider_cli_adapter = __esm({
12318
12318
  scope: this.currentTurnScope
12319
12319
  })
12320
12320
  });
12321
- if (this.currentTurnScope && !lastParsedAssistant && !this.submitRetryUsed && this.ptyProcess && this.currentStatus !== "waiting_approval" && promptLikelyVisible(screenText, normalizedPromptSnippet) && !this.hasMeaningfulResponseBuffer(normalizedPromptSnippet)) {
12321
+ if (this.currentTurnScope && !lastParsedAssistant && !this.submitRetryUsed && this.ptyProcess && !this.hasActionableApproval() && promptLikelyVisible(screenText, normalizedPromptSnippet) && !this.hasMeaningfulResponseBuffer(normalizedPromptSnippet)) {
12322
12322
  this.submitRetryUsed = true;
12323
12323
  this.responseSettleIgnoreUntil = Date.now() + this.timeouts.outputSettle + 400;
12324
12324
  LOG.info("CLI", `[${this.cliType}] Retrying submit key from settled parser (no assistant yet)`);
@@ -12408,7 +12408,7 @@ var init_provider_cli_adapter = __esm({
12408
12408
  this.setStatus("generating", "recent_activity_hold");
12409
12409
  if (this.idleTimeout) clearTimeout(this.idleTimeout);
12410
12410
  this.idleTimeout = setTimeout(() => {
12411
- if (this.isWaitingForResponse && this.currentStatus !== "waiting_approval") {
12411
+ if (this.isWaitingForResponse && !this.hasActionableApproval()) {
12412
12412
  if (this.shouldDeferIdleTimeoutFinish()) return;
12413
12413
  this.finishResponse();
12414
12414
  }
@@ -12440,16 +12440,16 @@ var init_provider_cli_adapter = __esm({
12440
12440
  }
12441
12441
  this.activeModal = null;
12442
12442
  if (this.isWaitingForResponse) {
12443
- this.setStatus("generating", inCooldown ? "approval_cooldown_ignore" : "approval_prompt_gone");
12443
+ this.setStatus("idle", inCooldown ? "approval_cooldown_non_actionable" : "approval_prompt_gone_non_actionable");
12444
12444
  if (this.idleTimeout) clearTimeout(this.idleTimeout);
12445
12445
  this.idleTimeout = setTimeout(() => {
12446
- if (this.isWaitingForResponse && this.currentStatus !== "waiting_approval") {
12446
+ if (this.isWaitingForResponse && !this.hasActionableApproval()) {
12447
12447
  if (this.shouldDeferIdleTimeoutFinish()) return;
12448
12448
  this.finishResponse();
12449
12449
  }
12450
12450
  }, this.timeouts.generatingIdle);
12451
12451
  } else {
12452
- this.setStatus("idle", inCooldown ? "approval_cooldown_ignore" : "approval_prompt_gone");
12452
+ this.setStatus("idle", inCooldown ? "approval_cooldown_non_actionable" : "approval_prompt_gone_non_actionable");
12453
12453
  }
12454
12454
  this.onStatusChange?.();
12455
12455
  return;
@@ -12507,9 +12507,7 @@ var init_provider_cli_adapter = __esm({
12507
12507
  }
12508
12508
  this.activeModal = null;
12509
12509
  this.lastApprovalResolvedAt = Date.now();
12510
- if (this.isWaitingForResponse) {
12511
- this.setStatus("generating", "approval_prompt_gone_idle_confirm");
12512
- }
12510
+ this.setStatus("idle", "approval_prompt_gone_script_idle");
12513
12511
  }
12514
12512
  if (!this.isWaitingForResponse) {
12515
12513
  if (prevStatus !== "idle") {
@@ -12567,7 +12565,7 @@ var init_provider_cli_adapter = __esm({
12567
12565
  }
12568
12566
  if (this.idleTimeout) clearTimeout(this.idleTimeout);
12569
12567
  this.idleTimeout = setTimeout(() => {
12570
- if (this.isWaitingForResponse && this.currentStatus !== "waiting_approval") {
12568
+ if (this.isWaitingForResponse && !this.hasActionableApproval()) {
12571
12569
  if (this.shouldDeferIdleTimeoutFinish()) return;
12572
12570
  this.clearIdleFinishCandidate("idle_timeout_finish");
12573
12571
  this.finishResponse();
@@ -12605,7 +12603,7 @@ var init_provider_cli_adapter = __esm({
12605
12603
  if (this.finishRetryTimer) clearTimeout(this.finishRetryTimer);
12606
12604
  this.finishRetryTimer = setTimeout(() => {
12607
12605
  this.finishRetryTimer = null;
12608
- if (this.isWaitingForResponse && this.currentStatus !== "waiting_approval") {
12606
+ if (this.isWaitingForResponse && !this.hasActionableApproval()) {
12609
12607
  this.finishResponse();
12610
12608
  }
12611
12609
  }, _ProviderCliAdapter.FINISH_RETRY_DELAY_MS);
@@ -12751,10 +12749,13 @@ var init_provider_cli_adapter = __esm({
12751
12749
  return null;
12752
12750
  }
12753
12751
  }
12752
+ hasActionableApproval(startupModal = null) {
12753
+ return !!(startupModal || this.activeModal);
12754
+ }
12754
12755
  projectEffectiveStatus(startupModal = null) {
12755
12756
  if (this.parseErrorMessage) return "error";
12756
- if (startupModal || this.activeModal) return "waiting_approval";
12757
- if (this.isWaitingForResponse && this.currentTurnScope && this.currentStatus === "idle") return "generating";
12757
+ if (this.hasActionableApproval(startupModal)) return "waiting_approval";
12758
+ if (this.isWaitingForResponse && this.currentTurnScope && this.currentStatus !== "stopped") return "generating";
12758
12759
  return this.currentStatus;
12759
12760
  }
12760
12761
  suppressStaleParsedApproval(parsed, recentBuffer, screenText) {
@@ -13052,7 +13053,7 @@ var init_provider_cli_adapter = __esm({
13052
13053
  async sendMessage(text) {
13053
13054
  if (!this.ptyProcess) throw new Error(`${this.cliName} is not running`);
13054
13055
  const allowInputDuringGeneration = this.provider.allowInputDuringGeneration === true;
13055
- const allowInterventionPrompt = allowInputDuringGeneration && this.isWaitingForResponse && this.currentStatus !== "waiting_approval";
13056
+ const allowInterventionPrompt = allowInputDuringGeneration && this.isWaitingForResponse && !this.hasActionableApproval();
13056
13057
  if (this.startupParseGate) {
13057
13058
  const deadline = Date.now() + 1e4;
13058
13059
  while (this.startupParseGate && Date.now() < deadline) {
@@ -13176,7 +13177,7 @@ var init_provider_cli_adapter = __esm({
13176
13177
  const retrySubmitIfStuck = (attempt) => {
13177
13178
  this.submitRetryTimer = null;
13178
13179
  if (!this.ptyProcess || !this.isWaitingForResponse || this.submitRetryUsed) return;
13179
- if (this.currentStatus === "waiting_approval") return;
13180
+ if (this.hasActionableApproval()) return;
13180
13181
  if (this.hasMeaningfulResponseBuffer(normalizedPromptSnippet)) return;
13181
13182
  const screenText2 = this.terminalScreen.getText();
13182
13183
  if (!promptLikelyVisible(screenText2, normalizedPromptSnippet)) return;
@@ -13219,7 +13220,7 @@ var init_provider_cli_adapter = __esm({
13219
13220
  this.submitRetryTimer = setTimeout(() => {
13220
13221
  this.submitRetryTimer = null;
13221
13222
  if (!this.ptyProcess || !this.isWaitingForResponse || this.submitRetryUsed) return;
13222
- if (this.currentStatus === "waiting_approval") return;
13223
+ if (this.hasActionableApproval()) return;
13223
13224
  if (this.hasMeaningfulResponseBuffer(normalizedPromptSnippet)) return;
13224
13225
  const screenText = this.terminalScreen.getText();
13225
13226
  if (!promptLikelyVisible(screenText, normalizedPromptSnippet)) return;
@@ -13504,6 +13505,9 @@ var init_provider_cli_adapter = __esm({
13504
13505
  name: this.cliName,
13505
13506
  providerResolution: this.providerResolutionMeta,
13506
13507
  status: effectiveStatus,
13508
+ projectedStatus: effectiveStatus,
13509
+ rawStatus: this.currentStatus,
13510
+ lifecycleStatus: this.isWaitingForResponse ? "awaiting_response" : "idle",
13507
13511
  ready: effectiveReady,
13508
13512
  startupParseGate: this.startupParseGate,
13509
13513
  spawnAt: this.spawnAt,
@@ -13556,7 +13560,10 @@ var init_provider_cli_adapter = __esm({
13556
13560
  screenText: summarizeCliTraceText(this.terminalScreen.getText(), 4e3),
13557
13561
  recentOutputBuffer: summarizeCliTraceText(this.recentOutputBuffer, 1e3),
13558
13562
  responseBuffer: summarizeCliTraceText(this.responseBuffer, 1200),
13559
- status: this.currentStatus,
13563
+ status: this.projectEffectiveStatus(),
13564
+ projectedStatus: this.projectEffectiveStatus(),
13565
+ rawStatus: this.currentStatus,
13566
+ lifecycleStatus: this.isWaitingForResponse ? "awaiting_response" : "idle",
13560
13567
  activeModal: this.activeModal,
13561
13568
  currentTurnScope: this.currentTurnScope,
13562
13569
  messages: summarizeCliTraceMessages(this.committedMessages, 5)
@@ -55519,7 +55526,7 @@ var init_adhdev_daemon = __esm({
55519
55526
  init_version();
55520
55527
  init_src();
55521
55528
  init_runtime_defaults();
55522
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.17" });
55529
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.19" });
55523
55530
  AdhdevDaemon = class _AdhdevDaemon {
55524
55531
  localHttpServer = null;
55525
55532
  localWss = null;