@ansight/react-native 1.0.2-preview.4 → 1.0.2-preview.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -2
- package/android/build.gradle +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,8 +25,8 @@ npx react-native run-android
|
|
|
25
25
|
|
|
26
26
|
This package version expects matching native SDK packages:
|
|
27
27
|
|
|
28
|
-
- CocoaPods: `Ansight`, `AnsightObjC` version `1.0.2-preview.
|
|
29
|
-
- Maven: `ai.ansight:ansight-android:1.0.2-preview.
|
|
28
|
+
- CocoaPods: `Ansight`, `AnsightObjC` version `1.0.2-preview.7`
|
|
29
|
+
- Maven: `ai.ansight:ansight-android:1.0.2-preview.7`
|
|
30
30
|
|
|
31
31
|
## Quickstart
|
|
32
32
|
|
|
@@ -79,6 +79,11 @@ where reconnects should only happen after an explicit app action.
|
|
|
79
79
|
> max-width settings, and disable `sessionJpegCapture` for performance-focused
|
|
80
80
|
> runs unless visual evidence is required.
|
|
81
81
|
|
|
82
|
+
For simulator/emulator sessions, Studio can acknowledge the native
|
|
83
|
+
`device.profile` with host screenshot mode. The native SDK then suspends
|
|
84
|
+
periodic in-app JPEG capture for that session so Studio can use a host-side
|
|
85
|
+
source such as `simctl` or `adb`.
|
|
86
|
+
|
|
82
87
|
## Options
|
|
83
88
|
|
|
84
89
|
The TypeScript `AnsightOptions` surface mirrors Android `AnsightOptions`, iOS
|
|
@@ -245,6 +250,8 @@ The bridge exposes the native SDK runtime surface:
|
|
|
245
250
|
| `enableTouchCapture`, `disableTouchCapture` | Runtime touch-capture toggle. |
|
|
246
251
|
| `updateSessionProperties`, `clearSessionProperties` | Grouped session property mutations. |
|
|
247
252
|
| `registerCustomProperty`, `removeCustomProperty`, `clearCustomProperties` | Convenience property mutations. |
|
|
253
|
+
| `registerArtifactProvider`, `registerArtifactProviders` | App-defined artifact catalogs and binary exports. |
|
|
254
|
+
| `unregisterArtifactProvider`, `listRegisteredArtifactProviders`, `clearArtifactProviders` | Artifact-provider lifecycle. |
|
|
248
255
|
|
|
249
256
|
Native methods resolve to plain objects. Operation-like methods return
|
|
250
257
|
`{ success, message }`. Host connection methods return a richer result with
|
|
@@ -362,6 +369,54 @@ await registration.unregister();
|
|
|
362
369
|
The native bridge registers JavaScript tools with `replaceExisting` semantics so
|
|
363
370
|
reloads can refresh handlers.
|
|
364
371
|
|
|
372
|
+
## App Artifacts
|
|
373
|
+
|
|
374
|
+
Artifact providers expose requestable app snapshots such as reports, logs,
|
|
375
|
+
traces, or images:
|
|
376
|
+
|
|
377
|
+
```ts
|
|
378
|
+
const reportProvider = Ansight.registerArtifactProvider({
|
|
379
|
+
descriptor: {
|
|
380
|
+
id: "app.reports",
|
|
381
|
+
name: "App Reports",
|
|
382
|
+
category: "diagnostics",
|
|
383
|
+
},
|
|
384
|
+
query: async () => [{
|
|
385
|
+
id: "current",
|
|
386
|
+
name: "Current Report",
|
|
387
|
+
description: "Exports the current diagnostic report.",
|
|
388
|
+
kind: "report",
|
|
389
|
+
category: "diagnostics",
|
|
390
|
+
content: {
|
|
391
|
+
supportedMimeTypes: ["application/json"],
|
|
392
|
+
defaultMimeType: "application/json",
|
|
393
|
+
suggestedFileName: "report.json",
|
|
394
|
+
supportsText: true,
|
|
395
|
+
},
|
|
396
|
+
}],
|
|
397
|
+
create: async (request) => ({
|
|
398
|
+
metadata: {
|
|
399
|
+
artifactId: request.artifactId,
|
|
400
|
+
providerId: request.providerId,
|
|
401
|
+
name: "Current Report",
|
|
402
|
+
kind: "report",
|
|
403
|
+
mimeType: "application/json",
|
|
404
|
+
fileName: "report.json",
|
|
405
|
+
},
|
|
406
|
+
payload: JSON.stringify(buildCurrentReport()),
|
|
407
|
+
}),
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
await reportProvider.ready;
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
The first provider installs the read-scoped `artifacts.query` and
|
|
414
|
+
`artifacts.request` JavaScript tools in the native registry. A provider can
|
|
415
|
+
return text, base64, byte arrays, `ArrayBuffer`, or `Uint8Array`. Artifact
|
|
416
|
+
requests require a live Studio tool call; the bridge forwards the returned
|
|
417
|
+
bytes through the native binary-transfer channel. Call
|
|
418
|
+
`reportProvider.unregister()` during teardown or hot-reload cleanup.
|
|
419
|
+
|
|
365
420
|
## React Tools
|
|
366
421
|
|
|
367
422
|
`installReactTools` registers React Native specific remote tools backed by the
|
package/android/build.gradle
CHANGED