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.
Files changed (144) hide show
  1. package/README.md +102 -1
  2. package/app.plugin.js +126 -9
  3. package/dist/AuthOverlay.d.ts +1 -14
  4. package/dist/AuthOverlay.js +9 -62
  5. package/dist/BlackBox.js +9 -1
  6. package/dist/DeployPanel.js +65 -0
  7. package/dist/Discovery.js +13 -8
  8. package/dist/DogfoodRuntime.d.ts +124 -0
  9. package/dist/DogfoodRuntime.js +273 -0
  10. package/dist/FeedbackModal.js +505 -65
  11. package/dist/LoginScreen.d.ts +1 -5
  12. package/dist/LoginScreen.js +2 -6
  13. package/dist/MachinePickerScreen.d.ts +1 -3
  14. package/dist/MachinePickerScreen.js +6 -18
  15. package/dist/P2PClient.d.ts +178 -2
  16. package/dist/P2PClient.js +493 -3
  17. package/dist/P2PDogfoodDriver.d.ts +12 -0
  18. package/dist/P2PDogfoodDriver.js +118 -0
  19. package/dist/PairDeviceModal.d.ts +2 -3
  20. package/dist/ShakeDetector.js +2 -0
  21. package/dist/VibeChatScreen.d.ts +11 -1
  22. package/dist/VibeChatScreen.js +200 -41
  23. package/dist/YaverFeedback.d.ts +132 -0
  24. package/dist/YaverFeedback.js +633 -65
  25. package/dist/YaverModeBadge.d.ts +22 -0
  26. package/dist/YaverModeBadge.js +219 -0
  27. package/dist/__tests__/AuthDevices.test.js +1 -48
  28. package/dist/__tests__/BlackBox.relayPassword.test.d.ts +1 -0
  29. package/dist/__tests__/BlackBox.relayPassword.test.js +105 -0
  30. package/dist/__tests__/BlackBoxAutoStart.test.d.ts +1 -0
  31. package/dist/__tests__/BlackBoxAutoStart.test.js +91 -0
  32. package/dist/__tests__/BlackBoxAutoStartColdStart.test.d.ts +1 -0
  33. package/dist/__tests__/BlackBoxAutoStartColdStart.test.js +156 -0
  34. package/dist/__tests__/BrowserLaneIcon.test.d.ts +3 -0
  35. package/dist/__tests__/BrowserLaneIcon.test.js +80 -0
  36. package/dist/__tests__/DogfoodRuntime.test.d.ts +1 -0
  37. package/dist/__tests__/DogfoodRuntime.test.js +116 -0
  38. package/dist/__tests__/P2PClient.test.js +2 -2
  39. package/dist/__tests__/P2PDogfoodDriver.test.d.ts +1 -0
  40. package/dist/__tests__/P2PDogfoodDriver.test.js +64 -0
  41. package/dist/__tests__/ReportIdentity.test.d.ts +25 -0
  42. package/dist/__tests__/ReportIdentity.test.js +180 -0
  43. package/dist/__tests__/SDKToken.test.js +1 -1
  44. package/dist/__tests__/ShakeToggle.test.d.ts +1 -0
  45. package/dist/__tests__/ShakeToggle.test.js +121 -0
  46. package/dist/__tests__/YaverFeedback.test.js +13 -3
  47. package/dist/__tests__/deviceDogfood.test.d.ts +1 -0
  48. package/dist/__tests__/deviceDogfood.test.js +86 -0
  49. package/dist/__tests__/dogfoodPolicy.test.d.ts +1 -0
  50. package/dist/__tests__/dogfoodPolicy.test.js +33 -0
  51. package/dist/__tests__/pickTargetDevice.test.d.ts +1 -0
  52. package/dist/__tests__/pickTargetDevice.test.js +89 -0
  53. package/dist/__tests__/reloadActions.test.d.ts +1 -0
  54. package/dist/__tests__/reloadActions.test.js +129 -0
  55. package/dist/__tests__/reloadActionsParity.test.d.ts +1 -0
  56. package/dist/__tests__/reloadActionsParity.test.js +42 -0
  57. package/dist/__tests__/types.test.js +5 -5
  58. package/dist/_core/ansi.d.ts +117 -0
  59. package/dist/_core/ansi.js +468 -0
  60. package/dist/_core/ansi.test.d.ts +1 -0
  61. package/dist/_core/ansi.test.js +225 -0
  62. package/dist/_core/buildFeedbackPrompt.d.ts +4 -9
  63. package/dist/_core/buildFeedbackPrompt.js +18 -72
  64. package/dist/_core/constants.d.ts +19 -6
  65. package/dist/_core/constants.js +20 -7
  66. package/dist/_core/device.d.ts +1 -5
  67. package/dist/_core/device.js +5 -14
  68. package/dist/_core/endpoints.d.ts +0 -7
  69. package/dist/_core/endpoints.js +0 -7
  70. package/dist/_core/index.d.ts +4 -0
  71. package/dist/_core/index.js +4 -0
  72. package/dist/_core/remoteless.d.ts +44 -0
  73. package/dist/_core/remoteless.js +75 -0
  74. package/dist/_core/trace.d.ts +47 -0
  75. package/dist/_core/trace.js +38 -0
  76. package/dist/_core/trace.test.d.ts +1 -0
  77. package/dist/_core/trace.test.js +60 -0
  78. package/dist/auth.d.ts +3 -60
  79. package/dist/auth.js +6 -88
  80. package/dist/deviceDogfood.d.ts +53 -0
  81. package/dist/deviceDogfood.js +137 -0
  82. package/dist/dogfoodPolicy.d.ts +25 -0
  83. package/dist/dogfoodPolicy.js +24 -0
  84. package/dist/index.d.ts +17 -4
  85. package/dist/index.js +33 -7
  86. package/dist/reloadActions.d.ts +88 -0
  87. package/dist/reloadActions.js +200 -0
  88. package/dist/storeShots.d.ts +67 -0
  89. package/dist/storeShots.js +137 -0
  90. package/dist/types.d.ts +208 -8
  91. package/package.json +13 -4
  92. package/src/AuthOverlay.tsx +20 -106
  93. package/src/BlackBox.ts +10 -1
  94. package/src/DeployPanel.tsx +74 -0
  95. package/src/Discovery.ts +13 -8
  96. package/src/DogfoodRuntime.ts +373 -0
  97. package/src/FeedbackModal.tsx +619 -79
  98. package/src/LoginScreen.tsx +2 -22
  99. package/src/MachinePickerScreen.tsx +6 -21
  100. package/src/P2PClient.ts +580 -4
  101. package/src/P2PDogfoodDriver.ts +132 -0
  102. package/src/PairDeviceModal.tsx +2 -3
  103. package/src/ShakeDetector.ts +1 -0
  104. package/src/VibeChatScreen.tsx +232 -42
  105. package/src/YaverFeedback.ts +631 -68
  106. package/src/YaverModeBadge.tsx +234 -0
  107. package/src/__tests__/AuthDevices.test.ts +1 -52
  108. package/src/__tests__/BlackBox.relayPassword.test.ts +129 -0
  109. package/src/__tests__/BlackBoxAutoStart.test.ts +111 -0
  110. package/src/__tests__/BlackBoxAutoStartColdStart.test.ts +191 -0
  111. package/src/__tests__/BrowserLaneIcon.test.ts +85 -0
  112. package/src/__tests__/DogfoodRuntime.test.ts +135 -0
  113. package/src/__tests__/P2PClient.test.ts +2 -2
  114. package/src/__tests__/P2PDogfoodDriver.test.ts +80 -0
  115. package/src/__tests__/ReportIdentity.test.ts +212 -0
  116. package/src/__tests__/SDKToken.test.ts +1 -1
  117. package/src/__tests__/ShakeToggle.test.ts +153 -0
  118. package/src/__tests__/YaverFeedback.test.ts +15 -3
  119. package/src/__tests__/deviceDogfood.test.ts +77 -0
  120. package/src/__tests__/dogfoodPolicy.test.ts +34 -0
  121. package/src/__tests__/pickTargetDevice.test.ts +101 -0
  122. package/src/__tests__/reloadActions.test.ts +171 -0
  123. package/src/__tests__/reloadActionsParity.test.ts +49 -0
  124. package/src/__tests__/types.test.ts +5 -5
  125. package/src/_core/ansi.test.ts +250 -0
  126. package/src/_core/ansi.ts +475 -0
  127. package/src/_core/buildFeedbackPrompt.ts +18 -95
  128. package/src/_core/constants.ts +20 -6
  129. package/src/_core/device.ts +5 -16
  130. package/src/_core/endpoints.ts +0 -7
  131. package/src/_core/index.ts +4 -0
  132. package/src/_core/remoteless.ts +110 -0
  133. package/src/_core/trace.test.ts +58 -0
  134. package/src/_core/trace.ts +75 -0
  135. package/src/auth.ts +7 -156
  136. package/src/deviceDogfood.ts +171 -0
  137. package/src/dogfoodPolicy.ts +40 -0
  138. package/src/index.ts +61 -11
  139. package/src/reloadActions.ts +273 -0
  140. package/src/storeShots.ts +189 -0
  141. package/src/types.ts +209 -8
  142. package/dist/GuestOnboardingScreen.d.ts +0 -8
  143. package/dist/GuestOnboardingScreen.js +0 -282
  144. package/src/GuestOnboardingScreen.tsx +0 -307
