fix(native)!: preserve incomplete native UI captures (#991)

* fix(native): preserve unknown accessibility child counts

* fix(native): align helper buffer with capture budget

* fix(native): align Swift helper JSON wire size

* fix(native): bound raw helper output to scenario budget
This commit is contained in:
morluto
2026-10-07 23:44:41 +08:00
committed by GitHub
parent 5065fcd520
commit 9f496ef2d4
13 changed files with 178 additions and 21 deletions
+15
View File
@@ -0,0 +1,15 @@
const HELPER_SUCCESS_WRAPPER = Buffer.from(
JSON.stringify({ ok: true, result: {} }),
);
/** Scenario output is charged at twice the encoded result size before return. */
export const NATIVE_UI_OUTPUT_BUDGET_BYTES = 64 * 1024 * 1024;
export const NATIVE_UI_OUTPUT_WEIGHT = 2;
/** Bytes added around a result by the helper's success JSON response. */
export const NATIVE_UI_HELPER_ENVELOPE_BYTES =
HELPER_SUCCESS_WRAPPER.byteLength - Buffer.byteLength("{}");
/** Raw helper output is bounded by the scenario's existing unweighted byte budget. */
export const NATIVE_UI_HELPER_MAX_BUFFER =
NATIVE_UI_OUTPUT_BUDGET_BYTES + NATIVE_UI_HELPER_ENVELOPE_BYTES;