@testerpaykit/expo 0.10.0 → 0.11.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 +61 -0
- package/README.md +29 -0
- package/dist/chunk-M6XDJUYN.mjs +36 -0
- package/dist/index.d.mts +229 -6
- package/dist/index.d.ts +229 -6
- package/dist/index.js +2264 -562
- package/dist/index.mjs +2288 -617
- package/dist/storage-RD3WGNGX.mjs +6 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,67 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@testerpaykit/expo` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.11.0 — 2026-10-31
|
|
6
|
+
|
|
7
|
+
Requires `@testerpaykit/api-client` **^1.7.0** (the dependency range now
|
|
8
|
+
says so; publish api-client 1.7.0 first — `core` stays 1.3.0, `ai-tester`
|
|
9
|
+
0.5.0).
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- **Live link to Claude Code** (`enableLiveLink` on the wrapper, off by
|
|
13
|
+
default), same as the Flutter SDK: "Connect to Claude" / "Mit Claude
|
|
14
|
+
verbinden" holds a WebSocket while the app is in the foreground, so the
|
|
15
|
+
developer's Claude Code session can call MCP `device_snapshot`
|
|
16
|
+
(screenshot without the TPK button, every text and field value on
|
|
17
|
+
screen with positions, screen, navigation, breadcrumbs, recent SDK logs
|
|
18
|
+
and `tpk.liveStateProvider`). Reconnects after 2, 4, 8, 16, 30 s with
|
|
19
|
+
a fresh one-time URL; the choice survives restarts. "Send to Claude" /
|
|
20
|
+
"An Claude senden" captures the screen, asks for one line and sends a
|
|
21
|
+
note (`list_device_notes`). Password fields and `<TpkSensitive>` are
|
|
22
|
+
never read.
|
|
23
|
+
- **"Was testen?" / "What to test"** menu item, shown only while the
|
|
24
|
+
project's checklist is non-empty (badge: tasks not passed yet). Opens a
|
|
25
|
+
compact panel docked over the app — not a full-screen modal — so the
|
|
26
|
+
tester keeps seeing and using the app: tasks with the last result →
|
|
27
|
+
steps with ✓/✗ and an optional note → Send (`POST
|
|
28
|
+
/v1/testers/me/checklist/<task>/runs`). The panel collapses to one bar
|
|
29
|
+
showing the current step, moves between top and bottom edge and jumps
|
|
30
|
+
to the top while a note is typed. Loading is fail-safe (offline / not
|
|
31
|
+
in the project → item hidden).
|
|
32
|
+
- **Device actions over the live link**: Claude Code can tap (by text or
|
|
33
|
+
x/y), type (into the field named by placeholder or label, else the
|
|
34
|
+
focused or only one; optional submit), scroll and go back in the
|
|
35
|
+
developer's app (MCP `device_tap`, `device_type`, `device_scroll`,
|
|
36
|
+
`device_back`). Works on React's tree below the wrapper's content —
|
|
37
|
+
nearest `onPress`, `onChangeText` / `onSubmitEditing`, ScrollView /
|
|
38
|
+
FlatList `scrollTo(Offset)`, react-navigation / expo-router
|
|
39
|
+
`navigation.goBack()` — on native and web alike; never on TPK's own UI
|
|
40
|
+
or inside `<TpkSensitive>`. Labels on the deny list (delete account,
|
|
41
|
+
pay now, sign out, löschen, abmelden …, same as Flutter) are refused. A
|
|
42
|
+
short hint "Claude tippt: …" / "Claude taps: …" shows on the device.
|
|
43
|
+
- `ChecklistPanel`, `loadChecklist`, `runLiveAction`, `parseLiveAction`,
|
|
44
|
+
`DENY_LABEL_PATTERNS`.
|
|
45
|
+
- `tpk.liveStateProvider`, `tpk.projectId`, and the building blocks
|
|
46
|
+
`TpkLiveLink`, `captureLiveSnapshot`, `readScreenTexts`,
|
|
47
|
+
`LiveNoteDialog`.
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
- The remote AI-run claim sends the app version (expo-application), so
|
|
51
|
+
an AI retest of a fixed bug reaches this app only from the fixed build on.
|
|
52
|
+
- Voice bug sheet while recording: no dark scrim (8 % instead of ~45 %) and
|
|
53
|
+
an almost clear sheet, so the app behind stays visible while the tester
|
|
54
|
+
describes it. Only timer and stop button stay solid.
|
|
55
|
+
|
|
56
|
+
## 0.10.1 — 2026-10-31
|
|
57
|
+
|
|
58
|
+
### Fixed
|
|
59
|
+
- **First-tap widget tour was unreadable**: the cards collapsed inside
|
|
60
|
+
the sheet, so the tour showed only a sliver of the first emoji and
|
|
61
|
+
could not be enlarged (reported from the Kinpal beta, iPhone 16 Pro
|
|
62
|
+
Max). The cards now take their content height; the sheet stays below
|
|
63
|
+
90 % of the screen and the tour's text scales with Dynamic Type up to
|
|
64
|
+
1.5×, so it also fits at the largest text sizes.
|
|
65
|
+
|
|
5
66
|
## 0.10.0 — 2026-10-30
|
|
6
67
|
|
|
7
68
|
Requires `@testerpaykit/core` 1.3.0 and `@testerpaykit/api-client` 1.5.0
|
package/README.md
CHANGED
|
@@ -360,6 +360,35 @@ the app waits for the next one. Tap anywhere outside the overlay to pause
|
|
|
360
360
|
a run. Off by default; enable it only in builds you want remote-controlled.
|
|
361
361
|
The project's organisation must have AI features enabled.
|
|
362
362
|
|
|
363
|
+
## Live link to Claude Code
|
|
364
|
+
|
|
365
|
+
For the developer's own device (dev build, TestFlight): two menu items
|
|
366
|
+
connect the running app to the developer's Claude Code session.
|
|
367
|
+
|
|
368
|
+
```tsx
|
|
369
|
+
<TesterPayKitWrapper tpk={tpk} enableLiveLink>
|
|
370
|
+
<YourApp />
|
|
371
|
+
</TesterPayKitWrapper>
|
|
372
|
+
|
|
373
|
+
// Optional: extra state for Claude, set wherever it is reachable.
|
|
374
|
+
tpk.liveStateProvider = () => ({ cartItems: cart.length, user: user?.id });
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
- **Connect to Claude / Mit Claude verbinden** — while switched on and the
|
|
378
|
+
app is in the foreground, the app holds a WebSocket to the TPK API, and
|
|
379
|
+
the session's MCP tool `device_snapshot` sees what the screen shows:
|
|
380
|
+
screenshot (without the TPK button), every text, button label and field
|
|
381
|
+
value top-to-bottom (password fields and `<TpkSensitive>` are never
|
|
382
|
+
read), current screen and navigation, breadcrumbs, recent SDK logs and
|
|
383
|
+
`liveStateProvider`. The choice is remembered; the socket closes when
|
|
384
|
+
the app goes to the background and reopens when it comes back.
|
|
385
|
+
- **Send to Claude / An Claude senden** — takes the same snapshot first,
|
|
386
|
+
then asks for one line and sends both as a note (`list_device_notes`).
|
|
387
|
+
|
|
388
|
+
Off by default. `liveStateProvider` is round-tripped through JSON; if it
|
|
389
|
+
throws, the snapshot carries `{error}` instead. Uncontrolled text inputs
|
|
390
|
+
(no `value` prop) show their `defaultValue`, not what was typed.
|
|
391
|
+
|
|
363
392
|
## What this package is NOT
|
|
364
393
|
|
|
365
394
|
- **Not** a full console app. The provider, floating button, and
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/storage.ts
|
|
2
|
+
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
3
|
+
var PREFIX = "@testerpaykit/";
|
|
4
|
+
var ExpoStorage = class {
|
|
5
|
+
/**
|
|
6
|
+
* Read a JSON-serializable value, returning `null` if the key is
|
|
7
|
+
* absent or the stored value can't be parsed.
|
|
8
|
+
*/
|
|
9
|
+
async get(key) {
|
|
10
|
+
const raw = await AsyncStorage.getItem(PREFIX + key);
|
|
11
|
+
if (raw == null) return null;
|
|
12
|
+
try {
|
|
13
|
+
return JSON.parse(raw);
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
async set(key, value) {
|
|
19
|
+
await AsyncStorage.setItem(PREFIX + key, JSON.stringify(value));
|
|
20
|
+
}
|
|
21
|
+
async remove(key) {
|
|
22
|
+
await AsyncStorage.removeItem(PREFIX + key);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* List every key this SDK has written. Useful for inspection /
|
|
26
|
+
* debug dashboards; not used internally.
|
|
27
|
+
*/
|
|
28
|
+
async keys() {
|
|
29
|
+
const all = await AsyncStorage.getAllKeys();
|
|
30
|
+
return all.filter((k) => k.startsWith(PREFIX)).map((k) => k.slice(PREFIX.length));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
ExpoStorage
|
|
36
|
+
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _testerpaykit_api_client from '@testerpaykit/api-client';
|
|
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';
|
|
2
|
+
import { SessionEventInput, BugReportAttachmentInput, BugReportAttachmentResponse, BugReportPayload, BugReportResponse, TaskListResponse, TesterTask, TesterPayKitApiClient, AnonymousLoginResponse, BugReportType, BugSeverity, BugCategory, MyBugReportSummary, NotificationsResult, TesterSessionEndReason, TesterProfile, TesterPoints, ChecklistTask, ChecklistStepResult, 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
4
|
import { RemoteAiSession } from '@testerpaykit/core';
|
|
5
5
|
import React, { RefObject, ReactNode } from 'react';
|
|
@@ -613,6 +613,17 @@ declare class TpkExpo {
|
|
|
613
613
|
* tpk.annotations.snapshot({ taskId: 'task-1' });
|
|
614
614
|
*/
|
|
615
615
|
readonly annotations: TaskAnnotationRegistry;
|
|
616
|
+
/**
|
|
617
|
+
* Extra state for the live link to Claude Code (`enableLiveLink` on
|
|
618
|
+
* the wrapper): what this returns goes into every `device_snapshot`
|
|
619
|
+
* and "Send to Claude" note as `app_state`. Set it anywhere the state
|
|
620
|
+
* is reachable, e.g. `tpk.liveStateProvider = () => ({ cart, user })`.
|
|
621
|
+
* Round-tripped through JSON; a throwing or non-serialisable provider
|
|
622
|
+
* yields `{error}` instead of breaking the snapshot.
|
|
623
|
+
*/
|
|
624
|
+
liveStateProvider: (() => unknown) | null;
|
|
625
|
+
/** The project this client reports into. */
|
|
626
|
+
get projectId(): string;
|
|
616
627
|
private readonly sessionEvents;
|
|
617
628
|
private uninstallDurableSync;
|
|
618
629
|
private uninstallTaskBinding;
|
|
@@ -908,6 +919,21 @@ interface FloatingFeedbackButtonProps {
|
|
|
908
919
|
* omitted, the row is hidden. See `AiRemoteControl` for the
|
|
909
920
|
* receiver-side wiring. */
|
|
910
921
|
onAutoTest?: () => void;
|
|
922
|
+
/** Tap "What to test" — the project's checklist (ChecklistPanel).
|
|
923
|
+
* Hidden when omitted (the wrapper omits it while the checklist is
|
|
924
|
+
* empty). */
|
|
925
|
+
onShowChecklist?: () => void;
|
|
926
|
+
/** Tasks the tester has not passed yet — shown next to the label. */
|
|
927
|
+
checklistCount?: number;
|
|
928
|
+
/** "Send to Claude": one line plus the current screen, read by the
|
|
929
|
+
* developer's Claude Code session (`list_device_notes`). Hidden when
|
|
930
|
+
* omitted. */
|
|
931
|
+
onSendToClaude?: () => void;
|
|
932
|
+
/** Switches the live link to the developer's Claude Code session on
|
|
933
|
+
* or off (MCP `device_snapshot`). Hidden when omitted. */
|
|
934
|
+
onToggleLiveLink?: () => void;
|
|
935
|
+
/** Whether the live link is open — flips the toggle's label. */
|
|
936
|
+
liveLinkConnected?: boolean;
|
|
911
937
|
/** Long-press the FAB — opens the Voice-AI bug-narration flow.
|
|
912
938
|
* When omitted, long-press is a no-op. */
|
|
913
939
|
onLongPressVoiceBug?: () => void | Promise<void>;
|
|
@@ -948,7 +974,7 @@ interface FloatingFeedbackButtonProps {
|
|
|
948
974
|
* wiring. A failed/absent storage degrades gracefully. */
|
|
949
975
|
tourStorage?: OnboardingStorage;
|
|
950
976
|
}
|
|
951
|
-
declare function FloatingFeedbackButton({ onReportBug, onGeneralFeedback, onViewDashboard, onEndSession, onShowRetests, retestCount, onShowDebugLogs, onShowMyBugs, onShowSessionDetails, onShowMessages, unreadMessageCount, onAutoTest, onLongPressVoiceBug, onFlushCachedCrashes, notificationCount, position, sessionStartedAt, earningsBaseAmount, earningsPerMinuteRate, earningsCurrency, style, testID, enableFirstTapTour, tourStorage, }: FloatingFeedbackButtonProps): React.ReactElement;
|
|
977
|
+
declare function FloatingFeedbackButton({ onReportBug, onGeneralFeedback, onViewDashboard, onEndSession, onShowRetests, retestCount, onShowDebugLogs, onShowMyBugs, onShowSessionDetails, onShowMessages, unreadMessageCount, onAutoTest, onShowChecklist, checklistCount, onSendToClaude, onToggleLiveLink, liveLinkConnected, onLongPressVoiceBug, onFlushCachedCrashes, notificationCount, position, sessionStartedAt, earningsBaseAmount, earningsPerMinuteRate, earningsCurrency, style, testID, enableFirstTapTour, tourStorage, }: FloatingFeedbackButtonProps): React.ReactElement;
|
|
952
978
|
|
|
953
979
|
type AttachmentKind = 'screenshot' | 'image' | 'video' | 'audio' | 'screen-recording' | 'log' | 'json' | 'other';
|
|
954
980
|
interface BugReportAttachmentDraft {
|
|
@@ -1592,7 +1618,7 @@ type MaterialIconName = string;
|
|
|
1592
1618
|
* Semantic icon names used by the SDK. Map to MaterialIcons glyph
|
|
1593
1619
|
* names by default; consumers can override via TpkIconsContext.
|
|
1594
1620
|
*/
|
|
1595
|
-
type TpkIconName = 'bug_report' | 'feedback' | 'dashboard' | 'session_end' | 'voice' | 'voice_off' | 'close' | 'check' | 'star_filled' | 'star_outline' | 'camera' | 'image' | 'attachment' | 'music_note' | 'language' | 'rocket' | 'lightbulb' | 'trend_up' | 'frown' | 'smile' | 'palette' | 'speed_slow' | 'crash' | 'sparkle' | 'cloud_upload' | 'refresh' | 'edit_pen' | 'shape_rect' | 'shape_circle' | 'shape_arrow' | 'text' | 'blur';
|
|
1621
|
+
type TpkIconName = 'bug_report' | 'feedback' | 'dashboard' | 'session_end' | 'voice' | 'voice_off' | 'close' | 'check' | 'star_filled' | 'star_outline' | 'camera' | 'image' | 'attachment' | 'music_note' | 'language' | 'rocket' | 'lightbulb' | 'trend_up' | 'frown' | 'smile' | 'palette' | 'speed_slow' | 'crash' | 'sparkle' | 'cloud_upload' | 'refresh' | 'edit_pen' | 'shape_rect' | 'shape_circle' | 'shape_arrow' | 'text' | 'blur' | 'link' | 'link_off' | 'send';
|
|
1596
1622
|
type TpkIconOverrideMap = Partial<Record<TpkIconName, MaterialIconName>>;
|
|
1597
1623
|
declare function TpkIconsProvider({ icons, children, }: {
|
|
1598
1624
|
icons: TpkIconOverrideMap;
|
|
@@ -1615,6 +1641,16 @@ interface RetestSheetProps {
|
|
|
1615
1641
|
}
|
|
1616
1642
|
declare function RetestSheet({ visible, tpk, onClose, onChanged, }: RetestSheetProps): React.ReactElement;
|
|
1617
1643
|
|
|
1644
|
+
interface ChecklistPanelProps {
|
|
1645
|
+
visible: boolean;
|
|
1646
|
+
tpk: TpkExpo | null;
|
|
1647
|
+
tasks: ChecklistTask[];
|
|
1648
|
+
/** Reloads the checklist (after a send, on "refresh"). */
|
|
1649
|
+
onReload: () => void;
|
|
1650
|
+
onClose: () => void;
|
|
1651
|
+
}
|
|
1652
|
+
declare function ChecklistPanel({ visible, tpk, tasks, onReload, onClose, }: ChecklistPanelProps): React.ReactElement | null;
|
|
1653
|
+
|
|
1618
1654
|
type TpkLanguage = 'de' | 'en';
|
|
1619
1655
|
/** The device's UI language, reduced to `de` / `en`. */
|
|
1620
1656
|
declare function detectDeviceLanguage(): TpkLanguage;
|
|
@@ -1639,6 +1675,10 @@ interface TpkStrings {
|
|
|
1639
1675
|
menuReportBug: string;
|
|
1640
1676
|
menuFeedback: string;
|
|
1641
1677
|
menuAutoTest: string;
|
|
1678
|
+
menuChecklist: string;
|
|
1679
|
+
menuSendToClaude: string;
|
|
1680
|
+
menuConnectClaude: string;
|
|
1681
|
+
menuDisconnectClaude: string;
|
|
1642
1682
|
menuCachedCrashes: (count: number) => string;
|
|
1643
1683
|
menuWorkboard: string;
|
|
1644
1684
|
menuMyBugs: string;
|
|
@@ -1733,6 +1773,23 @@ interface TpkStrings {
|
|
|
1733
1773
|
}
|
|
1734
1774
|
declare const TPK_STRINGS: Record<TpkLanguage, TpkStrings>;
|
|
1735
1775
|
|
|
1776
|
+
/** Verdict of one step while the tester works: null = not judged yet. */
|
|
1777
|
+
interface StepDraft {
|
|
1778
|
+
passed: boolean | null;
|
|
1779
|
+
note: string;
|
|
1780
|
+
}
|
|
1781
|
+
/** The checklist of a project, or [] on any failure (offline, 404, not
|
|
1782
|
+
* logged in yet) — the menu item simply stays hidden then. */
|
|
1783
|
+
declare function loadChecklist(tpk: {
|
|
1784
|
+
ready: Promise<void>;
|
|
1785
|
+
projectId: string;
|
|
1786
|
+
api: {
|
|
1787
|
+
getChecklist(projectId: string): Promise<ChecklistTask[]>;
|
|
1788
|
+
};
|
|
1789
|
+
} | null): Promise<ChecklistTask[]>;
|
|
1790
|
+
/** Judged steps, 1-based, as the API wants them. */
|
|
1791
|
+
declare function toStepResults(draft: StepDraft[]): ChecklistStepResult[];
|
|
1792
|
+
|
|
1736
1793
|
interface TpkTheme {
|
|
1737
1794
|
primary: string;
|
|
1738
1795
|
errorColour: string;
|
|
@@ -2077,6 +2134,14 @@ interface TesterPayKitWrapperProps {
|
|
|
2077
2134
|
aiRemoteTrigger?: boolean;
|
|
2078
2135
|
/** Poll interval for `aiRemoteTrigger`. Default 15. */
|
|
2079
2136
|
aiRemotePollSeconds?: number;
|
|
2137
|
+
/** Live link to the developer's Claude Code session. Adds two menu
|
|
2138
|
+
* items: "Connect to Claude" (while switched on and the app is in
|
|
2139
|
+
* front, the session can ask what the screen shows — MCP
|
|
2140
|
+
* `device_snapshot`) and "Send to Claude" (one line plus the current
|
|
2141
|
+
* screen, read with `list_device_notes`). Off by default — enable it
|
|
2142
|
+
* in builds the developer uses on their own device. Extra state for
|
|
2143
|
+
* both: `tpk.liveStateProvider`. */
|
|
2144
|
+
enableLiveLink?: boolean;
|
|
2080
2145
|
/** Currently active route — flows through to bug reports. */
|
|
2081
2146
|
currentScreen?: string;
|
|
2082
2147
|
/** When the session started — drives the earnings clock + the
|
|
@@ -2093,7 +2158,165 @@ interface TesterPayKitWrapperProps {
|
|
|
2093
2158
|
language?: TpkLanguage;
|
|
2094
2159
|
testID?: string;
|
|
2095
2160
|
}
|
|
2096
|
-
declare function TesterPayKitWrapper({ children, tpk, enableWrapper, enableShake, shakeThresholdG, style, onShowDebugLogs, notificationCount, onFlushCachedCrashes, retestCount, onShowRetests, onViewDashboard, buttonPosition, currentScreen, sessionStartedAt, aiCoordinatorToken, aiRemoteTrigger, aiRemotePollSeconds, aiProjectId, aiApiBaseUrl, theme, language, testID, }: TesterPayKitWrapperProps): React.ReactElement;
|
|
2161
|
+
declare function TesterPayKitWrapper({ children, tpk, enableWrapper, enableShake, shakeThresholdG, style, onShowDebugLogs, notificationCount, onFlushCachedCrashes, retestCount, onShowRetests, onViewDashboard, buttonPosition, currentScreen, sessionStartedAt, aiCoordinatorToken, aiRemoteTrigger, aiRemotePollSeconds, enableLiveLink, aiProjectId, aiApiBaseUrl, theme, language, testID, }: TesterPayKitWrapperProps): React.ReactElement;
|
|
2162
|
+
|
|
2163
|
+
type LiveLinkStatus = 'off' | 'connecting' | 'connected';
|
|
2164
|
+
/** The part of the WebSocket API the link uses (lets tests fake it). */
|
|
2165
|
+
interface LiveSocket {
|
|
2166
|
+
readyState: number;
|
|
2167
|
+
onopen: ((ev: unknown) => void) | null;
|
|
2168
|
+
onmessage: ((ev: {
|
|
2169
|
+
data: unknown;
|
|
2170
|
+
}) => void) | null;
|
|
2171
|
+
onerror: ((ev: unknown) => void) | null;
|
|
2172
|
+
onclose: ((ev: unknown) => void) | null;
|
|
2173
|
+
send(data: string): void;
|
|
2174
|
+
close(code?: number, reason?: string): void;
|
|
2175
|
+
}
|
|
2176
|
+
interface TpkLiveLinkOptions {
|
|
2177
|
+
/** Asks the API for a fresh one-time WebSocket URL. */
|
|
2178
|
+
openChannel: () => Promise<string>;
|
|
2179
|
+
/** What the app says about itself (app, appVersion, platform). */
|
|
2180
|
+
hello: () => Promise<Record<string, unknown>>;
|
|
2181
|
+
/** Captures what the screen shows right now. */
|
|
2182
|
+
capture: () => Promise<Record<string, unknown>>;
|
|
2183
|
+
/** Runs a device action (tap, type, scroll, back) Claude asked for.
|
|
2184
|
+
* Resolves with `{ok:true, matched?}`; throws to answer with an error. */
|
|
2185
|
+
act?: (action: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
2186
|
+
/** Socket factory. Default: the global WebSocket. */
|
|
2187
|
+
createSocket?: (url: string) => LiveSocket;
|
|
2188
|
+
}
|
|
2189
|
+
declare class TpkLiveLink {
|
|
2190
|
+
private readonly opts;
|
|
2191
|
+
private socket;
|
|
2192
|
+
private retry;
|
|
2193
|
+
private wanted;
|
|
2194
|
+
private failures;
|
|
2195
|
+
/** Bumped on every connect attempt and on stop, so late callbacks of
|
|
2196
|
+
* an abandoned socket do nothing. */
|
|
2197
|
+
private generation;
|
|
2198
|
+
private _status;
|
|
2199
|
+
private readonly listeners;
|
|
2200
|
+
constructor(opts: TpkLiveLinkOptions);
|
|
2201
|
+
get status(): LiveLinkStatus;
|
|
2202
|
+
/** Subscribe to status changes. Returns the unsubscribe function. */
|
|
2203
|
+
onStatus(listener: (s: LiveLinkStatus) => void): () => void;
|
|
2204
|
+
/** Opens the link and keeps it open until `stop`. */
|
|
2205
|
+
start(): void;
|
|
2206
|
+
stop(): void;
|
|
2207
|
+
dispose(): void;
|
|
2208
|
+
private setStatus;
|
|
2209
|
+
private connect;
|
|
2210
|
+
private fail;
|
|
2211
|
+
private close;
|
|
2212
|
+
private send;
|
|
2213
|
+
private onFrame;
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
interface ScreenText {
|
|
2217
|
+
tag: 'text' | 'button' | 'textfield' | 'label';
|
|
2218
|
+
text: string;
|
|
2219
|
+
x: number;
|
|
2220
|
+
y: number;
|
|
2221
|
+
}
|
|
2222
|
+
/** The parts of a React fiber the walk reads. */
|
|
2223
|
+
interface FiberLike {
|
|
2224
|
+
tag: number;
|
|
2225
|
+
type: unknown;
|
|
2226
|
+
memoizedProps: unknown;
|
|
2227
|
+
memoizedState?: unknown;
|
|
2228
|
+
stateNode: unknown;
|
|
2229
|
+
child: FiberLike | null;
|
|
2230
|
+
sibling: FiberLike | null;
|
|
2231
|
+
/** Parent fiber (read by live actions to find a pressable ancestor). */
|
|
2232
|
+
return?: FiberLike | null;
|
|
2233
|
+
}
|
|
2234
|
+
type Rect = {
|
|
2235
|
+
x: number;
|
|
2236
|
+
y: number;
|
|
2237
|
+
width: number;
|
|
2238
|
+
height: number;
|
|
2239
|
+
};
|
|
2240
|
+
/**
|
|
2241
|
+
* Everything readable below `root`, top-to-bottom. Entries that measure
|
|
2242
|
+
* as zero-sized or outside the window (detached / hidden screens) are
|
|
2243
|
+
* dropped; entries that cannot be measured keep tree order at (0, 0).
|
|
2244
|
+
*/
|
|
2245
|
+
declare function readScreenTexts(root: FiberLike | null): Promise<ScreenText[]>;
|
|
2246
|
+
|
|
2247
|
+
interface LiveSnapshotSource {
|
|
2248
|
+
/** Recent breadcrumbs (oldest first). */
|
|
2249
|
+
breadcrumbs: () => Breadcrumb[];
|
|
2250
|
+
/** Host hook for extra state; may be null. */
|
|
2251
|
+
liveStateProvider?: (() => unknown) | null;
|
|
2252
|
+
/** App name / version / build. */
|
|
2253
|
+
app: () => Promise<{
|
|
2254
|
+
name?: string;
|
|
2255
|
+
version?: string;
|
|
2256
|
+
build?: string;
|
|
2257
|
+
}>;
|
|
2258
|
+
/** Root of the host's content in React's tree; null skips `texts`. */
|
|
2259
|
+
rootFiber?: () => FiberLike | null;
|
|
2260
|
+
/** Base64 PNG of the app without TPK chrome, or null. */
|
|
2261
|
+
screenshot?: () => Promise<string | null>;
|
|
2262
|
+
/** Override for tests. */
|
|
2263
|
+
readTexts?: (root: FiberLike | null) => Promise<ScreenText[]>;
|
|
2264
|
+
}
|
|
2265
|
+
/** Runs the host's provider and round-trips the result through JSON so a
|
|
2266
|
+
* value the socket cannot carry fails here, not in the socket. */
|
|
2267
|
+
declare function readLiveState(provider: (() => unknown) | null | undefined): unknown;
|
|
2268
|
+
declare function captureLiveSnapshot(src: LiveSnapshotSource): Promise<Record<string, unknown>>;
|
|
2269
|
+
|
|
2270
|
+
interface LiveNoteDialogProps {
|
|
2271
|
+
visible: boolean;
|
|
2272
|
+
/** True while the note is being sent. */
|
|
2273
|
+
sending?: boolean;
|
|
2274
|
+
onCancel: () => void;
|
|
2275
|
+
onSend: (text: string) => void;
|
|
2276
|
+
}
|
|
2277
|
+
declare function LiveNoteDialog({ visible, sending, onCancel, onSend, }: LiveNoteDialogProps): React.ReactElement | null;
|
|
2278
|
+
|
|
2279
|
+
type LiveActionKind = 'tap' | 'type' | 'scroll' | 'back';
|
|
2280
|
+
type ScrollDirection = 'up' | 'down' | 'left' | 'right';
|
|
2281
|
+
interface LiveAction {
|
|
2282
|
+
kind: LiveActionKind;
|
|
2283
|
+
target?: {
|
|
2284
|
+
text?: string;
|
|
2285
|
+
x?: number;
|
|
2286
|
+
y?: number;
|
|
2287
|
+
};
|
|
2288
|
+
text?: string;
|
|
2289
|
+
submit?: boolean;
|
|
2290
|
+
direction?: ScrollDirection;
|
|
2291
|
+
}
|
|
2292
|
+
interface LiveActionResult {
|
|
2293
|
+
ok: true;
|
|
2294
|
+
/** What the action hit, in words (label, field, list). */
|
|
2295
|
+
matched?: string;
|
|
2296
|
+
[key: string]: unknown;
|
|
2297
|
+
}
|
|
2298
|
+
interface LiveActionEnv {
|
|
2299
|
+
/** Root of the host's content (the wrapper's anchor child). */
|
|
2300
|
+
root: FiberLike | null;
|
|
2301
|
+
/** Window size for visibility and scroll steps. */
|
|
2302
|
+
window?: {
|
|
2303
|
+
width: number;
|
|
2304
|
+
height: number;
|
|
2305
|
+
};
|
|
2306
|
+
/** `TextInput.State.currentlyFocusedInput()` on native. */
|
|
2307
|
+
focusedInput?: () => unknown;
|
|
2308
|
+
/** Override for tests. */
|
|
2309
|
+
measure?: (node: unknown) => Promise<Rect | null>;
|
|
2310
|
+
/** Web fallback for `back`; returns whether it went back. */
|
|
2311
|
+
historyBack?: () => boolean;
|
|
2312
|
+
}
|
|
2313
|
+
/** Labels that are never acted on, whatever Claude asks for. */
|
|
2314
|
+
declare const DENY_LABEL_PATTERNS: readonly RegExp[];
|
|
2315
|
+
/** Validates a raw `{type:'action', …}` frame into a LiveAction. */
|
|
2316
|
+
declare function parseLiveAction(raw: unknown): LiveAction;
|
|
2317
|
+
/** Runs one action from the live link. Throws an Error with a readable
|
|
2318
|
+
* message when it cannot be done. */
|
|
2319
|
+
declare function runLiveAction(raw: unknown, env: LiveActionEnv): Promise<LiveActionResult>;
|
|
2097
2320
|
|
|
2098
2321
|
interface TpkAnnotatedProps {
|
|
2099
2322
|
/** Task this element belongs to. */
|
|
@@ -2434,5 +2657,5 @@ declare function useTpkEarnings(tpk: TpkExpo | null, options?: {
|
|
|
2434
2657
|
payoutLimit?: number;
|
|
2435
2658
|
}): UseEarningsResult;
|
|
2436
2659
|
|
|
2437
|
-
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, RetestSheet, SCREENSHOT_CONSENT_STORAGE_KEY, ScreenRecorder, ScreenshotAnnotationEditor, SessionDetailsSheet, SessionEndDialog, SubmitQueue, TPK_STRINGS, TaskAnnotationRegistry, TesterDashboard, TesterPayKitProvider, TesterPayKitWrapper, TpkAnnotated, TpkAnnotationOverlay, TpkExpo, TpkIcon, TpkIconsProvider, TpkLanguageProvider, 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, detectDeviceLanguage, emptyAnnotationDoc, endNativeCapture, engagedMinutes, extractVoiceBug, findAssignmentForTask, formatTpkMoney, getAppSnapshot, getDeviceSnapshot, getEventCounts, getNativeCaptureMode, getSessionStats, getUniqueScreens, hasCompletedOnboarding, hasScreenshotConsent, hasSeenWidgetTour, hasWelcomeBriefBeenSeen, installCrashHandler, installNetworkCapture, markOnboardingComplete, markWelcomeBriefAsSeen, markWidgetTourSeen, parseVersionRange, pathToSvgD, quickDraftBug, resetOnboardingState, resetWelcomeBriefAck, resetWidgetTourSeen, simplifyPath, submitBugReportDraft, subscribeNativeCaptureMode, uploadScreenshotAttachment, useShake, useTaskAnnotation, useTesterPayKit, useTpkDashboard, useTpkEarnings, useTpkLanguage, useTpkStrings, useTpkTheme, useTr, versionSatisfies, widgetDiscovery, withNativeCapture };
|
|
2438
|
-
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, RetestSheetProps, ScreenshotAnnotationEditorProps, ScreenshotResult, SensitiveMaskingMode, SessionDetailsSheetProps, SessionEndDialogProps, SessionEndStats, SessionStatsSnapshot, StatusStyle, SubmitBugInput, TaskAnnotation, TaskInteractionSummary, TaskProgress, TesterDashboardProps, TesterPayKitContextValue, TesterPayKitProviderProps, TesterPayKitWrapperProps, TextShape, TpkAnnotatedProps, TpkAnnotationOverlayHandle, TpkAnnotationOverlayProps, TpkExpoConfig, TpkIconName, TpkIconOverrideMap, TpkIconProps, TpkLanguage, TpkLogEntry, TpkLogLevel, TpkOnboardingProps, TpkSensitiveProps, TpkStorage, TpkStrings, 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 };
|
|
2660
|
+
export { ANNOTATION_PALETTE, AttachmentQueue, Breadcrumbs, BugReportSheet, ChecklistPanel, CrashQueue, DEFAULT_STYLE, DEFAULT_TPK_THEME, DENY_LABEL_PATTERNS, ExpoStorage, FloatingFeedbackButton, GeneralFeedbackDialog, INTERACTION_NAV_WEIGHT, InviteCodeScreen, LiveNoteDialog, MIN_INTERACTIONS_PER_ACTIVE_MINUTE, MyBugsSheet, NotificationsSheet, ONBOARDING_DONE_STORAGE_KEY, RetestSheet, SCREENSHOT_CONSENT_STORAGE_KEY, ScreenRecorder, ScreenshotAnnotationEditor, SessionDetailsSheet, SessionEndDialog, SubmitQueue, TPK_STRINGS, TaskAnnotationRegistry, TesterDashboard, TesterPayKitProvider, TesterPayKitWrapper, TpkAnnotated, TpkAnnotationOverlay, TpkExpo, TpkIcon, TpkIconsProvider, TpkLanguageProvider, TpkLiveLink, 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, captureLiveSnapshot, captureView, classificationToBugType, createBugReportDraft, deriveTaskProgress, detectDeviceLanguage, emptyAnnotationDoc, endNativeCapture, engagedMinutes, extractVoiceBug, findAssignmentForTask, formatTpkMoney, getAppSnapshot, getDeviceSnapshot, getEventCounts, getNativeCaptureMode, getSessionStats, getUniqueScreens, hasCompletedOnboarding, hasScreenshotConsent, hasSeenWidgetTour, hasWelcomeBriefBeenSeen, installCrashHandler, installNetworkCapture, loadChecklist, markOnboardingComplete, markWelcomeBriefAsSeen, markWidgetTourSeen, parseLiveAction, parseVersionRange, pathToSvgD, quickDraftBug, readLiveState, readScreenTexts, resetOnboardingState, resetWelcomeBriefAck, resetWidgetTourSeen, runLiveAction, simplifyPath, submitBugReportDraft, subscribeNativeCaptureMode, toStepResults, uploadScreenshotAttachment, useShake, useTaskAnnotation, useTesterPayKit, useTpkDashboard, useTpkEarnings, useTpkLanguage, useTpkStrings, useTpkTheme, useTr, versionSatisfies, widgetDiscovery, withNativeCapture };
|
|
2661
|
+
export type { AnnotatedElementInfo, AnnotatedScreenshotResult, AnnotationColor, AnnotationEvent, AnnotationEventType, AnnotationInteraction, AnnotationListener, AnnotationShape, AnnotationStyle, AnnotationTool, AppSnapshot, ArrowShape, AttachmentQueueFlushOptions, BlurShape, Breadcrumb, BugFix, BugReportDraft, BugReportSheetProps, BuildInfo, CachedCrash, CaptureViewOptions, ChecklistPanelProps, CircleShape, CompletionTrigger, CrashHandlerOptions, CrashInfo, CreateBugReportDraftInput, DashboardData, DeviceSnapshot, DiscoverOptions, EarningsData, EngagedMinutesInput, FeedbackCategory, FloatingFeedbackButtonProps, FlushTelemetryResult, FocusArea, GeneralFeedbackDialogProps, InstallNetworkCaptureOptions, InteractionBounds, InteractionType, InviteCodeScreenProps, LiveAction, LiveActionEnv, LiveActionResult, LiveLinkStatus, LiveNoteDialogProps, LiveSnapshotSource, LiveSocket, MyBugsSheetProps, NotificationsSheetProps, OnboardingStorage, PathShape, PeriodFilter, Point, QueueFlushOptions, QueueFlushResult, QuickActionKind, RecordInteractionDetails, RecordingOptions, RecordingResult, RecordingState, RectShape, RegisterAnnotationInput, ReleaseNote, RetestSheetProps, ScreenText, ScreenshotAnnotationEditorProps, ScreenshotResult, SensitiveMaskingMode, SessionDetailsSheetProps, SessionEndDialogProps, SessionEndStats, SessionStatsSnapshot, StatusStyle, StepDraft, SubmitBugInput, TaskAnnotation, TaskInteractionSummary, TaskProgress, TesterDashboardProps, TesterPayKitContextValue, TesterPayKitProviderProps, TesterPayKitWrapperProps, TextShape, TpkAnnotatedProps, TpkAnnotationOverlayHandle, TpkAnnotationOverlayProps, TpkExpoConfig, TpkIconName, TpkIconOverrideMap, TpkIconProps, TpkLanguage, TpkLiveLinkOptions, TpkLogEntry, TpkLogLevel, TpkOnboardingProps, TpkSensitiveProps, TpkStorage, TpkStrings, 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 };
|