@farmslot/adapter-rn 0.16.0 → 0.17.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
@@ -6,6 +6,11 @@ All notable changes to `@farmslot/adapter-rn` (published as `@farmslot/expo-reci
6
6
 
7
7
  - Active-development baseline; add user-facing changes here before release or package publication.
8
8
 
9
+ ## 0.17.0 - 2026-10-05
10
+
11
+ - Add `bridge-runtime/bridge-core.cjs`, the generic Hermes CDP bridge CLI moved from mm-harness. `runBridgeCli(config)` runs the built-in commands (navigation, eval, UI gestures and input, scrolling and scroll-transition timing, Sentry debug, HUD steps, profiler, in-app issues, network capture), target selection over the CDP broker or a direct connection, the debugger-slot lock and typed errors. The host supplies its own commands, route table, recovery hints, help lines, perf markers and readiness check; a host command that reuses a built-in name throws at startup. The iOS and Android key and tap fallbacks read `RECIPE_RN_IDB_PATH` / `RECIPE_RN_ADB_PATH`.
12
+ - Publish with protocol 0.34.0 and recipe-runner 0.24.0.
13
+
9
14
  ## 0.16.0 - 2026-10-05
10
15
 
11
16
  - Add the generic React Native runtime, moved from mm-harness:
package/README.md CHANGED
@@ -6,20 +6,21 @@ Public docs: <https://farmslot.io/docs/guides/adapter-rn>
6
6
 
7
7
  ## Source layout
8
8
 
9
- | Path | Owns |
10
- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
11
- | `bin/` | Published `farmslot-adapter-rn` executable shim. |
12
- | `src/cli.ts` | Init command parsing and CLI entrypoint. |
13
- | `src/scaffold.ts` | File-copy and package-script scaffolding. |
14
- | `src/doctor.ts` | Project integration checks. |
15
- | `src/runner.ts` | Expo smoke runner wiring built on `@farmslot/recipe-runner`. |
16
- | `src/redaction.ts` | Output redaction helpers for generated artifacts. |
17
- | `templates/` | Versionless project scaffold copied into consuming Expo apps. |
18
- | `bridge-runtime/` | Hermes CDP bridge libraries (`lib/*.cjs`) and the console forwarder; a host bridge CLI requires them. |
19
- | `metro/` | Metro config wrapper, detached launcher and log generation/coalescing helpers. |
20
- | `src/tool-paths.ts`, `src/devices.ts` | adb/idb discovery (`RECIPE_RN_ADB_PATH`/`RECIPE_RN_IDB_PATH`) and connected-device listing. |
21
- | `src/video-recorder.ts`, `src/frame-metrics.ts` | Device video recorders and frame-timing summaries. |
22
- | `src/metro-env.ts`, `src/source-freshness.ts`, `src/fingerprint-baseline.ts` | Bundle-input fingerprints with recorded baselines; the project supplies the inputs. |
9
+ | Path | Owns |
10
+ | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
11
+ | `bin/` | Published `farmslot-adapter-rn` executable shim. |
12
+ | `src/cli.ts` | Init command parsing and CLI entrypoint. |
13
+ | `src/scaffold.ts` | File-copy and package-script scaffolding. |
14
+ | `src/doctor.ts` | Project integration checks. |
15
+ | `src/runner.ts` | Expo smoke runner wiring built on `@farmslot/recipe-runner`. |
16
+ | `src/redaction.ts` | Output redaction helpers for generated artifacts. |
17
+ | `templates/` | Versionless project scaffold copied into consuming Expo apps. |
18
+ | `bridge-runtime/` | Hermes CDP bridge libraries (`lib/*.cjs`) and the console forwarder. |
19
+ | `bridge-runtime/bridge-core.cjs` | Generic bridge CLI (`runBridgeCli`); a host preset adds its commands, routes and recovery hints. |
20
+ | `metro/` | Metro config wrapper, detached launcher and log generation/coalescing helpers. |
21
+ | `src/tool-paths.ts`, `src/devices.ts` | adb/idb discovery (`RECIPE_RN_ADB_PATH`/`RECIPE_RN_IDB_PATH`) and connected-device listing. |
22
+ | `src/video-recorder.ts`, `src/frame-metrics.ts` | Device video recorders and frame-timing summaries. |
23
+ | `src/metro-env.ts`, `src/source-freshness.ts`, `src/fingerprint-baseline.ts` | Bundle-input fingerprints with recorded baselines; the project supplies the inputs. |
23
24
 
24
25
  ## Relationship to the harness
25
26
 
@@ -29,6 +30,38 @@ Public docs: <https://farmslot.io/docs/guides/adapter-rn>
29
30
  - `@farmslot/recipe-runner` owns the generic runner, official core actions, UI actions, and CDP/React Native transports.
30
31
  - `@farmslot/adapter-rn` adds Expo-friendly scaffolding (package scripts, a default recipe, optional dev-only React Native bridge/HUD files, integration checks) and the generic React Native runtime a harness drives: the Hermes bridge libraries, Metro helpers, device tools, recorders and freshness fingerprints. Product commands, routes and env names stay in the host harness.
31
32
 
33
+ ### Bridge CLI preset
34
+
35
+ A host's bridge script is a preset over `runBridgeCli`:
36
+
37
+ ```js
38
+ // my-app/bridge-runtime/cdp-bridge.cjs
39
+ const { runBridgeCli } = require('@farmslot/adapter-rn/bridge-runtime/bridge-core.cjs');
40
+ const { cdpEval } = require('@farmslot/adapter-rn/bridge-runtime/lib/cdp-eval.cjs');
41
+
42
+ runBridgeCli({
43
+ appLabel: 'My App',
44
+ routes: { aliases: { Home: 'HomeView' }, nestedParents: { SettingsDetail: 'Settings' } },
45
+ teachingByErrorCode: { NO_TARGET: 'Next: open the app on the device.' },
46
+ commands: {
47
+ // `status` also gets the core's `status-selected` (the pinned target only).
48
+ // Handlers get (client, args, { deviceName, platform, runtimeIdentity }).
49
+ async status(client, _args, { deviceName } = {}) {
50
+ return { route: await cdpEval(client, 'globalThis.__AGENTIC__?.getRoute?.()'), deviceName };
51
+ },
52
+ },
53
+ commandDocs: { status: { help: ' status App status' } },
54
+ // measure-scroll-transition: console lines starting with a prefix carry a JSON event.
55
+ perfMarkerPrefixes: ['[MyAppPerf] '],
56
+ // Evaluated only when a measure-scroll-transition request sets requireWalletReady: true;
57
+ // it must return { ready, observedAtMs }, and the measurement refuses unless ready is true.
58
+ readyExpression:
59
+ '({ ready: Boolean(globalThis.__AGENTIC__?.getRoute?.()), observedAtMs: performance.now() })',
60
+ });
61
+ ```
62
+
63
+ The built-in commands use the app's dev-only `globalThis.__AGENTIC__` bridge where present (`platform`, `getRoute`, `getState`, `navigate`, `canGoBack`, `goBack`, `pressTestId`, `pressText`, `queryUiTarget`, `setInput`, `scrollView`, `scrollIntoView`, and `showStep`/`hideStep` for the HUD). A host command that reuses a built-in name, or `status-selected`, throws at startup.
64
+
32
65
  Do not add project-specific actions such as wallet, perps, or meetings to this package. Those belong in the app or a project-specific runner/manifest that extends the official harness actions. Generic whole-run video proof stays in the shared harness capability surface.
33
66
 
34
67
  ## What it installs