@supyagent/sdk 0.1.9 → 0.1.11

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/react.js CHANGED
@@ -1768,7 +1768,16 @@ function ResendFormatter({ data }) {
1768
1768
  import { Bell as Bell2, Calendar as Calendar3, Mail as Mail4, MessageSquare as MessageSquare3 } from "lucide-react";
1769
1769
  import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
1770
1770
  function isInboxEvent(data) {
1771
- return typeof data === "object" && data !== null && ("title" in data || "type" in data || "description" in data);
1771
+ if (typeof data !== "object" || data === null) return false;
1772
+ if ("event_type" in data || "summary" in data) return true;
1773
+ if ("title" in data || "type" in data && "source" in data) return true;
1774
+ return false;
1775
+ }
1776
+ function resolveEventType(event) {
1777
+ if (event.event_type) {
1778
+ return event.event_type.split(".")[0];
1779
+ }
1780
+ return event.type;
1772
1781
  }
1773
1782
  function getEventIcon(type) {
1774
1783
  switch (type) {
@@ -1798,21 +1807,27 @@ function formatTimestamp2(dateStr) {
1798
1807
  }
1799
1808
  }
1800
1809
  function EventCard2({ event }) {
1801
- const Icon = getEventIcon(event.type);
1802
- const timestamp = event.timestamp || event.created_at;
1810
+ const eventType = resolveEventType(event);
1811
+ const Icon = getEventIcon(eventType);
1812
+ const timestamp = event.received_at || event.timestamp || event.created_at;
1813
+ const title = event.summary || event.title;
1814
+ const source = event.provider || event.source;
1815
+ const snippet = event.description || event.payload?.snippet || event.payload?.text;
1816
+ const isUnread = event.status === "unread" || event.read === false;
1803
1817
  return /* @__PURE__ */ jsxs17("div", { className: "rounded-lg border border-border bg-card p-3 space-y-1.5", children: [
1804
1818
  /* @__PURE__ */ jsxs17("div", { className: "flex items-start gap-2", children: [
1805
1819
  /* @__PURE__ */ jsx18(Icon, { className: "h-4 w-4 text-muted-foreground mt-0.5 shrink-0" }),
1806
1820
  /* @__PURE__ */ jsxs17("div", { className: "min-w-0 flex-1", children: [
1807
1821
  /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
1808
- event.type && /* @__PURE__ */ jsx18("span", { className: "rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground capitalize", children: event.type }),
1809
- event.source && /* @__PURE__ */ jsx18("span", { className: "text-xs text-muted-foreground", children: event.source }),
1822
+ eventType && /* @__PURE__ */ jsx18("span", { className: "rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground capitalize", children: eventType }),
1823
+ source && /* @__PURE__ */ jsx18("span", { className: "text-xs text-muted-foreground capitalize", children: source }),
1824
+ isUnread && /* @__PURE__ */ jsx18("span", { className: "h-1.5 w-1.5 rounded-full bg-primary shrink-0" }),
1810
1825
  timestamp && /* @__PURE__ */ jsx18("span", { className: "text-xs text-muted-foreground ml-auto shrink-0", children: formatTimestamp2(timestamp) })
1811
1826
  ] }),
1812
- event.title && /* @__PURE__ */ jsx18("p", { className: "text-sm font-medium text-foreground mt-1", children: event.title })
1827
+ title && /* @__PURE__ */ jsx18("p", { className: "text-sm font-medium text-foreground mt-1 line-clamp-1", children: title })
1813
1828
  ] })
1814
1829
  ] }),
1815
- event.description && /* @__PURE__ */ jsx18("p", { className: "text-xs text-muted-foreground line-clamp-2 pl-6", children: event.description })
1830
+ snippet && /* @__PURE__ */ jsx18("p", { className: "text-xs text-muted-foreground line-clamp-2 pl-6", children: snippet })
1816
1831
  ] });
1817
1832
  }
1818
1833
  function InboxFormatter({ data }) {
@@ -3053,9 +3068,9 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
3053
3068
  const provider = getProviderFromToolName(toolName);
3054
3069
  const providerLabel = getProviderLabel(provider);
3055
3070
  const actionLabel = humanizeToolName(toolName);
3056
- const isStreaming = state === "input-streaming";
3057
- const isError = state === "output-error";
3058
- const isDone = state === "output-available";
3071
+ const isStreaming = state === "input-streaming" || state === "partial-call" || state === "call";
3072
+ const isError = state === "output-error" || state === "error";
3073
+ const isDone = state === "output-available" || state === "result";
3059
3074
  const hasResult = isDone || isError;
3060
3075
  let summary;
3061
3076
  let formatterOutput;
@@ -3068,7 +3083,8 @@ function SupyagentToolAction({ part, defaultExpanded = false }) {
3068
3083
  formatterOutput = renderFormatter(formatterType, data);
3069
3084
  }
3070
3085
  }
3071
- const hasExpandableContent = args || formatterOutput;
3086
+ const hasArgs = args && Object.keys(args).length > 0;
3087
+ const hasExpandableContent = hasArgs || formatterOutput;
3072
3088
  const canExpand = !isStreaming && hasExpandableContent;
3073
3089
  return /* @__PURE__ */ jsxs30(
3074
3090
  "div",