@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.
- package/CHANGELOG.md +2 -2
- package/README.md +3 -3
- package/dist/contracts/chat-bubble-style.d.ts +1 -1
- package/dist/contracts/chat-bubble-style.js +1 -1
- package/dist/core/ag-ui/event-projection.d.ts +125 -0
- package/dist/core/ag-ui/event-projection.js +275 -0
- package/dist/core/ag-ui/event-reduction.d.ts +39 -0
- package/dist/core/ag-ui/event-reduction.js +99 -0
- package/dist/core/ag-ui/run-input.d.ts +53 -0
- package/dist/core/ag-ui/run-input.js +87 -0
- package/dist/core/agentic/chat-capabilities.d.ts +1 -1
- package/dist/core/agentic/index.d.ts +2 -4
- package/dist/core/agentic/index.js +2 -3
- package/dist/core/agents-port.d.ts +50 -0
- package/dist/core/agents-port.js +2 -0
- package/dist/core/assistant-client/ag-ui-fetch-agent.d.ts +16 -0
- package/dist/core/assistant-client/ag-ui-fetch-agent.js +24 -0
- package/dist/core/assistant-client/ag-ui-transport.d.ts +15 -1
- package/dist/core/assistant-client/ag-ui-transport.js +167 -145
- package/dist/core/assistant-client/attachment-liveness.js +13 -11
- package/dist/core/assistant-client/durable-run-subscription.d.ts +3 -2
- package/dist/core/assistant-client/durable-run-subscription.js +6 -5
- package/dist/core/assistant-client/messages.d.ts +7 -4
- package/dist/core/assistant-client/messages.js +5 -4
- package/dist/core/assistant-client/transport.d.ts +1 -1
- package/dist/core/assistant-client/transport.js +4 -4
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +1 -0
- package/dist/core/page-port.d.ts +15 -0
- package/dist/core/page-port.js +2 -0
- package/dist/core/run-activity.js +1 -1
- package/dist/core/run-events/entry.js +1 -0
- package/dist/core/user-text-redaction.d.ts +1 -3
- package/dist/core/user-text-redaction.js +3 -61
- package/dist/embed-widget/browser/agent-inventory.d.ts +37 -0
- package/dist/embed-widget/browser/agent-inventory.js +36 -0
- package/dist/embed-widget/browser/frontend-session-bridge.d.ts +2 -2
- package/dist/embed-widget/browser/frontend-session-bridge.js +17 -14
- package/dist/embed-widget/react/dialog.hooks.d.ts +16 -0
- package/dist/embed-widget/react/dialog.hooks.js +15 -0
- package/dist/embed-widget/react/embed.d.ts +7 -2
- package/dist/embed-widget/react/embed.js +6 -16
- package/dist/embed-widget/react/header.d.ts +4 -1
- package/dist/embed-widget/react/header.js +2 -2
- package/dist/embed-widget/vanilla/state.js +2 -2
- package/dist/embed-widget/vanilla/style.css +4 -4
- package/dist/react/components/A2uiSurfaceCard.d.ts +18 -4
- package/dist/react/components/A2uiSurfaceCard.hooks.d.ts +36 -0
- package/dist/react/components/A2uiSurfaceCard.hooks.js +174 -0
- package/dist/react/components/A2uiSurfaceCard.js +14 -227
- package/dist/react/components/A2uiSurfaceCard.rules.d.ts +14 -0
- package/dist/react/components/A2uiSurfaceCard.rules.js +24 -0
- package/dist/react/components/AttachmentPreviewModal.d.ts +21 -1
- package/dist/react/components/AttachmentPreviewModal.hooks.js +1 -3
- package/dist/react/components/AttachmentPreviewModal.js +11 -9
- package/dist/react/components/AttachmentTray.d.ts +11 -1
- package/dist/react/components/AttachmentTray.js +12 -8
- package/dist/react/components/ChatFab.d.ts +10 -1
- package/dist/react/components/ChatFab.js +2 -2
- package/dist/react/components/ChatSettingsDialog.d.ts +4 -3
- package/dist/react/components/ChatSettingsDialog.js +9 -6
- package/dist/react/components/ChatSettingsSegmented.d.ts +1 -1
- package/dist/react/components/ChatSettingsSegmented.js +1 -1
- package/dist/react/components/Composer.d.ts +9 -1
- package/dist/react/components/Composer.hooks.d.ts +79 -0
- package/dist/react/components/Composer.hooks.js +336 -0
- package/dist/react/components/Composer.js +40 -341
- package/dist/react/components/ComposerDiscovery.js +1 -1
- package/dist/react/components/ConversationList.d.ts +34 -1
- package/dist/react/components/ConversationList.hooks.d.ts +37 -0
- package/dist/react/components/ConversationList.hooks.js +177 -1
- package/dist/react/components/ConversationList.js +7 -174
- package/dist/react/components/ConversationTitleEditor.d.ts +17 -2
- package/dist/react/components/ConversationTitleEditor.hooks.d.ts +15 -0
- package/dist/react/components/ConversationTitleEditor.hooks.js +36 -0
- package/dist/react/components/ConversationTitleEditor.js +11 -34
- package/dist/react/components/CopyMessageButton.d.ts +6 -1
- package/dist/react/components/CopyMessageButton.js +4 -4
- package/dist/react/components/ExtEventErrorBoundary.d.ts +2 -0
- package/dist/react/components/ExtEventErrorBoundary.js +5 -3
- package/dist/react/components/FolderChips.d.ts +11 -1
- package/dist/react/components/FolderChips.hooks.d.ts +12 -0
- package/dist/react/components/FolderChips.hooks.js +10 -0
- package/dist/react/components/FolderChips.js +9 -9
- package/dist/react/components/Markdown.js +7 -5
- package/dist/react/components/McpUiSurfaceCard.d.ts +29 -5
- package/dist/react/components/McpUiSurfaceCard.js +29 -16
- package/dist/react/components/MessageList.d.ts +10 -1
- package/dist/react/components/MessageList.hooks.js +4 -2
- package/dist/react/components/MessageList.js +12 -8
- package/dist/react/components/MessageRow.d.ts +46 -2
- package/dist/react/components/MessageRow.hooks.d.ts +60 -0
- package/dist/react/components/MessageRow.hooks.js +94 -0
- package/dist/react/components/MessageRow.js +53 -113
- package/dist/react/components/MidRunUserMessage.d.ts +6 -1
- package/dist/react/components/MidRunUserMessage.js +5 -5
- package/dist/react/components/NextStepActions.d.ts +3 -1
- package/dist/react/components/NextStepActions.js +3 -3
- package/dist/react/components/QuestionForm.answers.hooks.d.ts +26 -0
- package/dist/react/components/QuestionForm.answers.hooks.js +89 -0
- package/dist/react/components/QuestionForm.d.ts +6 -0
- package/dist/react/components/QuestionForm.js +23 -261
- package/dist/react/components/QuestionForm.values.d.ts +22 -0
- package/dist/react/components/QuestionForm.values.js +58 -0
- package/dist/react/components/QuestionFormField.d.ts +17 -0
- package/dist/react/components/QuestionFormField.js +114 -0
- package/dist/react/components/QuestionsPanel.d.ts +3 -1
- package/dist/react/components/QuestionsPanel.js +7 -3
- package/dist/react/components/SentAttachment.d.ts +11 -2
- package/dist/react/components/SentAttachment.hooks.d.ts +1 -1
- package/dist/react/components/SentAttachment.hooks.js +6 -5
- package/dist/react/components/SentAttachment.js +5 -3
- package/dist/react/components/TodoCard.d.ts +3 -1
- package/dist/react/components/TodoCard.js +9 -4
- package/dist/react/components/ToolCallGroup.d.ts +11 -1
- package/dist/react/components/ToolCallGroup.js +10 -4
- package/dist/react/components/ToolCard.d.ts +6 -1
- package/dist/react/components/ToolCard.js +79 -69
- package/dist/react/components/mcp-ui-question-input.d.ts +1 -1
- package/dist/react/components/mcp-ui-question-input.js +3 -3
- package/dist/react/components/mcp-ui-surface-state.d.ts +1 -1
- package/dist/react/features/chat-pane/agent-tools.d.ts +1 -1
- package/dist/react/features/chat-pane/antigravity/model-options.d.ts +2 -0
- package/dist/react/features/chat-pane/antigravity/model-options.js +2 -0
- package/dist/react/features/chat-pane/claude/model-options.d.ts +2 -0
- package/dist/react/features/chat-pane/claude/model-options.js +2 -0
- package/dist/react/features/chat-pane/codex/model-options.d.ts +2 -0
- package/dist/react/features/chat-pane/codex/model-options.js +2 -0
- package/dist/react/features/chat-pane/components/AgentPluginUsage.d.ts +4 -1
- package/dist/react/features/chat-pane/components/AgentPluginUsage.js +2 -2
- package/dist/react/features/chat-pane/components/AgentRuntimePicker.d.ts +10 -6
- package/dist/react/features/chat-pane/components/AgentRuntimePicker.js +18 -132
- package/dist/react/features/chat-pane/components/ChatPane.d.ts +24 -2
- package/dist/react/features/chat-pane/components/ChatPane.js +45 -297
- package/dist/react/features/chat-pane/components/ChatPaneComposerArea.d.ts +33 -0
- package/dist/react/features/chat-pane/components/ChatPaneComposerArea.js +119 -0
- package/dist/react/features/chat-pane/components/ChatPaneLayout.d.ts +42 -0
- package/dist/react/features/chat-pane/components/ChatPaneLayout.js +54 -0
- package/dist/react/features/chat-pane/components/ChatPaneStatus.d.ts +27 -0
- package/dist/react/features/chat-pane/components/ChatPaneStatus.js +91 -0
- package/dist/react/features/chat-pane/components/RuntimeDropUp.d.ts +6 -1
- package/dist/react/features/chat-pane/components/RuntimeDropUp.js +20 -19
- package/dist/react/features/chat-pane/components/RuntimePickerSections.d.ts +62 -0
- package/dist/react/features/chat-pane/components/RuntimePickerSections.js +122 -0
- package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.d.ts +1 -1
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.d.ts +5 -3
- package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js +78 -26
- package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.js +6 -6
- package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.d.ts +5 -1
- package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.js +7 -7
- package/dist/react/features/chat-pane/hooks/useRuntimeDropUp.hooks.d.ts +7 -0
- package/dist/react/features/chat-pane/hooks/useRuntimeDropUp.hooks.js +5 -0
- package/dist/react/features/chat-pane/model-options.js +7 -4
- package/dist/react/features/chat-pane/styles.d.ts +1 -1
- package/dist/react/features/chat-pane/styles.js +14 -14
- package/dist/react/features/chat-pane/types.d.ts +29 -1
- package/dist/react/hooks/assistant-chats-contracts.d.ts +1 -1
- package/dist/react/hooks/attachment-preview-cache.d.ts +1 -1
- package/dist/react/hooks/attachment-preview-cache.js +1 -1
- package/dist/react/hooks/fab-position.js +16 -18
- package/dist/react/hooks/useConversation.d.ts +6 -1
- package/dist/react/hooks/useConversation.js +11 -10
- package/dist/react/hooks/useRunStream.d.ts +3 -0
- package/dist/react/hooks/useRunStream.js +12 -12
- package/dist/react/hooks/useSurfaceRecovery.d.ts +1 -1
- package/dist/react/hooks/useSurfaceRecovery.js +2 -2
- package/dist/react/index.d.ts +6 -3
- package/dist/react/index.js +5 -3
- package/dist/react/styles/chat-settings.css +9 -9
- package/dist/react/surfaces.d.ts +91 -0
- package/dist/react/surfaces.js +28 -0
- package/dist/server/durable-runs/recover.d.ts +4 -3
- package/dist/server/durable-runs/recover.js +4 -3
- package/dist/store/legacy/sqlite/conversations.d.ts +1 -2
- package/dist/store/legacy/sqlite/conversations.js +1 -1
- package/dist/store/legacy/sqlite/messages.d.ts +2 -3
- package/dist/store/legacy/sqlite/messages.js +6 -6
- package/dist/store/pglite/index.d.ts +7 -7
- package/dist/store/pglite/index.js +1 -1
- package/dist/store/ports.d.ts +5 -2
- package/dist/store/postgres/index.d.ts +7 -7
- package/dist/store/postgres/index.js +1 -1
- package/dist/store/runtime/chat-expiry-sweep.js +2 -4
- package/dist/store/runtime/chat-history-store.js +2 -3
- package/dist/store/runtime/durable-run-store.js +16 -2
- package/dist/store/runtime/history-tools.js +33 -11
- package/dist/store/runtime/kernel.d.ts +3 -2
- package/dist/store/runtime/run-ledger.js +2 -2
- package/dist/store/sql/boundary.d.ts +5 -5
- package/dist/store/sql/maintenance.d.ts +3 -2
- package/dist/store/sql/store.d.ts +16 -8
- package/dist/store/sql/store.js +31 -14
- package/dist/store/sqlite/index.d.ts +11 -12
- package/dist/store/sqlite/index.js +5 -5
- package/dist/store/sqlite/schema.d.ts +1 -1
- package/package.json +49 -27
- package/dist/core/ag-ui/entry.d.ts +0 -84
- package/dist/core/ag-ui/entry.js +0 -225
- package/dist/core/browser/page-actions.d.ts +0 -121
- package/dist/core/browser/page-actions.js +0 -113
- package/dist/embed-widget/browser/page-actions.d.ts +0 -2
- package/dist/embed-widget/browser/page-actions.js +0 -3
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module AttachmentPreviewModal
|
|
3
|
+
*
|
|
4
|
+
* The "can we see it again" modal `MessageRow.tsx`'s attachment chip opens: an image scaled to fit,
|
|
5
|
+
* a scrollable monospace pane for a text-ish file, or - honestly, never a faked preview - the
|
|
6
|
+
* filename/type/size for anything else. All state/effects live in `useAttachmentPreviewModal`; this
|
|
7
|
+
* is the presentational shell, native-`<dialog>`-based like `Markdown.tsx`'s `TableBlock` pop-out.
|
|
8
|
+
* With `navigation` (more than one image in the message or the composer's staged set) a footer adds
|
|
9
|
+
* previous/next side by side in the bottom-right corner, plus ←/→ on the dialog.
|
|
10
|
+
*/
|
|
11
|
+
import { useT } from '../hooks/context.js';
|
|
1
12
|
import type { ChatAttachment } from '../../core/index.js';
|
|
13
|
+
import { useAttachmentPreviewModal } from './AttachmentPreviewModal.hooks.js';
|
|
2
14
|
import type { AttachmentPreviewNavigation } from './AttachmentGallery.hooks.js';
|
|
3
15
|
export interface AttachmentPreviewModalProps {
|
|
4
16
|
attachment: ChatAttachment;
|
|
@@ -6,5 +18,13 @@ export interface AttachmentPreviewModalProps {
|
|
|
6
18
|
/** Previous/next over the surrounding images; omitted for a lone attachment. */
|
|
7
19
|
navigation?: AttachmentPreviewNavigation | undefined;
|
|
8
20
|
}
|
|
9
|
-
|
|
21
|
+
/** Hooks AttachmentPreviewModal calls; defaults to the real ones, a test hands in fakes. */
|
|
22
|
+
export declare const defaultAttachmentPreviewModalHooks: {
|
|
23
|
+
useT: typeof useT;
|
|
24
|
+
useAttachmentPreviewModal: typeof useAttachmentPreviewModal;
|
|
25
|
+
};
|
|
26
|
+
export type AttachmentPreviewModalHooks = typeof defaultAttachmentPreviewModalHooks;
|
|
27
|
+
export declare function AttachmentPreviewModal({ attachment, onClose, navigation, hooks }: AttachmentPreviewModalProps & {
|
|
28
|
+
hooks?: AttachmentPreviewModalHooks | undefined;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
10
30
|
//# sourceMappingURL=AttachmentPreviewModal.d.ts.map
|
|
@@ -167,7 +167,6 @@ export function useAttachmentPreviewModal({ attachment, onClose, navigation }, {
|
|
|
167
167
|
const url = URL.createObjectURL(cachedFile);
|
|
168
168
|
setImageUrl(url);
|
|
169
169
|
return () => URL.revokeObjectURL(url);
|
|
170
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
171
170
|
}, [attemptImage, cachedFile]);
|
|
172
171
|
useEffect(() => {
|
|
173
172
|
if (!attemptText || !cachedFile) {
|
|
@@ -196,8 +195,7 @@ export function useAttachmentPreviewModal({ attachment, onClose, navigation }, {
|
|
|
196
195
|
return () => {
|
|
197
196
|
canceled = true;
|
|
198
197
|
};
|
|
199
|
-
|
|
200
|
-
}, [attemptText, cachedFile]);
|
|
198
|
+
}, [attemptText, cachedFile, readText]);
|
|
201
199
|
function handleNativeCancel(event) {
|
|
202
200
|
// Always prevented, same reasoning as `ConfirmDialog.hooks.tsx`: the effect above is the single
|
|
203
201
|
// source of truth for open/closed, so Escape still closes — it just does so through `onClose`
|
|
@@ -12,9 +12,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
12
12
|
import { useT } from '../hooks/context.js';
|
|
13
13
|
import { Icon } from './Icon.js';
|
|
14
14
|
import { looksLikeImageAttachment, useAttachmentPreviewModal } from './AttachmentPreviewModal.hooks.js';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
/** Hooks AttachmentPreviewModal calls; defaults to the real ones, a test hands in fakes. */
|
|
16
|
+
export const defaultAttachmentPreviewModalHooks = { useT, useAttachmentPreviewModal };
|
|
17
|
+
export function AttachmentPreviewModal({ attachment, onClose, navigation, hooks = defaultAttachmentPreviewModalHooks }) {
|
|
18
|
+
const t = hooks.useT();
|
|
19
|
+
const c = hooks.useAttachmentPreviewModal({ attachment: attachment, onClose: onClose, navigation });
|
|
18
20
|
return (_jsxs("dialog", { ref: c.dialogRef, className: `jini-attachment-preview-dialog${navigation ? ' has-nav' : ''}`, role: "dialog", "aria-modal": "true", "aria-label": t('{name} preview', { name: attachment.name }), onCancel: c.handleNativeCancel, onClick: c.handleBackdropClick, onKeyDown: c.handleKeyDown, children: [_jsxs("div", { className: "jini-attachment-preview-header", children: [_jsx("span", { className: "jini-attachment-preview-name", title: attachment.name, children: attachment.name }), _jsx("button", { type: "button", className: "jini-attachment-preview-close", onClick: onClose, title: t('Close'), "aria-label": t('Close'), children: _jsx(Icon, { name: "close", size: 16 }) })] }), _jsx("div", { className: "jini-attachment-preview-body", children: _jsx(AttachmentPreviewBody, { attachment: attachment, preview: c }) }), navigation ? _jsx(AttachmentPreviewNav, { navigation: navigation }) : null] }));
|
|
19
21
|
}
|
|
20
22
|
/** The image, the text pane, or - for anything else - the filename/type/size card. */
|
|
@@ -26,19 +28,19 @@ function AttachmentPreviewBody({ attachment, preview }) {
|
|
|
26
28
|
return _jsx(AttachmentTextPane, { preview: preview });
|
|
27
29
|
return _jsx(AttachmentMetaCard, { attachment: attachment, sizeLabel: preview.sizeLabel });
|
|
28
30
|
}
|
|
29
|
-
function AttachmentTextPane({ preview }) {
|
|
30
|
-
const t =
|
|
31
|
+
function AttachmentTextPane({ preview, useTHook = useT }) {
|
|
32
|
+
const t = useTHook();
|
|
31
33
|
if (preview.textLoading)
|
|
32
34
|
return _jsx("div", { className: "jini-attachment-preview-loading", children: t('Loading…') });
|
|
33
35
|
return (_jsxs(_Fragment, { children: [_jsx("pre", { className: "jini-attachment-preview-text", children: preview.text?.content ?? '' }), preview.text?.truncated ? (_jsx("div", { className: "jini-attachment-preview-truncated", children: t('Preview truncated — this file is larger than the preview limit.') })) : null] }));
|
|
34
36
|
}
|
|
35
|
-
function AttachmentMetaCard({ attachment, sizeLabel }) {
|
|
36
|
-
const t =
|
|
37
|
+
function AttachmentMetaCard({ attachment, sizeLabel, useTHook = useT }) {
|
|
38
|
+
const t = useTHook();
|
|
37
39
|
return (_jsxs("div", { className: "jini-attachment-preview-meta", children: [_jsxs("div", { className: "jini-attachment-preview-meta-row", children: [_jsx("span", { className: "jini-attachment-preview-meta-label", children: t('Name') }), _jsx("span", { children: attachment.name })] }), _jsxs("div", { className: "jini-attachment-preview-meta-row", children: [_jsx("span", { className: "jini-attachment-preview-meta-label", children: t('Type') }), _jsx("span", { children: looksLikeImageAttachment({ attachment: attachment }) ? t('Image') : t('File') })] }), sizeLabel ? (_jsxs("div", { className: "jini-attachment-preview-meta-row", children: [_jsx("span", { className: "jini-attachment-preview-meta-label", children: t('Size') }), _jsx("span", { children: sizeLabel })] })) : null, _jsx("div", { className: "jini-attachment-preview-meta-note", children: t('A preview is not available for this file.') })] }));
|
|
38
40
|
}
|
|
39
41
|
/** Previous/next side by side in the bottom-right corner, with the "2 / 5" position before them. */
|
|
40
|
-
function AttachmentPreviewNav({ navigation }) {
|
|
41
|
-
const t =
|
|
42
|
+
function AttachmentPreviewNav({ navigation, useTHook = useT }) {
|
|
43
|
+
const t = useTHook();
|
|
42
44
|
return (_jsxs("div", { className: "jini-attachment-preview-nav", children: [_jsx("span", { className: "jini-attachment-preview-count", "aria-live": "polite", children: t('{index} / {count}', { index: navigation.index + 1, count: navigation.count }) }), _jsx("button", { type: "button", className: "jini-attachment-preview-step", onClick: navigation.onPrevious, title: t('Previous image'), "aria-label": t('Previous image'), children: _jsx(Icon, { name: "chevron-left", size: 18 }) }), _jsx("button", { type: "button", className: "jini-attachment-preview-step", onClick: navigation.onNext, title: t('Next image'), "aria-label": t('Next image'), children: _jsx(Icon, { name: "chevron-right", size: 18 }) })] }));
|
|
43
45
|
}
|
|
44
46
|
//# sourceMappingURL=AttachmentPreviewModal.js.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { useT } from '../hooks/context.js';
|
|
1
2
|
import type { AttachmentTraySlot } from '../slots.js';
|
|
3
|
+
import { useAttachmentGallery } from './AttachmentGallery.hooks.js';
|
|
2
4
|
import { type ObjectUrlPort } from './SentAttachment.hooks.js';
|
|
3
5
|
import { formatAttachmentSize } from './attachment-size.js';
|
|
4
6
|
export { formatAttachmentSize };
|
|
@@ -9,5 +11,13 @@ export type AttachmentTrayProps = AttachmentTraySlot & {
|
|
|
9
11
|
/** An upload is still running: shows a spinning placeholder chip after the staged ones. */
|
|
10
12
|
uploading?: boolean | undefined;
|
|
11
13
|
};
|
|
12
|
-
|
|
14
|
+
/** Hooks AttachmentTray calls; defaults to the real ones, a test hands in fakes. */
|
|
15
|
+
export declare const defaultAttachmentTrayHooks: {
|
|
16
|
+
useT: typeof useT;
|
|
17
|
+
useAttachmentGallery: typeof useAttachmentGallery;
|
|
18
|
+
};
|
|
19
|
+
export type AttachmentTrayHooks = typeof defaultAttachmentTrayHooks;
|
|
20
|
+
export declare function AttachmentTray({ agentHandle, attachments, onRemove, renderItem, objectUrls, uploading, hooks }: AttachmentTrayProps & {
|
|
21
|
+
hooks?: AttachmentTrayHooks | undefined;
|
|
22
|
+
}): import("react").JSX.Element | null;
|
|
13
23
|
//# sourceMappingURL=AttachmentTray.d.ts.map
|
|
@@ -12,7 +12,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
* sent message's thumbnail reads) and opens the shared `AttachmentPreviewModal`, with previous/next
|
|
13
13
|
* across the staged images - before sending, the operator can check which screenshots are going.
|
|
14
14
|
*/
|
|
15
|
-
import { agentHandleProps, agentHandleSegment } from '@jini-ai/
|
|
15
|
+
import { agentHandleProps, agentHandleSegment } from '@jini-ai/core/agent-handles';
|
|
16
16
|
import { useT } from '../hooks/context.js';
|
|
17
17
|
import { Icon } from './Icon.js';
|
|
18
18
|
import { AttachmentPreviewModal } from './AttachmentPreviewModal.js';
|
|
@@ -22,17 +22,21 @@ import { useSentAttachmentThumbnail } from './SentAttachment.hooks.js';
|
|
|
22
22
|
import { formatAttachmentSize } from './attachment-size.js';
|
|
23
23
|
// Re-exported: callers and tests have always imported it from here.
|
|
24
24
|
export { formatAttachmentSize };
|
|
25
|
-
|
|
25
|
+
/** Hooks AttachmentTray calls; defaults to the real ones, a test hands in fakes. */
|
|
26
|
+
export const defaultAttachmentTrayHooks = { useT, useAttachmentGallery };
|
|
27
|
+
export function AttachmentTray({ agentHandle, attachments, onRemove, renderItem, objectUrls, uploading = false, hooks = defaultAttachmentTrayHooks }) {
|
|
26
28
|
const base = agentHandle || undefined;
|
|
27
|
-
const t = useT();
|
|
28
|
-
const gallery = useAttachmentGallery({ attachments });
|
|
29
|
+
const t = hooks.useT();
|
|
30
|
+
const gallery = hooks.useAttachmentGallery({ attachments });
|
|
29
31
|
if (attachments.length === 0 && !uploading)
|
|
30
32
|
return null;
|
|
31
|
-
return (_jsxs("div", { className: "jini-attachment-tray", "data-testid": "composer-attachment-tray", children: [attachments.map((a) => (_jsxs("div", { className: "jini-attachment-chip", "data-testid": "attachment-chip", "data-attachment-kind": a.kind, "data-attachment-name": a.name, children: [renderItem ? renderItem(a) : _jsx(DefaultAttachmentChip, { base: base, attachment: a, onOpen: gallery.open, objectUrls: objectUrls }), _jsx("button", { ...agentHandleProps({}, { base, action: `remove-${agentHandleSegment({ value: a.path })}`, role: 'button', label: t('Remove {name}', { name: a.name }) }), type: "button", className: "jini-attachment-remove", onClick: () => onRemove(a.path), title: t('Remove {name}', { name: a.name }), "aria-label": t('Remove {name}', { name: a.name }), children: _jsx(Icon, { name: "close", size: 12 }) })] }, a.path))), uploading ? (_jsxs("div", { className: "jini-attachment-chip is-uploading", "data-testid": "attachment-uploading-chip", children: [_jsx("span", { className: "jini-attachment-chip-icon", children: _jsx(Icon, { name: "spinner", size: 15 }) }), _jsx("span", { className: "jini-attachment-chip-copy", children: _jsx("span", { className: "jini-attachment-chip-name", children: t('Uploading…') }) })] })) : null, gallery.opened ? (_jsx(AttachmentPreviewModal, { attachment: gallery.opened, onClose: gallery.close, navigation: gallery.navigation })) : null] }));
|
|
33
|
+
return (_jsxs("div", { className: "jini-attachment-tray", "data-testid": "composer-attachment-tray", children: [attachments.map((a) => (_jsxs("div", { className: "jini-attachment-chip", "data-testid": "attachment-chip", "data-attachment-kind": a.kind, "data-attachment-name": a.name, children: [renderItem ? renderItem(a) : _jsx(DefaultAttachmentChip, { base: base, attachment: a, onOpen: gallery.open, objectUrls: objectUrls }), _jsx("button", { ...agentHandleProps({}, { base, action: `remove-${agentHandleSegment({ value: a.path })}`, role: 'button', label: t('Remove {name}', { name: a.name }) }), type: "button", className: "jini-attachment-remove", onClick: () => onRemove(a.path), title: t('Remove {name}', { name: a.name }), "aria-label": t('Remove {name}', { name: a.name }), children: _jsx(Icon, { name: "close", size: 12 }) })] }, a.path))), uploading ? (_jsxs("div", { className: "jini-attachment-chip jini-is-uploading", "data-testid": "attachment-uploading-chip", children: [_jsx("span", { className: "jini-attachment-chip-icon", children: _jsx(Icon, { name: "spinner", size: 15 }) }), _jsx("span", { className: "jini-attachment-chip-copy", children: _jsx("span", { className: "jini-attachment-chip-name", children: t('Uploading…') }) })] })) : null, gallery.opened ? (_jsx(AttachmentPreviewModal, { attachment: gallery.opened, onClose: gallery.close, navigation: gallery.navigation })) : null] }));
|
|
32
34
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
/** Hooks DefaultAttachmentChip calls; defaults to the real ones, a test hands in fakes. */
|
|
36
|
+
const defaultDefaultAttachmentChipHooks = { useT, useSentAttachmentThumbnail };
|
|
37
|
+
function DefaultAttachmentChip({ base, attachment, onOpen, objectUrls, hooks = defaultDefaultAttachmentChipHooks }) {
|
|
38
|
+
const t = hooks.useT();
|
|
39
|
+
const { thumbnailUrl, onThumbnailError } = hooks.useSentAttachmentThumbnail({ attachment }, objectUrls === undefined ? {} : { objectUrls });
|
|
36
40
|
const size = formatAttachmentSize({ size: attachment.size });
|
|
37
41
|
const label = thumbnailUrl && isOpaqueAttachmentName({ name: attachment.name }) ? t('Image') : attachment.name;
|
|
38
42
|
return (_jsxs("button", { type: "button", ...agentHandleProps({}, { base, action: `open-${agentHandleSegment({ value: attachment.path })}`, role: 'button', label: t('Open {name}', { name: attachment.name }) }), className: "jini-attachment-chip-body", onClick: () => onOpen(attachment), title: t('Open {name}', { name: attachment.name }), "aria-label": t('Open {name}', { name: attachment.name }), children: [thumbnailUrl ? (_jsx("img", { className: "jini-attachment-chip-thumb", src: thumbnailUrl, alt: "", onError: onThumbnailError })) : (_jsx("span", { className: `jini-attachment-chip-icon is-${attachment.kind}`, children: _jsx(Icon, { name: attachment.kind === 'image' ? 'image' : 'file', size: 15 }) })), _jsxs("span", { className: "jini-attachment-chip-copy", children: [_jsx("span", { className: "jini-attachment-chip-name", children: label }), size ? _jsx("small", { className: "jini-attachment-chip-size", children: size }) : null] })] }));
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module ChatFab
|
|
3
|
+
*
|
|
4
|
+
* A draggable floating button that opens and closes a chat pane. This package ships unstyled
|
|
5
|
+
* semantic markup (same convention as the rest of `@jini-ai/chat-react`) — a host supplies CSS
|
|
6
|
+
* for the `chat-fab`/`chat-fab-open` classes.
|
|
7
|
+
*/
|
|
8
|
+
import { useChatFabDrag } from '../hooks/useChatFabDrag.js';
|
|
1
9
|
export interface ChatFabProps {
|
|
2
10
|
readonly open: boolean;
|
|
3
11
|
readonly onToggle: () => void;
|
|
@@ -6,6 +14,7 @@ export interface ChatFabProps {
|
|
|
6
14
|
readonly 'aria-label'?: string;
|
|
7
15
|
readonly 'aria-controls'?: string;
|
|
8
16
|
readonly 'aria-haspopup'?: 'dialog';
|
|
17
|
+
useChatFabDragHook?: typeof useChatFabDrag;
|
|
9
18
|
}
|
|
10
|
-
export declare function ChatFab({ open, onToggle, label, 'aria-label': accessibleLabel, 'aria-controls': controls, 'aria-haspopup': popup }: ChatFabProps): import("react").JSX.Element;
|
|
19
|
+
export declare function ChatFab({ open, onToggle, label, 'aria-label': accessibleLabel, 'aria-controls': controls, 'aria-haspopup': popup, useChatFabDragHook }: ChatFabProps): import("react").JSX.Element;
|
|
11
20
|
//# sourceMappingURL=ChatFab.d.ts.map
|
|
@@ -7,8 +7,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
* for the `chat-fab`/`chat-fab-open` classes.
|
|
8
8
|
*/
|
|
9
9
|
import { useChatFabDrag } from '../hooks/useChatFabDrag.js';
|
|
10
|
-
export function ChatFab({ open, onToggle, label = 'chat', 'aria-label': accessibleLabel, 'aria-controls': controls, 'aria-haspopup': popup }) {
|
|
11
|
-
const { buttonRef, position, onPointerDown, onPointerMove, onPointerUp, onPointerCancel } =
|
|
10
|
+
export function ChatFab({ open, onToggle, label = 'chat', 'aria-label': accessibleLabel, 'aria-controls': controls, 'aria-haspopup': popup, useChatFabDragHook = useChatFabDrag }) {
|
|
11
|
+
const { buttonRef, position, onPointerDown, onPointerMove, onPointerUp, onPointerCancel } = useChatFabDragHook({ onClick: onToggle });
|
|
12
12
|
return (_jsx("button", { ref: buttonRef, type: "button", className: `chat-fab${open ? ' chat-fab-open' : ''}`,
|
|
13
13
|
// Not `onClick`: the pointer gesture already decides click-versus-drag, and keeping both
|
|
14
14
|
// would fire the toggle twice on a tap.
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { type ChatPermissionsPort, type ChatSettingsSection } from './ChatSettingsDialog.hooks.js';
|
|
1
|
+
import { useChatSettingsView, type ChatPermissionsPort, type ChatSettingsSection } from './ChatSettingsDialog.hooks.js';
|
|
2
2
|
/** Advanced chat settings; the host supplies display actions, capabilities and persistence.
|
|
3
3
|
* Native dialog semantics own modal focus containment; closing restores the opener.
|
|
4
4
|
* Header and tabs stay fixed while only the active panel scrolls.
|
|
5
5
|
*/
|
|
6
|
-
export declare function ChatSettingsDialog(required: {
|
|
6
|
+
export declare function ChatSettingsDialog({ useChatSettingsViewHook, ...required }: {
|
|
7
|
+
useChatSettingsViewHook?: typeof useChatSettingsView;
|
|
7
8
|
open: boolean;
|
|
8
9
|
onClose: () => void;
|
|
9
10
|
displaySections: readonly ChatSettingsSection[];
|
|
10
11
|
permissions: ChatPermissionsPort;
|
|
11
12
|
t?: (key: string) => string;
|
|
12
|
-
}
|
|
13
|
+
}): import("react").JSX.Element;
|
|
13
14
|
//# sourceMappingURL=ChatSettingsDialog.d.ts.map
|
|
@@ -9,7 +9,7 @@ import { ChatSettingsSegmented } from './ChatSettingsSegmented.js';
|
|
|
9
9
|
* Earlier (owner) ⓘ tips floated away from their icon, so this row showed visible text only; on 2026-10-18 the owner approved per-option ⓘ help, which InfoTip now anchors to the icon.
|
|
10
10
|
* Later that day radio groups moved to one ⓘ beside their legend; a switch keeps its own, which now
|
|
11
11
|
* sits right after its label like the legend's (owner, 2026-10-21) instead of at the row's far edge. */
|
|
12
|
-
function SettingSwitch(required
|
|
12
|
+
function SettingSwitch(required) {
|
|
13
13
|
const inputId = useId();
|
|
14
14
|
return _jsxs("div", { className: ['jini-chat-settings-row', required.className].filter(Boolean).join(' '), children: [_jsx("input", { id: inputId, type: "checkbox", role: "switch", className: "jini-checkbox jini-chat-settings-switch", checked: required.checked, disabled: required.disabled, "aria-describedby": [required.description ? required.descriptionId : '', required.tooltip ? `${required.descriptionId}-tooltip` : ''].filter(Boolean).join(' ') || undefined, onChange: event => required.onChange(event.currentTarget.checked) }), _jsxs("div", { className: "jini-chat-settings-text", children: [_jsxs("span", { className: "jini-chat-settings-label-row", children: [_jsx("label", { htmlFor: inputId, className: "jini-chat-settings-label", children: required.label }), required.tooltip && _jsx(InfoTip, { label: required.tooltip, descriptionId: `${required.descriptionId}-tooltip` })] }), required.description && _jsx("p", { id: required.descriptionId, className: "jini-chat-settings-description", children: required.description })] })] });
|
|
15
15
|
}
|
|
@@ -17,8 +17,8 @@ function SettingSwitch(required, _optional = {}) {
|
|
|
17
17
|
* Native dialog semantics own modal focus containment; closing restores the opener.
|
|
18
18
|
* Header and tabs stay fixed while only the active panel scrolls.
|
|
19
19
|
*/
|
|
20
|
-
export function ChatSettingsDialog(
|
|
21
|
-
const vm =
|
|
20
|
+
export function ChatSettingsDialog({ useChatSettingsViewHook = useChatSettingsView, ...required }) {
|
|
21
|
+
const vm = useChatSettingsViewHook(required);
|
|
22
22
|
const dialogRef = useRef(null), closeRef = useRef(null), titleId = useId();
|
|
23
23
|
const openerRef = useRef(null);
|
|
24
24
|
useLayoutEffect(() => {
|
|
@@ -56,7 +56,7 @@ export function ChatSettingsDialog(required, _optional = {}) {
|
|
|
56
56
|
}, [required.open]);
|
|
57
57
|
// Its own tip bounds: hosts mount this inside a narrow dock marked `data-jini-tip-bounds`, which
|
|
58
58
|
// pushed the ⓘ bubbles of options outside the dock across the dialog, away from their icon.
|
|
59
|
-
return
|
|
59
|
+
return _jsx("dialog", { ref: dialogRef, "aria-labelledby": titleId, "aria-modal": "true", tabIndex: -1, "data-jini-tip-bounds": "", className: "jini-dialog jini-chat-settings-dialog", onCancel: event => { event.preventDefault(); required.onClose(); }, onClick: event => {
|
|
60
60
|
if (event.target !== event.currentTarget)
|
|
61
61
|
return;
|
|
62
62
|
const { clientX: x, clientY: y } = event, box = event.currentTarget.getBoundingClientRect();
|
|
@@ -64,8 +64,7 @@ export function ChatSettingsDialog(required, _optional = {}) {
|
|
|
64
64
|
const verticalOutside = y < box.top || y > box.bottom;
|
|
65
65
|
if ((x === 0 && y === 0) || horizontalOutside || verticalOutside)
|
|
66
66
|
required.onClose();
|
|
67
|
-
}, children:
|
|
68
|
-
: renderPermissions(vm) })] });
|
|
67
|
+
}, children: _jsx(ChatSettingsBody, { vm: vm, titleId: titleId, closeRef: closeRef, onClose: required.onClose }) });
|
|
69
68
|
}
|
|
70
69
|
function renderDisplaySection(section) {
|
|
71
70
|
if (section.radio)
|
|
@@ -78,4 +77,8 @@ function renderDisplaySection(section) {
|
|
|
78
77
|
function renderPermissions(vm) {
|
|
79
78
|
return _jsxs(_Fragment, { children: [_jsx("p", { className: "jini-chat-settings-note", children: vm.t('Permission changes apply to the next run.') }), vm.permissions.unavailableReason && _jsx("p", { className: "jini-chat-settings-note", children: vm.t(vm.permissions.unavailableReason) }), _jsx(SettingSwitch, { className: "jini-chat-settings-row--master", label: vm.master.label, checked: vm.master.checked, disabled: vm.master.disabled, onChange: checked => vm.master.onCheckedChange({ checked }), description: vm.master.description, descriptionId: vm.master.descriptionId }), _jsx("div", { className: "jini-chat-settings-capabilities", children: vm.capabilities.map(item => _jsx(SettingSwitch, { label: item.control.label, checked: item.control.checked, disabled: item.control.disabled, onChange: checked => item.control.onCheckedChange({ checked }), description: item.description, descriptionId: item.descriptionId }, item.key)) }), vm.permissions.busy && _jsx("p", { role: "status", className: "jini-chat-settings-note", children: vm.t('Saving…') }), vm.permissions.error && _jsx("p", { role: "alert", className: "jini-chat-settings-error", children: vm.permissions.error })] });
|
|
80
79
|
}
|
|
80
|
+
function ChatSettingsBody({ vm, titleId, closeRef, onClose }) {
|
|
81
|
+
return _jsxs(_Fragment, { children: [_jsxs("header", { className: "jini-chat-settings-header", children: [_jsx("h2", { id: titleId, className: "jini-dialog-title", children: vm.t('Chat settings') }), _jsx("button", { ref: closeRef, type: "button", className: "jini-dialog-close jini-chat-settings-close", "aria-label": vm.t('Close'), onClick: onClose, children: _jsx("span", { "aria-hidden": "true", children: "\u00D7" }) })] }), _jsx(TabBar, { tabs: vm.tabs, activeId: vm.tab, onChange: vm.setTab, ariaLabel: vm.t('Chat settings') }), _jsx("div", { className: "jini-chat-settings-body", role: "tabpanel", "aria-label": vm.tab === 'display' ? vm.t('Display') : vm.t('Agent permissions'), children: vm.tab === 'display' ? vm.display.map(renderDisplaySection)
|
|
82
|
+
: renderPermissions(vm) }), " "] });
|
|
83
|
+
}
|
|
81
84
|
//# sourceMappingURL=ChatSettingsDialog.js.map
|
|
@@ -14,5 +14,5 @@ export declare function ChatSettingsSegmented(required: {
|
|
|
14
14
|
}[];
|
|
15
15
|
inputRole?: 'menuitemradio' | undefined;
|
|
16
16
|
checkedRef?: ((input: HTMLInputElement | null) => void) | undefined;
|
|
17
|
-
}
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
18
|
//# sourceMappingURL=ChatSettingsSegmented.d.ts.map
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
* 2026-10-21: the gear's Tool calls and Agent plugins match the dialog's control), so both look alike.
|
|
5
5
|
* Inside a `role="menu"` host, `inputRole="menuitemradio"` keeps each option a valid menu child, and
|
|
6
6
|
* `checkedRef` gets the checked option (else the first) so the host's roving focus can land on it. */
|
|
7
|
-
export function ChatSettingsSegmented(required
|
|
7
|
+
export function ChatSettingsSegmented(required) {
|
|
8
8
|
const focusKey = (required.items.find(item => item.checked) ?? required.items[0])?.key;
|
|
9
9
|
return _jsx("div", { className: "jini-chat-settings-segmented", children: required.items.map(item => _jsxs("label", { className: "jini-chat-settings-segment", children: [_jsx("input", { type: "radio", name: required.name, checked: !!item.checked, disabled: item.disabled, onChange: item.change, role: required.inputRole, "aria-checked": required.inputRole ? !!item.checked : undefined, ref: item.key === focusKey ? required.checkedRef : undefined }), _jsx("span", { children: item.label })] }, item.key)) });
|
|
10
10
|
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import type { Logger } from '@jini-ai/core/primitives';
|
|
2
|
+
import { useAgentHandle } from '@jini-ai/ui';
|
|
3
|
+
import { useT } from '../hooks/context.js';
|
|
1
4
|
import type { UseComposerResult } from '../hooks/useComposer.js';
|
|
2
5
|
import type { ComposerSlots } from '../slots.js';
|
|
6
|
+
import { useComposerView } from './Composer.hooks.js';
|
|
3
7
|
export interface ComposerProps {
|
|
8
|
+
report?: Pick<Logger, 'error'> | undefined;
|
|
9
|
+
useAgentHandleHook?: typeof useAgentHandle;
|
|
10
|
+
useTHook?: typeof useT;
|
|
11
|
+
useComposerViewHook?: typeof useComposerView;
|
|
4
12
|
/** Stable automation base; false suppresses every package-owned control handle. */
|
|
5
13
|
agentHandle?: string | false | undefined;
|
|
6
14
|
composer: UseComposerResult;
|
|
@@ -73,5 +81,5 @@ export interface ComposerProps {
|
|
|
73
81
|
* @complexity Time/space: O(n) in rendered attachments and supplied menu items.
|
|
74
82
|
* @overallScore 100/100
|
|
75
83
|
*/
|
|
76
|
-
export declare function Composer({ agentHandle, composer, onSend, disabled, sendDisabled, sendDisabledReason, sendDisabledReasonId, placeholder, slots, attachmentPicker, running, onCancel, onInterrupt, workingDirectory, onChangeWorkingDirectory, onPickWorkingDirectory, }: ComposerProps): import("react").JSX.Element;
|
|
84
|
+
export declare function Composer({ useAgentHandleHook, useTHook, useComposerViewHook, agentHandle, composer, onSend, report, disabled, sendDisabled, sendDisabledReason, sendDisabledReasonId, placeholder, slots, attachmentPicker, running, onCancel, onInterrupt, workingDirectory, onChangeWorkingDirectory, onPickWorkingDirectory, }: ComposerProps): import("react").JSX.Element;
|
|
77
85
|
//# sourceMappingURL=Composer.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type Logger } from '@jini-ai/core/primitives';
|
|
2
|
+
import { type ChangeEvent, type ClipboardEvent, type CSSProperties, type KeyboardEvent } from 'react';
|
|
3
|
+
import type { ComposerDiscoveryGroup, ComposerDiscoveryItem } from '../slots.js';
|
|
4
|
+
import type { ComposerProps } from './Composer.js';
|
|
5
|
+
/**
|
|
6
|
+
* Invokes host code synchronously, then observes either its synchronous result or async failure.
|
|
7
|
+
*
|
|
8
|
+
* @param onResolved - Optional, called with the host's resolved (non-thrown/non-rejected) return
|
|
9
|
+
* value — never called after a synchronous throw or an async rejection. Added for
|
|
10
|
+
* `onDiscoverySelect`, whose {@link ComposerDiscoveryOutcome} return value the caller applies to
|
|
11
|
+
* the draft; the two other host effects this function backs (`plusMenuItems.onSelect`,
|
|
12
|
+
* `attachmentPicker.onFiles`) simply omit it, which reproduces their exact prior behavior.
|
|
13
|
+
*/
|
|
14
|
+
export declare function runComposerHostEffect({ effectName, effect }: {
|
|
15
|
+
effectName: string;
|
|
16
|
+
effect: () => unknown;
|
|
17
|
+
}, { onSettled, onResolved, report }?: {
|
|
18
|
+
onSettled?: () => void;
|
|
19
|
+
onResolved?: (result: unknown) => void;
|
|
20
|
+
report?: Pick<Logger, 'error'> | undefined;
|
|
21
|
+
}): void;
|
|
22
|
+
/** Coordinate composer menus, keyboard handling, attachments, and host effects. */
|
|
23
|
+
export declare function useComposerView({ composer, slots, attachmentPicker, workingDirectory, onChangeWorkingDirectory, disabled, sendDisabled, onInterrupt, onSend }: {
|
|
24
|
+
composer: ComposerProps['composer'];
|
|
25
|
+
slots: ComposerProps['slots'];
|
|
26
|
+
attachmentPicker: ComposerProps['attachmentPicker'];
|
|
27
|
+
workingDirectory: ComposerProps['workingDirectory'];
|
|
28
|
+
onChangeWorkingDirectory: ComposerProps['onChangeWorkingDirectory'];
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
sendDisabled: boolean;
|
|
31
|
+
onInterrupt: ComposerProps['onInterrupt'];
|
|
32
|
+
onSend: ComposerProps['onSend'];
|
|
33
|
+
}, { report }?: {
|
|
34
|
+
report?: Pick<Logger, 'error'> | undefined;
|
|
35
|
+
}): {
|
|
36
|
+
attachmentInputRef: import("react").RefObject<HTMLInputElement | null>;
|
|
37
|
+
textareaRef: import("react").RefObject<HTMLTextAreaElement | null>;
|
|
38
|
+
discoveryMenuOpen: boolean;
|
|
39
|
+
setDiscoveryMenuOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
40
|
+
setSlashActiveIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
41
|
+
setDismissedSlashDraft: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
42
|
+
discoveryMenuPosition: CSSProperties | undefined;
|
|
43
|
+
slashMenuPosition: CSSProperties | undefined;
|
|
44
|
+
workdirOpen: boolean;
|
|
45
|
+
setWorkdirOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
46
|
+
workdirDraft: string;
|
|
47
|
+
setWorkdirDraft: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
48
|
+
workdirPosition: CSSProperties | undefined;
|
|
49
|
+
discoveryGroups: readonly ComposerDiscoveryGroup[];
|
|
50
|
+
leadingAccessories: import("react").ReactNode;
|
|
51
|
+
footerLeadingAccessory: import("react").ReactNode;
|
|
52
|
+
footerAccessories: import("react").ReactNode;
|
|
53
|
+
plusMenuItems: import("../slots.js").ComposerPlusItem[] | undefined;
|
|
54
|
+
hasDiscoveryItems: boolean;
|
|
55
|
+
slash: {
|
|
56
|
+
matches: import("./composer-discovery.js").ComposerDiscoveryMatch[];
|
|
57
|
+
open: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* A bare "/" intentionally matches every item (`matchesFuzzyCommand`'s own doc) so the palette
|
|
60
|
+
* doubles as a browse-everything view — but with nothing typed yet, nothing on screen tells a
|
|
61
|
+
* first-time user that continuing to type narrows it, and a fuzzy substring match against full
|
|
62
|
+
* descriptions stays broad for the first character or two regardless (owner-reported "it doesn't
|
|
63
|
+
* narrow" — narrowing DOES fire on every keystroke, this is the one state where there's no visual
|
|
64
|
+
* cue that it will). Shown only here, not once the user has started typing a real query — at that
|
|
65
|
+
* point the shrinking list is its own feedback.
|
|
66
|
+
*/
|
|
67
|
+
showFilterHint: boolean;
|
|
68
|
+
};
|
|
69
|
+
slashOpen: boolean;
|
|
70
|
+
slashActiveOption: number;
|
|
71
|
+
selectSlashItem: (item: ComposerDiscoveryItem) => void;
|
|
72
|
+
selectPlusItem: (item: ComposerDiscoveryItem) => void;
|
|
73
|
+
toggleWorkdir: () => void;
|
|
74
|
+
confirmWorkdir: () => void;
|
|
75
|
+
handleKeyDown: (event: KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
76
|
+
handleAttachmentChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
77
|
+
handleAttachmentPaste: (event: ClipboardEvent<HTMLTextAreaElement>) => void;
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=Composer.hooks.d.ts.map
|