yaver-feedback-react-native 0.6.0 → 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/src/types.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.
@@ -157,17 +136,33 @@ export interface FeedbackConfig {
157
136
  * Default: false (HTTPS preferred when fingerprint available, HTTP fallback).
158
137
  */
159
138
  requireTLS?: boolean;
139
+ /**
140
+ * Compile-time lockdown of the auth flow. When true the SDK refuses to
141
+ * ever open the user's external browser (Safari / Chrome) or show a
142
+ * 6-char device code. Auth happens only via native Apple Sign-In
143
+ * (`expo-apple-authentication`), in-app OAuth (`expo-web-browser`'s
144
+ * `ASWebAuthenticationSession` with `preferEphemeralSession: true`), or
145
+ * the built-in email/password form. If a required peer dep is missing,
146
+ * `signInWithOAuth`/`signInWithApple` throw instead of silently falling
147
+ * back to a web redirect.
148
+ *
149
+ * Recommended for apps that already embed OAuth on the native side and
150
+ * never want their users to see a `yaver.io` landing page. This is the
151
+ * belt-and-suspenders version of what the SDK has done since 0.6; set
152
+ * it to guarantee future regressions can't quietly reintroduce a
153
+ * browser-hop fallback.
154
+ *
155
+ * Default: false (preserve historical behavior).
156
+ */
157
+ strictNativeAuth?: boolean;
160
158
  }
161
159
 
162
160
  export interface FeedbackBundle {
163
161
  metadata: FeedbackMetadata;
162
+ /** Screen-recording file path, when produced by the "Start Recording" action. */
164
163
  video?: string;
165
- /** Voice annotation audio file path (WAV). Always available when voiceEnabled. */
166
- audio?: string;
167
- /** Transcribed text from voice annotation (if STT/S2S provider is available on agent). */
168
- audioTranscript?: string;
169
164
  screenshots: string[];
170
- /** Captured errors with stack traces, attached automatically when captureErrors is enabled. */
165
+ /** Captured errors with stack traces, attached via attachError / wrapErrorHandler. */
171
166
  errors?: CapturedError[];
172
167
  }
173
168
 
@@ -220,13 +215,6 @@ export interface FeedbackReport {
220
215
  error?: string;
221
216
  }
222
217
 
223
- export interface AgentCommentary {
224
- id: string;
225
- timestamp: string;
226
- message: string;
227
- type: 'observation' | 'suggestion' | 'question' | 'action';
228
- }
229
-
230
218
  export interface FeedbackStreamEvent {
231
219
  type: string;
232
220
  timestamp: string;
package/src/upload.ts CHANGED
@@ -7,16 +7,17 @@ import { FeedbackBundle } from './types';
7
7
  * The agent receives the bundle at POST /feedback with:
8
8
  * - `metadata` (JSON string)
9
9
  * - `screenshot_0`, `screenshot_1`, ... (image files)
10
- * - `audio` (audio file, if present)
11
10
  * - `video` (video file, if present)
12
11
  *
13
- * @returns The feedback report ID from the agent response.
12
+ * Returns the parsed agent response typically `{ ok, id, reportId }`.
13
+ * Callers can inspect `.id` / `.reportId` to drive a follow-up
14
+ * `/feedback/{id}/fix` kick.
14
15
  */
15
16
  export async function uploadFeedback(
16
17
  agentUrl: string,
17
18
  authToken: string,
18
19
  bundle: FeedbackBundle,
19
- ): Promise<string> {
20
+ ): Promise<{ id?: string; reportId?: string; [k: string]: unknown }> {
20
21
  const formData = new FormData();
21
22
 
22
23
  // Attach metadata as JSON
@@ -32,16 +33,6 @@ export async function uploadFeedback(
32
33
  } as any);
33
34
  }
34
35
 
35
- // Attach audio
36
- if (bundle.audio) {
37
- formData.append('audio', {
38
- uri:
39
- Platform.OS === 'android' ? `file://${bundle.audio}` : bundle.audio,
40
- type: 'audio/m4a',
41
- name: 'voice_note.m4a',
42
- } as any);
43
- }
44
-
45
36
  // Attach video
46
37
  if (bundle.video) {
47
38
  formData.append('video', {
@@ -69,6 +60,6 @@ export async function uploadFeedback(
69
60
  );
70
61
  }
71
62
 
72
- const result = await response.json();
73
- return result.id ?? result.reportId ?? 'unknown';
63
+ const result = await response.json().catch(() => ({}));
64
+ return result as { id?: string; reportId?: string; [k: string]: unknown };
74
65
  }