feat(v2): scaffold Tauri 2.x + Svelte 5 project (Phase 1)
- 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
This commit is contained in:
parent
5996615e68
commit
758d626fab
51 changed files with 2287 additions and 0 deletions
34
v2/src/lib/stores/agents.ts
Normal file
34
v2/src/lib/stores/agents.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// Agent tracking state — Svelte 5 runes
|
||||
// Phase 3: SDK agent lifecycle, subagent tree
|
||||
|
||||
export type AgentStatus = 'idle' | 'running' | 'thinking' | 'waiting' | 'done' | 'error';
|
||||
|
||||
export interface AgentState {
|
||||
id: string;
|
||||
sessionId: string;
|
||||
parentId?: string;
|
||||
status: AgentStatus;
|
||||
model?: string;
|
||||
costUsd?: number;
|
||||
tokensIn?: number;
|
||||
tokensOut?: number;
|
||||
}
|
||||
|
||||
let agents = $state<AgentState[]>([]);
|
||||
|
||||
export function getAgents() {
|
||||
return agents;
|
||||
}
|
||||
|
||||
export function getAgentTree(rootId: string): AgentState[] {
|
||||
const result: AgentState[] = [];
|
||||
const root = agents.find(a => a.id === rootId);
|
||||
if (!root) return result;
|
||||
|
||||
result.push(root);
|
||||
const children = agents.filter(a => a.parentId === rootId);
|
||||
for (const child of children) {
|
||||
result.push(...getAgentTree(child.id));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
28
v2/src/lib/stores/layout.ts
Normal file
28
v2/src/lib/stores/layout.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// Layout state management — Svelte 5 runes
|
||||
// Phase 2: pane positions, resize, presets
|
||||
|
||||
export type LayoutPreset = '1-col' | '2-col' | '3-col' | '2x2' | 'master-stack';
|
||||
|
||||
export interface PaneState {
|
||||
id: string;
|
||||
sessionId: string;
|
||||
row: number;
|
||||
col: number;
|
||||
rowSpan: number;
|
||||
colSpan: number;
|
||||
}
|
||||
|
||||
let activePreset = $state<LayoutPreset>('1-col');
|
||||
let panes = $state<PaneState[]>([]);
|
||||
|
||||
export function getActivePreset() {
|
||||
return activePreset;
|
||||
}
|
||||
|
||||
export function setPreset(preset: LayoutPreset) {
|
||||
activePreset = preset;
|
||||
}
|
||||
|
||||
export function getPanes() {
|
||||
return panes;
|
||||
}
|
||||
26
v2/src/lib/stores/sessions.ts
Normal file
26
v2/src/lib/stores/sessions.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Session state management — Svelte 5 runes
|
||||
// Phase 4: full session CRUD, persistence
|
||||
|
||||
export type SessionType = 'terminal' | 'agent' | 'markdown';
|
||||
|
||||
export interface Session {
|
||||
id: string;
|
||||
type: SessionType;
|
||||
title: string;
|
||||
createdAt: number;
|
||||
}
|
||||
|
||||
// Reactive session list
|
||||
let sessions = $state<Session[]>([]);
|
||||
|
||||
export function getSessions() {
|
||||
return sessions;
|
||||
}
|
||||
|
||||
export function addSession(session: Session) {
|
||||
sessions.push(session);
|
||||
}
|
||||
|
||||
export function removeSession(id: string) {
|
||||
sessions = sessions.filter(s => s.id !== id);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue