@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.cjs CHANGED
@@ -20687,7 +20687,11 @@ async function listThreads(backendUrl, auth, opts = {}) {
20687
20687
  const res = await fetch(`${base2}/api/conversations/threads/list`, {
20688
20688
  method: "POST",
20689
20689
  headers: { "Content-Type": "application/json", ...getAuthHeaders(auth) },
20690
- body: JSON.stringify({ limit: opts.limit ?? 50, offset: opts.offset ?? 0 })
20690
+ body: JSON.stringify({
20691
+ limit: opts.limit ?? 50,
20692
+ offset: opts.offset ?? 0,
20693
+ exclude_triggered: opts.exclude_triggered ?? true
20694
+ })
20691
20695
  });
20692
20696
  if (!res.ok) {
20693
20697
  throw new Error(`[AthenaSDK] Failed to list threads: ${res.status}`);
@@ -62485,7 +62489,9 @@ function ToolCard({
62485
62489
  toolName,
62486
62490
  badge,
62487
62491
  error: error2,
62488
- children
62492
+ children,
62493
+ args,
62494
+ result
62489
62495
  }) {
62490
62496
  const isRunning = status === "running";
62491
62497
  const isComplete = status === "complete";
@@ -62519,9 +62525,46 @@ function ToolCard({
62519
62525
  ] })
62520
62526
  ] }),
62521
62527
  error2 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 bg-destructive/10 px-4 py-2.5", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] leading-relaxed text-destructive", children: error2 }) }),
62522
- children
62528
+ children,
62529
+ toolName && isComplete && /* @__PURE__ */ jsxRuntime.jsx(CopyToolSpecButton, { toolName, args, result })
62523
62530
  ] });
62524
62531
  }
62532
+ function CopyToolSpecButton({
62533
+ toolName,
62534
+ args,
62535
+ result
62536
+ }) {
62537
+ const [copied, setCopied] = React.useState(false);
62538
+ const handleCopy = React.useCallback(() => {
62539
+ const spec = { tool_name: toolName };
62540
+ if (args) spec.arguments = args;
62541
+ if (result !== void 0) {
62542
+ if (typeof result === "string") {
62543
+ const parsed = tryParseJson(result);
62544
+ spec.result = parsed ?? result;
62545
+ } else {
62546
+ spec.result = result;
62547
+ }
62548
+ }
62549
+ navigator.clipboard.writeText(JSON.stringify(spec, null, 2)).then(() => {
62550
+ setCopied(true);
62551
+ setTimeout(() => setCopied(false), 2e3);
62552
+ });
62553
+ }, [toolName, args, result]);
62554
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end px-3 pb-1.5", children: /* @__PURE__ */ jsxRuntime.jsxs(
62555
+ "button",
62556
+ {
62557
+ type: "button",
62558
+ onClick: handleCopy,
62559
+ 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",
62560
+ title: "Copy tool name, arguments, and result as JSON",
62561
+ children: [
62562
+ /* @__PURE__ */ jsxRuntime.jsx(ClipboardCopy, { className: "size-2.5" }),
62563
+ copied ? "Copied!" : toolName
62564
+ ]
62565
+ }
62566
+ ) });
62567
+ }
62525
62568
  function ExpandableSection({
62526
62569
  label,
62527
62570
  children,
@@ -62585,6 +62628,8 @@ const WebSearchToolUIImpl = ({
62585
62628
  title: isRunning ? "Searching the web..." : "Web search",
62586
62629
  subtitle: query ? truncate(query, 80) : void 0,
62587
62630
  toolName,
62631
+ args: typedArgs,
62632
+ result,
62588
62633
  badge: isComplete && results.length > 0 ? `${results.length} results` : void 0,
62589
62634
  error: errorMsg,
62590
62635
  children: isComplete && results.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(ExpandableSection, { label: "Show search results", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2.5", children: results.map((r2, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5", children: [
@@ -62642,6 +62687,8 @@ const BrowseToolUIImpl = ({
62642
62687
  title: isRunning ? "Browsing page..." : pageTitle ? truncate(pageTitle, 50) : "Browsed page",
62643
62688
  subtitle: displayUrl,
62644
62689
  toolName,
62690
+ args: typedArgs,
62691
+ result,
62645
62692
  error: errorMsg,
62646
62693
  children: isComplete && pageContent && /* @__PURE__ */ jsxRuntime.jsx(ExpandableSection, { label: "Show page content", children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "whitespace-pre-wrap break-words text-[11px] leading-relaxed text-muted-foreground", children: truncate(pageContent, 3e3) }) })
62647
62694
  }
@@ -62685,6 +62732,8 @@ const EmailSearchToolUIImpl = ({
62685
62732
  title: isRunning ? "Searching emails..." : "Email search",
62686
62733
  subtitle: query ? truncate(query, 80) : void 0,
62687
62734
  toolName,
62735
+ args: typedArgs,
62736
+ result,
62688
62737
  badge: isComplete && emails.length > 0 ? `${emails.length} emails` : void 0,
62689
62738
  error: errorMsg,
62690
62739
  children: isComplete && emails.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(ExpandableSection, { label: "Show email results", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col divide-y divide-border/30", children: emails.map((email, i) => /* @__PURE__ */ jsxRuntime.jsxs(
@@ -62767,6 +62816,8 @@ function CreateAssetToolUIImpl({
62767
62816
  title: isRunning ? runningLabel : doneLabel,
62768
62817
  subtitle: createdName || name || void 0,
62769
62818
  toolName,
62819
+ args: typedArgs,
62820
+ result,
62770
62821
  error: errorMsg,
62771
62822
  children: assetId && isComplete && !isCancelled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 px-4 py-2", children: /* @__PURE__ */ jsxRuntime.jsxs(
62772
62823
  "button",
@@ -62844,6 +62895,8 @@ const CreateEmailDraftToolUIImpl = ({
62844
62895
  status: (status == null ? void 0 : status.type) ?? "complete",
62845
62896
  title: isRunning ? "Creating email draft..." : "Email draft created",
62846
62897
  toolName,
62898
+ args: typedArgs,
62899
+ result,
62847
62900
  subtitle: subject ? truncate(subject, 60) : to ? `To: ${truncate(to, 40)}` : void 0,
62848
62901
  error: errorMsg
62849
62902
  }
@@ -63212,6 +63265,8 @@ const RunPythonCodeToolUIImpl = ({
63212
63265
  status: (status == null ? void 0 : status.type) ?? "complete",
63213
63266
  title: isRunning ? "Running code..." : summary || `Executed ${lines} ${lines !== 1 ? "lines" : "line"}`,
63214
63267
  toolName,
63268
+ args: typedArgs,
63269
+ result,
63215
63270
  error: errorMsg,
63216
63271
  children: [
63217
63272
  code2 && /* @__PURE__ */ jsxRuntime.jsx(ExpandableSection, { label: "Show code", children: /* @__PURE__ */ jsxRuntime.jsx(SyntaxHighlightedCode, { code: code2 }) }),
@@ -63300,6 +63355,8 @@ const OpenAssetToolUIImpl = ({
63300
63355
  title: isRunning ? "Opening asset..." : "Asset opened",
63301
63356
  subtitle: assetId ? truncate(assetId, 30) : void 0,
63302
63357
  toolName,
63358
+ args: typedArgs,
63359
+ result,
63303
63360
  error: errorMsg,
63304
63361
  children: assetId && isComplete && !isCancelled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 px-4 py-2", children: /* @__PURE__ */ jsxRuntime.jsxs(
63305
63362
  "button",