adhdev 0.8.96 → 0.8.98

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.
Files changed (33) hide show
  1. package/dist/cli/index.js +56 -8
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/index.js +39 -6
  4. package/dist/index.js.map +1 -1
  5. package/package.json +1 -1
  6. package/vendor/session-host-daemon/index.js +4 -4
  7. package/vendor/session-host-daemon/index.js.map +1 -1
  8. package/vendor/session-host-daemon/index.mjs +13 -6
  9. package/vendor/session-host-daemon/index.mjs.map +1 -1
  10. package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/defaults.d.mts +6 -0
  11. package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/defaults.d.ts +6 -0
  12. package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/defaults.js +49 -0
  13. package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/defaults.js.map +1 -0
  14. package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/defaults.mjs +21 -0
  15. package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/defaults.mjs.map +1 -0
  16. package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/index.d.mts +1 -0
  17. package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/index.d.ts +1 -0
  18. package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/index.js +25 -2
  19. package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/index.js.map +1 -1
  20. package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/index.mjs +21 -2
  21. package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/index.mjs.map +1 -1
  22. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/defaults.d.mts +6 -0
  23. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/defaults.d.ts +6 -0
  24. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/defaults.js +49 -0
  25. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/defaults.js.map +1 -0
  26. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/defaults.mjs +21 -0
  27. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/defaults.mjs.map +1 -0
  28. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.d.mts +1 -0
  29. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.d.ts +1 -0
  30. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.js +25 -2
  31. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.js.map +1 -1
  32. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.mjs +21 -2
  33. package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.mjs.map +1 -1
package/dist/index.js CHANGED
@@ -10615,7 +10615,7 @@ function ensureNodePtySpawnHelperPermissions(logFn) {
10615
10615
  } catch {
10616
10616
  }
10617
10617
  }
