The prototype already has most of this: the contract lives in packages/platform/src/types.ts and the web adapter covers notifications, audio enumeration, and file download. Two gaps against the spec. The contract marks notifications, audioDevices, and fileTransfer nullable where the spec's interface has every target providing them, and no test pins the contract, so a port can drift without anything failing.
Tighten the interface so null strictly means "this target can't do this". Then write a mock adapter with plain stubs, like the spec's Testability example, and a headless test that runs app code against it with no DOM involved. Last, move the per-target port mapping into the contract as doc comments, so someone reading types.ts can tell designed-null from not-built-yet without opening the spec.
Spec
- Platform - the port table and the Testability mock example
Acceptance criteria
notifications, audioDevices, and fileTransfer are non-nullable in the contract; only tray, deepLinks, and dns stay nullable, matching the spec interface
- A mock Platform adapter exists and a headless test exercises app code through it
- Every port in
types.ts has a doc comment naming which targets provide it and where null is by design
Out of scope
No blockers.
The prototype already has most of this: the contract lives in
packages/platform/src/types.tsand the web adapter covers notifications, audio enumeration, and file download. Two gaps against the spec. The contract marksnotifications,audioDevices, andfileTransfernullable where the spec's interface has every target providing them, and no test pins the contract, so a port can drift without anything failing.Tighten the interface so null strictly means "this target can't do this". Then write a mock adapter with plain stubs, like the spec's Testability example, and a headless test that runs app code against it with no DOM involved. Last, move the per-target port mapping into the contract as doc comments, so someone reading
types.tscan tell designed-null from not-built-yet without opening the spec.Spec
Acceptance criteria
notifications,audioDevices, andfileTransferare non-nullable in the contract; onlytray,deepLinks, anddnsstay nullable, matching the spec interfacetypes.tshas a doc comment naming which targets provide it and where null is by designOut of scope
historyCacheport (Clients: local history cache #10 adds it)No blockers.