@paymanai/payman-ask-sdk 4.0.4 → 4.0.6
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 +1 -0
- package/dist/index.d.mts +54 -5
- package/dist/index.d.ts +54 -5
- package/dist/index.js +572 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +572 -25
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +90 -0
- package/dist/styles.css.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -283,6 +283,7 @@ type ChatCallbacks = {
|
|
|
283
283
|
| `placeholder` | `ui.input.placeholder` |
|
|
284
284
|
| `emptyStateText` / `showEmptyStateIcon` / `emptyStateComponent` | `ui.emptyState.{ text, icon, content }` |
|
|
285
285
|
| `showResetSession` | `ui.input.showResetButton` |
|
|
286
|
+
| `enableDeepModeToggle` | `ui.input.deepModeToggle` |
|
|
286
287
|
| `showAttachmentButton` / `showUploadImageButton` / `showAttachFileButton` | `ui.input.attachments: boolean \| { uploadImage, attachFile }` |
|
|
287
288
|
| `messageActions` | `ui.messages.actions` |
|
|
288
289
|
| `showAvatars` / `showUserAvatar` / `showAssistantAvatar` | `ui.messages.avatars: boolean \| { user, assistant }` |
|
package/dist/index.d.mts
CHANGED
|
@@ -4,6 +4,43 @@ import { MessageDisplay, AgentStage, ChatCallbacks as ChatCallbacks$1, ChatConfi
|
|
|
4
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';
|
|
5
5
|
import { ClassValue } from 'clsx';
|
|
6
6
|
|
|
7
|
+
declare const NEGATIVE_FEEDBACK_REASONS: readonly [{
|
|
8
|
+
readonly value: "NOT_FACTUALLY_CORRECT";
|
|
9
|
+
readonly label: "Not factually correct";
|
|
10
|
+
}, {
|
|
11
|
+
readonly value: "INCOMPLETE_RESPONSE";
|
|
12
|
+
readonly label: "Incomplete response";
|
|
13
|
+
}, {
|
|
14
|
+
readonly value: "DID_NOT_FOLLOW_REQUEST";
|
|
15
|
+
readonly label: "Did not follow my request";
|
|
16
|
+
}, {
|
|
17
|
+
readonly value: "OVERACTIVE_REFUSAL";
|
|
18
|
+
readonly label: "Refused unnecessarily";
|
|
19
|
+
}, {
|
|
20
|
+
readonly value: "ISSUE_WITH_THOUGHT_PROCESS";
|
|
21
|
+
readonly label: "Issue with reasoning";
|
|
22
|
+
}, {
|
|
23
|
+
readonly value: "REPORT_CONTENT";
|
|
24
|
+
readonly label: "Report content";
|
|
25
|
+
}, {
|
|
26
|
+
readonly value: "OTHER";
|
|
27
|
+
readonly label: "Other";
|
|
28
|
+
}];
|
|
29
|
+
type NegativeFeedbackReason = (typeof NEGATIVE_FEEDBACK_REASONS)[number]["value"];
|
|
30
|
+
/** The full feedback value sent to the backend. */
|
|
31
|
+
type FeedbackValue = "POSITIVE" | NegativeFeedbackReason;
|
|
32
|
+
/**
|
|
33
|
+
* Handler threaded down to the message components. Resolves when the
|
|
34
|
+
* feedback is durably saved and rejects when the POST fails, so the UI can
|
|
35
|
+
* revert its optimistic state or surface an error.
|
|
36
|
+
*/
|
|
37
|
+
type SubmitFeedbackHandler = (data: {
|
|
38
|
+
messageId: string;
|
|
39
|
+
executionId?: string;
|
|
40
|
+
feedback: FeedbackValue;
|
|
41
|
+
details?: string;
|
|
42
|
+
}) => Promise<void>;
|
|
43
|
+
|
|
7
44
|
type UserMessageActionsConfig = {
|
|
8
45
|
/** Show copy action on user messages (default: true) */
|
|
9
46
|
copy?: boolean;
|
|
@@ -49,6 +86,8 @@ type ChatConfig = ChatConfig$1 & {
|
|
|
49
86
|
voiceContinuous?: boolean;
|
|
50
87
|
/** Show a "New Session" reset button inside the input bar (default: false) */
|
|
51
88
|
showResetSession?: boolean;
|
|
89
|
+
/** Show the Fast/Deep analysis mode toggle in the v2 input bar (default: true). */
|
|
90
|
+
enableDeepModeToggle?: boolean;
|
|
52
91
|
/** Show the v2 attachment (+) menu button in the input bar (default: true) */
|
|
53
92
|
showAttachmentButton?: boolean;
|
|
54
93
|
/** Show the v2 "Upload image" attachment option (default: true) */
|
|
@@ -65,6 +104,19 @@ type ChatConfig = ChatConfig$1 & {
|
|
|
65
104
|
commandPermissions?: string[];
|
|
66
105
|
/** Sentry DSN for error monitoring. */
|
|
67
106
|
sentryDsn?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Diagnostic mode. When `true`, the per-message Trace button opens a
|
|
109
|
+
* built-in latency timeline (fetched from
|
|
110
|
+
* `GET ${api.baseUrl}/api/ask/executions/{executionId}/trace`) that
|
|
111
|
+
* shows wall-clock duration per pipeline step. Intended for local
|
|
112
|
+
* development; off by default so production embeds never leak the
|
|
113
|
+
* trace endpoint or surface the viewer.
|
|
114
|
+
*
|
|
115
|
+
* If the consuming app passes its own `onExecutionTraceClick`
|
|
116
|
+
* callback, that wins — `debug` only installs a default handler when
|
|
117
|
+
* the consumer hasn't wired one.
|
|
118
|
+
*/
|
|
119
|
+
debug?: boolean;
|
|
68
120
|
/**
|
|
69
121
|
* UI version to render.
|
|
70
122
|
* 1 = original component set
|
|
@@ -293,11 +345,8 @@ type MessageListV2Props = {
|
|
|
293
345
|
onRejectAction?: (messageId: string) => Promise<void>;
|
|
294
346
|
/** Resend a user action */
|
|
295
347
|
onResendAction?: (messageId: string) => Promise<void>;
|
|
296
|
-
/**
|
|
297
|
-
|
|
298
|
-
messageId: string;
|
|
299
|
-
feedback: "up" | "down";
|
|
300
|
-
}) => void;
|
|
348
|
+
/** Persist thumbs-up/down feedback (rejects on failure). */
|
|
349
|
+
onSubmitFeedback?: SubmitFeedbackHandler;
|
|
301
350
|
/**
|
|
302
351
|
* Speed multiplier for the typing-reveal animation.
|
|
303
352
|
* 1 = default, 2 = 2x faster, 0.5 = half speed, 0 = instant reveal.
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,43 @@ import { MessageDisplay, AgentStage, ChatCallbacks as ChatCallbacks$1, ChatConfi
|
|
|
4
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';
|
|
5
5
|
import { ClassValue } from 'clsx';
|
|
6
6
|
|
|
7
|
+
declare const NEGATIVE_FEEDBACK_REASONS: readonly [{
|
|
8
|
+
readonly value: "NOT_FACTUALLY_CORRECT";
|
|
9
|
+
readonly label: "Not factually correct";
|
|
10
|
+
}, {
|
|
11
|
+
readonly value: "INCOMPLETE_RESPONSE";
|
|
12
|
+
readonly label: "Incomplete response";
|
|
13
|
+
}, {
|
|
14
|
+
readonly value: "DID_NOT_FOLLOW_REQUEST";
|
|
15
|
+
readonly label: "Did not follow my request";
|
|
16
|
+
}, {
|
|
17
|
+
readonly value: "OVERACTIVE_REFUSAL";
|
|
18
|
+
readonly label: "Refused unnecessarily";
|
|
19
|
+
}, {
|
|
20
|
+
readonly value: "ISSUE_WITH_THOUGHT_PROCESS";
|
|
21
|
+
readonly label: "Issue with reasoning";
|
|
22
|
+
}, {
|
|
23
|
+
readonly value: "REPORT_CONTENT";
|
|
24
|
+
readonly label: "Report content";
|
|
25
|
+
}, {
|
|
26
|
+
readonly value: "OTHER";
|
|
27
|
+
readonly label: "Other";
|
|
28
|
+
}];
|
|
29
|
+
type NegativeFeedbackReason = (typeof NEGATIVE_FEEDBACK_REASONS)[number]["value"];
|
|
30
|
+
/** The full feedback value sent to the backend. */
|
|
31
|
+
type FeedbackValue = "POSITIVE" | NegativeFeedbackReason;
|
|
32
|
+
/**
|
|
33
|
+
* Handler threaded down to the message components. Resolves when the
|
|
34
|
+
* feedback is durably saved and rejects when the POST fails, so the UI can
|
|
35
|
+
* revert its optimistic state or surface an error.
|
|
36
|
+
*/
|
|
37
|
+
type SubmitFeedbackHandler = (data: {
|
|
38
|
+
messageId: string;
|
|
39
|
+
executionId?: string;
|
|
40
|
+
feedback: FeedbackValue;
|
|
41
|
+
details?: string;
|
|
42
|
+
}) => Promise<void>;
|
|
43
|
+
|
|
7
44
|
type UserMessageActionsConfig = {
|
|
8
45
|
/** Show copy action on user messages (default: true) */
|
|
9
46
|
copy?: boolean;
|
|
@@ -49,6 +86,8 @@ type ChatConfig = ChatConfig$1 & {
|
|
|
49
86
|
voiceContinuous?: boolean;
|
|
50
87
|
/** Show a "New Session" reset button inside the input bar (default: false) */
|
|
51
88
|
showResetSession?: boolean;
|
|
89
|
+
/** Show the Fast/Deep analysis mode toggle in the v2 input bar (default: true). */
|
|
90
|
+
enableDeepModeToggle?: boolean;
|
|
52
91
|
/** Show the v2 attachment (+) menu button in the input bar (default: true) */
|
|
53
92
|
showAttachmentButton?: boolean;
|
|
54
93
|
/** Show the v2 "Upload image" attachment option (default: true) */
|
|
@@ -65,6 +104,19 @@ type ChatConfig = ChatConfig$1 & {
|
|
|
65
104
|
commandPermissions?: string[];
|
|
66
105
|
/** Sentry DSN for error monitoring. */
|
|
67
106
|
sentryDsn?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Diagnostic mode. When `true`, the per-message Trace button opens a
|
|
109
|
+
* built-in latency timeline (fetched from
|
|
110
|
+
* `GET ${api.baseUrl}/api/ask/executions/{executionId}/trace`) that
|
|
111
|
+
* shows wall-clock duration per pipeline step. Intended for local
|
|
112
|
+
* development; off by default so production embeds never leak the
|
|
113
|
+
* trace endpoint or surface the viewer.
|
|
114
|
+
*
|
|
115
|
+
* If the consuming app passes its own `onExecutionTraceClick`
|
|
116
|
+
* callback, that wins — `debug` only installs a default handler when
|
|
117
|
+
* the consumer hasn't wired one.
|
|
118
|
+
*/
|
|
119
|
+
debug?: boolean;
|
|
68
120
|
/**
|
|
69
121
|
* UI version to render.
|
|
70
122
|
* 1 = original component set
|
|
@@ -293,11 +345,8 @@ type MessageListV2Props = {
|
|
|
293
345
|
onRejectAction?: (messageId: string) => Promise<void>;
|
|
294
346
|
/** Resend a user action */
|
|
295
347
|
onResendAction?: (messageId: string) => Promise<void>;
|
|
296
|
-
/**
|
|
297
|
-
|
|
298
|
-
messageId: string;
|
|
299
|
-
feedback: "up" | "down";
|
|
300
|
-
}) => void;
|
|
348
|
+
/** Persist thumbs-up/down feedback (rejects on failure). */
|
|
349
|
+
onSubmitFeedback?: SubmitFeedbackHandler;
|
|
301
350
|
/**
|
|
302
351
|
* Speed multiplier for the typing-reveal animation.
|
|
303
352
|
* 1 = default, 2 = 2x faster, 0.5 = half speed, 0 = instant reveal.
|