codsh-cli 0.1.0 → 0.2.0
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 +14 -2
- package/README.zh.md +12 -1
- package/lib/index.js +1154 -251
- package/lib/types/console.d.ts +121 -33
- package/lib/types/keys.d.ts +20 -0
- package/lib/types/prompt.d.ts +15 -0
- package/lib/types/screen.d.ts +204 -0
- package/lib/types/selector.d.ts +0 -1
- package/lib/types/spinner.d.ts +7 -1
- package/lib/types/theme.d.ts +6 -5
- package/lib/types/transcript.d.ts +9 -9
- package/lib/types/wrap.d.ts +27 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
English | [中文](README.zh.md)
|
|
6
6
|
|
|
7
|
-
A
|
|
7
|
+
A terminal coding agent whose interaction design fuses the best of today's agent CLIs, composed on the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) plugin runtime. codsh is a dsh *bundle*: it ships the interactive TTY surface and a coding agent preset, and everything underneath — the agent loop, tools, sessions, sandboxing, model adapters — is the released dsh packages from npm.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -19,7 +19,9 @@ The first run registers this package into a dsh `code` profile under `$DSH_HOME`
|
|
|
19
19
|
|
|
20
20
|
## What you get
|
|
21
21
|
|
|
22
|
-
- **
|
|
22
|
+
- **A session that is its own space**: codsh takes the alternate screen, so your shell's scrollback is untouched and waiting when you leave. The transcript scrolls in a buffer the session owns — mouse wheel, PgUp/PgDn, Shift+↑/↓ — under an input box that never moves from the bottom; scrolled back, the viewport says how far and new output keeps accumulating without yanking you to it. Every frame paints as one synchronized update, and quitting drops a two-line summary (session id, spend, the `--resume` command) into your shell.
|
|
23
|
+
- **Select to copy**: drag with the mouse and the selection is on your clipboard the moment you release — highlighted in place, sent through OSC 52 and the platform clipboard both (`CODSH_CLIPBOARD=osc52|system|off` narrows it). Long finished blocks — thinking, tool output, and answers past a screenful — collapse to their head lines once you move on; Ctrl-O swaps every one of them between summary and full form.
|
|
24
|
+
- **An input box that owns the keyboard**: multi-line editing (Alt-Enter), history across sessions, and completion for commands, arguments, and `@`-mentioned files (fuzzy, workspace-wide), opened as you type.
|
|
23
25
|
- **Streaming rendering**: Markdown with code highlighting and table layout, reasoning models' thinking dim under `✻ thinking`, tool calls as presenter-driven cards with diffs, and Ctrl-O to reprint the last clipped output in full.
|
|
24
26
|
- **Decisions as selections**: approvals, questions, `/model`, and `/resume` are arrow-key widgets; plan mode toggles on Shift-Tab and tints the box frame.
|
|
25
27
|
- **Session flow**: `/clear` starts fresh in place, `/resume` picks from recorded sessions with titles and ages, Escape twice recalls your previous message for editing, and `!cmd` runs in your shell with the outcome injected as model-visible context — no turn spent.
|
|
@@ -60,6 +62,16 @@ Day to day, dsh is an ordinary npm dependency. To step into harness code, clone
|
|
|
60
62
|
|
|
61
63
|
and re-run `pnpm install`. Changes you want upstream go to the harness repo as ordinary PRs; this repository never forks it.
|
|
62
64
|
|
|
65
|
+
### Keeping up with dsh releases
|
|
66
|
+
|
|
67
|
+
codsh consumes the harness as published `@deepseek-ai/dsh-*` packages, so "syncing with dsh" means tracking harness **releases**, not merging source. Three layers keep it automatic:
|
|
68
|
+
|
|
69
|
+
1. **Detect** — [Renovate](renovate.json) watches `@deepseek-ai/dsh-*` (plus co-released cordis packages) and opens dependency PRs; a nightly [sync workflow](.github/workflows/sync-dsh.yml) does the same without third-party services.
|
|
70
|
+
2. **Bump** — `pnpm run sync:dsh` rewrites every `@deepseek-ai/dsh-*` range to the latest published release, refreshes the lockfile, writes a changeset, and exits `1` from `--check` when newer versions exist (that is what the nightly job keys on).
|
|
71
|
+
3. **Prove** — the same command re-verifies `cordis.patch.yml`: every plugin id it disables or configures must still be declared by an installed dsh bundle, and every package it inserts must resolve. Then it runs typecheck/build/unit (add `--e2e` to boot the real patched bundle), and CI repeats all of that on the resulting PR.
|
|
72
|
+
|
|
73
|
+
Because every dsh package is a prerelease (`0.1.0-rc.N`), plain semver ranges do **not** float across releases — the sync command is the source of truth, not `pnpm update`.
|
|
74
|
+
|
|
63
75
|
## License
|
|
64
76
|
|
|
65
77
|
MIT
|
package/README.zh.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[English](README.md) | 中文
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
一款汲取了当今主流 agent CLI 交互体验精髓的终端编码 agent,组合在 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)插件运行时之上。codsh 是一个 dsh *bundle*:它携带交互式 TTY 界面与编码 agent preset,其下的一切——agent 循环、工具、会话、沙箱、模型适配器——都是 npm 上已发布的 dsh 包。
|
|
8
8
|
|
|
9
9
|
## 安装
|
|
10
10
|
|
|
@@ -19,6 +19,7 @@ codsh
|
|
|
19
19
|
|
|
20
20
|
## 你会得到什么
|
|
21
21
|
|
|
22
|
+
- **会话是自己的空间**:codsh 进入备用屏幕,你的 shell 滚回历史原封不动、退出即恢复。transcript 在会话自有的缓冲里滚动——鼠标滚轮、PgUp/PgDn、Shift+↑/↓——输入框钉在底部从不移动;向上翻阅时视口会标注离尾部多远,新输出继续累积而不把你拽回去。每一帧以同步更新原子绘制;退出时向 shell 留下两行摘要(会话 id、用量、`--resume` 命令)。
|
|
22
23
|
- **接管键盘的输入框**:多行编辑(Alt-Enter)、跨会话历史,命令、参数与 `@` 文件提及(全工作区模糊搜索)的补全随输入自动打开。
|
|
23
24
|
- **流式渲染**:Markdown 带代码高亮与表格排版,推理模型的思考在 `✻ thinking` 下暗色显示,工具调用按 presenter 驱动的卡片渲染(含 diff),Ctrl-O 完整重印最近被截断的输出。
|
|
24
25
|
- **决定用选择**:审批、提问、`/model` 与 `/resume` 都是方向键组件;Shift-Tab 切换 plan 模式并为框着色。
|
|
@@ -60,6 +61,16 @@ e2e 测试的是发布产物:`npm pack` 的输出装进真实 profile,由 np
|
|
|
60
61
|
|
|
61
62
|
再执行 `pnpm install`。想进上游的改动以普通 PR 提交到 harness 仓库;本仓库绝不 fork 它。
|
|
62
63
|
|
|
64
|
+
### 跟随 dsh 发布版本
|
|
65
|
+
|
|
66
|
+
codsh 消费的是已发布的 `@deepseek-ai/dsh-*` npm 包,所以"与 dsh 同步"跟踪的是 harness 的**发布**,不是合并源码。三层机制让这件事全自动:
|
|
67
|
+
|
|
68
|
+
1. **发现**——[Renovate](renovate.json) 盯着 `@deepseek-ai/dsh-*`(及同步发布的 cordis 包)自动开依赖 PR;[夜间 sync 工作流](.github/workflows/sync-dsh.yml) 不依赖第三方服务也能做同样的事。
|
|
69
|
+
2. **升级**——`pnpm run sync:dsh` 把所有 `@deepseek-ai/dsh-*` 范围改写到最新发布版、刷新锁文件、写 changeset;`--check` 模式在存在新版本时以退出码 1 报告(夜间任务就靠它判断)。
|
|
70
|
+
3. **验证**——同一命令重新核对 `cordis.patch.yml`:每个被禁用/配置的插件 id 必须仍被已安装的 dsh bundle 声明,每个 insert 的包必须可解析;然后跑 typecheck/build/单测(加 `--e2e` 会真正启动打补丁后的 bundle),CI 在生成的 PR 上再全部跑一遍。
|
|
71
|
+
|
|
72
|
+
因为所有 dsh 包都是预发布版本(`0.1.0-rc.N`),普通 semver 范围**不会**跨版本浮动——同步命令才是事实来源,`pnpm update` 不是。
|
|
73
|
+
|
|
63
74
|
## 许可
|
|
64
75
|
|
|
65
76
|
MIT
|