Coding
PromptBeginner5 minmarkdown
Nano Banana Pro
Agent skill for nano-banana-pro
7
This directory is the core state synchronization layer, responsible for observing the VS Code environment and broadcasting state changes to the backend server (via the `../comms` system).
Sign in to like and favorite skills
src/sync)This directory is the core state synchronization layer, responsible for observing the VS Code environment and broadcasting state changes to the backend server (via the
../comms system).
All sync modules are activated by
src/sync/index.ts and triggered primarily by requestSync events.
| File | Purpose | Data Broadcasted | Key Features |
|---|---|---|---|
| Environment | , , , , clipboard content. | Provides essential metadata about the VS Code instance and context. |
| Window State | Tab group structure, active/dirty tabs, visible text editors, window state. | Captures the UI layout and editing activity. |
| Workspace | Workspace name, trust status, folders, open text documents. | Captures the project-level context. |
| Terminal Activity | Command line, current working directory, output, exit code for each execution. | Tracks terminal commands using VS Code Shell Integration. Also handles opening a Dagger-based terminal via the event. |
fs.ts: Contains a VegContentProvider implementation similar to src/services/filesystemProvider.ts. It is NOT currently imported or activated by index.ts. It appears to be an older or alternative implementation of the virtual filesystem logic.terminals.ts)The terminal synchronization is robust, capturing full execution history.
class Exec { start: vscode.TerminalShellExecutionStartEvent | null = null output: string = "" end: vscode.TerminalShellExecutionEndEvent | null = null } class Terminal { termIndex: number = 0; terminal: vscode.Terminal | null = null; history: Exec[] = []; } class TerminalPayload { id: number = -1; name?: string; history?: HistoryPayload[]; } class HistoryPayload { cmd?: any; cwd?: string; out?: string; exit?: number; }
It listens to:
onDidStartTerminalShellExecutiononDidEndTerminalShellExecutionread() from the execution stream to capture output.env.ts)Broadcasts information about the environment.
async function broadcastEnv(context: vscode.ExtensionContext) { const wsF = vscode.workspace.workspaceFolders var wDir: string | undefined if (wsF && wsF.length > 0) { wDir = wsF[0].uri.path } const sid = context.workspaceState.get("sid") const msg = { type: "env.info.resp", payload: { sid, machineId: vscode.env.machineId, vscodeSid: vscode.env.sessionId, remoteName: vscode.env.remoteName, user: "verdverm", workspaceDir: wDir, clipboard: await vscode.env.clipboard.readText(), } } extensionEmitter.fire(msg); sendMessage(msg) }