@athenaintel/react 0.57.1 → 0.57.2

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.
Files changed (31) hide show
  1. package/README.md +19 -0
  2. package/dist/chat/AthenaChat.cjs +47 -2
  3. package/dist/chat/AthenaChat.cjs.map +1 -1
  4. package/dist/chat/AthenaChat.js +47 -2
  5. package/dist/chat/AthenaChat.js.map +1 -1
  6. package/dist/provider/AthenaProvider.cjs +7 -0
  7. package/dist/provider/AthenaProvider.cjs.map +1 -1
  8. package/dist/provider/AthenaProvider.js +9 -2
  9. package/dist/provider/AthenaProvider.js.map +1 -1
  10. package/dist/react/package.json.cjs +1 -1
  11. package/dist/react/package.json.js +1 -1
  12. package/dist/runtime/statewire-run-config.cjs +15 -0
  13. package/dist/runtime/statewire-run-config.cjs.map +1 -1
  14. package/dist/runtime/statewire-run-config.d.ts +13 -0
  15. package/dist/runtime/statewire-run-config.js +15 -0
  16. package/dist/runtime/statewire-run-config.js.map +1 -1
  17. package/dist/threads/SessionList.cjs +22 -19
  18. package/dist/threads/SessionList.cjs.map +1 -1
  19. package/dist/threads/SessionList.js +22 -19
  20. package/dist/threads/SessionList.js.map +1 -1
  21. package/dist/threads/live-session-rows.cjs +207 -0
  22. package/dist/threads/live-session-rows.cjs.map +1 -0
  23. package/dist/threads/live-session-rows.d.ts +175 -0
  24. package/dist/threads/live-session-rows.js +207 -0
  25. package/dist/threads/live-session-rows.js.map +1 -0
  26. package/dist/threads/statewire-thread-list.cjs +173 -20
  27. package/dist/threads/statewire-thread-list.cjs.map +1 -1
  28. package/dist/threads/statewire-thread-list.d.ts +44 -1
  29. package/dist/threads/statewire-thread-list.js +174 -21
  30. package/dist/threads/statewire-thread-list.js.map +1 -1
  31. package/package.json +1 -1
@@ -12,6 +12,7 @@ import { WaitingOnYouBanner } from "./WaitingOnYouBanner.js";
12
12
  import { DrivingOnChip } from "./DrivingOnChip.js";
13
13
  import { OfflineSnapshotBanner } from "../offline/offline-history.js";
14
14
  import { WakeMarkerMessage } from "../chat-ui/messages/wake-marker.js";
15
+ import { RuntimeMessageCard } from "../chat-ui/messages/runtime-message.js";
15
16
  import { ToolFallback, ToolFallbackAppearanceProvider } from "../tools/tool-fallback.js";
16
17
  import { AppendDocumentToolUI } from "../tools/append-document-tool-ui.js";
17
18
  import { ReadAssetToolUI } from "../tools/read-asset-tool-ui.js";
@@ -82,6 +83,7 @@ import { isStatewireChannelLive } from "../runtime/statewire-lifecycle.js";
82
83
  import { useComposerChatVoice, ChatVoiceButton, ChatVoiceStatus, ChatVoiceContinueOffer } from "./chat-voice-controls.js";
83
84
  import { TASK_TOOL_NAME } from "../agent-runtime/src/tool-names.js";
84
85
  import { useTurnToolCallsAwaitingApproval } from "../agent-runtime/src/subagents.js";
86
+ import { readSoleRuntimeMessageKind, readRuntimeMessageFromSourceMessages } from "../agent-runtime/src/runtime-messages.js";
85
87
  import { isGithubWakeMessage } from "../agent-runtime/src/github-wake-event.js";
86
88
  import { isSubscriptionWakeMessage } from "../agent-runtime/src/subscription-wake-event.js";
87
89
  import { useDeepAgentConnection, readRunLive } from "../agent-runtime/src/thread-status.js";
