@paymanai/payman-ask-sdk 1.2.3 → 1.2.5
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 +32 -0
- package/dist/index.d.mts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +880 -561
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +881 -562
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.js +1132 -1188
- package/dist/index.native.js.map +1 -1
- package/dist/styles.css +705 -54
- package/dist/styles.css.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -153,6 +153,38 @@ function MyApp() {
|
|
|
153
153
|
- **[ENDPOINTS.md](./ENDPOINTS.md)** - API endpoints guide
|
|
154
154
|
- **[CHANGELOG.md](./CHANGELOG.md)** - Version history
|
|
155
155
|
|
|
156
|
+
## Theming: Shimmer (active step text)
|
|
157
|
+
|
|
158
|
+
The active-step shimmer uses **full color values** only. Define these CSS variables in your app (e.g. in `:root` or your theme file) so the shimmer matches your theme:
|
|
159
|
+
|
|
160
|
+
| Variable | Description |
|
|
161
|
+
|----------|-------------|
|
|
162
|
+
| `--payman-shimmer-muted` | Muted color (gradient ends) |
|
|
163
|
+
| `--payman-shimmer-foreground` | Main text color (gradient sides) |
|
|
164
|
+
| `--payman-shimmer-primary` | Accent color (gradient center) |
|
|
165
|
+
|
|
166
|
+
**Example (hex theme):**
|
|
167
|
+
|
|
168
|
+
```css
|
|
169
|
+
:root {
|
|
170
|
+
--payman-shimmer-muted: var(--muted-foreground);
|
|
171
|
+
--payman-shimmer-foreground: var(--foreground);
|
|
172
|
+
--payman-shimmer-primary: var(--primary);
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Example (HSL-component theme):**
|
|
177
|
+
|
|
178
|
+
```css
|
|
179
|
+
:root {
|
|
180
|
+
--payman-shimmer-muted: hsl(var(--muted-foreground));
|
|
181
|
+
--payman-shimmer-foreground: hsl(var(--foreground));
|
|
182
|
+
--payman-shimmer-primary: hsl(var(--primary));
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
If these are not set, the widget falls back to neutral gray/blue.
|
|
187
|
+
|
|
156
188
|
## Common Issues
|
|
157
189
|
|
|
158
190
|
### 401 Error: "Workflow stage is not set"
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import React__default from 'react';
|
|
4
2
|
import { UserActionResult, UserActionRequest } from '@paymanai/payman-typescript-ask-sdk';
|
|
5
3
|
export { StreamEvent, StreamOptions, UseVoiceReturn, UserActionRequest, UserActionResult, UserActionState, VoiceCallbacks, VoiceConfig, VoicePermissions, VoiceState, cancelUserAction, generateId, resendUserAction, streamWorkflowEvents, submitUserAction, useChat, useVoice } from '@paymanai/payman-typescript-ask-sdk';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import React__default from 'react';
|
|
6
6
|
import { ClassValue } from 'clsx';
|
|
7
7
|
|
|
8
8
|
type MessageRole = "user" | "assistant" | "system";
|
|
@@ -15,6 +15,8 @@ type StreamingStep = {
|
|
|
15
15
|
status: "in_progress" | "completed" | "error" | "pending";
|
|
16
16
|
timestamp: number;
|
|
17
17
|
elapsedMs?: number;
|
|
18
|
+
thinkingText?: string;
|
|
19
|
+
isThinking?: boolean;
|
|
18
20
|
};
|
|
19
21
|
type ChunkDisplay = {
|
|
20
22
|
id?: string;
|
|
@@ -43,6 +45,10 @@ type MessageDisplay = {
|
|
|
43
45
|
currentExecutingStepId?: string;
|
|
44
46
|
/** Result of user action (OTP approval/rejection) */
|
|
45
47
|
userActionResult?: UserActionResult;
|
|
48
|
+
/** Current thinking block text (live, resets per block) */
|
|
49
|
+
activeThinkingText?: string;
|
|
50
|
+
/** All thinking accumulated across blocks (for post-stream display) */
|
|
51
|
+
allThinkingText?: string;
|
|
46
52
|
};
|
|
47
53
|
type SessionParams = {
|
|
48
54
|
id?: string;
|
|
@@ -192,6 +198,14 @@ type ChatInputProps = {
|
|
|
192
198
|
voiceAvailable?: boolean;
|
|
193
199
|
/** Is currently recording voice */
|
|
194
200
|
isRecording?: boolean;
|
|
201
|
+
/** Recording duration in seconds (for voice bar timer) */
|
|
202
|
+
recordingDurationSeconds?: number;
|
|
203
|
+
/** Confirm voice recording (stop and apply transcript to input) */
|
|
204
|
+
onConfirmRecording?: () => void;
|
|
205
|
+
/** Cancel voice recording (stop without applying transcript) */
|
|
206
|
+
onCancelRecording?: () => void;
|
|
207
|
+
/** Live transcript while recording (used to animate waveforms only when user is talking) */
|
|
208
|
+
transcribedText?: string;
|
|
195
209
|
};
|
|
196
210
|
type MessageListProps = {
|
|
197
211
|
/** Messages to display */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import React__default from 'react';
|
|
4
2
|
import { UserActionResult, UserActionRequest } from '@paymanai/payman-typescript-ask-sdk';
|
|
5
3
|
export { StreamEvent, StreamOptions, UseVoiceReturn, UserActionRequest, UserActionResult, UserActionState, VoiceCallbacks, VoiceConfig, VoicePermissions, VoiceState, cancelUserAction, generateId, resendUserAction, streamWorkflowEvents, submitUserAction, useChat, useVoice } from '@paymanai/payman-typescript-ask-sdk';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import React__default from 'react';
|
|
6
6
|
import { ClassValue } from 'clsx';
|
|
7
7
|
|
|
8
8
|
type MessageRole = "user" | "assistant" | "system";
|
|
@@ -15,6 +15,8 @@ type StreamingStep = {
|
|
|
15
15
|
status: "in_progress" | "completed" | "error" | "pending";
|
|
16
16
|
timestamp: number;
|
|
17
17
|
elapsedMs?: number;
|
|
18
|
+
thinkingText?: string;
|
|
19
|
+
isThinking?: boolean;
|
|
18
20
|
};
|
|
19
21
|
type ChunkDisplay = {
|
|
20
22
|
id?: string;
|
|
@@ -43,6 +45,10 @@ type MessageDisplay = {
|
|
|
43
45
|
currentExecutingStepId?: string;
|
|
44
46
|
/** Result of user action (OTP approval/rejection) */
|
|
45
47
|
userActionResult?: UserActionResult;
|
|
48
|
+
/** Current thinking block text (live, resets per block) */
|
|
49
|
+
activeThinkingText?: string;
|
|
50
|
+
/** All thinking accumulated across blocks (for post-stream display) */
|
|
51
|
+
allThinkingText?: string;
|
|
46
52
|
};
|
|
47
53
|
type SessionParams = {
|
|
48
54
|
id?: string;
|
|
@@ -192,6 +198,14 @@ type ChatInputProps = {
|
|
|
192
198
|
voiceAvailable?: boolean;
|
|
193
199
|
/** Is currently recording voice */
|
|
194
200
|
isRecording?: boolean;
|
|
201
|
+
/** Recording duration in seconds (for voice bar timer) */
|
|
202
|
+
recordingDurationSeconds?: number;
|
|
203
|
+
/** Confirm voice recording (stop and apply transcript to input) */
|
|
204
|
+
onConfirmRecording?: () => void;
|
|
205
|
+
/** Cancel voice recording (stop without applying transcript) */
|
|
206
|
+
onCancelRecording?: () => void;
|
|
207
|
+
/** Live transcript while recording (used to animate waveforms only when user is talking) */
|
|
208
|
+
transcribedText?: string;
|
|
195
209
|
};
|
|
196
210
|
type MessageListProps = {
|
|
197
211
|
/** Messages to display */
|