@agent-native/core 0.58.3 → 0.58.5
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/agent/production-agent.d.ts +9 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +80 -4
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/plan-local.d.ts +34 -0
- package/dist/cli/plan-local.d.ts.map +1 -1
- package/dist/cli/plan-local.js +205 -1
- package/dist/cli/plan-local.js.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.js +1 -1
- package/dist/cli/pr-visual-recap-workflow.js.map +1 -1
- package/dist/cli/recap.d.ts +5 -0
- package/dist/cli/recap.d.ts.map +1 -1
- package/dist/cli/recap.js +19 -2
- package/dist/cli/recap.js.map +1 -1
- package/dist/client/AgentPanel.d.ts +3 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +6 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +5 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +141 -39
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +44 -31
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/blocks/library/diagram.d.ts.map +1 -1
- package/dist/client/blocks/library/diagram.js +85 -20
- package/dist/client/blocks/library/diagram.js.map +1 -1
- package/dist/client/blocks/library/tabs.d.ts.map +1 -1
- package/dist/client/blocks/library/tabs.js +5 -5
- package/dist/client/blocks/library/tabs.js.map +1 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +13 -10
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/run-recovery.d.ts.map +1 -1
- package/dist/client/chat/run-recovery.js +3 -3
- package/dist/client/chat/run-recovery.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +0 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +5 -2
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat/widgets/DataChartRenderer.d.ts.map +1 -1
- package/dist/client/chat/widgets/DataChartRenderer.js +98 -21
- package/dist/client/chat/widgets/DataChartRenderer.js.map +1 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.d.ts +4 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.d.ts.map +1 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.js +30 -4
- package/dist/client/chat/widgets/builtin-tool-renderers.js.map +1 -1
- package/dist/client/composer/AgentComposerFrame.js +1 -1
- package/dist/client/composer/AgentComposerFrame.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +17 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +6 -2
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/framework-request-handler.d.ts.map +1 -1
- package/dist/server/framework-request-handler.js +13 -0
- package/dist/server/framework-request-handler.js.map +1 -1
- package/dist/sharing/actions/set-resource-visibility.d.ts.map +1 -1
- package/dist/sharing/actions/set-resource-visibility.js +25 -11
- package/dist/sharing/actions/set-resource-visibility.js.map +1 -1
- package/dist/styles/agent-native.css +115 -2
- package/dist/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +100 -0
- package/docs/content/pr-visual-recap.md +2 -2
- package/package.json +1 -1
- package/src/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +100 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiTabAssistantChat.d.ts","sourceRoot":"","sources":["../../src/client/MultiTabAssistantChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;A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kBAAkB,EAClB,OAAO,GAAG,UAAU,CACrB,GAAG;IACF,sCAAsC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iDAAiD;IACjD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC5E,2DAA2D;IAC3D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC7E,sGAAsG;IACtG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,EACpC,UAAiB,EACjB,YAAY,EACZ,aAAa,EACb,aAAqB,EACrB,MAAqD,EACrD,UAAU,EACV,mBAA0B,EAC1B,YAAY,EACZ,KAAY,EACZ,GAAG,KAAK,EACT,EAAE,0BAA0B,2CAgsD5B"}
|
|
@@ -100,10 +100,9 @@ function getScopeCopy(scope, isCurrentScope) {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* for taking a scoped chat back to a general one.
|
|
103
|
+
* Compact context tab above the composer. Click → popover with related chats
|
|
104
|
+
* and the remove-context action. It stays attached to the chat field so scoped
|
|
105
|
+
* context is visible right where the next message will be composed.
|
|
107
106
|
*/
|
|
108
107
|
function ScopeBadge({ scope, currentScope, onDetach, otherScopedThreads, activeThreadId, openTabIds, onSelectThread, }) {
|
|
109
108
|
const [open, setOpen] = useState(false);
|
|
@@ -119,7 +118,7 @@ function ScopeBadge({ scope, currentScope, onDetach, otherScopedThreads, activeT
|
|
|
119
118
|
? "New chats here keep this context."
|
|
120
119
|
: "Start a new chat for a general conversation.";
|
|
121
120
|
const otherCount = otherScopedThreads.length;
|
|
122
|
-
return (_jsx("div", { className: "flex items-
|
|
121
|
+
return (_jsx("div", { className: "agent-scope-badge-wrapper relative z-[1] -mb-2 flex shrink-0 items-end justify-center px-3 pt-1 text-[11px] text-muted-foreground", children: _jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: "inline-flex h-7 min-w-0 max-w-full cursor-pointer items-center gap-1.5 rounded-t-lg border border-b-0 border-input bg-background px-3 text-muted-foreground shadow-[0_-8px_24px_hsl(var(--background)/0.72)] transition-colors hover:bg-accent hover:text-foreground sm:max-w-72", "aria-label": heading, children: [_jsx(IconLink, { size: 11, className: "shrink-0 opacity-70" }), _jsx("span", { className: "min-w-0 truncate", children: heading }), otherCount > 0 && (_jsxs("span", { className: "ml-0.5 shrink-0 rounded-full bg-muted px-1.5 py-px text-[10px] leading-none text-muted-foreground", "aria-label": `${otherCount} other chats for ${objectLabel}`, children: ["+", otherCount] }))] }) }), _jsxs(PopoverContent, { align: "center", side: "top", className: "w-72 p-0", children: [_jsxs("p", { className: "px-3 pt-2 pb-1.5 text-[11px] text-muted-foreground", children: ["This chat can see", " ", _jsx("span", { className: "text-foreground", children: objectLabel }), ".", " ", detailSuffix] }), otherCount > 0 && (_jsxs("div", { className: "border-t border-border", children: [_jsxs("div", { className: "px-3 pt-1.5 pb-1 text-[10px] uppercase tracking-wider text-muted-foreground/70", children: ["Chats for ", objectLabel] }), _jsx("div", { className: "max-h-56 overflow-y-auto pb-1", children: otherScopedThreads.map((thread) => renderThreadRow(thread, activeThreadId, openTabIds, formatThreadTime, onSelectThread, () => setOpen(false))) })] })), _jsx("div", { className: "border-t border-border p-1", children: _jsxs("button", { type: "button", onClick: () => {
|
|
123
122
|
setOpen(false);
|
|
124
123
|
onDetach();
|
|
125
124
|
}, className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs text-foreground hover:bg-accent cursor-pointer", children: [_jsx(IconLinkOff, { size: 13 }), _jsx("span", { children: "Remove context" })] }) })] })] }) }));
|
|
@@ -145,7 +144,7 @@ function PreviousScopedChatsHint({ scope, threads, onSelectThread, }) {
|
|
|
145
144
|
* just happened and learn where the chat went (History popover).
|
|
146
145
|
*/
|
|
147
146
|
function DetachConfirmationBanner() {
|
|
148
|
-
return (_jsx("div", { className: "flex items-
|
|
147
|
+
return (_jsx("div", { className: "agent-scope-badge-wrapper relative z-[1] -mb-2 flex shrink-0 items-end justify-center px-3 pt-1 text-[11px] text-muted-foreground", children: _jsxs("span", { className: "inline-flex h-7 min-w-0 max-w-full items-center gap-1.5 rounded-t-lg border border-b-0 border-input bg-background px-3 text-foreground shadow-[0_-8px_24px_hsl(var(--background)/0.72)] sm:max-w-80", children: [_jsx(IconCheck, { size: 11, className: "shrink-0 opacity-80" }), _jsx("span", { className: "min-w-0 truncate", children: "Context removed. Find this chat in History." })] }) }));
|
|
149
148
|
}
|
|
150
149
|
// ─── History Popover ─────────────────────────────────────────────────────────
|
|
151
150
|
function formatThreadTime(ts) {
|
|
@@ -1153,29 +1152,12 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
1153
1152
|
if (id) {
|
|
1154
1153
|
newThreadIds.current.add(id);
|
|
1155
1154
|
}
|
|
1155
|
+
return id;
|
|
1156
1156
|
}, [createThread]);
|
|
1157
|
-
const
|
|
1157
|
+
const cleanupClosedTab = useCallback((tabId) => {
|
|
1158
1158
|
if (parentMapRef.current[tabId]) {
|
|
1159
1159
|
dismissedSubAgentTabsRef.current.add(tabId);
|
|
1160
1160
|
}
|
|
1161
|
-
setOpenTabIds((prev) => {
|
|
1162
|
-
if (prev.length <= 1) {
|
|
1163
|
-
// Last tab — create a new one and replace the old tab atomically
|
|
1164
|
-
createThread().then((newId) => {
|
|
1165
|
-
if (newId) {
|
|
1166
|
-
newThreadIds.current.add(newId);
|
|
1167
|
-
setOpenTabIds([newId]);
|
|
1168
|
-
}
|
|
1169
|
-
});
|
|
1170
|
-
return prev; // Keep old tab until new one is ready
|
|
1171
|
-
}
|
|
1172
|
-
const next = prev.filter((id) => id !== tabId);
|
|
1173
|
-
if (tabId === activeThreadIdRef.current && next.length > 0) {
|
|
1174
|
-
const idx = prev.indexOf(tabId);
|
|
1175
|
-
switchThread(next[Math.min(idx, next.length - 1)]);
|
|
1176
|
-
}
|
|
1177
|
-
return next;
|
|
1178
|
-
});
|
|
1179
1161
|
chatRefs.current.delete(tabId);
|
|
1180
1162
|
pendingSends.current.delete(tabId);
|
|
1181
1163
|
pendingContextItems.current.delete(tabId);
|
|
@@ -1200,7 +1182,28 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
1200
1182
|
const { [tabId]: _, ...rest } = prev;
|
|
1201
1183
|
return rest;
|
|
1202
1184
|
});
|
|
1203
|
-
}, [
|
|
1185
|
+
}, []);
|
|
1186
|
+
const closeTab = useCallback((tabId) => {
|
|
1187
|
+
setOpenTabIds((prev) => {
|
|
1188
|
+
if (prev.length <= 1) {
|
|
1189
|
+
// Last tab — create a new one and replace the old tab atomically
|
|
1190
|
+
createThread().then((newId) => {
|
|
1191
|
+
if (newId) {
|
|
1192
|
+
newThreadIds.current.add(newId);
|
|
1193
|
+
setOpenTabIds([newId]);
|
|
1194
|
+
}
|
|
1195
|
+
});
|
|
1196
|
+
return prev; // Keep old tab until new one is ready
|
|
1197
|
+
}
|
|
1198
|
+
const next = prev.filter((id) => id !== tabId);
|
|
1199
|
+
if (tabId === activeThreadIdRef.current && next.length > 0) {
|
|
1200
|
+
const idx = prev.indexOf(tabId);
|
|
1201
|
+
switchThread(next[Math.min(idx, next.length - 1)]);
|
|
1202
|
+
}
|
|
1203
|
+
return next;
|
|
1204
|
+
});
|
|
1205
|
+
cleanupClosedTab(tabId);
|
|
1206
|
+
}, [switchThread, createThread, cleanupClosedTab]);
|
|
1204
1207
|
const closeOtherTabs = useCallback((tabId) => {
|
|
1205
1208
|
for (const id of openTabIdsRef.current) {
|
|
1206
1209
|
if (id !== tabId && parentMapRef.current[id]) {
|
|
@@ -1296,8 +1299,17 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
1296
1299
|
return () => window.removeEventListener("agent-chat:open-thread", handleOpenThread);
|
|
1297
1300
|
}, [switchThread]);
|
|
1298
1301
|
const clearActiveTab = useCallback(() => {
|
|
1299
|
-
|
|
1300
|
-
|
|
1302
|
+
const tabIdToClear = activeThreadIdRef.current;
|
|
1303
|
+
void addTab().then((newTabId) => {
|
|
1304
|
+
if (!tabIdToClear || !newTabId || tabIdToClear === newTabId)
|
|
1305
|
+
return;
|
|
1306
|
+
setOpenTabIds((prev) => {
|
|
1307
|
+
const next = prev.filter((id) => id !== tabIdToClear);
|
|
1308
|
+
return next.includes(newTabId) ? next : [...next, newTabId];
|
|
1309
|
+
});
|
|
1310
|
+
cleanupClosedTab(tabIdToClear);
|
|
1311
|
+
});
|
|
1312
|
+
}, [addTab, cleanupClosedTab]);
|
|
1301
1313
|
const openFromHistory = useCallback((threadId) => {
|
|
1302
1314
|
if (!openTabIds.includes(threadId)) {
|
|
1303
1315
|
setOpenTabIds((prev) => [...prev, threadId]);
|
|
@@ -1567,8 +1579,7 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
1567
1579
|
background: "linear-gradient(to right, transparent, hsl(var(--accent)) 40%)",
|
|
1568
1580
|
}, children: _jsx(IconX, { size: 12 }) })] }, tab.id)))] }) }))] }));
|
|
1569
1581
|
})()
|
|
1570
|
-
: null, _jsxs("div", { className: "relative flex-1 flex flex-col min-h-0", children: [renderOverlay ? renderOverlay(headerProps) : null,
|
|
1571
|
-
(activeThreadScope && activeThreadId ? (_jsx(ScopeBadge, { scope: activeThreadScope, currentScope: scope, onDetach: handleDetachActiveThread, otherScopedThreads: otherScopedThreads, activeThreadId: activeThreadId, openTabIds: new Set(openTabIds), onSelectThread: openFromHistory })) : detachConfirmType ? (_jsx(DetachConfirmationBanner, {})) : null), showHistory && (_jsx(HistoryPopover, { threads: threads, openTabIds: new Set(openTabIds), activeThreadId: activeThreadId, currentScope: scope, onSelect: openFromHistory, onClose: () => setShowHistory(false), onSearch: searchThreads })), helpVisible && _jsx(HelpPopover, { onClose: () => setHelpVisible(false) }), [...new Set(visibleOpenTabIds)]
|
|
1582
|
+
: null, _jsxs("div", { className: "relative flex-1 flex flex-col min-h-0", children: [renderOverlay ? renderOverlay(headerProps) : null, showHistory && (_jsx(HistoryPopover, { threads: threads, openTabIds: new Set(openTabIds), activeThreadId: activeThreadId, currentScope: scope, onSelect: openFromHistory, onClose: () => setShowHistory(false), onSearch: searchThreads })), helpVisible && _jsx(HelpPopover, { onClose: () => setHelpVisible(false) }), [...new Set(visibleOpenTabIds)]
|
|
1572
1583
|
.filter((tabId) => tabId === activeThreadId || mountedTabsRef.current.has(tabId))
|
|
1573
1584
|
.map((tabId) => {
|
|
1574
1585
|
const modelSelection = resolveThreadModelSelection(tabId);
|
|
@@ -1578,6 +1589,8 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
1578
1589
|
const tabDynamicSuggestions = tabId === activeThreadId && !contentHidden
|
|
1579
1590
|
? props.dynamicSuggestions
|
|
1580
1591
|
: false;
|
|
1592
|
+
const scopeComposerSlot = tabId === activeThreadId && !contentHidden ? (tabScope && activeThreadId ? (_jsx(ScopeBadge, { scope: tabScope, currentScope: scope, onDetach: handleDetachActiveThread, otherScopedThreads: otherScopedThreads, activeThreadId: activeThreadId, openTabIds: new Set(openTabIds), onSelectThread: openFromHistory })) : detachConfirmType ? (_jsx(DetachConfirmationBanner, {})) : null) : null;
|
|
1593
|
+
const composerSlot = scopeComposerSlot || props.composerSlot ? (_jsxs(_Fragment, { children: [props.composerSlot, scopeComposerSlot] })) : undefined;
|
|
1581
1594
|
return (_jsxs("div", { className: "flex-1 min-h-0 flex-col", style: {
|
|
1582
1595
|
display: contentHidden || tabId !== activeThreadId ? "none" : "flex",
|
|
1583
1596
|
}, children: [_jsx(RunStuckBanner, { threadId: tabId, apiUrl: apiUrl, onRetry: () => {
|
|
@@ -1596,7 +1609,7 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
1596
1609
|
}
|
|
1597
1610
|
}, threadId: tabId, tabId: tabId, browserTabId: browserTabId, contextScope: tabScope, isActiveComposer: tabId === activeThreadId, apiUrl: apiUrl, isNewThread: newThreadIds.current.has(tabId) || isNewThread(tabId), onMessageCountChange: (count) => setMessageCounts((prev) => prev[tabId] === count
|
|
1598
1611
|
? prev
|
|
1599
|
-
: { ...prev, [tabId]: count }), onSaveThread: handleSaveThread, onGenerateTitle: handleGenerateTitle, onSlashCommand: handleSlashCommand, selectedModel: modelSelection?.model, selectedEngine: modelSelection?.engine, selectedEffort: modelSelection?.effort ?? "auto", defaultModel: defaultModel, availableModels: availableModels, onModelChange: handleModelChange, onEffortChange: handleEffortChange, onForkChat: () => handleForkChat(tabId),
|
|
1612
|
+
: { ...prev, [tabId]: count }), onSaveThread: handleSaveThread, onGenerateTitle: handleGenerateTitle, onSlashCommand: handleSlashCommand, selectedModel: modelSelection?.model, selectedEngine: modelSelection?.engine, selectedEffort: modelSelection?.effort ?? "auto", composerSlot: composerSlot, defaultModel: defaultModel, availableModels: availableModels, onModelChange: handleModelChange, onEffortChange: handleEffortChange, onForkChat: () => handleForkChat(tabId),
|
|
1600
1613
|
// Sub-agent tabs are read-only: sending a new message from the
|
|
1601
1614
|
// sub-agent tab would start a fresh run on that thread and kill
|
|
1602
1615
|
// the in-flight team chunk. Disable the composer and show a
|