@adhdev/daemon-core 0.8.61 → 0.8.62

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.
@@ -135,6 +135,7 @@ export declare class ProviderCliAdapter implements CliAdapter {
135
135
  private looksLikeVisibleAssistantCandidate;
136
136
  private shouldRetryFinishResponse;
137
137
  private hasRecentInteractiveActivity;
138
+ private shouldDeferIdleTimeoutFinish;
138
139
  private getStartupConfirmationModal;
139
140
  private shouldResolveModalWithEnter;
140
141
  private waitForInteractivePrompt;
@@ -24,6 +24,7 @@ export declare function buildCliParseInput(options: {
24
24
  terminalScreenText: string;
25
25
  baseMessages: CliChatMessage[];
26
26
  partialResponse: string;
27
+ isWaitingForResponse?: boolean;
27
28
  scope?: TurnParseScope | null;
28
29
  runtimeSettings: Record<string, any>;
29
30
  }): CliScriptInput;
@@ -63,6 +63,7 @@ export interface CliScriptInput {
63
63
  recentScreen: CliScreenSnapshot;
64
64
  messages: CliChatMessage[];
65
65
  partialResponse: string;
66
+ isWaitingForResponse?: boolean;
66
67
  promptText?: string;
67
68
  settings?: Record<string, any>;
68
69
  args?: Record<string, any>;
@@ -71,6 +72,7 @@ export interface CliStatusInput {
71
72
  tail: string;
72
73
  screenText?: string;
73
74
  rawBuffer?: string;
75
+ isWaitingForResponse?: boolean;
74
76
  screen: CliScreenSnapshot;
75
77
  tailScreen: CliScreenSnapshot;
76
78
  }
package/dist/index.js CHANGED
@@ -1166,6 +1166,7 @@ function buildCliParseInput(options) {
1166
1166
  terminalScreenText,
1167
1167
  baseMessages,
1168
1168
  partialResponse,
1169
+ isWaitingForResponse,
1169
1170
  scope,
1170
1171
  runtimeSettings
1171
1172
  } = options;
@@ -1183,6 +1184,7 @@ function buildCliParseInput(options) {
1183
1184
  recentScreen: buildCliScreenSnapshot(recentBuffer),
1184
1185
  messages: [...baseMessages],
1185
1186
  partialResponse,
1187
+ isWaitingForResponse,
1186
1188
  promptText: scope?.prompt || "",
1187
1189
  settings: { ...runtimeSettings }
1188
1190
  };
@@ -1921,6 +1923,18 @@ var init_provider_cli_adapter = __esm({
1921
1923
  const holdMs = this.getStatusActivityHoldMs();
1922
1924
  return quietForMs < holdMs || screenStableMs < holdMs;
1923
1925
  }
1926
+ shouldDeferIdleTimeoutFinish() {
1927
+ if (!this.isWaitingForResponse || this.currentStatus === "waiting_approval") {
1928
+ return false;
1929
+ }
1930
+ const latestStatus = this.runDetectStatus(this.recentOutputBuffer) || this.currentStatus;
1931
+ if (latestStatus === "generating") {
1932
+ this.settledBuffer = this.recentOutputBuffer;
1933
+ this.evaluateSettled();
1934
+ return true;
1935
+ }
1936
+ return false;
1937
+ }
1924
1938
  getStartupConfirmationModal(screenText) {
1925
1939
  const text = sanitizeTerminalText(String(screenText || ""));
1926
1940
  if (!text.trim()) return null;
@@ -2079,6 +2093,7 @@ var init_provider_cli_adapter = __esm({
2079
2093
  if (this.idleTimeout) clearTimeout(this.idleTimeout);
2080
2094
  this.idleTimeout = setTimeout(() => {
2081
2095
  if (this.isWaitingForResponse && this.currentStatus !== "waiting_approval") {
2096
+ if (this.shouldDeferIdleTimeoutFinish()) return;
2082
2097
  this.finishResponse();
2083
2098
  }
2084
2099
  }, this.timeouts.generatingIdle);
@@ -2114,6 +2129,7 @@ var init_provider_cli_adapter = __esm({
2114
2129
  if (this.idleTimeout) clearTimeout(this.idleTimeout);
2115
2130
  this.idleTimeout = setTimeout(() => {
2116
2131
  if (this.isWaitingForResponse && this.currentStatus !== "waiting_approval") {
2132
+ if (this.shouldDeferIdleTimeoutFinish()) return;
2117
2133
  this.finishResponse();
2118
2134
  }
2119
2135
  }, this.timeouts.generatingIdle);
@@ -2156,7 +2172,10 @@ var init_provider_cli_adapter = __esm({
2156
2172
  this.setStatus("generating", "script_detect");
2157
2173
  if (this.idleTimeout) clearTimeout(this.idleTimeout);
2158
2174
  this.idleTimeout = setTimeout(() => {
2159
- if (this.isWaitingForResponse) this.finishResponse();
2175
+ if (this.isWaitingForResponse) {
2176
+ if (this.shouldDeferIdleTimeoutFinish()) return;
2177
+ this.finishResponse();
2178
+ }
2160
2179
  }, this.timeouts.generatingIdle);
2161
2180
  this.onStatusChange?.();
2162
2181
  return;
@@ -2224,6 +2243,7 @@ var init_provider_cli_adapter = __esm({
2224
2243
  if (this.idleTimeout) clearTimeout(this.idleTimeout);
2225
2244
  this.idleTimeout = setTimeout(() => {
2226
2245
  if (this.isWaitingForResponse && this.currentStatus !== "waiting_approval") {
2246
+ if (this.shouldDeferIdleTimeoutFinish()) return;
2227
2247
  this.clearIdleFinishCandidate("idle_timeout_finish");
2228
2248
  this.finishResponse();
2229
2249
  }
@@ -2362,6 +2382,7 @@ var init_provider_cli_adapter = __esm({
2362
2382
  tail: text.slice(-500),
2363
2383
  screenText,
2364
2384
  rawBuffer: this.accumulatedRawBuffer,
2385
+ isWaitingForResponse: this.isWaitingForResponse,
2365
2386
  screen: buildCliScreenSnapshot(screenText),
2366
2387
  tailScreen: buildCliScreenSnapshot(text.slice(-500))
2367
2388
  });
@@ -2471,6 +2492,7 @@ var init_provider_cli_adapter = __esm({
2471
2492
  terminalScreenText: this.terminalScreen.getText(),
2472
2493
  baseMessages: this.committedMessages,
2473
2494
  partialResponse: this.responseBuffer,
2495
+ isWaitingForResponse: this.isWaitingForResponse,
2474
2496
  scope: this.currentTurnScope,
2475
2497
  runtimeSettings: this.runtimeSettings
2476
2498
  });
@@ -2489,6 +2511,7 @@ var init_provider_cli_adapter = __esm({
2489
2511
  terminalScreenText: this.terminalScreen.getText(),
2490
2512
  baseMessages,
2491
2513
  partialResponse,
2514
+ isWaitingForResponse: this.isWaitingForResponse,
2492
2515
  scope,
2493
2516
  runtimeSettings: this.runtimeSettings
2494
2517
  });