@@ -0,0 +1,25 @@
1
+ export interface SDKDogfoodConfig {
2
+ /** Explicit opt-in. Omitted/false keeps the normal Feedback SDK. */
3
+ enabled?: boolean;
4
+ /** App-account IDs allowed to enter Dogfood. Public identifiers, not secrets. */
5
+ accountIds?: string[];
6
+ /** The third-party app's currently authenticated account ID. */
7
+ currentAccountId?: string;
8
+ /** Account-free installation identity resolved by YaverDeviceDogfood. */
9
+ appId?: string;
10
+ installationId?: string;
11
+ installationStatus?: 'pending' | 'active' | 'cancelled' | 'revoked' | 'superseded';
12
+ /** Called after the user confirms Exit Dogfood mode. */
13
+ onExit?: () => void | Promise<void>;
14
+ /** Optional app label shown beside Dogfood mode. */
15
+ label?: string;
16
+ }
17
+ export interface SDKDogfoodStatus {
18
+ active: boolean;
19
+ code: 'SDK_DOGFOOD_ACTIVE' | 'SDK_DOGFOOD_DISABLED' | 'SDK_DOGFOOD_ACCOUNT_REQUIRED' | 'SDK_DOGFOOD_ACCOUNT_NOT_ALLOWED' | 'SDK_DOGFOOD_INSTALLATION_REQUIRED' | 'SDK_DOGFOOD_INSTALLATION_NOT_ACTIVE';
20
+ accountId?: string;
21
+ label: string;
22
+ }
23
+ /** Pure, fail-closed account gate shared by init, the Y badge and tests.
24
+ * This controls SDK UX only; every task/reload still requires Yaver auth. */
25
+ export declare function resolveSDKDogfood(config?: SDKDogfoodConfig | null): SDKDogfoodStatus;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveSDKDogfood = resolveSDKDogfood;
4
+ /** Pure, fail-closed account gate shared by init, the Y badge and tests.
5
+ * This controls SDK UX only; every task/reload still requires Yaver auth. */
6
+ function resolveSDKDogfood(config) {
7
+ const label = String(config?.label || 'Dogfood').trim() || 'Dogfood';
8
+ if (config?.enabled !== true)
9
+ return { active: false, code: 'SDK_DOGFOOD_DISABLED', label };
10
+ if (config.appId) {
11
+ if (!config.installationId)
12
+ return { active: false, code: 'SDK_DOGFOOD_INSTALLATION_REQUIRED', label };
13
+ if (config.installationStatus !== 'active')
14
+ return { active: false, code: 'SDK_DOGFOOD_INSTALLATION_NOT_ACTIVE', label };
15
+ return { active: true, code: 'SDK_DOGFOOD_ACTIVE', accountId: config.installationId, label };
16
+ }
17
+ const accountId = String(config.currentAccountId || '').trim();
18
+ if (!accountId)
19
+ return { active: false, code: 'SDK_DOGFOOD_ACCOUNT_REQUIRED', label };
20
+ const allowed = new Set((config.accountIds || []).map((id) => String(id).trim()).filter(Boolean));
21
+ if (!allowed.has(accountId))
22
+ return { active: false, code: 'SDK_DOGFOOD_ACCOUNT_NOT_ALLOWED', accountId, label };
23
+ return { active: true, code: 'SDK_DOGFOOD_ACTIVE', accountId, label };
24
+ }
package/dist/index.d.ts CHANGED
@@ -28,31 +28,44 @@
28
28
  * ```
29
29
  */
30
30
  export { YaverFeedback } from './YaverFeedback';
31
+ export type { DogfoodOnboardingOptions } from './YaverFeedback';
32
+ export { captureStoreScreenshots } from './storeShots';
33
+ export type { CaptureStoreScreenshotsOptions, CaptureStoreScreenshotsResult, StoreShotFrame, } from './storeShots';
31
34
  export { BlackBox } from './BlackBox';
32
35
  export { YaverUpdates } from './YaverUpdates';
33
36
  export type { YaverUpdatesConfig, PendingUpdate } from './YaverUpdates';
34
37
  export { initExpo } from './expo';
35
38
  export { YaverDiscovery } from './Discovery';
36
39
  export { P2PClient } from './P2PClient';
40
+ export type { DogfoodDevEvent, DogfoodDevServerStatus, DogfoodRemoteRuntimeCapabilities, DogfoodRemoteRuntimeSession, DogfoodRemoteRuntimeTarget, } from './P2PClient';
41
+ export { createP2PDogfoodDriver, type P2PDogfoodDriverOptions } from './P2PDogfoodDriver';
42
+ export { reloadActions, reloadRequest, reloadFrameworkFamily, describeReloadFailure, RELOAD_PATH, RELOAD_APP_PATH, } from './reloadActions';
43
+ export type { ReloadAction, ReloadActionId, ReloadActionsOptions, ReloadWireMode, DevServerSnapshot, } from './reloadActions';
37
44
  export { YaverConnectionScreen } from './ConnectionScreen';
38
45
  export { YaverLoginScreen } from './LoginScreen';
39
46
  export type { YaverLoginScreenProps } from './LoginScreen';
40
47
  export { YaverMachinePickerScreen } from './MachinePickerScreen';
41
48
  export type { YaverMachinePickerProps } from './MachinePickerScreen';
42
- export { YaverGuestOnboardingScreen } from './GuestOnboardingScreen';
43
- export type { YaverGuestOnboardingScreenProps } from './GuestOnboardingScreen';
44
49
  export { PairDeviceModal } from './PairDeviceModal';
45
50
  export type { PairDeviceModalProps } from './PairDeviceModal';
46
51
  export { AuthOverlay } from './AuthOverlay';
47
52
  export { ShakeDetector } from './ShakeDetector';
48
53
  export { FloatingButton } from './FloatingButton';
54
+ export { YaverModeBadge, hideYaverModeBadge, showYaverModeBadge, isYaverModeBadgeHidden } from './YaverModeBadge';
55
+ export type { YaverModeBadgeProps } from './YaverModeBadge';
56
+ export { resolveSDKDogfood } from './dogfoodPolicy';
57
+ export type { SDKDogfoodConfig, SDKDogfoodStatus } from './dogfoodPolicy';
58
+ export { YaverDeviceDogfood } from './deviceDogfood';
59
+ export type { DeviceDogfoodOptions, DeviceDogfoodSession, DeviceDogfoodState } from './deviceDogfood';
60
+ export { DogfoodController, DogfoodRuntimeError, defaultDogfoodLane, dogfoodLaneOptions, dogfoodLogLinesFromDevEvent, runtimeLogLinesFromDevEvent, validateDogfoodProject, } from './DogfoodRuntime';
61
+ export type { DogfoodControllerOptions, DogfoodDriver, DogfoodFailure, DogfoodLane, DogfoodLaneOption, DogfoodLogLine, DogfoodPhase, DogfoodProject, DogfoodResult, DogfoodRunContext, DogfoodSnapshot, } from './DogfoodRuntime';
49
62
  export { FeedbackModal } from './FeedbackModal';
50
63
  export { QuickActionIcon } from './QuickActionIcon';
51
64
  export type { QuickActionIconProps } from './QuickActionIcon';
52
65
  export { FixReport } from './FixReport';
53
66
  export { getQuickIconDisabled, setQuickIconDisabled, clearQuickIconDisabled, } from './preferences';
54
- export { configureAuthEndpoints, getConvexSiteUrl, getWebBaseUrl, getToken, saveToken, clearToken, getUser, saveUser, getSelectedDeviceId, saveSelectedDeviceId, clearSelectedDeviceId, validateToken, signInWithApple, signInWithOAuth, signupWithEmail, loginWithEmail, listReachableDevices, fetchGuestHosts, findInviteByCode, acceptGuestByCode, acceptGuestInvitation, DEFAULT_CONVEX_SITE_URL, DEFAULT_WEB_BASE_URL, DEFAULT_OAUTH_REDIRECT, } from './auth';
55
- export type { OAuthProvider, User, RemoteDevice, DeviceList, GuestInvitation, ActiveGuestHost, GuestHostsResponse, InvitationHostDevice, InvitationPreview, } from './auth';
67
+ export { configureAuthEndpoints, getConvexSiteUrl, getWebBaseUrl, getToken, saveToken, clearToken, getUser, saveUser, getSelectedDeviceId, saveSelectedDeviceId, clearSelectedDeviceId, validateToken, signInWithApple, signInWithOAuth, signupWithEmail, loginWithEmail, listReachableDevices, DEFAULT_CONVEX_SITE_URL, DEFAULT_WEB_BASE_URL, DEFAULT_OAUTH_REDIRECT, } from './auth';
68
+ export type { OAuthProvider, User, RemoteDevice, DeviceList, } from './auth';
56
69
  export { captureScreenshot, pickFeedbackFile, startVideoRecording, stopVideoRecording, isVideoRecording, } from './capture';
57
70
  export { uploadFeedback } from './upload';
58
71
  export type { FeedbackConfig, FeedbackBundle, FeedbackMetadata, DeviceInfo, AppInfo, TimelineEvent, FeedbackReport, FeedbackStreamEvent, VoiceCapability, CapturedError, TestFix, TestSession, } from './types';
package/dist/index.js CHANGED
@@ -29,9 +29,12 @@
29
29
  * ```
