annotation: annotate nested objects using `jsonpath` reference
The recently released annotation feature allows to annotate top-level objects stored on State.
For example, if State had this schema (this is the result of all reads and writes defined via @action), we could only annotate the full list of paragraphs and `summaries.
class State:
url: str
credentials: dict
paragraphs: list[str]
summaries: list[str]
The challenge is how to link annotations to specific state values.
Proposed solution
Since state is immutable and we have the full object stored, we could store access paths for arbitrary Mapping and Sequence types (i.e., JSON-like). For example, you could annotate the 3rd paragraph by specifying State -> paragraphs -> index 2
Related: if paragraphs was a list of objects that have richer UI support (e.g., list[pydantic.BaseModel]), we could display them in rich format.
Adapting the annotation UI for easy navigation may be challenging