diff --git a/chat/app.py b/chat/app.py index 6233d58..1d47509 100644 --- a/chat/app.py +++ b/chat/app.py @@ -17,6 +17,7 @@ import chat.state.world # noqa: F401 from chat.web.bots import router as bots_router from chat.web.chat import router as chat_router +from chat.web.drawer import router as drawer_router from chat.web.kickoff import router as kickoff_router from chat.web.nav import router as nav_router from chat.web.settings import router as settings_router @@ -62,6 +63,7 @@ app.include_router(kickoff_router) app.include_router(settings_router) app.include_router(nav_router) app.include_router(chat_router) +app.include_router(drawer_router) app.include_router(sse_router) app.include_router(turns_router) diff --git a/chat/static/app.css b/chat/static/app.css index f40bd40..915aa1c 100644 --- a/chat/static/app.css +++ b/chat/static/app.css @@ -79,3 +79,13 @@ code { font-family: ui-monospace, "SF Mono", Menlo, monospace; } .turn-input textarea { padding: 8px; font: inherit; border: 1px solid #ccc; border-radius: 3px; resize: vertical; } .drawer { position: fixed; top: 0; right: 0; width: 360px; height: 100vh; background: #fff; border-left: 1px solid #e5e5e5; padding: 16px; overflow-y: auto; z-index: 10; } .drawer[hidden] { display: none; } +.drawer-content { display: flex; flex-direction: column; gap: 16px; } +.drawer-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid #e5e5e5; } +.drawer-close { border: none; background: transparent; color: #1c1c1c; font-size: 24px; padding: 0 4px; cursor: pointer; } +.drawer-section h3 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: #666; } +.activity-row, .edge-row { margin-bottom: 12px; } +.activity-row strong, .edge-row strong { display: block; } +.memory-list { list-style: none; padding: 0; margin: 0; } +.memory-list li { padding: 4px 0; font-size: 13px; } +.sig { display: inline-block; min-width: 16px; } +.sig-3 { color: #d4af37; } diff --git a/chat/templates/_drawer.html b/chat/templates/_drawer.html new file mode 100644 index 0000000..637a8d3 --- /dev/null +++ b/chat/templates/_drawer.html @@ -0,0 +1,94 @@ +
+
+

{{ host_bot.name }}

+ +
+ +
+

Scene

+ {% if scene %} +

Started: {{ scene.started_at }}

+ {% endif %} + {% if container %} +

Container: {{ container.name }} ({{ container.type }})

+ {% else %} +

No active container.

+ {% endif %} +

Time: {{ chat.time }}

+
+ +
+

Activity

+ {% for label, act in [("you", you_activity), (host_bot.name, bot_activity)] %} +
+ {{ label }} + {% if act %} +

{{ act.posture or "—" }} / {{ (act.action or {}).verb or "—" }}

+ {% if act.attention %}

attention: {{ act.attention }}

{% endif %} + {% if act.holding %}

holding: {{ act.holding|join(", ") }}

{% endif %} + {% else %} +

No activity recorded.

+ {% endif %} +
+ {% endfor %} +
+ +
+

Edges

+ {% if edge_b2y %} +
+ {{ host_bot.name }} → you +

Affinity: {{ edge_b2y.affinity }}/100 · Trust: {{ edge_b2y.trust }}/100

+ {% if edge_b2y.summary %}

{{ edge_b2y.summary }}

{% endif %} + {% if edge_b2y.knowledge %} +
Knowledge ({{ edge_b2y.knowledge|length }}) +
    {% for fact in edge_b2y.knowledge %}
  • {{ fact }}
  • {% endfor %}
+
+ {% endif %} +
+ {% endif %} + {% if edge_y2b %} +
+ you → {{ host_bot.name }} +

Affinity: {{ edge_y2b.affinity }}/100 · Trust: {{ edge_y2b.trust }}/100

+ {% if edge_y2b.summary %}

{{ edge_y2b.summary }}

{% endif %} +
+ {% endif %} + {% if not edge_b2y and not edge_y2b %} +

No edges yet.

+ {% endif %} +
+ +
+

Pinned memories ({{ pinned|length }} / {{ pin_cap }})

+ {% if pinned %} + + {% else %} +

No pinned memories.

+ {% endif %} +
+ +
+

Recent memories

+ {% if recent_memories %} + + {% else %} +

No memories yet.

+ {% endif %} +
+
diff --git a/chat/templates/chat.html b/chat/templates/chat.html index 02f5c2d..0e45b6b 100644 --- a/chat/templates/chat.html +++ b/chat/templates/chat.html @@ -30,8 +30,11 @@ -