yaver-feedback-react-native 0.5.2 → 0.5.4

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.
Files changed (50) hide show
  1. package/README.md +8 -0
  2. package/dist/AuthOverlay.d.ts +16 -0
  3. package/dist/AuthOverlay.js +104 -0
  4. package/dist/BlackBox.d.ts +154 -0
  5. package/dist/BlackBox.js +395 -0
  6. package/dist/ConnectionScreen.d.ts +13 -0
  7. package/dist/ConnectionScreen.js +373 -0
  8. package/dist/Discovery.d.ts +59 -0
  9. package/dist/Discovery.js +293 -0
  10. package/dist/FeedbackModal.d.ts +11 -0
  11. package/dist/FeedbackModal.js +623 -0
  12. package/dist/FixReport.d.ts +23 -0
  13. package/dist/FixReport.js +282 -0
  14. package/dist/FloatingButton.d.ts +71 -0
  15. package/dist/FloatingButton.js +778 -0
  16. package/dist/LoginScreen.d.ts +14 -0
  17. package/dist/LoginScreen.js +317 -0
  18. package/dist/MachinePickerScreen.d.ts +19 -0
  19. package/dist/MachinePickerScreen.js +175 -0
  20. package/dist/P2PClient.d.ts +136 -0
  21. package/dist/P2PClient.js +357 -0
  22. package/dist/ShakeDetector.d.ts +39 -0
  23. package/dist/ShakeDetector.js +111 -0
  24. package/dist/YaverFeedback.d.ts +198 -0
  25. package/dist/YaverFeedback.js +679 -0
  26. package/dist/YaverUpdates.d.ts +78 -0
  27. package/dist/YaverUpdates.js +272 -0
  28. package/dist/__tests__/Discovery.test.d.ts +1 -0
  29. package/dist/__tests__/Discovery.test.js +164 -0
  30. package/dist/__tests__/P2PClient.test.d.ts +1 -0
  31. package/dist/__tests__/P2PClient.test.js +169 -0
  32. package/dist/__tests__/SDKToken.test.d.ts +1 -0
  33. package/dist/__tests__/SDKToken.test.js +215 -0
  34. package/dist/__tests__/YaverFeedback.test.d.ts +1 -0
  35. package/dist/__tests__/YaverFeedback.test.js +161 -0
  36. package/dist/__tests__/types.test.d.ts +1 -0
  37. package/dist/__tests__/types.test.js +219 -0
  38. package/dist/auth.d.ts +105 -0
  39. package/dist/auth.js +282 -0
  40. package/dist/capture.d.ts +27 -0
  41. package/dist/capture.js +74 -0
  42. package/dist/expo.d.ts +15 -0
  43. package/dist/expo.js +62 -0
  44. package/dist/index.d.ts +48 -0
  45. package/dist/index.js +80 -0
  46. package/dist/types.d.ts +282 -0
  47. package/dist/types.js +2 -0
  48. package/dist/upload.d.ts +13 -0
  49. package/dist/upload.js +59 -0
  50. package/package.json +10 -6
