yaver-feedback-react-native 0.9.0 → 0.9.3
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 +102 -1
- package/app.plugin.js +126 -9
- package/dist/AuthOverlay.d.ts +1 -14
- package/dist/AuthOverlay.js +9 -62
- package/dist/BlackBox.js +9 -1
- package/dist/DeployPanel.js +65 -0
- package/dist/Discovery.js +13 -8
- package/dist/DogfoodRuntime.d.ts +124 -0
- package/dist/DogfoodRuntime.js +273 -0
- package/dist/FeedbackModal.js +505 -65
- package/dist/LoginScreen.d.ts +1 -5
- package/dist/LoginScreen.js +2 -6
- package/dist/MachinePickerScreen.d.ts +1 -3
- package/dist/MachinePickerScreen.js +6 -18
- package/dist/P2PClient.d.ts +178 -2
- package/dist/P2PClient.js +493 -3
- package/dist/P2PDogfoodDriver.d.ts +12 -0
- package/dist/P2PDogfoodDriver.js +118 -0
- package/dist/PairDeviceModal.d.ts +2 -3
- package/dist/ShakeDetector.js +2 -0
- package/dist/VibeChatScreen.d.ts +11 -1
- package/dist/VibeChatScreen.js +200 -41
- package/dist/YaverFeedback.d.ts +132 -0
- package/dist/YaverFeedback.js +633 -65
- package/dist/YaverModeBadge.d.ts +22 -0
- package/dist/YaverModeBadge.js +219 -0
- package/dist/__tests__/AuthDevices.test.js +1 -48
- package/dist/__tests__/BlackBox.relayPassword.test.d.ts +1 -0
- package/dist/__tests__/BlackBox.relayPassword.test.js +105 -0
- package/dist/__tests__/BlackBoxAutoStart.test.d.ts +1 -0
- package/dist/__tests__/BlackBoxAutoStart.test.js +91 -0
- package/dist/__tests__/BlackBoxAutoStartColdStart.test.d.ts +1 -0
- package/dist/__tests__/BlackBoxAutoStartColdStart.test.js +156 -0
- package/dist/__tests__/BrowserLaneIcon.test.d.ts +3 -0
- package/dist/__tests__/BrowserLaneIcon.test.js +80 -0
- package/dist/__tests__/DogfoodRuntime.test.d.ts +1 -0
- package/dist/__tests__/DogfoodRuntime.test.js +116 -0
- package/dist/__tests__/P2PClient.test.js +2 -2
- package/dist/__tests__/P2PDogfoodDriver.test.d.ts +1 -0
- package/dist/__tests__/P2PDogfoodDriver.test.js +64 -0
- package/dist/__tests__/ReportIdentity.test.d.ts +25 -0
- package/dist/__tests__/ReportIdentity.test.js +180 -0
- package/dist/__tests__/SDKToken.test.js +1 -1
- package/dist/__tests__/ShakeToggle.test.d.ts +1 -0
- package/dist/__tests__/ShakeToggle.test.js +121 -0
- package/dist/__tests__/YaverFeedback.test.js +13 -3
- package/dist/__tests__/deviceDogfood.test.d.ts +1 -0
- package/dist/__tests__/deviceDogfood.test.js +86 -0
- package/dist/__tests__/dogfoodPolicy.test.d.ts +1 -0
- package/dist/__tests__/dogfoodPolicy.test.js +33 -0
- package/dist/__tests__/pickTargetDevice.test.d.ts +1 -0
- package/dist/__tests__/pickTargetDevice.test.js +89 -0
- package/dist/__tests__/reloadActions.test.d.ts +1 -0
- package/dist/__tests__/reloadActions.test.js +129 -0
- package/dist/__tests__/reloadActionsParity.test.d.ts +1 -0
- package/dist/__tests__/reloadActionsParity.test.js +42 -0
- package/dist/__tests__/types.test.js +5 -5
- package/dist/_core/ansi.d.ts +117 -0
- package/dist/_core/ansi.js +468 -0
- package/dist/_core/ansi.test.d.ts +1 -0
- package/dist/_core/ansi.test.js +225 -0
- package/dist/_core/buildFeedbackPrompt.d.ts +4 -9
- package/dist/_core/buildFeedbackPrompt.js +18 -72
- package/dist/_core/constants.d.ts +19 -6
- package/dist/_core/constants.js +20 -7
- package/dist/_core/device.d.ts +1 -5
- package/dist/_core/device.js +5 -14
- package/dist/_core/endpoints.d.ts +0 -7
- package/dist/_core/endpoints.js +0 -7
- package/dist/_core/index.d.ts +4 -0
- package/dist/_core/index.js +4 -0
- package/dist/_core/remoteless.d.ts +44 -0
- package/dist/_core/remoteless.js +75 -0
- package/dist/_core/trace.d.ts +47 -0
- package/dist/_core/trace.js +38 -0
- package/dist/_core/trace.test.d.ts +1 -0
- package/dist/_core/trace.test.js +60 -0
- package/dist/auth.d.ts +3 -60
- package/dist/auth.js +6 -88
- package/dist/deviceDogfood.d.ts +53 -0
- package/dist/deviceDogfood.js +137 -0
- package/dist/dogfoodPolicy.d.ts +25 -0
- package/dist/dogfoodPolicy.js +24 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.js +33 -7
- package/dist/reloadActions.d.ts +88 -0
- package/dist/reloadActions.js +200 -0
- package/dist/storeShots.d.ts +67 -0
- package/dist/storeShots.js +137 -0
- package/dist/types.d.ts +208 -8
- package/package.json +13 -4
- package/src/AuthOverlay.tsx +20 -106
- package/src/BlackBox.ts +10 -1
- package/src/DeployPanel.tsx +74 -0
- package/src/Discovery.ts +13 -8
- package/src/DogfoodRuntime.ts +373 -0
- package/src/FeedbackModal.tsx +619 -79
- package/src/LoginScreen.tsx +2 -22
- package/src/MachinePickerScreen.tsx +6 -21
- package/src/P2PClient.ts +580 -4
- package/src/P2PDogfoodDriver.ts +132 -0
- package/src/PairDeviceModal.tsx +2 -3
- package/src/ShakeDetector.ts +1 -0
- package/src/VibeChatScreen.tsx +232 -42
- package/src/YaverFeedback.ts +631 -68
- package/src/YaverModeBadge.tsx +234 -0
- package/src/__tests__/AuthDevices.test.ts +1 -52
- package/src/__tests__/BlackBox.relayPassword.test.ts +129 -0
- package/src/__tests__/BlackBoxAutoStart.test.ts +111 -0
- package/src/__tests__/BlackBoxAutoStartColdStart.test.ts +191 -0
- package/src/__tests__/BrowserLaneIcon.test.ts +85 -0
- package/src/__tests__/DogfoodRuntime.test.ts +135 -0
- package/src/__tests__/P2PClient.test.ts +2 -2
- package/src/__tests__/P2PDogfoodDriver.test.ts +80 -0
- package/src/__tests__/ReportIdentity.test.ts +212 -0
- package/src/__tests__/SDKToken.test.ts +1 -1
- package/src/__tests__/ShakeToggle.test.ts +153 -0
- package/src/__tests__/YaverFeedback.test.ts +15 -3
- package/src/__tests__/deviceDogfood.test.ts +77 -0
- package/src/__tests__/dogfoodPolicy.test.ts +34 -0
- package/src/__tests__/pickTargetDevice.test.ts +101 -0
- package/src/__tests__/reloadActions.test.ts +171 -0
- package/src/__tests__/reloadActionsParity.test.ts +49 -0
- package/src/__tests__/types.test.ts +5 -5
- package/src/_core/ansi.test.ts +250 -0
- package/src/_core/ansi.ts +475 -0
- package/src/_core/buildFeedbackPrompt.ts +18 -95
- package/src/_core/constants.ts +20 -6
- package/src/_core/device.ts +5 -16
- package/src/_core/endpoints.ts +0 -7
- package/src/_core/index.ts +4 -0
- package/src/_core/remoteless.ts +110 -0
- package/src/_core/trace.test.ts +58 -0
- package/src/_core/trace.ts +75 -0
- package/src/auth.ts +7 -156
- package/src/deviceDogfood.ts +171 -0
- package/src/dogfoodPolicy.ts +40 -0
- package/src/index.ts +61 -11
- package/src/reloadActions.ts +273 -0
- package/src/storeShots.ts +189 -0
- package/src/types.ts +209 -8
- package/dist/GuestOnboardingScreen.d.ts +0 -8
- package/dist/GuestOnboardingScreen.js +0 -282
- package/src/GuestOnboardingScreen.tsx +0 -307
package/dist/YaverFeedback.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { FeedbackConfig, CapturedError } from './types';
|
|
2
2
|
import { P2PClient } from './P2PClient';
|
|
3
|
+
import { CaptureStoreScreenshotsOptions, CaptureStoreScreenshotsResult } from './storeShots';
|
|
3
4
|
import { QuickIconColorPreset } from './preferences';
|
|
5
|
+
import { type SDKDogfoodStatus } from './dogfoodPolicy';
|
|
6
|
+
import { type DeviceDogfoodOptions, type DeviceDogfoodSession, type DeviceDogfoodState } from './deviceDogfood';
|
|
7
|
+
export interface DogfoodOnboardingOptions extends DeviceDogfoodOptions {
|
|
8
|
+
/** Hint used to preselect the matching project returned by the owner machine. */
|
|
9
|
+
projectName?: string;
|
|
10
|
+
/** Framework fallback when the machine has not classified the project yet. */
|
|
11
|
+
framework?: string;
|
|
12
|
+
}
|
|
4
13
|
/**
|
|
5
14
|
* Main entry point for the Yaver Feedback SDK.
|
|
6
15
|
* Call `YaverFeedback.init()` once at app startup.
|
|
@@ -15,7 +24,26 @@ export declare class YaverFeedback {
|
|
|
15
24
|
* If no `agentUrl` is provided, the SDK will attempt auto-discovery
|
|
16
25
|
* via `YaverDiscovery` on the first `startReport()` call.
|
|
17
26
|
*/
|
|
27
|
+
/** The runtime lane, when running on web inside a Yaver preview WebView. */
|
|
28
|
+
static detectWebLane(): 'browser' | 'webrtc' | null;
|
|
29
|
+
/**
|
|
30
|
+
* Mount a draggable DOM floating "Y" icon for the BROWSER lane (RN-web). It
|
|
31
|
+
* lives in the WebView's document.body (position:fixed, max z-index), so it
|
|
32
|
+
* renders ON TOP of the page inside the WebView and is never occluded by the
|
|
33
|
+
* fullScreen preview modal — the one occlusion-proof affordance on iOS.
|
|
34
|
+
* Tap opens the SDK's existing report flow (the RN FeedbackModal renders in
|
|
35
|
+
* the same WebView DOM, also un-occluded). No-op off-web or off-lane, and
|
|
36
|
+
* idempotent (a re-init reuses the existing node).
|
|
37
|
+
*/
|
|
38
|
+
static mountBrowserLaneIcon(): void;
|
|
18
39
|
static init(cfg: FeedbackConfig): void;
|
|
40
|
+
/**
|
|
41
|
+
* Opt-in global crash handler. This wraps the existing React Native
|
|
42
|
+
* ErrorUtils handler and still calls it, so Sentry/Crashlytics/Bugsnag can
|
|
43
|
+
* remain the system of record. The SDK only uploads a crash report and,
|
|
44
|
+
* when configured, asks the agent to create a fix task.
|
|
45
|
+
*/
|
|
46
|
+
static installCrashHandler(): void;
|
|
19
47
|
/**
|
|
20
48
|
* Run agent discovery in the background.
|
|
21
49
|
* Called automatically from init() when no agentUrl is provided.
|
|
@@ -46,6 +74,29 @@ export declare class YaverFeedback {
|
|
|
46
74
|
static setAuthToken(token: string): Promise<void>;
|
|
47
75
|
/** Returns true once the SDK has a session token it can use. */
|
|
48
76
|
static isAuthed(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* On-device App Store screenshot capture (Engine 2). Walks the routes
|
|
79
|
+
* the host hands us, screenshots each, and uploads to the agent which
|
|
80
|
+
* runs the App Store Connect backend. agentUrl / authToken / relay
|
|
81
|
+
* password default to the SDK's resolved session; the host only has to
|
|
82
|
+
* supply a navigation ref + the ordered route list.
|
|
83
|
+
*
|
|
84
|
+
* YaverFeedback.captureStoreScreenshots({
|
|
85
|
+
* app: 'sfmg',
|
|
86
|
+
* navigationRef,
|
|
87
|
+
* routes: ['/(tabs)/dashboard', '/(tabs)/messages', '/(tabs)/clients'],
|
|
88
|
+
* submit: true,
|
|
89
|
+
* })
|
|
90
|
+
*/
|
|
91
|
+
static captureStoreScreenshots(opts: Omit<CaptureStoreScreenshotsOptions, 'agentUrl' | 'authToken' | 'relayPassword'> & Partial<Pick<CaptureStoreScreenshotsOptions, 'agentUrl' | 'authToken' | 'relayPassword'>>): Promise<CaptureStoreScreenshotsResult>;
|
|
92
|
+
/**
|
|
93
|
+
* Let the mobile app / CLI kick THIS device into self-capturing. Registers
|
|
94
|
+
* a BlackBox command listener that fires captureStoreScreenshots when the
|
|
95
|
+
* agent pushes a `capture_store_shots` command (its `data` may override
|
|
96
|
+
* `submit` / `locale`). Returns an unsubscribe fn. Call once after init,
|
|
97
|
+
* passing the app's navigation ref + the routes to walk.
|
|
98
|
+
*/
|
|
99
|
+
static enableStoreShotsOnCommand(opts: Omit<CaptureStoreScreenshotsOptions, 'agentUrl' | 'authToken' | 'relayPassword'>): () => void;
|
|
49
100
|
/**
|
|
50
101
|
* Request the embedded FeedbackModal to show the login screen. Works by
|
|
51
102
|
* emitting an event the modal listens for — avoids forcing the host app
|
|
@@ -57,6 +108,12 @@ export declare class YaverFeedback {
|
|
|
57
108
|
* an active session; no-ops otherwise.
|
|
58
109
|
*/
|
|
59
110
|
static showMachinePicker(): void;
|
|
111
|
+
/** Begin the reusable host-app Dogfood wizard. Owner OAuth and machine
|
|
112
|
+
* selection intentionally happen before installation enrollment/runtime
|
|
113
|
+
* controls because starting builds or runners is owner-level authority. */
|
|
114
|
+
static beginDogfoodOnboarding(options: DogfoodOnboardingOptions): void;
|
|
115
|
+
static getDogfoodOnboarding(): DogfoodOnboardingOptions | null;
|
|
116
|
+
static clearDogfoodOnboarding(): void;
|
|
60
117
|
/**
|
|
61
118
|
* Update the selected remote device. Resets the cached agent URL so the
|
|
62
119
|
* next `startReport()` (or FloatingButton press) rediscovers against the
|
|
@@ -112,10 +169,64 @@ export declare class YaverFeedback {
|
|
|
112
169
|
* - All methods become active
|
|
113
170
|
*/
|
|
114
171
|
static setEnabled(value: boolean): void;
|
|
172
|
+
/**
|
|
173
|
+
* Turn shake-to-report on or off without tearing the SDK down.
|
|
174
|
+
*
|
|
175
|
+
* `trigger` is read only inside init(), so before this the only ways to
|
|
176
|
+
* stop listening for a shake were setEnabled(false) — which also kills the
|
|
177
|
+
* flight recorder and the agent command channel — or a re-init, which used
|
|
178
|
+
* to stack a duplicate command handler. Neither is what "turn the shake
|
|
179
|
+
* catcher off" should cost.
|
|
180
|
+
*
|
|
181
|
+
* Persists onto config.disableShakeGesture, so a later setEnabled(true)
|
|
182
|
+
* honours it rather than resurrecting the listener.
|
|
183
|
+
*/
|
|
184
|
+
static setShakeEnabled(value: boolean): void;
|
|
185
|
+
/** Whether the shake listener is currently armed. */
|
|
186
|
+
static isShakeEnabled(): boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Bring the shake listener in line with the current config. Idempotent —
|
|
189
|
+
* safe to call whenever `enabled`, `trigger`, or `disableShakeGesture`
|
|
190
|
+
* moves.
|
|
191
|
+
*/
|
|
192
|
+
private static syncShakeDetector;
|
|
193
|
+
private static stopShakeDetector;
|
|
194
|
+
/** Cancel a pending BlackBox auto-start retry chain. */
|
|
195
|
+
private static cancelBlackBoxAutoStart;
|
|
196
|
+
/**
|
|
197
|
+
* Start BlackBox as soon as we have BOTH an agentUrl and a token, polling
|
|
198
|
+
* until then.
|
|
199
|
+
*
|
|
200
|
+
* Both conditions are mandatory and deliberate: starting without a token
|
|
201
|
+
* makes the SSE channel 401 and retry with backoff, which is the tight
|
|
202
|
+
* string-concat + JSON-parse loop that used to SIGSEGV Hermes on iOS 18.3.1
|
|
203
|
+
* during Screenshot & Fix. This only re-checks that same guard over time.
|
|
204
|
+
*
|
|
205
|
+
* Bounded at ~60s: long enough for AsyncStorage hydration plus a Convex
|
|
206
|
+
* discovery round trip on a cold, off-LAN start, short enough that a device
|
|
207
|
+
* whose user never signs in stops polling. Giving up here costs nothing —
|
|
208
|
+
* setAuthToken() and startReport() both reschedule, so signing in later
|
|
209
|
+
* still brings the channel up.
|
|
210
|
+
*/
|
|
211
|
+
private static scheduleBlackBoxAutoStart;
|
|
115
212
|
/** Returns whether the SDK is currently enabled. */
|
|
116
213
|
static isEnabled(): boolean;
|
|
117
214
|
/** Returns the current config, or null if not initialized. */
|
|
118
215
|
static getConfig(): FeedbackConfig | null;
|
|
216
|
+
/** Current third-party SDK mode. Fails closed unless enabled + account match. */
|
|
217
|
+
static getDogfoodStatus(): SDKDogfoodStatus;
|
|
218
|
+
/** One-call, account-free Dogfood bootstrap for third-party apps. On first
|
|
219
|
+
* launch it creates/proves the installation key and returns pending; after
|
|
220
|
+
* owner approval the same call obtains a short-lived scoped Yaver session
|
|
221
|
+
* and enables Dogfood UX without the host app implementing OAuth. */
|
|
222
|
+
static enableDeviceDogfood(options: DeviceDogfoodOptions): Promise<{
|
|
223
|
+
status: DeviceDogfoodState;
|
|
224
|
+
installationId: string;
|
|
225
|
+
session: DeviceDogfoodSession | null;
|
|
226
|
+
}>;
|
|
227
|
+
/** Confirmed by the Y badge/UI before this is called. Reverts this SDK to
|
|
228
|
+
* normal Feedback mode for the remainder of the app run. */
|
|
229
|
+
static exitDogfoodMode(): Promise<void>;
|
|
119
230
|
/** Returns the resolved relay password the SDK is currently using.
|
|
120
231
|
* Empty string when no relay routing is in play (direct LAN agent
|
|
121
232
|
* URLs need no password). Callers attaching it to relay-routed
|
|
@@ -150,11 +261,32 @@ export declare class YaverFeedback {
|
|
|
150
261
|
* // wrapper, and the chain stays intact.
|
|
151
262
|
*/
|
|
152
263
|
static wrapErrorHandler(next?: ((error: Error, isFatal?: boolean) => void) | null): (error: Error, isFatal?: boolean) => void;
|
|
264
|
+
/**
|
|
265
|
+
* Upload a crash-aware feedback bundle. Apps can call this from their own
|
|
266
|
+
* error boundary/global handler. If crashReporting.autoFix is true, the SDK
|
|
267
|
+
* also triggers the agent's feedback-fix task; reload delivery still happens
|
|
268
|
+
* through the existing BlackBox command stream.
|
|
269
|
+
*/
|
|
270
|
+
static reportCrash(error: Error, opts?: {
|
|
271
|
+
isFatal?: boolean;
|
|
272
|
+
source?: 'manual' | 'global-handler';
|
|
273
|
+
metadata?: Record<string, unknown>;
|
|
274
|
+
autoFix?: boolean;
|
|
275
|
+
}): Promise<{
|
|
276
|
+
reportId?: string;
|
|
277
|
+
taskId?: string;
|
|
278
|
+
}>;
|
|
153
279
|
/**
|
|
154
280
|
* Returns the P2P client instance.
|
|
155
281
|
* Available after init if agentUrl is set, or after first successful discovery.
|
|
156
282
|
*/
|
|
157
283
|
static getP2PClient(): P2PClient | null;
|
|
284
|
+
/** Renderer/reload route; intentionally distinct from the coding client. */
|
|
285
|
+
static getRenderP2PClient(): P2PClient | null;
|
|
286
|
+
static getMachineRouting(): {
|
|
287
|
+
codingDeviceId?: string;
|
|
288
|
+
renderDeviceId?: string;
|
|
289
|
+
};
|
|
158
290
|
/**
|
|
159
291
|
* Record a business event. Routes through BlackBox so the agent
|
|
160
292
|
* persists it to the analytics ledger (no dashboards — export
|