@xinghunm/ai-chat 1.0.2 → 1.1.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/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
- questions: PlanQuestion[];
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
  }
@@ -382,6 +394,7 @@ interface AiChatLabels {
382
394
  sendButton?: string;
383
395
  stopButton?: string;
384
396
  retryButton?: string;
397
+ scrollToLatest?: string;
385
398
  placeholder?: string;
386
399
  modeLabelAsk?: string;
387
400
  modeLabelPlan?: string;
@@ -404,6 +417,9 @@ interface AiChatLabels {
404
417
  questionnaireSubmitted?: string;
405
418
  questionnaireValidationPrefix?: string;
406
419
  questionnaireSubmitFailed?: string;
420
+ questionnaireMultiSelectHint?: string;
421
+ questionnaireOtherOptionLabel?: string;
422
+ questionnaireOtherPlaceholder?: string;
407
423
  }
408
424
  /**
409
425
  * Default English label values used when no labels are provided.
@@ -638,4 +654,4 @@ declare const useChatContext: () => ChatContextValue;
638
654
  */
639
655
  declare const useChatStore: <T>(selector: (state: ChatStore) => T) => T;
640
656
 
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 };
657
+ 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
- questions: PlanQuestion[];
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
  }
@@ -382,6 +394,7 @@ interface AiChatLabels {
382
394
  sendButton?: string;
383
395
  stopButton?: string;
384
396
  retryButton?: string;
397
+ scrollToLatest?: string;
385
398
  placeholder?: string;
386
399
  modeLabelAsk?: string;
387
400
  modeLabelPlan?: string;
@@ -404,6 +417,9 @@ interface AiChatLabels {
404
417
  questionnaireSubmitted?: string;
405
418
  questionnaireValidationPrefix?: string;
406
419
  questionnaireSubmitFailed?: string;
420
+ questionnaireMultiSelectHint?: string;
421
+ questionnaireOtherOptionLabel?: string;
422
+ questionnaireOtherPlaceholder?: string;
407
423
  }
408
424
  /**
409
425
  * Default English label values used when no labels are provided.
@@ -638,4 +654,4 @@ declare const useChatContext: () => ChatContextValue;
638
654
  */
639
655
  declare const useChatStore: <T>(selector: (state: ChatStore) => T) => T;
640
656
 
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 };
657
+ 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 };