一键导入
architecture
Overall stack and module shape for nyxterm. Load when touching Tauri commands, PTY wiring, frontend↔backend IPC, or xterm rendering.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Overall stack and module shape for nyxterm. Load when touching Tauri commands, PTY wiring, frontend↔backend IPC, or xterm rendering.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | architecture |
| description | Overall stack and module shape for nyxterm. Load when touching Tauri commands, PTY wiring, frontend↔backend IPC, or xterm rendering. |
| triggers | ["tauri","xterm","pty","src-tauri/","src/modules/terminal/","ipc","webview"] |
portable-pty.fit, search, webgl, web-links, serialize addons).invoke() for commands; Tauri channels for binary streams (no JSON encoding of PTY output).nyxterm/
├── src-tauri/src/
│ ├── modules/
│ │ ├── pty/ # spawn, reader, flusher, waiter, signals, OSC filter
│ │ ├── multiplex/ # panes, splits, sessions
│ │ ├── shell/ # shell init (ZDOTDIR injection like Ghostty/Terax)
│ │ ├── fs/ # file ops for the AI harness
│ │ ├── theme/ # palette emit + theme reload
│ │ └── ai/ # provider routing, MCP client
│ ├── lib.rs # app init, command registration
│ └── main.rs
└── src/
└── modules/
├── terminal/ # TerminalPane, xterm wiring, renderer pool
├── multiplex/ # pane grid UI
├── ai/ # chat panel, tool calls
├── command-palette/
└── settings/
Three concurrent threads per PTY session:
ArrayBuffer chunks to the frontend channel.See pty-handling for the gotchas (SIGWINCH, ConPTY, OSC 7 trust).
Commands (frontend → backend):
#[tauri::command] fn pty_open(cols: u16, rows: u16, cwd: Option<String>, env: WorkspaceEnv) -> SessionId
#[tauri::command] fn pty_write(session_id: SessionId, data: String)
#[tauri::command] fn pty_resize(session_id: SessionId, cols: u16, rows: u16)
#[tauri::command] fn pty_close(session_id: SessionId)
Channels (backend → frontend):
data: ArrayBuffer — raw PTY bytes, no encoding.exit: i32 — exit code on child termination.Frontend receives ArrayBuffer and writes directly into xterm via term.write(bytes). Do NOT base64-encode — that doubles bandwidth and burns CPU.
altScreenAtRelease so we can SIGWINCH-kick the next bind for clean TUI repaint.| Concern | Layer |
|---|---|
| PTY syscalls, signals | Rust (src-tauri/src/modules/pty) |
| Theme palette source-of-truth | Rust emits, frontend listens |
| Pane layout state | Frontend (Zustand or similar), persisted via Engram |
| AI tool execution (Read/Write/Edit/Bash) | Rust (sandboxed where possible) |
| AI chat UI | React |
| MCP client | Rust |
Update this skill and AGENTS.md's skills table. Architectural changes are SDD-tracked (proposal → design → ...).
AI layer embeds the Pi SDK. Load when touching AI module, harness integration, providers, MCP decision, or chat UI.
Conventional Commits, work-unit commits, NO Co-Authored-By. Load before creating any commit.
Project philosophy and decision-making heuristics. Load before scope debates, feature proposals, or refactors.
Engram embedded + MCP fallback. Topic key conventions. Load when touching anything memory-related or starting/closing a session.
Native windows/splits/panes (absorb tmux). Load when touching multiplex module, keybinds, or session persistence.
Flake structure, Home Manager module, nixGL wrapper. Load when touching flake.nix, packaging, or NixOS integration.