@covro/covro 0.1.1-dev.7 → 0.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,10 +31,8 @@
31
31
 
32
32
  - 📱 **Step away from your desk. Stay with the task.** Follow tool activity, inspect file changes, handle permission requests, and answer Codex's questions from your computer or phone. Closing the page doesn't cancel the task.
33
33
  - 🗂️ **See every project in one place.** Run independent tasks in parallel and spot which conversations are working, waiting for approval, or ready to read.
34
- - 💬 **Pick up your Codex CLI conversations.** Browse saved history, resume existing work, or fork a new direction. Rename conversations to find them later and archive them when you're done. View and copy the full Thread ID in conversation details or diagnostics.
35
- - ⚡ **Open long conversations sooner.** Recent messages appear first; scrolling preloads older history. On this device, cached conversation lists and history pages appear while the server checks for updates. [Loading and cache behavior](docs/session-history.md).
34
+ - 💬 **Pick up your Codex CLI conversations.** Browse saved history, resume existing work, or fork a new direction. Rename conversations to find them later and archive them when you're done.
36
35
  - 📖 **Review the work beside the conversation.** Read Markdown documents with code, tables, and images, or open JSON files in a desktop side panel while you keep talking to Codex. JSON previews include indentation, syntax highlighting, and original text for invalid JSON. Copy the unchanged source, with a full-screen reader on mobile. File previews are read-only; Markdown and JSON files have a 2 MiB limit.
37
- - 🔎 **Inspect code changes.** Open Codex’s saved patches for a turn or tool in the same read-only panel. Switch files, inspect line numbers, see the exact words changed within each line, and jump between change blocks.
38
36
  - ✍️ **Switch tasks without losing your draft.** Each conversation keeps its own draft, pasted images, and model settings in the current page. Copy or export results when you're done.
39
37
  - 🖥️ **Run a command beside your task.** Open **Shell** to execute commands in the selected project's directory, follow stdout/stderr, interrupt a run, and reuse recent commands. The panel uses Codex's configured sandbox, with a ten-minute limit and no interactive input. Closing it keeps the command running. [Capabilities and limits](docs/shell.md).
40
38
 
@@ -82,8 +80,6 @@ The npm package is `@covro/covro`; the command is `covro`. Install the developme
82
80
 
83
81
  The npm CLI uses `~/.covro/config.json` and a fixed data directory beside it. Reuse an existing configuration with `covro --config /absolute/path/config.json`.
84
82
 
85
- Open **Service configuration → Advanced settings** to edit size limits in MiB (1 MiB = 1024 × 1024 bytes). Decimal values must correspond to whole bytes; existing byte values are preserved exactly. JSON files and the API continue to use bytes. Saved changes take effect after restarting the service.
86
-
87
83
  <a id="run-from-source"></a>
88
84
 
89
85
  ### 🛠️ Run from source
@@ -148,7 +144,6 @@ Use the browser to follow work, review requests, and continue conversations. An
148
144
  ## Development and contribution
149
145
 
