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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/CHANGELOG.md +2 -12
  2. package/README.md +3 -3
  3. package/dist/contracts/chat-bubble-style.d.ts +1 -1
  4. package/dist/contracts/chat-bubble-style.js +1 -1
  5. package/dist/core/ag-ui/event-projection.d.ts +125 -0
  6. package/dist/core/ag-ui/event-projection.js +275 -0
  7. package/dist/core/ag-ui/event-reduction.d.ts +39 -0
  8. package/dist/core/ag-ui/event-reduction.js +99 -0
  9. package/dist/core/ag-ui/run-input.d.ts +53 -0
  10. package/dist/core/ag-ui/run-input.js +87 -0
  11. package/dist/core/agentic/chat-capabilities.d.ts +1 -1
  12. package/dist/core/agentic/index.d.ts +2 -4
  13. package/dist/core/agentic/index.js +2 -3
  14. package/dist/core/agents-port.d.ts +50 -0
  15. package/dist/core/agents-port.js +2 -0
  16. package/dist/core/assistant-client/ag-ui-fetch-agent.d.ts +16 -0
  17. package/dist/core/assistant-client/ag-ui-fetch-agent.js +24 -0
  18. package/dist/core/assistant-client/ag-ui-transport.d.ts +15 -1
  19. package/dist/core/assistant-client/ag-ui-transport.js +167 -145
  20. package/dist/core/assistant-client/attachment-liveness.js +13 -11
  21. package/dist/core/assistant-client/durable-run-subscription.d.ts +3 -2
  22. package/dist/core/assistant-client/durable-run-subscription.js +6 -5
  23. package/dist/core/assistant-client/messages.d.ts +7 -4
  24. package/dist/core/assistant-client/messages.js +5 -4
  25. package/dist/core/assistant-client/transport.d.ts +1 -1
  26. package/dist/core/assistant-client/transport.js +4 -4
  27. package/dist/core/index.d.ts +2 -0
  28. package/dist/core/index.js +1 -0
  29. package/dist/core/page-port.d.ts +15 -0
  30. package/dist/core/page-port.js +2 -0
  31. package/dist/core/run-activity.js +1 -1
  32. package/dist/core/run-events/entry.js +1 -0
  33. package/dist/core/user-text-redaction.d.ts +1 -3
  34. package/dist/core/user-text-redaction.js +3 -61
  35. package/dist/embed-widget/browser/agent-inventory.d.ts +37 -0
  36. package/dist/embed-widget/browser/agent-inventory.js +36 -0
  37. package/dist/embed-widget/browser/frontend-session-bridge.d.ts +2 -2
  38. package/dist/embed-widget/browser/frontend-session-bridge.js +17 -14
  39. package/dist/embed-widget/react/dialog.hooks.d.ts +16 -0
  40. package/dist/embed-widget/react/dialog.hooks.js +15 -0
  41. package/dist/embed-widget/react/embed.d.ts +7 -2
  42. package/dist/embed-widget/react/embed.js +6 -16
  43. package/dist/embed-widget/react/header.d.ts +4 -1
  44. package/dist/embed-widget/react/header.js +2 -2
  45. package/dist/embed-widget/vanilla/state.js +2 -2
  46. package/dist/embed-widget/vanilla/style.css +4 -4
  47. package/dist/react/components/A2uiSurfaceCard.d.ts +18 -4
  48. package/dist/react/components/A2uiSurfaceCard.hooks.d.ts +36 -0
  49. package/dist/react/components/A2uiSurfaceCard.hooks.js +174 -0
  50. package/dist/react/components/A2uiSurfaceCard.js +14 -227
  51. package/dist/react/components/A2uiSurfaceCard.rules.d.ts +14 -0
  52. package/dist/react/components/A2uiSurfaceCard.rules.js +24 -0
  53. package/dist/react/components/AttachmentPreviewModal.d.ts +21 -1
  54. package/dist/react/components/AttachmentPreviewModal.hooks.js +1 -3
  55. package/dist/react/components/AttachmentPreviewModal.js +11 -9
  56. package/dist/react/components/AttachmentTray.d.ts +11 -1
  57. package/dist/react/components/AttachmentTray.js +12 -8
  58. package/dist/react/components/ChatFab.d.ts +10 -1
  59. package/dist/react/components/ChatFab.js +2 -2
  60. package/dist/react/components/ChatSettingsDialog.d.ts +4 -3
  61. package/dist/react/components/ChatSettingsDialog.js +9 -6
  62. package/dist/react/components/ChatSettingsSegmented.d.ts +1 -1
  63. package/dist/react/components/ChatSettingsSegmented.js +1 -1
  64. package/dist/react/components/Composer.d.ts +9 -1
  65. package/dist/react/components/Composer.hooks.d.ts +79 -0
  66. package/dist/react/components/Composer.hooks.js +336 -0
  67. package/dist/react/components/Composer.js +40 -341
  68. package/dist/react/components/ComposerDiscovery.js +1 -1
  69. package/dist/react/components/ConversationList.d.ts +34 -1
  70. package/dist/react/components/ConversationList.hooks.d.ts +37 -0
  71. package/dist/react/components/ConversationList.hooks.js +177 -1
  72. package/dist/react/components/ConversationList.js +7 -174
  73. package/dist/react/components/ConversationTitleEditor.d.ts +17 -2
  74. package/dist/react/components/ConversationTitleEditor.hooks.d.ts +15 -0
  75. package/dist/react/components/ConversationTitleEditor.hooks.js +36 -0
  76. package/dist/react/components/ConversationTitleEditor.js +11 -34
  77. package/dist/react/components/CopyMessageButton.d.ts +6 -1
  78. package/dist/react/components/CopyMessageButton.js +4 -4
  79. package/dist/react/components/ExtEventErrorBoundary.d.ts +2 -0
  80. package/dist/react/components/ExtEventErrorBoundary.js +5 -3
  81. package/dist/react/components/FolderChips.d.ts +11 -1
  82. package/dist/react/components/FolderChips.hooks.d.ts +12 -0
  83. package/dist/react/components/FolderChips.hooks.js +10 -0
  84. package/dist/react/components/FolderChips.js +9 -9
  85. package/dist/react/components/Markdown.js +7 -5
  86. package/dist/react/components/McpUiSurfaceCard.d.ts +29 -5
  87. package/dist/react/components/McpUiSurfaceCard.js +29 -16
  88. package/dist/react/components/MessageList.d.ts +10 -1
  89. package/dist/react/components/MessageList.hooks.d.ts +0 -4
  90. package/dist/react/components/MessageList.hooks.js +6 -18
  91. package/dist/react/components/MessageList.js +17 -20
  92. package/dist/react/components/MessageList.rules.d.ts +0 -5
  93. package/dist/react/components/MessageList.rules.js +0 -4
  94. package/dist/react/components/MessageRow.d.ts +46 -2
  95. package/dist/react/components/MessageRow.hooks.d.ts +60 -0
  96. package/dist/react/components/MessageRow.hooks.js +94 -0
  97. package/dist/react/components/MessageRow.js +53 -113
  98. package/dist/react/components/MidRunUserMessage.d.ts +6 -1
  99. package/dist/react/components/MidRunUserMessage.js +5 -5
  100. package/dist/react/components/NextStepActions.d.ts +3 -1
  101. package/dist/react/components/NextStepActions.js +3 -3
  102. package/dist/react/components/QuestionForm.answers.hooks.d.ts +26 -0
  103. package/dist/react/components/QuestionForm.answers.hooks.js +89 -0
  104. package/dist/react/components/QuestionForm.d.ts +6 -0
  105. package/dist/react/components/QuestionForm.js +23 -261
  106. package/dist/react/components/QuestionForm.values.d.ts +22 -0
  107. package/dist/react/components/QuestionForm.values.js +58 -0
  108. package/dist/react/components/QuestionFormField.d.ts +17 -0
  109. package/dist/react/components/QuestionFormField.js +114 -0
  110. package/dist/react/components/QuestionsPanel.d.ts +3 -1
  111. package/dist/react/components/QuestionsPanel.js +7 -3
  112. package/dist/react/components/SentAttachment.d.ts +11 -2
  113. package/dist/react/components/SentAttachment.hooks.d.ts +1 -1
  114. package/dist/react/components/SentAttachment.hooks.js +6 -5
  115. package/dist/react/components/SentAttachment.js +5 -3
  116. package/dist/react/components/TodoCard.d.ts +3 -1
  117. package/dist/react/components/TodoCard.js +9 -4
  118. package/dist/react/components/ToolCallGroup.d.ts +11 -1
  119. package/dist/react/components/ToolCallGroup.js +10 -4
  120. package/dist/react/components/ToolCard.d.ts +6 -1
  121. package/dist/react/components/ToolCard.js +79 -69
  122. package/dist/react/components/mcp-ui-question-input.d.ts +1 -1
  123. package/dist/react/components/mcp-ui-question-input.js +3 -3
  124. package/dist/react/components/mcp-ui-surface-state.d.ts +1 -1
  125. package/dist/react/features/chat-pane/agent-tools.d.ts +1 -1
  126. package/dist/react/features/chat-pane/antigravity/model-options.d.ts +2 -0
  127. package/dist/react/features/chat-pane/antigravity/model-options.js +2 -0
  128. package/dist/react/features/chat-pane/claude/model-options.d.ts +2 -0
  129. package/dist/react/features/chat-pane/claude/model-options.js +2 -0
  130. package/dist/react/features/chat-pane/codex/model-options.d.ts +2 -0
  131. package/dist/react/features/chat-pane/codex/model-options.js +2 -0
  132. package/dist/react/features/chat-pane/components/AgentPluginUsage.d.ts +4 -1
  133. package/dist/react/features/chat-pane/components/AgentPluginUsage.js +2 -2
  134. package/dist/react/features/chat-pane/components/AgentRuntimePicker.d.ts +10 -6
  135. package/dist/react/features/chat-pane/components/AgentRuntimePicker.js +18 -132
  136. package/dist/react/features/chat-pane/components/ChatPane.d.ts +24 -2
  137. package/dist/react/features/chat-pane/components/ChatPane.js +45 -297
  138. package/dist/react/features/chat-pane/components/ChatPaneComposerArea.d.ts +33 -0
  139. package/dist/react/features/chat-pane/components/ChatPaneComposerArea.js +119 -0
  140. package/dist/react/features/chat-pane/components/ChatPaneLayout.d.ts +42 -0
  141. package/dist/react/features/chat-pane/components/ChatPaneLayout.js +54 -0
  142. package/dist/react/features/chat-pane/components/ChatPaneStatus.d.ts +27 -0
  143. package/dist/react/features/chat-pane/components/ChatPaneStatus.js +91 -0
  144. package/dist/react/features/chat-pane/components/RuntimeDropUp.d.ts +6 -1
  145. package/dist/react/features/chat-pane/components/RuntimeDropUp.js +20 -19
  146. package/dist/react/features/chat-pane/components/RuntimePickerSections.d.ts +62 -0
  147. package/dist/react/features/chat-pane/components/RuntimePickerSections.js +122 -0
  148. package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.d.ts +1 -1
  149. package/dist/react/features/chat-pane/hooks/useChatPane.hooks.d.ts +5 -3
  150. package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js +78 -26
  151. package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.js +6 -6
  152. package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.d.ts +5 -1
  153. package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.js +7 -7
  154. package/dist/react/features/chat-pane/hooks/useRuntimeDropUp.hooks.d.ts +7 -0
  155. package/dist/react/features/chat-pane/hooks/useRuntimeDropUp.hooks.js +5 -0
  156. package/dist/react/features/chat-pane/model-options.js +7 -4
  157. package/dist/react/features/chat-pane/styles.d.ts +1 -1
  158. package/dist/react/features/chat-pane/styles.js +25 -41
  159. package/dist/react/features/chat-pane/types.d.ts +29 -1
  160. package/dist/react/hooks/assistant-chats-contracts.d.ts +1 -1
  161. package/dist/react/hooks/attachment-preview-cache.d.ts +1 -1
  162. package/dist/react/hooks/attachment-preview-cache.js +1 -1
  163. package/dist/react/hooks/fab-position.js +16 -18
  164. package/dist/react/hooks/useConversation.d.ts +6 -1
  165. package/dist/react/hooks/useConversation.js +11 -10
  166. package/dist/react/hooks/useRunStream.d.ts +3 -0
  167. package/dist/react/hooks/useRunStream.js +12 -12
  168. package/dist/react/hooks/useSurfaceRecovery.d.ts +1 -1
  169. package/dist/react/hooks/useSurfaceRecovery.js +2 -2
  170. package/dist/react/index.d.ts +6 -3
  171. package/dist/react/index.js +5 -3
  172. package/dist/react/styles/chat-settings.css +9 -9
  173. package/dist/react/surfaces.d.ts +91 -0
  174. package/dist/react/surfaces.js +28 -0
  175. package/dist/server/durable-runs/recover.d.ts +4 -3
  176. package/dist/server/durable-runs/recover.js +4 -3
  177. package/dist/store/legacy/sqlite/conversations.d.ts +1 -2
  178. package/dist/store/legacy/sqlite/conversations.js +1 -1
  179. package/dist/store/legacy/sqlite/messages.d.ts +2 -3
  180. package/dist/store/legacy/sqlite/messages.js +6 -6
  181. package/dist/store/pglite/index.d.ts +7 -7
  182. package/dist/store/pglite/index.js +1 -1
  183. package/dist/store/ports.d.ts +5 -2
  184. package/dist/store/postgres/index.d.ts +7 -7
  185. package/dist/store/postgres/index.js +1 -1
  186. package/dist/store/runtime/chat-expiry-sweep.js +2 -4
  187. package/dist/store/runtime/chat-history-store.js +2 -3
  188. package/dist/store/runtime/durable-run-store.js +16 -2
  189. package/dist/store/runtime/history-tools.js +33 -11
  190. package/dist/store/runtime/kernel.d.ts +3 -2
  191. package/dist/store/runtime/run-ledger.js +2 -2
  192. package/dist/store/sql/boundary.d.ts +5 -5
  193. package/dist/store/sql/maintenance.d.ts +3 -2
  194. package/dist/store/sql/store.d.ts +16 -8
  195. package/dist/store/sql/store.js +31 -14
  196. package/dist/store/sqlite/index.d.ts +11 -12
  197. package/dist/store/sqlite/index.js +5 -5
  198. package/dist/store/sqlite/schema.d.ts +1 -1
  199. package/package.json +46 -24
  200. package/dist/core/ag-ui/entry.d.ts +0 -84
  201. package/dist/core/ag-ui/entry.js +0 -225
  202. package/dist/core/browser/page-actions.d.ts +0 -121
  203. package/dist/core/browser/page-actions.js +0 -113
  204. package/dist/embed-widget/browser/page-actions.d.ts +0 -2
  205. package/dist/embed-widget/browser/page-actions.js +0 -3
