@paymanai/payman-ask-sdk 1.0.5 → 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 +37 -2
- package/dist/index.d.ts +37 -2
- package/dist/index.js +513 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +504 -13
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.js +496 -15
- package/dist/index.native.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
+
import { UserActionResult, UserActionRequest } from '@paymanai/payman-typescript-ask-sdk';
|
|
5
|
+
export { StreamEvent, StreamOptions, UserActionRequest, UserActionResult, UserActionState, cancelUserAction, generateId, resendUserAction, streamWorkflowEvents, submitUserAction, useChat } from '@paymanai/payman-typescript-ask-sdk';
|
|
4
6
|
import { ClassValue } from 'clsx';
|
|
5
|
-
export { StreamEvent, StreamOptions, generateId, streamWorkflowEvents, useChat } from '@paymanai/payman-typescript-ask-sdk';
|
|
6
7
|
|
|
7
8
|
type MessageRole = "user" | "assistant" | "system";
|
|
8
9
|
type StreamProgress = "started" | "processing" | "completed" | "error";
|
|
@@ -40,6 +41,8 @@ type MessageDisplay = {
|
|
|
40
41
|
steps?: StreamingStep[];
|
|
41
42
|
isCancelled?: boolean;
|
|
42
43
|
currentExecutingStepId?: string;
|
|
44
|
+
/** Result of user action (OTP approval/rejection) */
|
|
45
|
+
userActionResult?: UserActionResult;
|
|
43
46
|
};
|
|
44
47
|
type SessionParams = {
|
|
45
48
|
id?: string;
|
|
@@ -129,6 +132,10 @@ type ChatCallbacks = {
|
|
|
129
132
|
}) => void;
|
|
130
133
|
/** Called when session ID changes */
|
|
131
134
|
onSessionIdChange?: (sessionId: string) => void;
|
|
135
|
+
/** Called when a user action (e.g. OTP) is required */
|
|
136
|
+
onUserActionRequired?: (request: UserActionRequest) => void;
|
|
137
|
+
/** Called on user action events (SUCCESS, INVALID, EXPIRED, REJECTED, RESENT, FAILED) */
|
|
138
|
+
onUserActionEvent?: (eventType: string, message: string) => void;
|
|
132
139
|
};
|
|
133
140
|
type PaymanChatProps = {
|
|
134
141
|
/** Chat configuration - includes API config */
|
|
@@ -231,6 +238,10 @@ type MessageRowProps = {
|
|
|
231
238
|
showUserAvatar?: boolean;
|
|
232
239
|
/** Show assistant avatar only (overrides showAvatars) */
|
|
233
240
|
showAssistantAvatar?: boolean;
|
|
241
|
+
/** Layout style */
|
|
242
|
+
layout?: "centered" | "full-width";
|
|
243
|
+
/** Show timestamps on messages */
|
|
244
|
+
showTimestamps?: boolean;
|
|
234
245
|
/** Show execution steps */
|
|
235
246
|
showExecutionSteps?: boolean;
|
|
236
247
|
/** Show streaming dot */
|
|
@@ -328,6 +339,30 @@ type ChatHeaderProps = {
|
|
|
328
339
|
/** Custom class name */
|
|
329
340
|
className?: string;
|
|
330
341
|
};
|
|
342
|
+
type OtpInputProps = {
|
|
343
|
+
/** Current OTP value */
|
|
344
|
+
value: string;
|
|
345
|
+
/** Called with new OTP value */
|
|
346
|
+
onChange: (value: string) => void;
|
|
347
|
+
/** Number of digit boxes */
|
|
348
|
+
maxLength: number;
|
|
349
|
+
/** Disabled state */
|
|
350
|
+
disabled?: boolean;
|
|
351
|
+
};
|
|
352
|
+
type UserActionModalProps = {
|
|
353
|
+
/** Whether the modal is open */
|
|
354
|
+
isOpen: boolean;
|
|
355
|
+
/** User action request data from the stream */
|
|
356
|
+
userActionRequest: UserActionRequest | null;
|
|
357
|
+
/** Submit OTP */
|
|
358
|
+
onApprove: (otp: string) => Promise<void>;
|
|
359
|
+
/** Reject / cancel */
|
|
360
|
+
onReject: () => Promise<void>;
|
|
361
|
+
/** Resend OTP */
|
|
362
|
+
onResend: () => Promise<void>;
|
|
363
|
+
/** Increment to externally clear OTP field */
|
|
364
|
+
clearOtpTrigger: number;
|
|
365
|
+
};
|
|
331
366
|
|
|
332
367
|
declare function PaymanChat({ config, callbacks, className, style, children, }: PaymanChatProps): react_jsx_runtime.JSX.Element;
|
|
333
368
|
|
|
@@ -387,4 +422,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
387
422
|
*/
|
|
388
423
|
declare function formatDate(timestamp: string | Date): string;
|
|
389
424
|
|
|
390
|
-
export { type APIConfig, type AgentMessageProps, type ChatCallbacks, type ChatConfig, type ChatHeaderProps, type ChatInputProps, type ChunkDisplay, type MessageDisplay, type MessageListProps, type MessageRole, type MessageRowProps, PaymanChat, PaymanChatContext, type PaymanChatContextValue, type PaymanChatProps, type SessionParams, type StreamProgress, type StreamingMessageProps, type StreamingStep, type UserMessageProps, type WorkflowStage, cn, formatDate, usePaymanChat };
|
|
425
|
+
export { type APIConfig, type AgentMessageProps, type ChatCallbacks, type ChatConfig, type ChatHeaderProps, type ChatInputProps, type ChunkDisplay, type MessageDisplay, type MessageListProps, type MessageRole, type MessageRowProps, type OtpInputProps, PaymanChat, PaymanChatContext, type PaymanChatContextValue, type PaymanChatProps, type SessionParams, type StreamProgress, type StreamingMessageProps, type StreamingStep, type UserActionModalProps, type UserMessageProps, type WorkflowStage, cn, formatDate, usePaymanChat };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
+
import { UserActionResult, UserActionRequest } from '@paymanai/payman-typescript-ask-sdk';
|
|
5
|
+
export { StreamEvent, StreamOptions, UserActionRequest, UserActionResult, UserActionState, cancelUserAction, generateId, resendUserAction, streamWorkflowEvents, submitUserAction, useChat } from '@paymanai/payman-typescript-ask-sdk';
|
|
4
6
|
import { ClassValue } from 'clsx';
|
|
5
|
-
export { StreamEvent, StreamOptions, generateId, streamWorkflowEvents, useChat } from '@paymanai/payman-typescript-ask-sdk';
|
|
6
7
|
|
|
7
8
|
type MessageRole = "user" | "assistant" | "system";
|
|
8
9
|
type StreamProgress = "started" | "processing" | "completed" | "error";
|
|
@@ -40,6 +41,8 @@ type MessageDisplay = {
|
|
|
40
41
|
steps?: StreamingStep[];
|
|
41
42
|
isCancelled?: boolean;
|
|
42
43
|
currentExecutingStepId?: string;
|
|
44
|
+
/** Result of user action (OTP approval/rejection) */
|
|
45
|
+
userActionResult?: UserActionResult;
|
|
43
46
|
};
|
|
44
47
|
type SessionParams = {
|
|
45
48
|
id?: string;
|
|
@@ -129,6 +132,10 @@ type ChatCallbacks = {
|
|
|
129
132
|
}) => void;
|
|
130
133
|
/** Called when session ID changes */
|
|
131
134
|
onSessionIdChange?: (sessionId: string) => void;
|
|
135
|
+
/** Called when a user action (e.g. OTP) is required */
|
|
136
|
+
onUserActionRequired?: (request: UserActionRequest) => void;
|
|
137
|
+
/** Called on user action events (SUCCESS, INVALID, EXPIRED, REJECTED, RESENT, FAILED) */
|
|
138
|
+
onUserActionEvent?: (eventType: string, message: string) => void;
|
|
132
139
|
};
|
|
133
140
|
type PaymanChatProps = {
|
|
134
141
|
/** Chat configuration - includes API config */
|
|
@@ -231,6 +238,10 @@ type MessageRowProps = {
|
|
|
231
238
|
showUserAvatar?: boolean;
|
|
232
239
|
/** Show assistant avatar only (overrides showAvatars) */
|
|
233
240
|
showAssistantAvatar?: boolean;
|
|
241
|
+
/** Layout style */
|
|
242
|
+
layout?: "centered" | "full-width";
|
|
243
|
+
/** Show timestamps on messages */
|
|
244
|
+
showTimestamps?: boolean;
|
|
234
245
|
/** Show execution steps */
|
|
235
246
|
showExecutionSteps?: boolean;
|
|
236
247
|
/** Show streaming dot */
|
|
@@ -328,6 +339,30 @@ type ChatHeaderProps = {
|
|
|
328
339
|
/** Custom class name */
|
|
329
340
|
className?: string;
|
|
330
341
|
};
|
|
342
|
+
type OtpInputProps = {
|
|
343
|
+
/** Current OTP value */
|
|
344
|
+
value: string;
|
|
345
|
+
/** Called with new OTP value */
|
|
346
|
+
onChange: (value: string) => void;
|
|
347
|
+
/** Number of digit boxes */
|
|
348
|
+
maxLength: number;
|
|
349
|
+
/** Disabled state */
|
|
350
|
+
disabled?: boolean;
|
|
351
|
+
};
|
|
352
|
+
type UserActionModalProps = {
|
|
353
|
+
/** Whether the modal is open */
|
|
354
|
+
isOpen: boolean;
|
|
355
|
+
/** User action request data from the stream */
|
|
356
|
+
userActionRequest: UserActionRequest | null;
|
|
357
|
+
/** Submit OTP */
|
|
358
|
+
onApprove: (otp: string) => Promise<void>;
|
|
359
|
+
/** Reject / cancel */
|
|
360
|
+
onReject: () => Promise<void>;
|
|
361
|
+
/** Resend OTP */
|
|
362
|
+
onResend: () => Promise<void>;
|
|
363
|
+
/** Increment to externally clear OTP field */
|
|
364
|
+
clearOtpTrigger: number;
|
|
365
|
+
};
|
|
331
366
|
|
|
332
367
|
declare function PaymanChat({ config, callbacks, className, style, children, }: PaymanChatProps): react_jsx_runtime.JSX.Element;
|
|
333
368
|
|
|
@@ -387,4 +422,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
387
422
|
*/
|
|
388
423
|
declare function formatDate(timestamp: string | Date): string;
|
|
389
424
|
|
|
390
|
-
export { type APIConfig, type AgentMessageProps, type ChatCallbacks, type ChatConfig, type ChatHeaderProps, type ChatInputProps, type ChunkDisplay, type MessageDisplay, type MessageListProps, type MessageRole, type MessageRowProps, PaymanChat, PaymanChatContext, type PaymanChatContextValue, type PaymanChatProps, type SessionParams, type StreamProgress, type StreamingMessageProps, type StreamingStep, type UserMessageProps, type WorkflowStage, cn, formatDate, usePaymanChat };
|
|
425
|
+
export { type APIConfig, type AgentMessageProps, type ChatCallbacks, type ChatConfig, type ChatHeaderProps, type ChatInputProps, type ChunkDisplay, type MessageDisplay, type MessageListProps, type MessageRole, type MessageRowProps, type OtpInputProps, PaymanChat, PaymanChatContext, type PaymanChatContextValue, type PaymanChatProps, type SessionParams, type StreamProgress, type StreamingMessageProps, type StreamingStep, type UserActionModalProps, type UserMessageProps, type WorkflowStage, cn, formatDate, usePaymanChat };
|