@athenaintel/react 0.9.2 → 0.9.3

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
@@ -62485,7 +62485,9 @@ function ToolCard({
62485
62485
  toolName,
62486
62486
  badge,
62487
62487
  error: error2,
62488
- children
62488
+ children,
62489
+ args,
62490
+ result
62489
62491
  }) {
62490
62492
  const isRunning = status === "running";
62491
62493
  const isComplete = status === "complete";
@@ -62519,9 +62521,46 @@ function ToolCard({
62519
62521
  ] })
62520
62522
  ] }),
62521
62523
  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
62524
+ children,
62525
+ toolName && isComplete && /* @__PURE__ */ jsxRuntime.jsx(CopyToolSpecButton, { toolName, args, result })
62523
62526
  ] });
62524
62527
  }
62528
+ function CopyToolSpecButton({
62529
+ toolName,
62530
+ args,
62531
+ result
62532
+ }) {
62533
+ const [copied, setCopied] = React.useState(false);
62534
+ const handleCopy = React.useCallback(() => {
62535
+ const spec = { tool_name: toolName };
62536
+ if (args) spec.arguments = args;
62537
+ if (result !== void 0) {
62538
+ if (typeof result === "string") {
62539
+ const parsed = tryParseJson(result);
62540
+ spec.result = parsed ?? result;
62541
+ } else {
62542
+ spec.result = result;
62543
+ }
62544
+ }
62545
+ navigator.clipboard.writeText(JSON.stringify(spec, null, 2)).then(() => {
62546
+ setCopied(true);
62547
+ setTimeout(() => setCopied(false), 2e3);
62548
+ });
62549
+ }, [toolName, args, result]);
62550
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end px-3 pb-1.5", children: /* @__PURE__ */ jsxRuntime.jsxs(
62551
+ "button",
62552
+ {
62553
+ type: "button",
62554
+ onClick: handleCopy,
62555
+ 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",
62556
+ title: "Copy tool name, arguments, and result as JSON",
62557
+ children: [
62558
+ /* @__PURE__ */ jsxRuntime.jsx(ClipboardCopy, { className: "size-2.5" }),
62559
+ copied ? "Copied!" : toolName
62560
+ ]
62561
+ }
62562
+ ) });
62563
+ }
62525
62564
  function ExpandableSection({
62526
62565
  label,
62527
62566
  children,
@@ -62585,6 +62624,8 @@ const WebSearchToolUIImpl = ({
62585
62624
  title: isRunning ? "Searching the web..." : "Web search",
62586
62625
  subtitle: query ? truncate(query, 80) : void 0,
62587
62626
  toolName,
62627
+ args: typedArgs,
62628
+ result,
62588
62629
  badge: isComplete && results.length > 0 ? `${results.length} results` : void 0,
62589
62630
  error: errorMsg,
62590
62631
  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 +62683,8 @@ const BrowseToolUIImpl = ({
62642
62683
  title: isRunning ? "Browsing page..." : pageTitle ? truncate(pageTitle, 50) : "Browsed page",
62643
62684
  subtitle: displayUrl,
62644
62685
  toolName,
62686
+ args: typedArgs,
62687
+ result,
62645
62688
  error: errorMsg,
62646
62689
  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
62690
  }
@@ -62685,6 +62728,8 @@ const EmailSearchToolUIImpl = ({
62685
62728
  title: isRunning ? "Searching emails..." : "Email search",
62686
62729
  subtitle: query ? truncate(query, 80) : void 0,
62687
62730
  toolName,
62731
+ args: typedArgs,
62732
+ result,
62688
62733
  badge: isComplete && emails.length > 0 ? `${emails.length} emails` : void 0,
62689
62734
  error: errorMsg,
62690
62735
  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 +62812,8 @@ function CreateAssetToolUIImpl({
62767
62812
  title: isRunning ? runningLabel : doneLabel,
62768
62813
  subtitle: createdName || name || void 0,
62769
62814
  toolName,
62815
+ args: typedArgs,
62816
+ result,
62770
62817
  error: errorMsg,
62771
62818
  children: assetId && isComplete && !isCancelled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 px-4 py-2", children: /* @__PURE__ */ jsxRuntime.jsxs(
62772
62819
  "button",
@@ -62844,6 +62891,8 @@ const CreateEmailDraftToolUIImpl = ({
62844
62891
  status: (status == null ? void 0 : status.type) ?? "complete",
62845
62892
  title: isRunning ? "Creating email draft..." : "Email draft created",
62846
62893
  toolName,
62894
+ args: typedArgs,
62895
+ result,
62847
62896
  subtitle: subject ? truncate(subject, 60) : to ? `To: ${truncate(to, 40)}` : void 0,
62848
62897
  error: errorMsg
62849
62898
  }
@@ -63212,6 +63261,8 @@ const RunPythonCodeToolUIImpl = ({
63212
63261
  status: (status == null ? void 0 : status.type) ?? "complete",
63213
63262
  title: isRunning ? "Running code..." : summary || `Executed ${lines} ${lines !== 1 ? "lines" : "line"}`,
63214
63263
  toolName,
63264
+ args: typedArgs,
63265
+ result,
63215
63266
  error: errorMsg,
63216
63267
  children: [
63217
63268
  code2 && /* @__PURE__ */ jsxRuntime.jsx(ExpandableSection, { label: "Show code", children: /* @__PURE__ */ jsxRuntime.jsx(SyntaxHighlightedCode, { code: code2 }) }),
@@ -63300,6 +63351,8 @@ const OpenAssetToolUIImpl = ({
63300
63351
  title: isRunning ? "Opening asset..." : "Asset opened",
63301
63352
  subtitle: assetId ? truncate(assetId, 30) : void 0,
63302
63353
  toolName,
63354
+ args: typedArgs,
63355
+ result,
63303
63356
  error: errorMsg,
63304
63357
  children: assetId && isComplete && !isCancelled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 px-4 py-2", children: /* @__PURE__ */ jsxRuntime.jsxs(
63305
63358
  "button",