@asgard-js/react 0.2.61 → 0.2.63
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/README.md +55 -25
- package/dist/components/chatbot/channel-title/channel-title.d.ts +5 -0
- package/dist/components/chatbot/channel-title/channel-title.d.ts.map +1 -0
- package/dist/components/chatbot/channel-title/index.d.ts +2 -0
- package/dist/components/chatbot/channel-title/index.d.ts.map +1 -0
- package/dist/components/chatbot/chatbot-body/chatbot-body.d.ts.map +1 -1
- package/dist/components/chatbot/chatbot-body/conversation-message-renderer.d.ts.map +1 -1
- package/dist/components/chatbot/chatbot-footer/chatbot-footer.d.ts.map +1 -1
- package/dist/components/chatbot/chatbot-footer/document-upload-button.d.ts +1 -0
- package/dist/components/chatbot/chatbot-footer/document-upload-button.d.ts.map +1 -1
- package/dist/components/chatbot/chatbot-footer/speech-input-button.d.ts +2 -0
- package/dist/components/chatbot/chatbot-footer/speech-input-button.d.ts.map +1 -1
- package/dist/components/chatbot/chatbot.d.ts +23 -0
- package/dist/components/chatbot/chatbot.d.ts.map +1 -1
- package/dist/components/chatbot/running-indicator/index.d.ts +2 -0
- package/dist/components/chatbot/running-indicator/index.d.ts.map +1 -0
- package/dist/components/chatbot/running-indicator/running-indicator.d.ts +8 -0
- package/dist/components/chatbot/running-indicator/running-indicator.d.ts.map +1 -0
- package/dist/components/chatbot/subagent-list/index.d.ts +2 -0
- package/dist/components/chatbot/subagent-list/index.d.ts.map +1 -0
- package/dist/components/chatbot/subagent-list/subagent-list.d.ts +10 -0
- package/dist/components/chatbot/subagent-list/subagent-list.d.ts.map +1 -0
- package/dist/components/chatbot/task-list/index.d.ts +2 -0
- package/dist/components/chatbot/task-list/index.d.ts.map +1 -0
- package/dist/components/chatbot/task-list/task-list.d.ts +10 -0
- package/dist/components/chatbot/task-list/task-list.d.ts.map +1 -0
- package/dist/components/templates/index.d.ts +1 -0
- package/dist/components/templates/index.d.ts.map +1 -1
- package/dist/components/templates/text-template/bot-typing-box.d.ts.map +1 -1
- package/dist/components/templates/text-template/index.d.ts +0 -1
- package/dist/components/templates/text-template/index.d.ts.map +1 -1
- package/dist/components/templates/thinking-block/index.d.ts +2 -0
- package/dist/components/templates/thinking-block/index.d.ts.map +1 -0
- package/dist/components/templates/thinking-block/thinking-block.d.ts +8 -0
- package/dist/components/templates/thinking-block/thinking-block.d.ts.map +1 -0
- package/dist/components/templates/tool-call-group/index.d.ts +1 -0
- package/dist/components/templates/tool-call-group/index.d.ts.map +1 -1
- package/dist/components/templates/tool-call-group/tool-call-group-template.d.ts.map +1 -1
- package/dist/components/templates/tool-call-group/tool-call-group.d.ts +20 -1
- package/dist/components/templates/tool-call-group/tool-call-group.d.ts.map +1 -1
- package/dist/components/templates/tool-call-group/tool-call-label.d.ts +32 -0
- package/dist/components/templates/tool-call-group/tool-call-label.d.ts.map +1 -0
- package/dist/context/asgard-service-context.d.ts +11 -1
- package/dist/context/asgard-service-context.d.ts.map +1 -1
- package/dist/context/asgard-template-context.d.ts +23 -0
- package/dist/context/asgard-template-context.d.ts.map +1 -1
- package/dist/context/asgard-theme-context.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/use-channel.d.ts +4 -0
- package/dist/hooks/use-channel.d.ts.map +1 -1
- package/dist/hooks/use-derived-state.d.ts +9 -0
- package/dist/hooks/use-derived-state.d.ts.map +1 -0
- package/dist/i18n.d.ts +6 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14740 -13825
- package/dist/utils/file-validation.d.ts +14 -4
- package/dist/utils/file-validation.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/components/templates/text-template/bot-typing-placeholder.d.ts +0 -8
- package/dist/components/templates/text-template/bot-typing-placeholder.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -141,6 +141,26 @@ When `enableLoadConfigFromService` is enabled, you can also control the upload f
|
|
|
141
141
|
|
|
142
142
|
**Features**: Multiple file selection, image preview with modal view, and responsive design. Supports JPEG, PNG, GIF, WebP up to 20MB per file, maximum 10 files at once.
|
|
143
143
|
|
|
144
|
+
#### Restricting Allowed MIME Types
|
|
145
|
+
|
|
146
|
+
By default, image upload accepts `image/jpeg`, `image/jpg`, `image/png`, `image/gif`, and `image/webp`, while document upload accepts a built-in list of document types (with an extension-based fallback). To narrow — or extend — what users may attach, pass `allowedImageMimeTypes` / `allowedDocumentMimeTypes`:
|
|
147
|
+
|
|
148
|
+
```javascript
|
|
149
|
+
<Chatbot
|
|
150
|
+
config={{
|
|
151
|
+
apiKey: 'your-api-key',
|
|
152
|
+
botProviderEndpoint: 'https://api.asgard-ai.com/ns/{namespace}/bot-provider/{botProviderId}',
|
|
153
|
+
}}
|
|
154
|
+
customChannelId="your-channel-id"
|
|
155
|
+
enableUpload
|
|
156
|
+
enableDocumentUpload
|
|
157
|
+
allowedImageMimeTypes={['image/png', 'image/webp']}
|
|
158
|
+
allowedDocumentMimeTypes={['application/pdf']}
|
|
159
|
+
/>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Both props **override** their respective default list entirely (they do not merge) and only take effect when the matching `enableUpload` / `enableDocumentUpload` flag is on. The provided values drive both the file picker `accept` attribute and validation. For documents, supplying the prop also switches validation to MIME-only matching (the extension fallback no longer applies). Passing an empty array is treated the same as omitting the prop.
|
|
163
|
+
|
|
144
164
|
<a id="conversation-export"></a>
|
|
145
165
|
<br/>
|
|
146
166
|
|
|
@@ -295,6 +315,8 @@ config: {
|
|
|
295
315
|
- **enableUpload?**: `boolean` - Enable file upload functionality. When set, it takes priority over the `embedConfig.enableUpload` setting from the bot provider metadata. Defaults to `false` if not specified in either location. Supports image files (JPEG, PNG, GIF, WebP) up to 20MB per file, maximum 10 files at once.
|
|
296
316
|
- **enableExport?**: `boolean` - Enable conversation export functionality. When set, it takes priority over the `embedConfig.enableExport` setting from the bot provider metadata. Defaults to `false` if not specified in either location. Adds a download button to the chatbot footer that exports the conversation history as a Markdown file with timestamps and trace IDs.
|
|
297
317
|
- **enableDocumentUpload?**: `boolean` - Enable document file upload functionality. When enabled, users can attach document files to messages. The container-level drag-and-drop overlay is also activated. Defaults to `false`.
|
|
318
|
+
- **allowedImageMimeTypes?**: `string[]` - Restrict which image MIME types can be uploaded when `enableUpload` is on. When provided, it **overrides** the default image list entirely (values are used as-is for both the file picker `accept` and validation, and may include types outside the SDK defaults). When omitted or empty, all default image types are accepted (`image/jpeg`, `image/jpg`, `image/png`, `image/gif`, `image/webp`).
|
|
319
|
+
- **allowedDocumentMimeTypes?**: `string[]` - Restrict which document MIME types can be uploaded when `enableDocumentUpload` is on. When provided, it **overrides** the default document list entirely and validation switches to MIME-only matching (the extension-based fallback is dropped). When omitted or empty, the default document list with extension fallback is used.
|
|
298
320
|
- **maintainConnectionWhenClosed?**: `boolean` - Maintain connection when chat is closed, defaults to `false`
|
|
299
321
|
- **keepConnectionOnUnmount?**: `boolean` - Keep the in-flight SSE run alive when the chatbot unmounts (e.g. the user navigates to another in-app page) instead of aborting it, so that round can finish on the backend. The detached connection cleans itself up once the run completes, or after a safety timeout if it never finishes. Only covers in-app unmounts — a full page reload / tab close / network loss still tears the connection down. Defaults to `false`
|
|
300
322
|
- **loadingComponent?**: `ReactNode` - Custom loading component
|
|
@@ -315,7 +337,7 @@ config: {
|
|
|
315
337
|
- **onChannelReady?**: `() => void` - Callback fired once the chat channel is ready to accept messages. Use this instead of polling for `sendMessage` availability when you need to send an initial message right after the chatbot mounts. Re-fires after channel reset. See [On Channel Ready](#on-channel-ready) section for details.
|
|
316
338
|
- **onReset**: `() => void` - Callback function when chat is reset
|
|
317
339
|
- **onClose**: `() => void` - Callback function when chat is closed
|
|
318
|
-
- **authState?**: `AuthState` - Authentication state for dynamic API key management. Available states: `'loading'`, `'needApiKey'`, `'authenticated'`, `'error'`, `'invalidApiKey'`
|
|
340
|
+
- **authState?**: `AuthState` - Authentication state for dynamic API key management. Available states: `'loading'`, `'needApiKey'`, `'authenticated'`, `'error'`, `'invalidApiKey'`, `'subscriptionExpired'`, `'botNotFound'`
|
|
319
341
|
- **onApiKeySubmit?**: `(apiKey: string) => Promise<void>` - Callback function when user submits API key for authentication
|
|
320
342
|
- **onAuthError?**: `(error: { isAuthError: boolean; isBotProviderError: boolean; errorDetail?: unknown }) => void` - Callback fired when authentication or bot provider initialization fails. Useful for logging or showing a custom error UI.
|
|
321
343
|
- **onSseError?**: `(error: unknown) => void` - Callback fired when the SSE connection encounters an error.
|
|
@@ -624,33 +646,41 @@ function MyCustomFooter() {
|
|
|
624
646
|
|
|
625
647
|
**State**
|
|
626
648
|
|
|
627
|
-
| Property
|
|
628
|
-
|
|
|
629
|
-
| `avatar`
|
|
630
|
-
| `title`
|
|
631
|
-
| `
|
|
632
|
-
| `
|
|
633
|
-
| `
|
|
634
|
-
| `
|
|
635
|
-
| `
|
|
636
|
-
| `
|
|
637
|
-
| `
|
|
638
|
-
| `
|
|
639
|
-
| `
|
|
640
|
-
| `
|
|
641
|
-
| `
|
|
649
|
+
| Property | Type | Description |
|
|
650
|
+
| -------------------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
651
|
+
| `avatar` | `string \| undefined` | Avatar URL passed to the Chatbot, or loaded from the bot provider metadata. |
|
|
652
|
+
| `title` | `string \| undefined` | Chatbot title passed to the Chatbot, or loaded from the bot provider metadata. |
|
|
653
|
+
| `client` | `AsgardServiceClient \| null` | The underlying core client instance, or `null` before the channel is initialized. |
|
|
654
|
+
| `customChannelId` | `string \| undefined` | The active channel identifier. |
|
|
655
|
+
| `isOpen` | `boolean` | Whether the chatbot is currently open/visible. |
|
|
656
|
+
| `isResetting` | `boolean` | Whether a channel reset is in progress. Use to disable reset buttons during reset. |
|
|
657
|
+
| `isConnecting` | `boolean` | Whether the SSE channel is currently processing a message. Use to disable the send button. |
|
|
658
|
+
| `messages` | `Map<string, ConversationMessage> \| null` | All messages in the current conversation. `null` before the channel is initialized. |
|
|
659
|
+
| `botTypingPlaceholder` | `string \| undefined` | Typing indicator text (from props or bot provider metadata). |
|
|
660
|
+
| `inputPlaceholder` | `string \| undefined` | Textarea placeholder text (from props or bot provider metadata). |
|
|
661
|
+
| `enableUpload` | `boolean \| undefined` | Whether image upload is enabled (resolved from props / bot provider metadata). |
|
|
662
|
+
| `enableExport` | `boolean \| undefined` | Whether conversation export is enabled. |
|
|
663
|
+
| `enableDocumentUpload` | `boolean \| undefined` | Whether document upload is enabled. |
|
|
664
|
+
| `allowedImageMimeTypes` | `string[] \| undefined` | Resolved image MIME allow-list (from the `allowedImageMimeTypes` prop). `undefined` means all defaults are accepted. |
|
|
665
|
+
| `allowedDocumentMimeTypes` | `string[] \| undefined` | Resolved document MIME allow-list (from the `allowedDocumentMimeTypes` prop). `undefined` means the default list with extension fallback is used. |
|
|
666
|
+
| `pendingConsent` | `ToolCallConsentEventData \| null` | The pending tool-call consent prompt awaiting a user decision, or `null`. Read this to build a custom consent UI. |
|
|
667
|
+
| `messageBoxBottomRef` | `RefObject<HTMLDivElement \| null>` | Ref to the sentinel element at the bottom of the message list. |
|
|
668
|
+
| `scrollContainerRef` | `RefObject<HTMLDivElement \| null>` | Ref to the scrollable message container. |
|
|
669
|
+
| `isFollowingLatest` | `boolean` | Whether auto-scroll to the latest message is active. Becomes `false` when the user scrolls up. |
|
|
670
|
+
| `pendingInputValue` | `string \| null` | Text waiting to be filled into the textarea. Set by `ChatbotRef.setInputValue()` or by `renderMenu`. Read and clear this in `renderFooter` to receive externally pushed text. |
|
|
642
671
|
|
|
643
672
|
**Actions**
|
|
644
673
|
|
|
645
|
-
| Property | Type
|
|
646
|
-
| ---------------------------- |
|
|
647
|
-
| `sendMessage` | `((params: SendMessageParams) => Promise<void>) \| undefined`
|
|
648
|
-
| `resetChannel` | `(() => void) \| undefined`
|
|
649
|
-
| `closeChannel` | `(() => void) \| undefined`
|
|
650
|
-
| `
|
|
651
|
-
| `
|
|
652
|
-
| `
|
|
653
|
-
| `
|
|
674
|
+
| Property | Type | Description |
|
|
675
|
+
| ---------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
676
|
+
| `sendMessage` | `((params: SendMessageParams) => Promise<void>) \| undefined` | Send a message through the channel. `undefined` while the channel is not yet ready or in preview mode — always guard with `?.()`. |
|
|
677
|
+
| `resetChannel` | `(() => void) \| undefined` | Reset the channel (triggers a new welcome message from the bot). |
|
|
678
|
+
| `closeChannel` | `(() => void) \| undefined` | Close the SSE connection without resetting. |
|
|
679
|
+
| `replyToolCallConsents` | `((answers, options?, payload?) => Promise<void>) \| undefined` | Reply to the pending tool-call consent prompt (see `pendingConsent`). Used to build a custom consent UI. `undefined` before the channel is ready. |
|
|
680
|
+
| `scrollToBottom` | `(behavior?: ScrollBehavior) => void` | Scroll the message list to the bottom. Also resumes auto-scroll (`isFollowingLatest → true`). |
|
|
681
|
+
| `programmaticScrollToBottom` | `(behavior?: ScrollBehavior) => void` | Scroll to bottom without affecting `isFollowingLatest`. |
|
|
682
|
+
| `setFollowingLatest` | `(value: boolean) => void` | Manually set auto-scroll state. |
|
|
683
|
+
| `setPendingInputValue` | `(value: string \| null) => void` | Push text into the textarea from outside. Clear it (`null`) after reading in `renderFooter`. |
|
|
654
684
|
|
|
655
685
|
<a id="event-handlers"></a>
|
|
656
686
|
<br/>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-title.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/channel-title/channel-title.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAmClC,wBAAgB,YAAY,IAAI,SAAS,CA0BxC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/channel-title/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot-body.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-body/chatbot-body.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAA4D,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"chatbot-body.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-body/chatbot-body.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAA4D,MAAM,OAAO,CAAC;AA2GtG,wBAAgB,WAAW,IAAI,SAAS,CAgLvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-message-renderer.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-body/conversation-message-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAuB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation-message-renderer.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-body/conversation-message-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwB,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAuB,MAAM,iBAAiB,CAAC;AAsB3E,UAAU,gCAAgC;IACxC,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,GAAG,SAAS,CAyG9F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot-footer.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-footer/chatbot-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EAMV,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"chatbot-footer.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-footer/chatbot-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EAMV,MAAM,OAAO,CAAC;AA6Bf,UAAU,kBAAkB;IAC1B,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;CAChC;AAED,wBAAgB,aAAa,CAAC,EAAE,gBAAgB,EAAE,GAAE,kBAAuB,GAAG,SAAS,CA+6BtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-upload-button.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-footer/document-upload-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"document-upload-button.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-footer/document-upload-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAWtE,UAAU,yBAAyB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAC3C,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,SAAS,CA2DhF"}
|
|
@@ -4,6 +4,8 @@ interface SpeechInputButtonProps {
|
|
|
4
4
|
setValue: Dispatch<SetStateAction<string>>;
|
|
5
5
|
className?: string;
|
|
6
6
|
style?: CSSProperties;
|
|
7
|
+
/** When true (e.g. a run is streaming or the composer is in preview), voice input can't be started. */
|
|
8
|
+
disabled?: boolean;
|
|
7
9
|
}
|
|
8
10
|
export declare function SpeechInputButton(props: SpeechInputButtonProps): ReactNode;
|
|
9
11
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech-input-button.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-footer/speech-input-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,SAAS,EACT,cAAc,EAMd,aAAa,EACd,MAAM,OAAO,CAAC;AAIf,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"speech-input-button.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-footer/speech-input-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,SAAS,EACT,cAAc,EAMd,aAAa,EACd,MAAM,OAAO,CAAC;AAIf,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,uGAAuG;IACvG,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,SAAS,CAmH1E"}
|
|
@@ -12,15 +12,38 @@ interface ChatbotProps extends AsgardTemplateContextValue {
|
|
|
12
12
|
config: ClientConfig;
|
|
13
13
|
customChannelId: string;
|
|
14
14
|
initMessages?: ConversationMessage[];
|
|
15
|
+
/** Seed for the channel-title store (F-016) — e.g. from `GET /channel/metadata` (wired by F-015). `null` = unnamed. */
|
|
16
|
+
channelTitle?: string | null;
|
|
15
17
|
onSseMessage?: AsgardServiceContextProviderProps['onSseMessage'];
|
|
16
18
|
fullScreen?: boolean;
|
|
17
19
|
avatar?: string;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Since F-003 the run-in-progress cue is a connection-bound indicator at the
|
|
22
|
+
* thread↔input seam (see `RunningIndicator`), not a per-message typing placeholder. This prop no
|
|
23
|
+
* longer renders anything and will be removed in a future major.
|
|
24
|
+
*/
|
|
18
25
|
botTypingPlaceholder?: string;
|
|
19
26
|
inputPlaceholder?: string;
|
|
20
27
|
enableLoadConfigFromService?: boolean;
|
|
21
28
|
enableUpload?: boolean;
|
|
22
29
|
enableExport?: boolean;
|
|
23
30
|
enableDocumentUpload?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Restrict which image MIME types can be uploaded when `enableUpload` is on.
|
|
33
|
+
* When provided, it overrides the default list entirely — the values are used
|
|
34
|
+
* as-is for both the file picker `accept` and validation (you may include
|
|
35
|
+
* types outside the SDK's default list). When omitted, all default image
|
|
36
|
+
* types are accepted.
|
|
37
|
+
*/
|
|
38
|
+
allowedImageMimeTypes?: string[];
|
|
39
|
+
/**
|
|
40
|
+
* Restrict which document MIME types can be uploaded when
|
|
41
|
+
* `enableDocumentUpload` is on. When provided, it overrides the default list
|
|
42
|
+
* entirely — the values are used as-is for both the file picker `accept` and
|
|
43
|
+
* validation (you may include types outside the SDK's default list). When
|
|
44
|
+
* omitted, all default document types are accepted.
|
|
45
|
+
*/
|
|
46
|
+
allowedDocumentMimeTypes?: string[];
|
|
24
47
|
maintainConnectionWhenClosed?: boolean;
|
|
25
48
|
asyncInitializers?: Record<string, () => Promise<unknown>>;
|
|
26
49
|
onReset?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.d.ts","sourceRoot":"","sources":["../../../src/components/chatbot/chatbot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EACT,aAAa,EAId,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAA8B,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AACzG,OAAO,EAEL,yBAAyB,EAEz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S,CAAC;IAE7B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAE/B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,YAAY,CAAC,EAAE,MAAM,SAAS,CAAC;IAE/B,sFAAsF;IACtF,mBAAmB,CAAC,EAAE,0BAA0B,CAAC,qBAAqB,CAAC,CAAC;IAExE,uMAAuM;IACvM,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;;;;OASG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC,sHAAsH;IACtH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAC3C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,OAAO,qGA4SlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/running-indicator/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface RunningIndicatorProps {
|
|
4
|
+
running: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function RunningIndicator({ running }: RunningIndicatorProps): ReactNode;
|
|
7
|
+
export default RunningIndicator;
|
|
8
|
+
//# sourceMappingURL=running-indicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"running-indicator.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/running-indicator/running-indicator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQlC,UAAU,qBAAqB;IAC7B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE,qBAAqB,GAAG,SAAS,CAa9E;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/subagent-list/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Locale } from '../../../i18n';
|
|
2
|
+
import { Subagent } from '@asgard-js/core';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
export declare function SubagentList({ subagents, locale }: {
|
|
6
|
+
subagents: Subagent[];
|
|
7
|
+
locale?: Locale;
|
|
8
|
+
}): ReactNode;
|
|
9
|
+
export default SubagentList;
|
|
10
|
+
//# sourceMappingURL=subagent-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagent-list.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/subagent-list/subagent-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAoC,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAK,MAAM,eAAe,CAAC;AA+K1C,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,MAAgB,EAAE,EAAE;IAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAoCnH;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/task-list/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Locale } from '../../../i18n';
|
|
2
|
+
import { Task } from '@asgard-js/core';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
export declare function TaskList({ tasks, locale }: {
|
|
6
|
+
tasks: Task[];
|
|
7
|
+
locale?: Locale;
|
|
8
|
+
}): ReactNode;
|
|
9
|
+
export default TaskList;
|
|
10
|
+
//# sourceMappingURL=task-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-list.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/task-list/task-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAc,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAK,MAAM,eAAe,CAAC;AAqI1C,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAgB,EAAE,EAAE;IAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAiCnG;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -10,6 +10,7 @@ export * from './audio-template';
|
|
|
10
10
|
export * from './location-template';
|
|
11
11
|
export * from './user-image-template';
|
|
12
12
|
export * from './tool-call-group';
|
|
13
|
+
export * from './thinking-block';
|
|
13
14
|
export * from './table-template';
|
|
14
15
|
export * from './attachment-template';
|
|
15
16
|
export * from './quick-replies';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-typing-box.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/text-template/bot-typing-box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAW,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"bot-typing-box.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/text-template/bot-typing-box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAW,MAAM,OAAO,CAAC;AAS1D,UAAU,iBAAiB;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAKD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CA4BhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/text-template/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/text-template/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/thinking-block/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ConversationThinkingMessage } from '@asgard-js/core';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface ThinkingBlockProps {
|
|
5
|
+
message: ConversationThinkingMessage;
|
|
6
|
+
}
|
|
7
|
+
export declare function ThinkingBlock({ message }: ThinkingBlockProps): ReactNode;
|
|
8
|
+
//# sourceMappingURL=thinking-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinking-block.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/thinking-block/thinking-block.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAiG9D,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,2BAA2B,CAAC;CACtC;AAED,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,GAAG,SAAS,CAsDxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/tool-call-group/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/tool-call-group/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-call-group-template.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/tool-call-group/tool-call-group-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-call-group-template.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/tool-call-group/tool-call-group-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAiB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEtE,UAAU,0BAA2B,SAAQ,kBAAkB;IAC7D,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAKD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,GAAG,SAAS,CAUlF"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Locale } from '../../../i18n';
|
|
2
|
+
import { ToolCallVariant, ToolCallDiff } from './tool-call-label';
|
|
1
3
|
import { ReactNode } from 'react';
|
|
2
4
|
|
|
3
5
|
export declare function CloseIcon({ className }: {
|
|
@@ -8,14 +10,31 @@ export interface ToolCallItemData {
|
|
|
8
10
|
id: string;
|
|
9
11
|
label: string;
|
|
10
12
|
status: ToolCallStatus;
|
|
13
|
+
/** Left identity icon (F-004): native built-ins get their own icon; others get `generic`. */
|
|
14
|
+
variant: ToolCallVariant;
|
|
15
|
+
/** Right-side `+/-` line diff for Write / Edit (F-007); `null` for tools without a diff. */
|
|
16
|
+
diff?: ToolCallDiff | null;
|
|
11
17
|
initial?: Record<string, unknown>;
|
|
12
18
|
result?: Record<string, unknown>;
|
|
13
19
|
}
|
|
14
20
|
export interface ToolCallGroupProps {
|
|
15
21
|
title?: string;
|
|
16
22
|
items: ToolCallItemData[];
|
|
23
|
+
/**
|
|
24
|
+
* Pins the initial expand state and opts out of auto-collapse. When omitted, the group stays expanded
|
|
25
|
+
* while it is the live tail of the thread and auto-collapses to its summary once the assistant moves
|
|
26
|
+
* on — i.e. once `sealed` (mirrors the thinking block / SubagentList). A user click always takes over.
|
|
27
|
+
*/
|
|
17
28
|
defaultExpanded?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* True once later content (another group or a message) follows this group — the assistant has moved
|
|
31
|
+
* past it, so the finished group may fold. While it is still the tail (`sealed === false`) it stays
|
|
32
|
+
* open, so it never flickers shut between streamed tools. Ignored when `defaultExpanded` is set.
|
|
33
|
+
*/
|
|
34
|
+
sealed?: boolean;
|
|
18
35
|
className?: string;
|
|
36
|
+
/** Language for the expanded `Initial` / `Result` titles (F-008). Defaults to `en-US`. */
|
|
37
|
+
locale?: Locale;
|
|
19
38
|
}
|
|
20
39
|
export declare function SyntaxHighlightedJson({ json }: {
|
|
21
40
|
json: string;
|
|
@@ -32,5 +51,5 @@ export interface JsonViewerProps {
|
|
|
32
51
|
data: Record<string, unknown>;
|
|
33
52
|
}
|
|
34
53
|
export declare function JsonViewer({ title, data }: JsonViewerProps): ReactNode;
|
|
35
|
-
export declare function ToolCallGroup({ title, items, defaultExpanded, className, }: ToolCallGroupProps): ReactNode;
|
|
54
|
+
export declare function ToolCallGroup({ title, items, defaultExpanded, sealed, className, locale, }: ToolCallGroupProps): ReactNode;
|
|
36
55
|
//# sourceMappingURL=tool-call-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-call-group.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/tool-call-group/tool-call-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-call-group.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/tool-call-group/tool-call-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoC,MAAM,OAAO,CAAC;AAGpE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAK,MAAM,eAAe,CAAC;AAgE1C,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAM1E;AA+GD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,CAAC;IACvB,6FAA6F;IAC7F,OAAO,EAAE,eAAe,CAAC;IACzB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA+ED,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAY3E;AAGD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,cAAc,GAAG,SAAS,CAoErF;AAGD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,eAAe,GAAG,SAAS,CAqCtE;AAiFD,wBAAgB,aAAa,CAAC,EAC5B,KAAkC,EAClC,KAAK,EACL,eAAe,EACf,MAAc,EACd,SAAS,EACT,MAAgB,GACjB,EAAE,kBAAkB,GAAG,SAAS,CAoChC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Locale } from '../../../i18n';
|
|
2
|
+
import { ConversationToolCallMessage } from '@asgard-js/core';
|
|
3
|
+
|
|
4
|
+
export type ToolCallVariant = 'bash' | 'read' | 'write' | 'edit' | 'skill' | 'webfetch' | 'websearch' | 'generic';
|
|
5
|
+
type ToolCallInput = Pick<ConversationToolCallMessage, 'toolsetName' | 'toolName' | 'reason' | 'parameter'>;
|
|
6
|
+
/** The left identity icon key. native → its own variant; everything else → `generic`. */
|
|
7
|
+
export declare function getToolCallVariant(call: ToolCallInput): ToolCallVariant;
|
|
8
|
+
/**
|
|
9
|
+
* Single tool-call display label (pinned spec §1 priority):
|
|
10
|
+
* 1. `reason !== ""` → use `reason` (general tools + Asgard-platform built-ins)
|
|
11
|
+
* 2. `reason === ""` and native seven → synthesize (§3), localized via `t(locale, …)`
|
|
12
|
+
* 3. otherwise → `toolName` fallback
|
|
13
|
+
*/
|
|
14
|
+
export declare function synthesizeToolCallLabel(call: ToolCallInput, locale: Locale): string;
|
|
15
|
+
/**
|
|
16
|
+
* Localized group summary (pinned spec §5): `{n} steps · Used {s} skills · Processed {f} files`.
|
|
17
|
+
* `n` = calls in the group; `s` = native Skill calls; `f` = native Read + Write + Edit calls.
|
|
18
|
+
* The `skills` / `files` segments are omitted when their count is 0.
|
|
19
|
+
*/
|
|
20
|
+
export declare function groupSummary(calls: ToolCallInput[], locale: Locale): string;
|
|
21
|
+
export interface ToolCallDiff {
|
|
22
|
+
added: number;
|
|
23
|
+
removed: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Right-side `+/-` line diff for native Write / Edit (pinned spec §6):
|
|
27
|
+
* Write (create/override) → `+{content line count}`, no removals; Edit → a line-level LCS estimate over
|
|
28
|
+
* `old_string` ↔ `new_string`. Every other tool → `null` (no diff).
|
|
29
|
+
*/
|
|
30
|
+
export declare function toolDiff(call: ToolCallInput): ToolCallDiff | null;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=tool-call-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-call-label.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/tool-call-group/tool-call-label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAK,MAAM,eAAe,CAAC;AAU1C,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;AAYlH,KAAK,aAAa,GAAG,IAAI,CAAC,2BAA2B,EAAE,aAAa,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC,CAAC;AAQ5G,yFAAyF;AACzF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,eAAe,CAEvE;AAYD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CA0BnF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAc3E;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAuBD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,YAAY,GAAG,IAAI,CAcjE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseChannelProps, UseChannelReturn } from '../hooks';
|
|
2
2
|
import { ForwardedRef, ReactNode, RefObject } from 'react';
|
|
3
|
-
import { AsgardServiceClient, ClientConfig, ConversationMessage, ToolCallConsentEventData } from '@asgard-js/core';
|
|
3
|
+
import { AsgardServiceClient, ClientConfig, Conversation, ConversationMessage, ToolCallConsentEventData } from '@asgard-js/core';
|
|
4
4
|
|
|
5
5
|
/** Parameters for sending a message */
|
|
6
6
|
export interface SendMessageParams {
|
|
@@ -19,6 +19,10 @@ export interface AsgardServiceContextValue {
|
|
|
19
19
|
isResetting: boolean;
|
|
20
20
|
isConnecting: boolean;
|
|
21
21
|
messages: Map<string, ConversationMessage> | null;
|
|
22
|
+
/** The current Conversation (F-013) — the derivation source for the docked Task / Subagent panels. */
|
|
23
|
+
conversation: Conversation | null;
|
|
24
|
+
/** The current channel title (F-016) — seeded from metadata + updated by `title.update`. `null` = unnamed. */
|
|
25
|
+
channelTitle: string | null;
|
|
22
26
|
messageBoxBottomRef: RefObject<HTMLDivElement | null>;
|
|
23
27
|
sendMessage?: UseChannelReturn['sendMessage'];
|
|
24
28
|
resetChannel?: UseChannelReturn['resetChannel'];
|
|
@@ -30,6 +34,8 @@ export interface AsgardServiceContextValue {
|
|
|
30
34
|
enableUpload?: boolean;
|
|
31
35
|
enableExport?: boolean;
|
|
32
36
|
enableDocumentUpload?: boolean;
|
|
37
|
+
allowedImageMimeTypes?: string[];
|
|
38
|
+
allowedDocumentMimeTypes?: string[];
|
|
33
39
|
/** 用戶是否正在跟隨最新內容(用於自動滾動判斷) */
|
|
34
40
|
isFollowingLatest: boolean;
|
|
35
41
|
/** 設定跟隨狀態 */
|
|
@@ -59,10 +65,14 @@ export interface AsgardServiceContextProviderProps {
|
|
|
59
65
|
enableUpload?: boolean;
|
|
60
66
|
enableExport?: boolean;
|
|
61
67
|
enableDocumentUpload?: boolean;
|
|
68
|
+
allowedImageMimeTypes?: string[];
|
|
69
|
+
allowedDocumentMimeTypes?: string[];
|
|
62
70
|
customChannelId: string;
|
|
63
71
|
customMessageId?: string;
|
|
64
72
|
delayTime?: number;
|
|
65
73
|
initMessages?: ConversationMessage[];
|
|
74
|
+
/** Seed for the channel title store (F-016) — e.g. from `GET /channel/metadata` (wired by F-015). */
|
|
75
|
+
channelTitle?: string | null;
|
|
66
76
|
onSseMessage?: UseChannelProps['onSseMessage'];
|
|
67
77
|
onAuthError?: (error: {
|
|
68
78
|
isAuthError: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asgard-service-context.d.ts","sourceRoot":"","sources":["../../src/context/asgard-service-context.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"asgard-service-context.d.ts","sourceRoot":"","sources":["../../src/context/asgard-service-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,YAAY,EACZ,SAAS,EACT,SAAS,EAOV,MAAM,OAAO,CAAC;AACf,OAAO,EAAsC,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjG,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,M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