@testerpaykit/expo 0.7.5 → 0.9.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/CHANGELOG.md CHANGED
@@ -2,6 +2,63 @@
2
2
 
3
3
  All notable changes to `@testerpaykit/expo` are documented here.
4
4
 
5
+ ## 0.9.0 — 2026-10-28
6
+
7
+ **Quick actions, retests judged step by step, update notice.**
8
+
9
+ Requires `@testerpaykit/core` 1.2.0 and `@testerpaykit/api-client` 1.4.0
10
+ (published together; `ai-tester` stays 0.5.0) and an API from 2026-10-28
11
+ (api.testerpaykit.com).
12
+
13
+ ### Fixed
14
+ - `getMyRetests` returned the response envelope instead of the list, so
15
+ every retest screen built on it stayed empty (`@testerpaykit/api-client`).
16
+
17
+ ### Added
18
+ - Retest acceptance steps: `RetestItem.acceptanceSteps`, and
19
+ `verifyRetest(bugId, stepVerdicts?)` / `reopenRetest(bugId, reason?,
20
+ stepVerdicts?)` send the per-step verdicts (`RetestStepVerdicts`, needs
21
+ an API from 2026-10-28). `@testerpaykit/react`'s `TpkRetestScreen` lets
22
+ the tester judge each step; "confirmed" stays disabled until all passed.
23
+ - Development builds log a warning when the API reports a newer
24
+ `@testerpaykit/expo` release than the one running, with the update
25
+ command (`npx expo install @testerpaykit/expo@latest`). The API also
26
+ mails the project's coordinator once per release and shows a notice on
27
+ the project page in the console.
28
+ - Quick actions in the voice sheet: "Geht nicht", "Versteh ich nicht",
29
+ "Sieht kaputt aus", "Fehlt mir". One tap captures the screen behind the
30
+ sheet, the API drafts the report from the screenshot
31
+ (`POST /v1/testers/me/bug-reports/quick-draft`, needs an API from
32
+ 2026-10-28), and the tester reviews it before it is submitted. Shown
33
+ when the sheet gets `captureScreen`; `TesterPayKitWrapper` passes it.
34
+ Exported: `quickDraftBug`, `QuickActionKind`.
35
+ - Expo web: screenshots need the optional `html2canvas-pro` package.
36
+
37
+ ## 0.8.0 — 2026-10-25
38
+
39
+ **AI test runs can be started from outside the app.**
40
+
41
+ Requires `@testerpaykit/core` 1.1.0, `@testerpaykit/api-client` 1.3.0 and
42
+ `@testerpaykit/ai-tester` 0.5.0 (published together), and an API that has
43
+ `POST /v1/testers/me/ai-sessions/claim` (api.testerpaykit.com from
44
+ 2026-10-25).
45
+
46
+ ### Added
47
+ - `TesterPayKitWrapper` takes `aiRemoteTrigger` (and `aiRemotePollSeconds`,
48
+ default 15). With it on, the app picks up AI runs started from the
49
+ console ("Start on device") or `tpk autotest`, lets the AI drive it, and
50
+ closes the overlay on its own when the run ends.
51
+ - `TpkExpo.claimRemoteAiSession()` — the call behind it
52
+ (`POST /v1/testers/me/ai-sessions/claim`).
53
+
54
+ ### Fixed
55
+ - The AI tester was blind on the web: the shared executor asked for a
56
+ screenshot hook nobody installed, so the model only saw the widget list
57
+ and could not tell whether a tap changed anything. The wrapper now
58
+ installs it while a run is open.
59
+ - The AI tester could tap the Stop button of its own overlay and end the
60
+ run. Overlay controls are no longer offered to it.
61
+
5
62
  ## 0.7.5 — 2026-10-24
6
63
 
7
64
  **A spoken bug report opens on Review, ready to submit.**
package/README.md CHANGED
@@ -21,6 +21,7 @@ time, not in the moment a tester hits the feature:
21
21
  | Missing module | Feature that is OFF |
22
22
  |---|---|
23
23
  | `react-native-view-shot` | automatic screenshots on bug reports |
24
+ | `html2canvas-pro` (web only) | screenshots on Expo web — bug reports and the screens AI test runs judge |
24
25
  | `react-native-record-screen` | screen recording attachments |
25
26
  | `@shopify/react-native-skia` | screenshot annotation editor |
26
27
  | `react-native-draggable-flatlist` | annotation layer reordering |
@@ -323,6 +324,27 @@ if (note) {
323
324
  }
