Repository navigation
feat(session-inspector): Session-scoped Terminal surface; drop Actions - #147
Merged
Merged
Conversation
Add a Terminal surface to the inspector rail (ADR-0028's first multi-instance surface): an instance strip in the panel header, a count badge on the rail, and one xterm.js viewport per instance. The utilityProcess backend owns real PTYs via @lydell/node-pty (N-API — no Electron rebuild) and streams I/O over the existing RPC event channel; attach replays a bounded scrollback with offset-based de-dupe. Shells open in the Session's execution checkout (ADR-0007), falling back to the runtime snapshot cwd. - backend: drivers/terminal.ts + list/open/attach/input/resize/close RPC - renderer: TerminalView primitive (token-resolved chrome colors, conventional ANSI palettes picked by background luminance, slim token-tinted scrollbar via overviewRuler.width), terminal-client, SessionTerminalPanel - inspector: flushContent surface flag drops header and content padding; Changes and Terminal both render edge-to-edge; the terminal strip is a second 40px band matching the header - Actions surface removed; archive stays on the sidebar row menu - packaging: scripts/stage-node-pty.mjs materializes node-pty from bun's store so electron-builder can ship it (asarUnpacked) - AGENTS.md: never exercise the pty driver under the Bun runtime Verified: tsc clean, vitest 758 green, playwright 17/17 including a packaged-app terminal smoke.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
右栏 SessionInspector 新增 Terminal surface——ADR-0028 预留的首个多实例 surface 实装:
@lydell/node-pty——N-API 模块,Electron 免 rebuild;I/O 走既有 RPC 事件通道,attach 重放有界 scrollback 并按流偏移去重(修掉了启动横幅重复打印的竞态)TerminalView原语(Astryx 无终端组件)——chrome 色经探针从 token 桥解析(@scope+ 链式 var() + light-dark() 全链解析),ANSI 16 色按背景亮度在深/浅两套惯例色间切换,跟随 OS 明暗切换;滚动条按 app 语言瘦身为 8px token 半透明滑块(xterm 6 自绘滚动条,宽度由overviewRuler.width控制)同时移除 Actions surface(checkout 元数据 / model & cost / Archive 区块);归档入口保留在侧栏会话行菜单。
Packaging
node-pty是首个原生依赖:scripts/stage-node-pty.mjs把 bun store 里的实体包物化进apps/desktop/node_modules(幂等,五个 package/dist 脚本已串上),electron-builder.yml回包含并 asarUnpack 整个@lydellscope(pty.node要 dlopen、spawn-helper要 exec)。已在打包产物(未签名)里实测终端可用。Notes
package:mac已验证:pty.node/spawn-helper带 hardened-runtime 签名,codesign --verify --deep --strict通过,签名包终端 e2e 通过。dist:mac(dmg)会触发公证(notarize),需要 Apple 凭据,本次未跑。Test plan
bun run typecheck干净bun run test:758 通过(新增 backend driver 9 个、service 4 个、client 3 个、TerminalView 5 个、面板 7 个单测;actions 相关测试移除或改道)bun run test:e2e:17/17,含新增terminal-surface.spec.ts(真实 Electron + zsh:spawn、echo 往返、多实例、tab 切换 scrollback 重放、关闭实例)bun run test:e2e:packaged:mac -- terminal-surface:打包态通过