Targets
A target represents an object registered by the application, such as a photo card or toolbar button.
Identity and semantics
Assign a stable surface ID, role and capabilities when registering a target. IDs should refer to the current semantic target and should not be derived from a visual list index. The registry also maintains a registration generation used to reject stale work after detach/re-registration; Use this generation to check whether work is stale, not as a database identifier.
The Host may register surfaces such as a photo card or toolbar action with supported capabilities. A selector produces current target candidates. The Runtime evaluates action applicability against the candidate's semantic role/capabilities and current snapshot. The target identifier and the element's measured geometry are separate.
Lifecycle
sequenceDiagram
participant App as Host application
participant Adapter
participant Registry as Host registry
participant Runtime
App->>Adapter: mount and bind element
Adapter->>Registry: register descriptor
Adapter->>Runtime: provide current semantic/geometry snapshot
Runtime->>App: selected WHAT and TARGET
App->>Adapter: unmount or semantic replacement
Adapter->>Registry: unregister old generation
Runtime->>Runtime: reject stale target-bound execution
Attach establishes a current candidate. Update may replace semantic fields or element geometry according to the adapter contract. Detach unregisters it. Invalidation means the selected context no longer identifies the same live target; stale completion must not execute against a replacement with the same textual ID but a new registration generation.
Target history and affinity
Session-local target history can contribute to target mass using the current target-session policy. This contribution is separate from action-kind repetition. Both can apply to an inspect on the same target. Target history is bounded and volatile; there is no cross-session long-term affinity store.
Consumer responsibilities
The Consumer decides which product objects are targets, how IDs are formed, when capabilities are valid, and which trusted business action an activation invokes. CharaWeave selects registered targets and checks whether they are still current. It does not discover product data or execute package code. Browser geometry is measured in viewport CSS pixels by @charaweave/host-browser.
See Host Integration, React Integration, and Troubleshooting.