adhdev 0.8.81 → 0.8.82

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
@@ -542,6 +542,96 @@ function getSessionSeenMarker(state, sessionId, providerSessionId) {
542
542
  const providerKey = buildSessionReadStateKey(sessionId, providerSessionId);
543
543
  return state.sessionReadMarkers?.[providerKey] || state.sessionReadMarkers?.[sessionId] || "";
544
544
  }
545
+ function getSessionNotificationDismissal(state, sessionId, providerSessionId) {
546
+ const providerKey = buildSessionReadStateKey(sessionId, providerSessionId);
547
+ return state.sessionNotificationDismissals?.[providerKey] || state.sessionNotificationDismissals?.[sessionId] || "";
548
+ }
549
+ function getSessionNotificationUnreadOverride(state, sessionId, providerSessionId) {
550
+ const providerKey = buildSessionReadStateKey(sessionId, providerSessionId);
551
+ return state.sessionNotificationUnreadOverrides?.[providerKey] || state.sessionNotificationUnreadOverrides?.[sessionId] || "";
552
+ }
553
+ function dismissSessionNotification(state, sessionId, notificationId, providerSessionId) {
554
+ const dismissalId = String(notificationId || "").trim();
555
+ if (!dismissalId) return state;
556
+ const dismissalKeys = Array.from(new Set([
557
+ sessionId,
558
+ buildSessionReadStateKey(sessionId, providerSessionId)
559
+ ].filter(Boolean)));
560
+ const nextSessionNotificationDismissals = { ...state.sessionNotificationDismissals || {} };
561
+ const nextSessionNotificationUnreadOverrides = { ...state.sessionNotificationUnreadOverrides || {} };
562
+ for (const key of dismissalKeys) {
563
+ nextSessionNotificationDismissals[key] = dismissalId;
564
+ delete nextSessionNotificationUnreadOverrides[key];
565
+ }
566
+ return {
567
+ ...state,
568
+ sessionNotificationDismissals: nextSessionNotificationDismissals,
569
+ sessionNotificationUnreadOverrides: nextSessionNotificationUnreadOverrides
570
+ };
571
+ }
572
+ function markSessionNotificationUnread(state, sessionId, notificationId, providerSessionId) {
573
+ const unreadId = String(notificationId || "").trim();
574
+ if (!unreadId) return state;
575
+ const unreadKeys = Array.from(new Set([
576
+ sessionId,
577
+ buildSessionReadStateKey(sessionId, providerSessionId)
578
+ ].filter(Boolean)));
579
+ const nextSessionNotificationDismissals = { ...state.sessionNotificationDismissals || {} };
580
+ const nextSessionNotificationUnreadOverrides = { ...state.sessionNotificationUnreadOverrides || {} };
581
+ for (const key of unreadKeys) {
582
+ nextSessionNotificationUnreadOverrides[key] = unreadId;
583
+ delete nextSessionNotificationDismissals[key];
584
+ }
585
+ return {
586
+ ...state,
587
+ sessionNotificationDismissals: nextSessionNotificationDismissals,
588
+ sessionNotificationUnreadOverrides: nextSessionNotificationUnreadOverrides
589
+ };
590
+ }
591
+ function getSessionNotificationTargetValue(session) {
592
+ const providerSessionId = typeof session.providerSessionId === "string" ? session.providerSessionId.trim() : "";
593
+ return providerSessionId || session.id;
594
+ }
595
+ function getSessionCurrentNotificationId(session) {
596
+ const inboxBucket = session.inboxBucket || "idle";
597
+ const isNeedsAttention = inboxBucket === "needs_attention" || session.status === "waiting_approval";
598
+ const isTaskComplete = inboxBucket === "task_complete" && !!session.unread;
599
+ const type = isNeedsAttention ? "needs_attention" : isTaskComplete ? "task_complete" : "";
600
+ if (!type) return "";
601
+ const target = getSessionNotificationTargetValue(session);
602
+ const lastMessageHash = typeof session.lastMessageHash === "string" ? session.lastMessageHash : "";
603
+ const timestamp = Number(session.lastMessageAt || session.lastUpdated || 0);
604
+ return [type, target, lastMessageHash, String(timestamp)].join("|");
605
+ }
606
+ function applySessionNotificationOverlay(session, overlay) {
607
+ const currentNotificationId = getSessionCurrentNotificationId(session);
608
+ const taskCompleteNotificationId = (() => {
609
+ const target = getSessionNotificationTargetValue(session);
610
+ const lastMessageHash = typeof session.lastMessageHash === "string" ? session.lastMessageHash : "";
611
+ const timestamp = Number(session.lastMessageAt || session.lastUpdated || 0);
612
+ if (!target || !lastMessageHash || !timestamp) return "";
613
+ return ["task_complete", target, lastMessageHash, String(timestamp)].join("|");
614
+ })();
615
+ const dismissedNotificationId = typeof overlay.dismissedNotificationId === "string" ? overlay.dismissedNotificationId.trim() : "";
616
+ const unreadNotificationId = typeof overlay.unreadNotificationId === "string" ? overlay.unreadNotificationId.trim() : "";
617
+ if (unreadNotificationId && (currentNotificationId === unreadNotificationId || taskCompleteNotificationId === unreadNotificationId)) {
618
+ const forcedInboxBucket = session.inboxBucket === "needs_attention" || session.status === "waiting_approval" ? "needs_attention" : "task_complete";
619
+ return {
620
+ unread: true,
621
+ inboxBucket: forcedInboxBucket
622
+ };
623
+ }
624
+ if (!currentNotificationId || !dismissedNotificationId || currentNotificationId !== dismissedNotificationId) {
625
+ return {
626
+ unread: !!session.unread,
627
+ inboxBucket: session.inboxBucket || "idle"
628
+ };
629
+ }
630
+ return {
631
+ unread: false,
632
+ inboxBucket: "idle"
633
+ };
634
+ }
545
635
  function markSessionSeen(state, sessionId, seenAt = Date.now(), completionMarker, providerSessionId) {
546
636
  const prev = state.sessionReads || {};
547
637
  const prevMarkers = state.sessionReadMarkers || {};
@@ -552,14 +642,20 @@ function markSessionSeen(state, sessionId, seenAt = Date.now(), completionMarker
552
642
  ].filter(Boolean)));