324
325
  ```
325
326
 
327
+ ## AI test runs started from outside
328
+
329
+ The wrapper can hand the app to an AI tester that a coordinator starts
330
+ from the console ("Start on device" on the project page) or from a
331
+ terminal (`tpk autotest --project <id>`). Nobody has to touch the device:
332
+
333
+ ```tsx
334
+ <TesterPayKitWrapper tpk={tpk} aiRemoteTrigger>
335
+ <YourApp />
336
+ </TesterPayKitWrapper>
337
+ ```
338
+
339
+ While the app is in the foreground the wrapper asks the API every 15
340
+ seconds (`aiRemotePollSeconds`) whether a run is waiting for its project.
341
+ When one is, the AI overlay opens, a server-side model drives the app
342
+ (taps, typing, scrolling, with a screenshot per step) and files findings
343
+ into the console's AI Findings. When the run ends the overlay closes and
344
+ the app waits for the next one. Tap anywhere outside the overlay to pause
345
+ a run. Off by default; enable it only in builds you want remote-controlled.
346
+ The project's organisation must have AI features enabled.
347
+
326
348
  ## What this package is NOT
327
349
 
328
350
  - **Not** a full console app. The provider, floating button, and
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as _testerpaykit_api_client from '@testerpaykit/api-client';
2
2
  import { SessionEventInput, BugReportAttachmentInput, BugReportAttachmentResponse, BugReportPayload, BugReportResponse, TaskListResponse, TesterTask, TesterPayKitApiClient, AnonymousLoginResponse, BugReportType, BugSeverity, BugCategory, MyBugReportSummary, NotificationsResult, TesterSessionEndReason, TesterProfile, TesterPoints, EarningsSummary, PayoutRecord } from '@testerpaykit/api-client';
3
3
  export { BugCategory, BugReportAttachmentInput, BugReportAttachmentResponse, BugReportType, BugSeverity, EarningsSummary, EnrollmentResponse, MyBugReportSummary, MyBugReportsResponse, NotificationsResult, PayoutRecord, TaskListFilter, TaskListResponse, TesterPoints, TesterProfile, TesterTask, TpkNotification } from '@testerpaykit/api-client';
4
+ import { RemoteAiSession } from '@testerpaykit/core';
4
5
  import React, { RefObject, ReactNode } from 'react';
5
6
  import { StyleProp, ViewStyle, TextStyle } from 'react-native';
6
7
 
@@ -692,6 +693,12 @@ declare class TpkExpo {
692
693
  markNotificationsRead(params?: {
693
694
  id?: string;
694
695
  }): Promise<number>;
696
+ /**
697
+ * Claim an AI-tester run started from outside (console or
698
+ * `tpk autotest`) for this app's project. Null when nothing waits.
699
+ * Used by the wrapper's `aiRemoteTrigger` poll.
700
+ */
701
+ claimRemoteAiSession(): Promise<RemoteAiSession | null>;
695
702
  /**
696
703
  * Onboard with a runtime invite code (instead of the baked-in
697
704
  * config.testerCode): authenticate anonymously with `code`, persist the
@@ -1713,6 +1720,21 @@ interface VoiceExtractResult {
1713
1720
  * surface a retry UI.
1714
1721
  */
1715
1722
  declare function extractVoiceBug(tpk: Pick<TpkExpo, 'api'>, audio: VoiceExtractAudio): Promise<VoiceExtractResult>;
1723
+ /** One-tap report kinds of the sheet's quick actions (server wire names). */
1724
+ type QuickActionKind = 'broken' | 'confusing' | 'looks_broken' | 'missing';
1725
+ /**
1726
+ * Ask the server for a report draft written from a screenshot of the
1727
+ * screen the tester is on — the quick-action path next to voice. Returns
1728
+ * the same shape as {@link extractVoiceBug} so the review step and the
1729
+ * bug-report pre-fill stay one code path; `transcript` is empty because
1730
+ * nobody spoke.
1731
+ */
1732
+ declare function quickDraftBug(tpk: Pick<TpkExpo, 'api'>, input: {
1733
+ action: QuickActionKind;
1734
+ screenshotBase64: string;
1735
+ screenName?: string;
1736
+ language?: string;
1737
+ }): Promise<VoiceExtractResult>;
1716
1738
 
1717
1739
  type VoiceClassification = 'bug' | 'featureRequest' | 'idea' | 'issue';
1718
1740
  /** Per-string overrides — pass to host-localise. Any unset value
@@ -1737,6 +1759,15 @@ interface VoiceBugStrings {
1737
1759
  retry?: string;
1738
1760
  useExtracted?: string;
1739
1761
  rerecord?: string;
1762
+ quickHint?: string;
1763
+ quickBroken?: string;
1764
+ quickConfusing?: string;
1765
+ quickLooksBroken?: string;
1766
+ quickMissing?: string;
1767
+ quickProcessingDescription?: string;
1768
+ quickExtractedDescription?: string;
1769
+ quickNoScreenshot?: string;
1770
+ back?: string;
1740
1771
  }
1741
1772
  interface VoiceBugInputSheetProps {
1742
1773
  visible: boolean;
@@ -1776,10 +1807,19 @@ interface VoiceBugInputSheetProps {
1776
1807
  /** Host-side string overrides. Any missing key falls back to the
1777
1808
  * German default copy. */
1778
1809
  strings?: VoiceBugStrings;
1810
+ /**
1811
+ * Base64 PNG of the app screen behind the sheet. When set, the sheet
1812
+ * offers the quick actions (Geht nicht / Versteh ich nicht / Sieht
1813
+ * kaputt aus / Fehlt mir): one tap, and a vision model drafts the
1814
+ * report from this screenshot. The wrapper passes its root capture.
1815
+ */
1816
+ captureScreen?: () => Promise<string | null>;
1817
+ /** Screen name sent along with a quick action (model context). */
1818
+ currentScreen?: string;
1779
1819
  style?: StyleProp<ViewStyle>;
1780
1820
  testID?: string;
1781
1821
  }
1782
- declare function VoiceBugInputSheet({ visible, tpk, onCancel, onExtracted, maxSeconds, accentColor, sheetOpacity, voiceLanguage, strings, style, testID, }: VoiceBugInputSheetProps): React.ReactElement;
1822
+ declare function VoiceBugInputSheet({ visible, tpk, onCancel, onExtracted, maxSeconds, accentColor, sheetOpacity, voiceLanguage, strings, captureScreen, currentScreen, style, testID, }: VoiceBugInputSheetProps): React.ReactElement;
1783
1823
  /** Maps the sheet's classification onto the BugReportSheet's
1784
1824
  * BugReportType union. Exported so the host can call it when
1785
1825
  * building the initialDraft for the bug sheet. */
@@ -1905,6 +1945,14 @@ interface TesterPayKitWrapperProps {
1905
1945
  aiCoordinatorToken?: string;
1906
1946
  aiProjectId?: string;
1907
1947
  aiApiBaseUrl?: string;
1948
+ /** Let AI-tester runs started from outside (console "Start AI test",
1949
+ * `tpk autotest`) drive this app: while in the foreground the wrapper
1950
+ * asks the API every `aiRemotePollSeconds` whether a run is waiting
1951
+ * for this project and, if so, hands the app to it. Off by default —
1952
+ * only enable it in builds you want remote-controlled. */
1953
+ aiRemoteTrigger?: boolean;
1954
+ /** Poll interval for `aiRemoteTrigger`. Default 15. */
1955
+ aiRemotePollSeconds?: number;
1908
1956
  /** Currently active route — flows through to bug reports. */
1909
1957
  currentScreen?: string;
1910
1958
  /** When the session started — drives the earnings clock + the
@@ -1917,7 +1965,7 @@ interface TesterPayKitWrapperProps {
1917
1965
  theme?: Partial<TpkTheme>;
1918
1966
  testID?: string;
1919
1967
  }
1920
- declare function TesterPayKitWrapper({ children, tpk, enableWrapper, enableShake, shakeThresholdG, style, onShowDebugLogs, notificationCount, onFlushCachedCrashes, retestCount, onShowRetests, onViewDashboard, buttonPosition, currentScreen, sessionStartedAt, aiCoordinatorToken, aiProjectId, aiApiBaseUrl, theme, testID, }: TesterPayKitWrapperProps): React.ReactElement;
1968
+ declare function TesterPayKitWrapper({ children, tpk, enableWrapper, enableShake, shakeThresholdG, style, onShowDebugLogs, notificationCount, onFlushCachedCrashes, retestCount, onShowRetests, onViewDashboard, buttonPosition, currentScreen, sessionStartedAt, aiCoordinatorToken, aiRemoteTrigger, aiRemotePollSeconds, aiProjectId, aiApiBaseUrl, theme, testID, }: TesterPayKitWrapperProps): React.ReactElement;
1921
1969
 
1922
1970
  interface TpkAnnotatedProps {
1923
1971
  /** Task this element belongs to. */
@@ -2258,5 +2306,5 @@ declare function useTpkEarnings(tpk: TpkExpo | null, options?: {
2258
2306
  payoutLimit?: number;
2259
2307
  }): UseEarningsResult;
2260
2308
 
2261
- export { ANNOTATION_PALETTE, AttachmentQueue, Breadcrumbs, BugReportSheet, CrashQueue, DEFAULT_STYLE, DEFAULT_TPK_THEME, ExpoStorage, FloatingFeedbackButton, GeneralFeedbackDialog, INTERACTION_NAV_WEIGHT, InviteCodeScreen, MIN_INTERACTIONS_PER_ACTIVE_MINUTE, MyBugsSheet, NotificationsSheet, ONBOARDING_DONE_STORAGE_KEY, SCREENSHOT_CONSENT_STORAGE_KEY, ScreenRecorder, ScreenshotAnnotationEditor, SessionDetailsSheet, SessionEndDialog, SubmitQueue, TaskAnnotationRegistry, TesterDashboard, TesterPayKitProvider, TesterPayKitWrapper, TpkAnnotated, TpkAnnotationOverlay, TpkExpo, TpkIcon, TpkIconsProvider, TpkOnboarding, TpkSensitive, TpkTalker, TpkThemeProvider, TpkWelcomeSheet, VoiceBugInputSheet, VoiceNoteRecorder, WELCOME_ACK_STORAGE_KEY, WIDGET_TOUR_SEEN_STORAGE_KEY, WidgetDiscovery, WidgetTour, annotations, applySensitiveRedaction, arrowHeadPoints, beginNativeCapture, bugSeverityLabel, bugStatusStyle, canSubmitBugReportDraft, captureView, classificationToBugType, createBugReportDraft, deriveTaskProgress, emptyAnnotationDoc, endNativeCapture, engagedMinutes, extractVoiceBug, findAssignmentForTask, getAppSnapshot, getDeviceSnapshot, getEventCounts, getNativeCaptureMode, getSessionStats, getUniqueScreens, hasCompletedOnboarding, hasScreenshotConsent, hasSeenWidgetTour, hasWelcomeBriefBeenSeen, installCrashHandler, installNetworkCapture, markOnboardingComplete, markWelcomeBriefAsSeen, markWidgetTourSeen, mockBugFixes, mockBuildInfo, mockFocusAreas, mockWelcomeBrief, mockWelcomeTasks, mockWidgets, parseVersionRange, pathToSvgD, resetOnboardingState, resetWelcomeBriefAck, resetWidgetTourSeen, simplifyPath, submitBugReportDraft, subscribeNativeCaptureMode, uploadScreenshotAttachment, useShake, useTaskAnnotation, useTesterPayKit, useTpkDashboard, useTpkEarnings, useTpkTheme, versionSatisfies, widgetDiscovery, withNativeCapture };
2262
- export type { AnnotatedElementInfo, AnnotatedScreenshotResult, AnnotationColor, AnnotationEvent, AnnotationEventType, AnnotationInteraction, AnnotationListener, AnnotationShape, AnnotationStyle, AnnotationTool, AppSnapshot, ArrowShape, AttachmentQueueFlushOptions, BlurShape, Breadcrumb, BugFix, BugReportDraft, BugReportSheetProps, BuildInfo, CachedCrash, CaptureViewOptions, CircleShape, CompletionTrigger, CrashHandlerOptions, CrashInfo, CreateBugReportDraftInput, DashboardData, DeviceSnapshot, DiscoverOptions, EarningsData, EngagedMinutesInput, FeedbackCategory, FloatingFeedbackButtonProps, FlushTelemetryResult, FocusArea, GeneralFeedbackDialogProps, InstallNetworkCaptureOptions, InteractionBounds, InteractionType, InviteCodeScreenProps, MyBugsSheetProps, NotificationsSheetProps, OnboardingStorage, PathShape, PeriodFilter, Point, QueueFlushOptions, QueueFlushResult, RecordInteractionDetails, RecordingOptions, RecordingResult, RecordingState, RectShape, RegisterAnnotationInput, ReleaseNote, ScreenshotAnnotationEditorProps, ScreenshotResult, SensitiveMaskingMode, SessionDetailsSheetProps, SessionEndDialogProps, SessionEndStats, SessionStatsSnapshot, StatusStyle, SubmitBugInput, TaskAnnotation, TaskInteractionSummary, TaskProgress, TesterDashboardProps, TesterPayKitContextValue, TesterPayKitProviderProps, TesterPayKitWrapperProps, TextShape, TpkAnnotatedProps, TpkAnnotationOverlayHandle, TpkAnnotationOverlayProps, TpkExpoConfig, TpkIconName, TpkIconOverrideMap, TpkIconProps, TpkLogEntry, TpkLogLevel, TpkOnboardingProps, TpkSensitiveProps, TpkStorage, TpkTalkerListener, TpkTalkerOptions, TpkTheme, TpkWelcomeSheetProps, UseDashboardResult, UseEarningsResult, UseShakeOptions, UseTaskAnnotationOptions, UseTaskAnnotationResult, VersionRange, VoiceBugInputSheetProps, VoiceBugStrings, VoiceClassification, VoiceExtractAudio, VoiceExtractResult, VoiceNoteFileReader, VoiceNoteRecorderLike, VoiceNoteRecorderOptions, VoiceNoteResult, VoiceNoteState, WelcomeAckStorage, WelcomeBrief, WelcomeTask, WidgetInfo, WidgetTourProps };
2309
+ export { ANNOTATION_PALETTE, AttachmentQueue, Breadcrumbs, BugReportSheet, CrashQueue, DEFAULT_STYLE, DEFAULT_TPK_THEME, ExpoStorage, FloatingFeedbackButton, GeneralFeedbackDialog, INTERACTION_NAV_WEIGHT, InviteCodeScreen, MIN_INTERACTIONS_PER_ACTIVE_MINUTE, MyBugsSheet, NotificationsSheet, ONBOARDING_DONE_STORAGE_KEY, SCREENSHOT_CONSENT_STORAGE_KEY, ScreenRecorder, ScreenshotAnnotationEditor, SessionDetailsSheet, SessionEndDialog, SubmitQueue, TaskAnnotationRegistry, TesterDashboard, TesterPayKitProvider, TesterPayKitWrapper, TpkAnnotated, TpkAnnotationOverlay, TpkExpo, TpkIcon, TpkIconsProvider, TpkOnboarding, TpkSensitive, TpkTalker, TpkThemeProvider, TpkWelcomeSheet, VoiceBugInputSheet, VoiceNoteRecorder, WELCOME_ACK_STORAGE_KEY, WIDGET_TOUR_SEEN_STORAGE_KEY, WidgetDiscovery, WidgetTour, annotations, applySensitiveRedaction, arrowHeadPoints, beginNativeCapture, bugSeverityLabel, bugStatusStyle, canSubmitBugReportDraft, captureView, classificationToBugType, createBugReportDraft, deriveTaskProgress, emptyAnnotationDoc, endNativeCapture, engagedMinutes, extractVoiceBug, findAssignmentForTask, getAppSnapshot, getDeviceSnapshot, getEventCounts, getNativeCaptureMode, getSessionStats, getUniqueScreens, hasCompletedOnboarding, hasScreenshotConsent, hasSeenWidgetTour, hasWelcomeBriefBeenSeen, installCrashHandler, installNetworkCapture, markOnboardingComplete, markWelcomeBriefAsSeen, markWidgetTourSeen, mockBugFixes, mockBuildInfo, mockFocusAreas, mockWelcomeBrief, mockWelcomeTasks, mockWidgets, parseVersionRange, pathToSvgD, quickDraftBug, resetOnboardingState, resetWelcomeBriefAck, resetWidgetTourSeen, simplifyPath, submitBugReportDraft, subscribeNativeCaptureMode, uploadScreenshotAttachment, useShake, useTaskAnnotation, useTesterPayKit, useTpkDashboard, useTpkEarnings, useTpkTheme, versionSatisfies, widgetDiscovery, withNativeCapture };
2310
+ export type { AnnotatedElementInfo, AnnotatedScreenshotResult, AnnotationColor, AnnotationEvent, AnnotationEventType, AnnotationInteraction, AnnotationListener, AnnotationShape, AnnotationStyle, AnnotationTool, AppSnapshot, ArrowShape, AttachmentQueueFlushOptions, BlurShape, Breadcrumb, BugFix, BugReportDraft, BugReportSheetProps, BuildInfo, CachedCrash, CaptureViewOptions, CircleShape, CompletionTrigger, CrashHandlerOptions, CrashInfo, CreateBugReportDraftInput, DashboardData, DeviceSnapshot, DiscoverOptions, EarningsData, EngagedMinutesInput, FeedbackCategory, FloatingFeedbackButtonProps, FlushTelemetryResult, FocusArea, GeneralFeedbackDialogProps, InstallNetworkCaptureOptions, InteractionBounds, InteractionType, InviteCodeScreenProps, MyBugsSheetProps, NotificationsSheetProps, OnboardingStorage, PathShape, PeriodFilter, Point, QueueFlushOptions, QueueFlushResult, QuickActionKind, RecordInteractionDetails, RecordingOptions, RecordingResult, RecordingState, RectShape, RegisterAnnotationInput, ReleaseNote, ScreenshotAnnotationEditorProps, ScreenshotResult, SensitiveMaskingMode, SessionDetailsSheetProps, SessionEndDialogProps, SessionEndStats, SessionStatsSnapshot, StatusStyle, SubmitBugInput, TaskAnnotation, TaskInteractionSummary, TaskProgress, TesterDashboardProps, TesterPayKitContextValue, TesterPayKitProviderProps, TesterPayKitWrapperProps, TextShape, TpkAnnotatedProps, TpkAnnotationOverlayHandle, TpkAnnotationOverlayProps, TpkExpoConfig, TpkIconName, TpkIconOverrideMap, TpkIconProps, TpkLogEntry, TpkLogLevel, TpkOnboardingProps, TpkSensitiveProps, TpkStorage, TpkTalkerListener, TpkTalkerOptions, TpkTheme, TpkWelcomeSheetProps, UseDashboardResult, UseEarningsResult, UseShakeOptions, UseTaskAnnotationOptions, UseTaskAnnotationResult, VersionRange, VoiceBugInputSheetProps, VoiceBugStrings, VoiceClassification, VoiceExtractAudio, VoiceExtractResult, VoiceNoteFileReader, VoiceNoteRecorderLike, VoiceNoteRecorderOptions, VoiceNoteResult, VoiceNoteState, WelcomeAckStorage, WelcomeBrief, WelcomeTask, WidgetInfo, WidgetTourProps };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as _testerpaykit_api_client from '@testerpaykit/api-client';
2
2
  import { SessionEventInput, BugReportAttachmentInput, BugReportAttachmentResponse, BugReportPayload, BugReportResponse, TaskListResponse, TesterTask, TesterPayKitApiClient, AnonymousLoginResponse, BugReportType, BugSeverity, BugCategory, MyBugReportSummary, NotificationsResult, TesterSessionEndReason, TesterProfile, TesterPoints, EarningsSummary, PayoutRecord } from '@testerpaykit/api-client';
3
3
  export { BugCategory, BugReportAttachmentInput, BugReportAttachmentResponse, BugReportType, BugSeverity, EarningsSummary, EnrollmentResponse, MyBugReportSummary, MyBugReportsResponse, NotificationsResult, PayoutRecord, TaskListFilter, TaskListResponse, TesterPoints, TesterProfile, TesterTask, TpkNotification } from '@testerpaykit/api-client';
4
+ import { RemoteAiSession } from '@testerpaykit/core';
4
5
  import React, { RefObject, ReactNode } from 'react';
5
6
  import { StyleProp, ViewStyle, TextStyle } from 'react-native';
6
7
 
@@ -692,6 +693,12 @@ declare class TpkExpo {
692
693
  markNotificationsRead(params?: {
693
694
  id?: string;
694
695
  }): Promise<number>;
696
+ /**
697
+ * Claim an AI-tester run started from outside (console or
698
+ * `tpk autotest`) for this app's project. Null when nothing waits.
699
+ * Used by the wrapper's `aiRemoteTrigger` poll.
700
+ */
701
+ claimRemoteAiSession(): Promise<RemoteAiSession | null>;
695
702
  /**
696
703
  * Onboard with a runtime invite code (instead of the baked-in
697
704
  * config.testerCode): authenticate anonymously with `code`, persist the
@@ -1713,6 +1720,21 @@ interface VoiceExtractResult {
1713
1720
  * surface a retry UI.
1714
1721
  */
1715
1722
  declare function extractVoiceBug(tpk: Pick<TpkExpo, 'api'>, audio: VoiceExtractAudio): Promise<VoiceExtractResult>;
1723
+ /** One-tap report kinds of the sheet's quick actions (server wire names). */
1724
+ type QuickActionKind = 'broken' | 'confusing' | 'looks_broken' | 'missing';
1725
+ /**
1726
+ * Ask the server for a report draft written from a screenshot of the
1727
+ * screen the tester is on — the quick-action path next to voice. Returns
1728
+ * the same shape as {@link extractVoiceBug} so the review step and the
1729
+ * bug-report pre-fill stay one code path; `transcript` is empty because
1730
+ * nobody spoke.
1731
+ */
1732
+ declare function quickDraftBug(tpk: Pick<TpkExpo, 'api'>, input: {
1733
+ action: QuickActionKind;
1734
+ screenshotBase64: string;
1735
+ screenName?: string;
1736
+ language?: string;
1737
+ }): Promise<VoiceExtractResult>;
1716
1738
 
1717
1739
  type VoiceClassification = 'bug' | 'featureRequest' | 'idea' | 'issue';
1718
1740
  /** Per-string overrides — pass to host-localise. Any unset value
@@ -1737,6 +1759,15 @@ interface VoiceBugStrings {
1737
1759
  retry?: string;
1738
1760
  useExtracted?: string;
1739
1761
  rerecord?: string;
1762
+ quickHint?: string;
1763
+ quickBroken?: string;
1764
+ quickConfusing?: string;
1765
+ quickLooksBroken?: string;
1766
+ quickMissing?: string;
1767
+ quickProcessingDescription?: string;
1768
+ quickExtractedDescription?: string;
1769
+ quickNoScreenshot?: string;
1770
+ back?: string;
1740
1771
  }
1741
1772
  interface VoiceBugInputSheetProps {
1742
1773
  visible: boolean;
@@ -1776,10 +1807,19 @@ interface VoiceBugInputSheetProps {
1776
1807
  /** Host-side string overrides. Any missing key falls back to the
1777
1808
  * German default copy. */
1778
1809
  strings?: VoiceBugStrings;
1810
+ /**
1811
+ * Base64 PNG of the app screen behind the sheet. When set, the sheet
1812
+ * offers the quick actions (Geht nicht / Versteh ich nicht / Sieht
1813
+ * kaputt aus / Fehlt mir): one tap, and a vision model drafts the
1814
+ * report from this screenshot. The wrapper passes its root capture.
1815
+ */
1816
+ captureScreen?: () => Promise<string | null>;
1817
+ /** Screen name sent along with a quick action (model context). */
1818
+ currentScreen?: string;
1779
1819
  style?: StyleProp<ViewStyle>;
1780
1820
  testID?: string;
1781
1821
  }
1782
- declare function VoiceBugInputSheet({ visible, tpk, onCancel, onExtracted, maxSeconds, accentColor, sheetOpacity, voiceLanguage, strings, style, testID, }: VoiceBugInputSheetProps): React.ReactElement;
1822
+ declare function VoiceBugInputSheet({ visible, tpk, onCancel, onExtracted, maxSeconds, accentColor, sheetOpacity, voiceLanguage, strings, captureScreen, currentScreen, style, testID, }: VoiceBugInputSheetProps): React.ReactElement;
1783
1823
  /** Maps the sheet's classification onto the BugReportSheet's
1784
1824
  * BugReportType union. Exported so the host can call it when
1785
1825
  * building the initialDraft for the bug sheet. */
@@ -1905,6 +1945,14 @@ interface TesterPayKitWrapperProps {
1905
1945
  aiCoordinatorToken?: string;
1906
1946
  aiProjectId?: string;
1907
1947
  aiApiBaseUrl?: string;
1948
+ /** Let AI-tester runs started from outside (console "Start AI test",
1949
+ * `tpk autotest`) drive this app: while in the foreground the wrapper
1950
+ * asks the API every `aiRemotePollSeconds` whether a run is waiting
1951
+ * for this project and, if so, hands the app to it. Off by default —
1952
+ * only enable it in builds you want remote-controlled. */
1953
+ aiRemoteTrigger?: boolean;
1954
+ /** Poll interval for `aiRemoteTrigger`. Default 15. */
1955
+ aiRemotePollSeconds?: number;
1908
1956
  /** Currently active route — flows through to bug reports. */
1909
1957
  currentScreen?: string;
1910
1958
  /** When the session started — drives the earnings clock + the
@@ -1917,7 +1965,7 @@ interface TesterPayKitWrapperProps {
1917
1965
  theme?: Partial<TpkTheme>;
1918
1966
  testID?: string;
1919
1967
  }
1920
- declare function TesterPayKitWrapper({ children, tpk, enableWrapper, enableShake, shakeThresholdG, style, onShowDebugLogs, notificationCount, onFlushCachedCrashes, retestCount, onShowRetests, onViewDashboard, buttonPosition, currentScreen, sessionStartedAt, aiCoordinatorToken, aiProjectId, aiApiBaseUrl, theme, testID, }: TesterPayKitWrapperProps): React.ReactElement;
1968
+ declare function TesterPayKitWrapper({ children, tpk, enableWrapper, enableShake, shakeThresholdG, style, onShowDebugLogs, notificationCount, onFlushCachedCrashes, retestCount, onShowRetests, onViewDashboard, buttonPosition, currentScreen, sessionStartedAt, aiCoordinatorToken, aiRemoteTrigger, aiRemotePollSeconds, aiProjectId, aiApiBaseUrl, theme, testID, }: TesterPayKitWrapperProps): React.ReactElement;
1921
1969
 
1922
1970
  interface TpkAnnotatedProps {
1923
1971
  /** Task this element belongs to. */
@@ -2258,5 +2306,5 @@ declare function useTpkEarnings(tpk: TpkExpo | null, options?: {
2258
2306
  payoutLimit?: number;
2259
2307
  }): UseEarningsResult;
2260
2308
 
2261
- export { ANNOTATION_PALETTE, AttachmentQueue, Breadcrumbs, BugReportSheet, CrashQueue, DEFAULT_STYLE, DEFAULT_TPK_THEME, ExpoStorage, FloatingFeedbackButton, GeneralFeedbackDialog, INTERACTION_NAV_WEIGHT, InviteCodeScreen, MIN_INTERACTIONS_PER_ACTIVE_MINUTE, MyBugsSheet, NotificationsSheet, ONBOARDING_DONE_STORAGE_KEY, SCREENSHOT_CONSENT_STORAGE_KEY, ScreenRecorder, ScreenshotAnnotationEditor, SessionDetailsSheet, SessionEndDialog, SubmitQueue, TaskAnnotationRegistry, TesterDashboard, TesterPayKitProvider, TesterPayKitWrapper, TpkAnnotated, TpkAnnotationOverlay, TpkExpo, TpkIcon, TpkIconsProvider, TpkOnboarding, TpkSensitive, TpkTalker, TpkThemeProvider, TpkWelcomeSheet, VoiceBugInputSheet, VoiceNoteRecorder, WELCOME_ACK_STORAGE_KEY, WIDGET_TOUR_SEEN_STORAGE_KEY, WidgetDiscovery, WidgetTour, annotations, applySensitiveRedaction, arrowHeadPoints, beginNativeCapture, bugSeverityLabel, bugStatusStyle, canSubmitBugReportDraft, captureView, classificationToBugType, createBugReportDraft, deriveTaskProgress, emptyAnnotationDoc, endNativeCapture, engagedMinutes, extractVoiceBug, findAssignmentForTask, getAppSnapshot, getDeviceSnapshot, getEventCounts, getNativeCaptureMode, getSessionStats, getUniqueScreens, hasCompletedOnboarding, hasScreenshotConsent, hasSeenWidgetTour, hasWelcomeBriefBeenSeen, installCrashHandler, installNetworkCapture, markOnboardingComplete, markWelcomeBriefAsSeen, markWidgetTourSeen, mockBugFixes, mockBuildInfo, mockFocusAreas, mockWelcomeBrief, mockWelcomeTasks, mockWidgets, parseVersionRange, pathToSvgD, resetOnboardingState, resetWelcomeBriefAck, resetWidgetTourSeen, simplifyPath, submitBugReportDraft, subscribeNativeCaptureMode, uploadScreenshotAttachment, useShake, useTaskAnnotation, useTesterPayKit, useTpkDashboard, useTpkEarnings, useTpkTheme, versionSatisfies, widgetDiscovery, withNativeCapture };
2262
- export type { AnnotatedElementInfo, AnnotatedScreenshotResult, AnnotationColor, AnnotationEvent, AnnotationEventType, AnnotationInteraction, AnnotationListener, AnnotationShape, AnnotationStyle, AnnotationTool, AppSnapshot, ArrowShape, AttachmentQueueFlushOptions, BlurShape, Breadcrumb, BugFix, BugReportDraft, BugReportSheetProps, BuildInfo, CachedCrash, CaptureViewOptions, CircleShape, CompletionTrigger, CrashHandlerOptions, CrashInfo, CreateBugReportDraftInput, DashboardData, DeviceSnapshot, DiscoverOptions, EarningsData, EngagedMinutesInput, FeedbackCategory, FloatingFeedbackButtonProps, FlushTelemetryResult, FocusArea, GeneralFeedbackDialogProps, InstallNetworkCaptureOptions, InteractionBounds, InteractionType, InviteCodeScreenProps, MyBugsSheetProps, NotificationsSheetProps, OnboardingStorage, PathShape, PeriodFilter, Point, QueueFlushOptions, QueueFlushResult, RecordInteractionDetails, RecordingOptions, RecordingResult, RecordingState, RectShape, RegisterAnnotationInput, ReleaseNote, ScreenshotAnnotationEditorProps, ScreenshotResult, SensitiveMaskingMode, SessionDetailsSheetProps, SessionEndDialogProps, SessionEndStats, SessionStatsSnapshot, StatusStyle, SubmitBugInput, TaskAnnotation, TaskInteractionSummary, TaskProgress, TesterDashboardProps, TesterPayKitContextValue, TesterPayKitProviderProps, TesterPayKitWrapperProps, TextShape, TpkAnnotatedProps, TpkAnnotationOverlayHandle, TpkAnnotationOverlayProps, TpkExpoConfig, TpkIconName, TpkIconOverrideMap, TpkIconProps, TpkLogEntry, TpkLogLevel, TpkOnboardingProps, TpkSensitiveProps, TpkStorage, TpkTalkerListener, TpkTalkerOptions, TpkTheme, TpkWelcomeSheetProps, UseDashboardResult, UseEarningsResult, UseShakeOptions, UseTaskAnnotationOptions, UseTaskAnnotationResult, VersionRange, VoiceBugInputSheetProps, VoiceBugStrings, VoiceClassification, VoiceExtractAudio, VoiceExtractResult, VoiceNoteFileReader, VoiceNoteRecorderLike, VoiceNoteRecorderOptions, VoiceNoteResult, VoiceNoteState, WelcomeAckStorage, WelcomeBrief, WelcomeTask, WidgetInfo, WidgetTourProps };
2309
+ export { ANNOTATION_PALETTE, AttachmentQueue, Breadcrumbs, BugReportSheet, CrashQueue, DEFAULT_STYLE, DEFAULT_TPK_THEME, ExpoStorage, FloatingFeedbackButton, GeneralFeedbackDialog, INTERACTION_NAV_WEIGHT, InviteCodeScreen, MIN_INTERACTIONS_PER_ACTIVE_MINUTE, MyBugsSheet, NotificationsSheet, ONBOARDING_DONE_STORAGE_KEY, SCREENSHOT_CONSENT_STORAGE_KEY, ScreenRecorder, ScreenshotAnnotationEditor, SessionDetailsSheet, SessionEndDialog, SubmitQueue, TaskAnnotationRegistry, TesterDashboard, TesterPayKitProvider, TesterPayKitWrapper, TpkAnnotated, TpkAnnotationOverlay, TpkExpo, TpkIcon, TpkIconsProvider, TpkOnboarding, TpkSensitive, TpkTalker, TpkThemeProvider, TpkWelcomeSheet, VoiceBugInputSheet, VoiceNoteRecorder, WELCOME_ACK_STORAGE_KEY, WIDGET_TOUR_SEEN_STORAGE_KEY, WidgetDiscovery, WidgetTour, annotations, applySensitiveRedaction, arrowHeadPoints, beginNativeCapture, bugSeverityLabel, bugStatusStyle, canSubmitBugReportDraft, captureView, classificationToBugType, createBugReportDraft, deriveTaskProgress, emptyAnnotationDoc, endNativeCapture, engagedMinutes, extractVoiceBug, findAssignmentForTask, getAppSnapshot, getDeviceSnapshot, getEventCounts, getNativeCaptureMode, getSessionStats, getUniqueScreens, hasCompletedOnboarding, hasScreenshotConsent, hasSeenWidgetTour, hasWelcomeBriefBeenSeen, installCrashHandler, installNetworkCapture, markOnboardingComplete, markWelcomeBriefAsSeen, markWidgetTourSeen, mockBugFixes, mockBuildInfo, mockFocusAreas, mockWelcomeBrief, mockWelcomeTasks, mockWidgets, parseVersionRange, pathToSvgD, quickDraftBug, resetOnboardingState, resetWelcomeBriefAck, resetWidgetTourSeen, simplifyPath, submitBugReportDraft, subscribeNativeCaptureMode, uploadScreenshotAttachment, useShake, useTaskAnnotation, useTesterPayKit, useTpkDashboard, useTpkEarnings, useTpkTheme, versionSatisfies, widgetDiscovery, withNativeCapture };
2310
+ export type { AnnotatedElementInfo, AnnotatedScreenshotResult, AnnotationColor, AnnotationEvent, AnnotationEventType, AnnotationInteraction, AnnotationListener, AnnotationShape, AnnotationStyle, AnnotationTool, AppSnapshot, ArrowShape, AttachmentQueueFlushOptions, BlurShape, Breadcrumb, BugFix, BugReportDraft, BugReportSheetProps, BuildInfo, CachedCrash, CaptureViewOptions, CircleShape, CompletionTrigger, CrashHandlerOptions, CrashInfo, CreateBugReportDraftInput, DashboardData, DeviceSnapshot, DiscoverOptions, EarningsData, EngagedMinutesInput, FeedbackCategory, FloatingFeedbackButtonProps, FlushTelemetryResult, FocusArea, GeneralFeedbackDialogProps, InstallNetworkCaptureOptions, InteractionBounds, InteractionType, InviteCodeScreenProps, MyBugsSheetProps, NotificationsSheetProps, OnboardingStorage, PathShape, PeriodFilter, Point, QueueFlushOptions, QueueFlushResult, QuickActionKind, RecordInteractionDetails, RecordingOptions, RecordingResult, RecordingState, RectShape, RegisterAnnotationInput, ReleaseNote, ScreenshotAnnotationEditorProps, ScreenshotResult, SensitiveMaskingMode, SessionDetailsSheetProps, SessionEndDialogProps, SessionEndStats, SessionStatsSnapshot, StatusStyle, SubmitBugInput, TaskAnnotation, TaskInteractionSummary, TaskProgress, TesterDashboardProps, TesterPayKitContextValue, TesterPayKitProviderProps, TesterPayKitWrapperProps, TextShape, TpkAnnotatedProps, TpkAnnotationOverlayHandle, TpkAnnotationOverlayProps, TpkExpoConfig, TpkIconName, TpkIconOverrideMap, TpkIconProps, TpkLogEntry, TpkLogLevel, TpkOnboardingProps, TpkSensitiveProps, TpkStorage, TpkTalkerListener, TpkTalkerOptions, TpkTheme, TpkWelcomeSheetProps, UseDashboardResult, UseEarningsResult, UseShakeOptions, UseTaskAnnotationOptions, UseTaskAnnotationResult, VersionRange, VoiceBugInputSheetProps, VoiceBugStrings, VoiceClassification, VoiceExtractAudio, VoiceExtractResult, VoiceNoteFileReader, VoiceNoteRecorderLike, VoiceNoteRecorderOptions, VoiceNoteResult, VoiceNoteState, WelcomeAckStorage, WelcomeBrief, WelcomeTask, WidgetInfo, WidgetTourProps };
package/dist/index.js CHANGED
@@ -190,6 +190,7 @@ __export(index_exports, {
190
190
  mockWidgets: () => mockWidgets,
191
191
  parseVersionRange: () => parseVersionRange,
192
192
  pathToSvgD: () => pathToSvgD,
193
+ quickDraftBug: () => quickDraftBug,
193
194
  resetOnboardingState: () => resetOnboardingState,
194
195
  resetWelcomeBriefAck: () => resetWelcomeBriefAck,
195
196
  resetWidgetTourSeen: () => resetWidgetTourSeen,
@@ -1208,7 +1209,7 @@ function findAssignmentForTask(tasks, key) {
1208
1209
  }
1209
1210
 
1210
1211
  // package.json
1211
- var version = "0.7.5";
1212
+ var version = "0.9.0";
1212
1213
 
1213
1214
  // src/version.ts
1214
1215
  var SDK_VERSION = `@testerpaykit/expo/${version}`;
@@ -1519,6 +1520,14 @@ var TpkExpo = class _TpkExpo {
1519
1520
  async markNotificationsRead(params) {
1520
1521
  return this.api.markNotificationsRead(params);
1521
1522
  }
1523
+ /**
1524
+ * Claim an AI-tester run started from outside (console or
1525
+ * `tpk autotest`) for this app's project. Null when nothing waits.
1526
+ * Used by the wrapper's `aiRemoteTrigger` poll.
1527
+ */
1528
+ async claimRemoteAiSession() {
1529
+ return this.api.claimRemoteAiSession(this.config.projectId);
1530
+ }
1522
1531
  /**
1523
1532
  * Onboard with a runtime invite code (instead of the baked-in
1524
1533
  * config.testerCode): authenticate anonymously with `code`, persist the
@@ -1895,6 +1904,12 @@ async function startServerSession(api, projectId) {
1895
1904
  appVersion: appSnapshot.version,
1896
1905
  sdkVersion: SDK_VERSION
1897
1906
  });
1907
+ if (typeof __DEV__ !== "undefined" && __DEV__ && session.sdkUpdate) {
1908
+ const u = session.sdkUpdate;
1909
+ console.warn(
1910
+ `[testerpaykit/expo] ${u.package} ${u.current} is outdated \u2014 ${u.latest} is out. Update: ${u.command}`
1911
+ );
1912
+ }
1898
1913
  return session.id;
1899
1914
  }
1900
1915
  async function loadPersistedSession(storage, projectId, testerCode) {
@@ -7719,6 +7734,25 @@ async function extractVoiceBug(tpk, audio) {
7719
7734
  sourceLanguage: audio.language ?? result.detectedLanguage
7720
7735
  };
7721
7736
  }
7737
+ async function quickDraftBug(tpk, input) {
7738
+ const client = tpk.api.client;
7739
+ if (!client) {
7740
+ throw new Error("TpkExpo client did not expose an axios instance.");
7741
+ }
7742
+ const response = await client.post("/v1/testers/me/bug-reports/quick-draft", {
7743
+ action: input.action,
7744
+ screenshot_base64: input.screenshotBase64,
7745
+ ...input.screenName ? { screen_name: input.screenName } : {},
7746
+ ...input.language ? { language: input.language } : {}
7747
+ });
7748
+ return {
7749
+ ...response.data,
7750
+ transcript: "",
7751
+ transcriptConfidence: 1,
7752
+ lowConfidence: false,
7753
+ sourceLanguage: input.language
7754
+ };
7755
+ }
7722
7756
 
7723
7757
  // src/VoiceBugInputSheet.tsx
7724
7758
  var DEFAULT_STRINGS = {
@@ -7740,8 +7774,38 @@ var DEFAULT_STRINGS = {
7740
7774
  cancel: "Abbrechen",
7741
7775
  retry: "Nochmal versuchen",
7742
7776
  useExtracted: "\xDCbernehmen \u2192",
7743
- rerecord: "Nochmal aufnehmen"
7777
+ rerecord: "Nochmal aufnehmen",
7778
+ quickHint: "Oder mit einem Tipp \u2014 wir lesen den Screen:",
7779
+ quickBroken: "Geht nicht",
7780
+ quickConfusing: "Versteh ich nicht",
7781
+ quickLooksBroken: "Sieht kaputt aus",
7782
+ quickMissing: "Fehlt mir",
7783
+ quickProcessingDescription: "Die KI schaut sich den Screen an und schreibt einen Entwurf. ~3-5 Sekunden.",
7784
+ quickExtractedDescription: "Entwurf aus dem Screenshot \u2014 pr\xFCf jede Zeile, bevor du \xFCbernimmst. Nichts wird ohne dich gesendet.",
7785
+ quickNoScreenshot: "Vom Screen lie\xDF sich kein Bild aufnehmen.",
7786
+ back: "Zur\xFCck"
7744
7787
  };
7788
+ var QUICK_ACTIONS = [
7789
+ { kind: "broken", emoji: "\u{1F6AB}", label: "quickBroken", classification: "bug" },
7790
+ {
7791
+ kind: "confusing",
7792
+ emoji: "\u{1F914}",
7793
+ label: "quickConfusing",
7794
+ classification: "issue"
7795
+ },
7796
+ {
7797
+ kind: "looks_broken",
7798
+ emoji: "\u{1F9E9}",
7799
+ label: "quickLooksBroken",
7800
+ classification: "issue"
7801
+ },
7802
+ {
7803
+ kind: "missing",
7804
+ emoji: "\u2795",
7805
+ label: "quickMissing",
7806
+ classification: "featureRequest"
7807
+ }
7808
+ ];
7745
7809
  var CLASSIFICATIONS = [
7746
7810
  "bug",
7747
7811
  "featureRequest",
@@ -7758,6 +7822,8 @@ function VoiceBugInputSheet({
7758
7822
  sheetOpacity = 1,
7759
7823
  voiceLanguage,
7760
7824
  strings,
7825
+ captureScreen,
7826
+ currentScreen,
7761
7827
  style,
7762
7828
  testID = "tpk-voice-bug-sheet"
7763
7829
  }) {
@@ -7770,6 +7836,7 @@ function VoiceBugInputSheet({
7770
7836
  const [seconds, setSeconds] = (0, import_react16.useState)(0);
7771
7837
  const [error, setError] = (0, import_react16.useState)(null);
7772
7838
  const [result, setResult] = (0, import_react16.useState)(null);
7839
+ const [quickMode, setQuickMode] = (0, import_react16.useState)(false);
7773
7840
  const [language, setLanguage] = (0, import_react16.useState)(
7774
7841
  voiceLanguage ?? "auto"
7775
7842
  );
@@ -7913,10 +7980,37 @@ function VoiceBugInputSheet({
7913
7980
  recorderRef.current = null;
7914
7981
  onCancel();
7915
7982
  }, [onCancel]);
7983
+ const runQuick = (0, import_react16.useCallback)(
7984
+ async (action) => {
7985
+ if (phase !== "idle" || !captureScreen) return;
7986
+ setQuickMode(true);
7987
+ setClassification(action.classification);
7988
+ setError(null);
7989
+ setPhase("uploading");
7990
+ try {
7991
+ const shot = await captureScreen();
7992
+ if (!shot) throw new Error(S.quickNoScreenshot);
7993
+ if (!tpk) throw new Error("SDK not ready \u2014 try again in a moment.");
7994
+ const draft = await quickDraftBug(tpk, {
7995
+ action: action.kind,
7996
+ screenshotBase64: shot,
7997
+ screenName: currentScreen,
7998
+ language: language === "auto" ? void 0 : language
7999
+ });
8000
+ setResult(draft);
8001
+ setPhase("extracted");
8002
+ } catch (e) {
8003
+ setPhase("error");
8004
+ setError(e instanceof Error ? e.message : String(e));
8005
+ }
8006
+ },
8007
+ [phase, captureScreen, tpk, currentScreen, language, S]
8008
+ );
7916
8009
  const useResult = (0, import_react16.useCallback)(() => {
7917
8010
  if (result) onExtracted(result, classification);
7918
8011
  }, [result, classification, onExtracted]);
7919
8012
  const retryFresh = (0, import_react16.useCallback)(() => {
8013
+ setQuickMode(false);
7920
8014
  setResult(null);
7921
8015
  setSeconds(0);
7922
8016
  setError(null);
@@ -7943,13 +8037,13 @@ function VoiceBugInputSheet({
7943
8037
  case "recording":
7944
8038
  return S.recordingDescription;
7945
8039
  case "uploading":
7946
- return S.processingDescription;
8040
+ return quickMode ? S.quickProcessingDescription : S.processingDescription;
7947
8041
  case "extracted":
7948
- return S.extractedDescription;
8042
+ return quickMode ? S.quickExtractedDescription : S.extractedDescription;
7949
8043
  case "error":
7950
8044
  return error ?? S.errorDescriptionFallback;
7951
8045
  }
7952
- }, [phase, error, S]);
8046
+ }, [phase, error, S, quickMode]);
7953
8047
  const classificationLabel = (0, import_react16.useCallback)(
7954
8048
  (c) => {
7955
8049
  switch (c) {
@@ -8100,7 +8194,7 @@ function VoiceBugInputSheet({
8100
8194
  style: styles11.extractedScroll,
8101
8195
  contentContainerStyle: styles11.extractedScrollContent
8102
8196
  },
8103
- /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles11.transcriptCard }, /* @__PURE__ */ import_react16.default.createElement(import_react_native16.Text, { style: styles11.transcriptLabel }, "Transcript"), /* @__PURE__ */ import_react16.default.createElement(import_react_native16.Text, { style: styles11.transcriptText }, result.transcript || "(empty)")),
8197
+ quickMode ? null : /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles11.transcriptCard }, /* @__PURE__ */ import_react16.default.createElement(import_react_native16.Text, { style: styles11.transcriptLabel }, "Transcript"), /* @__PURE__ */ import_react16.default.createElement(import_react_native16.Text, { style: styles11.transcriptText }, result.transcript || "(empty)")),
8104
8198
  /* @__PURE__ */ import_react16.default.createElement(ExtractField, { label: "Title", value: result.title }),
8105
8199
  /* @__PURE__ */ import_react16.default.createElement(
8106
8200
  ExtractField,
@@ -8124,7 +8218,22 @@ function VoiceBugInputSheet({
8124
8218
  }
8125
8219
  ),
8126
8220
  /* @__PURE__ */ import_react16.default.createElement(ExtractField, { label: "Frequency", value: result.frequency })
8127
- ), /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles11.primaryRow }, isIdle && /* @__PURE__ */ import_react16.default.createElement(
8221
+ ), isIdle && captureScreen ? /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles11.quickBlock }, /* @__PURE__ */ import_react16.default.createElement(import_react_native16.Text, { style: styles11.quickHint }, S.quickHint), /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles11.quickGrid }, QUICK_ACTIONS.map((a) => /* @__PURE__ */ import_react16.default.createElement(
8222
+ import_react_native16.Pressable,
8223
+ {
8224
+ key: a.kind,
8225
+ accessibilityRole: "button",
8226
+ accessibilityLabel: S[a.label],
8227
+ testID: `tpk-quick-${a.kind}`,
8228
+ onPress: () => void runQuick(a),
8229
+ style: ({ pressed }) => [
8230
+ styles11.quickButton,
8231
+ pressed && { opacity: 0.8 }
8232
+ ]
8233
+ },
8234
+ /* @__PURE__ */ import_react16.default.createElement(import_react_native16.Text, { style: styles11.quickEmoji }, a.emoji),
8235
+ /* @__PURE__ */ import_react16.default.createElement(import_react_native16.Text, { style: styles11.quickLabel }, S[a.label])
8236
+ )))) : null, /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles11.primaryRow }, isIdle && /* @__PURE__ */ import_react16.default.createElement(
8128
8237
  import_react_native16.Pressable,
8129
8238
  {
8130
8239
  accessibilityRole: "button",
@@ -8168,7 +8277,7 @@ function VoiceBugInputSheet({
8168
8277
  pressed && { opacity: 0.85 }
8169
8278
  ]
8170
8279
  },
8171
- /* @__PURE__ */ import_react16.default.createElement(import_react_native16.Text, { style: styles11.secondaryButtonLabel }, isError ? S.retry : S.rerecord)
8280
+ /* @__PURE__ */ import_react16.default.createElement(import_react_native16.Text, { style: styles11.secondaryButtonLabel }, quickMode ? S.back : isError ? S.retry : S.rerecord)
8172
8281
  ), isExtracted && /* @__PURE__ */ import_react16.default.createElement(
8173
8282
  import_react_native16.Pressable,
8174
8283
  {
@@ -8460,6 +8569,41 @@ var styles11 = import_react_native16.StyleSheet.create({
8460
8569
  marginTop: 8,
8461
8570
  lineHeight: 20
8462
8571
  },
8572
+ quickBlock: {
8573
+ marginTop: 16
8574
+ },
8575
+ quickHint: {
8576
+ color: "#94A3B8",
8577
+ fontSize: 13,
8578
+ textAlign: "center",
8579
+ marginBottom: 8
8580
+ },
8581
+ quickGrid: {
8582
+ flexDirection: "row",
8583
+ flexWrap: "wrap",
8584
+ gap: 8
8585
+ },
8586
+ quickButton: {
8587
+ flexGrow: 1,
8588
+ flexBasis: "45%",
8589
+ flexDirection: "row",
8590
+ alignItems: "center",
8591
+ gap: 8,
8592
+ paddingHorizontal: 12,
8593
+ paddingVertical: 12,
8594
+ borderRadius: 12,
8595
+ backgroundColor: "rgba(255,255,255,0.08)",
8596
+ borderWidth: 1,
8597
+ borderColor: "rgba(255,255,255,0.15)"
8598
+ },
8599
+ quickEmoji: {
8600
+ fontSize: 18
8601
+ },
8602
+ quickLabel: {
8603
+ color: "#F1F5F9",
8604
+ fontSize: 14,
8605
+ fontWeight: "600"
8606
+ },
8463
8607
  timer: {
8464
8608
  fontSize: 40,
8465
8609
  fontWeight: "700",
@@ -9852,6 +9996,7 @@ function AiRemoteControl({
9852
9996
  apiBaseUrl,
9853
9997
  coordinatorToken,
9854
9998
  projectId,
9999
+ remoteSession,
9855
10000
  configuration,
9856
10001
  onClose,
9857
10002
  onSessionEnded,
@@ -9877,12 +10022,19 @@ function AiRemoteControl({
9877
10022
  wsRef.current = null;
9878
10023
  return;
9879
10024
  }
9880
- setStatus("choosing");
9881
10025
  setActionCount(0);
9882
10026
  setErrorMessage(null);
9883
- setSessionId(null);
9884
10027
  closedRef.current = false;
9885
10028
  (0, import_ai_tester.resetWidgetIds)();
10029
+ if (remoteSession) {
10030
+ setStatus("starting");
10031
+ setSessionId(remoteSession.sessionId);
10032
+ _openSocket(remoteSession.wsUrl);
10033
+ return;
10034
+ }
10035
+ setStatus("choosing");
10036
+ setSessionId(null);
10037
+ if (!apiBaseUrl || !coordinatorToken) return;
9886
10038
  let cancelled = false;
9887
10039
  void (async () => {
9888
10040
  try {
@@ -9902,12 +10054,15 @@ function AiRemoteControl({
9902
10054
  return () => {
9903
10055
  cancelled = true;
9904
10056
  };
9905
- }, [visible, apiBaseUrl, coordinatorToken]);
10057
+ }, [visible, apiBaseUrl, coordinatorToken, remoteSession]);
9906
10058
  const _start = (0, import_react22.useCallback)(
9907
10059
  () => {
9908
10060
  setStatus("starting");
9909
10061
  void (async () => {
9910
10062
  try {
10063
+ if (!apiBaseUrl || !coordinatorToken || !projectId) {
10064
+ throw new Error("AI test needs apiBaseUrl, coordinatorToken and projectId");
10065
+ }
9911
10066
  const resp = await fetch(
9912
10067
  `${apiBaseUrl}/v1/coordinator/projects/${projectId}/ai-sessions`,
9913
10068
  {
@@ -10246,6 +10401,8 @@ function TesterPayKitWrapper({
10246
10401
  currentScreen,
10247
10402
  sessionStartedAt,
10248
10403
  aiCoordinatorToken,
10404
+ aiRemoteTrigger = false,
10405
+ aiRemotePollSeconds = 15,
10249
10406
  aiProjectId,
10250
10407
  aiApiBaseUrl,
10251
10408
  theme,
@@ -10264,6 +10421,42 @@ function TesterPayKitWrapper({
10264
10421
  const [unreadMessages, setUnreadMessages] = (0, import_react23.useState)(0);
10265
10422
  const aiReady = Boolean(aiCoordinatorToken && aiProjectId && aiApiBaseUrl);
10266
10423
  const onAutoTest = aiReady ? () => setAiOpen(true) : void 0;
10424
+ const [remoteSession, setRemoteSession] = (0, import_react23.useState)(
10425
+ null
10426
+ );
10427
+ const remoteSessionRef = (0, import_react23.useRef)(null);
10428
+ (0, import_react23.useEffect)(() => {
10429
+ remoteSessionRef.current = remoteSession;
10430
+ }, [remoteSession]);
10431
+ (0, import_react23.useEffect)(() => {
10432
+ if (!aiRemoteTrigger || !tpk || aiOpen) return;
10433
+ let busy = false;
10434
+ const poll = async () => {
10435
+ if (busy || import_react_native23.AppState.currentState !== "active") return;
10436
+ busy = true;
10437
+ try {
10438
+ const claimed = await tpk.claimRemoteAiSession();
10439
+ if (claimed) {
10440
+ setRemoteSession(claimed);
10441
+ setAiOpen(true);
10442
+ }
10443
+ } catch {
10444
+ } finally {
10445
+ busy = false;
10446
+ }
10447
+ };
10448
+ void poll();
10449
+ const timer = setInterval(poll, aiRemotePollSeconds * 1e3);
10450
+ return () => clearInterval(timer);
10451
+ }, [aiRemoteTrigger, aiRemotePollSeconds, tpk, aiOpen]);
10452
+ (0, import_react23.useEffect)(() => {
10453
+ if (!aiOpen) return;
10454
+ const g = globalThis;
10455
+ g.__tpkCaptureScreenshot = async () => (await captureView(rootRef))?.base64 ?? null;
10456
+ return () => {
10457
+ delete g.__tpkCaptureScreenshot;
10458
+ };
10459
+ }, [aiOpen]);
10267
10460
  const sessionAnchor = (0, import_react23.useRef)(sessionStartedAt ?? null);
10268
10461
  (0, import_react23.useEffect)(() => {
10269
10462
  if (sessionStartedAt) {
@@ -10344,7 +10537,8 @@ function TesterPayKitWrapper({
10344
10537
  // Voice-bug split (A2): the title/description above are the
10345
10538
  // tester's O-Ton. Carry the transcript + language so submit
10346
10539
  // stores the author view + derives the English enriched fields.
10347
- transcript: result.transcript,
10540
+ // Quick actions have no spoken O-Ton — leave it unset then.
10541
+ transcript: result.transcript || void 0,
10348
10542
  sourceLanguage: result.sourceLanguage
10349
10543
  });
10350
10544
  setVoiceOpen(false);
@@ -10386,14 +10580,25 @@ function TesterPayKitWrapper({
10386
10580
  sessionStartedAt: sessionAnchor.current ?? void 0
10387
10581
  }
10388
10582
  ),
10389
- aiReady && /* @__PURE__ */ import_react23.default.createElement(
10583
+ (aiReady || remoteSession) && /* @__PURE__ */ import_react23.default.createElement(
10390
10584
  AiRemoteControl,
10391
10585
  {
10392
10586
  visible: aiOpen,
10393
10587
  apiBaseUrl: aiApiBaseUrl,
10394
10588
  coordinatorToken: aiCoordinatorToken,
10395
10589
  projectId: aiProjectId,
10396
- onClose: () => setAiOpen(false)
10590
+ remoteSession,
10591
+ onClose: () => {
10592
+ setAiOpen(false);
10593
+ setRemoteSession(null);
10594
+ },
10595
+ onSessionEnded: () => {
10596
+ if (!remoteSessionRef.current) return;
10597
+ setTimeout(() => {
10598
+ setAiOpen(false);
10599
+ setRemoteSession(null);
10600
+ }, 3e3);
10601
+ }
10397
10602
  }
10398
10603
  ),
10399
10604
  /* @__PURE__ */ import_react23.default.createElement(
@@ -10433,7 +10638,9 @@ function TesterPayKitWrapper({
10433
10638
  visible: voiceOpen,
10434
10639
  tpk,
10435
10640
  onCancel: () => setVoiceOpen(false),
10436
- onExtracted: handleVoiceExtracted
10641
+ onExtracted: handleVoiceExtracted,
10642
+ currentScreen: currentScreen ?? void 0,
10643
+ captureScreen: async () => (await captureView(rootRef))?.base64 ?? null
10437
10644
  }
10438
10645
  ),
10439
10646
  /* @__PURE__ */ import_react23.default.createElement(
@@ -10944,6 +11151,7 @@ function useTpkEarnings(tpk, options = {}) {
10944
11151
  mockWidgets,
10945
11152
  parseVersionRange,
10946
11153
  pathToSvgD,
11154
+ quickDraftBug,
10947
11155
  resetOnboardingState,
10948
11156
  resetWelcomeBriefAck,
10949
11157
  resetWidgetTourSeen,
package/dist/index.mjs CHANGED
@@ -1003,7 +1003,7 @@ function findAssignmentForTask(tasks, key) {
1003
1003
  }
1004
1004
 
1005
1005
  // package.json
1006
- var version = "0.7.5";
1006
+ var version = "0.9.0";
1007
1007
 
1008
1008
  // src/version.ts
1009
1009
  var SDK_VERSION = `@testerpaykit/expo/${version}`;
@@ -1314,6 +1314,14 @@ var TpkExpo = class _TpkExpo {
1314
1314
  async markNotificationsRead(params) {
1315
1315
  return this.api.markNotificationsRead(params);
1316
1316
  }
1317
+ /**
1318
+ * Claim an AI-tester run started from outside (console or
1319
+ * `tpk autotest`) for this app's project. Null when nothing waits.
1320
+ * Used by the wrapper's `aiRemoteTrigger` poll.
1321
+ */
1322
+ async claimRemoteAiSession() {
1323
+ return this.api.claimRemoteAiSession(this.config.projectId);
1324
+ }
1317
1325
  /**
1318
1326
  * Onboard with a runtime invite code (instead of the baked-in
1319
1327
  * config.testerCode): authenticate anonymously with `code`, persist the
@@ -1690,6 +1698,12 @@ async function startServerSession(api, projectId) {
1690
1698
  appVersion: appSnapshot.version,
1691
1699
  sdkVersion: SDK_VERSION
1692
1700
  });
1701
+ if (typeof __DEV__ !== "undefined" && __DEV__ && session.sdkUpdate) {
1702
+ const u = session.sdkUpdate;
1703
+ console.warn(
1704
+ `[testerpaykit/expo] ${u.package} ${u.current} is outdated \u2014 ${u.latest} is out. Update: ${u.command}`
1705
+ );
1706
+ }
1693
1707
  return session.id;
1694
1708
  }
1695
1709
  async function loadPersistedSession(storage, projectId, testerCode) {
@@ -7625,6 +7639,25 @@ async function extractVoiceBug(tpk, audio) {
7625
7639
  sourceLanguage: audio.language ?? result.detectedLanguage
7626
7640
  };
7627
7641
  }
7642
+ async function quickDraftBug(tpk, input) {
7643
+ const client = tpk.api.client;
7644
+ if (!client) {
7645
+ throw new Error("TpkExpo client did not expose an axios instance.");
7646
+ }
7647
+ const response = await client.post("/v1/testers/me/bug-reports/quick-draft", {
7648
+ action: input.action,
7649
+ screenshot_base64: input.screenshotBase64,
7650
+ ...input.screenName ? { screen_name: input.screenName } : {},
7651
+ ...input.language ? { language: input.language } : {}
7652
+ });
7653
+ return {
7654
+ ...response.data,
7655
+ transcript: "",
7656
+ transcriptConfidence: 1,
7657
+ lowConfidence: false,
7658
+ sourceLanguage: input.language
7659
+ };
7660
+ }
7628
7661
 
7629
7662
  // src/VoiceBugInputSheet.tsx
7630
7663
  var DEFAULT_STRINGS = {
@@ -7646,8 +7679,38 @@ var DEFAULT_STRINGS = {
7646
7679
  cancel: "Abbrechen",
7647
7680
  retry: "Nochmal versuchen",
7648
7681
  useExtracted: "\xDCbernehmen \u2192",
7649
- rerecord: "Nochmal aufnehmen"
7682
+ rerecord: "Nochmal aufnehmen",
7683
+ quickHint: "Oder mit einem Tipp \u2014 wir lesen den Screen:",
7684
+ quickBroken: "Geht nicht",
7685
+ quickConfusing: "Versteh ich nicht",
7686
+ quickLooksBroken: "Sieht kaputt aus",
7687
+ quickMissing: "Fehlt mir",
7688
+ quickProcessingDescription: "Die KI schaut sich den Screen an und schreibt einen Entwurf. ~3-5 Sekunden.",
7689
+ quickExtractedDescription: "Entwurf aus dem Screenshot \u2014 pr\xFCf jede Zeile, bevor du \xFCbernimmst. Nichts wird ohne dich gesendet.",
7690
+ quickNoScreenshot: "Vom Screen lie\xDF sich kein Bild aufnehmen.",
7691
+ back: "Zur\xFCck"
7650
7692
  };
7693
+ var QUICK_ACTIONS = [
7694
+ { kind: "broken", emoji: "\u{1F6AB}", label: "quickBroken", classification: "bug" },
7695
+ {
7696
+ kind: "confusing",
7697
+ emoji: "\u{1F914}",
7698
+ label: "quickConfusing",
7699
+ classification: "issue"
7700
+ },
7701
+ {
7702
+ kind: "looks_broken",
7703
+ emoji: "\u{1F9E9}",
7704
+ label: "quickLooksBroken",
7705
+ classification: "issue"
7706
+ },
7707
+ {
7708
+ kind: "missing",
7709
+ emoji: "\u2795",
7710
+ label: "quickMissing",
7711
+ classification: "featureRequest"
7712
+ }
7713
+ ];
7651
7714
  var CLASSIFICATIONS = [
7652
7715
  "bug",
7653
7716
  "featureRequest",
@@ -7664,6 +7727,8 @@ function VoiceBugInputSheet({
7664
7727
  sheetOpacity = 1,
7665
7728
  voiceLanguage,
7666
7729
  strings,
7730
+ captureScreen,
7731
+ currentScreen,
7667
7732
  style,
7668
7733
  testID = "tpk-voice-bug-sheet"
7669
7734
  }) {
@@ -7676,6 +7741,7 @@ function VoiceBugInputSheet({
7676
7741
  const [seconds, setSeconds] = useState11(0);
7677
7742
  const [error, setError] = useState11(null);
7678
7743
  const [result, setResult] = useState11(null);
7744
+ const [quickMode, setQuickMode] = useState11(false);
7679
7745
  const [language, setLanguage] = useState11(
7680
7746
  voiceLanguage ?? "auto"
7681
7747
  );
@@ -7819,10 +7885,37 @@ function VoiceBugInputSheet({
7819
7885
  recorderRef.current = null;
7820
7886
  onCancel();
7821
7887
  }, [onCancel]);
7888
+ const runQuick = useCallback7(
7889
+ async (action) => {
7890
+ if (phase !== "idle" || !captureScreen) return;
7891
+ setQuickMode(true);
7892
+ setClassification(action.classification);
7893
+ setError(null);
7894
+ setPhase("uploading");
7895
+ try {
7896
+ const shot = await captureScreen();
7897
+ if (!shot) throw new Error(S.quickNoScreenshot);
7898
+ if (!tpk) throw new Error("SDK not ready \u2014 try again in a moment.");
7899
+ const draft = await quickDraftBug(tpk, {
7900
+ action: action.kind,
7901
+ screenshotBase64: shot,
7902
+ screenName: currentScreen,
7903
+ language: language === "auto" ? void 0 : language
7904
+ });
7905
+ setResult(draft);
7906
+ setPhase("extracted");
7907
+ } catch (e) {
7908
+ setPhase("error");
7909
+ setError(e instanceof Error ? e.message : String(e));
7910
+ }
7911
+ },
7912
+ [phase, captureScreen, tpk, currentScreen, language, S]
7913
+ );
7822
7914
  const useResult = useCallback7(() => {
7823
7915
  if (result) onExtracted(result, classification);
7824
7916
  }, [result, classification, onExtracted]);
7825
7917
  const retryFresh = useCallback7(() => {
7918
+ setQuickMode(false);
7826
7919
  setResult(null);
7827
7920
  setSeconds(0);
7828
7921
  setError(null);
@@ -7849,13 +7942,13 @@ function VoiceBugInputSheet({
7849
7942
  case "recording":
7850
7943
  return S.recordingDescription;
7851
7944
  case "uploading":
7852
- return S.processingDescription;
7945
+ return quickMode ? S.quickProcessingDescription : S.processingDescription;
7853
7946
  case "extracted":
7854
- return S.extractedDescription;
7947
+ return quickMode ? S.quickExtractedDescription : S.extractedDescription;
7855
7948
  case "error":
7856
7949
  return error ?? S.errorDescriptionFallback;
7857
7950
  }
7858
- }, [phase, error, S]);
7951
+ }, [phase, error, S, quickMode]);
7859
7952
  const classificationLabel = useCallback7(
7860
7953
  (c) => {
7861
7954
  switch (c) {
@@ -8006,7 +8099,7 @@ function VoiceBugInputSheet({
8006
8099
  style: styles11.extractedScroll,
8007
8100
  contentContainerStyle: styles11.extractedScrollContent
8008
8101
  },
8009
- /* @__PURE__ */ React14.createElement(View11, { style: styles11.transcriptCard }, /* @__PURE__ */ React14.createElement(Text10, { style: styles11.transcriptLabel }, "Transcript"), /* @__PURE__ */ React14.createElement(Text10, { style: styles11.transcriptText }, result.transcript || "(empty)")),
8102
+ quickMode ? null : /* @__PURE__ */ React14.createElement(View11, { style: styles11.transcriptCard }, /* @__PURE__ */ React14.createElement(Text10, { style: styles11.transcriptLabel }, "Transcript"), /* @__PURE__ */ React14.createElement(Text10, { style: styles11.transcriptText }, result.transcript || "(empty)")),
8010
8103
  /* @__PURE__ */ React14.createElement(ExtractField, { label: "Title", value: result.title }),
8011
8104
  /* @__PURE__ */ React14.createElement(
8012
8105
  ExtractField,
@@ -8030,7 +8123,22 @@ function VoiceBugInputSheet({
8030
8123
  }
8031
8124
  ),
8032
8125
  /* @__PURE__ */ React14.createElement(ExtractField, { label: "Frequency", value: result.frequency })
8033
- ), /* @__PURE__ */ React14.createElement(View11, { style: styles11.primaryRow }, isIdle && /* @__PURE__ */ React14.createElement(
8126
+ ), isIdle && captureScreen ? /* @__PURE__ */ React14.createElement(View11, { style: styles11.quickBlock }, /* @__PURE__ */ React14.createElement(Text10, { style: styles11.quickHint }, S.quickHint), /* @__PURE__ */ React14.createElement(View11, { style: styles11.quickGrid }, QUICK_ACTIONS.map((a) => /* @__PURE__ */ React14.createElement(
8127
+ Pressable9,
8128
+ {
8129
+ key: a.kind,
8130
+ accessibilityRole: "button",
8131
+ accessibilityLabel: S[a.label],
8132
+ testID: `tpk-quick-${a.kind}`,
8133
+ onPress: () => void runQuick(a),
8134
+ style: ({ pressed }) => [
8135
+ styles11.quickButton,
8136
+ pressed && { opacity: 0.8 }
8137
+ ]
8138
+ },
8139
+ /* @__PURE__ */ React14.createElement(Text10, { style: styles11.quickEmoji }, a.emoji),
8140
+ /* @__PURE__ */ React14.createElement(Text10, { style: styles11.quickLabel }, S[a.label])
8141
+ )))) : null, /* @__PURE__ */ React14.createElement(View11, { style: styles11.primaryRow }, isIdle && /* @__PURE__ */ React14.createElement(
8034
8142
  Pressable9,
8035
8143
  {
8036
8144
  accessibilityRole: "button",
@@ -8074,7 +8182,7 @@ function VoiceBugInputSheet({
8074
8182
  pressed && { opacity: 0.85 }
8075
8183
  ]
8076
8184
  },
8077
- /* @__PURE__ */ React14.createElement(Text10, { style: styles11.secondaryButtonLabel }, isError ? S.retry : S.rerecord)
8185
+ /* @__PURE__ */ React14.createElement(Text10, { style: styles11.secondaryButtonLabel }, quickMode ? S.back : isError ? S.retry : S.rerecord)
8078
8186
  ), isExtracted && /* @__PURE__ */ React14.createElement(
8079
8187
  Pressable9,
8080
8188
  {
@@ -8366,6 +8474,41 @@ var styles11 = StyleSheet11.create({
8366
8474
  marginTop: 8,
8367
8475
  lineHeight: 20
8368
8476
  },
8477
+ quickBlock: {
8478
+ marginTop: 16
8479
+ },
8480
+ quickHint: {
8481
+ color: "#94A3B8",
8482
+ fontSize: 13,
8483
+ textAlign: "center",
8484
+ marginBottom: 8
8485
+ },
8486
+ quickGrid: {
8487
+ flexDirection: "row",
8488
+ flexWrap: "wrap",
8489
+ gap: 8
8490
+ },
8491
+ quickButton: {
8492
+ flexGrow: 1,
8493
+ flexBasis: "45%",
8494
+ flexDirection: "row",
8495
+ alignItems: "center",
8496
+ gap: 8,
8497
+ paddingHorizontal: 12,
8498
+ paddingVertical: 12,
8499
+ borderRadius: 12,
8500
+ backgroundColor: "rgba(255,255,255,0.08)",
8501
+ borderWidth: 1,
8502
+ borderColor: "rgba(255,255,255,0.15)"
8503
+ },
8504
+ quickEmoji: {
8505
+ fontSize: 18
8506
+ },
8507
+ quickLabel: {
8508
+ color: "#F1F5F9",
8509
+ fontSize: 14,
8510
+ fontWeight: "600"
8511
+ },
8369
8512
  timer: {
8370
8513
  fontSize: 40,
8371
8514
  fontWeight: "700",
@@ -9796,6 +9939,7 @@ import React21, {
9796
9939
  useState as useState18
9797
9940
  } from "react";
9798
9941
  import {
9942
+ AppState as AppState3,
9799
9943
  Platform as Platform8,
9800
9944
  StyleSheet as StyleSheet18,
9801
9945
  View as View18
@@ -9821,6 +9965,7 @@ function AiRemoteControl({
9821
9965
  apiBaseUrl,
9822
9966
  coordinatorToken,
9823
9967
  projectId,
9968
+ remoteSession,
9824
9969
  configuration,
9825
9970
  onClose,
9826
9971
  onSessionEnded,
@@ -9846,12 +9991,19 @@ function AiRemoteControl({
9846
9991
  wsRef.current = null;
9847
9992
  return;
9848
9993
  }
9849
- setStatus("choosing");
9850
9994
  setActionCount(0);
9851
9995
  setErrorMessage(null);
9852
- setSessionId(null);
9853
9996
  closedRef.current = false;
9854
9997
  resetWidgetIds();
9998
+ if (remoteSession) {
9999
+ setStatus("starting");
10000
+ setSessionId(remoteSession.sessionId);
10001
+ _openSocket(remoteSession.wsUrl);
10002
+ return;
10003
+ }
10004
+ setStatus("choosing");
10005
+ setSessionId(null);
10006
+ if (!apiBaseUrl || !coordinatorToken) return;
9855
10007
  let cancelled = false;
9856
10008
  void (async () => {
9857
10009
  try {
@@ -9871,12 +10023,15 @@ function AiRemoteControl({
9871
10023
  return () => {
9872
10024
  cancelled = true;
9873
10025
  };
9874
- }, [visible, apiBaseUrl, coordinatorToken]);
10026
+ }, [visible, apiBaseUrl, coordinatorToken, remoteSession]);
9875
10027
  const _start = useCallback9(
9876
10028
  () => {
9877
10029
  setStatus("starting");
9878
10030
  void (async () => {
9879
10031
  try {
10032
+ if (!apiBaseUrl || !coordinatorToken || !projectId) {
10033
+ throw new Error("AI test needs apiBaseUrl, coordinatorToken and projectId");
10034
+ }
9880
10035
  const resp = await fetch(
9881
10036
  `${apiBaseUrl}/v1/coordinator/projects/${projectId}/ai-sessions`,
9882
10037
  {
@@ -10215,6 +10370,8 @@ function TesterPayKitWrapper({
10215
10370
  currentScreen,
10216
10371
  sessionStartedAt,
10217
10372
  aiCoordinatorToken,
10373
+ aiRemoteTrigger = false,
10374
+ aiRemotePollSeconds = 15,
10218
10375
  aiProjectId,
10219
10376
  aiApiBaseUrl,
10220
10377
  theme,
@@ -10233,6 +10390,42 @@ function TesterPayKitWrapper({
10233
10390
  const [unreadMessages, setUnreadMessages] = useState18(0);
10234
10391
  const aiReady = Boolean(aiCoordinatorToken && aiProjectId && aiApiBaseUrl);
10235
10392
  const onAutoTest = aiReady ? () => setAiOpen(true) : void 0;
10393
+ const [remoteSession, setRemoteSession] = useState18(
10394
+ null
10395
+ );
10396
+ const remoteSessionRef = useRef10(null);
10397
+ useEffect14(() => {
10398
+ remoteSessionRef.current = remoteSession;
10399
+ }, [remoteSession]);
10400
+ useEffect14(() => {
10401
+ if (!aiRemoteTrigger || !tpk || aiOpen) return;
10402
+ let busy = false;
10403
+ const poll = async () => {
10404
+ if (busy || AppState3.currentState !== "active") return;
10405
+ busy = true;
10406
+ try {
10407
+ const claimed = await tpk.claimRemoteAiSession();
10408
+ if (claimed) {
10409
+ setRemoteSession(claimed);
10410
+ setAiOpen(true);
10411
+ }
10412
+ } catch {
10413
+ } finally {
10414
+ busy = false;
10415
+ }
10416
+ };
10417
+ void poll();
10418
+ const timer = setInterval(poll, aiRemotePollSeconds * 1e3);
10419
+ return () => clearInterval(timer);
10420
+ }, [aiRemoteTrigger, aiRemotePollSeconds, tpk, aiOpen]);
10421
+ useEffect14(() => {
10422
+ if (!aiOpen) return;
10423
+ const g = globalThis;
10424
+ g.__tpkCaptureScreenshot = async () => (await captureView(rootRef))?.base64 ?? null;
10425
+ return () => {
10426
+ delete g.__tpkCaptureScreenshot;
10427
+ };
10428
+ }, [aiOpen]);
10236
10429
  const sessionAnchor = useRef10(sessionStartedAt ?? null);
10237
10430
  useEffect14(() => {
10238
10431
  if (sessionStartedAt) {
@@ -10313,7 +10506,8 @@ function TesterPayKitWrapper({
10313
10506
  // Voice-bug split (A2): the title/description above are the
10314
10507
  // tester's O-Ton. Carry the transcript + language so submit
10315
10508
  // stores the author view + derives the English enriched fields.
10316
- transcript: result.transcript,
10509
+ // Quick actions have no spoken O-Ton — leave it unset then.
10510
+ transcript: result.transcript || void 0,
10317
10511
  sourceLanguage: result.sourceLanguage
10318
10512
  });
10319
10513
  setVoiceOpen(false);
@@ -10355,14 +10549,25 @@ function TesterPayKitWrapper({
10355
10549
  sessionStartedAt: sessionAnchor.current ?? void 0
10356
10550
  }
10357
10551
  ),
10358
- aiReady && /* @__PURE__ */ React21.createElement(
10552
+ (aiReady || remoteSession) && /* @__PURE__ */ React21.createElement(
10359
10553
  AiRemoteControl,
10360
10554
  {
10361
10555
  visible: aiOpen,
10362
10556
  apiBaseUrl: aiApiBaseUrl,
10363
10557
  coordinatorToken: aiCoordinatorToken,
10364
10558
  projectId: aiProjectId,
10365
- onClose: () => setAiOpen(false)
10559
+ remoteSession,
10560
+ onClose: () => {
10561
+ setAiOpen(false);
10562
+ setRemoteSession(null);
10563
+ },
10564
+ onSessionEnded: () => {
10565
+ if (!remoteSessionRef.current) return;
10566
+ setTimeout(() => {
10567
+ setAiOpen(false);
10568
+ setRemoteSession(null);
10569
+ }, 3e3);
10570
+ }
10366
10571
  }
10367
10572
  ),
10368
10573
  /* @__PURE__ */ React21.createElement(
@@ -10402,7 +10607,9 @@ function TesterPayKitWrapper({
10402
10607
  visible: voiceOpen,
10403
10608
  tpk,
10404
10609
  onCancel: () => setVoiceOpen(false),
10405
- onExtracted: handleVoiceExtracted
10610
+ onExtracted: handleVoiceExtracted,
10611
+ currentScreen: currentScreen ?? void 0,
10612
+ captureScreen: async () => (await captureView(rootRef))?.base64 ?? null
10406
10613
  }
10407
10614
  ),
10408
10615
  /* @__PURE__ */ React21.createElement(
@@ -10920,6 +11127,7 @@ export {
10920
11127
  mockWidgets,
10921
11128
  parseVersionRange,
10922
11129
  pathToSvgD,
11130
+ quickDraftBug,
10923
11131
  resetOnboardingState,
10924
11132
  resetWelcomeBriefAck,
10925
11133
  resetWidgetTourSeen,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testerpaykit/expo",
3
- "version": "0.7.5",
3
+ "version": "0.9.0",
4
4
  "description": "TesterPayKit Expo / React-Native bindings — shake-to-report, device info, bug-report hook",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -20,9 +20,9 @@
20
20
  "CHANGELOG.md"
21
21
  ],
22
22
  "dependencies": {
23
- "@testerpaykit/ai-tester": "0.4.0",
24
- "@testerpaykit/api-client": "1.2.0",
25
- "@testerpaykit/core": "1.0.1"
23
+ "@testerpaykit/core": "1.2.0",
24
+ "@testerpaykit/ai-tester": "0.5.0",
25
+ "@testerpaykit/api-client": "1.4.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@expo/vector-icons": ">=14.0.0",