Agents: CRUD, DB table, session binding, replace model picker

- agents table with name, avatar, description, model, persona, instructions, soft-delete
- AgentEndpoint (GET/POST/PUT/DELETE /api/agents)
- sessions + chains now reference agent_id
- ChatEndpoint resolves agent from session (no agent = no chat)
- system prompt built from agent persona + instructions
- frontend: agent editor with avatar upload, agent cards on dashboard
- session: agent dropdown replaces model picker, choice persisted
This commit is contained in:
Meleki committed 2026-02-26 20:59:19 +01:00
1 parent 0cd2d51d32
commit 449c872296
16 files changed
+552 -46

No files matched your search

+80
View File
@@ -129,3 +129,83 @@ body {
.placeholder-icon {
font-size: 4em;
}
/* ── Agent Form ── */
.agent-form {
padding: calc(var(--s4) * 2);
overflow-y: auto;
display: flex;
flex-direction: column;
gap: var(--s3);
max-width: 600px;
}
.agent-form label {
font-weight: bold;
}
.agent-form textarea {
resize: vertical;
}
.agent-avatar-section {
display: flex;
align-items: center;
gap: var(--s4);
}
.agent-avatar-preview {
width: 64px;
height: 64px;
background: var(--f2-bg);
border: var(--border-width) solid var(--f2-border);
display: flex;
align-items: center;
justify-content: center;
font-size: 2em;
overflow: hidden;
flex-shrink: 0;
}
.agent-avatar-preview img {
width: 100%;
height: 100%;
object-fit: cover;
}
.agent-form-actions {
display: flex;
gap: var(--s4);
margin-top: var(--s4);
}
.danger-btn {
color: #ff6b6b;
border-color: #ff6b6b;
}
.danger-btn:hover {
background: #ff6b6b;
color: var(--f1-bg);
}
/* ── Agent Card Avatar ── */
.agent-card-avatar {
width: 40px;
height: 40px;
background: var(--f2-bg);
border: var(--border-width) solid var(--f2-border);
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2em;
overflow: hidden;
}
.agent-card-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}