553
643
  const nextSessionReads = { ...prev };
554
644
  const nextSessionReadMarkers = { ...prevMarkers };
645
+ const nextSessionNotificationDismissals = { ...state.sessionNotificationDismissals || {} };
646
+ const nextSessionNotificationUnreadOverrides = { ...state.sessionNotificationUnreadOverrides || {} };
555
647
  for (const key of readKeys) {
556
648
  nextSessionReads[key] = Math.max(prev[key] || 0, seenAt);
557
649
  if (nextMarker) nextSessionReadMarkers[key] = nextMarker;
650
+ delete nextSessionNotificationDismissals[key];
651
+ delete nextSessionNotificationUnreadOverrides[key];
558
652
  }
559
653
  return {
560
654
  ...state,
561
655
  sessionReads: nextSessionReads,
562
- sessionReadMarkers: nextMarker ? nextSessionReadMarkers : prevMarkers
656
+ sessionReadMarkers: nextMarker ? nextSessionReadMarkers : prevMarkers,
657
+ sessionNotificationDismissals: nextSessionNotificationDismissals,
658
+ sessionNotificationUnreadOverrides: nextSessionNotificationUnreadOverrides
563
659
  };
564
660
  }
565
661
  var path2, MAX_ACTIVITY;
@@ -689,11 +785,19 @@ function normalizeState(raw) {
689
785
  const sessionReadMarkers = Object.fromEntries(
690
786
  Object.entries(isPlainObject2(parsed.sessionReadMarkers) ? parsed.sessionReadMarkers : {}).filter(([key, value]) => !isLegacyVolatileSessionReadKey(key) && typeof value === "string")
691
787
  );
788
+ const sessionNotificationDismissals = Object.fromEntries(
789
+ Object.entries(isPlainObject2(parsed.sessionNotificationDismissals) ? parsed.sessionNotificationDismissals : {}).filter(([key, value]) => !isLegacyVolatileSessionReadKey(key) && typeof value === "string" && value.length > 0)
790
+ );
791
+ const sessionNotificationUnreadOverrides = Object.fromEntries(
792
+ Object.entries(isPlainObject2(parsed.sessionNotificationUnreadOverrides) ? parsed.sessionNotificationUnreadOverrides : {}).filter(([key, value]) => !isLegacyVolatileSessionReadKey(key) && typeof value === "string" && value.length > 0)
793
+ );
692
794
  return {
693
795
  recentActivity,
694
796
  savedProviderSessions,
695
797
  sessionReads,
696
- sessionReadMarkers
798
+ sessionReadMarkers,
799
+ sessionNotificationDismissals,
800
+ sessionNotificationUnreadOverrides
697
801
  };
698
802
  }
