@adhdev/daemon-standalone 0.9.82-rc.296 → 0.9.82-rc.298

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/public/index.html CHANGED
@@ -7,9 +7,9 @@
7
7
  <meta name="description" content="ADHDev self-hosted dashboard for controlling AI agents" />
8
8
  <link rel="icon" href="/otter-logo.png" />
9
9
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet" />
10
- <script type="module" crossorigin src="/assets/index-BTGrWIYY.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-BjBqMRjO.js"></script>
11
11
  <link rel="modulepreload" crossorigin href="/assets/vendor-BHUMCOj6.js">
12
- <link rel="stylesheet" crossorigin href="/assets/index-C6CBDz4G.css">
12
+ <link rel="stylesheet" crossorigin href="/assets/index-D5P43B4N.css">
13
13
  </head>
14
14
  <body>
15
15
  <!-- Apply theme immediately to prevent FOIT (Flash of Incorrect Theme) -->
@@ -274,6 +274,22 @@ function buildCompactMessageTail(visibleMessages, opts) {
274
274
  }
275
275
  return tail;
276
276
  }
277
+ function normalizeForSummaryEquality(value) {
278
+ return value.replace(/\s+/g, " ").trim();
279
+ }
280
+ function dedupeSummaryFromTail(messages, summary) {
281
+ const normalizedSummary = summary ? normalizeForSummaryEquality(summary) : "";
282
+ if (!normalizedSummary) return messages;
283
+ return messages.map((message) => {
284
+ const role = String(message?.role ?? "").toLowerCase();
285
+ if (role !== "assistant" && role !== "agent") return message;
286
+ const content = messageContent(message);
287
+ if (!content.trim()) return message;
288
+ if (normalizeForSummaryEquality(content) !== normalizedSummary) return message;
289
+ const { content: _omitted, ...rest } = message;
290
+ return { ...rest, content: "", _sameAsSummary: true };
291
+ });
292
+ }
277
293
  function compactChatPayload(payload, opts = {}) {
278
294
  const rawMessages = Array.isArray(payload?.messages) ? payload.messages : [];
279
295
  const visible = rawMessages.filter(isCoordinatorVisibleMessage);
@@ -283,7 +299,10 @@ function compactChatPayload(payload, opts = {}) {
283
299
  return (role === "assistant" || role === "agent") && messageContent(message).trim();
284
300
  });
285
301
  const summary = typeof payload?.summary === "string" && payload.summary.trim() ? payload.summary.trim() : messageContent(finalAssistant).trim();
286
- const messages = buildCompactMessageTail(visible, { summary, finalAssistant, limit });
302
+ const messages = dedupeSummaryFromTail(
303
+ buildCompactMessageTail(visible, { summary, finalAssistant, limit }),
304
+ summary
305
+ );
287
306
  const toolSummaries = rawMessages.filter((m) => !isCoordinatorVisibleMessage(m)).map(summarizeToolMessage).filter((s) => s !== null);
288
307
  const omittedMessages = Math.max(0, rawMessages.length - messages.length);
289
308
  const filteredMessages = Math.max(0, rawMessages.length - visible.length);
@@ -787,6 +806,7 @@ function buildCompactQueueMaintenanceReport(maintenance) {
787
806
  var COMPACT_MAX_ACTIVE_QUEUE_ROWS = 15;
788
807
  var COMPACT_QUEUE_MESSAGE_CAP = 140;
789
808
  var COMPACT_MAX_ACTIVE_WORK_ROWS = 12;
809
+ var COMPACT_ACTIVE_WORK_TITLE_CAP = 80;
790
810
  function truncateForCompact(value, cap) {
791
811
  if (typeof value !== "string") return value;
792
812
  return value.length > cap ? value.slice(0, cap) + "\u2026" : value;
@@ -808,9 +828,8 @@ function compactActiveWorkRecord(record) {
808
828
  if (!record || typeof record !== "object") return record;
809
829
  const slim = {};
810
830
  for (const [k, v] of Object.entries(record)) {
811
- if (k === "message") slim[k] = truncateForCompact(v, COMPACT_QUEUE_MESSAGE_CAP);
812
- else if (k === "taskSummary") slim[k] = truncateForCompact(v, COMPACT_QUEUE_MESSAGE_CAP);
813
- else if (k === "taskTitle") slim[k] = truncateForCompact(v, COMPACT_QUEUE_MESSAGE_CAP);
831
+ if (k === "message" || k === "taskSummary") continue;
832
+ else if (k === "taskTitle") slim[k] = truncateForCompact(v, COMPACT_ACTIVE_WORK_TITLE_CAP);
814
833
  else slim[k] = elideLargeNestedValue(k, v);
815
834
  }
816
835
  return slim;
@@ -2780,6 +2799,7 @@ async function meshStatus(ctx, args = {}) {
2780
2799
  note: activeWorkEvidence.staleDirectWorkNote,
2781
2800
  detailHint: "Full stale direct entries are omitted from mesh_status by default. Call mesh_status with includeStaleDirectWorkDetails=true or inspect mesh_task_history for ledger detail."
2782
2801
  });
2802
+ const activeWorkForResponse = compact ? compactActiveWorkRecords(activeWorkEvidence.activeWork) : { records: activeWorkEvidence.activeWork, omitted: 0 };
2783
2803
  const coordinatorSessions = [];
2784
2804
  for (const nodeEntry of results) {
2785
2805
  const sessions = Array.isArray(nodeEntry.sessions) ? nodeEntry.sessions : [];
@@ -2937,7 +2957,9 @@ async function meshStatus(ctx, args = {}) {
2937
2957
  ...webOnlyStaleBuilds.length > 0 ? {
2938
2958
  webOnlyStaleBuildNote: 'One or more live daemons are behind workspace HEAD, but only web packages changed in that range. The daemon does NOT need a rebuild/restart \u2014 redeploy the web app to reflect those changes. This is informational, not a "fix not live" condition.'
2939
2959
  } : {},
2940
- activeWork: activeWorkEvidence.activeWork,
2960
+ activeWork: activeWorkForResponse.records,
2961
+ ...compact && activeWorkForResponse.omitted > 0 ? { activeWorkRowsOmitted: activeWorkForResponse.omitted } : {},
2962
+ ...compact ? { activeWorkHint: `Compact activeWork rows carry a short taskTitle + dispatch scalars only; full task prompt/summary text is omitted \u2014 use mesh_task_history or mesh_status verbose=true. First ${COMPACT_MAX_ACTIVE_WORK_ROWS} rows serialized.` } : {},
2941
2963
  staleDirectWorkSummary,
2942
2964
  ...args.includeStaleDirectWorkDetails === true ? { staleDirectWork: activeWorkEvidence.staleDirectWork } : {},
2943
2965
  // terminalDirectWork is historical (completed/failed direct dispatches) — opt-in only.
@@ -4522,7 +4544,9 @@ function formatChatResult(result, sessionId, format, limit = 50, compact = false
4522
4544
  role: m.role,
4523
4545
  kind: m.kind ?? null,
4524
4546
  content: messageContent(m),
4525
- timestamp: m.timestamp ?? null
4547
+ timestamp: m.timestamp ?? null,
4548
+ // Preserve the dedup flag so consumers know the body lives in `summary`.
4549
+ ...m._sameAsSummary === true ? { _sameAsSummary: true } : {}
4526
4550
  }))
4527
4551
  }, null, 2);
4528
4552
  }