@agent-native/core 0.7.54 → 0.7.56

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.
Files changed (60) hide show
  1. package/dist/a2a/artifact-response.d.ts +1 -0
  2. package/dist/a2a/artifact-response.d.ts.map +1 -1
  3. package/dist/a2a/artifact-response.js +111 -13
  4. package/dist/a2a/artifact-response.js.map +1 -1
  5. package/dist/a2a/task-store.d.ts +1 -0
  6. package/dist/a2a/task-store.d.ts.map +1 -1
  7. package/dist/a2a/task-store.js +15 -0
  8. package/dist/a2a/task-store.js.map +1 -1
  9. package/dist/cli/templates-meta.js +1 -1
  10. package/dist/cli/templates-meta.js.map +1 -1
  11. package/dist/client/AssistantChat.d.ts +15 -0
  12. package/dist/client/AssistantChat.d.ts.map +1 -1
  13. package/dist/client/AssistantChat.js +55 -52
  14. package/dist/client/AssistantChat.js.map +1 -1
  15. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  16. package/dist/client/MultiTabAssistantChat.js +0 -13
  17. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  18. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  19. package/dist/client/composer/TiptapComposer.js +59 -19
  20. package/dist/client/composer/TiptapComposer.js.map +1 -1
  21. package/dist/client/composer/useVoiceDictation.d.ts +8 -3
  22. package/dist/client/composer/useVoiceDictation.d.ts.map +1 -1
  23. package/dist/client/composer/useVoiceDictation.js +278 -22
  24. package/dist/client/composer/useVoiceDictation.js.map +1 -1
  25. package/dist/client/index.d.ts +1 -0
  26. package/dist/client/index.d.ts.map +1 -1
  27. package/dist/client/index.js +1 -0
  28. package/dist/client/index.js.map +1 -1
  29. package/dist/client/resources/ResourcesPanel.js +2 -2
  30. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  31. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  32. package/dist/client/settings/SettingsPanel.js +7 -5
  33. package/dist/client/settings/SettingsPanel.js.map +1 -1
  34. package/dist/client/settings/VoiceTranscriptionSection.d.ts +4 -2
  35. package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -1
  36. package/dist/client/settings/VoiceTranscriptionSection.js +164 -60
  37. package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
  38. package/dist/client/use-chat-models.d.ts +33 -0
  39. package/dist/client/use-chat-models.d.ts.map +1 -0
  40. package/dist/client/use-chat-models.js +183 -0
  41. package/dist/client/use-chat-models.js.map +1 -0
  42. package/dist/integrations/a2a-continuation-processor.js +29 -15
  43. package/dist/integrations/a2a-continuation-processor.js.map +1 -1
  44. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  45. package/dist/server/agent-chat-plugin.js +22 -1
  46. package/dist/server/agent-chat-plugin.js.map +1 -1
  47. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  48. package/dist/server/core-routes-plugin.js +6 -0
  49. package/dist/server/core-routes-plugin.js.map +1 -1
  50. package/dist/server/google-realtime-session.d.ts +14 -0
  51. package/dist/server/google-realtime-session.d.ts.map +1 -0
  52. package/dist/server/google-realtime-session.js +155 -0
  53. package/dist/server/google-realtime-session.js.map +1 -0
  54. package/dist/server/voice-providers-status.d.ts +7 -0
  55. package/dist/server/voice-providers-status.d.ts.map +1 -1
  56. package/dist/server/voice-providers-status.js +14 -1
  57. package/dist/server/voice-providers-status.js.map +1 -1
  58. package/docs/content/sharing.md +155 -0
  59. package/docs/content/template-clips.md +8 -5
  60. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantChat.d.ts","sourceRoot":"","sources":["../../src/client/AssistantChat.tsx"],"names":[],"mappings":"AACA,OAAO,KAQN,MAAM,OAAO,CAAC;AA6Bf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAk5DrE,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,6DAA6D;IAC7D,YAAY,CAAC,IAA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,MAAM,QAI9C;AAyBD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AA8nC7B,eAAO,MAAM,aAAa,gGA4DxB,CAAC"}
