@athenaintel/react 0.9.13 → 0.9.14
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 +161 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +161 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -580,7 +580,7 @@ export declare const parseAthenaCitationLink: ({ href, appUrl, }: {
|
|
|
580
580
|
appUrl?: string | null;
|
|
581
581
|
}) => ParsedAthenaCitationLink | null;
|
|
582
582
|
|
|
583
|
-
declare interface ParsedAthenaCitationLink {
|
|
583
|
+
export declare interface ParsedAthenaCitationLink {
|
|
584
584
|
url: URL;
|
|
585
585
|
assetId: string;
|
|
586
586
|
assetIds: string[];
|
package/dist/index.js
CHANGED
|
@@ -63428,6 +63428,7 @@ function parsePythonResult(result) {
|
|
|
63428
63428
|
const data = normalizeResult(result);
|
|
63429
63429
|
if (!data)
|
|
63430
63430
|
return {
|
|
63431
|
+
outputs: [],
|
|
63431
63432
|
stdout: null,
|
|
63432
63433
|
stderr: null,
|
|
63433
63434
|
value: null,
|
|
@@ -63435,7 +63436,9 @@ function parsePythonResult(result) {
|
|
|
63435
63436
|
exception: null,
|
|
63436
63437
|
imagePng: null,
|
|
63437
63438
|
plotlyJson: null,
|
|
63438
|
-
createdAssets: []
|
|
63439
|
+
createdAssets: [],
|
|
63440
|
+
assetId: null,
|
|
63441
|
+
deckId: null
|
|
63439
63442
|
};
|
|
63440
63443
|
const inner = typeof data.result === "object" && data.result !== null ? data.result : data;
|
|
63441
63444
|
const stdout = inner.stdout ?? null;
|
|
@@ -63453,13 +63456,18 @@ function parsePythonResult(result) {
|
|
|
63453
63456
|
}
|
|
63454
63457
|
let imagePng = null;
|
|
63455
63458
|
let plotlyJson = null;
|
|
63459
|
+
const outputs = [];
|
|
63456
63460
|
if (inner.data && typeof inner.data === "object") {
|
|
63457
63461
|
imagePng = inner.data.png ?? null;
|
|
63458
63462
|
}
|
|
63459
63463
|
if (Array.isArray(data.outputs)) {
|
|
63460
63464
|
for (const output of data.outputs) {
|
|
63461
63465
|
if (output && typeof output === "object") {
|
|
63466
|
+
const outputRecord = output;
|
|
63462
63467
|
const mimeBundle = output.mime_bundle;
|
|
63468
|
+
let outputImagePng = null;
|
|
63469
|
+
let outputPlotlyJson = null;
|
|
63470
|
+
let outputTextPlain = null;
|
|
63463
63471
|
if (mimeBundle && typeof mimeBundle === "object") {
|
|
63464
63472
|
const mb = mimeBundle;
|
|
63465
63473
|
if (!plotlyJson && typeof mb["plotly+json"] === "string") {
|
|
@@ -63468,12 +63476,52 @@ function parsePythonResult(result) {
|
|
|
63468
63476
|
if (!imagePng && typeof mb["image/png"] === "string") {
|
|
63469
63477
|
imagePng = mb["image/png"];
|
|
63470
63478
|
}
|
|
63471
|
-
|
|
63479
|
+
outputPlotlyJson = typeof mb["plotly+json"] === "string" ? mb["plotly+json"] : null;
|
|
63480
|
+
outputImagePng = typeof mb["image/png"] === "string" ? mb["image/png"] : null;
|
|
63481
|
+
outputTextPlain = typeof mb["text/plain"] === "string" ? mb["text/plain"] : null;
|
|
63482
|
+
}
|
|
63483
|
+
outputs.push({
|
|
63484
|
+
objectId: typeof outputRecord.object_id === "string" ? outputRecord.object_id : null,
|
|
63485
|
+
title: typeof outputRecord.title === "string" ? outputRecord.title : null,
|
|
63486
|
+
textPlain: outputTextPlain,
|
|
63487
|
+
imagePng: outputImagePng,
|
|
63488
|
+
plotlyJson: outputPlotlyJson,
|
|
63489
|
+
assetId: typeof outputRecord.asset_id === "string" ? outputRecord.asset_id : null
|
|
63490
|
+
});
|
|
63472
63491
|
}
|
|
63473
63492
|
}
|
|
63474
63493
|
}
|
|
63475
63494
|
const createdAssets = Array.isArray(data.created_assets) ? data.created_assets : [];
|
|
63476
|
-
|
|
63495
|
+
const assetId = typeof data.asset_id === "string" ? data.asset_id : null;
|
|
63496
|
+
const deckId = typeof data.deck_id === "string" ? data.deck_id : null;
|
|
63497
|
+
return {
|
|
63498
|
+
outputs,
|
|
63499
|
+
stdout,
|
|
63500
|
+
stderr,
|
|
63501
|
+
value,
|
|
63502
|
+
error: error2,
|
|
63503
|
+
exception,
|
|
63504
|
+
imagePng,
|
|
63505
|
+
plotlyJson,
|
|
63506
|
+
createdAssets,
|
|
63507
|
+
assetId,
|
|
63508
|
+
deckId
|
|
63509
|
+
};
|
|
63510
|
+
}
|
|
63511
|
+
function getExecutionTextOutput(parsed) {
|
|
63512
|
+
const output = [
|
|
63513
|
+
parsed.value,
|
|
63514
|
+
parsed.stdout,
|
|
63515
|
+
parsed.stderr,
|
|
63516
|
+
...parsed.outputs.map((entry) => {
|
|
63517
|
+
if (!entry.textPlain) {
|
|
63518
|
+
return null;
|
|
63519
|
+
}
|
|
63520
|
+
return entry.title ? `${entry.title}
|
|
63521
|
+
${entry.textPlain}` : entry.textPlain;
|
|
63522
|
+
})
|
|
63523
|
+
].filter((chunk) => Boolean(chunk && chunk.trim())).join("\n\n");
|
|
63524
|
+
return output || null;
|
|
63477
63525
|
}
|
|
63478
63526
|
function getPlotly() {
|
|
63479
63527
|
return window.Plotly;
|
|
@@ -63758,7 +63806,8 @@ const RunPythonCodeToolUIImpl = ({
|
|
|
63758
63806
|
[result, isComplete]
|
|
63759
63807
|
);
|
|
63760
63808
|
const openAsset = useAssetPanelStore((s) => s.openAsset);
|
|
63761
|
-
const
|
|
63809
|
+
const outputText = parsed ? getExecutionTextOutput(parsed) : null;
|
|
63810
|
+
const hasOutput = Boolean(outputText);
|
|
63762
63811
|
const hasError = parsed && (parsed.error || parsed.exception);
|
|
63763
63812
|
const hasImage = parsed == null ? void 0 : parsed.imagePng;
|
|
63764
63813
|
const hasPlotly = parsed == null ? void 0 : parsed.plotlyJson;
|
|
@@ -63779,7 +63828,7 @@ const RunPythonCodeToolUIImpl = ({
|
|
|
63779
63828
|
/* @__PURE__ */ jsx(Terminal, { className: "size-3 text-muted-foreground" }),
|
|
63780
63829
|
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-medium text-muted-foreground", children: "Output" })
|
|
63781
63830
|
] }),
|
|
63782
|
-
/* @__PURE__ */ jsx("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/30 p-2 text-[11px] leading-relaxed font-mono text-foreground/80", children:
|
|
63831
|
+
/* @__PURE__ */ jsx("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/30 p-2 text-[11px] leading-relaxed font-mono text-foreground/80", children: outputText })
|
|
63783
63832
|
] }),
|
|
63784
63833
|
isComplete && hasError && /* @__PURE__ */ jsxs("div", { className: "border-t border-border/40 bg-destructive/10 px-4 py-2.5", children: [
|
|
63785
63834
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 mb-1", children: [
|
|
@@ -63827,6 +63876,109 @@ const RunPythonCodeToolUI = memo(
|
|
|
63827
63876
|
RunPythonCodeToolUIImpl
|
|
63828
63877
|
);
|
|
63829
63878
|
RunPythonCodeToolUI.displayName = "RunPythonCodeToolUI";
|
|
63879
|
+
const ExecutePresentationCodeToolUIImpl = ({
|
|
63880
|
+
toolName,
|
|
63881
|
+
args,
|
|
63882
|
+
result,
|
|
63883
|
+
status
|
|
63884
|
+
}) => {
|
|
63885
|
+
var _a2;
|
|
63886
|
+
const typedArgs = args;
|
|
63887
|
+
const code2 = (typedArgs == null ? void 0 : typedArgs.code) ?? "";
|
|
63888
|
+
const summary = (typedArgs == null ? void 0 : typedArgs.summary) ?? null;
|
|
63889
|
+
const deckIdFromArgs = typeof (typedArgs == null ? void 0 : typedArgs.deck_id) === "string" ? typedArgs.deck_id : null;
|
|
63890
|
+
const isRunning = (status == null ? void 0 : status.type) === "running";
|
|
63891
|
+
const isComplete = (status == null ? void 0 : status.type) === "complete";
|
|
63892
|
+
const errorMsg = (status == null ? void 0 : status.type) === "incomplete" ? status.error : null;
|
|
63893
|
+
const parsed = useMemo(
|
|
63894
|
+
() => isComplete ? parsePythonResult(result) : null,
|
|
63895
|
+
[result, isComplete]
|
|
63896
|
+
);
|
|
63897
|
+
const outputText = parsed ? getExecutionTextOutput(parsed) : null;
|
|
63898
|
+
const assetId = (parsed == null ? void 0 : parsed.assetId) ?? null;
|
|
63899
|
+
const deckId = (parsed == null ? void 0 : parsed.deckId) ?? deckIdFromArgs;
|
|
63900
|
+
const hasError = parsed && (parsed.error || parsed.exception);
|
|
63901
|
+
const openAsset = useAssetPanelStore((s) => s.openAsset);
|
|
63902
|
+
const wasCompleteAtMount = useRef(isComplete);
|
|
63903
|
+
useEffect(() => {
|
|
63904
|
+
if (!isComplete || !assetId || wasCompleteAtMount.current) {
|
|
63905
|
+
return;
|
|
63906
|
+
}
|
|
63907
|
+
const store = useAssetPanelStore.getState();
|
|
63908
|
+
if (store.markAutoOpened(assetId)) {
|
|
63909
|
+
store.openAsset(assetId, { type: "presentation" });
|
|
63910
|
+
}
|
|
63911
|
+
}, [assetId, isComplete]);
|
|
63912
|
+
return /* @__PURE__ */ jsxs(
|
|
63913
|
+
ToolCard,
|
|
63914
|
+
{
|
|
63915
|
+
icon: Presentation,
|
|
63916
|
+
status: (status == null ? void 0 : status.type) ?? "complete",
|
|
63917
|
+
title: isRunning ? summary || "Executing presentation code..." : summary || "Presentation updated",
|
|
63918
|
+
subtitle: deckId ? `Deck ${truncate(deckId, 24)}` : assetId ? `Asset ${truncate(assetId, 24)}` : void 0,
|
|
63919
|
+
badge: "Deck",
|
|
63920
|
+
toolName,
|
|
63921
|
+
args: typedArgs,
|
|
63922
|
+
result,
|
|
63923
|
+
error: errorMsg,
|
|
63924
|
+
children: [
|
|
63925
|
+
assetId && isComplete && /* @__PURE__ */ jsx("div", { className: "border-t border-border/40 px-4 py-2.5", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
63926
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
63927
|
+
/* @__PURE__ */ jsx("div", { className: "text-[11px] font-medium text-muted-foreground", children: "Open the updated deck in the asset panel" }),
|
|
63928
|
+
/* @__PURE__ */ jsx("div", { className: "truncate text-[11px] text-foreground/80", children: truncate(assetId, 32) })
|
|
63929
|
+
] }),
|
|
63930
|
+
/* @__PURE__ */ jsxs(
|
|
63931
|
+
"button",
|
|
63932
|
+
{
|
|
63933
|
+
type: "button",
|
|
63934
|
+
onClick: () => openAsset(assetId, { type: "presentation" }),
|
|
63935
|
+
className: "flex shrink-0 items-center gap-1.5 rounded-md border border-border/60 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",
|
|
63936
|
+
children: [
|
|
63937
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "size-3" }),
|
|
63938
|
+
"Open deck"
|
|
63939
|
+
]
|
|
63940
|
+
}
|
|
63941
|
+
)
|
|
63942
|
+
] }) }),
|
|
63943
|
+
code2 && /* @__PURE__ */ jsx(ExpandableSection, { label: "Show code", children: /* @__PURE__ */ jsx(SyntaxHighlightedCode, { code: code2 }) }),
|
|
63944
|
+
isComplete && outputText && /* @__PURE__ */ jsxs("div", { className: "border-t border-border/40 px-4 py-2.5", children: [
|
|
63945
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center gap-1.5", children: [
|
|
63946
|
+
/* @__PURE__ */ jsx(Terminal, { className: "size-3 text-muted-foreground" }),
|
|
63947
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-medium text-muted-foreground", children: "Execution log" })
|
|
63948
|
+
] }),
|
|
63949
|
+
/* @__PURE__ */ jsx("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/30 p-2 text-[11px] leading-relaxed font-mono text-foreground/80", children: outputText })
|
|
63950
|
+
] }),
|
|
63951
|
+
isComplete && hasError && /* @__PURE__ */ jsxs("div", { className: "border-t border-border/40 bg-destructive/10 px-4 py-2.5", children: [
|
|
63952
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center gap-1.5", children: [
|
|
63953
|
+
/* @__PURE__ */ jsx(TriangleAlert, { className: "size-3 text-destructive" }),
|
|
63954
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-medium text-destructive", children: parsed.exception ? `${parsed.exception.name}: ${parsed.exception.value}` : "Execution error" })
|
|
63955
|
+
] }),
|
|
63956
|
+
/* @__PURE__ */ jsx("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-md bg-destructive/5 p-2 text-[11px] leading-relaxed font-mono text-destructive/80", children: ((_a2 = parsed.exception) == null ? void 0 : _a2.traceback) ?? parsed.error })
|
|
63957
|
+
] }),
|
|
63958
|
+
isComplete && parsed && parsed.createdAssets.length > 0 && /* @__PURE__ */ jsxs("div", { className: "border-t border-border/40 px-4 py-2", children: [
|
|
63959
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-medium text-muted-foreground", children: "Created assets" }),
|
|
63960
|
+
/* @__PURE__ */ jsx("div", { className: "mt-1 flex flex-wrap gap-1.5", children: parsed.createdAssets.map((entry) => /* @__PURE__ */ jsxs(
|
|
63961
|
+
"button",
|
|
63962
|
+
{
|
|
63963
|
+
type: "button",
|
|
63964
|
+
onClick: () => openAsset(entry.asset_id),
|
|
63965
|
+
className: "flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",
|
|
63966
|
+
children: [
|
|
63967
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "size-2.5" }),
|
|
63968
|
+
truncate(entry.asset_id, 20)
|
|
63969
|
+
]
|
|
63970
|
+
},
|
|
63971
|
+
entry.asset_id
|
|
63972
|
+
)) })
|
|
63973
|
+
] })
|
|
63974
|
+
]
|
|
63975
|
+
}
|
|
63976
|
+
);
|
|
63977
|
+
};
|
|
63978
|
+
const ExecutePresentationCodeToolUI = memo(
|
|
63979
|
+
ExecutePresentationCodeToolUIImpl
|
|
63980
|
+
);
|
|
63981
|
+
ExecutePresentationCodeToolUI.displayName = "ExecutePresentationCodeToolUI";
|
|
63830
63982
|
const OpenAssetToolUIImpl = ({
|
|
63831
63983
|
toolName,
|
|
63832
63984
|
args,
|
|
@@ -63908,6 +64060,7 @@ const TOOL_UI_REGISTRY = {
|
|
|
63908
64060
|
create_new_sheet: CreateSheetToolUI,
|
|
63909
64061
|
create_powerpoint_deck: CreatePresentationToolUI,
|
|
63910
64062
|
create_new_notebook: CreateNotebookToolUI,
|
|
64063
|
+
execute_presentation_code: ExecutePresentationCodeToolUI,
|
|
63911
64064
|
run_python_code: RunPythonCodeToolUI,
|
|
63912
64065
|
open_asset_in_workspace: OpenAssetToolUI
|
|
63913
64066
|
};
|
|
@@ -64620,7 +64773,7 @@ const MessageError = () => /* @__PURE__ */ jsx(MessagePrimitiveError, { children
|
|
|
64620
64773
|
}
|
|
64621
64774
|
) })
|
|
64622
64775
|
] }) });
|
|
64623
|
-
const AthenaAssistantMessageEmpty = () => /* @__PURE__ */ jsx("span", { className: "shimmer text-muted-foreground", children: "Thinking..." });
|
|
64776
|
+
const AthenaAssistantMessageEmpty = () => /* @__PURE__ */ jsx("span", { className: "shimmer text-[13px] text-muted-foreground", children: "Thinking..." });
|
|
64624
64777
|
const AthenaReasoningPart = ({
|
|
64625
64778
|
text: text2,
|
|
64626
64779
|
status,
|
|
@@ -64670,7 +64823,7 @@ const AthenaReasoningPart = ({
|
|
|
64670
64823
|
className: "flex w-full items-center justify-between gap-3 text-left",
|
|
64671
64824
|
"aria-label": isRunning ? "Toggle reasoning while streaming" : "Toggle reasoning",
|
|
64672
64825
|
children: [
|
|
64673
|
-
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2 text-
|
|
64826
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2 text-[13px] font-medium text-muted-foreground", children: [
|
|
64674
64827
|
/* @__PURE__ */ jsx(Brain, { className: "size-4 shrink-0" }),
|
|
64675
64828
|
/* @__PURE__ */ jsx("span", { children: isRunning ? "Reasoning..." : "Reasoning" })
|
|
64676
64829
|
] }),
|
|
@@ -64691,7 +64844,7 @@ const AthenaReasoningPart = ({
|
|
|
64691
64844
|
]
|
|
64692
64845
|
}
|
|
64693
64846
|
) }),
|
|
64694
|
-
/* @__PURE__ */ jsx(CollapsibleContent, { className: "pt-3", children: isRunning && !hasText ? /* @__PURE__ */ jsx("span", { className: "shimmer text-
|
|
64847
|
+
/* @__PURE__ */ jsx(CollapsibleContent, { className: "pt-3", children: isRunning && !hasText ? /* @__PURE__ */ jsx("span", { className: "shimmer text-[13px] text-muted-foreground", children: "Analyzing..." }) : isRunning ? /* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap break-words text-[13px] leading-relaxed text-foreground", children: text2 }) : /* @__PURE__ */ jsx("div", { className: "aui-assistant-reasoning-body text-[13px] leading-relaxed", children: /* @__PURE__ */ jsx(EffectiveTextComponent, { ...reasoningTextProps }) }) })
|
|
64695
64848
|
]
|
|
64696
64849
|
}
|
|
64697
64850
|
);
|