@xinghunm/ai-chat 1.0.2 → 1.1.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/dist/index.d.mts +17 -2
- package/dist/index.d.ts +17 -2
- package/dist/index.js +586 -215
- package/dist/index.mjs +606 -231
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -72,6 +72,7 @@ interface PlanSingleSelectQuestion extends PlanQuestionBase {
|
|
|
72
72
|
*/
|
|
73
73
|
interface PlanMultiSelectQuestion extends PlanQuestionBase {
|
|
74
74
|
kind: 'multi_select';
|
|
75
|
+
allowOther?: boolean;
|
|
75
76
|
options: PlanQuestionOption[];
|
|
76
77
|
}
|
|
77
78
|
/**
|
|
@@ -127,11 +128,21 @@ interface PlanQuestionnaire {
|
|
|
127
128
|
title?: string;
|
|
128
129
|
description?: string;
|
|
129
130
|
submitLabel?: string;
|
|
130
|
-
|
|
131
|
+
/**
|
|
132
|
+
* Single question rendered by the questionnaire card.
|
|
133
|
+
*/
|
|
134
|
+
question: PlanQuestion;
|
|
131
135
|
answers?: Partial<Record<string, PlanQuestionnaireAnswerValue>>;
|
|
132
136
|
status?: PlanQuestionnaireStatus;
|
|
133
137
|
statusMessage?: string;
|
|
134
138
|
}
|
|
139
|
+
interface PlanQuestionSubmissionDetail {
|
|
140
|
+
questionId: string;
|
|
141
|
+
kind: PlanQuestion['kind'];
|
|
142
|
+
value?: PlanQuestionnaireAnswerValue;
|
|
143
|
+
selectedOptionValues?: string[];
|
|
144
|
+
otherValue?: string;
|
|
145
|
+
}
|
|
135
146
|
/**
|
|
136
147
|
* Submission payload emitted by a questionnaire card.
|
|
137
148
|
*/
|
|
@@ -142,6 +153,7 @@ interface PlanQuestionnaireSubmission {
|
|
|
142
153
|
*/
|
|
143
154
|
blockKey?: string;
|
|
144
155
|
answers: Record<string, PlanQuestionnaireAnswerValue>;
|
|
156
|
+
details?: Record<string, PlanQuestionSubmissionDetail>;
|
|
145
157
|
content: string;
|
|
146
158
|
sourceMessageId?: string;
|
|
147
159
|
}
|
|
@@ -404,6 +416,9 @@ interface AiChatLabels {
|
|
|
404
416
|
questionnaireSubmitted?: string;
|
|
405
417
|
questionnaireValidationPrefix?: string;
|
|
406
418
|
questionnaireSubmitFailed?: string;
|
|
419
|
+
questionnaireMultiSelectHint?: string;
|
|
420
|
+
questionnaireOtherOptionLabel?: string;
|
|
421
|
+
questionnaireOtherPlaceholder?: string;
|
|
407
422
|
}
|
|
408
423
|
/**
|
|
409
424
|
* Default English label values used when no labels are provided.
|
|
@@ -638,4 +653,4 @@ declare const useChatContext: () => ChatContextValue;
|
|
|
638
653
|
*/
|
|
639
654
|
declare const useChatStore: <T>(selector: (state: ChatStore) => T) => T;
|
|
640
655
|
|
|
641
|
-
export { AiChat, type AiChatLabels, type AiChatProps, AiChatProvider, type AiChatProviderProps, CHAT_AGENT_MODES, CHAT_MESSAGE_RENDER_ORDERS, type ChatAgentMode, ChatComposer, type ChatComposerViewProps, type ChatConfirmationSubmitHandler, ChatConversationList, type ChatImageAttachment, type ChatMessage, type ChatMessageBlock, type ChatMessageBlockRenderer, type ChatMessageBlockRendererProps, type ChatMessageRenderOrder, type ChatMessageStatus, type ChatModel, type ChatParameterSummaryItem, type ChatQuestionnaireSubmitHandler, type ChatRole, type ChatSession, type ChatStreamMessagePatch, type ChatStreamPacketTransformArgs, type ChatStreamPacketUpdate, type ChatSubmissionContext, ChatThread, type ChatToolExecutionPolicy, type ChatTransport, type ChatTransportStartStreamArgs, type CreateDefaultChatTransportOptions, DEFAULT_AI_CHAT_LABELS, DEFAULT_CHAT_AGENT_MODE, type DefaultChatTransportEndpoints, type ExecutionConfirmationSubmission, type ExecutionProposal, type PlanQuestionOption, type PlanQuestionnaire, type PlanQuestionnaireSubmission, type ResultSummary, type TransformChatStreamPacket, createDefaultChatTransport, useChatContext, useChatStore };
|
|
656
|
+
export { AiChat, type AiChatLabels, type AiChatProps, AiChatProvider, type AiChatProviderProps, CHAT_AGENT_MODES, CHAT_MESSAGE_RENDER_ORDERS, type ChatAgentMode, ChatComposer, type ChatComposerViewProps, type ChatConfirmationSubmitHandler, ChatConversationList, type ChatImageAttachment, type ChatMessage, type ChatMessageBlock, type ChatMessageBlockRenderer, type ChatMessageBlockRendererProps, type ChatMessageRenderOrder, type ChatMessageStatus, type ChatModel, type ChatParameterSummaryItem, type ChatQuestionnaireSubmitHandler, type ChatRole, type ChatSession, type ChatStreamMessagePatch, type ChatStreamPacketTransformArgs, type ChatStreamPacketUpdate, type ChatSubmissionContext, ChatThread, type ChatToolExecutionPolicy, type ChatTransport, type ChatTransportStartStreamArgs, type CreateDefaultChatTransportOptions, DEFAULT_AI_CHAT_LABELS, DEFAULT_CHAT_AGENT_MODE, type DefaultChatTransportEndpoints, type ExecutionConfirmationSubmission, type ExecutionProposal, type PlanQuestionOption, type PlanQuestionSubmissionDetail, type PlanQuestionnaire, type PlanQuestionnaireSubmission, type ResultSummary, type TransformChatStreamPacket, createDefaultChatTransport, useChatContext, useChatStore };
|
package/dist/index.d.ts
CHANGED
|
@@ -72,6 +72,7 @@ interface PlanSingleSelectQuestion extends PlanQuestionBase {
|
|
|
72
72
|
*/
|
|
73
73
|
interface PlanMultiSelectQuestion extends PlanQuestionBase {
|
|
74
74
|
kind: 'multi_select';
|
|
75
|
+
allowOther?: boolean;
|
|
75
76
|
options: PlanQuestionOption[];
|
|
76
77
|
}
|
|
77
78
|
/**
|
|
@@ -127,11 +128,21 @@ interface PlanQuestionnaire {
|
|
|
127
128
|
title?: string;
|
|
128
129
|
description?: string;
|
|
129
130
|
submitLabel?: string;
|
|
130
|
-
|
|
131
|
+
/**
|
|
132
|
+
* Single question rendered by the questionnaire card.
|
|
133
|
+
*/
|
|
134
|
+
question: PlanQuestion;
|
|
131
135
|
answers?: Partial<Record<string, PlanQuestionnaireAnswerValue>>;
|
|
132
136
|
status?: PlanQuestionnaireStatus;
|
|
133
137
|
statusMessage?: string;
|
|
134
138
|
}
|
|
139
|
+
interface PlanQuestionSubmissionDetail {
|
|
140
|
+
questionId: string;
|
|
141
|
+
kind: PlanQuestion['kind'];
|
|
142
|
+
value?: PlanQuestionnaireAnswerValue;
|
|
143
|
+
selectedOptionValues?: string[];
|
|
144
|
+
otherValue?: string;
|
|
145
|
+
}
|
|
135
146
|
/**
|
|
136
147
|
* Submission payload emitted by a questionnaire card.
|
|
137
148
|
*/
|
|
@@ -142,6 +153,7 @@ interface PlanQuestionnaireSubmission {
|
|
|
142
153
|
*/
|
|
143
154
|
blockKey?: string;
|
|
144
155
|
answers: Record<string, PlanQuestionnaireAnswerValue>;
|
|
156
|
+
details?: Record<string, PlanQuestionSubmissionDetail>;
|
|
145
157
|
content: string;
|
|
146
158
|
sourceMessageId?: string;
|
|
147
159
|
}
|
|
@@ -404,6 +416,9 @@ interface AiChatLabels {
|
|
|
404
416
|
questionnaireSubmitted?: string;
|
|
405
417
|
questionnaireValidationPrefix?: string;
|
|
406
418
|
questionnaireSubmitFailed?: string;
|
|
419
|
+
questionnaireMultiSelectHint?: string;
|
|
420
|
+
questionnaireOtherOptionLabel?: string;
|
|
421
|
+
questionnaireOtherPlaceholder?: string;
|
|
407
422
|
}
|
|
408
423
|
/**
|
|
409
424
|
* Default English label values used when no labels are provided.
|
|
@@ -638,4 +653,4 @@ declare const useChatContext: () => ChatContextValue;
|
|
|
638
653
|
*/
|
|
639
654
|
declare const useChatStore: <T>(selector: (state: ChatStore) => T) => T;
|
|
640
655
|
|
|
641
|
-
export { AiChat, type AiChatLabels, type AiChatProps, AiChatProvider, type AiChatProviderProps, CHAT_AGENT_MODES, CHAT_MESSAGE_RENDER_ORDERS, type ChatAgentMode, ChatComposer, type ChatComposerViewProps, type ChatConfirmationSubmitHandler, ChatConversationList, type ChatImageAttachment, type ChatMessage, type ChatMessageBlock, type ChatMessageBlockRenderer, type ChatMessageBlockRendererProps, type ChatMessageRenderOrder, type ChatMessageStatus, type ChatModel, type ChatParameterSummaryItem, type ChatQuestionnaireSubmitHandler, type ChatRole, type ChatSession, type ChatStreamMessagePatch, type ChatStreamPacketTransformArgs, type ChatStreamPacketUpdate, type ChatSubmissionContext, ChatThread, type ChatToolExecutionPolicy, type ChatTransport, type ChatTransportStartStreamArgs, type CreateDefaultChatTransportOptions, DEFAULT_AI_CHAT_LABELS, DEFAULT_CHAT_AGENT_MODE, type DefaultChatTransportEndpoints, type ExecutionConfirmationSubmission, type ExecutionProposal, type PlanQuestionOption, type PlanQuestionnaire, type PlanQuestionnaireSubmission, type ResultSummary, type TransformChatStreamPacket, createDefaultChatTransport, useChatContext, useChatStore };
|
|
656
|
+
export { AiChat, type AiChatLabels, type AiChatProps, AiChatProvider, type AiChatProviderProps, CHAT_AGENT_MODES, CHAT_MESSAGE_RENDER_ORDERS, type ChatAgentMode, ChatComposer, type ChatComposerViewProps, type ChatConfirmationSubmitHandler, ChatConversationList, type ChatImageAttachment, type ChatMessage, type ChatMessageBlock, type ChatMessageBlockRenderer, type ChatMessageBlockRendererProps, type ChatMessageRenderOrder, type ChatMessageStatus, type ChatModel, type ChatParameterSummaryItem, type ChatQuestionnaireSubmitHandler, type ChatRole, type ChatSession, type ChatStreamMessagePatch, type ChatStreamPacketTransformArgs, type ChatStreamPacketUpdate, type ChatSubmissionContext, ChatThread, type ChatToolExecutionPolicy, type ChatTransport, type ChatTransportStartStreamArgs, type CreateDefaultChatTransportOptions, DEFAULT_AI_CHAT_LABELS, DEFAULT_CHAT_AGENT_MODE, type DefaultChatTransportEndpoints, type ExecutionConfirmationSubmission, type ExecutionProposal, type PlanQuestionOption, type PlanQuestionSubmissionDetail, type PlanQuestionnaire, type PlanQuestionnaireSubmission, type ResultSummary, type TransformChatStreamPacket, createDefaultChatTransport, useChatContext, useChatStore };
|