30
30
  */
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.uploadFeedback = exports.isVideoRecording = exports.stopVideoRecording = exports.startVideoRecording = exports.pickFeedbackFile = exports.captureScreenshot = exports.DEFAULT_OAUTH_REDIRECT = exports.DEFAULT_WEB_BASE_URL = exports.DEFAULT_CONVEX_SITE_URL = exports.acceptGuestInvitation = exports.acceptGuestByCode = exports.findInviteByCode = exports.fetchGuestHosts = exports.listReachableDevices = exports.loginWithEmail = exports.signupWithEmail = exports.signInWithOAuth = exports.signInWithApple = exports.validateToken = exports.clearSelectedDeviceId = exports.saveSelectedDeviceId = exports.getSelectedDeviceId = exports.saveUser = exports.getUser = exports.clearToken = exports.saveToken = exports.getToken = exports.getWebBaseUrl = exports.getConvexSiteUrl = exports.configureAuthEndpoints = exports.clearQuickIconDisabled = exports.setQuickIconDisabled = exports.getQuickIconDisabled = exports.FixReport = exports.QuickActionIcon = exports.FeedbackModal = exports.FloatingButton = exports.ShakeDetector = exports.AuthOverlay = exports.PairDeviceModal = exports.YaverGuestOnboardingScreen = exports.YaverMachinePickerScreen = exports.YaverLoginScreen = exports.YaverConnectionScreen = exports.P2PClient = exports.YaverDiscovery = exports.initExpo = exports.YaverUpdates = exports.BlackBox = exports.YaverFeedback = void 0;
32
+ exports.saveSelectedDeviceId = exports.getSelectedDeviceId = exports.saveUser = exports.getUser = exports.clearToken = exports.saveToken = exports.getToken = exports.getWebBaseUrl = exports.getConvexSiteUrl = exports.configureAuthEndpoints = exports.clearQuickIconDisabled = exports.setQuickIconDisabled = exports.getQuickIconDisabled = exports.FixReport = exports.QuickActionIcon = exports.FeedbackModal = exports.validateDogfoodProject = exports.runtimeLogLinesFromDevEvent = exports.dogfoodLogLinesFromDevEvent = exports.dogfoodLaneOptions = exports.defaultDogfoodLane = exports.DogfoodRuntimeError = exports.DogfoodController = exports.YaverDeviceDogfood = exports.resolveSDKDogfood = exports.isYaverModeBadgeHidden = exports.showYaverModeBadge = exports.hideYaverModeBadge = exports.YaverModeBadge = exports.FloatingButton = exports.ShakeDetector = exports.AuthOverlay = exports.PairDeviceModal = exports.YaverMachinePickerScreen = exports.YaverLoginScreen = exports.YaverConnectionScreen = exports.RELOAD_APP_PATH = exports.RELOAD_PATH = exports.describeReloadFailure = exports.reloadFrameworkFamily = exports.reloadRequest = exports.reloadActions = exports.createP2PDogfoodDriver = exports.P2PClient = exports.YaverDiscovery = exports.initExpo = exports.YaverUpdates = exports.BlackBox = exports.captureStoreScreenshots = exports.YaverFeedback = void 0;
33
+ exports.uploadFeedback = exports.isVideoRecording = exports.stopVideoRecording = exports.startVideoRecording = exports.pickFeedbackFile = exports.captureScreenshot = exports.DEFAULT_OAUTH_REDIRECT = exports.DEFAULT_WEB_BASE_URL = exports.DEFAULT_CONVEX_SITE_URL = exports.listReachableDevices = exports.loginWithEmail = exports.signupWithEmail = exports.signInWithOAuth = exports.signInWithApple = exports.validateToken = exports.clearSelectedDeviceId = void 0;
33
34
  var YaverFeedback_1 = require("./YaverFeedback");
