@jini-ai/chat 0.7.2 → 0.7.3-next.2

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 (202) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/README.md +3 -3
  3. package/dist/contracts/chat-bubble-style.d.ts +1 -1
  4. package/dist/contracts/chat-bubble-style.js +1 -1
  5. package/dist/core/ag-ui/event-projection.d.ts +125 -0
  6. package/dist/core/ag-ui/event-projection.js +275 -0
  7. package/dist/core/ag-ui/event-reduction.d.ts +39 -0
  8. package/dist/core/ag-ui/event-reduction.js +99 -0
  9. package/dist/core/ag-ui/run-input.d.ts +53 -0
  10. package/dist/core/ag-ui/run-input.js +87 -0
  11. package/dist/core/agentic/chat-capabilities.d.ts +1 -1
  12. package/dist/core/agentic/index.d.ts +2 -4
  13. package/dist/core/agentic/index.js +2 -3
  14. package/dist/core/agents-port.d.ts +50 -0
  15. package/dist/core/agents-port.js +2 -0
  16. package/dist/core/assistant-client/ag-ui-fetch-agent.d.ts +16 -0
  17. package/dist/core/assistant-client/ag-ui-fetch-agent.js +24 -0
  18. package/dist/core/assistant-client/ag-ui-transport.d.ts +15 -1
  19. package/dist/core/assistant-client/ag-ui-transport.js +167 -145
  20. package/dist/core/assistant-client/attachment-liveness.js +13 -11
  21. package/dist/core/assistant-client/durable-run-subscription.d.ts +3 -2
  22. package/dist/core/assistant-client/durable-run-subscription.js +6 -5
  23. package/dist/core/assistant-client/messages.d.ts +7 -4
  24. package/dist/core/assistant-client/messages.js +5 -4
  25. package/dist/core/assistant-client/transport.d.ts +1 -1
  26. package/dist/core/assistant-client/transport.js +4 -4
  27. package/dist/core/index.d.ts +2 -0
  28. package/dist/core/index.js +1 -0
  29. package/dist/core/page-port.d.ts +15 -0
  30. package/dist/core/page-port.js +2 -0
  31. package/dist/core/run-activity.js +1 -1
  32. package/dist/core/run-events/entry.js +1 -0
  33. package/dist/core/user-text-redaction.d.ts +1 -3
  34. package/dist/core/user-text-redaction.js +3 -61
  35. package/dist/embed-widget/browser/agent-inventory.d.ts +37 -0
  36. package/dist/embed-widget/browser/agent-inventory.js +36 -0
  37. package/dist/embed-widget/browser/frontend-session-bridge.d.ts +2 -2
  38. package/dist/embed-widget/browser/frontend-session-bridge.js +17 -14
  39. package/dist/embed-widget/react/dialog.hooks.d.ts +16 -0
  40. package/dist/embed-widget/react/dialog.hooks.js +15 -0
  41. package/dist/embed-widget/react/embed.d.ts +7 -2
  42. package/dist/embed-widget/react/embed.js +6 -16
  43. package/dist/embed-widget/react/header.d.ts +4 -1
  44. package/dist/embed-widget/react/header.js +2 -2
  45. package/dist/embed-widget/vanilla/state.js +2 -2
  46. package/dist/embed-widget/vanilla/style.css +4 -4
  47. package/dist/react/components/A2uiSurfaceCard.d.ts +18 -4
  48. package/dist/react/components/A2uiSurfaceCard.hooks.d.ts +36 -0
  49. package/dist/react/components/A2uiSurfaceCard.hooks.js +174 -0
  50. package/dist/react/components/A2uiSurfaceCard.js +14 -227
  51. package/dist/react/components/A2uiSurfaceCard.rules.d.ts +14 -0
  52. package/dist/react/components/A2uiSurfaceCard.rules.js +24 -0
  53. package/dist/react/components/AttachmentPreviewModal.d.ts +21 -1
  54. package/dist/react/components/AttachmentPreviewModal.hooks.js +1 -3
  55. package/dist/react/components/AttachmentPreviewModal.js +11 -9
  56. package/dist/react/components/AttachmentTray.d.ts +11 -1
  57. package/dist/react/components/AttachmentTray.js +12 -8
  58. package/dist/react/components/ChatFab.d.ts +10 -1
  59. package/dist/react/components/ChatFab.js +2 -2
  60. package/dist/react/components/ChatSettingsDialog.d.ts +4 -3
  61. package/dist/react/components/ChatSettingsDialog.js +9 -6
  62. package/dist/react/components/ChatSettingsSegmented.d.ts +1 -1
  63. package/dist/react/components/ChatSettingsSegmented.js +1 -1
  64. package/dist/react/components/Composer.d.ts +9 -1
  65. package/dist/react/components/Composer.hooks.d.ts +79 -0
  66. package/dist/react/components/Composer.hooks.js +336 -0
  67. package/dist/react/components/Composer.js +40 -341
  68. package/dist/react/components/ComposerDiscovery.js +1 -1
  69. package/dist/react/components/ConversationList.d.ts +34 -1
  70. package/dist/react/components/ConversationList.hooks.d.ts +37 -0
  71. package/dist/react/components/ConversationList.hooks.js +177 -1
  72. package/dist/react/components/ConversationList.js +7 -174
  73. package/dist/react/components/ConversationTitleEditor.d.ts +17 -2
  74. package/dist/react/components/ConversationTitleEditor.hooks.d.ts +15 -0
  75. package/dist/react/components/ConversationTitleEditor.hooks.js +36 -0
  76. package/dist/react/components/ConversationTitleEditor.js +11 -34
  77. package/dist/react/components/CopyMessageButton.d.ts +6 -1
  78. package/dist/react/components/CopyMessageButton.js +4 -4
  79. package/dist/react/components/ExtEventErrorBoundary.d.ts +2 -0
  80. package/dist/react/components/ExtEventErrorBoundary.js +5 -3
  81. package/dist/react/components/FolderChips.d.ts +11 -1
  82. package/dist/react/components/FolderChips.hooks.d.ts +12 -0
  83. package/dist/react/components/FolderChips.hooks.js +10 -0
  84. package/dist/react/components/FolderChips.js +9 -9
  85. package/dist/react/components/Markdown.js +7 -5
  86. package/dist/react/components/McpUiSurfaceCard.d.ts +29 -5
  87. package/dist/react/components/McpUiSurfaceCard.js +29 -16
  88. package/dist/react/components/MessageList.d.ts +10 -1
  89. package/dist/react/components/MessageList.hooks.js +4 -2
  90. package/dist/react/components/MessageList.js +12 -8
  91. package/dist/react/components/MessageRow.d.ts +46 -2
  92. package/dist/react/components/MessageRow.hooks.d.ts +60 -0
  93. package/dist/react/components/MessageRow.hooks.js +94 -0
  94. package/dist/react/components/MessageRow.js +53 -113
  95. package/dist/react/components/MidRunUserMessage.d.ts +6 -1
  96. package/dist/react/components/MidRunUserMessage.js +5 -5
  97. package/dist/react/components/NextStepActions.d.ts +3 -1
  98. package/dist/react/components/NextStepActions.js +3 -3
  99. package/dist/react/components/QuestionForm.answers.hooks.d.ts +26 -0
  100. package/dist/react/components/QuestionForm.answers.hooks.js +89 -0
  101. package/dist/react/components/QuestionForm.d.ts +6 -0
  102. package/dist/react/components/QuestionForm.js +23 -261
  103. package/dist/react/components/QuestionForm.values.d.ts +22 -0
  104. package/dist/react/components/QuestionForm.values.js +58 -0
  105. package/dist/react/components/QuestionFormField.d.ts +17 -0
  106. package/dist/react/components/QuestionFormField.js +114 -0
  107. package/dist/react/components/QuestionsPanel.d.ts +3 -1
  108. package/dist/react/components/QuestionsPanel.js +7 -3
  109. package/dist/react/components/SentAttachment.d.ts +11 -2
  110. package/dist/react/components/SentAttachment.hooks.d.ts +1 -1
  111. package/dist/react/components/SentAttachment.hooks.js +6 -5
  112. package/dist/react/components/SentAttachment.js +5 -3
  113. package/dist/react/components/TodoCard.d.ts +3 -1
  114. package/dist/react/components/TodoCard.js +9 -4
  115. package/dist/react/components/ToolCallGroup.d.ts +11 -1
  116. package/dist/react/components/ToolCallGroup.js +10 -4
  117. package/dist/react/components/ToolCard.d.ts +6 -1
  118. package/dist/react/components/ToolCard.js +79 -69
  119. package/dist/react/components/mcp-ui-question-input.d.ts +1 -1
  120. package/dist/react/components/mcp-ui-question-input.js +3 -3
  121. package/dist/react/components/mcp-ui-surface-state.d.ts +1 -1
  122. package/dist/react/features/chat-pane/agent-tools.d.ts +1 -1
  123. package/dist/react/features/chat-pane/antigravity/model-options.d.ts +2 -0
  124. package/dist/react/features/chat-pane/antigravity/model-options.js +2 -0
  125. package/dist/react/features/chat-pane/claude/model-options.d.ts +2 -0
  126. package/dist/react/features/chat-pane/claude/model-options.js +2 -0
  127. package/dist/react/features/chat-pane/codex/model-options.d.ts +2 -0
  128. package/dist/react/features/chat-pane/codex/model-options.js +2 -0
  129. package/dist/react/features/chat-pane/components/AgentPluginUsage.d.ts +4 -1
  130. package/dist/react/features/chat-pane/components/AgentPluginUsage.js +2 -2
  131. package/dist/react/features/chat-pane/components/AgentRuntimePicker.d.ts +10 -6
  132. package/dist/react/features/chat-pane/components/AgentRuntimePicker.js +18 -132
  133. package/dist/react/features/chat-pane/components/ChatPane.d.ts +24 -2
  134. package/dist/react/features/chat-pane/components/ChatPane.js +45 -297
  135. package/dist/react/features/chat-pane/components/ChatPaneComposerArea.d.ts +33 -0
  136. package/dist/react/features/chat-pane/components/ChatPaneComposerArea.js +119 -0
  137. package/dist/react/features/chat-pane/components/ChatPaneLayout.d.ts +42 -0
  138. package/dist/react/features/chat-pane/components/ChatPaneLayout.js +54 -0
  139. package/dist/react/features/chat-pane/components/ChatPaneStatus.d.ts +27 -0
  140. package/dist/react/features/chat-pane/components/ChatPaneStatus.js +91 -0
  141. package/dist/react/features/chat-pane/components/RuntimeDropUp.d.ts +6 -1
  142. package/dist/react/features/chat-pane/components/RuntimeDropUp.js +20 -19
  143. package/dist/react/features/chat-pane/components/RuntimePickerSections.d.ts +62 -0
  144. package/dist/react/features/chat-pane/components/RuntimePickerSections.js +122 -0
  145. package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.d.ts +1 -1
  146. package/dist/react/features/chat-pane/hooks/useChatPane.hooks.d.ts +5 -3
  147. package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js +78 -26
  148. package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.js +6 -6
  149. package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.d.ts +5 -1
  150. package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.js +7 -7
  151. package/dist/react/features/chat-pane/hooks/useRuntimeDropUp.hooks.d.ts +7 -0
  152. package/dist/react/features/chat-pane/hooks/useRuntimeDropUp.hooks.js +5 -0
  153. package/dist/react/features/chat-pane/model-options.js +7 -4
  154. package/dist/react/features/chat-pane/styles.d.ts +1 -1
  155. package/dist/react/features/chat-pane/styles.js +14 -14
  156. package/dist/react/features/chat-pane/types.d.ts +29 -1
  157. package/dist/react/hooks/assistant-chats-contracts.d.ts +1 -1
  158. package/dist/react/hooks/attachment-preview-cache.d.ts +1 -1
  159. package/dist/react/hooks/attachment-preview-cache.js +1 -1
  160. package/dist/react/hooks/fab-position.js +16 -18
  161. package/dist/react/hooks/useConversation.d.ts +6 -1
  162. package/dist/react/hooks/useConversation.js +11 -10
  163. package/dist/react/hooks/useRunStream.d.ts +3 -0
  164. package/dist/react/hooks/useRunStream.js +12 -12
  165. package/dist/react/hooks/useSurfaceRecovery.d.ts +1 -1
  166. package/dist/react/hooks/useSurfaceRecovery.js +2 -2
  167. package/dist/react/index.d.ts +6 -3
  168. package/dist/react/index.js +5 -3
  169. package/dist/react/styles/chat-settings.css +9 -9
  170. package/dist/react/surfaces.d.ts +91 -0
  171. package/dist/react/surfaces.js +28 -0
  172. package/dist/server/durable-runs/recover.d.ts +4 -3
  173. package/dist/server/durable-runs/recover.js +4 -3
  174. package/dist/store/legacy/sqlite/conversations.d.ts +1 -2
  175. package/dist/store/legacy/sqlite/conversations.js +1 -1
  176. package/dist/store/legacy/sqlite/messages.d.ts +2 -3
  177. package/dist/store/legacy/sqlite/messages.js +6 -6
  178. package/dist/store/pglite/index.d.ts +7 -7
  179. package/dist/store/pglite/index.js +1 -1
  180. package/dist/store/ports.d.ts +5 -2
  181. package/dist/store/postgres/index.d.ts +7 -7
  182. package/dist/store/postgres/index.js +1 -1
  183. package/dist/store/runtime/chat-expiry-sweep.js +2 -4
  184. package/dist/store/runtime/chat-history-store.js +2 -3
  185. package/dist/store/runtime/durable-run-store.js +16 -2
  186. package/dist/store/runtime/history-tools.js +33 -11
  187. package/dist/store/runtime/kernel.d.ts +3 -2
  188. package/dist/store/runtime/run-ledger.js +2 -2
  189. package/dist/store/sql/boundary.d.ts +5 -5
  190. package/dist/store/sql/maintenance.d.ts +3 -2
  191. package/dist/store/sql/store.d.ts +16 -8
  192. package/dist/store/sql/store.js +31 -14
  193. package/dist/store/sqlite/index.d.ts +11 -12
  194. package/dist/store/sqlite/index.js +5 -5
  195. package/dist/store/sqlite/schema.d.ts +1 -1
  196. package/package.json +49 -27
  197. package/dist/core/ag-ui/entry.d.ts +0 -84
  198. package/dist/core/ag-ui/entry.js +0 -225
  199. package/dist/core/browser/page-actions.d.ts +0 -121
  200. package/dist/core/browser/page-actions.js +0 -113
  201. package/dist/embed-widget/browser/page-actions.d.ts +0 -2
  202. package/dist/embed-widget/browser/page-actions.js +0 -3
