mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 08:02:11 +00:00
Add custom message extension system with typed renderers and message transformer
- Implement CustomMessages interface for type-safe message extension via declaration merging - Add MessageRenderer<T> with generic typing for custom message rendering - Add messageTransformer to Agent for filtering/transforming messages before LLM - Move message filtering from transports to Agent (separation of concerns) - Add message renderer registry with typed role support - Update web-ui example with SystemNotificationMessage demo - Add custom transformer that converts notifications to <system> tags - Add SessionListDialog onDelete callback for active session cleanup - Handle non-existent session IDs in URL (redirect to new session) - Update both web-ui example and browser extension with session fixes
This commit is contained in:
parent
cf6b3466f8
commit
05dfaa11a8
12 changed files with 457 additions and 152 deletions
|
|
@ -189,9 +189,17 @@ const renderApp = () => {
|
|||
size: "sm",
|
||||
children: icon(History, "sm"),
|
||||
onClick: () => {
|
||||
SessionListDialog.open((sessionId) => {
|
||||
loadSession(sessionId);
|
||||
});
|
||||
SessionListDialog.open(
|
||||
(sessionId) => {
|
||||
loadSession(sessionId);
|
||||
},
|
||||
(deletedSessionId) => {
|
||||
// If the deleted session is the current one, start a new session
|
||||
if (deletedSessionId === currentSessionId) {
|
||||
newSession();
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
title: "Sessions",
|
||||
})}
|
||||
|
|
@ -334,10 +342,14 @@ async function initApp() {
|
|||
|
||||
renderApp();
|
||||
return;
|
||||
} else {
|
||||
// Session doesn't exist, redirect to new session
|
||||
newSession();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// No session or session not found - create new agent
|
||||
// No session - create new agent
|
||||
await createAgent();
|
||||
renderApp();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue