@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":"AgentPanel.d.ts","sourceRoot":"","sources":["../../src/client/AgentPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;
|
|
1
|
+
{"version":3,"file":"AgentPanel.d.ts","sourceRoot":"","sources":["../../src/client/AgentPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KASN,MAAM,OAAO,CAAC;AAuCf,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAwJ7D,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,kBAAkB,EAClB,eAAe,CAChB;IACC,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC7B,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6GAA6G;IAC7G,UAAU,CAAC,E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
* // Full page
|
|
22
22
|
* <AgentPanel className="h-screen" />
|
|
23
23
|
*/
|
|
24
|
-
import ReactDOM from "react-dom";
|
|
25
24
|
import React, { useState, useEffect, useRef, useCallback, useMemo, lazy, Suspense, startTransition, } from "react";
|
|
26
25
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
27
26
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, normalizeTooltipText, } from "./components/ui/tooltip.js";
|
|
27
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuShortcut, DropdownMenuTrigger, } from "./components/ui/dropdown-menu.js";
|
|
28
28
|
import { IconMessageChatbot, IconSparkles, IconTerminal2, IconSettings, IconLayoutSidebarRightCollapse, IconLayoutGrid, IconCheck, IconPlus, IconX, IconDotsVertical, IconHistory, IconArrowsMaximize, IconArrowsMinimize, } from "@tabler/icons-react";
|
|
29
29
|
import { FeedbackButton } from "./FeedbackButton.js";
|
|
30
30
|
import { MultiTabAssistantChat, } from "./MultiTabAssistantChat.js";
|
|
@@ -298,7 +298,6 @@ function AgentPanelInner({ defaultMode = "chat", className, apiUrl, emptyStateTe
|
|
|
298
298
|
const renderHeaderActions = useCallback(() => (_jsxs("div", { className: "flex shrink-0 items-center gap-1.5", children: [SHOW_ONBOARDING && isDevMode && (_jsx(Suspense, { fallback: null, children: _jsx(SetupButton, {}) })), _jsx(FeedbackButton, { variant: "icon", side: "bottom", align: "end" }), onToggleFullscreen && (_jsx(IconTooltip, { content: isFullscreen ? "Exit fullscreen" : "Fullscreen", children: _jsx("button", { onClick: onToggleFullscreen, "aria-label": isFullscreen ? "Exit fullscreen" : "Enter fullscreen", className: "flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: isFullscreen ? (_jsx(IconArrowsMinimize, { size: 14 })) : (_jsx(IconArrowsMaximize, { size: 14 })) }) })), onCollapse && (_jsx(IconTooltip, { content: "Collapse sidebar", children: _jsx("button", { onClick: onCollapse, "aria-label": "Collapse sidebar", className: "flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconLayoutSidebarRightCollapse, { size: 14 }) }) }))] })), [onCollapse, isDevMode, onToggleFullscreen, isFullscreen]);
|
|
299
299
|
const [tabMenuOpen, setTabMenuOpen] = useState(null);
|
|
300
300
|
const [cliPickerOpen, setCliPickerOpen] = useState(false);
|
|
301
|
-
const cliPickerBtnRef = useRef(null);
|
|
302
301
|
// Ref callback: scroll the active tab into view in the overflow container.
|
|
303
302
|
// Uses getBoundingClientRect for reliable positioning regardless of offsetParent.
|
|
304
303
|
const activeTabRefCb = useCallback((el) => {
|
|
@@ -365,47 +364,11 @@ function AgentPanelInner({ defaultMode = "chat", className, apiUrl, emptyStateTe
|
|
|
365
364
|
paddingRight: 6,
|
|
366
365
|
borderRadius: "0 6px 6px 0",
|
|
367
366
|
background: "linear-gradient(to right, transparent, hsl(var(--accent)) 40%)",
|
|
368
|
-
}, children: _jsx(IconX, { size: 10 }) })] }, id))) }), _jsxs("div", { className: "flex items-center gap-0.5 shrink-0 ml-auto", children: [mode === "chat" && (_jsxs(_Fragment, { children: [_jsx(IconTooltip, { content: "New chat", children: _jsx("button", { onClick: addTab, "aria-label": "New chat", className: "flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconPlus, { size: 14 }) }) }), toggleHistory && (_jsx(IconTooltip, { content: "Chat history", children: _jsx("button", { onClick: toggleHistory, "aria-label": "Chat history", className: cn("flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", showHistory && "bg-accent text-foreground"), children: _jsx(IconHistory, { size: 14 }) }) })), _jsxs(
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
"
|
|
372
|
-
|
|
373
|
-
setTabMenuOpen(null);
|
|
374
|
-
}, children: ["Close Tab", _jsx("kbd", { className: "text-[10px] text-muted-foreground", children: closeTabHint })] }), _jsx("button", { className: "flex w-full items-center px-3 py-1.5 text-xs text-foreground hover:bg-accent", onClick: () => {
|
|
375
|
-
closeOtherTabs(activeTabId);
|
|
376
|
-
setTabMenuOpen(null);
|
|
377
|
-
}, children: "Close Other Tabs" }), _jsxs("button", { className: "flex w-full items-center justify-between px-3 py-1.5 text-xs text-foreground hover:bg-accent", onClick: () => {
|
|
378
|
-
closeAllTabs();
|
|
379
|
-
setTabMenuOpen(null);
|
|
380
|
-
}, children: ["Close All Tabs", _jsx("kbd", { className: "text-[10px] text-muted-foreground", children: closeAllTabsHint })] })] })] }))] })] })), mode === "cli" && (_jsxs(_Fragment, { children: [_jsx(IconTooltip, { content: "New terminal", children: _jsx("button", { onClick: addCliTab, "aria-label": "New terminal", className: "flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconPlus, { size: 14 }) }) }), availableClis.length > 0 && (_jsxs("div", { className: "relative", children: [_jsx(IconTooltip, { content: `CLI: ${selectedLabel}`, children: _jsx("button", { ref: cliPickerBtnRef, onClick: () => setCliPickerOpen(!cliPickerOpen), "aria-label": `Select CLI, currently ${selectedLabel}`, className: cn("flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", cliPickerOpen && "bg-accent text-foreground"), children: _jsx(IconSettings, { size: 14 }) }) }), cliPickerOpen &&
|
|
381
|
-
ReactDOM.createPortal(_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-[9980]", onClick: () => setCliPickerOpen(false) }), _jsx("div", { className: "fixed z-[9990] w-48 rounded-md border border-border bg-popover py-1 shadow-lg", style: (() => {
|
|
382
|
-
const r = cliPickerBtnRef.current?.getBoundingClientRect();
|
|
383
|
-
if (!r)
|
|
384
|
-
return { top: 0, right: 0 };
|
|
385
|
-
return {
|
|
386
|
-
top: r.bottom + 4,
|
|
387
|
-
right: window.innerWidth - r.right,
|
|
388
|
-
};
|
|
389
|
-
})(), children: availableClis.map((cli) => (_jsxs("button", { className: cn("flex w-full items-center gap-2 px-3 py-1.5 text-xs hover:bg-accent", cli.command === selectedCli
|
|
390
|
-
? "text-foreground font-medium"
|
|
391
|
-
: "text-muted-foreground"), onClick: () => {
|
|
392
|
-
selectCli(cli.command);
|
|
393
|
-
setCliPickerOpen(false);
|
|
394
|
-
}, children: [cli.command === selectedCli && (_jsx(IconCheck, { size: 12, className: "shrink-0" })), _jsx("span", { className: cli.command !== selectedCli
|
|
395
|
-
? "ml-5"
|
|
396
|
-
: "", children: cli.label })] }, cli.command))) })] }), document.body)] })), _jsxs("div", { className: "relative", children: [_jsx(IconTooltip, { content: "Tab options", children: _jsx("button", { onClick: () => setTabMenuOpen(tabMenuOpen === "__cli_global"
|
|
397
|
-
? null
|
|
398
|
-
: "__cli_global"), className: cn("flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", tabMenuOpen === "__cli_global" &&
|
|
399
|
-
"bg-accent text-foreground"), "aria-label": "Terminal tab options", children: _jsx(IconDotsVertical, { size: 14 }) }) }), tabMenuOpen === "__cli_global" && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: () => setTabMenuOpen(null) }), _jsxs("div", { className: "absolute right-0 top-full mt-1 z-50 w-44 rounded-md border border-border bg-popover py-1 shadow-lg", children: [_jsxs("button", { className: "flex w-full items-center justify-between px-3 py-1.5 text-xs text-foreground hover:bg-accent", onClick: () => {
|
|
400
|
-
closeCliTab(activeCliTab);
|
|
401
|
-
setTabMenuOpen(null);
|
|
402
|
-
}, children: ["Close Tab", _jsx("kbd", { className: "text-[10px] text-muted-foreground", children: closeTabHint })] }), _jsx("button", { className: "flex w-full items-center px-3 py-1.5 text-xs text-foreground hover:bg-accent", onClick: () => {
|
|
403
|
-
closeOtherCliTabs(activeCliTab);
|
|
404
|
-
setTabMenuOpen(null);
|
|
405
|
-
}, children: "Close Other Tabs" }), _jsxs("button", { className: "flex w-full items-center justify-between px-3 py-1.5 text-xs text-foreground hover:bg-accent", onClick: () => {
|
|
406
|
-
closeAllCliTabs();
|
|
407
|
-
setTabMenuOpen(null);
|
|
408
|
-
}, children: ["Close All Tabs", _jsx("kbd", { className: "text-[10px] text-muted-foreground", children: closeAllTabsHint })] })] })] }))] })] }))] })] }), mode === "chat" && hasSubTabs && (_jsx("div", { className: "flex items-center px-2 py-0.5 border-b border-border gap-0.5 bg-muted/30", children: _jsxs("div", { className: "flex items-center gap-0.5 min-w-0 overflow-x-auto scrollbar-none flex-1", children: [_jsx("div", { role: "button", tabIndex: 0, onClick: () => setActiveTabId(focusParentId), onKeyDown: activateOnKeyDown(() => setActiveTabId(focusParentId)), className: cn("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium cursor-pointer", activeTabId === focusParentId
|
|
367
|
+
}, children: _jsx(IconX, { size: 10 }) })] }, id))) }), _jsxs("div", { className: "flex items-center gap-0.5 shrink-0 ml-auto", children: [mode === "chat" && (_jsxs(_Fragment, { children: [_jsx(IconTooltip, { content: "New chat", children: _jsx("button", { onClick: addTab, "aria-label": "New chat", className: "flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconPlus, { size: 14 }) }) }), toggleHistory && (_jsx(IconTooltip, { content: "Chat history", children: _jsx("button", { onClick: toggleHistory, "aria-label": "Chat history", className: cn("flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", showHistory && "bg-accent text-foreground"), children: _jsx(IconHistory, { size: 14 }) }) })), _jsxs(DropdownMenu, { open: tabMenuOpen === "__chat_global", onOpenChange: (open) => setTabMenuOpen(open ? "__chat_global" : null), children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { className: cn("flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", tabMenuOpen === "__chat_global" &&
|
|
368
|
+
"bg-accent text-foreground"), "aria-label": "Chat tab options", children: _jsx(IconDotsVertical, { size: 14 }) }) }), _jsxs(DropdownMenuContent, { align: "end", sideOffset: 4, className: "w-44", children: [_jsxs(DropdownMenuItem, { onSelect: () => closeTab(activeTabId), children: ["Close Tab", _jsx(DropdownMenuShortcut, { children: closeTabHint })] }), _jsx(DropdownMenuItem, { onSelect: () => closeOtherTabs(activeTabId), children: "Close Other Tabs" }), _jsxs(DropdownMenuItem, { onSelect: () => closeAllTabs(), children: ["Close All Tabs", _jsx(DropdownMenuShortcut, { children: closeAllTabsHint })] })] })] })] })), mode === "cli" && (_jsxs(_Fragment, { children: [_jsx(IconTooltip, { content: "New terminal", children: _jsx("button", { onClick: addCliTab, "aria-label": "New terminal", className: "flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconPlus, { size: 14 }) }) }), availableClis.length > 0 && (_jsxs(DropdownMenu, { open: cliPickerOpen, onOpenChange: setCliPickerOpen, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { "aria-label": `Select CLI, currently ${selectedLabel}`, className: cn("flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", cliPickerOpen && "bg-accent text-foreground"), children: _jsx(IconSettings, { size: 14 }) }) }), _jsx(DropdownMenuContent, { align: "end", sideOffset: 4, className: "w-48", children: availableClis.map((cli) => (_jsxs(DropdownMenuItem, { onSelect: () => selectCli(cli.command), className: cn(cli.command === selectedCli
|
|
369
|
+
? "font-medium"
|
|
370
|
+
: "text-muted-foreground"), children: [cli.command === selectedCli ? (_jsx(IconCheck, { size: 12, className: "shrink-0" })) : (_jsx("span", { className: "w-3" })), cli.label] }, cli.command))) })] })), _jsxs(DropdownMenu, { open: tabMenuOpen === "__cli_global", onOpenChange: (open) => setTabMenuOpen(open ? "__cli_global" : null), children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { className: cn("flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", tabMenuOpen === "__cli_global" &&
|
|
371
|
+
"bg-accent text-foreground"), "aria-label": "Terminal tab options", children: _jsx(IconDotsVertical, { size: 14 }) }) }), _jsxs(DropdownMenuContent, { align: "end", sideOffset: 4, className: "w-44", children: [_jsxs(DropdownMenuItem, { onSelect: () => closeCliTab(activeCliTab), children: ["Close Tab", _jsx(DropdownMenuShortcut, { children: closeTabHint })] }), _jsx(DropdownMenuItem, { onSelect: () => closeOtherCliTabs(activeCliTab), children: "Close Other Tabs" }), _jsxs(DropdownMenuItem, { onSelect: () => closeAllCliTabs(), children: ["Close All Tabs", _jsx(DropdownMenuShortcut, { children: closeAllTabsHint })] })] })] })] }))] })] }), mode === "chat" && hasSubTabs && (_jsx("div", { className: "flex items-center px-2 py-0.5 border-b border-border gap-0.5 bg-muted/30", children: _jsxs("div", { className: "flex items-center gap-0.5 min-w-0 overflow-x-auto scrollbar-none flex-1", children: [_jsx("div", { role: "button", tabIndex: 0, onClick: () => setActiveTabId(focusParentId), onKeyDown: activateOnKeyDown(() => setActiveTabId(focusParentId)), className: cn("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium cursor-pointer", activeTabId === focusParentId
|
|
409
372
|
? "bg-accent text-foreground"
|
|
410
373
|
: "text-muted-foreground hover:bg-accent hover:text-foreground"), children: "Main" }), childTabs.map((tab) => (_jsxs("div", { role: "button", tabIndex: 0, ref: tab.id === activeTabId ? activeTabRefCb : undefined, onClick: () => setActiveTabId(tab.id), onKeyDown: activateOnKeyDown(() => setActiveTabId(tab.id)), className: cn("agent-tab relative flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium cursor-pointer max-w-[140px]", tab.id === activeTabId
|
|
411
374
|
? "bg-accent text-foreground"
|