@adhdev/daemon-core 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
@@ -8158,21 +8158,27 @@ function readMessageMeta(message) {
8158
8158
  const meta = message?.meta;
8159
8159
  return meta && typeof meta === "object" && !Array.isArray(meta) ? meta : null;
8160
8160
  }
8161
- function isExplicitlyHiddenFromTranscript(meta) {
8162
- if (!meta) return false;
8163
- const visibility = typeof meta.transcriptVisibility === "string" ? meta.transcriptVisibility.trim().toLowerCase() : "";
8164
- return visibility === "hidden" || visibility === "debug" || meta.internal === true || meta.debug === true || meta.statusOnly === true || meta.controlOnly === true;
8165
- }
8166
- function isExplicitlyVisibleInTranscript(meta) {
8167
- if (!meta) return false;
8168
- const visibility = typeof meta.transcriptVisibility === "string" ? meta.transcriptVisibility.trim().toLowerCase() : "";
8169
- return visibility === "visible" || meta.userFacing === true;
8161
+ function readStringField(value) {
8162
+ return typeof value === "string" ? value.trim().toLowerCase() : "";
8163
+ }
8164
+ function isExplicitlyHiddenFromTranscript(message, meta) {
8165
+ const record = message;
8166
+ const visibility = readStringField(record.visibility || meta?.visibility || meta?.transcriptVisibility);
8167
+ const audience = readStringField(record.audience || meta?.audience);
8168
+ const source = readStringField(record.source || meta?.source);
8169
+ return visibility === "hidden" || visibility === "debug" || visibility === "internal" || audience === "debug" || audience === "trace" || audience === "internal" || source === "runtime_status" || source === "provider_chrome" || source === "control" || record.internal === true || record.isInternal === true || record.debug === true || meta?.internal === true || meta?.isInternal === true || meta?.debug === true || meta?.statusOnly === true || meta?.controlOnly === true;
8170
+ }
8171
+ function isExplicitlyVisibleInTranscript(message, meta) {
8172
+ const record = message;
8173
+ const visibility = readStringField(record.visibility || meta?.visibility || meta?.transcriptVisibility);
8174
+ const audience = readStringField(record.audience || meta?.audience);
8175
+ return visibility === "visible" || visibility === "user" || audience === "chat" || record.userFacing === true || meta?.userFacing === true;
8170
8176
  }
8171
8177
  function isUserFacingChatMessage(message) {
8172
8178
  if (!message) return false;
8173
8179
  const meta = readMessageMeta(message);
8174
- if (isExplicitlyHiddenFromTranscript(meta)) return false;
8175
- if (isExplicitlyVisibleInTranscript(meta)) return true;
8180
+ if (isExplicitlyHiddenFromTranscript(message, meta)) return false;
8181
+ if (isExplicitlyVisibleInTranscript(message, meta)) return true;
8176
8182
  const role = typeof message.role === "string" ? message.role.trim().toLowerCase() : "";
8177
8183
  const kind = resolveChatMessageKind(message);
8178
8184
  if (role === "user" || role === "human") return kind === "standard" || kind === "";
@@ -12158,19 +12164,19 @@ function buildReadChatCommandResult(payload, args) {
12158
12164
  const visibleMessages = filterUserFacingChatMessages(messages);
12159
12165
  const sync = buildFullTail(visibleMessages, normalizeReadChatTailLimit(args));
12160
12166
  const hiddenMsgCount = Math.max(0, messages.length - visibleMessages.length);
12161
- const nextDebugReadChat = {
12162
- ...debugReadChat || {},
12163
- fullMsgCount: messages.length,
12167
+ const returnedDebugReadChat = debugReadChat ? {
12168
+ ...debugReadChat,
12169
+ fullMsgCount: typeof debugReadChat.fullMsgCount === "number" ? debugReadChat.fullMsgCount : messages.length,
12164
12170
  visibleMsgCount: visibleMessages.length,
12165
12171
  hiddenMsgCount,
12166
12172
  returnedMsgCount: sync.messages.length
12167
- };
12173
+ } : void 0;
12168
12174
  return {
12169
12175
  success: true,
12170
12176
  ...validatedPayload,
12171
12177
  messages: sync.messages,
12172
12178
  totalMessages: sync.totalMessages,
12173
- debugReadChat: nextDebugReadChat
12179
+ ...returnedDebugReadChat ? { debugReadChat: returnedDebugReadChat } : {}
12174
12180
  };
12175
12181
  }
12176
12182
  var DEFAULT_DEBUG_SANITIZE_OPTIONS = {
@@ -15801,12 +15807,11 @@ ${effect.notification.body || ""}`.trim();
15801
15807
  return Number.isFinite(value) && value > 0 ? value : 0;
15802
15808
  };
15803
15809
  const getRole = (message) => typeof message.role === "string" ? message.role.trim().toLowerCase() : "";
15804
- const isAutoApprovalRuntimeOverlay = (entry) => {
15810
+ const isRuntimeOverlay = (entry) => {
15805
15811
  if (entry.source !== "runtime") return false;
15806
15812
  const key = typeof entry.runtimeKey === "string" ? entry.runtimeKey.trim().toLowerCase() : "";
15807
15813
  if (key.startsWith("auto_approval:")) return true;
15808
- const content = typeof entry.message.content === "string" ? entry.message.content.trim().toLowerCase() : flattenContent(entry.message.content).trim().toLowerCase();
15809
- return content.startsWith("auto-approved:");
15814
+ return !isUserFacingChatMessage(entry.message);
15810
15815
  };
15811
15816
  const shouldKeepParsedBeforeUntimedRuntime = (message) => {
15812
15817
  const role = getRole(message);
@@ -15825,7 +15830,7 @@ ${effect.notification.body || ""}`.trim();
15825
15830
  if (a.source !== b.source && aTime !== bTime) {
15826
15831
  const parsedEntry = a.source === "parsed" ? a : b.source === "parsed" ? b : null;
15827
15832
  const runtimeEntry = a.source === "runtime" ? a : b.source === "runtime" ? b : null;
15828
- if (parsedEntry && runtimeEntry && isAutoApprovalRuntimeOverlay(runtimeEntry) && getTime(parsedEntry.message) === 0 && getTime(runtimeEntry.message) > 0) {
15833
+ if (parsedEntry && runtimeEntry && isRuntimeOverlay(runtimeEntry) && getTime(parsedEntry.message) === 0 && getTime(runtimeEntry.message) > 0) {
15829
15834
  if (shouldKeepParsedBeforeUntimedRuntime(parsedEntry.message)) {
15830
15835
  return a.source === "parsed" ? -1 : 1;
15831
15836
  }