@@ -0,0 +1,114 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { SecretInput, SecretTextarea } from '@jini-ai/ui';
3
+ import { isSecretQuestion, questionTextInputProps, questionTextareaProps } from '../../core/index.js';
4
+ import { CREDENTIAL_CARD_GUIDANCE } from '../../core/user-text-redaction.js';
5
+ import { shouldRenderCustomChoice, questionValueIsKnown, customSingleValue, customCheckboxValue, customInputCharCount, normalizeColorInputValue, fileValueLabel } from './QuestionForm.values.js';
6
+ function questionHelpId(formId, q) {
7
+ return `${formId}-${q.id}-help`;
8
+ }
9
+ /** Required state and help-text link for a control; each attribute is omitted when it does not apply. */
10
+ function fieldAria(formId, q) {
11
+ return { 'aria-required': q.required || undefined, 'aria-describedby': q.help ? questionHelpId(formId, q) : undefined };
12
+ }
13
+ export function QuestionField(ctx) {
14
+ const { q, t } = ctx;
15
+ const renderControl = QUESTION_CONTROLS[q.type];
16
+ return (_jsxs("div", { className: "qf-field", children: [_jsxs("label", { className: "qf-label", children: [_jsx("span", { children: q.label }), q.required ? (_jsx("span", { className: "qf-required", "aria-label": t('required'), children: "*" })) : null] }), q.help ? _jsx("div", { className: "qf-help", id: questionHelpId(ctx.formId, q), children: q.help }) : null, isSecretQuestion({ question: q }) ? _jsx("div", { className: "qf-help", children: t(CREDENTIAL_CARD_GUIDANCE) }) : null, renderControl ? renderControl(ctx) : null] }));
17
+ }
18
+ function stringValue(value) {
19
+ return typeof value === 'string' ? value : '';
20
+ }
21
+ /** A range with no usable answer yet (e.g. mid-stream) shows its minimum, matching `emptyQuestionValue`. */
22
+ function rangeValue(q, value) {
23
+ return typeof value === 'string' && value.trim() ? value : String(q.min ?? 0);
24
+ }
25
+ function customChoice({ q, t, locked }, value, onChange) {
26
+ if (!shouldRenderCustomChoice(q))
27
+ return null;
28
+ return _jsx(CustomChoiceInput, { label: q.customLabel ?? t('Something else'), value: value, placeholder: q.customPlaceholder ?? t('Type your own answer'), disabled: locked, onChange: onChange });
29
+ }
30
+ function singleCustomChoice(ctx) {
31
+ return customChoice(ctx, customSingleValue(ctx.q, ctx.value), (next) => ctx.update(ctx.q.id, next));
32
+ }
33
+ function RadioControl(ctx) {
34
+ const { q, value, formId, locked, update } = ctx;
35
+ if (!q.options)
36
+ return null;
37
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "qf-options", children: q.options.map((opt) => (_jsxs("label", { className: `qf-chip${value === opt.value ? ' qf-chip-on' : ''}`, title: opt.description, children: [_jsx("input", { type: "radio", name: `${formId}-${q.id}`, value: opt.value, checked: value === opt.value, disabled: locked, "aria-label": opt.label, onChange: () => update(q.id, opt.value) }), _jsx(OptionCopy, { option: opt })] }, opt.value))) }), singleCustomChoice(ctx)] }));
38
+ }
39
+ function CheckboxControl(ctx) {
40
+ const { q, value, locked, toggleCheckbox, updateCheckboxCustom } = ctx;
41
+ if (!q.options)
42
+ return null;
43
+ const arr = Array.isArray(value) ? value : [];
44
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "qf-options", children: q.options.map((opt) => {
45
+ const on = arr.includes(opt.value);
46
+ const maxed = q.maxSelections !== undefined && !on && arr.length >= q.maxSelections;
47
+ return (_jsxs("label", { title: opt.description, className: `qf-chip${on ? ' qf-chip-on' : ''}${maxed ? ' qf-chip-disabled' : ''}`, children: [_jsx("input", { type: "checkbox", value: opt.value, checked: on, disabled: locked || maxed, "aria-label": opt.label, onChange: () => toggleCheckbox(q.id, opt.value, q.maxSelections) }), _jsx(OptionCopy, { option: opt })] }, opt.value));
48
+ }) }), customChoice(ctx, customCheckboxValue(q, value), (next) => updateCheckboxCustom(q, next))] }));
49
+ }
50
+ function SelectControl(ctx) {
51
+ const { q, value, locked, t, update } = ctx;
52
+ if (!q.options)
53
+ return null;
54
+ return (_jsxs(_Fragment, { children: [_jsxs("select", { className: "qf-select", "aria-label": q.label, ...fieldAria(ctx.formId, q), value: typeof value === 'string' && questionValueIsKnown({ q, value }) ? value : '', disabled: locked, onChange: (e) => update(q.id, e.target.value), children: [_jsx("option", { value: "", disabled: true, children: q.placeholder ?? t('Choose one') }), q.options.map((opt) => (_jsx("option", { value: opt.value, title: opt.description, children: opt.label }, opt.value)))] }), singleCustomChoice(ctx)] }));
55
+ }
56
+ function DirectionCardsControl(ctx) {
57
+ const { q, value, formId, locked, update, t } = ctx;
58
+ if (!q.cards || q.cards.length === 0)
59
+ return null;
60
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "qf-direction-cards", children: q.cards.map((card) => (_jsx(DirectionCardView, { card: card, formId: formId, questionId: q.id, selected: value === card.id || value === card.label, disabled: locked, onSelect: () => update(q.id, card.id), t: t }, card.id))) }), singleCustomChoice(ctx)] }));
61
+ }
62
+ /** A credential-shaped text question gets the shared eye toggle (hidden by default). */
63
+ function TextControl({ q, value, locked, update, t, formId }) {
64
+ const shared = { className: 'qf-input', value: stringValue(value), placeholder: q.placeholder, disabled: locked, onChange: (e) => update(q.id, e.target.value) };
65
+ const props = questionTextInputProps({ question: q });
66
+ const { type, ...secretProps } = props;
67
+ if (type === 'password') {
68
+ return _jsx(SecretInput, { ...secretProps, ...shared, "aria-label": q.label, label: q.label, toggleLabels: { show: `${t('Show')} ${q.label}`, hide: `${t('Hide')} ${q.label}` } });
69
+ }
70
+ return _jsx("input", { ...props, ...shared, "aria-label": q.label, ...fieldAria(formId, q) });
71
+ }
72
+ /** A credential-shaped textarea gets the same eye toggle; `SecretTextarea` owns the masking style. */
73
+ function TextareaControl({ q, value, locked, update, t, formId }) {
74
+ const shared = { className: 'qf-textarea', value: stringValue(value), placeholder: q.placeholder, disabled: locked, rows: 3, onChange: (e) => update(q.id, e.target.value) };
75
+ const props = questionTextareaProps({ question: q });
76
+ if (isSecretQuestion({ question: q })) {
77
+ return _jsx(SecretTextarea, { ...props, ...shared, "aria-label": q.label, label: q.label, toggleLabels: { show: `${t('Show')} ${q.label}`, hide: `${t('Hide')} ${q.label}` } });
78
+ }
79
+ return _jsx("textarea", { ...props, ...shared, "aria-label": q.label, ...fieldAria(formId, q) });
80
+ }
81
+ /** date/time/datetime-local and url/email/tel share one plain input whose `type` is the question type. */
82
+ function TypedInputControl({ q, value, locked, update, formId }) {
83
+ return _jsx("input", { type: q.type, className: "qf-input", "aria-label": q.label, ...fieldAria(formId, q), value: stringValue(value), placeholder: q.placeholder, disabled: locked, onChange: (e) => update(q.id, e.target.value) });
84
+ }
85
+ const QUESTION_CONTROLS = {
86
+ radio: RadioControl,
87
+ checkbox: CheckboxControl,
88
+ select: SelectControl,
89
+ 'direction-cards': DirectionCardsControl,
90
+ text: TextControl,
91
+ number: ({ q, value, locked, update, formId }) => _jsx("input", { type: "number", className: "qf-input", "aria-label": q.label, ...fieldAria(formId, q), value: stringValue(value), placeholder: q.placeholder, min: q.min, max: q.max, step: q.step, disabled: locked, onChange: (e) => update(q.id, e.target.value) }),
92
+ range: ({ q, value, locked, update, formId }) => (_jsxs("div", { className: "qf-range-wrap", children: [_jsx("input", { type: "range", className: "qf-range", "aria-label": q.label, ...fieldAria(formId, q), value: rangeValue(q, value), min: q.min, max: q.max, step: q.step, disabled: locked, onChange: (e) => update(q.id, e.target.value) }), _jsx("output", { className: "qf-range-value", children: rangeValue(q, value) })] })),
93
+ date: TypedInputControl,
94
+ time: TypedInputControl,
95
+ 'datetime-local': TypedInputControl,
96
+ url: TypedInputControl,
97
+ email: TypedInputControl,
98
+ tel: TypedInputControl,
99
+ color: ({ q, value, locked, update, formId }) => _jsx("input", { type: "color", className: "qf-color", "aria-label": q.label, ...fieldAria(formId, q), value: normalizeColorInputValue(value), disabled: locked, onChange: (e) => update(q.id, e.target.value) }),
100
+ file: ({ q, value, locked, selectFiles, formId }) => (_jsxs("div", { className: "qf-file-wrap", children: [_jsx("input", { type: "file", className: "qf-file", "aria-label": q.label, ...fieldAria(formId, q), multiple: q.multiple, accept: q.accept, disabled: locked, onChange: (e) => selectFiles(q, e.target.files) }), fileValueLabel(value) ? _jsx("div", { className: "qf-file-summary", children: fileValueLabel(value) }) : null] })),
101
+ switch: ({ q, value, locked, update, formId }) => (_jsxs("label", { className: "qf-switch", children: [_jsx("input", { type: "checkbox", role: "switch", "aria-label": q.label, ...fieldAria(formId, q), checked: value === 'true', disabled: locked, onChange: (e) => update(q.id, e.target.checked ? 'true' : 'false') }), _jsx("span", { "aria-hidden": true })] })),
102
+ textarea: TextareaControl,
103
+ };
104
+ function OptionCopy({ option }) {
105
+ return (_jsxs("span", { className: "jini-qf-chip-copy", children: [_jsx("span", { children: option.label }), option.description ? _jsx("span", { className: "jini-qf-chip-desc", children: option.description }) : null] }));
106
+ }
107
+ function CustomChoiceInput({ label, value, placeholder, disabled, onChange }) {
108
+ const chars = customInputCharCount({ value, placeholder });
109
+ return (_jsxs("label", { className: "jini-qf-custom", children: [_jsx("span", { children: label }), _jsx("input", { type: "text", className: "qf-input", value: value, placeholder: placeholder, disabled: disabled, style: { '--qf-custom-chars': String(chars) }, onChange: (event) => onChange(event.target.value) })] }));
110
+ }
111
+ function DirectionCardView({ card, formId, questionId, selected, disabled, onSelect, t }) {
112
+ return (_jsxs("label", { className: `qf-card${selected ? ' qf-card-on' : ''}${disabled ? ' qf-card-disabled' : ''}`, children: [_jsx("input", { type: "radio", name: `${formId}-${questionId}`, value: card.id, checked: selected, disabled: disabled, onChange: () => onSelect() }), _jsxs("div", { className: "jini-qf-card-head", children: [_jsx("div", { className: "jini-qf-card-title", children: card.label }), selected ? _jsx("span", { className: "jini-qf-card-pill", children: t('Selected') }) : null] }), card.palette.length > 0 ? (_jsx("div", { className: "jini-qf-card-swatches", "aria-hidden": true, children: card.palette.slice(0, 6).map((c, i) => (_jsx("span", { className: "jini-qf-card-swatch", style: { background: c }, title: c }, i))) })) : null, _jsxs("div", { className: "jini-qf-card-types", "aria-hidden": true, children: [_jsx("span", { className: "jini-qf-card-type-display", style: { fontFamily: card.displayFont }, children: "Aa" }), _jsx("span", { className: "jini-qf-card-type-body", style: { fontFamily: card.bodyFont }, children: t('The quick brown fox') })] }), card.mood ? _jsx("p", { className: "jini-qf-card-mood", children: card.mood }) : null, card.references.length > 0 ? (_jsxs("p", { className: "jini-qf-card-refs", children: [_jsx("span", { className: "jini-qf-card-refs-label", children: t('References:') }), " ", card.references.slice(0, 4).join(' · ')] })) : null] }));
113
+ }
114
+ //# sourceMappingURL=QuestionFormField.js.map
@@ -1,5 +1,6 @@
1
1
  import type { UserTextRedactionOptions } from '../../core/user-text-redaction.js';