34
35
  Object.defineProperty(exports, "YaverFeedback", { enumerable: true, get: function () { return YaverFeedback_1.YaverFeedback; } });
36
+ var storeShots_1 = require("./storeShots");
37
+ Object.defineProperty(exports, "captureStoreScreenshots", { enumerable: true, get: function () { return storeShots_1.captureStoreScreenshots; } });
35
38
  var BlackBox_1 = require("./BlackBox");
36
39
  Object.defineProperty(exports, "BlackBox", { enumerable: true, get: function () { return BlackBox_1.BlackBox; } });
37
40
  var YaverUpdates_1 = require("./YaverUpdates");
@@ -42,14 +45,21 @@ var Discovery_1 = require("./Discovery");
42
45
  Object.defineProperty(exports, "YaverDiscovery", { enumerable: true, get: function () { return Discovery_1.YaverDiscovery; } });
43
46
  var P2PClient_1 = require("./P2PClient");
44
47
  Object.defineProperty(exports, "P2PClient", { enumerable: true, get: function () { return P2PClient_1.P2PClient; } });
48
+ var P2PDogfoodDriver_1 = require("./P2PDogfoodDriver");
49
+ Object.defineProperty(exports, "createP2PDogfoodDriver", { enumerable: true, get: function () { return P2PDogfoodDriver_1.createP2PDogfoodDriver; } });
50
+ var reloadActions_1 = require("./reloadActions");
51
+ Object.defineProperty(exports, "reloadActions", { enumerable: true, get: function () { return reloadActions_1.reloadActions; } });
52
+ Object.defineProperty(exports, "reloadRequest", { enumerable: true, get: function () { return reloadActions_1.reloadRequest; } });
53
+ Object.defineProperty(exports, "reloadFrameworkFamily", { enumerable: true, get: function () { return reloadActions_1.reloadFrameworkFamily; } });
54
+ Object.defineProperty(exports, "describeReloadFailure", { enumerable: true, get: function () { return reloadActions_1.describeReloadFailure; } });
55
+ Object.defineProperty(exports, "RELOAD_PATH", { enumerable: true, get: function () { return reloadActions_1.RELOAD_PATH; } });
56
+ Object.defineProperty(exports, "RELOAD_APP_PATH", { enumerable: true, get: function () { return reloadActions_1.RELOAD_APP_PATH; } });
45
57
  var ConnectionScreen_1 = require("./ConnectionScreen");
