跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

caret-poll.mjs

16 行 · 661 B历史下载
1// Focus and the caret nearly always move because of the viewer's own input.
2// Read them quickly while the viewer acts, and rarely once they stop: every
3// reading is a round trip into the guest, and on Linux also a probe key.
4export const caretPollFast = 250;
5export const caretPollSlow = 2000;
6
7export function caretPollDelay(quiet) {
8 if (quiet < 3000) return caretPollFast;
9 if (quiet < 8000) return 500;
10 if (quiet < 20000) return 1000;
11 return caretPollSlow;
12}
13
14// A composition may begin from the reading of the last slow interval. The
15// guest still rejects a context that changed in the meantime.
16export const caretFreshFor = caretPollSlow + 500;