fix(cli): wire command:result + system:reload socket events in TUI (#187)

Co-authored-by: Jason Woltje <[email protected]>
Co-committed-by: Jason Woltje <[email protected]>
This commit is contained in:
2026-03-16 13:21:11 +00:00
committed by jason.woltje
parent b6effdcd6b
commit f0476cae92
6 changed files with 189 additions and 77 deletions
+18 -1
View File
@@ -144,6 +144,23 @@ program
}
}
// Auto-create a conversation if none was specified
let conversationId = opts.conversation;
if (!conversationId) {
try {
const { createConversation } = await import('./tui/gateway-api.js');
const conv = await createConversation(opts.gateway, session.cookie, {
...(projectId ? { projectId } : {}),
});
conversationId = conv.id;
} catch (err) {
console.error(
`Failed to create conversation: ${err instanceof Error ? err.message : String(err)}`,
);
process.exit(1);
}
}
// Dynamic import to avoid loading React/Ink for other commands
const { render } = await import('ink');
const React = await import('react');
@@ -152,7 +169,7 @@ program
render(
React.createElement(TuiApp, {
gatewayUrl: opts.gateway,
conversationId: opts.conversation,
conversationId,
sessionCookie: session.cookie,
initialModel: opts.model,
initialProvider: opts.provider,