#415

fix(runtime): wire manifest bridge policy into TypeScript apps

Openzuohuadongwants to merge intofrom

Problem

TypeScript apps derive permissions and navigation origins from app.zon, but the generated TypeScript runner leaves RunOptions.builtin_bridge at its default disabled policy. Built-in bridge commands declared in app.zon are therefore denied at runtime even when the manifest explicitly grants them.

Fix

  • Convert the manifest's top-level permissions and bridge command permissions/origins into native_sdk.BridgePolicy at comptime.
  • Keep the policy fail-closed when the bridge block or command list is absent or empty.
  • Pass the derived policy through ts_core_main.zig into runner.runWithOptions.
  • Add regression coverage for absent, empty, and declared policies, including permission and origin checks.

Verification

  • zig build test-app-runner --summary all (3/3 tests passed)
  • zig build test --summary all (passed)
  • zig fmt --check src/app_runner/root.zig src/app_runner/ts_core_main.zig
  • git diff --check

scripts/gate.sh fast upstream/main reached the affected suites, but its broader matrix is environment-blocked by missing @typescript/old, Android/Xcode SDKs, and an external arocc download; those failures are unrelated to this two-file change.

Activity

3
vercel[bot]2mo ago

@gustbul is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.