@athenaintel/react 0.9.2 → 0.9.4

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.d.ts CHANGED
@@ -632,7 +632,7 @@ export declare const TOOL_UI_REGISTRY: Record<string, ToolCallMessagePartCompone
632
632
 
633
633
  export { ToolCallMessagePartComponent }
634
634
 
635
- export declare function ToolCard({ icon: Icon, status, title, subtitle, toolName, badge, error, children, }: {
635
+ export declare function ToolCard({ icon: Icon, status, title, subtitle, toolName, badge, error, children, args, result, }: {
636
636
  icon: React.ElementType;
637
637
  status: ToolStatus;
638
638
  title: string;
@@ -641,6 +641,8 @@ export declare function ToolCard({ icon: Icon, status, title, subtitle, toolName
641
641
  badge?: string;
642
642
  error?: string | null;
643
643
  children?: React.ReactNode;
644
+ args?: Record<string, unknown>;
645
+ result?: unknown;
644
646
  }): JSX.Element;
645
647
 
646
648
  export declare const ToolFallback: ToolCallMessagePartComponent & {
package/dist/index.js CHANGED
@@ -20669,7 +20669,11 @@ async function listThreads(backendUrl, auth, opts = {}) {
20669
20669
  const res = await fetch(`${base2}/api/conversations/threads/list`, {
20670
20670
  method: "POST",
20671
20671
  headers: { "Content-Type": "application/json", ...getAuthHeaders(auth) },
20672
- body: JSON.stringify({ limit: opts.limit ?? 50, offset: opts.offset ?? 0 })
20672
+ body: JSON.stringify({
20673
+ limit: opts.limit ?? 50,
20674
+ offset: opts.offset ?? 0,
20675
+ exclude_triggered: opts.exclude_triggered ?? true
20676
+ })
20673
20677
  });
20674
20678
  if (!res.ok) {
20675
20679
  throw new Error(`[AthenaSDK] Failed to list threads: ${res.status}`);
@@ -62467,7 +62471,9 @@ function ToolCard({
62467
62471
  toolName,
62468
62472
  badge,
62469
62473
  error: error2,
62470
- children
62474
+ children,
62475
+ args,
62476
+ result
62471
62477
  }) {
62472
62478
  const isRunning = status === "running";
62473
62479
  const isComplete = status === "complete";
@@ -62501,9 +62507,46 @@ function ToolCard({
62501
62507
  ] })
62502
62508
  ] }),
62503
62509
  error2 && /* @__PURE__ */ jsx("div", { className: "border-t border-border/40 bg-destructive/10 px-4 py-2.5", children: /* @__PURE__ */ jsx("p", { className: "text-[12px] leading-relaxed text-destructive", children: error2 }) }),
62504
- children
62510
+ children,
62511
+ toolName && isComplete && /* @__PURE__ */ jsx(CopyToolSpecButton, { toolName, args, result })
62505
62512
  ] });
62506
62513
  }