150
146
  ```sh
151
- pnpm format:check
152
147
  pnpm typecheck
153
148
  pnpm lint
154
149
  pnpm test
@@ -158,10 +153,6 @@ pnpm test:e2e
158
153
 
159
154
  Browser tests require the Chromium version used by the existing Playwright dependency. Tests and CI use explicit fixtures; they do not send real model requests.
160
155
 
161
- CI requires Prettier formatting to pass. Run `pnpm format` to fix formatting locally; see [formatting conventions](docs/contributing.md#格式检查) for generated-file exclusions.
162
-
163
- PR titles must follow Conventional Commits, for example `feat(ui): add JSON preview` or `fix: preserve scroll position`. See [PR checks and squash merge conventions](docs/contributing.md) for supported types, Release PRs, and release behavior.
164
-
165
156
  Found a problem or have an idea? [Open an issue](https://github.com/yuzheng14/codex-web-ui/issues). Include your OS, Node.js and Codex versions, installation method, and steps to reproduce. Small, focused PRs are welcome. Update both `README.md` and `README.zh-CN.md` when changing user-facing facts or setup instructions.
166
157
 
167
158
  <a id="documentation"></a>
package/README.zh-CN.md CHANGED
@@ -31,10 +31,8 @@
31
31
 
32
32
  - 📱 **离开电脑,也能跟进任务。** 在电脑或手机上查看工具活动与文件变更、处理权限审批、回答 Codex 的问题。关闭页面,任务仍会继续。
33
33
  - 🗂️ **多个项目,一眼掌握进展。** 让独立任务并行执行,随时看到哪些会话正在工作、等待审批,哪些已有结果可读。
34
- - 💬 **接着你的 Codex CLI 会话。** 浏览已有历史、恢复工作,或 Fork 一个新方向;为会话命名以便查找,完成后归档。在会话详情或状态诊断中查看、复制完整 Thread ID。
35
- - ⚡ **更快打开长会话。** 优先显示最近消息,向上滚动时提前加载历史;本机会话列表和历史分片可先显示缓存,再由服务端核对更新。[加载与缓存说明](docs/session-history.md)。
34
+ - 💬 **接着你的 Codex CLI 会话。** 浏览已有历史、恢复工作,或 Fork 一个新方向;为会话命名以便查找,完成后归档。
36
35
  - 📖 **一边看产出,一边继续讨论。** 电脑上将 Markdown 文档、JSON 文件与会话并排打开,继续向 Codex 提问;Markdown 支持代码、表格与图片,JSON 支持格式化缩进、语法高亮,格式无效时保留原文,可复制完整原文,手机上也有全屏阅读器。文件预览保持只读,Markdown 和 JSON 文件限制为 2 MiB。
37
- - 🔎 **逐行查看代码变更。** 在同一只读预览窗口查看某轮或某工具的 Codex 补丁快照,支持切换文件、查看行号、突出显示行内变化的文字和跳转变更区块。
38
36
  - ✍️ **切换任务,草稿还在。** 每个会话分别保留当前页面中的草稿、粘贴图片和模型设置;完成后可以复制或导出结果。
39
37
  - 🖥️ **在任务旁运行命令。** 打开 **Shell**,在所选项目目录执行命令、查看实时标准输出和错误输出、中断执行,并复用近期命令。面板沿用 Codex 配置的沙箱,最长运行十分钟,不支持交互输入;关闭面板后命令仍继续运行。[能力与限制](docs/shell.md)。
40
38
 
@@ -82,8 +80,6 @@ npm 包名为 `@covro/covro`,命令为 `covro`。开发渠道使用 `npm insta
82
80
 
83
81
  npm CLI 默认使用 `~/.covro/config.json`,数据目录固定在配置文件旁。可以通过 `covro --config /absolute/path/config.json` 沿用已有配置。
84
82
 
85
- 在**服务配置 → 高级设置**中,以 MiB 编辑大小限制(1 MiB = 1024 × 1024 字节)。小数必须精确对应整数字节;已有字节值会原样保留。JSON 文件和 API 继续使用字节,保存后需重启服务生效。
86
-
87
83
  <a id="从源码运行"></a>
88
84
 
89
85
  ### 🛠️ 从源码运行
@@ -148,7 +144,6 @@ Covro 是面向单用户的 Codex CLI Web UI,通过 `codex app-server` 连接
148
144
  ## 开发与参与
149
145
 
