@paymanai/payman-ask-sdk 4.0.11 → 4.0.13

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
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
- import { MessageDisplay, AgentStage, ChatCallbacks as ChatCallbacks$1, ChatConfig as ChatConfig$1, StreamProgress, StreamingStep, UserActionRequest } from '@paymanai/payman-typescript-ask-sdk';
4
- export { APIConfig, AgentStage, ChunkDisplay, MessageDisplay, MessageRole, SessionParams, StreamEvent, StreamOptions, StreamProgress, StreamingStep, UseChatV2Return, UseVoiceReturn, UserActionRequest, UserActionResult, UserActionState, UserActionType, V2EventProcessorState, VoiceCallbacks, VoiceConfig, VoicePermissions, VoiceResult, VoiceState, buildFormattedThinking, cancelUserAction, createInitialV2State, generateId, processStreamEventV2, resendUserAction, streamWorkflowEvents, submitUserAction, useChatV2, useVoice } from '@paymanai/payman-typescript-ask-sdk';
3
+ import { MessageDisplay, AgentStage, ChatCallbacks as ChatCallbacks$1, ChatConfig as ChatConfig$1, ActiveUserAction, UserNotification } from '@paymanai/payman-typescript-ask-sdk';
4
+ export { APIConfig, ActiveUserAction, AgentStage, ChunkDisplay, JsonSchemaField, JsonSchemaOption, MessageDisplay, MessageRole, RequestedSchema, SessionParams, StreamProgress, StreamingStep, UseChatV2Return, UseVoiceReturn, UserActionKind, UserActionRequest, UserActionStaleError, UserActionState, UserActionStatus, UserActionSubAction, UserNotification, VerificationType, VoiceCallbacks, VoiceConfig, VoicePermissions, VoiceResult, VoiceState, cancelUserAction, resendUserAction, submitUserAction, useChatV2, useVoice } from '@paymanai/payman-typescript-ask-sdk';
5
5
  import { ClassValue } from 'clsx';
6
6
 