10618
- var os8, path22, net, import_crypto3, os22, path32, __require, SessionHostClient;
10618
+ var os8, path22, net, import_crypto3, os22, path32, __require, DEFAULT_SESSION_HOST_COLS, DEFAULT_SESSION_HOST_ROWS, SessionHostClient;
10619
10619
  var init_dist = __esm({
10620
10620
  "../../oss/packages/session-host-core/dist/index.mjs"() {
10621
10621
  "use strict";
@@ -10631,6 +10631,8 @@ var init_dist = __esm({
10631
10631
  if (typeof require !== "undefined") return require.apply(this, arguments);
10632
10632
  throw Error('Dynamic require of "' + x + '" is not supported');
10633
10633
  });
10634
+ DEFAULT_SESSION_HOST_COLS = 80;
10635
+ DEFAULT_SESSION_HOST_ROWS = 48;
10634
10636
  SessionHostClient = class {
10635
10637
  endpoint;
10636
10638
  socket = null;
@@ -11253,8 +11255,8 @@ function resolveCliSpawnPlan(options) {
11253
11255
  isWin,
11254
11256
  useShell,
11255
11257
  ptyOptions: {
11256
- cols: 80,
11257
- rows: 24,
11258
+ cols: DEFAULT_SESSION_HOST_COLS,
11259
+ rows: DEFAULT_SESSION_HOST_ROWS,
11258
11260
  cwd: workingDir,
11259
11261
  env: buildCliSpawnEnv(process.env, spawnConfig.env)
11260
11262
  }
@@ -11311,6 +11313,7 @@ var init_provider_cli_runtime = __esm({
11311
11313
  "use strict";
11312
11314
  os11 = __toESM(require("os"));
11313
11315
  path10 = __toESM(require("path"));
11316
+ init_dist();
11314
11317
  init_provider_cli_shared();
11315
11318
  }
11316
11319
  });
@@ -11321,6 +11324,28 @@ __export(provider_cli_adapter_exports, {
11321
11324
  ProviderCliAdapter: () => ProviderCliAdapter,
11322
11325
  normalizeCliProviderForRuntime: () => normalizeCliProviderForRuntime
11323
11326
  });
11327
+ function normalizeComparableTranscriptText(value) {
11328
+ return sanitizeTerminalText(String(value || "")).replace(/\s+/g, " ").trim();
11329
+ }
11330
+ function parsedTranscriptIsRicherThanCommitted(parsedMessages, committedMessages) {
11331
+ if (!Array.isArray(parsedMessages) || !Array.isArray(committedMessages)) return false;
11332
+ if (parsedMessages.length > committedMessages.length) return true;
11333
+ if (parsedMessages.length !== committedMessages.length) return false;
11334
+ for (let index = 0; index < parsedMessages.length; index += 1) {
11335
+ const parsed = parsedMessages[index];
11336
+ const committed = committedMessages[index];
11337
+ if (!parsed || !committed) return false;
11338
+ if ((parsed.role || "") !== (committed.role || "")) return false;
11339
+ if (parsed.id && committed.id && String(parsed.id) !== String(committed.id)) return false;
11340
+ if (typeof parsed.index === "number" && typeof committed.index === "number" && parsed.index !== committed.index) return false;
11341
+ const parsedText = normalizeComparableTranscriptText(parsed.content);
11342
+ const committedText = normalizeComparableTranscriptText(committed.content);
11343
+ if (!parsedText || !committedText || parsedText === committedText) continue;
11344
+ if (parsedText.length > committedText.length && parsedText.startsWith(committedText)) return true;
11345
+ return false;
11346
+ }
11347
+ return false;
11348
+ }
11324
11349
  var os12, ProviderCliAdapter;
11325
11350
  var init_provider_cli_adapter = __esm({
11326
11351
  "../../oss/packages/daemon-core/src/cli-adapters/provider-cli-adapter.ts"() {
@@ -12648,7 +12673,7 @@ var init_provider_cli_adapter = __esm({
12648
12673
  }));
12649
12674
  const parsedLastAssistant = [...parsedHydratedMessages].reverse().find((message) => message.role === "assistant" && typeof message.content === "string" && message.content.trim());
12650
12675
  const visibleIdlePrompt = this.looksLikeVisibleIdlePrompt(screenText);
12651
- const shouldAdoptParsedIdleReplay = !this.currentTurnScope && !this.activeModal && !!parsedLastAssistant && parsedHydratedMessages.length > committedHydratedMessages.length && (this.currentStatus === "idle" || this.currentStatus === "generating" && this.isWaitingForResponse && parsed.status === "idle" && visibleIdlePrompt);
12676
+ const shouldAdoptParsedIdleReplay = !this.currentTurnScope && !this.activeModal && !!parsedLastAssistant && parsedTranscriptIsRicherThanCommitted(parsedHydratedMessages, committedHydratedMessages) && (this.currentStatus === "idle" || this.currentStatus === "generating" && this.isWaitingForResponse && parsed.status === "idle" && visibleIdlePrompt);
12652
12677
  if (shouldAdoptParsedIdleReplay) {
12653
12678
  this.committedMessages = normalizeCliParsedMessages(parsed.messages, {
12654
12679
  committedMessages: this.committedMessages,
@@ -13526,6 +13551,8 @@ var init_cli_provider_instance = __esm({
13526
13551
  generatingDebounceTimer = null;
13527
13552
  generatingDebouncePending = null;
13528
13553
  lastApprovalEventAt = 0;
13554
+ autoApproveBusy = false;
13555
+ autoApproveBusyTimer = null;
13529
13556
  controlValues = {};
13530
13557
  summaryMetadata = void 0;
13531
13558
  appliedEffectKeys = /* @__PURE__ */ new Set();
@@ -13817,7 +13844,13 @@ var init_cli_provider_instance = __esm({
13817
13844
  const parsedStatus = this.adapter.getScriptParsedStatus?.() || null;
13818
13845
  const rawStatus = adapterStatus.status;
13819
13846
  const autoApproveActive = rawStatus === "waiting_approval" && this.shouldAutoApprove();
13820
- if (autoApproveActive) {
13847
+ if (autoApproveActive && !this.autoApproveBusy) {
13848
+ this.autoApproveBusy = true;
13849
+ if (this.autoApproveBusyTimer) clearTimeout(this.autoApproveBusyTimer);
13850
+ this.autoApproveBusyTimer = setTimeout(() => {
13851
+ this.autoApproveBusy = false;
13852
+ this.autoApproveBusyTimer = null;
13853
+ }, 2e3);
13821
13854
  const { index: buttonIndex, label: buttonLabel } = pickApprovalButton(adapterStatus.activeModal?.buttons, this.provider);
13822
13855
  this.recordAutoApproval(adapterStatus.activeModal?.message, buttonLabel, now);
13823
13856
  setTimeout(() => {
@@ -55097,7 +55130,7 @@ var init_adhdev_daemon = __esm({
55097
55130
  init_version();
55098
55131
  init_src();
55099
55132
  init_runtime_defaults();
55100
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.96" });
55133
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.98" });
55101
55134
  AdhdevDaemon = class _AdhdevDaemon {
55102
55135
  localHttpServer = null;
55103
55136
  localWss = null;