@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-standalone",
3
- "version": "0.9.76-rc.55",
3
+ "version": "0.9.76-rc.56",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -28800,21 +28800,27 @@ function readMessageMeta(message) {
28800
28800
  const meta3 = message?.meta;
28801
28801
  return meta3 && typeof meta3 === "object" && !Array.isArray(meta3) ? meta3 : null;
28802
28802
  }
28803
- function isExplicitlyHiddenFromTranscript(meta3) {
28804
- if (!meta3) return false;
28805
- const visibility = typeof meta3.transcriptVisibility === "string" ? meta3.transcriptVisibility.trim().toLowerCase() : "";
28806
- return visibility === "hidden" || visibility === "debug" || meta3.internal === true || meta3.debug === true || meta3.statusOnly === true || meta3.controlOnly === true;
28807
- }
28808
- function isExplicitlyVisibleInTranscript(meta3) {
28809
- if (!meta3) return false;
28810
- const visibility = typeof meta3.transcriptVisibility === "string" ? meta3.transcriptVisibility.trim().toLowerCase() : "";
28811
- return visibility === "visible" || meta3.userFacing === true;
28803
+ function readStringField(value) {
28804
+ return typeof value === "string" ? value.trim().toLowerCase() : "";
28805
+ }
28806
+ function isExplicitlyHiddenFromTranscript(message, meta3) {
28807
+ const record2 = message;
28808
+ const visibility = readStringField(record2.visibility || meta3?.visibility || meta3?.transcriptVisibility);
28809
+ const audience = readStringField(record2.audience || meta3?.audience);
28810
+ const source = readStringField(record2.source || meta3?.source);
28811
+ 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;
28812
+ }
28813
+ function isExplicitlyVisibleInTranscript(message, meta3) {
28814
+ const record2 = message;
28815
+ const visibility = readStringField(record2.visibility || meta3?.visibility || meta3?.transcriptVisibility);
28816
+ const audience = readStringField(record2.audience || meta3?.audience);
28817
+ return visibility === "visible" || visibility === "user" || audience === "chat" || record2.userFacing === true || meta3?.userFacing === true;
28812
28818
  }
28813
28819
  function isUserFacingChatMessage(message) {
28814
28820
  if (!message) return false;
28815
28821
  const meta3 = readMessageMeta(message);
28816
- if (isExplicitlyHiddenFromTranscript(meta3)) return false;
28817
- if (isExplicitlyVisibleInTranscript(meta3)) return true;
28822
+ if (isExplicitlyHiddenFromTranscript(message, meta3)) return false;
28823
+ if (isExplicitlyVisibleInTranscript(message, meta3)) return true;
28818
28824
  const role = typeof message.role === "string" ? message.role.trim().toLowerCase() : "";
28819
28825
  const kind = resolveChatMessageKind(message);
28820
28826
  if (role === "user" || role === "human") return kind === "standard" || kind === "";
@@ -30992,19 +30998,19 @@ function buildReadChatCommandResult(payload, args) {
30992
30998
  const visibleMessages = filterUserFacingChatMessages(messages);
30993
30999
  const sync = buildFullTail(visibleMessages, normalizeReadChatTailLimit(args));
30994
31000
  const hiddenMsgCount = Math.max(0, messages.length - visibleMessages.length);
30995
- const nextDebugReadChat = {
30996
- ...debugReadChat || {},
30997
- fullMsgCount: messages.length,
31001
+ const returnedDebugReadChat = debugReadChat ? {
31002
+ ...debugReadChat,
31003
+ fullMsgCount: typeof debugReadChat.fullMsgCount === "number" ? debugReadChat.fullMsgCount : messages.length,
30998
31004
  visibleMsgCount: visibleMessages.length,
30999
31005
  hiddenMsgCount,
31000
31006
  returnedMsgCount: sync.messages.length
31001
- };
31007
+ } : void 0;
31002
31008
  return {
31003
31009
  success: true,
31004
31010
  ...validatedPayload,
31005
31011
  messages: sync.messages,
31006
31012
  totalMessages: sync.totalMessages,
31007
- debugReadChat: nextDebugReadChat
31013
+ ...returnedDebugReadChat ? { debugReadChat: returnedDebugReadChat } : {}
31008
31014
  };
31009
31015
  }
31010
31016
  function truncateDebugString(value, maxLength) {
@@ -47248,12 +47254,11 @@ ${effect.notification.body || ""}`.trim();
47248
47254
  return Number.isFinite(value) && value > 0 ? value : 0;
47249
47255
  };
47250
47256
  const getRole = (message) => typeof message.role === "string" ? message.role.trim().toLowerCase() : "";
47251
- const isAutoApprovalRuntimeOverlay = (entry) => {
47257
+ const isRuntimeOverlay = (entry) => {
47252
47258
  if (entry.source !== "runtime") return false;
47253
47259
  const key = typeof entry.runtimeKey === "string" ? entry.runtimeKey.trim().toLowerCase() : "";
47254
47260
  if (key.startsWith("auto_approval:")) return true;
47255
- const content = typeof entry.message.content === "string" ? entry.message.content.trim().toLowerCase() : flattenContent(entry.message.content).trim().toLowerCase();
47256
- return content.startsWith("auto-approved:");
47261
+ return !isUserFacingChatMessage(entry.message);
47257
47262
  };
47258
47263
  const shouldKeepParsedBeforeUntimedRuntime = (message) => {
47259
47264
  const role = getRole(message);
@@ -47272,7 +47277,7 @@ ${effect.notification.body || ""}`.trim();
47272
47277
  if (a.source !== b.source && aTime !== bTime) {
47273
47278
  const parsedEntry = a.source === "parsed" ? a : b.source === "parsed" ? b : null;
47274
47279
  const runtimeEntry = a.source === "runtime" ? a : b.source === "runtime" ? b : null;
47275
- if (parsedEntry && runtimeEntry && isAutoApprovalRuntimeOverlay(runtimeEntry) && getTime(parsedEntry.message) === 0 && getTime(runtimeEntry.message) > 0) {
47280
+ if (parsedEntry && runtimeEntry && isRuntimeOverlay(runtimeEntry) && getTime(parsedEntry.message) === 0 && getTime(runtimeEntry.message) > 0) {
47276
47281
  if (shouldKeepParsedBeforeUntimedRuntime(parsedEntry.message)) {
47277
47282
  return a.source === "parsed" ? -1 : 1;
47278
47283
  }