Files
LLeMbas/src/lembas/web/templates/admin/_layout.html
T
Jaroslav Beneš ecadb66414 MCP servers, over streamable HTTP
A server is a row with a URL; its tools are discovered by a button and
cached, then offered beside the built-in ones. Written by hand rather than
taken from the reference SDK, because that SDK's transport does its own
connecting -- and the one thing that must not be bypassed is check_url on
every hop. Owning the transport is the point; the framing beside it is the
small part.

Sessions are per call: initialize, initialized, the call, a best-effort
DELETE. Caching one wants an owner, a TTL, eviction, a lock and a shutdown
hook, and the server may expire it under all of that anyway -- ToolContext
is a session-free snapshot precisely so nothing in a tool holds live state.

A server's names and descriptions reach the model as instructions and are
bounded before they do; what it returns is escaped preformatted text, never
markdown. Tools are namespaced per server, so two servers exposing "search"
do not collide and neither shadows a built-in.

Also: a round's calls now run together under a semaphore, results indexed
so each tool turn stays paired with its call, and generation.status names
what is running -- a remote tool is latency-bound, and a silent pause is
what a hang looks like.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-01 16:44:29 +02:00

107 lines
4.0 KiB
HTML

{% extends "base.html" %}
{% from "_macros.html" import icon, brand %}
{#
Shared chrome for the admin area: its own narrow nav rather than the chat
sidebar, so administration is visibly a different place from chatting.
#}
{% block head %}
<link rel="stylesheet" href="{{ url_for('static', path='css/chat.css') }}">
<link rel="stylesheet" href="{{ url_for('static', path='css/admin.css') }}">
{% endblock %}
{% block body_attrs %} data-authenticated="true"{% endblock %}
{% block body %}
<div class="shell">
<aside class="sidebar">
<div class="sidebar__header">
{{ brand(uid="admin") }}
</div>
<nav class="sidebar__scroll" aria-label="Administration">
<div class="nav-group">
<div class="nav-group__label">Administration</div>
<a class="nav-item {{ 'is-active' if section == 'general' }}" href="/admin/general">
{{ icon("gear", "icon--sm") }}
<span class="nav-item__label">General</span>
</a>
<a class="nav-item {{ 'is-active' if section == 'connections' }}"
href="/admin/connections">
{{ icon("server", "icon--sm") }}
<span class="nav-item__label">Connections</span>
</a>
<a class="nav-item {{ 'is-active' if section == 'models' }}" href="/admin/models">
{{ icon("sliders", "icon--sm") }}
<span class="nav-item__label">Models</span>
</a>
<a class="nav-item {{ 'is-active' if section == 'audio' }}" href="/admin/audio">
{{ icon("speaker", "icon--sm") }}
<span class="nav-item__label">Audio</span>
</a>
<a class="nav-item {{ 'is-active' if section == 'search' }}" href="/admin/search">
{{ icon("globe", "icon--sm") }}
<span class="nav-item__label">Web search</span>
</a>
<a class="nav-item {{ 'is-active' if section == 'tools' }}" href="/admin/tools">
{{ icon("link", "icon--sm") }}
<span class="nav-item__label">Tools</span>
</a>
<a class="nav-item {{ 'is-active' if section == 'mcp' }}" href="/admin/mcp">
{{ icon("server", "icon--sm") }}
<span class="nav-item__label">MCP servers</span>
</a>
<a class="nav-item {{ 'is-active' if section == 'prompts' }}" href="/admin/prompts">
{{ icon("sparkle", "icon--sm") }}
<span class="nav-item__label">Prompts</span>
</a>
<a class="nav-item {{ 'is-active' if section == 'suggestions' }}"
href="/admin/suggestions">
{{ icon("star", "icon--sm") }}
<span class="nav-item__label">Suggestions</span>
</a>
<a class="nav-item {{ 'is-active' if section == 'users' }}" href="/admin/users">
{{ icon("user", "icon--sm") }}
<span class="nav-item__label">Users</span>
</a>
<a class="nav-item {{ 'is-active' if section == 'groups' }}" href="/admin/groups">
{{ icon("users", "icon--sm") }}
<span class="nav-item__label">Groups &amp; permissions</span>
</a>
</div>
<div class="nav-group">
<div class="nav-group__label">Not yet built</div>
<span class="nav-item is-disabled">
{{ icon("server", "icon--sm") }}
<span class="nav-item__label">Agents</span>
</span>
</div>
</nav>
<div class="sidebar__footer">
<a class="nav-item" href="/chat">
{{ icon("chat", "icon--sm") }}
<span class="nav-item__label">Back to chats</span>
</a>
</div>
</aside>
<main class="main">
<header class="topbar">
<h1 class="topbar__title">{% block heading %}Administration{% endblock %}</h1>
<button class="btn btn--icon" type="button" data-theme-toggle aria-label="Switch theme">
<span class="theme-icon theme-icon--dark">{{ icon("moon") }}</span>
<span class="theme-icon theme-icon--light">{{ icon("sun") }}</span>
</button>
</header>
<div class="admin-scroll">
<div class="admin-page">
{% block admin_content %}{% endblock %}
</div>
</div>
</main>
</div>
{% endblock %}