Skip to main content
@haip/view is the client a producer bundles into its review View for 2.0.0-draft.3. A View runs inside HAIP’s opaque sandbox frame with scripts only. It can present the stored input and result snapshots and propose a response. Trusted HAIP controls handle confirmation and authorisation, while execution remains external.
The client performs the haip/ui.initialize -> haip/ui.initialized handshake, validates the exact 2.0.0-draft.3 envelope, correlates request IDs, delivers haip/ui.input and haip/ui.result once and in order, and exposes the recursively frozen host-verified identity as view.envelope (request and bundle identity, source, snapshot digests and binding digest). A teardown acknowledgement closes the client, rejects pending proposals and removes its message listener. Every message and the envelope are defined in the protocol schema as StoredApp and the AgentUi* definitions, with generated TypeScript types in @haip/protocol. The sandbox has no network access, so bundle the client into the self-contained HTML registered through POST /v2/bundles. See examples/http/choice-app.js for a complete View.