Skip to content

Commit 0352080

Browse files
committed
docs: update AGENTS.md with current state, add CLAUDE.md symlink
1 parent 43238a4 commit 0352080

2 files changed

Lines changed: 40 additions & 2 deletions

File tree

‎AGENTS.md‎

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,48 @@
3636

3737
## Demo App
3838

39-
- Lives under `lib/a2ui/demo/` and the `A2UI.Demo.*` namespace
40-
- Not part of the published library — embedded example only
39+
- Lives under `dev/demo/` and the `A2UI.Demo.*` namespace
40+
- Not part of the published hex package — dev/test only
41+
- Compiled only in `:dev` and `:test` environments (see `elixirc_paths` in mix.exs)
4142
- Config in `config/config.exs` is demo-specific, not library config
4243
- Run with `mix a2ui.demo`
4344

45+
## Package Info
46+
47+
- Hex package name: `a2ui`
48+
- Version: 0.1.0
49+
- Source: https://github.com/actioncard/a2ui-elixir
50+
- License: Apache-2.0
51+
- Maintainer: Action Card AB
52+
53+
## Architecture
54+
55+
```
56+
Agent (GenServer / A2A Remote Agent)
57+
│ {:a2ui_message, msg} / PubSub
58+
▼
59+
Transport Layer (A2UI.Transport behaviour)
60+
│
61+
▼
62+
LiveView Process (use A2UI.Live)
63+
├─ handle_info({:a2ui_message, msg}) → SurfaceManager → assign
64+
├─ render: <.surface /> → Renderer walks adjacency list → function components
65+
├─ handle_event("a2ui_action") → EventHandler → Transport → agent
66+
└─ handle_event("a2ui_input_change") → updates local data model
67+
│
68+
▼ LiveView WebSocket
69+
Browser (native HTML, phx-click / phx-change events)
70+
```
71+
72+
## Key Design Decisions
73+
74+
1. **Function Components** (not LiveComponents) — surface state managed centrally in LiveView assigns via SurfaceManager
75+
2. **Pure Functional SurfaceManager** — `apply_message(surfaces, msg) → surfaces`, no GenServer needed
76+
3. **Data Binding Resolved at Render Time** — props stay as raw JSON until render, LiveView diff engine detects changes
77+
4. **Adjacency List Stays Flat** — renderer walks `%{id => component}` map via ID lookups, no tree reconstruction
78+
5. **CSS Convention** — `a2ui-*` BEM-style classes, layout via CSS utility classes, weight via `--a2ui-weight` custom property
79+
6. **Transport as Behaviour** — `A2UI.Transport` behaviour; `Local` (process messages) now, SSE/A2A later
80+
4481
## Do NOT
4582

4683
- Use `Application.get_env/3` in library code — accept config via function arguments

‎CLAUDE.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

0 commit comments

Comments
 (0)