@jini-ai/chat 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/components/MessageRow.d.ts +8 -0
- package/dist/react/components/MessageRow.d.ts.map +1 -1
- package/dist/react/components/MessageRow.js +31 -2
- package/dist/react/components/MessageRow.js.map +1 -1
- package/dist/react/features/chat-pane/components/ChatPane.d.ts.map +1 -1
- package/dist/react/features/chat-pane/components/ChatPane.js +15 -4
- package/dist/react/features/chat-pane/components/ChatPane.js.map +1 -1
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.d.ts.map +1 -1
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js +23 -3
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js.map +1 -1
- package/dist/react/features/chat-pane/types.d.ts +5 -1
- package/dist/react/features/chat-pane/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.d.ts +0 -12
- package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.d.ts.map +0 -1
- package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.js +0 -102
- package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.js.map +0 -1
- package/dist/react/features/chat-pane/react/components/ChatPane.d.ts +0 -10
- package/dist/react/features/chat-pane/react/components/ChatPane.d.ts.map +0 -1
- package/dist/react/features/chat-pane/react/components/ChatPane.js +0 -137
- package/dist/react/features/chat-pane/react/components/ChatPane.js.map +0 -1
- package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.d.ts +0 -133
- package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.d.ts.map +0 -1
- package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.js +0 -258
- package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.js.map +0 -1
- package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.d.ts +0 -66
- package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.d.ts.map +0 -1
- package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.js +0 -223
- package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.js.map +0 -1
- package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.d.ts +0 -38
- package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.d.ts.map +0 -1
- package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.js +0 -252
- package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.js.map +0 -1
- package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.d.ts +0 -26
- package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.d.ts.map +0 -1
- package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.js +0 -60
- package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.js.map +0 -1
- package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.d.ts +0 -25
- package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.d.ts.map +0 -1
- package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.js +0 -83
- package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.js.map +0 -1
- package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.d.ts +0 -38
- package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.d.ts.map +0 -1
- package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.js +0 -184
- package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.js.map +0 -1
- package/dist/react/features/chat-pane/react/styles.d.ts +0 -2
- package/dist/react/features/chat-pane/react/styles.d.ts.map +0 -1
- package/dist/react/features/chat-pane/react/styles.js +0 -863
- package/dist/react/features/chat-pane/react/styles.js.map +0 -1
- package/dist/react/features/model-picker/react/components/CredentialStatusBadge.d.ts +0 -7
- package/dist/react/features/model-picker/react/components/CredentialStatusBadge.d.ts.map +0 -1
- package/dist/react/features/model-picker/react/components/CredentialStatusBadge.js +0 -20
- package/dist/react/features/model-picker/react/components/CredentialStatusBadge.js.map +0 -1
- package/dist/react/features/model-picker/react/components/ModelPicker.d.ts +0 -9
- package/dist/react/features/model-picker/react/components/ModelPicker.d.ts.map +0 -1
- package/dist/react/features/model-picker/react/components/ModelPicker.js +0 -34
- package/dist/react/features/model-picker/react/components/ModelPicker.js.map +0 -1
- package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.d.ts +0 -27
- package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.d.ts.map +0 -1
- package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.js +0 -62
- package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AgentRuntimePicker.js","sourceRoot":"","sources":["../../../../../../src/react/features/chat-pane/react/components/AgentRuntimePicker.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AAQjD,gGAAgG;AAChG,wDAAwD;AACxD,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,CAAC;AAEtD,MAAM,UAAU,kBAAkB,CAAC,KAAoB;IACrD,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC,UAAU,IAAI,mBAAmB,CAAC;IAC9E,IA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time and
|
|
4
|
-
* working-directory orchestration owned by `@jini-ai/chat-react`.
|
|
5
|
-
*
|
|
6
|
-
* @complexity Time/space: O(n) in rendered messages, agents, and suggestions.
|
|
7
|
-
* @overallScore 100/100
|
|
8
|
-
*/
|
|
9
|
-
export declare function ChatPane({ transport, agents: injectedAgents, runtimeAccess, runtimeStatusPollMs, title, variant, initialMessages, conversationId, initialSelection, selection: controlledSelection, onSelectionChange, runContext, agentControl, onActivityChange, onMessagesChange, onRescanAgents, scanningAgents, daemonOnline, executionMode, apiModeAvailable, onExecutionModeChange, byokRuntime, onByokModelChange, initialDraft, placeholder, suggestions, workingDirectory, initialWorkingDirectory, onChangeWorkingDirectory, workingDirectoryAccess, projectFileNames, uploadAttachments, attachmentAccept, disabled, runtimePickerPlacement, composerSlots, header, leadingAccessory, footer, className, style, }: ChatPaneProps): import("react").JSX.Element;
|
|
10
|
-
//# sourceMappingURL=ChatPane.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatPane.d.ts","sourceRoot":"","sources":["../../../../../../src/react/features/chat-pane/react/components/ChatPane.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAEV,aAAa,EAId,MAAM,gBAAgB,CAAC;AAgSxB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,MAAM,EAAE,cAA6B,EACrC,aAAa,EACb,mBAA2B,EAC3B,KAAK,EACL,OAAqB,EACrB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,SAAS,EAAE,mBAAmB,EAC9B,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,cAAsB,EACtB,YAAmB,EACnB,aAAuB,EACvB,gBAAwB,EACxB,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,WAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,QAAgB,EAChB,sBAA6B,EAC7B,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,aAAa,+BAoHf"}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { WorkingDirPicker } from '@jini-ai/ui';
|
|
3
|
-
import { Composer } from '../../../../components/Composer.js';
|
|
4
|
-
import { MessageList } from '../../../../components/MessageList.js';
|
|
5
|
-
import { useT } from '../../../../hooks/context.js';
|
|
6
|
-
import { definedProps } from '../../../../util/defined-props.js';
|
|
7
|
-
import { useChatPane } from '../hooks/useChatPane.hooks.js';
|
|
8
|
-
import { useChatPaneAgentControl } from '../hooks/useChatPaneAgentControl.hooks.js';
|
|
9
|
-
import { useChatPaneFileDrop, } from '../hooks/useChatPaneFileDrop.hooks.js';
|
|
10
|
-
import { useChatPaneRuntimeInventory, } from '../hooks/useChatPaneRuntimeInventory.hooks.js';
|
|
11
|
-
import { CHAT_PANE_STYLES } from '../styles.js';
|
|
12
|
-
import { AgentRuntimePicker } from './AgentRuntimePicker.js';
|
|
13
|
-
const EMPTY_AGENTS = [];
|
|
14
|
-
function defaultHeader(title, onReset, t) {
|
|
15
|
-
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') })] }));
|
|
16
|
-
}
|
|
17
|
-
/** Collapses `header ?? defaultHeader(...)` out of `ChatPane` itself — nesting is what taxes the
|
|
18
|
-
* `??` in the caller's score, not the branch itself. */
|
|
19
|
-
function resolveChatPaneHeader(header, title, onReset, t) {
|
|
20
|
-
return header ?? defaultHeader(title, onReset, t);
|
|
21
|
-
}
|
|
22
|
-
function chatPaneClassName(variant, className) {
|
|
23
|
-
return `jini-chat-pane jini-chat-pane--${variant}${className ? ` ${className}` : ''}`;
|
|
24
|
-
}
|
|
25
|
-
function resolveRuntimeAccessView(runtimeAccess, injectedAgents, scanningAgents, daemonOnline, onRescanAgents, inventory) {
|
|
26
|
-
if (runtimeAccess === undefined) {
|
|
27
|
-
return { agents: injectedAgents, scanningAgents, daemonOnline, rescanAgents: onRescanAgents };
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
agents: inventory.agents,
|
|
31
|
-
scanningAgents: inventory.scanningAgents,
|
|
32
|
-
daemonOnline: inventory.daemonOnline,
|
|
33
|
-
rescanAgents: () => void inventory.rescanAgents(),
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function ChatPaneSuggestionsRow({ suggestions, onSelect, t }) {
|
|
37
|
-
if (suggestions.length === 0)
|
|
38
|
-
return null;
|
|
39
|
-
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))) }));
|
|
40
|
-
}
|
|
41
|
-
/** The pane's stack of mutually-independent error/status banners — each condition is its own
|
|
42
|
-
* source of truth, so they are rendered as siblings rather than folded into one derived state. */
|
|
43
|
-
function ChatPaneStatusMessages({ unavailable, conversationError, attachmentError, dropReadError, workingDirectoryError, workingDirectoryPending, workingDirectoryInvalid, runtimeInventoryError, t, }) {
|
|
44
|
-
return (_jsxs(_Fragment, { children: [unavailable ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: t('No usable CLI is selected.') })) : null, conversationError ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: conversationError.message })) : null, attachmentError ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: attachmentError.message })) : 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, workingDirectoryPending ? (_jsx("div", { className: "jini-chat-pane__status", role: "status", children: t('Checking working directory…') })) : workingDirectoryInvalid ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: t('Working directory is unavailable.') })) : null, runtimeInventoryError ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: runtimeInventoryError.message })) : null] }));
|
|
45
|
-
}
|
|
46
|
-
function ChatPaneWorkingDirectoryBlock({ workingDirectoryAccess, pane, t, }) {
|
|
47
|
-
if (workingDirectoryAccess) {
|
|
48
|
-
return (_jsx("div", { className: "jini-chat-pane__workdir", children: _jsx(WorkingDirPicker, { workingDir: pane.workingDirectory, recentDirs: [...pane.recentDirectories], onPickDirectory: () => void pane.pickWorkingDirectory(), onSelectRecent: (directory) => void pane.selectRecentDirectory(directory), placement: "up", onClear: pane.clearWorkingDirectory, invalid: pane.workingDirectoryInvalid, onOpen: () => void pane.openWorkingDirectoryPicker(), labels: { trigger: t('Select working directory') } }) }));
|
|
49
|
-
}
|
|
50
|
-
if (pane.workingDirectory) {
|
|
51
|
-
return (_jsxs("div", { className: "jini-chat-pane__workdir", children: [_jsx("strong", { children: t('Working directory') }), _jsx("code", { children: pane.workingDirectory })] }));
|
|
52
|
-
}
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
/** `uploadAttachments === undefined` gates BOTH of these — a temporarily-disabled composer still
|
|
56
|
-
* consumes a file drop so the browser cannot navigate away to the local file (see
|
|
57
|
-
* `useChatPaneFileDrop`'s module doc), so the drop handlers stay attached even when the picker
|
|
58
|
-
* itself is hidden. Shared here so `ChatPaneComposerArea` pays for the branch once, at module
|
|
59
|
-
* scope, instead of per call site. */
|
|
60
|
-
function resolveDropTargetProps(uploadAttachments, fileDrop) {
|
|
61
|
-
return uploadAttachments === undefined ? {} : fileDrop.targetProps;
|
|
62
|
-
}
|
|
63
|
-
function resolveComposerAttachmentPicker(uploadAttachments, pane, attachmentAccept) {
|
|
64
|
-
if (uploadAttachments === undefined)
|
|
65
|
-
return {};
|
|
66
|
-
return {
|
|
67
|
-
attachmentPicker: definedProps({
|
|
68
|
-
onFiles: pane.addAttachments,
|
|
69
|
-
uploading: pane.isUploadingAttachments,
|
|
70
|
-
accept: attachmentAccept,
|
|
71
|
-
}),
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
/** The drop target, composer, working-directory block, and cancel-run control — everything below
|
|
75
|
-
* the status banners that reads/writes the live pane. */
|
|
76
|
-
function ChatPaneComposerArea({ fileDrop, uploadAttachments, pane, disabled, unavailable, placeholder, slots, attachmentAccept, workingDirectoryAccess, t, }) {
|
|
77
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `jini-chat-pane__drop-target${fileDrop.draggingFiles ? ' is-dragging-files' : ''}`, "data-testid": "chat-pane-file-drop-target", "data-dragging-files": fileDrop.draggingFiles ? 'true' : 'false', ...resolveDropTargetProps(uploadAttachments, fileDrop), children: [fileDrop.draggingFiles ? (_jsx("span", { className: "jini-chat-pane__drop-announcement", role: "status", children: t('Drop files to attach') })) : null, _jsx(Composer, { composer: pane.composer, onSend: () => void pane.send(), disabled: disabled || unavailable || pane.conversation.isStreaming, sendDisabled: !pane.canSend, ...definedProps({ placeholder }), slots: slots, ...resolveComposerAttachmentPicker(uploadAttachments, pane, attachmentAccept) }), _jsx(ChatPaneWorkingDirectoryBlock, { workingDirectoryAccess: workingDirectoryAccess, pane: pane, t: t })] }), pane.conversation.isStreaming ? (_jsx("button", { type: "button", className: "jini-chat-pane__cancel", onClick: pane.conversation.cancel, children: t('Stop run') })) : null] }));
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Renders the self-contained chat-pane composition, including runtime and
|
|
81
|
-
* working-directory orchestration owned by `@jini-ai/chat-react`.
|
|
82
|
-
*
|
|
83
|
-
* @complexity Time/space: O(n) in rendered messages, agents, and suggestions.
|
|
84
|
-
* @overallScore 100/100
|
|
85
|
-
*/
|
|
86
|
-
export function ChatPane({ transport, agents: injectedAgents = EMPTY_AGENTS, runtimeAccess, runtimeStatusPollMs = 5_000, title, variant = 'workspace', initialMessages, conversationId, initialSelection, selection: controlledSelection, onSelectionChange, runContext, agentControl, onActivityChange, onMessagesChange, onRescanAgents, scanningAgents = false, daemonOnline = true, executionMode = 'local', apiModeAvailable = false, onExecutionModeChange, byokRuntime, onByokModelChange, initialDraft, placeholder, suggestions = [], workingDirectory, initialWorkingDirectory, onChangeWorkingDirectory, workingDirectoryAccess, projectFileNames, uploadAttachments, attachmentAccept, disabled = false, runtimePickerPlacement = 'up', composerSlots, header, leadingAccessory, footer, className, style, }) {
|
|
87
|
-
const t = useT();
|
|
88
|
-
const inventory = useChatPaneRuntimeInventory(definedProps({
|
|
89
|
-
access: runtimeAccess,
|
|
90
|
-
initialAgents: injectedAgents,
|
|
91
|
-
pollIntervalMs: runtimeStatusPollMs,
|
|
92
|
-
}));
|
|
93
|
-
const runtimeView = resolveRuntimeAccessView(runtimeAccess, injectedAgents, scanningAgents, daemonOnline, onRescanAgents, inventory);
|
|
94
|
-
const pane = useChatPane(definedProps({
|
|
95
|
-
transport,
|
|
96
|
-
agents: runtimeView.agents,
|
|
97
|
-
initialMessages,
|
|
98
|
-
conversationId,
|
|
99
|
-
initialSelection,
|
|
100
|
-
selection: controlledSelection,
|
|
101
|
-
onSelectionChange,
|
|
102
|
-
runContext,
|
|
103
|
-
initialDraft,
|
|
104
|
-
uploadAttachments,
|
|
105
|
-
onActivityChange,
|
|
106
|
-
onMessagesChange,
|
|
107
|
-
workingDirectory,
|
|
108
|
-
initialWorkingDirectory,
|
|
109
|
-
onChangeWorkingDirectory,
|
|
110
|
-
workingDirectoryAccess,
|
|
111
|
-
}));
|
|
112
|
-
// No `runContext` here on purpose: agent-driven sends go through `pane.sendPrompt`, which builds
|
|
113
|
-
// the context from the SAME `runContext` already handed to `useChatPane` above. A second copy
|
|
114
|
-
// would be a second source of truth that could silently drift from the composer's.
|
|
115
|
-
useChatPaneAgentControl(pane, definedProps({
|
|
116
|
-
enabled: agentControl?.enabled ?? false,
|
|
117
|
-
bridgeAccess: agentControl?.bridgeAccess,
|
|
118
|
-
}));
|
|
119
|
-
// Selection resolution only returns available agents, so absence is the
|
|
120
|
-
// single fail-closed state the view needs to represent.
|
|
121
|
-
const unavailable = pane.selectedAgent === undefined;
|
|
122
|
-
const fileDrop = useChatPaneFileDrop({
|
|
123
|
-
enabled: uploadAttachments !== undefined
|
|
124
|
-
&& !disabled
|
|
125
|
-
&& !unavailable
|
|
126
|
-
&& !pane.conversation.isStreaming
|
|
127
|
-
&& !pane.isUploadingAttachments,
|
|
128
|
-
onFiles: pane.addAttachments,
|
|
129
|
-
});
|
|
130
|
-
const slots = definedProps({
|
|
131
|
-
...composerSlots,
|
|
132
|
-
leadingAccessories: leadingAccessory,
|
|
133
|
-
footerAccessories: (_jsx(AgentRuntimePicker, { agents: runtimeView.agents, value: pane.selection, onChange: pane.setSelection, ...definedProps({ onRescan: runtimeView.rescanAgents }), scanning: runtimeView.scanningAgents, daemonOnline: runtimeView.daemonOnline, placement: runtimePickerPlacement, executionMode: executionMode, apiModeAvailable: apiModeAvailable, ...definedProps({ onExecutionModeChange, byokRuntime, onByokModelChange }) })),
|
|
134
|
-
});
|
|
135
|
-
return (_jsxs("section", { className: chatPaneClassName(variant, className), style: style, "data-activity": pane.activity, children: [_jsx("style", { "data-jini-chat-pane-styles": "true", children: CHAT_PANE_STYLES }), resolveChatPaneHeader(header, title, pane.reset, t), _jsxs("div", { className: "jini-chat-pane__body", children: [_jsx(MessageList, { messages: pane.conversation.messages, isStreaming: pane.conversation.isStreaming, scrollIntent: pane.conversation.scrollIntent, onScrolled: pane.conversation.acknowledgeScroll, ...(projectFileNames === undefined ? {} : { projectFileNames: new Set(projectFileNames) }) }), _jsxs("div", { className: "jini-chat-pane__controls", children: [_jsx(ChatPaneSuggestionsRow, { suggestions: suggestions, onSelect: pane.composer.setDraft, t: t }), _jsx(ChatPaneStatusMessages, { unavailable: unavailable, conversationError: pane.conversation.error, attachmentError: pane.attachmentError, dropReadError: fileDrop.dropReadError, workingDirectoryError: pane.workingDirectoryError, workingDirectoryPending: pane.workingDirectoryPending, workingDirectoryInvalid: pane.workingDirectoryInvalid, runtimeInventoryError: inventory.runtimeInventoryError, t: t }), _jsx(ChatPaneComposerArea, { fileDrop: fileDrop, uploadAttachments: uploadAttachments, pane: pane, disabled: disabled, unavailable: unavailable, placeholder: placeholder, slots: slots, attachmentAccept: attachmentAccept, workingDirectoryAccess: workingDirectoryAccess, t: t })] })] }), footer] }));
|
|
136
|
-
}
|
|
137
|
-
//# sourceMappingURL=ChatPane.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatPane.js","sourceRoot":"","sources":["../../../../../../src/react/features/chat-pane/react/components/ChatPane.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAQjE,OAAO,EAAE,WAAW,EAA0B,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EACL,mBAAmB,GAGpB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,2BAA2B,GAE5B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,YAAY,GAAyC,EAAE,CAAC;AAE9D,SAA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of `AgentRuntimePicker`'s behavior, so the component itself is only markup.
|
|
3
|
-
*
|
|
4
|
-
* What lives here is popover mechanics — open/close, dismissal, viewport-bounded positioning,
|
|
5
|
-
* focus restoration, and roving/trapped keyboard focus — plus the two derived labels the view
|
|
6
|
-
* shows. None of it is chat-specific; the only reason it is scoped to this feature rather than
|
|
7
|
-
* promoted to `@jini-ai/ui` is noted at the bottom of this comment.
|
|
8
|
-
*
|
|
9
|
-
* The pure functions below are separated from the hook deliberately: geometry and key-to-index
|
|
10
|
-
* resolution have real input/output contracts and edge cases (viewport clamping, `currentIndex`
|
|
11
|
-
* of `-1`, Tab-at-an-edge) that are far cheaper to test directly than to drive through a rendered
|
|
12
|
-
* popover with a mocked `getBoundingClientRect`. The hook itself owns only React lifecycle.
|
|
13
|
-
*
|
|
14
|
-
* **Not yet using `@jini-ai/ui`'s `useDismissOnOutsideOrEscape`**, which covers the same
|
|
15
|
-
* outside-click/Escape ground and whose own doc notes six features had hand-rolled it before this
|
|
16
|
-
* one. Two concrete mismatches block a drop-in: it takes a single `containerRef`, whereas here
|
|
17
|
-
* "inside" means the trigger *or* the portaled popover (two disjoint subtrees, since the popover
|
|
18
|
-
* renders into `document.body`); and it exposes one `onDismiss` with no indication of which input
|
|
19
|
-
* dismissed, while this popover must restore focus on the next tick for a pointer and immediately
|
|
20
|
-
* for Escape (see the comment on that timeout). Consolidating means extending the shared hook to
|
|
21
|
-
* accept multiple containers and report the dismissal cause — worth doing, but as its own change
|
|
22
|
-
* to a package other features already depend on, not as a side effect of this extraction.
|
|
23
|
-
*/
|
|
24
|
-
import { type CSSProperties, type KeyboardEvent as ReactKeyboardEvent, type RefObject } from 'react';
|
|
25
|
-
import type { ByokRuntimeSummary, ChatPaneAgent, ChatPaneAgentSelection, RuntimePickerPlacement } from '../../types.js';
|
|
26
|
-
/**
|
|
27
|
-
* Resolves the user-facing label for a selected model or reasoning option.
|
|
28
|
-
*
|
|
29
|
-
* @complexity Time: O(n) in the supplied option count; space: O(1).
|
|
30
|
-
* @overallScore 100/100
|
|
31
|
-
*/
|
|
32
|
-
export declare function runtimeOptionLabel(options: readonly {
|
|
33
|
-
id: string;
|
|
34
|
-
label: string;
|
|
35
|
-
}[] | undefined, value: string | undefined, fallback: string): string;
|
|
36
|
-
/**
|
|
37
|
-
* Computes a viewport-bounded fixed position for the body-portaled picker.
|
|
38
|
-
*
|
|
39
|
-
* @complexity Time/space: O(1).
|
|
40
|
-
* @overallScore 100/100
|
|
41
|
-
*/
|
|
42
|
-
export declare function runtimePopoverPosition(trigger: DOMRect, placement: RuntimePickerPlacement): CSSProperties;
|
|
43
|
-
/** `Tab` wraps focus around the popover's control list instead of leaving it (the popover is a
|
|
44
|
-
* modal-ish dialog). Returns the index to wrap TO, or `null` when `Tab` should behave natively
|
|
45
|
-
* (not at an edge). `currentIndex` may be `-1` (active element not in `controls`); `atStart`/
|
|
46
|
-
* `atEnd` below only matter when it legitimately is 0 or `count - 1`. */
|
|
47
|
-
export declare function resolveTabWrapIndex(shiftKey: boolean, currentIndex: number, count: number): number | null;
|
|
48
|
-
/** Arrow/Home/End roving-tabindex target, or `null` for any other key. `currentIndex === -1`
|
|
49
|
-
* (nothing in `controls` focused yet) is a legitimate input — the modulo arithmetic below relies
|
|
50
|
-
* on it wrapping the same way a real index would. */
|
|
51
|
-
export declare function resolveRovingIndex(key: string, currentIndex: number, count: number): number | null;
|
|
52
|
-
/**
|
|
53
|
-
* The control index the popover's key handler should move focus to, or `null` to leave focus alone
|
|
54
|
-
* (and, in the caller, to skip `preventDefault()`). `Tab` is resolved and returned immediately —
|
|
55
|
-
* it must never fall through to the roving-tabindex logic below it.
|
|
56
|
-
*/
|
|
57
|
-
export declare function resolvePopoverKeyAction(key: string, shiftKey: boolean, isButtonTarget: boolean, currentIndex: number, count: number): number | null;
|
|
58
|
-
/** Builds the one-line "which runtime am I talking to" summary shown in the popover head. */
|
|
59
|
-
export declare function runtimeSummaryText(selectedAgent: ChatPaneAgent | undefined, modelLabel: string, t: (key: string) => string): string;
|
|
60
|
-
/**
|
|
61
|
-
* The head/trigger labels while `executionMode` is `'api'`.
|
|
62
|
-
*
|
|
63
|
-
* Separate from {@link runtimeSummaryText} rather than folded into it because the two describe
|
|
64
|
-
* different things and fail differently: that one names a detected CLI and its model, this one
|
|
65
|
-
* names a provider and the model the credential is configured for, and neither has a sensible
|
|
66
|
-
* fallback to the other. A missing provider label here is not "no agent selected" — the API path is
|
|
67
|
-
* still what will run — so the fallback is a generic mode name, never a CLI's.
|
|
68
|
-
*
|
|
69
|
-
* @complexity Time/space: O(1).
|
|
70
|
-
*/
|
|
71
|
-
export declare function byokSummaryText(byokRuntime: ByokRuntimeSummary | undefined, t: (key: string) => string): {
|
|
72
|
-
title: string;
|
|
73
|
-
modelLabel: string;
|
|
74
|
-
summary: string;
|
|
75
|
-
};
|
|
76
|
-
export interface UseAgentRuntimePickerOptions {
|
|
77
|
-
agents: readonly ChatPaneAgent[];
|
|
78
|
-
value: ChatPaneAgentSelection;
|
|
79
|
-
placement: RuntimePickerPlacement;
|
|
80
|
-
/** Translator, injected rather than read from context so this hook is testable without a provider. */
|
|
81
|
-
t: (key: string) => string;
|
|
82
|
-
/** Which runtime the labels below should describe. Defaults to `'local'`, preserving the
|
|
83
|
-
* pre-BYOK behavior for every caller that does not pass one. */
|
|
84
|
-
executionMode?: 'local' | 'api';
|
|
85
|
-
/** Only read when `executionMode` is `'api'`. Explicitly `| undefined` because the package builds
|
|
86
|
-
* under `exactOptionalPropertyTypes` and the component forwards its own optional prop straight
|
|
87
|
-
* through. */
|
|
88
|
-
byokRuntime?: ByokRuntimeSummary | undefined;
|
|
89
|
-
}
|
|
90
|
-
export interface UseAgentRuntimePickerResult {
|
|
91
|
-
/** Ties the trigger's `aria-controls` to the popover's `id`. */
|
|
92
|
-
dialogId: string;
|
|
93
|
-
open: boolean;
|
|
94
|
-
/** Undefined until the trigger has been measured; the popover does not render before then. */
|
|
95
|
-
position: CSSProperties | undefined;
|
|
96
|
-
triggerRef: RefObject<HTMLButtonElement | null>;
|
|
97
|
-
popoverRef: RefObject<HTMLDivElement | null>;
|
|
98
|
-
/** Unavailable agents removed, then ordered — what the radio group renders. */
|
|
99
|
-
orderedAgents: readonly ChatPaneAgent[];
|
|
100
|
-
selectedAgent: ChatPaneAgent | undefined;
|
|
101
|
-
modelLabel: string;
|
|
102
|
-
runtimeSummary: string;
|
|
103
|
-
/** What the collapsed trigger names as the runtime — the selected CLI in `'local'`, the provider
|
|
104
|
-
* in `'api'`. A separate field because the trigger must NOT fall back to `selectedAgent.name`
|
|
105
|
-
* while an API turn is what would actually run. */
|
|
106
|
-
triggerTitle: string;
|
|
107
|
-
/**
|
|
108
|
-
* The `data-theme` of the place the popover was opened FROM, or `null` when the host pins none.
|
|
109
|
-
*
|
|
110
|
-
* The popover renders through `createPortal` into `document.body`, so it escapes any `data-theme`
|
|
111
|
-
* on an ancestor of the trigger — and `@jini-ai/ui` themes entirely through `[data-theme]` token
|
|
112
|
-
* blocks, with its DARK values on a bare `@media (prefers-color-scheme: dark) { :root { … } }`.
|
|
113
|
-
* The consequence is not hypothetical: measured in Tovu's admin on a dark-mode machine, the
|
|
114
|
-
* popover itself looked right (the chat package's own `--jini-chat-*` tokens default light) while
|
|
115
|
-
* the `@jini-ai/ui` control inside it — the BYOK model select — resolved against that dark `:root`
|
|
116
|
-
* block and rendered dark-on-dark inside an all-light admin.
|
|
117
|
-
*
|
|
118
|
-
* So the popover carries its origin's theme with it, the same compensation `CustomSelect` already
|
|
119
|
-
* makes for its own portaled menu. `null` leaves document-level theming untouched, so a host that
|
|
120
|
-
* pins nothing is byte-identical to before.
|
|
121
|
-
*/
|
|
122
|
-
originTheme: string | null;
|
|
123
|
-
toggleOpen: () => void;
|
|
124
|
-
handlePopoverKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Owns the runtime picker's popover state so the component stays presentational.
|
|
128
|
-
*
|
|
129
|
-
* @complexity Time: O(n) in the agent count for ordering/selection; space: O(n) for the ordered
|
|
130
|
-
* snapshot. The DOM queries are O(c) in the popover's own control count.
|
|
131
|
-
*/
|
|
132
|
-
export declare function useAgentRuntimePicker({ agents, value, placement, t, executionMode, byokRuntime, }: UseAgentRuntimePickerOptions): UseAgentRuntimePickerResult;
|
|
133
|
-
//# sourceMappingURL=useAgentRuntimePicker.hooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAgentRuntimePicker.hooks.d.ts","sourceRoot":"","sources":["../../../../../../src/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,aAAa,IAAI,kBAAkB,EACxC,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AAKxB;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,SAAS,EAC7D,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,sBAAsB,GAChC,aAAa,CA+Bf;AAED;;;yEAGyE;AACzE,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIzG;AAED;;qDAEqD;AACrD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,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C,cAAc,GAAG,IAAI,CAAC,CAAC;IAC7C,+EAA+E;IAC/E,aAAa,EAAE,SAAS,aAAa,EAAE,CAAC;IACxC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB;;wDAEoD;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;;;;OAcG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,oBAAoB,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;CAC3E;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,KAAK,EACL,SAAS,EACT,CAAC,EACD,aAAuB,EACvB,WAAW,GACZ,EAAE,4BAA4B,GAAG,2BAA2B,CAgI5D"}
|
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* All of `AgentRuntimePicker`'s behavior, so the component itself is only markup.
|
|
3
|
-
*
|
|
4
|
-
* What lives here is popover mechanics — open/close, dismissal, viewport-bounded positioning,
|
|
5
|
-
* focus restoration, and roving/trapped keyboard focus — plus the two derived labels the view
|
|
6
|
-
* shows. None of it is chat-specific; the only reason it is scoped to this feature rather than
|
|
7
|
-
* promoted to `@jini-ai/ui` is noted at the bottom of this comment.
|
|
8
|
-
*
|
|
9
|
-
* The pure functions below are separated from the hook deliberately: geometry and key-to-index
|
|
10
|
-
* resolution have real input/output contracts and edge cases (viewport clamping, `currentIndex`
|
|
11
|
-
* of `-1`, Tab-at-an-edge) that are far cheaper to test directly than to drive through a rendered
|
|
12
|
-
* popover with a mocked `getBoundingClientRect`. The hook itself owns only React lifecycle.
|
|
13
|
-
*
|
|
14
|
-
* **Not yet using `@jini-ai/ui`'s `useDismissOnOutsideOrEscape`**, which covers the same
|
|
15
|
-
* outside-click/Escape ground and whose own doc notes six features had hand-rolled it before this
|
|
16
|
-
* one. Two concrete mismatches block a drop-in: it takes a single `containerRef`, whereas here
|
|
17
|
-
* "inside" means the trigger *or* the portaled popover (two disjoint subtrees, since the popover
|
|
18
|
-
* renders into `document.body`); and it exposes one `onDismiss` with no indication of which input
|
|
19
|
-
* dismissed, while this popover must restore focus on the next tick for a pointer and immediately
|
|
20
|
-
* for Escape (see the comment on that timeout). Consolidating means extending the shared hook to
|
|
21
|
-
* accept multiple containers and report the dismissal cause — worth doing, but as its own change
|
|
22
|
-
* to a package other features already depend on, not as a side effect of this extraction.
|
|
23
|
-
*/
|
|
24
|
-
import { useCallback, useEffect, useId, useMemo, useRef, useState, } from 'react';
|
|
25
|
-
import { orderChatPaneAgents } from '../../rules.js';
|
|
26
|
-
/** Everything in the popover a roving/trapping key handler is allowed to move focus between. */
|
|
27
|
-
const FOCUSABLE_CONTROLS = 'button:not(:disabled), select:not(:disabled), input:not(:disabled)';
|
|
28
|
-
/**
|
|
29
|
-
* Resolves the user-facing label for a selected model or reasoning option.
|
|
30
|
-
*
|
|
31
|
-
* @complexity Time: O(n) in the supplied option count; space: O(1).
|
|
32
|
-
* @overallScore 100/100
|
|
33
|
-
*/
|
|
34
|
-
export function runtimeOptionLabel(options, value, fallback) {
|
|
35
|
-
if (!value || value === 'default')
|
|
36
|
-
return fallback;
|
|
37
|
-
return options?.find((option) => option.id === value)?.label ?? value;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Computes a viewport-bounded fixed position for the body-portaled picker.
|
|
41
|
-
*
|
|
42
|
-
* @complexity Time/space: O(1).
|
|
43
|
-
* @overallScore 100/100
|
|
44
|
-
*/
|
|
45
|
-
export function runtimePopoverPosition(trigger, placement) {
|
|
46
|
-
const margin = 12;
|
|
47
|
-
const gap = 8;
|
|
48
|
-
const width = Math.min(320, window.innerWidth - margin * 2);
|
|
49
|
-
const left = Math.min(Math.max(trigger.left + trigger.width / 2 - width / 2, margin), window.innerWidth - width - margin);
|
|
50
|
-
if (placement === 'up') {
|
|
51
|
-
const availableHeight = Math.max(0, trigger.top - margin - gap);
|
|
52
|
-
return {
|
|
53
|
-
position: 'fixed',
|
|
54
|
-
left,
|
|
55
|
-
bottom: Math.max(margin, window.innerHeight - trigger.top + gap),
|
|
56
|
-
width,
|
|
57
|
-
maxHeight: Math.min(620, availableHeight),
|
|
58
|
-
overflowY: 'auto',
|
|
59
|
-
zIndex: 1000,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
const top = trigger.bottom + gap;
|
|
63
|
-
const availableHeight = Math.max(0, window.innerHeight - top - margin);
|
|
64
|
-
return {
|
|
65
|
-
position: 'fixed',
|
|
66
|
-
top,
|
|
67
|
-
left,
|
|
68
|
-
width,
|
|
69
|
-
maxHeight: Math.min(620, availableHeight),
|
|
70
|
-
overflowY: 'auto',
|
|
71
|
-
zIndex: 1000,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
/** `Tab` wraps focus around the popover's control list instead of leaving it (the popover is a
|
|
75
|
-
* modal-ish dialog). Returns the index to wrap TO, or `null` when `Tab` should behave natively
|
|
76
|
-
* (not at an edge). `currentIndex` may be `-1` (active element not in `controls`); `atStart`/
|
|
77
|
-
* `atEnd` below only matter when it legitimately is 0 or `count - 1`. */
|
|
78
|
-
export function resolveTabWrapIndex(shiftKey, currentIndex, count) {
|
|
79
|
-
if (shiftKey && currentIndex === 0)
|
|
80
|
-
return count - 1;
|
|
81
|
-
if (!shiftKey && currentIndex === count - 1)
|
|
82
|
-
return 0;
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
/** Arrow/Home/End roving-tabindex target, or `null` for any other key. `currentIndex === -1`
|
|
86
|
-
* (nothing in `controls` focused yet) is a legitimate input — the modulo arithmetic below relies
|
|
87
|
-
* on it wrapping the same way a real index would. */
|
|
88
|
-
export function resolveRovingIndex(key, currentIndex, count) {
|
|
89
|
-
if (key === 'Home')
|
|
90
|
-
return 0;
|
|
91
|
-
if (key === 'End')
|
|
92
|
-
return count - 1;
|
|
93
|
-
if (key === 'ArrowDown')
|
|
94
|
-
return (currentIndex + 1 + count) % count;
|
|
95
|
-
if (key === 'ArrowUp')
|
|
96
|
-
return (currentIndex - 1 + count) % count;
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* The control index the popover's key handler should move focus to, or `null` to leave focus alone
|
|
101
|
-
* (and, in the caller, to skip `preventDefault()`). `Tab` is resolved and returned immediately —
|
|
102
|
-
* it must never fall through to the roving-tabindex logic below it.
|
|
103
|
-
*/
|
|
104
|
-
export function resolvePopoverKeyAction(key, shiftKey, isButtonTarget, currentIndex, count) {
|
|
105
|
-
if (key === 'Tab')
|
|
106
|
-
return resolveTabWrapIndex(shiftKey, currentIndex, count);
|
|
107
|
-
// Native selects own their arrow/Home/End behavior. Roving applies only
|
|
108
|
-
// when a button (including the agent radios) has focus.
|
|
109
|
-
if (!isButtonTarget)
|
|
110
|
-
return null;
|
|
111
|
-
return resolveRovingIndex(key, currentIndex, count);
|
|
112
|
-
}
|
|
113
|
-
/** Builds the one-line "which runtime am I talking to" summary shown in the popover head. */
|
|
114
|
-
export function runtimeSummaryText(selectedAgent, modelLabel, t) {
|
|
115
|
-
if (selectedAgent === undefined)
|
|
116
|
-
return t('No agent selected');
|
|
117
|
-
const version = selectedAgent.version ? ` · ${selectedAgent.version}` : '';
|
|
118
|
-
return `${selectedAgent.name}${version} · ${modelLabel}`;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* The head/trigger labels while `executionMode` is `'api'`.
|
|
122
|
-
*
|
|
123
|
-
* Separate from {@link runtimeSummaryText} rather than folded into it because the two describe
|
|
124
|
-
* different things and fail differently: that one names a detected CLI and its model, this one
|
|
125
|
-
* names a provider and the model the credential is configured for, and neither has a sensible
|
|
126
|
-
* fallback to the other. A missing provider label here is not "no agent selected" — the API path is
|
|
127
|
-
* still what will run — so the fallback is a generic mode name, never a CLI's.
|
|
128
|
-
*
|
|
129
|
-
* @complexity Time/space: O(1).
|
|
130
|
-
*/
|
|
131
|
-
export function byokSummaryText(byokRuntime, t) {
|
|
132
|
-
const title = byokRuntime?.providerLabel?.trim() || t('API · BYOK');
|
|
133
|
-
const model = byokRuntime?.model?.trim();
|
|
134
|
-
const modelLabel = model || t('No model configured');
|
|
135
|
-
return { title, modelLabel, summary: `${title} · ${modelLabel}` };
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Owns the runtime picker's popover state so the component stays presentational.
|
|
139
|
-
*
|
|
140
|
-
* @complexity Time: O(n) in the agent count for ordering/selection; space: O(n) for the ordered
|
|
141
|
-
* snapshot. The DOM queries are O(c) in the popover's own control count.
|
|
142
|
-
*/
|
|
143
|
-
export function useAgentRuntimePicker({ agents, value, placement, t, executionMode = 'local', byokRuntime, }) {
|
|
144
|
-
const dialogId = useId();
|
|
145
|
-
const [open, setOpen] = useState(false);
|
|
146
|
-
const [position, setPosition] = useState();
|
|
147
|
-
const triggerRef = useRef(null);
|
|
148
|
-
const popoverRef = useRef(null);
|
|
149
|
-
const orderedAgents = useMemo(() => orderChatPaneAgents(agents.filter((agent) => agent.available !== false)), [agents]);
|
|
150
|
-
const selectedAgent = orderedAgents.find((agent) => agent.id === value.agentId);
|
|
151
|
-
// `selectedAgent` stays resolved in BOTH modes on purpose — the CLI selection is still the stored
|
|
152
|
-
// one, and switching back to Local CLI must not have silently lost it. What changes in `'api'` is
|
|
153
|
-
// only what gets DESCRIBED, because none of the CLI's labels are true of an API turn.
|
|
154
|
-
const localModelLabel = runtimeOptionLabel(selectedAgent?.models, value.model, t('Default model'));
|
|
155
|
-
const byok = byokSummaryText(byokRuntime, t);
|
|
156
|
-
const isApi = executionMode === 'api';
|
|
157
|
-
const modelLabel = isApi ? byok.modelLabel : localModelLabel;
|
|
158
|
-
const runtimeSummary = isApi ? byok.summary : runtimeSummaryText(selectedAgent, localModelLabel, t);
|
|
159
|
-
const triggerTitle = isApi ? byok.title : (selectedAgent?.name ?? t('Choose agent'));
|
|
160
|
-
// Read during render rather than in an effect: the popover only mounts once `open` is true, which
|
|
161
|
-
// is itself a re-render, and `triggerRef` is populated at the first commit — so by the time this
|
|
162
|
-
// value is used it is always resolved. See `originTheme` on the result type for why it exists.
|
|
163
|
-
const originTheme = triggerRef.current?.closest('[data-theme]')?.getAttribute('data-theme') ?? null;
|
|
164
|
-
const focusTrigger = useCallback(() => {
|
|
165
|
-
triggerRef.current?.focus();
|
|
166
|
-
}, []);
|
|
167
|
-
const toggleOpen = useCallback(() => {
|
|
168
|
-
setOpen((current) => !current);
|
|
169
|
-
}, []);
|
|
170
|
-
useEffect(() => {
|
|
171
|
-
if (!open)
|
|
172
|
-
return;
|
|
173
|
-
const closeOnOutsidePointer = (event) => {
|
|
174
|
-
const target = event.target;
|
|
175
|
-
if (triggerRef.current?.contains(target)
|
|
176
|
-
|| popoverRef.current?.contains(target)
|
|
177
|
-
// A control INSIDE the popover may itself portal its menu to `document.body` —
|
|
178
|
-
// `@jini-ai/ui`'s `CustomSelect` (and so `SearchableModelSelect`, which the BYOK model row
|
|
179
|
-
// uses) does exactly that. Such a menu is a descendant of neither ref, so without this the
|
|
180
|
-
// first mousedown on a model option would be read as an outside click and close the
|
|
181
|
-
// popover out from under the selection the operator was making.
|
|
182
|
-
|| (target instanceof Element && target.closest('.jini-select-menu') !== null))
|
|
183
|
-
return;
|
|
184
|
-
setOpen(false);
|
|
185
|
-
// Let the pointer's click complete before restoring focus. Otherwise the
|
|
186
|
-
// browser focuses the clicked node after this mousedown handler runs.
|
|
187
|
-
window.setTimeout(focusTrigger, 0);
|
|
188
|
-
};
|
|
189
|
-
const closeOnEscape = (event) => {
|
|
190
|
-
if (event.key !== 'Escape')
|
|
191
|
-
return;
|
|
192
|
-
setOpen(false);
|
|
193
|
-
focusTrigger();
|
|
194
|
-
};
|
|
195
|
-
document.addEventListener('mousedown', closeOnOutsidePointer);
|
|
196
|
-
document.addEventListener('keydown', closeOnEscape);
|
|
197
|
-
return () => {
|
|
198
|
-
document.removeEventListener('mousedown', closeOnOutsidePointer);
|
|
199
|
-
document.removeEventListener('keydown', closeOnEscape);
|
|
200
|
-
};
|
|
201
|
-
}, [focusTrigger, open]);
|
|
202
|
-
useEffect(() => {
|
|
203
|
-
if (!open)
|
|
204
|
-
return;
|
|
205
|
-
const update = () => {
|
|
206
|
-
const rect = triggerRef.current?.getBoundingClientRect();
|
|
207
|
-
if (rect)
|
|
208
|
-
setPosition(runtimePopoverPosition(rect, placement));
|
|
209
|
-
};
|
|
210
|
-
update();
|
|
211
|
-
window.addEventListener('resize', update);
|
|
212
|
-
// Capture phase: a scroll inside any ancestor moves the trigger too, and scroll does not bubble.
|
|
213
|
-
window.addEventListener('scroll', update, true);
|
|
214
|
-
return () => {
|
|
215
|
-
window.removeEventListener('resize', update);
|
|
216
|
-
window.removeEventListener('scroll', update, true);
|
|
217
|
-
};
|
|
218
|
-
}, [open, placement]);
|
|
219
|
-
useEffect(() => {
|
|
220
|
-
if (!open || !position)
|
|
221
|
-
return;
|
|
222
|
-
const popover = popoverRef.current;
|
|
223
|
-
const selectedRadio = popover?.querySelector('[role="radio"][aria-checked="true"]');
|
|
224
|
-
const fallback = popover?.querySelector(FOCUSABLE_CONTROLS);
|
|
225
|
-
(selectedRadio ?? fallback)?.focus();
|
|
226
|
-
}, [open, position]);
|
|
227
|
-
const handlePopoverKeyDown = useCallback((event) => {
|
|
228
|
-
// No `?? []` fallback for a null ref: this handler is only ever reachable via the
|
|
229
|
-
// `onKeyDown` React wires to the exact element `popoverRef` is attached to, and
|
|
230
|
-
// React attaches refs during commit — before that element can dispatch any event — so
|
|
231
|
-
// `popoverRef.current` is guaranteed non-null by the time this runs.
|
|
232
|
-
const controls = [...popoverRef.current.querySelectorAll(FOCUSABLE_CONTROLS)];
|
|
233
|
-
if (controls.length === 0)
|
|
234
|
-
return;
|
|
235
|
-
const currentIndex = controls.indexOf(document.activeElement);
|
|
236
|
-
const nextIndex = resolvePopoverKeyAction(event.key, event.shiftKey, event.target instanceof HTMLButtonElement, currentIndex, controls.length);
|
|
237
|
-
if (nextIndex === null)
|
|
238
|
-
return;
|
|
239
|
-
event.preventDefault();
|
|
240
|
-
controls[nextIndex]?.focus();
|
|
241
|
-
}, []);
|
|
242
|
-
return {
|
|
243
|
-
dialogId,
|
|
244
|
-
open,
|
|
245
|
-
position,
|
|
246
|
-
triggerRef,
|
|
247
|
-
popoverRef,
|
|
248
|
-
orderedAgents,
|
|
249
|
-
selectedAgent,
|
|
250
|
-
modelLabel,
|
|
251
|
-
runtimeSummary,
|
|
252
|
-
triggerTitle,
|
|
253
|
-
originTheme,
|
|
254
|
-
toggleOpen,
|
|
255
|
-
handlePopoverKeyDown,
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
//# sourceMappingURL=useAgentRuntimePicker.hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAgentRuntimePicker.hooks.js","sourceRoot":"","sources":["../../../../../../src/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAQrD,gGAAgG;AAChG,MAAM,kBAAkB,GAAG,oEAAoE,CAAC;AAEhG;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAA6D,EAC7D,KAAyB,EACzB,QAAgB;IAEhB,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IACnD,OAAO,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,KAAK,IAAI,KAAK,CAAC;AACxE,CAAC;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