@@ -1003,6 +1005,12 @@ const AthenaReasoningPart = ({
1003
1005
  };
1004
1006
  const noToolGrouping = () => null;
1005
1007
  const isInlineToolOrSubagent = (toolName) => toolName === TASK_TOOL_NAME || isSdkInlineTool(toolName);
1008
+ const AthenaRuntimeEndingCard = () => {
1009
+ const message = useAuiState((s) => s.message);
1010
+ const runtime = useMemo(() => readRuntimeMessageFromSourceMessages(message), [message]);
1011
+ if (!runtime || runtime.silent) return null;
1012
+ return /* @__PURE__ */ jsx(RuntimeMessageCard, { message: runtime });
1013
+ };
1006
1014
  const AthenaAssistantMessage = ({
1007
1015
  toolUIs,
1008
1016
  AvatarComponent,
@@ -1035,6 +1043,43 @@ const AthenaAssistantMessage = ({
1035
1043
  [EmptyComponent, TextComponent, effectiveReasoningComponent, toolUIsWithNestedMessages]
1036
1044
  );
1037
1045
  const arrivedLive = useMessageArrivalAnimation();
1046
+ const soleEndingKind = useAuiState((s) => readSoleRuntimeMessageKind(s.message));
1047
+ const endingSilent = useAuiState(
1048
+ (s) => {
1049
+ var _a;
1050
+ return ((_a = readRuntimeMessageFromSourceMessages(s.message)) == null ? void 0 : _a.silent) === true;
1051
+ }
1052
+ );
1053
+ const chunkedEndingText = useAuiState((s) => {
1054
+ const runtime = readRuntimeMessageFromSourceMessages(s.message);
1055
+ if (!runtime || runtime.isSoleSourceMessage || runtime.kind === "handoff") return void 0;
1056
+ const markerText = runtime.text;
1057
+ const last = s.message.content.at(-1);
1058
+ if (markerText === void 0 || (last == null ? void 0 : last.type) !== "text" || last.text !== markerText) return void 0;
1059
+ const sameText = s.message.content.filter((part) => part.type === "text" && part.text === markerText);
1060
+ return sameText.length === 1 ? markerText : void 0;
1061
+ });
1062
+ const AnswerTextComponent = useMemo(() => {
1063
+ if (chunkedEndingText === void 0) return TextComponent;
1064
+ const Base = TextComponent;
1065
+ return function TextOrRunEnding(props) {
1066
+ return props.text === chunkedEndingText ? /* @__PURE__ */ jsx(AthenaRuntimeEndingCard, {}) : /* @__PURE__ */ jsx(Base, { ...props });
1067
+ };
1068
+ }, [TextComponent, chunkedEndingText]);
1069
+ if (soleEndingKind !== void 0 && soleEndingKind !== "handoff") {
1070
+ if (endingSilent) return null;
1071
+ return /* @__PURE__ */ jsxs(
1072
+ MessagePrimitive.Root,
1073
+ {
1074
+ className: "aui-assistant-message-root aui-run-ending-root mx-auto w-full max-w-(--thread-max-width) px-2 py-1",
1075
+ "data-role": "assistant",
1076
+ children: [
1077
+ /* @__PURE__ */ jsx(MessageDaySeparator, {}),
1078
+ /* @__PURE__ */ jsx(AthenaRuntimeEndingCard, {})
1079
+ ]
1080
+ }
1081
+ );
1082
+ }
1038
1083
  return /* @__PURE__ */ jsxs(
1039
1084
  MessagePrimitive.Root,
1040
1085
  {
@@ -1069,7 +1114,7 @@ const AthenaAssistantMessage = ({
1069
1114
  renderRunningMeta: renderGroupedRunningMeta
1070
1115
  }
1071
1116
  ),
1072
- /* @__PURE__ */ jsx(SuperGroupingFinalText, { TextComponent })
1117
+ /* @__PURE__ */ jsx(SuperGroupingFinalText, { TextComponent: AnswerTextComponent })
1073
1118
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1074
1119
  /* @__PURE__ */ jsx(AthenaMessageEmptyIndicator, { EmptyComponent }),
1075
1120
  /* @__PURE__ */ jsx(MessagePrimitive.GroupedParts, { groupBy: noToolGrouping, children: ({ part }) => {
@@ -1089,7 +1134,7 @@ const AthenaAssistantMessage = ({
1089
1134
  if (textPart.text === "" && ((_a = textPart.status) == null ? void 0 : _a.type) === "running") {
1090
1135
  return /* @__PURE__ */ jsx(EmptyComponent, { status: textPart.status });
1091
1136
  }
1092
- return /* @__PURE__ */ jsx(TextComponent, { ...textPart });
1137
+ return /* @__PURE__ */ jsx(AnswerTextComponent, { ...textPart });
1093
1138
  }
1094
1139
  default:
1095
1140
  return null;