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/cli/index.js CHANGED
@@ -11061,6 +11061,8 @@ var init_terminal_screen = __esm({
11061
11061
  // ../../oss/packages/session-host-core/dist/index.mjs
11062
11062
  var dist_exports = {};
11063
11063
  __export(dist_exports, {
11064
+ DEFAULT_SESSION_HOST_COLS: () => DEFAULT_SESSION_HOST_COLS,
11065
+ DEFAULT_SESSION_HOST_ROWS: () => DEFAULT_SESSION_HOST_ROWS,
11064
11066
  SessionHostClient: () => SessionHostClient,
11065
11067
  SessionHostRegistry: () => SessionHostRegistry,
11066
11068
  SessionRingBuffer: () => SessionRingBuffer,
@@ -11079,9 +11081,22 @@ __export(dist_exports, {
11079
11081
  isSessionHostRecoverySnapshot: () => isSessionHostRecoverySnapshot2,
11080
11082
  resolveAttachableRuntimeRecord: () => resolveAttachableRuntimeRecord,
11081
11083
  resolveRuntimeRecord: () => resolveRuntimeRecord,
11084
+ resolveSessionHostCols: () => resolveSessionHostCols,
11085
+ resolveSessionHostRows: () => resolveSessionHostRows,
11082
11086
  sanitizeSpawnEnv: () => sanitizeSpawnEnv,
11083
11087
  writeEnvelope: () => writeEnvelope
11084
11088
  });
11089
+ function normalizeSessionHostDimension(value, fallback2) {
11090
+ if (typeof value !== "number" || !Number.isFinite(value)) return fallback2;
11091
+ const rounded = Math.floor(value);
11092
+ return rounded > 0 ? rounded : fallback2;
11093
+ }
11094
+ function resolveSessionHostCols(value) {
11095
+ return normalizeSessionHostDimension(value, DEFAULT_SESSION_HOST_COLS);
11096
+ }
11097
+ function resolveSessionHostRows(value) {
11098
+ return normalizeSessionHostDimension(value, DEFAULT_SESSION_HOST_ROWS);
11099
+ }
11085
11100
  function normalizeSlug(input) {
11086
11101
  return input.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48);
11087
11102
  }
@@ -11278,7 +11293,7 @@ function ensureNodePtySpawnHelperPermissions(logFn) {
11278
11293
  } catch {
11279
11294
  }
11280
11295
  }
11281
- var import_crypto3, path9, os9, path22, net, import_crypto4, os22, path32, __require, SessionRingBuffer, LIVE_LIFECYCLES2, SessionHostRegistry, SessionHostClient;
11296
+ var import_crypto3, path9, os9, path22, net, import_crypto4, os22, path32, __require, SessionRingBuffer, DEFAULT_SESSION_HOST_COLS, DEFAULT_SESSION_HOST_ROWS, LIVE_LIFECYCLES2, SessionHostRegistry, SessionHostClient;
11282
11297
  var init_dist = __esm({
11283
11298
  "../../oss/packages/session-host-core/dist/index.mjs"() {
11284
11299
  "use strict";
@@ -11356,6 +11371,8 @@ var init_dist = __esm({
11356
11371
  }
11357
11372
  }
11358
11373
  };
11374
+ DEFAULT_SESSION_HOST_COLS = 80;
11375
+ DEFAULT_SESSION_HOST_ROWS = 48;
11359
11376
  LIVE_LIFECYCLES2 = /* @__PURE__ */ new Set(["starting", "running", "stopping", "interrupted"]);
11360
11377
  SessionHostRegistry = class {
11361
11378
  sessions = /* @__PURE__ */ new Map();
@@ -11397,8 +11414,8 @@ var init_dist = __esm({
11397
11414
  meta: payload.meta || {}
11398
11415
  };
11399
11416
  record2.meta = {
11400
- sessionHostCols: payload.cols || 80,
11401
- sessionHostRows: payload.rows || 24,
11417
+ sessionHostCols: resolveSessionHostCols(payload.cols),
11418
+ sessionHostRows: resolveSessionHostRows(payload.rows),
11402
11419
  ...record2.meta
11403
11420
  };
11404
11421
  this.sessions.set(sessionId, {
@@ -12194,8 +12211,8 @@ function resolveCliSpawnPlan(options) {
12194
12211
  isWin,
12195
12212
  useShell,
12196
12213
  ptyOptions: {
12197
- cols: 80,
12198
- rows: 24,
12214
+ cols: DEFAULT_SESSION_HOST_COLS,
12215
+ rows: DEFAULT_SESSION_HOST_ROWS,
12199
12216
  cwd: workingDir,
12200
12217
  env: buildCliSpawnEnv(process.env, spawnConfig.env)
12201
12218
  }
@@ -12252,6 +12269,7 @@ var init_provider_cli_runtime = __esm({
12252
12269
  "use strict";
12253
12270
  os12 = __toESM(require("os"));
12254
12271
  path11 = __toESM(require("path"));
12272
+ init_dist();
12255
12273
  init_provider_cli_shared();
12256
12274
  }
12257
12275
  });
@@ -12262,6 +12280,28 @@ __export(provider_cli_adapter_exports, {
12262
12280
  ProviderCliAdapter: () => ProviderCliAdapter,
12263
12281
  normalizeCliProviderForRuntime: () => normalizeCliProviderForRuntime
12264
12282
  });
12283
+ function normalizeComparableTranscriptText(value) {
12284
+ return sanitizeTerminalText(String(value || "")).replace(/\s+/g, " ").trim();
12285
+ }
12286
+ function parsedTranscriptIsRicherThanCommitted(parsedMessages, committedMessages) {
12287
+ if (!Array.isArray(parsedMessages) || !Array.isArray(committedMessages)) return false;
12288
+ if (parsedMessages.length > committedMessages.length) return true;
12289
+ if (parsedMessages.length !== committedMessages.length) return false;
12290
+ for (let index = 0; index < parsedMessages.length; index += 1) {
12291
+ const parsed = parsedMessages[index];
12292
+ const committed = committedMessages[index];
12293
+ if (!parsed || !committed) return false;
12294
+ if ((parsed.role || "") !== (committed.role || "")) return false;
12295
+ if (parsed.id && committed.id && String(parsed.id) !== String(committed.id)) return false;
12296
+ if (typeof parsed.index === "number" && typeof committed.index === "number" && parsed.index !== committed.index) return false;
12297
+ const parsedText = normalizeComparableTranscriptText(parsed.content);
12298
+ const committedText = normalizeComparableTranscriptText(committed.content);
12299
+ if (!parsedText || !committedText || parsedText === committedText) continue;
12300
+ if (parsedText.length > committedText.length && parsedText.startsWith(committedText)) return true;
12301
+ return false;
12302
+ }
12303
+ return false;
12304
+ }
12265
12305
  var os13, ProviderCliAdapter;
12266
12306
  var init_provider_cli_adapter = __esm({
12267
12307
  "../../oss/packages/daemon-core/src/cli-adapters/provider-cli-adapter.ts"() {
@@ -13589,7 +13629,7 @@ var init_provider_cli_adapter = __esm({
13589
13629
  }));
13590
13630
  const parsedLastAssistant = [...parsedHydratedMessages].reverse().find((message) => message.role === "assistant" && typeof message.content === "string" && message.content.trim());
13591
13631
  const visibleIdlePrompt = this.looksLikeVisibleIdlePrompt(screenText);
13592
- const shouldAdoptParsedIdleReplay = !this.currentTurnScope && !this.activeModal && !!parsedLastAssistant && parsedHydratedMessages.length > committedHydratedMessages.length && (this.currentStatus === "idle" || this.currentStatus === "generating" && this.isWaitingForResponse && parsed.status === "idle" && visibleIdlePrompt);
13632
+ const shouldAdoptParsedIdleReplay = !this.currentTurnScope && !this.activeModal && !!parsedLastAssistant && parsedTranscriptIsRicherThanCommitted(parsedHydratedMessages, committedHydratedMessages) && (this.currentStatus === "idle" || this.currentStatus === "generating" && this.isWaitingForResponse && parsed.status === "idle" && visibleIdlePrompt);
13593
13633
  if (shouldAdoptParsedIdleReplay) {
13594
13634
  this.committedMessages = normalizeCliParsedMessages(parsed.messages, {
13595
13635
  committedMessages: this.committedMessages,
@@ -14467,6 +14507,8 @@ var init_cli_provider_instance = __esm({
14467
14507
  generatingDebounceTimer = null;
14468
14508
  generatingDebouncePending = null;
14469
14509
  lastApprovalEventAt = 0;
14510
+ autoApproveBusy = false;
14511
+ autoApproveBusyTimer = null;
14470
14512
  controlValues = {};
14471
14513
  summaryMetadata = void 0;
14472
14514
  appliedEffectKeys = /* @__PURE__ */ new Set();
@@ -14758,7 +14800,13 @@ var init_cli_provider_instance = __esm({
14758
14800
  const parsedStatus = this.adapter.getScriptParsedStatus?.() || null;
14759
14801
  const rawStatus = adapterStatus.status;
14760
14802
  const autoApproveActive = rawStatus === "waiting_approval" && this.shouldAutoApprove();
14761
- if (autoApproveActive) {
14803
+ if (autoApproveActive && !this.autoApproveBusy) {
14804
+ this.autoApproveBusy = true;
14805
+ if (this.autoApproveBusyTimer) clearTimeout(this.autoApproveBusyTimer);
14806
+ this.autoApproveBusyTimer = setTimeout(() => {
14807
+ this.autoApproveBusy = false;
14808
+ this.autoApproveBusyTimer = null;
14809
+ }, 2e3);
14762
14810
  const { index: buttonIndex, label: buttonLabel } = pickApprovalButton(adapterStatus.activeModal?.buttons, this.provider);
14763
14811
  this.recordAutoApproval(adapterStatus.activeModal?.message, buttonLabel, now);
14764
14812
  setTimeout(() => {
@@ -86802,7 +86850,7 @@ var init_adhdev_daemon = __esm({
86802
86850
  init_version();
86803
86851
  init_src();
86804
86852
  init_runtime_defaults();
86805
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.96" });
86853
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.98" });
86806
86854
  AdhdevDaemon = class _AdhdevDaemon {
86807
86855
  localHttpServer = null;
86808
86856
  localWss = null;