feat(fpagent): show scanner availability and gate capture
Consume fpagent's fprint-device-status {available, device, captureAgentId}
in the /fingerprint wizard. Availability is tracked tri-state so an agent
that does not report it leaves capture working as before; the header tag
shows offline / no-scanner / ready, the capture panel warns, and capture is
disabled until a supported reader is attached.
Adds a vm-sandbox test for the wizard logic and the OpenSpec change
fpagent-device-availability, archived with the fingerprint-wizard spec.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
# Proposal: fpagent-device-availability
|
||||
|
||||
## Why
|
||||
|
||||
fpagent now reports whether a supported fingerprint reader is attached, as
|
||||
`fprint-device-status {available, device, captureAgentId}`, sent to each portal
|
||||
client on connect and whenever availability changes. The wizard does not consume
|
||||
it: the header tag reflects only the socket connection, so a connected agent
|
||||
with no scanner still reads "Agent connected" and capture is allowed, failing
|
||||
only when the enrollment reaches the reader. Operators need to see that the
|
||||
scanner is missing before they try.
|
||||
|
||||
## What Changes
|
||||
|
||||
- The wizard consumes `fprint-device-status` and tracks availability and the
|
||||
device name alongside the connected state.
|
||||
- The header status tag distinguishes agent offline, connected with no scanner,
|
||||
and ready.
|
||||
- While no supported reader is attached, the capture panel shows a warning and
|
||||
the capture/recapture controls are disabled; the capture handler refuses a
|
||||
racing attempt.
|
||||
|
||||
## Capabilities
|
||||
|
||||
### New Capabilities
|
||||
|
||||
(none)
|
||||
|
||||
### Modified Capabilities
|
||||
|
||||
- `fingerprint-wizard`: shows scanner availability from `fprint-device-status`
|
||||
and gates capture on a supported reader being attached.
|
||||
|
||||
## Impact
|
||||
|
||||
- `tools/public/assets/fp/app.js`: handle the event, a multi-state status tag,
|
||||
and a gated `capture()`.
|
||||
- `tools/public/assets/fp/index.html`: disabled controls and an inline warning
|
||||
when no reader is attached.
|
||||
- `README.md`, `tools/public/assets/help.html`: document the behavior.
|
||||
- Depends on `fingerprint-agent`'s `fprint-device-status` event (change
|
||||
`scanner-hotplug-recovery`). Agents that do not emit it are tolerated:
|
||||
availability stays unknown and captures are not blocked.
|
||||
Reference in New Issue
Block a user