@@ -0,0 +1,54 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { AgentPluginUsage } from './AgentPluginUsage.js';
4
+ import { SECRET_REDACTED_NOTICE } from '../../../../core/user-text-redaction.js';
5
+ import { MessageList } from '../../../components/MessageList.js';
6
+ import { definedProps } from '../../../util/defined-props.js';
7
+ import { useChatPaneControlsHeight } from '../hooks/useChatPaneControlsHeight.hooks.js';
8
+ import { useChatPaneSuggestion } from '../hooks/useChatPaneSuggestion.hooks.js';
9
+ import { useChatPaneNewTabLinks } from '../hooks/useChatPaneNewTabLinks.hooks.js';
10
+ import { CHAT_PANE_STYLES } from '../styles.js';
11
+ import { ChatPaneStatusMessages } from './ChatPaneStatus.js';
12
+ import { ChatPaneComposerArea } from './ChatPaneComposerArea.js';
13
+ function defaultHeader(title, onReset, t) {
14
+ return (_jsxs("div", { className: "jini-chat-pane__header", children: [_jsxs("div", { className: "jini-chat-pane__heading", children: [_jsx("span", { className: "jini-chat-pane__eyebrow", children: t('Workspace chat') }), _jsx("h1", { className: "jini-chat-pane__title", children: title ?? t('Chat') })] }), _jsx("button", { type: "button", className: "jini-chat-pane__new-thread", onClick: onReset, children: t('New thread') })] }));
15
+ }
16
+ function chatPaneClassName(variant, className) {
17
+ const suffix = className ? ' ' + className : '';
18
+ return `jini-chat-pane jini-chat-pane--${variant}${suffix}`;
19
+ }
20
+ function ChatPaneSuggestionsRow({ suggestions, onSelect, t }) {
21
+ if (suggestions.length === 0)
22
+ return null;
23
+ return (_jsx("div", { className: "jini-chat-pane__suggestions", "aria-label": t('Example prompts'), children: suggestions.map((suggestion) => (_jsx("button", { type: "button", className: "jini-chat-pane__suggestion", onClick: () => onSelect(suggestion), children: suggestion }, suggestion))) }));
24
+ }
25
+ export function useChatPaneTranscriptProps({ pane }, { projectFileNames }) {
26
+ // `MessageList` is memoized so a composer keystroke does not re-render the transcript; these two
27
+ // props would otherwise be fresh objects on every render and defeat it.
28
+ const { queuedMessages, cancelQueuedMessage } = pane;
29
+ const pendingPrompts = useMemo(() => queuedMessages.map(input => ({ ...input, onCancel: () => cancelQueuedMessage({ id: input.id }) })), [queuedMessages, cancelQueuedMessage]);
30
+ const projectFileNameSet = useMemo(() => (projectFileNames === undefined ? undefined : new Set(projectFileNames)), [projectFileNames]);
31
+ return { pendingPrompts, projectFileNameSet };
32
+ }
33
+ function ChatPaneTranscript({ pane, sendingLabel, emptyState, embed, suggestions, onSelectSuggestion, pendingPrompts, projectFileNameSet, toolCallDisplay, showUsageLine, showThinking, t, }) {
34
+ if (pane.conversation.messages.length === 0 && emptyState) {
35
+ return (_jsxs("div", { className: "jini-message-list jini-message-list--empty", children: [emptyState, embed && _jsx(ChatPaneSuggestionsRow, { suggestions: suggestions, onSelect: onSelectSuggestion, t: t })] }));
36
+ }
37
+ return (_jsx(MessageList, { messages: pane.conversation.messages, ...definedProps({ source: { sendingLabel } }), isStreaming: pane.conversation.isStreaming, scrollIntent: pane.conversation.scrollIntent, onScrolled: pane.conversation.acknowledgeScroll, pendingPrompts: pendingPrompts, toolCallDisplay: toolCallDisplay, showUsageLine: showUsageLine, showThinking: showThinking, ...(projectFileNameSet === undefined ? {} : { projectFileNames: projectFileNameSet }) }));
38
+ }
39
+ /** The controls-area suggestions row shows on every workspace surface, and on the embed surface
40
+ * only when the empty transcript has no `emptyState` to host it instead. */
41
+ function showsControlsSuggestions(embed, messageCount, emptyState) {
42
+ return !embed || (messageCount === 0 && !emptyState);
43
+ }
44
+ export function ChatPaneLayout({ p, pane, surface, runtimeView, base, unavailable, fileDrop, inventory, t, slots, composerPlaceholder, useChatPaneControlsHeightHook = useChatPaneControlsHeight, useChatPaneSuggestionHook = useChatPaneSuggestion, useChatPaneNewTabLinksHook = useChatPaneNewTabLinks, useChatPaneTranscriptPropsHook = useChatPaneTranscriptProps, }) {
45
+ const { rootRef, controlsRef } = useChatPaneControlsHeightHook();
46
+ const selectSuggestion = useChatPaneSuggestionHook({ rootRef, setDraft: pane.composer.setDraft });
47
+ const openLinkInNewTab = useChatPaneNewTabLinksHook();
48
+ const { pendingPrompts, projectFileNameSet } = useChatPaneTranscriptPropsHook({ pane }, definedProps({ source: { projectFileNames: p.projectFileNames } }));
49
+ return (_jsxs("section", { className: chatPaneClassName(p.variant, p.className), style: p.style, "data-activity": pane.activity, ref: rootRef, onClickCapture: openLinkInNewTab, children: [_jsx("style", { "data-jini-chat-pane-styles": "true", children: CHAT_PANE_STYLES }), p.header ?? defaultHeader(p.title, pane.reset, t), p.agentPluginsMode !== 'off' && _jsx(AgentPluginUsage, { conversationId: pane.conversation.conversationId, messages: pane.conversation.messages }), _jsxs("div", { className: "jini-chat-pane__body", children: [_jsx(ChatPaneTranscript, { pane: pane, sendingLabel: p.sendingLabel, emptyState: p.emptyState, embed: surface.embed, suggestions: p.suggestions, onSelectSuggestion: selectSuggestion, pendingPrompts: pendingPrompts, projectFileNameSet: projectFileNameSet, toolCallDisplay: p.toolCallDisplay, showUsageLine: p.showUsageLine, showThinking: p.showThinking, t: t }), _jsx(ChatPaneControls, { p: p, pane: pane, surface: surface, runtimeView: runtimeView, base: base, unavailable: unavailable, fileDrop: fileDrop, inventory: inventory, t: t, slots: slots, composerPlaceholder: composerPlaceholder, selectSuggestion: selectSuggestion, controlsRef: controlsRef })] }), p.footer] }));
50
+ }
51
+ function ChatPaneControls({ p, pane, surface, runtimeView, base, unavailable, fileDrop, inventory, t, slots, composerPlaceholder, selectSuggestion, controlsRef, }) {
52
+ return (_jsxs("div", { className: "jini-chat-pane__controls", ref: controlsRef, children: [showsControlsSuggestions(surface.embed, pane.conversation.messages.length, p.emptyState) && (_jsx(ChatPaneSuggestionsRow, { suggestions: p.suggestions, onSelect: selectSuggestion, t: t })), pane.secretRedacted ? (_jsxs("div", { className: "jini-chat-pane__status jini-chat-pane__status--dismissible", role: "status", children: [_jsx("span", { children: t(SECRET_REDACTED_NOTICE) }), _jsx("button", { type: "button", className: "jini-chat-pane__error-action", onClick: pane.dismissSecretRedacted, children: t('Dismiss') })] })) : null, _jsx(ChatPaneStatusMessages, { unavailable: unavailable, scanningAgents: runtimeView.scanningAgents, connectingAgents: runtimeView.connectingAgents, executionMode: p.executionMode, apiModeAvailable: p.apiModeAvailable, onExecutionModeChange: p.onExecutionModeChange, sendError: pane.conversation.sendError, onRetrySend: () => void pane.retrySend(), attachmentError: pane.attachmentError, dropReadError: fileDrop.dropReadError, workingDirectoryError: pane.workingDirectoryError, workingDirectoryPending: pane.workingDirectoryPending, workingDirectoryInvalid: pane.workingDirectoryInvalid, runtimeInventoryError: inventory.runtimeInventoryError, typedAnswerNotice: pane.typedAnswerNotice, t: t }), _jsx(ChatPaneComposerArea, { report: p.report, agentHandle: base ? `${base}-composer` : false, fileDrop: fileDrop, uploadAttachments: surface.uploadAttachments, pane: pane, disabled: p.disabled, unavailable: unavailable, placeholder: composerPlaceholder, slots: slots, attachmentAccept: p.attachmentAccept, workingDirectoryAccess: p.workingDirectoryAccess, workingDirectoryControlPlacement: surface.workingDirectoryControlPlacement, t: t })] }));
53
+ }
54
+ //# sourceMappingURL=ChatPaneLayout.js.map
@@ -0,0 +1,27 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { TypedAnswerNotice } from '../types.js';
3
+ interface ChatPaneAvailabilityStatusProps {
4
+ unavailable: boolean;
5
+ scanningAgents: boolean;
6
+ connectingAgents: boolean;
7
+ executionMode: 'local' | 'api';
8
+ apiModeAvailable: boolean;
9
+ onExecutionModeChange: ((mode: 'local' | 'api') => void) | undefined;
10
+ t: (key: string) => string;
11
+ }
12
+ interface ChatPaneStatusMessagesProps extends ChatPaneAvailabilityStatusProps {
13
+ sendError: Error | null;
14
+ onRetrySend: () => void;
15
+ attachmentError: Error | null;
16
+ dropReadError: string | null;
17
+ workingDirectoryError: Error | null;
18
+ workingDirectoryPending: boolean;
19
+ workingDirectoryInvalid: boolean;
20
+ runtimeInventoryError: Error | null;
21
+ typedAnswerNotice: TypedAnswerNotice | null;
22
+ }
23
+ /** The pane's stack of mutually-independent error/status banners — each condition is its own
24
+ * source of truth, so they are rendered as siblings rather than folded into one derived state. */
25
+ export declare function ChatPaneStatusMessages({ sendError, onRetrySend, attachmentError, dropReadError, workingDirectoryError, workingDirectoryPending, workingDirectoryInvalid, runtimeInventoryError, typedAnswerNotice, ...availability }: ChatPaneStatusMessagesProps): ReactNode;
26
+ export {};
27
+ //# sourceMappingURL=ChatPaneStatus.d.ts.map
@@ -0,0 +1,91 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { describeAttachmentError, describeTypedAnswerNotice } from '../rules.js';
3
+ /**
4
+ * The `unavailable` banner's copy and, where reachable, its actual fix — distinguishing three
5
+ * CLI-less states so a pointer at BYOK is never shown as an option that would not actually help:
6
+ *
7
+ * - `executionMode === 'local'` with BYOK available: switching mode is a real fix. When the host
8
+ * wired `onExecutionModeChange` (the same callback the runtime picker's own mode buttons already
9
+ * call — see `AgentRuntimePicker.tsx`), this renders as a button that performs the switch
10
+ * directly rather than prose telling the operator to go hunting for the control themselves. A
11
+ * host that reports `apiModeAvailable` without wiring the callback still gets an honest, if
12
+ * inert, pointer as plain copy.
13
+ * - `executionMode === 'local'` with BYOK NOT available: switching would not help — offering it
14
+ * anyway would be a lie — so this falls back to the original, unconditional message.
15
+ * - `executionMode === 'api'` already: the operator is already on the one path that could work,
16
+ * so a "switch to BYOK" pointer would be nonsensical here; whatever is still missing (e.g. no
17
+ * model chosen) is `RuntimeByokDetails`' own job to explain inside the runtime picker, not this
18
+ * banner's.
19
+ */
20
+ function ChatPaneNoUsableCliMessage({ executionMode, apiModeAvailable, onExecutionModeChange, t, }) {
21
+ const byokIsARealFix = executionMode === 'local' && apiModeAvailable;
22
+ if (!byokIsARealFix) {
23
+ return _jsx("div", { className: "jini-chat-pane__error", role: "alert", children: t('No usable CLI is selected.') });
24
+ }
25
+ if (!onExecutionModeChange) {
26
+ return (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: t('No usable CLI is selected — switch to BYOK to use your own API key.') }));
27
+ }
28
+ return (_jsxs("div", { className: "jini-chat-pane__error", role: "alert", children: [t('No usable CLI is selected.'), ' ', _jsx("button", { type: "button", className: "jini-chat-pane__error-action", onClick: () => onExecutionModeChange('api'), children: t('Switch to BYOK') })] }));
29
+ }
30
+ /**
31
+ * `unavailable` alone conflates "inventory still loading" with "inventory loaded, nothing
32
+ * usable" — both present as `selectedAgent === undefined`. `scanningAgents` is the signal
33
+ * that tells them apart, mirroring the `workingDirectoryPending`/`workingDirectoryInvalid`
34
+ * pair below: a pending detection is a `status`, only a *finished* detection that found
35
+ * nothing is an `alert`. `connectingAgents` is a third state: the inventory could not be
36
+ * read at all (the host is unreachable, typically a daemon restart) and a retry is
37
+ * pending — a plain status too, never "No usable CLI", which only a SUCCESSFUL answer can
38
+ * establish.
39
+ */
40
+ function ChatPaneAvailabilityStatus({ unavailable, scanningAgents, connectingAgents, executionMode, apiModeAvailable, onExecutionModeChange, t, }) {
41
+ if (!unavailable)
42
+ return null;
43
+ if (connectingAgents) {
44
+ return (_jsx("div", { className: "jini-chat-pane__status", role: "status", children: t('Connecting to the assistant…') }));
45
+ }
46
+ if (scanningAgents) {
47
+ return (_jsx("div", { className: "jini-chat-pane__status", role: "status", children: t('Loading available CLIs') }));
48
+ }
49
+ return (_jsx(ChatPaneNoUsableCliMessage, { executionMode: executionMode, apiModeAvailable: apiModeAvailable, onExecutionModeChange: onExecutionModeChange, t: t }));
50
+ }
51
+ function ChatPaneWorkingDirectoryStatus({ workingDirectoryPending, workingDirectoryInvalid, t, }) {
52
+ if (workingDirectoryPending) {
53
+ return (_jsx("div", { className: "jini-chat-pane__status", role: "status", children: t('Checking working directory…') }));
54
+ }
55
+ if (!workingDirectoryInvalid)
56
+ return null;
57
+ return (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: t('Working directory is unavailable.') }));
58
+ }
59
+ /**
60
+ * The typed-answer delivery notice. Only `'failed'` ever reaches it: `useChatPane` queues a
61
+ * `'not-pending'` refusal as one ordinary message itself (`answerWaitingQuestion`), without a notice.
62
+ *
63
+ * MOVE (from the retired "Send as a new message" button this notice once rendered for
64
+ * `'not-pending'`): the held answer's only way into a new run besides clearing the draft — an
65
+ * explicit choice, so a closed question never turns an answer into a paid run on a second Enter.
66
+ * The hook's automatic one-time fallback now owns that guarantee, which left the button unreachable.
67
+ */
68
+ function ChatPaneTypedAnswerNotice({ typedAnswerNotice, t, }) {
69
+ if (!typedAnswerNotice)
70
+ return null;
71
+ return (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: t(describeTypedAnswerNotice({ notice: typedAnswerNotice })) }));
72
+ }
73
+ /** A failed upload, in plain words, with redacted details a person can copy into a report. */
74
+ function ChatPaneAttachmentError({ error, t }) {
75
+ const { summary, details } = describeAttachmentError({ error });
76
+ return (_jsxs("div", { className: "jini-chat-pane__error", role: "alert", children: [_jsx("div", { children: t(summary) }), details ? _jsxs("div", { className: "jini-chat-pane__error-details", children: [t('Details:'), " ", details] }) : null] }));
77
+ }
78
+ /** A send the server never accepted. Its text went back into the composer if that was still empty;
79
+ * Retry sends it again either way (see `useChatPane`'s `retrySend`). */
80
+ function ChatPaneSendError({ sendError, onRetry, t }) {
81
+ if (!sendError)
82
+ return null;
83
+ return (_jsxs("div", { className: "jini-chat-pane__error", role: "alert", children: [t('Not sent:'), " ", sendError.message, ' ', _jsx("button", { type: "button", className: "jini-chat-pane__error-action", onClick: onRetry, children: t('Retry') })] }));
84
+ }
85
+ /** The pane's stack of mutually-independent error/status banners — each condition is its own
86
+ * source of truth, so they are rendered as siblings rather than folded into one derived state. */
87
+ export function ChatPaneStatusMessages({ sendError, onRetrySend, attachmentError, dropReadError, workingDirectoryError, workingDirectoryPending, workingDirectoryInvalid, runtimeInventoryError, typedAnswerNotice, ...availability }) {
88
+ const { t } = availability;
89
+ return (_jsxs(_Fragment, { children: [_jsx(ChatPaneAvailabilityStatus, { ...availability }), _jsx(ChatPaneSendError, { sendError: sendError, onRetry: onRetrySend, t: t }), attachmentError ? _jsx(ChatPaneAttachmentError, { error: attachmentError, t: t }) : null, dropReadError ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: dropReadError })) : null, workingDirectoryError ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: workingDirectoryError.message })) : null, _jsx(ChatPaneWorkingDirectoryStatus, { workingDirectoryPending: workingDirectoryPending, workingDirectoryInvalid: workingDirectoryInvalid, t: t }), runtimeInventoryError && !availability.connectingAgents ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: runtimeInventoryError.message })) : null, _jsx(ChatPaneTypedAnswerNotice, { typedAnswerNotice: typedAnswerNotice, t: t })] }));
90
+ }
91
+ //# sourceMappingURL=ChatPaneStatus.js.map
@@ -1,5 +1,10 @@
1
1
  import type { ReactNode } from 'react';