46
58
  Object.defineProperty(exports, "YaverConnectionScreen", { enumerable: true, get: function () { return ConnectionScreen_1.YaverConnectionScreen; } });
47
59
  var LoginScreen_1 = require("./LoginScreen");
48
60
  Object.defineProperty(exports, "YaverLoginScreen", { enumerable: true, get: function () { return LoginScreen_1.YaverLoginScreen; } });
49
61
  var MachinePickerScreen_1 = require("./MachinePickerScreen");
50
62
  Object.defineProperty(exports, "YaverMachinePickerScreen", { enumerable: true, get: function () { return MachinePickerScreen_1.YaverMachinePickerScreen; } });
51
- var GuestOnboardingScreen_1 = require("./GuestOnboardingScreen");
52
- Object.defineProperty(exports, "YaverGuestOnboardingScreen", { enumerable: true, get: function () { return GuestOnboardingScreen_1.YaverGuestOnboardingScreen; } });
53
63
  var PairDeviceModal_1 = require("./PairDeviceModal");
54
64
  Object.defineProperty(exports, "PairDeviceModal", { enumerable: true, get: function () { return PairDeviceModal_1.PairDeviceModal; } });
55
65
  var AuthOverlay_1 = require("./AuthOverlay");
@@ -58,6 +68,26 @@ var ShakeDetector_1 = require("./ShakeDetector");
58
68
  Object.defineProperty(exports, "ShakeDetector", { enumerable: true, get: function () { return ShakeDetector_1.ShakeDetector; } });
59
69
  var FloatingButton_1 = require("./FloatingButton");
60
70
  Object.defineProperty(exports, "FloatingButton", { enumerable: true, get: function () { return FloatingButton_1.FloatingButton; } });
71
+ // The polite "you're inside Yaver" mark. Rendered automatically by the SDK's
72
+ // overlay host when config.modeBadge !== false; exported so an app that manages
73
+ // its own overlay tree can place it itself.
74
+ var YaverModeBadge_1 = require("./YaverModeBadge");
75
+ Object.defineProperty(exports, "YaverModeBadge", { enumerable: true, get: function () { return YaverModeBadge_1.YaverModeBadge; } });
76
+ Object.defineProperty(exports, "hideYaverModeBadge", { enumerable: true, get: function () { return YaverModeBadge_1.hideYaverModeBadge; } });
77
+ Object.defineProperty(exports, "showYaverModeBadge", { enumerable: true, get: function () { return YaverModeBadge_1.showYaverModeBadge; } });
78
+ Object.defineProperty(exports, "isYaverModeBadgeHidden", { enumerable: true, get: function () { return YaverModeBadge_1.isYaverModeBadgeHidden; } });
79
+ var dogfoodPolicy_1 = require("./dogfoodPolicy");
80
+ Object.defineProperty(exports, "resolveSDKDogfood", { enumerable: true, get: function () { return dogfoodPolicy_1.resolveSDKDogfood; } });
81
+ var deviceDogfood_1 = require("./deviceDogfood");
82
+ Object.defineProperty(exports, "YaverDeviceDogfood", { enumerable: true, get: function () { return deviceDogfood_1.YaverDeviceDogfood; } });
83
+ var DogfoodRuntime_1 = require("./DogfoodRuntime");
84
+ Object.defineProperty(exports, "DogfoodController", { enumerable: true, get: function () { return DogfoodRuntime_1.DogfoodController; } });
85
+ Object.defineProperty(exports, "DogfoodRuntimeError", { enumerable: true, get: function () { return DogfoodRuntime_1.DogfoodRuntimeError; } });
86
+ Object.defineProperty(exports, "defaultDogfoodLane", { enumerable: true, get: function () { return DogfoodRuntime_1.defaultDogfoodLane; } });
87
+ Object.defineProperty(exports, "dogfoodLaneOptions", { enumerable: true, get: function () { return DogfoodRuntime_1.dogfoodLaneOptions; } });
88
+ Object.defineProperty(exports, "dogfoodLogLinesFromDevEvent", { enumerable: true, get: function () { return DogfoodRuntime_1.dogfoodLogLinesFromDevEvent; } });
89
+ Object.defineProperty(exports, "runtimeLogLinesFromDevEvent", { enumerable: true, get: function () { return DogfoodRuntime_1.runtimeLogLinesFromDevEvent; } });
90
+ Object.defineProperty(exports, "validateDogfoodProject", { enumerable: true, get: function () { return DogfoodRuntime_1.validateDogfoodProject; } });
61
91
  var FeedbackModal_1 = require("./FeedbackModal");
62
92
  Object.defineProperty(exports, "FeedbackModal", { enumerable: true, get: function () { return FeedbackModal_1.FeedbackModal; } });
63
93
  var QuickActionIcon_1 = require("./QuickActionIcon");
