adhdev 0.9.43 → 0.9.44

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
@@ -12774,7 +12774,8 @@ var provider_cli_adapter_exports = {};
12774
12774
  __export(provider_cli_adapter_exports, {
12775
12775
  ProviderCliAdapter: () => ProviderCliAdapter,
12776
12776
  appendBoundedText: () => appendBoundedText,
12777
- normalizeCliProviderForRuntime: () => normalizeCliProviderForRuntime
12777
+ normalizeCliProviderForRuntime: () => normalizeCliProviderForRuntime,
12778
+ sanitizeCliStandardMessageContent: () => sanitizeCliStandardMessageContent
12778
12779
  });
12779
12780
  function normalizeComparableTranscriptText(value) {
12780
12781
  return sanitizeTerminalText(String(value || "")).replace(/\s+/g, " ").trim();
@@ -12814,7 +12815,63 @@ function appendBoundedText(current, chunk, maxChars) {
12814
12815
  if (current.length <= keepFromCurrent) return current + chunk;
12815
12816
  return current.slice(-keepFromCurrent) + chunk;
12816
12817
  }
12817
- var os13, ProviderCliAdapter;
12818
+ function isLikelyCommittedActivityPrefixContinuation(line) {
12819
+ const trimmed = String(line || "").trim();
12820
+ if (!trimmed) return false;
12821
+ if (COMMITTED_ACTIVITY_PREFIX_BLOCK_RE.test(trimmed)) return false;
12822
+ if (/\s/.test(trimmed)) return false;
12823
+ if (/[가-힣]/.test(trimmed)) return false;
12824
+ if (trimmed.length > 96) return false;
12825
+ return /^[A-Za-z0-9_./:@+%=-]+$/.test(trimmed);
12826
+ }
12827
+ function parseCommittedActivityPrefixBlock(lines, index) {
12828
+ const first = String(lines[index] || "").trim();
12829
+ if (!COMMITTED_ACTIVITY_PREFIX_BLOCK_RE.test(first)) return null;
12830
+ const parts = [first];
12831
+ let nextIndex = index + 1;
12832
+ while (nextIndex < lines.length && isLikelyCommittedActivityPrefixContinuation(lines[nextIndex])) {
12833
+ parts.push(String(lines[nextIndex] || "").trim());
12834
+ nextIndex += 1;
12835
+ }
12836
+ return { label: parts.join(""), nextIndex };
12837
+ }
12838
+ function sanitizeCliStandardMessageContent(content) {
12839
+ const source = String(content || "").trim();
12840
+ if (!source) return "";
12841
+ const lines = source.split(/\r?\n/);
12842
+ if (lines.length < 4) return source;
12843
+ const counts = /* @__PURE__ */ new Map();
12844
+ for (let index = 0; index < lines.length; index += 1) {
12845
+ const block = parseCommittedActivityPrefixBlock(lines, index);
12846
+ if (!block) continue;
12847
+ counts.set(block.label, (counts.get(block.label) || 0) + 1);
12848
+ index = block.nextIndex - 1;
12849
+ }
12850
+ const repeatedLabels = new Set(
12851
+ Array.from(counts.entries()).filter(([, count]) => count >= 3).map(([label]) => label)
12852
+ );
12853
+ if (repeatedLabels.size === 0) return source;
12854
+ const stripped = [];
12855
+ let removed = 0;
12856
+ for (let index = 0; index < lines.length; index += 1) {
12857
+ const block = parseCommittedActivityPrefixBlock(lines, index);
12858
+ if (block && repeatedLabels.has(block.label)) {
12859
+ removed += 1;
12860
+ index = block.nextIndex - 1;
12861
+ continue;
12862
+ }
12863
+ stripped.push(lines[index]);
12864
+ }
12865
+ const next = stripped.join("\n").replace(/\n{3,}/g, "\n\n").trim();
12866
+ return removed >= 3 && next.length >= 80 ? next : source;
12867
+ }
12868
+ function sanitizeCommittedMessageForDisplay(message) {
12869
+ if (!message || message.role !== "assistant" || (message.kind || "standard") !== "standard") return message;
12870
+ const content = sanitizeCliStandardMessageContent(message.content);
12871
+ if (content === message.content) return message;
12872
+ return { ...message, content };
12873
+ }
12874
+ var os13, COMMITTED_ACTIVITY_PREFIX_BLOCK_RE, ProviderCliAdapter;
12818
12875
  var init_provider_cli_adapter = __esm({
12819
12876
  "../../oss/packages/daemon-core/src/cli-adapters/provider-cli-adapter.ts"() {
12820
12877
  "use strict";
@@ -12830,6 +12887,7 @@ var init_provider_cli_adapter = __esm({
12830
12887
  init_provider_cli_config();
12831
12888
  init_provider_cli_runtime();
12832
12889
  init_provider_cli_shared();
12890
+ COMMITTED_ACTIVITY_PREFIX_BLOCK_RE = /^(?:📖|💻|🔎|📚|📋|✏️|📝|🔧|🛠️|⚙️)\s+(.+)$/;
12833
12891
  ProviderCliAdapter = class _ProviderCliAdapter {
12834
12892
  constructor(provider, workingDir, extraArgs = [], transportFactory = new NodePtyTransportFactory()) {
12835
12893
  this.extraArgs = extraArgs;
@@ -13041,7 +13099,10 @@ var init_provider_cli_adapter = __esm({
13041
13099
  const tailFirst = parseBaseMessages[0];
13042
13100
  if (tailFirst && this.messagesComparable(parsedFirst, tailFirst)) {
13043
13101
  const prefixLength = fullBaseMessages.length - parseBaseMessages.length;
13044
- return [...fullBaseMessages.slice(0, prefixLength), ...parsedMessages];
13102
+ const prefix = fullBaseMessages.slice(0, prefixLength);
13103
+ const shouldSanitizePrefix = !!this.currentTurnScope || this.currentStatus !== "idle" || !!this.activeModal;
13104
+ const nextPrefix = shouldSanitizePrefix ? prefix.map((message) => sanitizeCommittedMessageForDisplay(message)) : prefix;
13105
+ return [...nextPrefix, ...parsedMessages];
13045
13106
  }
13046
13107
  return [...fullBaseMessages, ...parsedMessages];
13047
13108
  }
@@ -14240,10 +14301,12 @@ var init_provider_cli_adapter = __esm({
14240
14301
  }
14241
14302
  buildCommittedChatMessages() {
14242
14303
  return this.committedMessages.map((message, index) => {
14243
- const contentValue = message.content;
14304
+ const rawContentValue = message.content;
14305
+ const rawContent = typeof rawContentValue === "string" ? rawContentValue : String(rawContentValue || "");
14306
+ const content = message.role === "assistant" && (message.kind || "standard") === "standard" ? sanitizeCliStandardMessageContent(rawContent) : rawContent;
14244
14307
  return buildChatMessage({
14245
14308
  role: message.role,
14246
- content: typeof contentValue === "string" ? contentValue : String(contentValue || ""),
14309
+ content,
14247
14310
  timestamp: message.timestamp,
14248
14311
  kind: message.kind,
14249
14312
  meta: message.meta,
@@ -88440,7 +88503,7 @@ var init_adhdev_daemon = __esm({
88440
88503
  init_version();
88441
88504
  init_src();
88442
88505
  init_runtime_defaults();
88443
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.43" });
88506
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.44" });
88444
88507
  AdhdevDaemon = class _AdhdevDaemon {
88445
88508
  localHttpServer = null;
88446
88509
  localWss = null;