@dudousxd/nestjs-agent-react 0.18.0 → 0.19.0
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 +28 -24
- package/dist/generative-ui-BhXFni8j.d.ts +167 -0
- package/dist/generative-ui-C53b3FoA.d.cts +167 -0
- package/dist/genui-json-render.cjs +521 -4
- package/dist/genui-json-render.cjs.map +1 -1
- package/dist/genui-json-render.d.cts +15 -2
- package/dist/genui-json-render.d.ts +15 -2
- package/dist/genui-json-render.js +518 -2
- package/dist/genui-json-render.js.map +1 -1
- package/dist/genui.cjs +120 -23
- package/dist/genui.cjs.map +1 -1
- package/dist/genui.d.cts +5 -52
- package/dist/genui.d.ts +5 -52
- package/dist/genui.js +106 -11
- package/dist/genui.js.map +1 -1
- package/dist/index.cjs +201 -174
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -7
- package/dist/index.d.ts +24 -7
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -4
- package/dist/types-DFD-soWU.d.cts +0 -86
- package/dist/types-DFD-soWU.d.ts +0 -86
package/dist/index.d.cts
CHANGED
|
@@ -3,8 +3,8 @@ import { ChatTransport, UIMessage, UIMessageChunk, DataUIPart, UIDataTypes } fro
|
|
|
3
3
|
import * as _dudousxd_nestjs_agent_core from '@dudousxd/nestjs-agent-core';
|
|
4
4
|
import { ThreadSummary, ThreadDetail, MessageAttachment, ToolCatalogEntry, SkillCatalogEntry, QuotaView, QuotaReport, ModelCatalogView, AgentCatalogEntry, MessageFeedbackValue, MessageFeedback, ModelCatalogEntry, QuotaWindow, QuotaBlock, StoredMessage } from '@dudousxd/nestjs-agent-core';
|
|
5
5
|
export { ElicitationInput, ElicitationInputType, validateElicitationAnswer as validateAnswer, validateElicitationValue as validateAnswerValue } from '@dudousxd/nestjs-agent-core';
|
|
6
|
-
import React__default from 'react';
|
|
7
|
-
import { a as TranscriptBlock, U as UsageSummary, b as TimestampInfo, C as ChatStatus, M as MessageUsageInfo, c as ToolCatalog, A as ApproveOptions, d as AnyToolUIPart, e as TranscriptFile
|
|
6
|
+
import React__default, { ReactNode, Context } from 'react';
|
|
7
|
+
import { T as TranscriptUiBlock, a as TranscriptBlock, U as UsageSummary, b as TimestampInfo, C as ChatStatus, M as MessageUsageInfo, c as ToolCatalog, A as ApproveOptions, d as AnyToolUIPart, e as TranscriptFile } from './model-gHqjNjLJ.cjs';
|
|
8
8
|
export { f as ApprovalBlockOptions, B as BuildBlocksOptions, g as CoercibleQuestion, D as DescribeToolCallOptions, E as ElicitationBlockOptions, G as GroupToolActivityOptions, R as RawAnswer, h as ResolvedReading, i as ResolvedResultView, j as RetrievedPassage, S as SettleAction, k as ToolActivityGroup, l as ToolCallDescription, m as ToolCallState, n as ToolCallStatus, o as TranscriptApproval, p as TranscriptApprovalStatus, q as TranscriptElicitationBlock, r as TranscriptElicitationOutcome, s as TranscriptFilesBlock, t as TranscriptQuestion, u as TranscriptQuestionOption, v as TranscriptReasoningBlock, w as TranscriptSettleState, x as TranscriptSource, y as TranscriptSourcesBlock, z as TranscriptTextBlock, F as TranscriptToolBlock, H as TranscriptToolCall, I as buildTranscriptBlocks, J as coerceAnswer, K as correctedCallIds, L as describeTimestamp, N as describeToolCall, O as describeUsage, P as extractMessageText, Q as fillTemplate, V as formatRelativeTime, W as groupToolActivity, X as inferResultView, Y as isActionCall, Z as phraseFor, _ as readPath, $ as resolveResultView, a0 as toolCallState, a1 as toolCatalogFrom } from './model-gHqjNjLJ.cjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -753,6 +753,20 @@ declare class AgentClient implements AgentBackend {
|
|
|
753
753
|
private handleResponse;
|
|
754
754
|
}
|
|
755
755
|
|
|
756
|
+
/** Draws a server-pushed component block. */
|
|
757
|
+
type AmbientRenderUi = (block: TranscriptUiBlock) => ReactNode;
|
|
758
|
+
/**
|
|
759
|
+
* How pushed components are drawn when no `renderUi` is passed — set by `<GenuiProvider>` (the
|
|
760
|
+
* `/genui` subpath) and read by `MessageItem`.
|
|
761
|
+
*/
|
|
762
|
+
declare const AmbientRenderUiContext: Context<AmbientRenderUi | null>;
|
|
763
|
+
/**
|
|
764
|
+
* The renderer `<GenuiProvider>` installed for pushed components, or `null` outside one. For a
|
|
765
|
+
* custom transcript built on `useTranscriptItem`: draw a `ui` block with it and you get what
|
|
766
|
+
* `MessageItem` draws.
|
|
767
|
+
*/
|
|
768
|
+
declare function useAmbientRenderUi(): AmbientRenderUi | null;
|
|
769
|
+
|
|
756
770
|
interface ChatInputProps {
|
|
757
771
|
onSubmit: (text: string) => void;
|
|
758
772
|
disabled?: boolean;
|
|
@@ -991,8 +1005,8 @@ type RenderTextFn = (text: string, ctx: {
|
|
|
991
1005
|
type RenderFilesFn = (files: TranscriptFile[]) => React__default.ReactNode;
|
|
992
1006
|
/**
|
|
993
1007
|
* Render a component the server pushed into the message — look `block.component` up in your own
|
|
994
|
-
* registry. Omitted →
|
|
995
|
-
* own component).
|
|
1008
|
+
* registry. Omitted → drawn by the enclosing `<GenuiProvider>` (`/genui`) if there is one, else not
|
|
1009
|
+
* drawn (there is no sensible default for an app's own component).
|
|
996
1010
|
*/
|
|
997
1011
|
type RenderUiFn = (block: TranscriptUiBlock) => React__default.ReactNode;
|
|
998
1012
|
/** Render the body of a reasoning run; the disclosure toggle around it stays this component's. */
|
|
@@ -1027,7 +1041,10 @@ interface MessageRenderSlots {
|
|
|
1027
1041
|
renderReasoning?: RenderReasoningFn;
|
|
1028
1042
|
/** Draw files yourself — a gallery, a viewer. Omitted → images inline, everything else a link. */
|
|
1029
1043
|
renderFiles?: RenderFilesFn;
|
|
1030
|
-
/**
|
|
1044
|
+
/**
|
|
1045
|
+
* Draw a server-pushed component (a `ui` stream frame). Omitted → the enclosing `<GenuiProvider>`
|
|
1046
|
+
* draws it; without one, not drawn.
|
|
1047
|
+
*/
|
|
1031
1048
|
renderUi?: RenderUiFn;
|
|
1032
1049
|
/**
|
|
1033
1050
|
* Extra content for the action row, after the built-in affordances and before usage — a badge
|
|
@@ -1070,7 +1087,7 @@ interface MessageItemViewProps extends MessageRenderSlots {
|
|
|
1070
1087
|
*/
|
|
1071
1088
|
declare function MessageItem({ message, isStreaming, editable, onEditSubmit, regeneratable, onRegenerate, onFork, usage, createdAt, ...slots }: MessageItemProps): React__default.JSX.Element;
|
|
1072
1089
|
/** The default markup for one modelled message — what `MessageItem` renders once it has an item. */
|
|
1073
|
-
declare function MessageItemView({ item, ...
|
|
1090
|
+
declare function MessageItemView({ item, ...given }: MessageItemViewProps): React__default.JSX.Element;
|
|
1074
1091
|
|
|
1075
1092
|
interface MessageListClassNames {
|
|
1076
1093
|
root?: string;
|
|
@@ -1740,4 +1757,4 @@ declare class QuotaBlockedError extends Error {
|
|
|
1740
1757
|
constructor(block: QuotaBlock);
|
|
1741
1758
|
}
|
|
1742
1759
|
|
|
1743
|
-
export { type AgentBackend, AgentBackendUnsupportedError, AgentChatTransport, type AgentChatTransportOptions, AgentClient, type AgentClientOptions, AgentHttpError, type AgentMessageMetadata, type AgentStreamMeta, type AgentsState, type AggregatedTurnUsage, AnyToolUIPart, type ApprovalCountdown, ApproveOptions, type AttachmentRejection, type AttachmentsState, type AutocompleteInputProps, type AutocompleteItem, type AutocompleteListboxProps, type AutocompleteOptionProps, type AutocompleteSource, type BackgroundRun, type CancelResult, type ChatBackground, ChatInput, type ChatInputProps, ChatStatus, type ChatStreamRequest, type ChatStreamResponse, type ChatTranscript, type ClipboardLikeEvent, type CompletionEdit, type ComposerAutocomplete, DEFAULT_SPEECH_LANG, type DragLikeEvent, type MessageFeedbackInput, type MessageFeedbackState, type MessageFile, type MessageFileKind, MessageItem, type MessageItemClassNames, type MessageItemProps, MessageItemView, type MessageItemViewProps, MessageList, type MessageListClassNames, type MessageListProps, MessageUsageInfo, type ModelOption, type ModelsState, QuotaBlockedError, type QuotaState, type QuotaToday, type ReconnectOptions, type RenderFilesFn, type RenderReasoningFn, type RenderTextFn, type RenderToolGroupFn, type RenderToolPartFn, type RenderUiFn, type ResumeStreamRequest, SPEECH_LANGUAGES, type SkillSuggestionData, type SkillsSourceOptions, type SpeechLanguage, type SpeechRecognitionHook, type StagedAttachment, type StagedAttachmentStatus, type StickToBottom, type StickToBottomOptions, type StoredTurnMetadata, type StreamConnectionState, type ThreadPatch, type ThreadsEvent, type ThreadsState, TimestampInfo, ToolCatalog, type ToolCatalogState, type TranscriptActionState, TranscriptBlock, type TranscriptCopyState, type TranscriptEditState, TranscriptFile, type TranscriptItem, type TranscriptItemOptions, type TranscriptStopState, TranscriptUiBlock, type TranscriptWindow, type TriggerMatch, type TriggerPosition, type UploadAttachmentOptions, UsageSummary, type UseAgentChatOptions, type UseAgentsOptions, type UseApprovalCountdownOptions, type UseAttachmentsOptions, type UseChatTranscriptOptions, type UseComposerAutocompleteOptions, type UseElapsedOptions, type UseMessageFeedbackOptions, type UseModelsOptions, type UseQuotaOptions, type UseSpeechRecognitionOptions, type UseThreadsOptions, type UseToolCatalogOptions, type UseTranscriptItemOptions, acceptsFile, applyCompletion, approvalCountdown, backgroundRunsFromThread, createSkillsSource, dragHasFiles, fileKind, filesFromClipboard, filterAutocompleteItems, findActiveTrigger, formatElapsed, loadStoredSpeechLang, messageFiles, notifyThreads, onThreadsEvent, persistSpeechLang, readReasoningMs, requireBackendMethod, storedMessageToUiMessage, storedThreadToUiMessages, useAgentChat, useAgents, useApprovalCountdown, useAttachments, useChatTranscript, useComposerAutocomplete, useElapsed, useMessageFeedback, useModels, useQuota, useSpeechRecognition, useStickToBottom, useThreads, useToolCatalog, useTranscriptItem };
|
|
1760
|
+
export { type AgentBackend, AgentBackendUnsupportedError, AgentChatTransport, type AgentChatTransportOptions, AgentClient, type AgentClientOptions, AgentHttpError, type AgentMessageMetadata, type AgentStreamMeta, type AgentsState, type AggregatedTurnUsage, type AmbientRenderUi, AmbientRenderUiContext, AnyToolUIPart, type ApprovalCountdown, ApproveOptions, type AttachmentRejection, type AttachmentsState, type AutocompleteInputProps, type AutocompleteItem, type AutocompleteListboxProps, type AutocompleteOptionProps, type AutocompleteSource, type BackgroundRun, type CancelResult, type ChatBackground, ChatInput, type ChatInputProps, ChatStatus, type ChatStreamRequest, type ChatStreamResponse, type ChatTranscript, type ClipboardLikeEvent, type CompletionEdit, type ComposerAutocomplete, DEFAULT_SPEECH_LANG, type DragLikeEvent, type MessageFeedbackInput, type MessageFeedbackState, type MessageFile, type MessageFileKind, MessageItem, type MessageItemClassNames, type MessageItemProps, MessageItemView, type MessageItemViewProps, MessageList, type MessageListClassNames, type MessageListProps, MessageUsageInfo, type ModelOption, type ModelsState, QuotaBlockedError, type QuotaState, type QuotaToday, type ReconnectOptions, type RenderFilesFn, type RenderReasoningFn, type RenderTextFn, type RenderToolGroupFn, type RenderToolPartFn, type RenderUiFn, type ResumeStreamRequest, SPEECH_LANGUAGES, type SkillSuggestionData, type SkillsSourceOptions, type SpeechLanguage, type SpeechRecognitionHook, type StagedAttachment, type StagedAttachmentStatus, type StickToBottom, type StickToBottomOptions, type StoredTurnMetadata, type StreamConnectionState, type ThreadPatch, type ThreadsEvent, type ThreadsState, TimestampInfo, ToolCatalog, type ToolCatalogState, type TranscriptActionState, TranscriptBlock, type TranscriptCopyState, type TranscriptEditState, TranscriptFile, type TranscriptItem, type TranscriptItemOptions, type TranscriptStopState, TranscriptUiBlock, type TranscriptWindow, type TriggerMatch, type TriggerPosition, type UploadAttachmentOptions, UsageSummary, type UseAgentChatOptions, type UseAgentsOptions, type UseApprovalCountdownOptions, type UseAttachmentsOptions, type UseChatTranscriptOptions, type UseComposerAutocompleteOptions, type UseElapsedOptions, type UseMessageFeedbackOptions, type UseModelsOptions, type UseQuotaOptions, type UseSpeechRecognitionOptions, type UseThreadsOptions, type UseToolCatalogOptions, type UseTranscriptItemOptions, acceptsFile, applyCompletion, approvalCountdown, backgroundRunsFromThread, createSkillsSource, dragHasFiles, fileKind, filesFromClipboard, filterAutocompleteItems, findActiveTrigger, formatElapsed, loadStoredSpeechLang, messageFiles, notifyThreads, onThreadsEvent, persistSpeechLang, readReasoningMs, requireBackendMethod, storedMessageToUiMessage, storedThreadToUiMessages, useAgentChat, useAgents, useAmbientRenderUi, useApprovalCountdown, useAttachments, useChatTranscript, useComposerAutocomplete, useElapsed, useMessageFeedback, useModels, useQuota, useSpeechRecognition, useStickToBottom, useThreads, useToolCatalog, useTranscriptItem };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { ChatTransport, UIMessage, UIMessageChunk, DataUIPart, UIDataTypes } fro
|
|
|
3
3
|
import * as _dudousxd_nestjs_agent_core from '@dudousxd/nestjs-agent-core';
|
|
4
4
|
import { ThreadSummary, ThreadDetail, MessageAttachment, ToolCatalogEntry, SkillCatalogEntry, QuotaView, QuotaReport, ModelCatalogView, AgentCatalogEntry, MessageFeedbackValue, MessageFeedback, ModelCatalogEntry, QuotaWindow, QuotaBlock, StoredMessage } from '@dudousxd/nestjs-agent-core';
|
|
5
5
|
export { ElicitationInput, ElicitationInputType, validateElicitationAnswer as validateAnswer, validateElicitationValue as validateAnswerValue } from '@dudousxd/nestjs-agent-core';
|
|
6
|
-
import React__default from 'react';
|
|
7
|
-
import { a as TranscriptBlock, U as UsageSummary, b as TimestampInfo, C as ChatStatus, M as MessageUsageInfo, c as ToolCatalog, A as ApproveOptions, d as AnyToolUIPart, e as TranscriptFile
|
|
6
|
+
import React__default, { ReactNode, Context } from 'react';
|
|
7
|
+
import { T as TranscriptUiBlock, a as TranscriptBlock, U as UsageSummary, b as TimestampInfo, C as ChatStatus, M as MessageUsageInfo, c as ToolCatalog, A as ApproveOptions, d as AnyToolUIPart, e as TranscriptFile } from './model-gHqjNjLJ.js';
|
|
8
8
|
export { f as ApprovalBlockOptions, B as BuildBlocksOptions, g as CoercibleQuestion, D as DescribeToolCallOptions, E as ElicitationBlockOptions, G as GroupToolActivityOptions, R as RawAnswer, h as ResolvedReading, i as ResolvedResultView, j as RetrievedPassage, S as SettleAction, k as ToolActivityGroup, l as ToolCallDescription, m as ToolCallState, n as ToolCallStatus, o as TranscriptApproval, p as TranscriptApprovalStatus, q as TranscriptElicitationBlock, r as TranscriptElicitationOutcome, s as TranscriptFilesBlock, t as TranscriptQuestion, u as TranscriptQuestionOption, v as TranscriptReasoningBlock, w as TranscriptSettleState, x as TranscriptSource, y as TranscriptSourcesBlock, z as TranscriptTextBlock, F as TranscriptToolBlock, H as TranscriptToolCall, I as buildTranscriptBlocks, J as coerceAnswer, K as correctedCallIds, L as describeTimestamp, N as describeToolCall, O as describeUsage, P as extractMessageText, Q as fillTemplate, V as formatRelativeTime, W as groupToolActivity, X as inferResultView, Y as isActionCall, Z as phraseFor, _ as readPath, $ as resolveResultView, a0 as toolCallState, a1 as toolCatalogFrom } from './model-gHqjNjLJ.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -753,6 +753,20 @@ declare class AgentClient implements AgentBackend {
|
|
|
753
753
|
private handleResponse;
|
|
754
754
|
}
|
|
755
755
|
|
|
756
|
+
/** Draws a server-pushed component block. */
|
|
757
|
+
type AmbientRenderUi = (block: TranscriptUiBlock) => ReactNode;
|
|
758
|
+
/**
|
|
759
|
+
* How pushed components are drawn when no `renderUi` is passed — set by `<GenuiProvider>` (the
|
|
760
|
+
* `/genui` subpath) and read by `MessageItem`.
|
|
761
|
+
*/
|
|
762
|
+
declare const AmbientRenderUiContext: Context<AmbientRenderUi | null>;
|
|
763
|
+
/**
|
|
764
|
+
* The renderer `<GenuiProvider>` installed for pushed components, or `null` outside one. For a
|
|
765
|
+
* custom transcript built on `useTranscriptItem`: draw a `ui` block with it and you get what
|
|
766
|
+
* `MessageItem` draws.
|
|
767
|
+
*/
|
|
768
|
+
declare function useAmbientRenderUi(): AmbientRenderUi | null;
|
|
769
|
+
|
|
756
770
|
interface ChatInputProps {
|
|
757
771
|
onSubmit: (text: string) => void;
|
|
758
772
|
disabled?: boolean;
|
|
@@ -991,8 +1005,8 @@ type RenderTextFn = (text: string, ctx: {
|
|
|
991
1005
|
type RenderFilesFn = (files: TranscriptFile[]) => React__default.ReactNode;
|
|
992
1006
|
/**
|
|
993
1007
|
* Render a component the server pushed into the message — look `block.component` up in your own
|
|
994
|
-
* registry. Omitted →
|
|
995
|
-
* own component).
|
|
1008
|
+
* registry. Omitted → drawn by the enclosing `<GenuiProvider>` (`/genui`) if there is one, else not
|
|
1009
|
+
* drawn (there is no sensible default for an app's own component).
|
|
996
1010
|
*/
|
|
997
1011
|
type RenderUiFn = (block: TranscriptUiBlock) => React__default.ReactNode;
|
|
998
1012
|
/** Render the body of a reasoning run; the disclosure toggle around it stays this component's. */
|
|
@@ -1027,7 +1041,10 @@ interface MessageRenderSlots {
|
|
|
1027
1041
|
renderReasoning?: RenderReasoningFn;
|
|
1028
1042
|
/** Draw files yourself — a gallery, a viewer. Omitted → images inline, everything else a link. */
|
|
1029
1043
|
renderFiles?: RenderFilesFn;
|
|
1030
|
-
/**
|
|
1044
|
+
/**
|
|
1045
|
+
* Draw a server-pushed component (a `ui` stream frame). Omitted → the enclosing `<GenuiProvider>`
|
|
1046
|
+
* draws it; without one, not drawn.
|
|
1047
|
+
*/
|
|
1031
1048
|
renderUi?: RenderUiFn;
|
|
1032
1049
|
/**
|
|
1033
1050
|
* Extra content for the action row, after the built-in affordances and before usage — a badge
|
|
@@ -1070,7 +1087,7 @@ interface MessageItemViewProps extends MessageRenderSlots {
|
|
|
1070
1087
|
*/
|
|
1071
1088
|
declare function MessageItem({ message, isStreaming, editable, onEditSubmit, regeneratable, onRegenerate, onFork, usage, createdAt, ...slots }: MessageItemProps): React__default.JSX.Element;
|
|
1072
1089
|
/** The default markup for one modelled message — what `MessageItem` renders once it has an item. */
|
|
1073
|
-
declare function MessageItemView({ item, ...
|
|
1090
|
+
declare function MessageItemView({ item, ...given }: MessageItemViewProps): React__default.JSX.Element;
|
|
1074
1091
|
|
|
1075
1092
|
interface MessageListClassNames {
|
|
1076
1093
|
root?: string;
|
|
@@ -1740,4 +1757,4 @@ declare class QuotaBlockedError extends Error {
|
|
|
1740
1757
|
constructor(block: QuotaBlock);
|
|
1741
1758
|
}
|
|
1742
1759
|
|
|
1743
|
-
export { type AgentBackend, AgentBackendUnsupportedError, AgentChatTransport, type AgentChatTransportOptions, AgentClient, type AgentClientOptions, AgentHttpError, type AgentMessageMetadata, type AgentStreamMeta, type AgentsState, type AggregatedTurnUsage, AnyToolUIPart, type ApprovalCountdown, ApproveOptions, type AttachmentRejection, type AttachmentsState, type AutocompleteInputProps, type AutocompleteItem, type AutocompleteListboxProps, type AutocompleteOptionProps, type AutocompleteSource, type BackgroundRun, type CancelResult, type ChatBackground, ChatInput, type ChatInputProps, ChatStatus, type ChatStreamRequest, type ChatStreamResponse, type ChatTranscript, type ClipboardLikeEvent, type CompletionEdit, type ComposerAutocomplete, DEFAULT_SPEECH_LANG, type DragLikeEvent, type MessageFeedbackInput, type MessageFeedbackState, type MessageFile, type MessageFileKind, MessageItem, type MessageItemClassNames, type MessageItemProps, MessageItemView, type MessageItemViewProps, MessageList, type MessageListClassNames, type MessageListProps, MessageUsageInfo, type ModelOption, type ModelsState, QuotaBlockedError, type QuotaState, type QuotaToday, type ReconnectOptions, type RenderFilesFn, type RenderReasoningFn, type RenderTextFn, type RenderToolGroupFn, type RenderToolPartFn, type RenderUiFn, type ResumeStreamRequest, SPEECH_LANGUAGES, type SkillSuggestionData, type SkillsSourceOptions, type SpeechLanguage, type SpeechRecognitionHook, type StagedAttachment, type StagedAttachmentStatus, type StickToBottom, type StickToBottomOptions, type StoredTurnMetadata, type StreamConnectionState, type ThreadPatch, type ThreadsEvent, type ThreadsState, TimestampInfo, ToolCatalog, type ToolCatalogState, type TranscriptActionState, TranscriptBlock, type TranscriptCopyState, type TranscriptEditState, TranscriptFile, type TranscriptItem, type TranscriptItemOptions, type TranscriptStopState, TranscriptUiBlock, type TranscriptWindow, type TriggerMatch, type TriggerPosition, type UploadAttachmentOptions, UsageSummary, type UseAgentChatOptions, type UseAgentsOptions, type UseApprovalCountdownOptions, type UseAttachmentsOptions, type UseChatTranscriptOptions, type UseComposerAutocompleteOptions, type UseElapsedOptions, type UseMessageFeedbackOptions, type UseModelsOptions, type UseQuotaOptions, type UseSpeechRecognitionOptions, type UseThreadsOptions, type UseToolCatalogOptions, type UseTranscriptItemOptions, acceptsFile, applyCompletion, approvalCountdown, backgroundRunsFromThread, createSkillsSource, dragHasFiles, fileKind, filesFromClipboard, filterAutocompleteItems, findActiveTrigger, formatElapsed, loadStoredSpeechLang, messageFiles, notifyThreads, onThreadsEvent, persistSpeechLang, readReasoningMs, requireBackendMethod, storedMessageToUiMessage, storedThreadToUiMessages, useAgentChat, useAgents, useApprovalCountdown, useAttachments, useChatTranscript, useComposerAutocomplete, useElapsed, useMessageFeedback, useModels, useQuota, useSpeechRecognition, useStickToBottom, useThreads, useToolCatalog, useTranscriptItem };
|
|
1760
|
+
export { type AgentBackend, AgentBackendUnsupportedError, AgentChatTransport, type AgentChatTransportOptions, AgentClient, type AgentClientOptions, AgentHttpError, type AgentMessageMetadata, type AgentStreamMeta, type AgentsState, type AggregatedTurnUsage, type AmbientRenderUi, AmbientRenderUiContext, AnyToolUIPart, type ApprovalCountdown, ApproveOptions, type AttachmentRejection, type AttachmentsState, type AutocompleteInputProps, type AutocompleteItem, type AutocompleteListboxProps, type AutocompleteOptionProps, type AutocompleteSource, type BackgroundRun, type CancelResult, type ChatBackground, ChatInput, type ChatInputProps, ChatStatus, type ChatStreamRequest, type ChatStreamResponse, type ChatTranscript, type ClipboardLikeEvent, type CompletionEdit, type ComposerAutocomplete, DEFAULT_SPEECH_LANG, type DragLikeEvent, type MessageFeedbackInput, type MessageFeedbackState, type MessageFile, type MessageFileKind, MessageItem, type MessageItemClassNames, type MessageItemProps, MessageItemView, type MessageItemViewProps, MessageList, type MessageListClassNames, type MessageListProps, MessageUsageInfo, type ModelOption, type ModelsState, QuotaBlockedError, type QuotaState, type QuotaToday, type ReconnectOptions, type RenderFilesFn, type RenderReasoningFn, type RenderTextFn, type RenderToolGroupFn, type RenderToolPartFn, type RenderUiFn, type ResumeStreamRequest, SPEECH_LANGUAGES, type SkillSuggestionData, type SkillsSourceOptions, type SpeechLanguage, type SpeechRecognitionHook, type StagedAttachment, type StagedAttachmentStatus, type StickToBottom, type StickToBottomOptions, type StoredTurnMetadata, type StreamConnectionState, type ThreadPatch, type ThreadsEvent, type ThreadsState, TimestampInfo, ToolCatalog, type ToolCatalogState, type TranscriptActionState, TranscriptBlock, type TranscriptCopyState, type TranscriptEditState, TranscriptFile, type TranscriptItem, type TranscriptItemOptions, type TranscriptStopState, TranscriptUiBlock, type TranscriptWindow, type TriggerMatch, type TriggerPosition, type UploadAttachmentOptions, UsageSummary, type UseAgentChatOptions, type UseAgentsOptions, type UseApprovalCountdownOptions, type UseAttachmentsOptions, type UseChatTranscriptOptions, type UseComposerAutocompleteOptions, type UseElapsedOptions, type UseMessageFeedbackOptions, type UseModelsOptions, type UseQuotaOptions, type UseSpeechRecognitionOptions, type UseThreadsOptions, type UseToolCatalogOptions, type UseTranscriptItemOptions, acceptsFile, applyCompletion, approvalCountdown, backgroundRunsFromThread, createSkillsSource, dragHasFiles, fileKind, filesFromClipboard, filterAutocompleteItems, findActiveTrigger, formatElapsed, loadStoredSpeechLang, messageFiles, notifyThreads, onThreadsEvent, persistSpeechLang, readReasoningMs, requireBackendMethod, storedMessageToUiMessage, storedThreadToUiMessages, useAgentChat, useAgents, useAmbientRenderUi, useApprovalCountdown, useAttachments, useChatTranscript, useComposerAutocomplete, useElapsed, useMessageFeedback, useModels, useQuota, useSpeechRecognition, useStickToBottom, useThreads, useToolCatalog, useTranscriptItem };
|
package/dist/index.js
CHANGED
|
@@ -1752,6 +1752,24 @@ function backgroundRunsFromThread(messages) {
|
|
|
1752
1752
|
}
|
|
1753
1753
|
__name(backgroundRunsFromThread, "backgroundRunsFromThread");
|
|
1754
1754
|
|
|
1755
|
+
// src/components/ambient-ui.ts
|
|
1756
|
+
import { createContext, useContext } from "react";
|
|
1757
|
+
function sharedContext(key) {
|
|
1758
|
+
const symbol = Symbol.for(key);
|
|
1759
|
+
const holder = globalThis;
|
|
1760
|
+
const existing = holder[symbol];
|
|
1761
|
+
if (existing !== void 0) return existing;
|
|
1762
|
+
const created = createContext(null);
|
|
1763
|
+
holder[symbol] = created;
|
|
1764
|
+
return created;
|
|
1765
|
+
}
|
|
1766
|
+
__name(sharedContext, "sharedContext");
|
|
1767
|
+
var AmbientRenderUiContext = sharedContext("@dudousxd/nestjs-agent-react:ambient-render-ui");
|
|
1768
|
+
function useAmbientRenderUi() {
|
|
1769
|
+
return useContext(AmbientRenderUiContext);
|
|
1770
|
+
}
|
|
1771
|
+
__name(useAmbientRenderUi, "useAmbientRenderUi");
|
|
1772
|
+
|
|
1755
1773
|
// src/components/chat-input.tsx
|
|
1756
1774
|
import React2, { useEffect as useEffect7, useState as useState7 } from "react";
|
|
1757
1775
|
|
|
@@ -3397,7 +3415,12 @@ function MessageItem({ message, isStreaming = false, editable, onEditSubmit, reg
|
|
|
3397
3415
|
});
|
|
3398
3416
|
}
|
|
3399
3417
|
__name(MessageItem, "MessageItem");
|
|
3400
|
-
function MessageItemView({ item, ...
|
|
3418
|
+
function MessageItemView({ item, ...given }) {
|
|
3419
|
+
const ambientRenderUi = useAmbientRenderUi();
|
|
3420
|
+
const slots = given.renderUi === void 0 && ambientRenderUi !== null ? {
|
|
3421
|
+
...given,
|
|
3422
|
+
renderUi: ambientRenderUi
|
|
3423
|
+
} : given;
|
|
3401
3424
|
const { classNames } = slots;
|
|
3402
3425
|
const actionRow = /* @__PURE__ */ React3.createElement("div", {
|
|
3403
3426
|
className: classNames?.actions,
|
|
@@ -4827,6 +4850,7 @@ export {
|
|
|
4827
4850
|
AgentChatTransport,
|
|
4828
4851
|
AgentClient,
|
|
4829
4852
|
AgentHttpError,
|
|
4853
|
+
AmbientRenderUiContext,
|
|
4830
4854
|
ChatInput,
|
|
4831
4855
|
DEFAULT_SPEECH_LANG,
|
|
4832
4856
|
MessageItem,
|
|
@@ -4873,6 +4897,7 @@ export {
|
|
|
4873
4897
|
toolCatalogFrom,
|
|
4874
4898
|
useAgentChat,
|
|
4875
4899
|
useAgents,
|
|
4900
|
+
useAmbientRenderUi,
|
|
4876
4901
|
useApprovalCountdown,
|
|
4877
4902
|
useAttachments,
|
|
4878
4903
|
useChatTranscript,
|