@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.
- package/CHANGELOG.md +2 -12
- 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.d.ts +0 -4
- package/dist/react/components/MessageList.hooks.js +6 -18
- package/dist/react/components/MessageList.js +17 -20
- package/dist/react/components/MessageList.rules.d.ts +0 -5
- package/dist/react/components/MessageList.rules.js +0 -4
- 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 +25 -41
- 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 +46 -24
- 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,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { createConsoleLogger } from '@jini-ai/core/primitives';
|
|
3
3
|
const RUNNING_TITLE_CLASS = ' shimmer-text';
|
|
4
4
|
/**
|
|
5
5
|
* @module ToolCard
|
|
6
6
|
*
|
|
7
7
|
* Renders a single `tool_use` (optionally paired with its `tool_result`) as
|
|
8
8
|
* an inline card. Lookup order: (1) a user-registered renderer
|
|
9
|
-
* (`registerToolRenderer` —
|
|
9
|
+
* (`registerToolRenderer` — `packages/chat/src/react/tool-renderer-registry.ts`), (2) a
|
|
10
10
|
* hardcoded family card for tools shipped with this package (TodoWrite /
|
|
11
11
|
* Write / Edit / Read / Bash / Glob / Grep / WebFetch / WebSearch), (3) a
|
|
12
12
|
* generic command/output fallback.
|
|
@@ -37,14 +37,14 @@ import { toolPresentation } from '../../core/tool-presentation.js';
|
|
|
37
37
|
const RetriedContext = createContext(false);
|
|
38
38
|
/** A Jini registry tool id: dotted, lowercase, snake_case segments — `page.fill`, `daemon.db.vacuum`, `chat.send_message`. Never matches an agent-vendor tool name (`Bash`, `Write`, `mcp__jini__execute_delegated_tool`), which is the point — this is how a canonical delegated-tool event is told apart from everything else. */
|
|
39
39
|
const JINI_TOOL_ID_PATTERN = /^[a-z][a-z_]*(\.[a-z][a-z_]*)+$/;
|
|
40
|
-
export function ToolCard({ use, result, runStreaming, runSucceeded, projectFileNames, onRequestOpenFile, retried = false }) {
|
|
41
|
-
const registry =
|
|
40
|
+
export function ToolCard({ use, result, runStreaming, runSucceeded, projectFileNames, onRequestOpenFile, retried = false, report, useToolRendererRegistryHook = useToolRendererRegistry }) {
|
|
41
|
+
const registry = useToolRendererRegistryHook();
|
|
42
42
|
// Resolve vendor dialects for rendering only; tool ids and stored events stay intact.
|
|
43
43
|
const presentation = toolPresentation(use);
|
|
44
44
|
use = { ...use, ...presentation };
|
|
45
45
|
const name = use.name;
|
|
46
46
|
const card = { input: use.input, result: result, runStreaming: runStreaming ?? false, runSucceeded: runSucceeded ?? false };
|
|
47
|
-
const content = renderToolCardBody({ use, card, wrapper: presentation.wrapper, fileCtx: { projectFileNames, onRequestOpenFile }, registry });
|
|
47
|
+
const content = renderToolCardBody({ use, card, wrapper: presentation.wrapper, fileCtx: { projectFileNames, onRequestOpenFile }, registry, report });
|
|
48
48
|
if (content === null)
|
|
49
49
|
return null;
|
|
50
50
|
// Tagged once here, at the single dispatch point every branch below funnels through, rather than
|
|
@@ -70,7 +70,7 @@ const FAMILY_CARDS = new Map([
|
|
|
70
70
|
[['describe_tool', 'mcp__jini__describe_tool'], (card) => _jsx(DescribeToolCard, { ...card })],
|
|
71
71
|
].flatMap(([names, render]) => names.map((name) => [name, render])));
|
|
72
72
|
/** A host-registered renderer's output, or `undefined` when none is registered, it renders nothing, or it throws (logged) — every one of those falls back to the built-in cards. */
|
|
73
|
-
function renderRegistered({ use, card, registry }) {
|
|
73
|
+
function renderRegistered({ use, card, registry, report }) {
|
|
74
74
|
const custom = registry.get({ name: use.name });
|
|
75
75
|
if (!custom)
|
|
76
76
|
return undefined;
|
|
@@ -80,7 +80,8 @@ function renderRegistered({ use, card, registry }) {
|
|
|
80
80
|
return node;
|
|
81
81
|
}
|
|
82
82
|
catch (err) {
|
|
83
|
-
|
|
83
|
+
const logger = report ?? createConsoleLogger({ prefix: '' });
|
|
84
|
+
logger.error({ message: `[ToolCard] custom renderer for "${use.name}" threw; falling back` }, { error: err });
|
|
84
85
|
}
|
|
85
86
|
return undefined;
|
|
86
87
|
}
|
|
@@ -127,8 +128,8 @@ function renderToolCardBody(args) {
|
|
|
127
128
|
* target ({@link toolRowTarget}). One place, so a tool id the family table doesn't know (`content_post_update`,
|
|
128
129
|
* `mcp__acme__theme_list_files`) still reads as a label and never as its raw name and JSON args.
|
|
129
130
|
*/
|
|
130
|
-
function ToolRowHead({ name, input, result, runStreaming, runSucceeded }) {
|
|
131
|
-
const t =
|
|
131
|
+
function ToolRowHead({ name, input, result, runStreaming, runSucceeded, useTHook = useT }) {
|
|
132
|
+
const t = useTHook();
|
|
132
133
|
// Streaming deltas recreate result envelopes; parse only when the target's inputs change.
|
|
133
134
|
// A failed event's payload describes the error even when it contains human-looking names.
|
|
134
135
|
const resultContent = result?.content;
|
|
@@ -143,7 +144,7 @@ function ToolRowHead({ name, input, result, runStreaming, runSucceeded }) {
|
|
|
143
144
|
// The "Tool call · " prefix is visually hidden (owner bug 11-01: it took half a ~333px dock row, so
|
|
144
145
|
// names read "Tool call · Cont…") but stays in the row's accessible name. The name's tooltip must
|
|
145
146
|
// not repeat it: trees that read a child's title before its text announced "Tool call · Tool call ·".
|
|
146
|
-
return (_jsxs(_Fragment, { children: [_jsx(ResultBadge, { result: result, runStreaming: runStreaming, runSucceeded: runSucceeded }), _jsx("span", { className: "op-sr-prefix", children: prefix }), _jsx("span", { className: `op-title${isRunning ? RUNNING_TITLE_CLASS : ''}`, title: toolName, children: toolName }), summary ? _jsx("span", { className: "op-meta op-target", title: summary, children: summary }) : null] }));
|
|
147
|
+
return (_jsxs(_Fragment, { children: [_jsx(ResultBadge, { result: result, runStreaming: runStreaming, runSucceeded: runSucceeded }), _jsx("span", { className: "jini-op-sr-prefix", children: prefix }), _jsx("span", { className: `op-title${isRunning ? RUNNING_TITLE_CLASS : ''}`, title: toolName, children: toolName }), summary ? _jsx("span", { className: "jini-op-meta jini-op-target", title: summary, children: summary }) : null] }));
|
|
147
148
|
}
|
|
148
149
|
/**
|
|
149
150
|
* A card for one `page.*`/`daemon.db.*`/`chat.*`/… call — the canonical event
|
|
@@ -158,22 +159,27 @@ function DelegatedToolCard({ name, input, result, runStreaming, runSucceeded })
|
|
|
158
159
|
const wrapper = (input ?? {});
|
|
159
160
|
const toolId = isDelegatedWrapperToolName({ name: name }) ? (wrapper.toolId ?? name) : name;
|
|
160
161
|
const args = isDelegatedWrapperToolName({ name: name }) ? wrapper.input : input;
|
|
161
|
-
return (_jsx(ExpandableCard, { className: "op-jini-tool", call: { input: args ?? {}, result: result, runStreaming: runStreaming, runSucceeded: runSucceeded }, head: _jsx(ToolRowHead, { name: toolId, input: args, result: result, runStreaming: runStreaming, runSucceeded: runSucceeded }), after: _jsx(FileErrorDetail, { result: result }), children: _jsx(ToolCallDetail, { input: args ?? {}, result: result, runStreaming: runStreaming, runSucceeded: runSucceeded, children: _jsx(ToolResultMedia, { result: result }) }) }));
|
|
162
|
+
return (_jsx(ExpandableCard, { className: "jini-op-jini-tool", call: { input: args ?? {}, result: result, runStreaming: runStreaming, runSucceeded: runSucceeded }, head: _jsx(ToolRowHead, { name: toolId, input: args, result: result, runStreaming: runStreaming, runSucceeded: runSucceeded }), after: _jsx(FileErrorDetail, { result: result }), children: _jsx(ToolCallDetail, { input: args ?? {}, result: result, runStreaming: runStreaming, runSucceeded: runSucceeded, children: _jsx(ToolResultMedia, { result: result }) }) }));
|
|
162
163
|
}
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
/** The row every simple family card shares: status badge, a title (shimmering while the call runs when `shimmer`), optional meta, then the full call detail. */
|
|
165
|
+
function FamilyCard({ call, className, title, meta, shimmer = false, after, detailInput, children }) {
|
|
166
|
+
const isRunning = shimmer && call.runStreaming && !call.result;
|
|
167
|
+
return (_jsxs(ExpandableCard, { className: className, call: call, after: after, head: _jsxs(_Fragment, { children: [_jsx(ResultBadge, { result: call.result, runStreaming: call.runStreaming, runSucceeded: call.runSucceeded }), _jsx("span", { className: `op-title${isRunning ? RUNNING_TITLE_CLASS : ''}`, children: title }), meta] }), children: [children, _jsx(ToolCallDetail, { input: detailInput ?? call.input, result: call.result, runStreaming: call.runStreaming, runSucceeded: call.runSucceeded })] }));
|
|
168
|
+
}
|
|
169
|
+
function SearchToolsCard({ input, result, runStreaming, runSucceeded, useTHook = useT }) {
|
|
170
|
+
const t = useTHook();
|
|
165
171
|
const obj = (input ?? {});
|
|
166
|
-
const
|
|
167
|
-
return
|
|
172
|
+
const call = { input, result, runStreaming, runSucceeded };
|
|
173
|
+
return _jsx(FamilyCard, { call: call, className: "jini-op-jini-tool", shimmer: true, title: t('Search tools'), meta: obj.query ? _jsx("span", { className: "jini-op-meta", children: obj.query }) : null, after: _jsx(FileErrorDetail, { result: result }) });
|
|
168
174
|
}
|
|
169
|
-
function DescribeToolCard({ input, result, runStreaming, runSucceeded }) {
|
|
170
|
-
const t =
|
|
175
|
+
function DescribeToolCard({ input, result, runStreaming, runSucceeded, useTHook = useT }) {
|
|
176
|
+
const t = useTHook();
|
|
171
177
|
const obj = (input ?? {});
|
|
172
|
-
const
|
|
173
|
-
return
|
|
178
|
+
const call = { input, result, runStreaming, runSucceeded };
|
|
179
|
+
return _jsx(FamilyCard, { call: call, className: "jini-op-jini-tool", shimmer: true, title: t('Describe tool'), meta: obj.id ? _jsx("span", { className: "jini-op-meta", children: obj.id }) : null, after: _jsx(FileErrorDetail, { result: result }) });
|
|
174
180
|
}
|
|
175
|
-
function OpenInTabButton({ filePath, ctx }) {
|
|
176
|
-
const t =
|
|
181
|
+
function OpenInTabButton({ filePath, ctx, useTHook = useT }) {
|
|
182
|
+
const t = useTHook();
|
|
177
183
|
if (!ctx.onRequestOpenFile)
|
|
178
184
|
return null;
|
|
179
185
|
if (!filePath || filePath === '(unnamed)')
|
|
@@ -186,68 +192,72 @@ function OpenInTabButton({ filePath, ctx }) {
|
|
|
186
192
|
if (ctx.projectFileNames && !ctx.projectFileNames.has(baseName))
|
|
187
193
|
return null;
|
|
188
194
|
const open = ctx.onRequestOpenFile;
|
|
189
|
-
return (_jsx("button", { type: "button", className: "op-open", onClick: () => open(baseName), title: t('Open {name} in a tab', { name: baseName }), children: t('Open') }));
|
|
195
|
+
return (_jsx("button", { type: "button", className: "jini-op-open", onClick: () => open(baseName), title: t('Open {name} in a tab', { name: baseName }), children: t('Open') }));
|
|
190
196
|
}
|
|
191
|
-
function FileWriteCard({ input, result, runStreaming, runSucceeded, ctx }) {
|
|
192
|
-
const t =
|
|
197
|
+
function FileWriteCard({ input, result, runStreaming, runSucceeded, ctx, useTHook = useT }) {
|
|
198
|
+
const t = useTHook();
|
|
193
199
|
const obj = (input ?? {});
|
|
194
200
|
const file = obj.file_path ?? obj.filePath ?? obj.path ?? '(unnamed)';
|
|
195
201
|
// See OpenInTabButton's baseName comment: `.split('/').pop()` is never undefined.
|
|
196
202
|
const baseName = file.split('/').pop();
|
|
197
203
|
const lines = typeof obj.content === 'string' ? obj.content.split('\n').length : null;
|
|
198
|
-
const
|
|
199
|
-
return (
|
|
204
|
+
const call = { input, result, runStreaming, runSucceeded };
|
|
205
|
+
return (_jsx(FamilyCard, { call: call, className: "jini-op-file", shimmer: true, title: t('Write'), meta: _jsxs("span", { className: "jini-op-meta", children: [baseName, lines !== null ? ` · ${t('{n} lines', { n: lines })}` : ''] }), after: _jsx(FileErrorDetail, { result: result }), children: _jsxs("div", { className: "jini-op-card-detail jini-op-card-file-detail", children: [_jsx("code", { className: "jini-op-path", children: file }), _jsx(OpenInTabButton, { filePath: file, ctx: ctx })] }) }));
|
|
200
206
|
}
|
|
201
|
-
function FileEditCard({ input, result, runStreaming, runSucceeded, ctx }) {
|
|
202
|
-
const t =
|
|
207
|
+
function FileEditCard({ input, result, runStreaming, runSucceeded, ctx, useTHook = useT }) {
|
|
208
|
+
const t = useTHook();
|
|
203
209
|
const obj = (input ?? {});
|
|
204
210
|
const file = obj.file_path ?? obj.filePath ?? obj.path ?? '(unnamed)';
|
|
205
211
|
// See OpenInTabButton's baseName comment: `.split('/').pop()` is never undefined.
|
|
206
212
|
const baseName = file.split('/').pop();
|
|
207
213
|
const editCount = Array.isArray(obj.edits) ? obj.edits.length : 1;
|
|
208
|
-
const
|
|
209
|
-
return (
|
|
214
|
+
const call = { input, result, runStreaming, runSucceeded };
|
|
215
|
+
return (_jsx(FamilyCard, { call: call, className: "jini-op-file", shimmer: true, title: t('Edit'), meta: _jsxs("span", { className: "jini-op-meta", children: [baseName, " \u00B7 ", editCount, " ", editCount === 1 ? t('change') : t('changes')] }), after: _jsx(FileErrorDetail, { result: result }), children: _jsxs("div", { className: "jini-op-card-detail jini-op-card-file-detail", children: [_jsx("code", { className: "jini-op-path", children: file }), _jsx(OpenInTabButton, { filePath: file, ctx: ctx })] }) }));
|
|
210
216
|
}
|
|
211
|
-
function FileReadCard({ input, result, runStreaming, runSucceeded, ctx }) {
|
|
212
|
-
const t =
|
|
217
|
+
function FileReadCard({ input, result, runStreaming, runSucceeded, ctx, useTHook = useT }) {
|
|
218
|
+
const t = useTHook();
|
|
213
219
|
const obj = (input ?? {});
|
|
214
220
|
const file = obj.file_path ?? obj.filePath ?? obj.path ?? '(unnamed)';
|
|
215
221
|
// See OpenInTabButton's baseName comment: `.split('/').pop()` is never undefined.
|
|
216
222
|
const baseName = targetAtOffset({ target: file.split('/').pop(), offset: obj.offset });
|
|
217
|
-
const
|
|
218
|
-
return (
|
|
223
|
+
const call = { input, result, runStreaming, runSucceeded };
|
|
224
|
+
return (_jsx(FamilyCard, { call: call, className: "jini-op-file", shimmer: true, title: t('Read'), meta: _jsx("span", { className: "jini-op-meta", children: baseName }), after: _jsx(FileErrorDetail, { result: result }), children: _jsxs("div", { className: "jini-op-card-detail jini-op-card-file-detail", children: [_jsx("code", { className: "jini-op-path", children: file }), _jsx(OpenInTabButton, { filePath: file, ctx: ctx })] }) }));
|
|
219
225
|
}
|
|
220
|
-
function BashCard({ input, result, runStreaming, runSucceeded }) {
|
|
221
|
-
const t =
|
|
226
|
+
function BashCard({ input, result, runStreaming, runSucceeded, useTHook = useT }) {
|
|
227
|
+
const t = useTHook();
|
|
222
228
|
const obj = (input ?? {});
|
|
223
229
|
const command = obj.command ?? '';
|
|
224
230
|
const desc = obj.description;
|
|
225
|
-
const
|
|
226
|
-
return
|
|
231
|
+
const call = { input, result, runStreaming, runSucceeded };
|
|
232
|
+
return _jsx(FamilyCard, { call: call, className: "jini-op-bash", shimmer: true, title: t('Bash'), meta: desc ? _jsx("span", { className: "jini-op-meta jini-op-desc", children: desc }) : null, detailInput: command });
|
|
227
233
|
}
|
|
228
|
-
function GlobCard({ input, result, runStreaming, runSucceeded }) {
|
|
229
|
-
const t =
|
|
234
|
+
function GlobCard({ input, result, runStreaming, runSucceeded, useTHook = useT }) {
|
|
235
|
+
const t = useTHook();
|
|
230
236
|
const obj = (input ?? {});
|
|
231
|
-
|
|
237
|
+
const call = { input, result, runStreaming, runSucceeded };
|
|
238
|
+
return _jsx(FamilyCard, { call: call, className: "jini-op-search", title: t('Search files'), meta: _jsxs("span", { className: "jini-op-meta", children: [obj.pattern ?? '*', obj.path ? ` in ${obj.path}` : ''] }) });
|
|
232
239
|
}
|
|
233
|
-
function GrepCard({ input, result, runStreaming, runSucceeded }) {
|
|
234
|
-
const t =
|
|
240
|
+
function GrepCard({ input, result, runStreaming, runSucceeded, useTHook = useT }) {
|
|
241
|
+
const t = useTHook();
|
|
235
242
|
const obj = (input ?? {});
|
|
236
|
-
|
|
243
|
+
const call = { input, result, runStreaming, runSucceeded };
|
|
244
|
+
return _jsx(FamilyCard, { call: call, className: "jini-op-search", title: t('Search content'), meta: _jsxs("span", { className: "jini-op-meta", children: [obj.pattern ?? '', obj.path ? ` in ${obj.path}` : ''] }) });
|
|
237
245
|
}
|
|
238
|
-
function WebFetchCard({ input, result, runStreaming, runSucceeded }) {
|
|
239
|
-
const t =
|
|
246
|
+
function WebFetchCard({ input, result, runStreaming, runSucceeded, useTHook = useT }) {
|
|
247
|
+
const t = useTHook();
|
|
240
248
|
const obj = (input ?? {});
|
|
241
|
-
|
|
249
|
+
const call = { input, result, runStreaming, runSucceeded };
|
|
250
|
+
return _jsx(FamilyCard, { call: call, className: "jini-op-web", title: t('Fetch'), meta: _jsx("span", { className: "jini-op-meta", children: obj.url ?? '' }) });
|
|
242
251
|
}
|
|
243
|
-
function WebSearchCard({ input, result, runStreaming, runSucceeded }) {
|
|
244
|
-
const t =
|
|
252
|
+
function WebSearchCard({ input, result, runStreaming, runSucceeded, useTHook = useT }) {
|
|
253
|
+
const t = useTHook();
|
|
245
254
|
const obj = (input ?? {});
|
|
246
|
-
|
|
255
|
+
const call = { input, result, runStreaming, runSucceeded };
|
|
256
|
+
return _jsx(FamilyCard, { call: call, className: "jini-op-web", title: t('Search'), meta: _jsx("span", { className: "jini-op-meta", children: obj.query ?? '' }) });
|
|
247
257
|
}
|
|
248
258
|
/** Any tool this package has no family card for — an MCP tool, or a card tool such as `assistant_ask_choice` whose form renders elsewhere in the turn. The row still opens to the full call. */
|
|
249
259
|
function GenericCard({ name, input, result, runStreaming, runSucceeded }) {
|
|
250
|
-
return (_jsx(ExpandableCard, { className: "op-generic", call: { input: input, result: result, runStreaming: runStreaming, runSucceeded: runSucceeded }, head: _jsx(ToolRowHead, { name: name, input: input, result: result, runStreaming: runStreaming, runSucceeded: runSucceeded }), after: _jsx(ToolResultMedia, { result: result }), children: _jsx(ToolCallDetail, { input: input, result: result, runStreaming: runStreaming, runSucceeded: runSucceeded }) }));
|
|
260
|
+
return (_jsx(ExpandableCard, { className: "jini-op-generic", call: { input: input, result: result, runStreaming: runStreaming, runSucceeded: runSucceeded }, head: _jsx(ToolRowHead, { name: name, input: input, result: result, runStreaming: runStreaming, runSucceeded: runSucceeded }), after: _jsx(ToolResultMedia, { result: result }), children: _jsx(ToolCallDetail, { input: input, result: result, runStreaming: runStreaming, runSucceeded: runSucceeded }) }));
|
|
251
261
|
}
|
|
252
262
|
/**
|
|
253
263
|
* The one row shell every card shares: a real `<button>` head (Enter/Space toggle it) that reports
|
|
@@ -261,7 +271,7 @@ function GenericCard({ name, input, result, runStreaming, runSucceeded }) {
|
|
|
261
271
|
function ExpandableCard({ className, head, after, call, children }) {
|
|
262
272
|
const [open, setOpen] = useState(false);
|
|
263
273
|
const panelId = useId();
|
|
264
|
-
return (_jsxs("div", { className: `op-card ${className}`, children: [_jsxs("button", { type: "button", className: "op-card-head", "aria-expanded": open, "aria-controls": panelId, onClick: () => setOpen((o) => !o), children: [head, _jsx("span", { className: "op-expand-chev", "aria-hidden": true, children: _jsx(Icon, { name: open ? 'chevron-down' : 'chevron-right', size: 11 }) })] }), _jsx("div", { id: panelId, className: `accordion-collapsible${open ? ' open' : ''}`, children: open ? _jsx("div", { className: "accordion-collapsible-inner", children: children }) : null }), open ? null : _jsx(CollapsedReaderText, { call: call }), after] }));
|
|
274
|
+
return (_jsxs("div", { className: `op-card ${className}`, children: [_jsxs("button", { type: "button", className: "op-card-head", "aria-expanded": open, "aria-controls": panelId, onClick: () => setOpen((o) => !o), children: [head, _jsx("span", { className: "jini-op-expand-chev", "aria-hidden": true, children: _jsx(Icon, { name: open ? 'chevron-down' : 'chevron-right', size: 11 }) })] }), _jsx("div", { id: panelId, className: `accordion-collapsible${open ? ' open' : ''}`, children: open ? _jsx("div", { className: "jini-accordion-collapsible-inner", children: children }) : null }), open ? null : _jsx(CollapsedReaderText, { call: call }), after] }));
|
|
265
275
|
}
|
|
266
276
|
/** The collapsed row's stand-in for its panel — see {@link ExpandableCard} and `describeCollapsedToolCall`. */
|
|
267
277
|
function CollapsedReaderText({ call }) {
|
|
@@ -273,32 +283,32 @@ function CollapsedReaderText({ call }) {
|
|
|
273
283
|
const runStreaming = !call.result && call.runStreaming;
|
|
274
284
|
const runSucceeded = !call.result && call.runSucceeded;
|
|
275
285
|
const text = useMemo(() => describeCollapsedToolCall({ input, result: resultContent === undefined ? undefined : { content: resultContent, isError: resultIsError } }, { runStreaming, runSucceeded }), [input, resultContent, resultIsError, runStreaming, runSucceeded]);
|
|
276
|
-
return _jsx("span", { className: "op-card-reader-text op-sr-prefix", children: text });
|
|
286
|
+
return _jsx("span", { className: "jini-op-card-reader-text jini-op-sr-prefix", children: text });
|
|
277
287
|
}
|
|
278
288
|
/** The call's input, its result (or why there is none), and any extra `children` — see `describeToolCallDetail` for the redaction and formatting rules. */
|
|
279
|
-
function ToolCallDetail({ input, result, runStreaming, runSucceeded, children }) {
|
|
280
|
-
const t =
|
|
289
|
+
function ToolCallDetail({ input, result, runStreaming, runSucceeded, children, useTHook = useT }) {
|
|
290
|
+
const t = useTHook();
|
|
281
291
|
// Only mounted on expansion: keep the compact preview cheap without losing any of the stored
|
|
282
292
|
// call when the person opens it. The core formatter still owns formatting and secret redaction.
|
|
283
293
|
const detail = describeToolCallDetail({ input: input, result: result }, { runStreaming: runStreaming, runSucceeded: runSucceeded, maxChars: Infinity });
|
|
284
|
-
return (_jsxs("div", { className: "op-card-detail", children: [detail.inputText !== null ? _jsx("pre", { className: "op-command op-input", children: detail.inputText }) : null, detail.outputText !== null ? _jsx("pre", { className: "op-output", children: detail.outputText }) : null, detail.noteKey !== null ? _jsx("p", { className: "op-detail-note", children: t(detail.noteKey) }) : null, children] }));
|
|
294
|
+
return (_jsxs("div", { className: "jini-op-card-detail", children: [detail.inputText !== null ? _jsx("pre", { className: "jini-op-command jini-op-input", children: detail.inputText }) : null, detail.outputText !== null ? _jsx("pre", { className: "op-output", children: detail.outputText }) : null, detail.noteKey !== null ? _jsx("p", { className: "jini-op-detail-note", children: t(detail.noteKey) }) : null, children] }));
|
|
285
295
|
}
|
|
286
296
|
/** A failed result: neutral "Retried" when a later call of the same tool succeeded, else red. */
|
|
287
|
-
function ErrorBadge({ result }) {
|
|
288
|
-
const t =
|
|
297
|
+
function ErrorBadge({ result, useTHook = useT }) {
|
|
298
|
+
const t = useTHook();
|
|
289
299
|
if (useContext(RetriedContext))
|
|
290
|
-
return (_jsx("span", { className: "op-status op-status-retried", title: t('Retried'), children: _jsx(Icon, { name: "retry", size: 14 }) }));
|
|
291
|
-
return (_jsx("span", { className: "op-status op-status-error", title: describeToolCallDetail({ input: null, result }, { maxChars: COLLAPSED_DETAIL_MAX_CHARS }).outputText ?? t('Error'), children: _jsx(Icon, { name: "close", size: 14 }) }));
|
|
300
|
+
return (_jsx("span", { className: "jini-op-status jini-op-status-retried", title: t('Retried'), children: _jsx(Icon, { name: "retry", size: 14 }) }));
|
|
301
|
+
return (_jsx("span", { className: "jini-op-status op-status-error", title: describeToolCallDetail({ input: null, result }, { maxChars: COLLAPSED_DETAIL_MAX_CHARS }).outputText ?? t('Error'), children: _jsx(Icon, { name: "close", size: 14 }) }));
|
|
292
302
|
}
|
|
293
|
-
function ResultBadge({ result, runStreaming, runSucceeded }) {
|
|
294
|
-
const t =
|
|
303
|
+
function ResultBadge({ result, runStreaming, runSucceeded, useTHook = useT }) {
|
|
304
|
+
const t = useTHook();
|
|
295
305
|
if (!result && runStreaming)
|
|
296
|
-
return (_jsx("span", { className: "op-status op-status-running", title: t('Running'), children: _jsx(Icon, { name: "spinner", size: 14 }) }));
|
|
306
|
+
return (_jsx("span", { className: "jini-op-status jini-op-status-running", title: t('Running'), children: _jsx(Icon, { name: "spinner", size: 14 }) }));
|
|
297
307
|
if (!result && !runSucceeded)
|
|
298
|
-
return (_jsx("span", { className: "op-status op-status-error", title: t('Error'), children: _jsx(Icon, { name: "close", size: 14 }) }));
|
|
308
|
+
return (_jsx("span", { className: "jini-op-status op-status-error", title: t('Error'), children: _jsx(Icon, { name: "close", size: 14 }) }));
|
|
299
309
|
if (result?.isError)
|
|
300
310
|
return _jsx(ErrorBadge, { result: result });
|
|
301
|
-
return (_jsx("span", { className: "op-status op-status-ok", title: t('Done'), children: _jsx(Icon, { name: "check", size: 14 }) }));
|
|
311
|
+
return (_jsx("span", { className: "jini-op-status jini-op-status-ok", title: t('Done'), children: _jsx(Icon, { name: "check", size: 14 }) }));
|
|
302
312
|
}
|
|
303
313
|
/**
|
|
304
314
|
* Renders the `image` blocks a tool result's `media` field carries — the one media type this slice
|
|
@@ -319,7 +329,7 @@ function ToolResultMedia({ result }) {
|
|
|
319
329
|
const images = blocks.filter((block) => block.type === 'image');
|
|
320
330
|
if (images.length === 0)
|
|
321
331
|
return null;
|
|
322
|
-
return (_jsx("div", { className: "op-media", children: images.map((block, index) => _jsx(ToolResultImageFigure, { block: block }, index)) }));
|
|
332
|
+
return (_jsx("div", { className: "jini-op-media", children: images.map((block, index) => _jsx(ToolResultImageFigure, { block: block }, index)) }));
|
|
323
333
|
}
|
|
324
334
|
/**
|
|
325
335
|
* One tool image: captioned by its `title` (also the alt text) and linked to its `href` in a new
|
|
@@ -327,15 +337,15 @@ function ToolResultMedia({ result }) {
|
|
|
327
337
|
* safe-target rule as chat links (`Markdown.tsx`); `javascript:`/`data:` stays an unlinked image.
|
|
328
338
|
*/
|
|
329
339
|
function ToolResultImageFigure({ block }) {
|
|
330
|
-
const img = (_jsx("img", { className: "op-media-image", src: `data:${block.mimeType};base64,${block.data}`, alt: block.title ?? '', style: { maxWidth: '100%', height: 'auto', display: 'block' } }));
|
|
340
|
+
const img = (_jsx("img", { className: "jini-op-media-image", src: `data:${block.mimeType};base64,${block.data}`, alt: block.title ?? '', style: { maxWidth: '100%', height: 'auto', display: 'block' } }));
|
|
331
341
|
const linked = block.href !== undefined && SAFE_LINK_HREF.test(block.href) && !block.href.startsWith('#')
|
|
332
|
-
? _jsx("a", { className: "op-media-link", href: block.href, target: "_blank", rel: "noopener noreferrer", children: img })
|
|
342
|
+
? _jsx("a", { className: "jini-op-media-link", href: block.href, target: "_blank", rel: "noopener noreferrer", children: img })
|
|
333
343
|
: img;
|
|
334
344
|
if (block.title === undefined)
|
|
335
345
|
return linked;
|
|
336
346
|
return (
|
|
337
347
|
// No host stylesheet styles op-media yet; reset the UA figure margin (40px sides) inline, like the img.
|
|
338
|
-
_jsxs("figure", { className: "op-media-figure", style: { margin: 0 }, children: [linked, _jsx("figcaption", { className: "op-media-caption", children: block.title })] }));
|
|
348
|
+
_jsxs("figure", { className: "jini-op-media-figure", style: { margin: 0 }, children: [linked, _jsx("figcaption", { className: "jini-op-media-caption", children: block.title })] }));
|
|
339
349
|
}
|
|
340
350
|
function FileErrorDetail({ result }) {
|
|
341
351
|
if (!result?.isError)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Read display context from a standalone form; its host may not have emitted a tool call. */
|
|
2
|
-
import { type UIResource } from '@jini-ai/
|
|
2
|
+
import { type UIResource } from '@jini-ai/protocol/mcp-ui';
|
|
3
3
|
import type { AgentEvent } from '../../core/events.js';
|
|
4
4
|
import type { AcceptedInputProjectionOptions } from '../../core/accepted-input.js';
|
|
5
5
|
/** Feed recovered form context into the existing receipt projection, including after history reload.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Read display context from a standalone form; its host may not have emitted a tool call. */
|
|
2
|
-
import { parseUIResource, readActionPlan } from '@jini-ai/
|
|
2
|
+
import { parseUIResource, readActionPlan } from '@jini-ai/protocol/mcp-ui';
|
|
3
3
|
import { useMemo, useRef } from 'react';
|
|
4
4
|
import { SURFACE_QUESTION_META_KEY } from '../../core/question-answer.js';
|
|
5
5
|
import { useExtEventGroups } from '../hooks/useExtEventGroups.js';
|
|
@@ -19,7 +19,7 @@ export function useSurfaceAnswerContexts({ events }, _options = {}) {
|
|
|
19
19
|
const data = group.events[0];
|
|
20
20
|
let cached = cache.current.get(data);
|
|
21
21
|
if (cached === undefined || cached.sourceInput !== group.call.input) {
|
|
22
|
-
const input = surfaceQuestionInput({ resource: parseUIResource(data), input: group.call.input });
|
|
22
|
+
const input = surfaceQuestionInput({ resource: parseUIResource({ value: data }), input: group.call.input });
|
|
23
23
|
cached = { sourceInput: group.call.input, context: { input, includeTitle: input !== group.call.input } };
|
|
24
24
|
cache.current.set(data, cached);
|
|
25
25
|
}
|
|
@@ -51,7 +51,7 @@ function surfaceQuestionContext({ resource }, _options = {}) {
|
|
|
51
51
|
/** The title and offered choices an inert parse of the surface document shows. */
|
|
52
52
|
function markupQuestion({ resource }, _options = {}) {
|
|
53
53
|
const document = new DOMParser().parseFromString(resource.resource.text, 'text/html');
|
|
54
|
-
const title = readActionPlan(resource)?.title ?? document.querySelector('h1')?.textContent?.trim();
|
|
54
|
+
const title = readActionPlan({ resource })?.title ?? document.querySelector('h1')?.textContent?.trim();
|
|
55
55
|
const labels = new Map([...document.querySelectorAll('label')].map(label => [label.htmlFor, label.textContent?.trim() ?? '']));
|
|
56
56
|
const options = [...document.querySelectorAll('input[type="radio"], input[type="checkbox"], option')].map(control => ({ value: control.value, label: optionText({ labels, control }) }));
|
|
57
57
|
return { title, options };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { McpUiToolCallHandler } from '@jini-ai/
|
|
1
|
+
import type { McpUiToolCallHandler } from '@jini-ai/protocol/mcp-ui';
|
|
2
2
|
import type { ExtEventCall } from '../ext-event-renderer-registry.js';
|
|
3
3
|
import type { useT } from '../hooks/context.js';
|
|
4
4
|
type Translate = ReturnType<typeof useT>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CapabilityDef, CapabilityInputSchema, CapabilityRisk } from '@jini-ai/
|
|
1
|
+
import type { CapabilityDef, CapabilityInputSchema, CapabilityRisk } from '@jini-ai/core/contracts/capabilities';
|
|
2
2
|
/** @deprecated Use `CapabilityRisk` from `@jini-ai/agentic`. */
|
|
3
3
|
export type ChatPaneAgentToolRisk = CapabilityRisk;
|
|
4
4
|
/** @deprecated Use `CapabilityInputSchema` from `@jini-ai/agentic`. */
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { ChatMessage } from '../../../../core/messages.js';
|
|
2
|
+
import { useT } from '../../../hooks/context.js';
|
|
2
3
|
/** One per-chat usage strip; removing a name persists its exclusion for future turns. */
|
|
3
|
-
export declare function AgentPluginUsage({ conversationId, messages }: {
|
|
4
|
+
export declare function AgentPluginUsage({ conversationId, messages, useTHook }: {
|
|
4
5
|
conversationId?: string | null;
|
|
5
6
|
messages: readonly ChatMessage[];
|
|
7
|
+
} & {
|
|
8
|
+
useTHook?: typeof useT;
|
|
6
9
|
}): import("react").JSX.Element | null;
|
|
7
10
|
//# sourceMappingURL=AgentPluginUsage.d.ts.map
|
|
@@ -26,8 +26,8 @@ function resolveAgentPluginStrip({ messages }, { conversationId }) {
|
|
|
26
26
|
return { id, state, plugins };
|
|
27
27
|
}
|
|
28
28
|
/** One per-chat usage strip; removing a name persists its exclusion for future turns. */
|
|
29
|
-
export function AgentPluginUsage({ conversationId, messages }) {
|
|
30
|
-
const t =
|
|
29
|
+
export function AgentPluginUsage({ conversationId, messages, useTHook = useT }) {
|
|
30
|
+
const t = useTHook();
|
|
31
31
|
const [, setRevision] = useState(0);
|
|
32
32
|
useEffect(() => {
|
|
33
33
|
const refresh = () => setRevision(value => value + 1);
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { useAgentHandle, useOverlayContainer } from '@jini-ai/ui';
|
|
2
|
+
import { useT } from '../../../hooks/context.js';
|
|
3
|
+
import { runtimeOptionLabel, runtimePopoverPosition, useAgentRuntimePicker } from '../hooks/useAgentRuntimePicker.hooks.js';
|
|
4
|
+
import type { AgentRuntimePickerProps } from '../types.js';
|
|
3
5
|
export { runtimeOptionLabel, runtimePopoverPosition };
|
|
4
|
-
export declare function runtimeAgentStatus({ agent }: {
|
|
5
|
-
agent: ChatPaneAgent;
|
|
6
|
-
}): string;
|
|
7
6
|
/**
|
|
8
7
|
* Renders the package-owned local/API, agent, model, and reasoning picker.
|
|
9
8
|
*
|
|
10
9
|
* @complexity Time: O(n) in the runtime inventory; space: O(n) for ordering.
|
|
11
10
|
* @overallScore 100/100
|
|
12
11
|
*/
|
|
13
|
-
export declare function AgentRuntimePicker({ agentHandle, agents, nativeToolPolicy, value, onChange, onRescan, scanning, daemonOnline, placement, executionMode, apiModeAvailable, onExecutionModeChange, byokRuntime, onByokModelChange, agentIconBasePath, }: AgentRuntimePickerProps
|
|
12
|
+
export declare function AgentRuntimePicker({ useAgentHandleHook, useAgentRuntimePickerHook, useTHook, useOverlayContainerHook, agentHandle, agents, nativeToolPolicy, value, onChange, onRescan, scanning, daemonOnline, placement, executionMode, apiModeAvailable, onExecutionModeChange, byokRuntime, onByokModelChange, agentIconBasePath, }: AgentRuntimePickerProps & {
|
|
13
|
+
useAgentHandleHook?: typeof useAgentHandle;
|
|
14
|
+
useAgentRuntimePickerHook?: typeof useAgentRuntimePicker;
|
|
15
|
+
useTHook?: typeof useT;
|
|
16
|
+
useOverlayContainerHook?: typeof useOverlayContainer;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
14
18
|
//# sourceMappingURL=AgentRuntimePicker.d.ts.map
|