@adhdev/daemon-standalone 0.9.76-rc.55 → 0.9.76-rc.56

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/index.js CHANGED
@@ -39302,21 +39302,27 @@ ${lastSnapshot}`;
39302
39302
  const meta3 = message?.meta;
39303
39303
  return meta3 && typeof meta3 === "object" && !Array.isArray(meta3) ? meta3 : null;
39304
39304
  }
39305
- function isExplicitlyHiddenFromTranscript(meta3) {
39306
- if (!meta3) return false;
39307
- const visibility = typeof meta3.transcriptVisibility === "string" ? meta3.transcriptVisibility.trim().toLowerCase() : "";
39308
- return visibility === "hidden" || visibility === "debug" || meta3.internal === true || meta3.debug === true || meta3.statusOnly === true || meta3.controlOnly === true;
39309
- }
39310
- function isExplicitlyVisibleInTranscript(meta3) {
39311
- if (!meta3) return false;
39312
- const visibility = typeof meta3.transcriptVisibility === "string" ? meta3.transcriptVisibility.trim().toLowerCase() : "";
39313
- return visibility === "visible" || meta3.userFacing === true;
39305
+ function readStringField(value) {
39306
+ return typeof value === "string" ? value.trim().toLowerCase() : "";
39307
+ }
39308
+ function isExplicitlyHiddenFromTranscript(message, meta3) {
39309
+ const record2 = message;
39310
+ const visibility = readStringField(record2.visibility || meta3?.visibility || meta3?.transcriptVisibility);
39311
+ const audience = readStringField(record2.audience || meta3?.audience);
39312
+ const source = readStringField(record2.source || meta3?.source);
39313
+ return visibility === "hidden" || visibility === "debug" || visibility === "internal" || audience === "debug" || audience === "trace" || audience === "internal" || source === "runtime_status" || source === "provider_chrome" || source === "control" || record2.internal === true || record2.isInternal === true || record2.debug === true || meta3?.internal === true || meta3?.isInternal === true || meta3?.debug === true || meta3?.statusOnly === true || meta3?.controlOnly === true;
39314
+ }
39315
+ function isExplicitlyVisibleInTranscript(message, meta3) {
39316
+ const record2 = message;
39317
+ const visibility = readStringField(record2.visibility || meta3?.visibility || meta3?.transcriptVisibility);
39318
+ const audience = readStringField(record2.audience || meta3?.audience);
39319
+ return visibility === "visible" || visibility === "user" || audience === "chat" || record2.userFacing === true || meta3?.userFacing === true;
39314
39320
  }
39315
39321
  function isUserFacingChatMessage(message) {
39316
39322
  if (!message) return false;
39317
39323
  const meta3 = readMessageMeta(message);
39318
- if (isExplicitlyHiddenFromTranscript(meta3)) return false;
39319
- if (isExplicitlyVisibleInTranscript(meta3)) return true;
39324
+ if (isExplicitlyHiddenFromTranscript(message, meta3)) return false;
39325
+ if (isExplicitlyVisibleInTranscript(message, meta3)) return true;
39320
39326
  const role = typeof message.role === "string" ? message.role.trim().toLowerCase() : "";
39321
39327
  const kind = resolveChatMessageKind(message);
39322
39328
  if (role === "user" || role === "human") return kind === "standard" || kind === "";
@@ -43252,19 +43258,19 @@ ${effect.notification.body || ""}`.trim();
43252
43258
  const visibleMessages = filterUserFacingChatMessages(messages);
43253
43259
  const sync = buildFullTail(visibleMessages, normalizeReadChatTailLimit(args));
43254
43260
  const hiddenMsgCount = Math.max(0, messages.length - visibleMessages.length);
43255
- const nextDebugReadChat = {
43256
- ...debugReadChat || {},
43257
- fullMsgCount: messages.length,
43261
+ const returnedDebugReadChat = debugReadChat ? {
43262
+ ...debugReadChat,
43263
+ fullMsgCount: typeof debugReadChat.fullMsgCount === "number" ? debugReadChat.fullMsgCount : messages.length,
43258
43264
  visibleMsgCount: visibleMessages.length,
43259
43265
  hiddenMsgCount,
43260
43266
  returnedMsgCount: sync.messages.length
43261
- };
43267
+ } : void 0;
43262
43268
  return {
43263
43269
  success: true,
43264
43270
  ...validatedPayload,
43265
43271
  messages: sync.messages,
43266
43272
  totalMessages: sync.totalMessages,
43267
- debugReadChat: nextDebugReadChat
43273
+ ...returnedDebugReadChat ? { debugReadChat: returnedDebugReadChat } : {}
43268
43274
  };
43269
43275
  }
43270
43276
  var DEFAULT_DEBUG_SANITIZE_OPTIONS = {
@@ -46873,12 +46879,11 @@ ${effect.notification.body || ""}`.trim();
46873
46879
  return Number.isFinite(value) && value > 0 ? value : 0;
46874
46880
  };
46875
46881
  const getRole = (message) => typeof message.role === "string" ? message.role.trim().toLowerCase() : "";
46876
- const isAutoApprovalRuntimeOverlay = (entry) => {
46882
+ const isRuntimeOverlay = (entry) => {
46877
46883
  if (entry.source !== "runtime") return false;
46878
46884
  const key = typeof entry.runtimeKey === "string" ? entry.runtimeKey.trim().toLowerCase() : "";
46879
46885
  if (key.startsWith("auto_approval:")) return true;
46880
- const content = typeof entry.message.content === "string" ? entry.message.content.trim().toLowerCase() : flattenContent(entry.message.content).trim().toLowerCase();
46881
- return content.startsWith("auto-approved:");
46886
+ return !isUserFacingChatMessage(entry.message);
46882
46887
  };
46883
46888
  const shouldKeepParsedBeforeUntimedRuntime = (message) => {
46884
46889
  const role = getRole(message);
@@ -46897,7 +46902,7 @@ ${effect.notification.body || ""}`.trim();
46897
46902
  if (a.source !== b2.source && aTime !== bTime) {
46898
46903
  const parsedEntry = a.source === "parsed" ? a : b2.source === "parsed" ? b2 : null;
46899
46904
  const runtimeEntry = a.source === "runtime" ? a : b2.source === "runtime" ? b2 : null;
46900
- if (parsedEntry && runtimeEntry && isAutoApprovalRuntimeOverlay(runtimeEntry) && getTime(parsedEntry.message) === 0 && getTime(runtimeEntry.message) > 0) {
46905
+ if (parsedEntry && runtimeEntry && isRuntimeOverlay(runtimeEntry) && getTime(parsedEntry.message) === 0 && getTime(runtimeEntry.message) > 0) {
46901
46906
  if (shouldKeepParsedBeforeUntimedRuntime(parsedEntry.message)) {
46902
46907
  return a.source === "parsed" ? -1 : 1;
46903
46908
  }