adhdev 0.5.32 → 0.5.33

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 CHANGED
@@ -23609,6 +23609,7 @@ var require_dist = __commonJS({
23609
23609
  monitor;
23610
23610
  generatingDebounceTimer = null;
23611
23611
  generatingDebouncePending = null;
23612
+ lastApprovalEventAt = 0;
23612
23613
  historyWriter;
23613
23614
  instanceId;
23614
23615
  // ─── Lifecycle ─────────────────────────────────
@@ -23739,13 +23740,17 @@ var require_dist = __commonJS({
23739
23740
  if (!this.generatingStartedAt) this.generatingStartedAt = now;
23740
23741
  const modal = adapterStatus.activeModal;
23741
23742
  LOG5.info("CLI", `[${this.type}] approval modal: "${modal?.message?.slice(0, 80) ?? "none"}"`);
23742
- this.pushEvent({
23743
- event: "agent:waiting_approval",
23744
- chatTitle,
23745
- timestamp: now,
23746
- modalMessage: modal?.message,
23747
- modalButtons: modal?.buttons
23748
- });
23743
+ const approvalCooldown = 5e3;
23744
+ if (this.lastStatus !== "waiting_approval" && (!this.lastApprovalEventAt || now - this.lastApprovalEventAt > approvalCooldown)) {
23745
+ this.lastApprovalEventAt = now;
23746
+ this.pushEvent({
23747
+ event: "agent:waiting_approval",
23748
+ chatTitle,
23749
+ timestamp: now,
23750
+ modalMessage: modal?.message,
23751
+ modalButtons: modal?.buttons
23752
+ });
23753
+ }
23749
23754
  } else if (newStatus === "idle" && (this.lastStatus === "generating" || this.lastStatus === "waiting_approval")) {
23750
23755
  const duration3 = this.generatingStartedAt ? Math.round((now - this.generatingStartedAt) / 1e3) : 0;
23751
23756
  if (this.generatingDebouncePending) {
@@ -25166,7 +25171,8 @@ ${installInfo}`
25166
25171
  extensionId: this.extensionId,
25167
25172
  status: "error",
25168
25173
  messages: [],
25169
- inputContent: ""
25174
+ inputContent: "",
25175
+ _error: message
25170
25176
  };
25171
25177
  }
25172
25178
  };
@@ -25183,9 +25189,11 @@ ${installInfo}`
25183
25189
  if (providerLoader) {
25184
25190
  const allExtProviders = providerLoader.getByCategory("extension");
25185
25191
  for (const p of allExtProviders) {
25186
- const adapter = new ProviderStreamAdapter(p);
25192
+ const resolved = providerLoader.resolve(p.type);
25193
+ if (!resolved) continue;
25194
+ const adapter = new ProviderStreamAdapter(resolved);
25187
25195
  this.allAdapters.push(adapter);
25188
- this.logFn(`[AgentStream] Adapter created: ${p.type} (${p.name})`);
25196
+ this.logFn(`[AgentStream] Adapter created: ${p.type} (${p.name}) scripts=${Object.keys(resolved.scripts || {}).join(",") || "none"}`);
25189
25197
  }
25190
25198
  }
25191
25199
  }
@@ -25272,6 +25280,7 @@ ${installInfo}`
25272
25280
  try {
25273
25281
  const evaluate = (expr, timeout) => cdp.evaluateInSessionFrame(agent.sessionId, expr, timeout);
25274
25282
  const state = await agent.adapter.readChat(evaluate);
25283
+ this.logFn(`[AgentStream] readChat(${type}) result: status=${state.status} msgs=${state.messages?.length || 0} model=${state.model || ""}${state.status === "error" ? " error=" + JSON.stringify(state.error || state._error || "unknown") : ""}`);
25275
25284
  agent.lastState = state;
25276
25285
  agent.lastError = null;
25277
25286
  if (state.status === "panel_hidden") {
@@ -30313,7 +30322,7 @@ var init_adhdev_daemon = __esm({
30313
30322
  path2 = __toESM(require("path"));
30314
30323
  crypto2 = __toESM(require("crypto"));
30315
30324
  import_chalk = __toESM(require("chalk"));
30316
- pkgVersion = "0.5.32";
30325
+ pkgVersion = "0.5.33";
30317
30326
  if (pkgVersion === "unknown") {
30318
30327
  try {
30319
30328
  const possiblePaths = [