699
803
  function loadState() {
@@ -728,7 +832,9 @@ var init_state_store = __esm({
728
832
  recentActivity: [],
729
833
  savedProviderSessions: [],
730
834
  sessionReads: {},
731
- sessionReadMarkers: {}
835
+ sessionReadMarkers: {},
836
+ sessionNotificationDismissals: {},
837
+ sessionNotificationUnreadOverrides: {}
732
838
  };
733
839
  }
734
840
  });
@@ -4697,7 +4803,6 @@ var init_extension_provider_instance = __esm({
4697
4803
  }
4698
4804
  pushEvent(event) {
4699
4805
  this.events.push(event);
4700
- if (this.events.length > 50) this.events = this.events.slice(-50);
4701
4806
  }
4702
4807
  applyProviderResponse(data, options) {
4703
4808
  if (!data || typeof data !== "object") return;
@@ -4773,7 +4878,6 @@ var init_extension_provider_instance = __esm({
4773
4878
  key: dedupKey,
4774
4879
  message: normalizedMessage
4775
4880
  });
4776
- if (this.runtimeMessages.length > 50) this.runtimeMessages = this.runtimeMessages.slice(-50);
4777
4881
  if (normalizedContent) {
4778
4882
  this.historyWriter.appendNewMessages(
4779
4883
  this.type,
@@ -5450,7 +5554,6 @@ var init_ide_provider_instance = __esm({
5450
5554
  }
5451
5555
  pushEvent(event) {
5452
5556
  this.events.push(event);
5453
- if (this.events.length > 50) this.events = this.events.slice(-50);
5454
5557
  }
5455
5558
  applyProviderResponse(data, options) {
5456
5559
  if (!data || typeof data !== "object") return;
@@ -5540,7 +5643,6 @@ var init_ide_provider_instance = __esm({
5540
5643
  key: dedupKey,
5541
5644
  message: normalizedMessage
5542
5645
  });
5543
- if (this.runtimeMessages.length > 50) this.runtimeMessages = this.runtimeMessages.slice(-50);
5544
5646
  if (normalizedContent) {
5545
5647
  this.historyWriter.appendNewMessages(
5546
5648
  this.type,
@@ -7167,7 +7269,14 @@ async function handleReadChat(h, args) {
7167
7269
  const adapter = getTargetedCliAdapter(h, args, provider?.type);
7168
7270
  if (adapter) {
7169
7271
  _log(`${transport} adapter: ${adapter.cliType}`);
7170
- const parsedStatus = typeof adapter.getScriptParsedStatus === "function" ? parseMaybeJson(adapter.getScriptParsedStatus()) : null;
7272
+ let parsedStatus = null;
7273
+ if (typeof adapter.getScriptParsedStatus === "function") {
7274
+ try {
7275
+ parsedStatus = parseMaybeJson(adapter.getScriptParsedStatus());
7276
+ } catch (error48) {
7277
+ return { success: false, error: error48?.message || String(error48) };
7278
+ }
7279
+ }
7171
7280
  const parsedRecord = parsedStatus && typeof parsedStatus === "object" ? parsedStatus : null;
7172
7281
  const status = parsedRecord || adapter.getStatus();
7173
7282
  const title = typeof parsedRecord?.title === "string" ? parsedRecord.title : void 0;
@@ -11089,6 +11198,7 @@ var init_provider_cli_adapter = __esm({
11089
11198
  recentOutputBuffer = "";
11090
11199
  isWaitingForResponse = false;
11091
11200
  activeModal = null;
11201
+ parseErrorMessage = null;
11092
11202
  responseTimeout = null;
11093
11203
  idleTimeout = null;
11094
11204
  ready = false;
@@ -12083,10 +12193,12 @@ var init_provider_cli_adapter = __esm({
12083
12193
  // ─── Public API (CliAdapter) ───────────────────
12084
12194
  getStatus() {
12085
12195
  return {
12086
- status: this.currentStatus,
12196
+ status: this.parseErrorMessage ? "error" : this.currentStatus,
12087
12197
  messages: [...this.committedMessages],
12088
12198
  workingDir: this.workingDir,
12089
- activeModal: this.activeModal
12199
+ activeModal: this.activeModal,
12200
+ errorMessage: this.parseErrorMessage || void 0,
12201
+ errorReason: this.parseErrorMessage ? "parse_error" : void 0
12090
12202
  };
12091
12203
  }
12092
12204
  seedCommittedMessages(messages) {
@@ -12140,7 +12252,7 @@ var init_provider_cli_adapter = __esm({
12140
12252
  id: "cli_session",
12141
12253
  status: this.currentStatus,
12142
12254
  title: this.cliName,
12143
- messages: messages.slice(-50).map((message, index) => buildChatMessage({
12255
+ messages: messages.map((message, index) => buildChatMessage({
12144
12256
  ...message,
12145
12257
  id: message.id || `msg_${index}`,
12146
12258
  index: typeof message.index === "number" ? message.index : index,
@@ -12171,7 +12283,10 @@ var init_provider_cli_adapter = __esm({
12171
12283
  }));
12172
12284
  }
12173
12285
  parseCurrentTranscript(baseMessages, partialResponse, scope) {
12174
- if (!this.cliScripts?.parseOutput) return null;
12286
+ if (!this.cliScripts?.parseOutput) {
12287
+ this.parseErrorMessage = null;
12288
+ return null;
12289
+ }
12175
12290
  try {
12176
12291
  const input = buildCliParseInput({
12177
12292
  accumulatedBuffer: this.accumulatedBuffer,
@@ -12199,10 +12314,13 @@ var init_provider_cli_adapter = __esm({
12199
12314
  lastAssistant.content = trimPromptEchoPrefix(lastAssistant.content, promptForTrim);
12200
12315
  }
12201
12316
  }
12317
+ this.parseErrorMessage = null;
12202
12318
  return parsed;
12203
12319
  } catch (e) {
12204
- LOG.warn("CLI", `[${this.cliType}] parseOutput error: ${e.message}`);
12205
- return null;
12320
+ const message = e?.message || String(e);
12321
+ this.parseErrorMessage = message;
12322
+ LOG.warn("CLI", `[${this.cliType}] parseOutput error: ${message}`);
12323
+ throw e;
12206
12324
  }
12207
12325
  }
12208
12326
  /** Whether this adapter has CLI scripts loaded */
@@ -12876,6 +12994,8 @@ var init_cli_provider_instance = __esm({
12876
12994
  runtimeMessages = [];
12877
12995
  instanceId;
12878
12996
  suppressIdleHistoryReplay = false;
12997
+ errorMessage = void 0;
12998
+ errorReason = void 0;
12879
12999
  presentationMode;
12880
13000
  providerSessionId;
12881
13001
  launchMode;
@@ -12999,9 +13119,24 @@ var init_cli_provider_instance = __esm({
12999
13119
  }
13000
13120
  getState() {
13001
13121
  const adapterStatus = this.adapter.getStatus();
13002
- const parsedStatus = this.adapter.getScriptParsedStatus?.() || null;
13122
+ let parsedStatus = null;
13123
+ let parseErrorMessage;
13124
+ if (typeof this.adapter.getScriptParsedStatus === "function") {
13125
+ try {
13126
+ parsedStatus = this.adapter.getScriptParsedStatus() || null;
13127
+ this.errorMessage = void 0;
13128
+ this.errorReason = void 0;
13129
+ } catch (error48) {
13130
+ parseErrorMessage = error48?.message || String(error48);
13131
+ this.errorMessage = parseErrorMessage;
13132
+ this.errorReason = "parse_error";
13133
+ }
13134
+ } else {
13135
+ this.errorMessage = void 0;
13136
+ this.errorReason = void 0;
13137
+ }
13003
13138
  const autoApproveActive = adapterStatus.status === "waiting_approval" && this.shouldAutoApprove();
13004
- const visibleStatus = autoApproveActive ? "generating" : adapterStatus.status;
13139
+ const visibleStatus = parseErrorMessage ? "error" : autoApproveActive ? "generating" : adapterStatus.status;
13005
13140
  const parsedProviderSessionId = normalizeProviderSessionId(
13006
13141
  this.type,
13007
13142
  typeof parsedStatus?.providerSessionId === "string" ? parsedStatus.providerSessionId : ""
@@ -13011,7 +13146,7 @@ var init_cli_provider_instance = __esm({
13011
13146
  }
13012
13147
  const runtime = this.adapter.getRuntimeMetadata();
13013
13148
  this.maybeAppendRuntimeRecoveryMessage(runtime);
13014
- let parsedMessages = Array.isArray(parsedStatus?.messages) ? parsedStatus.messages : [];
13149
+ let parsedMessages = Array.isArray(parsedStatus?.messages) ? parsedStatus.messages : parseErrorMessage ? normalizeChatMessages(Array.isArray(adapterStatus.messages) ? adapterStatus.messages : []) : [];
13015
13150
  const historyMessageCount = Number.isFinite(parsedStatus?.historyMessageCount) ? Math.max(0, Number(parsedStatus.historyMessageCount)) : null;
13016
13151
  if (historyMessageCount !== null) {
13017
13152
  parsedMessages = historyMessageCount > 0 ? parsedMessages.slice(-historyMessageCount) : [];
@@ -13051,7 +13186,7 @@ var init_cli_provider_instance = __esm({
13051
13186
  activeChat: {
13052
13187
  id: `${this.type}_${this.workingDir}`,
13053
13188
  title: parsedStatus?.title || dirName,
13054
- status: autoApproveActive && parsedStatus?.status === "waiting_approval" ? "generating" : parsedStatus?.status || visibleStatus,
13189
+ status: parseErrorMessage ? "error" : autoApproveActive && parsedStatus?.status === "waiting_approval" ? "generating" : parsedStatus?.status || visibleStatus,
13055
13190
  messages: mergedMessages,
13056
13191
  activeModal: autoApproveActive ? null : parsedStatus?.activeModal ?? adapterStatus.activeModal,
13057
13192
  inputContent: ""
@@ -13077,7 +13212,9 @@ var init_cli_provider_instance = __esm({
13077
13212
  resume: this.provider.resume,
13078
13213
  controlValues: surface.controlValues,
13079
13214
  providerControls: this.provider.controls,
13080
- summaryMetadata: surface.summaryMetadata
13215
+ summaryMetadata: surface.summaryMetadata,
13216
+ errorMessage: this.errorMessage,
13217
+ errorReason: this.errorReason
13081
13218
  };
13082
13219
  }
13083
13220
  setPresentationMode(mode) {
@@ -13264,7 +13401,6 @@ var init_cli_provider_instance = __esm({
13264
13401
  }
13265
13402
  pushEvent(event) {
13266
13403
  this.events.push(event);
13267
- if (this.events.length > 50) this.events = this.events.slice(-50);
13268
13404
  }
13269
13405
  flushEvents() {
13270
13406
  const events = [...this.events];
@@ -13446,9 +13582,6 @@ ${effect.notification.body || ""}`.trim();
13446
13582
  key: dedupKey,
13447
13583
  message: normalizedMessage
13448
13584
  });
13449
- if (this.runtimeMessages.length > 50) {
13450
- this.runtimeMessages = this.runtimeMessages.slice(-50);
13451
- }
13452
13585
  if (normalizedContent) {
13453
13586
  this.historyWriter.appendNewMessages(
13454
13587
  this.type,
@@ -30007,8 +30140,8 @@ var init_acp_provider_instance = __esm({
30007
30140
  }
30008
30141
  getState() {
30009
30142
  const dirName = this.workingDir.split("/").filter(Boolean).pop() || "session";
30010
- const recentMessages = normalizeChatMessages(this.messages.slice(-50).map((m) => {
30011
- const content = this.truncateContent(m.content);
30143
+ const recentMessages = normalizeChatMessages(this.messages.map((m) => {
30144
+ const content = m.content;
30012
30145
  return buildChatMessage({
30013
30146
  ...m,
30014
30147
  content
@@ -30801,18 +30934,6 @@ var init_acp_provider_instance = __esm({
30801
30934
  }
30802
30935
  }
30803
30936
  // ─── Rich Content Helpers ────────────────────────────
30804
- /** Truncate content for transport (text: 2000 chars, images preserved) */
30805
- truncateContent(content) {
30806
- if (typeof content === "string") {
30807
- return content.length > 2e3 ? content.slice(0, 2e3) + "\n... (truncated)" : content;
30808
- }
30809
- return content.map((b) => {
30810
- if (b.type === "text" && b.text.length > 2e3) {
30811
- return { ...b, text: b.text.slice(0, 2e3) + "\n... (truncated)" };
30812
- }
30813
- return b;
30814
- });
30815
- }
30816
30937
  /** Build ContentBlock[] from current partial state */
30817
30938
  buildPartialBlocks() {
30818
30939
  const blocks = [];
@@ -30966,7 +31087,6 @@ ${rawInput}` : rawInput;
30966
31087
  }
30967
31088
  pushEvent(event) {
30968
31089
  this.events.push(event);
30969
- if (this.events.length > 50) this.events = this.events.slice(-50);
30970
31090
  }
30971
31091
  appendSystemMessage(content, timestamp = Date.now()) {
30972
31092
  const normalizedContent = String(content || "").trim();
@@ -35482,7 +35602,9 @@ var init_command_log = __esm({
35482
35602
  "heartbeat",
35483
35603
  "status_report",
35484
35604
  "read_chat",
35485
- "mark_session_seen"
35605
+ "mark_session_seen",
35606
+ "delete_notification",
35607
+ "mark_notification_unread"
35486
35608
  ]);
35487
35609
  cleanOldFiles();
35488
35610
  }
@@ -35702,9 +35824,22 @@ function buildStatusSnapshot(options) {
35702
35824
  completionMarker,
35703
35825
  seenCompletionMarker
35704
35826
  );
35827
+ const { unread: overlayUnread, inboxBucket: overlayInboxBucket } = applySessionNotificationOverlay({
35828
+ id: sourceSession.id,
35829
+ providerSessionId: sourceSession.providerSessionId,
35830
+ status: sourceSession.status,
35831
+ unread,
35832
+ inboxBucket,
35833
+ lastMessageHash: sourceSession.lastMessageHash,
35834
+ lastMessageAt: sourceSession.lastMessageAt,
35835
+ lastUpdated: sourceSession.lastUpdated
35836
+ }, {
35837
+ dismissedNotificationId: getSessionNotificationDismissal(state, sourceSession.id, sourceSession.providerSessionId),
35838
+ unreadNotificationId: getSessionNotificationUnreadOverride(state, sourceSession.id, sourceSession.providerSessionId)
35839
+ });
35705
35840
  session.lastSeenAt = lastSeenAt;
35706
- session.unread = unread;
35707
- session.inboxBucket = inboxBucket;
35841
+ session.unread = overlayUnread;
35842
+ session.inboxBucket = overlayInboxBucket;
35708
35843
  if (READ_DEBUG_ENABLED && (session.unread || session.inboxBucket !== "idle" || session.providerType.includes("codex"))) {
35709
35844
  const recentReadSnapshot = {
35710
35845
  sessionId: session.id,
@@ -35769,6 +35904,7 @@ var init_snapshot = __esm({
35769
35904
  init_terminal_screen();
35770
35905
  init_logger();
35771
35906
  init_builders();
35907
+ init_recent_activity();
35772
35908
  READ_DEBUG_ENABLED = process.argv.includes("--dev") || process.env.ADHDEV_READ_DEBUG === "1";
35773
35909
  recentReadDebugSignatureBySession = /* @__PURE__ */ new Map();
35774
35910
  }
@@ -36568,6 +36704,62 @@ var init_router = __esm({
36568
36704
  completionMarker
36569
36705
  };
36570
36706
  }
36707
+ case "delete_notification": {
36708
+ const sessionId = args?.sessionId;
36709
+ const notificationId = typeof args?.notificationId === "string" ? args.notificationId.trim() : "";
36710
+ if (!sessionId || typeof sessionId !== "string") {
36711
+ return { success: false, error: "sessionId is required" };
36712
+ }
36713
+ if (!notificationId) {
36714
+ return { success: false, error: "notificationId is required" };
36715
+ }
36716
+ const sessionEntries = buildSessionEntries(
36717
+ this.deps.instanceManager.collectAllStates(),
36718
+ this.deps.cdpManagers
36719
+ );
36720
+ const targetSession = sessionEntries.find((entry) => entry.id === sessionId);
36721
+ const next = dismissSessionNotification(
36722
+ loadState(),
36723
+ sessionId,
36724
+ notificationId,
36725
+ targetSession?.providerSessionId
36726
+ );
36727
+ saveState(next);
36728
+ this.deps.onStatusChange?.();
36729
+ return {
36730
+ success: true,
36731
+ sessionId,
36732
+ notificationId
36733
+ };
36734
+ }
36735
+ case "mark_notification_unread": {
36736
+ const sessionId = args?.sessionId;
36737
+ const notificationId = typeof args?.notificationId === "string" ? args.notificationId.trim() : "";
36738
+ if (!sessionId || typeof sessionId !== "string") {
36739
+ return { success: false, error: "sessionId is required" };
36740
+ }
36741
+ if (!notificationId) {
36742
+ return { success: false, error: "notificationId is required" };
36743
+ }
36744
+ const sessionEntries = buildSessionEntries(
36745
+ this.deps.instanceManager.collectAllStates(),
36746
+ this.deps.cdpManagers
36747
+ );
36748
+ const targetSession = sessionEntries.find((entry) => entry.id === sessionId);
36749
+ const next = markSessionNotificationUnread(
36750
+ loadState(),
36751
+ sessionId,
36752
+ notificationId,
36753
+ targetSession?.providerSessionId
36754
+ );
36755
+ saveState(next);
36756
+ this.deps.onStatusChange?.();
36757
+ return {
36758
+ success: true,
36759
+ sessionId,
36760
+ notificationId
36761
+ };
36762
+ }
36571
36763
  // ─── Daemon Self-Upgrade ───
36572
36764
  case "daemon_upgrade": {
36573
36765
  LOG.info("Upgrade", "Remote upgrade requested from dashboard");
@@ -54163,7 +54355,7 @@ var init_adhdev_daemon = __esm({
54163
54355
  init_source2();
54164
54356
  init_version();
54165
54357
  init_src();
54166
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.81" });
54358
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.82" });
54167
54359
  AdhdevDaemon = class _AdhdevDaemon {
54168
54360
  localHttpServer = null;
54169
54361
  localWss = null;