@tutti-os/agent-gui 0.0.25 → 0.0.27

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.
@@ -6,7 +6,7 @@ import {
6
6
  projectAgentConversationVM,
7
7
  reconcileProjectedAgentConversationVM,
8
8
  useProjectedAgentConversation
9
- } from "../chunk-3QDLVPMJ.js";
9
+ } from "../chunk-MLHARLOS.js";
10
10
  import "../chunk-VNRRXUI3.js";
11
11
  import "../chunk-XAQQN6MP.js";
12
12
  import "../chunk-XJ34OIEQ.js";
@@ -4094,7 +4094,9 @@ function projectAgentConversationVM(detail, options = {}) {
4094
4094
  rows.push(processing);
4095
4095
  }
4096
4096
  const normalizedRows = projectMessageCopyText(
4097
- mergeAdjacentAssistantMessageRows(rows),
4097
+ mergeAdjacentAssistantMessageRows(
4098
+ mergeAdjacentTransportRetryNoticeRows(rows)
4099
+ ),
4098
4100
  {
4099
4101
  assistantCopyEligibleTurnIds: buildAssistantCopyEligibleTurnIds(detail)
4100
4102
  }
@@ -4220,6 +4222,51 @@ function mergeAdjacentAssistantMessageRows(rows) {
4220
4222
  }
4221
4223
  return merged;
4222
4224
  }
4225
+ function mergeAdjacentTransportRetryNoticeRows(rows) {
4226
+ const merged = [];
4227
+ for (const row of rows) {
4228
+ const previous = merged.at(-1);
4229
+ if (isSingleTransportRetryNoticeRow(previous) && isSingleTransportRetryNoticeRow(row) && previous.turnId === row.turnId) {
4230
+ const previousMessage = previous.messages[0];
4231
+ const nextMessage = row.messages[0];
4232
+ if (!previousMessage || !nextMessage) {
4233
+ merged.push(row);
4234
+ continue;
4235
+ }
4236
+ const sourceTimelineItems = mergeSourceTimelineItems2(
4237
+ previousMessage.sourceTimelineItems,
4238
+ nextMessage.sourceTimelineItems
4239
+ );
4240
+ previous.messages[0] = {
4241
+ ...previousMessage,
4242
+ body: nextMessage.body || previousMessage.body,
4243
+ systemNotice: nextMessage.systemNotice ?? previousMessage.systemNotice,
4244
+ statusKind: nextMessage.statusKind ?? previousMessage.statusKind ?? null,
4245
+ occurredAtUnixMs: nextMessage.occurredAtUnixMs ?? previousMessage.occurredAtUnixMs,
4246
+ ...sourceTimelineItems ? { sourceTimelineItems } : {}
4247
+ };
4248
+ previous.occurredAtUnixMs = row.occurredAtUnixMs ?? previous.occurredAtUnixMs;
4249
+ continue;
4250
+ }
4251
+ merged.push(row);
4252
+ }
4253
+ return merged;
4254
+ }
4255
+ function isSingleTransportRetryNoticeRow(row) {
4256
+ if (!row || row.kind !== "message" || row.speaker !== "assistant" || row.thinking.length > 0 || row.messages.length !== 1) {
4257
+ return false;
4258
+ }
4259
+ return row.messages[0]?.systemNotice?.noticeKind === "transport_retry";
4260
+ }
4261
+ function mergeSourceTimelineItems2(previous, next) {
4262
+ if (!previous || previous.length === 0) {
4263
+ return next;
4264
+ }
4265
+ if (!next || next.length === 0) {
4266
+ return previous;
4267
+ }
4268
+ return [...previous, ...next];
4269
+ }
4223
4270
  function projectMessageCopyText(rows, options) {
4224
4271
  const assistantCopyTargetKeys = findLatestAssistantCopyTargetKeys(
4225
4272
  rows,
@@ -6311,6 +6358,7 @@ var CanvasNodeGhostIconButton = forwardRef3(function CanvasNodeGhostIconButton2(
6311
6358
  import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
6312
6359
  var MESSAGE_COPY_FEEDBACK_MS = 1400;
6313
6360
  var CONTEXT_COMPACTION_NOTICE_TITLE = "Context compacted.";
6361
+ var TRANSPORT_RETRY_PROGRESS_PATTERN = /\b(reconnect(?:ing)?(?:\s*(?:\.\.\.|…|[.。]+|:|-))?\s*\(?\d+\s*\/\s*\d+\)?)/i;
6314
6362
  function AgentMessageBlock({
6315
6363
  workspaceRoot,
6316
6364
  basePath,
@@ -6655,6 +6703,17 @@ function AgentSystemNoticeMessage({
6655
6703
  const notice = message.systemNotice;
6656
6704
  const detail = notice?.detail?.trim() ?? "";
6657
6705
  const title = systemNoticeTitle(message);
6706
+ if (notice?.noticeKind === "transport_retry") {
6707
+ const retryText = transportRetryNoticeText(message);
6708
+ return /* @__PURE__ */ jsx12(
6709
+ "div",
6710
+ {
6711
+ role: "status",
6712
+ className: "box-border w-full min-w-0 py-1 text-[13px] leading-5 text-[var(--text-primary)]",
6713
+ children: retryText
6714
+ }
6715
+ );
6716
+ }
6658
6717
  if (isContextCompactionNotice(message, title)) {
6659
6718
  return /* @__PURE__ */ jsxs7(
6660
6719
  "div",
@@ -6694,6 +6753,19 @@ function AgentSystemNoticeMessage({
6694
6753
  }
6695
6754
  );
6696
6755
  }
6756
+ function transportRetryNoticeText(message) {
6757
+ const notice = message.systemNotice;
6758
+ const detail = notice?.detail?.trim() ?? "";
6759
+ const progressText = transportRetryProgressText(detail) ?? transportRetryProgressText(notice?.title ?? "") ?? transportRetryProgressText(message.body);
6760
+ if (progressText) {
6761
+ return progressText;
6762
+ }
6763
+ return notice?.title?.trim() || message.body.trim() || translate("agentHost.agentGui.systemNoticeTransportRetry");
6764
+ }
6765
+ function transportRetryProgressText(value) {
6766
+ const match = TRANSPORT_RETRY_PROGRESS_PATTERN.exec(value.trim());
6767
+ return match?.[1]?.replace(/\s+/g, " ").trim() || null;
6768
+ }
6697
6769
  function isContextCompactionNotice(message, title) {
6698
6770
  const notice = message.systemNotice;
6699
6771
  return notice?.noticeKind === "system_notice" && (notice.detail?.trim() ?? "") === "" && title.trim() === CONTEXT_COMPACTION_NOTICE_TITLE;
@@ -12314,4 +12386,4 @@ export {
12314
12386
  AgentConversationFlow,
12315
12387
  useProjectedAgentConversation
12316
12388
  };
12317
- //# sourceMappingURL=chunk-3QDLVPMJ.js.map
12389
+ //# sourceMappingURL=chunk-MLHARLOS.js.map