2
+ import { useInfoTip, useAgentHandle } from '@jini-ai/ui';
3
+ import { useRuntimeDropUp } from '../hooks/useRuntimeDropUp.hooks.js';
2
4
  export interface RuntimeDropUpProps {
5
+ useAgentHandleHook?: typeof useAgentHandle;
6
+ useRuntimeDropUpHook?: typeof useRuntimeDropUp;
7
+ useInfoTipHook?: typeof useInfoTip;
3
8
  agentHandle?: string | false | undefined;
4
9
  /** Names both the trigger (with the current value appended) and the menu. */
5
10
  label: string;
@@ -26,5 +31,5 @@ export interface RuntimeDropUpProps {
26
31
  *
27
32
  * @complexity Time/space: O(n) in the option count.
28
33
  */
29
- export declare function RuntimeDropUp({ agentHandle, label, valueLabel, triggerLabel, value, options, onSelect, note, width, className, }: RuntimeDropUpProps): ReactNode;
34
+ export declare function RuntimeDropUp({ useAgentHandleHook, useRuntimeDropUpHook, useInfoTipHook, agentHandle, label, valueLabel, triggerLabel, value, options, onSelect, note, width, className, }: RuntimeDropUpProps): ReactNode;
30
35
  //# sourceMappingURL=RuntimeDropUp.d.ts.map
@@ -2,8 +2,8 @@ import { createElement as _createElement } from "react";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { createPortal } from 'react-dom';
4
4
  import { RemixIcon, infoTipBubbleStyle, useInfoTip, useAgentHandle } from '@jini-ai/ui';
5
- import { agentHandleProps, agentHandleSegment } from '@jini-ai/agentic';
6
- import { useRuntimeDropUp } from '../hooks/useRuntimeDropUp.hooks.js';
5
+ import { agentHandleProps, agentHandleSegment } from '@jini-ai/core/agent-handles';
6
+ import { createRuntimeDropUpTipHandler, useRuntimeDropUp } from '../hooks/useRuntimeDropUp.hooks.js';
7
7
  /** The full `valueLabel` in the same white bubble `InfoTip` uses, portalled to `document.body`. */
8
8
  function RuntimeDropUpTipBubble({ tip, valueLabel }) {
9
9
  return createPortal(_jsx("span", { ref: tip.bubbleRef, className: tip.placement === 'below' ? 'info-tip-bubble info-tip-bubble-below' : 'info-tip-bubble', role: "presentation", "aria-hidden": "true", style: infoTipBubbleStyle(tip.coords), children: valueLabel }), document.body);
@@ -24,27 +24,28 @@ function RuntimeDropUpMenu({ base, dropUp, label, value, options, onSelect, note
24
24
  *
25
25
  * @complexity Time/space: O(n) in the option count.
26
26
  */
27
- export function RuntimeDropUp({ agentHandle, label, valueLabel, triggerLabel, value, options, onSelect, note, width, className, }) {
28
- const base = useAgentHandle({ agentHandle });
29
- const dropUp = useRuntimeDropUp({ width });
30
- const { menuId, open, triggerRef, toggleOpen, handleTriggerKeyDown } = dropUp;
27
+ export function RuntimeDropUp({ useAgentHandleHook = useAgentHandle, useRuntimeDropUpHook = useRuntimeDropUp, useInfoTipHook = useInfoTip, agentHandle, label, valueLabel, triggerLabel, value, options, onSelect, note, width, className, }) {
28
+ const base = useAgentHandleHook({ agentHandle });
29
+ const dropUp = useRuntimeDropUpHook({ width });
30
+ const { open } = dropUp;
31
31
  // The same white bubble as `InfoTip` (its hook places it), rather than the browser's own title
32
32
  // tooltip; only when the trigger shows a shortened label, so there is something to reveal.
33
- const tip = useInfoTip({}, { placement: 'top' });
33
+ const tip = useInfoTipHook({}, { placement: 'top' });
34
34
  const shortened = triggerLabel !== undefined && triggerLabel !== valueLabel;
35
35
  // No tip over the open menu, which already lists the full name.
36
36
  const tipVisible = shortened && !open;
37
- const showTip = () => {
38
- if (tipVisible)
39
- tip.show();
40
- };
41
- return (_jsxs(_Fragment, { children: [_jsxs("button", { ...agentHandleProps({}, { base, role: 'button', label }), ref: triggerRef, type: "button", className: 'jini-runtime-dropup-trigger' + (className ? ' ' + className : ''), "aria-label": `${label}: ${valueLabel}`, "aria-haspopup": "menu", "aria-expanded": open, "aria-controls": menuId, ...(shortened ? {} : { title: valueLabel }), onClick: () => {
42
- tip.hide();
43
- toggleOpen();
44
- }, onKeyDown: (event) => {
45
- if (event.key === 'Escape')
46
- tip.hide();
47
- handleTriggerKeyDown(event);
48
- }, onMouseEnter: showTip, onMouseLeave: tip.leave, onFocus: showTip, onBlur: tip.hide, children: [_jsx("span", { ref: tip.iconRef, className: "jini-runtime-dropup-trigger__label", children: triggerLabel ?? valueLabel }), _jsx(RemixIcon, { name: "arrow-down-s-line", size: 15, className: "jini-runtime-trigger__chevron" })] }), tip.open && tipVisible ? _jsx(RuntimeDropUpTipBubble, { tip: tip, valueLabel: valueLabel }) : null, _jsx(RuntimeDropUpMenu, { base: base, dropUp: dropUp, label: label, value: value, options: options, onSelect: onSelect, note: note })] }));
37
+ const showTip = createRuntimeDropUpTipHandler({ tipVisible, tip });
38
+ return (_jsxs(_Fragment, { children: [_jsx(RuntimeDropUpTrigger, { base: base, dropUp: dropUp, tip: tip, shortened: shortened, showTip: showTip, label: label, valueLabel: valueLabel, triggerLabel: triggerLabel, className: className }), tip.open && tipVisible ? _jsx(RuntimeDropUpTipBubble, { tip: tip, valueLabel: valueLabel }) : null, _jsx(RuntimeDropUpMenu, { base: base, dropUp: dropUp, label: label, value: value, options: options, onSelect: onSelect, note: note })] }));
39
+ }
40
+ function RuntimeDropUpTrigger({ base, dropUp, tip, shortened, showTip, label, valueLabel, triggerLabel, className }) {
41
+ const { menuId, open, triggerRef, toggleOpen, handleTriggerKeyDown } = dropUp;
42
+ return (_jsxs("button", { ...agentHandleProps({}, { base, role: 'button', label }), ref: triggerRef, type: "button", className: 'jini-runtime-dropup-trigger' + (className ? ' ' + className : ''), "aria-label": `${label}: ${valueLabel}`, "aria-haspopup": "menu", "aria-expanded": open, "aria-controls": menuId, ...(shortened ? {} : { title: valueLabel }), onClick: () => {
43
+ tip.hide();
44
+ toggleOpen();
45
+ }, onKeyDown: (event) => {
46
+ if (event.key === 'Escape')
47
+ tip.hide();
48
+ handleTriggerKeyDown(event);
49
+ }, onMouseEnter: showTip, onMouseLeave: tip.leave, onFocus: showTip, onBlur: tip.hide, children: [_jsx("span", { ref: tip.iconRef, className: "jini-runtime-dropup-trigger__label", children: triggerLabel ?? valueLabel }), _jsx(RemixIcon, { name: "arrow-down-s-line", size: 15, className: "jini-runtime-trigger__chevron" })] }));
49
50
  }
50
51
  //# sourceMappingURL=RuntimeDropUp.js.map
@@ -0,0 +1,62 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { ChatPaneAgent, ChatPaneAgentSelection, ByokRuntimeSummary } from '../types.js';
3
+ export declare function runtimeAgentStatus({ agent }: {
4
+ agent: ChatPaneAgent;
5
+ }): string;
6
+ /** Selection preflight uses the launch assessor; it never substitutes for enforcement. */
7
+ export declare function NativeToolPolicyWarning({ agent, policy, isApi, t }: {
8
+ t: (key: string) => string;
9
+ agent: ChatPaneAgent | undefined;
10
+ policy: import('@jini-ai/core/contracts/agents').NativeToolPolicyInput | undefined;
11
+ isApi: boolean;
12
+ }): ReactNode;
13
+ interface RuntimeModeButtonsProps {
14
+ base: string | undefined;
15
+ executionMode: 'local' | 'api';
16
+ daemonOnline: boolean;
17
+ apiModeAvailable: boolean;
18
+ onExecutionModeChange: ((mode: 'local' | 'api') => void) | undefined;
19
+ t: (key: string) => string;
20
+ }
21
+ export declare function RuntimeModeButtons({ base, executionMode, daemonOnline, apiModeAvailable, onExecutionModeChange, t, }: RuntimeModeButtonsProps): ReactNode;
22
+ interface RuntimeAgentListProps {
23
+ base: string | undefined;
24
+ orderedAgents: readonly ChatPaneAgent[];
25
+ value: ChatPaneAgentSelection;
26
+ onChange: (selection: ChatPaneAgentSelection) => void;
27
+ agentIconBasePath?: string;
28
+ t: (key: string) => string;
29
+ }
30
+ export declare function RuntimeAgentList({ base, orderedAgents, value, onChange, agentIconBasePath, t, }: RuntimeAgentListProps): ReactNode;
31
+ interface RuntimeBarMenusProps {
32
+ base: string | undefined;
33
+ selectedAgent: ChatPaneAgent | undefined;
34
+ value: ChatPaneAgentSelection;
35
+ onChange: (selection: ChatPaneAgentSelection) => void;
36
+ modelLabel: string;
37
+ t: (key: string) => string;
38
+ }
39
+ /**
40
+ * The composer bar's "Model ⌄" and "Effort ⌄" drop-ups for the selected CLI. These replace the
41
+ * Model / Reasoning selects that used to sit in the runtime popover under the agent list (owner
42
+ * 2026-10-18: pick them from the bar and keep the popover small); they read and write the same
43
+ * selection, so nothing else changed. Either one renders nothing when the agent publishes no
44
+ * choices for it, rather than an empty menu.
45
+ */
46
+ export declare function RuntimeBarMenus({ base, selectedAgent, value, onChange, modelLabel, t }: RuntimeBarMenusProps): ReactNode;
47
+ interface RuntimeByokDetailsProps {
48
+ base: string | undefined;
49
+ byokRuntime: ByokRuntimeSummary | undefined;
50
+ onByokModelChange: ((model: string) => void) | undefined;
51
+ t: (key: string) => string;
52
+ }
53
+ export declare function RuntimeByokDetails({ base, byokRuntime, onByokModelChange, t }: RuntimeByokDetailsProps): ReactNode;
54
+ interface RuntimeRescanFooterProps {
55
+ base: string | undefined;
56
+ onRescan: (() => void) | undefined;
57
+ scanning: boolean;
58
+ t: (key: string) => string;
59
+ }
60
+ export declare function RuntimeRescanFooter({ base, onRescan, scanning, t }: RuntimeRescanFooterProps): ReactNode;
61
+ export {};
62
+ //# sourceMappingURL=RuntimePickerSections.d.ts.map
@@ -0,0 +1,122 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from 'react';
3
+ import { AgentIcon, RemixIcon, SearchableModelSelect } from '@jini-ai/ui';
4
+ import { agentHandleProps, agentHandleSegment } from '@jini-ai/core/agent-handles';
5
+ import { InfoTip } from '@jini-ai/ui/admin-widgets';
6
+ import { assessNativeToolPolicy } from '@jini-ai/agent-runtime/native-tool-policy';
7
+ import { modelReasoningOptions } from '@jini-ai/agent-runtime/model-selection';
8
+ import { friendlyModelLabel, pickerModelValue, pickerCatalogNote, pickerModelOptions, shortModelLabel } from '../model-options.js';
9
+ import { definedProps } from '../../../util/defined-props.js';
10
+ import { RuntimeDropUp } from './RuntimeDropUp.js';
11
+ import { defaultChatPaneSelection, resolveChatPaneSelection } from '../rules.js';
12
+ export function runtimeAgentStatus({ agent }) {
13
+ if (agent.available === false)
14
+ return agent.diagnostic ?? 'Not found on PATH';
15
+ if (agent.authStatus === 'missing')
16
+ return 'Installed · sign-in required';
17
+ return agent.version ?? 'Installed';
18
+ }
19
+ /**
20
+ * An agent's `fullCliAccessNote` as a warning icon whose tip (hover, focus, tap) holds the text.
21
+ * It was a paragraph beside the model picker that squeezed the composer row (owner 2026-10-30).
22
+ * `descriptionId` lets the agent's own radio in the picker list read the same text.
23
+ */
24
+ function FullAccessNoteTip({ note, descriptionId, t }) {
25
+ return (_jsx("span", { className: "jini-runtime-access-note", children: _jsx(InfoTip, { label: t(note), triggerLabel: t('Full computer access'), descriptionId: descriptionId, placement: "top", icon: _jsx(RemixIcon, { name: "alert-line", size: 16 }) }) }));
26
+ }
27
+ /** Selection preflight uses the launch assessor; it never substitutes for enforcement. */
28
+ export function NativeToolPolicyWarning({ agent, policy, isApi, t }) {
29
+ if (!agent || isApi)
30
+ return null;
31
+ const warning = policy ? assessNativeToolPolicy({ def: agent, policy }) : null;
32
+ return _jsxs(_Fragment, { children: [agent.fullCliAccessNote ? _jsx(FullAccessNoteTip, { note: agent.fullCliAccessNote, t: t }) : null, warning ? _jsx(InfoTip, { label: t(warning), triggerLabel: t('Agent permissions required'), placement: "top", icon: _jsx(RemixIcon, { name: "alert-line", size: 16 }) }) : null] });
33
+ }
34
+ export function RuntimeModeButtons({ base, executionMode, daemonOnline, apiModeAvailable, onExecutionModeChange, t, }) {
35
+ const localModeLabel = executionMode === 'local' ? t('active') : '';
36
+ return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", ...agentHandleProps({}, { base, action: 'mode-local', role: 'button', label: t('Use Local CLI') }), className: `jini-runtime-mode${executionMode === 'local' ? ' is-active' : ''}`, disabled: !daemonOnline && executionMode !== 'local', onClick: () => onExecutionModeChange?.('local'), children: [_jsx(RemixIcon, { name: "terminal-box-line", size: 18 }), _jsx("span", { children: t('Use Local CLI') }), _jsx("span", { className: "jini-runtime-mode__meta", children: !daemonOnline ? t('offline') : localModeLabel }), executionMode === 'local' ? (_jsx(RemixIcon, { name: "check-line", size: 19, className: "jini-runtime-check" })) : null] }), _jsxs("button", { type: "button", ...agentHandleProps({}, { base, action: 'mode-api', role: 'button', label: t('Use API · BYOK') }), className: `jini-runtime-mode${executionMode === 'api' ? ' is-active' : ''}`, disabled: !apiModeAvailable, onClick: () => onExecutionModeChange?.('api'), children: [_jsx(RemixIcon, { name: "link", size: 18 }), _jsx("span", { children: t('Use API · BYOK') }), !apiModeAvailable ? _jsx("span", { className: "jini-runtime-mode__meta", children: t('not configured') }) : null, executionMode === 'api' ? (_jsx(RemixIcon, { name: "check-line", size: 19, className: "jini-runtime-check" })) : null] })] }));
37
+ }
38
+ export function RuntimeAgentList({ base, orderedAgents, value, onChange, agentIconBasePath, t, }) {
39
+ const noteIdPrefix = useId();
40
+ if (orderedAgents.length === 0) {
41
+ return _jsx("div", { className: "jini-runtime-empty", children: t('No available code agents') });
42
+ }
43
+ return (_jsx(_Fragment, { children: orderedAgents.map((agent) => (_jsx(RuntimeAgentRow, { base: base, agent: agent, status: runtimeAgentStatus({ agent }), active: agent.id === value.agentId, noteId: agent.fullCliAccessNote ? `${noteIdPrefix}-${agent.id}-note` : undefined, onChange: onChange, agentIconBasePath: agentIconBasePath, t: t }, agent.id))) }));
44
+ }
45
+ function RuntimeAgentRow({ base, agent, status, active, noteId, onChange, agentIconBasePath, t }) {
46
+ // The note's icon is a control of its own, so it sits beside the radio, never inside it.
47
+ return (_jsxs("div", { className: "jini-runtime-agent-row", children: [_jsxs("button", { type: "button", ...agentHandleProps({}, { base, action: `agent-${agentHandleSegment({ value: agent.id })}`, role: 'button', label: agent.name }), role: "radio", "aria-checked": active, className: `jini-runtime-agent${active ? ' is-active' : ''}`, "aria-current": active ? 'true' : undefined, "aria-label": `${agent.name} · ${status}`, ...(noteId ? { 'aria-describedby': noteId } : {}), onClick: () => onChange(defaultChatPaneSelection({ agent: agent })), children: [_jsx(AgentIcon, { id: agent.id, size: 20, className: "jini-runtime-agent-icon", ...definedProps({ source: { basePath: agentIconBasePath } }) }), _jsx("span", { className: "jini-runtime-agent__copy", children: _jsx("strong", { children: agent.name }) }), agent.supportsTools === false ? (_jsx("span", { className: "jini-runtime-agent__badge", title: t("This CLI has no MCP support, so it cannot use this app's tools."), children: t('No tools') })) : null, _jsx("span", { className: "jini-runtime-agent__status", children: active ? t('selected') : status }), active ? (_jsx(RemixIcon, { name: "check-line", size: 19, className: "jini-runtime-check" })) : null] }), agent.fullCliAccessNote ? _jsx(FullAccessNoteTip, { note: agent.fullCliAccessNote, descriptionId: noteId, t: t }) : null] }));
48
+ }
49
+ /**
50
+ * The composer bar's "Model ⌄" and "Effort ⌄" drop-ups for the selected CLI. These replace the
51
+ * Model / Reasoning selects that used to sit in the runtime popover under the agent list (owner
52
+ * 2026-10-18: pick them from the bar and keep the popover small); they read and write the same
53
+ * selection, so nothing else changed. Either one renders nothing when the agent publishes no
54
+ * choices for it, rather than an empty menu.
55
+ */
56
+ export function RuntimeBarMenus({ base, selectedAgent, value, onChange, modelLabel, t }) {
57
+ if (!selectedAgent)
58
+ return null;
59
+ // Raw catalog ids (an offline fallback list's rows) read as friendly names in the bar and its list.
60
+ const models = pickerModelOptions(selectedAgent).map((row) => ({ ...row, label: friendlyModelLabel({ label: row.label }) }));
61
+ const selectedModelId = pickerModelValue(selectedAgent, value.model);
62
+ const efforts = modelReasoningOptions({ agent: selectedAgent, model: models.find(option => option.id === selectedModelId) });
63
+ const modelName = friendlyModelLabel({ label: modelLabel });
64
+ return (_jsxs(_Fragment, { children: [models.length > 0 ? (_jsx(RuntimeDropUp, { agentHandle: base ? `${base}-model` : false, label: t('Model'), valueLabel: modelName,
65
+ // The agent icon sits right beside it, so the bar drops the vendor word and caps the rest.
66
+ triggerLabel: shortModelLabel({ label: modelLabel, agentId: selectedAgent.id }), value: pickerModelValue(selectedAgent, value.model), options: models, note: pickerCatalogNote(selectedAgent, t), width: 260, onSelect: (model) => onChange(value.reasoning ? resolveChatPaneSelection({
67
+ agents: [selectedAgent], requested: { ...value, model },
68
+ }) : { agentId: value.agentId, model }) })) : null, efforts.length > 0 ? (_jsx(RuntimeDropUp, { agentHandle: base ? `${base}-reasoning` : false, label: t('Reasoning'),
69
+ // An unset reasoning shows the first option, as the old native select did.
70
+ valueLabel: efforts.find((option) => option.id === value.reasoning)?.label ?? efforts[0].label, value: value.reasoning ?? '', options: efforts, width: 180, className: "jini-runtime-dropup-trigger--effort", onSelect: (reasoning) => onChange({
71
+ agentId: value.agentId,
72
+ ...(value.model ? { model: value.model } : {}),
73
+ reasoning,
74
+ }) })) : null] }));
75
+ }
76
+ /**
77
+ * What the popover shows in place of the CLI inventory while `executionMode` is `'api'`: the model
78
+ * the credential will run, and nothing else.
79
+ *
80
+ * Everything this replaces (the agent radios, the "Default (CLI config)" select, Reasoning, Rescan
81
+ * PATH) is a property of a *detected CLI process* and has no effect on an API turn — rendering them
82
+ * here was the defect.
83
+ *
84
+ * ## Why the same `SearchableModelSelect` the settings screen uses
85
+ *
86
+ * Not a look-alike `<select>`. This is literally the control `ByokProviderForm`'s Model field
87
+ * renders, fed the same discovered list and writing back to the same stored config, so the two
88
+ * surfaces cannot drift: pick a model here and the settings screen shows it, and vice versa. Its
89
+ * search box also matters at this size — a live Gemini key discovers ~40 models, which is past the
90
+ * point where a plain dropdown in a 320px popover is usable.
91
+ *
92
+ * Falls back to plain text when the host supplies no `onByokModelChange` or no model list. That is
93
+ * a real state, not a degenerate one: a host without discovery has nothing to offer a picker, and a
94
+ * disabled dropdown would read as "editable once something is enabled" when nothing here will
95
+ * enable it.
96
+ */
97
+ function resolveByokModel({ onByokModelChange }, { byokRuntime }) {
98
+ const model = byokRuntime?.model?.trim();
99
+ const models = byokRuntime?.models ?? [];
100
+ const pickModel = onByokModelChange !== undefined && models.length > 0 ? onByokModelChange : undefined;
101
+ return { model, models, pickModel };
102
+ }
103
+ export function RuntimeByokDetails({ base, byokRuntime, onByokModelChange, t }) {
104
+ const { model, models, pickModel } = resolveByokModel({ onByokModelChange }, { byokRuntime });
105
+ return (_jsxs("div", { className: "jini-runtime-models", children: [_jsxs("div", { className: "jini-runtime-select jini-runtime-byok-model", children: [_jsx("span", { children: t('Model') }), pickModel ? (_jsx(SearchableModelSelect, { agentHandle: base ? `${base}-byok-model` : false, models: models, value: model ?? '', onChange: (next) => pickModel(next), ariaLabel: t('Model'), searchPlaceholder: t('Search models'),
106
+ // The menu portals to `document.body` at the package default `z-index: 60`, while this
107
+ // popover positions itself at 1000 — so without this the model list opens BEHIND the
108
+ // popover that owns it. Raised here rather than in the shared stylesheet because 60 is
109
+ // right for every other consumer; only this one opens a portalled menu from inside an
110
+ // already-elevated surface.
111
+ menuClassName: "jini-runtime-model-menu" })) : (_jsx("strong", { children: model || t('No model configured') }))] }), !model && !pickModel ? (_jsx("div", { className: "jini-runtime-empty", children: t('Set a model in the BYOK settings before sending a message.') })) : null] }));
112
+ }
113
+ export function RuntimeRescanFooter({ base, onRescan, scanning, t }) {
114
+ if (onRescan) {
115
+ return (_jsxs("button", { type: "button", ...agentHandleProps({}, { base, action: 'rescan', role: 'button', label: t('Rescan PATH') }), className: "jini-runtime-rescan", disabled: scanning, onClick: onRescan, children: [_jsx(RemixIcon, { name: "refresh-line", size: 17, ...(scanning ? { className: 'jini-runtime-spinner' } : {}) }), _jsx("span", { children: scanning ? t('Scanning PATH…') : t('Rescan PATH') })] }));
116
+ }
117
+ if (scanning) {
118
+ return _jsx("div", { className: "jini-runtime-empty", children: t('Scanning PATH…') });
119
+ }
120
+ return null;
121
+ }
122
+ //# sourceMappingURL=RuntimePickerSections.js.map
@@ -34,7 +34,7 @@
34
34
  * single-use token minted into the dialog is what proves a human saw it. Adding a client-side
35
35
  * allow-list would suggest a protection that is not real.
36
36
  */
37
- import type { McpUiToolCall, McpUiToolCallHandler } from '@jini-ai/ui/mcp-ui';
37
+ import type { McpUiToolCall, McpUiToolCallHandler } from '@jini-ai/protocol/mcp-ui';
38
38
  import type { SurfaceEmission } from '@jini-ai/core';
39
39
  import type { SurfaceRecoveryInfo } from '../../../core/surface-recovery.js';
40
40
  export interface SurfaceRecoveryCallbacks {
@@ -7,9 +7,9 @@ import type { ChatAttachment, ChatMessage } from '@jini-ai/chat';
7
7
  import type { ComposerHistoryStoragePort } from '../../../../core/composer-history.js';
8
8
  import type { ChatTransport } from '@jini-ai/chat';
9
9
  import { type UseComposerResult } from '../../../hooks/useComposer.js';
10
- import { type UseConversationResult } from '../../../hooks/useConversation.js';
10
+ import { useConversation, type UseConversationResult, type UseConversationOptions } from '../../../hooks/useConversation.js';
11
11
  import { type UseChatPaneWorkingDirectoryResult } from './useChatPaneWorkingDirectory.hooks.js';
12
- export interface UseChatPaneOptions extends UserTextRedactionOptions {
12
+ export interface UseChatPaneOptions extends UserTextRedactionOptions, Pick<UseConversationOptions, 'report'> {
13
13
  transport: ChatTransport;
14
14
  agents: readonly ChatPaneAgent[];
15
15
  initialMessages?: ChatMessage[];
@@ -126,5 +126,7 @@ export interface UseChatPaneResult extends UseChatPaneWorkingDirectoryResult {
126
126
  interruptSend: () => void;
127
127
  reset: () => void;
128
128
  }
129
- export declare function useChatPane(options: UseChatPaneOptions): UseChatPaneResult;
129
+ export declare function useChatPane(options: UseChatPaneOptions, { useConversationHook }?: {
130
+ useConversationHook?: typeof useConversation;
131
+ }): UseChatPaneResult;
130
132
  //# sourceMappingURL=useChatPane.hooks.d.ts.map