feat: add sqlite storage and terminal ui

This commit is contained in:
Mohamed Boudra
2026-03-29 23:20:18 +07:00
parent e5fd61f131
commit 7d02e24d84
189 changed files with 17868 additions and 4663 deletions
+14
View File
@@ -17,6 +17,11 @@ export interface AgentSendResult {
message: string;
}
function isTerminalAgentSendError(error: unknown): boolean {
const message = error instanceof Error ? error.message : String(error);
return /terminal agents do not support structured send operations/i.test(message);
}
/** Schema for agent send output */
export const agentSendSchema: OutputSchema<AgentSendResult> = {
idField: "agentId",
@@ -260,6 +265,15 @@ export async function runSendCommand(
} catch (err) {
await client.close().catch(() => {});
if (isTerminalAgentSendError(err)) {
const error: CommandError = {
code: "TERMINAL_AGENT_UNSUPPORTED",
message: "Cannot send messages to terminal agents",
details: "Open the terminal agent from the Sessions UI and interact through its terminal.",
};
throw error;
}
// Re-throw CommandError as-is
if (err && typeof err === "object" && "code" in err) {
throw err;