yaver-feedback-react-native 0.6.1 → 0.7.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/FeedbackModal.d.ts +0 -9
- package/dist/FeedbackModal.js +265 -473
- package/dist/P2PClient.d.ts +24 -0
- package/dist/P2PClient.js +65 -10
- package/dist/YaverFeedback.d.ts +0 -4
- package/dist/YaverFeedback.js +0 -10
- package/dist/__tests__/YaverFeedback.test.js +2 -35
- package/dist/__tests__/types.test.js +3 -35
- package/dist/capture.d.ts +25 -12
- package/dist/capture.js +73 -34
- package/dist/expo.d.ts +0 -1
- package/dist/expo.js +0 -2
- package/dist/index.d.ts +15 -10
- package/dist/index.js +17 -11
- package/dist/types.d.ts +2 -32
- package/dist/upload.d.ts +8 -3
- package/dist/upload.js +5 -12
- package/package.json +1 -1
- package/src/FeedbackModal.tsx +384 -565
- package/src/P2PClient.ts +66 -12
- package/src/YaverFeedback.ts +0 -12
- package/src/__tests__/YaverFeedback.test.ts +2 -41
- package/src/__tests__/types.test.ts +3 -39
- package/src/capture.ts +73 -37
- package/src/expo.ts +0 -2
- package/src/index.ts +19 -10
- package/src/types.ts +2 -33
- package/src/upload.ts +6 -15
package/dist/types.d.ts
CHANGED
|
@@ -65,27 +65,6 @@ export interface FeedbackConfig {
|
|
|
65
65
|
reportingOnly?: boolean;
|
|
66
66
|
/** Max screen recording duration in seconds. Default: 120 */
|
|
67
67
|
maxRecordingDuration?: number;
|
|
68
|
-
/**
|
|
69
|
-
* Feedback mode:
|
|
70
|
-
* - 'live': stream events to the agent as they happen
|
|
71
|
-
* - 'narrated': record everything, send on stop
|
|
72
|
-
* - 'batch': dump everything at end (default)
|
|
73
|
-
*/
|
|
74
|
-
feedbackMode?: 'live' | 'narrated' | 'batch';
|
|
75
|
-
/**
|
|
76
|
-
* Agent commentary level (0-10).
|
|
77
|
-
* 0 = silent, 10 = agent comments on everything it sees.
|
|
78
|
-
* Only relevant in live mode. Default: 0.
|
|
79
|
-
*/
|
|
80
|
-
agentCommentaryLevel?: number;
|
|
81
|
-
/**
|
|
82
|
-
* Enable voice input for feedback annotations. Always true by default.
|
|
83
|
-
* Audio is recorded on the device and sent to the agent for transcription.
|
|
84
|
-
* Works regardless of whether a speech-to-speech provider is configured —
|
|
85
|
-
* if STT is available on the agent, audio is auto-transcribed; otherwise
|
|
86
|
-
* raw audio is attached to the feedback report.
|
|
87
|
-
*/
|
|
88
|
-
voiceEnabled?: boolean;
|
|
89
68
|
/**
|
|
90
69
|
* Maximum number of captured errors to keep in memory (ring buffer).
|
|
91
70
|
* Oldest errors are evicted when the buffer is full.
|
|
@@ -179,13 +158,10 @@ export interface FeedbackConfig {
|
|
|
179
158
|
}
|
|
180
159
|
export interface FeedbackBundle {
|
|
181
160
|
metadata: FeedbackMetadata;
|
|
161
|
+
/** Screen-recording file path, when produced by the "Start Recording" action. */
|
|
182
162
|
video?: string;
|
|
183
|
-
/** Voice annotation audio file path (WAV). Always available when voiceEnabled. */
|
|
184
|
-
audio?: string;
|
|
185
|
-
/** Transcribed text from voice annotation (if STT/S2S provider is available on agent). */
|
|
186
|
-
audioTranscript?: string;
|
|
187
163
|
screenshots: string[];
|
|
188
|
-
/** Captured errors with stack traces, attached
|
|
164
|
+
/** Captured errors with stack traces, attached via attachError / wrapErrorHandler. */
|
|
189
165
|
errors?: CapturedError[];
|
|
190
166
|
}
|
|
191
167
|
/** An error captured by the SDK's global error handler. */
|
|
@@ -231,12 +207,6 @@ export interface FeedbackReport {
|
|
|
231
207
|
status: 'pending' | 'uploading' | 'uploaded' | 'failed';
|
|
232
208
|
error?: string;
|
|
233
209
|
}
|
|
234
|
-
export interface AgentCommentary {
|
|
235
|
-
id: string;
|
|
236
|
-
timestamp: string;
|
|
237
|
-
message: string;
|
|
238
|
-
type: 'observation' | 'suggestion' | 'question' | 'action';
|
|
239
|
-
}
|
|
240
210
|
export interface FeedbackStreamEvent {
|
|
241
211
|
type: string;
|
|
242
212
|
timestamp: string;
|
package/dist/upload.d.ts
CHANGED
|
@@ -5,9 +5,14 @@ import { FeedbackBundle } from './types';
|
|
|
5
5
|
* The agent receives the bundle at POST /feedback with:
|
|
6
6
|
* - `metadata` (JSON string)
|
|
7
7
|
* - `screenshot_0`, `screenshot_1`, ... (image files)
|
|
8
|
-
* - `audio` (audio file, if present)
|
|
9
8
|
* - `video` (video file, if present)
|
|
10
9
|
*
|
|
11
|
-
*
|
|
10
|
+
* Returns the parsed agent response — typically `{ ok, id, reportId }`.
|
|
11
|
+
* Callers can inspect `.id` / `.reportId` to drive a follow-up
|
|
12
|
+
* `/feedback/{id}/fix` kick.
|
|
12
13
|
*/
|
|
13
|
-
export declare function uploadFeedback(agentUrl: string, authToken: string, bundle: FeedbackBundle): Promise<
|
|
14
|
+
export declare function uploadFeedback(agentUrl: string, authToken: string, bundle: FeedbackBundle): Promise<{
|
|
15
|
+
id?: string;
|
|
16
|
+
reportId?: string;
|
|
17
|
+
[k: string]: unknown;
|
|
18
|
+
}>;
|
package/dist/upload.js
CHANGED
|
@@ -8,10 +8,11 @@ const react_native_1 = require("react-native");
|
|
|
8
8
|
* The agent receives the bundle at POST /feedback with:
|
|
9
9
|
* - `metadata` (JSON string)
|
|
10
10
|
* - `screenshot_0`, `screenshot_1`, ... (image files)
|
|
11
|
-
* - `audio` (audio file, if present)
|
|
12
11
|
* - `video` (video file, if present)
|
|
13
12
|
*
|
|
14
|
-
*
|
|
13
|
+
* Returns the parsed agent response — typically `{ ok, id, reportId }`.
|
|
14
|
+
* Callers can inspect `.id` / `.reportId` to drive a follow-up
|
|
15
|
+
* `/feedback/{id}/fix` kick.
|
|
15
16
|
*/
|
|
16
17
|
async function uploadFeedback(agentUrl, authToken, bundle) {
|
|
17
18
|
const formData = new FormData();
|
|
@@ -26,14 +27,6 @@ async function uploadFeedback(agentUrl, authToken, bundle) {
|
|
|
26
27
|
name: `screenshot_${i}.png`,
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
|
-
// Attach audio
|
|
30
|
-
if (bundle.audio) {
|
|
31
|
-
formData.append('audio', {
|
|
32
|
-
uri: react_native_1.Platform.OS === 'android' ? `file://${bundle.audio}` : bundle.audio,
|
|
33
|
-
type: 'audio/m4a',
|
|
34
|
-
name: 'voice_note.m4a',
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
30
|
// Attach video
|
|
38
31
|
if (bundle.video) {
|
|
39
32
|
formData.append('video', {
|
|
@@ -54,6 +47,6 @@ async function uploadFeedback(agentUrl, authToken, bundle) {
|
|
|
54
47
|
const text = await response.text().catch(() => '');
|
|
55
48
|
throw new Error(`[YaverFeedback] Upload failed (${response.status}): ${text}`);
|
|
56
49
|
}
|
|
57
|
-
const result = await response.json();
|
|
58
|
-
return result
|
|
50
|
+
const result = await response.json().catch(() => ({}));
|
|
51
|
+
return result;
|
|
59
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yaver-feedback-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Visual feedback SDK for Yaver — bug reports, screen recording, voice annotations, and local-first developer workflows",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|