anti-trace 0.1.1 → 0.1.5
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/LICENSE +0 -1
- package/README.en.md +83 -109
- package/README.md +83 -108
- package/package.json +4 -2
package/LICENSE
CHANGED
package/README.en.md
CHANGED
|
@@ -1,155 +1,129 @@
|
|
|
1
1
|
# Anti-trace
|
|
2
2
|
|
|
3
|
-
[
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](https://www.npmjs.com/package/anti-trace)
|
|
5
|
+
[](https://github.com/sadgsk/Anti-trace/actions/workflows/ci.yml)
|
|
6
|
+
[](https://github.com/sadgsk/Anti-trace/actions/workflows/release.yml)
|
|
7
|
+
<br>
|
|
8
|
+
[Quick start](#quick-start) · [Documentation](#documentation) · [Issues](https://github.com/sadgsk/Anti-trace/issues) · [中文](README.md)
|
|
4
9
|
|
|
5
|
-
Anti-trace is an AI coding
|
|
10
|
+
Anti-trace is an AI coding assistant for your terminal. It reads and edits project files, runs builds and tests, and follows up on tool results. Connect a supported model provider with your own API key and review commands, output, and diffs in the terminal.
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
## Install
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
Requires Node.js 22 or newer.
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
+
```sh
|
|
17
|
+
npm install -g anti-trace
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`ati` and `anti-trace` launch the same CLI. Shell tools use Bash on macOS and Linux. On Windows, Anti-trace prefers PowerShell 7 and falls back to Windows PowerShell 5.1. Git for Windows also enables Git Bash. If Anti-trace cannot find a custom installation, set `ANTI_TRACE_GIT_BASH_PATH` to the absolute path of Git for Windows' `bin\bash.exe`.
|
|
16
21
|
|
|
17
22
|
## Quick start
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
1. Open a terminal in your project directory and launch Anti-trace.
|
|
20
25
|
|
|
21
|
-
```sh
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
+
```sh
|
|
27
|
+
cd your-project
|
|
28
|
+
ati
|
|
29
|
+
```
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
2. Enter `/config` and choose **Add configuration**. Fill in the configuration file name, provider API URL, API key, model ID, and API protocol. Set the context window for your model and optionally set an output limit. Choose **Save and use configuration** or press `Ctrl+S`.
|
|
32
|
+
3. Enter your first task.
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
```text
|
|
35
|
+
Find this project's entry points and test commands, and explain how its main modules fit together.
|
|
36
|
+
```
|
|
32
37
|
|
|
33
|
-
|
|
38
|
+
Once a model is configured, you can also pipe in a single prompt. The CLI reads standard input as one message, processes it, and exits. Pipe mode blocks tools that require interactive approval.
|
|
34
39
|
|
|
35
40
|
```sh
|
|
36
|
-
|
|
41
|
+
echo "Explain the entry points in this project." | ati
|
|
37
42
|
```
|
|
38
43
|
|
|
39
|
-
|
|
44
|
+
## Key features
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
- **File and shell tools.** Read, create, and edit files. Use the shell to search the project, build, and run tests. Shell commands default to a 120-second timeout. Long output is shortened in the transcript, with the full output saved for later reads.
|
|
47
|
+
- **Terminal UI.** Stream responses with Markdown, syntax highlighting, tables, tool cards, and diffs. Type `/` to open the command menu or `@` to find and complete workspace file paths. Edit multiline drafts with undo and redo, and switch between English and Chinese with `/language`.
|
|
48
|
+
- **Image input.** Paste a path to an image file or use `Alt+V` (Windows) or `Ctrl+V` (macOS and Linux) to try reading an image from the clipboard. Supported formats include PNG, JPEG, GIF, and WebP. Clipboard support depends on the terminal and system tools, and the selected model must accept images.
|
|
49
|
+
- **Sessions and context.** Save conversations and attachments per project and continue with `/resume`. The status line shows context usage. Anti-trace can compact older messages automatically, and `/compact` lets you request compaction manually.
|
|
45
50
|
|
|
46
|
-
|
|
51
|
+
## Permissions and approvals
|
|
47
52
|
|
|
48
|
-
|
|
53
|
+
Reads are allowed by default. Writes, edits, and shell commands prompt for approval. You can approve once, allow for the current session, or deny with feedback. File changes can be previewed as diffs before approval. A session approval for file changes covers subsequent file writes and edits, while a shell approval applies to the same command in the same tool.
|
|
49
54
|
|
|
50
|
-
|
|
55
|
+
| Mode | Behavior |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| Default | Ask before writes, edits, and shell commands |
|
|
58
|
+
| `auto-edit` | Allow writes and edits automatically and ask before shell commands |
|
|
59
|
+
| `yolo` | Allow all tool calls automatically |
|
|
51
60
|
|
|
52
|
-
|
|
53
|
-
Explain this project's entry points and main modules.
|
|
54
|
-
Fix this function's handling of empty input and add a test.
|
|
55
|
-
Run the build, investigate the errors, and update the relevant code.
|
|
56
|
-
```
|
|
61
|
+
Press `Shift+Tab` to cycle through modes, or launch with `ati --auto-edit` or `ati --yolo`. Tools run with the current user's system permissions.
|
|
57
62
|
|
|
58
|
-
|
|
63
|
+
## Model configuration
|
|
59
64
|
|
|
60
|
-
|
|
65
|
+
Use `/config` to create, select, and edit configuration files. Each file can define multiple models, which you can switch between with `/model`. Anti-trace supports these APIs.
|
|
61
66
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
| API | Configuration value |
|
|
65
|
-
|---|---|
|
|
67
|
+
| API | JSON `api` value |
|
|
68
|
+
| --- | --- |
|
|
66
69
|
| OpenAI Chat Completions | `openai-completions` |
|
|
67
70
|
| OpenAI Responses | `openai-responses` |
|
|
68
71
|
| Anthropic Messages | `anthropic-messages` |
|
|
69
72
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
The user data root defaults to `~/.anti-trace`; override it with `ANTI_TRACE_HOME`. Model configurations and `/config` creations use `profiles/local/configs/`. The `local` profile is the current local user; the code accepts a `profileId` for future user separation without implementing login.
|
|
73
|
-
|
|
74
|
-
Startup selects an explicit `CLI_AGENT_CONFIG`, the project's last selection, the user's default selection, or the sole valid configuration, in that order. Multiple configurations without a saved selection require `/config`. Explicit configuration/model choices update the user default; reopening a project does not overwrite that default with its project selection. Missing saved paths warn and fall back; invalid explicit paths fail. Workspace `byok.json`, `.env` and old storage directories are not automatically read.
|
|
73
|
+
You can also copy the [example configuration](byok.example.json) to `~/.anti-trace/profiles/local/configs/main.json`. Replace the example URL, key, and model ID, then set `contextWindow` and optionally `maxOutputTokens` for your model. Each entry in `models` references a connection in `connections`, and `currentModel` is the key of the selected model entry.
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
├── configs/ # Model connection configuration
|
|
81
|
-
├── default-model.json # Default selection for new projects
|
|
82
|
-
└── projects/<SHA-256 of workspace>/
|
|
83
|
-
├── project.json # Workspace path
|
|
84
|
-
├── last-model.json # Project model/config selection
|
|
85
|
-
├── sessions/ # Conversations and image attachments
|
|
86
|
-
└── tool-results/ # Complete tool output
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Selection files contain only configuration paths and model keys. Conversations and tool output are separated by workspace and profile, while language is shared on this machine. File operations and shells keep the startup cwd. Image conversion uses the system temporary directory. Old conversations are not migrated; existing files remain untouched.
|
|
90
|
-
|
|
91
|
-
Anthropic Messages defaults to `32000` when `maxOutputTokens` is omitted, capped at the configured `contextWindow` if it is smaller. An explicit output limit takes precedence.
|
|
92
|
-
|
|
93
|
-
Include any required version prefix in `baseUrl`, such as `/v1`. Alternatively, select connection presets and models from the [provider configuration example](byok.providers.example.json), then set the corresponding API key environment variables. The example includes 36 connection options across nine providers, with explicit rules for supported protocols, regions, and models.
|
|
75
|
+
- Set either `apiKey` or `apiKeyEnv` for each connection. `apiKeyEnv` refers to an environment variable available to the CLI process. You can also use a connection from the [provider presets example](byok.providers.example.json).
|
|
76
|
+
- Set `baseUrl` to the API root, including any required version prefix such as `/v1`. Put a full inference URL in `endpoint` when needed.
|
|
77
|
+
- Startup checks `CLI_AGENT_CONFIG`, the project's last selection, the user's default selection, and the sole valid configuration in the config directory, in that order. When several valid configurations are available on first launch, choose one with `/config`.
|
|
78
|
+
- Local data lives in `~/.anti-trace` by default. Override it with `ANTI_TRACE_HOME`. Model configurations are stored in `profiles/local/configs/`. Conversations, attachments, and long tool output are grouped by working directory under `profiles/local/projects/`.
|
|
94
79
|
|
|
95
|
-
##
|
|
80
|
+
## Commands and shortcuts
|
|
96
81
|
|
|
97
|
-
Type `/` to
|
|
82
|
+
Type `/` and keep typing to filter the command menu. Use the arrow keys to select, `Enter` to confirm, `Tab` to complete, and `Esc` to close.
|
|
98
83
|
|
|
99
84
|
| Command | Purpose |
|
|
100
|
-
|
|
101
|
-
| `/help` | Show
|
|
102
|
-
| `/new` | Start a
|
|
103
|
-
| `/
|
|
104
|
-
| `/model` | Select
|
|
105
|
-
| `/
|
|
106
|
-
| `/
|
|
107
|
-
| `/
|
|
108
|
-
| `/
|
|
109
|
-
| `/
|
|
110
|
-
| `/language` | Switch
|
|
111
|
-
| `/context [positive integer]` | View or adjust the context window |
|
|
112
|
-
| `/compact` | Attempt manual context compaction |
|
|
85
|
+
| --- | --- |
|
|
86
|
+
| `/help` | Show commands and shortcuts |
|
|
87
|
+
| `/new` / `/resume` | Start a session or resume one for the current project |
|
|
88
|
+
| `/config [path]` | Manage configurations or load a specific JSON file |
|
|
89
|
+
| `/model [model key]` | Select a model from the current configuration |
|
|
90
|
+
| `/reload` | Reload the current configuration |
|
|
91
|
+
| `/thinking [on\|off\|default]` | Enable reasoning, disable it, or use the provider default |
|
|
92
|
+
| `/effort` | Select `low`, `medium`, `high`, `xhigh`, or `max`. The effect depends on the model and API |
|
|
93
|
+
| `/thinking-display [on\|off]` | Choose whether reasoning text starts expanded |
|
|
94
|
+
| `/context [positive integer]` / `/compact` | Inspect or adjust the context window, or request compaction |
|
|
95
|
+
| `/language [zh\|en]` | Switch and remember the interface language |
|
|
113
96
|
| `/exit` | Exit |
|
|
114
97
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Enter
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
98
|
+
| Shortcut | Action |
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| `Enter` / `Shift+Enter` or `Alt+Enter` | Submit / insert a newline |
|
|
101
|
+
| `Ctrl+Z` / `Ctrl+Y` or `Ctrl+Shift+Z` | Undo / redo draft changes |
|
|
102
|
+
| `Ctrl+C` | Interrupt generation or clear the draft. Exit when idle with an empty draft |
|
|
103
|
+
| `Ctrl+O` | Expand or collapse tool output and reasoning text |
|
|
104
|
+
| Scroll wheel or `PgUp` / `PgDn` / `Ctrl+End` | Browse history / return to the latest output |
|
|
122
105
|
|
|
123
|
-
|
|
106
|
+
Shortcut support depends on the terminal.
|
|
124
107
|
|
|
125
|
-
|
|
108
|
+
## Development
|
|
126
109
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
- [ ] Fix remaining issues with tool pairing and context-overflow error display.
|
|
134
|
-
|
|
135
|
-
## Known limitations
|
|
136
|
-
|
|
137
|
-
- Windows requires a working PowerShell or Git Bash installation. Without Git Bash, only PowerShell is exposed. An invalid explicit Bash path produces a configuration error. See [future-issues.md](docs/future-issues.md).
|
|
138
|
-
- Premature display of recoverable context-overflow errors still needs work. Interrupted tool-batch pairing was fixed in the TUI implementation; see the [review records](docs/review-records.md).
|
|
139
|
-
- Local HTTP SSE and macOS POSIX PTY verification records exist. Coverage of real models, clipboards, and other terminal platforms remains incomplete.
|
|
140
|
-
- Formal tests live in `tests/`. Run `npm test` for offline tests or `npm run check` for type checks, tests and a build. See the [testing guide](docs/testing.md) for commands, coverage and the three-platform CI matrix. Real-model checks have a separate explicit entry point.
|
|
110
|
+
```sh
|
|
111
|
+
git clone https://github.com/sadgsk/Anti-trace.git
|
|
112
|
+
cd Anti-trace
|
|
113
|
+
npm ci
|
|
114
|
+
npm start
|
|
115
|
+
```
|
|
141
116
|
|
|
142
|
-
|
|
117
|
+
`npm test` runs the offline tests. `npm run check` runs type checks, tests, and a build. Branch pushes and pull requests trigger GitHub Actions CI on Windows, macOS, and Linux with Node.js 22 and 24.
|
|
143
118
|
|
|
144
|
-
|
|
119
|
+
Pushing a `vX.Y.Z` version tag triggers the npm release workflow. It checks that the tag matches the package version and that the commit is in `main`, then publishes after CI and package installation checks pass.
|
|
145
120
|
|
|
146
|
-
|
|
147
|
-
- [Architecture](docs/architecture.md): module responsibilities and design.
|
|
148
|
-
- [Testing and CI](docs/testing.md): commands, test authoring, isolation, coverage and the CI matrix (Chinese).
|
|
149
|
-
- [npm releases](docs/releases.md): connect npm to GitHub and publish stable releases using version tags (Chinese).
|
|
121
|
+
## Documentation
|
|
150
122
|
|
|
151
|
-
|
|
123
|
+
- [Testing and CI](docs/testing.md)
|
|
124
|
+
- [npm release process](docs/releases.md)
|
|
125
|
+
- [Architecture and implementation notes](docs/architecture.md)
|
|
152
126
|
|
|
153
127
|
## License
|
|
154
128
|
|
|
155
|
-
[MIT](LICENSE).
|
|
129
|
+
[MIT](LICENSE).
|
package/README.md
CHANGED
|
@@ -1,154 +1,129 @@
|
|
|
1
1
|
# Anti-trace
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](https://www.npmjs.com/package/anti-trace)
|
|
5
|
+
[](https://github.com/sadgsk/Anti-trace/actions/workflows/ci.yml)
|
|
6
|
+
[](https://github.com/sadgsk/Anti-trace/actions/workflows/release.yml)
|
|
7
|
+
<br>
|
|
8
|
+
[快速开始](#快速开始) · [文档](#文档) · [Issues](https://github.com/sadgsk/Anti-trace/issues) · [English](README.en.md)
|
|
4
9
|
|
|
5
|
-
Anti-trace 是一个运行在终端里的 AI
|
|
10
|
+
Anti-trace 是一个运行在终端里的 AI 编程助手。它能读取和修改项目文件、运行构建与测试,并根据工具返回的结果继续排查。你可以用自己的 API 密钥接入支持的模型服务,在终端查看命令、输出和文件差异。
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
## 安装
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
需要 Node.js 22 或更新版本。
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
+
```sh
|
|
17
|
+
npm install -g anti-trace
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`ati` 和 `anti-trace` 是等价的启动命令。macOS 和 Linux 的命令工具使用 Bash。Windows 优先使用 PowerShell 7,找不到时使用 Windows PowerShell 5.1。安装 Git for Windows 后也可使用 Git Bash,若安装路径未被识别,可将 `ANTI_TRACE_GIT_BASH_PATH` 设为 Git for Windows 中 `bin\bash.exe` 的绝对路径。
|
|
16
21
|
|
|
17
22
|
## 快速开始
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
1. 在终端进入你的项目目录,启动 Anti-trace。
|
|
20
25
|
|
|
21
|
-
```sh
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
+
```sh
|
|
27
|
+
cd your-project
|
|
28
|
+
ati
|
|
29
|
+
```
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
2. 输入 `/config`,选择「新增配置文件」。填写配置文件名、服务商的 API URL、API Key、模型 ID 和接口协议。按模型规格设置上下文窗口,可按需填写最大输出。选择「保存并使用此配置」或按 `Ctrl+S`。
|
|
32
|
+
3. 输入你的第一个任务。
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
```text
|
|
35
|
+
找到这个项目的入口和测试命令,解释主要模块之间是怎么配合的。
|
|
36
|
+
```
|
|
32
37
|
|
|
33
|
-
|
|
38
|
+
已配置模型后,也可以通过管道提交一条提示词。CLI 会读取完整的标准输入,执行一次并退出。管道模式会阻止需要交互审批的工具调用。
|
|
34
39
|
|
|
35
40
|
```sh
|
|
36
|
-
|
|
41
|
+
echo "Explain the entry points in this project." | ati
|
|
37
42
|
```
|
|
38
43
|
|
|
39
|
-
|
|
44
|
+
## 主要功能
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
- **读写代码与执行命令。** 读取、创建和编辑文件,通过 Shell 搜索项目、运行构建与测试。Shell 命令默认超时为 120 秒,过长的输出会截取展示,并保存完整内容供后续读取。
|
|
47
|
+
- **终端交互。** 流式展示模型回复,支持 Markdown、代码高亮、表格、工具卡片和文件差异。输入 `/` 打开命令菜单,输入 `@` 搜索并补全工作区文件。可编辑多行草稿、撤销和重做,也可用 `/language` 切换中英文界面。
|
|
48
|
+
- **图片输入。** 粘贴图片文件路径,或用 `Alt+V`(Windows)和 `Ctrl+V`(macOS/Linux)尝试读取剪贴板图片。支持 PNG、JPEG、GIF 和 WebP,剪贴板读取取决于终端和系统工具,所选模型也须支持图片输入。
|
|
49
|
+
- **会话与上下文。** 按项目保存对话和图片附件,用 `/resume` 继续之前的会话。状态栏显示上下文用量,长会话可自动压缩旧内容,也可用 `/compact` 手动尝试压缩。
|
|
45
50
|
|
|
46
|
-
|
|
51
|
+
## 权限与审批
|
|
47
52
|
|
|
48
|
-
|
|
53
|
+
默认允许读取文件。写入、编辑和 Shell 命令会弹出审批,可以允许一次、在本会话内授权,或拒绝并给出修改意见。审批时可预览待写入的文件差异。会话授权对文件修改类操作生效,Shell 授权仅匹配同一工具中的相同命令。
|
|
49
54
|
|
|
50
|
-
|
|
55
|
+
| 模式 | 行为 |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| 默认 | 审批写入、编辑和 Shell 命令 |
|
|
58
|
+
| `auto-edit` | 自动允许写入和编辑,Shell 命令仍需审批 |
|
|
59
|
+
| `yolo` | 自动允许所有工具调用 |
|
|
51
60
|
|
|
52
|
-
|
|
53
|
-
梳理这个项目的入口和主要模块。
|
|
54
|
-
修复这个函数对空输入的处理,并补上对应测试。
|
|
55
|
-
运行构建,分析报错并修改相关代码。
|
|
56
|
-
```
|
|
61
|
+
按 `Shift+Tab` 切换模式,也可用 `ati --auto-edit` 或 `ati --yolo` 指定启动模式。工具使用当前用户的系统权限执行。
|
|
57
62
|
|
|
58
|
-
|
|
63
|
+
## 模型配置
|
|
59
64
|
|
|
60
|
-
|
|
65
|
+
可通过 `/config` 新增、选择和编辑配置文件。一个配置可以包含多个模型,用 `/model` 切换。支持以下接口。
|
|
61
66
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
| 接口 | 配置中的 api |
|
|
65
|
-
|---|---|
|
|
67
|
+
| 接口 | JSON 中的 `api` |
|
|
68
|
+
| --- | --- |
|
|
66
69
|
| OpenAI Chat Completions | `openai-completions` |
|
|
67
70
|
| OpenAI Responses | `openai-responses` |
|
|
68
71
|
| Anthropic Messages | `anthropic-messages` |
|
|
69
72
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
CLI 使用统一的用户数据目录,默认是 `~/.anti-trace`,可通过 `ANTI_TRACE_HOME` 覆盖。模型配置保存在 `profiles/local/configs/`,`/config` 新建的文件也写入这里。`local` 是当前本地用户空间;代码通过 `profileId` 预留未来的用户隔离能力,当前没有登录功能。
|
|
73
|
+
也可将 [配置示例](byok.example.json) 复制到 `~/.anti-trace/profiles/local/configs/main.json`,替换示例地址、密钥和模型 ID,再按模型规格设置 `contextWindow` 和可选的 `maxOutputTokens`。`models` 中的每个模型通过 `connection` 引用 `connections` 中的连接,`currentModel` 填写要使用的模型配置键。
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
- 每个连接填写 `apiKey` 或 `apiKeyEnv` 二者之一。`apiKeyEnv` 引用启动 CLI 的进程环境变量。也可从 [服务商预设示例](byok.providers.example.json) 选取连接。
|
|
76
|
+
- `baseUrl` 填写服务的 API 基址,包含所需的版本前缀(如 `/v1`)。如需指定完整推理地址,将其填入 `endpoint`。
|
|
77
|
+
- 启动时依次尝试 `CLI_AGENT_CONFIG` 指定的配置、当前项目上次选择、用户默认选择、配置目录中唯一有效的配置。首次遇到多个有效配置时,可用 `/config` 选择。
|
|
78
|
+
- 本地数据目录默认为 `~/.anti-trace`,可用 `ANTI_TRACE_HOME` 覆盖。模型配置位于 `profiles/local/configs/`,会话、附件和长工具输出按工作目录归档到 `profiles/local/projects/`。
|
|
75
79
|
|
|
76
|
-
|
|
77
|
-
~/.anti-trace/
|
|
78
|
-
├── preferences.json # 全局语言偏好
|
|
79
|
-
└── profiles/local/
|
|
80
|
-
├── configs/ # 模型连接配置
|
|
81
|
-
├── default-model.json # 新项目的默认配置与模型
|
|
82
|
-
└── projects/<工作目录的 SHA-256>/
|
|
83
|
-
├── project.json # 实际工作路径
|
|
84
|
-
├── last-model.json # 当前项目的配置与模型选择
|
|
85
|
-
├── sessions/ # 会话及图片附件
|
|
86
|
-
└── tool-results/ # 完整工具输出
|
|
87
|
-
```
|
|
80
|
+
## 命令与快捷键
|
|
88
81
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Anthropic Messages 未填写 `maxOutputTokens` 时默认使用 `32000`;若配置的 `contextWindow` 更小,默认输出上限会降到窗口大小。显式填写的输出上限优先。
|
|
92
|
-
|
|
93
|
-
`baseUrl` 应包含服务所需的版本前缀,例如 `/v1`。也可从 [厂商配置示例](byok.providers.example.json) 选取连接预设与模型,设置对应的环境变量密钥。示例覆盖九家厂商的 36 个连接选项;各协议、地区和模型的参数按明确规则适配。
|
|
94
|
-
|
|
95
|
-
## 常用命令
|
|
96
|
-
|
|
97
|
-
交互界面默认收起命令列表。输入 `/` 打开命令菜单,继续输入按名称筛选;↑↓ 选择,Enter 确认,Tab 仅补全,Esc 返回。模型、effort、思考及展示开关、会话恢复和配置管理使用二级界面,无需手输参数;原有显式参数仍兼容。输入框默认位于底部,滚轮和 PgUp/PgDn 回看历史,Ctrl+End 返回最新;Shift+拖动选中文本。
|
|
82
|
+
输入 `/` 后可继续输入以筛选命令,用方向键选择,按 `Enter` 确认、`Tab` 补全、`Esc` 关闭。
|
|
98
83
|
|
|
99
84
|
| 命令 | 用途 |
|
|
100
|
-
|
|
101
|
-
| `/help` |
|
|
102
|
-
| `/new` |
|
|
103
|
-
| `/
|
|
104
|
-
| `/model` |
|
|
105
|
-
| `/
|
|
106
|
-
| `/
|
|
107
|
-
| `/
|
|
108
|
-
| `/
|
|
109
|
-
| `/
|
|
110
|
-
| `/language` |
|
|
111
|
-
| `/context [正整数]` | 查看或调整上下文窗口 |
|
|
112
|
-
| `/compact` | 尝试手动压缩上下文 |
|
|
85
|
+
| --- | --- |
|
|
86
|
+
| `/help` | 查看命令和快捷键 |
|
|
87
|
+
| `/new` / `/resume` | 开始新会话或恢复当前项目的已有会话 |
|
|
88
|
+
| `/config [路径]` | 管理配置,或直接加载指定 JSON 文件 |
|
|
89
|
+
| `/model [模型键]` | 从当前配置中选择模型 |
|
|
90
|
+
| `/reload` | 重新读取当前配置 |
|
|
91
|
+
| `/thinking [on\|off\|default]` | 开启、关闭模型思考,或使用服务商默认值 |
|
|
92
|
+
| `/effort` | 选择思考档位,支持 `low`、`medium`、`high`、`xhigh`、`max`,实际效果取决于模型与接口 |
|
|
93
|
+
| `/thinking-display [on\|off]` | 设置思考文本是否默认展开 |
|
|
94
|
+
| `/context [正整数]` / `/compact` | 查看或调整上下文窗口,或尝试压缩上下文 |
|
|
95
|
+
| `/language [zh\|en]` | 切换并记住界面语言 |
|
|
113
96
|
| `/exit` | 退出 |
|
|
114
97
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Enter
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
98
|
+
| 快捷键 | 用途 |
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| `Enter` / `Shift+Enter` 或 `Alt+Enter` | 提交 / 换行 |
|
|
101
|
+
| `Ctrl+Z` / `Ctrl+Y` 或 `Ctrl+Shift+Z` | 撤销 / 重做草稿修改 |
|
|
102
|
+
| `Ctrl+C` | 中断生成或清空草稿,空闲且草稿为空时退出 |
|
|
103
|
+
| `Ctrl+O` | 展开或收起工具输出和思考文本 |
|
|
104
|
+
| 滚轮或 `PgUp` / `PgDn` / `Ctrl+End` | 回看对话 / 返回最新输出 |
|
|
122
105
|
|
|
123
|
-
|
|
106
|
+
快捷键能否被识别取决于终端。
|
|
124
107
|
|
|
125
|
-
|
|
108
|
+
## 开发
|
|
126
109
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
- [ ] 修复剩余的工具配对和上下文溢出提示问题。
|
|
134
|
-
|
|
135
|
-
## 已知限制
|
|
110
|
+
```sh
|
|
111
|
+
git clone https://github.com/sadgsk/Anti-trace.git
|
|
112
|
+
cd Anti-trace
|
|
113
|
+
npm ci
|
|
114
|
+
npm start
|
|
115
|
+
```
|
|
136
116
|
|
|
137
|
-
|
|
138
|
-
- 可恢复的上下文溢出错误提前显示问题仍待处理;工具批次中断配对已在 TUI 批次修复,见 [评审记录](docs/review-records.md)。
|
|
139
|
-
- 已有本地 HTTP SSE 和 macOS POSIX PTY 验证记录,真实模型、剪贴板和其他终端平台的覆盖仍不完整。
|
|
140
|
-
- 正式测试位于 `tests/`。运行 `npm test` 执行离线测试,`npm run check` 执行类型检查、测试和构建;命令、覆盖范围与三端 CI 见 [测试指南](docs/testing.md)。真实模型检查使用独立的显式入口。
|
|
117
|
+
`npm test` 运行离线测试,`npm run check` 运行类型检查、测试和构建。推送分支或提交 Pull Request 会触发 GitHub Actions,在 Windows、macOS 和 Linux 上用 Node.js 22 和 24 运行 CI。
|
|
141
118
|
|
|
142
|
-
|
|
119
|
+
推送 `vX.Y.Z` 格式的版本标签会触发 npm 发布流程。工作流确认标签版本与包版本一致、提交已进入 `main`,通过 CI 和安装检查后发布到 npm。
|
|
143
120
|
|
|
144
|
-
|
|
145
|
-
- [架构书](docs/architecture.md):模块职责与设计。
|
|
146
|
-
- [测试与 CI](docs/testing.md):本地命令、测试编写、隔离、覆盖率和三端 CI。
|
|
147
|
-
- [npm 自动发布](docs/releases.md):首次绑定 npm 与 GitHub,以及通过版本 tag 自动发布。
|
|
148
|
-
- [关键认知](docs/key-points.md):读码时形成的确定结论(工具字段位置、缓存前缀等),含原因与验证方式。
|
|
121
|
+
## 文档
|
|
149
122
|
|
|
150
|
-
|
|
123
|
+
- [测试与 CI](docs/testing.md)
|
|
124
|
+
- [npm 发布流程](docs/releases.md)
|
|
125
|
+
- [架构与实现说明](docs/architecture.md)
|
|
151
126
|
|
|
152
127
|
## 许可证
|
|
153
128
|
|
|
154
|
-
[MIT](LICENSE)
|
|
129
|
+
[MIT](LICENSE)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anti-trace",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Terminal AI coding agent with bring-your-own-key model support",
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"start": "tsx src/cli/main.ts",
|
|
32
32
|
"typecheck": "tsc --noEmit",
|
|
33
33
|
"build": "tsc",
|
|
34
|
-
"
|
|
34
|
+
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
35
|
+
"prepack": "npm run clean && npm run build",
|
|
35
36
|
"test": "node scripts/run-tests.mjs",
|
|
36
37
|
"test:unit": "node scripts/run-tests.mjs unit",
|
|
37
38
|
"test:integration": "node scripts/run-tests.mjs integration regressions",
|
|
@@ -59,6 +60,7 @@
|
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@types/node": "22.19.19",
|
|
61
62
|
"@types/react": "19.2.18",
|
|
63
|
+
"@xterm/headless": "6.0.0",
|
|
62
64
|
"c8": "12.0.0",
|
|
63
65
|
"tsx": "4.21.0",
|
|
64
66
|
"typescript": "5.9.3"
|