2
2
  import type { QuestionForm as QuestionFormType } from '../../core/index.js';
3
+ import { useT } from '../hooks/context.js';
3
4
  export interface QuestionsPanelProps extends UserTextRedactionOptions {
4
5
  form: QuestionFormType | null;
5
6
  interactive: boolean;
@@ -9,6 +10,7 @@ export interface QuestionsPanelProps extends UserTextRedactionOptions {
9
10
  /** The assistant turn is still streaming the form — keeps Continue disabled and shows a generating hint. */
10
11
  generating?: boolean;
11
12
  onSubmit: (text: string, answers: Record<string, string | string[]>) => void;
13
+ useTHook?: typeof useT;
12
14
  }
13
- export declare function QuestionsPanel({ form, interactive, submitDisabled, submittedAnswers, generating, onSubmit, redactUserText, onSecretRedacted }: QuestionsPanelProps): import("react").JSX.Element | null;
15
+ export declare function QuestionsPanel({ form, interactive, submitDisabled, submittedAnswers, generating, onSubmit, redactUserText, onSecretRedacted, useTHook }: QuestionsPanelProps): import("react").JSX.Element | null;
14
16
  //# sourceMappingURL=QuestionsPanel.d.ts.map
@@ -20,14 +20,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
20
  import { useRef, useState } from 'react';
21
21
  import { useT } from '../hooks/context.js';
22
22
  import { QuestionForm } from './QuestionForm.js';
23
- export function QuestionsPanel({ form, interactive, submitDisabled, submittedAnswers, generating = false, onSubmit, redactUserText, onSecretRedacted }) {
24
- const t = useT();
23
+ export function QuestionsPanel({ form, interactive, submitDisabled, submittedAnswers, generating = false, onSubmit, redactUserText, onSecretRedacted, useTHook = useT }) {
24
+ const t = useTHook();
25
25
  const formRef = useRef(null);
26
26
  const [ready, setReady] = useState(false);
27
27
  if (!form)
28
28
  return null;
29
29
  const answered = submittedAnswers !== undefined;
30
30
  const busy = submitDisabled || generating;
31
- return (_jsxs("div", { className: "qp-panel", children: [_jsx(QuestionForm, { ref: formRef, form: form, interactive: interactive, ...(submittedAnswers !== undefined ? { submittedAnswers } : {}), hideInternalSubmit: true, ...(redactUserText ? { redactUserText } : {}), ...(onSecretRedacted ? { onSecretRedacted } : {}), onReadyChange: setReady, onSubmit: onSubmit }), !answered ? (_jsxs("div", { className: "qp-foot", children: [generating ? _jsx("span", { className: "qp-hint", children: t('Still generating…') }) : null, _jsx("button", { type: "button", className: "qp-skip", disabled: busy, onClick: () => formRef.current?.skipAll(), children: t('Skip') }), _jsx("button", { type: "button", className: "qp-continue primary", disabled: busy || !ready, onClick: () => formRef.current?.submit(), children: t('Continue') })] })) : null] }));
31
+ return (_jsxs("div", { className: "jini-qp-panel", children: [_jsx(QuestionForm, { ref: formRef, form: form, interactive: interactive, ...(submittedAnswers !== undefined ? { submittedAnswers } : {}), hideInternalSubmit: true, ...(redactUserText ? { redactUserText } : {}), ...(onSecretRedacted ? { onSecretRedacted } : {}), onReadyChange: setReady, onSubmit: onSubmit }), !answered ? _jsx(QuestionsFooter, { formRef: formRef, generating: generating, busy: busy, ready: ready, t: t }) : null] }));
32
+ }
33
+ /** Skip / Continue controls (and the still-generating hint) under an unanswered form. */
34
+ function QuestionsFooter({ formRef, generating, busy, ready, t }) {
35
+ return (_jsxs("div", { className: "jini-qp-foot", children: [generating ? _jsx("span", { className: "jini-qp-hint", children: t('Still generating…') }) : null, _jsx("button", { type: "button", className: "jini-qp-skip", disabled: busy, onClick: () => formRef.current?.skipAll(), children: t('Skip') }), _jsx("button", { type: "button", className: "jini-qp-continue primary", disabled: busy || !ready, onClick: () => formRef.current?.submit(), children: t('Continue') })] }));
32
36
  }
33
37
  //# sourceMappingURL=QuestionsPanel.js.map
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ChatAttachment } from '../../core/index.js';
3
- import { type ObjectUrlPort } from './SentAttachment.hooks.js';
3
+ import { useT } from '../hooks/context.js';
4
+ import { useSentAttachmentThumbnail, type ObjectUrlPort } from './SentAttachment.hooks.js';
4
5
  export interface SentAttachmentButtonProps {
5
6
  attachment: ChatAttachment;
6
7
  /** Opens the row's preview modal for this attachment. */
@@ -10,10 +11,18 @@ export interface SentAttachmentButtonProps {
10
11
  /** Blob-URL port for the thumbnail; defaults to the platform's (see `SentAttachment.hooks.ts`). */
11
12
  objectUrls?: ObjectUrlPort | undefined;
12
13
  }
14
+ /** Hooks SentAttachmentButton calls; defaults to the real ones, a test hands in fakes. */
15
+ export declare const defaultSentAttachmentButtonHooks: {
16
+ useT: typeof useT;
17
+ useSentAttachmentThumbnail: typeof useSentAttachmentThumbnail;
18
+ };
19
+ export type SentAttachmentButtonHooks = typeof defaultSentAttachmentButtonHooks;
13
20
  /**
14
21
  * One attachment on a sent user message: a small image thumbnail when this browser still holds the
15
22
  * image's bytes, otherwise the filename chip. Either way a click opens the preview modal, and the
16
23
  * accessible name stays "Open {name}".
17
24
  */
18
- export declare function SentAttachmentButton({ attachment, onOpen, renderAttachment, objectUrls }: SentAttachmentButtonProps): import("react").JSX.Element;
25
+ export declare function SentAttachmentButton({ attachment, onOpen, renderAttachment, objectUrls, hooks }: SentAttachmentButtonProps & {
26
+ hooks?: SentAttachmentButtonHooks | undefined;
27
+ }): import("react").JSX.Element;
19
28
  //# sourceMappingURL=SentAttachment.d.ts.map
@@ -35,7 +35,7 @@ export interface SentAttachmentThumbnail {
35
35
  export declare function useSentAttachmentThumbnail({ attachment, hostRendered }: {
36
36
  attachment: ChatAttachment;
37
37
  hostRendered?: boolean;
38
- }, { objectUrls, getSource }?: {
38
+ }, { objectUrls: suppliedObjectUrls, getSource }?: {
39
39
  objectUrls?: ObjectUrlPort | undefined;
40
40
  getSource?: (required: {
41
41
  path: string;
@@ -8,7 +8,7 @@
8
8
  * else - a non-image, a reload, the cache's eviction cap, a browser that cannot decode the format -
9
9
  * stays the filename chip, which still opens the preview modal's honest fallback.
10
10
  */
11
- import { useEffect, useState } from 'react';
11
+ import { useEffect, useMemo, useState } from 'react';
12
12
  import { getAttachmentPreviewSource } from '../hooks/attachment-preview-cache.js';
13
13
  import { canCreateObjectUrl, looksLikeImageAttachment } from './AttachmentPreviewModal.hooks.js';
14
14
  /** The platform's Blob URLs, or `undefined` where they do not exist (jsdom, non-browser hosts). */
@@ -35,7 +35,9 @@ export function sentAttachmentThumbnailSource({ attachment }, { getSource = getA
35
35
  * @param options.getSource - Preview-cache lookup; defaults to the shared cache.
36
36
  * @complexity O(1) per attachment.
37
37
  */
38
- export function useSentAttachmentThumbnail({ attachment, hostRendered = false }, { objectUrls = platformObjectUrls(), getSource = getAttachmentPreviewSource } = {}) {
38
+ export function useSentAttachmentThumbnail({ attachment, hostRendered = false }, { objectUrls: suppliedObjectUrls, getSource = getAttachmentPreviewSource } = {}) {
39
+ // The default factory returns a fresh object, so keep it stable until the supplied port changes.
40
+ const objectUrls = useMemo(() => suppliedObjectUrls ?? platformObjectUrls(), [suppliedObjectUrls]);
39
41
  const [failed, setFailed] = useState(false);
40
42
  const [thumbnailUrl, setThumbnailUrl] = useState(undefined);
41
43
  // A host `renderAttachment` owns the chip's content, so no thumbnail URL is made for it.
@@ -48,9 +50,8 @@ export function useSentAttachmentThumbnail({ attachment, hostRendered = false },
48
50
  const url = objectUrls.create(source);
49
51
  setThumbnailUrl(url);
50
52
  return () => objectUrls.revoke(url);
51
- // `objectUrls` is a fresh object per render by default; the file is what the URL is made from.
52
- // eslint-disable-next-line react-hooks/exhaustive-deps
53
- }, [source]);
53
+ // The stable port and the source file both determine the URL and its matching cleanup.
54
+ }, [source, objectUrls]);
54
55
  return { thumbnailUrl, onThumbnailError: () => setFailed(true) };
55
56
  }
56
57
  //# sourceMappingURL=SentAttachment.hooks.js.map
@@ -1,14 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useT } from '../hooks/context.js';
3
3
  import { useSentAttachmentThumbnail } from './SentAttachment.hooks.js';
4
+ /** Hooks SentAttachmentButton calls; defaults to the real ones, a test hands in fakes. */
5
+ export const defaultSentAttachmentButtonHooks = { useT, useSentAttachmentThumbnail };
4
6
  /**
5
7
  * One attachment on a sent user message: a small image thumbnail when this browser still holds the
6
8
  * image's bytes, otherwise the filename chip. Either way a click opens the preview modal, and the
7
9
  * accessible name stays "Open {name}".
8
10
  */
9
- export function SentAttachmentButton({ attachment, onOpen, renderAttachment, objectUrls }) {
10
- const t = useT();
11
- const { thumbnailUrl, onThumbnailError } = useSentAttachmentThumbnail({ attachment, hostRendered: renderAttachment !== undefined }, objectUrls === undefined ? {} : { objectUrls });
11
+ export function SentAttachmentButton({ attachment, onOpen, renderAttachment, objectUrls, hooks = defaultSentAttachmentButtonHooks }) {
12
+ const t = hooks.useT();
13
+ const { thumbnailUrl, onThumbnailError } = hooks.useSentAttachmentThumbnail({ attachment, hostRendered: renderAttachment !== undefined }, objectUrls === undefined ? {} : { objectUrls });
12
14
  const fallback = thumbnailUrl
13
15
  ? _jsx("img", { className: "jini-message-attachment-thumb", src: thumbnailUrl, alt: "", onError: onThumbnailError })
14
16
  : attachment.name;
@@ -1,8 +1,10 @@
1
1
  import type { TodoItem } from '../../core/index.js';
2
+ import { useT } from '../hooks/context.js';
2
3
  export interface TodoCardProps {
3
4
  todos: TodoItem[];
4
5
  runStreaming?: boolean;
5
6
  onDismiss?: () => void;
7
+ useTHook?: typeof useT;
6
8
  }
7
- export declare function TodoCard({ todos, runStreaming, onDismiss }: TodoCardProps): import("react").JSX.Element;
9
+ export declare function TodoCard({ todos, runStreaming, onDismiss, useTHook }: TodoCardProps): import("react").JSX.Element;
8
10
  //# sourceMappingURL=TodoCard.d.ts.map
@@ -12,13 +12,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  import { useState } from 'react';
13
13
  import { useT } from '../hooks/context.js';
14
14
  import { Icon } from './Icon.js';
15
- export function TodoCard({ todos, runStreaming, onDismiss }) {
16
- const t = useT();
15
+ export function TodoCard({ todos, runStreaming, onDismiss, useTHook = useT }) {
16
+ const t = useTHook();
17
17
  const { defaultExpanded, inProgressTodo, done, allComplete } = todoProgress({ todos }, { runStreaming });
18
18
  const [overrideExpanded, setOverrideExpanded] = useState(null);
19
19
  const expanded = overrideExpanded ?? defaultExpanded;
20
- const showDismiss = Boolean(onDismiss) && allComplete;
21
- return (_jsxs("div", { className: `op-card op-todo${expanded ? '' : ' op-todo-collapsed'}`, children: [_jsxs("div", { className: "op-card-head op-todo-head", children: [_jsxs("button", { type: "button", className: "op-todo-toggle", "aria-expanded": expanded, onClick: () => setOverrideExpanded(!expanded), title: expanded ? t('Collapse todos') : t('Expand todos'), children: [_jsx("span", { className: "op-icon", "aria-hidden": true, children: "\u2610" }), _jsx("span", { className: "op-title", children: t('Todos') }), _jsxs("span", { className: "op-meta", children: [done, "/", todos.length] }), !expanded && inProgressTodo ? _jsx("span", { className: "op-todo-current", children: todoLabel({ todo: inProgressTodo }) }) : null, _jsx("span", { className: "op-todo-chev", "aria-hidden": true, children: expanded ? _jsx(Icon, { name: "chevron-down", size: 11 }) : _jsx(Icon, { name: "chevron-right", size: 11 }) })] }), showDismiss ? (_jsx("button", { type: "button", className: "op-todo-done", onClick: () => onDismiss?.(), title: t('Dismiss'), children: t('Done') })) : null] }), _jsx("div", { className: `accordion-collapsible${expanded ? ' open' : ''}`, children: _jsx("div", { className: "accordion-collapsible-inner", children: _jsx("ul", { className: "todo-list", children: todos.map((todo, i) => (_jsxs("li", { className: `todo-item todo-${todo.status}`, children: [_jsx("span", { className: "todo-check", "aria-hidden": true, children: todoStatusGlyph({ status: todo.status }) }), _jsx("span", { className: "todo-text", children: todoLabel({ todo }) })] }, i))) }) }) })] }));
20
+ return (_jsxs("div", { className: `op-card op-todo${expanded ? '' : ' op-todo-collapsed'}`, children: [_jsxs("div", { className: "op-card-head jini-op-todo-head", children: [_jsxs("button", { type: "button", className: "jini-op-todo-toggle", "aria-expanded": expanded, onClick: () => setOverrideExpanded(!expanded), title: expanded ? t('Collapse todos') : t('Expand todos'), children: [_jsx("span", { className: "jini-op-icon", "aria-hidden": true, children: "\u2610" }), _jsx("span", { className: "op-title", children: t('Todos') }), _jsxs("span", { className: "jini-op-meta", children: [done, "/", todos.length] }), !expanded && inProgressTodo ? _jsx("span", { className: "jini-op-todo-current", children: todoLabel({ todo: inProgressTodo }) }) : null, _jsx("span", { className: "jini-op-todo-chev", "aria-hidden": true, children: expanded ? _jsx(Icon, { name: "chevron-down", size: 11 }) : _jsx(Icon, { name: "chevron-right", size: 11 }) })] }), _jsx(TodoDismissButton, { onDismiss: onDismiss, allComplete: allComplete, t: t })] }), _jsx("div", { className: `accordion-collapsible${expanded ? ' open' : ''}`, children: _jsx("div", { className: "jini-accordion-collapsible-inner", children: _jsx("ul", { className: "jini-todo-list", children: todos.map((todo, i) => (_jsxs("li", { className: `todo-item todo-${todo.status}`, children: [_jsx("span", { className: "jini-todo-check", "aria-hidden": true, children: todoStatusGlyph({ status: todo.status }) }), _jsx("span", { className: "jini-todo-text", children: todoLabel({ todo }) })] }, i))) }) }) })] }));
21
+ }
22
+ /** The "Done" action; only a fully completed list the host can dismiss shows it. */
23
+ function TodoDismissButton({ onDismiss, allComplete, t }) {
24
+ if (!onDismiss || !allComplete)
25
+ return null;
26
+ return (_jsx("button", { type: "button", className: "jini-op-todo-done", onClick: () => onDismiss(), title: t('Dismiss'), children: t('Done') }));
22
27
  }
23
28
  function todoProgress({ todos }, { runStreaming = false } = {}) {
24
29
  const hasPending = todos.some((todo) => todo.status === 'pending' || todo.status === 'in_progress');
@@ -1,13 +1,23 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ToolDisplayRow } from '../tool-call-display.js';
3
+ import { useToolCallGroup } from './ToolCallGroup.hooks.js';
4
+ import { useT } from '../hooks/context.js';
5
+ /** Hooks ToolCallGroup calls; defaults to the real ones, a test hands in fakes. */
6
+ export declare const defaultToolCallGroupHooks: {
7
+ useToolCallGroup: typeof useToolCallGroup;
8
+ useT: typeof useT;
9
+ };
10
+ export type ToolCallGroupHooks = typeof defaultToolCallGroupHooks;
3
11
  /**
4
12
  * One turn's tool cards folded into a single line ("Used 3 tools ▸") that opens on click — the
5
13
  * `toolCallDisplay: 'collapsed'` layout, or the compact failure notice in 'hidden'. The disclosure
6
14
  * state lives in `useToolCallGroup`; copy uses the host's translator.
7
15
  */
8
- export declare function ToolCallGroup<Row extends ToolDisplayRow>({ rows, renderRow, failureOnly }: {
16
+ export declare function ToolCallGroup<Row extends ToolDisplayRow>({ rows, renderRow, failureOnly, hooks }: {
9
17
  rows: readonly Row[];
10
18
  failureOnly?: boolean;
11
19
  renderRow: (row: Row) => ReactNode;
20
+ } & {
21
+ hooks?: ToolCallGroupHooks | undefined;
12
22
  }): import("react").JSX.Element;
13
23
  //# sourceMappingURL=ToolCallGroup.d.ts.map
@@ -2,14 +2,20 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useToolCallGroup } from './ToolCallGroup.hooks.js';
3
3
  import { useT } from '../hooks/context.js';
4
4
  import { Icon } from './Icon.js';
5
+ /** Hooks ToolCallGroup calls; defaults to the real ones, a test hands in fakes. */
6
+ export const defaultToolCallGroupHooks = { useToolCallGroup, useT };
5
7
  /**
6
8
  * One turn's tool cards folded into a single line ("Used 3 tools ▸") that opens on click — the
7
9
  * `toolCallDisplay: 'collapsed'` layout, or the compact failure notice in 'hidden'. The disclosure
8
10
  * state lives in `useToolCallGroup`; copy uses the host's translator.
9
11
  */
10
- export function ToolCallGroup({ rows, renderRow, failureOnly = false }) {
11
- const group = useToolCallGroup({ rows });
12
- const t = useT();
13
- return (_jsxs("div", { className: "jini-tool-group", "data-failed": group.failed ? 'true' : undefined, children: [failureOnly ? _jsxs("span", { className: "jini-tool-group__label", children: [t('A step failed'), " "] }) : null, _jsxs("button", { type: "button", className: "jini-tool-group__toggle", "aria-expanded": group.open, onClick: group.toggle, children: [_jsx("span", { className: `jini-tool-group__label${group.running ? ' shimmer-text' : ''}`, children: failureOnly ? t('Show') : group.label }), !failureOnly && group.failureLabel ? _jsxs("span", { className: "jini-tool-group__failed", children: [" \u00B7 ", group.failureLabel] }) : null, _jsx(Icon, { name: group.open ? 'chevron-down' : 'chevron-right', size: 12 })] }), group.open ? _jsx("div", { className: "jini-message-tools", children: rows.map(renderRow) }) : null] }));
12
+ export function ToolCallGroup({ rows, renderRow, failureOnly = false, hooks = defaultToolCallGroupHooks }) {
13
+ const group = hooks.useToolCallGroup({ rows });
14
+ const t = hooks.useT();
15
+ return (_jsxs("div", { className: "jini-tool-group", "data-failed": group.failed ? 'true' : undefined, children: [failureOnly ? _jsxs("span", { className: "jini-tool-group__label", children: [t('A step failed'), " "] }) : null, _jsx(ToolGroupToggle, { group: group, failureOnly: failureOnly, t: t }), group.open ? _jsx("div", { className: "jini-message-tools", children: rows.map(renderRow) }) : null] }));
16
+ }
17
+ /** The one-line disclosure button: the tool summary, or a bare "Show" under the failure-only layout. */
18
+ function ToolGroupToggle({ group, failureOnly, t }) {
19
+ return (_jsxs("button", { type: "button", className: "jini-tool-group__toggle", "aria-expanded": group.open, onClick: group.toggle, children: [_jsx("span", { className: `jini-tool-group__label${group.running ? ' shimmer-text' : ''}`, children: failureOnly ? t('Show') : group.label }), !failureOnly && group.failureLabel ? _jsxs("span", { className: "jini-tool-group__failed", children: [" \u00B7 ", group.failureLabel] }) : null, _jsx(Icon, { name: group.open ? 'chevron-down' : 'chevron-right', size: 12 })] }));
14
20
  }
15
21
  //# sourceMappingURL=ToolCallGroup.js.map
@@ -1,4 +1,6 @@
1
+ import { type Logger } from '@jini-ai/core/primitives';
1
2
  import type { AgentEvent } from '../../core/index.js';
3
+ import { useToolRendererRegistry } from '../hooks/context.js';
2
4
  type ToolUseEvent = Extract<AgentEvent, {
3
5
  kind: 'tool_use';
4
6
  }>;
@@ -6,6 +8,7 @@ type ToolResultEvent = Extract<AgentEvent, {
6
8
  kind: 'tool_result';
7
9
  }>;
8
10
  export interface ToolCardProps {
11
+ report?: Pick<Logger, 'error'> | undefined;
9
12
  use: ToolUseEvent;
10
13
  result?: ToolResultEvent | undefined;
11
14
  /** Whether the owning run is still streaming. Forwarded to registered renderers via `status`. */
@@ -19,6 +22,8 @@ export interface ToolCardProps {
19
22
  /** A later call of the same tool in this turn succeeded (`retriedToolRowIds`): a failure shows a neutral "Retried" badge, not red. */
20
23
  retried?: boolean;
21
24
  }
22
- export declare function ToolCard({ use, result, runStreaming, runSucceeded, projectFileNames, onRequestOpenFile, retried }: ToolCardProps): import("react").JSX.Element | null;
25
+ export declare function ToolCard({ use, result, runStreaming, runSucceeded, projectFileNames, onRequestOpenFile, retried, report, useToolRendererRegistryHook }: ToolCardProps & {
26
+ useToolRendererRegistryHook?: typeof useToolRendererRegistry;
27
+ }): import("react").JSX.Element | null;
23
28
  export {};
24
29
  //# sourceMappingURL=ToolCard.d.ts.map