@@ -0,0 +1,282 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.FixReport = void 0;
37
+ const react_1 = __importStar(require("react"));
38
+ const react_native_1 = require("react-native");
39
+ /**
40
+ * Fix Report viewer — shows a markdown-style list of all fixes
41
+ * applied by the AI agent during a test session.
42
+ *
43
+ * Each fix shows the file, description, and error that triggered it.
44
+ * Tap a fix to expand and see the diff/code snippet.
45
+ *
46
+ * Fixes are NOT committed — they're staged changes the developer
47
+ * can review, accept, or revert.
48
+ */
49
+ const FixReport = ({ session, visible, onClose, color = '#6366f1', }) => {
50
+ const [expanded, setExpanded] = (0, react_1.useState)(new Set());
51
+ const toggleExpand = (id) => {
52
+ setExpanded((prev) => {
53
+ const next = new Set(prev);
54
+ if (next.has(id))
55
+ next.delete(id);
56
+ else
57
+ next.add(id);
58
+ return next;
59
+ });
60
+ };
61
+ const fixes = session?.fixes ?? [];
62
+ return (<react_native_1.Modal visible={visible} animationType="slide" transparent>
63
+ <react_native_1.View style={s.overlay}>
64
+ <react_native_1.View style={s.container}>
65
+ {/* Header */}
66
+ <react_native_1.View style={s.header}>
67
+ <react_native_1.View style={{ flex: 1 }}>
68
+ <react_native_1.Text style={s.title}>Test Report</react_native_1.Text>
69
+ {session && (<react_native_1.Text style={s.subtitle}>
70
+ {session.screensTested}/{session.screensDiscovered} screens
71
+ {' \u00B7 '}
72
+ {session.errorsFound} errors
73
+ {' \u00B7 '}
74
+ {fixes.length} fixes
75
+ </react_native_1.Text>)}
76
+ </react_native_1.View>
77
+ <react_native_1.TouchableOpacity onPress={onClose} style={s.closeBtn}>
78
+ <react_native_1.Text style={s.closeBtnText}>{'\u2715'}</react_native_1.Text>
79
+ </react_native_1.TouchableOpacity>
80
+ </react_native_1.View>
81
+
82
+ {/* Status bar */}
83
+ {session?.active && (<react_native_1.View style={[s.statusBar, { backgroundColor: `${color}20` }]}>
84
+ <react_native_1.View style={[s.statusDot, { backgroundColor: color }]}/>
85
+ <react_native_1.Text style={[s.statusText, { color }]}>
86
+ {session.status || 'Testing...'}
87
+ </react_native_1.Text>
88
+ </react_native_1.View>)}
89
+
90
+ {/* Fix list */}
91
+ <react_native_1.ScrollView style={s.list} contentContainerStyle={s.listContent}>
92
+ {fixes.length === 0 ? (<react_native_1.View style={s.empty}>
93
+ <react_native_1.Text style={s.emptyText}>
94
+ {session?.active
95
+ ? 'Agent is exploring the app...'
96
+ : 'No fixes yet. Start a test session.'}
97
+ </react_native_1.Text>
98
+ </react_native_1.View>) : (fixes.map((fix, i) => (<FixItem key={fix.id} fix={fix} index={i + 1} expanded={expanded.has(fix.id)} onToggle={() => toggleExpand(fix.id)} color={color}/>)))}
99
+ </react_native_1.ScrollView>
100
+
101
+ {/* Summary footer */}
102
+ {fixes.length > 0 && !session?.active && (<react_native_1.View style={s.footer}>
103
+ <react_native_1.Text style={s.footerText}>
104
+ {fixes.filter((f) => f.verified).length}/{fixes.length} verified
105
+ {' \u00B7 '}
106
+ Changes are staged, not committed.
107
+ </react_native_1.Text>
108
+ </react_native_1.View>)}
109
+ </react_native_1.View>
110
+ </react_native_1.View>
111
+ </react_native_1.Modal>);
112
+ };
113
+ exports.FixReport = FixReport;
114
+ function FixItem({ fix, index, expanded, onToggle, color, }) {
115
+ return (<react_native_1.Pressable onPress={onToggle} style={s.fixItem}>
116
+ {/* Fix header */}
117
+ <react_native_1.View style={s.fixHeader}>
118
+ <react_native_1.View style={[s.fixIndex, { backgroundColor: fix.verified ? '#22c55e20' : `${color}20` }]}>
119
+ <react_native_1.Text style={[s.fixIndexText, { color: fix.verified ? '#22c55e' : color }]}>
120
+ {fix.verified ? '\u2713' : index}
121
+ </react_native_1.Text>
122
+ </react_native_1.View>
123
+ <react_native_1.View style={{ flex: 1 }}>
124
+ <react_native_1.Text style={s.fixDesc}>{fix.description}</react_native_1.Text>
125
+ <react_native_1.Text style={s.fixFile}>
126
+ {fix.file}{fix.line ? `:${fix.line}` : ''}
127
+ </react_native_1.Text>
128
+ </react_native_1.View>
129
+ <react_native_1.Text style={s.expandIcon}>{expanded ? '\u25B2' : '\u25BC'}</react_native_1.Text>
130
+ </react_native_1.View>
131
+
132
+ {/* Error that triggered fix */}
133
+ {fix.error && (<react_native_1.View style={s.fixError}>
134
+ <react_native_1.Text style={s.fixErrorText}>{fix.error}</react_native_1.Text>
135
+ </react_native_1.View>)}
136
+
137
+ {/* Expanded: diff/code */}
138
+ {expanded && fix.diff && (<react_native_1.View style={s.diffBlock}>
139
+ <react_native_1.Text style={s.diffText}>{fix.diff}</react_native_1.Text>
140
+ </react_native_1.View>)}
141
+ </react_native_1.Pressable>);
142
+ }
143
+ const s = react_native_1.StyleSheet.create({
144
+ overlay: {
145
+ flex: 1,
146
+ backgroundColor: 'rgba(0,0,0,0.8)',
147
+ justifyContent: 'flex-end',
148
+ },
149
+ container: {
150
+ backgroundColor: '#0a0a0a',
151
+ borderTopLeftRadius: 20,
152
+ borderTopRightRadius: 20,
153
+ maxHeight: '85%',
154
+ borderWidth: 1,
155
+ borderColor: '#1a1a1a',
156
+ borderBottomWidth: 0,
157
+ },
158
+ header: {
159
+ flexDirection: 'row',
160
+ alignItems: 'center',
161
+ padding: 16,
162
+ borderBottomWidth: 1,
163
+ borderBottomColor: '#1a1a1a',
164
+ },
165
+ title: {
166
+ fontSize: 16,
167
+ fontWeight: '700',
168
+ color: '#e5e5e5',
169
+ fontFamily: 'Courier',
170
+ },
171
+ subtitle: {
172
+ fontSize: 11,
173
+ color: '#666',
174
+ marginTop: 2,
175
+ fontFamily: 'Courier',
176
+ },
177
+ closeBtn: { padding: 8 },
178
+ closeBtnText: { color: '#666', fontSize: 16 },
179
+ statusBar: {
180
+ flexDirection: 'row',
181
+ alignItems: 'center',
182
+ paddingHorizontal: 16,
183
+ paddingVertical: 8,
184
+ gap: 8,
185
+ },
186
+ statusDot: {
187
+ width: 6,
188
+ height: 6,
189
+ borderRadius: 3,
190
+ },
191
+ statusText: {
192
+ fontSize: 11,
193
+ fontWeight: '600',
194
+ fontFamily: 'Courier',
195
+ },
196
+ list: { flex: 1 },
197
+ listContent: { padding: 12, gap: 8 },
198
+ empty: {
199
+ padding: 32,
200
+ alignItems: 'center',
201
+ },
202
+ emptyText: {
203
+ color: '#444',
204
+ fontSize: 13,
205
+ fontFamily: 'Courier',
206
+ },
207
+ fixItem: {
208
+ backgroundColor: '#111',
209
+ borderRadius: 10,
210
+ padding: 12,
211
+ borderWidth: 1,
212
+ borderColor: '#1a1a1a',
213
+ },
214
+ fixHeader: {
215
+ flexDirection: 'row',
216
+ alignItems: 'center',
217
+ gap: 10,
218
+ },
219
+ fixIndex: {
220
+ width: 24,
221
+ height: 24,
222
+ borderRadius: 12,
223
+ alignItems: 'center',
224
+ justifyContent: 'center',
225
+ },
226
+ fixIndexText: {
227
+ fontSize: 11,
228
+ fontWeight: '700',
229
+ fontFamily: 'Courier',
230
+ },
231
+ fixDesc: {
232
+ fontSize: 12,
233
+ color: '#e5e5e5',
234
+ fontWeight: '600',
235
+ },
236
+ fixFile: {
237
+ fontSize: 10,
238
+ color: '#666',
239
+ fontFamily: 'Courier',
240
+ marginTop: 2,
241
+ },
242
+ expandIcon: {
243
+ color: '#444',
244
+ fontSize: 10,
245
+ },
246
+ fixError: {
247
+ marginTop: 8,
248
+ backgroundColor: '#f8717110',
249
+ borderRadius: 6,
250
+ padding: 8,
251
+ },
252
+ fixErrorText: {
253
+ fontSize: 10,
254
+ color: '#f87171',
255
+ fontFamily: 'Courier',
256
+ },
257
+ diffBlock: {
258
+ marginTop: 8,
259
+ backgroundColor: '#0d0d0d',
260
+ borderRadius: 6,
261
+ padding: 10,
262
+ borderWidth: 1,
263
+ borderColor: '#1a1a1a',
264
+ },
265
+ diffText: {
266
+ fontSize: 10,
267
+ color: '#22c55e',
268
+ fontFamily: 'Courier',
269
+ lineHeight: 16,
270
+ },
271
+ footer: {
272
+ borderTopWidth: 1,
273
+ borderTopColor: '#1a1a1a',
274
+ padding: 12,
275
+ alignItems: 'center',
276
+ },
277
+ footerText: {
278
+ fontSize: 10,
279
+ color: '#666',
280
+ fontFamily: 'Courier',
281
+ },
282
+ });
@@ -0,0 +1,71 @@
1
+ import React from 'react';
2
+ export interface FloatingButtonProps {
3
+ /** Called when user taps the button (opens inline console by default). */
4
+ onPress?: () => void;
5
+ /** Initial position. Default: top-left corner, below status bar. */
6
+ initialPosition?: {
7
+ x: number;
8
+ y: number;
9
+ };
10
+ /** Button size in pixels. Default: 40. */
11
+ size?: number;
12
+ /**
13
+ * Button background color. Default: "#6366f1" (indigo).
14
+ * Use a distinctive color so the debug button is never confused
15
+ * with your app's UI. Suggested: pink, purple, lime.
16
+ */
17
+ color?: string;
18
+ /** Show connection status dot on the button. Default: true. */
19
+ showStatusDot?: boolean;
20
+ /**
21
+ * Style preset:
22
+ * - "terminal" (default) — dark terminal look with >_ icon, monospace font, pink accents
23
+ * - "minimal" — small circle, single-letter icon, clean panel
24
+ */
25
+ style?: 'terminal' | 'minimal';
26
+ /** Custom icon text. Default: "y". */
27
+ icon?: string;
28
+ /** Agent base URL (auto-detected from YaverFeedback config if omitted). */
29
+ agentUrl?: string;
30
+ /** Auth token (auto-detected from YaverFeedback config if omitted). */
31
+ authToken?: string;
32
+ /**
33
+ * Health check interval in ms. The button polls the agent's /health
34
+ * endpoint to show connection status. Default: 5000. Set to 0 to disable.
35
+ */
36
+ healthCheckInterval?: number;
37
+ /**
38
+ * Background color of the debug console panel.
39
+ * Default: "#2d2d2d" (dark gray). Override to match your app's theme.
40
+ */
41
+ panelBackgroundColor?: string;
42
+ }
43
+ /**
44
+ * Draggable debug console button for the Yaver Feedback SDK.
45
+ *
46
+ * Drop this into any React Native app for an instant debug console
47
+ * with message back-and-forth, hot reload, and build+deploy:
48
+ *
49
+ * ```tsx
50
+ * import { FloatingButton } from '@yaver/feedback-react-native';
51
+ *
52
+ * function App() {
53
+ * return (
54
+ * <>
55
+ * <YourApp />
56
+ * <FloatingButton />
57
+ * </>
58
+ * );
59
+ * }
60
+ * ```
61
+ *
62
+ * Features:
63
+ * - **Tap** → expand terminal-style console panel
64
+ * - **Drag** → reposition anywhere
65
+ * - **Type** → send tasks to the AI agent, see responses
66
+ * - **Hot Reload** → trigger hot reload
67
+ * - **Build iOS** → build + auto-submit to TestFlight
68
+ * - **Build Android** → build + auto-submit to Play Store
69
+ * - **"quit"** → disable the SDK
70
+ */
71
+ export declare const FloatingButton: React.FC<FloatingButtonProps>;