@linkshell/host

中文文档
0.4.80发布于 2026/11/02MITTypeScriptES Module

LinkShell v2 host daemon: owns agent sessions and terminals on your computer, serves them to your devices.

原始使用文档
文档目录4 节
  1. Codex authentication
  2. Session recovery
  3. Agent questions
  4. Remote screen

@linkshell/host

The LinkShell v2 host daemon. It runs on your computer and owns what your devices control: agent sessions (Codex, Claude Code, Gemini, Copilot, Grok and other ACP agents), terminals, files, port previews and the remote screen. Devices reach it over the LAN or through a relay, end-to-end encrypted.

Run it through the CLI: npm install -g linkshell-cli, then linkshell host --daemon.

Claude Workflow progress and background sub-agent transcripts stay synchronized even while the main conversation is idle. The app can open each run, phase and Agent independently.

Codex authentication

Codex uses the computer's existing ChatGPT, API key or custom-provider configuration, including settings managed by CC Switch. A Codex login is not required by LinkShell: account detection is advisory, and Codex reports credential errors when a request runs. Restart the host after changing shell environment variables.

pnpm --filter @linkshell/host live:codex-api checks the installed Codex CLI against a loopback Responses fixture with isolated configuration: saved API keys, provider env keys and providers without account authentication. Each completes two turns through the host and checks HTTP authentication. No real API credentials or paid inference are used.

Session recovery

Host 0.4.19 revalidates busy sessions after restart, reconciles Codex native archives, and treats interrupted turns as finished. Archived Codex history is read without unarchiving. Missing Claude transcripts and other history failures preserve cached messages and show a retryable error. Lazy ACP agents initialize before their restore capabilities are checked; resume-only agents explain that earlier messages cannot be fetched.

The host negotiates and validates ACP 1. ACP 2 remains draft and changes prompt completion, history replay, messages and permissions; changing the version number alone is incompatible. See session recovery, protocol evidence and validation.

Agent questions

Codex Desktop asynchronous questions retain their pending state and accept immediate replies. Claude and standard ACP forms, Cursor choice questions, and Grok questions/MCP forms share the phone's question card while preserving each agent's native response format. See question support and validation boundaries.

Remote screen

screen.start returns a token-protected loopback viewer port and display list. The phone forwards the port; the web client hosts the same page in an isolated iframe. On Apple silicon and Intel Macs running macOS 13+, the universal LinkShell.app captures and encodes with ScreenCaptureKit/VideoToolbox. The host passes SDP/ICE over its Unix socket; the media track and four input/cursor channels run directly between LinkShell.app and the native iOS receiver or web player.

This media connection is separate from the host's werift bulk DataChannel (direct.offer), which can carry forwarded HTTP/WebSocket traffic. If video fails, the Mac supplies encoded H.264 frames over another Unix socket and screen-pacer.ts applies ACK-based dropping and quality steps; WebCodecs renders the byte stream. iOS tries native → standard WebView → RPC, bypassing the bulk direct channel for the last step. Linux uses ffmpeg/X11 and is view-only.

LINKSHELL_ICE_SERVERS=off disables the bulk channel and removes STUN from screen signalling; video can still try LAN candidates. LINKSHELL_SCREEN_VIDEO=off disables media-track offers. A gateway with a TURN server lends the host its credentials (turn.credentials): video tries direct paths first, the relay next (held to the gateway's TURN_MAX_KBPS), and the byte relay last. A relayed picture, through TURN or the gateway, ends after 3 minutes unused (LINKSHELL_SCREEN_IDLE_SECONDS, 0 for never); LINKSHELL_TURN=off keeps the host off TURN. See the current architecture for source/display limits, transport-specific defaults and validation boundaries.

Requires Node.js 22.13 or newer.

MIT License

版本与发布记录

@linkshell/host 共发布 88 个版本,首次发布于 2026/09/30;过去 12 个月发布了 88 个版本。

版本发布日期距今
0.4.80latest2026/11/021 天前
0.4.792026/11/011 天前
0.4.782026/11/012 天前
0.4.772026/11/012 天前
0.4.762026/11/012 天前
0.4.752026/10/303 天前

关于 @linkshell/host 的常见问题

@linkshell/host 是什么?

LinkShell v2主机守护进程:拥有您计算机上的代理会话和终端,为您的设备提供服务。

如何安装 @linkshell/host?

在项目目录运行 npm install @linkshell/host,或使用 pnpm add / yarn add / bun add。

@linkshell/host 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@linkshell/host 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@linkshell/host 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.13。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@linkshell/host 可以商用吗?

@linkshell/host 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@linkshell/host 还在维护吗?

最新版本 0.4.80 发布于 2026/11/02(1 天前);至今共发布 88 个版本,其中过去 12 个月发布了 88 个;首次发布于 2026/09/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。