@agent-native/core 0.81.0 → 0.81.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/corpus/core/CHANGELOG.md +6 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/client/AgentPanel.tsx +33 -1
- package/dist/client/AgentPanel.d.ts +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +18 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +7 -7
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/package.json +1 -1
package/corpus/core/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @agent-native/core
|
|
2
2
|
|
|
3
|
+
## 0.81.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ec433c3: Add a close (X) button to the left of the Chat tab in the agent pane header that closes the agent chat, and hide the open-agent button while the agent pane is open.
|
|
8
|
+
|
|
3
9
|
## 0.81.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/corpus/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.1",
|
|
4
4
|
"description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -85,6 +85,8 @@ import {
|
|
|
85
85
|
getInitialAgentSidebarOpen,
|
|
86
86
|
setAgentSidebarOpenPreference,
|
|
87
87
|
subscribeAgentSidebarUrlChanges,
|
|
88
|
+
SIDEBAR_STATE_CHANGE_EVENT,
|
|
89
|
+
type AgentSidebarStateChangeDetail,
|
|
88
90
|
} from "./agent-sidebar-state.js";
|
|
89
91
|
import { trackEvent } from "./analytics.js";
|
|
90
92
|
import { agentNativePath } from "./api-path.js";
|
|
@@ -969,6 +971,22 @@ function AgentPanelInner({
|
|
|
969
971
|
(activeMode: PanelMode) => (
|
|
970
972
|
<TooltipProvider delayDuration={200}>
|
|
971
973
|
<div className="flex shrink-0 items-center gap-1">
|
|
974
|
+
{onCollapse && (
|
|
975
|
+
<Tooltip>
|
|
976
|
+
<TooltipTrigger asChild>
|
|
977
|
+
<button
|
|
978
|
+
type="button"
|
|
979
|
+
onClick={onCollapse}
|
|
980
|
+
aria-label={t("agentPanel.collapseSidebar")}
|
|
981
|
+
className="flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-accent/50 hover:text-foreground"
|
|
982
|
+
style={AGENT_PANEL_CONTROL_STYLE}
|
|
983
|
+
>
|
|
984
|
+
<IconX size={16} />
|
|
985
|
+
</button>
|
|
986
|
+
</TooltipTrigger>
|
|
987
|
+
<TooltipContent>{t("agentPanel.collapseSidebar")}</TooltipContent>
|
|
988
|
+
</Tooltip>
|
|
989
|
+
)}
|
|
972
990
|
<Tooltip>
|
|
973
991
|
<TooltipTrigger asChild>
|
|
974
992
|
<button
|
|
@@ -1035,7 +1053,7 @@ function AgentPanelInner({
|
|
|
1035
1053
|
</div>
|
|
1036
1054
|
</TooltipProvider>
|
|
1037
1055
|
),
|
|
1038
|
-
[codeAccessEnabled, codeUnavailableDescription, showCliMode, t],
|
|
1056
|
+
[codeAccessEnabled, codeUnavailableDescription, onCollapse, showCliMode, t],
|
|
1039
1057
|
);
|
|
1040
1058
|
|
|
1041
1059
|
const [headerMenuOpen, setHeaderMenuOpen] = useState(false);
|
|
@@ -3027,6 +3045,20 @@ export function focusAgentChat() {
|
|
|
3027
3045
|
* Dispatches a custom event that AgentSidebar listens for.
|
|
3028
3046
|
*/
|
|
3029
3047
|
export function AgentToggleButton({ className }: { className?: string }) {
|
|
3048
|
+
const [open, setOpen] = useState(false);
|
|
3049
|
+
useEffect(() => {
|
|
3050
|
+
const handler = (event: Event) => {
|
|
3051
|
+
const detail = (event as CustomEvent<AgentSidebarStateChangeDetail>)
|
|
3052
|
+
.detail;
|
|
3053
|
+
if (detail && typeof detail.open === "boolean") setOpen(detail.open);
|
|
3054
|
+
};
|
|
3055
|
+
window.addEventListener(SIDEBAR_STATE_CHANGE_EVENT, handler);
|
|
3056
|
+
return () =>
|
|
3057
|
+
window.removeEventListener(SIDEBAR_STATE_CHANGE_EVENT, handler);
|
|
3058
|
+
}, []);
|
|
3059
|
+
// Hide the open-agent button while the agent pane is open; the pane has its
|
|
3060
|
+
// own close button.
|
|
3061
|
+
if (open) return null;
|
|
3030
3062
|
return (
|
|
3031
3063
|
<TooltipProvider delayDuration={200}>
|
|
3032
3064
|
<Tooltip>
|
|
@@ -188,6 +188,6 @@ export declare function focusAgentChat(): void;
|
|
|
188
188
|
*/
|
|
189
189
|
export declare function AgentToggleButton({ className }: {
|
|
190
190
|
className?: string;
|
|
191
|
-
}): React.JSX.Element;
|
|
191
|
+
}): React.JSX.Element | null;
|
|
192
192
|
export {};
|
|
193
193
|
//# sourceMappingURL=AgentPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentPanel.d.ts","sourceRoot":"","sources":["../../src/client/AgentPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAmBH,OAAO,KASN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AgentPanel.d.ts","sourceRoot":"","sources":["../../src/client/AgentPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAmBH,OAAO,KASN,MAAM,OAAO,CAAC;AA4Cf,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAW7D,O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AC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iFAAiF;IACjF,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,uBAAuB,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/D,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,0BAA0B,CAAC,eAAe,CAAC,CAAC;CAC7D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,cAAsC,EACtC,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,QAAkB,EAClB,WAAmB,EACnB,aAAoB,EACpB,cAAqB,EACrB,kBAA0B,EAC1B,UAAU,EACV,iBAAyB,EACzB,mBAAmB,EACnB,KAAK,EACL,YAAY,EACZ,aAAa,GACd,EAAE,iBAAiB,qBA2kBnB;AAED;;;GAGG;AACH,wBAAgB,cAAc,SAqB7B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,4BAqCtE"}
|
|
@@ -37,7 +37,7 @@ const MultiTabAssistantChatLazy = lazy(() => import("./MultiTabAssistantChat.js"
|
|
|
37
37
|
})));
|
|
38
38
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
39
39
|
import { useLocation, useNavigate } from "react-router";
|
|
40
|
-
import { consumeAgentSidebarUrlOpenOverride, dispatchAgentSidebarStateChange, getInitialAgentSidebarOpen, setAgentSidebarOpenPreference, subscribeAgentSidebarUrlChanges, } from "./agent-sidebar-state.js";
|
|
40
|
+
import { consumeAgentSidebarUrlOpenOverride, dispatchAgentSidebarStateChange, getInitialAgentSidebarOpen, setAgentSidebarOpenPreference, subscribeAgentSidebarUrlChanges, SIDEBAR_STATE_CHANGE_EVENT, } from "./agent-sidebar-state.js";
|
|
41
41
|
import { trackEvent } from "./analytics.js";
|
|
42
42
|
import { agentNativePath } from "./api-path.js";
|
|
43
43
|
import { assistantUiRecoverableRenderErrorKind } from "./assistant-ui-recovery.js";
|
|
@@ -532,7 +532,7 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
532
532
|
window.location.hostname === "127.0.0.1" ||
|
|
533
533
|
window.location.hostname === "::1");
|
|
534
534
|
const showDevToggle = canToggle && isLocalhost && isDevFrameChatSurface;
|
|
535
|
-
const renderModeButtons = useCallback((activeMode) => (_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { onClick: () => switchMode("chat"), "aria-label": t("agentPanel.chatMode"), className: cn("flex items-center gap-1 rounded-md px-2 py-1 text-[12px] leading-none", activeMode === "chat"
|
|
535
|
+
const renderModeButtons = useCallback((activeMode) => (_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [onCollapse && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: onCollapse, "aria-label": t("agentPanel.collapseSidebar"), className: "flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-accent/50 hover:text-foreground", style: AGENT_PANEL_CONTROL_STYLE, children: _jsx(IconX, { size: 16 }) }) }), _jsx(TooltipContent, { children: t("agentPanel.collapseSidebar") })] })), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { onClick: () => switchMode("chat"), "aria-label": t("agentPanel.chatMode"), className: cn("flex items-center gap-1 rounded-md px-2 py-1 text-[12px] leading-none", activeMode === "chat"
|
|
536
536
|
? "bg-accent text-foreground"
|
|
537
537
|
: "text-muted-foreground hover:bg-accent/50 hover:text-foreground"), style: AGENT_PANEL_CONTROL_STYLE, children: [_jsx(IconMessageCircle, { size: 14 }), t("agentPanel.chat")] }) }), _jsx(TooltipContent, { children: t("agentPanel.chatMode") })] }), showCliMode && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { onClick: () => switchMode("cli"), "aria-label": t("agentPanel.cliTerminalMode"), className: cn("flex items-center gap-1 rounded-md px-2 py-1 text-[12px] leading-none", activeMode === "cli"
|
|
538
538
|
? "bg-accent text-foreground"
|
|
@@ -540,7 +540,7 @@ function AgentPanelInner({ defaultMode = "chat", className, style, apiUrl, empty
|
|
|
540
540
|
? t("agentPanel.cliTerminalMode")
|
|
541
541
|
: codeUnavailableDescription })] })), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { onClick: () => switchMode("resources"), "aria-label": t("agentPanel.workspaceMode"), className: cn("agent-sidebar-hover-reveal flex items-center gap-1 rounded-md px-2 py-1 text-[12px] leading-none", activeMode === "resources"
|
|
542
542
|
? "bg-accent text-foreground"
|
|
543
|
-
: "text-muted-foreground hover:bg-accent/50 hover:text-foreground"), style: AGENT_PANEL_CONTROL_STYLE, children: [_jsx(IconLayoutGrid, { size: 14 }), t("agentPanel.workspace")] }) }), _jsx(TooltipContent, { children: t("agentPanel.workspaceMode") })] })] }) })), [codeAccessEnabled, codeUnavailableDescription, showCliMode, t]);
|
|
543
|
+
: "text-muted-foreground hover:bg-accent/50 hover:text-foreground"), style: AGENT_PANEL_CONTROL_STYLE, children: [_jsx(IconLayoutGrid, { size: 14 }), t("agentPanel.workspace")] }) }), _jsx(TooltipContent, { children: t("agentPanel.workspaceMode") })] })] }) })), [codeAccessEnabled, codeUnavailableDescription, onCollapse, showCliMode, t]);
|
|
544
544
|
const [headerMenuOpen, setHeaderMenuOpen] = useState(false);
|
|
545
545
|
const [feedbackOpen, setFeedbackOpen] = useState(false);
|
|
546
546
|
const renderHeaderActions = useCallback(({ activeChatSessionId, activeTabId, addTab, clearActiveTab, closeAllTabs, closeOtherTabs, closeTab, showHistory, tabs, toggleHistory, }) => (_jsxs("div", { className: "relative flex shrink-0 items-center gap-0.5", children: [SHOW_ONBOARDING && (_jsx(Suspense, { fallback: null, children: _jsx(SetupButton, {}) })), _jsx(FeedbackButton, { variant: "icon", side: "bottom", align: "end", chatSessionId: activeChatSessionId, chatStorageKey: storageKey, open: feedbackOpen, onOpenChange: setFeedbackOpen, trigger: _jsx("button", { type: "button", tabIndex: -1, "aria-hidden": "true", className: "pointer-events-none absolute end-0 top-full h-px w-px opacity-0" }) }), mode === "chat" && (_jsx(IconTooltip, { content: t("agentPanel.newChat"), children: _jsx("button", { onClick: addTab, "aria-label": t("agentPanel.newChat"), className: "agent-sidebar-hover-reveal flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconPlus, { size: 14 }) }) })), mode === "cli" && canUseCodeTools && (_jsx(IconTooltip, { content: t("agentPanel.newTerminal"), children: _jsx("button", { onClick: addCliTab, "aria-label": t("agentPanel.newTerminal"), className: "agent-sidebar-hover-reveal flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", children: _jsx(IconPlus, { size: 14 }) }) })), _jsxs(DropdownMenu, { open: headerMenuOpen, onOpenChange: setHeaderMenuOpen, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { className: cn("flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/50", (headerMenuOpen || mode === "settings") &&
|
|
@@ -1552,6 +1552,21 @@ export function focusAgentChat() {
|
|
|
1552
1552
|
* Dispatches a custom event that AgentSidebar listens for.
|
|
1553
1553
|
*/
|
|
1554
1554
|
export function AgentToggleButton({ className }) {
|
|
1555
|
+
const [open, setOpen] = useState(false);
|
|
1556
|
+
useEffect(() => {
|
|
1557
|
+
const handler = (event) => {
|
|
1558
|
+
const detail = event
|
|
1559
|
+
.detail;
|
|
1560
|
+
if (detail && typeof detail.open === "boolean")
|
|
1561
|
+
setOpen(detail.open);
|
|
1562
|
+
};
|
|
1563
|
+
window.addEventListener(SIDEBAR_STATE_CHANGE_EVENT, handler);
|
|
1564
|
+
return () => window.removeEventListener(SIDEBAR_STATE_CHANGE_EVENT, handler);
|
|
1565
|
+
}, []);
|
|
1566
|
+
// Hide the open-agent button while the agent pane is open; the pane has its
|
|
1567
|
+
// own close button.
|
|
1568
|
+
if (open)
|
|
1569
|
+
return null;
|
|
1555
1570
|
return (_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", "aria-label": "Toggle agent", onClick: () => window.dispatchEvent(new Event("agent-panel:toggle")), className: cn("inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent/40 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", className), children: _jsx(IconMessageDots, { size: 20, "aria-hidden": true }) }) }), _jsx(TooltipContent, { children: "Toggle agent" })] }) }));
|
|
1556
1571
|
}
|
|
1557
1572
|
//# sourceMappingURL=AgentPanel.js.map
|