@@ -86,10 +116,6 @@ Object.defineProperty(exports, "signInWithOAuth", { enumerable: true, get: funct
86
116
  Object.defineProperty(exports, "signupWithEmail", { enumerable: true, get: function () { return auth_1.signupWithEmail; } });
87
117
  Object.defineProperty(exports, "loginWithEmail", { enumerable: true, get: function () { return auth_1.loginWithEmail; } });
88
118
  Object.defineProperty(exports, "listReachableDevices", { enumerable: true, get: function () { return auth_1.listReachableDevices; } });
89
- Object.defineProperty(exports, "fetchGuestHosts", { enumerable: true, get: function () { return auth_1.fetchGuestHosts; } });
90
- Object.defineProperty(exports, "findInviteByCode", { enumerable: true, get: function () { return auth_1.findInviteByCode; } });
91
- Object.defineProperty(exports, "acceptGuestByCode", { enumerable: true, get: function () { return auth_1.acceptGuestByCode; } });
92
- Object.defineProperty(exports, "acceptGuestInvitation", { enumerable: true, get: function () { return auth_1.acceptGuestInvitation; } });
93
119
  Object.defineProperty(exports, "DEFAULT_CONVEX_SITE_URL", { enumerable: true, get: function () { return auth_1.DEFAULT_CONVEX_SITE_URL; } });
94
120
  Object.defineProperty(exports, "DEFAULT_WEB_BASE_URL", { enumerable: true, get: function () { return auth_1.DEFAULT_WEB_BASE_URL; } });
95
121
  Object.defineProperty(exports, "DEFAULT_OAUTH_REDIRECT", { enumerable: true, get: function () { return auth_1.DEFAULT_OAUTH_REDIRECT; } });
@@ -0,0 +1,88 @@
1
+ /** Stable identifier for each action the overlay can render. */
2
+ export type ReloadActionId = 'hot' | 'full' | 'rebuild';
3
+ /** Wire value of the `mode` field (or `bundle` for /dev/reload-app). */
4
+ export type ReloadWireMode = 'fast' | 'full' | 'bundle';
5
+ /** The part of GET /dev/status this decision depends on. */
6
+ export interface DevServerSnapshot {
7
+ /** Is a dev server process alive on the machine? */
8
+ running: boolean;
9
+ /** Is it still compiling? A reload now would race the build. */
10
+ building?: boolean;
11
+ /** Agent's framework name: expo | react-native | flutter | vite | nextjs. */
12
+ framework?: string;
13
+ }
14
+ export interface ReloadActionsOptions {
15
+ /**
16
+ * Is the HOST APP a development build?
17
+ *
18
+ * There is no honest default here, so there is no default: every stack has
19
+ * its own signal (`__DEV__`, `kDebugMode`, `Debug.isDebugBuild`,
20
+ * `FLAG_DEBUGGABLE`, `#if DEBUG`) and the caller passes it. False means the
21
+ * list is EMPTY — a shipped app never gets a reload button.
22
+ */
23
+ isDevBuild: boolean;
24
+ /** Do we have an agent connection / selected machine at all? */
25
+ connected: boolean;
26
+ /** Human label for the machine, used inside the disabled reason. */
27
+ machineLabel?: string;
28
+ /**
29
+ * Offer the React Native bundle rebuild as a third action. Only the RN SDK
30
+ * can act on the pushed bundle, so only the RN SDK sets this.
31
+ */
32
+ includeRebuild?: boolean;
33
+ }
34
+ export interface ReloadAction {
35
+ id: ReloadActionId;
36
+ /** Button label — stack-idiomatic wording lives here, not at the call site. */
37
+ label: string;
38
+ /** One line under/next to the button explaining what it actually does. */
39
+ hint: string;
40
+ mode: ReloadWireMode;
41
+ /** Agent path this action POSTs to. */
42
+ path: string;
43
+ enabled: boolean;
44
+ /**
45
+ * Present exactly when `enabled` is false. Names the specific blocker and
46
+ * the fix — never "unavailable".
47
+ */
48
+ disabledReason?: string;
49
+ }
50
+ type FrameworkFamily = 'flutter' | 'react-native' | 'web' | 'unknown';
51
+ /**
52
+ * Map the agent's framework name onto the family whose reload vocabulary we
53
+ * borrow. Unknown frameworks still get generic actions: the agent is the
54
+ * authority on what it can do, and refusing to offer a reload because we did
55
+ * not recognise a name would be us inventing a limit the product does not have.
56
+ */
57
+ export declare function reloadFrameworkFamily(framework?: string): FrameworkFamily;
58
+ /** Path constants — mirrored from AGENT_ENDPOINTS so a typo cannot diverge. */
59
+ export declare const RELOAD_PATH = "/dev/reload";
60
+ export declare const RELOAD_APP_PATH = "/dev/reload-app";
61
+ /**
62
+ * The whole decision, in one pure function.
63
+ *
64
+ * Returns the ordered list the overlay should render. An EMPTY list means
65
+ * "render no reload UI at all" — that is the production-build answer, and it
66
+ * is deliberately indistinguishable from "this SDK has no reload feature",
67
+ * because to a shipped app it doesn't.
68
+ *
69
+ * A NON-empty list may still contain disabled entries: showing a greyed
70
+ * "Hot Reload — no dev server is running on primary" teaches the user what
71
+ * to fix. Hiding it teaches them nothing.
72
+ */
73
+ export declare function reloadActions(snapshot: DevServerSnapshot | null | undefined, opts: ReloadActionsOptions): ReloadAction[];
74
+ /** The exact request an action makes. Kept next to the labels on purpose. */
75
+ export declare function reloadRequest(action: Pick<ReloadAction, 'mode' | 'path'>): {
76
+ method: 'POST';
77
+ path: string;
78
+ body: Record<string, unknown>;
79
+ };
80
+ /**
81
+ * Turn a failed reload into a sentence that names the cause AND the fix.
82
+ *
83
+ * "Reload failed" is the shape of error this codebase keeps paying whole
84
+ * sessions for. Every branch below exists because the raw text the agent (or
85
+ * Go's net stack) produces is accurate and unreadable.
86
+ */
87
+ export declare function describeReloadFailure(status: number, body: string, snapshot?: DevServerSnapshot | null): string;
88
+ export {};
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ // ─── Reload actions — the ONE decision seam every Yaver feedback SDK mirrors ──
3
+ //
4
+ // The in-app overlay offers the developer a way to reload the app they are
5
+ // looking at, without leaving it. This file answers the three questions that
6
+ // have to be answered IDENTICALLY on every stack, so that a bug fixed in one
7
+ // SDK is not still shipping in the other five:
8
+ //
9
+ // 1. WHICH actions may be shown at all (production build ⇒ none, ever)?
10
+ // 2. WHICH request does each action make (path + body)?
11
+ // 3. WHEN a reload fails, WHAT do we tell the user?
12
+ //
13
+ // It is deliberately PURE — no fetch, no DOM, no globals. That is what makes
14
+ // it unit-testable, and the unit test is the guard: a production build must
15
+ // yield an empty action list. Break `isDevBuild` and the test fails.
16
+ //
17
+ // ── Wire contract (desktop/agent/devserver_http.go) ──────────────────────────
18
+ //
19
+ // POST /dev/reload { "mode": "fast" | "full" }
20
+ // fast — the framework's cheapest refresh. Flutter stdin "r" (hot
21
+ // reload, keeps state). Metro/Expo fast refresh. Vite/Next HMR.
22
+ // full — framework-level restart. Flutter stdin "R" (hot RESTART,
23
+ // resets state). Web lane additionally forces a warm re-export.
24
+ // NEVER a cache clear or a process cold-start.
25
+ // Absent/unknown mode is normalised to "fast" by the agent, so an old
26
+ // client keeps its exact old behaviour.
27
+ //
28
+ // POST /dev/reload-app { "mode": "bundle", ...identity }
29
+ // Rebuild the Hermes bytecode bundle on the agent and push it over the
30
+ // BlackBox channel. React Native only, and the ONLY action that still
31
+ // works when no dev server is running — which is why it stays enabled
32
+ // in exactly that case.
33
+ //
34
+ // ── Auth ─────────────────────────────────────────────────────────────────────
35
+ //
36
+ // None of this needs a new secret. `/dev/reload` and `/dev/reload-app` are
37
+ // registered under `authSDK` (desktop/agent/httpserver.go), the same
38
+ // middleware that already admits the bearer this SDK sends with its feedback
39
+ // POST. A scope-limited SDK token needs the existing `reload` scope,
40
+ // whose path list already contains both routes — no widening, no new gate.
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.RELOAD_APP_PATH = exports.RELOAD_PATH = void 0;
43
+ exports.reloadFrameworkFamily = reloadFrameworkFamily;
44
+ exports.reloadActions = reloadActions;
45
+ exports.reloadRequest = reloadRequest;
46
+ exports.describeReloadFailure = describeReloadFailure;
47
+ /**
48
+ * Map the agent's framework name onto the family whose reload vocabulary we
49
+ * borrow. Unknown frameworks still get generic actions: the agent is the
50
+ * authority on what it can do, and refusing to offer a reload because we did
51
+ * not recognise a name would be us inventing a limit the product does not have.
52
+ */
53
+ function reloadFrameworkFamily(framework) {
54
+ const f = (framework || '').trim().toLowerCase();
55
+ if (!f)
56
+ return 'unknown';
57
+ if (f.indexOf('flutter') >= 0)
58
+ return 'flutter';
59
+ if (f === 'expo' || f.indexOf('react-native') >= 0 || f.indexOf('metro') >= 0) {
60
+ return 'react-native';
61
+ }
62
+ if (f === 'vite' || f === 'next' || f === 'nextjs' || f === 'web' || f === 'webpack') {
63
+ return 'web';
64
+ }
65
+ return 'unknown';
66
+ }
67
+ const LABELS = {
68
+ flutter: {
69
+ hot: ['Hot Reload', 'Flutter hot reload (r) — keeps the current app state.'],
70
+ full: ['Hot Restart', 'Flutter hot restart (R) — restarts the app and resets state.'],
71
+ },
72
+ 'react-native': {
73
+ hot: ['Hot Reload', 'Fast Refresh through Metro — keeps component state.'],
74
+ full: ['Full Reload', 'Reloads the whole JS bundle and resets state.'],
75
+ },
76
+ web: {
77
+ hot: ['Hot Reload', 'Hot module replacement through the dev server.'],
78
+ full: ['Full Reload', 'Re-exports the bundle and reloads the page.'],
79
+ },
80
+ unknown: {
81
+ hot: ['Hot Reload', "The dev server's cheapest refresh."],
82
+ full: ['Full Reload', 'Framework-level restart of the running app.'],
83
+ },
84
+ };
85
+ /** Path constants — mirrored from AGENT_ENDPOINTS so a typo cannot diverge. */
86
+ exports.RELOAD_PATH = '/dev/reload';
87
+ exports.RELOAD_APP_PATH = '/dev/reload-app';
88
+ /**
89
+ * The whole decision, in one pure function.
90
+ *
91
+ * Returns the ordered list the overlay should render. An EMPTY list means
92
+ * "render no reload UI at all" — that is the production-build answer, and it
93
+ * is deliberately indistinguishable from "this SDK has no reload feature",
94
+ * because to a shipped app it doesn't.
95
+ *
96
+ * A NON-empty list may still contain disabled entries: showing a greyed
97
+ * "Hot Reload — no dev server is running on primary" teaches the user what
98
+ * to fix. Hiding it teaches them nothing.
99
+ */
100
+ function reloadActions(snapshot, opts) {
101
+ // 1. Production build — never, under any circumstance.
102
+ if (!opts.isDevBuild)
103
+ return [];
104
+ const snap = snapshot || { running: false };
105
+ const family = reloadFrameworkFamily(snap.framework);
106
+ const labels = LABELS[family];
107
+ const machine = (opts.machineLabel || '').trim() || 'the selected machine';
108
+ let blocked;
109
+ if (!opts.connected) {
110
+ blocked = 'Not connected to a machine yet — pick one first.';
111
+ }
112
+ else if (snap.building) {
113
+ blocked = 'The dev server is still building — reload works once it finishes.';
114
+ }
115
+ else if (!snap.running) {
116
+ blocked =
117
+ `No dev server is running on ${machine}. ` +
118
+ 'Start one from the Yaver app, or run `yaver dev start` there.';
119
+ }
120
+ const actions = [
121
+ {
122
+ id: 'hot',
123
+ label: labels.hot[0],
124
+ hint: labels.hot[1],
125
+ mode: 'fast',
126
+ path: exports.RELOAD_PATH,
127
+ enabled: !blocked,
128
+ disabledReason: blocked,
129
+ },
130
+ {
131
+ id: 'full',
132
+ label: labels.full[0],
133
+ hint: labels.full[1],
134
+ mode: 'full',
135
+ path: exports.RELOAD_PATH,
136
+ enabled: !blocked,
137
+ disabledReason: blocked,
138
+ },
139
+ ];
140
+ if (opts.includeRebuild) {
141
+ // Deliberately NOT gated on `running`: rebuilding the bundle is exactly
142
+ // what you do when Metro is not up. It is gated on `connected`, because
143
+ // without a machine there is nothing to rebuild on.
144
+ const rebuildBlocked = opts.connected
145
+ ? undefined
146
+ : 'Not connected to a machine yet — pick one first.';
147
+ actions.push({
148
+ id: 'rebuild',
149
+ label: 'Rebuild Bundle',
150
+ hint: 'Recompiles the Hermes bundle on the machine. Works with no dev server.',
151
+ mode: 'bundle',
152
+ path: exports.RELOAD_APP_PATH,
153
+ enabled: !rebuildBlocked,
154
+ disabledReason: rebuildBlocked,
155
+ });
156
+ }
157
+ return actions;
158
+ }
159
+ /** The exact request an action makes. Kept next to the labels on purpose. */
160
+ function reloadRequest(action) {
161
+ return { method: 'POST', path: action.path, body: { mode: action.mode } };
162
+ }
163
+ /**
164
+ * Turn a failed reload into a sentence that names the cause AND the fix.
165
+ *
166
+ * "Reload failed" is the shape of error this codebase keeps paying whole
167
+ * sessions for. Every branch below exists because the raw text the agent (or
168
+ * Go's net stack) produces is accurate and unreadable.
169
+ */
170
+ function describeReloadFailure(status, body, snapshot) {
171
+ const lower = (body || '').toLowerCase();
172
+ const framework = (snapshot?.framework || '').trim();
173
+ if (lower.indexOf('does not support hot reload') >= 0) {
174
+ const name = framework || 'This dev server';
175
+ return `${name} cannot hot reload. Use Rebuild Bundle, or restart the dev server.`;
176
+ }
177
+ if (status === 503 ||
178
+ lower.indexOf('no dev server') >= 0 ||
179
+ lower.indexOf('dev server not available') >= 0) {
180
+ return 'No dev server is running on the machine. Start one before reloading.';
181
+ }
182
+ if ((lower.indexOf('connection refused') >= 0 || lower.indexOf('econnrefused') >= 0) &&
183
+ (lower.indexOf('127.0.0.1') >= 0 || lower.indexOf('localhost') >= 0)) {
184
+ return 'The dev server is not listening on the machine. Start it with `yaver dev start`.';
185
+ }
186
+ if (status === 401 || status === 403) {
187
+ return 'The machine rejected this session — sign in again, or re-pair this device.';
188
+ }
189
+ if (status === 404) {
190
+ return ('This machine’s agent has no /dev/reload route — it is too old. ' +
191
+ 'Update it with `npm install -g yaver-cli@latest`.');
192
+ }
193
+ if (status >= 500) {
194
+ return 'The agent hit an internal error while reloading. Check `yaver logs` on the machine.';
195
+ }
196
+ if (status === 0) {
197
+ return 'Could not reach the machine. Check that it is online and `yaver serve` is running.';
198
+ }
199
+ return `Reload failed (HTTP ${status}).`;
200
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * On-device App Store screenshot capture (Engine 2).
3
+ *
4
+ * The desktop `yaver shots` flow drives a simulator with Maestro. This is
5
+ * the in-app counterpart: the SDK, living inside the real running app,
6
+ * walks the app's own routes and screenshots each one with
7
+ * `react-native-view-shot`, then uploads the frames to the Yaver agent
8
+ * (POST /shots/upload). The agent normalizes them and runs the same App
9
+ * Store Connect backend (upload → metadata → submit).
10
+ *
11
+ * Why this exists alongside the simulator path: it captures *real device*
12
+ * pixels, knows the exact route map (no heuristics), and the user is
13
+ * already authenticated — so it sidesteps the i18n / no-testID fragility
14
+ * that makes a blind simulator walk hard.
15
+ *
16
+ * The host wires it once by handing us a navigation ref (react-navigation
17
+ * or expo-router router) plus the ordered list of routes to visit.
18
+ */
19
+ export interface StoreShotFrame {
20
+ route: string;
21
+ base64: string;
22
+ mimeType: string;
23
+ }
24
+ export interface CaptureStoreScreenshotsOptions {
25
+ /** Yaver agent base URL (e.g. http://192.168.1.5:18080 or a relay URL). */
26
+ agentUrl: string;
27
+ /** Bearer token for the agent (same-user envelope). */
28
+ authToken: string;
29
+ /** Relay password — required only when agentUrl is relay-routed. */
30
+ relayPassword?: string;
31
+ /** App name (vault scope / job label on the agent side). */
32
+ app: string;
33
+ /** iOS bundle id; the agent falls back to app.json if omitted. */
34
+ bundleId?: string;
35
+ /** App Store localization (default en-US). */
36
+ locale?: string;
37
+ /** When true, the agent also sets metadata + attempts submit-for-review. */
38
+ submit?: boolean;
39
+ /**
40
+ * Navigation handle. Either a react-navigation ref (has `.navigate`) or
41
+ * an expo-router `router` (has `.push`/`.navigate`). We call the first
42
+ * available method with the route string.
43
+ */
44
+ navigationRef?: any;
45
+ /** Ordered routes to visit + screenshot (e.g. ['/(tabs)/dashboard', ...]). */
46
+ routes: string[];
47
+ /** Optional per-route screenshot names (defaults to NN_<sanitized route>). */
48
+ screens?: string[];
49
+ /** Milliseconds to wait after navigating before capturing (default 900). */
50
+ settleMs?: number;
51
+ /** Hook the host can use to hide its own overlay before each capture. */
52
+ onBeforeCapture?: (route: string, index: number) => void | Promise<void>;
53
+ }
54
+ export interface CaptureStoreScreenshotsResult {
55
+ ok: boolean;
56
+ captured: number;
57
+ uploaded: number;
58
+ submitted?: boolean;
59
+ staged?: boolean;
60
+ message?: string;
61
+ }
62
+ /**
63
+ * Walk the app's routes, screenshot each, and upload the batch to the
64
+ * agent. Returns a summary; never throws for a single missed route —
65
+ * it captures what it can and reports the count.
66
+ */
67
+ export declare function captureStoreScreenshots(opts: CaptureStoreScreenshotsOptions): Promise<CaptureStoreScreenshotsResult>;