Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions external_plugins/cot-peek/.zcode-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "cot-peek",
"version": "1.0.2",
"description": "A floating ball that translates English reasoning traces into Chinese in real time, plus on-the-fly clipboard translation.",
"description_i18n": {
"en": "A floating ball that translates English reasoning traces into Chinese in real time, plus on-the-fly clipboard translation.",
"zh-CN": "思考小窗:悬浮球实时翻译英文思维链,半秒上屏,空闲零 CPU。附划词翻译,复制英文即出中文。"
},
"author": {
"name": "cobaltna"
},
"license": "MIT",
"skills": "skills",
"commands": "commands"
}
40 changes: 40 additions & 0 deletions external_plugins/cot-peek/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Cot Peek / 思考小窗

A floating ball that translates English reasoning traces into Chinese in real time. AI thinks in English; this ball speaks Chinese, half a second after each reasoning round lands on disk.

[中文说明](README_CN.md)

![thinking stream](https://raw.githubusercontent.com/cobaltna/cot-peek/main/screenshots/thinking.png)

## What it does

- **Reasoning stream**: watches ZCode's rollout directory with `ReadDirectoryChangesW`; each finished reasoning round is split into segments, translated by three concurrent workers, and shown as it completes. Latency from file write to on-screen text measured at 0.05 to 0.5 seconds.
- **Clipboard translation**: copy any English text while the window is open and get Chinese within a second.
- **Tabbed window**: one window, two tabs, a pause button. Reading position never jumps; the view only follows when you are already at the bottom.
- **Round ball**: a small dark circle docked at the right edge of the screen, with no rectangular frame. Click to expand, click × to collapse. Collapsing pauses all translation.

![clipboard](https://raw.githubusercontent.com/cobaltna/cot-peek/main/screenshots/clipboard.png)

## Install

From ZCode: Settings → Plugin Management → Discover → add the marketplace `cobaltna/cot-peek` → install 思考小窗. Then run `/cot-peek:start` or just tell ZCode to start it.

Standalone: run `install.ps1` from this directory with pwsh. It locates `pythonw.exe` and registers a per-minute scheduled task `ZCodeCotPeek` so the ball appears whenever ZCode runs and quits the moment ZCode exits. Or double-click `start-cot-peek.bat` to start it once.

Requirements: Windows 10/11, any Python 3 with tkinter.

## Side effects and dependencies

Read this before installing:

- **Network access**: translation requests go to three free public web endpoints, in fallback order: Volcengine translate web API (`translate.volcengine.com`), Bing translator (`cn.bing.com`), MyMemory (`api.mymemory.translated.net`). No keys, no accounts, no telemetry. If all three fail, the original English text is kept and marked red.
- **Files read**: `~/.zcode/cli/rollout/model-io-session_*.jsonl` and the system process list. Nothing else.
- **Files written**: only inside the plugin's own directory: `cot_peek.log`, `cot_peek.json`, `cot_peek.lock`.
- **Processes**: runs `pythonw.exe cot_peek.py`; `install.ps1` registers a Windows scheduled task via `schtasks.exe`.
- **No hooks, no MCP servers, no model-context injection, no writes to ZCode data**.

## Third-party services

Translation is performed by Volcengine, Microsoft Bing, and MyMemory public web endpoints. Their availability and terms may change at any time; Cot Peek degrades gracefully when they do. All other code is original, MIT licensed, Python standard library plus tkinter only.

![ball](https://raw.githubusercontent.com/cobaltna/cot-peek/main/screenshots/ball.png)
40 changes: 40 additions & 0 deletions external_plugins/cot-peek/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 思考小窗 / Cot Peek

一颗悬浮球,实时把英文思维链翻成中文。AI 用英文思考,这颗球用中文讲给你听,每轮思考落盘后半秒内出译文。

[English](README.md)

![思考流翻译](https://raw.githubusercontent.com/cobaltna/cot-peek/main/screenshots/thinking.png)

## 功能

- **思考流翻译**:用 ReadDirectoryChangesW 监听 ZCode 的 rollout 目录,每轮思考切成小段,三路并发翻译,逐段上屏。从写入到出译文实测 0.05 到 0.5 秒。
- **划词翻译**:窗口开着时复制一段英文,1 秒内出中文。
- **标签页窗口**:一个窗口两个标签页加一个暂停按钮。阅读位置永不跳动,只有视口停在底部才自动跟随。
- **圆形悬浮球**:一颗深色圆球,贴在屏幕右缘,圆外没有底框。点球展开,点 × 收起,收起即暂停。

![划词翻译](https://raw.githubusercontent.com/cobaltna/cot-peek/main/screenshots/clipboard.png)

## 安装

从 ZCode 装:设置 → 插件管理 → 发现 → 添加市场 `cobaltna/cot-peek` → 安装「思考小窗」。然后运行 `/cot-peek:start`,或直接对 ZCode 说「启动思考小窗」。

独立安装:在 pwsh 里运行本目录的 `install.ps1`。脚本会找到 pythonw.exe 并注册每分钟检查的计划任务 `ZCodeCotPeek`,ZCode 一运行小球就出现,ZCode 一退出小球即时跟随退出。也可以双击 `start-cot-peek.bat` 单次启动。

要求:Windows 10/11,任意带 tkinter 的 Python 3。

## 副作用与依赖

安装前请读这一段:

- **网络访问**:翻译请求发往三个免费公共网页接口,按序降级:火山翻译网页版 `translate.volcengine.com`、微软必应翻译 `cn.bing.com`、MyMemory `api.mymemory.translated.net`。不需要 key,不需要账号,无任何遥测。三个全挂时保留英文原文并标红。
- **读取的文件**:`~/.zcode/cli/rollout/model-io-session_*.jsonl` 与系统进程列表,仅此两项。
- **写入的文件**:只在插件自己的目录里写 `cot_peek.log`、`cot_peek.json`、`cot_peek.lock`。
- **进程**:运行 `pythonw.exe cot_peek.py`;`install.ps1` 通过 `schtasks.exe` 注册 Windows 计划任务。
- **没有 hook,没有 MCP server,不注入模型上下文,不写 ZCode 的任何数据**。

## 第三方服务

翻译由火山翻译、微软必应、MyMemory 的公共网页接口完成,可用性与条款随对方变化,接口变动时工具自动降级。其余代码全部原创,MIT 协议,只用 Python 标准库加 tkinter。

![悬浮球](https://raw.githubusercontent.com/cobaltna/cot-peek/main/screenshots/ball.png)
11 changes: 11 additions & 0 deletions external_plugins/cot-peek/commands/start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
description: 启动或安装思考小窗,把英文思维链实时翻成中文
argument-hint: "[安装、启动或排障]"
skills: cot-peek
---

用 `cot-peek` skill 处理这个请求:

$ARGUMENTS

首次使用先运行插件根目录的 `install.ps1` 完成安装,再启动小球并告诉用户小球在屏幕右侧、点开展开窗口。
Loading