@@ -996,7 +996,7 @@ function ensureMessageMetadata(repo) {
996
996
  // Re-export for backwards compatibility
997
997
  import { extractThreadMeta } from "../agent/thread-data-builder.js";
998
998
  export { extractThreadMeta };
999
- const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateText, suggestions, showHeader = true, onSwitchToCli, className, apiUrl, tabId, threadId, onMessageCountChange, onSaveThread, onGenerateTitle, composerSlot, isNewThread, onSlashCommand, execMode, onExecModeChange, selectedModel, defaultModel, selectedEngine, selectedEffort, availableModels, onModelChange, onEffortChange, onForkChat, }, ref) {
999
+ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateText, suggestions, showHeader = true, onSwitchToCli, className, apiUrl, tabId, threadId, onMessageCountChange, onSaveThread, onGenerateTitle, composerSlot, isNewThread, onSlashCommand, execMode, onExecModeChange, selectedModel, defaultModel, selectedEngine, selectedEffort, availableModels, onModelChange, onEffortChange, onForkChat, composerOnly, onSubmitOverride, composerPlaceholder, }, ref) {
1000
1000
  const scrollRef = useRef(null);
1001
1001
  const thread = useThread();
1002
1002
  const threadRuntime = useThreadRuntime();
@@ -1665,60 +1665,63 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1665
1665
  const shouldShowRunError = !!visibleRunError &&
1666
1666
  !showRunningInUI &&
1667
1667
  visibleRunErrorKey !== dismissedRunErrorKey;
1668
- return (_jsx(CheckpointContext.Provider, { value: checkpointCtx, children: _jsx(MessageActionsContext.Provider, { value: messageActionsCtx, children: _jsx(ChatRunningContext.Provider, { value: isRunning, children: _jsxs("div", { className: cn("flex flex-1 flex-col h-full min-h-0 text-foreground", className), children: [showHeader && (_jsxs("div", { className: "flex h-11 shrink-0 items-center justify-between border-b border-border px-4", children: [_jsx("span", { className: "text-[13px] font-medium text-muted-foreground", children: "Agent" }), _jsx("div", { className: "flex items-center gap-1", children: onSwitchToCli && (_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { onClick: onSwitchToCli, "aria-label": "Switch to CLI", className: "flex items-center gap-1 text-[12px] text-muted-foreground hover:text-foreground px-2 py-1 rounded-md hover:bg-accent", children: [_jsx(IconTerminal, { className: "h-3.5 w-3.5" }), "CLI"] }) }), _jsx(TooltipContent, { children: "Switch to CLI" })] }) })) })] })), _jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto overflow-x-hidden min-h-0", children: authError ? (_jsxs("div", { className: "flex flex-col items-center justify-center h-full px-4 gap-3", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-destructive/10", children: _jsx(IconLock, { className: "h-5 w-5 text-destructive" }) }), _jsxs("div", { className: "text-center max-w-[280px]", children: [_jsx("p", { className: "text-sm font-medium text-foreground mb-1", children: authError.sessionExpired
1669
- ? "Session expired"
1670
- : "Authentication required" }), _jsx("p", { className: "text-xs text-muted-foreground leading-relaxed", children: authError.sessionExpired ? ("Your session may have expired. Log out and log back in to reconnect.") : (_jsxs(_Fragment, { children: ["You need to log in to use the agent. If you're running locally, add", " ", _jsx("code", { className: "bg-muted px-1 py-0.5 rounded text-[10px]", children: "AUTH_MODE=local" }), " ", "to your", " ", _jsx("code", { className: "bg-muted px-1 py-0.5 rounded text-[10px]", children: ".env" }), " ", "file and restart the dev server."] })) })] }), _jsxs("div", { className: "flex gap-2", children: [authError.sessionExpired && (_jsx("button", { onClick: async () => {
1671
- try {
1672
- await fetch(agentNativePath("/_agent-native/auth/logout"), {
1673
- method: "POST",
1668
+ return (_jsx(CheckpointContext.Provider, { value: checkpointCtx, children: _jsx(MessageActionsContext.Provider, { value: messageActionsCtx, children: _jsx(ChatRunningContext.Provider, { value: isRunning, children: _jsxs("div", { className: cn("flex flex-1 flex-col h-full min-h-0 text-foreground", className), children: [showHeader && (_jsxs("div", { className: "flex h-11 shrink-0 items-center justify-between border-b border-border px-4", children: [_jsx("span", { className: "text-[13px] font-medium text-muted-foreground", children: "Agent" }), _jsx("div", { className: "flex items-center gap-1", children: onSwitchToCli && (_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { onClick: onSwitchToCli, "aria-label": "Switch to CLI", className: "flex items-center gap-1 text-[12px] text-muted-foreground hover:text-foreground px-2 py-1 rounded-md hover:bg-accent", children: [_jsx(IconTerminal, { className: "h-3.5 w-3.5" }), "CLI"] }) }), _jsx(TooltipContent, { children: "Switch to CLI" })] }) })) })] })), composerOnly ? null : (_jsxs(_Fragment, { children: [_jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto overflow-x-hidden min-h-0", children: authError ? (_jsxs("div", { className: "flex flex-col items-center justify-center h-full px-4 gap-3", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-destructive/10", children: _jsx(IconLock, { className: "h-5 w-5 text-destructive" }) }), _jsxs("div", { className: "text-center max-w-[280px]", children: [_jsx("p", { className: "text-sm font-medium text-foreground mb-1", children: authError.sessionExpired
1669
+ ? "Session expired"
1670
+ : "Authentication required" }), _jsx("p", { className: "text-xs text-muted-foreground leading-relaxed", children: authError.sessionExpired ? ("Your session may have expired. Log out and log back in to reconnect.") : (_jsxs(_Fragment, { children: ["You need to log in to use the agent. If you're running locally, add", " ", _jsx("code", { className: "bg-muted px-1 py-0.5 rounded text-[10px]", children: "AUTH_MODE=local" }), " ", "to your", " ", _jsx("code", { className: "bg-muted px-1 py-0.5 rounded text-[10px]", children: ".env" }), " ", "file and restart the dev server."] })) })] }), _jsxs("div", { className: "flex gap-2", children: [authError.sessionExpired && (_jsx("button", { onClick: async () => {
1671
+ try {
1672
+ await fetch(agentNativePath("/_agent-native/auth/logout"), {
1673
+ method: "POST",
1674
+ });
1675
+ }
1676
+ catch { }
1677
+ window.location.reload();
1678
+ }, className: "text-xs text-destructive hover:text-destructive/80 px-3 py-1.5 rounded-md border border-destructive/30 hover:bg-destructive/10", children: "Log out" })), _jsx("button", { onClick: () => {
1679
+ setAuthError(null);
1680
+ window.location.reload();
1681
+ }, className: "text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md border border-border hover:bg-accent", children: "Retry" })] })] })) : missingApiKey ? (_jsx("div", { className: "flex flex-col items-center justify-center h-full px-2", children: _jsx(ApiKeySetupCard, { apiUrl: apiUrl }) })) : isRestoring ? (_jsxs("div", { className: "flex flex-col gap-3 p-4", children: [_jsx("div", { className: "flex justify-end", children: _jsx("div", { className: "h-8 w-32 rounded-lg bg-muted animate-pulse" }) }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("div", { className: "h-4 w-48 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-4 w-64 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-4 w-40 rounded bg-muted animate-pulse" })] })] })) : messages.length === 0 && !isReconnecting ? (_jsxs("div", { className: "flex flex-col items-center justify-center gap-4 py-16 px-4 h-full", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-muted", children: _jsx(IconMessage, { className: "h-5 w-5 text-muted-foreground" }) }), _jsx("p", { className: "text-sm text-muted-foreground text-center max-w-[240px]", children: emptyStateText ?? "How can I help you?" }), suggestions && suggestions.length > 0 && (_jsx("div", { className: "flex flex-col gap-1.5 w-full max-w-[280px]", children: suggestions.map((suggestion) => (_jsx("button", { onClick: () => {
1682
+ threadRuntime.append({
1683
+ role: "user",
1684
+ content: [{ type: "text", text: suggestion }],
1674
1685
  });
1686
+ }, className: "w-full rounded-lg border border-border px-3 py-2 text-left text-[13px] text-muted-foreground hover:bg-accent hover:text-foreground", children: suggestion }, suggestion))) }))] })) : (_jsxs("div", { className: "agent-thread-content flex flex-col gap-4 px-4 py-4", children: [_jsx(ThreadPrimitive.Messages, { components: {
1687
+ UserMessage,
1688
+ AssistantMessage,
1689
+ } }), visibleLoopLimit && !showRunningInUI && (_jsx(LoopLimitContinueCard, { info: visibleLoopLimit, onContinue: () => {
1690
+ setShowContinue(false);
1691
+ setLoopLimitInfo(null);
1692
+ addToQueue("Continue from where you left off.");
1693
+ } })), shouldShowRunError && visibleRunError && (_jsx(RunErrorRecoveryCard, { info: visibleRunError, onContinue: () => {
1694
+ setRunErrorInfo(null);
1695
+ addToQueue("Continue from where you stopped. Use the partial work above, verify what succeeded, and finish the original request. Prefer dedicated app actions over raw database edits when they exist.");
1696
+ }, onRetry: () => {
1697
+ setRunErrorInfo(null);
1698
+ addToQueue(lastUserText
1699
+ ? `Retry the previous request from a clean approach. Original request:\n\n${lastUserText}`
1700
+ : "Retry the previous request from a clean approach.");
1701
+ }, onFork: onForkChat, onDismiss: () => {
1702
+ if (visibleRunErrorKey) {
1703
+ setDismissedRunErrorKey(visibleRunErrorKey);
1675
1704
  }
1676
- catch { }
1677
- window.location.reload();
1678
- }, className: "text-xs text-destructive hover:text-destructive/80 px-3 py-1.5 rounded-md border border-destructive/30 hover:bg-destructive/10", children: "Log out" })), _jsx("button", { onClick: () => {
1679
- setAuthError(null);
1680
- window.location.reload();
1681
- }, className: "text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md border border-border hover:bg-accent", children: "Retry" })] })] })) : missingApiKey ? (_jsx("div", { className: "flex flex-col items-center justify-center h-full px-2", children: _jsx(ApiKeySetupCard, { apiUrl: apiUrl }) })) : isRestoring ? (_jsxs("div", { className: "flex flex-col gap-3 p-4", children: [_jsx("div", { className: "flex justify-end", children: _jsx("div", { className: "h-8 w-32 rounded-lg bg-muted animate-pulse" }) }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("div", { className: "h-4 w-48 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-4 w-64 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-4 w-40 rounded bg-muted animate-pulse" })] })] })) : messages.length === 0 && !isReconnecting ? (_jsxs("div", { className: "flex flex-col items-center justify-center gap-4 py-16 px-4 h-full", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-muted", children: _jsx(IconMessage, { className: "h-5 w-5 text-muted-foreground" }) }), _jsx("p", { className: "text-sm text-muted-foreground text-center max-w-[240px]", children: emptyStateText ?? "How can I help you?" }), suggestions && suggestions.length > 0 && (_jsx("div", { className: "flex flex-col gap-1.5 w-full max-w-[280px]", children: suggestions.map((suggestion) => (_jsx("button", { onClick: () => {
1682
- threadRuntime.append({
1683
- role: "user",
1684
- content: [{ type: "text", text: suggestion }],
1685
- });
1686
- }, className: "w-full rounded-lg border border-border px-3 py-2 text-left text-[13px] text-muted-foreground hover:bg-accent hover:text-foreground", children: suggestion }, suggestion))) }))] })) : (_jsxs("div", { className: "agent-thread-content flex flex-col gap-4 px-4 py-4", children: [_jsx(ThreadPrimitive.Messages, { components: {
1687
- UserMessage,
1688
- AssistantMessage,
1689
- } }), visibleLoopLimit && !showRunningInUI && (_jsx(LoopLimitContinueCard, { info: visibleLoopLimit, onContinue: () => {
1690
- setShowContinue(false);
1691
- setLoopLimitInfo(null);
1692
- addToQueue("Continue from where you left off.");
1693
- } })), shouldShowRunError && visibleRunError && (_jsx(RunErrorRecoveryCard, { info: visibleRunError, onContinue: () => {
1694
- setRunErrorInfo(null);
1695
- addToQueue("Continue from where you stopped. Use the partial work above, verify what succeeded, and finish the original request. Prefer dedicated app actions over raw database edits when they exist.");
1696
- }, onRetry: () => {
1697
- setRunErrorInfo(null);
1698
- addToQueue(lastUserText
1699
- ? `Retry the previous request from a clean approach. Original request:\n\n${lastUserText}`
1700
- : "Retry the previous request from a clean approach.");
1701
- }, onFork: onForkChat, onDismiss: () => {
1702
- if (visibleRunErrorKey) {
1703
- setDismissedRunErrorKey(visibleRunErrorKey);
1704
- }
1705
- setRunErrorInfo(null);
1706
- } })), (isReconnecting || reconnectFrozen) &&
1707
- reconnectContent.length > 0 && (_jsx(ReconnectStreamMessage, { content: reconnectContent })), showRunningInUI && (_jsx(ThinkingIndicator, { label: isReconnecting ? "Reconnecting" : "Thinking" })), queuedMessages.map((msg) => {
1708
- const displayText = msg.text
1709
- .replace(/<context>[\s\S]*?<\/context>\n?/g, "")
1710
- .trim();
1711
- return (_jsx("div", { className: "flex justify-end group", children: _jsxs("div", { className: "relative max-w-[85%] rounded-lg bg-accent/50 text-foreground/60 px-3 py-2 text-sm leading-relaxed whitespace-pre-wrap break-words", children: [_jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-muted-foreground mb-1 font-medium uppercase tracking-wide", children: [_jsx(IconClock, { className: "h-3 w-3" }), "Queued"] }), displayText, msg.images && msg.images.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-1.5 mt-1.5", children: msg.images.map((img, j) => (_jsx("img", { src: img, alt: "", className: "h-12 w-12 rounded object-cover border border-border/50" }, j))) })), _jsx("button", { type: "button", onClick: () => setQueuedMessages((prev) => prev.filter((m) => m.id !== msg.id)), "aria-label": "Remove from queue", className: "absolute -top-2 -right-2 flex h-5 w-5 items-center justify-center rounded-full border border-border bg-background text-muted-foreground opacity-0 group-hover:opacity-100 focus-visible:opacity-100 hover:text-foreground hover:bg-accent shadow-sm", children: _jsx(IconX, { className: "h-3 w-3" }) })] }) }, msg.id));
1712
- })] })) }), showScrollToBottom && (_jsx("div", { className: "shrink-0 flex justify-center -mb-1", children: _jsx("button", { type: "button", onClick: scrollToBottom, className: "flex h-7 w-7 items-center justify-center rounded-full border border-border bg-background shadow-sm hover:bg-accent", "aria-label": "Scroll to bottom", children: _jsx(IconChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" }) }) })), composerSlot, _jsx(SelectionAttachedPill, {}), _jsx("div", { className: "agent-composer-area shrink-0 px-3 py-2", children: _jsxs(ComposerPrimitive.Root, { className: cn("flex flex-col rounded-lg border border-input bg-background focus-within:ring-1 focus-within:ring-ring", execMode === "plan" &&
1713
- "border-amber-500/50 bg-amber-500/[0.03] focus-within:ring-amber-500/30"), children: [_jsx(ComposerAttachmentPreviewStrip, {}), _jsx(TiptapComposer, { focusRef: tiptapRef, disabled: missingApiKey, placeholder: missingApiKey
1714
- ? "Connect an AI engine above to start chatting…"
1705
+ setRunErrorInfo(null);
1706
+ } })), (isReconnecting || reconnectFrozen) &&
1707
+ reconnectContent.length > 0 && (_jsx(ReconnectStreamMessage, { content: reconnectContent })), showRunningInUI && (_jsx(ThinkingIndicator, { label: isReconnecting ? "Reconnecting" : "Thinking" })), queuedMessages.map((msg) => {
1708
+ const displayText = msg.text
1709
+ .replace(/<context>[\s\S]*?<\/context>\n?/g, "")
1710
+ .trim();
1711
+ return (_jsx("div", { className: "flex justify-end group", children: _jsxs("div", { className: "relative max-w-[85%] rounded-lg bg-accent/50 text-foreground/60 px-3 py-2 text-sm leading-relaxed whitespace-pre-wrap break-words", children: [_jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-muted-foreground mb-1 font-medium uppercase tracking-wide", children: [_jsx(IconClock, { className: "h-3 w-3" }), "Queued"] }), displayText, msg.images && msg.images.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-1.5 mt-1.5", children: msg.images.map((img, j) => (_jsx("img", { src: img, alt: "", className: "h-12 w-12 rounded object-cover border border-border/50" }, j))) })), _jsx("button", { type: "button", onClick: () => setQueuedMessages((prev) => prev.filter((m) => m.id !== msg.id)), "aria-label": "Remove from queue", className: "absolute -top-2 -right-2 flex h-5 w-5 items-center justify-center rounded-full border border-border bg-background text-muted-foreground opacity-0 group-hover:opacity-100 focus-visible:opacity-100 hover:text-foreground hover:bg-accent shadow-sm", children: _jsx(IconX, { className: "h-3 w-3" }) })] }) }, msg.id));
1712
+ })] })) }), showScrollToBottom && (_jsx("div", { className: "shrink-0 flex justify-center -mb-1", children: _jsx("button", { type: "button", onClick: scrollToBottom, className: "flex h-7 w-7 items-center justify-center rounded-full border border-border bg-background shadow-sm hover:bg-accent", "aria-label": "Scroll to bottom", children: _jsx(IconChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" }) }) }))] })), composerSlot, _jsx(SelectionAttachedPill, {}), _jsx("div", { className: "agent-composer-area shrink-0 px-3 py-2", children: _jsxs(ComposerPrimitive.Root, { className: cn("flex flex-col rounded-lg border border-input bg-background focus-within:ring-1 focus-within:ring-ring", execMode === "plan" &&
1713
+ "border-amber-500/50 bg-amber-500/[0.03] focus-within:ring-amber-500/30"), children: [_jsx(ComposerAttachmentPreviewStrip, {}), _jsx(TiptapComposer, { focusRef: tiptapRef, disabled: missingApiKey, placeholder: composerPlaceholder ??
1714
+ (missingApiKey
1715
+ ? "Connect an AI engine above to start chatting…"
1716
+ : isRunning
1717
+ ? queuedMessages.length > 0
1718
+ ? `${queuedMessages.length} queued type another...`
1719
+ : "Queue a message..."
1720
+ : undefined), onSubmit: onSubmitOverride
1721
+ ? onSubmitOverride
1715
1722
  : isRunning
1716
- ? queuedMessages.length > 0
1717
- ? `${queuedMessages.length} queued type another...`
1718
- : "Queue a message..."
1719
- : undefined, onSubmit: isRunning
1720
- ? (text, references) => addToQueue(text, undefined, references.length > 0 ? references : undefined)
1721
- : undefined, onSlashCommand: onSlashCommand, execMode: execMode, onExecModeChange: onExecModeChange, selectedModel: selectedModel ?? defaultModel, selectedEffort: selectedEffort, availableModels: availableModels, onModelChange: onModelChange, onEffortChange: onEffortChange, draftScope: threadId || tabId, extraActionButton: showRunningInUI ? (_jsx("button", { type: "button", onClick: () => {
1723
+ ? (text, references) => addToQueue(text, undefined, references.length > 0 ? references : undefined)
1724
+ : undefined, onSlashCommand: onSlashCommand, execMode: execMode, onExecModeChange: onExecModeChange, selectedModel: selectedModel ?? defaultModel, selectedEffort: selectedEffort, availableModels: availableModels, onModelChange: onModelChange, onEffortChange: onEffortChange, draftScope: threadId || tabId, extraActionButton: showRunningInUI ? (_jsx("button", { type: "button", onClick: () => {
1722
1725
  // Nuclear stop: flip forceStopped so isRunning is false
1723
1726
  // immediately. This unblocks submission even if the
1724
1727
  // runtime or reconnect state is stuck.