62514
+ function CopyToolSpecButton({
62515
+ toolName,
62516
+ args,
62517
+ result
62518
+ }) {
62519
+ const [copied, setCopied] = useState(false);
62520
+ const handleCopy = useCallback(() => {
62521
+ const spec = { tool_name: toolName };
62522
+ if (args) spec.arguments = args;
62523
+ if (result !== void 0) {
62524
+ if (typeof result === "string") {
62525
+ const parsed = tryParseJson(result);
62526
+ spec.result = parsed ?? result;
62527
+ } else {
62528
+ spec.result = result;
62529
+ }
62530
+ }
62531
+ navigator.clipboard.writeText(JSON.stringify(spec, null, 2)).then(() => {
62532
+ setCopied(true);
62533
+ setTimeout(() => setCopied(false), 2e3);
62534
+ });
62535
+ }, [toolName, args, result]);
62536
+ return /* @__PURE__ */ jsx("div", { className: "flex justify-end px-3 pb-1.5", children: /* @__PURE__ */ jsxs(
62537
+ "button",
62538
+ {
62539
+ type: "button",
62540
+ onClick: handleCopy,
62541
+ className: "flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-muted-foreground/40 transition-colors hover:bg-muted/50 hover:text-muted-foreground",
62542
+ title: "Copy tool name, arguments, and result as JSON",
62543
+ children: [
62544
+ /* @__PURE__ */ jsx(ClipboardCopy, { className: "size-2.5" }),
62545
+ copied ? "Copied!" : toolName
62546
+ ]
62547
+ }
62548
+ ) });
62549
+ }
62507
62550
  function ExpandableSection({
62508
62551
  label,
62509
62552
  children,
@@ -62567,6 +62610,8 @@ const WebSearchToolUIImpl = ({
62567
62610
  title: isRunning ? "Searching the web..." : "Web search",
62568
62611
  subtitle: query ? truncate(query, 80) : void 0,
62569
62612
  toolName,
62613
+ args: typedArgs,
62614
+ result,
62570
62615
  badge: isComplete && results.length > 0 ? `${results.length} results` : void 0,
62571
62616
  error: errorMsg,
62572
62617
  children: isComplete && results.length > 0 && /* @__PURE__ */ jsx(ExpandableSection, { label: "Show search results", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2.5", children: results.map((r2, i) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
@@ -62624,6 +62669,8 @@ const BrowseToolUIImpl = ({
62624
62669
  title: isRunning ? "Browsing page..." : pageTitle ? truncate(pageTitle, 50) : "Browsed page",
62625
62670
  subtitle: displayUrl,
62626
62671
  toolName,
62672
+ args: typedArgs,
62673
+ result,
62627
62674
  error: errorMsg,
62628
62675
  children: isComplete && pageContent && /* @__PURE__ */ jsx(ExpandableSection, { label: "Show page content", children: /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap break-words text-[11px] leading-relaxed text-muted-foreground", children: truncate(pageContent, 3e3) }) })
62629
62676
  }
@@ -62667,6 +62714,8 @@ const EmailSearchToolUIImpl = ({
62667
62714
  title: isRunning ? "Searching emails..." : "Email search",
62668
62715
  subtitle: query ? truncate(query, 80) : void 0,
62669
62716
  toolName,
62717
+ args: typedArgs,
62718
+ result,
62670
62719
  badge: isComplete && emails.length > 0 ? `${emails.length} emails` : void 0,
62671
62720
  error: errorMsg,
62672
62721
  children: isComplete && emails.length > 0 && /* @__PURE__ */ jsx(ExpandableSection, { label: "Show email results", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col divide-y divide-border/30", children: emails.map((email, i) => /* @__PURE__ */ jsxs(
@@ -62749,6 +62798,8 @@ function CreateAssetToolUIImpl({
62749
62798
  title: isRunning ? runningLabel : doneLabel,
62750
62799
  subtitle: createdName || name || void 0,
62751
62800
  toolName,
62801
+ args: typedArgs,
62802
+ result,
62752
62803
  error: errorMsg,
62753
62804
  children: assetId && isComplete && !isCancelled && /* @__PURE__ */ jsx("div", { className: "border-t border-border/40 px-4 py-2", children: /* @__PURE__ */ jsxs(
62754
62805
  "button",
@@ -62826,6 +62877,8 @@ const CreateEmailDraftToolUIImpl = ({
62826
62877
  status: (status == null ? void 0 : status.type) ?? "complete",
62827
62878
  title: isRunning ? "Creating email draft..." : "Email draft created",
62828
62879
  toolName,
62880
+ args: typedArgs,
62881
+ result,
62829
62882
  subtitle: subject ? truncate(subject, 60) : to ? `To: ${truncate(to, 40)}` : void 0,
62830
62883
  error: errorMsg
62831
62884
  }
@@ -63194,6 +63247,8 @@ const RunPythonCodeToolUIImpl = ({
63194
63247
  status: (status == null ? void 0 : status.type) ?? "complete",
63195
63248
  title: isRunning ? "Running code..." : summary || `Executed ${lines} ${lines !== 1 ? "lines" : "line"}`,
63196
63249
  toolName,
63250
+ args: typedArgs,
63251
+ result,
63197
63252
  error: errorMsg,
63198
63253
  children: [
63199
63254
  code2 && /* @__PURE__ */ jsx(ExpandableSection, { label: "Show code", children: /* @__PURE__ */ jsx(SyntaxHighlightedCode, { code: code2 }) }),
@@ -63282,6 +63337,8 @@ const OpenAssetToolUIImpl = ({
63282
63337
  title: isRunning ? "Opening asset..." : "Asset opened",
63283
63338
  subtitle: assetId ? truncate(assetId, 30) : void 0,
63284
63339
  toolName,
63340
+ args: typedArgs,
63341
+ result,
63285
63342
  error: errorMsg,
63286
63343
  children: assetId && isComplete && !isCancelled && /* @__PURE__ */ jsx("div", { className: "border-t border-border/40 px-4 py-2", children: /* @__PURE__ */ jsxs(
63287
63344
  "button",