yaver-feedback-react-native 0.8.6 → 0.8.8
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 +24 -1
- package/dist/MachinePickerScreen.js +2 -2
- package/dist/P2PClient.d.ts +18 -1
- package/dist/P2PClient.js +62 -0
- package/dist/YaverFeedback.js +47 -16
- package/dist/__tests__/AuthDevices.test.js +7 -7
- package/dist/__tests__/BlackBox.hotReload.test.d.ts +1 -0
- package/dist/__tests__/BlackBox.hotReload.test.js +204 -0
- package/dist/__tests__/P2PClient.test.js +56 -0
- package/dist/__tests__/YaverFeedback.test.js +9 -0
- package/dist/__tests__/types.test.js +2 -0
- package/dist/_core/constants.d.ts +6 -2
- package/dist/_core/constants.js +6 -2
- package/dist/types.d.ts +84 -0
- package/package.json +1 -1
- package/src/MachinePickerScreen.tsx +2 -2
- package/src/P2PClient.ts +70 -1
- package/src/YaverFeedback.ts +46 -16
- package/src/__tests__/AuthDevices.test.ts +7 -7
- package/src/__tests__/BlackBox.hotReload.test.ts +226 -0
- package/src/__tests__/P2PClient.test.ts +70 -0
- package/src/__tests__/YaverFeedback.test.ts +11 -0
- package/src/__tests__/types.test.ts +2 -0
- package/src/_core/constants.ts +6 -2
- package/src/types.ts +88 -0
package/src/_core/constants.ts
CHANGED
|
@@ -57,9 +57,13 @@ export const DEFAULT_BEACON_UDP_PORT = 19837;
|
|
|
57
57
|
/**
|
|
58
58
|
* How old an agent's last heartbeat can be before the device is
|
|
59
59
|
* considered offline. Mirrors `backend/convex/devices.ts` so
|
|
60
|
-
* Convex + every client agree on the same threshold.
|
|
60
|
+
* Convex + every client agree on the same threshold. The agent
|
|
61
|
+
* heartbeats every 5 min (see `desktop/agent/main.go::heartbeatLoop`),
|
|
62
|
+
* so 6 min tolerates one missed beat + 60 s of jitter without
|
|
63
|
+
* flapping. Sub-minute death detection comes from the P2P bus, not
|
|
64
|
+
* this threshold.
|
|
61
65
|
*/
|
|
62
|
-
export const HEARTBEAT_STALE_MS =
|
|
66
|
+
export const HEARTBEAT_STALE_MS = 360_000;
|
|
63
67
|
|
|
64
68
|
/**
|
|
65
69
|
* How long after the last UDP beacon an agent is still considered
|
package/src/types.ts
CHANGED
|
@@ -20,6 +20,65 @@ export interface RunnerBrowserAuthSession {
|
|
|
20
20
|
completedAt?: number;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
export interface IncidentEvent {
|
|
24
|
+
id: string;
|
|
25
|
+
timestamp: number;
|
|
26
|
+
severity: 'info' | 'warn' | 'error' | 'fatal';
|
|
27
|
+
category: string;
|
|
28
|
+
code: string;
|
|
29
|
+
source: string;
|
|
30
|
+
title: string;
|
|
31
|
+
userMessage: string;
|
|
32
|
+
technicalInfo?: string;
|
|
33
|
+
suggestedAction?: string;
|
|
34
|
+
operationId?: string;
|
|
35
|
+
deviceId?: string;
|
|
36
|
+
projectPath?: string;
|
|
37
|
+
target?: string;
|
|
38
|
+
logsAvailable: boolean;
|
|
39
|
+
logRefs?: string[];
|
|
40
|
+
correlationId?: string;
|
|
41
|
+
recoverable: boolean;
|
|
42
|
+
metadata?: Record<string, unknown>;
|
|
43
|
+
resolved?: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface OperationState {
|
|
47
|
+
id: string;
|
|
48
|
+
kind: string;
|
|
49
|
+
status: string;
|
|
50
|
+
phase?: string;
|
|
51
|
+
message?: string;
|
|
52
|
+
progress?: number;
|
|
53
|
+
deviceId?: string;
|
|
54
|
+
projectPath?: string;
|
|
55
|
+
startedAt: number;
|
|
56
|
+
updatedAt: number;
|
|
57
|
+
incidentIds?: string[];
|
|
58
|
+
metadata?: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface CapabilityTargetReadiness {
|
|
62
|
+
enabled: boolean;
|
|
63
|
+
reasonCode?: string;
|
|
64
|
+
reason?: string;
|
|
65
|
+
suggestedAction?: string;
|
|
66
|
+
notes?: string[];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface CapabilitySnapshot {
|
|
70
|
+
generatedAt: string;
|
|
71
|
+
machine?: Record<string, unknown>;
|
|
72
|
+
infra?: Record<string, unknown>;
|
|
73
|
+
connectivity?: {
|
|
74
|
+
directAvailable?: boolean;
|
|
75
|
+
relayConfigured?: boolean;
|
|
76
|
+
tunnelConfigured?: boolean;
|
|
77
|
+
tailscaleAvailable?: boolean;
|
|
78
|
+
};
|
|
79
|
+
targets: Record<string, CapabilityTargetReadiness>;
|
|
80
|
+
}
|
|
81
|
+
|
|
23
82
|
export interface FeedbackConfig {
|
|
24
83
|
/** URL of the Yaver agent (e.g. "http://192.168.1.10:18080"). If omitted, auto-discovery is used. */
|
|
25
84
|
agentUrl?: string;
|
|
@@ -64,6 +123,35 @@ export interface FeedbackConfig {
|
|
|
64
123
|
preferredDeviceId?: string;
|
|
65
124
|
/** How feedback collection is triggered */
|
|
66
125
|
trigger?: 'shake' | 'floating-button' | 'manual';
|
|
126
|
+
/**
|
|
127
|
+
* Non-default escape hatch for host apps that want the SDK without
|
|
128
|
+
* shake gesture handling. When enabled:
|
|
129
|
+
* - the SDK does not start ShakeDetector
|
|
130
|
+
* - if `quickIcon` was left as `'auto'`/unset, it is promoted to `'always'`
|
|
131
|
+
* - the app should rely on the draggable quick icon or explicit
|
|
132
|
+
* `YaverFeedback.startReport()` calls instead
|
|
133
|
+
*
|
|
134
|
+
* Intended for builds where another surface owns motion / haptics.
|
|
135
|
+
*/
|
|
136
|
+
disableShakeGesture?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Auto-open the BlackBox SSE command channel after init() returns.
|
|
139
|
+
*
|
|
140
|
+
* Default: `true` (0.8.8+). Listens for `reload`, `reload_bundle`,
|
|
141
|
+
* and `status` commands the agent broadcasts after a vibe-coding
|
|
142
|
+
* task commits a fix — drives the auto-reload loop without the host
|
|
143
|
+
* app needing to call `BlackBox.start()` manually.
|
|
144
|
+
*
|
|
145
|
+
* The auto-start is deferred 500ms after init() and gated on having
|
|
146
|
+
* BOTH `agentUrl` and `authToken` resolved, to avoid the iOS 18.3.1
|
|
147
|
+
* rope-string SIGSEGV that the early auto-start in 0.7.6 hit when
|
|
148
|
+
* the agent was in needs-auth mode (tight 401-retry loop in SSE).
|
|
149
|
+
*
|
|
150
|
+
* Set `false` if your host app wants to gate BlackBox start on its
|
|
151
|
+
* own state machine (e.g. only after the user opts into telemetry).
|
|
152
|
+
* Calling `BlackBox.start()` manually is still safe — it's idempotent.
|
|
153
|
+
*/
|
|
154
|
+
autoStartBlackBox?: boolean;
|
|
67
155
|
/**
|
|
68
156
|
* Small tap-to-open icon that floats above the app so the user
|
|
69
157
|
* doesn't have to shake every time they want to open feedback.
|