@kkelly-offical/kkcode 0.1.7 → 0.2.3-preview.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/LICENSE +674 -674
- package/README.md +474 -387
- package/package.json +50 -46
- package/src/agent/agent.mjs +228 -220
- package/src/agent/custom-agent-loader.mjs +6 -3
- package/src/agent/generator.mjs +2 -2
- package/src/agent/prompt/assistant.txt +12 -0
- package/src/agent/prompt/bug-hunter.txt +89 -89
- package/src/agent/prompt/frontend-designer.txt +58 -58
- package/src/agent/prompt/guide.txt +1 -1
- package/src/agent/prompt/longagent-blueprint-agent.txt +83 -83
- package/src/agent/prompt/longagent-coding-agent.txt +37 -37
- package/src/agent/prompt/longagent-debugging-agent.txt +46 -46
- package/src/agent/prompt/longagent-preview-agent.txt +63 -63
- package/src/command/custom-commands.mjs +2 -2
- package/src/commands/agent.mjs +1 -1
- package/src/commands/background.mjs +145 -4
- package/src/commands/chat.mjs +117 -76
- package/src/commands/config.mjs +148 -1
- package/src/commands/doctor.mjs +30 -6
- package/src/commands/init.mjs +32 -6
- package/src/commands/longagent.mjs +117 -0
- package/src/commands/mcp.mjs +275 -43
- package/src/commands/permission.mjs +1 -1
- package/src/commands/session.mjs +195 -140
- package/src/commands/skill.mjs +63 -0
- package/src/commands/theme.mjs +1 -1
- package/src/commands/update.mjs +32 -0
- package/src/config/defaults.mjs +289 -260
- package/src/config/import-config.mjs +1 -1
- package/src/config/load-config.mjs +61 -4
- package/src/config/schema.mjs +604 -574
- package/src/context.mjs +4 -1
- package/src/core/constants.mjs +97 -91
- package/src/core/types.mjs +1 -1
- package/src/github/api.mjs +78 -78
- package/src/github/auth.mjs +294 -286
- package/src/github/flow.mjs +298 -298
- package/src/github/workspace.mjs +225 -212
- package/src/index.mjs +87 -82
- package/src/knowledge/frontend-aesthetics.txt +38 -38
- package/src/mcp/client-http.mjs +139 -141
- package/src/mcp/client-sse.mjs +297 -288
- package/src/mcp/client-stdio.mjs +534 -533
- package/src/mcp/constants.mjs +4 -2
- package/src/mcp/registry.mjs +498 -479
- package/src/mcp/stdio-framing.mjs +135 -133
- package/src/mcp/tool-result.mjs +24 -24
- package/src/observability/edit-diagnostics.mjs +449 -0
- package/src/observability/index.mjs +42 -42
- package/src/observability/metrics.mjs +165 -137
- package/src/observability/tracer.mjs +137 -137
- package/src/onboarding.mjs +209 -0
- package/src/orchestration/background-manager.mjs +567 -372
- package/src/orchestration/background-worker.mjs +419 -305
- package/src/orchestration/interruption-reason.mjs +21 -0
- package/src/orchestration/longagent-manager.mjs +197 -171
- package/src/orchestration/stage-scheduler.mjs +733 -728
- package/src/orchestration/subagent-router.mjs +7 -1
- package/src/orchestration/task-scheduler.mjs +219 -7
- package/src/permission/engine.mjs +1 -1
- package/src/permission/exec-policy.mjs +370 -370
- package/src/permission/file-edit-policy.mjs +108 -0
- package/src/permission/prompt.mjs +1 -1
- package/src/permission/rules.mjs +116 -7
- package/src/plugin/builtin-hooks/post-edit-format.mjs +2 -1
- package/src/plugin/builtin-hooks/post-edit-typecheck.mjs +104 -40
- package/src/plugin/hook-bus.mjs +19 -5
- package/src/plugin/manifest-loader.mjs +222 -0
- package/src/provider/anthropic.mjs +396 -390
- package/src/provider/ollama.mjs +7 -1
- package/src/provider/openai.mjs +382 -340
- package/src/provider/retry-policy.mjs +74 -68
- package/src/provider/router.mjs +242 -241
- package/src/provider/sse.mjs +104 -104
- package/src/provider/wizard.mjs +556 -0
- package/src/repl/capability-facade.mjs +30 -0
- package/src/repl/command-surface.mjs +23 -0
- package/src/repl/controller-entry.mjs +40 -0
- package/src/repl/core-shell.mjs +208 -0
- package/src/repl/dialog-router.mjs +87 -0
- package/src/repl/input-engine.mjs +76 -0
- package/src/repl/keymap.mjs +7 -0
- package/src/repl/operator-surface.mjs +15 -0
- package/src/repl/permission-flow.mjs +49 -0
- package/src/repl/runtime-facade.mjs +36 -0
- package/src/repl/slash-router.mjs +62 -0
- package/src/repl/state-store.mjs +29 -0
- package/src/repl/turn-controller.mjs +58 -0
- package/src/repl/verification.mjs +23 -0
- package/src/repl.mjs +3371 -2981
- package/src/rules/load-rules.mjs +3 -3
- package/src/runtime.mjs +1 -1
- package/src/session/agent-transaction.mjs +86 -0
- package/src/session/checkpoint.mjs +302 -302
- package/src/session/compaction.mjs +298 -298
- package/src/session/engine.mjs +417 -232
- package/src/session/longagent-4stage.mjs +467 -460
- package/src/session/longagent-hybrid.mjs +1344 -1097
- package/src/session/longagent-plan.mjs +376 -365
- package/src/session/longagent-project-memory.mjs +53 -53
- package/src/session/longagent-scaffold.mjs +291 -291
- package/src/session/longagent-task-bus.mjs +138 -54
- package/src/session/longagent-utils.mjs +828 -472
- package/src/session/longagent.mjs +911 -900
- package/src/session/loop.mjs +1005 -930
- package/src/session/prompt/agent.txt +25 -25
- package/src/session/prompt/anthropic.txt +150 -150
- package/src/session/prompt/beast.txt +1 -1
- package/src/session/prompt/plan.txt +31 -31
- package/src/session/prompt/qwen.txt +46 -46
- package/src/session/recovery.mjs +21 -0
- package/src/session/rollback.mjs +196 -195
- package/src/session/routing-observability.mjs +72 -0
- package/src/session/runtime-state.mjs +47 -0
- package/src/session/store.mjs +523 -519
- package/src/session/system-prompt.mjs +308 -273
- package/src/session/task-validator.mjs +267 -267
- package/src/session/usability-gates.mjs +2 -2
- package/src/skill/builtin/commit.mjs +64 -64
- package/src/skill/builtin/design.mjs +76 -76
- package/src/skill/generator.mjs +18 -2
- package/src/skill/registry.mjs +642 -390
- package/src/storage/audit-store.mjs +18 -11
- package/src/storage/event-log.mjs +7 -1
- package/src/storage/ghost-commit-store.mjs +243 -245
- package/src/storage/paths.mjs +17 -0
- package/src/theme/default-theme.mjs +1 -1
- package/src/theme/markdown.mjs +4 -0
- package/src/theme/schema.mjs +1 -1
- package/src/theme/status-bar.mjs +162 -158
- package/src/tool/audit-wrapper.mjs +18 -2
- package/src/tool/edit-transaction.mjs +23 -0
- package/src/tool/executor.mjs +26 -1
- package/src/tool/file-read-state.mjs +65 -0
- package/src/tool/git-auto.mjs +526 -526
- package/src/tool/git-full-auto.mjs +487 -478
- package/src/tool/mutation-guard.mjs +54 -0
- package/src/tool/prompt/edit.txt +3 -3
- package/src/tool/prompt/multiedit.txt +1 -0
- package/src/tool/prompt/notebookedit.txt +2 -1
- package/src/tool/prompt/patch.txt +25 -24
- package/src/tool/prompt/read.txt +3 -3
- package/src/tool/prompt/sysinfo.txt +29 -0
- package/src/tool/prompt/task.txt +66 -4
- package/src/tool/prompt/write.txt +2 -2
- package/src/tool/question-prompt.mjs +99 -93
- package/src/tool/registry.mjs +1701 -1343
- package/src/tool/task-tool.mjs +14 -6
- package/src/ui/activity-renderer.mjs +667 -664
- package/src/ui/repl-background-panel.mjs +7 -0
- package/src/ui/repl-capability-panel.mjs +9 -0
- package/src/ui/repl-dashboard.mjs +54 -4
- package/src/ui/repl-help.mjs +110 -0
- package/src/ui/repl-operator-panel.mjs +12 -0
- package/src/ui/repl-route-feedback.mjs +35 -0
- package/src/ui/repl-status-view.mjs +76 -0
- package/src/ui/repl-task-panel.mjs +5 -0
- package/src/ui/repl-transcript-panel.mjs +56 -0
- package/src/ui/repl-turn-summary.mjs +135 -0
- package/src/update/checker.mjs +184 -0
- package/src/usage/pricing.mjs +122 -121
- package/src/usage/usage-meter.mjs +1 -0
- package/src/util/git.mjs +562 -519
- package/src/util/template.mjs +6 -1
- package/src/version.mjs +3 -0
package/README.md
CHANGED
|
@@ -1,387 +1,474 @@
|
|
|
1
|
-
# kkcode
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@kkelly-offical/kkcode)
|
|
4
|
-
](https://www.npmjs.com/package/@kkelly-offical/kkcode)
|
|
4
|
+
[](https://github.com/kkelly-offical/kkcode/releases)
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
**Terminal-first personal assistant with dedicated Coding Agent and LongAgent modes for governed execution and extensible local workflows.**
|
|
10
|
+
|
|
11
|
+
**终端优先、可治理、可扩展的个人助手,内置专门 Coding Agent 与 LongAgent 模式。**
|
|
12
|
+
kkcode 把问答、规划、事务型修改、多阶段长任务编排放在同一个 CLI 工作台里,并且把权限、预算、审计、后台任务、MCP、技能与插件一起纳入统一执行面。
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<a id="table-of-contents"></a>
|
|
17
|
+
## Table of Contents / 目录
|
|
18
|
+
|
|
19
|
+
- [Overview / 概览](#overview)
|
|
20
|
+
- [Why kkcode / 为什么选择 kkcode](#why-kkcode)
|
|
21
|
+
- [Installation / 安装](#installation)
|
|
22
|
+
- [Quick Start / 快速开始](#quick-start)
|
|
23
|
+
- [Capability Snapshot / 能力总览](#capability-snapshot)
|
|
24
|
+
- [Modes & LongAgent / 模式与 LongAgent](#modes-and-longagent)
|
|
25
|
+
- [Safety & Permissions / 权限与安全](#safety-and-permissions)
|
|
26
|
+
- [Delegation & Subagents / 委派与子智能体](#delegation-and-subagents)
|
|
27
|
+
- [Integrations / 集成](#integrations)
|
|
28
|
+
- [Extensions / 扩展机制](#extensions)
|
|
29
|
+
- [TUI & CLI Reference / TUI 与命令参考](#tui-and-cli-reference)
|
|
30
|
+
- [Configuration & Project Layout / 配置与项目结构](#configuration-and-project-layout)
|
|
31
|
+
- [Release Status / 发布状态](#release-status)
|
|
32
|
+
- [Compatibility, Limits & Roadmap / 兼容性、边界与路线图](#compatibility-limits-and-roadmap)
|
|
33
|
+
- [FAQ / 常见问题](#faq)
|
|
34
|
+
- [Contributing / 贡献](#contributing)
|
|
35
|
+
- [License / 许可证](#license)
|
|
36
|
+
- [Further Reading / 延伸阅读](#further-reading)
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
<a id="overview"></a>
|
|
41
|
+
## Overview / 概览
|
|
42
|
+
|
|
43
|
+
**English**
|
|
44
|
+
- kkcode is a terminal-native personal assistant designed for local work, governed execution, coding, and multi-stage delivery.
|
|
45
|
+
- It keeps four public lanes — `assistant`, `plan`, `agent`/`code`, and `longagent` — under one CLI surface.
|
|
46
|
+
- It is optimized for **CLI-first** and **LongAgent-first** workflows rather than GUI-first or marketplace-first product patterns.
|
|
47
|
+
|
|
48
|
+
**中文**
|
|
49
|
+
- kkcode 是一个面向终端原生工作流的个人助手,强调本地事务、可治理执行、编码和多阶段交付。
|
|
50
|
+
- 它把四条公开执行航道 —— `assistant`、`plan`、`agent`/`code`、`longagent` —— 收敛在同一个 CLI 入口下。
|
|
51
|
+
- 它优先服务 **CLI-first**、**LongAgent-first** 的工程工作流,而不是 GUI 优先或 marketplace 优先的平台形态。
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
<a id="why-kkcode"></a>
|
|
56
|
+
## Why kkcode / 为什么选择 kkcode
|
|
57
|
+
|
|
58
|
+
**English**
|
|
59
|
+
- **CLI-first**: core workflows stay in the terminal.
|
|
60
|
+
- **LongAgent-first**: large tasks are planned, staged, and verified instead of improvised in one prompt.
|
|
61
|
+
- **Governed execution**: permissions, budgets, audit logs, and recovery are built in.
|
|
62
|
+
- **Local extensibility**: MCP, skills, commands, hooks, tools, and custom agents can all be mounted locally.
|
|
63
|
+
|
|
64
|
+
**中文**
|
|
65
|
+
- **CLI-first**:核心工作流都在终端内完成。
|
|
66
|
+
- **LongAgent-first**:复杂任务先规划、分阶段、带门禁,而不是靠单轮 prompt 硬顶。
|
|
67
|
+
- **可治理执行**:权限、预算、审计、恢复、后台任务都是内建能力。
|
|
68
|
+
- **本地可扩展**:MCP、skills、commands、hooks、tools、custom agents 都能本地挂载。
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
<a id="installation"></a>
|
|
73
|
+
## Installation / 安装
|
|
74
|
+
|
|
75
|
+
**Requirements / 环境要求**
|
|
76
|
+
- Node.js `>=22`
|
|
77
|
+
- npm or pnpm
|
|
78
|
+
- A modern terminal on Windows, macOS, or Linux
|
|
79
|
+
|
|
80
|
+
**Install from npm / 通过 npm 安装**
|
|
81
|
+
```bash
|
|
82
|
+
npm install -g @kkelly-offical/kkcode
|
|
83
|
+
kkcode
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Run from source / 从源码运行**
|
|
87
|
+
```bash
|
|
88
|
+
git clone https://github.com/kkelly-offical/kkcode.git
|
|
89
|
+
cd kkcode
|
|
90
|
+
npm install
|
|
91
|
+
npm run start
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Useful links / 常用链接**
|
|
95
|
+
- [npm package](https://www.npmjs.com/package/@kkelly-offical/kkcode)
|
|
96
|
+
- [GitHub Releases](https://github.com/kkelly-offical/kkcode/releases)
|
|
97
|
+
- [Example config](docs/config.example.yaml)
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
<a id="quick-start"></a>
|
|
102
|
+
## Quick Start / 快速开始
|
|
103
|
+
|
|
104
|
+
**1. Launch / 启动**
|
|
105
|
+
```bash
|
|
106
|
+
kkcode
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**2. Initialize project config / 初始化项目配置**
|
|
110
|
+
```bash
|
|
111
|
+
kkcode init -y
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**3. Verify the install / 验证安装**
|
|
115
|
+
```bash
|
|
116
|
+
kkcode --help
|
|
117
|
+
kkcode doctor
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**First-run behavior / 首次启动行为**
|
|
121
|
+
- On first launch, kkcode runs onboarding and records your preferences.
|
|
122
|
+
- Use `/profile` to inspect or update personal preferences.
|
|
123
|
+
- Use `/like` to rerun onboarding.
|
|
124
|
+
|
|
125
|
+
**Configuration search order / 配置查找顺序**
|
|
126
|
+
- User-level: `~/.kkcode/config.yaml`
|
|
127
|
+
- Project-level: `./kkcode.config.yaml` or `./.kkcode/config.yaml`
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
<a id="capability-snapshot"></a>
|
|
132
|
+
## Capability Snapshot / 能力总览
|
|
133
|
+
|
|
134
|
+
| Area / 能力面 | Status / 状态 | Notes / 说明 |
|
|
135
|
+
| --- | --- | --- |
|
|
136
|
+
| Assistant / 个人助手 | Supported | Default CLI lane for terminal-native personal work, explanation, and code understanding |
|
|
137
|
+
| Plan / 方案规划 | Supported | Planning without mutating the repo |
|
|
138
|
+
| Agent / 默认事务航道 | Supported | Local inspect/patch/verify loops |
|
|
139
|
+
| LongAgent / 长程编排 | Supported | Multi-stage execution, retries, gates, resumable flow |
|
|
140
|
+
| Permissions / 权限治理 | Supported | Policy + approvals + session cache |
|
|
141
|
+
| Background tasks / 后台任务 | Supported | Launch, inspect, wait, retry, cancel |
|
|
142
|
+
| MCP / 模型上下文协议 | Supported | Local MCP discovery and registry |
|
|
143
|
+
| Skills / Commands / Hooks | Supported | Local-first extensibility surface |
|
|
144
|
+
| Plugins / 插件包 | MVP | Local plugin manifests and component toggles |
|
|
145
|
+
| GUI / IDE / desktop automation | Not promised | README does not claim GUI-first product support |
|
|
146
|
+
|
|
147
|
+
For a deeper boundary matrix, see [CLI General Assistant Capability Matrix](docs/cli-general-assistant-capability-matrix.md).
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
<a id="modes-and-longagent"></a>
|
|
152
|
+
## Modes & LongAgent / 模式与 LongAgent
|
|
153
|
+
|
|
154
|
+
### Public lanes / 公开执行航道
|
|
155
|
+
|
|
156
|
+
| Mode | Purpose | Typical use |
|
|
157
|
+
| --- | --- | --- |
|
|
158
|
+
| `assistant` | default personal assistant | local files, logs, system checks, web lookup, Git/GitHub, notes, tasks |
|
|
159
|
+
| `plan` | specification / planning | producing an execution plan before mutations |
|
|
160
|
+
| `agent` / `code` / `coding` | dedicated coding execution | inspect + patch + verify small/medium coding tasks |
|
|
161
|
+
| `longagent` | staged orchestration | multi-file, multi-step, ownership-driven delivery |
|
|
162
|
+
|
|
163
|
+
**English**
|
|
164
|
+
- `assistant` is the default terminal personal-assistant lane.
|
|
165
|
+
- `agent` / `code` / `coding` is the dedicated coding lane.
|
|
166
|
+
- Only escalate to `longagent` when the task is clearly multi-stage or system-wide.
|
|
167
|
+
- Interrupted work can be resumed with the same session context.
|
|
168
|
+
|
|
169
|
+
**中文**
|
|
170
|
+
- `assistant` 是默认的终端个人助手航道。
|
|
171
|
+
- `agent` / `code` / `coding` 是专门编码航道。
|
|
172
|
+
- 只有在任务明显跨文件、跨阶段、影响面较大时,才建议升级到 `longagent`。
|
|
173
|
+
- 中断后的工作可以在同一会话中继续,不需要从零开始。
|
|
174
|
+
- **路由理由可见**:当 kkcode 自动建议模式变化时,会尽量解释为什么当前任务更适合留在 `assistant` / `agent` 或升级到 `longagent`。
|
|
175
|
+
|
|
176
|
+
### CLI 通用助手能力边界(0.1.13)
|
|
177
|
+
|
|
178
|
+
**公共模式契约**
|
|
179
|
+
|
|
180
|
+
- `assistant`:默认终端个人助手航道,承接本地文件、日志、系统信息、网页查询、Git/GitHub、笔记、任务整理、解释、答疑和分析。
|
|
181
|
+
- `plan`:**只产出规格,不执行文件变更**。
|
|
182
|
+
- `agent` / `code` / `coding`:专门编码航道,承接 inspect / patch / verify 小闭环事务。
|
|
183
|
+
- **只有出现明确重型证据时,才从 `assistant` 或 `agent` 升级到 `longagent`**。
|
|
184
|
+
|
|
185
|
+
**能力边界速览**
|
|
186
|
+
- 系统 / 运行时信息
|
|
187
|
+
- 本地目录 / 文件 / 日志检查
|
|
188
|
+
- 仓库 / 发布辅助
|
|
189
|
+
- 这**不代表** kkcode 已经承诺 GUI / 桌面自动化能力
|
|
190
|
+
- 默认先在 `assistant` 内处理普通终端事务;明确编码修改进入 `agent` / `code`,再判断是否需要升级
|
|
191
|
+
|
|
192
|
+
**Further reading / 延伸阅读**
|
|
193
|
+
- [0.1.13 Mode Lane Contract](docs/kkcode-0.1.13-mode-lane-contract.md)
|
|
194
|
+
- [Agent Mode Tolerance Contract](docs/kkcode-0.1.12-agent-mode-tolerance-contract.md)
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
<a id="safety-and-permissions"></a>
|
|
199
|
+
## Safety & Permissions / 权限与安全
|
|
200
|
+
|
|
201
|
+
**English**
|
|
202
|
+
- kkcode uses a policy-driven permission model with optional approvals.
|
|
203
|
+
- Session-scoped grants can reduce repeated prompts while preserving boundaries.
|
|
204
|
+
- Budget and usage controls are designed to keep long-running sessions governable.
|
|
205
|
+
|
|
206
|
+
**中文**
|
|
207
|
+
- kkcode 使用策略驱动的权限模型,并可叠加交互式审批。
|
|
208
|
+
- 会话级授权缓存可减少重复确认,同时保持边界清晰。
|
|
209
|
+
- 预算与用量控制让长会话、长任务仍然处于可治理状态。
|
|
210
|
+
|
|
211
|
+
**Policy examples / 策略示例**
|
|
212
|
+
- `permission.default_policy: ask | allow | deny`
|
|
213
|
+
- rule-based overrides by tool / mode / file pattern / command prefix
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
<a id="delegation-and-subagents"></a>
|
|
218
|
+
## Delegation & Subagents / 委派与子智能体
|
|
219
|
+
|
|
220
|
+
**English**
|
|
221
|
+
- kkcode supports bounded delegation through the `task` surface.
|
|
222
|
+
- Use `fresh_agent` for isolated implementation work.
|
|
223
|
+
- Use `fork_context` for read-only sidecar work such as research or verification.
|
|
224
|
+
- Do not outsource core understanding when the main thread must synthesize the result.
|
|
225
|
+
|
|
226
|
+
**中文**
|
|
227
|
+
- kkcode 通过 `task` 能力支持有边界的委派。
|
|
228
|
+
- `fresh_agent` 适合隔离实现任务。
|
|
229
|
+
- `fork_context` 适合研究、审计、验证这类只读 sidecar 任务。
|
|
230
|
+
- 如果主线程必须综合判断,就不要把理解工作本身外包出去。
|
|
231
|
+
|
|
232
|
+
**Background task contract / 后台任务契约**
|
|
233
|
+
- 通过 `background_output` 查看后台任务输出
|
|
234
|
+
- 通过 `background_cancel` 取消后台任务
|
|
235
|
+
- 终态固定为 `completed` / `cancelled` / `error` / `interrupted`
|
|
236
|
+
|
|
237
|
+
**Further reading / 延伸阅读**
|
|
238
|
+
- [Task Delegation Contract Matrix](docs/task-delegation-contract-matrix.md)
|
|
239
|
+
- [Agent / LongAgent Extension Guide](docs/agent-longagent-compat-extension-guide.md)
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
<a id="integrations"></a>
|
|
244
|
+
## Integrations / 集成
|
|
245
|
+
|
|
246
|
+
### MCP
|
|
247
|
+
- Discover local MCP definitions and mount tools into the runtime.
|
|
248
|
+
- Inspect registered MCP servers from the CLI.
|
|
249
|
+
- Use MCP as part of the same governed tool surface.
|
|
250
|
+
|
|
251
|
+
### GitHub
|
|
252
|
+
- Authenticate, inspect repositories, and run GitHub-related flows from the terminal.
|
|
253
|
+
- Repository helpers live under `src/github/`.
|
|
254
|
+
|
|
255
|
+
### Git automation
|
|
256
|
+
- Local git-aware helpers support safe status, patch, and snapshot workflows.
|
|
257
|
+
- See [GIT_AUTO_USAGE.md](docs/GIT_AUTO_USAGE.md).
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
<a id="extensions"></a>
|
|
262
|
+
## Extensions / 扩展机制
|
|
263
|
+
|
|
264
|
+
**Local-first extension surface / 本地优先扩展面**
|
|
265
|
+
- commands
|
|
266
|
+
- skills
|
|
267
|
+
- agents
|
|
268
|
+
- tools
|
|
269
|
+
- hooks
|
|
270
|
+
- plugin manifests
|
|
271
|
+
|
|
272
|
+
**Directory conventions / 目录约定**
|
|
273
|
+
- `.kkcode/commands/`
|
|
274
|
+
- `.kkcode/skills/`
|
|
275
|
+
- `.kkcode/agents/`
|
|
276
|
+
- `.kkcode/tools/`
|
|
277
|
+
- `.kkcode/plugins/`
|
|
278
|
+
- `.kkcode/hooks/`
|
|
279
|
+
- `.kkcode-plugin/plugin.json`
|
|
280
|
+
|
|
281
|
+
**English**
|
|
282
|
+
- kkcode’s extension story is local-first and explicit.
|
|
283
|
+
- Plugins are currently an MVP surface, not a marketplace platform promise.
|
|
284
|
+
|
|
285
|
+
**中文**
|
|
286
|
+
- kkcode 的扩展机制是本地优先、显式可控的。
|
|
287
|
+
- 当前插件能力是 MVP,不代表已经承诺 marketplace 平台形态。
|
|
288
|
+
|
|
289
|
+
**Further reading / 延伸阅读**
|
|
290
|
+
- [ClaudeNext Agent / LongAgent Skills Compatibility](docs/claudenext-agent-longagent-skills-compat.md)
|
|
291
|
+
- [Agent / LongAgent Extension Guide](docs/agent-longagent-compat-extension-guide.md)
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
<a id="tui-and-cli-reference"></a>
|
|
296
|
+
## TUI & CLI Reference / TUI 与命令参考
|
|
297
|
+
|
|
298
|
+
### Common TUI slash commands / 常用 TUI slash 命令
|
|
299
|
+
- `/help` — show help
|
|
300
|
+
- `/status` — show runtime and operator status
|
|
301
|
+
- `/commands` — inspect command / skill / capability surface
|
|
302
|
+
- `/reload` — reload commands, skills, and agents
|
|
303
|
+
- `/new`, `/resume`, `/history` — session lifecycle
|
|
304
|
+
- `/provider`, `/model` — provider/model switching
|
|
305
|
+
- `/permission` — permission policy management
|
|
306
|
+
- `/create-skill`, `/create-agent` — generate local extensions
|
|
307
|
+
|
|
308
|
+
**Interrupt semantics / 中断语义**
|
|
309
|
+
- `Esc` 可用于**中断当前 turn**、退出部分选择态或拒绝当前交互式请求,具体行为取决于当前上下文。
|
|
310
|
+
|
|
311
|
+
### Main CLI commands / 主要 CLI 子命令
|
|
312
|
+
- `chat`
|
|
313
|
+
- `session`
|
|
314
|
+
- `background`
|
|
315
|
+
- `agent`
|
|
316
|
+
- `longagent`
|
|
317
|
+
- `mcp`
|
|
318
|
+
- `skill`
|
|
319
|
+
- `config`
|
|
320
|
+
- `doctor`
|
|
321
|
+
- `usage`
|
|
322
|
+
- `review`
|
|
323
|
+
- `audit`
|
|
324
|
+
|
|
325
|
+
Run `kkcode --help` or `kkcode <command> --help` for the full surface.
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
<a id="configuration-and-project-layout"></a>
|
|
330
|
+
## Configuration & Project Layout / 配置与项目结构
|
|
331
|
+
|
|
332
|
+
### Key config themes / 关键配置主题
|
|
333
|
+
- provider/model selection
|
|
334
|
+
- permission and trust policy
|
|
335
|
+
- agent / longagent behavior
|
|
336
|
+
- usage and budget limits
|
|
337
|
+
- UI / theme settings
|
|
338
|
+
- MCP and extension loading
|
|
339
|
+
|
|
340
|
+
### Project structure / 项目结构
|
|
341
|
+
- `src/repl.mjs` — main REPL assembly surface
|
|
342
|
+
- `src/repl/` — extracted REPL seams
|
|
343
|
+
- `src/ui/` — REPL panels and render helpers
|
|
344
|
+
- `src/session/` — execution loop, memory, recovery, prompts
|
|
345
|
+
- `src/orchestration/` — background and longagent orchestration
|
|
346
|
+
- `src/skill/`, `src/plugin/`, `src/mcp/` — extension systems
|
|
347
|
+
|
|
348
|
+
**Useful docs / 推荐文档**
|
|
349
|
+
- [Example config](docs/config.example.yaml)
|
|
350
|
+
- [REPL roadmap](docs/repl-roadmap-0.1.27-0.1.36.md)
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
<a id="updates"></a>
|
|
355
|
+
## Updates / 更新
|
|
356
|
+
|
|
357
|
+
KKCode checks npm dist-tags in the background on startup and caches the result under `~/.kkcode/update-state.json`. By default it only prints a notice; it does not modify your global install unless you explicitly run the updater.
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
kkcode update --check
|
|
361
|
+
kkcode update --install --channel latest
|
|
362
|
+
kkcode update --install --channel preview
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
Config:
|
|
366
|
+
|
|
367
|
+
```yaml
|
|
368
|
+
update:
|
|
369
|
+
enabled: true
|
|
370
|
+
notify_on_startup: true
|
|
371
|
+
auto_install: false
|
|
372
|
+
channel: "latest"
|
|
373
|
+
check_interval_hours: 12
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
<a id="release-status"></a>
|
|
377
|
+
## Release Status / 发布状态
|
|
378
|
+
|
|
379
|
+
**Current preview / 当前预览版本**: `v0.2.3-preview.1`
|
|
380
|
+
**Latest releases / 最新发布**: [GitHub Releases](https://github.com/kkelly-offical/kkcode/releases)
|
|
381
|
+
**Package / 包地址**: [npm](https://www.npmjs.com/package/@kkelly-offical/kkcode)
|
|
382
|
+
|
|
383
|
+
**English**
|
|
384
|
+
- `0.2.3-preview.1` is the Preview V1 updater release: kkcode can check npm dist-tags at startup and exposes `kkcode update` for manual upgrades.
|
|
385
|
+
- `0.2.1` rebuilt kkcode around Assistant as the default general-purpose lane, with dedicated Agent and LongAgent modes for coding work.
|
|
386
|
+
|
|
387
|
+
**中文**
|
|
388
|
+
- `0.2.3-preview.1` 是 Preview V1 更新器版本:kkcode 可在启动时检查 npm dist-tag,并提供 `kkcode update` 手动升级入口。
|
|
389
|
+
- `0.2.1` 将 kkcode 重构为以 Assistant 为默认入口的通用个人助手,同时保留专门面向代码工作的 Agent 和 LongAgent 模式。
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
<a id="compatibility-limits-and-roadmap"></a>
|
|
394
|
+
## Compatibility, Limits & Roadmap / 兼容性、边界与路线图
|
|
395
|
+
|
|
396
|
+
**What this README does claim / 本 README 明确声明的能力**
|
|
397
|
+
- terminal-native coding workflows
|
|
398
|
+
- governed execution and permissions
|
|
399
|
+
- staged LongAgent orchestration
|
|
400
|
+
- MCP and local extension surfaces
|
|
401
|
+
- session/background/task visibility
|
|
402
|
+
|
|
403
|
+
**What this README does not promise / 本 README 不承诺的能力**
|
|
404
|
+
- GUI-first product workflows
|
|
405
|
+
- IDE-native UX parity
|
|
406
|
+
- desktop automation platform behavior
|
|
407
|
+
- marketplace-style plugin ecosystem
|
|
408
|
+
|
|
409
|
+
**Roadmap references / 路线图参考**
|
|
410
|
+
- [REPL roadmap 0.1.27 → 0.1.36](docs/repl-roadmap-0.1.27-0.1.36.md)
|
|
411
|
+
- [kkcode vs claudenext compatibility notes](docs/kkcode-vs-claudenext-private-agent-longagent-compat.md)
|
|
412
|
+
- [kkcode vs claudenext report](docs/kkcode-vs-claudenext-private-agent-longagent-report.md)
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
<a id="faq"></a>
|
|
417
|
+
## FAQ / 常见问题
|
|
418
|
+
|
|
419
|
+
**Q: When should I use `longagent`? / 什么时候该用 `longagent`?**
|
|
420
|
+
A: Use it when the task is clearly multi-stage, cross-file, or needs ownership/gates. Ordinary terminal assistance should stay in `assistant`; small coding inspect/patch/verify loops should stay in `agent` / `code`.
|
|
421
|
+
|
|
422
|
+
**Q: Can kkcode work with multiple providers? / kkcode 支持多模型厂商吗?**
|
|
423
|
+
A: Yes. Provider switching is built into config and the REPL command surface.
|
|
424
|
+
|
|
425
|
+
**Q: Can I extend kkcode locally? / 可以本地扩展吗?**
|
|
426
|
+
A: Yes. Commands, skills, hooks, tools, agents, and plugin manifests all have local-first support.
|
|
427
|
+
|
|
428
|
+
**Q: Does kkcode promise GUI or IDE parity? / 是否承诺 GUI 或 IDE 对等体验?**
|
|
429
|
+
A: No. This release line is CLI-first and does not overclaim GUI-first capability.
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
<a id="contributing"></a>
|
|
434
|
+
## Contributing / 贡献
|
|
435
|
+
|
|
436
|
+
**English**
|
|
437
|
+
- Keep changes small, testable, and reviewable.
|
|
438
|
+
- Run validation before pushing:
|
|
439
|
+
- `npm run lint`
|
|
440
|
+
- `npm run typecheck`
|
|
441
|
+
- `node ./scripts/run-node-tests.mjs`
|
|
442
|
+
- `npm run release:verify`
|
|
443
|
+
|
|
444
|
+
**中文**
|
|
445
|
+
- 贡献尽量保持小步、可验证、可审阅。
|
|
446
|
+
- 推送前建议至少运行:
|
|
447
|
+
- `npm run lint`
|
|
448
|
+
- `npm run typecheck`
|
|
449
|
+
- `node ./scripts/run-node-tests.mjs`
|
|
450
|
+
- `npm run release:verify`
|
|
451
|
+
|
|
452
|
+
欢迎中英双语 issue / PR。
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
<a id="license"></a>
|
|
457
|
+
## License / 许可证
|
|
458
|
+
|
|
459
|
+
kkcode is licensed under **GPL-3.0**.
|
|
460
|
+
See [LICENSE](LICENSE) for the full text.
|
|
461
|
+
|
|
462
|
+
---
|
|
463
|
+
|
|
464
|
+
<a id="further-reading"></a>
|
|
465
|
+
## Further Reading / 延伸阅读
|
|
466
|
+
|
|
467
|
+
- [CLI General Assistant Capability Matrix](docs/cli-general-assistant-capability-matrix.md)
|
|
468
|
+
- [0.1.13 Mode Lane Contract](docs/kkcode-0.1.13-mode-lane-contract.md)
|
|
469
|
+
- [Task Delegation Contract Matrix](docs/task-delegation-contract-matrix.md)
|
|
470
|
+
- [Agent / LongAgent Extension Guide](docs/agent-longagent-compat-extension-guide.md)
|
|
471
|
+
- [ClaudeNext Agent / LongAgent Skills Compatibility](docs/claudenext-agent-longagent-skills-compat.md)
|
|
472
|
+
- [REPL roadmap 0.1.27 → 0.1.36](docs/repl-roadmap-0.1.27-0.1.36.md)
|
|
473
|
+
- [Git automation usage](docs/GIT_AUTO_USAGE.md)
|
|
474
|
+
- [Edit diagnostics feedback contract](docs/edit-diagnostics-feedback-contract.md)
|