@agent-native/core 0.11.0 → 0.11.1
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/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +6 -43
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +8 -13
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/builder-frame.d.ts.map +1 -1
- package/dist/client/builder-frame.js +10 -3
- package/dist/client/builder-frame.js.map +1 -1
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +58 -21
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/use-action.d.ts.map +1 -1
- package/dist/client/use-action.js +1 -0
- package/dist/client/use-action.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +1 -0
- package/dist/server/action-routes.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantChat.d.ts","sourceRoot":"","sources":["../../src/client/AssistantChat.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssistantChat.d.ts","sourceRoot":"","sources":["../../src/client/AssistantChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AA6Bf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAg3DrE,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,6DAA6D;IAC7D,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,4CAA4C;IAC5C,SAAS,IAAI,OAAO,CAAC;IACrB,+BAA+B;IAC/B,aAAa,IAAI,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,6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CAAC;IACvB,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,uDAAuD;IACvD,eAAe,CAAC,EAAE,KAAK,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC,CAAC;IACH,uDAAuD;IACvD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,kEAAkE;IAClE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IACnD,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,QAI9C;AAqCD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAosC7B,eAAO,MAAM,aAAa,gGA4DxB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { createPortal } from "react-dom";
|
|
3
2
|
import React, { useState, useRef, useEffect, useCallback, useMemo, forwardRef, useImperativeHandle, } from "react";
|
|
4
3
|
import { AssistantRuntimeProvider, useLocalRuntime, useThreadRuntime, useThread, useAui, useComposer, useMessageRuntime, ThreadPrimitive, ComposerPrimitive, MessagePrimitive, } from "@assistant-ui/react";
|
|
5
4
|
import { SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, CompositeAttachmentAdapter, } from "@assistant-ui/react";
|
|
@@ -14,6 +13,7 @@ import { AgentTaskCard } from "./AgentTaskCard.js";
|
|
|
14
13
|
import { ConnectBuilderCard } from "./ConnectBuilderCard.js";
|
|
15
14
|
import { useBuilderConnectFlow } from "./settings/useBuilderStatus.js";
|
|
16
15
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./components/ui/tooltip.js";
|
|
16
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "./components/ui/dropdown-menu.js";
|
|
17
17
|
import { IframeEmbed, parseEmbedBody } from "./IframeEmbed.js";
|
|
18
18
|
import { useDevMode } from "./use-dev-mode.js";
|
|
19
19
|
import { agentNativePath } from "./api-path.js";
|
|
@@ -624,11 +624,9 @@ const CheckpointContext = React.createContext(null);
|
|
|
624
624
|
const MessageActionsContext = React.createContext(null);
|
|
625
625
|
function MessageActionsMenu({ showRevert, onRevert, } = {}) {
|
|
626
626
|
const [open, setOpen] = useState(false);
|
|
627
|
-
const [menuPos, setMenuPos] = useState(null);
|
|
628
627
|
const [copied, setCopied] = useState(null);
|
|
629
628
|
const messageRuntime = useMessageRuntime();
|
|
630
629
|
const actionsCtx = React.useContext(MessageActionsContext);
|
|
631
|
-
const buttonRef = useRef(null);
|
|
632
630
|
const handleCopyMessage = useCallback(() => {
|
|
633
631
|
const m = messageRuntime.getState();
|
|
634
632
|
const text = m.content
|
|
@@ -670,16 +668,13 @@ function MessageActionsMenu({ showRevert, onRevert, } = {}) {
|
|
|
670
668
|
setOpen(false);
|
|
671
669
|
onRevert?.();
|
|
672
670
|
}, [onRevert]);
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
return (_jsxs("div", { className: "relative", children: [_jsx("button", { ref: buttonRef, onClick: handleToggle, className: cn("flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground/70 hover:bg-accent hover:text-foreground", open && "bg-accent text-foreground"), children: _jsx(IconDots, { className: "h-3.5 w-3.5" }) }), open &&
|
|
681
|
-
menuPos &&
|
|
682
|
-
createPortal(_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0", style: { zIndex: 9998 }, onClick: () => setOpen(false) }), _jsxs("div", { className: "fixed w-44 rounded-md border border-border bg-popover py-1 shadow-lg", style: { top: menuPos.top, left: menuPos.left, zIndex: 9999 }, children: [actionsCtx?.onForkChat && (_jsxs("button", { className: "flex w-full items-center gap-2 px-3 py-1.5 text-xs text-foreground hover:bg-accent", onClick: handleForkChat, children: [_jsx(IconGitFork, { className: "h-3.5 w-3.5" }), "Fork Chat"] })), _jsxs("button", { className: "flex w-full items-center gap-2 px-3 py-1.5 text-xs text-foreground hover:bg-accent", onClick: handleCopyMessage, children: [copied === "message" ? (_jsx(IconCheck, { className: "h-3.5 w-3.5" })) : (_jsx(IconCopy, { className: "h-3.5 w-3.5" })), copied === "message" ? "Copied!" : "Copy Message"] }), _jsxs("button", { className: "flex w-full items-center gap-2 px-3 py-1.5 text-xs text-foreground hover:bg-accent", onClick: handleCopyRequestId, children: [copied === "id" ? (_jsx(IconCheck, { className: "h-3.5 w-3.5" })) : (_jsx(IconId, { className: "h-3.5 w-3.5" })), copied === "id" ? "Copied!" : "Copy Request ID"] }), showRevert && (_jsxs("button", { className: "flex w-full items-center gap-2 px-3 py-1.5 text-xs text-foreground hover:bg-accent", onClick: handleRevert, children: [_jsx(IconArrowBackUp, { className: "h-3.5 w-3.5" }), "Revert to here"] }))] })] }), document.body)] }));
|
|
671
|
+
return (_jsxs(DropdownMenu, { open: open, onOpenChange: setOpen, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { className: cn("flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground/70 hover:bg-accent hover:text-foreground", open && "bg-accent text-foreground"), children: _jsx(IconDots, { className: "h-3.5 w-3.5" }) }) }), _jsxs(DropdownMenuContent, { align: "start", sideOffset: 4, className: "w-44", children: [actionsCtx?.onForkChat && (_jsxs(DropdownMenuItem, { onSelect: handleForkChat, children: [_jsx(IconGitFork, { className: "h-3.5 w-3.5" }), "Fork Chat"] })), _jsxs(DropdownMenuItem, { onSelect: (e) => {
|
|
672
|
+
e.preventDefault();
|
|
673
|
+
handleCopyMessage();
|
|
674
|
+
}, children: [copied === "message" ? (_jsx(IconCheck, { className: "h-3.5 w-3.5" })) : (_jsx(IconCopy, { className: "h-3.5 w-3.5" })), copied === "message" ? "Copied!" : "Copy Message"] }), _jsxs(DropdownMenuItem, { onSelect: (e) => {
|
|
675
|
+
e.preventDefault();
|
|
676
|
+
handleCopyRequestId();
|
|
677
|
+
}, children: [copied === "id" ? (_jsx(IconCheck, { className: "h-3.5 w-3.5" })) : (_jsx(IconId, { className: "h-3.5 w-3.5" })), copied === "id" ? "Copied!" : "Copy Request ID"] }), showRevert && (_jsxs(DropdownMenuItem, { onSelect: handleRevert, children: [_jsx(IconArrowBackUp, { className: "h-3.5 w-3.5" }), "Revert to here"] }))] })] }));
|
|
683
678
|
}
|
|
684
679
|
function AssistantMessage() {
|
|
685
680
|
const [restoreState, setRestoreState] = useState("idle");
|