7
7
  declare const NEGATIVE_FEEDBACK_REASONS: readonly [{
@@ -328,23 +328,18 @@ type MessageListV2Props = {
328
328
  messageActions?: MessageActionsConfig;
329
329
  /** Disable retry/resend actions while the chat is busy */
330
330
  retryDisabled?: boolean;
331
- /** Current user action card */
332
- userAction?: {
333
- messageId: string;
334
- action: {
335
- type: string;
336
- message: string;
337
- amount?: string;
338
- payeeName?: string;
339
- };
340
- status: "pending" | "verifying" | "approved" | "rejected" | "error";
341
- } | null;
342
- /** Approve a user action */
343
- onApproveAction?: (messageId: string, otp: string) => Promise<void>;
344
- /** Reject a user action */
345
- onRejectAction?: (messageId: string) => Promise<void>;
346
- /** Resend a user action */
347
- onResendAction?: (messageId: string) => Promise<void>;
331
+ /** Active user-action prompts to render inline (rendered as a stack). */
332
+ userActionPrompts?: ActiveUserAction[];
333
+ /** One-way notifications to render inline. */
334
+ notifications?: UserNotification[];
335
+ /** Submit a prompt's schema-typed form payload. */
336
+ onSubmitUserAction?: (userActionId: string, content: Record<string, unknown>) => Promise<void>;
337
+ /** Cancel / decline a prompt. */
338
+ onCancelUserAction?: (userActionId: string) => Promise<void>;
339
+ /** Resend a prompt (e.g. resend a verification code). */
340
+ onResendUserAction?: (userActionId: string) => Promise<void>;
341
+ /** Dismiss a one-way notification. */
342
+ onDismissNotification?: (id: string) => void;
348
343
  /** Persist thumbs-up/down feedback (rejects on failure). */
349
344
  onSubmitFeedback?: SubmitFeedbackHandler;
350
345
  /**
@@ -429,22 +424,6 @@ type AgentMessageProps = {
429
424
  executionId?: string;
430
425
  }) => void;
431
426
  };
432
- type StreamingMessageProps = {
433
- /** Streaming content */
434
- content: string;
435
- /** Is currently streaming */
436
- isStreaming: boolean;
437
- /** Current worker */
438
- currentWorker?: string;
439
- /** Current message */
440
- currentMessage?: string;
441
- /** Stream progress */
442
- streamProgress: StreamProgress;
443
- /** "WORKFLOW_FAILED" and "STREAM_NOT_STARTED" show the friendly fallback; HTTP 409 conflicts render the backend message from the error payload. */
444
- error?: string;
445
- /** Streaming steps */
446
- steps?: StreamingStep[];
447
- };
448
427
  type ChatHeaderProps = {
449
428
  /** Session ID */
450
429
  sessionId?: string;
@@ -471,32 +450,6 @@ type ChatHeaderProps = {
471
450
  /** Custom class name */
472
451
  className?: string;
473
452
  };
474
- type OtpInputProps = {
475
- /** Current OTP value */
476
- value: string;
477
- /** Called with new OTP value */
478
- onChange: (value: string) => void;
479
- /** Number of digit boxes */
480
- maxLength: number;
481
- /** Disabled state */
482
- disabled?: boolean;
483
- /** Transient error state — triggers red borders + shake */
484
- error?: boolean;
485
- };
486
- type UserActionModalProps = {
487
- /** Whether the modal is open */
488
- isOpen: boolean;
489
- /** User action request data from the stream */
490
- userActionRequest: UserActionRequest | null;
491
- /** Submit OTP */
492
- onApprove: (otp: string) => Promise<void>;
493
- /** Reject / cancel */
494
- onReject: () => Promise<void>;
495
- /** Resend OTP */
496
- onResend: () => Promise<void>;
497
- /** Increment to externally clear OTP field */
498
- clearOtpTrigger: number;
499
- };
500
453
 
501
454
  /**
502
455
  * PaymanChat — the public component. Delegates to `PaymanChatInner`
@@ -587,4 +540,4 @@ interface ChatSessionContext {
587
540
  */
588
541
  declare function captureSentryError(error: Error | string, context: ChatSessionContext): void;
589
542
 
590
- export { type AgentMessageProps, type AssistantMessageActionsConfig, type ChatCallbacks, type ChatConfig, type ChatHeaderProps, type ChatInputProps, type ChatSessionContext, type MessageActionsConfig, type MessageListProps, type MessageListV2Props, type MessageRowProps, type OtpInputProps, PaymanChat, PaymanChatContext, type PaymanChatContextValue, type PaymanChatProps, type PaymanChatRef, type SlashCommandConfig, type StreamingMessageProps, type UserActionModalProps, type UserMessageActionsConfig, type UserMessageProps, captureSentryError, cn, formatDate, usePaymanChat };
543
+ export { type AgentMessageProps, type AssistantMessageActionsConfig, type ChatCallbacks, type ChatConfig, type ChatHeaderProps, type ChatInputProps, type ChatSessionContext, type MessageActionsConfig, type MessageListProps, type MessageListV2Props, type MessageRowProps, PaymanChat, PaymanChatContext, type PaymanChatContextValue, type PaymanChatProps, type PaymanChatRef, type SlashCommandConfig, type UserMessageActionsConfig, type UserMessageProps, captureSentryError, cn, formatDate, usePaymanChat };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
- import { MessageDisplay, AgentStage, ChatCallbacks as ChatCallbacks$1, ChatConfig as ChatConfig$1, StreamProgress, StreamingStep, UserActionRequest } from '@paymanai/payman-typescript-ask-sdk';
4
- export { APIConfig, AgentStage, ChunkDisplay, MessageDisplay, MessageRole, SessionParams, StreamEvent, StreamOptions, StreamProgress, StreamingStep, UseChatV2Return, UseVoiceReturn, UserActionRequest, UserActionResult, UserActionState, UserActionType, V2EventProcessorState, VoiceCallbacks, VoiceConfig, VoicePermissions, VoiceResult, VoiceState, buildFormattedThinking, cancelUserAction, createInitialV2State, generateId, processStreamEventV2, resendUserAction, streamWorkflowEvents, submitUserAction, useChatV2, useVoice } from '@paymanai/payman-typescript-ask-sdk';
3
+ import { MessageDisplay, AgentStage, ChatCallbacks as ChatCallbacks$1, ChatConfig as ChatConfig$1, ActiveUserAction, UserNotification } from '@paymanai/payman-typescript-ask-sdk';
4
+ export { APIConfig, ActiveUserAction, AgentStage, ChunkDisplay, JsonSchemaField, JsonSchemaOption, MessageDisplay, MessageRole, RequestedSchema, SessionParams, StreamProgress, StreamingStep, UseChatV2Return, UseVoiceReturn, UserActionKind, UserActionRequest, UserActionStaleError, UserActionState, UserActionStatus, UserActionSubAction, UserNotification, VerificationType, VoiceCallbacks, VoiceConfig, VoicePermissions, VoiceResult, VoiceState, cancelUserAction, resendUserAction, submitUserAction, useChatV2, useVoice } from '@paymanai/payman-typescript-ask-sdk';
5
5
  import { ClassValue } from 'clsx';
6
6
 
7
7
  declare const NEGATIVE_FEEDBACK_REASONS: readonly [{
@@ -328,23 +328,18 @@ type MessageListV2Props = {
328
328
  messageActions?: MessageActionsConfig;
329
329
  /** Disable retry/resend actions while the chat is busy */
330
330
  retryDisabled?: boolean;
331
- /** Current user action card */
332
- userAction?: {
333
- messageId: string;
334
- action: {
335
- type: string;
336
- message: string;
337
- amount?: string;
338
- payeeName?: string;
339
- };
340
- status: "pending" | "verifying" | "approved" | "rejected" | "error";
341
- } | null;
342
- /** Approve a user action */
343
- onApproveAction?: (messageId: string, otp: string) => Promise<void>;
344
- /** Reject a user action */
345
- onRejectAction?: (messageId: string) => Promise<void>;
346
- /** Resend a user action */
347
- onResendAction?: (messageId: string) => Promise<void>;
331
+ /** Active user-action prompts to render inline (rendered as a stack). */
332
+ userActionPrompts?: ActiveUserAction[];
333
+ /** One-way notifications to render inline. */
334
+ notifications?: UserNotification[];
335
+ /** Submit a prompt's schema-typed form payload. */
336
+ onSubmitUserAction?: (userActionId: string, content: Record<string, unknown>) => Promise<void>;
337
+ /** Cancel / decline a prompt. */
338
+ onCancelUserAction?: (userActionId: string) => Promise<void>;
339
+ /** Resend a prompt (e.g. resend a verification code). */
340
+ onResendUserAction?: (userActionId: string) => Promise<void>;
341
+ /** Dismiss a one-way notification. */
342
+ onDismissNotification?: (id: string) => void;
348
343
  /** Persist thumbs-up/down feedback (rejects on failure). */
349
344
  onSubmitFeedback?: SubmitFeedbackHandler;
350
345
  /**
@@ -429,22 +424,6 @@ type AgentMessageProps = {
429
424
  executionId?: string;
430
425
  }) => void;
431
426
  };
432
- type StreamingMessageProps = {
433
- /** Streaming content */
434
- content: string;
435
- /** Is currently streaming */
436
- isStreaming: boolean;
437
- /** Current worker */
438
- currentWorker?: string;
439
- /** Current message */
440
- currentMessage?: string;
441
- /** Stream progress */
442
- streamProgress: StreamProgress;
443
- /** "WORKFLOW_FAILED" and "STREAM_NOT_STARTED" show the friendly fallback; HTTP 409 conflicts render the backend message from the error payload. */
444
- error?: string;
445
- /** Streaming steps */
446
- steps?: StreamingStep[];
447
- };
448
427
  type ChatHeaderProps = {
449
428
  /** Session ID */
450
429
  sessionId?: string;
@@ -471,32 +450,6 @@ type ChatHeaderProps = {
471
450
  /** Custom class name */
472
451
  className?: string;
473
452
  };
474
- type OtpInputProps = {
475
- /** Current OTP value */
476
- value: string;
477
- /** Called with new OTP value */
478
- onChange: (value: string) => void;
479
- /** Number of digit boxes */
480
- maxLength: number;
481
- /** Disabled state */
482
- disabled?: boolean;
483
- /** Transient error state — triggers red borders + shake */
484
- error?: boolean;
485
- };
486
- type UserActionModalProps = {
487
- /** Whether the modal is open */
488
- isOpen: boolean;
489
- /** User action request data from the stream */
490
- userActionRequest: UserActionRequest | null;
491
- /** Submit OTP */
492
- onApprove: (otp: string) => Promise<void>;
493
- /** Reject / cancel */
494
- onReject: () => Promise<void>;
495
- /** Resend OTP */
496
- onResend: () => Promise<void>;
497
- /** Increment to externally clear OTP field */
498
- clearOtpTrigger: number;
499
- };
500
453
 
501
454
  /**
502
455
  * PaymanChat — the public component. Delegates to `PaymanChatInner`
@@ -587,4 +540,4 @@ interface ChatSessionContext {
587
540
  */
588
541
  declare function captureSentryError(error: Error | string, context: ChatSessionContext): void;
589
542
 
590
- export { type AgentMessageProps, type AssistantMessageActionsConfig, type ChatCallbacks, type ChatConfig, type ChatHeaderProps, type ChatInputProps, type ChatSessionContext, type MessageActionsConfig, type MessageListProps, type MessageListV2Props, type MessageRowProps, type OtpInputProps, PaymanChat, PaymanChatContext, type PaymanChatContextValue, type PaymanChatProps, type PaymanChatRef, type SlashCommandConfig, type StreamingMessageProps, type UserActionModalProps, type UserMessageActionsConfig, type UserMessageProps, captureSentryError, cn, formatDate, usePaymanChat };
543
+ export { type AgentMessageProps, type AssistantMessageActionsConfig, type ChatCallbacks, type ChatConfig, type ChatHeaderProps, type ChatInputProps, type ChatSessionContext, type MessageActionsConfig, type MessageListProps, type MessageListV2Props, type MessageRowProps, PaymanChat, PaymanChatContext, type PaymanChatContextValue, type PaymanChatProps, type PaymanChatRef, type SlashCommandConfig, type UserMessageActionsConfig, type UserMessageProps, captureSentryError, cn, formatDate, usePaymanChat };