150
146
  ```sh
151
- pnpm format:check
152
147
  pnpm typecheck
153
148
  pnpm lint
154
149
  pnpm test
@@ -158,10 +153,6 @@ pnpm test:e2e
158
153
 
159
154
  浏览器测试需要现有 Playwright 依赖所对应的 Chromium。测试与 CI 使用明确的测试夹具,不发起真实模型请求。
160
155
 
161
- CI 要求通过 Prettier 格式检查。可在本地运行 `pnpm format` 修复格式,生成文件的排除范围见[格式检查约定](docs/contributing.md#格式检查)。
162
-
163
- PR 标题须符合 Conventional Commits,例如 `feat(ui): add JSON preview` 或 `fix: preserve scroll position`。支持的 type、Release PR 检查及 squash 合并与发版约定见[开发与 PR 约定](docs/contributing.md)。
164
-
165
156
  遇到问题或有想法,欢迎[提交 Issue](https://github.com/yuzheng14/codex-web-ui/issues),附上操作系统、Node.js 与 Codex 版本、安装方式和复现步骤。也欢迎范围明确的小 PR。修改面向使用者的事实或安装步骤时,请同步更新 `README.md` 和 `README.zh-CN.md`。
166
157
 
167
158
  <a id="文档导航"></a>
@@ -536,73 +536,6 @@ class CodexAdapter {
536
536
  const sequence = ++this.archiveSequence;
537
537
  return this.storedThread(await this.readThreadHeader(id), sequence);
538
538
  }
539
- async readThreadPage(id, continuation) {
540
- const epoch = this.epoch;
541
- let cursor = null;
542
- if (continuation) {
543
- try {
544
- const decoded = JSON.parse(Buffer.from(continuation, "base64url").toString("utf8"));
545
- if (decoded.threadId !== id || decoded.epoch !== epoch || typeof decoded.cursor !== "string")
546
- throw new Error("Invalid cursor");
547
- cursor = decoded.cursor;
548
- } catch {
549
- throw new AppError("HISTORY_CURSOR_EXPIRED", "\u5386\u53F2\u5206\u9875\u5DF2\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u540C\u6B65\u4F1A\u8BDD\u3002", 409);
550
- }
551
- }
552
- const sequence = ++this.archiveSequence;
553
- const header = await this.readThreadHeader(id);
554
- if (header.historyMode !== "paginated") return this.readThread(id);
555
- const page = await this.call("thread/turns/list", {
556
- threadId: id,
557
- cursor,
558
- limit: 12,
559
- sortDirection: "desc",
560
- itemsView: "summary"
561
- });
562
- if (page.nextCursor && page.nextCursor === cursor)
563
- throw new CodexError("PROTOCOL_INCOMPATIBLE", "Invalid turn pagination");
564
- await this.hydrateTurns(id, page.data);
565
- if (this.epoch !== epoch)
566
- throw new AppError("HISTORY_CURSOR_EXPIRED", "\u8BFB\u53D6\u671F\u95F4 Codex \u5DF2\u91CD\u542F\uFF0C\u8BF7\u91CD\u65B0\u540C\u6B65\u4F1A\u8BDD\u3002", 409);
567
- const view = await this.storedThread(
568
- { ...header, turns: page.data.slice().reverse() },
569
- sequence
570
- );
571
- return {
572
- ...view,
573
- history: {
574
- olderCursor: page.nextCursor ? Buffer.from(
575
- JSON.stringify({
576
- threadId: id,
577
- epoch,
578
- cursor: page.nextCursor
579
- })
580
- ).toString("base64url") : null
581
- }
582
- };
583
- }
584
- async hydrateTurns(id, turns) {
585
- for (const turn of turns) {
586
- if (turn.itemsView === "full") continue;
587
- let cursor = null;
588
- const seen = /* @__PURE__ */ new Set();
589
- turn.items = [];
590
- do {
591
- const page = await this.call("thread/items/list", {
592
- threadId: id,
593
- turnId: turn.id,
594
- cursor,
595
- limit: 20,
596
- sortDirection: "asc"
597
- });
598
- turn.items.push(...page.data.map((entry) => entry.item));
599
- cursor = page.nextCursor;
600
- if (cursor && (seen.has(cursor) || seen.size >= 1e3))
601
- throw new CodexError("PROTOCOL_INCOMPATIBLE", "Invalid item pagination");
602
- if (cursor) seen.add(cursor);
603
- } while (cursor);
604
- }
605
- }
606
539
  async readThread(id) {
607
540
  const sequence = ++this.archiveSequence;
608
541
  const thread = await this.readThreadHeader(id);
@@ -793,7 +726,7 @@ class CodexAdapter {
793
726
  throw error;
794
727
  }
795
728
  titles?.register(result);
796
- const view = await this.readThreadPage(result.thread.id);
729
+ const view = await this.readThread(result.thread.id);
797
730
  return { ...view, runtimeSettings: await this.responseRuntimeSettings(result) };
798
731
  }
799
732
  async forkThread(id, cwd, settings) {