@agent-native/core 0.18.0 → 0.19.0
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/README.md +1 -11
- package/dist/a2a/client.d.ts +7 -0
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +3 -0
- package/dist/a2a/client.js.map +1 -1
- package/dist/cli/connect.d.ts +94 -0
- package/dist/cli/connect.d.ts.map +1 -0
- package/dist/cli/connect.js +443 -0
- package/dist/cli/connect.js.map +1 -0
- package/dist/cli/index.js +16 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp-config-writers.d.ts +71 -0
- package/dist/cli/mcp-config-writers.d.ts.map +1 -0
- package/dist/cli/mcp-config-writers.js +210 -0
- package/dist/cli/mcp-config-writers.js.map +1 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +11 -63
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/composer/PromptComposer.d.ts +6 -1
- package/dist/client/composer/PromptComposer.d.ts.map +1 -1
- package/dist/client/composer/PromptComposer.js +5 -4
- package/dist/client/composer/PromptComposer.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +6 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +20 -10
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/conversation/AgentConversation.d.ts +18 -0
- package/dist/client/conversation/AgentConversation.d.ts.map +1 -0
- package/dist/client/conversation/AgentConversation.js +94 -0
- package/dist/client/conversation/AgentConversation.js.map +1 -0
- package/dist/client/conversation/AgentConversation.spec.d.ts +2 -0
- package/dist/client/conversation/AgentConversation.spec.d.ts.map +1 -0
- package/dist/client/conversation/AgentConversation.spec.js +69 -0
- package/dist/client/conversation/AgentConversation.spec.js.map +1 -0
- package/dist/client/conversation/index.d.ts +4 -0
- package/dist/client/conversation/index.d.ts.map +1 -0
- package/dist/client/conversation/index.js +3 -0
- package/dist/client/conversation/index.js.map +1 -0
- package/dist/client/conversation/types.d.ts +54 -0
- package/dist/client/conversation/types.d.ts.map +1 -0
- package/dist/client/conversation/types.js +2 -0
- package/dist/client/conversation/types.js.map +1 -0
- package/dist/client/conversation/use-near-bottom-autoscroll.d.ts +15 -0
- package/dist/client/conversation/use-near-bottom-autoscroll.d.ts.map +1 -0
- package/dist/client/conversation/use-near-bottom-autoscroll.js +66 -0
- package/dist/client/conversation/use-near-bottom-autoscroll.js.map +1 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/resources/ResourceTree.d.ts.map +1 -1
- package/dist/client/resources/ResourceTree.js +2 -2
- package/dist/client/resources/ResourceTree.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +4 -28
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/code-agents/index.d.ts +1 -0
- package/dist/code-agents/index.d.ts.map +1 -1
- package/dist/code-agents/index.js +1 -0
- package/dist/code-agents/index.js.map +1 -1
- package/dist/code-agents/transcript-normalizer.d.ts +50 -0
- package/dist/code-agents/transcript-normalizer.d.ts.map +1 -0
- package/dist/code-agents/transcript-normalizer.js +356 -0
- package/dist/code-agents/transcript-normalizer.js.map +1 -0
- package/dist/extensions/schema.d.ts +1 -1
- package/dist/mcp/build-server.d.ts +20 -3
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +120 -15
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/mcp/builtin-tools.d.ts +8 -1
- package/dist/mcp/builtin-tools.d.ts.map +1 -1
- package/dist/mcp/builtin-tools.js +115 -13
- package/dist/mcp/builtin-tools.js.map +1 -1
- package/dist/mcp/connect-route.d.ts +43 -0
- package/dist/mcp/connect-route.d.ts.map +1 -0
- package/dist/mcp/connect-route.js +638 -0
- package/dist/mcp/connect-route.js.map +1 -0
- package/dist/mcp/connect-store.d.ts +132 -0
- package/dist/mcp/connect-store.d.ts.map +1 -0
- package/dist/mcp/connect-store.js +434 -0
- package/dist/mcp/connect-store.js.map +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +23 -4
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/stdio.d.ts.map +1 -1
- package/dist/mcp/stdio.js +1 -0
- package/dist/mcp/stdio.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +1 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/auth.d.ts +17 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +192 -49
- package/dist/server/auth.js.map +1 -1
- package/dist/server/better-auth-instance.d.ts +43 -0
- package/dist/server/better-auth-instance.d.ts.map +1 -1
- package/dist/server/better-auth-instance.js +25 -0
- package/dist/server/better-auth-instance.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts +12 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +42 -0
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/identity-sso-store.d.ts +86 -0
- package/dist/server/identity-sso-store.d.ts.map +1 -0
- package/dist/server/identity-sso-store.js +243 -0
- package/dist/server/identity-sso-store.js.map +1 -0
- package/dist/server/identity-sso.d.ts +78 -0
- package/dist/server/identity-sso.d.ts.map +1 -0
- package/dist/server/identity-sso.js +425 -0
- package/dist/server/identity-sso.js.map +1 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +2 -1
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/open-route.d.ts.map +1 -1
- package/dist/server/open-route.js +36 -5
- package/dist/server/open-route.js.map +1 -1
- package/dist/server/request-context.d.ts +8 -0
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/request-context.js.map +1 -1
- package/dist/sharing/schema.d.ts +1 -1
- package/docs/content/code-agents-ui.md +14 -3
- package/docs/content/cross-app-sso.md +118 -0
- package/docs/content/external-agents.md +130 -51
- package/docs/content/migration-workbench.md +1 -1
- package/package.json +2 -1
|
@@ -10,6 +10,7 @@ import { getActiveRun } from "./active-run-state.js";
|
|
|
10
10
|
import { AgentAutoContinueSignal, readSSEStreamRaw, } from "./sse-event-processor.js";
|
|
11
11
|
import { captureError } from "./analytics.js";
|
|
12
12
|
import { cn } from "./utils.js";
|
|
13
|
+
import { useNearBottomAutoscroll } from "./conversation/index.js";
|
|
13
14
|
import { TextAttachmentAdapter } from "./composer/attachment-accept.js";
|
|
14
15
|
import { AgentTaskCard } from "./AgentTaskCard.js";
|
|
15
16
|
import { ConnectBuilderCard } from "./ConnectBuilderCard.js";
|
|
@@ -1713,7 +1714,6 @@ function ensureMessageMetadata(repo) {
|
|
|
1713
1714
|
import { extractThreadMeta, normalizeThreadRepository, } from "../agent/thread-data-builder.js";
|
|
1714
1715
|
export { extractThreadMeta };
|
|
1715
1716
|
const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateText, suggestions, emptyStateAddon, showHeader = true, onSwitchToCli, className, apiUrl, tabId, threadId, onMessageCountChange, onSaveThread, onGenerateTitle, composerSlot, composerDisabled = false, composerDisabledPlaceholder, isNewThread, onSlashCommand, execMode, onExecModeChange, planModeDisabled, planModeDisabledReason, selectedModel, defaultModel, selectedEngine, selectedEffort, availableModels, onModelChange, onEffortChange, onForkChat, }, ref) {
|
|
1716
|
-
const scrollRef = useRef(null);
|
|
1717
1717
|
const thread = useThread();
|
|
1718
1718
|
const threadRuntime = useThreadRuntime();
|
|
1719
1719
|
const composerRuntime = useComposerRuntime();
|
|
@@ -2552,7 +2552,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2552
2552
|
setForceStopped(false);
|
|
2553
2553
|
}
|
|
2554
2554
|
}, [isReconnecting, forceStopped]);
|
|
2555
|
-
const addToQueue = useCallback(async (text, images, references, attachments, requestMode) => {
|
|
2555
|
+
const addToQueue = useCallback(async (text, images, references, attachments, requestMode, intent = "queued") => {
|
|
2556
2556
|
setShowContinue(false);
|
|
2557
2557
|
setLoopLimitInfo(null);
|
|
2558
2558
|
setRunErrorInfo(null);
|
|
@@ -2568,8 +2568,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2568
2568
|
// user had scrolled up to read history. The sticky-bottom override
|
|
2569
2569
|
// exists to stop streaming from yanking the viewport, not to swallow
|
|
2570
2570
|
// direct sends.
|
|
2571
|
-
|
|
2572
|
-
setShowScrollToBottom(false);
|
|
2571
|
+
markNearBottom();
|
|
2573
2572
|
const queuedAttachments = await serializeQueuedAttachments(attachments);
|
|
2574
2573
|
// Snapshot the exec mode at enqueue time when the caller didn't
|
|
2575
2574
|
// pass an explicit override. Without this, a plan-mode message that
|
|
@@ -2581,7 +2580,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2581
2580
|
: execMode === "build"
|
|
2582
2581
|
? "act"
|
|
2583
2582
|
: undefined);
|
|
2584
|
-
if (isRunning) {
|
|
2583
|
+
if (isRunning && intent === "queued") {
|
|
2585
2584
|
setQueuedMessages((prev) => [
|
|
2586
2585
|
...prev,
|
|
2587
2586
|
{
|
|
@@ -2640,40 +2639,10 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2640
2639
|
};
|
|
2641
2640
|
},
|
|
2642
2641
|
}), [addToQueue, messages.length, thread.isRunning, threadRuntime]);
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
const el = scrollRef.current;
|
|
2648
|
-
if (!el)
|
|
2649
|
-
return;
|
|
2650
|
-
function onScroll() {
|
|
2651
|
-
if (!el)
|
|
2652
|
-
return;
|
|
2653
|
-
const threshold = 40;
|
|
2654
|
-
const nearBottom = el.scrollHeight - el.scrollTop - el.clientHeight < threshold;
|
|
2655
|
-
isNearBottomRef.current = nearBottom;
|
|
2656
|
-
setShowScrollToBottom(!nearBottom && messages.length > 0);
|
|
2657
|
-
}
|
|
2658
|
-
el.addEventListener("scroll", onScroll, { passive: true });
|
|
2659
|
-
return () => el.removeEventListener("scroll", onScroll);
|
|
2660
|
-
}, [messages.length]);
|
|
2661
|
-
const scrollToBottom = useCallback(() => {
|
|
2662
|
-
const el = scrollRef.current;
|
|
2663
|
-
if (el) {
|
|
2664
|
-
el.scrollTop = el.scrollHeight;
|
|
2665
|
-
isNearBottomRef.current = true;
|
|
2666
|
-
setShowScrollToBottom(false);
|
|
2667
|
-
}
|
|
2668
|
-
}, []);
|
|
2669
|
-
const scrollToBottomAfterPaint = useCallback(() => {
|
|
2670
|
-
scrollToBottom();
|
|
2671
|
-
requestAnimationFrame(() => {
|
|
2672
|
-
scrollToBottom();
|
|
2673
|
-
requestAnimationFrame(scrollToBottom);
|
|
2674
|
-
});
|
|
2675
|
-
setTimeout(scrollToBottom, 80);
|
|
2676
|
-
}, [scrollToBottom]);
|
|
2642
|
+
const { scrollRef, isNearBottomRef, showScrollToBottom, markNearBottom, scrollToBottom, scrollToBottomAfterPaint, } = useNearBottomAutoscroll({
|
|
2643
|
+
followKey: [messages, queuedMessages],
|
|
2644
|
+
streaming: isRunning,
|
|
2645
|
+
});
|
|
2677
2646
|
const scrollToBottomWhileLayoutSettles = useCallback(() => {
|
|
2678
2647
|
scrollToBottomAfterPaint();
|
|
2679
2648
|
const el = scrollRef.current;
|
|
@@ -2705,32 +2674,11 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2705
2674
|
return scrollToBottomWhileLayoutSettles();
|
|
2706
2675
|
}
|
|
2707
2676
|
}, [isRestoring, scrollToBottomWhileLayoutSettles]);
|
|
2708
|
-
// Auto-scroll on new messages or queued messages (only if near bottom)
|
|
2709
|
-
useEffect(() => {
|
|
2710
|
-
const el = scrollRef.current;
|
|
2711
|
-
if (el && isNearBottomRef.current) {
|
|
2712
|
-
scrollToBottomAfterPaint();
|
|
2713
|
-
}
|
|
2714
|
-
}, [messages, queuedMessages, scrollToBottomAfterPaint]);
|
|
2715
2677
|
useEffect(() => {
|
|
2716
2678
|
if (!isRunning && isNearBottomRef.current) {
|
|
2717
2679
|
scrollToBottomAfterPaint();
|
|
2718
2680
|
}
|
|
2719
2681
|
}, [isRunning, scrollToBottomAfterPaint]);
|
|
2720
|
-
// Continuous auto-scroll while streaming (only if near bottom)
|
|
2721
|
-
useEffect(() => {
|
|
2722
|
-
if (!isRunning)
|
|
2723
|
-
return;
|
|
2724
|
-
const el = scrollRef.current;
|
|
2725
|
-
if (!el)
|
|
2726
|
-
return;
|
|
2727
|
-
const interval = setInterval(() => {
|
|
2728
|
-
if (isNearBottomRef.current) {
|
|
2729
|
-
el.scrollTop = el.scrollHeight;
|
|
2730
|
-
}
|
|
2731
|
-
}, 100);
|
|
2732
|
-
return () => clearInterval(interval);
|
|
2733
|
-
}, [isRunning]);
|
|
2734
2682
|
const { isDevMode: cpDevMode } = useDevMode(apiUrl);
|
|
2735
2683
|
const checkpointCtx = useMemo(() => ({ apiUrl, devMode: cpDevMode, threadId }), [apiUrl, cpDevMode, threadId]);
|
|
2736
2684
|
const messageActionsCtx = useMemo(() => ({ onForkChat }), [onForkChat]);
|
|
@@ -2852,10 +2800,10 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2852
2800
|
"Open Desktop to use this chat.")
|
|
2853
2801
|
: isRunning
|
|
2854
2802
|
? queuedMessages.length > 0
|
|
2855
|
-
? `${queuedMessages.length} queued —
|
|
2856
|
-
: "
|
|
2803
|
+
? `${queuedMessages.length} queued — send a follow-up...`
|
|
2804
|
+
: "Send a follow-up..."
|
|
2857
2805
|
: undefined, onSubmit: isRunning
|
|
2858
|
-
? (text, references, attachments) => void addToQueue(text, undefined, references.length > 0 ? references : undefined, attachments)
|
|
2806
|
+
? (text, references, attachments, options) => void addToQueue(text, undefined, references.length > 0 ? references : undefined, attachments, undefined, options?.intent ?? "immediate")
|
|
2859
2807
|
: undefined, onSlashCommand: onSlashCommand, execMode: execMode, onExecModeChange: onExecModeChange, planModeDisabled: planModeDisabled, planModeDisabledReason: planModeDisabledReason, selectedModel: selectedModel ?? defaultModel, selectedEffort: selectedEffort, availableModels: availableModels, onModelChange: onModelChange, onEffortChange: onEffortChange, draftScope: threadId || tabId, interceptBuildRequestsForBuilder: true, extraActionButton: showRunningInUI ? (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => {
|
|
2860
2808
|
// Nuclear stop: flip forceStopped so isRunning is false
|
|
2861
2809
|
// immediately. This unblocks submission even if the
|