Files
adebisi-fa 548e33390c 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.
2026-10-02 15:12:16 +01:00

1.6 KiB

Tasks

1. Consume the availability event

  • 1.1 In tools/public/assets/fp/app.js, add agent.available (default null) and agent.device (default ''); handle fprint-device-status to set both and re-render the tag. Verify the handler is present.
  • 1.2 Clear available back to null and device to '' on disconnect and connect_error.

2. Show availability

  • 2.1 Extend renderAgentTag to the four states (offline, scanner not connected, agent ready, agent connected/unknown) with the device name in the tag title.
  • 2.2 Add a computed notice (title/subtitle) for agent-offline and no-scanner, and render it as a warning cds-inline-notification in the capture panel.
  • 2.3 Disable the capture and recapture buttons while agent.available === false, and make capture() refuse an attempt in the same state.

3. Docs

  • 3.1 Add a paragraph to README.md under "The Fingerprint Agent".
  • 3.2 Add a line to tools/public/assets/help.html.

4. Verification

  • 4.1 cd tools && npm test passes (65 tests, 6 new in test/fp-wizard.test.js).
  • 4.2 openspec validate 2026-10-02-fpagent-device-availability --strict passes.
  • 4.3 test/fp-wizard.test.js loads app.js in a vm sandbox and asserts the availability states, tag labels, capture refusal, and disconnect reset.
  • 4.4 End-to-end browser pass against a running agent (tag transitions and disabled controls) — done with Playwright driving the real page against a stubbed agent socket; screenshots in the harness run.
  • 4.5 Archive the change (openspec archive), which syncs the fingerprint-wizard spec.