- Tauri 2.10 + Svelte 5.45 + TypeScript + Vite 7 - Catppuccin Mocha theme with CSS variables and semantic aliases - CSS Grid layout: sidebar (260px) + workspace, responsive breakpoints for ultrawide (3440px+) and narrow (<1200px) - Component structure: Layout/, Terminal/, Agent/, Markdown/, Sidebar/ - Svelte 5 stores with $state runes: sessions, agents, layout - SDK message adapter (abstracts Agent SDK wire format) - PTY bridge (Tauri IPC wrapper, stubbed for Phase 2) - Node.js sidecar entry point (stdio NDJSON, stubbed for Phase 3) - Rust modules: pty, sidecar, watcher, session (stubbed) - Vite dev server on port 9700 - Build verified: binary + .deb + .rpm + AppImage all produced
42 lines
1 KiB
TypeScript
42 lines
1 KiB
TypeScript
// Agent Runner — Node.js sidecar entry point
|
|
// Spawned by Rust backend, communicates via stdio NDJSON
|
|
// Phase 3: full Agent SDK integration
|
|
|
|
import { stdin, stdout, stderr } from 'process';
|
|
import { createInterface } from 'readline';
|
|
|
|
const rl = createInterface({ input: stdin });
|
|
|
|
function send(msg: Record<string, unknown>) {
|
|
stdout.write(JSON.stringify(msg) + '\n');
|
|
}
|
|
|
|
function log(message: string) {
|
|
stderr.write(`[sidecar] ${message}\n`);
|
|
}
|
|
|
|
rl.on('line', (line: string) => {
|
|
try {
|
|
const msg = JSON.parse(line);
|
|
handleMessage(msg);
|
|
} catch {
|
|
log(`Invalid JSON: ${line}`);
|
|
}
|
|
});
|
|
|
|
function handleMessage(msg: Record<string, unknown>) {
|
|
switch (msg.type) {
|
|
case 'ping':
|
|
send({ type: 'pong' });
|
|
break;
|
|
case 'query':
|
|
// Phase 3: call Agent SDK query()
|
|
send({ type: 'error', message: 'Agent SDK not yet integrated — Phase 3' });
|
|
break;
|
|
default:
|
|
send({ type: 'error', message: `Unknown message type: ${msg.type}` });
|
|
}
|
|
}
|
|
|
|
log('Sidecar started');
|
|
send({ type: 'ready' });
|